- Thank you received: 0
integrals and normals on subdomain boundaries
5 years 5 months ago #1641
by NilsHM
Replied by NilsHM on topic integrals and normals on subdomain boundaries
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.
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.
Attachments:
5 years 5 months ago #1642
by joachim
Replied by joachim on topic integrals and normals on subdomain boundaries
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
5 years 5 months ago - 5 years 5 months ago #1643
by NilsHM
Replied by NilsHM on topic integrals and normals on subdomain boundaries
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?
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?
Attachments:
Last edit: 5 years 5 months ago by NilsHM.
Time to create page: 0.105 seconds