PyVista Mesh IntegrationΒΆ

Run a modal analysis on a mesh generated from pyvista within MAPDL.

# sphinx_gallery_thumbnail_number = 2

import tempfile
import os
import pyvista as pv
from ansys.mapdl.reader import save_as_archive
from ansys.mapdl.core import launch_mapdl

# launch MAPDL as a service
mapdl = launch_mapdl(loglevel='ERROR')

# Create a simple plane mesh centered at (0, 0, 0) on the XY plane
mesh = pv.Plane(i_resolution=100, j_resolution=100)
mesh.plot(color='w', show_edges=True)
pyvista mesh

Out:

[(1.5773502691896262, 1.5773502691896262, 1.5773502691896262),
 (0.0, 0.0, 0.0),
 (0.0, 0.0, 1.0)]

Write the mesh to a temporary file

archive_filename = os.path.join(tempfile.gettempdir(), 'tmp.cdb')
save_as_archive(archive_filename, mesh)

# Read in the archive file
response = mapdl.cdread('db', archive_filename)
mapdl.prep7()
print(mapdl.shpp('SUMM'))

# specify shell thickness
mapdl.sectype(1, "shell")
mapdl.secdata(0.01)
mapdl.emodif('ALL', 'SECNUM', 1)

# specify material properties
# using aprox values for AISI 5000 Series Steel
# http://www.matweb.com/search/datasheet.aspx?matguid=89d4b891eece40fbbe6b71f028b64e9e
mapdl.units('SI')  # not necessary, but helpful for book keeping
mapdl.mp('EX', 1, 200E9)  # Elastic moduli in Pa (kg/(m*s**2))
mapdl.mp('DENS', 1, 7800)  # Density in kg/m3
mapdl.mp('NUXY', 1, 0.3)  # Poissons Ratio
mapdl.emodif('ALL', 'MAT', 1)

# Run an unconstrained modal analysis
# for the first 20 modes above 1 Hz
mapdl.modal_analysis(nmode=20, freqb=1)

# you could have also run:
# mapdl.run('/SOLU')
# mapdl.antype('MODAL')  # default NEW
# mapdl.modopt('LANB', 20, 1)
# mapdl.solve()

Out:

SUMMARIZE SHAPE TESTING FOR ALL SELECTED ELEMENTS

 ------------------------------------------------------------------------------
            <<<<<<          SHAPE TESTING SUMMARY           >>>>>>
            <<<<<<        FOR ALL SELECTED ELEMENTS         >>>>>>
 ------------------------------------------------------------------------------
                    --------------------------------------
                    |  Element count     10000 SHELL181  |
                    --------------------------------------

  Test                Number tested  Warning count  Error count    Warn+Err %
  ----                -------------  -------------  -----------    ----------
  Aspect Ratio              10000              0             0         0.00 %
  Parallel Deviation        10000              0             0         0.00 %
  Maximum Angle             10000              0             0         0.00 %
  Jacobian Ratio            10000              0             0         0.00 %
  Warping Factor            10000              0             0         0.00 %

  Any                       10000              0             0         0.00 %
 ------------------------------------------------------------------------------

