getfem-users
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: compute node normal on exterior surface of mesh


From: Konstantinos Poulios
Subject: Re: compute node normal on exterior surface of mesh
Date: Fri, 4 Feb 2022 09:37:16 +0100

Dear Anne-Cecile

It is easy to get averaged normals on a mesh_fem:

m=gf.Mesh("load", "ladder.mesh")
md=gf.Model("real")
m.set_region(99,m.outer_faces())
mf=gf.MeshFem(m,3)
mf.set_classical_fem(1)
U=md.interpolation("Normal",mf,99)
mf.export_to_vtu("normals.vtu", mf, U, "Normals")

image.png

you can then interpolate U on some given points with computer_interpolate_on.

However, I would rather recommend a solution with faces rather than points. Averaging unit vectors leads in general to non-unit vectors. Moreover, points in general do not make sense in a physical world. Surfaces and volumes do. I would recommend you to use the outer_faces_with_direction function. For example with

m.set_region(99,m.outer_faces_with_direction([0,1,0],0.9))

you can define a region with outer normals pointing approximately in the positive Y direction.

Best regards
Kostas



On Thu, Feb 3, 2022 at 12:22 AM Lesage,Anne Cecile J <AJLesage@mdanderson.org> wrote:

Dear all

 

I see in the python documentation that  the mesh class has a function normal_of_face

 

I would like to compute the mean normal at node points (mean of the faces normal to which this point belong) on the exterior surface of the mesh

I have the list of those points id

 

This is to do a direction test for setting boundary conditions

 

Thank you

Regards

Anne-Cecile

 

 

The information contained in this e-mail message may be privileged, confidential, and/or protected from disclosure. This e-mail message may contain protected health information (PHI); dissemination of PHI should comply with applicable federal and state laws. If you are not the intended recipient, or an authorized representative of the intended recipient, any further review, disclosure, use, dissemination, distribution, or copying of this message or any attachment (or the information contained therein) is strictly prohibited. If you think that you have received this e-mail message in error, please notify the sender by return e-mail and delete all references to it and its contents from your systems.

reply via email to

[Prev in Thread] Current Thread [Next in Thread]