We have moved the forum to https://forum.ngsolve.org. This is an archived version of the topics until 05/05/23. All the topics were moved to the new forum and conversations can be continued there. This forum is just kept as legacy to not invalidate old links. If you want to continue a conversation just look for the topic in the new forum.
I would like to solve some Helmholtz equations (complex-valued) with ngsxfem package (X-FEM) method.
As I know, the level set function is interpolated in real valued H1 FE space, but the solution of the Helmholtz problem is approximated in the complex H1 space such Vh = H1(mesh, order, complex=True). Thus, there will be some conflicts?
I was coding such a problem (for example modified the unf_interf_prob.py by Helmholtz equation in the demos) and I did not get the expected solution, so I am in doubt if ngsxfem is able to treat such a problem.
Another problem is in the ngsxfem, to integrate the Neumann BC on a specific boundary, we can not use the common symbol such f = g *v * ds("left|right") with the label of the boundary, we have to use dCut (Cut differential symbol ? If it is necessary, how can we define a specific boundary by dCut ?
Looking forward to your reply and thanks very much
Shaoqi
dCut is a differential symbol to integrate over domains defined by a level set function. Depending on which domain_type (NEG,IF,POS) you give dCut, you will integrate over the region where the level set function is negative , zero or positive respectively. My guess is that with your ds("left|right") you are trying to integrate on a mesh boundary rather than a level set interface, right? This then does not need any ngsxfem functionality.
Best wishes,
Henry
PS: Try to provide a minimal working example of any problems you have, since it it otherwise very difficult to answer questions.
Sorry to bother you, I have another question concerning the boundaries on the levelset domain.
I want to impose the BCs on each outer boundary separated by the level set function like BC1 and BC2 respectively in attached figure (a figure attached)
[attachment=undefined]bconlevelset.jpg[/attachment]
This kind of BCs can not be imposed directly by the label of the boundary since for example the top and bottom bc will be assigned with two different condition.
It seems that the dCut symbol have to be used to assign these two boundaries with NEG and POS label. I knew how to define the subdomain with dCut, but confused with this kind of "sub boundaries" .
I saw in some tutorial, we can use GetFacetsWithNeighborTypes(mesh,a=ci.GetElementsOfType(HASNEG),
b=ci.GetElementsOfType(IF))
to define some boundary, but I am not sure it works in my case.