Skip to content

Commit

Permalink
feat: latest apdl module output with pyconverter-xml2py new v…
Browse files Browse the repository at this point in the history
…ersion
  • Loading branch information
clatapie committed Oct 18, 2024
1 parent 81027b1 commit ac7b46a
Show file tree
Hide file tree
Showing 9 changed files with 3,525 additions and 3,130 deletions.
12 changes: 6 additions & 6 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -56,12 +56,12 @@ repos:
hooks:
- id: flake8

# - repo: https://github.com/codespell-project/codespell
# rev: v2.3.0
# hooks:
# - id: codespell
# args: ["--toml", "pyproject.toml"]
# additional_dependencies: ["tomli"]
- repo: https://github.com/codespell-project/codespell
rev: v2.3.0
hooks:
- id: codespell
args: ["--toml", "pyproject.toml"]
additional_dependencies: ["tomli"]

# - repo: https://github.com/pycqa/pydocstyle
# rev: 6.1.1
Expand Down
4 changes: 4 additions & 0 deletions doc/styles/config/vocabularies/ANSYS/accept.txt
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,7 @@ emiss
env
Eser
ethernet
Euclidian
extrem
FEMs
filname
Expand All @@ -86,6 +87,7 @@ hostname
HTML
Image[Mm]agick
imagin
imbedded
importlib
ist
Julia
Expand Down Expand Up @@ -118,6 +120,8 @@ NumPy
onefile
optiSLang
parm
ParY
pary
perf
performant
PMLs
Expand Down
163 changes: 83 additions & 80 deletions src/ansys/mapdl/core/_commands/apdl/abbreviations.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,38 +23,49 @@

class Abbreviations:

