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

Improving converter #2433

Merged
merged 76 commits into from
Oct 26, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
76 commits
Select commit Hold shift + click to select a range
caf20d3
first approach
germa89 Oct 17, 2023
be26a1f
Being more exigent on the commands with empty arguments.
germa89 Oct 18, 2023
a0c70eb
Adding tests to previous commit
germa89 Oct 18, 2023
c3eebc4
Adding `use_vtk` argument
germa89 Oct 18, 2023
d5c7fdf
Adding clear_at_start argument
germa89 Oct 18, 2023
7060874
Commenting better /out,scratch
germa89 Oct 18, 2023
2a03642
Avoiding cmplot conversion
germa89 Oct 18, 2023
72020e4
Supporting macros calls
germa89 Oct 18, 2023
bbc03dd
Fixing expand arguments
germa89 Oct 18, 2023
43e1372
Removing prep7 after /verify
germa89 Oct 18, 2023
7282a44
reducing white space in bypassed commands
germa89 Oct 18, 2023
773a43e
reducing white spacing
germa89 Oct 18, 2023
a827768
Adding arguments to ddoption
germa89 Oct 18, 2023
0860869
Fixing vm double argument
germa89 Oct 18, 2023
d1c6099
Fixing vm extra argument
germa89 Oct 18, 2023
76b69fa
Fixing vm extra argument
germa89 Oct 18, 2023
681005d
Fix double arg
germa89 Oct 18, 2023
129afc1
Fixing launcher reference
germa89 Oct 18, 2023
095a92c
Fixing wrong parameter name in parres
germa89 Oct 19, 2023
ed584d4
Exiting interactive (P) xsel function if in non_interactive.
germa89 Oct 19, 2023
62cd7e3
Avoiding parsing some unexisting commands.
germa89 Oct 19, 2023
ef7a674
exiting early if in non_interactive when checking file path.
germa89 Oct 19, 2023
5e9c5d2
adding check_parameter_names argument to converter and mapdl
germa89 Oct 19, 2023
06294ab
Removing extra /out in vm51
germa89 Oct 19, 2023
ed5b1a6
Avoiding dict changing size and passing start arguments to cases wher…
germa89 Oct 19, 2023
229900c
Better parsing CLI arguments.
germa89 Oct 19, 2023
1cf59be
Exiting early some functions when in `non_interactive`
germa89 Oct 19, 2023
c054360
Making sure we are passing vtk
germa89 Oct 19, 2023
2a9f4fd
Better CLI parsing
germa89 Oct 19, 2023
a8ec466
Avoiding some checks while in non_interactive.
germa89 Oct 19, 2023
719832d
Removing extra arguments in SUBOPT.
germa89 Oct 19, 2023
408bd69
Adding more commands to ignores
germa89 Oct 19, 2023
82c898d
Force output in png mode retrieval
germa89 Oct 19, 2023
f7fc28c
adding missing argument to prcamp
germa89 Oct 19, 2023
79ce70b
Avoiding parameter name issue when extension is part of name and not …
germa89 Oct 19, 2023
a61af5e
Updating converter golden tests
germa89 Oct 19, 2023
83296c1
Avoiding too early exit in mapdl.input
germa89 Oct 19, 2023
a5c73f9
Removing check
germa89 Oct 19, 2023
55fd432
Update the image cache
germa89 Oct 19, 2023
23db17c
removing coda codacy warnings
germa89 Oct 19, 2023
afdbf8e
Merge branch 'feat/converter-improvements-for-ai-week' of https://git…
germa89 Oct 19, 2023
198ea25
Adding missing arguments
germa89 Oct 19, 2023
239186c
Fixing argument order
germa89 Oct 19, 2023
98acb60
Adding missing commands to ignored.
germa89 Oct 19, 2023
ab4705b
Eliminating unused argument in TBDATA
germa89 Oct 19, 2023
9da409a
Allowing arguments in macro calls.
germa89 Oct 19, 2023
0300d57
Taking into account leading chars
germa89 Oct 19, 2023
70555ed
Adding missing argument to HEMIOPT
germa89 Oct 19, 2023
f5b23e7
Adding more command to empty spaces
germa89 Oct 19, 2023
5c32b2d
removing extra argument
germa89 Oct 19, 2023
3af991a
removing extra argument
germa89 Oct 19, 2023
a4d12f0
Adding missing argument to PSDGRAPH
germa89 Oct 19, 2023
ea5f311
Merge branch 'main' into feat/converter-improvements-for-ai-week
germa89 Oct 20, 2023
10f8eff
* Fixing no exit from interactive.
germa89 Oct 20, 2023
83a1745
* Adding FORCED_MAPPING for exceptions.
germa89 Oct 20, 2023
0af1315
* Fix issue when non finding pymapdl equivalent, it gets none.
germa89 Oct 20, 2023
ccd1e06
* Keeping empty lines
germa89 Oct 20, 2023
1d0d331
Removing extra arguments.
germa89 Oct 20, 2023
5811412
Adding missing arguments
germa89 Oct 20, 2023
8a02235
Adding golden tests
germa89 Oct 20, 2023
15c629a
Adding /AXLAB specific behaviour.
germa89 Oct 20, 2023
0a9d522
Fixing tests
germa89 Oct 20, 2023
8fcbc82
Update the image cache
germa89 Oct 20, 2023
7c13ad6
Empty comment to trigger CICD
germa89 Oct 20, 2023
fe93b07
Merge branch 'feat/converter-improvements-for-ai-week' of https://git…
germa89 Oct 20, 2023
1f75042
Adding missing import
germa89 Oct 20, 2023
0e385b8
Improving parsing when using functions
germa89 Oct 23, 2023
f731020
Early exiting `*GET` when in `non_interactive`.
germa89 Oct 23, 2023
a4900e2
Improving coverage
germa89 Oct 23, 2023
37a67e7
Removing unreachable code.
germa89 Oct 23, 2023
dce3a1c
Fixing vwrite command
germa89 Oct 24, 2023
be71fb5
Fixing kabs vs kswp in Xsel commands
germa89 Oct 24, 2023
c748d0d
Fixing not plotting when no show command was set. IMGREAD issue.
germa89 Oct 24, 2023
4a57d50
Merge branch 'main' into feat/converter-improvements-for-ai-week
clatapie Oct 25, 2023
4ef9abd
Merge branch 'main' into feat/converter-improvements-for-ai-week
germa89 Oct 25, 2023
ab46f53
Merge branch 'main' into feat/converter-improvements-for-ai-week
germa89 Oct 25, 2023
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
4 changes: 2 additions & 2 deletions doc/source/user_guide/launcher.rst
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ the location of MAPDL must be provided for non-standard installations.
When running for the first time, ``ansys-mapdl-core`` requests the
location of the MAPDL executable if it cannot automatically find it.
You can test your installation of PyMAPDL and set it up by running
the :func:`launch_mapdl() <ansys.mapdl.core.launch_mapdl>` function:
the :func:`launch_mapdl() <ansys.mapdl.core.launcher.launch_mapdl>` function:

