Skip to content

Commit

Permalink
Merging main
Browse files Browse the repository at this point in the history
  • Loading branch information
germa89 committed Oct 26, 2023
2 parents 34f92f2 + 712ec32 commit e76272f
Show file tree
Hide file tree
Showing 29 changed files with 731 additions and 245 deletions.
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

0 comments on commit e76272f

Please sign in to comment.