def abbr(self, abbr="", string="", **kwargs):
r"""Defines an abbreviation.
def ucmd(self, cmd: str = "", srnum: str = "", **kwargs):
r"""Assigns a user-defined command name.
Mechanical APDL Command: `\*ABBR <https://ansyshelp.ansys.com/Views/Secured/corp/v232/en//ans_cmd/Hlp_C_ABBR.html>`_
Mechanical APDL Command: `/UCMD <https://ansyshelp.ansys.com/Views/Secured/corp/v232/en//ans_cmd/Hlp_C_UCMD.html>`_
Parameters
----------
abbr : str
The abbreviation (up to 8 alphanumeric characters) used to represent the string ``String`` . If
``Abbr`` is the same as an existing Mechanical APDL command, the abbreviation overrides. Avoid using an
``Abbr`` which is the same as an Mechanical APDL command.
cmd : str
User-defined command name. Only the first four characters are significant. Must not conflict
with any Mechanical APDL command name or any user unknown-command macro name.
string : str
String of characters (60 maximum) represented by ``Abbr`` . Cannot include a $ or any of the
commands :ref:`c`, :ref:`com`, :ref:`gopr`, :ref:`nopr`, :ref:`quit`, :ref:`ui`, or
:ref:`end` . Parameter names and commands of the :ref:`do` and Use the :ref:`if` groups may not
be abbreviated. If ``String`` is blank, the abbreviation is deleted. To abbreviate multiple
commands, create an "unknown command" macro or define ``String`` to execute a macro file (
:ref:`use` ) containing the desired commands.
srnum : str
User subroutine number (1 to 10) programmed for this command. For example, the command
:ref:`ucmd` ,MYCMD,3 will execute subroutine USER03 whenever the command MYCMD is entered. Use a
blank command name to disassociate ``SRNUM`` from its command. For example, :ref:`ucmd` ,,3
removes MYCMD as a command.
Notes
-----
Once the abbreviation ``Abbr`` is defined, you can issue it at the beginning of a command line and follow it with a blank (or with a comma and appended data), and the program will substitute the string ``String`` for ``Abbr`` as the line is executed. Up to 100 abbreviations may exist at any time and are available throughout the program. Abbreviations may be redefined or deleted at any time.
Use :ref:`starstatus` to display the current list of abbreviations. For abbreviations repeated with :ref:`repeat`, substitution occurs before the repeat increments are applied. There are a number of abbreviations that are predefined by the program (these can be deleted by using the blank ``String`` option described above). Note that ``String`` will be written to the ``File.LOG`` .
This command is valid in any processor.
Assigns a user-defined command name to a user-programmable (system-dependent) subroutine. This
feature allows user-defined commands to be programmed into Mechanical APDL. Once programmed, this command
can be input to the program like other commands, and can also be included in the Mechanical APDL start-up
file. Up to 10 subroutines are available for user-defined commands (USER01 to USER10). You must
have system permission, system access, and knowledge to write, compile, and link the appropriate
subprocessors into Mechanical APDL at your site. All routines should be written in FORTRAN. For more
information about FORTRAN compilers, refer to either the `Ansys, Inc. Windows Installation Guide <https://ansyshelp.ansys.com/Views/Secured/corp/v232/en/installation/win_product_table.html>`_ or the `Ansys, Inc. Linux Installation Guide <https://ansyshelp.ansys.com/Views/Secured/corp/v232/en/installation/lin_product_table.html>`_ for
details specific to your platform or operating system. The USER01 routine is commented and should
be listed from the distribution media (system dependent) for more details. Issue :ref:`ucmd` ,STAT
to list all user-defined command names. Because a user-programmed command is a nonstandard use of
the program, the verification of any Mechanical APDL run incorporating these commands is your
responsibility. In any contact with Mechanical APDL customer support regarding the performance of a custom
version of Mechanical APDL, explicitly state that a user-programmable feature has been used. See `User-
Programmable Features (UPFs)
<https://ansyshelp.ansys.com/Views/Secured/corp/v232/en/ans_adv/Hlp_G_ADV7_1.html#aRzouq21ldm>`_
`Guide to User-Programmable Features
<https://ansyshelp.ansys.com/Views/Secured/corp/v232/en/ans_prog/ansysprog_aero_fullycoupled.html>`_
See :ref:`ulib` for another way of defining user commands. This command is valid only at the Begin
Level.
"""
command = f"*ABBR,{abbr},{string}"
command = f"/UCMD,{cmd},{srnum}"
return self.run(command, **kwargs)

def abbres(self, lab="", **kwargs):
def abbres(self, lab: str = "", fname: str = "", ext: str = "", **kwargs):
r"""Reads abbreviations from a coded file.
Mechanical APDL Command: `ABBRES <https://ansyshelp.ansys.com/Views/Secured/corp/v232/en//ans_cmd/Hlp_C_ABBRES.html>`_
Expand All @@ -64,94 +75,86 @@ def abbres(self, lab="", **kwargs):
lab : str
Label that specifies the read operation:
* ``NEW`` - Replace current abbreviation set with these abbreviations (default).
* ``CHANGE`` - Extend current abbreviation set with these abbreviations, replacing any of
the
same name that already exist.
* ``NEW`` - Replace current abbreviation set with these abbreviations (default).
* ``CHANGE`` - Extend current abbreviation set with these abbreviations, replacing any of the same
name that already exist.
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 ``Jobname`` .
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 ``Jobname``.
ext : str
Filename extension (eight-character maximum).
The extension defaults to ABBR if ``Fname`` is blank.
Filename extension (eight-character maximum). The extension defaults to ABBR if ``Fname`` is blank.
Notes
-----
The abbreviation file may have been written with the :ref:`abbsav` command. Do not issue :ref:`abbres` ,NEW while inside an executing abbreviation. Doing so will cause all data for the executing abbreviation to be deleted.
This command is valid in any processor.
The abbreviation file may have been written with the :ref:`abbsav` command. Do not issue
:ref:`abbres` ,NEW while inside an executing abbreviation. Doing so will cause all data for the
executing abbreviation to be deleted. This command is valid in any processor.
"""
command = f"ABBRES,{lab}"
command = f"ABBRES,{lab},{fname},{ext}"
return self.run(command, **kwargs)

def abbsav(self, lab="", **kwargs):
r"""Writes the current abbreviation set to a coded file.
def abbr(self, abbr: str = "", string: str = "", **kwargs):
r"""Defines an abbreviation.
Mechanical APDL Command: `ABBSAV <https://ansyshelp.ansys.com/Views/Secured/corp/v232/en//ans_cmd/Hlp_C_ABBSAV.html>`_
Mechanical APDL Command: `\*ABBR <https://ansyshelp.ansys.com/Views/Secured/corp/v232/en//ans_cmd/Hlp_C_ABBR.html>`_
Parameters
----------
lab : str
Label that specifies the write operation:
* ``ALL`` - Write all abbreviations (default).
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 ``Jobname`` .
abbr : str
The abbreviation (up to 8 alphanumeric characters) used to represent the string ``String``. If
``Abbr`` is the same as an existing Mechanical APDL command, the abbreviation overrides. Avoid using an
``Abbr`` which is the same as an Mechanical APDL command.
ext : str
Filename extension (eight-character maximum).
The extension defaults to ABBR if ``Fname`` is blank.
string : str
String of characters (60 maximum) represented by ``Abbr``. Cannot include a $ or any of the
commands :ref:`c`, :ref:`com`, :ref:`gopr`, :ref:`nopr`, :ref:`quit`, :ref:`ui`, or
:ref:`end`. Parameter names and commands of the :ref:`do` and Use the :ref:`if` groups may not
be abbreviated. If ``String`` is blank, the abbreviation is deleted. To abbreviate multiple
commands, create an "unknown command" macro or define ``String`` to execute a macro file (
:ref:`use` ) containing the desired commands.
Notes
-----
Existing abbreviations on this file, if any, will be overwritten. The abbreviation file may be read with the :ref:`abbres` command.
Once the abbreviation ``Abbr`` is defined, you can issue it at the beginning of a command line and
follow it with a blank (or with a comma and appended data), and the program will substitute the
string ``String`` for ``Abbr`` as the line is executed. Up to 100 abbreviations may exist at any
time and are available throughout the program. Abbreviations may be redefined or deleted at any
time. Use :ref:`starstatus` to display the current list of abbreviations. For abbreviations
repeated with :ref:`repeat`, substitution occurs before the repeat increments are applied. There
are a number of abbreviations that are predefined by the program (these can be deleted by using the
blank ``String`` option described above). Note that ``String`` will be written to the ``File.LOG``.
This command is valid in any processor.
"""
command = f"ABBSAV,{lab}"
command = f"*ABBR,{abbr},{string}"
return self.run(command, **kwargs)

