diff --git a/doc/changelog.d/4153.miscellaneous.md b/doc/changelog.d/4153.miscellaneous.md new file mode 100644 index 00000000000..9bc9f600715 --- /dev/null +++ b/doc/changelog.d/4153.miscellaneous.md @@ -0,0 +1 @@ +Feat: ``prep7`` - part 1 \ No newline at end of file diff --git a/doc/source/mapdl_commands/prep7/_status.rst b/doc/source/mapdl_commands/prep7/_status.rst new file mode 100644 index 00000000000..761f045076f --- /dev/null +++ b/doc/source/mapdl_commands/prep7/_status.rst @@ -0,0 +1,18 @@ + +.. _ref__status: + + +Status +====== + + +.. currentmodule:: ansys.mapdl.core._commands.prep7._status + +.. autoclass:: ansys.mapdl.core._commands.prep7._status.Status + +.. autosummary:: + :template: base.rst + :toctree: _autosummary + + + Status.fatigue diff --git a/doc/source/mapdl_commands/prep7/areas.rst b/doc/source/mapdl_commands/prep7/areas.rst index 9e4d0b4bb1b..0bd495357d0 100644 --- a/doc/source/mapdl_commands/prep7/areas.rst +++ b/doc/source/mapdl_commands/prep7/areas.rst @@ -1,34 +1,37 @@ -.. _ref_areas_commands_api: -***** +.. _ref_areas: + + Areas -***** +===== + -.. currentmodule:: ansys.mapdl.core +.. currentmodule:: ansys.mapdl.core._commands.prep7.areas -These PREP7 commands are used to create, modify, list, etc., areas. +.. autoclass:: ansys.mapdl.core._commands.prep7.areas.Areas .. autosummary:: - :toctree: _autosummary/ - - Mapdl.a - Mapdl.aatt - Mapdl.adele - Mapdl.adgl - Mapdl.adrag - Mapdl.afillt - Mapdl.agen - Mapdl.al - Mapdl.alist - Mapdl.anorm - Mapdl.aoffst - Mapdl.areverse - Mapdl.arotat - Mapdl.arscale - Mapdl.arsym - Mapdl.askin - Mapdl.asub - Mapdl.asum - Mapdl.atran - Mapdl.gsum - Mapdl.splot + :template: base.rst + :toctree: _autosummary + + + Areas.a + Areas.adele + Areas.adgl + Areas.adrag + Areas.afillt + Areas.agen + Areas.al + Areas.alist + Areas.anorm + Areas.aoffst + Areas.aplot + Areas.areverse + Areas.arotat + Areas.arscale + Areas.arsym + Areas.askin + Areas.asub + Areas.asum + Areas.atran + Areas.splot diff --git a/doc/source/mapdl_commands/prep7/artificially_matched_layers.rst b/doc/source/mapdl_commands/prep7/artificially_matched_layers.rst index 201ef98e10c..c75c3e0acf6 100644 --- a/doc/source/mapdl_commands/prep7/artificially_matched_layers.rst +++ b/doc/source/mapdl_commands/prep7/artificially_matched_layers.rst @@ -1,15 +1,20 @@ -.. _ref_artificially_matched_layers_commands_api: -*************************** -Artificially matched layers -*************************** +.. _ref_artificially_matched_layers: -.. currentmodule:: ansys.mapdl.core -These PREP7 commands are used to create artificially matched layers (PMLs or AMLs) designed to absorb high frequency waves. +ArtificiallyMatchedLayers +========================= + + +.. currentmodule:: ansys.mapdl.core._commands.prep7.artificially_matched_layers + +.. autoclass:: ansys.mapdl.core._commands.prep7.artificially_matched_layers.ArtificiallyMatchedLayers .. autosummary:: - :toctree: _autosummary/ + :template: base.rst + :toctree: _autosummary + - Mapdl.pmlopt - Mapdl.pmlsize + ArtificiallyMatchedLayers.pmlopt + ArtificiallyMatchedLayers.pmlsize + ArtificiallyMatchedLayers.psys diff --git a/doc/source/mapdl_commands/prep7/booleans.rst b/doc/source/mapdl_commands/prep7/booleans.rst index 040620b1c6f..d0b36e6d1c0 100644 --- a/doc/source/mapdl_commands/prep7/booleans.rst +++ b/doc/source/mapdl_commands/prep7/booleans.rst @@ -1,47 +1,51 @@ -.. _ref_booleans_commands_api: -******** +.. _ref_booleans: + + Booleans -******** +======== + -.. currentmodule:: ansys.mapdl.core +.. currentmodule:: ansys.mapdl.core._commands.prep7.booleans -These PREP7 commands are used to perform Boolean operations on solid model entities. +.. autoclass:: ansys.mapdl.core._commands.prep7.booleans.Booleans .. autosummary:: - :toctree: _autosummary/ - - Mapdl.aadd - Mapdl.aglue - Mapdl.aina - Mapdl.ainp - Mapdl.ainv - Mapdl.aovlap - Mapdl.aptn - Mapdl.asba - Mapdl.asbl - Mapdl.asbv - Mapdl.asbw - Mapdl.boptn - Mapdl.btol - Mapdl.lcsl - Mapdl.lglue - Mapdl.lina - Mapdl.linl - Mapdl.linp - Mapdl.linv - Mapdl.lovlap - Mapdl.lptn - Mapdl.lsba - Mapdl.lsbl - Mapdl.lsbv - Mapdl.lsbw - Mapdl.vadd - Mapdl.vglue - Mapdl.vinp - Mapdl.vinv - Mapdl.vovlap - Mapdl.vptn - Mapdl.vsba - Mapdl.vsbv - Mapdl.vsbw + :template: base.rst + :toctree: _autosummary + + + Booleans.aadd + Booleans.aglue + Booleans.aina + Booleans.ainp + Booleans.ainv + Booleans.aovlap + Booleans.aptn + Booleans.asba + Booleans.asbl + Booleans.asbv + Booleans.asbw + Booleans.boptn + Booleans.btol + Booleans.lcsl + Booleans.lglue + Booleans.lina + Booleans.linl + Booleans.linp + Booleans.linv + Booleans.lovlap + Booleans.lptn + Booleans.lsba + Booleans.lsbl + Booleans.lsbv + Booleans.lsbw + Booleans.vadd + Booleans.vglue + Booleans.vinp + Booleans.vinv + Booleans.vovlap + Booleans.vptn + Booleans.vsba + Booleans.vsbv + Booleans.vsbw diff --git a/doc/source/mapdl_commands/prep7/constraint_equations.rst b/doc/source/mapdl_commands/prep7/constraint_equations.rst index 53342d55510..a8fe440c46a 100644 --- a/doc/source/mapdl_commands/prep7/constraint_equations.rst +++ b/doc/source/mapdl_commands/prep7/constraint_equations.rst @@ -1,21 +1,27 @@ -.. _ref_constraint_equations_commands_api: -******************** -Constraint equations -******************** +.. _ref_constraint_equations: -.. currentmodule:: ansys.mapdl.core -These PREP7 commands are used to define, modify, list, etc., constraint equations. +ConstraintEquations +=================== + + +.. currentmodule:: ansys.mapdl.core._commands.prep7.constraint_equations + +.. autoclass:: ansys.mapdl.core._commands.prep7.constraint_equations.ConstraintEquations .. autosummary:: - :toctree: _autosummary/ - - Mapdl.ce - Mapdl.cecyc - Mapdl.cedele - Mapdl.ceintf - Mapdl.celist - Mapdl.cerig - Mapdl.cesgen - Mapdl.rbe3 + :template: base.rst + :toctree: _autosummary + + + ConstraintEquations.ce + ConstraintEquations.cecycms + ConstraintEquations.cedele + ConstraintEquations.ceims + ConstraintEquations.ceintf + ConstraintEquations.celist + ConstraintEquations.cerig + ConstraintEquations.cesel + ConstraintEquations.cesgen + ConstraintEquations.rbe3 diff --git a/doc/source/mapdl_commands/prep7/constraint_equations_.rst b/doc/source/mapdl_commands/prep7/constraint_equations_.rst new file mode 100644 index 00000000000..ac7a283f8d9 --- /dev/null +++ b/doc/source/mapdl_commands/prep7/constraint_equations_.rst @@ -0,0 +1,18 @@ + +.. _ref_constraint_equations_: + + +ConstraintEquations +=================== + + +.. currentmodule:: ansys.mapdl.core._commands.prep7.constraint_equations_ + +.. autoclass:: ansys.mapdl.core._commands.prep7.constraint_equations_.ConstraintEquations + +.. autosummary:: + :template: base.rst + :toctree: _autosummary + + + ConstraintEquations.cecyc diff --git a/doc/source/mapdl_commands/prep7/coupled_dof.rst b/doc/source/mapdl_commands/prep7/coupled_dof.rst index 6449d25c436..525a20c0410 100644 --- a/doc/source/mapdl_commands/prep7/coupled_dof.rst +++ b/doc/source/mapdl_commands/prep7/coupled_dof.rst @@ -1,22 +1,26 @@ -.. _ref_coupled_dof_commands_api: -************************** -Coupled degrees of freedom -************************** +.. _ref_coupled_dof: -.. currentmodule:: ansys.mapdl.core -These PREP7 commands are used to define, modify, list, etc., coupled -degrees of freedom. +CoupledDof +========== + + +.. currentmodule:: ansys.mapdl.core._commands.prep7.coupled_dof + +.. autoclass:: ansys.mapdl.core._commands.prep7.coupled_dof.CoupledDof .. autosummary:: - :toctree: _autosummary/ - - Mapdl.cp - Mapdl.cpdele - Mapdl.cpintf - Mapdl.cplgen - Mapdl.cplist - Mapdl.cpmerge - Mapdl.cpngen - Mapdl.cpsgen + :template: base.rst + :toctree: _autosummary + + + CoupledDof.cp + CoupledDof.cpdele + CoupledDof.cpintf + CoupledDof.cplgen + CoupledDof.cplist + CoupledDof.cpmerge + CoupledDof.cpngen + CoupledDof.cpsel + CoupledDof.cpsgen diff --git a/doc/source/mapdl_commands/prep7/cross_sections.rst b/doc/source/mapdl_commands/prep7/cross_sections.rst new file mode 100644 index 00000000000..e4dd00271c7 --- /dev/null +++ b/doc/source/mapdl_commands/prep7/cross_sections.rst @@ -0,0 +1,53 @@ + +.. _ref_cross_sections: + + +CrossSections +============= + + +.. currentmodule:: ansys.mapdl.core._commands.prep7.cross_sections + +.. autoclass:: ansys.mapdl.core._commands.prep7.cross_sections.CrossSections + +.. autosummary:: + :template: base.rst + :toctree: _autosummary + + + CrossSections.bsax + CrossSections.bsm1 + CrossSections.bsm2 + CrossSections.bsmd + CrossSections.bss1 + CrossSections.bss2 + CrossSections.bste + CrossSections.bstq + CrossSections.cbmd + CrossSections.cbmx + CrossSections.cbte + CrossSections.sdelete + CrossSections.seccontrol + CrossSections.secdata + CrossSections.secfunction + CrossSections.secjoint + CrossSections.seclib + CrossSections.seclock + CrossSections.secmodif + CrossSections.secnum + CrossSections.secoffset + CrossSections.secplot + CrossSections.secread + CrossSections.secstop + CrossSections.sectype + CrossSections.secwrite + CrossSections.sflex + CrossSections.slist + CrossSections.sload + CrossSections.ssbt + CrossSections.ssmt + CrossSections.sspa + CrossSections.sspb + CrossSections.sspd + CrossSections.sspe + CrossSections.sspm diff --git a/doc/source/mapdl_commands/prep7/data_tables.rst b/doc/source/mapdl_commands/prep7/data_tables.rst new file mode 100644 index 00000000000..3355d7f496d --- /dev/null +++ b/doc/source/mapdl_commands/prep7/data_tables.rst @@ -0,0 +1,32 @@ + +.. _ref_data_tables: + + +DataTables +========== + + +.. currentmodule:: ansys.mapdl.core._commands.prep7.data_tables + +.. autoclass:: ansys.mapdl.core._commands.prep7.data_tables.DataTables + +.. autosummary:: + :template: base.rst + :toctree: _autosummary + + + DataTables.cbtmp + DataTables.cgrow + DataTables.inistate + DataTables.tb + DataTables.tbcopy + DataTables.tbdata + DataTables.tbdele + DataTables.tbeo + DataTables.tbfield + DataTables.tbin + DataTables.tblist + DataTables.tbmodif + DataTables.tbplot + DataTables.tbpt + DataTables.tbtemp diff --git a/doc/source/mapdl_commands/prep7/index.rst b/doc/source/mapdl_commands/prep7/index.rst new file mode 100644 index 00000000000..4e79b5c57cc --- /dev/null +++ b/doc/source/mapdl_commands/prep7/index.rst @@ -0,0 +1,49 @@ + +.. _ref_prep7: + +Prep7 +===== + +.. list-table:: + + * - :ref:`ref_areas` + * - :ref:`ref_booleans` + * - :ref:`ref_meshing` + * - :ref:`ref_special_purpose` + * - :ref:`ref_database` + * - :ref:`ref_elements` + * - :ref:`ref_status` + * - :ref:`ref_piping` + * - :ref:`ref_primitives` + * - :ref:`ref_cross_sections` + * - :ref:`ref_lines` + * - :ref:`ref_data_tables` + * - :ref:`ref_constraint_equations` + * - :ref:`ref_constraint_equations_` + * - :ref:`ref_nodes` + * - :ref:`ref_coupled_dof` + * - :ref:`ref_morphing` + * - :ref:`ref_element_type` + * - :ref:`ref_materials` + * - :ref:`ref_volumes` + * - :ref:`ref__status` + * - :ref:`ref_keypoints` + * - :ref:`ref_hard_points` + * - :ref:`ref_artificially_matched_layers` + * - :ref:`ref_real_constants` + * - :ref:`ref_superelements` + + +.. toctree:: + :maxdepth: 1 + :hidden: + + areas + booleans + cross_sections + data_tables + constraint_equations + constraint_equations_ + coupled_dof + _status + artificially_matched_layers diff --git a/src/ansys/mapdl/core/_commands/prep7/__init__.py b/src/ansys/mapdl/core/_commands/prep7/__init__.py new file mode 100644 index 00000000000..87abafdaf0e --- /dev/null +++ b/src/ansys/mapdl/core/_commands/prep7/__init__.py @@ -0,0 +1,33 @@ +# 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 ( + _status, + areas, + artificially_matched_layers, + booleans, + constraint_equations, + constraint_equations_, + coupled_dof, + cross_sections, + data_tables, +) 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..ec763e87e23 --- /dev/null +++ b/src/ansys/mapdl/core/_commands/prep7/_status.py @@ -0,0 +1,49 @@ +# 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 fatigue(self, **kwargs): + r"""Specifies "Fatigue data status" as the subsequent status topic. + + Mechanical APDL Command: `FATIGUE `_ + + Notes + ----- + + .. _FATIGUE_notes: + + This is a status ( :ref:`stat` ) topic command that appears in the log file ( :file:`Jobname.LOG` ) + if status is requested for some items. This command is followed immediately by a :ref:`stat` + command, which reports the status for the specified topic. + + If entered directly into the program, the :ref:`stat` command should immediately follow this + command. + + .. warning:: + + This command is archived in the latest version of the software. + + """ + command = "FATIGUE" + return self.run(command, **kwargs) diff --git a/src/ansys/mapdl/core/_commands/prep7/areas.py b/src/ansys/mapdl/core/_commands/prep7/areas.py new file mode 100644 index 00000000000..188a9c8195e --- /dev/null +++ b/src/ansys/mapdl/core/_commands/prep7/areas.py @@ -0,0 +1,1458 @@ +# 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 Areas: + + def a( + self, + p1: str = "", + p2: str = "", + p3: str = "", + p4: str = "", + p5: str = "", + p6: str = "", + p7: str = "", + p8: str = "", + p9: str = "", + p10: str = "", + p11: str = "", + p12: str = "", + p13: str = "", + p14: str = "", + p15: str = "", + p16: str = "", + p17: str = "", + p18: str = "", + **kwargs, + ): + r"""Defines an area by connecting keypoints. + + Mechanical APDL Command: `A `_ + + Parameters + ---------- + p1 : str + List of keypoints defining the area (18 maximum if using keyboard entry). At least 3 keypoints + must be entered. If ``P1`` = P, graphical picking is enabled and all remaining arguments are + ignored (valid only in the GUI). + + p2 : str + List of keypoints defining the area (18 maximum if using keyboard entry). At least 3 keypoints + must be entered. If ``P1`` = P, graphical picking is enabled and all remaining arguments are + ignored (valid only in the GUI). + + p3 : str + List of keypoints defining the area (18 maximum if using keyboard entry). At least 3 keypoints + must be entered. If ``P1`` = P, graphical picking is enabled and all remaining arguments are + ignored (valid only in the GUI). + + p4 : str + List of keypoints defining the area (18 maximum if using keyboard entry). At least 3 keypoints + must be entered. If ``P1`` = P, graphical picking is enabled and all remaining arguments are + ignored (valid only in the GUI). + + p5 : str + List of keypoints defining the area (18 maximum if using keyboard entry). At least 3 keypoints + must be entered. If ``P1`` = P, graphical picking is enabled and all remaining arguments are + ignored (valid only in the GUI). + + p6 : str + List of keypoints defining the area (18 maximum if using keyboard entry). At least 3 keypoints + must be entered. If ``P1`` = P, graphical picking is enabled and all remaining arguments are + ignored (valid only in the GUI). + + p7 : str + List of keypoints defining the area (18 maximum if using keyboard entry). At least 3 keypoints + must be entered. If ``P1`` = P, graphical picking is enabled and all remaining arguments are + ignored (valid only in the GUI). + + p8 : str + List of keypoints defining the area (18 maximum if using keyboard entry). At least 3 keypoints + must be entered. If ``P1`` = P, graphical picking is enabled and all remaining arguments are + ignored (valid only in the GUI). + + p9 : str + List of keypoints defining the area (18 maximum if using keyboard entry). At least 3 keypoints + must be entered. If ``P1`` = P, graphical picking is enabled and all remaining arguments are + ignored (valid only in the GUI). + + p10 : str + List of keypoints defining the area (18 maximum if using keyboard entry). At least 3 keypoints + must be entered. If ``P1`` = P, graphical picking is enabled and all remaining arguments are + ignored (valid only in the GUI). + + p11 : str + List of keypoints defining the area (18 maximum if using keyboard entry). At least 3 keypoints + must be entered. If ``P1`` = P, graphical picking is enabled and all remaining arguments are + ignored (valid only in the GUI). + + p12 : str + List of keypoints defining the area (18 maximum if using keyboard entry). At least 3 keypoints + must be entered. If ``P1`` = P, graphical picking is enabled and all remaining arguments are + ignored (valid only in the GUI). + + p13 : str + List of keypoints defining the area (18 maximum if using keyboard entry). At least 3 keypoints + must be entered. If ``P1`` = P, graphical picking is enabled and all remaining arguments are + ignored (valid only in the GUI). + + p14 : str + List of keypoints defining the area (18 maximum if using keyboard entry). At least 3 keypoints + must be entered. If ``P1`` = P, graphical picking is enabled and all remaining arguments are + ignored (valid only in the GUI). + + p15 : str + List of keypoints defining the area (18 maximum if using keyboard entry). At least 3 keypoints + must be entered. If ``P1`` = P, graphical picking is enabled and all remaining arguments are + ignored (valid only in the GUI). + + p16 : str + List of keypoints defining the area (18 maximum if using keyboard entry). At least 3 keypoints + must be entered. If ``P1`` = P, graphical picking is enabled and all remaining arguments are + ignored (valid only in the GUI). + + p17 : str + List of keypoints defining the area (18 maximum if using keyboard entry). At least 3 keypoints + must be entered. If ``P1`` = P, graphical picking is enabled and all remaining arguments are + ignored (valid only in the GUI). + + p18 : str + List of keypoints defining the area (18 maximum if using keyboard entry). At least 3 keypoints + must be entered. If ``P1`` = P, graphical picking is enabled and all remaining arguments are + ignored (valid only in the GUI). + + Returns + ------- + int + The area number of the generated area. + + Notes + ----- + + .. _A_notes: + + Keypoints ( ``P1`` through ``P18`` ) must be input in a clockwise or counterclockwise order around + the area. This order also determines the positive normal direction of the area according to the + right-hand rule. Existing lines between adjacent keypoints will be used; missing lines are generated + "straight" in the active coordinate system and assigned the lowest available numbers ( :ref:`numstr` + ). If more than one line exists between two keypoints, the shorter one will be chosen. If the area + is to be defined with more than four keypoints, the required keypoints and lines must lie on a + constant coordinate value in the active coordinate system (such as a plane or a cylinder). Areas may + be redefined only if not yet attached to a volume. Solid modeling in a toroidal coordinate system is + not recommended. + + Examples + -------- + Create a simple triangle in the XY plane using three keypoints. + + >>> k0 = mapdl.k("", 0, 0, 0) + >>> k1 = mapdl.k("", 1, 0, 0) + >>> k2 = mapdl.k("", 0, 1, 0) + >>> a0 = mapdl.a(k0, k1, k2) + >>> a0 + 1 + """ + command = f"A,{p1},{p2},{p3},{p4},{p5},{p6},{p7},{p8},{p9},{p10},{p11},{p12},{p13},{p14},{p15},{p16},{p17},{p18}" + return parse.parse_a(self.run(command, **kwargs)) + + def adele( + self, + na1: str = "", + na2: str = "", + ninc: str = "", + kswp: int | str = "", + **kwargs, + ): + r"""Deletes unmeshed areas. + + Mechanical APDL Command: `ADELE `_ + + Parameters + ---------- + na1 : str + Delete areas from ``NA1`` to ``NA2`` (defaults to ``NA1`` ) in steps of ``NINC`` (defaults to + 1). If ``NA1`` = ALL, ``NA2`` and ``NINC`` are ignored and all selected areas ( :ref:`asel` ) + are deleted. If ``NA1`` = P, graphical picking is enabled and all remaining arguments are + ignored (valid only in the GUI). A component name may also be substituted for ``NA1`` ( ``NA2`` + and ``NINC`` are ignored). + + na2 : str + Delete areas from ``NA1`` to ``NA2`` (defaults to ``NA1`` ) in steps of ``NINC`` (defaults to + 1). If ``NA1`` = ALL, ``NA2`` and ``NINC`` are ignored and all selected areas ( :ref:`asel` ) + are deleted. If ``NA1`` = P, graphical picking is enabled and all remaining arguments are + ignored (valid only in the GUI). A component name may also be substituted for ``NA1`` ( ``NA2`` + and ``NINC`` are ignored). + + ninc : str + Delete areas from ``NA1`` to ``NA2`` (defaults to ``NA1`` ) in steps of ``NINC`` (defaults to + 1). If ``NA1`` = ALL, ``NA2`` and ``NINC`` are ignored and all selected areas ( :ref:`asel` ) + are deleted. If ``NA1`` = P, graphical picking is enabled and all remaining arguments are + ignored (valid only in the GUI). A component name may also be substituted for ``NA1`` ( ``NA2`` + and ``NINC`` are ignored). + + kswp : int or str + Specifies whether keypoints and lines are also to be deleted: + + * ``0`` - Delete areas only (default). + + * ``1`` - Delete areas, as well as keypoints and lines attached to specified areas but not shared by + other areas. + + Notes + ----- + + .. _ADELE_notes: + + An area attached to a volume cannot be deleted unless the volume is first deleted. + """ + command = f"ADELE,{na1},{na2},{ninc},{kswp}" + return self.run(command, **kwargs) + + def adgl(self, na1: str = "", na2: str = "", ninc: str = "", **kwargs): + r"""Lists keypoints of an area that lie on a parametric degeneracy. + + Mechanical APDL Command: `ADGL `_ + + Parameters + ---------- + na1 : str + List keypoints that lie on a parametric degeneracy on areas from ``NA1`` to ``NA2`` (defaults to + ``NA1`` ) in steps of ``NINC`` (defaults to 1). If ``NA1`` = ALL (default), ``NA2`` and ``NINC`` + will be ignored and keypoints on all selected areas ( :ref:`asel` ) will be listed. If ``NA1`` = + P, graphical picking is enabled and all remaining arguments are ignored (valid only in the GUI). + A component name may be substituted in ``NA1`` ( ``NA2`` and ``NINC`` will be ignored). + + na2 : str + List keypoints that lie on a parametric degeneracy on areas from ``NA1`` to ``NA2`` (defaults to + ``NA1`` ) in steps of ``NINC`` (defaults to 1). If ``NA1`` = ALL (default), ``NA2`` and ``NINC`` + will be ignored and keypoints on all selected areas ( :ref:`asel` ) will be listed. If ``NA1`` = + P, graphical picking is enabled and all remaining arguments are ignored (valid only in the GUI). + A component name may be substituted in ``NA1`` ( ``NA2`` and ``NINC`` will be ignored). + + ninc : str + List keypoints that lie on a parametric degeneracy on areas from ``NA1`` to ``NA2`` (defaults to + ``NA1`` ) in steps of ``NINC`` (defaults to 1). If ``NA1`` = ALL (default), ``NA2`` and ``NINC`` + will be ignored and keypoints on all selected areas ( :ref:`asel` ) will be listed. If ``NA1`` = + P, graphical picking is enabled and all remaining arguments are ignored (valid only in the GUI). + A component name may be substituted in ``NA1`` ( ``NA2`` and ``NINC`` will be ignored). + + Notes + ----- + + .. _ADGL_notes: + + See the `Modeling and Meshing Guide + `_ for details on + parametric degeneracies. + + This command is valid in any processor. + """ + command = f"ADGL,{na1},{na2},{ninc}" + return self.run(command, **kwargs) + + def adrag( + self, + nl1: str = "", + nl2: str = "", + nl3: str = "", + nl4: str = "", + nl5: str = "", + nl6: str = "", + nlp1: str = "", + nlp2: str = "", + nlp3: str = "", + nlp4: str = "", + nlp5: str = "", + nlp6: str = "", + **kwargs, + ): + r"""Generates areas by dragging a line pattern along a path. + + Mechanical APDL Command: `ADRAG `_ + + Parameters + ---------- + nl1 : str + List of lines in the pattern to be dragged (6 maximum if using keyboard entry). Lines should + form a continuous pattern (no more than two lines connected to any one keypoint. If ``NL1`` = P, + graphical picking is enabled and all remaining arguments are ignored (valid only in the GUI). If + ``NL1`` = ALL, all selected lines (except those that define the drag path) will be swept along + the path. A component name may also be substituted for ``NL1``. + + nl2 : str + List of lines in the pattern to be dragged (6 maximum if using keyboard entry). Lines should + form a continuous pattern (no more than two lines connected to any one keypoint. If ``NL1`` = P, + graphical picking is enabled and all remaining arguments are ignored (valid only in the GUI). If + ``NL1`` = ALL, all selected lines (except those that define the drag path) will be swept along + the path. A component name may also be substituted for ``NL1``. + + nl3 : str + List of lines in the pattern to be dragged (6 maximum if using keyboard entry). Lines should + form a continuous pattern (no more than two lines connected to any one keypoint. If ``NL1`` = P, + graphical picking is enabled and all remaining arguments are ignored (valid only in the GUI). If + ``NL1`` = ALL, all selected lines (except those that define the drag path) will be swept along + the path. A component name may also be substituted for ``NL1``. + + nl4 : str + List of lines in the pattern to be dragged (6 maximum if using keyboard entry). Lines should + form a continuous pattern (no more than two lines connected to any one keypoint. If ``NL1`` = P, + graphical picking is enabled and all remaining arguments are ignored (valid only in the GUI). If + ``NL1`` = ALL, all selected lines (except those that define the drag path) will be swept along + the path. A component name may also be substituted for ``NL1``. + + nl5 : str + List of lines in the pattern to be dragged (6 maximum if using keyboard entry). Lines should + form a continuous pattern (no more than two lines connected to any one keypoint. If ``NL1`` = P, + graphical picking is enabled and all remaining arguments are ignored (valid only in the GUI). If + ``NL1`` = ALL, all selected lines (except those that define the drag path) will be swept along + the path. A component name may also be substituted for ``NL1``. + + nl6 : str + List of lines in the pattern to be dragged (6 maximum if using keyboard entry). Lines should + form a continuous pattern (no more than two lines connected to any one keypoint. If ``NL1`` = P, + graphical picking is enabled and all remaining arguments are ignored (valid only in the GUI). If + ``NL1`` = ALL, all selected lines (except those that define the drag path) will be swept along + the path. A component name may also be substituted for ``NL1``. + + 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. + + 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. + + 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. + + 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. + + 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. + + 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. + + Notes + ----- + + .. _ADRAG_notes: + + Generates areas (and their corresponding keypoints and lines) by sweeping a given line 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 line 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. + + Keypoint, line, and area numbers are automatically assigned, beginning with the lowest available + values ( :ref:`numstr` ). Adjacent lines use a common keypoint. Adjacent areas use a common line. + 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. + """ + command = f"ADRAG,{nl1},{nl2},{nl3},{nl4},{nl5},{nl6},{nlp1},{nlp2},{nlp3},{nlp4},{nlp5},{nlp6}" + return self.run(command, **kwargs) + + def afillt(self, na1: str = "", na2: str = "", rad: str = "", **kwargs): + r"""Generates a fillet at the intersection of two areas. + + Mechanical APDL Command: `AFILLT `_ + + Parameters + ---------- + na1 : str + Number of the first intersecting area. If ``NA1`` = P, graphical picking is enabled and all + remaining arguments are ignored (valid only in the GUI). + + na2 : str + Number of the second intersecting area. + + rad : str + Radius of fillet to be generated. + + Notes + ----- + + .. _AFILLT_notes: + + Generates an area of constant fillet radius at the intersection of two areas using a series of + Boolean operations. Corresponding lines and keypoints are also generated. See :ref:`boptn` command + for an explanation of the options available to Boolean operations. If areas do not initially + intersect at a common line, use the :ref:`aina` command. + """ + command = f"AFILLT,{na1},{na2},{rad}" + return self.run(command, **kwargs) + + def agen( + self, + itime: str = "", + na1: str = "", + na2: str = "", + ninc: str = "", + dx: str = "", + dy: str = "", + dz: str = "", + kinc: str = "", + noelem: int | str = "", + imove: int | str = "", + **kwargs, + ): + r"""Generates additional areas from a pattern of areas. + + Mechanical APDL Command: `AGEN `_ + + 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 more than 1 + for generation to occur. + + na1 : str + Generate areas from the pattern of areas ``NA1`` to ``NA2`` (defaults to ``NA1`` ) in steps of + ``NINC`` (defaults to 1). If ``NA1`` = ALL, ``NA2`` and ``NINC`` are ignored and the pattern is + all selected areas ( :ref:`asel` ). If ``NA1`` = P, graphical picking is enabled and all + remaining arguments are ignored (valid only in the GUI). A component name may also be + substituted for ``NA1`` ( ``NA2`` and ``NINC`` are ignored). + + na2 : str + Generate areas from the pattern of areas ``NA1`` to ``NA2`` (defaults to ``NA1`` ) in steps of + ``NINC`` (defaults to 1). If ``NA1`` = ALL, ``NA2`` and ``NINC`` are ignored and the pattern is + all selected areas ( :ref:`asel` ). If ``NA1`` = P, graphical picking is enabled and all + remaining arguments are ignored (valid only in the GUI). A component name may also be + substituted for ``NA1`` ( ``NA2`` and ``NINC`` are ignored). + + ninc : str + Generate areas from the pattern of areas ``NA1`` to ``NA2`` (defaults to ``NA1`` ) in steps of + ``NINC`` (defaults to 1). If ``NA1`` = ALL, ``NA2`` and ``NINC`` are ignored and the pattern is + all selected areas ( :ref:`asel` ). If ``NA1`` = P, graphical picking is enabled and all + remaining arguments are ignored (valid only in the GUI). A component name may also be + substituted for ``NA1`` ( ``NA2`` 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 number 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 areas, if they exist. + + * ``1`` - Do not generate nodes and elements. + + imove : int or str + Specifies whether to redefine the existing areas: + + * ``0`` - Generate new areas as requested with the ``ITIME`` argument. + + * ``1`` - Move original areas to new position, retaining the same keypoint numbers ( ``ITIME``, + ``KINC``, and ``NOELEM`` are ignored). If the original areas are needed in the original position + (for example, they may be attached to a volume), they are not moved, and new areas are generated + instead. Meshed items corresponding to moved areas are also moved if not needed at their original + position. + + Notes + ----- + + .. _AGEN_notes: + + Generates additional areas (and their corresponding keypoints, lines and mesh) from a given area + pattern. The MAT, TYPE, REAL, ESYS, and SECNUM attributes of the new areas are based upon the areas + 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. Generations which produce areas 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. Solid modeling in a toroidal + coordinate system is not recommended. Area and line numbers are automatically assigned, beginning + with the lowest available values ( :ref:`numstr` ). + """ + command = ( + f"AGEN,{itime},{na1},{na2},{ninc},{dx},{dy},{dz},{kinc},{noelem},{imove}" + ) + return self.run(command, **kwargs) + + def al( + self, + l1: str = "", + l2: str = "", + l3: str = "", + l4: str = "", + l5: str = "", + l6: str = "", + l7: str = "", + l8: str = "", + l9: str = "", + l10: str = "", + **kwargs, + ): + r"""Generates an area bounded by previously defined lines. + + Mechanical APDL Command: `AL `_ + + Parameters + ---------- + l1 : str + List of lines defining area. The minimum number of lines is 3. The positive normal of the area + is controlled by the direction of ``L1`` using the right-hand rule. A negative value of ``L1`` + reverses the normal direction. If ``L1`` = ALL, use all selected lines with ``L2`` defining the + normal ( ``L3`` to ``L10`` are ignored and ``L2`` defaults to the lowest numbered selected + line). If ``L1`` = P, graphical picking is enabled and all remaining arguments are ignored + (valid only in the GUI). A component name may also be substituted for ``L1``. + + l2 : str + List of lines defining area. The minimum number of lines is 3. The positive normal of the area + is controlled by the direction of ``L1`` using the right-hand rule. A negative value of ``L1`` + reverses the normal direction. If ``L1`` = ALL, use all selected lines with ``L2`` defining the + normal ( ``L3`` to ``L10`` are ignored and ``L2`` defaults to the lowest numbered selected + line). If ``L1`` = P, graphical picking is enabled and all remaining arguments are ignored + (valid only in the GUI). A component name may also be substituted for ``L1``. + + l3 : str + List of lines defining area. The minimum number of lines is 3. The positive normal of the area + is controlled by the direction of ``L1`` using the right-hand rule. A negative value of ``L1`` + reverses the normal direction. If ``L1`` = ALL, use all selected lines with ``L2`` defining the + normal ( ``L3`` to ``L10`` are ignored and ``L2`` defaults to the lowest numbered selected + line). If ``L1`` = P, graphical picking is enabled and all remaining arguments are ignored + (valid only in the GUI). A component name may also be substituted for ``L1``. + + l4 : str + List of lines defining area. The minimum number of lines is 3. The positive normal of the area + is controlled by the direction of ``L1`` using the right-hand rule. A negative value of ``L1`` + reverses the normal direction. If ``L1`` = ALL, use all selected lines with ``L2`` defining the + normal ( ``L3`` to ``L10`` are ignored and ``L2`` defaults to the lowest numbered selected + line). If ``L1`` = P, graphical picking is enabled and all remaining arguments are ignored + (valid only in the GUI). A component name may also be substituted for ``L1``. + + l5 : str + List of lines defining area. The minimum number of lines is 3. The positive normal of the area + is controlled by the direction of ``L1`` using the right-hand rule. A negative value of ``L1`` + reverses the normal direction. If ``L1`` = ALL, use all selected lines with ``L2`` defining the + normal ( ``L3`` to ``L10`` are ignored and ``L2`` defaults to the lowest numbered selected + line). If ``L1`` = P, graphical picking is enabled and all remaining arguments are ignored + (valid only in the GUI). A component name may also be substituted for ``L1``. + + l6 : str + List of lines defining area. The minimum number of lines is 3. The positive normal of the area + is controlled by the direction of ``L1`` using the right-hand rule. A negative value of ``L1`` + reverses the normal direction. If ``L1`` = ALL, use all selected lines with ``L2`` defining the + normal ( ``L3`` to ``L10`` are ignored and ``L2`` defaults to the lowest numbered selected + line). If ``L1`` = P, graphical picking is enabled and all remaining arguments are ignored + (valid only in the GUI). A component name may also be substituted for ``L1``. + + l7 : str + List of lines defining area. The minimum number of lines is 3. The positive normal of the area + is controlled by the direction of ``L1`` using the right-hand rule. A negative value of ``L1`` + reverses the normal direction. If ``L1`` = ALL, use all selected lines with ``L2`` defining the + normal ( ``L3`` to ``L10`` are ignored and ``L2`` defaults to the lowest numbered selected + line). If ``L1`` = P, graphical picking is enabled and all remaining arguments are ignored + (valid only in the GUI). A component name may also be substituted for ``L1``. + + l8 : str + List of lines defining area. The minimum number of lines is 3. The positive normal of the area + is controlled by the direction of ``L1`` using the right-hand rule. A negative value of ``L1`` + reverses the normal direction. If ``L1`` = ALL, use all selected lines with ``L2`` defining the + normal ( ``L3`` to ``L10`` are ignored and ``L2`` defaults to the lowest numbered selected + line). If ``L1`` = P, graphical picking is enabled and all remaining arguments are ignored + (valid only in the GUI). A component name may also be substituted for ``L1``. + + l9 : str + List of lines defining area. The minimum number of lines is 3. The positive normal of the area + is controlled by the direction of ``L1`` using the right-hand rule. A negative value of ``L1`` + reverses the normal direction. If ``L1`` = ALL, use all selected lines with ``L2`` defining the + normal ( ``L3`` to ``L10`` are ignored and ``L2`` defaults to the lowest numbered selected + line). If ``L1`` = P, graphical picking is enabled and all remaining arguments are ignored + (valid only in the GUI). A component name may also be substituted for ``L1``. + + l10 : str + List of lines defining area. The minimum number of lines is 3. The positive normal of the area + is controlled by the direction of ``L1`` using the right-hand rule. A negative value of ``L1`` + reverses the normal direction. If ``L1`` = ALL, use all selected lines with ``L2`` defining the + normal ( ``L3`` to ``L10`` are ignored and ``L2`` defaults to the lowest numbered selected + line). If ``L1`` = P, graphical picking is enabled and all remaining arguments are ignored + (valid only in the GUI). A component name may also be substituted for ``L1``. + + Returns + ------- + int + Area number of the generated area. + + Notes + ----- + + .. _AL_notes: + + Lines may be input (once each) in any order and must form a simply connected closed curve. If the + area is defined with more than four lines, the lines must also lie in the same plane or on a + constant coordinate value in the active coordinate system (such as a plane or a cylinder). Solid + modeling in a toroidal coordinate system is not recommended. Areas may be redefined only if not yet + attached to a volume. + + This command is valid in any processor. + + Examples + -------- + Create an area from four lines + + >>> k0 = mapdl.k("", 0, 0, 0) + >>> k1 = mapdl.k("", 1, 0, 0) + >>> k2 = mapdl.k("", 1, 1, 0) + >>> k3 = mapdl.k("", 0, 1, 0) + >>> l0 = mapdl.l(k0, k1) + >>> l1 = mapdl.l(k1, k2) + >>> l2 = mapdl.l(k2, k3) + >>> l3 = mapdl.l(k3, k0) + >>> anum = mapdl.al(l0, l1, l2, l3) + >>> anum + 1 + """ + command = f"AL,{l1},{l2},{l3},{l4},{l5},{l6},{l7},{l8},{l9},{l10}" + return parse.parse_a(self.run(command, **kwargs)) + + def alist( + self, na1: str = "", na2: str = "", ninc: str = "", lab: str = "", **kwargs + ): + r"""Lists the defined areas. + + Mechanical APDL Command: `ALIST `_ + + Parameters + ---------- + na1 : str + List areas from ``NA1`` to ``NA2`` (defaults to ``NA1`` ) in steps of ``NINC`` (defaults to 1). + If ``NA1`` = ALL (default), ``NA2`` and ``NINC`` are ignored and all selected areas ( + :ref:`asel` ) are listed. If ``NA1`` = P, graphical picking is enabled and all remaining + arguments are ignored (valid only in the GUI). A component name may also be substituted for + ``NA1`` ( ``NA2`` and ``NINC`` are ignored). + + na2 : str + List areas from ``NA1`` to ``NA2`` (defaults to ``NA1`` ) in steps of ``NINC`` (defaults to 1). + If ``NA1`` = ALL (default), ``NA2`` and ``NINC`` are ignored and all selected areas ( + :ref:`asel` ) are listed. If ``NA1`` = P, graphical picking is enabled and all remaining + arguments are ignored (valid only in the GUI). A component name may also be substituted for + ``NA1`` ( ``NA2`` and ``NINC`` are ignored). + + ninc : str + List areas from ``NA1`` to ``NA2`` (defaults to ``NA1`` ) in steps of ``NINC`` (defaults to 1). + If ``NA1`` = ALL (default), ``NA2`` and ``NINC`` are ignored and all selected areas ( + :ref:`asel` ) are listed. If ``NA1`` = P, graphical picking is enabled and all remaining + arguments are ignored (valid only in the GUI). A component name may also be substituted for + ``NA1`` ( ``NA2`` and ``NINC`` are ignored). + + lab : str + Determines what type of listing is used (one of the following): + + * ``(blank)`` - Prints information about all areas in the specified range. + + * ``HPT`` - Prints information about only those areas that contain hard points. + + Notes + ----- + + .. _ALIST_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:`aatt` 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 ( :ref:`type`, :ref:`mat`, :ref:`real`, or :ref:`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 area has been meshed but there are no interior nodes. The area size is + listed only if an :ref:`asum` command has been performed on the area. + """ + command = f"ALIST,{na1},{na2},{ninc},{lab}" + return self.run(command, **kwargs) + + def anorm(self, anum: str = "", noeflip: int | str = "", **kwargs): + r"""Reorients area normals. + + Mechanical APDL Command: `ANORM `_ + + Parameters + ---------- + anum : str + Area number having the normal direction that the reoriented areas are to match. + + noeflip : int or str + Indicates whether you want to change the normal direction of the existing elements on the reoriented + area(s) so that they are consistent with each area's new normal direction. + + * ``0`` - Make the normal direction of existing elements on the reoriented area(s) consistent with + each area's new normal direction (default). + + * ``1`` - Do not change the normal direction of existing elements on the reoriented area(s). + + Notes + ----- + + .. _ANORM_notes: + + Reorients areas so that their normals are consistent with that of a specified area. + + If any of the areas have inner loops, the :ref:`anorm` command will consider the inner loops when it + reorients the area normals. + + You cannot use the :ref:`anorm` command to change the normal direction of any element that has a + body or surface load. We recommend that you apply all of your loads only after ensuring that the + element normal directions are acceptable. + + Real constants (such as nonuniform shell thickness and tapered beam constants) may be invalidated by + an element reversal. + + See `Revising Your Model + `_ of the + `Modeling and Meshing Guide + `_ for more + information. + """ + command = f"ANORM,{anum},{noeflip}" + return self.run(command, **kwargs) + + def aoffst(self, narea: str = "", dist: str = "", kinc: str = "", **kwargs): + r"""Generates an area, offset from a given area. + + Mechanical APDL Command: `AOFFST `_ + + Parameters + ---------- + narea : str + Area from which generated area is to be offset. If ``NAREA`` = ALL, offset from all selected + areas ( :ref:`asel` ). If ``NAREA`` = P, graphical picking is enabled and all remaining + arguments are ignored (valid only in the GUI). + + dist : str + Distance normal to given area at which keypoints for generated area are to be located. Positive + normal is determined from the right-hand-rule keypoint order. + + kinc : str + Keypoint increment between areas. If zero, the lowest available keypoint numbers are assigned ( + :ref:`numstr` ). + + Notes + ----- + + .. _AOFFST_notes: + + Generates an area (and its corresponding keypoints and lines) offset from a given 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. Area and line numbers are automatically assigned, beginning + with the lowest available values ( :ref:`numstr` ). + """ + command = f"AOFFST,{narea},{dist},{kinc}" + return self.run(command, **kwargs) + + def aplot( + self, + na1: str = "", + na2: str = "", + ninc: str = "", + degen: str = "", + scale: str = "", + **kwargs, + ): + r"""Displays the selected areas. + + Mechanical APDL Command: `APLOT `_ + + Parameters + ---------- + na1 : str + Displays areas from ``NA1`` to ``NA2`` (defaults to ``NA1`` ) in steps of ``NINC`` (defaults to + 1). If ``NA1`` = ALL (default), ``NA2`` and ``NINC`` are ignored and all selected areas ( + :ref:`asel` ) are displayed. + + na2 : str + Displays areas from ``NA1`` to ``NA2`` (defaults to ``NA1`` ) in steps of ``NINC`` (defaults to + 1). If ``NA1`` = ALL (default), ``NA2`` and ``NINC`` are ignored and all selected areas ( + :ref:`asel` ) are displayed. + + ninc : str + Displays areas from ``NA1`` to ``NA2`` (defaults to ``NA1`` ) in steps of ``NINC`` (defaults to + 1). If ``NA1`` = ALL (default), ``NA2`` and ``NINC`` are ignored and all selected areas ( + :ref:`asel` ) 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 + ----- + + .. _APLOT_notes: + + This command is valid in any processor. The degree of tessellation used to plot the selected areas + is set through the :ref:`facet` command. + """ + command = f"APLOT,{na1},{na2},{ninc},{degen},{scale}" + return self.run(command, **kwargs) + + def areverse(self, anum: str = "", noeflip: int | str = "", **kwargs): + r"""Reverses the normal of an area, regardless of its connectivity or mesh status. + + Mechanical APDL Command: `AREVERSE `_ + + Parameters + ---------- + anum : str + Area number of the area whose normal is to be reversed. If ``ANUM`` = ALL, the normals of all + selected areas will be reversed. If ``ANUM`` = P, graphical picking is enabled. A component name + may also be substituted for ``ANUM``. + + noeflip : int or str + Indicates whether you want to change the normal direction of the existing elements on the reversed + area(s) so that they are consistent with each area's new normal direction. + + * ``0`` - Make the normal direction of existing elements on the reversed area(s) consistent with + each area's new normal direction (default). + + * ``1`` - Do not change the normal direction of existing elements on the reversed area(s). + + Notes + ----- + + .. _AREVERSE_notes: + + You cannot use the :ref:`areverse` command to change the normal direction of any element that has a + body or surface load. We recommend that you apply all of your loads only after ensuring that the + element normal directions are acceptable. Also, you cannot use this command to change the normal + direction for areas attached to volumes because IGES and ANF data is unchanged by reversal. Reversed + areas that are attached to volumes need to be reversed again when imported. + + Real constants (such as nonuniform shell thickness and tapered beam constants) may be invalidated by + an element reversal. + + See `Revising Your Model + `_ in the + `Modeling and Meshing Guide + `_ + for more information. + """ + command = f"AREVERSE,{anum},{noeflip}" + return self.run(command, **kwargs) + + def arotat( + self, + nl1: str = "", + nl2: str = "", + nl3: str = "", + nl4: str = "", + nl5: str = "", + nl6: str = "", + pax1: str = "", + pax2: str = "", + arc: str = "", + nseg: str = "", + **kwargs, + ): + r"""Generates cylindrical areas by rotating a line pattern about an axis. + + Mechanical APDL Command: `AROTAT `_ + + Parameters + ---------- + nl1 : str + List of lines in the pattern to be rotated (6 maximum if using keyboard entry of ``NL1`` to + ``NL6`` ). The lines must lie in the plane of the axis of rotation. If ``NL1`` = P, graphical + picking is enabled and all remaining arguments are ignored (valid only in the GUI). If ``NL1`` = + ALL, all selected lines will define the pattern to be rotated. A component name may also be + substituted for ``NL1``. + + nl2 : str + List of lines in the pattern to be rotated (6 maximum if using keyboard entry of ``NL1`` to + ``NL6`` ). The lines must lie in the plane of the axis of rotation. If ``NL1`` = P, graphical + picking is enabled and all remaining arguments are ignored (valid only in the GUI). If ``NL1`` = + ALL, all selected lines will define the pattern to be rotated. A component name may also be + substituted for ``NL1``. + + nl3 : str + List of lines in the pattern to be rotated (6 maximum if using keyboard entry of ``NL1`` to + ``NL6`` ). The lines must lie in the plane of the axis of rotation. If ``NL1`` = P, graphical + picking is enabled and all remaining arguments are ignored (valid only in the GUI). If ``NL1`` = + ALL, all selected lines will define the pattern to be rotated. A component name may also be + substituted for ``NL1``. + + nl4 : str + List of lines in the pattern to be rotated (6 maximum if using keyboard entry of ``NL1`` to + ``NL6`` ). The lines must lie in the plane of the axis of rotation. If ``NL1`` = P, graphical + picking is enabled and all remaining arguments are ignored (valid only in the GUI). If ``NL1`` = + ALL, all selected lines will define the pattern to be rotated. A component name may also be + substituted for ``NL1``. + + nl5 : str + List of lines in the pattern to be rotated (6 maximum if using keyboard entry of ``NL1`` to + ``NL6`` ). The lines must lie in the plane of the axis of rotation. If ``NL1`` = P, graphical + picking is enabled and all remaining arguments are ignored (valid only in the GUI). If ``NL1`` = + ALL, all selected lines will define the pattern to be rotated. A component name may also be + substituted for ``NL1``. + + nl6 : str + List of lines in the pattern to be rotated (6 maximum if using keyboard entry of ``NL1`` to + ``NL6`` ). The lines must lie in the plane of the axis of rotation. If ``NL1`` = P, graphical + picking is enabled and all remaining arguments are ignored (valid only in the GUI). If ``NL1`` = + ALL, all selected lines will define the pattern to be rotated. A component name may also be + substituted for ``NL1``. + + pax1 : str + Keypoints defining the axis about which the line pattern is to be rotated. + + pax2 : str + Keypoints defining the axis about which the line 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 areas (8 maximum) around circumference. Defaults to minimum number required for 90° + -maximum arcs, that is, 4 for 360°, 3 for 270°, etc. + + Notes + ----- + + .. _AROTAT_notes: + + Generates cylindrical areas (and their corresponding keypoints and lines) by rotating a line pattern + (and its associated keypoint pattern) 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, + and area numbers are automatically assigned, beginning with the lowest available values ( + :ref:`numstr` ). Adjacent lines use a common keypoint. Adjacent areas use a common line. + """ + command = ( + f"AROTAT,{nl1},{nl2},{nl3},{nl4},{nl5},{nl6},{pax1},{pax2},{arc},{nseg}" + ) + return self.run(command, **kwargs) + + def arscale( + self, + na1: str = "", + na2: str = "", + ninc: str = "", + rx: str = "", + ry: str = "", + rz: str = "", + kinc: str = "", + noelem: int | str = "", + imove: int | str = "", + **kwargs, + ): + r"""Generates a scaled set of areas from a pattern of areas. + + Mechanical APDL Command: `ARSCALE `_ + + Parameters + ---------- + na1 : str + Set of areas, ``NA1`` to ``NA2`` in steps of ``NINC``, that defines the pattern to be scaled. + ``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 arguments 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 scaled. + ``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 arguments 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 scaled. + ``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 arguments are ignored (valid only in the GUI). A component name may + also be substituted for ``NA1`` ( ``NA2`` and ``NINC`` are ignored). + + 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. + + 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 areas will be generated (scaled) if they + exist. + + * ``1`` - Nodes and elements will not be generated. + + imove : int or str + Specifies whether areas will be moved or newly defined: + + * ``0`` - Additional areas will be generated. + + * ``1`` - Original areas will be moved to new position ( ``KINC`` and ``NOELEM`` are ignored). Use + only if the old areas are no longer needed at their original positions. Corresponding meshed items + are also moved if not needed at their original position. + + Notes + ----- + + .. _ARSCALE_notes: + + Generates a scaled set of areas (and their corresponding keypoints, lines, and mesh) from a pattern + of areas. The MAT, TYPE, REAL, and ESYS attributes are based on the areas in the pattern and not the + current settings. Scaling is done in the active coordinate system. Areas in the pattern could have + been generated in any coordinate system. However, solid modeling in a toroidal coordinate system is + not recommended. + """ + command = f"ARSCALE,{na1},{na2},{ninc},{rx},{ry},{rz},{kinc},{noelem},{imove}" + return self.run(command, **kwargs) + + def arsym( + self, + ncomp: str = "", + na1: str = "", + na2: str = "", + ninc: str = "", + kinc: str = "", + noelem: int | str = "", + imove: int | str = "", + **kwargs, + ): + r"""Generates areas from an area pattern by symmetry reflection. + + Mechanical APDL Command: `ARSYM `_ + + Parameters + ---------- + ncomp : str + Symmetry key: + + * ``X`` - X symmetry (default). + + * ``Y`` - Y symmetry. + + * ``Z`` - Z symmetry. + + na1 : str + Reflect areas from pattern beginning with ``NA1`` to ``NA2`` (defaults to ``NA1`` ) in steps of + ``NINC`` (defaults to 1). If ``NA1`` = ALL, ``NA2`` and ``NINC`` are ignored and the pattern is + all selected areas ( :ref:`asel` ). If ``Ncomp`` = P, use graphical picking to specify areas and + ignore ``NL2`` and ``NINC``. A component name may also be substituted for ``NA1`` ( ``NA2`` and + ``NINC`` are ignored). + + na2 : str + Reflect areas from pattern beginning with ``NA1`` to ``NA2`` (defaults to ``NA1`` ) in steps of + ``NINC`` (defaults to 1). If ``NA1`` = ALL, ``NA2`` and ``NINC`` are ignored and the pattern is + all selected areas ( :ref:`asel` ). If ``Ncomp`` = P, use graphical picking to specify areas and + ignore ``NL2`` and ``NINC``. A component name may also be substituted for ``NA1`` ( ``NA2`` and + ``NINC`` are ignored). + + ninc : str + Reflect areas from pattern beginning with ``NA1`` to ``NA2`` (defaults to ``NA1`` ) in steps of + ``NINC`` (defaults to 1). If ``NA1`` = ALL, ``NA2`` and ``NINC`` are ignored and the pattern is + all selected areas ( :ref:`asel` ). If ``Ncomp`` = P, use graphical picking to specify areas and + ignore ``NL2`` and ``NINC``. A component name may also be substituted for ``NA1`` ( ``NA2`` 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 areas, if they exist. + + * ``1`` - Do not generate nodes and elements. + + imove : int or str + Specifies whether areas will be moved or newly defined: + + * ``0`` - Generate additional areas. + + * ``1`` - Move original areas to new position retaining the same keypoint numbers ( ``KINC`` and + ``NOELEM`` are ignored). Valid only if the old areas are no longer needed at their original + positions. Corresponding meshed items are also moved if not needed at their original position. + + Notes + ----- + + .. _ARSYM_notes: + + Generates a reflected set of areas (and their corresponding keypoints, lines and mesh) from a given + area pattern by a symmetry reflection (see analogous node symmetry command, :ref:`nsym` ). The MAT, + TYPE, REAL, ESYS, and SECNUM attributes are based upon the areas 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. Areas in the pattern may + have been generated in any coordinate system. However, solid modeling in a toroidal coordinate + system is not recommended. Areas are generated as described in the :ref:`agen` command. + + See the :ref:`esym` command for additional information about symmetry elements. + """ + command = f"ARSYM,{ncomp},{na1},{na2},{ninc},{kinc},{noelem},{imove}" + return self.run(command, **kwargs) + + def askin( + self, + nl1: str = "", + nl2: str = "", + nl3: str = "", + nl4: str = "", + nl5: str = "", + nl6: str = "", + nl7: str = "", + nl8: str = "", + nl9: str = "", + **kwargs, + ): + r"""Generates an area by "skinning" a surface through guiding lines. + + Mechanical APDL Command: `ASKIN `_ + + Parameters + ---------- + nl1 : str + The additional guiding lines for the skinned area (up to 9 total lines, including ``NL1``, if + using keyboard entry). If negative (and ``NL1`` is negative), the line beginning and end will be + temporarily interchanged for the skinning operation (see :ref:`ASKIN_extranote1` below). + + nl2 : str + The additional guiding lines for the skinned area (up to 9 total lines, including ``NL1``, if + using keyboard entry). If negative (and ``NL1`` is negative), the line beginning and end will be + temporarily interchanged for the skinning operation (see :ref:`ASKIN_extranote1` below). + + nl3 : str + The additional guiding lines for the skinned area (up to 9 total lines, including ``NL1``, if + using keyboard entry). If negative (and ``NL1`` is negative), the line beginning and end will be + temporarily interchanged for the skinning operation (see :ref:`ASKIN_extranote1` below). + + nl4 : str + The additional guiding lines for the skinned area (up to 9 total lines, including ``NL1``, if + using keyboard entry). If negative (and ``NL1`` is negative), the line beginning and end will be + temporarily interchanged for the skinning operation (see :ref:`ASKIN_extranote1` below). + + nl5 : str + The additional guiding lines for the skinned area (up to 9 total lines, including ``NL1``, if + using keyboard entry). If negative (and ``NL1`` is negative), the line beginning and end will be + temporarily interchanged for the skinning operation (see :ref:`ASKIN_extranote1` below). + + nl6 : str + The additional guiding lines for the skinned area (up to 9 total lines, including ``NL1``, if + using keyboard entry). If negative (and ``NL1`` is negative), the line beginning and end will be + temporarily interchanged for the skinning operation (see :ref:`ASKIN_extranote1` below). + + nl7 : str + The additional guiding lines for the skinned area (up to 9 total lines, including ``NL1``, if + using keyboard entry). If negative (and ``NL1`` is negative), the line beginning and end will be + temporarily interchanged for the skinning operation (see :ref:`ASKIN_extranote1` below). + + nl8 : str + The additional guiding lines for the skinned area (up to 9 total lines, including ``NL1``, if + using keyboard entry). If negative (and ``NL1`` is negative), the line beginning and end will be + temporarily interchanged for the skinning operation (see :ref:`ASKIN_extranote1` below). + + nl9 : str + The additional guiding lines for the skinned area (up to 9 total lines, including ``NL1``, if + using keyboard entry). If negative (and ``NL1`` is negative), the line beginning and end will be + temporarily interchanged for the skinning operation (see :ref:`ASKIN_extranote1` below). + + Notes + ----- + + .. _ASKIN_notes: + + Generates an area by "skinning" a surface through specified guiding lines. The lines act as a set of + "ribs" over which a surface is "stretched." Two opposite edges of the area are framed by the first ( + ``NL1`` ) and last ( NLn ) guiding lines specified. The other two edges of the area are framed by + splines-fit lines which the program automatically generates through the ends of all guiding lines. + The interior of the area is shaped by the interior guiding lines. Once the area has been created, + only the four edge lines will be attached to it. In rare cases, it may be necessary to change the + default algorithm used by the :ref:`askin` command (see :ref:`ASKIN_extranote1` below). + + .. _ASKIN_extranote1: + + When skinning from one guiding line to the next, the program can create the transition area in one + of two ways: one more spiraled and one less spiraled ("flatter"). By default, the program attempts + to produce the flatter transition, instead of the more spiraled transition. This algorithm can be + changed by inputting ``NL1`` as a negative number, in which case the program connects all the + keypoints at the line "beginnings" ( :ref:`psymb`,LDIR command) as one edge of the area, and all the + line "ends" as the opposite edge, irrespective of the amount of spiraling produced in each + transition area. + + To further control the geometry of the area (if ``NL1`` is negative), the beginning and end of any + specified line (other than ``NL1`` ) can be temporarily interchanged (for the skinning operation + only) by inputting that line number as negative. See `Solid Modeling + `_ in the + `Modeling and Meshing Guide + `_ for an + illustration. + """ + command = f"ASKIN,{nl1},{nl2},{nl3},{nl4},{nl5},{nl6},{nl7},{nl8},{nl9}" + return self.run(command, **kwargs) + + def asub( + self, + na1: str = "", + p1: str = "", + p2: str = "", + p3: str = "", + p4: str = "", + **kwargs, + ): + r"""Generates an area using the shape of an existing area. + + Mechanical APDL Command: `ASUB `_ + + Parameters + ---------- + na1 : str + Existing area number whose shape is to be used. If ``P1`` = P, graphical picking is enabled and + all remaining arguments are ignored (valid only in the GUI). + + p1 : str + Keypoint defining starting corner of area. + + p2 : str + Keypoint defining second corner of area. + + p3 : str + Keypoint defining third corner of area. + + p4 : str + Keypoint defining fourth corner of area (defaults to ``P3`` ). + + Notes + ----- + + .. _ASUB_notes: + + The new area will overlay the old area. Often used when the area to be subdivided consists of a + complex shape that was not generated in a single coordinate system. Keypoints and any corresponding + lines must lie on the existing area. Missing lines are generated to lie on the given area. The + active coordinate system is ignored. + """ + command = f"ASUB,{na1},{p1},{p2},{p3},{p4}" + return self.run(command, **kwargs) + + def asum(self, lab: str = "", **kwargs): + r"""Calculates and prints geometry statistics of the selected areas. + + Mechanical APDL Command: `ASUM `_ + + 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 + ----- + + .. _ASUM_notes: + + Calculates and prints geometry statistics (area, centroid location, moments of inertia, volume, + etc.) associated with the selected areas. :ref:`asum` should only be used on perfectly flat areas. + + Geometry items are reported in the global Cartesian coordinate system. A unit thickness is assumed + unless the areas have a non-zero total thickness defined by real constant or section data. + + For layered areas, a unit density is always assumed. For single-layer areas, a unit density is + assumed unless the areas have a valid material (density). + + The thickness and density are associated to the areas via the :ref:`aatt` command. + + Items calculated via :ref:`asum` and later retrieved via a :ref:`get` or :ref:`starvget` command are + valid only if the model is not modified after issuing the :ref:`asum` command. + + 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 narrow (sliver) areas, such that the ratio of the minimum to the maximum dimension is less + than 0.01, the :ref:`asum` command can provide erroneous area information. To ensure that the + calculations are accurate, subdivide such areas so that the ratio of the minimum to the maximum is + at least 0.05. + """ + command = f"ASUM,{lab}" + return self.run(command, **kwargs) + + def atran( + self, + kcnto: str = "", + na1: str = "", + na2: str = "", + ninc: str = "", + kinc: str = "", + noelem: int | str = "", + imove: int | str = "", + **kwargs, + ): + r"""Transfers a pattern of areas to another coordinate system. + + Mechanical APDL Command: `ATRAN `_ + + 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. + + na1 : str + Transfer area pattern beginning with ``NA1`` to ``NA2`` (defaults to ``NA1`` ) in steps of + ``NINC`` (defaults to 1). If ``NA1`` = ALL, ``NA2`` and ``NINC`` are ignored and the pattern is + all selected areas ( :ref:`asel` ). If ``NA1`` = P, graphical picking is enabled and all + remaining arguments are ignored (valid only in the GUI). A component name may also be + substituted for ``NA1`` ( ``NA2`` and ``NINC`` are ignored). + + na2 : str + Transfer area pattern beginning with ``NA1`` to ``NA2`` (defaults to ``NA1`` ) in steps of + ``NINC`` (defaults to 1). If ``NA1`` = ALL, ``NA2`` and ``NINC`` are ignored and the pattern is + all selected areas ( :ref:`asel` ). If ``NA1`` = P, graphical picking is enabled and all + remaining arguments are ignored (valid only in the GUI). A component name may also be + substituted for ``NA1`` ( ``NA2`` and ``NINC`` are ignored). + + ninc : str + Transfer area pattern beginning with ``NA1`` to ``NA2`` (defaults to ``NA1`` ) in steps of + ``NINC`` (defaults to 1). If ``NA1`` = ALL, ``NA2`` and ``NINC`` are ignored and the pattern is + all selected areas ( :ref:`asel` ). If ``NA1`` = P, graphical picking is enabled and all + remaining arguments are ignored (valid only in the GUI). A component name may also be + substituted for ``NA1`` ( ``NA2`` 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 areas, if they exist. + + * ``1`` - Do not generate nodes and elements. + + imove : int or str + Specifies whether to redefine the existing areas: + + * ``0`` - Generate additional areas. + + * ``1`` - Move original areas to new position retaining the same keypoint numbers ( ``KINC`` and + ``NOELEM`` are ignored). Valid only if the old areas are no longer needed at their original + positions. Corresponding meshed items are also moved if not needed at their original position. + + Notes + ----- + + .. _ATRAN_notes: + + Transfers a pattern of areas (and their corresponding lines, keypoints and mesh) from one coordinate + system to another (see analogous node :ref:`transfer` command). The MAT, TYPE, REAL, and ESYS + attributes are based upon the areas 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. Areas are generated as described in the :ref:`agen` command. + """ + command = f"ATRAN,{kcnto},{na1},{na2},{ninc},{kinc},{noelem},{imove}" + return self.run(command, **kwargs) + + def splot( + self, na1: str = "", na2: str = "", ninc: str = "", mesh: str = "", **kwargs + ): + r"""Displays the selected areas and a faceted view of their underlying surfaces + + Mechanical APDL Command: `SPLOT `_ + + Parameters + ---------- + na1 : str + Starting area for display of areas and underlying surfaces. If ``NA1`` = ALL (default), ``NA2`` + and ``NINC`` are ignored and all selected areas are displayed ( :ref:`asel` command). + + na2 : str + Last area to be displayed. + + ninc : str + Numeric value setting steps between NA1 and NA2 for display. Default value is (1). + + mesh : str + Specifies a rectangular mesh density used to display the underlying surface (default 4, i.e. 4 x + 4). + + Notes + ----- + + .. _SPLOT_notes: + + This command is valid in any processor. The plot output displays the external and internal trim + curves and underlying surface. You cannot obtain a faceted view of your surface areas when you are + using the :ref:`slashexpand` command to create larger graphics displays. + + Use :ref:`aplot` for trimmed surface display. + """ + command = f"SPLOT,{na1},{na2},{ninc},{mesh}" + return self.run(command, **kwargs) diff --git a/src/ansys/mapdl/core/_commands/prep7/artificially_matched_layers.py b/src/ansys/mapdl/core/_commands/prep7/artificially_matched_layers.py new file mode 100644 index 00000000000..70297c20f8b --- /dev/null +++ b/src/ansys/mapdl/core/_commands/prep7/artificially_matched_layers.py @@ -0,0 +1,321 @@ +# 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 ArtificiallyMatchedLayers: + + def pmlopt( + self, + psys: str = "", + lab: str = "", + xminus: str = "", + xplus: str = "", + yminus: str = "", + yplus: str = "", + zminus: str = "", + zplus: str = "", + woptxm: str = "", + woptxp: str = "", + woptym: str = "", + woptyp: str = "", + woptzm: str = "", + woptzp: str = "", + **kwargs, + ): + r"""Defines perfectly matched layers (PMLs) or irregular perfectly matched layers (IPML). + + Mechanical APDL Command: `PMLOPT `_ + + Parameters + ---------- + psys : str + PML element coordinate system number. ``PSYS`` may be 0 (global Cartesian) or any previously + defined local Cartesian coordinate system number (>10). Defaults to 0. (Not used for IPML.) + + lab : str + Label defining the number of dimensions (not used for IPML) : + + * ``ONE`` - A one-dimensional PML region. + + * ``THREE`` - A three-dimensional PML region (default). + + xminus : str + For PML, normal reflection coefficient (harmonic analysis) or attenuation factor (static + structural analysis) in negative X direction of ``PSYS``. Defaults to 1.E-3 (equivalent to -60 + dB) for ``WOptXm`` = PROP or HYBR, 30 for ``WOptXm`` = EVAN, and 40 for ``WOptXm`` = MAXP. + + xplus : str + Normal reflection coefficient (harmonic analysis) or attenuation factor (static structural + analysis) in positive X direction of ``PSYS``. Defaults to 1.E-3 (equivalent to -60 dB) for + ``WOptXp`` = PROP or HYBR, 30 for ``WOptXp`` = EVAN, and 40 for ``WOptXp`` = MAXP. (Not used for + IPML.) + + yminus : str + Normal reflection coefficient (harmonic analysis) or attenuation factor (static structural + analysis) in negative Y direction of ``PSYS``. Defaults to 1.E-3 (equivalent to -60 dB) for + ``WOptYm`` = PROP or HYBR, 30 for ``WOptYm`` = EVAN, and 40 for ``WOptYm`` = MAXP. (Not used for + IPML.) + + yplus : str + Normal reflection coefficient (harmonic analysis) or attenuation factor (static structural + analysis) in positive Y direction of ``PSYS``. Defaults to 1.E-3 (equivalent to -60 dB) for + ``WOptYp`` = PROP or HYBR, 30 for ``WOptYp`` = EVAN, and 40 for ``WOptYp`` = MAXP. (Not used for + IPML.) + + zminus : str + Normal reflection coefficient (harmonic analysis) or attenuation factor (static structural + analysis) in negative Z direction of ``PSYS``. Defaults to 1.E-3 (equivalent to -60 dB) for + ``WOptZm`` = PROP or HYBR, 30 for ``WOptZm`` = EVAN, and 40 for ``WOptZm`` = MAXP. (Not used for + IPML.) + + zplus : str + Normal reflection coefficient (harmonic analysis) or attenuation factor (static structural + analysis) in positive Z direction of ``PSYS``. Defaults to 1.E-3 (equivalent to -60 dB) for + ``WOptZp`` = PROP or HYBR, 30 for ``WOptZp`` = EVAN, and 40 for ``WOptZp`` = MAXP. (Not used for + IPML.) + + woptxm : str + Type of attenuated wave in the PML region in each direction: + + * ``PROP`` - Only the propagating wave is attenuated. The PML parameter is set to s = 1-jβ in + harmonic analyses and acoustic transient analyses. + + * ``EVAN`` - Only the evanescent field is attenuated. The PML parameter is set to s = α ( α > 1) in + static analyses. + + * ``HYBR`` - Both the propagating wave and the evanescent wave are attenuated (default). The PML + parameter is set to s = α -jβ ( α > 1). The program sets the coefficient α values in terms of the + normal reflection coefficients in harmonic analyses. + + * ``MAXP`` - The maximum attenuation coefficient for frequency-independent PML parameter in harmonic + analyses, acoustic modal analyses, and acoustic transient analyses. + + woptxp : str + Type of attenuated wave in the PML region in each direction: + + * ``PROP`` - Only the propagating wave is attenuated. The PML parameter is set to s = 1-jβ in + harmonic analyses and acoustic transient analyses. + + * ``EVAN`` - Only the evanescent field is attenuated. The PML parameter is set to s = α ( α > 1) in + static analyses. + + * ``HYBR`` - Both the propagating wave and the evanescent wave are attenuated (default). The PML + parameter is set to s = α -jβ ( α > 1). The program sets the coefficient α values in terms of the + normal reflection coefficients in harmonic analyses. + + * ``MAXP`` - The maximum attenuation coefficient for frequency-independent PML parameter in harmonic + analyses, acoustic modal analyses, and acoustic transient analyses. + + woptym : str + Type of attenuated wave in the PML region in each direction: + + * ``PROP`` - Only the propagating wave is attenuated. The PML parameter is set to s = 1-jβ in + harmonic analyses and acoustic transient analyses. + + * ``EVAN`` - Only the evanescent field is attenuated. The PML parameter is set to s = α ( α > 1) in + static analyses. + + * ``HYBR`` - Both the propagating wave and the evanescent wave are attenuated (default). The PML + parameter is set to s = α -jβ ( α > 1). The program sets the coefficient α values in terms of the + normal reflection coefficients in harmonic analyses. + + * ``MAXP`` - The maximum attenuation coefficient for frequency-independent PML parameter in harmonic + analyses, acoustic modal analyses, and acoustic transient analyses. + + woptyp : str + Type of attenuated wave in the PML region in each direction: + + * ``PROP`` - Only the propagating wave is attenuated. The PML parameter is set to s = 1-jβ in + harmonic analyses and acoustic transient analyses. + + * ``EVAN`` - Only the evanescent field is attenuated. The PML parameter is set to s = α ( α > 1) in + static analyses. + + * ``HYBR`` - Both the propagating wave and the evanescent wave are attenuated (default). The PML + parameter is set to s = α -jβ ( α > 1). The program sets the coefficient α values in terms of the + normal reflection coefficients in harmonic analyses. + + * ``MAXP`` - The maximum attenuation coefficient for frequency-independent PML parameter in harmonic + analyses, acoustic modal analyses, and acoustic transient analyses. + + woptzm : str + Type of attenuated wave in the PML region in each direction: + + * ``PROP`` - Only the propagating wave is attenuated. The PML parameter is set to s = 1-jβ in + harmonic analyses and acoustic transient analyses. + + * ``EVAN`` - Only the evanescent field is attenuated. The PML parameter is set to s = α ( α > 1) in + static analyses. + + * ``HYBR`` - Both the propagating wave and the evanescent wave are attenuated (default). The PML + parameter is set to s = α -jβ ( α > 1). The program sets the coefficient α values in terms of the + normal reflection coefficients in harmonic analyses. + + * ``MAXP`` - The maximum attenuation coefficient for frequency-independent PML parameter in harmonic + analyses, acoustic modal analyses, and acoustic transient analyses. + + woptzp : str + Type of attenuated wave in the PML region in each direction: + + * ``PROP`` - Only the propagating wave is attenuated. The PML parameter is set to s = 1-jβ in + harmonic analyses and acoustic transient analyses. + + * ``EVAN`` - Only the evanescent field is attenuated. The PML parameter is set to s = α ( α > 1) in + static analyses. + + * ``HYBR`` - Both the propagating wave and the evanescent wave are attenuated (default). The PML + parameter is set to s = α -jβ ( α > 1). The program sets the coefficient α values in terms of the + normal reflection coefficients in harmonic analyses. + + * ``MAXP`` - The maximum attenuation coefficient for frequency-independent PML parameter in harmonic + analyses, acoustic modal analyses, and acoustic transient analyses. + + Notes + ----- + + .. _PMLOPT_notes: + + The :ref:`pmlopt` command can be used to define perfectly matched layers (PML). The following + element types support perfectly matched layers: + + * Acoustic elements: ``FLUID30``, ``FLUID220``, and ``FLUID221`` (KEYOPT(4) > 0) in a modal, + harmonic, or transient acoustic analysis. + + * Piezoelectric coupled-field elements: ``PLANE222``, ``PLANE223``, ``SOLID225``, ``SOLID226``, and + ``SOLID227`` (KEYOPT(15) = 1) in a harmonic piezoelectric analysis. For the lower order elements ( + ``PLANE222`` and ``SOLID225`` ), PML is only supported with the B-bar method. + + * Structural elements: ``PLANE182``, ``PLANE183``, ``SOLID185``, ``SOLID186``, and ``SOLID187`` + (KEYOPT(15) = 1) in a linear static or harmonic structural analysis. For the lower order elements + ( ``PLANE182`` and ``SOLID185`` ), PML is only supported with the B-bar method. + + Each PML region must have a uniquely defined PML element coordinate system ( :ref:`psys` ). Normal + reflection coefficient values for a harmonic analysis must be less than 1. + + The :ref:`pmlopt` command can also be used to define irregular perfectly matched layers (IPML) for + acoustic analyses. Normal reflection coefficient values for a harmonic analysis must be less than 1. + + Issue :ref:`pmlopt`,STAT to list the current normal reflection coefficient or attenuation factor + settings for a PML or IPML region. Issue :ref:`pmlopt`,CLEAR to clear all normal reflection + coefficient settings and restore them to the defaults. + + Issue :ref:`pmlopt`,PSYS,CLEAR to clear all normal reflection coefficient settings for the specified + PML element coordinate system and restore them to the defaults. + + For modal analysis, use one buffer element between the PML and the resonant structure to avoid the + spurious modes. The mode patterns should be evaluated graphically. + + See `Artificially Matched Layers + `_ + """ + command = f"PMLOPT,{psys},{lab},{xminus},{xplus},{yminus},{yplus},{zminus},{zplus},{woptxm},{woptxp},{woptym},{woptyp},{woptzm},{woptzp}" + return self.run(command, **kwargs) + + def pmlsize( + self, + freqb: str = "", + freqe: str = "", + dmin: str = "", + dmax: str = "", + thick: str = "", + angle: str = "", + wavespeed: str = "", + **kwargs, + ): + r"""Determines number of PML or IPML layers. + + Mechanical APDL Command: `PMLSIZE `_ + + Parameters + ---------- + freqb : str + Minimum operating frequency (no default). + + freqe : str + Maximum operating frequency (defaults to ``FREQB`` ). + + dmin : str + Minimum distance from the radiation source to the PML or IPML interface (no default). + + dmax : str + Maximum distance from the radiation source to the PML or IPML interface (defaults to ``DMIN`` ). + + thick : str + Thickness of the PML or IPML region (defaults to 0). + + angle : str + Incident angle of wave to the PML or IPML interface (defaults to 0). + + wavespeed : str + Wave speed in PML or IPML medium (defaults to 343.24 m/s). + + Notes + ----- + :ref:`pmlsize` determines the number of PML or IPML layers for acceptable numerical accuracy. + + :ref:`pmlsize` must be issued before any meshing commands. If the thickness of the PML or IPML + region is known, it determines an element edge length (h) and issues :ref:`esize`,h. If the + thickness of the PML or IPML region is unknown, it determines the number of layers (n) and issues + :ref:`esize`,,n. + + See `Artificially Matched Layers + `_ + """ + command = f"PMLSIZE,{freqb},{freqe},{dmin},{dmax},{thick},{angle},{wavespeed}" + return self.run(command, **kwargs) + + def psys(self, kcn: int | str = "", **kwargs): + r"""Sets the PML element coordinate system attribute pointer. + + Mechanical APDL Command: `PSYS `_ + + **Command default:** + + .. _PSYS_default: + + The PML element coordinate system orientation defaults to the global Cartesian system. + + Parameters + ---------- + kcn : int or str + Coordinate system number: + + * ``0`` - Use the global Cartesian coordinate system as the PML element coordinate system (default). + + * ``N`` - Set the PML element coordinate system orientation based on a local Cartesian coordinate + system N (where N must be greater than 10) defined by the :ref:`local` or :ref:`cs` command (for + example: :ref:`local`,11,0). + + Notes + ----- + + .. _PSYS_notes: + + This command identifies the local coordinate system used to define the PML (perfectly matched + layers) coordinate system of subsequently defined PML elements. It is only applicable to volume + elements that support PML. The use of PML coordinate systems is similar to element coordinate + systems, as discussed in `Understanding the Element Coordinate System + `_ + ``KCN`` ) defined using the :ref:`local` (or similar) command. + """ + command = f"PSYS,{kcn}" + return self.run(command, **kwargs) diff --git a/src/ansys/mapdl/core/_commands/prep7/booleans.py b/src/ansys/mapdl/core/_commands/prep7/booleans.py new file mode 100644 index 00000000000..6329d57cf0e --- /dev/null +++ b/src/ansys/mapdl/core/_commands/prep7/booleans.py @@ -0,0 +1,2563 @@ +# 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 Booleans: + + def aadd( + self, + na1: str = "", + na2: str = "", + na3: str = "", + na4: str = "", + na5: str = "", + na6: str = "", + na7: str = "", + na8: str = "", + na9: str = "", + **kwargs, + ): + r"""Adds separate areas to create a single area. + + Mechanical APDL Command: `AADD `_ + + Parameters + ---------- + na1 : str + Numbers of areas to be added. If ``NA1`` = ALL, add all selected areas and ignore ``NA2`` to + ``NA9``. If ``NA1`` = P, graphical picking is enabled and all remaining arguments are ignored + (valid only in the GUI). A component name may also be substituted for ``NA1``. + + na2 : str + Numbers of areas to be added. If ``NA1`` = ALL, add all selected areas and ignore ``NA2`` to + ``NA9``. If ``NA1`` = P, graphical picking is enabled and all remaining arguments are ignored + (valid only in the GUI). A component name may also be substituted for ``NA1``. + + na3 : str + Numbers of areas to be added. If ``NA1`` = ALL, add all selected areas and ignore ``NA2`` to + ``NA9``. If ``NA1`` = P, graphical picking is enabled and all remaining arguments are ignored + (valid only in the GUI). A component name may also be substituted for ``NA1``. + + na4 : str + Numbers of areas to be added. If ``NA1`` = ALL, add all selected areas and ignore ``NA2`` to + ``NA9``. If ``NA1`` = P, graphical picking is enabled and all remaining arguments are ignored + (valid only in the GUI). A component name may also be substituted for ``NA1``. + + na5 : str + Numbers of areas to be added. If ``NA1`` = ALL, add all selected areas and ignore ``NA2`` to + ``NA9``. If ``NA1`` = P, graphical picking is enabled and all remaining arguments are ignored + (valid only in the GUI). A component name may also be substituted for ``NA1``. + + na6 : str + Numbers of areas to be added. If ``NA1`` = ALL, add all selected areas and ignore ``NA2`` to + ``NA9``. If ``NA1`` = P, graphical picking is enabled and all remaining arguments are ignored + (valid only in the GUI). A component name may also be substituted for ``NA1``. + + na7 : str + Numbers of areas to be added. If ``NA1`` = ALL, add all selected areas and ignore ``NA2`` to + ``NA9``. If ``NA1`` = P, graphical picking is enabled and all remaining arguments are ignored + (valid only in the GUI). A component name may also be substituted for ``NA1``. + + na8 : str + Numbers of areas to be added. If ``NA1`` = ALL, add all selected areas and ignore ``NA2`` to + ``NA9``. If ``NA1`` = P, graphical picking is enabled and all remaining arguments are ignored + (valid only in the GUI). A component name may also be substituted for ``NA1``. + + na9 : str + Numbers of areas to be added. If ``NA1`` = ALL, add all selected areas and ignore ``NA2`` to + ``NA9``. If ``NA1`` = P, graphical picking is enabled and all remaining arguments are ignored + (valid only in the GUI). A component name may also be substituted for ``NA1``. + + Notes + ----- + + .. _AADD_notes: + + The areas must be coplanar. The original areas (and their corresponding lines and keypoints) will be + deleted by default. See the :ref:`boptn` command for the options available to Boolean operations. + Element attributes and solid model boundary conditions assigned to the original entities will not be + transferred to the new entities generated. Concatenated entities are not valid with this command. + + Examples + -------- + Generate two areas and combine them. + + >>> a1 = mapdl.rectng(2.5, 3.5, 0, 10) + >>> a2 = mapdl.cyl4(0, 10, 2.5, 0, 3.5, 90) + >>> a_comb = mapdl.aadd(a1, a2) + >>> a_comb + 3 + """ + command = f"AADD,{na1},{na2},{na3},{na4},{na5},{na6},{na7},{na8},{na9}" + return parse.parse_output_areas(self.run(command, **kwargs)) + + def aglue( + self, + na1: str = "", + na2: str = "", + na3: str = "", + na4: str = "", + na5: str = "", + na6: str = "", + na7: str = "", + na8: str = "", + na9: str = "", + **kwargs, + ): + r"""Generates new areas by "gluing" areas. + + Mechanical APDL Command: `AGLUE `_ + + Parameters + ---------- + na1 : str + Numbers of the areas to be glued. If ``NA1`` = ALL, all selected areas will be glued ( ``NA2`` + to ``NA9`` will be ignored). If ``NA1`` = P, graphical picking is enabled and all remaining + arguments are ignored (valid only in the GUI). A component name may also be substituted for + ``NA1``. + + na2 : str + Numbers of the areas to be glued. If ``NA1`` = ALL, all selected areas will be glued ( ``NA2`` + to ``NA9`` will be ignored). If ``NA1`` = P, graphical picking is enabled and all remaining + arguments are ignored (valid only in the GUI). A component name may also be substituted for + ``NA1``. + + na3 : str + Numbers of the areas to be glued. If ``NA1`` = ALL, all selected areas will be glued ( ``NA2`` + to ``NA9`` will be ignored). If ``NA1`` = P, graphical picking is enabled and all remaining + arguments are ignored (valid only in the GUI). A component name may also be substituted for + ``NA1``. + + na4 : str + Numbers of the areas to be glued. If ``NA1`` = ALL, all selected areas will be glued ( ``NA2`` + to ``NA9`` will be ignored). If ``NA1`` = P, graphical picking is enabled and all remaining + arguments are ignored (valid only in the GUI). A component name may also be substituted for + ``NA1``. + + na5 : str + Numbers of the areas to be glued. If ``NA1`` = ALL, all selected areas will be glued ( ``NA2`` + to ``NA9`` will be ignored). If ``NA1`` = P, graphical picking is enabled and all remaining + arguments are ignored (valid only in the GUI). A component name may also be substituted for + ``NA1``. + + na6 : str + Numbers of the areas to be glued. If ``NA1`` = ALL, all selected areas will be glued ( ``NA2`` + to ``NA9`` will be ignored). If ``NA1`` = P, graphical picking is enabled and all remaining + arguments are ignored (valid only in the GUI). A component name may also be substituted for + ``NA1``. + + na7 : str + Numbers of the areas to be glued. If ``NA1`` = ALL, all selected areas will be glued ( ``NA2`` + to ``NA9`` will be ignored). If ``NA1`` = P, graphical picking is enabled and all remaining + arguments are ignored (valid only in the GUI). A component name may also be substituted for + ``NA1``. + + na8 : str + Numbers of the areas to be glued. If ``NA1`` = ALL, all selected areas will be glued ( ``NA2`` + to ``NA9`` will be ignored). If ``NA1`` = P, graphical picking is enabled and all remaining + arguments are ignored (valid only in the GUI). A component name may also be substituted for + ``NA1``. + + na9 : str + Numbers of the areas to be glued. If ``NA1`` = ALL, all selected areas will be glued ( ``NA2`` + to ``NA9`` will be ignored). If ``NA1`` = P, graphical picking is enabled and all remaining + arguments are ignored (valid only in the GUI). A component name may also be substituted for + ``NA1``. + + Notes + ----- + + .. _AGLUE_notes: + + Use of the :ref:`aglue` command generates new areas by "gluing" input areas. The glue operation + redefines the input areas so that they share lines along their common boundaries. The new areas + encompass the same geometry as the original areas. This operation is only valid if the intersection + of the input areas are lines along the boundaries of those areas. See the `Modeling and Meshing + Guide `_ for an + illustration. See the :ref:`boptn` command for an explanation of the options available to Boolean + operations. Element attributes and solid model boundary conditions assigned to the original entities + will not be transferred to new entities generated. + + The :ref:`aglue` command results in the merging of lines and keypoints at the common area + boundaries. The lines and keypoints of the lower numbered area will be kept. This means one must be + aware of area numbering when multiple :ref:`aglue` commands are applied to avoid any "ungluing" of + geometry. + """ + command = f"AGLUE,{na1},{na2},{na3},{na4},{na5},{na6},{na7},{na8},{na9}" + return self.run(command, **kwargs) + + def aina( + self, + na1: str = "", + na2: str = "", + na3: str = "", + na4: str = "", + na5: str = "", + na6: str = "", + na7: str = "", + na8: str = "", + na9: str = "", + **kwargs, + ): + r"""Finds the intersection of areas. + + Mechanical APDL Command: `AINA `_ + + Parameters + ---------- + na1 : str + Numbers of areas to be intersected. If ``NA1`` = ALL, ``NA2`` to ``NA9`` are ignored and the + intersection of all selected areas is found. If ``NA1`` = P, graphical picking is enabled and + all remaining arguments are ignored (valid only in the GUI). A component name may also be + substituted for ``NA1``. + + na2 : str + Numbers of areas to be intersected. If ``NA1`` = ALL, ``NA2`` to ``NA9`` are ignored and the + intersection of all selected areas is found. If ``NA1`` = P, graphical picking is enabled and + all remaining arguments are ignored (valid only in the GUI). A component name may also be + substituted for ``NA1``. + + na3 : str + Numbers of areas to be intersected. If ``NA1`` = ALL, ``NA2`` to ``NA9`` are ignored and the + intersection of all selected areas is found. If ``NA1`` = P, graphical picking is enabled and + all remaining arguments are ignored (valid only in the GUI). A component name may also be + substituted for ``NA1``. + + na4 : str + Numbers of areas to be intersected. If ``NA1`` = ALL, ``NA2`` to ``NA9`` are ignored and the + intersection of all selected areas is found. If ``NA1`` = P, graphical picking is enabled and + all remaining arguments are ignored (valid only in the GUI). A component name may also be + substituted for ``NA1``. + + na5 : str + Numbers of areas to be intersected. If ``NA1`` = ALL, ``NA2`` to ``NA9`` are ignored and the + intersection of all selected areas is found. If ``NA1`` = P, graphical picking is enabled and + all remaining arguments are ignored (valid only in the GUI). A component name may also be + substituted for ``NA1``. + + na6 : str + Numbers of areas to be intersected. If ``NA1`` = ALL, ``NA2`` to ``NA9`` are ignored and the + intersection of all selected areas is found. If ``NA1`` = P, graphical picking is enabled and + all remaining arguments are ignored (valid only in the GUI). A component name may also be + substituted for ``NA1``. + + na7 : str + Numbers of areas to be intersected. If ``NA1`` = ALL, ``NA2`` to ``NA9`` are ignored and the + intersection of all selected areas is found. If ``NA1`` = P, graphical picking is enabled and + all remaining arguments are ignored (valid only in the GUI). A component name may also be + substituted for ``NA1``. + + na8 : str + Numbers of areas to be intersected. If ``NA1`` = ALL, ``NA2`` to ``NA9`` are ignored and the + intersection of all selected areas is found. If ``NA1`` = P, graphical picking is enabled and + all remaining arguments are ignored (valid only in the GUI). A component name may also be + substituted for ``NA1``. + + na9 : str + Numbers of areas to be intersected. If ``NA1`` = ALL, ``NA2`` to ``NA9`` are ignored and the + intersection of all selected areas is found. If ``NA1`` = P, graphical picking is enabled and + all remaining arguments are ignored (valid only in the GUI). A component name may also be + substituted for ``NA1``. + + Notes + ----- + + .. _AINA_notes: + + Finds the common (not pairwise) intersection of areas. The common intersection is defined as the + regions shared (in common) by **all** areas listed on this command. New areas will be generated + where the original areas intersect. If the + regions of intersection are only lines, new lines will be generated instead. See the `Modeling and + Meshing Guide `_ + for an + illustration. See the :ref:`boptn` command for the options available to Boolean operations. Element + attributes and solid model boundary conditions assigned to the original entities will not be + transferred to the new entities generated. + """ + command = f"AINA,{na1},{na2},{na3},{na4},{na5},{na6},{na7},{na8},{na9}" + return self.run(command, **kwargs) + + def ainp( + self, + na1: str = "", + na2: str = "", + na3: str = "", + na4: str = "", + na5: str = "", + na6: str = "", + na7: str = "", + na8: str = "", + na9: str = "", + **kwargs, + ): + r"""Finds the pairwise intersection of areas. + + Mechanical APDL Command: `AINP `_ + + Parameters + ---------- + na1 : str + Numbers of areas to be intersected pairwise. If ``NA1`` = ALL, ``NA2`` to ``NA9`` are ignored + and the pairwise intersection of all selected areas is found. If ``NA1`` = P, graphical picking + is enabled and all remaining arguments are ignored (valid only in the GUI). A component name may + be substituted for ``NA1``. + + na2 : str + Numbers of areas to be intersected pairwise. If ``NA1`` = ALL, ``NA2`` to ``NA9`` are ignored + and the pairwise intersection of all selected areas is found. If ``NA1`` = P, graphical picking + is enabled and all remaining arguments are ignored (valid only in the GUI). A component name may + be substituted for ``NA1``. + + na3 : str + Numbers of areas to be intersected pairwise. If ``NA1`` = ALL, ``NA2`` to ``NA9`` are ignored + and the pairwise intersection of all selected areas is found. If ``NA1`` = P, graphical picking + is enabled and all remaining arguments are ignored (valid only in the GUI). A component name may + be substituted for ``NA1``. + + na4 : str + Numbers of areas to be intersected pairwise. If ``NA1`` = ALL, ``NA2`` to ``NA9`` are ignored + and the pairwise intersection of all selected areas is found. If ``NA1`` = P, graphical picking + is enabled and all remaining arguments are ignored (valid only in the GUI). A component name may + be substituted for ``NA1``. + + na5 : str + Numbers of areas to be intersected pairwise. If ``NA1`` = ALL, ``NA2`` to ``NA9`` are ignored + and the pairwise intersection of all selected areas is found. If ``NA1`` = P, graphical picking + is enabled and all remaining arguments are ignored (valid only in the GUI). A component name may + be substituted for ``NA1``. + + na6 : str + Numbers of areas to be intersected pairwise. If ``NA1`` = ALL, ``NA2`` to ``NA9`` are ignored + and the pairwise intersection of all selected areas is found. If ``NA1`` = P, graphical picking + is enabled and all remaining arguments are ignored (valid only in the GUI). A component name may + be substituted for ``NA1``. + + na7 : str + Numbers of areas to be intersected pairwise. If ``NA1`` = ALL, ``NA2`` to ``NA9`` are ignored + and the pairwise intersection of all selected areas is found. If ``NA1`` = P, graphical picking + is enabled and all remaining arguments are ignored (valid only in the GUI). A component name may + be substituted for ``NA1``. + + na8 : str + Numbers of areas to be intersected pairwise. If ``NA1`` = ALL, ``NA2`` to ``NA9`` are ignored + and the pairwise intersection of all selected areas is found. If ``NA1`` = P, graphical picking + is enabled and all remaining arguments are ignored (valid only in the GUI). A component name may + be substituted for ``NA1``. + + na9 : str + Numbers of areas to be intersected pairwise. If ``NA1`` = ALL, ``NA2`` to ``NA9`` are ignored + and the pairwise intersection of all selected areas is found. If ``NA1`` = P, graphical picking + is enabled and all remaining arguments are ignored (valid only in the GUI). A component name may + be substituted for ``NA1``. + + Notes + ----- + + .. _AINP_notes: + + Finds the pairwise intersection of areas. The pairwise intersection is defined as all regions shared + by any two or more areas listed on this command. New areas will be generated where the original + areas intersect pairwise. If the regions of pairwise intersection are only lines, new lines will be + generated. See the `Modeling and Meshing Guide + `_ for an + illustration. See the :ref:`boptn` command for the options + available to Boolean operations. Element attributes and solid model boundary conditions assigned to + the original entities will not be transferred to the new entities generated. + """ + command = f"AINP,{na1},{na2},{na3},{na4},{na5},{na6},{na7},{na8},{na9}" + return self.run(command, **kwargs) + + def ainv(self, na: str = "", nv: str = "", **kwargs): + r"""Finds the intersection of an area with a volume. + + Mechanical APDL Command: `AINV `_ + + Parameters + ---------- + na : str + Number of area to be intersected. If P, graphical picking is enabled and all remaining arguments + are ignored (valid only in the GUI). + + nv : str + Number of volume to be intersected. + + Notes + ----- + + .. _AINV_notes: + + New areas will be generated where the areas intersect the volumes. If the regions of intersection + are only lines, new lines will be generated instead. See the `Modeling and Meshing Guide + `_ for an + illustration. See the + :ref:`boptn` command for the options available to Boolean operations. Element attributes and solid + model boundary conditions assigned to the original entities will not be transferred to the new + entities generated. + """ + command = f"AINV,{na},{nv}" + return self.run(command, **kwargs) + + def aovlap( + self, + na1: str = "", + na2: str = "", + na3: str = "", + na4: str = "", + na5: str = "", + na6: str = "", + na7: str = "", + na8: str = "", + na9: str = "", + **kwargs, + ): + r"""Overlaps areas. + + Mechanical APDL Command: `AOVLAP `_ + + Parameters + ---------- + na1 : str + Numbers of areas to be operated on. If ``NA1`` = ALL, use all selected areas and ignore ``NA2`` + to ``NA9``. If ``NA1`` = P, graphical picking is enabled and all remaining arguments are ignored + (valid only in the GUI). A component name may also be substituted for ``NA1``. + + na2 : str + Numbers of areas to be operated on. If ``NA1`` = ALL, use all selected areas and ignore ``NA2`` + to ``NA9``. If ``NA1`` = P, graphical picking is enabled and all remaining arguments are ignored + (valid only in the GUI). A component name may also be substituted for ``NA1``. + + na3 : str + Numbers of areas to be operated on. If ``NA1`` = ALL, use all selected areas and ignore ``NA2`` + to ``NA9``. If ``NA1`` = P, graphical picking is enabled and all remaining arguments are ignored + (valid only in the GUI). A component name may also be substituted for ``NA1``. + + na4 : str + Numbers of areas to be operated on. If ``NA1`` = ALL, use all selected areas and ignore ``NA2`` + to ``NA9``. If ``NA1`` = P, graphical picking is enabled and all remaining arguments are ignored + (valid only in the GUI). A component name may also be substituted for ``NA1``. + + na5 : str + Numbers of areas to be operated on. If ``NA1`` = ALL, use all selected areas and ignore ``NA2`` + to ``NA9``. If ``NA1`` = P, graphical picking is enabled and all remaining arguments are ignored + (valid only in the GUI). A component name may also be substituted for ``NA1``. + + na6 : str + Numbers of areas to be operated on. If ``NA1`` = ALL, use all selected areas and ignore ``NA2`` + to ``NA9``. If ``NA1`` = P, graphical picking is enabled and all remaining arguments are ignored + (valid only in the GUI). A component name may also be substituted for ``NA1``. + + na7 : str + Numbers of areas to be operated on. If ``NA1`` = ALL, use all selected areas and ignore ``NA2`` + to ``NA9``. If ``NA1`` = P, graphical picking is enabled and all remaining arguments are ignored + (valid only in the GUI). A component name may also be substituted for ``NA1``. + + na8 : str + Numbers of areas to be operated on. If ``NA1`` = ALL, use all selected areas and ignore ``NA2`` + to ``NA9``. If ``NA1`` = P, graphical picking is enabled and all remaining arguments are ignored + (valid only in the GUI). A component name may also be substituted for ``NA1``. + + na9 : str + Numbers of areas to be operated on. If ``NA1`` = ALL, use all selected areas and ignore ``NA2`` + to ``NA9``. If ``NA1`` = P, graphical picking is enabled and all remaining arguments are ignored + (valid only in the GUI). A component name may also be substituted for ``NA1``. + + Notes + ----- + + .. _AOVLAP_notes: + + Generates new areas which encompass the geometry of all the input areas. The new areas are defined + by the regions of intersection of the input areas, and by the complementary (non-intersecting) + regions. See `Solid Modeling + `_ in + the `Modeling and Meshing Guide + `_ for an + illustration. This operation is only valid when the region of intersection is an + area. See the :ref:`boptn` command for an explanation of the options available to Boolean + operations. Element attributes and solid model boundary conditions assigned to the original entities + will not be transferred to the new entities generated. + """ + command = f"AOVLAP,{na1},{na2},{na3},{na4},{na5},{na6},{na7},{na8},{na9}" + return self.run(command, **kwargs) + + def aptn( + self, + na1: str = "", + na2: str = "", + na3: str = "", + na4: str = "", + na5: str = "", + na6: str = "", + na7: str = "", + na8: str = "", + na9: str = "", + **kwargs, + ): + r"""Partitions areas. + + Mechanical APDL Command: `APTN `_ + + Parameters + ---------- + na1 : str + Numbers of areas to be operated on. If ``NA1`` = ALL, ``NA2`` to ``NA9`` are ignored and all + selected areas are used. If ``NA1`` = P, graphical picking is enabled and all remaining + arguments are ignored (valid only in the GUI). A component name may be substituted for ``NA1``. + + na2 : str + Numbers of areas to be operated on. If ``NA1`` = ALL, ``NA2`` to ``NA9`` are ignored and all + selected areas are used. If ``NA1`` = P, graphical picking is enabled and all remaining + arguments are ignored (valid only in the GUI). A component name may be substituted for ``NA1``. + + na3 : str + Numbers of areas to be operated on. If ``NA1`` = ALL, ``NA2`` to ``NA9`` are ignored and all + selected areas are used. If ``NA1`` = P, graphical picking is enabled and all remaining + arguments are ignored (valid only in the GUI). A component name may be substituted for ``NA1``. + + na4 : str + Numbers of areas to be operated on. If ``NA1`` = ALL, ``NA2`` to ``NA9`` are ignored and all + selected areas are used. If ``NA1`` = P, graphical picking is enabled and all remaining + arguments are ignored (valid only in the GUI). A component name may be substituted for ``NA1``. + + na5 : str + Numbers of areas to be operated on. If ``NA1`` = ALL, ``NA2`` to ``NA9`` are ignored and all + selected areas are used. If ``NA1`` = P, graphical picking is enabled and all remaining + arguments are ignored (valid only in the GUI). A component name may be substituted for ``NA1``. + + na6 : str + Numbers of areas to be operated on. If ``NA1`` = ALL, ``NA2`` to ``NA9`` are ignored and all + selected areas are used. If ``NA1`` = P, graphical picking is enabled and all remaining + arguments are ignored (valid only in the GUI). A component name may be substituted for ``NA1``. + + na7 : str + Numbers of areas to be operated on. If ``NA1`` = ALL, ``NA2`` to ``NA9`` are ignored and all + selected areas are used. If ``NA1`` = P, graphical picking is enabled and all remaining + arguments are ignored (valid only in the GUI). A component name may be substituted for ``NA1``. + + na8 : str + Numbers of areas to be operated on. If ``NA1`` = ALL, ``NA2`` to ``NA9`` are ignored and all + selected areas are used. If ``NA1`` = P, graphical picking is enabled and all remaining + arguments are ignored (valid only in the GUI). A component name may be substituted for ``NA1``. + + na9 : str + Numbers of areas to be operated on. If ``NA1`` = ALL, ``NA2`` to ``NA9`` are ignored and all + selected areas are used. If ``NA1`` = P, graphical picking is enabled and all remaining + arguments are ignored (valid only in the GUI). A component name may be substituted for ``NA1``. + + Notes + ----- + + .. _APTN_notes: + + Partitions areas that intersect. This command is similar to the combined functionality of the + :ref:`asba` and :ref:`aovlap` commands. If the intersection of two or more areas is an area (that + is, planar), new areas will be created with boundaries that conform to the area of intersection and + to the boundaries of the non-intersecting portions of the input areas ( :ref:`aovlap` ). If the + intersection is a line (that is, not planar), the areas will be subtracted, or divided, along the + line(s) of intersection ( :ref:`asba` ). Both types of intersection can occur during a single + :ref:`aptn` operation. Areas that do not intersect will not be modified. See the `Modeling and + Meshing Guide `_ + for an + illustration. See the :ref:`boptn` command for an explanation of the options available to Boolean + operations. Element attributes and solid model boundary conditions assigned to the original entities + will not be transferred to the new entities generated. + """ + command = f"APTN,{na1},{na2},{na3},{na4},{na5},{na6},{na7},{na8},{na9}" + return self.run(command, **kwargs) + + def asba( + self, + na1: str = "", + na2: str = "", + sepo: str = "", + keep1: str = "", + keep2: str = "", + **kwargs, + ): + r"""Subtracts areas from areas. + + Mechanical APDL Command: `ASBA `_ + + Parameters + ---------- + na1 : str + Area (or areas, if picking is used) to be subtracted from. If ALL, use all selected areas. Areas + specified in this argument are not available for use in the ``NA2`` argument. If P, graphical + picking is enabled (valid only in the GUI) and remaining fields are ignored. A component name + may also be substituted for ``NA1``. + + na2 : str + Area (or areas, if picking is used) to subtract. If ALL, use all selected areas (except those + included in the ``NA1`` argument). A component name may also be substituted for ``NA2``. + + sepo : str + Behavior if the intersection of the ``NA1`` areas and the ``NA2`` areas is a line or lines: + + * ``(blank)`` - The resulting areas will share line(s) where they touch. + + * ``SEPO`` - The resulting areas will have separate, but coincident line(s) where they touch. + + keep1 : str + Specifies whether ``NA1`` areas are to be deleted: + + * ``(blank)`` - Use the setting of KEEP on the :ref:`boptn` command. + + * ``DELETE`` - Delete ``NA1`` areas after :ref:`asba` operation (override :ref:`boptn` command + settings). + + * ``KEEP`` - Keep ``NA1`` areas after :ref:`asba` operation (override :ref:`boptn` command + settings). + + keep2 : str + Specifies whether ``NA2`` areas are to be deleted: + + * ``(blank)`` - Use the setting of KEEP on the :ref:`boptn` command. + + * ``DELETE`` - Delete ``NA2`` areas after :ref:`asba` operation (override :ref:`boptn` command + settings). + + * ``KEEP`` - Keep ``NA2`` areas after :ref:`asba` operation (override :ref:`boptn` command + settings). + + Returns + ------- + int + Area number of the new area (if applicable) + + Notes + ----- + + .. _ASBA_notes: + + Generates new areas by subtracting the regions common to both ``NA1`` and ``NA2`` areas (the + intersection) from the ``NA1`` areas. The intersection can be an area(s) or line(s). If the + intersection is a line and ``SEPO`` is blank, the ``NA1`` area is divided at the line and the + resulting areas will be connected, sharing a common line where they touch. If ``SEPO`` is set to + SEPO, ``NA1`` is divided into two unconnected areas with separate lines where they touch. See `Solid + Modeling `_ + in the `Modeling and Meshing Guide + `_ for an + illustration. See the :ref:`boptn` command for an explanation of the + options available to Boolean operations. Element attributes and solid model boundary conditions + assigned to the original entities will not be transferred to the new entities generated. + :ref:`asba`,ALL,ALL will have no effect since all the areas (in ``NA1`` ) will be unavailable as + ``NA2`` areas. + + Examples + -------- + Subtract a 0.5 x 0.5 rectangle from a 1 x 1 rectangle. + + >>> anum0 = mapdl.blc4(0, 0, 1, 1) + >>> anum1 = mapdl.blc4(0.25, 0.25, 0.5, 0.5) + >>> aout = mapdl.asba(anum0, anum1) + >>> aout + 3 + """ + command = f"ASBA,{na1},{na2},{sepo},{keep1},{keep2}" + return parse.parse_output_volume_area(self.run(command, **kwargs)) + + def asbl( + self, na: str = "", nl: str = "", keepa: str = "", keepl: str = "", **kwargs + ): + r"""Subtracts lines from areas. + + Mechanical APDL Command: `ASBL `_ + + Parameters + ---------- + na : str + Area (or areas, if picking is used) to be subtracted from. If ALL, use all selected areas. If P, + graphical picking is enabled (valid only in the GUI) and remaining fields are ignored. A + component name may also be substituted for ``NA``. + + nl : str + Line (or lines, if picking is used) to subtract. If ALL, use all selected lines. A component + name may also be substituted for ``NL``. + + keepa : str + Specifies whether ``NA`` areas are to be deleted: + + * ``(blank)`` - Use the setting of KEEP on the :ref:`boptn` command. + + * ``DELETE`` - Delete ``NA`` areas after :ref:`asbl` operation (override :ref:`boptn` command + settings). + + * ``KEEP`` - Keep ``NA`` areas after :ref:`asbl` operation (override :ref:`boptn` command settings). + + keepl : str + Specifies whether ``NL`` lines are to be deleted: + + * ``(blank)`` - Use the setting of KEEP on the :ref:`boptn` command. + + * ``DELETE`` - Delete ``NL`` lines after :ref:`asbl` operation (override :ref:`boptn` command + settings). + + * ``KEEP`` - Keep ``NL`` lines after :ref:`asbl` operation (override :ref:`boptn` command settings). + + Notes + ----- + + .. _ASBL_notes: + + Generates new areas by subtracting the regions common to both the areas and lines (the intersection) + from the ``NA`` areas. The intersection will be a line(s). See `Solid Modeling + `_ in the + `Modeling and Meshing Guide + `_ for an + illustration. See the :ref:`boptn` command for an explanation of the options + available to Boolean operations. Element attributes and solid model boundary conditions assigned to + the original entities will not be transferred to the new entities generated. + """ + command = f"ASBL,{na},{nl},,{keepa},{keepl}" + return self.run(command, **kwargs) + + def asbv( + self, + na: str = "", + nv: str = "", + sepo: str = "", + keepa: str = "", + keepv: str = "", + **kwargs, + ): + r"""Subtracts volumes from areas. + + Mechanical APDL Command: `ASBV `_ + + Parameters + ---------- + na : str + Area (or areas, if picking is used) to be subtracted from. If ALL, use all selected areas. If P, + graphical picking is enabled (valid only in the GUI) and remaining fields are ignored. A + component name may also be substituted for ``NA``. + + nv : str + Volume (or volumes, if picking is used) to subtract. If ALL, use all selected volumes. A + component name may also be substituted for ``NV``. + + sepo : str + Behavior if the intersection of the areas and the volumes is a line or lines: + + * ``(blank)`` - The resulting areas will share line(s) where they touch. + + * ``SEPO`` - The resulting areas will have separate, but coincident line(s) where they touch. + + keepa : str + Specifies whether ``NA`` areas are to be deleted: + + * ``(blank)`` - Use the setting of KEEP on the :ref:`boptn` command. + + * ``DELETE`` - Delete ``NA`` areas after :ref:`asbv` operation (override :ref:`boptn` command + settings). + + * ``KEEP`` - Keep ``NA`` areas after :ref:`asbv` operation (override :ref:`boptn` command settings). + + keepv : str + Specifies whether ``NV`` volumes are to be deleted: + + * ``(blank)`` - Use the setting of KEEP on the :ref:`boptn` command. + + * ``DELETE`` - Delete volumes after :ref:`asbv` operation (override :ref:`boptn` command settings). + + * ``KEEP`` - Keep volumes after :ref:`asbv` operation (override :ref:`boptn` command settings). + + Notes + ----- + + .. _ASBV_notes: + + Generates new areas by subtracting the regions common to both ``NA`` areas and ``NV`` volumes (the + intersection) from the ``NA`` areas. The intersection can be an area(s) or line(s). If the + intersection is a line and ``SEPO`` is blank, the ``NA`` area is divided at the line and the + resulting areas will be connected, sharing a common line where they touch. If ``SEPO`` is set to + SEPO, ``NA`` is divided into two unconnected areas with separate lines where they touch. See `Solid + Modeling `_ + in the `Modeling and Meshing Guide + `_ for an + illustration. See the :ref:`boptn` command for an explanation of the + options available to Boolean operations. Element attributes and solid model boundary conditions + assigned to the original entities will not be transferred to the new entities generated. + """ + command = f"ASBV,{na},{nv},{sepo},{keepa},{keepv}" + return self.run(command, **kwargs) + + def asbw(self, na: str = "", sepo: str = "", keep: str = "", **kwargs): + r"""Subtracts the intersection of the working plane from areas (divides areas). + + Mechanical APDL Command: `ASBW `_ + + Parameters + ---------- + na : str + Area (or areas, if picking is used) to be subtracted from. If ``NA`` = ALL, use all selected + areas. If ``NA`` = P, graphical picking is enabled (valid only in the GUI). A component name may + also be input for ``NA``. + + sepo : str + Behavior of the created boundary. + + * ``(blank)`` - The resulting areas will share line(s) where they touch. + + * ``SEPO`` - The resulting areas will have separate, but coincident line(s). + + keep : str + Specifies whether ``NA`` areas are to be deleted. + + * ``(blank)`` - Use the setting of KEEP on the :ref:`boptn` command. + + * ``DELETE`` - Delete ``NA`` areas after :ref:`asbw` operation (override :ref:`boptn` command + settings). + + * ``KEEP`` - Keep ``NA`` areas after :ref:`asbw` operation (override :ref:`boptn` command settings). + + Notes + ----- + + .. _ASBW_notes: + + Generates new areas by subtracting the intersection of the working plane from the ``NA`` areas. The + intersection will be a line(s). The working plane must not be in the same plane as the ``NA`` + area(s). If ``SEPO`` is blank, the ``NA`` area is divided at the line and the resulting areas will + be connected, sharing a common line where they touch. If ``SEPO`` is set to SEPO, ``NA`` is divided + into two unconnected areas with separate lines. The SEPO option may cause unintended consequences if + any keypoints exist along the cut plane. See `Solid Modeling + `_ in the + `Modeling and Meshing Guide + `_ for an + illustration. See the :ref:`boptn` command for an explanation of the options + available to Boolean operations. Element attributes and solid model boundary conditions assigned to + the original entities will not be transferred to the new entities generated. + + Issuing the :ref:`asbw` command under certain conditions may generate a topological degeneracy + error. Do not issue the command if: + + * A sphere or cylinder has been scaled. (A cylinder must be scaled unevenly in the XY plane.) + + * A sphere or cylinder has not been scaled but the work plane has been rotated. + """ + command = f"ASBW,{na},{sepo},{keep}" + return self.run(command, **kwargs) + + def boptn(self, lab: str = "", value: str = "", **kwargs): + r"""Specifies Boolean operation options. + + Mechanical APDL Command: `BOPTN `_ + + **Command default:** + + .. _BOPTN_default: + + Input entities will be deleted, and operations with no effect (that is, operations which are valid + but which do not cause a change in the input entities, such as adding two non-touching areas) will + produce a warning message. The Revision 5.2 Boolean compatibility option will be used. + + Parameters + ---------- + lab : str + Default/status key: + + * ``DEFA`` - Resets settings to default values. + + * ``STAT`` - Lists status of present settings. + + Option to be controlled: + + * ``KEEP`` - Delete or keep input entity option. + + * ``NUMB`` - Output numbering warning message option. + + * ``NWARN`` - No effect warning message option. + + * ``VERSION`` - Boolean compatibility option. + + value : str + Option settings if ``Lab`` = KEEP: + + * ``NO`` - Delete entities used as input with a Boolean operation (default). Entities will not be + deleted if meshed or if attached to a higher entity. + + * ``YES`` - Keep input solid modeling entities. + + Option settings if ``Lab`` = NUMB: + + * ``0`` - No warning message will be produced if the output entities of a Boolean operation are + numbered based on geometry (default). + + * ``1`` - A warning message will be produced if the output entities of a Boolean operation are + numbered based on geometry. (With geometric numbering, re-use of the input with altered dimensions + may not produce the same numbering, and later operations in the input may fail or produce unexpected + results.) + + Option settings if ``Lab`` = NWARN: + + * ``0`` - A warning message will be produced if a Boolean operation has no effect (default). + + * ``1`` - No warning or error messages will be generated if a Boolean operation has no effect. + + * ``-1`` - An error message will be produced if a Boolean operation has no effect. + + Option settings if ``Lab`` = VERSION: + + * ``RV52`` - Activate the Revision 5.2 compatibility option (default). The 5.2 option can produce + different numbering of the entities produced by Boolean operations than the 5.1 option. See Notes + below. + + * ``RV51`` - Activate the Revision 5.1 compatibility option. The 5.1 option can produce different + numbering of the entities produced by Boolean operations than the 5.2 option. See :ref:`BOPTN_notes` + below. + + Notes + ----- + + .. _BOPTN_notes: + + Boolean operations at Revision 5.2 may produce a different number of entities than previous + revisions of Mechanical APDL. When running input files created in earlier versions of Mechanical + APDL, match the + Boolean compatibility option (VERSION) to the revision originally used. For instance, if you are + running Revision 5.2 and are reading an input file ( :ref:`input` ) created at Revision 5.1, it is + recommended that you set VERSION to RV51 before reading the input. + + See the `Modeling and Meshing Guide + `_ for further + details on the functions of the RV51 and RV52 labels. + + This command is valid in any processor. + """ + command = f"BOPTN,{lab},{value}" + return self.run(command, **kwargs) + + def btol(self, ptol: str = "", **kwargs): + r"""Specifies the Boolean operation tolerances. + + Mechanical APDL Command: `BTOL `_ + + **Command default:** + + .. _BTOL_default: + + ``PTOL`` = 0.10E-4. + + Parameters + ---------- + ptol : str + Point coincidence tolerance. Points within this distance to each other will be assumed to be + coincident during Boolean operations. Loosening the tolerance will increase the run time and + storage requirements, but will allow more Boolean intersections to succeed. Defaults to 0.10E-4. + + Notes + ----- + + .. _BTOL_notes: + + Use :ref:`btol`,DEFA to reset the setting to its default value. Use :ref:`btol`,STAT to list the + status of the present setting. + """ + command = f"BTOL,{ptol}" + return self.run(command, **kwargs) + + def lcsl( + self, + nl1: str = "", + nl2: str = "", + nl3: str = "", + nl4: str = "", + nl5: str = "", + nl6: str = "", + nl7: str = "", + nl8: str = "", + nl9: str = "", + **kwargs, + ): + r"""Divides intersecting lines at their point(s) of intersection. + + Mechanical APDL Command: `LCSL `_ + + Parameters + ---------- + nl1 : str + Numbers of lines to be intersected. If ``NL1`` = ALL, ``NL2`` to ``NL9`` are ignored and the + intersection of all selected lines is found. If ``NL1`` = P, use graphical picking to specify + lines ( ``NL2`` to ``NL9`` are ignored). + + nl2 : str + Numbers of lines to be intersected. If ``NL1`` = ALL, ``NL2`` to ``NL9`` are ignored and the + intersection of all selected lines is found. If ``NL1`` = P, use graphical picking to specify + lines ( ``NL2`` to ``NL9`` are ignored). + + nl3 : str + Numbers of lines to be intersected. If ``NL1`` = ALL, ``NL2`` to ``NL9`` are ignored and the + intersection of all selected lines is found. If ``NL1`` = P, use graphical picking to specify + lines ( ``NL2`` to ``NL9`` are ignored). + + nl4 : str + Numbers of lines to be intersected. If ``NL1`` = ALL, ``NL2`` to ``NL9`` are ignored and the + intersection of all selected lines is found. If ``NL1`` = P, use graphical picking to specify + lines ( ``NL2`` to ``NL9`` are ignored). + + nl5 : str + Numbers of lines to be intersected. If ``NL1`` = ALL, ``NL2`` to ``NL9`` are ignored and the + intersection of all selected lines is found. If ``NL1`` = P, use graphical picking to specify + lines ( ``NL2`` to ``NL9`` are ignored). + + nl6 : str + Numbers of lines to be intersected. If ``NL1`` = ALL, ``NL2`` to ``NL9`` are ignored and the + intersection of all selected lines is found. If ``NL1`` = P, use graphical picking to specify + lines ( ``NL2`` to ``NL9`` are ignored). + + nl7 : str + Numbers of lines to be intersected. If ``NL1`` = ALL, ``NL2`` to ``NL9`` are ignored and the + intersection of all selected lines is found. If ``NL1`` = P, use graphical picking to specify + lines ( ``NL2`` to ``NL9`` are ignored). + + nl8 : str + Numbers of lines to be intersected. If ``NL1`` = ALL, ``NL2`` to ``NL9`` are ignored and the + intersection of all selected lines is found. If ``NL1`` = P, use graphical picking to specify + lines ( ``NL2`` to ``NL9`` are ignored). + + nl9 : str + Numbers of lines to be intersected. If ``NL1`` = ALL, ``NL2`` to ``NL9`` are ignored and the + intersection of all selected lines is found. If ``NL1`` = P, use graphical picking to specify + lines ( ``NL2`` to ``NL9`` are ignored). + + Notes + ----- + + .. _LCSL_notes: + + Divides intersecting (classifies) lines at their point(s) of intersection. The original lines (and + their corresponding keypoint(s)) will be deleted by default. See the :ref:`boptn` command for the + options available to Boolean operations. Element attributes and solid model boundary conditions + assigned to the original entities will not be transferred to the new entities generated. + """ + command = f"LCSL,{nl1},{nl2},{nl3},{nl4},{nl5},{nl6},{nl7},{nl8},{nl9}" + return self.run(command, **kwargs) + + def lglue( + self, + nl1: str = "", + nl2: str = "", + nl3: str = "", + nl4: str = "", + nl5: str = "", + nl6: str = "", + nl7: str = "", + nl8: str = "", + nl9: str = "", + **kwargs, + ): + r"""Generates new lines by "gluing" lines. + + Mechanical APDL Command: `LGLUE `_ + + Parameters + ---------- + nl1 : str + Numbers of the lines to be glued. If ``NL1`` = ALL, all selected lines will be glued ( ``NL2`` + to ``NL9`` will be ignored). If ``NL1`` = 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 + ``NL1``. + + nl2 : str + Numbers of the lines to be glued. If ``NL1`` = ALL, all selected lines will be glued ( ``NL2`` + to ``NL9`` will be ignored). If ``NL1`` = 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 + ``NL1``. + + nl3 : str + Numbers of the lines to be glued. If ``NL1`` = ALL, all selected lines will be glued ( ``NL2`` + to ``NL9`` will be ignored). If ``NL1`` = 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 + ``NL1``. + + nl4 : str + Numbers of the lines to be glued. If ``NL1`` = ALL, all selected lines will be glued ( ``NL2`` + to ``NL9`` will be ignored). If ``NL1`` = 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 + ``NL1``. + + nl5 : str + Numbers of the lines to be glued. If ``NL1`` = ALL, all selected lines will be glued ( ``NL2`` + to ``NL9`` will be ignored). If ``NL1`` = 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 + ``NL1``. + + nl6 : str + Numbers of the lines to be glued. If ``NL1`` = ALL, all selected lines will be glued ( ``NL2`` + to ``NL9`` will be ignored). If ``NL1`` = 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 + ``NL1``. + + nl7 : str + Numbers of the lines to be glued. If ``NL1`` = ALL, all selected lines will be glued ( ``NL2`` + to ``NL9`` will be ignored). If ``NL1`` = 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 + ``NL1``. + + nl8 : str + Numbers of the lines to be glued. If ``NL1`` = ALL, all selected lines will be glued ( ``NL2`` + to ``NL9`` will be ignored). If ``NL1`` = 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 + ``NL1``. + + nl9 : str + Numbers of the lines to be glued. If ``NL1`` = ALL, all selected lines will be glued ( ``NL2`` + to ``NL9`` will be ignored). If ``NL1`` = 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 + ``NL1``. + + Notes + ----- + + .. _LGLUE_notes: + + Use of the :ref:`lglue` command generates new lines by "gluing" input lines. The glue operation + redefines the input lines so that they share keypoints at their common ends. The new lines encompass + the same geometry as the original lines. This operation is only valid if the intersections of the + input lines are keypoints at the ends of those lines. See the `Modeling and Meshing Guide + `_ for an + illustration. See the + :ref:`boptn` command for an explanation of the options available to Boolean operations. Element + attributes and solid model boundary conditions assigned to the original entities will not be + transferred to the new entities generated. + + The :ref:`lglue` command results in the merging of keypoints at the common end of the lines. The + keypoints of the lower numbered line will be kept. This means one must be aware of line numbering + when multiple :ref:`lglue` commands are applied to avoid any "ungluing" of geometry. + """ + command = f"LGLUE,{nl1},{nl2},{nl3},{nl4},{nl5},{nl6},{nl7},{nl8},{nl9}" + return self.run(command, **kwargs) + + def lina(self, nl: str = "", na: str = "", **kwargs): + r"""Finds the intersection of a line with an area. + + Mechanical APDL Command: `LINA `_ + + Parameters + ---------- + nl : str + Number of line to be intersected. If ``NL`` = P, graphical picking is enabled and all remaining + command fields are ignored (valid only in the GUI). + + na : str + Number of area to be intersected. + + Notes + ----- + + .. _LINA_notes: + + Finds the intersection of a line with an area. New lines will be generated where the lines intersect + the areas. If the regions of intersection are only points, new keypoints will be generated instead. + See the `Modeling and Meshing Guide + `_ for an + illustration. See the :ref:`boptn` command for the options available to + Boolean operations. Element attributes and solid model boundary conditions assigned to the original + entities will not be transferred to the new entities generated. + """ + command = f"LINA,{nl},{na}" + return self.run(command, **kwargs) + + def linl( + self, + nl1: str = "", + nl2: str = "", + nl3: str = "", + nl4: str = "", + nl5: str = "", + nl6: str = "", + nl7: str = "", + nl8: str = "", + nl9: str = "", + **kwargs, + ): + r"""Finds the common intersection of lines. + + Mechanical APDL Command: `LINL `_ + + Parameters + ---------- + nl1 : str + Numbers of lines to be intersected. If ``NL1`` = ALL, find the intersection of all selected + lines and ``NL2`` to ``NL9`` are ignored. If ``NL1`` = 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 ``NL1``. + + nl2 : str + Numbers of lines to be intersected. If ``NL1`` = ALL, find the intersection of all selected + lines and ``NL2`` to ``NL9`` are ignored. If ``NL1`` = 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 ``NL1``. + + nl3 : str + Numbers of lines to be intersected. If ``NL1`` = ALL, find the intersection of all selected + lines and ``NL2`` to ``NL9`` are ignored. If ``NL1`` = 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 ``NL1``. + + nl4 : str + Numbers of lines to be intersected. If ``NL1`` = ALL, find the intersection of all selected + lines and ``NL2`` to ``NL9`` are ignored. If ``NL1`` = 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 ``NL1``. + + nl5 : str + Numbers of lines to be intersected. If ``NL1`` = ALL, find the intersection of all selected + lines and ``NL2`` to ``NL9`` are ignored. If ``NL1`` = 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 ``NL1``. + + nl6 : str + Numbers of lines to be intersected. If ``NL1`` = ALL, find the intersection of all selected + lines and ``NL2`` to ``NL9`` are ignored. If ``NL1`` = 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 ``NL1``. + + nl7 : str + Numbers of lines to be intersected. If ``NL1`` = ALL, find the intersection of all selected + lines and ``NL2`` to ``NL9`` are ignored. If ``NL1`` = 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 ``NL1``. + + nl8 : str + Numbers of lines to be intersected. If ``NL1`` = ALL, find the intersection of all selected + lines and ``NL2`` to ``NL9`` are ignored. If ``NL1`` = 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 ``NL1``. + + nl9 : str + Numbers of lines to be intersected. If ``NL1`` = ALL, find the intersection of all selected + lines and ``NL2`` to ``NL9`` are ignored. If ``NL1`` = 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 ``NL1``. + + Notes + ----- + + .. _LINL_notes: + + Finds the common (not pairwise) intersection of lines. The common intersection is defined as the + regions shared (in common) by all lines listed on this command. New lines will be generated where + the original lines intersect. If the regions of intersection are only points, new keypoints will be + generated instead. See the `Modeling and Meshing Guide + `_ for an + illustration. See the :ref:`boptn` command for the + options available to Boolean operations. Element attributes and solid model boundary conditions + assigned to the original entities will not be transferred to the new entities generated. + """ + command = f"LINL,{nl1},{nl2},{nl3},{nl4},{nl5},{nl6},{nl7},{nl8},{nl9}" + return self.run(command, **kwargs) + + def linp( + self, + nl1: str = "", + nl2: str = "", + nl3: str = "", + nl4: str = "", + nl5: str = "", + nl6: str = "", + nl7: str = "", + nl8: str = "", + nl9: str = "", + **kwargs, + ): + r"""Finds the pairwise intersection of lines. + + Mechanical APDL Command: `LINP `_ + + Parameters + ---------- + nl1 : str + Numbers of lines to be intersected pairwise. If ``NL1`` = ALL, find the pairwise intersection of + all selected lines and ``NL2`` to ``NL9`` are ignored. If ``NL1`` = P, graphical picking is + enabled and all remaining command fields are ignored (valid only in the GUI). A component name + may be substituted for ``NL1``. + + nl2 : str + Numbers of lines to be intersected pairwise. If ``NL1`` = ALL, find the pairwise intersection of + all selected lines and ``NL2`` to ``NL9`` are ignored. If ``NL1`` = P, graphical picking is + enabled and all remaining command fields are ignored (valid only in the GUI). A component name + may be substituted for ``NL1``. + + nl3 : str + Numbers of lines to be intersected pairwise. If ``NL1`` = ALL, find the pairwise intersection of + all selected lines and ``NL2`` to ``NL9`` are ignored. If ``NL1`` = P, graphical picking is + enabled and all remaining command fields are ignored (valid only in the GUI). A component name + may be substituted for ``NL1``. + + nl4 : str + Numbers of lines to be intersected pairwise. If ``NL1`` = ALL, find the pairwise intersection of + all selected lines and ``NL2`` to ``NL9`` are ignored. If ``NL1`` = P, graphical picking is + enabled and all remaining command fields are ignored (valid only in the GUI). A component name + may be substituted for ``NL1``. + + nl5 : str + Numbers of lines to be intersected pairwise. If ``NL1`` = ALL, find the pairwise intersection of + all selected lines and ``NL2`` to ``NL9`` are ignored. If ``NL1`` = P, graphical picking is + enabled and all remaining command fields are ignored (valid only in the GUI). A component name + may be substituted for ``NL1``. + + nl6 : str + Numbers of lines to be intersected pairwise. If ``NL1`` = ALL, find the pairwise intersection of + all selected lines and ``NL2`` to ``NL9`` are ignored. If ``NL1`` = P, graphical picking is + enabled and all remaining command fields are ignored (valid only in the GUI). A component name + may be substituted for ``NL1``. + + nl7 : str + Numbers of lines to be intersected pairwise. If ``NL1`` = ALL, find the pairwise intersection of + all selected lines and ``NL2`` to ``NL9`` are ignored. If ``NL1`` = P, graphical picking is + enabled and all remaining command fields are ignored (valid only in the GUI). A component name + may be substituted for ``NL1``. + + nl8 : str + Numbers of lines to be intersected pairwise. If ``NL1`` = ALL, find the pairwise intersection of + all selected lines and ``NL2`` to ``NL9`` are ignored. If ``NL1`` = P, graphical picking is + enabled and all remaining command fields are ignored (valid only in the GUI). A component name + may be substituted for ``NL1``. + + nl9 : str + Numbers of lines to be intersected pairwise. If ``NL1`` = ALL, find the pairwise intersection of + all selected lines and ``NL2`` to ``NL9`` are ignored. If ``NL1`` = P, graphical picking is + enabled and all remaining command fields are ignored (valid only in the GUI). A component name + may be substituted for ``NL1``. + + Notes + ----- + + .. _LINP_notes: + + Finds the pairwise intersection of lines. The pairwise intersection is defined as any and all + regions shared by at least two lines listed on this command. New lines will be generated where the + original lines intersect pairwise. If the regions of pairwise intersection are only points, new + keypoints will be generated. See the `Modeling and Meshing Guide + `_ for an + illustration. See the :ref:`boptn` command for + the options available to Boolean operations. Element attributes and solid model boundary conditions + assigned to the original entities will not be transferred to the new entities generated. + """ + command = f"LINP,{nl1},{nl2},{nl3},{nl4},{nl5},{nl6},{nl7},{nl8},{nl9}" + return self.run(command, **kwargs) + + def linv(self, nl: str = "", nv: str = "", **kwargs): + r"""Finds the intersection of a line with a volume. + + Mechanical APDL Command: `LINV `_ + + Parameters + ---------- + nl : str + Number of line to be intersected. If ``NL`` = P, graphical picking is enabled and all remaining + command fields are ignored (valid only in the GUI). + + nv : str + Number of volume to be intersected. + + Notes + ----- + + .. _LINV_notes: + + Finds the intersection of a line with a volume. New lines will be generated where the lines + intersect the volumes. If the regions of intersection are only points, new keypoints will be + generated instead. See the `Modeling and Meshing Guide + `_ for an + illustration. See the :ref:`boptn` command for the + options available to Boolean operations. Element attributes and solid model boundary conditions + assigned to the original entities will not be transferred to the new entities generated. + """ + command = f"LINV,{nl},{nv}" + return self.run(command, **kwargs) + + def lovlap( + self, + nl1: str = "", + nl2: str = "", + nl3: str = "", + nl4: str = "", + nl5: str = "", + nl6: str = "", + nl7: str = "", + nl8: str = "", + nl9: str = "", + **kwargs, + ): + r"""Overlaps lines. + + Mechanical APDL Command: `LOVLAP `_ + + Parameters + ---------- + nl1 : str + Numbers of lines to be overlapped. If ``NL1`` = ALL, ``NL2`` to ``NL9`` are ignored and all + selected lines are overlapped. If ``NL1`` = 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 + ``NL1``. + + nl2 : str + Numbers of lines to be overlapped. If ``NL1`` = ALL, ``NL2`` to ``NL9`` are ignored and all + selected lines are overlapped. If ``NL1`` = 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 + ``NL1``. + + nl3 : str + Numbers of lines to be overlapped. If ``NL1`` = ALL, ``NL2`` to ``NL9`` are ignored and all + selected lines are overlapped. If ``NL1`` = 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 + ``NL1``. + + nl4 : str + Numbers of lines to be overlapped. If ``NL1`` = ALL, ``NL2`` to ``NL9`` are ignored and all + selected lines are overlapped. If ``NL1`` = 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 + ``NL1``. + + nl5 : str + Numbers of lines to be overlapped. If ``NL1`` = ALL, ``NL2`` to ``NL9`` are ignored and all + selected lines are overlapped. If ``NL1`` = 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 + ``NL1``. + + nl6 : str + Numbers of lines to be overlapped. If ``NL1`` = ALL, ``NL2`` to ``NL9`` are ignored and all + selected lines are overlapped. If ``NL1`` = 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 + ``NL1``. + + nl7 : str + Numbers of lines to be overlapped. If ``NL1`` = ALL, ``NL2`` to ``NL9`` are ignored and all + selected lines are overlapped. If ``NL1`` = 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 + ``NL1``. + + nl8 : str + Numbers of lines to be overlapped. If ``NL1`` = ALL, ``NL2`` to ``NL9`` are ignored and all + selected lines are overlapped. If ``NL1`` = 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 + ``NL1``. + + nl9 : str + Numbers of lines to be overlapped. If ``NL1`` = ALL, ``NL2`` to ``NL9`` are ignored and all + selected lines are overlapped. If ``NL1`` = 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 + ``NL1``. + + Notes + ----- + + .. _LOVLAP_notes: + + Overlaps lines. Generates new lines which encompass the geometry of all the input lines. The new + lines are defined by the regions of intersection of the input lines, and by the complementary (non- + intersecting) regions. See the `Modeling and Meshing Guide + `_ for an + illustration. This operation is only valid when the + region of intersection is a line. See the :ref:`boptn` command for an explanation of the options + available to Boolean operations. Element attributes and solid model boundary conditions assigned to + the original entities will not be transferred to the new entities generated. + """ + command = f"LOVLAP,{nl1},{nl2},{nl3},{nl4},{nl5},{nl6},{nl7},{nl8},{nl9}" + return self.run(command, **kwargs) + + def lptn( + self, + nl1: str = "", + nl2: str = "", + nl3: str = "", + nl4: str = "", + nl5: str = "", + nl6: str = "", + nl7: str = "", + nl8: str = "", + nl9: str = "", + **kwargs, + ): + r"""Partitions lines. + + Mechanical APDL Command: `LPTN `_ + + Parameters + ---------- + nl1 : str + Numbers of lines to be operated on. If ``NL1`` = ALL, ``NL2`` to ``NL9`` are ignored all + selected lines are used. If ``NL1`` = P, graphical picking is enabled and all remaining command + fields are ignored (valid only in the GUI). A component name may be substituted for ``NL1``. + + nl2 : str + Numbers of lines to be operated on. If ``NL1`` = ALL, ``NL2`` to ``NL9`` are ignored all + selected lines are used. If ``NL1`` = P, graphical picking is enabled and all remaining command + fields are ignored (valid only in the GUI). A component name may be substituted for ``NL1``. + + nl3 : str + Numbers of lines to be operated on. If ``NL1`` = ALL, ``NL2`` to ``NL9`` are ignored all + selected lines are used. If ``NL1`` = P, graphical picking is enabled and all remaining command + fields are ignored (valid only in the GUI). A component name may be substituted for ``NL1``. + + nl4 : str + Numbers of lines to be operated on. If ``NL1`` = ALL, ``NL2`` to ``NL9`` are ignored all + selected lines are used. If ``NL1`` = P, graphical picking is enabled and all remaining command + fields are ignored (valid only in the GUI). A component name may be substituted for ``NL1``. + + nl5 : str + Numbers of lines to be operated on. If ``NL1`` = ALL, ``NL2`` to ``NL9`` are ignored all + selected lines are used. If ``NL1`` = P, graphical picking is enabled and all remaining command + fields are ignored (valid only in the GUI). A component name may be substituted for ``NL1``. + + nl6 : str + Numbers of lines to be operated on. If ``NL1`` = ALL, ``NL2`` to ``NL9`` are ignored all + selected lines are used. If ``NL1`` = P, graphical picking is enabled and all remaining command + fields are ignored (valid only in the GUI). A component name may be substituted for ``NL1``. + + nl7 : str + Numbers of lines to be operated on. If ``NL1`` = ALL, ``NL2`` to ``NL9`` are ignored all + selected lines are used. If ``NL1`` = P, graphical picking is enabled and all remaining command + fields are ignored (valid only in the GUI). A component name may be substituted for ``NL1``. + + nl8 : str + Numbers of lines to be operated on. If ``NL1`` = ALL, ``NL2`` to ``NL9`` are ignored all + selected lines are used. If ``NL1`` = P, graphical picking is enabled and all remaining command + fields are ignored (valid only in the GUI). A component name may be substituted for ``NL1``. + + nl9 : str + Numbers of lines to be operated on. If ``NL1`` = ALL, ``NL2`` to ``NL9`` are ignored all + selected lines are used. If ``NL1`` = P, graphical picking is enabled and all remaining command + fields are ignored (valid only in the GUI). A component name may be substituted for ``NL1``. + + Notes + ----- + + .. _LPTN_notes: + + Partitions lines. Generates new lines which encompass the geometry of all the input lines. The new + lines are defined by both the regions of intersection of the input lines and the complementary (non- + intersecting) regions. See the `Modeling and Meshing Guide + `_ for an + illustration. See the :ref:`boptn` command for an + explanation of the options available to Boolean operations. Element attributes and solid model + boundary conditions assigned to the original entities will not be transferred to the new entities + generated. + """ + command = f"LPTN,{nl1},{nl2},{nl3},{nl4},{nl5},{nl6},{nl7},{nl8},{nl9}" + return self.run(command, **kwargs) + + def lsba( + self, + nl: str = "", + na: str = "", + sepo: str = "", + keepl: str = "", + keepa: str = "", + **kwargs, + ): + r"""Subtracts areas from lines. + + Mechanical APDL Command: `LSBA `_ + + Parameters + ---------- + nl : str + Line (or lines, if picking is used) to be subtracted from. If ALL, use all selected lines. If + ``NL`` = 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 ``NL``. + + na : str + Area (or areas, if picking is used) to be subtracted. If ALL, use all selected areas. A + component name may also be substituted for ``NA``. + + sepo : str + Behavior if the intersection of the lines and the areas is a keypoint or keypoints: + + * ``(blank)`` - The resulting lines will share keypoint(s) where they touch. + + * ``SEPO`` - The resulting lines will have separate, but coincident keypoint(s) where they touch. + + keepl : str + Specifies whether ``NL`` lines are to be deleted: + + * ``(blank)`` - Use the setting of KEEP on the :ref:`boptn` command. + + * ``DELETE`` - Delete ``NL`` lines after :ref:`lsba` operation (override :ref:`boptn` command + settings). + + * ``KEEP`` - Keep ``NL`` lines after :ref:`lsba` operation (override :ref:`boptn` command settings). + + keepa : str + Specifies whether ``NA`` areas are to be deleted: + + * ``(blank)`` - Use the setting of KEEP on the :ref:`boptn` command. + + * ``DELETE`` - Delete areas after :ref:`lsba` operation (override :ref:`boptn` command settings). + + * ``KEEP`` - Keep areas after :ref:`lsba` operation (override :ref:`boptn` command settings). + + Notes + ----- + + .. _LSBA_notes: + + Generates new lines by subtracting the regions common to both ``NL`` lines and ``NA`` areas (the + intersection) from the ``NL`` lines. The intersection can be a line(s) or keypoint(s). If the + intersection is a keypoint and ``SEPO`` is blank, the ``NL`` line is divided at the keypoint and the + resulting lines will be connected, sharing a common keypoint where they touch. If ``SEPO`` is set to + SEPO, ``NL`` is divided into two unconnected lines with separate keypoints where they touch. See the + `Modeling and Meshing Guide + `_ for an + illustration. See the :ref:`boptn` command for an explanation of the options + available to Boolean operations. Element attributes and solid model boundary conditions assigned to + the original entities will not be transferred to the new entities generated. + """ + command = f"LSBA,{nl},{na},{sepo},{keepl},{keepa}" + return self.run(command, **kwargs) + + def lsbl( + self, + nl1: str = "", + nl2: str = "", + sepo: str = "", + keep1: str = "", + keep2: str = "", + **kwargs, + ): + r"""Subtracts lines from lines. + + Mechanical APDL Command: `LSBL `_ + + Parameters + ---------- + nl1 : str + Line (or lines, if picking is used) to be subtracted from. If ALL, use all selected lines. Lines + specified in this argument are not available for use in the ``NL2`` argument. If P, graphical + picking is enabled (valid only in the GUI) and all remaining fields are ignored. A component + name may also be substituted for ``NL1``. + + nl2 : str + Line (or lines, if picking is used) to subtract. If ALL, use all selected lines (except those + included in the ``NL1`` argument). A component name may also be substituted for ``NL2``. + + sepo : str + Behavior if the intersection of the ``NL1`` lines and the ``NL2`` lines is a keypoint or keypoints: + + * ``(blank)`` - The resulting lines will share keypoint(s) where they touch. + + * ``SEPO`` - The resulting lines will have separate, but coincident keypoint(s) where they touch. + + keep1 : str + Specifies whether ``NL1`` lines are to be deleted: + + * ``(blank)`` - Use the setting of KEEP on the :ref:`boptn` command. + + * ``DELETE`` - Delete ``NL1`` lines after :ref:`lsbl` operation (override :ref:`boptn` command + settings). + + * ``KEEP`` - Keep ``NL1`` lines after :ref:`lsbl` operation (override :ref:`boptn` command + settings). + + keep2 : str + Specifies whether ``NL2`` lines are to be deleted: + + * ``(blank)`` - Use the setting of KEEP on the :ref:`boptn` command. + + * ``DELETE`` - Delete ``NL2`` lines after :ref:`lsbl` operation (override :ref:`boptn` command + settings). + + * ``KEEP`` - Keep ``NL2`` lines after :ref:`lsbl` operation (override :ref:`boptn` command + settings). + + Notes + ----- + + .. _LSBL_notes: + + Generates new lines by subtracting the regions common to both ``NL1`` and ``NL2`` lines (the + intersection) from the ``NL1`` lines. The intersection can be a line(s) or point(s). If the + intersection is a point and ``SEPO`` is blank, the ``NL1`` line is divided at the point and the + resulting lines will be connected, sharing a common keypoint where they touch. If ``SEPO`` is set to + SEPO, ``NL1`` is divided into two unconnected lines with separate keypoints where they touch. See + the `Modeling and Meshing Guide + `_ for an + illustration. See the :ref:`boptn` command for an explanation of the options + available to Boolean operations. Element attributes and solid model boundary conditions assigned to + the original entities will not be transferred to the new entities generated. :ref:`lsbl`,ALL,ALL + will have no effect since all the lines (in ``NL1`` ) will be unavailable as ``NL2`` lines. + """ + command = f"LSBL,{nl1},{nl2},{sepo},{keep1},{keep2}" + return self.run(command, **kwargs) + + def lsbv( + self, + nl: str = "", + nv: str = "", + sepo: str = "", + keepl: str = "", + keepv: str = "", + **kwargs, + ): + r"""Subtracts volumes from lines. + + Mechanical APDL Command: `LSBV `_ + + Parameters + ---------- + nl : str + Line (or lines, if picking is used) to be subtracted from. If ALL, use all selected lines. If + ``NL`` = 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 ``NL``. + + nv : str + Volume (or volumes, if picking is used) to be subtracted. If ALL, use all selected volumes. A + component name may also be substituted for ``NV``. + + sepo : str + Behavior if the intersection of the ``NL`` lines and the ``NV`` volumes is a keypoint or keypoints: + + * ``(blank)`` - The resulting lines will share keypoint(s) where they touch. + + * ``SEPO`` - The resulting lines will have separate, but coincident keypoint(s) where they touch. + + keepl : str + Specifies whether ``NL`` lines are to be deleted: + + * ``(blank)`` - Use the setting of KEEP on the :ref:`boptn` command. + + * ``DELETE`` - Delete ``NL`` lines after :ref:`lsbv` operation (override :ref:`boptn` command + settings). + + * ``KEEP`` - Keep ``NL`` lines after :ref:`lsbv` operation (override :ref:`boptn` command settings). + + keepv : str + Specifies whether ``NV`` volumes are to be deleted: + + * ``(blank)`` - Use the setting of KEEP on the :ref:`boptn` command. + + * ``DELETE`` - Delete ``NV`` volumes after :ref:`lsbv` operation (override :ref:`boptn` command + settings). + + * ``KEEP`` - Keep ``NV`` volumes after :ref:`lsbv` operation (override :ref:`boptn` command + settings). + + Notes + ----- + + .. _LSBV_notes: + + Generates new lines by subtracting the regions common to both ``NL`` lines and ``NV`` volumes (the + intersection) from the ``NL`` lines. The intersection can be a line(s) or point(s). If the + intersection is a point and ``SEPO`` is blank, the ``NL1`` line is divided at the point and the + resulting lines will be connected, sharing a common keypoint where they touch. If ``SEPO`` is set to + SEPO, ``NL1`` is divided into two unconnected lines with separate keypoints where they touch. See + the `Modeling and Meshing Guide + `_ for an + illustration. See the :ref:`boptn` command for an explanation of the options + available to Boolean operations. Element attributes and solid model boundary conditions assigned to + the original entities will not be transferred to the new entities generated. :ref:`lsbl`,ALL,ALL + will have no effect since all the lines (in ``NL1`` ) will be unavailable as ``NL2`` lines. + """ + command = f"LSBV,{nl},{nv},{sepo},{keepl},{keepv}" + return self.run(command, **kwargs) + + def lsbw(self, nl: str = "", sepo: str = "", keep: str = "", **kwargs): + r"""Subtracts the intersection of the working plane from lines (divides lines). + + Mechanical APDL Command: `LSBW `_ + + Parameters + ---------- + nl : str + Line (or lines, if picking is used) to be subtracted from. If ``NL`` = ALL, use all selected + lines. If ``NL`` = P, graphical picking is enabled and all remaining command fields are ignored + (valid only in the GUI). A component name may also be input for ``NL``. + + sepo : str + Behavior of the created boundary. + + * ``(blank)`` - The resulting lines will share keypoint(s) where they touch. + + * ``SEPO`` - The resulting lines will have separate, but coincident keypoint(s). + + keep : str + Specifies whether ``NL`` lines are to be deleted: + + * ``(blank)`` - Use the setting of KEEP on the :ref:`boptn` command. + + * ``DELETE`` - Delete ``NL`` lines after :ref:`lsbw` operation (override :ref:`boptn` command + settings). + + * ``KEEP`` - Keep ``NL`` lines after :ref:`lsbw` operation (override :ref:`boptn` command settings). + + Notes + ----- + + .. _LSBW_notes: + + Generates new lines by subtracting the intersection of the working plane from the ``NL`` lines. The + intersection will be a keypoint(s). The working plane must not be in the same plane as the ``NL`` + line(s). If ``SEPO`` is blank, the ``NL`` line is divided and the resulting lines will be connected, + sharing a common keypoint where they touch. If ``SEPO`` is set to SEPO, ``NL`` is divided into two + unconnected lines with separate keypoints. See the `Modeling and Meshing Guide + `_ for an + illustration. See the + :ref:`boptn` command for an explanation of the options available to Boolean operations. Element + attributes and solid model boundary conditions assigned to the original entities will not be + transferred to the new entities generated. Areas that completely contain the input lines will be + updated if the lines are divided by this operation. + """ + command = f"LSBW,{nl},{sepo},{keep}" + return self.run(command, **kwargs) + + def vadd( + self, + nv1: str = "", + nv2: str = "", + nv3: str = "", + nv4: str = "", + nv5: str = "", + nv6: str = "", + nv7: str = "", + nv8: str = "", + nv9: str = "", + **kwargs, + ): + r"""Adds separate volumes to create a single volume. + + Mechanical APDL Command: `VADD `_ + + Parameters + ---------- + nv1 : str + Numbers of volumes to be added. If ``NV1`` = ALL, add all selected volumes and ignore ``NV2`` to + ``NV9``. 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 : str + Numbers of volumes to be added. If ``NV1`` = ALL, add all selected volumes and ignore ``NV2`` to + ``NV9``. 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``. + + nv3 : str + Numbers of volumes to be added. If ``NV1`` = ALL, add all selected volumes and ignore ``NV2`` to + ``NV9``. 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``. + + nv4 : str + Numbers of volumes to be added. If ``NV1`` = ALL, add all selected volumes and ignore ``NV2`` to + ``NV9``. 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``. + + nv5 : str + Numbers of volumes to be added. If ``NV1`` = ALL, add all selected volumes and ignore ``NV2`` to + ``NV9``. 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``. + + nv6 : str + Numbers of volumes to be added. If ``NV1`` = ALL, add all selected volumes and ignore ``NV2`` to + ``NV9``. 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``. + + nv7 : str + Numbers of volumes to be added. If ``NV1`` = ALL, add all selected volumes and ignore ``NV2`` to + ``NV9``. 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``. + + nv8 : str + Numbers of volumes to be added. If ``NV1`` = ALL, add all selected volumes and ignore ``NV2`` to + ``NV9``. 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``. + + nv9 : str + Numbers of volumes to be added. If ``NV1`` = ALL, add all selected volumes and ignore ``NV2`` to + ``NV9``. 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``. + + Notes + ----- + + .. _VADD_notes: + + Adds separate volumes to create a single volume. The original volumes (and their corresponding + areas, lines and keypoints) will be deleted by default ( :ref:`boptn` ). See the :ref:`boptn` + command for the options available to Boolean operations. Element attributes and solid model boundary + conditions assigned to the original entities will not be transferred to the new entities generated. + Concatenated entities are not valid with this command. + """ + command = f"VADD,{nv1},{nv2},{nv3},{nv4},{nv5},{nv6},{nv7},{nv8},{nv9}" + return self.run(command, **kwargs) + + def vglue( + self, + nv1: str = "", + nv2: str = "", + nv3: str = "", + nv4: str = "", + nv5: str = "", + nv6: str = "", + nv7: str = "", + nv8: str = "", + nv9: str = "", + **kwargs, + ): + r"""Generates new volumes by "gluing" volumes. + + Mechanical APDL Command: `VGLUE `_ + + Parameters + ---------- + nv1 : str + Numbers of the volumes to be glued. If ``NV1`` = ALL, all selected volumes will be glued ( + ``NV2`` to ``NV9`` will be ignored). 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 : str + Numbers of the volumes to be glued. If ``NV1`` = ALL, all selected volumes will be glued ( + ``NV2`` to ``NV9`` will be ignored). 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``. + + nv3 : str + Numbers of the volumes to be glued. If ``NV1`` = ALL, all selected volumes will be glued ( + ``NV2`` to ``NV9`` will be ignored). 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``. + + nv4 : str + Numbers of the volumes to be glued. If ``NV1`` = ALL, all selected volumes will be glued ( + ``NV2`` to ``NV9`` will be ignored). 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``. + + nv5 : str + Numbers of the volumes to be glued. If ``NV1`` = ALL, all selected volumes will be glued ( + ``NV2`` to ``NV9`` will be ignored). 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``. + + nv6 : str + Numbers of the volumes to be glued. If ``NV1`` = ALL, all selected volumes will be glued ( + ``NV2`` to ``NV9`` will be ignored). 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``. + + nv7 : str + Numbers of the volumes to be glued. If ``NV1`` = ALL, all selected volumes will be glued ( + ``NV2`` to ``NV9`` will be ignored). 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``. + + nv8 : str + Numbers of the volumes to be glued. If ``NV1`` = ALL, all selected volumes will be glued ( + ``NV2`` to ``NV9`` will be ignored). 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``. + + nv9 : str + Numbers of the volumes to be glued. If ``NV1`` = ALL, all selected volumes will be glued ( + ``NV2`` to ``NV9`` will be ignored). 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``. + + Notes + ----- + + .. _VGLUE_notes: + + Use of the :ref:`vglue` command generates new volumes by gluing input volumes. The glue operation + redefines the input volumes so that they share areas along their common boundaries. The new volumes + encompass the same geometry as the original volumes. This operation is only valid if the + intersections of the input volumes are areas along the boundaries of those volumes. See the + `Modeling and Meshing Guide + `_ + for an illustration. See the :ref:`boptn` command for an explanation of the options available to + Boolean operations. Element attributes and solid model boundary conditions assigned to the original + entities will not be transferred to the new entities generated. + + The :ref:`vglue` command results in the merging of areas, lines, and keypoints at the common volume + boundaries. The areas, lines, and keypoints of the lower numbered volume will be kept. This means + one must be aware of volume numbering when multiple :ref:`vglue` commands are applied to avoid any + ungluing of geometry. + """ + command = f"VGLUE,{nv1},{nv2},{nv3},{nv4},{nv5},{nv6},{nv7},{nv8},{nv9}" + return self.run(command, **kwargs) + + def vinp( + self, + nv1: str = "", + nv2: str = "", + nv3: str = "", + nv4: str = "", + nv5: str = "", + nv6: str = "", + nv7: str = "", + nv8: str = "", + nv9: str = "", + **kwargs, + ): + r"""Finds the pairwise intersection of volumes. + + Mechanical APDL Command: `VINP `_ + + Parameters + ---------- + nv1 : str + Numbers of volumes to be intersected pairwise. If ``NV1`` = ALL, ``NV2`` to ``NV9`` are ignored + and the pairwise intersection of all selected volumes is found. 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 : str + Numbers of volumes to be intersected pairwise. If ``NV1`` = ALL, ``NV2`` to ``NV9`` are ignored + and the pairwise intersection of all selected volumes is found. 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``. + + nv3 : str + Numbers of volumes to be intersected pairwise. If ``NV1`` = ALL, ``NV2`` to ``NV9`` are ignored + and the pairwise intersection of all selected volumes is found. 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``. + + nv4 : str + Numbers of volumes to be intersected pairwise. If ``NV1`` = ALL, ``NV2`` to ``NV9`` are ignored + and the pairwise intersection of all selected volumes is found. 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``. + + nv5 : str + Numbers of volumes to be intersected pairwise. If ``NV1`` = ALL, ``NV2`` to ``NV9`` are ignored + and the pairwise intersection of all selected volumes is found. 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``. + + nv6 : str + Numbers of volumes to be intersected pairwise. If ``NV1`` = ALL, ``NV2`` to ``NV9`` are ignored + and the pairwise intersection of all selected volumes is found. 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``. + + nv7 : str + Numbers of volumes to be intersected pairwise. If ``NV1`` = ALL, ``NV2`` to ``NV9`` are ignored + and the pairwise intersection of all selected volumes is found. 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``. + + nv8 : str + Numbers of volumes to be intersected pairwise. If ``NV1`` = ALL, ``NV2`` to ``NV9`` are ignored + and the pairwise intersection of all selected volumes is found. 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``. + + nv9 : str + Numbers of volumes to be intersected pairwise. If ``NV1`` = ALL, ``NV2`` to ``NV9`` are ignored + and the pairwise intersection of all selected volumes is found. 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``. + + Notes + ----- + + .. _VINP_notes: + + Finds the pairwise intersection of volumes. The pairwise intersection is defined as all regions + shared by any two or more volumes listed on this command. New volumes will be generated where the + original volumes intersect pairwise. If the regions of pairwise intersection are only areas, new + areas will be generated. See the `Modeling and Meshing Guide + `_ for an + illustration. See the :ref:`boptn` command for an + explanation of the options available to Boolean operations. Element attributes and solid model + boundary conditions assigned to the original entities will not be transferred to the new entities + generated. + """ + command = f"VINP,{nv1},{nv2},{nv3},{nv4},{nv5},{nv6},{nv7},{nv8},{nv9}" + return self.run(command, **kwargs) + + def vinv( + self, + nv1: str = "", + nv2: str = "", + nv3: str = "", + nv4: str = "", + nv5: str = "", + nv6: str = "", + nv7: str = "", + nv8: str = "", + nv9: str = "", + **kwargs, + ): + r"""Finds the intersection of volumes. + + Mechanical APDL Command: `VINV `_ + + Parameters + ---------- + nv1 : str + Numbers of volumes to be intersected. If ``NV1`` = ALL, ``NV2`` to ``NV9`` are ignored, and the + intersection of all selected volumes is found. 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 : str + Numbers of volumes to be intersected. If ``NV1`` = ALL, ``NV2`` to ``NV9`` are ignored, and the + intersection of all selected volumes is found. 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``. + + nv3 : str + Numbers of volumes to be intersected. If ``NV1`` = ALL, ``NV2`` to ``NV9`` are ignored, and the + intersection of all selected volumes is found. 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``. + + nv4 : str + Numbers of volumes to be intersected. If ``NV1`` = ALL, ``NV2`` to ``NV9`` are ignored, and the + intersection of all selected volumes is found. 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``. + + nv5 : str + Numbers of volumes to be intersected. If ``NV1`` = ALL, ``NV2`` to ``NV9`` are ignored, and the + intersection of all selected volumes is found. 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``. + + nv6 : str + Numbers of volumes to be intersected. If ``NV1`` = ALL, ``NV2`` to ``NV9`` are ignored, and the + intersection of all selected volumes is found. 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``. + + nv7 : str + Numbers of volumes to be intersected. If ``NV1`` = ALL, ``NV2`` to ``NV9`` are ignored, and the + intersection of all selected volumes is found. 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``. + + nv8 : str + Numbers of volumes to be intersected. If ``NV1`` = ALL, ``NV2`` to ``NV9`` are ignored, and the + intersection of all selected volumes is found. 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``. + + nv9 : str + Numbers of volumes to be intersected. If ``NV1`` = ALL, ``NV2`` to ``NV9`` are ignored, and the + intersection of all selected volumes is found. 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``. + + Notes + ----- + + .. _VINV_notes: + + Finds the common (not pairwise) intersection of volumes. The common intersection is defined as the + regions shared (in common) by **all** volumes listed on this command. New volumes will be generated + where the original volumes intersect. + If the regions of intersection are only areas, new areas will be generated instead. See the + `Modeling and Meshing Guide + `_ + for an illustration. See the :ref:`boptn` command for an explanation of the options available to + Boolean operations. Element attributes and solid model boundary conditions assigned to the original + entities will not be transferred to the new entities generated. + """ + command = f"VINV,{nv1},{nv2},{nv3},{nv4},{nv5},{nv6},{nv7},{nv8},{nv9}" + return self.run(command, **kwargs) + + def vovlap( + self, + nv1: str = "", + nv2: str = "", + nv3: str = "", + nv4: str = "", + nv5: str = "", + nv6: str = "", + nv7: str = "", + nv8: str = "", + nv9: str = "", + **kwargs, + ): + r"""Overlaps volumes. + + Mechanical APDL Command: `VOVLAP `_ + + Parameters + ---------- + nv1 : str + Numbers of volumes to be operated on. If ``NV1`` = ALL, ``NV2`` to ``NV9`` are ignored and all + selected volumes are used. 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 : str + Numbers of volumes to be operated on. If ``NV1`` = ALL, ``NV2`` to ``NV9`` are ignored and all + selected volumes are used. 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``. + + nv3 : str + Numbers of volumes to be operated on. If ``NV1`` = ALL, ``NV2`` to ``NV9`` are ignored and all + selected volumes are used. 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``. + + nv4 : str + Numbers of volumes to be operated on. If ``NV1`` = ALL, ``NV2`` to ``NV9`` are ignored and all + selected volumes are used. 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``. + + nv5 : str + Numbers of volumes to be operated on. If ``NV1`` = ALL, ``NV2`` to ``NV9`` are ignored and all + selected volumes are used. 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``. + + nv6 : str + Numbers of volumes to be operated on. If ``NV1`` = ALL, ``NV2`` to ``NV9`` are ignored and all + selected volumes are used. 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``. + + nv7 : str + Numbers of volumes to be operated on. If ``NV1`` = ALL, ``NV2`` to ``NV9`` are ignored and all + selected volumes are used. 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``. + + nv8 : str + Numbers of volumes to be operated on. If ``NV1`` = ALL, ``NV2`` to ``NV9`` are ignored and all + selected volumes are used. 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``. + + nv9 : str + Numbers of volumes to be operated on. If ``NV1`` = ALL, ``NV2`` to ``NV9`` are ignored and all + selected volumes are used. 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``. + + Notes + ----- + + .. _VOVLAP_notes: + + Overlaps volumes. Generates new volumes which encompass the geometry of all the input volumes. The + new volumes are defined by the regions of intersection of the input volumes, and by the + complementary (non-intersecting) regions. See the `Modeling and Meshing Guide + `_ for an + illustration. This operation is + only valid when the region of intersection is a volume. See the :ref:`boptn` command for an + explanation of the options available to Boolean operations. Element attributes and solid model + boundary conditions assigned to the original entities will not be transferred to the new entities + generated. + """ + command = f"VOVLAP,{nv1},{nv2},{nv3},{nv4},{nv5},{nv6},{nv7},{nv8},{nv9}" + return self.run(command, **kwargs) + + def vptn( + self, + nv1: str = "", + nv2: str = "", + nv3: str = "", + nv4: str = "", + nv5: str = "", + nv6: str = "", + nv7: str = "", + nv8: str = "", + nv9: str = "", + **kwargs, + ): + r"""Partitions volumes. + + Mechanical APDL Command: `VPTN `_ + + Parameters + ---------- + nv1 : str + Numbers of volumes to be operated on. If ``NV1`` = ALL, ``NV2`` to ``NV9`` are ignored and all + selected volumes are used. 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 : str + Numbers of volumes to be operated on. If ``NV1`` = ALL, ``NV2`` to ``NV9`` are ignored and all + selected volumes are used. 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``. + + nv3 : str + Numbers of volumes to be operated on. If ``NV1`` = ALL, ``NV2`` to ``NV9`` are ignored and all + selected volumes are used. 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``. + + nv4 : str + Numbers of volumes to be operated on. If ``NV1`` = ALL, ``NV2`` to ``NV9`` are ignored and all + selected volumes are used. 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``. + + nv5 : str + Numbers of volumes to be operated on. If ``NV1`` = ALL, ``NV2`` to ``NV9`` are ignored and all + selected volumes are used. 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``. + + nv6 : str + Numbers of volumes to be operated on. If ``NV1`` = ALL, ``NV2`` to ``NV9`` are ignored and all + selected volumes are used. 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``. + + nv7 : str + Numbers of volumes to be operated on. If ``NV1`` = ALL, ``NV2`` to ``NV9`` are ignored and all + selected volumes are used. 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``. + + nv8 : str + Numbers of volumes to be operated on. If ``NV1`` = ALL, ``NV2`` to ``NV9`` are ignored and all + selected volumes are used. 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``. + + nv9 : str + Numbers of volumes to be operated on. If ``NV1`` = ALL, ``NV2`` to ``NV9`` are ignored and all + selected volumes are used. 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``. + + Notes + ----- + + .. _VPTN_notes: + + Partitions volumes. Generates new volumes which encompass the geometry of all the input volumes. The + new volumes are defined by the regions of intersection of the input volumes, and by the + complementary (non-intersecting) regions. See the `Modeling and Meshing Guide + `_ for an + illustration. See the :ref:`boptn` + command for an explanation of the options available to Boolean operations. Element attributes and + solid model boundary conditions assigned to the original entities will not be transferred to the new + entities generated. + """ + command = f"VPTN,{nv1},{nv2},{nv3},{nv4},{nv5},{nv6},{nv7},{nv8},{nv9}" + return self.run(command, **kwargs) + + def vsba( + self, + nv: str = "", + na: str = "", + sepo: str = "", + keepv: str = "", + keepa: str = "", + **kwargs, + ): + r"""Subtracts areas from volumes. + + Mechanical APDL Command: `VSBA `_ + + Parameters + ---------- + nv : str + Volume (or volumes, if picking is used) to be subtracted from. If ALL, use all selected volumes. + If P, graphical picking is enabled (valid only in the GUI) and remaining fields are ignored. A + component name may also be substituted for ``NV``. + + na : str + Area (or areas, if picking is used) to subtract. If ALL, use all selected areas. A component + name may also be substituted for ``NA``. + + sepo : str + Behavior of the touching boundary: + + * ``(blank)`` - The resulting volumes will share area(s) where they touch. + + * ``SEPO`` - The resulting volumes will have separate, but coincident area(s) where they touch. + + keepv : str + Specifies whether ``NV`` volumes are to be deleted: + + * ``(blank)`` - Use the setting of KEEP on the :ref:`boptn` command. + + * ``DELETE`` - Delete ``NV`` volumes after :ref:`vsba` operation (override :ref:`boptn` command + settings). + + * ``KEEP`` - Keep ``NV`` volumes after :ref:`vsba` operation (override :ref:`boptn` command + settings). + + keepa : str + Specifies whether ``NA`` areas are to be deleted: + + * ``(blank)`` - Use the setting of KEEP on the :ref:`boptn` command. + + * ``DELETE`` - Delete ``NA`` areas after :ref:`vsba` operation (override :ref:`boptn` command + settings). + + * ``KEEP`` - Keep ``NA`` areas after :ref:`vsba` operation (override :ref:`boptn` command settings). + + Notes + ----- + + .. _VSBA_notes: + + Generates new volumes by subtracting the regions common to both the volumes and areas (the + intersection) from the ``NV`` volumes. The intersection will be an area(s). If ``SEPO`` is blank, + the volume is divided at the area and the resulting volumes will be connected, sharing a common area + where they touch. If ``SEPO`` is set to SEPO, the volume is divided into two unconnected volumes + with separate areas where they touch. See the `Modeling and Meshing Guide + `_ for an + illustration. See the :ref:`boptn` + command for an explanation of the options available to Boolean operations. Element attributes and + solid model boundary conditions assigned to the original entities will not be transferred to the new + entities generated. + """ + command = f"VSBA,{nv},{na},{sepo},{keepv},{keepa}" + return self.run(command, **kwargs) + + def vsbv( + self, + nv1: str = "", + nv2: str = "", + sepo: str = "", + keep1: str = "", + keep2: str = "", + **kwargs, + ): + r"""Subtracts volumes from volumes. + + Mechanical APDL Command: `VSBV `_ + + Parameters + ---------- + nv1 : str + Volume (or volumes, if picking is used) to be subtracted from. If ALL, use all selected volumes. + Volumes specified in set ``NV2`` are removed from set ``NV1``. If P, graphical picking is + enabled (valid only in the GUI) and remaining fields are ignored. A component name may also be + substituted for ``NV1``. + + nv2 : str + Volume (or volumes, if picking is used) to subtract. If ALL, use all selected volumes (except + those included in the ``NV1`` argument). A component name may also be substituted for ``NV2``. + + sepo : str + Behavior if the intersection of the ``NV1`` volumes and the ``NV2`` volumes is an area or areas: + + * ``(blank)`` - The resulting volumes will share area(s) where they touch. + + * ``SEPO`` - The resulting volumes will have separate, but coincident area(s) where they touch. + + keep1 : str + Specifies whether ``NV1`` volumes are to be deleted: + + * ``(blank)`` - Use the setting of ``KEEP`` on the :ref:`boptn` command. + + * ``DELETE`` - Delete ``NV1`` volumes after :ref:`vsbv` operation (override :ref:`boptn` command + settings). + + * ``KEEP`` - Keep ``NV1`` volumes after :ref:`vsbv` operation (override :ref:`boptn` command + settings). + + keep2 : str + Specifies whether ``NV2`` volumes are to be deleted: + + * ``(blank)`` - Use the setting of ``KEEP`` on the :ref:`boptn` command. + + * ``DELETE`` - Delete ``NV2`` volumes after :ref:`vsbv` operation (override :ref:`boptn` command + settings). + + * ``KEEP`` - Keep ``NV2`` volumes after :ref:`vsbv` operation (override :ref:`boptn` command + settings). + + Notes + ----- + + .. _VSBV_notes: + + Generates new volumes by subtracting the regions common to both ``NV1`` and ``NV2`` volumes (the + intersection) from the ``NV1`` volumes. The intersection can be a volume(s) or area(s). If the + intersection is an area and ``SEPO`` is blank, the ``NV1`` volume is divided at the area and the + resulting volumes will be connected, sharing a common area where they touch. If ``SEPO`` is set to + SEPO, ``NV1`` is divided into two unconnected volumes with separate areas where they touch. See the + `Modeling and Meshing Guide + `_ for an + illustration. See the :ref:`boptn` command for an explanation of the options + available to Boolean operations. Element attributes and solid model boundary conditions assigned to + the original entities will not be transferred to the new entities generated. :ref:`vsbv`,ALL,ALL + will have no effect because all the volumes in set ``NV1`` will have been moved to set ``NV2``. + """ + command = f"VSBV,{nv1},{nv2},{sepo},{keep1},{keep2}" + return self.run(command, **kwargs) + + def vsbw(self, nv: str = "", sepo: str = "", keep: str = "", **kwargs): + r"""Subtracts intersection of the working plane from volumes (divides volumes). + + Mechanical APDL Command: `VSBW `_ + + Parameters + ---------- + nv : str + Volume (or volumes, if picking is used) to be subtracted from. If ``NV`` = ALL, use all selected + volumes. If ``NV`` = P, graphical picking is enabled (valid only in the GUI). A component name + may also be input for ``NV``. + + sepo : str + Behavior of the created boundary. + + * ``(blank)`` - The resulting volumes will share area(s) where they touch. + + * ``SEPO`` - The resulting volumes will have separate, but coincident area(s). + + keep : str + Specifies whether ``NV`` volumes are to be deleted. + + * ``(blank)`` - Use the setting of ``KEEP`` on the :ref:`boptn` command. + + * ``DELETE`` - Delete ``NV`` volumes after :ref:`vsbw` operation (override :ref:`boptn` command + settings). + + * ``KEEP`` - Keep ``NV`` volumes after :ref:`vsbw` operation (override :ref:`boptn` command + settings). + + Notes + ----- + + .. _VSBW_notes: + + Generates new volumes by subtracting the intersection of the working plane from the ``NV`` volumes. + The intersection will be an area(s). If ``SEPO`` is blank, the volume is divided at the area and the + resulting volumes will be connected, sharing a common area where they touch. If ``SEPO`` is set to + SEPO, the volume is divided into two unconnected volumes with separate areas. The SEPO option may + cause unintended consequences if any keypoints exist along the cut plane. See the `Modeling and + Meshing Guide `_ + for an + illustration. See the :ref:`boptn` command for an explanation of the options available to Boolean + operations. Element attributes and solid model boundary conditions assigned to the original entities + will not be transferred to the new entities generated. + + Issuing the :ref:`vsbw` command under certain conditions may generate a topological degeneracy + error. Do not issue the command if: + + * A sphere or cylinder has been scaled. (A cylinder must be scaled unevenly in the XY plane.) + + * A sphere or cylinder has not been scaled but the work plane has been rotated. + """ + command = f"VSBW,{nv},{sepo},{keep}" + return self.run(command, **kwargs) diff --git a/src/ansys/mapdl/core/_commands/prep7/constraint_equations.py b/src/ansys/mapdl/core/_commands/prep7/constraint_equations.py new file mode 100644 index 00000000000..7a1b9a8165f --- /dev/null +++ b/src/ansys/mapdl/core/_commands/prep7/constraint_equations.py @@ -0,0 +1,889 @@ +# 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 ConstraintEquations: + + def ce( + self, + neqn: str = "", + const: str = "", + node1: str = "", + lab1: str = "", + c1: str = "", + node2: str = "", + lab2: str = "", + c2: str = "", + node3: str = "", + lab3: str = "", + c3: str = "", + **kwargs, + ): + r"""Defines a constraint equation relating degrees of freedom. + + Mechanical APDL Command: `CE `_ + + Parameters + ---------- + neqn : str + Set equation reference number: + + * ``n`` - Arbitrary set number. + + * ``HIGH`` - The highest defined constraint equation number. This option is especially useful when + adding nodes to an existing set. + + * ``NEXT`` - The highest defined constraint equation number plus one. This option automatically + numbers coupled sets so that existing sets are not modified. + + The default value is HIGH. + + const : str + Constant term of equation. + + node1 : str + Node for first term of equation. If - ``NODE1``, this term is deleted from the equation. + + lab1 : str + Degree of freedom label for first term of equation. Structural labels: UX, UY, or UZ + (displacements); ROTX, ROTY, or ROTZ (rotations, in radians). Thermal labels: TEMP, TBOT, TE2, + TE3, ..., TTOP (temperature). Electric labels: VOLT (voltage). Magnetic labels: MAG (scalar + magnetic potential); AZ (vector magnetic potential). Diffusion label: CONC (concentration). + + c1 : str + Coefficient for first node term of equation. If zero, this term is ignored. + + node2 : str + Node, label, and coefficient for second term. + + lab2 : str + Node, label, and coefficient for second term. + + c2 : str + Node, label, and coefficient for second term. + + node3 : str + Node, label, and coefficient for third term. + + lab3 : str + Node, label, and coefficient for third term. + + c3 : str + Node, label, and coefficient for third term. + + Notes + ----- + + .. _CE_notes: + + Repeat the :ref:`ce` command to add additional terms to the same equation. To change only the + constant term, repeat the command with no node terms specified. Only the constant term can be + changed during solution, and only with the :ref:`cecmod` command. + + Linear constraint equations may be used to relate the degrees of freedom of selected nodes in a more + general manner than described for nodal coupling ( :ref:`cp` ). The constraint equation is of the + form: + + .. math:: + + equation not available + + where U(I) is the degree of freedom (displacement, temperature, etc.) of term (I). The following + example is a set of two constraint equations, each containing three terms: + + 0.0 = 3.0* (1 UX) + 3.0* (4 UX) + (-2.0)* (4 ROTY) + + 2.0 = 6.0* (2 UX) + 10.0* (4 UY) + 1.0* (3 UZ) + + The first unique degree of freedom in the equation is eliminated in terms of all other degrees of + freedom in the equation. A unique degree of freedom is one which is not specified in any other + constraint equation, coupled node set, specified displacement set, or master degree of freedom set. + It is recommended that the first term of the equation be the degree of freedom to be eliminated. The + first term of the equation cannot contain a master degree of freedom, and no term can contain + coupled degrees of freedom. The same degree of freedom may be specified in more than one equation + but care must be taken to avoid over-specification (over-constraint). + + The degrees of freedom specified in the equation (that is, UX, UY, ROTZ, etc.) must also be included + in the model (as determined from the element types ( :ref:`et` )). Also, each node in the equation + must be defined on an element (any element type containing that degree of freedom will do). + + For buckling and modal analyses, the constant term of the equation will not be taken into account + (that is, ``CONST`` is always zero). + + Note that under certain circumstances a constraint equation generated by :ref:`ce` may be modified + during the solution. See for more information. + """ + command = f"CE,{neqn},{const},{node1},{lab1},{c1},{node2},{lab2},{c2},{node3},{lab3},{c3}" + return self.run(command, **kwargs) + + def cecycms( + self, + cyclownod: str = "", + cychighnod: str = "", + kmap: str = "", + toler: str = "", + kprint: int | str = "", + usrnmap: str = "", + **kwargs, + ): + r"""Generates the constraint equations for a `multistage cyclic symmetry analysis + `_. + + Mechanical APDL Command: `CECYCMS `_ + + Parameters + ---------- + cyclownod : str + The name of a component for the nodes located on the low angle edge of the sector (up to 256 + characters enclosed in single quotes). + + The sector is that of the current stage ( ``Sname`` ) specified with :ref:`msopt`,NEW, ``Sname`` + or :ref:`msopt`,MODIFY, ``Sname``. If blank and if the array parameter of edge node pairs does + not exist (no user-defined or default for ``UsrNMap`` ), the default component name is ‘ + ``Sname`` _CYCLOW_NOD``. + + cychighnod : str + The name of a component for the nodes located on the high angle edge of the sector (up to 256 + characters enclosed in single quotes). + + The sector is that of the current stage ( ``Sname`` ) specified with :ref:`msopt`,NEW, ``Sname`` + or :ref:`msopt`,MODIFY, ``Sname``. If blank and if the array parameter of edge node pairs does + not exist (no user-defined or default for ``UsrNMap`` ), the default component name is ‘ + ``Sname`` _CYCHIGH_NOD``. + + kmap : str + Option to use mapping when creating cyclic symmetry constraint equations. This option is ignored if + you specify ``UsrNMap``. + + * ``ON`` - Use mapping to relate low and high sector boundary DOFs when applying cyclic symmetry + constraint equations. + + * ``OFF`` - Use matching node pairs from low and high sector boundaries to apply cyclic symmetry + constraint equations (default). + + toler : str + Tolerance for determining if one node on the low edge boundary matches the corresponding node on the + high edge boundary after the nodes are rotated. + + * ``If positive`` - ``TOLER`` is absolute (length units, defaults to 1e-4 ). If the distance of the + nodes is smaller than this absolute tolerance, the nodes are matched. + + * ``If negative`` - ``TOLER`` is relative. Considering the diagonal of an imaginary box enclosing + the model, ``TOLER`` is a fraction of the length of that diagonal. Nodes within the relative + tolerance are matched. + + kprint : int or str + Option to print the table of matched nodes ( ``KMAP`` = OFF) or mapped nodes and elements ( ``KMAP`` + = ON). + + * ``0`` - Do not print the table (default). + + * ``1`` - Print the table. If edge nodes are mapped ( ``KMAP`` = ON) and a high edge node is + matching a low edge node, the third column labeled MAPPED lists the node number. (See :ref:`Snippets + of Table Printed with ` ``KPRINT`` = 1 on :ref:`cecycms` ). + + usrnmap : str + Option for matching node pairs between low and high edges. + + Input the name of an existing array parameter or a numerical key: + + * ```` - Name of a user-defined array parameter that specifies the matching node pairs. The + node pairs in the parameter may be input in any order, but the low edge node must be the first entry + in each pair. (See :ref:`Example: ` :ref:`cecycms` with a User-defined Array + Parameter for ``UsrNMap``.) + + * ``0 ( or blank)`` - If the default array parameter named ``Sname`` _CYCNODPAIR already exists, + it is used to specify the matching node pairs (default). + + If this array parameter does not exist, nodes are paired automatically, and the array parameter + named ``Sname`` _CYCNODPAIR is created. + + * ``1`` - Nodes are paired automatically, and the array parameter named ``Sname`` _CYCNODPAIR is + created. If it exists, it is deleted and re-created. + + * ``-1`` - Nodes are paired automatically without creating or using an array parameter. + + Notes + ----- + + .. _CECYCMS_notes: + + :ref:`cecycms`, :ref:`ceims`, and :ref:`msopt` are commands used in a `multistage cyclic symmetry + analysis + `_. + + If edge node pairs are matched ( ``KMAP`` = OFF) and an array parameter is not specified for + ``UsrNMap``, components are used for the cyclic edge nodes. You must specify those components using + the :ref:`cm` command and ensure that they contain base sector nodes only. See `Building the Model + `_ + :ref:`Example Usage for examples demonstrating the use of ` :ref:`cecycms` in + multistage cyclic symmetry analyses. + + This command contains some tables and extra information which can be inspected in the original + documentation pointed above. + + This command contains some tables and extra information which can be inspected in the original + documentation pointed above. + + **Example Usage** + + .. _CECYCMS_ExampleUse: + + `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"CECYCMS,{cyclownod},{cychighnod},,{kmap},{toler},,{kprint},{usrnmap}" + ) + return self.run(command, **kwargs) + + def cedele( + self, neqn1: str = "", neqn2: str = "", ninc: str = "", nsel: str = "", **kwargs + ): + r"""Deletes constraint equations. + + Mechanical APDL Command: `CEDELE `_ + + Parameters + ---------- + neqn1 : str + Delete constraint equations from ``NEQN1`` to ``NEQN2`` (defaults to ``NEQN1`` ) in steps of + ``NINC`` (defaults to 1). If ``NEQN1`` = ALL, ``NEQN2`` and ``NINC`` will be ignored all + constraint equations will be deleted. + + neqn2 : str + Delete constraint equations from ``NEQN1`` to ``NEQN2`` (defaults to ``NEQN1`` ) in steps of + ``NINC`` (defaults to 1). If ``NEQN1`` = ALL, ``NEQN2`` and ``NINC`` will be ignored all + constraint equations will be deleted. + + ninc : str + Delete constraint equations from ``NEQN1`` to ``NEQN2`` (defaults to ``NEQN1`` ) in steps of + ``NINC`` (defaults to 1). If ``NEQN1`` = ALL, ``NEQN2`` and ``NINC`` will be ignored all + constraint equations will be deleted. + + nsel : str + Additional node selection control: + + * ``ANY`` - Delete equation set if any of the selected nodes are in the set (default). + + * ``ALL`` - Delete equation set only if all of the selected nodes are in the set. + + """ + command = f"CEDELE,{neqn1},{neqn2},{ninc},{nsel}" + return self.run(command, **kwargs) + + def ceims( + self, + toler: str = "", + sname1: str = "", + sname2: str = "", + kprint: str = "", + intf1nod: str = "", + intf2nod: str = "", + **kwargs, + ): + r"""Generates constraint equations at the interstage boundary in a `multistage cyclic symmetry analysis + `_. + + Mechanical APDL Command: `CEIMS `_ + + Parameters + ---------- + toler : str + Tolerance for determining if selected nodes are on the interface. ``TOLER`` is a fraction of the + element dimension (defaults to 0.25 (25%)). Nodes outside the element by more than the tolerance + are not accepted as being on the interface. + + sname1 : str + The name of the first stage or part. For details on required node and element selections, see + :ref:`CEIMS_NodeElemSelectReq`. + + sname2 : str + The name of the second stage or part. For details on required node and element selections, see + :ref:`CEIMS_NodeElemSelectReq`. + + kprint : str + Option to print mapped nodes and elements. + + * ``0 (, or OFF)`` - Do not print mapped nodes and elements (default). + + * ``1 (, or ON)`` - Print mapped nodes and elements. + + intf1nod : str + The name of the interstage nodal component of the first stage or sector part to be tied to the + second stage or part named ``IntF2Nod``. It is optional to specify ``IntF1Nod`` (see + :ref:`CEIMS_NodeElemSelectReq` ), but if used, ``IntF2Nod`` must also be specified. + + intf2nod : str + The name of the interstage nodal component of the second stage or sector part to be tied to the + first stage or part named ``IntF1Nod``. It is optional to specify ``IntF2Nod`` (see + :ref:`CEIMS_NodeElemSelectReq` ), but it used, ``IntF1Nod`` must also be specified. + + Notes + ----- + + .. _CEIMS_notes: + + This command can be used to generate constraint equations to tie the interface nodes of two cyclic + sector parts. + + Mapping is performed so mesh patterns at the interface of both parts can be different. + + This command is supported for the following degrees of freedom (DOFs) at the interstage boundary: + UX, UY, UZ, ROTX, ROTY, ROTZ. Since only 3D elements are supported, UX, UY, and UZ are required. + Note that if rotational DOFs are included, all three of them must be present. + + .. _CEIMS_NodeElemSelectReq: + + Node and Element Selection Requirements + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + + You can specify the interface nodes in one of two ways: If you specify ``IntF1Nod`` and ``IntF2Nod`` + nodal components, there are no other node or element + selection requirements. + + Otherwise, prior to issuing CEIMS: + + * the **nodes** at the interface of the first cyclic sector part ( ``Sname1``, part having the + largest cyclic sector angle) must be selected, and + + * the **elements** at the interface of the second cyclic sector part ( ``Sname2``, part having the + smallest cyclic sector angle) must be selected. + + For cyclic sector parts, select only base sector quantities (not duplicate sector ones). See also + the :ref:`nsel` and :ref:`esel` commands for selecting nodes and elements. + + The degrees of freedom of the first part interface nodes are interpolated with the corresponding + degrees of freedom of the nodes of the second part interface elements using the shape functions of + those elements. + + Constraint equations are created between interface nodes. Those nodes should not have any other + constraints defined, but if so they must be compatible. + + **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"CEIMS,{toler},,{sname1},{sname2},{kprint},,,,,{intf1nod},{intf2nod}" + return self.run(command, **kwargs) + + def ceintf( + self, + toler: str = "", + dof1: str = "", + dof2: str = "", + dof3: str = "", + dof4: str = "", + dof5: str = "", + dof6: str = "", + movetol: str = "", + **kwargs, + ): + r"""Generates constraint equations at an interface. + + Mechanical APDL Command: `CEINTF `_ + + Parameters + ---------- + toler : str + Tolerance about selected elements, based on a fraction of the element dimension (defaults to + 0.25 (25%)). Nodes outside the element by more than the tolerance are not accepted as being on + the interface. + + dof1 : str + Degrees of freedom for which constraint equations are written. Defaults to all applicable DOFs. + ``DOF1`` accepts ALL as a valid label, in which case the rest are ignored (all DOFs are + applied). + + dof2 : str + Degrees of freedom for which constraint equations are written. Defaults to all applicable DOFs. + ``DOF1`` accepts ALL as a valid label, in which case the rest are ignored (all DOFs are + applied). + + dof3 : str + Degrees of freedom for which constraint equations are written. Defaults to all applicable DOFs. + ``DOF1`` accepts ALL as a valid label, in which case the rest are ignored (all DOFs are + applied). + + dof4 : str + Degrees of freedom for which constraint equations are written. Defaults to all applicable DOFs. + ``DOF1`` accepts ALL as a valid label, in which case the rest are ignored (all DOFs are + applied). + + dof5 : str + Degrees of freedom for which constraint equations are written. Defaults to all applicable DOFs. + ``DOF1`` accepts ALL as a valid label, in which case the rest are ignored (all DOFs are + applied). + + dof6 : str + Degrees of freedom for which constraint equations are written. Defaults to all applicable DOFs. + ``DOF1`` accepts ALL as a valid label, in which case the rest are ignored (all DOFs are + applied). + + movetol : str + The allowed "motion" of a node (see Note below). This distance is in terms of the element + coordinates (-1.0 to 1.0). A typical value is 0.05. Defaults to 0 (do not move). ``MoveTol`` + must be less than or equal to ``TOLER``. + + Notes + ----- + + .. _CEINTF_notes: + + This command can be used to "tie" together two regions with dissimilar mesh patterns by generating + constraint equations that connect the selected nodes of one region to the selected elements of the + other region. At the interface between regions, nodes should be selected from the more dense mesh + region, A, and the elements selected from the less dense mesh region, B. The degrees of freedom of + region A nodes are interpolated with the corresponding degrees of freedom of the nodes on the region + B elements, using the shape functions of the region B elements. Constraint equations are then + written that relate region A and B nodes at the interface. + + The ``MoveTol`` field lets the nodes in the previously mentioned region A change coordinates when + slightly inside or outside the elements of region B. The change in coordinates causes the nodes of + region A to assume the same surface as the nodes associated with the elements of region B. The + constraint equations that relate the nodes at both regions of the interface are then written. + + Solid elements with six degrees of freedom should only be interfaced with other six degree-of- + freedom elements. The region A nodes should be near the region B elements. A location tolerance + based on the smallest region B element length may be input. Stresses across the interface are not + necessarily continuous. Nodes in the interface region should not have specified constraints. + + Use the :ref:`cpintf` command to connect nodes by coupling instead of constraint equations. Use the + :ref:`eintf` command to connect nodes by line elements. See also the :ref:`nsel` and :ref:`esel` + commands for selecting nodes and elements. See the `Mechanical APDL Theory Reference + `_ for a + description of 3D space used to + determine if a node will be considered by this command. + + As an alternative to the :ref:`ceintf` command, you can use contact elements and the internal + multipoint constraint (MPC) algorithm to tie together two regions having dissimilar meshes. See + `Solid-Solid and Shell-Shell Assemblies + `_ + for more information. + """ + command = f"CEINTF,{toler},{dof1},{dof2},{dof3},{dof4},{dof5},{dof6},{movetol}" + return self.run(command, **kwargs) + + def celist( + self, + neqn1: str = "", + neqn2: str = "", + ninc: str = "", + option: str = "", + **kwargs, + ): + r"""Lists the constraint equations. + + Mechanical APDL Command: `CELIST `_ + + Parameters + ---------- + neqn1 : str + List constraint equations from ``NEQN1`` to ``NEQN2`` (defaults to ``NEQN1`` ) in steps of + ``NINC`` (defaults to 1). If ``NEQN1`` = ALL (default), ``NEQN2`` and ``NINC`` are ignored and + all constraint equations are listed. + + neqn2 : str + List constraint equations from ``NEQN1`` to ``NEQN2`` (defaults to ``NEQN1`` ) in steps of + ``NINC`` (defaults to 1). If ``NEQN1`` = ALL (default), ``NEQN2`` and ``NINC`` are ignored and + all constraint equations are listed. + + ninc : str + List constraint equations from ``NEQN1`` to ``NEQN2`` (defaults to ``NEQN1`` ) in steps of + ``NINC`` (defaults to 1). If ``NEQN1`` = ALL (default), ``NEQN2`` and ``NINC`` are ignored and + all constraint equations are listed. + + option : str + Options for listing constraint equations: + + * ``ANY`` - List equation set if any of the selected nodes are in the set (default). Only + externally-generated constraint equations are listed. + + * ``ALL`` - List equation set only if all of the selected nodes are in the set. Only externally- + generated constraint equations are listed. + + * ``INTE`` - List internally-generated constraint equations that are associated with MPC-based + contact. Constraint equations are listed only if all the nodes in the set are selected. + + * ``CONV`` - Convert internal constraint equations to external constraint equations. Internal + constraint equations are converted only if all of the nodes in the set are selected. + + Notes + ----- + + .. _CELIST_notes: + + This command is valid in any processor. However, the INTE and CONV options are only valid in the + Solution processor after a :ref:`solve` command has been issued. + """ + command = f"CELIST,{neqn1},{neqn2},{ninc},{option}" + return self.run(command, **kwargs) + + def cerig( + self, + independ: str = "", + depend: str = "", + ldof: str = "", + ldof2: str = "", + ldof3: str = "", + ldof4: str = "", + ldof5: str = "", + **kwargs, + ): + r"""Defines a rigid region. + + Mechanical APDL Command: `CERIG `_ + + Parameters + ---------- + independ : str + Retained (or independent) node for this rigid region. If ``INDEPEND`` = P, then graphical + picking of the independent and dependent nodes is enabled (first node picked will be the + independent node, and subsequent nodes picked will be dependent nodes), and subsequent fields + are ignored (valid only in GUI). + + depend : str + Removed (or dependent) node for this rigid region. If ALL, dependent nodes are all selected + nodes. + + ldof : str + Degrees of freedom associated with equations: + + * ``ALL`` - All applicable degrees of freedom (default). If 3D, generate 6 equations based on UX, + UY, UZ, ROTX, ROTY, ROTZ; if 2D, generate 3 equations based on UX, UY, ROTZ. + + * ``UXYZ`` - Translational degrees of freedom. If 3D, generate 3 equations based on the dependent + nodes' UX, UY, and UZ DOFs and the independent node's UX, UY, UZ, ROTX, ROTY, and ROTZ DOFs. If 2D, + generate 2 equations based on the dependent nodes UX and UY DOFs and the independent nodes UX, UY, + and ROTZ DOFs. No equations are generated for the rotational coupling. + + * ``RXYZ`` - Rotational degrees of freedom. If 3D, generate 3 equations based on ROTX, ROTY, ROTZ; + if 2D, generate 1 equation based on ROTZ. No equations are generated for the translational coupling. + + * ``UX`` - Dependent translational UX degree of freedom only. + + * ``UY`` - Dependent translational UY degree of freedom only. + + * ``UZ`` - Dependent translational UZ degree of freedom only. + + * ``ROTX`` - Dependent rotational ROTX degree of freedom only. + + * ``ROTY`` - Dependent rotational ROTY degree of freedom only. + + * ``ROTZ`` - Dependent rotational ROTZ degree of freedom only. + + ldof2 : str + Additional degrees of freedom. Used only if more than one degree of freedom are required and + ``Ldof`` is not ALL, UXYZ, or RXYZ. + + ldof3 : str + Additional degrees of freedom. Used only if more than one degree of freedom are required and + ``Ldof`` is not ALL, UXYZ, or RXYZ. + + ldof4 : str + Additional degrees of freedom. Used only if more than one degree of freedom are required and + ``Ldof`` is not ALL, UXYZ, or RXYZ. + + ldof5 : str + Additional degrees of freedom. Used only if more than one degree of freedom are required and + ``Ldof`` is not ALL, UXYZ, or RXYZ. + + Notes + ----- + + .. _CERIG_notes: + + Defines a rigid region (link, area or volume) by automatically generating constraint equations to + relate nodes in the region. Nodes in the rigid region must be assigned a geometric location before + this command is used. Also, nodes must be connected to elements having the required degree of + freedom set (see ``Ldof`` above). Generated constraint equations are based on small deflection + theory. Generated constraint equations are numbered beginning from the highest previously defined + equation number ( ``NEQN`` ) plus 1. Equations, once generated, may be listed ( :ref:`celist` ) or + modified ( :ref:`ce` ) as desired. Repeat the :ref:`cerig` command for additional rigid region + equations. + + This command generates the constraint equations needed for defining rigid lines in 2D or 3D space. + Multiple rigid lines relative to a common point are used to define a rigid area or a rigid volume. + In 2D space, with ``Ldof =`` ALL, three equations are generated for each pair of constrained nodes. + These equations define the three rigid body motions in global Cartesian space, that is, two in-plane + translations and one in-plane rotation. These equations assume the X-Y plane to be the active plane + with UX, UY, and ROTZ degrees of freedom available at each node. Other types of equations can be + generated with the appropriate ``Ldof`` labels. + + Six equations are generated for each pair of constrained nodes in 3D space (with ``Ldof =`` ALL). + These equations define the six rigid body motions in global Cartesian space. These equations assume + that UX, UY, UZ, ROTX, ROTY, and ROTZ degrees of freedom are available at each node. + + The UXYZ label allows generating a partial set of rigid region equations. This option is useful for + transmitting the bending moment between elements having different degrees of freedom at a node. With + this option only two of the three equations are generated for each pair of constrained nodes in 2D + space. In 3D space, only three of the six equations are generated. In each case the rotational + coupling equations are not generated. Similarly, the RXYZ label allows generating a partial set of + equations with the translational coupling equations omitted. + + Applying this command to a large number of dependent nodes may result in constraint equations with a + large number of coefficients. This may significantly increase the peak memory required during the + process of element assembly. If real memory or virtual memory is not available, consider reducing + the number of dependent nodes. + + Note that under certain circumstances the constraint equations generated by :ref:`cerig` may be + modified during the solution. See for more information. + + :ref:`cerig` is restricted to small-deflection analysis (large-deflection is not supported). As an + alternative to the :ref:`cerig` command, you can define a similar type of rigid region using contact + elements and the internal multipoint constraint (MPC) algorithm. See `Surface-Based Constraints + `_ + for more information. + + :ref:`cerig` cannot be deleted using :ref:`cedele`,ALL and then regenerated in the second or higher + load steps if the :ref:`lswrite` and :ref:`lssolve` procedure is used. :ref:`cerig` writes + constraint equations directly into load step files. Deleting constraint equations ( + :ref:`cedele`,ALL) cannot always maintain the consistency among load steps. + """ + command = f"CERIG,{independ},{depend},{ldof},{ldof2},{ldof3},{ldof4},{ldof5}" + return self.run(command, **kwargs) + + def cesel( + self, type_: str = "", vmin: str = "", vmax: str = "", vinc: str = "", **kwargs + ): + r"""Selects constraint equations via predefined reference numbers. + + Mechanical APDL Command: `CESEL `_ + + Parameters + ---------- + type_ : str + Label identifying the type of select: + + * ``S`` - Select a new set (default). + + * ``A`` - Select an additional set and add it to the current set. + + * ``U`` - Unselect a set from the current set. + + * ``ALL`` - Restore the full set. + + * ``NONE`` - Unselect the full set. + + * ``INVE`` - Invert the current set (selected becomes unselected and vice versa). + + * ``STAT`` - Display the current select status. + + vmin : str + Minimum value of constraint equation reference number range. + + vmax : str + Maximum value of constraint equation reference number range. ``VMAX`` defaults to ``VMIN``. + + vinc : str + Value increment within the specified range. Defaults to 1. + + Notes + ----- + + .. warning:: + + This function contains specificities regarding the argument definitions. + Please refer to the `command documentation `_ + for further explanations. + + .. _CESEL_notes: + + The :ref:`cesel` command selects sets of constraint equations ( :ref:`ce` ) via specified reference + numbers. ``VMIN``, ``VMAX``, and ``VINC`` must be positive integer values. + + For example, the following command selects a new set of constraint equations based on reference + numbers 1 through 7: + + .. code:: apdl + + CESEL,S,,,1,7,1 + + Data are flagged as selected and unselected; no data are actually deleted from the database. + + Use :ref:`celist` to list constraint equations and their reference numbers. If a constraint equation + is selected but involves unselected nodes, that constraint equation will not be listed by the + :ref:`celist` command, and the solver ignores it. + + Internal constraint equations are not affected by this command. + + This command is also valid in POST1. + """ + command = f"CESEL,{type_},,,{vmin},{vmax},{vinc}" + return self.run(command, **kwargs) + + def cesgen( + self, + itime: str = "", + inc: str = "", + nset1: str = "", + nset2: str = "", + ninc: str = "", + **kwargs, + ): + r"""Generates a set of constraint equations from existing sets. + + Mechanical APDL Command: `CESGEN `_ + + Parameters + ---------- + itime : str + Do this generation operation a total of ``ITIME`` s, incrementing all nodes in the existing sets + 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`` s, incrementing all nodes in the existing sets + by ``INC`` each time after the first. ``ITIME`` must be >1 for generation to occur. + + nset1 : str + Generate sets from sets beginning with ``NSET1`` to ``NSET2`` (defaults to ``NSET1`` ) in steps + of ``NINC`` (defaults to 1). If ``NSET1`` is negative, ``NSET2`` and ``NINC`` are ignored and + the last \| ``NSET1`` \| sets (in sequence from maximum set number) are used as the sets to be + repeated. + + nset2 : str + Generate sets from sets beginning with ``NSET1`` to ``NSET2`` (defaults to ``NSET1`` ) in steps + of ``NINC`` (defaults to 1). If ``NSET1`` is negative, ``NSET2`` and ``NINC`` are ignored and + the last \| ``NSET1`` \| sets (in sequence from maximum set number) are used as the sets to be + repeated. + + ninc : str + Generate sets from sets beginning with ``NSET1`` to ``NSET2`` (defaults to ``NSET1`` ) in steps + of ``NINC`` (defaults to 1). If ``NSET1`` is negative, ``NSET2`` and ``NINC`` are ignored and + the last \| ``NSET1`` \| sets (in sequence from maximum set number) are used as the sets to be + repeated. + + Notes + ----- + + .. _CESGEN_notes: + + Generates additional sets of constraint equations (with same labels) from existing sets. Node + numbers between sets may be uniformly incremented. + """ + command = f"CESGEN,{itime},{inc},{nset1},{nset2},{ninc}" + return self.run(command, **kwargs) + + def rbe3( + self, + independ: str = "", + dof: str = "", + depend: str = "", + wtfact: str = "", + **kwargs, + ): + r"""Distributes the force/moment applied at an independent node to a set of dependent nodes. + + Mechanical APDL Command: `RBE3 `_ + + Parameters + ---------- + independ : str + Node at which the force/moment to be distributed will be applied (the independent node). To be + included in the degree-of-freedom (DOF) solution, this node must be associated with an element. + + dof : str + Refers to the independent node DOFs to be used in the constraint equations. Valid labels are: + UX, UY, UZ, ROTX, ROTY, ROTZ, UXYZ, RXYZ, ALL + + depend : str + The name of an array parameter that contains a list of dependent nodes. Must specify the + starting index number. ALL can be used for the currently selected set of nodes. The dependent + nodes must not be colinear (that is, must not be located on the same straight line). See + :ref:`RBE3_notes` for details. + + wtfact : str + The name of an array parameter that contains a list of weighting factors corresponding to each + dependent node defined by Depend. Must have the starting index number. If not specified, the + weighting factor for each dependent node defaults to 1. + + Notes + ----- + + .. _RBE3_notes: + + :ref:`rbe3` distributes the force/moment applied at an independent node to a set of dependent nodes, + taking into account the geometry of the dependent nodes as well as weighting factors. The force is + distributed to the dependent nodes proportional to the weighting factors. The moment is distributed + as forces to the dependent nodes; these forces are proportional to the distance from the center of + gravity of the dependent nodes times the weighting factors. Only the translational degrees of + freedom of the dependent nodes are used for constructing the constraint equations. Constraint + equations are converted to distributed forces/moments on the dependent nodes during solution. + + :ref:`rbe3` creates constraint equations such that the motion of the independent node is the average + of the dependent nodes. For the rotations, a least-squares approach is used to define the "average + rotation" at the independent node from the translations of the dependent nodes. If the dependent + nodes are colinear, then one of the independent node rotations that is parallel to the colinear + direction cannot be determined in terms of the translations of the dependent nodes. Therefore, the + associated moment component on the independent node in that direction cannot be transmitted. When + this case occurs, a warning message is issued and the constraint equations created by :ref:`rbe3` + are ignored. + + Applying this command to a large number of dependent nodes may result in constraint equations with a + large number of coefficients. This may significantly increase the peak memory required during the + process of element assembly. If real memory or virtual memory is not available, consider reducing + the number of dependent nodes. + + You can use the :ref:`dofsel` command to select the degrees of freedom (DOFs) of the dependent nodes + to be included in the resulting constraint equations. (Be sure to issue :ref:`dofsel`,ALL after + issuing :ref:`rbe3`.) This capability is useful if, for example, you want to ignore radial + constraints in cylindrical geometries. The selected DOFs must collectively generate forces and + moments on the independent node in all six DOFs. + + :ref:`rbe3` is restricted to small-deflection analysis (large-deflection is not supported). As an + alternative to :ref:`rbe3`, you can apply a similar type of constraint using contact elements and + the internal multipoint constraint (MPC) algorithm. For more information, see `Surface-based + Constraints + `_. + + This command is also valid in SOLUTION. + """ + command = f"RBE3,{independ},{dof},{depend},{wtfact}" + return self.run(command, **kwargs) diff --git a/src/ansys/mapdl/core/_commands/prep7/constraint_equations_.py b/src/ansys/mapdl/core/_commands/prep7/constraint_equations_.py new file mode 100644 index 00000000000..3fa9980d909 --- /dev/null +++ b/src/ansys/mapdl/core/_commands/prep7/constraint_equations_.py @@ -0,0 +1,90 @@ +# 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 ConstraintEquations: + + def cecyc( + self, + lowname: str = "", + highname: str = "", + nsector: str = "", + hindex: str = "", + tolerance: str = "", + kmove: int | str = "", + kpairs: int | str = "", + **kwargs, + ): + r"""Generates the constraint equations for a cyclic symmetry analysis + + Mechanical APDL Command: `CECYC `_ + + Parameters + ---------- + lowname : str + Name of a component for the nodes on the low angle edge of the sector. Enclosed in single + quotes. + + highname : str + Name of a component for the nodes on the high angle edge of the sector. Enclosed in single + quotes. + + nsector : str + Number of sectors in the complete 360 degrees. + + hindex : str + Harmonic index to be represented by this set of constraint equations. If ``Hindex`` is -1, + generate constraint equations for static cyclic symmetry. If ``HIndex`` is -2, generate + constraint equations for static cyclic asymmetry. + + tolerance : str + A positive tolerance is an absolute tolerance (length units), and a negative tolerance is a + tolerance relative to the local element size. + + kmove : int or str + + * ``0`` - Nodes are not moved. + + * ``1`` - HIGHNAME component nodes are moved to match LOWNAME component nodes exactly. + + kpairs : int or str + + * ``0`` - Do not print paired nodes + + * ``1`` - Print table of paired nodes + + Notes + ----- + + .. _CECYC_notes: + + The analysis can be either modal cyclic symmetry or static cyclic symmetry. + + The pair of nodes for which constraint equations are written are rotated into :ref:`csys`,1. + + .. warning:: + + This command is archived in the latest version of the software. + + """ + command = f"CECYC,{lowname},{highname},{nsector},{hindex},{tolerance},{kmove},{kpairs}" + return self.run(command, **kwargs) diff --git a/src/ansys/mapdl/core/_commands/prep7/coupled_dof.py b/src/ansys/mapdl/core/_commands/prep7/coupled_dof.py new file mode 100644 index 00000000000..56ae5ecf4bc --- /dev/null +++ b/src/ansys/mapdl/core/_commands/prep7/coupled_dof.py @@ -0,0 +1,771 @@ +# 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 CoupledDof: + + def cp( + self, + nset: str = "", + lab: str = "", + node1: str = "", + node2: str = "", + node3: str = "", + node4: str = "", + node5: str = "", + node6: str = "", + node7: str = "", + node8: str = "", + node9: str = "", + node10: str = "", + node11: str = "", + node12: str = "", + node13: str = "", + node14: str = "", + node15: str = "", + node16: str = "", + node17: str = "", + **kwargs, + ): + r"""Defines (or modifies) a set of coupled degrees of freedom. + + Mechanical APDL Command: `CP `_ + + Parameters + ---------- + nset : str + Set reference number: + + * ``n`` - Arbitrary set number. + + * ``HIGH`` - The highest defined coupled set number will be used (default, unless ``Lab`` = ALL). + This option is useful when adding nodes to an existing set. + + * ``NEXT`` - The highest defined coupled set number plus one will be used (default if ``Lab`` = + ALL). This option automatically numbers coupled sets so that existing sets are not modified. + + lab : str + Degree of freedom label for coupled nodes (in the nodal coordinate system). Defaults to label + previously defined with ``NSET`` if set ``NSET`` already exists. A different label redefines the + previous label associated with ``NSET``. Valid labels are: Structural labels: UX, UY, or UZ + (displacements); ROTX, ROTY, or ROTZ (rotations) (in radians); HDSP (hydrostatic pressure). Thermal + labels: TEMP, TBOT, TE2, TE3, ..., TTOP (temperature). Fluid labels: PRES (pressure); VX, VY, or VZ + (velocities). Electric labels: VOLT (voltage); EMF (electromotive force drop); CURR (current). + Magnetic labels: MAG (scalar magnetic potential); AZ (vector magnetic potential); CURR (current). + Diffusion label: CONC (concentration). + + When ``Lab`` = ALL: + + * Sets are generated for each active degree of freedom (that is, one set for the UX degree of + freedom, another set for UY, etc.), and ``NSET`` is incremented automatically to prevent + overwriting existing sets. + + * Existing sets are not modified. ``NSET`` must be a new set number ``n`` or NEXT. + + * The degree of freedom set is determined according to all element types defined and the :ref:`dof` + command, if used. + + * Hydrostatic pressure (HDSP) is not included. + + node1 : str + List of nodes to be included in set. Duplicate nodes are ignored. If a node number is input as + negative, the node is deleted from the coupled set. The first node in the list is the primary + (retained) node, and the remaining nodes represent the removed degrees of freedom. + + If ``NODE1`` = ALL, ``NODE2`` through ``NODE17`` are ignored and all selected nodes ( + :ref:`nsel` ) are included in the set, and the node with the lowest node number becomes the + primary node. + + If ``NODE1`` = P, graphical picking is enabled and all remaining command fields are ignored + (valid only in the GUI). + + A component name can be substituted for ``NODE1``. The component consists of the node group to + be coupled. The node with the lowest node number becomes the primary node among the node group. + To display the generated and coupled node sets, issue the :ref:`cplist` command. + + node2 : str + List of nodes to be included in set. Duplicate nodes are ignored. If a node number is input as + negative, the node is deleted from the coupled set. The first node in the list is the primary + (retained) node, and the remaining nodes represent the removed degrees of freedom. + + If ``NODE1`` = ALL, ``NODE2`` through ``NODE17`` are ignored and all selected nodes ( + :ref:`nsel` ) are included in the set, and the node with the lowest node number becomes the + primary node. + + If ``NODE1`` = P, graphical picking is enabled and all remaining command fields are ignored + (valid only in the GUI). + + A component name can be substituted for ``NODE1``. The component consists of the node group to + be coupled. The node with the lowest node number becomes the primary node among the node group. + To display the generated and coupled node sets, issue the :ref:`cplist` command. + + node3 : str + List of nodes to be included in set. Duplicate nodes are ignored. If a node number is input as + negative, the node is deleted from the coupled set. The first node in the list is the primary + (retained) node, and the remaining nodes represent the removed degrees of freedom. + + If ``NODE1`` = ALL, ``NODE2`` through ``NODE17`` are ignored and all selected nodes ( + :ref:`nsel` ) are included in the set, and the node with the lowest node number becomes the + primary node. + + If ``NODE1`` = P, graphical picking is enabled and all remaining command fields are ignored + (valid only in the GUI). + + A component name can be substituted for ``NODE1``. The component consists of the node group to + be coupled. The node with the lowest node number becomes the primary node among the node group. + To display the generated and coupled node sets, issue the :ref:`cplist` command. + + node4 : str + List of nodes to be included in set. Duplicate nodes are ignored. If a node number is input as + negative, the node is deleted from the coupled set. The first node in the list is the primary + (retained) node, and the remaining nodes represent the removed degrees of freedom. + + If ``NODE1`` = ALL, ``NODE2`` through ``NODE17`` are ignored and all selected nodes ( + :ref:`nsel` ) are included in the set, and the node with the lowest node number becomes the + primary node. + + If ``NODE1`` = P, graphical picking is enabled and all remaining command fields are ignored + (valid only in the GUI). + + A component name can be substituted for ``NODE1``. The component consists of the node group to + be coupled. The node with the lowest node number becomes the primary node among the node group. + To display the generated and coupled node sets, issue the :ref:`cplist` command. + + node5 : str + List of nodes to be included in set. Duplicate nodes are ignored. If a node number is input as + negative, the node is deleted from the coupled set. The first node in the list is the primary + (retained) node, and the remaining nodes represent the removed degrees of freedom. + + If ``NODE1`` = ALL, ``NODE2`` through ``NODE17`` are ignored and all selected nodes ( + :ref:`nsel` ) are included in the set, and the node with the lowest node number becomes the + primary node. + + If ``NODE1`` = P, graphical picking is enabled and all remaining command fields are ignored + (valid only in the GUI). + + A component name can be substituted for ``NODE1``. The component consists of the node group to + be coupled. The node with the lowest node number becomes the primary node among the node group. + To display the generated and coupled node sets, issue the :ref:`cplist` command. + + node6 : str + List of nodes to be included in set. Duplicate nodes are ignored. If a node number is input as + negative, the node is deleted from the coupled set. The first node in the list is the primary + (retained) node, and the remaining nodes represent the removed degrees of freedom. + + If ``NODE1`` = ALL, ``NODE2`` through ``NODE17`` are ignored and all selected nodes ( + :ref:`nsel` ) are included in the set, and the node with the lowest node number becomes the + primary node. + + If ``NODE1`` = P, graphical picking is enabled and all remaining command fields are ignored + (valid only in the GUI). + + A component name can be substituted for ``NODE1``. The component consists of the node group to + be coupled. The node with the lowest node number becomes the primary node among the node group. + To display the generated and coupled node sets, issue the :ref:`cplist` command. + + node7 : str + List of nodes to be included in set. Duplicate nodes are ignored. If a node number is input as + negative, the node is deleted from the coupled set. The first node in the list is the primary + (retained) node, and the remaining nodes represent the removed degrees of freedom. + + If ``NODE1`` = ALL, ``NODE2`` through ``NODE17`` are ignored and all selected nodes ( + :ref:`nsel` ) are included in the set, and the node with the lowest node number becomes the + primary node. + + If ``NODE1`` = P, graphical picking is enabled and all remaining command fields are ignored + (valid only in the GUI). + + A component name can be substituted for ``NODE1``. The component consists of the node group to + be coupled. The node with the lowest node number becomes the primary node among the node group. + To display the generated and coupled node sets, issue the :ref:`cplist` command. + + node8 : str + List of nodes to be included in set. Duplicate nodes are ignored. If a node number is input as + negative, the node is deleted from the coupled set. The first node in the list is the primary + (retained) node, and the remaining nodes represent the removed degrees of freedom. + + If ``NODE1`` = ALL, ``NODE2`` through ``NODE17`` are ignored and all selected nodes ( + :ref:`nsel` ) are included in the set, and the node with the lowest node number becomes the + primary node. + + If ``NODE1`` = P, graphical picking is enabled and all remaining command fields are ignored + (valid only in the GUI). + + A component name can be substituted for ``NODE1``. The component consists of the node group to + be coupled. The node with the lowest node number becomes the primary node among the node group. + To display the generated and coupled node sets, issue the :ref:`cplist` command. + + node9 : str + List of nodes to be included in set. Duplicate nodes are ignored. If a node number is input as + negative, the node is deleted from the coupled set. The first node in the list is the primary + (retained) node, and the remaining nodes represent the removed degrees of freedom. + + If ``NODE1`` = ALL, ``NODE2`` through ``NODE17`` are ignored and all selected nodes ( + :ref:`nsel` ) are included in the set, and the node with the lowest node number becomes the + primary node. + + If ``NODE1`` = P, graphical picking is enabled and all remaining command fields are ignored + (valid only in the GUI). + + A component name can be substituted for ``NODE1``. The component consists of the node group to + be coupled. The node with the lowest node number becomes the primary node among the node group. + To display the generated and coupled node sets, issue the :ref:`cplist` command. + + node10 : str + List of nodes to be included in set. Duplicate nodes are ignored. If a node number is input as + negative, the node is deleted from the coupled set. The first node in the list is the primary + (retained) node, and the remaining nodes represent the removed degrees of freedom. + + If ``NODE1`` = ALL, ``NODE2`` through ``NODE17`` are ignored and all selected nodes ( + :ref:`nsel` ) are included in the set, and the node with the lowest node number becomes the + primary node. + + If ``NODE1`` = P, graphical picking is enabled and all remaining command fields are ignored + (valid only in the GUI). + + A component name can be substituted for ``NODE1``. The component consists of the node group to + be coupled. The node with the lowest node number becomes the primary node among the node group. + To display the generated and coupled node sets, issue the :ref:`cplist` command. + + node11 : str + List of nodes to be included in set. Duplicate nodes are ignored. If a node number is input as + negative, the node is deleted from the coupled set. The first node in the list is the primary + (retained) node, and the remaining nodes represent the removed degrees of freedom. + + If ``NODE1`` = ALL, ``NODE2`` through ``NODE17`` are ignored and all selected nodes ( + :ref:`nsel` ) are included in the set, and the node with the lowest node number becomes the + primary node. + + If ``NODE1`` = P, graphical picking is enabled and all remaining command fields are ignored + (valid only in the GUI). + + A component name can be substituted for ``NODE1``. The component consists of the node group to + be coupled. The node with the lowest node number becomes the primary node among the node group. + To display the generated and coupled node sets, issue the :ref:`cplist` command. + + node12 : str + List of nodes to be included in set. Duplicate nodes are ignored. If a node number is input as + negative, the node is deleted from the coupled set. The first node in the list is the primary + (retained) node, and the remaining nodes represent the removed degrees of freedom. + + If ``NODE1`` = ALL, ``NODE2`` through ``NODE17`` are ignored and all selected nodes ( + :ref:`nsel` ) are included in the set, and the node with the lowest node number becomes the + primary node. + + If ``NODE1`` = P, graphical picking is enabled and all remaining command fields are ignored + (valid only in the GUI). + + A component name can be substituted for ``NODE1``. The component consists of the node group to + be coupled. The node with the lowest node number becomes the primary node among the node group. + To display the generated and coupled node sets, issue the :ref:`cplist` command. + + node13 : str + List of nodes to be included in set. Duplicate nodes are ignored. If a node number is input as + negative, the node is deleted from the coupled set. The first node in the list is the primary + (retained) node, and the remaining nodes represent the removed degrees of freedom. + + If ``NODE1`` = ALL, ``NODE2`` through ``NODE17`` are ignored and all selected nodes ( + :ref:`nsel` ) are included in the set, and the node with the lowest node number becomes the + primary node. + + If ``NODE1`` = P, graphical picking is enabled and all remaining command fields are ignored + (valid only in the GUI). + + A component name can be substituted for ``NODE1``. The component consists of the node group to + be coupled. The node with the lowest node number becomes the primary node among the node group. + To display the generated and coupled node sets, issue the :ref:`cplist` command. + + node14 : str + List of nodes to be included in set. Duplicate nodes are ignored. If a node number is input as + negative, the node is deleted from the coupled set. The first node in the list is the primary + (retained) node, and the remaining nodes represent the removed degrees of freedom. + + If ``NODE1`` = ALL, ``NODE2`` through ``NODE17`` are ignored and all selected nodes ( + :ref:`nsel` ) are included in the set, and the node with the lowest node number becomes the + primary node. + + If ``NODE1`` = P, graphical picking is enabled and all remaining command fields are ignored + (valid only in the GUI). + + A component name can be substituted for ``NODE1``. The component consists of the node group to + be coupled. The node with the lowest node number becomes the primary node among the node group. + To display the generated and coupled node sets, issue the :ref:`cplist` command. + + node15 : str + List of nodes to be included in set. Duplicate nodes are ignored. If a node number is input as + negative, the node is deleted from the coupled set. The first node in the list is the primary + (retained) node, and the remaining nodes represent the removed degrees of freedom. + + If ``NODE1`` = ALL, ``NODE2`` through ``NODE17`` are ignored and all selected nodes ( + :ref:`nsel` ) are included in the set, and the node with the lowest node number becomes the + primary node. + + If ``NODE1`` = P, graphical picking is enabled and all remaining command fields are ignored + (valid only in the GUI). + + A component name can be substituted for ``NODE1``. The component consists of the node group to + be coupled. The node with the lowest node number becomes the primary node among the node group. + To display the generated and coupled node sets, issue the :ref:`cplist` command. + + node16 : str + List of nodes to be included in set. Duplicate nodes are ignored. If a node number is input as + negative, the node is deleted from the coupled set. The first node in the list is the primary + (retained) node, and the remaining nodes represent the removed degrees of freedom. + + If ``NODE1`` = ALL, ``NODE2`` through ``NODE17`` are ignored and all selected nodes ( + :ref:`nsel` ) are included in the set, and the node with the lowest node number becomes the + primary node. + + If ``NODE1`` = P, graphical picking is enabled and all remaining command fields are ignored + (valid only in the GUI). + + A component name can be substituted for ``NODE1``. The component consists of the node group to + be coupled. The node with the lowest node number becomes the primary node among the node group. + To display the generated and coupled node sets, issue the :ref:`cplist` command. + + node17 : str + List of nodes to be included in set. Duplicate nodes are ignored. If a node number is input as + negative, the node is deleted from the coupled set. The first node in the list is the primary + (retained) node, and the remaining nodes represent the removed degrees of freedom. + + If ``NODE1`` = ALL, ``NODE2`` through ``NODE17`` are ignored and all selected nodes ( + :ref:`nsel` ) are included in the set, and the node with the lowest node number becomes the + primary node. + + If ``NODE1`` = P, graphical picking is enabled and all remaining command fields are ignored + (valid only in the GUI). + + A component name can be substituted for ``NODE1``. The component consists of the node group to + be coupled. The node with the lowest node number becomes the primary node among the node group. + To display the generated and coupled node sets, issue the :ref:`cplist` command. + + Notes + ----- + + .. _CP_notes: + + Do not include the same degree of freedom in more than one coupled set. Repeat :ref:`cp` command for + additional nodes. + + Coupling degrees of freedom into a set causes the results calculated for one member of the set to be + the same for all members of the set. Coupling can be used to model various joint and hinge effects. + A more general form of coupling can be done with constraint equations ( :ref:`ce` ). For structural + analyses, a list of nodes is defined along with the nodal directions in which these nodes are to be + coupled. As a result of this coupling, these nodes are forced to take the same displacement in the + specified nodal coordinate direction. The amount of the displacement is unknown until the analysis + is completed. A set of coupled nodes which are not coincident, or which are not along the line of + the coupled displacement direction, may produce an applied moment which will not appear in the + reaction forces. The actual degrees of freedom available for a particular node depends upon the + degrees of freedom associated with element types ( :ref:`et` ) at that node. For scalar field + analysis, this command is used to couple nodal temperatures, pressures, voltages, etc. + + A set of coupled nodes which are not coincident, or which are not along the line of the coupled + displacement direction, produce an artificial moment constraint. If the structure rotates, a moment + may be produced in the coupled set in the form of a force couple. This moment is in addition to the + real reaction forces and may make it appear that moment equilibrium is not satisfied by just the + applied forces and the reaction forces. + + Additional sets of coupled nodes may be generated from a specified set. Degrees of freedom are + coupled within a set but are not coupled between sets. No degree of freedom should appear in more + than one coupled set. Such an appearance would indicate that at least two sets were in fact part of + a single larger set. The first degree of freedom of the coupled set is the "prime" degree of + freedom. All other degrees of freedom in the coupled sets are eliminated from the solution matrices + by their relationship to the prime degree of freedom. Forces applied to coupled nodes (in the + coupled degree of freedom direction) will be summed and applied to the prime degree of freedom. + Output forces are also summed at the prime degree of freedom. Degrees of freedom with specified + constraints ( :ref:`d` ) should not be included in a coupled set (unless the degree of freedom is + prime). + + If master degrees of freedom are defined for coupled nodes, only the prime degree of freedom should + be so defined. The use of coupled nodes reduces the set of coupled degrees of freedom to only one + degree of freedom. + + The removed degrees of freedom defined by the :ref:`cp` command cannot be included in any :ref:`ce` + or :ref:`cerig` command. + """ + command = f"CP,{nset},{lab},{node1},{node2},{node3},{node4},{node5},{node6},{node7},{node8},{node9},{node10},{node11},{node12},{node13},{node14},{node15},{node16},{node17}" + return self.run(command, **kwargs) + + def cpdele( + self, nset1: str = "", nset2: str = "", ninc: str = "", nsel: str = "", **kwargs + ): + r"""Deletes coupled degree of freedom sets. + + Mechanical APDL Command: `CPDELE `_ + + Parameters + ---------- + nset1 : str + Delete coupled sets from ``NSET1`` to ``NSET2`` (defaults to ``NSET1`` ) in steps of ``NINC`` + (defaults to 1). If ``NSET1`` = ALL, ``NSET2`` and ``NINC`` are ignored and all coupled sets are + deleted. + + nset2 : str + Delete coupled sets from ``NSET1`` to ``NSET2`` (defaults to ``NSET1`` ) in steps of ``NINC`` + (defaults to 1). If ``NSET1`` = ALL, ``NSET2`` and ``NINC`` are ignored and all coupled sets are + deleted. + + ninc : str + Delete coupled sets from ``NSET1`` to ``NSET2`` (defaults to ``NSET1`` ) in steps of ``NINC`` + (defaults to 1). If ``NSET1`` = ALL, ``NSET2`` and ``NINC`` are ignored and all coupled sets are + deleted. + + nsel : str + Additional node selection control: + + * ``ANY`` - Delete coupled set if any of the selected nodes are in the set (default). + + * ``ALL`` - Delete coupled set only if all of the selected nodes are in the set. + + Notes + ----- + + .. _CPDELE_notes: + + See the :ref:`cp` command for a method to delete individual nodes from a set. + """ + command = f"CPDELE,{nset1},{nset2},{ninc},{nsel}" + return self.run(command, **kwargs) + + def cpintf(self, lab: str = "", toler: str = "", **kwargs): + r"""Defines coupled degrees of freedom at an interface. + + Mechanical APDL Command: `CPINTF `_ + + Parameters + ---------- + lab : str + Degree of freedom label for coupled nodes (in the nodal coordinate system). If ALL, use all + appropriate labels except HDSP. Valid labels are: Structural labels: UX, UY, or UZ + (displacements); ROTX, ROTY, or ROTZ (rotations, in radians), HDSP (hydrostatic pressure). + Thermal labels: TEMP, TBOT, TE2, TE3,..., TTOP (temperature). Fluid labels: PRES (pressure); VX, + VY, or VZ (velocities). Electric labels: VOLT (voltage); EMF (electromotive force drop); CURR + (current). Magnetic labels: MAG (scalar magnetic potential); AZ (vector magnetic potential); + CURR (current). Diffusion label: CONC (concentration). + + toler : str + Tolerance for coincidence (based on maximum coordinate difference in each global Cartesian + direction for node locations and on angle differences for node orientations). Defaults to + 0.0001. Only nodes within the tolerance are considered to be coincident for coupling. + + Notes + ----- + + .. _CPINTF_notes: + + Defines coupled degrees of freedom between coincident nodes (within a tolerance). May be used, for + example, to "button" together elements interfacing at a seam, where the seam consists of a series of + node pairs. One coupled set is generated for each selected degree of freedom for each pair of + coincident nodes. For more than two coincident nodes in a cluster, a coupled set is generated from + the lowest numbered node to each of the other nodes in the cluster. Coupled sets are generated only + within (and not between) clusters. If fewer than all nodes are to be checked for coincidence, use + the :ref:`nsel` command to select nodes. Coupled set reference numbers are incremented by one from + the highest previous set number. Use :ref:`cplist` to display the generated sets. Only nodes having + the same nodal coordinate system orientations ("coincident" within a tolerance) are included. Use + the :ref:`ceintf` command to connect nodes by constraint equations instead of by coupling. Use the + :ref:`eintf` command to connect nodes by line elements instead of by coupling. + """ + command = f"CPINTF,{lab},{toler}" + return self.run(command, **kwargs) + + def cplgen( + self, + nsetf: str = "", + lab1: str = "", + lab2: str = "", + lab3: str = "", + lab4: str = "", + lab5: str = "", + **kwargs, + ): + r"""Generates sets of coupled nodes from an existing set. + + Mechanical APDL Command: `CPLGEN `_ + + Parameters + ---------- + nsetf : str + Generate sets from existing set ``NSETF``. + + lab1 : str + Generate sets with these labels (see :ref:`cp` command for valid labels). Sets are numbered as + the highest existing set number + 1. + + lab2 : str + Generate sets with these labels (see :ref:`cp` command for valid labels). Sets are numbered as + the highest existing set number + 1. + + lab3 : str + Generate sets with these labels (see :ref:`cp` command for valid labels). Sets are numbered as + the highest existing set number + 1. + + lab4 : str + Generate sets with these labels (see :ref:`cp` command for valid labels). Sets are numbered as + the highest existing set number + 1. + + lab5 : str + Generate sets with these labels (see :ref:`cp` command for valid labels). Sets are numbered as + the highest existing set number + 1. + + Notes + ----- + + .. _CPLGEN_notes: + + Generates additional sets of coupled nodes (with different labels) from an existing set ( :ref:`cp`, + :ref:`cpngen` ). The same node numbers are included in the generated sets. If all labels of nodes + are to be coupled and the nodes are coincident, the :ref:`nummrg` command should be used to + automatically redefine the node number (for efficiency). + """ + command = f"CPLGEN,{nsetf},{lab1},{lab2},{lab3},{lab4},{lab5}" + return self.run(command, **kwargs) + + def cplist( + self, nset1: str = "", nset2: str = "", ninc: str = "", nsel: str = "", **kwargs + ): + r"""Lists the coupled degree of freedom sets. + + Mechanical APDL Command: `CPLIST `_ + + Parameters + ---------- + nset1 : str + List coupled sets from ``NSET1`` to ``NSET2`` (defaults to ``NSET1`` ) in steps of ``NINC`` + (defaults to 1). If ``NSET1`` = ALL (default), ``NSET2`` and ``NINC`` are ignored and all + coupled sets are listed. + + nset2 : str + List coupled sets from ``NSET1`` to ``NSET2`` (defaults to ``NSET1`` ) in steps of ``NINC`` + (defaults to 1). If ``NSET1`` = ALL (default), ``NSET2`` and ``NINC`` are ignored and all + coupled sets are listed. + + ninc : str + List coupled sets from ``NSET1`` to ``NSET2`` (defaults to ``NSET1`` ) in steps of ``NINC`` + (defaults to 1). If ``NSET1`` = ALL (default), ``NSET2`` and ``NINC`` are ignored and all + coupled sets are listed. + + nsel : str + Node selection control: + + * ``ANY`` - List coupled set if any of the selected nodes are in the set (default). + + * ``ALL`` - List coupled set only if all of the selected nodes are in the set. + + Notes + ----- + + .. _CPLIST_notes: + + This command is valid in any processor. + """ + command = f"CPLIST,{nset1},{nset2},{ninc},{nsel}" + return self.run(command, **kwargs) + + def cpmerge(self, lab: str = "", **kwargs): + r"""Merges different couple sets with duplicate degrees of freedom into one couple set. + + Mechanical APDL Command: `CPMERGE `_ + + Parameters + ---------- + lab : str + Degree of freedom label for coupled nodes (in the nodal coordinate system). Valid labels are: + Structural labels: UX, UY, or UZ (displacements); ROTX, ROTY, or ROTZ (rotations) (in radians). + Thermal labels: TEMP, TBOT, TE2, TE3,..., TTOP (temperature). Fluid labels: PRES (pressure); VX, + VY, or VZ (velocities). Electric labels: VOLT (voltage); EMF (electromotive force drop); CURR + (current). Magnetic labels: MAG (scalar magnetic potential); AZ (vector magnetic potential); + CURR (current). Diffusion label: CONC (concentration). The degree of freedom set is determined + from all element types defined and the :ref:`dof` command, if used. + """ + command = f"CPMERGE,{lab}" + return self.run(command, **kwargs) + + def cpngen( + self, + nset: str = "", + lab: str = "", + node1: str = "", + node2: str = "", + ninc: str = "", + **kwargs, + ): + r"""Defines, modifies, or adds to a set of coupled degrees of freedom. + + Mechanical APDL Command: `CPNGEN `_ + + Parameters + ---------- + nset : str + Set reference number ( :ref:`cp` ). + + lab : str + Degree of freedom label ( :ref:`cp` ). + + node1 : str + Include in coupled set nodes ``NODE1`` to ``NODE2`` in steps of ``NINC`` (defaults to 1). If + ``NODE1`` = P, graphical picking is enabled and all remaining command fields are ignored (valid + only in the GUI). If - ``NODE1``, delete range of nodes from set instead of including. A + component name may also be substituted for ``NODE1`` ( ``NODE2`` and ``NINC`` are ignored). + + node2 : str + Include in coupled set nodes ``NODE1`` to ``NODE2`` in steps of ``NINC`` (defaults to 1). If + ``NODE1`` = P, graphical picking is enabled and all remaining command fields are ignored (valid + only in the GUI). If - ``NODE1``, delete range of nodes from set instead of including. A + component name may also be substituted for ``NODE1`` ( ``NODE2`` and ``NINC`` are ignored). + + ninc : str + Include in coupled set nodes ``NODE1`` to ``NODE2`` in steps of ``NINC`` (defaults to 1). If + ``NODE1`` = P, graphical picking is enabled and all remaining command fields are ignored (valid + only in the GUI). If - ``NODE1``, delete range of nodes from set instead of including. A + component name may also be substituted for ``NODE1`` ( ``NODE2`` and ``NINC`` are ignored). + + Notes + ----- + + .. _CPNGEN_notes: + + Defines, modifies, or adds to a set of coupled degrees of freedom. May be used in combination with + (or in place of) the :ref:`cp` command. Repeat :ref:`cpngen` command for additional nodes. + """ + command = f"CPNGEN,{nset},{lab},{node1},{node2},{ninc}" + return self.run(command, **kwargs) + + def cpsel( + self, type_: str = "", vmin: str = "", vmax: str = "", vinc: str = "", **kwargs + ): + r"""Selects coupled degree-of-freedom sets via predefined reference numbers. + + Mechanical APDL Command: `CPSEL `_ + + Parameters + ---------- + type_ : str + Label identifying the type of select: + + * ``S`` - Select a new set (default). + + * ``A`` - Select an additional set and add it to the current set. + + * ``U`` - Unselect a set from the current set. + + * ``ALL`` - Restore the full set. + + * ``NONE`` - Unselect the full set. + + * ``INVE`` - Invert the current set (selected becomes unselected and vice versa). + + * ``STAT`` - Display the current select status. + + vmin : str + Minimum value of coupled DOF reference number range. + + vmax : str + Maximum value of coupled DOF reference number range. ``VMAX`` defaults to ``VMIN``. + + vinc : str + Value increment within the specified range. Defaults to 1. + + Notes + ----- + + .. warning:: + + This function contains specificities regarding the argument definitions. + Please refer to the `command documentation `_ + for further explanations. + + .. _CPSEL_notes: + + The :ref:`cpsel` command selects coupled degree-of-freedom sets ( :ref:`cp` ) via specified + reference numbers. ``VMIN``, ``VMAX``, and ``VINC`` must be positive integer values. + + For example, the following command selects a new set of coupled degree-of-freedom sets based on + reference numbers 1 through 7: + + .. code:: apdl + + CPSEL,S,,,1,7,1 + + Data are flagged as selected and unselected; no data are actually deleted from the database. + + Use :ref:`cplist` to list coupled degree-of-freedom sets and their reference numbers. If a coupled + degree-of-freedom set is selected but involves unselected nodes, that coupled degree-of-freedom set + will not be listed by the :ref:`cplist` command, and the solver ignores it. + + Internally coupled degrees of freedom are not affected by this command. + + This command is also valid in POST1. + """ + command = f"CPSEL,{type_},,,{vmin},{vmax},{vinc}" + return self.run(command, **kwargs) + + def cpsgen( + self, + itime: str = "", + inc: str = "", + nset1: str = "", + nset2: str = "", + ninc: str = "", + **kwargs, + ): + r"""Generates sets of coupled nodes from existing sets. + + Mechanical APDL Command: `CPSGEN `_ + + Parameters + ---------- + itime : str + Do this generation operation a total of ``ITIME`` s, incrementing all nodes in the existing sets + 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`` s, incrementing all nodes in the existing sets + by ``INC`` each time after the first. ``ITIME`` must be > 1 for generation to occur. + + nset1 : str + Generate sets from sets beginning with ``NSET1`` to ``NSET2`` (defaults to ``NSET1`` ) in steps + of ``NINC`` (defaults to 1). If ``NSET1`` is negative, ``NSET2`` and ``NINC`` are ignored and + the last \| ``NSET1`` \| sets (in sequence from the maximum set number) are used as the sets to be + repeated. + + nset2 : str + Generate sets from sets beginning with ``NSET1`` to ``NSET2`` (defaults to ``NSET1`` ) in steps + of ``NINC`` (defaults to 1). If ``NSET1`` is negative, ``NSET2`` and ``NINC`` are ignored and + the last \| ``NSET1`` \| sets (in sequence from the maximum set number) are used as the sets to be + repeated. + + ninc : str + Generate sets from sets beginning with ``NSET1`` to ``NSET2`` (defaults to ``NSET1`` ) in steps + of ``NINC`` (defaults to 1). If ``NSET1`` is negative, ``NSET2`` and ``NINC`` are ignored and + the last \| ``NSET1`` \| sets (in sequence from the maximum set number) are used as the sets to be + repeated. + + Notes + ----- + + .. _CPSGEN_notes: + + Generates additional sets of coupled nodes (with the same labels) from existing sets. Node numbers + between sets may be uniformly incremented. + """ + command = f"CPSGEN,{itime},{inc},{nset1},{nset2},{ninc}" + return self.run(command, **kwargs) diff --git a/src/ansys/mapdl/core/_commands/prep7/cross_sections.py b/src/ansys/mapdl/core/_commands/prep7/cross_sections.py new file mode 100644 index 00000000000..007c83f9e9e --- /dev/null +++ b/src/ansys/mapdl/core/_commands/prep7/cross_sections.py @@ -0,0 +1,3454 @@ +# 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 CrossSections: + + def bsax(self, val1: str = "", val2: str = "", t: str = "", **kwargs): + r"""Specifies the axial strain and axial force relationship for beam sections. + + Mechanical APDL Command: `BSAX `_ + + Parameters + ---------- + val1 : str + Axial strain component ( :math:`equation not available` ). + + val2 : str + Axial force component ( :math:`equation not available` ). + + t : str + Temperature. + + Notes + ----- + The behavior of beam elements is governed by the generalized-stress/generalized-strain relationship + of the `form + `_ : + + .. math:: + + equation not available + + The :ref:`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 :ref:`sectype` command). + + Unspecified values default to zero. + + Related commands are :ref:`bsm1`, :ref:`bsm2`, :ref:`bstq`, :ref:`bss1`, :ref:`bss2`, :ref:`bsmd`, + and :ref:`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: str = "", val2: str = "", t: str = "", **kwargs): + r"""Specifies the bending curvature and moment relationship in plane XZ for beam sections. + + Mechanical APDL Command: `BSM1 `_ + + Parameters + ---------- + val1 : str + Curvature component ( :math:`equation not available` ). + + val2 : str + Bending moment component ( :math:`equation not available` ). + + t : str + Temperature. + + Notes + ----- + The behavior of beam elements is governed by the generalized-stress/generalized-strain relationship + of the `form + `_ : + + .. math:: + + equation not available + + The :ref:`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 :ref:`sectype` command). + + Unspecified values default to zero. + + Related commands are :ref:`bsax`, :ref:`bsm2`, :ref:`bstq`, :ref:`bss1`, :ref:`bss2`, :ref:`bsmd`, + and :ref:`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: str = "", val2: str = "", t: str = "", **kwargs): + r"""Specifies the bending curvature and moment relationship in plane XY for beam sections. + + Mechanical APDL Command: `BSM2 `_ + + Parameters + ---------- + val1 : str + Curvature component ( :math:`equation not available` ). + + val2 : str + Bending moment component ( :math:`equation not available` ). + + t : str + Temperature. + + Notes + ----- + The behavior of beam elements is governed by the generalized-stress/generalized-strain relationship + of the `form + `_ : + + .. math:: + + equation not available + + The :ref:`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 :ref:`sectype` command). + + Unspecified values default to zero. + + Related commands are :ref:`bsax`, :ref:`bsm1`, :ref:`bstq`, :ref:`bss1`, :ref:`bss2`, :ref:`bsmd`, + and :ref:`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: str = "", t: str = "", **kwargs): + r"""Specifies mass per unit length for a nonlinear general beam section. + + Mechanical APDL Command: `BSMD `_ + + Parameters + ---------- + dens : str + Mass density. + + t : str + Temperature. + + Notes + ----- + The :ref:`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 :ref:`sectype` command). + + Related commands are :ref:`bsax`, :ref:`bsm1`, :ref:`bsm2`, :ref:`bstq`, :ref:`bss1`, :ref:`bss2`, + and :ref:`bste`. + + For complete information, see `Using Nonlinear General Beam Sections + `_ + """ + command = f"BSMD,{dens},{t}" + return self.run(command, **kwargs) + + def bss1(self, val1: str = "", val2: str = "", t: str = "", **kwargs): + r"""Specifies the transverse shear strain and force relationship in plane XZ for beam sections. + + Mechanical APDL Command: `BSS1 `_ + + Parameters + ---------- + val1 : str + Transverse shear strain component ( :math:`equation not available` ). + + val2 : str + Transverse shear force component ( :math:`equation not available` ). + + t : str + Temperature. + + Notes + ----- + The behavior of beam elements is governed by the generalized-stress/generalized-strain relationship + of the `form + `_ : + + .. math:: + + equation not available + + The :ref:`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 + :ref:`sectype` command). + + Unspecified values default to zero. + + Related commands are :ref:`bsax`, :ref:`bsm1`, :ref:`bsm2`, :ref:`bstq`, :ref:`bss2`, :ref:`bsmd`, + and :ref:`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: str = "", val2: str = "", t: str = "", **kwargs): + r"""Specifies the transverse shear strain and force relationship in plane XY for beam sections. + + Mechanical APDL Command: `BSS2 `_ + + Parameters + ---------- + val1 : str + Transverse shear strain component ( :math:`equation not available` ). + + val2 : str + Transverse shear force component ( :math:`equation not available` ). + + t : str + Temperature. + + Notes + ----- + The behavior of beam elements is governed by the generalized-stress/generalized-strain relationship + of the `form + `_ : + + .. math:: + + equation not available + + The :ref:`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 + :ref:`sectype` command). + + Unspecified values default to zero. + + Related commands are :ref:`bsax`, :ref:`bsm1`, :ref:`bsm2`, :ref:`bstq`, :ref:`bss1`, :ref:`bsmd`, + and :ref:`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: str = "", t: str = "", **kwargs): + r"""Specifies a thermal expansion coefficient for a nonlinear general beam section. + + Mechanical APDL Command: `BSTE `_ + + Parameters + ---------- + alpha : str + Coefficient of thermal expansion for the cross section. + + t : str + Temperature. + + Notes + ----- + The :ref:`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 :ref:`sectype` command). + + Related commands are :ref:`bsax`, :ref:`bsm1`, :ref:`bsm2`, :ref:`bstq`, :ref:`bss1`, :ref:`bss2`, + and :ref:`bsmd`. + + For complete information, see `Using Nonlinear General Beam Sections + `_ + """ + command = f"BSTE,{alpha},{t}" + return self.run(command, **kwargs) + + def bstq(self, val1: str = "", val2: str = "", t: str = "", **kwargs): + r"""Specifies the cross section twist and torque relationship for beam sections. + + Mechanical APDL Command: `BSTQ `_ + + Parameters + ---------- + val1 : str + Twist component ( :math:`equation not available` ). + + val2 : str + Torque component ( :math:`equation not available` ). + + t : str + Temperature. + + Notes + ----- + The behavior of beam elements is governed by the generalized-stress/generalized-strain relationship + of the `form + `_ : + + .. math:: + + equation not available + + The :ref:`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 :ref:`sectype` command). + + Unspecified values default to zero. + + Related commands are :ref:`bsax`, :ref:`bsm1`, :ref:`bsm2`, :ref:`bss1`, :ref:`bss2`, :ref:`bsmd`, + and :ref:`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: str = "", + c_r__r: str = "", + c_r__rplus1: str = "", + c_r__rplus2: str = "", + c_r__rplus3: str = "", + c_r__rplus4: str = "", + c_r__rplus5: str = "", + **kwargs, + ): + r"""Specifies preintegrated section mass matrix for composite-beam sections. + + Mechanical APDL Command: `CBMD `_ + + Parameters + ---------- + row : str + Row number of the matrix. + + c_r__r : str + Upper triangle of the cross-section mass matrix **[C]**. + + c_r__rplus1 : str + Upper triangle of the cross-section mass matrix **[C]**. + + c_r__rplus2 : str + Upper triangle of the cross-section mass matrix **[C]**. + + c_r__rplus3 : str + Upper triangle of the cross-section mass matrix **[C]**. + + c_r__rplus4 : str + Upper triangle of the cross-section mass matrix **[C]**. + + c_r__rplus5 : str + 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): + + .. math:: + + equation not available + + The :ref:`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 ( :ref:`sectype` ) at the specified temperature ( :ref:`cbtmp` ). + + Unspecified values default to zero. + + Related commands are :ref:`cbtmp`, :ref:`cbte`, and :ref:`cbmx`. + + For complete information, see `Using Preintegrated Composite Beam Sections + `_ + """ + command = f"CBMD,{row},{c_r__r},{c_r__rplus1},{c_r__rplus2},{c_r__rplus3},{c_r__rplus4},{c_r__rplus5}" + return self.run(command, **kwargs) + + def cbmx( + self, + row: str = "", + s_r__r: str = "", + s_r__rplus1: str = "", + s_r__rplus2: str = "", + s_r__rplus3: str = "", + s_r__rplus4: str = "", + s_r__rplus5: str = "", + s_r__rplus6: str = "", + **kwargs, + ): + r"""Specifies preintegrated cross-section stiffness for composite beam sections. + + Mechanical APDL Command: `CBMX `_ + + Parameters + ---------- + row : str + Row number of the matrix. + + s_r__r : str + Upper triangle of the cross-section stiffness matrix **[S]**. + + s_r__rplus1 : str + Upper triangle of the cross-section stiffness matrix **[S]**. + + s_r__rplus2 : str + Upper triangle of the cross-section stiffness matrix **[S]**. + + s_r__rplus3 : str + Upper triangle of the cross-section stiffness matrix **[S]**. + + s_r__rplus4 : str + Upper triangle of the cross-section stiffness matrix **[S]**. + + s_r__rplus5 : str + Upper triangle of the cross-section stiffness matrix **[S]**. + + s_r__rplus6 : str + 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 + `_ : + + .. math:: + + equation not available + + The :ref:`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 ( :ref:`sectype` ) at the specified temperature ( :ref:`cbtmp` ). + + Unspecified values default to zero. + + Related commands are :ref:`cbtmp`, :ref:`cbte`, and :ref:`cbmd`. + + For complete information, see `Using Preintegrated Composite Beam Sections + `_ + """ + command = f"CBMX,{row},{s_r__r},{s_r__rplus1},{s_r__rplus2},{s_r__rplus3},{s_r__rplus4},{s_r__rplus5},{s_r__rplus6}" + return self.run(command, **kwargs) + + def cbte(self, alpha: str = "", **kwargs): + r"""Specifies a thermal expansion coefficient for a composite beam section. + + Mechanical APDL Command: `CBTE `_ + + Parameters + ---------- + alpha : str + Coefficient of thermal expansion for the cross section. + + Notes + ----- + The :ref:`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 ( :ref:`sectype` ) at the specified temperature ( :ref:`cbtmp` + ). + + Unspecified values default to zero. + + Related commands are :ref:`cbtmp`, :ref:`cbmx`, and :ref:`cbmd`. + + For complete information, see `Using Preintegrated Composite Beam Sections + `_ + """ + command = f"CBTE,{alpha}" + return self.run(command, **kwargs) + + def sdelete( + self, + sfirst: str = "", + slast: str = "", + sinc: str = "", + knoclean: int | str = "", + lchk: str = "", + **kwargs, + ): + r"""Deletes sections from the database. + + Mechanical APDL Command: `SDELETE `_ + + Parameters + ---------- + sfirst : str + First section ID to be deleted; defaults to first available section in the database. + + slast : str + Last section ID to be deleted; defaults to last available section in the database. + + sinc : str + Increment of the section ID; defaults to 1. + + knoclean : int or str + Pretension element cleanup key (pretension sections only). + + * ``0`` - Perform cleanup of ``PRETS179`` pretension elements (delete pretension elements and + reconnect elements split during :ref:`psmesh` ). + + * ``1`` - Do not perform cleanup. + + 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 + ----- + + .. _SDELETE_notes: + + Deletes one or more specified sections and their associated data from the Mechanical APDL database. + """ + command = f"SDELETE,{sfirst},{slast},{sinc},{knoclean},{lchk}" + return self.run(command, **kwargs) + + def seccontrol( + self, + val1: str = "", + val2: str = "", + val3: str = "", + val4: str = "", + val5: str = "", + val6: str = "", + val7: str = "", + val8: str = "", + val9: str = "", + val10: str = "", + val11: str = "", + val12: str = "", + val13: str = "", + **kwargs, + ): + r"""Supplements or overrides default section properties. + + Mechanical APDL Command: `SECCONTROL `_ + + Parameters + ---------- + val1 : str + 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 :ref:`SECCONTROL_notes` section of this command description for + details about these values for the various section types. + + val2 : str + 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 :ref:`SECCONTROL_notes` section of this command description for + details about these values for the various section types. + + val3 : str + 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 :ref:`SECCONTROL_notes` section of this command description for + details about these values for the various section types. + + val4 : str + 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 :ref:`SECCONTROL_notes` section of this command description for + details about these values for the various section types. + + val5 : str + 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 :ref:`SECCONTROL_notes` section of this command description for + details about these values for the various section types. + + val6 : str + 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 :ref:`SECCONTROL_notes` section of this command description for + details about these values for the various section types. + + val7 : str + 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 :ref:`SECCONTROL_notes` section of this command description for + details about these values for the various section types. + + val8 : str + 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 :ref:`SECCONTROL_notes` section of this command description for + details about these values for the various section types. + + val9 : str + 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 :ref:`SECCONTROL_notes` section of this command description for + details about these values for the various section types. + + val10 : str + 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 :ref:`SECCONTROL_notes` section of this command description for + details about these values for the various section types. + + val11 : str + 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 :ref:`SECCONTROL_notes` section of this command description for + details about these values for the various section types. + + val12 : str + 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 :ref:`SECCONTROL_notes` section of this command description for + details about these values for the various section types. + + val13 : str + 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 :ref:`SECCONTROL_notes` section of this command description for + details about these values for the various section types. + + Notes + ----- + + .. _SECCONTROL_notes: + + The :ref:`seccontrol` command is divided into these operation types: :ref:`Beams, + ` :ref:`Links, ` :ref:`Pipes, ` :ref:`Shells, + and ` :ref:`Reinforcings. ` + + Values are associated with the most recently issued :ref:`sectype` command. The data required is + determined by the section type and is different for each type. + + :ref:`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``. + + **Beams** + + .. _SECCONTROL_beams: + + Type: BEAM + ^^^^^^^^^^ + + * Data to provide in the value fields ( ``VAL1`` through ``VAL4`` ): + + * ``TXZ`` - User transverse shear stiffness. + .. flat-table :: + + * -- - Unused field. + + * ``TXY`` - User transverse shear stiffness. + * ``ADDMAS`` - Added mass per unit length. + + **Links** + + .. _SECCONTROL_links: + + Type: LINK + ^^^^^^^^^^ + + * Data to provide in the value fields ( ``VAL1``, ``VAL2``, ``VAL3``, ``VAL4``, ``VAL5``, ``VAL6`` + ): + + * ``ADDMAS`` - Added mass per unit length. + * ``TENSKEY`` - Flag specifying tension and compression, tension only, or compression only (not + valid for ``CABLE280`` : + * 0 - Tension and compression (default). + * 1 - Tension only. + .. flat-table :: + + * -1 - Compression only. + + * ``CV1``, ``CV2`` - `Damping coefficients + `_. + * ``CV3`` - Compressive stiffness scaling factor (for ``CABLE280`` only). The ratio between + compressive stiffness and tensile stiffness. Default - 1.0e-5. Maximum - 1.0. + * ``CV4`` - Viscous regularization factor (for ``CABLE280`` only). Default - 0.05. Maximum - 1.0. + + **Pipes** + + .. _SECCONTROL_pipes: + + Type: PIPE + ^^^^^^^^^^ + + * Data to provide in the value field ( ``VAL1`` ): + + * ``ADDMAS`` - Added mass per unit length. Use this value to account for extra hardware only. + + * **Notes** + * Other masses are handled as follows: + + * The mass of the internal fluid is accounted for by ``M`` :sub:`int` on the :ref:`secdata` command. + + * The mass of the outer covering (insulation) is accounted for by ``M`` :sub:`ins` on the + :ref:`secdata` command. + + * The mass of the external fluid is accounted for by ``MATOC`` on the :ref:`ocdata` command. + + **Shells** + + .. _SECCONTROL_shells: + + Type: SHELL + ^^^^^^^^^^^ + + * Data to provide in the value fields ( ``VAL1`` through ``VAL8`` ): + + * ``E`` 11 - User transverse-shear stiffness. + * ``E`` 22 - User transverse-shear stiffness. + * ``E`` 12 - User transverse-shear stiffness. + * ``ADDMAS`` - Added mass-per-unit area. + * ``HMEMSCF`` - Hourglass-control membrane-scale factor. + * ``HBENSCF`` - Hourglass-control bending-scale factor. + * ``DRLSTIF`` - Drill-stiffness scale factor. + * ``BENSTIF`` - Bending-stiffness scale factor ( ``SHELL181`` and ``SHELL281`` ). + + **Reinforcing** + + .. _SECCONTROL_reinfs: + + Type: REINF + ^^^^^^^^^^^ + + * Data to provide in the value fields ( ``VAL1``, ``VAL2``, ``VAL3`` ): + + * ``TENSKEY`` - Flag specifying tension-and-compression, tension-only, or compression-only + reinforcing behavior (valid for structural reinforcing analysis): + * 0 - Tension and compression (default). + * 1 - Tension only. + .. flat-table :: + + * -1 - Compression only. + * ------------- + + + * ``REMBASE`` - Flag specifying how base-element material is handled: + * 0 - Retain base-element material in the space occupied by the reinforcing fibers (default). + * 1 - Remove base-element material in the space occupied by the reinforcing fibers. + .. flat-table :: + + * ------------- + + + * ``STSSTATE`` - Flag specifying the reinforcing stress state or heat flow: + * For smeared reinforcing: + * 0 - Uniaxial-stress state (for structural reinforcing analysis) or uniaxial heat flow (for thermal + reinforcing analysis). Only ``kxx`` is required. (Default.) + * 1 - Plane-stress state (for structural reinforcing analysis) or anisotropic heat flow (for thermal + reinforcing analysis). Both kxx and kyy are specified. + * 2 - Plane-stress state with transverse shear stiffness. Valid for 3D smeared structural + reinforcing analysis. + * 3 - Plane-stress state with transverse shear stiffness and bending stiffness. Valid for 3D smeared + structural reinforcing analysis with solid base elements. + * For discrete reinforcing: + * 0 - Uniaxial stiffness, or uniaxial heat flow for thermal reinforcing analysis. (Default.) + * 1 - Uniaxial, bending, and torsional stiffness with square cross section. Valid for 3D structural + reinforcing analysis with solid base elements. + + * **Notes** + * ``REMBASE`` = 1 typically leads to more accurate models. (The base material must support 1D stress + states.) For structural-reinforcing analysis, the base-element material consists of mass, + stiffness, and body force. For thermal-reinforcing analysis, the base-element material consists of + damping, conduction, and heat generation, and the base-element surface loads (convection and heat + flux) are not subtracted. This option is not valid when the base-element material is anisotropic. + * For smeared reinforcing with ``STSSTATE`` = 0, the equivalent thickness h of the smeared + reinforcing layer is determined by h = ``A`` / ``S``, where ``A`` is the cross-section area of a + single fiber and ``S`` is the distance between two adjacent fibers. (See :ref:`secdata`.) + * ``STSSTATE`` = 1 to 3 is suitable for homogenous reinforcing layers (membrane) and applies to + smeared reinforcing only ( :ref:`sectype`,,REINF,SMEAR). For smeared reinforcing with ``STSSTATE`` + = 1 to 3, discrete reinforcing with ``STSSTATE`` = 1, ``TENSKEY`` is ignored, and the default + tension and compression behaviors apply to the reinforcing layers; also, the cross-section area + input ``A`` is the thickness of the reinforcing layers and the distance input ``S`` is ignored. + (See :ref:`secdata` and `REINF265 Structural/Thermal Input Data + `_ + * For discrete reinforcing with ``STSSTATE`` = 1 or smeared reinforcing with ``STSSTATE`` = 3, + bending or torsional reinforcing stiffness may not be captured adequately when using reinforcing + with overly refined high-order base tetrahedral elements ( ``SOLID187`` or degenerated + ``SOLID186`` ) and the stiffness ratio between reinforcing and base elements is excessive (> + 100x). + * Specified ``TENSKEY``, ``REMBASE`` and ``STSSTATE`` values apply to all fibers defined in the + current section. + * For more information, see `Element Embedding + `_ + """ + 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: str = "", + val2: str = "", + val3: str = "", + val4: str = "", + val5: str = "", + val6: str = "", + val7: str = "", + val8: str = "", + val9: str = "", + val10: str = "", + val11: str = "", + val12: str = "", + **kwargs, + ): + r"""Describes the geometry of a section. + + Mechanical APDL Command: `SECDATA `_ + + Parameters + ---------- + val1 : str + 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. + + val2 : str + 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. + + val3 : str + 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. + + val4 : str + 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. + + val5 : str + 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. + + val6 : str + 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. + + val7 : str + 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. + + val8 : str + 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. + + val9 : str + 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. + + val10 : str + 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. + + val11 : str + 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. + + val12 : str + 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 + ----- + + .. _SECDATA_notes: + + The :ref:`secdata` command defines the data describing the geometry of a section. The command is + divided into these section types: `Beams + `_ + Beams, :ref:`Contact, ` :ref:`General Axisymmetric, ` :ref:`Joints, + ` :ref:`Links, ` `Pipes + `_ + Pipes, :ref:`Pretension, ` :ref:`Reinforcing, ` + :ref:`Shells, ` :ref:`Supports, and ` :ref:`Taper. + ` + + The data input on the :ref:`secdata` command is interpreted based on the most recently issued + :ref:`sectype` command. The data required is determined by the section type and subtype, and is + different for each one. + + .. _SECDATA_beams: + + Type: BEAM + ^^^^^^^^^^ + + Beam sections are referenced by ``BEAM188`` and ``BEAM189`` elements. Not all :ref:`secoffset` + location values are valid for each subtype. + + This command contains some tables and extra information which can be inspected in the original + documentation pointed above. + + .. _SECDATA_contact: + + Type: CONTACT + ^^^^^^^^^^^^^ + + Geometry Correction Contact sections for geometry correction ( ``Subtype`` = CIRCLE, SPHERE, or + CYLINDER) are referenced + by the following elements: ``TARGE169``, ``TARGE170``, ``CONTA172``, and ``CONTA174``. This geometry + correction applies to cases where the original meshes of contact elements or target elements are + located on a portion of a circular, spherical, or revolute surface. + + **Type: CONTACT, Subtype: CIRCLE** + + * Data to provide in the value fields for ``Subtype`` = CIRCLE: + * ``X0``, ``Y0`` (circle center location in Global Cartesian coordinates - XY plane) + + **Type: CONTACT, Subtype: SPHERE** + + * Data to provide in the value fields for ``Subtype`` = SPHERE: + * ``X0``, ``Y0``, ``Z0`` (sphere center location in Global Cartesian coordinates) + + **Type: CONTACT, Subtype: CYLINDER** + + * Data to provide in the value fields for ``Subtype`` = CYLINDER: + * ``X1``, ``Y1``, ``Z1``, ``X2``, ``Y2``, ``Z2`` (two ends of cylindrical axis in Global Cartesian + coordinates) + + User-Defined Contact Surface Normal The contact section for a user-defined contact surface normal ( + ``Subtype`` = NORMAL) is referenced + by the following elements: ``CONTA172``, ``CONTA174``, and ``CONTA175``. This geometry correction is + used to define a `shift direction for interference fit + `_ solutions. + + **Type: CONTACT, Subtype: NORMAL** + + * Data to provide in the value fields for ``Subtype`` = NORMAL: + * ``CSYS``, ``NX``, ``NY``, ``NZ`` + * where: + * ``CSYS`` = Local coordinate system number (defaults to global Cartesian). + * ``NX``, ``NY``, ``NZ`` = Direction cosines with respect to ``CSYS.`` + + Radius values associated with contact or target elements The radius contact section ( ``Subtype`` = + RADIUS) is referenced by contact or target elements in a general contact definition under the + following circumstances: + + * **Equivalent 3D contact radius for beam-to-beam contact** - The contact section for a user-defined + equivalent contact radius ( ``Subtype`` = RADIUS) is referenced by the element type ``CONTA177`` + within a general contact definition. 3D beam-to-beam contact (or edge-to-edge contact) modeled by + this line contact element assumes that its surface is a cylindrical surface. + + * **Radius (or radii) of rigid target segments** - The contact section for rigid target segment + radii is referenced by target elements ``TARGE169`` (circle segment type) and ``TARGE170`` (line, + parabola, cylinder, sphere, or cone segment type) in a general contact definition. + + **Type: CONTACT, Subtype: RADIUS** + + * Data to provide in the value fields for ``Subtype`` = RADIUS if the section is used as an + equivalent contact radius for 3D beam-to-beam contact: + * ``VAL1`` = Equivalent radius - outer radius + * ``VAL2`` = Equivalent radius - inner radius (internal beam-to-beam contact) + * ``VAL3`` : Set to 1 for internal beam-to-beam contact. Defaults to external beam-to-beam contact. + + * Data to provide in the value fields for ``Subtype`` = RADIUS if the section is used for 2D or 3D + rigid target segments: + * ``VAL1`` = First radius of the target segment (used for circle, line, parabola, cylinder, sphere, + and cone segment types) + * ``VAL2`` = Second radius of the target segment (used only for the cone segment type) + + Simplified Bolt Thread Modeling The contact section for bolt-thread modeling ( ``Subtype`` = BOLT) + is referenced by the following + elements: ``CONTA172``, ``CONTA174``, and ``CONTA175``. It applies to cases where the original + meshes of contact elements are located on a portion of a bolt-thread surface. This feature allows + you to include the behavior of bolt threads without having to add the geometric detail of the + threads. Calculations are performed internally to approximate the behavior of the bolt-thread + connections. + + **Type: CONTACT, Subtype: BOLT** + + * Data to provide in the value fields for ``Subtype`` = BOLT: + * ``D`` m, ``P``, ``ALPHA``, ``N``, ``X1``, ``Y1``, ``Z1``, ``X2``, ``Y2``, ``Z2`` + * where: + * ``D`` m = Pitch diameter, d :sub:`m`. + * ``P`` = Pitch distance, p. + * ``ALPHA`` = Half-thread angle, α (defaults to 30 degrees). + * ``N`` = Number of starts (defaults to 1). + * ``X1``, ``Y1``, ``Z1``, ``X2``, ``Y2``, ``Z2`` = Two end points of the bolt axis in global + Cartesian coordinates. + + .. _SECDATA_axisy: + + Type: AXIS + ^^^^^^^^^^ + + General axisymmetric sections are referenced by the ``SURF159``, ``SOLID272``, and ``SOLID273`` + elements. Use this command to locate the axisymmetric axis. + + * Data to provide in the value fields: + * **Pattern 1 (two points):** + * 1, ``X1``, ``Y1``, ``Z1``, ``X2``, ``Y2``, ``Z2`` + * where ``X1``, ``Y1``, ``Z1``, ``X2``, ``Y2``, ``Z2`` are global Cartesian coordinates. + * **Pattern 2 (coordinate system number plus axis [1 = x, 2 = y, 3 = z] ):** + * 2, ``csys``, ``axis`` + * where ``csys`` is a Cartesian coordinate system. + * **Pattern 3 (origin plus direction):** + * 3, ``XO``, ``YO``, ``ZO``, ``xdir``, ``ydir``, ``zdir`` + * where ``XO``, ``YO``, ``ZO`` ``are global Cartesian coordinates and xdir``, ``ydir``, and + ``zdir`` are direction cosines. + + .. _SECDATA_joints: + + Type: JOINT + ^^^^^^^^^^^ + + Joint sections are referenced by ``MPC184`` joint elements. + + * Data to provide in the value fields: + * ``length1``, ``length2``, ``length3``, ``angle1``, ``angle2``, ``angle3`` + * where: + * ``length1-3`` = Reference lengths used in the constitutive calculations. + * ``angle1-3`` = Reference angles used in the constitutive calculations. + + The following table shows the lengths and angles to be specified for different kinds of joints. + + This command contains some tables and extra information which can be inspected in the original + documentation pointed above. + + The reference length and angle specifications correspond to the free relative degrees of freedom in + a joint element for which constitutive calculations are performed. These values are used when + stiffness and/or damping are specified for the joint elements. + + If the reference lengths and angles are not specified, they are calculated from the default or + starting configuration for the element. + + See ``MPC184`` or the individual joint element descriptions for more information on joint element + constitutive calculations. + + .. _SECDATA_links: + + Type: LINK + ^^^^^^^^^^ + + Link sections are referenced by the ``LINK33``, ``LINK180`` and ``CABLE280`` elements. + + * Data to provide in the value fields: + * ``VAL1`` = Area + + .. _SECDATA_pipes: + + Type: PIPE + ^^^^^^^^^^ + + Pipe sections are referenced by the ``PIPE288``, ``PIPE289``, and ``ELBOW290`` elements. + + * Data to provide in the value fields: + * ``D`` :sub:`o`, ``T`` :sub:`w`, ``N`` :sub:`c`, ``S`` :sub:`s`, ``N`` :sub:`t`, ``M`` + :sub:`int`, ``M`` :sub:`ins`, ``T`` :sub:`ins` + * where: + * ``D`` :sub:`o` = Outside diameter of pipe. Use a constant value for a circular pipe and an array + for a noncircular pipe. (Noncircular pipe sections are referenced by the ``ELBOW290`` element + only. See `Defining a Noncircular Pipe + `_ + * ``T`` :sub:`w` = Wall thickness. Default = ``D`` o / 2, or “solid” pipe. ("Solid" pipe is not + applicable to ``ELBOW290`` ; for that element, a thickness less than ``D`` o / 4 is recommended.) + * ``N`` :sub:`c` = Number of cells around the circumference (8 :math:`equation not available` + ``N`` :sub:`c` :math:`equation not available` 120, where a greater value improves accuracy + slightly; default = 8). + * ``S`` :sub:`s` = Section number of the shell representing the pipe wall. Valid with ``ELBOW290`` + only. (Total thickness of the section is scaled to ``T`` :sub:`w`. The program considers the + innermost layer inside of the pipe to be the first layer.) + * ``N`` :sub:`t` = Number of cells through the pipe wall. Valid values are 1 (default), 3, 5, 7, + and 9. Cells are graded such that they are thinner on the inner and outer surfaces. Valid with + ``PIPE288`` and ``PIPE289`` only. + * ``M`` :sub:`int` = Material number of fluid inside of the pipe. The default value is 0 (no + fluid). This value is used to input the density of the internal fluid. The fluid inside the pipe + element is ignored unless the free surface in a global X-Y plane is added as face 3 ( :ref:`sfe` ) + and is high enough to include at least one end node of the element. + * ``M`` :sub:`ins` = Material number of material external to the pipe (such as insulation or + armoring). The default value is 0 (no external material). This value is used to input the density + of the external material. (External material adds mass and increases hydraulic diameter, but does + not add to stiffness.) + * ``T`` :sub:`ins` = Thickness of material external to the pipe, such as insulation. The default + value is 0 (no external material). + + The accuracy of the ovalization value (OVAL) output by ``ELBOW290`` ( `Structural Elbow + `_ + form only) improves as the specified number of cells around the circumference ( ``N`` :sub:`c` ) is + increased. + + External material ( ``M`` :sub:`ins` ) adds mass and increases hydraulic diameter, but does not add + to stiffness. + + .. figure::../../../images/_commands/gSECD_pipe.svg + + .. _SECDATA_pretension: + + Type: PRETENSION + ^^^^^^^^^^^^^^^^ + + Pretension sections are referenced by the ``PRETS179`` element. + + * Data to provide in the value fields: + * ``node``, ``nx``, ``ny``, ``nz`` + * where: + * ``node`` = Pretension node number. + * ``nx`` = Orientation in global Cartesian x direction. + * ``ny`` = Orientation in global Cartesian y direction. + * ``nz`` = Orientation in global Cartesian z direction. + + The following usage is typical: + + * SECTYPE, 1, PRETENSION + * SECDATA, 13184, 0.000, 0.000, 1.000 + * SECMODIF, 1, NAME, example + * SLOAD, 1, PL01, TINY, FORC, 100.00, 1, 2 + + The ``PRETENSION`` section options of :ref:`sectype` and :ref:`secdata` are documented mainly to aid + in the understanding of data written by :ref:`cdwrite`. Ansys, Inc. recommends that you + generate pretension sections using :ref:`psmesh`. + + .. _SECDATA_reinforcement: + + Type: REINF + ^^^^^^^^^^^ + + Each :ref:`secdata` command defines the material, geometry, and orientation (if Subtype = SMEAR) of + one reinforcing member (discrete fiber or smeared surface) in the section. The reinforcing section + can be referenced by reinforcing elements ( ``REINF263``, ``REINF264``, and ``REINF265`` ), or + ``MESH200`` elements when used for temporarily representing reinforcing members. Only one + :ref:`secdata` command is allowed per section when referenced by ``MESH200`` elements. For more + information, see `Element Embedding + `_ + + - - - - - - - - - - - - - - - - - - - - - + + **Type: REINF, Subtype: DISCRETE** + + Defines discrete reinforcing fibers with arbitrary orientations. For the MESH input pattern, + reinforcing section data is referenced by ``MESH200`` elements. For other patterns, issue separate + :ref:`secdata` commands to define each reinforcing fiber. + + * Data to provide in the value fields: + * ``MAT, A, PATT, V1, V2, V3, V4, V5`` + * ``MAT`` = Material ID for the fiber. (See ``REINF264`` for valid material models.) When the + reinforcing section is referenced by a ``MESH200`` element, the default is the ``MESH200`` element + material ID ( :ref:`mat` ). When the section is referenced by reinforcing elements, the material + ID is required for all fibers, and no default for this value is available. + * ``A`` = Cross-section area of the reinforcing fiber. + * ``PATT`` = Input pattern code (described below) indicating how the location of this fiber is + defined. Available input patterns are MESH (when the section is referenced by a ``MESH200`` + element), and LAYN, EDGO, and BEAM (when the section is referenced by a reinforcing element). + * ``V1, V2, V3, V4, V5`` = Values to define the location of the reinforcing fiber (depending on the + ``PATT`` pattern code used), as shown: + + **PATT: MESH** + + **Description:** The locations of reinforcing fibers are defined directly via ``MESH200`` element + connectivity. + + **Required input:**None. + + **PATT: LAYN** + + **Description:** The discrete reinforcing fiber is placed in the middle of a layer in a layered base + element. The + orientation of the fiber within the layer is adjustable via offsets with respect to a specified + element edge. + + **Required input:** + + * ``V1`` (or ``N`` ) -- The number of the layer in the base element on which to apply the + reinforcing fiber. The default value is 1. + * ``V2`` (or ``e`` ) -- The number to indicate the element edge to which the offsets are measured. + The default value is 1. + * ``V3`` and ``V4`` (or ``Y1`` and ``Y2`` ) -- The normalized distances from the fiber to the two + ends of the specified element edge. Valid values for ``Y1`` and ``Y2`` are 0.0 through 1.0. The + default value of ``Y1`` is 0.5. The default value of ``Y2`` is ``Y1``. + + When applied to 8-node or 20-node layered solid elements: + + .. figure::../../../images/_commands/gSECD18.svg + + .. figure::../../../images/_commands/gSECD19.svg + + When applied to 4-node or 8-node layered shell elements: + + .. figure::../../../images/_commands/gSECD20.svg + + .. figure::../../../images/_commands/gSECD21.svg + + **PATT: EDGO** + + **Description:** The orientation of the discrete reinforcing fiber is similar to one of the + specified element edges. + The fiber orientation can be further adjusted via offsets with respect to the specified element + edge. + + **Required input:** + + * ``V1`` (or ``O`` ) -- The number to indicate the element edge to which the offsets are measured. + The default value is 1. + * ``V2`` and ``V3`` (or ``Y1`` and ``Z1`` ) -- The normalized distances from the fiber to the first + end of the specified element edge. Valid values for ``Y1`` and ``Z1`` are 0.0 through 1.0. The + default value for ``Y1`` and ``Z1`` is 0.5. + * ``V4`` and ``V5`` (or ``Y2`` and ``Z2`` ) - The normalized distances from the fiber to the second + end of the specified element edge. Value values for ``Y2`` and ``Z2`` are 0.0 through 1.0. The + default value for ``Y2`` is ``Y1``, and the default value for ``Z2`` is ``Z1``. + + If the base element is a beam or link, the program ignores values ``V2`` through ``V5`` and instead + places the reinforcing in the center of the beam or link. + + When applied to 8-node or 20-node solid elements: + + .. figure::../../../images/_commands/gSECD22.svg + + .. figure::../../../images/_commands/gSECD22b.svg + + .. figure::../../../images/_commands/gSECD22c.svg + + When applied to tetrahedral elements: + + This command contains some tables and extra information which can be inspected in the original + documentation pointed above. + + When applied to 3D shell elements: + + .. figure::../../../images/_commands/gSECD28.svg + + .. figure::../../../images/_commands/gSECD29.svg + + When applied to beam or link elements: + + .. figure::../../../images/_commands/gSECD30.svg + + **PATT: BEAM** + + **Description:** Use this specialized input pattern for defining reinforcing in regular constant and + tapered beams. + + **Required input:** + + * ``V1`` and ``V2`` (or ``Y1`` and ``Z1`` ) -- Y and Z offsets with respect to the section origin in + the first beam section referenced by the base beam element. The default value for Y1 and Z1 is + 0.0. + * ``V3`` and ``V4`` (or ``Y2`` and ``Z2`` ) -- Y and Z offsets with respect to the section origin in + the second beam section referenced by the base beam element. The default value for ``Y2`` is + ``Y1``, and the default value for ``Z2`` is ``Z1``. (Because ``V3`` and ``V4`` values apply only + to tapered beams, the program ignores them if the base beam has a constant section.) + + .. figure::../../../images/_commands/gSECD31.svg + + - - - - - - - - - - - - - - - - - - - - - + + **Type: REINF, Subtype: SMEAR** + + Suitable for layers of reinforcing fibers with uniform cross-section area and spacing. Each + :ref:`secdata` command defines the one reinforcing layer in the section. When referenced by a + ``MESH200`` element, only one :ref:`secdata` command per section is allowed. When referenced by + reinforcing elements ( ``REINF263`` and ``REINF265`` ), this limitation does not apply. + + * Data to provide in the value fields: + * ``MAT, A, S, KCN, THETA, PATT, V1, V2, V3, V4, V5`` + * where: + * ``MAT`` = Material ID for layer. (See ``REINF263`` or ``REINF265`` for available material models.) + When the section is referenced by a ``MESH200`` element, the default is the ``MESH200`` element + material ID ( :ref:`mat` ). When the section is referenced by reinforcing elements, the material + ID is required for all fibers, and no default for this value is available. + * ``A`` = Cross-section area of a single reinforcing fiber ( or the thickness of the reinforcing + layer for homogeneous reinforcing membranes). + * ``S`` = Distance between two adjacent reinforcing fibers (ignored for homogeneous reinforcing + membranes). + * **Note:** If the section is used to model the reinforcing layers with a uniaxial stress state ( + :ref:`seccontrol`,,,0), the equivalent thickness h of the reinforcing layer is determined by h = + ``A`` / ``S``, where ``A`` is the cross-section area of a single fiber and ``S`` is the distance + between two adjacent fibers. If the section is used to model homogeneous reinforcing membranes ( + :ref:`seccontrol`,,,1), the cross-section area input ``A`` is the thickness of the reinforcing + layer and the distance input ``S`` is ignored. + * ``KCN`` = Local coordinate system reference number for this layer. (See :ref:`local` for more + information.) When the section is referenced by a ``MESH200`` element, the default ``KCN`` value + is the ``MESH200`` element coordinate system ID ( :ref:`esys` ). For the 2D smeared reinforcing + element ``REINF263``, ``KCN`` input is not required. When ``KCN`` is not specified, the program + uses a default layer coordinate system (described in ``REINF263`` and ``REINF265`` ). + * ``THETA`` = Angle (in degrees) of the final layer coordinate system with respect to the default + layer system or the layer system specified in the ``KCN`` field. This value is ignored for + ``REINF263`` when that element is embedded in 2D plane strain or plane stress base elements. + * ``PATT`` = Input pattern code (described below) indicating how the location of this fiber is + defined. Available input patterns are MESH (when the section is referenced by a ``MESH200`` + element), and LAYN, EDGO, and BEAM (when the section is referenced by a reinforcing element). + * ``V1, V2, V3, V4, V5`` = Values to define the location of the reinforcing layer, as shown: + + **PATT: MESH** + + **Description:** The locations of reinforcing fibers are defined directly via ``MESH200`` element + connectivity. + + **Required input:**None. + + **PATT: LAYN** + + **Description:** The smeared reinforcing layer is placed in the middle of a layer in a layered base + element. + + **Required input:**``V1`` (or ``n`` ) -- The number of the layer in the base element on which to apply the reinforcing layer. The default value is 1. + + This command contains some tables and extra information which can be inspected in the original + documentation pointed above. + + **PATT: EDGO** + + **Description:** This pattern applies only to 2D smeared reinforcing element ``REINF263``. The + smeared reinforcing layer is represented by a line in 2D. The orientation of the 2D smeared + reinforcing layer is similar to one of the specified element edges. The fiber orientation can be + further adjusted via offsets with respect to the specified element edge. + + **Required input:** + + * ``V1`` (or ``O`` ) -- The number to indicate the element edge to which the offsets are measured. + The default value is 1. + * ``V2`` (or ``Y1`` ) -- The normalized distances from the reinforcing layer to the first end of the + specified element edge. Valid values for Y1 are 0.0 through 1.0. The default value for ``Y1`` is + 0.5. ``V3`` (or ``Z1`` ) input is ignored. + * ``V4`` (or ``Y2`` ) -- The normalized distances from the reinforcing layer to the second end of + the specified element edge. Valid value values for ``Y2`` are 0.0 through 1.0. The default value + for ``Y2`` is ``Y1``. ``V4`` (or ``Y2`` ) is ignored for axisymmetric shell elements. ``V5`` (or + ``Z2``` ) input is ignored. + + This command contains some tables and extra information which can be inspected in the original + documentation pointed above. + + **PATT: ELEF** + + **Description:** The smeared reinforcing layer is oriented parallel to one of three adjacent element + faces. (This + pattern does not apply to 2D smeared reinforcing element ``REINF263``.) + + **Required input:** + + * ``V1`` (or ``F`` ) -- The number to indicate the base element face. The default value is 1. + * ``V2`` (or ``d1`` ) -- The normalized distance from the layer to the specified base element face. + Valid values for ``d1`` are 0.0 through 1.0. The default value is 0.5. + * ``V3`` (or ``d2`` ) -- The normalized distance from corners JJ and KK of the layer to the + specified base element face (applicable to 8-node or 20-node solid elements only). Valid values + for ``d2`` are 0.0 through 1.0. The default value is ``d1``. + + When applied to 8-node or 20-node solid elements: + + This command contains some tables and extra information which can be inspected in the original + documentation pointed above. + + When applied to tetrahedral elements: + + This command contains some tables and extra information which can be inspected in the original + documentation pointed above. + + When applied to 3D shell elements: + + .. figure::../../../images/_commands/gSECD16.svg + + .. _SECDATA_shells: + + Type: SHELL + ^^^^^^^^^^^ + + Shell sections are referenced by the ``SHELL131``, ``SHELL132``, ``SHELL181``, ``SOLID185`` Layered + Solid, ``SOLID186`` Layered Solid, ``SOLSH190``, ``SHELL208``, ``SHELL209``, ``SOLID278`` Layered + Solid, ``SOLID279`` Layered Solid, and ``SHELL281`` elements. + + * Data to provide in the value fields: + * ``TK``, ``MAT``, ``THETA``, ``NUMPT``, ``LayerName`` + * where: + * ``TK`` = Thickness of shell layer. Zero thickness (not valid for ``SHELL131`` and ``SHELL132`` ) + indicates a dropped layer. The sum of all layer thicknesses must be greater than zero. The total + thickness can be tapered via the :ref:`secfunction` command. + * ``MAT`` = Material ID for layer (any current-technology material model is available for + ``SHELL181``, ``SOLID185`` Layered Solid, ``SOLID186`` Layered Solid, ``SOLSH190``, ``SHELL208``, + ``SHELL209``, ``SOLID278`` Layered Solid and ``SOLID279`` Layered Solid [including `UserMat + `_ ], and + ``SHELL281`` ). ``MAT`` is required for a composite (multi-layered) laminate. For a homogeneous + (single-layered) shell, the default is the `element material attribute + `_. + You can also address multiple reference temperatures ( :ref:`tref` and/or :ref:`mp`,REFT). + + * ``THETA`` = Angle (in degrees) of layer element coordinate system with respect to element + coordinate system (ESYS). + * ``NUMPT`` = Number of integration points in layer. The user interface offers 1, 3 (default), 5, 7, + or 9 points; however, you can specify a higher number on the :ref:`secdata` command. The + integration rule used is Simpson's Rule. ( ``NUMPT`` is not used by ``SHELL131`` and + ``SHELL132``.) + + .. _SECDATA_supports: + + Type: SUPPORT + ^^^^^^^^^^^^^ + + Support sections are referenced by ``SOLID185`` and ``SOLID186`` elements. + + **Type: SUPPORT, Subtype: BLOCK** + + * Data to provide in the value fields for ``Subtype`` = BLOCK: + * ``T``, ``L`` + * where: + * ``T`` = Thickness of the block wall. + * ``L`` = Spacing distance of the block walls. + + **Type: SUPPORT, Subtype: ASEC** + + * Data to provide in the value fields for ``Subtype`` = ASEC: + + This command contains some tables and extra information which can be inspected in the original + documentation pointed above. + + * The multiplication factors are homogenization factors, and in each direction reflect the ratio of + the support area projected onto the area of a fully solid support. + * Values default to 1.0. + * Y and Z values default to X values. + * GXY value defaults to EX value, GYZ to EY, and GXZ to EZ. + + .. _SECDATA_taper: + + Type: TAPER + ^^^^^^^^^^^ + + Tapered sections are referenced by ``BEAM188``, ``BEAM189`` and ``ELBOW290`` elements. After + specifying the tapered section type ( :ref:`sectype`,,TAPER), issue separate :ref:`secdata` commands + to define each end of the tapered beam or pipe. + + * Data to provide in the value fields: + * ``Sec_IDn``, ``XLOC``, ``YLOC``, ``ZLOC`` + + * where: + * ``Sec_IDn`` = Previously defined beam or pipe section at ends 1 and 2. + * ``XLOC``, ``YLOC``, ``ZLOC`` = The location of Sec_ID n in the global Cartesian coordinate system. + + For more information about tapered beams and pipes, including assumptions and example command input, + see `Defining a Tapered Beam or Pipe + `_ + + """ + command = f"SECDATA,{val1},{val2},{val3},{val4},{val5},{val6},{val7},{val8},{val9},{val10},{val11},{val12}" + return self.run(command, **kwargs) + + def secfunction(self, table: str = "", pattern: str = "", **kwargs): + r"""Specifies shell section thickness as a tabular function. + + Mechanical APDL Command: `SECFUNCTION `_ + + Parameters + ---------- + table : str + Name of table parameter or array parameter for specifying thickness. + + pattern : str + Interpretation pattern for array parameters. + + Notes + ----- + + .. _SECFUNCTION_notes: + + The :ref:`secfunction` command is associated with the section most recently defined via the + :ref:`sectype` command. + + A table parameter 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. (See + ``PATTERN`` of NOD2 for array content.) Enclose the table or array name in percent signs (%) ( + :ref:`secfunction`,``tablename``). + + Issue the :ref:`dim` command to define a table or array. + + 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. + + Refer to the :ref:`dim` command for interpreting a table in a local coordinate system. + + When ``PATTERN`` = NODE, ``TABLE`` should be a 1D array parameter (indexed by node number) that + expresses the function to be mapped. + + When ``PATTERN`` = NOD2, ``TABLE`` should be a 2D array parameter (where column 1 contains node + numbers and column 2 contains the corresponding thicknesses) that expresses the function to be + mapped. + + Specify ``PATTERN`` when ``TABLE`` is an array parameter only (and not when it is a table parameter + or a single value). + """ + command = f"SECFUNCTION,{table},{pattern}" + return self.run(command, **kwargs) + + def secjoint( + self, + kywrd: str = "", + val1: str = "", + val2: str = "", + val3: str = "", + val4: str = "", + val5: str = "", + val6: str = "", + **kwargs, + ): + r"""Defines local coordinate systems at joint element nodes and other data for joint elements. + + Mechanical APDL Command: `SECJOINT `_ + + Parameters + ---------- + kywrd : str + 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``, ``MPC184-Slot``, ``MPC184-Translational``, or ``MPC184-Spherical`` joint + element. + + * ``PNLT`` - Define the penalty factors for the penalty-based joint element formulation. + + val1 : str + The meaning of ``Val1`` through ``Val6`` changes, depending on the value of ``Kywrd``. + + If ``Kywrd`` = LSYS (or blank), ``Val1`` and ``Val2`` are Identifiers of the local coordinate + systems at nodes I and J, respectively, of the joint element. ``Val3`` through ``Val6`` are not + used. + + If ``Kywrd`` = RDOF, ``Val1`` through ``Val6`` are the relative degrees of freedom to be fixed for a + general joint element. Input 1 for UX, 2 for UY, 3 for UZ, 4 for ROTX, 5 for ROTY, and 6 for ROTZ. + You may input the DOFs in any order. + + If ``Kywrd`` = PITC, ``Val1`` is the pitch of the screw joint element; pitch is defined as the ratio + of relative axial displacement (length units) to relative rotation (in radians). ``Val2`` through + ``Val6`` are not used. + + If ``Kywrd`` = FRIC, ``Val1`` through ``Val3`` are defined as follows. + + * **For Revolute Joint:** + * ``Val1`` = outer radius + * ``Val2`` = inner radius + * ``Val3`` = effective length + * **For Translational Joint:** + * ``Val1`` = effective length + * ``Val2`` = effective radius + * **For Spherical Joint:** + * ``Val1`` = effective radius + + If ``Kywrd`` = PNLT, ``Val1`` and ``Val2`` are defined as follows, and ``Val3`` through ``Val6`` are not used. + + * ``Val1`` - Constraint type: + + * DISP - Displacement-based constraint + * ROT - Rotation-based constraint + + * ``Val2`` - Scaling factor (input a positive number) or penalty factor (input a negative number) used with the + penalty-based joint element formulation: + + * Positive number - the number is used as a scaling factor to scale the internally calculated + penalty values. + * Negative number - the absolute value of the number is used as the penalty factor in calculations. + + val2 : str + The meaning of ``Val1`` through ``Val6`` changes, depending on the value of ``Kywrd``. + + If ``Kywrd`` = LSYS (or blank), ``Val1`` and ``Val2`` are Identifiers of the local coordinate + systems at nodes I and J, respectively, of the joint element. ``Val3`` through ``Val6`` are not + used. + + If ``Kywrd`` = RDOF, ``Val1`` through ``Val6`` are the relative degrees of freedom to be fixed for a + general joint element. Input 1 for UX, 2 for UY, 3 for UZ, 4 for ROTX, 5 for ROTY, and 6 for ROTZ. + You may input the DOFs in any order. + + If ``Kywrd`` = PITC, ``Val1`` is the pitch of the screw joint element; pitch is defined as the ratio + of relative axial displacement (length units) to relative rotation (in radians). ``Val2`` through + ``Val6`` are not used. + + If ``Kywrd`` = FRIC, ``Val1`` through ``Val3`` are defined as follows. + + * **For Revolute Joint:** + * ``Val1`` = outer radius + * ``Val2`` = inner radius + * ``Val3`` = effective length + * **For Translational Joint:** + * ``Val1`` = effective length + * ``Val2`` = effective radius + * **For Spherical Joint:** + * ``Val1`` = effective radius + + If ``Kywrd`` = PNLT, ``Val1`` and ``Val2`` are defined as follows, and ``Val3`` through ``Val6`` are not used. + + * ``Val1`` - Constraint type: + + * DISP - Displacement-based constraint + * ROT - Rotation-based constraint + + * ``Val2`` - Scaling factor (input a positive number) or penalty factor (input a negative number) used with the + penalty-based joint element formulation: + + * Positive number - the number is used as a scaling factor to scale the internally calculated + penalty values. + * Negative number - the absolute value of the number is used as the penalty factor in calculations. + + val3 : str + The meaning of ``Val1`` through ``Val6`` changes, depending on the value of ``Kywrd``. + + If ``Kywrd`` = LSYS (or blank), ``Val1`` and ``Val2`` are Identifiers of the local coordinate + systems at nodes I and J, respectively, of the joint element. ``Val3`` through ``Val6`` are not + used. + + If ``Kywrd`` = RDOF, ``Val1`` through ``Val6`` are the relative degrees of freedom to be fixed for a + general joint element. Input 1 for UX, 2 for UY, 3 for UZ, 4 for ROTX, 5 for ROTY, and 6 for ROTZ. + You may input the DOFs in any order. + + If ``Kywrd`` = PITC, ``Val1`` is the pitch of the screw joint element; pitch is defined as the ratio + of relative axial displacement (length units) to relative rotation (in radians). ``Val2`` through + ``Val6`` are not used. + + If ``Kywrd`` = FRIC, ``Val1`` through ``Val3`` are defined as follows. + + * **For Revolute Joint:** + * ``Val1`` = outer radius + * ``Val2`` = inner radius + * ``Val3`` = effective length + * **For Translational Joint:** + * ``Val1`` = effective length + * ``Val2`` = effective radius + * **For Spherical Joint:** + * ``Val1`` = effective radius + + If ``Kywrd`` = PNLT, ``Val1`` and ``Val2`` are defined as follows, and ``Val3`` through ``Val6`` are not used. + + * ``Val1`` - Constraint type: + + * DISP - Displacement-based constraint + * ROT - Rotation-based constraint + + * ``Val2`` - Scaling factor (input a positive number) or penalty factor (input a negative number) used with the + penalty-based joint element formulation: + + * Positive number - the number is used as a scaling factor to scale the internally calculated + penalty values. + * Negative number - the absolute value of the number is used as the penalty factor in calculations. + + val4 : str + The meaning of ``Val1`` through ``Val6`` changes, depending on the value of ``Kywrd``. + + If ``Kywrd`` = LSYS (or blank), ``Val1`` and ``Val2`` are Identifiers of the local coordinate + systems at nodes I and J, respectively, of the joint element. ``Val3`` through ``Val6`` are not + used. + + If ``Kywrd`` = RDOF, ``Val1`` through ``Val6`` are the relative degrees of freedom to be fixed for a + general joint element. Input 1 for UX, 2 for UY, 3 for UZ, 4 for ROTX, 5 for ROTY, and 6 for ROTZ. + You may input the DOFs in any order. + + If ``Kywrd`` = PITC, ``Val1`` is the pitch of the screw joint element; pitch is defined as the ratio + of relative axial displacement (length units) to relative rotation (in radians). ``Val2`` through + ``Val6`` are not used. + + If ``Kywrd`` = FRIC, ``Val1`` through ``Val3`` are defined as follows. + + * **For Revolute Joint:** + * ``Val1`` = outer radius + * ``Val2`` = inner radius + * ``Val3`` = effective length + * **For Translational Joint:** + * ``Val1`` = effective length + * ``Val2`` = effective radius + * **For Spherical Joint:** + * ``Val1`` = effective radius + + If ``Kywrd`` = PNLT, ``Val1`` and ``Val2`` are defined as follows, and ``Val3`` through ``Val6`` are not used. + + * ``Val1`` - Constraint type: + + * DISP - Displacement-based constraint + * ROT - Rotation-based constraint + + * ``Val2`` - Scaling factor (input a positive number) or penalty factor (input a negative number) used with the + penalty-based joint element formulation: + + * Positive number - the number is used as a scaling factor to scale the internally calculated + penalty values. + * Negative number - the absolute value of the number is used as the penalty factor in calculations. + + val5 : str + The meaning of ``Val1`` through ``Val6`` changes, depending on the value of ``Kywrd``. + + If ``Kywrd`` = LSYS (or blank), ``Val1`` and ``Val2`` are Identifiers of the local coordinate + systems at nodes I and J, respectively, of the joint element. ``Val3`` through ``Val6`` are not + used. + + If ``Kywrd`` = RDOF, ``Val1`` through ``Val6`` are the relative degrees of freedom to be fixed for a + general joint element. Input 1 for UX, 2 for UY, 3 for UZ, 4 for ROTX, 5 for ROTY, and 6 for ROTZ. + You may input the DOFs in any order. + + If ``Kywrd`` = PITC, ``Val1`` is the pitch of the screw joint element; pitch is defined as the ratio + of relative axial displacement (length units) to relative rotation (in radians). ``Val2`` through + ``Val6`` are not used. + + If ``Kywrd`` = FRIC, ``Val1`` through ``Val3`` are defined as follows. + + * **For Revolute Joint:** + * ``Val1`` = outer radius + * ``Val2`` = inner radius + * ``Val3`` = effective length + * **For Translational Joint:** + * ``Val1`` = effective length + * ``Val2`` = effective radius + * **For Spherical Joint:** + * ``Val1`` = effective radius + + If ``Kywrd`` = PNLT, ``Val1`` and ``Val2`` are defined as follows, and ``Val3`` through ``Val6`` are not used. + + * ``Val1`` - Constraint type: + + * DISP - Displacement-based constraint + * ROT - Rotation-based constraint + + * ``Val2`` - Scaling factor (input a positive number) or penalty factor (input a negative number) used with the + penalty-based joint element formulation: + + * Positive number - the number is used as a scaling factor to scale the internally calculated + penalty values. + * Negative number - the absolute value of the number is used as the penalty factor in calculations. + + val6 : str + The meaning of ``Val1`` through ``Val6`` changes, depending on the value of ``Kywrd``. + + If ``Kywrd`` = LSYS (or blank), ``Val1`` and ``Val2`` are Identifiers of the local coordinate + systems at nodes I and J, respectively, of the joint element. ``Val3`` through ``Val6`` are not + used. + + If ``Kywrd`` = RDOF, ``Val1`` through ``Val6`` are the relative degrees of freedom to be fixed for a + general joint element. Input 1 for UX, 2 for UY, 3 for UZ, 4 for ROTX, 5 for ROTY, and 6 for ROTZ. + You may input the DOFs in any order. + + If ``Kywrd`` = PITC, ``Val1`` is the pitch of the screw joint element; pitch is defined as the ratio + of relative axial displacement (length units) to relative rotation (in radians). ``Val2`` through + ``Val6`` are not used. + + If ``Kywrd`` = FRIC, ``Val1`` through ``Val3`` are defined as follows. + + * **For Revolute Joint:** + * ``Val1`` = outer radius + * ``Val2`` = inner radius + * ``Val3`` = effective length + * **For Translational Joint:** + * ``Val1`` = effective length + * ``Val2`` = effective radius + * **For Spherical Joint:** + * ``Val1`` = effective radius + + If ``Kywrd`` = PNLT, ``Val1`` and ``Val2`` are defined as follows, and ``Val3`` through ``Val6`` are not used. + + * ``Val1`` - Constraint type: + + * DISP - Displacement-based constraint + * ROT - Rotation-based constraint + + * ``Val2`` - Scaling factor (input a positive number) or penalty factor (input a negative number) used with the + penalty-based joint element formulation: + + * Positive number - the number is used as a scaling factor to scale the internally calculated + penalty values. + * Negative number - the absolute value of the number is used as the penalty factor in calculations. + + Notes + ----- + + .. _SECJOINT_notes: + + Use this command to define additional section data for ``MPC184`` joint elements. To overwrite the + current values, issue another :ref:`secjoint` command with the same ``Kywrd`` value. The data input + on this command is interpreted based on the most recently issued :ref:`sectype` command. + + The command :ref:`secjoint`,PNLT is only applicable to penalty-based joints (KEYOPT(2) = 1 on most + joint elements). The default penalty factor (common to all constraints of the joint element) is of + the order of 10\2E:sub:`avg`, where E:sub:`avg` is the average Young``s modulus of the elements + attached to the joint element or deduced from the connections to other elements. The default value + may be overridden by specifying user-defined penalty factors via :ref:`secjoint`,PNLT. The choice of + penalty factors can affect the constraint satisfaction as well as overall solution convergence. + """ + command = f"SECJOINT,{kywrd},{val1},{val2},{val3},{val4},{val5},{val6}" + return self.run(command, **kwargs) + + def seclib(self, option: str = "", path: str = "", **kwargs): + r"""Sets the default section library path for the :ref:`secread` command. + + Mechanical APDL Command: `/SECLIB `_ + + Parameters + ---------- + option : str + + * ``READ`` - Sets the read path (default). + + * ``STATUS`` - Reports the current section library path setting to the :file:`Jobname.LOG` file. + + path : str + Defines the directory path from which to read section library files. + + Notes + ----- + + .. _s-SECLIB_notes: + + When the :ref:`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 :ref:`seclib` command + + """ + command = f"/SECLIB,{option},{path}" + return self.run(command, **kwargs) + + def seclock( + self, + dof0: str = "", + minvalue0: str = "", + maxvalue0: str = "", + dof1: str = "", + minvalue1: str = "", + maxvalue1: str = "", + dof2: str = "", + minvalue2: str = "", + maxvalue2: str = "", + addional_command_arg: str = "", + **kwargs, + ): + r"""Specifies locks on the components of relative motion in a joint element. + + Mechanical APDL Command: `SECLOCK `_ + + Parameters + ---------- + dof0 : str + The description of the argument is missing in the Python function. Please, refer to the `command + documentation + `_ for + further information. + + minvalue0 : str + The description of the argument is missing in the Python function. Please, refer to the `command + documentation + `_ for + further information. + + maxvalue0 : str + The description of the argument is missing in the Python function. Please, refer to the `command + documentation + `_ for + further information. + + dof1 : str + The description of the argument is missing in the Python function. Please, refer to the `command + documentation + `_ for + further information. + + minvalue1 : str + The description of the argument is missing in the Python function. Please, refer to the `command + documentation + `_ for + further information. + + maxvalue1 : str + The description of the argument is missing in the Python function. Please, refer to the `command + documentation + `_ for + further information. + + dof2 : str + The description of the argument is missing in the Python function. Please, refer to the `command + documentation + `_ for + further information. + + minvalue2 : str + The description of the argument is missing in the Python function. Please, refer to the `command + documentation + `_ for + further information. + + maxvalue2 : str + The description of the argument is missing in the Python function. Please, refer to the `command + documentation + `_ for + further information. + + addional_command_arg : str + Additional arguments can be passed to the initial command. Please, refer to the `command + documentation + `_ for + further information. + + Notes + ----- + + .. _SECLOCK_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,{dof0},{minvalue0},{maxvalue0},{dof1},{minvalue1},{maxvalue1},{dof2},{minvalue2},{maxvalue2},{addional_command_arg}" + return self.run(command, **kwargs) + + def secmodif( + self, secid: str = "", kywrd: str = "", addional_command_arg: str = "", **kwargs + ): + r"""Modifies a pretension section + + Mechanical APDL Command: `SECMODIF `_ + + Parameters + ---------- + secid : str + Unique section number. This number must already be assigned to a section. + + kywrd : str + The description of the argument is missing in the Python function. Please, refer to the `command + documentation + `_ for + further information. + + addional_command_arg : str + Additional arguments can be passed to the initial command. 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. + + .. _SECMODIF_notes: + + The :ref:`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},{addional_command_arg}" + return self.run(command, **kwargs) + + def secnum(self, secid: str = "", **kwargs): + r"""Sets the element section attribute pointer. + + Mechanical APDL Command: `SECNUM `_ + + Parameters + ---------- + secid : str + Defines the section ID number to be assigned to the subsequently-defined elements. Defaults to + 1. See :ref:`sectype` for more information about the section ID number. + """ + command = f"SECNUM,{secid}" + return self.run(command, **kwargs) + + def secoffset( + self, + location: str = "", + offset1: str = "", + offset2: str = "", + cg_y: str = "", + cg_z: str = "", + sh_y: str = "", + sh_z: str = "", + **kwargs, + ): + r"""Defines the section offset for cross sections. + + Mechanical APDL Command: `SECOFFSET `_ + + Parameters + ---------- + location : str + The location of the nodes in the section. All are dependent on the type. See the + :ref:`SECOFFSET_notes` section for information about the values for the various section types. + + offset1 : str + The location of the nodes in the section. All are dependent on the type. See the + :ref:`SECOFFSET_notes` section for information about the values for the various section types. + + offset2 : str + The location of the nodes in the section. All are dependent on the type. See the + :ref:`SECOFFSET_notes` section for information about the values for the various section types. + + cg_y : str + The location of the nodes in the section. All are dependent on the type. See the + :ref:`SECOFFSET_notes` section for information about the values for the various section types. + + cg_z : str + The location of the nodes in the section. All are dependent on the type. See the + :ref:`SECOFFSET_notes` section for information about the values for the various section types. + + sh_y : str + The location of the nodes in the section. All are dependent on the type. See the + :ref:`SECOFFSET_notes` section for information about the values for the various section types. + + sh_z : str + The location of the nodes in the section. All are dependent on the type. See the + :ref:`SECOFFSET_notes` section for information about the values for the various section types. + + Notes + ----- + + .. _SECOFFSET_notes: + + The :ref:`secoffset` command is divided into four types: `Beams + `_ + Beams, :ref:`Pipes, ` :ref:`Shells, and ` :ref:`Preintegrated + General Shells. ` + + The offsets defined by the :ref:`secoffset` command are associated with the section most recently + defined using the :ref:`sectype` command. Not all :ref:`secoffset` location values are valid for + each subtype. + + For the thermal shell elements, ``SHELL131`` and ``SHELL132``, the node offset specified by + :ref:`secoffset` is used in thermal contact analyses. Otherwise, the :ref:`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``. + + For beam elements ``BEAM188`` / ``BEAM189`` and pipe elements ``PIPE288`` / ``PIPE289`` in the XY + plane, an offset is not allowed if it causes the elements to be nonsymmetric about the XY plane. + + **Beams** + + .. _SECOFFSET_beams: + + Type: BEAM + ^^^^^^^^^^ + + Argument data to provide: + + ``Location``, ``OFFSETY``, ``OFFSETZ``, ``CG-Y``, ``CG-Z``, ``SH-Y``, ``SH-Z`` + + * ``Location`` - + + * ``CENT`` - Beam node will be offset to centroid (default). + + * ``SHRC`` - Beam node will be offset to shear center. + + * ``ORIGIN`` - Beam node will be offset to origin of the cross section. + + * ``USER`` - Beam node will be offset to the location specified by ``OFFSETY`` and ``OFFSETZ``. + + * ``OFFSETY, OFFSETZ`` - Values that locate the node with respect to the default origin of the + cross section when the ``Location`` argument is set to USER. Valid only when USER is set. + + The following figure illustrates the offsets for a channel cross section, and shows the relative + locations of SHRC and CENT. + + .. figure::../../../images/_commands/gSECO1.svg + + Offsets for a CHAN Section Subtype + + * ``CG-Y, CG-Z, SH-Y, SH-Z`` - Override the program-calculated centroid and shear centroid + locations. + + This option should only be used by advanced users modeling composite cross sections. + + **Pipes** + + .. _SECOFFSET_pipes: + + Type: PIPE + ^^^^^^^^^^ + + Argument data to provide: + + ``OFFSETY``, ``OFFSETZ`` + + * ``OFFSETY, OFFSETZ`` - Values that locate the node with respect to the center of the pipe. + + **Shells** + + .. _SECOFFSET_shells: + + Type: SHELL + ^^^^^^^^^^^ + + Argument data to provide: + + ``Location``, ``OFFSET`` + + * ``Location`` - + + * ``TOP`` - Shell node will be offset to top of the section. + + * ``MID`` - Shell node will be offset to midplane of the section (default). + + * ``BOT`` - Shell node will be offset to bottom of the section. + + * ``USER`` - Shell node will be offset to the location specified by ``OFFSET``. + + * ``OFFSET`` - Value that locates the node with respect to the default origin (midplane) of the + section. Valid only when ``Location`` = USER. + + The offset alters only the reference surface of the shell elements (that is, where the nodes are + located). It does not change the physical dimensions of the shell itself; the volume and mass remain + constant when an offset is specified. + + **Preintegrated General Shells** + + .. _SECOFFSET_preintshells: + + Type: GENS + ^^^^^^^^^^ + + Argument data to provide: + + ``Location``, ``OFFSET`` + + * ``Location`` - + + * ``MID`` - Shell node will be offset to midplane of the section (default). + + * ``USER`` - Shell node will be offset to the location specified by ``OFFSET``. + + * ``OFFSET`` - Value that locates the node with respect to the default origin (midplane) of the + section. Valid only when ``Location`` = USER. + + The offset alters only the reference surface of the shell elements (that is, where the nodes are + located). + """ + command = ( + f"SECOFFSET,{location},{offset1},{offset2},{cg_y},{cg_z},{sh_y},{sh_z}" + ) + return self.run(command, **kwargs) + + def secplot( + self, secid: str = "", val1: str = "", val2: str = "", val3: str = "", **kwargs + ): + r"""Plots the geometry of a beam, pipe, shell, or reinforcing section to scale. + + Mechanical APDL Command: `SECPLOT `_ + + Parameters + ---------- + secid : str + The section ID number (as defined via the :ref:`sectype` command). + + val1 : str + Values that control the information to be plotted. See the :ref:`SECPLOT_notes` section of this + command description for more information. For clarity, the labels ``VAL1``, ``VAL2``, and + ``VAL3`` are renamed according to the section type. + + val2 : str + Values that control the information to be plotted. See the :ref:`SECPLOT_notes` section of this + command description for more information. For clarity, the labels ``VAL1``, ``VAL2``, and + ``VAL3`` are renamed according to the section type. + + val3 : str + Values that control the information to be plotted. See the :ref:`SECPLOT_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 + ----- + + .. _SECPLOT_notes: + + :ref:`secplot` is valid for :ref:`SECPLOT_beams`, :ref:`SECPLOT_shells`, and :ref:`SECPLOT_reinf` + only. The command is not valid for ``ELBOW290``. + + :ref:`secplot` cannot display the plot of an ASEC (arbitrary section) subtype. + + .. _SECPLOT_beams: + + Plots the geometry of the beam or pipe section to scale depicting the centroid, shear center, and + origin. :ref:`secplot` also lists various section properties such as ``Iyy``, ``Iyz``, and ``Izz``. + + Data to be supplied in the value fields: + + * ``MESHKEY`` - Beam or pipe section mesh display options: + + * ``0`` - Display section outline only. + + * ``1`` - Display beam or pipe section mesh. + + * ``2`` - Display the section mesh with node numbers. + + * ``3`` - Display the section mesh with cell numbers. + + * ``4`` - Display the section mesh with material numbers and colors. + + * ``5`` - Display the section mesh with material colors only. + + * ``6`` - 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. + + * ``7`` - 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: + + .. figure::../../../images/_commands/gSECP1.jpg + + .. _SECPLOT_shells: + + Plots the layer arrangement of the shell section showing the layer material and orientation. + + Data to be supplied in the value fields: + + * ``LAYR1, LAYR2`` - 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: + + .. figure::../../../images/_commands/gsecplotshell.jpg + + .. _SECPLOT_reinf: + + Plots the arrangement of a :ref:`reinforcing section within the base element. + ` + + Data to be supplied in the value fields: + + * ``REINF1, REINF2, OVERLAY`` - ``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, the program displays the reinforcing section only. + + Following is a sample section plot for the reinforcing section type: + + .. figure::../../../images/_commands/gSECP.fig.3.jpg + + For more information about reinforcing, see the documentation for the :ref:`secdata` command, and + the ``REINF264`` and ``REINF265`` elements. + """ + command = f"SECPLOT,{secid},{val1},{val2},{val3}" + return self.run(command, **kwargs) + + def secread(self, fname: str = "", ext: str = "", option: str = "", **kwargs): + r"""Reads a custom section library or a user-defined section mesh into Mechanical APDL. + + Mechanical APDL Command: `SECREAD `_ + + Parameters + ---------- + fname : str + 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. + + When the :ref:`secread` command is given 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 :ref:`seclib` command + + The file name defaults to :file:`Jobname` if ``Fname`` is left blank. + + ext : str + Filename extension (eight-character maximum). The extension defaults to SECT if ``Ext`` is left + blank. + + option : str + + * ``LIBRARY`` - Reads in a library of sections and their associated section data values; the + default. A section library may be created by editing the section-defining portions of the + :file:`Jobname.LOG` file and saving it with a :file:`.SECT` suffix. + + * ``MESH`` - Reads in a user mesh section file containing the cell connectivity, cell flags, and + nodal coordinates for the current beam section of subtype MESH as defined by :ref:`sectype`. See the + :ref:`SECREAD_notes` section of this command description for details about user mesh section files. + :ref:`secwrite` builds mesh files based on 2D models you create. + + Notes + ----- + + .. _SECREAD_notes: + + The :ref:`secread` command operates on the section specified via the most recently issued + **SECTYPE** command. Issue a separate :ref:`secread` command for each section ID that you want to + read in. + + .. _SECREAD_extranote1: + + 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. + + This command contains some tables and extra information which can be inspected in the original + documentation pointed above. + + 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 :ref:`secread_fig_2`. + + **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 :ref:`secread_fig_1` ). Since all node boundary + flags are 0, :ref:`secread` ignores them when it reads a cell mesh file into Mechanical APDL. + + 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. + + .. figure::../../../images/_commands/gSECR2.svg + + Two-hole Box Section + + .. figure::../../../images/_commands/gSECR3.svg + + Cell Mesh for the Two-hole Box Section + """ + command = f"SECREAD,{fname},{ext},,{option}" + return self.run(command, **kwargs) + + def secstop( + self, + dof0: str = "", + minvalue0: str = "", + maxvalue0: str = "", + dof1: str = "", + minvalue1: str = "", + maxvalue1: str = "", + dof2: str = "", + minvalue2: str = "", + maxvalue2: str = "", + addional_command_arg: str = "", + **kwargs, + ): + r"""Specifies stops on the components of relative motion in a joint element. + + Mechanical APDL Command: `SECSTOP `_ + + Parameters + ---------- + dof0 : str + The description of the argument is missing in the Python function. Please, refer to the `command + documentation + `_ for + further information. + + minvalue0 : str + The description of the argument is missing in the Python function. Please, refer to the `command + documentation + `_ for + further information. + + maxvalue0 : str + The description of the argument is missing in the Python function. Please, refer to the `command + documentation + `_ for + further information. + + dof1 : str + The description of the argument is missing in the Python function. Please, refer to the `command + documentation + `_ for + further information. + + minvalue1 : str + The description of the argument is missing in the Python function. Please, refer to the `command + documentation + `_ for + further information. + + maxvalue1 : str + The description of the argument is missing in the Python function. Please, refer to the `command + documentation + `_ for + further information. + + dof2 : str + The description of the argument is missing in the Python function. Please, refer to the `command + documentation + `_ for + further information. + + minvalue2 : str + The description of the argument is missing in the Python function. Please, refer to the `command + documentation + `_ for + further information. + + maxvalue2 : str + The description of the argument is missing in the Python function. Please, refer to the `command + documentation + `_ for + further information. + + addional_command_arg : str + Additional arguments can be passed to the initial command. Please, refer to the `command + documentation + `_ for + further information. + + Notes + ----- + + .. _SECSTOP_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,{dof0},{minvalue0},{maxvalue0},{dof1},{minvalue1},{maxvalue1},{dof2},{minvalue2},{maxvalue2},{addional_command_arg}" + return self.run(command, **kwargs) + + def sectype( + self, + secid: str = "", + type_: str = "", + subtype: str = "", + name: str = "", + refinekey: str = "", + **kwargs, + ): + r"""Associates section type information with a section ID number. + + Mechanical APDL Command: `SECTYPE `_ + + Parameters + ---------- + secid : str + Section identification number. If ``SECID`` is blank or zero, the ``SECID`` number is + incremented by one from the highest section ID number currently defined in the database. (See + `Notes + `_ + Notes for ``SECID`` input specific to general contact.) + + type_ : str + + * ``AXIS`` - Define the axis for a general axisymmetric section. + + * ``BEAM`` - Defines a beam section. This option has a ``Subtype``. + + * ``COMB`` - Defines a composite (temperature-dependent) beam section. This option has a + ``Subtype``. + + * ``CONTACT`` - Defines a contact section. This option has a ``Subtype``. + + * ``GENB`` - Defines a nonlinear general (temperature-dependent) beam section. This option has a + ``Subtype``. + + * ``GENS`` - Defines a preintegrated general (temperature-dependent) shell section. + + * ``JOINT`` - Defines a joint section. This option has a ``Subtype``. + + * ``LINK`` - Defines a link section. + + * ``PIPE`` - Defines a pipe section. + + * ``PRETENSION`` - Defines a pretension section. + + * ``REINF`` - Defines a reinforcing section. This option has a ``Subtype``. + + * ``SHELL`` - Defines a shell section. + + * ``SUPPORT`` - Additive manufacturing support. This option has a ``Subtype``. + + * ``TAPER`` - Defines a tapered beam or pipe section. The sections at the end points must be + topologically identical. + + subtype : str + When ``Type`` = BEAM, the possible beam sections that can be defined for ``Subtype`` are: This + command contains some tables and extra information which can be inspected in the original + documentation pointed above. + + The following figure shows the shape of each cross section subtype: + + .. figure::../../../images/_commands/gSECT1.svg + + When ``Type`` = COMB, the only possible `composite-beam section + `_ + that can be defined for ``Subtype`` is: This command contains some tables and extra information + which can be inspected in the original documentation pointed above. + + When ``Type`` = CONTACT, the possible contact sections that can be defined for ``Subtype`` are: + This command contains some tables and extra information which can be inspected in the original + documentation pointed above. + + When ``Type`` = GENB, the possible `nonlinear general beam sections + `_ + that can be defined for ``Subtype`` are: This command contains some tables and extra + information which can be inspected in the original documentation pointed above. + + When ``Type`` = JOINT, the possible joint sections that can be defined for ``Subtype`` are: + This command contains some tables and extra information which can be inspected in the original + documentation pointed above. + + When ``Type`` = REINF, the possible reinforcing sections that can be defined for ``Subtype`` + are: This command contains some tables and extra information which can be inspected in the + original documentation pointed above. + + When ``Type`` = SUPPORT, the possible support sections that can be defined for ``Subtype`` are: + This command contains some tables and extra information which can be inspected in the original + documentation pointed above. + + name : str + 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 : str + 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_notes: + + :ref:`sectype` sets the section ID number, section type, and subtype for a section. A previously- + defined section with the same identification number will be redefined. The geometry data describing + this section type is defined by a subsequent :ref:`secdata` command. Define the offsets (if + applicable) by a subsequent :ref:`secoffset` command. The :ref:`slist` command lists the section + properties, and the :ref:`secplot` command displays the section to scale. The :ref:`secnum` command + assigns the section ID number to any subsequently-defined elements. + + When defining a section for contact elements ( ``Type`` = CONTACT) that are used in a `general + contact `_ + definition, a section number representing a general contact surface can be specified. Alternatively, + you may define a subset of a region by inputting a valid label for ``SECID`` (ALL_EDGE, ALL_FACE, + ALL_VERT, ALL_TOP,or ALL_BOT), or by inputting a node component name with or without a component + name extension (_EDGE, _FACE, _VERT, _TOP, or _BOT). For more information, see in the `Contact + Technology Guide + `_. + + For a beam section ( ``Type`` = BEAM), a subsequent :ref:`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: :ref:`bsax`, :ref:`bsm1`, :ref:`bsm2`, :ref:`bstq`, :ref:`bss1`, + :ref:`bss2`, :ref:`bsmd`, and :ref:`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: :ref:`cbtmp`, :ref:`cbmx`, :ref:`cbmd`, and :ref:`cbte` are available. All other + section commands are ignored for this section type. + + For a `tapered beam or pipe section + `_ ( ``Type`` = + TAPER), two subsequent :ref:`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. + + For a `preintegrated general shell section + `_ + ( ``Type`` = GENS), the ``Subtype`` and ``REFINEKEY`` options do not apply. Subsequent commands are + necessary to define the section: :ref:`sspa`, :ref:`sspb`, :ref:`sspd`, :ref:`sspe`, :ref:`ssmt`, + :ref:`ssbt`, and :ref:`sspm` are available. All other section commands are ignored for this section + type. + + The PRETENSION section options of the :ref:`sectype` and :ref:`secdata` commands are documented + primarily to aid your understanding of the data written by the :ref:`cdwrite` command. + Ansys, Inc. recommends that you generate pretension sections via the :ref:`psmesh` command. + + For a reinforcing section ( ``Type`` = REINF), each subsequent :ref:`secdata` command defines the + material, geometry, and orientation of one discrete reinforcing fiber ( ``Subtype`` = DISC) or one + smeared reinforcing surface ( ``Subtype`` = SMEAR). When referenced by a ``MESH200`` element, only + one :ref:`secdata` command is valid. + + A subsequent :ref:`secdata` command defines the geometry data describing this section type. + + To display elements with shapes determined from the section definition, issue the :ref:`eshape` + command. + + .. _SECTYPE_prodres: + + Ansys Mechanical Pro :ref:`sectype`,COMB is not valid. + """ + command = f"SECTYPE,{secid},{type_},{subtype},{name},{refinekey}" + return self.run(command, **kwargs) + + def secwrite(self, fname: str = "", ext: str = "", elem_type: str = "", **kwargs): + r"""Creates an ASCII file containing user mesh section information. + + Mechanical APDL Command: `SECWRITE `_ + + 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` if + ``Fname`` is left blank. + + ext : str + Filename extension (eight-character maximum). The extension defaults to SECT if ``Ext`` is left + blank. + + elem_type : str + Element type attribute pointer ( :ref:`et` ) for the elements that are part of the section. See + :ref:`secread` for a detailed description. + + Notes + ----- + + .. _SECWRITE_notes: + + Before creating a user mesh file, first create a model using 2D meshing. Use ``PLANE183`` or + ``MESH200`` with KEYOPT(1) = 7 (quadrilateral with 8 nodes option) to model the cells. + :ref:`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 + `_. + """ + command = f"SECWRITE,{fname},{ext},,{elem_type}" + return self.run(command, **kwargs) + + def sflex( + self, + ffax: str = "", + ffby: str = "", + ffbz: str = "", + ffto: str = "", + fftsy: str = "", + fftsz: str = "", + **kwargs, + ): + r"""Sets flexibility factors for the currently defined pipe element section. + + Mechanical APDL Command: `SFLEX `_ + + Parameters + ---------- + ffax : str + Factor to increase axial flexibility. The default value is 1.0. + + ffby : str + Factor to increase bending flexibility about element y axis (bending in the element x-z plane). + The default value is 1.0. + + ffbz : str + Factor to increase bending flexibility about element z axis (bending in the element x-y plane). + The default value is ``FFBY``. + + ffto : str + Factor to increase torsional flexibility. The default value is 1.0. + + fftsy : str + Factor to increase transverse shear flexibility in the element x-z plane. The default value is + 1.0. + + fftsz : str + Factor to increase transverse shear flexibility in the element x-y plane. The default value is + ``FFTSY``. + + Notes + ----- + + .. _SFLEX_notes: + + The :ref:`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 :ref:`sflex` command applies to the pipe section most recently defined via the + :ref:`sectype` command. + + :ref:`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: str = "", + slast: str = "", + sinc: str = "", + details: str = "", + type_: str = "", + **kwargs, + ): + r"""Summarizes the section properties for all defined sections in the current session. + + Mechanical APDL Command: `SLIST `_ + + Parameters + ---------- + sfirst : str + First section ID to be summarized. Default = First available section in the database. + + slast : str + Last section ID to be summarized. Default = Last available section in the database. + + sinc : str + Increment of the section ID. Default = 1. + + details : str + Determines the content of the summarized information for beam, pipe, shell, and reinforcing + sections. + + * ``BRIEF`` - For beams, lists only the section integrated properties (such as Area, Iyy, and Iyz ). + This option is the default. + + For `reinforcing + `_, + lists only the input reinforcing properties (such as material, cross-section area, fiber spacing, + and input fiber location parameters). + + * ``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 program + accounts for section offsets during the solution phase of the analysis. + + For predefined reinforcing sections used by the standard method, lists the complete information of + reinforcing fibers or surfaces (including material ID, cross-section area, fiber spacing, + orientation, and locations in natural coordinates). For predefined section reinforcing used by the + mesh-independent method, lists section properties to generate the fibers or surfaces (including + material ID, cross-section area, fiber spacing, and orientation) For reinforcing sections generated + ( :ref:`ereinf` ) via the mesh-independent method, lists element ID, material ID, and locations in + natural coordinates. + + * ``GROUP`` - If a section calls other sections, this option lists those sections too. + + type_ : str + The section type. Valid arguments are ALL (default) or any valid section type ( :ref:`sectype` + ). + + Notes + ----- + + .. _SLIST_notes: + + By default, the command lists information about all sections. You can limit the output to specific + section types via the ``Type`` key. + + When ocean loading is present, the command lists beam section properties used by ocean loading. + + .. _SLIST_extranote1: + + Following is example output from the :ref:`slist`,,,,BRIEF command for a rectangular beam section + subtype ( :ref:`sectype`,,BEAM,RECT): + + .. code:: apdl + + LIST SECTION ID SETS 1 TO 1 BY 1 + + SECTION ID NUMBER: 1 + BEAM SECTION TYPE: Rectangle + BEAM SECTION NAME IS: + BEAM SECTION DATA SUMMARY: + Area = 6.0000 + Iyy = 4.5000 + Iyz = 0.11281E-15 + Izz = 2.0000 + Warping Constant = 0.23299 + Torsion Constant = 4.7330 + Center of Gravity Y =-0.30973E-16 + Center of Gravity Z = 0.15376E-15 + Shear Center Y =-0.22957E-13 + Shear Center Z = 0.31281E-13 + + Beam Section is offset to CENTROID of cross section + """ + command = f"SLIST,{sfirst},{slast},{sinc},{details},{type_}" + return self.run(command, **kwargs) + + def sload( + self, + secid: str = "", + plnlab: str = "", + kinit: str = "", + kfd: str = "", + fdvalue: str = "", + lsload: str = "", + lslock: str = "", + **kwargs, + ): + r"""Loads a pretension section. + + Mechanical APDL Command: `SLOAD `_ + + **Command default:** + + .. _SLOAD_default: + + The default pretension load value ``FDVALUE`` is zero (no load). A positive value puts the + pretension elements in tension. + + No default exists for the ``LSLOAD`` applied load step value. You must specify the load step in + which to apply the ``FDVALUE``. + + No default exists for the ``LSLOCK`` locked load step value. You must specify the load step in which + to lock the ``FDVALUE``. + + Parameters + ---------- + secid : str + Unique section number. The number must already be assigned to a pretension section. + + plnlab : str + Label representing the pretension load sequence number in the format "PL ``nn`` " where ``nn`` + is an integer from 1 through 99 (for example, PL01 through PL99). + + Specify a value of DELETE to delete all loads on the specified pretension section ( ``SECID`` ). + In this case, the command ignores any other argument values. + + kinit : str + 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 : str + 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 : str + Pretension load value. If ``KFD`` = FORC, this value is a pretension force. If ``KFD`` = DISP, + this value is a pretension displacement (adjustment). + + lsload : str + Load step in which to apply the ``FDVALUE``. + + lslock : str + The load step in which the displacement value resulting from the pretension force is locked. + This value is valid only if ``KFD`` = FORC. + + Notes + ----- + + .. _SLOAD_notes: + + The :ref:`sload` command applies pretension loads to specified pretension sections ( ``PRETS179`` + -based) created via the :ref:`psmesh` command. A pretension load is ramp-applied ( :ref:`kbc` = 0) + if it is a force ( ``KFD`` = FORC), and step-applied ( :ref:`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 the program 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 :ref:`sload` command is not valid for ``MPC184`` -based preload sections created with + :ref:`psmesh`. + + **Example: Applying a Load** + + The following command shows how to establish loads on a pretension section: + + .. code:: apdl + + SLOAD,1,PL01,TINY,FORC,5000,2,3 + + In this example, the load is applied to pretension section + + .. code:: apdl + + 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. + + **Example: Editing an Existing Load** + + You can use the :ref:`sload` command to edit (overwrite) existing loads on a pretension section. + This example changes the load on pretension section 1 (set above) to 6000: + + .. code:: apdl + + 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. + + **Example: Deleting All Loads** + + The command can also delete all loads on a specified pretension section, as shown here: + + .. code:: apdl + + SLOAD,1,DELETE + + **Example: Locking a Pretension Element** + + For a prestressed modal analysis, this command locks the pretension element: + + .. code:: apdl + + SLOAD,1,PL01,LOCK,DISP,0,1,2 + + **Multiple Loadings** + The :ref:`sload` command allows you to apply multiple loadings. You can add up to 15 loadings (PL01 + through PL15), or delete loadings, for any given pretension section(s). + + **Example: Applying Multiple Loadings** + + The following :ref:`sload` commands, issued in the order shown, establish a pretension load sequence + in pretension section 2 with a force of 25 in load step (LS) 2, locked in LS 3-6, a force of 50 in + LS 7, locked in LS 8-11, a force of 75 in LS 12, locked in LS 13 and beyond: + + .. code:: apdl + + SLOAD,2,PL01,LOCK,FORC,25,2,3 + + .. code:: apdl + + SLOAD,2,PL02,,FORC,50,7,8 + + .. code:: apdl + + SLOAD,2,PL03,,FORC,75,12,13 + + At the same time, you can issue SLOAD commands to apply loads on other pretension sections. For + example, in addition to the commands listed above, you could issue the following command to apply a + load on pretension section 3: + + .. code:: apdl + + SLOAD,3,PL01,LOCK,FORC,25,3,4 + + Any addition or deletion of a loading applies to the selected sections only. Mechanical APDL does + not apply + or delete a load until you click the Apply or OK button. + + After you have successfully solved for a specified ``LSLOAD`` (GUI field Apply at LS ) and + eventually ``LSLOCK`` (GUI field Lock at LS ) value, you cannot modify that loading's settings + during subsequent steps of the analysis. Similarly, you cannot delete loadings that you have already + partially or completely solved. + + You can select more than one pretension section at a time in order to specify identical loadings on + them. Before you completely solve a given loading, any combination of pretension sections is valid. + The following limitations apply: + + * After you have completely solved one or more loadings, Mechanical APDL allows multiple selection + of only + those pretension sections having + + .. flat-table :: + + * -- the same number of defined loadings, and * -- the identical loading number from the most recent + + completely solved loading. + + * A multiple selection meeting the necessary criteria retains the settings that are identical for + all selected pretension sections and leaves all other fields blank. + """ + command = f"SLOAD,{secid},{plnlab},{kinit},{kfd},{fdvalue},{lsload},{lslock}" + return self.run(command, **kwargs) + + def ssbt( + self, bt11: str = "", bt22: str = "", bt12: str = "", t: str = "", **kwargs + ): + r"""Specifies preintegrated bending thermal effects for shell sections. + + Mechanical APDL Command: `SSBT `_ + + Parameters + ---------- + bt11 : str + Bending thermal effects component [ **B** :sup:`T` ]. + + bt22 : str + Bending thermal effects component [ **B** :sup:`T` ]. + + bt12 : str + Bending thermal effects component [ **B** :sup:`T` ]. + + t : str + Temperature. + + Notes + ----- + The behavior of shell elements is governed by the generalized-stress/generalized-strain relationship + of the `form + `_ + : + + .. math:: + + equation not available + + The :ref:`ssbt` command, one of several `preintegrated shell section commands + `_, + specifies the bending thermal effects quantity (submatrix [ **B** :sup:`T` ] data) for a + preintegrated shell section. The section data defined is associated with the section most recently + defined (via the :ref:`sectype` command). + + The [ **B** :sup:`T` ] 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 [ **B** :sup:`T` ] and [ **M** :sup:`T` ] quantities (by issuing the :ref:`ssbt` + and :ref:`ssmt` commands, respectively). + + Unspecified values default to zero. + + Related commands are :ref:`sspa`, :ref:`sspb`, :ref:`sspd`, :ref:`sspe`, :ref:`ssmt`, and + :ref:`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 `Creating a Preintegrated General Shell Section + `_ + """ + command = f"SSBT,{bt11},{bt22},{bt12},{t}" + return self.run(command, **kwargs) + + def ssmt( + self, mt11: str = "", mt22: str = "", mt12: str = "", t: str = "", **kwargs + ): + r"""Specifies preintegrated membrane thermal effects for shell sections. + + Mechanical APDL Command: `SSMT `_ + + Parameters + ---------- + mt11 : str + Membrane thermal effects component [ **M** :sup:`T` ]. + + mt22 : str + Membrane thermal effects component [ **M** :sup:`T` ]. + + mt12 : str + Membrane thermal effects component [ **M** :sup:`T` ]. + + t : str + Temperature. + + Notes + ----- + The behavior of shell elements is governed by the generalized-stress/generalized-strain relationship + of the `form + `_ + : + + .. math:: + + equation not available + + The :ref:`ssmt` command, one of several `preintegrated shell section commands + `_, + specifies the membrane thermal effects quantity (submatrix [ **M** :sup:`T` ] data) for a + preintegrated shell section. The section data defined is associated with the section most recently + defined (via the :ref:`sectype` command). + + The [ **M** :sup:`T` ] 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 [ **M** :sup:`T` ] and [ **B** :sup:`T` ] quantities (by issuing the :ref:`ssmt` + and :ref:`ssbt` commands, respectively). + + Unspecified values default to zero. + + Related commands are :ref:`sspa`, :ref:`sspb`, :ref:`sspd`, :ref:`sspe`, :ref:`ssbt`, and + :ref:`sspm`. + + For complete information, see `Creating a Preintegrated General Shell Section + `_ + """ + command = f"SSMT,{mt11},{mt22},{mt12},{t}" + return self.run(command, **kwargs) + + def sspa( + self, + a11: str = "", + a21: str = "", + a31: str = "", + a22: str = "", + a32: str = "", + a33: str = "", + t: str = "", + **kwargs, + ): + r"""Specifies a preintegrated membrane stiffness for shell sections. + + Mechanical APDL Command: `SSPA `_ + + Parameters + ---------- + a11 : str + Membrane stiffness component (symmetric lower part of submatrix [ **A** ]). + + a21 : str + Membrane stiffness component (symmetric lower part of submatrix [ **A** ]). + + a31 : str + Membrane stiffness component (symmetric lower part of submatrix [ **A** ]). + + a22 : str + Membrane stiffness component (symmetric lower part of submatrix [ **A** ]). + + a32 : str + Membrane stiffness component (symmetric lower part of submatrix [ **A** ]). + + a33 : str + Membrane stiffness component (symmetric lower part of submatrix [ **A** ]). + + t : str + Temperature. + + Notes + ----- + The behavior of shell elements is governed by the generalized-stress/generalized-strain relationship + of the `form + `_ + : + + .. math:: + + equation not available + + The :ref:`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 :ref:`sectype` command). + + Unspecified values default to zero. + + Related commands are :ref:`sspb`, :ref:`sspd`, :ref:`sspe`, :ref:`ssmt`, :ref:`ssbt`, and + :ref:`sspm`. + + For complete information, see `Creating a Preintegrated General Shell Section + `_ + """ + command = f"SSPA,{a11},{a21},{a31},{a22},{a32},{a33},{t}" + return self.run(command, **kwargs) + + def sspb( + self, + b11: str = "", + b21: str = "", + b31: str = "", + b22: str = "", + b32: str = "", + b33: str = "", + t: str = "", + b12: str = "", + b13: str = "", + b23: str = "", + **kwargs, + ): + r"""Specifies a preintegrated coupling stiffness for shell sections. + + Mechanical APDL Command: `SSPB `_ + + Parameters + ---------- + b11 : str + Coupling stiffness component (symmetric lower part of submatrix [ **B** ]). + + b21 : str + Coupling stiffness component (symmetric lower part of submatrix [ **B** ]). + + b31 : str + Coupling stiffness component (symmetric lower part of submatrix [ **B** ]). + + b22 : str + Coupling stiffness component (symmetric lower part of submatrix [ **B** ]). + + b32 : str + Coupling stiffness component (symmetric lower part of submatrix [ **B** ]). + + b33 : str + Coupling stiffness component (symmetric lower part of submatrix [ **B** ]). + + t : str + Temperature. + + b12 : str + Upper part of submatrix [ **B** ] + + b13 : str + Upper part of submatrix [ **B** ] + + b23 : str + Upper part of submatrix [ **B** ] + + Notes + ----- + The behavior of shell elements is governed by the generalized-stress/generalized-strain relationship + of the `form + `_ + : + + .. math:: + + equation not available + + If the coefficients ``B`` 12, ``B`` 13, ``B`` 23 are undefined, the program uses a symmetric form of + submatrix [ **B** ]. If any one of the coefficients ``B`` 12, ``B`` 13, ``B`` 23 is nonzero, the + program considers submatrix [ **B** ] to be unsymmetric. + + The :ref:`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 :ref:`sectype` command). + + Unspecified values default to zero. + + Related commands are :ref:`sspa`, :ref:`sspd`, :ref:`sspe`, :ref:`ssmt`, :ref:`ssbt`, and + :ref:`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 `Creating a Preintegrated General Shell Section + `_ + """ + command = f"SSPB,{b11},{b21},{b31},{b22},{b32},{b33},{t},{b12},{b13},{b23}" + return self.run(command, **kwargs) + + def sspd( + self, + d11: str = "", + d21: str = "", + d31: str = "", + d22: str = "", + d32: str = "", + d33: str = "", + t: str = "", + **kwargs, + ): + r"""Specifies a preintegrated bending stiffness for shell sections. + + Mechanical APDL Command: `SSPD `_ + + Parameters + ---------- + d11 : str + Bending stiffness component (symmetric lower part of submatrix [ **D** ]). + + d21 : str + Bending stiffness component (symmetric lower part of submatrix [ **D** ]). + + d31 : str + Bending stiffness component (symmetric lower part of submatrix [ **D** ]). + + d22 : str + Bending stiffness component (symmetric lower part of submatrix [ **D** ]). + + d32 : str + Bending stiffness component (symmetric lower part of submatrix [ **D** ]). + + d33 : str + Bending stiffness component (symmetric lower part of submatrix [ **D** ]). + + t : str + Temperature. + + Notes + ----- + The behavior of shell elements is governed by the generalized-stress/generalized-strain relationship + of the `form + `_ + : + + .. math:: + + equation not available + + The :ref:`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 :ref:`sectype` command). + + Unspecified commands default to zero. + + Related commands are :ref:`sspa`, :ref:`sspb`, :ref:`sspe`, :ref:`ssmt`, :ref:`ssbt`, and + :ref:`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 `Creating a Preintegrated General Shell Section + `_ + """ + command = f"SSPD,{d11},{d21},{d31},{d22},{d32},{d33},{t}" + return self.run(command, **kwargs) + + def sspe(self, e11: str = "", e21: str = "", e22: str = "", t: str = "", **kwargs): + r"""Specifies a preintegrated transverse shear stiffness for shell sections. + + Mechanical APDL Command: `SSPE `_ + + Parameters + ---------- + e11 : str + Transverse shear stiffness component (symmetric lower part of submatrix [ **E** ]). + + e21 : str + Transverse shear stiffness component (symmetric lower part of submatrix [ **E** ]). + + e22 : str + Transverse shear stiffness component (symmetric lower part of submatrix [ **E** ]). + + t : str + Temperature. + + Notes + ----- + The behavior of shell elements is governed by the generalized-stress/generalized-strain relationship + of the `form + `_ + : + + .. math:: + + equation not available + + The :ref:`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 :ref:`sectype` command). + + Unspecified values default to zero. + + Related commands are :ref:`sspa`, :ref:`sspb`, :ref:`sspd`, :ref:`ssmt`, :ref:`ssbt`, and + :ref:`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 `Creating a Preintegrated General Shell Section + `_ + . + """ + command = f"SSPE,{e11},{e21},{e22},{t}" + return self.run(command, **kwargs) + + def sspm(self, dens: str = "", t: str = "", **kwargs): + r"""Specifies mass density for a preintegrated shell section. + + Mechanical APDL Command: `SSPM `_ + + Parameters + ---------- + dens : str + + t : str + Temperature. + + Notes + ----- + The :ref:`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 :ref:`sectype` command). + + Related commands are :ref:`sspa`, :ref:`sspb`, :ref:`sspd`, :ref:`sspe`, :ref:`ssmt`, and + :ref:`ssbt`. + + For complete information, see `Creating a Preintegrated General Shell Section + `_ + """ + command = f"SSPM,{dens},{t}" + return self.run(command, **kwargs) diff --git a/src/ansys/mapdl/core/_commands/prep7/data_tables.py b/src/ansys/mapdl/core/_commands/prep7/data_tables.py new file mode 100644 index 00000000000..ddca04162e5 --- /dev/null +++ b/src/ansys/mapdl/core/_commands/prep7/data_tables.py @@ -0,0 +1,3632 @@ +# 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 DataTables: + + def cbtmp(self, temp: str = "", **kwargs): + r"""Specifies a temperature for composite-beam input. + + Mechanical APDL Command: `CBTMP `_ + + Parameters + ---------- + temp : str + Temperature value. + + Notes + ----- + The :ref:`cbtmp` command, one of several `composite beam-section commands + `_, + specifies a temperature to be associated with the data input via subsequent :ref:`cbmx` + (preintegrated cross-section stiffness), :ref:`cbmd` (preintegrated section mass), or :ref:`cbte` + (thermal-expansion) commands. + + The specified temperature remains active unt il the next :ref:`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 cgrow( + self, action: str = "", par1: str = "", par2: str = "", par3: str = "", **kwargs + ): + r"""Specifies crack-growth options in a fracture analysis. + + Mechanical APDL Command: `CGROW `_ + + Parameters + ---------- + action : str + Specifies the action for defining or manipulating crack-growth data: + + * `Command Specification for Action= NEW + `_ NEW - Initiate + a new set of crack-growth simulation data (default). + + * `Command Specification for Action= CID + `_ CID - Specify + the crack-calculation ( :ref:`cint` ) ID for energy-release rates to be used in the fracture + criterion calculation. + + * `Command Specification for Action= FCOPTION + `_ FCOPTION - + Specify the fracture criterion for crack-growth/delamination. + + * `Command Specification for Action= CSFL + `_ CSFL - Specify + a crack-surface load for crack-growth. + + * `Command Specification for Action= CPATH + `_ CPATH - Specify + the element component for crack-growth. + + * `Command Specification for Action= DTIME + `_ DTIME - Specify + the initial time step for crack-growth. + + * `Command Specification for Action= DTMIN + `_ DTMIN - Specify + the minimum time step for crack-growth. + + * `Command Specification for Action= DTMAX + `_ DTMAX - Specify + the maximum time step for crack-growth. + + * `Command Specification for Action= FCRAT + `_ FCRAT - + Fracture criterion ratio ( `fc + `_ + c ). + + * `Command Specification for Action= STOP + `_ STOP - Stops + the analysis when the specified criterion ( ``Par1`` ) is reached. + + * `Command Specification for Action= METHOD + `_ METHOD - Define + the method of crack propagation. + + * `Command Specification for Action= FCG + `_ FCG - Specifies + `fatigue crack-growth + `_. + + * `Command Specification for Action= SOPT + `_ SOPT - + Specifies the crack-growth solution option in a multicrack analysis. + + * `Command Specification for Action= RMCONT + `_ RMCONT - + Specifies remeshing control options for mesh coarsening. + + * `Command Specification for Action= NPLOAD + `_ NPLOAD - + Specifies `nonproportional loading + `_ control options + for fatigue crack-growth. + + 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. + + Other Parameters + ---------------- + **Command Specification for Action= NEW** + + .. _CGROW_NEW: + + * ``Par1`` - Crack-growth data set ID (integer value). + + **Command Specification for Action= CID** + + .. _CGROW_CID: + + * ``Par1`` - Contour-integral calculation ( :ref:`cint` ) ID for energy-release rates to be used in + fracture criterion calculation. + + **Command Specification for Action= FCOPTION** + + .. _CGROW_FCOPTION: + + * ``Par1`` - **MTAB** - Crack-growth fracture criterion used with the material data table ( + :ref:`tb`, `CGCR -- Crack-Growth Fracture Criterion + `_ + CGCR). + + **GTC** - Defines the critical energy-release rate, a simple fracture criterion used for the `VCCT `_ method. + + **KIC** - Defines the `critical stress-intensity factor `_. Valid for the `SMART `_ method only. + + **JIC** - Defines the `critical J-integral `_. Valid for the `SMART `_ method only. + + * ``Par2`` - For ``Par1`` = MTAB: Material ID for the material data table. + + For I ``Par1`` = GTC: Critical energy-release rate value. + + For ``Par1`` = KIC: Critical stress-intensity factor value. + + For ``Par1`` = JIC: Critical J-integral value. + + * ``Par3`` - For ``Par1`` = MTAB, KIC, or JIC: Specifies the fracture-parameter contour to use for + `SMART + `_ + crack-growth evaluation. Default = 2. + + **Command Specification for Action= CSFL** + + .. _CGROW_CSFL: + + * ``Par1`` - Crack-surface load options: + + * PRES - New crack-surface pressure load. + * CZM - Entire crack-surface enhanced by ``INTER204`` 3D 16-node cohesive elements (generated + automatically during the first remeshing around the associated crack). See :ref:`CGROW_notes`. + + * ``Par2`` - When ``Par1`` = PRES: (blank) + + When ``Par1`` = CZM: A valid material ID (defined via :ref:`tb`,CZM,,,,BILI, :ref:`tb`,CZM,,,,CEXP, + or :ref:`tb`,CZM,,,,CLIN [default]). If zero or an invalid value is specified, the program uses + :ref:`tb`,CZM,,,,CLIN as the default cohesive model type and sets reasonable CZM parameters based on + the solid elements around the crack fronts/surfaces. For more information, see `Enhancing Crack + Surfaces with Cohesive Zone Elements + `_ + + * ``Par3`` - New crack-surface load value, or the name of a table for specifying tabular load values + for crack- growth. + + The new crack-surface load is always assumed to be constant. If ``Par1`` = PRES, ``Par3`` specifies + a constant pressure load. + + To specify a table ( :ref:`dim` ), enclose the table name within "%" characters ( + + .. code:: apdl + + % tablename% ). Only one table can be specified for a crack-growth set, and time is the only + primary variable supported. + + .. code:: apdl + + % tablename% ). Only one table can be specified for a crack-growth set, and time is the only + primary variable supported. + + **Command Specification for Action= CPATH** + + .. _CGROW_CPATH: + + * ``Par1`` - Interface element component for crack path ( `VCCT + `_ + method only). (Component name must be 32 characters or less.) + + **Command Specification for Action= DTIME** + + .. _CGROW_DTIME: + + * ``Par1`` - Initial time step when crack-growth is detected. + + **Command Specification for Action= DTMIN** + + .. _CGROW_DTMIN: + + * ``Par1`` - Minimum time step allowed when crack-growth is detected. + + **Command Specification for Action= DTMAX** + + .. _CGROW_DTMAX: + + * ``Par1`` - Maximum time step allowed when crack-growth is detected. + + **Command Specification for Action= FCRAT** + + .. _CGROW_FCRAT: + + * ``Par1`` - `Fracture criterion ratio + `_ + (f:sub:`c`, where f:sub:`c` is generally around 1). The recommended ratio is 0.95 to 1.05. The + default is 1.00. + + **Command Specification for Action= STOP** + + .. _CGROW_STOP: + + * ``Par1`` - **CEMX** - Stops the analysis when the crack extension for any crack-front node reaches + the maximum value + (specified via ``Par2`` ). + + **FBOU** - Stops the analysis when the crack extension reaches the free boundary. Valid only for `SMART `_ crack-growth analysis. + + **KMAX** - Stops the analysis when the maximum equivalent stress-intensity factor exceeds the specified limit + ( ``Par2`` ). Valid only for SMART crack-growth analysis. + + * ``Par2`` - When ``Par1`` = CEMX, the value of maximum crack extension allowed. + + When ``Par1`` = KMAX, the value of the maximum equivalent stress-intensity factor allowed. + + **Command Specification for Action= METHOD** + + .. _CGROW_METHOD: + + * ``Par1, Par2`` - **VCCT** - Use `VCCT + `_ + to grow the crack (default). + + **XFEM** - Use `XFEM `_ to grow the crack. + + **SMART** - Use `SMART `_ to grow the crack. + + * ``Par2`` - REME - Remeshing-based `SMART + `_ + crack-growth method (the default and only option). Valid only when ``Par1`` = SMART. + + **Command Specification for Action= FCG** + + .. _CGROW_FCG: + + * ``Par1`` - **METH** - Fatigue crack-growth method. + + **DAMX** - Maximum crack-growth increment. + + **DAMN** - Minimum crack-growth increment. + + **SRAT** - `Stress ratio `_. + + **DKTH** - Threshold value of equivalent stress-intensity-factor range (SIFS). + + **DN** - Incremental number of cycles. + + * ``Par2`` - ``Method`` - `LC or CBC method + `_ + CBCmethod. Valid only when ``Par1`` = METH. + + ``VALUE`` - Value for the specified ``Par1``. Valid only when ``Par1`` = DAMX, DAMN, SRAT, DKTH, or DN. + + * For ``Par1`` = SRAT or DKTH, ``Par2`` can be a constant or table. To specify a table ( :ref:`dim` + ), enclose the table name within "%" characters (``tablename``). Only one table can be + specified for a crack-growth set, and time is the only primary variable supported. + + * ``Par3`` - Valid only for `SMART + `_ + crack-growth analysis when ``Par1`` = DKTH. + + MIN or MAX or AVER or blank (default) - The minimum, maximum, or average stress-intensity-factor + range (ΔK), respectively. The program calculates the range over the entire crack front, then uses + the result to evaluate the threshold criterion. The entire crack is arrested if the specified + minimum, maximum, or average ΔK is below the threshold ( ``Par2`` ). Partial crack-growth does not + occur. + + If ``Par3`` is unspecified (default), the program evaluates threshold criterion at each crack-front + node individually and ensures that the crack is arrested locally at any node where ΔK is below the + threshold ( ``Par2`` ). If some nodes have ΔK less than the threshold and others have ΔK greater + than the threshold, partial crack-growth occurs at the crack front. + + **Example: Using + + .. code:: apdl + + CGROW,FCG,DKTH, Par2, Par3 + + ** + + If ``Par3`` = MIN, the program selects the minimum ΔK from the ΔK values calculated at all crack- + front nodes for the corresponding crack ID. If the minimum ΔK does not exceed the threshold ( + ``Par2`` ), there is no crack extension at the entire crack front. + + **Command Specification for Action= SOPT** + + .. _CGROW_SOPT: + + * ``Par1`` - SCN - Use a single number of cycles for all cracks in a multicrack analysis (even if + each crack has separate loading) (default). + + MCN - Allow a separate cycle count for each crack in a multicrack analysis (available only if each + crack has separate loading). + + **Command Specification for Action= RMCONT** + + .. _CGROW_RMCONT: + + Valid in a `SMART + `_ + crack-growth analysis only. + + * ``Par1`` - COARSE - Controls `mesh-coarsening + `_. + + ESIZE - Controls element sizing and crack-increment size. + + CMULT - Controls the crack-growth increment multiplier. + + * ``Par2`` - For ``Par1`` = COARSE: + + * CONS - Remeshing occurs with conservative mesh-coarsening (default). + * MODE - Remeshing occurs with moderate mesh-coarsening. + * AGGR - Remeshing occurs with aggressive mesh-coarsening. + + For ``Par1`` = ESIZE: + + * Crack-front reference element-size value, or the table name for specifying tabular element size + values as a function of solution time. + + For ``Par1`` = CMULT: + + * Crack-front `element-size multiplier function + `_ + : + * TIME - Controls the crack-growth increment multiplier via the beginning and end of the solution + time. + * CEMX - Controls the crack-growth increment multiplier via the beginning and end of the accumulated + maximum crack extension. + * RMNU - Controls the crack-growth increment multiplier via the beginning and end of the number of + remeshing steps. + * TABLE - The name of the table for controlling the crack-growth increment multiplier. + + * ``Par3 - Par5`` - For ``Par1`` = ESIZE and ``Par2`` = ``VALUE`` or ``tablename`` and ``Par3`` = + COMP: + + * ``Par4`` = Name of the node or element component (≤ 32 characters). + + For ``Par1`` = ESIZE and ``Par2`` = ``VALUE`` or ``tablename`` and ``Par3`` = NODE: + + * ``Par4`` = Node ID. + + For ``Par1`` = ESIZE and ``Par2`` = ``VALUE`` or ``tablename`` and ``Par3`` = ELEM: + + * ``Par4`` = Element ID. + + For ``Par1`` = CMULT and ``Par2`` = TIME: + + * ``Par3`` = ``VALUE`` - Maximum value of the crack-growth multiplier value. + * ``Par4`` = ``VALUE`` - Time at the beginning of the crack-increment control function. + * ``Par5`` = ``VALUE`` - Time at the end of the crack-increment control function. + + For ``Par1`` = CMULT and ``Par2`` = CEMX: + + * ``Par3`` = ``VALUE`` - Maximum value of the crack-growth multiplier value. + * ``Par4`` = ``VALUE`` - Accumulated maximum crack extension at the beginning of the crack-increment + control function. + * ``Par5`` = ``VALUE`` - Accumulated maximum crack extension at the end of the crack-increment + control function. + + For ``Par1`` = CMULT and ``Par2`` = RMNU: + + * ``Par3`` = ``VALUE`` - Maximum value of the crack-growth multiplier value. + * ``Par4`` = ``VALUE`` - Remeshing number at the beginning of the crack-increment control function. + * ``Par5`` = ``VALUE`` - Remeshing number at the end of the crack-increment control function. + + For ``Par1`` = CMULT and ``Par2`` = TABLE: + + * ``Par3`` = ``tablename`` - Controls the crack-growth increment multiplier via the tabular data + in the specified table. + * To specify a table ( :ref:`dim` ), enclose the table name ``tablename`` within % characters. You + can specify one table per crack-growth set, and time is the only valid variable. + + **Command Specification for Action= NPLOAD** + + .. _CGROW_NPLOAD: + + Valid in a `SMART + `_ + fatigue crack-growth analysis using `nonproportional loading + `_. + + * ``Par1`` - METHOD - Specifies the nonproportional `solution method + `_. + + DIRECTION - Specifies the nonproportional `crack-growth-direction method + `_. + + * ``Par2`` - For ``Par1`` = METHOD: + + * DKEF - Specifies the effective stress-intensity-factor range method. + * DKMO - Specifies the stress-intensity-factor range method based on mode separation. + * TKEF - Specifies the total effective stress-intensity-factor method. + * TKMO - Specifies the total stress-intensity-factor method based on mode separation. + + For ``Par1`` = DIRECTION: + + * KMAX - Specifies the maximum-load method for the crack-growth direction. + * KMIN - Specifies the minimum-load method for the crack-growth direction. + * KLOC - Specifies the local kink-tip stress-intensity-factor method. + + * ``Par3`` - For ``Par2`` = KLOC: + + * ``w`` - Parameter-fitting value between 0 and 1. Default = 0.5. + + Notes + ----- + + .. _CGROW_notes: + + When ``Action`` = NEW, the :ref:`cgrow` command initializes a crack-growth simulation set. + Subsequent :ref:`cgrow` commands define the parameters necessary for the simulation. + + For multiple cracks, issue multiple :ref:`cgrow`,NEW commands (and any subsequent :ref:`cgrow` + commands necessary to define the parameters) for each crack. + + If the analysis is restarted ( :ref:`antype`,,RESTART), the :ref:`cgrow` command must be re-issued. + + If the :ref:`save` command is issued after any :ref:`cgrow` commands are issued, the :ref:`cgrow` + commands are not saved to the database. Reissue the :ref:`cgrow` command(s) when the database is + resumed. + + **For** `SMART + `_ + -based crack-growth: + + * ``Action`` = CPATH has no effect. + + * ``Action`` = STOP affects both SMART-based `static + `_ + and `fatigue + `_ + crack-growth analyses. + + * When ``Action`` = CSFL with ``Option`` = CZM, the remeshing for cracks associated with this option + is enforced at the end of the first load step and the first substep whether or not the crack grows + at this moment. On original crack surfaces (defined via :ref:`cint`,SURF), ``INTER204`` elements + are initialized fully damaged, as they are used for crack-closure only and do not contribute + bonding tractions on crack surfaces. The cohesive tractions on the new open crack surface are + defined via the cohesive zone material model type ( :ref:`tb`,CZM) and :ref:`cgrow`,CSFL,CZM. This + option can be combined with :ref:`adpci` to initialize a crack with cohesive effect. + + **For** `VCCT + `_ + -based crack-growth: + + * Crack-growth element components must use the crack tip nodes as the starting nodes of the crack + path. + + * Fracture criteria ( ``Action`` = FCOPTION) use energy-release rates calculated via VCCT technology + ( :ref:`cint`,TYPE,VCCT). For information about the fracture criteria available, see `Fracture + Criteria + `_ + :ref:`tb`, `CGCR -- Crack-Growth Fracture Criterion + `_ + CGCR. + + **For** `XFEM + `_ + -based crack-growth: + + * The crack specification originates via the :ref:`xfenrich`, :ref:`xfdata`, or :ref:`xfcrkmesh` + command. + + * ``Action`` = CPATH, DTMIN, or DTMAX has no effect. + + * ``Action`` = STOP affects `fatigue + `_ + crack-growth analysis only. + """ + command = f"CGROW,{action},{par1},{par2},{par3}" + return self.run(command, **kwargs) + + def inistate( + self, + action: str = "", + val1: str = "", + val2: str = "", + val3: str = "", + val4: str = "", + val5: str = "", + val6: str = "", + val7: str = "", + val8: str = "", + val9: str = "", + **kwargs, + ): + r"""Defines initial-state data and parameters. + + Mechanical APDL Command: `INISTATE `_ + + Parameters + ---------- + action : str + Specifies action for defining or manipulating `initial-state + `_ data: + + * ``SET`` - Use ``Action`` = SET to designate initial-state coordinate system, data type, and + material type parameters. See :ref:`inistate_set`. + + * ``DEFINE`` - Use ``Action`` = DEFINE to specify the actual state values, and the corresponding + element, integration point, or layer information. See :ref:`inistate_define`. + + Use ``Action`` = DEFINE for `function-based + `_ initial + state. See :ref:`inistate_deffuncbased`. + + * ``WRITE`` - Use ``Action`` = WRITE to write the initial-state values to a file when the + :ref:`solve` command is issued. See :ref:`inistate_write`. + + * ``READ`` - Use ``Action`` = READ to read the initial-state values from a file. See + :ref:`inistate_read`. + + * ``LIST`` - Use ``Action`` = LIST to read out the initial-state data. See :ref:`inistate_list`. + + * ``DELETE`` - Use ``Action`` = DELE to delete initial-state data from a selected set of elements. + See :ref:`inistate_delete` + + 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. + + Other Parameters + ---------------- + **Command Specification for Action= SET** + + .. _inistate_set: + + This command contains some tables and extra information which can be inspected in the original + documentation pointed above. + + ``Action`` = SET specifies and modifies the environment into which you will define the initial-state + data (via a subsequent :ref:`inistate`,DEFINE command). Otherwise, subsequent + :ref:`inistate`,DEFINE data is input as initial stress data in the global Cartesian coordinate + system. + + **Command Specifications for Action= DEFINE** + + .. _inistate_define: + + * ``ELID`` - Element ID number when using element-based initial state. Defaults to current element + selection. + + Node number when using node-based initial state. Defaults to current node selection. + + * ``EINT`` - Gauss integration point. Default = ALL or -1. + + For node-based initial state ( ``Val2`` = NODE), element ID number (if specified). The + :ref:`inistate` command is applied only to the specified element (unlike the default behavior, where + the command is applied to all selected elements containing the specified node). + + Not valid for material-based initial-state data ( ``Val1`` = MAT) or node-based initial state ( + ``Val2`` = NODE). + + * ``KLAYER`` - Layer number (for layered solid/shell elements) or cell number for beam/pipe + elements. Blank for other supported element types and material-based initial-state data. Default = + ALL or -1. + + * ``ParmInt`` - Section integration point within a layer, or cell-integration point for beams + (typically four integration points). Default = ALL or -1. Not valid for material-based initial-state + data ( ``Val1`` = MAT) or node-based initial state ( ``Val2`` = NODE). + + Not valid for material-based initial-state data ( ``Val1`` = MAT). + + Not used for node-based initial state with elements that do not have a beam/pipe/shell section + defined. + + For node-based initial state with beams/pipes, values 1 through 4 can be used to specify the values + at corner nodes within a cell. + + For node-based initial state with layered sections, values can be specified at TOP, BOT, and MID, or + left blank (ALL or -1). + + * ``Cxx, Cyy, Czz, Cxy, Cyz, Cxz`` - Stress (S), strain (EPEL), or plastic strain (EPPL) values. + + You can issue the :ref:`inistate` command repeatedly to define multiple sets of initial-state + values. initial-state data can be specified according to elements, layers or integration points. + + When the initial-state parameters are being defined based on the material, ( + :ref:`inistate`,SET,MAT, ``MATID`` ), ``ELID`` designates the element ID number and all subsequent + values are ignored. + + For coupled-field elements, the stresses to input must be Biot``s effective stresses. + + **Command Specifications for Action= DEFINE (Function-Based Option)** + + .. _inistate_deffuncbased: + + * ``ELID`` - Element ID number when using element-based initial state. Defaults to current element + selection. + + Node number when using node-based initial state. Defaults to current node selection. + + * ``EINT`` - Gauss integration point (defaults to ALL). Not valid for material-based initial-state + data ( ``Val1`` = MAT) or node-based initial state ( ``Val2`` = NODE). + + * ``(Blank)`` - Reserved for future use. + + * ``(Blank)`` - Reserved for future use. + + * ``FuncName`` - LINX \| LINY \| LINZ. Apply initial-state data as a linear function of location based + on the X axis (LINX), Y axis (LINY), or Z axis (LINZ) in the coordinate system specified via the + :ref:`inistate`,SET,CSYS command. Default coordinate system: CSYS,0 (global Cartesian). + + * ``C1, C2,..., C12`` - For ``FuncName`` with tensors, each component uses two values. SXX = ``C1`` + + X\* ``C2``, SYY = ``C3`` + X\* ``C4``, and so on. Specify 12 values (for the six tensor + components). + + For ``FuncName`` with scalars, only two values ``C1`` and ``C2`` ( ``VALUE`` = ``C1`` + X\* ``C2`` ) are necessary to apply the initial state. + + You can issue :ref:`inistate` repeatedly with the function-based option to define multiple sets of + initial-state values. Initial-state data can be specified according to elements or integration + points. + + For coupled-field elements, the stresses to input must be Biot's effective stresses. + + **Command Specifications for Action= WRITE** + + .. _inistate_write: + + * ``FLAG`` - Set this value to 1 to generate the initial-state file, or 0 to disable initial-state + file generation. + + * ``CSID`` - Determines the `coordinate system + `_ + for the initial state: + + * ``0 (default)`` - Write in global Cartesian coordinate system for solid elements. + + * ``-1 (or MAT)`` - Write in material coordinate system + + * ``-2 (or ELEM)`` - Write in element coordinate system for link, beam, and layered elements. + + * ``Dtype`` - Sets the data type to be written in the :file:`.IST` file: + + * ``S`` - Output stresses. + + * ``EPEL`` - Output elastic strain. + + * ``EPPL`` - Output plastic strain. + + * ``PLEQ`` - Output equivalent plastic strain. + + * ``PLWK`` - Output plastic strain energy density. + + * ``EPCR`` - Output creep strain. + + * ``PPRE`` - Initial pore pressure. + + * ``VOID`` - Initial void ratio. + + * ``SVAR`` - State variables. + + Default is 0 for solid elements and -2 for link, beam, and shell elements. + + State variables are always written to the :file:`.ist` file in the material coordinate system. + + Only the three in-plane stresses for the top and bottom surfaces are written. + + For coupled-field elements, the stresses written out are Biot``s effective stress values. + + Initial pore pressure and void ratio are available for the coupled pore-pressure elements (CPT + ``nnn`` ) only: ``CPT212``, ``CPT213``, ``CPT215``, ``CPT216``, and ``CPT217``. + + **Command Specifications for Action= READ** + + .. _inistate_read: + + Reads initial-state data from a standalone `initial-state (.ist) file + `_ + of the specified name ( ``Fname`` ) and filename extension ( ``Ext`` ), located in the specified + path ( ``Path`` ). The initial-state file must be in a comma-delimited ASCII file format, consisting + of individual rows for each stress/strain item, with each row consisting of columns separated by + commas. + + Use ``Action`` = READ to apply complex sets of initial-state data to various elements, cells, + layers, sections, and integration points. This option is available for element-integration-point- + based initial-state data and node-based initial-state data. + + Mapping to nodes may offer better performance when many substeps are involved; however, only + location support is available. Mapping to element-integration points supports additional field + variables TIME, FREQ and TEMP and generally uses less memory. + + For other non-user-defined field variables (such as initial stress or strain), initial state is + evaluated only at the first substep in the first load step. + + * ``MeshIndMethod`` - Mesh-Independent method :file:`.ist` read options: + + * 0 or DEFA -- `Standard + `_ + (mesh-dependent) initial state :file:`.ist` file (default). + * MAPN -- Map to nodes internally when applying the initial state. + * MAPI -- Map to element-integration points. + * DOBJ -- Do not use :file:`.ist` data in the finite element solution. (Use this option if + `converting initial-stress data to a traction load + `_.) + + **Command Specifications for Action= LIST** + + .. _inistate_list: + + If using the `standard method + `_ + for applying initial-state data,specify ``ELID`` = element ID number to list initial-state data for + elements. If ``ELID`` is unspecified, all initial-state data for all selected elements are listed. + + If using the mesh-independent method, specify ``ELID`` = MIND to list initial-state data. + + **Command Specifications for Action= DELETE** + + .. _inistate_delete: + + If using the `standard method + `_, + specify ``ELID`` = element ID number to delete initial-state data for elements. If ``ELID`` is + unspecified, all initial-state data for all selected elements are deleted. + + If using the mesh-independent method, specify ``ELID`` = MIND to delete initial-state data. + + Notes + ----- + :ref:`inistate` is available for `current-technology elements + `_. + + The command can also be used with ``MESH200`` (via the `mesh-independent method + `_ + for defining `reinforcing + `_ ) to + apply an initial state to all generated reinforcing elements automatically. For more information, + see `Applying an Initial State to Reinforcing Elements + `_ + + Initial-state support for a given element is indicated in the documentation for the element under + **Special Features**. + + Initial-strain input ( :ref:`inistate`,SET,DTYPE,EPEL) enables the nonlinear solver option + automatically even if no nonlinear materials are involved. + + The command does not support kinematic hardening material properties (such as :ref:`tb` + ,PLAS,,,,BKIN) or the shape memory alloy material model ( :ref:`tb`,SMA). + + :ref:`inistate` with elastic strain alone is not supported for gasket materials ( :ref:`tb`,GASK) + and hyperelastic materials ( :ref:`tb` ,HYPER, :ref:`tb` ,BB, :ref:`tb`,AHYPER, :ref:`tb`,CDM, + :ref:`tb`,EXPE). + + :ref:`inistate` with initial stress alone is not supported for gasket materials ( :ref:`tb`,GASK). + + :ref:`inistate` with plastic strain (which must include initial strain or stress, plastic strain, + and accumulated plastic strain) does not support gasket materials ( :ref:`tb`,GASK), rate-dependent + plasticity ( :ref:`tb`,RATE), and viscoelasticity ( :ref:`tb`,PRONY, :ref:`tb`,SHIFT). + + For more information about using the initial-state capability, see `Initial State + `_ + """ + command = f"INISTATE,{action},{val1},{val2},{val3},{val4},{val5},{val6},{val7},{val8},{val9}" + return self.run(command, **kwargs) + + def tb( + self, + lab: str = "", + matid: str = "", + ntemp: str = "", + npts: str = "", + tbopt: str = "", + funcname: str = "", + **kwargs, + ): + r"""Activates a data table for material properties or special element input. + + Mechanical APDL Command: `TB `_ + + Parameters + ---------- + lab : str + Material model data table type: + + * ``AFDM`` - :ref:`Acoustic frequency-dependent material. ` + + * ``AHYPER`` - :ref:`Anisotropic hyperelasticity. ` + + * ``ANEL`` - :ref:`Anisotropic elasticity. ` + + * ``ANISO`` - :ref:`Generalized Hill anisotropy. ` + + * ``AVIS`` - :ref:`Anisotropic viscosity. ` + + * ``BB`` - :ref:`Bergstrom-Boyce. ` + + * ``BH`` - :ref:`Magnetic field. ` + + * ``CAST`` - :ref:`Cast iron. ` + + * ``CDM`` - :ref:`Damage. ` + + * ``CFOAM`` - :ref:`Crushable foam. ` + + * ``CGCR`` - `CGCR -- Crack-Growth Fracture Criterion + `_ + Crack-growth fracture criterion ( :ref:`cgrow` ). + + * ``CHABOCHE`` - :ref:`Chaboche nonlinear kinematic hardening using von Mises or Hill plasticity. + ` + + * ``CONCR`` - :ref:`Concrete element or material data. ` + + * ``CREEP`` - :ref:`Creep. Pure creep, creep with isotropic hardening plasticity, or creep with + kinematic hardening plasticity using both von Mises or Hill potentials. ` + + * ``CRKI`` - - Material criterion for :ref:`adaptive-crack initiation ( ` :ref:`adpci` ) + + * ``CTE`` - :ref:`Coefficient of thermal expansion. ` + + * ``CZM`` - :ref:`Cohesive zone. ` + + * ``DENS`` - :ref:`Mass Density. ` + + * ``DLST`` - :ref:`Anisotropic dielectric loss tangent. ` + + * ``DMGE`` - :ref:`Damage evolution law. ` + + * ``DMGI`` - :ref:`Damage initiation criteria. ` + + * ``DPER`` - :ref:`Anisotropic electric permittivity. ` + + * ``EDP`` - :ref:`Extended Drucker-Prager (for granular materials such as rock, concrete, soil, + ceramics and other pressure-dependent materials). ` + + * ``ELASTIC`` - :ref:`Elasticity. ` + + * ``ELST`` - :ref:`Anisotropic elastic loss tangent. ` + + * ``EXPE`` - :ref:`Experimental data. ` + + * ``FCON`` - :ref:`Fluid conductance data. ` + + * ``FCLI`` - :ref:`Material strength limits for calculating failure criteria. ` + + * ``FLUID`` - :ref:`Fluid. ` + + * ``FRIC`` - :ref:`Coefficient of friction based on Coulomb's Law or user-defined friction. + ` + + * ``GASKET`` - :ref:`Gasket. ` + + * ``GURSON`` - :ref:`Gurson pressure-dependent plasticity for porous metals. ` + + * ``HFLM`` - :ref:`Film coefficient data. ` + + * ``HILL`` - :ref:`Hill anisotropy. When combined with other material options, simulates plasticity, + viscoplasticity, and creep -- all with the Hill potential. ` + + * ``HYPER`` - :ref:`Hyperelasticity material models (Arruda-Boyce, Blatz-Ko, Extended Tube, Gent, + Mooney-Rivlin [default], Neo-Hookean, Ogden, Ogden Foam, Polynomial Form, Response Function, Yeoh, + and user- defined). ` + + * ``INTER`` - :ref:`Contact interaction. ` + + * ``JOIN`` - :ref:`Joint (linear and nonlinear elastic stiffness, linear and nonlinear damping, and + frictional behavior). ` + + * ``JROCK`` - :ref:`Jointed rock. ` + + * ``MC`` - :ref:`Mohr-Coulomb. ` + + * ``MELAS`` - :ref:`Multilinear elasticity. ` + + * ``MIGR`` - :ref:`Migration. ` + + * ``MPLANE`` - :ref:`Microplane. ` + + * ``NLISO`` - :ref:`Voce isotropic hardening law (or power law) for modeling nonlinear isotropic + hardening using von Mises or Hill plasticity. ` + + * ``PELAS`` - :ref:`Porous elasticity. ` + + * ``PERF`` - :ref:`Perforated material for acoustics; equivalent fluid model of perforated media, + poroelastic material model, and transfer admittance matrix. ` + + * ``PIEZ`` - :ref:`Piezoelectric matrix. ` + + * ``PLASTIC`` - :ref:`Nonlinear plasticity. ` + + * ``PM`` - :ref:`Porous media. Coupled pore-fluid diffusion and structural model of porous media. + ` + + * ``PRONY`` - :ref:`Prony series constants for viscoelastic materials. ` + + * ``PZRS`` - :ref:`Piezoresistivity. ` + + * ``RATE`` - :ref:`Rate-dependent plasticity (viscoplasticity) when combined with the BISO, NLISO or + PLASTIC material options, or rate-dependent anisotropic plasticity (anisotropic viscoplasticity) + when combined with the HILL and BISO, NLISO or PLASTIC material options. ` + + The exponential visco-hardening option includes an explicit function for directly defining static + yield stresses of materials. + + The Anand unified plasticity option requires no combination with other material models. + + * ``SDAMP`` - :ref:`Material damping coefficients. ` + + * ``SHIFT`` - :ref:`Shift function for viscoelastic materials. ` + + * ``SINT`` - :ref:`Sintering. Available with the Additive Suite license. ` + + * ``SMA`` - :ref:`Shape memory alloy for simulating ` `superelasticity + `_, `shape memory effect + `_, or shape memory + effect with `plasticity + `_. + + * ``SOIL`` - :ref:`Soil models. ` + + * ``STATE`` - :ref:`User-defined state variables. Valid with ` :ref:`tb`,USER + and used with either the `UserMat + `_ or `UserMatTh + `_ subroutine. + Also valid with :ref:`tb`,CREEP (when ``TBOPT`` = 100) and used with the UserCreep subroutine. + + * ``SWELL`` - :ref:`Swelling strain function. ` + + * ``TNM`` - :ref:`Three-network model for viscoplastic materials. ` + + * ``THERM`` - :ref:`Thermal properties. ` + + * ``USER`` - :ref:`User-defined material or thermal material model (general-purpose except for + incompressible material models) or thermal material model. ` + + * ``WEAR`` - :ref:`Contact surface wear. ` + + * ``XTAL`` - :ref:`Crystal plasticity for elasto-viscoplastic crystalline materials. ` + + matid : str + Material reference identification number. Valid value is any number ``n``, where 0 < ``n`` < + 100,000. Default = 1. + + ntemp : str + The number of temperatures for which data will be provided (if applicable). Specify temperatures + via the :ref:`tbtemp` command. + + npts : str + For most labels where ``NPTS`` is defined, the number of data points to be specified for a given + temperature. Define data points via the :ref:`tbdata` or :ref:`tbpt` commands. + + tbopt : str + The description of the argument is missing in the Python function. Please, refer to the `command + documentation `_ + for further information. + + funcname : str + The name of the function to be used (entered as ``tabname``, where ``tabname`` is the name of + the table created by the Function Tool). Valid only when ``Lab`` = JOIN (joint element material) + and nonlinear stiffness or damping are specified on the ``TBOPT`` field (see :ref:`tbjoinspec` + ). The function must be predefined via the Function Tool. To learn more about how to create a + function, see `Using the Function Tool + `_ + + Notes + ----- + + .. warning:: + + This function contains specificities regarding the argument definitions. + Please refer to the `command documentation `_ + for further explanations. + + **Data Table Specifications** + + .. _TB_datatabspec: + + Following are input requirements ( ``NTEMP``, ``NPTS``, and ``TBOPT`` values) and links to detailed + documentation for each data table type ( :ref:`tb`, ``Lab`` value): + + .. _TBafdm_spec: + + * ``NTEMP:`` - Not used. + + * ``NPTS :`` - Not used. + + * ``TBOPT:`` - Acoustic material options: + + * ``MAT`` - Material properties + + * ``THIN`` - Thin layer + + * ``RECT`` - Rectangular cross-section + + * ``CIRC`` - Circular cross-section + + * ``ROOM`` - Diffusion properties for room acoustics + + * ``References:`` - `Defining Acoustic Material Properties + `_ + + See :ref:`tbfield` for more information about defining temperature- and/or frequency-dependent + properties. + + .. _TBahyperspec: + + * ``NTEMP :`` - Number of temperatures for which data will be provided. Default = 1. Maximum = 40. + + * ``NPTS :`` - Number of data points to be specified for a given temperature. + + * ``TBOPT :`` - Anisotropic hyperelastic material options. + + * ``POLY`` - Polynomial strain energy potential. + + * ``EXPO`` - Exponential strain energy potential. + + * ``AVEC`` - Define the A vector. + + * ``BVEC`` - Define the B vector. + + * ``PVOL`` - Volumetric potential. + + * ``USER`` - `User-defined + `_ potential + invariant set type. + + * ``UNUM`` - `User-defined + `_ invariant set + number. + + * ``AU01`` - `User-defined + `_ material + parameters. + + * ``FB01`` - `User-defined + `_ fiber + directions. + + * ``References:`` - `Anisotropic Hyperelasticity ( TB,AHYPER) + `_ + + `Anisotropic Hyperelasticity Model + `_ + + `Subroutine UserHyperAniso (Writing Your Own Anisotropic Hyperelasticity Laws) + `_ + + `Anisotropic Hyperelasticity + `_ + + .. _TBDTSpANELjwf070600: + + This material model is not supported for use with the :ref:`coefficient of thermal expansion ( + ` :ref:`tb`,CTE). The maximum number of ANEL tables is 1,000,000. + + * ``NTEMP :`` - Number of temperatures for which data will be provided. Default = 6. Maximum = 6. + + * ``NPTS :`` - Not used. + + * ``TBOPT :`` - Anisotropic elastic matrix options. + + * ``0`` - Elasticity matrix used as supplied (input in stiffness form). + + * ``1`` - Elasticity matrix inverted before use (input in flexibility form). + + * ``References:`` - `Anisotropic Elasticity + `_ + + .. _TBANISOspec: + + * ``NTEMP:`` - Not used. + + * ``NPTS :`` - Not used. + + * ``TBOPT:`` - Not used. + + * ``References:`` - `Generalized Hill Anisotropy + `_ + + .. _AVIS_spec: + + * ``NTEMP:`` - Not used. + + * ``NPTS :`` - Not used. + + * ``TBOPT:`` - Anisotropic viscosity matrix options: + + * ``0`` - Viscosity matrix (used as specified). + + * ``1`` - Fluency matrix (converted to viscosity matrix before use). + + * ``References:`` - `Anisotropic Viscosity + `_ + + .. _TBBBspecs: + + * ``NTEMP :`` - Number of temperatures for which data will be provided. Default = 1. The maximum + must be a value such that ( ``NTEMP`` x ``NPTS`` ) <= 1000. + + * ``NPTS :`` - Number of material constants. + + * ``TBOPT :`` - Isochoric or volumetric strain-energy function: + + * ``ISO`` - Define material constants for isochoric strain energy. + + * ``PVOL`` - Define material constants for volumetric strain energy. + + * ``References:`` - `Bergstrom-Boyce + `_ + + `Bergstrom-Boyce Material ( TB,BB) + `_ + + `Bergstrom-Boyce Hyperviscoelasticity Model + `_ + + .. _TBDTSpBHjwf070600: + + * ``NTEMP :`` - Not used. + + * ``NPTS :`` - Number of data points to be specified. Default = 20. Maximum = 500. + + * ``TBOPT :`` - BH curve options. + + * ``BH or (blank)`` - BH curve data (default). + + * ``TCF`` - Thermal coefficient data for BH curve modification. This option is valid for the + following elements: ``PLANE223``, ``SOLID226``, ``SOLID227``, ``PLANE233``, ``SOLID236``, and + ``SOLID237``. + + * ``References:`` - + + `Additional Guidelines for Defining Regional Material Properties and Real Constants + `_ + + .. _tbcastspecjmb: + + * ``NTEMP:`` - Number of temperatures for which data will be provided. Default = 1. Maximum = 10. + + * ``NPTS:`` - Not used. + + * ``TBOPT:`` - Cast iron options: + + * ``ISOTROPIC`` - Specifies cast iron plasticity with isotropic hardening. + + * ``TENSION`` - Defines stress-strain relation in tension. + + * ``COMPRESSION`` - Defines stress-strain relation in compression. + + * ``ROUNDING`` - Defines tension yield surface rounding factor. + + * ``References:`` - `Cast Iron + `_ + + .. _TBCDMspecs: + + * ``NTEMP :`` - Number of temperatures for which data will be provided. Default = 1. The maximum + must be a value such that ( ``NTEMP`` x ``NPTS`` ) <= 1000. + + * ``NPTS :`` - Number of data points to be specified for a given temperature. + + * ``TBOPT :`` - Damage option: + + * ``PSE2`` - Mullins effect for hyperelasticity models: Pseudo-elastic model with a modified Ogden- + Roxburgh damage function. Requires ``NPTS`` = 3. + + * ``MUSER`` - Mullins effect for hyperelasticity models: Pseudo-elastic model with a user-defined + damage function. + + * ``GDMG`` - Generalized damage model parameters. + + * ``FIB1`` - Damage parameters in fiber direction 1. + + * ``FIB2`` - Damage parameters in fiber direction 2. + + * ``FIB3`` - Damage parameters in fiber direction 3. + + * ``References:`` - `Mullins Effect + `_ + + `Mullins Effect ( TB,CDM) + `_ + + `Mullins Effect Model + `_ + + `Regularized Anisotropic Damage + `_ + + .. _TBCFOAMspecs: + + * ``NTEMP :`` - Not used. + + * ``NPTS :`` - Not used. + + * ``TBOPT :`` - Crushable foam material option: + + * `YIELD `_ - + Initial yield stress values. + + * `HTYPE `_ - + Hardening evolution type. + + * `MHARD `_ - + Multilinear hardening evolution points. + + * `PPR `_ - + Plastic Poisson``s ratio. + + * ``References:`` - `Crushable Foam + `_ + + .. _tbcgcrspec: + + * ``NTEMP :`` - Number of temperatures for which data will be provided. Default = 1. + + * ``NPTS :`` - Number of data points to be specified for a given temperature. + + * ``TBOPT :`` - Fracture-criterion option. + + * `LINEAR `_ + -- Linear fracture criterion. Valid when ``NPTS`` = 3. + * `BILINEAR `_ + -- Bilinear fracture criterion. Valid when ``NPTS`` = 4. + * `BK `_ -- + B-K fracture criterion. Valid when ``NPTS`` = 3. + * `MBK `_ -- + Modified B-K (Reeder) fracture criterion. Valid when ``NPTS`` = 4. + * `POWERLAW `_ + -- Wu's Power Law fracture criterion. Valid when ``NPTS`` = 6. + * `USER + `_ + -- User-defined fracture criterion. Valid when ``NPTS`` = 20. + * `PSMAX + `_ + -- Circumferential stress criterion based on :math:`equation not available` when sweeping around + the crack tip at a given radius. Valid when ``NPTS`` = 1. Used in an `XFEM + `_ + -based crack-growth analysis only. + * `STTMAX + `_ + -- Maximum circumferential stress criterion. Valid when ``NPTS`` = 1. Used in an `XFEM + `_ + -based crack-growth analysis only. + * `RLIN + `_ + -- Rigid linear evolution law for the decay of stress. Valid when ``NPTS`` = 4. Used in an `XFEM + `_ + -based crack-growth analysis only. + * `PARIS + `_ + -- Paris' Law for fatigue crack-growth. Valid when ``NPTS`` = 2. Used in a `SMART + `_ + - or `XFEM + `_ + -based fatigue crack-growth analysis only. + * `WALK + `_ + -- Walker equation for fatigue crack-growth. Valid when ``NPTS`` = 3. Used in a `SMART + `_ + -based fatigue crack-growth analysis only. + * `FORM + `_ + -- Forman equation for fatigue crack-growth. Valid when ``NPTS`` = 3. Used in a `SMART + `_ + -based fatigue crack-growth analysis only. + * `TFDK + `_ + -- Tabular fatigue law for fatigue crack-growth. Used in a `SMART + `_ + -based fatigue crack-growth analysis only. + * `NG03 `_ + -- `NASGRO + `_ + equation v. 3 for fatigue crack-growth. Valid when ``NPTS`` = 9. Used in a `SMART + `_ + -based fatigue crack-growth analysis only. + * `NG04 `_ + -- `NASGRO + `_ + equation v. 4 for fatigue crack-growth. Valid when ``NPTS`` = 10. Used in a `SMART + `_ + -based fatigue crack-growth analysis only. + * KIC -- `Critical stress-intensity factor + `_ for static crack-growth. Valid when ``NPTS`` = 1. Valid in a `SMART + `_ + -based static crack-growth analysis only. + * JIC -- `Critical J-integral + `_ + for static crack-growth. Valid when ``NPTS`` = 1. Valid in a `SMART + `_ + -based static crack-growth analysis only. + + Fatigue `crack-closure `_ option. Valid in a `SMART `_ -based fatigue crack-growth analysis only, with crack-growth based on `Paris`` law `_ or `tabular fatigue `_ law. + + * `ELBER + `_ + - Elber closure function. + * `SCHIJVE + `_ + - Schijve closure function. + * `NEWMAN + `_ - Newman closure function. + * `UPOLY + `_ - Polynomial closure function. + + * ``References:`` - `Fracture Analysis Guide + `_ + + :ref:`cgrow` command + + .. _TBDTSpCHABjwf070600: + + * ``NTEMP :`` - Number of temperatures for which data will be provided. Default = 1. The maximum + value of ``NTEMP`` is such that ``NTEMP`` x (1 + 2 ``NPTS`` ) = 1000. + + * ``NPTS :`` - Number of kinematic models to be superposed. Default = 1. Maximum = 5. + + * ``TBOPT :`` - * ``(blank)`` - Default option for nonlinear kinematic hardening. + + * ``TRATE`` - Include temperature-rate term in back-stress evolution. + + * ``SHDR`` - Strain-hardening of dynamic recovery properties. To use this option, ``TBOPT`` = TRATE + is also required. + + * ``References:`` - `Nonlinear Kinematic Hardening + `_ + + .. _TBDTSpCONCjwf070600: + + * ``NTEMP :`` - Number of temperatures for which data will be provided (used only if ``TBOPT`` = 0 + or 1). Default = 6. Maximum = 6. + + * ``NPTS :`` - Not used. + + * ``TBOPT :`` - Concrete material options. + + * ``DP`` - `Drucker-Prager + `_ + concrete strength parameters. + + * ``RCUT`` - Rankine tension failure parameter. + + * ``DILA`` - Drucker-Prager concrete dilatation. + + * ``HSD2`` - Drucker-Prager concrete `exponential + `_ + `hardening/softening/dilitation (HSD) + `_ + behavior. + + * ``HSD4`` - Drucker-Prager concrete `steel reinforcement + `_ + HSD behavior. + + * ``HSD5`` - Drucker-Prager concrete `fracture energy + `_ + HSD behavior. + + * ``HSD6`` - Drucker-Prager concrete `linear + `_ + HSD behavior. + + * ``FPLANE`` - Drucker-Prager concrete joint parameters. + + * ``FTCUT`` - Drucker-Prager concrete joint tension cutoff. + + * ``FORIE`` - Drucker-Prager concrete joint orientation. + + * ``MW`` - Menetrey-Willam constitutive model. + + * ``MSOL`` - `Material solution option + `_. + + * ``References:`` - `Drucker-Prager Concrete + `_ + + `Hardening, Softening and Dilatation (HSD) Behavior + `_ + + `Menetrey-Willam + `_ + + .. _TBDTSpCREEjwf070600: + + * ``NTEMP :`` - Number of temperatures for which data will be provided. Default = 1. + + * ``NPTS :`` - Number of data points to be specified for a given temperature. + + * ``TBOPT :`` - Creep model options. + + * ``1 through 13`` - Implicit creep option. See for a list of available equations. + + * ``100`` - USER CREEP option. Define the creep law using the :file:`USERCREEP.F` subroutine. See + the `Guide to User-Programmable Features + `_ + + * ``References:`` - `Creep + `_ + + `Creep Model + `_ + + See also `Combining Material Models + `_ + + .. _TBspecCRKI: + + * ``NTEMP :`` - Number of temperatures for which data will be provided. Default = 6. Maximum = 6. + + * ``NPTS :`` - Not used. + + * ``TBOPT :`` - Adaptive crack-initiation options: + + * ``PSMAX`` - Maximum principal stress (default). + + * ``References:`` - `SMART Method for Crack-Initiation Simulation + `_ + + .. _TBctespec: + + * ``NTEMP:`` - No limit. + + * ``NPTS:`` - Not used. + + * ``TBOPT:`` - * ``(blank)`` - Enter the secant coefficients of thermal expansion (CTEX,CTEY,CTEZ) + (default). + + * ``USER`` - User-defined thermal strain. + + * ``FLUID`` - `Fluid thermal-expansion coefficient + `_ + for porous media. + + * ``UFSTRAIN`` - `User-defined free strain + `_ + in porous media. + + * ``References:`` - `Thermal Expansion + `_ + + `Porous Media Mechanics + `_ + + `Free-Strain Rate + `_ + + See also :ref:`tbfield` (for defining frequency-dependent, temperature-dependent, and `user-defined + field-variable-based + `_ + properties). + + .. _TBczmspec: + + * ``NTEMP :`` - Number of temperatures for which data will be provided. Default = 1. + + * ``NPTS :`` - Number of data points to be specified for a given temperature. + + * ``TBOPT :`` - Cohesive zone material options. + + * ``EXPO`` - Exponential material behavior. Valid for interface elements and contact elements. + + * ``BILI`` - `Bilinear material behavior + `_. + Valid for interface elements, contact elements, and in an `XFEM-based crack-growth + `_ + analysis when cohesive behavior on the initial crack is desired. + + * ``CBDD`` - Bilinear material behavior with linear softening characterized by maximum traction and + maximum separation. Valid for contact elements only. + + * ``CBDE`` - Bilinear material behavior with linear softening characterized by maximum traction and + critical energy release rate. Valid for contact elements only. + + * ``CEXP`` - Exponential material behavior for preventing surface penetration on the cohesive + interface. Valid for `SMART + `_ + -based crack-growth only. + + * ``CLIN`` - Linear material behavior with a penalty slope for preventing surface penetration on the + cohesive interface. Valid for `SMART + `_ + -based crack-growth only. + + * ``VREG`` - Viscous regularization. Valid for interface elements and contact elements. Also valid + in an XFEM- based crack-growth analysis when cohesive behavior is specified for the initial crack. + + * ``USER`` - User-defined option. Valid for interface elements only. + + * ``References:`` - `Cohesive Zone Material (CZM) Model + `_ + + `Cohesive Material Law + `_ + + `Subroutine userCZM (Creating Your Own Cohesive Zone Material) + `_ + + `Crack-Initiation and -Growth Simulation, Interface Delamination, and Fatigue Crack-Growth + `_ + + `XFEM-Based Crack Analysis and Crack-Growth Simulation + `_ + + `Enhancing Crack Surfaces with Cohesive Zone Elements + `_ + + .. _TBdensspec: + + * ``NTEMP :`` - Not used. + + * ``NPTS :`` - 1 + + * ``TBOPT :`` - Not used. + + * ``References:`` - See :ref:`tbfield` and `User-Defined Field Variables + `_ + + .. _DLST_spec: + + * ``NTEMP:`` - Not used. + + * ``NPTS :`` - Not used. + + * ``TBOPT:`` - Not used. + + * ``References:`` - `Anisotropic Dielectric Loss Tangent + `_ + + .. _TBdmge: + + * ``NTEMP :`` - Number of temperatures for which data will be provided. Default = 1. + + * ``NPTS :`` - Number of data points to be specified for a given temperature. Default = 4 when + ``TBOPT`` = MPDG + + * ``TBOPT :`` - Damage initiation definition: + + * ``1, or MPDG`` - Progressive damage evolution based on simple instant material stiffness + reduction. + + * ``2, or CDM`` - Progressive damage evolution based on continuum damage mechanics. + + * ``Reference:`` - `Damage Evolution Law + `_ + + .. _TBdmgi: + + * ``NTEMP :`` - Number of temperatures for which data will be provided. Default = 1. + + * ``NPTS :`` - Number of data points to be specified for a given temperature. Default = 4 when + ``TBOPT`` = FCRT. + + * ``TBOPT :`` - Damage initiation definition: + + * ``1 or FCRT`` - Define failure criteria as the damage initiation criteria. + + * ``Reference:`` - `Damage Initiation Criteria + `_ + + .. _tbdperspec: + + * ``NTEMP:`` - Not used. + + * ``NPTS:`` - Not used. + + * ``TBOPT:`` - Permittivity matrix options for ``PLANE222``, ``PLANE223``, ``SOLID225``, + ``SOLID226``, and + ``SOLID227`` : + + * ``0`` - Permittivity matrix at constant strain [ε :sup:`S` ] (used as supplied) + + * ``1`` - Permittivity matrix at constant stress [ε :sup:`T` ] (converted to [ε :sup:`S` ] form + before use) + + * ``References:`` - `Anisotropic Electric Permittivity + `_ + + .. _TBedpspec: + + * ``NTEMP :`` - Number of temperatures for which data will be provided. Default = 1. Maximum = 40. + + * ``NPTS :`` - Number of data points to be specified for a given temperature. + + * ``TBOPT :`` - EDP material options. + + * ``LYFUN`` - Linear yield function. + + * ``PYFUN`` - Power law yield function. + + * ``HYFUN`` - Hyperbolic yield function. + + * ``LFPOT`` - Linear flow potential function. + + * ``PFPOT`` - Power law flow potential function. + + * ``HFPOT`` - Hyperbolic flow potential function. + + * ``CYFUN`` - Cap yield function. + + * ``CFPOT`` - Cap flow potential function. + + * ``References:`` - `Extended Drucker-Prager (EDP) + `_ + + `Extended Drucker-Prager Cap + `_ + + .. _tbelasticpec: + + * ``NTEMP:`` - Number of temperatures for which data will be provided. + + * ``NPTS:`` - Number of properties to be defined for the material option. This value is set + automatically according to the elasticity option ( ``TBOPT`` ) selected. If ``TBOPT`` is not + specified, default settings become ``NPTS`` = 2 and ``TBOPT`` = ISOT. + + * ``TBOPT:`` - Elasticity options: + + * ``ISOT`` - Isotropic property (EX, NUXY) (default). Setting ``NPTS`` = 2 also selects this option + automatically. + + * ``OELN`` - Orthotropic option with minor Poisson's ratio (EX, EY, EZ, GXY, GYZ, GXZ, NUXY, NUYZ, + NUXZ). ``NPTS`` = 9. Setting ``NPTS`` = 9 selects this option automatically. All nine parameters + must be set, even for the 2D case. + + * ``OELM`` - Orthotropic option with major Poisson's ratio (EX, EY, EZ, GXY, GYZ, GXZ, PRXY, PRYZ, + PRXZ). ``NPTS`` = 9. All nine parameters must be set, even for the 2D case. + + * ``AELS`` - Anisotropic option in stiffness form (D11, D21, D31, D41, D51, D61, D22, D32, D42, D52, + D62, D33, D43,..... D66). ``NPTS`` = 21. Setting ``NPTS`` = 21 selects this option automatically. + + * ``AELF`` - Anisotropic option in compliance form (C11, C21, C31, C41, C51, C61, C22, C32, C42, + C52, C62, C33, C43,..... C66). ``NPTS`` = 21. + + * ``FIB1`` - Fiber parameters in fiber direction 1. + + * ``FIB2`` - Fiber parameters in fiber direction 2. + + * ``FIB3`` - Fiber parameters in fiber direction 3. + + * ``USER`` - User-defined linear elastic properties. For more information on the user_tbelastic + subroutine, see the `Guide to User-Programmable Features + `_ + + * ``References:`` - See :ref:`tbfield` for more information about defining temperature- and/or + frequency-dependent properties. + + `Regularized Anisotropic Damage + `_ + + `Full Harmonic Analysis + `_ + + .. _ELST_spec: + + * ``NTEMP:`` - Not used. + + * ``NPTS :`` - Not used. + + * ``TBOPT:`` - Not used. + + * ``References:`` - `Anisotropic Elastic Loss Tangent + `_ + + .. _TBexperimental: + + * ``NTEMP :`` - Number of temperatures for which data will be provided. + + * ``NPTS :`` - Number of data points to be specified for a given temperature. + + * ``TBOPT :`` - Experimental data type: + + * ``UNITENSION`` - Uniaxial tension experimental data. + + * ``UNICOMPRESSION`` - Uniaxial compression experimental data. + + * ``UNIAXIAL`` - Uniaxial experimental data (combined uniaxial tension and compression). + + * ``BIAXIAL`` - Equibiaxial experimental data. + + * ``SHEAR`` - Pure shear experimental data (also known as planar tension). + + * ``SSHEAR`` - Simple shear experimental data. + + * ``VOLUME`` - Volumetric experimental data. + + * ``GMODULUS`` - Shear modulus experimental data. + + * ``KMODULUS`` - Bulk modulus experimental data. + + * ``EMODULUS`` - Tensile modulus experimental data. + + * ``NUXY`` - Poisson's ratio experimental data. + + * ``References:`` - + + `Experimental Response Functions + `_ + + `Viscoelasticity + `_ + + See also :ref:`tbfield` for information about defining field-dependent experimental data. + + .. _TBDTSpFCONjwf070600: + + * ``NTEMP :`` - Number of temperatures for which data will be provided. Default = 1. Maximum = 20. + + * ``NPTS :`` - Number of data points to be specified for a given temperature. Default = 1. Maximum = + 100. + + * ``TBOPT :`` - Not used. + + * ``References:`` - ``FLUID116`` + + .. _TBfclispecs: + + * ``NTEMP :`` - Number of temperatures for which data will be provided. Default = 1. + + * ``NPTS :`` - Number of data points to be specified for a given temperature. Default = 20 when + ``TBOPT`` = 1. Default = 9 when ``TBOPT`` = 2. + + * ``TBOPT :`` - Material strength limit definition: + + * ``1`` - Define stress-strength limits. + + * ``2`` - Define strain-strength limits. + + * ``References:`` - + + .. _tbfluidspec: + + * ``NTEMP:`` - Number of temperatures for which data will be provided. Default = 1. + + * ``NPTS:`` - Number of data points to be specified for a given temperature. + + * ``TBOPT:`` - Fluid material options: + + * ``LIQUID`` - Define material constants for a liquid material. + + * ``GAS`` - Define material constants for a gas material. + + * ``PVDATA`` - Define pressure-volume data for a fluid material. + + * ``References:`` - + + `Fluid Material Models + `_ + + .. _tbfricspec: + + * ``NTEMP:`` - Number of temperatures for which data will be provided. Default = 1. No maximum + limit. + + ``NTEMP`` is not used for the following situations: + + * Isotropic or orthotropic friction defined in terms of field data ( :ref:`tbfield` command) + + * User-defined friction ( ``TBOPT`` = USER) + + * ``NPTS:`` - Number of data points to be specified for user-defined friction ( ``TBOPT`` = USER). + Not used for ``TBOPT`` = ISO or ``TBOPT`` = ORTHO. + + * ``TBOPT:`` - Friction options: + + * ``ISO`` - Isotropic friction (one coefficient of friction, MU) (default). This option is valid for + all 2D and 3D contact elements. + + * ``ORTHO`` - Orthotropic friction (two coefficients of friction, MU1 and MU2). This option is valid + for the following 3D contact elements: ``CONTA174``, ``CONTA175``, and ``CONTA177``. + + * ``FORTHO`` - Orthotropic friction (two coefficients of friction, MU1 and Mu2) with a friction + coordinate system fixed in space. This option is valid for the following 3D contact elements: + ``CONTA174``, ``CONTA175``, and ``CONTA177``. + + * ``EORTHO`` - Equivalent orthotropic friction (two coefficients of friction, MU1 and MU2). This + option differs from ``TBOPT`` = ORTHO only in the way the friction coefficients are interpolated + when they are dependent upon the following field variables: sliding distance and/or sliding + velocity. In this case, the total magnitude of the field variable is used to do the interpolation. + + * ``USER`` - User defined friction. This option is valid for all 2D and 3D contact elements. + + * ``References:`` - `Contact Friction + `_ + + See also :ref:`tbfield` for more information about defining a coefficient of friction that is + dependent on temperature, time, normal pressure, sliding distance, or sliding relative velocity. + + .. _TBDTSgas111501: + + * ``NTEMP :`` - Number of temperatures for which data will be provided. Default = 1. The maximum + number of + temperatures specified is such that ``NTEMP`` \* ``NPTS`` < 2000. + + * ``NPTS :`` - Number of data points to be specified for a given temperature. Default = 5 for + ``TBOPT`` = PARA. Default = 1 for all other values of ``TBOPT``. + + * ``TBOPT :`` - Gasket material options. + + * ``PARA`` - Gasket material general parameters. + + * ``COMP`` - Gasket material compression data. + + * ``LUNL`` - Gasket linear unloading data. + + * ``NUNL`` - Gasket nonlinear unloading data. + + * ``TSS`` - Transverse shear data. + + * ``TSMS`` - Transverse shear and membrane stiffness data. (If selected, this option takes + precedence over TSS.) + + * ``References:`` - `Gasket + `_ + + `Gasket Joints Simulation + `_ + + .. _TBgurspec: + + * ``NTEMP :`` - Number of temperatures for which data will be provided. Default = 1. Maximum = 40. + + * ``NPTS :`` - Number of data points to be specified for a given temperature. + + * ``TBOPT :`` - GURSON material options. + + * ``BASE`` - Basic model without nucleation or coalescence (default). + + * ``SNNU`` - Strain controlled nucleation. + + * ``SSNU`` - Stress controlled nucleation. + + * ``COAL`` - Coalescence. + + * ``References:`` - `Gurson + `_ + + `Gurson's Model + `_ + + .. _TBDTSpHFLMjwf070600: + + * ``NTEMP :`` - Number of temperatures for which data will be provided. Default = 1. Maximum = 20. + + * ``NPTS :`` - Number of data points to be specified for a given temperature. Default = 1. Maximum = + 100. + + * ``TBOPT :`` - Not used. + + * ``References:`` - ``FLUID116`` + + .. _TBDTSpHILLjwf070600: + + * ``NTEMP :`` - Number of temperatures for which data will be provided. Default = 1. Maximum = 40. + + * ``NPTS :`` - Not used. + + * ``TBOPT:`` - Hill plasticity option: + + * ``(blank)`` - Use one set of Hill parameters (default). + + * ``PC`` - Enter separate Hill parameters for plasticity and creep. This option is valid for + material combinations of creep and Chaboche nonlinear kinematic hardening only. + + * ``References:`` - `Hill Anisotropy + `_ + + `Hill Yield Criterion + `_ + + See also `Combining Material Models + `_ + + .. _TBDTSpHYPEjwf070600: + + * ``NTEMP :`` - Number of temperatures for which data will be provided. Default = 1. The maximum + value of ``NTEMP`` is such that ``NTEMP`` x ``NPTS`` = 1000. + + * ``NPTS :`` - Number of material parameters to be specified for a given temperature. Exceptions are + for ``TBOPT`` = FOAM, OGDEN, POLY and YEOH, where ``NPTS`` is the number of terms in the material + model``s energy function. + + * ``TBOPT :`` - Hyperelastic material options. + + * ``BOYCE`` - `Arruda-Boyce model + `_. + For ``NPTS``, default = 3 and maximum = 3. + + * ``BLATZ`` - `Blatz-Ko model + `_. + For ``NPTS``, default = 1 and maximum = 1. + + * ``ETUBE`` - Extended tube model. Five constants ( ``NPTS`` = 5) are required. + + * ``EXF1`` - `Embedded fiber + `_ + directions. Three constants ( ``NPTS`` = 3) define the direction for each fiber. Up to five fibers ( + ``NPTS`` = 15) are allowed. + + * ``EX1`` - `Embedded fiber + `_ + strain energy potential. Two constants ( ``NPTS`` = 2) are used for each fiber corresponding to the + defined fiber directions. Undefined values default to zero. + + * ``EXA1`` - `Embedded fiber + `_ + compression strain energy potential. Two constants ( ``NPTS`` = 2) are used for each fiber + corresponding to the defined fiber directions. If not defined, the values specified via EX1 are used + for both tension and compression. + + * ``FOAM`` - `Hyperfoam (Ogden) model + `_. + For ``NPTS``, default = 1 and maximum is the number of terms in the energy function + + * ``GENT`` - `Gent model + `_. + For ``NPTS``, default = 3 and maximum = 3. + + * ``MOONEY`` - `Mooney-Rivlin model + `_ (default). You can choose a two-parameter Mooney-Rivlin model with ``NPTS`` = 2 + (default), or a three-, five-, or nine-parameter model by setting ``NPTS`` equal to one of these + values. + + * ``NEO`` - `Neo-Hookean model + `_. + For ``NPTS``, default = 2 and maximum = 2. + + * ``OGDEN`` - `Ogden model + `_. + For ``NPTS``, default = 1 and maximum is the number of terms in the energy function. + + * ``POLY`` - `Polynomial form model + `_. + For ``NPTS``, default = 1 and maximum is the number of terms in the energy function. + + * ``RESPONSE`` - `Experimental response function model + `_. + For ``NPTS``, default = 0 and maximum is such that ``NTEMP`` x ``NPTS`` + 2 = 1000. + + * ``YEOH`` - `Yeoh model + `_. + For ``NPTS``, default = 1 and maximum is the number of terms in the energy function. + + * ``USER`` - User-defined hyperelastic model. + + * ``References:`` - `Hyperelasticity + `_ + + .. _tbinterspec: + + * ``NTEMP :`` - Number of temperatures for which data will be provided. Default = 1. No maximum + limit. ``NTEMP`` is used only for user-defined contact interaction ( ``TBOPT`` = USER). + + * ``NPTS :`` - Number of data points to be specified. ``NPTS`` is used only for user-defined contact + interaction ( ``TBOPT`` = USER). + + * ``TBOPT :`` - Contact interaction options. + + The following options are valid only for general contact interactions specified via the :ref:`gcdef` + command: + * ``STANDARD`` - Standard unilateral contact (default). + + * ``ROUGH`` - Rough, no sliding. + + * ``NOSEPE`` - No separation (sliding permitted). + + * ``BONDED`` - Bonded contact (no separation, no sliding). + + * ``ANOSEP`` - No separation (always). + + * ``ABOND`` - Bonded (always). + + * ``IBOND`` - Bonded (initial contact). + + The following option is valid for all 2D and 3D contact elements: + * ``USER`` - User-defined contact interaction. + + * ``References:`` - `Contact Interaction + `_ + + `Defining Your Own Contact Interaction ( USERINTER) + `_ + + .. _tbjoinspec: + + * ``NTEMP:`` - Number of temperatures for which data will be provided. Default = 1. + + * ``NPTS:`` - Number of data points to be specified for a given temperature. ``NPTS`` is ignored if + ``TBOPT`` = STIF or DAMP. + + If Coulomb friction is specified, ``NPTS`` is used only for ``TBOPT`` = MUS1, MUS4, and MUS6. + + * ``TBOPT:`` - Joint element material options. + + Linear stiffness behavior: + * ``STIF`` - Linear stiffness. + + Nonlinear stiffness behavior: + * ``JNSA`` - Nonlinear stiffness behavior in all available components of relative motion for the + joint element. + + * ``JNS1`` - Nonlinear stiffness behavior in local UX direction only. + + * ``JNS2`` - Nonlinear stiffness behavior in local UY direction only. + + * ``JNS3`` - Nonlinear stiffness behavior in local UZ direction only. + + * ``JNS4`` - Nonlinear stiffness behavior in local ROTX direction only. + + * ``JNS5`` - Nonlinear stiffness behavior in local ROTY direction only. + + * ``JNS6`` - Nonlinear stiffness behavior in local ROTZ direction only. + + Linear damping behavior: + * ``DAMP`` - Linear damping. + + Nonlinear damping behavior: + * ``JNDA`` - Nonlinear damping behavior in all available components of relative motion for the joint + element. + + * ``JND1`` - Nonlinear damping behavior in local UX direction only. + + * ``JND2`` - Nonlinear damping behavior in local UY direction only. + + * ``JND3`` - Nonlinear damping behavior in local UZ direction only. + + * ``JND4`` - Nonlinear damping behavior in local ROTX direction only. + + * ``JND5`` - Nonlinear damping behavior in local ROTY direction only. + + * ``JND6`` - Nonlinear damping behavior in local ROTZ direction only. + + Friction Behavior: + * ``Coulomb friction coefficient -`` - The values can be specified using either :ref:`tbdata` ( + ``NPTS`` = 0) or :ref:`tbpt` ( ``NPTS`` is nonzero). + + * ``MUS1`` - Coulomb friction coefficient (stiction) in local UX direction only. + + * ``MUS4`` - Coulomb friction coefficient (stiction) in local ROTX direction only. + + * ``MUS6`` - Coulomb friction coefficient (stiction) in local ROTZ direction only, or + + Coulomb friction coefficient (stiction) for Spherical Joint. + + * ``Coulomb friction coefficient - Exponential Law -`` - Use :ref:`tbdata` to specify μ:sub:`s`, + μ:sub:`d`, and c for the exponential law. + + * ``EXP1`` - Exponential law for friction in local UX direction only. + + * ``EXP4`` - Exponential law for friction in local ROTX direction only. + + * ``EXP6`` - Exponential law for friction in local ROTZ direction only. + + Elastic slip: + * ``SL1`` - Elastic slip in local UX direction only. + + * ``SL4`` - Elastic slip in local ROTX direction only. + + * ``SL6`` - Elastic slip in local ROTZ direction only, or + + Elastic slip for Spherical Joint. + + * ``TMX1`` - Critical force in local UX direction only. + + * ``TMX4`` - Critical moment in local ROTX direction only. + + * ``TMX6`` - Critical moment in local ROTZ direction only. + + Stick-stiffness: + * ``SK1`` - Stick-stiffness in local UX direction only. + + * ``SK4`` - Stick-stiffness in local ROTX direction only. + + * ``SK6`` - Stick-stiffness in local ROTZ direction only, or + + Stick-stiffness for Spherical Joint. + + Interference fit force/moment: + * ``FI1`` - Interference fit force in local UX direction only. + + * ``FI4`` - Interference fit moment in local ROTX direction only. + + * ``FI6`` - Interference fit moment in local ROTZ direction only. + + * ``References:`` - `MPC184 Joint + `_ + + .. _tbjointedrockspec: + + * ``NTEMP :`` - Not used. + + * ``NPTS :`` - Not used. + + * ``TBOPT :`` - * ``BASE`` - Base material parameters. + + * ``RCUT`` - Base material tension cutoff. + + * ``RSC`` - Residual strength coupling. + + * ``FPLANE`` - Joint parameters. + + * ``FTCUT`` - Joint tension cutoff. + + * ``FORIE`` - Joint orientation. + + * ``MSOL`` - `Material solution option + `_. + + * ``References:`` - `Jointed Rock + `_ + + .. _tbmohrcoulombspec: + + * ``NTEMP :`` - Not used. + + * ``NPTS :`` - Not used. + + * ``TBOPT :`` - * ``BASE`` - Mohr-Coulomb material parameters. + + * ``RCUT`` - Tension cutoff. + + * ``RSC`` - Residual strength coupling. + + * ``POTN`` - Plastic potential. + + * ``FRICTION`` - Friction angle scaling. + + * ``COHESION`` - Cohesion scaling. + + * ``TENSION`` - Tension strength scaling. + + * ``DILATATION`` - Dilatancy angle scaling. + + * ``MSOL`` - `Material solution option + `_. + + * ``References:`` - `Mohr-Coulomb + `_ + + .. _tbmelasspec: + + * ``NTEMP :`` - Number of temperatures for which data will be provided. + + * ``NPTS :`` - Number of data points to be specified for a given temperature. + + * ``TBOPT :`` - Not used. + + * ``References:`` - `Multilinear Elasticity + `_ + + .. _tbmigrspec: + + * ``NTEMP :`` - Not used. + + * ``NPTS :`` - Not used. + + * ``TBOPT :`` - Migration model options. + + * ``0`` - Atomic (or ion) flux (default). + + * ``1`` - Vacancy flux. + + * ``References:`` - `Migration Model + `_ + + `Electric-Diffusion Analysis + `_ + + `Thermal-Diffusion Analysis + `_ + + `Structural-Diffusion Analysis + `_ + + `Electric-Diffusion Coupling + `_ + + `Thermal-Diffusion Coupling + `_ + + `Structural-Diffusion Coupling + `_ + + .. _TBmplanespec: + + * ``NTEMP :`` - The number of temperatures for which data will be provided. Default = 1. Maximum is + such that ``NTEMP`` x ``NPTS`` = 1000. + + * ``NPTS :`` - The number of data points to be specified for a given temperature. Default = 6. + Maximum is such that ``NTEMP`` x ``NPTS`` = 1000. + + * ``TBOPT :`` - Microplane model options: + + * ``ORTH`` - `Elastic microplane material with damage + `_ model (default). + + * ``DPC`` - `Coupled damage-plasticity + `_ microplane + model. + + * ``NLOCAL`` - `Nonlocal parameters + `_. + + * ``References:`` - `Microplane + `_ + + .. _TBDTSpNLISjwf070600: + + * ``NTEMP :`` - Number of temperatures for which data will be provided. Default = 1. + + * ``NPTS :`` - Number of data points to be specified for a given temperature. Default = 4. Maximum = + 4. + + * ``TBOPT :`` - Isotropic hardening options. + + * ``VOCE`` - Voce hardening law (default). + + * ``POWER`` - Power hardening law. + + * ``References:`` - `Nonlinear Isotropic Hardening + `_ + + .. _TBperf_model_spec: + + * ``NTEMP:`` - Not used. + + * ``NPTS:`` - Not used. + + * ``TBOPT:`` - Equivalent fluid model options: + + * ``JCA`` - Johnson-Champoux-Allard model + + * ``DLB`` - Delaney-Bazley model + + * ``MIKI`` - Miki model + + * ``ZPRO`` - Complex impedance and propagating constant model + + * ``CDV`` - Complex density and velocity model + + Poroelastic acoustic material: + + * ``PORO`` - Poroelastic material model + + Transfer admittance matrix options: + + * ``YMAT`` - General transfer admittance matrix model + + * ``SGYM`` - Transfer admittance matrix model of square grid structure + + * ``HGYM`` - Transfer admittance matrix model of hexagonal grid structure + + * ``References:`` - `Perforated Media + `_ + + `Equivalent Fluid of Perforated Materials + `_ + + `Poroelastic Acoustics + `_ + + `Perforated Material + `_ + + `Trim Element with Transfer Admittance Matrix + `_ + + See :ref:`tbfield` for more information about defining temperature and/or frequency-dependent + properties. + + .. _TBDTSpPIEZjwf070600: + + * ``NTEMP :`` - Not used. + + * ``NPTS :`` - Not used. + + * ``TBOPT :`` - Piezoelectric matrix options. + + * ``0`` - Piezoelectric stress matrix [e] (used as supplied) + + * ``1`` - Piezoelectric strain matrix [d] (converted to [e] form before use) + + * ``References:`` - `Piezoelectricity + `_ + + `Piezoelectric Analysis + `_ + + .. _tbplasticspec: + + * ``NTEMP:`` - Not used. + + * ``NPTS:`` - Not used. + + * ``TBOPT:`` - Plasticity option: + + * ``BISO`` - `Bilinear isotropic hardening plasticity + `_. + + * ``BKIN`` - `Bilinear kinematic hardening plasticity + `_. + + * ``MISO`` - `Multilinear isotropic hardening plasticity + `_. + + * ``KINH`` - `Multilinear kinematic hardening plasticity + `_. + + The number of points ( :ref:`tbpt` commands issued) is limited to 100 for this option. + + * ``KSR2`` - `Kinematic static recovery + `_. + + * ``ISR`` - `Isotropic static recovery + `_. + + * ``References:`` - `Rate-Independent Plasticity + `_ + + .. _tbporelasspec: + + * ``NTEMP :`` - Not used. + + * ``NPTS :`` - Not used. + + * ``TBOPT :`` - * ``POISSON`` - Porous elasticity model.. + + * ``References:`` - `Porous Elasticity + `_ + + .. _TBpmspec: + + * ``NTEMP :`` - The number of temperatures. Default = 1. The maximum must be a value such that ( + ``NTEMP`` x ``NPTS`` ) <= 1000. + + * ``NPTS :`` - The number of material constants. Default = 4. The maximum must be a value such that + ( ``NTEMP`` x ``NPTS`` ) <= 1000. + + * ``TBOPT :`` - Porous media options: + + * ``PERM`` - Permeability + + * ``BIOT`` - Biot coefficient + + * ``SP`` - Solid property + + * ``FP`` - Fluid property + + * ``DSAT`` - Degree-of-saturation table + + * ``RPER`` - Relative-permeability table + + * ``GRAV`` - Gravity magnitude + + * ``References:`` - `Porous Media Material Properties + `_ + + `Porous Media Flow + `_ + + `Structural-Pore-Fluid-Diffusion-Thermal Analysis + `_ + + `Applying Initial Degree of Saturation and Relative Permeability + `_ + + See also `VM260 + `_. + + .. _tbpronyspecjmb: + + * ``NTEMP:`` - Number of temperatures for which data will be provided. Default = 1. + + Unused for ``TBOPT`` = EXPERIMENTAL. + + * ``NPTS:`` - Defines the number of Prony series pairs for ``TBOPT`` = SHEAR or ``TBOPT`` = BULK. + Default = 1. + + Unused for ``TBOPT`` = INTEGRATION and ``TBOPT`` = EXPERIMENTAL. + + * ``TBOPT:`` - Defines the behavior for viscoelasticity. + + * ``SHEAR`` - Shear Prony series. + + * ``BULK`` - Bulk Prony series. + + * ``INTEGRATION`` - Stress update algorithm. + + * ``EXPERIMENTAL`` - Complex modulus from experimental data. + + * ``References:`` - `Viscoelasticity + `_ + + .. _tbpzrsspec: + + * ``NTEMP:`` - Not used. + + * ``NPTS:`` - Not used. + + * ``TBOPT:`` - Piezoresistive matrix options + + * ``0`` - Piezoresistive stress matrix (used as supplied) + + * ``1`` - Piezoresistive strain matrix (used as supplied) + + * ``References:`` - `Piezoresistivity + `_ + + `Piezoresistive Analysis + `_ + + .. _TBDTSpRATEjwf070600: + + * ``NTEMP :`` - The number of temperatures for which data will be provided. Default is 1. Maximum is + such that ``NTEMP`` x ``NPTS`` = 1000. + + * ``NPTS :`` - The number of data points to be specified for a given temperature. Default = 2. + Maximum is such that ``NTEMP`` x ``NPTS`` = 1000. + + * ``TBOPT :`` - Rate-dependent viscoplasticity options. + + * ``PERZYNA`` - Perzyna option (default). + + * ``PEIRCE`` - Peirce option. + + * ``EVH`` - Exponential visco-hardening option. + + * ``ANAND`` - Anand option. + + * ``References:`` - `Rate-Dependent Plasticity (Viscoplasticity) + `_ + + `Viscoplasticity Model + `_ + + `Rate-Dependent Plasticity + `_ + + See also `Combining Material Models + `_ + + .. _tbsdampspec: + + * ``NTEMP:`` - Number of temperatures for which data will be provided. Default = 1. + + * ``NPTS:`` - Number of properties to be defined for the material option. Default = 1 for each + material damping option ( ``TBOPT`` ) selected. + + * ``TBOPT:`` - Material damping options: + + * ``STRU or 1`` - Structural damping coefficient (default). + + * ``ALPD or 2`` - Rayleigh mass proportional material damping. + + * ``BETD or 3`` - Rayleigh stiffness proportional material damping. + + * ``References:`` - `Material Damping + `_ + + `Full Harmonic Analysis + `_ + + `Damping Matrices + `_ + + .. _tbshiftspecjmb: + + * ``NTEMP:`` - Allows one temperature for which data will be provided. + + * ``NPTS:`` - Number of material constants to be entered as determined by the `shift function + `_ + specified via ``TBOPT``. Not used for ``TBOPT`` = PLIN. + + * ``3`` - for ``TBOPT`` = WLF + + * ``2`` - for ``TBOPT`` = TN + + * ``n, :sub:`f``` - for ``TBOPT`` = FICT, where ``n`` :sub:`f` is the number of partial fictive + temperatures + + * ``TBOPT:`` - Shift function: + + * ``WLF`` - `Williams-Landel-Ferry + `_. + + * ``TN`` - `Tool-Narayanaswamy + `_. + + * ``FICT`` - `Tool-Narayanaswamy + `_ with + fictive temperature. + + * ``PLIN`` - `Piecewise linear + `_. + + * ``USER`` - User-defined. + + * ``References:`` - `Viscoelasticity + `_ + + .. _tbsintspec: + + * ``NTEMP:`` - Not used. + + * ``NPTS:`` - Not used. + + * ``TBOPT:`` - Sintering options: + + * ``INIT`` - `Initial conditions + `_ : relative + density, particle diameter, and grain-size diameter. The initial relative density can alternatively + be specified as a location-varying initial state ( :ref:`inistate` ). + + * ``PARAM`` - `Sintering activation temperature + `_ and mode + specification. + + * ``STRESS`` - Sintering stress coefficients. + + * ``VSCOEF`` - `Viscosity coefficients + `_. Mutually + exclusive with VSTABLE. + + * ``VSTABLE`` - Table of viscosity values. Mutually exclusive with VSCOEF. + + * ``GROWTH`` - `Grain-growth + `_ parameters. + + * ``RIEDEL`` - Selects the Riedel sintering model (default) and defines the viscous moduli + coefficients. + + * ``SOVS`` - Selects the Skorohold-Olevsky sintering model and defines the viscous moduli + coefficients. + + * ``ANICONST`` - `Orthotropic factors + `_ to be applied + to the viscous bulk and shear moduli. The factors remain constant throughout densification. + + * ``References:`` - `Sintering + `_ + + .. _TBDTSpSMA: + + * ``NTEMP :`` - Number of temperatures for which data will be provided. Default = 1. + + * ``NPTS :`` - Number of data points to be specified for a given temperature. Default = 7 if + ``TBOPT`` = SUPE or MEFF, 2 if ``TBOPT`` = METE, 6 if ``TBOPT`` = METL or METH, and 7 if ``TBOPT`` = + MEPD. + + * ``TBOPT :`` - Shape memory model option: + + SUPE -- `Superelasticity + `_ option (default). + + MEFF -- `Shape memory effect + `_ option. + + METE - Shape memory effect with `plasticity + `_ + option: elastic phase-dependent and thermal expansion. + + METL - Shape memory effect with `plasticity + `_ + option: limits of transformation in strain-stress-temperature space. + + METH - Shape memory effect with `plasticity + `_ + option: transformation hardening. + + MEPD - Shape memory effect with `plasticity + `_ + option: plastic response. + + METC - Shape memory effect with `plasticity + `_ + option: tension-compression asymmetry response and hysteresis response. + + * ``Reference:`` - `Shape Memory Alloy (SMA) + `_ + + .. _tbsoilspec: + + * ``NTEMP :`` - Not used. + + * ``NPTS :`` - Not used. + + * ``TBOPT :`` - * ``CAMCLAY`` - Modified Cam-clay material model. + + * ``MSOL`` - `Material solution option + `_. + + * ``References:`` - `Cam-clay + `_ + + .. _TBDTSpSTATjwf070600: + + When ``Lab`` = STATE, state variable specifications affect user-defined material models. The + subroutine in use depends on the element type used when ``Lab`` = USER is specified. + + * ``NTEMP :`` - Not used. + + * ``NPTS :`` - Number of state variables. + + * ``TBOPT :`` - Not used. + + * ``References:`` - `Customizing Material Behavior + `_ + + .. _TBDTSpSWELjwf070600: + + * ``NTEMP :`` - Number of temperatures for which data will be provided. The maximum value of NTEMP + is such that NTEMP x NPTS = 1000 + + * ``NPTS :`` - Number of data points to be specified for a given temperature. The maximum value of + NPTS is such that NPTS x NTEMP = 1000. + + * ``TBOPT :`` - Swelling model options: + + * ``LINEAR`` - Linear swelling function. + + * ``EXPT`` - Exponential swelling function. + + * ``USER`` - User-defined swelling function. Define the swelling function via subroutine + userswstrain (described in the `Programmer's Reference `_). Define temperature-dependent constants via the + :ref:`tbtemp` and :ref:`tbdata` commands. For solution-dependent variables, define the number of + variables via the :ref:`tb`,STATE command. + + * ``References:`` - `Swelling + `_ + + `Swelling Model + `_ + + .. _tbthermspec: + + * ``NTEMP :`` - Not used. + + * ``NPTS :`` - Not used. + + * ``TBOPT :`` - Thermal properties: + + * ``COND`` - Thermal conductivity. + + * ``ENTH`` - Enthalpy. Enthalpy must be a function of temperature only (see :ref:`Considerations for + Enthalpy). ` + + * ``SPHT`` - Specific heat. For `porous media + `_, + solid-skeleton specific heat. + + * ``FLSPHT`` - Fluid-specific heat for `porous media + `_. + + * ``References:`` - `Thermal Properties + `_ + + `Porous Media Mechanics + `_ + + .. _tbtnmspec: + + * ``NTEMP :`` - Not used. + + * ``NPTS :`` - Not used. + + * ``TBOPT :`` - Three-network model material options: + + * ``NETA`` - Network A properties. + + * ``NETB`` - Network B properties. + + * ``NETC`` - Network C properties. + + * ``FLOW`` - Network flow properties. + + * ``TDEP`` - Temperature-dependence factors. + + * ``LOCK`` - Chain-locking stretch. + + * ``BULK`` - Bulk modulus. + + * ``References:`` - `Three-Network Model ( TB,TNM) + `_ + + .. _TBDTSpUSERjwf070600: + + When ``Lab`` = USER, the :ref:`tb` command activates either the `UserMat + `_ (user-defined + material) or the `UserMatTh + `_ (user-defined + thermal material) subroutine automatically. The subroutine activated depends on the element type + used. + + * ``NTEMP :`` - Number of temperatures for which data will be provided. Default = 1. + + * ``NPTS :`` - Number of data points to be specified for a given temperature. Default = 48. + + * ``TBOPT:`` - User-defined material model ( `UserMat + `_ ) or thermal + material model ( `UserMatTh + `_ ) options: + + * ``NONLINEAR`` - Nonlinear iterations are applied (default). + + * ``LINEAR`` - Nonlinear iterations are not applied. This option is ignored if there is any other + nonlinearity involved, such as contact, geometric nonlinearity, etc. + + * ``MXUP`` - This option indicates a `UserMat material model + `_ to be used + with `mixed u-P element formulation + `_ + for material exhibiting incompressible or nearly incompressible behavior. + + * ``THERM`` - Thermal material model ( UserMatTh ) for a coupled-field analysis using elements + ``SOLID225``, ``SOLID226`` and ``SOLID227`` with thermal degrees of freedom. Use this option in a + coupled structural-thermal analysis to specify a user-defined thermal material model ( `UserMatTh + `_ ) + independently of the user-defined structural material model ( `UserMat + `_ ). + + * ``References:`` - `Customizing Material Behavior + `_ + + `Subroutine UserMat (Creating Your Own Material Model) + `_ + + `Subroutine UserMatTh (Creating Your Own Thermal Material Model) + `_ + + .. _tbwearspec: + + * ``NTEMP:`` - Number of temperatures for which data will be provided. + + * ``NPTS:`` - Number of data points to be specified for the wear option. This value is set + automatically based on the selected wear option ( ``TBOPT`` ). If ``TBOPT`` is not specified, the + default becomes ``NPTS`` = 5 and ``TBOPT`` = ARCD. + + * ``TBOPT:`` - Wear model options: + + * ``ARCD`` - Archard wear model (default). + + * ``USER`` - User-defined wear model. + + * ``AUTS`` - Automatic scaling of wear increment. Must be used in conjunction with one of the wear + models ( ``TBOPT`` = ARCD or USER). + + * ``References:`` - `Contact Surface Wear + `_ + + `Contact Surface Wear + `_ + + See also :ref:`tbfield` for more information about defining temperature and/or time-dependent + properties. + + .. _xtalspec: + + * ``NTEMP:`` - Unused. + + * ``NPTS:`` - Unused. + + * ``TBOPT:`` - Crystal plasticity material options: + + * ``ORIE`` - Crystal orientation. + + * ``NSLFAM`` - Number of slip families. + + * ``FORM`` - Formulation number. + + * ``XPARAM`` - Crystal characteristic parameters. + + * ``HARD`` - Slip system hardness properties. + + * ``FLFCC`` - Face-centered cubic (FCC) flow parameters. + + * ``FLHCP`` - Hexagonal closed packed (HCP) flow parameters. + + * ``FLBCC`` - Body-centered cubic (BCC) flow parameters. + + * ``Reference:`` - `Crystal Plasticity + `_ + + .. _TB_notes: + + :ref:`tb` activates a data table for use by subsequent :ref:`tbdata` or :ref:`tbpt` commands. The + table space is initialized to zero values. Data from this table are used for most nonlinear material + descriptions as well as for special input for some elements. + + For a list of elements supporting each material model ( ``Lab`` value), see `Material Model Element + Support + `_ + + For information about linear material property input, see :ref:`mp`. + + This command is also valid in SOLUTION. + + .. _TB_enthalpy_notes: + + Considerations for Enthalpy ( ``TBOPT`` = ENTH) + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + + * To ensure correct results, you must define enthalpy over a large enough temperature range to span + all computed temperatures during the solution. The :ref:`tb` command does not extrapolate enthalpy + values beyond the specified temp range like the :ref:`mp` command does. + + * If both the :ref:`tb` and :ref:`mp` commands are used to specify enthalpy values, enthalpy values + defined via the :ref:`tb` command are used and those defined via the :ref:`mp` command are + ignored. + + .. _TBprodRest: + + This command contains some tables and extra information which can be inspected in the original + documentation pointed above. + """ + command = f"TB,{lab},{matid},{ntemp},{npts},{tbopt},,{funcname}" + return self.run(command, **kwargs) + + def tbcopy(self, lab: str = "", matf: str = "", matt: str = "", **kwargs): + r"""Copies a data table from one material to another. + + Mechanical APDL Command: `TBCOPY `_ + + Parameters + ---------- + lab : str + Data table label. See the :ref:`tb` command for valid labels, and see :ref:`TBCOPY_notes` for + ``Lab`` = ALL. + + matf : str + Material reference number where data table is to be copied from. + + matt : str + Material reference number where data table is to be copied to. + + Notes + ----- + + .. _TBCOPY_notes: + + The :ref:`tbcopy` command, with ``Lab`` = ALL, copies all of the nonlinear data defined by the + :ref:`tb` command. If you copy a model that includes both yield behavior constants and linear + constants (for example, a BKIN model), :ref:`tbcopy`,ALL and :ref:`mpcopy` are used together to copy + the entire model. All input data associated with the model is copied, that is, all data defined + through the :ref:`tb` and :ref:`mp` commands. + + Also, if you copy a material model using the `Material Model Interface + `_ + ( Edit> Copy ), both the commands :ref:`tbcopy`,ALL and :ref:`mpcopy` are issued, regardless of + whether the model includes linear constants only, or if it includes a combination of linear and + yield behavior constants. + + This command is also valid in SOLUTION. + """ + command = f"TBCOPY,{lab},{matf},{matt}" + return self.run(command, **kwargs) + + def tbdata( + self, + stloc: str = "", + c1: str = "", + c2: str = "", + c3: str = "", + c4: str = "", + c5: str = "", + c6: str = "", + **kwargs, + ): + r"""Defines data for the material data table. + + Mechanical APDL Command: `TBDATA `_ + + Parameters + ---------- + stloc : str + Data values assigned to six locations starting with ``STLOC``. If a value is already in this + location, it is redefined. A blank value leaves the existing value unchanged. + + c1 : str + Data values assigned to six locations starting with ``STLOC``. If a value is already in this + location, it is redefined. A blank value leaves the existing value unchanged. + + c2 : str + Data values assigned to six locations starting with ``STLOC``. If a value is already in this + location, it is redefined. A blank value leaves the existing value unchanged. + + c3 : str + Data values assigned to six locations starting with ``STLOC``. If a value is already in this + location, it is redefined. A blank value leaves the existing value unchanged. + + c4 : str + Data values assigned to six locations starting with ``STLOC``. If a value is already in this + location, it is redefined. A blank value leaves the existing value unchanged. + + c5 : str + Data values assigned to six locations starting with ``STLOC``. If a value is already in this + location, it is redefined. A blank value leaves the existing value unchanged. + + c6 : str + Data values assigned to six locations starting with ``STLOC``. If a value is already in this + location, it is redefined. A blank value leaves the existing value unchanged. + + Notes + ----- + + .. _TBDATA_notes: + + Defines data for the table specified via the most recent :ref:`tb` command (at the temperature + specified via the most recent :ref:`tbtemp` or :ref:`tbfield` command, if applicable). + + The type of data table specified determines the number of data values needed in :ref:`tbdata`. Data + values are interpolated for temperatures or other specified field variables that fall between user- + defined :ref:`tbtemp` or :ref:`tbfield` values. + + You can specify values for up to six constants per :ref:`tbdata` command. Issue the command multiple + times if needed. + + Some elements (for example, ``SOLID226`` ) support tabular input for some linear materials. For a + list of elements supporting tabular material properties and associated primary variables, see + `Defining Linear Material Properties Using Tabular Input + `_ + + This command is also valid in SOLUTION. + """ + command = f"TBDATA,{stloc},{c1},{c2},{c3},{c4},{c5},{c6}" + return self.run(command, **kwargs) + + def tbdele( + self, + lab: str = "", + mat1: str = "", + mat2: str = "", + inc: str = "", + tbopt: str = "", + **kwargs, + ): + r"""Deletes previously defined material data tables. + + Mechanical APDL Command: `TBDELE `_ + + Parameters + ---------- + lab : str + Material data table label to delete. (See :ref:`tb` for valid ``Lab`` values.) + + mat1 : str + Deletes data tables for materials ``MAT1`` to ``MAT2`` (default = ``MAT1`` ) in steps of ``INC`` + (default = 1). + + mat2 : str + Deletes data tables for materials ``MAT1`` to ``MAT2`` (default = ``MAT1`` ) in steps of ``INC`` + (default = 1). + + inc : str + Deletes data tables for materials ``MAT1`` to ``MAT2`` (default = ``MAT1`` ) in steps of ``INC`` + (default = 1). + + tbopt : str + Material data table option. (See :ref:`tb` for valid ``TBOPT`` values for the given ``Lab``.) + + Notes + ----- + + .. _TBDELE_notes: + + If ``Lab`` = ALL, delete all material data tables. + + If ``MAT1`` = ALL, ``MAT2`` and ``INC`` are ignored and all material data tables are deleted. + + If ``TBOPT`` is specified, the material data table corresponding to ``Lab`` is deleted if it also + has the specified table option. If ``TBOPT`` is not specified, all material data tables + corresponding to ``Lab`` are deleted. ``TBOPT`` is ignored when ``Lab`` = ALL. + + This command is also valid in SOLUTION, but is not intended for changing material behaviors between + load steps. + """ + command = f"TBDELE,{lab},{mat1},{mat2},{inc},{tbopt}" + return self.run(command, **kwargs) + + def tbeo(self, par: str = "", value: str = "", **kwargs): + r"""Sets special options or parameters for material data tables. + + Mechanical APDL Command: `TBEO `_ + + Parameters + ---------- + par : str + Parameter name: + + * ``CAPCREEPREG`` - Available for the viscoplasticity/creep model ( :ref:`tb`, CREEP ), allows two + creep models to be specified via the same material ID when used with the Extended Drucker-Prager + model ( :ref:`tb`, EDP ). + + * ``FDCS`` - Coordinate system to use with location (XCOR, YCOR, ZCOR) or displacement (UX, UY, UZ) + field variables. + + * ``NEGSLOPE`` - Controls whether negative tangent slopes of the stress-strain curve are allowed for + multilinear `kinematic + `_ or `isotropic + `_ hardening in a + `rate-independent plasticity + `_ + analysis. + + value : str + Parameter value: + + When ``Par`` = CAPCREEPREG -- + + * ``SHEA`` - Use the shear stress-state creep model with the Extended Drucker-Prager model. + + * ``COMP`` - Use the compaction stress-state creep model with the Extended Drucker-Prager model. + + When ``Par`` = FDCS -- + + * Any predefined, user-defined, or custom ( :ref:`local` or :ref:`cs` ) Cartesian coordinate system + number. + + When ``Par`` = NEGSLOPE -- + + * ``0`` - Error-trap negative tangent slopes of the stress-strain curve (default). + + * ``1`` - Allow negative tangent slopes of the stress-strain curve. + + Notes + ----- + + .. _TBEO_notes: + + Issue the :ref:`tbeo` command after activating the material data table ( :ref:`tb` ) but before + defining data for the table ( :ref:`tbdata` ) or a point on a nonlinear data curve ( :ref:`tbpt` ). + + If the defined material data table has subtables, issue the :ref:`tbeo` command for each desired + subtable. + """ + command = f"TBEO,{par},{value}" + return self.run(command, **kwargs) + + def tbfield(self, type_: str = "", value: str = "", **kwargs): + r"""Defines values of field variables for material data tables. + + Mechanical APDL Command: `TBFIELD `_ + + Parameters + ---------- + type_ : str + Field variable type: + + * ``CYCLE`` - A healing cycle number is to be specified in ``Value``. + + * ``FREQ`` - A frequency is to be specified in ``Value``. + + * ``NPRES`` - A normal pressure is to be specified in ``Value``. + + * ``PLSR`` - An equivalent plastic strain rate is to be specified in ``Value``. + + * ``PPRE`` - Pressure degree of freedom is to be specified in ``Value``. + + * ``SLDA`` - A total sliding distance (algebraic) is to be specified in ``Value``. + + * ``SLDI`` - A total sliding distance (absolute) is to be specified in ``Value``. + + * ``SLRV`` - A sliding velocity is to be specified in ``Value``. + + * ``SRAT`` - Stress ratio of fatigue load cycle is to be specified in ``Value``. + + * ``TEMP`` - A temperature is to be specified in ``Value``. + + * ``TIME`` - A time is to be specified in ``Value``. + + * ``UFXX`` - `User-defined + `_ field + variable (UF01,UF02,..., UF09). + + * ``UX / UY / UZ`` - Displacements in the global/local X, Y, or Z coordinate system, respectively, + are to be specified in ``Value``. + + * ``XCOR / YCOR / ZCOR`` - X, Y and Z locations, respectively, are to be specified in ``Value``.. + + value : str + The field value to be referenced. + + Notes + ----- + Define your data tables as field-variable-dependent (via the appropriate :ref:`tb` command), then + issue :ref:`tbfield` to define the field values. + + Issue this command multiple times to enter values for different field variables. + + Define data values in ascending order for all field quantities. If a field value is to be held + constant, define it only once; subsequent definitions are ignored. + + No limit exists on the number of values that you can specify. The specified field value remains + active until the next :ref:`tbfield` command is input. + + After you have defined the field value(s), define your data for the data tables ( :ref:`tbdata` ). + + For more information about the interpolation scheme used for field-dependent material properties, + see `Understanding Field Variables + `_ + + For more information about using :ref:`tbfield` with :ref:`tb`,ELASTIC or :ref:`tb`,SDAMP, see + `Full Harmonic Analysis + `_ + + The TEMP (temperature) predefined field variable is available for all material models defined via + :ref:`tb`, ``Lab``. + + Several other field variables are available for use with some material models (when used with + specific element types), such as TIME (time), PPRE (pore-pressure), XCOR / YCOR / ZCOR (location), + UX / UY / UZ (displacement), and UF01 - UF09 ( `user-defined + `_ ). + + The field variables can be defined in the global coordinate system or in any local or user-defined + coordinate system. + + For more information, see `Predefined Field Variables + `_ + """ + command = f"TBFIELD,{type_},{value}" + return self.run(command, **kwargs) + + def tbin( + self, + oper: str = "", + par1: str = "", + par2: str = "", + par3: str = "", + par4: str = "", + **kwargs, + ): + r"""Sets parameters used for `interpolation + `_ of the + material data tables. + + Mechanical APDL Command: `TBIN `_ + + Parameters + ---------- + oper : str + Operation to perform: + + * :ref:`ALGO ` - Specifies the interpolation algorithm to use for the subtable (or + table if the material data table has only one subtable) being defined. + + * :ref:`BNDS ` - Specifies the maximum and minimum bounds for individual field + variables. + + * :ref:`CACH ` - Enables or disables caching of interpolated data for better + performance. + + * :ref:`DEFA ` - Specifies the default value of the user-defined field variable used + for interpolation (if no value was specified). + + * :ref:`EXTR ` - Controls extrapolation options. + + * :ref:`NORM ` - Scales the field variables before interpolation. + + * :ref:`SCALE ` - Interpolates :ref:`tb` -based material parameters in the linear- or + natural-log scale. + + 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. + + Other Parameters + ---------------- + **Interpolation Parameters for Oper= ALGO** + + .. _tbinoperalgo: + + * ``Par1`` - Interpolation algorithm: + + * `LINEAR + `_ + - Linear 1D / 2D (default). + * `LMUL + `_ + - Linear-multivariate interpolation (multidimensional). + + ``Par1`` = LINEAR is available for all material models. The remaining options are limited to a + subset of material models. For more information, see. + + **Interpolation Parameters for Oper= BNDS** + + .. _tbinoperbnds: + + * ``Par1`` - The field variable on which the operation is being applied. + + * ``Par2`` - Lower bound of the field variable. + + * ``Par3`` - Upper bound of the field variable. + + **Interpolation Parameters for Oper= CACH** + + .. _tbinopercach: + + * ``Par1`` - Reserved for future use. + + * ``Par2`` - Enable or disable caching of interpolated material parameters. Enable for better + performance. + + * OFF - Disable (default). + * ON - Enable. + + **Interpolation Parameters for Oper= DEFA** + + .. _tbinoperdefa: + + * ``Par1`` - The field variable on which the operation is being applied. + + * ``Par2`` - Default value of the field variable for which an initial value was not specified. + + **Interpolation Parameters for Oper= EXTR** + + .. _tbinoperextr: + + * ``Par1`` - Reserved for future use. + + * ``Par2`` - Set extrapolation/projection options for interpolating material parameters. + + * OFF / BBOX- Projects to the hyper-rectangular bounding box (default). An error occurs if query + points exist outside the convex hull of points but inside the hyper-rectangular bounding box. + * PHULL - Projects to the convex hull of points if a point is located outside the convex hull + surface. + + :ref:`tbin`,EXTR is supported for the `linear multivariate + `_ + interpolation algorithm only. + + **Interpolation Parameters for Oper= NORM** + + .. _tbinopernorm: + + * ``Par1`` - Reserved for future use. + + * ``Par2`` - Enable or disables field-variable normalization for interpolation. + + * OFF - Disable. + * ON - Enable (default). + + **Interpolation Parameters for Oper= SCALE** + + .. _tbinoperscale: + + * ``Par1`` - Independent variable, which can be any field variable specified via the :ref:`tbfield` + command. + + * ``Par2`` - Index of any material parameter specified via the :ref:`tbdata` command. + + * ``Par3`` - Scale to use for the independent variable. Valid options are LINEAR (linear) or LOG + (logarithmic). + + * ``Par4`` - Scale to use for the dependent variable (the material parameter specified via ``Par2`` + ). Valid options are LINEAR (linear) or LOG (logarithmic). + + Notes + ----- + + .. _TBIN_notes: + + For a list of the supported material data tables ( :ref:`tb` ), see `Logarithmic Interpolation and + Scaling `_ + + ``Oper`` = DEFA, BNDS, NORM and CACH are supported for the `linear multivariate + `_ + ( :ref:`tbin`,ALGO,LMUL) interpolation algorithm only. + """ + command = f"TBIN,{oper},{par1},{par2},{par3},{par4}" + return self.run(command, **kwargs) + + def tblist(self, lab: str = "", mat: str = "", **kwargs): + r"""Lists the material data tables. + + Mechanical APDL Command: `TBLIST `_ + + Parameters + ---------- + lab : str + Data table label. (See the :ref:`tb` command for valid labels.) Defaults to the active table. If + ALL, list data for all labels. + + mat : str + Material number to be listed (defaults to the active material). If ALL, list data tables for all + materials. + + Notes + ----- + + .. _TBLIST_notes: + + This command is a utility command, valid anywhere. + """ + command = f"TBLIST,{lab},{mat}" + return self.run(command, **kwargs) + + def tbmodif(self, row: str = "", col: str = "", value: str = "", **kwargs): + r"""Modifies data for the material data table (GUI). + + Mechanical APDL Command: `TBMODIF `_ + + Parameters + ---------- + row : str + The row and column numbers of the table entry to be modified. + + col : str + The row and column numbers of the table entry to be modified. + + value : str + The new value to be used in the ``ROW``, ``COL`` location. + + Notes + ----- + + .. _TBMODIF_notes: + + The :ref:`tbmodif` command modifies data for the table specified on the last :ref:`tb` command. + + For temperature-dependent data, the command uses the temperature specified via the last + :ref:`tbtemp` command. + + The command is generated by the program's Graphical User Interface (GUI). It appears in the log file + ( :file:`Jobname`.LOG) if a :ref:`tb` material data table is graphically edited in spreadsheet + fashion. The command is not intended to be typed in directly during an analysis session (although it + can be included in an input file for batch input or for use with :ref:`input` ). + + The command supports the following material data tables ( :ref:`tb`, ``Lab`` values): + + * ANEL - Anisotropic elasticity + * AVIS - Anisotropic viscosity + * CFOAM - Crushable foam + * DLST - Anisotropic dielectric loss tangent + * DPER - Anisotropic electric permittivity + * ELST - Anisotropic elastic loss tangent + * FCON - Fluid conductance data + * GASKET - Gasket + * GURSON - Gurson pressure-dependent plasticity + * HFLM - Film coefficient data + * HILL - Hill anisotropy + * JOIN - Joint + * MIGR - Migration + * NLISO - Voce isotropic hardening law + * PIEZ - Piezoelectric matrix + * PLASTIC ( ``TBOPT`` = BISO) - Bilinear isotropic hardening + * PLASTIC ( ``TBOPT`` = BKIN) - Bilinear kinematic hardening + * PRONY - Prony series + * PZRS - Piezoresistivity + * SHIFT - Shift function for viscoelastic materials + * SMA - Shape memory alloy + * STATE - User-defined state variables + + This command is also valid in SOLUTION. + """ + command = f"TBMODIF,{row},{col},{value}" + return self.run(command, **kwargs) + + def tbplot( + self, + lab: str = "", + mat: str = "", + tbopt: str = "", + temp: str = "", + segn: str = "", + **kwargs, + ): + r"""Displays the material data table. + + Mechanical APDL Command: `TBPLOT `_ + + Parameters + ---------- + lab : str + Data table label. Valid labels are: MELAS, BKIN, BISO, BH, GASKET, and JOIN. Defaults to the + active table label. For B-H data, also valid are: NB to display NU-B :sup:`2`, MH to display MU + vs. H, and SBH, SNB, SMH to display the slopes of the corresponding data. + + mat : str + Material number to be displayed (defaults to the active material). + + tbopt : str + Gasket material or joint element material option to be plotted. + + The following gasket material options are valid only when ``Lab`` = GASKET: + + * ``ALL`` - Plots all gasket data. + + * ``COMP`` - Plots gasket compression data only. + + * ``LUNL`` - Plots gasket linear unloading data with compression curve. + + * ``NUNL`` - Plots gasket nonlinear unloading data only. + + The following joint element material options are valid only when Lab = JOIN: + + * ``JNSA`` - Plots nonlinear stiffness data that is applicable to all relevant directions. + + * ``JNS, n`` - Plots only the specified nonlinear stiffness data. The n can be 1, 4, or 6. For + example, JNS4 plots only the nonlinear stiffness data specified in the local direction 4 (ROTX). + + * ``JNDA`` - Plots nonlinear damping data that is applicable to all relevant directions. + + * ``JND, n`` - Plots only the specified nonlinear damping data. The n can be 1, 4, or 6. For + example, JND4 plots only the nonlinear damping data specified in the local direction 4 (ROTX). + + * ``JNFA`` - Plots nonlinear hysteretic friction data that is applicable to all relevant directions. + + * ``JNF, n`` - Plots only the specified nonlinear hysteretic friction data. The n can be 1, 4, or + 6. For example, JNF4 plots only the nonlinear hysteretic friction data specified in local direction + 4 (ROTX). + + temp : str + Specific temperature at which gasket data or joint element material data will be plotted (used + only when ``Lab`` = GASKET or JOIN). Use ``TEMP`` = ALL to plot gasket data or joint element + material data at all temperatures. + + segn : str + Segment number of plotted curve (valid only when ``Lab`` = GASKET): + + * ``NO`` - Segment number is not added to plotted curve (default). + + * ``YES`` - Segment number is added to plotted curve. This option is ignored if the number of data + points in a curve exceeds 20. + + Notes + ----- + + .. _TBPLOT_notes: + + Only data for stress-strain, B-H, gasket curves, or joint element nonlinear material model curves + can be displayed. + + The ``TBOPT`` and ``TEMP`` values are valid only when Lab = GASKET or JOIN. + + The ``SEGN`` value is valid only when Lab = GASKET. + + This command is valid in any processor. + """ + command = f"TBPLOT,{lab},{mat},{tbopt},{temp},{segn}" + return self.run(command, **kwargs) + + def tbpt( + self, + oper: str = "", + x1: str = "", + x2: str = "", + x3: str = "", + xn: str = "", + **kwargs, + ): + r"""Defines a point on a nonlinear data curve. + + Mechanical APDL Command: `TBPT `_ + + Parameters + ---------- + oper : str + Operation to perform: + + * ``DEFI`` - Defines a new data point (default). The point is inserted into the table in ascending + order of ``X1``. If a point already exists with the same ``X1`` value, it is replaced. + + * ``DELE`` - Deletes an existing point. The ``X1`` value must match the ``X1`` value of the point to + be deleted ( ``XN`` is ignored). + + x1 : str + The N components of the point. N depends on the type of data table. Except for :ref:`tb`,EXPE + all other :ref:`tb` Tables support only 2 components. + + x2 : str + The N components of the point. N depends on the type of data table. Except for :ref:`tb`,EXPE + all other :ref:`tb` Tables support only 2 components. + + x3 : str + The N components of the point. N depends on the type of data table. Except for :ref:`tb`,EXPE + all other :ref:`tb` Tables support only 2 components. + + xn : str + The N components of the point. N depends on the type of data table. Except for :ref:`tb`,EXPE + all other :ref:`tb` Tables support only 2 components. + + Notes + ----- + + .. _TBPT_notes: + + :ref:`tbpt` defines a point on a nonlinear data curve (such as a stress-strain curve, B-H curve, + etc.) at the temperature specified on the last :ref:`tbtemp` command. The meaning of the values + depends on the type of data table specified on the last :ref:`tb` command. + + This command is also valid in SOLUTION. + """ + command = f"TBPT,{oper},{x1},{x2},{x3},{xn}" + return self.run(command, **kwargs) + + def tbtemp(self, temp: str = "", kmod: str = "", **kwargs): + r"""Defines a temperature for a material data table. + + Mechanical APDL Command: `TBTEMP `_ + + Parameters + ---------- + temp : str + Temperature value (defaults to 0.0 if ``KMOD`` is blank). + + kmod : str + If blank, ``TEMP`` defines a new temperature. (Issue :ref:`tblist` to list temperatures and + data.) + + Notes + ----- + + .. _TBTEMP_notes: + + The :ref:`tbtemp` command defines a temperature to be associated with the data on subsequent + :ref:`tbpt` or :ref:`tbdata` commands. + + The defined temperature remains active until the next :ref:`tbtemp` command is issued. + + Data values must be defined with the temperatures in ascending order. + + This command is also valid in SOLUTION. + """ + command = f"TBTEMP,{temp},{kmod}" + 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 index 82c6e53ae76..ddf4bd0ec98 100644 --- a/src/ansys/mapdl/core/_commands/preproc/__init__.py +++ b/src/ansys/mapdl/core/_commands/preproc/__init__.py @@ -21,11 +21,6 @@ # SOFTWARE. from . import ( - areas, - artificially_matched_layers, - booleans, - constraint_equations, - coupled_dof, database, digitizing, element_type, diff --git a/src/ansys/mapdl/core/_commands/preproc/areas.py b/src/ansys/mapdl/core/_commands/preproc/areas.py deleted file mode 100644 index 3cb6b2e4832..00000000000 --- a/src/ansys/mapdl/core/_commands/preproc/areas.py +++ /dev/null @@ -1,1127 +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 Areas: - def a( - self, - p1="", - p2="", - p3="", - p4="", - p5="", - p6="", - p7="", - p8="", - p9="", - p10="", - p11="", - p12="", - p13="", - p14="", - p15="", - p16="", - p17="", - p18="", - **kwargs, - ) -> int: - """Define an area by connecting keypoints. - - APDL Command: A - - Keypoints (P1 through P18) must be input in a clockwise or - counterclockwise order around the area. This order also - determines the positive normal direction of the area according - to the right-hand rule. Existing lines between adjacent - keypoints will be used; missing lines are generated "straight" - in the active coordinate system and assigned the lowest - available numbers [NUMSTR]. If more than one line exists - between two keypoints, the shorter one will be chosen. If the - area is to be defined with more than four keypoints, the - required keypoints and lines must lie on a constant coordinate - value in the active coordinate system (such as a plane or a - cylinder). Areas may be redefined only if not yet attached to - a volume. Solid modeling in a toroidal coordinate system is - not recommended. - - Parameters - ---------- - p1, p2, p3, . . . , p18 - List of keypoints defining the area (18 maximum if using - keyboard entry). At least 3 keypoints must be entered. - - Returns - ------- - int - The area number of the generated area. - - Examples - -------- - Create a simple triangle in the XY plane using three keypoints. - - >>> k0 = mapdl.k("", 0, 0, 0) - >>> k1 = mapdl.k("", 1, 0, 0) - >>> k2 = mapdl.k("", 0, 1, 0) - >>> a0 = mapdl.a(k0, k1, k2) - >>> a0 - 1 - - """ - command = f"A,{p1},{p2},{p3},{p4},{p5},{p6},{p7},{p8},{p9},{p10},{p11},{p12},{p13},{p14},{p15},{p16},{p17},{p18}" - return parse.parse_a(self.run(command, **kwargs)) - - def aatt(self, mat="", real="", type_="", esys="", secn="", **kwargs): - """Associates element attributes with the selected, unmeshed areas. - - APDL Command: AATT - - Areas subsequently generated from the areas will also have these - attributes. These element attributes will be used when the areas are - meshed. If an area does not have attributes associated with it (by - this command) at the time it is meshed, the attributes are obtained - from the then current MAT, REAL, TYPE, ESYS, and SECNUM command - settings. Reissue the AATT command (before areas are meshed) to change - the attributes. A zero (or blank) argument removes the corresponding - association. If any of the arguments MAT, REAL, TYPE, ESYS, or SECN are - defined as -1, then that value will be left unchanged in the selected - set. - - In some cases, ANSYS can proceed with an area meshing operation even - when no logical element type has been assigned via AATT,,,TYPE or TYPE. - For more information, see the discussion on setting element attributes - in Meshing Your Solid Model in the Modeling and Meshing Guide. - - Parameters - ---------- - mat - The material number to be associated with selected, unmeshed areas. - - real - The real constant set number to be associated with selected, - unmeshed areas. - - type\\_ - The type number to be associated with selected, unmeshed areas. - - esys - The coordinate system number to be associated with selected, - unmeshed areas. - - secn - The section number to be associated with selected unmeshed areas. - - """ - command = f"AATT,{mat},{real},{type_},{esys},{secn}" - return self.run(command, **kwargs) - - def adele(self, na1="", na2="", ninc="", kswp="", **kwargs): - """Deletes unmeshed areas. - - APDL Command: ADELE - - Parameters - ---------- - na1, na2, ninc - Delete areas from NA1 to NA2 (defaults to NA1) in steps of NINC - (defaults to 1). If NA1 = ALL, NA2 and NINC are ignored and all - selected areas [ASEL] are deleted. If NA1 = P, graphical picking - is enabled and all remaining arguments are ignored (valid only in - the GUI). A component name may also be substituted for NA1 (NA2 - and NINC are ignored). - - kswp - Specifies whether keypoints and lines are also to be deleted: - - 0 - Delete areas only (default). - - 1 - Delete areas, as well as keypoints and lines attached - to specified areas but not shared by other areas. - - Notes - ----- - An area attached to a volume cannot be deleted unless the volume is - first deleted. - """ - command = f"ADELE,{na1},{na2},{ninc},{kswp}" - return self.run(command, **kwargs) - - def adgl(self, na1="", na2="", ninc="", **kwargs): - """Lists keypoints of an area that lie on a parametric degeneracy. - - APDL Command: ADGL - - Parameters - ---------- - na1, na2, ninc - List keypoints that lie on a parametric degeneracy on areas from - NA1 to NA2 (defaults to NA1) in steps of NINC (defaults to 1). If - NA1 = ALL (default), NA2 and NINC will be ignored and keypoints on - all selected areas [ASEL] will be listed. If NA1 = P, graphical - picking is enabled and all remaining arguments are ignored (valid - only in the GUI). A component name may be substituted in NA1 (NA2 - and NINC will be ignored). - - Notes - ----- - See the Modeling and Meshing Guide for details on parametric - degeneracies. - - This command is valid in any processor. - """ - command = f"ADGL,{na1},{na2},{ninc}" - return self.run(command, **kwargs) - - def adrag( - self, - nl1="", - nl2="", - nl3="", - nl4="", - nl5="", - nl6="", - nlp1="", - nlp2="", - nlp3="", - nlp4="", - nlp5="", - nlp6="", - **kwargs, - ) -> str: - """Generate areas by dragging a line pattern along a path. - - APDL Command: ADRAG - - Generates areas (and their corresponding keypoints and lines) - by sweeping a given line 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 line 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. - - Keypoint, line, and area numbers are automatically assigned - (beginning with the lowest available values [NUMSTR]). - Adjacent lines use a common keypoint. Adjacent areas use a - common line. 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. - - Parameters - ---------- - nl1, nl2, nl3, . . . , nl6 - List of lines in the pattern to be dragged (6 maximum if - using keyboard entry). Lines should form a continuous - pattern (no more than two lines connected to any one - keypoint. If NL1 = ALL, all selected lines (except those - that define the drag path) will be swept along the path. - A component name may also be substituted for NL1. - - 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. - - Returns - ------- - str - MAPDL command output. - - Examples - -------- - Drag a circle between two keypoints to create an area - - >>> k0 = mapdl.k("", 0, 0, 0) - >>> k1 = mapdl.k("", 0, 0, 1) - >>> carc = mapdl.circle(k0, 1, k1, arc=90) - >>> l0 = mapdl.l(k0, k1) - >>> output = mapdl.adrag(carc[0], nlp1=l0) - >>> print(output) - DRAG LINES: - 1, - ALONG LINES - 2, - - """ - command = f"ADRAG,{nl1},{nl2},{nl3},{nl4},{nl5},{nl6},{nlp1},{nlp2},{nlp3},{nlp4},{nlp5},{nlp6}" - return self.run(command, **kwargs) - - def afillt(self, na1="", na2="", rad="", **kwargs): - """Generates a fillet at the intersection of two areas. - - APDL Command: AFILLT - - Generates an area of constant fillet radius at the - intersection of two areas using a series of Boolean - operations. Corresponding lines and keypoints are also - generated. See BOPTN command for an explanation of the - options available to Boolean operations. If areas do not - initially intersect at a common line, use the AINA command. - - Parameters - ---------- - na1 - Number of the first intersecting area. - - na2 - Number of the second intersecting area. - - rad - Radius of fillet to be generated. - - """ - command = f"AFILLT,{na1},{na2},{rad}" - return self.run(command, **kwargs) - - def agen( - self, - itime="", - na1="", - na2="", - ninc="", - dx="", - dy="", - dz="", - kinc="", - noelem="", - imove="", - **kwargs, - ): - """Generates additional areas from a pattern of areas. - - APDL Command: AGEN - - Generates additional areas (and their corresponding keypoints, lines - and mesh) from a given area pattern. The MAT, TYPE, REAL, ESYS, and - SECNUM attributes of the new areas are based upon the areas 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. Generations which produce areas 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. Solid modeling in - a toroidal coordinate system is not recommended. Area and line numbers - are automatically assigned, beginning with the lowest available values - [NUMSTR]. - - 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 more than 1 for generation to - occur. - - na1, na2, ninc - Generate areas from the pattern of areas NA1 to NA2 (defaults to - NA1) in steps of NINC (defaults to 1). If NA1 = ALL, NA2 and NINC - are ignored and the pattern is all selected areas [ASEL]. If NA1 = - P, graphical picking is enabled and all remaining arguments are - ignored (valid only in the GUI). A component name may also be - substituted for NA1 (NA2 and NINC are ignored). - - dx, dy, dz - Keypoint location increments in the active coordinate system (--, - D θ, DZ for cylindrical; --, D θ, -- for spherical). - - kinc - Keypoint number 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 areas, if they exist. - - 1 - Do not generate nodes and elements. - - imove - Specifies whether to redefine the existing areas: - - 0 - Generate new areas as requested with the ITIME argument. - - 1 - Move original areas to new position, retaining the same keypoint numbers - (ITIME, KINC, and NOELEM are ignored). If the original areas - are needed in the original position (e.g., they may be - attached to a volume), they are not moved, and new areas are - generated instead. Meshed items corresponding to moved areas - are also moved if not needed at their original position. - - """ - command = ( - f"AGEN,{itime},{na1},{na2},{ninc},{dx},{dy},{dz},{kinc},{noelem},{imove}" - ) - return self.run(command, **kwargs) - - def al( - self, - l1="", - l2="", - l3="", - l4="", - l5="", - l6="", - l7="", - l8="", - l9="", - l10="", - **kwargs, - ) -> int: - """Generate an area bounded by previously defined lines. - - APDL Command: AL - - Lines may be input (once each) in any order and must form a - simply connected closed curve. If the area is defined with - more than four lines, the lines must also lie in the same - plane or on a constant coordinate value in the active - coordinate system (such as a plane or a cylinder). - - Solid modeling in a toroidal coordinate system is not - recommended. Areas may be redefined only if not yet attached - to a volume. - - This command is valid in any processor. - - Parameters - ---------- - l1, l2, l3, . . . , l10 - List of lines defining area. The minimum number of lines - is 3. The positive normal of the area is controlled by - the direction of L1 using the right-hand rule. A negative - value of L1 reverses the normal direction. If L1 = ALL, - use all selected lines with L2 defining the normal (L3 to - L10 are ignored and L2 defaults to the lowest numbered - selected line). A component name may also be substituted - for L1. - - Returns - ------- - int - Area number of the generated area. - - Examples - -------- - Create an area from four lines - - >>> k0 = mapdl.k("", 0, 0, 0) - >>> k1 = mapdl.k("", 1, 0, 0) - >>> k2 = mapdl.k("", 1, 1, 0) - >>> k3 = mapdl.k("", 0, 1, 0) - >>> l0 = mapdl.l(k0, k1) - >>> l1 = mapdl.l(k1, k2) - >>> l2 = mapdl.l(k2, k3) - >>> l3 = mapdl.l(k3, k0) - >>> anum = mapdl.al(l0, l1, l2, l3) - >>> anum - 1 - - """ - command = f"AL,{l1},{l2},{l3},{l4},{l5},{l6},{l7},{l8},{l9},{l10}" - return parse.parse_a(self.run(command, **kwargs)) - - def alist(self, na1="", na2="", ninc="", lab="", **kwargs): - """Lists the defined areas. - - APDL Command: ALIST - - Parameters - ---------- - na1, na2, ninc - List areas from NA1 to NA2 (defaults to NA1) in steps of NINC - (defaults to 1). If NA1 = ALL (default), NA2 and NINC are ignored - and all selected areas [ASEL] are listed. If NA1 = P, graphical - picking is enabled and all remaining arguments are ignored (valid - only in the GUI). A component name may also be substituted for NA1 - (NA2 and NINC are ignored). - - lab - Determines what type of listing is used (one of the following): - - (blank) - Prints information about all areas in the specified range. - - HPT - Prints information about only those areas that - contain hard points. - - 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 AATT 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 area - has been meshed but there are no interior nodes. The area size is - listed only if an ASUM command has been performed on the area. - """ - command = f"ALIST,{na1},{na2},{ninc},{lab}" - return self.run(command, **kwargs) - - def anorm(self, anum="", noeflip="", **kwargs): - """Reorients area normals. - - APDL Command: ANORM - - Parameters - ---------- - anum - Area number having the normal direction that the reoriented areas - are to match. - - noeflip - Indicates whether you want to change the normal direction of the - existing elements on the reoriented area(s) so that they are - consistent with each area's new normal direction. - - 0 - Make the normal direction of existing elements on the reoriented area(s) - consistent with each area's new normal direction (default). - - 1 - Do not change the normal direction of existing elements on the reoriented - area(s). - - Notes - ----- - Reorients areas so that their normals are consistent with that of a - specified area. - - If any of the areas have inner loops, the ANORM command will consider - the inner loops when it reorients the area normals. - - You cannot use the ANORM command to change the normal direction of any - element that has a body or surface load. We recommend that you apply - all of your loads only after ensuring that the element normal - directions are acceptable. - - Real constants (such as nonuniform shell thickness and tapered beam - constants) may be invalidated by an element reversal. - - See Revising Your Model of the Modeling and Meshing Guide for more - information. - """ - command = f"ANORM,{anum},{noeflip}" - return self.run(command, **kwargs) - - def aoffst(self, narea="", dist="", kinc="", **kwargs): - """Generates an area, offset from a given area. - - APDL Command: AOFFST - - Parameters - ---------- - narea - Area from which generated area is to be offset. If NAREA = ALL, - offset from all selected areas [ASEL]. If NAREA = P, graphical - picking is enabled and all remaining arguments are ignored (valid - only in the GUI). - - dist - Distance normal to given area at which keypoints for generated area - are to be located. Positive normal is determined from the right- - hand-rule keypoint order. - - kinc - Keypoint increment between areas. If zero, the lowest available - keypoint numbers are assigned [NUMSTR]. - - Notes - ----- - Generates an area (and its corresponding keypoints and lines) offset - from a given 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. Area and line numbers are automatically - assigned, beginning with the lowest available values [NUMSTR]. - """ - command = f"AOFFST,{narea},{dist},{kinc}" - return self.run(command, **kwargs) - - def aplot(self, na1="", na2="", ninc="", degen="", scale="", **kwargs): - """Displays the selected areas. - - APDL Command: APLOT - - Parameters - ---------- - na1, na2, ninc - Displays areas from NA1 to NA2 (defaults to NA1) in steps of NINC - (defaults to 1). If NA1 = ALL (default), NA2 and NINC are ignored - and all selected areas [ASEL] 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 - ----- - This command is valid in any processor. The degree of tessellation - used to plot the selected areas is set through the /FACET command. - """ - command = f"APLOT,{na1},{na2},{ninc},{degen},{scale}" - return self.run(command, **kwargs) - - def areverse(self, anum="", noeflip="", **kwargs): - """Reverses the normal of an area, regardless of its connectivity or mesh - - APDL Command: AREVERSE - status. - - Parameters - ---------- - anum - Area number of the area whose normal is to be reversed. If ANUM = - ALL, the normals of all selected areas will be reversed. If ANUM = - P, graphical picking is enabled. A component name may also be - substituted for ANUM. - - noeflip - Indicates whether you want to change the normal direction of the - existing elements on the reversed area(s) so that they are - consistent with each area's new normal direction. - - 0 - Make the normal direction of existing elements on the reversed area(s) - consistent with each area's new normal direction (default). - - 1 - Do not change the normal direction of existing elements on the reversed - area(s). - - Notes - ----- - You cannot use the AREVERSE command to change the normal direction of - any element that has a body or surface load. We recommend that you - apply all of your loads only after ensuring that the element normal - directions are acceptable. Also, you cannot use this command to change - the normal direction for areas attached to volumes because IGES and ANF - data is unchanged by reversal. Reversed areas that are attached to - volumes need to be reversed again when imported. - - Real constants (such as nonuniform shell thickness and tapered beam - constants) may be invalidated by an element reversal. - - See Revising Your Model in the Modeling and Meshing Guide for more - information. - """ - command = f"AREVERSE,{anum},{noeflip}" - return self.run(command, **kwargs) - - def arotat( - self, - nl1="", - nl2="", - nl3="", - nl4="", - nl5="", - nl6="", - pax1="", - pax2="", - arc="", - nseg="", - **kwargs, - ): - """Generates cylindrical areas by rotating a line pattern about an axis. - - APDL Command: AROTAT - - Parameters - ---------- - nl1, nl2, nl3, . . . , nl6 - List of lines in the pattern to be rotated (6 maximum if using - keyboard entry of NL1 to NL6). The lines must lie in the plane of - the axis of rotation. If NL1 = P, graphical picking is enabled and - all remaining arguments are ignored (valid only in the GUI). If - NL1 = ALL, all selected lines will define the pattern to be - rotated. A component name may also be substituted for NL1. - - pax1, pax2 - Keypoints defining the axis about which the line 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 areas (8 maximum) around circumference. Defaults to - minimum number required for 90° -maximum arcs, i.e., 4 for 360°, 3 - for 270°, etc. - - Notes - ----- - Generates cylindrical areas (and their corresponding keypoints and - lines) by rotating a line pattern (and its associated keypoint pattern) - 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, and area - numbers are automatically assigned, beginning with the lowest available - values [NUMSTR]. Adjacent lines use a common keypoint. Adjacent areas - use a common line. - """ - command = ( - f"AROTAT,{nl1},{nl2},{nl3},{nl4},{nl5},{nl6},{pax1},{pax2},{arc},{nseg}" - ) - return self.run(command, **kwargs) - - def arscale( - self, - na1="", - na2="", - ninc="", - rx="", - ry="", - rz="", - kinc="", - noelem="", - imove="", - **kwargs, - ): - """Generates a scaled set of areas from a pattern of areas. - - APDL Command: ARSCALE - - Parameters - ---------- - na1, na2, ninc - Set of areas, NA1 to NA2 in steps of NINC, that defines the pattern - to be scaled. 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 arguments are ignored (valid only in the GUI). A - component name may also be substituted for NA1 (NA2 and NINC are - ignored). - - 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. - - 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 areas will be generated - (scaled) if they exist. - - 1 - Nodes and elements will not be generated. - - imove - Specifies whether areas will be moved or newly defined: - - 0 - Additional areas will be generated. - - 1 - Original areas will be moved to new position (KINC and NOELEM are ignored). - Use only if the old areas 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 areas (and their corresponding keypoints, - lines, and mesh) from a pattern of areas. The MAT, TYPE, REAL, and - ESYS attributes are based on the areas in the pattern and not the - current settings. Scaling is done in the active coordinate system. - Areas in the pattern could have been generated in any coordinate - system. However, solid modeling in a toroidal coordinate system is not - recommended. - """ - command = f"ARSCALE,{na1},{na2},{ninc},{rx},{ry},{rz},{kinc},{noelem},{imove}" - return self.run(command, **kwargs) - - def arsym( - self, - ncomp="", - na1="", - na2="", - ninc="", - kinc="", - noelem="", - imove="", - **kwargs, - ): - """Generates areas from an area pattern by symmetry reflection. - - APDL Command: ARSYM - - Parameters - ---------- - ncomp - Symmetry key: - - X - X symmetry (default). - - Y - Y symmetry. - - Z - Z symmetry. - - na1, na2, ninc - Reflect areas from pattern beginning with NA1 to NA2 (defaults to - NA1) in steps of NINC (defaults to 1). If NA1 = ALL, NA2 and NINC - are ignored and the pattern is all selected areas [ASEL]. If Ncomp - = P, use graphical picking to specify areas and ignore NL2 and - NINC. A component name may also be substituted for NA1 (NA2 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 areas, if they exist. - - 1 - Do not generate nodes and elements. - - imove - Specifies whether areas will be moved or newly defined: - - 0 - Generate additional areas. - - 1 - Move original areas to new position retaining the same keypoint numbers (KINC - and NOELEM are ignored). Valid only if the old areas are no - longer needed at their original positions. Corresponding - meshed items are also moved if not needed at their original - position. - - Notes - ----- - Generates a reflected set of areas (and their corresponding keypoints, - lines and mesh) from a given area pattern by a symmetry reflection (see - analogous node symmetry command, NSYM). The MAT, TYPE, REAL, ESYS, and - SECNUM attributes are based upon the areas 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. Areas in the pattern may have been - generated in any coordinate system. However, solid modeling in a - toroidal coordinate system is not recommended. Areas are generated as - described in the AGEN command. - - See the ESYM command for additional information about symmetry - elements. - """ - command = f"ARSYM,{ncomp},{na1},{na2},{ninc},{kinc},{noelem},{imove}" - return self.run(command, **kwargs) - - def askin( - self, - nl1="", - nl2="", - nl3="", - nl4="", - nl5="", - nl6="", - nl7="", - nl8="", - nl9="", - **kwargs, - ): - """Generates an area by "skinning" a surface through guiding lines. - - APDL Command: ASKIN - - Parameters - ---------- - nl1 - The first guiding line forming the skinned area. If NL1 = P, - graphical picking is enabled and all remaining arguments are - ignored (valid only in the GUI). A component name may also be - substituted for NL1. If NL1 is negative, the line beginnings and - ends will be used to direct the skinning of the remaining lines - (see "Changing the ASKIN Algorithm" below). - - nl2, nl3, nl4, . . . , nl9 - The additional guiding lines for the skinned area (up to 9 total - lines, including NL1, if using keyboard entry). If negative (and - NL1 is negative), the line beginning and end will be temporarily - interchanged for the skinning operation (see "Changing the ASKIN - Algorithm" below). - - Notes - ----- - Generates an area by "skinning" a surface through specified guiding - lines. The lines act as a set of "ribs" over which a surface is - "stretched." Two opposite edges of the area are framed by the first - (NL1) and last (NLn) guiding lines specified. The other two edges of - the area are framed by splines-fit lines which the program - automatically generates through the ends of all guiding lines. The - interior of the area is shaped by the interior guiding lines. Once the - area has been created, only the four edge lines will be attached to it. - In rare cases, it may be necessary to change the default algorithm used - by the ASKIN command (see "Changing the ASKIN Algorithm" below). - - When skinning from one guiding line to the next, the program can create - the transition area in one of two ways: one more spiraled and one less - spiraled ("flatter"). By default, the program attempts to produce the - flatter transition, instead of the more spiraled transition. This - algorithm can be changed by inputting NL1 as a negative number, in - which case the program connects all the keypoints at the line - "beginnings" (/PSYMB,LDIR command) as one edge of the area, and all the - line "ends" as the opposite edge, irrespective of the amount of - spiraling produced in each transition area. - - To further control the geometry of the area (if NL1 is negative), the - beginning and end of any specified line (other than NL1) can be - temporarily interchanged (for the skinning operation only) by inputting - that line number as negative. See Solid Modeling in the Modeling and - Meshing Guide for an illustration. - """ - command = f"ASKIN,{nl1},{nl2},{nl3},{nl4},{nl5},{nl6},{nl7},{nl8},{nl9}" - return self.run(command, **kwargs) - - def asub(self, na1="", p1="", p2="", p3="", p4="", **kwargs): - """Generates an area using the shape of an existing area. - - APDL Command: ASUB - - Parameters - ---------- - na1 - Existing area number whose shape is to be used. If P1 = P, - graphical picking is enabled and all remaining arguments are - ignored (valid only in the GUI). - - p1 - Keypoint defining starting corner of area. - - p2 - Keypoint defining second corner of area. - - p3 - Keypoint defining third corner of area. - - p4 - Keypoint defining fourth corner of area (defaults to P3). - - Notes - ----- - The new area will overlay the old area. Often used when the area to be - subdivided consists of a complex shape that was not generated in a - single coordinate system. Keypoints and any corresponding lines must - lie on the existing area. Missing lines are generated to lie on the - given area. The active coordinate system is ignored. - """ - command = f"ASUB,{na1},{p1},{p2},{p3},{p4}" - return self.run(command, **kwargs) - - def asum(self, lab="", **kwargs): - """Calculates and prints geometry statistics of the selected areas. - - APDL Command: ASUM - - 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 (area, centroid location, - moments of inertia, volume, etc.) associated with the selected areas. - ASUM should only be used on perfectly flat areas. - - Geometry items are reported in the global Cartesian coordinate system. - A unit thickness is assumed unless the areas have a non-zero total - thickness defined by real constant or section data. - - For layered areas, a unit density is always assumed. For single-layer - areas, a unit density is assumed unless the areas have a valid material - (density). - - The thickness and density are associated to the areas via the AATT - command. - - Items calculated via ASUM and later retrieved via a ``*GET`` or ``*VGET`` - command are valid only if the model is not modified after issuing the - ASUM command. - - 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 narrow (sliver) areas, such that the ratio of the minimum to - the maximum dimension is less than 0.01, the ASUM command can provide - erroneous area information. To ensure that the calculations are - accurate, subdivide such areas so that the ratio of the minimum to the - maximum is at least 0.05. - """ - command = f"ASUM,{lab}" - return self.run(command, **kwargs) - - def atran( - self, - kcnto="", - na1="", - na2="", - ninc="", - kinc="", - noelem="", - imove="", - **kwargs, - ): - """Transfers a pattern of areas to another coordinate system. - - APDL Command: ATRAN - - 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. - - na1, na2, ninc - Transfer area pattern beginning with NA1 to NA2 (defaults to NA1) - in steps of NINC (defaults to 1). If NA1 = ALL, NA2 and NINC are - ignored and the pattern is all selected areas [ASEL]. If NA1 = P, - graphical picking is enabled and all remaining arguments are - ignored (valid only in the GUI). A component name may also be - substituted for NA1 (NA2 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 areas, if they exist. - - 1 - Do not generate nodes and elements. - - imove - Specifies whether to redefine the existing areas: - - 0 - Generate additional areas. - - 1 - Move original areas to new position retaining the same keypoint numbers (KINC - and NOELEM are ignored). Valid only if the old areas are no - longer needed at their original positions. Corresponding - meshed items are also moved if not needed at their original - position. - - Notes - ----- - Transfers a pattern of areas (and their corresponding lines, keypoints - and mesh) from one coordinate system to another (see analogous node - TRANSFER command). The MAT, TYPE, REAL, and ESYS attributes are based - upon the areas 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. Areas are generated as - described in the AGEN command. - """ - command = f"ATRAN,{kcnto},{na1},{na2},{ninc},{kinc},{noelem},{imove}" - return self.run(command, **kwargs) - - def gsum(self, **kwargs): - """Calculates and prints geometry items. - - APDL Command: GSUM - - Notes - ----- - Calculates and prints geometry items (centroid location, moments of - inertia, length, area, volume etc.) associated with the selected - keypoints, lines, areas, and volumes. Geometry items are reported in - the global Cartesian coordinate system. For volumes, a unit density - is assumed unless the volumes have a material association via the VATT - command. For areas, a unit density (and thickness) is assumed unless - the areas have a material (and real constant) association via the AATT - command. For lines and keypoints, a unit density is assumed, - irrespective of any material associations [LATT, KATT, MAT]. Items - calculated by GSUM and later retrieved by a ``*GET`` or ``*VGET`` commands are - valid only if the model is not modified after the GSUM command is - issued. This command combines the functions of the KSUM, LSUM, ASUM, - and VSUM commands. - """ - command = f"GSUM," - return self.run(command, **kwargs) - - def splot(self, na1="", na2="", ninc="", mesh="", **kwargs): - """Displays the selected areas and a faceted view of their underlying - - APDL Command: SPLOT - surfaces - - Parameters - ---------- - na1 - Starting area for display of areas and underlying surfaces. If NA1 - = ALL (default), NA2 and NINC are ignored and all selected areas - are displayed (ASEL command). - - na2 - Last area to be displayed. - - ninc - Numeric value setting steps between NA1 and NA2 for display. - Default value is (1). - - mesh - Specifies a rectangular mesh density used to display the underlying - surface (default 4, i.e. 4 x 4). - - Notes - ----- - This command is valid in any processor. The plot output displays the - external and internal trim curves and underlying surface. You cannot - obtain a faceted view of your surface areas when you are using the - /EXPAND command to create larger graphics displays. - - Use APLOT for trimmed surface display. - """ - command = f"SPLOT,{na1},{na2},{ninc},{mesh}" - return self.run(command, **kwargs) diff --git a/src/ansys/mapdl/core/_commands/preproc/artificially_matched_layers.py b/src/ansys/mapdl/core/_commands/preproc/artificially_matched_layers.py deleted file mode 100644 index af1fee0f825..00000000000 --- a/src/ansys/mapdl/core/_commands/preproc/artificially_matched_layers.py +++ /dev/null @@ -1,143 +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 ArtificiallyMatchedLayers: - def pmlopt( - self, - esys="", - lab="", - xminus="", - xplus="", - yminus="", - yplus="", - zminus="", - zplus="", - **kwargs, - ): - """Defines perfectly matched layers (PMLs) for acoustic and structural - - APDL Command: PMLOPT - analyses. - - Parameters - ---------- - esys - Element coordinate system number. ESYS may be 0 (global Cartesian) - or any previously defined local Cartesian coordinate system number - (>10). Defaults to 0. - - lab - Label defining the number of dimensions: - - ONE - A one-dimensional PML region. - - THREE - A three-dimensional PML region (default). - - xminus - For harmonic analysis, normal reflection coefficient in negative X - direction of ESYS. Defaults to 1.E−3 (equivalent to -60 dB) for a - harmonic analysis and 30 for a static structural analysis. - - xplus - For harmonic analysis, normal reflection coefficient in positive X - direction of ESYS. Defaults to 1.E−3 (equivalent to -60 dB) for a - harmonic analysis and 30 for a static structural analysis. - - yminus - For harmonic analysis, normal reflection coefficient in negative Y - direction of ESYS. Defaults to 1.E−3 (equivalent to -60 dB) for a - harmonic analysis and 30 for a static structural analysis. - - yplus - For harmonic analysis, normal reflection coefficient in positive Y - direction of ESYS. Defaults to 1.E−3 (equivalent to -60 dB) for a - harmonic analysis and 30 for a static structural analysis. - - zminus - For harmonic analysis, normal reflection coefficient in negative Z - direction of ESYS. Defaults to 1.E−3 (equivalent to -60 dB) for a - harmonic analysis and 30 for a static structural analysis. - - zplus - For harmonic analysis, normal reflection coefficient in positive Z - direction of ESYS. Defaults to 1.E−3 (equivalent to -60 dB) for a - harmonic analysis and 30 for a static structural analysis. - - Notes - ----- - PMLOPT defines perfectly matched layers (PML) for acoustic or - structural analyses. Each PML region must have a uniquely defined - element coordinate system. Normal reflection coefficient values for a - harmonic analysis must be less than 1. - - Issue PMLOPT,STAT to list the current normal reflection coefficient or - attenuation factor settings for a PML region. Issue PMLOPT,CLEAR to - clear all normal reflection coefficient settings and restore them to - the defaults. Issue PMLOPT,ESYS,CLEAR to clear all normal reflection - coefficient settings for this element coordinate system and restore - them to the defaults. - """ - command = ( - f"PMLOPT,{esys},{lab},{xminus},{xplus},{yminus},{yplus},{zminus},{zplus}" - ) - return self.run(command, **kwargs) - - def pmlsize( - self, freqb="", freqe="", dmin="", dmax="", thick="", angle="", **kwargs - ): - """Determines number of PML layers. - - APDL Command: PMLSIZE - - Parameters - ---------- - freqb - Minimum operating frequency - - freqe - Maximum operating frequency - - dmin - Minimum distance from radiation source to PML interface. - - dmax - Maximum distance from radiation source to PML interface. - - thick - Thickness of PML region. Defaults to 0. - - angle - Incident angle of wave to the PML interface. Defaults to 0. - - Notes - ----- - PMLSIZE determines the number of PML layers for acceptable numerical - accuracy. - - PMLSIZE must be issued before any meshing commands. If the thickness of - the PML region is known, it determines an element edge length (h) and - issues ESIZE,h. If the thickness of the PML region is unknown, it - determines the number of layers (n) and issues ESIZE,,n. - """ - command = f"PMLSIZE,{freqb},{freqe},{dmin},{dmax},{thick},{angle}" - return self.run(command, **kwargs) diff --git a/src/ansys/mapdl/core/_commands/preproc/booleans.py b/src/ansys/mapdl/core/_commands/preproc/booleans.py deleted file mode 100644 index 62adc3ec3f1..00000000000 --- a/src/ansys/mapdl/core/_commands/preproc/booleans.py +++ /dev/null @@ -1,1609 +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 Booleans: - def aadd( - self, - na1="", - na2="", - na3="", - na4="", - na5="", - na6="", - na7="", - na8="", - na9="", - **kwargs, - ): - """Adds separate areas to create a single area. - - APDL Command: AADD - - Parameters - ---------- - na1, na2, na3, . . . , na9 - Numbers of areas to be added. If NA1 = ALL, add all selected areas - and ignore NA2 to NA9. If NA1 = P, graphical picking is enabled - and all remaining arguments are ignored (valid only in the GUI). A - component name may also be substituted for NA1. - - Notes - ----- - The areas must be coplanar. The original areas (and their - corresponding lines and keypoints) will be deleted by default. - See the BOPTN command for the options available to Boolean - operations. Element attributes and solid model boundary - conditions assigned to the original entities will not be - transferred to the new entities generated. Concatenated entities - are not valid with this command. - - Examples - -------- - Generate two areas and combine them. - - >>> a1 = mapdl.rectng(2.5, 3.5, 0, 10) - >>> a2 = mapdl.cyl4(0, 10, 2.5, 0, 3.5, 90) - >>> a_comb = mapdl.aadd(a1, a2) - >>> a_comb - 3 - - """ - command = f"AADD,{na1},{na2},{na3},{na4},{na5},{na6},{na7},{na8},{na9}" - return parse.parse_output_areas(self.run(command, **kwargs)) - - def aglue( - self, - na1="", - na2="", - na3="", - na4="", - na5="", - na6="", - na7="", - na8="", - na9="", - **kwargs, - ): - """Generates new areas by "gluing" areas. - - APDL Command: AGLUE - - Parameters - ---------- - na1, na2, na3, . . . , na9 - Numbers of the areas to be glued. If NA1 = ALL, all selected areas - will be glued (NA2 to NA9 will be ignored). If NA1 = P, graphical - picking is enabled and all remaining arguments are ignored (valid - only in the GUI). A component name may also be substituted for - NA1. - - Notes - ----- - Use of the AGLUE command generates new areas by "gluing" input areas. - The glue operation redefines the input areas so that they share lines - along their common boundaries. The new areas encompass the same - geometry as the original areas. This operation is only valid if the - intersection of the input areas are lines along the boundaries of those - areas. See the Modeling and Meshing Guide for an illustration. See - the BOPTN command for an explanation of the options available to - Boolean operations. Element attributes and solid model boundary - conditions assigned to the original entities will not be transferred to - new entities generated. - - The AGLUE command results in the merging of lines and keypoints at the - common area boundaries. The lines and keypoints of the lower numbered - area will be kept. This means one must be aware of area numbering when - multiple AGLUE commands are applied to avoid any "ungluing" of - geometry. - """ - command = f"AGLUE,{na1},{na2},{na3},{na4},{na5},{na6},{na7},{na8},{na9}" - return self.run(command, **kwargs) - - def aina( - self, - na1="", - na2="", - na3="", - na4="", - na5="", - na6="", - na7="", - na8="", - na9="", - **kwargs, - ): - """Finds the intersection of areas. - - APDL Command: AINA - - Parameters - ---------- - na1, na2, na3, . . . , na9 - Numbers of areas to be intersected. If NA1 = ALL, NA2 to NA9 are - ignored and the intersection of all selected areas is found. If - NA1 = P, graphical picking is enabled and all remaining arguments - are ignored (valid only in the GUI). A component name may also be - substituted for NA1. - - Notes - ----- - Finds the common (not pairwise) intersection of areas. The common - intersection is defined as the regions shared (in common) by all areas - listed on this command. New areas will be generated where the original - areas intersect. If the regions of intersection are only lines, new - lines will be generated instead. See the Modeling and Meshing Guide - for an illustration. See the BOPTN command for the options available - to Boolean operations. Element attributes and solid model boundary - conditions assigned to the original entities will not be transferred to - the new entities generated. - """ - command = f"AINA,{na1},{na2},{na3},{na4},{na5},{na6},{na7},{na8},{na9}" - return self.run(command, **kwargs) - - def ainp( - self, - na1="", - na2="", - na3="", - na4="", - na5="", - na6="", - na7="", - na8="", - na9="", - **kwargs, - ): - """Finds the pairwise intersection of areas. - - APDL Command: AINP - - Parameters - ---------- - na1, na2, na3, . . . , na9 - Numbers of areas to be intersected pairwise. If NA1 = ALL, NA2 to - NA9 are ignored and the pairwise intersection of all selected areas - is found. If NA1 = P, graphical picking is enabled and all - remaining arguments are ignored (valid only in the GUI). A - component name may be substituted for NA1. - - Notes - ----- - Finds the pairwise intersection of areas. The pairwise intersection is - defined as all regions shared by any two or more areas listed on this - command. New areas will be generated where the original areas - intersect pairwise. If the regions of pairwise intersection are only - lines, new lines will be generated. See the Modeling and Meshing Guide - for an illustration. See the BOPTN command for the options available - to Boolean operations. Element attributes and solid model boundary - conditions assigned to the original entities will not be transferred to - the new entities generated. - """ - command = f"AINP,{na1},{na2},{na3},{na4},{na5},{na6},{na7},{na8},{na9}" - return self.run(command, **kwargs) - - def ainv(self, na="", nv="", **kwargs): - """Finds the intersection of an area with a volume. - - APDL Command: AINV - - Parameters - ---------- - na - Number of area to be intersected. If P, graphical picking is - enabled and all remaining arguments are ignored (valid only in the - GUI). - - nv - Number of volume to be intersected. - - Notes - ----- - New areas will be generated where the areas intersect the volumes. If - the regions of intersection are only lines, new lines will be generated - instead. See the Modeling and Meshing Guide for an illustration. See - the BOPTN command for the options available to Boolean operations. - Element attributes and solid model boundary conditions assigned to the - original entities will not be transferred to the new entities - generated. - """ - command = f"AINV,{na},{nv}" - return self.run(command, **kwargs) - - def aovlap( - self, - na1="", - na2="", - na3="", - na4="", - na5="", - na6="", - na7="", - na8="", - na9="", - **kwargs, - ): - """Overlaps areas. - - APDL Command: AOVLAP - - Parameters - ---------- - na1, na2, na3, . . . , na9 - Numbers of areas to be operated on. If NA1 = ALL, use all selected - areas and ignore NA2 to NA9. If NA1 = P, graphical picking is - enabled and all remaining arguments are ignored (valid only in the - GUI). A component name may also be substituted for NA1. - - Notes - ----- - Generates new areas which encompass the geometry of all the input - areas. The new areas are defined by the regions of intersection of the - input areas, and by the complementary (non-intersecting) regions. See - Solid Modeling in the Modeling and Meshing Guide for an illustration. - This operation is only valid when the region of intersection is an - area. See the BOPTN command for an explanation of the options - available to Boolean operations. Element attributes and solid model - boundary conditions assigned to the original entities will not be - transferred to the new entities generated. - """ - command = f"AOVLAP,{na1},{na2},{na3},{na4},{na5},{na6},{na7},{na8},{na9}" - return self.run(command, **kwargs) - - def aptn( - self, - na1="", - na2="", - na3="", - na4="", - na5="", - na6="", - na7="", - na8="", - na9="", - **kwargs, - ): - """Partitions areas. - - APDL Command: APTN - - Parameters - ---------- - na1, na2, na3, . . . , na9 - Numbers of areas to be operated on. If NA1 = ALL, NA2 to NA9 are - ignored and all selected areas are used. If NA1 = P, graphical - picking is enabled and all remaining arguments are ignored (valid - only in the GUI). A component name may be substituted for NA1. - - Notes - ----- - Partitions areas that intersect. This command is similar to the - combined functionality of the ASBA and AOVLAP commands. If the - intersection of two or more areas is an area (i.e., planar), new areas - will be created with boundaries that conform to the area of - intersection and to the boundaries of the non-intersecting portions of - the input areas [AOVLAP]. If the intersection is a line (i.e., not - planar), the areas will be subtracted, or divided, along the line(s) of - intersection [ASBA]. Both types of intersection can occur during a - single APTN operation. Areas that do not intersect will not be - modified. See the Modeling and Meshing Guide for an illustration. See - the BOPTN command for an explanation of the options available to - Boolean operations. Element attributes and solid model boundary - conditions assigned to the original entities will not be transferred to - the new entities generated. - """ - command = f"APTN,{na1},{na2},{na3},{na4},{na5},{na6},{na7},{na8},{na9}" - return self.run(command, **kwargs) - - def asba(self, na1="", na2="", sepo="", keep1="", keep2="", **kwargs) -> int: - """Subtracts areas from areas. - - APDL Command: ASBA - - Generates new areas by subtracting the regions common to both - NA1 and NA2 areas (the intersection) from the NA1 areas. The - intersection can be an area(s) or line(s). If the - intersection is a line and SEPO is blank, the NA1 area is - divided at the line and the resulting areas will be connected, - sharing a common line where they touch. If SEPO is set to - SEPO, NA1 is divided into two unconnected areas with separate - lines where they touch. See Solid Modeling in the Modeling - and Meshing Guide for an illustration. See the BOPTN command - for an explanation of the options available to Boolean - operations. Element attributes and solid model boundary - conditions assigned to the original entities will not be - transferred to the new entities generated. ASBA,ALL,ALL will - have no effect since all the areas (in NA1) will be - unavailable as NA2 areas. - - Parameters - ---------- - na1 - Area (or areas, if picking is used) to be subtracted from. - If ALL, use all selected areas. Areas specified in this - argument are not available for use in the NA2 argument. A - component name may also be substituted for NA1. - - na2 - Area (or areas, if picking is used) to subtract. If ALL, - use all selected areas (except those included in the NA1 - argument). A component name may also be substituted for - NA2. - - sepo - Behavior if the intersection of the NA1 areas and the NA2 areas is - a line or lines: - - (blank) - The resulting areas will share line(s) where they touch. - - SEPO - The resulting areas will have separate, but - coincident line(s) where they touch. - - keep1 - Specifies whether NA1 areas are to be deleted: - - (blank) - Use the setting of KEEP on the BOPTN command. - - DELETE - Delete NA1 areas after ASBA operation (override - BOPTN command settings). - - KEEP - Keep NA1 areas after ASBA operation (override BOPTN - command settings). - - keep2 - Specifies whether NA2 areas are to be deleted: - - (blank) - Use the setting of KEEP on the BOPTN command. - - DELETE - Delete NA2 areas after ASBA operation (override - BOPTN command settings). - - KEEP - Keep NA2 areas after ASBA operation (override BOPTN - command settings). - - Returns - ------- - int - Area number of the new area (if applicable) - - Examples - -------- - Subtract a 0.5 x 0.5 rectangle from a 1 x 1 rectangle. - - >>> anum0 = mapdl.blc4(0, 0, 1, 1) - >>> anum1 = mapdl.blc4(0.25, 0.25, 0.5, 0.5) - >>> aout = mapdl.asba(anum0, anum1) - >>> aout - 3 - - """ - command = f"ASBA,{na1},{na2},{sepo},{keep1},{keep2}" - return parse.parse_output_volume_area(self.run(command, **kwargs)) - - def asbl(self, na="", nl="", keepa="", keepl="", **kwargs): - """Subtracts lines from areas. - - APDL Command: ASBL - - Parameters - ---------- - na - Area (or areas, if picking is used) to be subtracted from. If ALL, - use all selected areas. If P, graphical picking is enabled (valid - only in the GUI) and remaining fields are ignored. A component - name may also be substituted for NA. - - nl - Line (or lines, if picking is used) to subtract. If ALL, use all - selected lines. A component name may also be substituted for NL. - - keepa - Specifies whether NA areas are to be deleted: - - (blank) - Use the setting of KEEP on the BOPTN command. - - DELETE - Delete NA areas after ASBL operation (override BOPTN command settings). - - KEEP - Keep NA areas after ASBL operation (override BOPTN command settings). - - keepl - Specifies whether NL lines are to be deleted: - - (blank) - Use the setting of KEEP on the BOPTN command. - - DELETE - Delete NL lines after ASBL operation (override BOPTN command settings). - - KEEP - Keep NL lines after ASBL operation (override BOPTN command settings). - - Notes - ----- - Generates new areas by subtracting the regions common to both the areas - and lines (the intersection) from the NA areas. The intersection will - be a line(s). See Solid Modeling in the Modeling and Meshing Guide for - an illustration. See the BOPTN command for an explanation of the - options available to Boolean operations. Element attributes and solid - model boundary conditions assigned to the original entities will not be - transferred to the new entities generated. - """ - command = f"ASBL,{na},{nl},,{keepa},{keepl}" - return self.run(command, **kwargs) - - def asbv(self, na="", nv="", sepo="", keepa="", keepv="", **kwargs): - """Subtracts volumes from areas. - - APDL Command: ASBV - - Parameters - ---------- - na - Area (or areas, if picking is used) to be subtracted from. If ALL, - use all selected areas. If P, graphical picking is enabled (valid - only in the GUI) and remaining fields are ignored. A component - name may also be substituted for NA. - - nv - Volume (or volumes, if picking is used) to subtract. If ALL, use - all selected volumes. A component name may also be substituted for - NV. - - sepo - Behavior if the intersection of the areas and the volumes is a line - or lines: - - (blank) - The resulting areas will share line(s) where they touch. - - SEPO - The resulting areas will have separate, but coincident line(s) where they - touch. - - keepa - Specifies whether NA areas are to be deleted: - - (blank) - Use the setting of KEEP on the BOPTN command. - - DELETE - Delete NA areas after ASBV operation (override BOPTN command settings). - - KEEP - Keep NA areas after ASBV operation (override BOPTN command settings). - - keepv - Specifies whether NV volumes are to be deleted: - - (blank) - Use the setting of KEEP on the BOPTN command. - - DELETE - Delete volumes after ASBV operation (override BOPTN command settings). - - KEEP - Keep volumes after ASBV operation (override BOPTN command settings). - - Notes - ----- - Generates new areas by subtracting the regions common to both NA areas - and NV volumes (the intersection) from the NA areas. The intersection - can be an area(s) or line(s). If the intersection is a line and SEPO - is blank, the NA area is divided at the line and the resulting areas - will be connected, sharing a common line where they touch. If SEPO is - set to SEPO, NA is divided into two unconnected areas with separate - lines where they touch. See Solid Modeling in the Modeling and Meshing - Guide for an illustration. See the BOPTN command for an explanation of - the options available to Boolean operations. Element attributes and - solid model boundary conditions assigned to the original entities will - not be transferred to the new entities generated. - """ - command = f"ASBV,{na},{nv},{sepo},{keepa},{keepv}" - return self.run(command, **kwargs) - - def asbw(self, na="", sepo="", keep="", **kwargs): - """Subtracts the intersection of the working plane from areas (divides - - APDL Command: ASBW - areas). - - Parameters - ---------- - na - Area (or areas, if picking is used) to be subtracted from. If NA = - ALL, use all selected areas. If NA = P, graphical picking is - enabled (valid only in the GUI). A component name may also be - input for NA. - - sepo - Behavior of the created boundary. - - (blank) - The resulting areas will share line(s) where they touch. - - SEPO - The resulting areas will have separate, but coincident line(s). - - keep - Specifies whether NA areas are to be deleted. - - (blank) - Use the setting of KEEP on the BOPTN command. - - DELETE - Delete NA areas after ASBW operation (override BOPTN command settings). - - KEEP - Keep NA areas after ASBW operation (override BOPTN command settings). - - Notes - ----- - Generates new areas by subtracting the intersection of the working - plane from the NA areas. The intersection will be a line(s). The - working plane must not be in the same plane as the NA areas(s). If - SEPO is blank, the NA area is divided at the line and the resulting - areas will be connected, sharing a common line where they touch. If - SEPO is set to SEPO, NA is divided into two unconnected areas with - separate lines. The SEPO option may cause unintended consequences if - any keypoints exist along the cut plane. See Solid Modeling in the - Modeling and Meshing Guide for an illustration. See the BOPTN command - for an explanation of the options available to Boolean operations. - Element attributes and solid model boundary conditions assigned to the - original entities will not be transferred to the new entities - generated. - - Issuing the ASBW command under certain conditions may generate a - topological degeneracy error. Do not issue the command if: - - A sphere or cylinder has been scaled. (A cylinder must be scaled - unevenly in the XY plane.) - - A sphere or cylinder has not been scaled but the work plane has been - rotated. - """ - command = f"ASBW,{na},{sepo},{keep}" - return self.run(command, **kwargs) - - def boptn(self, lab="", value="", **kwargs): - """Specifies Boolean operation options. - - APDL Command: BOPTN - - Parameters - ---------- - lab - Default/status key: - - DEFA - Resets settings to default values. - - STAT - Lists status of present settings. - - value - Option settings if Lab = KEEP: - - NO - Delete entities used as input with a Boolean operation (default). Entities - will not be deleted if meshed or if attached to a higher - entity. - - YES - Keep input solid modeling entities. - - Notes - ----- - Boolean operations at Revision 5.2 may produce a different number of - entities than previous revisions of ANSYS. When running input files - created at earlier revisions of ANSYS, match the Boolean compatibility - option (VERSION) to the revision originally used. For instance, if you - are running Revision 5.2 and are reading an input file (/INPUT) created - at Revision 5.1, it is recommended that you set VERSION to RV51 before - reading the input. - - See the Modeling and Meshing Guide for further details on the functions - of the RV51 and RV52 labels. - - This command is valid in any processor. - """ - command = f"BOPTN,{lab},{value}" - return self.run(command, **kwargs) - - def btol(self, ptol="", **kwargs): - """Specifies the Boolean operation tolerances. - - APDL Command: BTOL - - Parameters - ---------- - ptol - Point coincidence tolerance. Points within this distance to each - other will be assumed to be coincident during Boolean operations. - Loosening the tolerance will increase the run time and storage - requirements, but will allow more Boolean intersections to succeed. - Defaults to 0.10E-4. - - Notes - ----- - Use BTOL,DEFA to reset the setting to its default value. Use BTOL,STAT - to list the status of the present setting. - """ - command = f"BTOL,{ptol}" - return self.run(command, **kwargs) - - def lcsl( - self, - nl1="", - nl2="", - nl3="", - nl4="", - nl5="", - nl6="", - nl7="", - nl8="", - nl9="", - **kwargs, - ): - """Divides intersecting lines at their point(s) of intersection. - - APDL Command: LCSL - - Parameters - ---------- - nl1, nl2, nl3, . . . , nl9 - Numbers of lines to be intersected. If NL1 = ALL, NL2 to NL9 are - ignored and the intersection of all selected lines is found. If - NL1 = P, use graphical picking to specify lines (NL2 to NL9 are - ignored). - - Notes - ----- - Divides intersecting (classifies) lines at their point(s) of - intersection. The original lines (and their corresponding keypoint(s)) - will be deleted by default. See the BOPTN command for the options - available to Boolean operations. Element attributes and solid model - boundary conditions assigned to the original entities will not be - transferred to the new entities generated. - """ - command = f"LCSL,{nl1},{nl2},{nl3},{nl4},{nl5},{nl6},{nl7},{nl8},{nl9}" - return self.run(command, **kwargs) - - def lglue( - self, - nl1="", - nl2="", - nl3="", - nl4="", - nl5="", - nl6="", - nl7="", - nl8="", - nl9="", - **kwargs, - ): - """Generates new lines by "gluing" lines. - - APDL Command: LGLUE - - Parameters - ---------- - nl1, nl2, nl3, . . . , nl9 - Numbers of the lines to be glued. If NL1 = ALL, all selected lines - will be glued (NL2 to NL9 will be ignored). If NL1 = 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 NL1. - - Notes - ----- - Use of the LGLUE command generates new lines by "gluing" input lines. - The glue operation redefines the input lines so that they share - keypoints at their common ends. The new lines encompass the same - geometry as the original lines. This operation is only valid if the - intersections of the input lines are keypoints at the ends of those - lines. See the Modeling and Meshing Guide for an illustration. See - the BOPTN command for an explanation of the options available to - Boolean operations. Element attributes and solid model boundary - conditions assigned to the original entities will not be transferred to - the new entities generated. - - The LGLUE command results in the merging of keypoints at the common end - of the lines. The keypoints of the lower numbered line will be kept. - This means one must be aware of line numbering when multiple LGLUE - commands are applied to avoid any "ungluing" of geometry. - """ - command = f"LGLUE,{nl1},{nl2},{nl3},{nl4},{nl5},{nl6},{nl7},{nl8},{nl9}" - return self.run(command, **kwargs) - - def lina(self, nl="", na="", **kwargs): - """Finds the intersection of a line with an area. - - APDL Command: LINA - - Parameters - ---------- - nl - Number of line to be intersected. If NL = P, graphical picking is - enabled and all remaining command fields are ignored (valid only in - the GUI). - - na - Number of area to be intersected. - - Notes - ----- - Finds the intersection of a line with an area. New lines will be - generated where the lines intersect the areas. If the regions of - intersection are only points, new keypoints will be generated instead. - See the Modeling and Meshing Guide for an illustration. See the BOPTN - command for the options available to Boolean operations. Element - attributes and solid model boundary conditions assigned to the original - entities will not be transferred to the new entities generated. - """ - command = f"LINA,{nl},{na}" - return self.run(command, **kwargs) - - def linl( - self, - nl1="", - nl2="", - nl3="", - nl4="", - nl5="", - nl6="", - nl7="", - nl8="", - nl9="", - **kwargs, - ): - """Finds the common intersection of lines. - - APDL Command: LINL - - Parameters - ---------- - nl1, nl2, nl3, . . . , nl9 - Numbers of lines to be intersected. If NL1 = ALL, find the - intersection of all selected lines and NL2 to NL9 are ignored. If - NL1 = 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 NL1. - - Notes - ----- - Finds the common (not pairwise) intersection of lines. The common - intersection is defined as the regions shared (in common) by all lines - listed on this command. New lines will be generated where the original - lines intersect. If the regions of intersection are only points, new - keypoints will be generated instead. See the Modeling and Meshing - Guide for an illustration. See the BOPTN command for the options - available to Boolean operations. Element attributes and solid model - boundary conditions assigned to the original entities will not be - transferred to the new entities generated. - """ - command = f"LINL,{nl1},{nl2},{nl3},{nl4},{nl5},{nl6},{nl7},{nl8},{nl9}" - return self.run(command, **kwargs) - - def linp( - self, - nl1="", - nl2="", - nl3="", - nl4="", - nl5="", - nl6="", - nl7="", - nl8="", - nl9="", - **kwargs, - ): - """Finds the pairwise intersection of lines. - - APDL Command: LINP - - Parameters - ---------- - nl1, nl2, nl3, . . . , nl9 - Numbers of lines to be intersected pairwise. If NL1 = ALL, find - the pairwise intersection of all selected lines and NL2 to NL9 are - ignored. If NL1 = P, graphical picking is enabled and all - remaining command fields are ignored (valid only in the GUI). A - component name may be substituted for NL1. - - Notes - ----- - Finds the pairwise intersection of lines. The pairwise intersection is - defined as any and all regions shared by at least two lines listed on - this command. New lines will be generated where the original lines - intersect pairwise. If the regions of pairwise intersection are only - points, new keypoints will be generated. See the Modeling and Meshing - Guide for an illustration. See the BOPTN command for the options - available to Boolean operations. Element attributes and solid model - boundary conditions assigned to the original entities will not be - transferred to the new entities generated. - """ - command = f"LINP,{nl1},{nl2},{nl3},{nl4},{nl5},{nl6},{nl7},{nl8},{nl9}" - return self.run(command, **kwargs) - - def linv(self, nl="", nv="", **kwargs): - """Finds the intersection of a line with a volume. - - APDL Command: LINV - - Parameters - ---------- - nl - Number of line to be intersected. If NL = P, graphical picking is - enabled and all remaining command fields are ignored (valid only in - the GUI). - - nv - Number of volume to be intersected. - - Notes - ----- - Finds the intersection of a line with a volume. New lines will be - generated where the lines intersect the volumes. If the regions of - intersection are only points, new keypoints will be generated instead. - See the Modeling and Meshing Guide for an illustration. See the BOPTN - command for the options available to Boolean operations. Element - attributes and solid model boundary conditions assigned to the original - entities will not be transferred to the new entities generated. - """ - command = f"LINV,{nl},{nv}" - return self.run(command, **kwargs) - - def lovlap( - self, - nl1="", - nl2="", - nl3="", - nl4="", - nl5="", - nl6="", - nl7="", - nl8="", - nl9="", - **kwargs, - ): - """Overlaps lines. - - APDL Command: LOVLAP - - Parameters - ---------- - nl1, nl2, nl3, . . . , nl9 - Numbers of lines to be overlapped. If NL1 = ALL, NL2 to NL9 are - ignored and all selected lines are overlapped. If NL1 = 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 NL1. - - Notes - ----- - Overlaps lines. Generates new lines which encompass the geometry of all - the input lines. The new lines are defined by the regions of - intersection of the input lines, and by the complementary (non- - intersecting) regions. See the Modeling and Meshing Guide for an - illustration. This operation is only valid when the region of - intersection is a line. See the BOPTN command for an explanation of - the options available to Boolean operations. Element attributes and - solid model boundary conditions assigned to the original entities will - not be transferred to the new entities generated. - """ - command = f"LOVLAP,{nl1},{nl2},{nl3},{nl4},{nl5},{nl6},{nl7},{nl8},{nl9}" - return self.run(command, **kwargs) - - def lptn( - self, - nl1="", - nl2="", - nl3="", - nl4="", - nl5="", - nl6="", - nl7="", - nl8="", - nl9="", - **kwargs, - ): - """Partitions lines. - - APDL Command: LPTN - - Parameters - ---------- - nl1, nl2, nl3, . . . , nl9 - Numbers of lines to be operated on. If NL1 = ALL, NL2 to NL9 are - ignored all selected lines are used. If NL1 = P, graphical picking - is enabled and all remaining command fields are ignored (valid only - in the GUI). A component name may be substituted for NL1. - - Notes - ----- - Partitions lines. Generates new lines which encompass the geometry of - all the input lines. The new lines are defined by both the regions of - intersection of the input lines and the complementary (non- - intersecting) regions. See the Modeling and Meshing Guide for an - illustration. See the BOPTN command for an explanation of the options - available to Boolean operations. Element attributes and solid model - boundary conditions assigned to the original entities will not be - transferred to the new entities generated. - """ - command = f"LPTN,{nl1},{nl2},{nl3},{nl4},{nl5},{nl6},{nl7},{nl8},{nl9}" - return self.run(command, **kwargs) - - def lsba(self, nl="", na="", sepo="", keepl="", keepa="", **kwargs): - """Subtracts areas from lines. - - APDL Command: LSBA - - Parameters - ---------- - nl - Line (or lines, if picking is used) to be subtracted from. If ALL, - use all selected lines. If NL = 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 NL. - - na - Area (or areas, if picking is used) to be subtracted. If ALL, use - all selected areas. A component name may also be substituted for - NA. - - sepo - Behavior if the intersection of the lines and the areas is a - keypoint or keypoints: - - (blank) - The resulting lines will share keypoint(s) where they touch. - - SEPO - The resulting lines will have separate, but coincident keypoint(s) where they - touch. - - keepl - Specifies whether NL lines are to be deleted: - - (blank) - Use the setting of KEEP on the BOPTN command. - - DELETE - Delete NL lines after LSBA operation (override BOPTN command settings). - - KEEP - Keep NL lines after LSBA operation (override BOPTN command settings). - - keepa - Specifies whether NA areas are to be deleted: - - (blank) - Use the setting of KEEP on the BOPTN command. - - DELETE - Delete areas after LSBA operation (override BOPTN command settings). - - KEEP - Keep areas after LSBA operation (override BOPTN command settings). - - Notes - ----- - Generates new lines by subtracting the regions common to both NL lines - and NA areas (the intersection) from the NL lines. The intersection - can be a line(s) or keypoint(s). If the intersection is a keypoint and - SEPO is blank, the NL line is divided at the keypoint and the resulting - lines will be connected, sharing a common keypoint where they touch. - If SEPO is set to SEPO, NL is divided into two unconnected lines with - separate keypoints where they touch. See the Modeling and Meshing - Guide for an illustration. See the BOPTN command for an explanation of - the options available to Boolean operations. Element attributes and - solid model boundary conditions assigned to the original entities will - not be transferred to the new entities generated. - """ - command = f"LSBA,{nl},{na},{sepo},{keepl},{keepa}" - return self.run(command, **kwargs) - - def lsbl(self, nl1="", nl2="", sepo="", keep1="", keep2="", **kwargs): - """Subtracts lines from lines. - - APDL Command: LSBL - - Parameters - ---------- - nl1 - Line (or lines, if picking is used) to be subtracted from. If ALL, - use all selected lines. Lines specified in this argument are not - available for use in the NL2 argument. If P, graphical picking is - enabled (valid only in the GUI) and all remaining fields are - ignored. A component name may also be substituted for NL1. - - nl2 - Line (or lines, if picking is used) to subtract. If ALL, use all - selected lines (except those included in the NL1 argument). A - component name may also be substituted for NL2. - - sepo - Behavior if the intersection of the NL1 lines and the NL2 lines is - a keypoint or keypoints: - - (blank) - The resulting lines will share keypoint(s) where they touch. - - SEPO - The resulting lines will have separate, but coincident keypoint(s) where they - touch. - - keep1 - Specifies whether NL1 lines are to be deleted: - - (blank) - Use the setting of KEEP on the BOPTN command. - - DELETE - Delete NL1 lines after LSBL operation (override BOPTN command settings). - - KEEP - Keep NL1 lines after LSBL operation (override BOPTN command settings). - - keep2 - Specifies whether NL2 lines are to be deleted: - - (blank) - Use the setting of KEEP on the BOPTN command. - - DELETE - Delete NL2 lines after LSBL operation (override BOPTN command settings). - - KEEP - Keep NL2 lines after LSBL operation (override BOPTN command settings). - - Notes - ----- - Generates new lines by subtracting the regions common to both NL1 and - NL2 lines (the intersection) from the NL1 lines. The intersection can - be a line(s) or point(s). If the intersection is a point and SEPO is - blank, the NL1 line is divided at the point and the resulting lines - will be connected, sharing a common keypoint where they touch. If SEPO - is set to SEPO, NL1 is divided into two unconnected lines with separate - keypoints where they touch. See the Modeling and Meshing Guide for an - illustration. See the BOPTN command for an explanation of the options - available to Boolean operations. Element attributes and solid model - boundary conditions assigned to the original entities will not be - transferred to the new entities generated. LSBL,ALL,ALL will have no - effect since all the lines (in NL1) will be unavailable as NL2 lines. - """ - command = f"LSBL,{nl1},{nl2},{sepo},{keep1},{keep2}" - return self.run(command, **kwargs) - - def lsbv(self, nl="", nv="", sepo="", keepl="", keepv="", **kwargs): - """Subtracts volumes from lines. - - APDL Command: LSBV - - Parameters - ---------- - nl - Line (or lines, if picking is used) to be subtracted from. If ALL, - use all selected lines. If NL = 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 NL. - - nv - Volume (or volumes, if picking is used) to be subtracted. If ALL, - use all selected volumes. A component name may also be substituted - for NV. - - sepo - Behavior if the intersection of the NL lines and the NV volumes is - a keypoint or keypoints: - - (blank) - The resulting lines will share keypoint(s) where they touch. - - SEPO - The resulting lines will have separate, but coincident keypoint(s) where they - touch. - - keepl - Specifies whether NL lines are to be deleted: - - (blank) - Use the setting of KEEP on the BOPTN command. - - DELETE - Delete NL lines after LSBV operation (override BOPTN command settings). - - KEEP - Keep NL lines after LSBV operation (override BOPTN command settings). - - keepv - Specifies whether NV volumes are to be deleted: - - (blank) - Use the setting of KEEP on the BOPTN command. - - DELETE - Delete NV volumes after LSBV operation (override BOPTN command settings). - - KEEP - Keep NV volumes after LSBV operation (override BOPTN command settings). - - Notes - ----- - Generates new lines by subtracting the regions common to both NL lines - and NV volumes (the intersection) from the NL lines. The intersection - can be a line(s) or point(s). If the intersection is a point and SEPO - is blank, the NL1 line is divided at the point and the resulting lines - will be connected, sharing a common keypoint where they touch. If SEPO - is set to SEPO, NL1 is divided into two unconnected lines with separate - keypoints where they touch. See the Modeling and Meshing Guide for an - illustration. See the BOPTN command for an explanation of the options - available to Boolean operations. Element attributes and solid model - boundary conditions assigned to the original entities will not be - transferred to the new entities generated. LSBL,ALL,ALL will have no - effect since all the lines (in NL1) will be unavailable as NL2 lines. - """ - command = f"LSBV,{nl},{nv},{sepo},{keepl},{keepv}" - return self.run(command, **kwargs) - - def lsbw(self, nl="", sepo="", keep="", **kwargs): - """Subtracts the intersection of the working plane from lines (divides - - APDL Command: LSBW - lines). - - Parameters - ---------- - nl - Line (or lines, if picking is used) to be subtracted from. If NL = - ALL, use all selected lines. If NL = P, graphical picking is - enabled and all remaining command fields are ignored (valid only in - the GUI). A component name may also be input for NL. - - sepo - Behavior of the created boundary. - - (blank) - The resulting lines will share keypoint(s) where they touch. - - SEPO - The resulting lines will have separate, but coincident keypoint(s). - - keep - Specifies whether NL lines are to be deleted: - - (blank) - Use the setting of KEEP on the BOPTN command. - - DELETE - Delete NL lines after LSBW operation (override BOPTN command settings). - - KEEP - Keep NL lines after LSBW operation (override BOPTN command settings). - - Notes - ----- - Generates new lines by subtracting the intersection of the working - plane from the NL lines. The intersection will be a keypoint(s). The - working plane must not be in the same plane as the NL line(s). If SEPO - is blank, the NL line is divided and the resulting lines will be - connected, sharing a common keypoint where they touch. If SEPO is set - to SEPO, NL is divided into two unconnected lines with separate - keypoints. See the Modeling and Meshing Guide for an illustration. - See the BOPTN command for an explanation of the options available to - Boolean operations. Element attributes and solid model boundary - conditions assigned to the original entities will not be transferred to - the new entities generated. Areas that completely contain the input - lines will be updated if the lines are divided by this operation. - """ - command = f"LSBW,{nl},{sepo},{keep}" - return self.run(command, **kwargs) - - def vadd( - self, - nv1="", - nv2="", - nv3="", - nv4="", - nv5="", - nv6="", - nv7="", - nv8="", - nv9="", - **kwargs, - ): - """Adds separate volumes to create a single volume. - - APDL Command: VADD - - Parameters - ---------- - nv1, nv2, nv3, . . . , nv9 - Numbers of volumes to be added. If NV1 = ALL, add all selected - volumes and ignore NV2 to NV9. 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. - - Notes - ----- - Adds separate volumes to create a single volume. The original volumes - (and their corresponding areas, lines and keypoints) will be deleted by - default [BOPTN]. See the BOPTN command for the options available to - Boolean operations. Element attributes and solid model boundary - conditions assigned to the original entities will not be transferred to - the new entities generated. Concatenated entities are not valid with - this command. - """ - command = f"VADD,{nv1},{nv2},{nv3},{nv4},{nv5},{nv6},{nv7},{nv8},{nv9}" - return self.run(command, **kwargs) - - def vglue( - self, - nv1="", - nv2="", - nv3="", - nv4="", - nv5="", - nv6="", - nv7="", - nv8="", - nv9="", - **kwargs, - ): - """Generates new volumes by "gluing" volumes. - - APDL Command: VGLUE - - Parameters - ---------- - nv1, nv2, nv3, . . . , nv9 - Numbers of the volumes to be glued. If NV1 = ALL, all selected - volumes will be glued (NV2 to NV9 will be ignored). 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. - - Notes - ----- - Use of the VGLUE command generates new volumes by "gluing" input - volumes. The glue operation redefines the input volumes so that they - share areas along their common boundaries. The new volumes encompass - the same geometry as the original volumes. This operation is only - valid if the intersections of the input volumes are areas along the - boundaries of those volumes. See the Modeling and Meshing Guide for an - illustration. See the BOPTN command for an explanation of the options - available to Boolean operations. Element attributes and solid model - boundary conditions assigned to the original entities will not be - transferred to the new entities generated. - - The VGLUE command results in the merging of areas, lines, and keypoints - at the common volume boundaries. The areas, lines, and keypoints of the - lower numbered volume will be kept. This means one must be aware of - volume numbering when multiple VGLUE commands are applied to avoid any - "ungluing" of geometry. - """ - command = f"VGLUE,{nv1},{nv2},{nv3},{nv4},{nv5},{nv6},{nv7},{nv8},{nv9}" - return self.run(command, **kwargs) - - def vinp( - self, - nv1="", - nv2="", - nv3="", - nv4="", - nv5="", - nv6="", - nv7="", - nv8="", - nv9="", - **kwargs, - ): - """Finds the pairwise intersection of volumes. - - APDL Command: VINP - - Parameters - ---------- - nv1, nv2, nv3, . . . , nv9 - Numbers of volumes to be intersected pairwise. If NV1 = ALL, NV2 - to NV9 are ignored and the pairwise intersection of all selected - volumes is found. 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. - - Notes - ----- - Finds the pairwise intersection of volumes. The pairwise intersection - is defined as all regions shared by any two or more volumes listed on - this command. New volumes will be generated where the original volumes - intersect pairwise. If the regions of pairwise intersection are only - areas, new areas will be generated. See the Modeling and Meshing Guide - for an illustration. See the BOPTN command for an explanation of the - options available to Boolean operations. Element attributes and solid - model boundary conditions assigned to the original entities will not be - transferred to the new entities generated. - """ - command = f"VINP,{nv1},{nv2},{nv3},{nv4},{nv5},{nv6},{nv7},{nv8},{nv9}" - return self.run(command, **kwargs) - - def vinv( - self, - nv1="", - nv2="", - nv3="", - nv4="", - nv5="", - nv6="", - nv7="", - nv8="", - nv9="", - **kwargs, - ): - """Finds the intersection of volumes. - - APDL Command: VINV - - Parameters - ---------- - nv1, nv2, nv3, . . . , nv9 - Numbers of volumes to be intersected. If NV1 = ALL, NV2 to NV9 are - ignored, and the intersection of all selected volumes is found. 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. - - Notes - ----- - Finds the common (not pairwise) intersection of volumes. The common - intersection is defined as the regions shared (in common) by all - volumes listed on this command. New volumes will be generated where - the original volumes intersect. If the regions of intersection are - only areas, new areas will be generated instead. See the Modeling and - Meshing Guide for an illustration. See the BOPTN command for an - explanation of the options available to Boolean operations. Element - attributes and solid model boundary conditions assigned to the original - entities will not be transferred to the new entities generated. - """ - command = f"VINV,{nv1},{nv2},{nv3},{nv4},{nv5},{nv6},{nv7},{nv8},{nv9}" - return self.run(command, **kwargs) - - def vovlap( - self, - nv1="", - nv2="", - nv3="", - nv4="", - nv5="", - nv6="", - nv7="", - nv8="", - nv9="", - **kwargs, - ): - """Overlaps volumes. - - APDL Command: VOVLAP - - Parameters - ---------- - nv1, nv2, nv3, . . . , nv9 - Numbers of volumes to be operated on. If NV1 = ALL, NV2 to NV9 are - ignored and all selected volumes are used. 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. - - Notes - ----- - Overlaps volumes. Generates new volumes which encompass the geometry of - all the input volumes. The new volumes are defined by the regions of - intersection of the input volumes, and by the complementary (non- - intersecting) regions. See the Modeling and Meshing Guide for an - illustration. This operation is only valid when the region of - intersection is a volume. See the BOPTN command for an explanation of - the options available to Boolean operations. Element attributes and - solid model boundary conditions assigned to the original entities will - not be transferred to the new entities generated. - """ - command = f"VOVLAP,{nv1},{nv2},{nv3},{nv4},{nv5},{nv6},{nv7},{nv8},{nv9}" - return self.run(command, **kwargs) - - def vptn( - self, - nv1="", - nv2="", - nv3="", - nv4="", - nv5="", - nv6="", - nv7="", - nv8="", - nv9="", - **kwargs, - ): - """Partitions volumes. - - APDL Command: VPTN - - Parameters - ---------- - nv1, nv2, nv3, . . . , nv9 - Numbers of volumes to be operated on. If NV1 = ALL, NV2 to NV9 are - ignored and all selected volumes are used. 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. - - Notes - ----- - Partitions volumes. Generates new volumes which encompass the geometry - of all the input volumes. The new volumes are defined by the regions - of intersection of the input volumes, and by the complementary (non- - intersecting) regions. See the Modeling and Meshing Guide for an - illustration. See the BOPTN command for an explanation of the options - available to Boolean operations. Element attributes and solid model - boundary conditions assigned to the original entities will not be - transferred to the new entities generated. - """ - command = f"VPTN,{nv1},{nv2},{nv3},{nv4},{nv5},{nv6},{nv7},{nv8},{nv9}" - return self.run(command, **kwargs) - - def vsba(self, nv="", na="", sepo="", keepv="", keepa="", **kwargs): - """Subtracts areas from volumes. - - APDL Command: VSBA - - Parameters - ---------- - nv - Volume (or volumes, if picking is used) to be subtracted from. If - ALL, use all selected volumes. If P, graphical picking is enabled - (valid only in the GUI) and remaining fields are ignored. A - component name may also be substituted for NV. - - na - Area (or areas, if picking is used) to subtract. If ALL, use all - selected areas. A component name may also be substituted for NA. - - sepo - Behavior of the touching boundary: - - (blank) - The resulting volumes will share area(s) where they touch. - - SEPO - The resulting volumes will have separate, but coincident area(s) where they - touch. - - keepv - Specifies whether NV volumes are to be deleted: - - (blank) - Use the setting of KEEP on the BOPTN command. - - DELETE - Delete NV volumes after VSBA operation (override BOPTN command settings). - - KEEP - Keep NV volumes after VSBA operation (override BOPTN command settings). - - keepa - Specifies whether NA areas are to be deleted: - - (blank) - Use the setting of KEEP on the BOPTN command. - - DELETE - Delete NA areas after VSBA operation (override BOPTN command settings). - - KEEP - Keep NA areas after VSBA operation (override BOPTN command settings). - - Notes - ----- - Generates new volumes by subtracting the regions common to both the - volumes and areas (the intersection) from the NV volumes. The - intersection will be an area(s). If SEPO is blank, the volume is - divided at the area and the resulting volumes will be connected, - sharing a common area where they touch. If SEPO is set to SEPO, the - volume is divided into two unconnected volumes with separate areas - where they touch. See the Modeling and Meshing Guide for an - illustration. See the BOPTN command for an explanation of the options - available to Boolean operations. Element attributes and solid model - boundary conditions assigned to the original entities will not be - transferred to the new entities generated. - """ - command = f"VSBA,{nv},{na},{sepo},{keepv},{keepa}" - return self.run(command, **kwargs) - - def vsbv(self, nv1="", nv2="", sepo="", keep1="", keep2="", **kwargs): - """Subtracts volumes from volumes. - - APDL Command: VSBV - - Parameters - ---------- - nv1 - Volume (or volumes, if picking is used) to be subtracted - from. If ALL, use all selected volumes. Volumes - specified in set NV2 are removed from set NV1. If P, - graphical picking is enabled (valid only in the GUI) and - remaining fields are ignored. A component name may also - be substituted for NV1. - - nv2 - Volume (or volumes, if picking is used) to subtract. If - ALL, use all selected volumes (except those included in - the NV1 argument). A component name may also be - substituted for NV2. - - sepo - Behavior if the intersection of the NV1 volumes and the - NV2 volumes is an area or areas: - - (blank) - The resulting volumes will share area(s) where they touch. - - SEPO - The resulting volumes will have separate, but - coincident area(s) where they touch. - - keep1 - Specifies whether NV1 volumes are to be deleted: - - (blank) - Use the setting of KEEP on the BOPTN command. - - DELETE - Delete NV1 volumes after VSBV operation (override - BOPTN command settings). - - KEEP - Keep NV1 volumes after VSBV operation (override - BOPTN command settings). - - keep2 - Specifies whether NV2 volumes are to be deleted: - - (blank) - Use the setting of KEEP on the BOPTN command. - - DELETE - Delete NV2 volumes after VSBV operation (override - BOPTN command settings). - - KEEP - Keep NV2 volumes after VSBV operation (override - BOPTN command settings). - - Notes - ----- - Generates new volumes by subtracting the regions common to - both NV1 and NV2 volumes (the intersection) from the NV1 - volumes. The intersection can be a volume(s) or area(s). If - the intersection is an area and SEPO is blank, the NV1 volume - is divided at the area and the resulting volumes will be - connected, sharing a common area where they touch. If SEPO is - set to SEPO, NV1 is divided into two unconnected volumes with - separate areas where they touch. See the Modeling and Meshing - Guide for an illustration. See the BOPTN command for an - explanation of the options available to Boolean operations. - Element attributes and solid model boundary conditions - assigned to the original entities will not be transferred to - the new entities generated. VSBV,ALL,ALL will have no effect - because all the volumes in set NV1will have been moved to set - NV2. - """ - command = f"VSBV,{nv1},{nv2},{sepo},{keep1},{keep2}" - return self.run(command, **kwargs) - - def vsbw(self, nv="", sepo="", keep="", **kwargs): - """Subtracts intersection of the working plane from volumes. - - APDL Command: VSBW - - Parameters - ---------- - nv - Volume (or volumes, if picking is used) to be subtracted from. If - NV = ALL, use all selected volumes. If NV = P, graphical picking - is enabled (valid only in the GUI). A component name may also be - input for NV. - - sepo - Behavior of the created boundary. - - (blank) - The resulting volumes will share area(s) where they touch. - - SEPO - The resulting volumes will have separate, but coincident area(s). - - keep - Specifies whether NV volumes are to be deleted. - - (blank) - Use the setting of KEEP on the BOPTN command. - - DELETE - Delete NV volumes after VSBW operation (override BOPTN command settings). - - KEEP - Keep NV volumes after VSBW operation (override BOPTN command settings). - - Notes - ----- - Generates new volumes by subtracting the intersection of the working - plane from the NV volumes. The intersection will be an area(s). If - SEPO is blank, the volume is divided at the area and the resulting - volumes will be connected, sharing a common area where they touch. If - SEPO is set to SEPO, the volume is divided into two unconnected volumes - with separate areas. The SEPO option may cause unintended consequences - if any keypoints exist along the cut plane. See the Modeling and - Meshing Guide for an illustration. See the BOPTN command for an - explanation of the options available to Boolean operations. Element - attributes and solid model boundary conditions assigned to the original - entities will not be transferred to the new entities generated. - - Issuing the VSBW command under certain conditions may generate a - topological degeneracy error. Do not issue the command if: - - A sphere or cylinder has been scaled. (A cylinder must be scaled - unevenly in the XY plane.) - - A sphere or cylinder has not been scaled but the work plane has been - rotated. - """ - command = f"VSBW,{nv},{sepo},{keep}" - return self.run(command, **kwargs) diff --git a/src/ansys/mapdl/core/_commands/preproc/constraint_equations.py b/src/ansys/mapdl/core/_commands/preproc/constraint_equations.py deleted file mode 100644 index cccd16e21c7..00000000000 --- a/src/ansys/mapdl/core/_commands/preproc/constraint_equations.py +++ /dev/null @@ -1,550 +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 ConstraintEquations: - def ce( - self, - neqn="", - const="", - node1="", - lab1="", - c1="", - node2="", - lab2="", - c2="", - node3="", - lab3="", - c3="", - **kwargs, - ): - """Defines a constraint equation relating degrees of freedom. - - APDL Command: CE - - Parameters - ---------- - neqn - Set equation reference number: - - n - Arbitrary set number. - - HIGH - The highest defined constraint equation number. This option is especially - useful when adding nodes to an existing set. - - NEXT - The highest defined constraint equation number plus one. This option - automatically numbers coupled sets so that existing sets are - not modified. - - const - Constant term of equation. - - node1 - Node for first term of equation. If -NODE1, this term is deleted - from the equation. - - lab1 - Degree of freedom label for first term of equation. Structural - labels: UX, UY, or UZ (displacements); ROTX, ROTY, or ROTZ - (rotations, in radians). Thermal labels: TEMP, TBOT, TE2, TE3, . . - ., TTOP (temperature). Electric labels: VOLT (voltage). Magnetic - labels: MAG (scalar magnetic potential); AX, AY, or AZ (vector - magnetic potentials). Diffusion label: CONC (concentration). - - c1 - Coefficient for first node term of equation. If zero, this term is - ignored. - - node2, lab2, c2 - Node, label, and coefficient for second term. - - node3, lab3, c3 - Node, label, and coefficient for third term. - - Notes - ----- - Repeat the CE command to add additional terms to the same equation. To - change only the constant term, repeat the command with no node terms - specified. Only the constant term can be changed during solution, and - only with the CECMOD command. - - Linear constraint equations may be used to relate the degrees of - freedom of selected nodes in a more general manner than described for - nodal coupling [CP]. The constraint equation is of the form: - - where U(I) is the degree of freedom (displacement, temperature, etc.) - of term (I). The following example is a set of two constraint - equations, each containing three terms: - - 0.0 = 3.0* (1 UX) + 3.0* (4 UX) + (-2.0)* (4 ROTY) - - 2.0 = 6.0* (2 UX) + 10.0* (4 UY) + 1.0* (3 UZ) - - The first unique degree of freedom in the equation is eliminated in - terms of all other degrees of freedom in the equation. A unique degree - of freedom is one which is not specified in any other constraint - equation, coupled node set, specified displacement set, or master - degree of freedom set. It is recommended that the first term of the - equation be the degree of freedom to be eliminated. The first term of - the equation cannot contain a master degree of freedom, and no term can - contain coupled degrees of freedom. The same degree of freedom may be - specified in more than one equation but care must be taken to avoid - over-specification (over-constraint). - - The degrees of freedom specified in the equation (i.e., UX, UY, ROTZ, - etc.) must also be included in the model (as determined from the - element types [ET]). Also, each node in the equation must be defined - on an element (any element type containing that degree of freedom will - do). - - For buckling and modal analyses, the constant term of the equation will - not be taken into account (that is, CONST is always zero). - - Note that under certain circumstances a constraint equation generated - by CE may be modified during the solution. See Program Modification of - Constraint Equations for more information. - """ - command = f"CE,{neqn},{const},{node1},{lab1},{c1},{node2},{lab2},{c2},{node3},{lab3},{c3}" - return self.run(command, **kwargs) - - def cecyc( - self, - lowname="", - highname="", - nsector="", - hindex="", - tolerance="", - kmove="", - kpairs="", - **kwargs, - ): - """Generates the constraint equations for a cyclic symmetry analysis - - APDL Command: CECYC - - Parameters - ---------- - lowname - Name of a component for the nodes on the low angle edge of the - sector. Enclosed in single quotes. - - highname - Name of a component for the nodes on the high angle edge of the - sector. Enclosed in single quotes. - - nsector - Number of sectors in the complete 360 degrees. - - hindex - Harmonic index to be represented by this set of constraint - equations. If Hindex is -1, generate constraint equations for - static cyclic symmetry. If HIndex is -2, generate constraint - equations for static cyclic asymmetry. - - tolerance - A positive tolerance is an absolute tolerance (length units), and a - negative tolerance is a tolerance relative to the local element - size. - - kmove - 0 - - 0 - Nodes are not moved. - - 1 - HIGHNAME component nodes are moved to match LOWNAME component nodes exactly. - - kpairs - 0 - - 0 - Do not print paired nodes - - 1 - Print table of paired nodes - - Notes - ----- - The analysis can be either modal cyclic symmetry or static cyclic - symmetry. - - The pair of nodes for which constraint equations are written are - rotated into CSYS,1. - """ - command = f"CECYC,{lowname},{highname},{nsector},{hindex},{tolerance},{kmove},{kpairs}" - return self.run(command, **kwargs) - - def cedele(self, neqn1="", neqn2="", ninc="", nsel="", **kwargs): - """Deletes constraint equations. - - APDL Command: CEDELE - - Parameters - ---------- - neqn1, neqn2, ninc - Delete constraint equations from NEQN1 to NEQN2 (defaults to NEQN1) - in steps of NINC (defaults to 1). If NEQN1 = ALL, NEQN2 and NINC - will be ignored all constraint equations will be deleted. - - nsel - Additional node selection control: - - ANY - Delete equation set if any of the selected nodes are in the set (default). - - ALL - Delete equation set only if all of the selected nodes are in the set. - """ - command = f"CEDELE,{neqn1},{neqn2},{ninc},{nsel}" - return self.run(command, **kwargs) - - def ceintf( - self, - toler="", - dof1="", - dof2="", - dof3="", - dof4="", - dof5="", - dof6="", - movetol="", - **kwargs, - ): - """Generates constraint equations at an interface. - - APDL Command: CEINTF - - Parameters - ---------- - toler - Tolerance about selected elements, based on a fraction of the - element dimension (defaults to 0.25 (25%)). Nodes outside the - element by more than the tolerance are not accepted as being on the - interface. - - dof1, dof2, dof3, . . . , dof6 - Degrees of freedom for which constraint equations are written. - Defaults to all applicable DOFs. DOF1 accepts ALL as a valid - label, in which case the rest are ignored (all DOFs are applied). - - movetol - The allowed "motion" of a node (see Note below). This distance is - in terms of the element coordinates (-1.0 to 1.0). A typical value - is 0.05. Defaults to 0 (do not move). MoveTol must be less than - or equal to TOLER. - - Notes - ----- - This command can be used to "tie" together two regions with dissimilar - mesh patterns by generating constraint equations that connect the - selected nodes of one region to the selected elements of the other - region. At the interface between regions, nodes should be selected - from the more dense mesh region, A, and the elements selected from the - less dense mesh region, B. The degrees of freedom of region A nodes - are interpolated with the corresponding degrees of freedom of the nodes - on the region B elements, using the shape functions of the region B - elements. Constraint equations are then written that relate region A - and B nodes at the interface. - - The MoveTol field lets the nodes in the previously mentioned region A - change coordinates when slightly inside or outside the elements of - region B. The change in coordinates causes the nodes of region A to - assume the same surface as the nodes associated with the elements of - region B. The constraint equations that relate the nodes at both - regions of the interface are then written. - - Solid elements with six degrees of freedom should only be interfaced - with other six degree-of-freedom elements. The region A nodes should - be near the region B elements. A location tolerance based on the - smallest region B element length may be input. Stresses across the - interface are not necessarily continuous. Nodes in the interface - region should not have specified constraints. - - Use the CPINTF command to connect nodes by coupling instead of - constraint equations. Use the EINTF command to connect nodes by line - elements. See also the NSEL and ESEL commands for selecting nodes and - elements. See the Mechanical APDL Theory Reference for a description - of 3-D space used to determine if a node will be considered by this - command. - - As an alternative to the CEINTF command, you can use contact elements - and the internal multipoint constraint (MPC) algorithm to tie together - two regions having dissimilar meshes. See Solid-Solid and Shell-Shell - Assemblies for more information. - """ - command = f"CEINTF,{toler},{dof1},{dof2},{dof3},{dof4},{dof5},{dof6},{movetol}" - return self.run(command, **kwargs) - - def celist(self, neqn1="", neqn2="", ninc="", option="", **kwargs): - """Lists the constraint equations. - - APDL Command: CELIST - - Parameters - ---------- - neqn1, neqn2, ninc - List constraint equations from NEQN1 to NEQN2 (defaults to NEQN1) - in steps of NINC (defaults to 1). If NEQN1 = ALL (default), NEQN2 - and NINC are ignored and all constraint equations are listed. - - option - Options for listing constraint equations: - - ANY - List equation set if any of the selected nodes are in the set (default). Only - externally-generated constraint equations are listed. - - ALL - List equation set only if all of the selected nodes are in the set. Only - externally-generated constraint equations are listed. - - INTE - List internally-generated constraint equations that are associated with MPC- - based contact. Constraint equations are listed only if all - the nodes in the set are selected. - - CONV - Convert internal constraint equations to external constraint equations. - Internal constraint equations are converted only if all of - the nodes in the set are selected. - - Notes - ----- - This command is valid in any processor. However, the INTE and CONV - options are only valid in the Solution processor after a SOLVE command - has been issued. - """ - command = f"CELIST,{neqn1},{neqn2},{ninc},{option}" - return self.run(command, **kwargs) - - def cerig( - self, - maste="", - slave="", - ldof="", - ldof2="", - ldof3="", - ldof4="", - ldof5="", - **kwargs, - ): - """Defines a rigid region. - - APDL Command: CERIG - - Parameters - ---------- - maste - Retained (or master) node for this rigid region. If MASTE = P, - then graphical picking of the master and slave nodes is enabled - (first node picked will be the master node, and subsequent nodes - picked will be slave nodes), and subsequent fields are ignored - (valid only in GUI). - - slave - Removed (or slave) node for this rigid region. If ALL, slave nodes - are all selected nodes. - - ldof - Degrees of freedom associated with equations: - - ALL - All applicable degrees of freedom (default). If 3-D, generate 6 equations - based on UX, UY, UZ, ROTX, ROTY, ROTZ; if 2-D, generate 3 - equations based on UX, UY, ROTZ. - - UXYZ - Translational degrees of freedom. If 3-D, generate 3 equations based on the - slave nodes' UX, UY, and UZ DOFs and the master node's UX, - UY, UZ, ROTX, ROTY, and ROTZ DOFs; if 2-D, generate 2 - equations based on the slave nodes UX and UY DOFs and the - master nodes UX, UY, and ROTZ DOFs. No equations are - generated for the rotational coupling. - - RXYZ - Rotational degrees of freedom. If 3-D, generate 3 equations based on ROTX, - ROTY, ROTZ; if 2-D, generate 1 equation based on ROTZ. No - equations are generated for the translational coupling. - - UX - Slave translational UX degree of freedom only. - - UY - Slave translational UY degree of freedom only. - - UZ - Slave translational UZ degree of freedom only. - - ROTX - Slave rotational ROTX degree of freedom only. - - ROTY - Slave rotational ROTY degree of freedom only. - - ROTZ - Slave rotational ROTZ degree of freedom only. - - ldof2, ldof3, ldof4, ldof5 - Additional degrees of freedom. Used only if more than one degree - of freedom required and Ldof is not ALL, UXYZ, or RXYZ. - - Notes - ----- - Defines a rigid region (link, area or volume) by automatically - generating constraint equations to relate nodes in the region. Nodes - in the rigid region must be assigned a geometric location before this - command is used. Also, nodes must be connected to elements having the - required degree of freedom set (see Ldof above). Generated constraint - equations are based on small deflection theory. Generated constraint - equations are numbered beginning from the highest previously defined - equation number (NEQN) plus 1. Equations, once generated, may be - listed [CELIST] or modified [CE] as desired. Repeat CERIG command for - additional rigid region equations. - - This command will generate the constraint equations needed for defining - rigid lines in 2-D or 3-D space. Multiple rigid lines relative to a - common point are used to define a rigid area or a rigid volume. In 2-D - space, with Ldof = ALL, three equations are generated for each pair of - constrained nodes. These equations define the three rigid body motions - in global Cartesian space, i.e., two in-plane translations and one in- - plane rotation. These equations assume the X-Y plane to be the active - plane with UX, UY, and ROTZ degrees of freedom available at each node. - Other types of equations can be generated with the appropriate Ldof - labels. - - Six equations are generated for each pair of constrained nodes in 3-D - space (with Ldof = ALL). These equations define the six rigid body - motions in global Cartesian space. These equations assume that UX, UY, - UZ, ROTX, ROTY, and ROTZ degrees of freedom are available at each node. - - The UXYZ label allows generating a partial set of rigid region - equations. This option is useful for transmitting the bending moment - between elements having different degrees of freedom at a node. With - this option only two of the three equations are generated for each pair - of constrained nodes in 2-D space. In 3-D space, only three of the six - equations are generated. In each case the rotational coupling - equations are not generated. Similarly, the RXYZ label allows - generating a partial set of equations with the translational coupling - equations omitted. - - Applying this command to a large number of slave nodes may result in - constraint equations with a large number of coefficients. This may - significantly increase the peak memory required during the process of - element assembly. If real memory or virtual memory is not available, - consider reducing the number of slave nodes. - - Note that under certain circumstances the constraint equations - generated by CERIG may be modified during the solution. See Program - Modification of Constraint Equations for more information. - - As an alternative to the CERIG command, you can define a similar type - of rigid region using contact elements and the internal multipoint - constraint (MPC) algorithm. See Surface-Based Constraints for more - information. - - CERIG cannot be deleted using CEDELE,ALL and then regenerated in the - second or higher load steps if the LSWRITE and LSSOLVE procedure is - used. CERIG writes constraint equations directly into load step files. - Deleting constraint equations (CEDELE,ALL) cannot always maintain the - consistency among load steps. - """ - command = f"CERIG,{maste},{slave},{ldof},{ldof2},{ldof3},{ldof4},{ldof5}" - return self.run(command, **kwargs) - - def cesgen(self, itime="", inc="", nset1="", nset2="", ninc="", **kwargs): - """Generates a set of constraint equations from existing sets. - - APDL Command: CESGEN - - Parameters - ---------- - itime, inc - Do this generation operation a total of ITIMEs, incrementing all - nodes in the existing sets by INC each time after the first. ITIME - must be >1 for generation to occur. - - nset1, nset2, ninc - Generate sets from sets beginning with NSET1 to NSET2 (defaults to - NSET1) in steps of NINC (defaults to 1). If NSET1 is negative, - NSET2 and NINC are ignored and the last ``|NSET1|`` sets (in sequence - from maximum set number) are used as the sets to be repeated. - - Notes - ----- - Generates additional sets of constraint equations (with same labels) - from existing sets. Node numbers between sets may be uniformly - incremented. - """ - command = f"CESGEN,{itime},{inc},{nset1},{nset2},{ninc}" - return self.run(command, **kwargs) - - def rbe3(self, master="", dof="", slaves="", wtfact="", **kwargs): - """Distributes the force/moment applied at the master node to a set of - - APDL Command: RBE3 - slave nodes, taking into account the geometry of the slave nodes as - well as weighting factors. - - Parameters - ---------- - master - Node at which the force/moment to be distributed will be applied. - This node must be associated with an element for the master node to - be included in the DOF solution. - - dof - Refers to the master node degrees of freedom to be used in - constraint equations. Valid labels are: UX, UY, UZ, ROTX, ROTY, - ROTZ, UXYZ, RXYZ, ALL - - slaves - The name of an array parameter that contains a list of slave nodes. - Must specify the starting index number. ALL can be used for - currently selected set of nodes. The slave nodes may not be - colinear, that is, not be all located on the same straight line - (see Notes below). - - wtfact - The name of an array parameter that contains a list of weighting - factors corresponding to each slave node above. Must have the - starting index number. If not specified, the weighting factor for - each slave node defaults to 1. - - Notes - ----- - The force is distributed to the slave nodes proportional to the - weighting factors. The moment is distributed as forces to the slaves; - these forces are proportional to the distance from the center of - gravity of the slave nodes times the weighting factors. Only the - translational degrees of freedom of the slave nodes are used for - constructing the constraint equations. Constraint equations are - converted to distributed forces/moments on the slave nodes during - solution. - - RBE3 creates constraint equations such that the motion of the master is - the average of the slaves. For the rotations, a least-squares approach - is used to define the "average rotation" at the master from the - translations of the slaves. If the slave nodes are colinear, then one - of the master rotations that is parallel to the colinear direction can - not be determined in terms of the translations of the slave nodes. - Therefore, the associated moment component on the master node in that - direction can not be transmitted. When this case occurs, a warning - message is issued and the constraint equations created by RBE3 are - ignored. - - Applying this command to a large number of slave nodes may result in - constraint equations with a large number of coefficients. This may - significantly increase the peak memory required during the process of - element assembly. If real memory or virtual memory is not available, - consider reducing the number of slave nodes. - - As an alternative to the RBE3 command, you can apply a similar type of - constraint using contact elements and the internal multipoint - constraint (MPC) algorithm. See Surface-based Constraints for more - information. - - This command is also valid in SOLUTION. - """ - command = f"RBE3,{master},{dof},{slaves},{wtfact}" - return self.run(command, **kwargs) diff --git a/src/ansys/mapdl/core/_commands/preproc/coupled_dof.py b/src/ansys/mapdl/core/_commands/preproc/coupled_dof.py deleted file mode 100644 index 4a3f8150d61..00000000000 --- a/src/ansys/mapdl/core/_commands/preproc/coupled_dof.py +++ /dev/null @@ -1,367 +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 CoupledDOF: - def cp( - self, - nset="", - lab="", - node1="", - node2="", - node3="", - node4="", - node5="", - node6="", - node7="", - node8="", - node9="", - node10="", - node11="", - node12="", - node13="", - node14="", - node15="", - node16="", - node17="", - **kwargs, - ): - """Defines (or modifies) a set of coupled degrees of freedom. - - APDL Command: CP - - Parameters - ---------- - nset - Set reference number: - - n - Arbitrary set number. - - HIGH - The highest defined coupled set number will be used (default, unless Lab = - ALL). This option is useful when adding nodes to an - existing set. - - NEXT - The highest defined coupled set number plus one will be used (default if Lab = - ALL). This option automatically numbers coupled sets so - that existing sets are not modified. - - lab - Degree of freedom label for coupled nodes (in the nodal coordinate - system). Defaults to label previously defined with NSET if set - NSET already exists. A different label redefines the previous label - associated with NSET. Valid labels are: Structural labels: UX, - UY, or UZ (displacements); ROTX, ROTY, or ROTZ (rotations) (in - radians); HDSP (hydrostatic pressure). Thermal labels: TEMP, TBOT, - TE2, TE3, . . ., TTOP (temperature). Fluid labels: PRES - (pressure); VX, VY, or VZ (velocities). Electric labels: VOLT - (voltage); EMF (electromotive force drop); CURR (current). - Magnetic labels: MAG (scalar magnetic potential); AX, AY, or AZ - (vector magnetic potentials); CURR (current). Diffusion label: - CONC (concentration). Explicit analysis labels: UX, UY, or UZ - (displacements). - - node1, node2, node3, . . . , node17 - List of nodes to be included in set. Duplicate nodes are ignored. - If a node number is input as negative, the node is deleted from the - coupled set. The first node in the list is the primary (retained) - node, and the remaining nodes represent the removed degrees of - freedom. If NODE1 = ALL, NODE2 through NODE17 are ignored and all - selected nodes (NSEL) are included in the set. 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 - ----- - Do not include the same degree of freedom in more than one coupled set. - Repeat CP command for additional nodes. - - Coupling degrees of freedom into a set causes the results calculated - for one member of the set to be the same for all members of the set. - Coupling can be used to model various joint and hinge effects. A more - general form of coupling can be done with constraint equations (CE). - For structural analyses, a list of nodes is defined along with the - nodal directions in which these nodes are to be coupled. As a result - of this coupling, these nodes are forced to take the same displacement - in the specified nodal coordinate direction. The amount of the - displacement is unknown until the analysis is completed. A set of - coupled nodes which are not coincident, or which are not along the line - of the coupled displacement direction, may produce an applied moment - which will not appear in the reaction forces. The actual degrees of - freedom available for a particular node depends upon the degrees of - freedom associated with element types (ET) at that node. For scalar - field analysis, this command is used to couple nodal temperatures, - pressures, voltages, etc. - - For an explicit dynamic analysis, the only valid DOF labels for - coupling are UX, UY, and UZ. Since the rotational DOF (ROTX, ROTY, - ROTZ) are not allowed. The CP family of commands should not be used in - an explicit analysis to model rigid body behavior that involves - rotations. If CP is used in this manner, it could lead to nonphysical - responses. - - A set of coupled nodes which are not coincident, or which are not along - the line of the coupled displacement direction, produce an artificial - moment constraint. If the structure rotates, a moment may be produced - in the coupled set in the form of a force couple. This moment is in - addition to the real reaction forces and may make it appear that moment - equilibrium is not satisfied by just the applied forces and the - reaction forces. Note, however, that in an explicit dynamic analysis, - this artificial moment will not be produced. Rather, just the applied - forces and the reaction forces will satisfy the moment equilibrium in - the model. Thus, in an explicit analysis, the magnitude of nodal - displacements for this set of nodes will depend on the distance from - each node to the center of the coupled set, and the direction of - displacement will depend on the resulting moment. This may lead to a - nonphysical response in some cases. - - Additional sets of coupled nodes may be generated from a specified set. - Degrees of freedom are coupled within a set but are not coupled between - sets. No degree of freedom should appear in more than one coupled set. - Such an appearance would indicate that at least two sets were in fact - part of a single larger set. The first degree of freedom of the - coupled set is the "prime" degree of freedom. All other degrees of - freedom in the coupled sets are eliminated from the solution matrices - by their relationship to the prime degree of freedom. Forces applied - to coupled nodes (in the coupled degree of freedom direction) will be - summed and applied to the prime degree of freedom. Output forces are - also summed at the prime degree of freedom. Degrees of freedom with - specified constraints (D) should not be included in a coupled set - (unless the degree of freedom is prime). - - If master degrees of freedom are defined for coupled nodes, only the - prime degree of freedom should be so defined. The use of coupled nodes - reduces the set of coupled degrees of freedom to only one degree of - freedom. - - The removed degrees of freedom defined by the CP command cannot be - included in any CE or CERIG command. - """ - command = f"CP,{nset},{lab},{node1},{node2},{node3},{node4},{node5},{node6},{node7},{node8},{node9},{node10},{node11},{node12},{node13},{node14},{node15},{node16},{node17}" - return self.run(command, **kwargs) - - def cpdele(self, nset1="", nset2="", ninc="", nsel="", **kwargs): - """Deletes coupled degree of freedom sets. - - APDL Command: CPDELE - - Parameters - ---------- - nset1, nset2, ninc - Delete coupled sets from NSET1 to NSET2 (defaults to NSET1) in - steps of NINC (defaults to 1). If NSET1 = ALL, NSET2 and NINC are - ignored and all coupled sets are deleted. - - nsel - Additional node selection control: - - ANY - Delete coupled set if any of the selected nodes are in the set (default). - - ALL - Delete coupled set only if all of the selected nodes are in the set. - - Notes - ----- - See the CP command for a method to delete individual nodes from a set. - """ - command = f"CPDELE,{nset1},{nset2},{ninc},{nsel}" - return self.run(command, **kwargs) - - def cpintf(self, lab="", toler="", **kwargs): - """Defines coupled degrees of freedom at an interface. - - APDL Command: CPINTF - - Parameters - ---------- - lab - Degree of freedom label for coupled nodes (in the nodal coordinate - system). If ALL, use all appropriate labels except HDSP. Valid - labels are: Structural labels: UX, UY, or UZ (displacements); - ROTX, ROTY, or ROTZ (rotations, in radians), HDSP (hydrostatic - pressure). Thermal labels: TEMP, TBOT, TE2, TE3, . . ., TTOP - (temperature). Fluid labels: PRES (pressure); VX, VY, or VZ - (velocities). Electric labels: VOLT (voltage); EMF - (electromotive force drop); CURR (current). Magnetic labels: MAG - (scalar magnetic potential); AX, AY, or AZ (vector magnetic - potentials); CURR (current). Diffusion label: CONC - (concentration). - - toler - Tolerance for coincidence (based on maximum coordinate difference - in each global Cartesian direction for node locations and on angle - differences for node orientations). Defaults to 0.0001. Only - nodes within the tolerance are considered to be coincident for - coupling. - - Notes - ----- - Defines coupled degrees of freedom between coincident nodes (within a - tolerance). May be used, for example, to "button" together elements - interfacing at a seam, where the seam consists of a series of node - pairs. One coupled set is generated for each selected degree of - freedom for each pair of coincident nodes. For more than two - coincident nodes in a cluster, a coupled set is generated from the - lowest numbered node to each of the other nodes in the cluster. - Coupled sets are generated only within (and not between) clusters. If - fewer than all nodes are to be checked for coincidence, use the NSEL - command to select nodes. Coupled set reference numbers are incremented - by one from the highest previous set number. Use CPLIST to display the - generated sets. Only nodes having the same nodal coordinate system - orientations ("coincident" within a tolerance) are included. Use the - CEINTF command to connect nodes by constraint equations instead of by - coupling. Use the EINTF command to connect nodes by line elements - instead of by coupling. - """ - command = f"CPINTF,{lab},{toler}" - return self.run(command, **kwargs) - - def cplgen(self, nsetf="", lab1="", lab2="", lab3="", lab4="", lab5="", **kwargs): - """Generates sets of coupled nodes from an existing set. - - APDL Command: CPLGEN - - Parameters - ---------- - nsetf - Generate sets from existing set NSETF. - - lab1, lab2, lab3, . . . , lab5 - Generate sets with these labels (see CP command for valid labels). - Sets are numbered as the highest existing set number + 1. - - Notes - ----- - Generates additional sets of coupled nodes (with different labels) from - an existing set [CP, CPNGEN]. The same node numbers are included in - the generated sets. If all labels of nodes are to be coupled and the - nodes are coincident, the NUMMRG command should be used to - automatically redefine the node number (for efficiency). - """ - command = f"CPLGEN,{nsetf},{lab1},{lab2},{lab3},{lab4},{lab5}" - return self.run(command, **kwargs) - - def cplist(self, nset1="", nset2="", ninc="", nsel="", **kwargs): - """Lists the coupled degree of freedom sets. - - APDL Command: CPLIST - - Parameters - ---------- - nset1, nset2, ninc - List coupled sets from NSET1 to NSET2 (defaults to NSET1) in steps - of NINC (defaults to 1). If NSET1 = ALL (default), NSET2 and NINC - are ignored and all coupled sets are listed. - - nsel - Node selection control: - - ANY - List coupled set if any of the selected nodes are in the set (default). - - ALL - List coupled set only if all of the selected nodes are in the set. - - Notes - ----- - This command is valid in any processor. - """ - command = f"CPLIST,{nset1},{nset2},{ninc},{nsel}" - return self.run(command, **kwargs) - - def cpmerge(self, lab="", **kwargs): - """Merges different couple sets with duplicate degrees of freedom into one - - APDL Command: CPMERGE - couple set. - - Parameters - ---------- - lab - Degree of freedom label for coupled nodes (in the nodal coordinate - system). Valid labels are: Structural labels: UX, UY, or UZ - (displacements); ROTX, ROTY, or ROTZ (rotations) (in radians). - Thermal labels: TEMP, TBOT, TE2, TE3, . . ., TTOP (temperature). - Fluid labels: PRES (pressure); VX, VY, or VZ (velocities). - Electric labels: VOLT (voltage); EMF (electromotive force drop); - CURR (current). Magnetic labels: MAG (scalar magnetic potential); - AX, AY, or AZ (vector magnetic potentials); CURR (current). - Diffusion label: CONC (concentration). Explicit analysis labels: - UX, UY, or UZ (displacements). The degree of freedom set is - determined from all element types defined and the DOF command, if - used. - """ - command = f"CPMERGE,{lab}" - return self.run(command, **kwargs) - - def cpngen(self, nset="", lab="", node1="", node2="", ninc="", **kwargs): - """Defines, modifies, or adds to a set of coupled degrees of freedom. - - APDL Command: CPNGEN - - Parameters - ---------- - nset - Set reference number [CP]. - - lab - Degree of freedom label [CP]. - - node1, node2, ninc - Include in coupled set nodes NODE1 to NODE2 in steps of NINC - (defaults to 1). If NODE1 = P, graphical picking is enabled and - all remaining command fields are ignored (valid only in the GUI). - If -NODE1, delete range of nodes from set instead of including. A - component name may also be substituted for NODE1 (NODE2 and NINC - are ignored). - - Notes - ----- - Defines, modifies, or adds to a set of coupled degrees of freedom. May - be used in combination with (or in place of) the CP command. Repeat - CPNGEN command for additional nodes. - """ - command = f"CPNGEN,{nset},{lab},{node1},{node2},{ninc}" - return self.run(command, **kwargs) - - def cpsgen(self, itime="", inc="", nset1="", nset2="", ninc="", **kwargs): - """Generates sets of coupled nodes from existing sets. - - APDL Command: CPSGEN - - Parameters - ---------- - itime, inc - Do this generation operation a total of ITIMEs, incrementing all - nodes in the existing sets by INC each time after the first. ITIME - must be > 1 for generation to occur. - - nset1, nset2, ninc - Generate sets from sets beginning with NSET1 to NSET2 (defaults to - NSET1) in steps of NINC (defaults to 1). If NSET1 is negative, - NSET2 and NINC are ignored and the last ``|NSET1|`` sets (in sequence - from the maximum set number) are used as the sets to be repeated. - - Notes - ----- - Generates additional sets of coupled nodes (with the same labels) from - existing sets. Node numbers between sets may be uniformly incremented. - """ - command = f"CPSGEN,{itime},{inc},{nset1},{nset2},{ninc}" - return self.run(command, **kwargs) diff --git a/src/ansys/mapdl/core/commands.py b/src/ansys/mapdl/core/commands.py index f9c5e3e1426..64bc03391dd 100644 --- a/src/ansys/mapdl/core/commands.py +++ b/src/ansys/mapdl/core/commands.py @@ -46,6 +46,7 @@ misc, post1, post26, + prep7, preproc, session, solution, @@ -325,17 +326,26 @@ def func_wrapper(self, *args: Any, **kwargs: dict[Any, Any]): return func_wrapper +class Prep7Commands( + prep7._status.Status, + prep7.areas.Areas, + prep7.artificially_matched_layers.ArtificiallyMatchedLayers, + prep7.booleans.Booleans, + prep7.constraint_equations_.ConstraintEquations, + prep7.constraint_equations.ConstraintEquations, + prep7.coupled_dof.CoupledDof, + prep7.cross_sections.CrossSections, + prep7.data_tables.DataTables, +): + pass + + class PreprocessorCommands( preproc.database.Database, preproc.explicit_dynamics.ExplicitDynamics, preproc.lines.Lines, - preproc.areas.Areas, preproc.nodes.Nodes, preproc.keypoints.KeyPoints, - preproc.artificially_matched_layers.ArtificiallyMatchedLayers, - preproc.booleans.Booleans, - preproc.constraint_equations.ConstraintEquations, - preproc.coupled_dof.CoupledDOF, preproc.real_constants.RealConstants, preproc.digitizing.Digitizing, preproc.element_type.ElementType,