formulation and high order Lagrange
Dear Anthony,
I am facing a couple issues and have new questions about my previous grating example (attachedgrating2D.cpp).
- The commented formmulation in the attached code was working fine in gmshfem @ commit 1b257f97, and now it fails without error (getting nans), likely during assembly. I managed to fix it by packing most of the elementary operation (* and /) of the formulation into "piecewise objects" as ScalarPiecewiseFunction. More precisely, the old verbose version :
formulation.integral(-1./mur * grad(dof(u2d)), grad(tf(u2d)) , volscat | volsubs | volsuper , gauss);
formulation.integral(-PML_T_inv * grad(dof(u2d)), grad(tf(u2d)) , volpmls , gauss);
fails where the following works :
TensorPiecewiseFunction< Complex > inv_mur_tilde;
inv_mur_tilde.addFunction(PML_T_inv,volpmls);
inv_mur_tilde.addFunction(TensorId , volscat | volsubs | volsuper);
formulation.integral(-inv_mur_tilde * grad(dof(u2d)) , grad(tf(u2d)) , omega , gauss);
-
There is something off with P3 Lagrange order 3 (+ periodic conditions?): the attached example converges nicely (I'm computing the Fresnel reflexion/transmission coefficients of a plane wave onto a dielectric interface so R+T shoud be ~1) with order=1 and order=2 and gives wrong results for order>=3...
-
a detail : the example uses
userDefinedParameter
to conviniently set common line arguments. The arguments are nicely taken into account, but I'm getting warnings at the end of the program output :
WARNING! There are options you set that were not used!
WARNING! could be spelling mistake, etc!
There are 3 unused database options. They are:
Option left: name:-...
- Is there a way to set the FEM interpolation order independently of the geometric order (eg P2 or P3 with order 1 planar elements)? For now the FEM order follows the geo one by using "gmsh::model::mesh::setOrder(order);"
Sorry, that's quite a lot of questions !? Of course I can make more tests if you need !
Kind regards, Guillaume