Skip to content

Measure relative distance between bodies/mesh-bodies #3410

Answered by germa89
derne058 asked this question in Q&A
Discussion options

You must be logged in to vote

Hi @derne058

If you want to use Pyvista meshes to calculate the distance, you will have to obtain the mesh of the deformed and undeformed elements.

from ansys.mapdl.core import launch_mapdl
mapdl = launch_mapdl()

# define your model
undef_mesh = mapdl.mesh.grid

# Solve your model
mapdl.solution()
mapdl.antype("static")
# more options...

mapdl.solve()

# Updating mesh
mapdl.post1()
mapdl.set('last')
mapdl.upcoord(1)
deformed_mesh = mapdl.mesh.grid

# Use pyvista to compare distances

I think the approach is decent. Hopefully @mikerife agrees with me, he is the expert.

Related:

Replies: 1 comment 2 replies

Comment options

You must be logged in to vote
2 replies
@derne058
Comment options

@mikerife
Comment options

Answer selected by germa89
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants