internal surface using gmsh

Asked by Louise Olsen-Kettle

I am using gmsh to create a mesh with internal surfaces. I would like to integrate the stress, Sigma_xx, over this internal surface. If I add this surface as a Physical Surface in the gmsh file will this be a problem? Are Physical Surfaces for 3D meshes allowed to be internal surfaces for eScript? And can I integrate over this surface using FunctionOnBoundary?

Thanks.

Question information

Language:
English Edit question
Status:
Solved
For:
esys-escript Edit question
Assignee:
No assignee Edit question
Solved by:
Lutz Gross
Solved:
Last query:
Last reply:

This question was reopened

Revision history for this message
Adam Ellery (aellery) said :
#1

Hi Louise,

Adding this surface as a Physical Surface in gmsh should not affect escript in any way. You should still be able to load your mesh. However, if you wish to integrate over this surface, you should not use the functionspace "FunctionOnBoundary". Instead, you should use the functionspace "Function".

- Adam

Revision history for this message
Louise Olsen-Kettle (lokettle) said :
#2

Thanks Adam, I can see the surface in the mesh without having it as a Physical Surface. If I'm integrating over Function not FunctionOnBoundary do I need to label it as a Physical Space? My understanding is that labelling it as a Physical Surface sets it as an external boundary in eScript. Is this right?

Revision history for this message
Adam Ellery (aellery) said :
#4

-If I'm integrating over Function not FunctionOnBoundary do I need to label it as a Physical Space?
No, labelling it as a Physical Surface should work fine.

-My understanding is that labelling it as a Physical Surface sets it as an external boundary in eScript. Is this right?
No. eScript will not treat the surface as an external boundary if it is within the interior of the domain.

Revision history for this message
Louise Olsen-Kettle (lokettle) said :
#5

Thanks Adam Ellery, that solved my question.

Revision history for this message
Lutz Gross (l-gross) said :
#6

I would like to add that if you like to integrate over the interface this works for nodal values only. Stresses for instance need to be projected back to nodes first.

Revision history for this message
Louise Olsen-Kettle (lokettle) said :
#7

Thanks Lutz, and my understanding is that this needs to be labelled as a Physical Surface in gmsh first? Thanks.

Revision history for this message
Louise Olsen-Kettle (lokettle) said :
#8

Can I quickly check how I would set a mask for the internal Physical Surface created that I want to integrate over:

In gmsh I have a Physical Surface labelled: PSSideTarget_1

which is the 2D surface at x= -R00

Would this work or is there a better way to do it which directly references the tagged name: PSSideTarget_1?

mesh = mydomain.getX()

Tag_x_fixed_BC_output = whereZero(mesh[0]+R00)

stress00_nodes=proj(stress[0,0])

Average_orthogonal_stress_xx_Fixed_bc = integrate(stress00_nodes*Tag_x_fixed_BC_output)/integrate(Tag_x_fixed_BC_output)

I guess the second question is does the mask Tag_x_fixed_BC_output give back a surface or 3D volume? It would be preferable to get the stress only on the physical surface labelled PSSideTarget_1 at x=-R00.

Revision history for this message
Louise Olsen-Kettle (lokettle) said :
#9

Hi Lutz and Adam,

I tried to check that the tagged interior surface came up with the same area as the analytical value. But there is a problem where the numerical value is much less than the analytical result:

Tag_x_Target_output = whereZero(mesh[0]+R00)

Tag_x_Target_output_nodes=proj(Tag_x_Target_output)

Numerical_Target_Surface_area = integrate(Tag_x_Target_output_nodes)

I can send images by email of the tagged region Tag_x_Target_output_nodes for you to look at.

Revision history for this message
Lutz Gross (l-gross) said :
#10

I assume that Tag_x_Target_output are already data hold on nodes (mesh[0]=domain.getx()?).
The projection then would not change anything (or more likely smooth the values on nodes with x=-R00 over a wider area).
The integrate actually interpolates back to element quadrature points. At this moment the function looses its mask characteristics. and the surface area becomes wrong.

I guess what you want to do is

Target_output=<data on elements> # eg. s=grad(u)
Tag=<mask of face elements to be integrated over>

Target_output_nodes=proj(Target_output)
Intergral_Target_Over_Surface_Area = integrate(interpolate(Target_output_nodes, FunctionOnBoundary(dom))*Tag)

the interpolation can be dropped as Tag is already on boundaries.

If you set Target_output=1 you will get the area. It is my understanding that you already did this.

Revision history for this message
Louise Olsen-Kettle (lokettle) said :
#11

Hi Lutz,

The solution didn't seem to work either:

x_boundary=FunctionOnBoundary(mydomain).getX()

Tag_x_Target_surface = whereZero(x_boundary[0]+R00)

Numerical_Target_Surface_area = integrate(interpolate(1.,FunctionOnBoundary(mydomain))*Tag_x_Target_surface)

I tried to follow your instructions.

Should x_boundary just be:

x_boundary = FunctionOnBoundary(mydomain)

Thanks!

Revision history for this message
Best Lutz Gross (l-gross) said :
#12

Most likely the difference is caused by the fact that the numerical integration scheme for triangles uses quadrature points located at triangle edges. This means that whereZero(x_boundary[0]+R00) will assign the value 1 not only to quadrature points on the element on the target surface but also to some quadrature points located in elements sharing an edge with the target surface.
There are two options overcome this

a) use tagging which is always the recommended way to identify surfaces or subdomain.

or

b) use the center of the face element. This can be done by using "x_boundary=ReducedFunctionOnBoundary(mydomain).getX()"

Revision history for this message
Louise Olsen-Kettle (lokettle) said :
#13

Thanks Lutz, that works now with tagging.

Revision history for this message
Louise Olsen-Kettle (lokettle) said :
#14

Thanks Lutz Gross, that solved my question.