Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: aux2 submodule #3683

Open
wants to merge 10 commits into
base: feat/main_commands
Choose a base branch
from
1 change: 1 addition & 0 deletions doc/changelog.d/3683.added.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
feat: ``aux2`` submodule
17 changes: 0 additions & 17 deletions doc/source/mapdl_commands/aux2/bin_dump.rst

This file was deleted.

17 changes: 0 additions & 17 deletions doc/source/mapdl_commands/aux2/bin_manip.rst

This file was deleted.

22 changes: 22 additions & 0 deletions doc/source/mapdl_commands/aux2/binary_file_dump.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@

.. _ref_binary_file_dump:


BinaryFileDump
==============


.. currentmodule:: ansys.mapdl.core._commands.aux2.binary_file_dump

.. autoclass:: ansys.mapdl.core._commands.aux2.binary_file_dump.BinaryFileDump

.. autosummary::
:template: base.rst
:toctree: _autosummary


BinaryFileDump.aux2
BinaryFileDump.dump
BinaryFileDump.fileaux2
BinaryFileDump.form
BinaryFileDump.ptr
20 changes: 20 additions & 0 deletions doc/source/mapdl_commands/aux2/binary_file_manipulation.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@

.. _ref_binary_file_manipulation:


BinaryFileManipulation
======================


.. currentmodule:: ansys.mapdl.core._commands.aux2.binary_file_manipulation

.. autoclass:: ansys.mapdl.core._commands.aux2.binary_file_manipulation.BinaryFileManipulation

.. autosummary::
:template: base.rst
:toctree: _autosummary


BinaryFileManipulation.combine
BinaryFileManipulation.hbmat
BinaryFileManipulation.psmat
18 changes: 18 additions & 0 deletions doc/source/mapdl_commands/aux2/index.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@

.. _ref_aux2:

Aux2
====

.. list-table::

* - :ref:`ref_binary_file_manipulation`
* - :ref:`ref_binary_file_dump`


.. toctree::
:maxdepth: 1
:hidden:

binary_file_manipulation
binary_file_dump
2 changes: 1 addition & 1 deletion src/ansys/mapdl/core/_commands/aux2_/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,4 +20,4 @@
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
# SOFTWARE.

from . import bin_dump, bin_manip
from . import binary_file_dump, binary_file_manipulation
127 changes: 78 additions & 49 deletions src/ansys/mapdl/core/_commands/aux2_/bin_dump.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,95 +21,124 @@
# SOFTWARE.


class BinDump:
def dump(self, nstrt="", nstop="", **kwargs):
"""Dumps the contents of a binary file.
class BinaryFileDump:

APDL Command: DUMP
def aux2(self, **kwargs):
r"""Enters the binary file dumping processor.

Parameters
----------
nstrt, nstop
Dump file from record NSTRT (defaults to 1) to NSTOP (defaults to
NSTRT). If NSTRT = HEAD, dump only record 1 of the file (NSTOP and
the format specification are ignored). If NSTRT = ALL, dump the
entire file.
Mechanical APDL Command: `/AUX2 <https://ansyshelp.ansys.com/Views/Secured/corp/v232/en//ans_cmd/Hlp_C_AUX2.html>`_

Notes
-----
Dumps the file named on the AUX2 FILEAUX2 command according the format
specified on the FORM command.
Enters the binary file-dumping processor (auxiliary processor AUX2), used for dumping the contents
of certain Mechanical APDL binary files for visual examination.

This command is valid only at the Begin Level.
"""
command = f"DUMP,{nstrt},{nstop}"
command = "/AUX2"
return self.run(command, **kwargs)

def fileaux2(self, fname="", ident="", **kwargs):
"""Specifies the binary file to be dumped.
def fileaux2(self, fname: str = "", ident: str = "", **kwargs):
r"""Specifies the binary file to be dumped.

APDL Command: FILEAUX2
Mechanical APDL Command: `FILEAUX2 <https://ansyshelp.ansys.com/Views/Secured/corp/v232/en//ans_cmd/Hlp_C_FILEAUX2.html>`_

Parameters
----------
fname
File name and directory path (248 characters maximum,
including the characters needed for the directory path).
An unspecified directory path defaults to the working
directory; in this case, you can use all 248 characters
for the file name.

ident
ANSYS filename identifier. See the Basic Analysis Guide
for file descriptions and identifiers. If not an ANSYS
identifier, Ident will be used as the filename extension.
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 the current
:file:`Jobname` if ``Ident`` is specified.

ident : str
File name identifier. See the `Basic Analysis Guide
<https://ansyshelp.ansys.com/Views/Secured/corp/v232/en/ans_bas/Hlp_G_BAS19.html>`_ Basic
Analysis Guide for file descriptions and identifiers. If not an identifier, the program uses
``Ident`` as the file name extension.

Notes
-----
Specifies the binary file to be dumped with the DUMP command.
Specifies the binary file to be dumped with the :ref:`dump` command.
"""
command = f"FILEAUX2,{fname},{ident}"
return self.run(command, **kwargs)

