diff --git a/doc/changelog.d/3892.miscellaneous.md b/doc/changelog.d/3892.miscellaneous.md new file mode 100644 index 0000000000..8702e2d62d --- /dev/null +++ b/doc/changelog.d/3892.miscellaneous.md @@ -0,0 +1 @@ +Feat: ``post26`` submodule \ No newline at end of file diff --git a/doc/source/mapdl_commands/index.rst b/doc/source/mapdl_commands/index.rst index 28ed8f0889..47776582f5 100644 --- a/doc/source/mapdl_commands/index.rst +++ b/doc/source/mapdl_commands/index.rst @@ -186,12 +186,13 @@ time-history processor. :maxdepth: 1 :caption: POST26 - post26/setup + post26/_set_up post26/controls - post26/operations post26/display post26/listing - post26/special + post26/operations + post26/set_up + post26/special_purpose post26/status diff --git a/doc/source/mapdl_commands/post26/_set_up.rst b/doc/source/mapdl_commands/post26/_set_up.rst new file mode 100644 index 0000000000..51c8295456 --- /dev/null +++ b/doc/source/mapdl_commands/post26/_set_up.rst @@ -0,0 +1,18 @@ + +.. _ref__set_up: + + +SetUp +===== + + +.. currentmodule:: ansys.mapdl.core._commands.post26._set_up + +.. autoclass:: ansys.mapdl.core._commands.post26._set_up.SetUp + +.. autosummary:: + :template: base.rst + :toctree: _autosummary + + + SetUp.gapf diff --git a/doc/source/mapdl_commands/post26/controls.rst b/doc/source/mapdl_commands/post26/controls.rst index e1dd3a850d..b65d74ec37 100644 --- a/doc/source/mapdl_commands/post26/controls.rst +++ b/doc/source/mapdl_commands/post26/controls.rst @@ -1,19 +1,20 @@ -.. _ref_post26_controls_api: -******** +.. _ref_controls: + + Controls -******** +======== -.. currentmodule:: ansys.mapdl.core -These POST26 commands are used to control the calculations of other -commands. +.. currentmodule:: ansys.mapdl.core._commands.post26.controls + +.. autoclass:: ansys.mapdl.core._commands.post26.controls.Controls .. autosummary:: - :toctree: _autosummary/ + :template: base.rst + :toctree: _autosummary + - Mapdl.cfact - Mapdl.force - Mapdl.layerp26 - Mapdl.shell - Mapdl.tvar + Controls.cfact + Controls.layerp26 + Controls.tvar diff --git a/doc/source/mapdl_commands/post26/display.rst b/doc/source/mapdl_commands/post26/display.rst index 974f4ab166..f558de3d1a 100644 --- a/doc/source/mapdl_commands/post26/display.rst +++ b/doc/source/mapdl_commands/post26/display.rst @@ -1,19 +1,23 @@ -.. _ref_display_api: -******* +.. _ref_display: + + Display -******* +======= + -.. currentmodule:: ansys.mapdl.core +.. currentmodule:: ansys.mapdl.core._commands.post26.display -These POST26 commands are used to display the results. +.. autoclass:: ansys.mapdl.core._commands.post26.display.Display .. autosummary:: - :toctree: _autosummary/ - - Mapdl.keep - Mapdl.plcplx - Mapdl.pltime - Mapdl.plvar - Mapdl.spread - Mapdl.xvar + :template: base.rst + :toctree: _autosummary + + + Display.keep + Display.plcplx + Display.pltime + Display.plvar + Display.spread + Display.xvar diff --git a/doc/source/mapdl_commands/post26/index.rst b/doc/source/mapdl_commands/post26/index.rst new file mode 100644 index 0000000000..3a21a42ca0 --- /dev/null +++ b/doc/source/mapdl_commands/post26/index.rst @@ -0,0 +1,30 @@ + +.. _ref_post26: + +Post26 +====== + +.. list-table:: + + * - :ref:`ref_operations` + * - :ref:`ref_set_up` + * - :ref:`ref_controls` + * - :ref:`ref_special_purpose` + * - :ref:`ref_listing` + * - :ref:`ref__set_up` + * - :ref:`ref_display` + * - :ref:`ref_status` + + +.. toctree:: + :maxdepth: 1 + :hidden: + + operations + set_up + controls + special_purpose + listing + _set_up + display + status diff --git a/doc/source/mapdl_commands/post26/listing.rst b/doc/source/mapdl_commands/post26/listing.rst index 70d6ca759a..86a0d09a62 100644 --- a/doc/source/mapdl_commands/post26/listing.rst +++ b/doc/source/mapdl_commands/post26/listing.rst @@ -1,20 +1,23 @@ -.. _ref_post26_listing_api: -******* +.. _ref_listing: + + Listing -******* +======= + -.. currentmodule:: ansys.mapdl.core +.. currentmodule:: ansys.mapdl.core._commands.post26.listing -These POST26 commands are used to produce tabular listings of the -results. +.. autoclass:: ansys.mapdl.core._commands.post26.listing.Listing .. autosummary:: - :toctree: _autosummary/ - - Mapdl.extrem - Mapdl.lines - Mapdl.nprint - Mapdl.prcplx - Mapdl.prtime - Mapdl.prvar + :template: base.rst + :toctree: _autosummary + + + Listing.extrem + Listing.lines + Listing.nprint + Listing.prcplx + Listing.prtime + Listing.prvar diff --git a/doc/source/mapdl_commands/post26/operations.rst b/doc/source/mapdl_commands/post26/operations.rst index 80cb615d09..a346c30b70 100644 --- a/doc/source/mapdl_commands/post26/operations.rst +++ b/doc/source/mapdl_commands/post26/operations.rst @@ -1,31 +1,34 @@ -.. _ref_operations_api: -********** +.. _ref_operations: + + Operations -********** +========== + -.. currentmodule:: ansys.mapdl.core +.. currentmodule:: ansys.mapdl.core._commands.post26.operations -These POST26 commands are used to perform operations on the stored -variables. +.. autoclass:: ansys.mapdl.core._commands.post26.operations.Operations .. autosummary:: - :toctree: _autosummary/ - - Mapdl.abs - Mapdl.add - Mapdl.atan - Mapdl.clog - Mapdl.conjug - Mapdl.deriv - Mapdl.exp - Mapdl.filldata - Mapdl.imagin - Mapdl.int1 - Mapdl.large - Mapdl.nlog - Mapdl.prod - Mapdl.quot - Mapdl.realvar - Mapdl.small - Mapdl.sqrt + :template: base.rst + :toctree: _autosummary + + + Operations.abs + Operations.add + Operations.atan + Operations.clog + Operations.conjug + Operations.deriv + Operations.exp + Operations.filldata + Operations.imagin + Operations.int1 + Operations.large + Operations.nlog + Operations.prod + Operations.quot + Operations.realvar + Operations.small + Operations.sqrt diff --git a/doc/source/mapdl_commands/post26/set_up.rst b/doc/source/mapdl_commands/post26/set_up.rst new file mode 100644 index 0000000000..249be2edb2 --- /dev/null +++ b/doc/source/mapdl_commands/post26/set_up.rst @@ -0,0 +1,34 @@ + +.. _ref_set_up: + + +SetUp +===== + + +.. currentmodule:: ansys.mapdl.core._commands.post26.set_up + +.. autoclass:: ansys.mapdl.core._commands.post26.set_up.SetUp + +.. autosummary:: + :template: base.rst + :toctree: _autosummary + + + SetUp.ansol + SetUp.cisol + SetUp.data + SetUp.enersol + SetUp.esol + SetUp.gssol + SetUp.jsol + SetUp.nsol + SetUp.nstore + SetUp.numvar + SetUp.rforce + SetUp.rgb + SetUp.solu + SetUp.store + SetUp.timerange + SetUp.vardel + SetUp.varnam diff --git a/doc/source/mapdl_commands/post26/setup.rst b/doc/source/mapdl_commands/post26/setup.rst deleted file mode 100644 index a7fec0dc22..0000000000 --- a/doc/source/mapdl_commands/post26/setup.rst +++ /dev/null @@ -1,34 +0,0 @@ -.. _ref_post26_setup_api: - -***** -Setup -***** - -.. currentmodule:: ansys.mapdl.core - -These POST26 commands are used to store data for processing. - -.. autosummary:: - :toctree: _autosummary/ - - Mapdl.ansol - Mapdl.cisol - Mapdl.data - Mapdl.edread - Mapdl.enersol - Mapdl.esol - Mapdl.file - Mapdl.gapf - Mapdl.gssol - Mapdl.jsol - Mapdl.nsol - Mapdl.nstore - Mapdl.numvar - Mapdl.reset - Mapdl.rforce - Mapdl.rgb - Mapdl.solu - Mapdl.store - Mapdl.timerange - Mapdl.vardel - Mapdl.varnam diff --git a/doc/source/mapdl_commands/post26/special.rst b/doc/source/mapdl_commands/post26/special.rst deleted file mode 100644 index 2864d00671..0000000000 --- a/doc/source/mapdl_commands/post26/special.rst +++ /dev/null @@ -1,21 +0,0 @@ -.. _ref_special_purpose_api: - -*************** -Special purpose -*************** - -.. currentmodule:: ansys.mapdl.core - -These POST26 commands are used for various special purposes. - -.. autosummary:: - :toctree: _autosummary/ - - Mapdl.cvar - Mapdl.pmgtran - Mapdl.rcyc - Mapdl.resp - Mapdl.rpsd - Mapdl.smooth - Mapdl.vput - Mapdl.vget diff --git a/doc/source/mapdl_commands/post26/special_purpose.rst b/doc/source/mapdl_commands/post26/special_purpose.rst new file mode 100644 index 0000000000..9e73e77001 --- /dev/null +++ b/doc/source/mapdl_commands/post26/special_purpose.rst @@ -0,0 +1,25 @@ + +.. _ref_special_purpose: + + +SpecialPurpose +============== + + +.. currentmodule:: ansys.mapdl.core._commands.post26.special_purpose + +.. autoclass:: ansys.mapdl.core._commands.post26.special_purpose.SpecialPurpose + +.. autosummary:: + :template: base.rst + :toctree: _autosummary + + + SpecialPurpose.cvar + SpecialPurpose.pmgtran + SpecialPurpose.rcyc + SpecialPurpose.resp + SpecialPurpose.rpsd + SpecialPurpose.smooth + SpecialPurpose.vget + SpecialPurpose.vput diff --git a/doc/source/mapdl_commands/post26/status.rst b/doc/source/mapdl_commands/post26/status.rst index 1cdc8bbd71..c0c0bc463f 100644 --- a/doc/source/mapdl_commands/post26/status.rst +++ b/doc/source/mapdl_commands/post26/status.rst @@ -1,17 +1,19 @@ -.. _ref_status_api: -****** +.. _ref_status: + + Status -****** +====== -.. currentmodule:: ansys.mapdl.core -These POST26 commands are for use with the STAT command. +.. currentmodule:: ansys.mapdl.core._commands.post26.status + +.. autoclass:: ansys.mapdl.core._commands.post26.status.Status .. autosummary:: - :toctree: _autosummary/ + :template: base.rst + :toctree: _autosummary + - Mapdl.define - Mapdl.operate - Mapdl.plotting - Mapdl.print + Status.operate + Status.plotting diff --git a/src/ansys/mapdl/core/_commands/post26_/__init__.py b/src/ansys/mapdl/core/_commands/post26/__init__.py similarity index 89% rename from src/ansys/mapdl/core/_commands/post26_/__init__.py rename to src/ansys/mapdl/core/_commands/post26/__init__.py index 5f396473ec..7002ecee1b 100644 --- a/src/ansys/mapdl/core/_commands/post26_/__init__.py +++ b/src/ansys/mapdl/core/_commands/post26/__init__.py @@ -20,4 +20,13 @@ # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE # SOFTWARE. -from . import controls, display, listing, operations, setup, special, status +from . import ( + _set_up, + controls, + display, + listing, + operations, + set_up, + special_purpose, + status, +) diff --git a/src/ansys/mapdl/core/_commands/post26/_set_up.py b/src/ansys/mapdl/core/_commands/post26/_set_up.py new file mode 100644 index 0000000000..c2a10558cc --- /dev/null +++ b/src/ansys/mapdl/core/_commands/post26/_set_up.py @@ -0,0 +1,60 @@ +# Copyright (C) 2016 - 2025 ANSYS, Inc. and/or its affiliates. +# SPDX-License-Identifier: MIT +# +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to deal +# in the Software without restriction, including without limitation the rights +# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +# copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in all +# copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +# SOFTWARE. + + +class SetUp: + + def gapf(self, nvar: str = "", num: str = "", name: str = "", **kwargs): + r"""Defines the gap force data to be stored in a variable. + + Mechanical APDL Command: `GAPF `_ + + Parameters + ---------- + nvar : str + Arbitrary reference number assigned to this variable (2 to ``NV`` on :ref:`numvar` ). Overwrites + any existing results for this variable. + + num : str + Number identifying gap number for which the gap force is to be stored. Issue the :ref:`gplist` + command to display gap numbers. + + name : str + Thirty-two character name for identifying the item on the printout and displays (defaults to the + name :ref:`gapf` ). + + Notes + ----- + + .. _GAPF_notes: + + Defines the gap force data to be stored in a variable. Applicable only to the expansion pass of the + mode-superposition linear transient dynamic ( :ref:`antype`,TRANS) analysis. The data is usually on + :file:`FnameRDSP`. + + .. warning:: + + This command is archived in the latest version of the software. + + """ + command = f"GAPF,{nvar},{num},{name}" + return self.run(command, **kwargs) diff --git a/src/ansys/mapdl/core/_commands/post26/controls.py b/src/ansys/mapdl/core/_commands/post26/controls.py new file mode 100644 index 0000000000..633aedc26f --- /dev/null +++ b/src/ansys/mapdl/core/_commands/post26/controls.py @@ -0,0 +1,152 @@ +# Copyright (C) 2016 - 2025 ANSYS, Inc. and/or its affiliates. +# SPDX-License-Identifier: MIT +# +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to deal +# in the Software without restriction, including without limitation the rights +# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +# copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in all +# copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +# SOFTWARE. + + +class Controls: + + def cfact( + self, + rfacta: str = "", + ifacta: str = "", + rfactb: str = "", + ifactb: str = "", + rfactc: str = "", + ifactc: str = "", + **kwargs, + ): + r"""Defines complex scaling factors to be used with operations. + + Mechanical APDL Command: `CFACT `_ + + **Command default:** + + .. _CFACT_default: + + Use the real factors as described with the operation command. + + Parameters + ---------- + rfacta : str + Real portion of the complex scale factor used in place of ``FACTA``. + + ifacta : str + Imaginary portion of the complex scale factor used in place of ``FACTA``. + + rfactb : str + Real portion of the complex scale factor used in place of ``FACTB``. + + ifactb : str + Imaginary portion of the complex scale factor used in place of ``FACTB``. + + rfactc : str + Real portion of the complex scale factor used in place of ``FACTC``. + + ifactc : str + Imaginary portion of the complex scale factor used in place of ``FACTC``. + + Notes + ----- + + .. _CFACT_notes: + + Defines complex scale factors to be used with the operations ( :ref:`add`, :ref:`prod`, etc.). If + this command is supplied, these complex factors override any real factors ( ``FACTA``, ``FACTB``, + ``FACTC`` ) supplied on the operation commands. Factors are typically involved in scaling a + specified variable, such as in the term ``FACTA`` x ``IA`` of the :ref:`add` command to scale + variable ``IA`` before the ADD operation. + + When the :ref:`cfact` command is active, defaults are as follows: 1) if the complex factor is not + specified, but the variable upon which it acts (such as ``IA`` ) is specified, the factor defaults + to 1.0+ i 0.0; 2) if the variable upon which the factor operates is not specified, but the factor is + specified, the variable defaults to 1.0 so that the term in the operation becomes the complex factor + itself; 3) if neither the factor nor the variable number is supplied, the term is omitted from the + operation. Once the operation (such as the :ref:`add` command) has been processed, the :ref:`cfact` + command becomes inactive and must be specified again if it is to be used. + """ + command = f"CFACT,{rfacta},{ifacta},{rfactb},{ifactb},{rfactc},{ifactc}" + return self.run(command, **kwargs) + + def layerp26(self, num: str = "", **kwargs): + r"""Specifies the element layer for which data are to be stored. + + Mechanical APDL Command: `LAYERP26 `_ + + Parameters + ---------- + num : str + Layer-processing mode: + + * ``N`` - The layer number to process. The default value is 1. + + Notes + ----- + + .. _LAYERP26_notes: + + Defines the element layer for which results data are to be stored for postprocessing. Applies to + stress and strain data for layered elements ``SHELL181``, ``SOLID185``, ``SOLID186``, ``SOLSH190``, + ``SHELL208``, ``SHELL209``, ``SHELL281``, ``REINF265``, and ``ELBOW290``. + + The :ref:`shell` command can be used (for shell elements) to specify a location (TOP, MID, BOT) + within the layer for selection on the :ref:`esol` command. Transverse shear stresses for MID are + linearly averaged from TOP and BOT, and do not reflect a parabolic distribution. Setting KEYOPT(8) = + 2 for ``SHELL181``, ``SHELL208``, ``SHELL209``, ``SHELL281``, and ``ELBOW290`` writes the mid- + surface values directly to the results file and yields more accurate values than linear averaging. + + That this command cannot be used for energy output, as energy is a per-element quantity. + + When using the :ref:`layerp26` command with ``SHELL181``, ``SOLID185``, ``SOLID186``, ``SOLSH190``, + ``SHELL208``, or ``SHELL209``, KEYOPT(8) must be set to 1 (or 2 for ``SHELL181``, ``SHELL208``, + ``SHELL209``, ``SHELL281``, and ``ELBOW290`` ) in order to store results for all layers. + + In POST26, the :ref:`esol` data stored is based on the active :ref:`layerp26` specification at the + time the data is stored. To store data at various specifications (for example, layers 2 and 5), + issue a :ref:`store` command before each new specification. + """ + command = f"LAYERP26,{num}" + return self.run(command, **kwargs) + + def tvar(self, key: int | str = "", **kwargs): + r"""Changes time to the cumulative iteration number. + + Mechanical APDL Command: `TVAR `_ + + Parameters + ---------- + key : int or str + Time key: + + * ``0`` - Time is used for the variable ``TIME``. + + * ``1`` - NCUMIT is used for the variable ``TIME``. + + Notes + ----- + + .. _TVAR_notes: + + Changes the meaning of the time variable to the cumulative iteration number (NCUMIT) variable. Data + can be read from the file, printed, and displayed as a function of NCUMIT rather than time. All + POST26 descriptions applying to TIME then apply to NCUMIT. + """ + command = f"TVAR,{key}" + return self.run(command, **kwargs) diff --git a/src/ansys/mapdl/core/_commands/post26/display.py b/src/ansys/mapdl/core/_commands/post26/display.py new file mode 100644 index 0000000000..f19dc4870d --- /dev/null +++ b/src/ansys/mapdl/core/_commands/post26/display.py @@ -0,0 +1,250 @@ +# Copyright (C) 2016 - 2025 ANSYS, Inc. and/or its affiliates. +# SPDX-License-Identifier: MIT +# +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to deal +# in the Software without restriction, including without limitation the rights +# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +# copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in all +# copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +# SOFTWARE. + + +class Display: + + def keep(self, key: str = "", **kwargs): + r"""Stores POST26 definitions and data during active session. + + Mechanical APDL Command: `KEEP `_ + + Parameters + ---------- + key : str + State or value + + * ``On or 1`` - Allows you to exit and reenter :ref:`post26` without losing your current time + history variable information. Keeps a cache of the :ref:`post26` variable information including the + active file name ( :ref:`file` ), variable definitions ( :ref:`nsol`, :ref:`esol`, :ref:`rforce`, + and :ref:`solu` ) and stored variable data in memory for the current Mechanical APDL session. + + * ``Off or 0`` - :ref:`post26` variable information is deleted when you exit :ref:`post26`. + + Notes + ----- + + .. _KEEP_notes: + + Your variable information is saved in memory only for the current active Mechanical APDL session. It + is + deleted when you exit Mechanical APDL. This information is also deleted when you issue ``/CLEAR``, + :ref:`resume`, :ref:`solve`, or :ref:`reset`. + + When you reenter :ref:`post26` all time history variable data is available for use. When you issue + :ref:`store`, NEW, variable definitions created by math operations such as :ref:`add` or :ref:`prod` + will not be restored. However, variables defined with :ref:`nsol`, :ref:`esol`, :ref:`rforce`, and + :ref:`solu` will be restored. Only the last active results file name is kept in memory ( + :ref:`file` ). + + Commands such as :ref:`layerp26`, :ref:`shell`, and :ref:`force` that specify the location or a + component of data to be stored will retain the setting at the time of exiting :ref:`post26`. + """ + command = f"KEEP,{key}" + return self.run(command, **kwargs) + + def plcplx(self, key: int | str = "", **kwargs): + r"""Specifies the part of a complex variable to display. + + Mechanical APDL Command: `PLCPLX `_ + + Parameters + ---------- + key : int or str + Complex variable part: + + * ``0`` - Amplitude. + + * ``1`` - Phase angle. + + * ``2`` - Real part. + + * ``3`` - Imaginary part. + + Notes + ----- + + .. _PLCPLX_notes: + + Used only with harmonic analyses ( :ref:`antype`,HARMIC). + + All results data are stored in the form of real and imaginary components and converted to amplitude + and/or phase angle as specified via the :ref:`plcplx` command. The conversion is not valid for + derived results (such as principal stress/strain, equivalent stress/strain and USUM). + """ + command = f"PLCPLX,{key}" + return self.run(command, **kwargs) + + def pltime(self, tmin: str = "", tmax: str = "", **kwargs): + r"""Defines the time range for which data are to be displayed. + + Mechanical APDL Command: `PLTIME `_ + + **Command default:** + + .. _PLTIME_default: + + Use the previously defined range ( :ref:`timerange` ). + + Parameters + ---------- + tmin : str + Minimum time (defaults to the first point stored). + + tmax : str + Maximum time (defaults to the last point stored). + + Notes + ----- + + .. _PLTIME_notes: + + Defines the time (or frequency) range (within the range stored) for which data are to be displayed. + Time is always displayed in the Z-axis direction for 3D graph displays. If XVAR = 1, time is also + displayed in the X-axis direction and this control also sets the abscissa scale range. + """ + command = f"PLTIME,{tmin},{tmax}" + return self.run(command, **kwargs) + + def plvar( + self, + nvar1: str = "", + nvar2: str = "", + nvar3: str = "", + nvar4: str = "", + nvar5: str = "", + nvar6: str = "", + nvar7: str = "", + nvar8: str = "", + nvar9: str = "", + nvar10: str = "", + **kwargs, + ): + r"""Displays up to ten variables in the form of a graph. + + Mechanical APDL Command: `PLVAR `_ + + Parameters + ---------- + nvar1 : str + Variables to be displayed, defined either by the reference number or a unique thirty-two + character name. If duplicate names are used the command will plot the data for the lowest- + numbered variable with that name. + + nvar2 : str + Variables to be displayed, defined either by the reference number or a unique thirty-two + character name. If duplicate names are used the command will plot the data for the lowest- + numbered variable with that name. + + nvar3 : str + Variables to be displayed, defined either by the reference number or a unique thirty-two + character name. If duplicate names are used the command will plot the data for the lowest- + numbered variable with that name. + + nvar4 : str + Variables to be displayed, defined either by the reference number or a unique thirty-two + character name. If duplicate names are used the command will plot the data for the lowest- + numbered variable with that name. + + nvar5 : str + Variables to be displayed, defined either by the reference number or a unique thirty-two + character name. If duplicate names are used the command will plot the data for the lowest- + numbered variable with that name. + + nvar6 : str + Variables to be displayed, defined either by the reference number or a unique thirty-two + character name. If duplicate names are used the command will plot the data for the lowest- + numbered variable with that name. + + nvar7 : str + Variables to be displayed, defined either by the reference number or a unique thirty-two + character name. If duplicate names are used the command will plot the data for the lowest- + numbered variable with that name. + + nvar8 : str + Variables to be displayed, defined either by the reference number or a unique thirty-two + character name. If duplicate names are used the command will plot the data for the lowest- + numbered variable with that name. + + nvar9 : str + Variables to be displayed, defined either by the reference number or a unique thirty-two + character name. If duplicate names are used the command will plot the data for the lowest- + numbered variable with that name. + + nvar10 : str + Variables to be displayed, defined either by the reference number or a unique thirty-two + character name. If duplicate names are used the command will plot the data for the lowest- + numbered variable with that name. + + Notes + ----- + + .. _PLVAR_notes: + + Variables are displayed vs. variable ``N`` on the :ref:`xvar` command. The string value will be a + predefined, unique name. For complex variables, the amplitude is displayed by default ( + :ref:`plcplx` ). Each :ref:`plvar` command produces a new frame. See the :ref:`grtyp` command for + displaying multiple variables in a single frame with separate Y-axes. + """ + command = f"PLVAR,{nvar1},{nvar2},{nvar3},{nvar4},{nvar5},{nvar6},{nvar7},{nvar8},{nvar9},{nvar10}" + return self.run(command, **kwargs) + + def spread(self, value: str = "", **kwargs): + r"""Turns on a dashed tolerance curve for the subsequent curve plots. + + Mechanical APDL Command: `SPREAD `_ + + Parameters + ---------- + value : str + Amount of tolerance. For example, 0.1 is ± 10%. + """ + command = f"SPREAD,{value}" + return self.run(command, **kwargs) + + def xvar(self, n: int | str = "", **kwargs): + r"""Specifies the X variable to be displayed. + + Mechanical APDL Command: `XVAR `_ + + Parameters + ---------- + n : int or str + X variable number: + + * ``0 or 1`` - Display :ref:`plvar` values vs. time (or frequency). + + * ``n`` - Display :ref:`plvar` values vs. variable ``n`` (2 to ``NV`` ( :ref:`numvar` )). + + * ``1`` - Interchange time and :ref:`plvar` variable numbers with time as the curve parameter. + :ref:`plvar` variable numbers are displayed uniformly spaced along X-axis from position 1 to 10. + + Notes + ----- + + .. _XVAR_notes: + + Defines the X variable (displayed along the abscissa) against which the Y variable(s) ( :ref:`plvar` + ) are to be displayed. + """ + command = f"XVAR,{n}" + return self.run(command, **kwargs) diff --git a/src/ansys/mapdl/core/_commands/post26/listing.py b/src/ansys/mapdl/core/_commands/post26/listing.py new file mode 100644 index 0000000000..f52961ca80 --- /dev/null +++ b/src/ansys/mapdl/core/_commands/post26/listing.py @@ -0,0 +1,213 @@ +# Copyright (C) 2016 - 2025 ANSYS, Inc. and/or its affiliates. +# SPDX-License-Identifier: MIT +# +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to deal +# in the Software without restriction, including without limitation the rights +# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +# copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in all +# copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +# SOFTWARE. + + +class Listing: + + def extrem(self, nvar1: str = "", nvar2: str = "", ninc: str = "", **kwargs): + r"""Lists the extreme values for variables. + + Mechanical APDL Command: `EXTREM `_ + + Parameters + ---------- + nvar1 : str + List extremes for variables ``NVAR1`` through ``NVAR2`` in steps of ``NINC``. Variable range + defaults to its maximum. ``NINC`` defaults to 1. + + nvar2 : str + List extremes for variables ``NVAR1`` through ``NVAR2`` in steps of ``NINC``. Variable range + defaults to its maximum. ``NINC`` defaults to 1. + + ninc : str + List extremes for variables ``NVAR1`` through ``NVAR2`` in steps of ``NINC``. Variable range + defaults to its maximum. ``NINC`` defaults to 1. + + Notes + ----- + + .. _EXTREM_notes: + + Lists the extreme values (and the corresponding times) for stored and calculated variables. Extremes + for stored variables are automatically listed as they are stored. Only the real part of a complex + number is used. Extreme values may also be assigned to parameters ( :ref:`get` ). + """ + command = f"EXTREM,{nvar1},{nvar2},{ninc}" + return self.run(command, **kwargs) + + def lines(self, n: str = "", **kwargs): + r"""Specifies the length of a printed page. + + Mechanical APDL Command: `LINES `_ + + Parameters + ---------- + n : str + Number of lines per page (defaults to 20). (Minimum allowed = 11). + + Notes + ----- + + .. _LINES_notes: + + Specifies the length of a printed page (for use in reports, etc.). + """ + command = f"LINES,{n}" + return self.run(command, **kwargs) + + def nprint(self, n: str = "", **kwargs): + r"""Defines which time points stored are to be listed. + + Mechanical APDL Command: `NPRINT `_ + + Parameters + ---------- + n : str + List data associated with every ``N`` time (or frequency) point(s), beginning with the first + point stored (defaults to 1). + + Notes + ----- + + .. _NPRINT_notes: + + Defines which time (or frequency) points within the range stored are to be listed. + """ + command = f"NPRINT,{n}" + return self.run(command, **kwargs) + + def prcplx(self, key: int | str = "", **kwargs): + r"""Defines the output form for complex variables. + + Mechanical APDL Command: `PRCPLX `_ + + Parameters + ---------- + key : int or str + Output form key: + + * ``0`` - Real and imaginary parts. + + * ``1`` - Amplitude and phase angle. Stored real and imaginary data are converted to amplitude and + phase angle upon output. Data remain stored as real and imaginary parts. + + Notes + ----- + + .. _PRCPLX_notes: + + Defines the output form for complex variables. Used only with harmonic analyses ( + :ref:`antype`,HARMIC). + + All results data are stored in the form of real and imaginary components and converted to amplitude + and/or phase angle as specified via the :ref:`prcplx` command. The conversion is not valid for + derived results (such as principal stress/strain, equivalent stress/strain and USUM). + """ + command = f"PRCPLX,{key}" + return self.run(command, **kwargs) + + def prtime(self, tmin: str = "", tmax: str = "", **kwargs): + r"""Defines the time range for which data are to be listed. + + Mechanical APDL Command: `PRTIME `_ + + **Command default:** + + .. _PRTIME_default: + + Use the previously defined range ( :ref:`timerange` ). + + Parameters + ---------- + tmin : str + Minimum time (defaults to the first point stored). + + tmax : str + Maximum time (defaults to the last point stored). + + Notes + ----- + + .. _PRTIME_notes: + + Defines the time (or frequency) range (within the range stored) for which data are to be listed. + """ + command = f"PRTIME,{tmin},{tmax}" + return self.run(command, **kwargs) + + def prvar( + self, + nvar1: str = "", + nvar2: str = "", + nvar3: str = "", + nvar4: str = "", + nvar5: str = "", + nvar6: str = "", + **kwargs, + ): + r"""Lists variables vs. time (or frequency). + + Mechanical APDL Command: `PRVAR `_ + + Parameters + ---------- + nvar1 : str + Variables to be displayed, defined either by the reference number or a unique thirty-two + character name. If duplicate names are used the command will print the data for the lowest- + numbered variable with that name. + + nvar2 : str + Variables to be displayed, defined either by the reference number or a unique thirty-two + character name. If duplicate names are used the command will print the data for the lowest- + numbered variable with that name. + + nvar3 : str + Variables to be displayed, defined either by the reference number or a unique thirty-two + character name. If duplicate names are used the command will print the data for the lowest- + numbered variable with that name. + + nvar4 : str + Variables to be displayed, defined either by the reference number or a unique thirty-two + character name. If duplicate names are used the command will print the data for the lowest- + numbered variable with that name. + + nvar5 : str + Variables to be displayed, defined either by the reference number or a unique thirty-two + character name. If duplicate names are used the command will print the data for the lowest- + numbered variable with that name. + + nvar6 : str + Variables to be displayed, defined either by the reference number or a unique thirty-two + character name. If duplicate names are used the command will print the data for the lowest- + numbered variable with that name. + + Notes + ----- + + .. _PRVAR_notes: + + Lists variables vs. time (or frequency). Up to six variables may be listed across the line. Time + column output format can be changed using the :ref:`format` command arguments ``Ftype``, ``NWIDTH``, + and ``DSIGNF``. + """ + command = f"PRVAR,{nvar1},{nvar2},{nvar3},{nvar4},{nvar5},{nvar6}" + return self.run(command, **kwargs) diff --git a/src/ansys/mapdl/core/_commands/post26/operations.py b/src/ansys/mapdl/core/_commands/post26/operations.py new file mode 100644 index 0000000000..719724d7a5 --- /dev/null +++ b/src/ansys/mapdl/core/_commands/post26/operations.py @@ -0,0 +1,863 @@ +# Copyright (C) 2016 - 2025 ANSYS, Inc. and/or its affiliates. +# SPDX-License-Identifier: MIT +# +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to deal +# in the Software without restriction, including without limitation the rights +# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +# copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in all +# copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +# SOFTWARE. + + +class Operations: + + def abs( + self, ir: str = "", ia: str = "", name: str = "", facta: str = "", **kwargs + ): + r"""Forms the absolute value of a variable. + + Mechanical APDL Command: `ABS `_ + + Parameters + ---------- + ir : str + Arbitrary reference number assigned to the resulting variable (2 to NV ( :ref:`numvar` )). If + this number is the same as for a previously defined variable, the previously defined variable + will be overwritten with this result. + + ia : str + Reference number of the variable to be operated on. + + name : str + Thirty-two character name for identifying the variable on the printout and displays. Embedded + blanks are compressed upon output. + + facta : str + Scaling factor (positive or negative) applied to variable ``IA`` (defaults to 1.0). + + Notes + ----- + + .. _ABS_notes: + + The new variable is calculated as: + + IR = \| FACTA x IA \| + + For a complex number (a + i b), the absolute value is the magnitude, where the ``IA`` values are + obtained from: + + .. math:: + + equation_not_available + + See `POST26 - Data Operations + `_ + in the `Mechanical APDL Theory Reference + `_ for details. + """ + command = f"ABS,{ir},{ia},,,{name},,,{facta}" + return self.run(command, **kwargs) + + def add( + self, + ir: str = "", + ia: str = "", + ib: str = "", + ic: str = "", + name: str = "", + facta: str = "", + factb: str = "", + factc: str = "", + **kwargs, + ): + r"""Adds (sums) variables. + + Mechanical APDL Command: `ADD `_ + + Parameters + ---------- + ir : str + Arbitrary reference number assigned to the resulting variable (2 to NV ( :ref:`numvar` )). If + this number is the same as for a previously defined variable, the previously defined variable + will be overwritten with this result. + + ia : str + Reference numbers of the three variables to be operated on. If only two variables, leave ``IC`` + blank. If only one, leave ``IB`` and ``IC`` blank. + + ib : str + Reference numbers of the three variables to be operated on. If only two variables, leave ``IC`` + blank. If only one, leave ``IB`` and ``IC`` blank. + + ic : str + Reference numbers of the three variables to be operated on. If only two variables, leave ``IC`` + blank. If only one, leave ``IB`` and ``IC`` blank. + + name : str + Thirty-two character name for identifying the variable on the printout and displays. Embedded + blanks are compressed upon output. + + facta : str + Scaling factors (positive or negative) applied to the corresponding variables (default to 1.0). + + factb : str + Scaling factors (positive or negative) applied to the corresponding variables (default to 1.0). + + factc : str + Scaling factors (positive or negative) applied to the corresponding variables (default to 1.0). + + Notes + ----- + + .. _ADD_notes: + + Adds variables (up to three at once) according to the operation: + + ``IR`` = ( ``FACTA`` x ``IA`` ) + ( ``FACTB`` x ``IB`` ) + ( ``FACTC`` x ``IC`` ) + + """ + command = f"ADD,{ir},{ia},{ib},{ic},{name},,,{facta},{factb},{factc}" + return self.run(command, **kwargs) + + def atan( + self, ir: str = "", ia: str = "", name: str = "", facta: str = "", **kwargs + ): + r"""Forms the arctangent of a complex variable. + + Mechanical APDL Command: `ATAN `_ + + Parameters + ---------- + ir : str + Arbitrary reference number assigned to the resulting variable (2 to ``NV`` ( :ref:`numvar` )). + If this number is the same as for a previously defined variable, the previously defined variable + will be overwritten with this result. + + ia : str + Reference number of the complex variable to be operated on. + + name : str + Thirty-two character name for identifying the variable on the printout and displays. Embedded + blanks are compressed upon output. + + facta : str + Scaling factor (positive or negative) applied to variable ``IA`` (defaults to 1.0). Usually + ``FACTA`` should be set to 1. ``FACTA`` may affect the position of the angle by a multiple of π, + resulting in a quadrant change. + + Notes + ----- + + .. _ATAN_notes: + + Forms the arctangent of a complex variable according to the operation: + + ``IR`` = ATAN( ``FACTA`` X b / a ) + + where a and b are the real and imaginary parts, respectively, of the complex variable ``IA`` (which + is of the form a + i b ). The arctangent represents the phase angle (in radians), and is valid only + for a harmonic analysis ( :ref:`antype`,HARMIC). + + Since the scaling factor is applied uniformly to b / a, applying any positive or negative scaling + factor will not affect the size of the phase angle, with the exception that a negative scaling + factor will change the results quadrant by π. The magnitude of a complex number is still obtained + through the :ref:`abs` command. See `POST26 - Data Operations + `_ + in the `Mechanical APDL Theory Reference + `_ for details. + """ + command = f"ATAN,{ir},{ia},,,{name},,,{facta}" + return self.run(command, **kwargs) + + def clog( + self, + ir: str = "", + ia: str = "", + name: str = "", + facta: str = "", + factb: str = "", + **kwargs, + ): + r"""Forms the common log of a variable + + Mechanical APDL Command: `CLOG `_ + + Parameters + ---------- + ir : str + Arbitrary reference number assigned to the resulting variable (2 to NV ( :ref:`numvar` )). If + this number is the same as for a previously defined variable, the previously defined variable + will be overwritten with this result. + + ia : str + Reference number of the variable to be operated on. + + name : str + Thirty-two character name for identifying the variable on printouts and displays. Embedded + blanks are compressed for output. + + facta : str + Scaling factor applied to variable ``IA`` (defaults to 1.0). + + factb : str + Scaling factor (positive or negative) applied to the operation (defaults to 1.0). + + Notes + ----- + + .. _CLOG_notes: + + Forms the common log of a variable according to the operation: + + ``IR`` = ``FACTB`` \*LOG( ``FACTA`` x ``IA`` ) + """ + command = f"CLOG,{ir},{ia},,,{name},,,{facta},{factb}" + return self.run(command, **kwargs) + + def conjug( + self, ir: str = "", ia: str = "", name: str = "", facta: str = "", **kwargs + ): + r"""Forms the complex conjugate of a variable. + + Mechanical APDL Command: `CONJUG `_ + + Parameters + ---------- + ir : str + Arbitrary reference number assigned to the resulting variable (2 to NV ( :ref:`numvar` )). If + this number is the same as for a previously defined variable, the previously defined variable + will be overwritten with this result. + + ia : str + Reference number of the variable to be operated on. + + name : str + Thirty-two character name for identifying the variable on printouts and displays. Embedded + blanks are compressed for output. + + facta : str + Scaling factor (positive or negative) applied to variable (default to 1.0). + + Notes + ----- + + .. _CONJUG_notes: + + Used only with harmonic analyses ( :ref:`antype`,HARMIC). + """ + command = f"CONJUG,{ir},{ia},,,{name},,,{facta}" + return self.run(command, **kwargs) + + def deriv( + self, + ir: str = "", + iy: str = "", + ix: str = "", + name: str = "", + facta: str = "", + **kwargs, + ): + r"""Differentiates a variable. + + Mechanical APDL Command: `DERIV `_ + + Parameters + ---------- + ir : str + Arbitrary reference number assigned to the resulting variable (2 to NV ( :ref:`numvar` )). If + this number is the same as for a previously defined variable, the previously defined variable + will be overwritten with this result. + + iy : str + Reference numbers of variables to be operated on. ``IY`` is differentiated with respect to + ``IX``. + + ix : str + Reference numbers of variables to be operated on. ``IY`` is differentiated with respect to + ``IX``. + + name : str + Thirty-two character name for identifying the variable on printouts and displays. Embedded + blanks are compressed for output. + + facta : str + Scaling factor (positive or negative) applied as shown below (defaults to 1.0). + + Notes + ----- + + .. _DERIV_notes: + + Differentiates variables according to the operation: + + ``IR`` = ``FACTA`` x d( ``IY`` )/d( ``IX`` ) + + Variable ``IX`` must be in ascending order. + """ + command = f"DERIV,{ir},{iy},{ix},,{name},,,{facta}" + return self.run(command, **kwargs) + + def exp( + self, + ir: str = "", + ia: str = "", + name: str = "", + facta: str = "", + factb: str = "", + **kwargs, + ): + r"""Forms the exponential of a variable. + + Mechanical APDL Command: `EXP `_ + + Parameters + ---------- + ir : str + Arbitrary reference number assigned to the resulting variable (2 to NV ( :ref:`numvar` )). If + this number is the same as for a previously defined variable, the previously defined variable + will be overwritten with this result. + + ia : str + Reference number of the variable to be operated on. + + name : str + Thirty-two character name for identifying the variable on the printout and displays. Embedded + blanks are compressed upon output. + + facta : str + Scaling factor applied to variable ``IA`` (defaults to 1.0). + + factb : str + Scaling factor (positive or negative) applied to the operation (defaults to 1.0). + + Notes + ----- + + .. _EXP_notes: + + Forms the exponential of a variable according to the operation: + + ``IR`` = ``FACTB`` \*EXP( ``FACTA`` x ``IA`` ) + + """ + command = f"EXP,{ir},{ia},,,{name},,,{facta},{factb}" + return self.run(command, **kwargs) + + def filldata( + self, + ir: str = "", + lstrt: str = "", + lstop: str = "", + linc: str = "", + value: str = "", + dval: str = "", + **kwargs, + ): + r"""Fills a variable by a ramp function. + + Mechanical APDL Command: `FILLDATA `_ + + Parameters + ---------- + ir : str + Define data table as variable ``IR`` (2 to ``NV`` ( :ref:`numvar` )). + + lstrt : str + Start at location ``LSTRT`` (defaults to 1). + + lstop : str + Stop at location ``LSTOP`` (defaults to maximum location as determined from data previously + stored. + + linc : str + Fill every ``LINC`` location between ``LSTRT`` and ``LSTOP`` (defaults to 1). + + value : str + Value assigned to location ``LSTRT``. + + dval : str + Increment value of previous filled location by ``DVAL`` and assign sum to next location to be + filled (may be positive or negative.) + + Notes + ----- + + .. _FILLDATA_notes: + + Locations may be filled continuously or at regular intervals ( ``LINC`` ). Previously defined data + at a location will be overwritten. + """ + command = f"FILLDATA,{ir},{lstrt},{lstop},{linc},{value},{dval}" + return self.run(command, **kwargs) + + def imagin( + self, ir: str = "", ia: str = "", name: str = "", facta: str = "", **kwargs + ): + r"""Forms an imaginary variable from a complex variable. + + Mechanical APDL Command: `IMAGIN `_ + + Parameters + ---------- + ir : str + Arbitrary reference number assigned to the resulting variable (2 to ``NV`` ( :ref:`numvar` )). + If this number is the same as for a previously defined variable, the previously defined variable + will be overwritten with this result. + + ia : str + Reference number of the variable to be operated on. + + name : str + Thirty-two character name for identifying the variable on the printout and displays. Embedded + blanks are compressed upon output. + + facta : str + Scaling factor (positive or negative) applied to variable ``IA`` (defaults to 1.0). + + Notes + ----- + + .. _IMAGIN_notes: + + This command forms a new variable from a complex variable by storing the imaginary part as the real + part. The imaginary part can then be used in other operations. Used only with harmonic analyses ( + :ref:`antype`,HARMIC). + + Complex variables are stored in two-column arrays with the real component stored in the first column + and the imaginary component stored in the second column. This command extracts the value stored in + the second column (that is, imaginary component). However, with harmonic analyses, all variables are + stored in two-column arrays as complex variables. If the variable is not complex, then the same + value is stored in both columns. This command will extract the variable in the second column of the + array, even if this variable is not the imaginary component of a complex variable. + """ + command = f"IMAGIN,{ir},{ia},,,{name},,,{facta}" + return self.run(command, **kwargs) + + def int1( + self, + ir: str = "", + iy: str = "", + ix: str = "", + name: str = "", + facta: str = "", + factb: str = "", + const: str = "", + **kwargs, + ): + r"""Integrates a variable. + + Mechanical APDL Command: `INT1 `_ + + Parameters + ---------- + ir : str + Arbitrary reference number assigned to the resulting variable (2 to ``NV`` ( :ref:`numvar` )). + If this number is the same as for a previously defined variable, the previously defined variable + will be overwritten with this result. Table values represent integrated sum of ``IY`` to current + table position of ``IX``. + + iy : str + Integrate variable ``IY`` with respect to ``IX``. + + ix : str + Integrate variable ``IY`` with respect to ``IX``. + + name : str + Thirty-two character name for identifying the variable on the printout and displays. Embedded + blanks are compressed upon output. + + facta : str + Scaling factors (positive or negative) applied to the corresponding variables (default to 1.0). + + factb : str + Scaling factors (positive or negative) applied to the corresponding variables (default to 1.0). + + const : str + Initial value. + + Notes + ----- + + .. _INT1_notes: + + Integrates variables according to the operation: + + ``IR`` = ∫ ( ``FACTA`` x ``IY`` ) d( ``FACTB`` x ``IX`` ) + ``CONST`` + + """ + command = f"INT1,{ir},{iy},{ix},,{name},,,{facta},{factb},{const}" + return self.run(command, **kwargs) + + def large( + self, + ir: str = "", + ia: str = "", + ib: str = "", + ic: str = "", + name: str = "", + facta: str = "", + factb: str = "", + factc: str = "", + **kwargs, + ): + r"""Finds the largest (the envelope) of three variables. + + Mechanical APDL Command: `LARGE `_ + + Parameters + ---------- + ir : str + Arbitrary reference number assigned to the resulting variable (2 to ``NV`` ( :ref:`numvar` )). + If this number is the same as for a previously defined variable, the previously defined variable + will be overwritten with this result. + + ia : str + Reference numbers of the three variables to be operated on. If only two, leave ``IC`` blank. If + only one, leave ``IB`` blank also. + + ib : str + Reference numbers of the three variables to be operated on. If only two, leave ``IC`` blank. If + only one, leave ``IB`` blank also. + + ic : str + Reference numbers of the three variables to be operated on. If only two, leave ``IC`` blank. If + only one, leave ``IB`` blank also. + + name : str + Thirty-two character name for identifying the variable on the printout and displays. Embedded + blanks are compressed upon output. + + facta : str + Scaling factors (positive or negative) applied to the corresponding variables (default to 1.0). + + factb : str + Scaling factors (positive or negative) applied to the corresponding variables (default to 1.0). + + factc : str + Scaling factors (positive or negative) applied to the corresponding variables (default to 1.0). + + Notes + ----- + + .. _LARGE_notes: + + Creates a new variable by finding the largest of up to three variables according to the operation: + + ``IR`` = Largest of ( ``FACTA`` x ``IA``, ``FACTB`` x ``IB``, ``FACTC`` x ``IC`` ) + + The comparison is done at each time location, so that the new variable is the "envelope" of the + three existing variables. + """ + command = f"LARGE,{ir},{ia},{ib},{ic},{name},,,{facta},{factb},{factc}" + return self.run(command, **kwargs) + + def nlog( + self, + ir: str = "", + ia: str = "", + name: str = "", + facta: str = "", + factb: str = "", + **kwargs, + ): + r"""Forms the natural log of a variable. + + Mechanical APDL Command: `NLOG `_ + + Parameters + ---------- + ir : str + Arbitrary reference number assigned to the resulting variable (2 to NV ( :ref:`numvar` )). If + this number is the same as for a previously defined variable, the previously defined variable + will be overwritten with this result. + + ia : str + Reference number of the variable to be operated on. + + name : str + Thirty-two character name identifying the variable on printouts and displays. Embedded blanks + are compressed for output. + + facta : str + Scaling factor applied to variable ``IA`` (defaults to 1.0). + + factb : str + Scaling factor (positive or negative) applied to the operation (defaults to 1.0). + + Notes + ----- + + .. _NLOG_notes: + + Forms the natural log of a variable according to the operation: + + ``IR`` = ``FACTB`` \*LN( ``FACTA`` x ``IA`` ) + + """ + command = f"NLOG,{ir},{ia},,,{name},,,{facta},{factb}" + return self.run(command, **kwargs) + + def prod( + self, + ir: str = "", + ia: str = "", + ib: str = "", + ic: str = "", + name: str = "", + facta: str = "", + factb: str = "", + factc: str = "", + **kwargs, + ): + r"""Multiplies variables. + + Mechanical APDL Command: `PROD `_ + + Parameters + ---------- + ir : str + Arbitrary reference number assigned to the resulting variable (2 to NV ( :ref:`numvar` )). If + this number is the same as for a previously defined variable, the previously defined variable + will be overwritten with this result. + + ia : str + Reference numbers of the three variables to be operated on. If only two leave ``IC`` blank. If + only one, leave ``IB`` blank also. + + ib : str + Reference numbers of the three variables to be operated on. If only two leave ``IC`` blank. If + only one, leave ``IB`` blank also. + + ic : str + Reference numbers of the three variables to be operated on. If only two leave ``IC`` blank. If + only one, leave ``IB`` blank also. + + name : str + Thirty-two character name identifying the variable on printouts and displays. Embedded blanks + are compressed for output. + + facta : str + Scaling factors (positive or negative) applied to the corresponding variables (default to 1.0). + + factb : str + Scaling factors (positive or negative) applied to the corresponding variables (default to 1.0). + + factc : str + Scaling factors (positive or negative) applied to the corresponding variables (default to 1.0). + + Notes + ----- + + .. _PROD_notes: + + Multiplies variables (up to three at once) according to the operation: + + ``IR`` = ( ``FACTA`` x ``IA`` ) x ( ``FACTB`` x ``IB`` ) x ( ``FACTC`` x ``IC`` ) + + """ + command = f"PROD,{ir},{ia},{ib},{ic},{name},,,{facta},{factb},{factc}" + return self.run(command, **kwargs) + + def quot( + self, + ir: str = "", + ia: str = "", + ib: str = "", + name: str = "", + facta: str = "", + factb: str = "", + **kwargs, + ): + r"""Divides two variables. + + Mechanical APDL Command: `QUOT `_ + + Parameters + ---------- + ir : str + Arbitrary reference number assigned to the resulting variable (2 to ``NV`` ( :ref:`numvar` )). + If this number is the same as for a previously defined variable, the previously defined variable + will be overwritten with this result. + + ia : str + Reference numbers of the two variables to be operated on. + + ib : str + Reference numbers of the two variables to be operated on. + + name : str + Thirty-two character name identifying the variable on printouts and displays. Embedded blanks + are compressed for output. + + facta : str + Scaling factors (positive or negative) applied to the corresponding variables (default to 1.0). + + factb : str + Scaling factors (positive or negative) applied to the corresponding variables (default to 1.0). + + Notes + ----- + + .. _QUOT_notes: + + Divides two variables according to the operation: + + ``IR`` = ( ``FACTA`` x ``IA`` )/( ``FACTB`` x ``IB`` ) + + """ + command = f"QUOT,{ir},{ia},{ib},,{name},,,{facta},{factb}" + return self.run(command, **kwargs) + + def realvar( + self, ir: str = "", ia: str = "", name: str = "", facta: str = "", **kwargs + ): + r"""Forms a variable using only the real part of a complex variable. + + Mechanical APDL Command: `REALVAR `_ + + Parameters + ---------- + ir : str + Arbitrary reference number assigned to the resulting variable (2 to NV ( :ref:`numvar` )). If + this number is the same as for a previously defined variable, the previously defined variable + will be overwritten with this result. + + ia : str + Reference number of the variable to be operated on. + + name : str + Thirty-two character name identifying the variable on printouts and displays. Embedded blanks + are compressed for output. + + facta : str + Scaling factor (positive or negative) applied to variable ``IA`` (defaults to 1.0). + + Notes + ----- + + .. _REALVAR_notes: + + Forms a variable using only the real part of a variable. Used only with harmonic analyses ( + :ref:`antype`,HARMIC). + + Complex variables are stored in two-column arrays with the real component stored in the first column + and the imaginary component stored in the second column. This command extracts the value stored in + the first column (that is, real component). However with harmonic analyses, all variables are stored + in two-column arrays as complex variables. If the variable is not complex, then the same value is + stored in both columns. This command will extract the variable in the first column of the array, + even if this variable is not the real component of a complex variable. + """ + command = f"REALVAR,{ir},{ia},,,{name},,,{facta}" + return self.run(command, **kwargs) + + def small( + self, + ir: str = "", + ia: str = "", + ib: str = "", + ic: str = "", + name: str = "", + facta: str = "", + factb: str = "", + factc: str = "", + **kwargs, + ): + r"""Finds the smallest of three variables. + + Mechanical APDL Command: `SMALL `_ + + Parameters + ---------- + ir : str + Arbitrary reference number assigned to the resulting variable (2 to ``NV`` ( :ref:`numvar` )). + If this number is the same as for a previously defined variable, the previously defined variable + will be overwritten with this result. + + ia : str + Reference numbers of the three variables to be operated on. If only two, leave ``IC`` blank. If + only one, leave ``IB`` blank also. + + ib : str + Reference numbers of the three variables to be operated on. If only two, leave ``IC`` blank. If + only one, leave ``IB`` blank also. + + ic : str + Reference numbers of the three variables to be operated on. If only two, leave ``IC`` blank. If + only one, leave ``IB`` blank also. + + name : str + Thirty-two character name identifying the variable on printouts and displays. Embedded blanks + are compressed for output. + + facta : str + Scaling factors (positive or negative) applied to the corresponding variables (defaults to 1.0). + + factb : str + Scaling factors (positive or negative) applied to the corresponding variables (defaults to 1.0). + + factc : str + Scaling factors (positive or negative) applied to the corresponding variables (defaults to 1.0). + + Notes + ----- + + .. _SMALL_notes: + + Finds the smallest of three variables according to the operation: + + ``IR`` = smallest of ( ``FACTA`` x ``IA``, ``FACTB`` x ``IB``, ``FACTC`` x ``IC`` ) + + """ + command = f"SMALL,{ir},{ia},{ib},{ic},{name},,,{facta},{factb},{factc}" + return self.run(command, **kwargs) + + def sqrt( + self, ir: str = "", ia: str = "", name: str = "", facta: str = "", **kwargs + ): + r"""Forms the square root of a variable. + + Mechanical APDL Command: `SQRT `_ + + Parameters + ---------- + ir : str + Arbitrary reference number assigned to the resulting variable (2 to ``NV`` ( :ref:`numvar` )). + If this number is the same as for a previously defined variable, the previously defined variable + will be overwritten with this result. + + ia : str + Reference number of the variable to be operated on. + + name : str + Thirty-two character name identifying the variable on printouts and displays. Embedded blanks + are compressed for output. + + facta : str + Scaling factor (positive or negative) applied to variable ``IA`` (defaults to 1.0). + + Notes + ----- + + .. _SQRT_notes: + + Forms the square root of a variable according to the operation: + + .. math:: + + equation_not_available + """ + command = f"SQRT,{ir},{ia},,,{name},,,{facta}" + return self.run(command, **kwargs) diff --git a/src/ansys/mapdl/core/_commands/post26/set_up.py b/src/ansys/mapdl/core/_commands/post26/set_up.py new file mode 100644 index 0000000000..3dba082016 --- /dev/null +++ b/src/ansys/mapdl/core/_commands/post26/set_up.py @@ -0,0 +1,1668 @@ +# Copyright (C) 2016 - 2025 ANSYS, Inc. and/or its affiliates. +# SPDX-License-Identifier: MIT +# +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to deal +# in the Software without restriction, including without limitation the rights +# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +# copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in all +# copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +# SOFTWARE. + + +class SetUp: + + def ansol( + self, + nvar: str = "", + node: str = "", + item: str = "", + comp: str = "", + name: str = "", + mat: str = "", + real: str = "", + ename: str = "", + datakey: str = "", + **kwargs, + ): + r"""Specifies averaged element nodal data to be stored from the results file. + + Mechanical APDL Command: `ANSOL `_ + + Parameters + ---------- + nvar : str + Arbitrary reference number assigned to this variable (2 to ``NV`` ( :ref:`numvar` )). Overwrites + any existing results for this variable. + + node : str + Node number for which data are to be stored. + + item : str + Label identifying the item. General item labels are shown in :ref:`ANSOL_tab_1`below. Some items + also require a component label. + + comp : str + Component of the item (if required). General component labels are shown in :ref:`ANSOL_tab_1`. + Selected result components ( ``Item`` = SRES) are shown in :ref:`ANSOL_tab_2`. + + name : str + 32-character name to identify the item on the printout and displays. Default: An eight-character + label formed by concatenating the first four characters of the ``Item`` and ``Comp`` labels. + + mat : str + Material number. Average is calculated based on the subset of elements with the specified + material number. Default: Use all elements in the active set unless ``Real`` and/or ``Ename`` is + specified. + + real : str + Real number. Average is calculated based on the subset of elements with the specified real + number. Default: Use all elements in the active set unless ``Mat`` and/or ``Ename`` is + specified. + + ename : str + Element type name. Average is calculated based on the subset of elements with the specified + element type name. Default: Use all elements in the active set unless ``Mat`` and/or ``Real`` is + specified. + + datakey : str + Key to specify which data is stored: + + * ``AUTO`` - `Nodal-averaged results + `_ are + used if they are available for the first applicable time step; otherwise, the element-based data is + used, if available. (Default.) + + * ``ESOL`` - Only element-based results are used. If they are not available, the command is ignored. + + * ``NAR`` - Only nodal-averaged results are used. If they are not available, the command is ignored. + + ``Mat``, ``Real``, and ``Ename`` are ignored when nodal-averaged results are used. + + Notes + ----- + + .. _ANSOL_notes: + + Valid item and component labels for element nodal results are listed in :ref:`ANSOL_tab_1`. + + :ref:`ansol` defines element nodal results data to be stored from a results file ( :ref:`file` ). + Not all items are valid for all nodes. See the input and output summary tables of each element + attached to the node for the available items. + + If `nodal-averaged results + `_ ( + :ref:`outres`,NAR or another nodal-averaged label) are available, then :ref:`ansol` uses the nodal- + averaged data for the applicable items (S, EPEL, EPPL, EPCR, EPTH) as dictated by the by ``DataKey`` + argument. By default, ( ``DataKey`` = AUTO), the availability of nodal-averaged results or element- + based data is determined at the first load step that has results for the associated item. For more + information, see `Postprocessing Nodal-Averaged Results + `_ + + **Coordinate systems:** Generally, element nodal quantities stored by :ref:`ansol` are obtained in + the solution coordinate system ( :ref:`rsys`, SOLU) and then averaged. There are some exceptions as + listed below. :ref:`ansol` does not transform results from :ref:`rsys`,SOLU (or from the coordinate + systems described for the exceptions below) to other coordinate systems. Verify that all elements + attached to the subject node have the same coordinate system before using :ref:`ansol`. + + * Layered element results are in the layer coordinate system ( :ref:`rsys`,LSYS). You can further + specify the element nodal results, for some elements, with the :ref:`shell`, :ref:`layerp26`, and + :ref:`force` commands. + + * When :ref:`ansol` is used to store nodal-averaged result data (based on the ``DataType`` setting), + the global Cartesian coordinate system ( :ref:`rsys`,0) is used. + + **Shell elements:** The default shell element coordinate system is based on node ordering. For shell + elements the + adjacent elements could have a different :ref:`rsys`,SOLU, making the resultant averaged data + inconsistent. A message to this effect is issued when :ref:`ansol` is used in models containing + shell elements. Ensure that consistent coordinate systems are active for all associated elements + used by the :ref:`ansol` command. + + **Derived quantities:** Some of the result items supported by :ref:`ansol` ( :ref:`ANSOL_tab_1`) are + derived from the component quantities. Issue :ref:`avprin` to specify the principal and vector sum + quantity averaging methods. + + **Default:** If ``Mat``, ``Real``, and ``Ename`` are not specified, all elements attached to the + node are considered. When a material ID, real constant ID, or element-type discontinuity is detected + at a node, a message is issued. For example, in a FSI analysis, a ``FLUID30`` element at the + structure interface would be considered; however, because it contains no SX result, it is not used + during :ref:`store` operations. + + .. _ANSOL_tab_1: + + ANSOL - General Result Item and Component Labels + ************************************************ + + .. flat-table:: General Item and Component Labels :ref:`ansol`, ``NVAR,NODE,Item,Comp,Name,Mat,Real,Ename,DataType`` + :header-rows: 1 + + * - Item + - Comp + - Description + * - :rspan:`3` S + - X, Y, Z, XY, YZ, XZ + - Component stress. This item stores `nodal-averaged results `_ if they are available on the results file. + * - 1, 2, 3 + - Principal stress. + * - INT + - Stress intensity. + * - EQV + - Equivalent stress. + * - :rspan:`3` EPEL + - X, Y, Z, XY, YZ, XZ + - Component elastic strain. + * - 1, 2, 3 + - Principal elastic strain. + * - INT + - Elastic strain intensity. + * - EQV + - Elastic equivalent strain. + * - :rspan:`3` EPPL + - X, Y, Z, XY, YZ, XZ + - Component plastic strain. + * - 1, 2, 3 + - Principal plastic strain. + * - INT + - Plastic strain intensity. + * - EQV + - Plastic equivalent strain. + * - :rspan:`3` EPCR + - X, Y, Z, XY, YZ, XZ + - Component creep strain. + * - 1,2,3 + - Principal creep strain. + * - INT + - Creep strain intensity. + * - EQV + - Creep equivalent strain. + * - :rspan:`3` EPTH + - X, Y, Z, XY, YZ, XZ + - Component thermal strain. + * - 1, 2, 3 + - Principal thermal strain. + * - INT + - Thermal strain intensity. + * - EQV + - Thermal equivalent strain. + * - :rspan:`3` ESIG + - X, Y, Z, XY, YZ, XZ + - Components of Biot``s effective stress. + * - 1, 2, 3 + - Principal stresses of Biot's effective stress. + * - INT + - Stress intensity of Biot's effective stress. + * - EQV + - Equivalent stress of Biot's effective stress. + * - :rspan:`6` NL + - SEPL + - Equivalent stress (from stress-strain curve). + * - SRAT + - Stress state ratio. + * - HPRES + - Hydrostatic pressure. + * - EPEQ + - Accumulated equivalent plastic strain. + * - CREQ + - Accumulated equivalent creep strain. + * - PSV + - Plastic state variable. + * - PLWK + - Plastic work/volume. + * - :rspan:`9` CONT + - STAT For more information about the meaning of contact status and its possible values, see `Reviewing Results in POST1 `_ + - Contact status. + * - PENE + - Contact penetration. + * - PRES + - Contact pressure. + * - SFRIC + - Contact friction stress. + * - STOT + - Contact total stress (pressure plus friction). + * - SLIDE + - Contact sliding distance. + * - GAP + - Contact gap distance. + * - FLUX + - Total heat flux at contact surface. + * - CNOS + - Total number of contact status changes during substep. + * - FPRS + - Fluid penetration pressure. + * - TG + - X, Y, Z, SUM ``Comp`` = SUM is not supported for coupled pore-pressure-thermal (CPT ``nnn`` ) elements. + - Component thermal gradient or vector sum. + * - TF + - X, Y, Z, SUM + - Component thermal flux or vector sum. + * - PG + - X, Y, Z, SUM + - Component pressure gradient or vector sum. + * - EF + - X, Y, Z, SUM + - Component electric field or vector sum. + * - D + - X, Y, Z, SUM + - Component electric flux density or vector sum. + * - H + - X, Y, Z, SUM + - Component magnetic field intensity or vector sum. + * - B + - X, Y, Z, SUM + - Component magnetic flux density or vector sum. + * - CG + - X, Y, Z, SUM + - Component concentration gradient or vector sum. + * - DF + - X, Y, Z, SUM + - Component diffusion flux density or vector sum. + * - JC + - X, Y, Z, SUM + - Conduction current density for elements that support conduction current calculation. Components (X, Y, Z) and vector sum (SUM). + * - FFLX + - X, Y, Z + - Fluid-flow flux in poromechanics. + * - FGRA + - X, Y, Z + - Fluid pore-pressure gradient in poromechanics. + * - PMSV + - VRAT, PPRE, DSAT, RPER + - Void volume ratio, pore pressure, degree of saturation, and relative permeability for coupled pore-pressure-thermal elements. + * - NS + - X, Y, Z, XY, YZ, XZ + - `Nominal strain `_ for hyperelastic material, reported in the current configuration (unaffected by :ref:`rsys` ). + * - MPLA + - DMAC, DMAX + - Microplane damage, macroscopic and maximum values. + * - MPDP + - TOTA, TENS, COMP, RW + - Microplane homogenized total, tension, and compression damages (TOTA, TENS, COMP), and split weight factor (RW). + * - EPFR + - + - Free strain in porous media + * - DAMAGE + - 1,2,3,MAX + - Damage in directions 1, 2, 3 (1, 2, 3) and the maximum damage (MAX). + * - GDMG + - + - Damage + * - IDIS + - + - Structural-thermal dissipation rate + + + .. _ANSOL_tab_2: + + ANSOL - Selected Result Component Labels + **************************************** + + .. flat-table:: Selected Result Component Labels :ref:`ansol`, ``NVAR``, ``NODE``,SRES, ``Comp``, ``Name``, ``Mat``, ``Real``, ``Ename`` + :header-rows: 1 + + * - Comp + - Description + * - SVAR ``n`` + - The ``n`` th state variable. + * - FLDUF0 ``n`` + - The ``n`` th user-defined field variable. + + """ + command = ( + f"ANSOL,{nvar},{node},{item},{comp},{name},{mat},{real},{ename},{datakey}" + ) + return self.run(command, **kwargs) + + def cisol( + self, + n: str = "", + id_: str = "", + node: str = "", + cont: str = "", + dtype: str = "", + **kwargs, + ): + r"""Stores fracture parameter information in a variable. + + Mechanical APDL Command: `CISOL `_ + + Parameters + ---------- + n : str + Arbitrary reference number or name assigned to this variable. Number must be >1 but `_ + + Parameters + ---------- + ir : str + Arbitrary reference number assigned to the resulting variable (2 to NV ( :ref:`numvar` )). If + this number is the same as for a previously defined variable, the previously defined variable + will be overwritten with this result. + + lstrt : str + Start at location ``LSTRT`` (defaults to 1). + + lstop : str + Stop at location ``LSTOP`` (defaults to ``LSTRT`` ). Maximum location available is determined + from data previously stored. + + linc : str + Fill every ``LINC`` location between ``LSTRT`` and ``LSTOP`` (defaults to 1). + + name : str + Eight character name for identifying the variable on the printout and displays. Embedded blanks + are compressed upon output. + + kcplx : int or str + Complex number key: + + * ``0`` - Data stored as the real part of the complex number. + + * ``1`` - Data stored as the imaginary part of the complex number. + + Notes + ----- + + .. _DATA_notes: + + This command must be followed by a format statement (on the next line) and the subsequent data + records, and all must be on the same file (that may then be read with the :ref:`input` command). The + format specifies the number of fields to be read per record, the field width, and the placement of + the decimal point (if one is not included in the data value). The read operation follows the + available FORTRAN FORMAT conventions of the system. See the system FORTRAN manual for details. Any + standard FORTRAN real format (such as (4F6.0), (F2.0,2X,F12.0), etc.) may be used. Integer (I), + character (A), and list-directed (\2) descriptors may not be used. The parentheses must be included + in the format. Up to 80 columns per record may be read. Locations may be filled within a range. + Previous data in the range will be overwritten. + """ + command = f"DATA,{ir},{lstrt},{lstop},{linc},{name},{kcplx}" + return self.run(command, **kwargs) + + def enersol(self, nvar: str = "", item: str = "", name: str = "", **kwargs): + r"""Specifies the total energies to be stored. + + Mechanical APDL Command: `ENERSOL `_ + + Parameters + ---------- + nvar : str + Arbitrary reference number assigned to this variable (2 to NV). + + item : str + + * ``SENE`` - Potential energy (stiffness energy) + + * ``KENE`` - Kinetic energy + + * ``DENE`` - Damping energy + + * ``WEXT`` - Work done by external load + + * ``AENE`` - Artificial energy due to hourglass control/drill stiffness or due to contact + stabilization damping + + * ``STEN`` - Artificial energy due to nonlinear stabilization + + name : str + A 32-character name identifying the item on printouts and displays. Defaults to a 4-character + label formed by the four characters of the ``Item`` value. + + Notes + ----- + + .. _ENERSOL_Notes: + + Damping energy (DENE) and work done by external loads (WEXT) are available only if the following + were set prior to the analysis solution: ``EngCalc`` = YES on the :ref:`trnopt`, :ref:`hrout` or + :ref:`mxpand` command; and ``Item`` = VENG, ESOL, or ALL on the :ref:`outres` command. + + If ``EngCalc`` = YES on the :ref:`hrout` or :ref:`mxpand` command, ``Item`` = SENE and KENE are the + average potential and kinetic energies, respectively. + """ + command = f"ENERSOL,{nvar},{item},,{name}" + return self.run(command, **kwargs) + + def esol( + self, + nvar: str = "", + elem: str = "", + node: str = "", + item: str = "", + comp: str = "", + name: str = "", + **kwargs, + ): + r"""Specifies element data to be stored from the results file. + + Mechanical APDL Command: `ESOL `_ + + Parameters + ---------- + nvar : str + Arbitrary reference number assigned to this variable (2 to ``NV`` ( :ref:`numvar` )). Overwrites + any existing results for this variable. + + elem : str + Element for which data are to be stored. If ``ELEM`` = P, graphical picking is enabled (valid + only in the GUI). + + node : str + Node number on this element for which data are to be stored. If blank, store the average element + value (except for ``FMAG`` values, which are summed instead of averaged). If ``NODE`` = P, + graphical picking is enabled (valid only in the GUI). + + item : str + Label identifying the item. General item labels are shown in :ref:`ESOL_tab_1`. Some items also + require a component label. + + comp : str + Component of the item (if required). General component labels are shown in + :ref:`ESOL_tab_1`below. If ``Comp`` is a sequence number ( ``n`` ), the ``NODE`` field is + ignored. + + name : str + 32-character name for identifying the item on the printout and displays. Defaults to a label + formed by concatenating the first four characters of the ``Item`` and ``Comp`` labels. + + Notes + ----- + + .. _ESOL_notes: + + See :ref:`ESOL_tab_1`for a list of item and component labels for element (excluding line element) + results. See :ref:`ESOL_tab_2`for a list of valid selected result ( ``Item`` = SRES) components. + + :ref:`esol` defines element results data to be stored from a results file ( :ref:`file` ). Not all + items are valid for all elements. To see the available items for a given element, refer to the input + and output summary tables in the documentation for that element. + + Two methods of data access are available via the :ref:`esol` command. You can access some data by + using a generic label ( component name method ), while others require a label and number ( sequence + number method ). + + Use the component name method to access general element data (that is, element data generally + available to most element types or groups of element types). Element results are in the element + coordinate system, except for layered elements where results are in the layer coordinate system. + Element forces and moments are in the nodal coordinate system. Results are obtainable for an element + at a specified node. Further location specifications can be made for some elements via :ref:`shell`, + :ref:`layerp26`, and :ref:`force`. + + The sequence number method is required for data that is not averaged (such as pressures at nodes and + temperatures at integration points), or data that is not easily described generically (such as all + derived data for structural line elements and contact elements, all derived data for thermal line + elements, and layer data for layered elements). + + In a `2D to 3D analysis + `_, this + command not supported in the POST26 postprocessor and is ignored. + + .. _ESOL_tab_1: + + ESOL - General Result Item and Component Labels + *********************************************** + + .. flat-table:: Component Name Method + :header-rows: 1 + + * - Item + - Comp + - Description + * - :rspan:`3` S + - X, Y, Z, XY, YZ, XZ + - Component stress. + * - 1, 2, 3 + - Principal stress. + * - INT + - Stress intensity. + * - EQV + - Equivalent stress. + * - :rspan:`3` EPEL + - X, Y, Z, XY, YZ, XZ + - Component elastic strain. + * - 1, 2, 3 + - Principal elastic strain. + * - INT + - Elastic strain intensity. + * - EQV + - Elastic equivalent strain. + * - :rspan:`3` EPTH + - X, Y, Z, XY, YZ, XZ + - Component thermal strain. + * - 1, 2, 3 + - Principal thermal strain. + * - INT + - Thermal strain intensity. + * - EQV + - Thermal equivalent strain. + * - :rspan:`3` EPPL + - X, Y, Z, XY, YZ, XZ + - Component plastic strain. + * - 1, 2, 3 + - Principal plastic strain. + * - INT + - Plastic strain intensity. + * - EQV + - Plastic equivalent strain. + * - :rspan:`3` EPCR + - X, Y, Z, XY, YZ, XZ + - Component creep strain. + * - 1,2,3 + - Principal creep strain. + * - INT + - Creep strain intensity. + * - EQV + - Creep equivalent strain. + * - :rspan:`3` EPDI + - X, Y, Z, XY, YZ, XZ + - Component diffusion strain. + * - 1, 2, 3 + - Principal diffusion strain. + * - INT + - Diffusion strain intensity. + * - EQV + - Diffusion equivalent strain. + * - :rspan:`6` NL + - SEPL + - Equivalent stress (from stress-strain curve). + * - SRAT + - Stress state ratio. + * - HPRES + - Hydrostatic pressure. + * - EPEQ + - Accumulated equivalent plastic strain. + * - CREQ + - Accumulated equivalent creep strain. + * - PSV + - Plastic state variable. + * - PLWK + - Plastic work/volume. + * - :rspan:`7` SEND + - ELASTIC The results for this postprocessing SEND component are invalid for ``ELBOW290`` if that element is used with viscoelastic or viscohyperelastic materials. + - Elastic strain energy density. (For `viscoelastic `_ and `sintering `_ materials, the `stored energy `_.) + * - PLASTIC + - Plastic strain energy density. + * - CREEP + - Creep strain energy density. + * - DAMAGE + - Damage strain energy density. + * - VDAM + - Viscoelastic dissipation energy density. + * - VREG + - Visco-regularization strain energy density. + * - DISS + - Structural-thermal dissipation. + * - ENTO + - Total strain energy density (sum of ELASTIC, PLASTIC, and CREEP strain energy densities). + * - :rspan:`1` CDM + - DMG + - Damage variable. + * - LM + - Maximum previous strain energy for virgin material. + * - GKS + - X + - Gasket component stress (also gasket pressure). + * - GKD + - X + - Gasket component total closure. + * - GKDI + - X + - Gasket component total inelastic closure. + * - GKTH + - X + - Gasket component thermal closure. + * - SS + - X, XY, XZ + - Interface traction (stress). + * - SD + - X,XY,XZ + - Interface separation. + * - :rspan:`9` CONT + - STAT For more information about the meaning of contact status and its possible values, see `Reviewing Results in POST1 `_ + - Contact status. + * - PENE + - Contact penetration. + * - PRES + - Contact pressure. + * - SFRIC + - Contact friction stress. + * - STOT + - Contact total stress (pressure plus friction). + * - SLIDE + - Contact sliding distance. + * - GAP + - Contact gap distance. + * - FLUX + - Total heat flux at contact surface. + * - CNOS + - Total number of contact status changes during substep. + * - FPRS + - Fluid penetration pressure. + * - TG For ``SHELL131`` and ``SHELL132`` elements with KEYOPT(3) = 0 or 1, use the labels HBOT, HE2, HE3..., HTOP instead of HEAT. + - X, Y, Z, SUM + - Component thermal gradient or vector sum. + * - TF + - X, Y, Z, SUM + - Component thermal flux or vector sum. + * - PG + - X, Y, Z, SUM + - Component pressure gradient or vector sum. + * - EF + - X, Y, Z, SUM + - Component electric field or vector sum. + * - D + - X, Y, Z, SUM + - Component electric flux density or vector sum. + * - H + - X, Y, Z, SUM + - Component magnetic field intensity or vector sum. + * - B + - X, Y, Z, SUM + - Component magnetic flux density or vector sum. + * - CG + - X, Y, Z, SUM + - Component concentration gradient or vector sum. + * - DF + - X, Y, Z, SUM + - Component diffusion flux density or vector sum. + * - FMAG + - X, Y, Z, SUM + - Component electromagnetic forces or vector sum. + * - P + - X, Y, Z, SUM + - Poynting vector components or vector sum + * - F + - X, Y, Z + - Component structural force. + * - M + - X, Y, Z + - Component structural moment. + * - HEAT + - + - Heat flow. + * - FLOW + - + - Fluid flow. + * - AMPS + - + - Current flow. + * - FLUX + - + - Magnetic flux. + * - CSG + - X, Y, Z + - Component magnetic current segment. + * - RATE + - + - Diffusion flow rate. + * - SENE + - + - "Stiffness" energy. + * - STEN + - + - Elemental energy dissipation due to `stabilization `_. + * - KENE + - + - Kinetic energy. + * - ASENE + - + - Amplitude stiffness energy. + * - PSENE + - + - Peak stiffness energy. + * - AKENE + - + - Amplitude kinetic energy. + * - PKENE + - + - Peak kinetic energy. + * - DENE + - + - Damping energy. + * - WEXT WEXT is calculated for element-based loading only (and not for nodal-force loading). WEXT is stored on elements to which loading has been applied; if surface elements are added on top of other elements, for example, and pressure loading is applied to the surface elements, WEXT is available for the surface elements only. + - + - Work due to external load. + * - AENE + - + - Artificial energy due to hourglass control/drill stiffness or due to contact stabilization. + * - JHEAT + - + - Element Joule heat generation. + * - JC + - X, Y, Z, SUM + - Conduction current density for elements that support conduction current calculation. Components (X, Y, Z) and vector sum (SUM). + * - JS + - X, Y, Z + - Source current density for low-frequency magnetic analyses. Total current density (sum of conduction and displacement current densities) in low-frequency electric analyses. Components (X, Y, Z). + * - JT + - X, Y, Z, SUM + - Total measurable current density in low-frequency electromagnetic analyses. (Conduction current density in a low-frequency electric analysis.) Components (X, Y, Z) and vector sum (SUM). + * - MRE + - + - Magnetics Reynolds number. + * - VOLU + - + - Volume of volume element. + * - BFE + - TEMP + - Body temperatures (calculated from applied temperatures) as used in solution (area and volume elements only). + * - FICT + - TEMP + - Fictive temperature. + * - CAP + - C0,X0,K0,ZONE, DPLS,VPLS + - Material cap plasticity model only: Cohesion; hydrostatic compaction yielding stress; I1 at the transition point at which the shear and compaction envelopes intersect; zone = 0: elastic state, zone = 1: compaction zone, zone = 2: shear zone, zone = 3: expansion zone; effective deviatoric plastic strain; volume plastic strain. + * - EDPC + - CSIG,CSTR + - Material EDP creep model only (not including the cap model): Equivalent creep stress; equivalent creep strain. + * - FFLX + - X, Y, Z + - Fluid flux flow in poromechanics. + * - FGRA + - X, Y, Z + - Fluid pore pressure gradient in poromechanics. + * - PMSV + - VRAT, PPRE, DSAT, RPER + - Void volume ratio, pore pressure, degree of saturation, and relative permeability for coupled pore-pressure-thermal elements. + * - YSIDX + - TENS,SHEA + - Yield surface activity status for Mohr-Coulomb, soil, concrete, and joint rock material models: 1 = yielded, 0 = not yielded. + * - FPIDX + - TF01,SF01, TF02,SF02, TF03,SF03, TF04,SF04 + - Failure plane surface activity status for concrete and joint rock material models: 1 = yielded, 0 = not yielded. Tension and shear failure status are available for all four sets of failure planes. + * - NS + - X, Y, Z, XY, YZ, XZ + - `Nominal strain `_ for hyperelastic material, reported in the current configuration (unaffected by :ref:`rsys` ). + * - MPLA + - DMAC, DMAX + - Microplane damage, macroscopic and maximum values. + * - MPDP + - TOTA, TENS, COMP, RW + - Microplane homogenized total, tension, and compression damages (TOTA, TENS, COMP), and split weight factor (RW). + * - DAMAGE + - 1,2,3,MAX + - Damage in directions 1, 2, 3 (1, 2, 3) and the maximum damage (MAX). + * - GDMG + - + - Damage + * - IDIS + - + - Structural-thermal dissipation rate + * - BKS + - X, Y, Z, XY, YZ, XZ + - Total `nonlinear kinematic backstress `_ reported in the current configuration (unaffected by :ref:`rsys` ). Available for 3D, plane strain, and axisymmetric elements. + * - BKS1,...,BKS5 + - X, Y, Z, XY, YZ, XZ + - Superimposed components of the total `nonlinear kinematic backstress`_ reported in the current configuration (unaffected by :ref:`rsys` ). Available for 3D, plane strain, and axisymmetric elements when more than one superimposed back-stress component is defined. + * - EPFR + - + - Free strain in porous media + * - FC1S + - 1,2,3,4,5,6 + - First set of six components of FCC crystal slip. Available for 3D elements only. + * - FC2S + - 1,2,3,4,5,6 + - Second set of six components of FCC crystal slip. Available for 3D elements only. + * - HC1S + - 1,2,3,4,5,6 + - Six components of HCP crystal slip on basal and prismatic systems. Available for 3D elements only. + * - HC2S + - 1,2,3,4,5,6 + - Six components of HCP crystal slip on pyramidal system. Available for 3D elements only. + * - HC3S + - 1,2,3,4,5,6 + - First set of six components of HCP crystal slip on the first-order pyramidal system. Available for 3D elements only. + * - HC4S + - 1,2,3,4,5,6 + - Second set of six components of HCP crystal slip on the first-order pyramidal system. Available for 3D elements only. + * - HC5S + - 1,2,3,4,5,6 + - Six components of HCP crystal slip on the second-order pyramidal system. Available for 3D elements only. + * - BC1S + - 1,2,3,4,5,6 + - First set of six components of BCC slip on 111 plane. Available for 3D elements only. + * - BC2S + - 1,2,3,4,5,6 + - Second set of six components of BCC slip on 111 plane. Available for 3D elements only. + * - BC3S + - 1,2,3,4,5,6 + - First set of six components of BCC slip on 112 plane. Available for 3D elements only. + * - BC4S + - 1,2,3,4,5,6 + - Second set of six components of BCC slip on 112 plane. Available for 3D elements only. + * - BC5S + - 1,2,3,4,5,6 + - First set of six components of BCC slip on 123 plane. Available for 3D elements only. + * - BC6S + - 1,2,3,4,5,6 + - Second set of six components of BCC slip on 123 plane. Available for 3D elements only. + * - BC7S + - 1,2,3,4,5,6 + - Third set of six components of BCC slip on 123 plane. Available for 3D elements only. + * - BC8S + - 1,2,3,4,5,6 + - Fourth set of six components of BCC slip on 123 plane. Available for 3D elements only. + * - FC1H + - 1,2,3,4,5,6 + - First set of six components of FCC crystal hardness. Available for 3D elements only. + * - FC2H + - 1,2,3,4,5,6 + - Second set of six components of FCC crystal hardness. Available for 3D elements only. + * - HC1H + - 1,2,3,4,5,6 + - Sixcomponents of HCP crystal hardness on basal and prismatic systems. Available for 3D elements. + * - HC2H + - 1,2,3,4,5,6 + - Six components of HCP crystal hardness on pyramidal system. Available for 3D elements only. + * - HC3H + - 1,2,3,4,5,6 + - First set of six components of HCP crystal hardness on the first-order pyramidal system. Available for 3D elements only. + * - HC4H + - 1,2,3,4,5,6 + - Second set of six components of HCP crystal hardness on the first-order pyramidal system. Available for 3D elements only. + * - HC5H + - 1,2,3,4,5,6 + - Six components of HCP crystal hardness on the second-order pyramidal system. Available for 3D elements only. + * - BC1H + - 1,2,3,4,5,6 + - First set of six components of BCC hardness on 111 plane. Available for 3D elements only. + * - BC2H + - 1,2,3,4,5,6 + - Second set of six components of BCC hardness on 111 plane. Available for 3D elements only. + * - BC3H + - 1,2,3,4,5,6 + - First set of six components of BCC hardness on 112 plane. Available for 3D elements only. + * - BC4H + - 1,2,3,4,5,6 + - Second set of six components of BCC hardness on 112 plane. Available for 3D elements only. + * - BC5H + - 1,2,3,4,5,6 + - First set of six components of BCC hardness on 123 plane. Available for 3D elements only. + * - BC6H + - 1,2,3,4,5,6 + - Second set of six components of BCC hardness on 123 plane. Available for 3D elements only. + * - BC7H + - 1,2,3,4,5,6 + - Third set of six components of BCC hardness on 123 plane. Available for 3D elements only. + * - BC8H + - 1,2,3,4,5,6 + - Fourth set of six components of BCC hardness on 123 plane. Available for 3D elements only. + * - XELG + - 1,2,3,45,6,EQV + - Crystal Lagrangian strain in 11, 22, 33, 12, 23,13 directions and its equivalent. Available for 3D elements only. + * - SINT + - RHO, ETA, SSTR, GRAIN + - Sintering relative density, viscosity, sintering stress, and average grain size values. + * - **Sequence Number Method** + * - **Item** + - **Comp** + - **Description** + * - SMISC + - ``snum`` + - Summable items. + * - NMISC + - ``snum`` + - Nonsummable items. + * - LS + - ``snum`` + - Line element elastic stresses. + * - LEPEL + - ``snum`` + - Line element strains. + * - LEPTH + - ``snum`` + - Line element thermal strains. + * - LEPPL + - ``snum`` + - Line element plastic strains. + * - LEPCR + - ``snum`` + - Line element creep strains. + * - LBFE + - ``snum`` + - Line element temperatures. + + + .. _ESOL_tab_2: + + ESOL - Selected Result Component Labels + *************************************** + + .. flat-table:: + :header-rows: 1 + + * - Comp + - Description + * - SVAR ``n`` + - The ``n`` th state variable. + * - FLDUF0 ``n`` + - The ``n`` th user-defined field variable. + + """ + command = f"ESOL,{nvar},{elem},{node},{item},{comp},{name}" + return self.run(command, **kwargs) + + def gssol( + self, nvar: str = "", item: str = "", comp: str = "", name: str = "", **kwargs + ): + r"""Specifies which results to store from the results file when using generalized plane strain. + + Mechanical APDL Command: `GSSOL `_ + + Parameters + ---------- + nvar : str + Arbitrary reference number or name assigned to this variable. Variable numbers can be 2 to + ``NV`` ( :ref:`numvar` ) while the name can be an eight byte character string. Overwrites any + existing results for this variable. + + item : str + Label identifying item to be stored. + + * ``LENGTH`` - Change of fiber length at the ending point. + + * ``ROT`` - Rotation of the ending plane during deformation. + + * ``F`` - Reaction force at the ending point in the fiber direction. + + * ``M`` - Reaction moment applied on the ending plane. + + comp : str + Component of the item, if Item = ROT or M. + + * ``X`` - The rotation angle or reaction moment of the ending plane about X. + + * ``Y`` - The rotation angle or reaction moment of the ending plane about Y. + + name : str + Thirty-two character name identifying the item on the printout and display. Defaults to the + label formed by concatenating the first four characters of the ``Item`` and ``Comp`` labels. + + Notes + ----- + + .. _GSSOL_notes: + + This command stores the results (new position of the ending plane after deformation) for generalized + plane strain. All outputs are in the global Cartesian coordinate system. For more information about + the generalized plane strain feature, see Generalized Plane Strain Option of Current-Technology + Solid Elements in the `Element Reference + `_. + """ + command = f"GSSOL,{nvar},{item},{comp},{name}" + return self.run(command, **kwargs) + + def jsol( + self, + nvar: str = "", + elem: str = "", + item: str = "", + comp: str = "", + name: str = "", + **kwargs, + ): + r"""Specifies result items to be stored for the joint element. + + Mechanical APDL Command: `JSOL `_ + + Parameters + ---------- + nvar : str + Arbitrary reference number or name assigned to this variable. Variable numbers can be 2 to + ``NV`` ( :ref:`numvar` ) while the name can be an eight-byte character string. Overwrites any + existing results for this variable. + + elem : str + Element number for which to store results. + + item : str + Label identifying the item. Valid item labels are shown in :ref:`jsol_tab_1`below. + + comp : str + Component of the ``Item`` (if required). Valid component labels are shown in + :ref:`jsol_tab_1`below. + + name : str + Thirty-two character name identifying the item on printouts and displays. Defaults to a label + formed by concatenating the first four characters of the ``Item`` and ``Comp`` labels. + + Notes + ----- + + .. _JSOL_notes: + + This command is valid for the ``MPC184`` joint elements. The values stored are for the free or + unconstrained degrees of freedom of a joint element. Relative reaction forces and moments are + available only if stiffness, damping, or friction is associated with the joint element. + .. _jsol_tab_1: + + JSOL - Valid Item and Component Labels + ************************************** + + .. flat-table:: + :header-rows: 1 + + * - Item + - Comp + - Description + * - U + - X, Y, Z + - x, y, or z relative displacement. + * - ROT + - X, Y, Z + - x, y, or z relative rotation. + * - VEL + - X, Y, Z + - x, y, or z relative linear velocity. + * - OMG + - X, Y, Z + - x, y, or z relative angular velocity. + * - ACC + - X, Y, Z + - x, y, or z relative linear acceleration. + * - DMG + - X, Y, Z + - x, y, or z relative angular acceleration. + * - RF + - X, Y, Z + - Relative reaction forces in the local x, y, or z direction. + * - RM + - X, Y, Z + - Relative reaction moments in the local x, y, or z direction. + + """ + command = f"JSOL,{nvar},{elem},{item},{comp},{name}" + return self.run(command, **kwargs) + + def nsol( + self, + nvar: str = "", + node: str = "", + item: str = "", + comp: str = "", + name: str = "", + sector: str = "", + **kwargs, + ): + r"""Specifies nodal data to be stored from the results file. + + Mechanical APDL Command: `NSOL `_ + + Parameters + ---------- + nvar : str + Arbitrary reference number assigned to this variable. Variable numbers can be 2 to ``NV`` ( + :ref:`numvar` ). Overwrites any existing results for this variable. + + node : str + Node for which data are to be stored. + + item : str + Label identifying the item. Valid item labels are shown in the table below. Some items also + require a component label. + + comp : str + Component of the item (if required). Valid component labels are shown in the table below. + + name : str + Thirty-two character name identifying the item on printouts and displays. Defaults to a label + formed by concatenating the first four characters of the ``Item`` and ``Comp`` labels. + + sector : str + For a full harmonic cyclic symmetry solution, the sector number for which the results from NODE + are to be stored. + + Notes + ----- + + .. _NSOL_notes: + + Stores nodal degree of freedom and solution results in a variable. For more information, see Data + Interpreted in the Nodal Coordinate System in the `Modeling and Meshing Guide + `_. + + For ``SECTOR`` >1, the result is in the nodal coordinate system of the base sector, and it is + rotated to the expanded sector``s location. Refer to `Using the /CYCEXPAND Command + `_ + + .. _nsol_tab_1: + + NSOL - Valid Item and Component Labels + ************************************** + + .. flat-table:: Valid Item and Component Labels :ref:`nsol`, ``NVAR,NODE,Item,Comp,Name`` + :header-rows: 2 + + * - Valid item and component labels for nodal degree of freedom results are: + * - Item + - Comp + - Description + * - U + - X, Y, Z + - X, Y, or Z structural displacement. + * - ROT + - X, Y, Z + - X, Y, or Z structural rotation. + * - TEMP[ :ref:`NSOL_temp`] + - + - Temperature. + * - PRES + - + - Pressure. + * - GFV1, GFV2, GFV3 + - + - Nonlocal field values 1, 2, and 3. + * - VOLT + - + - Electric potential. + * - MAG + - + - Magnetic scalar potential. + * - V + - X, Y, Z + - X, Y, or Z fluid velocity in a fluid analysis. + * - A + - X, Y, Z + - X, Y, or Z magnetic vector potential in an electromagnetic analysis. + * - CONC + - + - Concentration. + * - VEL + - X, Y, Z + - X, Y, or Z velocity in a structural transient dynamic analysis ( :ref:`antype`,TRANS). + * - ACC + - X, Y, Z + - X, Y, or Z acceleration in a structural transient dynamic analysis ( :ref:`antype`,TRANS). + * - OMG + - X, Y, Z + - X, Y, or Z rotational velocity in a structural transient dynamic analysis ( :ref:`antype`,TRANS). + * - DMG + - X, Y, Z + - X, Y, or Z rotational acceleration in a structural transient dynamic analysis ( :ref:`antype`,TRANS). + * - CURR + - + - Current. + * - EMF + - + - Electromotive force drop. + * - SPL + - + - Sound pressure level. + * - SPLA + - + - A-weighted sound pressure level (dBA). + * - ENKE + - + - Acoustic energy density + + .. _NSOL_temp: + + For ``SHELL131`` and ``SHELL132`` elements with KEYOPT(3) = 0 or 1, use the labels TBOT, TE2, TE3,. + .., TTOP instead of TEMP. + """ + command = f"NSOL,{nvar},{node},{item},{comp},{name},{sector}" + return self.run(command, **kwargs) + + def nstore(self, tinc: str = "", **kwargs): + r"""Defines which time points are to be stored. + + Mechanical APDL Command: `NSTORE `_ + + Parameters + ---------- + tinc : str + Store data associated with every ``TINC`` time (or frequency) point(s), within the previously + defined range of ``TMIN`` to ``TMAX`` ( :ref:`timerange` ). (Defaults to 1) + + Notes + ----- + + .. _NSTORE_notes: + + Defines which time (or frequency) points within the range are to be stored. + """ + command = f"NSTORE,{tinc}" + return self.run(command, **kwargs) + + def numvar(self, nv: str = "", **kwargs): + r"""Specifies the number of variables allowed in POST26. + + Mechanical APDL Command: `NUMVAR `_ + + Parameters + ---------- + nv : str + Allow storage for ``NV`` variables. 200 maximum are allowed. Defaults to 10. TIME (variable 1) + should also be included in this number. + + Notes + ----- + + .. _NUMVAR_notes: + + Specifies the number of variables allowed for data read from the results file and for data resulting + from an operation (if any). For efficiency, ``NV`` should not be larger than necessary. ``NV`` + cannot be changed after data storage begins. + """ + command = f"NUMVAR,{nv}" + return self.run(command, **kwargs) + + def rforce( + self, + nvar: str = "", + node: str = "", + item: str = "", + comp: str = "", + name: str = "", + **kwargs, + ): + r"""Specifies the total reaction force data to be stored. + + Mechanical APDL Command: `RFORCE `_ + + Parameters + ---------- + nvar : str + Arbitrary reference number assigned to this variable (2 to NV ( :ref:`numvar` )). Overwrites any + existing results for this variable. + + node : str + Node for which data are to be stored. If ``NODE`` = P, graphical picking is enabled (valid only + in the GUI). + + item : str + Label identifying the item. Valid item labels are shown in the table below. Some items also + require a component label. + + comp : str + Component of the item (if required). Valid component labels are shown in the table below. + + name : str + Thirty-two character name identifying the item on printouts and displays. Defaults to an eight + character label formed by concatenating the first four characters of the ``Item`` and ``Comp`` + labels. + + Notes + ----- + + .. _RFORCE_notes: + + Defines the total reaction force data (static, damping, and inertial components) to be stored from + single pass ( :ref:`antype`,STATIC or TRANS) solutions or from the expansion pass of mode- + superposition ( :ref:`antype`,HARMIC or TRANS) solutions. + + .. _rforce_tab_1: + + RFORCE - Valid Item and Component Labels + **************************************** + + .. flat-table:: Valid item and component labels for node results are: + :header-rows: 1 + + * - Item + - Comp + - Description + * - F + - X,Y,Z + - X, Y, or Z structural force + * - M + - X,Y,Z + - X, Y, or Z structural moment + * - HEAT[ :ref:`rforce_table1_note1`] + - + - Heat flow + * - FLOW + - + - Fluid flow + * - AMPS + - + - Current flow + * - FLUX + - + - Magnetic flux + * - CSG + - X,Y,Z + - X, Y, or Z magnetic current segment component + * - RATE + - + - Diffusion flow rate + * - VLTG + - + - Voltage drop + * - CURT + - + - Current + * - CHRG + - + - Charge + + .. _rforce_table1_note1: + + For ``SHELL131`` and ``SHELL132`` elements with KEYOPT(3) = 0 or 1, use the labels HBOT, HE2, HE3,. + .., HTOP instead of HEAT. + """ + command = f"RFORCE,{nvar},{node},{item},{comp},{name}" + return self.run(command, **kwargs) + + def rgb( + self, + kywrd: str = "", + pred: str = "", + pgrn: str = "", + pblu: str = "", + n1: str = "", + n2: str = "", + ninc: str = "", + ncntr: str = "", + **kwargs, + ): + r"""Specifies the RGB color values for indices and contours. + + Mechanical APDL Command: `/RGB `_ + + Parameters + ---------- + kywrd : str + Determines how RGB modifications will be applied. + + * ``INDEX`` - Specifies that subsequent color values apply to Mechanical APDL color indices (0-15). + + * ``CNTR`` - Specifies that subsequent color values apply to contours (1-128). Applies to C-option + devices only (i.e. X11C or Win32C). + + pred : str + Intensity of the color red, expressed as a percentage. + + pgrn : str + Intensity of the color green, expressed as a percentage. + + pblu : str + Intensity of the color blue, expressed as a percentage. + + n1 : str + First index (0-15), or contour (1-128) to which the designated RGB values apply. + + n2 : str + Final index (0-15), or contour (1-128) to which the designated RGB values apply. + + ninc : str + The step increment between the values ``N1`` and ``N2`` determining which contours or indices + will be controlled by the specified RGB values. + + ncntr : str + The new maximum number of contours (1-128). + + Notes + ----- + + .. _s-RGB_notes: + + Issuing the :ref:`cmap` command (with no filename) will restore the default color settings. + """ + command = f"/RGB,{kywrd},{pred},{pgrn},{pblu},{n1},{n2},{ninc},{ncntr}" + return self.run(command, **kwargs) + + def solu( + self, nvar: str = "", item: str = "", comp: str = "", name: str = "", **kwargs + ): + r"""Specifies solution summary data per substep to be stored. + + Mechanical APDL Command: `SOLU `_ + + Parameters + ---------- + nvar : str + Arbitrary reference number assigned to this variable (2 to ``NV`` ( :ref:`numvar` )). + + item : str + Label identifying the item. Valid item labels are shown in the table below. Some items may also + require a component label. + + comp : str + Component of the item (if required). Valid component labels are shown in the table below. None + are currently required. + + name : str + Thirty-two character name identifying the item on printouts and displays. Defaults to an eight + character label formed by concatenating the first four characters of the ``Item`` and ``Comp`` + labels. + + Notes + ----- + + .. _SOLU_notes: + + See also the :ref:`priter` command of POST1 to display some of these items directly. Valid for a + static or full transient analysis. All other analyses have zeros for the data. Valid item and + component labels for solution summary values are: + + This command contains some tables and extra information which can be inspected in the original + documentation pointed above. + """ + command = f"SOLU,{nvar},{item},{comp},{name}" + return self.run(command, **kwargs) + + def store( + self, + lab: str = "", + npts: str = "", + freq: str = "", + toler: str = "", + cluster: str = "", + **kwargs, + ): + r"""Stores data in the database for the defined variables. + + Mechanical APDL Command: `STORE `_ + + Parameters + ---------- + lab : str + Valid labels: + + * ``MERGE`` - Merge data from results file for the time points in memory with the existing data + using current specifications (default). + + * ``NEW`` - Store a new set of data, replacing any previously stored data with current result file + specifications and deleting any previously-calculated variables (see ). + + Variables defined using the :ref:`ansol` command are also deleted if they represent element-based + results. Variables created using `nodal-averaged results + `_ are + not deleted. + + * ``APPEN`` - Append data from results file to the existing data. + + * ``ALLOC`` - Allocate (and zero) space for ``NPTS`` data points. + + * ``PSD`` - Create a new set of frequency points for PSD calculations (replacing any previously + stored data and erasing any previously calculated data). + + npts : str + The number of time points (or frequency points) for storage (used only with ``Lab`` = ALLOC or + PSD). The value may be input when using POST26 with data supplied from other than a results + file. This value is automatically determined from the results file data with the NEW, APPEN, and + MERGE options. For the PSD option, ``NPTS`` determines the resolution of the frequency vector + (valid numbers are between 1 and 10, defaults to 5). + + freq : str + A frequency value, or an array containing frequency values (Hz). Use :ref:`dim` to define the + array and enclose the array name in percent signs (for example, :ref:`store`,,,,``arrayname``). + A default value of 1% of damping is considered for clustering around the user-input frequency + values. Supported for ``Lab`` = PSD only. + + toler : str + Tolerance to determine if a user-input frequency value ( ``FREQ`` ) is a duplicate and can be + ignored. Two frequency values are considered duplicates if their difference is smaller than the + frequency range multiplied by the tolerance. The default value is 10 :sup:`-5`. Supported for + ``Lab`` = PSD and ``Cluster`` = YES only. + + cluster : str + Key to control whether or not to consider the clustering frequencies around each of the user-input + array values. Available only when a user-defined frequency array is used ( ``FREQ`` ). + + * ``YES`` - Merge the clustering frequencies around both the natural frequencies and the frequency + values entered in the user-defined array ( ``FREQ`` ) (default). + + * ``NO`` - Do not include clustering frequencies, and use only natural frequencies and the + frequencies in the user-defined array ( ``FREQ`` ). + + Notes + ----- + + .. _STORE_notes: + + This command stores data from the results file in the database for the defined variables ( + :ref:`ansol`, :ref:`nsol`, :ref:`esol`, :ref:`solu`, :ref:`jsol` ) per specification ( + :ref:`avprin`, :ref:`force`, :ref:`layerp26`, :ref:`shell` ). See `Storing the Variable + `_ + + The :ref:`store`,PSD command creates a new frequency vector (variable 1) for response PSD + calculations ( :ref:`rpsd` ). This command should first be issued before defining variables ( + :ref:`nsol`, :ref:`esol`, :ref:`rforce` ) for which response PSD's are to be calculated. + + If the frequencies in the user-defined array are relevant, turning off clustering ( ``Cluster`` = + NO) reduces calculation costs without significant loss of accuracy. You can check the frequencies by + initially issuing a default :ref:`rpsd` (with clustering) to obtain a reference plot of the + response. + """ + command = f"STORE,{lab},{npts},,{freq},{toler},{cluster}" + return self.run(command, **kwargs) + + def timerange(self, tmin: str = "", tmax: str = "", **kwargs): + r"""Specifies the time range for which data are to be stored. + + Mechanical APDL Command: `TIMERANGE `_ + + Parameters + ---------- + tmin : str + Minimum time (defaults to first time (or frequency) point on the file). + + tmax : str + Maximum time (defaults to last time (or frequency) point on the file). + + Notes + ----- + + .. _TIMERANGE_notes: + + Defines the time (or frequency) range for which data are to be read from the file and stored in + memory. Use the :ref:`nstore` command to define the time increment. + + Use :ref:`prtime` or :ref:`pltime` to specify the time (frequency) range for cyclic mode- + superposition harmonic analyses. + """ + command = f"TIMERANGE,{tmin},{tmax}" + return self.run(command, **kwargs) + + def vardel(self, nvar: str = "", **kwargs): + r"""Deletes a variable (GUI). + + Mechanical APDL Command: `VARDEL `_ + + Parameters + ---------- + nvar : str + The reference number of the variable to be deleted. ``NVAR`` is as defined by :ref:`nsol`, + :ref:`esol`, etc. + + Notes + ----- + + .. _VARDEL_notes: + + Deletes a POST26 solution results variable. This command is generated by the Graphical User + Interface (GUI). It appears in the log file ( :file:`Jobname.LOG` ) if a POST26 variable is deleted + from the Defined Time-History Variables dialog box. + + The command is not intended to be typed in directly in a Mechanical APDL session (although it can be + included in an input file for batch input or for use with :ref:`input` ). + """ + command = f"VARDEL,{nvar}" + return self.run(command, **kwargs) + + def varnam(self, ir: str = "", name: str = "", **kwargs): + r"""Names (or renames) a variable. + + Mechanical APDL Command: `VARNAM `_ + + Parameters + ---------- + ir : str + Reference number of the variable (2 to NV ( :ref:`numvar` )). + + name : str + Thirty-two character name for identifying variable on printouts and displays. Embedded blanks + are compressed for output. + """ + command = f"VARNAM,{ir},{name}" + return self.run(command, **kwargs) diff --git a/src/ansys/mapdl/core/_commands/post26/special_purpose.py b/src/ansys/mapdl/core/_commands/post26/special_purpose.py new file mode 100644 index 0000000000..34df43efc3 --- /dev/null +++ b/src/ansys/mapdl/core/_commands/post26/special_purpose.py @@ -0,0 +1,588 @@ +# Copyright (C) 2016 - 2025 ANSYS, Inc. and/or its affiliates. +# SPDX-License-Identifier: MIT +# +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to deal +# in the Software without restriction, including without limitation the rights +# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +# copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in all +# copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +# SOFTWARE. + + +class SpecialPurpose: + + def cvar( + self, + ir: str = "", + ia: str = "", + ib: str = "", + itype: int | str = "", + datum: int | str = "", + name: str = "", + **kwargs, + ): + r"""Computes covariance between two quantities. + + Mechanical APDL Command: `CVAR `_ + + Parameters + ---------- + ir : str + Arbitrary reference number assigned to the resulting variable (2 to ``NV`` ( :ref:`numvar` )). + If this number is the same as for a previous variable, the previous variable will be overwritten + with this result. + + ia : str + Reference numbers of the two variables to be operated on. If only one, leave ``IB`` blank. + + ib : str + Reference numbers of the two variables to be operated on. If only one, leave ``IB`` blank. + + itype : int or str + Defines the type of response PSD to be calculated: + + * ``0,1`` - Displacement (default). + + * ``2`` - Velocity. + + * ``3`` - Acceleration. + + datum : int or str + Defines the reference with respect to which covariance is to be calculated: + + * ``1`` - Absolute value. + + * ``2`` - Relative to base (default). + + name : str + Thirty-two character name for identifying the variable on listings and displays. Embedded blanks + are compressed upon output. + + Notes + ----- + + .. _CVAR_notes: + + This command computes the covariance value for the variables referenced by the reference numbers + ``IA`` and ``IB``. If ``DATUM`` = 2, the variable referenced by ``IR`` will contain the individual + modal contributions (that is, the dynamic or relative values). If ``DATUM`` = 1, the variable + referenced by ``IR`` will contain the modal contributions followed by the contributions of pseudo- + static and covariance between dynamic and pseudo-static responses. :file:`File.PSD` must be + available for the calculations to occur. + """ + command = f"CVAR,{ir},{ia},{ib},{itype},{datum},{name}" + return self.run(command, **kwargs) + + def pmgtran( + self, + fname: str = "", + freq: str = "", + fcnam1: str = "", + fcnam2: str = "", + pcnam1: str = "", + pcnam2: str = "", + ecnam1: str = "", + ccnam1: str = "", + **kwargs, + ): + r"""Summarizes electromagnetic results from a transient analysis. + + Mechanical APDL Command: `PMGTRAN `_ + + Parameters + ---------- + fname : str + File name (8 characters maximum) to which tabular data and plot files will be written. Must be + enclosed in single quotes when the command is manually typed in. Defaults to MG_TRNS. The data + file extension is :file:`.OUT` and the plot file extension is. :file:`PLT`. + + freq : str + Frequency of solution output. Defaults to 1. Every ``FREQ`` th solution on the results file is + output. + + fcnam1 : str + Names of element components for force calculation. Must be enclosed in single quotes when the + command is manually typed in. + + fcnam2 : str + Names of element components for force calculation. Must be enclosed in single quotes when the + command is manually typed in. + + pcnam1 : str + Names of element components for power loss calculation. Must be enclosed in single quotes when + the command is manually typed in. + + pcnam2 : str + Names of element components for power loss calculation. Must be enclosed in single quotes when + the command is manually typed in. + + ecnam1 : str + Names of element components for energy and total current calculations, respectively. Must be + enclosed in single quotes when the command is manually typed in. + + ccnam1 : str + Names of element components for energy and total current calculations, respectively. Must be + enclosed in single quotes when the command is manually typed in. + + Notes + ----- + + .. _PMGTRAN_notes: + + :ref:`pmgtran` invokes a Mechanical APDL macro which calculates and summarizes electromagnetic + results from + a transient analysis. The results are summarized by element components and listed on the screen as + well as written to a file ( :file:`Fname.OUT` ). + + You can select two components for the summary of electromagnetic forces, two for power loss, and one + each for stored energy (see :ref:`senergy` ) and total current (see :ref:`curr2d` ). See the + referenced commands for other restrictions. + + :ref:`pmgtran` is restricted to MKSA units. + """ + command = f"PMGTRAN,{fname},{freq},{fcnam1},{fcnam2},{pcnam1},{pcnam2},{ecnam1},{ccnam1}" + return self.run(command, **kwargs) + + def rcyc( + self, ir: str = "", ia: str = "", sector: str = "", name: str = "", **kwargs + ): + r"""Calculates cyclic results for a mode-superposition harmonic solution. + + Mechanical APDL Command: `RCYC `_ + + Parameters + ---------- + ir : str + Arbitrary reference number assigned to the resulting variable (2 to ``NV`` ( :ref:`numvar` )). + If this number is the same as for a previous variable, the previous variable will be overwritten + with this result. + + ia : str + Reference number of the variable to be operated on. + + sector : str + Sector number to calculate the results for. + + name : str + Thirty-two character name identifying the variable on listings and displays. Embedded blanks are + compressed for output. + + Notes + ----- + + .. _RCYC_notes: + + This command calculates the harmonic response in the sector specified by ``SECTOR`` for the variable + referenced by the reference number ``IA``. Only component values for ``IA`` are valid (no principles + or sums). The variable specified by ``IR`` will contain the harmonic solution. :file:`Jobname.RFRQ` + from the cyclic mode-superposition harmonic solve and :file:`Jobname.RST` or :file:`Jobname.RSTP` + from the cyclic modal solve must be available for the calculations to occur. The Jobname must be the + same for the cyclic modal solve and the cyclic mode-superposition harmonic solve. + + For ``SECTOR`` > 1, the result is in the nodal coordinate system of the base sector, and it is + rotated to the expanded sector``s location. Refer to `Using the /CYCEXPAND Command + `_ + + See also `Mode-Superposition Harmonic Cyclic Symmetry Analysis + `_ + """ + command = f"RCYC,{ir},{ia},{sector},{name}" + return self.run(command, **kwargs) + + def resp( + self, + ir: str = "", + lftab: str = "", + ldtab: str = "", + spectype: int | str = "", + dampratio: str = "", + dtime: str = "", + tmin: str = "", + tmax: str = "", + inputtype: int | str = "", + **kwargs, + ): + r"""Generates a response spectrum. + + Mechanical APDL Command: `RESP `_ + + Parameters + ---------- + ir : str + Arbitrary reference number assigned to the response spectrum results (2 to NV ( :ref:`numvar` + )). If this number is the same as for a previously defined variable, the previously defined + variable will be overwritten with these results. + + lftab : str + Reference number of variable containing frequency table (created with :ref:`filldata` or + :ref:`data` command). The frequency table defines the number and frequency of oscillating + systems used to determine the response spectrum. The frequency interval need not be constant + over the entire range. Frequencies must be input in ascending order. + + ldtab : str + Reference number of variable containing the input time-history. + + spectype : int or str + Defines the type of response spectrum to be calculated: + + * ``0 or 1`` - Displacement (relative to base excitation) + + * ``2`` - Velocity (relative to base excitation) + + * ``3`` - Acceleration response spectrum (absolute) + + * ``4`` - Pseudo-velocity + + * ``5`` - Pseudo-acceleration + + dampratio : str + Ratio of viscous damping to critical damping (input as a decimal number). + + dtime : str + Integration time step. This value should be equal to or greater than the integration time step + used in the initial transient analysis performed to generate the input time-history ( ``LDTAB`` + ). + + ``DTIME`` defaults to a value of 1/(20\*FMAX), where FMAX is the highest frequency in the + frequency table ( ``LFTAB`` ) except when the time-history is read from the reduced displacement + ( :file:`RDSP` ) file following a mode-superposition transient analysis without an expansion + pass. In this case, ``DTIME`` defaults to the time step value used in the analysis. + + tmin : str + Specifies a subset of the input time-history ( ``LDTAB`` ) to be used in the response spectrum + calculation. Defaults to the full time range. + + tmax : str + Specifies a subset of the input time-history ( ``LDTAB`` ) to be used in the response spectrum + calculation. Defaults to the full time range. + + inputtype : int or str + Defines the type of the input time-history: + + * ``0`` - Displacement (default) + + * ``1`` - Acceleration + + Notes + ----- + + .. _RESP_notes: + + This command generates a response spectrum from a displacement or acceleration time-history and + frequency data. The response spectrum is defined as the maximum response of single degree of freedom + systems of varying frequency (or period) to a given input support excitation. + + A response spectrum analysis ( :ref:`antype`, SPECTR with :ref:`spopt`, SPRS or MPRS) requires a + response spectrum input. This input can be determined from the response spectrum printout or display + of this command. + + If a response spectrum is to be calculated from a given displacement (or acceleration) time-history, + the displacement time-history may be input to a single one-element reduced linear transient dynamic + ( :ref:`antype`,TRANS) analysis, so that the calculated output (which should be the same as the + input) will be properly located on the file. + + The integration time step (argument ``DTIME`` on the :ref:`resp` command) and the damping + coefficient (argument ``dampRatio`` ) are constant over the frequency range. The number of + calculations done per response spectrum curve is the product of the number of input solution points + ( ``TMAX`` - ``TMIN`` )/ ``DTIME`` and the number of frequency points (frequencies located in + variable ``LFTAB`` ). + + Input solution points requested (using ``DTIME`` and the frequency range) at a time not + corresponding to an actual displacement solution time on the file are linearly interpolated with + respect to the existing points. + + For the theory of the response spectrum calculation, see `POST26 - Response Spectrum Generator + (RESP) + `_ + + For an example of the command usage, see `Generating a Response Spectrum + `_ + """ + command = f"RESP,{ir},{lftab},{ldtab},{spectype},{dampratio},{dtime},{tmin},{tmax},{inputtype}" + return self.run(command, **kwargs) + + def rpsd( + self, + ir: str = "", + ia: str = "", + ib: str = "", + itype: int | str = "", + datum: int | str = "", + name: str = "", + signif: str = "", + **kwargs, + ): + r"""Calculates response power spectral density (PSD). + + Mechanical APDL Command: `RPSD `_ + + Parameters + ---------- + ir : str + Arbitrary reference number assigned to the resulting variable (2 to ``NV`` ( :ref:`numvar` )). + If this number is the same as for a previous variable, the previous variable will be overwritten + with this result. + + ia : str + Reference numbers of the two variables to be operated on. If only one, leave ``IB`` blank. + + ib : str + Reference numbers of the two variables to be operated on. If only one, leave ``IB`` blank. + + itype : int or str + Defines the type of response PSD to be calculated: + + * ``0,1`` - Displacement (default). + + * ``2`` - Velocity. + + * ``3`` - Acceleration. + + datum : int or str + Defines the reference with respect to which response PSD is to be calculated: + + * ``1`` - Absolute value. + + * ``2`` - Relative to base (default). + + name : str + Thirty-two character name identifying variable on listings and displays. Embedded blanks are + compressed for output. + + signif : str + Combine only those modes whose significance level exceeds the ``SIGNIF`` threshold. The + significance level is defined as the modal covariance matrix term divided by the maximum of all + the modal covariance matrix terms. Any term whose significance level is less than ``SIGNIF`` is + considered insignificant and does not contribute to the response. All modes are taken into + account by default ( ``SIGNIF`` = 0.0). + + The significance level definition is identical to the one used for the combination ( ``SIGNIF`` + on the :ref:`psdcom` command); however, the default value is different. + + The significance does not apply to spatial correlation ( :ref:`psdspl` ) and wave propagation ( + :ref:`psdwav` ) response power spectral density. + + Notes + ----- + + .. _RPSD_notes: + + This command calculates response power spectral density (PSD) for the variables referenced by the + reference numbers ``IA`` and ``IB``. The variable referred by ``IR`` will contain the response PSD. + You must issue the :ref:`store`,PSD command first; :file:`File.PSD` must be available for the + calculations to occur. + + See `POST26 - Response Power Spectral Density + `_ + in the `Mechanical APDL Theory Reference + `_ for more + information on these equations. + """ + command = f"RPSD,{ir},{ia},{ib},{itype},{datum},{name},,{signif}" + return self.run(command, **kwargs) + + def smooth( + self, + vect1: str = "", + vect2: str = "", + datap: str = "", + fitpt: int | str = "", + vect3: str = "", + vect4: str = "", + disp: int | str = "", + **kwargs, + ): + r"""Allows smoothing of noisy data and provides a graphical representation of the data. + + Mechanical APDL Command: `SMOOTH `_ + + Parameters + ---------- + vect1 : str + Name of the first vector that contains the noisy data set (that is, independent variable). You + must create and fill this vector before issuing :ref:`smooth`. + + vect2 : str + Name of the second vector that contains the dependent set of data. Must be the same length as + the first vector. You must create and fill this vector before issuing :ref:`smooth`. + + datap : str + Number of data points to be fitted, starting from the beginning of the vector. If left blank, + the entire vector will be fitted. The maximum number of data points is 100,000 (or greater, + depending on the memory of the computer). + + fitpt : int or str + Order of the fitting curve that will be used as a smooth representation of the data. This number + should be less than or equal to the number of the data points. Default (blank) is one-half the + number of data points. Maximum number of smoothed data fitting order is the number of data points up + to 50. Depending on this number, the smoothed curve will be one of the following: + + * ``1`` - Curve is the absolute average of all of the data points. + + * ``2`` - Curve is the least square average of all of the data points. + + * ``3 or more`` - Curve is a polynomial of the order (n-1), where n is the number of data fitting + order points. + + vect3 : str + Name of the vector that contains the smoothed data of the independent variable. This vector + should have a length equal to or greater than the number of smoothed data points. In batch + (command) mode, you must create this vector before issuing the :ref:`smooth` command. In + interactive mode, the GUI automatically creates this vector (if it does not exist). If you do + not specify a vector name, the GUI will name the vector smth_ind. + + vect4 : str + Name of the vector that contains the smoothed data of the dependent variable. This vector must + be the same length as ``Vect3``. In batch (command) mode, you must create this vector before + issuing the :ref:`smooth` command. In interactive mode, the GUI automatically creates this + vector (if it does not exist). If you do not specify a vector name, the GUI will name the vector + smth_dep. + + disp : int or str + Specifies how you want to display data. No default; you must specify an option. + + * ``1`` - Unsmoothed data only + + * ``2`` - Smoothed data only + + * ``3`` - Both smoothed and unsmoothed data + + Notes + ----- + + .. _SMOOTH_notes: + + This command enables you to control the attributes of the graph using standard Mechanical APDL + controls ( + :ref:`grid`, :ref:`gthk`, :ref:`color`, etc.). + + If working interactively, the controls appear in this dialog box for convenience, as well as in + their standard dialog boxes. + + You must always create ``Vect1`` and ``Vect2`` (using :ref:`dim` ) and fill these vectors before + smoothing the data. If working interactively, the program automatically creates ``Vect3`` and + ``Vect4``. If working in batch (command) mode, you must create ``Vect3`` and ``Vect4`` (using + :ref:`dim` ) before issuing :ref:`smooth`. ``Vect3`` and ``Vect4`` are then filled automatically by + the program. + + The program also creates an additional TABLE type array that contains the smoothed array and the + unsmoothed data to enable plotting later with :ref:`starvplot`. Column 1 in the table corresponds to + ``Vect1``, column 2 to ``Vect2``, and column 3 to ``Vect4``. The array is named ``Vect3`` _SMOOTH, + up to a limit of 32 characters. For example, if the array name is X1, the table name is X1_SMOOTH. + + This command is also valid in PREP7 and SOLUTION. + """ + command = f"SMOOTH,{vect1},{vect2},{datap},{fitpt},{vect3},{vect4},{disp}" + return self.run(command, **kwargs) + + def vget( + self, + par: str = "", + ir: str = "", + tstrt: str = "", + kcplx: int | str = "", + **kwargs, + ): + r"""Moves a variable into an array parameter vector. + + Mechanical APDL Command: `VGET `_ + + Parameters + ---------- + par : str + Array parameter vector in the operation. + + ir : str + Reference number of the variable (1 to NV ( :ref:`numvar` )). + + tstrt : str + Time (or frequency) corresponding to start of ``IR`` data. If between values, the nearer value + is used. + + kcplx : int or str + Complex number key: + + * ``0`` - Use the real part of the ``IR`` data. + + * ``1`` - Use the imaginary part of the ``IR`` data. + + Notes + ----- + + .. _VGET_notes: + + Moves a variable into an array parameter vector. The starting array element number must be defined. + For example, :ref:`vget`,A(1),2 moves variable 2 (starting at time 0.0) to array parameter A. + Looping continues from array element A(1) with the index number incremented by one until the + variable is filled. The number of loops may be controlled with the `\*VLEN + `_ :ref:`vlen` + command (except that loop skipping ( ``NINC`` ) is not allowed). For multi-dimensioned array + parameters, only the first (row) subscript is incremented. + """ + command = f"VGET,{par},{ir},{tstrt},{kcplx}" + return self.run(command, **kwargs) + + def vput( + self, + par: str = "", + ir: str = "", + tstrt: str = "", + kcplx: int | str = "", + name: str = "", + **kwargs, + ): + r"""Moves an array parameter vector into a variable. + + Mechanical APDL Command: `VPUT `_ + + Parameters + ---------- + par : str + Array parameter vector in the operation. + + ir : str + Arbitrary reference number assigned to this variable (1 to ``NV`` ( :ref:`numvar` )). + Overwrites any existing results for this variable. + + tstrt : str + Time (or frequency) corresponding to start of ``IR`` data. If between values, the nearer value + is used. + + kcplx : int or str + Complex number key: + + * ``0`` - Use the real part of the ``IR`` data. + + * ``1`` - Use the imaginary part of the ``IR`` data. + + name : str + Thirty-two character name identifying the item on printouts and displays. Defaults to the label + formed by concatenating VPUT with the reference number ``IR``. + + Notes + ----- + + .. _VPUT_notes: + + At least one variable should be defined ( :ref:`nsol`, :ref:`esol`, :ref:`rforce`, etc.) before + using this command. The starting array element number must be defined. For example, + :ref:`vput`,A(1),2 moves array parameter A to variable 2 starting at time 0.0. Looping continues + from array element A(1) with the index number incremented by one until the variable is filled. + Unfilled variable locations are assigned a zero value. The number of loops may be controlled with + the :ref:`vlen` command (except that loop skipping (NINC) is not allowed). For multi-dimensioned + array parameters, only the first (row) subscript is incremented. + """ + command = f"VPUT,{par},{ir},{tstrt},{kcplx},{name}" + return self.run(command, **kwargs) diff --git a/src/ansys/mapdl/core/_commands/post26/status.py b/src/ansys/mapdl/core/_commands/post26/status.py new file mode 100644 index 0000000000..ac5383a480 --- /dev/null +++ b/src/ansys/mapdl/core/_commands/post26/status.py @@ -0,0 +1,66 @@ +# Copyright (C) 2016 - 2025 ANSYS, Inc. and/or its affiliates. +# SPDX-License-Identifier: MIT +# +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to deal +# in the Software without restriction, including without limitation the rights +# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +# copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in all +# copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +# SOFTWARE. + + +class Status: + + def operate(self, **kwargs): + r"""Specifies "Operation data" as the subsequent status topic. + + Mechanical APDL Command: `OPERATE `_ + + Notes + ----- + + .. _OPERATE_notes: + + This is a status ( :ref:`stat` ) topic command. Status topic commands are generated by the GUI and + will appear in the log file ( :file:`Jobname.LOG` ) if status is requested for some items under + Utility Menu> List> Status. This command will be immediately followed by a :ref:`stat` command, + which will report the status for the specified topic. + + If entered directly into the program, the :ref:`stat` command should immediately follow this + command. + """ + command = "OPERATE" + return self.run(command, **kwargs) + + def plotting(self, **kwargs): + r"""Specifies "Plotting settings" as the subsequent status topic. + + Mechanical APDL Command: `PLOTTING `_ + + Notes + ----- + + .. _PLOTTING_notes: + + This is a status ( :ref:`stat` ) topic command. Status topic commands are generated by the GUI and + will appear in the log file ( :file:`Jobname.LOG` ) if status is requested for some items under + Utility Menu> List> Status. This command will be immediately followed by a :ref:`stat` command, + which will report the status for the specified topic. + + If entered directly into the program, the :ref:`stat` command should immediately follow this + command. + """ + command = "PLOTTING" + return self.run(command, **kwargs) diff --git a/src/ansys/mapdl/core/_commands/post26_/controls.py b/src/ansys/mapdl/core/_commands/post26_/controls.py deleted file mode 100644 index 7e281b7a5f..0000000000 --- a/src/ansys/mapdl/core/_commands/post26_/controls.py +++ /dev/null @@ -1,259 +0,0 @@ -# Copyright (C) 2016 - 2025 ANSYS, Inc. and/or its affiliates. -# SPDX-License-Identifier: MIT -# -# -# Permission is hereby granted, free of charge, to any person obtaining a copy -# of this software and associated documentation files (the "Software"), to deal -# in the Software without restriction, including without limitation the rights -# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -# copies of the Software, and to permit persons to whom the Software is -# furnished to do so, subject to the following conditions: -# -# The above copyright notice and this permission notice shall be included in all -# copies or substantial portions of the Software. -# -# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -# SOFTWARE. - - -class Controls: - def cfact( - self, - rfacta="", - ifacta="", - rfactb="", - ifactb="", - rfactc="", - ifactc="", - **kwargs, - ): - """Defines complex scaling factors to be used with operations. - - APDL Command: CFACT - - Parameters - ---------- - rfacta - Real portion of the complex scale factor used in place of FACTA. - - ifacta - Imaginary portion of the complex scale factor used in place of - FACTA. - - rfactb - Real portion of the complex scale factor used in place of FACTB. - - ifactb - Imaginary portion of the complex scale factor used in place of - FACTB. - - rfactc - Real portion of the complex scale factor used in place of FACTC. - - ifactc - Imaginary portion of the complex scale factor used in place of - FACTC. - - Notes - ----- - Defines complex scale factors to be used with the operations [ADD, - PROD, etc.]. If this command is supplied, these complex factors - override any real factors (FACTA, FACTB, FACTC) supplied on the - operation commands. Factors are typically involved in scaling a - specified variable, such as in the term FACTA x IA of the ADD command - to scale variable IA before the ADD operation. - - When the CFACT command is active, defaults are as follows: 1) if the - complex factor is not specified, but the variable upon which it acts - (such as IA) is specified, the factor defaults to 1.0+i0.0; 2) if the - variable upon which the factor operates is not specified, but the - factor is specified, the variable defaults to 1.0 so that the term in - the operation becomes the complex factor itself; 3) if neither the - factor nor the variable number is supplied, the term is omitted from - the operation. Once the operation (such as the ADD command) has been - processed, the CFACT command becomes inactive and must be specified - again if it is to be used. - """ - command = f"CFACT,{rfacta},{ifacta},{rfactb},{ifactb},{rfactc},{ifactc}" - return self.run(command, **kwargs) - - def force(self, lab="", **kwargs): - """Selects the element nodal force type for output. - - APDL Command: FORCE - - Parameters - ---------- - lab - Type of force to be associated with the force items: - - TOTAL - Total forces (static, damping, and inertia). - - STATIC - Static forces. - - DAMP - Damping forces. - - INERT - Inertia forces. - - Notes - ----- - FORCE selects the element nodal force type for output with the POST1 - PRESOL, PLESOL, PRRFOR, NFORCE, FSUM, etc. commands, the POST26 ESOL - command, and reaction force plotting [/PBC]. For example, FORCE,STATIC - causes item F of the PRESOL command to be the static forces for the - elements processed. Element member forces (such as those available for - beams and shells and processed by Item and Sequence number) are not - affected by this command. The SMISC records extract the static force. - - The PRRSOL command is not valid with FORCE. Use the PRRFOR command, - which provides the same functionality as PRRSOL, instead. - - Use the FORCE command prior to any load case operations (LCOPER) to - insure the correct element nodal force combinations. - - In POST26, the ESOL data stored is based on the active FORCE - specification at the time the data is stored. To store data at various - specifications (for example, static and inertia forces), issue a STORE - command before each new specification. - - The FORCE command cannot be used to extract static, damping, and - inertial forces for MPC184 joint elements. - - To retrieve the different force types, use the ``*GET`` command with - Entity=ELEM and Item1=EFOR. - - The FORCE command is not supported in a spectrum analysis. You can - specify the force type directly on the combination method commands - (ForceType on the PSDCOM, SRSS, CQC, etc. commands). - - The FORCE command is not supported in a modal analysis. - """ - command = f"FORCE,{lab}" - return self.run(command, **kwargs) - - def layerp26(self, num="", **kwargs): - """Specifies the element layer for which data are to be stored. - - APDL Command: LAYERP26 - - Parameters - ---------- - num - Layer-processing mode: - - N - The layer number to process. The default value is 1. - - Notes - ----- - Defines the element layer for which results data are to be stored for - postprocessing. Applies to stress and strain data for layered elements - BEAM161, SHELL163, SHELL181, SOLID185, SOLID186, SOLSH190, SHELL208, - SHELL209, SHELL281, REINF265, and ELBOW290. - - The SHELL command can be used (for shell elements) to specify a - location (TOP, MID, BOT) within the layer for selection on the ESOL - command. Transverse shear stresses for MID are linearly averaged from - TOP and BOT, and do not reflect a parabolic distribution. Setting - KEYOPT(8) = 2 for SHELL181, SHELL208, SHELL209, SHELL281, and ELBOW290 - writes the mid-surface values directly to the results file and yields - more accurate values than linear averaging. - - That this command cannot be used for energy output, as energy is a per- - element quantity. - - When using the LAYERP26 command with SHELL181, SOLID185, SOLID186, - SOLSH190, SHELL208, or SHELL209, KEYOPT(8) must be set to 1 (or 2 for - SHELL181, SHELL208, SHELL209, SHELL281, and ELBOW290) in order to store - results for all layers. - - For the ANSYS LS-DYNA product, this command works differently than - described above. For SHELL163 and BEAM161, you must first use EDINT - during the solution phase to define the integration points for which - you want output data. Be aware that the output location for SHELL163 - data is always at the integration point, so "top" and "bottom" refer to - the top or bottom integration point, not necessarily the top or bottom - surface. For more information, see the ANSYS LS-DYNA User's Guide. - - In POST26, the ESOL data stored is based on the active LAYERP26 - specification at the time the data is stored. To store data at various - specifications (for example, layers 2 and 5), issue a STORE command - before each new specification. - """ - command = f"LAYERP26,{num}" - return self.run(command, **kwargs) - - def shell(self, loc="", **kwargs): - """Selects a shell element or shell layer location for results output. - - APDL Command: SHELL - - Parameters - ---------- - loc - Location within shell element (or layer) to obtain stress results: - - TOP - Top of shell element (or layer) (default). - - MID - Middle of shell element (or layer). The default method averages the TOP and BOT - values to obtain a mid value. Setting KEYOPT(8) = 2 for - SHELL181, SHELL208, SHELL209, and ELBOW290 uses MID results - obtained directly from the results file. - - BOT - Bottom of shell element (or layer). - - Notes - ----- - Selects the location within a shell element (or a shell layer) for - results output (nodal stresses, strains, etc.). Applies to POST1 - selects, sorts, and output [NSEL, NSORT, PRNSOL, PLNSOL, PRPATH, - PLPATH, etc.], and is used for storage with the POST26 ESOL command. - For example, SHELL,TOP causes item S of the POST1 PRNSOL command or the - POST26 ESOL command to be the stresses at the top of the shell - elements. For layered shell elements, use the LAYER (POST1) or - LAYERP26 (POST26) command to select the layer. The SHELL command does - not apply to the layered thermal shell elements, SHELL131 and SHELL132. - - For PowerGraphics [/GRAPHICS,POWER], the SHELL,MID command affects both - the printed output and the displayed results, while the SHELL (TOP or - BOT) command prints and displays both the top and bottom layers - simultaneously. Note that /CYCEXPAND,ON automatically turns on - PowerGraphics; however, for cyclic mode-superposition harmonic - postprocessing (CYCFILES), the SHELL command prints and displays only - the requested layer. - - In POST26, the ESOL data stored is based on the active SHELL - specification at the time the data is stored. To store data at various - specifications (for example, stresses at the top and bottom locations), - issue a STORE command before each new specification. - """ - command = f"SHELL,{loc}" - return self.run(command, **kwargs) - - def tvar(self, key="", **kwargs): - """Changes time to the cumulative iteration number. - - APDL Command: TVAR - - Parameters - ---------- - key - Time key: - - 0 - Time is used for the variable TIME. - - 1 - NCUMIT is used for the variable TIME. - - Notes - ----- - Changes the meaning of the time variable to the cumulative iteration - number (NCUMIT) variable. Data can be read from the file, printed, and - displayed as a function of NCUMIT rather than time. All POST26 - descriptions applying to TIME then apply to NCUMIT. - """ - command = f"TVAR,{key}" - return self.run(command, **kwargs) diff --git a/src/ansys/mapdl/core/_commands/post26_/display.py b/src/ansys/mapdl/core/_commands/post26_/display.py deleted file mode 100644 index 93550a5d46..0000000000 --- a/src/ansys/mapdl/core/_commands/post26_/display.py +++ /dev/null @@ -1,193 +0,0 @@ -# Copyright (C) 2016 - 2025 ANSYS, Inc. and/or its affiliates. -# SPDX-License-Identifier: MIT -# -# -# Permission is hereby granted, free of charge, to any person obtaining a copy -# of this software and associated documentation files (the "Software"), to deal -# in the Software without restriction, including without limitation the rights -# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -# copies of the Software, and to permit persons to whom the Software is -# furnished to do so, subject to the following conditions: -# -# The above copyright notice and this permission notice shall be included in all -# copies or substantial portions of the Software. -# -# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -# SOFTWARE. - - -class Display: - def keep(self, key="", **kwargs): - """Stores POST26 definitions and data during active session. - - APDL Command: KEEP - - Parameters - ---------- - key - State or value - - On or 1 - Allows you to exit and reenter /POST26 without losing your current time history - variable information. Keeps a cache of the /POST26 - variable information including the active file name - (FILE), variable definitions (NSOL, ESOL, GAPF, RFORCE, - SOLU, and EDREAD) and stored variable data in memory for - the current ANSYS session. - - Off or 0 - /POST26 variable information is deleted when you exit /POST26. - - Notes - ----- - Your variable information is saved in memory only for the current - active ANSYS session. It is deleted when you exit ANSYS. This - information is also deleted when you issue /CLEAR, RESUME, SOLVE, or - RESET. - - When you reenter /POST26 all time history variable data is available - for use. When you issue STORE,NEW, variable definitions created by math - operations such as ADD or PROD will not be restored. However, variables - defined with NSOL, ESOL, GAPF, RFORCE, SOLU, and EDREAD will be - restored. Only the last active results file name is kept in memory - (FILE). - - Commands such as LAYERP26, SHELL, and FORCE that specify the location - or a component of data to be stored will retain the setting at the time - of exiting /POST26 . - """ - command = f"KEEP,{key}" - return self.run(command, **kwargs) - - def plcplx(self, key="", **kwargs): - """Specifies the part of a complex variable to display. - - APDL Command: PLCPLX - - Parameters - ---------- - key - Complex variable part: - - 0 - Amplitude. - - 1 - Phase angle. - - 2 - Real part. - - 3 - Imaginary part. - - Notes - ----- - Used only with harmonic analyses (ANTYPE,HARMIC). - - All results data are stored in the form of real and imaginary - components and converted to amplitude and/or phase angle as specified - via the PLCPLX command. The conversion is not valid for derived - results (such as principal stress/strain, equivalent stress/strain and - USUM). - """ - command = f"PLCPLX,{key}" - return self.run(command, **kwargs) - - def pltime(self, tmin="", tmax="", **kwargs): - """Defines the time range for which data are to be displayed. - - APDL Command: PLTIME - - Parameters - ---------- - tmin - Minimum time (defaults to the first point stored). - - tmax - Maximum time (defaults to the last point stored). - - Notes - ----- - Defines the time (or frequency) range (within the range stored) for - which data are to be displayed. Time is always displayed in the Z-axis - direction for 3-D graph displays. If XVAR = 1, time is also displayed - in the X-axis direction and this control also sets the abscissa scale - range. - """ - command = f"PLTIME,{tmin},{tmax}" - return self.run(command, **kwargs) - - def plvar( - self, - nvar1="", - nvar2="", - nvar3="", - nvar4="", - nvar5="", - nvar6="", - nvar7="", - nvar8="", - nvar9="", - nvar10="", - **kwargs, - ): - """Displays up to ten variables in the form of a graph. - - APDL Command: PLVAR - - Parameters - ---------- - nvar1, nvar2, nvar3, . . . , nvar10 - Variables to be displayed, defined either by the reference number - or a unique thirty-two character name. If duplicate names are used - the command will plot the data for the lowest-numbered variable - with that name. - - Notes - ----- - Variables are displayed vs. variable N on the XVAR command. The string - value will be a predefined, unique name. For complex variables, the - amplitude is displayed by default [PLCPLX]. Each PLVAR command - produces a new frame. See the /GRTYP command for displaying multiple - variables in a single frame with separate Y-axes. - """ - command = f"PLVAR,{nvar1},{nvar2},{nvar3},{nvar4},{nvar5},{nvar6},{nvar7},{nvar8},{nvar9},{nvar10}" - return self.run(command, **kwargs) - - def spread(self, value="", **kwargs): - """Turns on a dashed tolerance curve for the subsequent curve plots. - - APDL Command: SPREAD - - Parameters - ---------- - value - Amount of tolerance. For example, 0.1 is ± 10%. - """ - return self.run("SPREAD,%s" % (str(value)), **kwargs) - - def xvar(self, n="", **kwargs): - """Specifies the X variable to be displayed. - - APDL Command: XVAR - - Parameters - ---------- - n - X variable number: - - 0 or 1 - Display PLVAR values vs. time (or frequency). - - n - Display PLVAR values vs. variable n (2 to NV [NUMVAR]). - - 1 - Interchange time and PLVAR variable numbers with time as the curve parameter. - PLVAR variable numbers are displayed uniformly spaced along - X-axis from position 1 to 10. - - Notes - ----- - Defines the X variable (displayed along the abscissa) against which the - Y variable(s) [PLVAR] are to be displayed. - """ - command = f"XVAR,{n}" - return self.run(command, **kwargs) diff --git a/src/ansys/mapdl/core/_commands/post26_/listing.py b/src/ansys/mapdl/core/_commands/post26_/listing.py deleted file mode 100644 index f4290fde89..0000000000 --- a/src/ansys/mapdl/core/_commands/post26_/listing.py +++ /dev/null @@ -1,162 +0,0 @@ -# Copyright (C) 2016 - 2025 ANSYS, Inc. and/or its affiliates. -# SPDX-License-Identifier: MIT -# -# -# Permission is hereby granted, free of charge, to any person obtaining a copy -# of this software and associated documentation files (the "Software"), to deal -# in the Software without restriction, including without limitation the rights -# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -# copies of the Software, and to permit persons to whom the Software is -# furnished to do so, subject to the following conditions: -# -# The above copyright notice and this permission notice shall be included in all -# copies or substantial portions of the Software. -# -# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -# SOFTWARE. - - -class Listing: - def extrem(self, nvar1="", nvar2="", ninc="", **kwargs): - """Lists the extreme values for variables. - - APDL Command: EXTREM - - Parameters - ---------- - nvar1, nvar2, ninc - List extremes for variables NVAR1 through NVAR2 in steps of NINC. - Variable range defaults to its maximum. NINC defaults to 1. - - Notes - ----- - Lists the extreme values (and the corresponding times) for stored and - calculated variables. Extremes for stored variables are automatically - listed as they are stored. Only the real part of a complex number is - used. Extreme values may also be assigned to parameters [``*GET``]. - """ - command = f"EXTREM,{nvar1},{nvar2},{ninc}" - return self.run(command, **kwargs) - - def lines(self, n="", **kwargs): - """Specifies the length of a printed page. - - APDL Command: LINES - - Parameters - ---------- - n - Number of lines per page (defaults to 20). (Minimum allowed = 11). - - Notes - ----- - Specifies the length of a printed page (for use in reports, etc.). - """ - command = f"LINES,{n}" - return self.run(command, **kwargs) - - def nprint(self, n="", **kwargs): - """Defines which time points stored are to be listed. - - APDL Command: NPRINT - - Parameters - ---------- - n - List data associated with every N time (or frequency) point(s), - beginning with the first point stored (defaults to 1). - - Notes - ----- - Defines which time (or frequency) points within the range stored are to - be listed. - """ - command = f"NPRINT,{n}" - return self.run(command, **kwargs) - - def prcplx(self, key="", **kwargs): - """Defines the output form for complex variables. - - APDL Command: PRCPLX - - Parameters - ---------- - key - Output form key: - - 0 - Real and imaginary parts. - - 1 - Amplitude and phase angle. Stored real and imaginary data are converted to - amplitude and phase angle upon output. Data remain stored as - real and imaginary parts. - - Notes - ----- - Defines the output form for complex variables. Used only with harmonic - analyses (ANTYPE,HARMIC). - - All results data are stored in the form of real and imaginary - components and converted to amplitude and/or phase angle as specified - via the PRCPLX command. The conversion is not valid for derived - results (such as principal stress/strain, equivalent stress/strain and - USUM). - """ - command = f"PRCPLX,{key}" - return self.run(command, **kwargs) - - def prtime(self, tmin="", tmax="", **kwargs): - """Defines the time range for which data are to be listed. - - APDL Command: PRTIME - - Parameters - ---------- - tmin - Minimum time (defaults to the first point stored). - - tmax - Maximum time (defaults to the last point stored). - - Notes - ----- - Defines the time (or frequency) range (within the range stored) for - which data are to be listed. - """ - command = f"PRTIME,{tmin},{tmax}" - return self.run(command, **kwargs) - - def prvar( - self, - nvar1="", - nvar2="", - nvar3="", - nvar4="", - nvar5="", - nvar6="", - **kwargs, - ): - """Lists variables vs. time (or frequency). - - APDL Command: PRVAR - - Parameters - ---------- - nvar1, nvar2, nvar3, . . . , nvar6 - Variables to be displayed, defined either by the reference number - or a unique thirty-two character name. If duplicate names are used - the command will print the data for the lowest-numbered variable - with that name. - - Notes - ----- - Lists variables vs. time (or frequency). Up to six variables may be - listed across the line. Time column output format can be changed using - the /FORMAT command arguments Ftype, NWIDTH, and DSIGNF. - """ - command = f"PRVAR,{nvar1},{nvar2},{nvar3},{nvar4},{nvar5},{nvar6}" - return self.run(command, **kwargs) diff --git a/src/ansys/mapdl/core/_commands/post26_/operations.py b/src/ansys/mapdl/core/_commands/post26_/operations.py deleted file mode 100644 index 7e72716c0e..0000000000 --- a/src/ansys/mapdl/core/_commands/post26_/operations.py +++ /dev/null @@ -1,711 +0,0 @@ -# Copyright (C) 2016 - 2025 ANSYS, Inc. and/or its affiliates. -# SPDX-License-Identifier: MIT -# -# -# Permission is hereby granted, free of charge, to any person obtaining a copy -# of this software and associated documentation files (the "Software"), to deal -# in the Software without restriction, including without limitation the rights -# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -# copies of the Software, and to permit persons to whom the Software is -# furnished to do so, subject to the following conditions: -# -# The above copyright notice and this permission notice shall be included in all -# copies or substantial portions of the Software. -# -# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -# SOFTWARE. - - -class Operations: - def abs(self, ir="", ia="", name="", facta="", **kwargs): - """Forms the absolute value of a variable. - - APDL Command: ABS - - Parameters - ---------- - ir - Arbitrary reference number assigned to the resulting - variable (2 to NV [NUMVAR]). If this number is the same - as for a previously defined variable, the previously - defined variable will be overwritten with this result. - - ia - Reference number of the variable to be operated on. - - name - Thirty-two character name for identifying the variable on - the printout and displays. Embedded blanks are compressed - upon output. - - facta - Scaling factor (positive or negative) applied to variable - IA (defaults to 1.0). - - Notes - ----- - The new variable is calculated as: - - IR = | FACTA x IA | - - For a complex number (a + ib), the absolute value is the - magnitude, where the IA values are obtained from: - ``sqrt(a**2 + b**2)`` - - See POST26 - Data Operations in the Mechanical APDL Theory - Reference for details. - """ - return self.run(f"ABS,{ir},{ia},,,{name},,,{facta}", **kwargs) - - def add( - self, - ir="", - ia="", - ib="", - ic="", - name="", - facta="", - factb="", - factc="", - **kwargs, - ): - """Adds (sums) variables. - - APDL Command: ADD - - Parameters - ---------- - ir - Arbitrary reference number assigned to the resulting variable (2 to - NV [NUMVAR]). If this number is the same as for a previously - defined variable, the previously defined variable will be - overwritten with this result. - - ia, ib, ic - Reference numbers of the three variables to be operated on. If - only two variables, leave IC blank. If only one, leave IB and IC - blank. - - name - Thirty-two character name for identifying the variable on the - printout and displays. Embedded blanks are compressed upon output. - - facta, factb, factc - Scaling factors (positive or negative) applied to the corresponding - variables (default to 1.0). - - Notes - ----- - Adds variables (up to three at once) according to the operation: - - IR = (FACTA x IA) + (FACTB x IB) + (FACTC x IC) - """ - command = f"ADD,{ir},{ia},{ib},{ic},{name},,,{facta},{factb},{factc}" - return self.run(command, **kwargs) - - def atan(self, ir="", ia="", name="", facta="", **kwargs): - """Forms the arctangent of a complex variable. - - APDL Command: ATAN - - Parameters - ---------- - ir - Arbitrary reference number assigned to the resulting variable (2 to - NV [NUMVAR]). If this number is the same as for a previously - defined variable, the previously defined variable will be - overwritten with this result. - - ia - Reference number of the complex variable to be operated on. - - name - Thirty-two character name for identifying the variable on the - printout and displays. Embedded blanks are compressed upon output. - - facta - Scaling factor (positive or negative) applied to variable - IA (defaults to 1.0). Usually FACTA should be set to 1. - FACTA may affect the position of the angle by a multiple - of π, resulting in a quadrant change. - - Notes - ----- - Forms the arctangent of a complex variable according to the - operation: - - IR = ATAN(FACTA X b/a) - - where a and b are the real and imaginary parts, respectively, - of the complex variable IA (which is of the form a + ib). The - arctangent represents the phase angle (in radians), and is - valid only for a harmonic analysis (ANTYPE,HARMIC). - - Since the scaling factor is applied uniformly to b/a, applying - any positive or negative scaling factor will not affect the - size of the phase angle, with the exception that a negative - scaling factor will change the results quadrant by : π. The - magnitude of a complex number is still obtained through the - ABS command. See POST26 - Data Operations in the Mechanical - APDL Theory Reference for details. - """ - command = f"ATAN,{ir},{ia},,,{name},,,{facta}" - return self.run(command, **kwargs) - - def clog(self, ir="", ia="", name="", facta="", factb="", **kwargs): - """Forms the common log of a variable - - APDL Command: CLOG - - Parameters - ---------- - ir - Arbitrary reference number assigned to the resulting - variable (2 to NV [NUMVAR]). If this number is the same - as for a previously defined variable, the previously - defined variable will be overwritten with this result. - - ia - Reference number of the variable to be operated on. - - name - Thirty-two character name for identifying the variable on - printouts and displays. Embedded blanks are compressed - for output. - - facta - Scaling factor applied to variable IA (defaults to 1.0). - - factb - Scaling factor (positive or negative) applied to the operation - (defaults to 1.0). - - Notes - ----- - Forms the common log of a variable according to the operation: - - ``IR = FACTB*LOG(FACTA x IA)`` - """ - return self.run(f"CLOG,{ir},{ia},,,{name},,,{facta},{factb}", **kwargs) - - def conjug(self, ir="", ia="", name="", facta="", **kwargs): - """Forms the complex conjugate of a variable. - - APDL Command: CONJUG - - Parameters - ---------- - ir - Arbitrary reference number assigned to the resulting variable (2 to - NV [NUMVAR]). If this number is the same as for a previously - defined variable, the previously defined variable will be - overwritten with this result. - - ia - Reference number of the variable to be operated on. - - name - Thirty-two character name for identifying the variable on printouts - and displays. Embedded blanks are compressed for output. - - facta - Scaling factor (positive or negative) applied to variable (default - to 1.0). - - Notes - ----- - Used only with harmonic analyses (ANTYPE,HARMIC). - """ - return self.run(f"CONJUG,{ir},{ia},,,{name},,,{facta}", **kwargs) - - def deriv(self, ir="", iy="", ix="", name="", facta="", **kwargs): - """Differentiates a variable. - - APDL Command: DERIV - - Parameters - ---------- - ir - Arbitrary reference number assigned to the resulting - variable (2 to NV [NUMVAR]). If this number is the same - as for a previously defined variable, the previously - defined variable will be overwritten with this result. - - iy, ix - Reference numbers of variables to be operated on. IY is - differentiated with respect to IX. - - name - Thirty-two character name for identifying the variable on - printouts and displays. Embedded blanks are compressed for - output. - - facta - Scaling factor (positive or negative) applied as shown - below (defaults to 1.0). - - Notes - ----- - Differentiates variables according to the operation: - - IR = FACTA x d(IY)/d(IX) - """ - return self.run(f"DERIV,{ir},{iy},{ix},,{name},,,{facta}", **kwargs) - - def exp(self, ir="", ia="", name="", facta="", factb="", **kwargs): - """Forms the exponential of a variable. - - APDL Command: EXP - - Parameters - ---------- - ir - Arbitrary reference number assigned to the resulting - variable (2 to NV [NUMVAR]). If this number is the same as - for a previously defined variable, the previously defined - variable will be overwritten with this result. - - ia - Reference number of the variable to be operated on. - - name - Thirty-two character name for identifying the variable on - the printout and displays. Embedded blanks are compressed - upon output. - - facta - Scaling factor applied to variable IA (defaults to 1.0). - - factb - Scaling factor (positive or negative) applied to the operation - (defaults to 1.0). - - Notes - ----- - Forms the exponential of a variable according to the operation: - - ``IR = FACTB*EXP(FACTA x IA)`` - """ - return self.run(f"EXP,{ir},{ia},,,{name},,,{facta},{factb}", **kwargs) - - def filldata(self, ir="", lstrt="", lstop="", linc="", value="", dval="", **kwargs): - """Fills a variable by a ramp function. - - APDL Command: FILLDATA - - Parameters - ---------- - ir - Define data table as variable IR (2 to NV [NUMVAR]). - - lstrt - Start at location LSTRT (defaults to 1). - - lstop - Stop at location LSTOP (defaults to maximum location as determined - from data previously stored. - - linc - Fill every LINC location between LSTRT and LSTOP (defaults to 1). - - value - Value assigned to location LSTRT. - - dval - Increment value of previous filled location by DVAL and assign sum - to next location to be filled (may be positive or negative.) - - Notes - ----- - Locations may be filled continuously or at regular intervals (LINC). - Previously defined data at a location will be overwritten. - """ - command = f"FILLDATA,{ir},{lstrt},{lstop},{linc},{value},{dval}" - return self.run(command, **kwargs) - - def imagin(self, ir="", ia="", name="", facta="", **kwargs): - """Forms an imaginary variable from a complex variable. - - APDL Command: IMAGIN - - Parameters - ---------- - ir - Arbitrary reference number assigned to the resulting - variable (2 to NV [NUMVAR]). If this number is the same - as for a previously defined variable, the previously - defined variable will be overwritten with this result. - - ia - Reference number of the variable to be operated on. - - name - Thirty-two character name for identifying the variable on - the printout and displays. Embedded blanks are compressed - upon output. - - facta - Scaling factor (positive or negative) applied to variable IA - (defaults to 1.0). - - Notes - ----- - This command forms a new variable from a complex variable by - storing the imaginary part as the real part. The imaginary - part can then be used in other operations. Used only with - harmonic analyses (ANTYPE,HARMIC). - - Complex variables are stored in two-column arrays with the - real component stored in the first column and the imaginary - component stored in the second column. This command extracts - the value stored in the second column (i.e., imaginary - component). However, with harmonic analyses, all variables - are stored in two-column arrays as complex variables. If the - variable is not complex, then the same value is stored in both - columns. This command will extract the variable in the second - column of the array, even if this variable is not the - imaginary component of a complex variable. - """ - return self.run(f"IMAGIN,{ir},{ia},,,{name},,,{facta}", **kwargs) - - def int1( - self, - ir="", - iy="", - ix="", - name="", - facta="", - factb="", - const="", - **kwargs, - ): - """Integrates a variable. - - APDL Command: INT1 - - Parameters - ---------- - ir - Arbitrary reference number assigned to the resulting - variable (2 to NV [NUMVAR]). If this number is the same - as for a previously defined variable, the previously - defined variable will be overwritten with this result. - Table values represent integrated sum of IY to current - table position of IX. - - iy, ix - Integrate variable IY with respect to IX. - - name - Thirty-two character name for identifying the variable on - the printout and displays. Embedded blanks are compressed - upon output. - - facta, factb - Scaling factors (positive or negative) applied to the - corresponding variables (default to 1.0). - - const - Initial value. - - Notes - ----- - Integrates variables according to the operation: - - IR = ∫ (FACTA x IY) d(FACTB x IX) + CONST - """ - command = f"INT1,{ir},{iy},{ix},,{name},,,{facta},{factb},{const}" - return self.run(command, **kwargs) - - def large( - self, - ir="", - ia="", - ib="", - ic="", - name="", - facta="", - factb="", - factc="", - **kwargs, - ): - """Finds the largest (the envelope) of three variables. - - APDL Command: LARGE - - Parameters - ---------- - ir - Arbitrary reference number assigned to the resulting variable (2 to - NV [NUMVAR]). If this number is the same as for a previously - defined variable, the previously defined variable will be - overwritten with this result. - - ia, ib, ic - Reference numbers of the three variables to be operated on. If - only two, leave IC blank. If only one, leave IB blank also. - - name - Thirty-two character name for identifying the variable on the - printout and displays. Embedded blanks are compressed upon output. - - facta, factb, factc - Scaling factors (positive or negative) applied to the corresponding - variables (default to 1.0). - - Notes - ----- - Creates a new variable by finding the largest of up to three variables - according to the operation: - - IR = Largest of (FACTA x IA, FACTB x IB, FACTC x IC) - - The comparison is done at each time location, so that the new variable - is the "envelope" of the three existing variables. - """ - command = f"LARGE,{ir},{ia},{ib},{ic},{name},,,{facta},{factb},{factc}" - return self.run(command, **kwargs) - - def nlog(self, ir="", ia="", name="", facta="", factb="", **kwargs): - """Forms the natural log of a variable. - - APDL Command: NLOG - - Parameters - ---------- - ir - Arbitrary reference number assigned to the resulting - variable (2 to NV [NUMVAR]). If this number is the same - as for a previously defined variable, the previously - defined variable will be overwritten with this result. - - ia - Reference number of the variable to be operated on. - - name - Thirty-two character name identifying the variable on - printouts and displays. Embedded blanks are compressed - for output. - - facta - Scaling factor applied to variable IA (defaults to 1.0). - - factb - Scaling factor (positive or negative) applied to the operation - (defaults to 1.0). - - Notes - ----- - Forms the natural log of a variable according to the operation: - - ``IR = FACTB*LN(FACTA x IA)`` - """ - return self.run(f"NLOG,{ir},{ia},,,{name},,,{facta},{factb}", **kwargs) - - def prod( - self, - ir="", - ia="", - ib="", - ic="", - name="", - facta="", - factb="", - factc="", - **kwargs, - ): - """Multiplies variables. - - APDL Command: PROD - - Parameters - ---------- - ir - Arbitrary reference number assigned to the resulting - variable (2 to NV [NUMVAR]). If this number is the same - as for a previously defined variable, the previously - defined variable will be overwritten with this result. - - ia, ib, ic - Reference numbers of the three variables to be operated - on. If only two leave IC blank. If only one, leave IB - blank also. - - name - Thirty-two character name identifying the variable on - printouts and displays. Embedded blanks are compressed - for output. - - facta, factb, factc - Scaling factors (positive or negative) applied to the - corresponding variables (default to 1.0). - - Notes - ----- - Multiplies variables (up to three at once) according to the - operation: - - ``IR = (FACTA x IA) x (FACTB x IB) x (FACTC x IC)`` - """ - return self.run( - f"PROD,{ir},{ia},{ib},{ic},{name},,,{facta},{factb},{factc}", - **kwargs, - ) - - def quot(self, ir="", ia="", ib="", name="", facta="", factb="", **kwargs): - """Divides two variables. - - APDL Command: QUOT - - Parameters - ---------- - ir - Arbitrary reference number assigned to the resulting variable (2 to - NV [NUMVAR]). If this number is the same as for a previously - defined variable, the previously defined variable will be - overwritten with this result. - - ia, ib - Reference numbers of the two variables to be operated on. - - name - Thirty-two character name identifying the variable on printouts and - displays. Embedded blanks are compressed for output. - - facta, factb - Scaling factors (positive or negative) applied to the corresponding - variables (default to 1.0). - - Notes - ----- - Divides two variables according to the operation: - - IR = (FACTA x IA)/(FACTB x IB) - """ - return self.run(f"QUOT,{ir},{ia},{ib},,{name},,,{facta},{factb}", **kwargs) - - def realvar(self, ir="", ia="", name="", facta="", **kwargs): - """Forms a variable using only the real part of a complex variable. - - APDL Command: REALVAR - - Parameters - ---------- - ir - Arbitrary reference number assigned to the resulting variable (2 to - NV [NUMVAR]). If this number is the same as for a previously - defined variable, the previously defined variable will be - overwritten with this result. - - ia - Reference number of the variable to be operated on. - - name - Thirty-two character name identifying the variable on printouts and - displays. Embedded blanks are compressed for output. - - facta - Scaling factor (positive or negative) applied to variable IA - (defaults to 1.0). - - Notes - ----- - Forms a variable using only the real part of a variable. Used only - with harmonic analyses (ANTYPE,HARMIC). - - Complex variables are stored in two-column arrays with the - real component stored in the first column and the imaginary - component stored in the second column. This command extracts - the value stored in the first column (i.e., real component). - However with harmonic analyses, all variables are stored in - two-column arrays as complex variables. If the variable is - not complex, then the same value is stored in both columns. - This command will extract the variable in the first column of - the array, even if this variable is not the real component of - a complex variable. - """ - command = f"REALVAR,{ir},{ia},,,{name},,,{facta}" - return self.run(command, **kwargs) - - def small( - self, - ir="", - ia="", - ib="", - ic="", - name="", - facta="", - factb="", - factc="", - **kwargs, - ): - """Finds the smallest of three variables. - - APDL Command: SMALL - - Parameters - ---------- - ir - Arbitrary reference number assigned to the resulting - variable (2 to NV [NUMVAR]). If this number is the same - as for a previously defined variable, the previously - defined variable will be overwritten with this result. - - ia, ib, ic - Reference numbers of the three variables to be operated - on. If only two, leave IC blank. If only one, leave IB - blank also. - - name - Thirty-two character name identifying the variable on - printouts and displays. Embedded blanks are compressed - for output. - - facta, factb, factc - Scaling factors (positive or negative) applied to the - corresponding variables (defaults to 1.0). - - Notes - ----- - Finds the smallest of three variables according to the operation: - - ``IR = min(FACTA x IA, FACTB x IB, FACTC x IC)`` - """ - command = f"SMALL,{ir},{ia},{ib},{ic},{name},,,{facta},{factb},{factc}" - return self.run(command, **kwargs) - - def sqrt(self, ir="", ia="", name="", facta="", **kwargs): - """Forms the square root of a variable. - - APDL Command: SQRT - - Parameters - ---------- - ir - Arbitrary reference number assigned to the resulting variable (2 to - NV [NUMVAR]). If this number is the same as for a previously - defined variable, the previously defined variable will be - overwritten with this result. - - ia - Reference number of the variable to be operated on. - - name - Thirty-two character name identifying the variable on printouts and - displays. Embedded blanks are compressed for output. - - facta - Scaling factor (positive or negative) applied to variable IA - (defaults to 1.0). - - Notes - ----- - Forms the square root of a variable according to the operation: - ``IR=sqrt(FACTA*IA)`` - """ - return self.run(f"SQRT,{ir},{ia},,,{name},,,{facta}", **kwargs) diff --git a/src/ansys/mapdl/core/_commands/post26_/setup.py b/src/ansys/mapdl/core/_commands/post26_/setup.py deleted file mode 100644 index 845f66fda2..0000000000 --- a/src/ansys/mapdl/core/_commands/post26_/setup.py +++ /dev/null @@ -1,920 +0,0 @@ -# Copyright (C) 2016 - 2025 ANSYS, Inc. and/or its affiliates. -# SPDX-License-Identifier: MIT -# -# -# Permission is hereby granted, free of charge, to any person obtaining a copy -# of this software and associated documentation files (the "Software"), to deal -# in the Software without restriction, including without limitation the rights -# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -# copies of the Software, and to permit persons to whom the Software is -# furnished to do so, subject to the following conditions: -# -# The above copyright notice and this permission notice shall be included in all -# copies or substantial portions of the Software. -# -# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -# SOFTWARE. - -from typing import Optional - -from ansys.mapdl.core.mapdl_types import MapdlInt - - -class Setup: - def ansol( - self, - nvar="", - node="", - item="", - comp="", - name="", - mat="", - real="", - ename="", - **kwargs, - ): - """Specifies averaged nodal data to be stored from the results file in the - - APDL Command: ANSOL - solution coordinate system. - - Parameters - ---------- - nvar - Arbitrary reference number assigned to this variable (2 to NV - [NUMVAR]). Overwrites any existing results for this variable. - - node - Node number for which data are to be stored. - - item - Label identifying the item. General item labels are shown in - Table 126: ANSOL - General Item and Component Labels below. Some - items also require a component label. - - comp - Component of the item (if required). General component labels are - shown in Table 126: ANSOL - General Item and Component Labels - below. - - name - Thirty-two character name for identifying the item on the printout - and displays. Defaults to an eight character label formed by - concatenating the first four characters of the Item and Comp - labels. - - mat - The material number. Average will be computed based on the subset - of elements with the specified material number. DEFAULT: Use all - elements in the active set unless Real and/or Ename is specified. - - real - The real number. Average will be computed based on the subset of - elements with the specified real number. DEFAULT: Use all elements - in the active set unless Mat and/or Ename is specified. - - ename - The element type name. Average will be computed based on the subset - of elements with the specified element type name. DEFAULT: Use all - elements in the active set unless Mat and/or Real is specified. - - Notes - ----- - Valid item and component labels for averaged nodal results are listed - in Table: 126:: ANSOL - General Item and Component Labels, below. - - All element nodal quantities are obtained in RSYS, Solu and then - averaged. - - The ANSOL command defines averaged nodal results data to be stored from - a results file [FILE]. Not all items are valid for all nodes. See the - input and output summary tables of the Element Reference of each - element that is attached to the node for the available items. - - COORDINATE SYSTEMS: All element nodal results used by ANSOL for - averaging are in the element coordinate system, except for layered - elements. Layered element results are in the layer coordinate system. - You can further specify the element nodal results, for some elements, - with the SHELL, LAYERP26, and FORCE commands. - - ANSOL does not transform results from RSYS, SOLU to other coordinate - systems. Verify that all elements attached to the subject node have the - same coordinate system before using ANSOL. - - SHELL ELEMENTS: The default shell element coordinate system is based on - node ordering. For shell elements the adjacent elements could have a - different RSYS,SOLU, making the resultant averaged data inconsistent. A - note to this effect is issued when ANSOL is used in models containing - shell elements. Ensure that consistent coordinate systems are active - for all associated elements used by the ANSOL command. - - DERIVED QUANTITIES: Some of the result items supported by ANSOL (see - Table: 126:: ANSOL - General Item and Component Labels) are derived - from the component quantities. Use AVPRIN to specify the principal and - vector sum quantity averaging methods. - - DEFAULT: If Mat, Real , and Ename are not specified, all of the - elements attached to the node will be considered. When a material ID, - real constant ID, or element type discontinuity is detected at a node, - a note is issued. For example, in a FSI analysis, a FLUID30 element at - the structure interface would be considered. But since it contains no - SX result, it will not be used during STORE operations. - - Table: 126:: : ANSOL - General Item and Component Labels - - For more information on the meaning of contact status and its possible - values, see Reviewing Results in POST1 in the Contact Technology Guide. - """ - command = f"ANSOL,{nvar},{node},{item},{comp},{name},{mat},{real},{ename}" - return self.run(command, **kwargs) - - def cisol(self, n="", id_="", node="", cont="", dtype="", **kwargs): - """Stores fracture parameter information in a variable. - - APDL Command: CISOL - - Parameters - ---------- - n - Arbitrary reference number or name assigned to this variable. - Number must be >1 but Optional[str]: - """Specify element data to be stored from the results file. - - /POST26 APDL Command: ESOL - - Parameters - ---------- - nvar - Arbitrary reference number assigned to this variable (2 to - NV [NUMVAR]). Overwrites any existing results for this - variable. - - elem - Element for which data are to be stored. - - node - Node number on this element for which data are to be - stored. If blank, store the average element value (except - for FMAG values, which are summed instead of averaged). - - item - Label identifying the item. General item labels are shown - in Table 134: ESOL - General Item and Component Labels - below. Some items also require a component label. - - comp - Component of the item (if required). General component - labels are shown in Table 134: ESOL - General Item and - Component Labels below. If Comp is a sequence number (n), - the NODE field will be ignored. - - name - Thirty-two character name for identifying the item on the - printout and displays. Defaults to a label formed by - concatenating the first four characters of the Item and - Comp labels. - - Notes - ----- - See Table: 134:: ESOL - General Item and Component Labels for - a list of valid item and component labels for element (except - line element) results. - - The ESOL command defines element results data to be stored - from a results file (FILE). Not all items are valid for all - elements. To see the available items for a given element, - refer to the input and output summary tables in the - documentation for that element. - - Two methods of data access are available via the ESOL - command. You can access some simply by using a generic label - (component name method), while others require a label and - number (sequence number method). - - Use the component name method to access general element data - (that is, element data generally available to most element - types or groups of element types). - - The sequence number method is required for data that is not - averaged (such as pressures at nodes and temperatures at - integration points), or data that is not easily described in a - generic fashion (such as all derived data for structural line - elements and contact elements, all derived data for thermal - line elements, and layer data for layered elements). - - Element results are in the element coordinate system, except - for layered elements where results are in the layer coordinate - system. Element forces and moments are in the nodal - coordinate system. Results are obtainable for an element at a - specified node. Further location specifications can be made - for some elements via the SHELL, LAYERP26, and FORCE commands. - - For more information on the meaning of contact status and its - possible values, see Reviewing Results in POST1 in the Contact - Technology Guide. - - Examples - -------- - Switch to the time-history postprocessor - - >>> mapdl.post26() - - Store the stress in the X direction for element 1 at node 1 - - >>> nvar = 2 - >>> mapdl.esol(nvar, 1, 1, 'S', 'X') - - Move the value to an array and access it via mapdl.parameters - - >>> mapdl.dim('ARR', 'ARRAY', 1) - >>> mapdl.vget('ARR', nvar) - >>> mapdl.parameters['ARR'] - array(-1991.40234375) - - """ - command = f"ESOL,{nvar},{elem},{node},{item},{comp},{name}" - return self.run(command, **kwargs) - - def gapf(self, nvar="", num="", name="", **kwargs): - """Defines the gap force data to be stored in a variable. - - APDL Command: GAPF - - Parameters - ---------- - nvar - Arbitrary reference number assigned to this variable (2 to NV - [NUMVAR]). Overwrites any existing results for this variable. - - num - Number identifying gap number for which the gap force is to be - stored. Issue the GPLIST command to display gap numbers. - - name - Thirty-two character name for identifying the item on the printout - and displays (defaults to the name GAPF). - - Notes - ----- - Defines the gap force data to be stored in a variable. Applicable only - to the expansion pass of the mode-superposition linear transient - dynamic (ANTYPE,TRANS) analysis. The data is usually on Fname.RDSP. - """ - command = f"GAPF,{nvar},{num},{name}" - return self.run(command, **kwargs) - - def gssol(self, nvar="", item="", comp="", name="", **kwargs): - """Specifies which results to store from the results file when using - - APDL Command: GSSOL - generalized plane strain. - - Parameters - ---------- - nvar - Arbitrary reference number or name assigned to this variable. - Variable numbers can be 2 to NV (NUMVAR) while the name can be an - eight byte character string. Overwrites any existing results for - this variable. - - item - Label identifying item to be stored. - - LENGTH - Change of fiber length at the ending point. - - ROT - Rotation of the ending plane during deformation. - - F - Reaction force at the ending point in the fiber direction. - - M - Reaction moment applied on the ending plane. - - comp - Component of the item, if Item = ROT or M. - - X - The rotation angle or reaction moment of the ending plane about X. - - Y - The rotation angle or reaction moment of the ending plane about Y. - - name - Thirty-two character name identifying the item on the printout and - display. Defaults to the label formed by concatenating the first - four characters of the Item and Comp labels. - - Notes - ----- - This command stores the results (new position of the ending plane after - deformation) for generalized plane strain. All outputs are in the - global Cartesian coordinate system. For more information about the - generalized plane strain feature, see Generalized Plane Strain Option - of Current-Technology Solid Elements in the Element Reference. - """ - command = f"GSSOL,{nvar},{item},{comp},{name}" - return self.run(command, **kwargs) - - def jsol(self, nvar="", elem="", item="", comp="", name="", **kwargs): - """Specifies result items to be stored for the joint element. - - APDL Command: JSOL - - Parameters - ---------- - nvar - Arbitrary reference number or name assigned to this variable. - Variable numbers can be 2 to NV (NUMVAR) while the name can be an - eight-byte character string. Overwrites any existing results for - this variable. - - elem - Element number for which to store results. - - item - Label identifying the item. Valid item labels are shown in - Table 202: JSOL - Valid Item and Component Labels below. - - comp - Component of the Item (if required). Valid component labels are - shown in Table 202: JSOL - Valid Item and Component Labels below. - - name - Thirty-two character name identifying the item on printouts and - displays. Defaults to a label formed by concatenating the first - four characters of the Item and Comp labels. - - Notes - ----- - This command is valid for the MPC184 joint elements. The values stored - are for the free or unconstrained degrees of freedom of a joint - element. Relative reaction forces and moments are available only if - stiffness, damping, or friction is associated with the joint element. - - Table: 202:: : JSOL - Valid Item and Component Labels - - - """ - command = f"JSOL,{nvar},{elem},{item},{comp},{name}" - return self.run(command, **kwargs) - - def nsol(self, nvar="", node="", item="", comp="", name="", sector="", **kwargs): - """Specifies nodal data to be stored from the results file. - - APDL Command: NSOL - - Parameters - ---------- - nvar - Arbitrary reference number or name assigned to this variable. - Variable numbers can be 2 to NV (NUMVAR) while the name can be an - eight byte character string. Overwrites any existing results for - this variable. - - node - Node for which data are to be stored. - - item - Label identifying the item. Valid item labels are shown in the - table below. Some items also require a component label. - - comp - Component of the item (if required). Valid component labels are - shown in the table below. - - name - Thirty-two character name identifying the item on printouts and - displays. Defaults to a label formed by concatenating the first - four characters of the Item and Comp labels. - - sector - For a full harmonic cyclic symmetry solution, the sector number for - which the results from NODE are to be stored. - - Notes - ----- - Stores nodal degree of freedom and solution results in a variable. For - more information, see Data Interpreted in the Nodal Coordinate System - in the Modeling and Meshing Guide. - - For SECTOR>1, the result is in the nodal coordinate system of the base - sector, and it is rotated to the expanded sector’s location. Refer to - Using the /CYCEXPAND Command in the Cyclic Symmetry Analysis Guide for - more information. - - For SHELL131 and SHELL132 elements with KEYOPT(3) = 0 or 1, use the - labels TBOT, TE2, TE3, . . ., TTOP instead of TEMP. - """ - command = f"NSOL,{nvar},{node},{item},{comp},{name},{sector}" - return self.run(command, **kwargs) - - def nstore(self, tinc="", **kwargs): - """Defines which time points are to be stored. - - APDL Command: NSTORE - - Parameters - ---------- - tinc - Store data associated with every TINC time (or frequency) point(s), - within the previously defined range of TMIN to TMAX [TIMERANGE]. - (Defaults to 1) - - Notes - ----- - Defines which time (or frequency) points within the range are to be - stored. - """ - command = f"NSTORE,{tinc}" - return self.run(command, **kwargs) - - def numvar(self, nv="", **kwargs): - """Specifies the number of variables allowed in POST26. - - APDL Command: NUMVAR - - Parameters - ---------- - nv - Allow storage for NV variables. 200 maximum are allowed. Defaults - to 10 (except for an explicit dynamics analysis, which defaults to - 30). TIME (variable 1) should also be included in this number. - - Notes - ----- - Specifies the number of variables allowed for data read from the - results file and for data resulting from an operation (if any). For - efficiency, NV should not be larger than necessary. NV cannot be - changed after data storage begins. - """ - command = f"NUMVAR,{nv}" - return self.run(command, **kwargs) - - def reset(self, **kwargs): - """Resets all POST1 or POST26 specifications to initial defaults. - - APDL Command: RESET - - Notes - ----- - Has the same effect as entering the processor the first time within the - run. In POST1, resets all specifications to initial defaults, erases - all element table items, path table data, fatigue table data, and load - case pointers. In POST26, resets all specifications to initial - defaults, erases all variables defined, and zeroes the data storage - space. - """ - command = f"RESET," - return self.run(command, **kwargs) - - def rforce(self, nvar="", node="", item="", comp="", name="", **kwargs): - """Specifies the total reaction force data to be stored. - - APDL Command: RFORCE - - Parameters - ---------- - nvar - Arbitrary reference number assigned to this variable (2 to NV - [NUMVAR]). Overwrites any existing results for this variable. - - node - Node for which data are to be stored. If NODE = P, graphical - picking is enabled (valid only in the GUI). - - item - Label identifying the item. Valid item labels are shown in the - table below. Some items also require a component label. - - comp - Component of the item (if required). Valid component labels are - shown in the table below. - - name - Thirty-two character name identifying the item on printouts and - displays. Defaults to an eight character label formed by - concatenating the first four characters of the Item and Comp - labels. - - Notes - ----- - Defines the total reaction force data (static, damping, and inertial - components) to be stored from single pass (ANTYPE,STATIC or TRANS) - solutions or from the expansion pass of mode-superposition - (ANTYPE,HARMIC or TRANS) solutions. - - Table: 228:: : RFORCE - Valid Item and Component Labels - - For SHELL131 and SHELL132 elements with KEYOPT(3) = 0 or 1, use the - labels HBOT, HE2, HE3, . . ., HTOP instead of HEAT. - """ - command = f"RFORCE,{nvar},{node},{item},{comp},{name}" - return self.run(command, **kwargs) - - def rgb( - self, - kywrd="", - pred="", - pgrn="", - pblu="", - n1="", - n2="", - ninc="", - ncntr="", - **kwargs, - ): - """Specifies the RGB color values for indices and contours. - - APDL Command: /RGB - - Parameters - ---------- - kywrd - Determines how RGB modifications will be applied. - - INDEX - Specifies that subsequent color values apply to ANSYS color indices (0-15). - - CNTR - Specifies that subsequent color values apply to contours (1-128). Applies to - C-option devices only (i.e. X11C or Win32C). - - pred - Intensity of the color red, expressed as a percentage. - - pgrn - Intensity of the color green, expressed as a percentage. - - pblu - Intensity of the color blue, expressed as a percentage. - - n1 - First index (0-15), or contour (1-128) to which the designated RGB - values apply. - - n2 - Final index (0-15), or contour (1-128) to which the designated RGB - values apply. - - ninc - The step increment between the values N1 and N2 determining which - contours or indices will be controlled by the specified RGB values. - - ncntr - The new maximum number of contours (1-128). - - Notes - ----- - Issuing the /CMAP command (with no filename) will restore the default - color settings. - """ - command = f"/RGB,{kywrd},{pred},{pgrn},{pblu},{n1},{n2},{ninc},{ncntr}" - return self.run(command, **kwargs) - - def solu(self, nvar="", item="", comp="", name="", **kwargs): - """Specifies solution summary data per substep to be stored. - - APDL Command: SOLU - - Parameters - ---------- - nvar - Arbitrary reference number assigned to this variable (2 to NV - [NUMVAR]). - - item - Label identifying the item. Valid item labels are shown in the - table below. Some items may also require a component label. - - comp - Component of the item (if required). Valid component labels are - shown in the table below. None are currently required. - - name - Thirty-two character name identifying the item on printouts and - displays. Defaults to an eight character label formed by - concatenating the first four characters of the Item and Comp - labels. - - Notes - ----- - See also the PRITER command of POST1 to display some of these items - directly. Valid for a static or full transient analysis. All other - analyses have zeros for the data. Valid item and component labels for - solution summary values are: - """ - command = f"SOLU,{nvar},{item},{comp},{name}" - return self.run(command, **kwargs) - - def store(self, lab="", npts="", **kwargs): - """Stores data in the database for the defined variables. - - APDL Command: STORE - - Parameters - ---------- - lab - Valid labels: - - MERGE - Merge data from results file for the time points in memory with the existing - data using current specifications (default). - - NEW - Store a new set of data, replacing any previously stored data with current - result file specifications and deleting any previously- - calculated (OPER) variables. Variables defined using the - ANSOL command are also deleted. - - APPEN - Append data from results file to the existing data. - - ALLOC - Allocate (and zero) space for NPTS data points. - - PSD - Create a new set of frequency points for PSD calculations (replacing any - previously stored data and erasing any previously calculated - data). - - npts - The number of time points (or frequency points) for storage (used - only with Lab = ALLOC or PSD). The value may be input when using - POST26 with data supplied from other than a results file. This - value is automatically determined from the results file data with - the NEW, APPEN, and MERGE options. For the PSD option, NPTS - determines the resolution of the frequency vector (valid numbers - are between 1 and 10, defaults to 5). - - Notes - ----- - This command stores data from the results file in the database for the - defined variables [NSOL, ESOL, SOLU, JSOL] per specification [FORCE, - LAYERP26, SHELL]. See the Basic Analysis Guide for more information. - - The STORE,PSD command will create a new frequency vector (variable 1) - for response PSD calculations [RPSD]. This command should first be - issued before defining variables [NSOL, ESOL, RFORCE] for which - response PSD's are to be calculated. - """ - command = f"STORE,{lab},{npts}" - return self.run(command, **kwargs) - - def timerange(self, tmin="", tmax="", **kwargs): - """Specifies the time range for which data are to be stored. - - APDL Command: TIMERANGE - - Parameters - ---------- - tmin - Minimum time (defaults to first time (or frequency) point on the - file). - - tmax - Maximum time (defaults to last time (or frequency) point on the - file). - - Notes - ----- - Defines the time (or frequency) range for which data are to be read - from the file and stored in memory. Use the NSTORE command to define - the time increment. - - Use PRTIME or PLTIME to specify the time (frequency) range for cyclic - mode-superposition harmonic analyses. - """ - command = f"TIMERANGE,{tmin},{tmax}" - return self.run(command, **kwargs) - - def vardel(self, nvar="", **kwargs): - """Deletes a variable (GUI). - - APDL Command: VARDEL - - Parameters - ---------- - nvar - The reference number of the variable to be deleted. NVAR is as - defined by NSOL, ESOL, etc. - - Notes - ----- - Deletes a POST26 solution results variable. This is a command - generated by the Graphical User Interface (GUI). It will appear in the - log file (Jobname.LOG) if a POST26 variable is deleted from the - "Defined Time-History Variables" dialog box. This command is not - intended to be typed in directly in an ANSYS session (although it can - be included in an input file for batch input or for use with the /INPUT - command). - """ - command = f"VARDEL,{nvar}" - return self.run(command, **kwargs) - - def varnam(self, ir="", name="", **kwargs): - """Names (or renames) a variable. - - APDL Command: VARNAM - - Parameters - ---------- - ir - Reference number of the variable (2 to NV [NUMVAR]). - - name - Thirty-two character name for identifying variable on printouts and - displays. Embedded blanks are compressed for output. - """ - command = f"VARNAM,{ir},{name}" - return self.run(command, **kwargs) diff --git a/src/ansys/mapdl/core/_commands/post26_/special.py b/src/ansys/mapdl/core/_commands/post26_/special.py deleted file mode 100644 index 695d44e3ac..0000000000 --- a/src/ansys/mapdl/core/_commands/post26_/special.py +++ /dev/null @@ -1,539 +0,0 @@ -# Copyright (C) 2016 - 2025 ANSYS, Inc. and/or its affiliates. -# SPDX-License-Identifier: MIT -# -# -# Permission is hereby granted, free of charge, to any person obtaining a copy -# of this software and associated documentation files (the "Software"), to deal -# in the Software without restriction, including without limitation the rights -# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -# copies of the Software, and to permit persons to whom the Software is -# furnished to do so, subject to the following conditions: -# -# The above copyright notice and this permission notice shall be included in all -# copies or substantial portions of the Software. -# -# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -# SOFTWARE. - - -class Special: - def cvar(self, ir="", ia="", ib="", itype="", datum="", name="", **kwargs): - """Computes covariance between two quantities. - - APDL Command: CVAR - - Parameters - ---------- - ir - Arbitrary reference number assigned to the resulting variable (2 to - NV [NUMVAR]). If this number is the same as for a previous - variable, the previous variable will be overwritten with this - result. - - ia, ib - Reference numbers of the two variables to be operated on. If only - one, leave ``IB`` blank. - - itype - Defines the type of response PSD to be calculated: - - * ``0,1`` - Displacement (default). - - * ``2`` - Velocity. - - * ``3`` - Acceleration. - - datum - Defines the reference with respect to which covariance is to be - calculated: - - * ``1`` - Absolute value. - - * ``2`` - Relative to base (default). - - name - Thirty-two character name for identifying the variable on listings - and displays. Embedded blanks are compressed upon output. - - Notes - ----- - This command computes the covariance value for the variables referenced - by the reference numbers IA and IB. If DATUM = 2, the variable - referenced by IR will contain the individual modal contributions (i.e., - the dynamic or relative values). If DATUM = 1, the variable referenced - by IR will contain the modal contributions followed by the - contributions of pseudo-static and covariance between dynamic and - pseudo-static responses. File.PSD must be available for the - calculations to occur. - """ - command = f"CVAR,{ir},{ia},{ib},{itype},{datum},{name}" - return self.run(command, **kwargs) - - def pmgtran( - self, - fname="", - freq="", - fcnam1="", - fcnam2="", - pcnam1="", - pcnam2="", - ecnam1="", - ccnam1="", - **kwargs, - ): - """Summarizes electromagnetic results from a transient analysis. - - APDL Command: PMGTRAN - - Parameters - ---------- - fname - File name (8 characters maximum) to which tabular data and plot - files will be written. Must be enclosed in single quotes when the - command is manually typed in. Defaults to ``MG_TRNS``. The data file - extension is ``.OUT`` and the plot file extension is ``.PLT``. - - freq - Frequency of solution output. Defaults to 1. Every FREQth - solution on the results file is output. - - fcnam1, fcnam2 - Names of element components for force calculation. Must be - enclosed in single quotes when the command is manually typed in. - - pcnam1, pcnam2 - Names of element components for power loss calculation. Must be - enclosed in single quotes when the command is manually typed in. - - ecnam1, ccnam1 - Names of element components for energy and total current - calculations, respectively. Must be enclosed in single quotes when - the command is manually typed in. - - Notes - ----- - ``PMGTRAN`` invokes an ANSYS macro which calculates and summarizes - electromagnetic results from a transient analysis. The results are - summarized by element components and listed on the screen as well as - written to a file (``Fname.OUT``). Also, graph plots of results as a - function of time are created and written to a file (``Fname.PLT``) for use - in the ``DISPLAY`` program. - - Two components may be selected for the summary of electromagnetic - forces (see ``FMAGSUM``), two for power loss, and one each for stored - energy (see ``SENERGY``) and total current (see ``CURR2D``). See the - referenced commands for other restrictions. - - PMGTRAN is restricted to MKSA units. - - Distributed ANSYS Restriction: This command is not supported in - Distributed ANSYS. - """ - command = f"PMGTRAN,{fname},{freq},{fcnam1},{fcnam2},{pcnam1},{pcnam2},{ecnam1},{ccnam1}" - return self.run(command, **kwargs) - - def rcyc(self, ir="", ia="", sector="", name="", **kwargs): - """Calculates cyclic results for a mode-superposition harmonic solution. - - APDL Command: RCYC - - Parameters - ---------- - ir - Arbitrary reference number assigned to the resulting variable (2 to - NV [NUMVAR]). If this number is the same as for a previous - variable, the previous variable will be overwritten with this - result. - - ia - Reference number of the variable to be operated on. - - sector - Sector number to calculate the results for. - - name - Thirty-two character name identifying the variable on listings and - displays. Embedded blanks are compressed for output. - - Notes - ----- - This command calculates the harmonic response in the sector specified - by SECTOR for the variable referenced by the reference number IA. Only - component values for IA are valid (no principles or sums). The variable - specified by IR will contain the harmonic solution. Jobname.RFRQ from - the cyclic mode-superposition harmonic solve and Jobname.RST or - Jobname.RSTP from the cyclic modal solve must be available for the - calculations to occur. The Jobname must be the same for the cyclic - modal solve and the cyclic mode-superposition harmonic solve. - - For SECTOR > 1, the result is in the nodal coordinate system of the - base sector, and it is rotated to the expanded sector’s location. Refer - to Using the /CYCEXPAND Command in the Cyclic Symmetry Analysis Guide - for more information. - - See also Mode-Superposition Harmonic Cyclic Symmetry Analysis in the - Cyclic Symmetry Analysis Guide. - """ - command = f"RCYC,{ir},{ia},{sector},{name}" - return self.run(command, **kwargs) - - def resp( - self, - ir="", - lftab="", - ldtab="", - spectype="", - dampratio="", - dtime="", - tmin="", - tmax="", - inputtype="", - **kwargs, - ): - """Generates a response spectrum. - - APDL Command: RESP - - Parameters - ---------- - ir - Arbitrary reference number assigned to the response spectrum - results (2 to NV [NUMVAR]). If this number is the same as for a - previously defined variable, the previously defined variable will - be overwritten with these results. - - lftab - Reference number of variable containing frequency table (created - with FILLDATA or DATA command). The frequency table defines the - number and frequency of oscillating systems used to determine the - response spectrum. The frequency interval need not be constant over - the entire range. Frequencies must be input in ascending order. - - ldtab - Reference number of variable containing the input time-history. - - spectype - Defines the type of response spectrum to be calculated: - - * ``0`` or ``1`` - Displacement (relative to base excitation) - - * ``2`` - Velocity (relative to base excitation) - - * ``3`` - Acceleration response spectrum (absolute) - - * ``4`` - Pseudo-velocity - - * ``5`` - Pseudo-acceleration - - dampratio - Ratio of viscous damping to critical damping (input as a decimal - number). - - dtime - Integration time step. This value should be equal to or greater - than the integration time step used in the initial transient - analysis performed to generate the input time-history (LDTAB). - - tmin, tmax - Specifies a subset of the displacement-time history to be used in - the response spectrum calculation. Defaults to the full time - range. - - inputtype - Defines the type of the input time-history: - - * ``0`` - Displacement (default) - - * ``1`` - Acceleration - - Notes - ----- - This command generates a response spectrum from a displacement or - acceleration time-history and frequency data. The response spectrum is - defined as the maximum response of single degree of freedom systems of - varying frequency (or period) to a given input support excitation. - - A response spectrum analysis (``ANTYPE, SPECTR`` with ``SPOPT``, ``SPRS`` or ``MPRS``) - requires a response spectrum input. This input can be determined from - the response spectrum printout or display of this command. - - If a response spectrum is to be calculated from a given displacement - (or acceleration) time-history, the displacement time-history may be - input to a single one-element reduced linear transient dynamic - (``ANTYPE,TRANS``) analysis, so that the calculated output (which should be - the same as the input) will be properly located on the file. - - The integration time step (argument ``DTIME`` on the RESP command) and the - damping coefficient (argument dampRatio) are constant over the - frequency range. The number of calculations done per response spectrum - curve is the product of the number of input solution points ``(TMAX- - TMIN)/DTIME`` and the number of frequency points (frequencies located in - variable LFTAB). - - Input solution points requested (using ``DTIME`` and the frequency range) - at a time not corresponding to an actual displacement solution time on - the file are linearly interpolated with respect to the existing points. - - For the details of the response spectrum calculation, see POST26 - - Response Spectrum Generator (RESP). - """ - command = f"RESP,{ir},{lftab},{ldtab},{spectype},{dampratio},{dtime},{tmin},{tmax},{inputtype}" - return self.run(command, **kwargs) - - def rpsd( - self, - ir="", - ia="", - ib="", - itype="", - datum="", - name="", - signif="", - **kwargs, - ): - """Calculates response power spectral density (PSD). - - APDL Command: RPSD - - Parameters - ---------- - ir - Arbitrary reference number assigned to the resulting variable (2 to - NV [NUMVAR]). If this number is the same as for a previous - variable, the previous variable will be overwritten with this - result. - - ia, ib - Reference numbers of the two variables to be operated on. If only - one, leave ``IB`` blank. - - itype - Defines the type of response PSD to be calculated: - - * ``0,1`` - Displacement (default). - - * ``2`` - Velocity. - - * ``3`` - Acceleration. - - datum - Defines the reference with respect to which response PSD is to be - calculated: - - * ``1`` - Absolute value. - - * ``2`` - Relative to base (default). - - name - Thirty-two character name identifying variable on listings and - displays. Embedded blanks are compressed for output. - - signif - Combine only those modes whose significance level exceeds the - ``SIGNIF`` threshold. The significance level is defined as the modal - covariance matrix term divided by the maximum of all the modal - covariance matrix terms. Any term whose significance level is less - than ``SIGNIF`` is considered insignificant and does not contribute to - the response. All modes are taken into account by default (``SIGNIF = - 0.0``). - - Notes - ----- - This command calculates response power spectral density (PSD) for the - variables referenced by the reference numbers IA and IB. The variable - referred by IR will contain the response PSD. You must issue the - STORE,PSD command first; File.PSD must be available for the - calculations to occur. - - See POST26 - Response Power Spectral Density in the Mechanical APDL - Theory Reference for more information on these equations. - """ - command = f"RPSD,{ir},{ia},{ib},{itype},{datum},{name},,{signif}" - return self.run(command, **kwargs) - - def smooth( - self, - vect1="", - vect2="", - datap="", - fitpt="", - vect3="", - vect4="", - disp="", - **kwargs, - ): - """Allows smoothing of noisy data and provides a graphical representation - - APDL Command: SMOOTH - of the data. - - Parameters - ---------- - vect1 - Name of the first vector that contains the noisy data set (i.e., - independent variable). You must create and fill this vector before - issuing ``SMOOTH``. - - vect2 - Name of the second vector that contains the dependent set of data. - Must be the same length as the first vector. You must create and - fill this vector before issuing ``SMOOTH``. - - datap - Number of data points to be fitted, starting from the beginning of - the vector. If left blank, the entire vector will be fitted. The - maximum number of data points is 100,000 (or greater, depending on - the memory of the computer). - - fitpt - Order of the fitting curve that will be used as a smooth - representation of the data. This number should be less than or - equal to the number of the data points. Default (blank) is one-half - the number of data points. Maximum number of smoothed data fitting - order is the number of data points up to 50. Depending on this - number, the smoothed curve will be one of the following: - - * ``1`` - Curve is the absolute average of all of the data points. - - * ``2`` - Curve is the least square average of all of the data points. - - * ``3`` or more - Curve is a polynomial of the order (n-1), where n is the number of data fitting - order points. - - vect3 - Name of the vector that contains the smoothed data of the - independent variable. This vector should have a length equal to or - greater than the number of smoothed data points. In batch (command) - mode, you must create this vector before issuing the ``SMOOTH`` - command. In interactive mode, the GUI automatically creates this - vector (if it does not exist). If you do not specify a vector name, - the GUI will name the vector smth_ind. - - vect4 - Name of the vector that contains the smoothed data of the dependent - variable. This vector must be the same length as Vect3. In batch - (command) mode, you must create this vector before issuing the - ``SMOOTH`` command. In interactive mode, the GUI automatically creates - this vector (if it does not exist). If you do not specify a vector - name, the GUI will name the vector smth_dep. - - disp - Specifies how you want to display data. No default; you must - specify an option. - - * ``1`` - Unsmoothed data only - - * ``2`` - Smoothed data only - - * ``3`` - Both smoothed and unsmoothed data - - Notes - ----- - You can control the attributes of the graph using standard ANSYS - controls (``/GRID``, ``/GTHK``, ``/COLOR``, etc.). If working interactively, these - controls appear in this dialog box for convenience, as well as in their - standard dialog boxes. You must always create Vect1 and Vect2 (using - ``*DIM``) and fill these vectors before smoothing the data. If you're - working interactively, ANSYS automatically creates Vect3 and Vect4, but - if you're working in batch (command) mode, you must create Vect3 and - Vect4 (using ``*DIM``) before issuing SMOOTH. Vect3 and Vect4 are then - filled automatically by ANSYS. In addition, ANSYS creates an - additional TABLE type array that contains the smoothed array and the - unsmoothed data to allow for plotting later with ``*VPLOT``. Column 1 in - this table corresponds to Vect1, column 2 to Vect2, and column 3 to - Vect4. This array is named Vect3_SMOOTH, up to a limit of 32 - characters. For example, if the array name is X1, the table name is - X1_SMOOTH. - - This command is also valid in PREP7 and SOLUTION. - """ - command = f"SMOOTH,{vect1},{vect2},{datap},{fitpt},{vect3},{vect4},{disp}" - return self.run(command, **kwargs) - - def vget(self, par="", ir="", tstrt="", kcplx="", **kwargs): - """Moves a variable into an array parameter vector. - - APDL Command: VGET - - Parameters - ---------- - par - Array parameter vector in the operation. - - ir - Reference number of the variable (1 to NV [NUMVAR]). - - tstrt - Time (or frequency) corresponding to start of IR data. If between - values, the nearer value is used. - - kcplx - Complex number key: - - * ``0`` - Use the real part of the IR data. - - * ``1`` - Use the imaginary part of the IR data. - - Notes - ----- - Moves a variable into an array parameter vector. The starting array - element number must be defined. For example, ``VGET,A(1),2`` moves - variable 2 (starting at time 0.0) to array parameter A. Looping - continues from array element ``A(1)`` with the index number incremented by - one until the variable is filled. The number of loops may be - controlled with the ``*VLEN`` command (except that loop skipping (``NINC``) is - not allowed). For multi-dimensioned array parameters, only the first - (row) subscript is incremented. - """ - command = f"VGET,{par},{ir},{tstrt},{kcplx}" - return self.run(command, **kwargs) - - def vput(self, par="", ir="", tstrt="", kcplx="", name="", **kwargs): - """Moves an array parameter vector into a variable. - - APDL Command: VPUT - - Parameters - ---------- - par - Array parameter vector in the operation. - - ir - Arbitrary reference number assigned to this variable (1 to NV - [NUMVAR]). Overwrites any existing results for this variable. - - tstrt - Time (or frequency) corresponding to start of IR data. If between - values, the nearer value is used. - - kcplx - Complex number key: - - * ``0`` - Use the real part of the IR data. - - * ``1`` - Use the imaginary part of the IR data. - - name - Thirty-two character name identifying the item on printouts and - displays. Defaults to the label formed by concatenating VPUT with - the reference number IR. - - Notes - ----- - At least one variable should be defined (``NSOL``, ``ESOL``, ``RFORCE``, etc.) - before using this command. The starting array element number must be - defined. For example,`` VPUT,A(1),2`` moves array parameter A to variable - 2 starting at time 0.0. Looping continues from array element ``A(1)`` with - the index number incremented by one until the variable is filled. - Unfilled variable locations are assigned a zero value. The number of - loops may be controlled with the ``*VLEN`` command (except that loop - skipping (``NINC``) is not allowed). For multi-dimensioned array - parameters, only the first (row) subscript is incremented. - """ - command = f"VPUT,{par},{ir},{tstrt},{kcplx},{name}" - return self.run(command, **kwargs) diff --git a/src/ansys/mapdl/core/_commands/post26_/status.py b/src/ansys/mapdl/core/_commands/post26_/status.py deleted file mode 100644 index fa3b84fc5d..0000000000 --- a/src/ansys/mapdl/core/_commands/post26_/status.py +++ /dev/null @@ -1,99 +0,0 @@ -# Copyright (C) 2016 - 2025 ANSYS, Inc. and/or its affiliates. -# SPDX-License-Identifier: MIT -# -# -# Permission is hereby granted, free of charge, to any person obtaining a copy -# of this software and associated documentation files (the "Software"), to deal -# in the Software without restriction, including without limitation the rights -# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -# copies of the Software, and to permit persons to whom the Software is -# furnished to do so, subject to the following conditions: -# -# The above copyright notice and this permission notice shall be included in all -# copies or substantial portions of the Software. -# -# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -# SOFTWARE. - - -class Status: - def define(self, **kwargs): - """Specifies "Data definition settings" as the subsequent status topic. - - APDL Command: DEFINE - - Notes - ----- - This is a status [STAT] topic command. Status topic commands are - generated by the GUI and will appear in the log file (Jobname.LOG) if - status is requested for some items under Utility Menu> List> Status. - This command will be immediately followed by a STAT command, which will - report the status for the specified topic. - - If entered directly into the program, the STAT command should - immediately follow this command. - """ - command = f"DEFINE," - return self.run(command, **kwargs) - - def operate(self, **kwargs): - """Specifies "Operation data" as the subsequent status topic. - - APDL Command: OPERATE - - Notes - ----- - This is a status [STAT] topic command. Status topic commands are - generated by the GUI and will appear in the log file (Jobname.LOG) if - status is requested for some items under Utility Menu> List> Status. - This command will be immediately followed by a STAT command, which will - report the status for the specified topic. - - If entered directly into the program, the STAT command should - immediately follow this command. - """ - command = f"OPERATE," - return self.run(command, **kwargs) - - def plotting(self, **kwargs): - """Specifies "Plotting settings" as the subsequent status topic. - - APDL Command: PLOTTING - - Notes - ----- - This is a status [STAT] topic command. Status topic commands are - generated by the GUI and will appear in the log file (Jobname.LOG) if - status is requested for some items under Utility Menu> List> Status. - This command will be immediately followed by a STAT command, which will - report the status for the specified topic. - - If entered directly into the program, the STAT command should - immediately follow this command. - """ - command = f"PLOTTING," - return self.run(command, **kwargs) - - def print(self, **kwargs): - """Specifies "Print settings" as the subsequent status topic. - - APDL Command: PRINT - - Notes - ----- - This is a status [STAT] topic command. Status topic commands are - generated by the GUI and will appear in the log file (Jobname.LOG) if - status is requested for some items under Utility Menu> List> Status. - This command will be immediately followed by a STAT command, which will - report the status for the specified topic. - - If entered directly into the program, the STAT command should - immediately follow this command. - """ - command = f"PRINT," - return self.run(command, **kwargs) diff --git a/src/ansys/mapdl/core/commands.py b/src/ansys/mapdl/core/commands.py index 2bf82dd080..81a0ac5474 100644 --- a/src/ansys/mapdl/core/commands.py +++ b/src/ansys/mapdl/core/commands.py @@ -46,7 +46,7 @@ map, misc, post1_, - post26_, + post26, preproc, reduced, session, @@ -451,13 +451,14 @@ class Post1Commands( class Post26Commands( - post26_.controls.Controls, - post26_.display.Display, - post26_.listing.Listing, - post26_.operations.Operations, - post26_.setup.Setup, - post26_.special.Special, - post26_.status.Status, + post26._set_up.SetUp, + post26.controls.Controls, + post26.display.Display, + post26.listing.Listing, + post26.operations.Operations, + post26.set_up.SetUp, + post26.special_purpose.SpecialPurpose, + post26.status.Status, ): pass