Skip to content

Commit

Permalink
feat: changes obtained using pyconverter-xml2py (after pre-commit…
Browse files Browse the repository at this point in the history
… hook)
  • Loading branch information
clatapie committed Sep 5, 2024
1 parent 193af83 commit e9de204
Show file tree
Hide file tree
Showing 12 changed files with 4,694 additions and 4,187 deletions.
12 changes: 6 additions & 6 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -45,12 +45,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
7 changes: 4 additions & 3 deletions src/ansys/mapdl/core/_commands/apdl/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,10 @@

from . import (
abbreviations,
array_param,
array_parameters,
encryption_decryption,
macro_files,
matrix_op,
parameter_definition,
matrix_operations,
parameters,
process_controls,
)
181 changes: 73 additions & 108 deletions src/ansys/mapdl/core/_commands/apdl/abbreviations.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,169 +22,134 @@


class Abbreviations:

def abbr(self, abbr="", string="", **kwargs):
"""Defines an abbreviation.
r"""Defines an abbreviation.
APDL Command: ``*ABBR``
Mechanical APDL Command: `\*ABBR <https://ansyshelp.ansys.com/Views/Secured/corp/v232/en//ans_cmd/Hlp_C_ABBR.html>`_
Parameters
----------
abbr
The abbreviation (up to 8 alphanumeric characters) used to
represent the string String. If Abbr is the same as an existing
ANSYS command, the abbreviation overrides. Avoid using an Abbr
which is the same as an ANSYS command.
string
String of characters (60 maximum) represented by Abbr.
Cannot include a $ or any of the commands ``C***``, /COM,
/GOPR, /NOPR, /QUIT, /UI, or ``*END``.
Use the ``*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 [``*USE``]
containing the desired commands.
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.
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
-----
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 ``*STATUS`` to display the current list of abbreviations. For
abbreviations repeated with ``*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.
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"*ABBR,{abbr},{string}"
return self.run(command, **kwargs)

def abbres(self, lab="", fname="", ext="", **kwargs):
"""Reads abbreviations from a coded file.
def abbres(self, lab="", **kwargs):
r"""Reads abbreviations from a coded file.
APDL Command: ABBRES
Mechanical APDL Command: `ABBRES <https://ansyshelp.ansys.com/Views/Secured/corp/v232/en//ans_cmd/Hlp_C_ABBRES.html>`_
Parameters
----------
lab
lab : str
Label that specifies the read operation:
NEW
Replace current abbreviation set with these abbreviations (default).
* ``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.
* ``CHANGE`` - Extend current abbreviation set with these abbreviations, replacing any of
the
same name that already exist.
fname
File name and directory path (248 characters maximum, including the
characters needed for the directory path). An unspecified
directory path defaults to the working directory; in this case, you
can use all 248 characters for the file name.
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`` .
ext
ext : str
Filename extension (eight-character maximum).
The extension defaults to ABBR if ``Fname`` is blank.
Notes
-----
The abbreviation file may have been written with the ABBSAV command. Do
not issue ABBRES,NEW while inside an executing abbreviation. Doing so
will cause all data for the executing abbreviation to be deleted.
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},{fname},{ext}"
command = f"ABBRES,{lab}"
return self.run(command, **kwargs)

def abbsav(self, lab="", fname="", ext="", **kwargs):
"""Writes the current abbreviation set to a coded file.
def abbsav(self, lab="", **kwargs):
r"""Writes the current abbreviation set to a coded file.
APDL Command: ABBSAV
Mechanical APDL Command: `ABBSAV <https://ansyshelp.ansys.com/Views/Secured/corp/v232/en//ans_cmd/Hlp_C_ABBSAV.html>`_
Parameters
----------
lab
Label that specifies the write operation.
ALL - Write all abbreviations (default).
lab : str
Label that specifies the write operation:
fname
File name and directory path (248 characters maximum,
including the characters needed for the directory path).
An unspecified directory path defaults to the working
directory; in this case, you can use all 248 characters
for the file name.
* ``ALL`` - Write all abbreviations (default).
The file name defaults to Jobname.
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`` .
ext
Filename extension (eight-character maximum). The
extension defaults to ABBR if Fname is blank.
ext : str
Filename extension (eight-character maximum).
The extension defaults to ABBR if ``Fname`` is blank.
Notes
-----
Existing abbreviations on this file, if any, will be overwritten. The
abbreviation file may be read with the ABBRES command.
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"ABBSAV,{lab},{fname},{ext}"
command = f"ABBSAV,{lab}"
return self.run(command, **kwargs)

def ucmd(self, cmd="", srnum="", **kwargs):
"""Assigns a user-defined command name.
r"""Assigns a user-defined command name.
APDL Command: /UCMD
Mechanical APDL Command: `/UCMD <https://ansyshelp.ansys.com/Views/Secured/corp/v232/en//ans_cmd/Hlp_C_UCMD.html>`_
Parameters
----------
cmd
User-defined command name. Only the first four characters are
significant. Must not conflict with any ANSYS command name or any
user "unknown command" macro name.
srnum
User subroutine number (1 to 10) programmed for this command. For
example, the command /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, /UCMD,,3 removes
MYCMD as a 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.
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 the ANSYS program. Once programmed, this command can
be input to the program like other commands, and can also be included
in the ANSYS start-up file. See ``*ULIB`` for another way of defining user
commands.
Up to 10 subroutines are available for user-defined commands (USER01 to
USER10). Users must have system permission, system access, and
knowledge to write, compile, and link the appropriate subprocessors
into the ANSYS program at the site where it is to be run. All routines
should be written in FORTRAN. For more information on FORTRAN compilers
please refer to either the ANSYS, Inc. Windows Installation Guide or
the ANSYS, Inc. Linux Installation Guide 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 /UCMD,STAT to list all user-defined command names.
Since a user-programmed command is a nonstandard use of the program,
the verification of any ANSYS run incorporating these commands is
entirely up to the user. In any contact with ANSYS customer support
regarding the performance of a custom version of the ANSYS program, you
should explicitly state that a user programmable feature has been used.
See the Advanced Analysis Guide for a general description of user-
programmable features and Guide to User-Programmable Features for a
detailed description of these features.
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.
"""
Expand Down
Loading

0 comments on commit e9de204

Please sign in to comment.