def form(self, lab="", **kwargs):
"""Specifies the format of the file dump.
def form(self, lab: str = "", **kwargs):
r"""Specifies the format of the file dump.

APDL Command: FORM
Mechanical APDL Command: `FORM <https://ansyshelp.ansys.com/Views/Secured/corp/v232/en//ans_cmd/Hlp_C_FORM.html>`_

Parameters
----------
lab
lab : str
Format:

RECO
Basic record description only (minimum output) (default).
* ``RECO`` - Basic record description only (minimum output) (default).

TEN
Same as RECO plus the first ten words of each record.
* ``TEN`` - Same as RECO plus the first ten words of each record.

LONG
Same as RECO plus all words of each record.
* ``LONG`` - Same as RECO plus all words of each record.

Notes
-----
Specifies the format of the file dump (from the DUMP command).
Specifies the format of the file dump (from the :ref:`dump` command).
"""
command = f"FORM,{lab}"
return self.run(command, **kwargs)

def ptr(self, loc="", base="", **kwargs):
"""Dumps the record of a binary file.
def ptr(
self, loc: str = "", base: str = "", loch: str = "", baseh: str = "", **kwargs
):
r"""Dumps the record of a binary file.

APDL Command: PTR
Mechanical APDL Command: `PTR <https://ansyshelp.ansys.com/Views/Secured/corp/v232/en//ans_cmd/Hlp_C_PTR.html>`_

Parameters
----------
loc, base
Dump the file record starting at pointer LOC. BASE is the base
pointer, and would be used if LOC is a relative pointer.
loc : str
Dump the file record starting at pointer ``LOC``. ``BASE`` is the base pointer, and would be
used if ``LOC`` is a relative pointer.

base : str
Dump the file record starting at pointer ``LOC``. ``BASE`` is the base pointer, and would be
used if ``LOC`` is a relative pointer.

loch : str
Second 32-bit integer (if required) for defining the 64-bit pointer.

baseh : str
Second 32-bit integer (if required) for defining the 64-bit pointer.

Notes
-----
Dumps the record of the file named on the AUX2 FILEAUX2 command
according the format specified on the FORM command.
Dumps the record of the file named on the AUX2 :ref:`fileaux2` command according the format
specified on the :ref:`form` command.
"""
command = f"PTR,{loc},{base}"
command = f"PTR,{loc},{base},{loch},{baseh}"
return self.run(command, **kwargs)

def dump(self, nstrt: str = "", nstop: str = "", **kwargs):
r"""Dumps the contents of a binary file.

Mechanical APDL Command: `DUMP <https://ansyshelp.ansys.com/Views/Secured/corp/v232/en//ans_cmd/Hlp_C_DUMP.html>`_

Parameters
----------
nstrt : str
Dump file from record ``NSTRT`` (defaults to 1) to ``NSTOP`` (defaults to ``NSTRT`` ). If
``NSTRT`` = HEAD, dump only record 1 of the file ( ``NSTOP`` and the format specification are
ignored). If ``NSTRT`` = ALL, dump the entire file.

nstop : str
Dump file from record ``NSTRT`` (defaults to 1) to ``NSTOP`` (defaults to ``NSTRT`` ). If
``NSTRT`` = HEAD, dump only record 1 of the file ( ``NSTOP`` and the format specification are
ignored). If ``NSTRT`` = ALL, dump the entire file.

Notes
-----
Dumps the file named on the AUX2 :ref:`fileaux2` command according the format specified on the
:ref:`form` command.
"""
command = f"DUMP,{nstrt},{nstop}"
return self.run(command, **kwargs)
Loading
Loading