diff --git a/doc/changelog.d/4318.added.md b/doc/changelog.d/4318.added.md new file mode 100644 index 00000000000..e321343eb45 --- /dev/null +++ b/doc/changelog.d/4318.added.md @@ -0,0 +1 @@ +\`\`prep7\`\` submodule - part 3 diff --git a/doc/source/mapdl_commands/prep7/index.rst b/doc/source/mapdl_commands/prep7/index.rst index 014fc9fefb6..f83b971f92b 100644 --- a/doc/source/mapdl_commands/prep7/index.rst +++ b/doc/source/mapdl_commands/prep7/index.rst @@ -42,19 +42,27 @@ Prep7 areas booleans meshing + special_purpose database elements + status + piping + primitives cross_sections lines data_tables constraint_equations constraint_equations_ + nodes coupled_dof morphing element_type materials + volumes _status keypoints hard_points artificially_matched_layers + real_constants + superelements explicit_dynamics diff --git a/doc/source/mapdl_commands/prep7/nodes.rst b/doc/source/mapdl_commands/prep7/nodes.rst index 583f78b907f..91d97a7dd57 100644 --- a/doc/source/mapdl_commands/prep7/nodes.rst +++ b/doc/source/mapdl_commands/prep7/nodes.rst @@ -1,36 +1,42 @@ -.. _ref_nodes_commands_api: -***** +.. _ref_nodes: + + Nodes -***** +===== + -.. currentmodule:: ansys.mapdl.core +.. currentmodule:: ansys.mapdl.core._commands.prep7.nodes -These PREP7 commands are used to create, modify, list, etc., nodes. +.. autoclass:: ansys.mapdl.core._commands.prep7.nodes.Nodes .. autosummary:: - :toctree: _autosummary/ - - Mapdl.center - Mapdl.fill - Mapdl.move - Mapdl.n - Mapdl.naxis - Mapdl.nang - Mapdl.ndele - Mapdl.ndist - Mapdl.ngen - Mapdl.nkpt - Mapdl.nlist - Mapdl.nmodif - Mapdl.nora - Mapdl.norl - Mapdl.nread - Mapdl.nrotat - Mapdl.nrrang - Mapdl.nscale - Mapdl.nsmooth - Mapdl.nsym - Mapdl.nwrite - Mapdl.quad - Mapdl.transfer + :template: base.rst + :toctree: _autosummary + + + Nodes.center + Nodes.eextrude + Nodes.fill + Nodes.move + Nodes.n + Nodes.nang + Nodes.naxis + Nodes.ndele + Nodes.ndist + Nodes.ngen + Nodes.nkpt + Nodes.nlist + Nodes.nmodif + Nodes.nora + Nodes.norl + Nodes.nplot + Nodes.nread + Nodes.nrotat + Nodes.nrrang + Nodes.nscale + Nodes.nsmooth + Nodes.nsym + Nodes.nwrite + Nodes.quad + Nodes.transfer diff --git a/doc/source/mapdl_commands/prep7/piping.rst b/doc/source/mapdl_commands/prep7/piping.rst new file mode 100644 index 00000000000..fe486d844d3 --- /dev/null +++ b/doc/source/mapdl_commands/prep7/piping.rst @@ -0,0 +1,37 @@ + +.. _ref_piping: + + +Piping +====== + + +.. currentmodule:: ansys.mapdl.core._commands.prep7.piping + +.. autoclass:: ansys.mapdl.core._commands.prep7.piping.Piping + +.. autosummary:: + :template: base.rst + :toctree: _autosummary + + + Piping.bellow + Piping.bend + Piping.branch + Piping.flange + Piping.miter + Piping.pcorro + Piping.pdrag + Piping.pfluid + Piping.pgap + Piping.pinsul + Piping.popt + Piping.ppres + Piping.pspec + Piping.psprng + Piping.ptemp + Piping.punit + Piping.reduce + Piping.run + Piping.tee + Piping.valve diff --git a/doc/source/mapdl_commands/prep7/primitives.rst b/doc/source/mapdl_commands/prep7/primitives.rst index 73391699a67..d83e5741673 100644 --- a/doc/source/mapdl_commands/prep7/primitives.rst +++ b/doc/source/mapdl_commands/prep7/primitives.rst @@ -1,34 +1,38 @@ -.. _ref_primitives_commands_api: -********** +.. _ref_primitives: + + Primitives -********** +========== + -.. currentmodule:: ansys.mapdl.core +.. currentmodule:: ansys.mapdl.core._commands.prep7.primitives -These PREP7 commands are used to create primitive shapes for modeling. +.. autoclass:: ansys.mapdl.core._commands.prep7.primitives.Primitives .. autosummary:: - :toctree: _autosummary/ - - Mapdl.blc4 - Mapdl.blc5 - Mapdl.block - Mapdl.con4 - Mapdl.cone - Mapdl.cyl4 - Mapdl.cyl5 - Mapdl.cylind - Mapdl.pcirc - Mapdl.poly - Mapdl.pri2 - Mapdl.prism - Mapdl.ptxy - Mapdl.rectng - Mapdl.rpoly - Mapdl.rpr4 - Mapdl.rprism - Mapdl.sph4 - Mapdl.sph5 - Mapdl.sphere - Mapdl.torus + :template: base.rst + :toctree: _autosummary + + + Primitives.blc4 + Primitives.blc5 + Primitives.block + Primitives.con4 + Primitives.cone + Primitives.cyl4 + Primitives.cyl5 + Primitives.cylind + Primitives.pcirc + Primitives.poly + Primitives.pri2 + Primitives.prism + Primitives.ptxy + Primitives.rectng + Primitives.rpoly + Primitives.rpr4 + Primitives.rprism + Primitives.sph4 + Primitives.sph5 + Primitives.sphere + Primitives.torus diff --git a/doc/source/mapdl_commands/prep7/real_constants.rst b/doc/source/mapdl_commands/prep7/real_constants.rst index c74d158dac8..a1335fe27cb 100644 --- a/doc/source/mapdl_commands/prep7/real_constants.rst +++ b/doc/source/mapdl_commands/prep7/real_constants.rst @@ -1,19 +1,23 @@ -.. _ref_real_constants_commands_api: -************** -Real constants -************** +.. _ref_real_constants: -.. currentmodule:: ansys.mapdl.core -These PREP7 commands define the model real constants. +RealConstants +============= + + +.. currentmodule:: ansys.mapdl.core._commands.prep7.real_constants + +.. autoclass:: ansys.mapdl.core._commands.prep7.real_constants.RealConstants .. autosummary:: - :toctree: _autosummary/ - - Mapdl.r - Mapdl.rdele - Mapdl.rlist - Mapdl.rmodif - Mapdl.rmore - Mapdl.setfgap + :template: base.rst + :toctree: _autosummary + + + RealConstants.r + RealConstants.rdele + RealConstants.rlist + RealConstants.rmodif + RealConstants.rmore + RealConstants.setfgap diff --git a/doc/source/mapdl_commands/prep7/sections.rst b/doc/source/mapdl_commands/prep7/sections.rst deleted file mode 100644 index 0770d725b85..00000000000 --- a/doc/source/mapdl_commands/prep7/sections.rst +++ /dev/null @@ -1,50 +0,0 @@ -.. _ref_Sections_commands_api: - -******** -Sections -******** - -.. currentmodule:: ansys.mapdl.core - -These PREP7 commands manage sections. - -.. autosummary:: - :toctree: _autosummary/ - - Mapdl.bsax - Mapdl.bsm1 - Mapdl.bsm2 - Mapdl.bsmd - Mapdl.bss1 - Mapdl.bss2 - Mapdl.bste - Mapdl.bstq - Mapdl.cbmd - Mapdl.cbmx - Mapdl.cbte - Mapdl.cbtmp - Mapdl.sdelete - Mapdl.seccontrol - Mapdl.secdata - Mapdl.secmodif - Mapdl.secfunction - Mapdl.secjoint - Mapdl.seclib - Mapdl.seclock - Mapdl.secnum - Mapdl.secoffset - Mapdl.secplot - Mapdl.secread - Mapdl.secstop - Mapdl.sectype - Mapdl.secwrite - Mapdl.sflex - Mapdl.slist - Mapdl.sload - Mapdl.ssbt - Mapdl.ssmt - Mapdl.sspa - Mapdl.sspb - Mapdl.sspd - Mapdl.sspe - Mapdl.sspm diff --git a/doc/source/mapdl_commands/prep7/special_purpose.rst b/doc/source/mapdl_commands/prep7/special_purpose.rst index c50d112e5d0..ed3d43f3e85 100644 --- a/doc/source/mapdl_commands/prep7/special_purpose.rst +++ b/doc/source/mapdl_commands/prep7/special_purpose.rst @@ -1,28 +1,34 @@ -.. _ref_special_purpose_commands_api: -*************** -Special purpose -*************** +.. _ref_special_purpose: -.. currentmodule:: ansys.mapdl.core -These PREP7 commands are used for special-purpose operations. +SpecialPurpose +============== + + +.. currentmodule:: ansys.mapdl.core._commands.prep7.special_purpose + +.. autoclass:: ansys.mapdl.core._commands.prep7.special_purpose.SpecialPurpose .. autosummary:: - :toctree: _autosummary/ - - Mapdl.aerocoeff - Mapdl.cint - Mapdl.cycexpand - Mapdl.cycfreq - Mapdl.cyclic - Mapdl.cycopt - Mapdl.emsym - Mapdl.mstole - Mapdl.perbc2d - Mapdl.physics - Mapdl.race - Mapdl.sstate - Mapdl.xfdata - Mapdl.xfenrich - Mapdl.xflist + :template: base.rst + :toctree: _autosummary + + + SpecialPurpose.adpci + SpecialPurpose.aerocoeff + SpecialPurpose.cint + SpecialPurpose.cycexpand + SpecialPurpose.cycfreq + SpecialPurpose.cyclic + SpecialPurpose.cycopt + SpecialPurpose.emsym + SpecialPurpose.msopt + SpecialPurpose.mstole + SpecialPurpose.perbc2d + SpecialPurpose.race + SpecialPurpose.sstate + SpecialPurpose.xfcrkmesh + SpecialPurpose.xfdata + SpecialPurpose.xfenrich + SpecialPurpose.xflist diff --git a/doc/source/mapdl_commands/prep7/status.rst b/doc/source/mapdl_commands/prep7/status.rst index 263e1342632..0aca571d0bc 100644 --- a/doc/source/mapdl_commands/prep7/status.rst +++ b/doc/source/mapdl_commands/prep7/status.rst @@ -1,34 +1,39 @@ -.. _ref_status_commands_api: -****** +.. _ref_status: + + Status -****** +====== + -.. currentmodule:: ansys.mapdl.core +.. currentmodule:: ansys.mapdl.core._commands.prep7.status -These PREP7 commands are for use with the STAT command. +.. autoclass:: ansys.mapdl.core._commands.prep7.status.Status .. autosummary:: - :toctree: _autosummary/ - - Mapdl.areas - Mapdl.bool - Mapdl.ceqn - Mapdl.couple - Mapdl.digit - Mapdl.elem - Mapdl.etype - Mapdl.febody - Mapdl.fecons - Mapdl.fefor - Mapdl.fesurf - Mapdl.geometry - Mapdl.keypts - Mapdl.line - Mapdl.mater - Mapdl.nodes - Mapdl.prim - Mapdl.rcon - Mapdl.selm - Mapdl.tble - Mapdl.volumes + :template: base.rst + :toctree: _autosummary + + + Status.areas + Status.bool + Status.ceqn + Status.couple + Status.elem + Status.etype + Status.febody + Status.fecons + Status.fefor + Status.fesurf + Status.geometry + Status.keypts + Status.line + Status.mater + Status.meshing + Status.nodes + Status.pipe + Status.prim + Status.rcon + Status.selm + Status.tble + Status.volumes diff --git a/doc/source/mapdl_commands/prep7/superelements.rst b/doc/source/mapdl_commands/prep7/superelements.rst index 94382af64eb..734593bf8ae 100644 --- a/doc/source/mapdl_commands/prep7/superelements.rst +++ b/doc/source/mapdl_commands/prep7/superelements.rst @@ -1,18 +1,22 @@ -.. _ref_superelements_commands_api: -************* +.. _ref_superelements: + + Superelements -************* +============= -.. currentmodule:: ansys.mapdl.core -These PREP7 commands are used to create and modify superelements. +.. currentmodule:: ansys.mapdl.core._commands.prep7.superelements + +.. autoclass:: ansys.mapdl.core._commands.prep7.superelements.Superelements .. autosummary:: - :toctree: _autosummary/ + :template: base.rst + :toctree: _autosummary + - Mapdl.se - Mapdl.sedlist - Mapdl.selist - Mapdl.sesymm - Mapdl.setran + Superelements.se + Superelements.sedlist + Superelements.selist + Superelements.sesymm + Superelements.setran diff --git a/doc/source/mapdl_commands/prep7/volumes.rst b/doc/source/mapdl_commands/prep7/volumes.rst index 6c90e53a15d..7de4b794ed3 100644 --- a/doc/source/mapdl_commands/prep7/volumes.rst +++ b/doc/source/mapdl_commands/prep7/volumes.rst @@ -1,28 +1,33 @@ -.. _ref_volumes_commands_api: -******* +.. _ref_volumes: + + Volumes -******* +======= + -.. currentmodule:: ansys.mapdl.core +.. currentmodule:: ansys.mapdl.core._commands.prep7.volumes -These PREP7 commands are used to create, modify, list, etc., volumes. +.. autoclass:: ansys.mapdl.core._commands.prep7.volumes.Volumes .. autosummary:: - :toctree: _autosummary/ - - Mapdl.extopt - Mapdl.v - Mapdl.va - Mapdl.vdele - Mapdl.vdgl - Mapdl.vdrag - Mapdl.vext - Mapdl.vgen - Mapdl.vlist - Mapdl.vlscale - Mapdl.voffst - Mapdl.vrotat - Mapdl.vsum - Mapdl.vsymm - Mapdl.vtran + :template: base.rst + :toctree: _autosummary + + + Volumes.extopt + Volumes.v + Volumes.va + Volumes.vdele + Volumes.vdgl + Volumes.vdrag + Volumes.vext + Volumes.vgen + Volumes.vlist + Volumes.vlscale + Volumes.voffst + Volumes.vplot + Volumes.vrotat + Volumes.vsum + Volumes.vsymm + Volumes.vtran diff --git a/src/ansys/mapdl/core/_commands/prep7/__init__.py b/src/ansys/mapdl/core/_commands/prep7/__init__.py index 2647109d921..efb5411099e 100644 --- a/src/ansys/mapdl/core/_commands/prep7/__init__.py +++ b/src/ansys/mapdl/core/_commands/prep7/__init__.py @@ -40,4 +40,12 @@ materials, meshing, morphing, + nodes, + piping, + primitives, + real_constants, + special_purpose, + status, + superelements, + volumes, ) diff --git a/src/ansys/mapdl/core/_commands/prep7/keypoints.py b/src/ansys/mapdl/core/_commands/prep7/keypoints.py index 8a06afdab88..d53e061d350 100644 --- a/src/ansys/mapdl/core/_commands/prep7/keypoints.py +++ b/src/ansys/mapdl/core/_commands/prep7/keypoints.py @@ -238,10 +238,7 @@ def kcenter( three locations on a line. Note that for method c, if a circular line is specified by ``VAL1``, ``VAL2`` through ``VAL4`` are not needed. - .. only:: html - - .. figure:: ../../../images/_commands/gKCEN1.svg - + .. figure:: ../../../images/_commands/gKCEN1.svg Examples -------- diff --git a/src/ansys/mapdl/core/_commands/prep7/nodes.py b/src/ansys/mapdl/core/_commands/prep7/nodes.py new file mode 100644 index 00000000000..b144e428e66 --- /dev/null +++ b/src/ansys/mapdl/core/_commands/prep7/nodes.py @@ -0,0 +1,1516 @@ +# 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 ansys.mapdl.core._commands import parse + + +class Nodes: + + def center( + self, + node: str = "", + node1: str = "", + node2: str = "", + node3: str = "", + radius: int | str = "", + **kwargs, + ): + r"""Defines a node at the center of curvature of 2 or 3 nodes. + + Mechanical APDL Command: `CENTER `_ + + Parameters + ---------- + node : str + Number to be assigned to the node generated at the center of curvature. + + node1 : str + Three nodes used to calculated the center of curvature, as described under ``RADIUS``. + + node2 : str + Three nodes used to calculated the center of curvature, as described under ``RADIUS``. + + node3 : str + Three nodes used to calculated the center of curvature, as described under ``RADIUS``. + + radius : int or str + Used to control the interpretation of ``NODE1``, ``NODE2`` and ``NODE3`` : + + * ``0`` - ``NODE1``, ``NODE2`` and ``NODE3`` lie on a circular arc. The program will calculate the + center of curvature (and radius) (default). + + * ``≠, 0`` - ``NODE1`` and ``NODE2`` are the endpoints of an arc, and ``RADIUS`` is the + radius of curvature. The program will locate the center of curvature on the ``NODE3`` side of the + ``NODE1`` - ``NODE2`` line if ``RADIUS`` > 0, and opposite to ``NODE3`` if ``RADIUS`` < 0. + + """ + command = f"CENTER,{node},{node1},{node2},{node3},{radius}" + return self.run(command, **kwargs) + + def eextrude( + self, + action: str = "", + nelem: str = "", + space: str = "", + dist: str = "", + theta: str = "", + tfact: str = "", + bckey: str = "", + **kwargs, + ): + r"""Extrudes 2D plane elements into 3D solids during a 2D to 3D analysis. + + Mechanical APDL Command: `EEXTRUDE `_ + + Parameters + ---------- + action : str + Specifies one of the following command behaviors: + + * ``AUTO`` - Extrudes plane elements ( ``PLANE182`` and ``PLANE183`` ) `Notes + `_ based on the + KEYOPT(3) setting. Complementary elements are also extruded. (See `Notes + `_ Notes for + more information.) This behavior is the default. + + * ``PLANE`` - Extrudes elements in the global Z direction. KEYOPT(3) of the parent plane elements is + ignored. + + * ``AXIS`` - Extrudes elements about the global Y axis. KEYOPT(3) of the parent plane elements is + ignored. + + * ``TANGENT`` - Extrudes plane and contact elements about the global Y axis. Target elements are + extruded in the global Z direction. + + * ``TIRE`` - Extrudes plane and contact elements about the global Y axis in a 360-degree span. + Target elements are extruded in the global Z direction if outside the plane elements. Mesh + refinement is adapted specifically for tire analysis. + + See :ref:`actionbehavior`. + + nelem : str + Number of elements to generate in the extruded direction. If you do not specify a number, the + program calculates a number automatically based on the average element size and extrusion + distance. + + space : str + Spacing ratio. If positive, this value is the nominal ratio of the last division size to the + first division size (if > 1.0, sizes increase, if < 1.0, sizes decrease). If negative, \|SPACE\| + is the nominal ratio of the center division size to the end division size. Default = 1.0 + (uniform spacing). + + dist : str + Distance to extrude in the global Z direction for the plane strain case ( ``Action`` = PLANE). + The default is 1. + + theta : str + Angle (in degrees) depending on ``Action`` : + + * ``Action`` = AXIS - Ending angle to extrude about the global Y axis for the axisymmetric case. + Default = 360. (The beginning angle is always 0 degrees.) + * ``Action`` = TIRE - Span of the contact patch for mesh refinement. The program generates an abrupt + mesh transition from fine to coarse. Default = 0. + + tfact : str + Factor for increasing the rigid target size. The size of the extruded rigid target elements is + determined automatically based on the size of the contact elements. Default = 0.2. + + bckey : str + Controls the nodal orientation in the third direction and boundary-condition mapping ( ``Action`` = AXIS or TIRE only): + + * ``0`` - All nodes are rotated to a local Cartesian coordinate system where X is the radial, Y + axial and Z circumferential direction. All loads and displacements are mapped from the 2D model to + the 3D model in the local coordinate system. + + If applying rotation ROTY in axisymmetric cases with torsion on the 2D model, this value sets UZ = 0 + at all corresponding 3D nodes. + + This value is the default. + + * ``1`` - Only nodes with applied loads and/or displacements are rotated to a local Cartesian + coordinate system where X is the radial, Y axial and Z circumferential direction. All loads are + mapped to the 3D model and all applied displacements are reset to zero. + + See :ref:`bckeybehavior`. + + Notes + ----- + + .. _EEXTRUDE_notes: + + The :ref:`eextrude` command extrudes elements ``PLANE182`` and ``PLANE183``. Complementary elements + ``TARGE169``, ``CONTA172``, and ``REINF263`` also extrude. Extrusion operates automatically on + elements in the selected element set. + + ``Action`` = TIRE determines if target elements are in the middle (rim) part of the model or on the + outside (road) part. The middle elements extrude axisymmetrically about the Y axis, and the outside + elements extrude in the Z direction. + + Example Command Actions + If interference exists between road and tire, the command extrudes outside elements within the + specified tolerance ( :ref:`seltol` ) in the global Z direction. For more information, see `2D to 3D + analysis + `_. + + The ``BCKEY`` value is valid only within the 2D to 3D analysis environment (that is, after issuing + :ref:`map2dto3d`,START and before issuing :ref:`map2dto3d`,FINISH). + + Use the default ``BCKEY`` = 0 setting if you intend to apply minimal new loads or constraints during + the 3D analysis phase; otherwise, set ``BCKEY`` = 1. + + For more information, including how boundary conditions and loads are mapped from the 2D model to + the 3D model, see `2D to 3D Analysis + `_ + + Boundary Condition Key Behavior + This command is valid in the PREP7 ( :ref:`prep7` ) and SOLUTION ( :ref:`slashsolu` ) processors. + Some options are valid within the 2D to 3D analysis environment only (between :ref:`map2dto3d` + ,START and :ref:`map2dto3d`,FINISH). + + For automatic ``PLANE182`` and ``PLANE183`` extrusion ( ``Action`` = AUTO), based on the element + behavior of the plane elements, the command performs as follows: + + * ``KEYOPT(3) = 0`` - Plane stress; the element is ignored. + + * ``KEYOPT(3) = 1`` - Axisymmetric; the element is extruded 360 degrees about the Y-axis. ``THETA`` + is ignored. + + * ``KEYOPT(3) = 2`` - Plane strain (Z strain = 0.0); the element is extruded a unit distance in the + global Z direction. + + * ``KEYOPT(3) = 3`` - Plane stress with thickness input; the element is extruded in the Z-direction + as specified by the thickness input via a real constant. + + * ``KEYOPT(3) = 5`` - Generalized plane strain; the element is ignored. + + * ``KEYOPT(3) = 6`` - Axisymmetric with torsion; the element is extruded 360 degrees about the + Y-axis. ``THETA`` is ignored. + + For an axisymmetric extrusion ( ``Action`` = AUTO with KEYOPT(3) = 1, ``Action`` = AXIS, or + ``Action`` = TANGENT), the command merges any nodes within the specified tolerance ( :ref:`seltol`, + ``TOLER`` ) of the axis into a single node, then forms degenerate tetrahedrons, pyramids, or wedges. + The default tolerance value is 1.0E-6. + + For an axisymmetric extrusion, ``SHELL208`` and ``SHELL209`` will extrude. + + You can control shape-checking options via the :ref:`shpp` command. + + The extrusion behavior of accompanying contact ( ``CONTA172`` ) is determined by the plane element + settings. Rigid target ( ``TARGE169`` ) elements are extruded in the global Z direction unless + axisymmetric extrusion ( ``Action`` = AXIS or ``Action`` = TIRE) is in effect. + + Within the 2D to 3D analysis environment (between :ref:`map2dto3d`,START and + :ref:`map2dto3d`,FINISH), ``PLANE182``, ``PLANE183``, and associated contact/target/reinforcing + elements are supported for the axisymmetric (with or without torsion) and plane-strain options only. + For ``REINF263`` reinforcing elements, if the fibers have an orientation angle that causes torsion + in an axisymmetric analysis, use the axsiymmetrixc-with-torsion option (KEYOPT(3) = 6) for the base + elements. For more information, see `2D to 3D Analysis Requirements and Limitations + `_ + + The following table shows each 2D element capable of extrusion and its corresponding post-extrusion + 3D element: + + This command contains some tables and extra information which can be inspected in the original + documentation pointed above. + + All element properties are also transferred consistently during extrusion. For example, a + :math:`equation not available` 2D element is extruded to a :math:`equation not available` 3D + element, and a mixed u-P 2D element is extruded to a mixed u-P 3D element. Element and node + components are passed over the 3D elements and extruded nodes. + """ + command = f"EEXTRUDE,{action},{nelem},{space},{dist},{theta},{tfact},,{bckey}" + return self.run(command, **kwargs) + + def fill( + self, + node1: str = "", + node2: str = "", + nfill: str = "", + nstrt: str = "", + ninc: str = "", + itime: str = "", + inc: str = "", + space: str = "", + **kwargs, + ): + r"""Generates a line of nodes between two existing nodes. + + Mechanical APDL Command: `FILL `_ + + Parameters + ---------- + node1 : str + Beginning and ending nodes for fill-in. ``NODE1`` defaults to next to last node specified, + ``NODE2`` defaults to last node specified. If ``NODE1`` = P, graphical picking is enabled and + all remaining command fields are ignored (valid only in the GUI). + + node2 : str + Beginning and ending nodes for fill-in. ``NODE1`` defaults to next to last node specified, + ``NODE2`` defaults to last node specified. If ``NODE1`` = P, graphical picking is enabled and + all remaining command fields are ignored (valid only in the GUI). + + nfill : str + Fill ``NFILL`` nodes between ``NODE1`` and ``NODE2`` (defaults to \| ``NODE2`` - ``NODE1`` \|-1). + ``NFILL`` must be positive. + + nstrt : str + Node number assigned to first filled-in node (defaults to ``NODE1`` + ``NINC`` ). + + ninc : str + Add this increment to each of the remaining filled-in node numbers (may be positive or + negative). Defaults to the integer result of ( ``NODE2`` - ``NODE1`` )/( ``NFILL`` + 1), that + is, linear interpolation. If the default evaluates to zero, or if zero is input, ``NINC`` is set + to 1. + + itime : str + Do fill-in operation a total of ``ITIMEs``, incrementing ``NODE1``, ``NODE2`` and ``NSTRT`` by + ``INC`` each time after the first. ``ITIME`` and ``INC`` both default to 1. + + inc : str + Do fill-in operation a total of ``ITIMEs``, incrementing ``NODE1``, ``NODE2`` and ``NSTRT`` by + ``INC`` each time after the first. ``ITIME`` and ``INC`` both default to 1. + + space : str + Spacing ratio. Ratio of last division size to first division size. If > 1.0, divisions increase. + If < 1.0, divisions decrease. Ratio defaults to 1.0 (uniform spacing). + + Notes + ----- + + .. _FILL_notes: + + Generates a line of nodes (in the active coordinate system) between two existing nodes. The two + nodes may have been defined in any coordinate system. Nodal locations and rotation angles are + determined by interpolation. Any number of nodes may be filled-in and any node number sequence may + be assigned. See the :ref:`cscir` command when filling across the 180° singularity line in a non- + Cartesian system. + """ + command = f"FILL,{node1},{node2},{nfill},{nstrt},{ninc},{itime},{inc},{space}" + return self.run(command, **kwargs) + + def move( + self, + node: str = "", + kc1: str = "", + x1: str = "", + y1: str = "", + z1: str = "", + kc2: str = "", + x2: str = "", + y2: str = "", + z2: str = "", + **kwargs, + ): + r"""Calculates and moves a node to an intersection. + + Mechanical APDL Command: `MOVE `_ + + Parameters + ---------- + node : str + Move this node. If ``NODE`` = P, graphical picking is enabled and all remaining command fields + are ignored (valid only in the GUI). A component name may also be substituted for ``NODE``. + + kc1 : str + First coordinate system number. Defaults to 0 (global Cartesian). + + x1 : str + Input one or two values defining the location of the node in this coordinate system. Input "U" + for unknown value(s) to be calculated and input "E" to use an existing coordinate value. Fields + are R1, θ1, Z1 for cylindrical, or R1, θ1, Φ1 for spherical or toroidal. + + y1 : str + Input one or two values defining the location of the node in this coordinate system. Input "U" + for unknown value(s) to be calculated and input "E" to use an existing coordinate value. Fields + are R1, θ1, Z1 for cylindrical, or R1, θ1, Φ1 for spherical or toroidal. + + z1 : str + Input one or two values defining the location of the node in this coordinate system. Input "U" + for unknown value(s) to be calculated and input "E" to use an existing coordinate value. Fields + are R1, θ1, Z1 for cylindrical, or R1, θ1, Φ1 for spherical or toroidal. + + kc2 : str + Second coordinate system number. + + x2 : str + Input two or one value(s) defining the location of the node in this coordinate system. Input "U" + for unknown value(s) to be calculated and input "E" to use an existing coordinate value. Fields + are R2, θ2, Z2 for cylindrical, or R2, θ2, Φ2 for spherical or toroidal. + + y2 : str + Input two or one value(s) defining the location of the node in this coordinate system. Input "U" + for unknown value(s) to be calculated and input "E" to use an existing coordinate value. Fields + are R2, θ2, Z2 for cylindrical, or R2, θ2, Φ2 for spherical or toroidal. + + z2 : str + Input two or one value(s) defining the location of the node in this coordinate system. Input "U" + for unknown value(s) to be calculated and input "E" to use an existing coordinate value. Fields + are R2, θ2, Z2 for cylindrical, or R2, θ2, Φ2 for spherical or toroidal. + + Notes + ----- + + .. _MOVE_notes: + + Calculates and moves a node to an intersection location. The node may have been previously defined + (at an approximate location) or left undefined (in which case it is internally defined at the + :ref:`source` location). The actual location is calculated from the intersection of three surfaces + (implied from three coordinate constants in two different coordinate systems). The three (of six) + constants easiest to define should be used. The program will calculate the remaining three + coordinate constants. All arguments, except ``KC1``, must be input. Use the repeat command ( + ``*REPEAT`` ) after the :ref:`move` command to define a line of intersection by repeating the move + operation on all nodes of the line. + + Surfaces of constant value are implied by some commands by specifying a single coordinate value. + Implied surfaces are used with various commands ( :ref:`move`, :ref:`kmove`, :ref:`nsel`, etc.). + Three surfaces are available with each of the four coordinate system types. Values or X, Y, or Z may + be constant for the Cartesian coordinate system; values of R, θ, or Z for the cylindrical + system; and values of R, θ, Φ for the spherical and toroidal systems. For example, an X value + of 3 represents the Y-Z plane (or surface) at X=3. In addition, the parameters for the cylindrical + and spherical coordinate systems may be adjusted ( :ref:`cs`, :ref:`local` ) to form elliptical + surfaces. For surfaces in elliptical coordinate systems, a surface of "constant" radius is defined + by the radius value at the X-axis. Surfaces of constant value may be located in local coordinate + systems ( :ref:`local`, :ref:`clocal`, :ref:`cs`, or :ref:`cskp` ) to allow for any orientation. + + The intersection calculation is based on an iterative procedure (250 iterations maximum) and a + tolerance of 1.0E-4. The approximate location of a node should be sufficient to determine a unique + intersection if more than one intersection point is possible. Tangent "intersections" should be + avoided. If an intersection is not found, the node is placed at the last iteration location. + + This command is also valid in the :ref:`slashmap` processor. + """ + command = f"MOVE,{node},{kc1},{x1},{y1},{z1},{kc2},{x2},{y2},{z2}" + return self.run(command, **kwargs) + + def n( + self, + node: str = "", + x: str = "", + y: str = "", + z: str = "", + thxy: str = "", + thyz: str = "", + thzx: str = "", + **kwargs, + ): + r"""Defines a node. + + Mechanical APDL Command: `N `_ + + Parameters + ---------- + node : str + Node number to be assigned. A previously defined node of the same number will be redefined. + Defaults to the maximum node number used +1. + + x : str + Node location in the active coordinate system (R, θ, Z for cylindrical, R, θ, Φ for spherical or + toroidal). If ``X`` = P, graphical picking is enabled and all remaining command fields are + ignored (valid only in the GUI). + + y : str + Node location in the active coordinate system (R, θ, Z for cylindrical, R, θ, Φ for spherical or + toroidal). If ``X`` = P, graphical picking is enabled and all remaining command fields are + ignored (valid only in the GUI). + + z : str + Node location in the active coordinate system (R, θ, Z for cylindrical, R, θ, Φ for spherical or + toroidal). If ``X`` = P, graphical picking is enabled and all remaining command fields are + ignored (valid only in the GUI). + + thxy : str + First rotation about nodal Z (positive X toward Y). + + thyz : str + Second rotation about nodal X (positive Y toward Z). + + thzx : str + Third rotation about nodal Y (positive Z toward X). + + Returns + ------- + int + Node number of the generated node. + + Notes + ----- + + .. _N_notes: + + Defines a node in the active coordinate system ( :ref:`csys` ). The nodal coordinate system is + parallel to the global Cartesian system unless rotated. Rotation angles are in degrees and redefine + any previous rotation angles. See the :ref:`nmodif`, :ref:`nang`, :ref:`nrotat`, and :ref:`nora` + commands for other rotation options. + + Examples + -------- + Create a node at ``(0, 1, 1)`` + + >>> nnum = mapdl.n("", 0, 1, 1) + >>> nnum + 1 + + Create a node at ``(4, 5, 1)`` with a node ID of 10 + + >>> nnum = mapdl.n(10, 4, 5, 1) + >>> nnum + 10 + """ + command = f"N,{node},{x},{y},{z},{thxy},{thyz},{thzx}" + return parse.parse_n(self.run(command, **kwargs)) + + def nang( + self, + node: str = "", + x1: str = "", + x2: str = "", + x3: str = "", + y1: str = "", + y2: str = "", + y3: str = "", + z1: str = "", + z2: str = "", + z3: str = "", + **kwargs, + ): + r"""Rotates a nodal coordinate system by direction cosines. + + Mechanical APDL Command: `NANG `_ + + Parameters + ---------- + node : str + Rotate coordinate system of this node. + + x1 : str + Global X, Y, Z components of a unit vector in new nodal X direction. + + x2 : str + Global X, Y, Z components of a unit vector in new nodal X direction. + + x3 : str + Global X, Y, Z components of a unit vector in new nodal X direction. + + y1 : str + Global X, Y, Z components of a unit vector in new nodal Y direction. + + y2 : str + Global X, Y, Z components of a unit vector in new nodal Y direction. + + y3 : str + Global X, Y, Z components of a unit vector in new nodal Y direction. + + z1 : str + Global X, Y, Z components of a unit vector in new nodal Z direction. + + z2 : str + Global X, Y, Z components of a unit vector in new nodal Z direction. + + z3 : str + Global X, Y, Z components of a unit vector in new nodal Z direction. + + Notes + ----- + + .. _NANG_notes: + + Rotates a nodal coordinate system to the orientation specified by the X, Y and Z direction cosines. + Existing rotation specifications on the node are redefined. If only two of the three unit vectors + are specified, the third is defined according to the right hand rule. It is the responsibility of + the user to ensure that input direction cosines are orthogonal in a right-handed system. + + See the :ref:`nmodif`, :ref:`nrotat`, and :ref:`nora` commands for other rotation options. + """ + command = f"NANG,{node},{x1},{x2},{x3},{y1},{y2},{y3},{z1},{z2},{z3}" + return self.run(command, **kwargs) + + def naxis(self, action: str = "", val: str = "", **kwargs): + r"""Generates nodes for general axisymmetric element sections. + + Mechanical APDL Command: `NAXIS `_ + + Parameters + ---------- + action : str + Specifies one of the following command behaviors: + + * ``GEN`` - Generates nodes around the axis of an axisymmetric section (default). + + * ``CLEAR`` - Clears all nodes around the axis of an axisymmetric section. + + * ``EFACET`` - Specifies the number of facets per edge between nodal planes and integration planes + in the circumferential direction to display using PowerGraphics. This option is only valid with + :ref:`eshape`,1 and :ref:`rsys`,SOLU commands. + + val : str + Tolerance value or number of facets per edge: + + * ``TOLER`` - When ``Action`` = GEN, the tolerance to use for merging the generated nodes around the + axis. + + * ``NUM`` - When ``Action`` = EFACET, the number of facets per element edge for element plots: + + * ``AUTO`` - Use program-chosen facets per edge (default). + + * ``1`` - Use 1 facet per edge (default for elements with 9, 10, 11, or 12 nodal planes). Shows + nodal and integration planes only. + + * ``2`` - Use 2 facets per edge (default for elements with 5, 6, 7, or 8 nodal planes, and maximum + for elements with 9, 10, 11, or 12 nodal planes). + + * ``3`` - Use 3 facets per edge (default for elements with 3 or 4 nodal planes, and maximum for + elements with 6, 7, or 8 nodal planes). + + * ``4`` - Use 4 facets per edge (maximum for elements with 5 nodal planes). + + * ``5`` - Use 5 facets per edge (maximum for elements with 4 nodal planes). + + * ``6`` - Use 6 facets per edge (maximum for elements with 3 nodal planes). + + Notes + ----- + + .. _NAXIS_notes: + + The :ref:`naxis` command generates or clears the nodes for general axisymmetric element sections. + The command applies to elements ``SURF159``, ``SOLID272``, and ``SOLID273``. + + The generate option ( ``Action`` = GEN) operates automatically on any current-technology + axisymmetric element. Any nodes within the tolerance value ( ``TOLER`` ) of the axis are merged into + a single node. The default tolerance is 1.0e-4. + + If you want to change the number of nodes, use the clear option ( ``Action`` = CLEAR) before + regenerating the nodes. + + To cause the 3D element plot to appear more like the actual 3D model, use :ref:`naxis`,EFACET, + ``NUM``, where ``NUM`` > 1. In this case, the coordinate system specified for displaying element and + nodal results (RSYS) must be solution ( :ref:`rsys`,SOLU); otherwise, Ansys resets + ``NUM`` to 1. + """ + command = f"NAXIS,{action},{val}" + return self.run(command, **kwargs) + + def ndele(self, node1: str = "", node2: str = "", ninc: str = "", **kwargs): + r"""Deletes nodes. + + Mechanical APDL Command: `NDELE `_ + + Parameters + ---------- + node1 : str + Delete nodes from ``NODE1`` to ``NODE2`` (defaults to ``NODE1`` ) in steps of ``NINC`` (defaults + to 1). If ``NODE1`` = ALL, ``NODE2`` and ``NINC`` are ignored and all selected nodes ( + :ref:`nsel` ) are deleted. If ``NODE1`` = P, graphical picking is enabled and all remaining + command fields are ignored (valid only in the GUI). A component name may also be substituted for + ``NODE1``. + + node2 : str + Delete nodes from ``NODE1`` to ``NODE2`` (defaults to ``NODE1`` ) in steps of ``NINC`` (defaults + to 1). If ``NODE1`` = ALL, ``NODE2`` and ``NINC`` are ignored and all selected nodes ( + :ref:`nsel` ) are deleted. If ``NODE1`` = P, graphical picking is enabled and all remaining + command fields are ignored (valid only in the GUI). A component name may also be substituted for + ``NODE1``. + + ninc : str + Delete nodes from ``NODE1`` to ``NODE2`` (defaults to ``NODE1`` ) in steps of ``NINC`` (defaults + to 1). If ``NODE1`` = ALL, ``NODE2`` and ``NINC`` are ignored and all selected nodes ( + :ref:`nsel` ) are deleted. If ``NODE1`` = P, graphical picking is enabled and all remaining + command fields are ignored (valid only in the GUI). A component name may also be substituted for + ``NODE1``. + + Notes + ----- + + .. _NDELE_notes: + + Deletes selected nodes that are not connected to elements. Nodes may also be redefined instead of + deleted, if desired. Boundary conditions (displacements, forces, etc.) as well as any coupling or + constraint equations containing the deleted nodes are also deleted. + + This command is also valid in the :ref:`slashmap` processor. + """ + command = f"NDELE,{node1},{node2},{ninc}" + return self.run(command, **kwargs) + + def ndist(self, nd1: str = "", nd2: str = "", **kwargs): + r"""Calculates and lists the distance between two nodes. + + Mechanical APDL Command: `NDIST `_ + + Parameters + ---------- + nd1 : str + First node in distance calculation. If ``ND1`` = P, graphical picking is enabled and all + remaining command fields are ignored (valid only in the GUI). + + nd2 : str + Second node in distance calculation. + + Returns + ------- + list + ``[DIST, X, Y, Z]`` distance between two nodes. + + Notes + ----- + + .. _NDIST_notes: + + :ref:`ndist` lists the distance between nodes ``ND1`` and ``ND2``, as well as the current coordinate + system offsets from ``ND1`` to ``ND2``, where the X, Y, and Z locations of ``ND1`` are subtracted + from the X, Y, and Z locations of ``ND2`` (respectively) to determine the offsets. :ref:`ndist` is + valid in any coordinate system except toroidal ( :ref:`csys`,3). + + :ref:`ndist` returns a variable, called " ``_RETURN``," which contains the distance value. You can + use this value for various purposes, such as the calculation of distributed loads. In interactive + mode, you can access this command by using the Model Query Picker ( Utility Menu> List> Picked + Entities ), where you can also access automatic annotation functions and display the value on your + model. + + This command is valid in any processor. + + Examples + -------- + Compute the distance between two nodes. + + >>> node1 = (0, 8, -3) + >>> node2 = (13, 5, 7) + >>> node_num1 = mapdl.n("", *node1) + >>> node_num2 = mapdl.n("", *node2) + >>> node_dist = mapdl.ndist(node_num1, node_num2) + >>> node_dist + [16.673332000533065, 13.0, -3.0, 10.0] + """ + return parse.parse_ndist(self.run(f"NDIST,{nd1},{nd2}", **kwargs)) + + def ngen( + self, + itime: str = "", + inc: str = "", + node1: str = "", + node2: str = "", + ninc: str = "", + dx: str = "", + dy: str = "", + dz: str = "", + space: str = "", + **kwargs, + ): + r"""Generates additional nodes from a pattern of nodes. + + Mechanical APDL Command: `NGEN `_ + + Parameters + ---------- + itime : str + Do this generation operation a total of ``ITIME`` times, incrementing all nodes in the given + pattern by ``INC`` each time after the first. ``ITIME`` must be > 1 for generation to occur. + + inc : str + Do this generation operation a total of ``ITIME`` times, incrementing all nodes in the given + pattern by ``INC`` each time after the first. ``ITIME`` must be > 1 for generation to occur. + + node1 : str + Generate nodes from the pattern of nodes beginning with ``NODE1`` to ``NODE2`` (defaults to + ``NODE1`` ) in steps of ``NINC`` (defaults to 1). If ``NODE1`` = ALL, ``NODE2`` and ``NINC`` are + ignored and the pattern is all selected nodes ( :ref:`nsel` ). If ``NODE1`` = P, graphical + picking is enabled and all remaining command fields are ignored (valid only in the GUI). A + component name may also be substituted for ``NODE1`` ( ``NODE2`` and ``NINC`` are ignored). + + node2 : str + Generate nodes from the pattern of nodes beginning with ``NODE1`` to ``NODE2`` (defaults to + ``NODE1`` ) in steps of ``NINC`` (defaults to 1). If ``NODE1`` = ALL, ``NODE2`` and ``NINC`` are + ignored and the pattern is all selected nodes ( :ref:`nsel` ). If ``NODE1`` = P, graphical + picking is enabled and all remaining command fields are ignored (valid only in the GUI). A + component name may also be substituted for ``NODE1`` ( ``NODE2`` and ``NINC`` are ignored). + + ninc : str + Generate nodes from the pattern of nodes beginning with ``NODE1`` to ``NODE2`` (defaults to + ``NODE1`` ) in steps of ``NINC`` (defaults to 1). If ``NODE1`` = ALL, ``NODE2`` and ``NINC`` are + ignored and the pattern is all selected nodes ( :ref:`nsel` ). If ``NODE1`` = P, graphical + picking is enabled and all remaining command fields are ignored (valid only in the GUI). A + component name may also be substituted for ``NODE1`` ( ``NODE2`` and ``NINC`` are ignored). + + dx : str + Node location increments in the active coordinate system (DR, Dθ, DZ for cylindrical, DR, Dθ, DΦ + for spherical or toroidal). + + dy : str + Node location increments in the active coordinate system (DR, Dθ, DZ for cylindrical, DR, Dθ, DΦ + for spherical or toroidal). + + dz : str + Node location increments in the active coordinate system (DR, Dθ, DZ for cylindrical, DR, Dθ, DΦ + for spherical or toroidal). + + space : str + Spacing ratio. Ratio of last division size to first division size. If > 1.0, divisions increase. + If < 1.0, divisions decrease. Ratio defaults to 1.0 (uniform spacing). + + The average spacing ratio remains 1.0, such that the location of the last generated set will be + the same regardless of ``SPACE``. ``SPACE`` only serves to skew the position of the nodes + between the pattern set and the last set. + + Notes + ----- + + .. _NGEN_notes: + + Generates additional nodes from a given node pattern. Generation is done in the active coordinate + system. Nodes in the pattern may have been generated in any coordinate system. + + This command is also valid in the :ref:`slashmap` processor. + """ + command = f"NGEN,{itime},{inc},{node1},{node2},{ninc},{dx},{dy},{dz},{space}" + return self.run(command, **kwargs) + + def nkpt(self, node: str = "", npt: str = "", **kwargs): + r"""Defines a node at an existing keypoint location. + + Mechanical APDL Command: `NKPT `_ + + Parameters + ---------- + node : str + Arbitrary reference number for node. If zero or blank, defaults to the highest node number +1 ( + :ref:`numstr` ). + + npt : str + Keypoint number defining global X, Y, Z location. If ``NPT`` = All, then a node will be placed + at each selected keypoint. If ``NPT`` = P, graphical picking is enabled and all remaining + command fields are ignored (valid only in the GUI). A component name may also be substituted for + ``NPT``. + """ + command = f"NKPT,{node},{npt}" + return self.run(command, **kwargs) + + def nlist( + self, + node1: str = "", + node2: str = "", + ninc: str = "", + lcoord: str = "", + sort1: str = "", + sort2: str = "", + sort3: str = "", + kinternal: str = "", + **kwargs, + ): + r"""Lists nodes. + + Mechanical APDL Command: `NLIST `_ + + Parameters + ---------- + node1 : str + List nodes from ``NODE1`` to ``NODE2`` (defaults to ``NODE1`` ) in steps of ``NINC`` (defaults + to 1). If ``NODE1`` = ALL (default), ``NODE2`` and ``NINC`` are ignored and all selected nodes ( + :ref:`nsel` ) are listed. If ``NODE1`` = P, graphical picking is enabled and all remaining + command fields are ignored (valid only in the GUI). A component name may also be substituted for + ``NODE1`` ( ``NODE2`` and ``NINC`` are ignored). + + node2 : str + List nodes from ``NODE1`` to ``NODE2`` (defaults to ``NODE1`` ) in steps of ``NINC`` (defaults + to 1). If ``NODE1`` = ALL (default), ``NODE2`` and ``NINC`` are ignored and all selected nodes ( + :ref:`nsel` ) are listed. If ``NODE1`` = P, graphical picking is enabled and all remaining + command fields are ignored (valid only in the GUI). A component name may also be substituted for + ``NODE1`` ( ``NODE2`` and ``NINC`` are ignored). + + ninc : str + List nodes from ``NODE1`` to ``NODE2`` (defaults to ``NODE1`` ) in steps of ``NINC`` (defaults + to 1). If ``NODE1`` = ALL (default), ``NODE2`` and ``NINC`` are ignored and all selected nodes ( + :ref:`nsel` ) are listed. If ``NODE1`` = P, graphical picking is enabled and all remaining + command fields are ignored (valid only in the GUI). A component name may also be substituted for + ``NODE1`` ( ``NODE2`` and ``NINC`` are ignored). + + lcoord : str + Coordinate listing key: + + * ``(blank)`` - List all nodal information + + * ``COORD`` - Suppress all but the XYZ coordinates (shown to a higher degree of accuracy than when + displayed with all information). + + sort1 : str + First item on which to sort. Valid item names are NODE, X, Y, Z, THXY, THYZ, THXZ + + sort2 : str + Second and third items on which to sort. Valid item names are the same as for ``SORT1``. + + sort3 : str + Second and third items on which to sort. Valid item names are the same as for ``SORT1``. + + kinternal : str + Internal nodes listing key: + + * ``(blank)`` - List only external nodes. + + * ``INTERNAL`` - List all nodes, including internal nodes. + + Notes + ----- + + .. _NLIST_notes: + + Lists nodes in the active display coordinate system ( :ref:`dsys` ). Nodal coordinate rotation + angles are also listed (relative to the global Cartesian coordinate system). + + Node listing can be in a sorted order (ascending). ``SORT2``, for example, will be carried out on + nodes having equal values of ``SORT1``. + + This command is valid in any processor. + """ + command = ( + f"NLIST,{node1},{node2},{ninc},{lcoord},{sort1},{sort2},{sort3},{kinternal}" + ) + return self.run(command, **kwargs) + + def nmodif( + self, + node: str = "", + x: str = "", + y: str = "", + z: str = "", + thxy: str = "", + thyz: str = "", + thzx: str = "", + **kwargs, + ): + r"""Modifies an existing node. + + Mechanical APDL Command: `NMODIF `_ + + Parameters + ---------- + node : str + Modify coordinates of this node. If ALL, modify coordinates of all selected nodes ( :ref:`nsel` + ). If ``NODE`` = P, graphical picking is enabled and all remaining command fields are ignored + (valid only in the GUI). A component name may also be substituted for ``NODE``. + + x : str + Replace the previous coordinate values assigned to this node with these corresponding coordinate + values. Values are interpreted in the active coordinate system (R, θ, Z for cylindrical; R, θ, Φ + for spherical or toroidal). Leaving any of these fields blank retains the previous value(s). + + y : str + Replace the previous coordinate values assigned to this node with these corresponding coordinate + values. Values are interpreted in the active coordinate system (R, θ, Z for cylindrical; R, θ, Φ + for spherical or toroidal). Leaving any of these fields blank retains the previous value(s). + + z : str + Replace the previous coordinate values assigned to this node with these corresponding coordinate + values. Values are interpreted in the active coordinate system (R, θ, Z for cylindrical; R, θ, Φ + for spherical or toroidal). Leaving any of these fields blank retains the previous value(s). + + thxy : str + First rotation of nodal coordinate system about nodal Z (positive X toward Y). Leaving this + field blank retains the previous value. + + thyz : str + Second rotation of nodal coordinate system about nodal X (positive Y toward Z). Leaving this + field blank retains the previous value. + + thzx : str + Third rotation of nodal coordinate system about nodal Y (positive Z toward X). Leaving this + field blank retains the previous value. + + Notes + ----- + + .. _NMODIF_notes: + + Modifies an existing node. Nodal coordinate system rotation angles are in degrees and redefine any + existing rotation angles. Nodes can also be redefined with the :ref:`n` command. + + See the :ref:`nrotat`, :ref:`nang`, and :ref:`nora` commands for other rotation options. + + This command is also valid in the :ref:`slashmap` processor. + """ + command = f"NMODIF,{node},{x},{y},{z},{thxy},{thyz},{thzx}" + return self.run(command, **kwargs) + + def nora(self, area: str = "", ndir: str = "", **kwargs): + r"""Rotates nodal coordinate systems to surface normal + + Mechanical APDL Command: `NORA `_ + + Parameters + ---------- + area : str + The area number containing the nodes to be rotated to their normals. If ALL, applies to all + selected areas (see the :ref:`asel` command). If AREA = P, graphical picking is enabled. + + ndir : str + Direction of the normal. If NDIR = -1, the nodal coordinate system is rotated in the opposite + direction of the surface normal. The default is the same direction as the surface normal. + + Notes + ----- + + .. _NORA_notes: + + The NORA command rotates the X-axis of the nodal coordinate system to the surface normal. The + rotated nodal coordinate systems may be displayed through the :ref:`psymb` command. In case multiple + areas are selected, there could be conflicts at the boundaries. If a node belongs to two areas that + have a different normal, its nodal coordinate system will be rotated to the area normal with the + lowest number. You can use the :ref:`areverse` and :ref:`anorm` commands to rotate the surface + normals in the appropriate direction. Keep the following in mind when using the NORA command: + + * If the nodal coordinate system is parallel to the global Cartesian system, it is not displayed + through the :ref:`psymb` command. + + * Previously specified rotation on the selected nodes are overridden. + """ + command = f"NORA,{area},{ndir}" + return self.run(command, **kwargs) + + def norl(self, line: str = "", area: str = "", ndir: str = "", **kwargs): + r"""Rotates nodal coordinate systems perpendicular to line normal + + Mechanical APDL Command: `NORL `_ + + Parameters + ---------- + line : str + Line number containing the nodes to be rotated. If ALL, applies to all selected lines (see the + :ref:`lsel` command). If ``LINE`` = P, graphical picking is enabled. + + area : str + The area number containing the selected lines. The normal of the line(s) selected is supposed to + lie on this area. Defaults to the lowest numbered selected area containing the line number. + + ndir : str + Direction of the normal. If ``NDIR`` = -1, the nodal coordinate system is rotated in the + opposite direction of the line normal. The default is the same direction as the surface normal. + + Notes + ----- + + .. _NORL_notes: + + The NORL command rotates the X-axis of the nodal coordinate perpendicular to the line normal. The + rotated nodal coordinate systems may be displayed through the :ref:`psymb` command. In case multiple + lines are selected, there could be conflicts at the boundaries. If a node belongs to two lines that + have a different normal, its nodal coordinate system will be rotated to the line normal with the + lowest number. Keep the following in mind when using the NORL command: + + * If the nodal coordinate system is parallel to the global Cartesian system, it is not displayed + through the :ref:`psymb` command. + + * Previously specified rotation on the selected nodes are overridden. + """ + command = f"NORL,{line},{area},{ndir}" + return self.run(command, **kwargs) + + def nplot(self, knum: int | str = "", **kwargs): + r"""Displays nodes. + + Mechanical APDL Command: `NPLOT `_ + + Parameters + ---------- + knum : int or str + Node number key: + + * ``0`` - No node numbers on display. + + * ``1`` - Include node numbers on display. See also :ref:`pnum` command. + + Notes + ----- + + .. _NPLOT_notes: + + Produces a node display. Only selected nodes ( :ref:`nsel` ) are displayed. Elements need not be + defined. See the :ref:`dsys` command for display coordinate system. + + This command is valid in any processor. + """ + command = f"NPLOT,{knum}" + return self.run(command, **kwargs) + + def nread(self, fname: str = "", ext: str = "", **kwargs): + r"""Reads nodes from a file. + + Mechanical APDL Command: `NREAD `_ + + Parameters + ---------- + fname : str + File name and directory path (248 characters maximum, including the characters needed for the + directory path). An unspecified directory path defaults to the working directory; in this case, + you can use all 248 characters for the file name. The file name defaults to :file:`Jobname`. + + ext : str + Filename extension (eight-character maximum). The extension defaults to NODE if ``Fname`` is + blank. + + Notes + ----- + + .. _NREAD_notes: + + The read operation is not necessary in a standard Mechanical APDL run but is provided as a + convenience for + those who want to read a coded node file (such as from another mesh generator or from a CAD/CAM + program). + + Data should be formatted as produced via :ref:`nwrite`. + + Only nodes within the node range specified via :ref:`nrrang` are read from the file. Duplicate nodes + already in the database are overwritten. + + The file is rewound before and after reading. Reading continues until the end of the file. + """ + command = f"NREAD,{fname},{ext}" + return self.run(command, **kwargs) + + def nrotat(self, node1: str = "", node2: str = "", ninc: str = "", **kwargs): + r"""Rotates nodal coordinate systems into the active system. + + Mechanical APDL Command: `NROTAT `_ + + Parameters + ---------- + node1 : str + Rotate nodes from ``NODE1`` to ``NODE2`` (defaults to ``NODE1`` ) in steps of ``NINC`` (defaults + to 1). If ``NODE1`` = ALL, ``NODE2`` and ``NINC`` are ignored and all selected nodes ( + :ref:`nsel` ) are rotated. If ``NODE1`` = P, graphical picking is enabled and all remaining + command fields are ignored (valid only in the GUI). A component name may also be substituted for + ``NODE1`` ( ``NODE2`` and ``NINC`` are ignored). + + node2 : str + Rotate nodes from ``NODE1`` to ``NODE2`` (defaults to ``NODE1`` ) in steps of ``NINC`` (defaults + to 1). If ``NODE1`` = ALL, ``NODE2`` and ``NINC`` are ignored and all selected nodes ( + :ref:`nsel` ) are rotated. If ``NODE1`` = P, graphical picking is enabled and all remaining + command fields are ignored (valid only in the GUI). A component name may also be substituted for + ``NODE1`` ( ``NODE2`` and ``NINC`` are ignored). + + ninc : str + Rotate nodes from ``NODE1`` to ``NODE2`` (defaults to ``NODE1`` ) in steps of ``NINC`` (defaults + to 1). If ``NODE1`` = ALL, ``NODE2`` and ``NINC`` are ignored and all selected nodes ( + :ref:`nsel` ) are rotated. If ``NODE1`` = P, graphical picking is enabled and all remaining + command fields are ignored (valid only in the GUI). A component name may also be substituted for + ``NODE1`` ( ``NODE2`` and ``NINC`` are ignored). + + Notes + ----- + + .. _NROTAT_notes: + + Rotates nodal coordinate systems into the active coordinate system. Nodal coordinate systems may be + automatically rotated into the active (global or local) coordinate system as follows: Rotations in + Cartesian systems will have nodal x directions rotated parallel to the Cartesian X direction. + Rotations in cylindrical, spherical or toroidal systems will have the nodal x directions rotated + parallel to the R direction. Nodes at (or near) a zero radius location should not be rotated. Nodal + coordinate directions may be displayed ( :ref:`psymb` ). Nodal forces and constraints will also + appear rotated when displayed if the nodal coordinate system is rotated. + + When the nodal coordinate systems are defined, they remain parallel to the global Cartesian system + unless subsequently rotated. + + Previously specified rotations on the specified nodes are overridden. + + See the :ref:`nmodif`, :ref:`nang`, and :ref:`nora` commands for other rotation options. + """ + command = f"NROTAT,{node1},{node2},{ninc}" + return self.run(command, **kwargs) + + def nrrang(self, nmin: str = "", nmax: str = "", ninc: str = "", **kwargs): + r"""Specifies the range of nodes to be read from the node file. + + Mechanical APDL Command: `NRRANG `_ + + Parameters + ---------- + nmin : str + Node range is defined from ``NMIN`` (defaults to 1) to ``NMAX`` (defaults to 999999999) in steps + of ``NINC`` (defaults to 1). + + nmax : str + Node range is defined from ``NMIN`` (defaults to 1) to ``NMAX`` (defaults to 999999999) in steps + of ``NINC`` (defaults to 1). + + ninc : str + Node range is defined from ``NMIN`` (defaults to 1) to ``NMAX`` (defaults to 999999999) in steps + of ``NINC`` (defaults to 1). + + Notes + ----- + + .. _NRRANG_notes: + + Defines the range of nodes to be read ( :ref:`nread` ) from the node file. Also implies an element + range since only elements fully attached to these nodes will be read from the element file. + """ + command = f"NRRANG,{nmin},{nmax},{ninc}" + return self.run(command, **kwargs) + + def nscale( + self, + inc: str = "", + node1: str = "", + node2: str = "", + ninc: str = "", + rx: str = "", + ry: str = "", + rz: str = "", + **kwargs, + ): + r"""Generates a scaled set of nodes from a pattern of nodes. + + Mechanical APDL Command: `NSCALE `_ + + Parameters + ---------- + inc : str + Do this scaling operation one time, incrementing all nodes in the given pattern by ``INC``. If + ``INC`` = 0, nodes will be redefined at the scaled locations. + + node1 : str + Scale nodes from pattern of nodes beginning with ``NODE1`` to ``NODE2`` (defaults to ``NODE1`` ) + in steps of ``NINC`` (defaults to 1). If ``NODE1`` = ALL, ``NODE2`` and ``NINC`` are ignored and + pattern is all selected nodes ( :ref:`nsel` ). If ``NODE1`` = P, graphical picking is enabled + and all remaining command fields are ignored (valid only in the GUI). A component name may also + be substituted for ``NODE1`` ( ``NODE2`` and ``NINC`` are ignored). + + node2 : str + Scale nodes from pattern of nodes beginning with ``NODE1`` to ``NODE2`` (defaults to ``NODE1`` ) + in steps of ``NINC`` (defaults to 1). If ``NODE1`` = ALL, ``NODE2`` and ``NINC`` are ignored and + pattern is all selected nodes ( :ref:`nsel` ). If ``NODE1`` = P, graphical picking is enabled + and all remaining command fields are ignored (valid only in the GUI). A component name may also + be substituted for ``NODE1`` ( ``NODE2`` and ``NINC`` are ignored). + + ninc : str + Scale nodes from pattern of nodes beginning with ``NODE1`` to ``NODE2`` (defaults to ``NODE1`` ) + in steps of ``NINC`` (defaults to 1). If ``NODE1`` = ALL, ``NODE2`` and ``NINC`` are ignored and + pattern is all selected nodes ( :ref:`nsel` ). If ``NODE1`` = P, graphical picking is enabled + and all remaining command fields are ignored (valid only in the GUI). A component name may also + be substituted for ``NODE1`` ( ``NODE2`` and ``NINC`` are ignored). + + rx : str + Scale factor ratios. Scaling is relative to the origin of the active coordinate system (RR, Rθ, + RZ for cylindrical, RR, Rθ, RΦ for spherical or toroidal). If absolute value of ratio > 1.0, + pattern is enlarged. If < 1.0, pattern is reduced. Ratios default to 1.0 (each). + + ry : str + Scale factor ratios. Scaling is relative to the origin of the active coordinate system (RR, Rθ, + RZ for cylindrical, RR, Rθ, RΦ for spherical or toroidal). If absolute value of ratio > 1.0, + pattern is enlarged. If < 1.0, pattern is reduced. Ratios default to 1.0 (each). + + rz : str + Scale factor ratios. Scaling is relative to the origin of the active coordinate system (RR, Rθ, + RZ for cylindrical, RR, Rθ, RΦ for spherical or toroidal). If absolute value of ratio > 1.0, + pattern is enlarged. If < 1.0, pattern is reduced. Ratios default to 1.0 (each). + + Notes + ----- + + .. _NSCALE_notes: + + Generates a scaled pattern of nodes from a given node pattern. Scaling is done in the active + coordinate system. Nodes in the pattern may have been generated in any coordinate system. + + This command is also valid in the :ref:`slashmap` processor. + """ + command = f"NSCALE,{inc},{node1},{node2},{ninc},{rx},{ry},{rz}" + return self.run(command, **kwargs) + + def nsmooth(self, npass: str = "", **kwargs): + r"""Smooths selected nodes among selected elements. + + Mechanical APDL Command: `NSMOOTH `_ + + Parameters + ---------- + npass : str + Number of smoothing passes. Defaults to 3. + + Notes + ----- + + .. _NSMOOTH_notes: + + Repositions each selected node at the average position of its immediate neighbors on the selected + elements. The node positions converge after some number of smoothing passes. For some initial + conditions, ``NPASS`` may need to be much larger than 3. If the boundary of a mesh is to be + undisturbed (usually desirable), the boundary nodes should be unselected before issuing + :ref:`nsmooth`. + """ + command = f"NSMOOTH,{npass}" + return self.run(command, **kwargs) + + def nsym( + self, + ncomp: str = "", + inc: str = "", + node1: str = "", + node2: str = "", + ninc: str = "", + **kwargs, + ): + r"""Generates a reflected set of nodes. + + Mechanical APDL Command: `NSYM `_ + + Parameters + ---------- + ncomp : str + Symmetry key: + + * ``X`` - X (or R) symmetry (default). + + * ``Y`` - Y (or θ) symmetry. + + * ``Z`` - Z (or Φ) symmetry. + + inc : str + Increment all nodes in the given pattern by ``INC`` to form the reflected node pattern. + + node1 : str + Reflect nodes from pattern beginning with ``NODE1`` to ``NODE2`` (defaults to ``NODE1`` ) in + steps of ``NINC`` (defaults to 1). If ``NODE1`` = ALL, ``NODE2`` and ``NINC`` are ignored and + pattern is all selected nodes ( :ref:`nsel` ). If ``NODE1`` = P, graphical picking is enabled + and all remaining command fields are ignored (valid only in the GUI). A component name may also + be substituted for ``NODE1`` ( ``NODE2`` and ``NINC`` are ignored). + + node2 : str + Reflect nodes from pattern beginning with ``NODE1`` to ``NODE2`` (defaults to ``NODE1`` ) in + steps of ``NINC`` (defaults to 1). If ``NODE1`` = ALL, ``NODE2`` and ``NINC`` are ignored and + pattern is all selected nodes ( :ref:`nsel` ). If ``NODE1`` = P, graphical picking is enabled + and all remaining command fields are ignored (valid only in the GUI). A component name may also + be substituted for ``NODE1`` ( ``NODE2`` and ``NINC`` are ignored). + + ninc : str + Reflect nodes from pattern beginning with ``NODE1`` to ``NODE2`` (defaults to ``NODE1`` ) in + steps of ``NINC`` (defaults to 1). If ``NODE1`` = ALL, ``NODE2`` and ``NINC`` are ignored and + pattern is all selected nodes ( :ref:`nsel` ). If ``NODE1`` = P, graphical picking is enabled + and all remaining command fields are ignored (valid only in the GUI). A component name may also + be substituted for ``NODE1`` ( ``NODE2`` and ``NINC`` are ignored). + + Notes + ----- + + .. _NSYM_notes: + + Generates nodes from a given node pattern by a symmetry reflection. Reflection is done in the active + coordinate system by changing a particular coordinate sign. Nodes in the pattern may have been + generated in any coordinate system. Nodal rotation angles are not reflected. + + Symmetry reflection may be used with any node pattern, in any coordinate system, as many times as + desired. Reflection is accomplished by a coordinate sign change (in the active coordinate system). + For example, an X-reflection in a Cartesian coordinate system generates additional nodes from a + given pattern, with a node increment added to each node number, and an X coordinate sign change. An + R-reflection in a cylindrical coordinate system gives a reflected "radial" location by changing the + "equivalent" Cartesian (that is, the Cartesian system with the same origin as the active cylindrical + system) X and Y coordinate signs. An R-reflection in a spherical coordinate system gives a reflected + "radial" location by changing the equivalent Cartesian X, Y, and Z coordinate location signs. Nodal + coordinate system rotation angles are not reflected. + """ + command = f"NSYM,{ncomp},{inc},{node1},{node2},{ninc}" + return self.run(command, **kwargs) + + def nwrite(self, fname: str = "", ext: str = "", kappnd: int | str = "", **kwargs): + r"""Writes nodes to a file. + + Mechanical APDL Command: `NWRITE `_ + + Parameters + ---------- + fname : str + File name and directory path (248 characters maximum, including the characters needed for the + directory path). An unspecified directory path defaults to the working directory; in this case, + you can use all 248 characters for the file name. The file name defaults to :file:`Jobname`. + + ext : str + Filename extension (eight-character maximum). The extension defaults to NODE if ``Fname`` is + blank. + + kappnd : int or str + Append key: + + * ``0`` - Rewind file before the write operation. + + * ``1`` - Append data to the end of the existing file. + + Notes + ----- + + .. _NWRITE_notes: + + Writes selected nodes ( :ref:`nsel` ]) to a file. The write operation is not necessary in a standard + Mechanical APDL run but is provided as a convenience to those who want coded node file. + + Data are written in a coded format. The format used is (I9, 6G21.13E3) to write out ``NODE``, ``X``, + ``Y``, ``Z``, ``THXY``, ``THYZ``, ``THZX``. If the last number is zero ( ``THZX`` = 0), or the last + set of numbers are zero, they are not written but are left blank. Therefore, use a formatted read to + process this file. + + Coordinate values are in the global Cartesian system. + """ + command = f"NWRITE,{fname},{ext},,{kappnd}" + return self.run(command, **kwargs) + + def quad( + self, + node1: str = "", + nintr: str = "", + node2: str = "", + nfill: str = "", + nstrt: str = "", + ninc: str = "", + pkfac: str = "", + **kwargs, + ): + r"""Generates a quadratic line of nodes from three nodes. + + Mechanical APDL Command: `QUAD `_ + + Parameters + ---------- + node1 : str + Begin fill-in from this node location. If ``NODE1`` = P, graphical picking is enabled and all + remaining command fields are ignored (valid only in the GUI). + + nintr : str + Intermediate or guiding node. Quadratic curve will pass through this location. ``NINTR`` may + have any node number and any location. If the quadratic line also generates a node with number + ``NINTR``, the generated location overrides the previous ``NINTR`` location. + + node2 : str + End quadratic fill-in at this node location. + + nfill : str + Fill-in ``NFILL`` nodes between ``NODE1`` and ``NODE2`` (defaults to | ``NODE2`` - ``NODE1`` + |-1). ``NFILL`` must be positive. + + nstrt : str + Node number assigned to first filled-in node (defaults to ``NODE1`` + ``NINC`` ). + + ninc : str + Add this increment to each of the remaining filled-in node numbers (may be positive or + negative). Defaults to ( ``NODE2`` - ``NODE1`` )/( ``NFILL`` + 1), that is, linear + interpolation. + + pkfac : str + Peak location factor. If ``PKFAC`` =0.5, the peak of the quadratic shape occurs at the ``NINTR`` + location. If 0.0 < ``PKFAC`` < 0.5, the peak occurs to the ``NODE2`` side of the ``NINTR`` + location. If 0.5 < ``PKFAC`` < 1.0, the peak occurs to the ``NODE1`` side of the ``NINTR`` + location. Defaults to 0.5. + + Notes + ----- + + .. _QUAD_notes: + + Generates a quadratic line of nodes (in the active coordinate system) from three nodes. The three + nodes determine the plane of the curve and may have been defined in any coordinate system. Any + number of nodes may be filled-in and any node number sequence may be assigned. + + The quadratic line feature uses three nodes ( ``NODE1``, ``NINTR``, ``NODE2`` ) to determine the + plane of the curve. The curve passes through the three points, beginning from ``NODE1``, through the + intermediate (or guiding) point ``NINTR``, and toward ``NODE2``. + + Generated nodes are also quadratically spaced. If the guiding node number is within the set being + generated, it will be relocated according to the quadratic spacing. + + The peak location factor is used to determine how the quadratic fits through the three points. + Various nodal progressions can be obtained by different combinations of ``PKFAC`` and the guiding + node location. If the guiding node is at mid-length between ``NODE1`` and ``NODE2``, 0.293 + :math:`equation not available` ``PKFAC`` < 0.707 will ensure that all generated nodes fall within + the ``NODE1``, ``NODE2`` bounds. In the limit, as ``PKFAC`` approaches 0.0, the peak approaches the + line through ``NODE1`` and ``NINTR`` at an infinite distance from ``NODE1``. The :ref:`quad` command + generates quadratic lines of nodes, which in turn may be used as a base line for generating + irregular surfaces of nodes (by repeating ( ``*REPEAT`` ), generating ( :ref:`ngen`, :ref:`nscale` + ), etc.). Irregular surfaces may also be generated with the meshing commands. + """ + command = f"QUAD,{node1},{nintr},{node2},{nfill},{nstrt},{ninc},{pkfac}" + return self.run(command, **kwargs) + + def transfer( + self, + kcnto: str = "", + inc: str = "", + node1: str = "", + node2: str = "", + ninc: str = "", + **kwargs, + ): + r"""Transfers a pattern of nodes to another coordinate system. + + Mechanical APDL Command: `TRANSFER `_ + + Parameters + ---------- + kcnto : str + Reference number of coordinate system where the pattern is to be transferred. Transfer occurs + from the active coordinate system. + + inc : str + Increment all nodes in the given pattern by ``INC`` to form the transferred node pattern. + + node1 : str + Transfer nodes from pattern beginning with ``NODE1`` to ``NODE2`` (defaults to ``NODE1`` ) in + steps of ``NINC`` (defaults to 1). If ``NODE1`` = ALL, ``NODE2`` and ``NINC`` are ignored and + the pattern is all selected nodes ( :ref:`nsel` ). If ``NODE1`` = P, graphical picking is + enabled and all remaining command fields are ignored (valid only in the GUI). A component may be + substituted for ``NODE1`` ( ``NODE2`` and ``NINC`` are ignored). + + node2 : str + Transfer nodes from pattern beginning with ``NODE1`` to ``NODE2`` (defaults to ``NODE1`` ) in + steps of ``NINC`` (defaults to 1). If ``NODE1`` = ALL, ``NODE2`` and ``NINC`` are ignored and + the pattern is all selected nodes ( :ref:`nsel` ). If ``NODE1`` = P, graphical picking is + enabled and all remaining command fields are ignored (valid only in the GUI). A component may be + substituted for ``NODE1`` ( ``NODE2`` and ``NINC`` are ignored). + + ninc : str + Transfer nodes from pattern beginning with ``NODE1`` to ``NODE2`` (defaults to ``NODE1`` ) in + steps of ``NINC`` (defaults to 1). If ``NODE1`` = ALL, ``NODE2`` and ``NINC`` are ignored and + the pattern is all selected nodes ( :ref:`nsel` ). If ``NODE1`` = P, graphical picking is + enabled and all remaining command fields are ignored (valid only in the GUI). A component may be + substituted for ``NODE1`` ( ``NODE2`` and ``NINC`` are ignored). + + Notes + ----- + + .. _TRANSFER_notes: + + Transfers a pattern of nodes from one coordinate system to another. Coordinate systems may be + translated and rotated relative to each other. Initial pattern may be generated in any coordinate + system. Coordinate values are interpreted in the active coordinate system and are transferred + directly. + + A model generated in one coordinate system may be transferred to another coordinate system. The user + may define several coordinate systems (translated and rotated from each other), generate a model in + one coordinate system, and then repeatedly transfer the model to other coordinate systems. The model + may be generated in any type of coordinate system (Cartesian, cylindrical, etc.) and transferred to + any other type of coordinate system. Coordinate values (X, Y, Z, or R, θ, Z, or etc.) of the + model being transferred are interpreted in the active coordinate system type, regardless of how they + were generated. Values are transferred directly and are interpreted according to the type of + coordinate system being transferred to. For example, transferring from a Cartesian coordinate system + to a cylindrical coordinate system (not recommended) would cause X = 2.0 and Y = 3.0 values to be + directly interpreted as R = 2.0 and θ = 3.0 values, respectively. + + This command is also valid in the :ref:`slashmap` processor. + """ + command = f"TRANSFER,{kcnto},{inc},{node1},{node2},{ninc}" + return self.run(command, **kwargs) diff --git a/src/ansys/mapdl/core/_commands/prep7/piping.py b/src/ansys/mapdl/core/_commands/prep7/piping.py new file mode 100644 index 00000000000..60762878e74 --- /dev/null +++ b/src/ansys/mapdl/core/_commands/prep7/piping.py @@ -0,0 +1,1062 @@ +# 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 Piping: + + def bellow( + self, + nloc: str = "", + leng: str = "", + stiff: str = "", + flex: str = "", + elem: str = "", + **kwargs, + ): + r"""Defines a bellows in a piping run. + + Mechanical APDL Command: `BELLOW `_ + + Parameters + ---------- + nloc : str + Node where bellows is to be placed. Defaults to current run starting point (RUN). + + leng : str + Length of bellows (defaults to average pipe OD). + + stiff : str + Axial stiffness value (defaults to that of equivalent straight pipe). + + flex : str + Bending flexibility factor (defaults to 1.0). + + elem : str + Element number to be assigned to bellows (defaults to the previous maximum element number + (MAXEL) + 1). + + Notes + ----- + + .. _BELLOW_notes: + + Defines a bellows (straight-pipe element PIPE16 with adjusted specifications and loadings) at a + given location in a piping run. + + .. warning:: + + This command is archived in the latest version of the software. + + """ + command = f"BELLOW,{nloc},{leng},{stiff},{flex},{elem}" + return self.run(command, **kwargs) + + def bend( + self, + nel1: str = "", + nel2: str = "", + rad: str = "", + ndiv: str = "", + estrt: str = "", + einc: str = "", + **kwargs, + ): + r"""Defines a bend in a piping run. + + Mechanical APDL Command: `BEND `_ + + Parameters + ---------- + nel1 : str + Element numbers of the two intersecting straight pipes. Defaults to the last two straight pipe + elements nearest the intersection of the last two runs. + + nel2 : str + Element numbers of the two intersecting straight pipes. Defaults to the last two straight pipe + elements nearest the intersection of the last two runs. + + rad : str + Bend radius. If LR, use long radius standard (1.5 x nominal diameter) (default). If SR, use + short radius standard (1.0 x nominal diameter). + + ndiv : str + Number of divisions (elements) along bend (defaults to 2). A node is generated at the end of + each division. + + estrt : str + Number to be assigned to first element of bend (defaults to MAXEL + 1). + + einc : str + Element number increment (defaults to 1). + + Notes + ----- + + .. _BEND_notes: + + Defines a bend of curved (elbow) pipe elements (PIPE18) in place of the intersection of two + previously defined straight pipe elements (RUN). Two new nodes are generated at the ends of the bend + (at the tangency points). A node is also generated at the center of curvature point. The two + straight pipes are automatically "shortened" to meet the ends of the bend. The bend specifications + and loadings are taken from the corresponding two straight pipes. The flexibility factors are + calculated from the internal pressure and EX (evaluated at TAVE) based on the current PPRES and + PTEMP command specifications when the element is generated. + + .. warning:: + + This command is archived in the latest version of the software. + + """ + command = f"BEND,{nel1},{nel2},{rad},{ndiv},{estrt},{einc}" + return self.run(command, **kwargs) + + def branch(self, node: str = "", x: str = "", y: str = "", z: str = "", **kwargs): + r"""Defines the starting point for a piping branch. + + Mechanical APDL Command: `BRANCH `_ + + Parameters + ---------- + node : str + Start branch at this node. + + x : str + Start branch at this location (in the active coordinate system). Used only if ``Node`` is not + input or input but the node itself is not previously defined. In either case a node is generated + at this location and assigned the number ``Node`` (or 1 + previous maximum node number if + ``Node`` is not input). + + y : str + Start branch at this location (in the active coordinate system). Used only if ``Node`` is not + input or input but the node itself is not previously defined. In either case a node is generated + at this location and assigned the number ``Node`` (or 1 + previous maximum node number if + ``Node`` is not input). + + z : str + Start branch at this location (in the active coordinate system). Used only if ``Node`` is not + input or input but the node itself is not previously defined. In either case a node is generated + at this location and assigned the number ``Node`` (or 1 + previous maximum node number if + ``Node`` is not input). + + Notes + ----- + + .. _BRANCH_notes: + + Notes + See the RUN command in :ref:`archlegacycommands` for information about piping models. + + .. warning:: + + This command is archived in the latest version of the software. + + """ + command = f"BRANCH,{node},{x},{y},{z}" + return self.run(command, **kwargs) + + def flange( + self, + nloc: str = "", + leng: str = "", + mass: str = "", + sif: str = "", + flex: str = "", + arins: str = "", + elem: str = "", + **kwargs, + ): + r"""Defines a flange in a piping run. + + Mechanical APDL Command: `FLANGE `_ + + Parameters + ---------- + nloc : str + Node where flange is to be placed (as described below). Defaults to current piping run starting + point. + + leng : str + Length of flange (defaults to larger pipe OD). + + mass : str + Dry mass (weight/gravity) of flange without insulation (defaults to equivalent straight pipe + mass). Note that acceleration ( :ref:`acel` ) must be nonzero for weight to be calculated. + + sif : str + Stress intensification factor (defaults to 1.0). + + flex : str + Bending flexibility factor (defaults to 1.0). + + arins : str + Insulation surface area (defaults to equivalent straight pipe insulation area). Units (length + :sup:`2` ) must be consistent with the smallest unit of the system used (not mixed) regardless + of the PUNIT option. + + elem : str + Element number to be assigned to flange (defaults to the previous maximum element number (MAXEL) + + 1). + + Notes + ----- + + .. _FLANGE_notes: + + Defines a flange (straight-pipe element PIPE16 with adjusted specifications and loadings) at a given + location in a piping run. (See the RUN command, and other commands described here, in + :ref:`archlegacycommands`.) + + The FLANGE command is similar to the VALVE command except for a different flexibility factor + default. The location may be 1) between two adjacent colinear straight pipes, 2) between an adjacent + straight pipe and a different piping component, or 3) at the end of a straight pipe. + + For Case 1, two new nodes are generated at the ends of the flange. The two straight pipes are + automatically "shortened" to meet the ends of the flange. The flange specifications and loadings are + taken from the corresponding two straight pipes. + + For Case 2, one new node is generated at one end of the flange. The straight pipe is automatically + "shortened" to meet this end of the flange. The other end of the flange meets the other piping + component. The flange specifications and loadings are taken from the straight pipe. + + For Case 3, one new node is generated at the free end of the flange. The other end of the flange + meets the straight pipe. The flange specifications and loadings are taken from the straight pipe. + + .. warning:: + + This command is archived in the latest version of the software. + + """ + command = f"FLANGE,{nloc},{leng},{mass},{sif},{flex},{arins},{elem}" + return self.run(command, **kwargs) + + def miter( + self, + nel1: str = "", + nel2: str = "", + rad: str = "", + ndiv: str = "", + estrt: str = "", + einc: str = "", + **kwargs, + ): + r"""Defines a mitered bend in a piping run. + + Mechanical APDL Command: `MITER `_ + + Parameters + ---------- + nel1 : str + Element numbers of the two intersecting straight pipes. Defaults to the last two straight pipe + elements nearest the intersection of the last two runs. + + nel2 : str + Element numbers of the two intersecting straight pipes. Defaults to the last two straight pipe + elements nearest the intersection of the last two runs. + + rad : str + Bend radius. If LR, use long radius standard (1.5 x OD) (default). If SR, use short radius + standard (1.0 x OD). + + ndiv : str + Number of divisions (elements) along bend (defaults to 2). A node is generated at the end of + each division. + + estrt : str + Number to be assigned to first element of bend (defaults to MAXEL + 1). + + einc : str + Element number increment (defaults to 1). + + Notes + ----- + + .. _MITER_notes: + + Defines a mitered bend of piecewise straight-pipe PIPE16 elements in place of the intersection of + two previously defined straight pipe elements (RUN). This command is similar to the BEND command + except that straight pipe elements are used to form the bend instead of curved (elbow) elements. + (See the RUN and BEND command descriptions in :ref:`archlegacycommands`.) + + .. warning:: + + This command is archived in the latest version of the software. + + """ + command = f"MITER,{nel1},{nel2},{rad},{ndiv},{estrt},{einc}" + return self.run(command, **kwargs) + + def pcorro(self, ctk: str = "", **kwargs): + r"""Specifies the allowable exterior corrosion thickness for a piping run. + + Mechanical APDL Command: `PCORRO `_ + + Parameters + ---------- + ctk : str + Allowable corrosion thickness. + + Notes + ----- + + .. _PCORRO_notes: + + Specifies the allowable exterior corrosion thickness for a piping run. (See the RUN command + description in :ref:`archlegacycommands`.) + + .. warning:: + + This command is archived in the latest version of the software. + + """ + command = f"PCORRO,{ctk}" + return self.run(command, **kwargs) + + def pdrag( + self, + px1: str = "", + py1: str = "", + pz1: str = "", + h1: str = "", + px2: str = "", + py2: str = "", + pz2: str = "", + h2: str = "", + kcord: str = "", + **kwargs, + ): + r"""Defines the external fluid drag loading for a piping run. + + Mechanical APDL Command: `PDRAG `_ + + Parameters + ---------- + px1 : str + External fluid drag pressure (global Cartesian components) at height ``H1``. + + py1 : str + External fluid drag pressure (global Cartesian components) at height ``H1``. + + pz1 : str + External fluid drag pressure (global Cartesian components) at height ``H1``. + + h1 : str + Height (along ``Kcord`` coordinate) for first drag pressure. + + px2 : str + External fluid drag pressure (global Cartesian components) at height ``H2``. + + py2 : str + External fluid drag pressure (global Cartesian components) at height ``H2``. + + pz2 : str + External fluid drag pressure (global Cartesian components) at height ``H2``. + + h2 : str + Height (along ``Kcord`` coordinate) for second drag pressure. + + kcord : str + Coordinate direction for height value (in the global Cartesian coordinate system): + + * ``X`` - X coordinate. + + * ``Y`` - Y coordinate (default). + + * ``Z`` - Z coordinate. + + Notes + ----- + + .. _PDRAG_notes: + + Defines the external fluid drag loading (pressure) as a function of height for a piping run. (See + the RUN command description in :ref:`archlegacycommands`.) The element drag pressure is determined + from the centroid height and linear interpolation. Pressures are assigned to the elements as they + are generated. + + .. warning:: + + This command is archived in the latest version of the software. + + """ + command = f"PDRAG,{px1},{py1},{pz1},{h1},{px2},{py2},{pz2},{h2},{kcord}" + return self.run(command, **kwargs) + + def pfluid(self, dens: str = "", **kwargs): + r"""Defines the contained fluid density for a piping run. + + Mechanical APDL Command: `PFLUID `_ + + Parameters + ---------- + dens : str + Density of the contained fluid. + + Notes + ----- + + .. _PFLUID_notes: + + See the RUN command description in :ref:`archlegacycommands`. + + .. warning:: + + This command is archived in the latest version of the software. + + """ + command = f"PFLUID,{dens}" + return self.run(command, **kwargs) + + def pgap( + self, + nloc: str = "", + k: str = "", + dx: str = "", + dy: str = "", + dz: str = "", + gap: str = "", + elem: str = "", + **kwargs, + ): + r"""Defines a spring-gap constraint in a piping run. + + Mechanical APDL Command: `PGAP `_ + + Parameters + ---------- + nloc : str + Node where gap is to be placed. Defaults to current run starting point. + + k : str + Spring constant value (must be positive). + + dx : str + Increment (in terms of the active coordinate system components) to determine gap ground point. + Element length must not be zero. Constraints are automatically generated at the ground point. + + dy : str + Increment (in terms of the active coordinate system components) to determine gap ground point. + Element length must not be zero. Constraints are automatically generated at the ground point. + + dz : str + Increment (in terms of the active coordinate system components) to determine gap ground point. + Element length must not be zero. Constraints are automatically generated at the ground point. + + gap : str + Gap size (defaults to the element length). + + elem : str + Element number to be assigned to gap (defaults to MAXEL + 1). + + Notes + ----- + + .. _PGAP_notes: + + Defines a spring-gap constraint (gap element CONTAC52) at a given location in a piping run. Gives + spring constraint resistance after a specified gap is closed. (See the RUN command description in + :ref:`archlegacycommands`.) + + .. warning:: + + This command is archived in the latest version of the software. + + """ + command = f"PGAP,{nloc},{k},{dx},{dy},{dz},{gap},{elem}" + return self.run(command, **kwargs) + + def pinsul(self, dens: str = "", itk: str = "", **kwargs): + r"""Defines the external insulation constants in a piping run. + + Mechanical APDL Command: `PINSUL `_ + + **Command default:** + + .. _PINSUL_default: + + No insulation. + + Parameters + ---------- + dens : str + Insulation density. + + itk : str + Insulation thickness. + + Notes + ----- + + .. _PINSUL_notes: + + Defines the external insulation constants in a piping run. (See the RUN command description in + :ref:`archlegacycommands`.) + + .. warning:: + + This command is archived in the latest version of the software. + + """ + command = f"PINSUL,{dens},{itk}" + return self.run(command, **kwargs) + + def popt(self, lop1: str = "", **kwargs): + r"""Selects the piping analysis standard for a piping run. + + Mechanical APDL Command: `POPT `_ + + **Command default:** + + .. _POPT_default: + + ANSI B31.1. + + Parameters + ---------- + lop1 : str + Option label: + + * ``B31.1`` - for ANSI B31.1. + + * ``NC`` - for ASME Section III NC, Class 2. + + Notes + ----- + + .. _POPT_notes: + + Selects the piping analysis standard for a piping run (RUN). Affects only the flexibility and stress + intensification factors applied to the curved pipe elements. (See the RUN command description in + :ref:`archlegacycommands`.) + + .. warning:: + + This command is archived in the latest version of the software. + + """ + command = f"POPT,{lop1}" + return self.run(command, **kwargs) + + def ppres(self, press: str = "", **kwargs): + r"""Defines the internal pressure for a piping run. + + Mechanical APDL Command: `PPRES `_ + + Parameters + ---------- + press : str + Pipe internal pressure. + + Notes + ----- + + .. _PPRES_notes: + + Defines the pipe internal pressure for a piping run (RUN). These pressures are assigned to the + elements as they are generated. (See the RUN command description in :ref:`archlegacycommands`.) + + .. warning:: + + This command is archived in the latest version of the software. + + """ + command = f"PPRES,{press}" + return self.run(command, **kwargs) + + def pspec( + self, + mat: str = "", + dnom: str = "", + sched: str = "", + od: str = "", + tk: str = "", + **kwargs, + ): + r"""Defines pipe material and dimensions. + + Mechanical APDL Command: `PSPEC `_ + + Parameters + ---------- + mat : str + Material number referring to a material property [ :ref:`mp` ]. Material number must be between + 1 and 40. + + dnom : str + Nominal diameter of pipe and schedule rating. Only valid ratings accepted. If these are + specified, the ``OD`` and ``TK`` values are found from an internal table. + + Valid values for ``DNOM`` are: 1, 1.5, 2, 2.5, 3, 3.5, 4, 5, 6, 8, 10, 12, 14, 16, 18, 20, 22, + 24, 26, 28, 30, 32, 34, and 36. + + Valid ratings for ``SCHED`` are: 5, 5S, 10, 10S, 20, 30, 40, 40S, 60, 80 80S, 100, 120, 140, + 160, XS, XXS, and STD. + + sched : str + Nominal diameter of pipe and schedule rating. Only valid ratings accepted. If these are + specified, the ``OD`` and ``TK`` values are found from an internal table. + + Valid values for ``DNOM`` are: 1, 1.5, 2, 2.5, 3, 3.5, 4, 5, 6, 8, 10, 12, 14, 16, 18, 20, 22, + 24, 26, 28, 30, 32, 34, and 36. + + Valid ratings for ``SCHED`` are: 5, 5S, 10, 10S, 20, 30, 40, 40S, 60, 80 80S, 100, 120, 140, + 160, XS, XXS, and STD. + + od : str + Outer diameter of pipe (if ``DNOM`` not specified). If both ``DNOM`` and ``OD`` are not + specified, ``OD`` and ``TK`` retain their previous values. + + tk : str + Wall thickness of pipe (if ``OD`` specified). + + Notes + ----- + + .. _PSPEC_notes: + + Defines pipe material and dimensions. (See the RUN command description in + :ref:`archlegacycommands`.) + + .. warning:: + + This command is archived in the latest version of the software. + + """ + command = f"PSPEC,{mat},{dnom},{sched},{od},{tk}" + return self.run(command, **kwargs) + + def psprng( + self, + nloc: str = "", + type_: str = "", + k: str = "", + dx: str = "", + dy: str = "", + dz: str = "", + elem: str = "", + **kwargs, + ): + r"""Defines a spring constraint in a piping run. + + Mechanical APDL Command: `PSPRNG `_ + + Parameters + ---------- + nloc : str + Node where spring is to be placed. Defaults to current run starting point. + + type_ : str + Type of spring: + + * ``TRAN`` - Translational (default). + + * ``ROT`` - Rotational. + + k : str + Spring constant value (must be positive). + + dx : str + Increment (in terms of the active coordinate system components) to determine spring ground + point. Spring length must not be zero. Constraints are automatically generated at the ground + point. + + dy : str + Increment (in terms of the active coordinate system components) to determine spring ground + point. Spring length must not be zero. Constraints are automatically generated at the ground + point. + + dz : str + Increment (in terms of the active coordinate system components) to determine spring ground + point. Spring length must not be zero. Constraints are automatically generated at the ground + point. + + elem : str + Element number to be assigned to spring (defaults to the previous maximum element number (MAXEL + + 1)). + + Notes + ----- + + .. _PSPRNG_notes: + + Defines a spring constraint (spring element ``COMBIN14`` ) at a given location in a piping run. (See + the RUN command description in :ref:`archlegacycommands`.) + + .. warning:: + + This command is archived in the latest version of the software. + + """ + command = f"PSPRNG,{nloc},{type_},{k},{dx},{dy},{dz},{elem}" + return self.run(command, **kwargs) + + def ptemp(self, tout: str = "", tin: str = "", **kwargs): + r"""Defines the pipe wall temperatures in a piping run. + + Mechanical APDL Command: `PTEMP `_ + + **Command default:** + + .. _PTEMP_default: + + Assign uniform temperature :ref:`bfunif` to elements. + + Parameters + ---------- + tout : str + Outer pipe wall temperature. If NONE, reset temperature specification to none ( :ref:`bfunif` + will be assigned). + + tin : str + Inner pipe wall temperature (defaults to ``TOUT`` ). + + Notes + ----- + + .. _PTEMP_notes: + + Defines the pipe wall temperatures in a piping run. These temperatures are assigned to the elements + as they are generated. (See the RUN command description in :ref:`archlegacycommands`.) + + .. warning:: + + This command is archived in the latest version of the software. + + """ + command = f"PTEMP,{tout},{tin}" + return self.run(command, **kwargs) + + def punit(self, kopt: int | str = "", **kwargs): + r"""Selects the system of length units to be used in a piping run. + + Mechanical APDL Command: `PUNIT `_ + + **Command default:** + + .. _PUNIT_default: + + Input units are consistent (no conversions are done). + + Parameters + ---------- + kopt : int or str + Units key: + + * ``0`` - Input units are consistent (no conversions are done) (default). + + * ``FTIN or 1`` - English units (feet A, inch B, fraction of inch C/D). Use A+B+C/D format for + PDRAG, BRANCH, RUN, BEND, MITER, REDUCE, VALVE, BELLOW, FLANGE, PSPRNG, and PGAP commands. Precede + by "-'' sign for negative coordinates. (Example: 5+6+7/16 for 5 ft. 6-7/16 in., +3 for 3 in., -0+3 + for -3 in., +0+9/16 for 9/16 in.). + + The two signs should not be consecutive. A, B, C, and D must be integers. Use B+C/D format for + PSPEC, PINSUL, and PCORRO commands. (Example: 2 for 2 in., 3+1/2 for 3-1/2 in., +3/8 for 3/8 in.) + + * ``METRIC or 2`` - Metric units (meter A, centimeter B, fraction of cm C/D). Use as explained for + English units. (Example: 5+6+7/10 for 5 m 6-7/10 cm with PDRAG command.) + + Notes + ----- + + .. _PUNIT_notes: + + Selects the system of length units to be used for the piping commands. Mixed length units require a + + sign to delimit (or position) the units in the system and are converted to the smallest unit of + the system (inches or centimeters) upon input. + + This conversion is local only to pure length units of the piping commands listed. Other units and + units for other commands must be input to be consistent with the smallest length unit of the system + used. + + .. warning:: + + This command is archived in the latest version of the software. + + """ + command = f"PUNIT,{kopt}" + return self.run(command, **kwargs) + + def reduce(self, nloc: str = "", leng: str = "", elem: str = "", **kwargs): + r"""Defines a reducer in a piping run. + + Mechanical APDL Command: `REDUCE `_ + + Parameters + ---------- + nloc : str + Node where two straight pipes intersect at center of reducer. Defaults to previous run starting + point. + + leng : str + Length of reducer (defaults to average pipe OD). + + elem : str + Element number to be assigned to reducer (defaults to MAXEL + 1). + + Notes + ----- + + .. _REDUCE_notes: + + Defines a reducer (straight-pipe element PIPE16 with averaged specifications) in place of the + intersection of two previously defined straight pipe elements in a piping run. (See the RUN command + description in :ref:`archlegacycommands`.) Two new nodes are generated at the ends of the reducer. + The two straight pipes are automatically "shortened" to meet the ends of the reducer. The reducer + specifications and loadings are taken from the corresponding two straight pipes. + + .. warning:: + + This command is archived in the latest version of the software. + + """ + command = f"REDUCE,{nloc},{leng},{elem}" + return self.run(command, **kwargs) + + def run( + self, + dx: str = "", + dy: str = "", + dz: str = "", + ndiv: str = "", + nend: str = "", + estrt: str = "", + einc: str = "", + **kwargs, + ): + r"""Defines a pipe run. + + Mechanical APDL Command: `RUN `_ + + Parameters + ---------- + dx : str + Increment (in terms of the active coordinate system components) to determine run end point. + Increment is applied to branch starting point (BRANCH) or end point of previous run (whichever + was later). + + dy : str + Increment (in terms of the active coordinate system components) to determine run end point. + Increment is applied to branch starting point (BRANCH) or end point of previous run (whichever + was later). + + dz : str + Increment (in terms of the active coordinate system components) to determine run end point. + Increment is applied to branch starting point (BRANCH) or end point of previous run (whichever + was later). + + ndiv : str + Number of divisions (elements) along branch (defaults to 1). A node is generated at the end of + each division. + + nend : str + Number to be assigned to end node of branch (defaults to MAXNP + ``NDIV`` ). + + estrt : str + Number to be assigned to first element of branch (defaults to the previous maximum element + number (MAXEL) + 1). + + einc : str + Element number increment (defaults to 1). + + Notes + ----- + + .. _RUN_notes: + + Defines a pipe run from a previous point to an incremental point. Nodes (and elements) are generated + straight (in the active coordinate system). Elements are of type PIPE16 straight pipes. Material + properties, real constants, and loads are derived from the previously defined piping specifications. + Piping loads and specifications are defined via PCORRO, PDRAG, PFLUID, PINSUL, POPT, PPRES, PSPEC, + PTEMP, and PUNIT commands. + + Generated items may be listed (or displayed) with the standard commands ( :ref:`nlist`, + :ref:`elist`, :ref:`nplot`, :ref:`eplot`, :ref:`etlist`, :ref:`rlist`, etc.). + + Items may also be modified ( :ref:`nmodif`, :ref:`emodif`, :ref:`rmodif`, etc.) or redefined as + desired. + + See :ref:`aCcQxq3dbmcm` for more information. + + .. warning:: + + This command is archived in the latest version of the software. + + """ + command = f"RUN,{dx},{dy},{dz},{ndiv},{nend},{estrt},{einc}" + return self.run(command, **kwargs) + + def tee( + self, + ncent: str = "", + type_: str = "", + elem: str = "", + einc: str = "", + l1: str = "", + l2: str = "", + l3: str = "", + **kwargs, + ): + r"""Defines a tee in a piping run. + + Mechanical APDL Command: `TEE `_ + + Parameters + ---------- + ncent : str + Node where three straight pipes intersect forming a tee (or "Y"). Defaults to last starting + branch node (BRANCH). + + type_ : str + Type of tee: + + * ``WT`` - Welding tee (default). + + r = (D:sub:`0` - t:sub:`w` ) / 2 + + h = 4.4 t:sub:`w` / r + + SIF = 0.9 / (h :sup:`2/3` ) + + If (SIF < 1) SIF = 1 + + * ``UFT`` - Unreinforced fabricated tee. + + r = (D:sub:`0` - t:sub:`w` ) / 2 + + h = t:sub:`w` / r + + SIF = 0.9 / (h :sup:`2/3` ) + + If (SIF < 1) SIF = 1 + + elem : str + Element number to be assigned to first tee leg (defaults to the previous maximum element number + (MAXEL) + 1). + + einc : str + Element number increment (defaults to 1). + + l1 : str + Tee leg lengths (corresponding in order of increasing straight pipe element numbers). Must be + less than the straight pipe length. Defaults to 2 x OD of straight pipe (for each leg). + + l2 : str + Tee leg lengths (corresponding in order of increasing straight pipe element numbers). Must be + less than the straight pipe length. Defaults to 2 x OD of straight pipe (for each leg). + + l3 : str + Tee leg lengths (corresponding in order of increasing straight pipe element numbers). Must be + less than the straight pipe length. Defaults to 2 x OD of straight pipe (for each leg). + + Notes + ----- + + .. _TEE_notes: + + Defines a tee in place of the tee intersection of three previously defined straight pipe elements. + (See the RUN command description in :ref:`archlegacycommands`.) + + The new tee is also composed of three PIPE16 straight pipe elements, but of the leg lengths + specified and with the appropriate tee factors calculated. + + Three new nodes are generated at the ends of the tee. + + The original three straight pipes are automatically "shortened" to meet the ends of the tee. The tee + specifications and loadings are taken from the corresponding three straight pipes. + + .. warning:: + + This command is archived in the latest version of the software. + + """ + command = f"TEE,{ncent},{type_},{elem},{einc},{l1},{l2},{l3}" + return self.run(command, **kwargs) + + def valve( + self, + nloc: str = "", + leng: str = "", + mass: str = "", + sif: str = "", + flex: str = "", + arins: str = "", + elem: str = "", + **kwargs, + ): + r"""Defines a valve in a piping run. + + Mechanical APDL Command: `VALVE `_ + + Parameters + ---------- + nloc : str + Node where valve is to be placed (as described below). Defaults to current run starting point. + + leng : str + Length of valve (defaults to larger pipe OD). + + mass : str + Dry mass (weight/gravity) of valve without insulation (defaults to equivalent straight pipe + mass). Note, acceleration ( :ref:`acel` ) must be nonzero for weight to be calculated. + + sif : str + Stress intensification factor (defaults to 1.0). + + flex : str + Bending flexibility factor (defaults to 0.5). + + arins : str + Insulation surface area (defaults to equivalent straight pipe insulation area). Units (length + :sup:`2` ) must be consistent with the smallest unit of the system used (not mixed) regardless + of the PUNIT option. + + elem : str + Element number to be assigned to valve (defaults to the previous maximum element number (MAXEL) + + 1). + + Notes + ----- + + .. _VALVE_notes: + + Defines a valve (straight-pipe element PIPE16 with adjusted specifications and loadings) at a given + location in a piping run. (See the RUN command description in :ref:`archlegacycommands`.) The + location may be 1) between two adjacent colinear straight pipes, 2) between an adjacent straight + pipe and a different piping component, or 3) at the end of a straight pipe. + + For Case 1, two new nodes are generated at the ends of the valve. The two straight pipes are + automatically "shortened" to meet the ends of the valve. The valve specifications and loadings are + taken from the corresponding two straight pipes. + + For Case 2, one new node is generated at one end of the valve. The straight pipe is automatically + "shortened" to meet this end of the valve. The other end of the valve meets the other piping + component. The valve specifications and loadings are taken from the straight pipe. + + For Case 3, one new node is generated at the free end of the valve. The other end of the valve meets + the straight pipe. The valve specifications and loadings are taken from the straight pipe. + + .. warning:: + + This command is archived in the latest version of the software. + + """ + command = f"VALVE,{nloc},{leng},{mass},{sif},{flex},{arins},{elem}" + return self.run(command, **kwargs) diff --git a/src/ansys/mapdl/core/_commands/prep7/primitives.py b/src/ansys/mapdl/core/_commands/prep7/primitives.py new file mode 100644 index 00000000000..759698586f3 --- /dev/null +++ b/src/ansys/mapdl/core/_commands/prep7/primitives.py @@ -0,0 +1,1278 @@ +# 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 ansys.mapdl.core._commands import parse + + +class Primitives: + + def blc4( + self, + xcorner: str = "", + ycorner: str = "", + width: str = "", + height: str = "", + depth: str = "", + **kwargs, + ): + r"""Creates a rectangular area or block volume by corner points. + + Mechanical APDL Command: `BLC4 `_ + + Parameters + ---------- + xcorner : str + Working plane X and Y coordinates of one corner of the rectangle or block face. + + ycorner : str + Working plane X and Y coordinates of one corner of the rectangle or block face. + + width : str + The distance from ``XCORNER`` on or parallel to the working plane X-axis that, together with + ``YCORNER``, defines a second corner of the rectangle or block face. + + height : str + The distance from ``YCORNER`` on or parallel to the working plane Y-axis that, together with + ``XCORNER``, defines a third corner of the rectangle or block face. + + depth : str + The perpendicular distance (either positive or negative based on the working plane Z direction) + from the working plane representing the depth of the block. If ``DEPTH`` = 0 (default), a + rectangular area is created on the working plane. + + Returns + ------- + int + Volume or area number of the block or rectangle. + + Notes + ----- + + .. _BLC4_notes: + + Defines a rectangular area anywhere on the working plane or a hexahedral volume with one face + anywhere on the working plane. A rectangle will be defined with four keypoints and four lines. A + volume will be defined with eight keypoints, twelve lines, and six areas, with the top and bottom + faces parallel to the working plane. See the :ref:`blc5`, :ref:`rectng`, and :ref:`block` commands + for alternate ways to create rectangles and blocks. + + Examples + -------- + Create a block with dimensions 1 x 2 x 10 with one corner of + the block at (0, 0) of the current working plane. + + >>> vnum = mapdl.blc4(1, 1, 1, 2, 10) + >>> vnum + 1 + """ + command = f"BLC4,{xcorner},{ycorner},{width},{height},{depth}" + return parse.parse_output_volume_area(self.run(command, **kwargs)) + + def blc5( + self, + xcenter: str = "", + ycenter: str = "", + width: str = "", + height: str = "", + depth: str = "", + **kwargs, + ): + r"""Creates a rectangular area or block volume by center and corner points. + + Mechanical APDL Command: `BLC5 `_ + + Parameters + ---------- + xcenter : str + Working plane X and Y coordinates of the center of the rectangle or block face. + + ycenter : str + Working plane X and Y coordinates of the center of the rectangle or block face. + + width : str + The total distance on or parallel to the working plane X-axis defining the width of the + rectangle or block face. + + height : str + The total distance on or parallel to the working plane Y-axis defining the height of the + rectangle or block face. + + depth : str + The perpendicular distance (either positive or negative based on the working plane Z direction) + from the working plane representing the depth of the block. If ``DEPTH`` = 0 (default), a + rectangular area is created on the working plane. If you are working with a model imported from + an IGES file (import option set to DEFAULT), you must supply a value for ``DEPTH`` or the + command is ignored. + + Returns + ------- + int + Volume or area number of the block or rectangle. + + Notes + ----- + + .. _BLC5_notes: + + Defines a rectangular area anywhere on the working plane or a hexahedral volume with one face + anywhere on the working plane by specifying the center and corner points. A rectangle will be + defined with four keypoints and four lines. A volume will be defined with eight keypoints, twelve + lines, and six areas, with the top and bottom faces parallel to the working plane. See the + :ref:`blc4`, :ref:`rectng`, and :ref:`block` commands for alternate ways to create rectangles and + blocks. + + Examples + -------- + Create a square centered at ``(0, 0)`` with a width of 0.5 and + a height of 0.5 + + >>> anum = mapdl.blc5(width=0.5, height=0.5) + >>> anum + 1 + + >>> vnum = mapdl.blc5(width=1, height=4, depth=9) + >>> vnum + 1 + """ + command = f"BLC5,{xcenter},{ycenter},{width},{height},{depth}" + return parse.parse_output_volume_area(self.run(command, **kwargs)) + + def block( + self, + x1: str = "", + x2: str = "", + y1: str = "", + y2: str = "", + z1: str = "", + z2: str = "", + **kwargs, + ): + r"""Creates a block volume based on working plane coordinates. + + Mechanical APDL Command: `BLOCK `_ + + Parameters + ---------- + x1 : str + Working plane X coordinates of the block. + + x2 : str + Working plane X coordinates of the block. + + y1 : str + Working plane Y coordinates of the block. + + y2 : str + Working plane Y coordinates of the block. + + z1 : str + Working plane Z coordinates of the block. + + z2 : str + Working plane Z coordinates of the block. + + Returns + ------- + int + Volume number of the block. + + Notes + ----- + + .. _BLOCK_notes: + + Defines a hexahedral volume based on the working plane. The block must have a spatial volume greater + than zero (that is, this volume primitive command cannot be used to create a degenerate volume as a + means of creating an area.) The volume will be defined with eight keypoints, twelve lines, and six + areas, with the top and bottom faces parallel to the working plane. See the :ref:`blc4` and + :ref:`blc5` commands for alternate ways to create blocks. + + Examples + -------- + Create a block volume based on working plane coordinates with + the size ``(1 x 2 x 3)``. + + >>> vnum = mapdl.block(0, 1, 0, 2, 1, 4) + >>> vnum + 1 + """ + command = f"BLOCK,{x1},{x2},{y1},{y2},{z1},{z2}" + return parse.parse_output_volume_area(self.run(command, **kwargs)) + + def con4( + self, + xcenter: str = "", + ycenter: str = "", + rad1: str = "", + rad2: str = "", + depth: str = "", + **kwargs, + ): + r"""Creates a conical volume anywhere on the working plane. + + Mechanical APDL Command: `CON4 `_ + + Parameters + ---------- + xcenter : str + Working plane X and Y coordinates of the center axis of the cone. + + ycenter : str + Working plane X and Y coordinates of the center axis of the cone. + + rad1 : str + Radii of the faces of the cone. ``RAD1`` defines the bottom face and will be located on the + working plane. ``RAD2`` defines the top face and is parallel to the working plane. A value of + zero or blank for either ``RAD1`` or ``RAD2`` defines a degenerate face at the center axis (that + is, the vertex of the cone). The same value for both ``RAD1`` and ``RAD2`` defines a cylinder + instead of a cone. + + rad2 : str + Radii of the faces of the cone. ``RAD1`` defines the bottom face and will be located on the + working plane. ``RAD2`` defines the top face and is parallel to the working plane. A value of + zero or blank for either ``RAD1`` or ``RAD2`` defines a degenerate face at the center axis (that + is, the vertex of the cone). The same value for both ``RAD1`` and ``RAD2`` defines a cylinder + instead of a cone. + + depth : str + The perpendicular distance (either positive or negative based on the working plane Z direction) + from the working plane representing the depth of the cone. ``DEPTH`` cannot be zero (see + :ref:`CON4_notes` below). + + Returns + ------- + int + Volume number of the cone. + + Notes + ----- + + .. _CON4_notes: + + Defines a solid conical volume with either the vertex or a face anywhere on the working plane. The + cone must have a spatial volume greater than zero. (that is, this volume primitive command cannot be + used to create a degenerate volume as a means of creating an area.) The face or faces will be + circular (each area defined with four lines), and they will be connected with two areas (each + spanning 180°). See the :ref:`cone` command for an alternate way to create cones. + + Examples + -------- + Create a cone with a bottom radius of 3 and a height of 10. + + >>> vnum = mapdl.con4(rad1=3, rad2=0, depth=10) + >>> vnum + 1 + """ + command = f"CON4,{xcenter},{ycenter},{rad1},{rad2},{depth}" + return parse.parse_output_volume_area(self.run(command, **kwargs)) + + def cone( + self, + rbot: str = "", + rtop: str = "", + z1: str = "", + z2: str = "", + theta1: str = "", + theta2: str = "", + **kwargs, + ): + r"""Creates a conical volume centered about the working plane origin. + + Mechanical APDL Command: `CONE `_ + + Parameters + ---------- + rbot : str + Radii of the bottom and top faces of the cone. A value of zero or blank for either ``RBOT`` or + ``RTOP`` defines a degenerate face at the center axis (that is, the vertex of the cone). The + same value for both ``RBOT`` and ``RTOP`` defines a cylinder instead of a cone. + + rtop : str + Radii of the bottom and top faces of the cone. A value of zero or blank for either ``RBOT`` or + ``RTOP`` defines a degenerate face at the center axis (that is, the vertex of the cone). The + same value for both ``RBOT`` and ``RTOP`` defines a cylinder instead of a cone. + + z1 : str + Working plane Z coordinates of the cone. The smaller value is always associated with the bottom + face. + + z2 : str + Working plane Z coordinates of the cone. The smaller value is always associated with the bottom + face. + + theta1 : str + Starting and ending angles (either order) of the cone. Used for creating a conical sector. The + sector begins at the algebraically smaller angle, extends in a positive angular direction, and + ends at the larger angle. The starting angle defaults to 0° and the ending angle defaults to + 360°. See the `Modeling and Meshing Guide + `_ for an + illustration. + + theta2 : str + Starting and ending angles (either order) of the cone. Used for creating a conical sector. The + sector begins at the algebraically smaller angle, extends in a positive angular direction, and + ends at the larger angle. The starting angle defaults to 0° and the ending angle defaults to + 360°. See the `Modeling and Meshing Guide + `_ for an + illustration. + + Returns + ------- + int + Volume number of the cone. + + Notes + ----- + + .. _CONE_notes: + + Defines a solid conical volume centered about the working plane origin. The non-degenerate face (top + or bottom) is parallel to the working plane but not necessarily coplanar with (that is, "on") the + working plane. The cone must have a spatial volume greater than zero. (that is, this volume + primitive command cannot be used to create a degenerate volume as a means of creating an area.) For + a cone of 360°, top and bottom faces will be circular (each area defined with four lines), and they + will be connected with two areas (each spanning 180°). See the :ref:`con4` command for an alternate + way to create cones. + + Examples + -------- + Create a quarter cone with a bottom radius of 3, top radius of 1 and + a height of 10 centered at ``(0, 0)``. + + >>> vnum = mapdl.cone(rbot=5, rtop=1, z1=0, z2=10, theta1=180, theta2=90) + >>> vnum + 1 + """ + command = f"CONE,{rbot},{rtop},{z1},{z2},{theta1},{theta2}" + return parse.parse_output_volume_area(self.run(command, **kwargs)) + + def cyl4( + self, + xcenter: str = "", + ycenter: str = "", + rad1: str = "", + theta1: str = "", + rad2: str = "", + theta2: str = "", + depth: str = "", + **kwargs, + ): + r"""Creates a circular area or cylindrical volume anywhere on the working plane. + + Mechanical APDL Command: `CYL4 `_ + + Parameters + ---------- + xcenter : str + Working plane X and Y coordinates of the center of the circle or cylinder. + + ycenter : str + Working plane X and Y coordinates of the center of the circle or cylinder. + + rad1 : str + Inner and outer radii (either order) of the circle or cylinder. A value of zero or blank for + either ``RAD1`` or ``RAD2``, or the same value for both ``RAD1`` and ``RAD2``, defines a solid + circle or cylinder. + + theta1 : str + Starting and ending angles (either order) of the circle or faces of the cylinder. Used for + creating a partial annulus or partial cylinder. The sector begins at the algebraically smaller + angle, extends in a positive angular direction, and ends at the larger angle. The starting angle + defaults to 0° and the ending angle defaults to 360°. See the `Modeling and Meshing Guide + `_ for an + illustration. + + rad2 : str + Inner and outer radii (either order) of the circle or cylinder. A value of zero or blank for + either ``RAD1`` or ``RAD2``, or the same value for both ``RAD1`` and ``RAD2``, defines a solid + circle or cylinder. + + theta2 : str + Starting and ending angles (either order) of the circle or faces of the cylinder. Used for + creating a partial annulus or partial cylinder. The sector begins at the algebraically smaller + angle, extends in a positive angular direction, and ends at the larger angle. The starting angle + defaults to 0° and the ending angle defaults to 360°. See the `Modeling and Meshing Guide + `_ for an + illustration. + + depth : str + The perpendicular distance (either positive or negative based on the working plane Z direction) + from the working plane representing the depth of the cylinder. If ``DEPTH`` = 0 (default), a + circular area is created on the working plane. + + Returns + ------- + int + Volume or area number of the block or rectangle. + + Notes + ----- + + .. _CYL4_notes: + + Defines a circular area anywhere on the working plane or a cylindrical volume with one face anywhere + on the working plane. For a solid cylinder of 360°, the top and bottom faces will be circular (each + area defined with four lines) and they will be connected with two surface areas (each spanning + 180°). See the :ref:`cyl5`, :ref:`pcirc`, and :ref:`cylind` commands for alternate ways to create + circles and cylinders. + + When working with a model imported from an IGES file (DEFAULT import option), you must provide a + value for ``DEPTH`` or the command will be ignored. + + Examples + -------- + Create a half arc centered at the origin with an outer radius + of 2 and an inner radius of 1 + + >>> anum = mapdl.cyl4(xcenter=0, ycenter=0, rad1=1, + theta1=0, rad2=2, theta2=180) + >>> anum + + Create a solid cylinder with a depth of 10 at the center of + the working plane. + + >>> vnum = mapdl.cyl4(0, 0, 1, depth=10) + >>> vnum + 1 + + Create a cylinder with an inner radius of 1.9 and an outer of + 2.0 with a height of 5 centered at the working plane. + + >>> vnum = mapdl.cyl4(0, 0, rad1=1.9, rad2=2.0, depth=10) + 2 + """ + command = f"CYL4,{xcenter},{ycenter},{rad1},{theta1},{rad2},{theta2},{depth}" + return parse.parse_output_volume_area(self.run(command, **kwargs)) + + def cyl5( + self, + xedge1: str = "", + yedge1: str = "", + xedge2: str = "", + yedge2: str = "", + depth: str = "", + **kwargs, + ): + r"""Creates a circular area or cylindrical volume by end points. + + Mechanical APDL Command: `CYL5 `_ + + Parameters + ---------- + xedge1 : str + Working plane X and Y coordinates of one end of the circle or cylinder face. + + yedge1 : str + Working plane X and Y coordinates of one end of the circle or cylinder face. + + xedge2 : str + Working plane X and Y coordinates of the other end of the circle or cylinder face. + + yedge2 : str + Working plane X and Y coordinates of the other end of the circle or cylinder face. + + depth : str + The perpendicular distance (either positive or negative based on the working plane Z direction) + from the working plane representing the depth of the cylinder. If ``DEPTH`` = 0 (default), a + circular area is created on the working plane. + + Returns + ------- + int + Volume or area number of the circular area of cylindrical + volume. + + Notes + ----- + + .. _CYL5_notes: + + Defines a circular area anywhere on the working plane or a cylindrical volume with one face anywhere + on the working plane by specifying diameter end points. For a solid cylinder of 360°, the top and + bottom faces will be circular (each area defined with four lines) and they will be connected with + two surface areas (each spanning 180°). See the :ref:`cyl4`, :ref:`pcirc`, and :ref:`cylind` + commands for alternate ways to create circles and cylinders. + + Examples + -------- + Create a circular with one point of the circle at ``(1, 1)`` + and the other point at ``(2, 2)`` + + >>> anum = mapdl.cyl5(xedge1=1, yedge1=1, xedge2=2, yedge2=2) + >>> anum + 1 + + Create a cylinder with one point of the circle at ``(X, Y) == + (1, 1)`` and the other point at ``(X, Y) == (2, 2)`` with a + height of 3. + + >>> vnum = mapdl.cyl5(xedge1=1, yedge1=1, xedge2=2, yedge2=2, depth=5) + >>> vnum + 1 + """ + command = f"CYL5,{xedge1},{yedge1},{xedge2},{yedge2},{depth}" + return parse.parse_output_volume_area(self.run(command, **kwargs)) + + def cylind( + self, + rad1: str = "", + rad2: str = "", + z1: str = "", + z2: str = "", + theta1: str = "", + theta2: str = "", + **kwargs, + ): + r"""Creates a cylindrical volume centered about the working plane origin. + + Mechanical APDL Command: `CYLIND `_ + + Parameters + ---------- + rad1 : str + Inner and outer radii (either order) of the cylinder. A value of zero or blank for either + ``RAD1`` or ``RAD2``, or the same value for both ``RAD1`` and ``RAD2``, defines a solid + cylinder. + + rad2 : str + Inner and outer radii (either order) of the cylinder. A value of zero or blank for either + ``RAD1`` or ``RAD2``, or the same value for both ``RAD1`` and ``RAD2``, defines a solid + cylinder. + + z1 : str + Working plane Z coordinates of the cylinder. If either ``Z1`` or ``Z2`` is zero, one of the + faces of the cylinder will be coplanar with the working plane. + + z2 : str + Working plane Z coordinates of the cylinder. If either ``Z1`` or ``Z2`` is zero, one of the + faces of the cylinder will be coplanar with the working plane. + + theta1 : str + Starting and ending angles (either order) of the cylinder. Used for creating a cylindrical + sector. The sector begins at the algebraically smaller angle, extends in a positive angular + direction, and ends at the larger angle. The starting angle defaults to 0.0° and the ending + angle defaults to 360.0°. See the `Modeling and Meshing Guide + `_ for an + illustration. + + theta2 : str + Starting and ending angles (either order) of the cylinder. Used for creating a cylindrical + sector. The sector begins at the algebraically smaller angle, extends in a positive angular + direction, and ends at the larger angle. The starting angle defaults to 0.0° and the ending + angle defaults to 360.0°. See the `Modeling and Meshing Guide + `_ for an + illustration. + + Returns + ------- + int + Volume number of the cylinder. + + Notes + ----- + + .. _CYLIND_notes: + + Defines a cylindrical volume centered about the working plane origin. The top and bottom faces are + parallel to the working plane but neither face need be coplanar with (that is, "on") the working + plane. The cylinder must have a spatial volume greater than zero. (that is, this volume primitive + command cannot be used to create a degenerate volume as a means of creating an area.) For a solid + cylinder of 360°, the top and bottom faces will be circular (each area defined with four lines), and + they will be connected with two areas (each spanning 180°.) See the :ref:`cyl4` and :ref:`cyl5` + commands for alternate ways to create cylinders. + + Examples + -------- + Create a hollow cylinder with an inner radius of 0.9 and an + outer radius of 1.0 with a height of 5 + + >>> vnum = mapdl.cylind(0.9, 1, z1=0, z2=5) + >>> vnum + 1 + """ + command = f"CYLIND,{rad1},{rad2},{z1},{z2},{theta1},{theta2}" + return parse.parse_output_volume_area(self.run(command, **kwargs)) + + def pcirc( + self, + rad1: str = "", + rad2: str = "", + theta1: str = "", + theta2: str = "", + **kwargs, + ): + r"""Creates a circular area centered about the working plane origin. + + Mechanical APDL Command: `PCIRC `_ + + Parameters + ---------- + rad1 : str + Inner and outer radii (either order) of the circle. A value of either zero or blank for either + ``RAD1`` or ``RAD2``, or the same value for both ``RAD1`` and ``RAD2``, defines a solid circle. + + rad2 : str + Inner and outer radii (either order) of the circle. A value of either zero or blank for either + ``RAD1`` or ``RAD2``, or the same value for both ``RAD1`` and ``RAD2``, defines a solid circle. + + theta1 : str + Starting and ending angles (either order) of the circular area. Used for creating a circular + sector. The sector begins at the algebraically smaller angle, extends in a positive angular + direction, and ends at the larger angle. The starting angle defaults to 0.0° and the ending + angle defaults to 360.0°. See the `Modeling and Meshing Guide + `_ for an + illustration. + + theta2 : str + Starting and ending angles (either order) of the circular area. Used for creating a circular + sector. The sector begins at the algebraically smaller angle, extends in a positive angular + direction, and ends at the larger angle. The starting angle defaults to 0.0° and the ending + angle defaults to 360.0°. See the `Modeling and Meshing Guide + `_ for an + illustration. + + Returns + ------- + int + Area number of the new circular area. + + Notes + ----- + + .. _PCIRC_notes: + + Defines a solid circular area or circular sector centered about the working plane origin. For a + solid circle of 360°, the area will be defined with four keypoints and four lines. See the + :ref:`cyl4` and :ref:`cyl5` commands for alternate ways to create circles. + + Examples + -------- + In this example a circular area with an inner radius of 0.95 + and an outer radius of 1 is created. + + >>> anum = mapdl.pcirc(0.95, 1) + >>> anum + 1 + """ + command = f"PCIRC,{rad1},{rad2},{theta1},{theta2}" + return parse.parse_output_volume_area(self.run(command, **kwargs)) + + def poly(self, **kwargs): + r"""Creates a polygonal area based on working plane coordinate pairs. + + Mechanical APDL Command: `POLY `_ + + Notes + ----- + + .. _POLY_notes: + + Defines a polygonal area on the working plane. The area will be defined with NPT keypoints and NPT + lines, where NPT (must be at least 3) is the number of coordinate pairs defined with the :ref:`ptxy` + command. See the :ref:`rpoly` and :ref:`rpr4` commands for other ways to create polygons. + """ + command = "POLY" + return self.run(command, **kwargs) + + def pri2(self, p51x: str = "", z1: str = "", z2: str = "", **kwargs): + r"""Creates a polygonal area or a prism volume by vertices (GUI). + + Mechanical APDL Command: `PRI2 `_ + + Parameters + ---------- + p51x : str + The description of the argument is missing in the Python function. Please, refer to the `command + documentation + `_ for further + information. + + z1 : str + The description of the argument is missing in the Python function. Please, refer to the `command + documentation + `_ for further + information. + + z2 : str + The description of the argument is missing in the Python function. Please, refer to the `command + documentation + `_ for further + information. + + Notes + ----- + + .. warning:: + + This function contains specificities regarding the argument definitions. + Please refer to the `command documentation `_ + for further explanations. + + .. _PRI2_notes: + + Creates a polygonal area or a prism volume using the vertices as input. This is a command generated + by the Graphical User Interface (GUI) and appears in the log file ( :file:`Jobname.LOG` ) if + graphical picking is used. + + This 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` ). + + For polygons, :ref:`pri2` appears in the log file as :ref:`pri2`, ``P51X``,0.0,0.0, preceded by + :ref:`fitem` commands defining the vertices (in global Cartesian coordinates). + + For prisms, :ref:`pri2` appears in the log file as :ref:`pri2`, ``P51X``, preceded by :ref:`fitem` + commands defining the vertices and the Z-end of the prism. + + See :ref:`rpoly`, :ref:`poly`, :ref:`rprism`, :ref:`prism`, and :ref:`rpr4` for other ways to create + polygons and prisms. + """ + command = f"PRI2,{p51x},{z1},{z2}" + return self.run(command, **kwargs) + + def prism(self, z1: str = "", z2: str = "", **kwargs): + r"""Creates a prism volume based on working plane coordinate pairs. + + Mechanical APDL Command: `PRISM `_ + + Parameters + ---------- + z1 : str + Working plane Z coordinates of the top and bottom of the prism. + + z2 : str + Working plane Z coordinates of the top and bottom of the prism. + + Notes + ----- + + .. _PRISM_notes: + + Defines a prism volume based on the working plane. The top and bottom areas will each be defined + with NPT keypoints and NPT lines, where NPT (must be at least 3) is the number of coordinate pairs + defined with :ref:`ptxy` command. Also, a line will be defined between each point pair on the top + and bottom face. See the :ref:`rprism` and :ref:`rpr4` commands for other ways to create prisms. + """ + command = f"PRISM,{z1},{z2}" + return self.run(command, **kwargs) + + def ptxy( + self, + x1: str = "", + y1: str = "", + x2: str = "", + y2: str = "", + x3: str = "", + y3: str = "", + x4: str = "", + y4: str = "", + **kwargs, + ): + r"""Defines coordinate pairs for use in polygons and prisms. + + Mechanical APDL Command: `PTXY `_ + + Parameters + ---------- + x1 : str + X and Y coordinate pairs on the working plane. + + y1 : str + X and Y coordinate pairs on the working plane. + + x2 : str + X and Y coordinate pairs on the working plane. + + y2 : str + X and Y coordinate pairs on the working plane. + + x3 : str + X and Y coordinate pairs on the working plane. + + y3 : str + X and Y coordinate pairs on the working plane. + + x4 : str + X and Y coordinate pairs on the working plane. + + y4 : str + X and Y coordinate pairs on the working plane. + + Notes + ----- + + .. _PTXY_notes: + + Defines coordinate pairs for use in polygons and prisms ( :ref:`poly`, :ref:`rprism` ). The + coordinates must be in the Cartesian coordinate system. The coordinate pairs must be input in a + continuous order. :ref:`ptxy` may be repeated (up to 100 pairs) until the required pairs have been + defined. The pairs will be saved until either the :ref:`poly` or :ref:`prism` command is entered. + Use :ref:`ptxy`,STAT to list the saved coordinate pairs. Use :ref:`ptxy`,DELE to delete all the + saved coordinate pairs. See the :ref:`rpoly`, :ref:`rprism`, and :ref:`rpr4` commands for other ways + to create polygons and prisms. + """ + command = f"PTXY,{x1},{y1},{x2},{y2},{x3},{y3},{x4},{y4}" + return self.run(command, **kwargs) + + def rectng(self, x1: str = "", x2: str = "", y1: str = "", y2: str = "", **kwargs): + r"""Creates a rectangular area anywhere on the working plane. + + Mechanical APDL Command: `RECTNG `_ + + Parameters + ---------- + x1 : str + Working plane X coordinates of the rectangle. + + x2 : str + Working plane X coordinates of the rectangle. + + y1 : str + Working plane Y coordinates of the rectangle. + + y2 : str + Working plane Y coordinates of the rectangle. + + Notes + ----- + + .. _RECTNG_notes: + + The area will be defined with four keypoints and four lines. See the :ref:`blc4` and :ref:`blc5` + commands for alternate ways to create rectangles. + """ + command = f"RECTNG,{x1},{x2},{y1},{y2}" + return parse.parse_output_volume_area(self.run(command, **kwargs)) + + def rpoly( + self, + nsides: str = "", + lside: str = "", + majrad: str = "", + minrad: str = "", + **kwargs, + ): + r"""Creates a regular polygonal area centered about the working plane origin. + + Mechanical APDL Command: `RPOLY `_ + + Parameters + ---------- + nsides : str + Number of sides in the regular polygon. Must be greater than 2. + + lside : str + Length of each side of the regular polygon. + + majrad : str + Radius of the major (or circumscribed) circle of the polygon. Not used if ``LSIDE`` is input. + + minrad : str + Radius of the minor (or inscribed) circle of the polygon. Not used if ``LSIDE`` or ``MAJRAD`` is + input. + + Notes + ----- + + .. _RPOLY_notes: + + Defines a regular polygonal area on the working plane. The polygon will be centered about the + working plane origin, with the first keypoint defined at θ = 0°. The area will be defined + with ``NSIDES`` keypoints and ``NSIDES`` lines. See the :ref:`rpr4` and :ref:`poly` commands for + other ways to create polygons. + """ + command = f"RPOLY,{nsides},{lside},{majrad},{minrad}" + return self.run(command, **kwargs) + + def rpr4( + self, + nsides: str = "", + xcenter: str = "", + ycenter: str = "", + radius: str = "", + theta: str = "", + depth: str = "", + **kwargs, + ): + r"""Creates a regular polygonal area or prism volume anywhere on the working plane. + + Mechanical APDL Command: `RPR4 `_ + + Parameters + ---------- + nsides : str + The number of sides in the polygon or prism face. Must be greater than 2. + + xcenter : str + Working plane X and Y coordinates of the center of the polygon or prism face. + + ycenter : str + Working plane X and Y coordinates of the center of the polygon or prism face. + + radius : str + Distance (major radius) from the center to a vertex of the polygon or prism face (where the + first keypoint is defined). + + theta : str + Angle (in degrees) from the working plane X-axis to the vertex of the polygon or prism face + where the first keypoint is defined. Used to orient the polygon or prism face. Defaults to zero. + + depth : str + The perpendicular distance (either positive or negative based on the working plane Z direction) + from the working plane representing the depth of the prism. If ``DEPTH`` = 0 (default), a + polygonal area is created on the working plane. + + Notes + ----- + + .. _RPR4_notes: + + Defines a regular polygonal area anywhere on the working plane or prism volume with one face + anywhere on the working plane. The top and bottom faces of the prism are polygonal areas. See the + :ref:`rpoly`, :ref:`poly`, :ref:`rprism`, and :ref:`prism` commands for other ways to create + polygons and prisms. + """ + command = f"RPR4,{nsides},{xcenter},{ycenter},{radius},{theta},{depth}" + return self.run(command, **kwargs) + + def rprism( + self, + z1: str = "", + z2: str = "", + nsides: str = "", + lside: str = "", + majrad: str = "", + minrad: str = "", + **kwargs, + ): + r"""Creates a regular prism volume centered about the working plane origin. + + Mechanical APDL Command: `RPRISM `_ + + Parameters + ---------- + z1 : str + Working plane Z coordinates of the prism. + + z2 : str + Working plane Z coordinates of the prism. + + nsides : str + Number of sides in the polygon defining the top and bottom faces of the prism. Must be greater + than 2. + + lside : str + Length of each side of the polygon defining the top and bottom faces of the prism. + + majrad : str + Radius of the major (or circumscribed) circle of the polygon defining the top and bottom faces + of the prism. Not used if ``LSIDE`` is input. + + minrad : str + Radius of the minor (or inscribed circle) of the polygon defining the top and bottom faces of + the prism. Not used if ``LSIDE`` or ``MAJRAD`` is input. + + Notes + ----- + + .. _RPRISM_notes: + + Defines a regular prism volume centered about the working plane origin. The prism must have a + spatial volume greater than zero. (that is, this volume primitive command cannot be used to create a + degenerate volume as a means of creating an area.) The top and bottom faces are polygonal areas that + are parallel to the working plane but neither face need be coplanar with (that is, "on") the working + plane. The first keypoint defined for each face is at θ = 0°. See the :ref:`rpr4` and + :ref:`prism` commands for other ways to create prisms. + """ + command = f"RPRISM,{z1},{z2},{nsides},{lside},{majrad},{minrad}" + return self.run(command, **kwargs) + + def sph4( + self, + xcenter: str = "", + ycenter: str = "", + rad1: str = "", + rad2: str = "", + **kwargs, + ): + r"""Creates a spherical volume anywhere on the working plane. + + Mechanical APDL Command: `SPH4 `_ + + Parameters + ---------- + xcenter : str + Working plane X and Y coordinates of the center of the sphere. + + ycenter : str + Working plane X and Y coordinates of the center of the sphere. + + rad1 : str + Inner and outer radii (either order) of the sphere. A value of zero or blank for either ``RAD1`` + or ``RAD2`` defines a solid sphere. + + rad2 : str + Inner and outer radii (either order) of the sphere. A value of zero or blank for either ``RAD1`` + or ``RAD2`` defines a solid sphere. + + Returns + ------- + int + Volume number of the sphere. + + Notes + ----- + + .. _SPH4_notes: + + Defines either a solid or hollow spherical volume anywhere on the working plane. The sphere must + have a spatial volume greater than zero. (that is, this volume primitive command cannot be used to + create a degenerate volume as a means of creating an area.) A sphere of 360° will be defined with + two areas, each consisting of a hemisphere. See the :ref:`sphere` and :ref:`sph5` commands for other + ways to create spheres. + + When working with a model imported from an IGES file (DEFAULT import option), you can create only + solid spheres. If you enter a value for both ``RAD1`` and ``RAD2`` the command is ignored. + + Examples + -------- + This example creates a hollow sphere with an inner radius of + 0.9 and an outer radius of 1.0 centered at ``(0, 0)`` + + >>> vnum = mapdl.sph4(0, 0, rad1=0.9, rad2=1.0) + >>> vnum + 1 + """ + command = f"SPH4,{xcenter},{ycenter},{rad1},{rad2}" + return parse.parse_output_volume_area(self.run(command, **kwargs)) + + def sph5( + self, + xedge1: str = "", + yedge1: str = "", + xedge2: str = "", + yedge2: str = "", + **kwargs, + ): + r"""Creates a spherical volume by diameter end points. + + Mechanical APDL Command: `SPH5 `_ + + Parameters + ---------- + xedge1 : str + Working plane X and Y coordinates of one edge of the sphere. + + yedge1 : str + Working plane X and Y coordinates of one edge of the sphere. + + xedge2 : str + Working plane X and Y coordinates of the other edge of the sphere. + + yedge2 : str + Working plane X and Y coordinates of the other edge of the sphere. + + Returns + ------- + int + Volume number of the sphere. + + Notes + ----- + + .. _SPH5_notes: + + Defines a solid spherical volume anywhere on the working plane by specifying diameter end points. + The sphere must have a spatial volume greater than zero. (that is, this volume primitive command + cannot be used to create a degenerate volume as a means of creating an area.) A sphere of 360° will + be defined with two areas, each consisting of a hemisphere. See the :ref:`sphere` and :ref:`sph4` + commands for other ways to create spheres. + + Examples + -------- + This example creates a sphere with one point at ``(1, 1)`` and + one point at ``(2, 2)`` + + >>> vnum = mapdl.sph5(xedge1=1, yedge1=1, xedge2=2, yedge2=2) + >>> vnum + 1 + """ + command = f"SPH5,{xedge1},{yedge1},{xedge2},{yedge2}" + return parse.parse_output_volume_area(self.run(command, **kwargs)) + + def sphere( + self, + rad1: str = "", + rad2: str = "", + theta1: str = "", + theta2: str = "", + **kwargs, + ): + r"""Creates a spherical volume centered about the working plane origin. + + Mechanical APDL Command: `SPHERE `_ + + Parameters + ---------- + rad1 : str + Inner and outer radii (either order) of the sphere. A value of zero or blank for either ``RAD1`` + or ``RAD2`` defines a solid sphere. + + rad2 : str + Inner and outer radii (either order) of the sphere. A value of zero or blank for either ``RAD1`` + or ``RAD2`` defines a solid sphere. + + theta1 : str + Starting and ending angles (either order) of the sphere. Used for creating a spherical sector. + The sector begins at the algebraically smaller angle, extends in a positive angular direction, + and ends at the larger angle. The starting angle defaults to 0.0° and the ending angle defaults + to 360.0°. See the `Modeling and Meshing Guide + `_ for an + illustration. + + theta2 : str + Starting and ending angles (either order) of the sphere. Used for creating a spherical sector. + The sector begins at the algebraically smaller angle, extends in a positive angular direction, + and ends at the larger angle. The starting angle defaults to 0.0° and the ending angle defaults + to 360.0°. See the `Modeling and Meshing Guide + `_ for an + illustration. + + Returns + ------- + int + Volume number of the sphere. + + Notes + ----- + + .. _SPHERE_notes: + + Defines either a solid or hollow sphere or spherical sector centered about the working plane origin. + The sphere must have a spatial volume greater than zero. (that is, this volume primitive command + cannot be used to create a degenerate volume as a means of creating an area.) Inaccuracies can + develop when the size of the object you create is much smaller than the relative coordinate system + values (ratios near to or greater than 1000). If you require an exceptionally small sphere, create a + larger object, and scale it down to the appropriate size. + + For a solid sphere of 360°, you define it with two areas, each consisting of a hemisphere. See the + :ref:`sph4` and :ref:`sph5` commands for the other ways to create spheres. + + Examples + -------- + >>> vnum = mapdl.sphere(rad1=0.95, rad2=1.0, theta1=90, theta2=270) + >>> vnum + 1 + """ + command = f"SPHERE,{rad1},{rad2},{theta1},{theta2}" + return parse.parse_output_volume_area(self.run(command, **kwargs)) + + def torus( + self, + rad1: str = "", + rad2: str = "", + rad3: str = "", + theta1: str = "", + theta2: str = "", + **kwargs, + ): + r"""Creates a toroidal volume. + + Mechanical APDL Command: `TORUS `_ + + Parameters + ---------- + rad1 : str + Three values that define the radii of the torus. You can specify the radii in any order. The + smallest of the values is the inner minor radius, the intermediate value is the outer minor + radius, and the largest value is the major radius. (There is one exception regarding the order + of the radii values--if you want to create a solid torus, specify zero or blank for the inner + minor radius, in which case the zero or blank must occupy either the ``RAD1`` or ``RAD2`` + position.) At least two of the values that you specify must be positive values; they will be + used to define the outer minor radius and the major radius. See the diagram in the Notes section + for a view of a toroidal sector showing all radii. + + rad2 : str + Three values that define the radii of the torus. You can specify the radii in any order. The + smallest of the values is the inner minor radius, the intermediate value is the outer minor + radius, and the largest value is the major radius. (There is one exception regarding the order + of the radii values--if you want to create a solid torus, specify zero or blank for the inner + minor radius, in which case the zero or blank must occupy either the ``RAD1`` or ``RAD2`` + position.) At least two of the values that you specify must be positive values; they will be + used to define the outer minor radius and the major radius. See the diagram in the Notes section + for a view of a toroidal sector showing all radii. + + rad3 : str + Three values that define the radii of the torus. You can specify the radii in any order. The + smallest of the values is the inner minor radius, the intermediate value is the outer minor + radius, and the largest value is the major radius. (There is one exception regarding the order + of the radii values--if you want to create a solid torus, specify zero or blank for the inner + minor radius, in which case the zero or blank must occupy either the ``RAD1`` or ``RAD2`` + position.) At least two of the values that you specify must be positive values; they will be + used to define the outer minor radius and the major radius. See the diagram in the Notes section + for a view of a toroidal sector showing all radii. + + theta1 : str + Starting and ending angles (either order) of the torus. Used for creating a toroidal sector. The + sector begins at the algebraically smaller angle, extends in a positive angular direction, and + ends at the larger angle. The starting angle defaults to 0° and the ending angle defaults to + 360°. + + theta2 : str + Starting and ending angles (either order) of the torus. Used for creating a toroidal sector. The + sector begins at the algebraically smaller angle, extends in a positive angular direction, and + ends at the larger angle. The starting angle defaults to 0° and the ending angle defaults to + 360°. + + Returns + ------- + int + Volume number of the torus. + + Notes + ----- + + .. _TORUS_notes: + + Defines a toroidal volume centered about the working plane origin. A solid torus of 360° will be + defined with four areas, each area spanning 180° around the major and minor circumference. + + To create the toroidal sector shown below, the command :ref:`torus`,5,1,2,0,180 was issued. Since + "1" was the smallest radii value specified, it defined the inner minor radius; since "2" was the + intermediate radii value specified, it defined the outer minor radius; and since "5" was the largest + radii value specified, it defined the major radius. The values "0" and "180" defined the starting + and ending angles of the torus. + + .. figure:: ../../../images/_commands/gTORU1.svg + + Examples + -------- + This example creates a torus with an inner minor radius of 1, an + intermediate radii of 2, and a major radius of 5. The values + 0 and 180 define the starting and ending angles of the torus. + + >>> vnum = mapdl.torus(rad1=5, rad2=1, rad3=2, theta1=0, theta2=180) + >>> vnum + 1 + """ + command = f"TORUS,{rad1},{rad2},{rad3},{theta1},{theta2}" + return parse.parse_output_volume_area(self.run(command, **kwargs)) diff --git a/src/ansys/mapdl/core/_commands/prep7/real_constants.py b/src/ansys/mapdl/core/_commands/prep7/real_constants.py new file mode 100644 index 00000000000..36db85f3367 --- /dev/null +++ b/src/ansys/mapdl/core/_commands/prep7/real_constants.py @@ -0,0 +1,371 @@ +# 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 RealConstants: + + def r( + self, + nset: str = "", + r1: str = "", + r2: str = "", + r3: str = "", + r4: str = "", + r5: str = "", + r6: str = "", + **kwargs, + ): + r"""Defines the element real constants. + + Mechanical APDL Command: `R `_ + + Parameters + ---------- + nset : str + Real constant set identification number (arbitrary). If same as a previous set number, set is + redefined. Set number relates to that defined with the element ( :ref:`real` ). Note that the + GUI automatically assigns this value. + + r1 : str + Real constant values (interpreted as area, moment of inertia, thickness, etc., as required for + the particular element type using this set), or table names for tabular input of boundary + conditions. Use :ref:`rmore` command if more than six real constants per set are to be input. + + r2 : str + Real constant values (interpreted as area, moment of inertia, thickness, etc., as required for + the particular element type using this set), or table names for tabular input of boundary + conditions. Use :ref:`rmore` command if more than six real constants per set are to be input. + + r3 : str + Real constant values (interpreted as area, moment of inertia, thickness, etc., as required for + the particular element type using this set), or table names for tabular input of boundary + conditions. Use :ref:`rmore` command if more than six real constants per set are to be input. + + r4 : str + Real constant values (interpreted as area, moment of inertia, thickness, etc., as required for + the particular element type using this set), or table names for tabular input of boundary + conditions. Use :ref:`rmore` command if more than six real constants per set are to be input. + + r5 : str + Real constant values (interpreted as area, moment of inertia, thickness, etc., as required for + the particular element type using this set), or table names for tabular input of boundary + conditions. Use :ref:`rmore` command if more than six real constants per set are to be input. + + r6 : str + Real constant values (interpreted as area, moment of inertia, thickness, etc., as required for + the particular element type using this set), or table names for tabular input of boundary + conditions. Use :ref:`rmore` command if more than six real constants per set are to be input. + + Notes + ----- + + .. _R_notes: + + Defines the element real constants. The real constants required for an element are shown in the + Input Summary of each element description in the `Element Reference + `_. Constants + must be input in the same order + as shown in that table. If more than the required number of element real constants are specified in + a set, only those required are used. If fewer than the required number are specified, zero values + are assumed for the unspecified constants. + + If using table inputs ( ``COMBIN14``, ``FLUID116``, ``SURF151``, ``SURF152``, ``CONTA172``, + ``CONTA174``, ``CONTA175``, ``CONTA177``, and ``COMBI214`` only), enclose the table name in % signs + (for example, ``%tabname%`` ). + + When copying real constants to new sets, Ansys, Inc. recommends that you use the command + input. If you do use the GUI, restrict the real constant copy to only the first six real constants + (real constants seven and greater will be incorrect for both the master and copy set). + + This command is also valid in SOLUTION. + """ + command = f"R,{nset},{r1},{r2},{r3},{r4},{r5},{r6}" + return self.run(command, **kwargs) + + def rdele( + self, nset1: str = "", nset2: str = "", ninc: str = "", lchk: str = "", **kwargs + ): + r"""Deletes real constant sets. + + Mechanical APDL Command: `RDELE `_ + + Parameters + ---------- + nset1 : str + Delete real constant sets from ``NSET1`` to ``NSET2`` (defaults to ``NSET1`` ) in steps of + ``NINC`` (defaults to 1). If ``NSET1`` = ALL, ignore ``NSET2`` and ``NINC`` and all real + constant sets are deleted. + + nset2 : str + Delete real constant sets from ``NSET1`` to ``NSET2`` (defaults to ``NSET1`` ) in steps of + ``NINC`` (defaults to 1). If ``NSET1`` = ALL, ignore ``NSET2`` and ``NINC`` and all real + constant sets are deleted. + + ninc : str + Delete real constant sets from ``NSET1`` to ``NSET2`` (defaults to ``NSET1`` ) in steps of + ``NINC`` (defaults to 1). If ``NSET1`` = ALL, ignore ``NSET2`` and ``NINC`` and all real + constant sets are deleted. + + lchk : str + Specifies the level of element-associativity checking: + + * ``NOCHECK`` - No element-associativity check occurs. This option is the default. + + * ``WARN`` - When a section, material, or real constant is associated with an element, the program + issues a message warning that the necessary entity has been deleted. + + * ``CHECK`` - The command terminates, and no section, material, or real constant is deleted if it is + associated with an element. + + Notes + ----- + + .. _RDELE_notes: + + Deletes real constant sets defined with the :ref:`r` command. + + This command is also valid in SOLUTION. + """ + command = f"RDELE,{nset1},{nset2},{ninc},{lchk}" + return self.run(command, **kwargs) + + def rlist(self, nset1: str = "", nset2: str = "", ninc: str = "", **kwargs): + r"""Lists the real constant sets. + + Mechanical APDL Command: `RLIST `_ + + Parameters + ---------- + nset1 : str + List real constant sets from ``NSET1`` to ``NSET2`` (defaults to ``NSET1`` ) in steps of + ``NINC`` (defaults to 1). If ``NSET1`` = ALL (default), ignore ``NSET2`` and ``NINC`` and list + all real constant sets ( :ref:`r` ). + + nset2 : str + List real constant sets from ``NSET1`` to ``NSET2`` (defaults to ``NSET1`` ) in steps of + ``NINC`` (defaults to 1). If ``NSET1`` = ALL (default), ignore ``NSET2`` and ``NINC`` and list + all real constant sets ( :ref:`r` ). + + ninc : str + List real constant sets from ``NSET1`` to ``NSET2`` (defaults to ``NSET1`` ) in steps of + ``NINC`` (defaults to 1). If ``NSET1`` = ALL (default), ignore ``NSET2`` and ``NINC`` and list + all real constant sets ( :ref:`r` ). + + Notes + ----- + + .. _RLIST_notes: + + The real constant sets listed contain only those values specifically set by the user. Default values + for real constants set automatically within the various elements are not listed. + + This command is valid in any processor. + """ + command = f"RLIST,{nset1},{nset2},{ninc}" + return self.run(command, **kwargs) + + def rmodif( + self, + nset: str = "", + stloc: str = "", + v1: str = "", + v2: str = "", + v3: str = "", + v4: str = "", + v5: str = "", + v6: str = "", + **kwargs, + ): + r"""Modifies real constant sets. + + Mechanical APDL Command: `RMODIF `_ + + Parameters + ---------- + nset : str + Number of existing real constant set to be modified. + + The labels CONT and GCN are also valid input for defining or modifying real constants associated + with contact elements (see :ref:`Notes). ` + + stloc : str + Starting location in table for modifying data. For example, if ``STLOC`` = 1, data input in the + ``V1`` field is the first constant in the set. If ``STLOC`` = 7, data input in the ``V1`` field + is the seventh constant in the set, etc. Must be greater than zero. + + v1 : str + New values assigned to constants in the next five locations. If blank, the value remains + unchanged. + + v2 : str + New values assigned to constants in the next five locations. If blank, the value remains + unchanged. + + v3 : str + New values assigned to constants in the next five locations. If blank, the value remains + unchanged. + + v4 : str + New values assigned to constants in the next five locations. If blank, the value remains + unchanged. + + v5 : str + New values assigned to constants in the next five locations. If blank, the value remains + unchanged. + + v6 : str + New values assigned to constants in the next five locations. If blank, the value remains + unchanged. + + Notes + ----- + + .. _RMODIF_notes: + + Allows modifying (or adding) real constants to an existing set ( :ref:`r` ) at any location. + + Specify ``NSET`` = CONT to define or modify real constants for all real constant sets associated + with contact elements in pair-based contact definitions. Specify ``NSET`` = GCN to define or modify + real constants for real constant sets that were previously assigned by the :ref:`gcdef` command; + that is, real constants used in `general contact + `_ + interactions. + + This command is also valid in SOLUTION. For important information about using this command within + the solution phase, see in the `Advanced Analysis Guide + `_. + """ + command = f"RMODIF,{nset},{stloc},{v1},{v2},{v3},{v4},{v5},{v6}" + return self.run(command, **kwargs) + + def rmore( + self, + r7: str = "", + r8: str = "", + r9: str = "", + r10: str = "", + r11: str = "", + r12: str = "", + **kwargs, + ): + r"""Adds real constants to a set. + + Mechanical APDL Command: `RMORE `_ + + Parameters + ---------- + r7 : str + Add real constants 7 to 12 (numerical values or table names) to the most recently defined set. + + r8 : str + Add real constants 7 to 12 (numerical values or table names) to the most recently defined set. + + r9 : str + Add real constants 7 to 12 (numerical values or table names) to the most recently defined set. + + r10 : str + Add real constants 7 to 12 (numerical values or table names) to the most recently defined set. + + r11 : str + Add real constants 7 to 12 (numerical values or table names) to the most recently defined set. + + r12 : str + Add real constants 7 to 12 (numerical values or table names) to the most recently defined set. + + Notes + ----- + + .. _RMORE_notes: + + Adds six more real constants to the most recently defined set. Repeat the :ref:`rmore` command for + constants 13 to 18, again for 19-24, etc. + + If using table inputs ( ``SURF151``, ``SURF152``, ``FLUID116``, ``CONTA172``, ``CONTA174``, + ``CONTA175``, and ``CONTA177`` only), enclose the table name in % signs (for example, ``%tabname%`` + ). + + When copying real constants to new sets, Ansys, Inc. recommends that you use the command + input. If you do use the GUI, restrict the real constant copy to only the first six real constants + (real constants seven and greater will be incorrect for both the master and copy set). + + This command is also valid in SOLUTION. + """ + command = f"RMORE,{r7},{r8},{r9},{r10},{r11},{r12}" + return self.run(command, **kwargs) + + def setfgap( + self, + gap: str = "", + ropt: int | str = "", + pamb: str = "", + acf1: str = "", + acf2: str = "", + pref: str = "", + mfp: str = "", + **kwargs, + ): + r"""Updates or defines the real constant table for squeeze film elements. + + Mechanical APDL Command: `SETFGAP `_ + + Parameters + ---------- + gap : str + Gap separation. + + ropt : int or str + Real constant set option. + + * ``0`` - Creates separate real constant sets for each selected element with the specified real + constant values (default). + + * ``1`` - Updates existing real constant sets. The gap separation is updated from displacement + results in the database. Other real constants are updated as specified in the command input + parameters. + + pamb : str + Ambient pressure. + + acf1 : str + Accommodation factor 1 and 2. + + acf2 : str + Accommodation factor 1 and 2. + + pref : str + Reference pressure for mean free path. + + mfp : str + Mean free path. + + Notes + ----- + + .. _SETFGAP_notes: + + This command is used for large signal cases to update the gap separation real constant on a per- + element basis. Issue this command prior to solution using the default ``ROPT`` value to initialize + real constant sets for every fluid element. After a solution, you can re-issue the command to update + the real constant set for a subsequent analysis. See for more information on thin film analyses. + """ + command = f"SETFGAP,{gap},{ropt},,{pamb},{acf1},{acf2},{pref},{mfp}" + return self.run(command, **kwargs) diff --git a/src/ansys/mapdl/core/_commands/prep7/special_purpose.py b/src/ansys/mapdl/core/_commands/prep7/special_purpose.py new file mode 100644 index 00000000000..831d6ad1fe3 --- /dev/null +++ b/src/ansys/mapdl/core/_commands/prep7/special_purpose.py @@ -0,0 +1,2273 @@ +# 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 adpci( + self, + action: str = "", + par1: str = "", + par2: str = "", + par3: str = "", + par4: str = "", + par5: str = "", + par6: str = "", + par7: str = "", + par8: str = "", + **kwargs, + ): + r"""Defines parameters associated with adaptive crack initiation. + + Mechanical APDL Command: `ADPCI `_ + + Parameters + ---------- + action : str + Specifies action for defining or manipulating initial crack data: + + * ``DEFINE`` - `Command Specification for Action= DEFINE + `_ Initiate a new + adaptive-crack calculation and assign an ID. + + * ``GEOM`` - `Command Specifications for Action= GEOM + `_ Define the + geometry data for initializing a crack. + + * ``DELE`` - `Command Specifications for Action= DELE + `_ Delete the + :ref:`adpci` data set associated with the specified ID. + + * ``LIST`` - `Command Specifications for Action= LIST + `_ List the + :ref:`adpci` data set associated with the specified ID. + + par1 : str + The description of the argument is missing in the Python function. Please, refer to the `command + documentation + `_ for further + information. + + par2 : str + The description of the argument is missing in the Python function. Please, refer to the `command + documentation + `_ for further + information. + + par3 : str + The description of the argument is missing in the Python function. Please, refer to the `command + documentation + `_ for further + information. + + par4 : str + The description of the argument is missing in the Python function. Please, refer to the `command + documentation + `_ for further + information. + + par5 : str + The description of the argument is missing in the Python function. Please, refer to the `command + documentation + `_ for further + information. + + par6 : str + The description of the argument is missing in the Python function. Please, refer to the `command + documentation + `_ for further + information. + + par7 : str + The description of the argument is missing in the Python function. Please, refer to the `command + documentation + `_ for further + information. + + par8 : str + The description of the argument is missing in the Python function. Please, refer to the `command + documentation + `_ for further + information. + + Other Parameters + ---------------- + **Command Specification for Action= DEFINE** + + .. _adpci_define: + + * ``Par1`` - :ref:`adpci` ID number. + + * ``Par2`` - Surface-node component name for defining the crack-initiation zone (must be 32 + characters or less). + + * ``Par3`` - Material ID for defining the crack-initiation criterion. + + * ``Par4`` - Shape of the initialized crack: + + * ELLIPSE - Elliptical crack shape (default, and the only valid value). + + **Command Specifications for Action= GEOM** + + .. _adpci_geom: + + * ``Par1`` - :ref:`adpci` ID number. + + * ``Par2`` - Crack geometry characteristic to define: + + * CENTER - Specify the ellipse center location. + * AXES - Specify the directions of the two ellipse axes. + * ALEN - Specify the lengths of two ellipse axes. This value is required when AXES or LCS is + specified. + * LCS - Local coordinate system number for defining the ellipse center location and axes directions. + See :ref:`adpci_notes` below. + + * ``Par3`` - The first value to assign to the geometry characteristic specified via ``Par2`` : + + * If ``Par2`` = CENTER, the X coordinate of the ellipse center. + * If ``Par2`` = AXES, the X component of the first ellipse axis direction. + * If ``Par2`` = ALEN, the length of the first ellipse axis. + * If ``Par2`` = LCS, the local coordinate system number. + + * ``Par4`` - The second value to assign to the geometry characteristic specified via ``Par2`` : + + * If ``Par2`` = CENTER, the Y coordinate of the ellipse center. + * If ``Par2`` = AXES, the Y component of the first ellipse axis direction. + * If ``Par2`` = ALEN, the length of the second ellipse axis. + + * ``Par5`` - The third value to assign to the geometry characteristic specified via ``Par2`` : + + * If ``Par2`` = CENTER, the Z coordinate of the ellipse center. + * If ``Par2`` = AXES, the Z component of the first ellipse axis direction. + + * ``Par6`` - The fourth value to assign to the geometry characteristic specified via ``Par2`` : + + * If ``Par2`` = AXES, the X component of the second ellipse axis direction. + + * ``Par7`` - The fifth value to assign to the geometry characteristic specified via ``Par2`` : + + * If ``Par2`` = AXES, the Y component of the second ellipse axis direction. + + * ``Par8`` - The sixth value to assign to the geometry characteristic specified via ``Par2`` : + + * If ``Par2`` = AXES, the Z component of the second ellipse axis direction. + + **Command Specifications for Action= DELE** + + .. _adpci_dele: + + * ``Par1`` - :ref:`adpci` ID (default = ALL). + + **Command Specifications for Action= LIST** + + .. _adpci_ncontour: + + * ``Par1`` - :ref:`adpci` ID number (default = ALL). + + Notes + ----- + + .. _adpci_notes: + + For :ref:`adpci`,GEOM,LCS, the ellipse center locates at the origin of the local coordinate system. + The local coordinate system Y axis defines the plane normal of the ellipse, and X and Z axes define + two orientations of the ellipse. (The LCS argument is equivalent to combining the CENTER and AXES + arguments. Separate :ref:`adpci`,GEOM commands to specify those arguments are therefore not issued.) + + For more information about using :ref:`adpci` in a crack-initiation analysis, see `SMART Method for + Crack-Initiation Simulation + `_ + """ + command = ( + f"ADPCI,{action},{par1},{par2},{par3},{par4},{par5},{par6},{par7},{par8}" + ) + return self.run(command, **kwargs) + + def aerocoeff( + self, + aeromodetype: str = "", + aeromappedfilenames: str = "", + aerospecs: str = "", + aeroscalar: str = "", + nblades: str = "", + autofileread: str = "", + **kwargs, + ): + r"""Computes the aero-damping and stiffness coefficients and writes them to an APDL array. + + Mechanical APDL Command: `AEROCOEFF `_ + + **Command default:** + + .. _AEROCOEFF_default: + + No defaults are available for the :ref:`aerocoeff` command. + + Parameters + ---------- + aeromodetype : str + Mode type to be used. + + * ``BLADE`` - Non-cyclic cantilevered blade mode (default) + + aeromappedfilenames : str + The description of the argument is missing in the Python function. Please, refer to the `command + documentation + `_ for + further information. + + aerospecs : str + Name of numerical array containing data organized to correspond to the ``AeroMappedFiles`` + array. See the :ref:`AEROCOEFF_notes` section for specific information that must be in the + array. + + aeroscalar : str + Scaling value(s) to handle any modal scaling difference between structural and CFD modes. The + values can be entered as a scalar or 1-dimensional array. (each scaling value defaults to 1) + + nblades : str + Number of blades. + + autofileread : str + Key to automatically read and use values from CFD file header. + + * ``0 (OFF or NO)`` - Do not read scaling values or nodal diameter from the CFD file header. + (default) + + * ``1 (ON or YES)`` - Read scaling values (labeled ``Mode Multiplier`` in CFD file) from CFD file + header. The scaling values read will be used in calculations and the ``AeroScalar`` input will be + ignored. The nodal diameter values will be used to cross check the value of i (input through + ``AeroSpecs`` array). + + Notes + ----- + + .. _AEROCOEFF_notes: + + The :ref:`aerocoeff` command is designed to `generate an array of aerodynamic coefficients + `_ + that can be used in a cyclic mode-superposition harmonic response analysis using the :ref:`cycfreq` + ,AERO command to represent aerodynamic stiffness and damping. These aerodynamic coefficients can + also be used in a damped modal analysis phase ( :ref:`cycfreq`,MODAL) of a cyclic mode- + superposition harmonic solve. An APDL array called ``Jobname`` AeroArray is generated using the + :ref:`aerocoeff` command. This array is compatible with the array needed for the :ref:`cycfreq`,AERO + command. + + The format of the written array follows that of the :ref:`cycfreq`,AERO command. The array is + formatted as follows: + + .. math:: + + equation not available + + where + + * :math:`equation not available` = the i :sup:`th` interblade phase angle (IBPA) + * :math:`equation not available` = the m :sup:`th` vibrating blade mode + * :math:`equation not available` = the n :sup:`th` blade mode generating the pressure oscillations + * :math:`equation not available` and :math:`equation not available` = the real and imaginary + coefficients. + + Prior to issuing the :ref:`aerocoeff` command, a non-cyclic cantilevered blade modal analysis must + be run, either stress-free or prestressed using linear perturbation. For more information, see + `Modal Analysis + `_ + :ref:`aerocoeff` command are the same as those needed for modal restart as described in `Modal + Analysis Restart + `_ + + The ``AeroSpecs`` values are specified in a 3×r array ( :ref:`dim` ), wherer is a positive integer + equal to the number of interblade phase angles and the pressure modes solved for in the CFD + analysis. Each row has the structure: + + .. math:: + + equation not available + + where + + * :math:`equation not available` = the i :sup:`th` interblade phase angle (IBPA) + * :math:`equation not available` = the m :sup:`th` vibrating blade mode + * :math:`equation not available` = the n :sup:`th` blade mode generating the pressure oscillations + At least one aerodynamic damping coefficient must be specified for each IBPA (equal to the number of + blades) while keeping + :math:`equation not available` and :math:`equation not available` constant. If a value is not specified, the program writes an array value of zero for both :math:`equation not available` and :math:`equation not available`. The values of :math:`equation not available` and :math:`equation not available` are relative to the modes computed in the required modal analysis. + + The number of ``AeroScalar`` values must be equal to the number of pressure modes ( :math:`equation + not available` from ``AeroSpecs`` ). If the number of ``AeroScalar`` values is greater than 1, the + values must be entered by defining an :math:`equation not available` array ( :ref:`dim` ) and + entering the array name in the ``AeroScalar`` field. For a discussion of how ``AeroScalar`` values + are computed, see `Scaling Aerodynamic Coupling Coefficients + `_ + + The value for ``nBlades`` should be equal to the number of sectors of the system. If there are + multiple blades per cyclic sector, then the combination of blades on the single sector will have an + aero coefficient value. In this case, each blade will not have a distinct aero coefficient. + """ + command = f"AEROCOEFF,{aeromodetype},{aeromappedfilenames},{aerospecs},{aeroscalar},{nblades},{autofileread}" + return self.run(command, **kwargs) + + def cint( + self, + action: str = "", + par1: str = "", + par2: str = "", + par3: str = "", + par4: str = "", + par5: str = "", + par6: str = "", + par7: str = "", + **kwargs, + ): + r"""Defines parameters associated with fracture-parameter calculations. + + Mechanical APDL Command: `CINT `_ + + Parameters + ---------- + action : str + Specifies action for defining or manipulating initial crack data: + + * ``NEW`` - `Command Specification for Action= NEW + `_ Initiate a new + calculation and assign an ID. + + * ``CTNC`` - `Command Specifications for Action= CTNC + `_ Define the + crack-tip node component. + + * ``SURF`` - `Command Specifications for Action= SURF + `_ Define the + crack-surface node components. + + * ``CENC`` - `Command Specifications for Action= CENC + `_ Define the + crack-extension node component, the crack-tip node, and the crack-extension direction. + + * ``TYPE`` - `Command Specifications for Action= TYPE + `_ Define the type + of calculation to perform. + + * ``DELE`` - `Command Specifications for Action= DELE + `_ Delete the + :ref:`cint` object associated with the specified ID. + + * ``NCON`` - `Command Specifications for Action= NCON + `_ Specify the + number of contours to calculate in the contour-integral calculation. + + * ``SYMM`` - `Command Specifications for Action= SYMM + `_ Indicate whether + the crack is on a symmetrical line or plane. + + * ``NORM`` - `Command Specifications for Action= NORM + `_ Define the + crack-plane normal. + + * ``UMM`` - `Command Specifications for Action= UMM + `_ Enable or + disable the unstructured-mesh method (UMM). + + * ``EDIR`` - `Command Specifications for Action= EDIR + `_ Crack-assist + extension direction. + + * ``PLOT`` - `Command Specifications for Action= PLOT + `_ Plots the crack- + front and crack-tip coordinate system. + + * ``LIST`` - `Command Specifications for Action= LIST `_ List the **CINT** commands issued, or the elements used, in fracture-parameter calculations. + + * ``CXFE`` - `Command Specifications for Action= CXFE + `_ Define the + crack-tip element or crack-front element set. Valid for `XFEM-based crack-growth + `_ + analysis only. + + * ``RADIUS`` - `Command Specifications for Action= RADIUS + `_ Define the + radius at which the given value is to be evaluated. Valid for XFEM-based crack-growth analysis only. + + * ``RSWEEP`` - `Command Specifications for Action= RSWEEP + `_ Define the + minimum and maximum sweep angle from existing crack direction. Valid for XFEM-based crack-growth + analysis only. + + * ``INIT`` - `Command Specifications for Action= INIT + `_ SMART crack- + initiation ID. + + * ``CSFL`` - `Command Specifications for Action= CSFL + `_ Convert initial- + stress data to crack-surface traction loading. + + par1 : str + The description of the argument is missing in the Python function. Please, refer to the `command + documentation + `_ for further + information. + + par2 : str + The description of the argument is missing in the Python function. Please, refer to the `command + documentation + `_ for further + information. + + par3 : str + The description of the argument is missing in the Python function. Please, refer to the `command + documentation + `_ for further + information. + + par4 : str + The description of the argument is missing in the Python function. Please, refer to the `command + documentation + `_ for further + information. + + par5 : str + The description of the argument is missing in the Python function. Please, refer to the `command + documentation + `_ for further + information. + + par6 : str + The description of the argument is missing in the Python function. Please, refer to the `command + documentation + `_ for further + information. + + par7 : str + The description of the argument is missing in the Python function. Please, refer to the `command + documentation + `_ for further + information. + + Other Parameters + ---------------- + **Command Specification for Action= NEW** + + .. _cint_new: + + * ``Par1`` - :ref:`cint` ID number. + + **Command Specifications for Action= CTNC** + + .. _cint_ctncomp: + + * ``Par1`` - Crack-tip node component name (must be 32 characters or less). + + * ``Par2`` - Crack-extension direction calculation-assist node. Any node on the open side of the + crack. + + * ``Par3`` - Crack front``s end-node crack-extension direction override flag: + + * ``0`` - Align the extension direction with the edges attached at the two end nodes of the crack + front (default). + + * ``1`` - Align the extension direction to be perpendicular to the crack front. + + **Command Specifications for Action= SURF** + + .. _cint_ctnsurf: + + * ``Par1`` - Crack-surface node component 1 (top or bottom crack face). (Component name must be 32 + characters or less.) + + * ``Par2`` - Crack-surface node component 2 (top or bottom crack face, but the opposite of ``Par1`` + ). (Component name must be 32 characters or less.) + + **Command Specifications for Action= CENC** + + .. _cint_cencomp: + + * ``Par1`` - Crack-extension node component name ( :ref:`cm` ). (Must be 32 characters or less.) + + * ``Par2`` - Crack-tip node. The crack-tip node defaults to the first node of the crack-extension + node component. + + * ``Par3, Par4`` - Coordinate system number ( ``Par3`` ) and the number of the axis that is + coincident with the crack direction ( ``Par4`` ). When these parameters are defined, ``Par5``, + ``Par6`` and ``Par7`` are ignored. + + * ``Par5, Par6, Par7`` - Global x, y, and z components of the crack-extension direction vector. ( + ``Par3`` and ``Par4`` must be blank.) + + **Command Specifications for Action= TYPE** + + .. _cint_type: + + * ``Par1`` - Type of calculation to perform: + + * ``JINT`` - Calculate `J-integral + `_ + (default). + + * ``SIFS`` - Calculate `stress-intensity factors + `_. + + * ``TSTRESS`` - Calculate `T-stress + `_. + + * ``MFOR`` - Calculate `material forces + `_. + + * ``CSTAR`` - Calculate `C\2-integral + `_. + + * ``VCCT`` - Calculate `energy-release rate + `_ + using the VCCT method. + + * ``PSMAX`` - Calculate circumferential stress at the location where :math:`equation not available` + when sweeping around the crack tip at the given radius. Valid + in an `XFEM- based crack-growth + `_ + analysis only. + + * ``STTMAX`` - Calculate maximum circumferential stress when sweeping around the crack tip at the + given radius. Valid in an XFEM-based crack-growth analysis only. + + * ``Par2`` - Auxiliary stress fields and strategy for **3D** `stress-intensity factors + `_ + ( ``Par1`` = SIFS) calculations: + + * ``0`` - The plane-strain auxiliary fields are used at the interior nodes along the crack front. + The stress- intensity factors at the end nodes of the crack front are set to copy the stress- + intensity factors at the adjacent nodes. (Default.) + + * ``1`` - The plane-stress auxiliary fields are used over the entire crack front. + + * ``2`` - The plane-strain auxiliary fields are used over the entire crack front. + + **Command Specifications for Action= DELE** + + .. _cint_dele: + + * ``Par1`` - :ref:`cint` ID (default = ALL). + + **Command Specifications for Action= NCON** + + .. _cint_ncontour: + + * ``Par1`` - Number of contours to be calculated. + + **Command Specifications for Action= SYMM** + + .. _cint_symmetric: + + * ``Par1`` - * ``OFF, 0, or NO`` - No symmetry (default). + + * ``ON, 1, or YES`` - Symmetric about the crack line/plane. + + **Command Specifications for Action= UMM** + + .. _cint_umm: + + * ``Par1`` - * ``OFF, 0, or NO`` - Disable the `unstructured-mesh method (UMM) + `_ + (default). + + * ``ON, 1, or YES`` - Enable the UMM. + + **Command Specifications for Action= NORM** + + .. _cint_normal: + + * ``Par1`` - Coordinate system number (default = 0, global Cartesian). + + * ``Par2`` - Axis of coordinate system (default = 2, global Cartesian Y-axis). + + **Command Specifications for Action= EDIR** + + .. _cint_caextdir: + + * ``ITYPE`` - Input type for the crack-assist extension direction. Valid values are CS (coordinate + system number) or COMP (component x or y extension direction). + + * ``Par2`` - If ``ITYPE`` = CS, the coordinate system number. + + If ``ITYPE`` = COMP, the x component of the crack-assist extension direction. + + * ``Par3`` - If ``ITYPE`` is CS, the axis representing the crack-assist extension direction. + + If ``ITYPE`` = COMP, the y component of the crack-assist extension direction. + + * ``Par4`` - For ``ITYPE`` = CS, this value is not specified. + + For ``ITYPE`` = COMP, the z component of the crack-assist extension direction. + + * ``Par5`` - A reference node on the crack front attached to the crack-assist extension direction. + To accurately calculate and flip the crack-extension directions, the crack-assist extension + direction defined at this node is rotated as the tangent along the crack front rotates. This + capability is useful when the crack-extension directions vary by more than 180 degrees along the + crack front. + + **Command Specifications for Action= PLOT** + + .. _cint_plot: + + * ``Par1`` - Crack ID. + + * ``Par2`` - 0 -- Disable plotting of crack-tip coordinate system. + + 1 -- Enable plotting of crack-tip coordinate system (default). + + Color codes are white for the crack-extension direction, green for the crack normal, and red for the + direction tangential to the crack front. To clear or delete the plots, issue :ref:`annot`. + + **Command Specifications for Action= LIST** + + .. _cint_list: + + * ``CrackID`` - Crack ID. Default = ALL. + + * ``Par2`` - No value -- Lists the :ref:`cint` commands issued for the crack. ``Par3`` and ``Par4`` + are ignored. + + ELEM -- Lists the elements used in the fracture-parameter calculation. + + * ``Par3`` - Node number on the crack front/tip. Default = ALL. Valid only when ``Par2`` =ELEM. + + * ``Par4`` - Contour number around the crack front/tip. Default = ALL. Valid only when ``Par2`` + =ELEM. + + **Command Specifications for Action= CXFE** + + .. _cint_cxfe: + + * ``Par1`` - Crack-tip element number or crack-front component name. (Component name must be 32 + characters or less.) + + **Command Specifications for Action= RADIUS** + + .. _cint_radius: + + * ``Par1`` - Radius at which a value is evaluated (used with :ref:`cint`,TYPE,PSMAX or + :ref:`cint`,TYPE,STTMAX only). + + **Command Specifications for Action= RSWEEP** + + .. _cint_rsweep: + + * ``Par1`` - Number of intervals for the sweep. + + * ``Par2`` - Minimum angle of the sweep. + + * ``Par3`` - Maximum angle of the sweep + + **Command Specifications for Action= INIT** + + .. _cint_init: + + * ``Par1`` - :ref:`adpci` ID number. The data associated with the :ref:`adpci` ID is connected to + the :ref:`cint` data set to define `crack-initiation analysis + `_ + details (such as crack location and shape, initiation criteria, etc.). + + **Command Specifications for Action= CSFL** + + .. _cint_csfl: + + `Initial-stress + `_ data ( + mesh-independent ) are converted to a traction load acting on the crack-surfaces (specified via + :ref:`cint`,SURF). The traction is applied as a step load for all substeps. + + The initial-stress data points are specified at various spatial locations in the global Cartesian + coordinate system ( :ref:`csys` ). The data is required in the vicinity of the crack surfaces only. + The program interpolates the initial stress at the centroid of each element face of the crack + surfaces, then determines the equivalent traction at the element face based on its orientation. + + For more information, see and + + Notes + ----- + + .. _cint_notes: + + Initiate a new calculation via the ``Action`` = NEW parameter. Subsequent :ref:`cint` commands (with + parameters other than NEW) define the input required for the fracture-parameter calculations. + + The simplest method is to define crack information via ``Action`` = CTNC; however, this method + limits you to only one node for a given location along the crack front. Use the CTNC option only + when all nodes that define the crack front lie in a single plane. + + For ``Action`` = SURF, ``Par1`` and ``Par2`` can be the top or bottom crack-face node component. No + order is required, provided that if one value the top crach-face node component, the other must be + the bottom, and vice-versa. This option is valid only with :ref:`cgrow` for crack-growth simulation. + + To define crack information at multiple locations along the crack front, use ``Action`` = CENC. You + can issue :ref:`cint`,CENC, ``Par1``, etc. multiple times to define the crack-extension node + component, the crack tip, and the crack-extension directions at multiple locations along the crack + front. + + Although you can vary the sequence of your definitions, all specified crack-tip nodes must be at the + crack front, and no crack-tip node can be omitted. + + You can define the crack-extension direction directly by specifying either ``Action`` = CENC or + ``Action`` = NORM. + + The crack-assist extension direction ( ``Action`` = EDIR) provides a generic extension direction + when ``Action`` = CTNC. It helps to define crack-extension directions based on the connectivity of + the crack-front elements. For a 2D case when the crack tangent cannot be calculated, the program + uses the provided crack-assist extension direction directly. + + For an `XFEM-based crack-growth + `_ + analysis: + + * ``Action`` = CTNC, CENC, NCON, SYMM, UMM, or EDIR have no effect. + + * ``Action`` = CXFE, RADIUS, or RSWEEP are XFEM-specific and invalid for any other type of crack- + growth analysis. + + * For :ref:`cint`,TYPE, only ``Par1`` = PSMAX or STTMAX are valid. Other ``Par1`` values have no + effect. + + The stress-intensity factors calculation ( :ref:`cint`,TYPE,SIFS) applies only to isotropic linear + elasticity. Use only one material type for the crack-tip elements that are used for the + calculations. + + When calculating energy release rates ( :ref:`cint`,TYPE,VCCT), do not restrict the results from + being written to the database ( :ref:`config`,NOELDB,1) after solution processing; otherwise, + incorrect and potentially random results are possible. + + Fracture-parameter calculations based on domain integrations such as stress-intensity factors, + J-integral, or material force are not supported when contact elements exist inside the domain. The + calculations may become path-dependent unless the contact pressure is negligible. + + For ``Action`` = UMM, the default value can be OFF or ON `depending on the element type + `_. + The :ref:`cint` command overrides the default setting for the given element. + + The :ref:`cint` command supports only strain data for initial state ( + :ref:`inistate`,SET,DTYP,EPEL). Other initial-state capabilities are not supported. + + For more information about using the :ref:`cint` command, including supported element types and + material behavior, see `Calculating Fracture Parameters + `_ + """ + command = f"CINT,{action},{par1},{par2},{par3},{par4},{par5},{par6},{par7}" + return self.run(command, **kwargs) + + def cycexpand( + self, + wn: str = "", + option: str = "", + value1: str = "", + value2: str = "", + **kwargs, + ): + r"""Graphically expands displacements, stresses and strains of a cyclically symmetric model. + + Mechanical APDL Command: `/CYCEXPAND `_ + + Parameters + ---------- + wn : str + The window number to which the expansion applies. Valid values are 1 through 5. The default + value is 1. The window number applies only to the AMOUNT argument. + + option : str + One of the following options: + + * ``ON`` - Activates cyclic expansion using the previous settings (if any). If no previous settings + exist, this option activates the default settings. This option is default. + + * ``DEFAULT`` - Resets cyclic expansion to the default settings. + + * ``OFF`` - Deactivates cyclic expansion. + + * ``STATUS`` - Lists the current cyclic expansion settings. + + * ``AMOUNT`` - The number of repetitions or the total angle. + + * ``Value1`` - NREPEAT + + * ``Value2`` - The number of repetitions. The default is the total number of sectors in 360 degrees. + + or + + * ``Value1`` - ANGLE + + * ``Value2`` - The total angle in degrees. The default is 360. + + * ``WHAT`` - A specified portion or subset of the model to expand: + + * ``Value1`` - The component name of the elements to expand. The default is all selected components. + + * ``EDGE`` - Sector edge display key. Possible ``Value1`` settings are: + + * ``-1`` - Suppresses display of edges between sectors even if the cyclic count varies between active windows. + This setting is not valid for cyclic mode-superposition (MSUP) harmonic analyses. + + .. warning:: + + Plots with fewer than the maximum number of repetitions may have missing element faces at the + sector boundaries. + * ``0 or OFF`` - Averages stresses or strains across sector boundaries. This value is the default + (although the default reverts to 1 or ON if the cyclic count varies between active windows). + + * ``1 or ON`` - No averaging of stresses or strains occurs, and sector boundaries are shown on the + plot. This setting is not valid for cyclic MSUP harmonic analyses. + + * ``PHASEANG`` - Possible ``Value1`` settings are: + + * ``n`` - The phase angle shift in degrees. The valid range for ``n`` is 0 through 360. The default + is 0. For a modal solution, this value is typically the phase angle obtained via the :ref:`cycphase` + command. The expanded modal results are printed or displayed for the specified phase angle shift. + + * ``AMPLITUDE (or, n ≥ 360)`` - The amplitude is reported, except for the following circumstances where the amplitude solution is + not valid: + + * non-component results (such as equivalent stress) + + * modal analyses (no amplitude is calculated, and the expanded modal results are printed or + displayed at a phase angle of 360º). + + * ``SWEEP`` - For a mode-superposition harmonic solution, the maximum values across a phase angle + sweep are reported. + + value1 : str + The description of the argument is missing in the Python function. Please, refer to the `command + documentation + `_ for + further information. + + value2 : str + The description of the argument is missing in the Python function. Please, refer to the `command + documentation + `_ for + further information. + + Notes + ----- + + .. _s-CYCEXPAND_notes: + + In preprocessing, the :ref:`cycexpand` command verifies a cyclically symmetric model by graphically + expanding it partially or through the full 360 degrees. + + For the postprocessing plot nodal solution ( :ref:`plnsol` ) operation, the command graphically + expands displacements, stresses and strains of a cyclically symmetric model partially or though the + full 360 degrees by combining the real (original nodes and elements) and imaginary (duplicate nodes + and elements) parts of the solution. + + For the print nodal solution ( :ref:`prnsol` ) operation, the command expands the printed output of + displacements or stresses on a sector-by-sector basis. To learn more about specific :ref:`prnsol` + behaviors in cyclic analyses, see `Using the /CYCEXPAND Command + `_ + + Use of the :ref:`cycexpand` command does not change the database. The command does not modify the + geometry, nodal displacements or element stresses. + + The command affects element and result plots only. It has no effect on operations other than plot + element solution ( :ref:`plesol` ), plot nodal solution ( :ref:`plnsol` ), print nodal solution ( + :ref:`prnsol` ), and calculate harmonic solution ( :ref:`cyccalc` ). Operations other than + :ref:`plesol`, :ref:`plnsol`, :ref:`prnsol`, or :ref:`cyccalc` work on the unprocessed real and + imaginary parts of a cyclic symmetry solution + + If you issue a :ref:`cycexpand`, OFF command, you cannot then expand the model by simply issuing + another :ref:`cycexpand` command (for example, to specify an NREPEAT value for the number of + repetitions). In such a case, you must specify :ref:`cycexpand`, ON, which activates expansion using + the previous settings (if any) or the default settings. + + The command requires PowerGraphics and will turn PowerGraphics on ( :ref:`graphics`, POWER ) if not + already active. Any setting which bypasses PowerGraphics (for example, :ref:`pbf` ) also bypasses + cyclic expansion; in such cases, the :ref:`cycexpand` command displays unprocessed real and + imaginary results. + + The :ref:`cycphase` command uses full model graphics ( :ref:`graphics`, FULL ) to compute peak + values. Because of this, there may be slight differences between max/min values obtained with + :ref:`cycphase`, and those obtained via :ref:`cycexpand`, which uses power graphics ( + :ref:`graphics`, POWER ). + + For PHASEANG = AMPLITUDE (or 360) with a cyclic full harmonic solution, the only appropriate + coordinate system is the solution coordinate system ( :ref:`rsys`,SOLU). + + Load case operations ( :ref:`lcoper` ) are not valid during a cyclic expansion using + :ref:`cycexpand`. + + To learn more about analyzing a cyclically symmetric structure, see the `Cyclic Symmetry Analysis + Guide `_. + """ + command = f"/CYCEXPAND,{wn},{option},{value1},{value2}" + return self.run(command, **kwargs) + + def cycfreq( + self, + option: str = "", + value1: str = "", + value2: str = "", + value3: str = "", + value4: str = "", + value5: str = "", + **kwargs, + ): + r"""Specifies solution options for a cyclic symmetry mode-superposition harmonic analysis. + + Mechanical APDL Command: `CYCFREQ `_ + + **Command default:** + + .. _CYCFREQ_default: + + No defaults are available for the :ref:`cycfreq` command. You must specify an ``Option`` label when + issuing this command. Other values which may be necessary depend upon which ``Option`` label you + specify. + + Parameters + ---------- + option : str + One of the following options: + + * ``AERO`` - Specify the array containing the aerodynamic damping coefficients. + + * ``Value1`` - The name of the array containing the aerodynamic stiffness damping coefficients. + + * ``BLADE`` - Blade information required for a mistuning or aerodamping analysis. + + * ``Value1`` - The name of the nodal component containing the blade boundary nodes at the blade-to- + disk interface. Also include boundary nodes at any shroud interfaces. + + * ``Value2`` - The name of the element component containing the blade elements. + + * ``Value3`` - The number of blade modes to include in the CMS reduction. + + * ``Value4`` - The lower bound of the frequency range of interest. This value is optional. + + * ``Value5`` - The upper bound of the frequency range of interest. This value is optional. + + * ``DEFAULT`` - Set the default cyclic harmonic solution settings. + + * ``EO`` - Excitation engine order. + + * ``Value1`` - An integer value indicating the the excitation order. The loadings on the other + sectors will be related to the loading on the base sector based on the engine order phase shift. + + * ``Value2`` - The name of the Mechanical APDL array containing the modal forces corresponding to the modes + kept in the mode-superpostion analysis. + + * ``MIST`` - Mistuning parameters. + + * ``Value1`` - The type of mistuning: + + * ``K`` - Stiffness (frequency) mistuning + + * ``Value2`` - The name of the array containing the stiffness mistuning parameters. + + * ``MODAL`` - Specifies if a damped modal analysis should be performed on the reduced system. + + * ``Value1`` - On/Off key. + + * ``0 (OFF or NO)`` - No modal solution. Perform the harmonic solution. + + * ``1 (ON or YES)`` - Perform a damped modal analysis of the reduced system in order to obtain the + complex frequencies. The harmonic solution is not performed. + + * ``Value2`` - Number of modes for the damped modal analysis. + + * ``Value3`` - The beginning, or lower end, of the frequency range of interest (in Hz). + + * ``Value4`` - The ending, or upper end, of the frequency range of interest (in Hz). + + * ``RESTART`` - Defines the point at which to restart the harmonic analysis. + + * ``Value1`` - The restart point: + + * ``OFF`` - No restart (default) + + * ``SWEEP`` - Restart for a new frequency sweep range ( :ref:`harfrq` ) + + * ``MIST`` - Restart for new mistuning parameters (new mistuning arrays) + + * ``USER`` - Causes the program to call for a user-defined solution. + + * ``Value1-5`` - Values passed down to the user-defined solution. + + * ``STATUS`` - List the harmonic solution option settings active for the cyclic model. + + value1 : str + The description of the argument is missing in the Python function. Please, refer to the `command + documentation + `_ for + further information. + + value2 : str + The description of the argument is missing in the Python function. Please, refer to the `command + documentation + `_ for + further information. + + value3 : str + The description of the argument is missing in the Python function. Please, refer to the `command + documentation + `_ for + further information. + + value4 : str + The description of the argument is missing in the Python function. Please, refer to the `command + documentation + `_ for + further information. + + value5 : str + The description of the argument is missing in the Python function. Please, refer to the `command + documentation + `_ for + further information. + + Notes + ----- + + .. _CYCFREQ_notes: + + The program solves a cyclically symmetric model (set up via the :ref:`cyclic` command during + preprocessing) at the harmonic indices specified via the :ref:`cycopt` command. + + When ``Option`` = AERO, the aerodynamic coefficients are specified in a 5×(N×r) array ( :ref:`dim` + ), where N is the number of blades and r can be any positive integer. Each column has the structure: + + .. math:: + + equation not available + + where: + + * :math:`equation not available` = the i :sup:`th` interblade phase angle (IBPA) + * :math:`equation not available` = the m :sup:`th` vibrating blade mode + * :math:`equation not available` = the n :sup:`th` blade mode generating the pressure oscillations + * :math:`equation not available` and :math:`equation not available` = the real and imaginary + coefficients. + One aerodynamic damping coefficient must be specified for each IBPA (equal to the number of blades) + while keeping m and n constant. + + The following table shows how the IBPA index ( :math:`equation not available` ) relates to other + quantities for a system with 22 blades: + + This command contains some tables and extra information which can be inspected in the original + documentation pointed above. + + The :ref:`cycfreq`,AERO command is only valid if :ref:`cycfreq`,BLADE is also specified. The blade + mode numbers, m and n, are relative to the values kept in the :ref:`cycfreq`,BLADE command. + + For constant (frequency-independent) mistuning, the stiffness parameters are specified in an N×1 + array ( :ref:`dim` ) where N is the number of blades. + + For stiffness mistuning, each row entry represents the deviation of Young``s modulus from nominal, + :math:`equation not available` (or equivalently, the ratio of the frequency deviationsquared). Each + frequency can also be independently mistuned, in whichcase the array is NtimesM, where M is the + number of blade frequencies( ``Value3`` of :ref:`cycfreq`,BLADE). The entries in each row therefore + correspond to the ratio of the mistuned frequency to the tuned frequency squared minus one: + + .. math:: + + equation not available + + The USER option activates the solution macro :file:`CYCMSUPUSERSOLVE.MAC`. The normal solution is + skipped. You may implement your own mistuning solution using APDL and APDL Math operations, or call + your own program for the solution. + + The :ref:`cycfreq` command is valid in the preprocessing and solution stages of an analysis. + + The :ref:`cycfreq`,MODAL,ON command writes modal frequencies to the output file. No other + postprocessing is available for this modal solve. + + When using :ref:`cycfreq`,RESTART, only mistuning parameters or frequency range may be changed. All + other changes in parameters are ignored. This type of restart can only be performed by exiting the + current mistuning solution using :ref:`finish` and re-entering the solution phase using + :ref:`slashsolu` and then calling the desired :ref:`cycfreq`,RESTART command. + + To learn more about analyzing a cyclically symmetric structure, see the `Cyclic Symmetry Analysis + Guide `_. + + **Example Usage** + + .. _CYCFREQ_ExUsage: + + `Analysis and Solution Controls section of the Technology Showcase Example Problem: Forced-response + analysis of a mistuned bladed disk with aerodamping + `_. + + For an example demonstrating how to apply modal loads directly in the cyclic harmonic analysis step + of a mode-superposition harmonic cyclic symmetry analysis, see. + """ + command = f"CYCFREQ,{option},{value1},{value2},{value3},{value4},{value5}" + return self.run(command, **kwargs) + + def cyclic( + self, + nsector: str = "", + angle: str = "", + kcn: str = "", + name: str = "", + usrcomp: str = "", + usrnmap: str = "", + **kwargs, + ): + r"""Specifies a cyclic symmetry analysis. + + Mechanical APDL Command: `CYCLIC `_ + + **Command default:** + + .. _CYCLIC_default: + + The default :ref:`cyclic` command (issuing the command with no arguments) detects the number of + sectors ( ``NSECTOR`` ), the sector angle ( ``ANGLE`` ), and the coordinate system ( ``KCN`` ) based + upon the existing solid or finite-element model. The command also detects sector low- and high-edge + components in most cases and assigns the default root name CYCLIC to the components. + + Parameters + ---------- + nsector : str + The number of sectors in the full 360 degrees, or one of the following options: + + * ``STATUS`` - Indicates the current cyclic status. + + * ``OFF`` - Resets model to normal (non-cyclic) status and removes the duplicate sector if it + exists. This option also deletes automatically detected edge components (generated when ``USRCOMP`` + = 0). + + * ``UNDOUBLE`` - Removes the duplicate sector if it exists. The duplicate sector is created during + the solution ( :ref:`solve` ) stage of a modal cyclic symmetry analysis. + + The duplicate sector is necessary for displaying cyclic symmetry analysis results during + postprocessing ( :ref:`post1` ). + + If you specify a value of STATUS, OFF or UNDOUBLE, the command ignores all remaining arguments. + + angle : str + The sector angle in degrees. + + kcn : str + An arbitrary reference number assigned to the cyclic coordinate system. The default value of 0 + specifies automatic detection. + + name : str + The root name of sector low- and high-edge components (line, area, or node components). The default + root name (when ``USRCOMP`` = 0) is CYCLIC. A root name that you specify can contain up to 11 + characters. + + The naming convention for each low- and high-edge component pair is either of the following: + + * ``Name`` _m ``xx`` l, ``Name`` _m ``xx`` h (potentially matched node patterns) + * ``Name`` _u ``xx`` l, ``Name`` _u ``xx`` h (potentially unmatched node patterns) + + The ``Name`` value is the default ( CYCLIC ) or specified root name and ``xx`` is the component pair + ID number (sequential, starting at 01). + + usrcomp : str + The number of pairs of user-defined low- and high-edge components on the cyclic sector (if any). + The default value of 0 specifies automatic detection of sector edges; however, the automatic + setting is not valid in all cases. (For more information, see the Notes section below.) If the + value is greater than 0, no verification of user-defined components occurs. + + usrnmap : str + The name of a user-defined array specifying the matching node pairs between the sector low and high + edges. Valid only when ``USRCOMP`` = 0. Skips the automatic detection of sector edges. Node pairs + may be input in any order, but the low edge node must be the first entry in each pair. + + .. code:: apdl + + *DIM,MYMAP,ARRAY,2,14 ! specifying 14 low-high edge node pairs + *set,mymap(1, 1), 107, 108 ! low node 107 <> high node 108 + *set,mymap(1, 2), 147, 211 ! low node 147 <> high node 211 + *set,mymap(1, 3), 110, 109 ! low node 110 <> high node 109 + ! etc for node pairs 4 through 14 + cyclic,12,,1,,,MYMAP ! use array MYMAP to generate cyclic CEs + + Notes + ----- + + .. _CYCLIC_notes: + + You can input your own value for ``NSECTOR``, ``ANGLE`` or ``KCN`` ; if you do so, the command + verifies argument values before executing. + + When ``USRCOMP`` = 0 and ``UsrNMap`` = blank (default), the :ref:`cyclic` command automatically + detects `low- and high-edge components + `_ for + models that consist of any combination of line, area, or volume elements. If a solid model exists, + however, the command uses only the lines, areas, and/or volumes to determine the low- and high-edge + components; the elements, if any, are ignored. + + Nodes will be automatically rotated unless :ref:`cycopt`,USRROT,YES has been specified. + + If you issue a :ref:`cycopt`,TOLER command to set a tolerance for edge-component pairing before + issuing the :ref:`cyclic` command, the :ref:`cyclic` command uses the specified tolerance when + performing automatic edge-component detection. + + For 2D models, autodetection does not consider the :ref:`csys`,5 or :ref:`csys`,6 coordinate system + specification. Autodetection for 180 degree (two-sector) models is not possible unless a central + hole exists. + + The :ref:`cyclic` command sets values and keys so that, if possible, the area-mesh ( :ref:`amesh` ) + or volume-mesh ( :ref:`vmesh` ) command meshes the sector with matching node and element face + patterns on the low and high edges. (The command has no effect on any other element-creation + command.) + + Issue the :ref:`cyclic` command prior to the meshing command to, if possible, produce a mesh with + identical node and element patterns on the low and high sector edges. Only the :ref:`amesh` or + :ref:`vmesh` commands can perform automated matching. (Other meshing operation commands such as + :ref:`vsweep` cannot.) If you employ a meshing operation other than :ref:`amesh` or :ref:`vmesh`, + you should ensure that node and element face patterns match, if desired. The :ref:`cyclic` command + output indicates whether each edge-component pair has or can produce a matching node pair. + + A cyclic solution (via the :ref:`solve` command) allows dissimilar mesh patterns on the extreme + boundaries of a cyclically symmetric model. The allowance for dissimilar patterns is useful when you + have only finite-element meshes for your model but not the geometry data necessary to remesh it to + obtain identical node patterns. In such cases, it is possible to obtain solution results, although + perhaps at the expense of accuracy. A warning message appears because results may be degraded near + the sector edges. + + The constraint equations (CEs) that tie together the low and high edges of your model are generated + at the solution stage of the analysis from the low- and high-edge components (and nowhere else). You + should verify that automatically detected components are in the correct locations and that you can + account for all components; to do so, you can list ( :ref:`cmlist` ) or plot ( :ref:`cmplot` ) the + components. + + If you issue the :ref:`cyclic` command after meshing and have defined element types with rotational + degrees of freedom (DOFs), Mechanical APDL generates cyclic CEs for rotational DOFs that may not + exist on + the sector boundaries. Issue :ref:`cycopt`,DOF to prevent unused rotational terms from being + generated. + + Modal cyclic symmetry analysis is supported by the following eigensolvers: + + * Block Lanczos ( :ref:`modopt`,LANB) + + * PCG Lanczos ( :ref:`modopt`,LANPCG) + + * Super Node ( :ref:`modopt`,SNODE) + + * Subspace ( :ref:`modopt`,SUBSP) + + To learn more about analyzing a cyclically symmetric structure, see the `Cyclic Symmetry Analysis + Guide `_. + + When using the :ref:`cyclic` command to automatically detect the sector, if an area is defined with + the :ref:`al` command, the lines need to be oriented to form the closed curve. + """ + command = f"CYCLIC,{nsector},{angle},{kcn},{name},{usrcomp},{usrnmap}" + return self.run(command, **kwargs) + + def cycopt( + self, + option: str = "", + value1: str = "", + value2: str = "", + value3: str = "", + value4: str = "", + value5: str = "", + value6: str = "", + value7: str = "", + **kwargs, + ): + r"""Specifies solution options for a cyclic symmetry analysis. + + Mechanical APDL Command: `CYCOPT `_ + + Parameters + ---------- + option : str + Cyclic symmetry analysis option. There is no default. You must choose o ne of the following options: + + * ``BCMULT`` - Controls whether cyclic sector array parameter names are reused or created new for multiple + entities. + + * ``Value1`` - The flag value. + + * ``0 (OFF or NO)`` - Create new array parameter names (default) + + * ``1(ON or YES)`` - Reuse array parameter names + + * ``COMBINE`` - For linear `static cyclic symmetry analysis + `_ + with `non-cyclically symmetric loading + `_ only, + expands and combines all harmonic index solutions and writes them to the results file during the + solution phase of the analysis. + + * ``Value1`` - The flag value. + + * ``0 (OFF or NO)`` - Disable combining of harmonic index solutions (default) + + * ``1 (ON or YES)`` - Enable combining of harmonic index solutions + + * ``DEFAULT`` - Set the default cyclic solution settings. + + * ``DOF`` - The degrees of freedom to couple from the nodes on the low sector boundary to nodes on the high + boundary: + + * ``Value1`` - The component pair ID number. + + * ``Value2, Value3, Value4, ..., Value7`` - The constraint-equation/-coupling degree of + freedom (DOF) for this pair. Repeat the command to add other DOFs. The default is constraint- + equation/-coupling all applicable DOFs. + + * ``FACETOL`` - Tolerance for inclusion of surface nodes into your base sector. Autodetect defaults to 15°, + accommodating most sections. Specify a new ``Value1`` only when extreme cut angles or complex model + geometry cause surface nodes to be excluded. See Notes (below) for more information. + + Ansys, Inc. recommends that successful auto-detection depends more on the value of ANGTOL + than the value of FACETOL. Please refer to `CYCOPTAuto Detection Tolerance Adjustments for Difficult + Cases + `_ + :ref:`cycopt` command. + + * ``Value1`` - The face tolerance applies only to auto detection from node/element models (already + meshed and no solid model), and it defaults to 15°. + + * ``HINDEX`` - The `harmonic index + `_ + ranges to be solved. Applies to static and harmonic analyses only if :ref:`CYCOPT_HINDEXValue5` + ``Value5`` = STATIC. + + By default, the :ref:`solve` command loops through all available harmonic indices. `Static + `_ + and `harmonic + `_ + analyses only solve harmonic indices required for the applied loads. All other analyses solve them + all. + + * ``EVEN / ODD`` - For low-frequency electromagnetic analysis only, EVEN specifies a symmetric + solution and ODD specifies an antisymmetric solution. + + The value you specify is based on the `harmonic index + `_ + : EVEN (default) indicates harmonic index = 0, and ODD indicates harmonic index = ``N`` / 2 (where + ``N`` is an integer representing the number of sectors in 360°). A value of ODD applies only when + ``N`` is an even number. + + The :ref:`cycopt` command with this HINDEX option is cumulative. To remove an option (for example, + EVEN), issue this command: :ref:`cycopt`,HINDEX,EVEN,,,-1 + + * ``ALL`` - Solve all applicable harmonic indices. ``Value2`` must be blank. + + * ``Value1, Value2, Value3`` - Solve harmonic indices in range ``Value1`` through ``Value2`` in + steps of ``Value3``. Repeat the command to add other ranges. The default solves all applicable + harmonic indices. + + * ``Value4`` - The only valid value is -1. If specified, it removes ``Value1`` through ``Value2`` in + steps of ``Value3`` from the set to solve. By default, if ``Value4`` = -1 then ``Value1`` = 0, + ``Value2`` = 0, and ``Value3`` = 1. + + * ``Value5`` - For `static + `_ + and `harmonic + `_ + analyses, enter either a number or STATIC: + + If ``Value5`` = the number entered sets the tolerance for determining if the Fourier + contribution of a load is significant (default = 1.0E-5). In this case, the harmonic index selection + is disabled. + + If ``Value5`` = STATIC the harmonic index selection is enabled, and no verification is done on the + significance of unselected harmonic indicies. Improper selection of the harmonic index range may + produce incomplete (incorrect) results. + + * ``LDSECT`` - Restricts subsequently defined force loads and surface loads to a specified sector. The restriction + remains in effect until you change or reset it. This option is not available for harmonic analyses + based on mode-superposition ( :ref:`cycopt`,MSUP,1) + + * ``Value1`` - The sector number. A value other than 0 (default) is valid for a cyclic symmetry + analysis with `non- cyclically symmetric loading + `_ only. A + value of 0 (or ALL) resets the default behavior for cyclic loading (where the loads are identical on + all sectors). + + * ``MOVE`` - Specifies if the program should move high- or low-edge component nodes paired within the specified + tolerance (TOLER) to create precisely matching pairs. + + * ``Value1`` - The flag value. + + * ``0`` - Do not move edge component nodes (default) + + * ``1 or HIGH`` - Move the high-edge component nodes to precisely match the low-edge component nodes + + * ``-1 or LOW`` - Move the low-edge component nodes to precisely match the high-edge component nodes + + * ``MSUP`` - This flag is used to limit the results written to the :file:`Jobname.MODE` and :file:`Jobname.RST` + files in a modal cyclic symmetry analysis. In a linear perturbation analysis, the modal analysis and + the first load step of the preceding base analysis must be set to the same value. + + * ``Value1`` - The flag value. + + * ``0 (OFF or NO)`` - Write results for the base and duplicate sectors to the :file:`Jobname.MODE` + and :file:`Jobname.RST` files. + + * ``1 (ON or YES)`` - Write only the base sector results to the :file:`Jobname.MODE` and + :file:`Jobname.RST` files for use in a subsequent mode-superposition-based analysis. Default, except + for cyclic unsymmetric modal, LANPCG, and SNODE solutions, which use ``Value1`` = 0 as the default. + This option is not valid for cyclic unsymmetric modal, LANPCG, and SNODE solutions. + + * ``STATUS`` - List the solution option settings active for the cyclic model. + + * ``TOLER`` - The tolerance used to determine whether a node on the low edge is paired with a node on the high + edge. + + * ``Value1`` - The tolerance value. + + * ``Greater than 0`` - The absolute distance tolerance for automatic sector-boundary detection and + low-/high-edge component node pairing + + * ``Less than 0`` - The relative tolerance for automatic sector-boundary detection and low-/high-edge component node + pairing. In this case, the tolerance is ``Value1`` \* ``Length``, where ``Length`` is the length of the diagonal of an imaginary box enclosing the model + + * ``0`` - Tolerance is set to -1.0 x 10 :sup:`-4` (default) + + * ``Value2`` - ``ANGTOL`` = Maximum allowable angle tolerance. (default = 0.01°) + + The valid range for ``ANGTOL`` is model dependent. + + If you input both the number of sectors and a sector angle, the angle must match 360/(number of + sectors) within ``ANGTOL``. + + If you input only a sector angle, it must divide evenly into 360° within ``ANGTOL``. + + If you input a sector angle, the final cyclic sector must span that angle within ``ANGTOL``. + + For auto detected sector angle, the final cyclic sector must span 360/(number of sectors) within + ``ANGTOL``, everywhere along the LOW/HIGH boundaries. + + If ``ANGTOL`` is too small, your CAD or FEA model may not be accurate enough to allow auto detection + or verification. + + If ``ANGTOL`` is too large, you may get an unexpected or incorrect boundary definition, or in other + cases fail to detect the boundaries. + + For some difficult cases from FEA models (not solid models), you may need to change the value of + ``FACETOL`` to achieve auto detection. Please refer to `CYCOPTAuto Detection Tolerance Adjustments + for Difficult Cases + `_ + :ref:`cycopt` command. + + * ``USRROT`` - Flag specifying whether the program should override automatic nodal rotations to edge components and + allow you to apply nodal rotations manually. + + * ``Value1`` - The flag value. + + * ``0 (OFF or NO)`` - Allow automatic node rotation (default) + + * ``1 (ON or YES)`` - Suppress automatic node rotation. If you select this option, you must apply + appropriate nodal rotations to all edge component nodes; otherwise, your analysis will yield + incorrect solution results. + + * ``LOW`` - Suppresses automatic rotation of low-edge component nodes only, allowing you to apply + them manually. Automatic rotation of high-edge component nodes occurs to produce the matching edge + nodes required for a valid cyclic solution. + + * ``HIGH`` - Suppresses automatic rotation of high-edge component nodes only, allowing you to apply + them manually. Automatic rotation of low-edge component nodes occurs to produce the matching edge + nodes required for a valid cyclic solution. + + value1 : str + The description of the argument is missing in the Python function. Please, refer to the `command + documentation + `_ for + further information. + + value2 : str + The description of the argument is missing in the Python function. Please, refer to the `command + documentation + `_ for + further information. + + value3 : str + The description of the argument is missing in the Python function. Please, refer to the `command + documentation + `_ for + further information. + + value4 : str + The description of the argument is missing in the Python function. Please, refer to the `command + documentation + `_ for + further information. + + value5 : str + The description of the argument is missing in the Python function. Please, refer to the `command + documentation + `_ for + further information. + + value6 : str + The description of the argument is missing in the Python function. Please, refer to the `command + documentation + `_ for + further information. + + value7 : str + The description of the argument is missing in the Python function. Please, refer to the `command + documentation + `_ for + further information. + + Notes + ----- + + .. _CYCOPT_notes: + + The program solves a cyclically symmetric model (set up via the :ref:`cyclic` command during + preprocessing) at the harmonic indices specified via the :ref:`cycopt` command. + + The :ref:`cycopt`,COMBINE option is an alternative to the :ref:`cycexpand` command and is especially + useful for testing purposes. However, Ansys, Inc. recommends specifying COMBINE only when + the number of sectors is relatively small. (The option expands nodes and elements into the full 360° + and can slow postprocessing significantly. + + If you issue a :ref:`cycopt`,TOLER command to set a tolerance for `edge-component + `_ pairing + before issuing the :ref:`cyclic` command, the :ref:`cyclic` command uses the specified tolerance + when performing automatic edge-component detection. + + In cases involving `non-cyclically symmetric loading + `_ (that is, + when LDSECT > 0), the underlying command operations create or modify the required SECTOR tabular + boundary condition (BC) data to apply on the appropriate sector. Therefore, it is not necessary to + manipulate tables for situations where the applied BC is not a function of other tabular BC + variables such as TIME, X, Y, Z, and so on. + + To delete a previously applied load on a specified sector, issue an :ref:`fdele` command. + + Because edge nodes are rotated into the cyclic coordinate system during solution, any applied + displacements or forces on sector edges will be in the cyclic coordinate system. + + The :ref:`cycopt` command is valid in the preprocessing and solution stages of an analysis. + + To learn more about analyzing a cyclically symmetric structure, see the `Cyclic Symmetry Analysis + Guide `_. + + Distributed-Memory Parallel (DMP) Restriction The COMBINE option is not supported in a DMP solution. + """ + command = f"CYCOPT,{option},{value1},{value2},{value3},{value4},{value5},{value6},{value7}" + return self.run(command, **kwargs) + + def emsym(self, nsect: str = "", **kwargs): + r"""Specifies circular symmetry for electromagnetic sources. + + Mechanical APDL Command: `EMSYM `_ + + Parameters + ---------- + nsect : str + The number of circular symmetry sections (defaults to 1). + + Notes + ----- + + .. _EMSYM_notes: + + Specifies the number of times to repeat electromagnetic sources for circular symmetry. Applies to + ``SOURC36`` elements and to coupled-field elements with electric current conduction results in the + database. Sources are assumed to be equally spaced over 360° about the global Cartesian Z axis. + + This command is also valid in SOLUTION. + """ + command = f"EMSYM,{nsect}" + return self.run(command, **kwargs) + + def msopt( + self, + option: str = "", + sname: str = "", + value1: str = "", + value2: str = "", + value3: str = "", + value4: str = "", + value5: str = "", + value6: str = "", + value7: str = "", + **kwargs, + ): + r"""Specifies solution options for a `multistage cyclic symmetry analysis + `_. + + Mechanical APDL Command: `MSOPT `_ + + Parameters + ---------- + option : str + Multistage cyclic symmetry analysis option. There is no default. You must choose one of the + following options: + + * ``CSYS`` - Activates a previously defined cyclic coordinate system by the reference number specified in + ``Value1``. ``Sname`` is ignored. This option is only valid in the /PREP7 processor. + + * ``Value1`` - Cylindrical coordinate system reference number. You must have already created the + coordinate system by issuing prior commands like :ref:`cs` or :ref:`local` to define it. Defaults to + 1 where the global Cartesian Z axis is the cyclic symmetry axis. + + You must define the coordinate system before defining the stages. + + * ``NEW`` - Creates a new stage with the name entered in ``Sname`` and the ``Value1`` - ``Value6`` + specifications listed in the table below. This option is only valid in the /PREP7 processor. + + * ``Sname`` - An alphanumeric name used to identify the stage. ``Sname`` may be up to 32 characters, + beginning with a letter and containing only letters, numbers, and underscores. Names beginning with + an underscore (for example, _LOOP) are reserved for use by Mechanical APDL and should be avoided. The + component name ALL is not permitted. + + This command contains some tables and extra information which can be inspected in the original + documentation pointed above. + + When creating a new stage, the base and duplicate sector meshes should be coincident. The offset + between the number of base and duplicate coincident nodes is constant throughout the whole model. + The same is true for the element numbers. + + * ``DELETE`` - Deletes the stage identified by ``Sname``. + + * ``Sname`` - The name of the stage to be deleted. Entities such as nodes and elements contained in + the stage are unaffected. Only the grouping and the related constraint equations are concerned. + + * ``EXPAND`` - Specifies stages (identified by ``Sname`` ) and sectors (sector number specified in ``Value1`` ) for + subsequent expansion. This option is only valid in the /POST1 processor. + + * ``Sname`` - The name of the stage to be expanded. A value of 0 resets all expansion settings. A + value of ALL means all existing stages will be expanded (default). + + * ``Value1`` - The sector number. A value of 0 resets all sector settings. A value of ALL means all + sectors will be expanded (default). + + * ``LIST`` - Lists the stage identified by ``Sname`` with the level of detail specified in ``Value1``. + + * ``Sname`` - The name of the stage to be listed. If blank, list all stages (default). + + * ``Value1`` - Key for specifying the level of detail. + + * ``0 (, or OFF)`` - Basic listing (default). + + * ``1 (, or ON)`` - Detailed listing, including constraint equations information. Note that the + interstage constraint equations number information is only listed for the stage with the smallest + number of sectors. + + * ``MODIFY`` - Sets the `harmonic index + `_ + of a stage identified by ``Sname`` to the integer specified in ``Value1``. + + * ``Sname`` - The name of the stage to be modified. + + * ``Value1`` - The new `harmonic index + `_. + Existing cyclic and multistage interface constraint equations will be deleted. + + * ``RESET`` - Deletes all stages and resets all multistage analysis settings. + + sname : str + The description of the argument is missing in the Python function. Please, refer to the `command + documentation + `_ for further + information. + + value1 : str + The description of the argument is missing in the Python function. Please, refer to the `command + documentation + `_ for further + information. + + value2 : str + The description of the argument is missing in the Python function. Please, refer to the `command + documentation + `_ for further + information. + + value3 : str + The description of the argument is missing in the Python function. Please, refer to the `command + documentation + `_ for further + information. + + value4 : str + The description of the argument is missing in the Python function. Please, refer to the `command + documentation + `_ for further + information. + + value5 : str + The description of the argument is missing in the Python function. Please, refer to the `command + documentation + `_ for further + information. + + value6 : str + The description of the argument is missing in the Python function. Please, refer to the `command + documentation + `_ for further + information. + + value7 : str + The description of the argument is missing in the Python function. Please, refer to the `command + documentation + `_ for further + information. + + Notes + ----- + + .. _MSOPT_notes: + + The :ref:`msopt` command is used to specify solution options for a `multistage cyclic symmetry + analysis + `_. It + is not part of the :ref:`cyclic` procedure for a cyclic symmetry analysis. + + When you issue :ref:`msopt`,EXPAND, subsequent :ref:`set` commands read the data set from the + specified :file:`.rst` file and expand the nodes and elements to the stages and sectors specified + via :ref:`msopt`,EXPAND. + + **Example Usage** + `Example: Static Analysis of a Compressor Model with 4 Axial Stages Without a Duplicate Sector + `_ + + `Example: Linear Perturbation Modal Analysis of a Simplified Model with 2 Axial Stages and a Non- + planar Interstage Boundary + `_ + + `Example: Modal Analysis of Turbomachinery Stage Modeled as 2 Radial Stages with Offset Cyclic Edge + Starting Points + `_ + + `Example: Mutistage Multiharmonic Modal Analysis of a Hollow Cylinder Modeled Using 2 Stages + `_ + + `Example: Multiharmonic Linear Perturbation Modal Analysis of a Simplified Model with 3 Axial Stages + `_ + """ + command = f"MSOPT,{option},{sname},{value1},{value2},{value3},{value4},{value5},{value6},{value7}" + return self.run(command, **kwargs) + + def mstole( + self, method: int | str = "", namesurf: str = "", namefluid: str = "", **kwargs + ): + r"""Adds two extra nodes from ``FLUID116`` elements to ``SURF151`` or ``SURF152`` elements for + convection analyses. + + Mechanical APDL Command: `MSTOLE `_ + + Parameters + ---------- + method : int or str + Mapping method: + + * ``0`` - Hybrid method (default). + + * ``1`` - Projection method. + + * ``2`` - Minimum centroid distance method. + + namesurf : str + Component name for a group of ``SURF151`` or ``SURF152`` elements. The component name must be 32 + characters or less, and it must be enclosed in single quotes (for example, 'COM152') when the + :ref:`mstole` command is manually typed in. + + namefluid : str + Component name for a group of ``FLUID116`` elements. The component name must be 32 characters or + less, and it must be enclosed in single quotes (for example, 'COM116') when the :ref:`mstole` + command is manually typed in. + + Notes + ----- + + .. _MSTOLE_notes: + + For convection analyses, the :ref:`mstole` command adds two extra nodes from ``FLUID116`` elements + to ``SURF151`` or ``SURF152`` elements by employing the specified mapping method. In the hybrid + method, the projection method is tried first and if it fails the centroid distance method is used. + The ``SURF151`` or ``SURF152`` elements and the ``FLUID116`` elements must be grouped into + components and named using the :ref:`cm` command. + + The ``SURF151`` or ``SURF152`` extra node option must be set for two extra nodes (KEYOPT(5) = 2). + + For more information, see `Using the Surface Effect Elements + `_ in the + `Thermal Analysis Guide + `_. + """ + command = f"MSTOLE,{method},{namesurf},{namefluid}" + return self.run(command, **kwargs) + + def perbc2d( + self, + loc1: str = "", + loc2: str = "", + loctol: str = "", + r1: str = "", + r2: str = "", + tolr: str = "", + opt: int | str = "", + plnopt: int | str = "", + **kwargs, + ): + r"""Generates periodic constraints for 2D planar magnetic field analyses. + + Mechanical APDL Command: `PERBC2D `_ + + Parameters + ---------- + loc1 : str + Constant coordinate location of the first plane of nodes. For ``PLNOPT`` = 1 or 2, the constant + coordinate location is the global Cartesian coordinate system ( :ref:`csys`,0) location in the X + or Y direction respectively. For ``PLNOPT`` = 0, the location is the angle in the global + cylindrical coordinate system ( :ref:`csys`,1). + + loc2 : str + Constant coordinate location of the second plane of nodes. For ``PLNOPT`` = 1 or 2, the constant + coordinate location is the global Cartesian coordinate system ( :ref:`csys`,0) location in the X + or Y direction respectively. For ``PLNOPT`` = 0, the location is the angle (in degrees) in the + global cylindrical coordinate system ( :ref:`csys`,1). + + loctol : str + Tolerance on the constant coordinate location for node selection. Defaults to.00001 for + ``PLNOPT`` = 1 or 2 and.001 degrees for ``PLNOPT`` = 0. + + r1 : str + Minimum coordinate location along the second plane of nodes. For ``PLNOPT`` = 1 or 2, the + coordinate location is the global Cartesian coordinate system location in the Y or X direction + respectively. For ``PLNOPT`` = 0, the coordinate location is the radial coordinate value in the + global cylindrical coordinate system. Periodic conditions are not applied to nodes at this + location. + + r2 : str + Maximum coordinate location along the second plane of nodes. For ``PLNOPT`` = 1 or 2, the + coordinate location is the global Cartesian coordinate system location in the Y or X direction + respectively. For ``PLNOPT`` = 0, the coordinate location is the radial coordinate value in the + global cylindrical coordinate system. Periodic conditions are not applied to nodes at this + location. + + tolr : str + Tolerance dimension on node selection along the plane of nodes. Defaults to.00001. + + opt : int or str + Periodic option: + + * ``0`` - Odd symmetry (default). Apply constraint equations such that AZ(i) = -AZ(j). + + * ``1`` - Even symmetry. Apply node coupling such that AZ(i) = AZ(j). + + plnopt : int or str + Symmetry plane option: + + * ``0`` - Planes of constant angle in the global cylindrical coordinate system ( :ref:`csys`,1). + + * ``1`` - Planes parallel to the global Cartesian X axis ( :ref:`csys`,0). + + * ``2`` - Planes parallel to the global Cartesian Y axis ( :ref:`csys`,0). + + Notes + ----- + + .. _PERBC2D_notes: + + :ref:`perbc2d` invokes a Mechanical APDL macro which generates periodic boundary condition + constraints for + 2D planar magnetic field analysis. + + The macro is restricted to node pairs sharing common coordinate values along symmetry planes + separated by a constant coordinate value. Planes (or lines) must lie at either constant angles ( + ``PLNOPT`` = 0), constant X values ( ``PLNOPT`` = 1), or constant Y values ( ``PLNOPT`` = 2). + + The macro applies constraint equations ( ``OPT`` = 0, odd symmetry) or node coupling ( ``OPT`` = 1, + even symmetry) to each node pair sharing a common coordinate value along the symmetry planes. By + default, periodic conditions are not applied at the first and last node pairs on the symmetry planes + unless the input location values, R1 and R2, are adjusted to be less than or greater than the actual + node coordinate values. + + Nodes are selected for application of constraints via :ref:`nsel`, with tolerances on the constant + coordinate location ( ``LOCTOL`` ) and the coordinate location along the plane (RTOL). + """ + command = f"PERBC2D,{loc1},{loc2},{loctol},{r1},{r2},{tolr},{opt},{plnopt}" + return self.run(command, **kwargs) + + def race( + self, + xc: str = "", + yc: str = "", + rad: str = "", + tcur: str = "", + dy: str = "", + dz: str = "", + cname: str = "", + **kwargs, + ): + r"""Defines a "racetrack" current source. + + Mechanical APDL Command: `RACE `_ + + Parameters + ---------- + xc : str + Location of the mid-thickness of the vertical leg along the working plane X-axis. + + yc : str + Location of the mid-thickness of the horizontal leg along the working plane Y-axis. + + rad : str + Radius of curvature of the mid-thickness of the curves in the racetrack source. Defaults to.501 * DY + + tcur : str + Total current, amp-turns (MKS), flowing in the source. + + dy : str + In-plane thickness of the racetrack source. + + dz : str + Out-of-plane thickness (depth) of the racetrack source. + + cname : str + + Notes + ----- + + .. _RACE_notes: + + :ref:`race` invokes a Mechanical APDL macro which defines a racetrack current source in the working + plane + coordinate system. + + .. figure:: ../../../images/_commands/gRACE1.svg + + The current source is generated from bar and arc source primitives using ``SOURC36`` (which is + assigned the next available element type number). + + The macro is valid for use in 3D magnetic field analysis using a scalar potential formulation. + + Current flows in a counterclockwise direction with respect to the working plane. + """ + command = f"RACE,{xc},{yc},{rad},{tcur},{dy},{dz},,,{cname}" + return self.run(command, **kwargs) + + def sstate( + self, + action: str = "", + cm_name: str = "", + val1: str = "", + val2: str = "", + val3: str = "", + val4: str = "", + val5: str = "", + val6: str = "", + val7: str = "", + val8: str = "", + val9: str = "", + **kwargs, + ): + r"""Defines a steady-state rolling analysis. + + Mechanical APDL Command: `SSTATE `_ + + Parameters + ---------- + action : str + Action to perform for defining or manipulating steady-state rolling analysis data: + + * ``DEFINE`` - Define steady-state rolling analysis data + + * ``LIST`` - List current steady-state rolling analysis data + + * ``DELETE`` - Delete steady-state rolling analysis data + + cm_name : str + Element component name + + val1 : str + Input values (based on the ``Action`` type) + + val2 : str + Input values (based on the ``Action`` type) + + val3 : str + Input values (based on the ``Action`` type) + + val4 : str + Input values (based on the ``Action`` type) + + val5 : str + Input values (based on the ``Action`` type) + + val6 : str + Input values (based on the ``Action`` type) + + val7 : str + Input values (based on the ``Action`` type) + + val8 : str + Input values (based on the ``Action`` type) + + val9 : str + Input values (based on the ``Action`` type) + + Notes + ----- + + .. _SSTATE_notes: + + The :ref:`sstate` command specifies steady-state rolling analysis parameters for the given element + component. The program runs the steady-state rolling analysis if the corresponding element key + option is enabled for that element component. + + The command supports the following elements: + + This command contains some tables and extra information which can be inspected in the original + documentation pointed above. + + For information about steady-state rolling for rebar and solid elements, see `Steady-State Rolling + `_ + + .. _sstate_define_spec: + + The following data types can be defined: + + * SPIN -- Spinning motion + + * TRANSLATE -- Rigid body motion (velocity) that the spinning component is undergoing + + **Define the steady-state spinning motion:** + + :ref:`sstate`, DEFINE, ``CM_Name``, SPIN, ``OMEGA``, ``Method``, ``Val4``, ``Val5``, ``Val6``, + ``Val7``, ``Val8``, ``Val9`` + + * ``OMEGA`` - Spin velocity + + * ``Method`` - Method to use for defining the spin axis: + + * ``POINTS`` - Define the spin axis using two points: + + ``Val4``, ``Val5``, ``Val6`` -- Coordinates of the first point + + ``Val7``, ``Val8``, ``Val9`` -- Coordinates of the second point + + This definition method is currently the only option. + + **Example: Defining Steady-State Spinning Motion** + + This command defines a steady-state spinning motion of 120 rad/s around the spin axis: + + .. code:: apdl + + SSTATE,DEFINE, CM_Name,SPIN,120,POINTS,0,0,0,0,1,0 + + In this case, two points with coordinates (0,0,0) and (0,1,0) define the spin axis in the global Y + direction. + + **Define the rigid body motion (velocity):** + + :ref:`sstate`, DEFINE, ``CM_Name``, TRANSLATE, ``Val2``, ``Val3``, ``Val4`` + + * ``Val2``, ``Val3``, ``Val4`` -- Rigid body velocity components + + .. _sstate_list_spec: + + :ref:`sstate`, LIST, ``CM_Name`` + + Lists all steady-state rolling analysis data defined on the specified element component. All data is + listed if no component ( ``CM_Name`` ) is specified. + + .. _sstate_delete_spec: + + :ref:`sstate`, DELETE, ``CM_Name`` + + Deletes all steady-state rolling analysis data defined on the specified element component. All data + is deleted if no component ( ``CM_Name`` ) is specified. + """ + command = f"SSTATE,{action},{cm_name},{val1},{val2},{val3},{val4},{val5},{val6},{val7},{val8},{val9}" + return self.run(command, **kwargs) + + def xfcrkmesh( + self, enrichmentid: str = "", elemcomp: str = "", nodecomp: str = "", **kwargs + ): + r"""Defines a crack in the model when the crack surface is discretized by ``MESH200`` elements + + Mechanical APDL Command: `XFCRKMESH `_ + + Parameters + ---------- + enrichmentid : str + Name of the enrichment specified via the associated :ref:`xfenrich` command. + + elemcomp : str + Name of the element component consisting of ``MESH200`` elements that form the crack surface. + + nodecomp : str + Name of the node component consisting of the crack front nodes of the crack surface. + + Notes + ----- + + .. _XFCRKMESH_notes: + + Used in an `XFEM-based crack analysis + `_, + this command defines a crack in the model when the crack surface is discretized by ``MESH200`` + elements. For more informatiom, see `MESH200 Element Method + `_ + + Issue the :ref:`xfcrkmesh` command multiple times as needed to define multiple crack surfaces in the + model. + + This command is valid in PREP7 ( :ref:`prep7` ) only. + """ + command = f"XFCRKMESH,{enrichmentid},{elemcomp},{nodecomp}" + return self.run(command, **kwargs) + + def xfdata( + self, + enrichmentid: str = "", + lsm: str = "", + elemnum: str = "", + nodenum: str = "", + phi: str = "", + psi: str = "", + **kwargs, + ): + r"""Defines a crack in the model by specifying nodal level set values + + Mechanical APDL Command: `XFDATA `_ + + Parameters + ---------- + enrichmentid : str + Name of the enrichment specified via the associated :ref:`xfenrich` command. + + lsm : str + Indicates that level set values are being specified (default). + + elemnum : str + Element number. + + nodenum : str + Node number associated with the specified element ``ELNUM``. + + phi : str + Signed normal distance of the node from the crack. + + psi : str + Signed normal distance of the node from the crack tip (or crack front). Used only in the + `singularity-based + `_ + XFEM method. + + Notes + ----- + + .. _XFDATA_notes: + + Issue the :ref:`xfdata` command multiple times as needed to specify nodal level set values for all + nodes of an element. + + This command is valid in PREP7 ( :ref:`prep7` ) only. + """ + command = f"XFDATA,{enrichmentid},{lsm},{elemnum},{nodenum},{phi},{psi}" + return self.run(command, **kwargs) + + def xfenrich( + self, + enrichmentid: str = "", + compname: str = "", + mat_id: str = "", + method: str = "", + radius: str = "", + snaptoler: str = "", + **kwargs, + ): + r"""Defines parameters associated with crack propagation using XFEM + + Mechanical APDL Command: `XFENRICH `_ + + Parameters + ---------- + enrichmentid : str + An alphanumeric name assigned to identify the enrichment. The name can contain up to 32 + characters and must begin with an alphabetic character. Alphabetic characters, numbers, and + underscores are valid. + + compname : str + Name of the element set component for which initial cracks are defined and possibly propagated. + + mat_id : str + Material ID number referring to cohesive zone material behavior on the initial crack. If 0 or + not specified, the initial crack is assumed to be free of cohesive zone behavior. Used only with + the phantom-node XFEM method ( ``Method`` ). + + method : str + PHAN -- Use `phantom-node-based + `_ + XFEM (default). + + SING -- Use `singularity-based + `_ + XFEM. + + radius : str + Radius defining the region around the crack tip encompassing the set of elements to be + influenced by the crack-tip singularity effects. Default = 0.0. Used only in singularity-based + XFEM. + + snaptoler : str + Snap tolerance to snap the crack tip to the closest crack face along the extension direction. + Default = 1.0E-6. Used only in singularity-based XFEM. + + Notes + ----- + + .. _XFENRICH_notes: + + If ``MAT_ID`` is specified, the cohesive zone behavior is described by the `bilinear cohesive law + `_. + + If issuing multiple :ref:`xfenrich` commands, the element components ( ``CompName`` ) should not + intersect (that is, the element components should not have any common elements between them). + + When multiple :ref:`xfenrich` commands are issued in an analysis, combining the phantom-node-based + method ( ``Method`` = PHAN) and the singularity-based method ( ``Method`` = SING) is not valid. Only + one XFEM method per analysis is allowed. + + This command is valid in PREP7 ( :ref:`prep7` ) only. + """ + command = ( + f"XFENRICH,{enrichmentid},{compname},{mat_id},{method},{radius},{snaptoler}" + ) + return self.run(command, **kwargs) + + def xflist(self, enrichmentid: str = "", **kwargs): + r"""Lists enrichment details and associated crack information + + Mechanical APDL Command: `XFLIST `_ + + Parameters + ---------- + enrichmentid : str + The description of the argument is missing in the Python function. Please, refer to the `command + documentation + `_ for + further information. + + Notes + ----- + + .. _XFLIST_notes: + + This command is valid in PREP7 ( :ref:`prep7` ) and SOLUTION ( :ref:`slashsolu` ). + """ + command = f"XFLIST,{enrichmentid}" + return self.run(command, **kwargs) diff --git a/src/ansys/mapdl/core/_commands/prep7/status.py b/src/ansys/mapdl/core/_commands/prep7/status.py new file mode 100644 index 00000000000..e9396a32203 --- /dev/null +++ b/src/ansys/mapdl/core/_commands/prep7/status.py @@ -0,0 +1,487 @@ +# 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 areas(self, **kwargs): + r"""Specifies "Areas" as the subsequent status topic. + + Mechanical APDL Command: `AREAS `_ + + Notes + ----- + + .. _AREAS_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 = "AREAS" + return self.run(command, **kwargs) + + def bool(self, **kwargs): + r"""Specifies "Booleans" as the subsequent status topic. + + Mechanical APDL Command: `BOOL `_ + + Notes + ----- + + .. _BOOL_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 = "BOOL" + return self.run(command, **kwargs) + + def ceqn(self, **kwargs): + r"""Specifies "Constraint equations" as the subsequent status topic. + + Mechanical APDL Command: `CEQN `_ + + Notes + ----- + + .. _CEQN_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 = "CEQN" + return self.run(command, **kwargs) + + def couple(self, **kwargs): + r"""Specifies "Node coupling" as the subsequent status topic. + + Mechanical APDL Command: `COUPLE `_ + + Notes + ----- + + .. _COUPLE_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 = "COUPLE" + return self.run(command, **kwargs) + + def elem(self, **kwargs): + r"""Specifies "Elements" as the subsequent status topic. + + Mechanical APDL Command: `ELEM `_ + + Notes + ----- + + .. _ELEM_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 = "ELEM" + return self.run(command, **kwargs) + + def etype(self, **kwargs): + r"""Specifies "Element types" as the subsequent status topic. + + Mechanical APDL Command: `ETYPE `_ + + Notes + ----- + + .. _ETYPE_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 = "ETYPE" + return self.run(command, **kwargs) + + def febody(self, **kwargs): + r"""Specifies "Body loads on elements" as the subsequent status topic. + + Mechanical APDL Command: `FEBODY `_ + + Notes + ----- + + .. _FEBODY_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 = "FEBODY" + return self.run(command, **kwargs) + + def fecons(self, **kwargs): + r"""Specifies "Constraints on nodes" as the subsequent status topic. + + Mechanical APDL Command: `FECONS `_ + + Notes + ----- + + .. _FECONS_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 = "FECONS" + return self.run(command, **kwargs) + + def fefor(self, **kwargs): + r"""Specifies "Forces on nodes" as the subsequent status topic. + + Mechanical APDL Command: `FEFOR `_ + + Notes + ----- + + .. _FEFOR_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 = "FEFOR" + return self.run(command, **kwargs) + + def fesurf(self, **kwargs): + r"""Specifies "Surface loads on elements" as the subsequent status topic. + + Mechanical APDL Command: `FESURF `_ + + Notes + ----- + + .. _FESURF_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 = "FESURF" + return self.run(command, **kwargs) + + def geometry(self, **kwargs): + r"""Specifies "Geometry" as the subsequent status topic. + + Mechanical APDL Command: `GEOMETRY `_ + + Notes + ----- + + .. _GEOMETRY_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 = "GEOMETRY" + return self.run(command, **kwargs) + + def keypts(self, **kwargs): + r"""Specifies "Keypoints" as the subsequent status topic. + + Mechanical APDL Command: `KEYPTS `_ + + Notes + ----- + + .. _KEYPTS_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 = "KEYPTS" + return self.run(command, **kwargs) + + def line(self, **kwargs): + r"""Specifies "Lines" as the subsequent status topic. + + Mechanical APDL Command: `LINE `_ + + Notes + ----- + + .. _LINE_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 = "LINE" + return self.run(command, **kwargs) + + def mater(self, **kwargs): + r"""Specifies "Material properties" as the subsequent status topic. + + Mechanical APDL Command: `MATER `_ + + Notes + ----- + + .. _MATER_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 = "MATER" + return self.run(command, **kwargs) + + def meshing(self, **kwargs): + r"""Specifies "Meshing" as the subsequent status topic. + + Mechanical APDL Command: `MESHING `_ + + Notes + ----- + + .. _MESHING_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 = "MESHING" + return self.run(command, **kwargs) + + def nodes(self, **kwargs): + r"""Specifies "Nodes" as the subsequent status topic. + + Mechanical APDL Command: `NODES `_ + + Notes + ----- + + .. _NODES_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 = "NODES" + return self.run(command, **kwargs) + + def pipe(self, **kwargs): + r"""Specifies "Pipe modeling" as the subsequent status topic. + + Mechanical APDL Command: `PIPE `_ + + Notes + ----- + + .. _PIPE_notes: + + This is a status topic command. If status is requested for some items, it appears in the log + file ( :file:`Jobname.LOG` ). This command should be followed immediately by a :ref:`stat` command, + which reports the status for the specified topic. + + .. warning:: + + This command is archived in the latest version of the software. + + """ + command = "PIPE" + return self.run(command, **kwargs) + + def prim(self, **kwargs): + r"""Specifies "Solid model primitives" as the subsequent status topic. + + Mechanical APDL Command: `PRIM `_ + + Notes + ----- + + .. _PRIM_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 = "PRIM" + return self.run(command, **kwargs) + + def rcon(self, **kwargs): + r"""Specifies "Real constants" as the subsequent status topic. + + Mechanical APDL Command: `RCON `_ + + Notes + ----- + + .. _RCON_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 = "RCON" + return self.run(command, **kwargs) + + def selm(self, **kwargs): + r"""Specifies "Superelements" as the subsequent status topic. + + Mechanical APDL Command: `SELM `_ + + Notes + ----- + + .. _SELM_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 = "SELM" + return self.run(command, **kwargs) + + def tble(self, **kwargs): + r"""Specifies "Data table properties" as the subsequent status topic. + + Mechanical APDL Command: `TBLE `_ + + Notes + ----- + + .. _TBLE_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 = "TBLE" + return self.run(command, **kwargs) + + def volumes(self, **kwargs): + r"""Specifies "Volumes" as the subsequent status topic. + + Mechanical APDL Command: `VOLUMES `_ + + Notes + ----- + + .. _VOLUMES_notes: + + This is a status ( :ref:`stat` ) topic command. Status topic commands are generated by the GUI and + appear in the log file ( :file:`Jobname.LOG` ) if status is requested for some items by choosing + 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 = "VOLUMES" + return self.run(command, **kwargs) diff --git a/src/ansys/mapdl/core/_commands/prep7/superelements.py b/src/ansys/mapdl/core/_commands/prep7/superelements.py new file mode 100644 index 00000000000..288f28c8f5a --- /dev/null +++ b/src/ansys/mapdl/core/_commands/prep7/superelements.py @@ -0,0 +1,300 @@ +# 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 Superelements: + + def se(self, file: str = "", toler: str = "", nstartvn: str = "", **kwargs): + r"""Defines a superelement. + + Mechanical APDL Command: `SE `_ + + Parameters + ---------- + file : str + The name (case sensitive) of the file containing the original superelement matrix created by the + generation pass ( :file:`Sename.SUB` ). The default is the current Jobname. + + toler : str + Tolerance used to determine if use pass nodes are noncoincident with master nodes having the + same node numbers. Defaults to 0.0001. Use pass nodes will always be replaced by master nodes of + the same node number. However, if a use pass node is more than ``TOLER`` away from the + corresponding master node, a warning is generated. + + nstartvn : str + Node number to be assigned to the first virtual node created to store the generalized + coordinates in a component mode synthesis analysis. See :ref:`SE_notes` for more information. + + Notes + ----- + + .. _SE_notes: + + Defines a superelement by reading in the superelement matrices and master nodes from the + superelement matrix file. The matrix file ( :file:`File.SUB` ) must be available from the + substructure generation pass. The proper element type ( ``MATRIX50`` ) must be active ( :ref:`type` + ) for this command. A scratch file called :file:`File.SORD` showing the superelement names and their + corresponding element numbers is also written. + + ``nStartVN`` should be chosen so as to offset the virtual node numbers from the other node numbers + used in the model. Otherwise, ``nStartVN`` is internally set by the program to fulfill that + condition. The node number defined through ``nStartVN`` is considered only if applied on the first + issued :ref:`se` command. ``nStartVN`` can also be defined during the generation pass using the + :ref:`cmsopt` command. If ``nStartVN`` is defined on both :ref:`cmsopt` and :ref:`se` commands, the + larger number prevails. + """ + command = f"SE,{file},,,{toler},{nstartvn}" + return self.run(command, **kwargs) + + def sedlist(self, sename: str = "", kopt: int | str = "", **kwargs): + r"""Lists the DOF solution of a superelement after the use pass. + + Mechanical APDL Command: `SEDLIST `_ + + Parameters + ---------- + sename : str + Name of the superelement in :file:`Jobname.DSUB` to be listed. If a number, it is the element + number of the superelement as used in the use pass. If ALL, list results for all superelements. + + kopt : int or str + List key: + + * ``0`` - List summary data only. + + * ``1`` - List full contents. Be aware that the listing may be extensive. + + Notes + ----- + + .. _SEDLIST_notes: + + Lists the degree of freedom solution of a superelement after the substructure use pass. Results may + be listed for any superelement on :file:`FileDSUB`. + + This command is valid in any processor. + """ + command = f"SEDLIST,{sename},{kopt}" + return self.run(command, **kwargs) + + def selist(self, sename: str = "", kopt: int | str = "", kint: str = "", **kwargs): + r"""Lists the contents of a superelement matrix file. + + Mechanical APDL Command: `SELIST `_ + + Parameters + ---------- + sename : str + The name (case-sensitive) of the superelement matrix file created by the substructure generation + pass ( :file:`Sename.SUB` ). Defaults to the current :file:`Jobname`. If a number, it is the + element number of the superelement as used in the use pass. + + kopt : int or str + List key: + + * ``0`` - List summary data only. + + * ``1`` - List contents, except load vectors and matrices. + + * ``2`` - List contents, except matrices. + + * ``3`` - List full contents. Be aware that the listing may be extensive. + + kint : str + Integer printout format key: + + * ``OFF`` - Default. + + * ``ON`` - Long format for large integers. + + Notes + ----- + + .. _SELIST_notes: + + This command is valid in any processor. + """ + command = f"SELIST,{sename},{kopt},{kint}" + return self.run(command, **kwargs) + + def sesymm( + self, + sename: str = "", + ncomp: str = "", + inc: str = "", + file: str = "", + ext: str = "", + **kwargs, + ): + r"""Performs a symmetry operation on a superelement within the use pass. + + Mechanical APDL Command: `SESYMM `_ + + Parameters + ---------- + sename : str + The name (case-sensitive) of the superelement matrix file created by the substructure generation + pass ( :file:`Sename.SUB` ). Defaults to the current :file:`Jobname`. If a number, it is the + element number of a previously defined superelement in the current use pass. + + ncomp : str + Symmetry key: + + * ``X`` - X symmetry (default). + + * ``Y`` - Y symmetry. + + * ``Z`` - Z symmetry. + + inc : str + Increment all nodes in the superelement by ``INC``. + + file : str + File name and directory path (248 characters maximum, including the characters needed for the + directory path). An unspecified directory path defaults to the working directory; in this case, + you can use all 248 characters for the file name. This field must be input. + + ext : str + Filename extension (eight-character maximum). The extension defaults to SUB. + + Notes + ----- + + .. _SESYMM_notes: + + Performs a symmetry operation on a superelement within the substructure use pass by reversing the + sign of component ``Ncomp`` in the global Cartesian coordinate system. The node numbers are + incremented by ``INC``. The new superelement is written to :file:`File.SUB` in the current directory + (by default). All master node nodal coordinate systems must be global Cartesian (no rotated nodes + allowed). + + The maximum number of transformations for a given superelement is five (including :ref:`setran`, + :ref:`sesymm`, and the large rotation transformation if :ref:`nlgeom` is ON in the use pass). + + This command is not supported if the original superelement matrix was created in a component mode + synthesis analysis generation pass with the element results calculation activated ( ``Elcalc`` = YES + on :ref:`cmsopt` ). + """ + command = f"SESYMM,{sename},{ncomp},{inc},{file},{ext}" + return self.run(command, **kwargs) + + def setran( + self, + sename: str = "", + kcnto: str = "", + inc: str = "", + file: str = "", + ext: str = "", + dx: str = "", + dy: str = "", + dz: str = "", + norot: int | str = "", + **kwargs, + ): + r"""Creates a superelement from an existing superelement. + + Mechanical APDL Command: `SETRAN `_ + + Parameters + ---------- + sename : str + The name (case-sensitive) of the file containing the original superelement matrix created by the + generation pass ( :file:`Sename.SUB` ). The default is the current :file:`Jobname`. If + ``Sename`` is a number, it is the element number of a previously defined superelement in the + current use pass. + + kcnto : str + The reference number of the coordinate system to where the superelement is to be transferred. + The default is the global Cartesian system. Transfer occurs from the active coordinate system. + + inc : str + The node offset. The default is zero. All new element node numbers are offset from those on the + original by ``INC``. + + file : str + File name and directory path (248 characters maximum, including the characters needed for the + directory path). An unspecified directory path defaults to the working directory; in this case, + you can use all 248 characters for the file name. This field requires input. + + ext : str + Filename extension (eight-character maximum). The extension defaults to SUB. + + dx : str + Node location increments in the global Cartesian coordinate system. Defaults to zero. + + dy : str + Node location increments in the global Cartesian coordinate system. Defaults to zero. + + dz : str + Node location increments in the global Cartesian coordinate system. Defaults to zero. + + norot : int or str + Node rotation :ref:`key: ` + + * ``0`` - The nodal coordinate systems of the transferred superelement rotate into the ``KCNTO`` + system. (That is, the nodal coordinate systems rotate with the superelement.) The superelement + matrices remain unchanged. This value is the default. + + * ``1`` - The nodal coordinate systems do not rotate. (That is, they remain fixed in their original + global orientation.) The superelement matrices and load vectors are modified if any rotations occur. + + Notes + ----- + + .. _SETRAN_notes: + + The :ref:`setran` command creates a superelement from an existing superelement and writes the new + element to a file. You can then issue an :ref:`se` command to read the new element (during the `use + pass + `_ + ). + + You can create a superelement from an original by: + + * Transferring the original's geometry from the active coordinate system into another coordinate + system ( ``KCNTO`` ) + + * Offsetting its geometry in the global Cartesian coordinate system ( ``DX``, ``DY``, and ``DZ`` ) + + * Offsetting its node numbers ( ``INC`` ). + + A combination of methods is valid. If you specify both the geometry transfer and the geometry + offset, the transfer occurs first. + + If you specify rotation of the transferred superelement's nodal coordinate systems into the + ``KCNTO`` system ( ``NOROT`` = 0), the rotated nodes cannot be coupled via the :ref:`cp` command; in + this case, issue the :ref:`ce` command instead. If you specify no rotation of the nodal coordinate + systems ( ``NOROT`` = 1) for models with displacement degrees of freedom, and ``KCNTO`` is not the + active system, the superelement ``Sename`` must have six MDOF at each node that has MDOF; therefore, + only elements with all six structural DOFs are valid in such cases. + + There is no limit to the number of copies that can be made of a superelement, provided the copies + are all generated from the same original superelement. However, nested copies are limited to five. + In other words, the total number of different ``Sename`` usages on the :ref:`setran` and + :ref:`sesymm` commands is limited to five. + + This command is not supported if the original superelement matrix was created in a component mode + synthesis analysis generation pass with the element results calculation activated ( ``Elcalc`` = YES + on :ref:`cmsopt` ). + """ + command = f"SETRAN,{sename},{kcnto},{inc},{file},{ext},,{dx},{dy},{dz},{norot}" + return self.run(command, **kwargs) diff --git a/src/ansys/mapdl/core/_commands/prep7/volumes.py b/src/ansys/mapdl/core/_commands/prep7/volumes.py new file mode 100644 index 00000000000..1e62efbd540 --- /dev/null +++ b/src/ansys/mapdl/core/_commands/prep7/volumes.py @@ -0,0 +1,1372 @@ +# 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 ansys.mapdl.core._commands import parse + + +class Volumes: + + def extopt( + self, + lab: str = "", + val1: str = "", + val2: str = "", + val3: str = "", + val4: str = "", + **kwargs, + ): + r"""Controls options relating to the generation of volume elements from area elements. + + Mechanical APDL Command: `EXTOPT `_ + + Parameters + ---------- + lab : str + Label identifying the control option. The meanings of ``Val1``, ``Val2``, and ``Val3`` will vary depending on ``Lab``. + + * ``ON`` - Sets carryover of the material attributes, real constant attributes, and element + coordinate system attributes of the pattern area elements to the generated volume elements. Sets the + pattern area mesh to clear when volume generations are done. ``Val1``, ``Val2``, and ``Val3`` are + ignored. + + * ``OFF`` - Removes all settings associated with this command. ``Val1``, ``Val2``, and ``Val3`` are + ignored. + + * ``STAT`` - Shows all settings associated with this command. ``Val1``, ``Val2``, ``Val3``, and + ``Val4`` are ignored. + + * ``ATTR`` - Sets carryover of particular pattern area attributes (materials, real constants, and element + coordinate systems) of the pattern area elements to the generated volume elements. (See :ref:`EXTOPT_notes_2`.) ``Val1`` can be: + + * ``0`` - Sets volume elements to use current :ref:`mat` command settings. + + * ``1`` - Sets volume elements to use material attributes of the pattern area elements. + + ``Val2`` can be: + + * ``0`` - Sets volume elements to use current :ref:`real` command settings. + + * ``1`` - Sets volume elements to use real constant attributes of the pattern area elements. + + ``Val3`` can be: + + * ``0`` - Sets volume elements to use current :ref:`esys` command settings. + + * ``1`` - Sets volume elements to use element coordinate system attributes of the pattern area + elements. + + ``Val4`` can be: + + * ``0`` - Sets volume elements to use current :ref:`secnum` command settings. + + * ``1`` - Sets volume elements to use section attributes of the pattern area elements. + + * ``ESIZE`` - Val1 sets the number of element divisions in the direction of volume generation or + volume sweep. For :ref:`vdrag` and :ref:`vsweep`, ``Val1`` is overridden by the :ref:`lesize` + command ``NDIV`` setting. ``Val2`` sets the spacing ratio (bias) in the direction of volume + generation or volume sweep. If positive, ``Val2`` is the nominal ratio of last division size to + first division size (if > 1.0, sizes increase, if < 1.0, sizes decrease). If negative, ``Val2`` is + the nominal ratio of center division(s) size to end divisions size. Ratio defaults to 1.0 (uniform + spacing). ``Val3`` and ``Val4`` are ignored. + + * ``ACLEAR`` - Sets clearing of pattern area mesh. (See :ref:`EXTOPT_notes_3`.) ``Val1`` can be: + + * ``0`` - Sets pattern area to remain meshed when volume generation is done. + + * ``1`` - Sets pattern area mesh to clear when volume generation is done. ``Val2``, ``Val3``, and + ``Val4`` are ignored. + + * ``VSWE`` - Indicates that volume sweeping options will be set using ``Val1`` and ``Val2``. Settings specified with :ref:`extopt`, ``VSWE`` will be used the next time the :ref:`vsweep` command is invoked. If ``Lab`` = VSWE, ``Val1`` becomes a label. ``Val1`` can be: + + * ``AUTO`` - Indicates whether you will be prompted for the source and target used by :ref:`vsweep` + or if VSWE should automatically determine the source and target. If ``Val1`` = AUTO, ``Val2`` is ON + by default. VSWE will automatically determine the source and target for :ref:`vsweep`. You will be + allowed to pick more than one volume for sweeping. When ``Val2`` = OFF, the application prompts you + for the source and target for :ref:`vsweep`. You will only be allowed to pick one volume for + sweeping. + + * ``TETS`` - Indicates whether :ref:`vsweep` will tet mesh non-sweepable volumes or leave them + unmeshed. If ``Val1`` = TETS, ``Val2`` is OFF by default. Non-sweepable volumes will be left + unmeshed. When ``Val2`` = ON, the non-sweepable volumes will be tet meshed if the assigned element + type supports tet shaped elements. + + ``Val3`` is ignored for Lab = VSWE. + + val1 : str + Additional input values as described under each option for ``Lab``. + + val2 : str + Additional input values as described under each option for ``Lab``. + + val3 : str + Additional input values as described under each option for ``Lab``. + + val4 : str + Additional input values as described under each option for ``Lab``. + + Notes + ----- + + .. _EXTOPT_notes: + + .. _EXTOPT_notes_1: + + :ref:`extopt` controls options relating to the generation of volume elements from pattern area + elements using the :ref:`vext`, :ref:`vrotat`, :ref:`voffst`, :ref:`vdrag`, and :ref:`vsweep` + commands. (When using :ref:`vsweep`, the pattern area is referred to as the source area.) + + .. _EXTOPT_notes_2: + + Enables carryover of the attributes of the pattern area elements to the generated volume elements + when you are using :ref:`vext`, :ref:`vrotat`, :ref:`voffst`, or :ref:`vdrag`. (When using + :ref:`vsweep`, since the volume already exists, use the :ref:`vatt` command to assign attributes + before sweeping.) + + .. _EXTOPT_notes_3: + + When you are using :ref:`vext`, :ref:`vrotat`, :ref:`voffst`, or :ref:`vdrag`, enables clearing of + the pattern area mesh when volume generations are done. (When you are using :ref:`vsweep`, if + selected, the area meshes on the pattern (source), target, and/or side areas clear when volume + sweeping is done.) + + .. _EXTOPT_notes_4: + + Neither :ref:`extopt`,VSWE,AUTO nor :ref:`extopt`,VSWE,TETS will be affected by :ref:`extopt`,ON or + :ref:`extopt`, OFF. + """ + command = f"EXTOPT,{lab},{val1},{val2},{val3},{val4}" + return self.run(command, **kwargs) + + def v( + self, + p1: str = "", + p2: str = "", + p3: str = "", + p4: str = "", + p5: str = "", + p6: str = "", + p7: str = "", + p8: str = "", + **kwargs, + ): + r"""Defines a volume through keypoints. + + Mechanical APDL Command: `V `_ + + Parameters + ---------- + p1 : str + Keypoint defining starting corner of volume. If ``P1`` = P, graphical picking is enabled and all + remaining command fields are ignored (valid only in the GUI). + + p2 : str + Keypoint defining second corner of volume. + + p3 : str + Keypoint defining third corner of volume. + + p4 : str + Keypoint defining fourth corner of volume. + + p5 : str + Keypoint defining fifth corner of volume. + + p6 : str + Keypoint defining sixth corner of volume. + + p7 : str + Keypoint defining seventh corner of volume. + + p8 : str + Keypoint defining eighth corner of volume. + + Returns + ------- + int + Volume number of the generated volume. + + Notes + ----- + **Notes** + + .. _V_notes: + + Defines a volume (and its corresponding lines and areas) through eight (or fewer) existing + keypoints. Keypoints must be input in a continuous order. The order of the keypoints should be + around the bottom and then the top. Missing lines are generated "straight" in the active coordinate + system and assigned the lowest available numbers ( :ref:`numstr` ). Missing areas are generated and + assigned the lowest available numbers. + + Solid modeling in a toroidal coordinate system is not recommended. + + Certain faces may be condensed to a line or point by repeating keypoints. For example, use + :ref:`v`, ``P1``, ``P2``, ``P3``, ``P3``, ``P5``, ``P6``, ``P7``, ``P7`` for a triangular prism or + :ref:`v`, ``P1``, ``P2``, ``P3``, ``P3``, ``P5``, ``P5``, ``P5``, ``P5`` for a tetrahedron. + + Using keypoints to produce partial sections in :ref:`csys` = 2 can generate anomalies; check the + resulting volumes carefully. + + Examples + -------- + Create a simple cube volume. + + >>> k0 = mapdl.k("", 0, 0, 0) + >>> k1 = mapdl.k("", 1, 0, 0) + >>> k2 = mapdl.k("", 1, 1, 0) + >>> k3 = mapdl.k("", 0, 1, 0) + >>> k4 = mapdl.k("", 0, 0, 1) + >>> k5 = mapdl.k("", 1, 0, 1) + >>> k6 = mapdl.k("", 1, 1, 1) + >>> k7 = mapdl.k("", 0, 1, 1) + >>> v0 = mapdl.v(k0, k1, k2, k3, k4, k5, k6, k7) + >>> v0 + 1 + + Create a triangular prism + + >>> k0 = mapdl.k("", 0, 0, 0) + >>> k1 = mapdl.k("", 1, 0, 0) + >>> k2 = mapdl.k("", 1, 1, 0) + >>> k3 = mapdl.k("", 0, 1, 0) + >>> k4 = mapdl.k("", 0, 0, 1) + >>> k5 = mapdl.k("", 1, 0, 1) + >>> k6 = mapdl.k("", 1, 1, 1) + >>> k7 = mapdl.k("", 0, 1, 1) + >>> v1 = mapdl.v(k0, k1, k2, k2, k4, k5, k6, k6) + >>> v1 + 2 + + Create a tetrahedron + + >>> k0 = mapdl.k("", 0, 0, 0) + >>> k1 = mapdl.k("", 1, 0, 0) + >>> k2 = mapdl.k("", 1, 1, 0) + >>> k3 = mapdl.k("", 0, 0, 1) + >>> v2 = mapdl.v(k0, k1, k2, k2, k3, k3, k3, k3) + >>> v2 + 3 + """ + command = f"V,{p1},{p2},{p3},{p4},{p5},{p6},{p7},{p8}" + return parse.parse_v(self.run(command, **kwargs)) + + def va( + self, + a1: str = "", + a2: str = "", + a3: str = "", + a4: str = "", + a5: str = "", + a6: str = "", + a7: str = "", + a8: str = "", + a9: str = "", + a10: str = "", + **kwargs, + ): + r"""Generates a volume bounded by existing areas. + + Mechanical APDL Command: `VA `_ + + Parameters + ---------- + a1 : str + List of areas defining volume. The minimum number of areas is 4. If ``A1`` = ALL, use all + selected ( :ref:`asel` ) areas and ignore ``A2`` to ``A10``. If ``A1`` = P, graphical picking is + enabled and all remaining command fields are ignored (valid only in the GUI). A component name + may also be substituted for ``A1``. + + a2 : str + List of areas defining volume. The minimum number of areas is 4. If ``A1`` = ALL, use all + selected ( :ref:`asel` ) areas and ignore ``A2`` to ``A10``. If ``A1`` = P, graphical picking is + enabled and all remaining command fields are ignored (valid only in the GUI). A component name + may also be substituted for ``A1``. + + a3 : str + List of areas defining volume. The minimum number of areas is 4. If ``A1`` = ALL, use all + selected ( :ref:`asel` ) areas and ignore ``A2`` to ``A10``. If ``A1`` = P, graphical picking is + enabled and all remaining command fields are ignored (valid only in the GUI). A component name + may also be substituted for ``A1``. + + a4 : str + List of areas defining volume. The minimum number of areas is 4. If ``A1`` = ALL, use all + selected ( :ref:`asel` ) areas and ignore ``A2`` to ``A10``. If ``A1`` = P, graphical picking is + enabled and all remaining command fields are ignored (valid only in the GUI). A component name + may also be substituted for ``A1``. + + a5 : str + List of areas defining volume. The minimum number of areas is 4. If ``A1`` = ALL, use all + selected ( :ref:`asel` ) areas and ignore ``A2`` to ``A10``. If ``A1`` = P, graphical picking is + enabled and all remaining command fields are ignored (valid only in the GUI). A component name + may also be substituted for ``A1``. + + a6 : str + List of areas defining volume. The minimum number of areas is 4. If ``A1`` = ALL, use all + selected ( :ref:`asel` ) areas and ignore ``A2`` to ``A10``. If ``A1`` = P, graphical picking is + enabled and all remaining command fields are ignored (valid only in the GUI). A component name + may also be substituted for ``A1``. + + a7 : str + List of areas defining volume. The minimum number of areas is 4. If ``A1`` = ALL, use all + selected ( :ref:`asel` ) areas and ignore ``A2`` to ``A10``. If ``A1`` = P, graphical picking is + enabled and all remaining command fields are ignored (valid only in the GUI). A component name + may also be substituted for ``A1``. + + a8 : str + List of areas defining volume. The minimum number of areas is 4. If ``A1`` = ALL, use all + selected ( :ref:`asel` ) areas and ignore ``A2`` to ``A10``. If ``A1`` = P, graphical picking is + enabled and all remaining command fields are ignored (valid only in the GUI). A component name + may also be substituted for ``A1``. + + a9 : str + List of areas defining volume. The minimum number of areas is 4. If ``A1`` = ALL, use all + selected ( :ref:`asel` ) areas and ignore ``A2`` to ``A10``. If ``A1`` = P, graphical picking is + enabled and all remaining command fields are ignored (valid only in the GUI). A component name + may also be substituted for ``A1``. + + a10 : str + List of areas defining volume. The minimum number of areas is 4. If ``A1`` = ALL, use all + selected ( :ref:`asel` ) areas and ignore ``A2`` to ``A10``. If ``A1`` = P, graphical picking is + enabled and all remaining command fields are ignored (valid only in the GUI). A component name + may also be substituted for ``A1``. + + Returns + ------- + int + Volume number of the volume. + + Notes + ----- + + .. _VA_notes: + + This command conveniently allows generating volumes from regions having more than eight keypoints + (which is not allowed with the :ref:`v` command). Areas may be input in any order. The exterior + surface of a :ref:`va` volume must be continuous, but holes may pass completely through it. + + Examples + -------- + Create a simple tetrahedral bounded by 4 areas. + + >>> k0 = mapdl.k('', -1, 0, 0) + >>> k1 = mapdl.k('', 1, 0, 0) + >>> k2 = mapdl.k('', 1, 1, 0) + >>> k3 = mapdl.k('', 1, 0.5, 1) + >>> a0 = mapdl.a(k0, k1, k2) + >>> a1 = mapdl.a(k0, k1, k3) + >>> a2 = mapdl.a(k1, k2, k3) + >>> a3 = mapdl.a(k0, k2, k3) + >>> vnum = mapdl.va(a0, a1, a2, a3) + >>> vnum + 1 + """ + command = f"VA,{a1},{a2},{a3},{a4},{a5},{a6},{a7},{a8},{a9},{a10}" + return parse.parse_v(self.run(command, **kwargs)) + + def vdele( + self, + nv1: str = "", + nv2: str = "", + ninc: str = "", + kswp: int | str = "", + **kwargs, + ): + r"""Deletes unmeshed volumes. + + Mechanical APDL Command: `VDELE `_ + + Parameters + ---------- + nv1 : str + Delete volumes from ``NV1`` to ``NV2`` (defaults to ``NV1`` ) in steps of ``NINC`` (defaults to + 1). If ``NV1`` = ALL, ``NV2`` and ``NINC`` are ignored and all selected volumes ( :ref:`vsel` ) + are deleted. If ``NV1`` = P, graphical picking is enabled and all remaining command fields are + ignored (valid only in the GUI). A component name may also be substituted for ``NV1`` ( ``NV2`` + and ``NINC`` are ignored). + + nv2 : str + Delete volumes from ``NV1`` to ``NV2`` (defaults to ``NV1`` ) in steps of ``NINC`` (defaults to + 1). If ``NV1`` = ALL, ``NV2`` and ``NINC`` are ignored and all selected volumes ( :ref:`vsel` ) + are deleted. If ``NV1`` = P, graphical picking is enabled and all remaining command fields are + ignored (valid only in the GUI). A component name may also be substituted for ``NV1`` ( ``NV2`` + and ``NINC`` are ignored). + + ninc : str + Delete volumes from ``NV1`` to ``NV2`` (defaults to ``NV1`` ) in steps of ``NINC`` (defaults to + 1). If ``NV1`` = ALL, ``NV2`` and ``NINC`` are ignored and all selected volumes ( :ref:`vsel` ) + are deleted. If ``NV1`` = P, graphical picking is enabled and all remaining command fields are + ignored (valid only in the GUI). A component name may also be substituted for ``NV1`` ( ``NV2`` + and ``NINC`` are ignored). + + kswp : int or str + Specifies whether keypoints, lines, and areas are also deleted: + + * ``0`` - Delete volumes only (default). + + * ``1`` - Delete volumes, as well as keypoints, lines, and areas attached to the specified volumes + but not shared by other volumes. + + """ + command = f"VDELE,{nv1},{nv2},{ninc},{kswp}" + return self.run(command, **kwargs) + + def vdgl(self, nv1: str = "", nv2: str = "", ninc: str = "", **kwargs): + r"""Lists keypoints of a volume that lie on a parametric degeneracy. + + Mechanical APDL Command: `VDGL `_ + + Parameters + ---------- + nv1 : str + List keypoints that lie on a parametric degeneracy on volumes from ``NV1`` to ``NV2`` (defaults + to ``NV1`` ) in steps of ``NINC`` (defaults to 1). If ``NV1`` = ALL (default), ``NV2`` and + ``NINC`` will be ignored and keypoints on all selected volumes ( :ref:`vsel` ) will be listed. + If ``NV1`` = P, graphical picking is enabled and all remaining command fields are ignored (valid + only in the GUI). You may also substitute a component name for ``NV1`` (ignore ``NV2`` and + ``NINC`` ). + + nv2 : str + List keypoints that lie on a parametric degeneracy on volumes from ``NV1`` to ``NV2`` (defaults + to ``NV1`` ) in steps of ``NINC`` (defaults to 1). If ``NV1`` = ALL (default), ``NV2`` and + ``NINC`` will be ignored and keypoints on all selected volumes ( :ref:`vsel` ) will be listed. + If ``NV1`` = P, graphical picking is enabled and all remaining command fields are ignored (valid + only in the GUI). You may also substitute a component name for ``NV1`` (ignore ``NV2`` and + ``NINC`` ). + + ninc : str + List keypoints that lie on a parametric degeneracy on volumes from ``NV1`` to ``NV2`` (defaults + to ``NV1`` ) in steps of ``NINC`` (defaults to 1). If ``NV1`` = ALL (default), ``NV2`` and + ``NINC`` will be ignored and keypoints on all selected volumes ( :ref:`vsel` ) will be listed. + If ``NV1`` = P, graphical picking is enabled and all remaining command fields are ignored (valid + only in the GUI). You may also substitute a component name for ``NV1`` (ignore ``NV2`` and + ``NINC`` ). + + Notes + ----- + + .. _VDGL_notes: + + See the `Modeling and Meshing Guide + `_ for details + about parametric degeneracies. + + This command is valid in any processor. + """ + command = f"VDGL,{nv1},{nv2},{ninc}" + return self.run(command, **kwargs) + + def vdrag( + self, + na1: str = "", + na2: str = "", + na3: str = "", + na4: str = "", + na5: str = "", + na6: str = "", + nlp1: str = "", + nlp2: str = "", + nlp3: str = "", + nlp4: str = "", + nlp5: str = "", + nlp6: str = "", + **kwargs, + ): + r"""Generates volumes by dragging an area pattern along a path. + + Mechanical APDL Command: `VDRAG `_ + + Parameters + ---------- + na1 : str + List of areas in the pattern to be dragged (6 maximum if using keyboard entry). If ``NA1`` = P, + graphical picking is enabled and all remaining command fields are ignored (valid only in the + GUI). If ``NA1`` = ALL, all selected areas will be swept along the path. A component name may + also be substituted for ``NA1``. + + na2 : str + List of areas in the pattern to be dragged (6 maximum if using keyboard entry). If ``NA1`` = P, + graphical picking is enabled and all remaining command fields are ignored (valid only in the + GUI). If ``NA1`` = ALL, all selected areas will be swept along the path. A component name may + also be substituted for ``NA1``. + + na3 : str + List of areas in the pattern to be dragged (6 maximum if using keyboard entry). If ``NA1`` = P, + graphical picking is enabled and all remaining command fields are ignored (valid only in the + GUI). If ``NA1`` = ALL, all selected areas will be swept along the path. A component name may + also be substituted for ``NA1``. + + na4 : str + List of areas in the pattern to be dragged (6 maximum if using keyboard entry). If ``NA1`` = P, + graphical picking is enabled and all remaining command fields are ignored (valid only in the + GUI). If ``NA1`` = ALL, all selected areas will be swept along the path. A component name may + also be substituted for ``NA1``. + + na5 : str + List of areas in the pattern to be dragged (6 maximum if using keyboard entry). If ``NA1`` = P, + graphical picking is enabled and all remaining command fields are ignored (valid only in the + GUI). If ``NA1`` = ALL, all selected areas will be swept along the path. A component name may + also be substituted for ``NA1``. + + na6 : str + List of areas in the pattern to be dragged (6 maximum if using keyboard entry). If ``NA1`` = P, + graphical picking is enabled and all remaining command fields are ignored (valid only in the + GUI). If ``NA1`` = ALL, all selected areas will be swept along the path. A component name may + also be substituted for ``NA1``. + + nlp1 : str + List of lines defining the path along which the pattern is to be dragged (6 maximum if using + keyboard entry). Must be a continuous set of lines. To be continuous, adjacent lines must share + the connecting keypoint (the end keypoint of one line must also be first keypoint of the next + line). + + nlp2 : str + List of lines defining the path along which the pattern is to be dragged (6 maximum if using + keyboard entry). Must be a continuous set of lines. To be continuous, adjacent lines must share + the connecting keypoint (the end keypoint of one line must also be first keypoint of the next + line). + + nlp3 : str + List of lines defining the path along which the pattern is to be dragged (6 maximum if using + keyboard entry). Must be a continuous set of lines. To be continuous, adjacent lines must share + the connecting keypoint (the end keypoint of one line must also be first keypoint of the next + line). + + nlp4 : str + List of lines defining the path along which the pattern is to be dragged (6 maximum if using + keyboard entry). Must be a continuous set of lines. To be continuous, adjacent lines must share + the connecting keypoint (the end keypoint of one line must also be first keypoint of the next + line). + + nlp5 : str + List of lines defining the path along which the pattern is to be dragged (6 maximum if using + keyboard entry). Must be a continuous set of lines. To be continuous, adjacent lines must share + the connecting keypoint (the end keypoint of one line must also be first keypoint of the next + line). + + nlp6 : str + List of lines defining the path along which the pattern is to be dragged (6 maximum if using + keyboard entry). Must be a continuous set of lines. To be continuous, adjacent lines must share + the connecting keypoint (the end keypoint of one line must also be first keypoint of the next + line). + + Notes + ----- + + .. _VDRAG_notes: + + Generates volumes (and their corresponding keypoints, lines, and areas) by sweeping a given area + pattern along a characteristic drag path. If the drag path consists of multiple lines, the drag + direction is determined by the sequence in which the path lines are input ( ``NLP1``, ``NLP2``, + etc.). If the drag path is a single line ( ``NLP1`` ), the drag direction is from the keypoint on + the drag line that is closest to the first keypoint of the given area pattern to the other end of + the drag line. + + The magnitude of the vector between the keypoints of the given pattern and the first path keypoint + remains constant for all generated keypoint patterns and the path keypoints. The direction of the + vector relative to the path slope also remains constant so that patterns may be swept around curves. + Lines are generated with the same shapes as the given pattern and the path lines. + + Keypoint, line, area, and volume numbers are automatically assigned (beginning with the lowest + available values ( :ref:`numstr` )). Adjacent lines use a common keypoint, adjacent areas use a + common line, and adjacent volumes use a common area. For best results, the entities to be dragged + should be orthogonal to the start of the drag path. Drag operations that produce an error message + may create some of the desired entities prior to terminating. + + If element attributes have been associated with the input area via the :ref:`aatt` command, the + opposite area generated by the :ref:`vdrag` operation will also have those attributes (that is, the + element attributes from the input area are copied to the opposite area). Note that only the area + opposite the input area will have the same attributes as the input area; the areas adjacent to the + input area will not. + + If the input areas are meshed or belong to a meshed volume, the area(s) can be extruded to a 3D + mesh. Note that the ``NDIV`` argument of the :ref:`esize` command should be set before extruding the + meshed areas. Alternatively, mesh divisions can be specified directly on the drag line(s) ( + :ref:`lesize` ). See the `Modeling and Meshing Guide + `_ for more + information. + + You can use the :ref:`vdrag` command to generate 3D interface element meshes for elements + ``INTER194`` and ``INTER195``. When generating interface element meshes using :ref:`vdrag`, you must + specify the line divisions to generate one interface element directly on the drag line using the + :ref:`lesize` command. The source area to be extruded becomes the bottom surface of the interface + element. Interface elements must be extruded in what will become the element's local x direction, + that is, bottom to top. + """ + command = f"VDRAG,{na1},{na2},{na3},{na4},{na5},{na6},{nlp1},{nlp2},{nlp3},{nlp4},{nlp5},{nlp6}" + return self.run(command, **kwargs) + + def vext( + self, + na1: str = "", + na2: str = "", + ninc: str = "", + dx: str = "", + dy: str = "", + dz: str = "", + rx: str = "", + ry: str = "", + rz: str = "", + **kwargs, + ): + r"""Generates additional volumes by extruding areas. + + Mechanical APDL Command: `VEXT `_ + + Parameters + ---------- + na1 : str + Set of areas ( ``NA1`` to ``NA2`` in steps of ``NINC`` ) that defines the pattern to be + extruded. ``NA2`` defaults to ``NA1``, ``NINC`` defaults to 1. If ``NA1`` = ALL, ``NA2`` and + ``NINC`` are ignored and the pattern is defined by all selected areas. If ``NA1`` = P, graphical + picking is enabled and all remaining command fields are ignored (valid only in the GUI). A + component name may also be substituted for ``NA1`` ( ``NA2`` and ``NINC`` are ignored). + + na2 : str + Set of areas ( ``NA1`` to ``NA2`` in steps of ``NINC`` ) that defines the pattern to be + extruded. ``NA2`` defaults to ``NA1``, ``NINC`` defaults to 1. If ``NA1`` = ALL, ``NA2`` and + ``NINC`` are ignored and the pattern is defined by all selected areas. If ``NA1`` = P, graphical + picking is enabled and all remaining command fields are ignored (valid only in the GUI). A + component name may also be substituted for ``NA1`` ( ``NA2`` and ``NINC`` are ignored). + + ninc : str + Set of areas ( ``NA1`` to ``NA2`` in steps of ``NINC`` ) that defines the pattern to be + extruded. ``NA2`` defaults to ``NA1``, ``NINC`` defaults to 1. If ``NA1`` = ALL, ``NA2`` and + ``NINC`` are ignored and the pattern is defined by all selected areas. If ``NA1`` = P, graphical + picking is enabled and all remaining command fields are ignored (valid only in the GUI). A + component name may also be substituted for ``NA1`` ( ``NA2`` and ``NINC`` are ignored). + + dx : str + Increments to be applied to the X, Y, and Z keypoint coordinates in the active coordinate system + ( DR, Dθ, DZ for cylindrical; DR, Dθ, DΦ for spherical). + + dy : str + Increments to be applied to the X, Y, and Z keypoint coordinates in the active coordinate system + ( DR, Dθ, DZ for cylindrical; DR, Dθ, DΦ for spherical). + + dz : str + Increments to be applied to the X, Y, and Z keypoint coordinates in the active coordinate system + ( DR, Dθ, DZ for cylindrical; DR, Dθ, DΦ for spherical). + + rx : str + Scale factors to be applied to the X, Y, and Z keypoint coordinates in the active coordinate + system ( RR, Rθ, RZ for cylindrical; RR, Rθ, RΦ for spherical). Note that the Rθ and RΦ scale + factors are interpreted as angular offsets. For example, if CSYS = 1, ``RX``, ``RY``, ``RZ`` + input of (1.5,10,3) would scale the specified keypoints 1.5 times in the radial and 3 times in + the Z direction, while adding an offset of 10 degrees to the keypoints. Zero, blank, or negative + scale factor values are assumed to be 1.0. Zero or blank angular offsets have no effect. + + ry : str + Scale factors to be applied to the X, Y, and Z keypoint coordinates in the active coordinate + system ( RR, Rθ, RZ for cylindrical; RR, Rθ, RΦ for spherical). Note that the Rθ and RΦ scale + factors are interpreted as angular offsets. For example, if CSYS = 1, ``RX``, ``RY``, ``RZ`` + input of (1.5,10,3) would scale the specified keypoints 1.5 times in the radial and 3 times in + the Z direction, while adding an offset of 10 degrees to the keypoints. Zero, blank, or negative + scale factor values are assumed to be 1.0. Zero or blank angular offsets have no effect. + + rz : str + Scale factors to be applied to the X, Y, and Z keypoint coordinates in the active coordinate + system ( RR, Rθ, RZ for cylindrical; RR, Rθ, RΦ for spherical). Note that the Rθ and RΦ scale + factors are interpreted as angular offsets. For example, if CSYS = 1, ``RX``, ``RY``, ``RZ`` + input of (1.5,10,3) would scale the specified keypoints 1.5 times in the radial and 3 times in + the Z direction, while adding an offset of 10 degrees to the keypoints. Zero, blank, or negative + scale factor values are assumed to be 1.0. Zero or blank angular offsets have no effect. + + Notes + ----- + + .. _VEXT_notes: + + Generates additional volumes (and their corresponding keypoints, lines, and areas) by extruding and + scaling a pattern of areas in the active coordinate system. + + If element attributes have been associated with the input area via the :ref:`aatt` command, the + opposite area generated by the :ref:`vext` operation will also have those attributes (that is, the + element attributes from the input area are copied to the opposite area). Note that only the area + opposite the input area will have the same attributes as the input area; the areas adjacent to the + input area will not. + + If the areas are meshed or belong to meshed volumes, a 3D mesh can be extruded with this command. + Note that the ``NDIV`` argument on the :ref:`esize` command should be set before extruding the + meshed areas. + + Scaling of the input areas, if specified, is performed first, followed by the extrusion. + + In a non-Cartesian coordinate system, the :ref:`vext` command locates the end face of the volume + based on the active coordinate system. However, the extrusion is made along a straight line between + the end faces. Note that solid modeling in a toroidal coordinate system is not recommended. + + .. warning:: + + Use of the VEXT command can produce unexpected results when operating in a non-Cartesian + coordinate system. For a detailed description of the possible problems that may occur, see + Solid Modelingin the `Modeling and Meshing Guide `_. + """ + command = f"VEXT,{na1},{na2},{ninc},{dx},{dy},{dz},{rx},{ry},{rz}" + return self.run(command, **kwargs) + + def vgen( + self, + itime: str = "", + nv1: str = "", + nv2: str = "", + ninc: str = "", + dx: str = "", + dy: str = "", + dz: str = "", + kinc: str = "", + noelem: int | str = "", + imove: int | str = "", + **kwargs, + ): + r"""Generates additional volumes from a pattern of volumes. + + Mechanical APDL Command: `VGEN `_ + + Parameters + ---------- + itime : str + Do this generation operation a total of ``ITIME`` s, incrementing all keypoints in the given + pattern automatically (or by ``KINC`` ) each time after the first. ``ITIME`` must be > 1 for + generation to occur. + + nv1 : str + Generate volumes from pattern beginning with ``NV1`` to ``NV2`` (defaults to ``NV1`` ) in steps + of ``NINC`` (defaults to 1). If ``NV1`` = ALL, ``NV2`` and ``NINC`` are ignored and the pattern + is all selected volumes ( :ref:`vsel` ). If ``NV1`` = P, graphical picking is enabled and all + remaining command fields are ignored (valid only in the GUI). A component name may also be + substituted for ``NV1`` ( ``NV2`` and ``NINC`` are ignored). + + nv2 : str + Generate volumes from pattern beginning with ``NV1`` to ``NV2`` (defaults to ``NV1`` ) in steps + of ``NINC`` (defaults to 1). If ``NV1`` = ALL, ``NV2`` and ``NINC`` are ignored and the pattern + is all selected volumes ( :ref:`vsel` ). If ``NV1`` = P, graphical picking is enabled and all + remaining command fields are ignored (valid only in the GUI). A component name may also be + substituted for ``NV1`` ( ``NV2`` and ``NINC`` are ignored). + + ninc : str + Generate volumes from pattern beginning with ``NV1`` to ``NV2`` (defaults to ``NV1`` ) in steps + of ``NINC`` (defaults to 1). If ``NV1`` = ALL, ``NV2`` and ``NINC`` are ignored and the pattern + is all selected volumes ( :ref:`vsel` ). If ``NV1`` = P, graphical picking is enabled and all + remaining command fields are ignored (valid only in the GUI). A component name may also be + substituted for ``NV1`` ( ``NV2`` and ``NINC`` are ignored). + + dx : str + Keypoint location increments in the active coordinate system (--, Dθ, DZ for cylindrical, --, + Dθ, -- for spherical). + + dy : str + Keypoint location increments in the active coordinate system (--, Dθ, DZ for cylindrical, --, + Dθ, -- for spherical). + + dz : str + Keypoint location increments in the active coordinate system (--, Dθ, DZ for cylindrical, --, + Dθ, -- for spherical). + + kinc : str + Keypoint increment between generated sets. If zero, the lowest available keypoint numbers are + assigned ( :ref:`numstr` ). + + noelem : int or str + Specifies if elements and nodes are also to be generated: + + * ``0`` - Generate nodes and elements associated with the original volumes, if they exist. + + * ``1`` - Do not generate nodes and elements. + + imove : int or str + Specifies whether to redefine the existing volumes: + + * ``0`` - Generate additional volumes as requested with the ``ITIME`` argument. + + * ``1`` - Move original volumes to new position retaining the same keypoint line, and area numbers ( + ``ITIME``, ``KINC``, and ``NOELEM`` are ignored). Corresponding meshed items are also moved if not + needed at their original position. + + Notes + ----- + + .. _VGEN_notes: + + Generates additional volumes (and their corresponding keypoints, lines, areas and mesh) from a given + volume pattern. The MAT, TYPE, REAL, and ESYS attributes are based upon the volumes in the pattern + and not upon the current settings of the pointers. End slopes of the generated lines remain the same + (in the active coordinate system) as those of the given pattern. For example, radial slopes remain + radial, etc. Generations which produce volumes of a size or shape different from the pattern (that + is, radial generations in cylindrical systems, radial and phi generations in spherical systems, and + theta generations in elliptical systems) are not allowed. Note that solid modeling in a toroidal + coordinate system is not recommended. Volume, area, and line numbers are automatically assigned + (beginning with the lowest available values ( :ref:`numstr` )). + """ + command = ( + f"VGEN,{itime},{nv1},{nv2},{ninc},{dx},{dy},{dz},{kinc},{noelem},{imove}" + ) + return self.run(command, **kwargs) + + def vlist(self, nv1: str = "", nv2: str = "", ninc: str = "", **kwargs): + r"""Lists the defined volumes. + + Mechanical APDL Command: `VLIST `_ + + Parameters + ---------- + nv1 : str + List volumes from ``NV1`` to ``NV2`` (defaults to ``NV1`` ) in steps of ``NINC`` (defaults to + 1). If ``NV1`` = ALL (default), ``NV2`` and ``NINC`` are ignored and all selected volumes ( + :ref:`vsel` ) are listed. If ``NV1`` = P, graphical picking is enabled and all remaining command + fields are ignored (valid only in the GUI). A component name may also be substituted for ``NV1`` + ( ``NV2`` and ``NINC`` are ignored). + + nv2 : str + List volumes from ``NV1`` to ``NV2`` (defaults to ``NV1`` ) in steps of ``NINC`` (defaults to + 1). If ``NV1`` = ALL (default), ``NV2`` and ``NINC`` are ignored and all selected volumes ( + :ref:`vsel` ) are listed. If ``NV1`` = P, graphical picking is enabled and all remaining command + fields are ignored (valid only in the GUI). A component name may also be substituted for ``NV1`` + ( ``NV2`` and ``NINC`` are ignored). + + ninc : str + List volumes from ``NV1`` to ``NV2`` (defaults to ``NV1`` ) in steps of ``NINC`` (defaults to + 1). If ``NV1`` = ALL (default), ``NV2`` and ``NINC`` are ignored and all selected volumes ( + :ref:`vsel` ) are listed. If ``NV1`` = P, graphical picking is enabled and all remaining command + fields are ignored (valid only in the GUI). A component name may also be substituted for ``NV1`` + ( ``NV2`` and ``NINC`` are ignored). + + Notes + ----- + + .. _VLIST_notes: + + An attribute (TYPE, MAT, REAL, or ESYS) listed as a zero is unassigned; one listed as a positive + value indicates that the attribute was assigned with the :ref:`vatt` command (and will not be reset + to zero if the mesh is cleared); one listed as a negative value indicates that the attribute was + assigned using the attribute pointer [TYPE, MAT, REAL, or ESYS] that was active during meshing (and + will be reset to zero if the mesh is cleared). A "-1" in the "nodes" column indicates that the + volume has been meshed but there are no interior nodes. The volume size is listed only if a + :ref:`vsum` command has been performed on the volume. Volume orientation attributes (KZ1 and KZ2) + are listed only if a :ref:`veorient` command was previously used to define an orientation for the + volume. + + This command is valid in any processor. + """ + command = f"VLIST,{nv1},{nv2},{ninc}" + return self.run(command, **kwargs) + + def vlscale( + self, + nv1: str = "", + nv2: str = "", + ninc: str = "", + rx: str = "", + ry: str = "", + rz: str = "", + kinc: str = "", + noelem: int | str = "", + imove: int | str = "", + **kwargs, + ): + r"""Generates a scaled set of volumes from a pattern of volumes. + + Mechanical APDL Command: `VLSCALE `_ + + Parameters + ---------- + nv1 : str + Set of volumes ( ``NV1`` to ``NV2`` in steps of ``NINC`` ) that defines the pattern to be + scaled. ``NV2`` defaults to ``NV1``, ``NINC`` defaults to 1. If ``NV1`` = ALL, ``NV2`` and + ``NINC`` are ignored and the pattern is defined by all selected volumes. If ``NV1`` = P, + graphical picking is enabled and all remaining command fields are ignored (valid only in the + GUI). A component name may also be substituted for ``NV1`` ( ``NV2`` and ``NINC`` are ignored). + + nv2 : str + Set of volumes ( ``NV1`` to ``NV2`` in steps of ``NINC`` ) that defines the pattern to be + scaled. ``NV2`` defaults to ``NV1``, ``NINC`` defaults to 1. If ``NV1`` = ALL, ``NV2`` and + ``NINC`` are ignored and the pattern is defined by all selected volumes. If ``NV1`` = P, + graphical picking is enabled and all remaining command fields are ignored (valid only in the + GUI). A component name may also be substituted for ``NV1`` ( ``NV2`` and ``NINC`` are ignored). + + ninc : str + Set of volumes ( ``NV1`` to ``NV2`` in steps of ``NINC`` ) that defines the pattern to be + scaled. ``NV2`` defaults to ``NV1``, ``NINC`` defaults to 1. If ``NV1`` = ALL, ``NV2`` and + ``NINC`` are ignored and the pattern is defined by all selected volumes. If ``NV1`` = P, + graphical picking is enabled and all remaining command fields are ignored (valid only in the + GUI). A component name may also be substituted for ``NV1`` ( ``NV2`` and ``NINC`` are ignored). + + rx : str + Scale factors to be applied to the X, Y, and Z keypoint coordinates in active coordinate system + ( RR, R θ, RZ for cylindrical; RR, R θ, R Φ for spherical). Note that the R θ and R Φ scale + factors are interpreted as angular offsets. For example, if CSYS = 1, ``RX``, ``RY``, ``RZ`` + input of (1.5,10,3) would scale the specified keypoints 1.5 times in the radial and 3 times in + the Z direction, while adding an offset of 10 degrees to the keypoints. Zero, blank, or negative + scale factor values are assumed to be 1.0. Zero or blank angular offsets have no effect. + + ry : str + Scale factors to be applied to the X, Y, and Z keypoint coordinates in active coordinate system + ( RR, R θ, RZ for cylindrical; RR, R θ, R Φ for spherical). Note that the R θ and R Φ scale + factors are interpreted as angular offsets. For example, if CSYS = 1, ``RX``, ``RY``, ``RZ`` + input of (1.5,10,3) would scale the specified keypoints 1.5 times in the radial and 3 times in + the Z direction, while adding an offset of 10 degrees to the keypoints. Zero, blank, or negative + scale factor values are assumed to be 1.0. Zero or blank angular offsets have no effect. + + rz : str + Scale factors to be applied to the X, Y, and Z keypoint coordinates in active coordinate system + ( RR, R θ, RZ for cylindrical; RR, R θ, R Φ for spherical). Note that the R θ and R Φ scale + factors are interpreted as angular offsets. For example, if CSYS = 1, ``RX``, ``RY``, ``RZ`` + input of (1.5,10,3) would scale the specified keypoints 1.5 times in the radial and 3 times in + the Z direction, while adding an offset of 10 degrees to the keypoints. Zero, blank, or negative + scale factor values are assumed to be 1.0. Zero or blank angular offsets have no effect. + + kinc : str + Increment to be applied to keypoint numbers for generated set. If zero, the lowest available + keypoint numbers will be assigned ( :ref:`numstr` ). + + noelem : int or str + Specifies whether nodes and elements are also to be generated: + + * ``0`` - Nodes and elements associated with the original volumes will be generated (scaled) if they + exist. + + * ``1`` - Nodes and elements will not be generated. + + imove : int or str + Specifies whether volumes will be moved or newly defined: + + * ``0`` - Additional volumes will be generated. + + * ``1`` - Original volumes will be moved to new position ( ``KINC`` and ``NOELEM`` are ignored). Use + only if the old volumes are no longer needed at their original positions. Corresponding meshed items + are also moved if not needed at their original position. + + Notes + ----- + + .. _VLSCALE_notes: + + Generates a scaled set of volumes (and their corresponding keypoints, lines, areas, and mesh) from a + pattern of volumes. The MAT, TYPE, REAL, and ESYS attributes are based on the volumes in the pattern + and not the current settings. Scaling is done in the active coordinate system. Volumes in the + pattern could have been generated in any coordinate system. However, solid modeling in a toroidal + coordinate system is not recommended. + """ + command = f"VLSCALE,{nv1},{nv2},{ninc},{rx},{ry},{rz},{kinc},{noelem},{imove}" + return self.run(command, **kwargs) + + def voffst(self, narea: str = "", dist: str = "", kinc: str = "", **kwargs): + r"""Generates a volume, offset from a given area. + + Mechanical APDL Command: `VOFFST `_ + + Parameters + ---------- + narea : str + Area from which generated volume is to be offset. If ``NAREA`` = P, graphical picking is enabled + and all remaining command fields are ignored (valid only in the GUI). + + dist : str + Distance normal to given area at which keypoints for generated volume are to be located. + Positive normal is determined from the right-hand rule keypoint order. + + kinc : str + Increment to be applied to the keypoint numbers between sets. If zero, keypoint numbers will be + automatically assigned beginning with the lowest available value ( :ref:`numstr` ). + + Notes + ----- + + .. _VOFFST_notes: + + Generates a volume (and its corresponding keypoints, lines, and areas) by offsetting from an area. + The direction of the offset varies with the given area normal. End slopes of the generated lines + remain the same as those of the given pattern. + + If element attributes have been associated with the input area via the :ref:`aatt` command, the + opposite area generated by the :ref:`voffst` operation will also have those attributes (that is, the + element attributes from the input area are copied to the opposite area). Note that only the area + opposite the input area will have the same attributes as the input area; the areas adjacent to the + input area will not. + + If the areas are meshed or belong to meshed volumes, a 3D mesh can be extruded with this command. + Note that the ``NDIV`` argument on the :ref:`esize` command should be set before extruding the + meshed areas. + """ + command = f"VOFFST,{narea},{dist},{kinc}" + return self.run(command, **kwargs) + + def vplot( + self, + nv1: str = "", + nv2: str = "", + ninc: str = "", + degen: str = "", + scale: str = "", + **kwargs, + ): + r"""Displays the selected volumes. + + Mechanical APDL Command: `VPLOT `_ + + Parameters + ---------- + nv1 : str + Display volumes from ``NV1`` to ``NV2`` (defaults to ``NV1`` ) in steps of ``NINC`` (defaults to + 1). If ``NV1`` = ALL (default), ``NV2`` and ``NINC`` are ignored and all selected volumes ( + :ref:`vsel` ) are displayed. + + nv2 : str + Display volumes from ``NV1`` to ``NV2`` (defaults to ``NV1`` ) in steps of ``NINC`` (defaults to + 1). If ``NV1`` = ALL (default), ``NV2`` and ``NINC`` are ignored and all selected volumes ( + :ref:`vsel` ) are displayed. + + ninc : str + Display volumes from ``NV1`` to ``NV2`` (defaults to ``NV1`` ) in steps of ``NINC`` (defaults to + 1). If ``NV1`` = ALL (default), ``NV2`` and ``NINC`` are ignored and all selected volumes ( + :ref:`vsel` ) are displayed. + + degen : str + Degeneracy marker: + + * ``(blank)`` - No degeneracy marker is used (default). + + * ``DEGE`` - A red star is placed on keypoints at degeneracies (see the `Modeling and Meshing Guide `_). Not available if + :ref:`facet`,WIRE is set. + + scale : str + Scale factor for the size of the degeneracy-marker star. The scale is the size in window space + (-1 to 1 in both directions) (defaults to.075). + + Notes + ----- + + .. _VPLOT_notes: + + Displays selected volumes. (Only volumes having areas within the selected area set ( :ref:`asel` ) + will be plotted.) With PowerGraphics on ( :ref:`graphics`,POWER), :ref:`vplot` will display only the + currently selected areas. This command is also a utility command, valid anywhere. The degree of + tessellation used to plot the volumes is set through the :ref:`facet` command. + """ + command = f"VPLOT,{nv1},{nv2},{ninc},{degen},{scale}" + return self.run(command, **kwargs) + + def vrotat( + self, + na1: str = "", + na2: str = "", + na3: str = "", + na4: str = "", + na5: str = "", + na6: str = "", + pax1: str = "", + pax2: str = "", + arc: str = "", + nseg: str = "", + **kwargs, + ): + r"""Generates cylindrical volumes by rotating an area pattern about an axis. + + Mechanical APDL Command: `VROTAT `_ + + Parameters + ---------- + na1 : str + List of areas in the pattern to be rotated (6 maximum if using keyboard entry). Areas must lie + to one side of, and in the plane of, the axis of rotation. If ``NA1`` = P, graphical picking is + enabled and all remaining command fields are ignored (valid only in the GUI). If ``NA1`` = ALL, + all selected areas will define the pattern to be rotated. A component name may also be + substituted for ``NA1``. + + na2 : str + List of areas in the pattern to be rotated (6 maximum if using keyboard entry). Areas must lie + to one side of, and in the plane of, the axis of rotation. If ``NA1`` = P, graphical picking is + enabled and all remaining command fields are ignored (valid only in the GUI). If ``NA1`` = ALL, + all selected areas will define the pattern to be rotated. A component name may also be + substituted for ``NA1``. + + na3 : str + List of areas in the pattern to be rotated (6 maximum if using keyboard entry). Areas must lie + to one side of, and in the plane of, the axis of rotation. If ``NA1`` = P, graphical picking is + enabled and all remaining command fields are ignored (valid only in the GUI). If ``NA1`` = ALL, + all selected areas will define the pattern to be rotated. A component name may also be + substituted for ``NA1``. + + na4 : str + List of areas in the pattern to be rotated (6 maximum if using keyboard entry). Areas must lie + to one side of, and in the plane of, the axis of rotation. If ``NA1`` = P, graphical picking is + enabled and all remaining command fields are ignored (valid only in the GUI). If ``NA1`` = ALL, + all selected areas will define the pattern to be rotated. A component name may also be + substituted for ``NA1``. + + na5 : str + List of areas in the pattern to be rotated (6 maximum if using keyboard entry). Areas must lie + to one side of, and in the plane of, the axis of rotation. If ``NA1`` = P, graphical picking is + enabled and all remaining command fields are ignored (valid only in the GUI). If ``NA1`` = ALL, + all selected areas will define the pattern to be rotated. A component name may also be + substituted for ``NA1``. + + na6 : str + List of areas in the pattern to be rotated (6 maximum if using keyboard entry). Areas must lie + to one side of, and in the plane of, the axis of rotation. If ``NA1`` = P, graphical picking is + enabled and all remaining command fields are ignored (valid only in the GUI). If ``NA1`` = ALL, + all selected areas will define the pattern to be rotated. A component name may also be + substituted for ``NA1``. + + pax1 : str + Keypoints defining the axis about which the area pattern is to be rotated. + + pax2 : str + Keypoints defining the axis about which the area pattern is to be rotated. + + arc : str + Arc length (in degrees). Positive follows right-hand rule about ``PAX1`` - ``PAX2`` vector. + Defaults to 360. + + nseg : str + Number of volumes (8 maximum) around circumference. Defaults to minimum required for 90° + (maximum) arcs, that is, 4 for 360°, 3 for 270°, etc. + + Notes + ----- + + .. _VROTAT_notes: + + Generates cylindrical volumes (and their corresponding keypoints, lines, and areas) by rotating an + area pattern (and its associated line and keypoint patterns) about an axis. Keypoint patterns are + generated at regular angular locations (based on a maximum spacing of 90°). Line patterns are + generated at the keypoint patterns. Arc lines are also generated to connect the keypoints + circumferentially. Keypoint, line, area, and volume numbers are automatically assigned (beginning + with the lowest available values). Adjacent lines use a common keypoint, adjacent areas use a common + line, and adjacent volumes use a common area. + + To generate a single volume with an arc greater than 180°, ``NSEG`` must be greater than or equal to + 2. + + If element attributes have been associated with the input area via the :ref:`aatt` command, the + opposite area generated by the :ref:`vrotat` operation will also have those attributes (that is, the + element attributes from the input area are copied to the opposite area). Note that only the area + opposite the input area will have the same attributes as the input area; the areas adjacent to the + input area will not. + + If the given areas are meshed or belong to meshed volumes, the 2D mesh can be rotated (extruded) to + a 3D mesh. See the `Modeling and Meshing Guide + `_ for more + information. Note that the ``NDIV`` argument on the + :ref:`esize` command should be set before extruding the meshed areas. + """ + command = ( + f"VROTAT,{na1},{na2},{na3},{na4},{na5},{na6},{pax1},{pax2},{arc},{nseg}" + ) + return self.run(command, **kwargs) + + def vsum(self, lab: str = "", **kwargs): + r"""Calculates and prints geometry statistics of the selected volumes. + + Mechanical APDL Command: `VSUM `_ + + Parameters + ---------- + lab : str + Controls the degree of tessellation used in the calculation of area properties. If ``LAB`` = + DEFAULT, area calculations will use the degree of tessellation set through the :ref:`facet` + command. If ``LAB`` = FINE, area calculations are based on a finer tessellation. + + Notes + ----- + + .. _VSUM_notes: + + Calculates and prints geometry statistics (volume, centroid location, moments of inertia, etc.) + associated with the selected volumes. Geometry items are reported in the global Cartesian coordinate + system. A unit density is assumed unless the volumes have a material association via the :ref:`vatt` + command. Items calculated by :ref:`vsum` and later retrieved by a :ref:`get` or :ref:`starvget` + command are valid only if the model is not modified after the :ref:`vsum` command is issued. + + Setting a finer degree of tessellation will provide area calculations with greater accuracy, + especially for thin, hollow models. However, using a finer degree of tessellation requires longer + processing. + + For very thin volumes, such that the ratio of the minimum to the maximum dimension is less than + 0.01, the :ref:`vsum` command can provide erroneous volume information. To ensure that such + calculations are accurate, make certain that you subdivide such volumes so that the ratio of the + minimum to the maximum is at least 0.05. + """ + command = f"VSUM,{lab}" + return self.run(command, **kwargs) + + def vsymm( + self, + ncomp: str = "", + nv1: str = "", + nv2: str = "", + ninc: str = "", + kinc: str = "", + noelem: int | str = "", + imove: int | str = "", + **kwargs, + ): + r"""Generates volumes from a volume pattern by symmetry reflection. + + Mechanical APDL Command: `VSYMM `_ + + Parameters + ---------- + ncomp : str + Symmetry key: + + * ``X`` - X symmetry (default). + + * ``Y`` - Y symmetry. + + * ``Z`` - Z symmetry. + + nv1 : str + Reflect volumes from pattern beginning with ``NV1`` to ``NV2`` (defaults to ``NV1`` ) in steps + of ``NINC`` (defaults to 1). If ``NV1`` = ALL, ``NV2`` and ``NINC`` are ignored and the pattern + is all selected volumes ( :ref:`vsel` ). If ``NV1`` = P, graphical picking is enabled and all + remaining command fields are ignored (valid only in the GUI). A component name may also be + substituted for ``NV1`` ( ``NV2`` and ``NINC`` are ignored). + + nv2 : str + Reflect volumes from pattern beginning with ``NV1`` to ``NV2`` (defaults to ``NV1`` ) in steps + of ``NINC`` (defaults to 1). If ``NV1`` = ALL, ``NV2`` and ``NINC`` are ignored and the pattern + is all selected volumes ( :ref:`vsel` ). If ``NV1`` = P, graphical picking is enabled and all + remaining command fields are ignored (valid only in the GUI). A component name may also be + substituted for ``NV1`` ( ``NV2`` and ``NINC`` are ignored). + + ninc : str + Reflect volumes from pattern beginning with ``NV1`` to ``NV2`` (defaults to ``NV1`` ) in steps + of ``NINC`` (defaults to 1). If ``NV1`` = ALL, ``NV2`` and ``NINC`` are ignored and the pattern + is all selected volumes ( :ref:`vsel` ). If ``NV1`` = P, graphical picking is enabled and all + remaining command fields are ignored (valid only in the GUI). A component name may also be + substituted for ``NV1`` ( ``NV2`` and ``NINC`` are ignored). + + kinc : str + Keypoint increment between sets. If zero, the lowest available keypoint numbers are assigned ( + :ref:`numstr` ). + + noelem : int or str + Specifies whether nodes and elements are also to be generated: + + * ``0`` - Generate nodes and elements associated with the original volumes, if they exist. + + * ``1`` - Do not generate nodes and elements. + + imove : int or str + Specifies whether volumes will be moved or newly defined: + + * ``0`` - Generate additional volumes. + + * ``1`` - Move original volumes to new position retaining the same keypoint numbers ( ``KINC`` and + ``NOELEM`` are ignored). Corresponding meshed items are also moved if not needed at their original + position. + + Notes + ----- + + .. _VSYMM_notes: + + Generates a reflected set of volumes (and their corresponding keypoints, lines, areas and mesh) from + a given volume pattern by a symmetry reflection (see analogous node symmetry command, :ref:`nsym` ). + The MAT, TYPE, REAL, and ESYS attributes are based upon the volumes in the pattern and not upon the + current settings. Reflection is done in the active coordinate system by changing a particular + coordinate sign. The active coordinate system must be a Cartesian system. Volumes in the pattern may + have been generated in any coordinate system. However, solid modeling in a toroidal coordinate + system is not recommended. Volumes are generated as described in the :ref:`vgen` command. + + See the :ref:`esym` command for additional information about symmetry elements. + """ + command = f"VSYMM,{ncomp},{nv1},{nv2},{ninc},{kinc},{noelem},{imove}" + return self.run(command, **kwargs) + + def vtran( + self, + kcnto: str = "", + nv1: str = "", + nv2: str = "", + ninc: str = "", + kinc: str = "", + noelem: int | str = "", + imove: int | str = "", + **kwargs, + ): + r"""Transfers a pattern of volumes to another coordinate system. + + Mechanical APDL Command: `VTRAN `_ + + Parameters + ---------- + kcnto : str + Reference number of coordinate system where the pattern is to be transferred. Transfer occurs + from the active coordinate system. The coordinate system type and parameters of ``KCNTO`` must + be the same as the active system. + + nv1 : str + Transfer volumes from pattern beginning with ``NV1`` to ``NV2`` (defaults to ``NV1`` ) in steps + of ``NINC`` (defaults to 1). If ``NV1`` = ALL, ``NV2`` and ``NINC`` are ignored and the pattern + is all selected volumes ( :ref:`vsel` ). If ``NV1`` = P, graphical picking is enabled and all + remaining command fields are ignored (valid only in the GUI). A component name may also be + substituted for ``NV1`` ( ``NV2`` and ``NINC`` are ignored). + + nv2 : str + Transfer volumes from pattern beginning with ``NV1`` to ``NV2`` (defaults to ``NV1`` ) in steps + of ``NINC`` (defaults to 1). If ``NV1`` = ALL, ``NV2`` and ``NINC`` are ignored and the pattern + is all selected volumes ( :ref:`vsel` ). If ``NV1`` = P, graphical picking is enabled and all + remaining command fields are ignored (valid only in the GUI). A component name may also be + substituted for ``NV1`` ( ``NV2`` and ``NINC`` are ignored). + + ninc : str + Transfer volumes from pattern beginning with ``NV1`` to ``NV2`` (defaults to ``NV1`` ) in steps + of ``NINC`` (defaults to 1). If ``NV1`` = ALL, ``NV2`` and ``NINC`` are ignored and the pattern + is all selected volumes ( :ref:`vsel` ). If ``NV1`` = P, graphical picking is enabled and all + remaining command fields are ignored (valid only in the GUI). A component name may also be + substituted for ``NV1`` ( ``NV2`` and ``NINC`` are ignored). + + kinc : str + Keypoint increment between sets. If zero, the lowest available keypoint numbers are assigned ( + :ref:`numstr` ). + + noelem : int or str + Specifies whether elements and nodes are also to be generated: + + * ``0`` - Generate nodes and elements associated with the original volumes, if they exist. + + * ``1`` - Do not generate nodes and elements. + + imove : int or str + Specifies whether to redefine the existing volumes: + + * ``0`` - Generate additional volumes. + + * ``1`` - Move original volumes to new position retaining the same keypoint numbers ( ``KINC`` and + ``NOELEM`` are ignored). Corresponding meshed items are also moved if not needed at their original + position. + + Notes + ----- + + .. _VTRAN_notes: + + Transfers a pattern of volumes (and their corresponding keypoints, lines, areas and mesh) from one + coordinate system to another (see analogous node transfer command, :ref:`transfer` ). The MAT, TYPE, + REAL, and ESYS attributes are based upon the volumes in the pattern and not upon the current + settings. Coordinate systems may be translated and rotated relative to each other. Initial pattern + may be generated in any coordinate system. However, solid modeling in a toroidal coordinate system + is not recommended. Coordinate and slope values are interpreted in the active coordinate system and + are transferred directly. Volumes are generated as described in the :ref:`vgen` command. + """ + command = f"VTRAN,{kcnto},{nv1},{nv2},{ninc},{kinc},{noelem},{imove}" + return self.run(command, **kwargs) diff --git a/src/ansys/mapdl/core/_commands/preproc/__init__.py b/src/ansys/mapdl/core/_commands/preproc/__init__.py deleted file mode 100644 index 69e22efec00..00000000000 --- a/src/ansys/mapdl/core/_commands/preproc/__init__.py +++ /dev/null @@ -1,32 +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 . import ( - nodes, - primitives, - real_constants, - sections, - special_purpose, - status, - superelements, - volumes, -) diff --git a/src/ansys/mapdl/core/_commands/preproc/nodes.py b/src/ansys/mapdl/core/_commands/preproc/nodes.py deleted file mode 100644 index c9ff5ff5336..00000000000 --- a/src/ansys/mapdl/core/_commands/preproc/nodes.py +++ /dev/null @@ -1,1110 +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 ansys.mapdl.core._commands import parse - - -class Nodes: - def center(self, node="", node1="", node2="", node3="", radius="", **kwargs): - """Defines a node at the center of curvature of 2 or 3 nodes. - - APDL Command: CENTER - - Parameters - ---------- - node - Number to be assigned to the node generated at the center of - curvature. - - node1, node2, node3 - Three nodes used to calculated the center of curvature, as - described under RADIUS. - - radius - Used to control the interpretation of NODE1, NODE2 and NODE3: - - 0 - NODE1, NODE2 and NODE3 lie on a circular arc. The program will calculate the - center of curvature (and radius) (default). - - ≠0 - NODE1 and NODE2 are the endpoints of an arc, and RADIUS is the radius of - curvature. The program will locate the center of curvature on - the NODE3 side of the NODE1-NODE2 line if RADIUS > 0, and - opposite to NODE3 if RADIUS < 0. - """ - command = f"CENTER,{node},{node1},{node2},{node3},{radius}" - return self.run(command, **kwargs) - - def fill( - self, - node1="", - node2="", - nfill="", - nstrt="", - ninc="", - itime="", - inc="", - space="", - **kwargs, - ): - """Generates a line of nodes between two existing nodes. - - APDL Command: FILL - - Parameters - ---------- - node1, node2 - Beginning and ending nodes for fill-in. NODE1 defaults to next to - last node specified, NODE2 defaults to last node specified. If - NODE1 = P, graphical picking is enabled and all remaining command - fields are ignored (valid only in the GUI). - - nfill - Fill NFILL nodes between NODE1 and NODE2 (defaults to - ``|NODE2-NODE1|-1``). NFILL must be positive. - - nstrt - Node number assigned to first filled-in node (defaults to ``NODE1 + - NINC``). - - ninc - Add this increment to each of the remaining filled-in node numbers - (may be positive or negative). Defaults to the integer result of - ``(NODE2-NODE1)/(NFILL + 1)``, i.e., linear interpolation. If the - default evaluates to zero, or if zero is input, NINC is set to 1. - - itime, inc - Do fill-in operation a total of ITIMEs, incrementing NODE1, NODE2 - and NSTRT by INC each time after the first. ITIME and INC both - default to 1. - - space - Spacing ratio. Ratio of last division size to first division size. - If > 1.0, divisions increase. If < 1.0, divisions decrease. Ratio - defaults to 1.0 (uniform spacing). - - Notes - ----- - Generates a line of nodes (in the active coordinate system) between two - existing nodes. The two nodes may have been defined in any coordinate - system. Nodal locations and rotation angles are determined by - interpolation. Any number of nodes may be filled-in and any node - number sequence may be assigned. See the CSCIR command when filling - across the 180° singularity line in a non-Cartesian system. - """ - command = f"FILL,{node1},{node2},{nfill},{nstrt},{ninc},{itime},{inc},{space}" - return self.run(command, **kwargs) - - def move( - self, - node="", - kc1="", - x1="", - y1="", - z1="", - kc2="", - x2="", - y2="", - z2="", - **kwargs, - ): - """Calculates and moves a node to an intersection. - - APDL Command: MOVE - - Parameters - ---------- - node - Move this node. If NODE = P, graphical picking is enabled and all - remaining command fields are ignored (valid only in the GUI). A - component name may also be substituted for NODE. - - kc1 - First coordinate system number. Defaults to 0 (global Cartesian). - - x1, y1, z1 - Input one or two values defining the location of the node in this - coordinate system. Input "U" for unknown value(s) to be calculated - and input "E" to use an existing coordinate value. Fields are R1, - θ1, Z1 for cylindrical, or R1, θ1, Φ1 for spherical or toroidal. - - kc2 - Second coordinate system number. - - x2, y2, z2 - Input two or one value(s) defining the location of the node in this - coordinate system. Input "U" for unknown value(s) to be calculated - and input "E" to use an existing coordinate value. Fields are R2, - θ2, Z2 for cylindrical, or R2, θ2, Φ2 for spherical or toroidal. - - Notes - ----- - Calculates and moves a node to an intersection location. The node may - have been previously defined (at an approximate location) or left - undefined (in which case it is internally defined at the SOURCE - location). The actual location is calculated from the intersection of - three surfaces (implied from three coordinate constants in two - different coordinate systems). The three (of six) constants easiest to - define should be used. The program will calculate the remaining three - coordinate constants. All arguments, except KC1, must be input. Use - the repeat command [``*REPEAT``] after the MOVE command to define a line of - intersection by repeating the move operation on all nodes of the line. - - Surfaces of constant value are implied by some commands by specifying a - single coordinate value. Implied surfaces are used with various - commands [MOVE, KMOVE, NSEL, etc.]. Three surfaces are available with - each of the four coordinate system types. Values or X, Y, or Z may be - constant for the Cartesian coordinate system; values of R,: θ, or Z for - the cylindrical system; and values of R, θ,: Φ for the spherical and - toroidal systems. For example, an X value of 3 represents the Y-Z - plane (or surface) at X=3. In addition, the parameters for the - cylindrical and spherical coordinate systems may be adjusted [CS, - LOCAL] to form elliptical surfaces. For surfaces in elliptical - coordinate systems, a surface of "constant" radius is defined by the - radius value at the X-axis. Surfaces of constant value may be located - in local coordinate systems [LOCAL, CLOCAL, CS, or CSKP] to allow for - any orientation. - - The intersection calculation is based on an iterative procedure (250 - iterations maximum) and a tolerance of 1.0E-4. The approximate - location of a node should be sufficient to determine a unique - intersection if more than one intersection point is possible. Tangent - "intersections" should be avoided. If an intersection is not found, - the node is placed at the last iteration location. - - This command is also valid in the /MAP processor. - """ - command = f"MOVE,{node},{kc1},{x1},{y1},{z1},{kc2},{x2},{y2},{z2}" - return self.run(command, **kwargs) - - def n(self, node="", x="", y="", z="", thxy="", thyz="", thzx="", **kwargs) -> int: - """Define a node. - - APDL Command: N - - Defines a node in the active coordinate system [CSYS]. The - nodal coordinate system is parallel to the global Cartesian - system unless rotated. Rotation angles are in degrees and - redefine any previous rotation angles. See the NMODIF, NANG, - NROTAT, and NORA commands for other rotation options. - - Parameters - ---------- - node - Node number to be assigned. A previously defined node of - the same number will be redefined. Defaults to the - maximum node number used +1. - - x, y, z - Node location in the active coordinate system (R, θ, Z for - cylindrical, R, θ, Φ for spherical or toroidal). - - thxy - First rotation about nodal Z (positive X toward Y). - - thyz - Second rotation about nodal X (positive Y toward Z). - - thzx - Third rotation about nodal Y (positive Z toward X). - - Returns - ------- - int - Node number of the generated node. - - Examples - -------- - Create a node at ``(0, 1, 1)`` - - >>> nnum = mapdl.n("", 0, 1, 1) - >>> nnum - 1 - - Create a node at ``(4, 5, 1)`` with a node ID of 10 - - >>> nnum = mapdl.n(10, 4, 5, 1) - >>> nnum - 10 - """ - command = f"N,{node},{x},{y},{z},{thxy},{thyz},{thzx}" - return parse.parse_n(self.run(command, **kwargs)) - - def naxis(self, action="", val="", **kwargs): - """Generates nodes for general axisymmetric element sections. - - APDL Command: NAXIS - - Parameters - ---------- - action - Specifies one of the following command behaviors: - - GEN - Generates nodes around the axis of an axisymmetric section (default). - - CLEAR - Clears all nodes around the axis of an axisymmetric section. - - EFACET - Specifies the number of facets per edge between nodal planes and integration - planes in the circumferential direction to display using - PowerGraphics. This option is only valid with /ESHAPE,1 - and RSYS,SOLU commands. - - val - Tolerance value or number of facets per edge: - - TOLER - When Action = GEN, the tolerance to use for merging the generated nodes around - the axis. - - NUM - When Action = EFACET, the number of facets per element edge for element plots: - - AUTO - Use program-chosen facets per edge (default). - - 1 - Use 1 facet per edge (default for elements with 9, 10, 11, or 12 nodal planes). - Shows nodal and integration planes only. - - 2 - Use 2 facets per edge (default for elements with 5, 6, 7, or 8 nodal planes, - and maximum for elements with 9, 10, 11, or 12 nodal planes). - - 3 - Use 3 facets per edge (default for elements with 3 or 4 nodal planes, and - maximum for elements with 6, 7, or 8 nodal planes). - - 4 - Use 4 facets per edge (maximum for elements with 5 nodal planes). - - 5 - Use 5 facets per edge (maximum for elements with 4 nodal planes). - - 6 - Use 6 facets per edge (maximum for elements with 3 nodal planes). - - Notes - ----- - The NAXIS command generates or clears the nodes for general - axisymmetric element sections. The command applies to elements SURF159, - SOLID272, and SOLID273. - - The generate option (Action = GEN) operates automatically on any - current-technology axisymmetric element. Any nodes within the tolerance - value (TOLER) of the axis are merged into a single node. The default - tolerance is 1.0e-4. - - If you want to change the number of nodes, use the clear option (Action - = CLEAR) before regenerating the nodes. - - To cause the 3-D element plot to appear more like the actual 3-D model, - use NAXIS,EFACET,NUM, where NUM > 1. In this case, the coordinate - system specified for displaying element and nodal results (RSYS) must - be solution (RSYS,SOLU); otherwise, ANSYS resets NUM to 1. - """ - command = f"NAXIS,{action},{val}" - return self.run(command, **kwargs) - - def nang( - self, - node="", - x1="", - x2="", - x3="", - y1="", - y2="", - y3="", - z1="", - z2="", - z3="", - **kwargs, - ): - """Rotates a nodal coordinate system by direction cosines. - - APDL Command: NANG - - Parameters - ---------- - node - Rotate coordinate system of this node. - - x1, x2, x3 - Global X, Y, Z components of a unit vector in new nodal X - direction. - - y1, y2, y3 - Global X, Y, Z components of a unit vector in new nodal Y - direction. - - z1, z2, z3 - Global X, Y, Z components of a unit vector in new nodal Z - direction. - - Notes - ----- - Rotates a nodal coordinate system to the orientation specified by the - X, Y and Z direction cosines. Existing rotation specifications on the - node are redefined. If only two of the three unit vectors are - specified, the third is defined according to the right hand rule. It - is the responsibility of the user to ensure that input direction - cosines are orthogonal in a right-handed system. - - See the NMODIF, NROTAT, and NORA commands for other rotation options. - """ - command = f"NANG,{node},{x1},{x2},{x3},{y1},{y2},{y3},{z1},{z2},{z3}" - return self.run(command, **kwargs) - - def ndele(self, node1="", node2="", ninc="", **kwargs): - """Deletes nodes. - - APDL Command: NDELE - - Parameters - ---------- - node1, node2, ninc - Delete nodes from NODE1 to NODE2 (defaults to NODE1) in steps of - NINC (defaults to 1). If NODE1 = ALL, NODE2 and NINC are ignored - and all selected nodes [NSEL] are deleted. If NODE1 = P, graphical - picking is enabled and all remaining command fields are ignored - (valid only in the GUI). A component name may also be substituted - for NODE1. - - Notes - ----- - Deletes selected nodes that are not connected to elements. Nodes may - also be redefined instead of deleted, if desired. Boundary conditions - (displacements, forces, etc.) as well as any coupling or constraint - equations containing the deleted nodes are also deleted. - - This command is also valid in the /MAP processor. - """ - command = f"NDELE,{node1},{node2},{ninc}" - return self.run(command, **kwargs) - - def ndist(self, nd1="", nd2="", **kwargs): - """Calculates and lists the distance between two nodes. - - APDL Command: NDIST - - Parameters - ---------- - nd1 - First node in distance calculation. If ND1 = P, graphical picking - is enabled and all remaining command fields are ignored (valid only - in the GUI). - nd2 - Second node in distance calculation. - - Returns - ------- - list - ``[DIST, X, Y, Z]`` distance between two nodes. - - Notes - ----- - NDIST lists the distance between nodes ND1 and ND2, as well as the - current coordinate system offsets from ND1 to ND2, where the X, Y, and - Z locations of ND1 are subtracted from the X, Y, and Z locations of ND2 - (respectively) to determine the offsets. NDIST is valid in any - coordinate system except toroidal [CSYS,3]. - NDIST returns a variable, called "_RETURN," which contains the distance - value. You can use this value for various purposes, such as the - calculation of distributed loads. In interactive mode, you can access - this command by using the Model Query Picker (Utility Menu> List> - Picked Entities), where you can also access automatic annotation - functions and display the value on your model. - This command is valid in any processor. - - Examples - -------- - Compute the distance between two nodes. - - >>> node1 = (0, 8, -3) - >>> node2 = (13, 5, 7) - >>> node_num1 = mapdl.n("", *node1) - >>> node_num2 = mapdl.n("", *node2) - >>> node_dist = mapdl.ndist(node_num1, node_num2) - >>> node_dist - [16.673332000533065, 13.0, -3.0, 10.0] - """ - - return parse.parse_ndist(self.run(f"NDIST,{nd1},{nd2}", **kwargs)) - - def ngen( - self, - itime="", - inc="", - node1="", - node2="", - ninc="", - dx="", - dy="", - dz="", - space="", - **kwargs, - ): - """Generates additional nodes from a pattern of nodes. - - APDL Command: NGEN - - Parameters - ---------- - itime, inc - Do this generation operation a total of ITIME times, incrementing - all nodes in the given pattern by INC each time after the first. - ITIME must be > 1 for generation to occur. - - node1, node2, ninc - Generate nodes from the pattern of nodes beginning with NODE1 to - NODE2 (defaults to NODE1) in steps of NINC (defaults to 1). If - NODE1 = ALL, NODE2 and NINC are ignored and the pattern is all - selected nodes [NSEL]. If NODE1 = P, graphical picking is enabled - and all remaining command fields are ignored (valid only in the - GUI). A component name may also be substituted for NODE1 (NODE2 - and NINC are ignored). - - dx, dy, dz - Node location increments in the active coordinate system (DR, Dθ, - DZ for cylindrical, DR, Dθ, DΦ for spherical or toroidal). - - space - Spacing ratio. Ratio of last division size to first division size. - If > 1.0, divisions increase. If < 1.0, divisions decrease. Ratio - defaults to 1.0 (uniform spacing). - - Notes - ----- - Generates additional nodes from a given node pattern. Generation is - done in the active coordinate system. Nodes in the pattern may have - been generated in any coordinate system. - - This command is also valid in the /MAP processor. - """ - command = f"NGEN,{itime},{inc},{node1},{node2},{ninc},{dx},{dy},{dz},{space}" - return self.run(command, **kwargs) - - def nkpt(self, node="", npt="", **kwargs): - """Defines a node at an existing keypoint location. - - APDL Command: NKPT - - Parameters - ---------- - node - Arbitrary reference number for node. If zero or blank, defaults to - the highest node number +1 [NUMSTR]. - - npt - Keypoint number defining global X, Y, Z location. If NPT = All, - then a node will be placed at each selected keypoint. If NPT = P, - graphical picking is enabled and all remaining command fields are - ignored (valid only in the GUI). A component name may also be - substituted for NPT. - """ - command = f"NKPT,{node},{npt}" - return self.run(command, **kwargs) - - def nlist( - self, - node1="", - node2="", - ninc="", - lcoord="", - sort1="", - sort2="", - sort3="", - kinternal="", - **kwargs, - ): - """Lists nodes. - - APDL Command: NLIST - - Parameters - ---------- - node1, node2, ninc - List nodes from NODE1 to NODE2 (defaults to NODE1) in steps of NINC - (defaults to 1). If NODE1 = ALL (default), NODE2 and NINC are - ignored and all selected nodes [NSEL] are listed. If NODE1 = P, - graphical picking is enabled and all remaining command fields are - ignored (valid only in the GUI). A component name may also be - substituted for NODE1 (NODE2 and NINC are ignored). - - lcoord - Coordinate listing key: - - (blank) - List all nodal information - - COORD - Suppress all but the XYZ coordinates (shown to a higher degree of accuracy than - when displayed with all information). - - sort1 - First item on which to sort. Valid item names are NODE, X, Y, Z, - THXY, THYZ, THXZ - - sort2, sort3 - Second and third items on which to sort. Valid item names are the - same as for SORT1. - - kinternal - Internal nodes listing key: - - (blank) - List only external nodes. - - INTERNAL - List all nodes, including internal nodes. - - Notes - ----- - Lists nodes in the active display coordinate system [DSYS]. Nodal - coordinate rotation angles are also listed (relative to the global - Cartesian coordinate system). - - Node listing can be in a sorted order (ascending). SORT2, for example, - will be carried out on nodes having equal values of SORT1. - - This command is valid in any processor. - """ - command = ( - f"NLIST,{node1},{node2},{ninc},{lcoord},{sort1},{sort2},{sort3},{kinternal}" - ) - return self.run(command, **kwargs) - - def nmodif(self, node="", x="", y="", z="", thxy="", thyz="", thzx="", **kwargs): - """Modifies an existing node. - - APDL Command: NMODIF - - Parameters - ---------- - node - Modify coordinates of this node. If ALL, modify coordinates of all - selected nodes [NSEL]. If NODE = P, graphical picking is enabled - and all remaining command fields are ignored (valid only in the - GUI). A component name may also be substituted for NODE. - - x, y, z - Replace the previous coordinate values assigned to this node with - these corresponding coordinate values. Values are interpreted in - the active coordinate system (R, θ, Z for cylindrical; R, θ, Φ for - spherical or toroidal). Leaving any of these fields blank retains - the previous value(s). - - thxy - First rotation of nodal coordinate system about nodal Z (positive X - toward Y). Leaving this field blank retains the previous value. - - thyz - Second rotation of nodal coordinate system about nodal X (positive - Y toward Z). Leaving this field blank retains the previous value. - - thzx - Third rotation of nodal coordinate system about nodal Y (positive Z - toward X). Leaving this field blank retains the previous value. - - Notes - ----- - Modifies an existing node. Nodal coordinate system rotation angles are - in degrees and redefine any existing rotation angles. Nodes can also - be redefined with the N command. - - See the NROTAT, NANG, and NORA commands for other rotation options. - - This command is also valid in the /MAP processor. - """ - command = f"NMODIF,{node},{x},{y},{z},{thxy},{thyz},{thzx}" - return self.run(command, **kwargs) - - def nora(self, area="", ndir="", **kwargs): - """Rotates nodal coordinate systems to surface normal - - APDL Command: NORA - - Parameters - ---------- - area - The area number containing the nodes to be rotated to their - normals. If ALL, applies to all selected areas (see the ASEL - command). If AREA = P, graphical picking is enabled. - - ndir - Direction of the normal. If NDIR = -1, the nodal coordinate system - is rotated in the opposite direction of the surface normal. The - default is the same direction as the surface normal. - - Notes - ----- - The NORA command rotates the X-axis of the nodal coordinate system to - the surface normal. The rotated nodal coordinate systems may be - displayed through the /PSYMB command. In case multiple areas are - selected, there could be conflicts at the boundaries. If a node belongs - to two areas that have a different normal, its nodal coordinate system - will be rotated to the area normal with the lowest number. You can use - the AREVERSE and ANORM commands to rotate the surface normals in the - appropriate direction. Keep the following in mind when using the NORA - command: - - If the nodal coordinate system is parallel to the global Cartesian - system, it is not displayed through the /PSYMB command. - - Previously specified rotation on the selected nodes are overridden. - """ - command = f"NORA,{area},{ndir}" - return self.run(command, **kwargs) - - def norl(self, line="", area="", ndir="", **kwargs): - """APDL Command: NORL - - Rotates nodal coordinate systems perpendicular to line normal - - Parameters - ---------- - line - Line number containing the nodes to be rotated. If ALL, applies to - all selected lines (see the LSEL command). If LINE = P, graphical - picking is enabled. - - area - The area number containing the selected lines. The normal of the - line(s) selected is supposed to lie on this area. Defaults to the - lowest numbered selected area containing the line number. - - ndir - Direction of the normal. If NDIR = -1, the nodal coordinate system - is rotated in the opposite direction of the line normal. The - default is the same direction as the surface normal. - - Notes - ----- - The NORL command rotates the X-axis of the nodal coordinate - perpendicular to the line normal. The rotated nodal coordinate systems - may be displayed through the /PSYMB command. In case multiple lines are - selected, there could be conflicts at the boundaries. If a node belongs - to two lines that have a different normal, its nodal coordinate system - will be rotated to the line normal with the lowest number. Keep the - following in mind when using the NORL command: - - If the nodal coordinate system is parallel to the global Cartesian - system, it is not displayed through the /PSYMB command. - - Previously specified rotation on the selected nodes are overridden. - """ - command = f"NORL,{line},{area},{ndir}" - return self.run(command, **kwargs) - - def nplot(self, knum="", **kwargs): - """Displays nodes. - - APDL Command: NPLOT - - Parameters - ---------- - knum - Node number key: - - 0 - No node numbers on display. - - 1 - Include node numbers on display. See also /PNUM command. - - Notes - ----- - Produces a node display. Only selected nodes [NSEL] are displayed. - Elements need not be defined. See the DSYS command for display - coordinate system. - - This command is valid in any processor. - """ - command = f"NPLOT,{knum}" - return self.run(command, **kwargs) - - def nread(self, fname="", ext="", **kwargs): - """Reads nodes from a file. - - APDL Command: NREAD - - Parameters - ---------- - fname - File name and directory path (248 characters maximum, including the - characters needed for the directory path). An unspecified - directory path defaults to the working directory; in this case, you - can use all 248 characters for the file name. - - ext - Filename extension (eight-character maximum). - - Notes - ----- - The read operation is not necessary in a standard ANSYS run but is - provided as a convenience to users wanting to read a coded node file, - such as from another mesh generator or from a CAD/CAM program. Data - should be formatted as produced with the NWRITE command. Only nodes - that are within the node range specified with the NRRANG command are - read from the file. Duplicate nodes already in the database will be - overwritten. The file is rewound before and after reading. Reading - continues until the end of the file. - """ - command = f"NREAD,{fname},{ext}" - return self.run(command, **kwargs) - - def nrotat(self, node1="", node2="", ninc="", **kwargs): - """Rotates nodal coordinate systems into the active system. - - APDL Command: NROTAT - - Parameters - ---------- - node1, node2, ninc - Rotate nodes from NODE1 to NODE2 (defaults to NODE1) in steps of - NINC (defaults to 1). If NODE1 = ALL, NODE2 and NINC are ignored - and all selected nodes [NSEL] are rotated. If NODE1 = P, graphical - picking is enabled and all remaining command fields are ignored - (valid only in the GUI). A component name may also be substituted - for NODE1 (NODE2 and NINC are ignored). - - Notes - ----- - Rotates nodal coordinate systems into the active coordinate system. - Nodal coordinate systems may be automatically rotated into the active - (global or local) coordinate system as follows: Rotations in Cartesian - systems will have nodal x directions rotated parallel to the Cartesian - X direction. Rotations in cylindrical, spherical or toroidal systems - will have the nodal x directions rotated parallel to the R direction. - Nodes at (or near) a zero radius location should not be rotated. Nodal - coordinate directions may be displayed [/PSYMB]. Nodal forces and - constraints will also appear rotated when displayed if the nodal - coordinate system is rotated. - - ANSYS LS-DYNA (explicit dynamics) does not support the NROTAT command. - If you have rotated nodes in the implicit phase of an implicit-to- - explicit sequential solution, you must rotate the nodes back to the - global Cartesian direction before switching from implicit to explicit - elements (ETCHG,ITE). Use the EDNROT command in the explicit run to - maintain the same displacement constraints as were used on rotated - nodes in the implicit run. - - Note:: : When the nodal coordinate systems are defined, they remain - parallel to the global Cartesian system unless subsequently rotated. - - Previously specified rotations on the specified nodes are overridden. - - See the NMODIF, NANG, and NORA commands for other rotation options. - """ - command = f"NROTAT,{node1},{node2},{ninc}" - return self.run(command, **kwargs) - - def nrrang(self, nmin="", nmax="", ninc="", **kwargs): - """Specifies the range of nodes to be read from the node file. - - APDL Command: NRRANG - - Parameters - ---------- - nmin, nmax, ninc - Node range is defined from NMIN (defaults to 1) to NMAX (defaults - to 99999999) in steps of NINC (defaults to 1). - - Notes - ----- - Defines the range of nodes to be read [NREAD] from the node file. Also - implies an element range since only elements fully attached to these - nodes will be read from the element file. - """ - command = f"NRRANG,{nmin},{nmax},{ninc}" - return self.run(command, **kwargs) - - def nscale( - self, inc="", node1="", node2="", ninc="", rx="", ry="", rz="", **kwargs - ): - """Generates a scaled set of nodes from a pattern of nodes. - - APDL Command: NSCALE - - Parameters - ---------- - inc - Do this scaling operation one time, incrementing all nodes in the - given pattern by INC. If INC = 0, nodes will be redefined at the - scaled locations. - - node1, node2, ninc - Scale nodes from pattern of nodes beginning with NODE1 to NODE2 - (defaults to NODE1) in steps of NINC (defaults to 1). If NODE1 = - ALL, NODE2 and NINC are ignored and pattern is all selected nodes - [NSEL]. If NODE1 = P, graphical picking is enabled and all - remaining command fields are ignored (valid only in the GUI). A - component name may also be substituted for NODE1 (NODE2 and NINC - are ignored). - - rx, ry, rz - Scale factor ratios. Scaling is relative to the origin of the - active coordinate system (RR, Rθ, RZ for cylindrical, RR, Rθ, RΦ - for spherical or toroidal). If absolute value of ratio > 1.0, - pattern is enlarged. If < 1.0, pattern is reduced. Ratios default - to 1.0 (each). - - Notes - ----- - Generates a scaled pattern of nodes from a given node pattern. Scaling - is done in the active coordinate system. Nodes in the pattern may have - been generated in any coordinate system. - - This command is also valid in the /MAP processor. - """ - command = f"NSCALE,{inc},{node1},{node2},{ninc},{rx},{ry},{rz}" - return self.run(command, **kwargs) - - def nsmooth(self, npass="", **kwargs): - """Smooths selected nodes among selected elements. - - APDL Command: NSMOOTH - - Parameters - ---------- - npass - Number of smoothing passes. Defaults to 3. - - Notes - ----- - Repositions each selected node at the average position of its immediate - neighbors on the selected elements. The node positions converge after - some number of smoothing passes. For some initial conditions, NPASS may - need to be much larger than 3. If the boundary of a mesh is to be - undisturbed (usually desirable), the boundary nodes should be - unselected before issuing NSMOOTH. - """ - command = f"NSMOOTH,{npass}" - return self.run(command, **kwargs) - - def nsym(self, ncomp="", inc="", node1="", node2="", ninc="", **kwargs): - """Generates a reflected set of nodes. - - APDL Command: NSYM - - Parameters - ---------- - ncomp - Symmetry key: - - X - X (or R) symmetry (default). - - Y - Y (or θ) symmetry. - - Z - Z (or Φ) symmetry. - - inc - Increment all nodes in the given pattern by INC to form the - reflected node pattern. - - node1, node2, ninc - Reflect nodes from pattern beginning with NODE1 to NODE2 (defaults - to NODE1) in steps of NINC (defaults to 1). If NODE1 = ALL, NODE2 - and NINC are ignored and pattern is all selected nodes [NSEL]. If - NODE1 = P, graphical picking is enabled and all remaining command - fields are ignored (valid only in the GUI). A component name may - also be substituted for NODE1 (NODE2 and NINC are ignored). - - Notes - ----- - Generates nodes from a given node pattern by a symmetry reflection. - Reflection is done in the active coordinate system by changing a - particular coordinate sign. Nodes in the pattern may have been - generated in any coordinate system. Nodal rotation angles are not - reflected. - - Symmetry reflection may be used with any node pattern, in any - coordinate system, as many times as desired. Reflection is - accomplished by a coordinate sign change (in the active coordinate - system). For example, an X-reflection in a Cartesian coordinate system - generates additional nodes from a given pattern, with a node increment - added to each node number, and an X coordinate sign change. An - R-reflection in a cylindrical coordinate system gives a reflected - "radial" location by changing the "equivalent" Cartesian (i.e., the - Cartesian system with the same origin as the active cylindrical system) - X and Y coordinate signs. An R-reflection in a spherical coordinate - system gives a reflected "radial" location by changing the equivalent - Cartesian X, Y, and Z coordinate location signs. Nodal coordinate - system rotation angles are not reflected. - """ - command = f"NSYM,{ncomp},{inc},{node1},{node2},{ninc}" - return self.run(command, **kwargs) - - def nwrite(self, fname="", ext="", kappnd="", **kwargs): - """Writes nodes to a file. - - APDL Command: NWRITE - - Parameters - ---------- - fname - File name and directory path (248 characters maximum, - including the characters needed for the directory path). - An unspecified directory path defaults to the working - directory; in this case, you can use all 248 characters - for the file name. - - ext - Filename extension (eight-character maximum). - - kappnd - Append key: - - 0 - Rewind file before the write operation. - - 1 - Append data to the end of the existing file. - - Notes - ----- - Writes selected nodes [NSEL] to a file. The write operation - is not necessary in a standard ANSYS run but is provided as a - convenience to users wanting a coded node file. Data are - written in a coded format. The format used is (I8, 6G20.13) - to write out NODE,X,Y,Z,THXY,THYZ,THZX. If the last number is - zero (i.e., THZX = 0), or the last set of numbers are zero, - they are not written but are left blank. Therefore, you must - use a formatted read to process this file. Coordinate values - are in the global Cartesian system. - """ - return self.run(f"NWRITE,{fname},{ext},,{kappnd}", **kwargs) - - def quad( - self, - node1="", - nintr="", - node2="", - nfill="", - nstrt="", - ninc="", - pkfac="", - **kwargs, - ): - """Generates a quadratic line of nodes from three nodes. - - APDL Command: QUAD - - Parameters - ---------- - node1 - Begin fill-in from this node location. If NODE1 = P, graphical - picking is enabled and all remaining command fields are ignored - (valid only in the GUI). - - nintr - Intermediate or guiding node. Quadratic curve will pass through - this location. NINTR may have any node number and any location. - If the quadratic line also generates a node with number NINTR, the - generated location overrides the previous NINTR location. - - node2 - End quadratic fill-in at this node location. - - nfill - Fill-in NFILL nodes between NODE1 and NODE2 (defaults to - ``|NODE2-NODE1|-1``). NFILL must be positive. - - nstrt - Node number assigned to first filled-in node (defaults to NODE1 + - NINC). - - ninc - Add this increment to each of the remaining filled-in node numbers - (may be positive or negative). Defaults to ``(NODE2-NODE1)/(NFILL + - 1)``, i.e., linear interpolation. - - pkfac - Peak location factor. If PKFAC=0.5, the peak of the quadratic - shape occurs at the NINTR location. If 0.0 < PKFAC < 0.5, the peak - occurs to the NODE2 side of the NINTR location. If 0.5 < PKFAC < - 1.0, the peak occurs to the NODE1 side of the NINTR location. - Defaults to 0.5. - - Notes - ----- - Generates a quadratic line of nodes (in the active coordinate system) - from three nodes. The three nodes determine the plane of the curve and - may have been defined in any coordinate system. Any number of nodes - may be filled-in and any node number sequence may be assigned. - - The quadratic line feature uses three nodes (NODE1,NINTR,NODE2) to - determine the plane of the curve. The curve passes through the three - points, beginning from NODE1, through the intermediate (or guiding) - point NINTR, and toward NODE2. - - Generated nodes are also quadratically spaced. If the guiding node - number is within the set being generated, it will be relocated - according to the quadratic spacing. - - The peak location factor is used to determine how the quadratic fits - through the three points. Various nodal progressions can be obtained - by different combinations of PKFAC and the guiding node location. If - the guiding node is at mid-length between NODE1 and NODE2, 0.293: - PKFAC< 0.707 will ensure that all generated nodes fall within the - NODE1,NODE2 bounds. In the limit, as PKFAC approaches 0.0, the peak - approaches the line through NODE1 and NINTR at an infinite distance - from NODE1. The QUAD command generates quadratic lines of nodes, which - in turn may be used as a base line for generating irregular surfaces of - nodes (by repeating [``*REPEAT``], generating [NGEN, NSCALE], etc.). - Irregular surfaces may also be generated with the meshing commands. - """ - command = f"QUAD,{node1},{nintr},{node2},{nfill},{nstrt},{ninc},{pkfac}" - return self.run(command, **kwargs) - - def transfer(self, kcnto="", inc="", node1="", node2="", ninc="", **kwargs): - """Transfers a pattern of nodes to another coordinate system. - - APDL Command: TRANSFER - - Parameters - ---------- - kcnto - Reference number of coordinate system where the pattern is to be - transferred. Transfer occurs from the active coordinate system. - - inc - Increment all nodes in the given pattern by INC to form the - transferred node pattern. - - node1, node2, ninc - Transfer nodes from pattern beginning with NODE1 to NODE2 (defaults - to NODE1) in steps of NINC (defaults to 1). If NODE1 = ALL, NODE2 - and NINC are ignored and the pattern is all selected nodes [NSEL]. - If NODE1 = P, graphical picking is enabled and all remaining - command fields are ignored (valid only in the GUI). A component - may be substituted for NODE1 (NODE2 and NINC are ignored). - - Notes - ----- - Transfers a pattern of nodes from one coordinate system to another. - Coordinate systems may be translated and rotated relative to each - other. Initial pattern may be generated in any coordinate system. - Coordinate values are interpreted in the active coordinate system and - are transferred directly. - - A model generated in one coordinate system may be transferred to - another coordinate system. The user may define several coordinate - systems (translated and rotated from each other), generate a model in - one coordinate system, and then repeatedly transfer the model to other - coordinate systems. The model may be generated in any type of - coordinate system (Cartesian, cylindrical, etc.) and transferred to any - other type of coordinate system. Coordinate values (X, Y, Z, or R,: θ, - Z, or etc.) of the model being transferred are interpreted in the - active coordinate system type, regardless of how they were generated. - Values are transferred directly and are interpreted according to the - type of coordinate system being transferred to. For example, - transferring from a Cartesian coordinate system to a cylindrical - coordinate system (not recommended) would cause X = 2.0 and Y = 3.0 - values to be directly interpreted as R = 2.0 and θ = 3.0 values, - respectively. - - This command is also valid in the /MAP processor. - """ - command = f"TRANSFER,{kcnto},{inc},{node1},{node2},{ninc}" - return self.run(command, **kwargs) diff --git a/src/ansys/mapdl/core/_commands/preproc/primitives.py b/src/ansys/mapdl/core/_commands/preproc/primitives.py deleted file mode 100644 index c2ea4a83519..00000000000 --- a/src/ansys/mapdl/core/_commands/preproc/primitives.py +++ /dev/null @@ -1,949 +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 ansys.mapdl.core._commands import parse - - -class Primitives: - def blc4( - self, xcorner="", ycorner="", width="", height="", depth="", **kwargs - ) -> int: - """Creates a rectangular area or block volume by corner points. - - APDL Command: BLC4 - - Defines a rectangular area anywhere on the working plane or a - hexahedral volume with one face anywhere on the working plane. - A rectangle will be defined with four keypoints and four - lines. A volume will be defined with eight keypoints, twelve - lines, and six areas, with the top and bottom faces parallel - to the working plane. See the BLC5, RECTNG, and BLOCK - commands for alternate ways to create rectangles and blocks. - - Parameters - ---------- - xcorner, ycorner - Working plane X and Y coordinates of one corner of the - rectangle or block face. - - width - The distance from XCORNER on or parallel to the working - plane X-axis that, together with YCORNER, defines a second - corner of the rectangle or block face. - - height - The distance from YCORNER on or parallel to the working - plane Y-axis that, together with XCORNER, defines a third - corner of the rectangle or block face. - - depth - The perpendicular distance (either positive or negative - based on the working plane Z direction) from the working - plane representing the depth of the block. If DEPTH = 0 - (default), a rectangular area is created on the working - plane. - - Returns - ------- - int - Volume or area number of the block or rectangle. - - Examples - -------- - Create a block with dimensions 1 x 2 x 10 with one corner of - the block at (0, 0) of the current working plane. - - >>> vnum = mapdl.blc4(1, 1, 1, 2, 10) - >>> vnum - 1 - """ - command = f"BLC4,{xcorner},{ycorner},{width},{height},{depth}" - return parse.parse_output_volume_area(self.run(command, **kwargs)) - - def blc5( - self, xcenter="", ycenter="", width="", height="", depth="", **kwargs - ) -> int: - """Create a rectangular area or block volume by center and corner points. - - APDL Command: BLC5 - - Defines a rectangular area anywhere on the working plane or a - hexahedral volume with one face anywhere on the working plane - by specifying the center and corner points. A rectangle will - be defined with four keypoints and four lines. A volume will - be defined with eight keypoints, twelve lines, and six areas, - with the top and bottom faces parallel to the working plane. - See the ``BLC4``, ``RECTNG``, and ``BLOCK`` commands for - alternate ways to create rectangles and blocks. - - Parameters - ---------- - xcenter, ycenter - Working plane X and Y coordinates of the center of the - rectangle or block face. - - width - The total distance on or parallel to the working plane - X-axis defining the width of the rectangle or block face. - - height - The total distance on or parallel to the working plane - Y-axis defining the height of the rectangle or block face. - - depth - The perpendicular distance (either positive or negative - based on the working plane Z direction) from the working - plane representing the depth of the block. If ``depth=0`` - (default), a rectangular area is created on the working - plane. - - Returns - ------- - int - Volume or area number of the block or rectangle. - - Examples - -------- - Create a square centered at ``(0, 0)`` with a width of 0.5 and - a height of 0.5 - - >>> anum = mapdl.blc5(width=0.5, height=0.5) - >>> anum - 1 - - >>> vnum = mapdl.blc5(width=1, height=4, depth=9) - >>> vnum - 1 - """ - command = f"BLC5,{xcenter},{ycenter},{width},{height},{depth}" - return parse.parse_output_volume_area(self.run(command, **kwargs)) - - def block(self, x1="", x2="", y1="", y2="", z1="", z2="", **kwargs): - """Create a block volume based on working plane coordinates. - - APDL Command: BLOCK - - Defines a hexahedral volume based on the working plane. The - block must have a spatial volume greater than zero (i.e., this - volume primitive command cannot be used to create a degenerate - volume as a means of creating an area.) The volume will be - defined with eight keypoints, twelve lines, and six areas, - with the top and bottom faces parallel to the working plane. - See the ``BLC4`` and ``BLC5`` commands for alternate ways to - create blocks. - - Parameters - ---------- - x1, x2 - Working plane X coordinates of the block. - - y1, y2 - Working plane Y coordinates of the block. - - z1, z2 - Working plane Z coordinates of the block. - - Returns - ------- - int - Volume number of the block. - - Examples - -------- - Create a block volume based on working plane coordinates with - the size ``(1 x 2 x 3)``. - - >>> vnum = mapdl.block(0, 1, 0, 2, 1, 4) - >>> vnum - 1 - """ - command = f"BLOCK,{x1},{x2},{y1},{y2},{z1},{z2}" - return parse.parse_output_volume_area(self.run(command, **kwargs)) - - def con4(self, xcenter="", ycenter="", rad1="", rad2="", depth="", **kwargs) -> int: - """Create a conical volume anywhere on the working plane. - - APDL Command: CON4 - - Defines a solid conical volume with either the vertex or a - face anywhere on the working plane. The cone must have a - spatial volume greater than zero. (i.e., this volume - primitive command cannot be used to create a degenerate volume - as a means of creating an area.) The face or faces will be - circular (each area defined with four lines), and they will be - connected with two areas (each spanning 180 degrees). See the CONE - command for an alternate way to create cones. - - Parameters - ---------- - xcenter, ycenter - Working plane X and Y coordinates of the center axis of - the cone. - - rad1, rad2 - Radii of the faces of the cone. RAD1 defines the bottom - face and will be located on the working plane. RAD2 - defines the top face and is parallel to the working plane. - A value of zero or blank for either RAD1 or RAD2 defines a - degenerate face at the center axis (i.e., the vertex of - the cone). The same value for both RAD1 and RAD2 defines - a cylinder instead of a cone. - - depth - The perpendicular distance (either positive or negative - based on the working plane Z direction) from the working - plane representing the depth of the cone. DEPTH cannot be - zero. - - Returns - ------- - int - Volume number of the cone. - - Examples - -------- - Create a cone with a bottom radius of 3 and a height of 10. - - >>> vnum = mapdl.con4(rad1=3, rad2=0, depth=10) - >>> vnum - 1 - """ - command = f"CON4,{xcenter},{ycenter},{rad1},{rad2},{depth}" - return parse.parse_output_volume_area(self.run(command, **kwargs)) - - def cone( - self, rbot="", rtop="", z1="", z2="", theta1="", theta2="", **kwargs - ) -> int: - """Create a conical volume centered about the working plane origin. - - APDL Command: CONE - - Defines a solid conical volume centered about the working - plane origin. The non-degenerate face (top or bottom) is - parallel to the working plane but not necessarily coplanar - with (i.e., "on") the working plane. The cone must have a - spatial volume greater than zero. (i.e., this volume primitive - command cannot be used to create a degenerate volume as a - means of creating an area.) - - For a cone of 360, top and bottom faces will be circular (each - area defined with four lines), and they will be connected with - two areas (each spanning 180 degrees). See the ``CON4`` - command for an alternate way to create cones. - - Parameters - ---------- - rbot, rtop - Radii of the bottom and top faces of the cone. A value of - zero or blank for either RBOT or RTOP defines a degenerate - face at the center axis (i.e., the vertex of the cone). - The same value for both RBOT and RTOP defines a cylinder - instead of a cone. - - z1, z2 - Working plane Z coordinates of the cone. The smaller - value is always associated with the bottom face. - - theta1, theta2 - Starting and ending angles (either order) of the cone. - Used for creating a conical sector. The sector begins at - the algebraically smaller angle, extends in a positive - angular direction, and ends at the larger angle. The - starting angle defaults to 0 degrees and the ending angle - defaults to 360 degrees. See the Modeling and Meshing Guide for - an illustration. - - Returns - ------- - int - Volume number of the cone. - - Examples - -------- - Create a quarter cone with a bottom radius of 3, top radius of 1 and - a height of 10 centered at ``(0, 0)``. - - >>> vnum = mapdl.cone(rbot=5, rtop=1, z1=0, z2=10, theta1=180, theta2=90) - >>> vnum - 1 - """ - command = f"CONE,{rbot},{rtop},{z1},{z2},{theta1},{theta2}" - return parse.parse_output_volume_area(self.run(command, **kwargs)) - - def cyl4( - self, - xcenter="", - ycenter="", - rad1="", - theta1="", - rad2="", - theta2="", - depth="", - **kwargs, - ) -> int: - """Creates a circular area or cylindrical volume anywhere on - the working plane. - - APDL Command: CYL4 - - Defines a circular area anywhere on the working plane or a - cylindrical volume with one face anywhere on the working - plane. For a solid cylinder of 360 degrees, the top and bottom faces - will be circular (each area defined with four lines) and they - will be connected with two surface areas (each spanning 180 degrees). - See the CYL5, PCIRC, and CYLIND commands for alternate ways to - create circles and cylinders. - - When working with a model imported from an IGES file (DEFAULT - import option), you must provide a value for DEPTH or the - command will be ignored. - - Parameters - ---------- - xcenter, ycenter - Working plane X and Y coordinates of the center of the - circle or cylinder. - - rad1, rad2 - Inner and outer radii (either order) of the circle or - cylinder. A value of zero or blank for either RAD1 or - RAD2, or the same value for both RAD1 and RAD2, defines a - solid circle or cylinder. - - theta1, theta2 - Starting and ending angles (either order) of the circle or - faces of the cylinder. Used for creating a partial - annulus or partial cylinder. The sector begins at the - algebraically smaller angle, extends in a positive angular - direction, and ends at the larger angle. The starting - angle defaults to 0 degrees and the ending angle defaults to - 360 degrees. See the Modeling and Meshing Guide for an - illustration. - - depth - The perpendicular distance (either positive or negative - based on the working plane Z direction) from the working - plane representing the depth of the cylinder. If DEPTH = - 0 (default), a circular area is created on the working - plane. - - Returns - ------- - int - Volume or area number of the block or rectangle. - - Examples - -------- - Create a half arc centered at the origin with an outer radius - of 2 and an inner radius of 1 - - >>> anum = mapdl.cyl4(xcenter=0, ycenter=0, rad1=1, - theta1=0, rad2=2, theta2=180) - >>> anum - - Create a solid cylinder with a depth of 10 at the center of - the working plane. - - >>> vnum = mapdl.cyl4(0, 0, 1, depth=10) - >>> vnum - 1 - - Create a cylinder with an inner radius of 1.9 and an outer of - 2.0 with a height of 5 centered at the working plane. - - >>> vnum = mapdl.cyl4(0, 0, rad1=1.9, rad2=2.0, depth=10) - 2 - """ - command = f"CYL4,{xcenter},{ycenter},{rad1},{theta1},{rad2},{theta2},{depth}" - return parse.parse_output_volume_area(self.run(command, **kwargs)) - - def cyl5( - self, xedge1="", yedge1="", xedge2="", yedge2="", depth="", **kwargs - ) -> int: - """Create a circular area or cylindrical volume by end points. - - APDL Command: CYL5 - - Defines a circular area anywhere on the working plane or a - cylindrical volume with one face anywhere on the working plane - by specifying diameter end points. For a solid cylinder of - 360°, the top and bottom faces will be circular (each area - defined with four lines) and they will be connected with two - surface areas (each spanning 180°). See the CYL4, PCIRC, and - CYLIND commands for alternate ways to create circles and - cylinders. - - Parameters - ---------- - xedge1, yedge1 - Working plane X and Y coordinates of one end of the circle - or cylinder face. - - xedge2, yedge2 - Working plane X and Y coordinates of the other end of the - circle or cylinder face. - - depth - The perpendicular distance (either positive or negative - based on the working plane Z direction) from the working - plane representing the depth of the cylinder. If DEPTH = - 0 (default), a circular area is created on the working - plane. - - Returns - ------- - int - Volume or area number of the circular area of cylindrical - volume. - - Examples - -------- - Create a circular with one point of the circle at ``(1, 1)`` - and the other point at ``(2, 2)`` - - >>> anum = mapdl.cyl5(xedge1=1, yedge1=1, xedge2=2, yedge2=2) - >>> anum - 1 - - Create a cylinder with one point of the circle at ``(X, Y) == - (1, 1)`` and the other point at ``(X, Y) == (2, 2)`` with a - height of 3. - - >>> vnum = mapdl.cyl5(xedge1=1, yedge1=1, xedge2=2, yedge2=2, depth=5) - >>> vnum - 1 - """ - command = f"CYL5,{xedge1},{yedge1},{xedge2},{yedge2},{depth}" - return parse.parse_output_volume_area(self.run(command, **kwargs)) - - def cylind( - self, rad1="", rad2="", z1="", z2="", theta1="", theta2="", **kwargs - ) -> int: - """Create a cylindrical volume centered about the working plane origin. - - APDL Command: CYLIND - - Defines a cylindrical volume centered about the working plane - origin. The top and bottom faces are parallel to the working - plane but neither face need be coplanar with (i.e., "on") the - working plane. The cylinder must have a spatial volume - greater than zero. (i.e., this volume primitive command cannot - be used to create a degenerate volume as a means of creating - an area.) - - For a solid cylinder of 360°, the top and bottom faces will be - circular (each area defined with four lines), and they will be - connected with two areas (each spanning 180°.) See the CYL4 - and CYL5 commands for alternate ways to create cylinders. - - Parameters - ---------- - rad1, rad2 - Inner and outer radii (either order) of the cylinder. A - value of zero or blank for either RAD1 or RAD2, or the - same value for both RAD1 and RAD2, defines a solid - cylinder. - - z1, z2 - Working plane Z coordinates of the cylinder. If either Z1 - or Z2 is zero, one of the faces of the cylinder will be - coplanar with the working plane. - - theta1, theta2 - Starting and ending angles (either order) of the cylinder. - Used for creating a cylindrical sector. The sector begins - at the algebraically smaller angle, extends in a positive - angular direction, and ends at the larger angle. The - starting angle defaults to 0.0° and the ending angle - defaults to 360.0°. See the Modeling and Meshing Guide - for an illustration. - - Returns - ------- - int - Volume number of the cylinder. - - Examples - -------- - Create a hollow cylinder with an inner radius of 0.9 and an - outer radius of 1.0 with a height of 5 - - >>> vnum = mapdl.cylind(0.9, 1, z1=0, z2=5) - >>> vnum - 1 - """ - command = f"CYLIND,{rad1},{rad2},{z1},{z2},{theta1},{theta2}" - return parse.parse_output_volume_area(self.run(command, **kwargs)) - - def pcirc(self, rad1="", rad2="", theta1="", theta2="", **kwargs) -> int: - """Create a circular area centered about the working plane origin. - - APDL Command: PCIRC - - Defines a solid circular area or circular sector centered - about the working plane origin. For a solid circle of 360°, - the area will be defined with four keypoints and four lines. - See the ``cyl4`` and ``cyl5`` commands for alternate ways to - create circles. - - Parameters - ---------- - rad1, rad2 - Inner and outer radii (either order) of the circle. A - value of either zero or blank for either ``rad1`` or - ``rad2``, or the same value for both ``rad1`` and - ``rad2``, defines a solid circle. - - theta1, theta2 - Starting and ending angles (either order) of the circular - area. Used for creating a circular sector. The sector - begins at the algebraically smaller angle, extends in a - positive angular direction, and ends at the larger angle. - The starting angle defaults to 0.0° and the ending angle - defaults to 360.0°. See the Modeling and Meshing Guide - for an illustration. - - Returns - ------- - int - Area number of the new circular area. - - Examples - -------- - In this example a circular area with an inner radius of 0.95 - and an outer radius of 1 is created. - - >>> anum = mapdl.pcirc(0.95, 1) - >>> anum - 1 - """ - command = f"PCIRC,{rad1},{rad2},{theta1},{theta2}" - return parse.parse_output_volume_area(self.run(command, **kwargs)) - - def poly(self, **kwargs): - """Creates a polygonal area based on working plane coordinate pairs. - - APDL Command: POLY - - Defines a polygonal area on the working plane. The area will be - defined with NPT keypoints and NPT lines, where NPT (must be at least - 3) is the number of coordinate pairs defined with the PTXY command. - See the RPOLY and RPR4 commands for other ways to create polygons. - """ - command = f"POLY," - return self.run(command, **kwargs) - - def pri2(self, p51x="", z1="", z2="", **kwargs): - """Creates a polygonal area or a prism volume by vertices (GUI). - - APDL Command: PRI2 - - Creates a polygonal area or a prism volume using the vertices as input. - This is a command generated by the Graphical User Interface (GUI) and - will appear in the log file (Jobname.LOG) if graphical picking is used. - 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). - - For polygons, the PRI2 command will appear in the log file as - PRI2,P51X,0.0,0.0 preceded by FITEM commands that define the vertices - (in global Cartesian coordinates). For prisms, the PRI2 command will - appear in the log file as PRI2,P51X preceded by FITEM commands that - define the vertices and the Z-end of the prism. - - See the RPOLY, POLY, RPRISM, PRISM, and RPR4 commands for other ways to - create polygons and prisms. - """ - command = f"PRI2,{p51x},{z1},{z2}" - return self.run(command, **kwargs) - - def prism(self, z1="", z2="", **kwargs): - """Creates a prism volume based on working plane coordinate pairs. - - APDL Command: PRISM - - Defines a prism volume based on the working plane. The top and bottom - areas will each be defined with NPT keypoints and NPT lines, where NPT - (must be at least 3) is the number of coordinate pairs defined with - PTXY command. Also, a line will be defined between each point pair on - the top and bottom face. See the RPRISM and RPR4 commands for other - ways to create prisms. - - Parameters - ---------- - z1, z2 - Working plane Z coordinates of the top and bottom of the prism. - """ - command = f"PRISM,{z1},{z2}" - return self.run(command, **kwargs) - - def ptxy(self, x1="", y1="", x2="", y2="", x3="", y3="", x4="", y4="", **kwargs): - """Defines coordinate pairs for use in polygons and prisms. - - APDL Command: PTXY - - Defines coordinate pairs for use in polygons and prisms [POLY, RPRISM]. - The coordinates must be in the Cartesian coordinate system. The - coordinate pairs must be input in a continuous order. PTXY may be - repeated (up to 100 pairs) until the required pairs have been defined. - The pairs will be saved until either the POLY or PRISM command is - entered. Use PTXY,STAT to list the saved coordinate pairs. Use - PTXY,DELE to delete all the saved coordinate pairs. See the RPOLY, - RPRISM, and RPR4 commands for other ways to create polygons and prisms. - - Parameters - ---------- - x1, y1, x2, y2, x3, y3, x4, y4 - X and Y coordinate pairs on the working plane. - """ - command = f"PTXY,{x1},{y1},{x2},{y2},{x3},{y3},{x4},{y4}" - return self.run(command, **kwargs) - - def rectng(self, x1="", x2="", y1="", y2="", **kwargs): - """Create a rectangular area anywhere on the working plane. - - APDL Command: RECTNG - - The area will be defined with four keypoints and four lines. - See the ``blc4`` and ``blc5`` commands for alternate ways to - create rectangles. - - Parameters - ---------- - x1, x2 - Working plane X coordinates of the rectangle. - - y1, y2 - Working plane Y coordinates of the rectangle. - """ - command = f"RECTNG,{x1},{x2},{y1},{y2}" - return parse.parse_output_volume_area(self.run(command, **kwargs)) - - def rpoly(self, nsides="", lside="", majrad="", minrad="", **kwargs): - """Creates a regular polygonal area centered about the working plane origin. - - APDL Command: RPOLY - - Defines a regular polygonal area on the working plane. The polygon - will be centered about the working plane origin, with the first - keypoint defined at : θ = 0°. The area will be defined with NSIDES - keypoints and NSIDES lines. See the RPR4 and POLY commands for other - ways to create polygons. - - - Parameters - ---------- - nsides - Number of sides in the regular polygon. Must be greater than 2. - - lside - Length of each side of the regular polygon. - - majrad - Radius of the major (or circumscribed) circle of the polygon. Not - used if LSIDE is input. - - minrad - Radius of the minor (or inscribed) circle of the polygon. Not used - if LSIDE or MAJRAD is input. - """ - command = f"RPOLY,{nsides},{lside},{majrad},{minrad}" - return self.run(command, **kwargs) - - def rpr4( - self, - nsides="", - xcenter="", - ycenter="", - radius="", - theta="", - depth="", - **kwargs, - ): - """Creates a regular polygonal area or prism volume anywhere on the working plane. - - APDL Command: RPR4 - - Defines a regular polygonal area anywhere on the working plane or prism - volume with one face anywhere on the working plane. The top and bottom - faces of the prism are polygonal areas. See the RPOLY, POLY, RPRISM, - and PRISM commands for other ways to create polygons and prisms. - - Parameters - ---------- - nsides - The number of sides in the polygon or prism face. Must be greater - than 2. - - xcenter, ycenter - Working plane X and Y coordinates of the center of the polygon or - prism face. - - radius - Distance (major radius) from the center to a vertex of the polygon - or prism face (where the first keypoint is defined). - - theta - Angle (in degrees) from the working plane X-axis to the vertex of - the polygon or prism face where the first keypoint is defined. - Used to orient the polygon or prism face. Defaults to zero. - - depth - The perpendicular distance (either positive or negative based on - the working plane Z direction) from the working plane representing - the depth of the prism. If DEPTH = 0 (default), a polygonal area - is created on the working plane. - """ - command = f"RPR4,{nsides},{xcenter},{ycenter},{radius},{theta},{depth}" - return self.run(command, **kwargs) - - def rprism(self, z1="", z2="", nsides="", lside="", majrad="", minrad="", **kwargs): - """Creates a regular prism volume centered about the working plane origin. - - Defines a regular prism volume centered about the working plane origin. - The prism must have a spatial volume greater than zero. (i.e., this - volume primitive command cannot be used to create a degenerate volume - as a means of creating an area.) The top and bottom faces are - polygonal areas that are parallel to the working plane but neither face - need be coplanar with (i.e., "on") the working plane. The first - keypoint defined for each face is at : θ = 0°. See the RPR4 and PRISM - commands for other ways to create prisms. - - APDL Command: RPRISM - - Parameters - ---------- - z1, z2 - Working plane Z coordinates of the prism. - - nsides - Number of sides in the polygon defining the top and bottom faces of - the prism. Must be greater than 2. - - lside - Length of each side of the polygon defining the top and bottom - faces of the prism. - - majrad - Radius of the major (or circumscribed) circle of the polygon - defining the top and bottom faces of the prism. Not used if LSIDE - is input. - - minrad - Radius of the minor (or inscribed circle) of the polygon defining - the top and bottom faces of the prism. Not used if LSIDE or MAJRAD - is input. - """ - command = f"RPRISM,{z1},{z2},{nsides},{lside},{majrad},{minrad}" - return self.run(command, **kwargs) - - def sph4(self, xcenter="", ycenter="", rad1="", rad2="", **kwargs) -> int: - """Create a spherical volume anywhere on the working plane. - - APDL Command: SPH4 - - Defines either a solid or hollow spherical volume anywhere on - the working plane. The sphere must have a spatial volume - greater than zero. (i.e., this volume primitive command - cannot be used to create a degenerate volume as a means of - creating an area.) A sphere of 360° will be defined with two - areas, each consisting of a hemisphere. See the ``sphere`` - and ``sph5`` commands for other ways to create spheres. - - When working with a model imported from an IGES file (DEFAULT - import option), you can create only solid spheres. If you - enter a value for both ``rad1`` and ``rad2`` the command is - ignored. - - Parameters - ---------- - xcenter, ycenter - Working plane X and Y coordinates of the center of the - sphere. - - rad1, rad2 - Inner and outer radii (either order) of the sphere. A - value of zero or blank for either ``rad1`` or ``rad2`` - defines a solid sphere. - - Returns - ------- - int - Volume number of the sphere. - - Examples - -------- - This example creates a hollow sphere with an inner radius of - 0.9 and an outer radius of 1.0 centered at ``(0, 0)`` - - >>> vnum = mapdl.sph4(0, 0, rad1=0.9, rad2=1.0) - >>> vnum - 1 - """ - command = f"SPH4,{xcenter},{ycenter},{rad1},{rad2}" - return parse.parse_output_volume_area(self.run(command, **kwargs)) - - def sph5(self, xedge1="", yedge1="", xedge2="", yedge2="", **kwargs) -> int: - """Create a spherical volume by diameter end points. - - APDL Command: SPH5 - - Defines a solid spherical volume anywhere on the working plane - by specifying diameter end points. The sphere must have a - spatial volume greater than zero. (i.e., this volume - primitive command cannot be used to create a degenerate volume - as a means of creating an area.) A sphere of 360° will be - defined with two areas, each consisting of a hemisphere. See - the ``sphere`` and ``sph4`` commands for other ways to create - spheres. - - Parameters - ---------- - xedge1, yedge1 - Working plane X and Y coordinates of one edge of the sphere. - - xedge2, yedge2 - Working plane X and Y coordinates of the other edge of the - sphere. - - Returns - ------- - int - Volume number of the sphere. - - Examples - -------- - This example creates a sphere with one point at ``(1, 1)`` and - one point at ``(2, 2)`` - - >>> vnum = mapdl.sph5(xedge1=1, yedge1=1, xedge2=2, yedge2=2) - >>> vnum - 1 - """ - command = f"SPH5,{xedge1},{yedge1},{xedge2},{yedge2}" - return parse.parse_output_volume_area(self.run(command, **kwargs)) - - def sphere(self, rad1="", rad2="", theta1="", theta2="", **kwargs) -> int: - """Create a spherical volume centered about the working plane origin. - - APDL Command: SPHERE - - Defines either a solid or hollow sphere or spherical sector - centered about the working plane origin. The sphere must have - a spatial volume greater than zero. (i.e., this volume - primitive command cannot be used to create a degenerate volume - as a means of creating an area.) Inaccuracies can develop - when the size of the object you create is much smaller than - the relative coordinate system values (ratios near to or - greater than 1000). If you require an exceptionally small - sphere, create a larger object, and scale it down to the - appropriate size. - - For a solid sphere of 360°, you define it with two areas, each - consisting of a hemisphere. See the ``sph4`` and ``sph5`` - commands for the other ways to create spheres. - - Parameters - ---------- - rad1, rad2 - Inner and outer radii (either order) of the sphere. A - value of zero or blank for either ``rad1`` or ``rad2`` - defines a solid sphere. - - theta1, theta2 - Starting and ending angles (either order) of the sphere. - Used for creating a spherical sector. The sector begins - at the algebraically smaller angle, extends in a positive - angular direction, and ends at the larger angle. The - starting angle defaults to 0.0° and the ending angle - defaults to 360.0°. See the Modeling and Meshing Guide - for an illustration. - - Returns - ------- - int - Volume number of the sphere. - - Examples - -------- - >>> vnum = mapdl.sphere(rad1=0.95, rad2=1.0, theta1=90, theta2=270) - >>> vnum - 1 - """ - command = f"SPHERE,{rad1},{rad2},{theta1},{theta2}" - return parse.parse_output_volume_area(self.run(command, **kwargs)) - - def torus(self, rad1="", rad2="", rad3="", theta1="", theta2="", **kwargs): - """Create a toroidal volume. - - APDL Command: TORUS - - Defines a toroidal volume centered about the working plane - origin. A solid torus of 360° will be defined with four - areas, each area spanning 180° around the major and minor - circumference. - - Parameters - ---------- - rad1, rad2, rad3 - Three values that define the radii of the torus. You can - specify the radii in any order. The smallest of the - values is the inner minor radius, the intermediate value - is the outer minor radius, and the largest value is the - major radius. (There is one exception regarding the order - of the radii values--if you want to create a solid torus, - specify zero or blank for the inner minor radius, in which - case the zero or blank must occupy either the ``rad1`` or - ``rad2`` position.) - - At least two of the values that you specify must be - positive values; they will be used to define the outer - minor radius and the major radius. See the diagram in the - Notes section for a view of a toroidal sector showing all - radii. - - theta1, theta2 - Starting and ending angles (either order) of the torus. - Used for creating a toroidal sector. The sector begins at - the algebraically smaller angle, extends in a positive - angular direction, and ends at the larger angle. The - starting angle defaults to 0° and the ending angle - defaults to 360°. - - Returns - ------- - int - Volume number of the torus. - - - Examples - -------- - This example creates a torus with an inner minor radius of 1, an - intermediate radii of 2, and a major radius of 5. The values - 0 and 180 define the starting and ending angles of the torus. - - >>> vnum = mapdl.torus(rad1=5, rad2=1, rad3=2, theta1=0, theta2=180) - >>> vnum - 1 - """ - command = f"TORUS,{rad1},{rad2},{rad3},{theta1},{theta2}" - return parse.parse_output_volume_area(self.run(command, **kwargs)) diff --git a/src/ansys/mapdl/core/_commands/preproc/real_constants.py b/src/ansys/mapdl/core/_commands/preproc/real_constants.py deleted file mode 100644 index 35a0b6bff9a..00000000000 --- a/src/ansys/mapdl/core/_commands/preproc/real_constants.py +++ /dev/null @@ -1,298 +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. - -""" -These PREP7 commands define the model real constants. -""" - - -class RealConstants: - def r(self, nset="", r1="", r2="", r3="", r4="", r5="", r6="", **kwargs): - """APDL Command: R - - Defines the element real constants. - - Parameters - ---------- - nset - Real constant set identification number (arbitrary). If same as a - previous set number, set is redefined. Set number relates to that - defined with the element [REAL]. Note that the GUI automatically - assigns this value. - - r1, r2, r3, . . . , r6 - Real constant values (interpreted as area, moment of inertia, - thickness, etc., as required for the particular element type using - this set), or table names for tabular input of boundary conditions. - Use RMORE command if more than six real constants per set are to be - input. - - Notes - ----- - Defines the element real constants. The real constants required for an - element are shown in the Input Summary of each element description in - the Element Reference. Constants must be input in the same order as - shown in that table. If more than the required number of element real - constants are specified in a set, only those required are used. If - fewer than the required number are specified, zero values are assumed - for the unspecified constants. - - If using table inputs (SURF151, SURF152, FLUID116, CONTA171, CONTA172, - CONTA173, CONTA174, and CONTA175 only), enclose the table name in % - signs (e.g., %tabname%). - - Specify NSET = GCN to define real constants for real constant sets that - were previously assigned by the GCDEF command (that is, real constants - used in general contact interactions). - - When copying real constants to new sets, ANSYS, Inc. recommends that - you use the command input. If you do use the GUI, restrict the real - constant copy to only the first six real constants (real constants - seven and greater will be incorrect for both the master and copy set). - - This command is also valid in SOLUTION. - """ - command = "R,%s,%s,%s,%s,%s,%s,%s" % ( - str(nset), - str(r1), - str(r2), - str(r3), - str(r4), - str(r5), - str(r6), - ) - return self.run(command, **kwargs) - - def rdele(self, nset1="", nset2="", ninc="", lchk="", **kwargs): - """APDL Command: RDELE - - Deletes real constant sets. - - Parameters - ---------- - nset1, nset2, ninc - Delete real constant sets from NSET1 to NSET2 (defaults to NSET1) - in steps of NINC (defaults to 1). If NSET1 = ALL, ignore NSET2 and - NINC and all real constant sets are deleted. - - lchk - Specifies the level of element-associativity checking: - - NOCHECK - No element-associativity check occurs. This option is the default. - - WARN - When a section, material, or real constant is associated with an element, ANSYS - issues a message warning that the necessary entity has been - deleted. - - CHECK - The command terminates, and no section, material, or real constant is deleted - if it is associated with an element. - - Notes - ----- - Deletes real constant sets defined with the R command. - - This command is also valid in SOLUTION. - """ - command = "RDELE,%s,%s,%s,%s" % ( - str(nset1), - str(nset2), - str(ninc), - str(lchk), - ) - return self.run(command, **kwargs) - - def rlist(self, nset1="", nset2="", ninc="", **kwargs): - """APDL Command: RLIST - - Lists the real constant sets. - - Parameters - ---------- - nset1, nset2, ninc - List real constant sets from NSET1 to NSET2 (defaults to NSET1) in - steps of NINC (defaults to 1). If NSET1 = ALL (default), ignore - NSET2 and NINC and list all real constant sets [R]. - - Notes - ----- - The real constant sets listed contain only those values specifically - set by the user. Default values for real constants set automatically - within the various elements are not listed. - - This command is valid in any processor. - """ - command = "RLIST,%s,%s,%s" % (str(nset1), str(nset2), str(ninc)) - return self.run(command, **kwargs) - - def rmodif( - self, - nset="", - stloc="", - v1="", - v2="", - v3="", - v4="", - v5="", - v6="", - **kwargs, - ): - """APDL Command: RMODIF - - Modifies real constant sets. - - Parameters - ---------- - nset - Number of existing real constant set to be modified. - - stloc - Starting location in table for modifying data. For example, if - STLOC = 1, data input in the V1 field is the first constant in the - set. If STLOC = 7, data input in the V1 field is the seventh - constant in the set, etc. Must be greater than zero. - - v1 - New value assigned to constant in location STLOC. If zero (or - blank), a zero value will be assigned. - - v2, v3, v4, . . . , v6 - New values assigned to constants in the next five locations. If - blank, the value remains unchanged. - - Notes - ----- - Allows modifying (or adding) real constants to an existing set [R] at - any location. - - Specify NSET = GCN to define/modify real constants for real constant - sets that were previously assigned by the GCDEF command (that is, real - constants used in general contact interactions). - - This command is also valid in SOLUTION. For important information about - using this command within the solution phase, see What Are Nonstandard - Uses? in the Advanced Analysis Guide. - """ - command = "RMODIF,%s,%s,%s,%s,%s,%s,%s,%s" % ( - str(nset), - str(stloc), - str(v1), - str(v2), - str(v3), - str(v4), - str(v5), - str(v6), - ) - return self.run(command, **kwargs) - - def rmore(self, r7="", r8="", r9="", r10="", r11="", r12="", **kwargs): - """APDL Command: RMORE - - Adds real constants to a set. - - Parameters - ---------- - r7, r8, r9, . . . , r12 - Add real constants 7 to 12 (numerical values or table names) to the - most recently defined set. - - Notes - ----- - Adds six more real constants to the most recently defined set. Repeat - the RMORE command for constants 13 to 18, again for 19-24, etc. - - If using table inputs (SURF151, SURF152, FLUID116, CONTA171, CONTA172, - CONTA173, CONTA174, and CONTA175 only), enclose the table name in % - signs (e.g., %tabname%). - - When copying real constants to new sets, ANSYS, Inc. recommends that - you use the command input. If you do use the GUI, restrict the real - constant copy to only the first six real constants (real constants - seven and greater will be incorrect for both the master and copy set). - - This command is also valid in SOLUTION. - """ - command = "RMORE,%s,%s,%s,%s,%s,%s" % ( - str(r7), - str(r8), - str(r9), - str(r10), - str(r11), - str(r12), - ) - return self.run(command, **kwargs) - - def setfgap( - self, - gap="", - ropt="", - pamb="", - acf1="", - acf2="", - pref="", - mfp="", - **kwargs, - ): - """APDL Command: SETFGAP - - Updates or defines the real constant table for squeeze film elements. - - Parameters - ---------- - gap - Gap separation. - - ropt - Real constant set option. - - 0 - Creates separate real constant sets for each selected element with the - specified real constant values (default). - - 1 - Updates existing real constant sets. The gap separation is updated from - displacement results in the database. Other real constants are - updated as specified in the command input parameters. - - pamb - Ambient pressure. - - acf1, acf2 - Accommodation factor 1 and 2. - - pref - Reference pressure for mean free path. - - mfp - Mean free path. - - Notes - ----- - This command is used for large signal cases to update the gap - separation real constant on a per-element basis. Issue this command - prior to solution using the default ROPT value to initialize real - constant sets for every fluid element. After a solution, you can re- - issue the command to update the real constant set for a subsequent - analysis. See Introduction for more information on thin film analyses. - - Distributed ANSYS Restriction: This command is not supported in - Distributed ANSYS. - """ - command = f"SETFGAP,{gap},{ropt},,{pamb},{acf1},{acf2},{pref},{mfp}" - return self.run(command, **kwargs) diff --git a/src/ansys/mapdl/core/_commands/preproc/sections.py b/src/ansys/mapdl/core/_commands/preproc/sections.py deleted file mode 100644 index a5ca7c7b695..00000000000 --- a/src/ansys/mapdl/core/_commands/preproc/sections.py +++ /dev/null @@ -1,1707 +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 Sections: - def bsax(self, val1="", val2="", t="", **kwargs): - """Specifies the axial strain and axial force relationship for beam - - APDL Command: BSAX - sections. - - Parameters - ---------- - val1 - Axial strain component (ε). - - val2 - Axial force component (N). - - t - Temperature. - - Notes - ----- - The behavior of beam elements is governed by the generalized- - stress/generalized-strain relationship of the form: - - The BSAX command, one of several nonlinear general beam section - commands, specifies the relationship of axial strain and axial force - for a beam section. The section data defined is associated with the - section most recently defined (via the SECTYPE command). - - Unspecified values default to zero. - - Related commands are BSM1, BSM2, BSTQ, BSS1, BSS2, BSMD, and BSTE. - - For complete information, see Using Nonlinear General Beam Sections. - """ - command = f"BSAX,{val1},{val2},{t}" - return self.run(command, **kwargs) - - def bsm1(self, val1="", val2="", t="", **kwargs): - """Specifies the bending curvature and moment relationship in plane XZ for - - APDL Command: BSM1 - beam sections. - - Parameters - ---------- - val1 - Curvature component (κ1). - - val2 - Bending moment component (M1). - - t - Temperature. - - Notes - ----- - The behavior of beam elements is governed by the generalized- - stress/generalized-strain relationship of the form: - - The BSM1 command, one of several nonlinear general beam section - commands, specifies the bending curvature and moment for plane XZ of a - beam section. The section data defined is associated with the section - most recently defined (via the SECTYPE command). - - Unspecified values default to zero. - - Related commands are BSAX, BSM2, BSTQ, BSS1, BSS2, BSMD, and BSTE. - - For complete information, see Using Nonlinear General Beam Sections. - """ - command = f"BSM1,{val1},{val2},{t}" - return self.run(command, **kwargs) - - def bsm2(self, val1="", val2="", t="", **kwargs): - """Specifies the bending curvature and moment relationship in plane XY for - - APDL Command: BSM2 - beam sections. - - Parameters - ---------- - val1 - Curvature component (κ2). - - val2 - Bending moment component (M2). - - t - Temperature. - - Notes - ----- - The behavior of beam elements is governed by the generalized- - stress/generalized-strain relationship of the form: - - The BSM2 command, one of several nonlinear general beam section - commands, specifies the bending curvature and moment relationship for - plane XY of a beam section. The section data defined is associated with - the section most recently defined (via the SECTYPE command). - - Unspecified values default to zero. - - Related commands are BSAX, BSM1, BSTQ, BSS1, BSS2, BSMD, and BSTE. - - For complete information, see Using Nonlinear General Beam Sections. - """ - command = f"BSM2,{val1},{val2},{t}" - return self.run(command, **kwargs) - - def bsmd(self, dens="", **kwargs): - """Specifies mass per unit length for a nonlinear general beam section. - - APDL Command: BSMD - - Parameters - ---------- - dens - Mass density. - - Notes - ----- - The BSMD command, one of several nonlinear general beam section - commands, specifies the mass density (assuming a unit area) for a beam - section. The value specified is associated with the section most - recently defined (via the SECTYPE command). - - Related commands are BSAX, BSM1, BSM2, BSTQ, BSS1, BSS2, and BSTE. - - For complete information, see Using Nonlinear General Beam Sections. - """ - command = f"BSMD,{dens}" - return self.run(command, **kwargs) - - def bss1(self, val1="", val2="", t="", **kwargs): - """Specifies the transverse shear strain and force relationship in plane - - APDL Command: BSS1 - XZ for beam sections. - - Parameters - ---------- - val1 - Transverse shear strain component (γ1). - - val2 - Transverse shear force component (S1). - - t - Temperature. - - Notes - ----- - The behavior of beam elements is governed by the generalized- - stress/generalized-strain relationship of the form: - - The BSS1 command, one of several nonlinear general beam section - commands, specifies the transverse shear strain and transverse shear - force relationship for plane XZ of a beam section. The section data - defined is associated with the section most recently defined (via the - SECTYPE command). - - Unspecified values default to zero. - - Related commands are BSAX, BSM1, BSM2, BSTQ, BSS2, BSMD, and BSTE. - - For complete information, see Using Nonlinear General Beam Sections. - """ - command = f"BSS1,{val1},{val2},{t}" - return self.run(command, **kwargs) - - def bss2(self, val1="", val2="", t="", **kwargs): - """Specifies the transverse shear strain and force relationship in plane - - APDL Command: BSS2 - XY for beam sections. - - Parameters - ---------- - val1 - Transverse shear strain component (γ2). - - val2 - Transverse shear force component (S2). - - t - Temperature. - - Notes - ----- - The behavior of beam elements is governed by the generalized- - stress/generalized-strain relationship of the form: - - The BSS1 command, one of several nonlinear general beam section - commands, specifies the transverse shear strain and transverse shear - force relationship for plane XY of a beam section. The section data - defined is associated with the section most recently defined (via the - SECTYPE command). - - Unspecified values default to zero. - - Related commands are BSAX, BSM1, BSM2, BSTQ, BSS1, BSMD, and BSTE. - - For complete information, see Using Nonlinear General Beam Sections. - """ - command = f"BSS2,{val1},{val2},{t}" - return self.run(command, **kwargs) - - def bste(self, alpha="", **kwargs): - """Specifies a thermal expansion coefficient for a nonlinear general beam - - APDL Command: BSTE - section. - - Parameters - ---------- - alpha - Coefficient of thermal expansion for the cross section. - - Notes - ----- - The BSTE command, one of several nonlinear general beam section - commands, specifies a thermal expansion coefficient for a beam section. - The value specified is associated with the section most recently - defined (via the SECTYPE command). - - Related commands are BSAX, BSM1, BSM2, BSTQ, BSS1, BSS2, and BSMD. - - For complete information, see Using Nonlinear General Beam Sections. - """ - command = f"BSTE,{alpha}" - return self.run(command, **kwargs) - - def bstq(self, val1="", val2="", t="", **kwargs): - """Specifies the cross section twist and torque relationship for beam - - APDL Command: BSTQ - sections. - - Parameters - ---------- - val1 - Twist component (χ). - - val2 - Torque component (τ). - - t - Temperature. - - Notes - ----- - The behavior of beam elements is governed by the generalized- - stress/generalized-strain relationship of the form: - - The BSTQ command, one of several nonlinear general beam section - commands, specifies the cross section twist and torque relationship for - a beam section. The section data defined is associated with the section - most recently defined (via the SECTYPE command). - - Unspecified values default to zero. - - Related commands are BSAX, BSM1, BSM2, BSS1, BSS2, BSMD, and BSTE. - - For complete information, see Using Nonlinear General Beam Sections. - """ - command = f"BSTQ,{val1},{val2},{t}" - return self.run(command, **kwargs) - - def cbmd( - self, - row="", - c_r__r_="", - c_r__r_plus_1_="", - c_r__r_plus_2_="", - c_r__r_plus_3_="", - c_r__r_plus_4_="", - c_r__r_plus_5_="", - **kwargs, - ): - """Specifies preintegrated section mass matrix for composite-beam - - APDL Command: CBMD - sections. - - Parameters - ---------- - row - Row number of the matrix. - - c(r)(r), . . . , c(r)(r+5) - Upper triangle of the cross-section mass matrix [C]. - - Notes - ----- - With a unit beam length, the section mass matrix relates the resultant - forces and torques to accelerations and angular accelerations as - follows (applicable to the local element coordinate system): - - The CBMD command, one of several composite beam section commands, - specifies the section mass matrix (submatrix [C] data) for a composite - beam section. The section data defined is associated with the section - most recently defined (SECTYPE) at the specified temperature (CBTMP). - - Unspecified values default to zero. - - Related commands are CBTMP, CBTE, and CBMX. - - For complete information, see Using Preintegrated Composite Beam - Sections. - """ - command = f"CBMD,{row},{c_r__r_},{c_r__r_plus_1_},{c_r__r_plus_2_},{c_r__r_plus_3_},{c_r__r_plus_4_},{c_r__r_plus_5_}" - return self.run(command, **kwargs) - - def cbmx( - self, - row="", - s_r__r_="", - s_r__r_plus_1_="", - s_r__r_plus_2_="", - s_r__r_plus_3_="", - s_r__r_plus_4_="", - s_r__r_plus_5_="", - s_r__r_plus_6_="", - **kwargs, - ): - """Specifies preintegrated cross-section stiffness for composite beam - - APDL Command: CBMX - sections. - - Parameters - ---------- - row - Row number of the matrix. - - s(r)(r), . . . , s(r)(r+6) - Upper triangle of the cross-section stiffness matrix [S]. - - Notes - ----- - The behavior of beam elements is governed by the generalized- - stress/generalized-strain relationship of the form: - - The CBMX command, one of several composite beam section commands, - specifies the cross-section stiffness matrix (submatrix [S] data) for a - composite beam section. The section data defined is associated with the - section most recently defined (SECTYPE) at the specified temperature - (CBTMP). - - Unspecified values default to zero. - - Related commands are CBTMP, CBTE, and CBMD. - - For complete information, see Using Preintegrated Composite Beam - Sections. - """ - command = f"CBMX,{row},{s_r__r_},{s_r__r_plus_1_},{s_r__r_plus_2_},{s_r__r_plus_3_},{s_r__r_plus_4_},{s_r__r_plus_5_},{s_r__r_plus_6_}" - return self.run(command, **kwargs) - - def cbte(self, alpha="", **kwargs): - """Specifies a thermal expansion coefficient for a composite beam section. - - APDL Command: CBTE - - Parameters - ---------- - alpha - Coefficient of thermal expansion for the cross section. - - Notes - ----- - The CBTE command, one of several composite beam section commands, - specifies a thermal expansion coefficient for a beam section. The value - specified is associated with the section most recently defined - (SECTYPE) at the specified temperature (CBTMP). - - Unspecified values default to zero. - - Related commands are CBTMP, CBMX, and CBMD. - - For complete information, see Using Preintegrated Composite Beam - Sections. - """ - command = f"CBTE,{alpha}" - return self.run(command, **kwargs) - - def cbtmp(self, temp="", **kwargs): - """Specifies a temperature for composite-beam input. - - APDL Command: CBTMP - - Parameters - ---------- - temp - Temperature value. - - Notes - ----- - The CBTMP command, one of several composite beam-section commands, - specifies a temperature to be associated with the data input via - subsequent CBMX (preintegrated cross-section stiffness), CBMD - (preintegrated section mass), or CBTE (thermal-expansion) commands. - - The specified temperature remains active until the next CBTMP command - is issued. - - An unspecified temperature value defaults to zero. - - For complete information, see Using Preintegrated Composite Beam - Sections. - """ - command = f"CBTMP,{temp}" - return self.run(command, **kwargs) - - def sdelete(self, sfirst="", slast="", sinc="", knoclean="", lchk="", **kwargs): - """Deletes sections from the database. - - APDL Command: SDELETE - - Parameters - ---------- - sfirst - First section ID to be deleted; defaults to first available section - in the database. - - slast - Last section ID to be deleted; defaults to last available section - in the database. - - sinc - Increment of the section ID; defaults to 1. - - knoclean - Pretension element cleanup key (pretension sections only). - - 0 - Perform cleanup of pretension elements (delete pretension elements and - reconnect elements split during PSMESH). - - 1 - Do not perform cleanup. - - lchk - Specifies the level of element-associativity checking: - - NOCHECK - No element-associativity check occurs. This option is the default. - - WARN - When a section, material, or real constant is associated with an element, ANSYS - issues a message warning that the necessary entity has been - deleted. - - CHECK - The command terminates, and no section, material, or real constant is deleted - if it is associated with an element. - - Notes - ----- - Deletes one or more specified sections and their associated data from - the ANSYS database. - """ - command = f"SDELETE,{sfirst},{slast},{sinc},{knoclean},{lchk}" - return self.run(command, **kwargs) - - def secmodif(self, secid="", kywrd="", **kwargs): - """Modifies a pretension section - - APDL Command: SECMODIF - - Parameters - ---------- - secid - Unique section number. This number must already be assigned to a - section. - - norm - Keyword specifying that the command will modify the pretension - section normal direction. - - nx, ny, nz - Specifies the individual normal components to modify. - - kcn - Coordinate system number. This can be either 0 (Global Cartesian), - 1 (Global Cylindrical) 2 (Global Spherical), 4 (Working Plane), 5 - (Global Y Axis Cylindrical) or an arbitrary reference number - assigned to a coordinate system. - - Notes - ----- - The SECMODIF command either modifies the normal for a specified - pretension section, or changes the name of the specified pretension - surface. - """ - command = f"SECMODIF,{secid},{kywrd}" - return self.run(command, **kwargs) - - def secfunction(self, table="", kcn="", **kwargs): - """Specifies shell section thickness as a tabular function. - - APDL Command: SECFUNCTION - - Parameters - ---------- - table - Table name or array parameter reference for specifying thickness. - - kcn - Local coordinate system reference number or array interpretation - pattern for this tabular function evaluation. - - Notes - ----- - The SECFUNCTION command is associated with the section most recently - defined via the SECTYPE command. - - A table (TABLE) can define tabular thickness as a function of - coordinates. Alternatively, you can use an array parameter (indexed by - node number) that expresses the function to be mapped. (For example, - func (17) should be the desired shell thickness at node 17.) To - specify a table, enclose the table or array name in percent signs (%) - (SECFUNCTION,%tablename%). Use the ``*DIM`` command to define a table. - - The table or array defines the total shell thickness at any point in - space. In multilayered sections, the total thickness and each layer - thickness are scaled accordingly. - - The Function Tool is a convenient way to define your thickness tables. - For more information, see Using the Function Tool in the Basic Analysis - Guide. - - If you do not specify a local coordinate system (KCN), the program - interprets TABLE in global XYZ coordinates. (For information about - local coordinate systems, see the LOCAL command documentation.) - - When KCN = NODE, the program interprets TABLE as an array parameter - (indexed by node number) that expresses the function to be mapped. - - When KCN = NOD2, the program interprets TABLE as a 2-D array parameter - (where columns contain node numbers and rows contain the corresponding - thicknesses) that expresses the function to be mapped. - """ - command = f"SECFUNCTION,{table},{kcn}" - return self.run(command, **kwargs) - - def seccontrol( - self, - val1="", - val2="", - val3="", - val4="", - val5="", - val6="", - val7="", - val8="", - val9="", - val10="", - val11="", - val12="", - val13="", - **kwargs, - ): - """Supplements or overrides default section properties. - - APDL Command: SECCONTROL - - Parameters - ---------- - val1, val2, val3, . . . , val13 - Values, such as the length of a side or the numbers of cells along - the width, that describe the geometry of a section. See the "Notes" - section of this command description for details about these values - for the various section types. - - Notes - ----- - The SECCONTROL command is divided into these operation types: Beams, - Links, Pipes, Shells, and Reinforcings. - - Values are associated with the most recently issued SECTYPE command. - The data required is determined by the section type and is different - for each type. - - SECCONTROL overrides the program-calculated transverse-shear stiffness. - - The command does not apply to thermal shell elements SHELL131 and - SHELL132 or thermal solid elements SOLID278 and SOLID279. - """ - command = f"SECCONTROL,{val1},{val2},{val3},{val4},{val5},{val6},{val7},{val8},{val9},{val10},{val11},{val12},{val13}" - return self.run(command, **kwargs) - - def secdata( - self, - val1="", - val2="", - val3="", - val4="", - val5="", - val6="", - val7="", - val8="", - val9="", - val10="", - val11="", - val12="", - val13="", - val14="", - **kwargs, - ): - """Describes the geometry of a section. - - APDL Command: SECDATA - - Parameters - ---------- - val1, val2, val3, . . . , val14 - Values, such as thickness or the length of a side or the numbers of - cells along the width, that describe the geometry of a section. The - terms VAL1, VAL2, etc. are specialized for each type of cross- - section. - - Notes - ----- - The SECDATA command defines the data describing the geometry of a - section. The command is divided into these section types: Beams, Links, - Pipes, Axisymmetric, Taper, Shells, Pretension, Joints, Reinforcing, - and Contact. - - The data input on the SECDATA command is interpreted based on the most - recently issued SECTYPE command. The data required is determined by the - section type and subtype, and is different for each one. - - Beam sections are referenced by BEAM188 and BEAM189 elements. Not all - SECOFFSET location values are valid for each subtype. - - Type: BEAM, Subtype: RECT - - Type: BEAM, Subtype: QUAD - - Degeneration to triangle is permitted by specifying the same - coordinates for cells along an edge. - - Type: BEAM, Subtype: CSOLID - - Type: BEAM, Subtype: CTUBE - - This subtype is similar to type PIPE. However, elements using PIPE - account for internal or external pressures, whereas elements using - CTUBE do not. - - Type: BEAM, Subtype: CHAN - - Type: BEAM, Subtype: I - - Type: BEAM, Subtype: Z - - Type: BEAM, Subtype: L - - If W2 is a negative value, the section will be flipped. - - Type: BEAM, Subtype: T - - If W2 is a negative value, the section will be flipped. - - Type: BEAM, Subtype: HATS - """ - command = f"SECDATA,{val1},{val2},{val3},{val4},{val5},{val6},{val7},{val8},{val9},{val10},{val11},{val12},{val13},{val14}" - return self.run(command, **kwargs) - - def secjoint( - self, - kywrd="", - val1="", - val2="", - val3="", - val4="", - val5="", - val6="", - **kwargs, - ): - """Defines local coordinate systems at joint element nodes and other data - - APDL Command: SECJOINT - for joint elements. - - Parameters - ---------- - kywrd - Keyword that indicates the type of joint element data being - defined. - - LSYS or blank - Define local coordinate systems at the nodes that form the MPC184 joint - element. - - RDOF - Define the relative degrees of freedom to be fixed for an MPC184-General joint - element. - - PITC - Define the pitch of an MPC184-Screw joint element. - - FRIC - Define the geometric quantities required for Coulomb frictional behavior in the - MPC184-Revolute or MPC184-Translational joint element. - - val1, val2, val3, val4, val5, val6 - The meaning of Val1 through Val6 changes, depending on the value of - Kywrd. - - Notes - ----- - Use this command to define additional section data for MPC184 joint - elements. To overwrite the current values, issue another SECJOINT - command with the same Kywrd value. The data input on this command is - interpreted based on the most recently issued SECTYPE command. - """ - command = f"SECJOINT,{kywrd},{val1},{val2},{val3},{val4},{val5},{val6}" - return self.run(command, **kwargs) - - def seclib(self, option="", path="", **kwargs): - """Sets the default section library path for the SECREAD command. - - APDL Command: /SECLIB - - Parameters - ---------- - option - READ - - READ - Sets the read path (default). - - STATUS - Reports the current section library path setting to the Jobname.LOG file. - - path - Defines the directory path from which to read section library - files. - - Notes - ----- - When the SECREAD command is issued without a directory path, the - command searches for a section library in the following order: - - The user's home directory - - The current working directory - - The path specified by the /SECLIB command - """ - command = f"/SECLIB,{option},{path}" - return self.run(command, **kwargs) - - def seclock( - self, - dof1="", - minvalue1="", - maxvalue1="", - dof2="", - minvalue2="", - maxvalue2="", - dof3="", - minvalue3="", - maxvalue3="", - **kwargs, - ): - """Specifies locks on the components of relative motion in a joint - - APDL Command: SECLOCK - element. - - Parameters - ---------- - dof - Local degree of freedom to be locked. - - minvalue - Low end of the range of allowed movement for the specified DOF. - - maxvalue - High end of the range of allowed movement for the specified DOF. - - Notes - ----- - Specify up to three DOFs to be locked. Locks are activated when the - limit values are reached, and further motion in that DOF is frozen. If - necessary, you may repeat the command. - """ - command = f"SECLOCK,{dof1},{minvalue1},{maxvalue1},{dof2},{minvalue2},{maxvalue2},{dof3},{minvalue3},{maxvalue3}" - return self.run(command, **kwargs) - - def secnum(self, secid="", **kwargs): - """Sets the element section attribute pointer. - - APDL Command: SECNUM - - Parameters - ---------- - secid - Defines the section ID number to be assigned to the subsequently- - defined elements. Defaults to 1. See SECTYPE for more information - about the section ID number. - """ - command = f"SECNUM,{secid}" - return self.run(command, **kwargs) - - def secoffset( - self, - location="", - offset1="", - offset2="", - cg_y="", - cg_z="", - sh_y="", - sh_z="", - **kwargs, - ): - """Defines the section offset for cross sections. - - APDL Command: SECOFFSET - - Parameters - ---------- - location, offset1, offset2, cg-y, cg-z, sh-y, sh-z - The location of the nodes in the section. All are dependent on the - type. See the "Notes" section of this command description for - details about these values for the various section types. - - Notes - ----- - The SECOFFSET command is divided into three types: Beams, Pipes, and - Shells. - - The offsets defined by the SECOFFSET command are associated with the - section most recently defined using the SECTYPE command. Not all - SECOFFSET location values are valid for each subtype. - - For the thermal shell elements, SHELL131 and SHELL132, the node offset - specified by SECOFFSET is used in thermal contact analyses. Otherwise, - the SECOFFSET command has no effect on the solution for these elements - and is used only for visualization purposes. - - This command is not valid with thermal solid elements SOLID278 and - SOLID279. - """ - command = ( - f"SECOFFSET,{location},{offset1},{offset2},{cg_y},{cg_z},{sh_y},{sh_z}" - ) - return self.run(command, **kwargs) - - def secplot(self, secid="", val1="", val2="", val3="", **kwargs): - """Plots the geometry of a beam, pipe, shell, or reinforcing section to - - APDL Command: SECPLOT - scale. - - Parameters - ---------- - secid - The section ID number (as defined via the SECTYPE command). - - val1, val2, val3 - Values that control the information to be plotted. See the "Notes" - section of this command description for more information. For - clarity, the labels VAL1, VAL2, and VAL3 are renamed according to - the section type. - - Notes - ----- - The SECPLOT command is valid only for "Beams and Pipes", "Shells", and - "Reinforcings". - - SECPLOT cannot display the plot of an ASEC (arbitrary section) subtype. - - Plots the geometry of the beam or pipe section to scale depicting the - centroid, shear center, and origin. SECPLOT also lists various section - properties such as Iyy, Iyz, and Izz. - - Data to be supplied in the value fields: - - Beam or pipe section mesh display options: - - Display section outline only. - - Display beam or pipe section mesh. - - Display the section mesh with node numbers. - - Display the section mesh with cell numbers. - - Display the section mesh with material numbers and colors. - - Display the section mesh with material colors only. - - Display the section mesh with the RST node numbers. RST nodes are - section corner nodes where results are available. This is applicable - when the averaged results format (KEYOPT(15) = 0 for BEAM188, BEAM189, - PIPE288, and PIPE289) is used. - - Display the section mesh with the RST cell numbers. RST cells are - section cells where results are available. This is applicable when the - non-averaged results format (KEYOPT(15) = 1 for BEAM188, BEAM189, - PIPE288, and PIPE289) is used. - - Options 2 through 6 do not depict centroid and shear center, nor do - they list section properties. - - Following is a sample section plot for the beam section type: - - Plots the layer arrangement of the shell section showing the layer - material and orientation. - - Data to be supplied in the value fields: - - The range of layer numbers to be displayed. If LAYR1 is greater than - LAYR2, a reversed order display is produced. Up to 20 layers may be - displayed at the same time. LAYR1 defaults to 1. LAYR2 defaults to - LAYR1 if LAYR1 is input or to the number of layers (or to 19+LAYR1, if - smaller) if LAYR1 is not input. - - Following is a sample section plot for the shell section type: - - Plots the arrangement of a reinforcing section within the base element. - - Data to be supplied in the value fields: - - REINF1, REINF2 -- The numerical range of reinforcings to be displayed. - The default REINF1 value is 1. The default REINF2 value is the number - of reinforcings. - - OVERLAY -- The section ID of the base element within which to display - the reinforcing section. The section appears translucent and the - reinforcing section is solid. Valid values are: - - SOLID -- Display a translucent solid block over the reinforcing section - - SECID -- A number corresponding to a specific section ID of the base - element. - - If no OVERLAY value is specified, ANSYS displays the reinforcing - section only. - - Following is a sample section plot for the reinforcing section type: - - For more information about reinforcing, see the documentation for the - SECDATA command, and the REINF264 and REINF265 elements. - """ - command = f"SECPLOT,{secid},{val1},{val2},{val3}" - return self.run(command, **kwargs) - - def secread(self, fname="", ext="", option="", **kwargs): - """Reads a custom section library or a user-defined section mesh into - - APDL Command: SECREAD - ANSYS. - - Parameters - ---------- - fname - Section library file name and directory path containing the section - library file (248 characters maximum, including directory). If you - do not specify a directory path, it will default to your working - directory and you can use all 248 characters for the file name. - - ext - Filename extension (eight-character maximum). - - option - LIBRARY - Reads in a library of sections and - theirassociated section data values; the default. A - section library may be created by editing the - section-defining portions of the Jobname.LOG file and - saving it with a .SECT suffix. - - Notes - ----- - The SECREAD command operates on the section specified via the - most recently issued SECTYPE command. Issue a separate SECREAD - command for each section ID that you want to read in. - - Here are excerpts from a sample user section mesh file for a - section with 75 nodes, 13 cells, and 9 nodes per cell for a - two-hole box section. Illustrations of the two-hole box - section and the cell mesh for it appear later in this command - description. - - The mesh file is divided into three sections: the First Line, - the Cells Section, and the Nodes Section. Here are brief - descriptions of the contents of each. - - First Line: The First Line defines the number of nodes and the - number of cells for the mesh. - - Cells Section: The Cells Section contains as many lines as - there are cells. In this example, there are thirteen cells, - so there are thirteen lines in this section. In each line, the - number "1" that follows the cell connectivity information is - the material number. - - Cell nodal connectivity must be given in a counterclockwise - direction, with the center node being the ninth node. For - details, see Figure: 10:: Cell Mesh for the Two-hole Box - Section. - - Nodes Section: The Nodes Section contains as many lines as - there are nodes. In this example, there are 75 nodes, so - there are a total of 75 lines in this section. Each node line - contains the node's boundary flag, the Y coordinate of the - node, and the Z coordinate of the node. Currently, all node - boundary flags appear as 0s in a cell mesh file (as - illustrated in Figure: 9:: Two-hole Box Section). Since all - node boundary flags are 0, SECREAD ignores them when it reads - a cell mesh file into ANSYS. - - There cannot be any gaps in the node numbering of a cell mesh. - The nodes in a cell mesh must be numbered consecutively, with - the first node having a node number of 1, and the last node - having a node number that is equal to the maximum number of - nodes in the cell mesh. - """ - return self.run(f"SECREAD,{fname},{ext},,{option}", **kwargs) - - def secstop( - self, - dof1="", - minvalue1="", - maxvalue1="", - dof2="", - minvalue2="", - maxvalue2="", - dof3="", - minvalue3="", - maxvalue3="", - **kwargs, - ): - """Specifies stops on the components of relative motion in a joint - - APDL Command: SECSTOP - element. - - Parameters - ---------- - dof - Local degree of freedom to be stopped. - - minvalue - Low end of the range of allowed movement for the specified DOF. - - maxvalue - High end of the range of allowed movement for the specified DOF. - - Notes - ----- - Stops restrict motion in a DOF; motion beyond the MINVALUE or MAXVALUE - is prevented (motion away from a limit is allowed). You can specify up - to three stops. If necessary, you can repeat the command. - """ - command = f"SECSTOP,{dof1},{minvalue1},{maxvalue1},{dof2},{minvalue2},{maxvalue2},{dof3},{minvalue3},{maxvalue3}" - return self.run(command, **kwargs) - - def sectype(self, secid="", type_="", subtype="", name="", refinekey="", **kwargs): - """Associates section type information with a section ID number. - - APDL Command: SECTYPE - - Parameters - ---------- - secid - Section identification number. - - type\\_ - BEAM - - BEAM - Defines a beam section. - - TAPER - Defines a tapered beam or pipe section. The sections at the end points must be - topologically identical. - - GENB - Defines a nonlinear general (temperature-dependent) beam section. - - COMB - Defines a composite (temperature-dependent) beam section. - - PIPE - Defines a pipe section. - - LINK - Defines a link section. - - AXIS - Define the axis for a general axisymmetric section. - - SHELL - Defines a shell section. - - GENS - Defines a preintegrated general (temperature-dependent) shell section. - - PRETENSION - Defines a pretension section. - - JOINT - Defines a joint section. - - REINF - Defines a reinforcing section. - - CONTACT - Defines a contact section. - - subtype - When Type = BEAM, the possible beam sections that can be defined - for Subtype are: - - name - An eight-character name for the section. Name can be a string such - as "W36X210" or "HP13X73" for beam sections. Section name can - consist of letters and numbers, but cannot contain punctuation, - special characters, or spaces. - - refinekey - Sets mesh refinement level for thin-walled beam sections. Valid - values are 0 (the default - no mesh refinement) through 5 (high - level of mesh refinement). This value has meaning only when Type = - BEAM. - - Notes - ----- - SECTYPE sets the section ID number, section type, and subtype for a - section. If the section ID number is not specified, ANSYS increments - the highest section ID number currently defined in the database by one. - A previously-defined section with the same identification number will - be redefined. The geometry data describing this section type is defined - by a subsequent SECDATA command. Define the offsets by a subsequent - SECOFFSET command. The SLIST command lists the section properties, and - the SECPLOT command displays the section to scale. The SECNUM command - assigns the section ID number to a subsequently-defined beam element. - - For a beam section (Type = BEAM), a subsequent SECDATA command builds a - numeric model using a nine-node cell for determining the properties - (Ixx, Iyy, etc.) of the section and for the solution to the Poisson's - equation for torsional behavior. See Beam Analysis and Cross Sections - in the Structural Analysis Guide for examples using the section - commands. - - For a nonlinear general beam section (Type = GENB), the Subtype and - REFINEKEY options do not apply. Subsequent commands are necessary to - define the section: BSAX, BSM1, BSM2, BSTQ, BSS1, BSS2, BSMD, and BSTE - are available. All other section commands are ignored for this section - type. - - For a preintegrated composite-beam section (Type = COMB), the REFINEKEY - options do not apply. Subsequent commands are necessary to define the - section: CBTMP, CBMX, CBMD, and CBTE are available. All other section - commands are ignored for this section type. - - For a tapered beam or pipe section (Type = TAPER), two subsequent - SECDATA commands are required (one for each end section). Section ends - must be topologically identical (same Subtype, number of cells and - material IDs). For a tapered pipe section, end sections must have the - same number of cells around the circumference and along the pipe wall, - and the same shell section ID for a composite pipe wall. - """ - command = f"SECTYPE,{secid},{type_},{subtype},{name},{refinekey}" - return self.run(command, **kwargs) - - def secwrite(self, fname="", ext="", elem_type="", **kwargs): - """Creates an ASCII file containing user mesh section information. - - APDL Command: SECWRITE - - Parameters - ---------- - fname - File name and directory path (248 characters maximum, - including the characters needed for the directory path). - An unspecified directory path defaults to the working - directory; in this case, you can use all 248 characters - for the file name. - - ext - Filename extension (eight-character maximum). - - elem_type - Element type attribute pointer (ET) for the elements that - are part of the section. See SECREAD for a detailed - description. - - Notes - ----- - Before creating a user mesh file, first create a model using - 2-D meshing. Use PLANE183 or MESH200 with KEYOPT(1) = 7 - (quadrilateral with 8 nodes option) to model the cells. - SECWRITE creates an ASCII file that contains information about - the nodes and cells that describe a beam section. For detailed - information on how to create a user mesh file, see Creating - Custom Cross Sections with a User-defined Mesh in the - Structural Analysis Guide. - """ - return self.run(f"SECWRITE,{fname},{ext},,{elem_type}", **kwargs) - - def sflex(self, ffax="", ffby="", ffbz="", ffto="", fftsy="", fftsz="", **kwargs): - """Sets flexibility factors for the currently defined pipe element - - APDL Command: SFLEX - section. - - Parameters - ---------- - ffax - Factor to increase axial flexibility. The default value is 1.0. - - ffby - Factor to increase bending flexibility about element y axis - (bending in the element x-z plane). The default value is 1.0. - - ffbz - Factor to increase bending flexibility about element z axis - (bending in the element x-y plane). The default value is FFBY. - - ffto - Factor to increase torsional flexibility. The default value is 1.0. - - fftsy - Factor to increase transverse shear flexibility in the element x-z - plane. The default value is 1.0. - - fftsz - Factor to increase transverse shear flexibility in the element x-y - plane. The default value is FFTSY. - - Notes - ----- - The SFLEX command sets section-flexibility factors for sections used by - pipe elements. - - To increase stiffness, use a flexibility factor of less than 1.0. - - The FFBY and FFTSY arguments affect motion in the element x-z plane, - and the FFBZ and FFTSZ arguments affect motion in the element x-y - plane. For stout pipe structures with low slenderness ratios, set both - FFBY and FFTSY--and/or both FFBZ and FFTSZ (the related bending and - transverse shear factors)--to the same value to obtain the expected - flexibility effect. - - When issued, the SFLEX command applies to the pipe section most - recently defined via the SECTYPE command. - - SFLEX is valid only for linear material properties and small strain - analyses. The command does not support offsets, temperature loading, or - initial state loading. While the resulting displacements and reactions - are valid, the stresses may not be valid. - """ - command = f"SFLEX,{ffax},{ffby},{ffbz},{ffto},{fftsy},{fftsz}" - return self.run(command, **kwargs) - - def slist(self, sfirst="", slast="", sinc="", details="", type_="", **kwargs): - """Summarizes the section properties for all defined sections in the - - APDL Command: SLIST - current session. - - Parameters - ---------- - sfirst - First section ID to be summarized. Defaults to first available - section in the database. - - slast - Last section ID to be summarized. Defaults to last available - section in the database. - - sinc - Increment of the section ID; defaults to 1. - - details - Determines the content of the summarized information for beams and - shells. - - BRIEF - For beams, lists only the section integrated properties (such as Area, Iyy, and - Iyz). This option is the default. - - FULL - For beams, lists the section integrated properties, as well as the section - nodal coordinates, section cell connectivity information, - and section cell integration point coordinates. For shells, - the section stiffness (membrane, bending, membrane-bending - coupling and transverse shear) are printed. - - The shell section stiffness listed considers elastic behavior of materials at reference temperature only. The elements that use the section data may alter the transverse shear stiffness based on slenderness considerations (in addition to the shear correction factors shown). - Section stiffness terms listed via the FULL option do not include section - offsets. The ANSYS program considers section - offsets during the solution phase of the - analysis. - - GROUP - If a section calls other sections, this option lists those sections too. - - type\\_ - The section type. Valid arguments are ALL (the default) and the - types available on the SECTYPE command. - - Notes - ----- - By default, the command lists information concerning all sections; - however, you can limit the output to only beam or pretension sections - via the Type key. Also, by default when ocean loading is present, the - command lists the beam section properties used by ocean loading. - - Following is example output from the SLIST,,,,BRIEF command for a - rectangular beam section subtype (SECTYPE,,BEAM,RECT): - """ - command = f"SLIST,{sfirst},{slast},{sinc},{details},{type_}" - return self.run(command, **kwargs) - - def sload( - self, - secid="", - plnlab="", - kinit="", - kfd="", - fdvalue="", - lsload="", - lslock="", - **kwargs, - ): - """Load a pretension section. - - APDL Command: SLOAD - - Parameters - ---------- - secid - Unique section number. The number must already be assigned to a - pretension section. - - plnlab - Label representing the pretension load sequence number in the - format "PLnn" where nn is an integer from 1 through 99 (for - example, PL01 through PL99). - - kinit - Initial action key for pretension load PL01. (This field is omitted - for PL02 and up.) Three scenarios are possible: - - LOCK - Constrains (connects) the cutting plane on the pretension section. This value - is the default. - - SLID - Unconstrains (disconnects) the cutting plane on the pretension section. - - TINY - Applies a very small pretension load (0.1% of FDVALUE) before the desired load - is established. The small load prevents convergence problems - which can occur when the desired load is not established in - the first load step. This value is valid only if KFD = FORC. - - kfd - Force/Displacement key. Specifies whether FDVALUE is a force or a - displacement: - - FORC - Apply a force on the specified pretension section. This value is the default. - - DISP - Apply a displacement (adjustment) on the specified pretension section. - - fdvalue - Pretension load value. If KFD = FORC, this value is a pretension - force. If KFD = DISP, this value is a pretension displacement - (adjustment). - - lsload - Load step in which to apply the FDVALUE. - - lslock - The load step in which the displacement value resulting from the - pretension force is locked. This value is valid only if KFD = FORC. - - Notes - ----- - The SLOAD command applies pretension loads to specified pretension - sections (created via the PSMESH command). A pretension load is ramp- - applied (KBC = 0) if it is a force (KFD = FORC), and step-applied (KBC - = 1) if it is a displacement (KFD = DISP). - - You can "lock" the load value at a specified load step. When locked, - the load changes from a force to a displacement, and ANSYS applies the - load as a constant displacement in all future load steps. Locking is - useful when applying additional loadings. The additional loadings alter - the effect of the initial load value, but because locking transforms - the load into a displacement, it preserves the initial load's effect. - - In modal and harmonic analyses, any pretension load (force, - displacement, or locked) is ignored and no load is produced. - - The following command shows how to establish loads on a pretension - section: - - SLOAD,1,PL01,TINY,FORC,5000,2,3 - - In this example, the load is applied to pretension section 1, and the - sequence begins with the initial action key, KINIT, set to TINY. A - small stabilization load (5 = 0.10% of 5000) is applied in the first - load step, as the actual pretension force is not applied until the - second load step. The next four fields set the actual load: the KFD - value FORC specifies the type of load, FDVALUE defines the pretension - load value (5000), LSLOAD specifies the load step in which the force is - applied (2), and the LSLOCK field specifies the load step in which the - force is locked (3). Additional sets of four fields can be used to - define additional loads. - - You can use the SLOAD command to edit (overwrite) existing loads on a - pretension section. This example changes the load on pretension section - 1 (set above) to 6000: - - SLOAD,1,PL01,,,6000,2,3 - - Unspecified values (blank fields), as shown in this example, remain - unchanged from prior settings. If no prior specifications exist, then - default values (KINIT = LOCK and KFD = FORC) apply. - - The command can also delete all loads on a specified pretension - section, as shown here: - - SLOAD,1,DELETE - - For a prestressed modal analysis, this command locks the pretension - element: - - SLOAD,1,PL01,LOCK,DISP,0,1,2 - """ - command = f"SLOAD,{secid},{plnlab},{kinit},{kfd},{fdvalue},{lsload},{lslock}" - return self.run(command, **kwargs) - - def ssbt(self, bt11="", bt22="", bt12="", t="", **kwargs): - """Specifies preintegrated bending thermal effects for shell sections. - - APDL Command: SSBT - - Parameters - ---------- - bt11, bt22, bt12 - Bending thermal effects component [BT]. - - t - Temperature. - - Notes - ----- - The behavior of shell elements is governed by the generalized- - stress/generalized-strain relationship of the form: - - The SSBT command, one of several preintegrated shell section commands, - specifies the bending thermal effects quantity (submatrix [BT] data) - for a preintegrated shell section. The section data defined is - associated with the section most recently defined (via the SECTYPE - command). - - The [BT] quantity represents bending stress resultants caused by a unit - raise in temperature on a fully constrained model. For a layered - composite shell, it is usually necessary to specify both the [BT] and - [MT] quantities (by issuing the SSBT and SSMT commands, respectively). - - Unspecified values default to zero. - - Related commands are SSPA, SSPB, SSPD, SSPE, SSMT, and SSPM. - - If you are using the SHELL181 or SHELL281 element's Membrane option - (KEYOPT(1) = 1), it is not necessary to issue this command. - - For complete information, see Using Preintegrated General Shell - Sections. - """ - command = f"SSBT,{bt11},{bt22},{bt12},{t}" - return self.run(command, **kwargs) - - def ssmt(self, mt11="", mt22="", mt12="", t="", **kwargs): - """Specifies preintegrated membrane thermal effects for shell sections. - - APDL Command: SSMT - - Parameters - ---------- - mt11, mt22, mt12 - Membrane thermal effects component [MT]. - - t - Temperature. - - Notes - ----- - The behavior of shell elements is governed by the generalized- - stress/generalized-strain relationship of the form: - - The SSMT command, one of several preintegrated shell section commands, - specifies the membrane thermal effects quantity (submatrix [MT] data) - for a preintegrated shell section. The section data defined is - associated with the section most recently defined (via the SECTYPE - command). - - The [MT] quantity represents membrane stress resultants caused by a - unit raise in temperature on a fully constrained model. For a layered - composite shell, it is usually necessary to specify both the [MT] and - [BT] quantities (by issuing the SSMT and SSBT commands, respectively). - - Unspecified values default to zero. - - Related commands are SSPA, SSPB, SSPD, SSPE, SSBT, and SSPM. - - For complete information, see Using Preintegrated General Shell - Sections. - """ - command = f"SSMT,{mt11},{mt22},{mt12},{t}" - return self.run(command, **kwargs) - - def sspa(self, a11="", a21="", a31="", a22="", a32="", a33="", t="", **kwargs): - """Specifies a preintegrated membrane stiffness for shell sections. - - APDL Command: SSPA - - Parameters - ---------- - a11, a21, a31, a22, a32, a33 - Membrane stiffness component (symmetric lower part of submatrix - [A]). - - t - Temperature. - - Notes - ----- - The behavior of shell elements is governed by the generalized- - stress/generalized-strain relationship of the form: - - The SSPA command, one of several preintegrated shell section commands, - specifies the membrane stiffness quantity (submatrix [A]) for a - preintegrated shell section. The section data defined is associated - with the section most recently defined (via the SECTYPE command). - - Unspecified values default to zero. - - Related commands are SSPB, SSPD, SSPE, SSMT, SSBT, and SSPM. - - For complete information, see Using Preintegrated General Shell - Sections. - """ - command = f"SSPA,{a11},{a21},{a31},{a22},{a32},{a33},{t}" - return self.run(command, **kwargs) - - def sspb( - self, - b11="", - b21="", - b31="", - b22="", - b32="", - b33="", - t="", - b12="", - b13="", - b23="", - **kwargs, - ): - """Specifies a preintegrated coupling stiffness for shell sections. - - APDL Command: SSPB - - Parameters - ---------- - b11, b21, b31, b22, b32, b33 - Coupling stiffness component (symmetric lower part of submatrix - [B]). - - t - Temperature. - - b12, b13, b23 - Upper part of submatrix [B] - - Notes - ----- - The behavior of shell elements is governed by the generalized- - stress/generalized-strain relationship of the form: - - If the coefficients B12, B13, B23 are undefined, ANSYS uses a symmetric - form of submatrix [B]. If any one of the coefficients B12, B13, B23 is - nonzero, ANSYS considers submatrix [B] to be unsymmetric. - - The SSPB command, one of several preintegrated shell section commands, - specifies the coupling stiffness quantity (submatrix [B] data) for a - preintegrated shell section. The section data defined is associated - with the section most recently defined (via the SECTYPE command). - - Unspecified values default to zero. - - Related commands are SSPA, SSPD, SSPE, SSMT, SSBT, and SSPM. - - If you are using the SHELL181 or SHELL281 element's Membrane option - (KEYOPT(1) = 1), it is not necessary to issue this command. - - For complete information, see Using Preintegrated General Shell - Sections. - """ - command = f"SSPB,{b11},{b21},{b31},{b22},{b32},{b33},{t},{b12},{b13},{b23}" - return self.run(command, **kwargs) - - def sspd(self, d11="", d21="", d31="", d22="", d32="", d33="", t="", **kwargs): - """Specifies a preintegrated bending stiffness for shell sections. - - APDL Command: SSPD - - Parameters - ---------- - d11, d21, d31, d22, d32, d33 - Bending stiffness component (symmetric lower part of submatrix - [D]). - - t - Temperature. - - Notes - ----- - The behavior of shell elements is governed by the generalized- - stress/generalized-strain relationship of the form: - - The SSPD command, one of several preintegrated shell section commands, - specifies the bending stiffness quantity (submatrix [D] data) for a - preintegrated shell section. The section data defined is associated - with the section most recently defined (via the SECTYPE command). - - Unspecified commands default to zero. - - Related commands are SSPA, SSPB, SSPE, SSMT, SSBT, and SSPM. - - If you are using the SHELL181 or SHELL281 element's Membrane option - (KEYOPT(1) = 1), it is not necessary to issue this command. - - For complete information, see Using Preintegrated General Shell - Sections. - """ - command = f"SSPD,{d11},{d21},{d31},{d22},{d32},{d33},{t}" - return self.run(command, **kwargs) - - def sspe(self, e11="", e21="", e22="", t="", **kwargs): - """Specifies a preintegrated transverse shear stiffness for shell - - APDL Command: SSPE - sections. - - Parameters - ---------- - e11, e21, e22 - Transverse shear stiffness component (symmetric lower part of - submatrix [E]). - - t - Temperature. - - Notes - ----- - The behavior of shell elements is governed by the generalized- - stress/generalized-strain relationship of the form: - - The SSPE command, one of several preintegrated shell section commands, - specifies the transverse shear stiffness quantity (submatrix [E] data) - for a preintegrated shell section. The section data defined is - associated with the section most recently defined (via the SECTYPE - command). - - Unspecified values default to zero. - - Related commands are SSPA, SSPB, SSPD, SSMT, SSBT, and SSPM. - - If you are using the SHELL181 or SHELL281 element's Membrane option - (KEYOPT(1) = 1), it is not necessary to issue this command. - - For complete information, see Using Preintegrated General Shell - Sections. - """ - command = f"SSPE,{e11},{e21},{e22},{t}" - return self.run(command, **kwargs) - - def sspm(self, dens="", t="", **kwargs): - """Specifies mass density for a preintegrated shell section. - - APDL Command: SSPM - - Parameters - ---------- - dens - Mass density. - - t - Temperature. - - Notes - ----- - The SSPM command, one of several preintegrated shell section commands, - specifies the mass density (assuming a unit thickness) for a - preintegrated shell section. The value specified is associated with the - section most recently defined (via the SECTYPE command). - - Related commands are SSPA, SSPB, SSPD, SSPE, SSMT, and SSBT. - - For complete information, see Using Preintegrated General Shell - Sections. - """ - command = f"SSPM,{dens},{t}" - return self.run(command, **kwargs) diff --git a/src/ansys/mapdl/core/_commands/preproc/special_purpose.py b/src/ansys/mapdl/core/_commands/preproc/special_purpose.py deleted file mode 100644 index 18bf3da44c8..00000000000 --- a/src/ansys/mapdl/core/_commands/preproc/special_purpose.py +++ /dev/null @@ -1,1327 +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 SpecialPurpose: - def aerocoeff( - self, - aeromodetype="", - aeromappedfilenames="", - aerospecs="", - aeroscalar="", - nblades="", - autofileread="", - **kwargs, - ): - """Computes the aero-damping and stiffness coefficients and - writes them to an APDL array. - - APDL Command: AEROCOEFF - - Parameters - ---------- - aeromodetype - Mode type to be used. - - * ``"blade"`` : Non-cyclic cantilevered blade mode (default) - - aeromappedfiles - Name of string array containing file names of mapped pressures - from CFD. The file names should be ordered to correspond to - the AeroSpecs array. - - aerospecs - Name of numerical array containing data organized to correspond to - the AeroMappedFiles array. - - aeroscalar - Scaling value(s) to handle any modal scaling difference - between structural and CFD modes. The values can be entered as - a scalar or 1-dimensional array. (each scaling value defaults - to 1) - - nblades - Number of blades. - - autofileread - Key to automatically read and use values from CFD file header. - - * 0 (OFF or NO) : Do not read scaling values or nodal diameter - from the CFD file header. (default) - * 1 (ON or YES) : Read scaling values (labeled Mode Multiplier - in CFD file) from CFD file header. The scaling values read - will be used in calculations and the AeroScalar input will - be ignored. The nodal diameter values will be used to cross - check the value of i (input through AeroSpecs array). - - Notes - ----- - The AEROCOEFF command is designed to generate an array of - aerodynamic coefficients that can be used in a cyclic - mode-superposition harmonic response analysis using the CYCFREQ - , AERO command to represent aerodynamic stiffness and - damping. These aerodynamic coefficients can also be used in a damped - modal analysis phase (CYCFREQ, MODAL) of a cyclic - mode-superposition harmonic solve. An APDL array called - JobnameAeroArray is generated using the AEROCOEFF command. This array - is compatible with the array needed for the CYCFREQ, AERO command. - The format of the written array follows that of the CYCFREQ, AERO - command. The array is formatted as follows: - ``i, m, n, V_real, V_imag`` - - where - * ``i`` = the i th interblade phase angle (IBPA) - * ``m`` = the m th vibrating blade mode - * ``n`` = the n th blade mode generating the pressure oscillations - - ``Vreal`` and ``V_imag`` = the real and imaginary coefficients. - - Prior to issuing the AEROCOEFF command, a non-cyclic cantilevered - blade modal analysis must be run, either stress-free or - prestressed using linear perturbation. For more information, see - Modal Analysis in the Structural Analysis Guide. The file - requirements for the AEROCOEFF command are the same as those - needed for modal restart as described in Modal Analysis Restart. - The AeroSpecs values are specified in a 3xr array ``*DIM``, - where r is a positive integer equal to the number of interblade - phase angles and the pressure modes solved for in the CFD - analysis. - - Each row has the structure: ``i, m, n`` - where - * ``i`` = the i th interblade phase angle (IBPA) - * ``m`` = the m th vibrating blade mode - * ``n`` = the n th blade mode generating the pressure oscillations - - At least one aerodynamic damping coefficient must be specified for - each IBPA (equal to the number of blades) while keeping and - constant. If a value is not specified, the program writes an array - value of zero for both and . The values of and are relative to the - modes computed in the re- quired modal analysis. - - The number of AeroScalar values must be equal to the number of - pressure modes ( from Aero- Specs). If the number of AeroScalar - values is greater than 1, the values must be entered by defining - an array ``*DIM`` and entering the array name in the AeroScalar - field. For a discussion of how AeroScalar values are computed, see - Scaling Aerodynamic Coupling Coefficients. - - The value for nBlades should be equal to the number of sectors of - the system. If there are multiple blades per cyclic sector, then - the combination of blades on the single sector will have an aero - coefficient value. In this case, each blade will not have a - distinct aero coefficient. - """ - command = f"AEROCOEFF,{aeromodetype},{aeromappedfilenames},{aerospecs},{aeroscalar},{nblades},{autofileread}" - return self.run(command, **kwargs) - - def cint( - self, - action="", - par1="", - par2="", - par3="", - par4="", - par5="", - par6="", - par7="", - **kwargs, - ): - """Defines parameters associated with fracture parameter calculations - - APDL Command: CINT - - Parameters - ---------- - action - Specifies action for defining or manipulating initial crack data: - - NEW - Initiate a new calculation and assign an ID. - - CTNC - Define the crack tip node component. - - CENC - Define the crack extension node component, the crack tip node, - and the crack extension direction. - - TYPE - Define the type of calculation to perform. - - DELE - Delete the ``CINT`` object associated with the specified ID. - - NCON - Define the number of contours to be calculated in the - contour-integral calculation. - - SYMM - Indicate whether the crack is on a symmetrical line or plane. - - NORM - Define the crack plane normal. - - UMM - Activate or deactivate the unstructured mesh method. - - EDIR - Crack-assist extension direction. - - PLOT - Plots crack front and crack tip coordinate system. - - CXFE - Define the crack tip element or crack front element set. - Valid for XFEM-based crack-growth analysis only. - - RADIUS - Define the radius at which the given value is to be evaluated. - Valid for XFEM-based crack-growth analysis only. - - RSWEEP - Define the minimum and maximum sweep angle from existing crack - direction. Valid for XFEM-based crack-growth analysis only. - """ - command = f"CINT,{action},{par1},{par2},{par3},{par4},{par5},{par6},{par7}" - return self.run(command, **kwargs) - - def cycexpand(self, wn="", option="", value1="", value2="", **kwargs): - """Graphically expands displacements, stresses and strains of a - cyclically symmetric model. - - APDL Command: /CYCEXPAND - - Parameters - ---------- - wn - The window number to which the expansion applies. Valid values are - 1 through 5. The default value is 1. The window number applies - only to the ``AMOUNT`` argument. - - option - One of the following options: - - ON - Activates cyclic expansion using the previous settings (if any). - If no previous settings exist, this option activates the default - settings. This option is default. - - DEFAULT - Resets cyclic expansion to the default settings. - - OFF - Deactivates cyclic expansion. - - STATUS - Lists the current cyclic expansion settings. - - AMOUNT - The number of repetitions or the total angle. - - Value1 - ``NREPEAT`` - - Value2 - The number of repetitions. The default is the total number - of sectors in 360 degrees. - - or - - Value1 - ANGLE - - Value2 - The total angle in degrees. The default is 360. - - WHAT - A specified portion or subset of the model to expand: - - Value1 - The component name of the elements to expand. The default - is all selected components. - - EDGE - Sector edge display key. Possible ``Value1`` settings are: - - -1 - Suppresses display of edges between sectors even if the - cyclic count varies between active windows. This setting is - not valid for cyclic mode-superposition (``MSUP``) harmonic - analyses. - - .. warning:: - Plots with fewer than the maximum number of - repetitions may have missing element faces at the sector - boundaries. - - 0 or OFF - Averages stresses or strains across sector boundaries. This - value is the default (although the default reverts to 1 or - ON if the cyclic count varies between active windows). - - 1 or ON - No averaging of stresses or strains occurs, and sector - boundaries are shown on the plot. This setting is not valid - for cyclic ``MSUP`` harmonic analyses. - - PHASEANG - Possible ``Value1`` settings are: - - n - The phase angle shift in degrees. The valid range for n is 0 - through 360. The default is 0. For a modal solution, this - value is typically the phase angle obtained via the - ``CYCPHASE`` command. The expanded modal results are printed - or displayed for the specified phase angle shift. - - AMPLITUDE (or n ≥ 360) - The amplitude is reported, except for the following - circumstances where the amplitude solution is not valid: - - * non-component results (such as equivalent stress) - * modal analyses (no amplitude is calculated, and the - expanded modal results are printed or displayed at a - phase angle of 360º). - - SWEEP - For a mode-superposition harmonic solution, the maximum - values across a phase angle sweep are reported. - - Notes - ----- - In preprocessing, the ``/CYCEXPAND`` command verifies a cyclically - symmetric model by graphically expanding it partially or through the - full 360 degrees. - - For the postprocessing plot nodal solution (``PLNSOL``) operation, the - command graphically expands displacements, stresses and strains of a - cyclically symmetric model partially or though the full 360 degrees by - combining the real (original nodes and elements) and imaginary - (duplicate nodes and elements) parts of the solution. - - For the print nodal solution (``PRNSOL``) operation, the command expands - the printed output of displacements or stresses on a sector-by-sector - basis. To learn more about specific ``PRNSOL`` behaviors in cyclic - analyses, see Using the ``/CYCEXPAND`` Command in the *Cyclic Symmetry - Analysis Guide*. - - Use of the ``/CYCEXPAND`` command does not change the database. The - command does not modify the geometry, nodal displacements or element - stresses. - - The command affects element and result plots only. It has no effect on - operations other than plot element solution (``PLESOL``), plot nodal - solution (``PLNSOL``), print nodal solution (`PRNSOL`), and calculate - harmonic solution (``CYCCALC``). Operations other than ``PLESOL``, - ``PLNSOL``, ``PRNSOL``, or ``CYCCALC`` work on the unprocessed real and - imaginary parts of a cyclic symmetry solution - - If you issue a ``/CYCEXPAND,,OFF`` command, you cannot then expand the - model by simply issuing another ``/CYCEXPAND`` command (for example, to - specify an ``NREPEAT`` value for the number of repetitions). In such a - case, you must specify ``/CYCEXPAND,,ON``, which activates expansion - using the previous settings (if any) or the default settings. - - The command requires PowerGraphics and will turn PowerGraphics on - (``/GRAPHICS,POWER``) if not already active. Any setting which bypasses - PowerGraphics (for example, ``/PBF``) also bypasses cyclic expansion; in - such cases, the ``/CYCEXPAND`` command displays unprocessed real and - imaginary results. - - The ``CYCPHASE`` command uses full model graphics (``/GRAPHICS,FULL``) - to compute peak values. Because of this, there may be slight differences - between max/min values obtained with ``CYCPHASE``, and those obtained - via ``/CYCEXPAND``, which uses power graphics (``/GRAPHICS,POWER``). - - For ``PHASEANG = AMPLITUDE`` (or 360) with a cyclic full harmonic - solution, the only appropriate coordinate system is the solution - coordinate system (``RSYS,SOLU``). - - Load case operations (``LCOPER``) are not valid during a cyclic - expansion using ``/CYCEXPAND``. - - To learn more about analyzing a cyclically symmetric structure, see the - *Cyclic Symmetry Analysis Guide*. - """ - command = f"/CYCEXPAND, {wn}, {option}, {value1}, {value2}" - return self.run(command, **kwargs) - - def cycfreq( - self, - option="", - value1="", - value2="", - value3="", - value4="", - value5="", - **kwargs, - ): - """Specifies solution options for a cyclic symmetry mode-superposition - - APDL Command: CYCFREQ - harmonic analysis. - - Parameters - ---------- - option - One of the following options: - - AERO - Specify the array containing the aerodynamic damping - coefficients. - - Value1 - The name of the array containing the aerodynamic stiffness - damping coefficients. - - BLADE - Blade information required for a mistuning analysis. - - Value1 - The name of the nodal component containing the blade - boundary nodes at the - blade-to-disk interface. Also include boundary nodes at - any shroud interfaces. - - Value2 - The name of the element component containing the blade - elements. - - Value3 - The number of blade modes to include in the CMS reduction. - - Value4 - The lower bound of the frequency range of interest. This - value is optional. - - Value5 - The upper bound of the frequency range of interest. This - value is optional. - - DEFAULT - Set the default cyclic harmonic solution settings. - - EO - Excitation engine order. - - Value1 - The value of the excitation order, which must be an integer. - The loadings on the other sectors will be related to the - loading on the basic sector based on the engine order phase - shift. - - Value2 - The name of the Mechanical APDL array containing the modal - forces corresponding to the modes kept in the - mode-superpostion analysis. - - MIST - Mistuning parameters. - - Value1 - The type of mistuning: - - K - Stiffness (frequency) mistuning - - Value2 - The name of the array containing the stiffness mistuning - parameters. - - MODAL - Specifies if a damped modal analysis should be performed on the - reduced system. - - Value1 - On/Off key. - - 0 (OFF or NO) - No modal solution. Perform the harmonic solution. - - 1 (ON or YES) - Perform a damped modal analysis of the reduced system in - order to obtain the complex frequencies. The harmonic - solution is not performed. - - Value2 - Number of modes for the damped modal analysis. - - Value3 - The beginning, or lower end, of the frequency range of - interest (in Hz). - - Value4 - The ending, or upper end, of the frequency range of interest - (in Hz). - - RESTART - Defines the point at which to restart the harmonic analysis. - - Value1 - The restart point: - - OFF - No restart (default) - - SWEEP - Restart for a new frequency sweep range (``HARFRQ``) - - MIST - Restart for new mistuning parameters (new mistuning - arrays) - - USER - Causes the program to call for a user-defined solution. - - Value1-5 - Values passed down to the user-defined solution. - - STATUS - List the harmonic solution option settings active for the cyclic - model. - - Notes - ----- - The program solves a cyclically symmetric model (set up via the ``CYCLIC`` - command during preprocessing) at the harmonic indices specified via the - ``CYCOPT`` command. - - The aerodynamic coefficients are specified in a 5x(Nxr) array (``*DIM``), - where N is the number of blades and r can be any positive integer. Each - column has the structure: - - where: - - One aerodynamic damping coefficient must be specified for each ``IBPA`` - (equal to the number of blades) while keeping m and n constant. - - For constant (frequency-independent) mistuning, the stiffness - parameters are specified in an Nx1 array (``*DIM``) where N is the number - of blades. - - For stiffness mistuning, each row entry represents the deviation of - Young's modulus from nominal, (or equivalently, the ratio of the - frequency deviation squared). Each frequency can also be independently - mistuned, in which case the array is NxM, where M is the number of - blade frequencies (Value3 of ``CYCFREQ,BLADE``). The entries in each row - therefore correspond to the ratio of the mistuned frequency to the - tuned frequency squared minus one: - - The ``USER`` option activates the solution macro ``CYCMSUPUSERSOLVE.MAC``. - The normal solution is skipped. You may implement your own mistuning - solution using APDL and APDL Math operations, or call your own program - for the solution. - - The ``CYCFREQ`` command is valid in the preprocessing and solution stages - of an analysis. - - The ``CYCFREQ,MODAL,ON`` command writes modal frequencies to the output - file. No other postprocessing is available for this modal solve. - - When using ``CYCFREQ,RESTART``, only mistuning parameters or frequency - range may be changed. All other changes in parameters are ignored. - - To learn more about analyzing a cyclically symmetric structure, see the - Cyclic Symmetry Analysis Guide. - """ - command = f"CYCFREQ,{option},{value1},{value2},{value3},{value4},{value5}" - return self.run(command, **kwargs) - - def cyclic( - self, - nsector="", - angle="", - kcn="", - name="", - usrcomp="", - usrnmap="", - **kwargs, - ): - """Specifies a cyclic symmetry analysis. - - APDL Command: CYCLIC - - Parameters - ---------- - nsector - The number of sectors in the full 360 degrees, or one of the - following options: - - STATUS - Indicates the current cyclic status. - - OFF - Resets model to normal (non-cyclic) status and removes the - duplicate sector if it exists. This option also deletes - automatically detected edge components (generated when ``USRCOMP = 0``). - - UNDOUBLE - Removes the duplicate sector if it exists. The duplicate sector - is created during the solution (SOLVE) stage of a modal cyclic - symmetry analysis. - - angle - The sector angle in degrees. - - kcn - An arbitrary reference number assigned to the cyclic coordinate - system. The default value of 0 specifies automatic detection. - - name - The root name of sector low- and high-edge components (line, area, - or node components). The default root name (when ``USRCOMP`` = 0) is - "CYCLIC". A root name that you specify can contain up to 11 - characters. - - usrcomp - The number of pairs of user-defined low- and high-edge components - on the cyclic sector (if any). The default value of 0 specifies - automatic detection of sector edges; however, the automatic setting - is not valid in all cases. (For more information, see the Notes - section below.) If the value is greater than 0, no verification of - user-defined components occurs. - - usrnmap - The name of a user-defined array specifying the matching node pairs - between the sector low and high edges. Valid only when ``USRCOMP`` = 0. - Skips the automatic detection of sector edges. Node pairs may be - input in any order, but the low edge node must be the first entry - in each pair. - - Notes - ----- - You can input your own value for ``NSECTOR``, ``ANGLE`` or ``KCN``; if - you do so, the command verifies argument values before executing. - - When ``USRCOMP = 0`` and ``USRNMAP = blank`` (default), the ``CYCLIC`` command - automatically detects low- and high-edge components for models - comprised of any combination of line, area, or volume elements. If a - solid model exists, however, the command uses only the lines, areas, - and/or volumes to determine the low- and high-edge components; the - elements, if any, are ignored. - - Nodes will be automatically rotated unless ``CYCOPT,USERROT,YES`` has been - specified. - - If you issue a ``CYCOPT,TOLER`` command to set a tolerance for edge- - component pairing before issuing the ``CYCLIC`` command, the ``CYCLIC`` command - uses the specified tolerance when performing automatic edge-component - detection. - - For 2-D models, autodetection does not consider the ``CSYS,5`` or ``CSYS,6`` - coordinate system specification. Autodetection for 180 degree (two- - sector) models is not possible unless a central hole exists. - - The ``CYCLIC`` command sets values and keys so that, if possible, the area- - mesh (``AMESH``) or volume-mesh (``VMESH``) command meshes the sector with - matching node and element face patterns on the low and high edges. (The - command has no effect on any other element-creation command.) - - Issue the ``CYCLIC`` command prior to the meshing command to, if possible, - produce a mesh with identical node and element patterns on the low and - high sector edges. Only the ``AMESH`` or ``VMESH`` commands can perform - automated matching. (Other meshing operation commands such as VSWEEP - cannot.) If you employ a meshing operation other than ``AMESH`` or ``VMESH``, - you should ensure that node and element face patterns match, if - desired. The ``CYCLIC`` command output indicates whether each edge- - component pair has or can produce a matching node pair. - - A cyclic solution (via the ``SOLVE`` command) allows dissimilar mesh - patterns on the extreme boundaries of a cyclically symmetric model. The - allowance for dissimilar patterns is useful when you have only finite- - element meshes for your model but not the geometry data necessary to - remesh it to obtain identical node patterns. In such cases, it is - possible to obtain solution results, although perhaps at the expense of - accuracy. A warning message appears because results may be degraded - near the sector edges. - - The constraint equations (CEs) that tie together the low and high edges - of your model are generated at the solution stage of the analysis from - the low- and high-edge components (and nowhere else). You should verify - that automatically detected components are in the correct locations - and that you can account for all components; to do so, you can list - (``CMLIST``) or plot (``CMPLOT``) the components. - - If you issue the ``CYCLIC`` command after meshing and have defined element - types with rotational degrees of freedom (DOFs), ANSYS generates cyclic - CEs for rotational DOFs that may not exist on the sector boundaries. - Issue the ``CYCOPT,DOF`` command to prevent unused rotational terms from - being generated. - - Modal cyclic symmetry analysis is supported by the following - eigensolvers: - - * Block Lanczos (``MODOPT,LANB``) - * PCG Lanczos (``MODOPT,LANPCG``) - * Super Node (``MODOPT,SNODE``) - * Subspace (``MODOPT,SUBSP``) - - To learn more about analyzing a cyclically symmetric structure, see the - Cyclic Symmetry Analysis Guide. - - When using the: ``CYCLIC``: command to automatically detect the sector, if - an area is defined with the: AL: command, the lines need to be oriented - to form the closed curve. - """ - command = f"CYCLIC,{nsector},{angle},{kcn},{name},{usrcomp},{usrnmap}" - return self.run(command, **kwargs) - - def cycopt( - self, - option="", - value1="", - value2="", - value3="", - value4="", - value5="", - value6="", - value7="", - **kwargs, - ): - """Specifies solution options for a cyclic symmetry analysis. - - APDL Command: CYCOPT - - Parameters - ---------- - option - One of the following options: - - BCMULT - Controls whether cyclic sector array parameter names are reused or created new - for multiple entities. - - Value1 - The flag value. - - 0 (OFF or NO) - Create new array parameter names (default) - - 1(ON or YES) - Reuse array parameter names - - COMBINE - For linear static cyclic symmetry analysis with non-cyclically symmetric - loading only, expands and combines all harmonic index - solutions and writes them to the results file during the - solution phase of the analysis. - - Value1 - The flag value. - - 0 (OFF or NO) - Disable combining of harmonic index solutions (default) - - 1 (ON or YES) - Enable combining of harmonic index solutions - - DEFAULT - Set the default cyclic solution settings. - - DOF - The degrees of freedom to couple from the nodes on the low sector boundary to - nodes on the high boundary: - - Value1 - The component pair ID number. - - Value2, Value3, Value4, . . . , Value7 - The constraint-equation/-coupling degree of freedom (DOF) for this pair. Repeat - the command to add other DOFs. The default is - constraint-equation/-coupling all applicable - DOFs. - - FACETOL - Tolerance for inclusion of surface nodes into your basic sector. Autodetect - defaults to 15°, accommodating most sections. Specify a - new Value1 only when extreme cut angles or complex model - geometry cause surface nodes to be excluded. See Notes - (below) for more information. - - ANSYS, Inc. recommends that successful auto-detection depends more on the value of ANGTOL than the value of FACETOL. Please refer to CYCOPT Auto Detection Tolerance Adjustments for Difficult Cases for more information about auto-detection and the CYCOPT command. - Value1 - - The face tolerance applies only to auto detection from node/element models (already meshed and no solid model), and it defaults to 15°. - HINDEX - - The harmonic index solution ranges for modal or buckling cyclic symmetry analyses. The SOLVE command initiates a cyclic symmetry solution sequence at the harmonic indices specified. (By default, the SOLVE command solves for all available harmonic indices.) Static and harmonic cyclic symmetry solutions always use all harmonic indices required for the applied loads. - EVEN / ODD - - For low-frequency electromagnetic analysis only, EVEN specifies a symmetric solution and ODD specifies an antisymmetric solution. - The value you specify is based on the harmonic index: EVEN (default) indicates - harmonic index = 0, and ODD indicates harmonic - index = N / 2 (where N is an integer representing - the number of sectors in 360°). A value of ODD - applies only when N is an even number. - - The CYCOPT command with this HINDEX option is cumulative. To remove an option (for example, EVEN), issue this command: CYCOPT,HINDEX,EVEN,,,-1 - ALL - - Solve all applicable harmonic indices. - Note: Value2 must be blank. - - Value1, Value2, Value3 - Solve harmonic indices in range Value1 through Value2 in steps of Value3. - Repeat the command to add other ranges. The - default solves all applicable harmonic indices. - - Value4 - The only valid value is -1. If specified, it removes Value1 through Value2 in - steps of Value3 from the set to solve. By default, if - Value4 = -1 then Value1 = 0, Value2 = 0, and Value3 = 1. - - Value5 - For static and harmonic analyses, the tolerance for determining if a Fourier - contribution of a load contributes to the response - (default = 1.0E-5). - - If Value5=STATIC, it forces the program to solve only the specified harmonic indices (even if a load may have a Fourier contribution in an index not specified). - LDSECT - - Restricts subsequently defined force loads and surface loads to a specified sector. The restriction remains in effect until you change or reset it. This option is not available for harmonic analyses based on mode-superposition (CYCOPT,MSUP,1) - Value1 - - The sector number. A value other than 0 (default) is valid for a cyclic symmetry analysis with non-cyclically symmetric loading only. A value of 0 (or ALL) resets the default behavior for cyclic loading (where the loads are identical on all sectors). - MOVE - - Specifies if the program should move high- or low-edge component nodes paired within the specified tolerance (TOLER) to create precisely matching pairs. - Value1 - - The flag value. - 0 - - Do not move edge component nodes (default) - 1 or HIGH - - Move the high-edge component nodes to precisely match the low-edge component nodes - -1 or LOW - - Move the low-edge component nodes to precisely match the high-edge component nodes - MSUP - - For modal cyclic symmetry analysis only, this flag is used to limit the results written to the Jobname.MODE and Jobname.RST files in preparation for a subsequent mode-superposition-based analysis. In a linear perturbation modal analysis, this option must be specified in the first load step of the preceding base analysis. - m - """ - command = f"CYCOPT,{option},{value1},{value2},{value3},{value4},{value5},{value6},{value7}" - return self.run(command, **kwargs) - - def emsym(self, nsect="", **kwargs): - """Specifies circular symmetry for electromagnetic sources. - - APDL Command: EMSYM - - Parameters - ---------- - nsect - The number of circular symmetry sections (defaults to 1). - - Notes - ----- - Specifies the number of times to repeat electromagnetic sources for - circular symmetry. Applies to SOURC36 elements and to coupled-field - elements with electric current conduction results in the database. - Sources are assumed to be equally spaced over 360° about the global - Cartesian Z axis. - - This command is also valid in SOLUTION. - """ - command = f"EMSYM,{nsect}" - return self.run(command, **kwargs) - - def mstole(self, method="", namesurf="", namefluid="", **kwargs): - """Adds two extra nodes from FLUID116 elements to SURF151 or SURF152 - - APDL Command: MSTOLE - elements for convection analyses. - - Parameters - ---------- - method - Mapping method: - - 0 - Hybrid method (default). - - 1 - Projection method. - - 2 - Minimum centroid distance method. - - namesurf - Component name for a group of SURF151 or SURF152 elements. The name - must be enclosed in single quotes (e.g., 'COM152') when the MSTOLE - command is manually typed in. - - namefluid - Component name for a group of FLUID116 elements. The name must be - enclosed in single quotes (e.g., 'COM116') when the MSTOLE command - is manually typed in. - - Notes - ----- - For convection analyses, the MSTOLE command adds two extra nodes from - FLUID116 elements to SURF151 or SURF152 elements by employing the - specified mapping method. In the hybrid method, the projection method - is tried first and if it fails the centroid distance method is used. - The SURF151 or SURF152 elements and the FLUID116 elements must be - grouped into components and named using the CM command. - - The SURF151 or SURF152 extra node option must be set for two extra - nodes (KEYOPT(5) = 2). - - For more information, see Using the Surface Effect Elements in the - Thermal Analysis Guide. - """ - command = f"MSTOLE,{method},{namesurf},{namefluid}" - return self.run(command, **kwargs) - - def perbc2d( - self, - loc1="", - loc2="", - loctol="", - r1="", - r2="", - tolr="", - opt="", - plnopt="", - **kwargs, - ): - """Generates periodic constraints for 2-D planar magnetic field analyses. - - APDL Command: PERBC2D - - Parameters - ---------- - loc1 - Constant coordinate location of the first plane of nodes. For - PLNOPT = 1 or 2, the constant coordinate location is the global - Cartesian coordinate system [CSYS,0] location in the X or Y - direction respectively. For PLNOPT = 0, the location is the angle - in the global cylindrical coordinate system [CSYS,1]. - - loc2 - Constant coordinate location of the second plane of nodes. For - PLNOPT = 1 or 2, the constant coordinate location is the global - Cartesian coordinate system [CSYS,0] location in the X or Y - direction respectively. For PLNOPT = 0, the location is the angle - (in degrees) in the global cylindrical coordinate system [CSYS,1]. - - loctol - Tolerance on the constant coordinate location for node selection. - Defaults to .00001 for PLNOPT = 1 or 2 and .001 degrees for PLNOPT - = 0. - - r1 - Minimum coordinate location along the second plane of nodes. For - PLNOPT = 1 or 2, the coordinate location is the global Cartesian - coordinate system location in the Y or X direction respectively. - For PLNOPT = 0, the coordinate location is the radial coordinate - value in the global cylindrical coordinate system. Periodic - conditions are not applied to nodes at this location. - - r2 - Maximum coordinate location along the second plane of nodes. For - PLNOPT = 1 or 2, the coordinate location is the global Cartesian - coordinate system location in the Y or X direction respectively. - For PLNOPT = 0, the coordinate location is the radial coordinate - value in the global cylindrical coordinate system. Periodic - conditions are not applied to nodes at this location. - - tolr - Tolerance dimension on node selection along the plane of nodes. - Defaults to .00001. - - opt - Periodic option: - - 0 - Odd symmetry (default). Apply constraint equations such that AZ(i) = -AZ(j). - - 1 - Even symmetry. Apply node coupling such that AZ(i) = AZ(j). - - plnopt - Symmetry plane option: - - 0 - Planes of constant angle in the global cylindrical coordinate system [CSYS,1]. - - 1 - Planes parallel to the global Cartesian X axis [CSYS,0]. - - 2 - Planes parallel to the global Cartesian Y axis [CSYS,0]. - - Notes - ----- - PERBC2D invokes an ANSYS macro which generates periodic boundary - condition constraints for 2-D planar magnetic field analysis. The - macro is restricted to node pairs sharing common coordinate values - along symmetry planes separated by a constant coordinate value. Planes - (or lines) must lie at either constant angles (PLNOPT = 0), constant X - values (PLNOPT = 1), or constant Y values (PLNOPT = 2). PERBC2D - applies constraint equations (OPT = 0, odd symmetry) or node coupling - (OPT = 1, even symmetry) to each node pair sharing a common coordinate - value along the symmetry planes. By default, periodic conditions are - not applied at the first and last node pairs on the symmetry planes - unless the input location values, R1 and R2, are adjusted to be less - than or greater than the actual node coordinate values. Nodes are - selected for application of the constraints using the NSEL command with - tolerances on the constant coordinate location (LOCTOL) and the - coordinate location along the plane (RTOL). - - Distributed ANSYS Restriction: This command is not supported in - Distributed ANSYS. - """ - command = f"PERBC2D,{loc1},{loc2},{loctol},{r1},{r2},{tolr},{opt},{plnopt}" - return self.run(command, **kwargs) - - def physics(self, option="", title="", fname="", ext="", **kwargs): - """Writes, reads, or lists all element information - - APDL Command: PHYSICS - - Parameters - ---------- - option - Specifies what to do with element information: - - WRITE - Write all appropriate element types, key options, - real constants, material properties, solution - analysis options, load step options, constraint - equations, coupled nodes, defined components, and - GUI preference settings to the file specified with - the Fname and Ext arguments. - - READ - Deletes all solution information (material - properties, solution options, load step options, - constraint equations, coupled nodes, results, and - GUI preference settings) then reads all the - information listed above into the ANSYS database - from the location specified by the Fname and Ext - arguments. - - LIST - Lists currently defined physics files and their titles. - - DELETE - Deletes a specified physics file and its title - from the database. - - CLEAR - Deletes all material properties, solution options, - load step options, constraint equations, coupled - nodes, results, and GUI preference settings from - the database. Does NOT clear the active physics - file title from the database. - - STATUS - Displays information about all active elements - and settings. - - title - A user-defined title that quickly identifies a set of - physics settings. For example, you might use "Fluid," - "Structural," or "Magnetic" as titles. A title can - contain up to 64 characters. It can be entered in lower or - upper case. Lower case is internally converted to upper - case within the program. - - fname - File name and directory path (248 characters maximum, - including the characters needed for the directory path). - An unspecified directory path defaults to the working - directory; in this case, you can use all 248 characters - for the file name. - - ext - Filename extension (eight-character maximum). - - Notes - ----- - Use the PHYSICS command when you are performing a multiphysics - analysis that involves two different disciplines (for example, - magnetic and structural analyses) and you cannot solve both - analyses simultaneously. Once you have set up physics - environments for both analyses, you can use the PHYSICS,READ - command to change between the defined physics environments. - For more information about doing multiphysics analyses, see - Sequential Coupled-Field Analysis in the Coupled-Field - Analysis Guide. - - The PHYSICS command outputs all solution information, - including analysis options, to the Jobname.PHn file described - above. Although it also outputs components, the ANSYS program - does not list entities (nodes, elements, lines, etc.). - - PHYSICS,WRITE will overwrite existing physics files with the - same title (even if the name is different). In other words, if - the directory has a physics file with the same title as the - active physics file title, but a different name, the - PHYSICS,WRITE command will overwrite the existing physics file - and use the existing filename, not the filename specified on - the PHYSICS,WRITE command. - """ - command = f"PHYSICS,{option},{title},{fname},{ext}" - return self.run(command, **kwargs) - - def race(self, xc="", yc="", rad="", tcur="", dy="", dz="", cname="", **kwargs): - """Defines a "racetrack" current source. - - APDL Command: RACE - - Parameters - ---------- - xc - Location of the mid-thickness of the vertical leg along the working - plane X-axis. - - yc - Location of the mid-thickness of the horizontal leg along the - working plane Y-axis. - - rad - Radius of curvature of the mid-thickness of the curves in the - racetrack source. Defaults to .501 * DY - - tcur - Total current, amp-turns (MKS), flowing in the source. - - dy - In-plane thickness of the racetrack source. - - dz - Out-of-plane thickness (depth) of the racetrack source. - - cname - An alphanumeric name assigned as a component name to the group of - SOURC36 elements created by the command macro. Cname must be - enclosed in single quotes in the RACE command line. Cname may be - up to 32 characters, beginning with a letter and containing only - letters, numbers, and underscores. Component names beginning with - an underscore (e.g., _LOOP) are reserved for use by ANSYS and - should be avoided. If blank, no component name is assigned. - - Notes - ----- - RACE invokes an ANSYS macro which defines a "racetrack" current source - in the working plane coordinate system. The current source is - generated from bar and arc source primitives using the SOURC36 element - (which is assigned the next available element type number). The macro - is valid for use in 3-D magnetic field analysis using a scalar - potential formulation. Current flows in a counterclockwise direction - with respect to the working plane. - - The diagram below shows you a racetrack current source. - """ - return self.run(f"RACE,{xc},{yc},{rad},{tcur},{dy},{dz},,,{cname}", **kwargs) - - def sstate( - self, - action="", - cm_name="", - val1="", - val2="", - val3="", - val4="", - val5="", - val6="", - val7="", - val8="", - val9="", - **kwargs, - ): - """Defines a steady-state analysis. - - APDL Command: SSTATE - - Parameters - ---------- - action - Action to perform for defining or manipulating steady-state - analysis data: - - DEFINE - Define steady-state analysis data - - LIST - List current steady-state analysis data - - DELETE - Delete steady-state analysis data - - cm_name - Element component name - - val1, ..., val9 - Input values (based on the Action type) - - Notes - ----- - The SSTATE command specifies steady-state analysis parameters for the - given element component. The program runs the steady-state analysis if - the corresponding element key option is enabled for that element - component. - - The command supports the following elements: - - SOLID185 - - 3-D 8-Node Structural Solid - - SOLID186 - - 3-D 20-Node Structural Solid - - SOLID187 - - 3-D 10-Node Tetrahedral Structural Solid - - SOLSH190 - - 3-D 8-Node Structural Solid Shell - - Degenerated shape (prism) option not supported. - - SOLID285 - - 3-D 4-Node Tetrahedral Structural Solid with Nodal Pressures - - For information about steady-state rolling for rebar and solid - elements, see Steady State Rolling in the Mechanical APDL Theory - Reference. - - The following data types can be defined: - - SPIN -- Steady-state spinning motion - - TRANSLATE -- Rigid body motion (velocity) that the spinning component - is undergoing - - Define the steady-state spinning motion: - - SSTATE, DEFINE, CM_Name, SPIN, OMEGA, Method, Val4, Val5, Val6, Val7, - Val8, Val9 - - Spin velocity - - Method to use for defining the spin axis: - - Define the spin axis using two points: - - Val4, Val5, Val6 -- Coordinates of the first point - - Val7, Val8, Val9 -- Coordinates of the second point - - This definition method is currently the only option. - - This command defines a steady state spinning motion of 120 rad/s around - the spin axis: - - In this case, two points with coordinates (0,0,0) and (0,1,0) define - the spin axis in the global Y direction. - - Define the rigid body motion (velocity): - - SSTATE, DEFINE, CM_Name, TRANSLATE, Val2, Val3, Val4 - - SSTATE, LIST, CM_Name - - Lists all steady-state analysis data defined on the specified element - component. All data is listed if no component (CM_Name) is specified. - - SSTATE, DELETE, CM_Name - - Deletes all steady-state analysis data defined on the specified element - component. All data is deleted if no component (CM_Name) is specified. - """ - command = f"SSTATE,{action},{cm_name},{val1},{val2},{val3},{val4},{val5},{val6},{val7},{val8},{val9}" - return self.run(command, **kwargs) - - def xfdata( - self, enrichmentid="", lsm="", elemnum="", nodenum="", phi="", psi="", **kwargs - ): - """Defines a crack in the model by specifying nodal level set values - - APDL Command: XFDATA - - Parameters - ---------- - enrichmentid - Name of the enrichment specified via the associated XFENRICH - command. - - lsm (or blank) - Specify LSM to indicate that level set values (PHI and optional - PSI) are specified. - - elemnum - Element number. - - nodenum - Node number associated with the specified element ELNUM. - - phi - Signed normal distance of the node from the crack. - - psi - Signed normal distance of the node from the crack tip (or crack front). - Used only in the singularity- based XFEM method. - - Notes - ----- - Issue the XFDATA command multiple times as needed to specify nodal - level set values for all nodes of an element. - - This command is valid in PREP7 (/PREP7) only. - """ - command = f"XFDATA,{enrichmentid},{lsm},{elemnum},{nodenum},{phi},{psi}" - return self.run(command, **kwargs) - - def xfenrich( - self, - enrichmentid="", - compname="", - matid="", - method="", - radius="", - snaptoler="", - **kwargs, - ): - """Defines parameters associated with crack propagation using XFEM - - APDL Command: XFENRICH - - Parameters - ---------- - enrichmentid - An alphanumeric name assigned to identify the enrichment. The name - can contain up to 32 characters and must begin with an alphabetic - character. Alphabetic characters, numbers, and underscores are - valid. - - compname - Name of the element set component for which initial cracks are - defined and possibly propagated. - - matid - Material ID number referring to cohesive zone material behavior on - the initial crack. If 0 or not specified, the initial crack is - assumed to be free of cohesive zone behavior. - - method - PHAN -- Use phantom-node-based XFEM (default). - SING -- Use singularity-based XFEM. - - radius - Radius defining the region around the crack tip encompassing the - set of elements to be influenced by the crack-tip singularity effects. - Default = 0.0. Used only in singularity-based XFEM. - - snaptoler - Snap tolerance to snap the crack tip to the closest crack face along - the extension direction. Default = 1.0E-6. Used only in singularity-based XFEM. - - Notes - ----- - If MatID is specified, the cohesive zone behavior is described by the - bilinear cohesive law. - - This command is valid in PREP7 (/PREP7) only. - """ - command = f"XFENRICH,{enrichmentid},{compname},{matid}, {method}, {radius}, {snaptoler}" - return self.run(command, **kwargs) - - def xflist(self, enrichmentid="", **kwargs): - """Lists enrichment details and associated crack information - - APDL Command: XFLIST - - Parameters - ---------- - enrichmentid or (blank) - Name of the enrichment specified via the associated XFENRICH - command. Specifying EnrichmentID is optional. - - Notes - ----- - This command is valid in PREP7 (/PREP7) and SOLUTION (/SOLU). - """ - command = f"XFLIST,{enrichmentid}" - return self.run(command, **kwargs) diff --git a/src/ansys/mapdl/core/_commands/preproc/status.py b/src/ansys/mapdl/core/_commands/preproc/status.py deleted file mode 100644 index 010139d8f3f..00000000000 --- a/src/ansys/mapdl/core/_commands/preproc/status.py +++ /dev/null @@ -1,443 +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 - - -class Status: - def areas(self, **kwargs): - """Specifies "Areas" as the subsequent status topic. - - APDL Command: AREAS - - 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"AREAS," - return self.run(command, **kwargs) - - def bool(self, **kwargs): - """Specifies "Booleans" as the subsequent status topic. - - APDL Command: BOOL - - 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"BOOL," - return self.run(command, **kwargs) - - def ceqn(self, **kwargs): - """Specifies "Constraint equations" as the subsequent status topic. - - APDL Command: CEQN - - 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"CEQN," - return self.run(command, **kwargs) - - def couple(self, **kwargs): - """Specifies "Node coupling" as the subsequent status topic. - - APDL Command: COUPLE - - 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"COUPLE," - return self.run(command, **kwargs) - - def digit(self, **kwargs): - """Specifies "Node digitizing" as the subsequent status topic. - - APDL Command: DIGIT - - 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"DIGIT," - return self.run(command, **kwargs) - - def elem(self, **kwargs) -> Optional[str]: - """Specifies "Elements" as the subsequent status topic. - - APDL Command: ELEM - - Notes - ----- - - The STAT command should immediately follow this command, - which should report the status for the specified topic. - """ - command = f"ELEM," - return self.run(command, **kwargs) - - def etype(self, **kwargs) -> Optional[str]: - """Specify "Element types" as the subsequent status topic. - - APDL Command: ETYPE - - This is a status [STAT] topic command. - The STAT command should immediately follow this command, - which should report the status for the specified topic. - - Examples - -------- - >>> mapdl.et(1, 'SOLID186') - >>> mapdl.etype() - >>> mapdl.stat() - ELEMENT TYPE 1 IS SOLID186 3-D 20-NODE STRUCTURAL SOLID - KEYOPT( 1- 6)= 0 0 0 0 0 0 - KEYOPT( 7-12)= 0 0 0 0 0 0 - KEYOPT(13-18)= 0 0 0 0 0 0 - """ - return self.run("ETYPE", **kwargs) - - def febody(self, **kwargs): - """Specifies "Body loads on elements" as the subsequent status topic. - - APDL Command: FEBODY - - 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"FEBODY," - return self.run(command, **kwargs) - - def fecons(self, **kwargs): - """Specifies "Constraints on nodes" as the subsequent status topic. - - APDL Command: FECONS - - 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"FECONS," - return self.run(command, **kwargs) - - def fefor(self, **kwargs): - """Specifies "Forces on nodes" as the subsequent status topic. - - APDL Command: FEFOR - - 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"FEFOR," - return self.run(command, **kwargs) - - def fesurf(self, **kwargs): - """Specifies "Surface loads on elements" as the subsequent status topic. - - APDL Command: FESURF - - 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"FESURF," - return self.run(command, **kwargs) - - def geometry(self, **kwargs): - """Specifies "Geometry" as the subsequent status topic. - - APDL Command: GEOMETRY - - 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"GEOMETRY," - return self.run(command, **kwargs) - - def keypts(self, **kwargs): - """Specifies "Keypoints" as the subsequent status topic. - - APDL Command: KEYPTS - - 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"KEYPTS," - return self.run(command, **kwargs) - - def line(self, **kwargs): - """Specifies "Lines" as the subsequent status topic. - - APDL Command: LINE - - 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"LINE," - return self.run(command, **kwargs) - - def mater(self, **kwargs): - """Specifies "Material properties" as the subsequent status topic. - - APDL Command: MATER - - 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"MATER," - return self.run(command, **kwargs) - - def meshing(self, **kwargs): - """Specifies "Meshing" as the subsequent status topic. - - APDL Command: MESHING - - 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"MESHING," - return self.run(command, **kwargs) - - def nodes(self, **kwargs): - """Specifies "Nodes" as the subsequent status topic. - - APDL Command: NODES - - 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"NODES," - return self.run(command, **kwargs) - - def prim(self, **kwargs): - """Specifies "Solid model primitives" as the subsequent status topic. - - APDL Command: PRIM - - 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"PRIM," - return self.run(command, **kwargs) - - def rcon(self, **kwargs): - """Specifies "Real constants" as the subsequent status topic. - - APDL Command: RCON - - 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"RCON," - return self.run(command, **kwargs) - - def selm(self, **kwargs): - """Specifies "Superelements" as the subsequent status topic. - - APDL Command: SELM - - 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. - - Distributed ANSYS Restriction: This command is not supported in - Distributed ANSYS. - """ - return self.run("SELM,", **kwargs) - - def tble(self, **kwargs): - """Specifies "Data table properties" as the subsequent status topic. - - APDL Command: TBLE - - 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"TBLE," - return self.run(command, **kwargs) - - def volumes(self, **kwargs): - """Specifies "Volumes" as the subsequent status topic. - - APDL Command: VOLUMES - - Notes - ----- - This is a status [STAT] topic command. Status topic commands are - generated by the GUI and appear in the log file (Jobname.LOG) if status - is requested for some items by choosing 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"VOLUMES," - return self.run(command, **kwargs) diff --git a/src/ansys/mapdl/core/_commands/preproc/superelements.py b/src/ansys/mapdl/core/_commands/preproc/superelements.py deleted file mode 100644 index 9a329e729d9..00000000000 --- a/src/ansys/mapdl/core/_commands/preproc/superelements.py +++ /dev/null @@ -1,286 +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 Superelements: - def se(self, file="", toler="", **kwargs): - """Defines a superelement. - - APDL Command: SE - - Parameters - ---------- - file - The name (case sensitive) of the file containing the - original superelement matrix created by the generation - pass (Sename.SUB). The default is the current Jobname. - - toler - Tolerance used to determine if use pass nodes are - noncoincident with master nodes having the same node - numbers. Defaults to 0.0001. Use pass nodes will always - be replaced by master nodes of the same node number. - However, if a use pass node is more than TOLER away from - the corresponding master node, a warning is generated. - - Notes - ----- - Defines a superelement by reading in the superelement matrices - and master nodes from the superelement matrix file. The - matrix file (File.SUB) must be available from the substructure - generation pass. The proper element type (MATRIX50) must be - active [TYPE] for this command. A scratch file called - File.SORD showing the superelement names and their - corresponding element numbers is also written. - """ - return self.run(f"SE,{file},,,{toler}", **kwargs) - - def sedlist(self, sename="", kopt="", **kwargs): - """Lists the DOF solution of a superelement after the use pass. - - APDL Command: SEDLIST - - Parameters - ---------- - sename - Name of the superelement in Jobname.DSUB to be listed. If a - number, it is the element number of the superelement as used in the - use pass. If ALL, list results for all superelements. - - kopt - List key: - - 0 - List summary data only. - - 1 - List full contents. Be aware that the listing may be extensive. - - Notes - ----- - Lists the degree of freedom solution of a superelement after the - substructure use pass. Results may be listed for any superelement on - File.DSUB. - - This command is valid in any processor. - - Distributed ANSYS Restriction: This command is not supported in - Distributed ANSYS. - """ - command = f"SEDLIST,{sename},{kopt}" - return self.run(command, **kwargs) - - def selist(self, sename="", kopt="", kint="", **kwargs): - """Lists the contents of a superelement matrix file. - - APDL Command: SELIST - - Parameters - ---------- - sename - The name (case-sensitive) of the superelement matrix file created - by the substructure generation pass (Sename.SUB). Defaults to the - current Jobname. If a number, it is the element number of the - superelement as used in the use pass. - - kopt - List key: - - 0 - List summary data only. - - 1 - List contents, except load vectors and matrices. - - 2 - List contents, except matrices. - - 3 - List full contents. Be aware that the listing may be extensive. - - kint - Integer printout format key: - - OFF - Default. - - ON - Long format for large integers. - - Notes - ----- - This command is valid in any processor. - - Distributed ANSYS Restriction: This command is not supported in - Distributed ANSYS. - """ - command = f"SELIST,{sename},{kopt},{kint}" - return self.run(command, **kwargs) - - def sesymm(self, sename="", ncomp="", inc="", file="", ext="", **kwargs): - """Performs a symmetry operation on a superelement within the use pass. - - APDL Command: SESYMM - - Parameters - ---------- - sename - The name (case-sensitive) of the superelement matrix file - created by the substructure generation pass (Sename.SUB). - Defaults to the current Jobname. If a number, it is the - element number of a previously defined superelement in the - current use pass. - - ncomp - Symmetry key: - - X - X symmetry (default). - - Y - Y symmetry. - - Z - Z symmetry. - - inc - Increment all nodes in the superelement by INC. - - file - File name and directory path (248 characters maximum, - including the characters needed for the directory path). - An unspecified directory path defaults to the working - directory; in this case, you can use all 248 characters - for the file name. - - ext - Filename extension (eight-character maximum). - - Notes - ----- - Performs a symmetry operation on a superelement within the - substructure use pass by reversing the sign of component Ncomp - in the global Cartesian coordinate system. The node numbers - are incremented by INC. The new superelement is written to - File.SUB in the current directory (by default). All master - node nodal coordinate systems must be global Cartesian (no - rotated nodes allowed). - - The maximum number of transformations for a given superelement - is five (including SETRAN, SESYMM, and the large rotation - transformation if NLGEOM is ON in the use pass). - - Distributed ANSYS Restriction: This command is not supported - in Distributed ANSYS. - """ - command = f"SESYMM,{sename},{ncomp},{inc},{file},{ext}" - return self.run(command, **kwargs) - - def setran( - self, - sename="", - kcnto="", - inc="", - file="", - ext="", - dx="", - dy="", - dz="", - norot="", - **kwargs, - ): - """Creates a superelement from an existing superelement. - - APDL Command: SETRAN - - Parameters - ---------- - sename - The name (case-sensitive) of the file containing the original - superelement matrix created by the generation pass (Sename.SUB). - The default is the current Jobname. If Sename is a number, it is - the element number of a previously defined superelement in the - current use pass. - - kcnto - The reference number of the coordinate system to where the - superelement is to be transferred. The default is the global - Cartesian system. Transfer occurs from the active coordinate - system. - - inc - The node offset. The default is zero. All new element node - numbers are offset from those on the original by INC. - - file - File name and directory path (248 characters maximum, including the - characters needed for the directory path). An unspecified - directory path defaults to the working directory; in this case, you - can use all 248 characters for the file name. - - ext - Filename extension (eight-character maximum). - - dx, dy, dz - Node location increments in the global Cartesian coordinate system. - Defaults to zero. - - norot - Node rotation key: - - 0 - The nodal coordinate systems of the transferred superelement rotate into the - KCNTO system. (That is, the nodal coordinate systems rotate - with the superelement.) The superelement matrices remain - unchanged. This value is the default. - - 1 - The nodal coordinate systems do not rotate. (That is, they remain fixed in - their original global orientation.) The superelement matrices - and load vectors are modified if any rotations occur. - - Notes - ----- - The SETRAN command creates a superelement from an existing superelement - and writes the new element to a file. You can then issue an SE command - to read the new element (during the use pass). - - You can create a superelement from an original by: - - Transferring the original's geometry from the active coordinate system - into another coordinate system (KCNTO) - - Offsetting its geometry in the global Cartesian coordinate system (DX, - DY, and DZ ) - - Offsetting its node numbers (INC). - - A combination of methods is valid. If you specify both the geometry - transfer and the geometry offset, the transfer occurs first. - - If you specify rotation of the transferred superelement's nodal - coordinate systems into the KCNTO system (NOROT = 0), the rotated nodes - cannot be coupled via the CP command; in this case, issue the CE - command instead. If you specify no rotation of the nodal coordinate - systems (NOROT = 1) for models with displacement degrees of freedom, - and KCNTO is not the active system, the superelement Sename must have - six MDOF at each node that has MDOF; therefore, only elements with all - six structural DOFs are valid in such cases. - - There is no limit to the number of copies that can be made of a - superelement, provided the copies are all generated from the same - original superelement. However, nested copies are limited to five. In - other words, the total number of different Sename usages on the SETRAN - and SESYMM commands is limited to five. - - Distributed ANSYS Restriction: This command is not supported in - Distributed ANSYS. - """ - command = f"SETRAN,{sename},{kcnto},{inc},{file},{ext},,{dx},{dy},{dz},{norot}" - return self.run(command, **kwargs) diff --git a/src/ansys/mapdl/core/_commands/preproc/volumes.py b/src/ansys/mapdl/core/_commands/preproc/volumes.py deleted file mode 100644 index fadf81ce7c3..00000000000 --- a/src/ansys/mapdl/core/_commands/preproc/volumes.py +++ /dev/null @@ -1,1160 +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, Union - -from ansys.mapdl.core._commands import parse -from ansys.mapdl.core.mapdl_types import MapdlInt - - -class Volumes: - def extopt( - self, - lab: str = "", - val1: Union[str, int] = "", - val2: Union[str, int] = "", - val3: MapdlInt = "", - val4: MapdlInt = "", - **kwargs, - ) -> Optional[str]: - """Controls options relating to the generation of volume elements from area elements. - - APDL Command: EXTOPT - - Parameters - ---------- - lab - Label identifying the control option. The meanings of - Val1, Val2, and Val3 will vary depending on Lab. - - ON - Sets carryover of the material attributes, real - constant attributes, and element coordinate system - attributes of the pattern area elements to the - generated volume elements. Sets the pattern - area mesh to clear when volume generations are done. - Val1, Val2, and Val3 are ignored. - - OFF - Removes all settings associated with this command. - Val1, Val2, and Val3 are ignored. - - STAT - Shows all settings associated with this command. - Val1, Val2, Val3, and Val4 are ignored. - - ATTR - Sets carryover of particular pattern area attributes - (materials, real constants, and element coordinate - systems) of the pattern area elements to the - generated volume elements. (See 2.) Val1 can be: - - 0 - Sets volume elements to use - current MAT command settings. - - 1 - Sets volume elements to use material - attributes of the pattern area elements. - - Val2 can be: - - 0 - Sets volume elements to use current REAL - command settings. - - 1 - Sets volume elements to use real constant attributes - of the pattern area elements. - - Val3 can be: - - 0 - Sets volume elements to use current ESYS command - settings. - - 1 - Sets volume elements to use element coordinate - system attributes of the pattern area elements. - - Val4 can be: - - 0 - Sets volume elements to use current SECNUM command - settings. - - 1 - Sets volume elements to use section attributes of - the pattern area elements. - - ESIZE - Val1 sets the number of element divisions in the - direction of volume generation or volume sweep. - For VDRAG and VSWEEP, Val1 is overridden by the - LESIZE command NDIV setting. Val2 sets the spacing - ratio (bias) in the direction of volume generation - or volume sweep. If positive, Val2 is the nominal - ratio of last division size to first division size - (if > 1.0, sizes increase, if < 1.0, sizes - decrease). If negative, Val2 is the nominal ratio of - center division(s) size to end divisions size. Ratio - defaults to 1.0 (uniform spacing). - Val3 and Val4 are ignored. - - ACLEAR - Sets clearing of pattern area mesh. - (See 3.) Val1 can be: - - 0 - Sets pattern area to remain meshed when volume - generation is done. - - 1 - Sets pattern area mesh to clear when volume - generation is done. Val2, Val3, and Val4 are - ignored. - - VSWE - Indicates that volume sweeping options will be set - using Val1 and Val2. Settings specified with EXTOPT, - VSWE will be used the next time the VSWEEP command - is invoked. If Lab = VSWE, Val1 becomes a label. - Val1 can be: - - AUTO - Indicates whether you will be prompted for the source - and target used by VSWEEP or if VSWE should - automatically determine the source and target. - If Val1 = AUTO, Val2 is ON by default. VSWE will - automatically determine the source and target for - VSWEEP. You will be allowed to pick more than one - volume for sweeping. When Val2 = OFF, the user will - be prompted for the source and target for VSWEEP. - You will only be allowed to pick one volume for - sweeping. - - TETS - Indicates whether VSWEEP will tet mesh non-sweepable - volumes or leave them unmeshed. If Val1 = TETS, - Val2 is OFF by default. Non-sweepable volumes will be - left unmeshed. When Val2 = ON, the non-sweepable - volumes will be tet meshed if the assigned element - type supports tet shaped elements. - - val1, val2, val3, val4 - Additional input values as described under each option for - Lab. - - Notes - ----- - EXTOPT controls options relating to the generation of volume - elements from pattern area elements using the VEXT, VROTAT, - VOFFST, VDRAG, and VSWEEP commands. (When using VSWEEP, - the pattern area is referred to as the source area.) - - Enables carryover of the attributes of the pattern area - elements to the generated volume elements when you are using - VEXT, VROTAT, VOFFST, or VDRAG. (When using VSWEEP, since the - volume already exists, use the VATT command to assign attributes - before sweeping.) - - When you are using VEXT, VROTAT, VOFFST, or VDRAG, enables - clearing of the pattern area mesh when volume generations are - done. (When you are using VSWEEP, if selected, the area meshes - on the pattern (source), target, and/or side areas clear when - volume sweeping is done.) - - Neither EXTOPT,VSWE,AUTO nor EXTOPT,VSWE,TETS will be affected - by EXTOPT,ON or EXTOPT, OFF. - """ - command = f"EXTOPT,{lab},{val1},{val2},{val3},{val4}" - return self.run(command, **kwargs) - - def v( - self, p1="", p2="", p3="", p4="", p5="", p6="", p7="", p8="", **kwargs - ) -> int: - """Define a volume through keypoints. - - APDL Command: V - - Parameters - ---------- - p1 : int, optional - Keypoint defining starting corner of volume. - - p2 : int, optional - Keypoint defining second corner of volume. - - p3 : int, optional - Keypoint defining third corner of volume. - - p4 : int, optional - Keypoint defining fourth corner of volume. - - p5 : int, optional - Keypoint defining fifth corner of volume. - - p6 : int, optional - Keypoint defining sixth corner of volume. - - p7 : int, optional - Keypoint defining seventh corner of volume. - - p8 : int, optional - Keypoint defining eighth corner of volume. - - Returns - ------- - int - Volume number of the generated volume. - - Notes - ----- - Defines a volume (and its corresponding lines and areas) - through eight (or fewer) existing keypoints. Keypoints must - be input in a continuous order. The order of the keypoints - should be around the bottom and then the top. Missing lines - are generated "straight" in the active coordinate system and - assigned the lowest available numbers [NUMSTR]. Missing areas - are generated and assigned the lowest available numbers. - - Solid modeling in a toroidal coordinate system is not recommended. - - Certain faces may be condensed to a line or point by repeating - keypoints. For example, use V,P1,P2,P3,P3,P5,P6,P7,P7 for a - triangular prism or V,P1,P2,P3,P3,P5,P5,P5,P5 for a tetrahedron. - - Using keypoints to produce partial sections in CSYS = 2 can generate - anomalies; check the resulting volumes carefully. - - Examples - -------- - Create a simple cube volume. - - >>> k0 = mapdl.k("", 0, 0, 0) - >>> k1 = mapdl.k("", 1, 0, 0) - >>> k2 = mapdl.k("", 1, 1, 0) - >>> k3 = mapdl.k("", 0, 1, 0) - >>> k4 = mapdl.k("", 0, 0, 1) - >>> k5 = mapdl.k("", 1, 0, 1) - >>> k6 = mapdl.k("", 1, 1, 1) - >>> k7 = mapdl.k("", 0, 1, 1) - >>> v0 = mapdl.v(k0, k1, k2, k3, k4, k5, k6, k7) - >>> v0 - 1 - - Create a triangular prism - - >>> k0 = mapdl.k("", 0, 0, 0) - >>> k1 = mapdl.k("", 1, 0, 0) - >>> k2 = mapdl.k("", 1, 1, 0) - >>> k3 = mapdl.k("", 0, 1, 0) - >>> k4 = mapdl.k("", 0, 0, 1) - >>> k5 = mapdl.k("", 1, 0, 1) - >>> k6 = mapdl.k("", 1, 1, 1) - >>> k7 = mapdl.k("", 0, 1, 1) - >>> v1 = mapdl.v(k0, k1, k2, k2, k4, k5, k6, k6) - >>> v1 - 2 - - Create a tetrahedron - - >>> k0 = mapdl.k("", 0, 0, 0) - >>> k1 = mapdl.k("", 1, 0, 0) - >>> k2 = mapdl.k("", 1, 1, 0) - >>> k3 = mapdl.k("", 0, 0, 1) - >>> v2 = mapdl.v(k0, k1, k2, k2, k3, k3, k3, k3) - >>> v2 - 3 - """ - command = f"V,{p1},{p2},{p3},{p4},{p5},{p6},{p7},{p8}" - return parse.parse_v(self.run(command, **kwargs)) - - def va( - self, - a1="", - a2="", - a3="", - a4="", - a5="", - a6="", - a7="", - a8="", - a9="", - a10="", - **kwargs, - ) -> int: - """Generate a volume bounded by existing areas. - - APDL Command: VA - - Parameters - ---------- - a1, a2, a3, . . . , a10 - List of areas defining volume. The minimum number of - areas is 4. If A1 = ALL, use all selected [ASEL] areas - and ignore A2 to A10. A component name may also be - substituted for A1. - - Returns - ------- - int - Volume number of the volume. - - Notes - ----- - This command conveniently allows generating volumes from - regions having more than eight keypoints (which is not allowed - with the V command). Areas may be input in any order. The - exterior surface of a VA volume must be continuous, but holes - may pass completely through it. - - Examples - -------- - Create a simple tetrahedral bounded by 4 areas. - - >>> k0 = mapdl.k('', -1, 0, 0) - >>> k1 = mapdl.k('', 1, 0, 0) - >>> k2 = mapdl.k('', 1, 1, 0) - >>> k3 = mapdl.k('', 1, 0.5, 1) - >>> a0 = mapdl.a(k0, k1, k2) - >>> a1 = mapdl.a(k0, k1, k3) - >>> a2 = mapdl.a(k1, k2, k3) - >>> a3 = mapdl.a(k0, k2, k3) - >>> vnum = mapdl.va(a0, a1, a2, a3) - >>> vnum - 1 - """ - command = f"VA,{a1},{a2},{a3},{a4},{a5},{a6},{a7},{a8},{a9},{a10}" - return parse.parse_v(self.run(command, **kwargs)) - - def vdele(self, nv1="", nv2="", ninc="", kswp="", **kwargs): - """Deletes unmeshed volumes. - - APDL Command: VDELE - - Parameters - ---------- - nv1, nv2, ninc - Delete volumes from NV1 to NV2 (defaults to NV1) in steps of NINC - (defaults to 1). If NV1 = ALL, NV2 and NINC are ignored and all - selected volumes [VSEL] are deleted. If NV1 = P, graphical picking - is enabled and all remaining command fields are ignored (valid only - in the GUI). A component name may also be substituted for NV1 (NV2 - and NINC are ignored). - - kswp - Specifies whether keypoints, lines, and areas are also deleted: - - 0 - Delete volumes only (default). - - 1 - Delete volumes, as well as keypoints, lines, and areas attached to the - specified volumes but not shared by other volumes. - """ - command = f"VDELE,{nv1},{nv2},{ninc},{kswp}" - return self.run(command, **kwargs) - - def vdgl(self, nv1="", nv2="", ninc="", **kwargs): - """Lists keypoints of a volume that lie on a parametric degeneracy. - - APDL Command: VDGL - - Parameters - ---------- - nv1, nv2, ninc - List keypoints that lie on a parametric degeneracy on volumes from - NV1 to NV2 (defaults to NV1) in steps of NINC (defaults to 1). If - NV1 = ALL (default), NV2 and NINC will be ignored and keypoints on - all selected volumes [VSEL] will be listed. If NV1 = P, graphical - picking is enabled and all remaining command fields are ignored - (valid only in the GUI). You may also substitute a component name - for NV1 (ignore NV2 and NINC). - - Notes - ----- - See the Modeling and Meshing Guide for details about parametric - degeneracies. - - This command is valid in any processor. - """ - command = f"VDGL,{nv1},{nv2},{ninc}" - return self.run(command, **kwargs) - - def vdrag( - self, - na1="", - na2="", - na3="", - na4="", - na5="", - na6="", - nlp1="", - nlp2="", - nlp3="", - nlp4="", - nlp5="", - nlp6="", - **kwargs, - ) -> str: - """Generate volumes by dragging an area pattern along a path. - - APDL Command: VDRAG - - Parameters - ---------- - na1, na2, na3, . . . , na6 - List of areas in the pattern to be dragged (6 maximum if - using keyboard entry). If NA1 = ALL, all selected areas - will be swept along the path. A component name may also - be substituted for NA1. - - nlp1, nlp2, nlp3, . . . , nlp6 - List of lines defining the path along which the pattern is - to be dragged (6 maximum if using keyboard entry). Must - be a continuous set of lines. To be continuous, adjacent - lines must share the connecting keypoint (the end keypoint - of one line must also be first keypoint of the next line). - - Returns - ------- - str - MAPDL command output. - - Notes - ----- - Generates volumes (and their corresponding keypoints, lines, - and areas) by sweeping a given area pattern along a - characteristic drag path. If the drag path consists of - multiple lines, the drag direction is determined by the - sequence in which the path lines are input (NLP1, NLP2, etc.). - If the drag path is a single line (NLP1), the drag direction - is from the keypoint on the drag line that is closest to the - first keypoint of the given area pattern to the other end of - the drag line. - - The magnitude of the vector between the keypoints of the given - pattern and the first path keypoint remains constant for all - generated keypoint patterns and the path keypoints. The - direction of the vector relative to the path slope also - remains constant so that patterns may be swept around curves. - Lines are generated with the same shapes as the given pattern - and the path lines. - - Keypoint, line, area, and volume numbers are automatically - assigned (beginning with the lowest available values - [NUMSTR]). Adjacent lines use a common keypoint, adjacent - areas use a common line, and adjacent volumes use a common - area. For best results, the entities to be dragged should be - orthogonal to the start of the drag path. Drag operations - that produce an error message may create some of the desired - entities prior to terminating. - - If element attributes have been associated with the input area - via the AATT command, the opposite area generated by the VDRAG - operation will also have those attributes (i.e., the element - attributes from the input area are copied to the opposite - area). Note that only the area opposite the input area will - have the same attributes as the input area; the areas adjacent - to the input area will not. - - If the input areas are meshed or belong to a meshed volume, - the area(s) can be extruded to a 3-D mesh. Note that the NDIV - argument of the ESIZE command should be set before extruding - the meshed areas. Alternatively, mesh divisions can be - specified directly on the drag line(s) (LESIZE). See the - Modeling and Meshing Guide for more information. - - You can use the VDRAG command to generate 3-D interface - element meshes for elements INTER194 and INTER195. When - generating interface element meshes using VDRAG, you must - specify the line divisions to generate one interface element - directly on the drag line using the LESIZE command. The - source area to be extruded becomes the bottom surface of the - interface element. Interface elements must be extruded in what - will become the element's local x direction, that is, bottom - to top. - - Examples - -------- - Create a square with a hole in it and drag it along an arc. - - >>> anum0 = mapdl.blc4(0, 0, 1, 1) - >>> anum1 = mapdl.blc4(0.25, 0.25, 0.5, 0.5) - >>> aout = mapdl.asba(anum0, anum1) - >>> k0 = mapdl.k("", 0, 0, 0) - >>> k1 = mapdl.k("", 1, 0, 1) - >>> k2 = mapdl.k("", 1, 0, 0) - >>> l0 = mapdl.larc(k0, k1, k2, 2) - >>> output = mapdl.vdrag(aout, nlp1=l0) - >>> print(output) - DRAG AREAS - 3, - ALONG LINES - 9 - """ - command = f"VDRAG,{na1},{na2},{na3},{na4},{na5},{na6},{nlp1},{nlp2},{nlp3},{nlp4},{nlp5},{nlp6}" - return self.run(command, **kwargs) - - def vext( - self, - na1="", - na2="", - ninc="", - dx="", - dy="", - dz="", - rx="", - ry="", - rz="", - **kwargs, - ) -> str: - """Generate additional volumes by extruding areas. - - APDL Command: VEXT - - Parameters - ---------- - na1, na2, ninc - Set of areas (NA1 to NA2 in steps of NINC) that defines - the pattern to be extruded. NA2 defaults to NA1, NINC - defaults to 1. If NA1 = ALL, NA2 and NINC are ignored and - the pattern is defined by all selected areas. A component - name may also be substituted for NA1 (NA2 and NINC are - ignored). - - dx, dy, dz - Increments to be applied to the X, Y, and Z keypoint - coordinates in the active coordinate system (DR, Dθ, DZ - for cylindrical; DR, Dθ, DΦ for spherical). - - rx, ry, rz - Scale factors to be applied to the X, Y, and Z keypoint - coordinates in the active coordinate system (RR, Rθ, RZ - for cylindrical; RR, Rθ, RΦ for spherical). Note that the - Rθ and RΦ scale factors are interpreted as angular - offsets. For example, if CSYS = 1, RX, RY, RZ input of - (1.5,10,3) would scale the specified keypoints 1.5 times - in the radial and 3 times in the Z direction, while adding - an offset of 10 degrees to the keypoints. Zero, blank, or - negative scale factor values are assumed to be 1.0. Zero - or blank angular offsets have no effect. - - Returns - ------- - str - MAPDL command output. - - Examples - -------- - Create a basic cylinder by extruding a circle. - - >>> k0 = mapdl.k("", 0, 0, 0) - >>> k1 = mapdl.k("", 0, 0, 1) - >>> k2 = mapdl.k("", 0, 0, 0.5) - >>> carc0 = mapdl.circle(k0, 1, k1) - >>> a0 = mapdl.al(*carc0) - >>> mapdl.vext(a0, dz=4) - - Create a tapered cylinder. - - >>> mapdl.vdele('all') - >>> mapdl.vext(a0, dz=4, rx=0.3, ry=0.3, rz=1) - """ - command = f"VEXT,{na1},{na2},{ninc},{dx},{dy},{dz},{rx},{ry},{rz}" - return self.run(command, **kwargs) - - def vgen( - self, - itime="", - nv1="", - nv2="", - ninc="", - dx="", - dy="", - dz="", - kinc="", - noelem="", - imove="", - **kwargs, - ): - """Generates additional volumes from a pattern of volumes. - - APDL Command: VGEN - - Generates additional volumes (and their corresponding - keypoints, lines, and areas) by extruding and scaling a - pattern of areas in the active coordinate system. - - If element attributes have been associated with the input area - via the AATT command, the opposite area generated by the VEXT - operation will also have those attributes (i.e., the element - attributes from the input area are copied to the opposite - area). Note that only the area opposite the input area will - have the same attributes as the input area; the areas adjacent - to the input area will not. - - If the areas are meshed or belong to meshed volumes, a 3-D - mesh can be extruded with this command. Note that the NDIV - argument on the ESIZE command should be set before extruding - the meshed areas. - - Scaling of the input areas, if specified, is performed first, - followed by the extrusion. - - In a non-Cartesian coordinate system, the VEXT command locates - the end face of the volume based on the active coordinate - system. However, the extrusion is made along a straight line - between the end faces. Note that solid modeling in a toroidal - coordinate system is not recommended. - - .. warning:: - Use of the VEXT command can produce unexpected results when - operating in a non-Cartesian coordinate system. For a - detailed description of the possible problems that may - occur, see Solid Modeling in the Modeling and Meshing - Guide. - - Parameters - ---------- - itime - Do this generation operation a total of ITIMEs, incrementing all - keypoints in the given pattern automatically (or by KINC) each time - after the first. ITIME must be > 1 for generation to occur. - - nv1, nv2, ninc - Generate volumes from pattern beginning with NV1 to NV2 (defaults - to NV1) in steps of NINC (defaults to 1). If NV1 = ALL, NV2 and - NINC are ignored and the pattern is all selected volumes [VSEL]. - If NV1 = P, graphical picking is enabled and all remaining command - fields are ignored (valid only in the GUI). A component name may - also be substituted for NV1 (NV2 and NINC are ignored). - - dx, dy, dz - Keypoint location increments in the active coordinate system (--, - Dθ, DZ for cylindrical, --, Dθ, -- for spherical). - - kinc - Keypoint increment between generated sets. If zero, the lowest - available keypoint numbers are assigned [NUMSTR]. - - noelem - Specifies if elements and nodes are also to be generated: - - 0 - Generate nodes and elements associated with the original volumes, if they - exist. - - 1 - Do not generate nodes and elements. - - imove - Specifies whether to redefine the existing volumes: - - 0 - Generate additional volumes as requested with the ITIME argument. - - 1 - Move original volumes to new position retaining the same keypoint line, and - area numbers (ITIME, KINC, and NOELEM are ignored). - Corresponding meshed items are also moved if not needed at - their original position. - - Notes - ----- - Generates additional volumes (and their corresponding keypoints, lines, - areas and mesh) from a given volume pattern. The MAT, TYPE, REAL, and - ESYS attributes are based upon the volumes in the pattern and not upon - the current settings of the pointers. End slopes of the generated - lines remain the same (in the active coordinate system) as those of the - given pattern. For example, radial slopes remain radial, etc. - Generations which produce volumes of a size or shape different from the - pattern (i.e., radial generations in cylindrical systems, radial and - phi generations in spherical systems, and theta generations in - elliptical systems) are not allowed. Note that solid modeling in a - toroidal coordinate system is not recommended. Volume, area, and line - numbers are automatically assigned (beginning with the lowest available - values [NUMSTR]). - """ - command = ( - f"VGEN,{itime},{nv1},{nv2},{ninc},{dx},{dy},{dz},{kinc},{noelem},{imove}" - ) - return self.run(command, **kwargs) - - def vlist(self, nv1="", nv2="", ninc="", **kwargs): - """Lists the defined volumes. - - APDL Command: VLIST - - Parameters - ---------- - nv1, nv2, ninc - List volumes from NV1 to NV2 (defaults to NV1) in steps of NINC - (defaults to 1). If NV1 = ALL (default), NV2 and NINC are ignored - and all selected volumes [VSEL] are listed. If NV1 = P, graphical - picking is enabled and all remaining command fields are ignored - (valid only in the GUI). A component name may also be substituted - for NV1 (NV2 and NINC are ignored). - - Notes - ----- - An attribute (TYPE, MAT, REAL, or ESYS) listed as a zero is unassigned; - one listed as a positive value indicates that the attribute was - assigned with the VATT command (and will not be reset to zero if the - mesh is cleared); one listed as a negative value indicates that the - attribute was assigned using the attribute pointer [TYPE, MAT, REAL, or - ESYS] that was active during meshing (and will be reset to zero if the - mesh is cleared). A "-1" in the "nodes" column indicates that the - volume has been meshed but there are no interior nodes. The volume - size is listed only if a VSUM command has been performed on the volume. - Volume orientation attributes (KZ1 and KZ2) are listed only if a - VEORIENT command was previously used to define an orientation for the - volume. - - This command is valid in any processor. - """ - command = f"VLIST,{nv1},{nv2},{ninc}" - return self.run(command, **kwargs) - - def vlscale( - self, - nv1="", - nv2="", - ninc="", - rx="", - ry="", - rz="", - kinc="", - noelem="", - imove="", - **kwargs, - ): - """Generates a scaled set of volumes from a pattern of volumes. - - APDL Command: VLSCALE - - Parameters - ---------- - nv1, nv2, ninc - Set of volumes (NV1 to NV2 in steps of NINC) that defines the - pattern to be scaled. NV2 defaults to NV1, NINC defaults to 1. If - NV1 = ALL, NV2 and NINC are ignored and the pattern is defined by - all selected volumes. If NV1 = P, graphical picking is enabled and - all remaining command fields are ignored (valid only in the GUI). - A component name may also be substituted for NV1 (NV2 and NINC are - ignored). - - rx, ry, rz - Scale factors to be applied to the X, Y, and Z keypoint coordinates - in active coordinate system (RR, Rθ, RZ for cylindrical; RR, Rθ, RΦ - for spherical). Note that the Rθ and RΦ scale factors are - interpreted as angular offsets. For example, if CSYS = 1, RX, RY, - RZ input of (1.5,10,3) would scale the specified keypoints 1.5 - times in the radial and 3 times in the Z direction, while adding an - offset of 10 degrees to the keypoints. Zero, blank, or negative - scale factor values are assumed to be 1.0. Zero or blank angular - offsets have no effect. - - kinc - Increment to be applied to keypoint numbers for generated set. If - zero, the lowest available keypoint numbers will be assigned - [NUMSTR]. - - noelem - Specifies whether nodes and elements are also to be generated: - - 0 - Nodes and elements associated with the original volumes will be generated - (scaled) if they exist. - - 1 - Nodes and elements will not be generated. - - imove - Specifies whether volumes will be moved or newly defined: - - 0 - Additional volumes will be generated. - - 1 - Original volumes will be moved to new position (KINC and NOELEM are ignored). - Use only if the old volumes are no longer needed at their - original positions. Corresponding meshed items are also moved - if not needed at their original position. - - Notes - ----- - Generates a scaled set of volumes (and their corresponding keypoints, - lines, areas, and mesh) from a pattern of volumes. The MAT, TYPE, - REAL, and ESYS attributes are based on the volumes in the pattern and - not the current settings. Scaling is done in the active coordinate - system. Volumes in the pattern could have been generated in any - coordinate system. However, solid modeling in a toroidal coordinate - system is not recommended. - """ - command = f"VLSCALE,{nv1},{nv2},{ninc},{rx},{ry},{rz},{kinc},{noelem},{imove}" - return self.run(command, **kwargs) - - def voffst(self, narea="", dist="", kinc="", **kwargs): - """Generates a volume, offset from a given area. - - APDL Command: VOFFST - - Parameters - ---------- - narea - Area from which generated volume is to be offset. If NAREA = P, - graphical picking is enabled and all remaining command fields are - ignored (valid only in the GUI). - - dist - Distance normal to given area at which keypoints for generated - volume are to be located. Positive normal is determined from the - right-hand rule keypoint order. - - kinc - Increment to be applied to the keypoint numbers between sets. If - zero, keypoint numbers will be automatically assigned beginning - with the lowest available value [NUMSTR]. - - Notes - ----- - Generates a volume (and its corresponding keypoints, lines, and areas) - by offsetting from an area. The direction of the offset varies with - the given area normal. End slopes of the generated lines remain the - same as those of the given pattern. - - If element attributes have been associated with the input area via the - AATT command, the opposite area generated by the VOFFST operation will - also have those attributes (i.e., the element attributes from the input - area are copied to the opposite area). Note that only the area - opposite the input area will have the same attributes as the input - area; the areas adjacent to the input area will not. - - If the areas are meshed or belong to meshed volumes, a 3-D mesh can be - extruded with this command. Note that the NDIV argument on the ESIZE - command should be set before extruding the meshed areas. - """ - command = f"VOFFST,{narea},{dist},{kinc}" - return self.run(command, **kwargs) - - def vplot(self, nv1="", nv2="", ninc="", degen="", scale="", **kwargs): - """Displays the selected volumes. - - APDL Command: VPLOT - - Parameters - ---------- - nv1, nv2, ninc - Display volumes from NV1 to NV2 (defaults to NV1) in steps of NINC - (defaults to 1). If NV1 = ALL (default), NV2 and NINC are ignored - and all selected volumes [VSEL] are displayed. - - degen - Degeneracy marker: - - (blank) - No degeneracy marker is used (default). - - DEGE - A red star is placed on keypoints at degeneracies (see the Modeling and Meshing - Guide). Not available if /FACET,WIRE is set. - - scale - Scale factor for the size of the degeneracy-marker star. The scale - is the size in window space (-1 to 1 in both directions) (defaults - to .075). - - Notes - ----- - Displays selected volumes. (Only volumes having areas within the - selected area set [ASEL] will be plotted.) With PowerGraphics on - [/GRAPHICS,POWER], VPLOT will display only the currently selected - areas. This command is also a utility command, valid anywhere. The - degree of tessellation used to plot the volumes is set through the - /FACET command. - """ - command = f"VPLOT,{nv1},{nv2},{ninc},{degen},{scale}" - return self.run(command, **kwargs) - - def vrotat( - self, - na1="", - na2="", - na3="", - na4="", - na5="", - na6="", - pax1="", - pax2="", - arc="", - nseg="", - **kwargs, - ) -> str: - """Generate cylindrical volumes by rotating an area pattern about an axis. - - APDL Command: VROTAT - - Generates cylindrical volumes (and their corresponding - keypoints, lines, and areas) by rotating an area pattern (and - its associated line and keypoint patterns) about an axis. - Keypoint patterns are generated at regular angular locations - (based on a maximum spacing of 90 degrees). Line patterns are - generated at the keypoint patterns. Arc lines are also - generated to connect the keypoints circumferentially. - Keypoint, line, area, and volume numbers are automatically - assigned (beginning with the lowest available values). - Adjacent lines use a common keypoint, adjacent areas use a - common line, and adjacent volumes use a common area. - - To generate a single volume with an arc greater than 180 degrees, - NSEG must be greater than or equal to 2. - - If element attributes have been associated with the input area - via the AATT command, the opposite area generated by the - VROTAT operation will also have those attributes (i.e., the - element attributes from the input area are copied to the - opposite area). Note that only the area opposite the input - area will have the same attributes as the input area; the - areas adjacent to the input area will not. - - If the given areas are meshed or belong to meshed volumes, the - 2-D mesh can be rotated (extruded) to a 3-D mesh. See the - Modeling and Meshing Guide for more information. Note that - the NDIV argument on the ESIZE command should be set before - extruding the meshed areas. - - Parameters - ---------- - na1, na2, na3, . . . , na6 - List of areas in the pattern to be rotated (6 maximum if - using keyboard entry). Areas must lie to one side of, and - in the plane of, the axis of rotation. If NA1 = ALL, - all selected areas will define the pattern to be rotated. - A component name may also be substituted for NA1. - - pax1, pax2 - Keypoints defining the axis about which the area pattern - is to be rotated. - - arc - Arc length (in degrees). Positive follows right-hand rule - about PAX1-PAX2 vector. Defaults to 360. - - nseg - Number of volumes (8 maximum) around circumference. - Defaults to minimum required for 90 degrees (maximum) arcs, i.e., - 4 for 360 degrees, 3 for 270 degrees, etc. - - Returns - ------- - str - MAPDL command output. - - Examples - -------- - Rotate a circle about the Z axis to create a hoop. - - First, create a circle offset from origin on the XZ plane. - - >>> hoop_radius = 10 - >>> hoop_thickness = 0.5 - >>> k0 = mapdl.k("", hoop_radius, 0, 0) - >>> k1 = mapdl.k("", hoop_radius, 1, 0) - >>> k2 = mapdl.k("", hoop_radius, 0, hoop_thickness) - >>> carc0 = mapdl.circle(k0, 1, k1) - >>> a0 = mapdl.al(*carc0) - - Create a hoop by rotating it about an axis defined by two - keypoints. - - >>> k_axis0 = mapdl.k("", 0, 0, 0) - >>> k_axis1 = mapdl.k("", 0, 0, 1) - mapdl.vrotat(a0, pax1=k_axis0, pax2=k_axis1) - """ - command = ( - f"VROTAT,{na1},{na2},{na3},{na4},{na5},{na6},{pax1},{pax2},{arc},{nseg}" - ) - return self.run(command, **kwargs) - - def vsum(self, lab="", **kwargs): - """Calculates and prints geometry statistics of the selected volumes. - - APDL Command: VSUM - - Parameters - ---------- - lab - Controls the degree of tessellation used in the calculation of area - properties. If LAB = DEFAULT, area calculations will use the - degree of tessellation set through the /FACET command. If LAB = - FINE, area calculations are based on a finer tessellation. - - Notes - ----- - Calculates and prints geometry statistics (volume, centroid location, - moments of inertia, etc.) associated with the selected volumes. - Geometry items are reported in the global Cartesian coordinate system. - A unit density is assumed unless the volumes have a material - association via the VATT command. Items calculated by VSUM and later - retrieved by a ``*GET`` or ``*VGET`` command are valid only if the model is not - modified after the VSUM command is issued. - - Setting a finer degree of tessellation will provide area calculations - with greater accuracy, especially for thin, hollow models. However, - using a finer degree of tessellation requires longer processing. - - For very thin volumes, such that the ratio of the minimum to the - maximum dimension is less than 0.01, the VSUM command can provide - erroneous volume information. To ensure that such calculations are - accurate, make certain that you subdivide such volumes so that the - ratio of the minimum to the maximum is at least 0.05. - """ - command = f"VSUM,{lab}" - return self.run(command, **kwargs) - - def vsymm( - self, - ncomp="", - nv1="", - nv2="", - ninc="", - kinc="", - noelem="", - imove="", - **kwargs, - ) -> str: - """Generate volumes from a volume pattern by symmetry reflection. - - APDL Command: VSYMM - - Generates a reflected set of volumes (and their corresponding - keypoints, lines, areas and mesh) from a given volume pattern - by a symmetry reflection (see analogous node symmetry command, - NSYM). The MAT, TYPE, REAL, and ESYS attributes are based - upon the volumes in the pattern and not upon the current - settings. Reflection is done in the active coordinate system - by changing a particular coordinate sign. The active - coordinate system must be a Cartesian system. Volumes in the - pattern may have been generated in any coordinate system. - However, solid modeling in a toroidal coordinate system is not - recommended. Volumes are generated as described in the VGEN - command. - - See the ESYM command for additional information about symmetry - elements. - - Parameters - ---------- - ncomp - Symmetry key: - - - ``'X'`` : X symmetry (default). - - ``'Y'`` : Y symmetry. - - ``'Z'`` : Z symmetry. - - nv1, nv2, ninc - Reflect volumes from pattern beginning with NV1 to NV2 - (defaults to NV1) in steps of NINC (defaults to 1). If - NV1 = ALL, NV2 and NINC are ignored and the pattern is all - selected volumes [VSEL]. A component name may also be - substituted for NV1 (NV2 and NINC are ignored). - - kinc - Keypoint increment between sets. If zero, the lowest - available keypoint numbers are assigned [NUMSTR]. - - noelem - Specifies whether nodes and elements are also to be generated: - - 0 - Generate nodes and elements associated with the - original volumes, if they exist. - - 1 - Do not generate nodes and elements. - - imove - Specifies whether volumes will be moved or newly defined: - - 0 - Generate additional volumes. - - 1 - Move original volumes to new position retaining the - same keypoint numbers (KINC and NOELEM are ignored). - Corresponding meshed items are also moved if not - needed at their original position. - - Returns - ------- - str - MAPDL command output. - - Examples - -------- - Create four blocks by reflecting a single block across the X - component and then the Y component. - - >>> vnum = mapdl.blc4(1, 1, 1, 1, depth=1) - >>> mapdl.vsymm('X', vnum) - >>> output = mapdl.vsymm('Y', 'ALL') - >>> print(output) - SYMMETRY TRANSFORMATION OF VOLUMES USING COMPONENT Y - SET IS ALL SELECTED VOLUMES - """ - command = f"VSYMM,{ncomp},{nv1},{nv2},{ninc},{kinc},{noelem},{imove}" - return self.run(command, **kwargs) - - def vtran( - self, - kcnto="", - nv1="", - nv2="", - ninc="", - kinc="", - noelem="", - imove="", - **kwargs, - ): - """Transfers a pattern of volumes to another coordinate system. - - APDL Command: VTRAN - - Parameters - ---------- - kcnto - Reference number of coordinate system where the pattern is to be - transferred. Transfer occurs from the active coordinate system. - The coordinate system type and parameters of KCNTO must be the same - as the active system. - - nv1, nv2, ninc - Transfer volumes from pattern beginning with NV1 to NV2 (defaults - to NV1) in steps of NINC (defaults to 1). If NV1 = ALL, NV2 and - NINC are ignored and the pattern is all selected volumes [VSEL]. - If NV1 = P, graphical picking is enabled and all remaining command - fields are ignored (valid only in the GUI). A component name may - also be substituted for NV1 (NV2 and NINC are ignored). - - kinc - Keypoint increment between sets. If zero, the lowest available - keypoint numbers are assigned [NUMSTR]. - - noelem - Specifies whether elements and nodes are also to be generated: - - 0 - Generate nodes and elements associated with the original volumes, if they - exist. - - 1 - Do not generate nodes and elements. - - imove - Specifies whether to redefine the existing volumes: - - 0 - Generate additional volumes. - - 1 - Move original volumes to new position retaining the same keypoint numbers (KINC - and NOELEM are ignored). Corresponding meshed items are also - moved if not needed at their original position. - - Notes - ----- - Transfers a pattern of volumes (and their corresponding keypoints, - lines, areas and mesh) from one coordinate system to another (see - analogous node transfer command, TRANSFER). The MAT, TYPE, REAL, and - ESYS attributes are based upon the volumes in the pattern and not upon - the current settings. Coordinate systems may be translated and rotated - relative to each other. Initial pattern may be generated in any - coordinate system. However, solid modeling in a toroidal coordinate - system is not recommended. Coordinate and slope values are interpreted - in the active coordinate system and are transferred directly. Volumes - are generated as described in the VGEN command. - """ - command = f"VTRAN,{kcnto},{nv1},{nv2},{ninc},{kinc},{noelem},{imove}" - return self.run(command, **kwargs) diff --git a/src/ansys/mapdl/core/commands.py b/src/ansys/mapdl/core/commands.py index 290d67cd1e5..b61bb23a4ae 100644 --- a/src/ansys/mapdl/core/commands.py +++ b/src/ansys/mapdl/core/commands.py @@ -47,7 +47,6 @@ post1, post26, prep7, - preproc, session, solution, ) @@ -344,19 +343,13 @@ class Prep7Commands( prep7.materials.Materials, prep7.meshing.Meshing, prep7.morphing.Morphing, -): - pass - - -class PreprocessorCommands( - preproc.nodes.Nodes, - preproc.real_constants.RealConstants, - preproc.primitives.Primitives, - preproc.sections.Sections, - preproc.special_purpose.SpecialPurpose, - preproc.status.Status, - preproc.superelements.Superelements, - preproc.volumes.Volumes, + prep7.nodes.Nodes, + prep7.piping.Piping, + prep7.real_constants.RealConstants, + prep7.special_purpose.SpecialPurpose, + prep7.status.Status, + prep7.superelements.Superelements, + prep7.volumes.Volumes, ): pass @@ -525,7 +518,6 @@ class Commands( MiscCommands, Post1Commands, Post26Commands, - PreprocessorCommands, Prep7Commands, SessionCommands, SolutionCommands,