.. code:: python

Expand Down Expand Up @@ -81,4 +81,4 @@ keyword argument:
API reference
~~~~~~~~~~~~~
For more information on controlling how MAPDL launches locally, see the
description of the :func:`launch_mapdl() <ansys.mapdl.core.launch_mapdl>` function.
description of the :func:`launch_mapdl() <ansys.mapdl.core.launcher.launch_mapdl>` function.
14 changes: 8 additions & 6 deletions src/ansys/mapdl/core/_commands/apdl/parameter_definition.py
Original file line number Diff line number Diff line change
Expand Up @@ -518,13 +518,15 @@ def parres(self, lab="", fname="", ext="", **kwargs):
>>> mapdl.parres('parm.PARM')

"""
if ext:
fname = fname + "." + ext
elif not fname:
fname = "." + "PARM"
if not fname:
fname = self.jobname

if "Grpc" in self.__class__.__name__: # grpc mode
if self._local:
fname = self._get_file_name(
fname=fname, ext=ext, default_extension="parm"
) # Although documentation says `PARM`

if self._mode == "grpc": # grpc mode
if self.is_local:
# It must be a file!
if os.path.isfile(fname):
# And it exist!
Expand Down
5 changes: 4 additions & 1 deletion src/ansys/mapdl/core/_commands/aux12_/radiosity_solver.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,11 @@ def hemiopt(self, hres="", **kwargs):
hres
Hemicube resolution. Increase value to increase the accuracy of
the view factor calculation. Defaults to 10.

tolerance
Tolerance value that controls whether or not facets are subdivided in view factor calculations to increase view factor accuracy. TOLERANCE is closely related to the spacing between facets. Defaults to 1e-6.
"""
command = f"HEMIOPT,{hres}"
command = f"HEMIOPT,{hres},{tolerance}"
return self.run(command, **kwargs)