'*****  ANSYS SOLVE    COMMAND  *****\n\n *** NOTE ***                            CP =      97.354   TIME= 04:18:47\n There is no title defined for this analysis.                            \n\n *** NOTE ***                            CP =      97.451   TIME= 04:18:47\n No modes are being expanded (MXPAND command) and therefore the element  \n results will not be written to the mode file.  If you do not intend to  \n use mode selection and for more efficient calculation of element        \n results in the expansion pass of any downstream mode superposition      \n analyses, expand all modes during the modal analysis.                   \n\n *** SELECTION OF ELEMENT TECHNOLOGIES FOR APPLICABLE ELEMENTS ***\n                ---GIVE SUGGESTIONS ONLY---\n\n ELEMENT TYPE         4 IS SHELL181. IT IS ASSOCIATED WITH ELASTOPLASTIC \n MATERIALS ONLY. KEYOPT(8)=2 IS SUGGESTED AND KEYOPT(3)=2 IS SUGGESTED FOR\n HIGHER ACCURACY OF MEMBRANE STRESSES; OTHERWISE, KEYOPT(3)=0 IS SUGGESTED.\n\n\n\n *** ANSYS - ENGINEERING ANALYSIS SYSTEM  RELEASE 2021 R2          21.2BETA ***\n Ansys Mechanical Enterprise                       \n 00000000  VERSION=LINUX x64     04:18:47  AUG 26, 2021 CP=     97.489\n\n                                                                               \n\n\n\n ** WARNING: PRE-RELEASE VERSION OF ANSYS 21.2BETA\n  ANSYS,INC TESTING IS NOT COMPLETE - CHECK RESULTS CAREFULLY **\n\n                       S O L U T I O N   O P T I O N S\n\n   PROBLEM DIMENSIONALITY. . . . . . . . . . . . .3-D                  \n   DEGREES OF FREEDOM. . . . . . UX   UY   UZ   ROTX ROTY ROTZ\n   ANALYSIS TYPE . . . . . . . . . . . . . . . . .MODAL                \n      EXTRACTION METHOD. . . . . . . . . . . . . .BLOCK LANCZOS\n   NUMBER OF MODES TO EXTRACT. . . . . . . . . . .    20\n   SHIFT POINT . . . . . . . . . . . . . . . . . .  1.0000    \n   GLOBALLY ASSEMBLED MATRIX . . . . . . . . . . .SYMMETRIC  \n\n *** WARNING ***                         CP =      97.512   TIME= 04:18:47\n No constraints have been defined using the D command.                   \n\n *** NOTE ***                            CP =      97.513   TIME= 04:18:47\n The step data was checked and warning messages were found.              \n  Please review output or errors file ( /file.err ) for these warning    \n messages.                                                               \n\n *** NOTE ***                            CP =      97.513   TIME= 04:18:47\n The conditions for direct assembly have been met.  No .emat or .erot    \n files will be produced.                                                 \n\n                      L O A D   S T E P   O P T I O N S\n\n   LOAD STEP NUMBER. . . . . . . . . . . . . . . .     1\n   THERMAL STRAINS INCLUDED IN THE LOAD VECTOR . .   YES\n\n\n\n                         ***********  PRECISE MASS SUMMARY  ***********\n\n   TOTAL RIGID BODY MASS MATRIX ABOUT ORIGIN\n               Translational mass               |   Coupled translational/rotational mass\n         78.000        0.0000      -0.30747E-30 |    0.27474E-33   0.86667E-33   0.20817E-16\n         0.0000        78.000        0.0000     |   -0.14541E-31    0.0000       0.70300E-15\n       -0.30571E-30    0.0000        78.000     |    0.53776E-15  -0.68391E-15   0.52333E-34\n     ------------------------------------------ | ------------------------------------------\n                                                |         Rotational mass (inertia)\n                                                |     6.5006       0.22335E-16   0.39789E-15\n                                                |   -0.27105E-16    6.5006       0.13241E-32\n                                                |    0.39789E-15   0.55370E-33    12.999    \n\n   TOTAL MASS =  78.000    \n     The mass principal axes coincide with the global Cartesian axes\n\n   CENTER OF MASS (X,Y,Z)=   0.90128E-17  -0.26688E-18   0.11111E-34\n\n   TOTAL INERTIA ABOUT CENTER OF MASS\n         6.5006       0.22335E-16   0.39789E-15\n        0.22335E-16    6.5006       0.13241E-32\n        0.39789E-15   0.13241E-32    12.999    \n     The inertia principal axes coincide with the global Cartesian axes\n\n\n  *** MASS SUMMARY BY ELEMENT TYPE ***\n\n  TYPE      MASS\n     4   78.0000    \n\n Range of element maximum matrix coefficients in global coordinates\n Maximum = 749504998 at element 9504.                                    \n Minimum = 749503915 at element 9505.                                    \n\n   *** ELEMENT MATRIX FORMULATION TIMES\n     TYPE    NUMBER   ENAME      TOTAL CP  AVE CP\n\n        4     10000  SHELL181      1.045   0.000104\n Time at end of element matrix formulation CP = 98.848671.               \n\n  BLOCK LANCZOS CALCULATION OF UP TO    20 EIGENVECTORS.\n  NUMBER OF EQUATIONS              =        61206\n  MAXIMUM WAVEFRONT                =           36\n  MAXIMUM MODES STORED             =           20\n  MINIMUM EIGENVALUE               =  0.10000E+01\n  MAXIMUM EIGENVALUE               =  0.10000E+31\n\n  Memory allocated for solver              =   187.579 MB\n  Memory required for in-core solution     =   178.982 MB\n  Memory required for out-of-core solution =    60.929 MB\n\n *** NOTE ***                            CP =     100.773   TIME= 04:18:50\n The Sparse Matrix Solver used by the Block Lanczos eigensolver is       \n currently running in the in-core memory mode.  This memory mode uses    \n the most amount of memory in order to avoid using the hard drive as     \n much as possible, which most often results in the fastest solution      \n time.  This mode is recommended if enough physical memory is present    \n to accommodate all of the solver data.                                  \n\n *** ANSYS - ENGINEERING ANALYSIS SYSTEM  RELEASE 2021 R2          21.2BETA ***\n Ansys Mechanical Enterprise                       \n 00000000  VERSION=LINUX x64     04:18:51  AUG 26, 2021 CP=    104.243\n\n                                                                               \n\n\n\n ** WARNING: PRE-RELEASE VERSION OF ANSYS 21.2BETA\n  ANSYS,INC TESTING IS NOT COMPLETE - CHECK RESULTS CAREFULLY **\n\n *** FREQUENCIES FROM BLOCK LANCZOS ITERATION ***\n\n  MODE    FREQUENCY (HERTZ)      \n\n\n   FREQUENCY RANGE REQUESTED=   20 MODES ABOVE   1.00000     HERTZ\n\n    1     32.74664192920    \n    2     47.77804288735    \n    3     59.17108298315    \n    4     84.60790505155    \n    5     84.60790505182    \n    6     148.8927748648    \n    7     148.8927748649    \n    8     154.6519861746    \n    9     168.3840411459    \n   10     187.7790667343    \n   11     255.9751634915    \n   12     255.9751634919    \n   13     285.2444050796    \n   14     298.2943388369    \n   15     319.8023401634    \n   16     319.8023401637    \n   17     370.6023621796    \n   18     391.8457651342    \n   19     409.1039880839    \n   20     482.6516135508    \n\n *** ANSYS - ENGINEERING ANALYSIS SYSTEM  RELEASE 2021 R2          21.2BETA ***\n Ansys Mechanical Enterprise                       \n 00000000  VERSION=LINUX x64     04:18:52  AUG 26, 2021 CP=    104.531\n\n                                                                               \n\n\n\n ** WARNING: PRE-RELEASE VERSION OF ANSYS 21.2BETA\n  ANSYS,INC TESTING IS NOT COMPLETE - CHECK RESULTS CAREFULLY **\n\n\n\n          ***** PARTICIPATION FACTOR CALCULATION *****  X  DIRECTION\n                                                                                  CUMULATIVE     RATIO EFF.MASS\n  MODE   FREQUENCY       PERIOD      PARTIC.FACTOR     RATIO    EFFECTIVE MASS   MASS FRACTION   TO TOTAL MASS\n     1     32.7466       0.30537E-01    0.0000        0.000000     0.00000         0.00000         0.00000    \n     2     47.7780       0.20930E-01    0.0000        0.000000     0.00000         0.00000         0.00000    \n     3     59.1711       0.16900E-01    0.0000        0.000000     0.00000         0.00000         0.00000    \n     4     84.6079       0.11819E-01    0.0000        0.000000     0.00000         0.00000         0.00000    \n     5     84.6079       0.11819E-01    0.0000        0.000000     0.00000         0.00000         0.00000    \n     6     148.893       0.67162E-02    0.0000        0.000000     0.00000         0.00000         0.00000    \n     7     148.893       0.67162E-02    0.0000        0.000000     0.00000         0.00000         0.00000    \n     8     154.652       0.64661E-02    0.0000        0.000000     0.00000         0.00000         0.00000    \n     9     168.384       0.59388E-02    0.0000        0.000000     0.00000         0.00000         0.00000    \n    10     187.779       0.53254E-02    0.0000        0.000000     0.00000         0.00000         0.00000    \n    11     255.975       0.39066E-02    0.0000        0.000000     0.00000         0.00000         0.00000    \n    12     255.975       0.39066E-02    0.0000        0.000000     0.00000         0.00000         0.00000    \n    13     285.244       0.35058E-02    0.0000        0.000000     0.00000         0.00000         0.00000    \n    14     298.294       0.33524E-02    0.0000        0.000000     0.00000         0.00000         0.00000    \n    15     319.802       0.31269E-02    0.0000        0.000000     0.00000         0.00000         0.00000    \n    16     319.802       0.31269E-02    0.0000        0.000000     0.00000         0.00000         0.00000    \n    17     370.602       0.26983E-02    0.0000        0.000000     0.00000         0.00000         0.00000    \n    18     391.846       0.25520E-02    0.0000        0.000000     0.00000         0.00000         0.00000    \n    19     409.104       0.24444E-02    0.0000        0.000000     0.00000         0.00000         0.00000    \n    20     482.652       0.20719E-02    0.0000        0.000000     0.00000         0.00000         0.00000    \n\n\n\n          ***** PARTICIPATION FACTOR CALCULATION *****  Y  DIRECTION\n                                                                                  CUMULATIVE     RATIO EFF.MASS\n  MODE   FREQUENCY       PERIOD      PARTIC.FACTOR     RATIO    EFFECTIVE MASS   MASS FRACTION   TO TOTAL MASS\n     1     32.7466       0.30537E-01    0.0000        0.000000     0.00000         0.00000         0.00000    \n     2     47.7780       0.20930E-01    0.0000        0.000000     0.00000         0.00000         0.00000    \n     3     59.1711       0.16900E-01    0.0000        0.000000     0.00000         0.00000         0.00000    \n     4     84.6079       0.11819E-01    0.0000        0.000000     0.00000         0.00000         0.00000    \n     5     84.6079       0.11819E-01    0.0000        0.000000     0.00000         0.00000         0.00000    \n     6     148.893       0.67162E-02    0.0000        0.000000     0.00000         0.00000         0.00000    \n     7     148.893       0.67162E-02    0.0000        0.000000     0.00000         0.00000         0.00000    \n     8     154.652       0.64661E-02    0.0000        0.000000     0.00000         0.00000         0.00000    \n     9     168.384       0.59388E-02    0.0000        0.000000     0.00000         0.00000         0.00000    \n    10     187.779       0.53254E-02    0.0000        0.000000     0.00000         0.00000         0.00000    \n    11     255.975       0.39066E-02    0.0000        0.000000     0.00000         0.00000         0.00000    \n    12     255.975       0.39066E-02    0.0000        0.000000     0.00000         0.00000         0.00000    \n    13     285.244       0.35058E-02    0.0000        0.000000     0.00000         0.00000         0.00000    \n    14     298.294       0.33524E-02    0.0000        0.000000     0.00000         0.00000         0.00000    \n    15     319.802       0.31269E-02    0.0000        0.000000     0.00000         0.00000         0.00000    \n    16     319.802       0.31269E-02    0.0000        0.000000     0.00000         0.00000         0.00000    \n    17     370.602       0.26983E-02    0.0000        0.000000     0.00000         0.00000         0.00000    \n    18     391.846       0.25520E-02    0.0000        0.000000     0.00000         0.00000         0.00000    \n    19     409.104       0.24444E-02    0.0000        0.000000     0.00000         0.00000         0.00000    \n    20     482.652       0.20719E-02    0.0000        0.000000     0.00000         0.00000         0.00000    \n\n\n\n          ***** PARTICIPATION FACTOR CALCULATION *****  Z  DIRECTION\n                                                                                  CUMULATIVE     RATIO EFF.MASS\n  MODE   FREQUENCY       PERIOD      PARTIC.FACTOR     RATIO    EFFECTIVE MASS   MASS FRACTION   TO TOTAL MASS\n     1     32.7466       0.30537E-01    0.0000        0.000000     0.00000         0.00000         0.00000    \n     2     47.7780       0.20930E-01    0.0000        0.000000     0.00000         0.00000         0.00000    \n     3     59.1711       0.16900E-01    0.0000        0.000000     0.00000         0.00000         0.00000    \n     4     84.6079       0.11819E-01    0.0000        0.000000     0.00000         0.00000         0.00000    \n     5     84.6079       0.11819E-01    0.0000        0.000000     0.00000         0.00000         0.00000    \n     6     148.893       0.67162E-02    0.0000        0.000000     0.00000         0.00000         0.00000    \n     7     148.893       0.67162E-02    0.0000        0.000000     0.00000         0.00000         0.00000    \n     8     154.652       0.64661E-02    0.0000        0.000000     0.00000         0.00000         0.00000    \n     9     168.384       0.59388E-02    0.0000        0.000000     0.00000         0.00000         0.00000    \n    10     187.779       0.53254E-02    0.0000        0.000000     0.00000         0.00000         0.00000    \n    11     255.975       0.39066E-02    0.0000        0.000000     0.00000         0.00000         0.00000    \n    12     255.975       0.39066E-02    0.0000        0.000000     0.00000         0.00000         0.00000    \n    13     285.244       0.35058E-02    0.0000        0.000000     0.00000         0.00000         0.00000    \n    14     298.294       0.33524E-02    0.0000        0.000000     0.00000         0.00000         0.00000    \n    15     319.802       0.31269E-02    0.0000        0.000000     0.00000         0.00000         0.00000    \n    16     319.802       0.31269E-02    0.0000        0.000000     0.00000         0.00000         0.00000    \n    17     370.602       0.26983E-02    0.0000        0.000000     0.00000         0.00000         0.00000    \n    18     391.846       0.25520E-02    0.0000        0.000000     0.00000         0.00000         0.00000    \n    19     409.104       0.24444E-02    0.0000        0.000000     0.00000         0.00000         0.00000    \n    20     482.652       0.20719E-02    0.0000        0.000000     0.00000         0.00000         0.00000    \n\n\n\n          ***** PARTICIPATION FACTOR CALCULATION *****ROTX DIRECTION\n                                                                                  CUMULATIVE     RATIO EFF.MASS\n  MODE   FREQUENCY       PERIOD      PARTIC.FACTOR     RATIO    EFFECTIVE MASS   MASS FRACTION   TO TOTAL MASS\n     1     32.7466       0.30537E-01    0.0000        0.000000     0.00000         0.00000         0.00000    \n     2     47.7780       0.20930E-01    0.0000        0.000000     0.00000         0.00000         0.00000    \n     3     59.1711       0.16900E-01    0.0000        0.000000     0.00000         0.00000         0.00000    \n     4     84.6079       0.11819E-01    0.0000        0.000000     0.00000         0.00000         0.00000    \n     5     84.6079       0.11819E-01    0.0000        0.000000     0.00000         0.00000         0.00000    \n     6     148.893       0.67162E-02    0.0000        0.000000     0.00000         0.00000         0.00000    \n     7     148.893       0.67162E-02    0.0000        0.000000     0.00000         0.00000         0.00000    \n     8     154.652       0.64661E-02    0.0000        0.000000     0.00000         0.00000         0.00000    \n     9     168.384       0.59388E-02    0.0000        0.000000     0.00000         0.00000         0.00000    \n    10     187.779       0.53254E-02    0.0000        0.000000     0.00000         0.00000         0.00000    \n    11     255.975       0.39066E-02    0.0000        0.000000     0.00000         0.00000         0.00000    \n    12     255.975       0.39066E-02    0.0000        0.000000     0.00000         0.00000         0.00000    \n    13     285.244       0.35058E-02    0.0000        0.000000     0.00000         0.00000         0.00000    \n    14     298.294       0.33524E-02    0.0000        0.000000     0.00000         0.00000         0.00000    \n    15     319.802       0.31269E-02    0.0000        0.000000     0.00000         0.00000         0.00000    \n    16     319.802       0.31269E-02    0.0000        0.000000     0.00000         0.00000         0.00000    \n    17     370.602       0.26983E-02    0.0000        0.000000     0.00000         0.00000         0.00000    \n    18     391.846       0.25520E-02    0.0000        0.000000     0.00000         0.00000         0.00000    \n    19     409.104       0.24444E-02    0.0000        0.000000     0.00000         0.00000         0.00000    \n    20     482.652       0.20719E-02    0.0000        0.000000     0.00000         0.00000         0.00000    \n\n\n\n          ***** PARTICIPATION FACTOR CALCULATION *****ROTY DIRECTION\n                                                                                  CUMULATIVE     RATIO EFF.MASS\n  MODE   FREQUENCY       PERIOD      PARTIC.FACTOR     RATIO    EFFECTIVE MASS   MASS FRACTION   TO TOTAL MASS\n     1     32.7466       0.30537E-01    0.0000        0.000000     0.00000         0.00000         0.00000    \n     2     47.7780       0.20930E-01    0.0000        0.000000     0.00000         0.00000         0.00000    \n     3     59.1711       0.16900E-01    0.0000        0.000000     0.00000         0.00000         0.00000    \n     4     84.6079       0.11819E-01    0.0000        0.000000     0.00000         0.00000         0.00000    \n     5     84.6079       0.11819E-01    0.0000        0.000000     0.00000         0.00000         0.00000    \n     6     148.893       0.67162E-02    0.0000        0.000000     0.00000         0.00000         0.00000    \n     7     148.893       0.67162E-02    0.0000        0.000000     0.00000         0.00000         0.00000    \n     8     154.652       0.64661E-02    0.0000        0.000000     0.00000         0.00000         0.00000    \n     9     168.384       0.59388E-02    0.0000        0.000000     0.00000         0.00000         0.00000    \n    10     187.779       0.53254E-02    0.0000        0.000000     0.00000         0.00000         0.00000    \n    11     255.975       0.39066E-02    0.0000        0.000000     0.00000         0.00000         0.00000    \n    12     255.975       0.39066E-02    0.0000        0.000000     0.00000         0.00000         0.00000    \n    13     285.244       0.35058E-02    0.0000        0.000000     0.00000         0.00000         0.00000    \n    14     298.294       0.33524E-02    0.0000        0.000000     0.00000         0.00000         0.00000    \n    15     319.802       0.31269E-02    0.0000        0.000000     0.00000         0.00000         0.00000    \n    16     319.802       0.31269E-02    0.0000        0.000000     0.00000         0.00000         0.00000    \n    17     370.602       0.26983E-02    0.0000        0.000000     0.00000         0.00000         0.00000    \n    18     391.846       0.25520E-02    0.0000        0.000000     0.00000         0.00000         0.00000    \n    19     409.104       0.24444E-02    0.0000        0.000000     0.00000         0.00000         0.00000    \n    20     482.652       0.20719E-02    0.0000        0.000000     0.00000         0.00000         0.00000    \n\n\n\n          ***** PARTICIPATION FACTOR CALCULATION *****ROTZ DIRECTION\n                                                                                  CUMULATIVE     RATIO EFF.MASS\n  MODE   FREQUENCY       PERIOD      PARTIC.FACTOR     RATIO    EFFECTIVE MASS   MASS FRACTION   TO TOTAL MASS\n     1     32.7466       0.30537E-01    0.0000        0.000000     0.00000         0.00000         0.00000    \n     2     47.7780       0.20930E-01    0.0000        0.000000     0.00000         0.00000         0.00000    \n     3     59.1711       0.16900E-01    0.0000        0.000000     0.00000         0.00000         0.00000    \n     4     84.6079       0.11819E-01    0.0000        0.000000     0.00000         0.00000         0.00000    \n     5     84.6079       0.11819E-01    0.0000        0.000000     0.00000         0.00000         0.00000    \n     6     148.893       0.67162E-02    0.0000        0.000000     0.00000         0.00000         0.00000    \n     7     148.893       0.67162E-02    0.0000        0.000000     0.00000         0.00000         0.00000    \n     8     154.652       0.64661E-02    0.0000        0.000000     0.00000         0.00000         0.00000    \n     9     168.384       0.59388E-02    0.0000        0.000000     0.00000         0.00000         0.00000    \n    10     187.779       0.53254E-02    0.0000        0.000000     0.00000         0.00000         0.00000    \n    11     255.975       0.39066E-02    0.0000        0.000000     0.00000         0.00000         0.00000    \n    12     255.975       0.39066E-02    0.0000        0.000000     0.00000         0.00000         0.00000    \n    13     285.244       0.35058E-02    0.0000        0.000000     0.00000         0.00000         0.00000    \n    14     298.294       0.33524E-02    0.0000        0.000000     0.00000         0.00000         0.00000    \n    15     319.802       0.31269E-02    0.0000        0.000000     0.00000         0.00000         0.00000    \n    16     319.802       0.31269E-02    0.0000        0.000000     0.00000         0.00000         0.00000    \n    17     370.602       0.26983E-02    0.0000        0.000000     0.00000         0.00000         0.00000    \n    18     391.846       0.25520E-02    0.0000        0.000000     0.00000         0.00000         0.00000    \n    19     409.104       0.24444E-02    0.0000        0.000000     0.00000         0.00000         0.00000    \n    20     482.652       0.20719E-02    0.0000        0.000000     0.00000         0.00000         0.00000    \n\n\n *** ANSYS BINARY FILE STATISTICS\n  BUFFER SIZE USED= 16384\n       19.250 MB WRITTEN ON ASSEMBLED MATRIX FILE: file.full\n       26.938 MB WRITTEN ON MODAL MATRIX FILE: file.mode'

