
He wanted to define some properties with respect to time and his rotational speed and wanted to know how hard it would be to write a custom routine in ANSYS to do that. Mapdl.I was having a discussion with a user who is very experienced with a FEA tool other than ANSYS. Mapdl.aplot(na1, na2, ninc, degen, scale.) Pl.show() # Plot the currently selected elements


Plotting is interpolated with PyVista by saving the resulting stress and storing within the underlying UnstructureGrid pl = pyvista.Plotter() Nod_eqv_stress = mapdl.post_processing.nodal_eqv_stress() This class is used for plotting and saving results to NumPy arrays. # Save node numbers of all nodes to array # Save node numbers of selected nodes to array Save element & node numbers to Python arrays. Store the finite element mesh as a VTK UnstrucuredGrid data object. #Runs *VGET command and returns a Python array To access information using GET and VGET directly to NumPy arrays #Runs *GET command and returns a Python value # Create a parameter from a NumPy array nparray To access from or write parameters to MAPDL database # Save a parameter to a NumPy array nparray

Load a table from Python to MAPDL mapdl.load_table(name, array, var1='', var2='', var3='', csysid='') mapdl.solu() # SOLUĬonverting an existing APDL script to PyMAPDL format inputfile = 'ansys_inputfile.inp' In cases where removing " * " or " / " will cause conflict with other commands, a prefix "slash" or "star" is added. For instance, ESEL, s, type, 1 is translated as: mapdl.esel('s', 'type', vmin=1)Ĭommands that start with " * " or " / " have those characters removed. PyMAPDL commands are Python statements that act as a wrapper for APDL commands. To create and exit a pool of instances # To create a pool of 10 instancesįrom import LocalMapdlPool To connect to an existing instance of MAPDL at IP 192.168.1.30 and port 50001. Mapdl = launch_mapdl(nproc=2, run_location=path, jobname=jname) To specify a job name, number of processors, and working directory jname = 'user_jobname' To launch a PyMAPDL instance locally and exit it # To launch an instanceįrom import launch_mapdl

Launching PyMAPDL | PyMAPDL Language | MAPDL Class | Mesh Class | Post-Processing Class | Plotting Class You can jump to a section of your choosing by using these links: This is a quick-reference guide for PyMAPDL.
