Dear Ross,
First question that comes to mind: did you check the error on the Dirichlet boundary? Is it zero or converging with the right order?
Best,
Guido
--
The deal.II project is located at http://www.dealii.org/
For mailing list/forum options, see https://groups.google.com/d/forum/dealii?hl=en
---
You received this message because you are subscribed to the Google Groups "deal.II User Group" group.
To unsubscribe from this group and stop receiving emails from it, send an email to dealii+un...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Dear Ross,
If you see and are sure that the tangential component of the solution is wrong, we may not need the error calculation.
Have you checked whether the function that computes the projected values behaves significant different depending on whether it receives one or two Nedelec elements? You may have found a bug here.
Best,
Guido
Best,
fe (FE_Nedelec<dim>(order), 1, FE_Nedelec<dim>(order), 1)
If so - this makes no difference. If you mean reducing the complex-valued problem to a real valued problem so that only a single Nedelec element is required, then yes, I have tried a simple toy problem with non zero Dirichetl BCs - it too had issues with orders > 0. This was a while ago - unfortunately I got sidetracked with some other work at the time. I'll have to dig out the code and tidy it up if you'd like that example as well?
My colleague (supervisor on the EPRSC project I'm a PDRA on) has suggested that the handling of edges and faces in 3D is different to the 2D problem and he suspects there's a bug in the handling of the enforcement of the tangential components too. I'm unsure of where to look in the source code - my C++ knowledge isn't good enough to fully debug the problem.
Cheers
Ross
- Todo:
- Even if this element is implemented for two and three space dimensions, the definition of the node values relies on consistently oriented faces in 3D. Therefore, care should be taken on complicated meshes.
Restriction on transformations
In some sense, the implementation of this element is not complete, but you will rarely notice. Here is the fact: since the element is vector-valued already on the unit cell, the Jacobian matrix (or its inverse) is needed already to generate the values of the shape functions on the cells in real space. This is in contrast to most other elements, where you only need the Jacobian for the gradients. Thus, to generate the gradients of Nédélec shape functions, one would need to have the derivatives of the inverse of the Jacobian matrix.
Basically, the Nédélec shape functions can be understood as the gradients of scalar shape functions on the real cell. They are thus the inverse Jacobian matrix times the gradients of scalar shape functions on the unit cell. The gradient of Nédélec shape functions is then, by the product rule, the sum of first the derivative (with respect to true coordinates) of the inverse Jacobian times the gradient (in unit coordinates) of the scalar shape function, plus second the inverse Jacobian times the derivative (in true coordinates) of the gradient (in unit coordinates) of the scalar shape functions. Note that each of the derivatives in true coordinates can be expressed as inverse Jacobian times gradient in unit coordinates.
The problem is the derivative of the inverse Jacobian. This rank-3 tensor can actually be computed (and we did so in very early versions of the library), but is a large task and very time consuming, so we dropped it. Since it is not available, we simply drop this first term.
What this means for the present case: first the computation of gradients of Nédélec shape functions is wrong in general. Second, in the following two cases you will not notice this:
- If the cell is a parallelogram, then the usual bi-/trilinear mapping is in fact affine. In that case, the gradient of the Jacobian vanishes and the gradient of the shape functions is computed exactly, since the first term is zero.
- With the Nédélec elements, you will usually want to compute the curl, not the general derivative tensor. However, the curl of the Jacobian vanishes, so for the curl of shape functions the first term is irrelevant, and the curl will always be computed correctly even on cells that are not parallelograms.
Hi all,I'm solving a complex-valued vector-wave equation (the curl-curl formulation of the Maxwell equations):curl(curl(E)) + kappa*E=0with BCs given byn x E = g on \Gamma_D (Dirichlet)n x curl(E) = h on \Gamma_N (Neumann)note, I've set mu =1 for this problem.the wave propagation solution is given by:E = p*exp(i*k*x), x, k and p in R^3with p orthogonal to k, |k| < 1, |p|=1.I've chosen k=(-0.1 -0.1, 0.2) and p=(1/sqrt(3))*[1 1 1].I've implemented this for both Neumann and Dirichet BCs using Nedelec elements and splitting the system into real/imaginary parts. I am seeing the correct rates of convergence in the L2 and H(curl) norms of the error for the Neumann version with both h and p refinement.However, when using Dirichlet BCs, after p=0, something seems to go wrong. Am I enforcing the boundary conditions correctly for the project_boundary_values_curl_conforming routine? - I have a function with dim+dim components, with the first dim(3) being the real part and the latter dim being the imaginary part - is this the correct way to do this?I've included an example with Dirichlet BCs, although if you uncomment the 666-678 in the code then the boundaries will be changed to Neumann. It takes the polynomial order as input, so run it with "./wave_propagation -p 2" for order 2 elements, etc.For comparison, here are the results when I've run the code p=0,1,2 - using a direct solver for now, so going above p=2 causes memory problems, also runtime increases due to the slow generation of the Nedelec elements at higher orders.Thanks,RossDirichlet:./wave_propagation -p 0cycle cells dofs L2 Error H(curl) Error0 8 108 1.15904018e-01 1.24176508e-011 64 600 5.77896943e-02 6.19578648e-022 512 3888 2.88743606e-02 3.09624645e-02./wave_propagation -p 1cycle cells dofs L2 Error H(curl) Error0 8 600 8.35079734e-01 2.59980668e+001 64 3888 7.93792725e-01 3.36290438e+002 512 27744 7.77603612e-01 4.42928910e+00./wave_propagation -p 2cycle cells dofs L2 Error H(curl) Error0 8 1764 8.20717491e-01 2.50234579e+001 64 12168 7.87196814e-01 3.17447088e+002 512 90000 7.74601489e-01 4.11893779e+00Neumann:./wave_propagation -p 00 8 108 1.15471804e-01 1.23771671e-011 64 600 5.77352583e-02 6.19069021e-022 512 3888 2.88675425e-02 3.09560822e-02./wave_propagation -p 1cycle cells dofs L2 Error H(curl) Error0 8 600 2.58268149e-03 2.79282760e-031 64 3888 6.45549584e-04 6.98219104e-042 512 27744 1.61377755e-04 1.74553607e-04./wave_propagation -p 2cycle cells dofs L2 Error H(curl) Error0 8 1764 4.17828432e-05 4.53286783e-051 64 12168 5.22313050e-06 5.66700077e-062 512 90000 6.52897524e-07 7.08401532e-07