Load the result file within pyansys and plot the 8th mode.

result = mapdl.result
print(result)

result.plot_nodal_displacement(7, show_displacement=True, displacement_factor=0.4)
pyvista mesh

Out:

PyMAPDL Result
Units       : User Defined
Version     : 21.2
Cyclic      : False
Result Sets : 20
Nodes       : 10201
Elements    : 10000


Available Results:
NSL : Nodal displacements


[(1.6018615354080923, 1.6018615354080956, 1.5911447281352509),
 (-2.609024107869118e-15, 7.216449660063518e-16, -0.010716807272844166),
 (0.0, 0.0, 1.0)]

plot the 1st mode using contours

result.plot_nodal_displacement(0, show_displacement=True,
                               displacement_factor=0.4, n_colors=10)
pyvista mesh

Out:

[(1.6007557758557032, 1.6007557758557043, 1.6007557758547206),
 (-1.6653345369377348e-16, 9.43689570931383e-16, -9.828041158677081e-13),
 (0.0, 0.0, 1.0)]

Animate a high frequency mode

Get a smoother plot by disabling movie_filename and increasing nangles. Enable a continuous plot looping with `loop=True`.

result.animate_nodal_displacement(18, loop=False, add_text=False,
                                  nangles=30, displacement_factor=0.4,
                                  show_axes=False, background='w',
                                  movie_filename='plane_vib.gif')
