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.

Unexpected behaviour of FESpace defined on interface

More
4 years 4 months ago #2238 by salim
Dear colleagues,

I am trying to solve an interface problem in mixed form with a Lagrange multiplier on the internal boundary. Using the finite element space

L = L2(mesh, order = order, definedon="", definedonbound="interface")

for the Lagrange multiplier I obtain the error (please see the attached file)

netgen(7069,0x7000061f6000) malloc: *** error for object 0x12b0e4140: pointer being freed was not allocated
netgen(7069,0x7000061f6000) malloc: *** set a breakpoint in malloc_error_break to debug
Caught SIGABRT: usually caused by abort() or assert()

However, with the choice

L = H1(mesh, order = order, definedon="", definedonbound="interface")

everything works fine.

Best regards,
Salim
More
4 years 4 months ago #2239 by christopher
The standard L2 space does not have degrees of freedom at BND elements. You need to use the SurfaceL2 space for this:
Code:
L = SurfaceL2(mesh, order=order, definedon="", definedonbound="interface")
note that you can compute the error against the coefficientfunction itself and you do not need to interpolate it:
Code:
upe = CoefficientFunction([p_top if mat == "top" else p_bottom for mat in mesh.GetMaterials()]) # L2 error err = sqrt(Integrate((upe-glob)*(upe-glob),mesh))

if you want to compare it to the interpolation an easier way would be:
Code:
upe = GridFunction(Vpost, name="exact") upe.Set(CoefficientFunction([p_top if mat == "top" else p_bottom for mat in mesh.GetMaterials()]))

Best
Christopher
More
4 years 4 months ago #2240 by salim
Dear Christopher,

Thank you very much for your help and for the trick that simplifies the calculation of the error.

I take this opportunity to congratulate the entire NGsolve team for the formidable tool they have created. Thank you for making it available to the community.

Best,
Salim
Time to create page: 0.101 seconds