Forum Message

 

 

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.

Notice

The forum is in read only mode.

integrals and normals on subdomain boundaries

More
4 years 11 months ago #1641 by NilsHM
Hello Joachim!

Thank you for the example. I now understand better what the BoundaryFromVolumeCoefficientFunction does.

I want to integrate the vector product of a vector field and the normal vectors over the domain boundary. Doing that I get strange results.

During some trial and error I found out that the result changes a lot when changing the finite element space of the GridFunction you give BoundaryFromVolumeCF. I made a small example file demonstrating that. By my understanding the Integral result should be the same, but I get:
CF Integral = -2.081668171172171e-17
H-Vec Integral = 7.816576618000729
H-Curl Integral = -2.0173882950217807
H-Div Integral = -0.20501329559045756

I mainly work with complex HCurl finite element spaces and in my application the result is nan, witch a vector product can not cause.

Can you clarify these results for me?
Thanks in advance.
More
4 years 11 months ago #1642 by joachim
don't use -dim=3 with H(curl), H(div) or VectorH1, they are already vectorial. Otherwise, you create 3 copies of H(curL) ...
Code:
fesVec = VectorH1(mesh, order=2) # , dim = 3) fesCurl = HCurl(mesh, order=2) # , dim = 3) fesDiv = HDiv(mesh, order=2) # , dim = 3)
The following user(s) said Thank You: NilsHM
More
4 years 11 months ago - 4 years 11 months ago #1643 by NilsHM
Hello Joachim!

Thank you for the clarification.

I still have a problem when using a CoefficientFunction that is the curl of a GridFunction (e.i. the solution of the fe-problem). I made a simple exaple file. When I run it I get the error

print("curl Integral = ", Integrate(Norm(bfcurl*bfv_normals), mesh, definedon=mesh.Boundaries("innerbnd")))

NgException: BaseVector<Complex>::GetIndirect<double> called

which is not very helpful. Do you have a solution to that?
Last edit: 4 years 11 months ago by NilsHM.
Time to create page: 0.169 seconds