def radopt(
Expand Down
29 changes: 17 additions & 12 deletions src/ansys/mapdl/core/_commands/post1_/special.py
Original file line number Diff line number Diff line change
Expand Up @@ -1748,6 +1748,7 @@ def prcamp(
stabval="",
keyallfreq="",
keynegfreq="",
keywhirl="",
**kwargs,
):
"""Prints Campbell diagram data for applications involving rotating
Expand All @@ -1768,19 +1769,18 @@ def prcamp(
slope
The slope of the line to be printed. This value must be positive.

SLOPE > 0 - The line represents the number of excitations per revolution of the rotor. For
example, SLOPE = 1 represents one excitation per
revolution, usually resulting from unbalance.
SLOPE > 0 - The line represents the number of excitations per
revolution of the rotor. For example, SLOPE = 1 represents one
excitation per revolution, usually resulting from unbalance.

SLOPE = 0 - The line represents the stability threshold for stability values or logarithmic
decrements printout (STABVAL = 1 or 2)
SLOPE = 0 - The line represents the stability threshold for stability
values or logarithmic decrements printout (STABVAL = 1 or 2)

unit
Specifies the unit of measurement for rotational angular
velocities:

RDS - Rotational angular velocities in radians per second (rad/s). This value is the
default.
RDS - Rotational angular velocities in radians per second (rad/s). This value is the default.

RPM - Rotational angular velocities in revolutions per minute (RPMs).

Expand All @@ -1794,8 +1794,8 @@ def prcamp(
stabval
Flag to print the stability values:

0 (OFF or NO) - Print the frequencies (the imaginary parts of the eigenvalues in Hz). This
value is the default.
0 (OFF or NO) - Print the frequencies (the imaginary parts of the
eigenvalues in Hz). This value is the default.

1 (ON or YES) - Print the stability values (the real parts of the eigenvalues in Hz).

Expand All @@ -1804,9 +1804,8 @@ def prcamp(
keyallfreq
Key to specify if all frequencies above FREQB are printed out:

0 (OFF or NO) - A maximum of 10 frequencies are printed out. They correspond to the frequencies
displayed via the PLCAMP command. This value is the
default.
0 (OFF or NO) - A maximum of 10 frequencies are printed out. They
correspond to the frequencies displayed via the PLCAMP command. This value is the default.

1 (ON or YES) - All frequencies are printed out.

Expand All @@ -1819,6 +1818,12 @@ def prcamp(

1 (ON or YES) - Negative and positive frequencies are printed out.

keywhirl
Flag to print the whirl and instability keys for each load step:

0 (OFF or NO) - Print the whirl for the last load step. This value is the default.
1 (ON or YES) - Print the whirl and instability keys for each load step.

Notes
-----
The following items are required when generating a Campbell diagram:
Expand Down
2 changes: 1 addition & 1 deletion src/ansys/mapdl/core/_commands/post26_/special.py
Original file line number Diff line number Diff line change
Expand Up @@ -330,7 +330,7 @@ def rpsd(
See POST26 - Response Power Spectral Density in the Mechanical APDL
Theory Reference for more information on these equations.
"""
command = f"RPSD,{ir},{ia},{ib},{itype},{datum},{name},{signif}"
command = f"RPSD,{ir},{ia},{ib},{itype},{datum},{name},,{signif}"
return self.run(command, **kwargs)

def smooth(
Expand Down
36 changes: 32 additions & 4 deletions src/ansys/mapdl/core/_commands/preproc/special_purpose.py
Original file line number Diff line number Diff line change
Expand Up @@ -969,7 +969,9 @@ def sstate(
command = f"SSTATE,{action},{cm_name},{val1},{val2},{val3},{val4},{val5},{val6},{val7},{val8},{val9}"
return self.run(command, **kwargs)

def xfdata(self, enrichmentid="", elemnum="", nodenum="", phi="", **kwargs):
def xfdata(
self, enrichmentid="", lsm="", elemnum="", nodenum="", phi="", psi="", **kwargs
):
"""Defines a crack in the model by specifying nodal level set values

APDL Command: XFDATA
Expand All @@ -993,17 +995,30 @@ def xfdata(self, enrichmentid="", elemnum="", nodenum="", phi="", **kwargs):
phi
Signed normal distance of the node from the crack.

psi
Signed normal distance of the node from the crack tip (or crack front).
Used only in the singularity- based XFEM method.

Notes
-----
Issue the XFDATA command multiple times as needed to specify nodal
level set values for all nodes of an element.

This command is valid in PREP7 (/PREP7) only.
"""
command = f"XFDATA,{enrichmentid},{elemnum},{nodenum},{phi}"
command = f"XFDATA,{enrichmentid},{lsm},{elemnum},{nodenum},{phi},{psi}"
return self.run(command, **kwargs)

def xfenrich(self, enrichmentid="", compname="", matid="", **kwargs):
def xfenrich(
self,
enrichmentid="",
compname="",
matid="",
method="",
radius="",
snaptoler="",
**kwargs,
):
"""Defines parameters associated with crack propagation using XFEM

APDL Command: XFENRICH
Expand All @@ -1025,14 +1040,27 @@ def xfenrich(self, enrichmentid="", compname="", matid="", **kwargs):
the initial crack. If 0 or not specified, the initial crack is
assumed to be free of cohesive zone behavior.

method
PHAN -- Use phantom-node-based XFEM (default).
SING -- Use singularity-based XFEM.

radius
Radius defining the region around the crack tip encompassing the
set of elements to be influenced by the crack-tip singularity effects.
Default = 0.0. Used only in singularity-based XFEM.

snaptoler
Snap tolerance to snap the crack tip to the closest crack face along
the extension direction. Default = 1.0E-6. Used only in singularity-based XFEM.

Notes
-----
If MatID is specified, the cohesive zone behavior is described by the
bilinear cohesive law.

This command is valid in PREP7 (/PREP7) only.
"""
command = f"XFENRICH,{enrichmentid},{compname},{matid}"
command = f"XFENRICH,{enrichmentid},{compname},{matid}, {method}, {radius}, {snaptoler}"
return self.run(command, **kwargs)

def xflist(self, enrichmentid="", **kwargs):
Expand Down
33 changes: 19 additions & 14 deletions src/ansys/mapdl/core/_commands/solution/analysis_options.py
Original file line number Diff line number Diff line change
Expand Up @@ -1105,25 +1105,27 @@ def cutcontrol(self, lab="", value="", option="", **kwargs):
command = f"CUTCONTROL,{lab},{value},{option}"
return self.run(command, **kwargs)

def ddoption(self, decomp="", **kwargs):
def ddoption(self, decomp="", nprocpersol="", numsolforlp="", **kwargs):
"""Sets domain decomposer option for Distributed ANSYS.

APDL Command: DDOPTION

Parameters
----------
decomp
Decomp
Controls which domain decomposition algorithm to use.

AUTO
Use the default domain decomposition algorithm when splitting the model into
domains for Distributed ANSYS (default).
* AUTO - Automatically selects the optimal domain decomposition method (default).
* MESH - Decompose the FEA mesh.
* FREQ - Decompose the frequency domain for harmonic analyses.
* CYCHI -Decompose the harmonic indices for cyclic symmetry modal analyses.

GREEDY
Use the "greedy" domain decomposition algorithm.
nprocpersol
Number of processes to be used for mesh-based decomposition in conjunction with each frequency solution (`Decomp = FREQ`) or harmonic index solution (`Decomp = CYCHI`). Defaults to 1. This field
is ignored when `Decomp = MESH`.

METIS
Use the METIS graph partitioning domain decomposition algorithm.
numsolforlp
Number of frequency or harmonic index solutions in a subsequent linear perturbation harmonic or linear perturbation cyclic modal analysis. This field is ignored when `Decomp = MESH`

Notes
-----
Expand Down Expand Up @@ -2016,7 +2018,7 @@ def essolv(
command = f"ESSOLV,{electit},{strutit},{dimn},{morphopt},{mcomp},{xcomp},{electol},{strutol},{mxloop},,{ruseky},{restky},{eiscomp}"
return self.run(command, **kwargs)

def expass(self, key="", **kwargs):
def expass(self, key="", keystat="", **kwargs):
"""Specifies an expansion pass of an analysis.

APDL Command: EXPASS
Expand All @@ -2025,10 +2027,13 @@ def expass(self, key="", **kwargs):
----------
key
Expansion pass key:
* OFF - No expansion pass will be performed (default).
* ON - An expansion pass will be performed.

OFF - No expansion pass will be performed (default).

ON - An expansion pass will be performed.
keystat
Static correction vectors key:
* ON - Include static correction vectors in the expanded displacements (default).
* OFF - Do not include static correction vectors in the expanded displacements.

Notes
-----
Expand All @@ -2040,7 +2045,7 @@ def expass(self, key="", **kwargs):

This command is also valid in PREP7.
"""
command = f"EXPASS,{key}"
command = f"EXPASS,{key},,,{keystat}"
return self.run(command, **kwargs)

def gauge(self, opt="", freq="", **kwargs):
Expand Down
12 changes: 10 additions & 2 deletions src/ansys/mapdl/core/_commands/solution/spectrum_options.py
Original file line number Diff line number Diff line change
Expand Up @@ -669,7 +669,7 @@ def psdfrq(
command = f"PSDFRQ,{tblno1},{tblno2},{freq1},{freq2},{freq3},{freq4},{freq5},{freq6},{freq7}"
return self.run(command, **kwargs)

def psdgraph(self, tblno1="", tblno2="", **kwargs):
def psdgraph(self, tblno1="", tblno2="", displaykey="", **kwargs):
"""Displays input PSD curves

APDL Command: PSDGRAPH
Expand All @@ -683,6 +683,14 @@ def psdgraph(self, tblno1="", tblno2="", **kwargs):
Second PSD table number to display. TBLNO2 is used only in
conjunction with the COVAL or the QDVAL commands.

displaykey
Key to display the points markers and numbering:

0 - Display points markers and numbering (default).
1 - Display points numbering only.
2 - Display points markers only.
3 - No points markers or numbering.

Notes
-----
The input PSD tables are displayed in log-log format as dotted lines.
Expand All @@ -699,7 +707,7 @@ def psdgraph(self, tblno1="", tblno2="", **kwargs):

This command is valid in any processor.
"""
command = f"PSDGRAPH,{tblno1},{tblno2}"
command = f"PSDGRAPH,{tblno1},{tblno2},{displaykey}"
return self.run(command, **kwargs)

def psdres(self, lab="", relkey="", **kwargs):
Expand Down
Loading