pyvista mesh

Out:

/opt/hostedtoolcache/Python/3.7.11/x64/lib/python3.7/site-packages/ansys/mapdl/reader/rst.py:863: UserWarning: The ``nangles`` kwarg is depreciated and ``n_frames`` should be used instead.
  warnings.warn('The ``nangles`` kwarg is depreciated and ``n_frames`` '

Rendering animation:   0%|          | 0/30 [00:00<?, ?it/s]
Rendering animation:   3%|3         | 1/30 [00:00<00:08,  3.34it/s]
Rendering animation:   7%|6         | 2/30 [00:00<00:07,  3.97it/s]
Rendering animation:  10%|#         | 3/30 [00:00<00:06,  4.24it/s]
Rendering animation:  13%|#3        | 4/30 [00:00<00:06,  4.31it/s]
Rendering animation:  17%|#6        | 5/30 [00:01<00:05,  4.19it/s]
Rendering animation:  20%|##        | 6/30 [00:01<00:05,  4.00it/s]
Rendering animation:  23%|##3       | 7/30 [00:01<00:06,  3.76it/s]
Rendering animation:  27%|##6       | 8/30 [00:02<00:05,  3.75it/s]
Rendering animation:  30%|###       | 9/30 [00:02<00:05,  3.71it/s]
Rendering animation:  33%|###3      | 10/30 [00:02<00:05,  3.66it/s]
Rendering animation:  37%|###6      | 11/30 [00:02<00:05,  3.66it/s]
Rendering animation:  40%|####      | 12/30 [00:03<00:04,  3.66it/s]
Rendering animation:  43%|####3     | 13/30 [00:03<00:04,  3.65it/s]
Rendering animation:  47%|####6     | 14/30 [00:03<00:04,  3.75it/s]
Rendering animation:  50%|#####     | 15/30 [00:03<00:03,  3.97it/s]
Rendering animation:  53%|#####3    | 16/30 [00:04<00:03,  4.06it/s]
Rendering animation:  57%|#####6    | 17/30 [00:04<00:03,  4.13it/s]
Rendering animation:  60%|######    | 18/30 [00:04<00:02,  4.19it/s]
Rendering animation:  63%|######3   | 19/30 [00:04<00:02,  4.32it/s]
Rendering animation:  67%|######6   | 20/30 [00:05<00:02,  4.21it/s]
Rendering animation:  70%|#######   | 21/30 [00:05<00:02,  4.09it/s]
Rendering animation:  73%|#######3  | 22/30 [00:05<00:02,  3.87it/s]
Rendering animation:  77%|#######6  | 23/30 [00:05<00:01,  3.71it/s]
Rendering animation:  80%|########  | 24/30 [00:06<00:01,  3.63it/s]
Rendering animation:  83%|########3 | 25/30 [00:06<00:01,  3.55it/s]
Rendering animation:  87%|########6 | 26/30 [00:06<00:01,  3.45it/s]
Rendering animation:  90%|######### | 27/30 [00:07<00:00,  3.46it/s]
Rendering animation:  93%|#########3| 28/30 [00:07<00:00,  3.58it/s]
Rendering animation:  97%|#########6| 29/30 [00:07<00:00,  3.66it/s]
Rendering animation: 100%|##########| 30/30 [00:07<00:00,  3.89it/s]
Rendering animation: 100%|##########| 30/30 [00:08<00:00,  3.75it/s]

[(1.5773502691896262, 1.5773502691896262, 1.5773502691896262),
 (0.0, 0.0, 0.0),
 (0.0, 0.0, 1.0)]

Total running time of the script: ( 0 minutes 14.673 seconds)

Gallery generated by Sphinx-Gallery