Skip to content

Display results as vectors #2464

Answered by germa89
arun-maniam asked this question in Q&A
Nov 1, 2023 · 1 comments · 3 replies
Discussion options

You must be logged in to vote

Hello @arun-maniam !

You could accomplish that using pyvista:

import pyvista as pv

grid = mapdl.mesh._grid

mapdl.post1()
mapdl.set("last")  # Important! Otherwise the element values are zero.

centers = np.array(grid.cell_centers().points)
scalars = mapdl.post_processing.element_displacement("NORM")  # Just for plotting
direction = np.array(mapdl.post_processing.element_displacement("ALL"))

size_arrow_respect_full_model = 10 # th times smaller
arrow_size = np.mean(centers.max(axis=0) - centers.min(axis=0))/size_arrow_respect_full_model
magnitude = arrow_size/direction.max()

pl = pv.Plotter()
# pl.add_mesh(grid, opacity=0.5, color='grey')  # In case you want to plot the cylinder too
pl.a…

Replies: 1 comment 3 replies

Comment options

You must be logged in to vote
3 replies
@arun-maniam
Comment options

@germa89
Comment options

@arun-maniam
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
2 participants