def ucmd(self, cmd="", srnum="", **kwargs):
r"""Assigns a user-defined command name.
def abbsav(self, lab: str = "", fname: str = "", ext: str = "", **kwargs):
r"""Writes the current abbreviation set to a coded file.
Mechanical APDL Command: `/UCMD <https://ansyshelp.ansys.com/Views/Secured/corp/v232/en//ans_cmd/Hlp_C_UCMD.html>`_
Mechanical APDL Command: `ABBSAV <https://ansyshelp.ansys.com/Views/Secured/corp/v232/en//ans_cmd/Hlp_C_ABBSAV.html>`_
Parameters
----------
cmd : str
User-defined command name. Only the first four characters are significant. Must not conflict
with any Mechanical APDL command name or any user unknown-command macro name.
srnum : str
User subroutine number (1 to 10) programmed for this command. For example, the command
:ref:`ucmd` ,MYCMD,3 will execute subroutine USER03 whenever the command MYCMD is entered. Use a
blank command name to disassociate ``SRNUM`` from its command. For example, :ref:`ucmd` ,,3
removes MYCMD as a command.
Notes
-----
Assigns a user-defined command name to a user-programmable (system-dependent) subroutine. This feature allows user-defined commands to be programmed into Mechanical APDL. Once programmed, this command can be input to the program like other commands, and can also be included in the Mechanical APDL start-up file.
Up to 10 subroutines are available for user-defined commands (USER01 to USER10). You must have system permission, system access, and knowledge to write, compile, and link the appropriate subprocessors into Mechanical APDL at your site.
All routines should be written in FORTRAN. For more information about FORTRAN compilers, refer to either the `Ansys, Inc. Windows Installation Guide <https://ansyshelp.ansys.com/Views/Secured/corp/v232/en/installation/win_product_table.html>`_ or the `Ansys, Inc. Linux Installation Guide <https://ansyshelp.ansys.com/Views/Secured/corp/v232/en/installation/lin_product_table.html>`_ for details specific to your platform or operating system.
The USER01 routine is commented and should be listed from the distribution media (system dependent) for more details.
Issue :ref:`ucmd` ,STAT to list all user-defined command names.
lab : str
Label that specifies the write operation:
Because a user-programmed command is a nonstandard use of the program, the verification of any Mechanical APDL run incorporating these commands is your responsibility. In any contact with Mechanical APDL customer support regarding the performance of a custom version of Mechanical APDL, explicitly state that a user-programmable feature has been used.
* ``ALL`` - Write all abbreviations (default).
See `User-Programmable Features (UPFs) <https://ansyshelp.ansys.com/Views/Secured/corp/v232/en/ans_adv/Hlp_G_ADV7_1.html#aRzouq21ldm>`_ `Guide to User-Programmable Features <https://ansyshelp.ansys.com/Views/Secured/corp/v232/en/ans_prog/ansysprog_aero_fullycoupled.html>`_
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 ``Jobname``.
See :ref:`ulib` for another way of defining user commands.
ext : str
Filename extension (eight-character maximum). The extension defaults to ABBR if ``Fname`` is blank.
This command is valid only at the Begin Level.
Notes
-----
Existing abbreviations on this file, if any, will be overwritten. The abbreviation file may be read
with the :ref:`abbres` command. This command is valid in any processor.
"""
command = f"/UCMD,{cmd},{srnum}"
command = f"ABBSAV,{lab},{fname},{ext}"
return self.run(command, **kwargs)
Loading

0 comments on commit ac7b46a

Please sign in to comment.