-
Is there a way to directly plot a displacement field (including any auxilary info such as corresponding nodes, dofs) available as a numpy vector(s) in python on the mesh that pymapdl has (eg. after resuming from a db) directly without performing any analysis inside mapdl? |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 6 replies
-
Hi @AnsMainak for this purpose, I would recommend using PyDPF Core. The data can be inserted in a field and this field can be plotted on the mesh. |
Beta Was this translation helpful? Give feedback.
-
Hi @AnsMainak There could be several answers here depending on some details of the actual numpy vector. And in addition to using using PyDPF core as @pmaroneh suggested. Do the numpy vector values correspond 1-to-1 to nodes in the MAPDL mesh? If so then we can get the MAPDL mesh as a VTK UnstructuredGrid object, then use PyVista to visualize the numpy vector data. There is an example of this in this PyMAPDL Doc Example: If there is not a 1-to-1 correspondence then you could map the numpy displacement field onto the MAPDL mesh...which again can be done then visualized via PyVista. Mike |
Beta Was this translation helpful? Give feedback.
Hi @AnsMainak There could be several answers here depending on some details of the actual numpy vector. And in addition to using using PyDPF core as @pmaroneh suggested. Do the numpy vector values correspond 1-to-1 to nodes in the MAPDL mesh? If so then we can get the MAPDL mesh as a VTK UnstructuredGrid object, then use PyVista to visualize the numpy vector data. There is an example of this in this PyMAPDL Doc Example:
https://mapdldocs.pyansys.com/examples/00-mapdl-examples/transient_thermal.html#sphx-glr-examples-00-mapdl-examples-transient-thermal-py
Scroll down to the "Visualize a Slice" section. Of course you can visualize the whole model and not just a slice but it shows the genera…