Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
34 changes: 34 additions & 0 deletions doc/source/api/mapdl.rst
Original file line number Diff line number Diff line change
Expand Up @@ -51,3 +51,37 @@ Latest 2021R1 and newer features
mapdl_grpc.MapdlGrpc.math
mapdl_grpc.MapdlGrpc.mute
mapdl_grpc.MapdlGrpc.upload


Mapdl Information Class
~~~~~~~~~~~~~~~~~~~~~~~

.. currentmodule:: ansys.mapdl.core.misc

.. autoclass:: ansys.mapdl.core.misc.Information

.. autosummary::
:toctree: _autosummary

Information.product
Information.mapdl_version
Information.pymapdl_version
Information.products
Information.preprocessing_capabilities
Information.aux_capabilities
Information.solution_options
Information.post_capabilities
Information.title
Information.titles
Information.stitles
Information.units
Information.scratch_memory_status
Information.database_status
Information.config_values
Information.global_status
Information.job_information
Information.model_information
Information.boundary_condition_information
Information.routine_information
Information.solution_options_configuration
Information.load_step_options
35 changes: 11 additions & 24 deletions src/ansys/mapdl/core/mapdl.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@
from ansys.mapdl.core.errors import MapdlInvalidRoutineError, MapdlRuntimeError
from ansys.mapdl.core.inline_functions import Query
from ansys.mapdl.core.misc import (
Information,
last_created,
load_file,
random_string,
Expand Down Expand Up @@ -201,6 +202,8 @@ def __init__(

self._wrap_listing_functions()

self._info = Information(self)

@property
def print_com(self):
return self._print_com
Expand Down Expand Up @@ -570,27 +573,12 @@ def clear(self, *args, **kwargs):

@supress_logging
def __str__(self):
try:
if self._exited:
return "MAPDL exited"
stats = self.slashstatus("PROD")
except Exception: # pragma: no cover
return "MAPDL exited"

st = stats.find("*** Products ***")
en = stats.find("*** PrePro")
product = "\n".join(stats[st:en].splitlines()[1:]).strip()

# get product version
stats = self.slashstatus("TITLE")
st = stats.find("RELEASE")
en = stats.find("INITIAL", st)
mapdl_version = stats[st:en].split("CUSTOMER")[0].strip()

info = [f"Product: {product}"]
info.append(f"MAPDL Version: {mapdl_version}")
info.append(f"PyMAPDL Version: {pymapdl.__version__}\n")
return "\n".join(info)
return self.info.__str__()

@property
def info(self):
"""General information"""
return self._info

@property
def geometry(self):
Expand Down Expand Up @@ -2420,11 +2408,10 @@ def run(self, command, write_to_log=True, mute=None, **kwargs) -> str:
msg = f"{cmd_} is ignored: {INVAL_COMMANDS_SILENT[cmd_]}."
self._log.info(msg)

# This very likely won't be recorded anywhere.

# This, very likely, won't be recorded anywhere.
# But just in case, I'm adding info as /com
command = (
f"/com, PyAnsys: {msg}" # Using '!' makes the output of '_run' empty
f"/com, PyMAPDL: {msg}" # Using '!' makes the output of '_run' empty
)

if command[:3].upper() in INVAL_COMMANDS:
Expand Down
Loading