diff --git a/.github/workflows/doc-build.yml b/.github/workflows/doc-build.yml index bb061177545..ac1c9e320fa 100644 --- a/.github/workflows/doc-build.yml +++ b/.github/workflows/doc-build.yml @@ -227,7 +227,7 @@ jobs: shell: bash run: | export PYTHONFAULTHANDLER=1 - xvfb-run make -C doc ${{ inputs.builder }} SPHINXOPTS="-j auto -W --keep-going" | tee doc_build.log + xvfb-run make -C doc ${{ inputs.builder }} SPHINXOPTS="-j auto" | tee doc_build.log - name: "Substitute defective GIF" shell: bash diff --git a/doc/changelog.d/4060.documentation.md b/doc/changelog.d/4060.documentation.md new file mode 100644 index 00000000000..c1d7bc635f9 --- /dev/null +++ b/doc/changelog.d/4060.documentation.md @@ -0,0 +1 @@ +Docs: update documentation to ``2023r2`` \ No newline at end of file diff --git a/doc/source/conf.py b/doc/source/conf.py index d3d6fd294ee..31717e0d807 100755 --- a/doc/source/conf.py +++ b/doc/source/conf.py @@ -92,7 +92,9 @@ # -- General configuration --------------------------------------------------- extensions = [ + "ansys_sphinx_theme.extension.linkcode", "jupyter_sphinx", + "linuxdoc.rstFlatTable", "numpydoc", "sphinx.ext.autodoc", "sphinx.ext.autosummary", @@ -156,6 +158,7 @@ numpydoc_validation_exclude = { # set of regex # class inherits from pymapdl-reader r"\.*MeshGrpc\.*", + r"ansys\.mapdl\.core\._commands\..+", } # Favicon diff --git a/doc/source/images/_commands/GSTR5-2.svg b/doc/source/images/_commands/GSTR5-2.svg new file mode 100644 index 00000000000..45371793e4a --- /dev/null +++ b/doc/source/images/_commands/GSTR5-2.svg @@ -0,0 +1,178 @@ + + + + + + + + + + + Gaps between + + + + + + + + + master node pairs + + + + + + + + + + (a) + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + (b) + + + + + + + + + + + + + + + + + + + + + Gaps between + + + + + + + + + master nodes + + + + + + + + + and ground + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/doc/source/images/_commands/Linebrk.gif b/doc/source/images/_commands/Linebrk.gif new file mode 100644 index 00000000000..fba32d35358 Binary files /dev/null and b/doc/source/images/_commands/Linebrk.gif differ diff --git a/doc/source/images/_commands/eqRESP2.gif b/doc/source/images/_commands/eqRESP2.gif new file mode 100644 index 00000000000..1cb57fd08fc Binary files /dev/null and b/doc/source/images/_commands/eqRESP2.gif differ diff --git a/doc/source/images/_commands/gEDBO1.svg b/doc/source/images/_commands/gEDBO1.svg new file mode 100644 index 00000000000..ef706b2a177 --- /dev/null +++ b/doc/source/images/_commands/gEDBO1.svg @@ -0,0 +1,836 @@ + + + + + + + + + + + + + + + + + + + + + Si + + + + + + + + + d + + + + + + + + + e + + + + + + + + + + + + + + + + + + 1 + + + + + + + + + + + Se + + + + + + + + + g + + + + + + + + + me + + + + + + + + + n + + + + + + + + + t + + + + + + + + + + + Si + + + + + + + + + d + + + + + + + + + e + + + + + + + + + + + + + + + + + + 2 + + + + + + + + + + + C + + + + + + + + + n + + + + + + + + + a + + + + + + + + + me + + + + + + + + + + + + + + + + + + - + + + + + + + + + + + + + + + + + + n + + + + + + + + + o + + + + + + + + + d + + + + + + + + + e + + + + + + + + + s + + + + + + + + + a + + + + + + + + + l + + + + + + + + + o + + + + + + + + + n + + + + + + + + + g + + + + + + + + + + + + + + + + + + si + + + + + + + + + d + + + + + + + + + e + + + + + + + + + + + + + + + + + + 1 + + + + + + + + + + + C + + + + + + + + + n + + + + + + + + + a + + + + + + + + + me + + + + + + + + + 2 + + + + + + + + + + + + + + + + + + - + + + + + + + + + + + + + + + + + + n + + + + + + + + + o + + + + + + + + + d + + + + + + + + + e + + + + + + + + + s + + + + + + + + + a + + + + + + + + + l + + + + + + + + + o + + + + + + + + + n + + + + + + + + + g + + + + + + + + + + + + + + + + + + si + + + + + + + + + d + + + + + + + + + e + + + + + + + + + + + + + + + + + + 2 + + + + + + + + + + + C + + + + + + + + + o + + + + + + + + + n + + + + + + + + + f + + + + + + + + + o + + + + + + + + + rm + + + + + + + + + a + + + + + + + + + b + + + + + + + + + l + + + + + + + + + e + + + + + + + + + + + + + + + + + + I + + + + + + + + + n + + + + + + + + + t + + + + + + + + + e + + + + + + + + + rf + + + + + + + + + a + + + + + + + + + ce + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/doc/source/images/_commands/gEDLC1.svg b/doc/source/images/_commands/gEDLC1.svg new file mode 100644 index 00000000000..cdf9e4f075a --- /dev/null +++ b/doc/source/images/_commands/gEDLC1.svg @@ -0,0 +1,88 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + y + + + + + + + + + z + + + + + + + + + xy + + + + + + + + + x + + + + + + + + + Origin (0,0,0) + + + + + + diff --git a/doc/source/images/_commands/gEINFIN1a.png b/doc/source/images/_commands/gEINFIN1a.png new file mode 100644 index 00000000000..6ef9d762c5f Binary files /dev/null and b/doc/source/images/_commands/gEINFIN1a.png differ diff --git a/doc/source/images/_commands/gEINFIN1b.png b/doc/source/images/_commands/gEINFIN1b.png new file mode 100644 index 00000000000..d52c90c8cd3 Binary files /dev/null and b/doc/source/images/_commands/gEINFIN1b.png differ diff --git a/doc/source/images/_commands/gEINFIN2a.png b/doc/source/images/_commands/gEINFIN2a.png new file mode 100644 index 00000000000..e200b503d22 Binary files /dev/null and b/doc/source/images/_commands/gEINFIN2a.png differ diff --git a/doc/source/images/_commands/gEINFIN2b.png b/doc/source/images/_commands/gEINFIN2b.png new file mode 100644 index 00000000000..84811a4b0d9 Binary files /dev/null and b/doc/source/images/_commands/gEINFIN2b.png differ diff --git a/doc/source/images/_commands/gEINFIN3.png b/doc/source/images/_commands/gEINFIN3.png new file mode 100644 index 00000000000..b10668e8a11 Binary files /dev/null and b/doc/source/images/_commands/gEINFIN3.png differ diff --git a/doc/source/images/_commands/gEINFIN4.png b/doc/source/images/_commands/gEINFIN4.png new file mode 100644 index 00000000000..4c3331df213 Binary files /dev/null and b/doc/source/images/_commands/gEINFIN4.png differ diff --git a/doc/source/images/_commands/gEINFIN5.png b/doc/source/images/_commands/gEINFIN5.png new file mode 100644 index 00000000000..37fa9d3d9ce Binary files /dev/null and b/doc/source/images/_commands/gEINFIN5.png differ diff --git a/doc/source/images/_commands/gENDRELEASE1.png b/doc/source/images/_commands/gENDRELEASE1.png new file mode 100644 index 00000000000..b0b6c3185cd Binary files /dev/null and b/doc/source/images/_commands/gENDRELEASE1.png differ diff --git a/doc/source/images/_commands/gENDRELEASE2.png b/doc/source/images/_commands/gENDRELEASE2.png new file mode 100644 index 00000000000..f701ad908f6 Binary files /dev/null and b/doc/source/images/_commands/gENDRELEASE2.png differ diff --git a/doc/source/images/_commands/gENDRELEASE3.png b/doc/source/images/_commands/gENDRELEASE3.png new file mode 100644 index 00000000000..9fb9eb8d2cc Binary files /dev/null and b/doc/source/images/_commands/gENDRELEASE3.png differ diff --git a/doc/source/images/_commands/gENDRELEASE4.png b/doc/source/images/_commands/gENDRELEASE4.png new file mode 100644 index 00000000000..f9eed4f4720 Binary files /dev/null and b/doc/source/images/_commands/gENDRELEASE4.png differ diff --git a/doc/source/images/_commands/gENDRELEASE5.png b/doc/source/images/_commands/gENDRELEASE5.png new file mode 100644 index 00000000000..d0c5eedb01a Binary files /dev/null and b/doc/source/images/_commands/gENDRELEASE5.png differ diff --git a/doc/source/images/_commands/gENDRELEASE6.png b/doc/source/images/_commands/gENDRELEASE6.png new file mode 100644 index 00000000000..0c2664d3665 Binary files /dev/null and b/doc/source/images/_commands/gENDRELEASE6.png differ diff --git a/doc/source/images/_commands/gENDRELEASE7.png b/doc/source/images/_commands/gENDRELEASE7.png new file mode 100644 index 00000000000..69a824a800c Binary files /dev/null and b/doc/source/images/_commands/gENDRELEASE7.png differ diff --git a/doc/source/images/_commands/gENDRELEASE8.png b/doc/source/images/_commands/gENDRELEASE8.png new file mode 100644 index 00000000000..df6c3594ec5 Binary files /dev/null and b/doc/source/images/_commands/gENDRELEASE8.png differ diff --git a/doc/source/images/_commands/gENDRELEASE9.png b/doc/source/images/_commands/gENDRELEASE9.png new file mode 100644 index 00000000000..23505226f0c Binary files /dev/null and b/doc/source/images/_commands/gENDRELEASE9.png differ diff --git a/doc/source/images/_commands/gFFT1.PNG b/doc/source/images/_commands/gFFT1.PNG new file mode 100644 index 00000000000..017d1aed2c7 Binary files /dev/null and b/doc/source/images/_commands/gFFT1.PNG differ diff --git a/doc/source/images/_commands/gFFT2.PNG b/doc/source/images/_commands/gFFT2.PNG new file mode 100644 index 00000000000..9f28e278364 Binary files /dev/null and b/doc/source/images/_commands/gFFT2.PNG differ diff --git a/doc/source/images/_commands/gFFT3.PNG b/doc/source/images/_commands/gFFT3.PNG new file mode 100644 index 00000000000..a58ac7c2675 Binary files /dev/null and b/doc/source/images/_commands/gFFT3.PNG differ diff --git a/doc/source/images/_commands/gINIT1.svg b/doc/source/images/_commands/gINIT1.svg new file mode 100644 index 00000000000..249d45ef707 --- /dev/null +++ b/doc/source/images/_commands/gINIT1.svg @@ -0,0 +1,585 @@ + + + + + + + + + + + + + + + + + + + + + + + + + image/svg+xml + + + + + + + + + + + + + + + + + + + + 2 + 7 + 3 + 6 + 4 + 5 + 1 + 2 + 3 + Original Matrix, M1 + + + + + + + + + + + 8 + 7 + 3 + 6 + 8 + 5 + 1 + 2 + 8 + *INIT,M1,DIAG,0,8 + + + + + + + + + + + + + + 8 + 7 + 3 + 8 + 5 + 1 + 3 + *INIT,M1,DIAG,-1,8 + + + 2 + 4 + OR + + + diff --git a/doc/source/images/_commands/gKCEN1.svg b/doc/source/images/_commands/gKCEN1.svg new file mode 100644 index 00000000000..00b33639961 --- /dev/null +++ b/doc/source/images/_commands/gKCEN1.svg @@ -0,0 +1,441 @@ + + + + + + + + + + + + + + + VAL1 + + + + + + + + + + imaginary + + + + + + + + + circular arc + + + + + + + + + + + imaginary + + + + + + + + + circular arc + + + + + + + + + + + imaginary + + + + + + + + + circular arc + + + + + + + + + + VAL1 + + + + + + + + + VAL1 + + + + + + + + + VAL1 (circular line) + + + + + + + + + VAL1 (arbitrary line) + + + + + + + + + VAL2 + + + + + + + + + VAL2 + + + + + + + + + VAL2 + + + + + + + + + VAL2 + + + + + + + + + VAL3 + + + + + + + + + VAL3 + + + + + + + + + VAL3 + + + + + + + + + VAL3 + + + + + + + + + + VAL4 + + + + + + + + + (+ radius) + + + + + + + + + + + VAL4 + + + + + + + + + (- radius) + + + + + + + + + + VAL4 + + + + + + + + + KPNEW + + + + + + + + + KPNEW + + + + + + + + + KPNEW + + + + + + + + + KPNEW + + + + + + + + + KPNEW + + + + + + + + + (a) Three keypoints + + + + + + + + + (b) Three keypoints and a radius + + + + + + + + + (c) Locations on line + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + imaginary + + + + + + + + + circular arc + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/doc/source/images/_commands/gMERGE1.png b/doc/source/images/_commands/gMERGE1.png new file mode 100644 index 00000000000..24ad6e17482 Binary files /dev/null and b/doc/source/images/_commands/gMERGE1.png differ diff --git a/doc/source/images/_commands/gMERGE2.png b/doc/source/images/_commands/gMERGE2.png new file mode 100644 index 00000000000..5149ce7a77c Binary files /dev/null and b/doc/source/images/_commands/gMERGE2.png differ diff --git a/doc/source/images/_commands/gMERGE3.png b/doc/source/images/_commands/gMERGE3.png new file mode 100644 index 00000000000..c2b366ee27e Binary files /dev/null and b/doc/source/images/_commands/gMERGE3.png differ diff --git a/doc/source/images/_commands/gMSHP1.svg b/doc/source/images/_commands/gMSHP1.svg new file mode 100644 index 00000000000..95730178564 --- /dev/null +++ b/doc/source/images/_commands/gMSHP1.svg @@ -0,0 +1,276 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + KE + + + + + + + + + Y + + + + + + + + + = + + + + + + + + + + + + + + + + + + 0 + + + + + + + + + + + KE + + + + + + + + + Y + + + + + + + + + = + + + + + + + + + + + + + + + + + + 1 + + + + + + + + + + + KE + + + + + + + + + Y + + + + + + + + + = + + + + + + + + + + + + + + + + + + 2 + + + + + + diff --git a/doc/source/images/_commands/gOCDATA1.png b/doc/source/images/_commands/gOCDATA1.png new file mode 100644 index 00000000000..8b88a9a6f59 Binary files /dev/null and b/doc/source/images/_commands/gOCDATA1.png differ diff --git a/doc/source/images/_commands/gPDBBMproblevels.gif b/doc/source/images/_commands/gPDBBMproblevels.gif new file mode 100644 index 00000000000..3e6ea92b0fa Binary files /dev/null and b/doc/source/images/_commands/gPDBBMproblevels.gif differ diff --git a/doc/source/images/_commands/gPDCORR00.gif b/doc/source/images/_commands/gPDCORR00.gif new file mode 100644 index 00000000000..64801779b0a Binary files /dev/null and b/doc/source/images/_commands/gPDCORR00.gif differ diff --git a/doc/source/images/_commands/gPDCORR06.gif b/doc/source/images/_commands/gPDCORR06.gif new file mode 100644 index 00000000000..847face7a8d Binary files /dev/null and b/doc/source/images/_commands/gPDCORR06.gif differ diff --git a/doc/source/images/_commands/gPDCORR09.gif b/doc/source/images/_commands/gPDCORR09.gif new file mode 100644 index 00000000000..c90c1051340 Binary files /dev/null and b/doc/source/images/_commands/gPDCORR09.gif differ diff --git a/doc/source/images/_commands/gPDMETHbbm.gif b/doc/source/images/_commands/gPDMETHbbm.gif new file mode 100644 index 00000000000..80956e4ec54 Binary files /dev/null and b/doc/source/images/_commands/gPDMETHbbm.gif differ diff --git a/doc/source/images/_commands/gPDMETHccd.gif b/doc/source/images/_commands/gPDMETHccd.gif new file mode 100644 index 00000000000..0add3f4d428 Binary files /dev/null and b/doc/source/images/_commands/gPDMETHccd.gif differ diff --git a/doc/source/images/_commands/gPDMETHdir.gif b/doc/source/images/_commands/gPDMETHdir.gif new file mode 100644 index 00000000000..7f77e5ca902 Binary files /dev/null and b/doc/source/images/_commands/gPDMETHdir.gif differ diff --git a/doc/source/images/_commands/gPDMETHlhs.gif b/doc/source/images/_commands/gPDMETHlhs.gif new file mode 100644 index 00000000000..820784875d0 Binary files /dev/null and b/doc/source/images/_commands/gPDMETHlhs.gif differ diff --git a/doc/source/images/_commands/gPDPLOTlimits1.gif b/doc/source/images/_commands/gPDPLOTlimits1.gif new file mode 100644 index 00000000000..1cca880a1e7 Binary files /dev/null and b/doc/source/images/_commands/gPDPLOTlimits1.gif differ diff --git a/doc/source/images/_commands/gPDVARbeta.svg b/doc/source/images/_commands/gPDVARbeta.svg new file mode 100644 index 00000000000..99519c58af1 --- /dev/null +++ b/doc/source/images/_commands/gPDVARbeta.svg @@ -0,0 +1,112 @@ + + + + + + + + + + + + f + + + + + + + + + X + + + + + + + + + (x) + + + + + + + + + + x + + + + + + + + + + + + x + + + + + + + + + min + + + + + + + + + + + x + + + + + + + + + max + + + + + + + + + + + + + + r + + + + + + + + + ,t + + + + + + diff --git a/doc/source/images/_commands/gPDVARbetacum.svg b/doc/source/images/_commands/gPDVARbetacum.svg new file mode 100644 index 00000000000..07053936ccf --- /dev/null +++ b/doc/source/images/_commands/gPDVARbetacum.svg @@ -0,0 +1,112 @@ + + + + + + + + + + + + F + + + + + + + + + X + + + + + + + + + (x) + + + + + + + + + + x + + + + + + + + + + + + x + + + + + + + + + min + + + + + + + + + + + x + + + + + + + + + max + + + + + + + + + + + + + + r + + + + + + + + + ,t + + + + + + diff --git a/doc/source/images/_commands/gPDVARexpo.svg b/doc/source/images/_commands/gPDVARexpo.svg new file mode 100644 index 00000000000..d3b0effd8cd --- /dev/null +++ b/doc/source/images/_commands/gPDVARexpo.svg @@ -0,0 +1,76 @@ + + + + + + + + + + + + f + + + + + + + + + X + + + + + + + + + (x) + + + + + + + + + + x + + + + + + + + + + + x + + + + + + + + + min + + + + + + + + + + + diff --git a/doc/source/images/_commands/gPDVARexpocum.svg b/doc/source/images/_commands/gPDVARexpocum.svg new file mode 100644 index 00000000000..27167c74430 --- /dev/null +++ b/doc/source/images/_commands/gPDVARexpocum.svg @@ -0,0 +1,74 @@ + + + + + + + + + + + + F + + + + + + + + + X + + + + + + + + + (x) + + + + + + + + + + x + + + + + + + + + + x + + + + + + + + + min + + + + + + + + + + + diff --git a/doc/source/images/_commands/gPDVARgama.svg b/doc/source/images/_commands/gPDVARgama.svg new file mode 100644 index 00000000000..3da03b6a0ec --- /dev/null +++ b/doc/source/images/_commands/gPDVARgama.svg @@ -0,0 +1,73 @@ + + + + + + + + + + + + f + + + + + + + + + X + + + + + + + + + (x) + + + + + + + + + + + + + + + k + + + + + + + + + + x + + + + + + + + + + diff --git a/doc/source/images/_commands/gPDVARgamacum.svg b/doc/source/images/_commands/gPDVARgamacum.svg new file mode 100644 index 00000000000..42624b861b8 --- /dev/null +++ b/doc/source/images/_commands/gPDVARgamacum.svg @@ -0,0 +1,72 @@ + + + + + + + + + + + + F + + + + + + + + + X + + + + + + + + + (x) + + + + + + + + + + + + + + + k + + + + + + + + + + x + + + + + + + + + + diff --git a/doc/source/images/_commands/gPDVARgaus.svg b/doc/source/images/_commands/gPDVARgaus.svg new file mode 100644 index 00000000000..e88928879b3 --- /dev/null +++ b/doc/source/images/_commands/gPDVARgaus.svg @@ -0,0 +1,94 @@ + + + + + + + + + + + + + f + + + + + + + + + X + + + + + + + + + (x) + + + + + + + + + + 2 + + + + + + + + + µ + + + + + + + + + x + + + + + + + + + + + + + + + + + + + + + + + + + σ + + + + + diff --git a/doc/source/images/_commands/gPDVARgauscum.svg b/doc/source/images/_commands/gPDVARgauscum.svg new file mode 100644 index 00000000000..5fc720fb1bf --- /dev/null +++ b/doc/source/images/_commands/gPDVARgauscum.svg @@ -0,0 +1,60 @@ + + + + + + + + + + + + + F + + + + + + + + + X + + + + + + + + + (x) + + + + + + + + + + x + + + + + + + + + + diff --git a/doc/source/images/_commands/gPDVARlog1.svg b/doc/source/images/_commands/gPDVARlog1.svg new file mode 100644 index 00000000000..08c82d36193 --- /dev/null +++ b/doc/source/images/_commands/gPDVARlog1.svg @@ -0,0 +1,63 @@ + + + + + + + + + + + + + f + + + + + + + + + X + + + + + + + + + (x) + + + + + + + + + + + + + x + + + + + + + + + diff --git a/doc/source/images/_commands/gPDVARlog2.svg b/doc/source/images/_commands/gPDVARlog2.svg new file mode 100644 index 00000000000..284c6f90d09 --- /dev/null +++ b/doc/source/images/_commands/gPDVARlog2.svg @@ -0,0 +1,74 @@ + + + + + + + + + + + + f + + + + + + + + + X + + + + + + + + + (x) + + + + + + + + + + + + + + x + + + + + + + diff --git a/doc/source/images/_commands/gPDVARlog2cum.svg b/doc/source/images/_commands/gPDVARlog2cum.svg new file mode 100644 index 00000000000..7f62cf4b388 --- /dev/null +++ b/doc/source/images/_commands/gPDVARlog2cum.svg @@ -0,0 +1,75 @@ + + + + + + + + + + + + F + + + + + + + + + X + + + + + + + + + (x) + + + + + + + + + + + + + + x + + + + + + + diff --git a/doc/source/images/_commands/gPDVARtgau.svg b/doc/source/images/_commands/gPDVARtgau.svg new file mode 100644 index 00000000000..1bc03e50aca --- /dev/null +++ b/doc/source/images/_commands/gPDVARtgau.svg @@ -0,0 +1,157 @@ + + + + + + + + + + + + + f + + + + + + + + + X + + + + + + + + + (x) + + + + + + + + + + + 2 + + + + + + + + + + + + G + + + + + + + + + + + + + + G + + + + + + + + + + x + + + + + + + + + + + + + + + + + + + + + + + + + + + x + + + + + + + + + min + + + + + + + + + + + x + + + + + + + + + max + + + + + + + diff --git a/doc/source/images/_commands/gPDVARtgaucum.svg b/doc/source/images/_commands/gPDVARtgaucum.svg new file mode 100644 index 00000000000..4a8a0409ef2 --- /dev/null +++ b/doc/source/images/_commands/gPDVARtgaucum.svg @@ -0,0 +1,112 @@ + + + + + + + + + + + + + F + + + + + + + + + X + + + + + + + + + (x) + + + + + + + + + + + + + + G + + + + + + + + + + x + + + + + + + + + + x + + + + + + + + + min + + + + + + + + + + + x + + + + + + + + + max + + + + + + + + + diff --git a/doc/source/images/_commands/gPDVARtria.svg b/doc/source/images/_commands/gPDVARtria.svg new file mode 100644 index 00000000000..eb260bf4318 --- /dev/null +++ b/doc/source/images/_commands/gPDVARtria.svg @@ -0,0 +1,111 @@ + + + + + + + + + + + + + f + + + + + + + + + X + + + + + + + + + (x) + + + + + + + + + + x + + + + + + + + + + + x + + + + + + + + + min + + + + + + + + + + + x + + + + + + + + + max + + + + + + + + + + + + + + x + + + + + + + + + mlv + + + + + + diff --git a/doc/source/images/_commands/gPDVARtriacum.svg b/doc/source/images/_commands/gPDVARtriacum.svg new file mode 100644 index 00000000000..188e2e597a6 --- /dev/null +++ b/doc/source/images/_commands/gPDVARtriacum.svg @@ -0,0 +1,110 @@ + + + + + + + + + + + + F + + + + + + + + + X + + + + + + + + + (x) + + + + + + + + + + x + + + + + + + + + + + x + + + + + + + + + min + + + + + + + + + + + x + + + + + + + + + max + + + + + + + + + + + + x + + + + + + + + + mlv + + + + + + + diff --git a/doc/source/images/_commands/gPDVARunif.svg b/doc/source/images/_commands/gPDVARunif.svg new file mode 100644 index 00000000000..18078901859 --- /dev/null +++ b/doc/source/images/_commands/gPDVARunif.svg @@ -0,0 +1,89 @@ + + + + + + + + + + + + f + + + + + + + + + X + + + + + + + + + (x) + + + + + + + + + + x + + + + + + + + + + + x + + + + + + + + + min + + + + + + + + + + + x + + + + + + + + + max + + + + + + + + diff --git a/doc/source/images/_commands/gPDVARunifcum.svg b/doc/source/images/_commands/gPDVARunifcum.svg new file mode 100644 index 00000000000..452944037b4 --- /dev/null +++ b/doc/source/images/_commands/gPDVARunifcum.svg @@ -0,0 +1,91 @@ + + + + + + + + + + + + F + + + + + + + + + X + + + + + + + + + (x) + + + + + + + + + + x + + + + + + + + + + + x + + + + + + + + + min + + + + + + + + + + + x + + + + + + + + + max + + + + + + + + + + diff --git a/doc/source/images/_commands/gPDVARweib.svg b/doc/source/images/_commands/gPDVARweib.svg new file mode 100644 index 00000000000..9132931ae14 --- /dev/null +++ b/doc/source/images/_commands/gPDVARweib.svg @@ -0,0 +1,91 @@ + + + + + + + + + + + + f + + + + + + + + + X + + + + + + + + + (x) + + + + + + + + + + x + + + + + + + + + + + + x + + + + + + + + + min + + + + + + + + + + + + m,x + + + + + + + + + chr + + + + + + + diff --git a/doc/source/images/_commands/gPDVARweibcum.svg b/doc/source/images/_commands/gPDVARweibcum.svg new file mode 100644 index 00000000000..9d1ff6fdd77 --- /dev/null +++ b/doc/source/images/_commands/gPDVARweibcum.svg @@ -0,0 +1,137 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/doc/source/images/_commands/gPORT1.gif b/doc/source/images/_commands/gPORT1.gif new file mode 100644 index 00000000000..85218c5a2aa Binary files /dev/null and b/doc/source/images/_commands/gPORT1.gif differ diff --git a/doc/source/images/_commands/gPORT2.gif b/doc/source/images/_commands/gPORT2.gif new file mode 100644 index 00000000000..6fece1b2201 Binary files /dev/null and b/doc/source/images/_commands/gPORT2.gif differ diff --git a/doc/source/images/_commands/gPORT3.gif b/doc/source/images/_commands/gPORT3.gif new file mode 100644 index 00000000000..82b0430b161 Binary files /dev/null and b/doc/source/images/_commands/gPORT3.gif differ diff --git a/doc/source/images/_commands/gPSMAT1.gif b/doc/source/images/_commands/gPSMAT1.gif new file mode 100644 index 00000000000..408df366e70 Binary files /dev/null and b/doc/source/images/_commands/gPSMAT1.gif differ diff --git a/doc/source/images/_commands/gPSMAT2.svg b/doc/source/images/_commands/gPSMAT2.svg new file mode 100644 index 00000000000..02a01abfc45 --- /dev/null +++ b/doc/source/images/_commands/gPSMAT2.svg @@ -0,0 +1,688 @@ + + + + + + + + + + K Matrix + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/doc/source/images/_commands/gRACE1.svg b/doc/source/images/_commands/gRACE1.svg new file mode 100644 index 00000000000..d6f112bb2f7 --- /dev/null +++ b/doc/source/images/_commands/gRACE1.svg @@ -0,0 +1,227 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + TCUR + + + + + + + + + + + + + + + + + + + + + + + + + + + X + + + + + + + + + Y + + + + + + + + + Z + + + + + + + + + + + + + + + + + + + + + + + + + + + XC + + + + + + + + + + + + + + + + + + + + + + + + + + + DY + + + + + + + + + + + + + + RAD + + + + + + + + + YC + + + + + + + + + Thickness = DZ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/doc/source/images/_commands/gRDEC.svg b/doc/source/images/_commands/gRDEC.svg new file mode 100644 index 00000000000..203329ee1db --- /dev/null +++ b/doc/source/images/_commands/gRDEC.svg @@ -0,0 +1,225 @@ + + + + + + + + + + edge + + + + + + + + + collapse + + + + + + + + + + + + + + + + + + + Before + + + + + + + + + After + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + I + + + + + + + + + J + + + + + + + + + + + + edge + + + + + + + + + collapse + + + + + + + + + + + + + + + + + + + Before + + + + + + + + + After + + + + + + + + + + + + + + + + + + + J + + + + + + + + + + Optimal Placement + + + + + + + + + Subset Placement + + + + + + + + + + + + + + + + + + + + + + + + I + + + + + + + + + J + + + + + + + diff --git a/doc/source/images/_commands/gSECD1.svg b/doc/source/images/_commands/gSECD1.svg new file mode 100644 index 00000000000..004eee26ba8 --- /dev/null +++ b/doc/source/images/_commands/gSECD1.svg @@ -0,0 +1,110 @@ + + + + + + + + + + + + + B + + + + + + + + + H + + + + + + + + + y + + + + + + + + + z + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + H + + + + + + + + + + + + + + + + + + + + B + + + + + diff --git a/doc/source/images/_commands/gSECD10.svg b/doc/source/images/_commands/gSECD10.svg new file mode 100644 index 00000000000..9996a245bce --- /dev/null +++ b/doc/source/images/_commands/gSECD10.svg @@ -0,0 +1,193 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + W1 + + + + + + + + + W2 + + + + + + + + + W3 + + + + + + + + + W4 + + + + + + + + + t3 + + + + + + + + + t4 + + + + + + + + + + + + + + + + t1 + + + + + + + + + + + + + + + + + + + + + + + + + + + t2 + + + + + + + + + t5 + + + + + + + + + z + + + + + + + + + y + + + + + + + diff --git a/doc/source/images/_commands/gSECD11.svg b/doc/source/images/_commands/gSECD11.svg new file mode 100644 index 00000000000..0af8ddd33ca --- /dev/null +++ b/doc/source/images/_commands/gSECD11.svg @@ -0,0 +1,242 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + W1 + + + + + + + + + + W + + + + + + + + + 2 + + + + + + + + + + t1 + + + + + + + + + t4 + + + + + + + + + + + + + + + + + + + + + + + + + + + y + + + + + + + + + z + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + t2 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + t3 + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/doc/source/images/_commands/gSECD12.svg b/doc/source/images/_commands/gSECD12.svg new file mode 100644 index 00000000000..e865cc3813a --- /dev/null +++ b/doc/source/images/_commands/gSECD12.svg @@ -0,0 +1,127 @@ + + + + +Base layer n + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +I +II +J +K +KK +L +LL + + + + + + + + +JJ + + + + + + +M + + + + +P +O +N + + + + +Reinforcement + + + + + + + + + diff --git a/doc/source/images/_commands/gSECD13.svg b/doc/source/images/_commands/gSECD13.svg new file mode 100644 index 00000000000..0b0dbf7e37a --- /dev/null +++ b/doc/source/images/_commands/gSECD13.svg @@ -0,0 +1,207 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + I + + + + + + + + + II + + + + + + + + + J + + + + + + + + + K + + + + + + + + + KK + + + + + + + + + L + + + + + + + + + LL + + + + + + + + + + + + + + + + + JJ + + + + + + + + + + + + + + + + + + + + + + + + + + + + Base layer n + + + + + + + + + + + + + + + Reinforcement + + + + + + + + + + diff --git a/doc/source/images/_commands/gSECD14a.svg b/doc/source/images/_commands/gSECD14a.svg new file mode 100644 index 00000000000..c2b463c6104 --- /dev/null +++ b/doc/source/images/_commands/gSECD14a.svg @@ -0,0 +1,109 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +I +II +J (d = 0) +K +KK +L +LL + + + + + + + + +JJ + + + + + + +M + +P +O + + + + + + + + + + +d2 +N (d = 1) +f = 1 + + + + + + + + + + + + + + + +d1 +d1 + + + + + + + + + +d2 + diff --git a/doc/source/images/_commands/gSECD14b.svg b/doc/source/images/_commands/gSECD14b.svg new file mode 100644 index 00000000000..abecc83d28d --- /dev/null +++ b/doc/source/images/_commands/gSECD14b.svg @@ -0,0 +1,118 @@ + + + + + + + + + + +d2 + + + + + + + + + + + + + + + + + + +I (d = 0) +II +J (d = 1) +K +KK +L +LL + + + + + + + + +JJ + + + + + + + +M + +P +O + + + + + + + +d1 +N +f = 2 + + + + + + + + + + + + + + + + + + +d1 + + + + + + + + + + + + +d2 + + + + + + + diff --git a/doc/source/images/_commands/gSECD14c.svg b/doc/source/images/_commands/gSECD14c.svg new file mode 100644 index 00000000000..52979df99ef --- /dev/null +++ b/doc/source/images/_commands/gSECD14c.svg @@ -0,0 +1,123 @@ + + + + + + + + + + + + + + + + +I +II +J (d = 0) +K (d = 1) +KK +L +LL + + + + + + + +JJ + + + + +M + +P +O + +N +f = 3 + + + + + + + + + + + + + + + + + + + + + + + + + + +d2 + + + + + + +d1 + + + + + + + + + + + + +d2 + + + + + + + + + + + + +d1 + + + + + + + diff --git a/doc/source/images/_commands/gSECD15a.svg b/doc/source/images/_commands/gSECD15a.svg new file mode 100644 index 00000000000..67412b1cdbe --- /dev/null +++ b/doc/source/images/_commands/gSECD15a.svg @@ -0,0 +1,141 @@ + + + + + + + + + + + + + + + + + + + + + + + d + + + + + + + + + JJ + + + + + + + + + KK, LL + + + + + + + + + K + + + + + + + + + J (d = 0) + + + + + + + + + I + + + + + + + + + II + + + + + + + + + + L + + + + + + + + + (d = 1) + + + + + + + + + + + + + f = 1 + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/doc/source/images/_commands/gSECD15b.svg b/doc/source/images/_commands/gSECD15b.svg new file mode 100644 index 00000000000..ac8440381d6 --- /dev/null +++ b/doc/source/images/_commands/gSECD15b.svg @@ -0,0 +1,141 @@ + + + + + + + + + + + + + + + + + + + + + + + d + + + + + + + + + JJ + + + + + + + + + KK, LL + + + + + + + + + K + + + + + + + + + J (d = 1) + + + + + + + + + I + + + + + + + + + II + + + + + + + + + + L + + + + + + + + + (d = 0) + + + + + + + + + + + + + f = 2 + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/doc/source/images/_commands/gSECD15c.svg b/doc/source/images/_commands/gSECD15c.svg new file mode 100644 index 00000000000..d97ef8c9019 --- /dev/null +++ b/doc/source/images/_commands/gSECD15c.svg @@ -0,0 +1,130 @@ + + + + + + + + + + + + + + + + + + + + + + d + + + + + + + + + JJ + + + + + + + + + KK, LL + + + + + + + + + K (d = 1) + + + + + + + + + J (d = 0) + + + + + + + + + I + + + + + + + + + II + + + + + + + + + L + + + + + + + + + + + + f = 3 + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/doc/source/images/_commands/gSECD16.svg b/doc/source/images/_commands/gSECD16.svg new file mode 100644 index 00000000000..52406713097 --- /dev/null +++ b/doc/source/images/_commands/gSECD16.svg @@ -0,0 +1,393 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + L + + + + + + + + + K + + + + + + + + + J + + + + + + + + + + I + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + LL + + + + + + + + + JJ + + + + + + + + + KK + + + + + + + + + II + + + + + + + + + d = 0 + + + + + + + + + d = 1 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + d + + + + + + + + + + + + + + + + diff --git a/doc/source/images/_commands/gSECD18.svg b/doc/source/images/_commands/gSECD18.svg new file mode 100644 index 00000000000..88cbe0d5092 --- /dev/null +++ b/doc/source/images/_commands/gSECD18.svg @@ -0,0 +1,436 @@ + + + + + + + + + + + + + + Base layer n + + + + + + + + + + + + + + + + + + + + + + + + + + + + + I + + + + + + + + + J + + + + + + + + + K + + + + + + + + + L + + + + + + + + + + + + + + + + M + + + + + + + + + + + + + P + + + + + + + + + O + + + + + + + + + N + + + + + + + + + + + (Y + + + + + + + + + 1 + + + + + + + + + + + + + + + + + + = 1) + + + + + + + + + + + (Y + + + + + + + + + 2 + + + + + + + + + + + + + + + + + + = 1) + + + + + + + + + + + (Y + + + + + + + + + 1 + + + + + + + + + + + + + + + + + + = 0) + + + + + + + + + + + Y + + + + + + + + + 2 + + + + + + + + + + + + + + + + + + + + (Y + + + + + + + + + 2 + + + + + + + + + + + + + + + + + + = 0) + + + + + + + + + + + + + + + + + + + + + Y + + + + + + + + + 1 + + + + + + + + + + II + + + + + + + + + + + + + + + + + + JJ + + + + + + + + + + + + + + + + + + + + + + + + + + + + Reinforcing + + + + + + + + + + + + + + + + + + + e = 1 + + + + + + + + + + + + + + diff --git a/doc/source/images/_commands/gSECD19.svg b/doc/source/images/_commands/gSECD19.svg new file mode 100644 index 00000000000..729333f32d6 --- /dev/null +++ b/doc/source/images/_commands/gSECD19.svg @@ -0,0 +1,501 @@ + + + + + + + + + + + + + + + Base layer n + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + I + + + + + + + + + + + J + + + + + + + + + + + K + + + + + + + + + + + L + + + + + + + + + + + + + + + + + + M + + + + + + + + + + + + + + + P + + + + + + + + + + + O + + + + + + + + + + + N + + + + + + + + + + + + (Y + + + + + + + + + + + 1 + + + + + + + + + + + + + + + + + + + + + + = 1) + + + + + + + + + + + + + (Y + + + + + + + + + + + 2 + + + + + + + + + + + + + + + + + + + + + + = 1) + + + + + + + + + + + + + (Y + + + + + + + + + + + 1 + + + + + + + + + + + + + + + + + + + + + + = 0) + + + + + + + + + + + + + Y + + + + + + + + + + + 2 + + + + + + + + + + + + + + + + + + + + + + (Y + + + + + + + + + + + 2 + + + + + + + + + + + + + + + + + + + + + + = 0) + + + + + + + + + + + + + + + + + + + + + + + Y + + + + + + + + + + + 1 + + + + + + + + + + + + II + + + + + + + + + + + + + + + + + + + + JJ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + e = 2 + + + + + + + + + + + + + + + + + + + + + + Reinforcing + + + + + + + + + + + + + + diff --git a/doc/source/images/_commands/gSECD2.svg b/doc/source/images/_commands/gSECD2.svg new file mode 100644 index 00000000000..e29aad5668a --- /dev/null +++ b/doc/source/images/_commands/gSECD2.svg @@ -0,0 +1,104 @@ + + + + + + + + + + + + + I + + + + + + + + + J + + + + + + + + + K + + + + + + + + + L + + + + + + + + + g + + + + + + + + + h + + + + + + + + + y + + + + + + + + + z + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/doc/source/images/_commands/gSECD20.svg b/doc/source/images/_commands/gSECD20.svg new file mode 100644 index 00000000000..83e5590d487 --- /dev/null +++ b/doc/source/images/_commands/gSECD20.svg @@ -0,0 +1,403 @@ + + + + + + + + + + + + + + + Base layer n + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + I + + + + + + + + + J + + + + + + + + + K + + + + + + + + + L + + + + + + + + + + + + + + + + + + (Y + + + + + + + + + 1 + + + + + + + + + + + + + + + + + + = 1) + + + + + + + + + + + (Y + + + + + + + + + 2 + + + + + + + + + + + + + + + + + + = 1) + + + + + + + + + + + (Y + + + + + + + + + 1 + + + + + + + + + + + + + + + + + + = 0) + + + + + + + + + + + Y + + + + + + + + + 2 + + + + + + + + + + + + + + + + + + + + + (Y + + + + + + + + + 2 + + + + + + + + + + + + + + + + + + = 0) + + + + + + + + + + + + + + + + + + + + + + Y + + + + + + + + + 1 + + + + + + + + + + II + + + + + + + + + + + + + + + + + + JJ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Reinforcing + + + + + + + + + + + + + + + + + + + e = 1 + + + + + + + + + + + + + + + + + diff --git a/doc/source/images/_commands/gSECD21.svg b/doc/source/images/_commands/gSECD21.svg new file mode 100644 index 00000000000..ad1a93ef1d8 --- /dev/null +++ b/doc/source/images/_commands/gSECD21.svg @@ -0,0 +1,402 @@ + + + + + + + + + + + + + + + Base layer n + + + + + + + + + + + + + + + + + + + + + + + + + + + + + I + + + + + + + + + J + + + + + + + + + K + + + + + + + + + L + + + + + + + + + + + + + + + + + (Y + + + + + + + + + 1 + + + + + + + + + + + + + + + + + + = 1) + + + + + + + + + + + (Y + + + + + + + + + 2 + + + + + + + + + + + + + + + + + + = 1) + + + + + + + + + + + (Y + + + + + + + + + 1 + + + + + + + + + + + + + + + + + + = 0) + + + + + + + + + + + Y + + + + + + + + + 2 + + + + + + + + + + + + + + + + + + + + (Y + + + + + + + + + 2 + + + + + + + + + + + + + + + + + + = 0) + + + + + + + + + + + + + + + + + + + + + Y + + + + + + + + + 1 + + + + + + + + + + II + + + + + + + + + + + + + + + + + + JJ + + + + + + + + + + + + + + + + + + + + + + + + + + + + e = 2 + + + + + + + + + + + + + + + + + + + + + + + Reinforcing + + + + + + + + + + + + + + + + + + + + diff --git a/doc/source/images/_commands/gSECD22.svg b/doc/source/images/_commands/gSECD22.svg new file mode 100644 index 00000000000..6aa9b33a781 --- /dev/null +++ b/doc/source/images/_commands/gSECD22.svg @@ -0,0 +1,561 @@ + + + + + + + + + + + + + + + + + + + + + I + + + + + + + + + J + + + + + + + + + K + + + + + + + + + L + + + + + + + + + + + + + M + + + + + + + + + + + + + P + + + + + + + + + O + + + + + + + + + N + + + + + + + + + II + + + + + + + + + e = 1 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Y + + + + + + + + + 1 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Z + + + + + + + + + 1 + + + + + + + + + + + (Z + + + + + + + + + 1 + + + + + + + + + + + + + + + + + + = 1) + + + + + + + + + + + (Y + + + + + + + + + 1 + + + + + + + + + + + + + + + + + + = 0) + + + + + + + + + (Z + + + + + + + + + 1 + + + + + + + + + + + + + + + + + + = 0) + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Y + + + + + + + + + 2 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Z + + + + + + + + + 2 + + + + + + + + + + JJ + + + + + + + + + + (Y + + + + + + + + + 2 + + + + + + + + + + + + + + + + + + = 0) + + + + + + + + + (Z + + + + + + + + + 2 + + + + + + + + + + + + + + + + + + = 0) + + + + + + + + + + + (Y + + + + + + + + + 2 + + + + + + + + + + + + + + + + + + = 1) + + + + + + + + + + + (Z + + + + + + + + + 2 + + + + + + + + + + + + + + + + + + = 1) + + + + + + + + + + + + + + diff --git a/doc/source/images/_commands/gSECD22b.svg b/doc/source/images/_commands/gSECD22b.svg new file mode 100644 index 00000000000..94fde4345c1 --- /dev/null +++ b/doc/source/images/_commands/gSECD22b.svg @@ -0,0 +1,537 @@ + + + + + + + + + e = 2 + + + + + + + + + + + + + + + + + + I + + + + + + + + + J + + + + + + + + + K + + + + + + + + + L + + + + + + + + + + + + + M + + + + + + + + + + + + + P + + + + + + + + + O + + + + + + + + + N + + + + + + + + + + II + + + + + + + + + + + + + + + + + Y + + + + + + + + + 1 + + + + + + + + + + + + + + + Z + + + + + + + + + 1 + + + + + + + + + (Z + + + + + + + + + 1 + + + + + + + + + + + + + + + + + + = 1) + + + + + + + + + (Y + + + + + + + + + 1 + + + + + + + + + + + + + + + + + + = 0) + + + + + + + + + (Z + + + + + + + + + 1 + + + + + + + + + + + + + + + + + + = 0) + + + + + + + + + + + + + + + Y + + + + + + + + + 2 + + + + + + + + + + + + + + + Z + + + + + + + + + 2 + + + + + + + + + + JJ + + + + + + + + + (Y + + + + + + + + + 2 + + + + + + + + + + + + + + + + + + = 0) + + + + + + + + + (Z + + + + + + + + + 2 + + + + + + + + + + + + + + + + + + = 0) + + + + + + + + + (Y + + + + + + + + + 2 + + + + + + + + + + + + + + + + + + = 1) + + + + + + + + + (Z + + + + + + + + + 2 + + + + + + + + + + + + + + + + + + = 1) + + + + + + + + + (Y + + + + + + + + + 1 + + + + + + + + + + + + + + + + + + = 1) + + + + + + + + + Reinforcing + + + + + + + + + diff --git a/doc/source/images/_commands/gSECD22c.svg b/doc/source/images/_commands/gSECD22c.svg new file mode 100644 index 00000000000..397ca1b41bc --- /dev/null +++ b/doc/source/images/_commands/gSECD22c.svg @@ -0,0 +1,553 @@ + + + + + + + + + + + + + e = 3 + + + + + + + + + + + + + + + + + + I + + + + + + + + + J + + + + + + + + + K + + + + + + + + + L + + + + + + + + + + + + + M + + + + + + + + + + + + + P + + + + + + + + + O + + + + + + + + + N + + + + + + + + + + II + + + + + + + + + + + Y + + + + + + + + + 1 + + + + + + + + + ( + + + + + + + + + Z + + + + + + + + + 1 + + + + + + + + + + + + + + + + + + = 1) + + + + + + + + + (Y + + + + + + + + + 1 + + + + + + + + + + + + + + + + + + = 0) + + + + + + + + + (Z + + + + + + + + + 1 + + + + + + + + + + + + + + + + + + = 0) + + + + + + + + + + JJ + + + + + + + + + (Y + + + + + + + + + 2 + + + + + + + + + = 0 + + + + + + + + + ) + + + + + + + + + (Z + + + + + + + + + 2 + + + + + + + + + + + + + + + + + + = 0) + + + + + + + + + (Y + + + + + + + + + 2 + + + + + + + + + + + + + + + + + + = 1) + + + + + + + + + (Z + + + + + + + + + 2 + + + + + + + + + + + + + + + + + + = 1) + + + + + + + + + ( + + + + + + + + + Y + + + + + + + + + 1 + + + + + + + + + + + + + + + + + + = 1) + + + + + + + + + + + + + + + + + + + + + + + + + + Y + + + + + + + + + 2 + + + + + + + + + + + + + + + + + + Z + + + + + + + + + 2 + + + + + + + + + Z + + + + + + + + + 1 + + + + + + + + + + diff --git a/doc/source/images/_commands/gSECD25.svg b/doc/source/images/_commands/gSECD25.svg new file mode 100644 index 00000000000..54fa3d40845 --- /dev/null +++ b/doc/source/images/_commands/gSECD25.svg @@ -0,0 +1,474 @@ + + + + + + + + + + L + + + + + + + + + K + + + + + + + + + J + + + + + + + + + I + + + + + + + + + + + + + + + + + + + (Z + + + + + + + + + 1 + + + + + + + + + = 1) + + + + + + + + + (Z + + + + + + + + + 2 + + + + + + + + + = 1) + + + + + + + + + + + (Y + + + + + + + + + 1 + + + + + + + + + = 1) + + + + + + + + + (Y + + + + + + + + + 2 + + + + + + + + + = 1) + + + + + + + + + + + (Y + + + + + + + + + 2 + + + + + + + + + = 0) + + + + + + + + + (Z + + + + + + + + + 2 + + + + + + + + + = 0) + + + + + + + + + + + (Y + + + + + + + + + 1 + + + + + + + + + = 0) + + + + + + + + + (Z + + + + + + + + + 1 + + + + + + + + + = 0) + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Y + + + + + + + + + 1 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Z + + + + + + + + + 1 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Y + + + + + + + + + 2 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Z + + + + + + + + + 2 + + + + + + + + + + + + + + II + + + + + + + + + JJ + + + + + + + + + + + + + + + + + + e = 1 + + + + + diff --git a/doc/source/images/_commands/gSECD26.svg b/doc/source/images/_commands/gSECD26.svg new file mode 100644 index 00000000000..bb5f3f574a0 --- /dev/null +++ b/doc/source/images/_commands/gSECD26.svg @@ -0,0 +1,445 @@ + + + + + + + + + + L + + + + + + + + + K + + + + + + + + + J + + + + + + + + + I + + + + + + + + + + + + + + + + + (Z + + + + + + + + + 1 + + + + + + + + + = 1) + + + + + + + + + (Z + + + + + + + + + 2 + + + + + + + + + = 1) + + + + + + + + + + + (Y + + + + + + + + + 2 + + + + + + + + + = 1) + + + + + + + + + + + (Y + + + + + + + + + 1 + + + + + + + + + = 1) + + + + + + + + + (Y + + + + + + + + + 2 + + + + + + + + + = 0) + + + + + + + + + (Z + + + + + + + + + 2 + + + + + + + + + = 0) + + + + + + + + + + + (Y + + + + + + + + + 1 + + + + + + + + + = 0) + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Z + + + + + + + + + 1 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Y + + + + + + + + + 2 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Z + + + + + + + + + 2 + + + + + + + + + + + + + + II + + + + + + + + + JJ + + + + + + + + + + + + + + + + + + + + + + + + + + + + Y + + + + + + + + + 1 + + + + + + + + + + + + + + + + + + + e = 2 + + + + + diff --git a/doc/source/images/_commands/gSECD27.svg b/doc/source/images/_commands/gSECD27.svg new file mode 100644 index 00000000000..b73f4ffa1a9 --- /dev/null +++ b/doc/source/images/_commands/gSECD27.svg @@ -0,0 +1,445 @@ + + + + + + + + + L + + + + + + + + + K + + + + + + + + + J + + + + + + + + + I + + + + + + + + + + + + + + + + + (Z + + + + + + + + + 2 + + + + + + + + + = 1) + + + + + + + + + + + (Y + + + + + + + + + 2 + + + + + + + + + = 1) + + + + + + + + + + + (Y + + + + + + + + + 1 + + + + + + + + + = 1) + + + + + + + + + (Y + + + + + + + + + 2 + + + + + + + + + = 0) + + + + + + + + + (Z + + + + + + + + + 2 + + + + + + + + + = 0) + + + + + + + + + + + (Y + + + + + + + + + 1 + + + + + + + + + = 0) + + + + + + + + + (Z + + + + + + + + + 1 + + + + + + + + + = 0) + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Y + + + + + + + + + 2 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Z + + + + + + + + + 2 + + + + + + + + + + + + + + II + + + + + + + + + JJ + + + + + + + + + + Y + + + + + + + + + 1 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Z + + + + + + + + + 1 + + + + + + + + + + + + + + + + + + + e = 3 + + + + + diff --git a/doc/source/images/_commands/gSECD28.svg b/doc/source/images/_commands/gSECD28.svg new file mode 100644 index 00000000000..6c6721e9acf --- /dev/null +++ b/doc/source/images/_commands/gSECD28.svg @@ -0,0 +1,526 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + I + + + + + + + + + J + + + + + + + + + K + + + + + + + + + L + + + + + + + + + + + + + + (Y + + + + + + + + + 1 + + + + + + + + + + + + + + + + + + = 1) + + + + + + + + + + + (Y + + + + + + + + + 2 + + + + + + + + + + + + + + + + + + = 1) + + + + + + + + + + + (Y + + + + + + + + + 1 + + + + + + + + + + + + + + + + + + = 0) + + + + + + + + + + + Y + + + + + + + + + 2 + + + + + + + + + + + + + + + + + + + + + (Y + + + + + + + + + 2 + + + + + + + + + + + + + + + + + + = 0) + + + + + + + + + + + + + + + + + + + + + Y + + + + + + + + + 1 + + + + + + + + + + II + + + + + + + + + JJ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Reinforcing + + + + + + + + + + + + + + + + + + + + + + (Z + + + + + + + + + 1 + + + + + + + + + + + + + + + + + + = 0) + + + + + + + + + + + (Z + + + + + + + + + 1 + + + + + + + + + + + + + + + + + + = 1) + + + + + + + + + + + + + + + + + + + + + Z + + + + + + + + + 1 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Z + + + + + + + + + 2 + + + + + + + + + = Z + + + + + + + + + 1 + + + + + + + + + + e = 1 + + + + + diff --git a/doc/source/images/_commands/gSECD29.svg b/doc/source/images/_commands/gSECD29.svg new file mode 100644 index 00000000000..81b3829dc4c --- /dev/null +++ b/doc/source/images/_commands/gSECD29.svg @@ -0,0 +1,479 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + I + + + + + + + + + J + + + + + + + + + K + + + + + + + + + L + + + + + + + + + + + + + + (Y + + + + + + + + + 1 + + + + + + + + + + + + + + + + + + = 1) + + + + + + + + + + + (Y + + + + + + + + + 2 + + + + + + + + + + + + + + + + + + = 1) + + + + + + + + + + + (Y + + + + + + + + + 1 + + + + + + + + + + + + + + + + + + = 0) + + + + + + + + + + + Y + + + + + + + + + 2 + + + + + + + + + + + + + + + + + + + + (Y + + + + + + + + + 2 + + + + + + + + + + + + + + + + + + = 0) + + + + + + + + + + + + + + + + + + + + Y + + + + + + + + + 1 + + + + + + + + + + II + + + + + + + + + + + JJ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Reinforcing + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Z + + + + + + + + + 1 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Z + + + + + + + + + 2 + + + + + + + + + = Z + + + + + + + + + 1 + + + + + + + + + + + + Z + + + + + + + + + 1 + + + + + + + + + = 0 + + + + + + + + + + e = 2 + + + + + diff --git a/doc/source/images/_commands/gSECD3.svg b/doc/source/images/_commands/gSECD3.svg new file mode 100644 index 00000000000..1ebd37848c7 --- /dev/null +++ b/doc/source/images/_commands/gSECD3.svg @@ -0,0 +1,70 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + R + + + + + + + + + y + + + + + + + + + z + + + + + + + + + + + + + + + + + + + + + diff --git a/doc/source/images/_commands/gSECD30.svg b/doc/source/images/_commands/gSECD30.svg new file mode 100644 index 00000000000..ac3c780c5fd --- /dev/null +++ b/doc/source/images/_commands/gSECD30.svg @@ -0,0 +1,66 @@ + + + + + + + + + + + + + + + + + + + + + e = 1 + + + + + + + + + II + + + + + + + + + JJ + + + + + + + + + I + + + + + + + + + J + + + + + diff --git a/doc/source/images/_commands/gSECD31.svg b/doc/source/images/_commands/gSECD31.svg new file mode 100644 index 00000000000..f0d1d83342b --- /dev/null +++ b/doc/source/images/_commands/gSECD31.svg @@ -0,0 +1,283 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + II + + + + + + + + + JJ + + + + + + + + + + + + I + + + + + + + + + J + + + + + + + + + + + + + + + + + + + + y + + + + + + + + + z + + + + + + + + + y + + + + + + + + + z + + + + + + + + + + (y + + + + + + + + + 2 + + + + + + + + + , z + + + + + + + + + 2 + + + + + + + + + ) + + + + + + + + + + + (y + + + + + + + + + 1 + + + + + + + + + , z + + + + + + + + + 1 + + + + + + + + + ) + + + + + + + + + + Base beam + + + + + + + + + Beam section #2 + + + + + + + + + Beam section #1 + + + + + + + + + Reinforcing + + + + + diff --git a/doc/source/images/_commands/gSECD32.svg b/doc/source/images/_commands/gSECD32.svg new file mode 100644 index 00000000000..ccbc9d347ea --- /dev/null +++ b/doc/source/images/_commands/gSECD32.svg @@ -0,0 +1,55 @@ + + + + + + + + + + + + + + + + + + + + +JJ +II +J +I + + + + + + + + + + +Reinforcement + + + + + + + + +Base Layer + + + + + + + diff --git a/doc/source/images/_commands/gSECD33.svg b/doc/source/images/_commands/gSECD33.svg new file mode 100644 index 00000000000..ceb5df415e5 --- /dev/null +++ b/doc/source/images/_commands/gSECD33.svg @@ -0,0 +1,66 @@ + + + + + + + + + + + + (Y = 0) +1 + + + + + + + + + + + + + + + + +Y +2 +JJ + + + + + + + + + + + + + + + + +Y +1 +II + (Y = 0) +2 +II +J +I +=Y +1 + + + diff --git a/doc/source/images/_commands/gSECD34.svg b/doc/source/images/_commands/gSECD34.svg new file mode 100644 index 00000000000..f669f885785 --- /dev/null +++ b/doc/source/images/_commands/gSECD34.svg @@ -0,0 +1,124 @@ + + + + + + + + + + + + + + + + + + + + + + + + +Y +1 + + + + + + + + + + + + + + +Y +2 +J(Y = 0) +JJ +II + + +2 +I(Y = 0) +1 +K(Y = 1) +2 +L(Y = 0) +1 +e=1 +Y +1 +Y +2 +J(Y = 1) +JJ +II + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +1 +I(Y = 0) +1 +K(Y = 1) +2 +L(Y = 0) +2 +e=2 + + + + + + + + + + + diff --git a/doc/source/images/_commands/gSECD35.svg b/doc/source/images/_commands/gSECD35.svg new file mode 100644 index 00000000000..2f62b856f6b --- /dev/null +++ b/doc/source/images/_commands/gSECD35.svg @@ -0,0 +1,171 @@ + + + + + + + + + + + + + + + + +K(Y = 1 + +1 + Y = 1) +2 + + + + + + + + + + + + + +Y +2 + + + + + + + + + + + + + + + + +Y +1 +JJ +J(Y = 0) +2 +I(Y = 0) +1 +e=1 +Y +1 + + + + + + + + + + + + + +I(Y = 0) +1 + + + + + + + + + + + + + +Y +2 +II +JJ +II +e=2 +K(Y = 0) +2 +J(Y = 1 + +1 + Y = 1) +2 + + + + + + + + + + + + + +Y +2 +Y +1 + + + + + + + + + + + + + +J(Y = 0) +1 +I(Y = 1 + +1 + Y = 1) +2 +JJ +II +K(Y = 0) +2 +e=3 + + + + + + + + + + + + diff --git a/doc/source/images/_commands/gSECD4.svg b/doc/source/images/_commands/gSECD4.svg new file mode 100644 index 00000000000..dd898095e80 --- /dev/null +++ b/doc/source/images/_commands/gSECD4.svg @@ -0,0 +1,92 @@ + + + + + + + + + + + Ri + + + + + + + + + y + + + + + + + + + z + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Ro + + + + + + + + + + + + + diff --git a/doc/source/images/_commands/gSECD5.svg b/doc/source/images/_commands/gSECD5.svg new file mode 100644 index 00000000000..85e346f6ed4 --- /dev/null +++ b/doc/source/images/_commands/gSECD5.svg @@ -0,0 +1,146 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + W1 + + + + + + + + + + + + + + + + + + + + W2 + + + + + + + + + + + + + + + + + + + + W3 + + + + + + + + + t1 + + + + + + + + + t2 + + + + + + + + + t3 + + + + + + + + + + z + + + + + + + + + y + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/doc/source/images/_commands/gSECD6.svg b/doc/source/images/_commands/gSECD6.svg new file mode 100644 index 00000000000..243d14d2ed2 --- /dev/null +++ b/doc/source/images/_commands/gSECD6.svg @@ -0,0 +1,176 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + W1 + + + + + + + + + W2 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + t1 + + + + + + + + + t2 + + + + + + + + + t3 + + + + + + + + + + + + + + + + + + + + + + z + + + + + + + + + y + + + + + + + + + + + + + + + + + + + + + + + W3 + + + + + diff --git a/doc/source/images/_commands/gSECD7.svg b/doc/source/images/_commands/gSECD7.svg new file mode 100644 index 00000000000..0b43e0350ad --- /dev/null +++ b/doc/source/images/_commands/gSECD7.svg @@ -0,0 +1,156 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + W + + + + + + + + + 1 + + + + + + + + + + W2 + + + + + + + + + W3 + + + + + + + + + t1 + + + + + + + + + t2 + + + + + + + + + t3 + + + + + + + + + + + + + + + z + + + + + + + + + y + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/doc/source/images/_commands/gSECD8.svg b/doc/source/images/_commands/gSECD8.svg new file mode 100644 index 00000000000..f8382fdfa08 --- /dev/null +++ b/doc/source/images/_commands/gSECD8.svg @@ -0,0 +1,106 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + W1 + + + + + + + + + W2 + + + + + + + + + t1 + + + + + + + + + t2 + + + + + + + + + + + + z + + + + + + + + + y + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/doc/source/images/_commands/gSECD9.svg b/doc/source/images/_commands/gSECD9.svg new file mode 100644 index 00000000000..68b8c21bd1f --- /dev/null +++ b/doc/source/images/_commands/gSECD9.svg @@ -0,0 +1,115 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + W1 + + + + + + + + + W2 + + + + + + + + + t1 + + + + + + + + + + + + t2 + + + + + + + + + + + + + + + + + + + + + + + + + + + y + + + + + + + + + z + + + + + + diff --git a/doc/source/images/_commands/gSECD_pipe.svg b/doc/source/images/_commands/gSECD_pipe.svg new file mode 100644 index 00000000000..b4bcdb03f47 --- /dev/null +++ b/doc/source/images/_commands/gSECD_pipe.svg @@ -0,0 +1,896 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/doc/source/images/_commands/gSECO1.svg b/doc/source/images/_commands/gSECO1.svg new file mode 100644 index 00000000000..e66f86eecf8 --- /dev/null +++ b/doc/source/images/_commands/gSECO1.svg @@ -0,0 +1,263 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/doc/source/images/_commands/gSECP.fig.3.jpg b/doc/source/images/_commands/gSECP.fig.3.jpg new file mode 100644 index 00000000000..e3597fb7f20 Binary files /dev/null and b/doc/source/images/_commands/gSECP.fig.3.jpg differ diff --git a/doc/source/images/_commands/gSECP1.jpg b/doc/source/images/_commands/gSECP1.jpg new file mode 100644 index 00000000000..595eb5b2331 Binary files /dev/null and b/doc/source/images/_commands/gSECP1.jpg differ diff --git a/doc/source/images/_commands/gSECR2.svg b/doc/source/images/_commands/gSECR2.svg new file mode 100644 index 00000000000..94df2ab5059 --- /dev/null +++ b/doc/source/images/_commands/gSECR2.svg @@ -0,0 +1,155 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 0.05" + + + + + + + + + 0.03" + + + + + + + + + 0.03" + + + + + + + + + 0.04" + + + + + + + + + 10" + + + + + + + + + 10" + + + + + + + + + + + + + + + + + + + + + 0.03" + + + + + + + + + + + + + + + + diff --git a/doc/source/images/_commands/gSECR3.svg b/doc/source/images/_commands/gSECR3.svg new file mode 100644 index 00000000000..4f26978b37f --- /dev/null +++ b/doc/source/images/_commands/gSECR3.svg @@ -0,0 +1,680 @@ + + + + + + + + + + + + + + + + 65 + + + + + + + + + 66 + + + + + + + + + 67 + + + + + + + + + 54 + + + + + + + + + 43 + + + + + + + + + 68 + + + + + + + + + 71 + + + + + + + + + 69 + + + + + + + + + 70 + + + + + + + + + 72 + + + + + + + + + 73 + + + + + + + + + 74 + + + + + + + + + 75 + + + + + + + + + 64 + + + + + + + + + 53 + + + + + + + + + 23 + + + + + + + + + 12 + + + + + + + + + 1 + + + + + + + + + 3 + + + + + + + + + 2 + + + + + + + + + 4 + + + + + + + + + 5 + + + + + + + + + 6 + + + + + + + + + 7 + + + + + + + + + 8 + + + + + + + + + 9 + + + + + + + + + 10 + + + + + + + + + 11 + + + + + + + + + 22 + + + + + + + + + 33 + + + + + + + + + 34 + + + + + + + + + 42 + + + + + + + + + + A + + + + + + + + + n + + + + + + + + + i + + + + + + + + + n + + + + + + + + + e + + + + + + + + + + + + + + + + + + n + + + + + + + + + o + + + + + + + + + d + + + + + + + + + e + + + + + + + + + + + + + + + + + + ce + + + + + + + + + l + + + + + + + + + l + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/doc/source/images/_commands/gSECT1.svg b/doc/source/images/_commands/gSECT1.svg new file mode 100644 index 00000000000..2fe24b0e089 --- /dev/null +++ b/doc/source/images/_commands/gSECT1.svg @@ -0,0 +1,149 @@ + + + + + + + + + + + + + + + + + + + + + RECT + + + + + + + + + QUAD + + + + + + + + + CSOLID + + + + + + + + + CTUBE + + + + + + + + + CHAN + + + + + + + + + I + + + + + + + + + Z + + + + + + + + + L + + + + + + + + + + + + + + + + + + T + + + + + + + + + HATS + + + + + + + + + HREC + + + + + + + + + + ASEC + + + + + + diff --git a/doc/source/images/_commands/gSFCONTROL1.png b/doc/source/images/_commands/gSFCONTROL1.png new file mode 100644 index 00000000000..4c0bf0c05ef Binary files /dev/null and b/doc/source/images/_commands/gSFCONTROL1.png differ diff --git a/doc/source/images/_commands/gSFCONTROL10.png b/doc/source/images/_commands/gSFCONTROL10.png new file mode 100644 index 00000000000..10c63696a3c Binary files /dev/null and b/doc/source/images/_commands/gSFCONTROL10.png differ diff --git a/doc/source/images/_commands/gSFCONTROL11.png b/doc/source/images/_commands/gSFCONTROL11.png new file mode 100644 index 00000000000..73c558780b6 Binary files /dev/null and b/doc/source/images/_commands/gSFCONTROL11.png differ diff --git a/doc/source/images/_commands/gSFCONTROL12.png b/doc/source/images/_commands/gSFCONTROL12.png new file mode 100644 index 00000000000..641e251459a Binary files /dev/null and b/doc/source/images/_commands/gSFCONTROL12.png differ diff --git a/doc/source/images/_commands/gSFCONTROL13.png b/doc/source/images/_commands/gSFCONTROL13.png new file mode 100644 index 00000000000..32c87fcf1ae Binary files /dev/null and b/doc/source/images/_commands/gSFCONTROL13.png differ diff --git a/doc/source/images/_commands/gSFCONTROL14.png b/doc/source/images/_commands/gSFCONTROL14.png new file mode 100644 index 00000000000..e96d786c614 Binary files /dev/null and b/doc/source/images/_commands/gSFCONTROL14.png differ diff --git a/doc/source/images/_commands/gSFCONTROL15.png b/doc/source/images/_commands/gSFCONTROL15.png new file mode 100644 index 00000000000..3b5ae044910 Binary files /dev/null and b/doc/source/images/_commands/gSFCONTROL15.png differ diff --git a/doc/source/images/_commands/gSFCONTROL16.png b/doc/source/images/_commands/gSFCONTROL16.png new file mode 100644 index 00000000000..89f496939b9 Binary files /dev/null and b/doc/source/images/_commands/gSFCONTROL16.png differ diff --git a/doc/source/images/_commands/gSFCONTROL2.png b/doc/source/images/_commands/gSFCONTROL2.png new file mode 100644 index 00000000000..3c2dc0223f3 Binary files /dev/null and b/doc/source/images/_commands/gSFCONTROL2.png differ diff --git a/doc/source/images/_commands/gSFCONTROL3.png b/doc/source/images/_commands/gSFCONTROL3.png new file mode 100644 index 00000000000..24e4dfd977a Binary files /dev/null and b/doc/source/images/_commands/gSFCONTROL3.png differ diff --git a/doc/source/images/_commands/gSFCONTROL4.png b/doc/source/images/_commands/gSFCONTROL4.png new file mode 100644 index 00000000000..1391f4e319a Binary files /dev/null and b/doc/source/images/_commands/gSFCONTROL4.png differ diff --git a/doc/source/images/_commands/gSFCONTROL5.png b/doc/source/images/_commands/gSFCONTROL5.png new file mode 100644 index 00000000000..ee526f2e9f5 Binary files /dev/null and b/doc/source/images/_commands/gSFCONTROL5.png differ diff --git a/doc/source/images/_commands/gSFCONTROL6.png b/doc/source/images/_commands/gSFCONTROL6.png new file mode 100644 index 00000000000..7d04cdf3b65 Binary files /dev/null and b/doc/source/images/_commands/gSFCONTROL6.png differ diff --git a/doc/source/images/_commands/gSFCONTROL7.png b/doc/source/images/_commands/gSFCONTROL7.png new file mode 100644 index 00000000000..6d9d5895c03 Binary files /dev/null and b/doc/source/images/_commands/gSFCONTROL7.png differ diff --git a/doc/source/images/_commands/gSFCONTROL8.png b/doc/source/images/_commands/gSFCONTROL8.png new file mode 100644 index 00000000000..886ebd4f269 Binary files /dev/null and b/doc/source/images/_commands/gSFCONTROL8.png differ diff --git a/doc/source/images/_commands/gSFCONTROL9.png b/doc/source/images/_commands/gSFCONTROL9.png new file mode 100644 index 00000000000..be56fee7a28 Binary files /dev/null and b/doc/source/images/_commands/gSFCONTROL9.png differ diff --git a/doc/source/images/_commands/gSHSDcontact.eps b/doc/source/images/_commands/gSHSDcontact.eps new file mode 100644 index 00000000000..272c5c98362 Binary files /dev/null and b/doc/source/images/_commands/gSHSDcontact.eps differ diff --git a/doc/source/images/_commands/gSHSDoverlap.eps b/doc/source/images/_commands/gSHSDoverlap.eps new file mode 100644 index 00000000000..41bde6ecd90 Binary files /dev/null and b/doc/source/images/_commands/gSHSDoverlap.eps differ diff --git a/doc/source/images/_commands/gTORU1.svg b/doc/source/images/_commands/gTORU1.svg new file mode 100644 index 00000000000..c662e299a93 --- /dev/null +++ b/doc/source/images/_commands/gTORU1.svg @@ -0,0 +1,5628 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Inner + + + + + + + + + minor + + + + + + + + + radius + + + + + + + + + + + Outer + + + + + + + + + minor + + + + + + + + + radius + + + + + + + + + + + Major + + + + + + + + + radius + + + + + + diff --git a/doc/source/images/_commands/gcmd2ddispltopnodes.png b/doc/source/images/_commands/gcmd2ddispltopnodes.png new file mode 100644 index 00000000000..6e2405d56fd Binary files /dev/null and b/doc/source/images/_commands/gcmd2ddispltopnodes.png differ diff --git a/doc/source/images/_commands/gcmd_mlist_example.PNG b/doc/source/images/_commands/gcmd_mlist_example.PNG new file mode 100644 index 00000000000..ec3b328ca19 Binary files /dev/null and b/doc/source/images/_commands/gcmd_mlist_example.PNG differ diff --git a/doc/source/images/_commands/gcmd_oczone_comp.png b/doc/source/images/_commands/gcmd_oczone_comp.png new file mode 100644 index 00000000000..7b36c96a7d0 Binary files /dev/null and b/doc/source/images/_commands/gcmd_oczone_comp.png differ diff --git a/doc/source/images/_commands/gcmd_oczone_compz.png b/doc/source/images/_commands/gcmd_oczone_compz.png new file mode 100644 index 00000000000..1c19845a261 Binary files /dev/null and b/doc/source/images/_commands/gcmd_oczone_compz.png differ diff --git a/doc/source/images/_commands/gcmd_oczone_pip.png b/doc/source/images/_commands/gcmd_oczone_pip.png new file mode 100644 index 00000000000..29f833e4823 Binary files /dev/null and b/doc/source/images/_commands/gcmd_oczone_pip.png differ diff --git a/doc/source/images/_commands/gcmd_oczone_zloc.png b/doc/source/images/_commands/gcmd_oczone_zloc.png new file mode 100644 index 00000000000..dd8fcac8913 Binary files /dev/null and b/doc/source/images/_commands/gcmd_oczone_zloc.png differ diff --git a/doc/source/images/_commands/gcmdexxt1.jpg b/doc/source/images/_commands/gcmdexxt1.jpg new file mode 100644 index 00000000000..1e639b78799 Binary files /dev/null and b/doc/source/images/_commands/gcmdexxt1.jpg differ diff --git a/doc/source/images/_commands/gcmdrsymm1.png b/doc/source/images/_commands/gcmdrsymm1.png new file mode 100644 index 00000000000..5b9d56fa3c6 Binary files /dev/null and b/doc/source/images/_commands/gcmdrsymm1.png differ diff --git a/doc/source/images/_commands/gcmdrsymm2.png b/doc/source/images/_commands/gcmdrsymm2.png new file mode 100644 index 00000000000..de3fac5c723 Binary files /dev/null and b/doc/source/images/_commands/gcmdrsymm2.png differ diff --git a/doc/source/images/_commands/gcmdrsymm3.png b/doc/source/images/_commands/gcmdrsymm3.png new file mode 100644 index 00000000000..72f297f3c6e Binary files /dev/null and b/doc/source/images/_commands/gcmdrsymm3.png differ diff --git a/doc/source/images/_commands/gcmdrsymm4.png b/doc/source/images/_commands/gcmdrsymm4.png new file mode 100644 index 00000000000..778f88c3dde Binary files /dev/null and b/doc/source/images/_commands/gcmdrsymm4.png differ diff --git a/doc/source/images/_commands/gcmdrsymm5.png b/doc/source/images/_commands/gcmdrsymm5.png new file mode 100644 index 00000000000..b9d93c3d79c Binary files /dev/null and b/doc/source/images/_commands/gcmdrsymm5.png differ diff --git a/doc/source/images/_commands/gcmdrsymm_VFextrusion.png b/doc/source/images/_commands/gcmdrsymm_VFextrusion.png new file mode 100644 index 00000000000..8e53442b4b5 Binary files /dev/null and b/doc/source/images/_commands/gcmdrsymm_VFextrusion.png differ diff --git a/doc/source/images/_commands/gcmdrsymm_cyclic_reflection.png b/doc/source/images/_commands/gcmdrsymm_cyclic_reflection.png new file mode 100644 index 00000000000..eca2d6c3f05 Binary files /dev/null and b/doc/source/images/_commands/gcmdrsymm_cyclic_reflection.png differ diff --git a/doc/source/images/_commands/gcmdrsymm_planar_reflection.png b/doc/source/images/_commands/gcmdrsymm_planar_reflection.png new file mode 100644 index 00000000000..d8cd1230eec Binary files /dev/null and b/doc/source/images/_commands/gcmdrsymm_planar_reflection.png differ diff --git a/doc/source/images/_commands/ghflumpcircuitload2.GIF b/doc/source/images/_commands/ghflumpcircuitload2.GIF new file mode 100644 index 00000000000..e090897ed9e Binary files /dev/null and b/doc/source/images/_commands/ghflumpcircuitload2.GIF differ diff --git a/doc/source/images/_commands/gpdcfld1.svg b/doc/source/images/_commands/gpdcfld1.svg new file mode 100644 index 00000000000..d1e42ca7c62 --- /dev/null +++ b/doc/source/images/_commands/gpdcfld1.svg @@ -0,0 +1,24 @@ + + + + + + + + + + + + + + + + + + diff --git a/doc/source/images/_commands/gpdcfld2.svg b/doc/source/images/_commands/gpdcfld2.svg new file mode 100644 index 00000000000..d59f351c43a --- /dev/null +++ b/doc/source/images/_commands/gpdcfld2.svg @@ -0,0 +1,706 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/doc/source/images/_commands/graphics - Shortcut.lnk b/doc/source/images/_commands/graphics - Shortcut.lnk new file mode 100644 index 00000000000..785a689c95c Binary files /dev/null and b/doc/source/images/_commands/graphics - Shortcut.lnk differ diff --git a/doc/source/images/_commands/gsecplotshell.jpg b/doc/source/images/_commands/gsecplotshell.jpg new file mode 100644 index 00000000000..93503833fec Binary files /dev/null and b/doc/source/images/_commands/gsecplotshell.jpg differ diff --git a/doc/source/images/_commands/gsupportblock.png b/doc/source/images/_commands/gsupportblock.png new file mode 100644 index 00000000000..9a19d74cf52 Binary files /dev/null and b/doc/source/images/_commands/gsupportblock.png differ diff --git a/doc/source/mapdl_commands/apdl/abbreviations.rst b/doc/source/mapdl_commands/apdl/abbreviations.rst index dd1daba0cdc..8f104076c70 100644 --- a/doc/source/mapdl_commands/apdl/abbreviations.rst +++ b/doc/source/mapdl_commands/apdl/abbreviations.rst @@ -1,22 +1,21 @@ -.. _ref_abbreviations_commands_api: -************* -Abbreviations -************* +.. _ref_abbreviations: + -.. currentmodule:: ansys.mapdl.core +Abbreviations +============= -These APDL commands can be used to define abbreviations for longer commands, and to create user-defined commands. -.. note:: - It is probably easier to use Python strings instead of MAPDL - strings. +.. currentmodule:: ansys.mapdl.core._commands.apdl.abbreviations +.. autoclass:: ansys.mapdl.core._commands.apdl.abbreviations.Abbreviations .. autosummary:: - :toctree: _autosummary/ + :template: base.rst + :toctree: _autosummary + - Mapdl.abbr - Mapdl.abbres - Mapdl.abbsav - Mapdl.ucmd + Abbreviations.abbr + Abbreviations.abbres + Abbreviations.abbsav + Abbreviations.ucmd diff --git a/doc/source/mapdl_commands/apdl/array_parameters.rst b/doc/source/mapdl_commands/apdl/array_parameters.rst new file mode 100644 index 00000000000..d7cdcade7a7 --- /dev/null +++ b/doc/source/mapdl_commands/apdl/array_parameters.rst @@ -0,0 +1,37 @@ + +.. _ref_array_parameters: + + +ArrayParameters +=============== + + +.. currentmodule:: ansys.mapdl.core._commands.apdl.array_parameters + +.. autoclass:: ansys.mapdl.core._commands.apdl.array_parameters.ArrayParameters + +.. autosummary:: + :template: base.rst + :toctree: _autosummary + + + ArrayParameters.mfouri + ArrayParameters.mfun + ArrayParameters.moper + ArrayParameters.mwrite + ArrayParameters.sread + ArrayParameters.starvplot + ArrayParameters.starvput + ArrayParameters.toper + ArrayParameters.vabs + ArrayParameters.vcol + ArrayParameters.vcum + ArrayParameters.vfact + ArrayParameters.vfun + ArrayParameters.vitrp + ArrayParameters.vlen + ArrayParameters.vmask + ArrayParameters.voper + ArrayParameters.vscfun + ArrayParameters.vstat + ArrayParameters.vwrite diff --git a/doc/source/mapdl_commands/apdl/array_parm.rst b/doc/source/mapdl_commands/apdl/array_parm.rst deleted file mode 100644 index 2fb6e0a8bc4..00000000000 --- a/doc/source/mapdl_commands/apdl/array_parm.rst +++ /dev/null @@ -1,40 +0,0 @@ -.. _ref_array_parameters_commands_api: - -**************** -Array parameters -**************** - -.. currentmodule:: ansys.mapdl.core - -These APDL commands are used to operate on parameter arrays (vectors and matrices). - -.. note:: - Many of these commands are kept for legacy compatibility. - - To interact with arrays in a more Pythonic manner, see the parameters class :ref:`ref_parameters_api` . - - For working with arrays outside of MAPDL, consider using `NumPy `_. - - -.. autosummary:: - :toctree: _autosummary/ - - Mapdl.mfouri - Mapdl.mfun - Mapdl.moper - Mapdl.mwrite - Mapdl.sread - Mapdl.toper - Mapdl.vabs - Mapdl.vcol - Mapdl.vcum - Mapdl.vfact - Mapdl.vfun - Mapdl.vitrp - Mapdl.vlen - Mapdl.vmask - Mapdl.voper - Mapdl.starvput - Mapdl.vscfun - Mapdl.vstat - Mapdl.vwrite diff --git a/doc/source/mapdl_commands/apdl/encryption_decryption.rst b/doc/source/mapdl_commands/apdl/encryption_decryption.rst new file mode 100644 index 00000000000..0a97fd24da9 --- /dev/null +++ b/doc/source/mapdl_commands/apdl/encryption_decryption.rst @@ -0,0 +1,21 @@ + +.. _ref_encryption_decryption: + + +EncryptionDecryption +==================== + + +.. currentmodule:: ansys.mapdl.core._commands.apdl.encryption_decryption + +.. autoclass:: ansys.mapdl.core._commands.apdl.encryption_decryption.EncryptionDecryption + +.. autosummary:: + :template: base.rst + :toctree: _autosummary + + + EncryptionDecryption.dbdecrypt + EncryptionDecryption.dbencrypt + EncryptionDecryption.decrypt + EncryptionDecryption.encrypt diff --git a/doc/source/mapdl_commands/apdl/index.rst b/doc/source/mapdl_commands/apdl/index.rst new file mode 100644 index 00000000000..675a01e5981 --- /dev/null +++ b/doc/source/mapdl_commands/apdl/index.rst @@ -0,0 +1,30 @@ + +.. _ref_apdl: + + +Apdl +==== + + +.. list-table:: + + * - :ref:`ref_abbreviations` + * - :ref:`ref_parameter_definition` + * - :ref:`ref_matrix_operations` + * - :ref:`ref_macro_files` + * - :ref:`ref_encryption_decryption` + * - :ref:`ref_array_parameters` + * - :ref:`ref_process_controls` + + +.. toctree:: + :maxdepth: 1 + :hidden: + + abbreviations + parameter_definition + matrix_operations + macro_files + encryption_decryption + array_parameters + process_controls diff --git a/doc/source/mapdl_commands/apdl/macro_files.rst b/doc/source/mapdl_commands/apdl/macro_files.rst index 6e7610f8ba6..9de70cf512f 100644 --- a/doc/source/mapdl_commands/apdl/macro_files.rst +++ b/doc/source/mapdl_commands/apdl/macro_files.rst @@ -1,35 +1,30 @@ -.. _ref_macro_files_commands_api: -*********** -Macro files -*********** +.. _ref_macro_files: -.. currentmodule:: ansys.mapdl.core -These APDL commands are used to build and execute command macros. +MacroFiles +========== -.. note:: - Most of the commands here should be replaced with Python - alternatives. For example, instead of using macros, use Python - functions. Instead of ``/MKDIR`` use ``os.mkdir``. -.. warning:: - Many of the commands here must be run in ``mapdl.non_interactive`` +.. currentmodule:: ansys.mapdl.core._commands.apdl.macro_files + +.. autoclass:: ansys.mapdl.core._commands.apdl.macro_files.MacroFiles .. autosummary:: - :toctree: _autosummary/ - - Mapdl.cfclos - Mapdl.cfopen - Mapdl.cfwrite - Mapdl.create - Mapdl.dflab - Mapdl.end - Mapdl.mkdir - Mapdl.msg - Mapdl.pmacro - Mapdl.psearch - Mapdl.rmdir - Mapdl.tee - Mapdl.ulib - Mapdl.use + :template: base.rst + :toctree: _autosummary + + + MacroFiles.cfclos + MacroFiles.cfopen + MacroFiles.cfwrite + MacroFiles.create + MacroFiles.end + MacroFiles.mkdir + MacroFiles.msg + MacroFiles.pmacro + MacroFiles.psearch + MacroFiles.rmdir + MacroFiles.slashtee + MacroFiles.ulib + MacroFiles.use diff --git a/doc/source/mapdl_commands/apdl/matrix_op.rst b/doc/source/mapdl_commands/apdl/matrix_op.rst deleted file mode 100644 index 07e35e9d9a7..00000000000 --- a/doc/source/mapdl_commands/apdl/matrix_op.rst +++ /dev/null @@ -1,42 +0,0 @@ -.. _ref_matrix_operations_commands_api: - -***************** -Matrix operations -***************** - -.. currentmodule:: ansys.mapdl.core - -These APDL Math commands can be used to create, manipulate, and solve matrices. - -.. note:: - See the :ref:`mapdl_math_class_ref` for a more pythonic way of - interacting with APDLMath. - -.. autosummary:: - :toctree: _autosummary/ - - Mapdl.axpy - Mapdl.comp - Mapdl.dmat - Mapdl.dot - Mapdl.eigen - Mapdl.export - Mapdl.fft - Mapdl.free - Mapdl.init - Mapdl.itengine - Mapdl.lsbac - Mapdl.lsdump - Mapdl.lsengine - Mapdl.lsfactor - Mapdl.lsrestore - Mapdl.merge - Mapdl.mult - Mapdl.nrm - Mapdl.remove - Mapdl.scal - Mapdl.smat - Mapdl.starprint - Mapdl.sort - Mapdl.vec - Mapdl.wrk diff --git a/doc/source/mapdl_commands/apdl/matrix_operations.rst b/doc/source/mapdl_commands/apdl/matrix_operations.rst new file mode 100644 index 00000000000..e0dece49a4b --- /dev/null +++ b/doc/source/mapdl_commands/apdl/matrix_operations.rst @@ -0,0 +1,45 @@ + +.. _ref_matrix_operations: + + +MatrixOperations +================ + + +.. currentmodule:: ansys.mapdl.core._commands.apdl.matrix_operations + +.. autoclass:: ansys.mapdl.core._commands.apdl.matrix_operations.MatrixOperations + +.. autosummary:: + :template: base.rst + :toctree: _autosummary + + + MatrixOperations.axpy + MatrixOperations.comp + MatrixOperations.dmat + MatrixOperations.dot + MatrixOperations.eigen + MatrixOperations.export + MatrixOperations.fft + MatrixOperations.free + MatrixOperations.hprod + MatrixOperations.init + MatrixOperations.itengine + MatrixOperations.lsbac + MatrixOperations.lsdump + MatrixOperations.lsengine + MatrixOperations.lsfactor + MatrixOperations.lsrestore + MatrixOperations.merge + MatrixOperations.mult + MatrixOperations.nrm + MatrixOperations.remove + MatrixOperations.scal + MatrixOperations.smat + MatrixOperations.starinquire + MatrixOperations.starprint + MatrixOperations.starrename + MatrixOperations.starsort + MatrixOperations.vec + MatrixOperations.wrk diff --git a/doc/source/mapdl_commands/apdl/parameter_definition.rst b/doc/source/mapdl_commands/apdl/parameter_definition.rst index 8a3b7f91711..88affe9918a 100644 --- a/doc/source/mapdl_commands/apdl/parameter_definition.rst +++ b/doc/source/mapdl_commands/apdl/parameter_definition.rst @@ -1,24 +1,30 @@ -.. _ref_parameter_definition_commands_api: -******************** -Parameter definition -******************** +.. _ref_parameter_definition: -.. currentmodule:: ansys.mapdl.core -These APDL commands are used to define parameters and their values. +ParameterDefinition +=================== + + +.. currentmodule:: ansys.mapdl.core._commands.apdl.parameter_definition + +.. autoclass:: ansys.mapdl.core._commands.apdl.parameter_definition.ParameterDefinition .. autosummary:: - :toctree: _autosummary/ - - Mapdl.afun - Mapdl.dim - Mapdl.inquire - Mapdl.parres - Mapdl.parsav - Mapdl.starset - Mapdl.taxis - Mapdl.tread - Mapdl.vfill - Mapdl.starvget - Mapdl.vread + :template: base.rst + :toctree: _autosummary + + + ParameterDefinition.afun + ParameterDefinition.dim + ParameterDefinition.get + ParameterDefinition.inquire + ParameterDefinition.parres + ParameterDefinition.parsav + ParameterDefinition.starset + ParameterDefinition.starstatus + ParameterDefinition.starvget + ParameterDefinition.taxis + ParameterDefinition.tread + ParameterDefinition.vfill + ParameterDefinition.vread diff --git a/doc/source/mapdl_commands/apdl/process_controls.rst b/doc/source/mapdl_commands/apdl/process_controls.rst index 1bef3310216..cf10acac958 100644 --- a/doc/source/mapdl_commands/apdl/process_controls.rst +++ b/doc/source/mapdl_commands/apdl/process_controls.rst @@ -1,34 +1,19 @@ -.. _ref_process_controls_api: -**************** -Process controls -**************** +.. _ref_process_controls: -.. currentmodule:: ansys.mapdl.core -These APDL commands can be used to control the order in which other -commands are processed. +ProcessControls +=============== -.. note:: - The following commands are not directly mapped to PyMAPDL. Use - `non-interactive` if you must use these commands, but ideally they - should be replaced by Python statements. - * ``*CYCLE`` - * ``*DO`` - * ``*DOWHILE`` - * ``*ELSE`` - * ``*ELSEIF`` - * ``*ENDDO`` - * ``*ENDIF`` - * ``*EXIT`` - * ``*GO`` - * ``*IF`` - * ``*REPEAT`` - * ``*RETURN`` +.. currentmodule:: ansys.mapdl.core._commands.apdl.process_controls +.. autoclass:: ansys.mapdl.core._commands.apdl.process_controls.ProcessControls .. autosummary:: - :toctree: _autosummary/ + :template: base.rst + :toctree: _autosummary - Mapdl.wait + + ProcessControls.starexit + ProcessControls.wait diff --git a/doc/source/mapdl_commands/aux12/general_radiation.rst b/doc/source/mapdl_commands/aux12/general_radiation.rst index 9d52fd6e35c..71519a9dc36 100644 --- a/doc/source/mapdl_commands/aux12/general_radiation.rst +++ b/doc/source/mapdl_commands/aux12/general_radiation.rst @@ -1,15 +1,19 @@ -.. _ref_general Radiation_api: -***************** -General radiation -***************** +.. _ref_general_radiation: -.. currentmodule:: ansys.mapdl.core -These AUX12 commands are used to specify general radiation parameters. +GeneralRadiation +================ + + +.. currentmodule:: ansys.mapdl.core._commands.aux12.general_radiation + +.. autoclass:: ansys.mapdl.core._commands.aux12.general_radiation.GeneralRadiation .. autosummary:: - :toctree: _autosummary/ + :template: base.rst + :toctree: _autosummary + - Mapdl.stef - Mapdl.toffst + GeneralRadiation.aux12 + GeneralRadiation.stef diff --git a/doc/source/mapdl_commands/aux12/index.rst b/doc/source/mapdl_commands/aux12/index.rst new file mode 100644 index 00000000000..d13c4803fa2 --- /dev/null +++ b/doc/source/mapdl_commands/aux12/index.rst @@ -0,0 +1,20 @@ + +.. _ref_aux12: + +Aux12 +===== + +.. list-table:: + + * - :ref:`ref_general_radiation` + * - :ref:`ref_radiation_matrix_method` + * - :ref:`ref_radiosity_solver` + + +.. toctree:: + :maxdepth: 1 + :hidden: + + general_radiation + radiation_matrix_method + radiosity_solver diff --git a/doc/source/mapdl_commands/aux12/radiation_mat.rst b/doc/source/mapdl_commands/aux12/radiation_mat.rst deleted file mode 100644 index 588b013cff0..00000000000 --- a/doc/source/mapdl_commands/aux12/radiation_mat.rst +++ /dev/null @@ -1,20 +0,0 @@ -.. _ref_radiation Matrix Method_api: - -*********************** -Radiation matrix method -*********************** - -.. currentmodule:: ansys.mapdl.core - -These AUX12 commands are used to calculate radiation view factors and -to create a radiation substructure for the Radiation Matrix method. - -.. autosummary:: - :toctree: _autosummary/ - - Mapdl.emis - Mapdl.geom - Mapdl.mprint - Mapdl.space - Mapdl.vtype - Mapdl.write diff --git a/doc/source/mapdl_commands/aux12/radiation_matrix_method.rst b/doc/source/mapdl_commands/aux12/radiation_matrix_method.rst new file mode 100644 index 00000000000..8f9257b4d65 --- /dev/null +++ b/doc/source/mapdl_commands/aux12/radiation_matrix_method.rst @@ -0,0 +1,23 @@ + +.. _ref_radiation_matrix_method: + + +RadiationMatrixMethod +===================== + + +.. currentmodule:: ansys.mapdl.core._commands.aux12.radiation_matrix_method + +.. autoclass:: ansys.mapdl.core._commands.aux12.radiation_matrix_method.RadiationMatrixMethod + +.. autosummary:: + :template: base.rst + :toctree: _autosummary + + + RadiationMatrixMethod.emis + RadiationMatrixMethod.geom + RadiationMatrixMethod.mprint + RadiationMatrixMethod.space + RadiationMatrixMethod.vtype + RadiationMatrixMethod.write diff --git a/doc/source/mapdl_commands/aux12/radiosity_solver.rst b/doc/source/mapdl_commands/aux12/radiosity_solver.rst index 1a7ab414290..0ae7966cdce 100644 --- a/doc/source/mapdl_commands/aux12/radiosity_solver.rst +++ b/doc/source/mapdl_commands/aux12/radiosity_solver.rst @@ -1,23 +1,20 @@ -.. _ref_radiosity Solver_api: -**************** -Radiosity solver -**************** +.. _ref_radiosity_solver: -.. currentmodule:: ansys.mapdl.core -These AUX12 commands are used to calculate the radiation view factors -and to specify the solution parameters for the Radiosity solver -method. +RadiositySolver +=============== + + +.. currentmodule:: ansys.mapdl.core._commands.aux12.radiosity_solver + +.. autoclass:: ansys.mapdl.core._commands.aux12.radiosity_solver.RadiositySolver .. autosummary:: - :toctree: _autosummary/ - - Mapdl.hemiopt - Mapdl.radopt - Mapdl.spcnod - Mapdl.spctemp - Mapdl.v2dopt - Mapdl.vfsm - Mapdl.vfopt - Mapdl.vfquery + :template: base.rst + :toctree: _autosummary + + + RadiositySolver.vfco + RadiositySolver.vfquery + RadiositySolver.vfsm diff --git a/doc/source/mapdl_commands/aux15.rst b/doc/source/mapdl_commands/aux15.rst deleted file mode 100644 index df357169578..00000000000 --- a/doc/source/mapdl_commands/aux15.rst +++ /dev/null @@ -1,15 +0,0 @@ -.. _ref_iges_api: - -**** -IGES -**** - -.. currentmodule:: ansys.mapdl.core - -These AUX15 commands read an IGES format file into PREP7 data. - -.. autosummary:: - :toctree: _autosummary/ - - Mapdl.igesin - Mapdl.ioptn diff --git a/doc/source/mapdl_commands/aux15/iges.rst b/doc/source/mapdl_commands/aux15/iges.rst new file mode 100644 index 00000000000..4846944d1d6 --- /dev/null +++ b/doc/source/mapdl_commands/aux15/iges.rst @@ -0,0 +1,20 @@ + +.. _ref_iges: + + +Iges +==== + + +.. currentmodule:: ansys.mapdl.core._commands.aux15.iges + +.. autoclass:: ansys.mapdl.core._commands.aux15.iges.Iges + +.. autosummary:: + :template: base.rst + :toctree: _autosummary + + + Iges.aux15 + Iges.igesin + Iges.ioptn diff --git a/doc/source/mapdl_commands/aux15/index.rst b/doc/source/mapdl_commands/aux15/index.rst new file mode 100644 index 00000000000..23bea85776e --- /dev/null +++ b/doc/source/mapdl_commands/aux15/index.rst @@ -0,0 +1,16 @@ + +.. _ref_aux15: + +Aux15 +===== + +.. list-table:: + + * - :ref:`ref_iges` + + +.. toctree:: + :maxdepth: 1 + :hidden: + + iges diff --git a/doc/source/mapdl_commands/aux2/bin_dump.rst b/doc/source/mapdl_commands/aux2/bin_dump.rst deleted file mode 100644 index 8a78b43b9e5..00000000000 --- a/doc/source/mapdl_commands/aux2/bin_dump.rst +++ /dev/null @@ -1,17 +0,0 @@ -.. _ref_binary File Dump_api: - -**************** -Binary file dump -**************** - -.. currentmodule:: ansys.mapdl.core - -These AUX2 commands are used to dump the contents of binary files. - -.. autosummary:: - :toctree: _autosummary/ - - Mapdl.dump - Mapdl.fileaux2 - Mapdl.form - Mapdl.ptr diff --git a/doc/source/mapdl_commands/aux2/bin_manip.rst b/doc/source/mapdl_commands/aux2/bin_manip.rst deleted file mode 100644 index bf34c096c79..00000000000 --- a/doc/source/mapdl_commands/aux2/bin_manip.rst +++ /dev/null @@ -1,17 +0,0 @@ -.. _ref_binary File Manipulation_api: - -************************ -Binary file manipulation -************************ - -.. currentmodule:: ansys.mapdl.core - -These AUX2 commands are used to manipulate the contents of binary -files. - -.. autosummary:: - :toctree: _autosummary/ - - Mapdl.combine - Mapdl.hbmat - Mapdl.psmat diff --git a/doc/source/mapdl_commands/aux2/binary_file_dump.rst b/doc/source/mapdl_commands/aux2/binary_file_dump.rst new file mode 100644 index 00000000000..b06682cafd8 --- /dev/null +++ b/doc/source/mapdl_commands/aux2/binary_file_dump.rst @@ -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 diff --git a/doc/source/mapdl_commands/aux2/binary_file_manipulation.rst b/doc/source/mapdl_commands/aux2/binary_file_manipulation.rst new file mode 100644 index 00000000000..0f681bb0ee0 --- /dev/null +++ b/doc/source/mapdl_commands/aux2/binary_file_manipulation.rst @@ -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 diff --git a/doc/source/mapdl_commands/aux2/index.rst b/doc/source/mapdl_commands/aux2/index.rst new file mode 100644 index 00000000000..3dc466a90bb --- /dev/null +++ b/doc/source/mapdl_commands/aux2/index.rst @@ -0,0 +1,18 @@ + +.. _ref_aux2: + +Aux2 +==== + +.. list-table:: + + * - :ref:`ref_binary_file_dump` + * - :ref:`ref_binary_file_manipulation` + + +.. toctree:: + :maxdepth: 1 + :hidden: + + binary_file_dump + binary_file_manipulation diff --git a/doc/source/mapdl_commands/aux3.rst b/doc/source/mapdl_commands/aux3.rst deleted file mode 100644 index 8c7d9027fa7..00000000000 --- a/doc/source/mapdl_commands/aux3.rst +++ /dev/null @@ -1,19 +0,0 @@ -.. _ref_results_files_api: - -************* -Results files -************* - -.. currentmodule:: ansys.mapdl.core - -These commands are related to the /AUX3 command. - -.. autosummary:: - :toctree: _autosummary/ - - Mapdl.compress - Mapdl.fileaux3 - Mapdl.list - Mapdl.modify - Mapdl.undelete - Mapdl.delete diff --git a/doc/source/mapdl_commands/aux3/index.rst b/doc/source/mapdl_commands/aux3/index.rst new file mode 100644 index 00000000000..7855d643336 --- /dev/null +++ b/doc/source/mapdl_commands/aux3/index.rst @@ -0,0 +1,16 @@ + +.. _ref_aux3: + +Aux3 +==== + +.. list-table:: + + * - :ref:`ref_results_files` + + +.. toctree:: + :maxdepth: 1 + :hidden: + + results_files diff --git a/doc/source/mapdl_commands/aux3/results_files.rst b/doc/source/mapdl_commands/aux3/results_files.rst new file mode 100644 index 00000000000..e82b982ff68 --- /dev/null +++ b/doc/source/mapdl_commands/aux3/results_files.rst @@ -0,0 +1,24 @@ + +.. _ref_results_files: + + +ResultsFiles +============ + + +.. currentmodule:: ansys.mapdl.core._commands.aux3.results_files + +.. autoclass:: ansys.mapdl.core._commands.aux3.results_files.ResultsFiles + +.. autosummary:: + :template: base.rst + :toctree: _autosummary + + + ResultsFiles.aux3 + ResultsFiles.compress + ResultsFiles.delete + ResultsFiles.fileaux3 + ResultsFiles.list + ResultsFiles.modify + ResultsFiles.undelete diff --git a/doc/source/mapdl_commands/database/components.rst b/doc/source/mapdl_commands/database/components.rst index 49b4f69edfd..e77e23000d7 100644 --- a/doc/source/mapdl_commands/database/components.rst +++ b/doc/source/mapdl_commands/database/components.rst @@ -1,23 +1,26 @@ -.. _ref_components_api: -********** +.. _ref_components: + + Components -********** +========== + -.. currentmodule:: ansys.mapdl.core +.. currentmodule:: ansys.mapdl.core._commands.database.components -These DATABASE commands allow selected subsets of entities to be named -as components for easy selection later on. +.. autoclass:: ansys.mapdl.core._commands.database.components.Components .. autosummary:: - :toctree: _autosummary/ - - Mapdl.cm - Mapdl.cmdele - Mapdl.cmedit - Mapdl.cmgrp - Mapdl.cmlist - Mapdl.cmmod - Mapdl.cmplot - Mapdl.cmsel - Mapdl.cmwrite + :template: base.rst + :toctree: _autosummary + + + Components.cm + Components.cmdele + Components.cmedit + Components.cmgrp + Components.cmlist + Components.cmmod + Components.cmplot + Components.cmsel + Components.cmwrite diff --git a/doc/source/mapdl_commands/database/coord_sys.rst b/doc/source/mapdl_commands/database/coord_sys.rst deleted file mode 100644 index afce4dd78dd..00000000000 --- a/doc/source/mapdl_commands/database/coord_sys.rst +++ /dev/null @@ -1,22 +0,0 @@ -.. _ref_coordinate System_api: - -***************** -Coordinate system -***************** - -.. currentmodule:: ansys.mapdl.core - -These DATABASE commands define and manipulate coordinate systems. - -.. autosummary:: - :toctree: _autosummary/ - - Mapdl.clocal - Mapdl.cs - Mapdl.cscir - Mapdl.csdele - Mapdl.cskp - Mapdl.cslist - Mapdl.cswpla - Mapdl.csys - Mapdl.local diff --git a/doc/source/mapdl_commands/database/coordinate_system.rst b/doc/source/mapdl_commands/database/coordinate_system.rst new file mode 100644 index 00000000000..07367f22196 --- /dev/null +++ b/doc/source/mapdl_commands/database/coordinate_system.rst @@ -0,0 +1,26 @@ + +.. _ref_coordinate_system: + + +CoordinateSystem +================ + + +.. currentmodule:: ansys.mapdl.core._commands.database.coordinate_system + +.. autoclass:: ansys.mapdl.core._commands.database.coordinate_system.CoordinateSystem + +.. autosummary:: + :template: base.rst + :toctree: _autosummary + + + CoordinateSystem.clocal + CoordinateSystem.cs + CoordinateSystem.cscir + CoordinateSystem.csdele + CoordinateSystem.cskp + CoordinateSystem.cslist + CoordinateSystem.cswpla + CoordinateSystem.csys + CoordinateSystem.local diff --git a/doc/source/mapdl_commands/database/index.rst b/doc/source/mapdl_commands/database/index.rst new file mode 100644 index 00000000000..7eb7c65b115 --- /dev/null +++ b/doc/source/mapdl_commands/database/index.rst @@ -0,0 +1,26 @@ + +.. _ref_database: + +Database +======== + +.. list-table:: + + * - :ref:`ref_selecting` + * - :ref:`ref_coordinate_system` + * - :ref:`ref_components` + * - :ref:`ref_picking` + * - :ref:`ref_working_plane` + * - :ref:`ref_set_up` + + +.. toctree:: + :maxdepth: 1 + :hidden: + + selecting + coordinate_system + components + picking + working_plane + set_up diff --git a/doc/source/mapdl_commands/database/picking.rst b/doc/source/mapdl_commands/database/picking.rst index 38a43bb5e03..e1ae4b42dba 100644 --- a/doc/source/mapdl_commands/database/picking.rst +++ b/doc/source/mapdl_commands/database/picking.rst @@ -1,18 +1,19 @@ -.. _ref_picking_api: -******* +.. _ref_picking: + + Picking -******* +======= -.. currentmodule:: ansys.mapdl.core -These DATABASE commands are generated by the GUI when picking -operations are performed. They can also be used to add additional -parameters to a command. For example, more points to a spline than -would be normally supported. +.. currentmodule:: ansys.mapdl.core._commands.database.picking + +.. autoclass:: ansys.mapdl.core._commands.database.picking.Picking .. autosummary:: - :toctree: _autosummary/ + :template: base.rst + :toctree: _autosummary + - Mapdl.fitem - Mapdl.flst + Picking.fitem + Picking.flst diff --git a/doc/source/mapdl_commands/database/selecting.rst b/doc/source/mapdl_commands/database/selecting.rst index 0db338bbc6a..9810209e89b 100644 --- a/doc/source/mapdl_commands/database/selecting.rst +++ b/doc/source/mapdl_commands/database/selecting.rst @@ -1,39 +1,42 @@ -.. _ref_selecting_api: -********* +.. _ref_selecting: + + Selecting -********* +========= + -.. currentmodule:: ansys.mapdl.core +.. currentmodule:: ansys.mapdl.core._commands.database.selecting -These DATABASE commands are used to select subsets of database -entities for further operations. +.. autoclass:: ansys.mapdl.core._commands.database.selecting.Selecting .. autosummary:: - :toctree: _autosummary/ - - Mapdl.allsel - Mapdl.asll - Mapdl.asel - Mapdl.aslv - Mapdl.dofsel - Mapdl.esel - Mapdl.esla - Mapdl.esll - Mapdl.esln - Mapdl.eslv - Mapdl.ksel - Mapdl.ksll - Mapdl.ksln - Mapdl.lsel - Mapdl.lsla - Mapdl.lslk - Mapdl.nsel - Mapdl.nsla - Mapdl.nsle - Mapdl.nslk - Mapdl.nsll - Mapdl.nslv - Mapdl.partsel - Mapdl.vsel - Mapdl.vsla + :template: base.rst + :toctree: _autosummary + + + Selecting.allsel + Selecting.asel + Selecting.asll + Selecting.aslv + Selecting.dofsel + Selecting.esel + Selecting.esla + Selecting.esll + Selecting.esln + Selecting.eslv + Selecting.ksel + Selecting.ksll + Selecting.ksln + Selecting.lsel + Selecting.lsla + Selecting.lslk + Selecting.nsel + Selecting.nsla + Selecting.nsle + Selecting.nslk + Selecting.nsll + Selecting.nslv + Selecting.seltol + Selecting.vsel + Selecting.vsla diff --git a/doc/source/mapdl_commands/database/set_up.rst b/doc/source/mapdl_commands/database/set_up.rst new file mode 100644 index 00000000000..e1a89b98791 --- /dev/null +++ b/doc/source/mapdl_commands/database/set_up.rst @@ -0,0 +1,24 @@ + +.. _ref_set_up: + + +SetUp +===== + + +.. currentmodule:: ansys.mapdl.core._commands.database.set_up + +.. autoclass:: ansys.mapdl.core._commands.database.set_up.SetUp + +.. autosummary:: + :template: base.rst + :toctree: _autosummary + + + SetUp.resume + SetUp.save + SetUp.smbc + SetUp.stat + SetUp.stitle + SetUp.title + SetUp.units diff --git a/doc/source/mapdl_commands/database/setup.rst b/doc/source/mapdl_commands/database/setup.rst deleted file mode 100644 index ef92f56356a..00000000000 --- a/doc/source/mapdl_commands/database/setup.rst +++ /dev/null @@ -1,22 +0,0 @@ -.. _ref_setup_commands_api: - -***** -Setup -***** - -.. currentmodule:: ansys.mapdl.core - -These DATABASE commands can be used to initialize the database, save -it to a file, or annotate it with titles and systems of units. - -.. autosummary:: - :toctree: _autosummary/ - - Mapdl.clear - Mapdl.resume - Mapdl.save - Mapdl.smbc - Mapdl.stat - Mapdl.stitle - Mapdl.title - Mapdl.units diff --git a/doc/source/mapdl_commands/database/working_plane.rst b/doc/source/mapdl_commands/database/working_plane.rst index d3eb8ec1699..f76f86027a8 100644 --- a/doc/source/mapdl_commands/database/working_plane.rst +++ b/doc/source/mapdl_commands/database/working_plane.rst @@ -1,25 +1,28 @@ -.. _ref_working_plane_api: -************* -Working plane -************* +.. _ref_working_plane: -.. currentmodule:: ansys.mapdl.core -These DATABASE commands turn on, move, rotate, and modify the working -plane, which is used for picking operations. +WorkingPlane +============ + + +.. currentmodule:: ansys.mapdl.core._commands.database.working_plane + +.. autoclass:: ansys.mapdl.core._commands.database.working_plane.WorkingPlane .. autosummary:: - :toctree: _autosummary/ - - Mapdl.kwpave - Mapdl.kwplan - Mapdl.lwplan - Mapdl.nwpave - Mapdl.nwplan - Mapdl.wpave - Mapdl.wpcsys - Mapdl.wplane - Mapdl.wpoffs - Mapdl.wprota - Mapdl.wpstyl + :template: base.rst + :toctree: _autosummary + + + WorkingPlane.kwpave + WorkingPlane.kwplan + WorkingPlane.lwplan + WorkingPlane.nwpave + WorkingPlane.nwplan + WorkingPlane.wpave + WorkingPlane.wpcsys + WorkingPlane.wplane + WorkingPlane.wpoffs + WorkingPlane.wprota + WorkingPlane.wpstyl diff --git a/doc/source/mapdl_commands/display/setup.rst b/doc/source/mapdl_commands/display/setup.rst deleted file mode 100644 index aa42c72255f..00000000000 --- a/doc/source/mapdl_commands/display/setup.rst +++ /dev/null @@ -1,19 +0,0 @@ -.. _ref_display_setup_api: - -***** -Setup -***** - -.. currentmodule:: ansys.mapdl.core - -These DISPLAY commands are used to set up the DISPLAY program. - -.. autosummary:: - :toctree: _autosummary/ - - Mapdl.cmap - Mapdl.devdisp - Mapdl.filedisp - Mapdl.nocolor - Mapdl.showdisp - Mapdl.trans diff --git a/doc/source/mapdl_commands/graphics/annotation.rst b/doc/source/mapdl_commands/graphics/annotation.rst index a32ec936573..1184b9bf445 100644 --- a/doc/source/mapdl_commands/graphics/annotation.rst +++ b/doc/source/mapdl_commands/graphics/annotation.rst @@ -1,26 +1,31 @@ -.. _ref_annotation_api: -********** +.. _ref_annotation: + + Annotation -********** +========== + -.. currentmodule:: ansys.mapdl.core +.. currentmodule:: ansys.mapdl.core._commands.graphics.annotation -These GRAPHICS commands are used to annotate a display with notes and -symbols. +.. autoclass:: ansys.mapdl.core._commands.graphics.annotation.Annotation .. autosummary:: - :toctree: _autosummary/ - - Mapdl.an3d - Mapdl.annot - Mapdl.anum - Mapdl.lspec - Mapdl.lsymbol - Mapdl.slash_pcircle - Mapdl.pmore - Mapdl.polygon - Mapdl.pspec - Mapdl.pwedge - Mapdl.tlabel - Mapdl.tspec + :template: base.rst + :toctree: _autosummary + + + Annotation.an3d + Annotation.annot + Annotation.anum + Annotation.lspec + Annotation.lsymbol + Annotation.pcircle + Annotation.pmore + Annotation.polygon + Annotation.pwedge + Annotation.slashlarc + Annotation.slashline + Annotation.slashpspec + Annotation.tlabel + Annotation.tspec diff --git a/doc/source/mapdl_commands/graphics/graphs.rst b/doc/source/mapdl_commands/graphics/graphs.rst index 0afd86b213f..4c5fc934430 100644 --- a/doc/source/mapdl_commands/graphics/graphs.rst +++ b/doc/source/mapdl_commands/graphics/graphs.rst @@ -1,21 +1,24 @@ -.. _ref_graphs_api: -****** +.. _ref_graphs: + + Graphs -****** +====== + -.. currentmodule:: ansys.mapdl.core +.. currentmodule:: ansys.mapdl.core._commands.graphics.graphs -These GRAPHICS commands are used to control the way line graphs are -displayed. +.. autoclass:: ansys.mapdl.core._commands.graphics.graphs.Graphs .. autosummary:: - :toctree: _autosummary/ - - Mapdl.axlab - Mapdl.grid - Mapdl.gropt - Mapdl.grtyp - Mapdl.gthk - Mapdl.xrange - Mapdl.yrange + :template: base.rst + :toctree: _autosummary + + + Graphs.axlab + Graphs.grid + Graphs.gropt + Graphs.grtyp + Graphs.gthk + Graphs.xrange + Graphs.yrange diff --git a/doc/source/mapdl_commands/graphics/index.rst b/doc/source/mapdl_commands/graphics/index.rst new file mode 100644 index 00000000000..03b25f3e807 --- /dev/null +++ b/doc/source/mapdl_commands/graphics/index.rst @@ -0,0 +1,28 @@ + +.. _ref_graphics: + +Graphics +======== + +.. list-table:: + + * - :ref:`ref_annotation` + * - :ref:`ref_views` + * - :ref:`ref_graphs` + * - :ref:`ref_labeling` + * - :ref:`ref_set_up` + * - :ref:`ref_style` + * - :ref:`ref_scaling` + + +.. toctree:: + :maxdepth: 1 + :hidden: + + annotation + views + graphs + labeling + set_up + style + scaling diff --git a/doc/source/mapdl_commands/graphics/labeling.rst b/doc/source/mapdl_commands/graphics/labeling.rst index 7445b7972ed..932a94f2ba2 100644 --- a/doc/source/mapdl_commands/graphics/labeling.rst +++ b/doc/source/mapdl_commands/graphics/labeling.rst @@ -1,29 +1,32 @@ -.. _ref_labeling_api: -******** +.. _ref_labeling: + + Labeling -******** +======== + -.. currentmodule:: ansys.mapdl.core +.. currentmodule:: ansys.mapdl.core._commands.graphics.labeling -These GRAPHICS commands are used to add helpful labels and symbols to -displays. +.. autoclass:: ansys.mapdl.core._commands.graphics.labeling.Labeling .. autosummary:: - :toctree: _autosummary/ - - Mapdl.cformat - Mapdl.clabel - Mapdl.contour - Mapdl.cval - Mapdl.gformat - Mapdl.hbc - Mapdl.number - Mapdl.pbc - Mapdl.pbf - Mapdl.plopts - Mapdl.pnum - Mapdl.psf - Mapdl.psymb - Mapdl.triad - Mapdl.udoc + :template: base.rst + :toctree: _autosummary + + + Labeling.cformat + Labeling.clabel + Labeling.contour + Labeling.cval + Labeling.gformat + Labeling.hbc + Labeling.number + Labeling.pbc + Labeling.pbf + Labeling.plopts + Labeling.pnum + Labeling.psf + Labeling.psymb + Labeling.triad + Labeling.udoc diff --git a/doc/source/mapdl_commands/graphics/scaling.rst b/doc/source/mapdl_commands/graphics/scaling.rst index 063276bb84b..b3b64216768 100644 --- a/doc/source/mapdl_commands/graphics/scaling.rst +++ b/doc/source/mapdl_commands/graphics/scaling.rst @@ -1,21 +1,24 @@ -.. _ref_scaling_api: -******* +.. _ref_scaling: + + Scaling -******* +======= + -.. currentmodule:: ansys.mapdl.core +.. currentmodule:: ansys.mapdl.core._commands.graphics.scaling -These GRAPHICS commands are used to scale various parts of the -display. +.. autoclass:: ansys.mapdl.core._commands.graphics.scaling.Scaling .. autosummary:: - :toctree: _autosummary/ - - Mapdl.iclwid - Mapdl.icscale - Mapdl.ratio - Mapdl.shrink - Mapdl.sscale - Mapdl.txtre - Mapdl.vscale + :template: base.rst + :toctree: _autosummary + + + Scaling.iclwid + Scaling.icscale + Scaling.ratio + Scaling.shrink + Scaling.slashdscale + Scaling.sscale + Scaling.vscale diff --git a/doc/source/mapdl_commands/graphics/set_up.rst b/doc/source/mapdl_commands/graphics/set_up.rst new file mode 100644 index 00000000000..9fb6de27e15 --- /dev/null +++ b/doc/source/mapdl_commands/graphics/set_up.rst @@ -0,0 +1,43 @@ + +.. _ref_set_up: + + +SetUp +===== + + +.. currentmodule:: ansys.mapdl.core._commands.graphics.set_up + +.. autoclass:: ansys.mapdl.core._commands.graphics.set_up.SetUp + +.. autosummary:: + :template: base.rst + :toctree: _autosummary + + + SetUp.cmap + SetUp.color + SetUp.device + SetUp.dsys + SetUp.dv3d + SetUp.gcmd + SetUp.gcolumn + SetUp.gfile + SetUp.gplot + SetUp.graphics + SetUp.gresume + SetUp.gsave + SetUp.gtype + SetUp.image + SetUp.immed + SetUp.jpeg + SetUp.mrep + SetUp.noerase + SetUp.pngr + SetUp.pstatus + SetUp.replot + SetUp.seg + SetUp.show + SetUp.slashreset + SetUp.tiff + SetUp.window diff --git a/doc/source/mapdl_commands/graphics/setup.rst b/doc/source/mapdl_commands/graphics/setup.rst deleted file mode 100644 index ff8e58f1d4a..00000000000 --- a/doc/source/mapdl_commands/graphics/setup.rst +++ /dev/null @@ -1,39 +0,0 @@ -.. _ref_graphics_setup_api: - -***** -Setup -***** - -.. currentmodule:: ansys.mapdl.core - -These GRAPHICS commands are used for general graphics control, such as -window setup, color settings, specifications saving, etc. - -.. autosummary:: - :toctree: _autosummary/ - - Mapdl.color - Mapdl.device - Mapdl.dsys - Mapdl.dv3d - Mapdl.gcmd - Mapdl.gcolumn - Mapdl.gfile - Mapdl.gplot - Mapdl.graphics - Mapdl.gresume - Mapdl.gsave - Mapdl.gtype - Mapdl.image - Mapdl.jpeg - Mapdl.mrep - Mapdl.pcopy - Mapdl.pngr - Mapdl.pscr - Mapdl.pstatus - Mapdl.replot - Mapdl.slashreset - Mapdl.seg - Mapdl.show - Mapdl.tiff - Mapdl.window diff --git a/doc/source/mapdl_commands/graphics/style.rst b/doc/source/mapdl_commands/graphics/style.rst index e02d8c9c1de..22a7e62ae08 100644 --- a/doc/source/mapdl_commands/graphics/style.rst +++ b/doc/source/mapdl_commands/graphics/style.rst @@ -1,26 +1,31 @@ -.. _ref_style_api: -***** +.. _ref_style: + + Style -***** +===== + -.. currentmodule:: ansys.mapdl.core +.. currentmodule:: ansys.mapdl.core._commands.graphics.style -These GRAPHICS commands are used to change the way a model is -displayed. +.. autoclass:: ansys.mapdl.core._commands.graphics.style.Style .. autosummary:: - :toctree: _autosummary/ - - Mapdl.cplane - Mapdl.ctype - Mapdl.edge - Mapdl.eshape - Mapdl.facet - Mapdl.gline - Mapdl.gmarker - Mapdl.gmface - Mapdl.light - Mapdl.normal - Mapdl.shade - Mapdl.trlcy + :template: base.rst + :toctree: _autosummary + + + Style.cplane + Style.ctype + Style.edge + Style.eshape + Style.facet + Style.gline + Style.gmarker + Style.gmface + Style.light + Style.normal + Style.shade + Style.slashtype + Style.trlcy + Style.txtre diff --git a/doc/source/mapdl_commands/graphics/views.rst b/doc/source/mapdl_commands/graphics/views.rst index 6fae00ee2a4..332b80941d1 100644 --- a/doc/source/mapdl_commands/graphics/views.rst +++ b/doc/source/mapdl_commands/graphics/views.rst @@ -1,23 +1,27 @@ -.. _ref_views_api: -***** +.. _ref_views: + + Views -***** +===== + -.. currentmodule:: ansys.mapdl.core +.. currentmodule:: ansys.mapdl.core._commands.graphics.views -These GRAPHICS commands are used to control the view of the model. +.. autoclass:: ansys.mapdl.core._commands.graphics.views.Views .. autosummary:: - :toctree: _autosummary/ - - Mapdl.angle - Mapdl.auto - Mapdl.dist - Mapdl.focus - Mapdl.user - Mapdl.vcone - Mapdl.view - Mapdl.vup - Mapdl.xfrm - Mapdl.zoom + :template: base.rst + :toctree: _autosummary + + + Views.angle + Views.auto + Views.dist + Views.focus + Views.user + Views.vcone + Views.view + Views.vup + Views.xfrm + Views.zoom diff --git a/doc/source/mapdl_commands/index.rst b/doc/source/mapdl_commands/index.rst index 8eeba77bb34..b37ac88c46c 100644 --- a/doc/source/mapdl_commands/index.rst +++ b/doc/source/mapdl_commands/index.rst @@ -19,10 +19,7 @@ are grouped by capability. :maxdepth: 1 :caption: Session - session/run_controls - session/processor_entry - session/files - session/list_controls + session/index ******** @@ -34,12 +31,8 @@ These commands are used to operate on the database globally. :maxdepth: 1 :caption: Database - database/setup - database/selecting - database/components - database/working_plane - database/coord_sys - database/picking + database/index + ******** Graphics @@ -50,13 +43,7 @@ These commands are used to control the graphics of the program. :maxdepth: 1 :caption: Graphics - graphics/setup - graphics/views - graphics/scaling - graphics/style - graphics/labeling - graphics/graphs - graphics/annotation + graphics/index **** @@ -69,12 +56,7 @@ These commands make up the ANSYS Parametric Design Language :maxdepth: 1 :caption: APDL - apdl/parameter_definition - apdl/macro_files - apdl/abbreviations - apdl/array_parm - apdl/matrix_op - apdl/process_controls + apdl/index .. _ref_prep_commands: @@ -166,20 +148,8 @@ processor. :maxdepth: 1 :caption: POST1 - post1/setup - post1/controls - post1/results - post1/element_table - post1/listing - post1/animation - post1/path_operations - post1/surface_operations - post1/load_case - post1/magnetics_calc - post1/trace_points - post1/special - post1/status - post1/failure_criteria + post1/index + ****** POST26 @@ -191,13 +161,7 @@ time-history processor. :maxdepth: 1 :caption: POST26 - post26/setup - post26/controls - post26/operations - post26/display - post26/listing - post26/special - post26/status + post26/index **** @@ -210,8 +174,7 @@ binary files produced by the program. :maxdepth: 1 :caption: AUX2 - aux2/bin_dump - aux2/bin_manip + aux2/index **** AUX3 @@ -223,7 +186,7 @@ files by deleting sets or by changing values. :maxdepth: 1 :caption: AUX3 - aux3 + aux3/index ***** @@ -236,9 +199,7 @@ analyses. :maxdepth: 1 :caption: AUX12 - aux12/general_radiation - aux12/radiation_mat - aux12/radiosity_solver + aux12/index ***** @@ -250,7 +211,7 @@ These commands are used to read in an IGES file for analysis in ANSYS. :maxdepth: 1 :caption: AUX15 - aux15 + aux15/index ***************** @@ -263,41 +224,8 @@ onto the existing geometry. :maxdepth: 1 :caption: MAP - map - - -*************** -DISPLAY program -*************** -These commands are used for the DISPLAY program. The DISPLAY program -is a companion program to ANSYS, used for recovering graphics displays -produced within ANSYS. - -.. note:: - Many of these commands are not applicable when using PyMAPDL. - -.. toctree:: - :maxdepth: 1 - :caption: DISPLAY - - display/setup - - -********************** -REDUCED order modeling -********************** -These commands are used for the DISPLAY program. The DISPLAY program -is a companion program to ANSYS, used for recovering graphics displays -produced within ANSYS. - -.. toctree:: - :maxdepth: 1 - :caption: REDUCED + map/index - reduced/setup - reduced/preparation - reduced/generation - reduced/use_pass ******************* Connection commands diff --git a/doc/source/mapdl_commands/map.rst b/doc/source/mapdl_commands/map.rst deleted file mode 100644 index 827b60dc046..00000000000 --- a/doc/source/mapdl_commands/map.rst +++ /dev/null @@ -1,21 +0,0 @@ -.. _ref_pressure_mapping_api: - -**************** -Pressure mapping -**************** - -.. currentmodule:: ansys.mapdl.core - -These commands are used to read pressure data from an external file -and map it onto a geometry. - -.. autosummary:: - :toctree: _autosummary/ - - Mapdl.ftype - Mapdl.plgeom - Mapdl.plmap - Mapdl.read - Mapdl.slashmap - Mapdl.target - Mapdl.writemap diff --git a/doc/source/mapdl_commands/map/index.rst b/doc/source/mapdl_commands/map/index.rst new file mode 100644 index 00000000000..e806cb76b56 --- /dev/null +++ b/doc/source/mapdl_commands/map/index.rst @@ -0,0 +1,16 @@ + +.. _ref_map: + +Map +=== + +.. list-table:: + + * - :ref:`ref_pressure_mapping` + + +.. toctree:: + :maxdepth: 1 + :hidden: + + pressure_mapping diff --git a/doc/source/mapdl_commands/map/pressure_mapping.rst b/doc/source/mapdl_commands/map/pressure_mapping.rst new file mode 100644 index 00000000000..79bebfb50ee --- /dev/null +++ b/doc/source/mapdl_commands/map/pressure_mapping.rst @@ -0,0 +1,25 @@ + +.. _ref_pressure_mapping: + + +PressureMapping +=============== + + +.. currentmodule:: ansys.mapdl.core._commands.map.pressure_mapping + +.. autoclass:: ansys.mapdl.core._commands.map.pressure_mapping.PressureMapping + +.. autosummary:: + :template: base.rst + :toctree: _autosummary + + + PressureMapping.ftype + PressureMapping.map + PressureMapping.plgeom + PressureMapping.plmap + PressureMapping.read + PressureMapping.slashmap + PressureMapping.target + PressureMapping.writemap diff --git a/doc/source/mapdl_commands/post1/_fatigue.rst b/doc/source/mapdl_commands/post1/_fatigue.rst new file mode 100644 index 00000000000..1c5de0994f1 --- /dev/null +++ b/doc/source/mapdl_commands/post1/_fatigue.rst @@ -0,0 +1,31 @@ + +.. _ref__fatigue: + + +Fatigue +======= + + +.. currentmodule:: ansys.mapdl.core._commands.post1._fatigue + +.. autoclass:: ansys.mapdl.core._commands.post1._fatigue.Fatigue + +.. autosummary:: + :template: base.rst + :toctree: _autosummary + + + Fatigue.fe + Fatigue.felist + Fatigue.fl + Fatigue.fllist + Fatigue.fp + Fatigue.fplist + Fatigue.fs + Fatigue.fsdele + Fatigue.fslist + Fatigue.fsnode + Fatigue.fsplot + Fatigue.ftcalc + Fatigue.ftsize + Fatigue.ftwrite diff --git a/doc/source/mapdl_commands/post1/_special_purpose.rst b/doc/source/mapdl_commands/post1/_special_purpose.rst new file mode 100644 index 00000000000..7a45a436555 --- /dev/null +++ b/doc/source/mapdl_commands/post1/_special_purpose.rst @@ -0,0 +1,19 @@ + +.. _ref__special_purpose: + + +SpecialPurpose +============== + + +.. currentmodule:: ansys.mapdl.core._commands.post1._special_purpose + +.. autoclass:: ansys.mapdl.core._commands.post1._special_purpose.SpecialPurpose + +.. autosummary:: + :template: base.rst + :toctree: _autosummary + + + SpecialPurpose.kcalc + SpecialPurpose.plcrack diff --git a/doc/source/mapdl_commands/post1/animation.rst b/doc/source/mapdl_commands/post1/animation.rst index 503e9348fe2..2abf7778544 100644 --- a/doc/source/mapdl_commands/post1/animation.rst +++ b/doc/source/mapdl_commands/post1/animation.rst @@ -1,28 +1,31 @@ -.. _ref_animation_api: -********* +.. _ref_animation: + + Animation -********* +========= + -.. currentmodule:: ansys.mapdl.core +.. currentmodule:: ansys.mapdl.core._commands.post1.animation -These POST1 commands are used to animate results. +.. autoclass:: ansys.mapdl.core._commands.post1.animation.Animation .. autosummary:: - :toctree: _autosummary/ - - Mapdl.ancntr - Mapdl.ancut - Mapdl.andata - Mapdl.andscl - Mapdl.ancyc - Mapdl.andyna - Mapdl.anfile - Mapdl.anflow - Mapdl.anharm - Mapdl.anim - Mapdl.anisos - Mapdl.anmode - Mapdl.anmres - Mapdl.antime - Mapdl.trtime + :template: base.rst + :toctree: _autosummary + + + Animation.ancntr + Animation.ancut + Animation.ancyc + Animation.andata + Animation.andscl + Animation.andyna + Animation.anfile + Animation.anflow + Animation.anharm + Animation.anim + Animation.anisos + Animation.anmode + Animation.antime + Animation.trtime diff --git a/doc/source/mapdl_commands/post1/controls.rst b/doc/source/mapdl_commands/post1/controls.rst index 6c27318bf09..24bd0697638 100644 --- a/doc/source/mapdl_commands/post1/controls.rst +++ b/doc/source/mapdl_commands/post1/controls.rst @@ -1,21 +1,26 @@ -.. _ref_controls_api: -******** +.. _ref_controls: + + Controls -******** +======== + -.. currentmodule:: ansys.mapdl.core +.. currentmodule:: ansys.mapdl.core._commands.post1.controls -These POST1 commands are used to control the calculations done for -other commands. +.. autoclass:: ansys.mapdl.core._commands.post1.controls.Controls .. autosummary:: - :toctree: _autosummary/ - - Mapdl.avprin - Mapdl.avres - Mapdl.efacet - Mapdl.ernorm - Mapdl.inres - Mapdl.layer - Mapdl.rsys + :template: base.rst + :toctree: _autosummary + + + Controls.avprin + Controls.avres + Controls.efacet + Controls.ernorm + Controls.force + Controls.inres + Controls.layer + Controls.rsys + Controls.shell diff --git a/doc/source/mapdl_commands/post1/element_table.rst b/doc/source/mapdl_commands/post1/element_table.rst index db946831b8b..e79d24fc4b5 100644 --- a/doc/source/mapdl_commands/post1/element_table.rst +++ b/doc/source/mapdl_commands/post1/element_table.rst @@ -1,35 +1,36 @@ -.. _ref_element_table_api: -************* -Element table -************* +.. _ref_element_table: -.. currentmodule:: ansys.mapdl.core -These POST1 commands are used to operate with the element table, which -in turn is used to process results stored for each element, such as -average stresses, heat fluxes, etc. +ElementTable +============ + + +.. currentmodule:: ansys.mapdl.core._commands.post1.element_table + +.. autoclass:: ansys.mapdl.core._commands.post1.element_table.ElementTable .. autosummary:: - :toctree: _autosummary/ - - Mapdl.detab - Mapdl.esort - Mapdl.etable - Mapdl.eusort - Mapdl.pletab - Mapdl.plls - Mapdl.pretab - Mapdl.sabs - Mapdl.sadd - Mapdl.sallow - Mapdl.sexp - Mapdl.sfact - Mapdl.sfcalc - Mapdl.smax - Mapdl.smin - Mapdl.smult - Mapdl.ssum - Mapdl.tallow - Mapdl.vcross - Mapdl.vdot + :template: base.rst + :toctree: _autosummary + + + ElementTable.esort + ElementTable.etable + ElementTable.eusort + ElementTable.pletab + ElementTable.plls + ElementTable.pretab + ElementTable.sabs + ElementTable.sadd + ElementTable.sallow + ElementTable.sexp + ElementTable.sfact + ElementTable.sfcalc + ElementTable.smax + ElementTable.smin + ElementTable.smult + ElementTable.ssum + ElementTable.tallow + ElementTable.vcross + ElementTable.vdot diff --git a/doc/source/mapdl_commands/post1/failure_criteria.rst b/doc/source/mapdl_commands/post1/failure_criteria.rst index b68bbb3de19..f16b4c40a70 100644 --- a/doc/source/mapdl_commands/post1/failure_criteria.rst +++ b/doc/source/mapdl_commands/post1/failure_criteria.rst @@ -1,18 +1,18 @@ -.. _ref_failure_criteria_api: -**************** -Failure criteria -**************** +.. _ref_failure_criteria: -.. currentmodule:: ansys.mapdl.core -These POST1 commands are for use with the failure criteria. +FailureCriteria +=============== + + +.. currentmodule:: ansys.mapdl.core._commands.post1.failure_criteria + +.. autoclass:: ansys.mapdl.core._commands.post1.failure_criteria.FailureCriteria .. autosummary:: - :toctree: _autosummary/ + :template: base.rst + :toctree: _autosummary + - Mapdl.fc - Mapdl.fccheck - Mapdl.fcdele - Mapdl.fclist - Mapdl.fctyp + FailureCriteria.fctyp diff --git a/doc/source/mapdl_commands/post1/index.rst b/doc/source/mapdl_commands/post1/index.rst new file mode 100644 index 00000000000..304dddb680f --- /dev/null +++ b/doc/source/mapdl_commands/post1/index.rst @@ -0,0 +1,46 @@ + +.. _ref_post1: + +Post1 +===== + +.. list-table:: + + * - :ref:`ref_animation` + * - :ref:`ref_set_up` + * - :ref:`ref_controls` + * - :ref:`ref_special_purpose` + * - :ref:`ref_status` + * - :ref:`ref_magnetics_calculations` + * - :ref:`ref_element_table` + * - :ref:`ref_failure_criteria` + * - :ref:`ref__fatigue` + * - :ref:`ref_listing` + * - :ref:`ref_path_operations` + * - :ref:`ref__special_purpose` + * - :ref:`ref_load_case_calculations` + * - :ref:`ref_results` + * - :ref:`ref_trace_points` + * - :ref:`ref_surface_operations` + + +.. toctree:: + :maxdepth: 1 + :hidden: + + animation + set_up + controls + special_purpose + status + magnetics_calculations + element_table + failure_criteria + _fatigue + listing + path_operations + _special_purpose + load_case_calculations + results + trace_points + surface_operations diff --git a/doc/source/mapdl_commands/post1/listing.rst b/doc/source/mapdl_commands/post1/listing.rst index fcc26ae3c39..ee7b7f16666 100644 --- a/doc/source/mapdl_commands/post1/listing.rst +++ b/doc/source/mapdl_commands/post1/listing.rst @@ -1,19 +1,23 @@ -.. _ref_listing_api: -******* +.. _ref_listing: + + Listing -******* +======= + -.. currentmodule:: ansys.mapdl.core +.. currentmodule:: ansys.mapdl.core._commands.post1.listing -These POST1 commands are used to control printed listings of results. +.. autoclass:: ansys.mapdl.core._commands.post1.listing.Listing .. autosummary:: - :toctree: _autosummary/ - - Mapdl.format - Mapdl.header - Mapdl.irlist - Mapdl.page - Mapdl.prerr - Mapdl.priter + :template: base.rst + :toctree: _autosummary + + + Listing.format + Listing.header + Listing.irlist + Listing.page + Listing.prerr + Listing.priter diff --git a/doc/source/mapdl_commands/post1/load_case.rst b/doc/source/mapdl_commands/post1/load_case.rst deleted file mode 100644 index 1db82198ee7..00000000000 --- a/doc/source/mapdl_commands/post1/load_case.rst +++ /dev/null @@ -1,25 +0,0 @@ -.. _ref_load Case Calculations_api: - -********************** -Load case calculations -********************** - -.. currentmodule:: ansys.mapdl.core - -These POST1 commands are used for combining results from different -load steps. - -.. autosummary:: - :toctree: _autosummary/ - - Mapdl.lcabs - Mapdl.lcase - Mapdl.lcdef - Mapdl.lcfact - Mapdl.lcfile - Mapdl.lcoper - Mapdl.lcsel - Mapdl.lcsum - Mapdl.lcwrite - Mapdl.lczero - Mapdl.rappnd diff --git a/doc/source/mapdl_commands/post1/load_case_calculations.rst b/doc/source/mapdl_commands/post1/load_case_calculations.rst new file mode 100644 index 00000000000..f3d3c9f181a --- /dev/null +++ b/doc/source/mapdl_commands/post1/load_case_calculations.rst @@ -0,0 +1,27 @@ + +.. _ref_load_case_calculations: + + +LoadCaseCalculations +==================== + + +.. currentmodule:: ansys.mapdl.core._commands.post1.load_case_calculations + +.. autoclass:: ansys.mapdl.core._commands.post1.load_case_calculations.LoadCaseCalculations + +.. autosummary:: + :template: base.rst + :toctree: _autosummary + + + LoadCaseCalculations.lcabs + LoadCaseCalculations.lcase + LoadCaseCalculations.lcdef + LoadCaseCalculations.lcfact + LoadCaseCalculations.lcfile + LoadCaseCalculations.lcoper + LoadCaseCalculations.lcsel + LoadCaseCalculations.lcwrite + LoadCaseCalculations.lczero + LoadCaseCalculations.rappnd diff --git a/doc/source/mapdl_commands/post1/magnetics_calc.rst b/doc/source/mapdl_commands/post1/magnetics_calc.rst deleted file mode 100644 index be754d524ed..00000000000 --- a/doc/source/mapdl_commands/post1/magnetics_calc.rst +++ /dev/null @@ -1,23 +0,0 @@ -.. _ref_magnetics Calculations_api: - -********************** -Magnetics calculations -********************** - -.. currentmodule:: ansys.mapdl.core - -These POST1 commands are used for special purpose magnetics -postprocessing. - -.. autosummary:: - :toctree: _autosummary/ - - Mapdl.curr2d - Mapdl.emagerr - Mapdl.emf - Mapdl.emft - Mapdl.fluxv - Mapdl.mmf - Mapdl.plf2d - Mapdl.powerh - Mapdl.senergy diff --git a/doc/source/mapdl_commands/post1/magnetics_calculations.rst b/doc/source/mapdl_commands/post1/magnetics_calculations.rst new file mode 100644 index 00000000000..56068418c13 --- /dev/null +++ b/doc/source/mapdl_commands/post1/magnetics_calculations.rst @@ -0,0 +1,26 @@ + +.. _ref_magnetics_calculations: + + +MagneticsCalculations +===================== + + +.. currentmodule:: ansys.mapdl.core._commands.post1.magnetics_calculations + +.. autoclass:: ansys.mapdl.core._commands.post1.magnetics_calculations.MagneticsCalculations + +.. autosummary:: + :template: base.rst + :toctree: _autosummary + + + MagneticsCalculations.curr2d + MagneticsCalculations.emagerr + MagneticsCalculations.emf + MagneticsCalculations.emft + MagneticsCalculations.fluxv + MagneticsCalculations.mmf + MagneticsCalculations.plf2d + MagneticsCalculations.powerh + MagneticsCalculations.senergy diff --git a/doc/source/mapdl_commands/post1/path_operations.rst b/doc/source/mapdl_commands/post1/path_operations.rst index a51b3f2eb95..6928df85788 100644 --- a/doc/source/mapdl_commands/post1/path_operations.rst +++ b/doc/source/mapdl_commands/post1/path_operations.rst @@ -1,33 +1,38 @@ -.. _ref_path_operations_api: -*************** -Path operations -*************** +.. _ref_path_operations: -.. currentmodule:: ansys.mapdl.core -These POST1 commands are used for path operations. +PathOperations +============== + + +.. currentmodule:: ansys.mapdl.core._commands.post1.path_operations + +.. autoclass:: ansys.mapdl.core._commands.post1.path_operations.PathOperations .. autosummary:: - :toctree: _autosummary/ - - Mapdl.padele - Mapdl.paget - Mapdl.paput - Mapdl.paresu - Mapdl.pasave - Mapdl.path - Mapdl.pcalc - Mapdl.pcross - Mapdl.pdef - Mapdl.pdot - Mapdl.plpagm - Mapdl.plpath - Mapdl.plsect - Mapdl.pmap - Mapdl.ppath - Mapdl.prange - Mapdl.prpath - Mapdl.prsect - Mapdl.psel - Mapdl.pvect + :template: base.rst + :toctree: _autosummary + + + PathOperations.fssect + PathOperations.padele + PathOperations.paget + PathOperations.paput + PathOperations.paresu + PathOperations.pasave + PathOperations.path + PathOperations.pcalc + PathOperations.pcross + PathOperations.pdef + PathOperations.pdot + PathOperations.plpagm + PathOperations.plpath + PathOperations.plsect + PathOperations.pmap + PathOperations.ppath + PathOperations.prange + PathOperations.prpath + PathOperations.prsect + PathOperations.psel + PathOperations.pvect diff --git a/doc/source/mapdl_commands/post1/results.rst b/doc/source/mapdl_commands/post1/results.rst index 22f57701a35..61d05206fa2 100644 --- a/doc/source/mapdl_commands/post1/results.rst +++ b/doc/source/mapdl_commands/post1/results.rst @@ -1,34 +1,38 @@ -.. _ref_results_api: -******* +.. _ref_results: + + Results -******* +======= + -.. currentmodule:: ansys.mapdl.core +.. currentmodule:: ansys.mapdl.core._commands.post1.results -These POST1 commands are used to process results, such as -degree-of-freedom results, nodal stresses, and element summable and -non-summable miscellaneous data. +.. autoclass:: ansys.mapdl.core._commands.post1.results.Results .. autosummary:: - :toctree: _autosummary/ - - Mapdl.nsort - Mapdl.nusort - Mapdl.plcint - Mapdl.pldisp - Mapdl.plesol - Mapdl.plnsol - Mapdl.plorb - Mapdl.prenergy - Mapdl.prorb - Mapdl.plvect - Mapdl.prcint - Mapdl.presol - Mapdl.prjsol - Mapdl.prnld - Mapdl.prnsol - Mapdl.prrfor - Mapdl.prrsol - Mapdl.prvect - Mapdl.sumtype + :template: base.rst + :toctree: _autosummary + + + Results.lcsum + Results.nsort + Results.nusort + Results.plcint + Results.plcksurf + Results.pldisp + Results.plesol + Results.plnsol + Results.plorb + Results.plvect + Results.prcint + Results.prenergy + Results.presol + Results.prjsol + Results.prnld + Results.prnsol + Results.prorb + Results.prrfor + Results.prrsol + Results.prvect + Results.sumtype diff --git a/doc/source/mapdl_commands/post1/set_up.rst b/doc/source/mapdl_commands/post1/set_up.rst new file mode 100644 index 00000000000..10d50cd3e92 --- /dev/null +++ b/doc/source/mapdl_commands/post1/set_up.rst @@ -0,0 +1,26 @@ + +.. _ref_set_up: + + +SetUp +===== + + +.. currentmodule:: ansys.mapdl.core._commands.post1.set_up + +.. autoclass:: ansys.mapdl.core._commands.post1.set_up.SetUp + +.. autosummary:: + :template: base.rst + :toctree: _autosummary + + + SetUp.append + SetUp.desol + SetUp.detab + SetUp.dnsol + SetUp.hrcplx + SetUp.rescombine + SetUp.reset + SetUp.set + SetUp.subset diff --git a/doc/source/mapdl_commands/post1/setup.rst b/doc/source/mapdl_commands/post1/setup.rst deleted file mode 100644 index b187c7d74b3..00000000000 --- a/doc/source/mapdl_commands/post1/setup.rst +++ /dev/null @@ -1,21 +0,0 @@ -.. _ref_setup_api: - -***** -Setup -***** - -.. currentmodule:: ansys.mapdl.core - -These POST1 commands are used to put data into the database for -postprocessing. - -.. autosummary:: - :toctree: _autosummary/ - - Mapdl.append - Mapdl.desol - Mapdl.dnsol - Mapdl.hrcplx - Mapdl.rescombine - Mapdl.subset - Mapdl.set diff --git a/doc/source/mapdl_commands/post1/special.rst b/doc/source/mapdl_commands/post1/special.rst deleted file mode 100644 index b79a31cdb3b..00000000000 --- a/doc/source/mapdl_commands/post1/special.rst +++ /dev/null @@ -1,49 +0,0 @@ -.. _ref_special Purpose_api: - -*************** -Special purpose -*************** - -.. currentmodule:: ansys.mapdl.core - -These POST1 commands are used for various special purposes. - -.. autosummary:: - :toctree: _autosummary/ - - Mapdl.bfint - Mapdl.cbdof - Mapdl.cmsfile - Mapdl.cyccalc - Mapdl.cycfiles - Mapdl.cycphase - Mapdl.cycspec - Mapdl.exoption - Mapdl.expand - Mapdl.exprofile - Mapdl.exunit - Mapdl.fssparm - Mapdl.fsum - Mapdl.hfang - Mapdl.hfsym - Mapdl.intsrf - Mapdl.kcalc - Mapdl.nforce - Mapdl.nldpost - Mapdl.plcamp - Mapdl.plcfreq - Mapdl.plchist - Mapdl.plfar - Mapdl.plmc - Mapdl.plnear - Mapdl.plzz - Mapdl.pras - Mapdl.prcamp - Mapdl.prfar - Mapdl.prnear - Mapdl.reswrite - Mapdl.rmflvec - Mapdl.rsplit - Mapdl.rstmac - Mapdl.spoint - Mapdl.spmwrite diff --git a/doc/source/mapdl_commands/post1/special_purpose.rst b/doc/source/mapdl_commands/post1/special_purpose.rst new file mode 100644 index 00000000000..7bc21631223 --- /dev/null +++ b/doc/source/mapdl_commands/post1/special_purpose.rst @@ -0,0 +1,56 @@ + +.. _ref_special_purpose: + + +SpecialPurpose +============== + + +.. currentmodule:: ansys.mapdl.core._commands.post1.special_purpose + +.. autoclass:: ansys.mapdl.core._commands.post1.special_purpose.SpecialPurpose + +.. autosummary:: + :template: base.rst + :toctree: _autosummary + + + SpecialPurpose.bfint + SpecialPurpose.cbdof + SpecialPurpose.cmsfile + SpecialPurpose.cyccalc + SpecialPurpose.cycfiles + SpecialPurpose.cycphase + SpecialPurpose.cycspec + SpecialPurpose.exoption + SpecialPurpose.expand + SpecialPurpose.exprofile + SpecialPurpose.exunit + SpecialPurpose.fssparm + SpecialPurpose.fsum + SpecialPurpose.hfang + SpecialPurpose.hfsym + SpecialPurpose.macopt + SpecialPurpose.nforce + SpecialPurpose.nldpost + SpecialPurpose.plas + SpecialPurpose.plcamp + SpecialPurpose.plcfreq + SpecialPurpose.plchist + SpecialPurpose.plfar + SpecialPurpose.plmc + SpecialPurpose.plnear + SpecialPurpose.plzz + SpecialPurpose.pras + SpecialPurpose.prcamp + SpecialPurpose.prfar + SpecialPurpose.prmc + SpecialPurpose.prnear + SpecialPurpose.reswrite + SpecialPurpose.rmflvec + SpecialPurpose.rsplit + SpecialPurpose.rstmac + SpecialPurpose.slashexpand + SpecialPurpose.spmwrite + SpecialPurpose.spoint + SpecialPurpose.vtkwrite diff --git a/doc/source/mapdl_commands/post1/status.rst b/doc/source/mapdl_commands/post1/status.rst index 447abdfddcd..87bbb6dc3f7 100644 --- a/doc/source/mapdl_commands/post1/status.rst +++ b/doc/source/mapdl_commands/post1/status.rst @@ -1,19 +1,26 @@ -.. _ref_status_post1: -****** +.. _ref_status: + + Status -****** +====== + -.. currentmodule:: ansys.mapdl.core +.. currentmodule:: ansys.mapdl.core._commands.post1.status -These POST1 commands are for use with the STAT command. +.. autoclass:: ansys.mapdl.core._commands.post1.status.Status .. autosummary:: - :toctree: _autosummary/ - - Mapdl.calc - Mapdl.datadef - Mapdl.display - Mapdl.lccalc - Mapdl.point - Mapdl.spec + :template: base.rst + :toctree: _autosummary + + + Status.calc + Status.datadef + Status.define + Status.display + Status.lccalc + Status.point + Status.print + Status.sort + Status.spec diff --git a/doc/source/mapdl_commands/post1/surface_operations.rst b/doc/source/mapdl_commands/post1/surface_operations.rst index 7f292a0cc6a..832d3fe11bf 100644 --- a/doc/source/mapdl_commands/post1/surface_operations.rst +++ b/doc/source/mapdl_commands/post1/surface_operations.rst @@ -1,26 +1,29 @@ -.. _ref_surface_operations_api: -****************** -Surface operations -****************** +.. _ref_surface_operations: -.. currentmodule:: ansys.mapdl.core -These POST1 commands are used to define an arbitrary surface and to -develop results information for that surface. +SurfaceOperations +================= + + +.. currentmodule:: ansys.mapdl.core._commands.post1.surface_operations + +.. autoclass:: ansys.mapdl.core._commands.post1.surface_operations.SurfaceOperations .. autosummary:: - :toctree: _autosummary/ - - Mapdl.sucalc - Mapdl.sucr - Mapdl.sudel - Mapdl.sueval - Mapdl.suget - Mapdl.sumap - Mapdl.supl - Mapdl.supr - Mapdl.suresu - Mapdl.susave - Mapdl.susel - Mapdl.suvect + :template: base.rst + :toctree: _autosummary + + + SurfaceOperations.sucalc + SurfaceOperations.sucr + SurfaceOperations.sudel + SurfaceOperations.sueval + SurfaceOperations.suget + SurfaceOperations.sumap + SurfaceOperations.supl + SurfaceOperations.supr + SurfaceOperations.suresu + SurfaceOperations.susave + SurfaceOperations.susel + SurfaceOperations.suvect diff --git a/doc/source/mapdl_commands/post1/trace_points.rst b/doc/source/mapdl_commands/post1/trace_points.rst index fa94cb96cb8..607ba87f662 100644 --- a/doc/source/mapdl_commands/post1/trace_points.rst +++ b/doc/source/mapdl_commands/post1/trace_points.rst @@ -1,18 +1,21 @@ -.. _ref_trace Points_api: -************ -Trace points -************ +.. _ref_trace_points: -.. currentmodule:: ansys.mapdl.core -These POST1 commands are used to trace particle motions in a flow -stream. +TracePoints +=========== + + +.. currentmodule:: ansys.mapdl.core._commands.post1.trace_points + +.. autoclass:: ansys.mapdl.core._commands.post1.trace_points.TracePoints .. autosummary:: - :toctree: _autosummary/ + :template: base.rst + :toctree: _autosummary + - Mapdl.pltrac - Mapdl.trpdel - Mapdl.trplis - Mapdl.trpoin + TracePoints.pltrac + TracePoints.trpdel + TracePoints.trplis + TracePoints.trpoin diff --git a/doc/source/mapdl_commands/post26/_set_up.rst b/doc/source/mapdl_commands/post26/_set_up.rst new file mode 100644 index 00000000000..51c82954568 --- /dev/null +++ b/doc/source/mapdl_commands/post26/_set_up.rst @@ -0,0 +1,18 @@ + +.. _ref__set_up: + + +SetUp +===== + + +.. currentmodule:: ansys.mapdl.core._commands.post26._set_up + +.. autoclass:: ansys.mapdl.core._commands.post26._set_up.SetUp + +.. autosummary:: + :template: base.rst + :toctree: _autosummary + + + SetUp.gapf diff --git a/doc/source/mapdl_commands/post26/controls.rst b/doc/source/mapdl_commands/post26/controls.rst index e1dd3a850d3..b65d74ec374 100644 --- a/doc/source/mapdl_commands/post26/controls.rst +++ b/doc/source/mapdl_commands/post26/controls.rst @@ -1,19 +1,20 @@ -.. _ref_post26_controls_api: -******** +.. _ref_controls: + + Controls -******** +======== -.. currentmodule:: ansys.mapdl.core -These POST26 commands are used to control the calculations of other -commands. +.. currentmodule:: ansys.mapdl.core._commands.post26.controls + +.. autoclass:: ansys.mapdl.core._commands.post26.controls.Controls .. autosummary:: - :toctree: _autosummary/ + :template: base.rst + :toctree: _autosummary + - Mapdl.cfact - Mapdl.force - Mapdl.layerp26 - Mapdl.shell - Mapdl.tvar + Controls.cfact + Controls.layerp26 + Controls.tvar diff --git a/doc/source/mapdl_commands/post26/display.rst b/doc/source/mapdl_commands/post26/display.rst index 974f4ab1663..f558de3d1a7 100644 --- a/doc/source/mapdl_commands/post26/display.rst +++ b/doc/source/mapdl_commands/post26/display.rst @@ -1,19 +1,23 @@ -.. _ref_display_api: -******* +.. _ref_display: + + Display -******* +======= + -.. currentmodule:: ansys.mapdl.core +.. currentmodule:: ansys.mapdl.core._commands.post26.display -These POST26 commands are used to display the results. +.. autoclass:: ansys.mapdl.core._commands.post26.display.Display .. autosummary:: - :toctree: _autosummary/ - - Mapdl.keep - Mapdl.plcplx - Mapdl.pltime - Mapdl.plvar - Mapdl.spread - Mapdl.xvar + :template: base.rst + :toctree: _autosummary + + + Display.keep + Display.plcplx + Display.pltime + Display.plvar + Display.spread + Display.xvar diff --git a/doc/source/mapdl_commands/post26/index.rst b/doc/source/mapdl_commands/post26/index.rst new file mode 100644 index 00000000000..3a21a42ca0c --- /dev/null +++ b/doc/source/mapdl_commands/post26/index.rst @@ -0,0 +1,30 @@ + +.. _ref_post26: + +Post26 +====== + +.. list-table:: + + * - :ref:`ref_operations` + * - :ref:`ref_set_up` + * - :ref:`ref_controls` + * - :ref:`ref_special_purpose` + * - :ref:`ref_listing` + * - :ref:`ref__set_up` + * - :ref:`ref_display` + * - :ref:`ref_status` + + +.. toctree:: + :maxdepth: 1 + :hidden: + + operations + set_up + controls + special_purpose + listing + _set_up + display + status diff --git a/doc/source/mapdl_commands/post26/listing.rst b/doc/source/mapdl_commands/post26/listing.rst index 70d6ca759a1..86a0d09a62f 100644 --- a/doc/source/mapdl_commands/post26/listing.rst +++ b/doc/source/mapdl_commands/post26/listing.rst @@ -1,20 +1,23 @@ -.. _ref_post26_listing_api: -******* +.. _ref_listing: + + Listing -******* +======= + -.. currentmodule:: ansys.mapdl.core +.. currentmodule:: ansys.mapdl.core._commands.post26.listing -These POST26 commands are used to produce tabular listings of the -results. +.. autoclass:: ansys.mapdl.core._commands.post26.listing.Listing .. autosummary:: - :toctree: _autosummary/ - - Mapdl.extrem - Mapdl.lines - Mapdl.nprint - Mapdl.prcplx - Mapdl.prtime - Mapdl.prvar + :template: base.rst + :toctree: _autosummary + + + Listing.extrem + Listing.lines + Listing.nprint + Listing.prcplx + Listing.prtime + Listing.prvar diff --git a/doc/source/mapdl_commands/post26/operations.rst b/doc/source/mapdl_commands/post26/operations.rst index 80cb615d09b..a346c30b701 100644 --- a/doc/source/mapdl_commands/post26/operations.rst +++ b/doc/source/mapdl_commands/post26/operations.rst @@ -1,31 +1,34 @@ -.. _ref_operations_api: -********** +.. _ref_operations: + + Operations -********** +========== + -.. currentmodule:: ansys.mapdl.core +.. currentmodule:: ansys.mapdl.core._commands.post26.operations -These POST26 commands are used to perform operations on the stored -variables. +.. autoclass:: ansys.mapdl.core._commands.post26.operations.Operations .. autosummary:: - :toctree: _autosummary/ - - Mapdl.abs - Mapdl.add - Mapdl.atan - Mapdl.clog - Mapdl.conjug - Mapdl.deriv - Mapdl.exp - Mapdl.filldata - Mapdl.imagin - Mapdl.int1 - Mapdl.large - Mapdl.nlog - Mapdl.prod - Mapdl.quot - Mapdl.realvar - Mapdl.small - Mapdl.sqrt + :template: base.rst + :toctree: _autosummary + + + Operations.abs + Operations.add + Operations.atan + Operations.clog + Operations.conjug + Operations.deriv + Operations.exp + Operations.filldata + Operations.imagin + Operations.int1 + Operations.large + Operations.nlog + Operations.prod + Operations.quot + Operations.realvar + Operations.small + Operations.sqrt diff --git a/doc/source/mapdl_commands/post26/set_up.rst b/doc/source/mapdl_commands/post26/set_up.rst new file mode 100644 index 00000000000..249be2edb2c --- /dev/null +++ b/doc/source/mapdl_commands/post26/set_up.rst @@ -0,0 +1,34 @@ + +.. _ref_set_up: + + +SetUp +===== + + +.. currentmodule:: ansys.mapdl.core._commands.post26.set_up + +.. autoclass:: ansys.mapdl.core._commands.post26.set_up.SetUp + +.. autosummary:: + :template: base.rst + :toctree: _autosummary + + + SetUp.ansol + SetUp.cisol + SetUp.data + SetUp.enersol + SetUp.esol + SetUp.gssol + SetUp.jsol + SetUp.nsol + SetUp.nstore + SetUp.numvar + SetUp.rforce + SetUp.rgb + SetUp.solu + SetUp.store + SetUp.timerange + SetUp.vardel + SetUp.varnam diff --git a/doc/source/mapdl_commands/post26/setup.rst b/doc/source/mapdl_commands/post26/setup.rst deleted file mode 100644 index a7fec0dc22d..00000000000 --- a/doc/source/mapdl_commands/post26/setup.rst +++ /dev/null @@ -1,34 +0,0 @@ -.. _ref_post26_setup_api: - -***** -Setup -***** - -.. currentmodule:: ansys.mapdl.core - -These POST26 commands are used to store data for processing. - -.. autosummary:: - :toctree: _autosummary/ - - Mapdl.ansol - Mapdl.cisol - Mapdl.data - Mapdl.edread - Mapdl.enersol - Mapdl.esol - Mapdl.file - Mapdl.gapf - Mapdl.gssol - Mapdl.jsol - Mapdl.nsol - Mapdl.nstore - Mapdl.numvar - Mapdl.reset - Mapdl.rforce - Mapdl.rgb - Mapdl.solu - Mapdl.store - Mapdl.timerange - Mapdl.vardel - Mapdl.varnam diff --git a/doc/source/mapdl_commands/post26/special.rst b/doc/source/mapdl_commands/post26/special.rst deleted file mode 100644 index 2864d00671e..00000000000 --- a/doc/source/mapdl_commands/post26/special.rst +++ /dev/null @@ -1,21 +0,0 @@ -.. _ref_special_purpose_api: - -*************** -Special purpose -*************** - -.. currentmodule:: ansys.mapdl.core - -These POST26 commands are used for various special purposes. - -.. autosummary:: - :toctree: _autosummary/ - - Mapdl.cvar - Mapdl.pmgtran - Mapdl.rcyc - Mapdl.resp - Mapdl.rpsd - Mapdl.smooth - Mapdl.vput - Mapdl.vget diff --git a/doc/source/mapdl_commands/post26/special_purpose.rst b/doc/source/mapdl_commands/post26/special_purpose.rst new file mode 100644 index 00000000000..9e73e770014 --- /dev/null +++ b/doc/source/mapdl_commands/post26/special_purpose.rst @@ -0,0 +1,25 @@ + +.. _ref_special_purpose: + + +SpecialPurpose +============== + + +.. currentmodule:: ansys.mapdl.core._commands.post26.special_purpose + +.. autoclass:: ansys.mapdl.core._commands.post26.special_purpose.SpecialPurpose + +.. autosummary:: + :template: base.rst + :toctree: _autosummary + + + SpecialPurpose.cvar + SpecialPurpose.pmgtran + SpecialPurpose.rcyc + SpecialPurpose.resp + SpecialPurpose.rpsd + SpecialPurpose.smooth + SpecialPurpose.vget + SpecialPurpose.vput diff --git a/doc/source/mapdl_commands/post26/status.rst b/doc/source/mapdl_commands/post26/status.rst index 1cdc8bbd714..c0c0bc463fb 100644 --- a/doc/source/mapdl_commands/post26/status.rst +++ b/doc/source/mapdl_commands/post26/status.rst @@ -1,17 +1,19 @@ -.. _ref_status_api: -****** +.. _ref_status: + + Status -****** +====== -.. currentmodule:: ansys.mapdl.core -These POST26 commands are for use with the STAT command. +.. currentmodule:: ansys.mapdl.core._commands.post26.status + +.. autoclass:: ansys.mapdl.core._commands.post26.status.Status .. autosummary:: - :toctree: _autosummary/ + :template: base.rst + :toctree: _autosummary + - Mapdl.define - Mapdl.operate - Mapdl.plotting - Mapdl.print + Status.operate + Status.plotting diff --git a/doc/source/mapdl_commands/reduced/generation.rst b/doc/source/mapdl_commands/reduced/generation.rst deleted file mode 100644 index f58ef020d0f..00000000000 --- a/doc/source/mapdl_commands/reduced/generation.rst +++ /dev/null @@ -1,28 +0,0 @@ -.. _ref_generation_pass_api: - -*************** -Generation pass -*************** - -.. currentmodule:: ansys.mapdl.core - -These commands are used to create a reduced order model. - -.. autosummary:: - :toctree: _autosummary/ - - Mapdl.rmalist - Mapdl.rmanl - Mapdl.rmaster - Mapdl.rmcap - Mapdl.rmclist - Mapdl.rmmlist - Mapdl.rmmrange - Mapdl.rmmselect - Mapdl.rmporder - Mapdl.rmrgenerate - Mapdl.rmroptions - Mapdl.rmrplot - Mapdl.rmrstatus - Mapdl.rmsmple - Mapdl.rmxport diff --git a/doc/source/mapdl_commands/reduced/preparation.rst b/doc/source/mapdl_commands/reduced/preparation.rst deleted file mode 100644 index 4440cf01d9d..00000000000 --- a/doc/source/mapdl_commands/reduced/preparation.rst +++ /dev/null @@ -1,16 +0,0 @@ -.. _ref_preparation_api: - -*********** -Preparation -*********** - -.. currentmodule:: ansys.mapdl.core - -These commands are used to create the input files for the ROM -Generation Pass. - -.. autosummary:: - :toctree: _autosummary/ - - Mapdl.rmndisp - Mapdl.rmnevec diff --git a/doc/source/mapdl_commands/reduced/setup.rst b/doc/source/mapdl_commands/reduced/setup.rst deleted file mode 100644 index 4f6245126bc..00000000000 --- a/doc/source/mapdl_commands/reduced/setup.rst +++ /dev/null @@ -1,15 +0,0 @@ -.. _ref_reduced_setup_api: - -***** -Setup -***** - -.. currentmodule:: ansys.mapdl.core - -These commands are used to save or resume the ROM database. - -.. autosummary:: - :toctree: _autosummary/ - - Mapdl.rmresume - Mapdl.rmsave diff --git a/doc/source/mapdl_commands/reduced/use_pass.rst b/doc/source/mapdl_commands/reduced/use_pass.rst deleted file mode 100644 index a327851fea9..00000000000 --- a/doc/source/mapdl_commands/reduced/use_pass.rst +++ /dev/null @@ -1,16 +0,0 @@ -.. _ref_use_pass_api: - -******** -Use pass -******** - -.. currentmodule:: ansys.mapdl.core - -These commands use the reduced order model in an analysis. - -.. autosummary:: - :toctree: _autosummary/ - - Mapdl.dcvswp - Mapdl.rmlvscale - Mapdl.rmuse diff --git a/doc/source/mapdl_commands/session/files.rst b/doc/source/mapdl_commands/session/files.rst index 9e65c19d571..bc00c7e9c95 100644 --- a/doc/source/mapdl_commands/session/files.rst +++ b/doc/source/mapdl_commands/session/files.rst @@ -1,25 +1,29 @@ -.. _ref_files_commands_api: -***** +.. _ref_files: + + Files -***** +===== + -.. currentmodule:: ansys.mapdl.core +.. currentmodule:: ansys.mapdl.core._commands.session.files -These SESSION commands are for file operations, such as deleting, -copying, and listing. +.. autoclass:: ansys.mapdl.core._commands.session.files.Files .. autosummary:: - :toctree: _autosummary/ - - Mapdl.anstoaqwa - Mapdl.anstoasas - Mapdl.assign - Mapdl.copy - Mapdl.slashdelete - Mapdl.fcomp - Mapdl.lgwrite - Mapdl.starlist - Mapdl.slashclog - Mapdl.slashfdele - Mapdl.rename + :template: base.rst + :toctree: _autosummary + + + Files.anstoaqwa + Files.anstoasas + Files.assign + Files.copy + Files.fclean + Files.fcomp + Files.lgwrite + Files.slashclog + Files.slashdelete + Files.slashfdele + Files.slashrename + Files.starlist diff --git a/doc/source/mapdl_commands/session/index.rst b/doc/source/mapdl_commands/session/index.rst new file mode 100644 index 00000000000..9218113b637 --- /dev/null +++ b/doc/source/mapdl_commands/session/index.rst @@ -0,0 +1,22 @@ + +.. _ref_session: + +Session +======= + +.. list-table:: + + * - :ref:`ref_files` + * - :ref:`ref_list_controls` + * - :ref:`ref_run_controls` + * - :ref:`ref_processor_entry` + + +.. toctree:: + :maxdepth: 1 + :hidden: + + files + list_controls + run_controls + processor_entry diff --git a/doc/source/mapdl_commands/session/list_controls.rst b/doc/source/mapdl_commands/session/list_controls.rst index d555443cd9f..56805db46fa 100644 --- a/doc/source/mapdl_commands/session/list_controls.rst +++ b/doc/source/mapdl_commands/session/list_controls.rst @@ -1,18 +1,23 @@ -.. _ref_list_controls_commands_api: -************* -List controls -************* +.. _ref_list_controls: -.. currentmodule:: ansys.mapdl.core -These SESSION commands are used to control listings and printed program output. +ListControls +============ + + +.. currentmodule:: ansys.mapdl.core._commands.session.list_controls + +.. autoclass:: ansys.mapdl.core._commands.session.list_controls.ListControls .. autosummary:: - :toctree: _autosummary/ + :template: base.rst + :toctree: _autosummary + - Mapdl.com - Mapdl.golist - Mapdl.gopr - Mapdl.nolist - Mapdl.nopr + ListControls.com + ListControls.golist + ListControls.gopr + ListControls.nolist + ListControls.nopr + ListControls.slashgo diff --git a/doc/source/mapdl_commands/session/processor_entry.rst b/doc/source/mapdl_commands/session/processor_entry.rst index 0cb79b4962e..42810f8a076 100644 --- a/doc/source/mapdl_commands/session/processor_entry.rst +++ b/doc/source/mapdl_commands/session/processor_entry.rst @@ -1,24 +1,23 @@ -.. _ref_processor_entry_commands_api: -*************** -Processor entry -*************** +.. _ref_processor_entry: -.. currentmodule:: ansys.mapdl.core -These SESSION commands are used to enter and exit the various processors in the program. +ProcessorEntry +============== + + +.. currentmodule:: ansys.mapdl.core._commands.session.processor_entry + +.. autoclass:: ansys.mapdl.core._commands.session.processor_entry.ProcessorEntry .. autosummary:: - :toctree: _autosummary/ - - Mapdl.aux2 - Mapdl.aux3 - Mapdl.aux12 - Mapdl.aux15 - Mapdl.finish - Mapdl.map - Mapdl.post1 - Mapdl.post26 - Mapdl.prep7 - Mapdl.quit - Mapdl.slashsolu + :template: base.rst + :toctree: _autosummary + + + ProcessorEntry.finish + ProcessorEntry.post1 + ProcessorEntry.post26 + ProcessorEntry.prep7 + ProcessorEntry.quit + ProcessorEntry.slashsolu diff --git a/doc/source/mapdl_commands/session/run_controls.rst b/doc/source/mapdl_commands/session/run_controls.rst index 056810bc946..d3fe196843c 100644 --- a/doc/source/mapdl_commands/session/run_controls.rst +++ b/doc/source/mapdl_commands/session/run_controls.rst @@ -1,29 +1,34 @@ -.. _ref_run_controls_commands_api: -************ -Run controls -************ +.. _ref_run_controls: -.. currentmodule:: ansys.mapdl.core -These SESSION commands control the overall characteristics of the -session, including the job name, Graphical User Interface behavior, and -file switching. +RunControls +=========== + + +.. currentmodule:: ansys.mapdl.core._commands.session.run_controls + +.. autoclass:: ansys.mapdl.core._commands.session.run_controls.RunControls .. autosummary:: - :toctree: _autosummary/ - - Mapdl.config - Mapdl.cwd - Mapdl.exit - Mapdl.filname - Mapdl.input - Mapdl.keyw - Mapdl.memm - Mapdl.nerr - Mapdl.pause - Mapdl.slashstatus - Mapdl.starstatus - Mapdl.syp - Mapdl.sys - Mapdl.unpause + :template: base.rst + :toctree: _autosummary + + + RunControls.config + RunControls.cwd + RunControls.filname + RunControls.input + RunControls.keyw + RunControls.memm + RunControls.menu + RunControls.mstart + RunControls.nerr + RunControls.output + RunControls.pause + RunControls.slashstatus + RunControls.syp + RunControls.sys + RunControls.ui + RunControls.uis + RunControls.unpause diff --git a/doc/styles/config/vocabularies/ANSYS/accept.txt b/doc/styles/config/vocabularies/ANSYS/accept.txt index b75472ead23..f6d8aa92471 100644 --- a/doc/styles/config/vocabularies/ANSYS/accept.txt +++ b/doc/styles/config/vocabularies/ANSYS/accept.txt @@ -87,6 +87,7 @@ Hashin hexahedral hostname HTML +Iges Image[Mm]agick imagin importlib diff --git a/pyproject.toml b/pyproject.toml index 302eba1ec81..b6504d499ab 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -93,6 +93,7 @@ doc = [ "jupyter==1.1.1", "jupyter_sphinx==0.5.3", "jupyterlab>=3.2.8", + "linuxdoc==20240924", "matplotlib==3.10.3", "nbformat==5.10.4", "numpydoc==1.9.0", @@ -178,7 +179,7 @@ show_missing = true ignore-regex = ".*codespell-ignore$|NORML|POIN" ignore-words = "doc/styles/config/vocabularies/ANSYS/accept.txt" quiet-level = 3 -skip = '*.pyc,*.txt,*.gif,*.png,*.jpg,*.js,*.html,*.doctree,*.ttf,*.woff,*.woff2,*.eot,*.mp4,*.inv,*.pickle,*.ipynb,flycheck*,./.git/*,./.hypothesis/*,*.yml,./doc/build/*,./doc/images/*,./dist/*,*~,.hypothesis*,./doc/source/examples/*,*cover,*.dat,*.mac,*.cdb,*.CDB,build,./docker/mapdl/v*,./factory/*,./ansys/mapdl/core/mapdl_functions.py,PKG-INFO,*.mypy_cache/*,./docker/mapdl/*,./_unused/*' +skip = '*.pyc,*.txt,*.gif,*.png,*.jpg,*.js,*.html,*.doctree,*.ttf,*.woff,*.woff2,*.eot,*.mp4,*.inv,*.pickle,*.ipynb,flycheck*,./.git/*,./.hypothesis/*,*.yml,./doc/build/*,./doc/images/*,./dist/*,*~,.hypothesis*,./doc/source/examples/*,*cover,*.dat,*.mac,*.cdb,*.CDB,build,./docker/mapdl/v*,./factory/*,./ansys/mapdl/core/mapdl_functions.py,PKG-INFO,*.mypy_cache/*,./docker/mapdl/*,./_unused/*,src/ansys/mapdl/core/_commands/*' [tool.numpydoc_validation] checks = [ diff --git a/src/ansys/mapdl/core/_commands/apdl/__init__.py b/src/ansys/mapdl/core/_commands/apdl/__init__.py index dfdea9c4571..0b2b9772bca 100644 --- a/src/ansys/mapdl/core/_commands/apdl/__init__.py +++ b/src/ansys/mapdl/core/_commands/apdl/__init__.py @@ -22,9 +22,10 @@ from . import ( abbreviations, - array_param, + array_parameters, + encryption_decryption, macro_files, - matrix_op, + matrix_operations, parameter_definition, process_controls, ) diff --git a/src/ansys/mapdl/core/_commands/apdl/abbreviations.py b/src/ansys/mapdl/core/_commands/apdl/abbreviations.py index 9958ac932ab..e9736dc81a6 100644 --- a/src/ansys/mapdl/core/_commands/apdl/abbreviations.py +++ b/src/ansys/mapdl/core/_commands/apdl/abbreviations.py @@ -22,169 +22,262 @@ class Abbreviations: - def abbr(self, abbr="", string="", **kwargs): - """Defines an abbreviation. - APDL Command: ``*ABBR`` + def abbr(self, abbr: str = "", string: str = "", **kwargs): + r"""Defines an abbreviation. + + Mechanical APDL Command: `\*ABBR `_ 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 ``C***``, :ref:`com`, :ref:`gopr`, :ref:`nopr`, :ref:`quit`, :ref:`ui`, or :ref:`end`. + Parameter names and commands of the ``*DO`` and 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 ( :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. + + .. warning:: + + This function contains specificities regarding the argument definitions. + Please refer to the `command documentation `_ + for further explanations. + + **Argument Descriptions** + + .. _a-ABBR_argdescript: + + * ``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 ``C***``, :ref:`com`, :ref:`gopr`, :ref:`nopr`, :ref:`quit`, :ref:`ui`, or + :ref:`end`. Parameter names and commands of the ``*DO`` and 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 ( :ref:`use` ) + containing the desired commands. + + .. _a-ABBR_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 :ref:`starstatus` 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:`FileLOG`. 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: str = "", fname: str = "", ext: str = "", **kwargs): + r"""Reads abbreviations from a coded file. - APDL Command: ABBRES + Mechanical APDL Command: `ABBRES `_ 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 :file:`Jobname`. - ext - Filename extension (eight-character maximum). + 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. + + .. warning:: + + This function contains specificities regarding the argument definitions. + Please refer to the `command documentation `_ + for further explanations. + + **Argument Descriptions** + + .. _pmabbresargdescript: + + * ``lab : str`` - Label that specifies the read operation: + + * ``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. + + * ``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 :file:`Jobname`. + + * ``ext : str`` - Filename extension (eight-character maximum). The extension defaults to ABBR if + ``Fname`` is blank. + + .. _abbres_notes: + + 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}" 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: str = "", fname: str = "", ext: str = "", **kwargs): + r"""Writes the current abbreviation set to a coded file. - APDL Command: ABBSAV + Mechanical APDL Command: `ABBSAV `_ Parameters ---------- - lab - Label that specifies the write operation. + lab : str + Label that specifies the write operation: - ALL - Write all abbreviations (default). + * ``ALL`` - Write all abbreviations (default). - 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 :file:`Jobname`. - 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. + + .. warning:: + + This function contains specificities regarding the argument definitions. + Please refer to the `command documentation `_ + for further explanations. + + **Argument Descriptions** + + .. _ABBSAV_argdescript: + + * ``lab : str`` - Label that specifies the write operation: + + * ``ALL`` - Write all abbreviations (default). + + * ``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 :file:`Jobname`. + + * ``ext : str`` - Filename extension (eight-character maximum). The extension defaults to ABBR if + ``Fname`` is blank. + + .. _ABBSAV_notes: + + 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}" return self.run(command, **kwargs) - def ucmd(self, cmd="", srnum="", **kwargs): - """Assigns a user-defined command name. + def ucmd(self, cmd: str = "", srnum: str = "", **kwargs): + r"""Assigns a user-defined command name. - APDL Command: /UCMD + Mechanical APDL Command: `/UCMD `_ 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. + + .. warning:: + + This function contains specificities regarding the argument definitions. + Please refer to the `command documentation `_ + for further explanations. + + **Argument Descriptions** + + .. _s-UCMD_argdescript: + + * ``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. + + .. _s-UCMD_notes: + + 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 + `_ 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 :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) + `_ + `Guide to User-Programmable Features + `_ + + See :ref:`ulib` for another way of defining user commands. This command is valid only at the Begin Level. """ diff --git a/src/ansys/mapdl/core/_commands/apdl/array_param.py b/src/ansys/mapdl/core/_commands/apdl/array_param.py deleted file mode 100644 index 31f255b8958..00000000000 --- a/src/ansys/mapdl/core/_commands/apdl/array_param.py +++ /dev/null @@ -1,1535 +0,0 @@ -# Copyright (C) 2016 - 2025 ANSYS, Inc. and/or its affiliates. -# SPDX-License-Identifier: MIT -# -# -# Permission is hereby granted, free of charge, to any person obtaining a copy -# of this software and associated documentation files (the "Software"), to deal -# in the Software without restriction, including without limitation the rights -# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -# copies of the Software, and to permit persons to whom the Software is -# furnished to do so, subject to the following conditions: -# -# The above copyright notice and this permission notice shall be included in all -# copies or substantial portions of the Software. -# -# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -# SOFTWARE. - - -class ArrayParam: - def mfouri(self, oper="", coeff="", mode="", isym="", theta="", curve="", **kwargs): - """Calculates the coefficients for, or evaluates, a Fourier series. - - APDL Command: ``*MFOURI`` - - Parameters - ---------- - oper - Type of Fourier operation: - - FIT - Calculate Fourier coefficients COEFF from MODE, ISYM, - THETA, and CURVE. - - EVAL - Evaluate the Fourier curve CURVE from - COEFF, MODE, ISYM and THETA. - - coeff - Name of the array parameter vector containing the Fourier - coefficients (calculated if Oper = FIT, required as input if Oper = - EVAL). See ``*SET`` for name restrictions. - - mode - Name of the array parameter vector containing the mode numbers of - the desired Fourier terms. - - isym - Name of the array parameter vector containing the symmetry key for - the corresponding Fourier terms. The vector should contain keys - for each term as follows: - - 0 or 1 - Symmetric (cosine) term - - -1 - Antisymmetric (sine) term. - - theta, curve - Names of the array parameter vectors containing the theta vs. curve - description, respectively. Theta values should be input in - degrees. If Oper = FIT, one curve value should be supplied with - each theta value. If Oper = EVAL, one curve value will be - calculated for each theta value. - - Notes - ----- - Calculates the coefficients of a Fourier series for a given - curve, or evaluates the Fourier curve from the given (or - previously calculated) coefficients. The lengths of the - COEFF, MODE, and ISYM vectors must be the same--typically two - times the number of modes desired, since two terms (sine and - cosine) are generally required for each mode. The lengths of - the CURVE and THETA vectors should be the same or the smaller - of the two will be used. There should be a sufficient number - of points to adequately define the curve--at least two times - the number of coefficients. A starting array element number - (1) must be defined for each array parameter vector. - - The vector specifications ``*VLEN``, ``*VCOL``, ``*VABS``, - ``*VFACT``, and ``*VCUM`` do not apply to this command. Array - elements should not be skipped with the ``*VMASK`` and the - NINC value of the ``*VLEN`` specifications. The vector being - calculated (COEFF if Oper is FIT, or CURVE if Oper is EVAL) - must exist as a dimensioned array [``*DIM``]. - - This command is valid in any processor. - """ - command = f"*MFOURI,{oper},{coeff},{mode},{isym},{theta},{curve}" - return self.run(command, **kwargs) - - def mfun(self, parr="", func="", par1="", **kwargs): - """Copies or transposes an array parameter matrix. - - APDL Command: ``*MFUN`` - - Parameters - ---------- - parr - The name of the resulting array parameter matrix. See ``*SET`` for - name restrictions. - - func - Copy or transpose function: - - Par1 is copied to ParR - Par1 is transposed to ParR. Rows - (m) and columns (n) of Par1 matrix are transposed to - resulting ParR matrix of shape (n,m). - - par1 - Array parameter matrix input to the operation. - - Notes - ----- - Operates on one input array parameter matrix and produces one output - array parameter matrix according to: - - ParR = f(Par1) - - where the function (f) is either a copy or transpose, as described - above. - - Functions are based on the standard FORTRAN definitions where - possible. ParR may be the same as Par1. Starting array - element numbers must be defined for each array parameter - matrix if it does not start at the first location. For - example, ``*MFUN,A(1,5),COPY,B(2,3)`` copies matrix B - (starting at element (2,3)) to matrix A (starting at element - (1,5)). The diagonal corner elements for each submatrix must - be defined: the upper left corner by the array starting - element (on this command), the lower right corner by the - current values from the ``*VCOL`` and ``*VLEN`` commands. The - default values are the (1,1) element and the last element in - the matrix. No operations progress across matrix planes (in - the 3rd dimension). Absolute values and scale factors may be - applied to all parameters [``*VABS``, ``*VFACT``]. Results - may be cumulative [``*VCUM``]. - - Array elements should not be skipped with the ``*VMASK`` and the - NINC value of the ``*VLEN`` specifications. The number of - rows [``*VLEN``] applies to the Par1 array. See the - ``*VOPER`` command for details. - - This command is valid in any processor. - """ - command = f"*MFUN,{parr},{func},{par1}" - return self.run(command, **kwargs) - - def moper( - self, - parr="", - par1="", - oper="", - val1="", - val2="", - val3="", - val4="", - val5="", - val6="", - **kwargs, - ): - """Performs matrix operations on array parameter matrices. - - APDL Command: ``*MOPER`` - - Parameters - ---------- - parr - The name of the resulting array parameter matrix. See ``*SET`` for - name restrictions. - - par1 - First array parameter matrix input to the operation. For ``Oper = - MAP``, this is an ``N`` x 3 array of coordinate locations at which to - interpolate. ``ParR`` will then be an ``N(out)`` x ``M`` array containing the - interpolated values. - - oper - Matrix operations: - - * `INVERT` - ``(*MOPER, ParR, Par1, INVERT)`` - Square matrix invert: Inverts the ``n`` x ``n`` matrix in ``Par1`` - into ``ParR``. The matrix must be well conditioned. - - .. warning:: - - Non-independent or ill-conditioned equations can - cause erroneous results. - - For large matrices, use the - APDL Math operation ``*LSFACTOR`` for efficiency (see APDL - Math). - - * `MULT` - ``(*MOPER, ParR, Par1, MULT, Par2)`` - Matrix multiply: Multiplies ``Par1`` by ``Par2``. The number of - rows of ``Par2`` must equal the number of columns of ``Par1`` for - the operation. If ``Par2`` is input with a number of rows - greater than the number of columns of ``Par1``, matrices are - still multiplied. However, the operation only uses a - number of rows of ``Par2`` equal to the number of columns of - ``Par1``. - - * `COVAR` - ``(*MOPER, ParR, Par1, COVAR, Par2)`` - Covariance: The measure of association between two columns - of the input matrix (``Par1``). ``Par1``, of size m runs (rows) - by ``n`` data (columns) is first processed to produce a row - vector containing the mean of each column which is - transposed to a column vector (``Par2``) of n array elements. - The ``Par1`` and ``Par2`` operation then produces a resulting ``n`` x - ``n`` matrix (``ParR``) of covariances (with the variances as the - diagonal terms). - - * `CORR` - ``(*MOPER, ParR, Par1, CORR, Par2)`` - Correlation: The correlation coefficient between two - variables. The input matrix (``Par1``), of size m runs (rows) - by n data (columns), is first processed to produce a row - vector containing the mean of each column which is then - transposed to a column vector (``Par2``) of n array elements. - The ``Par1`` and ``Par2`` operation then produces a resulting ``n`` x - ``n`` matrix (``ParR``) of correlation coefficients (with a value - of 1.0 for the diagonal terms). - - * `SOLV` - ``(*MOPER, ParR, Par1, SOLV, Par2)`` - Solution of simultaneous equations: Solves the set of ``n`` - equations of n terms of the form ``an_1 x_1 + an_2 x_2 + ... + - an_n x_n = b_n`` where ``Par1`` contains the matrix of - a-coefficients, ``Par2`` the vector(s) of b-values, and ``ParR`` - the vector(s) of x-results. ``Par1`` must be a square matrix. - The equations must be linear, independent, and well - conditioned. - - **Warning**: Non-independent or ill-conditioned equations can - cause erroneous results. - For large matrices, use the - APDL Math operation ``*LSFACTOR`` for efficiency (see APDL - Math). - - * `SORT` - ``(*MOPER, ParR, Par1, SORT, Par2, n1, n2, n3)`` - Matrix sort: Sorts matrix ``Par1`` according to sort vector - ``Par2`` and places the result back in ``Par1``. Rows of ``Par1`` are - moved to the corresponding positions indicated by the - values of ``Par2``. ``Par2`` may be a column of ``Par1`` (in which - case it will also be reordered). Alternatively, you may - specify the column of ``Par1`` to sort using n1 (leaving ``Par2`` - blank). A secondary sort can be specified by column ``n2``, - and a third sort using ``n3``. ``ParR`` is the vector of initial - row positions (the permutation vector). Sorting ``Par1`` - according to ``ParR`` should reproduce the initial ordering. - - * `NNEAR` - ``(*MOPER, ParR, Par1, NNEAR, Toler)`` - Nearest Node: Quickly determine all the nodes within a - specified tolerance of a given array. ``ParR`` is a vector of - the nearest selected nodes, or 0 if no nodes are nearer - than ``Toler``. ``Par1`` is the ``n`` x 3 array of coordinate - locations. ``Toler`` defaults to 1 and is limited to the - maximum model size. - - * `ENEAR` - ``(*MOPER, ``ParR``, ``Par1``, ENEAR, Toler)`` - Nearest Element: Quickly determine the elements with - centroids that are within a specified tolerance of the - points in a given array. - ``ParR`` is a vector of the nearest - selected elements, or 0 if no element centroids are nearer - than ``Toler``. ``Par1`` is the ``n`` x 3 array of coordinate - locations. - - * `MAP` - ``(*MOPER, ParR, Par1, MAP, Par2, Par3, kDim, --, kOut, LIMIT)`` - Maps the results from one set of points to another. For - example, you can map pressures from a CFD analysis onto - your model for a structural analysis. - - * ``Par1`` is the ``Nout`` x 3 array of points that will be mapped - to. ``Par2`` is the ``Nin`` x ``M`` array that contains ``M`` values of - data to be interpolated at each point and corresponds to - the ``Nin`` x 3 points in ``Par3``. The resulting ``ParR`` is the ``Nout`` - x ``M`` array of mapped data points. - - For each point in the destination mesh, all possible - triangles in the source mesh are searched to find the best - triangle containing each point. It then does a linear - interpolation inside this triangle. You should carefully - specify your interpolation method and search criteria in - order to provide faster and more accurate results (see - ``LIMIT``, below). - - * ``kDim`` is the interpolation criteria. If ``kDim = 2 or 0``, two - dimensional interpolation is applied (interpolate on a - surface). If ``kDim = 3``, three dimensional interpolation is - applied (interpolate on a volume). - - * ``kOut`` specified how points outside of the domain are - handled. If ``kOut`` = 0, use the value(s) of the nearest - region point for points outside of the region. If ```kOut``` = - 1, set results outside of the region to zero. - - * `LIMIT` specifies the number of nearby points considered for - interpolation. The default is 20, and the minimum is - 5. Lower values will reduce processing time; however, some - distorted or irregular sets of points will require a - higher ``LIMIT`` value to encounter three nodes for - triangulation. - - Output points are incorrect if they are not within the - domain (area or volume) defined by the specified input - points. Also, calculations for out-of-bound points require - much more processing time than do points that are within - bounds. Results mapping is available from the command line - only. - - * `INTP` - ``(*MOPER, ParR, Par1, INTP, Par2)`` - Finds the elements that contain each point in the array of - ``n`` x 3 points in ``Par1``. ``Par2`` will contain the set of element - ID numbers and ``ParR`` will contain their ``n`` x 3 set of - natural element coordinates (values between -1 and - 1). ``Par1`` must be in global Cartesian coordinates. - - * `SGET` - ``(*MOPER, ParR, Par1, SGET, Par2, Label, Comp)`` - Gets the nodal solution item corresponding to Label and - Comp (see the PLNSOL command) and interpolates it to the - given element locations. ``Par1`` contains the ``n`` x 3 array of - natural element coordinates (values between -1 and 1) of - the ``n`` element ID numbers in ``Par2``. ``Par1`` and ``Par2`` are - usually the output of the ``*MOPER,,,INTP`` operation. ``ParR`` - contains the ``n`` interpolated results. - - * ``Val1, Val2, ..., Val6`` - Additional input used in the operation. The meanings of - ``Val1`` through ``Val6`` vary depending on the specified matrix - operation. See the description of Oper for details. - """ - command = ( - f"*MOPER,{parr},{par1},{oper},{val1},{val2},{val3},{val4},{val5},{val6}" - ) - return self.run(command, **kwargs) - - def mwrite( - self, parr="", fname="", ext="", label="", n1="", n2="", n3="", **kwargs - ): - """Writes a matrix to a file in a formatted sequence. - - APDL Command: ``*MWRITE`` - - .. warning:: - This command cannot be run interactively. See - :func:`non_interactive `. - - Parameters - ---------- - parr - The name of the array parameter. See ``*SET`` for name restrictions. - - 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. - - ext - Filename extension (eight-character maximum). - - label - Can use a value of ``IJK``, ``IKJ``, ``JIK``, ``JKI``, ``KIJ``, ``KJI``, or blank (``JIK``). - - n1, n2, n3 - Write as ``(((ParR(i,j,k), k = 1,n1), i = 1, n2), j = 1, n3)`` for - ``Label = KIJ``. ``n1``, ``n2``, and ``n3`` default to the corresponding dimensions - of the array parameter ParR. - - Notes - ----- - Writes a matrix or vector to a specified file in a formatted sequence. - You can also use the ``*VWRITE`` command to write data to a specified file. - Both commands contain format descriptors on the line immediately - following the command. The format descriptors can be in either Fortran - or C format. - - Fortran format descriptors are enclosed in parentheses. They must - immediately follow the ``*MWRITE`` command on a separate line of the same - input file. The word FORMAT should not be included. The format must - specify the number of fields to be written per line, the field width, - the placement of the decimal point, etc. There should be one field - descriptor for each data item written. The write operation uses the - available system FORTRAN FORMAT conventions (see your system FORTRAN - manual). Any standard FORTRAN real format (such as (4F6.0), - (E10.3,2X,D8.2), etc.) and character format (A) may be used. Integer - (I) and list-directed (``*``) descriptors may not be used. Text may be - included in the format as a quoted string. The FORTRAN descriptor must - be enclosed in parentheses and the format must not exceed 80 characters - (including parentheses). - - The "C" format descriptors are used if the first character of the - format descriptor line is not a left parenthesis. "C" format - descriptors may be up to 80 characters long, consisting of text strings - and predefined "data descriptors" between the strings where numeric or - alphanumeric character data are to be inserted. The normal descriptors - are %I for integer data, %G for double precision data, %C for - alphanumeric character data, and %/ for a line break. There must be one - data descriptor for each specified value in the order of the specified - values. The enhanced formats described in ``*MSG`` may also be used. - - The starting array element number must be defined. Looping continues in - the directions indicated by the Label argument. The number of loops and - loop skipping may also be controlled with the ``*VLEN`` and ``*VMASK`` - commands, which work in the n2 direction (by row on the output file), - and by the ``*VCOL`` command, which works in the n1 direction (by column - in the output file). The vector specifications ``*VABS`` and ``*VFACT`` apply - to this command, while ``*VCUM`` does not apply to this command. See the - ``*VOPER`` command for details. If you are in the GUI, the ``*MWRITE`` command - must be contained in an externally prepared file and read into ANSYS - (i.e., ``*USE``, ``/INPUT``, etc.). - - This command is valid in any processor. - """ - command = f"*MWRITE,{parr},{fname},{ext},,{label},{n1},{n2},{n3}" - return self.run(command, **kwargs) - - def starvput( - self, - parr="", - entity="", - entnum="", - item1="", - it1num="", - item2="", - it2num="", - kloop="", - **kwargs, - ): - """Restores array parameter values into the ANSYS database. - - APDL Command: ``*VPUT`` - - Parameters - ---------- - parr - The name of the input vector array parameter. See ``*SET`` for name - restrictions. The parameter must exist as a dimensioned array - [``*DIM``] with data input. - - entity - Entity keyword. Valid keywords are shown for Entity = in the table - below. - - entnum - The number of the entity (as shown for ENTNUM= in the table below). - - item1 - The name of a particular item for the given entity. Valid items - are as shown in the Item1 columns of the table below. - - it1num - The number (or label) for the specified Item1 (if any). Valid - IT1NUM values are as shown in the IT1NUM columns of the table - below. Some Item1 labels do not require an IT1NUM value. - - item2, it2num - A second set of item labels and numbers to further qualify the item - for which data is to be stored. Most items do not require this - level of information. - - kloop - Field to be looped on: - - Loop on the ENTNUM field (default). - Loop on the Item1 field. - - Loop on the IT1NUM field. Successive items are as shown with IT1NUM. - Loop on the Item2 field. - - Notes - ----- - The ``*VPUT`` command is not supported for PowerGraphics - displays. Inconsistent results may be obtained if this - command is not used in /GRAPHICS, FULL. - - Plot and print operations entered via the GUI (Utility Menu> - Pltcrtls, Utility Menu> Plot) incorporate the AVPRIN - command. This means that the principal and equivalent values - are recalculated. If you use ``*VPUT`` to put data back into - the database, issue the plot commands from the command line to - preserve your data. - - This operation is basically the inverse of the ``*VGET`` - operation. Vector items are put directly (without any - coordinate system transformation) into the ANSYS database. - Items can only replace existing items of the database and not - create new items. Degree of freedom results that are replaced - in the database are available for all subsequent - postprocessing operations. Other results are changed - temporarily and are available mainly for the immediately - following print and display operations. The vector - specification ``*VCUM`` does not apply to this command. The - valid labels for the location fields (Entity, ENTNUM, Item1, - and IT1NUM) are listed below. Item2 and IT2NUM are not - currently used. Not all items from the ``*VGET`` list are - allowed on ``*VPUT`` since putting values into some locations - could cause the database to be inconsistent. - - This command is valid in any processor. - - """ - command = ( - f"*VPUT,{parr},{entity},{entnum},{item1},{it1num},{item2},{it2num},{kloop}" - ) - return self.run(command, **kwargs) - - def sread( - self, - strarray="", - fname="", - ext="", - nchar="", - nskip="", - nread="", - **kwargs, - ): - """Reads a file into a string array parameter. - - APDL Command: ``*SREAD`` - - Parameters - ---------- - strarray - Name of the "string array" parameter which will hold the read file. - String array parameters are similar to character arrays, but each - array element can be as long as 128 characters. If the string - parameter does not exist, it will be created. The array will be - created as: ``*DIM,StrArray,STRING,nChar,nRead``` - - 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. - - ext - Filename extension (eight-character maximum). - - nchar - Number of characters per line to read (default is length of the - longest line in the file). - - nskip - Number of lines to skip at the start of the file (default is 0). - - nread - Number of lines to read from the file (default is the entire file). - - Notes - ----- - The ``*SREAD`` command reads from a file into a string array - parameter. The file must be an ASCII text file. - """ - command = f"*SREAD,{strarray},{fname},{ext},,{nchar},{nskip},{nread}" - return self.run(command, **kwargs) - - def toper( - self, - parr="", - par1="", - oper="", - par2="", - fact1="", - fact2="", - con1="", - **kwargs, - ): - """Operates on table parameters. - - APDL Command: ``*TOPER`` - - Parameters - ---------- - parr - Name of the resulting table parameter. The command will create a - table array parameter with this name. Any existing parameter with - this name will be overwritten. - - par1 - Name of the first table parameter. - - oper - The operation to be performed: ``ADD``. The operation is: - ``ParR(i,j,k) = FACT1*Par1(i,j,k) + FACT2 *Par2(i,j,k) +CON1`` - - par2 - Name of the second table parameter. - - fact1 - The first table parameter multiplying constant. Defaults to 1. - - fact2 - The second table parameter multiplying constant. Defaults to 1. - - con1 - The constant increment for offset. Defaults to 0. - - Notes - ----- - ``*TOPER`` operates on table parameters according to: - ``ParR(i,j,k) = FACT1*Par1(i,j,k) + FACT2 *Par2(i,j,k) +CON1`` - - Par1 and Par2 must have the same dimensions and the same variable names - corresponding to those dimensions. Par1 and Par2 must also have - identical index values for rows, columns, etc. - - If you want a local coordinate system for the resulting array, you must - dimension it as such using the ``*DIM`` command before issuing ``*TOPER``. - - This command is valid in any processor. - """ - command = f"*TOPER,{parr},{par1},{oper},{par2},{fact1},{fact2},{con1}" - return self.run(command, **kwargs) - - def vabs(self, kabsr="", kabs1="", kabs2="", kabs3="", **kwargs): - """Applies the absolute value function to array parameters. - - APDL Command: ``*VABS`` - - Parameters - ---------- - kabsr - Absolute value of results parameter: - - Do not take absolute value of results parameter (``ParR``). - Take absolute value. - - kabs1 - Absolute value of first parameter: - - Do not take absolute value of first parameter (``Par1`` or ``ParI``). - Take absolute value. - - kabs2 - Absolute value of second parameter: - - Do not take absolute value of second parameter (``Par2`` or ``ParJ``). - Take absolute value. - - kabs3 - Absolute value of third parameter: - - Do not take absolute value of third parameter (``Par3`` or ``ParK``). - Take absolute value. - - Notes - ----- - Applies an absolute value to parameters used in certain ``*VXX`` and ``*MXX`` - operations. Typical absolute value applications are of the form: - - ``ParR = |f(|Par1|)|`` - - or - - ``ParR = |(|Par1| o |Par2|)|`` - - The absolute values are applied to each input parameter value before - the operation and to the result value after the operation. Absolute - values are applied before the scale factors so that negative scale - factors may be used. The absolute value settings are reset to the - default (no absolute value) after each ``*VXX`` or ``*MXX`` operation. Use - ``*VSTAT`` to list settings. - - This command is valid in any processor. - """ - command = f"*VABS,{kabsr},{kabs1},{kabs2},{kabs3}" - return self.run(command, **kwargs) - - def vcol(self, ncol1="", ncol2="", **kwargs): - """Specifies the number of columns in matrix operations. - - APDL Command: ``*VCOL`` - - Parameters - ---------- - ncol1 - Number of columns to be used for Par1 with ``*MXX`` operations. - Defaults to whatever is needed to fill the result array. - - ncol2 - Number of columns to be used for Par2 with ``*MXX`` operations. - Defaults to whatever is needed to fill the result array. - - Notes - ----- - Specifies the number of columns to be used in array parameter matrix - operations. The size of the submatrix used is determined from the - upper left starting array element (defined on the operation command) to - the lower right array element (defined by the number of columns on this - command and the number of rows on the ``*VLEN`` command). - - The default NCOL is calculated from the maximum number of columns of - the result array (the ``*DIM`` column dimension) minus the starting - location + 1. For example, ``*DIM,R,,1,10`` and a starting location of - R(1,7) gives a default of 4 columns ( starting with R(1,7), R(1,8), - R(1,9), and R(1,10)). Repeat operations automatically terminate at the - last column of the result array. Existing values in the rows and - columns of the results matrix remain unchanged where not overwritten by - the requested input or operation values. - - The column control settings are reset to the defaults after each ``*MXX`` - operation. Use ``*VSTAT`` to list settings. - - This command is valid in any processor. - """ - command = f"*VCOL,{ncol1},{ncol2}" - return self.run(command, **kwargs) - - def vcum(self, key="", **kwargs): - """Allows array parameter results to add to existing results. - - APDL Command: ``*VCUM`` - - Parameters - ---------- - key - Accumulation key: - - Overwrite results. - Add results to the current value of the results parameter. - - Notes - ----- - Allows results from certain ``*VXX`` and ``*MXX`` operations to overwrite or - add to existing results. The cumulative operation is of the form: - - ``ParR = ParR + ParR(Previous)`` - - The cumulative setting is reset to the default (overwrite) after each - ``*VXX`` or ``*MXX`` operation. Use ``*VSTAT`` to list settings. - - This command is valid in any processor. - """ - command = f"*VCUM,{key}" - return self.run(command, **kwargs) - - def vfact(self, factr="", fact1="", fact2="", fact3="", **kwargs): - """Applies a scale factor to array parameters. - - APDL Command: ``*VFACT`` - - Parameters - ---------- - factr - Scale factor applied to results (``ParR``) parameter. Defaults to 1.0. - - fact1 - Scale factor applied to first parameter (``Par1`` or ``ParI``). Defaults - to 1.0. - - fact2 - Scale factor applied to second parameter (``Par2`` or ``ParJ``). Defaults - to 1.0. - - fact3 - Scale factor applied to third parameter (``Par3`` or ``ParK``). Defaults - to 1.0. - - Notes - ----- - Applies a scale factor to parameters used in certain ``*VXX`` and ``*MXX`` - operations. Typical scale factor applications are of the form: - - ``ParR = FACTR*f(FACT1*Par1)`` - - or - - ``ParR = FACTR*((FACT1*Par1) o (FACT2*Par2))`` - - The factors are applied to each input parameter value before the - operation and to the result value after the operation. The scale - factor settings are reset to the default (1.0) after each ``*VXX`` or ``*MXX`` - operation. Use ``*VSTAT`` to list settings. - - This command is valid in any processor. - """ - command = f"*VFACT,{factr},{fact1},{fact2},{fact3}" - return self.run(command, **kwargs) - - def vfun(self, parr="", func="", par1="", con1="", con2="", con3="", **kwargs): - """Performs a function on a single array parameter. - - APDL Command: ``*VFUN`` - - Parameters - ---------- - parr - The name of the resulting numeric array parameter vector. See ``*SET`` - for name restrictions. - - func - Function to be performed: - - * ACOS - Arccosine: ``ACOS(Par1)``. - - * ``ASIN`` - Arcsine: ``ASIN(Par1)``. - - * ``ASORT`` - ``Par1`` is sorted in ascending order. ``*VCOL``, ``*VMASK``, - ``*VCUM``, and ``*VLEN,,NINC`` do not apply. - ``*VLEN,NROW`` does apply. - - * ``ATAN`` - Arctangent: ``ATAN(Par1)`` - - * ``COMP`` - Compress: Selectively compresses data set. "True" - (``*VMASK``) values of ``Par1`` (or row positions to be considered - according to the ``NINC`` value on the ``*VLEN`` command) are - written in compressed form to ``ParR``, starting at the - specified position. - - * ``COPY`` - Copy: ``Par1`` copied to ``ParR``. - - * ``COS`` - Cosine: ``COS(Par1)``. - - * ``COSH`` - Hyperbolic cosine: ``COSH(Par1)``. - - * ``DIRCOS`` - Direction cosines of the principal stresses (nX9). ``Par1`` - contains the nX6 component stresses for the ``n`` locations of - the calculations. - - * ``DSORT`` - ``Par1`` is sorted in descending order. - ``*VCOL``, ``*VMASK``, ``*VCUM``, and ``*VLEN,,NINC`` do not apply. - ``*VLEN,NROW`` does apply. - - * ``EURLER`` - Euler angles of the principal stresses (nX3). ``Par1`` - contains the nX6 component stresses for the ``n`` locations of - the calculations. - - * ``EXP`` - Exponential: ``EXP(Par1)``. - - * ``EXPA`` - Expand: Reverse of the COMP function. All elements of - ``Par1`` (starting at the position specified) are written in - expanded form to corresponding "true" (``*VMASK``) positions - (or row positions to be considered according to the ``NINC`` - value on the ``*VLEN`` command) of ``ParR``. - - * ``LOG`` - Natural logarithm: ``LOG(Par1)``. - - * ``LOG10`` - Common logarithm: ``LOG10(Par1)``. - - * ``NINT`` - Nearest integer: 2.783 becomes 3.0, -1.75 becomes -2.0. - - * ``NOT`` - Logical complement: values 0.0 (false) become 1.0 (true). - Values > 0.0 (true) become 0.0 (false). - - * ``PRIN`` - Principal stresses (nX5). ``Par1`` contains the ``nX6`` component stresses - for the ``n`` locations of the calculations. - - * ``PWR`` - Power function: ``Par1**CON1``. Exponentiation of any negative - number in the vector ``Par1`` to a non-integer power is - performed by exponentiating the positive number and - prepending the minus sign. For example, ``-4**2.3`` is - ``-(4**2.3)``. - - * ``SIN`` - Sine: ``SIN(Par1)`` - - * ``SINH`` - Hyperbolic sine: ``SINH(Par1)``. - - * ``SQRT`` - Square root: ``SQRT(Par1)``. - - * ``TAN`` - Tangent: ``TAN(Par1)``. - - * ``TANH`` - Hyperbolic tangent: ``TANH(Par1)``. - - * ``TANG`` - Tangent to a path at a point: the slope at a point is determined by linear interpolation half - way between the previous and next points. Points are assumed to be in the global Cartesian - coordinate system. Path points are specified in array ``Par1`` (having 3 consecutive columns - of data, with the columns containing the ``x``, ``y``, and ``z`` coordinate locations, respectively, of - the points). Only the starting row index and the column index for the x coordinates are - specified, such as ``A(1,1)``. The y and z coordinates of the vector are assumed to begin in the - corresponding next columns, such as ``A(1,2)`` and ``A(1,3)``. The tangent result, ``ParR``, must also - have 3 consecutive columns of data and will contain the tangent direction vector (normalized - to 1.0); such as 1,0,0 for an x-direction vector. - - * ``NORM`` - Normal to a path and an input vector at a point: determined from the cross-product of the - calculated tangent vector (see ``TANG``) and the input direction vector (with the ``i``, - ``j``, and ``k`` components input as ``CON1``, ``CON2``, and ``CON3``). - Points are assumed to be in the global Cartesian coordinate system. - Path points are specified in array ``Par1`` (having 3 consecutive - columns of data, with the columns containing the ``x``, ``y``, and ``z`` - coordinate locations, respectively, of the points). - Only the starting row index and the column index for the ``x`` coordinates - are specified, such as ``A(1,1)``. The ``y`` and ``z`` coordinates of the vector are assumed to begin - in the corresponding next columns, such as ``A(1,2)`` and ``A(1,3)``. The normal result, ``ParR``, - must also have 3 consecutive columns of data and will contain the normal direction vector - (normalized to 1.0); such as ``1,0,0`` for an x-direction vector - - * ``LOCAL`` - Transforms global Cartesian coordinates of a point to the coordinates of a specified system: - points to be transformed are specified in array ``Par1`` (having 3 consecutive columns of - data, with the columns containing the ``x``, ``y``, and ``z`` global Cartesian coordinate locations, - respectively, of the points). - Only the starting row index and the column index for the ``x`` - coordinates are specified, such as ``A(1,1)``. - The y and z coordinates of the vector are assumed - to begin in the corresponding next columns, such as ``A(1,2)`` and ``A(1,3)``. - Results are transformed to coordinate system ``CON1`` (which may be any valid coordinate system number, - such as 1,2,11,12, etc.). The transformed result, ``ParR``, must also have 3 consecutive columns - of data and will contain the corresponding transformed coordinate locations. - - * ``GLOBAL`` - Transforms specified coordinates of a point to global Cartesian coordinates: points to be - transformed are specified in array ``Par1`` (having 3 consecutive columns of data, with the - columns containing the local coordinate locations (``x``, ``y``, ``z`` or ``r``, ``θ``, ``z`` - or etc.) of the points). - Only the starting row index and the column index for the x coordinates are specified, such - as ``A(1,1)``. - The y and z coordinates (or ``θ`` and ``z``, or etc.) of the vector are assumed to begin - in the corresponding next columns, such as ``A(1,2)`` and ``A(1,3)``. - Local coordinate locations are assumed to be in coordinate system ``CON1`` - (which may be any valid coordinate system number, such as 1,2,11,12, etc.). - The transformed result, ``ParR``, must also have 3 consecutive - columns of data, with the columns containing the global Cartesian ``x``, y, and z coordinate - locations, respectively. - - par1 - Array parameter vector in the operation. - - con1, con2, con3 - Constants (used only with the PWR, NORM, LOCAL, and GLOBAL - functions). - - Notes - ----- - Operates on one input array parameter vector and produces one output - array parameter vector according to: - - ``ParR = f(Par1)`` - - """ - command = f"*VFUN,{parr},{func},{par1},{con1},{con2},{con3}" - return self.run(command, **kwargs) - - def vitrp(self, parr="", part="", pari="", parj="", park="", **kwargs): - """Forms an array parameter by interpolation of a table. - - APDL Command: ``*VITRP`` - - Parameters - ---------- - parr - The name of the resulting array parameter. See ``*SET`` for name - restrictions. - - part - The name of the TABLE array parameter. The parameter must exist as - a dimensioned array of type TABLE [``*DIM``]. - - pari - Array parameter vector of I (row) index values for interpolation in - ParT. - - parj - Array parameter vector of J (column) index values for interpolation - in ParT (which must be at least 2-D). - - park - Array parameter vector of K (depth) index values for interpolation - in ParT (which must be 3-D). - - Notes - ----- - Forms an array parameter (of type ``ARRAY``) by interpolating values of an - array parameter (of type ``TABLE``) at specified table index locations - according to: - - ``ParR = f(ParT, Parl, ParJ, ParK)`` - - where ``ParT`` is the type ``TABLE`` array parameter, and ``ParI``, ``ParJ``, ``ParK`` are - the type ``ARRAY`` array parameter vectors of index values for - interpolation in ``ParT``. See the ``*DIM`` command for ``TABLE`` and ``ARRAY`` - declaration types. Linear interpolation is used. The starting array - element number for the ``TABLE`` array (``ParT``) is not used (but a value must - be input). Starting array element numbers must be defined for each - array parameter vector if it does not start at the first location. For - example, ``*VITRP,R(5),TAB(1,1),X(2),Y(4)`` uses the second element of X - and the fourth element of Y as index values (row and column) for a 2-D - interpolation in ``TAB`` and stores the result in the fifth element of R. - Operations continue on successive array elements ``[*VLEN, *VMASK]`` with - the default being all successive elements. Absolute values and scale - factors may be applied to the result parameter ``[*VABS, *VFACT]``. - Results may be cumulative ``[*VCUM]``. See the ``*VOPER`` command for details. - - This command is valid in any processor. - """ - command = f"*VITRP,{parr},{part},{pari},{parj},{park}" - return self.run(command, **kwargs) - - def vlen(self, nrow="", ninc="", **kwargs): - """Specifies the number of rows to be used in array parameter operations. - - APDL Command: ``*VLEN`` - - Parameters - ---------- - nrow - Number of rows to be used with the ``*VXX`` or ``*MXX`` operations. - Defaults to the number of rows needed to fill the result array. - - ninc - Perform the operation on every NINC row (defaults to 1). - - Notes - ----- - Specifies the number of rows to be used in array parameter operations. - The size of the submatrix used is determined from the upper left - starting array element (defined on the operation command) to the lower - right array element (defined by the number of rows on this command and - the number of columns on the ``*VCOL`` command). ``NINC`` allows skipping row - operations for some operation commands. Skipped rows are included in - the row count. The starting row number must be defined on the - operation command for each parameter read and for the result written. - - The default ``NROW`` is calculated from the maximum number of rows of the - result array (the ``*DIM`` row dimension) minus the starting location + 1. - For example, ``*DIM,R,,10`` and a starting location of ``R(7)`` gives a default - of 4 loops (filling ``R(7)``, ``R(8)``, ``R(9)``, and ``R(10)``). Repeat operations - automatically terminate at the last row of the result array. Existing - values in the rows and columns of the results matrix remain unchanged - where not overwritten by the requested input or operation values. - - The stride (``NINC``) allows operations to be performed at regular - intervals. It has no effect on the total number of row operations. - Skipped operations retain the previous result. For example, ``*DIM,R,,6,`` - with a starting location of ``R(1)``, ``NROW = 10``, and ``NINC = 2`` calculates - values for locations ``R(1)``, ``R(3)``, and ``R(5)`` and retains values for - locations ``R(2)``, ``R(4)``, and ``R(6)``. A more general skip control may be - done by masking ``[*VMASK]``. The row control settings are reset to the - defaults after each ``*VXX`` or ``*MXX`` operation. Use ``*VSTAT`` to list - settings. - - This command is valid in any processor. - """ - command = f"*VLEN,{nrow},{ninc}" - return self.run(command, **kwargs) - - def vmask(self, par="", **kwargs): - """Specifies an array parameter as a masking vector. - - APDL Command: ``*VMASK`` - - Parameters - ---------- - par - Name of the mask parameter. The starting subscript must also be - specified. - - Notes - ----- - Specifies the name of the parameter whose values are to be checked for - each resulting row operation. The mask vector usually contains only 0 - (for false) and 1 (for true) values. For each row operation the - corresponding mask vector value is checked. A true value allows the - operation to be done. A false value skips the operation (and retains - the previous results). A mask vector can be created from direct input, - such as ``M(1) = 1,0,0,1,1,0,1``; or from the DATA function of the ``*VFILL`` - command. The NOT function of the ``*VFUN`` command can be used to reverse - the logical sense of the mask vector. The logical compare operations - (``LT``, ``LE``, ``EQ``, ``NE``, ``GE``, and ``GT``) of - the ``*VOPER`` command also produce a mask - vector by operating on two other vectors. Any numeric vector can be - used as a mask vector since the actual interpretation assumes values - less than 0.0 are 0.0 (false) and values greater than 0.0 are 1.0 - (true). If the mask vector is not specified (or has fewer values than - the result vector), true (1.0) values are assumed for the unspecified - values. Another skip control may be input with ``NINC`` on the ``*VLEN`` - command. If both are present, operations occur only when both are - true. The mask setting is reset to the default (no mask) after each - ``*VXX`` or ``*MXX`` operation. Use ``*VSTAT`` to list settings. - - This command is valid in any processor. - """ - command = f"*VMASK,{par}" - return self.run(command, **kwargs) - - def voper(self, parr="", par1="", oper="", par2="", con1="", con2="", **kwargs): - """Operates on two array parameters. - - APDL Command: ``*VOPER`` - - Parameters - ---------- - PARR - The name of the resulting array parameter vector. See ``*SET`` for - name restrictions. - - PAR1 - First array parameter vector in the operation. May also be a - scalar parameter or a literal constant. - - OPER - Operations: - - * ``ADD`` - Addition: ``Par1+Par2``. - - * ``SUB`` - Subtraction: ``Par1-Par2``. - - * ``MULT`` - Multiplication: ``Par1*Par2``. - - * ``DIV`` - Division: ``Par1/Par2`` (a divide by zero results in a value of zero). - - * ``MIN`` - Minimum: minimum of ``Par1`` and ``Par2``. - - * ``MAX`` - Maximum: maximum of ``Par1`` and ``Par2``. - - * ``LT`` - Less than comparison: ``Par1= Par2`` gives 1.0 if - true, 0.0 if false. - - * ``GT`` - Greater than comparison: ``Par1>Par2`` - gives 1.0 if true, 0.0 if false. - - * ``DER`` - First derivative: - - .. math:: - - \\dfrac{\\mathrm{d}(\\mathrm{Par1})}{\\mathrm{d}(\\mathrm{Par2})} - - The derivative at a point is determined over points - half way between the previous and next points - (by linear interpolation). - ``Par1`` must be a function (a unique ``Par1`` - value for each ``Par2`` - value) and ``Par2`` must be in ascending order. - - * ``DER2`` - Second derivative: - - .. math:: - - \\dfrac{\\mathrm{d}^2(\\mathrm{Par1})}{\\mathrm{d}(\\mathrm{Par2})^2} - - See also ``DER1``. - - * ``INT1`` - Single integral: - - .. math:: - - \\int Par1 \\, d(Par2) - - where ``CON1`` is the integration constant. - The integral at a point is - determined by using the single integration procedure - described in the Mechanical APDL Theory Reference. - - * ``INT2`` - Double integral: - - .. math:: - - \\iint Par1 \\, d(Par2) - - where ``CON1`` is the integration constant of the first - integral and ``CON2`` is the integration constant - of the second integral. If ``Par1`` - contains acceleration data, ``CON1`` is the initial velocity - and ``CON2`` is the initial displacement. See also ``INT1``. - - * ``DOT`` - Dot product: ``Par1 . Par2``. - ``Par1`` and ``Par2`` must each have - three consecutive columns of data, with the columns - containing the ``i``, ``j``, and ``k`` vector components, - respectively. Only the starting row index and the column - index for the ``i`` components are specified for ``Par1`` and - ``Par2``, such as ``A(1,1)``. The ``j`` and ``k`` components of the - vector are assumed to begin in the corresponding next - columns, such as ``A(1,2)`` and ``A(1,3)``. - - * ``CROSS`` - Cross product: ``Par1 x Par2``. - ``Par1``, ``Par2``, and ``ParR`` must each have 3 components, - respectively. Only the starting row index and the column - index for the i components are specified for ``Par1``, ``Par2``, - and ``ParR``, such as ``A(1,1)``. The j and k components of the - vector are assumed to begin in the corresponding next - columns, such as ``A(1,2)`` and ``A(1,3)``. - - * ``GATH`` - Gather: For a vector of position numbers, ``Par2``, copy the - value of ``Par1`` at each position number to ParR. Example: - for ``Par1 = 10,20,30,40`` and ``Par2 = 2,4,1``; ``ParR = - 20,40,10``. - - * ``SCAT`` - Scatter: Opposite of ``GATH`` operation. For a - vector of position numbers, ``Par2``, copy the value of ``Par1`` - to that position number in ``ParR``. Example: for ``Par1 = - 10,20,30,40,50`` and ``Par2 = 2,1,0,5,3``; ``ParR = 20,10,50,0,40``. - - * ``ATN2`` - Arctangent: arctangent of ``Par1/Par2`` with the sign of each - component considered. - - * ``LOCAL`` - Transform the data in ``Par1`` from - the global Cartesian coordinate system to the local - coordinate system given in ``CON1``. ``Par1`` must be an ``N`` x 3 - (i.e., vector) or an ``N`` x 6 (i.e., stress or strain tensor) - array. If the local coordinate system is a cylindrical, - spherical, or toroidal system, then you must provide the - global Cartesian coordinates in ``Par2`` as an ``N`` x 3 array. - Set ``CON2 = 1`` if the data is strain data. - - * ``GLOBAL`` - Transform the data in ``Par1`` from the local coordinate system given in ``CON1`` to the global - Cartesian coordinate system. ``Par1`` must be an ``N`` x 3 (that is, vector) or an ``N`` x 6 (that is, - stress or strain tensor) array. If the local coordinate system is a cylindrical, spherical, or - toroidal system, then you must provide the global Cartesian coordinates in ``Par2`` as an ``N`` - x 3 array. Set ``CON2 = 1`` if the data is strain data. - - PAR2 - Second array parameter vector in the operation. May also be a - scalar parameter or a literal constant. - - CON1 - First constant (used only with the ``INT1`` and ``INT2`` operations). - - CON2 - Second constant (used only with the ``INT2`` operation). - - Notes - ----- - Operates on two input array parameter vectors and produces one output - array parameter vector according to: - - ``ParR = Par1 o Par2`` - - where the operations (o) are described below. ParR may be the same as - ``Par1`` or ``Par2``. Absolute values and scale factors may be applied to all - parameters [``*VABS``, ``*VFACT``]. Results may be cumulative [``*VCUM``]. - Starting array element numbers must be defined for each array parameter - vector if it does not start at the first location, such as - ``*VOPER,A,B(5),ADD,C(3)`` which adds the third element of C to the fifth - element of B and stores the result in the first element of A. - Operations continue on successive array elements ``[*VLEN, *VMASK]`` with - the default being all successive elements. Skipping array elements via - ``*VMASK`` or ``*VLEN`` for the ``DER`` and ``INT`` functions skips only the writing - of the results (skipped array element data are used in all - calculations). - - Parameter functions and operations are available to operate on a scalar - parameter or a single element of an array parameter, such as ``SQRT(B)`` or - ``SQRT(A(4))``. See the ``*SET`` command for details. Operations on a - sequence of array elements can be done by repeating the desired - function or operation in a do-loop ``[*DO]``. The vector operations within - the ANSYS program (``*VXX`` commands) are internally programmed do-loops - that conveniently perform the indicated operation over a sequence of - array elements. If the array is multidimensional, only the first - subscript is incremented in the do-loop, that is, the operation repeats - in column vector fashion "down" the array. For example, for ``A(1,5)``, - ``A(2,5)``, ``A(3,5)``, etc. The starting location of the row index must be - defined for each parameter read and for the result written. - - The default number of loops is from the starting result location to the - last result location and can be altered with the ``*VLEN`` command. A - logical mask vector may be defined to control at which locations the - operations are to be skipped [``*VMASK``]. The default is to skip no - locations. Repeat operations automatically terminate at the last array - element of the result array column if the number of loops is undefined - or if it exceeds the last result array element. Zeroes are used in - operations for values read beyond the last array element of an input - array column. Existing values in the rows and columns of the results - matrix - """ - command = f"*VOPER,{parr},{par1},{oper},{par2},{con1},{con2}" - return self.run(command, **kwargs) - - def vscfun(self, parr="", func="", par1="", **kwargs): - """Determines properties of an array parameter. - - APDL Command: ``*VSCFUN`` - - Parameters - ---------- - parr - The name of the resulting scalar parameter. See ``*SET`` for name - restrictions. - - func - Functions: - - * ``MAX`` - Maximum: the maximum ``Par1`` array element value. - - * ``MIN`` - Minimum: the minimum ``Par1`` array element value. - - * ``LMAX`` - Index location of the maximum ``Par1`` array element value. - Array ``Par1`` is searched starting from its specified - index. - - * ``LMIN`` - Index location of the minimum ``Par1`` array element - value. Array ``Par1`` is searched starting from its specified - index. - - * ``FIRST`` - Index location of the first nonzero value in array ``Par1``. - Array ``Par1`` is searched starting from its specified - index. - - * ``LAST`` - Index location of the last nonzero value in array - ``Par1``. Array ``Par1`` is searched starting from its specified - index. - - * ``SUM`` - Sum: ``Par1`` (the summation of the ``Par1`` array element - values). - - * ``MEDI`` - Median: value of ``Par1`` at which there are an - equal number of values above and below. - - * ``MEAN`` - Mean: ``(σ Par1)/NUM``, where ``NUM`` is the number of summed - values. - - * ``VARI`` - Variance: ``(σ ((Par1-MEAN)**2))/NUM``. - - * ``STDV`` - Standard deviation: square root of ``VARI``. - - * ``RMS`` - Root-mean-square: square root of ``(σ (Par1**2))/NUM``. - - * ``NUM`` - Number: the number of summed values (masked values are not counted). - - par1 - Array parameter vector in the operation. - - Notes - ----- - Operates on one input array parameter vector and produces one output - scalar parameter according to: - - ``ParR = f(Par1)`` - - where the functions (f) are described below. The starting array element - number must be defined for the array parameter vector. For example, - ``*VSCFUN,MU,MEAN,A(1)`` finds the mean of the ``A`` vector values, starting - from the first value and stores the result as parameter ``MU``. Operations - use successive array elements ``[*VLEN, *VMASK]`` with the default being - all successive array elements. Absolute values and scale factors may - be applied to all parameters ``[*VABS, *VFACT]``. Results may be - cumulative ``[*VCUM]``. See the ``*VOPER`` command for details. - - This command is valid in any processor. - """ - command = f"*VSCFUN,{parr},{func},{par1}" - return self.run(command, **kwargs) - - def vstat(self, **kwargs): - """Lists the current specifications for the array parameters. - - APDL Command: ``*VSTAT`` - - Notes - ----- - Lists the current specifications for the ``*VABS``, ``*VCOL``, - ``*VCUM``, ``*VFACT``, ``*VLEN``, and ``*VMASK`` commands. - - This command is valid in any processor. - """ - command = f"*VSTAT," - return self.run(command, **kwargs) - - def vwrite( - self, - par1="", - par2="", - par3="", - par4="", - par5="", - par6="", - par7="", - par8="", - par9="", - par10="", - par11="", - par12="", - par13="", - par14="", - par15="", - par16="", - par17="", - par18="", - par19="", - **kwargs, - ): - """Writes data to a file in a formatted sequence. - - APDL Command: ``*VWRITE`` - - .. warning:: - This command cannot be run interactively. See - :func:`non_interactive `. - - Parameters - ---------- - par1, par2, par3, . . . , par19 - You can write up to 19 parameters (or constants) at a time. Any Par - values after a blank Par value are ignored. If you leave them all - blank, one line will be written (to write a title or a blank line). - If you input the keyword SEQU, a sequence of numbers (starting from - 1) will be written for that item. - - Notes - ----- - You use ``*VWRITE`` to write data to a file in a formatted sequence. Data - items (Par1, Par2, etc.) may be array parameters, scalar parameters, - character parameters (scalar or array), or constants. You must - evaluate expressions and functions in the data item fields before using - the ``*VWRITE`` command, since initially they will be evaluated to a - constant and remain constant throughout the operation. Unless a file - is defined with the ``*CFOPEN`` command, data is written to the standard - output file. Data written to the standard output file may be diverted - to a different file by first switching the current output file with the - /OUTPUT command. You can also use the ``*MWRITE`` command to write data to - a specified file. Both commands contain format descriptors on the line - immediately following the command. The format descriptors can be in - either Fortran or C format. - - You must enclose Fortran format descriptors in parentheses. They must - immediately follow the ``*VWRITE`` command on a separate line of the same - input file. Do not include the word FORMAT. The format must specify - the number of fields to be written per line, the field width, the - placement of the decimal point, etc. You should use one field - descriptor for each data item written. The write operation uses your - system's available FORTRAN FORMAT conventions (see your system FORTRAN - manual). You can use any standard FORTRAN real format (such as - (4F6.0), (E10.3,2X,D8.2), etc.) and alphanumeric format (A). - Alphanumeric strings are limited to a maximum of 8 characters for any - field (A8) using the Fortran format. Use the "C" format for string - arrays larger than 8 characters. Integer (I) and list-directed (*) - descriptors may not be used. You can include text in the format as a - quoted string. The parentheses must be included in the format and the - format must not exceed 80 characters (including parentheses). The - output line length is limited to 128 characters. - - The "C" format descriptors are used if the first character of the - format descriptor line is not a left parenthesis. "C" format - descriptors are up to 80 characters long, consisting of text strings - and predefined "data descriptors" between the strings where numeric or - alphanumeric character data will be inserted. The normal descriptors - are %I for integer data, %G for double precision data, %C for - alphanumeric character data, and %/ for a line break. There must be one - data descriptor for each specified value (8 maximum) in the order of - the specified values. The enhanced formats described in ``*MSG`` may also - be used. - - For array parameter items, you must define the starting array - element number. Looping continues (incrementing the vector - index number of each array parameter by one) each time you - output a line, until the maximum array vector element is - written. For example, ``*VWRITE,A(1)`` followed by (F6.0) - will write one value per output line, i.e., A(1), A(2), A(3), - A(4), etc. You write constants and scalar parameters with the - same values for each loop. You can also control the number of - loops and loop skipping with the ``*VLEN`` and ``*VMASK`` - commands. The vector specifications ``*VABS``, ``*VFACT``, - and ``*VCUM`` do not apply to this command. If looping - continues beyond the supplied data array's length, zeros will - be output for numeric array parameters and blanks for - character array parameters. For multi-dimensioned array - parameters, only the first (row) subscript is incremented. - See the ``*VOPER`` command for details. If you are in the GUI, - the ``*VWRITE`` command must be contained in an externally - prepared file and read into ANSYS (i.e., ``*USE``, /INPUT, etc.). - - This command is valid in any processor. - - """ - command = f"*VWRITE,{par1},{par2},{par3},{par4},{par5},{par6},{par7},{par8},{par9},{par10},{par11},{par12},{par13},{par14},{par15},{par16},{par17},{par18},{par19}" - return self.run(command, **kwargs) diff --git a/src/ansys/mapdl/core/_commands/apdl/array_parameters.py b/src/ansys/mapdl/core/_commands/apdl/array_parameters.py new file mode 100644 index 00000000000..fc901da7f31 --- /dev/null +++ b/src/ansys/mapdl/core/_commands/apdl/array_parameters.py @@ -0,0 +1,2579 @@ +# Copyright (C) 2016 - 2025 ANSYS, Inc. and/or its affiliates. +# SPDX-License-Identifier: MIT +# +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to deal +# in the Software without restriction, including without limitation the rights +# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +# copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in all +# copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +# SOFTWARE. + + +class ArrayParameters: + + def mfouri( + self, + oper: str = "", + coeff: str = "", + mode: str = "", + isym: str = "", + theta: str = "", + curve: str = "", + **kwargs, + ): + r"""Calculates the coefficients for, or evaluates, a Fourier series. + + Mechanical APDL Command: `\*MFOURI `_ + + Parameters + ---------- + oper : str + Type of Fourier operation: + + * ``FIT`` - Calculate Fourier coefficients ``COEFF`` from ``MODE``, ``ISYM``, ``THETA``, and + ``CURVE``. + + * ``EVAL`` - Evaluate the Fourier curve ``CURVE`` from ``COEFF``, ``MODE``, ``ISYM`` and ``THETA`` + + coeff : str + Name of the array parameter vector containing the Fourier coefficients (calculated if ``Oper`` = + FIT, required as input if ``Oper`` = EVAL). See :ref:`starset` for name restrictions. + + mode : str + Name of the array parameter vector containing the mode numbers of the desired Fourier terms. + + isym : str + Name of the array parameter vector containing the symmetry key for the corresponding Fourier terms. + The vector should contain keys for each term as follows: + + * ``0 or 1`` - Symmetric (cosine) term + + * ``-1`` - Antisymmetric (sine) term. + + theta : str + Names of the array parameter vectors containing the theta vs. curve description, respectively. + Theta values should be input in degrees. If ``Oper`` = FIT, one curve value should be supplied + with each theta value. If ``Oper`` = EVAL, one curve value will be calculated for each theta + value. + + curve : str + Names of the array parameter vectors containing the theta vs. curve description, respectively. + Theta values should be input in degrees. If ``Oper`` = FIT, one curve value should be supplied + with each theta value. If ``Oper`` = EVAL, one curve value will be calculated for each theta + value. + + Notes + ----- + + .. warning:: + + This function contains specificities regarding the argument definitions. + Please refer to the `command documentation `_ + for further explanations. + + **Argument Descriptions** + + .. _a-MFOURI_argdescript: + + * ``oper : str`` - Type of Fourier operation: + + * ``FIT`` - Calculate Fourier coefficients ``COEFF`` from ``MODE``, ``ISYM``, ``THETA``, and + ``CURVE``. + + * ``EVAL`` - Evaluate the Fourier curve ``CURVE`` from ``COEFF``, ``MODE``, ``ISYM`` and ``THETA`` + + * ``coeff : str`` - Name of the array parameter vector containing the Fourier coefficients + (calculated if ``Oper`` = FIT, required as input if ``Oper`` = EVAL). See :ref:`starset` for name + restrictions. + + * ``mode : str`` - Name of the array parameter vector containing the mode numbers of the desired + Fourier terms. + + * ``isym : str`` - Name of the array parameter vector containing the symmetry key for the + corresponding Fourier terms. + The vector should contain keys for each term as follows: + + * ``0 or 1`` - Symmetric (cosine) term + + * ``-1`` - Antisymmetric (sine) term. + + * ``theta, curve : str`` - Names of the array parameter vectors containing the theta vs. curve + description, respectively. Theta values should be input in degrees. If ``Oper`` = FIT, one curve + value should be supplied with each theta value. If ``Oper`` = EVAL, one curve value will be + calculated for each theta value. + + .. _a-MFOURI_notes: + + Calculates the coefficients of a Fourier series for a given curve, or evaluates the Fourier curve + from the given (or previously calculated) coefficients. The lengths of the ``COEFF``, ``MODE``, and + ``ISYM`` vectors must be the same--typically two times the number of modes desired, since two terms + (sine and cosine) are generally required for each mode. The lengths of the ``CURVE`` and ``THETA`` + vectors should be the same or the smaller of the two will be used. There should be a sufficient + number of points to adequately define the curve--at least two times the number of coefficients. A + starting array element number (1) must be defined for each array parameter vector. The vector + specifications :ref:`vlen`, :ref:`vcol`, :ref:`vabs`, :ref:`vfact`, and :ref:`vcum` do not apply to + this command. Array elements should not be skipped with the :ref:`vmask` and the ``NINC`` value of + the :ref:`vlen` specifications. The vector being calculated ( ``COEFF`` if ``Oper`` is FIT, or + ``CURVE`` if ``Oper`` is EVAL) must exist as a dimensioned array ( :ref:`dim` ). + + This command is valid in any processor. + """ + command = f"*MFOURI,{oper},{coeff},{mode},{isym},{theta},{curve}" + return self.run(command, **kwargs) + + def mfun(self, parr: str = "", func: str = "", par1: str = "", **kwargs): + r"""Copies or transposes an array parameter matrix. + + Mechanical APDL Command: `\*MFUN `_ + + Parameters + ---------- + parr : str + The name of the resulting array parameter matrix. See :ref:`starset` for name restrictions. + + func : str + Copy or transpose function: + + * ``COPY`` - ``Par1`` is copied to ``ParR`` + + * ``TRAN`` - ``Par1`` is transposed to ``ParR``. Rows (m) and columns (n) of ``Par1`` matrix are + transposed to resulting ``ParR`` matrix of shape (n,m). + + par1 : str + Array parameter matrix input to the operation. + + Notes + ----- + + .. warning:: + + This function contains specificities regarding the argument definitions. + Please refer to the `command documentation `_ + for further explanations. + + **Argument Descriptions** + + .. _a-MFUN_argdescript: + + * ``parr : str`` - The name of the resulting array parameter matrix. See :ref:`starset` for name + restrictions. + + * ``func : str`` - Copy or transpose function: + + * ``COPY`` - ``Par1`` is copied to ``ParR`` + + * ``TRAN`` - ``Par1`` is transposed to ``ParR``. Rows (m) and columns (n) of ``Par1`` matrix are + transposed to resulting ``ParR`` matrix of shape (n,m). + + * ``par1 : str`` - Array parameter matrix input to the operation. + + .. _a-MFUN_notes: + + Operates on one input array parameter matrix and produces one output array parameter matrix + according to: ``ParR`` = f( ``Par1`` ) + + where the function (f) is either a copy or transpose, as described above. + + Functions are based on the standard FORTRAN definitions where possible. ``ParR`` may be the same as + ``Par1``. Starting array element numbers must be defined for each array parameter matrix if it does + not start at the first location. For example, :ref:`mfun`,A(1,5),COPY,B(2,3) copies matrix B + (starting at element (2,3)) to matrix A (starting at element (1,5)). The diagonal corner elements + for each submatrix must be defined: the upper left corner by the array starting element (on this + command), the lower right corner by the current values from the :ref:`vcol` and :ref:`vlen` + commands. The default values are the (1,1) element and the last element in the matrix. No operations + progress across matrix planes (in the 3rd dimension). Absolute values and scale factors may be + applied to all parameters ( :ref:`vabs`, :ref:`vfact` ). Results may be cumulative ( :ref:`vcum` ). + Array elements should not be skipped with the :ref:`vmask` and the ``NINC`` value of the :ref:`vlen` + specifications. The number of rows ( :ref:`vlen` ) applies to the ``Par1`` array. See the + :ref:`voper` command for details. + + This command is valid in any processor. + """ + command = f"*MFUN,{parr},{func},{par1}" + return self.run(command, **kwargs) + + def moper( + self, + parr: str = "", + par1: str = "", + oper: str = "", + val1: str = "", + val2: str = "", + val3: str = "", + val4: str = "", + val5: str = "", + val6: str = "", + **kwargs, + ): + r"""Performs matrix operations on array parameter matrices. + + Mechanical APDL Command: `\*MOPER `_ + + Parameters + ---------- + parr : str + The name of the resulting array parameter matrix. See :ref:`starset` for name restrictions. + + par1 : str + First array parameter matrix input to the operation. + + oper : str + Matrix operations. Usage of the ``Val1`` through ``Val6`` arguments varies for each operation, as + described below: + + * ``INVERT`` - ( :ref:`moper`, ``ParR``, ``Par1``, INVERT) + + Square matrix invert: Inverts the n x n matrix in Par1 into ParR. The matrix must be well + conditioned. + + .. warning:: + + Non-independent or ill-conditioned equations can cause erroneous results. + + For large matrices, use the APDL Math operation :ref:`lsfactor` for efficiency (see `APDL Math + `_ + + * ``MULT`` - ( :ref:`moper`, ``ParR``, ``Par1``, MULT, ``Par2`` ) + + Matrix multiply: Multiplies ``Par1`` by ``Par2``. The number of rows of ``Par2`` must equal the + number of columns of ``Par1`` for the operation. If ``Par2`` is input with a number of rows greater + than the number of columns of ``Par1``, matrices are still multiplied. However, the operation only + uses a number of rows of ``Par2`` equal to the number of columns of ``Par1``. + + * ``COVAR`` - ( :ref:`moper`, ``ParR``, ``Par1``, COVAR, ``Par2`` ) + + Covariance: The measure of association between columns of the ``Par1`` input matrix. ``Par1`` of + size m runs (rows) by n data (columns) is first processed to produce a row vector containing the + mean of each column, which is transposed to the output column vector ``Par2`` of n array elements. + The ``Par1`` and ``Par2`` operation then produces ``ParR``, a resulting n x n matrix of covariances + (with the variances as the diagonal terms). + + * ``CORR`` - ( :ref:`moper`, ``ParR``, ``Par1``, CORR, ``Par2`` ) + + Correlation: The correlation coefficient between columns of the ``Par1`` input matrix. ``Par1`` of + size m runs (rows) by n data (columns) is first processed to produce a row vector containing the + mean of each column, which is then transposed to the output column vector ``Par2`` of n array + elements. The ``Par1`` and ``Par2`` operation then produces ``ParR``, a resulting n x n matrix of + correlation coefficients (with a value of 1.0 for the diagonal terms). + + * ``SOLV`` - ( :ref:`moper`, ``ParR``, ``Par1``, SOLV, ``Par2`` ) + + Solution of simultaneous equations: Solves the set of ``n`` equations of ``n`` terms of the form + a:sub:`n1` x:sub:`1` + a:sub:`n2` x:sub:`2` + :sup:`...` + a:sub:`nn` x:sub:`n` = b:sub:`n` where + ``Par1`` contains the matrix of a-coefficients, ``Par2`` contains the vector(s) of b-values, and + ``ParR`` contains the vector(s) of x-results. ``Par1`` must be a square matrix. The equations must + be linear, independent, and well conditioned. + + .. warning:: + + Non-independent or ill-conditioned equations can cause erroneous results. + + For large matrices, use the APDL Math operation :ref:`lsfactor` for efficiency (see `APDL Math + `_ + + * ``SORT`` - ( :ref:`moper`, ``ParR``, ``Par1``, SORT, ``Par2``, ``n1``, ``n2``, ``n3`` ) + + Matrix sort: Sorts the columns of matrix ``Par1`` according to sort vector ``Par2`` and places the + result back into ``Par1``. Rows of ``Par1`` are moved to the corresponding positions indicated by + the values of ``Par2``. ``Par2`` may be a column of ``Par1`` (in which case it will also be + reordered). Alternatively, you may specify the column of ``Par1`` to sort using ``n1`` (leaving + ``Par2`` blank). A secondary sort can be specified by column ``n2``, and a third sort using column + ``n3``. ``ParR`` is the vector of initial row positions (the permutation vector). Sorting ``Par1`` + according to ``ParR`` should reproduce the initial ordering. + + * ``NNEAR`` - ( :ref:`moper`, ``ParR``, ``Par1``, NNEAR, ``Toler`` ) + + Nearest Node: Finds the nodes nearest to the given set of points in ``Par1``, where ``Par1`` is an n + x 3 array of coordinate locations. ``ParR`` is a vector of the nearest selected nodes, or 0 if no + nodes are nearer than ``Toler``. ``Toler`` defaults to 1 and is limited to the maximum model size. + + * ``ENEAR`` - ( :ref:`moper`, ``ParR``, ``Par1``, ENEAR, ``Toler`` ) + + Nearest Element: Finds the elements nearest to the given set of points in ``Par1``, where ``Par1`` + is an n x 3 array of coordinate locations. ``ParR`` is a vector of the nearest selected elements, or + 0 if no element centroids are nearer than ``Toler``. ``Toler`` defaults to 1 and is limited to the + maximum model size. + + * ``MAP`` - ( :ref:`moper`, ``ParR``, ``Par1``, MAP, ``Par2``, ``Par3``, ``kDim``, ``--``, ``kOut``, + ``LIMIT`` ) + + Maps the results from one set of points to another. For example, you can map pressures from a CFD + analysis onto your model for a structural analysis. + + ``Par1`` is the Nout x 3 array of points that will be mapped to. ``Par2`` is the Nin x M array that + contains M values of data to be interpolated at each point and corresponds to the Nin x 3 points in + ``Par3``. The resulting ``ParR`` is the Nout x M array of mapped data points. + + For each point in the destination mesh, all possible triangles in the source mesh are searched to + find the best triangle containing each point. It then does a linear interpolation inside this + triangle. You should carefully specify your interpolation method and search criteria in order to + provide faster and more accurate results (see ``LIMIT``, below). + + ``kDim`` is the interpolation criteria. If ``kDim`` = 2 or 0, two dimensional interpolation is + applied (interpolate on a surface). If ``kDim`` = 3, three dimensional interpolation is applied + (interpolate on a volume). + + ``kOut`` specified how points outside of the domain are handled. If ``kOut`` = 0, use the value(s) + of the nearest region point for points outside of the region. If ``kOut`` = 1, set results outside + of the region to zero. + + ``LIMIT`` specifies the number of nearby points considered for interpolation. The default is 20, and + the minimum is 5. Lower values will reduce processing time; however, some distorted or irregular + sets of points will require a higher ``LIMIT`` value to encounter three nodes for triangulation. + + Output points are incorrect if they are not within the domain (area or volume) defined by the + specified input points. Also, calculations for out-of-bound points require much more processing time + than do points that are within bounds. Results mapping is available from the command line only. + + * ``INTP`` - ( :ref:`moper`, ``ParR``, ``Par1``, INTP, ``Par2`` ) + + Finds the elements that contain each point in the array of n x 3 points in ``Par1``. ``Par2`` will + contain the set of element ID numbers and ``ParR`` will contain their n x 3 set of natural element + coordinates (values between -1 and 1). ``Par1`` must be in global Cartesian coordinates. + + * ``SGET`` - ( :ref:`moper`, ``ParR``, ``Par1``, SGET, ``Par2``, ``Label``, ``Comp`` ) + + Gets the nodal solution item corresponding to ``Label`` and ``Comp`` (see the :ref:`plnsol` command) + and interpolates it to the given element locations. ``Par1`` contains the n x 3 array of natural + element coordinates (values between -1 and 1) of the n element ID numbers in ``Par2``. ``Par1`` and + ``Par2`` are usually the output of the :ref:`moper`,,,INTP operation. ``ParR`` contains the n + interpolated results. + + val1 : str + Additional input used in the operation. The meanings of ``Val1`` through ``Val6`` vary depending + on the specified matrix operation. See the description of ``Oper`` for details. + + val2 : str + Additional input used in the operation. The meanings of ``Val1`` through ``Val6`` vary depending + on the specified matrix operation. See the description of ``Oper`` for details. + + val3 : str + Additional input used in the operation. The meanings of ``Val1`` through ``Val6`` vary depending + on the specified matrix operation. See the description of ``Oper`` for details. + + val4 : str + Additional input used in the operation. The meanings of ``Val1`` through ``Val6`` vary depending + on the specified matrix operation. See the description of ``Oper`` for details. + + val5 : str + Additional input used in the operation. The meanings of ``Val1`` through ``Val6`` vary depending + on the specified matrix operation. See the description of ``Oper`` for details. + + val6 : str + Additional input used in the operation. The meanings of ``Val1`` through ``Val6`` vary depending + on the specified matrix operation. See the description of ``Oper`` for details. + + Notes + ----- + + .. warning:: + + This function contains specificities regarding the argument definitions. + Please refer to the `command documentation `_ + for further explanations. + + **Argument Descriptions** + + .. _a-MOPER_argdescript: + + * ``parr : str`` - The name of the resulting array parameter matrix. See :ref:`starset` for name + restrictions. + + * ``par1 : str`` - First array parameter matrix input to the operation. + + * ``oper : str`` - Matrix operations. Usage of the ``Val1`` through ``Val6`` arguments varies for + each operation, as + described below: + + * ``INVERT`` - ( :ref:`moper`, ``ParR``, ``Par1``, INVERT) + + Square matrix invert: Inverts the n x n matrix in Par1 into ParR. The matrix must be well + conditioned. + + .. warning:: + + Non-independent or ill-conditioned equations can cause erroneous results. + + For large matrices, use the APDL Math operation :ref:`lsfactor` for efficiency (see `APDL Math + `_ + + * ``MULT`` - ( :ref:`moper`, ``ParR``, ``Par1``, MULT, ``Par2`` ) + + Matrix multiply: Multiplies ``Par1`` by ``Par2``. The number of rows of ``Par2`` must equal the + number of columns of ``Par1`` for the operation. If ``Par2`` is input with a number of rows greater + than the number of columns of ``Par1``, matrices are still multiplied. However, the operation only + uses a number of rows of ``Par2`` equal to the number of columns of ``Par1``. + + * ``COVAR`` - ( :ref:`moper`, ``ParR``, ``Par1``, COVAR, ``Par2`` ) + + Covariance: The measure of association between columns of the ``Par1`` input matrix. ``Par1`` of + size m runs (rows) by n data (columns) is first processed to produce a row vector containing the + mean of each column, which is transposed to the output column vector ``Par2`` of n array elements. + The ``Par1`` and ``Par2`` operation then produces ``ParR``, a resulting n x n matrix of covariances + (with the variances as the diagonal terms). + + * ``CORR`` - ( :ref:`moper`, ``ParR``, ``Par1``, CORR, ``Par2`` ) + + Correlation: The correlation coefficient between columns of the ``Par1`` input matrix. ``Par1`` of + size m runs (rows) by n data (columns) is first processed to produce a row vector containing the + mean of each column, which is then transposed to the output column vector ``Par2`` of n array + elements. The ``Par1`` and ``Par2`` operation then produces ``ParR``, a resulting n x n matrix of + correlation coefficients (with a value of 1.0 for the diagonal terms). + + * ``SOLV`` - ( :ref:`moper`, ``ParR``, ``Par1``, SOLV, ``Par2`` ) + + Solution of simultaneous equations: Solves the set of ``n`` equations of ``n`` terms of the form + a:sub:`n1` x:sub:`1` + a:sub:`n2` x:sub:`2` + :sup:`...` + a:sub:`nn` x:sub:`n` = b:sub:`n` where + ``Par1`` contains the matrix of a-coefficients, ``Par2`` contains the vector(s) of b-values, and + ``ParR`` contains the vector(s) of x-results. ``Par1`` must be a square matrix. The equations must + be linear, independent, and well conditioned. + + .. warning:: + + Non-independent or ill-conditioned equations can cause erroneous results. + + For large matrices, use the APDL Math operation :ref:`lsfactor` for efficiency (see `APDL Math + `_ + + * ``SORT`` - ( :ref:`moper`, ``ParR``, ``Par1``, SORT, ``Par2``, ``n1``, ``n2``, ``n3`` ) + + Matrix sort: Sorts the columns of matrix ``Par1`` according to sort vector ``Par2`` and places the + result back into ``Par1``. Rows of ``Par1`` are moved to the corresponding positions indicated by + the values of ``Par2``. ``Par2`` may be a column of ``Par1`` (in which case it will also be + reordered). Alternatively, you may specify the column of ``Par1`` to sort using ``n1`` (leaving + ``Par2`` blank). A secondary sort can be specified by column ``n2``, and a third sort using column + ``n3``. ``ParR`` is the vector of initial row positions (the permutation vector). Sorting ``Par1`` + according to ``ParR`` should reproduce the initial ordering. + + * ``NNEAR`` - ( :ref:`moper`, ``ParR``, ``Par1``, NNEAR, ``Toler`` ) + + Nearest Node: Finds the nodes nearest to the given set of points in ``Par1``, where ``Par1`` is an n + x 3 array of coordinate locations. ``ParR`` is a vector of the nearest selected nodes, or 0 if no + nodes are nearer than ``Toler``. ``Toler`` defaults to 1 and is limited to the maximum model size. + + * ``ENEAR`` - ( :ref:`moper`, ``ParR``, ``Par1``, ENEAR, ``Toler`` ) + + Nearest Element: Finds the elements nearest to the given set of points in ``Par1``, where ``Par1`` + is an n x 3 array of coordinate locations. ``ParR`` is a vector of the nearest selected elements, or + 0 if no element centroids are nearer than ``Toler``. ``Toler`` defaults to 1 and is limited to the + maximum model size. + + * ``MAP`` - ( :ref:`moper`, ``ParR``, ``Par1``, MAP, ``Par2``, ``Par3``, ``kDim``, ``--``, ``kOut``, + ``LIMIT`` ) + + Maps the results from one set of points to another. For example, you can map pressures from a CFD + analysis onto your model for a structural analysis. + + ``Par1`` is the Nout x 3 array of points that will be mapped to. ``Par2`` is the Nin x M array that + contains M values of data to be interpolated at each point and corresponds to the Nin x 3 points in + ``Par3``. The resulting ``ParR`` is the Nout x M array of mapped data points. + + For each point in the destination mesh, all possible triangles in the source mesh are searched to + find the best triangle containing each point. It then does a linear interpolation inside this + triangle. You should carefully specify your interpolation method and search criteria in order to + provide faster and more accurate results (see ``LIMIT``, below). + + ``kDim`` is the interpolation criteria. If ``kDim`` = 2 or 0, two dimensional interpolation is + applied (interpolate on a surface). If ``kDim`` = 3, three dimensional interpolation is applied + (interpolate on a volume). + + ``kOut`` specified how points outside of the domain are handled. If ``kOut`` = 0, use the value(s) + of the nearest region point for points outside of the region. If ``kOut`` = 1, set results outside + of the region to zero. + + ``LIMIT`` specifies the number of nearby points considered for interpolation. The default is 20, and + the minimum is 5. Lower values will reduce processing time; however, some distorted or irregular + sets of points will require a higher ``LIMIT`` value to encounter three nodes for triangulation. + + Output points are incorrect if they are not within the domain (area or volume) defined by the + specified input points. Also, calculations for out-of-bound points require much more processing time + than do points that are within bounds. Results mapping is available from the command line only. + + * ``INTP`` - ( :ref:`moper`, ``ParR``, ``Par1``, INTP, ``Par2`` ) + + Finds the elements that contain each point in the array of n x 3 points in ``Par1``. ``Par2`` will + contain the set of element ID numbers and ``ParR`` will contain their n x 3 set of natural element + coordinates (values between -1 and 1). ``Par1`` must be in global Cartesian coordinates. + + * ``SGET`` - ( :ref:`moper`, ``ParR``, ``Par1``, SGET, ``Par2``, ``Label``, ``Comp`` ) + + Gets the nodal solution item corresponding to ``Label`` and ``Comp`` (see the :ref:`plnsol` command) + and interpolates it to the given element locations. ``Par1`` contains the n x 3 array of natural + element coordinates (values between -1 and 1) of the n element ID numbers in ``Par2``. ``Par1`` and + ``Par2`` are usually the output of the :ref:`moper`,,,INTP operation. ``ParR`` contains the n + interpolated results. + + * ``val1, val2,..., val6 : str`` - Additional input used in the operation. The meanings of ``Val1`` + through ``Val6`` vary depending on the specified matrix operation. See the description of ``Oper`` + for details. + + .. _a-MOPER_notes: + + Each starting array element number must be defined for each array parameter matrix if it does not + start at the first location. For example, :ref:`moper`,A(2,3),B(1,4),MULT,C(1,5) multiplies + submatrix B (starting at element (1,4)) by submatrix C (starting at element (1,5)) and puts the + result in matrix A (starting at element (2,3)). + + The diagonal corner elements for each submatrix must be defined: the upper left corner by the array + starting element (on this command), the lower right corner by the current values from the + :ref:`vcol` and :ref:`vlen` commands. The default values are the (1,1) element and the last element + in the matrix. No operations progress across matrix planes (in the 3rd dimension). Absolute values + and scale factors may be applied to all parameters ( :ref:`vabs`, :ref:`vfact` ). Results may be + cumulative ( :ref:`vcum` ). Array elements should not be skipped with the :ref:`vmask` and the + ``NINC`` value of the :ref:`vlen` specifications. See the :ref:`voper` command for details. + + This command is valid in any processor. + """ + command = ( + f"*MOPER,{parr},{par1},{oper},{val1},{val2},{val3},{val4},{val5},{val6}" + ) + return self.run(command, **kwargs) + + def mwrite( + self, + parr: str = "", + fname: str = "", + ext: str = "", + label: str = "", + n1: str = "", + n2: str = "", + n3: str = "", + **kwargs, + ): + r"""Writes a matrix to a file in a formatted sequence. + + Mechanical APDL Command: `\*MWRITE `_ + + .. warning:: + + This command must be run using :func:`non_interactive `. + Please visit `Unsupported Interactive Commands `_ + for further information. + + Parameters + ---------- + parr : str + The name of the array parameter. See :ref:`starset` for name restrictions. + + 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. If the file name fields are left blank, the + default file is the current output file. + + ext : str + Filename extension (eight-character maximum). + + label : str + Can use a value of IJK, IKJ, JIK, JKI, KIJ, KJI, or blank (JIK). + + n1 : str + Write as ((( ``ParR`` (i,j,k), k = 1,n1), i = 1, n2), j = 1, n3) for ``Label`` = KIJ. ``n1,`` + ``n2,`` and ``n3`` default to the corresponding dimensions of the array parameter ParR. + + n2 : str + Write as ((( ``ParR`` (i,j,k), k = 1,n1), i = 1, n2), j = 1, n3) for ``Label`` = KIJ. ``n1,`` + ``n2,`` and ``n3`` default to the corresponding dimensions of the array parameter ParR. + + n3 : str + Write as ((( ``ParR`` (i,j,k), k = 1,n1), i = 1, n2), j = 1, n3) for ``Label`` = KIJ. ``n1,`` + ``n2,`` and ``n3`` default to the corresponding dimensions of the array parameter ParR. + + Notes + ----- + + .. warning:: + + This function contains specificities regarding the argument definitions. + Please refer to the `command documentation `_ + for further explanations. + + **Argument Descriptions** + + .. _a-MWRITE_argdescript: + + * ``parr : str`` - The name of the array parameter. See :ref:`starset` for name restrictions. + + * ``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. If the file name fields are left blank, the default + file is the + current output file. + + * ``ext : str`` - Filename extension (eight-character maximum). + * ``label : str`` - Can use a value of IJK, IKJ, JIK, JKI, KIJ, KJI, or blank (JIK). + + * ``n1, n2, n3 : str`` - Write as ((( ``ParR`` (i,j,k), k = 1,n1), i = 1, n2), j = 1, n3) for + ``Label`` = KIJ. ``n1,`` ``n2,`` and ``n3`` default to the corresponding dimensions of the array + parameter ParR. + + .. _a-MWRITE_notes: + + Writes a matrix or vector to a specified file in a formatted sequence. You can also use the + :ref:`vwrite` command to write data to a specified file. Both commands contain format descriptors on + the line immediately following the command. The format descriptors can be in either FORTRAN or C + format. + + FORTRAN format descriptors are enclosed in parentheses. They must immediately follow the + :ref:`mwrite` command on a separate line of the same input file. The word FORMAT should not be + included. The format must specify the number of fields to be written per line, the field width, the + placement of the decimal point, etc. There should be one field descriptor for each data item + written. The write operation uses the available system FORTRAN FORMAT conventions (see your system + FORTRAN manual). Any standard FORTRAN real format (such as (4F6.0), (E10.3,2X,D8.2), etc.) and + character format (A) may be used. Integer (I) and list-directed (\2) descriptors may not be used. + Text may be included in the format as a quoted string. The FORTRAN descriptor must be enclosed in + parentheses and the format must not exceed 80 characters (including parentheses). + + The "C" format descriptors are used if the first character of the format descriptor line is not a + left parenthesis. "C" format descriptors may be up to 80 characters long, consisting of text strings + and predefined "data descriptors" between the strings where numeric or alphanumeric character data + are to be inserted. The normal descriptors are %I for integer data, %G for double precision data, %C + for alphanumeric character data, and %/ for a line break. There must be one data descriptor for each + specified value in the order of the specified values. The enhanced formats described in :ref:`msg` + can also be used. + + The starting array element number must be defined. Looping continues in the directions indicated by + the Label argument. The number of loops and loop skipping may also be controlled via :ref:`vlen` and + :ref:`vmask`, which work in the ``n2`` direction (by row on the output file), and by :ref:`vcol`, + which works in the ``n1`` direction (by column in the output file). The vector specifications + :ref:`vabs` and :ref:`vfact` apply to this command, while :ref:`vcum` does not apply to this + command. See :ref:`voper` for details. If you are in the GUI, the :ref:`mwrite` command must be + contained in an externally prepared file and read into Mechanical APDL (that is, :ref:`use`, + :ref:`input`, + etc.). + + This command is valid in any processor. + """ + command = f"*MWRITE,{parr},{fname},{ext},,{label},{n1},{n2},{n3}" + return self.run(command, **kwargs) + + def sread( + self, + strarray: str = "", + fname: str = "", + ext: str = "", + nchar: str = "", + nskip: str = "", + nread: str = "", + **kwargs, + ): + r"""Reads a file into a string array parameter. + + Mechanical APDL Command: `\*SREAD `_ + + Parameters + ---------- + strarray : str + Name of the string array parameter which will hold the read file. String array parameters are + similar to character arrays, but each array element can be as long as 248 characters. If the + string parameter does not exist, it will be created. The array will be created as: + \*DIM,StrArray,STRING,nChar,nRead + + 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. + + ext : str + Filename extension (eight-character maximum). + + nchar : str + Number of characters per line to read (default is length of the longest line in the file). + + nskip : str + Number of lines to skip at the start of the file (default is 0). + + nread : str + Number of lines to read from the file (default is the entire file). + + Notes + ----- + + .. warning:: + + This function contains specificities regarding the argument definitions. + Please refer to the `command documentation `_ + for further explanations. + + **Argument Descriptions** + + .. _a-SREAD_argdescript: + + * ``strarray : str`` - Name of the string array parameter which will hold the read file. String + array parameters are similar to character arrays, but each array element can be as long as 248 + characters. If the string parameter does not exist, it will be created. The array will be created + as: \*DIM,StrArray,STRING,nChar,nRead + + * ``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. + * ``ext : str`` - Filename extension (eight-character maximum). + * ``nchar : str`` - Number of characters per line to read (default is length of the longest line in + the file). + + * ``nskip : str`` - Number of lines to skip at the start of the file (default is 0). + + * ``nread : str`` - Number of lines to read from the file (default is the entire file). + + .. _a-SREAD_notes: + + The :ref:`sread` command reads from a file into a string array parameter. The file must be an ASCII + text file. + """ + command = f"*SREAD,{strarray},{fname},{ext},,{nchar},{nskip},{nread}" + return self.run(command, **kwargs) + + def starvplot( + self, + parx: str = "", + pary: str = "", + y2: str = "", + y3: str = "", + y4: str = "", + y5: str = "", + y6: str = "", + y7: str = "", + y8: str = "", + **kwargs, + ): + r"""Graphs columns (vectors) of array parameters. + + Mechanical APDL Command: `\*VPLOT `_ + + Parameters + ---------- + parx : str + Name of the array parameter whose column vector values will be the abscissa of the graph. If + blank, row subscript numbers are used instead. ``ParX`` is not sorted by the program. + + pary : str + Additional column subscript of the ``ParY`` array parameter whose values are to be graphed + against the ``ParX`` values. + + y2 : str + Additional column subscript of the ``ParY`` array parameter whose values are to be graphed + against the ``ParX`` values. + + y3 : str + Additional column subscript of the ``ParY`` array parameter whose values are to be graphed + against the ``ParX`` values. + + y4 : str + Additional column subscript of the ``ParY`` array parameter whose values are to be graphed + against the ``ParX`` values. + + y5 : str + Additional column subscript of the ``ParY`` array parameter whose values are to be graphed + against the ``ParX`` values. + + y6 : str + Additional column subscript of the ``ParY`` array parameter whose values are to be graphed + against the ``ParX`` values. + + y7 : str + Additional column subscript of the ``ParY`` array parameter whose values are to be graphed + against the ``ParX`` values. + + y8 : str + Additional column subscript of the ``ParY`` array parameter whose values are to be graphed + against the ``ParX`` values. + + Notes + ----- + + .. warning:: + + This function contains specificities regarding the argument definitions. + Please refer to the `command documentation `_ + for further explanations. + + **Argument Descriptions** + + .. _a-VPLOT_argdescript: + + * ``parx : str`` - Name of the array parameter whose column vector values will be the abscissa of + the graph. If blank, row subscript numbers are used instead. ``ParX`` is not sorted by the program. + + * ``pary : str`` - Name of the array parameter whose column vector values will be graphed against + the ``ParX`` values. + + * ``y2, y3, y4,..., y8 : str`` - Additional column subscript of the ``ParY`` array parameter + whose values are to be graphed against the ``ParX`` values. + + .. _a-VPLOT_notes: + + The column to be graphed and the starting row for each array parameter must be specified as + subscripts. Additional columns of the ``ParY`` array parameter may be graphed by specifying column + numbers for ``Y2``, ``Y3``,..., ``Y8``. For example, :ref:`starvplot`,TIME (4,6), DISP (8,1),2,3 + specifies that the 1st, 2nd, and 3rd columns of array parameter DISP (all starting at row 8) are to + be graphed against the 6th column of array parameter TIME (starting at row 4). The columns are + graphed from the starting row to their maximum extent. See the :ref:`vlen` and :ref:`vmask` commands + to limit or skip data to be graphed. The array parameters specified on the :ref:`starvplot` command + must be of the same type (type ARRAY or TABLE; ( :ref:`dim` ). Arrays of type TABLE are graphed as + continuous curves. Arrays of type ARRAY is displayed in bar chart fashion. + + The normal curve labeling scheme for :ref:`starvplot` is to label curve 1 "COL 1", curve 2 "COL 2" + and so on. You can use the :ref:`gcolumn` command to apply user-specified labels (8 characters + maximum) to your curves. See `Modifying Curve Labels + `_ + in the `Ansys Parametric Design Language Guide + `_ for more + information on using :ref:`gcolumn`. + + + When a graph plot reaches minimum or maximum y-axis limits, the program indicates the condition by + clipping the graph. The clip appears as a horizontal magenta line. Mechanical APDL calculates y-axis + limits + automatically; however, you can modify the (YMIN and YMAX) limits via the :ref:`yrange` command. + + This command is valid in any processor. + """ + command = f"*VPLOT,{parx},{pary},{y2},{y3},{y4},{y5},{y6},{y7},{y8}" + return self.run(command, **kwargs) + + def starvput( + self, + parr: str = "", + entity: str = "", + entnum: str = "", + item1: str = "", + it1num: str = "", + item2: str = "", + it2num: str = "", + kloop: str = "", + **kwargs, + ): + r"""Restores array parameter values into the Mechanical APDL database. + + Mechanical APDL Command: `\*VPUT `_ + + Parameters + ---------- + parr : str + The name of the input vector array parameter. See :ref:`starset` for name restrictions. The + parameter must exist as a dimensioned array ( :ref:`dim` ) with data input. + + entity : str + Entity keyword. Valid keywords are shown for ``Entity`` = in the table below. + + entnum : str + The number of the entity (as shown for ``ENTNUM`` = in the table below). + + item1 : str + The name of a particular item for the given entity. Valid items are as shown in the ``Item1`` + columns of the table below. + + it1num : str + The number (or label) for the specified ``Item1`` (if any). Valid ``IT1NUM`` values are as shown + in the ``IT1NUM`` columns of the table below. Some ``Item1`` labels do not require an ``IT1NUM`` + value. + + item2 : str + A second set of item labels and numbers to further qualify the item for which data is to be + stored. Most items do not require this level of information. + + it2num : str + A second set of item labels and numbers to further qualify the item for which data is to be + stored. Most items do not require this level of information. + + kloop : str + Field to be looped on: + + * ``0 or 2`` - Loop on the ``ENTNUM`` field (default). + + * ``3`` - Loop on the ``Item1`` field. + + * ``4`` - Loop on the ``IT1NUM`` field. Successive items are as shown with ``IT1NUM``. + + * ``5`` - Loop on the ``Item2`` field. + + * ``6`` - Loop on the ``IT2NUM`` field. Successive items are as shown with ``IT2NUM``. + + Notes + ----- + + .. warning:: + + This function contains specificities regarding the argument definitions. + Please refer to the `command documentation `_ + for further explanations. + + **Argument Descriptions** + + .. _a-VPUT_argdescript: + + * ``parr : str`` - The name of the input vector array parameter. See :ref:`starset` for name + restrictions. The parameter must exist as a dimensioned array ( :ref:`dim` ) with data input. + + * ``entity : str`` - Entity keyword. Valid keywords are shown for ``Entity`` = in the table below. + + * ``entnum : str`` - The number of the entity (as shown for ``ENTNUM`` = in the table below). + + * ``item1 : str`` - The name of a particular item for the given entity. Valid items are as shown in + the ``Item1`` columns of the table below. + + * ``it1num : str`` - The number (or label) for the specified ``Item1`` (if any). Valid ``IT1NUM`` + values are as shown in the ``IT1NUM`` columns of the table below. Some ``Item1`` labels do not + require an ``IT1NUM`` value. + + * ``item2, it2num : str`` - A second set of item labels and numbers to further qualify the item for + which data is to be stored. Most items do not require this level of information. + + * ``kloop : str`` - Field to be looped on: + + * ``0 or 2`` - Loop on the ``ENTNUM`` field (default). + + * ``3`` - Loop on the ``Item1`` field. + + * ``4`` - Loop on the ``IT1NUM`` field. Successive items are as shown with ``IT1NUM``. + + * ``5`` - Loop on the ``Item2`` field. + + * ``6`` - Loop on the ``IT2NUM`` field. Successive items are as shown with ``IT2NUM``. + + .. _a-VPUT_notes: + + The :ref:`starvput` command is not supported for PowerGraphics displays. Inconsistent results may be + obtained if this command is not used in :ref:`graphics`, FULL. + + Plot and print operations entered via the GUI ( Utility Menu> Pltcrtls, Utility Menu> Plot ) + incorporate the :ref:`avprin` command. This means that the principal and equivalent values are + recalculated. If you use :ref:`starvput` to put data back into the database, issue the plot commands + from the command line to preserve your data. + + This operation is basically the inverse of the :ref:`starvget` operation. Vector items are put + directly (without any coordinate system transformation) into the Mechanical APDL database. Items can + only + replace existing items of the database and not create new items. Degree of freedom results that are + replaced in the database are available for all subsequent postprocessing operations. Other results + are changed temporarily and are available mainly for the immediately following print and display + operations. The vector specification :ref:`vcum` does not apply to this command. The valid labels + for the location fields ( ``Entity``, ``ENTNUM``, ``Item1``, and ``IT1NUM`` ) are listed below. + ``Item2`` and ``IT2NUM`` are not currently used. Not all items from the :ref:`starvget` list are + allowed on :ref:`starvput`, as putting values into some locations could cause the database to be + inconsistent. + + This command is valid in any processor. + + .. _vput_tab_1: + + \*VPUT - POST1 Items + ******************** + + .. flat-table:: ``Entity`` = NODE, ``ENTNUM`` = ``n`` (node number) + :header-rows: 1 + + * - Item1 + - IT1NUM + - Description + * - Valid labels for nodal degree of freedom results are: + * - U + - X, Y, Z + - X, Y, or Z structural displacement. + * - ROT + - X, Y, Z + - X, Y, or Z structural rotation. + * - TEMP + - + - Temperature. For ``SHELL131`` and ``SHELL132`` elements with KEYOPT(3) = 0 or 1, use TBOT, TE2, TE3,..., TTOP instead of TEMP. Alternative get functions: TEMP(N), TBOT(N), TE2(N), etc. + * - PRES + - + - Pressure. + * - VOLT + - + - Electric potential. + * - MAG + - + - Magnetic scalar potential. + * - V + - X, Y, Z + - X, Y, or Z fluid velocity. X, Y, or Z nodal velocity in a transient structural analysis (analysis with :ref:`antype`,TRANS). + * - A + - X, Y, Z + - X, Y, or Z magnetic vector potential. X, Y, or Z nodal acceleration in a transient structural analysis (analysis with :ref:`antype`,TRANS). + * - CONC + - + - Concentration. + * - CURR + - + - Current. + * - EMF + - + - Electromotive force drop. + * - Valid labels for element nodal results are: + * - Item1 + - IT1NUM + - Description + * - S + - X, Y, Z, XY, YZ, XZ + - Component stress. + * - " + - 1, 2, 3 + - Principal stress. + * - " + - INT, EQV + - Stress intensity or equivalent stress. + * - EPTO + - X, Y, Z, XY, YZ, XZ + - Component total strain (EPEL + EPPL + EPCR). + * - " + - 1,2,3 + - Principal total strain. + * - " + - INT, EQV + - Total strain intensity or total equivalent strain. + * - EPEL + - X, Y, Z, XY, YZ, XZ + - Component elastic strain. + * - " + - 1, 2, 3 + - Principal elastic strain. + * - " + - INT, EQV + - Elastic strain intensity or elastic equivalent strain. + * - EPPL + - X, Y, Z, XY, YZ, XZ + - Component plastic strain. + * - " + - 1,2,3 + - Principal plastic strain. + * - " + - INT, EQV + - Plastic strain intensity or plastic equivalent strain. + * - EPCR + - X, Y, Z, XY, YZ, XZ + - Component creep strain. + * - " + - 1, 2, 3 + - Principal creep strain. + * - " + - INT, EQV + - Creep strain intensity or creep equivalent strain. + * - EPTH + - X, Y, Z, XY, YZ, XZ + - Component thermal strain. + * - " + - 1, 2, 3 + - Principal thermal strain. + * - " + - INT, EQV + - Thermal strain intensity or thermal equivalent strain. + * - EPSW + - + - Swelling strain. + * - NL + - SEPL + - Equivalent stress (from stress-strain curve). + * - " + - SRAT + - Stress state ratio. + * - " + - HPRES + - Hydrostatic pressure. + * - " + - EPEQ + - Accumulated equivalent plastic strain. + * - " + - PSV + - Plastic state variable. + * - " + - PLWK + - Plastic work/volume. + * - TG + - X, Y, Z + - Component thermal gradient. + * - TF + - X, Y, Z + - Component thermal flux. + * - PG + - X, Y, Z + - Component pressure gradient. + * - EF + - X, Y, Z + - Component electric field. + * - D + - X, Y, Z + - Component electric flux density. + * - H + - X, Y, Z + - Component magnetic field intensity. + * - B + - X, Y, Z + - Component magnetic flux density. + * - FMAG + - X, Y, Z + - Component electromagnetic force. + * - **Entity= ELEM,** ``ENTNUM`` = ``n`` (element number) + * - Valid labels for element results are: + * - Item1 + - IT1NUM + - Description + * - ETAB + - Lab + - Any user-defined element table label ( :ref:`etable` ). + + """ + command = ( + f"*VPUT,{parr},{entity},{entnum},{item1},{it1num},{item2},{it2num},{kloop}" + ) + return self.run(command, **kwargs) + + def toper( + self, + parr: str = "", + par1: str = "", + oper: str = "", + par2: str = "", + fact1: str = "", + fact2: str = "", + con1: str = "", + **kwargs, + ): + r"""Operates on table parameters. + + Mechanical APDL Command: `\*TOPER `_ + + Parameters + ---------- + parr : str + Name of the resulting table parameter. The command will create a table array parameter with this + name. Any existing parameter with this name will be overwritten. + + par1 : str + Name of the first table parameter. + + oper : str + The operation to be performed: ADD. The operation is: ParR(i,j,k) = FACT1\2Par1(i,j,k) + FACT2 + *Par2(i,j,k) +CON1 + + par2 : str + Name of the second table parameter. + + fact1 : str + The first table parameter multiplying constant. Defaults to 1. + + fact2 : str + The second table parameter multiplying constant. Defaults to 1. + + con1 : str + The constant increment for offset. Defaults to 0. + + Notes + ----- + + .. warning:: + + This function contains specificities regarding the argument definitions. + Please refer to the `command documentation `_ + for further explanations. + + **Argument Descriptions** + + .. _TOPER_argdescript: + + * ``parr : str`` - Name of the resulting table parameter. The command will create a table array + parameter with this name. Any existing parameter with this name will be overwritten. + + * ``par1 : str`` - Name of the first table parameter. + + * ``oper : str`` - The operation to be performed: ADD. The operation is: ParR(i,j,k) = + FACT1\2Par1(i,j,k) + FACT2 *Par2(i,j,k) +CON1 + + * ``par2 : str`` - Name of the second table parameter. + + * ``fact1 : str`` - The first table parameter multiplying constant. Defaults to 1. + + * ``fact2 : str`` - The second table parameter multiplying constant. Defaults to 1. + + * ``con1 : str`` - The constant increment for offset. Defaults to 0. + + .. _TOPER_notes: + + :ref:`toper` operates on table parameters according to: ParR(i,j,k) = FACT1\2Par1(i,j,k) + FACT2 + *Par2(i,j,k) +CON1 + + Par1 and Par2 must have the same dimensions and the same variable names corresponding to those + dimensions. Par1 and Par2 must also have identical index values for rows, columns, etc. + + If you want a local coordinate system for the resulting array, you must dimension it as such using + the :ref:`dim` command before issuing :ref:`toper`. + + This command is valid in any processor. + """ + command = f"*TOPER,{parr},{par1},{oper},{par2},{fact1},{fact2},{con1}" + return self.run(command, **kwargs) + + def vabs( + self, + kabsr: str = "", + kabs1: str = "", + kabs2: str = "", + kabs3: str = "", + **kwargs, + ): + r"""Applies the absolute value function to array parameters. + + Mechanical APDL Command: `\*VABS `_ + + Parameters + ---------- + kabsr : str + Absolute value of results parameter: + + * ``0`` - Do not take absolute value of results parameter (ParR). + + * ``1`` - Take absolute value. + + kabs1 : str + Absolute value of first parameter: + + * ``0`` - Do not take absolute value of first parameter (Par1 or ParI). + + * ``1`` - Take absolute value. + + kabs2 : str + Absolute value of second parameter: + + * ``0`` - Do not take absolute value of second parameter (Par2 or ParJ). + + * ``1`` - Take absolute value. + + kabs3 : str + Absolute value of third parameter: + + * ``0`` - Do not take absolute value of third parameter (Par3 or ParK). + + * ``1`` - Take absolute value. + + Notes + ----- + + .. warning:: + + This function contains specificities regarding the argument definitions. + Please refer to the `command documentation `_ + for further explanations. + + **Argument Descriptions** + + .. _a-VABS_argdescript: + + * ``kabsr : str`` - Absolute value of results parameter: + + * ``0`` - Do not take absolute value of results parameter (ParR). + + * ``1`` - Take absolute value. + + * ``kabs1 : str`` - Absolute value of first parameter: + + * ``0`` - Do not take absolute value of first parameter (Par1 or ParI). + + * ``1`` - Take absolute value. + + * ``kabs2 : str`` - Absolute value of second parameter: + + * ``0`` - Do not take absolute value of second parameter (Par2 or ParJ). + + * ``1`` - Take absolute value. + + * ``kabs3 : str`` - Absolute value of third parameter: + + * ``0`` - Do not take absolute value of third parameter (Par3 or ParK). + + * ``1`` - Take absolute value. + + .. _a-VABS_notes: + + Applies an absolute value to parameters used in certain **\*V** ``XX`` and **\*M** ``XX`` + operations. Typical absolute value applications are of the form: ParR = \|f(\|Par1\|)\| + + or + + ParR = \|(\|Par1\| o \|Par2\|)\| + + The absolute values are applied to each input parameter value before the operation and to the result + value after the operation. Absolute values are applied before the scale factors so that negative + scale factors may be used. The absolute value settings are reset to the default (no absolute value) + after each **\*V** ``XX`` or **\*M** ``XX`` operation. Use :ref:`vstat` to list settings. + + This command is valid in any processor. + """ + command = f"*VABS,{kabsr},{kabs1},{kabs2},{kabs3}" + return self.run(command, **kwargs) + + def vcol(self, ncol1: str = "", ncol2: str = "", **kwargs): + r"""Specifies the number of columns in matrix operations. + + Mechanical APDL Command: `\*VCOL `_ + + Parameters + ---------- + ncol1 : str + Number of columns to be used for Par1 with **\*M** ``XX`` operations. Defaults to whatever is needed to fill the result array. + + ncol2 : str + Number of columns to be used for Par2 with **\*M** ``XX`` operations. Defaults to whatever is needed to fill the result array. + + Notes + ----- + + .. warning:: + + This function contains specificities regarding the argument definitions. + Please refer to the `command documentation `_ + for further explanations. + + **Argument Descriptions** + + .. _a-VCOL_argdescript: + + * ``ncol1 : str`` - Number of columns to be used for Par1 with **\*M** ``XX`` operations. Defaults + to whatever is needed to fill the result array. + + * ``ncol2 : str`` - Number of columns to be used for Par2 with **\*M** ``XX`` operations. Defaults + to whatever is needed to fill the result array. + + .. _a-VCOL_notes: + + Specifies the number of columns to be used in array parameter matrix operations. The size of the + submatrix used is determined from the upper left starting array element (defined on the operation + command) to the lower right array element (defined by the number of columns on this command and the + number of rows on the :ref:`vlen` command). + + The default ``NCOL`` is calculated from the maximum number of columns of the result array (the + :ref:`dim` column dimension) minus the starting location + 1. For example, :ref:`dim`,R,,1,10 and a + starting location of R(1,7) gives a default of 4 columns ( starting with R(1,7), R(1,8), R(1,9), and + R(1,10)). Repeat operations automatically terminate at the last column of the result array. Existing + values in the rows and columns of the results matrix remain unchanged where not overwritten by the + requested input or operation values. + + The column control settings are reset to the defaults after each **\*M** ``XX`` operation. Use + :ref:`vstat` to list settings. + + This command is valid in any processor. + """ + command = f"*VCOL,{ncol1},{ncol2}" + return self.run(command, **kwargs) + + def vcum(self, key: str = "", **kwargs): + r"""Allows array parameter results to add to existing results. + + Mechanical APDL Command: `\*VCUM `_ + + Parameters + ---------- + key : str + Accumulation key: + + * ``0`` - Overwrite results. + + * ``1`` - Add results to the current value of the results parameter. + + Notes + ----- + + .. warning:: + + This function contains specificities regarding the argument definitions. + Please refer to the `command documentation `_ + for further explanations. + + **Argument Descriptions** + + .. _a-VCUM_argdescript: + + * ``key : str`` - Accumulation key: + + * ``0`` - Overwrite results. + + * ``1`` - Add results to the current value of the results parameter. + + .. _a-VCUM_notes: + + Allows results from certain **\*V** ``XX`` and **\*M** ``XX`` operations to overwrite or add to + existing results. The cumulative operation is of the form: ParR = ParR + ParR(Previous) + + The cumulative setting is reset to the default (overwrite) after each **\*V** ``XX`` or **\*M** + ``XX`` operation. Use :ref:`vstat` to list settings. + + This command is valid in any processor. + """ + command = f"*VCUM,{key}" + return self.run(command, **kwargs) + + def vfact( + self, + factr: str = "", + fact1: str = "", + fact2: str = "", + fact3: str = "", + **kwargs, + ): + r"""Applies a scale factor to array parameters. + + Mechanical APDL Command: `\*VFACT `_ + + Parameters + ---------- + factr : str + Scale factor applied to results (ParR) parameter. Defaults to 1.0. + + fact1 : str + Scale factor applied to first parameter (Par1 or ParI). Defaults to 1.0. + + fact2 : str + Scale factor applied to second parameter (Par2 or ParJ). Defaults to 1.0. + + fact3 : str + Scale factor applied to third parameter (Par3 or ParK). Defaults to 1.0. + + Notes + ----- + + .. warning:: + + This function contains specificities regarding the argument definitions. + Please refer to the `command documentation `_ + for further explanations. + + **Argument Descriptions** + + .. _a-VFACT_argdescript: + + * ``factr : str`` - Scale factor applied to results (ParR) parameter. Defaults to 1.0. + + * ``fact1 : str`` - Scale factor applied to first parameter (Par1 or ParI). Defaults to 1.0. + + * ``fact2 : str`` - Scale factor applied to second parameter (Par2 or ParJ). Defaults to 1.0. + + * ``fact3 : str`` - Scale factor applied to third parameter (Par3 or ParK). Defaults to 1.0. + + .. _a-VFACT_notes: + + Applies a scale factor to parameters used in certain **\*V** ``XX`` and **\*M** ``XX`` operations. + Typical scale factor applications are of the form: ParR = ``FACTR`` \*f( ``FACT1`` \*Par1) + + or + + ParR = ``FACTR`` \*(( ``FACT1`` \*Par1) o ( ``FACT2`` \*Par2)) + + The factors are applied to each input parameter value before the operation and to the result value + after the operation. The scale factor settings are reset to the default (1.0) after each **\*V** + ``XX`` or **\*M** ``XX`` operation. Use :ref:`vstat` to list settings. + + This command is valid in any processor. + """ + command = f"*VFACT,{factr},{fact1},{fact2},{fact3}" + return self.run(command, **kwargs) + + def vfun( + self, + parr: str = "", + func: str = "", + par1: str = "", + con1: str = "", + con2: str = "", + con3: str = "", + **kwargs, + ): + r"""Performs a function on a single array parameter. + + Mechanical APDL Command: `\*VFUN `_ + + Parameters + ---------- + parr : str + The name of the resulting numeric array parameter vector. See :ref:`starset` for name + restrictions. + + func : str + Function to be performed: + + * ``ACOS`` - Arccosine: ACOS( ``Par1`` ). + + * ``ASIN`` - Arcsine: ASIN( ``Par1`` ). + + * ``ASORT`` - Par1 is sorted in ascending order. :ref:`vcol`, :ref:`vmask`, :ref:`vcum`, and + :ref:`vlen`,,NINC do not apply. :ref:`vlen`,NROW does apply. + + * ``ATAN`` - Arctangent: ATAN( ``Par1`` ). + + * ``COMP`` - Compress: Selectively compresses data set. "True" ( :ref:`vmask` ) values of ``Par1`` + (or row positions to be considered according to the ``NINC`` value on the :ref:`vlen` command) are + written in compressed form to ``ParR``, starting at the specified position. + + * ``COPY`` - Copy: ``Par1`` copied to ``ParR``. + + * ``COS`` - Cosine: COS( ``Par1`` ). + + * ``COSH`` - Hyperbolic cosine: COSH( ``Par1`` ). + + * ``DIRCOS`` - Direction cosines of the principal stresses ( ``n`` X9). ``Par1`` contains the ``n`` + X6 component stresses for the ``n`` locations of the calculations. + + * ``DSORT`` - ``Par1`` is sorted in descending order. :ref:`vcol`, :ref:`vmask`, :ref:`vcum`, and + :ref:`vlen`,,NINC do not apply. :ref:`vlen`,NROW does apply. + + * ``EULER`` - Euler angles of the principal stresses ( ``n`` X3). ``Par1`` contains the ``n`` X6 + component stresses for the ``n`` locations of the calculations. + + * ``EXP`` - Exponential: EXP( ``Par1`` ). + + * ``EXPA`` - Expand: Reverse of the COMP function. All elements of ``Par1`` (starting at the + position specified) are written in expanded form to corresponding "true" ( :ref:`vmask` ) positions + (or row positions to be considered according to the ``NINC`` value on the :ref:`vlen` command) of + ``ParR``. + + * ``LOG`` - Natural logarithm: LOG( ``Par1`` ). + + * ``LOG10`` - Common logarithm: LOG10( ``Par1`` ). + + * ``NINT`` - Nearest integer: 2.783 becomes 3.0, -1.75 becomes -2.0. + + * ``NOT`` - Logical complement: values :math:`equation not available` 0.0 (false) become 1.0 + (true). Values > 0.0 (true) become0.0 (false). + + * ``PRIN`` - Principal stresses ( ``n`` X5). ``Par1`` contains the ``n`` X6 component stresses for + the ``n`` locations of the calculations. + + * ``PWR`` - Power function: ``Par1`` \*\* ``CON1`` . Exponentiation of any negative number in the vector ``Par1`` to a non-integer power is performed by exponentiating the positive number and prepending the minus sign. For example, -4\*\*2.3 is -(4\*\*2.3). + + * ``SIN`` - Sine: SIN( ``Par1`` ). + + * ``SINH`` - Hyperbolic sine: SINH( ``Par1`` ). + + * ``SQRT`` - Square root: SQRT( ``Par1`` ). + + * ``TAN`` - Tangent: TAN( ``Par1`` ). + + * ``TANH`` - Hyperbolic tangent: TANH( ``Par1`` ). + + * ``TANG`` - Tangent to a path at a point: the slope at a point is determined by linear + interpolation half way between the previous and next points. Points are assumed to be in the global + Cartesian coordinate system. Path points are specified in array ``Par1`` (having 3 consecutive + columns of data, with the columns containing the x, y, and z coordinate locations, respectively, of + the points). Only the starting row index and the column index for the x coordinates are specified, + such as A(1,1). The y and z coordinates of the vector are assumed to begin in the corresponding next + columns, such as A(1,2) and A(1,3). The tangent result, ``ParR``, must also have 3 consecutive + columns of data and will contain the tangent direction vector (normalized to 1.0); such as 1,0,0 for + an x-direction vector. + + * ``NORM`` - Normal to a path and an input vector at a point: determined from the cross-product of + the calculated tangent vector (see TANG) and the input direction vector (with the i, j, and k + components input as ``CON1``, ``CON2``, and ``CON3`` ). Points are assumed to be in the global + Cartesian coordinate system. Path points are specified in array ``Par1`` (having 3 consecutive + columns of data, with the columns containing the x, y, and z coordinate locations, respectively, of + the points). Only the starting row index and the column index for the x coordinates are specified, + such as A(1,1). The y and z coordinates of the vector are assumed to begin in the corresponding next + columns, such as A(1,2) and A(1,3). The normal result, ``ParR``, must also have 3 consecutive + columns of data and will contain the normal direction vector (normalized to 1.0); such as 1,0,0 for + an x-direction vector. + + * ``LOCAL`` - Transforms global Cartesian coordinates of a point to the coordinates of a specified + system: points to be transformed are specified in array ``Par1`` (having 3 consecutive columns of + data, with the columns containing the x, y, and z global Cartesian coordinate locations, + respectively, of the points). Only the starting row index and the column index for the x coordinates + are specified, such as A(1,1). The y and z coordinates of the vector are assumed to begin in the + corresponding next columns, such as A(1,2) and A(1,3). Results are transformed to coordinate system + ``CON1`` (which may be any valid coordinate system number, such as 1,2,11,12, etc.). The transformed + result, ``ParR``, must also have 3 consecutive columns of data and will contain the corresponding + transformed coordinate locations. + + * ``GLOBAL`` - Transforms specified coordinates of a point to global Cartesian coordinates: points + to be transformed are specified in array ``Par1`` (having 3 consecutive columns of data, with the + columns containing the local coordinate locations (x, y, z or r, θ, z or etc.) of the + points). Only the starting row index and the column index for the x coordinates are specified, such + as A(1,1). The y and z coordinates (or θ and z, or etc.) of the vector are assumed to begin + in the corresponding next columns, such as A(1,2) and A(1,3). Local coordinate locations are assumed + to be in coordinate system ``CON1`` (which may be any valid coordinate system number, such as + 1,2,11,12, etc.). The transformed result, ``ParR``, must also have 3 consecutive columns of data, + with the columns containing the global Cartesian x, y, and z coordinate locations, respectively. + + par1 : str + Array parameter vector in the operation. + + con1 : str + Constants (used only with the PWR, NORM, LOCAL, and GLOBAL functions). + + con2 : str + Constants (used only with the PWR, NORM, LOCAL, and GLOBAL functions). + + con3 : str + Constants (used only with the PWR, NORM, LOCAL, and GLOBAL functions). + + Notes + ----- + + .. warning:: + + This function contains specificities regarding the argument definitions. + Please refer to the `command documentation `_ + for further explanations. + + **Argument Descriptions** + + .. _a-VFUN_argdescript: + + * ``parr : str`` - The name of the resulting numeric array parameter vector. See :ref:`starset` for + name restrictions. + + * ``func : str`` - Function to be performed: + + * ``ACOS`` - Arccosine: ACOS( ``Par1`` ). + + * ``ASIN`` - Arcsine: ASIN( ``Par1`` ). + + * ``ASORT`` - Par1 is sorted in ascending order. :ref:`vcol`, :ref:`vmask`, :ref:`vcum`, and + :ref:`vlen`,,NINC do not apply. :ref:`vlen`,NROW does apply. + + * ``ATAN`` - Arctangent: ATAN( ``Par1`` ). + + * ``COMP`` - Compress: Selectively compresses data set. "True" ( :ref:`vmask` ) values of ``Par1`` + (or row positions to be considered according to the ``NINC`` value on the :ref:`vlen` command) are + written in compressed form to ``ParR``, starting at the specified position. + + * ``COPY`` - Copy: ``Par1`` copied to ``ParR``. + + * ``COS`` - Cosine: COS( ``Par1`` ). + + * ``COSH`` - Hyperbolic cosine: COSH( ``Par1`` ). + + * ``DIRCOS`` - Direction cosines of the principal stresses ( ``n`` X9). ``Par1`` contains the ``n`` + X6 component stresses for the ``n`` locations of the calculations. + + * ``DSORT`` - ``Par1`` is sorted in descending order. :ref:`vcol`, :ref:`vmask`, :ref:`vcum`, and + :ref:`vlen`,,NINC do not apply. :ref:`vlen`,NROW does apply. + + * ``EULER`` - Euler angles of the principal stresses ( ``n`` X3). ``Par1`` contains the ``n`` X6 + component stresses for the ``n`` locations of the calculations. + + * ``EXP`` - Exponential: EXP( ``Par1`` ). + + * ``EXPA`` - Expand: Reverse of the COMP function. All elements of ``Par1`` (starting at the + position specified) are written in expanded form to corresponding "true" ( :ref:`vmask` ) positions + (or row positions to be considered according to the ``NINC`` value on the :ref:`vlen` command) of + ``ParR``. + + * ``LOG`` - Natural logarithm: LOG( ``Par1`` ). + + * ``LOG10`` - Common logarithm: LOG10( ``Par1`` ). + + * ``NINT`` - Nearest integer: 2.783 becomes 3.0, -1.75 becomes -2.0. + + * ``NOT`` - Logical complement: values :math:`equation not available` 0.0 (false) become 1.0 + (true). Values > 0.0 (true) become0.0 (false). + + * ``PRIN`` - Principal stresses ( ``n`` X5). ``Par1`` contains the ``n`` X6 component stresses for + the ``n`` locations of the calculations. + + * ``PWR`` - Power function: ``Par1`` \*\* ``CON1`` . Exponentiation of any negative number in the vector ``Par1`` to a non-integer power is performed by exponentiating the positive number and prepending the minus sign. For example, -4\*\*2.3 is -(4\*\*2.3). + + * ``SIN`` - Sine: SIN( ``Par1`` ). + + * ``SINH`` - Hyperbolic sine: SINH( ``Par1`` ). + + * ``SQRT`` - Square root: SQRT( ``Par1`` ). + + * ``TAN`` - Tangent: TAN( ``Par1`` ). + + * ``TANH`` - Hyperbolic tangent: TANH( ``Par1`` ). + + * ``TANG`` - Tangent to a path at a point: the slope at a point is determined by linear + interpolation half way between the previous and next points. Points are assumed to be in the global + Cartesian coordinate system. Path points are specified in array ``Par1`` (having 3 consecutive + columns of data, with the columns containing the x, y, and z coordinate locations, respectively, of + the points). Only the starting row index and the column index for the x coordinates are specified, + such as A(1,1). The y and z coordinates of the vector are assumed to begin in the corresponding next + columns, such as A(1,2) and A(1,3). The tangent result, ``ParR``, must also have 3 consecutive + columns of data and will contain the tangent direction vector (normalized to 1.0); such as 1,0,0 for + an x-direction vector. + + * ``NORM`` - Normal to a path and an input vector at a point: determined from the cross-product of + the calculated tangent vector (see TANG) and the input direction vector (with the i, j, and k + components input as ``CON1``, ``CON2``, and ``CON3`` ). Points are assumed to be in the global + Cartesian coordinate system. Path points are specified in array ``Par1`` (having 3 consecutive + columns of data, with the columns containing the x, y, and z coordinate locations, respectively, of + the points). Only the starting row index and the column index for the x coordinates are specified, + such as A(1,1). The y and z coordinates of the vector are assumed to begin in the corresponding next + columns, such as A(1,2) and A(1,3). The normal result, ``ParR``, must also have 3 consecutive + columns of data and will contain the normal direction vector (normalized to 1.0); such as 1,0,0 for + an x-direction vector. + + * ``LOCAL`` - Transforms global Cartesian coordinates of a point to the coordinates of a specified + system: points to be transformed are specified in array ``Par1`` (having 3 consecutive columns of + data, with the columns containing the x, y, and z global Cartesian coordinate locations, + respectively, of the points). Only the starting row index and the column index for the x coordinates + are specified, such as A(1,1). The y and z coordinates of the vector are assumed to begin in the + corresponding next columns, such as A(1,2) and A(1,3). Results are transformed to coordinate system + ``CON1`` (which may be any valid coordinate system number, such as 1,2,11,12, etc.). The transformed + result, ``ParR``, must also have 3 consecutive columns of data and will contain the corresponding + transformed coordinate locations. + + * ``GLOBAL`` - Transforms specified coordinates of a point to global Cartesian coordinates: points + to be transformed are specified in array ``Par1`` (having 3 consecutive columns of data, with the + columns containing the local coordinate locations (x, y, z or r, θ, z or etc.) of the + points). Only the starting row index and the column index for the x coordinates are specified, such + as A(1,1). The y and z coordinates (or θ and z, or etc.) of the vector are assumed to begin + in the corresponding next columns, such as A(1,2) and A(1,3). Local coordinate locations are assumed + to be in coordinate system ``CON1`` (which may be any valid coordinate system number, such as + 1,2,11,12, etc.). The transformed result, ``ParR``, must also have 3 consecutive columns of data, + with the columns containing the global Cartesian x, y, and z coordinate locations, respectively. + + * ``par1 : str`` - Array parameter vector in the operation. + + * ``con1, con2, con3 : str`` - Constants (used only with the PWR, NORM, LOCAL, and GLOBAL + functions). + + .. _a-VFUN_notes: + + Operates on one input array parameter vector and produces one output array parameter vector + according to: ``ParR`` = f( ``Par1`` ) + + where the functions (f) are described below. Functions are based on the standard FORTRAN definitions + where possible. Out-of-range function results (or results with exponents whose magnitudes are + approximately greater than 32 or less than -32) produce a zero value. Input and output for angular + functions may be radians (default) or degrees ( :ref:`afun` ). ``ParR`` may be the same as ``Par1``. + Starting array element numbers must be defined for each array parameter vector if it does not start + at the first location. For example, :ref:`vfun`,A,SQRT,B(5) takes the square root of the fifth + element of B and stores the result in the first element of A. Operations continue on successive + array elements ( :ref:`vlen`, :ref:`vmask` ) with the default being all successive elements. + Absolute values and scale factors may be applied to all parameters ( :ref:`vabs`, :ref:`vfact` ). + Results may be cumulative ( :ref:`vcum` ). Skipping array elements via :ref:`vmask` or :ref:`vlen` + for the TANG and NORM functions skips only the writing of the results (skipped array element data + are used in all calculations). See the :ref:`voper` command for details. + + This command is valid in any processor. + """ + command = f"*VFUN,{parr},{func},{par1},{con1},{con2},{con3}" + return self.run(command, **kwargs) + + def vitrp( + self, + parr: str = "", + part: str = "", + pari: str = "", + parj: str = "", + park: str = "", + **kwargs, + ): + r"""Forms an array parameter by interpolation of a table. + + Mechanical APDL Command: `\*VITRP `_ + + Parameters + ---------- + parr : str + The name of the resulting array parameter. See :ref:`starset` for name restrictions. + + part : str + The name of the TABLE array parameter. The parameter must exist as a dimensioned array of type + TABLE ( :ref:`dim` ). + + pari : str + Array parameter vector of I (row) index values for interpolation in ``ParT``. + + parj : str + Array parameter vector of J (column) index values for interpolation in ``ParT`` (which must be + at least 2D). + + park : str + Array parameter vector of K (depth) index values for interpolation in ``ParT`` (which must be + 3D). + + Notes + ----- + + .. warning:: + + This function contains specificities regarding the argument definitions. + Please refer to the `command documentation `_ + for further explanations. + + **Argument Descriptions** + + .. _a-VITRP_argdescript: + + * ``parr : str`` - The name of the resulting array parameter. See :ref:`starset` for name + restrictions. + + * ``part : str`` - The name of the TABLE array parameter. The parameter must exist as a dimensioned + array of type TABLE ( :ref:`dim` ). + + * ``pari : str`` - Array parameter vector of I (row) index values for interpolation in ``ParT``. + + * ``parj : str`` - Array parameter vector of J (column) index values for interpolation in ``ParT`` + (which must be at least 2D). + + * ``park : str`` - Array parameter vector of K (depth) index values for interpolation in ``ParT`` + (which must be 3D). + + .. _a-VITRP_notes: + + Forms an array parameter (of type ARRAY) by interpolating values of an array parameter (of type + TABLE) at specified table index locations according to: ``ParR`` = f( ``ParT``, ``Parl``, ``ParJ``, + ``ParK`` ) + + where ``ParT`` is the type TABLE array parameter, and ``ParI``, ``ParJ``, ``ParK`` are the type + ARRAY array parameter vectors of index values for interpolation in ``ParT``. See the :ref:`dim` + command for TABLE and ARRAY declaration types. Linear interpolation is used. The starting array + element number for the TABLE array ( ``ParT`` ) is not used (but a value must be input). Starting + array element numbers must be defined for each array parameter vector if it does not start at the + first location. For example, :ref:`vitrp`,R(5),TAB(1,1),X(2),Y(4) uses the second element of X and + the fourth element of Y as index values (row and column) for a 2D interpolation in TAB and stores + the result in the fifth element of R. Operations continue on successive array elements ( + :ref:`vlen`, :ref:`vmask` ) with the default being all successive elements. Absolute values and + scale factors may be applied to the result parameter ( :ref:`vabs`, :ref:`vfact` ). Results may be + cumulative ( :ref:`vcum` ). See the :ref:`voper` command for details. + + This command is valid in any processor. + """ + command = f"*VITRP,{parr},{part},{pari},{parj},{park}" + return self.run(command, **kwargs) + + def vlen(self, nrow: str = "", ninc: str = "", **kwargs): + r"""Specifies the number of rows to be used in array parameter operations. + + Mechanical APDL Command: `\*VLEN `_ + + Parameters + ---------- + nrow : str + Number of rows to be used with the **\*V** ``XX`` or **\*M** ``XX`` operations. Defaults to the number of rows needed to fill the result array. + + ninc : str + Perform the operation on every ``NINC`` row (defaults to 1). + + Notes + ----- + + .. warning:: + + This function contains specificities regarding the argument definitions. + Please refer to the `command documentation `_ + for further explanations. + + **Argument Descriptions** + + .. _a-VLEN_argdescript: + + * ``nrow : str`` - Number of rows to be used with the **\*V** ``XX`` or **\*M** ``XX`` operations. + Defaults to the number of rows needed to fill the result array. + + * ``ninc : str`` - Perform the operation on every ``NINC`` row (defaults to 1). + + .. _a-VLEN_notes: + + Specifies the number of rows to be used in array parameter operations. The size of the submatrix + used is determined from the upper left starting array element (defined on the operation command) to + the lower right array element (defined by the number of rows on this command and the number of + columns on the :ref:`vcol` command). ``NINC`` allows skipping row operations for some operation + commands. Skipped rows are included in the row count. The starting row number must be defined on the + operation command for each parameter read and for the result written. + + The default ``NROW`` is calculated from the maximum number of rows of the result array (the + :ref:`dim` row dimension) minus the starting location + 1. For example, :ref:`dim`,R,,10 and a + starting location of R(7) gives a default of 4 loops (filling R(7), R(8), R(9), and R(10)). Repeat + operations automatically terminate at the last row of the result array. Existing values in the rows + and columns of the results matrix remain unchanged where not overwritten by the requested input or + operation values. + + The stride ( ``NINC`` ) allows operations to be performed at regular intervals. It has no effect on + the total number of row operations. Skipped operations retain the previous result. For example, + :ref:`dim`,R,,6, with a starting location of R(1), ``NROW`` = 10, and ``NINC`` = 2 calculates values + for locations R(1), R(3), and R(5) and retains values for locations R(2), R(4), and R(6). A more + general skip control may be done by masking ( :ref:`vmask` ). The row control settings are reset to + the defaults after each **\*V** ``XX`` or **\*M** ``XX`` operation. Use :ref:`vstat` to list + settings. + + This command is valid in any processor. + """ + command = f"*VLEN,{nrow},{ninc}" + return self.run(command, **kwargs) + + def vmask(self, par: str = "", **kwargs): + r"""Specifies an array parameter as a masking vector. + + Mechanical APDL Command: `\*VMASK `_ + + Parameters + ---------- + par : str + Name of the mask parameter. The starting subscript must also be specified. + + Notes + ----- + + .. warning:: + + This function contains specificities regarding the argument definitions. + Please refer to the `command documentation `_ + for further explanations. + + **Argument Descriptions** + + .. _a-VMASK_argdescript: + + * ``par : str`` - Name of the mask parameter. The starting subscript must also be specified. + + .. _a-VMASK_notes: + + Specifies the name of the parameter whose values are to be checked for each resulting row operation. + The mask vector usually contains only 0 (for false) and 1 (for true) values. For each row operation + the corresponding mask vector value is checked. A true value allows the operation to be done. A + false value skips the operation (and retains the previous results). A mask vector can be created + from direct input, such as M(1) = 1,0,0,1,1,0,1; or from the DATA function of the :ref:`vfill` + command. The NOT function of the :ref:`vfun` command can be used to reverse the logical sense of the + mask vector. The logical compare operations (LT, LE, EQ, NE, GE, and GT) of the :ref:`voper` command + also produce a mask vector by operating on two other vectors. Any numeric vector can be used as a + mask vector since the actual interpretation assumes values less than 0.0 are 0.0 (false) and values + greater than 0.0 are 1.0 (true). If the mask vector is not specified (or has fewer values than the + result vector), true (1.0) values are assumed for the unspecified values. Another skip control may + be input with ``NINC`` on the :ref:`vlen` command. If both are present, operations occur only when + both are true. The mask setting is reset to the default (no mask) after each **\*V** ``XX`` or + **\*M** ``XX`` operation. Use :ref:`vstat` to list settings. + + This command is valid in any processor. + """ + command = f"*VMASK,{par}" + return self.run(command, **kwargs) + + def voper( + self, + parr: str = "", + par1: str = "", + oper: str = "", + par2: str = "", + con1: str = "", + con2: str = "", + **kwargs, + ): + r"""Operates on two array parameters. + + Mechanical APDL Command: `\*VOPER `_ + + Parameters + ---------- + parr : str + The name of the resulting array parameter vector. See :ref:`starset` for name restrictions. + + par1 : str + First array parameter vector in the operation. May also be a scalar parameter or a literal + constant. + + oper : str + Operations: + + * ``ADD`` - Addition: ``Par1`` + ``Par2``. + + * ``SUB`` - Subtraction: ``Par1`` - ``Par2``. + + * ``MULT`` - Multiplication: ``Par1`` \* ``Par2`` . + + * ``DIV`` - Division: ``Par1`` / ``Par2`` (a divide by zero results in a value of zero). + + * ``MIN`` - Minimum: minimum of ``Par1`` and ``Par2``. + + * ``MAX`` - Maximum: maximum of ``Par1`` and ``Par2``. + + * ``LT`` - Less than comparison: ``Par1`` < ``Par2`` gives 1.0 if true, 0.0 if false. + + * ``LE`` - Less than or equal comparison: ``Par1`` :math:`equation not available` ``Par2`` gives + 1.0 if true, 0.0 if false. + + * ``EQ`` - Equal comparison: ``Par1`` = ``Par2`` gives 1.0 if true, 0.0 if false. + + * ``NE`` - Not equal comparison: ``Par1`` ≠ ``Par2`` gives 1.0 if true, 0.0 if false. + + * ``GE`` - Greater than or equal comparison: ``Par1`` :math:`equation not available` Par2 gives 1.0 + if true, 0.0 if false. + + * ``GT`` - Greater than comparison: ``Par1`` > ``Par2`` gives 1.0 if true, 0.0 if false. + + * ``DER1`` - First derivative: d( ``Par1`` )/d( ``Par2`` ). The derivative at a point is determined + over points half way between the previous and next points (by linear interpolation). ``Par1`` must + be a function (a unique ``Par1`` value for each ``Par2`` value) and ``Par2`` must be in ascending + order. + + * ``DER2`` - Second derivative: d :sup:`2` ( ``Par1`` )/d( ``Par2`` ) :sup:`2`. See also DER1. + + * ``INT1`` - Single integral: ``Par1`` d( ``Par2`` ), where ``CON1`` is the integration constant. + The integral at a point is determined by using the single integration procedure described in the + `Mechanical APDL Theory Reference `_. + + * ``INT2`` - Double integral: ``Par1`` d( ``Par2`` ), where ``CON1`` is the integration constant + of the first integral and ``CON2`` is the integration constant of the second integral. If ``Par1`` + contains acceleration data, ``CON1`` is the initial velocity and ``CON2`` is the initial + displacement. See also INT1. + + * ``DOT`` - Dot product: ``Par1``. ``Par2``. ``Par1`` and ``Par2`` must each have three consecutive + columns of data, with the columns containing the i, j, and k vector components, respectively. Only + the starting row index and the column index for the i components are specified for ``Par1`` and + ``Par2``, such as A(1,1). The j and k components of the vector are assumed to begin in the + corresponding next columns, such as A(1,2) and A(1,3). + + * ``CROSS`` - Cross product: ``Par1`` x ``Par2``. ``Par1``, ``Par2``, and ``ParR`` must each have 3 + components, respectively. Only the starting row index and the column index for the i components are + specified for ``Par1``, ``Par2``, and ``ParR``, such as A(1,1). The j and k components of the vector + are assumed to begin in the corresponding next columns, such as A(1,2) and A(1,3). + + * ``GATH`` - Gather: For a vector of position numbers, ``Par2``, copy the value of ``Par1`` at each + position number to ``ParR``. Example: for ``Par1`` = 10,20,30,40 and ``Par2`` = 2,4,1; ``ParR`` = + 20,40,10. + + * ``SCAT`` - Scatter: Opposite of GATH operation. For a vector of position numbers, ``Par2``, copy + the value of ``Par1`` to that position number in ``ParR``. Example: for ``Par1`` = 10,20,30,40,50 + and ``Par2`` = 2,1,0,5,3; ``ParR`` = 20,10,50,0,40. + + * ``ATN2`` - Arctangent: arctangent of ``Par1`` / ``Par2`` with the sign of each component + considered. + + * ``LOCAL`` - Transform the data in ``Par1`` from the global Cartesian coordinate system to the + local coordinate system given in ``CON1``. ``Par1`` must be an N x 3 (that is, vector) or an N x 6 + (that is, stress or strain tensor) array. If the local coordinate system is a cylindrical, + spherical, or toroidal system, then you must provide the global Cartesian coordinates in ``Par2`` as + an N x 3 array. Set ``CON2`` = 1 if the data is strain data. + + * ``GLOBAL`` - Transform the data in ``Par1`` from the local coordinate system given in ``CON1`` to + the global Cartesian coordinate system. ``Par1`` must be an N x 3 (that is, vector) or an N x 6 + (that is, stress or strain tensor) array. If the local coordinate system is a cylindrical, + spherical, or toroidal system, then you must provide the global Cartesian coordinates in ``Par2`` as + an N x 3 array. Set ``CON2`` = 1 if the data is strain data. + + par2 : str + Second array parameter vector in the operation. May also be a scalar parameter or a literal + constant. + + con1 : str + First constant (used only with the INT1 and INT2 operations). + + con2 : str + Second constant (used only with the INT2 operation). + + Notes + ----- + + .. warning:: + + This function contains specificities regarding the argument definitions. + Please refer to the `command documentation `_ + for further explanations. + + **Argument Descriptions** + + .. _a-VOPER_argdescript: + + * ``parr : str`` - The name of the resulting array parameter vector. See :ref:`starset` for name + restrictions. + + * ``par1 : str`` - First array parameter vector in the operation. May also be a scalar parameter or + a literal constant. + + * ``oper : str`` - Operations: + + * ``ADD`` - Addition: ``Par1`` + ``Par2``. + + * ``SUB`` - Subtraction: ``Par1`` - ``Par2``. + + * ``MULT`` - Multiplication: ``Par1`` \* ``Par2`` . + + * ``DIV`` - Division: ``Par1`` / ``Par2`` (a divide by zero results in a value of zero). + + * ``MIN`` - Minimum: minimum of ``Par1`` and ``Par2``. + + * ``MAX`` - Maximum: maximum of ``Par1`` and ``Par2``. + + * ``LT`` - Less than comparison: ``Par1`` < ``Par2`` gives 1.0 if true, 0.0 if false. + + * ``LE`` - Less than or equal comparison: ``Par1`` :math:`equation not available` ``Par2`` gives + 1.0 if true, 0.0 if false. + + * ``EQ`` - Equal comparison: ``Par1`` = ``Par2`` gives 1.0 if true, 0.0 if false. + + * ``NE`` - Not equal comparison: ``Par1`` ≠ ``Par2`` gives 1.0 if true, 0.0 if false. + + * ``GE`` - Greater than or equal comparison: ``Par1`` :math:`equation not available` Par2 gives 1.0 + if true, 0.0 if false. + + * ``GT`` - Greater than comparison: ``Par1`` > ``Par2`` gives 1.0 if true, 0.0 if false. + + * ``DER1`` - First derivative: d( ``Par1`` )/d( ``Par2`` ). The derivative at a point is determined + over points half way between the previous and next points (by linear interpolation). ``Par1`` must + be a function (a unique ``Par1`` value for each ``Par2`` value) and ``Par2`` must be in ascending + order. + + * ``DER2`` - Second derivative: d :sup:`2` ( ``Par1`` )/d( ``Par2`` ) :sup:`2`. See also DER1. + + * ``INT1`` - Single integral: ``Par1`` d( ``Par2`` ), where ``CON1`` is the integration constant. + The integral at a point is determined by using the single integration procedure described in the + `Mechanical APDL Theory Reference `_. + + * ``INT2`` - Double integral: ``Par1`` d( ``Par2`` ), where ``CON1`` is the integration constant + of the first integral and ``CON2`` is the integration constant of the second integral. If ``Par1`` + contains acceleration data, ``CON1`` is the initial velocity and ``CON2`` is the initial + displacement. See also INT1. + + * ``DOT`` - Dot product: ``Par1``. ``Par2``. ``Par1`` and ``Par2`` must each have three consecutive + columns of data, with the columns containing the i, j, and k vector components, respectively. Only + the starting row index and the column index for the i components are specified for ``Par1`` and + ``Par2``, such as A(1,1). The j and k components of the vector are assumed to begin in the + corresponding next columns, such as A(1,2) and A(1,3). + + * ``CROSS`` - Cross product: ``Par1`` x ``Par2``. ``Par1``, ``Par2``, and ``ParR`` must each have 3 + components, respectively. Only the starting row index and the column index for the i components are + specified for ``Par1``, ``Par2``, and ``ParR``, such as A(1,1). The j and k components of the vector + are assumed to begin in the corresponding next columns, such as A(1,2) and A(1,3). + + * ``GATH`` - Gather: For a vector of position numbers, ``Par2``, copy the value of ``Par1`` at each + position number to ``ParR``. Example: for ``Par1`` = 10,20,30,40 and ``Par2`` = 2,4,1; ``ParR`` = + 20,40,10. + + * ``SCAT`` - Scatter: Opposite of GATH operation. For a vector of position numbers, ``Par2``, copy + the value of ``Par1`` to that position number in ``ParR``. Example: for ``Par1`` = 10,20,30,40,50 + and ``Par2`` = 2,1,0,5,3; ``ParR`` = 20,10,50,0,40. + + * ``ATN2`` - Arctangent: arctangent of ``Par1`` / ``Par2`` with the sign of each component + considered. + + * ``LOCAL`` - Transform the data in ``Par1`` from the global Cartesian coordinate system to the + local coordinate system given in ``CON1``. ``Par1`` must be an N x 3 (that is, vector) or an N x 6 + (that is, stress or strain tensor) array. If the local coordinate system is a cylindrical, + spherical, or toroidal system, then you must provide the global Cartesian coordinates in ``Par2`` as + an N x 3 array. Set ``CON2`` = 1 if the data is strain data. + + * ``GLOBAL`` - Transform the data in ``Par1`` from the local coordinate system given in ``CON1`` to + the global Cartesian coordinate system. ``Par1`` must be an N x 3 (that is, vector) or an N x 6 + (that is, stress or strain tensor) array. If the local coordinate system is a cylindrical, + spherical, or toroidal system, then you must provide the global Cartesian coordinates in ``Par2`` as + an N x 3 array. Set ``CON2`` = 1 if the data is strain data. + + * ``par2 : str`` - Second array parameter vector in the operation. May also be a scalar parameter or + a literal constant. + + * ``con1 : str`` - First constant (used only with the INT1 and INT2 operations). + + * ``con2 : str`` - Second constant (used only with the INT2 operation). + + .. _a-VOPER_notes: + + Operates on two input array parameter vectors and produces one output array parameter vector + according to: ``ParR`` = ``Par1`` o ``Par2`` + + where the operations (o) are described below. ``ParR`` can be the same as ``Par1`` or ``Par2``. + + Absolute values and scale factors can be applied to all parameters ( :ref:`vabs`, :ref:`vfact` ). + Results can be cumulative ( :ref:`vcum` ). + + Starting array element numbers must be defined for each array parameter vector if it does not start + at the first location, such as :ref:`voper`,A,B(5),ADD,C(3) which adds the third element of C to the + fifth element of B and stores the result in the first element of A. + + Operations continue on successive array elements ( :ref:`vlen`, :ref:`vmask` ) with the default + being all successive elements. + + Skipping array elements via :ref:`vmask` or :ref:`vlen` for the DER and INT functions skips only + the writing of the results (skipped array element data are used in all calculations). + + Parameter functions and operations are available to operate on a scalar parameter or a single + element of an array parameter, such as SQRT(B) or SQRT(A(4)). (See :ref:`starset` for more + information.) + + Operations on a sequence of array elements can be performed by repeating the desired function or + operation in a do-loop ( ``*DO`` ). The vector operations within Mechanical APDLm ( **\*V** ``XX`` + commands) are internally programmed do-loops that conveniently perform the indicated operation over + a sequence of array elements. If the array is multidimensional, only the first subscript is + incremented in the do-loop; that is, the operation repeats in column vector fashion down the array. + For example, for A(1,5), A(2,5), A(3,5), etc. The starting location of the row index must be defined + for each parameter read and for the result written. + + The default number of loops is from the starting result location to the last result location and can + be altered via :ref:`vlen`. + + A logical mask vector can be defined to control at which locations the operations are to be skipped + ( :ref:`vmask` ). The default is to skip no locations. + + Repeat operations automatically terminate at the last array element of the result array column if + the number of loops is undefined or if it exceeds the last result array element. + + Zeroes are used in operations for values read beyond the last array element of an input array + column. Existing values in the rows and columns of the results matrix remain unchanged where not + changed by the requested operation values. + + The result array column may be the same as the input array column, as results in progress are stored + in a temporary array until being moved to the results array at the end of the operation. Results may + be overwritten or accumulated with the existing results ( :ref:`vcum` ). The default is to overwrite + results. + + The absolute value can be used for each parameter read or written ( :ref:`vabs` ). A scale factor + (defaulting to 1.0) is also applied to each parameter read and written ( :ref:`vfact` ). + + This command is valid in any processor. + """ + command = f"*VOPER,{parr},{par1},{oper},{par2},{con1},{con2}" + return self.run(command, **kwargs) + + def vscfun(self, parr: str = "", func: str = "", par1: str = "", **kwargs): + r"""Determines properties of an array parameter. + + Mechanical APDL Command: `\*VSCFUN `_ + + Parameters + ---------- + parr : str + The name of the resulting scalar parameter. See :ref:`starset` for name restrictions. + + func : str + Functions: + + * ``MAX`` - Maximum: the maximum ``Par1`` array element value. + + * ``MIN`` - Minimum: the minimum ``Par1`` array element value. + + * ``LMAX`` - Index location of the maximum ``Par1`` array element value. Array ``Par1`` is searched + starting from its specified index. + + * ``LMIN`` - Index location of the minimum ``Par1`` array element value. Array ``Par1`` is searched + starting from its specified index. + + * ``FIRST`` - Index location of the first nonzero value in array ``Par1``. Array ``Par1`` is + searched starting from its specified index. + + * ``LAST`` - Index location of the last nonzero value in array ``Par1``. Array ``Par1`` is searched + starting from its specified index. + + * ``SUM`` - Sum: ``Par1`` (the summation of the ``Par1`` array element values). + + * ``MEDI`` - Median: value of ``Par1`` at which there are an equal number of values above and below. + + * ``MEAN`` - Mean: (σ Par1)/NUM, where NUM is the number of summed values. + + * ``VARI`` - Variance: (σ (( ``Par1`` -MEAN)\*\*2))/NUM. + + * ``STDV`` - Standard deviation: square root of VARI. + + * ``RMS`` - Root-mean-square: square root of (σ ( ``Par1`` \*\*2))/NUM. + + * ``NUM`` - Number: the number of summed values (masked values are not counted). + + par1 : str + Array parameter vector in the operation. + + Notes + ----- + + .. warning:: + + This function contains specificities regarding the argument definitions. + Please refer to the `command documentation `_ + for further explanations. + + **Argument Descriptions** + + .. _a-VSCFUN_argdescript: + + * ``parr : str`` - The name of the resulting scalar parameter. See :ref:`starset` for name + restrictions. + + * ``func : str`` - Functions: + + * ``MAX`` - Maximum: the maximum ``Par1`` array element value. + + * ``MIN`` - Minimum: the minimum ``Par1`` array element value. + + * ``LMAX`` - Index location of the maximum ``Par1`` array element value. Array ``Par1`` is searched + starting from its specified index. + + * ``LMIN`` - Index location of the minimum ``Par1`` array element value. Array ``Par1`` is searched + starting from its specified index. + + * ``FIRST`` - Index location of the first nonzero value in array ``Par1``. Array ``Par1`` is + searched starting from its specified index. + + * ``LAST`` - Index location of the last nonzero value in array ``Par1``. Array ``Par1`` is searched + starting from its specified index. + + * ``SUM`` - Sum: ``Par1`` (the summation of the ``Par1`` array element values). + + * ``MEDI`` - Median: value of ``Par1`` at which there are an equal number of values above and below. + + * ``MEAN`` - Mean: (σ Par1)/NUM, where NUM is the number of summed values. + + * ``VARI`` - Variance: (σ (( ``Par1`` -MEAN)\*\*2))/NUM. + + * ``STDV`` - Standard deviation: square root of VARI. + + * ``RMS`` - Root-mean-square: square root of (σ ( ``Par1`` \*\*2))/NUM. + + * ``NUM`` - Number: the number of summed values (masked values are not counted). + + * ``par1 : str`` - Array parameter vector in the operation. + + .. _a-VSCFUN_notes: + + Operates on one input array parameter vector and produces one output scalar parameter according to: + ``ParR`` = f( ``Par1`` ) + + where the functions (f) are described below. The starting array element number must be defined for + the array parameter vector. For example, :ref:`vscfun`,MU,MEAN,A(1) finds the mean of the A vector + values, starting from the first value and stores the result as parameter MU. Operations use + successive array elements ( :ref:`vlen`, :ref:`vmask` ) with the default being all successive array + elements. Absolute values and scale factors may be applied to all parameters ( :ref:`vabs`, + :ref:`vfact` ). Results may be cumulative ( :ref:`vcum` ). See the :ref:`voper` command for details. + + This command is valid in any processor. + """ + command = f"*VSCFUN,{parr},{func},{par1}" + return self.run(command, **kwargs) + + def vstat(self, **kwargs): + r"""Lists the current specifications for the array parameters. + + Mechanical APDL Command: `\*VSTAT `_ + + Notes + ----- + + .. _a-VSTAT_notes: + + Lists the current specifications for the :ref:`vabs`, :ref:`vcol`, :ref:`vcum`, :ref:`vfact`, + :ref:`vlen`, and :ref:`vmask` commands. + + This command is valid in any processor. + """ + command = "*VSTAT" + return self.run(command, **kwargs) + + def vwrite( + self, + par1: str = "", + par2: str = "", + par3: str = "", + par4: str = "", + par5: str = "", + par6: str = "", + par7: str = "", + par8: str = "", + par9: str = "", + par10: str = "", + par11: str = "", + par12: str = "", + par13: str = "", + par14: str = "", + par15: str = "", + par16: str = "", + par17: str = "", + par18: str = "", + par19: str = "", + **kwargs, + ): + r"""Writes data to a file in a formatted sequence. + + Mechanical APDL Command: `\*VWRITE `_ + + .. warning:: + + This command must be run using :func:`non_interactive `. + Please visit `Unsupported Interactive Commands `_ + for further information. + + Parameters + ---------- + par1 : str + You can write up to 19 parameters (or constants) at a time. Any Par values after a blank Par + value are ignored. If you leave them all blank, one line will be written (to write a title or a + blank line). If you input the keyword SEQU, a sequence of numbers (starting from 1) will be + written for that item. + + par2 : str + You can write up to 19 parameters (or constants) at a time. Any Par values after a blank Par + value are ignored. If you leave them all blank, one line will be written (to write a title or a + blank line). If you input the keyword SEQU, a sequence of numbers (starting from 1) will be + written for that item. + + par3 : str + You can write up to 19 parameters (or constants) at a time. Any Par values after a blank Par + value are ignored. If you leave them all blank, one line will be written (to write a title or a + blank line). If you input the keyword SEQU, a sequence of numbers (starting from 1) will be + written for that item. + + par4 : str + You can write up to 19 parameters (or constants) at a time. Any Par values after a blank Par + value are ignored. If you leave them all blank, one line will be written (to write a title or a + blank line). If you input the keyword SEQU, a sequence of numbers (starting from 1) will be + written for that item. + + par5 : str + You can write up to 19 parameters (or constants) at a time. Any Par values after a blank Par + value are ignored. If you leave them all blank, one line will be written (to write a title or a + blank line). If you input the keyword SEQU, a sequence of numbers (starting from 1) will be + written for that item. + + par6 : str + You can write up to 19 parameters (or constants) at a time. Any Par values after a blank Par + value are ignored. If you leave them all blank, one line will be written (to write a title or a + blank line). If you input the keyword SEQU, a sequence of numbers (starting from 1) will be + written for that item. + + par7 : str + You can write up to 19 parameters (or constants) at a time. Any Par values after a blank Par + value are ignored. If you leave them all blank, one line will be written (to write a title or a + blank line). If you input the keyword SEQU, a sequence of numbers (starting from 1) will be + written for that item. + + par8 : str + You can write up to 19 parameters (or constants) at a time. Any Par values after a blank Par + value are ignored. If you leave them all blank, one line will be written (to write a title or a + blank line). If you input the keyword SEQU, a sequence of numbers (starting from 1) will be + written for that item. + + par9 : str + You can write up to 19 parameters (or constants) at a time. Any Par values after a blank Par + value are ignored. If you leave them all blank, one line will be written (to write a title or a + blank line). If you input the keyword SEQU, a sequence of numbers (starting from 1) will be + written for that item. + + par10 : str + You can write up to 19 parameters (or constants) at a time. Any Par values after a blank Par + value are ignored. If you leave them all blank, one line will be written (to write a title or a + blank line). If you input the keyword SEQU, a sequence of numbers (starting from 1) will be + written for that item. + + par11 : str + You can write up to 19 parameters (or constants) at a time. Any Par values after a blank Par + value are ignored. If you leave them all blank, one line will be written (to write a title or a + blank line). If you input the keyword SEQU, a sequence of numbers (starting from 1) will be + written for that item. + + par12 : str + You can write up to 19 parameters (or constants) at a time. Any Par values after a blank Par + value are ignored. If you leave them all blank, one line will be written (to write a title or a + blank line). If you input the keyword SEQU, a sequence of numbers (starting from 1) will be + written for that item. + + par13 : str + You can write up to 19 parameters (or constants) at a time. Any Par values after a blank Par + value are ignored. If you leave them all blank, one line will be written (to write a title or a + blank line). If you input the keyword SEQU, a sequence of numbers (starting from 1) will be + written for that item. + + par14 : str + You can write up to 19 parameters (or constants) at a time. Any Par values after a blank Par + value are ignored. If you leave them all blank, one line will be written (to write a title or a + blank line). If you input the keyword SEQU, a sequence of numbers (starting from 1) will be + written for that item. + + par15 : str + You can write up to 19 parameters (or constants) at a time. Any Par values after a blank Par + value are ignored. If you leave them all blank, one line will be written (to write a title or a + blank line). If you input the keyword SEQU, a sequence of numbers (starting from 1) will be + written for that item. + + par16 : str + You can write up to 19 parameters (or constants) at a time. Any Par values after a blank Par + value are ignored. If you leave them all blank, one line will be written (to write a title or a + blank line). If you input the keyword SEQU, a sequence of numbers (starting from 1) will be + written for that item. + + par17 : str + You can write up to 19 parameters (or constants) at a time. Any Par values after a blank Par + value are ignored. If you leave them all blank, one line will be written (to write a title or a + blank line). If you input the keyword SEQU, a sequence of numbers (starting from 1) will be + written for that item. + + par18 : str + You can write up to 19 parameters (or constants) at a time. Any Par values after a blank Par + value are ignored. If you leave them all blank, one line will be written (to write a title or a + blank line). If you input the keyword SEQU, a sequence of numbers (starting from 1) will be + written for that item. + + par19 : str + You can write up to 19 parameters (or constants) at a time. Any Par values after a blank Par + value are ignored. If you leave them all blank, one line will be written (to write a title or a + blank line). If you input the keyword SEQU, a sequence of numbers (starting from 1) will be + written for that item. + + Notes + ----- + + .. warning:: + + This function contains specificities regarding the argument definitions. + Please refer to the `command documentation `_ + for further explanations. + + **Argument Descriptions** + + .. _a-VWRITE_argdescript: + + * ``par1, par2, par3,..., par19 : str`` - You can write up to 19 parameters (or constants) at a + time. Any Par values after a blank Par value are ignored. If you leave them all blank, one line will + be written (to write a title or a blank line). If you input the keyword SEQU, a sequence of numbers + (starting from 1) will be written for that item. + + .. _a-VWRITE_notes: + + You use :ref:`vwrite` to write data to a file in a formatted sequence. Data items ( ``Par1``, + ``Par2``, etc.) may be array parameters, scalar parameters, character parameters (scalar or array), + or constants. You must evaluate expressions and functions in the data item fields before using the + :ref:`vwrite` command, since initially they will be evaluated to a constant and remain constant + throughout the operation. Unless a file is defined with the :ref:`cfopen` command, data is written + to the standard output file. Data written to the standard output file may be diverted to a different + file by first switching the current output file with the :ref:`output` command. You can also use the + :ref:`mwrite` command to write data to a specified file. Both commands contain format descriptors on + the line immediately following the command. The format descriptors can be in either FORTRAN or C + format. + + You must enclose FORTRAN format descriptors in parentheses. They must immediately follow the + :ref:`vwrite` command on a separate line of the same input file. Do not include the word FORMAT. The + format must specify the number of fields to be written per line, the field width, the placement of + the decimal point, etc. You should use one field descriptor for each data item written. The write + operation uses your system's available FORTRAN FORMAT conventions (see your system FORTRAN manual). + You can use any standard FORTRAN real format (such as (4F6.0), (E10.3,2X,D8.2), etc.) and + alphanumeric format (A). Alphanumeric strings are limited to a maximum of 8 characters for any field + (A8) using the FORTRAN format. Use the "C" format for string arrays larger than 8 characters. + Integer (I) and list-directed (\2) descriptors may not be used. You can include text in the format as + a quoted string. The parentheses must be included in the format and the format must not exceed 80 + characters (including parentheses). The output line length is limited to 128 characters. + + The "C" format descriptors are used if the first character of the format descriptor line is not a + left parenthesis. "C" format descriptors are up to 80 characters long, consisting of text strings + and predefined "data descriptors" between the strings where numeric or alphanumeric character data + will be inserted. The normal descriptors are %I for integer data, %G for double precision data, %C + for alphanumeric character data, and %/ for a line break. There must be one data descriptor for each + specified value (8 maximum) in the order of the specified values. The enhanced formats described in + :ref:`msg` may also be used. + + For array parameter items, you must define the starting array element number. Looping continues + (incrementing the vector index number of each array parameter by one) each time you output a line, + until the maximum array vector element is written. For example, :ref:`vwrite`,A(1) followed by + (F6.0) will write one value per output line, that is, A(1), A(2), A(3), A(4), etc. You write + constants and scalar parameters with the same values for each loop. You can also control the number + of loops and loop skipping with the :ref:`vlen` and :ref:`vmask` commands. The vector specifications + :ref:`vabs`, :ref:`vfact`, and :ref:`vcum` do not apply to this command. If looping continues beyond + the supplied data array's length, zeros will be output for numeric array parameters and blanks for + character array parameters. For multi-dimensioned array parameters, only the first (row) subscript + is incremented. See the :ref:`voper` command for details. If you are in the GUI, the :ref:`vwrite` + command must be contained in an externally prepared file and read into Mechanical APDL (that is, + :ref:`use`, :ref:`input`, etc.). + + If ``Par`` is a table array name, the subscripts refer to the index numbers of the table and not the + index values of its primary variables. See :ref:`starset` if you want to evaluate a table array at + certain values of its primary variables for writing. + + This command is valid in any processor. + """ + command = f"*VWRITE,{par1},{par2},{par3},{par4},{par5},{par6},{par7},{par8},{par9},{par10},{par11},{par12},{par13},{par14},{par15},{par16},{par17},{par18},{par19}" + return self.run(command, **kwargs) diff --git a/src/ansys/mapdl/core/_commands/apdl/encryption_decryption.py b/src/ansys/mapdl/core/_commands/apdl/encryption_decryption.py new file mode 100644 index 00000000000..578572b6b9a --- /dev/null +++ b/src/ansys/mapdl/core/_commands/apdl/encryption_decryption.py @@ -0,0 +1,233 @@ +# Copyright (C) 2016 - 2025 ANSYS, Inc. and/or its affiliates. +# SPDX-License-Identifier: MIT +# +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to deal +# in the Software without restriction, including without limitation the rights +# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +# copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in all +# copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +# SOFTWARE. + + +class EncryptionDecryption: + + def dbdecrypt( + self, + keya: str = "", + keyb: str = "", + datatype: str = "", + num1: str = "", + num2: str = "", + inc: str = "", + **kwargs, + ): + r"""Controls decryption of material data in the database file. + + Mechanical APDL Command: `/DBDECRYPT `_ + + Parameters + ---------- + keya : str + Decryption key A (32-character maximum). This key is used to decrypt the data in a one-level + encryption or to control access to the data in a two-level encryption. Leave this field blank if + you do not have key A. + + keyb : str + Decryption key B (32-character maximum). This key is used to decrypt the data in a two-level + encryption. Leave this field blank if the database file is encrypted with one-level encryption. + + datatype : str + Type of data to decrypt. Must be set to MAT for material data. + + num1 : str + Decrypt materials from material number ``NUM1`` to ``NUM2`` (defaults to ``NUM1`` ) in steps of + ``INC`` (defaults to 1). If ``NUM1`` = ALL (default), ``NUM2`` and ``INC`` are ignored. + + num2 : str + Decrypt materials from material number ``NUM1`` to ``NUM2`` (defaults to ``NUM1`` ) in steps of + ``INC`` (defaults to 1). If ``NUM1`` = ALL (default), ``NUM2`` and ``INC`` are ignored. + + inc : str + Decrypt materials from material number ``NUM1`` to ``NUM2`` (defaults to ``NUM1`` ) in steps of + ``INC`` (defaults to 1). If ``NUM1`` = ALL (default), ``NUM2`` and ``INC`` are ignored. + + Notes + ----- + + .. _s-DBDECRYPT_notes: + + This command decrypts data in the database file. It must be issued before resuming the database file + ( :ref:`resume` command). Only ``KeyA`` is required for a one-level encryption. For a `two-level + encryption + `_, + inputting ``KeyB`` gives you partial access to the data. Inputting both ``KeyA`` and ``KeyB`` gives + you full access. + + For more information about using :ref:`dbdecrypt` in the encryption/decryption procedure, see + `Encrypting Material Data + `_ + :ref:`dbencrypt` command. + + This command is valid in any processor. + """ + command = f"/DBDECRYPT,{keya},{keyb},{datatype},{num1},{num2},{inc}" + return self.run(command, **kwargs) + + def dbencrypt( + self, + keya: str = "", + keyb: str = "", + datatype: str = "", + num1: str = "", + num2: str = "", + inc: str = "", + **kwargs, + ): + r"""Controls encryption of material data in the database file. + + Mechanical APDL Command: `/DBENCRYPT `_ + + Parameters + ---------- + keya : str + Encryption key A (32-character maximum). This key is used to encrypt the data in a one-level + encryption or to control access to the data in a two-level encryption. + + keyb : str + Encryption key B (32-character maximum). This key is used to encrypt the data in a two-level + encryption. If ``KeyB`` is not specified, a one-level encryption is used to encrypt the data. + + datatype : str + Type of data to encrypt. Must be set to MAT for material data. + + num1 : str + Encrypt materials from material number ``NUM1`` to ``NUM2`` (defaults to ``NUM1`` ) in steps of + ``INC`` (defaults to 1). If ``NUM1`` = ALL (default), ``NUM2`` and ``INC`` are ignored. + + num2 : str + Encrypt materials from material number ``NUM1`` to ``NUM2`` (defaults to ``NUM1`` ) in steps of + ``INC`` (defaults to 1). If ``NUM1`` = ALL (default), ``NUM2`` and ``INC`` are ignored. + + inc : str + Encrypt materials from material number ``NUM1`` to ``NUM2`` (defaults to ``NUM1`` ) in steps of + ``INC`` (defaults to 1). If ``NUM1`` = ALL (default), ``NUM2`` and ``INC`` are ignored. + + Notes + ----- + + .. _s-DBENCRYPT_notes: + + This command encrypts data in the database file. It must be issued before saving the database file ( + :ref:`save` command). + + For a one-level encryption, specify only ``KeyA`` and set ``NUM1`` to ALL. ( ``NUM2`` and ``INC`` + are not used.) + + For a `two-level encryption + `_, + specify both ``KeyA`` and ``KeyB``. Also specify ``NUM1``, ``NUM2``, and ``INC`` as needed. + + For more information about using :ref:`dbencrypt` in the encryption/decryption procedure, see + `Encrypting Material Data + `_ + :ref:`dbdecrypt` command. + + This command is valid in any processor. + """ + command = f"/DBENCRYPT,{keya},{keyb},{datatype},{num1},{num2},{inc}" + return self.run(command, **kwargs) + + def decrypt(self, key1: str = "", key2: str = "", **kwargs): + r"""Controls decryption of command input. + + Mechanical APDL Command: `/DECRYPT `_ + + Parameters + ---------- + key1 : str + Key to decrypt the encrypted input created by :ref:`encrypt`. The only valid label is PASSWORD. + + key2 : str + Key to decrypt the encrypted input or to set the global encryption key. The following are valid + inputs: + + * If ``Key2`` = OPENSSL or is blank, then decryption commences and the previously set global + encryption key is used for decryption. + + * If ``Key2`` has a value, then that value is set as the global encryption key. + + * If ``Key2`` = OFF, then the global encryption password previously set by the command + :ref:`decrypt`,PASSWORD, ``Key2`` is reset. + + Notes + ----- + + .. _s-DECRYPT_notes: + + When decrypting an encrypted input, ``/DECRYPT,PASSWORD,OPENSSL`` must appear as the first line of + the encrypted file. The line is inserted automatically when you issue :ref:`encrypt` to create the + encrypted file. + + To read an encrypted file, enter :ref:`decrypt`,PASSWORD, ``Key2`` anywhere in the standard input + file to set the global encryption key. The encryption key must be set before reading in the + encrypted input. + + :ref:`decrypt` is also valid when entered in the Command Input Window of the Mechanical APDL user + interface. + + See `Encrypting Command Input and Other Data + `_ + :ref:`decrypt` and performing encryption and decryption. + """ + command = f"/DECRYPT,{key1},{key2}" + return self.run(command, **kwargs) + + def encrypt(self, key: str = "", fname: str = "", ext: str = "", **kwargs): + r"""Controls encryption of command input. + + Mechanical APDL Command: `/ENCRYPT `_ + + Parameters + ---------- + key : str + Encryption key used to encrypt the data (32-character maximum). A character parameter may be + used. If the key is unspecified, encryption is turned off. + + fname : str + Name of file (including directory path) where the encrypted commands are written (248-character + maximum for both file name and directory). An unspecified directory path defaults to the working + directory; in this case, you can use all 248 characters for the file name. + + ext : str + File name extension (eight-character maximum). + + Notes + ----- + + .. _s-ENCRYPT_notes: + + This command opens the encrypted file specified by ``Fname`` and ``Ext`` for writing encrypted input + commands. + + Issuing this command results in a new file that overwrites any data in an existing file by the same + name. When the encrypted file is written, the first line in the file is + ``/DECRYPT``,PASSWORD,OPENSSL and the last line is ``/DECRYPT``. + + See `Encrypting Command Input and Other Data + `_ + :ref:`encrypt` and performing encryption and decryption. + """ + command = f"/ENCRYPT,{key},{fname},{ext}" + return self.run(command, **kwargs) diff --git a/src/ansys/mapdl/core/_commands/apdl/macro_files.py b/src/ansys/mapdl/core/_commands/apdl/macro_files.py index 3c26402ca1a..9de669016b0 100644 --- a/src/ansys/mapdl/core/_commands/apdl/macro_files.py +++ b/src/ansys/mapdl/core/_commands/apdl/macro_files.py @@ -22,442 +22,674 @@ class MacroFiles: + def cfclos(self, **kwargs): - """Closes the "command" file. + r"""Closes the "command" file. - APDL Command: ``*CFCLOS`` + Mechanical APDL Command: `\*CFCLOS `_ Notes ----- + + .. _a-CFCLOS_notes: + This command is valid in any processor. """ - command = f"*CFCLOS," + command = "*CFCLOS" return self.run(command, **kwargs) - def cfopen(self, fname="", ext="", loc="", **kwargs): - """Opens a "command" file. + def cfopen(self, fname: str = "", ext: str = "", loc: str = "", **kwargs): + r"""Opens a "command" file. - APDL Command: ``*CFOPEN`` - - .. warning:: - This command must be run using :func:`non_interactive - ` + Mechanical APDL Command: `\*CFOPEN `_ 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. - - ext - Filename extension (eight-character maximum). + 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 :file:`Jobname`. + + ext : str + Filename extension (eight-character maximum). The extension defaults to CMD if ``Fname`` is + blank. - loc + loc : str Determines whether existing file will be overwritten or appended: - (blank) : The existing file will be overwritten. - APPEND : The file will be appended to the existing file. + * ``(blank)`` - The existing file will be overwritten. + + * ``APPEND`` - The file will be appended to the existing file. Notes ----- - Data processed with the ``*VWRITE`` command will also be written to this - file if the file is open when the ``*VWRITE`` command is issued. + + .. warning:: + + This function contains specificities regarding the argument definitions. + Please refer to the `command documentation `_ + for further explanations. + + **Argument Descriptions** + + .. _a-CFOPEN_argdescript: + + * ``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 :file:`Jobname`. + + * ``ext : str`` - Filename extension (eight-character maximum). The extension defaults to CMD if + ``Fname`` is blank. + + * ``loc : str`` - Determines whether existing file will be overwritten or appended: + + * ``(blank)`` - The existing file will be overwritten. + + * ``APPEND`` - The file will be appended to the existing file. + + .. _a-CFOPEN_notes: + + Mechanical APDL commands specified by the :ref:`cfwrite` command are written to the file opened by + :ref:`cfopen`. Data processed with the :ref:`vwrite` command are also written to this file if the + file is open when the :ref:`vwrite` command is issued. + + Issue the :ref:`cfclos` command to close the command file. This command is valid in any processor. """ - return self.run(f"*CFOPEN,{fname},{ext},,{loc}", **kwargs) + command = f"*CFOPEN,{fname},{ext},,{loc}" + return self.run(command, **kwargs) - def cfwrite(self, command="", **kwargs): - """Writes an ANSYS command (or similar string) to a "command" file. + def cfwrite(self, command: str = "", **kwargs): + r"""Writes a Mechanical APDL command (or similar string) to a "command" file. - APDL Command: ``*CFWRITE`` + Mechanical APDL Command: `\*CFWRITE `_ Parameters ---------- - command - Command or string to be written. The standard command form of a - label followed by arguments separated by commas is assumed. - Command may be a parameter assignment (e.g., ``*CFWRITE, A = 5``). + command : str + Command or string to be written. The standard command form of a label followed by arguments + separated by commas is assumed. ``Command`` may be a parameter assignment (for example, + :ref:`cfwrite`, A = 5). Notes ----- - Writes an ANSYS command (or similar string) to the file opened - with ``*CFOPEN``. The Command string is not executed (except - that numeric and character parameter substitution and - operations (with embedded ``*``, /, >,$ etc. characters) are - performed before writing). When used with ``*GET`` results - and parameter substitution, an ANSYS command can be created - from results and then read back into the ANSYS program (or - used elsewhere). For example, if the command - ``*CFWRITE,BF,NNUM,TEMP,TVAL`` is used in a do-loop, where - TVAL is a parameter value returned from the ``*GET`` operation - and NNUM is a specified or returned parameter value, a series - of BF commands, with numerical values substituted for the two - parameters, will be written. To create a file without - parameter substitution, use ``*CREATE``. + + .. warning:: + + This function contains specificities regarding the argument definitions. + Please refer to the `command documentation `_ + for further explanations. + + **Argument Descriptions** + + .. _a-CFWRITE_argdescript: + + * ``command : str`` - Command or string to be written. The standard command form of a label followed + by arguments separated by commas is assumed. ``Command`` may be a parameter assignment (for example, + :ref:`cfwrite`, A = 5). + + .. _a-CFWRITE_notes: + + Writes a Mechanical APDL command (or similar string) to the file opened via :ref:`cfopen`. The + ``Command`` + string is not executed (except that numeric and character parameter substitution and operations + (with imbedded \*, /, >, etc. characters) are performed before writing). + + When used with :ref:`get` results and parameter substitution, a command can be created from results + and then read back into the Mechanical APDL program (or used elsewhere). For example, if the command + :ref:`cfwrite`,BF,NNUM,TEMP,TVAL is used in a do-loop, where TVAL is a parameter value returned from + the :ref:`get` operation and NNUM is a specified or returned parameter value, a series of :ref:`bf` + commands, with numerical values substituted for the two parameters, will be written. + + To create a file without parameter substitution, issue :ref:`create`. This command is valid in any processor. """ command = f"*CFWRITE,{command}" return self.run(command, **kwargs) - def create(self, fname="", ext="", **kwargs): - """Opens (creates) a macro file. + def create(self, fname: str = "", ext: str = "", **kwargs): + r"""Opens (creates) a macro file. - APDL Command: ``*CREATE`` + Mechanical APDL Command: `\*CREATE `_ .. warning:: - This command must be run using :func:`non_interactive - ` + + This command must be run using :func:`non_interactive `. + Please visit `Unsupported Interactive Commands `_ + for further information. 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. + 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. Do not use a directory path if file is to be + read with the macro ``Name`` option of the :ref:`use` command. - ext - Filename extension (eight-character maximum). + ext : str + Filename extension (eight-character maximum). ``Ext`` should not be used if file is to be read + with the macro ``Name`` option of the :ref:`use` command. Notes ----- - See the ``*USE`` command for a discussion of macros. All - commands following the ``*CREATE`` command, up to the ``*END`` - command, are written to the specified file without being - executed. An existing file of the same name, if any, will be - overwritten. Parameter values are not substituted for - parameter names in the commands when the commands are written - to the file. Use ``*CFWRITE`` to create a file if this is - desired. The resulting macro may be executed with a ``*USE`` - command (which also allows parameters to be passed into the - macro) or a /INPUT command (which does not allow parameters to - be passed in). Several macros may be stacked into a library - file ``[*ULIB]``. You cannot use ``*CREATE`` within a DO loop. - This command is valid in any processor. - """ - return self.run(f"*CREATE,{fname},{ext}", **kwargs) + .. warning:: - def dflab(self, dof="", displab="", forcelab="", **kwargs): - """Changes degree-of-freedom labels for user custom elements. + This function contains specificities regarding the argument definitions. + Please refer to the `command documentation `_ + for further explanations. - APDL Command: /DFLAB + **Argument Descriptions** - Parameters - ---------- - dof - Number between 1 and 32 indicating which degree of freedom is to - have its labels changed. For a list of these quantities, see the - degree-of-freedom table in the echprm.inc file. The first few - quantities follow: + .. _a-CREATE_argdescript: - displab - New label (four-character maximum) for the displacement label. The - prior label is no longer valid. + * ``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. Do not use a directory path if file is to be read with + the macro + ``Name`` option of the :ref:`use` command. - forcelab - New label (four-character maximum) for the force label for this - degree of freedom. The prior label is no longer valid. + * ``ext : str`` - Filename extension (eight-character maximum). ``Ext`` should not be used if file + is to be read with the macro + ``Name`` option of the :ref:`use` command. - Notes - ----- - The /DFLAB command is rarely used. Use it if you are writing a custom - element and want to use degrees of freedom that are not part of the - standard element set. + .. _a-CREATE_notes: + + See the :ref:`use` command for a discussion of macros. All commands following the :ref:`create` + command, up to the :ref:`end` command, are written to the specified file without being executed. An + existing file of the same name, if any, will be overwritten. Parameter values are not substituted + for parameter names in the commands when the commands are written to the file. Use :ref:`cfwrite` to + create a file if this is desired. The resulting macro may be executed with a :ref:`use` command + (which also allows parameters to be passed into the macro) or a :ref:`input` command (which does not + allow parameters to be passed in). Several macros may be stacked into a library file ( :ref:`ulib` + ). You cannot use :ref:`create` within a DO loop. + + This command is valid in any processor. """ - command = f"/DFLAB,{dof},{displab},{forcelab}" + command = f"*CREATE,{fname},{ext}" return self.run(command, **kwargs) def end(self, **kwargs): - """Closes a macro file. + r"""Closes a macro file. - APDL Command: ``*END`` + Mechanical APDL Command: `\*END `_ Notes ----- - Closes a file opened with ``*CREATE``. The ``*END`` command is an 8-character - command (to differentiate it from ``*ENDIF``). If you add commented text - on that same line but do not allow enough spaces between ``*END`` and the - "!" that indicates the comment text, the ``*END`` will attempt to interpret - the "!" as the 8th character and will fail. + + .. _a-END_notes: + + Closes a file opened with :ref:`create`. The :ref:`end` command is an 8-character command (to + differentiate it from ``*ENDIF`` ). If you add commented text on that same line but do not allow + enough spaces between :ref:`end` and the "!" that indicates the comment text, the :ref:`end` will + attempt to interpret the "!" as the 8th character and will fail. This command is valid in any processor. """ - command = f"*END," + command = "*END" return self.run(command, **kwargs) - def mkdir(self, dir_="", **kwargs): - """Creates a directory. + def mkdir(self, dir_: str = "", **kwargs): + r"""Creates a directory. - APDL Command: /MKDIR + Mechanical APDL Command: `/MKDIR `_ Parameters ---------- - dir_ - The directory to create (248 characters maximum on Linux; - 233 on Windows). If no path is provided, it will be - created in the current working directory. Must be a valid - name (and path) for the system you are working on. + dir_ : str + The directory to create (248 characters maximum on Linux; 233 on Windows). If no path is + provided, it will be created in the current working directory. Must be a valid name (and path) + for the system you are working on. Notes ----- - It is recommended to just use ``os.mkdir`` - Creates a directory on the computer ANSYS is currently running on. + .. warning:: + + This function contains specificities regarding the argument definitions. + Please refer to the `command documentation `_ + for further explanations. + + **Argument Descriptions** + * ``Dir`` - The directory to create (248 characters maximum on Linux; 233 on Windows). If no path is + provided, it will be created in the current working directory. Must be a valid name (and path) for + the system you are working on. + + Creates a directory on the computer Mechanical APDL is currently running on. """ command = f"/MKDIR,{dir_}" return self.run(command, **kwargs) def msg( self, - lab="", - val1="", - val2="", - val3="", - val4="", - val5="", - val6="", - val7="", - val8="", + lab: str = "", + val1: str = "", + val2: str = "", + val3: str = "", + val4: str = "", + val5: str = "", + val6: str = "", + val7: str = "", + val8: str = "", **kwargs, ): - """Writes an output message via the ANSYS message subroutine. + r"""Writes an output message via the Mechanical APDL message subroutine. - APDL Command: ``*MSG`` + Mechanical APDL Command: `\*MSG `_ Parameters ---------- - lab + lab : str Label for output and termination control: - Writes the message with no heading (default). - Writes the - message with a "NOTE" heading. + * ``INFO`` - Writes the message with no heading (default). + + * ``NOTE`` - Writes the message with a "NOTE" heading. + + * ``WARN`` - Writes the message with a "WARNING" heading. Also writes the message to the errors + file, :file:`JobnameERR`. - Writes the message with a "WARNING" heading. Also writes - the message to the errors file, Jobname.ERR. - Writes the - message with a "ERROR" heading and causes run termination - (if batch) at earliest "clean exit" point. Also writes - the message to the errors file, Jobname.ERR. + * ``ERROR`` - Writes the message with a "ERROR" heading and causes run termination (if batch) at + earliest "clean exit" point. Also writes the message to the errors file, :file:`JobnameERR`. - Writes the message with a "FATAL ERROR" heading and causes - run termination immediately. Also writes the message to - the errors file, Jobname.ERR. - Writes the message with a - "NOTE" heading and displays it in the message dialog box. - This option is most useful in GUI mode. + * ``FATAL`` - Writes the message with a "FATAL ERROR" heading and causes run termination + immediately. Also writes the message to the errors file, :file:`JobnameERR`. - val1, val2, val3, . . . , val8 - Numeric or alphanumeric character values to be included in message. - Values may be the results of parameter evaluations. All numeric - values are assumed to be double precision. The FORTRAN nearest - integer (NINT) function is used to form integers for the %I - specifier. + * ``UI`` - Writes the message with a "NOTE" heading and displays it in the message dialog box. This + option is most useful in GUI mode. + + val1 : str + Numeric or alphanumeric character values to be included in message. Values may be the results of + parameter evaluations. All numeric values are assumed to be double precision. The FORTRAN + nearest integer (NINT) function is used to form integers for the %I specifier. + + val2 : str + Numeric or alphanumeric character values to be included in message. Values may be the results of + parameter evaluations. All numeric values are assumed to be double precision. The FORTRAN + nearest integer (NINT) function is used to form integers for the %I specifier. + + val3 : str + Numeric or alphanumeric character values to be included in message. Values may be the results of + parameter evaluations. All numeric values are assumed to be double precision. The FORTRAN + nearest integer (NINT) function is used to form integers for the %I specifier. + + val4 : str + Numeric or alphanumeric character values to be included in message. Values may be the results of + parameter evaluations. All numeric values are assumed to be double precision. The FORTRAN + nearest integer (NINT) function is used to form integers for the %I specifier. + + val5 : str + Numeric or alphanumeric character values to be included in message. Values may be the results of + parameter evaluations. All numeric values are assumed to be double precision. The FORTRAN + nearest integer (NINT) function is used to form integers for the %I specifier. + + val6 : str + Numeric or alphanumeric character values to be included in message. Values may be the results of + parameter evaluations. All numeric values are assumed to be double precision. The FORTRAN + nearest integer (NINT) function is used to form integers for the %I specifier. + + val7 : str + Numeric or alphanumeric character values to be included in message. Values may be the results of + parameter evaluations. All numeric values are assumed to be double precision. The FORTRAN + nearest integer (NINT) function is used to form integers for the %I specifier. + + val8 : str + Numeric or alphanumeric character values to be included in message. Values may be the results of + parameter evaluations. All numeric values are assumed to be double precision. The FORTRAN + nearest integer (NINT) function is used to form integers for the %I specifier. Notes ----- - Allows writing an output message via the ANSYS message subroutine. - Also allows run termination control. This command is used only when - contained in a prepared file read into the ANSYS program (i.e., - ``*USE,/INPUT``, etc.). A message format must immediately follow the ``*MSG`` + + .. warning:: + + This function contains specificities regarding the argument definitions. + Please refer to the `command documentation `_ + for further explanations. + + **Argument Descriptions** + + .. _a-MSG_argdescript: + + * ``lab : str`` - Label for output and termination control: + + * ``INFO`` - Writes the message with no heading (default). + + * ``NOTE`` - Writes the message with a "NOTE" heading. + + * ``WARN`` - Writes the message with a "WARNING" heading. Also writes the message to the errors + file, :file:`JobnameERR`. + + * ``ERROR`` - Writes the message with a "ERROR" heading and causes run termination (if batch) at + earliest "clean exit" point. Also writes the message to the errors file, :file:`JobnameERR`. + + * ``FATAL`` - Writes the message with a "FATAL ERROR" heading and causes run termination + immediately. Also writes the message to the errors file, :file:`JobnameERR`. + + * ``UI`` - Writes the message with a "NOTE" heading and displays it in the message dialog box. This + option is most useful in GUI mode. + + * ``val1, val2, val3,..., val8 : str`` - Numeric or alphanumeric character values to be included + in message. Values may be the results of parameter evaluations. All numeric values are assumed to be + double precision. The FORTRAN nearest integer (NINT) function is used to form integers for the %I + specifier. + + .. _a-MSG_notes: + + Allows writing an output message via the Mechanical APDL message subroutine. Also allows run + termination + control. This command is used only when contained in a prepared file read into the Mechanical APDL + program + (that is, :ref:`use`, :ref:`input`, etc.). A message format must immediately follow the :ref:`msg` command (on a separate line, without parentheses, as described below). - The message format may be up to 80 characters long, consisting of text - strings and predefined "data descriptors" between the strings where - numeric or alphanumeric character data are to be inserted. The normal - descriptors are %I for integer data, %G for double precision data, %C - for alphanumeric character data, and %/ for a line break. The - corresponding FORTRAN data descriptors are I9, 1PG16.9 and A8, - respectively. Each descriptor must be preceded by a blank. There must - be one data descriptor for each specified value (8 maximum) in the - order of the specified values. - - Enhanced descriptions may also be used: - - Do not begin ``*MSG`` format lines with ``*IF``, ``*ELSE`` , - ``*ELSEIF``, or ``*ENDIF`` . If the last nonblank character - of the message format is an ampersand (&), a second line will - also be read as a continuation of the format. Up to nine - continuations (ten total lines) may be read. If normal - descriptions are used, then consecutive blanks are condensed - into one blank upon output, and a period is appended. Up to - ten lines of output of 72 characters each may be produced - (using the %/ descriptor). Two examples follow. - - Here is an example of the ``*MSG`` command and a format to print a message - with two integer values and one real value: + The message format may be up to 80 characters long, consisting of text strings and predefined "data + descriptors" between the strings where numeric or alphanumeric character data are to be inserted. + The normal descriptors are %I for integer data, %G for double precision data, %C for alphanumeric + character data, and %/ for a line break. The corresponding FORTRAN data descriptors are I9, 1PG16.9 + and A8, respectively. Each descriptor must be preceded by a blank. There must be one data descriptor + for each specified value (8 maximum) in the order of the specified values. + + Enhanced descriptions may also be used: This command contains some tables and extra information + which can be inspected in the original documentation pointed above. + + Do not begin :ref:`msg` format lines with ``*IF``, ``*ELSE``, ``*ELSEIF``, or ``*ENDIF``. If the + last nonblank character of the message format is an ampersand (&), a second line will also be read + as a continuation of the format. Up to nine continuations (ten total lines) may be read. If normal + descriptions are used, then consecutive blanks are condensed into one blank upon output, and a + period is appended. Up to ten lines of output of 72 characters each may be produced (using the %/ + descriptor). Two examples follow. + + Here is an example of the :ref:`msg` command and a format to print a message with two integer values + and one real value: + + .. code:: apdl + + *MSG, INFO, 'Inner',25,1.2,148 + Radius ( %C) = %I, Thick = %G, Length = %I The output line is: - Here is an example illustrating multiline displays in GUI message - windows: + .. code:: apdl - Note:: : The /UIS,MSGPOP command controls which messages are displayed - in the message dialog box when the GUI is active. All messages - produced by the ``*MSG`` command are subject to the /UIS specification, - with one exception, If Lab = UI, the message will be displayed in the - dialog box regardless of the /UIS specification. + Radius (Inner) = 25, Thick = 1.2, Length = 148. - This command is valid in any processor. + Here is an example illustrating multiline displays in GUI message windows: + + .. code:: apdl + + *MSG,UI,Vcoilrms,THTAv,Icoilrms,THTAi,Papprnt,Pelec,PF,indctnc + Coil RMS voltage, RMS current, apparent pwr, actual pwr, pwr factor: %/& + Vcoil = %G V (electrical angle = %G DEG) %/& + Icoil = %G A (electrical angle = %G DEG) %/& + APPARENT POWER = %G W %/& + ACTUAL POWER = %G W %/& + Power factor: %G %/& + Inductance = %G %/& + VALUES ARE FOR ENTIRE COIL (NOT JUST THE MODELED SECTOR) + The :ref:`uis`,MSGPOP command controls which messages are displayed in the message dialog box when + the GUI is active. All messages produced by the :ref:`msg` command are subject to the :ref:`uis` + specification, with one exception, If ``Lab`` = UI, the message will be displayed in the dialog box + regardless of the :ref:`uis` specification. + + This command is valid in any processor. """ command = f"*MSG,{lab},{val1},{val2},{val3},{val4},{val5},{val6},{val7},{val8}" return self.run(command, **kwargs) def pmacro(self, **kwargs): - """Specifies that macro contents be written to the session log file. + r"""Specifies that macro contents be written to the session log file. - APDL Command: /PMACRO + Mechanical APDL Command: `/PMACRO `_ Notes ----- - This command forces the contents of a macro or other input file to be - written to Jobname.LOG. It is valid only within a macro or input file, - and should be placed at the top of the file. /PMACRO should be - included in any macro or input file that calls GUI functions. + + .. _s-PMACRO_notes: + + This command forces the contents of a macro or other input file to be written to + :file:`Jobname.LOG`. It is valid only within a macro or input file, and should be placed at the top + of the file. :ref:`pmacro` should be included in any macro or input file that calls GUI + functions. """ - command = f"/PMACRO," + command = "/PMACRO" return self.run(command, **kwargs) - def psearch(self, pname="", **kwargs): - """Specifies a directory to be searched for "unknown command" macro files. + def psearch(self, pname: str = "", **kwargs): + r"""Specifies a directory to be searched for "unknown command" macro files. - APDL Command: /PSEARCH + Mechanical APDL Command: `/PSEARCH `_ Parameters ---------- - pname - Path name (64 characters maximum, and must include the final - delimiter) of the middle directory to be searched. Defaults to the - user home directory. If Pname = OFF, search only the ANSYS and - current working directories. If Pname = STAT, list the current - middle directory and show the ANSYS_MACROLIB setting. + pname : str + Path name (64 characters maximum, and must include the final delimiter) of the middle directory + to be searched. Defaults to the user home directory. If ``Pname`` = OFF, search only the program + and current working directories. If ``Pname`` = STAT, list the current middle directory and show + the ANSYS_MACROLIB setting. Notes ----- - Specifies the pathname of a directory for file searches when reading - "unknown command" macro files. The search for the files is typically - from the ANSYS directory, then from the user home directory, and then - from the current working directory. This command allows the middle - directory searched to be other than the user home directory. - This command is valid only at the Begin Level. + .. _s-PSEARCH_notes: + + Specifies the pathname of a directory for file searches when reading unknown-command macro files. + + The search for the files is typically from the program directory, then from the user home directory, + and then from the current working directory. The command allows the middle directory searched to be + other than the user home directory. + + This command is valid only at the Begin level. """ command = f"/PSEARCH,{pname}" return self.run(command, **kwargs) - def rmdir(self, dir_="", **kwargs): - """Removes (deletes) a directory. + def rmdir(self, dir_: str = "", **kwargs): + r"""Removes (deletes) a directory. - APDL Command: /RMDIR + Mechanical APDL Command: `/RMDIR `_ Parameters ---------- - dir\\_ - The directory to remove. If no path is provided, it will be assumed - to be in the current working directory. All files in the directory - are also removed. + dir_ : str + The directory to remove. If no path is provided, it will be assumed to be in the current working + directory. All files in the directory are also removed. Notes ----- - Removes a directory on the computer ANSYS is currently running on. No - warning or prompt is given, so use with extreme caution. + + .. warning:: + + This function contains specificities regarding the argument definitions. + Please refer to the `command documentation `_ + for further explanations. + + **Argument Descriptions** + * ``Dir`` - The directory to remove. If no path is provided, it will be assumed to be in the current + working directory. All files in the directory are also removed. + + Removes a directory on the computer on which Mechanical APDL is currently running. No warning or + prompt is + given, so use with extreme caution. """ command = f"/RMDIR,{dir_}" return self.run(command, **kwargs) - def tee(self, label="", fname="", ext="", **kwargs): - """Writes a list of commands to a specified file at the same time that the + def slashtee(self, label: str = "", fname: str = "", ext: str = "", **kwargs): + r"""Writes a list of commands to a specified file at the same time that the commands are being executed. - APDL Command: /TEE - commands are being executed. + Mechanical APDL Command: `/TEE `_ Parameters ---------- - label - Indicates how ANSYS is to interpret this /TEE command: - - Signals the beginning of the command text that is to be - written to Fname. If Fname already exists, specifying NEW - causes the contents of Fname to be overwritten. - - Indicates that you want to append to Fname the command - text that follows. - - 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. - - ext - Filename extension (eight-character maximum). + label : str + Specifies how Mechanical APDL is to interpret this :ref:`slashtee` command: + + * ``NEW`` - Signals the beginning of the command text that is to be written to ``Fname``. If + ``Fname`` already exists, specifying NEW causes the contents of ``Fname`` to be overwritten. + + * ``APPEND`` - Indicates that you want to append to ``Fname`` the command text that follows. + + * ``END`` - Signals the end of the command text that is to be written to or appended to ``Fname``. + + 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. + + ext : str + Filename extension (eight-character maximum). If you plan to execute the file as if it were a + Mechanical APDL command, use the extension ``.mac``. Notes ----- - You can use the /TEE command to record a macro to a specified file at - the same time that the macro is being executed. It is similar to the - Linux tee command. - For more information about the /TEE command, see the Introducing APDL - of the ANSYS Parametric Design Language Guide. + .. warning:: + + This function contains specificities regarding the argument definitions. + Please refer to the `command documentation `_ + for further explanations. + + **Argument Descriptions** - The following example illustrates the use of the /TEE command. If you - issue these commands: + .. _pmTEEsargdescript: - the content of myfile.mac is: + * ``label : str`` - Specifies how Mechanical APDL is to interpret this :ref:`slashtee` command: - This command is valid in any processor, but only during an interactive - run. + * ``NEW`` - Signals the beginning of the command text that is to be written to ``Fname``. If + ``Fname`` already exists, specifying NEW causes the contents of ``Fname`` to be overwritten. + + * ``APPEND`` - Indicates that you want to append to ``Fname`` the command text that follows. + + * ``END`` - Signals the end of the command text that is to be written to or appended to ``Fname``. + + * ``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. + * ``ext : str`` - Filename extension (eight-character maximum). If you plan to execute the file as + if it were a Mechanical APDL command, use + the extension ``.mac``. + + .. _s-TEE_notes: + + You can use the :ref:`slashtee` command to record a macro to a specified file at the same time that + the macro is being executed. It is similar to the Linux **tee** command. + + For more information about the :ref:`slashtee` command, see the of the `Ansys Parametric Design + Language Guide `_. + + The following example illustrates the use of the :ref:`slashtee` command. If you issue these + commands: + + .. code:: apdl + + /tee,new,myfile,mac + et,1,42,0,0,1 + ex,1,3e7 + /tee,end + /tee,append,myfile,mac + n,1,8 + n,5,11 + fill + ngen,5,5,1,5,1,0,1 + /tee,end + + the content of **myfile.mac** is: + + .. code:: apdl + + et,1,42,0,0,1 + ex,1,3e7 + n,1,8 + n,5,11 + fill + ngen,5,5,1,5,1,0,1 + + This command is valid in any processor, but only during an interactive run. """ command = f"/TEE,{label},{fname},{ext}" return self.run(command, **kwargs) - def ulib(self, fname="", ext="", **kwargs): - """Identifies a macro library file. + def ulib(self, fname: str = "", ext: str = "", **kwargs): + r"""Identifies a macro library file. - APDL Command: ``*ULIB`` + Mechanical APDL Command: `\*ULIB `_ 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. + 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. - ext + ext : str Filename extension (eight-character maximum). Notes ----- - Identifies a macro library file for the ``*USE`` command. A - library of macros allows blocks of often used ANSYS commands - to be stacked and executed from a single file. The macro - blocks must be enclosed within block identifier and terminator - lines as shown in the example below. If you want to add - comment lines to a macro block, you may place them anywhere - within the macro block. (This includes placing them directly - on the lines where the macro block identifier and the macro - block terminator appear, as shown in the example.) Do not - place comment lines (or any other lines) outside of a macro - block. - - The name of the macro library file is identified for reading - on the ``*ULIB`` command. The name of the macro block is - identified on the ``*USE`` command. The commands within the macro - block are copied to a temporary file (of the macro block name) - during the ``*USE`` operation and executed as if a macro file of - that name had been created by the user. The temporary file is - deleted after it has been used. Macro block names should be - acceptable filenames (system dependent) and should not match - user created macro file names, since the user macro file will - be used first (if it exists) before the library file is - searched. Macro blocks may be stacked in any order. - Branching [``*GO`` or ``*IF``] external to the macro block is not - allowed. + + .. warning:: + + This function contains specificities regarding the argument definitions. + Please refer to the `command documentation `_ + for further explanations. + + **Argument Descriptions** + + .. _a-ULIB_argdescript: + + * ``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. + + * ``ext : str`` - Filename extension (eight-character maximum). + + .. _a-ULIB_notes: + + Identifies a macro library file for the :ref:`use` command. + + A library of macros allows blocks of often-used commands to be stacked and executed from a single + file. The macro blocks must be enclosed within block identifier and terminator lines as shown in + this example: **Example: Macro Blocks** + + .. code:: apdl + + ABC! Any valid alphanumeric name (32 characters maximum) + ! identifying this data block + ---! Mechanical APDL data-input commands + --- + --- + /EOF! Terminator for this data block + XYZ! Identify another data block (if desired) + ---! Mechanical APDL data-input commands + --- + --- + /EOF! Terminator for this data block + (etc.) + + To add comment lines to a macro block, place them anywhere within the macro block, including + directly on the lines where the macro block identifier and the macro block terminator appear as + shown in the example. Do not place comment lines (or any other lines) outside of a macro block. + + The name of the macro library file is identified for reading via :ref:`ulib`. The name of the macro + block is identified via :ref:`use`. + + Commands within the macro block are copied to a temporary file (of the macro block name) during the + :ref:`use` operation and executed as if a macro file of that name had been created. The temporary + file is deleted after it has been used. + + Macro block names should be acceptable file names (system-dependent) and should not match user- + created macro file names, as the user-created macro file is used first (if it exists) before the + library file is searched. + + Macro blocks may be stacked in any order. Branching ( ``*GO`` or ``*IF`` ) external to the macro + block is not allowed. This command is valid in any processor. """ @@ -466,124 +698,228 @@ def ulib(self, fname="", ext="", **kwargs): def use( self, - name="", - arg1="", - arg2="", - arg3="", - arg4="", - arg5="", - arg6="", - arg7="", - arg8="", - arg9="", - ar10="", - ar11="", - ar12="", - ar13="", - ar14="", - ag15="", - ar16="", - ar17="", - ar18="", + name: str = "", + arg1: str = "", + arg2: str = "", + arg3: str = "", + arg4: str = "", + arg5: str = "", + arg6: str = "", + arg7: str = "", + arg8: str = "", + arg9: str = "", + ar10: str = "", + ar11: str = "", + ar12: str = "", + ar13: str = "", + ar14: str = "", + ag15: str = "", + ar16: str = "", + ar17: str = "", + ar18: str = "", **kwargs, ): - """Executes a macro file. + r"""Executes a macro file. - APDL Command: ``*USE`` + Mechanical APDL Command: `\*USE `_ Parameters ---------- - name - Name (32 characters maximum, beginning with a letter) identifying - the macro file or a macro block on a macro library file. - - arg1, arg2, arg3, . . . , ar18 - Values passed into the file or block where the parameters ARG1 - through ARG9 and AR10 through AR18 are referenced. Values may be - numbers, alphanumeric character strings (up to 32 characters - enclosed in single quotes), parameters (numeric or character) or - parametric expressions. See below for additional details. + name : str + Name (32 characters maximum, beginning with a letter) identifying the macro file or a macro + block on a macro library file. + + arg1 : str + Values passed into the file or block where the parameters ARG1 through ARG9 and AR10 through + AR18 are referenced. Values may be numbers, alphanumeric character strings (up to 32 characters + enclosed in single quotes), parameters (numeric or character) or parametric expressions. See + below for additional details. + + arg2 : str + Values passed into the file or block where the parameters ARG1 through ARG9 and AR10 through + AR18 are referenced. Values may be numbers, alphanumeric character strings (up to 32 characters + enclosed in single quotes), parameters (numeric or character) or parametric expressions. See + below for additional details. + + arg3 : str + Values passed into the file or block where the parameters ARG1 through ARG9 and AR10 through + AR18 are referenced. Values may be numbers, alphanumeric character strings (up to 32 characters + enclosed in single quotes), parameters (numeric or character) or parametric expressions. See + below for additional details. + + arg4 : str + Values passed into the file or block where the parameters ARG1 through ARG9 and AR10 through + AR18 are referenced. Values may be numbers, alphanumeric character strings (up to 32 characters + enclosed in single quotes), parameters (numeric or character) or parametric expressions. See + below for additional details. + + arg5 : str + Values passed into the file or block where the parameters ARG1 through ARG9 and AR10 through + AR18 are referenced. Values may be numbers, alphanumeric character strings (up to 32 characters + enclosed in single quotes), parameters (numeric or character) or parametric expressions. See + below for additional details. + + arg6 : str + Values passed into the file or block where the parameters ARG1 through ARG9 and AR10 through + AR18 are referenced. Values may be numbers, alphanumeric character strings (up to 32 characters + enclosed in single quotes), parameters (numeric or character) or parametric expressions. See + below for additional details. + + arg7 : str + Values passed into the file or block where the parameters ARG1 through ARG9 and AR10 through + AR18 are referenced. Values may be numbers, alphanumeric character strings (up to 32 characters + enclosed in single quotes), parameters (numeric or character) or parametric expressions. See + below for additional details. + + arg8 : str + Values passed into the file or block where the parameters ARG1 through ARG9 and AR10 through + AR18 are referenced. Values may be numbers, alphanumeric character strings (up to 32 characters + enclosed in single quotes), parameters (numeric or character) or parametric expressions. See + below for additional details. + + arg9 : str + Values passed into the file or block where the parameters ARG1 through ARG9 and AR10 through + AR18 are referenced. Values may be numbers, alphanumeric character strings (up to 32 characters + enclosed in single quotes), parameters (numeric or character) or parametric expressions. See + below for additional details. + + ar10 : str + The description of the argument is missing in the Python function. Please, refer to the `command + documentation `_ + for further information. + + ar11 : str + The description of the argument is missing in the Python function. Please, refer to the `command + documentation `_ + for further information. + + ar12 : str + The description of the argument is missing in the Python function. Please, refer to the `command + documentation `_ + for further information. + + ar13 : str + The description of the argument is missing in the Python function. Please, refer to the `command + documentation `_ + for further information. + + ar14 : str + The description of the argument is missing in the Python function. Please, refer to the `command + documentation `_ + for further information. + + ag15 : str + The description of the argument is missing in the Python function. Please, refer to the `command + documentation `_ + for further information. + + ar16 : str + The description of the argument is missing in the Python function. Please, refer to the `command + documentation `_ + for further information. + + ar17 : str + The description of the argument is missing in the Python function. Please, refer to the `command + documentation `_ + for further information. + + ar18 : str + The description of the argument is missing in the Python function. Please, refer to the `command + documentation `_ + for further information. Notes ----- - Causes execution of a macro file called Name, or, if not found, a macro - block "Name" on the macro library file [``*ULIB``]. Argument values - (numeric or character) are passed into the file or block and - substituted for local parameters ARG1, ARG2, ..., AR18. The file Name - may also be executed as an "unknown command" (i.e., without the ``*USE`` - command name) as described below. - - A macro is a sequence of ANSYS commands (as many as needed) recorded in - a file or in a macro block in a library file (specified with the ``*ULIB`` - command). The file or block is typically executed with the ``*USE`` - command. In addition to command, numerical and alphanumeric data, the - macro may include parameters which will be assigned numerical or - alphanumerical character values when the macro is used. Use of the - macro may be repeated (within a do-loop, for example) with the - parameters incremented. A macro is defined within a run by "enclosing" - a sequence of data input commands between a ``*CREATE`` and a ``*END`` - command. The data input commands are passive (not executed) while - being written to the macro file. The macro file (without ``*CREATE`` and - ``*END`` ) can also be created external to ANSYS. - - Up to 99 specially named scalar parameters called ARG1 to AR99 are - locally available to each macro. Note that the prefix for the first 9 - parameters is "ARG," while the prefix for the last 90 is "AR." A local - parameter is one which is not affected by, nor does it affect, other - parameters, even those of the same name, which are used outside of the - macro. The only way a local parameter can affect, or be affected by, - parameters outside the macro is if values are passed out of, or into, - the macro by an argument list. Parameters ARG1 through AR18 can have - their values (numeric or character) passed via the argument list on the - ``*USE`` command (ARG1 through AR19 can be passed as arguments on the - "unknown command" macro). Parameters AR19 through AR99 (AR20 through - AR99 in the "unknown command" macro) are available solely for use - within the macro; they cannot be passed via an argument list. Local - parameters are available to do-loops and to /INPUT files processed - within the macro. In addition to an ARG1--AR99 set for each macro, - another ARG1--AR99 set is available external to all macros, local to - "non-macro" space. - - A macro is exited after its last line is executed. Macros may be - nested (such as a ``*USE`` or an "unknown command" within a macro). Each - nested macro has its own set of 99 local parameters. Only one set of - local parameters can be active at a time and that is the set - corresponding to the macro currently being executed or to the set - external to all macros (if any). When a nested macro completes - execution, the previous set of local parameters once again becomes - available. Use ``*STATUS,ARGX`` to view current macro parameter values. - - An alternate way of executing a macro file is via the "unknown command" - route. If a command unknown to the ANSYS program is entered, a search - for a file of that name (plus a .MAC suffix) is made. If the file - exists, it is executed, if not, the "unknown command" message is - output. Thus, users can write their own commands in terms of other - ANSYS commands. The procedure is similar to issuing the ``*USE`` command - with the unknown command in the Name field. For example, the command - CMD,10,20,30 is internally similar to ``*USE,CMD,10,20,30``. The macro - file named CMD.MAC will be executed with the three parameters. The - ``*USE`` macro description also applies to the "unknown command" macro, - except that various directories are searched and a suffix (.MAC) is - assumed. Also, a macro library file is not searched. - - A three-level directory search for the "unknown command" macro file may - be available (see the Operations Guide). The search order may be: 1) a - high-level system directory, 2) the login directory, and 3) the local - (working) directory. Use the /PSEARCH command to change the directory - search path. For an "unknown command" CMD, the first file named - CMD.MAC found to exist in the search order will be executed. The - command may be input as upper or lower case, however, it is converted - to upper case before the file name search occurs. On systems that - uniquely support both upper and lower case file names, the file with - the matching lower case name will be used if it exists, otherwise, the - file with the matching upper case name will be used. All macro files - placed in the apdl directory must be upper case. - - Note, since undocumented commands exist in the ANSYS program, the user - should issue the command intended for the macro file name to be sure - the "unknown command" message is output in the processor where it's to - be used. If the macro is to be used in other processors, the other - processors must also be checked. + + .. warning:: + + This function contains specificities regarding the argument definitions. + Please refer to the `command documentation `_ + for further explanations. + + **Argument Descriptions** + + .. _a-USE_argdescript: + + * ``name : str`` - Name (32 characters maximum, beginning with a letter) identifying the macro file + or a macro block on a macro library file. + + * ``arg1, arg2, arg3,..., ar18 : str`` - Values passed into the file or block where the + parameters ARG1 through ARG9 and AR10 through AR18 are referenced. Values may be numbers, + alphanumeric character strings (up to 32 characters enclosed in single quotes), parameters (numeric + or character) or parametric expressions. See below for additional details. + + .. _a-USE_notes: + + Causes execution of a macro file called ``Name``, or, if not found, a macro block " ``Name`` " on + the macro library file ( :ref:`ulib` ). Argument values (numeric or character) are passed into the + file or block and substituted for local parameters ARG1, ARG2,..., AR18. The file ``Name`` may also + be executed as an "unknown command" (that is, without the :ref:`use` command name) as described + below. + + A macro is a sequence of Mechanical APDL commands (as many as needed) recorded in a file or in a + macro + block in a library file (specified with the :ref:`ulib` command). The file or block is typically + executed via :ref:`use`. In addition to command, numerical and alphanumeric data, the macro can + include parameters which will be assigned numerical or alphanumerical character values when the + macro is used. Use of the macro can be repeated (within a do-loop, for example) with the parameters + incremented. + + A macro is defined within a run by enclosing a sequence of data input commands between :ref:`create` + and :ref:`end` commands. The data input commands are passive (not executed) while being written to + the macro file. The macro file (without :ref:`create` and :ref:`end` ) can also be created external + to Mechanical APDL. + + Up to 99 specially named scalar parameters, ARG1 to AR99, are locally available to each macro: + + * The prefix for the first nine parameters is ARG, and the prefix for the remaining 90 parameters is + AR. + + * A local parameter is not affected by, nor does it affect, other parameters, even those of the same + name, which are used outside of the macro. The only way a local parameter can affect, or be + affected by, parameters outside the macro is if values are passed out of, or into, the macro by an + argument list. + + * Parameters ARG1 through AR18 can have their values (numeric or character) passed via the argument + list on :ref:`use`. (ARG1 through AR19 can be passed as arguments on the unknown-command macro.) + Parameters AR19 through AR99 (AR20 through AR99 in the unknown-command macro) are available solely + for use within the macro; they cannot be passed via an argument list. + + * Local parameters are available to do-loops and to :ref:`input` files processed within the macro. + In addition to an ARG1--AR99 set for each macro, another ARG1--AR99 set is available external to + all macros, local to "non-macro" space. + + A macro is exited after its last line is executed. Macros may be nested (such as a :ref:`use` or an + unknown command within a macro). Each nested macro has its own set of 99 local parameters. Only one + set of local parameters can be active at a time and that is the set corresponding to the macro + currently being executed or to the set external to all macros (if any). When a nested macro + completes execution, the previous set of local parameters once again becomes available. Issue + :ref:`starstatus`,ARGX to view current macro parameter values. + + An alternate way of executing a macro file is via the unknown-command route. If a command unknown to + Mechanical APDL is entered, a search for a file of that name (plus a :file:`.MAC` suffix) is made. + If the file exists, it is executed, if not, the "unknown command" message is output. Thus, you can + write your own commands in terms of other Mechanical APDL commands. The procedure is similar to + issuing :ref:`use` with the unknown command in the ``Name`` field. For example, the command **CMD** + ,10,20,30 is internally similar to :ref:`use`,CMD,10,20,30. The macro file named :file:`CMD.MAC` is + executed with the three parameters. The :ref:`use` macro description also applies to the unknown- + command macro, except that various directories are searched and a suffix ( :file:`.MAC` ) is + assumed. Also, a macro library file is not searched. + + A three-level directory search for the unknown-command macro file may be available. The search order + may be: 1) a high-level system directory, 2) the log-in directory, and 3) the local (working) + directory. Issue :ref:`psearch` to change the directory search path. For an unknown command **CMD**, + the first file named :file:`CMD.MAC` found to exist in the search order is executed. The command can + be input in lower-, upper-, or mixed-case; however, it converts to uppercase automatically before + the file name search occurs. On systems that preserve the case as it was input, a file matching the + upper-case name is used first, followed by a file with the matching the lower-case name, and finally + a file matching the mixed-case name. All macro files placed in the :file:`apdl` directory must be + upper-case. + + Because undocumented commands exist in Mechanical APDL, you should issue the command intended for + the macro + file name to ensure that the unknown-command message is output in the processor where it is to be + used. If the macro is to be used in other processors, the other processors must also be checked. This command is valid in any processor. """ diff --git a/src/ansys/mapdl/core/_commands/apdl/matrix_op.py b/src/ansys/mapdl/core/_commands/apdl/matrix_op.py deleted file mode 100644 index 35ae6eaa2bd..00000000000 --- a/src/ansys/mapdl/core/_commands/apdl/matrix_op.py +++ /dev/null @@ -1,999 +0,0 @@ -# Copyright (C) 2016 - 2025 ANSYS, Inc. and/or its affiliates. -# SPDX-License-Identifier: MIT -# -# -# Permission is hereby granted, free of charge, to any person obtaining a copy -# of this software and associated documentation files (the "Software"), to deal -# in the Software without restriction, including without limitation the rights -# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -# copies of the Software, and to permit persons to whom the Software is -# furnished to do so, subject to the following conditions: -# -# The above copyright notice and this permission notice shall be included in all -# copies or substantial portions of the Software. -# -# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -# SOFTWARE. - - -class MatrixOP: - def axpy(self, vr="", vi="", m1="", wr="", wi="", m2="", **kwargs): - """Performs the matrix operation ``M2= v*M1 + w*M2``. - - APDL Command: ``*AXPY`` - - Parameters - ---------- - vr, vi - The real and imaginary parts of the scalar v. Default value is 0. - - m1 - Name of matrix M1. If not specified, the operation ``M2 = w*M2`` will - be performed. - - wr, wi - The real and imaginary parts of the scalar w. Default value is 0. - - m2 - Name of matrix M2. Must be specified. - - Notes - ----- - The matrices M1 and M2 must have the same dimensions and same type - (dense or sparse). If M2 is real, vi and wi are ignored. - """ - command = f"*AXPY,{vr},{vi},{m1},{wr},{wi},{m2}" - return self.run(command, **kwargs) - - def comp(self, matrix="", algorithm="", threshold="", **kwargs): - """Compresses the columns of a matrix using a specified algorithm. - - APDL Command: ``*COMP`` - - Parameters - ---------- - matrix - Name of the matrix to compress. - - algorithm - Algorithm to use: - - Singular value decomposition algorithm (default). - Modified Gram-Schmidt algorithm. - - threshold - Numerical threshold value used to manage the compression. Default - value for SVD is 1E-7; default value for MGS is 1E-14. - - Notes - ----- - The algorithms available through this command are only applicable to - dense matrices that were created using the ``*DMAT`` command. - - Columns which are linearly dependent on others are removed, leaving the - independent or basis vectors. The matrix is resized according to the - new size determined by the algorithm. - """ - command = f"*COMP,{matrix},{algorithm},{threshold}" - return self.run(command, **kwargs) - - def dmat( - self, - matrix="", - type_="", - method="", - val1="", - val2="", - val3="", - val4="", - val5="", - **kwargs, - ): - """Creates a dense matrix. - - APDL Command: ``*DMAT`` - - Parameters - ---------- - matrix - Name used to identify the matrix. Must be specified. - - type\\_ - Matrix type: - - Double precision real values (default). - Complex double precision values. - - method - Method used to create the matrix: - - Allocate space for a matrix (default). - Resize an - existing matrix to new row and column dimensions. Values - are kept from the original matrix. If the dimensions - specified by Val1 (rows) and Val2 (columns) are greater - than the original matrix size, the additional entries are - assigned a value of zero. - - Copy an existing matrix. - Link to an existing matrix. The - memory will be shared between the original matrix and the - new matrix. This is useful for manipulating a submatrix of - a larger matrix. The Val1 through Val5 arguments will be - used to specify the lower and upper bounds of row and - column numbers from the original matrix. - - val1, val2, val3, val4, val5 - Additional input. The meaning of Val1 through Val5 will vary - depending on the specified Method. See details below. - - Notes - ----- - This command allows you to create a dense matrix. To create a sparse - matrix, use the ``*SMAT`` command. ``*SMAT`` is recommended for large matrices - obtained from the .FULL or .HBMAT file. Refer to the HBMAT command - documentation for more information about .FULL file contents. - - Use the ``*VEC`` command to create a vector. - - For very large matrices, use the OUTOFCORE option (Method = ALLOC or - COPY) to keep some of the matrix on disk if there is insufficient - memory. - - When importing a dense matrix from a DMIG file, you can define the - formatting of the file using the Val3 and Val4 fields. - - """ - command = f"*DMAT,{matrix},{type_},{method},{val1},{val2},{val3},{val4},{val5}" - return self.run(command, **kwargs) - - def dot(self, vector1="", vector2="", par_real="", par_imag="", **kwargs): - """Computes the dot (or inner) product of two vectors. - - APDL Command: ``*DOT`` - - Parameters - ---------- - vector1 - Name of first vector; must have been previously specified by a ``*VEC`` - command. - - vector2 - Name of second vector; must have been previously specified by a - ``*VEC`` command. - - par_real - Parameter name that contains the result. - - par_imag - Parameter name that contains the imaginary part of the result (used - only for complex vectors). - - Notes - ----- - If Vector1 and Vector2 are complex, the complex conjugate of Vector1 is - used to compute the result (Par_Real, Par_Imag). - """ - command = f"*DOT,{vector1},{vector2},{par_real},{par_imag}" - return self.run(command, **kwargs) - - def eigen(self, kmatrix="", mmatrix="", cmatrix="", evals="", evects="", **kwargs): - """Performs a modal solution with unsymmetric or damping matrices. - - APDL Command: ``*EIGEN`` - - Parameters - ---------- - kmatrix - Name of the stiffness matrix. May be a real or complex-valued - matrix. - - mmatrix - Name of the mass matrix. - - cmatrix - Name of the damping matrix (used only for MODOPT,DAMP). - - evals - Name of the output eigenvalues vector. It will be an m-long ``*VEC`` - vector of complex values, where m is the number of eigenvalues - requested (MODOPT). - - evects - Name of the output eigenvector matrix. It will be a n x m ``*DMAT`` - (dense) matrix of complex values, where n is the size of the matrix - and m is the number of eigenvalues requested (MODOPT). - - Notes - ----- - Use the command ANTYPE,MODAL and the MODOPT command to specify the - modal solution options. Only MODOPT,DAMP, MODOPT,UNSYM, MODOPT,LANB, - and MODOPT,SUBSP are supported. - - ``*EIGEN`` with Block Lanczos (LANB) only supports sparse matrices. - - Distributed ANSYS Restriction: This command is not supported in - Distributed ANSYS. - """ - command = f"*EIGEN,{kmatrix},{mmatrix},{cmatrix},{evals},{evects}" - return self.run(command, **kwargs) - - def export( - self, - matrix="", - format_="", - fname="", - val1="", - val2="", - val3="", - **kwargs, - ): - """Exports a matrix to a file in the specified format. - - APDL Command: ``*EXPORT`` - - Parameters - ---------- - matrix - Name of the matrix to export (must be a matrix previously created - with ``*DMAT`` or ``*SMAT``, or a vector previously created with ``*VEC``). - - format\\_ - Format of the output file: - - Export the matrix in the Matrix Market Format. - Export - the matrix in the SUB file format. - - Export the matrix in the Harwell-Boeing file format. - - Export the matrix in a native format, to be re-imported - using the ``*DMAT`` or ``*SMAT`` command. - - Export the matrix to an existing EMAT file. - Export the - matrix to an APDL array parameter. - - Export the matrix profile to a Postscript file. - Export - the matrix in the DMIG file format. - - fname - Name of the file, or name of the array parameter if Format = APDL. - - val1, val2, val3 - Additional input. The meaning of Val1 through Val3 will vary - depending on the specified Format. See table below for details. - - Notes - ----- - Only sparse matrices can be exported to Postscript files. This option - plots the matrix profile as a series of dots. - - If you want to create a .SUB file from several matrices, you need to - set Val3 = WAIT for all matrices but the last, and Val3 = DONE for the - last one. The export will be effective at the last ``*EXPORT`` command. - - To create a .SUB file or .DMIG file from scratch, you must supply the - row information array. (Specify this array in the Val2 field for .SUB - or in the Val1 field for .DMIG.) This must be an m x 2 array, where m - is the size of the matrix. The first column is the node number and the - second column is the DOF number corresponding to each row of the - matrix. - - The ``*EXPORT`` command is not applicable to sparse matrices initialized - from .FULL files by means of the NOD2BCS option on the ``*SMAT`` command - (i.e., ``*SMAT,,,IMPORT,FULL,,NOD2BCS``). - """ - command = f"*EXPORT,{matrix},{format_},{fname},{val1},{val2},{val3}" - return self.run(command, **kwargs) - - def fft( - self, - type_="", - inputdata="", - outputdata="", - dim1="", - dim2="", - resultformat="", - **kwargs, - ): - """Computes the fast Fourier transformation of a specified matrix or - - APDL Command: ``*FFT`` - vector. - - Parameters - ---------- - type\\_ - Type of FFT transformation: - - Forward FFT computation (default). - Backward FFT computation. - - inputdata - Name of matrix or vector for which the FFT will be computed. This - can be a dense matrix (created by the ``*DMAT`` command) or a vector - (created by the ``*VEC`` command). Data can be real or complex values. - There is no default value for this argument. - - outputdata - Name of matrix or vector where the FFT results will be stored. The - type of this argument must be consistent with InputData (see table - below). There is no default value for this argument. - - dim1 - The number of terms to consider for a vector, or the number of rows - for a matrix. Defaults to the whole input vector or all the rows of - the matrix. - - dim2 - The number of columns to consider for a matrix. Defaults to all the - columns of the matrix. (Valid only for matrices.) - - resultformat - Specifies the result format: - - Returns the full result. That is, the result matches the - dimension specified on this command (DIM1, DIM2). - - Returns partial results. For real input data, there is a - symmetry in the results of the Fourier transform as some - coefficients are conjugated. The partial format uses this - symmetry to optimize the storage of the results. (Valid - only for real data.) - - Notes - ----- - In the example that follows, the fast Fourier transformation is used to - filter frequencies from a noisy input signal. - """ - command = f"*FFT,{type_},{inputdata},{outputdata},{dim1},{dim2},{resultformat}" - return self.run(command, **kwargs) - - def free(self, name="", **kwargs): - """Deletes a matrix or a solver object and frees its memory allocation. - - APDL Command: ``*FREE`` - - Parameters - ---------- - name - Name of the matrix or solver object to delete. Use Name = ALL to - delete all APDL Math matrices and solver objects. Use Name = WRK - to delete all APDL Math matrices and solver objects that belong to - a given workspace. - - val1 - If Name = WRK, Val1 is to set the memory workspace number. - - Notes - ----- - A /CLEAR command will automatically delete all the current APDL Math - objects. - """ - command = f"*FREE,{name}" - return self.run(command, **kwargs) - - def init(self, name="", method="", val1="", val2="", val3="", **kwargs): - """Initializes a vector or dense matrix. - - APDL Command: ``*INIT`` - - Parameters - ---------- - name - Vector or matrix which will be initialized. This can be a vector - (created by the ``*VEC`` command) or a dense matrix (created by the - ``*DMAT`` command). - - method - Initialization method to use: - - Fill the vector/matrix with zeros (default). - Fill the vector/matrix with a constant value. - - Fill the vector/matrix with random values. - Fill the nth diagonal of the matrix with a constant value. Other values are not - overwritten. - - val1, val2, val3 - Additional input. The meaning of Val1 through Val3 will vary - depending on the specified Method. See details below. - - Notes - ----- - This command initializes a previously defined vector (``*VEC``) or dense - matrix (``*DMAT``). - """ - command = f"*INIT,{name},{method},{val1},{val2},{val3}" - return self.run(command, **kwargs) - - def itengine( - self, - type_="", - enginename="", - precondname="", - matrix="", - rhsvector="", - solvector="", - maxiter="", - toler="", - **kwargs, - ): - """Performs a solution using an iterative solver. - - APDL Command: ``*ITENGINE`` - - Parameters - ---------- - type\\_ - Specifies the algorithm to be used: - - enginename - Name used to identify this iterative solver engine. Must be - specified. - - precondname - Linear solver engine name (``*LSENGINE``) identifying the factored - matrix to be used as the preconditioner. - - matrix - Name of the matrix to solve. - - rhsvector - Matrix (load vector) name. - - solvector - Solution vector name. If non-zero, it will be taken as the initial - vector for the iterative process. - - maxiter - Maximum number of iterations allowed. Default is 2 times the number - of rows in the matrix. - - toler - Convergence tolerance. Default is 1.0E-8. - - Notes - ----- - This command solves Ax = b using a preconditioned conjugate gradient - algorithm. It uses an existing factored system as the preconditioner. - This solution method is useful if an existing matrix has been solved - and minor changes have been made to the matrix. - """ - command = f"*ITENGINE,{type_},{enginename},{precondname},{matrix},{rhsvector},{solvector},{maxiter},{toler}" - return self.run(command, **kwargs) - - def lsbac(self, enginename="", rhsvector="", solvector="", **kwargs): - """Performs the solve (forward/backward substitution) of a - factorized linear system. - - APDL Command: ``*LSBAC`` - - Parameters - ---------- - enginename - Name used to identify this engine. Must have been previously - created using ``*LSENGINE`` and factorized using ``*LSFACTOR``. - - rhsvector - Name of vector containing the right-hand side (load) vectors as - input. Must have been previously defined as a ``*VEC`` vector or a - ``*DMAT`` matrix. - - solvector - Name of vector that will contain the solution vectors upon - completion. Must be predefined as a ``*VEC`` vector or ``*DMAT`` matrix. - - Notes - ----- - This command performs forward and back substitution to obtain the - solution to the linear matrix equation Ax = b. The matrix engine must - have been previously defined using ``*LSENGINE``, and the matrix factored - using ``*LSFACTOR``. - - You can use the ``*DMAT,,,COPY`` (or ``*VEC,,,COPY``) command to copy the load - vector to the solution vector in order to predefine it with the - appropriate size. - """ - command = f"*LSBAC,{enginename},{rhsvector},{solvector}" - return self.run(command, **kwargs) - - def lsdump(self, enginename="", filename="", **kwargs): - """Dumps a linear solver engine to a binary File. - - APDL Command: ``*LSDUMP`` - - Parameters - ---------- - enginename - Name used to identify this engine. Must have been previously - created using ``*LSENGINE`` and factorized using ``*LSFACTOR``. - - filename - Name of the file to create. - - Notes - ----- - Dumps a previously factorized linear solver system to a binary file. - Only LAPACK and BCS linear solvers can be used with this feature. The - Linear Solver can later be restored with the ``*LSRESTORE`` command. - - A BCS Sparse Solver can be dumped only if uses the INCORE memory option - (see BCSOPTION). - """ - command = f"*LSDUMP,{enginename},{filename}" - return self.run(command, **kwargs) - - def lsengine(self, type_="", enginename="", matrix="", option="", **kwargs): - """Creates a linear solver engine. - - APDL Command: ``*LSENGINE`` - - Parameters - ---------- - type_ - Specifies the algorithm to be used: - - * ``"BCS"`` - Boeing sparse solver (default if applied to - sparse matrices). - - * ``"DSS"`` : MKL sparse linear solver (Intel Windows and - Linux systems only). - - * ``"LAPACK"`` : LAPACK dense matrix linear solver (default if - applied to dense matrices). - - * ``"DSP"`` : Distributed sparse solver. - - enginename - Name used to identify this engine. Must be specified. - - matrix - Name of the matrix to solve. - - option - Option to control the memory mode of the DSS solver (used only - if ``type='dss'``): - - * ``"INCORE"`` : In-core memory mode - - * ``"OUTOFCORE"`` : Out-of-core memory mode - - Notes - ----- - This command creates a linear solver engine. - - The BCS, DSS, and DSP solvers can only be used with sparse matrices. - For dense matrices, use the LAPACK solver. - """ - command = f"*LSENGINE,{type_},{enginename},{matrix},{option}" - return self.run(command, **kwargs) - - def lsfactor(self, enginename="", option="", **kwargs): - """Performs the numerical factorization of a linear solver system. - - APDL Command: ``*LSFACTOR`` - - Parameters - ---------- - enginename - Name used to identify this engine. Must have been previously - created using ``*LSENGINE``. - - option - Option to invert the matrix, used only with an LAPACK engine - (``*LSENGINE,LAPACK``): - - Notes - ----- - Performs the computationally intensive, memory intensive factorization - of a matrix specified by ``*LSENGINE``, using the solver engine also - specified by ``*LSENGINE``. - """ - command = f"*LSFACTOR,{enginename},{option}" - return self.run(command, **kwargs) - - def lsrestore(self, enginename="", filename="", **kwargs): - """Restores a linear solver engine from a binary file. - - APDL Command: ``*LSRESTORE`` - - Parameters - ---------- - enginename - Name used to identify this engine. - - filename - Name of the file to read from. - - Notes - ----- - Restores a previously dumped Linear Solver (see the ``*LSDUMP`` command). - This Linear Solver can be used to solve a linear system using the - ``*LSBAC`` command. - """ - command = "*LSRESTORE,%s,%s" % (str(enginename), str(filename)) - return self.run(command, **kwargs) - - def merge(self, name1="", name2="", val1="", val2="", **kwargs): - """Merges two dense matrices or vectors into one. - - APDL Command: ``*MERGE`` - - Parameters - ---------- - name1 - Name of the matrix or vector to extend. - - name2 - Name of the matrix or vector to be merged into ``name1``. - - val1 - If ``name1`` refers to a dense matrix created by the ``*DMAT`` - command then the column or row number indicating where the new values - are to be inserted into the Name1 matrix. - - If ``name` refers to a vector created by ``*VEC`` then this is the - row number indicating where the new values are to be inserted - into the ``name1`` vector. - - val2 - Specifies how the ``name2`` matrix or vector is copied into - the ``name1`` matrix. - - * ``"COL"`` : Insert the new values at the column location - specified by ``val1`` (default). - * ``"row"`` : Insert the new values at the row location - specified by ``val1``. - - Notes - ----- - ``merge`` can be used to add new columns or rows to a dense matrix - that was created by the ``*DMAT`` command. In this case, ``name1`` must - be the name of the dense matrix and ``name2`` must refer to a vector - or another dense matrix. - - ``*MERGE`` can also be used to add new rows to a vector that was - created by the ``*VEC`` command. In this case, ``name1`` and - ``name2`` must both refer to vectors. - - In all cases, the values of the original matrix or vector are - retained, and the matrix or vector is resized to accommodate the - additional rows or columns. - """ - return self.run(f"MERGE,{name1},{name2},{val1},{val2}", **kwargs) - - def mult(self, m1="", t1="", m2="", t2="", m3="", **kwargs): - """Performs the matrix multiplication ``M3 = M1(T1)*M2(T2)``. - - APDL Command: ``*MULT`` - - Parameters - ---------- - m1 - Name of matrix M1. Must have been previously specified by a ``*DMAT`` - or ``*SMAT`` command. - - t1 - Transpose key. Set T1 = TRANS to use the transpose of M1. If blank, - transpose will not be used. - - m2 - Name of matrix M2. Must have been previously specified by a ``*DMAT`` - command. - - t2 - Transpose key. Set T2 = TRANS to use the transpose of M2. If blank, - transpose will not be used. - - m3 - Name of resulting matrix, M3. Must be specified. - - Notes - ----- - The matrices must be dimensionally consistent such that the number of - columns of M1 (or the transposed matrix, if requested) is equal to the - number of rows of M2 (or the transposed matrix, if requested). - - You cannot multiply two sparse matrices with this command (that is, M1 - and M2 cannot both be sparse). The resulting matrix, M3, will always be - a dense matrix, no matter what combination of input matrices is used - (dense*sparse, sparse*dense, or dense*dense). - """ - command = f"*MULT,{m1},{t1},{m2},{t2},{m3}" - return self.run(command, **kwargs) - - def nrm(self, name="", normtype="", parr="", normalize="", **kwargs): - """Computes the norm of the specified matrix or vector. - - APDL Command: ``*NRM`` - - Parameters - ---------- - name - Matrix or vector for which the norm will be computed. This - can be a dense matrix (created by the ``*DMAT`` command), - a sparse matrix (created by the ``*SMAT`` command) or a - vector (created by the ``*VEC`` command) - - normtype - Mathematical norm to use: - - - L2 (Euclidean or SRSS) norm (default). - - L1 (absolute sum) norm (vectors only). - - parr - Parameter name that contains the result. - - normalize - Normalization key; to be used only for vectors created by ``*VEC``: - - Normalize the vector such that the norm is 1.0. - Do not - normalize the vector (default). - - Notes - ----- - The NRM2 option corresponds to the Euclidean or L2 norm and is - applicable to either vectors or matrices. The NRM1 option corresponds - to the L1 norm and is applicable to vectors only. The NRMINF option is - the maximum norm and is applicable to either vectors or matrices. - """ - command = f"*NRM,{name},{normtype},{parr},{normalize}" - return self.run(command, **kwargs) - - def remove(self, name="", val1="", val2="", val3="", **kwargs): - """Suppresses rows or columns of a dense matrix or a vector. - - APDL Command: ``*REMOVE`` - - Parameters - ---------- - name - Name of the matrix or vector to be revised. - - val1 - First row or column number to suppress if ``name`` is a dense - matrix. First value index to suppress if ``name`` is a - vector. - - Val2 - Last row or column number to suppress if ``name`` is a dense - matrix. Last value index to suppress if ``name`` is a - vector. - - Val3 - Specifies what to remove if ``name`` is a dense matrix. - - * ``"COL"`` : Remove columns of the matrix (default). - - * ``"ROW"`` : Remove rows of the matrix. - - Notes - ----- - The values of the original matrix or vector specified by Name are - retained. The matrix or vector is resized to the new number of - rows and columns. - """ - return self.run(f"REMOVE,{name},{val1},{val2},{val3}", **kwargs) - - def scal(self, name="", val1="", val2="", **kwargs): - """Scales a vector or matrix by a constant or a vector. - - APDL Command: ``*SCAL`` - - Parameters - ---------- - name - Name used to identify the vector or matrix to be scaled. Must - be specified. - - val1 - When scaling a matrix or a vector by a scalar value, Val1 is - the real part of the constant to use (default = 1). - - When scaling a matrix or a vector by a vector, Val1 is the - name of the vector used for the scaling operation. - - val2 - The imaginary part of the constant to use (default = 0). - This value is used only if the vector or matrix specified by - Name is complex. - - val2 is only valid for scaling by a constant. It is not - used when scaling by a vector. - - Notes - ----- - This command can be applied to vectors and matrices created by the - ``*VEC``, ``*DMAT`` and ``*SMAT`` commands. - - Data types must be consistent between the vectors and matrices - being scaled and the scaling vector (or constant value). - - When scaling a matrix with a vector, the matrix must be square - and the scaling vector must be the same size. - - Scaling a matrix with a vector, is available only on - MAPDL V23.2 and greater. - - """ - return self.run(f"*SCAL,{name},{val1},{val2}", **kwargs) - - def smat( - self, - matrix="", - type_="", - method="", - val1="", - val2="", - val3="", - val4="", - **kwargs, - ): - """Creates a sparse matrix. - - APDL Command: ``*SMAT`` - - Parameters - ---------- - matrix - Name used to identify the matrix. Must be specified. - - type\\_ - Matrix type: - - Double precision real values (default). - Complex double precision values. - - method - Method used to create the matrix: - - Copy an existing matrix. - Import the matrix from a file. - - val1, val2, val3, val4 - Additional input. The meaning of Val1 through Val3 will - vary depending on the specified Method. See in your ansys - documentation. - - Notes - ----- - Use the ``*DMAT`` command to create a dense matrix. - - Unlike the ``*DMAT`` command, the ``*SMAT`` command cannot be used to allocate - a sparse matrix. - - For more information on the NOD2BCS and USR2BCS mapping vectors, see - Degree of Freedom Ordering in the ANSYS Parametric Design Language - Guide. - - For more information about .FULL file contents, see the HBMAT in the - Command Reference. - """ - command = f"*SMAT,{matrix},{type_},{method},{val1},{val2},{val3},{val4}" - return self.run(command, **kwargs) - - def starprint(self, matrix="", fname="", **kwargs): - """Prints the matrix values to a file. - - APDL Command: ``*PRINT`` - - Parameters - ---------- - matrix - Name of matrix or vector to print. Must be specified. - - fname - File name. If blank, matrix is written to the output file. - - Notes - ----- - The matrix may be a dense matrix (``*DMAT``), a sparse matrix - (``*SMAT``), or a vector (``*VEC``). Only the non-zero entries - of the matrix are printed. - """ - command = f"*PRINT,{matrix},{fname}" - return self.run(command, **kwargs) - - def sort(self, **kwargs): - """Specifies "Sort settings" as the subsequent status topic. - - APDL Command: SORT - - Notes - ----- - This is a status [STAT] topic command. Status topic commands are - generated by the GUI and will appear in the log file (Jobname.LOG) if - status is requested for some items under Utility Menu> List> Status. - This command will be immediately followed by a STAT command, which will - report the status for the specified topic. - - If entered directly into the program, the STAT command should - immediately follow this command. - """ - command = f"SORT," - return self.run(command, **kwargs) - - def vec( - self, - vector="", - type_="", - method="", - val1="", - val2="", - val3="", - val4="", - **kwargs, - ): - """Creates a vector. - - APDL Command: ``*VEC`` - - Parameters - ---------- - vector - Name used to identify the vector. Must be specified. - - type_ - Vector type: - - * ``"D"`` : Double precision real values (default). - - * ``"Z"`` : Complex double precision values. - - * ``"I"`` : Integer values. - - method - Method used to create the vector: - - * ``"ALLOC"`` : Allocate space for a vector (default). - - * ``"RESIZE"`` : Resize an existing vector to a new - length. Values are kept from the original vector. If the - length specified by Val1 is greater than the original vector - length, the additional rows are assigned a value of zero. - - * ``"COPY"`` : Copy an existing vector. - - * ``"IMPORT"`` : Import the vector from a file. - - * ``"LINK"`` : Link to a column of an existing dense ``*DMAT`` - matrix and use it in subsequent vector calculations. Any - changes to the vector are also made to the corresponding - matrix column (memory is shared). - - Copy an existing vector. - Import the vector from a file. - - val1, val2, val3, val4, val5 - Additional input. The meaning of ``val1`` through ``val5`` will vary - depending on the specified Method. See: - https://www.mm.bme.hu/~gyebro/files/ans_help_v182/ans_cmd/Hlp_C_VEC.html - - Notes - ----- - Use the ``*DMAT`` command to create a matrix. - - For more information on the BACK and FORWARD nodal mapping vectors, see - Degree of Freedom Ordering in the ANSYS Parametric Design Language - Guide. - """ - command = f"*VEC,{vector},{type_},{method},{val1},{val2},{val3},{val4}" - return self.run(command, **kwargs) - - def wrk(self, num="", **kwargs): - """Sets the active workspace number. - - APDL Command: ``*WRK`` - - Parameters - ---------- - num - Number of the active memory workspace for APDLMath vector and - matrices. All the following APDLMath vectors and matrices will - belong to this memory workspace, until the next call to the ``*WRK`` - command. By default, all the APDLMath objects belong to workspace - number 1. - - Notes - ----- - This feature enables you to associate a set of vector and matrices in a - given memory workspace, so that you can easily manage the free step: - - This feature can be useful to free all the temporary APDLMath variables - inside a MACRO in one call. - """ - command = "*WRK,%s" % (str(num)) - return self.run(command, **kwargs) diff --git a/src/ansys/mapdl/core/_commands/apdl/matrix_operations.py b/src/ansys/mapdl/core/_commands/apdl/matrix_operations.py new file mode 100644 index 00000000000..85fe9654caf --- /dev/null +++ b/src/ansys/mapdl/core/_commands/apdl/matrix_operations.py @@ -0,0 +1,2401 @@ +# Copyright (C) 2016 - 2025 ANSYS, Inc. and/or its affiliates. +# SPDX-License-Identifier: MIT +# +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to deal +# in the Software without restriction, including without limitation the rights +# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +# copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in all +# copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +# SOFTWARE. + + +class MatrixOperations: + + def axpy( + self, + vr: str = "", + vi: str = "", + m1: str = "", + wr: str = "", + wi: str = "", + m2: str = "", + **kwargs, + ): + r"""Performs the matrix operation M2= v\2M1 + w\2M2. + + Mechanical APDL Command: `\*AXPY `_ + + Parameters + ---------- + vr : str + The real and imaginary parts of the scalar ``v``. Default value is 0. + + vi : str + The real and imaginary parts of the scalar ``v``. Default value is 0. + + m1 : str + Name of matrix ``M1``. If not specified, the operation M2 = w\*M2 will be performed. + + wr : str + The real and imaginary parts of the scalar ``w``. Default value is 0. + + wi : str + The real and imaginary parts of the scalar ``w``. Default value is 0. + + m2 : str + Name of matrix ``M2``. Must be specified. + + Notes + ----- + + .. warning:: + + This function contains specificities regarding the argument definitions. + Please refer to the `command documentation `_ + for further explanations. + + **Argument Descriptions** + + .. _a-AXPY_argdescript: + + * ``vr, vi : str`` - The real and imaginary parts of the scalar ``v``. Default value is 0. + + * ``m1 : str`` - Name of matrix ``M1``. If not specified, the operation M2 = w\*M2 will be + performed. + + * ``wr, wi : str`` - The real and imaginary parts of the scalar ``w``. Default value is 0. + + * ``m2 : str`` - Name of matrix ``M2``. Must be specified. + + .. _a-AXPY_notes: + + The matrices ``M1`` and ``M2`` must have the same dimensions and same type (dense or sparse). If + ``M2`` is real, ``vi`` and ``wi`` are ignored. + """ + command = f"*AXPY,{vr},{vi},{m1},{wr},{wi},{m2}" + return self.run(command, **kwargs) + + def comp( + self, + matrix: str = "", + algorithm: str = "", + threshold: str = "", + val1: str = "", + val2: str = "", + **kwargs, + ): + r"""Compresses a matrix using a specified algorithm. + + Mechanical APDL Command: `\*COMP `_ + + Parameters + ---------- + matrix : str + Name of the matrix to compress. + + algorithm : str + Algorithm or method to use: + + * ``SVD`` - Singular value decomposition algorithm (default). + + * ``MGS`` - Modified Gram-Schmidt algorithm. + + * ``SPARSE`` - Compress a sparse matrix based on the threshold value. + + threshold : str + Numerical threshold value used to manage the compression. The default value depends on the + method of compression: 1E-7 for SVD; 1E-14 for MGS; 1E-16 for SPARSE. + + val1 : str + Name of the vector used to store the :math:`equation not available` values (see + :ref:`a-COMP_notes` below). This argument is optional. + + val2 : str + Name of the dense matrix used to store the :math:`equation not available` output matrix (see + :ref:`a-COMP_notes` below). This argument is optional. + + Notes + ----- + + .. warning:: + + This function contains specificities regarding the argument definitions. + Please refer to the `command documentation `_ + for further explanations. + + **Argument Descriptions** + + .. _a-COMP_argdescript: + + * ``matrix : str`` - Name of the matrix to compress. + + * ``algorithm : str`` - Algorithm or method to use: + + * ``SVD`` - Singular value decomposition algorithm (default). + + * ``MGS`` - Modified Gram-Schmidt algorithm. + + * ``SPARSE`` - Compress a sparse matrix based on the threshold value. + + * ``threshold : str`` - Numerical threshold value used to manage the compression. The default value + depends on the method of compression: 1E-7 for SVD; 1E-14 for MGS; 1E-16 for SPARSE. + + ``Val1`` and ``Val2`` are additional input used only for the SVD algorithm: + + * ``val1 : str`` - Name of the vector used to store the :math:`equation not available` values (see + :ref:`a-COMP_notes` below). This argument is optional. + + * ``val2 : str`` - Name of the dense matrix used to store the :math:`equation not available` output + matrix (see :ref:`a-COMP_notes` below). This argument is optional. + + .. _a-COMP_notes: + + The SVD and MGS algorithms are only applicable to dense matrices that were created using the + :ref:`dmat` command. Columns that are linearly dependent on others are removed, leaving the + independent or basis vectors. The matrix is resized according to the new size determined by the + algorithm. + + For the SVD algorithm, the singular value decomposition of an input matrix :math:`equation not + available` is a factorization of the form: + + .. math:: + + equation not available + + Here, the :math:`equation not available` matrix is replaced by the :math:`equation not available` + matrix, according to the specified threshold. + + The SPARSE compression method is only applicable to sparse matrices that were created using the + :ref:`smat` command. All terms that have an absolute value below the specified threshold, relative + to the maximum value in the matrix, are removed from the original matrix. For example, given a + sparse matrix having 100 as the largest term and ``THRESHOLD`` = 0.5, all terms having an absolute + value below 0.5\*100 = 50 are removed. + """ + command = f"*COMP,{matrix},{algorithm},{threshold},{val1},{val2}" + return self.run(command, **kwargs) + + def dmat( + self, + matrix: str = "", + type_: str = "", + method: str = "", + val1: str = "", + val2: str = "", + val3: str = "", + val4: str = "", + val5: str = "", + **kwargs, + ): + r"""Creates a dense matrix. + + Mechanical APDL Command: `\*DMAT `_ + + Parameters + ---------- + matrix : str + Name used to identify the matrix. Must be specified. + + type_ : str + Matrix type: + + * ``D`` - Double precision real values (default). + + * ``Z`` - Complex double precision values. + + * ``I`` - Integer values. + + method : str + Method used to create the matrix: + + * ``ALLOC`` - Allocate space for a matrix (default). + + * ``RESIZE`` - Resize an existing matrix to new row and column dimensions. Values are kept from the + original matrix. If the dimensions specified by ``Val1`` (rows) and ``Val2`` (columns) are greater + than the original matrix size, the additional entries are assigned a value of zero. + + * ``COPY`` - Copy an existing matrix. + + * ``LINK`` - Link to an existing matrix. The memory will be shared between the original matrix and + the new matrix. This is useful for manipulating a submatrix of a larger matrix. The ``Val1`` through + ``Val5`` arguments will be used to specify the lower and upper bounds of row and column numbers from + the original matrix. + + * ``IMPORT`` - Import the matrix from a file. + + val1 : str + Name of the original matrix. + + val2 : str + First column number (defaults to 1). + + val3 : str + Last column number (defaults to the maximum column number of the original matrix). + + val4 : str + First row number (defaults to 1). + + val5 : str + Last row number (defaults to the maximum row number of the original matrix). + + Notes + ----- + + .. warning:: + + This function contains specificities regarding the argument definitions. + Please refer to the `command documentation `_ + for further explanations. + + **Argument Descriptions** + + .. _a-DMAT_argdescript: + + * ``matrix : str`` - Name used to identify the matrix. Must be specified. + + * ``type_ : str`` - Matrix type: + + * ``D`` - Double precision real values (default). + + * ``Z`` - Complex double precision values. + + * ``I`` - Integer values. + + * ``method : str`` - Method used to create the matrix: + + * ``ALLOC`` - Allocate space for a matrix (default). + + * ``RESIZE`` - Resize an existing matrix to new row and column dimensions. Values are kept from the + original matrix. If the dimensions specified by ``Val1`` (rows) and ``Val2`` (columns) are greater + than the original matrix size, the additional entries are assigned a value of zero. + + * ``COPY`` - Copy an existing matrix. + + * ``LINK`` - Link to an existing matrix. The memory will be shared between the original matrix and + the new matrix. This is useful for manipulating a submatrix of a larger matrix. The ``Val1`` through + ``Val5`` arguments will be used to specify the lower and upper bounds of row and column numbers from + the original matrix. + + * ``IMPORT`` - Import the matrix from a file. + + * ``val1, val2, val3, val4, val5 : str`` - Additional input. The meaning of ``Val1`` through + ``Val5`` will vary depending on the specified ``Method``. See details below. + + **The following** ``Valx`` fields are used with ``Method`` = ALLOC or ``Method`` = RESIZE: + + * ``val1 : str`` - Number of rows in the matrix. + + * ``val2 : str`` - Number of columns in the matrix. + + * ``val3 : str`` - Memory allocation type (used only with ``Method`` = ALLOC): + + * ``INCORE`` - In-core memory allocation (default). + + * ``OUTOFCORE`` - Out-of-core memory allocation. + + **The following** ``Valx`` fields are used with ``Method`` = COPY: + + * ``val1 : str`` - Name of the matrix to copy. + + * ``val2 : str`` - Method used for copying the matrix: + + * ``TRANS`` - Transpose the original matrix. ``Val3`` and ``Val4`` are ignored. + + * ``REAL`` - Copy the real part to the output matrix. This option only applies when copying a + complex value matrix to a real value matrix. ``Val3`` and ``Val4`` are ignored. + + * ``IMAG`` - Copy the imaginary part to the output matrix. This option only applies when copying a + complex value matrix to a real value matrix. ``Val3`` and ``Val4`` are ignored. + + * ``EXTRACT`` - Extract a submatrix based on row and column numbers specified by ``Val3`` and + ``Val4``. + + * ``val3 : str`` - Name of integer vector ( :ref:`vec` ) containing row numbers. If no vector is + specified, defaults to all rows. + + * ``val4 : str`` - Name of integer vector ( :ref:`vec` ) containing column numbers. If no vector is + specified, defaults to all columns. + + **The following** ``Valx`` fields are used with ``Method`` = LINK: + + * ``val1 : str`` - Name of the original matrix. + + * ``val2 : str`` - First column number (defaults to 1). + + * ``val3 : str`` - Last column number (defaults to the maximum column number of the original + matrix). + + * ``val4 : str`` - First row number (defaults to 1). + + * ``val5 : str`` - Last row number (defaults to the maximum row number of the original matrix). + + **The following table describes the** ``Valx`` fields used with ``Method`` = IMPORT: + + This command contains some tables and extra information which can be inspected in the original + documentation pointed above. + + .. _a-DMAT_notes: + + This command allows you to create a dense matrix. To create a sparse matrix, use the :ref:`smat` + command. :ref:`smat` is recommended for large matrices obtained from the :file:`.FULL` or + :file:`.HBMAT` file. Refer to the :ref:`hbmat` command documentation for more information about + :file:`.FULL` file contents. + + Use the :ref:`vec` command to create a vector. + + For very large matrices, use the OUTOFCORE option ( ``Method`` = ALLOC or COPY) to keep some of the + matrix on disk if there is insufficient memory. + + When importing a dense matrix from a **DMIG** file, you can define the formatting of the file using + the ``Val3`` and ``Val4`` fields. Here are a few different example of formats: + + * A LARGE field format file (using ``Val3`` = ``LARGE``): + + .. code:: apdl + + ... DMIG* KAAX 21 2 * 21 + 1-2.261491337E+08... + + * A FREE field format file with blank separators (using ``Val4`` = ``S``): + + .. code:: apdl + + ... DMIG stiff 1 2 1 2 29988. 1 6 149940. 2 2 -29988. 2 6 149940.... + + * A FREE field format file with a comma separator (using ``Val4`` = ``,``): + + .. code:: apdl + + ... DMIG,KF,22321,3,,22321,2,-5.00E+6 DMIG,KF,22320,3,,22320,2,-5.00E+6... + + **Requirement when importing matrices from a Nastran DMIG file:** To ensure that the :file:`.sub` + file is properly generated from matrices imported from Nastran **DMIG** file, the generalized + coordinates for a CMS superelement (SPOINTS in Nastran) must appear last (have + highest ID number). + + **Example Usage** + `APDL Math Examples + `_ + """ + command = f"*DMAT,{matrix},{type_},{method},{val1},{val2},{val3},{val4},{val5}" + return self.run(command, **kwargs) + + def dot( + self, + vector1: str = "", + vector2: str = "", + par_real: str = "", + par_imag: str = "", + conj: str = "", + **kwargs, + ): + r"""Computes the dot (or inner) product of two vectors. + + Mechanical APDL Command: `\*DOT `_ + + Parameters + ---------- + vector1 : str + Name of first vector; must have been previously specified by a :ref:`vec` command. + + vector2 : str + Name of second vector; must have been previously specified by a :ref:`vec` command. + + par_real : str + Parameter name that contains the result. + + par_imag : str + Parameter name that contains the imaginary part of the result (used only for complex vectors). + + conj : str + Key to specify use of the conjugate of ``Vector1`` when the vectors are complex: + + * ``TRUE`` - Use the conjugate of ``Vector1`` (default). + + * ``FALSE`` - Do not use the conjugate of ``Vector1``. + + Notes + ----- + + .. _a-DOT_notes: + + If ``Vector1`` and ``Vector2`` are complex, the complex conjugate of ``Vector1`` is used to compute + the result ( ``Par_Real``, ``Par_Imag`` ). Therefore, **\*DOT** applied to complex vectors performs + the operation: + + .. math:: + + equation not available + + Set ``Conj`` = FALSE if you do not want to use the conjugate of ``Vector1``. In this case, the + operation is: + + .. math:: + + equation not available + """ + command = f"*DOT,{vector1},{vector2},{par_real},{par_imag},{conj}" + return self.run(command, **kwargs) + + def eigen( + self, + kmatrix: str = "", + mmatrix: str = "", + cmatrix: str = "", + evals: str = "", + evects: str = "", + **kwargs, + ): + r"""Performs a modal solution with unsymmetric or damping matrices. + + Mechanical APDL Command: `\*EIGEN `_ + + Parameters + ---------- + kmatrix : str + Name of the stiffness matrix. May be a real or complex-valued matrix. + + mmatrix : str + Name of the mass matrix. + + cmatrix : str + Name of the damping matrix (used only for :ref:`modopt`,DAMP). + + evals : str + Name of the output eigenvalues vector. It will be an ``m`` -long :ref:`vec` vector of complex + values, where ``m`` is the number of eigenvalues requested ( :ref:`modopt` ). + + evects : str + Name of the output eigenvector matrix. It will be a ``n`` x ``m`` :ref:`dmat` (dense) matrix of + complex values, where ``n`` is the size of the matrix and ``m`` is the number of eigenvalues + requested ( :ref:`modopt` ). + + Notes + ----- + + .. warning:: + + This function contains specificities regarding the argument definitions. + Please refer to the `command documentation `_ + for further explanations. + + **Argument Descriptions** + + .. _a-EIGEN_argdescript: + + * ``kmatrix : str`` - Name of the stiffness matrix. May be a real or complex-valued matrix. + + * ``mmatrix : str`` - Name of the mass matrix. + + * ``cmatrix : str`` - Name of the damping matrix (used only for :ref:`modopt`,DAMP). + + * ``evals : str`` - Name of the output eigenvalues vector. It will be an ``m`` -long :ref:`vec` + vector of complex values, where ``m`` is the number of eigenvalues requested ( :ref:`modopt` ). + + * ``evects : str`` - Name of the output eigenvector matrix. It will be a ``n`` x ``m`` :ref:`dmat` + (dense) matrix of complex values, where ``n`` is the size of the matrix and ``m`` is the number of + eigenvalues requested ( :ref:`modopt` ). + + .. _a-EIGEN_notes: + + Use the command :ref:`antype`,MODAL and the :ref:`modopt` command to specify the modal solution + options. Only :ref:`modopt` ,DAMP, :ref:`modopt`,UNSYM, :ref:`modopt`,LANB, and + :ref:`modopt`,SUBSP are supported. + + :ref:`eigen` with Block Lanczos (LANB) only supports sparse matrices. Distributed-Memory Parallel + (DMP) Restriction This command is not supported in a DMP solution. + """ + command = f"*EIGEN,{kmatrix},{mmatrix},{cmatrix},{evals},{evects}" + return self.run(command, **kwargs) + + def export( + self, + matrix: str = "", + format_: str = "", + fname: str = "", + val1: str = "", + val2: str = "", + val3: str = "", + **kwargs, + ): + r"""Exports a matrix to a file in the specified format. + + Mechanical APDL Command: `\*EXPORT `_ + + Parameters + ---------- + matrix : str + Name of the matrix to export (must be a matrix previously created with :ref:`dmat` or + :ref:`smat`, or a vector previously created with :ref:`vec` ). + + format_ : str + Format of the output file: + + * ``MMF`` - Export the matrix in the Matrix Market Format. + + * ``SUB`` - Export the matrix in the :file:`SUB` file format. + + * ``HBMAT`` - Export the matrix in the Harwell-Boeing file format. + + * ``MAT`` - Export the matrix in a native format, to be re-imported using the :ref:`dmat` or + :ref:`smat` command. + + * ``EMAT`` - Export the matrix to an existing :file:`EMAT` file. + + * ``APDL`` - Export the matrix to an APDL array parameter. + + * ``PS`` - Export the matrix profile to a Postscript file. + + * ``DMIG`` - Export the matrix in the :file:`DMIG` file format. + + * ``CSV`` - Export the matrix to an ASCII CSV (comma-separated values) file. + + fname : str + Name of the file (case-sensitive, 32-character maximum), or name of the array parameter if + ``Format`` = APDL (no default). + + val1 : str + Additional input. The meaning of ``Val1`` through ``Val3`` will vary depending on the specified + ``Format``. See table below for details. + + val2 : str + Additional input. The meaning of ``Val1`` through ``Val3`` will vary depending on the specified + ``Format``. See table below for details. + + val3 : str + Additional input. The meaning of ``Val1`` through ``Val3`` will vary depending on the specified + ``Format``. See table below for details. + + Notes + ----- + + .. warning:: + + This function contains specificities regarding the argument definitions. + Please refer to the `command documentation `_ + for further explanations. + + **Argument Descriptions** + + .. _a-EXPORT_argdescript: + + * ``matrix : str`` - Name of the matrix to export (must be a matrix previously created with + :ref:`dmat` or :ref:`smat`, or a vector previously created with :ref:`vec` ). + + * ``format : str`` - Format of the output file: + + * ``MMF`` - Export the matrix in the Matrix Market Format. + + * ``SUB`` - Export the matrix in the :file:`SUB` file format. + + * ``HBMAT`` - Export the matrix in the Harwell-Boeing file format. + + * ``MAT`` - Export the matrix in a native format, to be re-imported using the :ref:`dmat` or + :ref:`smat` command. + + * ``EMAT`` - Export the matrix to an existing :file:`EMAT` file. + + * ``APDL`` - Export the matrix to an APDL array parameter. + + * ``PS`` - Export the matrix profile to a Postscript file. + + * ``DMIG`` - Export the matrix in the :file:`DMIG` file format. + + * ``CSV`` - Export the matrix to an ASCII CSV (comma-separated values) file. + + * ``fname : str`` - Name of the file (case-sensitive, 32-character maximum), or name of the array + parameter if ``Format`` = APDL (no default). + + * ``val1, val2, val3 : str`` - Additional input. The meaning of ``Val1`` through ``Val3`` will vary + depending on the specified ``Format``. See table below for details. + + This command contains some tables and extra information which can be inspected in the original + documentation pointed above. + + .. _a-EXPORT_notes: + + Only sparse matrices can be exported to Postscript files. This option plots the matrix profile as a + series of dots. + + If you want to create a :file:`.SUB` file from several matrices, you need to set ``Val3`` = WAIT for + all matrices but the last, and ``Val3`` = DONE for the last one. The export will be effective at the + last :ref:`export` command. + + To create a :file:`.SUB` file or :file:`.DMIG` file from scratch, you must supply the row + information array. (Specify this array in the ``Val2`` field for :file:`.SUB` or in the ``Val1`` + field for :file:`.DMIG`.) This must be an ``m`` x 2 array, where ``m`` is the size of the matrix. + The first column is the node number and the second column is the DOF number corresponding to each + row of the matrix. + + When exporting an HBMAT file in ASCII format, you can include the matrix type in the header of the + file by specifying the matrix type in the ``Val2`` field. The matrix type is not included in the + header if ``Val2`` is empty. If ``Val1`` = BINARY, ``Val2`` is not used. + + The :ref:`export` command is not applicable to sparse matrices initialized from :file:`.FULL` files + by means of the NOD2SOLV option on the :ref:`smat` command (that is, + :ref:`smat`,,,IMPORT,FULL,,NOD2SOLV). + + The :file:`.CSV` file format does not support sparse matrices. + """ + command = f"*EXPORT,{matrix},{format_},{fname},{val1},{val2},{val3}" + return self.run(command, **kwargs) + + def fft( + self, + type_: str = "", + inputdata: str = "", + outputdata: str = "", + dim1: str = "", + dim2: str = "", + resultformat: str = "", + **kwargs, + ): + r"""Computes the fast Fourier transformation of a specified matrix or vector. + + Mechanical APDL Command: `\*FFT `_ + + Parameters + ---------- + type_ : str + Type of FFT transformation: + + * ``FORW`` - Forward FFT computation (default). + + * ``BACK`` - Backward FFT computation. + + inputdata : str + Name of matrix or vector for which the FFT will be computed. This can be a dense matrix (created + by the :ref:`dmat` command) or a vector (created by the :ref:`vec` command). Data can be real or + complex values. There is no default value for this argument. + + outputdata : str + Name of matrix or vector where the FFT results will be stored. The type of this argument must be + consistent with ``InputData`` (see table below). There is no default value for this argument. + + This command contains some tables and extra information which can be inspected in the original + documentation pointed above. + + dim1 : str + The number of terms to consider for a vector, or the number of rows for a matrix. Defaults to + the whole input vector or all the rows of the matrix. + + dim2 : str + The number of columns to consider for a matrix. Defaults to all the columns of the matrix. + (Valid only for matrices.) + + resultformat : str + Specifies the result format: + + * ``FULL`` - Returns the full result. That is, the result matches the dimension specified on this + command ( ``DIM1``, ``DIM2`` ). + + * ``PART`` - Returns partial results. For real input data, there is a symmetry in the results of the + Fourier transform as some coefficients are conjugated. The partial format uses this symmetry to + optimize the storage of the results. (Valid only for real data.) + + Notes + ----- + + .. warning:: + + This function contains specificities regarding the argument definitions. + Please refer to the `command documentation `_ + for further explanations. + + **Argument Descriptions** + + .. _a-FFT_argdescript: + + * ``type_ : str`` - Type of FFT transformation: + + * ``FORW`` - Forward FFT computation (default). + + * ``BACK`` - Backward FFT computation. + + * ``inputdata : str`` - Name of matrix or vector for which the FFT will be computed. This can be a + dense matrix (created by the :ref:`dmat` command) or a vector (created by the :ref:`vec` command). + Data can be real or complex values. There is no default value for this argument. + + * ``outputdata : str`` - Name of matrix or vector where the FFT results will be stored. The type of + this argument must be consistent with ``InputData`` (see table below). There is no default value for + this argument. + + This command contains some tables and extra information which can be inspected in the original + documentation pointed above. + * ``dim1 : str`` - The number of terms to consider for a vector, or the number of rows for a matrix. + Defaults to the whole input vector or all the rows of the matrix. + + * ``dim2 : str`` - The number of columns to consider for a matrix. Defaults to all the columns of + the matrix. (Valid only for matrices.) + + * ``resultformat : str`` - Specifies the result format: + + * ``FULL`` - Returns the full result. That is, the result matches the dimension specified on this + command ( ``DIM1``, ``DIM2`` ). + + * ``PART`` - Returns partial results. For real input data, there is a symmetry in the results of the + Fourier transform as some coefficients are conjugated. The partial format uses this symmetry to + optimize the storage of the results. (Valid only for real data.) + + .. _a-FFT_notes: + + In the example that follows, the fast Fourier transformation is used to filter frequencies from a + noisy input signal. + + **Example Usage** + + .. _a-FFT_example: + + The fast Fourier transformation can be used to create a filter to remove noise from a noisy input + signal. + + .. figure::../../../images/_commands/gFFT1.PNG + + Input Signal + + The input signal is decomposed in the Fourier space using the :ref:`fft`, ``FORW`` command so that + the frequencies that compose the signal can be observed. + + .. figure::../../../images/_commands/gFFT2.PNG + + Amplitude Spectrum of the FFT + + The filter applies a threshold on the Fourier coefficients. Fourier coefficients of small amplitude + are the result of the noise in the input signal. Only coefficients of a large amplitude are + significant. The inversion of the :ref:`fft` command ( :ref:`fft`, ``BACK`` command) rebuilds the + signal from the remaining coefficients. + + .. figure::../../../images/_commands/gFFT3.PNG + + Signal Obtained with the Filter + + Example input demonstrating :ref:`fft` usage is provided below: + + .. code:: apdl + + /com,************************************************* + /com,* Usage example of the *FFT APDLMath command. * + /com,* Use FFT to filter a noisy sinusoidal signal. * + /com,************************************************* + /verify + /nopr + + /post26 + + /gopr + /com, *** Definition of the parameters for the signal + + pi = acos(-1) + periode1 = 2\2pi/40.0 + phase1 = 4.0 + amplitude1 = 2.5 + periode2 = 2\2pi/150.0 + phase2 = 0.0 + amplitude2 = 2.0 + periode3 = 2\2pi/140.0 + phase3 = 0.0 + amplitude3 = 1.5 + amplitudenoise = 6.0 + n = 400 !number of points in the sampling input signal + tbegin = 0.0 !start time for the signal + dt = 0.001 !time step + tend = tbegin + (n-1)\2dt + + /com, *** Definition of the parameters + + threshold = 150.0 + FFTmethod = 1 !0 = FFT giving partial results, 1 = FFT giving full results + + /com, *** Create a signal from two sinus and add noise + + *dim,signal,array,n + *dim,t,array,n + *dim,noise,array,n + *vfill,noise,rand + + omega1 = (2.0\2pi) / periode1 + omega2 = (2.0\2pi) / periode2 + omega3 = (2.0\2pi) / periode3 + + *do,ii,1,n + noisec = amplitudenoise * noise(ii) + tc = tbegin + (ii-1)\2dt + t(ii) = tc + + signal(ii) = amplitude1\2sin(omega1*tc+phase1) + amplitude2\2sin(omega2*tc+phase2) + + amplitude3\2sin(omega3*tc+phase3) + noisec *enddo /com, *** Display the input signal + *dim,signaldisp,table,n *dim,tdisp,table,n *do,ii,1,n + tdisp(ii)=t(ii) signaldisp(ii)=signal(ii) *enddo /show,png /AXLAB,X,TIME /AXLAB,Y,SIGNAL + /color,curve,BLUE /color,grbak,WHIT /color,wbak,WHIT /color,axes,BLAC /color,axlab,BLAC + /color,axnum,blac /GROPT,FILL,OFF *vplot,tdisp,signaldisp /com, *** Copy signal in an APDLMath + vector *vec,sigvec,d,alloc,n,1 *do,ii,1,n sigvec(ii) = signal(ii) *enddo /com, *** Perform a Fast + Fourier Transform *vec,VFFT,Z,ALLOC,n,1 *if,FFTmethod,eq,0,then \*FFT,FORW,sigvec,VFFT,,,PART + !partial FFT (use symmetry properties) *else \*FFT,FORW,sigvec,VFFT,,,FULL !full FFT *endif /com, *** + Determine the real part and the imaginary part of the Fourier's coefficients *vec,VFFTI,Z,COPY,VFFT + \*AXPY,,,,0.,-1.,VFFTI *vec,VI,D,COPY,VFFTI *vec,VR,D,COPY,VFFT /com, *** Compute the modulus of the + Fourier's coeff \*EXPORT,VR,APDL,fftr \*EXPORT,VI,APDL,ffti sizeVR = VR_rowDim *if,FFTmethod,eq,0,then + sizeVR = sizeVR/2 *endif *dim,ind,table,sizeVR *dim,modfft,array,sizeVR *do,ii,1,sizeVR ind(ii) = ii + modfft(ii)= sqrt( fftr(ii)\2fftr(ii) + ffti(ii)\2ffti(ii) ) *enddo /com,*** Display the Amplitude + spectrum of the FFT *dim,modfftdisp,table,sizeVR *do,ii,1,sizeVR modfftdisp(ii) = modfft(ii) *enddo + /show,png /AXLAB,X,Amplitude spectrum of the FFT /AXLAB,Y, *vplot,ind,modfftdisp fini /com, *** + Threshold on Fourier coefficients *print,VR *do,ii,1,sizeVR module = modfft(ii) + *if,module,lt,threshold,then VR(ii) = 0.0 VI(ii) = 0.0 *endif *enddo /com, *** Invert Fourier + Transform *vec,VIFT,Z,COPY,VR \*AXPY,0.0,1.0,VI,1.0,0.0,VIFT *vec,VFILTER,D,ALLOC,VR_DIM + \*FFT,BACK,VIFT,VFILTER /com, *** Display the filtered signal \*EXPORT,VFILTER,APDL,filterSignal + *dim,fsignal,table,sizeVR *do,ii,1,sizeVR fsignal(ii) = filterSignal(ii) *enddo /show,png + /AXLAB,X,TIME /AXLAB,Y,SIGNAL *vplot,tdisp,fsignal fini /com, *** Free the APDLMath objects + *free,all + """ + command = f"*FFT,{type_},{inputdata},{outputdata},{dim1},{dim2},{resultformat}" + return self.run(command, **kwargs) + + def free(self, name: str = "", val1: str = "", **kwargs): + r"""Deletes a matrix or a solver object and frees its memory allocation. + + Mechanical APDL Command: `\*FREE `_ + + Parameters + ---------- + name : str + Name of the matrix or solver object to delete. Use ``Name`` = ALL to delete all APDL Math + matrices and solver objects. Use ``Name`` = WRK to delete all APDL Math matrices and solver + objects that belong to a given workspace. + + val1 : str + If ``Name`` = WRK, ``Val1`` is the memory workspace number. + + Notes + ----- + + .. warning:: + + This function contains specificities regarding the argument definitions. + Please refer to the `command documentation `_ + for further explanations. + + **Argument Descriptions** + + .. _a-FREE_argdescript: + + * ``name : str`` - Name of the matrix or solver object to delete. Use ``Name`` = ALL to delete all + APDL Math matrices and solver objects. Use ``Name`` = WRK to delete all APDL Math matrices and + solver objects that belong to a given workspace. + + * ``val1 : str`` - If ``Name`` = WRK, ``Val1`` is the memory workspace number. + + .. _a-FREE_notes: + + A ``/CLEAR`` command will automatically delete all the current APDL Math objects. + """ + command = f"*FREE,{name},{val1}" + return self.run(command, **kwargs) + + def hprod(self, a: str = "", b: str = "", c: str = "", **kwargs): + r"""Performs a Hadamard vector product (C = A∘B). + + Mechanical APDL Command: `\*HPROD `_ + + Parameters + ---------- + a : str + Name of vector A. Must have been previously created by a :ref:`vec` command. + + b : str + Name of vector B. Must have been previously created by a :ref:`vec` command. + + c : str + Name of vector C. Must be specified (no default). + + Notes + ----- + + .. _a-HPROD_notes: + + For two vectors ``A`` and ``B`` of the same dimension ``n``, the Hadamard product (A∘B) is a vector + of the same dimension as the operands, with elements given by: + + .. math:: + + equation not available + + This command is limited to vector operands. + """ + command = f"*HPROD,{a},{b},{c}" + return self.run(command, **kwargs) + + def init( + self, + name: str = "", + method: str = "", + val1: str = "", + val2: str = "", + val3: str = "", + **kwargs, + ): + r"""Initializes a vector or matrix. + + Mechanical APDL Command: `\*INIT `_ + + Parameters + ---------- + name : str + Vector or matrix which will be initialized. This can be a vector (created by the :ref:`vec` + command), a dense matrix (created by the :ref:`dmat` command), or a sparse matrix (created by + the :ref:`smat` command). + + method : str + Initialization method to use: + + * ``ZERO`` - Fill the vector/matrix with zeros (default). + + * ``CONST`` - Fill the vector/matrix with a constant value. + + * ``RAND`` - Fill the vector/matrix with random values. + + * ``DIAG`` - Fill the ``n`` th diagonal of the matrix with a constant value. Other values are not + overwritten. For this option, ``Name`` must be a dense matrix. + + * ``ADIAG`` - Fill the ``n`` th anti-diagonal of the matrix with a constant value. Other values are + not overwritten. For this option, ``Name`` must be a dense matrix. + + * ``CONJ`` - Take the complex conjugate of the values in the vector/matrix (no change for non- + complex values). + + * ``FILTER`` - Initialize a subset of values of a vector using a filtering vector. For this option, + ``Name`` must be a vector. + + val1 : str + The name of an existing integer vector (created by :ref:`vec` ) to be used as the filter vector. + The values in this vector indicate the locations in the ``Name`` vector that are to be + initialized to ``Val2`` (real value) and ``Val3`` (imaginary value, if applicable). Location + values higher than the dimension of the original vector are ignored. + + val2 : str + The real part of the value used for initialization (default = 0). + + val3 : str + The imaginary part of the value used for initialization (default = 0); applicable only if the + ``Name`` vector contains complex values. + + Notes + ----- + + .. warning:: + + This function contains specificities regarding the argument definitions. + Please refer to the `command documentation `_ + for further explanations. + + **Argument Descriptions** + + .. _a-INIT_argdescript: + + * ``name : str`` - Vector or matrix which will be initialized. This can be a vector (created by the + :ref:`vec` command), a dense matrix (created by the :ref:`dmat` command), or a sparse matrix + (created by the :ref:`smat` command). + + * ``method : str`` - Initialization method to use: + + * ``ZERO`` - Fill the vector/matrix with zeros (default). + + * ``CONST`` - Fill the vector/matrix with a constant value. + + * ``RAND`` - Fill the vector/matrix with random values. + + * ``DIAG`` - Fill the ``n`` th diagonal of the matrix with a constant value. Other values are not + overwritten. For this option, ``Name`` must be a dense matrix. + + * ``ADIAG`` - Fill the ``n`` th anti-diagonal of the matrix with a constant value. Other values are + not overwritten. For this option, ``Name`` must be a dense matrix. + + * ``CONJ`` - Take the complex conjugate of the values in the vector/matrix (no change for non- + complex values). + + * ``FILTER`` - Initialize a subset of values of a vector using a filtering vector. For this option, + ``Name`` must be a vector. + + * ``val1, val2, val3 : str`` - Additional input. The meaning of ``Val1`` through ``Val3`` will vary + depending on the specified ``Method``. See details below. + + **The following** ``Valx`` fields are used with ``Method`` = CONST: + + * ``val1 : str`` - The real part of the constant value to use (default = 0). + + * ``val2 : str`` - The imaginary part of the constant value to use (default = 0). Required only for + a complex vector/matrix. + + **The following** ``Valx`` fields are used with ``Method`` = DIAG or ``Method`` = ADIAG: + + * ``val1 : str`` - The number of the diagonal to fill. A zero value (which is the default) indicates + the main diagonal (or main anti-diagonal). A positive value indicates an upper diagonal; a negative + value indicates a lower diagonal. + + * ``val2 : str`` - The real part of the constant value to use (default = 1). + + * ``val3 : str`` - The imaginary part of the constant value to use (default = 0). Required only for + a complex matrix. + + The following example demonstrates ``Method`` = DIAG: + + .. figure::../../../images/_commands/gINIT1.svg + + **The following** ``Valx`` fields are used with ``Method`` = FILTER: + + * ``val1 : str`` - The name of an existing integer vector (created by :ref:`vec` ) to be used as the + filter vector. The values in this vector indicate the locations in the ``Name`` vector that are to + be initialized to ``Val2`` (real value) and ``Val3`` (imaginary value, if applicable). Location + values higher than the dimension of the original vector are ignored. + + * ``val2 : str`` - The real part of the value used for initialization (default = 0). + + * ``val3 : str`` - The imaginary part of the value used for initialization (default = 0); applicable + only if the ``Name`` vector contains complex values. + + .. _a-INIT_notes: + + This command initializes a previously defined vector ( :ref:`vec` ), dense matrix ( :ref:`dmat` ), + or sparse matrix ( :ref:`smat` ). + """ + command = f"*INIT,{name},{method},{val1},{val2},{val3}" + return self.run(command, **kwargs) + + def itengine( + self, + type_: str = "", + enginename: str = "", + precondname: str = "", + matrix: str = "", + rhsvector: str = "", + solvector: str = "", + maxiter: str = "", + toler: str = "", + **kwargs, + ): + r"""Performs a solution using an iterative solver. + + Mechanical APDL Command: `\*ITENGINE `_ + + Parameters + ---------- + type_ : str + Specifies the algorithm to be used: + + * ``PCG`` - Preconditioned conjugate gradient (default). + + enginename : str + Name used to identify this iterative solver engine. Must be specified. + + precondname : str + Linear solver engine name ( :ref:`lsengine` ) identifying the factored matrix to be used as the + preconditioner. + + matrix : str + Name of the matrix to solve. + + rhsvector : str + Matrix (load vector) name. + + solvector : str + Solution vector name. If non-zero, it will be taken as the initial vector for the iterative + process. + + maxiter : str + Maximum number of iterations allowed. Default is 2 times the number of rows in the matrix. + + toler : str + Convergence tolerance. Default is 1.0E-8. + + Notes + ----- + + .. warning:: + + This function contains specificities regarding the argument definitions. + Please refer to the `command documentation `_ + for further explanations. + + **Argument Descriptions** + + .. _a-ITENGINE_argdescript: + + * ``type_ : str`` - Specifies the algorithm to be used: + + * ``PCG`` - Preconditioned conjugate gradient (default). + + * ``enginename : str`` - Name used to identify this iterative solver engine. Must be specified. + + * ``precondname : str`` - Linear solver engine name ( :ref:`lsengine` ) identifying the factored + matrix to be used as the preconditioner. + + * ``matrix : str`` - Name of the matrix to solve. + + * ``rhsvector : str`` - Matrix (load vector) name. + + * ``solvector : str`` - Solution vector name. If non-zero, it will be taken as the initial vector + for the iterative process. + + * ``maxiter : str`` - Maximum number of iterations allowed. Default is 2 times the number of rows in + the matrix. + + * ``toler : str`` - Convergence tolerance. Default is 1.0E-8. + + .. _a-ITENGINE_notes: + + This command solves Ax = b using a preconditioned conjugate gradient algorithm. It uses an existing + factored system as the preconditioner. This solution method is useful if an existing matrix has been + solved and minor changes have been made to the matrix. + """ + command = f"*ITENGINE,{type_},{enginename},{precondname},{matrix},{rhsvector},{solvector},{maxiter},{toler}" + return self.run(command, **kwargs) + + def lsbac( + self, + enginename: str = "", + rhsvector: str = "", + solvector: str = "", + transkey: str = "", + **kwargs, + ): + r"""Performs the solve (forward/backward substitution) of a factorized linear system. + + Mechanical APDL Command: `\*LSBAC `_ + + Parameters + ---------- + enginename : str + Name used to identify this engine. Must have been previously created using :ref:`lsengine` and + factorized using :ref:`lsfactor`. + + rhsvector : str + Name of vector containing the right-hand side (load) vectors as input. Must have been previously + defined as a :ref:`vec` vector or a :ref:`dmat` matrix. + + solvector : str + Name of vector that will contain the solution vectors upon completion. Must be predefined as a + :ref:`vec` vector or :ref:`dmat` matrix. + + transkey : str + Transpose key. Set ``TransKey`` = TRANS to solve the transposed linear system. If blank, + transpose will not be used. + + Notes + ----- + + .. warning:: + + This function contains specificities regarding the argument definitions. + Please refer to the `command documentation `_ + for further explanations. + + **Argument Descriptions** + + .. _a-LSBAC_argdescript: + + * ``enginename : str`` - Name used to identify this engine. Must have been previously created using + :ref:`lsengine` and factorized using :ref:`lsfactor`. + + * ``rhsvector : str`` - Name of vector containing the right-hand side (load) vectors as input. Must + have been previously defined as a :ref:`vec` vector or a :ref:`dmat` matrix. + + * ``solvector : str`` - Name of vector that will contain the solution vectors upon completion. Must + be predefined as a :ref:`vec` vector or :ref:`dmat` matrix. + + * ``transkey : str`` - Transpose key. Set ``TransKey`` = TRANS to solve the transposed linear + system. If blank, transpose will not be used. + + .. _a-LSBAC_notes: + + This command performs forward and back substitution to obtain the solution to the linear matrix + equation Ax = b (or A :sup:`T` x = b if ``TransKey`` = TRANS). The matrix engine must have been + previously defined using :ref:`lsengine`, and the matrix factored using :ref:`lsfactor`. + + You can use the :ref:`dmat`,,,COPY (or :ref:`vec`,,,COPY) command to copy the load vector to the + solution vector in order to predefine it with the appropriate size. + """ + command = f"*LSBAC,{enginename},{rhsvector},{solvector},{transkey}" + return self.run(command, **kwargs) + + def lsdump(self, enginename: str = "", filename: str = "", **kwargs): + r"""Dumps a linear solver engine to a binary File. + + Mechanical APDL Command: `\*LSDUMP `_ + + Parameters + ---------- + enginename : str + Name used to identify this engine. Must have been previously created using :ref:`lsengine` and + factorized using :ref:`lsfactor`. + + filename : str + Name of the file to create. + + Notes + ----- + + .. warning:: + + This function contains specificities regarding the argument definitions. + Please refer to the `command documentation `_ + for further explanations. + + **Argument Descriptions** + + .. _a-LSDUMP_argdescript: + + * ``enginename : str`` - Name used to identify this engine. Must have been previously created using + :ref:`lsengine` and factorized using :ref:`lsfactor`. + + * ``filename : str`` - Name of the file to create. + + .. _a-LSDUMP_notes: + + Dumps a previously factorized linear solver system to a binary file. Only LAPACK and BCS linear + solvers can be used with this feature. The Linear Solver can later be restored with the + :ref:`lsrestore` command. + + A BCS Sparse Solver can be dumped only if uses the ``INCORE`` memory option (see :ref:`bcsoption` ). + + + """ + command = f"*LSDUMP,{enginename},{filename}" + return self.run(command, **kwargs) + + def lsengine( + self, + type_: str = "", + enginename: str = "", + matrix: str = "", + option: str = "", + **kwargs, + ): + r"""Creates a linear solver engine. + + Mechanical APDL Command: `\*LSENGINE `_ + + Parameters + ---------- + type_ : str + Specifies the algorithm to be used: + + * ``DSS`` - MKL sparse linear solver. + + * ``LAPACK`` - LAPACK dense matrix linear solver (default if applied to dense matrices). + + * ``DSP`` - Distributed sparse solver (default for sparse matrices). + + enginename : str + Name used to identify this engine. Must be specified. + + matrix : str + Name of the matrix to solve. + + option : str + Option to control the memory mode of the DSS solver (used only if ``Type`` = DSS): + + * ``INCORE`` - In-core memory mode. + + * ``OUTOFCORE`` - Out-of-core memory mode. + + Notes + ----- + + .. warning:: + + This function contains specificities regarding the argument definitions. + Please refer to the `command documentation `_ + for further explanations. + + **Argument Descriptions** + + .. _a-LSENGINE_argdescript: + + * ``type_ : str`` - Specifies the algorithm to be used: + + * ``DSS`` - MKL sparse linear solver. + + * ``LAPACK`` - LAPACK dense matrix linear solver (default if applied to dense matrices). + + * ``DSP`` - Distributed sparse solver (default for sparse matrices). + + * ``enginename : str`` - Name used to identify this engine. Must be specified. + + * ``matrix : str`` - Name of the matrix to solve. + + * ``option : str`` - Option to control the memory mode of the DSS solver (used only if ``Type`` = + DSS): + + * ``INCORE`` - In-core memory mode. + + * ``OUTOFCORE`` - Out-of-core memory mode. + + .. _a-LSENGINE_notes: + + This command creates a linear solver engine. + + The DSS and DSP solvers can only be used with sparse matrices. For dense matrices, use the LAPACK + solver. + """ + command = f"*LSENGINE,{type_},{enginename},{matrix},{option}" + return self.run(command, **kwargs) + + def lsfactor(self, enginename: str = "", option: str = "", **kwargs): + r"""Performs the numerical factorization of a linear solver system. + + Mechanical APDL Command: `\*LSFACTOR `_ + + Parameters + ---------- + enginename : str + Name used to identify this engine. Must have been previously created using :ref:`lsengine`. + + option : str + Option to invert the matrix, used only with an LAPACK engine ( :ref:`lsengine`,LAPACK): + + * ``INVERT`` - Invert the matrix. + + Notes + ----- + + .. warning:: + + This function contains specificities regarding the argument definitions. + Please refer to the `command documentation `_ + for further explanations. + + **Argument Descriptions** + + .. _a-LSFACTOR_argdescript: + + * ``enginename : str`` - Name used to identify this engine. Must have been previously created using + :ref:`lsengine`. + + * ``option : str`` - Option to invert the matrix, used only with an LAPACK engine ( + :ref:`lsengine`,LAPACK): + + * ``INVERT`` - Invert the matrix. + + .. _a-LSFACTOR_notes: + + Performs the computationally intensive, memory intensive factorization of a matrix specified by + :ref:`lsengine`, using the solver engine also specified by :ref:`lsengine`. + """ + command = f"*LSFACTOR,{enginename},{option}" + return self.run(command, **kwargs) + + def lsrestore(self, enginename: str = "", filename: str = "", **kwargs): + r"""Restores a linear solver engine from a binary file. + + Mechanical APDL Command: `\*LSRESTORE `_ + + Parameters + ---------- + enginename : str + Name used to identify this engine. + + filename : str + Name of the file to read from. + + Notes + ----- + + .. warning:: + + This function contains specificities regarding the argument definitions. + Please refer to the `command documentation `_ + for further explanations. + + **Argument Descriptions** + + .. _a-LSRESTORE_argdescript: + + * ``enginename : str`` - Name used to identify this engine. + + * ``filename : str`` - Name of the file to read from. + + .. _a-LSRESTORE_notes: + + Restores a previously dumped Linear Solver (see the :ref:`lsdump` command). This Linear Solver can + be used to solve a linear system using the :ref:`lsbac` command. + + + """ + command = f"*LSRESTORE,{enginename},{filename}" + return self.run(command, **kwargs) + + def merge( + self, name1: str = "", name2: str = "", val1: str = "", val2: str = "", **kwargs + ): + r"""Merges two dense matrices or vectors into one. + + Mechanical APDL Command: `\*MERGE `_ + + Parameters + ---------- + name1 : str + Name of the matrix or vector to extend. + + name2 : str + Name of the matrix or vector to be merged into ``Name1``. + + val1 : str + Row number indicating where the new values are to be inserted into the ``Name1`` vector. + + val2 : str + Specifies how the ``Name2`` matrix or vector is copied into the ``Name1`` matrix. + + * ``COL`` - Insert the new values at the column location specified by ``Val1`` (default). + + * ``ROW`` - Insert the new values at the row location specified by ``Val1``. + + Notes + ----- + + .. warning:: + + This function contains specificities regarding the argument definitions. + Please refer to the `command documentation `_ + for further explanations. + + **Argument Descriptions** + + .. _a-MERGE_argdescript: + + * ``name1 : str`` - Name of the matrix or vector to extend. + + * ``name2 : str`` - Name of the matrix or vector to be merged into ``Name1``. + + * ``val1, val2 : str`` - Additional input. The meaning of ``Val1`` and ``Val2`` varies depending on + the entity type (matrix or vector). See details below. + + **The following** ``Val1`` and ``Val2`` fields are used if ``Name1`` refers to a dense matrix + created by the :ref:`dmat` command: + + * ``val1 : str`` - Column or row number indicating where the new values are to be inserted into the + ``Name1`` matrix. + + * ``val2 : str`` - Specifies how the ``Name2`` matrix or vector is copied into the ``Name1`` matrix. + + * ``COL`` - Insert the new values at the column location specified by ``Val1`` (default). + + * ``ROW`` - Insert the new values at the row location specified by ``Val1``. + + **The following** ``Val1`` field is used if ``Name1`` refers to a vector created by the :ref:`vec` + command: + + * ``val1 : str`` - Row number indicating where the new values are to be inserted into the ``Name1`` + vector. + + .. _a-MERGE_notes: + + :ref:`merge` can be used to add new columns or rows to a dense matrix that was created by the + :ref:`dmat` command. In this case, ``Name1`` must be the name of the dense matrix and ``Name2`` must + refer to a vector or another dense matrix. + + The following two examples demonstrate merging columns into a dense matrix. + + .. figure::../../../images/_commands/gMERGE1.png + + The following example demonstrates merging rows into a dense matrix. + + .. figure::../../../images/_commands/gMERGE3.png + + :ref:`merge` can also be used to add new rows to a vector that was created by the :ref:`vec` + command. In this case, ``Name1`` and ``Name2`` must both refer to vectors, as demonstrated in the + example below. + + .. figure::../../../images/_commands/gMERGE2.png + + In all cases, the values of the original matrix or vector are retained, and the matrix or vector is + resized to accommodate the additional rows or columns. + """ + command = f"*MERGE,{name1},{name2},{val1},{val2}" + return self.run(command, **kwargs) + + def mult( + self, + m1: str = "", + t1: str = "", + m2: str = "", + t2: str = "", + m3: str = "", + **kwargs, + ): + r"""Performs the matrix multiplication M3 = M1 :sup:`(T1)` *M2 :sup:`(T2)`. + + Mechanical APDL Command: `\*MULT `_ + + Parameters + ---------- + m1 : str + Name of matrix ``M1``. Must have been previously specified by a :ref:`dmat` or :ref:`smat` + command. + + t1 : str + Transpose key. Set ``T1`` = TRANS to use the non-conjugate transpose of ``M1``. Set ``T1`` = + CTRANS to use the conjugate transpose of ``M1``. CTRANS is only applicable when the ``M1`` + matrix is complex. If blank, transpose will not be used. + + m2 : str + Name of matrix ``M2``. Must have been previously specified by a :ref:`dmat` command. + + t2 : str + Transpose key. Set ``T2`` = TRANS to use the non-conjugate transpose of ``M2``. Set ``T2`` = + CTRANS to use the conjugate transpose of ``M2``. CTRANS is only applicable when the ``M2`` + matrix is complex. If blank, transpose will not be used. + + m3 : str + Name of resulting matrix, ``M3``. Must be specified. + + Notes + ----- + + .. warning:: + + This function contains specificities regarding the argument definitions. + Please refer to the `command documentation `_ + for further explanations. + + **Argument Descriptions** + + .. _a-MULT_argdescript: + + * ``m1 : str`` - Name of matrix ``M1``. Must have been previously specified by a :ref:`dmat` or + :ref:`smat` command. + + * ``t1 : str`` - Transpose key. Set ``T1`` = TRANS to use the non-conjugate transpose of ``M1``. Set + ``T1`` = CTRANS to use the conjugate transpose of ``M1``. CTRANS is only applicable when the ``M1`` + matrix is complex. If blank, transpose will not be used. + + * ``m2 : str`` - Name of matrix ``M2``. Must have been previously specified by a :ref:`dmat` + command. + + * ``t2 : str`` - Transpose key. Set ``T2`` = TRANS to use the non-conjugate transpose of ``M2``. Set + ``T2`` = CTRANS to use the conjugate transpose of ``M2``. CTRANS is only applicable when the ``M2`` + matrix is complex. If blank, transpose will not be used. + + * ``m3 : str`` - Name of resulting matrix, ``M3``. Must be specified. + + .. _a-MULT_notes: + + The matrices must be dimensionally consistent such that the number of columns of ``M1`` (or the + transposed matrix, if requested) is equal to the number of rows of ``M2`` (or the transposed matrix, + if requested). + + You cannot multiply two sparse matrices with this command (that is, ``M1`` and ``M2`` cannot both be + sparse). The resulting matrix, ``M3``, will always be a dense matrix, no matter what combination of + input matrices is used (dense\*sparse, sparse\*dense, or dense\*dense). + """ + command = f"*MULT,{m1},{t1},{m2},{t2},{m3}" + return self.run(command, **kwargs) + + def nrm( + self, + name: str = "", + normtype: str = "", + parr: str = "", + normalize: str = "", + **kwargs, + ): + r"""Computes the norm of the specified matrix or vector. + + Mechanical APDL Command: `\*NRM `_ + + Parameters + ---------- + name : str + Matrix or vector for which the norm will be computed. This can be a dense matrix (created by the + :ref:`dmat` command), a sparse matrix (created by the :ref:`smat` command) or a vector (created + by the :ref:`vec` command) + + normtype : str + Mathematical norm to use: + + * ``NRM2`` - L2 (Euclidian or SRSS) norm (default). + + * ``NRM1`` - L1 (absolute sum) norm (vectors and dense matrices only). + + * ``NRMINF`` - Maximum norm. + + parr : str + Parameter name that contains the result. + + normalize : str + Normalization key; to be used only for vectors created by :ref:`vec` : + + * ``YES`` - Normalize the vector such that the norm is 1.0. + + * ``NO`` - Do not normalize the vector (default). + + Notes + ----- + + .. warning:: + + This function contains specificities regarding the argument definitions. + Please refer to the `command documentation `_ + for further explanations. + + **Argument Descriptions** + + .. _a-NRM_argdescript: + + * ``name : str`` - Matrix or vector for which the norm will be computed. This can be a dense matrix + (created by the :ref:`dmat` command), a sparse matrix (created by the :ref:`smat` command) or a + vector (created by the :ref:`vec` command) + + * ``normtype : str`` - Mathematical norm to use: + + * ``NRM2`` - L2 (Euclidian or SRSS) norm (default). + + * ``NRM1`` - L1 (absolute sum) norm (vectors and dense matrices only). + + * ``NRMINF`` - Maximum norm. + + * ``parr : str`` - Parameter name that contains the result. + + * ``normalize : str`` - Normalization key; to be used only for vectors created by :ref:`vec` : + + * ``YES`` - Normalize the vector such that the norm is 1.0. + + * ``NO`` - Do not normalize the vector (default). + + .. _a-NRM_notes: + + The NRM2 option corresponds to the Euclidian or L2 norm and is applicable to either vectors or + matrices: + + :math:`equation not available`, :math:`equation not available` + + :math:`equation not available`, :math:`equation not available` where :math:`equation not + available` is the complex conjugate of :math:`equation not available` + + :math:`equation not available`, :math:`equation not available` = largest eigenvalue of + :math:`equation not available` + + The NRM1 option corresponds to the L1 norm and is applicable to vectors and dense matrices: + + :math:`equation not available` or :math:`equation not available`, :math:`equation not available` + + :math:`equation not available` or :math:`equation not available`, :math:`equation not available` + + The NRMINF option is the maximum norm and is applicable to either vectors or matrices: + + :math:`equation not available` or :math:`equation not available`, :math:`equation not available` + + :math:`equation not available` or :math:`equation not available`, :math:`equation not available` + """ + command = f"*NRM,{name},{normtype},{parr},{normalize}" + return self.run(command, **kwargs) + + def remove( + self, name: str = "", val1: str = "", val2: str = "", val3: str = "", **kwargs + ): + r"""Suppresses rows or columns of a dense matrix or a vector. + + Mechanical APDL Command: `\*REMOVE `_ + + Parameters + ---------- + name : str + Name of the matrix or vector to be revised. + + val1 : str + First value index to suppress. + + val2 : str + Last value index to suppress. + + val3 : str + Specifies what to remove: + + * ``COL`` - Remove columns of the matrix (default). + + * ``ROW`` - Remove rows of the matrix. + + Notes + ----- + + .. warning:: + + This function contains specificities regarding the argument definitions. + Please refer to the `command documentation `_ + for further explanations. + + **Argument Descriptions** + + .. _a-REMOVE_argdescript: + + * ``name : str`` - Name of the matrix or vector to be revised. + + * ``val1, val2, val3 : str`` - Additional input. The meaning of ``Val1`` to ``Val3`` varies + depending on the entity type (matrix or vector). See details below. + + **The following** ``Val1`` through ``Val3`` fields are used if ``Name`` refers to a dense matrix + created by the :ref:`dmat` command: + + * ``val1 : str`` - First row or column number to suppress. + + * ``val2 : str`` - Last row or column number to suppress. + + * ``val3 : str`` - Specifies what to remove: + + * ``COL`` - Remove columns of the matrix (default). + + * ``ROW`` - Remove rows of the matrix. + + **The following** ``Val1`` and ``Val2`` fields are used if ``Name`` refers to a vector created by + the :ref:`vec` command: + + * ``val1 : str`` - First value index to suppress. + + * ``val2 : str`` - Last value index to suppress. + + .. _a-REMOVE_notes: + + The values of the original matrix or vector specified by ``Name`` are retained. The matrix or vector + is resized to the new number of rows and columns. + """ + command = f"*REMOVE,{name},{val1},{val2},{val3}" + return self.run(command, **kwargs) + + def scal(self, name: str = "", val1: str = "", val2: str = "", **kwargs): + r"""Scales a vector or matrix by a constant. + + Mechanical APDL Command: `\*SCAL `_ + + Parameters + ---------- + name : str + Name used to identify the vector or matrix to be scaled. Must be specified. + + val1 : str + The real part of the constant to use (default = 1). + + val2 : str + The imaginary part of the constant to use (default = 0). This value is used only if the vector + or matrix specified by ``Name`` is complex. + + Notes + ----- + + .. warning:: + + This function contains specificities regarding the argument definitions. + Please refer to the `command documentation `_ + for further explanations. + + **Argument Descriptions** + + .. _a-SCAL_argdescript: + + * ``name : str`` - Name used to identify the vector or matrix to be scaled. Must be specified. + + * ``val1 : str`` - The real part of the constant to use (default = 1). + + * ``val2 : str`` - The imaginary part of the constant to use (default = 0). This value is used only + if the vector or matrix specified by ``Name`` is complex. + + .. _a-SCAL_notes: + + This command can be applied to vectors and matrices created by the :ref:`vec`, :ref:`dmat` and + :ref:`smat` commands. + """ + command = f"*SCAL,{name},{val1},{val2}" + return self.run(command, **kwargs) + + def smat( + self, + matrix: str = "", + type_: str = "", + method: str = "", + val1: str = "", + val2: str = "", + val3: str = "", + val4: str = "", + val5: str = "", + **kwargs, + ): + r"""Creates a sparse matrix. + + Mechanical APDL Command: `\*SMAT `_ + + Parameters + ---------- + matrix : str + Name used to identify the matrix. Must be specified. + + type_ : str + Matrix type: + + * ``D`` - Double precision real values (default). + + * ``Z`` - Complex double precision values. + + method : str + Method used to create the matrix: + + * ``ALLOC`` - Allocate a new matrix. + + * ``COPY`` - Copy an existing matrix. + + * ``IMPORT`` - Import the matrix from a file. + + val1 : str + Name of the matrix to copy (can be either a dense or a sparse matrix). + + val2 : str + Method used for copying the matrix: + + * ``DIAG`` - Copy only the diagonal of the matrix. ``Val3`` and ``Val4`` are ignored. + + * ``TRANS`` - Transpose the original matrix. ``Val3`` and ``Val4`` are ignored. + + * ``EXTRACT`` - Extract a submatrix based on row and column numbers specified by ``Val3`` and + ``Val4``. + + val3 : str + Name of integer vector ( :ref:`vec` ) containing row numbers. If no vector is specified, + defaults to all rows. + + val4 : str + Name of integer vector ( :ref:`vec` ) containing column numbers. If no vector is specified, + defaults to all columns. + + val5 : str + Additional input. The meaning of ``Val1`` through ``Val5`` will vary depending on the specified + ``Method``. See details below. + + Notes + ----- + + .. warning:: + + This function contains specificities regarding the argument definitions. + Please refer to the `command documentation `_ + for further explanations. + + **Argument Descriptions** + + .. _a-SMAT_argdescript: + + * ``matrix : str`` - Name used to identify the matrix. Must be specified. + + * ``type_ : str`` - Matrix type: + + * ``D`` - Double precision real values (default). + + * ``Z`` - Complex double precision values. + + * ``method : str`` - Method used to create the matrix: + + * ``ALLOC`` - Allocate a new matrix. + + * ``COPY`` - Copy an existing matrix. + + * ``IMPORT`` - Import the matrix from a file. + + * ``val1, val2, val3, val4, val5 : str`` - Additional input. The meaning of ``Val1`` through + ``Val5`` will vary depending on the specified ``Method``. See details below. + + **The following** ``Valx`` fields are used with ``Method`` = ALLOC. + + * ``val1 : str`` - Method used to create the matrix: + + * ``DIAG`` - Allocate a diagonal square matrix. ``Val2`` is used; ``Val3``, ``Val4``, and ``Val5`` are ignored. + + * ``Val2`` - Matrix size. + + * ``CSR`` - Create a square sparse matrix based on Compressed Sparse Row (CSR) format description vectors. This + format requires 3 input vectors specified as ``Val2``, ``Val3`` and ``Val4``. + + * ``Val2, Val3, Val4`` - Names of required row_ptr, col_ind and val vectors. These vectors must + be created using the :ref:`vec` command. + + row_ptr is a long integer vector (use of L instead of I as the scalar type in the :ref:`vec` call); + col_ind is an integer vector. Val can be a real of complex values vector, according to the matrix + type. + + * ``Val5`` - Specifies whether the matrix is symmetric (TRUE) or unsymmetric (FALSE). Default = + TRUE. + + **The following** ``Valx`` fields are used with ``Method`` = COPY. + + * ``val1 : str`` - Name of the matrix to copy (can be either a dense or a sparse matrix). + + * ``val2 : str`` - Method used for copying the matrix: + + * ``DIAG`` - Copy only the diagonal of the matrix. ``Val3`` and ``Val4`` are ignored. + + * ``TRANS`` - Transpose the original matrix. ``Val3`` and ``Val4`` are ignored. + + * ``EXTRACT`` - Extract a submatrix based on row and column numbers specified by ``Val3`` and + ``Val4``. + + * ``val3 : str`` - Name of integer vector ( :ref:`vec` ) containing row numbers. If no vector is + specified, defaults to all rows. + + * ``val4 : str`` - Name of integer vector ( :ref:`vec` ) containing column numbers. If no vector is + specified, defaults to all columns. + + **The following table describes the** ``Valx`` fields used with ``Method`` = IMPORT. + + This command contains some tables and extra information which can be inspected in the original + documentation pointed above. + + .. _a-SMAT_notes: + + Use the :ref:`dmat` command to create a dense matrix. + + For more information on the CSR format, see `Creating a Sparse Matrix Using the CSR Format + `_ + + For more information on the NOD2SOLV and USR2SOLV mapping vectors, see. + + For more information about :file:`.FULL` file contents, see the :ref:`hbmat` in the `Command + Reference `_. + """ + command = f"*SMAT,{matrix},{type_},{method},{val1},{val2},{val3},{val4},{val5}" + return self.run(command, **kwargs) + + def starinquire(self, obj: str = "", property_: str = "", var1: str = "", **kwargs): + r"""Retrieves properties of an existing APDL Math object. + + Mechanical APDL Command: `\*INQUIRE `_ + + Parameters + ---------- + obj : str + Name of the vector or matrix of interest. + + property_ : str + Object property to get: + + * ``DIM1`` - First dimension of a matrix, or size of a vector. + + * ``DIM2`` - Second dimension of a matrix. + + var1 : str + Name of the resulting parameter that contains the property value. + + Notes + ----- + + .. _a-INQUIRE_notes: + + The following example demonstrates using :ref:`starinquire` to get the number of rows and columns of + an existing matrix. + + .. code:: apdl + + *SMAT,K,D,IMPORT,FULL,file.full,STIFF ! Import the stiffness matrix from an existing FULL file + *INQUIRE,K,DIM1,NROW ! Get the first dimension of the stiffness matrix + *INQUIRE,K,DIM2,NCOL ! Get the second dimension of the stiffness matrix + /COM, K matrix size: %NROW% x %NCOL% + """ + command = f"*INQUIRE,{obj},{property_},{var1}" + return self.run(command, **kwargs) + + def starprint(self, matrix: str = "", fname: str = "", **kwargs): + r"""Prints the matrix values to a file. + + Mechanical APDL Command: `\*PRINT `_ + + Parameters + ---------- + matrix : str + Name of matrix or vector to print. Must be specified. + + fname : str + File name (case-sensitive, 32-character maximum). If blank, matrix is written to the output + file. + + Notes + ----- + + .. warning:: + + This function contains specificities regarding the argument definitions. + Please refer to the `command documentation `_ + for further explanations. + + **Argument Descriptions** + + .. _a-PRINT_argdescript: + + * ``matrix : str`` - Name of matrix or vector to print. Must be specified. + + * ``fname : str`` - File name (case-sensitive, 32-character maximum). If blank, matrix is written to + the output file. + + .. _a-PRINT_notes: + + The matrix may be a dense matrix ( :ref:`dmat` ), a sparse matrix ( :ref:`smat` ), or a vector ( + :ref:`vec` ). Only the non-zero entries of the matrix are printed. + """ + command = f"*PRINT,{matrix},{fname}" + return self.run(command, **kwargs) + + def starrename(self, oldname: str = "", newname: str = "", **kwargs): + r"""Renames an existing vector or matrix. + + Mechanical APDL Command: `\*RENAME `_ + + Parameters + ---------- + oldname : str + Name of the existing vector or matrix to be renamed. + + newname : str + New name for the vector or matrix. + + Notes + ----- + + .. warning:: + + This function contains specificities regarding the argument definitions. + Please refer to the `command documentation `_ + for further explanations. + + **Argument Descriptions** + + .. _a-RENAME_argdescript: + + * ``oldname : str`` - Name of the existing vector or matrix to be renamed. + + * ``newname : str`` - New name for the vector or matrix. + + .. _a-RENAME_notes: + + The :ref:`starrename` command is used to rename `APDL Math + `_ objects. + """ + command = f"*RENAME,{oldname},{newname}" + return self.run(command, **kwargs) + + def starsort( + self, + name: str = "", + sorttype: str = "", + val1: str = "", + val2: str = "", + **kwargs, + ): + r"""Sorts the values of the specified vector. + + Mechanical APDL Command: `\*SORT `_ + + Parameters + ---------- + name : str + Name of the vector to be sorted. This vector can contain real or complex values. + + sorttype : str + Criteria used to sort the values: + + * ``VALUE`` - Values are sorted based on their real value (default). + + * ``ABS`` - Values are sorted based on their absolute value. + + * ``PERM`` - Values are sorted based on the input permutation vector ( ``Val1`` ). + + val1 : str + Name of the permutation vector used to sort the values. This must be a vector of integer values + that was created with the :ref:`vec` command. The size of this permutation vector must be + identical to the size of the vector to be sorted. + + This permutation vector is required when using ``Method`` = PERM. + + val2 : str + Order of the sort operation: + + * ``0`` - Increasing order (default). + + * ``1`` - Decreasing order. + + Notes + ----- + + .. warning:: + + This function contains specificities regarding the argument definitions. + Please refer to the `command documentation `_ + for further explanations. + + **Argument Descriptions** + + .. _a-SORT_argdescript: + + * ``name : str`` - Name of the vector to be sorted. This vector can contain real or complex values. + + * ``sorttype : str`` - Criteria used to sort the values: + + * ``VALUE`` - Values are sorted based on their real value (default). + + * ``ABS`` - Values are sorted based on their absolute value. + + * ``PERM`` - Values are sorted based on the input permutation vector ( ``Val1`` ). + + * ``val1, val2 : str`` - Additional input. The meaning of ``Val1``, ``Val2`` varies depending on the + specified ``SortType``. See below for details. + + **The following** ``Valx`` fields are used with ``SortType`` = VALUE or ABS: + + * ``val1 : str`` - Name of the vector in which permutation values will be saved (optional). This + should be an empty vector of type integer that was created with the :ref:`vec` command. The size of + this permutation vector must be identical to the size of the vector to be sorted. After the sort, + this vector contains the permutation used to sort the values. + + * ``val2 : str`` - Order of the sort operation: + + * ``0`` - Increasing order (default). + + * ``1`` - Decreasing order. + + **The following** ``Valx`` fields are used with ``Method`` = PERM: + + * ``val1 : str`` - Name of the permutation vector used to sort the values. This must be a vector of + integer values that was created with the :ref:`vec` command. The size of this permutation vector + must be identical to the size of the vector to be sorted. + + This permutation vector is required when using ``Method`` = PERM. + + .. _a-SORT_notes: + + The examples below demonstrate using :ref:`starsort` to sort the values of an input vector. + + The following input: + + .. code:: apdl + + *VEC,V,I,ALLOC,5 + V(1)=5,-3,2,0,-1 + *SORT,V,VALUE + *PRINT,V + + generates this output: + + .. code:: apdl + + -3 -1 0 2 5 + + To reverse the order, this input: + + .. code:: apdl + + *SORT,V,VALUE,,1 + *PRINT,V + + generates this output: + + .. code:: apdl + + 5 2 0 -1 -3 + """ + command = f"*SORT,{name},{sorttype},{val1},{val2}" + return self.run(command, **kwargs) + + def vec( + self, + vector: str = "", + type_: str = "", + method: str = "", + val1: str = "", + val2: str = "", + val3: str = "", + val4: str = "", + **kwargs, + ): + r"""Creates a vector. + + Mechanical APDL Command: `\*VEC `_ + + Parameters + ---------- + vector : str + Name used to identify the vector. Must be specified. + + type_ : str + Vector type: + + * ``D`` - Double precision real values (default). + + * ``Z`` - Complex double precision values. + + * ``I`` - Integer values. + + method : str + Method used to create the vector: + + * ``ALLOC`` - Allocate space for a vector (default). + + * ``RESIZE`` - Resize an existing vector to a new length. Values are kept from the original vector. + If the length specified by ``Val1`` is greater than the original vector length, the additional rows + are assigned a value of zero. + + * ``COPY`` - Copy an existing vector. + + * ``IMPORT`` - Import the vector from a file. + + * ``LINK`` - Link to a column of an existing dense :ref:`dmat` matrix and use it in subsequent + vector calculations. Any changes to the vector are also made to the corresponding matrix column + (memory is shared). + + val1 : str + Name of the :ref:`dmat` matrix. + + val2 : str + Column number of the matrix to link to. + + val3 : str + Additional input. The meaning of ``Val1`` through ``Val5`` will vary depending on the specified + ``Method``. See details below. + + val4 : str + Additional input. The meaning of ``Val1`` through ``Val5`` will vary depending on the specified + ``Method``. See details below. + + Notes + ----- + + .. warning:: + + This function contains specificities regarding the argument definitions. + Please refer to the `command documentation `_ + for further explanations. + + **Argument Descriptions** + + .. _a-VEC_argdescript: + + * ``vector : str`` - Name used to identify the vector. Must be specified. + + * ``type_ : str`` - Vector type: + + * ``D`` - Double precision real values (default). + + * ``Z`` - Complex double precision values. + + * ``I`` - Integer values. + + * ``method : str`` - Method used to create the vector: + + * ``ALLOC`` - Allocate space for a vector (default). + + * ``RESIZE`` - Resize an existing vector to a new length. Values are kept from the original vector. + If the length specified by ``Val1`` is greater than the original vector length, the additional rows + are assigned a value of zero. + + * ``COPY`` - Copy an existing vector. + + * ``IMPORT`` - Import the vector from a file. + + * ``LINK`` - Link to a column of an existing dense :ref:`dmat` matrix and use it in subsequent + vector calculations. Any changes to the vector are also made to the corresponding matrix column + (memory is shared). + + * ``val1, val2, val3, val4, val5 : str`` - Additional input. The meaning of ``Val1`` through + ``Val5`` will vary depending on the specified ``Method``. See details below. + + **The following** ``Valx`` field is used with ``Method`` = ALLOC or ``Method`` = RESIZE: + + * ``val1 : str`` - Number of rows in the vector. + + **The following** ``Valx`` field is used with ``Method`` = COPY: + + * ``val1 : str`` - Name of the vector to copy. + + * ``val2 : str`` - Optional argument to specify either the real or the imaginary part of the values + to be copied. This + option only applies when copying a complex value vector to a real value vector. + + * ``REAL`` - Copy the real part of the vector to the output vector. + + * ``IMAG`` - Copy the imaginary part of the vector to the output vector. + + **The following table describes the** ``Valx`` fields used with ``Method`` = IMPORT. + + This command contains some tables and extra information which can be inspected in the original + documentation pointed above. + + **The following** ``Valx`` fields are used with ``Method`` = LINK: + + * ``val1 : str`` - Name of the :ref:`dmat` matrix. + + * ``val2 : str`` - Column number of the matrix to link to. + + .. _a-VEC_notes: + + Use the :ref:`dmat` command to create a matrix. + + For more information on the BACK and FORWARD nodal mapping vectors, see in the `Ansys Parametric + Design Language Guide + `_. + """ + command = f"*VEC,{vector},{type_},{method},{val1},{val2},{val3},{val4}" + return self.run(command, **kwargs) + + def wrk(self, num: str = "", **kwargs): + r"""Sets the active workspace number. + + Mechanical APDL Command: `\*WRK `_ + + Parameters + ---------- + num : str + Number of the active memory workspace for APDLMath vector and matrices. All the following + APDLMath vectors and matrices will belong to this memory workspace, until the next call to the + :ref:`wrk` command. By default, all the APDLMath objects belong to workspace number 1. + + Notes + ----- + + .. warning:: + + This function contains specificities regarding the argument definitions. + Please refer to the `command documentation `_ + for further explanations. + + **Argument Descriptions** + + .. _a-WRK_argdescript: + + * ``num : str`` - Number of the active memory workspace for APDLMath vector and matrices. All the + following APDLMath vectors and matrices will belong to this memory workspace, until the next call to + the :ref:`wrk` command. By default, all the APDLMath objects belong to workspace number 1. + + .. _a-WRK_notes: + + This feature enables you to associate a set of vector and matrices in a given memory workspace, so + that you can easily manage the free step: + + .. code:: apdl + + *VEC,V,D,ALLOC,5 ! V belongs to the default Workspace 1 + + \*WRK,2 ! Set the active workspace as the number 2 + + \*VEC,W,D,IMPORT,FULL,file.full,RHS ! W belongs to the Workspace 2 + \*SMAT,K,D,IMPORT,FULL,file.full,STIFF ! K belongs to the Workspace 2 + \*DMAT,M,ALLOC,10,10 ! M belongs to the Workspace 2 + ... + \*FREE,WRK,2 ! W, K and M are deleted, but not V + + \*PRINT,V + + This feature can be useful to free all the temporary APDLMath variables inside a MACRO in one call. + """ + command = f"*WRK,{num}" + return self.run(command, **kwargs) diff --git a/src/ansys/mapdl/core/_commands/apdl/parameter_definition.py b/src/ansys/mapdl/core/_commands/apdl/parameter_definition.py index 37e27f1f203..c46b22225b4 100644 --- a/src/ansys/mapdl/core/_commands/apdl/parameter_definition.py +++ b/src/ansys/mapdl/core/_commands/apdl/parameter_definition.py @@ -22,825 +22,4751 @@ class ParameterDefinition: - def afun(self, lab="", **kwargs): - """Specifies units for angular functions in parameter expressions. - APDL Command: ``*AFUN`` + def afun(self, lab: str = "", **kwargs): + r"""Specifies units for angular functions in parameter expressions. + + Mechanical APDL Command: `\*AFUN `_ Parameters ---------- - lab + lab : str Specifies the units to be used: - Use radians for input and output of parameter angular functions (default). - Use degrees for input and output of parameter angular functions. + * ``RAD`` - Use radians for input and output of parameter angular functions (default). + + * ``DEG`` - Use degrees for input and output of parameter angular functions. + + * ``STAT`` - Show current setting (DEG or RAD) for this command. + + Notes + ----- + + .. warning:: + + This function contains specificities regarding the argument definitions. + Please refer to the `command documentation `_ + for further explanations. + + **Argument Descriptions** + + .. _a-AFUN_argdescript: + + * ``lab : str`` - Specifies the units to be used: + + * ``RAD`` - Use radians for input and output of parameter angular functions (default). + + * ``DEG`` - Use degrees for input and output of parameter angular functions. + + * ``STAT`` - Show current setting (DEG or RAD) for this command. + + .. _a-AFUN_default: + + Use radians for input or output of parameter angular functions. + + .. _a-AFUN_notes: + + Only the SIN, COS, TAN, ASIN, ACOS, ATAN, ATAN2, ANGLEK, and ANGLEN functions ( :ref:`starset`, + :ref:`vfun` ) are affected by this command. + """ + command = f"*AFUN,{lab}" + return self.run(command, **kwargs) + + def dim( + self, + par: str = "", + type_: str = "", + imax: str = "", + jmax: str = "", + kmax: str = "", + var1: str = "", + var2: str = "", + var3: str = "", + csysid: str = "", + **kwargs, + ): + r"""Defines an array parameter and its dimensions. + + Mechanical APDL Command: `\*DIM `_ + + Parameters + ---------- + par : str + Name of parameter to be dimensioned. See :ref:`starset` for name restrictions. + + type_ : str + Array type: + + * ``ARRAY`` - Arrays are similar to standard FORTRAN arrays (indices are integers) (default). Index + numbers for the rows, columns, and planes are sequential values beginning with one. Used for 1-, 2-, + or 3D arrays. + + * ``ARR4`` - Same as ARRAY, but used to specify 4-D arrays. + + * ``ARR5`` - Same as ARRAY, but used to specify 5-D arrays. + + * ``CHAR`` - Array entries are character strings (up to 8 characters each). Index numbers for rows, + columns, and planes are sequential values beginning with one. + + * ``TABLE`` - Array indices are real (non-integer) numbers which must be defined when filling the + table. Index numbers for the rows and columns are stored in the zero column and row "array elements" + and are initially assigned a near-zero value. Index numbers must be in ascending order and are used + only for retrieving an array element. When retrieving an array element with a real index that does + not match a specified index, linear interpolation is done among the nearest indices and the + corresponding array element values ( :ref:`starset` ). Used for 1-, 2-, or 3D tables. + + * ``TAB4`` - Same as TABLE, but used to specify 4-D tables. + + * ``TAB5`` - Same as TABLE, but used to specify 5-D tables. + + * ``STRING`` - Array entries are character strings (up to IMAX each). Index numbers for columns and + planes are sequential values beginning with 1. Row index is character position in string. + + imax : str + Extent of first dimension (row). (For ``Type`` = STRING, ``IMAX`` is rounded up to the next + multiple of eight and has a limit of 248). Default = 1. + + jmax : str + Extent of second dimension (column). Default = 1. + + kmax : str + Extent of third dimension (plane). Default = 1. + + var1 : str + Variable name corresponding to the first dimension (row) for ``Type`` = TABLE, TAB4, or TAB5. + Default = Row. + + var2 : str + Variable name corresponding to the second dimension (column) for ``Type`` = TABLE, TAB4, or + TAB5. Default = Column. + + var3 : str + Variable name corresponding to the third dimension (plane) for ``Type`` = TABLE, TAB4, TAB5. + Default = Plane. + + csysid : str + An integer corresponding to the coordinate system ID number. Default = 0 (global Cartesian). + + Notes + ----- + + .. warning:: + + This function contains specificities regarding the argument definitions. + Please refer to the `command documentation `_ + for further explanations. + + **Argument Descriptions** + + .. _a-DIM_argdescript: + + * ``par : str`` - Name of parameter to be dimensioned. See :ref:`starset` for name restrictions. + + * ``type_ : str`` - Array type: + + * ``ARRAY`` - Arrays are similar to standard FORTRAN arrays (indices are integers) (default). Index + numbers for the rows, columns, and planes are sequential values beginning with one. Used for 1-, 2-, + or 3D arrays. + + * ``ARR4`` - Same as ARRAY, but used to specify 4-D arrays. + + * ``ARR5`` - Same as ARRAY, but used to specify 5-D arrays. + + * ``CHAR`` - Array entries are character strings (up to 8 characters each). Index numbers for rows, + columns, and planes are sequential values beginning with one. + + * ``TABLE`` - Array indices are real (non-integer) numbers which must be defined when filling the + table. Index numbers for the rows and columns are stored in the zero column and row "array elements" + and are initially assigned a near-zero value. Index numbers must be in ascending order and are used + only for retrieving an array element. When retrieving an array element with a real index that does + not match a specified index, linear interpolation is done among the nearest indices and the + corresponding array element values ( :ref:`starset` ). Used for 1-, 2-, or 3D tables. + + * ``TAB4`` - Same as TABLE, but used to specify 4-D tables. + + * ``TAB5`` - Same as TABLE, but used to specify 5-D tables. + + * ``STRING`` - Array entries are character strings (up to IMAX each). Index numbers for columns and + planes are sequential values beginning with 1. Row index is character position in string. + + * ``imax : str`` - Extent of first dimension (row). (For ``Type`` = STRING, ``IMAX`` is rounded up + to the next multiple of eight and has a limit of 248). Default = 1. + + * ``jmax : str`` - Extent of second dimension (column). Default = 1. + + * ``kmax : str`` - Extent of third dimension (plane). Default = 1. + + * ``var1 : str`` - Variable name corresponding to the first dimension (row) for ``Type`` = TABLE, + TAB4, or TAB5. Default = Row. + + * ``var2 : str`` - Variable name corresponding to the second dimension (column) for ``Type`` = + TABLE, TAB4, or TAB5. Default = Column. + + * ``var3 : str`` - Variable name corresponding to the third dimension (plane) for ``Type`` = TABLE, + TAB4, TAB5. Default = Plane. + + * ``csysid : str`` - An integer corresponding to the coordinate system ID number. Default = 0 + (global Cartesian). + + .. _a-DIM_notes: + + Up to three dimensions (row, column, and plane) may be defined using ARRAY and TABLE. Use ARR4, + ARR5, TAB4, and TAB5 to define up to five dimensions (row, column, plane, book, and shelf). An index + number is associated with each row, column, and plane. For array and table type parameters, element + values are initialized to zero. For character and string parameters, element values are initialized + to (blank). A defined parameter must be deleted ( :ref:`starset` ) before its dimensions can be + changed. Scalar (single valued) parameters should not be dimensioned. :ref:`dim`,A,,3 defines a + vector array with elements A(1), A(2), and A(3). :ref:`dim`,B,,2,3 defines a 2x3 array with elements + B(1,1), B(2,1), B(1,2), B(2,2), B(1,3), and B(2,3). Use :ref:`starstatus`, ``Par`` to display + elements of array ``Par``. You can write formatted data files (tabular formatting) from data held in + arrays through the :ref:`vwrite` command. + + If you use table parameters to define boundary conditions, then ``Var1``, ``Var2``, and/or ``Var3`` + can either specify a primary variable (listed in :ref:`a-DIM_tab_1` ) or can be an independent + parameter. If specifying an independent parameter, then you must define an additional table for the + independent parameter. The additional table must have the same name as the independent parameter and + may be a function of one or more primary variables or another independent parameter. All independent + parameters must relate to a primary variable. + + Tabular load arrays can be defined in both global Cartesian (default), cylindrical, spherical, or + local (see below) coordinate systems by specifying ``CSYSID``, as defined in :ref:`local`. + Coordinate system ``CSYSID`` must exist prior to issuing the :ref:`dim` command. + + **The following constraints apply when specifying a local coordinate system for your tabular + loads:** + + * Only Cartesian, cylindrical and spherical coordinate systems are supported + + * Angle values for Y in cylindrical or spherical coordinate systems must be input in degrees and + must be positive values between 0 and 360 degrees (0 :math:`equation not available` Y + :math:`equation not available` 360) + + * Angle values for Z in spherical coordinate system must be input in degrees and must be positive + values between -90 and +90 ( -90 :math:`equation not available` Z :math:`equation not available` + 90) + + If specifying a 4- or 5-D array or table, four additional fields ( ``LMAX``, ``MMAX``, ``Var4``, and + ``Var5`` ) are available. Thus, for a 4-D table, the command syntax would be: + + .. code:: apdl + + *DIM,Par,Type,IMAX,JMAX,KMAX,LMAX,Var1,Var2,Var3,Var4,CSYSID + + For a 5-D table, the command syntax is: + + .. code:: apdl + + *DIM,Par,Type,IMAX,JMAX,KMAX,LMAX,MMAX,Var1,Var2,Var3,Var4,Var5,CSYSID + + You cannot create or edit 4- or 5-D arrays or tables via the GUI. + + For more information, see `Array Parameters + `_ + + .. _a-DIM_tab_1: + + \*DIM - Primary Variables + ************************* + + .. flat-table:: + :header-rows: 1 + + * - Primary Variable + - Label for ``Var1, Var2, Var3, Var4, Var5`` + * - Time + - TIME + * - Frequency + - FREQ + * - X-coordinate location + - X + * - Y-coordinate location + - Y + * - Z-coordinate location + - Z + * - Temperature + - TEMP + * - Velocity + - VELOCITY + * - Pressure + - PRESSURE [ :ref:`cmddimvarnote1` ] + * - Geometric gap/penetration + - GAP + * - Cyclic sector number + - SECTOR + * - Amplitude of the rotational velocity vector + - OMEGS + * - Eccentricity + - ECCENT + * - Phase shift + - THETA + * - Element number + - ELEM + * - Node number + - NODE + * - Concentration + - CONC + + + .. _cmddimvarnote1: + + Specify PRESSURE as the independent variable (not PRES). + + The X, Y, and Z coordinate locations listed above are valid in global Cartesian, or local + (Cartesian, cylindrical and spherical) coordinate systems. The VELOCITY label is applicable only to + the calculated fluid velocity in element ``FLUID116``. + + When using PRESSURE as a primary variable, the underlying element must have the pressure DOF + associated with it, or it must be a supported contact element. + + The gap/penetration label (GAP) is only used for defining certain contact element real constants. + + The frequency label (FREQ) is valid for harmonic analyses only. + + The node and element labels (NODE and ELEM) allow you to use node and element numbers as primary + variables, and their axis values should be integers. + + The OMEGS, ECCENT, and THETA primary variables only apply to the ``COMBI214`` element. The amplitude + of the rotational velocity (OMEGS) is an absolute value, so only positive values of OMEGS are valid. + The eccentricity (ECCENT) and phase shift (THETA) labels are only valid for nonlinear analyses. + + If you use table parameters to define boundary conditions, the table names ( ``Par`` ) must not + exceed 32 characters. + + In thermal analyses, if you apply tabular loads as a function of temperature but the rest of the + model is linear (for example, includes no temperature-dependent material properties or radiation ), + you should turn on Newton-Raphson iterations ( :ref:`nropt`,FULL) to evaluate the temperature- + dependent tabular boundary conditions correctly. + + This command is valid in any processor. + """ + command = ( + f"*DIM,{par},{type_},{imax},{jmax},{kmax},{var1},{var2},{var3},{csysid}" + ) + return self.run(command, **kwargs) + + def get( + self, + par: str = "", + entity: str = "", + entnum: str = "", + item1: str = "", + it1num: str = "", + item2: str = "", + it2num: str = "", + **kwargs, + ): + r"""Retrieves a value and stores it as a scalar parameter or part of an array parameter. + + Mechanical APDL Command: `\*GET `_ + + Parameters + ---------- + par : str + The name of the resulting parameter. See :ref:`starset` for name restrictions. + + entity : str + Entity keyword. Valid keywords are NODE, ELEM, KP, LINE, AREA, VOLU, etc., as shown for + ``Entity`` = in the tables below. + + entnum : str + The number or label for the entity (as shown for ``ENTNUM`` = in the tables below). In some + cases, a zero (or blank) ``ENTNUM`` represents all entities of the set. + + item1 : str + The name of a particular item for the given entity. Valid items are as shown in the ``Item1`` + columns of the tables below. + + it1num : str + The number (or label) for the specified ``Item1`` (if any). Valid ``IT1NUM`` values are as shown + in the ``IT1NUM`` columns of the tables below. Some ``Item1`` labels do not require an + ``IT1NUM`` value. + + item2 : str + A second set of item labels and numbers to further qualify the item for which data are to be + retrieved. Most items do not require this level of information. + + it2num : str + A second set of item labels and numbers to further qualify the item for which data are to be + retrieved. Most items do not require this level of information. + + Notes + ----- + + .. _GET_notes: + + :ref:`get` retrieves a value for a specified item and stores the value as a scalar parameter, or as + a value in a user-named array parameter. An item is identified by various keyword, label, and number + combinations. Usage is similar to the :ref:`starset` command except that the parameter values are + retrieved from previously input or calculated results. + + Example: :ref:`get` Usage + + :ref:`get`,A,ELEM,5,CENT,X returns the centroid x location of element 5 and stores the result as + parameter A. + + :ref:`get` command operations, and corresponding get functions, return values in the active + coordinate system ( :ref:`csys` for input data or :ref:`rsys` for results data) unless stated + otherwise. + + A get function is an alternative in-line function that can be used instead of the :ref:`get` command + to retrieve a value. For more information, see. + + Both :ref:`get` and :ref:`starvget` retrieve information from the active data stored in memory. The + database is often the source, and sometimes the information is retrieved from common memory blocks + that the program uses to manipulate information. Although POST1 and POST26 operations use a + :file:`\*.rst` file, :ref:`get` data is accessed from the database or from the common blocks. Get + operations do not access the :file:`\*.rst` file directly. For repeated gets of sequential items, + such as from a series of elements, see the :ref:`starvget` command. + + Most items are stored in the database after they are calculated and are available anytime + thereafter. Items are grouped according to where they are usually first defined or calculated. + Preprocessing data will often not reflect the calculated values generated from section data. Do not + use :ref:`get` to obtain data from elements that use calculated section data, such as beams or + shells. + + When the value retrieved by :ref:`get` is a component name, the resulting character parameter is + limited to 32 characters. If the component name is longer than 32 characters, the remaining + characters are ignored. + + Most of the general items listed below are available from all modules. Each of the sections for + accessing :ref:`get` parameters are shown in the following order: + + * :ref:`gettabgen` + + * :ref:`gettabprep` + + * :ref:`gettabsol` + + * :ref:`gettabpost` + + The :ref:`get` command is valid in any processor. + + **General Items** + + .. _gettabgen: + + \*GET General Entity Items + ^^^^^^^^^^^^^^^^^^^^^^^^^^ + + * :ref:`get_gen_act` + + * :ref:`get_gen_cmd` + + * :ref:`get_gen_comp` + + * :ref:`get_gen_graph` + + * :ref:`get_gen_parm` + + * :ref:`get_gen_tbtype` + + .. _get_gen_act: + + \*GET General Items, Entity = ACTIVE + ************************************ + + .. flat-table:: ``Entity`` = ACTIVE, ``ENTNUM`` = 0 (or blank) + :header-rows: 2 + + * - :ref:`get`, Par, ACTIVE, 0, ``Item1``, ``IT1NUM``, ``Item2``, ``IT2NUM`` + * - Item1 + - IT1NUM + - Description + * - INT + - + - Current interactive key: 0=off, 2=on. + * - IMME + - + - Current immediate key: 0=off, 1=on. + * - MENU + - + - Current menu key: 0=off, 1=on. + * - PRKEY + - + - Printout suppression status: 0= :ref:`nopr`, 1= :ref:`gopr` or :ref:`slashgo` + * - UNITS + - + - Units specified by :ref:`units` command: 0 = USER, 1 = SI, 2 = CGS, 3 = BFT, 4 = BIN, 5 = MKS, 6 = MPA, 7 = uMKS. + * - ROUT + - + - Current routine: 0 = Begin level, 17 = PREP7, 21 = SOLUTION, 31 = POST1, 36 = POST26, 52 = AUX2, 53 = AUX3, 62 = AUX12, 65 = AUX15. + * - TIME + - WALL,CPU + - Current wall clock or CPU time. Current wall clock will continue to accumulate during a run and is not reset to zero at midnight. + * - DBASE + - LDATE + - Date of first modification of any database quantity required for POST1 operation. The parameter returned is ``Par`` = YEAR\*10000 + MONTH\*100 + DAY. + * - DBASE + - LTIME + - Time of last modification of any database quantity required for POST1 operation. The parameter returned is ``Par`` = HOURS\*10000 + MINUTES\*100 + SECONDS. + * - REV + - + - Minor release revision number (5.6, 5.7, 6.0 etc.). Letter notation (for example, 5.0A) is not included. + * - TITLE + - 0,1,2,3,4 + - **Item2:** START **IT2NUM:** ``N`` Current title string of the main title ( ``IT1NUM`` =0 or blank) or subtitle 1, 2, 3, or 4 ( ``IT1NUM`` =1,2,3, or 4). A character parameter of up to 8 characters, starting at position ``N``, is returned. + * - JOBNAM + - + - **Item2:** START **IT2NUM:** ``N`` Current Jobname. A character parameter of up to 8 characters, starting at position ``N``, is returned. Use :ref:`dim` and ``*DO`` to get all 32 characters. + * - PLATFORM + - + - The current platform. + * - NPROC + - CURR, MAX, MAXP + - The number of processors being used for the current session, or the maximum total number of processors (physical and virtual) available on the machine, or the maximum number of physical processors available on the machine. This only applies to shared-memory parallelism. + * - NUMCPU + - + - Number of distributed processes being used (distributed-memory parallel solution). + + + .. _get_gen_cmd: + + \*GET General Items, Entity = CMD + ********************************* + + .. flat-table:: ``Entity`` = CMD, ``ENTNUM`` = 0 (or blank) The following items are valid for all commands except star (\2) commands and non-graphics slash (/) commands. + :header-rows: 2 + + * - :ref:`get`, ``Par``, CMD, 0, ``Item1``, ``IT1NUM``, ``Item2``, ``IT2NUM`` + * - Item1 + - IT1NUM + - Description + * - STAT + - + - Status of previous command: 0=found, 1=not found (unknown). + * - NARGS + - + - Field number of last nonblank field on the previous command. + * - FIELD + - 2,3... ``N`` + - Numerical value of the ``N`` th field on the previous command. Field 1 is the command name (not available) + + + .. _get_gen_comp: + + \*GET General Items, Entity = COMP + ********************************** + + .. flat-table:: ``Entity`` = COMP, ``ENTNUM`` = 0 (or blank) + :header-rows: 2 + + * - :ref:`get`, ``Par``, COMP, 0, ``Item1``, ``IT1NUM``, ``Item2``, ``IT2NUM`` + * - Item1 + - IT1NUM + - Description + * - NCOMP + - + - Total number of components and assemblies currently defined. + + + .. _get_gen_graph: + + \*GET General Items, Entity = GRAPH + *********************************** + + .. flat-table:: ``Entity`` =GRAPH, ``ENTNUM`` = N (window number) + :header-rows: 2 + + * - :ref:`get`, ``Par``, GRAPH, N, ``Item1``, ``IT1NUM``, ``Item2``, ``IT2NUM`` + * - Item1 + - IT1NUM + - Description + * - ACTIVE + - + - :ref:`window` status: 0=off, 1=on. + * - ANGLE + - + - :ref:`angle` ``THETA`` angle. + * - CONTOUR + - ``Name`` + - :ref:`contour` value for ``Name``, where ``Name`` = VMIN, VINC, or NCONT. + * - DIST + - + - :ref:`dist` ``DVAL`` value. + * - DSCALE + - DMULT + - :ref:`slashdscale` ``DMULT`` value. + * - EDGE + - + - :ref:`edge` ``KEY`` value. + * - FOCUS + - X, Y, Z + - :ref:`focus` ``CIN``, ``YF``, or ``ZF`` value. + * - GLINE + - + - :ref:`gline` ``STYLE`` value. + * - MODE + - + - :ref:`user` or :ref:`auto` setting: 0=user, 1=auto. + * - NORMAL + - + - :ref:`normal` ``KEY`` value. + * - RANGE + - XMIN, XMAX, YMIN, YMAX + - :ref:`window` ``XMIN``, ``XMAX``, ``YMIN``, or ``YMAX`` screen coordinates. + * - RATIO + - X, Y + - :ref:`ratio` ``RATOX`` or ``RATOY`` value. + * - SSCALE + - SMULT + - :ref:`sscale` ``SMULT`` value. + * - TYPE + - + - :ref:`slashtype` ``Type`` value. + * - VCONE + - ANGLE + - :ref:`vcone` ``PHI`` angle. + * - VIEW + - X, Y, Z + - :ref:`view` ``XV``, ``YV``, or ``ZV`` value. + * - VSCALE + - VRATIO + - :ref:`vscale` ``VRATIO`` value. + + + .. _get_gen_parm: + + \*GET General Items, Entity = PARM + ********************************** + + .. flat-table:: ``Entity`` = PARM, ``ENTNUM`` = 0 (or blank) + :header-rows: 2 + + * - :ref:`get`, ``Par``, PARM, 0, ``Item1``, ``IT1NUM``, ``Item2``, ``IT2NUM`` + * - Item1 + - IT1NUM + - Description + * - MAX + - + - Total number of parameters currently defined. + * - BASIC + - + - Number of scalar parameters (excluding parameters beginning with an underscore _, array parameters, and character parameters). + * - LOC + - ``Num`` + - Name of the parameter at the ``Num`` location in the parameter table. A character parameter is returned. + + + .. _get_gen_tbtype: + + \*GET General Items, Entity = TBTYPE + ************************************ + + .. flat-table:: ``Entity`` = ``TBTYPE``, ``ENTNUM`` = ``MatID`` (where TBTYPE is the material table type as defined via the :ref:`tb` command, such (ELASTIC, CTE, etc.), and ``MatID`` is the material ID) **Evaluates a material property coefficient for a given set of input field variables.** + :header-rows: 2 + + * - :ref:`get`, ``Par``, **TBTYPE**, ``MatID``, ``Item1``, ``IT1NUM``, ``Item2``, ``IT2NUM``, ``Fld1``, ``Fld2``,... + * - Item1 + - IT1NUM + - Description + * - :rspan:`2` TBEV: Material table evaluation for query at a given field variable + - :rspan:`2` ``SINDEX`` = Subtable index (1 - max number of subtables) + - **Item2** : ``CINDEX`` = Coefficient index + * - **IT2NUM** : ``N`` = Number of field variables input + * - ``Fld1``, ``Fld2``, ..., : ``Val`` = Value of the field variable(s), entered in the same order specified via the :ref:`tbfield` command(s) + + **Preprocessing Items** + + .. _gettabprep: + + \*GET Preprocessing Entity Items + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + + * :ref:`get_prep_act` + + * :ref:`get_prep_area` + + * :ref:`get_prep_axis` + + * :ref:`get_prep_cdsy` + + * :ref:`get_prep_ce` + + * :ref:`get_prep_cmpb` + + * :ref:`get_prep_cp` + + * :ref:`get_prep_csec` + + * :ref:`get_prep_elem` + + * :ref:`get_prep_etyp` + + * :ref:`get_prep_gcn` + + * :ref:`get_prep_genb` + + * :ref:`get_prep_gens` + + * :ref:`get_prep_kp` + + * :ref:`get_prep_line` + + * :ref:`get_prep_link` + + * :ref:`get_prep_mat` + + * :ref:`get_prep_mplab` + + * :ref:`get_prep_node` + + * :ref:`get_prep_ocean` + + * :ref:`get_prep_oczone` + + * :ref:`get_prep_part` + + * :ref:`get_prep_pipe` + + * :ref:`get_prep_rcon` + + * :ref:`get_prep_rein` + + * :ref:`get_prep_sctn` + + * :ref:`get_prep_secp` + + * :ref:`get_prep_shel` + + * :ref:`get_prep_tbft1` + + * :ref:`get_prep_tblab` + + * :ref:`get_prep_volu` + + .. _get_prep_act: + + \*GET Preprocessing Items, Entity = ACTIVE + ****************************************** + + .. flat-table:: ``Entity`` = ACTIVE, ``ENTNUM`` = 0 (or blank) + :header-rows: 2 + + * - :ref:`get`, ``Par``, ACTIVE, 0, ``Item1``, ``IT1NUM``, ``Item2``, ``IT2NUM`` + * - Item1 + - IT1NUM + - Description + * - SEG + - + - Segment capability of graphics driver: 0=no segments available, 1=erasable segments available, 2=non-erasable segments available. + * - CSYS + - + - Active coordinate system. + * - DSYS + - + - Active display coordinate system. + * - MAT + - + - Active material. + * - TYPE + - + - Active element type. + * - REAL + - + - Active real constant set. + * - ESYS + - + - Active element coordinate system. + * - SECT + - + - Active section. + * - CP + - + - Maximum coupled node set number in the model (includes merged and deleted sets until compressed out). + * - CE + - + - Maximum constraint equation set number in the model (includes merged and deleted sets until compressed out). + + + .. _get_prep_area: + + \*GET Preprocessing items, Entity = AREA + **************************************** + + .. flat-table:: ``Entity`` = AREA, ``ENTNUM`` = ``N`` (area number) + :header-rows: 2 + + * - :ref:`get`, ``Par``, AREA, ``N``, ``Item1``, ``IT1NUM``, ``Item2``, ``IT2NUM`` + * - Item1 + - IT1NUM + - Description + * - ATTR + - ``Name`` + - Number assigned to the attribute, ``Name``, where ``Name`` =MAT, TYPE, REAL, ESYS, KB,KE,SECN, NNOD, NELM, or ESIZ. (NNOD=number of nodes, NELM=number of elements, ESIZ=element size.) + * - ASEL + - + - Select status of area ``N`` : -1=unselected, 0=undefined, 1=selected. Alternative get function: ASEL( ``N`` ). + * - NXTH + - + - Next higher area number above ``N`` in selected set (or zero if none found). + * - NXTL + - + - Next lower area number below ``N`` in selected set (or zero if none found). + * - AREA + - + - Area of area ``N``. ( :ref:`asum` or :ref:`gsum` must have been performed sometime previously with at least this area ``N`` selected). + * - LOOP + - 1,2,..., ``I`` + - ``Item2`` : LINE, ``IT2NUM`` : 1,2,..., ``p`` Line number of position ``p`` of loop ``I`` + + + .. _get_prep_axis: + + \*GET Preprocessing Items, Entity = AXIS + **************************************** + + .. flat-table:: ``Entity`` = AXIS, ``ENTNUM`` = 0 (or blank) + :header-rows: 2 + + * - :ref:`get`, ``Par``, AXIS, 0, ``Item1``, ``IT1NUM``, ``Item2``, ``IT2NUM`` + * - Item1 + - IT1NUM + - Description + * - COUNT + - -- + - Number of defined sections. + * - NUM + - MAX + - Largest section number defined. + + + .. _get_prep_cdsy: + + \*GET Preprocessing Items, Entity = CDSY + **************************************** + + .. flat-table:: ``Entity`` = CDSY, ``ENTNUM`` = ``N`` (coordinate system number) + :header-rows: 2 + + * - :ref:`get`, ``Par``, CDSY, ``N``, ``Item1``, ``IT1NUM``, ``Item2``, ``IT2NUM`` + * - Item1 + - IT1NUM + - Description + * - LOC + - X, Y, Z + - X, Y, or Z origin location in global Cartesian system. + * - ANG + - XY, YZ, ZX + - THXY, THYZ, or THZX rotation angle (in degrees) relative to the global Cartesian coordinate system. + * - ATTR + - ``Name`` + - Number assigned to ``Name``, where ``Name`` =KCS, KTHET, KPHI, PAR1, or PAR2. The value -1.0 is returned for KCS if the coordinate system is undefined. + * - NUM + - MAX + - The maximum coordinate system number + + + .. _get_prep_ce: + + \*GET Preprocessing Items, Entity = CE + ************************************** + + .. flat-table:: ``Entity`` = CE, ``ENTNUM`` = ``N`` (constraint equation set) + :header-rows: 2 + + * - :ref:`get`, ``Par``, CE, ``N``, ``Item1``, ``IT1NUM``, ``Item2``, ``IT2NUM`` + * - Item1 + - IT1NUM + - Description + * - If N = 0, then + * - MAX + - + - Maximum constraint equation number + * - NUM + - + - Number of constraint equations + * - If N > 0, then + * - NTERM + - + - Number of terms in this constraint equation + * - CONST + - + - Constant term for this constraint equation + * - TERM + - number + - Item2 = NODE: Gives the node for this position in the constraint equation. Item2 = DOF: Gives the DOF number for this position in the constraint equation. (1-UX, 2-UY, 3-UZ, 4-ROTX, etc.) Item2 = COEF: Gives the coefficient for this position in the constraint equation. + + + .. _get_prep_cmpb: + + \*GET Preprocessing Items, Entity = CMPB + **************************************** + + .. flat-table:: ``Entity`` = CMPB, ``ENTNUM`` = ``N`` (composite beam section identification number) + :header-rows: 2 + + * - :ref:`get`, ``Par``, CMPB, ``N``, ``Item1``, ``IT1NUM``, ``Item2``, ``IT2NUM`` + * - Item1 + - IT1NUM + - Description + * - COUNT + - + - Number of defined sections. If Item1 = COUNT, then N is blank. + * - NUM + - MAX + - Largest section number defined. If IT1NUM = MAX, then N is blank. + * - EXIS + - + - Returns a 1 if the section exists and if it is a CMPB section. + * - NAME + - + - The 8-character section name defined via the :ref:`sectype` command. + * - One of the following: * CBMX * CBTE * CBMD + - + - Item2 = NTEM (the number of temperatures for :ref:`cbmx`, :ref:`cbte`, or :ref:`cbmd` data). + * - One of the following: * CBMX * CBTE * CBMD + - + - Item2 = TVAL; IT2NUM = ``nnn`` where ``nnn`` is the temperature value (< = NTEM). + * - One of the following: * CBMX * CBTE * CBMD + - ``nnn`` + - Item2 = TEMP; IT2NUM = ``tval`` Where ``nnn`` is the location in the :ref:`cbmx`, :ref:`cbte`, or :ref:`cbmd` command for the given coefficient number, and ``tval`` is the temperature value. + + + .. _get_prep_cp: + + \*GET Preprocessing Items, Entity = CP + ************************************** + + .. flat-table:: ``Entity`` = CP, ``ENTNUM`` = ``N`` (coupled node set) + :header-rows: 2 + + * - :ref:`get`, ``Par``, CP, ``N``, ``Item1``, ``IT1NUM``, ``Item2``, ``IT2NUM`` + * - Item1 + - IT1NUM + - Description + * - If N = 0, then + * - MAX + - + - Maximum coupled set number + * - NUM + - + - Number of coupled sets + * - If N > 0, then + * - DOF + - + - The degree of freedom for this set (1-UX, 2-UY, 3-UZ, 4-ROTX, etc.) + * - NTERM + - + - Number of nodes in this set. + * - TERM + - number + - Item2 = NODE: Gives the node for this position number in the coupled set. + + + .. _get_prep_csec: + + \*GET Preprocessing Items, Entity = CSEC + **************************************** + + .. flat-table:: ``Entity`` = CSEC, ``ENTNUM`` = 0 (or blank) + :header-rows: 2 + + * - :ref:`get`, ``Par``, CSEC, 0, ``Item1``, ``IT1NUM``, ``Item2``, ``IT2NUM`` + * - Item1 + - IT1NUM + - Description + * - COUNT + - -- + - Number of defined sections. + * - NUM + - MAX + - Largest section number defined. + + + .. _get_prep_elem: + + \*GET Preprocessing Items, Entity = ELEM + **************************************** + + .. flat-table:: ``Entity`` = ELEM, ``ENTNUM`` = ``N`` (element number) + :header-rows: 2 + + * - :ref:`get`, ``Par``, ELEM, ``N``, ``Item1``, ``IT1NUM``, ``Item2``, ``IT2NUM`` + * - Item1 + - IT1NUM + - Description + * - NODE + - 1, 2,... 20 + - Node number at position 1,2,... or 20 of element ``N``. Alternative get function: NELEM( ``n,npos`` ), where ``npos`` is 1,2,...20. + * - CENT + - X, Y, Z + - Centroid X, Y, or Z location (based on shape function) in the active coordinate system. The original locations is used even if large deflections are active. Alternative get functions: CENTRX( ``N`` ), CENTRY( ``N`` ), and CENTRZ( ``N`` ) always retrieve the element centroid in global Cartesian coordinates, and are determined from the selected nodes on the elements. + * - ADJ + - 1, 2,... 6 + - Element number adjacent to face 1,2,...6. Alternative get function: ELADJ( ``N``, ``face`` ). Only elements (of the same dimensionality) adjacent to lateral faces are considered. + * - ATTR + - ``Name`` + - Number assigned to the attribute ``Name``, where ``Name`` = MAT, TYPE, REAL, ESYS, PSTAT, LIVE, or SECN. Returns a zero if the element is unselected. If ``Name`` = LIVE, returns a 1 if the element is selected and active, and a -1 if it is selected and inactive. ``Name`` = SECN returns the section number of the selected beam element. + * - LENG + - + - Length of line element (straight line between ends). + * - LPROJ + - X, Y, Z + - Projected line element length (in the active coordinate system). X is x-projection onto y-z plane, Y is y projection onto z-x plane, and Z is z-projection onto x-y plane. + * - AREA + - + - Area of area element. + * - APROJ + - X, Y, Z + - Projected area of area element area (in the active coordinate system). X is x-projection onto y-z plane, Y is y projection onto z-x plane, and Z is z-projection onto x-y plane. + * - VOLU + - + - Element volume. Based on unit thickness for 2D plane elements (unless the thickness option is used) and on the full 360 degrees for 2D axisymmetric elements. For general axisymmetric elements ``SOLID272`` and ``SOLID273``, only the area of the element on the master plane is reported before solving, not the volume. After solving, the volume is reported. If results data are in the database, the volume returned is the volume calculated during solution. + * - ESEL + - + - Select status of element ``N`` : -1 = unselected, 0 = undefined, 1 = selected. Alternative get function: ESEL( ``N`` ). + * - NXTH + - + - Next higher element number above ``N`` in selected set (or zero if none found). Alternative get function: ELNEXT( ``N`` ) + * - NXTL + - + - Next lower element number below ``N`` in selected set (or zero if none found). + * - HGEN + - + - Heat generation on selected element ``N``. + * - DGEN + - + - Diffusing substance generation on selected node N (returns 0.0 if node is unselected, or if the DOF is inactive). + * - HCOE + - face + - Heat coefficient for selected element ``N`` on specified face. Returns the value at the first node that forms the face. + * - TBULK + - face + - Bulk temperature for selected element ``N`` on specified face. Returns the value at the first node that forms the face. + * - PRES + - face + - Pressure on selected element, ``N`` on specified face. Returns the value at the first node that forms the face. + * - SHPAR + - ``Test`` + - Element shape test result for selected element ``N``, where ``Test`` = ANGD, ASPE (aspect ratio), JACR (Jacobian ratio), MAXA (maximum corner angle), PARA (deviation from parallelism of opposite edges), or WARP (warping factor). + * - MEMBER + - COUNT + - Number of reinforcing members (individual reinforcings) in the element ``N``. + * - :rspan:`1` EGID + - COUNT + - Number of non-duplicate global identifiers in the element ``N``. + * - MIN, MAX + - Lowest or highest global identifier in the element ``N``. + + + .. _get_prep_etyp: + + \*GET Preprocessing Items, Entity = ETYP + **************************************** + + .. flat-table:: ``Entity`` = ETYP, ``ENTNUM`` = ``N`` (element type number) + :header-rows: 2 + + * - :ref:`get`, ``Par``, ETYP, ``N``, ``Item1``, ``IT1NUM``, ``Item2``, ``IT2NUM`` + * - Item1 + - IT1NUM + - Description + * - ATTR + - ``Name`` + - Number assigned to the attribute ``Name``, where ``Name`` =ENAM, KOP1, KOP2,..., KOP9, KO10, KO11, etc. + + + .. _get_prep_gcn: + + \*GET Preprocessing Items, Entity = GCN + *************************************** + + .. flat-table:: ``Entity`` = GCN, ``ENTNUM`` = 0 (or blank) + :header-rows: 2 + + * - :ref:`get`, ``Par``, GCN, 0, ``Item1``, ``IT1NUM``, ``Item2``, ``IT2NUM`` + * - Item1 + - IT1NUM + - Description + * - MAT + - ``Sect1`` + - ``Item2`` = 0 or blank; ``IT2NUM`` = ``Sect2``. Material ID to be used for general contact between ``Sect1`` and ``Sect2``. Alternative get function: SECTOMAT( ``Sect1``, ``Sect2`` ). + * - REAL + - ``Sect1`` + - ``Item2`` = 0 or blank; ``IT2NUM`` = ``Sect2``. Real constant ID to be used for general contact between ``Sect1`` and ``Sect2`` . Alternative get function: SECTOREAL( ``Sect1``, ``Sect2`` ). + * - DEF + - ``Sect1`` + - ``Item2`` = 0 or blank; ``IT2NUM`` = ``Sect2``. Number indicating the type of contact for the general contact definition between ``Sect1`` and ``Sect2`` : * = 0 - Excluded general contact between ``Sect1`` / ``Sect2`` * = 1 - Asymmetric general contact between ``Sect1`` (contact) / ``Sect2`` (target) * = 2 - Asymmetric general contact between ``Sect1`` (target) / ``Sect2`` (contact) * = 3 - Symmetric general contact between ``Sect1`` / ``Sect2`` + * - ``Sect1`` and ``Sect2`` are section numbers associated with general contact surfaces. + + + .. _get_prep_genb: + + \*GET Preprocessing Items, Entity = GENB + **************************************** + + .. flat-table:: ``Entity`` = GENB, ``ENTNUM`` = ``N`` (nonlinear beam general section identification number) + :header-rows: 2 + + * - :ref:`get`, ``Par``, GENB, ``N``, ``Item1``, ``IT1NUM``, ``Item2``, ``IT2NUM`` + * - Item1 + - IT1NUM + - Description + * - COUNT + - (Blank) + - Number of defined sections. If ``Item1`` = COUNT, then ``N`` is blank. + * - NUM + - MAX + - Largest section number defined. If ``IT1NUM`` = MAX, then ``N`` is blank. + * - EXIS + - (Blank) + - Returns a 1 if the section exists and if it is a GENB section. + * - SUBTYPE + - (Blank) + - Section subtype for the section ID specified via the :ref:`sectype` command. + * - NAME + - (Blank) + - The 8-character section name defined via the :ref:`sectype` command. + * - One of the following: * BSAX * BSM1 * BSM2 * BSTQ * BSS1 * BSS2 * BSMD * BSTE + - (Blank) + - ``Item2`` = NTEM, the number of temperatures for :ref:`bsax`, :ref:`bsm1`, :ref:`bsm2`, :ref:`bstq`, :ref:`bss1`, :ref:`bss2`, :ref:`bsmd`, or :ref:`bste` data. + * - One of the following: * BSAX * BSM1 * BSM2 * BSTQ * BSS1 * BSS2 * BSMD * BSTE + - (Blank) + - ``Item2`` = TVAL; ``IT2NUM`` = ``nnn`` Where ``nnn`` is the temperature value (<= NTEM). + * - One of the following: * BSAX * BSM1 * BSM2 * BSTQ * BSS1 * BSS2 * BSMD * BSTE + - ``nnn`` + - ``Item2`` = TEMP; ``IT2NUM`` = ``tval`` Where ``nnn`` is the location in the :ref:`bsax`, :ref:`bsm1`, :ref:`bsm2`, :ref:`bstq`, :ref:`bss1`, :ref:`bss2`, :ref:`bsmd`, or :ref:`bste` command for the given coefficient number, and ``tval`` is the temperature value. Examples for ``nnn`` : * ``nnn`` = 1 for STRAIN(1) * ``nnn`` = 2 for STRESS(1) * ``nnn`` = 3 for STRAIN(2) * ``nnn`` = 4 for STRESS(2) * ``nnn`` = 5 for STRAIN(3) *... + * - One of the following: * BSAX * BSM1 * BSM2 * BSTQ * BSS1 * BSS2 * BSMD * BSTE + - (Blank) + - ``Item2`` = TEMP; ``IT2NUM`` = ``tval`` ; ``Item3`` = NCONST The number of constants at ``tval``. + + + .. _get_prep_gens: + + \*GET Preprocessing Items, Entity = GENS + **************************************** + + .. flat-table:: ``Entity`` = GENS, ``ENTNUM`` = ``N`` (preintegrated shell general section identification number) + :header-rows: 2 + + * - :ref:`get`, ``Par``, GENS, ``N``, ``Item1``, ``IT1NUM``, ``Item2``, ``IT2NUM`` + * - Item1 + - IT1NUM + - Description + * - COUNT + - (Blank) + - Number of defined sections. If ``Item1`` = COUNT, then ``N`` is blank. + * - NUM + - MAX + - Largest section number defined. If ``IT1NUM`` = MAX, then ``N`` is blank. + * - EXIS + - (Blank) + - Returns a 1 if the section exists and if it is a GENS section. + * - NAME + - (Blank) + - The 8-character section name defined via the :ref:`sectype` command. + * - One of the following: * SSPA * SSPB * SSPD * SSPE * SSMT * SSBT * SSPM + - (Blank) + - ``Item2`` = NTEM, the number of temperatures for :ref:`sspa`, :ref:`sspb`, :ref:`sspd`, :ref:`sspe`, :ref:`ssmt`, :ref:`ssbt`, or :ref:`sspm` data. + * - One of the following: * SSPA * SSPB * SSPD * SSPE * SSMT * SSBT * SSPM + - (Blank) + - ``Item2`` = TVAL; ``IT2NUM`` = ``nnn`` Where ``nnn`` is the temperature value (<= NTEM). + * - One of the following: * SSPA * SSPB * SSPD * SSPE * SSMT * SSBT * SSPM + - ``nnn`` + - ``Item2`` = TEMP; ``IT2NUM`` = ``tval`` Where ``nnn`` is the location in the :ref:`sspa`, :ref:`sspb`, :ref:`sspd`, :ref:`sspe`, :ref:`ssmt`, :ref:`ssbt`, or :ref:`sspm` command for the given coefficient number, and ``tval`` is the temperature value. + + + .. _get_prep_kp: + + \*GET Preprocessing Items, Entity = KP + ************************************** + + .. flat-table:: ``Entity`` = KP, ``ENTNUM`` = ``N`` (keypoint number) + :header-rows: 2 + + * - :ref:`get`, ``Par``, KP, ``N``, ``Item1``, ``IT1NUM``, ``Item2``, ``IT2NUM`` + * - Item1 + - IT1NUM + - Description + * - LOC + - X, Y, Z + - X, Y, or Z location in the active coordinate system. Alternative get functions: KX( ``N`` ), KY( ``N`` ), KZ( ``N`` ). Inverse get function: KP( ``x,y,z`` ) returns the number of the selected keypoint nearest the ``x,y,z`` location (in the active coordinate system, lowest number for coincident keypoints). + * - ATTR + - ``Name`` + - Number assigned to the attribute ``Name``, where ``Name`` = MAT, TYPE, REAL, ESYS, NODE, or ELEM. + * - KSEL + - + - Select status of keypoint ``N`` : -1 = unselected, 0 = undefined, 1 = selected. Alternative get function: KSEL( ``N`` ). + * - NXTH + - + - Next higher keypoint number above ``N`` in selected set (or zero if none found). Alternative get function: KPNEXT( ``N`` ). + * - NXTL + - + - Next lower keypoint number below ``N`` in selected set (or zero if none found). + * - DIV + - + - Divisions (element size setting) from :ref:`kesize` command. + + + .. _get_prep_line: + + \*GET Preprocessing Items, Entity = LINE + **************************************** + + .. flat-table:: ``Entity`` = LINE, ``ENTNUM`` = ``N`` (line number) + :header-rows: 2 + + * - :ref:`get`, ``Par``, LINE, ``N``, ``Item1``, ``IT1NUM``, ``Item2``, ``IT2NUM`` + * - Item1 + - IT1NUM + - Description + * - KP + - 1,2 + - Keypoint number at position 1 or 2. + * - ATTR + - ``Name`` + - Number assigned to the attribute, ``Name``, where ``Name`` =MAT, TYPE, REAL, ESYS, NNOD, NELM, NDIV, NDNX, SPAC, SPNX, KYND, KYSP, LAY1, or LAY2. (NNOD=number of nodes, returns --1 for meshed line with no internal nodes, NELM=number of elements, NDIV=number of divisions in an existing mesh, NDNX=number of divisions assigned for next mesh, SPAC=spacing ratio in an existing mesh, SPNX=spacing ratio for next mesh, KYND=soft key for NDNX, KYSP=soft key for SPNX, LAY1=LAYER1 setting, LAY2=LAYER2 setting.) + * - LSEL + - + - Select status of line ``N`` : -1=unselected, 0=undefined, 1=selected. Alternative get function: LSEL( ``N`` ). + * - NXTH + - + - Next higher line number above ``N`` in the selected set (or zero if none found). Alternative get function: LSNEXT( ``N`` ) + * - NXTL + - + - Next lower line number below ``N`` in selected set (or zero if none found). + * - LENG + - + - Length. A get function LX( ``n,lfrac`` ) also exists to return the X coordinate location of line ``N`` at the length fraction ``lfrac`` (0.0 to 1.0). Similar LY and LZ functions exist. + + + .. _get_prep_link: + + \*GET Preprocessing Items, Entity = LINK + **************************************** + + .. flat-table:: ``Entity`` = LINK, ``ENTNUM`` = 0 (or blank) + :header-rows: 2 + + * - :ref:`get`, ``Par``, LINK, ``NUM``, ``Item1``, ``IT1NUM``, ``Item2``, ``IT2NUM`` + * - Item1 + - IT1NUM + - Description + * - COUNT + - + - Number of defined sections. + * - NUM + - MAX + - Largest section number defined. + + + .. _get_prep_mat: + + \*GET Preprocessing Items, Entity = MAT + *************************************** + + .. flat-table:: ``Entity`` = MAT, ``ENTNUM`` = 0 (or blank) + :header-rows: 2 + + * - :ref:`get`, ``Par``, MAT, 0, ``Item1``, ``IT1NUM``, ``Item2``, ``IT2NUM`` + * - Item1 + - IT1NUM + - Description + * - COUNT + - + - Number of materials. + * - NUM + - MAX + - Largest material number for which at least one property is defined. + + + .. _get_prep_mplab: + + \*GET Preprocessing Items, Entity = MPLAB + ***************************************** + + .. flat-table:: ``Entity`` = MPlab, ``ENTNUM`` = ``N`` ( ``MPlab`` = material property label from :ref:`mp` command; ``N`` = material number.) + :header-rows: 2 + + * - :ref:`get`, ``Par``, MPlab, ``N``, ``Item1``, ``IT1NUM``, ``Item2``, ``IT2NUM`` + * - Item1 + - IT1NUM + - Description + * - TEMP + - val + - Material property value at temperature of ``val`` . For temperature dependent materials, the program interpolates the property at temperature input for ``val``. + + + .. _get_prep_node: + + \*GET Preprocessing Items, Entity = NODE + **************************************** + + .. flat-table:: ``Entity`` = NODE, ``ENTNUM`` = ``N`` (node number) + :header-rows: 2 + + * - :ref:`get`, ``Par``, NODE, ``N``, ``Item1``, ``IT1NUM``, ``Item2``, ``IT2NUM`` + * - Item1 + - IT1NUM + - Description + * - LOC + - X, Y, Z + - X, Y, Z location in the active coordinate system. Alternative get functions: NX( ``N`` ), NY( ``N`` ), NZ( ``N`` ). Inverse get function. NODE( ``x,y,z`` ) returns the number of the selected node nearest the ``x,y,z`` location (in the active coordinate system, lowest number for coincident nodes). + * - ANG + - XY, YZ, ZX + - THXY, THYZ, THZX rotation angle. + * - NSEL + - + - Select status of node ``N`` : -1=unselected, 0=undefined, 1=selected. Alternative get function: NSEL( ``N`` ). + * - NXTH + - + - Next higher node number above ``N`` in selected set (or zero if none found). Alternative get function: NDNEXT( ``N`` ). + * - NXTL + - + - Next lower node number below ``N`` in selected set (or zero if none found). + * - F + - FX, MX,... + - Applied force at selected node ``N`` in direction ``IT1NUM`` (returns 0.0 if no force is defined, if node is unselected, or if the DOF is inactive). If ``ITEM2`` is IMAG, return the imaginary part. + * - D + - UX, ROTX,... + - Applied constraint force at selected node ``N`` in direction ``IT1NUM`` (returns a large number, such as 2e100, if no constraint is specified, if the node is unselected, or if the DOF is inactive). If ``ITEM2`` is IMAG, return the imaginary part. + * - HGEN + - + - Heat generation on selected node ``N`` (returns 0.0 if node is unselected, or if the DOF is inactive). + * - NTEMP + - + - Temperature on selected node N (returns 0.0 if node is unselected) + * - CPS + - Lab + - Couple set number with direction Lab = any active DOF, which contains the node ``N``. + * - DGEN + - + - Diffusing substance generation on selected node N (returns 0.0 if node is unselected, or if the DOF is inactive). + + + .. _get_prep_ocean: + + \*GET Preprocessing Items, Entity = OCEAN + ***************************************** + + .. flat-table:: ``Entity`` = OCEAN, ``ENTNUM`` = ``Type`` (where ``Type`` is a valid label on the ``DataType`` field of the :ref:`octype` command) + :header-rows: 2 + + * - :ref:`get`, ``Par``, OCEAN, ``Type``, ``Item1``, ``IT1NUM``, ``Item2``, ``IT2NUM`` + * - Item1 + - IT1NUM + - Description + * - NAME + - + - Name defined for a given ``Type`` + * - :rspan:`13` DATA + - 1 + - Depth when ``Type`` = BASI + * - 2 + - Material ID when ``Type`` = BASI + * - 8 + - ``KFLOOD`` when ``Type`` = BASI + * - 9 + - ``Cay`` when ``Type`` = BASI + * - 10 + - ``Cb`` when ``Type`` = BASI + * - 11 + - ``Zmsl`` when ``Type`` = BASI + * - 13 + - ``Caz`` when ``Type`` = BASI + * - 14 + - ``Ktable`` when ``Type`` = BASI + * - 1 + - ``KWAVE`` when ``Type`` = WAVE + * - 2 + - ``THETA`` when ``Type`` = WAVE + * - 3 + - ``WAVELOC`` when ``Type`` = WAVE + * - 4 + - ``KCRC`` when ``Type`` = WAVE + * - 5 + - ``KMF`` when ``Type`` = WAVE + * - 6 + - ``PRKEY`` when ``Type`` = WAVE + * - PROP + - NROW + - Number of rows defined by :ref:`octable` command + * - TABL + - ``i`` + - Data in table defined by :ref:`octable` command ``i`` = row number; Item2 = column number + + + This command contains some tables and extra information which can be inspected in the original + documentation pointed above. + + .. _get_prep_oczone: + + \*GET Preprocessing Items, Entity = OCZONE + ****************************************** + + .. flat-table:: ``Entity`` = OCZONE, ``ENTNUM`` = ``Name`` (where ``Name`` is a valid label on the ``ZoneName`` field of the :ref:`oczone` command) + :header-rows: 2 + + * - :ref:`get`, ``Par``, OCZONE, ``Name``, ``Item1``, ``IT1NUM``, ``Item2``, ``IT2NUM`` + * - Item1 + - IT1NUM + - Description + * - :rspan:`3` DATA + - 8 + - ``KFLOOD`` for a given ``ENTNUM`` = ``Name`` + * - 9 + - ``Cay`` for a given ``ENTNUM`` = ``Name`` + * - 10 + - ``Cb`` for a given ``ENTNUM`` = ``Name`` + * - 13 + - ``Caz`` for a given ``ENTNUM`` = ``Name`` + * - PROP + - NROW + - Number of rows defined by :ref:`octable` command + * - TABL + - ``i`` + - Data in table defined by :ref:`octable` command ``i`` = row number; Item2 = column number + * - TYPE + - + - Ocean zone type (returns 1, 2 or 3 for ZLOC-, COMP-, or PIP-type zones, respectively) + * - COMP + - + - Component name when the given ocean zone type is COMP, or internal component name when the given ocean zone type is PIP + * - COMP2 + - + - External component name when the type of given ocean zone is PIP + + + This command contains some tables and extra information which can be inspected in the original + documentation pointed above. + + This command contains some tables and extra information which can be inspected in the original + documentation pointed above. + + .. _get_prep_pipe: + + \*GET Preprocessing Items, Entity = PIPE + **************************************** + + .. flat-table:: ``Entity`` = PIPE, ``ENTNUM`` = 0 (or blank) + :header-rows: 2 + + * - :ref:`get`, ``Par``, PIPE, ``NUM``, ``Item1``, ``IT1NUM``, ``Item2``, ``IT2NUM`` + * - Item1 + - IT1NUM + - Description + * - COUNT + - + - Number of defined sections + * - NUM + - MAX + - Largest section number defined + + + .. _get_prep_part: + + \*GET Preprocessing Items, Entity = PART + **************************************** + + .. flat-table:: ``Entity`` = PART, ``ENTNUM`` = ``N`` (PART number) + :header-rows: 2 + + * - :ref:`get`, ``Par``, PART, ``N``, ``Item1``, ``IT1NUM``, ``Item2``, ``IT2NUM`` + * - Item1 + - IT1NUM + - Description + * - TYPE + - + - Element type number assigned to PART ``N``. + * - MAT + - + - Material number assigned to PART ``N``. + * - REAL + - + - Real constant number assigned to PART ``N``. + + + .. _get_prep_rcon: + + \*GET Preprocessing Items, Entity = RCON + **************************************** + + .. flat-table:: ``Entity`` = :ref:`rcon`, ``ENTNUM`` = ``N`` (real constant set number) + :header-rows: 1 + + * - :ref:`get`, ``Par``, RCON, ``N``, ``Item1``, ``IT1NUM``, ``Item2``, ``IT2NUM`` + * - CONST + - 1, 2,..., ``m`` + - Value of real constant number ``m`` in set ``N``. + * - :ref:`get` + - [\*GET ,Par, RCON,0, Item1, IT1NUM, Item2, IT2NUM] + * - NUM + - MAX + - The maximum real constant set number defined + + + .. _get_prep_rein: + + \*GET Preprocessing Items, Entity = REIN + **************************************** + + .. flat-table:: ``Entity`` = REIN, ``ENTNUM`` = ``N`` (reinforcing section identification number) + :header-rows: 2 + + * - :ref:`get`, ``Par``, REIN, ``N``, ``Item1``, ``IT1NUM``, ``Item2``, ``IT2NUM`` + * - Item1 + - IT1NUM + - Description + * - TYPE + - + - Section type, for ID -- :ref:`sectype` command (always REIN for reinforcing sections). + * - SUBTYPE + - + - Section subtype for ID -- :ref:`sectype` command. + * - NAME + - + - Name defined for a given ID number. + * - NREIN + - + - Number of reinforcing fibers. For reinforcing sections generated ( :ref:`ereinf` ) via the standard method, the number of fibers defined via :ref:`secdata`. For reinforcing sections generated ( :ref:`ereinf` ) via the mesh-independent method, the total number of fibers in the section. + * - TABL + - ``ReinfNum,I`` + - Reinforcing fiber data, as defined via :ref:`secdata`. This item is not allowed for reinforcing sections generated ( :ref:`ereinf` ) via the mesh-independent method. + + + .. _get_prep_sctn: + + \*GET Preprocessing Items, Entity = SCTN + **************************************** + + .. flat-table:: ``Entity`` = SCTN, ``ENTNUM`` = ``N`` (pretension section ID number) + :header-rows: 2 + + * - :ref:`get`, ``Par``, SCTN, ``N``, ``Item1``, ``IT1NUM``, ``Item2``, ``IT2NUM`` + * - Item1 + - IT1NUM + - Description + * - 1 + - + - Section ID number. + * - 2 + - + - Section type (always 5 for pretension section). + * - 3 + - + - Pretension node number. + * - 4 + - Coordinate system number. + - Section normal NX. + * - 5 + - Coordinate system number. + - Section normal NY. + * - 6 + - Coordinate system number. + - Section normal NZ. + * - 7 or 8 + - + - Eight character section name. + * - 9 + - + - Initial action key. Returns 0 or 1 for lock, 2 for "free-to-slide," or 3 for tiny. + * - 10 + - + - Force displacement key. Returns 0 or 1 for force, or 2 for displacement. + * - 11 + - + - First preload value. + * - 12 + - + - Load step in which first preload value is to be applied. + * - 13 + - + - Load step in which first preload value is to be locked. + * - 14... + - + - 14 through 17 is a repeat of 10 through 13, but for the second preload value; 18 through 21 is for the third preload value; and so forth. + + + .. _get_prep_secp: + + \*GET Preprocessing Items, Entity = SECP + **************************************** + + .. flat-table:: ``Entity`` = SECP, ``ENTNUM`` = 0 (or blank) + :header-rows: 2 + + * - :ref:`get`, ``Par``, SECP, ``NUM``, ``Item1``, ``IT1NUM``, ``Item2``, ``IT2NUM`` + * - Item1 + - IT1NUM + - Description + * - COUNT + - + - Number of defined sections + * - NUM + - MAX + - Largest section number defined + + + .. _get_prep_shel: + + \*GET Preprocessing Items, Entity = SHEL + **************************************** + + .. flat-table:: ``Entity`` = SHEL, ENTNUM = ``N`` (shell section identification number) + :header-rows: 2 + + * - :ref:`get`, ``Par``, SHEL, ``N``, ``Item1``, ``IT1NUM``, ``Item2``, ``IT2NUM`` + * - Item1 + - IT1NUM + - Description + * - TYPE + - + - Section type, for id -- :ref:`sectype` command. (always SHEL for shell sections) + * - NAME + - + - Name defined for a given id number. + * - :rspan:`26` PROP + - TTHK + - Total thickness. + * - NLAY + - Number of layers. + * - NSP + - Number of section integration points. + * - :rspan:`4` POS + - Node position (as defined by :ref:`secoffset` ). + * - 0 = User Defined. + * - 1 = Middle. + * - 2 = Top. + * - 3 = Bottom. + * - OFFZ + - User-defined section offset (POS = 0). + * - TS11 + - Transverse shear stiffness factors. + * - TS22 + - Transverse shear stiffness factors. + * - TS12 + - Transverse shear stiffness factors. + * - :rspan:`2` HORC + - Homogeneous or complete section flag. + * - 0 = Homogeneous. + * - 1 = Composite. + * - FUNC + - Tabular function name for total thickness. + * - UT11 + - User transverse shear stiffness 11. + * - UT22 + - User transverse shear stiffness 22. + * - UT12 + - User transverse shear stiffness 12. + * - AMAS + - Added mass. + * - MSCF + - Hourglass control membrane scale factor. + * - BSCF + - Hourglass control bending scale factor. + * - DSTF + - Drill stiffness scale factor. + * - LDEN + - Laminate density. + * - FKCN + - ``KCN`` field value from the :ref:`secfunction` command, in which the array or table is interpreted. + * - ABD + - Section membrane and bending stiffness matrix. Valid ITEM2 = 1,6 and IT2NUM = 1,6. + * - E + - Section transverse shear stiffness matrix. Valid ITEM2 = 1,2 and IT2NUM = 1,2. + * - :rspan:`3` LAYD + - LayerNumber,THIC + - Layer thickness. + * - LayerNumber,MAT + - Layer material. + * - LayerNumber,ANGL + - Layer orientation angle. + * - LayerNumber,NINT + - Number of layer integration points. + + + .. _get_prep_tbft1: + + \*GET Preprocessing Items, Entity = TBFT + **************************************** + + .. flat-table:: ``Entity`` = TBFT, ``ENTNUM`` = ``blank`` + :header-rows: 2 + + * - :ref:`get`, ``Par``, TBFT, ``Item1``, ``IT1NUM``, ``Item2``, ``IT2NUM`` + * - Item1 + - IT1NUM + - Description + * - nmat + - + - Number of defined material models. + * - matnum + - ``index`` + - Material number in array (index varies for 1 to num materials). + * - ``Entity`` = TBFT, ``ENTNUM`` = ``matid`` (For getting names of constitutive function, matid = the material ID number) + * - :ref:`get` + - [\*GET ,Par, TBFT,matid,nfun,IT1NUM,Item2,IT2NUM] + * - Item1 + - IT1NUM + - Description + * - nfun + - + - Number of constitutive functions for this material. + * - ``Entity`` = TBFT, ``ENTNUM`` = ``matid`` (To query constitutive function data, matid = the material ID number) + * - :ref:`get` + - [\*GET ,Par, TBFT,matid,func,fname,Item2,IT2NUM] + * - Item1 + - IT1NUM + - Description + * - func + - index + - If Item2 = fname, the name of the constitutive function is returned. + * - func + - function name + - If Item2 = ncon, the number of constants is returned for the function specified in IT1NUM by the constitutive function name. + * - " + - " + - If Item2 = cons, set Item2num to index to return the value of the constant. + * - " + - " + - If Item2 = fixe, set Item2num to index to return the fix flag status. + * - " + - " + - If Item2 = RESI, returns the residual error while fitting the data. + * - " + - " + - If Item2 = type, returns the category of the constitutive model (moon, poly, etc.) + * - " + - " + - If Item2 = sord, returns the shear order of the prony visco model. + * - " + - " + - If Item2 = bord, returns the bulk order of the prony visco model. + * - " + - " + - If Item2 = shif, returns the shift function name of the prony visco model. + * - ``Entity`` = TBFT, ``ENTNUM`` = ``matid`` (For getting names of experimental data, matid = the material ID number) + * - :ref:`get` + - [\*GET ,Par, TBFT,matid,nexp,IT1NUM,Item2,IT2NUM] + * - Item1 + - IT1NUM + - Description + * - nexp + - + - Number of experiments for this material. + * - ``Entity`` = TBFT, ``ENTNUM`` = ``matid`` (To query experimental data, ``matid`` = the material ID number)) + * - :ref:`get` + - [\*GET ,Par, TBFT,matid,func,fname,Item2,IT2NUM] + * - Item1 + - IT1NUM + - Description + * - " + - expindex + - If Item2 = type, returns experiments type string. + * - " + - " + - If Item2 = numrow, returns number of rows in the data. + * - " + - " + - If Item2 = numcol, returns the number of cols in a row (set Intem2num = Row index) + * - " + - " + - If Item2 = data, returns the value of the data in row, col of exp expindex (set item2Num = row index and item3 = column index. All indices vary from 1 to the maximum value. + * - " + - " + - If Item2 = natt, returns the number of attributes. + * - " + - " + - If Item2 = attname, returns the attribute name (set Item2Num = Attr index). + * - " + - " + - If Item2 = attvald, returns double value of attribute (set Item2Num = Attr index). + * - " + - " + - If Item2 = attvali, returns integer valud of attribute (set Item2Num = Attr index). + * - " + - " + - If Item2 = attvals, returns the string value of the attribute (set Item2Num = Attr index). + + + .. _get_prep_tblab: + + \*GET Preprocessing Items, Entity = TBLAB + ***************************************** + + .. flat-table:: ``Entity`` = TBLAB, ``ENTNUM`` = ``N``..( ``TBlab`` = data table label from the :ref:`tb` command; ``N`` = material number.) + :header-rows: 2 + + * - :ref:`get`, ``Par``, ``TBlab``, ``N``, ``Item1``, ``IT1NUM``, ``Item2``, ``IT2NUM``, ``TBOPT`` + * - Item1 + - IT1NUM + - Description + * - TEMP + - ``T`` + - **Item2** : CONST **IT2NUM** : ``Num`` Value of constant number Num in the data table at temperature ``T``. For constants, input an X,Y point; the constant numbers are consecutive with the X constants being the odd numbers, beginning with one. + * - To get all necessary output for materials defined via the :ref:`tb` command, you must specify the final argument ``TBOPT`` as indicated in the syntax description above. + + + .. _get_prep_volu: + + \*GET Preprocessing Items, Entity = VOLU + **************************************** + + .. flat-table:: ``Entity`` = VOLU, ``ENTNUM`` = ``N`` (volume number) + :header-rows: 2 + + * - :ref:`get`, ``Par``, VOLU, ``N``, ``Item1``, ``IT1NUM``, ``Item2``, ``IT2NUM`` + * - Item1 + - IT1NUM + - Description + * - ATTR + - ``Name`` + - Number assigned to the attribute ``Name``, where ``Name`` =MAT, TYPE, REAL, ESYS, NNOD, or NELM. (NNOD=number of nodes, NELM=number of elements.) + * - VSEL + - + - Select status of volume ``N`` : -1=unselected, 0=undefined, 1=selected. Alternative get function: VSEL( ``N`` ). + * - NXTH + - + - Next higher volume number above ``N`` in selected set (or zero if none found). Alternative get function: VLNEXT( ``N`` ). + * - NXTL + - + - Next lower volume number below ``N`` in selected set (or zero if none found). + * - VOLU + - + - Volume of volume ``N``. ( :ref:`vsum` or :ref:`gsum` must have been performed sometime previously with at least this volume ``N`` selected). + * - SHELL + - 1, 2,..., ``m`` + - **Item2** : AREA **IT2NUM** : 1,2,..., ``p`` Line number of position ``p`` of shell ``m`` + + **Solution Items** + + .. _gettabsol: + + \*GET Solution Entity Items + ^^^^^^^^^^^^^^^^^^^^^^^^^^^ + + * :ref:`get_sol_active` + + * :ref:`get_sol_elem` + + * :ref:`get_sol_mode` + + * :ref:`get_sol_ddam` + + .. _get_sol_active: + + \*GET Solution Items, Entity = ACTIVE + ************************************* + + .. flat-table:: ``Entity`` = ACTIVE, ``ENTNUM`` = 0 (or blank) + :header-rows: 2 + + * - :ref:`get`, ``Par``, ACTIVE, 0, ``Item1``, ``IT1NUM``, ``Item2``, ``IT2NUM`` + * - Item1 + - IT1NUM + - Description + * - ANTY + - + - Current analysis type. + * - :rspan:`27` SOLU + - DTIME + - Time step size. + * - NCMLS + - Cumulative number of load steps. + * - NCMSS + - Number of substeps. NOTE: Used only for static and transient analyses. + * - EQIT + - Number of equilibrium iterations. + * - NCMIT + - Cumulative number of iterations. + * - CNVG + - Convergence indicator: 0=not converged, 1=converged. + * - MXDVL + - Maximum degree of freedom value. + * - RESFRQ + - Response frequency for 2nd order systems. + * - RESEIG + - Response eigenvalue for 1st order systems. + * - DSPRM + - Descent parameter. + * - FOCV + - Force convergence value. + * - MOCV + - Moment convergence value. + * - HFCV + - Heat flow convergence value. + * - MFCV + - Magnetic flux convergence value. + * - CSCV + - Current segment convergence value. + * - CUCV + - Current convergence value. + * - FFCV + - Fluid flow convergence value. + * - DICV + - Displacement convergence value. + * - ROCV + - Rotation convergence value. + * - TECV + - Temperature convergence value. + * - VMCV + - Vector magnetic potential convergence value. + * - SMCV + - Scalar magnetic potential convergence value. + * - VOCV + - Voltage convergence value. + * - PRCV + - Pressure convergence value. + * - VECV + - Velocity convergence value. + * - CRPRAT + - Maximum creep ratio. + * - PSINC + - Maximum plastic strain increment. + * - CGITER + - Number of iterations in the PCG and symmetric JCG (non-complex version) solvers. + + + .. _get_sol_elem: + + \*GET Solution Items, Entity = ELEM + *********************************** + + .. flat-table:: ``Entity`` = ELEM, ``ENTNUM`` = 0 (or blank) + :header-rows: 2 + + * - :ref:`get`, ``Par``, ELEM, 0, ``Item1``, ``IT1NUM``, ``Item2``, ``IT2NUM`` + * - Item1 + - IT1NUM + - Description + * - MTOT + - X, Y, Z + - Total mass components. + * - MC + - X, Y, Z + - Center of mass components. + * - IOR + - X, Y, Z, XY, YZ, ZX + - Moment of inertia about origin. + * - IMC + - X, Y, Z, XY, YZ, ZX + - Moment of inertia about the center of mass. + * - IPRIN + - X, Y, Z + - Principal moments of inertia. + * - IANG + - XY, YZ, ZX + - Angles of the moments of inertia principal axes. + * - FMC + - X, Y, Z + - Force components at mass centroid ( :ref:`1). ` + * - MMOR + - X, Y, Z + - Moment components at origin ( :ref:`1).` + * - MMMC + - X, Y, Z + - Moment components at mass centroid ( :ref:`1).` + + Items ( :ref:`1) are available only after inertia relief solution ( ` :ref:`irlf`,1) + or pre-calculation of masses ( :ref:`irlf`,-1). + + Item values are consistent with the mass summary printed in the output file. They are based on + unscaled mass properties (see :ref:`mascale` command). + + .. _get_sol_mode: + + \*GET Solution Items, Entity = MODE + *********************************** + + .. flat-table:: ``Entity`` = MODE, ``ENTNUM`` = ``N`` (mode number) + :header-rows: 2 + + * - :ref:`get`, ``Par``, MODE, ``N``, ``Item1``, ``IT1NUM``, ``Item2``, ``IT2NUM`` + * - Item1 + - IT1NUM + - Description + * - FREQ + - + - Frequency of mode ``N``. Returned values are valid for modal analyses which calculate real eigensolutions. + * - STAB + - + - Stability value of mode ``N``. Returned values are valid for modal analyses which calculate complex eigensolutions. The stability value is the real part of the complex eigenvalue. It contains information on the mode damping in a damped modal analysis. + * - DFRQ + - + - Damped frequency of mode ``N``. Returned values are valid for modal analyses which calculate complex eigensolutions. The damped frequency is the imaginary part of the complex eigenvalue. + * - PFACT + - + - Participation factor of mode ``N``. * If retrieved after a modal analysis, the real part of the participation factor is returned unless ``IT1NUM`` = IMAG. The direction is specified using ``Item2`` = DIREC and ``IT2NUM`` = X, Y, Z, ROTX, ROTY, or ROTZ * If retrieved after a spectrum analysis, the spectrum number M is specified using ``Item2`` = SPECT and ``IT2NUM`` = M. For a PSD analysis with spatial correlation or wave excitation, the retrieved participation factors will correspond to the first degree of freedom that is excited. + * - EFFM + - + - Effective mass of mode ``N``. Returned values are valid only after a modal analysis with effective mass calculation has been solved. The direction is specified using ``Item2`` = DIREC and ``IT2NUM`` = X, Y, Z, ROTX, ROTY, or ROTZ. + * - GENM + - + - Generalized mass (also called modal mass) of mode ``N``. Returned values are valid only after a modal analysis with generalized mass calculation has been solved. + * - MCOEF + - + - Mode coefficient of mode ``N``. Returned values are valid only after a spectrum analysis has been solved. The spectrum number M is specified using ``Item2`` = SPECT and ``IT2NUM`` = M. In a SPRS analysis, the values returned are based on the curve with the lowest damping. After a PSD analysis, the diagonal of the dynamic modal covariance matrix is retrieved for the displacement solution. + * - DAMP + - + - Damping ratio of mode ``N``. If retrieved after a modal analysis that creates complex solutions (DAMP, QRDAMP, or UNSYM eigensolvers) returned value is calculated from the complex frequencies. If retrieved after a spectrum analysis, returned value is the effective damping ratio. Not a function of direction. Also retrievable following a harmonic analysis or transient analysis with mode-superposition. + + For all items except PFACT and MCOEF (as noted above), only the first 10000 values corresponding to + significant modes will be returned. + + The MODE file must be available to retrieve items PFACT and MCOEF with specified ``Item2``. If + ``Item2`` is not specified, the last calculated value will be returned. + + All values retrieved correspond to the first load step values. For a Campbell diagram analysis + (multistep modal), :ref:`get` with ``Entity`` = CAMP must be used. + + .. _get_sol_ddam: + + \*GET Solution Items, Entity = DDAM + *********************************** + + .. flat-table:: ``Entity`` = DDAM, ``ENTNUM`` = ``N`` (mode number) + :header-rows: 2 + + * - :ref:`get`, ``Par``,DDAM, ``N``, ``Item1``, ``IT1NUM`` + * - Item1 + - IT1NUM + - Description + * - DSHOCK + - + - Shock design value of mode ``N``. + + If multiple DDAM analyses are performed, the last calculated value will be returned. + + **Postprocessing Items** + + .. _gettabpost: + + \*GET Postprocessing Entity Items + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + + * :ref:`get_post_act` + + * :ref:`get_post_acus` + + * :ref:`get_post_camp` + + * :ref:`get_post_cint` + + * :ref:`get_post_cyccalc` + + * :ref:`get_post_elem` + + * :ref:`get_post_etab` + + * :ref:`get_post_fsum` + + * :ref:`get_post_gsresult` + + * :ref:`get_post_member` + + * :ref:`get_post_node` + + * :ref:`get_post_path` + + * :ref:`get_post_plnsol` + + * :ref:`get_post_prenergy` + + * :ref:`get_post_prerr` + + * :ref:`get_post_rad` + + * :ref:`get_post_rstmac` + + * :ref:`get_post_secr` + + * :ref:`get_post_section` + + * :ref:`get_post_sort` + + * :ref:`get_post_ssum` + + * :ref:`get_post_vari` + + * :ref:`get_prep_xfem` + + .. _get_post_act: + + \*GET Postprocessing Items, Entity = ACTIVE + ******************************************* + + .. flat-table:: ``Entity`` = ACTIVE, ``ENTNUM`` = 0 (or blank) + :header-rows: 2 + + * - :ref:`get`, ``Par``, ACTIVE, 0, ``Item1``, ``IT1NUM``, ``Item2``, ``IT2NUM`` + * - Item1 + - IT1NUM + - Description + * - :rspan:`4` SET + - LSTP + - Current load step number. + * - SBST + - Current substep number. + * - TIME + - Time associated with current results in the database. + * - FREQ + - Frequency (for ANTYPE=MODAL, HARMIC, SPECTR; load factor for ANTYPE=BUCKLE). + * - NSET + - If Item2 is blank, number of data sets on result file. * If Item2 = FIRST, IT2NUM = Loadstep, get set number of first substep of loadstep * If Item2 = LAST, IT2NUM = Loadstep, get set number of last substep of loadstep + * - RSYS + - + - Active results coordinate system. + + + .. _get_post_acus: + + \*GET Postprocessing Items, Entity = ACUS + ***************************************** + + .. flat-table:: ``Entity`` = ACUS, ``ENTNUM`` = 0 (or blank) + :header-rows: 2 + + * - :ref:`get`, ``Par``, ACUS, 0, ``Item1``, ``IT1NUM``, ``Item2``, ``IT2NUM`` + * - Item1 + - IT1NUM + - Description + * - PWL + - + - Radiated sound power level + * - PRES + - + - Far-field pressure at a given point + * - PHASE + - + - Far-field pressure phase at a given point + * - SPL + - + - Far-field sound pressure level at a given point + * - SPLA + - + - Far-field a-weighted sound pressure level at a given point + * - DG + - + - Far-field directivity at a given point + * - PS + - + - Far-field scattered pressure at a given point + * - TS + - + - Far-field target strength at a given point + * - DFIN + - + - Diffuse sound field incident power + * - SIMP + - + - Magnitude of specific acoustic impedance on the selected surface + * - AIMP + - + - Magnitude of acoustic impedance on the selected surface + * - MIMP + - + - Magnitude of mechanical impedance on the selected surface + * - APRES + - + - Magnitude of average pressure on the selected surface + * - FORC + - + - Magnitude of average force on the selected surface + * - POWER + - + - Acoustic power through the selected surface + * - BSPL + - + - SPL over frequency band + * - BSPA + - + - A-weighted SPL over frequency band + * - PWRF + - + - Reference sound power + * - TL + - + - Transmission loss + * - RL + - + - Return loss + * - Item1 = PWL, PRES, SPL, SPLA, PHASE, DG, PS, and TS are available after issuing the :ref:`prfar` or :ref:`plfar` command. The maximum values are obtained from the current command. Item1 = SIMP, AIMP, MIMP, APRES, FORC, POWER, TL, and RL are available after issuing the corresponding :ref:`pras` command at the current frequency. The values are obtained at the current frequency, or at the last frequency for multiple load step and substep cases. Item1 = DFIN is available after the diffuse sound field solution. + + + .. _get_post_camp: + + \*GET Postprocessing Items, Entity = CAMP + ***************************************** + + .. flat-table:: Available after :ref:`plcamp` or :ref:`prcamp` command is issued. ``Entity`` = CAMP, ``ENTNUM`` = ``N`` (mode number) + :header-rows: 2 + + * - :ref:`get`, ``Par``, CAMP, ``N``, ``Item1``, ``IT1NUM``, ``Item2``, ``IT2NUM`` + * - Item1 + - IT1NUM + - Description + * - NBMO + - + - Number of modes in the Campbell diagram ( ``ENTNUM`` not required). This value is the maximum value for ``N``. + * - NBST + - + - Number of steps in the Campbell diagram: modal load steps with rotational velocity ( ``ENTNUM`` not required). This value is the maximum value for ``M`` (see Item1 = FREQ). + * - WHRL + - ``M`` + - Whirl of mode ``N`` at step ``M`` : -1 is backward whirl, 1 is forward whirl, and 0 is undetermined. For default ``IT1NUM``, it corresponds to the whirl at the maximum rotational velocity. + * - VCRI + - + - Critical speed for mode ``N``. This value is available if an excitation is defined via the :ref:`plcamp` or :ref:`prcamp` command's ``SLOPE`` argument. (The unit of speed depends upon the ``UNIT`` value specified in those commands.) N does not correspond to the mode number if ``FREQB`` ( :ref:`prcamp` or :ref:`plcamp` command) is used. Instead, it represents the Nth mode number listed in the output of :ref:`prcamp` or :ref:`plcamp`. + * - FREQ + - ``M`` + - Natural frequency of mode (Hz) ``N`` at step ``M``. It represents the complex part of the eigenvalue. + * - STAB + - ``M`` + - Stability value (Hz) of mode ``N`` at step ``M``. It represents the real part of the eigenvalue. + * - UKEY + - ``M`` + - Instability key for mode ``N`` at step ``M`` : 0 is stable and 1 is unstable. For default ``IT1NUM``, it corresponds to the stability over the whole rotational velocity range. + * - VSTA + - + - Stability limit for mode N. This value is available when ``SLOPE`` is zero on the :ref:`plcamp` or :ref:`prcamp` command. (The unit of speed depends upon the ``UNIT`` value specified in those commands.) N does not correspond to the mode number if ``FREQB`` ( :ref:`prcamp` or :ref:`plcamp` command) is used. Instead, it represents the Nth mode number listed in the output of :ref:`prcamp` or :ref:`plcamp`. + + If the sorting is activated (Option= ``ON`` on the :ref:`prcamp` and :ref:`plcamp` commands), all + the parameters retrieved are in the sorted order. + + .. _get_post_cint: + + \*GET Postprocessing Items, Entity = CINT + ***************************************** + + .. flat-table:: ``Entity`` = CINT, ``ENTNUM`` = ``CrackId`` (required Crack ID number) + :header-rows: 2 + + * - :ref:`get`, ``Par``, CINT, ``CrackId``, ``Item1``, ``IT1NUM``, ``Item2``, ``IT2NUM`` + * - Item1 + - IT1NUM + - Description + * - CTIP + - ctnum + - ``IT1NUM`` = Crack tip node number (required) ``Item2`` = CONTOUR ``IT2NUM`` = Contour number (default 1) Returns JINT value if crack ID is JINT type; otherwise, returns 0. ``Item1`` defaults to CTIP, ``Item2`` defaults to CONTOUR. + * - **Entity= CINT,** ``ENTNUM`` = CrackID (required Crack ID number) + * - **\*GET ,** ``Par``, CINT, ``CrackId``, ``Item1``, ``IT1NUM``, ``Item2``, ``IT2NUM``, ``Item3``, ``IT3NUM``, ``Item4``, ``IT4NUM`` + * - **Item1** + - **IT1NUM** + - **Description** + * - CTIP + - ctnum + - ``IT1NUM`` = Crack tip node number (required) ``Item2`` = CONTOUR ``IT2NUM`` = Contour number (default 1) ``Item3`` = DTYPE ``IT3NUM`` = Data type (JINT, IIN1, IIN2, IIN3, K1, K2, K3, G1, G2, G3, GT, MFTX, MFTY, MFTZ, TSTRESS, CEXT, STTMAX, PSMAX, CSTAR, DLTA, DLTN, DLTK, R, UFAC, CRDX, CRDY, CRDZ, and APOS) FOR ``IT3NUM`` = STTMAX or PSMAX: * Item4 = AINDEX (angle index) * IT4NUM = Index value (1 to N+1; N = Maximum number of intervals for the sweep ( :ref:`cint`,RSWEEP). Returns specified data type value. FOR ``IT3NUM`` = DLTA, DLTN, DLTK, R, UFAC, CRDX, CRDY, CRDZ, APOS: * Set ``IT2NUM`` = 1 Returns specified data type value. ``Item1`` defaults to CTIP, ``Item2`` defaults to CONTOUR, ``Item3`` defaults to DTYPE. DLTK in a 3D XFEM-based fatigue crack-growth analysis is evaluated based on the smoothed SIFS values. The actual DLTK value can be easily calculated by issuing :ref:`get` for SIFS values and the stress (load) ratio. + * - **Entity= CINT,** ``ENTNUM`` = CrackID (required Crack ID number) + * - **\*GET ,** ``Par``, CINT, ``CrackId``, ``Item1``, ``IT1NUM``, ``Item2``, ``IT2NUM`` , + * - **Item1** + - **IT1NUM** + - **Description** + * - NNOD + - + - Maximum number of nodes along the crack front. + * - **Entity= CINT,** ``ENTNUM`` = CrackID (required Crack ID number) + * - **\*GET ,** ``Par``, CINT, ``CrackId``, ``Item1``, ``IT1NUM``, ``Item2``, ``IT2NUM`` + * - **Item1** + - **IT1NUM** + - **Description** + * - NODE + - ipos + - IT1NUM = Position along the crack front (from 1 to NNOD). Default = 1. Returns node number at the given position along the crack front. (For XFEM, an internal node number is returned.) + + + .. _get_post_cyccalc: + + \*GET Postprocessing Items, Entity = CYCCALC + ******************************************** + + .. flat-table:: ``Entity`` = CYCCALC, ``ENTNUM`` = :ref:`cycspec` specification number Generate date for cyclic results using :ref:`cyccalc` before retrieving those items. + :header-rows: 2 + + * - :ref:`get`, ``Par``,CYCCALC, ``spec``, ``Item1``, ``IT1NUM``, ``Item2``, ``IT2NUM`` + * - Item1 + - IT1NUM + - Item2 + - IT2NUM + - Description + * - :rspan:`3` FREQ + - :rspan:`3` frequency point + - SECTOR + - sector + - :ref:`cycspec` result at the IT1NUM frequency and IT2NUM sector + * - SECMAX + - - + - :ref:`cycspec` maximum result at the IT1NUM frequency + * - SECNUM + - - + - :ref:`cycspec` sector with the maximum result at the IT1NUM frequency + * - SECNODE + - - + - :ref:`cycspec` node in the sector with the maximum result at the IT1NUM frequency + * - The frequency point refers to the harmonic solution data set number (NSET on the :ref:`set` command) + + + .. _get_post_elem: + + \*GET Postprocessing Items, Entity = ELEM + ***************************************** + + .. flat-table:: ``Entity`` = :ref:`elem`, ``ENTNUM`` = ``N`` (element number) + :header-rows: 2 + + * - :ref:`get`, ``Par``, ELEM, ``N``, ``Item1``, ``IT1NUM``, ``Item2``, ``IT2NUM`` + * - Item1 + - IT1NUM + - Description + * - SERR Some element- and material-type limitations apply. For more information, see the documentation for the :ref:`prerr` command. + - + - Structural error energy. + * - SDSG + - + - Absolute value of the maximum variation of any nodal stress component. + * - TERR + - + - Thermal error energy. + * - TDSG + - + - Absolute value of the maximum variation of any nodal thermal gradient component. + * - SENE + - + - "Stiffness" energy or thermal heat dissipation. Same as TENE. + * - TENE + - + - Thermal heat dissipation or "stiffness" energy. Same as SENE. + * - KENE + - + - Kinetic energy. + * - ASENE + - + - Amplitude “stiffness” energy. + * - PSENE + - + - Peak “stiffness” energy. + * - AKENE + - + - Amplitude kinetic energy. + * - PKENE + - + - Peak kinetic energy. + * - DENE + - + - Damping energy. + * - WEXT WEXT is calculated for element-based loading only (and not for nodal-force loading). WEXT is stored on elements to which loading has been applied; if surface elements are added on top of other elements, for example, and pressure loading is applied to the surface elements, WEXT is available for the surface elements only. + - + - Work due to external load. + * - JHEAT + - + - Element Joule heat generation (coupled-field calculation). + * - JS + - X, Y, Z + - Source current density (coupled-field calculation) in the global Cartesian coordinate system. + * - HS + - X, Y, Z + - Average element magnetic field intensity from current sources. + * - VOLU + - + - Element volume, as calculated during solution. + * - ETAB + - ``Lab`` + - Value of element table item ``Lab`` for element ``N`` (see :ref:`etable` command). + * - EFOR + - ``Nnum`` + - Element force at node ``Nnum``. The force label is specified using Item2 = FX, FY, FZ, MX, MY, MZ, or HEAT. In a dynamics analysis, the element forces returned are based on the type of force requested. It is specified using the :ref:`force` command for all dynamics analyses, except for spectrum analyses where ``ForceType`` is used on the combination commands ( :ref:`srss`, :ref:`psdcom`, etc.). + * - SMISC + - ``Snum`` + - Value of element summable miscellaneous data at sequence number ``Snum`` (as used on :ref:`etable` command). + * - NMISC + - ``Snum`` + - Value of element non-summable miscellaneous data at sequence number ``Snum`` (as used on :ref:`etable` command). + * - FSOU + - + - Element fluid flow source loading (poromechanics). + + + .. _get_post_etab: + + \*GET Postprocessing Items, Entity = ETAB + ***************************************** + + .. flat-table:: ``Entity`` = ETAB, ``ENTNUM = N`` (column number) + :header-rows: 2 + + * - :ref:`get`, ``Par``, ETAB, ``N``, ``Item1``, ``IT1NUM``, ``Item2``, ``IT2NUM`` + * - Item1 + - IT1NUM + - Description + * - LAB + - + - Label for column ``N`` of the element table ( :ref:`etable` ). Returns a character parameter. + * - ELEM + - ``E`` + - Value in :ref:`etable` column ``N`` for element number ``E``. + + + .. _get_post_fsum: + + \*GET Postprocessing Items, Entity = FSUM + ***************************************** + + .. flat-table:: ``Entity`` = :ref:`fsum`, ``ENTNUM`` = 0 (or blank) + :header-rows: 2 + + * - :ref:`get`, ``Par``, FSUM, 0, ``Item1``, ``IT1NUM``, ``Item2``, ``IT2NUM`` + * - Item1 + - IT1NUM + - Description + * - ITEM + - ``Lab`` + - Value of item ``Lab`` from last :ref:`fsum` command. Valid labels are FX, FY, FZ, MX, MY, MZ, FLOW, HEAT, FLUX, etc. + + + .. _get_post_gsresult: + + \*GET Postprocessing Items, Entity = GSRESULT + ********************************************* + + .. flat-table:: ``Entity`` = GSRESULT, ``ENTNUM`` = 0 (or blank) for generalized plane strain results in fiber direction + :header-rows: 2 + + * - :ref:`get`, ``Par``, GSRESULT, 0, ``Item1``, ``IT1NUM`` + * - Item1 + - IT1NUM + - Description + * - LFIBER + - + - Fiber length change at ending point. + * - ROT + - X,Y + - Rotation angle of end plane about X or Y axis. + * - F + - + - Reaction force at ending point. + * - M + - X,Y + - Reaction moment on ending plane. + + + .. _get_post_member: + + \*GET Postprocessing Items, Entity = MEMBER + ******************************************* + + .. flat-table:: ``Entity`` = MEMBER, ``ENTNUM`` = ``N`` (GroupID) + :header-rows: 2 + + * - :ref:`get`, ``Par``,MEMBER, ``N``, ``Item1``, ``IT1NUM`` + * - Item1 + - IT1NUM + - Description + * - TEMP + - MIN, MAX + - Minimum or maximum temperature of members (individual reinforcings) with GroupID = ``N`` in the selected set of reinforcing elements. + + + .. _get_post_node: + + \*GET Postprocessing Items, Entity = NODE + ***************************************** + + .. flat-table:: ``Entity`` = ``NODE``, ``ENTNUM`` = ``N`` (node number) for nodal degree-of-freedom results: + :header-rows: 2 + + * - :ref:`get`, ``Par``, NODE, ``N``, ``Item1``, ``IT1NUM``, ``Item2``, ``IT2NUM`` + * - Item1 + - IT1NUM + - Description + * - U + - X, Y, Z, SUM + - X, Y, or Z structural displacement or vector sum. Alternative get functions: UX( ``N`` ), UY( ``N`` ), UZ( ``N`` ). + * - ROT + - X, Y, Z, SUM + - X, Y, or Z structural rotation or vector sum. Alternative get functions: ROTX( ``N`` ), ROTY( ``N`` ), ROTZ( ``N`` ). + * - TEMP + - + - Temperature. For ``SHELL131`` and ``SHELL132`` elements with KEYOPT(3) = 0 or 1, use TBOT, TE2, TE3,..., TTOP instead of TEMP. Alternative get functions: TEMP( ``N`` ), TBOT( ``N`` ), TE2( ``N`` ), etc. + * - PRES + - + - Pressure. Alternative get function: PRES( ``N`` ). + * - GFV1, GFV2, GFV3 + - + - Nonlocal field values 1, 2, and 3. + * - VOLT + - + - Electric potential. Alternative get function: VOLT( ``N`` ). + * - CONC + - + - Concentration. + * - MAG + - + - Magnetic scalar potential. Alternative get function: MAG( ``N`` ). + * - V + - X, Y, Z, SUM + - X, Y, or Z fluid velocity or vector sum in a fluid analysis. X, Y, or Z nodal velocity or vector sum in a structural transient analysis (analysis with :ref:`antype`,TRANS). Alternative get functions: VX( ``N`` ), VY( ``N`` ), VZ( ``N`` ). + * - A + - X, Y, Z, SUM + - X, Y, or Z magnetic vector potential or vector sum in an electromagnetic analysis. X, Y, or Z nodal acceleration or vector sum in a structural transient analysis (analysis with :ref:`antype`,TRANS). Alternative get functions: AX( ``N`` ), AY( ``N`` ), AZ( ``N`` ). + * - CURR + - + - Current. + * - EMF + - + - Electromotive force drop. + * - RF + - FX, FY, FZ, MX, MY, MZ, CSGZ, BMOM, RATE, DVOL, FLOW, HEAT, AMPS or CHRG, FLUX, CURT, VLTG + - Nodal reaction forces in the nodal coordinate system. The reaction forces returned are the total forces: static, plus damping, plus inertial, as appropriate based on analysis type (see :ref:`prrsol` command). The first exception is modal analyses and mode-superposition transient analyses where static forces are returned. The second exception is spectrum analyses where the :ref:`prrfor` logic is used internally. In this case, the reaction forces are based on the type of force requested (using ``ForceType`` with combination commands, such as :ref:`srss`, :ref:`psdcom`, etc.). + * - ORBT + - A, B, PSI, PHI, YMAX, ZMAX, Whirl + - Whirl orbit characteristics: * A is the semi-major axis. * B is the semi-minor axis. * PSI is the angle between the local axis y and the major axis Y. * PHI is the angle between initial position (t = 0) and major axis. * YMAX is the maximum displacement along local y axis. * ZMAX is the maximum displacement along local z axis. * Whirl is the direction of an orbital motion (-1 is backward whirl, 1 is forward whirl, and 0 is undetermined). Angles PSI and PHI are in degrees and within the range of -180 through +180. Orbits are available only after issuing a :ref:`prorb` command. + * - Use this command carefully when N represents an internal node, as the nodal degrees of freedom may have different physical meanings. + + + .. _get_post_path: + + \*GET Postprocessing Items, Entity = PATH + ***************************************** + + .. flat-table:: Entity = PATH, ``ENTNUM`` = 0 (or blank) + :header-rows: 2 + + * - :ref:`get`, ``Par``, PATH, 0, ``Item1``, ``IT1NUM``, ``Item2``, ``IT2NUM`` + * - Item1 + - IT1NUM + - Description + * - MAX + - ``Lab`` + - Maximum value of path item ``Lab`` from last path operation. Valid labels are the user-defined labels on the :ref:`pdef` or :ref:`pcalc` command. + * - MAXPATH + - + - Returns the maximum path number defined. + * - MIN + - ``Lab`` + - Minimum value of path item ``Lab`` from last path operation. Valid labels are the user-defined labels on the :ref:`pdef` or :ref:`pcalc` command. + * - LAST + - ``Lab`` + - Last value of path item ``Lab`` from last path operation. Valid labels are the user-defined labels on the :ref:`pdef` or :ref:`pcalc` command. + * - NODE + - + - Value providing the number of nodes defining the path referenced in the last path operation. + * - ITEM + - ``Lab`` + - **Item2** = PATHPT, **IT2NUM** = n The value of ``Lab`` at the ``n`` th data point from the last path operation. + * - POINT + - ``n`` + - **Item2** = X,Y,Z, or CSYS. Returns information about the nth point on the current path. + * - NVAL + - + - The number of path data points (the length of the data table) from the last path operation. + * - SET + - ``n`` + - **Item2** = NAME. Returns the name of the n th data set on the current path. + * - NUMPATH + - + - Returns the number of paths defined. + + + .. _get_post_plnsol: + + \*GET Postprocessing Items, Entity = PLNSOL + ******************************************* + + .. flat-table:: ``Entity`` = :ref:`plnsol` You must issue the :ref:`show` command before commands that produce a graphical output when running in batch mode to produce/export graphic files. For more details, see `External Graphics Options `_, ``ENTNUM`` = 0 (or blank) + :header-rows: 2 + + * - :ref:`get`, ``Par``, PLNSOL, 0, ``Item1``, ``IT1NUM``, ``Item2``, ``IT2NUM`` + * - Item1 + - IT1NUM + - Description + * - MAX + - + - Maximum value of item in last contour display ( :ref:`plnsol`, :ref:`plesol` ). + * - MIN + - + - Minimum value of item in last contour display ( :ref:`plnsol`, :ref:`plesol` ). + * - BMAX + - + - Maximum bound value of item in last contour display ( :ref:`plnsol`, :ref:`plesol` ). + * - BMIN + - + - Minimum bound value of item in last contour display ( :ref:`plnsol`, :ref:`plesol` ). + + + .. _get_post_prenergy: + + \*GET Postprocessing Items, Entity = PRENERGY + ********************************************* + + .. flat-table:: Available after the :ref:`prenergy` command is issued. ``Entity`` = PRENERGY, ``ENTNUM`` = ``N`` (component number) + :header-rows: 2 + + * - :ref:`get`, ``Par``, PRENERGY, ``N``, ``Item1``, ``IT1NUM`` + * - Item1 + - IT1NUM + - Description + * - NCMP + - + - Number of components ( ``ENTNUM`` not required). This value is the maximum value for ``N``. + * - NENE + - + - Number of energy types ( ``ENTNUM`` not required). This value is the maximum value for ``M``. + * - TOTE + - ``M`` + - Total energy of type ``M`` of the model ( ``ENTNUM`` not required). Energy value is non-zero when ``Cname1`` is blank on prior :ref:`prenergy` command. + * - ENG + - ``M`` + - Energy of type ``M`` of component ``N``. Energy value is non-zero when ``Cname1`` is specified on prior :ref:`prenergy` command. + * - PENG + - ``M`` + - Percentage of energy of type ``M`` of component ``N``. Percentage of energy value is non-zero when ``Cname1`` is specified on prior :ref:`prenergy` command. + * - Ordering of ``N`` and ``M`` corresponds to :ref:`prenergy` output. + + + .. _get_post_prerr: + + \*GET Postprocessing Items, Entity = PRERR + ****************************************** + + .. flat-table:: ``Entity`` = PRERR, ``ENTNUM`` = 0 (or blank) + :header-rows: 2 + + * - :ref:`get`, ``Par``, PRERR, 0, ``Item1``, ``IT1NUM``, ``Item2``, ``IT2NUM`` + * - Item1 + - IT1NUM + - Description + * - SEPC[ :ref:`starget_prerr_limits` ] + - + - Structural percent error in energy norm ( :ref:`prerr` ). + * - TEPC[ :ref:`starget_prerr_limits` ] + - + - Thermal percent error in energy norm ( :ref:`prerr` ). + * - SERSM[ :ref:`starget_prerr_limits` ] + - + - Structural error energy summation ( :ref:`prerr` ). + * - TERSM[ :ref:`starget_prerr_limits` ] + - + - Thermal error energy summation ( :ref:`prerr` ). + * - SENSM[ :ref:`starget_prerr_limits` ] + - + - Structural energy summation ( :ref:`prerr` ). + * - TENSM[ :ref:`starget_prerr_limits` ] + - + - Thermal energy summation ( :ref:`prerr` ). + + .. _starget_prerr_limits: + + Some element- and material-type limitations apply. For more information, see the documentation for + the :ref:`prerr` command. + + .. _get_post_rad: + + \*GET Postprocessing Items, Entity = RAD + **************************************** + + .. flat-table:: ``Entity`` = RAD, ENTNUM = 0 (or blank) + :header-rows: 2 + + * - :ref:`get`, ``Par``, RAD, 0, ``Item1``, ``IT1NUM``, ``Item2``, ``IT2NUM`` + * - Item1 + - IT1NUM + - Description + * - VFAVG + - + - Value of the average view factor computed from the previous VFQUERY command. + + + .. _get_post_rstmac: + + \*GET Postprocessing Items, Entity = RSTMAC + ******************************************* + + .. flat-table:: Available after :ref:`rstmac` command is issued. ``Entity`` = :ref:`rstmac`, ``ENTNUM`` = ``N`` (solution number on ``File1`` ) + :header-rows: 2 + + * - :ref:`get`, ``Par``, RSTMAC, 0 or ``N``, ``Item1``, ``IT1NUM``, ``Item2``, ``IT2NUM`` + * - Item1 + - IT1NUM + - Description + * - NS1 + - + - Total number of solutions (modes for example) read on ``File1``. See ``Sbstep1`` on the :ref:`rstmac` command. This value is the maximum value for ``N``. + * - NS2 + - + - Total number of solutions (modes for example) read on ``File2``. See ``Sbstep2`` on the :ref:`rstmac` command. This value is the maximum value for ``M`` + * - MAC + - M + - Modal assurance criterion value (MAC) between the solution ``N`` read on ``File1`` and the solution ``M`` read on ``File2``. ``N`` and ``M`` do not correspond to the substep (or mode) numbers if NS1 and NS2 are different from the total number of substeps (or modes). + * - MACCYC + - M + - Modal assurance criterion value (MAC) from compressed table for :ref:`cyclic` between the solution ``N`` read on ``File1`` and the solution ``M`` read on ``File2``. ``N`` and ``M`` do not correspond to the substep (or mode) numbers if NS1 and NS2 are different from the total number of substeps (or modes). + + + .. _get_post_secr: + + \*GET Postprocessing Items, Entity = SECR + ***************************************** + + .. flat-table:: ``Entity`` = SECR, ``ENTNUM`` = ``n`` (element number) For beam and pipe (including elbow) section results, return values for all elements if the element number ( ``n`` ) is blank or ALL. + :header-rows: 2 + + * - :ref:`get`, ``Par``, SECR, n, ``Item1``, ``IT1NUM``, ``Item2``, ``IT2NUM`` + * - Item1 + - IT1NUM + - Description + - Item2 + - IT2NUM + * - :rspan:`3` S + - X, Y, Z, XY, YZ, XZ + - Component total stress + - :rspan:`39` MAX - Returns maximum MIN - Returns minimum MAXY - Returns section Y location of maximum MAXZ - Returns section Z location of maximum MINY - Returns section Y location of minimum MINZ - Returns section Z location of minimum IVAL - Returns value at node or integration point at element I node JVAL - Returns value at node or integration point at element J node KVAL - Returns value at node or integration point at element K node ( ``ELBOW290`` ) --- **For IVAL, JVAL, and KVAL:** The ALL (or blank) option for the element number is not valid. You must specify an element ( **n** ). + - :rspan:`39` These values are applicable only when Item2 = IVAL, JVAL, or KVAL: When KEYOPT(15) = 0, this value is the section node number (which can be visualized via :ref:`secplot`,,2). When KEYOPT(15) = 1 (or when using elbow elements), this value is the integration point number. + * - 1, 2, 3 + - Principal stress value + * - INT + - Stress intensity value + * - EQV + - Equivalent stress value + * - :rspan:`3` EPTO + - X, Y, Z, XY, YZ, XZ + - Component total strain + * - 1, 2, 3 + - Principal total strain value + * - INT + - Total strain intensity value + * - EQV + - Equivalent total strain value + * - :rspan:`3` EPEL + - X, Y, Z, XY, YZ, XZ + - Component elastic strain + * - 1, 2, 3 + - Principal elastic strain value + * - INT + - Elastic strain intensity value + * - EQV + - Equivalent elastic strain value + * - :rspan:`3` EPTH + - X, Y, Z, XY, YZ, XZ + - Component thermal strain + * - 1, 2, 3 + - Principal thermal strain value + * - INT + - Thermal strain intensity value + * - EQV + - Equivalent thermal strain value + * - :rspan:`3` EPPL + - X, Y, Z, XY, YZ, XZ + - Component plastic strain + * - 1, 2, 3 + - Principal plastic strain value + * - INT + - Plastic strain intensity value + * - EQV + - Equivalent plastic strain value + * - :rspan:`3` EPCR + - X, Y, Z, XY, YZ, XZ + - Component creep strain + * - 1, 2, 3 + - Principal component creep strain value + * - INT + - Component creep strain intensity value + * - EQV + - Equivalent component creep strain value + * - :rspan:`3` EPTT + - X, Y, Z, XY, YZ, XZ + - Component total mechanical and thermal and swelling strain + * - 1, 2, 3 + - Principal total mechanical and thermal and swelling strain value + * - INT + - Total mechanical and thermal and swelling strain intensity value + * - EQV + - Equivalent total mechanical and thermal and swelling strain value + * - :rspan:`3` EPDI + - X, Y, Z, XY, YZ, XZ + - Component diffusion strain + * - 1, 2, 3 + - Principal diffusion strain value + * - INT + - Diffusion strain intensity value + * - EQV + - Equivalent diffusion strain value + * - :rspan:`5` NL + - SEPL + - Plastic yield stress + * - SRAT + - Plastic yielding (1 = actively yielding, 0 = not yielding) + * - HPRES + - Hydrostatic pressure + * - EPEQ + - Accumulated equivalent plastic strain + * - CREQ + - Accumulated equivalent creep strain + * - PLWK + - Plastic work/volume + * - YSIDX + - TENS,SHEA + - Yield surface activity status: 1 for yielded and 0 for not yielded. + * - FPIDX + - TF01,SF01, TF02,SF02, TF03,SF03, TF04,SF04 + - Failure plane surface activity status: 1 for yielded and 0 for not yielded. Tension and Shear failure status are available for all four sets of failure planes. + + + .. _get_post_section: + + \*GET Postprocessing Items, Entity = SECTION + ******************************************** + + .. flat-table:: ``Entity`` = SECTION, ``ENTNUM`` = ``component`` (listed below). Generate data for section stress results, using :ref:`prsect` before retrieving these items. Valid labels for ``ENTNUM`` are MEMBRANE, BENDING, SUM (Membrane+Bending), PEAK, and TOTAL. (The following items are not stored in the database and the values returned reflect the last quantities generated by :ref:`prsect` or :ref:`plsect`.) Only MEMBRANE, BENDING, and SUM data are available after a :ref:`plsect` command. The MEMBRANE label is only valid with ``Item1`` = INSIDE. + :header-rows: 2 + + * - :ref:`get`, ``Par``, SECTION, ``component``, ``Item1``, ``IT1NUM``, ``Item2``, ``IT2NUM`` + * - Item1 + - IT1NUM + - Item2 + - Description + * - :rspan:`2` INSIDE + - :rspan:`2` S + - X, Y, Z, XY, YZ, XZ + - Stress component at beginning of path. + * - 1, 2, 3 + - Principal stress at beginning of path. + * - INT, EQV + - Stress intensity or equivalent stress at beginning of path. + * - :rspan:`2` CENTER + - :rspan:`2` S + - X, Y, Z, XY, YZ, XZ + - Stress component at midpoint of path. + * - 1, 2, 3 + - Principal stress at midpoint of path. + * - INT, EQV + - Stress intensity or equivalent stress at midpoint of path. + * - :rspan:`2` OUTSIDE + - :rspan:`2` S + - X, Y, Z, XY, YZ, XZ + - Stress component at end of path. + * - 1, 2, 3 + - Principal stress at end of path. + * - INT, EQV + - Stress intensity or equivalent stress at end of path. + + + .. _get_post_sort: + + \*GET Postprocessing Items, Entity = SORT + ***************************************** + + .. flat-table:: ``Entity`` = SORT, ``ENTNUM`` = 0 (or blank) + :header-rows: 2 + + * - :ref:`get`, ``Par``, SORT, 0, ``Item1``, ``IT1NUM``, ``Item2``, ``IT2NUM`` + * - Item1 + - IT1NUM + - Description + * - MAX + - + - Maximum value of last sorted item ( :ref:`nsort` or :ref:`esort` command). + * - MIN + - + - Minimum value of last sorted item ( :ref:`nsort` or :ref:`esort` command). + * - IMAX + - + - Node/Element number where maximum value occurs. + * - IMIN + - + - Node/Element number where minimum value occurs. + + + .. _get_post_ssum: + + \*GET Postprocessing Items, Entity = SSUM + ***************************************** + + .. flat-table:: ``Entity`` = SSUM, ``ENTNUM`` = 0 (or blank) + :header-rows: 2 + + * - :ref:`get`, ``Par``, SSUM, 0, ``Item1``, ``IT1NUM``, ``Item2``, ``IT2NUM`` + * - Item1 + - IT1NUM + - Description + * - ITEM + - ``Lab`` + - Value of item ``Lab`` from last :ref:`ssum` command. Valid labels are the user-defined labels on the :ref:`etable` command. + + + .. _get_post_vari: + + \*GET Postprocessing Items, Entity = VARI + ***************************************** + + .. flat-table:: ``Entity`` = VARI, ``ENTNUM`` = ``N`` (variable number after POST26 data storage) (for complex values, only the real part is returned with Item1 = EXTREM) + :header-rows: 2 + + * - :ref:`get`, ``Par,VARI,N``, ``Item1``, ``IT1NUM``, ``Item2``, ``IT2NUM`` + * - Item1 + - IT1NUM + - Description + * - :rspan:`6` EXTREM + - VMAX + - Maximum extreme value. + * - TMAX + - Time or frequency corresponding to VMAX. + * - VMIN + - Minimum extreme value. + * - TMIN + - Time or frequency corresponding to VMIN. + * - VLAST + - Last value. + * - TLAST + - Time or frequency corresponding to VLAST. + * - CVAR + - Covariance + * - REAL + - f + - Real part of variable ``N`` at time or frequency f. + * - IMAG + - f + - Imaginary part of variable ``N`` at frequency f. + * - AMPL + - f + - Amplitude value of variable ``N`` at frequency f + * - PHASE + - f + - Phase angle value of variable ``N`` at frequency f + * - RSET + - ``Snum`` + - Real part of variable ``N`` at location ``Snum``. + * - ISET + - ``Snum`` + - Imaginary part of variable ``N`` at location ``Snum``. + + + .. _get_prep_xfem: + + \*GET Postprocessing Items, Entity = XFEM + ***************************************** + + .. flat-table:: ``Entity`` = XFEM, ``ENTNUM`` = 0 (or blank) + :header-rows: 2 + + * - :ref:`get`, ``Par``, XFEM, 0, ``Item1``, ``IT1NUM`` + * - Item1 + - IT1NUM + - Description + * - STAT + - ``Element Number`` + - Status of the element: 0 = uncracked, 1 = cracked + + """ + command = f"*GET,{par},{entity},{entnum},{item1},{it1num},{item2},{it2num}" + return self.run(command, **kwargs) + + def inquire(self, strarray: str = "", func: str = "", **kwargs): + r"""Returns system information to a parameter. + + Mechanical APDL Command: `/INQUIRE `_ + + Parameters + ---------- + strarray : str + Name of the "string array" parameter that will hold the returned values. String array parameters + are similar to character arrays, but each array element can be as long as 248 characters. If the + string parameter does not exist, it will be created. + + func : str + Specifies the type of file information returned: + + * ``EXIST`` - Returns a 1 if the specified file exists, and 0 if it does not. + + * ``DATE`` - Returns the date stamp of the specified file in the format ``yyyymmdd.hhmmss``. + + * ``SIZE`` - Returns the size of the specified file in MB. + + * ``WRITE`` - Returns the status of the write attribute. A 0 denotes no write permission while a 1 + denotes write permission. + + * ``READ`` - Returns the status of the read attribute. A 0 denotes no read permission while a 1 + denotes read permission. + + * ``EXEC`` - Returns the status of the execute attribute (this has meaning only on Linux). A 0 + denotes no execute permission while a 1 denotes execute permission. + + * ``LINES`` - Returns the number of lines in an ASCII file. + + Notes + ----- + + .. warning:: + + This function contains specificities regarding the argument definitions. + Please refer to the `command documentation `_ + for further explanations. + + **Argument Descriptions** + + .. _s-INQUIRE_argdescript: + + * ``strarray : str`` - Name of the "string array" parameter that will hold the returned values. + String array parameters are similar to character arrays, but each array element can be as long as + 248 characters. If the string parameter does not exist, it will be created. + + * ``func : str`` - Specifies the type of system information returned: + + * ``LOGIN`` - Returns the pathname of the login directory on Linux systems or the pathname of the + default directory (including drive letter) on Windows systems. + + * ``DOCU`` - Returns the pathname of the Mechanical APDL docu directory. + + * ``APDL`` - Returns the pathname of the Mechanical APDL APDL directory. + + * ``PROG`` - Returns the pathname of the Mechanical APDL executable directory. + + * ``AUTH`` - Returns the pathname of the directory in which the license file resides. + + * ``USER`` - Returns the name of the user currently logged-in. + + * ``DIRECTORY`` - Returns the pathname of the current directory. + + * ``JOBNAME`` - Returns the current ``Jobname``. + + * ``RSTDIR`` - Returns rst directory ( ``FILE`` command). + + * ``RSTFILE`` - Returns rst file name ( ``FILE`` command). + + * ``RSTEXT`` - Returns rst file extension ( ``FILE`` command). + + * ``PSEARCH`` - Returns path used for "unknown command" macro ( :ref:`psearch` command). + + * ``OUTPUT`` - Returns the current output file name ( :ref:`output` command). + + Returning the Value of an Environment Variable to a Parameter + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + + If ``FUNC`` =ENV, the command format is :ref:`inquire`, ``StrArray``,ENV, ``ENVNAME``, + ``Substring``. In this instance, ENV specifies that the command should return the value of an + environment variable. The following defines the remaining fields: + + * ``envname : str`` - Specifies the name of the environment variable. + + * ``substring : str`` - If ``Substring`` = 1, the first substring (up to the first colon (:)) is + returned. If ``Substring`` = 2, the second substring is returned, etc. For Windows platforms, the + separating character is semicolon (;). If this argument is either blank or 0, the entire value of + the environment variable is returned. + + Returning the Value of a Title to a Parameter + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + + If ``FUNC`` = TITLE, the command format is :ref:`inquire`, ``StrArray``,TITLE, ``Title_num``. In + this context, the value of ``Title_num`` can be blank or 1 through 5. If the value is 1 or blank, + the title is returned. If the value is 2 through 5, a corresponding subtitle is returned (2 denoting + the first subtitle, and so on). + + Returning Information About a File to a Parameter + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + + The :ref:`inquire` command can also return information about specified files within the file system. + For these capabilities, the format is :ref:`inquire`, ``Parameter``, ``FUNC``,``Fname``, ``Ext``, + ``--``. The + following defines the fields: + + * ``parameter : str`` - Name of the parameter that will hold the returned values. + + * ``func : str`` - Specifies the type of file information returned: + + * ``EXIST`` - Returns a 1 if the specified file exists, and 0 if it does not. + + * ``DATE`` - Returns the date stamp of the specified file in the format ``yyyymmdd.hhmmss``. + + * ``SIZE`` - Returns the size of the specified file in MB. + + * ``WRITE`` - Returns the status of the write attribute. A 0 denotes no write permission while a 1 + denotes write permission. + + * ``READ`` - Returns the status of the read attribute. A 0 denotes no read permission while a 1 + denotes read permission. + + * ``EXEC`` - Returns the status of the execute attribute (this has meaning only on Linux). A 0 + denotes no execute permission while a 1 denotes execute permission. + + * ``LINES`` - Returns the number of lines in an ASCII file. + + * ``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. + * ``ext : str`` - Filename extension (eight-character maximum). + + .. _s-INQUIRE_notes: + + The :ref:`inquire` command is valid in any processor. + """ + command = f"/INQUIRE,{strarray},{func}" + return self.run(command, **kwargs) + + def parres(self, lab: str = "", fname: str = "", ext: str = "", **kwargs): + r"""Reads parameters from a file. + + Mechanical APDL Command: `PARRES `_ + + Parameters + ---------- + lab : str + Read operation: + + * ``NEW`` - Replace current parameter set with these parameters (default). + + * ``CHANGE`` - Extend current parameter set with these parameters, replacing any that already exist. + + 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 :file:`Jobname`. + + ext : str + Filename extension (eight-character maximum). The extension defaults to PARM if ``Fname`` is + blank. + + Notes + ----- + + .. warning:: + + This function contains specificities regarding the argument definitions. + Please refer to the `command documentation `_ + for further explanations. + + **Argument Descriptions** + + .. _PARRES_argdescript: + + * ``lab : str`` - Read operation: + + * ``NEW`` - Replace current parameter set with these parameters (default). + + * ``CHANGE`` - Extend current parameter set with these parameters, replacing any that already exist. + + * ``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 :file:`Jobname`. + + * ``ext : str`` - Filename extension (eight-character maximum). The extension defaults to PARM if + ``Fname`` is blank. + + .. _PARRES_notes: + + Reads parameters from a coded file. The parameter file may have been written with the :ref:`parsav` + command. The parameters read may replace or change the current parameter set. + + This command is valid in any processor. + """ + command = f"PARRES,{lab},{fname},{ext}" + return self.run(command, **kwargs) + + def parsav(self, lab: str = "", fname: str = "", ext: str = "", **kwargs): + r"""Writes parameters to a file. + + Mechanical APDL Command: `PARSAV `_ + + Parameters + ---------- + lab : str + Write operation: + + * ``SCALAR`` - Write only scalar parameters (default). + + * ``ALL`` - Write scalar and array parameters. Parameters may be numeric or alphanumeric. + + 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 :file:`Jobname`. + + ext : str + Filename extension (eight-character maximum). The extension defaults to PARM if ``Fname`` is + blank. + + Notes + ----- + + .. warning:: + + This function contains specificities regarding the argument definitions. + Please refer to the `command documentation `_ + for further explanations. + + **Argument Descriptions** + + .. _PARSAV_argdescript: + + * ``lab : str`` - Write operation: + + * ``SCALAR`` - Write only scalar parameters (default). + + * ``ALL`` - Write scalar and array parameters. Parameters may be numeric or alphanumeric. + + * ``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 :file:`Jobname`. + + * ``ext : str`` - Filename extension (eight-character maximum). The extension defaults to PARM if + ``Fname`` is blank. + + .. _PARSAV_notes: + + Writes the current parameters to a coded file. Previous parameters on this file, if any, will be + overwritten. The parameter file may be read with the :ref:`parres` command. + + :ref:`parsav` / :ref:`parres` operations truncate some long decimal strings, and can cause differing + values in your solution data when other operations are performed. A good practice is to limit the + number of decimal places you will use before and after these operations. + + This command is valid in any processor. + """ + command = f"PARSAV,{lab},{fname},{ext}" + return self.run(command, **kwargs) + + def starset( + self, + par: str = "", + value: str = "", + val2: str = "", + val3: str = "", + val4: str = "", + val5: str = "", + val6: str = "", + val7: str = "", + val8: str = "", + val9: str = "", + val10: str = "", + **kwargs, + ): + r"""Assigns values to user-named parameters. + + Mechanical APDL Command: `\*SET `_ + + Parameters + ---------- + par : str + An alphanumeric name used to identify this parameter. ``Par`` can contain up to 32 characters, + beginning with a letter and containing only letters, numbers, and underscores. Examples: + + .. code:: apdl + + ABC A3X TOP_END + + Command names, function names, label names, component and assembly names, etc., are invalid, as + are parameter names beginning with an underscore (for example, + + .. code:: apdl + + _LOOP + + ). + + Parameter names ending in an underscore are not listed by the :ref:`starstatus` command. Array + parameter names must be followed by a subscript, and the entire expression must be 32 characters + or less. Examples: + + .. code:: apdl + + A(1,1) NEW_VAL(3,2,5) RESULT(1000) + + There is no character parameter substitution for the ``Par`` field. Table parameters used in + command fields (where constant values are normally given) are limited to 32 characters. + + value : str + Numerical value or alphanumeric character string (up to 32 characters enclosed in single quotes) + to be assigned to this parameter. Examples: + + .. code:: apdl + + A(1,3)=7.4 B='ABC3' + + Can also be a parameter or a parametric expression. Examples: + + .. code:: apdl + + C=A(1,3) A(2,2)=(C+4)/2 + + .. code:: apdl + + C=A(1,3) A(2,2)=(C+4)/2 + + If ``VALUE`` is the table array name, the subscripts are the values of the primary variables + and the table is evaluated at these specified index values. + + If blank, delete this parameter. Example: + + .. code:: apdl + + A= + + deletes parameter + + .. code:: apdl + + A + + .. code:: apdl + + A + + val2 : str + If ``Par`` is an array parameter, values ``VAL2`` through ``VAL10`` (up to the last nonblank + value) are sequentially assigned to the succeeding array elements of the column. Examples: + + .. code:: apdl + + *SET,A(1,4),10,11 + + assigns + + .. code:: apdl + + A(1,4)=10, A(2,4)=11 + + .. code:: apdl + + A(1,4)=10, A(2,4)=11 + + .. code:: apdl + + *SET,B(2,3),'file10','file11' + + assigns + + .. code:: apdl + + B(2,3)='file10', B(3,3)='file11' + + .. code:: apdl + + B(2,3)='file10', B(3,3)='file11' + + val3 : str + If ``Par`` is an array parameter, values ``VAL2`` through ``VAL10`` (up to the last nonblank + value) are sequentially assigned to the succeeding array elements of the column. Examples: + + .. code:: apdl + + *SET,A(1,4),10,11 + + assigns + + .. code:: apdl + + A(1,4)=10, A(2,4)=11 + + .. code:: apdl + + A(1,4)=10, A(2,4)=11 + + .. code:: apdl + + *SET,B(2,3),'file10','file11' + + assigns + + .. code:: apdl + + B(2,3)='file10', B(3,3)='file11' + + .. code:: apdl + + B(2,3)='file10', B(3,3)='file11' + + val4 : str + If ``Par`` is an array parameter, values ``VAL2`` through ``VAL10`` (up to the last nonblank + value) are sequentially assigned to the succeeding array elements of the column. Examples: + + .. code:: apdl + + *SET,A(1,4),10,11 + + assigns + + .. code:: apdl + + A(1,4)=10, A(2,4)=11 + + .. code:: apdl + + A(1,4)=10, A(2,4)=11 + + .. code:: apdl + + *SET,B(2,3),'file10','file11' + + assigns + + .. code:: apdl + + B(2,3)='file10', B(3,3)='file11' + + .. code:: apdl + + B(2,3)='file10', B(3,3)='file11' + + val5 : str + If ``Par`` is an array parameter, values ``VAL2`` through ``VAL10`` (up to the last nonblank + value) are sequentially assigned to the succeeding array elements of the column. Examples: + + .. code:: apdl + + *SET,A(1,4),10,11 + + assigns + + .. code:: apdl + + A(1,4)=10, A(2,4)=11 + + .. code:: apdl + + A(1,4)=10, A(2,4)=11 + + .. code:: apdl + + *SET,B(2,3),'file10','file11' + + assigns + + .. code:: apdl + + B(2,3)='file10', B(3,3)='file11' + + .. code:: apdl + + B(2,3)='file10', B(3,3)='file11' + + val6 : str + If ``Par`` is an array parameter, values ``VAL2`` through ``VAL10`` (up to the last nonblank + value) are sequentially assigned to the succeeding array elements of the column. Examples: + + .. code:: apdl + + *SET,A(1,4),10,11 + + assigns + + .. code:: apdl + + A(1,4)=10, A(2,4)=11 + + .. code:: apdl + + A(1,4)=10, A(2,4)=11 + + .. code:: apdl + + *SET,B(2,3),'file10','file11' + + assigns + + .. code:: apdl + + B(2,3)='file10', B(3,3)='file11' + + .. code:: apdl + + B(2,3)='file10', B(3,3)='file11' + + val7 : str + If ``Par`` is an array parameter, values ``VAL2`` through ``VAL10`` (up to the last nonblank + value) are sequentially assigned to the succeeding array elements of the column. Examples: + + .. code:: apdl + + *SET,A(1,4),10,11 + + assigns + + .. code:: apdl + + A(1,4)=10, A(2,4)=11 + + .. code:: apdl + + A(1,4)=10, A(2,4)=11 + + .. code:: apdl + + *SET,B(2,3),'file10','file11' + + assigns + + .. code:: apdl + + B(2,3)='file10', B(3,3)='file11' + + .. code:: apdl + + B(2,3)='file10', B(3,3)='file11' + + val8 : str + If ``Par`` is an array parameter, values ``VAL2`` through ``VAL10`` (up to the last nonblank + value) are sequentially assigned to the succeeding array elements of the column. Examples: + + .. code:: apdl + + *SET,A(1,4),10,11 + + assigns + + .. code:: apdl + + A(1,4)=10, A(2,4)=11 + + .. code:: apdl + + A(1,4)=10, A(2,4)=11 + + .. code:: apdl + + *SET,B(2,3),'file10','file11' + + assigns + + .. code:: apdl + + B(2,3)='file10', B(3,3)='file11' + + .. code:: apdl + + B(2,3)='file10', B(3,3)='file11' + + val9 : str + If ``Par`` is an array parameter, values ``VAL2`` through ``VAL10`` (up to the last nonblank + value) are sequentially assigned to the succeeding array elements of the column. Examples: + + .. code:: apdl + + *SET,A(1,4),10,11 + + assigns + + .. code:: apdl + + A(1,4)=10, A(2,4)=11 + + .. code:: apdl + + A(1,4)=10, A(2,4)=11 + + .. code:: apdl + + *SET,B(2,3),'file10','file11' + + assigns + + .. code:: apdl + + B(2,3)='file10', B(3,3)='file11' + + .. code:: apdl + + B(2,3)='file10', B(3,3)='file11' + + val10 : str + If ``Par`` is an array parameter, values ``VAL2`` through ``VAL10`` (up to the last nonblank + value) are sequentially assigned to the succeeding array elements of the column. Examples: + + .. code:: apdl + + *SET,A(1,4),10,11 + + assigns + + .. code:: apdl + + A(1,4)=10, A(2,4)=11 + + .. code:: apdl + + A(1,4)=10, A(2,4)=11 + + .. code:: apdl + + *SET,B(2,3),'file10','file11' + + assigns + + .. code:: apdl + + B(2,3)='file10', B(3,3)='file11' + + .. code:: apdl + + B(2,3)='file10', B(3,3)='file11' + + Notes + ----- + + .. warning:: + + This function contains specificities regarding the argument definitions. + Please refer to the `command documentation `_ + for further explanations. + + **Argument Descriptions** + + .. _a-SET_argdescript: + + * ``par : str`` - An alphanumeric name used to identify this parameter. ``Par`` can contain up to 32 + characters, beginning with a letter and containing only letters, numbers, and underscores. Examples: + + .. code:: apdl - Notes - ----- - Only the SIN, COS, TAN, ASIN, ACOS, ATAN, ATAN2, ANGLEK, and ANGLEN - functions ``[*SET, *VFUN]`` are affected by this command. - """ - command = f"*AFUN,{lab}" - return self.run(command, **kwargs) + ABC A3X TOP_END - def dim( - self, - par="", - type_="", - imax="", - jmax="", - kmax="", - var1="", - var2="", - var3="", - csysid="", - **kwargs, - ): - """Defines an array parameter and its dimensions. + Command names, function names, label names, component and assembly names, etc., are invalid, as are + parameter names beginning with an underscore (for example, - APDL Command: ``*DIM`` + .. code:: apdl - Parameters - ---------- - par - Name of parameter to be dimensioned. See ``*SET`` for name - restrictions. + _LOOP - type\\_ - Array type: + ). - Arrays are similar to standard FORTRAN arrays (indices are - integers) (default). Index numbers for the rows, columns, - and planes are sequential values beginning with one. Used - for 1-, 2-, or 3-D arrays. - Same as ARRAY, but used to - specify 4-D arrays. - - Same as ARRAY, but used to specify 5-D arrays. - Array - entries are character strings (up to 8 characters each). - Index numbers for rows, columns, and planes are sequential - values beginning with one. - - Array indices are real (non-integer) numbers which must be - defined when filling the table. Index numbers for the - rows and columns are stored in the zero column and row - "array elements" and are initially assigned a near-zero - value. Index numbers must be in ascending order and are - used only for retrieving an array element. When - retrieving an array element with a real index that does - not match a specified index, linear interpolation is done - among the nearest indices and the corresponding array - element values [``*SET``]. Used for 1-, 2-, or 3-D tables. - - Same as TABLE, but used to specify 4-D tables. - - Same as TABLE, but used to specify 5-D tables. - Array - entries are character strings (up to IMAX each). Index - numbers for columns and planes are sequential values - beginning with 1. Row index is character position in - string. - - imax - Extent of first dimension (row). (For Type = STRING, IMAX is - rounded up to the next multiple of eight and has a limit of 248). - Defaults to 1. - - jmax - Extent of second dimension (column). Defaults to 1. - - kmax - Extent of third dimension (plane). Defaults to 1. - - var1 - Variable name corresponding to the first dimension (row) for Type = - TABLE. Defaults to Row. - - var2 - Variable name corresponding to the second dimension (column) for - Type = TABLE. Defaults to Column. - - var3 - Variable name corresponding to the third dimension (plane) for Type - = TABLE. Defaults to Plane. - - csysid - An integer corresponding to the coordinate system ID Number. + Parameter names ending in an underscore are not listed by the :ref:`starstatus` command. Array + parameter names must be followed by a subscript, and the entire expression must be 32 characters or + less. Examples: - Notes - ----- - Up to three dimensions (row, column, and plane) may be defined using - ARRAY and TABLE. Use ARR4, ARR5, TAB4, and TAB5 to define up to five - dimensions (row, column, plane, book, and shelf). An index number is - associated with each row, column, and plane. For array and table type - parameters, element values are initialized to zero. For character and - string parameters, element values are initialized to (blank). A - defined parameter must be deleted [``*SET``] before its dimensions can be - changed. Scalar (single valued) parameters should not be dimensioned. - ``*DIM,A,,3`` defines a vector array with elements A(1), A(2), and A(3). - ``*DIM,B,,2,3`` defines a 2x3 array with elements B(1,1), B(2,1), B(1,2), - B(2,2), B(1,3), and B(2,3). Use ``*STATUS,Par`` to display elements of - array Par. You can write formatted data files (tabular formatting) from - data held in arrays through the ``*VWRITE`` command. - - If you use table parameters to define boundary conditions, then Var1, - Var2, and/or Var3 can either specify a primary variable (listed in - Table: 130:: ``*DIM`` - Primary Variables) or can be an independent - parameter. If specifying an independent parameter, then you must - define an additional table for the independent parameter. The - additional table must have the same name as the independent parameter - and may be a function of one or more primary variables or another - independent parameter. All independent parameters must relate to a - primary variable. - - Tabular load arrays can be defined in both global Cartesian (default) - or local (see below) coordinate systems by specifying CSYSID, as - defined in LOCAL. For batch operations, you must specify your - coordinate system first. - - The following constraints apply when you specify a local coordinate - system for your tabular loads: - - If you are specifying a 4- or 5-D array or table, four additional - fields (LMAX, MMAX, Var4, and Var5) are available. Thus, for a 4-D - table, the command syntax would be: - - For a 5-D table, the command syntax would be: - - You cannot create or edit 4- or 5-D arrays or tables using the GUI. - - See Array Parameters for a detailed discussion on and examples for - using array parameters. - - Table: 130:: : ``*DIM`` - Primary Variables + .. code:: apdl - Specify PRESSURE as the independent variable (not PRES). + A(1,1) NEW_VAL(3,2,5) RESULT(1000) - The X, Y, and Z coordinate locations listed above are valid in global - Cartesian, or local (Cartesian, cylindrical and spherical) coordinate - systems. The VELOCITY label is applicable only to the calculated fluid - velocity in element FLUID116. + There is no character parameter substitution for the ``Par`` field. Table parameters used in command + fields (where constant values are normally given) are limited to 32 characters. - When using PRESSURE as a primary variable, the underlying element must - have the pressure DOF associated with it, or it must be a supported - contact element. + * ``value : str`` - Numerical value or alphanumeric character string (up to 32 characters enclosed + in single quotes) to be assigned to this parameter. Examples: - The gap/penetration label (GAP) is only used for defining certain - contact element real constants. + .. code:: apdl - The frequency label (FREQ) is valid for harmonic analyses only. + A(1,3)=7.4 B='ABC3' - The OMEGS, ECCENT, and THETA primary variables only apply to the - COMBI214 element. The amplitude of the rotational velocity (OMEGS) is - an absolute value, so only positive values of OMEGS are valid. The - eccentricity (ECCENT) and phase shift (THETA) labels are only valid for - nonlinear analyses. + Can also be a parameter or a parametric expression. Examples: - If you use table parameters to define boundary conditions, the table - names (Par) must not exceed 32 characters. + .. code:: apdl - In thermal analyses, if you apply tabular loads as a function of - temperature but the rest of the model is linear (e.g., includes no - temperature-dependent material properties or radiation ), you should - turn on Newton-Raphson iterations (NROPT,FULL) to evaluate the - temperature-dependent tabular boundary conditions correctly. + C=A(1,3) A(2,2)=(C+4)/2 - This command is valid in any processor. - """ - command = ( - f"*DIM,{par},{type_},{imax},{jmax},{kmax},{var1},{var2},{var3},{csysid}" - ) - return self.run(command, **kwargs) + .. code:: apdl - def get( - self, - par="", - entity="", - entnum="", - item1="", - it1num="", - item2="", - it2num="", - **kwargs, - ): - """Retrieves a value and stores it as a scalar parameter or part of an array parameter. - - APDL Command: ``*GET`` - - See the full MADPL command at `*GET - `_ - - GET retrieves a value for a specified item and stores the - value as a scalar parameter, or as a value in a user-named - array parameter. An item is identified by various keyword, - label, and number combinations. Usage is similar to the SET - command except that the parameter values are retrieved from - previously input or calculated results. For example, - ``GET,A,ELEM,5,CENT,X`` returns the centroid x-location of element - 5 and stores the result as parameter A. GET command - operations, along with the associated Get functions return - values in the active coordinate system unless stated - otherwise. A Get function is an alternative in- line function - that can be used to retrieve a value instead of the GET - command (see Using In-line Get Functions for more - information). - Both GET and VGET retrieve information from the active data - stored in memory. The database is often the source, and - sometimes the information is retrieved from common memory - blocks that the program uses to manipulate - information. Although POST1 and POST26 operations use a .rst - file, GET data is accessed from the database or from the - common blocks. Get operations do not access the .rst file - directly. For repeated gets of sequential items, such as from - a series of elements, see the VGET command. - Most items are stored in the database after they are - calculated and are available anytime thereafter. Items are - grouped according to where they are usually first defined or - calculated. Preprocessing data will often not reflect the - calculated values generated from section data. Do not use GET - to obtain data from elements that use calculated section data, - such as beams or shells. Most of the general items listed - below are available from all modules. + C=A(1,3) A(2,2)=(C+4)/2 - Parameters - ---------- - par : str, optional - The name of the resulting parameter. See \\*SET for name - restrictions. + If ``VALUE`` is the table array name, the subscripts are the values of the primary variables and + the table is evaluated at these specified index values. - entity - Entity keyword. Valid keywords are NODE, ELEM, KP, LINE, - AREA, VOLU, PDS, etc., as shown for Entity = in the tables - below. - - entnum - The number or label for the entity (as shown for ENTNUM = - in the tables below). In some cases, a zero (or blank) - ENTNUM represents all entities of the set. - - item1 - The name of a particular item for the given entity. - - it1num - The number (or label) for the specified Item1 (if - any). Valid IT1NUM values are as shown in the IT1NUM - columns of the tables below. Some Item1 labels do not - require an IT1NUM value. - - item2, it2num - A second set of item labels and numbers to further qualify - the item for which data are to be retrieved. Most items do - not require this level of information. - - item3 - A third set of item labels to further qualify - the item for which data are to be retrieved. Almost all items do - not require this level of information. - - item3 : str, optional - A third set of item labels and numbers to further qualify the item - for which data are to be retrieved. Most items do not require this - level of information. - - it3num : str, int, optional - The number (or label) for the specified ``item3`` (if - any). Some ``item3`` labels do not require an ``it3num`` - value. - - item4 : str, optional - A fourth set of item labels and numbers to further qualify the item - for which data are to be retrieved. Most items do not require this level of information. - - it4num : str, int, optional - The number (or label) for the specified ``item4`` (if - any). Some ``item4`` labels do not require an ``it4num`` - value. - - Returns - ------- - float - Floating point value of the parameter. - - Examples - -------- - Retrieve the number of nodes - - >>> value = mapdl.get('val', 'node', '', 'count') - >>> value - 3003 - - Retrieve the number of nodes using keywords. Note that the - parameter name is optional. - - >>> value = mapdl.get(entity='node', item1='count') - >>> value - 3003 + If blank, delete this parameter. Example: - """ - command = f"*GET,{par},{entity},{entnum},{item1},{it1num},{item2},{it2num}" - return self.run(command, **kwargs) + .. code:: apdl - def inquire(self, strarray="", func="", arg1="", arg2="", **kwargs): - """Returns system information. + A= - By default, with no arguments, it returns the working directory. + deletes parameter - >>> mapdl.inquire() - C:\\Users\\user\\AppData\\Local\\Temp\\ansys_nynvxsaooh + .. code:: apdl - Parameters - ---------- - strarray : str, optional - Name of the string array or parameter that will hold the returned values. - Normally, if used in a python script you should just work with the - return value from this method. - func : str, optional - Specifies the type of system information returned. See the - notes section for more information. - arg1 : str, optional - First argument. See notes for ``arg1`` definition. - arg2 : str, optional - Second argument. See notes for ``arg1`` definition. - - Returns - ------- - str - Value of the inquired item. + A - Notes - ----- - The ``/INQUIRE`` command is valid in any processor. + .. code:: apdl - .. warning:: - Take note that from version 0.60.4 and later, the command behaviour - has been changed. - Previously, the ``StrArray`` argument was omitted. For example: - >>> mapdl.inquire('DIRECTORY') - C:\\Users\\user\\AppData\\Local\\Temp\\ansys_nynvxsaooh + A - Now this will raise an exception. - The default behaviour now, requires to input ``StrArray``: - >>> mapdl.inquire('', 'DIRECTORY') - C:\\Users\\user\\AppData\\Local\\Temp\\ansys_nynvxsaooh + * ``val2, val3, val4, val5, val6, val7, val8, val9, val10 : str`` - If ``Par`` is an array + parameter, values ``VAL2`` through ``VAL10`` (up to the last nonblank value) are sequentially + assigned to the succeeding array elements of the column. Examples: - **GENERAL FUNC OPTIONS** + .. code:: apdl - - ``LOGIN`` - Returns the pathname of the login directory on Linux - systems or the pathname of the default directory (including - drive letter) on Windows systems. - - ``DOCU`` - Pathname of the ANSYS documentation directory. - - ``APDL`` - Pathname of the ANSYS APDL directory. - - ``PROG`` - Pathname of the ANSYS executable directory. - - ``AUTH`` - Pathname of the directory in which the license file resides. - - ``USER`` - Name of the user currently logged-in. - - ``DIRECTORY`` - Pathname of the current directory. - - ``JOBNAME`` - Current Jobname. - - ``RSTDIR`` - Result file directory. - - ``RSTFILE`` - Result file name. - - ``RSTEXT`` - Result file extension. - - ``OUTPUT`` - Current output file name. + *SET,A(1,4),10,11 + assigns - **RETURNING THE VALUE OF AN ENVIRONMENT VARIABLE TO A PARAMETER** + .. code:: apdl - If ``FUNC=ENV``, the command format is ``/INQUIRE,StrArray,ENV,ENVNAME,Substring``. - In this instance, ENV specifies that the command should return the - value of an environment variable. - The following defines the remaining fields: + A(1,4)=10, A(2,4)=11 - Envname: - Specifies the name of the environment variable. + .. code:: apdl - Substring: - If ``Substring = 1``, the first substring (up to the first colon (:)) is returned. - If ``Substring = 2``, the second substring is returned, etc. For Windows platforms, - the separating character is semicolon (;). - If this argument is either blank or 0, the entire value of the environment - variable is returned. + A(1,4)=10, A(2,4)=11 + .. code:: apdl - **RETURNING THE VALUE OF A TITLE TO A PARAMETER** + *SET,B(2,3),'file10','file11' - If ``FUNC = TITLE``, the command format is ``/INQUIRE,StrArray,TITLE,Title_num``. - In this context, the value of Title_num can be blank or ``1`` through ``5``. If the - value is ``1`` or blank, the title is returned. If the value is ``2`` through ``5``, - a corresponding subtitle is returned (``2`` denoting the first subtitle, and so on). + assigns + .. code:: apdl - **RETURNING INFORMATION ABOUT A FILE TO A PARAMETER** + B(2,3)='file10', B(3,3)='file11' - The ``/INQUIRE`` command can also return information about specified files - within the file system. - For these capabilities, the format is ``/INQUIRE,Parameter,FUNC,Fname, Ext, --``. - The following defines the fields: + .. code:: apdl - Parameter: - Name of the parameter that will hold the returned values. + B(2,3)='file10', B(3,3)='file11' - Func: - Specifies the type of file information returned: + .. _a-SET_notes: - EXIST: - Returns a ``1`` if the specified file exists, and ``0`` if it does not. + Assigns values to user-named parameters that can be substituted later in the run. The equivalent + (and recommended) format is ``Par`` = ``VALUE``, ``VAL2``, ``VAL3``,..., ``VAL10`` - DATE: - Returns the date stamp of the specified file in the format ``*yyyymmdd.hhmmss*``. + which can be used in place of :ref:`starset`, ``Par``,... for convenience. - SIZE: - Returns the size of the specified file in MB. + This command is valid in any processor. - WRITE: - Returns the status of the write attribute. A ``0`` denotes no write permission while a ``1`` denotes - write permission. + .. _a-SET_extranote1: - READ: - Returns the status of the read attribute. A ``0`` denotes no read permission while a ``1`` denotes read - permission. + Parameters (numeric or character) can be scalars (single valued) or arrays (multiple valued in one, + two, or three dimensions). An unlimited number of parameter names can be defined in any run. For + very large numbers of parameters, it is most efficient to define them in alphabetical order. - EXEC: - Returns the status of the execute attribute (this has meaning only on Linux). A ``0`` denotes no - execute permission while a ``1`` denotes execute permission. + Parameter values can be redefined at any time. Array parameters can also be assigned values within a + do-loop ( ``*DO`` ) for convenience. Internally programmed do-loop commands are also available with + the **\*V** ``XX`` commands ( :ref:`vfill` ). Parameter values (except for parameters ending in an + underscore) can be listed with the :ref:`starstatus` command, displayed via :ref:`starvplot` + (numeric parameters only), and modified via ``*VEDIT`` (numeric parameters only). - LINES: - Returns the number of lines in an ASCII file. + Older program-provided macro files can use parameter names that do not begin with an underscore. + Using these macros embedded in your own macros may cause conflicts if the same parameter names are + used. - 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. + Parameters can also be resolved in comments created via :ref:`com`. A parameter can be deleted by + redefining it with a blank ``VALUE``. If the parameter is an array, the entire array is deleted. + Parameters can also be defined by a response to a query via ``*ASK`` or from a Mechanical APDL- + provided + value via :ref:`get`. - Ext: - Filename extension (eight-character maximum). + .. _a-SET_extranote2: - Examples - -------- - Return the MAPDL working directory - >>> mapdl.inquire('', 'DIRECTORY') - C:\\Users\\gayuso\\AppData\\Local\\Temp\\ansys_nynvxsaooh + Array parameters must be dimensioned ( :ref:`dim` ) before being assigned values unless they are the + result of an array operation or defined using the implied loop convention. - Or + Undefined scalar parameters are initialized to a near-zero value. Numeric array parameters are + initialized to zero when dimensioned, and character array parameters are initialized to blank. - >>> mapdl.inquire() - C:\\Users\\gayuso\\AppData\\Local\\Temp\\ansys_nynvxsaooh + An existing array parameter must be deleted before it can be redimensioned. - Return the job name + Array parameter names must be followed by a subscript list (enclosed in parentheses) identifying the + element of the array. The subscript list can have one, two, or three values (separated by commas). + Typical array parameter elements are A(1,1), NEW_VAL(3,2,5), RESULT(1000). Subscripts for defining + an array element must be integers (or parameter expressions that evaluate to integers). Non-integer + values are rounded to the nearest integer value. - >>> mapdl.inquire('', 'JOBNAME') - file + All array parameters are stored as 3D arrays with the unspecified dimensions set to 1. For example, + the 4th array element of a 1-dimensional array, A(4), is stored as array element A(4,1,1). - Return the result file name + Arrays adhere to standard FORTRAN conventions. - >>> mapdl.inquire('', 'RSTFILE') - 'file.rst' - """ - return self.run(f"/INQUIRE,{strarray},{func},{arg1},{arg2}", **kwargs) + .. _a-SET_extranote3: - def parres(self, lab="", fname="", ext="", **kwargs): - """Reads parameters from a file. + If the parameter name ``Par`` is input in a numeric argument of a command, the numeric value of the + parameter (as assigned with :ref:`starset`, :ref:`get`, =, etc.) is substituted into the command at + that point. Substitution occurs only if the parameter name is used between blanks, commas, + parentheses, or arithmetic operators (or any combination) in a numeric argument. Substitution can be + prevented by enclosing the parameter name ``Par`` within single quotes ( ' ), if the parameter is + alone in the argument; if the parameter is part of an arithmetic expression, the entire expression + must be enclosed within single quotes to prevent substitution. In either case the character string + will be used instead of the numeric value (and the string will be taken as 0.0 if it is in a numeric + argument). - APDL Command: PARRES + A forced substitution is available in the text fields of :ref:`title`, :ref:`stitle`, :ref:`tlabel`, + :ref:`an3d`, :ref:`syp` ( ``ARG1`` -- ``ARG8`` ), and :ref:`abbr` by enclosing the parameter within + percent (%) signs. Also, parameter substitution can be forced within the file name or extension + fields of commands having these fields by enclosing the parameter within percent (%) signs. Array + parameters ( :ref:`dim` ) must include a subscript (within parentheses) to identify the array + element whose value is to be substituted, such as A(1,3). Out-of-range subscripts result in an error + message. Non-integer subscripts are allowed when identifying a TABLE array element for substitution. + A proportional linear interpolation of values among the nearest array elements is performed before + substitution. Interpolation is done in all three dimensions. - Reads parameters from a coded file. The parameter file may - have been written with the PARSAV command. The parameters - read may replace or change the current parameter set. + Interpolation is based upon the assigned index numbers which must be defined when the table is + filled ( :ref:`dim` ). - This command is valid in any processor. + .. _a-SET_extranote4: - Parameters - ---------- - lab - Read operation. + Most alphanumeric arguments permit the use of character parameter substitution. When the parameter + name ``Par`` input, the alphanumeric value of the parameter is substituted into the command at that + point. Substitution can be suppressed by enclosing the parameter name within single quotes ( ' ). + Forced substitution is available in some fields by enclosing the parameter name within percent (%) + signs. Valid forced substitution fields include command name fields, ``Fname`` (filename) or ``Ext`` + (extension) arguments, :ref:`abbr` command ( ``Abbr`` arguments), :ref:`title` and :ref:`stitle` + commands ( ``Title`` argument) and :ref:`tlabel` command ( ``Text`` argument). Character parameter + substitution is also available in the ``*ASK``, :ref:`an3d`, :ref:`cfwrite`, ``*IF``, ``*ELSEIF``, + :ref:`msg`, :ref:`starset`, :ref:`use`, :ref:`vread`, and :ref:`vwrite` commands. Character array + parameters must include a subscript (within parentheses) to identify the array element whose value + is to be substituted. - NEW - Replace current parameter set with these parameters (default). + .. _a-SET_extranote5: - CHANGE - Extend current parameter set with these - parameters, replacing any that already exist. + If a parameter operation expression is input in a numeric argument, the numeric value of the + expression is substituted into the command at that point. Allowable operation expressions are of the + form - 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. + .. code:: apdl - The file name defaults to Jobname. + E1oE2oE3...oE10 - ext - Filename extension (eight-character maximum). The - extension defaults to PARM if Fname is blank. + where E1, E2, etc. are expressions connected by operators (o). The allowable operations (o) are - Examples - -------- - Read a local parameter file. + .. code:: apdl - >>> mapdl.parres('parm.PARM') + + - * / ** < > - """ - return self.run(f"PARRES, {lab}, {fname}, {ext}") + For example, - def parsav(self, lab="", fname="", ext="", **kwargs): - """Writes parameters to a file. + .. code:: apdl - APDL Command: PARSAV + A+B**C/D*E - Parameters - ---------- - lab - Write operation: + is a valid operation expression. The - - ``'SCALAR'`` : Write only scalar parameters (default). - - ``'ALL'`` : Write scalar and array parameters. - Parameters may be numeric or alphanumeric. + .. code:: apdl - 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. + * - ext - Filename extension (eight-character maximum). + represents multiplication and the - Notes - ----- - Writes the current parameters to a coded file. Previous - parameters on this file, if any, will be overwritten. The - parameter file may be read with the PARRES command. + .. code:: apdl - PARSAV/PARRES operations truncate some long decimal strings, - and can cause differing values in your solution data when - other operations are performed. A good practice is to limit - the number of decimal places you will use before and after - these operations. + ** - This command is valid in any processor. + represents exponentiation. + + Exponentiation of a negative number (without parentheses) to an integer power follows standard + FORTRAN hierarchy conventions; that is, the positive number is exponentiated and then the sign is + attached. Thus, -4**2 is evaluated as -16. If parentheses are applied, such as (-4)**2, the result + is 16. + + A parameter is evaluated as a number within parentheses before exponentiation. Exponentiation of a + negative number to a non-integer power is performed by exponentiating the positive number and + prepending the minus sign, for example, -4**2.3 is -(4**2.3). The < and > operators allow + conditional substitution. For example, E1`_ Parameters ---------- - par - An alphanumeric name used to identify this parameter. Par may be - up to 32 characters, beginning with a letter and containing only - letters, numbers, and underscores. Examples: ABC A3X TOP_END. - ANSYS command names, function names, label names, component and - assembly names, etc., should not be used. Parameter names - beginning with an underscore (e.g., _LOOP) are reserved for use by - ANSYS and should be avoided. Parameter names ending in an - underscore are not listed by the ``*STATUS`` command. Array parameter - names must be followed by a subscript, and the entire expression - must be 32 characters or less. Examples: A(1,1) NEW_VAL(3,2,5) - RESULT(1000). There is no character parameter substitution for the - Par field. Table parameters that are used in command fields (where - constant values are normally given) are limited to 32 characters. - - value - Numerical value or alphanumeric character string (up to 32 - characters enclosed in single quotes) to be assigned to this - parameter. Examples: A(1,3)=7.4 B='ABC3'. May also be a - parameter or a parametric expression. Examples: C=A(1,3) - A(2,2)=(C+4)/2. If blank, delete this parameter. Example: A= - deletes parameter A. - - val2, val3, val4, val5, val6, val7, val8, val9, val10 - If Par is an array parameter, values VAL2 through VAL10 (up to the - last nonblank value) are sequentially assigned to the succeeding - array elements of the column. Example: ``*SET,A(1,4),10,11`` assigns - ``A(1,4)=10, A(2,4)=11``. ``*SET,B(2,3),'file10','file11'`` assigns - ``B(2,3)='file10', B(3,3)='file11'``. + par : str + Specifies the parameter or sets of parameters listed. For array parameters, use ``IMIN``, ``IMAX``, + etc. to specify ranges. Use :ref:`dim` to define array parameters. Use ``*VEDIT`` to review array + parameters interactively. Use :ref:`vwrite` to print array values in a formatted output. If ``Par`` + is blank, list all scalar parameter values, array parameter dimensions, and abbreviations. If ARGX, + list the active set of local macro parameters (ARG1 to ARG9 and AR10 to AR99) ( :ref:`use` ). + + The following are possible values for ``Par`` + + * ``ALL or blank`` - Lists all parameters (except local macro parameters and those with names + beginning or ending with an underbar) and toolbar abbreviations. + + * ``_PRM`` - Lists only parameters with names beginning with an underbar (_). These are Mechanical APDL + internal parameters. + + * ``PRM_`` - Lists only parameters with names ending with an underbar (_). A good APDL programming + convention is to ensure that all parameters created by your system programmer are named with a + trailing underbar. + + * ``ABBR`` - Lists all toolbar abbreviations. + + * ``PARM`` - Lists all parameters (except local macro parameters and those with names beginning or + ending with an underbar). + + * ``MATH`` - Lists all APDL Math parameters, including vectors, matrices, and linear solvers. + + * ``PARNAME`` - Lists only the parameter specified. ``PARNAME`` cannot be a local macro parameter + name. + + * ``ARGX`` - Lists all local macro parameter values (ARG1- AR99) that are non-zero or non-blank. + + imin : str + Range of array elements to display (in terms of the dimensions (row, column, plane, book, and + shelf). Minimum values default to 1. Maximum values default to the maximum dimension values. + Zero may be input for ``IMIN``, ``JMIN``, and ``KMIN`` to display the index numbers. See + :ref:`taxis` command to list index numbers of 4- and 5-D tables. + + imax : str + Range of array elements to display (in terms of the dimensions (row, column, plane, book, and + shelf). Minimum values default to 1. Maximum values default to the maximum dimension values. + Zero may be input for ``IMIN``, ``JMIN``, and ``KMIN`` to display the index numbers. See + :ref:`taxis` command to list index numbers of 4- and 5-D tables. + + jmin : str + Range of array elements to display (in terms of the dimensions (row, column, plane, book, and + shelf). Minimum values default to 1. Maximum values default to the maximum dimension values. + Zero may be input for ``IMIN``, ``JMIN``, and ``KMIN`` to display the index numbers. See + :ref:`taxis` command to list index numbers of 4- and 5-D tables. + + jmax : str + Range of array elements to display (in terms of the dimensions (row, column, plane, book, and + shelf). Minimum values default to 1. Maximum values default to the maximum dimension values. + Zero may be input for ``IMIN``, ``JMIN``, and ``KMIN`` to display the index numbers. See + :ref:`taxis` command to list index numbers of 4- and 5-D tables. + + kmin : str + Range of array elements to display (in terms of the dimensions (row, column, plane, book, and + shelf). Minimum values default to 1. Maximum values default to the maximum dimension values. + Zero may be input for ``IMIN``, ``JMIN``, and ``KMIN`` to display the index numbers. See + :ref:`taxis` command to list index numbers of 4- and 5-D tables. + + kmax : str + Range of array elements to display (in terms of the dimensions (row, column, plane, book, and + shelf). Minimum values default to 1. Maximum values default to the maximum dimension values. + Zero may be input for ``IMIN``, ``JMIN``, and ``KMIN`` to display the index numbers. See + :ref:`taxis` command to list index numbers of 4- and 5-D tables. + + lmin : str + Range of array elements to display (in terms of the dimensions (row, column, plane, book, and + shelf). Minimum values default to 1. Maximum values default to the maximum dimension values. + Zero may be input for ``IMIN``, ``JMIN``, and ``KMIN`` to display the index numbers. See + :ref:`taxis` command to list index numbers of 4- and 5-D tables. + + lmax : str + Range of array elements to display (in terms of the dimensions (row, column, plane, book, and + shelf). Minimum values default to 1. Maximum values default to the maximum dimension values. + Zero may be input for ``IMIN``, ``JMIN``, and ``KMIN`` to display the index numbers. See + :ref:`taxis` command to list index numbers of 4- and 5-D tables. + + mmin : str + Range of array elements to display (in terms of the dimensions (row, column, plane, book, and + shelf). Minimum values default to 1. Maximum values default to the maximum dimension values. + Zero may be input for ``IMIN``, ``JMIN``, and ``KMIN`` to display the index numbers. See + :ref:`taxis` command to list index numbers of 4- and 5-D tables. + + mmax : str + Range of array elements to display (in terms of the dimensions (row, column, plane, book, and + shelf). Minimum values default to 1. Maximum values default to the maximum dimension values. + Zero may be input for ``IMIN``, ``JMIN``, and ``KMIN`` to display the index numbers. See + :ref:`taxis` command to list index numbers of 4- and 5-D tables. + + kpri : int or str + Use this field to list your primary variable labels (X, Y, Z, TIME, etc.). + + * ``1`` - List the labels (default). YES, Y, or ON are also valid entries. + + * ``0`` - Do not list the labels. NO, N, or OFF are also valid entries. Notes ----- - Assigns values to user-named parameters that may be substituted later - in the run. The equivalent (and recommended) format is - ``Par = VALUE,VAL2,VAL3, . . . , VAL10`` + .. warning:: - which may be used in place of ``*SET,Par, : ...`` for convenience. + This function contains specificities regarding the argument definitions. + Please refer to the `command documentation `_ + for further explanations. - This command is valid in any processor. + **Argument Descriptions** + + .. _a-STATUS_argdescript: + + * ``par : str`` - Specifies the parameter or sets of parameters listed. For array parameters, use + ``IMIN``, ``IMAX``, + etc. to specify ranges. Use :ref:`dim` to define array parameters. Use ``*VEDIT`` to review array + parameters interactively. Use :ref:`vwrite` to print array values in a formatted output. If ``Par`` + is blank, list all scalar parameter values, array parameter dimensions, and abbreviations. If ARGX, + list the active set of local macro parameters (ARG1 to ARG9 and AR10 to AR99) ( :ref:`use` ). + + The following are possible values for ``Par`` + + * ``ALL or blank`` - Lists all parameters (except local macro parameters and those with names + beginning or ending with an underbar) and toolbar abbreviations. + + * ``_PRM`` - Lists only parameters with names beginning with an underbar (_). These are Mechanical APDL + internal parameters. + + * ``PRM_`` - Lists only parameters with names ending with an underbar (_). A good APDL programming + convention is to ensure that all parameters created by your system programmer are named with a + trailing underbar. + + * ``ABBR`` - Lists all toolbar abbreviations. + + * ``PARM`` - Lists all parameters (except local macro parameters and those with names beginning or + ending with an underbar). - Parameters (numeric or character) may be scalars (single valued) or - arrays (multiple valued in one, two, or three dimensions). An unlimited - number of parameter names may be defined in any ANSYS run. For very - large numbers of parameters, it is most efficient to define them in - alphabetical order. - - Parameter values may be redefined at any time. Array parameters may - also be assigned values within a do-loop [``*DO``] for convenience. - Internally programmed do-loop commands are also available with the ``*VXX`` - commands (``*VFILL``). Parameter values (except for parameters ending in - an underscore) may be listed with the ``*STATUS`` command, displayed with - the ``*VPLOT`` command (numeric parameters only), and modified with the - ``*VEDIT`` command (numeric parameters only). - - Older ANSYS-supplied macro files may use parameter names that do not - begin with an underscore. Using these macros embedded in your own - macros may cause conflicts if the same parameter names are used. - - Parameters can also be resolved in comments created by the /COM command - (see /COM for complete documentation). A parameter can be deleted by - redefining it with a blank VALUE. If the parameter is an array, the - entire array is deleted. Parameters may also be defined by a response - to a query with the ``*ASK`` command or from an "ANSYS-supplied" value - with the ``*GET`` command. - - Array parameters must be dimensioned [``*DIM``] before being assigned - values unless they are the result of an array operation or defined - using the implied loop convention. Scalar parameters that are not - defined are initialized to a "near" zero value. Numeric array - parameters are initialized to zero when dimensioned, and character - array parameters are initialized to blank. An existing array parameter - must be deleted before it can be redimensioned. Array parameter names - must be followed by a subscript list (enclosed in parentheses) - identifying the element of the array. The subscript list may have one, - two, or three values (separated by commas). Typical array parameter - elements are A(1,1), NEW_VAL(3,2,5), RESULT(1000). Subscripts for - defining an array element must be integers (or parameter expressions - that evaluate to integers). Non-integer values are rounded to the - nearest integer value. All array parameters are stored as 3-D arrays - with the unspecified dimensions set to 1. For example, the 4th array - element of a 1-dimensional array, A(4), is stored as array element - A(4,1,1). Arrays are patterned after standard FORTRAN conventions. - - If the parameter name Par is input in a numeric argument of a command, - the numeric value of the parameter (as assigned with ``*SET``, ``*GET``, =, - etc.) is substituted into the command at that point. Substitution - occurs only if the parameter name is used between blanks, commas, - parentheses, or arithmetic operators (or any combination) in a numeric - argument. Substitution can be prevented by enclosing the parameter - name Par within single quotes ( ' ), if the parameter is alone in the - argument; if the parameter is part of an arithmetic expression, the - entire expression must be enclosed within single quotes to prevent - substitution. In either case the character string will be used instead - of the numeric value (and the string will be taken as 0.0 if it is in a - numeric argument). - - A forced substitution is available in the text fields of the /TITLE, - /STITLE, /TLABEL, /AN3D, /SYP (ARG1--ARG8), and ``*ABBR`` commands by - enclosing the parameter within percent (%) signs. Also, parameter - substitution may be forced within the file name or extension fields of - commands having these fields by enclosing the parameter within percent - (%) signs. Array parameters [``*DIM``] must include a subscript (within - parentheses) to identify the array element whose value is to be - substituted, such as A(1,3). Out-of-range subscripts result in an - error message. Non-integer subscripts are allowed when identifying a - TABLE array element for substitution. A proportional linear - interpolation of values among the nearest array elements is performed - before substitution. Interpolation is done in all three dimensions. - - Note:: : Interpolation is based upon the assigned index numbers which - must be defined when the table is filled [``*DIM``]. - - Most alphanumeric arguments permit the use of character - parameter substitution. When the parameter name Par input, - the alphanumeric value of the parameter is substituted into - the command at that point. Substitution can be suppressed by - enclosing the parameter name within single quotes ( ' ). - Forced substitution is available in some fields by enclosing - the parameter name within percent (%) signs. Valid forced - substitution fields include command name fields, Fname - (filename) or Ext (extension) arguments, ``*ABBR`` command - (Abbr arguments), /TITLE and /STITLE commands (Title argument) - and /TLABEL command (Text argument). Character parameter - substitution is also available in the ``*ASK``, /AN3D, - ``*CFWRITE``, ``*IF``, ``*ELSEIF``, ``*MSG``, ``*SET``, - ``*USE``, ``*VREAD``, and ``*VWRITE`` commands. Character array - parameters must include a subscript (within parentheses) to - identify the array element whose value is to be substituted. - - If a parameter operation expression is input in a numeric argument, the - numeric value of the expression is substituted into the command at that - point. Allowable operation expressions are of the form - - ``E1oE2oE3: ...oE10`` - - where E1, E2, etc. are expressions connected by operators (o). The - allowable operations (o) are - - ``+ - * / ** < >`` - - For example, ``A+B**C/D*E`` is a valid operation expression. The ``*`` - represents multiplication and the ``**`` represents exponentiation. + * ``MATH`` - Lists all APDL Math parameters, including vectors, matrices, and linear solvers. + + * ``PARNAME`` - Lists only the parameter specified. ``PARNAME`` cannot be a local macro parameter + name. + + * ``ARGX`` - Lists all local macro parameter values (ARG1- AR99) that are non-zero or non-blank. + + * ``imin, imax, jmin, jmax, kmin, kmax, lmin, lmax, mmin, mmax : str`` - Range of array elements to + display (in terms of the dimensions (row, column, plane, book, and shelf). Minimum values default to + 1. Maximum values default to the maximum dimension values. Zero may be input for ``IMIN``, ``JMIN``, + and ``KMIN`` to display the index numbers. See :ref:`taxis` command to list index numbers of 4- and + 5-D tables. + + * ``kpri : int`` - Use this field to list your primary variable labels (X, Y, Z, TIME, etc.). + + * ``1`` - List the labels (default). YES, Y, or ON are also valid entries. + + * ``0`` - Do not list the labels. NO, N, or OFF are also valid entries. + + .. _a-STATUS_notes: + + You cannot obtain the value for a single local parameter (for example, :ref:`starstatus`,ARG2). You + can only request all local parameters simultaneously using :ref:`starstatus`,ARGX. + + This command is valid in any processor. """ - command = f"*SET,{par},{value},{val2},{val3},{val4},{val5},{val6},{val7},{val8},{val9},{val10}" + command = f"*STATUS,{par},{imin},{imax},{jmin},{jmax},{kmin},{kmax},{lmin},{lmax},{mmin},{mmax},{kpri}" return self.run(command, **kwargs) def starvget( self, - parr="", - entity="", - entnum="", - item1="", - it1num="", - item2="", - it2num="", - kloop="", + parr: str = "", + entity: str = "", + entnum: str = "", + item1: str = "", + it1num: str = "", + item2: str = "", + it2num: str = "", + kloop: str = "", **kwargs, ): - """Retrieves values and stores them into an array parameter. + r"""Retrieves values and stores them into an array parameter. - APDL Command: ``*VGET`` + Mechanical APDL Command: `\*VGET `_ Parameters ---------- - parr - The name of the resulting vector array parameter. See ``*SET`` for - name restrictions. + parr : str + The name of the resulting vector array parameter. See :ref:`starset` for name restrictions. The + program creates the array parameter if it does not exist. + + entity : str + Entity keyword. Valid keywords are NODE, ELEM, KP, LINE, AREA, VOLU, etc. as shown for + ``Entity`` = in the tables below. - entity - Entity keyword. Valid keywords are NODE, ELEM, KP, LINE, AREA, - VOLU, etc. as shown for Entity = in the tables below. + entnum : str + The number of the entity (as shown for ``ENTNUM`` = in the tables below). - entnum - The number of the entity (as shown for ENTNUM = in the tables - below). + item1 : str + The name of a particular item for the given entity. Valid items are as shown in the ``Item1`` + columns of the tables below. - item1 - The name of a particular item for the given entity. Valid items - are as shown in the Item1 columns of the tables below. + it1num : str + The number (or label) for the specified ``Item1`` (if any). Valid ``IT1NUM`` values are as shown + in the ``IT1NUM`` columns of the tables below. Some ``Item1`` labels do not require an + ``IT1NUM`` value. - it1num - The number (or label) for the specified Item1 (if any). Valid - IT1NUM values are as shown in the IT1NUM columns of the tables - below. Some Item1 labels do not require an IT1NUM value. + item2 : str + A second set of item labels and numbers to further qualify the item for which data is to be + retrieved. Most items do not require this level of information. - item2, it2num - A second set of item labels and numbers to further qualify the item - for which data is to be retrieved. Most items do not require this - level of information. + it2num : str + A second set of item labels and numbers to further qualify the item for which data is to be + retrieved. Most items do not require this level of information. - kloop + kloop : str Field to be looped on: - ``0`` or ``2`` : Loop on the ENTNUM field (default). + * ``0 or 2`` - Loop on the ``ENTNUM`` field (default). - ``3`` : Loop on the Item1 field. + * ``3`` - Loop on the ``Item1`` field. - ``4`` : Loop on the IT1NUM field. Successive items are as shown with IT1NUM. + * ``4`` - Loop on the ``IT1NUM`` field. Successive items are as shown with ``IT1NUM``. - ``5`` : Loop on the Item2 field. + * ``5`` - Loop on the ``Item2`` field. - ``6`` : Loop on the IT2NUM field. Successive items are as shown with IT2NUM. + * ``6`` - Loop on the ``IT2NUM`` field. Successive items are as shown with ``IT2NUM``. Notes ----- - Retrieves values for specified items and stores the values in an output - vector of a user-named array parameter according to: - - ``ParR = f(Entity, ENTNUM, Item1, IT1NUM, Item2, IT2NUM)`` - - where (f) is the ``*GET`` function; Entity, Item1, and Item2 - are keywords; and ENTNUM, IT1NUM, and IT2NUM are numbers or - labels corresponding to the keywords. Looping continues over - successive entity numbers (ENTNUM) for the KLOOP default. For - example, ``*VGET,A(1),ELEM,5,CENT,X`` returns the centroid - x-location of element 5 and stores the result in the first - location of A. Retrieving continues with element 6, 7, 8, - etc., regardless of whether the element exists or is selected, - until successive array locations are filled. Use ``*VLEN`` or - ``*VMASK`` to skip locations. Absolute values and scale - factors may be applied to the result parameter [``*VABS``, - ``*VFACT``]. Results may be cumulative [``*VCUM``]. See the - ``*VOPER`` command for general details. Results can be put - back into an analysis by writing a file of the desired input - commands with the ``*VWRITE`` command. See also the ``*VPUT`` + + .. warning:: + + This function contains specificities regarding the argument definitions. + Please refer to the `command documentation `_ + for further explanations. + + **Argument Descriptions** + + .. _a-VGET_argdescript: + + * ``parr : str`` - The name of the resulting vector array parameter. See :ref:`starset` for name + restrictions. The program creates the array parameter if it does not exist. + + * ``entity : str`` - Entity keyword. Valid keywords are NODE, ELEM, KP, LINE, AREA, VOLU, etc. as + shown for ``Entity`` = in the tables below. + + * ``entnum : str`` - The number of the entity (as shown for ``ENTNUM`` = in the tables below). + + * ``item1 : str`` - The name of a particular item for the given entity. Valid items are as shown in + the ``Item1`` columns of the tables below. + + * ``it1num : str`` - The number (or label) for the specified ``Item1`` (if any). Valid ``IT1NUM`` + values are as shown in the ``IT1NUM`` columns of the tables below. Some ``Item1`` labels do not + require an ``IT1NUM`` value. + + * ``item2, it2num : str`` - A second set of item labels and numbers to further qualify the item for + which data is to be retrieved. Most items do not require this level of information. + + * ``kloop : str`` - Field to be looped on: + + * ``0 or 2`` - Loop on the ``ENTNUM`` field (default). + + * ``3`` - Loop on the ``Item1`` field. + + * ``4`` - Loop on the ``IT1NUM`` field. Successive items are as shown with ``IT1NUM``. + + * ``5`` - Loop on the ``Item2`` field. + + * ``6`` - Loop on the ``IT2NUM`` field. Successive items are as shown with ``IT2NUM``. + + .. _a-VGET_notes: + + Retrieves values for specified items and stores the values in an output vector of a user-named array + parameter according to: ``ParR`` = f( ``Entity``, ``ENTNUM``, ``Item1``, ``IT1NUM``, ``Item2``, + ``IT2NUM`` ) + + where (f) is the :ref:`get` function; ``Entity``, ``Item1``, and ``Item2`` are keywords; and + ``ENTNUM``, ``IT1NUM``, and ``IT2NUM`` are numbers or labels corresponding to the keywords. Looping + continues over successive entity numbers ( ``ENTNUM`` ) for the ``KLOOP`` default. For example, + :ref:`starvget`,A(1),ELEM,5,CENT,X returns the centroid x-location of element 5 and stores the + result in the first location of A. Retrieving continues with element 6, 7, 8, etc., regardless of + whether the element exists or is selected, until successive array locations are filled. Use + :ref:`vlen` or :ref:`vmask` to skip locations. Absolute values and scale factors may be applied to + the result parameter ( :ref:`vabs`, :ref:`vfact` ). Results may be cumulative ( :ref:`vcum` ). See + the :ref:`voper` command for general details. Results can be put back into an analysis by writing a + file of the desired input commands with the :ref:`vwrite` command. See also the :ref:`starvput` command. - Both ``*GET`` and ``*VGET`` retrieve information from the - active data stored in memory. The database is often the - source, and sometimes the information is retrieved from common - memory blocks that ANSYS uses to manipulate - information. Although POST1 and POST26 operations use a ``*.rst`` - file, GET data is accessed from the database or from the - common blocks. Get operations do not access the ``*.rst`` file - directly. + Both :ref:`get` and :ref:`starvget` retrieve information from the active data stored in memory. The + database is often the source, and sometimes the information is retrieved from common memory blocks + that Mechanical APDL uses to manipulate information. Although POST1 and POST26 operations use a + :file:`\*.rst` file, GET data is accessed from the database or from the common blocks. Get + operations do not access the :file:`\*.rst` file directly. - The ``*VGET`` command retrieves both the unprocessed real and the imaginary - parts (original and duplicate sector nodes and elements) of a cyclic - symmetry solution. + The :ref:`starvget` command retrieves both the unprocessed real and the imaginary parts (original + and duplicate sector nodes and elements) of a `cyclic symmetry + `_ solution. - For each of the sections for accessing ``*VGET`` parameters see: - https://www.mm.bme.hu/~gyebro/files/ans_help_v182/ans_cmd/Hlp_C_VGET_st.html + Each of the sections for accessing \*VGET parameters are shown in the following order: + + * `\*VGET PREP7 Items + `_ + \*VGET PREP7 Items + + * `\*VGET POST1 Items + `_ + \*VGET POST1 Items This command is valid in any processor. + + **\*VGET PREP7 Items** + + .. _vget_prep7: + + * :ref:`vget_prep7_node` + + * :ref:`vget_prep7_elem` + + * :ref:`vget_prep7_kp` + + * :ref:`vget_prep7_line` + + * :ref:`vget_prep7_area` + + * :ref:`vget_prep7_volu` + + * :ref:`vget_prep7_cdsy` + + * :ref:`vget_prep7_rcon` + + * :ref:`vget_prep7_tlab` + + .. _vget_prep7_node: + + \*VGET PREP7 Items, Entity = NODE + ********************************* + + .. flat-table:: ``Entity`` = NODE, ``ENTNUM`` = ``n`` (node number) + :header-rows: 2 + + * - :ref:`starvget`, ``ParR``, NODE, ``n``, ``Item1``, ``IT1NUM``,, ``KLOOP`` + * - Item1 + - IT1NUM + - Description + * - LOC + - X, Y, Z + - X, Y, or Z location in the active coordinate system + * - ANG + - XY, YZ, ZX + - THXY, THYZ, THZX rotation angle + * - NSEL + - + - Select status of node ``n`` : -1 = unselected, 0 = undefined, 1 = selected + * - NLIST + - + - Returns the list of selected nodes ( ``ENTNUM`` is ignored) + + + .. _vget_prep7_elem: + + \*VGET PREP7 Items, Entity = ELEM + ********************************* + + .. flat-table:: ``Entity`` = ELEM, ``ENTNUM`` = ``n`` (element number) + :header-rows: 2 + + * - :ref:`starvget`, ``ParR``, ELEM, ``n``, ``Item1``, ``IT1NUM``,, ``KLOOP`` + * - Item1 + - IT1NUM + - Description + * - NODE + - 1, 2,... 20 + - Node number at position 1, 2,... 20 of element ``n`` + * - CENT + - X, Y, Z + - Centroid X, Y, or Z location (based on shape function) in the active coordinate system + * - ADJ + - 1, 2,... 6 + - Number of elements adjacent to face 1, 2,... 6 + * - ATTR + - ``name`` + - Number assigned to specified attribute; ``name`` = MAT, TYPE, REAL, ESYS, ENAM, or SECN + * - GEOM + - + - Characteristic element geometry. Length of line element (straight line between ends), area of area element, or volume of volume element. Issuing :ref:`starvget` for an element returns a signed value. To always get a positive value, issue :ref:`vabs`,1 prior to issuing the :ref:`starvget` command. + * - ESEL + - + - Select status of element ``n`` : -1 = unselected, 0 = undefined, 1 = selected + * - SHPAR + - ``Test`` + - Element shape test result for selected element ``n``, where ``Test`` = ASPE (aspect ratio), JACR (Jacobian ratio), MAXA (maximum corner angle), PARA (deviation from parallelism of opposite edges), or WARP (warping factor) + * - ELIST + - + - Returns the list of selected elements ( ``ENTNUM`` is ignored) + + + .. _vget_prep7_kp: + + \*VGET PREP7 Items, Entity = KP + ******************************* + + .. flat-table:: ``Entity`` = KP, ``ENTNUM`` = ``n`` (keypoint number) + :header-rows: 2 + + * - :ref:`starvget`, ``ParR``, KP, ``n``, ``Item1``, ``IT1NUM``,, ``KLOOP`` + * - Item1 + - IT1NUM + - Description + * - LOC + - X, Y, Z + - X, Y, or Z location in the active coordinate system + * - ATTR + - ``name`` + - Number assigned to specified attribute; ``name`` = MAT, TYPE, REAL, ESYS, NODE, or ELEM + * - DIV + - + - Divisions (element size setting) from :ref:`kesize` + * - KSEL + - + - Select status of keypoint ``n`` : -1 = unselected, 0 = undefined, 1 = selected + * - KLIST + - + - Returns the list of selected keypoints ( ``ENTNUM`` is ignored) + + + .. _vget_prep7_line: + + \*VGET PREP7 Items, Entity = LINE + ********************************* + + .. flat-table:: ``Entity`` = LINE, ``ENTNUM`` = ``n`` (line number) + :header-rows: 2 + + * - :ref:`starvget`, ``ParR``, LINE, ``n``, ``Item1``, ``IT1NUM``,, ``KLOOP`` + * - Item1 + - IT1NUM + - Description + * - KP + - 1, 2 + - Keypoint number at position 1 or 2 + * - ATTR + - ``name`` + - Number assigned to specified attribute; ``name`` = MAT, TYPE, REAL, ESYS, NNOD, NELM, or NDIV (NNOD = number of nodes, NELM = number of elements, NDIV = number of divisions) + * - LENG + - + - Length + * - LSEL + - + - Select status of line ``n`` : -1 = unselected, 0 = undefined, 1 = selected + * - LLIST + - + - Returns the list of selected lines ( ``ENTNUM`` is ignored) + + + .. _vget_prep7_area: + + \*VGET PREP7 Items, Entity = AREA + ********************************* + + .. flat-table:: ``Entity`` = AREA, ``ENTNUM`` = ``n`` (area number) + :header-rows: 2 + + * - :ref:`starvget`, ``ParR``, AREA, ``n``, ``Item1``, ``IT1NUM``, ``Item2``, ``IT2NUM``, ``KLOOP`` + * - Item1 + - IT1NUM + - Item2 + - IT2NUM + - Description + * - LOOP + - 1,2,... + - LINE + - 1, 2,... ``p`` + - IT1NUM is the loop number, and must be input if LINE is to be retrieved. IT2NUM is line number at position 1, 2,... ``p`` + * - ATTR + - ``name`` + - :rspan:`3` + - :rspan:`3` + - Number assigned to specified attribute; ``name`` = MAT, TYPE, REAL, ESYS, SECN, NNOD, or NELM (NNOD = number of nodes, NELM = number of elements) + * - AREA + - - + - Area (after last :ref:`asum` ) + * - ASEL + - - + - Select status of area ``n`` : -1 = unselected, 0 = undefined, 1 = selected + * - ALIST + - - + - Returns the list of selected areas ( ``ENTNUM`` is ignored) + + + .. _vget_prep7_volu: + + \*VGET PREP7 Items, Entity = VOLU + ********************************* + + .. flat-table:: ``Entity`` = VOLU, ``ENTNUM`` = ``n`` (volume number) + :header-rows: 2 + + * - :ref:`starvget`, ``ParR``, VOLU, ``n``, ``Item1``, ``IT1NUM``, ``Item2``, ``IT2NUM``, ``KLOOP`` + * - Item1 + - IT1NUM + - Item2 + - IT2NUM + - Description + * - SHELL + - 1, 2,... + - AREA + - 1, 2,... ``p`` + - IT1NUM is the shell number, and must be input if AREA is to be retrieved. IT2NUM is area number at position 1, 2... ``p`` + * - ATTR + - ``name`` + - :rspan:`3` + - :rspan:`3` + - Number assigned to specified attribute; ``name`` = MAT, TYPE, REAL, ESYS, NNOD, or NELM (NNOD = number of nodes, NELM = number of elements) + * - VOLU + - - + - Volume (after last :ref:`vsum` ) + * - VSEL + - - + - Select status of volume ``n`` : -1 = unselected, 0 = undefined, 1 = selected + * - VLIST + - - + - Returns the list of selected volumes ( ``ENTNUM`` is ignored) + + + .. _vget_prep7_cdsy: + + \*VGET PREP7 Items, Entity = CDSY + ********************************* + + .. flat-table:: ``Entity`` = CDSY, ``ENTNUM`` = ``n`` (coordinate system number) + :header-rows: 2 + + * - :ref:`starvget`, ``ParR``, CDSY, ``n``, ``Item1``, ``IT1NUM``,, ``KLOOP`` + * - Item1 + - IT1NUM + - Description + * - LOC + - X, Y, Z + - X, Y, or Z origin location (global Cartesian coordinate) + * - ANG + - XY, YZ, ZX + - THXY, THYZ, or THZX rotation angle (°) relative to the global Cartesian coordinate system + * - ATTR + - ``name`` + - Number assigned to specified attribute; ``name`` = KCS, KTHET, KPHI, PAR1, or PAR2. If the coordinate system is undefined, KCS returns as -1.0 + + + .. _vget_prep7_rcon: + + \*VGET PREP7 Items, Entity = RCON + ********************************* + + .. flat-table:: ``Entity`` = RCON, ``ENTNUM`` = ``n`` (real constant set number) + :header-rows: 2 + + * - :ref:`starvget`, ``ParR``, RCON, ``n``, ``Item1``, ``IT1NUM``,, ``KLOOP`` + * - Item1 + - IT1NUM + - Description + * - CONST + - 1, 2,... ``m`` + - Real constant value for constant 1, 2,... ``m`` + + + .. _vget_prep7_tlab: + + \*VGET PREP7 Items, Entity = TLAB + ********************************* + + .. flat-table:: ``Entity`` = ``TLAB``, ``ENTNUM`` = ``n`` ( ``TLAB`` is the ``Lab`` data table label on the :ref:`tb` command. ``n`` is the material number.) + :header-rows: 2 + + * - :ref:`starvget`, ``ParR``, ``TLAB``, ``n``, ``Item1``, ``IT1NUM``,, ``KLOOP`` + * - Item1 + - IT1NUM + - Item2 + - IT2NUM + - Description + * - TEMP + - ``val`` + - CONST + - ``num`` + - IT1NUM ``value`` is the temperature value at which to retrieve table data. ``num`` is the constant number whose value is to be retrieved. For constants input as X, Y points, the constant numbers are consecutive with the X constants being the odd numbers, beginning with one. + + **\*VGET POST1 Items** + + .. _vget_post1: + + * :ref:`vget_post1_cyccalc` + + * :ref:`vget_post1_elem` + + * :ref:`vget_post1_member` + + * :ref:`vget_post1_node_enode` + + * :ref:`vget_post1_node_ndof` + + Vector items are in the active results coordinate system unless otherwise specified. + + .. _vget_post1_cyccalc: + + \*VGET POST1 Items, Entity = CYCCALC + ************************************ + + .. flat-table:: ``Entity`` = CYCCALC, ``ENTNUM`` = ``n`` ( :ref:`cycspec` specification number) + :header-rows: 2 + + * - :ref:`starvget`, ``ParR``, CYCCALC, ``n``, ``Item1``, ``IT1NUM``, ``Item2``, ``IT2NUM``, ``KLOOP`` + * - Item1 + - IT1NUM + - Item2 + - IT2NUm + - Description + * - :rspan:`1` FREQ + - :rspan:`1` ``Frequency point`` + - SECTOR + - ``sector`` + - :ref:`cycspec` results at the IT1NUM frequency or sector (depending on ``KLOOP`` ) + * - SECMAX + - + - :ref:`cycspec` maximum results + * - The frequency point refers to the harmonic solution data set number ( ``NSET`` on the :ref:`set` command). For ``KLOOP`` = 4 or SECMAX, returns the requested sector results for all frequencies and ``IT1NUM`` is ignored. For ``KLOOP`` = 6, returns the requested frequency results for all sectors and ``IT2NUM`` is ignored. All other ``KLOOP`` options are invalid. + + + .. _vget_post1_elem: + + \*VGET POST1 Items, Entity = ELEM + ********************************* + + .. flat-table:: ``Entity`` = ELEM, ``ENTNUM`` = ``n`` (element number) + :header-rows: 2 + + * - :ref:`starvget`, ``ParR``, ELEM, ``n``, ``Item1``, ``IT1NUM``,, ``KLOOP`` + * - Item1 + - IT1NUM + - Description + * - ETAB + - ``Label`` + - Any user-defined element table label (see :ref:`etable` command) + + + .. _vget_post1_member: + + \*VGET POST1 Items, Entity = MEMBER + *********************************** + + .. flat-table:: ``Entity`` = MEMBER, ``ENTNUM`` = ``N`` (GroupID) + :header-rows: 2 + + * - :ref:`starvget`, ``Par`` ,MEMBER, ``N``, ``Item1``, ``IT1NUM``,, ``KLOOP`` + * - Item1 + - IT1NUM + - Description + * - TEMP + - MIN, MAX + - Minimum or maximum temperature of members (individual reinforcings) with GroupID = ``N`` in the selected set of reinforcing elements + + + .. _vget_post1_node_enode: + + \*VGET POST1 Items, Entity = NODE, Element Nodal Results + ******************************************************** + + .. flat-table:: ``Entity`` = NODE, ``ENTNUM`` = ``n`` (node number) + :header-rows: 2 + + * - :ref:`starvget`, ``ParR``, NODE, ``n``, ``Item1``, ``IT1NUM``,, ``KLOOP`` + * - Item1 + - IT1NUM + - Description + - Item2 + * - :rspan:`2` S + - X, Y, Z, XY, YZ, XZ + - Component stress + - :rspan:`2` ``Item2`` controls whether `nodal-averaged results `_ are used. Valid labels are: AUTO - Use nodal-averaged results, if available. Otherwise use element-based results. ESOL- Use element-based results only. NAR - Use nodal-averaged results only. + * - 1, 2, 3 + - Principal stress + * - INT, EQV + - Stress intensity or equivalent stress + * - :rspan:`2` EPTO + - X, Y, Z, XY, YZ, XZ + - Component total strain (EPEL + EPPL + EPCR) + - + * - 1, 2, 3 + - Principal total strain + - + * - INT, EQV + - Total strain intensity or total equivalent strain + - + * - :rspan:`2` EPEL + - X, Y, Z, XY, YZ, XZ + - Component elastic strain + - :rspan:`2` ``Item2`` controls whether `nodal-averaged results`_ are used. Valid labels are: AUTO - Use nodal-averaged results, if available. Otherwise use element-based results. ESOL- Use element-based results only. NAR - Use nodal-averaged results only. + * - 1, 2, 3 + - Principal elastic strain + * - INT, EQV + - Elastic strain intensity or elastic equivalent strain + * - :rspan:`2` EPPL + - X, Y, Z, XY, YZ, XZ + - Component plastic strain + - :rspan:`2` ``Item2`` controls whether `nodal-averaged results`_ are used. Valid labels are: AUTO - Use nodal-averaged results, if available. Otherwise use element-based results. ESOL- Use element-based results only. NAR - Use nodal-averaged results only. + * - 1, 2, 3 + - Principal plastic strain + * - INT, EQV + - Plastic strain intensity or plastic equivalent strain + * - :rspan:`2` EPCR + - X, Y, Z, XY, YZ, XZ + - Component creep strain + - :rspan:`2` ``Item2`` controls whether `nodal-averaged results`_ are used. Valid labels are: AUTO - Use nodal-averaged results, if available. Otherwise use element-based results. ESOL- Use element-based results only. NAR - Use nodal-averaged results only. + * - 1, 2, 3 + - Principal creep strain + * - INT, EQV + - Creep strain intensity or creep equivalent strain + * - :rspan:`2` EPTH + - X, Y, Z, XY, YZ, XZ + - Component thermal strain + - :rspan:`2` ``Item2`` controls whether `nodal-averaged results`_ are used. Valid labels are: AUTO - Use nodal-averaged results, if available. Otherwise use element-based results. ESOL- Use element-based results only. NAR - Use nodal-averaged results only. + * - 1, 2, 3 + - Principal thermal strain + * - INT, EQV + - Thermal strain intensity or thermal equivalent strain + * - EPSW + - + - Swelling strain + - ``Item2`` controls whether `nodal-averaged results`_ are used. Valid labels are: AUTO - Use nodal-averaged results, if available. Otherwise use element-based results. ESOL- Use element-based results only. NAR - Use nodal-averaged results only. + * - :rspan:`2` EPDI + - X, Y, Z, XY, YZ, XZ + - Component diffusion strain + - + * - 1, 2, 3 + - Principal diffusion strain + - + * - INT, EQV + - Diffusion strain intensity or diffusion equivalent strain + - + * - :rspan:`5` NL + - SEPL + - Equivalent stress (from stress-strain curve) + - + * - SRAT + - Stress state ratio + - + * - HPRES + - Hydrostatic pressure + - + * - EPEQ + - Accumulated equivalent plastic strain + - + * - PSV + - Plastic state variable + - + * - PLWK + - Plastic work/volume + - + * - HS + - X, Y, Z + - Component magnetic field intensity from current sources (in the global Cartesian coordinate system) + - + * - BFE + - TEMP + - Body temperatures (calculated from applied temperatures) as used in solution + - + * - TG + - X, Y, Z, SUM + - Component thermal gradient and sum + - + * - TF + - X, Y, Z, SUM + - Component thermal flux and sum + - + * - PG + - X, Y, Z, SUM + - Component pressure gradient and sum + - + * - EF + - X, Y, Z, SUM + - Component electric field and sum + - + * - D + - X, Y, Z, SUM + - Component electric flux density and sum + - + * - H + - X, Y, Z, SUM + - Component magnetic field intensity and sum + - + * - B + - X, Y, Z, SUM + - Component magnetic flux density and sum + - + * - FMAG + - X, Y, Z, SUM + - Component electromagnetic force and sum + - + * - :rspan:`9` CONT + - STAT + - Contact status + - + * - PENE + - Contact penetration + - + * - PRES + - Contact pressure + - + * - SFRIC + - Contact friction stress + - + * - STOT + - Contact total stress (pressure plus friction) + - + * - SLIDE + - Contact sliding distance + - + * - GAP + - Contact gap distance + - + * - FLUX + - Total heat flux at contact surface + - + * - CNOS + - Total number of contact status changes during substep + - + * - FPRS + - Actual applied fluid penetration pressure + - + * - Element nodal results are the average nodal value of the selected elements + + + .. _vget_post1_node_ndof: + + \*VGET POST1 Items, Entity = NODE, Nodal Degree of Freedom Results + ****************************************************************** + + .. flat-table:: ``Entity`` = NODE, ``ENTNUM`` = ``n`` (node number) + :header-rows: 2 + + * - :ref:`starvget`, ``ParR``, NODE, ``n``, ``Item1``, ``IT1NUM``,, ``KLOOP`` + * - Item1 + - IT1NUM + - Description + * - U + - X, Y, Z + - X, Y, or Z structural displacement + * - ROT + - X, Y, Z + - X, Y, or Z structural rotation + * - TEMP + - + - Temperature. For ``SHELL131`` and ``SHELL132`` elements with KEYOPT(3) = 0 or 1, use TBOT, TE2, TE3,..., TTOP instead of TEMP. Alternative get functions: TEMP(N), TBOT(N), TE2(N), etc. + * - PRES + - + - Pressure + * - VOLT + - + - Electric potential + * - MAG + - + - Magnetic scalar potential + * - V + - X, Y, Z + - X, Y, or Z fluid velocity; X, Y, or Z nodal velocity in a transient structural analysis (analysis with :ref:`antype`,TRANS) + * - A + - X, Y, Z + - X, Y, or Z magnetic vector potential; X, Y or Z nodal acceleration in a transient structural analysis (analysis with :ref:`antype`,TRANS) + * - CURR + - + - Current + * - EMF + - + - Electromotive force drop + """ command = ( f"*VGET,{parr},{entity},{entnum},{item1},{it1num},{item2},{it2num},{kloop}" @@ -849,88 +4775,226 @@ def starvget( def taxis( self, - parmloc="", - naxis="", - val1="", - val2="", - val3="", - val4="", - val5="", - val6="", - val7="", - val8="", - val9="", - val10="", + parmloc: str = "", + naxis: str = "", + val1: str = "", + val2: str = "", + val3: str = "", + val4: str = "", + val5: str = "", + val6: str = "", + val7: str = "", + val8: str = "", + val9: str = "", + val10: str = "", **kwargs, ): - """Defines table index numbers. + r"""Defines table index numbers. - APDL Command: ``*TAXIS`` + Mechanical APDL Command: `\*TAXIS `_ Parameters ---------- - parmloc - Name and starting location in the table array parameter for - indexing. Indexing occurs along the axis defined with nAxis. + parmloc : str + Name and starting location in the table array parameter for indexing. Indexing occurs along the + axis defined with ``nAxis``. + + naxis : str + Axis along which indexing occurs. Valid labels are: + + * ``1`` - Corresponds to Row. Default. + + * ``2`` - Corresponds to Column. + + * ``3`` - Corresponds to Plane. + + * ``4`` - Corresponds to Book. + + * ``5`` - Corresponds to Shelf. + + * ``ALL`` - Lists all index numbers. Valid only if ``Val1`` = LIST. + + val1 : str + Values of the index numbers for the axis ``nAxis``, starting from the table array parameter + location ``ParmLoc``. You can define up to ten values. + + To list the index values specified with ``nAxis``, issue ``Val1`` = LIST. If ``Val1`` = LIST, + ``Val2`` - ``Val10`` are ignored. + + val2 : str + Values of the index numbers for the axis ``nAxis``, starting from the table array parameter + location ``ParmLoc``. You can define up to ten values. + + To list the index values specified with ``nAxis``, issue ``Val1`` = LIST. If ``Val1`` = LIST, + ``Val2`` - ``Val10`` are ignored. - naxis - Axis along which indexing occurs. Valid labels are: + val3 : str + Values of the index numbers for the axis ``nAxis``, starting from the table array parameter + location ``ParmLoc``. You can define up to ten values. - Corresponds to Row. Default. - Corresponds to Column. + To list the index values specified with ``nAxis``, issue ``Val1`` = LIST. If ``Val1`` = LIST, + ``Val2`` - ``Val10`` are ignored. - Corresponds to Plane. - Corresponds to Book. + val4 : str + Values of the index numbers for the axis ``nAxis``, starting from the table array parameter + location ``ParmLoc``. You can define up to ten values. - Corresponds to Shelf. - Lists all index numbers. Valid only if Val1 = LIST. + To list the index values specified with ``nAxis``, issue ``Val1`` = LIST. If ``Val1`` = LIST, + ``Val2`` - ``Val10`` are ignored. - val1, val2, val3, . . . , val10 - Values of the index numbers for the axis nAxis, starting from the - table array parameter location ParmLoc. You can define up to ten - values. + val5 : str + Values of the index numbers for the axis ``nAxis``, starting from the table array parameter + location ``ParmLoc``. You can define up to ten values. + + To list the index values specified with ``nAxis``, issue ``Val1`` = LIST. If ``Val1`` = LIST, + ``Val2`` - ``Val10`` are ignored. + + val6 : str + Values of the index numbers for the axis ``nAxis``, starting from the table array parameter + location ``ParmLoc``. You can define up to ten values. + + To list the index values specified with ``nAxis``, issue ``Val1`` = LIST. If ``Val1`` = LIST, + ``Val2`` - ``Val10`` are ignored. + + val7 : str + Values of the index numbers for the axis ``nAxis``, starting from the table array parameter + location ``ParmLoc``. You can define up to ten values. + + To list the index values specified with ``nAxis``, issue ``Val1`` = LIST. If ``Val1`` = LIST, + ``Val2`` - ``Val10`` are ignored. + + val8 : str + Values of the index numbers for the axis ``nAxis``, starting from the table array parameter + location ``ParmLoc``. You can define up to ten values. + + To list the index values specified with ``nAxis``, issue ``Val1`` = LIST. If ``Val1`` = LIST, + ``Val2`` - ``Val10`` are ignored. + + val9 : str + Values of the index numbers for the axis ``nAxis``, starting from the table array parameter + location ``ParmLoc``. You can define up to ten values. + + To list the index values specified with ``nAxis``, issue ``Val1`` = LIST. If ``Val1`` = LIST, + ``Val2`` - ``Val10`` are ignored. + + val10 : str + Values of the index numbers for the axis ``nAxis``, starting from the table array parameter + location ``ParmLoc``. You can define up to ten values. + + To list the index values specified with ``nAxis``, issue ``Val1`` = LIST. If ``Val1`` = LIST, + ``Val2`` - ``Val10`` are ignored. Notes ----- - ``*TAXIS`` is a convenient method to define table index values. These - values reside in the zero column, row, etc. Instead of filling values - in these zero location spots, use the ``*TAXIS`` command. - To list index numbers, issue ```*TAXIS,ParmLoc, nAxis, LIST,`` where - nAxis = 1 through 5 or ALL. + .. warning:: + + This function contains specificities regarding the argument definitions. + Please refer to the `command documentation `_ + for further explanations. + + **Argument Descriptions** + + .. _a-TAXIS_argdescript: + + * ``parmloc : str`` - Name and starting location in the table array parameter for indexing. Indexing + occurs along the axis defined with ``nAxis``. + + * ``naxis : str`` - Axis along which indexing occurs. Valid labels are: + + * ``1`` - Corresponds to Row. Default. + + * ``2`` - Corresponds to Column. + + * ``3`` - Corresponds to Plane. + + * ``4`` - Corresponds to Book. + + * ``5`` - Corresponds to Shelf. + + * ``ALL`` - Lists all index numbers. Valid only if ``Val1`` = LIST. + + * ``val1, val2, val3,..., val10 : str`` - Values of the index numbers for the axis ``nAxis``, + starting from the table array parameter location ``ParmLoc``. You can define up to ten values. + + To list the index values specified with ``nAxis``, issue ``Val1`` = LIST. If ``Val1`` = LIST, + ``Val2`` - ``Val10`` are ignored. + + .. _a-TAXIS_notes: + + :ref:`taxis` is a convenient method to define table index values. These values reside in the zero + column, row, etc. Instead of filling values in these zero location spots, use the :ref:`taxis` + command. For example, + + .. code:: apdl + + *TAXIS,longtable(1,4,1,1),2,1.0,2.2,3.5,4.7,5.9 + + would fill index values 1.0, 2.2, 3.5, 4.7, and 5.9 in ``nAxis`` 2 (column location), starting at + location 4. + + To list index numbers, issue :ref:`taxis`, ``ParmLoc``, ``nAxis``, LIST, where ``nAxis`` = 1 through + 5 or ALL. """ command = f"*TAXIS,{parmloc},{naxis},{val1},{val2},{val3},{val4},{val5},{val6},{val7},{val8},{val9},{val10}" return self.run(command, **kwargs) - def tread(self, par="", fname="", ext="", nskip="", **kwargs): - """Reads data from an external file into a table array parameter. + def tread( + self, par: str = "", fname: str = "", ext: str = "", nskip: str = "", **kwargs + ): + r"""Reads data from an external file into a table array parameter. - APDL Command: ``*TREAD`` + Mechanical APDL Command: `\*TREAD `_ Parameters ---------- - par - Table array parameter name as defined by the ``*DIM`` command. + par : str + Table array parameter name as defined by the :ref:`dim` command. - 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. File name has no default. - ext - Filename extension (eight-character maximum). + ext : str + Filename extension (eight-character maximum). Extension has no default. - nskip - Number of comment lines at the beginning of the file being read - that will be skipped during the reading. Default = 0. + nskip : str + Number of comment lines at the beginning of the file being read that will be skipped during the + reading. Default = 0. Notes ----- - Use this command to read in a table of data from an external file into - an ANSYS table array parameter. The external file may be created using - a text editor or by an external application or program. The external - file must be in tab-delimited, blank-delimited, or comma-delimited - format to be used by ``*TREAD``. The ANSYS TABLE type array parameter must - be defined before you can read in an external file. See ``*DIM`` for more - information. + + .. warning:: + + This function contains specificities regarding the argument definitions. + Please refer to the `command documentation `_ + for further explanations. + + **Argument Descriptions** + + .. _a-TREAD_argdescript: + + * ``par : str`` - Table array parameter name as defined by the :ref:`dim` command. + + * ``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. File name has no default. + + * ``ext : str`` - Filename extension (eight-character maximum). Extension has no default. + + * ``nskip : str`` - Number of comment lines at the beginning of the file being read that will be + skipped during the reading. Default = 0. + + .. _a-TREAD_notes: + + Use this command to read in a table of data from an external file into a table array parameter. The + external file may be created using a text editor or by an external application or program. To be + used by :ref:`tread`, the external file's encoding format must be UTF-8, and the file must be in + tab-delimited, blank-delimited, or comma-delimited format. The TABLE type array parameter must be + defined before you can read in an external file. See :ref:`dim` for more information. This command is not applicable to 4- or 5-D tables. """ @@ -939,120 +5003,200 @@ def tread(self, par="", fname="", ext="", nskip="", **kwargs): def vfill( self, - parr="", - func="", - con1="", - con2="", - con3="", - con4="", - con5="", - con6="", - con7="", - con8="", - con9="", - con10="", + parr: str = "", + func: str = "", + con1: str = "", + con2: str = "", + con3: str = "", + con4: str = "", + con5: str = "", + con6: str = "", + con7: str = "", + con8: str = "", + con9: str = "", + con10: str = "", **kwargs, ): - """Fills an array parameter. + r"""Fills an array parameter. - APDL Command: ``*VFILL`` + Mechanical APDL Command: `\*VFILL `_ Parameters ---------- - parr - The name of the resulting numeric array parameter vector. See ``*SET`` - for name restrictions. + parr : str + The name of the resulting numeric array parameter vector. See :ref:`starset` for name + restrictions. - func + func : str Fill function: - DATA - Assign specified values CON1, CON2, etc. to successive - array elements. Up to 10 assignments may be made at a - time. Any CON values after a blank CON value are - ignored. - Assign ramp function values: ``CON1+((n-1)*CON2)`` - , where n is the loop number [``*VLEN``]. To specify a - constant function (no ramp), set CON2 to zero. - - RAMP - Assign random number values based on a uniform - distribution RAND(CON1,CON2), where: - Assign random - sample of Gaussian distributions GDIS(CON1,CON2). - - RAND - Assign random number values based on a uniform - distribution RAND(CON1,CON2), where CON1 is the lower - bound (defaults to 0.0) and CON2 is the upper bound - (defaults to 1.0) - - GDIS - Assign random sample of Gaussian distributions - GDIS(CON1,CON2) where CON1 is the mean (defaults to 0.0), - and CON2 is the standard deviation (defaults to 1.0) - - TRIA - Assigns random number values based on a triangular - distribution TRIA(CON1,CON2,CON3) where CON1 is the lower - bound (defaults to 0.0), CON2 is the location of the peak - value (CON1 ≤ CON2 ≤CON3; CON2 defaults to 0 if CON1 ≤ 0 ≤ - CON3, CON1 if 0 ≤ CON1, or CON3 if CON3 ≤ 0), and CON3 is - the upper bound (defaults to 1.0 + CON1 if CON1 ≥ 0 or 0.0 - if CON1 ≤ 0) - - BETA - Assigns random number values based on a beta - distribution BETA(CON1,CON2,CON3,CON4) where: CON1 is the - lower bound (defaults to 0.0), CON2 is the upper bound - (defaults to 1.0 + CON1 if CON1 ≥ 0 or 0.0 if CON1 ≤ 0), and CON3 - and CON4 are the alpha and beta parameters, respectively, - of the beta function. Alpha and beta must both be - positive; they default to 1.0. - - GAMM - Assigns random number values based on a gamma - distribution: GAMM(CON1,CON2,CON3) where: CON1 is the - lower bound (defaults to 0.0), CON2 and CON3 are the alpha - and beta parameters, respectively, of the gamma - function. Alpha and beta must both be positive; they - default to 1.0. - - RIGID - Generates the rigid body modes with respect to the - reference point coordinates (CON1, CON2, CON3). The - dimensions of the array parameter ParR are (dim1,dim2) - where dim1 is the maximum node number (including internal - nodes but excluding orientation nodes) multiplied by the - number of degrees of freedom, and dim2 is the number of - rigid body modes (which corresponds to the number of - structural degrees of freedom). - - CLUSTER - Generates excitation frequencies with clustering - option CLUSTER(CON1,CON2,CON3,CON4,%CON5%) where: - - - CON1 is the lower end of the frequency range in Hz (0 < CON1) - - CON2 is the upper end of the frequency range in Hz (CON1 < CON2) - - CON3 is the number of points on each side of the natural - frequency (4 ≤ CON3 ≤ 20, defaults to 4) - - CON4 is the constant damping ratio value or an array - parameter (size NFR) specifying the damping ratios (if - zero or blank, defaults to constant damping ratio of - 0.005) - - CON5 is an array parameter (size NFR) specifying the - natural frequencies in Hz - - The dimension of the resulting array parameter ParR is - less than ``2+NFR*(2*CON3+1)`` where NFR is the number of - natural frequencies defined in CON5. - - con1, con2, con3, . . . , con10 + * ``DATA`` - Assign specified values ``CON1``, ``CON2``, etc. to successive array elements. Up to 10 + assignments may be made at a time. Any CON values after a blank CON value are ignored. + + * ``RAMP`` - Assign ramp function values: ``CON1`` +((n-1)\* ``CON2`` ), where n is the loop number ( :ref:`vlen` ). To specify a constant function (no ramp), set ``CON2`` to zero. + + * ``RAND`` - Assign random number values based on a uniform distribution RAND( ``CON1``, ``CON2`` ), where: + + * ``CON1`` is the lower bound (defaults to 0.0) + * ``CON2`` is the upper bound (defaults to 1.0) + + * ``GDIS`` - Assign random sample of Gaussian distributions GDIS( ``CON1``, ``CON2`` ) where: + + * ``CON1`` is the mean (defaults to 0.0) + * ``CON2`` is the standard deviation (defaults to 1.0) + + * ``TRIA`` - Assigns random number values based on a triangular distribution TRIA( ``CON1``, ``CON2``, ``CON3`` ) where: + + * ``CON1`` is the lower bound (defaults to 0.0) + * ``CON2`` is the location of the peak value ( ``CON1`` ≤ ``CON2`` ≤ ``CON3`` ; ``CON2`` defaults to + 0 if ``CON1`` ≤ 0 ≤ ``CON3``, ``CON1`` if 0 ≤ ``CON1``, or ``CON3`` if ``CON3`` ≤ 0) + * ``CON3`` is the upper bound (defaults to 1.0 + ``CON1`` if ``CON1`` ≥ 0 or 0.0 if ``CON1`` ≤ 0) + + * ``BETA`` - Assigns random number values based on a beta distribution BETA( ``CON1``, ``CON2``, ``CON3``, ``CON4`` ) where: + + * ``CON1`` is the lower bound (defaults to 0.0) + * ``CON2`` is the upper bound (defaults to 1.0 + ``CON1`` if ``CON1`` ≥ 0 or 0.0 if ``CON1`` ≤ 0) + * ``CON3`` and ``CON4`` are the alpha and beta parameters, respectively, of the beta function. Alpha + and beta must both be positive; they default to 1.0. + + * ``GAMM`` - Assigns random number values based on a gamma distribution: GAMM( ``CON1``, ``CON2``, ``CON3`` ) where: + + * ``CON1`` is the lower bound (defaults to 0.0) + * ``CON2`` and ``CON3`` are the alpha and beta parameters, respectively, of the gamma function. + Alpha and beta must both be positive; they default to 1.0. + + * ``RIGID`` - Generates the rigid body modes with respect to the reference point coordinates ( + ``CON1``, ``CON2``, ``CON3`` ). The dimensions of the array parameter ``ParR`` are + (dim:sub:`1`,dim:sub:`2` ) where dim:sub:`1` is the maximum node number (including internal nodes + but excluding orientation nodes ) multiplied by the number of degrees of freedom, and dim:sub:`2` is + the number of rigid body modes (which corresponds to the number of structural degrees of freedom). + + * ``CLUSTER`` - Generates excitation frequencies with clustering option CLUSTER( ``CON1``, ``CON2``, ``CON3``, ``CON4``, ``%CON5%`` ) where: + + * ``CON1`` is the lower end of the frequency range in Hz (0 < ``CON1`` ) + * ``CON2`` is the upper end of the frequency range in Hz ( ``CON1`` < ``CON2`` ) + * ``CON3`` is the number of points on each side of the natural frequency (4 ≤ ``CON3`` ≤ 20, + defaults to 4) + * ``CON4`` is the constant damping ratio value or an array parameter (size NFR) specifying the + damping ratios (if zero or blank, defaults to constant damping ratio of 0.005) + * ``CON5`` is an array parameter (size NFR) specifying the natural frequencies in Hz + The dimension of the resulting array parameter ParR is less than 2+NFR\2(2* + ``CON3`` +1) where NFR is the number of natural frequencies defined in ``CON5``. + + con1 : str + Constants used with above functions. + + con2 : str + Constants used with above functions. + + con3 : str + Constants used with above functions. + + con4 : str + Constants used with above functions. + + con5 : str + Constants used with above functions. + + con6 : str + Constants used with above functions. + + con7 : str + Constants used with above functions. + + con8 : str + Constants used with above functions. + + con9 : str + Constants used with above functions. + + con10 : str Constants used with above functions. Notes ----- - Operates on input data and produces one output array parameter vector - according to: - ParR = f(CON1, CON2, : ...) + .. warning:: + + This function contains specificities regarding the argument definitions. + Please refer to the `command documentation `_ + for further explanations. + + **Argument Descriptions** + + .. _a-VFILL_argdescript: + + * ``parr : str`` - The name of the resulting numeric array parameter vector. See :ref:`starset` for + name restrictions. + + * ``func : str`` - Fill function: + + * ``DATA`` - Assign specified values ``CON1``, ``CON2``, etc. to successive array elements. Up to 10 + assignments may be made at a time. Any CON values after a blank CON value are ignored. + + * ``RAMP`` - Assign ramp function values: ``CON1`` +((n-1)\* ``CON2`` ), where n is the loop number ( :ref:`vlen` ). To specify a constant function (no ramp), set ``CON2`` to zero. + + * ``RAND`` - Assign random number values based on a uniform distribution RAND( ``CON1``, ``CON2`` ), where: + + * ``CON1`` is the lower bound (defaults to 0.0) + * ``CON2`` is the upper bound (defaults to 1.0) + + * ``GDIS`` - Assign random sample of Gaussian distributions GDIS( ``CON1``, ``CON2`` ) where: + + * ``CON1`` is the mean (defaults to 0.0) + * ``CON2`` is the standard deviation (defaults to 1.0) + + * ``TRIA`` - Assigns random number values based on a triangular distribution TRIA( ``CON1``, ``CON2``, ``CON3`` ) where: + + * ``CON1`` is the lower bound (defaults to 0.0) + * ``CON2`` is the location of the peak value ( ``CON1`` ≤ ``CON2`` ≤ ``CON3`` ; ``CON2`` defaults to + 0 if ``CON1`` ≤ 0 ≤ ``CON3``, ``CON1`` if 0 ≤ ``CON1``, or ``CON3`` if ``CON3`` ≤ 0) + * ``CON3`` is the upper bound (defaults to 1.0 + ``CON1`` if ``CON1`` ≥ 0 or 0.0 if ``CON1`` ≤ 0) + + * ``BETA`` - Assigns random number values based on a beta distribution BETA( ``CON1``, ``CON2``, ``CON3``, ``CON4`` ) where: + + * ``CON1`` is the lower bound (defaults to 0.0) + * ``CON2`` is the upper bound (defaults to 1.0 + ``CON1`` if ``CON1`` ≥ 0 or 0.0 if ``CON1`` ≤ 0) + * ``CON3`` and ``CON4`` are the alpha and beta parameters, respectively, of the beta function. Alpha + and beta must both be positive; they default to 1.0. + + * ``GAMM`` - Assigns random number values based on a gamma distribution: GAMM( ``CON1``, ``CON2``, ``CON3`` ) where: - where the functions (f) are described above. Operations use successive - array elements [``*VLEN``, ``*VMASK``] with the default being all successive - elements. For example, ``*VFILL,A,RAMP,1,10`` assigns A(1) = 1.0, A(2) = - 11.0, A(3) = 21.0, etc. ``*VFILL,B(5,1),DATA,1.5,3.0`` assigns ``B(5,1) = - 1.5 and B(6,1) = 3.0``. Absolute values and scale factors may be applied - to the result parameter [``*VABS``, ``*VFACT``]. Results may be cumulative - [``*VCUM``]. See the ``*VOPER`` command for details. + * ``CON1`` is the lower bound (defaults to 0.0) + * ``CON2`` and ``CON3`` are the alpha and beta parameters, respectively, of the gamma function. + Alpha and beta must both be positive; they default to 1.0. + + * ``RIGID`` - Generates the rigid body modes with respect to the reference point coordinates ( + ``CON1``, ``CON2``, ``CON3`` ). The dimensions of the array parameter ``ParR`` are + (dim:sub:`1`,dim:sub:`2` ) where dim:sub:`1` is the maximum node number (including internal nodes + but excluding orientation nodes ) multiplied by the number of degrees of freedom, and dim:sub:`2` is + the number of rigid body modes (which corresponds to the number of structural degrees of freedom). + + * ``CLUSTER`` - Generates excitation frequencies with clustering option CLUSTER( ``CON1``, ``CON2``, ``CON3``, ``CON4``, ``%CON5%`` ) where: + + * ``CON1`` is the lower end of the frequency range in Hz (0 < ``CON1`` ) + * ``CON2`` is the upper end of the frequency range in Hz ( ``CON1`` < ``CON2`` ) + * ``CON3`` is the number of points on each side of the natural frequency (4 ≤ ``CON3`` ≤ 20, + defaults to 4) + * ``CON4`` is the constant damping ratio value or an array parameter (size NFR) specifying the + damping ratios (if zero or blank, defaults to constant damping ratio of 0.005) + * ``CON5`` is an array parameter (size NFR) specifying the natural frequencies in Hz + The dimension of the resulting array parameter ParR is less than 2+NFR\2(2* + ``CON3`` +1) where NFR is the number of natural frequencies defined in ``CON5``. + + * ``con1, con2, con3,..., con10 : str`` - Constants used with above functions. + + .. _a-VFILL_notes: + + Operates on input data and produces one output array parameter vector according to: ``ParR`` = f( + ``CON1``, ``CON2``,...) + + where the functions (f) are described above. Operations use successive array elements ( :ref:`vlen`, + :ref:`vmask` ) with the default being all successive elements. For example, :ref:`vfill` + ,A,RAMP,1,10 assigns A(1) = 1.0, A(2) = 11.0, A(3) = 21.0, etc. :ref:`vfill`,B(5,1),DATA,1.5,3.0 + assigns B(5,1) = 1.5 and B(6,1) = 3.0. Absolute values and scale factors may be applied to the + result parameter ( :ref:`vabs`, :ref:`vfact` ). Results may be cumulative ( :ref:`vcum` ). See the + :ref:`voper` command for details. This command is valid in any processor. """ @@ -1061,88 +5205,132 @@ def vfill( def vread( self, - parr="", - fname="", - ext="", - label="", - n1="", - n2="", - n3="", - nskip="", + parr: str = "", + fname: str = "", + ext: str = "", + label: str = "", + n1: str = "", + n2: str = "", + n3: str = "", + nskip: str = "", **kwargs, ): - """Reads data and produces an array parameter vector or matrix. + r"""Reads data and produces an array parameter vector or matrix. - APDL Command: ``*VREAD`` + Mechanical APDL Command: `\*VREAD `_ Parameters ---------- - parr - The name of the resulting array parameter vector. See ``*SET`` for - name restrictions. The parameter must exist as a dimensioned array - [``*DIM``]. String arrays are limited to a maximum of 8 characters. - - 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. - - ext + parr : str + The name of the resulting array parameter vector. See :ref:`starset` for name restrictions. The + parameter must exist as a dimensioned array ( :ref:`dim` ). String arrays are limited to a + maximum of 8 characters. + + 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. If the ``Fname`` field is left blank, reading + continues from the current input device, such as the terminal. + + ext : str Filename extension (eight-character maximum). - label + label : str Can take a value of IJK, IKJ, JIK, JKI, KIJ, KJI, or blank (IJK). - n1, n2, n3 - Read as (((ParR (i,j,k), k = 1,n1), i = 1, n2), j = 1, n3) for - Label = KIJ. n2 and n3 default to 1. + n1 : str + Read as ((( ``ParR`` (i,j,k), k = 1,n1), i = 1, n2), j = 1, n3) for ``Label`` = KIJ. ``n2`` and + ``n3`` default to 1. + + n2 : str + Read as ((( ``ParR`` (i,j,k), k = 1,n1), i = 1, n2), j = 1, n3) for ``Label`` = KIJ. ``n2`` and + ``n3`` default to 1. + + n3 : str + Read as ((( ``ParR`` (i,j,k), k = 1,n1), i = 1, n2), j = 1, n3) for ``Label`` = KIJ. ``n2`` and + ``n3`` default to 1. - nskip - Number of lines at the beginning of the file being read that will - be skipped during the reading. Default = 0. + nskip : str + Number of lines at the beginning of the file being read that will be skipped during the reading. + Default = 0. Notes ----- - Reads data from a file and fills in an array parameter vector or - matrix. Data are read from a formatted file or, if the menu is off - [/MENU,OFF] and Fname is blank, from the next input lines. The format - of the data to be read must be input immediately following the ``*VREAD`` - command. The format specifies the number of fields to be read per - record, the field width, and the placement of the decimal point (if - none specified in the value). The read operation follows the available - FORTRAN FORMAT conventions of the system (see your system FORTRAN - manual). Any standard FORTRAN real format (such as (4F6.0), - (E10.3,2X,D8.2), etc.) or alphanumeric format (A) may be used. - Alphanumeric strings are limited to a maximum of 8 characters for any - field (A8). For storage of string arrays greater than 8 characters, the - ``*SREAD`` command can be used. Integer (I) and list-directed (*) - descriptors may not be used. The parentheses must be included in the - format and the format must not exceed 80 characters (including - parentheses). The input line length is limited to 128 characters. - - A starting array element number must be defined for the result array - parameter vector (numeric or character). For example, entering these - two lines: - - will read two values from each line of file ARRAYVAL and assign the - values to A(1), A(2), A(3), etc. Reading continues until successive - row elements [``*VLEN``, ``*VMASK``, ``*DIM``] are filled. - - For an array parameter matrix, a starting array element row and column - number must be defined. For example, entering these two lines: - - will read two values from each line of file ARRAYVAL and assign the - values to A(1,1), A(2,1), A(3,1), etc. Reading continues until n1 (10) - successive row elements are filled. Once the maximum row number is - reached, subsequent data will be read into the next column (e.g., + + .. warning:: + + This function contains specificities regarding the argument definitions. + Please refer to the `command documentation `_ + for further explanations. + + **Argument Descriptions** + + .. _a-VREAD_argdescript: + + * ``parr : str`` - The name of the resulting array parameter vector. See :ref:`starset` for name + restrictions. The parameter must exist as a dimensioned array ( :ref:`dim` ). String arrays are + limited to a maximum of 8 characters. + + * ``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. If the ``Fname`` field is left blank, reading + continues from the + current input device, such as the terminal. + + * ``ext : str`` - Filename extension (eight-character maximum). + * ``label : str`` - Can take a value of IJK, IKJ, JIK, JKI, KIJ, KJI, or blank (IJK). + + * ``n1, n2, n3 : str`` - Read as ((( ``ParR`` (i,j,k), k = 1,n1), i = 1, n2), j = 1, n3) for + ``Label`` = KIJ. ``n2`` and ``n3`` default to 1. + + * ``nskip : str`` - Number of lines at the beginning of the file being read that will be skipped + during the reading. Default = 0. + + .. _a-VREAD_notes: + + Reads data from a file and fills in an array parameter vector or matrix. Data are read from a + formatted file or, if the menu is off ( :ref:`menu`,OFF) and ``Fname`` is blank, from the next input + lines. The format of the data to be read must be input immediately following the :ref:`vread` + command. The format specifies the number of fields to be read per record, the field width, and the + placement of the decimal point (if none specified in the value). The read operation follows the + available FORTRAN FORMAT conventions of the system (see your system FORTRAN manual). Any standard + FORTRAN real format (such as (4F6.0), (E10.3,2X,D8.2), etc.) or alphanumeric format (A) may be used. + Alphanumeric strings are limited to a maximum of 8 characters for any field (A8). For storage of + string arrays greater than 8 characters, the \*SREAD command can be used. Integer (I) and list- + directed (\2) descriptors may not be used. The parentheses must be included in the format and the + format must not exceed 80 characters (including parentheses). The input line length is limited to + 128 characters. + + A starting array element number must be defined for the result array parameter vector (numeric or + character). For example, entering these two lines: + + .. code:: apdl + + *VREAD,A(1),ARRAYVAL + (2F6.0) + + will read two values from each line of file ARRAYVAL and assign the values to A(1), A(2), A(3), etc. + Reading continues until successive row elements ( :ref:`vlen`, :ref:`vmask`, :ref:`dim` ) are + filled. + + For an array parameter matrix, a starting array element row and column number must be defined. For + example, entering these two lines: + + .. code:: apdl + + *VREAD,A(1,1),ARRAYVAL,,,IJK,10,2 + (2F6.0) + + will read two values from each line of file ARRAYVAL and assign the values to A(1,1), A(2,1), + A(3,1), etc. Reading continues until ``n1`` (10) successive row elements are filled. Once the + maximum row number is reached, subsequent data will be read into the next column (for example, A(1,2), A(2,2), A(3,2), etc.) - For numerical parameters, absolute values and scale factors may be - applied to the result parameter [``*VABS``, ``*VFACT``]. Results may be - cumulative [``*VCUM``]. See the ``*VOPER`` command for details. If you are in - the GUI the ``*VREAD`` command must be contained in an externally prepared - file read into the ANSYS program (i.e., ``*USE``, /INPUT, etc.). + For numerical parameters, absolute values and scale factors may be applied to the result parameter ( + :ref:`vabs`, :ref:`vfact` ). Results may be cumulative ( :ref:`vcum` ). See the :ref:`voper` command + for details. If you are in the GUI the :ref:`vread` command must be contained in an externally + prepared file read into Mechanical APDL (that is, :ref:`use`, :ref:`input`, etc.). This command is not applicable to 4- or 5-D arrays. diff --git a/src/ansys/mapdl/core/_commands/apdl/process_controls.py b/src/ansys/mapdl/core/_commands/apdl/process_controls.py index 1225b5cae53..64abfcb7493 100644 --- a/src/ansys/mapdl/core/_commands/apdl/process_controls.py +++ b/src/ansys/mapdl/core/_commands/apdl/process_controls.py @@ -22,25 +22,56 @@ class ProcessControls: - def wait(self, dtime="", **kwargs): - """APDL Command: /WAIT - Causes a delay before the reading of the next command. + def starexit(self, **kwargs): + r"""Exits a do-loop. + + Mechanical APDL Command: `\*EXIT `_ + + Notes + ----- + + .. _a-EXIT_notes: + + The command following the ``*ENDDO`` is executed next. The exit option may also be conditional [Use + the ``*IF`` ]. The :ref:`starexit` command must appear on the same file as the ``*DO`` command. + + This command is valid in any processor. + """ + command = "*EXIT" + return self.run(command, **kwargs) + + def wait(self, dtime: str = "", **kwargs): + r"""Causes a delay before the reading of the next command. + + Mechanical APDL Command: `/WAIT `_ Parameters ---------- - dtime + dtime : str Time delay (in seconds). Maximum time delay is 59 seconds. Notes ----- - You should consider using ``time.sleep(dtime)`` - The command following the /WAIT will not be processed until the - specified wait time increment has elapsed. Useful when reading from a - prepared input file to cause a pause, for example, after a display - command so that the display can be reviewed for a period of time. - Another "wait" feature is available via the ``*ASK`` command. + .. warning:: + + This function contains specificities regarding the argument definitions. + Please refer to the `command documentation `_ + for further explanations. + + **Argument Descriptions** + + .. _s-WAIT_argdescript: + + * ``dtime : str`` - Time delay (in seconds). Maximum time delay is 59 seconds. + + .. _s-WAIT_notes: + + The command following the :ref:`wait` will not be processed until the specified wait time increment + has elapsed. Useful when reading from a prepared input file to cause a pause, for example, after a + display command so that the display can be reviewed for a period of time. Another "wait" feature is + available via the ``*ASK`` command. This command is valid in any processor. """ diff --git a/src/ansys/mapdl/core/_commands/graphics_/__init__.py b/src/ansys/mapdl/core/_commands/aux12/__init__.py similarity index 92% rename from src/ansys/mapdl/core/_commands/graphics_/__init__.py rename to src/ansys/mapdl/core/_commands/aux12/__init__.py index a827eef7045..517df786683 100644 --- a/src/ansys/mapdl/core/_commands/graphics_/__init__.py +++ b/src/ansys/mapdl/core/_commands/aux12/__init__.py @@ -20,4 +20,8 @@ # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE # SOFTWARE. -from . import annotation, graphs, labeling, scaling, setup, style, views +from . import ( + general_radiation, + radiation_matrix_method, + radiosity_solver, +) diff --git a/src/ansys/mapdl/core/_commands/reduced/setup.py b/src/ansys/mapdl/core/_commands/aux12/general_radiation.py similarity index 52% rename from src/ansys/mapdl/core/_commands/reduced/setup.py rename to src/ansys/mapdl/core/_commands/aux12/general_radiation.py index 600617e9f8c..6c886108879 100644 --- a/src/ansys/mapdl/core/_commands/reduced/setup.py +++ b/src/ansys/mapdl/core/_commands/aux12/general_radiation.py @@ -21,46 +21,44 @@ # SOFTWARE. -class Setup: - def rmresume(self, fname="", ext="", **kwargs): - """Resumes ROM data from a file. +class GeneralRadiation: - APDL Command: RMRESUME + def aux12(self, **kwargs): + r"""Enters the radiation processor. - Parameters - ---------- - fname - Name and directory path of the ROM database file (248 character - maximum). Default to Jobname. - - ext - Extension of the ROM database file. Default to .rom. + Mechanical APDL Command: `/AUX12 `_ Notes ----- - Distributed ANSYS Restriction: This command is not supported in - Distributed ANSYS. + + .. _s-AUX12_notes: + + Enters the radiation processor (auxiliary processor AUX12). This processor supports the Radiation + Matrix and the Radiosity Solver methods. + + This command is valid only at the Begin Level. """ - command = f"RMRESUME,{fname},{ext}" + command = "/AUX12" return self.run(command, **kwargs) - def rmsave(self, fname="", ext="", **kwargs): - """Saves ROM data to file. + def stef(self, value: str = "", **kwargs): + r"""Specifies Stefan-Boltzmann radiation constant. - APDL Command: RMSAVE + Mechanical APDL Command: `STEF `_ Parameters ---------- - fname - Name and directory path of the ROM database file. Default to - Jobname. - - ext - Extension of the ROM database file. Default to .rom. + value : str + Stefan-Boltzmann constant (defaults to 0.119E-10 Btu/hr/in :sup:`2` / °R :sup:`4` ). Notes ----- - Distributed ANSYS Restriction: This command is not supported in - Distributed ANSYS. + + .. _STEF_notes: + + You can use this command in the general preprocessor (PREP7) and in the Solution processor to + specify the Stefan-Boltzmann constant in analyses using the radiation matrix method or the radiosity + solver to model radiation. """ - return self.run(f"RMSAVE,{fname},{ext}", **kwargs) + command = f"STEF,{value}" + return self.run(command, **kwargs) diff --git a/src/ansys/mapdl/core/_commands/aux12/radiation_matrix_method.py b/src/ansys/mapdl/core/_commands/aux12/radiation_matrix_method.py new file mode 100644 index 00000000000..a69aa293608 --- /dev/null +++ b/src/ansys/mapdl/core/_commands/aux12/radiation_matrix_method.py @@ -0,0 +1,169 @@ +# Copyright (C) 2016 - 2025 ANSYS, Inc. and/or its affiliates. +# SPDX-License-Identifier: MIT +# +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to deal +# in the Software without restriction, including without limitation the rights +# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +# copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in all +# copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +# SOFTWARE. + + +class RadiationMatrixMethod: + + def emis(self, mat: str = "", evalu: str = "", **kwargs): + r"""Specifies emissivity as a material property for the Radiation Matrix method. + + Mechanical APDL Command: `EMIS `_ + + **Command default:** + + .. _EMIS_default: + + Since there is no :ref:`command default value for emissivity, you must issue ` + :ref:`emis` to specify it. Otherwise, an error message appears. If you issue :ref:`emis` without + defining a numerical value, emissivity defaults to 0. + + Parameters + ---------- + mat : str + Material number associated with this emissivity (500 maximum). Defaults to 1. + + evalu : str + Emissivity for this material (0.0 < ``EVALU`` :math:`equation not available` 1.0). Enter a + very small number for zero. + + Notes + ----- + + .. _EMIS_notes: + + Specifies emissivity as a material property for the Radiation Matrix method. This material property + can then be associated with each element. + """ + command = f"EMIS,{mat},{evalu}" + return self.run(command, **kwargs) + + def geom(self, k2d: int | str = "", ndiv: str = "", **kwargs): + r"""Defines the geometry specifications for the radiation matrix calculation. + + Mechanical APDL Command: `GEOM `_ + + Parameters + ---------- + k2d : int or str + Dimensionality key: + + * ``0`` - 3D geometry (default) + + * ``1`` - 2D geometry (plane or axisymmetric) + + ndiv : str + Number of divisions in an axisymmetric model. Used only with ``K2D`` = 1. Defaults to 0 (2D + plane). The 2D model is internally expanded to a 3D model based on the number of divisions + specified (6 :math:`equation not available` ``NDIV`` :math:`equation not available` 90). + For example, ``NDIV`` of 6 is internally represented by six 60° sections. + """ + command = f"GEOM,{k2d},{ndiv}" + return self.run(command, **kwargs) + + def mprint(self, key: int | str = "", **kwargs): + r"""Specifies that radiation matrices are to be printed. + + Mechanical APDL Command: `MPRINT `_ + + Parameters + ---------- + key : int or str + Print key: + + * ``0`` - Do not print matrices. + + * ``1`` - Print matrices. + + Notes + ----- + + .. _MPRINT_notes: + + Specifies that the element and node radiation matrices are to be printed when the :ref:`write` + command is issued. If ``KEY`` = 1, form factor information for each element will also be printed. + """ + command = f"MPRINT,{key}" + return self.run(command, **kwargs) + + def space(self, node: str = "", **kwargs): + r"""Defines a space node for radiation using the Radiation Matrix method. + + Mechanical APDL Command: `SPACE `_ + + Parameters + ---------- + node : str + Node defined to be the space node. + + Notes + ----- + + .. _SPACE_notes: + + A space node is required in an open system to account for radiation losses. + """ + command = f"SPACE,{node}" + return self.run(command, **kwargs) + + def vtype(self, nohid: int | str = "", nzone: str = "", **kwargs): + r"""Specifies the viewing procedure used to determine the form factors for the Radiation Matrix method. + + Mechanical APDL Command: `VTYPE `_ + + Parameters + ---------- + nohid : int or str + Type of viewing procedure: + + * ``0`` - Hidden procedure. + + * ``1`` - Non-hidden (faster, but less general) procedure. + + nzone : str + Number of sampling zones for the hidden procedure (100 maximum for 3D, 1000 maximum for 2D). + Defaults to 20 for 3D, 200 for 2D. Number of points is 2* ``NZONE`` for 2D and 2\* ``NZONE`` \*( ``NZONE`` +1) for 3D. + """ + command = f"VTYPE,{nohid},{nzone}" + return self.run(command, **kwargs) + + def write(self, fname: str = "", **kwargs): + r"""Writes the radiation matrix file. + + Mechanical APDL Command: `WRITE `_ + + Parameters + ---------- + 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 :file:`Jobname`. + + Notes + ----- + + .. _WRITE_notes: + + Writes radiation matrix file ( :file:`File.SUB` ) for input to the substructure thermal "use" pass. + Subsequent :ref:`write` operations to the same file overwrite the file. + """ + command = f"WRITE,{fname}" + return self.run(command, **kwargs) diff --git a/src/ansys/mapdl/core/_commands/aux12/radiosity_solver.py b/src/ansys/mapdl/core/_commands/aux12/radiosity_solver.py new file mode 100644 index 00000000000..c853b436e59 --- /dev/null +++ b/src/ansys/mapdl/core/_commands/aux12/radiosity_solver.py @@ -0,0 +1,216 @@ +# Copyright (C) 2016 - 2025 ANSYS, Inc. and/or its affiliates. +# SPDX-License-Identifier: MIT +# +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to deal +# in the Software without restriction, including without limitation the rights +# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +# copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in all +# copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +# SOFTWARE. + + +class RadiositySolver: + + def vfco(self, action: str = "", encl: str = "", level: int | str = "", **kwargs): + r"""Controls the use and level of view factor condensation for symmetric radiation. + + Mechanical APDL Command: `VFCO `_ + + Parameters + ---------- + action : str + Action to be performed: + + * ``DEFINE`` - Defines the level of view factor condensation (default). + + * ``CLEAR`` - Resets the level of view factor condensation to 0 for all enclosures. All subsequent + arguments are ignored. + + * ``STATUS`` - Outputs the ``LEVEL`` of view factor condensation for each enclosure in the model. + + encl : str + Previously defined enclosure number for the view factor adjustment. + + level : int or str + Key that controls the level of condensation used in calculating the view factor matrix for models + with symmetry. Efficiency gains increase with increasing values of ``LEVEL``. + + * ``0`` - View factor condensation is turned off (default). The view factor matrix is calculated for + all facets, as described in. + + * ``1`` - View factor condensation is turned on. With condensation on, view factors for dependent + facets are not calculated, which reduces solution time for models with symmetry. The view factor + matrix is calculated only for independent facets as described in. This option achieves better + efficiency than ``LEVEL`` = 0. Element NMISC data is written to the results file for both + independent and dependent facets. :ref:`get`,,RAD,,NETHF, which also uses element fluxes, is based + on independent and dependent facets. + + * ``2`` - This option achieves even more efficiency gains than ``LEVEL`` = 1, but it requires more + memory and loses some information. Note that when ``LEVEL`` = 2 is used, dependent facets are + unselected, and no element NMISC data is written to the results file for dependent facets. The same + is true for :ref:`get`,,RAD,,NETHF, which also uses element fluxes and is based on independent + facets only. + + Notes + ----- + + .. _VFCO_notes: + + If view factor condensation is turned on ( :ref:`vfco`, ``ENCL``,1 or :ref:`vfco`, ``ENCL``,2): + + * The dependent facets do not participate in the solution, and only the independent view factors are + calculated as described in. + + * The problem is reduced to solving only for the independent radiosity flux as described in + `Radiosity Equations Simplified for Models with Symmetry + `_ + + * The :ref:`vfsm` command operates on the condensed view factor matrix. + + :ref:`vfco` must be issued before the view factors are computed by issuing either :ref:`vfopt`,NEW + or :ref:`solve`. + + **Example Usage** + `Example of a 3D Open Enclosure with Symmetry: Radiation Analysis with Condensed View Factor + Calculation + `_ + """ + command = f"VFCO,{action},{encl},{level}" + return self.run(command, **kwargs) + + def vfquery(self, srcelem: str = "", tarelem: str = "", **kwargs): + r"""Queries and prints element Hemicube view factors and average view factor. + + Mechanical APDL Command: `VFQUERY `_ + + Parameters + ---------- + srcelem : str + Elements representing the source radiating surfaces used to query the view factor at the target + element(s). If ``SRCELEM`` = P, graphical picking is enabled (valid only in the GUI). If + ``SRCELEM`` = ALL, all selected elements will have their view factors queried. A component name + may also be substituted for ``SRCELEM``. Selected elements must be flagged for surface to + surface radiation in order to query view factors ( :ref:`sf`, :ref:`sfa`, or :ref:`sfe` with Lab + = RDSF). The view factors must have been previously computed. + + tarelem : str + Element for view factor query. If ``TARELEM`` = P, graphical picking is enabled (valid only in + the GUI). If ``TARELEM`` = ALL, all selected elements will have their view factors queried. A + component name may also be substituted for ``TARELEM``. Selected elements must be flagged for + surface to surface radiation in order to query view factors ( :ref:`sf`, :ref:`sfa`, or + :ref:`sfe` with Lab = RDSF). The view factors must have been previously computed. + + Notes + ----- + + .. _VFQUERY_notes: + + View factors for each target element will be printed. + + An average view factor for all target elements will be computed. (Use :ref:`get` to retrieve the + average value). + + When resuming a database, issue the command :ref:`vfopt`,READ before issuing the :ref:`vfquery` + command. + """ + command = f"VFQUERY,{srcelem},{tarelem}" + return self.run(command, **kwargs) + + def vfsm( + self, + action: str = "", + encl: str = "", + opt: int | str = "", + maxiter: str = "", + conv: str = "", + **kwargs, + ): + r"""Adjusts view factor matrix to satisfy reciprocity and/or row sum properties. + + Mechanical APDL Command: `VFSM `_ + + Parameters + ---------- + action : str + Action to be performed: + + * ``DEFINE`` - Define a view factor summation (default) + + * ``CLEAR`` - Resets the scaling method to 0 for all enclosures. All subsequent arguments are + ignored. + + * ``STATUS`` - Outputs the ``OPT`` value for each enclosure in the model. + + encl : str + Previously defined enclosure number for the view factor adjustment. + + opt : int or str + Option key: + + * ``0`` - The view factor matrix values are not adjusted (default). + + * ``1`` - The view factor matrix values are adjusted so that the row sum equals 1.0. + + * ``2`` - The view factor matrix values are adjusted so that the row sum equals 1.0 and the + reciprocity relationship is satisfied. + + * ``3`` - The view factor matrix values are adjusted so that the reciprocity relationship is + satisfied. + + * ``4`` - The view factor matrix values are adjusted so that the original row sum is maintained and + the reciprocity relationship is satisfied. + + maxiter : str + Maximum number of iterations to achieve convergence. Valid only when ``OPT`` = 2 or 4. Default + is 100. + + conv : str + Convergence value for row sum. Iterations will continue (up to ``MAXITER`` ) until the maximum + residual over all the rows is less than this value. Valid only when ``OPT`` = 2 or 4. Default is + 1E-3. + + Notes + ----- + + .. _VFSM_notes: + + To have a good energy balance, it is important to satisfy both the row sum and reciprocity + relationships. For more information, see `View Factors + `_ + in the `Mechanical APDL Theory Reference + `_. + + ``OPT`` = 1 and 2 are suitable for perfect enclosures. ``OPT`` = 1 is less expensive than ``OPT`` = + 2 because no iterations are involved. However, with ``OPT`` = 1, the reciprocity relationship is not + satisfied. + + ``OPT`` = 3 and 4 are suitable for leaky enclosures. ``OPT`` = 3 is less expensive than ``OPT`` = 4 + because no iterations are involved. However, with ``OPT`` = 3, the original row sum is not + maintained. + + The :ref:`vfsm` command must be used before :ref:`vfopt` is issued, or Solve is initiated. + + While the primary purpose of the :ref:`vfsm` command is to adjust the viewfactor matrix to satisfy + reciprocity and rowsum properties, a side effect of this command is that the model could flip from + being an imperfect to a perfect enclosure and the space node ignored if the rowsum becomes 1.0. The + program's check for an imperfect enclosure is not based geometry, but rather on the value of the + rowsum of all rows of the enclosure view factor matrix. A rowsum close to 1.0 is deemed a perfect + enclosure; otherwise, it is an imperfect enclosure, which requires you to define a spacenode. It is + important to be aware that the :ref:`vfsm` command can affect the `view factor + `_ + rowsum and potentially also whether the enclosure is treated as an imperfect or perfect enclosure. + """ + command = f"VFSM,{action},{encl},{opt},{maxiter},{conv}" + return self.run(command, **kwargs) diff --git a/src/ansys/mapdl/core/_commands/aux12_/general_radiation.py b/src/ansys/mapdl/core/_commands/aux12_/general_radiation.py deleted file mode 100644 index b2bfdf0d674..00000000000 --- a/src/ansys/mapdl/core/_commands/aux12_/general_radiation.py +++ /dev/null @@ -1,71 +0,0 @@ -# Copyright (C) 2016 - 2025 ANSYS, Inc. and/or its affiliates. -# SPDX-License-Identifier: MIT -# -# -# Permission is hereby granted, free of charge, to any person obtaining a copy -# of this software and associated documentation files (the "Software"), to deal -# in the Software without restriction, including without limitation the rights -# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -# copies of the Software, and to permit persons to whom the Software is -# furnished to do so, subject to the following conditions: -# -# The above copyright notice and this permission notice shall be included in all -# copies or substantial portions of the Software. -# -# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -# SOFTWARE. - - -class GeneralRadiation: - def stef(self, value="", **kwargs): - """Specifies Stefan-Boltzmann radiation constant. - - APDL Command: STEF - - Parameters - ---------- - value - Stefan-Boltzmann constant (defaults to 0.119E-10 Btu/hr/in2/ °R4). - - Notes - ----- - You can use this command in the general preprocessor (PREP7) and in the - Solution processor to specify the Stefan-Boltzmann constant in analyses - using the radiation matrix method or the radiosity solver to model - radiation. - """ - command = f"STEF,{value}" - return self.run(command, **kwargs) - - def toffst(self, value="", **kwargs): - """Specifies the temperature offset from absolute zero to zero. - - APDL Command: TOFFST - - Parameters - ---------- - value - Degrees between absolute zero and zero of temperature system used - (should be positive). - - Notes - ----- - Specifies the difference (in degrees) between absolute zero and the - zero of the temperature system used. Absolute temperature values are - required in evaluating certain expressions, such as for creep, - swelling, radiation heat transfer, MASS71, etc. (The offset - temperature is not used in evaluating emissivity.) Examples are 460° - for the Fahrenheit system and 273° for the Celsius system. The offset - temperature is internally included in the element calculations and does - not affect the temperature input or output. If used in SOLUTION, this - command is valid only within the first load step. - - This command is also valid in PREP7. - """ - command = f"TOFFST,{value}" - return self.run(command, **kwargs) diff --git a/src/ansys/mapdl/core/_commands/aux12_/radiation_mat.py b/src/ansys/mapdl/core/_commands/aux12_/radiation_mat.py deleted file mode 100644 index 7be6c4c4123..00000000000 --- a/src/ansys/mapdl/core/_commands/aux12_/radiation_mat.py +++ /dev/null @@ -1,170 +0,0 @@ -# Copyright (C) 2016 - 2025 ANSYS, Inc. and/or its affiliates. -# SPDX-License-Identifier: MIT -# -# -# Permission is hereby granted, free of charge, to any person obtaining a copy -# of this software and associated documentation files (the "Software"), to deal -# in the Software without restriction, including without limitation the rights -# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -# copies of the Software, and to permit persons to whom the Software is -# furnished to do so, subject to the following conditions: -# -# The above copyright notice and this permission notice shall be included in all -# copies or substantial portions of the Software. -# -# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -# SOFTWARE. - - -class RadiationMat: - def emis(self, mat="", evalu="", **kwargs): - """Specifies emissivity as a material property for the Radiation Matrix - - APDL Command: EMIS - method. - - Parameters - ---------- - mat - Material number associated with this emissivity (500 maximum). - Defaults to 1. - - evalu - Emissivity for this material (0.0 < EVALU 1.0). Enter a very - small number for zero. - - Notes - ----- - Specifies emissivity as a material property for the Radiation Matrix - method. This material property can then be associated with each - element. - """ - command = f"EMIS,{mat},{evalu}" - return self.run(command, **kwargs) - - def geom(self, k2d="", ndiv="", **kwargs): - """Defines the geometry specifications for the radiation matrix - - APDL Command: GEOM - calculation. - - Parameters - ---------- - k2d - Dimensionality key: - - 0 - 3-D geometry (default) - - 1 - 2-D geometry (plane or axisymmetric) - - ndiv - Number of divisions in an axisymmetric model. Used only with K2D = - 1. Defaults to 0 (2-D plane). The 2-D model is internally - expanded to a 3-D model based on the number of divisions specified - (6 NDIV 90). For example, NDIV of 6 is internally represented - by six 60° sections. - """ - command = f"GEOM,{k2d},{ndiv}" - return self.run(command, **kwargs) - - def mprint(self, key="", **kwargs): - """Specifies that radiation matrices are to be printed. - - APDL Command: MPRINT - - Parameters - ---------- - key - Print key: - - 0 - Do not print matrices. - - 1 - Print matrices. - - Notes - ----- - Specifies that the element and node radiation matrices are to be - printed when the WRITE command is issued. If KEY = 1, form factor - information for each element will also be printed. - """ - command = f"MPRINT,{key}" - return self.run(command, **kwargs) - - def space(self, node="", **kwargs): - """Defines a space node for radiation using the Radiation Matrix method. - - APDL Command: SPACE - - Parameters - ---------- - node - Node defined to be the space node. - - Notes - ----- - A space node is required in an open system to account for radiation - losses. - - If using SPACE with the ANSYS Multi-field solver (MFS), you must - capture this command in the command file using MFCMMAND. This step is - necessary because at the end of each field computation, this command is - unset. - """ - command = f"SPACE,{node}" - return self.run(command, **kwargs) - - def vtype(self, nohid="", nzone="", **kwargs): - """Specifies the viewing procedure used to determine the form factors for - - APDL Command: VTYPE - the Radiation Matrix method. - - Parameters - ---------- - nohid - Type of viewing procedure: - - 0 - Hidden procedure. - - 1 - Non-hidden (faster, but less general) procedure. - - nzone - Number of sampling zones for the hidden procedure (100 maximum for - 3-D, 1000 maximum for 2-D). Defaults to 20 for 3-D, 200 for 2-D. - Number of points is ``2*NZONE`` for 2-D and ``2*NZONE*(NZONE+1)`` for 3-D. - """ - command = f"VTYPE,{nohid},{nzone}" - return self.run(command, **kwargs) - - def write(self, fname="", **kwargs): - """Writes the radiation matrix file. - - APDL Command: WRITE - - 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. - - Notes - ----- - Writes radiation matrix file (File.SUB) for input to the substructure - thermal "use" pass. Subsequent WRITE operations to the same file - overwrite the file. - """ - command = f"WRITE,{fname}" - return self.run(command, **kwargs) diff --git a/src/ansys/mapdl/core/_commands/aux12_/radiosity_solver.py b/src/ansys/mapdl/core/_commands/aux12_/radiosity_solver.py deleted file mode 100644 index 3d96a7bc6b2..00000000000 --- a/src/ansys/mapdl/core/_commands/aux12_/radiosity_solver.py +++ /dev/null @@ -1,475 +0,0 @@ -# Copyright (C) 2016 - 2025 ANSYS, Inc. and/or its affiliates. -# SPDX-License-Identifier: MIT -# -# -# Permission is hereby granted, free of charge, to any person obtaining a copy -# of this software and associated documentation files (the "Software"), to deal -# in the Software without restriction, including without limitation the rights -# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -# copies of the Software, and to permit persons to whom the Software is -# furnished to do so, subject to the following conditions: -# -# The above copyright notice and this permission notice shall be included in all -# copies or substantial portions of the Software. -# -# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -# SOFTWARE. - - -class RadiositySolver: - def hemiopt(self, hres="", tolerance="", **kwargs): - """Specifies options for Hemicube view factor calculation. - - APDL Command: HEMIOPT - - Parameters - ---------- - 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},{tolerance}" - return self.run(command, **kwargs) - - def radopt( - self, - fluxtol="", - solver="", - maxiter="", - toler="", - overrlex="", - maxfluxiter="", - **kwargs, - ): - """Specifies Radiosity Solver options. - - APDL Command: RADOPT - - Parameters - ---------- - fluxtol - Convergence tolerance for radiation flux. Defaults to 0.0001. This - value is a relative tolerance. - - solver - Choice of solver for radiosity calculation: - - 0 - Gauss-Seidel iterative solver (default). - - 1 - Direct solver. - - 2 - Jacobi solver. - - maxiter - Maximum number of iterations for iterative solver (SOLVER = 0 or - 2). Defaults to 1000. - - toler - Convergence tolerance for the iterative solver (SOLVER = 0 or 2). - Defaults to 0.1. - - overrlex - Over-relaxation factor applied to the iterative solver (SOLVER = 0 - or 2). Defaults to 0.1. - - maxfluxiter - Maximum number of flux iterations to be performed according to the - specified solver type: - - 0 - If the FULL solver is specified (``THOPT,FULL``), convergence - criteria are monitored and iterations are performed until - convergence occurs. If the QUASI solver is specified - (``THOPT,QUASI``), convergence criteria are ignored and one - iteration is performed. This value is the default. - - 1, 2, 3, ...N - If the FULL solver is specified (``THOPT,FULL``), convergence - criteria are monitored and iterations are performed until - convergence occurs, or until the specified number of iterations - has been completed, whichever comes first. If the QUASI solver - is specified (``THOPT,QUASI``), convergence criteria are ignored and - the specified number of iterations are completed. - - Notes - ----- - The radiation heat flux is linearized, resulting in robust convergence. - - The radiation flux norm for FLUXTOL is expressed as: - - where i is the pass or iteration number and j is the surface facet for - radiation. - - For a sufficiently small absolute tolerance value, relative tolerance - converges in fewer iterations than absolute tolerance. For a - sufficiently large absolute tolerance value, relative tolerance may - cause convergence difficulties. - - For more information about FLUXTOL and MAXFLUXITER usage, see Figure: - 3.5:: FULL Solution Method When Radiosity Is Present and Figure: 3.6:: - QUASI Solution Method When Radiosity Is Present in the Thermal Analysis - Guide. - - In Figure: 3.5:: FULL Solution Method When Radiosity Is Present and - Figure: 3.6:: QUASI Solution Method When Radiosity Is Present (under - Solving for Temperature and Radiosity in the Thermal Analysis Guide), - refer to the KQQ = FQ equation system via the iterative method: - - If TOLER ≥ 0, the iterative solver is converged for maximum value over - a different j as shown: - - If TOLER < 0, the iterative solver is converged for maximum value over - a different j as shown: - - where: - - The Jacobi solver (SOLVER = 2) is suitable when using Distributed - ANSYS. This option is only available for 3-D models; if SOLVER is set - to 2 for a 2-D analysis, the Gauss-Seidel iterative solver (SOLVER = 0) - is used. - """ - command = ( - f"RADOPT,,{fluxtol},{solver},{maxiter},{toler},{overrlex},,,,,{maxfluxiter}" - ) - return self.run(command, **kwargs) - - def spcnod(self, encl="", node="", **kwargs): - """Defines a space node for radiation using the Radiosity method. - - APDL Command: SPCNOD - - Parameters - ---------- - encl - Radiating surface enclosure number. Defaults to 1. If ENCL = STAT, - the command lists all enclosure space nodes. If ENCL = DELE, the - command deletes all enclosure space nodes. - - node - Node defined to be the space node. - - Notes - ----- - For open systems, an enclosure may radiate to a space node (NODE). - - Open systems may be characterized by one or more enclosures (ENCL). - Each enclosure may radiate to a different space node (NODE). - - For a space node that is not part of the finite element model, specify - the temperature using the D command. For the first load step, the space - node temperature ramps from the uniform temperature specified by the - TUNIF command to the temperature specified by the D command. For - subsequent load steps, it ramps from the previous value of the space - node temperature. For intermediate load steps, use the SPCNOD,DELETE - command and specify the space node temperature again to ramp from the - uniform temperature. - - For a space node that is part of the finite element model, the - temperature is that calculated during the finite element solution. - """ - command = f"SPCNOD,{encl},{node}" - return self.run(command, **kwargs) - - def spctemp(self, encl="", temp="", **kwargs): - """Defines a free-space ambient temperature for radiation using the - - APDL Command: SPCTEMP - Radiosity method. - - Parameters - ---------- - encl - Radiating surface enclosure number. Defaults to 1. If ENCL = STAT, - the command lists all enclosure space temperatures. If ENCL = - DELE, the command deletes all enclosure space temperatures. - - temp - Temperature of free-space in the reference temperature system. The - temperature will be offset by the value specified in the TOFFST - command for internal calculations. - - Notes - ----- - For open systems, an enclosure may radiate to the free-space ambient - temperature (TEMP). - - Open systems may be characterized by one or more enclosures (ENCL). - Each enclosure may radiate to a different free-space ambient - temperature (TEMP). - - For the first load step, the space temperature ramps from the uniform - temperature specified by the TUNIF command to the temperature specified - by the SPCTEMP command. For subsequent load steps, it ramps from the - previous value of the space temperature. For intermediate load steps, - use the SPCTEMP,DELETE command and specify the space temperature again - to ramp from the uniform temperature. - - If using SPCTEMP with the ANSYS Multi-field solver (MFS), you must - capture this command in the command file using MFCMMAND. This step is - necessary because at the end of each field computation, this command is - unset. - """ - command = f"SPCTEMP,{encl},{temp}" - return self.run(command, **kwargs) - - def v2dopt(self, geom="", ndiv="", hidopt="", nzone="", **kwargs): - """Specifies 2-D/axisymmetric view factor calculation options. - - APDL Command: V2DOPT - - Parameters - ---------- - geom - Choice of geometry: - - 0 - Planar (default). - - 1 - Axisymmetric - - ndiv - Number of divisions for axisymmetric geometry (that is, the number - of circumferential segments). Default is 20. Maximum is 90. - - hidopt - Viewing option: - - 0 - Hidden (default). - - 1 - Non-hidden - - nzone - Number of zones (that is, the number of rays emanating from a - surface) for view factor calculation. Default is 200. Maximum is - 1000. - """ - command = f"V2DOPT,{geom},{ndiv},{hidopt},{nzone}" - return self.run(command, **kwargs) - - def vfsm(self, action="", encl="", opt="", maxiter="", conv="", **kwargs): - """Adjusts view factor matrix to satisfy reciprocity and/or - row sum properties. - - APDL Command: VFSM - - Parameters - ---------- - action - Action to be performed: - - Define - Define a view factor summation (default) - - Clear - Resets the scaling method to 0 for all - enclosures. All subsequent arguments are ignored. - - Status - Outputs the OPT value for each enclosure in the model. - - encl - Previously defined enclosure number for the view factor adjustment. - - opt - Option key: - - 0 - The view factor matrix values are not adjusted (default). - - 1 - The view factor matrix values are adjusted so that the - row sum equals 1.0. - - 2 - The view factor matrix values are adjusted so that the - row sum equals 1.0 and the reciprocity relationship is - satisfied. - - 3 - The view factor matrix values are adjusted so that the - original row sum is maintained. - - 4 - The view factor matrix values are adjusted so that the - original row sum is maintained and the reciprocity - relationship is satisfied. - - maxiter - Maximum number of iterations to achieve convergence. Valid only - when OPT = 2 or 4. Default is 100. - - conv - Convergence value for row sum. Iterations will continue (up to - MAXITER) until the maximum residual over all the rows is less than - this value. Valid only when OPT = 2 or 4. Default is 1E-3. - - Notes - ----- - To have a good energy balance, it is important to satisfy both the row - sum and reciprocity relationships. For more information, see View - Factors in the Mechanical APDL Theory Reference. - - OPT = 1 and 2 are suitable for perfect enclosures. OPT = 1 is less - expensive than OPT = 2 because no iterations are involved. However, - with OPT = 1, the reciprocity relationship is not satisfied. - - OPT = 3 and 4 are suitable for leaky enclosures. OPT = 3 is less - expensive than OPT = 4 because no iterations are involved. However, - with OPT = 3, the reciprocity relationship is not satisfied. - - The VFSM command must be used before VFOPT is issued, or Solve is - initiated. - """ - command = f"VFSM,{action},{encl},{opt},{maxiter},{conv}" - return self.run(command, **kwargs) - - def vfopt( - self, - opt="", - filename="", - ext="", - dir_="", - filetype="", - fileformat="", - **kwargs, - ): - """Specifies options for the view factor file and calculates view factors. - - APDL Command: VFOPT - - Parameters - ---------- - opt - View factor option: - - NEW - Calculate view factors and write them to a file. - - OFF - Do not recalculate view factors it they already exist in the database, - otherwise calculate compute them. This option is the default - behavior. - - READ - Read view factors from a binary file. For subsequent SOLVE commands, switch to - the default option (OFF). - - NONE - Do not write view factors to a file. - - fname - File name for view factor matrix. Default = Jobname. - - ext - Filename extension for view factor matrix. Default = .vf. - - dir\\_ - Directory path for view factor matrix. If you do not specify a - directory path, it will default to your working directory. - - filetype - View factor file type: - - BINA - Binary (default). - - ASCI - ASCII. - - fileformat - Format for the specified Filetype: - - Binary files (Filetype = BINA): - - 0 - No compression. (View factor file size may be very large.) - - 1 - Zeroes are compressed out. (Useful for large models to reduce - the view factor file size.) - - ASCII files (Filetype = ASCI): - - 0 - 10F7.4 (low precision, lower accuracy). - - 1 - 7F11.8 (high precision, higher accuracy). - - Notes - ----- - The VFOPT command allows you to deactivate the view factor computation - (Opt = OFF) if the view factors already exist in the database. The - default behavior is OFF upon encountering the second and subsequent - SOLVE commands in the solution processor. - - When Opt = READ, only a previously calculated view factor binary file - is valid. - - For 3-D analyses, two options are available for calculating view - factors when running Distributed ANSYS: - - Issue a SOLVE command -- View factors are calculated in parallel mode - if no view factors were previously calculated. - - Issue a VFOPT,NEW command -- View factors are calculated in serial - mode. - - For 2-D analyses, view factors are calculated in serial mode. - """ - command = f"VFOPT,{opt},{filename},{ext},{dir_},{filetype},{fileformat}" - return self.run(command, **kwargs) - - def vfquery(self, srcelem="", tarelem="", wropt="", **kwargs): - """Queries and prints element Hemicube view factors and average view - - APDL Command: VFQUERY - factor. - - Parameters - ---------- - srcelem - Elements representing the source radiating surfaces used to query - the view factor at the target element(s). If SRCELEM = P, graphical - picking is enabled (valid only in the GUI). If SRCELEM = ALL, all - selected elements will have their view factors queried. A component - name may also be substituted for SRCELEM. Selected elements must be - flagged for surface to surface radiation in order to query view - factors (SF, SFA, or SFE with Lab = RDSF). The view factors must - have been previously computed. - - tarelem - Element for view factor query. If TARELEM = P, graphical picking is - enabled (valid only in the GUI). If TARELEM = ALL, all selected - elements will have their view factors queried. A component name may - also be substituted for TARELEM. Selected elements must be flagged - for surface to surface radiation in order to query view factors - (SF, SFA, or SFE with Lab = RDSF). The view factors must have been - previously computed. - - Notes - ----- - View factors for each target element will be printed. - - An average view factor for all target elements will be computed. (Use - ``*GET`` to retrieve the average value). - - When resuming a database, issue the command VFOPT,READ before issuing - the VFQUERY command. - """ - command = f"VFQUERY,{srcelem},{tarelem},,{wropt}" - return self.run(command, **kwargs) diff --git a/src/ansys/mapdl/core/_commands/display_/__init__.py b/src/ansys/mapdl/core/_commands/aux15/__init__.py similarity index 97% rename from src/ansys/mapdl/core/_commands/display_/__init__.py rename to src/ansys/mapdl/core/_commands/aux15/__init__.py index 737c36038cc..483a9e20579 100644 --- a/src/ansys/mapdl/core/_commands/display_/__init__.py +++ b/src/ansys/mapdl/core/_commands/aux15/__init__.py @@ -20,4 +20,6 @@ # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE # SOFTWARE. -from . import setup +from . import ( + iges, +) diff --git a/src/ansys/mapdl/core/_commands/aux15/iges.py b/src/ansys/mapdl/core/_commands/aux15/iges.py new file mode 100644 index 00000000000..fbe4df4a7f3 --- /dev/null +++ b/src/ansys/mapdl/core/_commands/aux15/iges.py @@ -0,0 +1,176 @@ +# Copyright (C) 2016 - 2025 ANSYS, Inc. and/or its affiliates. +# SPDX-License-Identifier: MIT +# +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to deal +# in the Software without restriction, including without limitation the rights +# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +# copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in all +# copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +# SOFTWARE. + + +class Iges: + + def aux15(self, **kwargs): + r"""Enters the IGES file transfer processor. + + Mechanical APDL Command: `/AUX15 `_ + + Notes + ----- + + .. _s-AUX15_notes: + + Enters the IGES file-transfer processor (auxiliary processor AUX15), used to read an IGES data file + into the Mechanical APDL program. + + This command is valid only at the Begin Level. + """ + command = "/AUX15" + return self.run(command, **kwargs) + + def igesin(self, fname: str = "", ext: str = "", **kwargs): + r"""Transfers IGES data from a file into Mechanical APDL. + + Mechanical APDL Command: `IGESIN `_ + + Parameters + ---------- + 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 :file:`Jobname`. + + ext : str + Filename extension (eight-character maximum). The extension defaults to CAD if ``Fname`` is + blank. + + Notes + ----- + + .. _IGESIN_notes: + + Reads a file containing IGES data and transfers it into the Mechanical APDL database. The file + transferred + is the IGES Version 5.1, ASCII format file. IGES (Initial Graphics Exchange Specification) is a + neutral format developed by the U.S. Dept. of Commerce, National Institute of Standards and + Technology. No output transfer file is written because the transferred data is read directly into + the Mechanical APDL database. + + You can import multiple files into a single database, but you must use the same import option (set + with the :ref:`ioptn` command) for each file. + + The :ref:`ioptn` command sets the parameters for reading the file. Files read via the SMOOTH method + (the only available method) use the standard database. + """ + command = f"IGESIN,{fname},{ext}" + return self.run(command, **kwargs) + + def ioptn(self, lab: str = "", val1: str = "", **kwargs): + r"""Controls options relating to importing a model. + + Mechanical APDL Command: `IOPTN `_ + + Parameters + ---------- + lab : str + Label identifying the import option. The meaning of ``VAL1`` varies depending on ``Lab``. + + * ``STAT`` - List overall status of import facilities, including current option values. ``VAL1`` is + ignored. + + * ``DEFA`` - Set default values for all import options. ``VAL1`` is ignored. + + * ``MERG`` - Entity merge option. ``VAL1`` can be: + + * ``YES`` - Automatic merging is performed (default). + + * ``NO`` - No merging of entities. + + * ``SOLID`` - Solid option. ``VAL1`` can be: + + * ``YES`` - Solid is created automatically (default). + + * ``NO`` - No solid created. + + * ``GTOLER`` - Entity merging tolerance. If IGES = SMOOTH, the GTOLER, ``VAL1`` can be: + + * ``DEFA`` - Use system defaults (default). + + * ``FILE`` - Use tolerance from the imported file. + + * ``n`` - A user-specified tolerance value. + + * ``IGES`` - IGES import option. ``VAL1`` can be: + + * ``STAT`` - List status of IGES related options in the output window. + + * ``SMOOTH (or RV52)`` - Use more robust IGES revision 5.2 import function (default). + + * ``SMALL`` - Small areas option. ``VAL1`` can be: + + * ``YES`` - Small areas are deleted (default). + + * ``NO`` - Small areas are retained. + + val1 : str + Additional input value as described under each ``Lab`` option. + + Notes + ----- + + .. _IOPTN_notes: + + Controls various options during a model file transfer. A global solid model tolerance (GTOLER) can + be specified. + + The SMALL,YES option (default) delete small areas and can cause geometrical inconsistencies that + could cause the import process to abort. Retaining the small areas increases processor time and + memory usage. + + The data is stored in the standard Mechanical APDL graphics database. + + The IGES,SMOOTH (default) option is capable of reading in any rational B-spline curve entity (type + 126), or rational B-spline surface entity (type 128) with a degree less than or equal to 20. + Attempts to read in B-spline curve or surface entities of degree higher than 20 may result in error + messages. + + If you issue the ``/CLEAR`` command, the :ref:`ioptn` settings return to their defaults. + + For MERG,YES, merging of coincident geometry items is performed automatically when the :ref:`igesin` + command is issued (that is, an internal :ref:`nummrg`,KP command is issued). The model is merged + with the consideration tolerance ( ``TOLER`` on :ref:`nummrg` ) set equal to 0.75 * the shortest + distance between the endpoints of any active line. See the :ref:`nummrg` command for more + information about the tolerances. In most cases, the default merging is appropriate. Use the + :ref:`ioptn` command when you want to: + + * Disable merging operations. + + * Override the default merging and specify a global solid model tolerance value (GTOLER). + + * Disable the automatic creation of solids (SOLID). + + The :ref:`ioptn` command should be issued before the :ref:`igesin` command. You cannot change these + options after your model has been imported or created. If you must change the options: Clear the + database ( ``/CLEAR`` ) or exit and restart the program. + + Set the correct options. + + Reimport or recreate the model. + + This command is valid in any processor. + """ + command = f"IOPTN,{lab},{val1}" + return self.run(command, **kwargs) diff --git a/src/ansys/mapdl/core/_commands/aux15_.py b/src/ansys/mapdl/core/_commands/aux15_.py deleted file mode 100644 index c9396074a2a..00000000000 --- a/src/ansys/mapdl/core/_commands/aux15_.py +++ /dev/null @@ -1,201 +0,0 @@ -# Copyright (C) 2016 - 2025 ANSYS, Inc. and/or its affiliates. -# SPDX-License-Identifier: MIT -# -# -# Permission is hereby granted, free of charge, to any person obtaining a copy -# of this software and associated documentation files (the "Software"), to deal -# in the Software without restriction, including without limitation the rights -# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -# copies of the Software, and to permit persons to whom the Software is -# furnished to do so, subject to the following conditions: -# -# The above copyright notice and this permission notice shall be included in all -# copies or substantial portions of the Software. -# -# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -# SOFTWARE. - - -class Aux15: - def igesin(self, fname="", ext="", **kwargs): - """Transfers IGES data from a file into MAPDL. - - APDL Command: IGESIN - - Parameters - ---------- - 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 : str - Filename extension (eight-character maximum). This is - optional and the extension can be included in the ``fname`` - parameter. The extension defaults to CAD if ``fname`` is - blank. - - Notes - ----- - Reads a file containing IGES data and transfers it into the ANSYS - database. The file transferred is the IGES Version 5.1, ASCII - format file. IGES (Initial Graphics Exchange Specification) is a - neutral format developed by the U.S. Dept. of Commerce, National - Institute of Standards and Technology. There is no output - transfer file written since the transferred data is read directly - into the MAPDL database. - - You can import multiple files into a single database, but you must - use the same import option (set with the IOPTN command) for each - file. - - The IOPTN command sets the parameters for reading the file. Files - read via the SMOOTH method (the only available method) use the - standard database. - - Examples - -------- - Read in an IGES file in the current MAPDL directory. - - >>> mapdl.igesin('bracket.iges') - - Read in an example IGES file - - >>> from ansys.mapdl.core import examples - >>> bracket_file = examples.download_bracket() - >>> mapdl.igesin(bracket_file) - - Read in a igesfile from a full path - - >>> mapdl.igesin('C:\\Users\\user\\bracket.iges) - - """ - return self.run(f"IGESIN,{fname},{ext}", **kwargs) - - def ioptn(self, lab="", val1="", **kwargs): - """Controls options relating to importing a model. - - APDL Command: IOPTN - - Parameters - ---------- - lab - Label identifying the import option. The meaning of VAL1 varies - depending on Lab. - - STAT - List overall status of import facilities, including current option values. - VAL1 is ignored. - - DEFA - Set default values for all import options. VAL1is ignored. - - MERG - Entity merge option. VAL1 can be: - - YES - Automatic merging is performed (default). - - NO - No merging of entities. - - SOLID - Solid option. VAL1 can be: - - YES - Solid is created automatically (default). - - NO - No solid created. - - GTOLER - Entity merging tolerance. If IGES = SMOOTH, the GTOLER,VAL1 can be: - - DEFA - Use system defaults (default). - - FILE - Use tolerance from the imported file. - - n - A user-specified tolerance value. - - IGES - IGES import option. VAL1 can be: - - STAT - List status of IGES related options in the output window. - - SMOOTH (or RV52) - Use more robust IGES revision 5.2 import function (default). - - SMALL - Small areas option. VAL1 can be: - - YES - Small areas are deleted (default). - - NO - Small areas are retained. - - val1 - Additional input value as described under each Lab option. - - Notes - ----- - Controls various options during a model file transfer. A global solid - model tolerance (GTOLER) can be specified. - - The SMALL,YES option (default) delete small areas and can cause - geometrical inconsistencies that could cause the import process to - abort. Retaining the small areas increases processor time and memory - usage. - - The data is stored in the standard ANSYS graphics database. - - The IGES,SMOOTH (default) option is capable of reading in any rational - B-spline curve entity (type 126), or rational B-spline surface entity - (type 128) with a degree less than or equal to 20. Attempts to read in - B-spline curve or surface entities of degree higher than 20 may result - in error messages. - - If you issue the /CLEAR command, the IOPTN settings return to their - defaults. - - For MERG,YES, merging of coincident geometry items is performed - automatically when the IGESIN command is issued (that is, an internal - NUMMRG,KP command is issued). The model is merged with the - consideration tolerance (TOLER on NUMMRG) set equal to 0.75 * the - shortest distance between the endpoints of any active line. See the - NUMMRG command for more information about the tolerances. In most - cases, the default merging is appropriate. Use the IOPTN command when - you want to: - - Disable merging operations. - - Override the default merging and specify a global solid model tolerance - value (GTOLER). - - Disable the automatic creation of solids (SOLID). - - The IOPTN command should be issued before the IGESIN command. You - cannot change these options after your model has been imported or - created. If you must change the options: - - Clear the database (/CLEAR) or exit and restart the program. - - Set the correct options. - - Reimport or recreate the model. - - This command is valid in any processor. - """ - command = f"IOPTN,{lab},{val1}" - return self.run(command, **kwargs) diff --git a/src/ansys/mapdl/core/_commands/aux12_/__init__.py b/src/ansys/mapdl/core/_commands/aux2/__init__.py similarity index 94% rename from src/ansys/mapdl/core/_commands/aux12_/__init__.py rename to src/ansys/mapdl/core/_commands/aux2/__init__.py index 4c7a98ae017..792a0c15152 100644 --- a/src/ansys/mapdl/core/_commands/aux12_/__init__.py +++ b/src/ansys/mapdl/core/_commands/aux2/__init__.py @@ -20,4 +20,7 @@ # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE # SOFTWARE. -from . import general_radiation, radiation_mat, radiosity_solver +from . import ( + binary_file_dump, + binary_file_manipulation, +) diff --git a/src/ansys/mapdl/core/_commands/aux2/binary_file_dump.py b/src/ansys/mapdl/core/_commands/aux2/binary_file_dump.py new file mode 100644 index 00000000000..106680a4153 --- /dev/null +++ b/src/ansys/mapdl/core/_commands/aux2/binary_file_dump.py @@ -0,0 +1,159 @@ +# Copyright (C) 2016 - 2025 ANSYS, Inc. and/or its affiliates. +# SPDX-License-Identifier: MIT +# +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to deal +# in the Software without restriction, including without limitation the rights +# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +# copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in all +# copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +# SOFTWARE. + + +class BinaryFileDump: + + def aux2(self, **kwargs): + r"""Enters the binary file dumping processor. + + Mechanical APDL Command: `/AUX2 `_ + + Notes + ----- + + .. _s-AUX2_notes: + + 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 = "/AUX2" + 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 `_ + + 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 + ----- + + .. _DUMP_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) + + def fileaux2(self, fname: str = "", ident: str = "", **kwargs): + r"""Specifies the binary file to be dumped. + + Mechanical APDL Command: `FILEAUX2 `_ + + Parameters + ---------- + 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 + `_ for file + descriptions and identifiers. If not an identifier, the program uses ``Ident`` as the file name + extension. + + Notes + ----- + + .. _FILEAUX2_notes: + + 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: str = "", **kwargs): + r"""Specifies the format of the file dump. + + Mechanical APDL Command: `FORM `_ + + Parameters + ---------- + lab : str + Format: + + * ``RECO`` - Basic record description only (minimum output) (default). + + * ``TEN`` - Same as RECO plus the first ten words of each record. + + * ``LONG`` - Same as RECO plus all words of each record. + + Notes + ----- + + .. _FORM_notes: + + 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: str = "", base: str = "", loch: str = "", baseh: str = "", **kwargs + ): + r"""Dumps the record of a binary file. + + Mechanical APDL Command: `PTR `_ + + Parameters + ---------- + 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 + ----- + + .. _PTR_notes: + + 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},{loch},{baseh}" + return self.run(command, **kwargs) diff --git a/src/ansys/mapdl/core/_commands/aux2/binary_file_manipulation.py b/src/ansys/mapdl/core/_commands/aux2/binary_file_manipulation.py new file mode 100644 index 00000000000..193d6c8ce8f --- /dev/null +++ b/src/ansys/mapdl/core/_commands/aux2/binary_file_manipulation.py @@ -0,0 +1,340 @@ +# Copyright (C) 2016 - 2025 ANSYS, Inc. and/or its affiliates. +# SPDX-License-Identifier: MIT +# +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to deal +# in the Software without restriction, including without limitation the rights +# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +# copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in all +# copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +# SOFTWARE. + + +class BinaryFileManipulation: + + def combine(self, filetype: str = "", num: str = "", **kwargs): + r"""Combines distributed memory parallel ( DMP ) files. + + Mechanical APDL Command: `COMBINE `_ + + Parameters + ---------- + filetype : str + Type of solution file to combine. There is no default; if (blank), the command is ignored. + + * ``RST`` - Structural results file ( :file:`.RST` ) + + * ``RTH`` - Thermal results file ( :file:`.RTH` ) + + * ``RMG`` - Magnetics results file ( :file:`.RMG` ) + + * ``RSTP`` - Linear perturbation results file ( :file:`.RSTP` ) + + * ``EMAT`` - Element matrix file ( :file:`.EMAT` ). + + * ``ESAV`` - Element saved data file ( :file:`.ESAV` ) + + * ``MODE`` - Modal results file ( :file:`.MODE` ) + + * ``MLV`` - Modal load vector file ( :file:`.MLV` ) + + * ``IST`` - Initial state file ( :file:`.IST` ) + + * ``FULL`` - Full matrix file ( :file:`.FULL` ) + + * ``RFRQ`` - Reduced complex displacement file ( :file:`.RFRQ` ) + + * ``RDSP`` - Reduced displacement file ( :file:`.RDSP` ) + + * ``RNNN`` - Multiframe restart files ( :file:`.Rnnn` ) + + num : str + Number of :file:`.Rnnn` files to combine: + + * ``ALL`` - Combine all :file:`.Rnnn` files (default). + + * ``N`` - Combine only :file:`.RN` files, where N is an integer from 1 to 999. + + Notes + ----- + + .. _COMBINE_notes: + + The :ref:`combine` command is used within the AUX2 auxiliary processor to combine local solution + files from a distributed memory parallel solution into a single, global file. Before using this + command, you must enter the AUX2 processor by issuing the :ref:`aux2` command. + + In a distributed-memory parallel ( DMP ) solution, you can use the :ref:`dmpoption` command to + bypass the file combination step, causing all individual local files to be kept on the local disks + in the current working directory. Later on, you can start a new distributed memory parallel solution + and use the :ref:`combine` command to combine local files into a global file for a downstream + solution or another operation (such as postprocessing with :ref:`post1` ). For example, the command + :ref:`combine`,RST will combine local results files ( :file:`JobnameN.RST` ) into a global results + file ( :file:`Jobname.RST` ). + + The :ref:`combine` command cannot be used to combine local files generated during a distributed + memory parallel solution that used the frequency or cyclic harmonic index domain decomposition + method ( :ref:`ddoption`,FREQ or :ref:`ddoption`,CYCHI). + + If :ref:`combine`,RNNN is specified, all of the multiframe restart files named :file:`Jobname.R001` + to :file:`Jobname.R999` will automatically be combined. To combine only one set of :file:`.Rnnn` + restart files, place only that set of restart files in your current working directory, or use the + ``NUM`` argument to specify which set of :file:`.Rnnn` files to combine. + + When the :ref:`combine` command is used in a subsequent distributed memory parallel (DMP) session, + the number of processors must be the same as in the DMP solution that generated the files. + + When running on a cluster, the local solution files must be available in the working directory on + each node in the subsequent session. As an example, consider the following command line used to + generate local solution files: + + .. code:: apdl + + ansys232 -dis -machines machine1: 4: machine2: 1: machine3: 2-i input -o output + + Different machines can be used in the subsequent session to combine these files. However, the total + number of cores must remain unchanged (seven in the above case), and the local files must be copied + to the working directory (or directories) on each of the machines used in the subsequent session. + """ + command = f"COMBINE,{filetype},{num}" + return self.run(command, **kwargs) + + def hbmat( + self, + fname: str = "", + ext: str = "", + form: str = "", + matrx: str = "", + rhs: str = "", + mapping: str = "", + **kwargs, + ): + r"""Writes an assembled global matrix in Harwell-Boeing format. + + Mechanical APDL Command: `HBMAT `_ + + Parameters + ---------- + 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. Defaults to the current Jobname if left blank. + + ext : str + Filename extension (eight-character maximum). Defaults to :file:`.matrix` if left blank. + + form : str + Specifies format of output matrix file: + + * ``ASCII`` - Write output matrix file in ASCII form. + + * ``BIN`` - Write output matrix file in binary form. + + matrx : str + Specify which matrix to write to the output matrix file: + + * ``STIFF`` - Write stiffness matrix to output matrix file. Valid for all types of analyses that + write a :file:`.full` file. + + * ``MASS`` - Write mass matrix to output matrix file. Valid for buckling, substructure, and modal + analyses. If :file:`.full` file was generated in a buckling analysis, then this label will write + stress stiffening matrix to output matrix file. + + * ``DAMP`` - Write damping matrix to output matrix file. Only valid for damped modal analyses. + + rhs : str + Specifies whether to write the right-hand side vector to output matrix file: + + * ``YES`` - Write right-hand side vector to output matrix file. + + * ``NO`` - Do not write right-hand side vector to output matrix file. + + mapping : str + Specifies whether to write the mapping file. This file is always named :file:`Fnamemapping`. + + * ``YES`` - Write the mapping file. + + * ``NO`` - Do not write the mapping file (default). + + Notes + ----- + + .. _HBMAT_notes: + + This command copies a matrix from the assembled global matrix file ( :file:`.full` file) or from the + superelement matrix file ( :file:`.sub` file) as specified on the :ref:`fileaux2` command and write + it in Harwell-Boeing format to a new file named :file:`Jobname.matrix`. The Harwell-Boeing format is + widely used by other applications that deal with matrices. + + The assembled global matrix file is created during solution depending on the analysis type, equation + solver, and other solution options. By default, the assembled global matrix file is never deleted at + the end of solution. For most analysis types, the Sparse direct solver and the ICCG solver will + write a :file:`.full` file. All mode extraction methods used for buckling and modal analyses will + write a properly formatted :file:`.full` file to be used with the :ref:`hbmat` command. However, + when using distributed-memory parallel (DMP) processing, a majority of analyses will write a + distributed (or local) form of the :file:`.full` file which is not currently supported by the + :ref:`hbmat` command. + + When dumping the stiffness matrix for transient and harmonic analyses, be aware that the element + mass matrix values (and possibly element damping matrix values) are incorporated into the globally + assembled stiffness matrix. Thus, the globally assembled stiffness matrix represents more than the + stiffness of the model for these analysis types. Please refer to the `Mechanical APDL Theory + Reference `_ for + more details. + + When dumping a :file:`.full` file, the rows and columns corresponding to specified constraints (for + example, :ref:`d` commands) are eliminated from the system of equations and therefore are not + written to the :file:`.matrix` file. Also, rows and columns corresponding to eliminated (dependent) + degrees of freedom from coupling and/or constraint equations (for example, :ref:`ce`, :ref:`cp` + commands) are also eliminated from the system of equations and are not written to the + :file:`.matrix` file. The DOFs that are eliminated from any coupling and/or constraint equations are + determined internally by the solution code and may not match what you specified via the :ref:`ce` / + :ref:`cp` (or similar) commands. + + When dumping a :file:`.sub` file, the full ``n`` x ``n`` matrix will be written to the + :file:`.matrix` file for either symmetric or unsymmetric matrices, regardless of whether any of the + matrix coefficients are zero-valued. When dumping a :file:`.full` file, only the lower triangular + part of the matrix will be written to the :file:`.matrix` file if the matrix is symmetric; the full + matrix is written if the matrix is unsymmetric. Only matrix coefficients that are greater than zero + will be written. + + The Harwell-Boeing format is column-oriented. That is, non-zero matrix values are stored with their + corresponding row indices in a sequence of columns. However, because the Mechanical APDL matrix + files are + stored by row and not column, when the :ref:`hbmat` command is used with a non-symmetric matrix, the + transpose of the matrix is, in fact, written. + + The :ref:`wrfull` command, used with the :ref:`solve` command, generates the assembled global matrix + file and eliminate the equation solution process and results output process. + + The mapping file can be used to map the matrix equation numbers found in the :file:`.matrix` file + directly to the corresponding node numbers and degrees of freedom. + + When dumping a CMS :file:`.sub` file, the last rows/columns of the matrix are non-physical degrees + of freedom added internally by the `CMS process + `_ + and cannot be mapped directly to a node number or particular degree of freedom. + """ + command = f"HBMAT,{fname},{ext},,{form},{matrx},{rhs},{mapping}" + return self.run(command, **kwargs) + + def psmat( + self, + fname: str = "", + ext: str = "", + matrix: str = "", + color: str = "", + **kwargs, + ): + r"""Writes an assembled global matrix to a postscript format that graphically displays nonzero matrix + values. + + Mechanical APDL Command: `PSMAT `_ + + Parameters + ---------- + 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. This file name is used for the postscript file + name. It defaults to the current Jobname if left blank. + + ext : str + Filename extension (eight-character maximum). Defaults to :file:`.PS` if left blank. + + matrix : str + Specify which matrix to write to the output postscript file: + + * ``STIFF`` - Write stiffness matrix to output postscript file. Valid for all types of analyses that + write a :file:`.FULL` file. + + * ``MASS`` - Write mass matrix to output postscript file. Valid for buckling, substructure, and + modal analyses. If the :file:`.FULL` file was generated in a buckling analysis, then this label will + write the stress stiffening matrix to the output postscript file. + + * ``DAMP`` - Write damping matrix to output postscript file. Only valid for damped modal analyses. + + color : str + Specifies whether to display the grid in black and white or in color: + + * ``BLACK`` - Each nonzero coefficient is symbolized by a black square (default). + + * ``COLOR`` - Each nonzero coefficient is symbolized by a colored square. The color depends on the + module of the coefficient; the range is from blue for the smallest values to red for the largest + values. The color map is: + + Notes + ----- + + .. _PSMAT_notes: + + This command is used to copy a matrix from the assembled global matrix file ( :file:`.FULL` file) as + specified on the ``FILE`` command and write it in a postscript format to a new file named ``Fname``. + ``Ext`` (defaults to :file:`Jobname.PS` ). The matrix is symbolized by a grid in which the black or + colored squares represent the nonzero coefficients of the matrix. The :file:`.FULL` file must be + available for this command to work properly. + + If the matrix is large, it may be difficult to display the postscript file. In this case, use + ``Color`` = BLACK to reduce the postscript file size. + + The assembled global matrix file is created during solution depending on the analysis type, equation + solver, and other solution options. By default, the assembled global matrix file is never deleted at + the end of solution. For most analysis types, the Sparse direct solver and the ICCG solver write a + :file:`.FULL` file. All mode extraction methods used for buckling and modal analyses write a + properly formatted :file:`.FULL` file to be used with the :ref:`psmat` command. + + When copying the stiffness matrix for transient and harmonic analyses, be aware that the element + mass matrix values (and possibly element damping matrix values) are incorporated into the globally + assembled stiffness matrix. Thus, the globally assembled stiffness matrix represents more than the + stiffness of the model for these analysis types. Please refer to the `Mechanical APDL Theory + Reference `_ for + more details. + + The :ref:`psmat` command is not able to display a lumped mass matrix from a :file:`.FULL` file + generated by a harmonic analysis. + + When copying a :file:`.FULL` file, the rows and columns corresponding to specified constraints (for + example, :ref:`d` commands) are eliminated from the system of equations and therefore are not + written to the :file:`.PS` file. In addition, rows and columns corresponding to eliminated + (dependent) degrees of freedom from coupling and/or constraint equations (for example, :ref:`ce`, + :ref:`cp` commands) are eliminated from the system of equations and are not written to the + :file:`.PS` file. The DOFs that are eliminated from any coupling and/or constraint equations are + determined internally by the solution code and may not match what you specified via the :ref:`ce` / + :ref:`cp` (or similar) commands. + + When copying a :file:`.FULL` file, only the upper triangular part of the matrix will be written to + the :file:`.PS` file if the matrix is symmetric; the full matrix is written if the matrix is + unsymmetric. Only matrix coefficients that are greater than zero will be written. + + The :ref:`wrfull` command, in conjunction with the :ref:`solve` command, can be used to generate the + assembled global matrix file and eliminate the equation solution process and results output process. + + The following command sequence shows typical usage of this command. + + .. code:: apdl + + /BATCH,LIST + /AUX2 ! Enter AUX2 processor + FILE,job1,full ! FULL file containing stiffness matrix is job1.full + PSMAT,job1KColor,ps,STIFF,COLOR ! Create file job1KColor.ps in color + ! postscript format for stiffness matrix + PSMAT,job1MBlack,,STIFF,BLACK ! Create file job1MBalck.ps in black/white + ! postscript format for stiffness matrix + FINISH + + Below is an example of an export of the stiffness matrix to a postscript format using the COLOR + option. + """ + command = f"PSMAT,{fname},{ext},{matrix},{color}" + return self.run(command, **kwargs) diff --git a/src/ansys/mapdl/core/_commands/aux2_/bin_dump.py b/src/ansys/mapdl/core/_commands/aux2_/bin_dump.py deleted file mode 100644 index 4a588cf2a94..00000000000 --- a/src/ansys/mapdl/core/_commands/aux2_/bin_dump.py +++ /dev/null @@ -1,115 +0,0 @@ -# Copyright (C) 2016 - 2025 ANSYS, Inc. and/or its affiliates. -# SPDX-License-Identifier: MIT -# -# -# Permission is hereby granted, free of charge, to any person obtaining a copy -# of this software and associated documentation files (the "Software"), to deal -# in the Software without restriction, including without limitation the rights -# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -# copies of the Software, and to permit persons to whom the Software is -# furnished to do so, subject to the following conditions: -# -# The above copyright notice and this permission notice shall be included in all -# copies or substantial portions of the Software. -# -# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -# SOFTWARE. - - -class BinDump: - def dump(self, nstrt="", nstop="", **kwargs): - """Dumps the contents of a binary file. - - APDL Command: DUMP - - 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. - - Notes - ----- - Dumps the file named on the AUX2 FILEAUX2 command according the format - specified on the FORM command. - """ - command = f"DUMP,{nstrt},{nstop}" - return self.run(command, **kwargs) - - def fileaux2(self, fname="", ident="", **kwargs): - """Specifies the binary file to be dumped. - - APDL Command: FILEAUX2 - - 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. - - Notes - ----- - Specifies the binary file to be dumped with the DUMP command. - """ - command = f"FILEAUX2,{fname},{ident}" - return self.run(command, **kwargs) - - def form(self, lab="", **kwargs): - """Specifies the format of the file dump. - - APDL Command: FORM - - Parameters - ---------- - lab - Format: - - RECO - Basic record description only (minimum output) (default). - - TEN - Same as RECO plus the first ten 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). - """ - command = f"FORM,{lab}" - return self.run(command, **kwargs) - - def ptr(self, loc="", base="", **kwargs): - """Dumps the record of a binary file. - - APDL Command: PTR - - 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. - - Notes - ----- - Dumps the record of the file named on the AUX2 FILEAUX2 command - according the format specified on the FORM command. - """ - command = f"PTR,{loc},{base}" - return self.run(command, **kwargs) diff --git a/src/ansys/mapdl/core/_commands/aux2_/bin_manip.py b/src/ansys/mapdl/core/_commands/aux2_/bin_manip.py deleted file mode 100644 index cfd7a7cc6ae..00000000000 --- a/src/ansys/mapdl/core/_commands/aux2_/bin_manip.py +++ /dev/null @@ -1,343 +0,0 @@ -# Copyright (C) 2016 - 2025 ANSYS, Inc. and/or its affiliates. -# SPDX-License-Identifier: MIT -# -# -# Permission is hereby granted, free of charge, to any person obtaining a copy -# of this software and associated documentation files (the "Software"), to deal -# in the Software without restriction, including without limitation the rights -# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -# copies of the Software, and to permit persons to whom the Software is -# furnished to do so, subject to the following conditions: -# -# The above copyright notice and this permission notice shall be included in all -# copies or substantial portions of the Software. -# -# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -# SOFTWARE. - - -class BinManip: - def combine(self, filetype="", **kwargs): - """Combines distributed memory parallel (Distributed ANSYS) files. - - APDL Command: COMBINE - - Parameters - ---------- - filetype - Type of solution file to combine. There is no default; if (blank), - the command is ignored. - - RST - Structural results file (.RST) - - RTH - Thermal results file (.RTH) - - RMG - Magnetics results file (.RMG) - - RSTP - Linear perturbation results file (.RSTP) - - EMAT - Element matrix file (.EMAT). - - ESAV - Element saved data file (.ESAV) - - MODE - Modal results file (.MODE) - - MLV - Modal load vector file (.MLV) - - IST - Initial state file (.IST) - - FULL - Full matrix file (.FULL) - - RFRQ - Reduced complex displacement file (.RFRQ) - - RDSP - Reduced displacement file (.RDSP) - - Notes - ----- - The COMBINE command is used within the AUX2 auxiliary processor to - combine local solution files from a distributed memory parallel - solution into a single, global file. Before using this command, you - must enter the AUX2 processor by issuing the /AUX2 command. - - In a distributed memory parallel (Distributed ANSYS) solution, you can - use the DMPOPTION command to bypass the file combination step, causing - all individual local files to be kept on the local disks in the current - working directory. Later on, you can start a new distributed memory - parallel solution and use the COMBINE command to combine local files - into a global file for a downstream solution or another operation - (e.g., postprocessing with /POST1). For example, the command - COMBINE,RST will combine local results files (JobnameN.RST) into a - global results file (Jobname.RST). - - When the COMBINE command is used in a subsequent Distributed ANSYS - session, the number of processors must be the same as in the - distributed memory parallel solution that generated the files. - - When running on a cluster, the local solution files must be available - in the working directory on each node in the subsequent session. As an - example, consider the following command line used to generate local - solution files: - - Different machines can be used in the subsequent session to combine - these files. However, the total number of cores must remain unchanged - (seven in the above case), and the local files must be copied to the - working directory (or directories) on each of the machines used in the - subsequent session. - """ - command = f"COMBINE,{filetype}" - return self.run(command, **kwargs) - - def hbmat(self, fname="", ext="", form="", matrx="", rhs="", mapping="", **kwargs): - """Writes an assembled global matrix in Harwell-Boeing format. - - APDL Command: HBMAT - - 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. - - ext - Filename extension (eight-character maximum). - - form - Specifies format of output matrix file: - - ASCII - Write output matrix file in ASCII form. - - BIN - Write output matrix file in binary form. - - matrx - Specify which matrix to write to the output matrix file: - - STIFF - Write stiffness matrix to output matrix file. Valid for all types of analyses - that write a .FULL file. - - MASS - Write mass matrix to output matrix file. Valid for buckling, substructure, and - modal analyses. If .FULL file was generated in a buckling - analysis, then this label will write stress stiffening - matrix to output matrix file. - - DAMP - Write damping matrix to output matrix file. Only valid for damped modal - analyses. - - rhs - Specifies whether to write the right-hand side vector to output - matrix file: - - YES - Write right-hand side vector to output matrix file. - - NO - Do not write right-hand side vector to output matrix file. - - mapping - Specifies whether to write the mapping file. This file is always - named Fname.MAPPING. - - YES - Write the mapping file. - - NO - Do not write the mapping file (default). - - Notes - ----- - This command is used to copy a matrix from the assembled global matrix - file (.FULL file) or from the superelement matrix file (.SUB file) as - specified on the FILEAUX2 command and write it in Harwell-Boeing format - to a new file, named jobname.MATRIX. The Harwell-Boeing format is - widely used by other applications that deal with matrices. - - The assembled global matrix file is created during solution depending - on the analysis type, equation solver, and other solution options. By - default, the assembled global matrix file is never deleted at the end - of solution. For most analysis types, the Sparse direct solver and the - ICCG solver will write a .FULL file. All mode extraction methods used - for buckling and modal analyses will write a properly formatted .FULL - file to be used with the HBMAT command. However, when using Distributed - ANSYS, a majority of analyses will write a distributed (or local) form - of the .FULL file which is not currently supported by the HBMAT - command. - - When dumping the stiffness matrix for transient and harmonic analyses, - be aware that the element mass matrix values (and possibly element - damping matrix values) are incorporated into the globally assembled - stiffness matrix. Thus, the globally assembled stiffness matrix - represents more than the stiffness of the model for these analysis - types. Please refer to the Mechanical APDL Theory Reference for more - details. - - When dumping a .FULL file, the rows and columns corresponding to - specified constraints (e.g., D commands) are eliminated from the system - of equations and therefore are not written to the .MATRIX file. Also, - rows and columns corresponding to eliminated (slave) degrees of freedom - from coupling and/or constraint equations (e.g., CE, CP commands) are - also eliminated from the system of equations and are not written to the - .MATRIX file. The DOFs that are eliminated from any coupling and/or - constraint equations are determined internally by the solution code and - may not match what you specified via the CE/CP (or similar) commands. - - When dumping a .SUB file, the full nxn matrix will be written to the - .MATRIX file for either symmetric or unsymmetric matrices, regardless - of whether any of the matrix coefficients are zero-valued. When dumping - a .FULL file, only the lower triangular part of the matrix will be - written to the .MATRIX file if the matrix is symmetric; the full matrix - is written if the matrix is unsymmetric. Only matrix coefficients that - are greater than zero will be written. - - The Harwell-Boeing format is column-oriented. That is, non-zero matrix - values are stored with their corresponding row indices in a sequence of - columns. However, since the ANSYS matrix files are stored by row and - not column, when the HBMAT command is used with a non-symmetric matrix, - the transpose of the matrix is, in fact, written. - - The WRFULL command, in conjunction with the SOLVE command, can be used - to generate the assembled global matrix file and eliminate the equation - solution process and results output process. - - The mapping file can be used to map the matrix equation numbers found - in the .MATRIX file directly to the corresponding node numbers and - degrees of freedom. - - When dumping a CMS .SUB file, the last rows/columns of the matrix are - non-physical degrees of freedom added internally by the CMS process and - cannot be mapped directly to a node number or particular degree of - freedom. - """ - command = f"HBMAT,{fname},{ext},,{form},{matrx},{rhs},{mapping}" - return self.run(command, **kwargs) - - def psmat(self, fname="", ext="", matrix="", color="", **kwargs): - """Writes an assembled global matrix to a postscript format that - - APDL Command: PSMAT - graphically displays nonzero matrix values. - - 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. - - ext - Filename extension (eight-character maximum). - - matrix - Specify which matrix to write to the output postscript file: - - STIFF - Write stiffness matrix to output postscript file. Valid for all types of - analyses that write a .FULL file. - - MASS - Write mass matrix to output postscript file. Valid for buckling, substructure, - and modal analyses. If the .FULL file was generated in a - buckling analysis, then this label will write the stress - stiffening matrix to the output postscript file. - - DAMP - Write damping matrix to output postscript file. Only valid for damped modal - analyses. - - color - Specifies whether to display the grid in black and white or in - color: - - BLACK - Each nonzero coefficient is symbolized by a black square (default). - - COLOR - Each nonzero coefficient is symbolized by a colored square. The color depends - on the module of the coefficient; the range is from blue - for the smallest values to red for the largest values. The - color map is: - - Notes - ----- - This command is used to copy a matrix from the assembled global matrix - file (.FULL file) as specified on the FILE command and write it in a - postscript format to a new file named Fname.Ext (defaults to - Jobname.PS). The matrix is symbolized by a grid in which the black or - colored squares represent the nonzero coefficients of the matrix. The - .FULL file must be available for this command to work properly. - - If the matrix is large, it may be difficult to display the postscript - file. In this case, use Color = BLACK to reduce the postscript file - size. - - The assembled global matrix file is created during solution depending - on the analysis type, equation solver, and other solution options. By - default, the assembled global matrix file is never deleted at the end - of solution. For most analysis types, the Sparse direct solver and the - ICCG solver write a .FULL file. All mode extraction methods used for - buckling and modal analyses write a properly formatted .FULL file to be - used with the PSMAT command. - - When copying the stiffness matrix for transient and harmonic analyses, - be aware that the element mass matrix values (and possibly element - damping matrix values) are incorporated into the globally assembled - stiffness matrix. Thus, the globally assembled stiffness matrix - represents more than the stiffness of the model for these analysis - types. Please refer to the Mechanical APDL Theory Reference for more - details. - - The PSMAT command is not able to display a lumped mass matrix from a - .FULL file generated by a harmonic analysis. - - When copying a .FULL file, the rows and columns corresponding to - specified constraints (e.g., D commands) are eliminated from the system - of equations and therefore are not written to the .PS file. In - addition, rows and columns corresponding to eliminated (slave) degrees - of freedom from coupling and/or constraint equations (e.g., CE, CP - commands) are eliminated from the system of equations and are not - written to the .PS file. The DOFs that are eliminated from any coupling - and/or constraint equations are determined internally by the solution - code and may not match what you specified via the CE/CP (or similar) - commands. - - When copying a .FULL file, only the upper triangular part of the matrix - will be written to the .PS file if the matrix is symmetric; the full - matrix is written if the matrix is unsymmetric. Only matrix - coefficients that are greater than zero will be written. - - The WRFULL command, in conjunction with the SOLVE command, can be used - to generate the assembled global matrix file and eliminate the equation - solution process and results output process. - - The following command sequence shows typical usage of this command. - - Below is an example of an export of the stiffness matrix to a - postscript format using the COLOR option. - - : - """ - command = f"PSMAT,{fname},{ext},{matrix},{color}" - return self.run(command, **kwargs) diff --git a/src/ansys/mapdl/core/_commands/aux2_/__init__.py b/src/ansys/mapdl/core/_commands/aux3/__init__.py similarity index 96% rename from src/ansys/mapdl/core/_commands/aux2_/__init__.py rename to src/ansys/mapdl/core/_commands/aux3/__init__.py index d388e85a7a0..ec3d4655d58 100644 --- a/src/ansys/mapdl/core/_commands/aux2_/__init__.py +++ b/src/ansys/mapdl/core/_commands/aux3/__init__.py @@ -20,4 +20,6 @@ # 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 ( + results_files, +) diff --git a/src/ansys/mapdl/core/_commands/aux3/results_files.py b/src/ansys/mapdl/core/_commands/aux3/results_files.py new file mode 100644 index 00000000000..96fcee01e19 --- /dev/null +++ b/src/ansys/mapdl/core/_commands/aux3/results_files.py @@ -0,0 +1,280 @@ +# Copyright (C) 2016 - 2025 ANSYS, Inc. and/or its affiliates. +# SPDX-License-Identifier: MIT +# +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to deal +# in the Software without restriction, including without limitation the rights +# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +# copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in all +# copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +# SOFTWARE. + + +class ResultsFiles: + + def aux3(self, **kwargs): + r"""Enters the results file editing processor. + + Mechanical APDL Command: `/AUX3 `_ + + Notes + ----- + + .. _s-AUX3_notes: + + Enters the results-file editing processor (auxiliary processor AUX3), used for editing Mechanical + APDL + results files. + + A pending :ref:`delete` is processed when :ref:`finish` or ``/EOF`` is issued. To cancel a pending + :ref:`delete`, issue :ref:`undelete`. + + This command is valid only at the Begin Level. + """ + command = "/AUX3" + return self.run(command, **kwargs) + + def compress(self, **kwargs): + r"""Deletes all specified sets. + + Mechanical APDL Command: `COMPRESS `_ + + Notes + ----- + + .. _COMPRESS_notes: + + Issue this command to delete all sets specified with the :ref:`delete` command. + + The :ref:`compress` command is valid only in the results file editing processor (auxiliary processor + AUX3), and, like the other AUX3 commands, it only affects the data steps index (DSI), time (TIM), + loadstep, substep and cumulative step iteration (LSP) records in the results file. + """ + command = "COMPRESS" + return self.run(command, **kwargs) + + def delete(self, set_: str = "", nstart: str = "", nend: str = "", **kwargs): + r"""Specifies sets in the results file to be deleted before postprocessing. + + Mechanical APDL Command: `DELETE `_ + + Parameters + ---------- + set_ : str + Specifies that sets in the results file are to be deleted. + + nstart : str + The first set in a results file to be deleted. + + nend : str + The final set in a results file to be deleted. This field is used only if deleting more than one + sequential sets. + + Notes + ----- + + .. _DELETE_notes: + + :ref:`delete` is a specification command that flags sets in the results file for deletion. It should + be followed by a :ref:`compress` command, the corresponding action command that deletes the + specified sets. + + The :ref:`delete` command is valid only in the results file editing processor (auxiliary processor + AUX3). + """ + command = f"DELETE,{set_},{nstart},{nend}" + return self.run(command, **kwargs) + + def fileaux3(self, fname: str = "", ext: str = "", **kwargs): + r"""Specifies the results file to be edited. + + Mechanical APDL Command: `FILEAUX3 `_ + + Parameters + ---------- + 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 ``Ext`` is specified. + + ext : str + Filename extension (eight-character maximum). + + Notes + ----- + + .. _FILEAUX3_notes: + + Specifies the results file to be edited. + """ + command = f"FILEAUX3,{fname},{ext}" + return self.run(command, **kwargs) + + def list(self, **kwargs): + r"""Lists out the sets in the results file. + + Mechanical APDL Command: `LIST `_ + + Notes + ----- + + .. warning:: + + This function contains specificities regarding the argument definitions. + Please refer to the `command documentation `_ + for further explanations. + + .. _LIST_notes: + + This command lists the results set number, the load step, substep, and time step for each set. It + also shows all sets marked for deletion. + + The :ref:`list` command is valid only in the results file editing processor (auxiliary processor + AUX3). + """ + command = "LIST" + return self.run(command, **kwargs) + + def modify( + self, + set_: str = "", + lstep: str = "", + iter_: str = "", + cumit: str = "", + time: str = "", + ktitle: int | str = "", + **kwargs, + ): + r"""Changes the listed values of the data in a set. + + Mechanical APDL Command: `MODIFY `_ + + Parameters + ---------- + set_ : str + Set of data in results file to be modified. + + lstep : str + The new load step number. + + iter_ : str + The new load substep number. + + cumit : str + The new cumulative iteration. + + time : str + The new time/frequency value. + + ktitle : int or str + Indicates if the set title should be modified. + + * ``0`` - Keep the original title. + + * ``1`` - Change the title to the title specified with the most current :ref:`title` command. + + Notes + ----- + + .. _MODIFY_notes: + + Use this command to change the listed values in a data set in a results file. Using this command + does not change any actual model data; it affects only the values listed in the results file. + + The :ref:`modify` command is valid only in the results file editing processor (auxiliary processor + AUX3), and, like the other AUX3 commands, it only affects the data steps index (DSI), time (TIM), + loadstep, substep and cumulative step iteration (LSP) records in the results file. + + **Example Usage** + If you start with the following results file: + + .. code:: apdl + + SET TIME/FREQ LOAD STEP SUBSTEP CUMULATIVE + 1 1.0000 1 1 1 + first load set + + 2 2.0000 2 1 2 + second load set + + 3 3.0000 3 1 3 + third load set + + 4 4.0000 4 1 4 + fourth load set + + and you then issue the following commands: + + .. code:: apdl + + /title, modified title for set number 3 + modify,3,5,2,5,4.5,1 + + The modified results file would look like this: + + .. code:: apdl + + SET TIME/FREQ LOAD STEP SUBSTEP CUMULATIVE + 1 1.0000 1 1 1 + first load set + + 2 2.0000 2 1 2 + second load set + + 3 4.5000 5 2 5 + modified title for set number 3 + + 4 4.0000 4 1 4 + fourth load set + """ + command = f"MODIFY,{set_},{lstep},{iter_},{cumit},{time},{ktitle}" + return self.run(command, **kwargs) + + def undelete(self, option: str = "", nstart: str = "", nend: str = "", **kwargs): + r"""Removes results sets from the group of sets selected for editing. + + Mechanical APDL Command: `UNDELETE `_ + + Parameters + ---------- + option : str + Specifies which sets are to be removed from the selected sets. + + * ``SET`` - Specifies one or more particular sets in the results file that are to be removed from + the group of sets selected for deletion. + + * ``ALL`` - Removes all selected sets that are currently selected for deletion. + + nstart : str + The first set to be removed from the set selected for deletion. + + nend : str + The final set to be removed from the set selected for deletion. This field is used only if + operating on more than one sequential set. + + Notes + ----- + + .. _UNDELETE_notes: + + Use this command if you have previously marked a set for deletion (with the :ref:`delete` command) + and now wish to keep that set instead of deleting it. + + The :ref:`undelete` command is valid only in the results file editing processor (auxiliary processor + AUX3), and, like the other AUX3 commands, it only affects the data steps index (DSI), time (TIM), + loadstep, substep and cumulative step iteration (LSP) records in the results file. + """ + command = f"UNDELETE,{option},{nstart},{nend}" + return self.run(command, **kwargs) diff --git a/src/ansys/mapdl/core/_commands/aux3_.py b/src/ansys/mapdl/core/_commands/aux3_.py deleted file mode 100644 index 0119d56be2d..00000000000 --- a/src/ansys/mapdl/core/_commands/aux3_.py +++ /dev/null @@ -1,191 +0,0 @@ -# Copyright (C) 2016 - 2025 ANSYS, Inc. and/or its affiliates. -# SPDX-License-Identifier: MIT -# -# -# Permission is hereby granted, free of charge, to any person obtaining a copy -# of this software and associated documentation files (the "Software"), to deal -# in the Software without restriction, including without limitation the rights -# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -# copies of the Software, and to permit persons to whom the Software is -# furnished to do so, subject to the following conditions: -# -# The above copyright notice and this permission notice shall be included in all -# copies or substantial portions of the Software. -# -# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -# SOFTWARE. - - -class Aux3: - def compress(self, **kwargs): - """Deletes all specified sets. - - APDL Command: COMPRESS - - Notes - ----- - Issue this command to delete all sets specified with the DELETE - command. - """ - command = f"COMPRESS," - return self.run(command, **kwargs) - - def list(self, level="", **kwargs): - """Lists out the sets in the results file. - - APDL Command: LIST - - Notes - ----- - This command lists the results set number, the load step, substep, and - time step for each set. It also shows all sets marked for deletion. - """ - command = "LIST,%s" % (str(level)) - return self.run(command, **kwargs) - - def fileaux3(self, fname="", ext="", **kwargs): - """Specifies the results file to be edited. - - APDL Command: FILEAUX3 - - 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. - - ext - Filename extension (eight-character maximum). - - Notes - ----- - Specifies the results file to be edited. - """ - command = f"FILEAUX3,{fname},{ext}" - return self.run(command, **kwargs) - - def modify( - self, - set_="", - lstep="", - iter_="", - cumit="", - time="", - ktitle="", - **kwargs, - ): - """Changes the listed values of the data in a set. - - APDL Command: MODIFY - - Parameters - ---------- - set\\_ - Set of data in results file to be modified. - - lstep - The new load step number. - - iter\\_ - The new load substep number. - - cumit - The new cumulative iteration. - - time - The new time/frequency value. - - ktitle - Indicates if the set title should be modified. - - 0 - Keep the original title. - - 1 - Change the title to the title specified with the most current /TITLE command. - - Notes - ----- - Use this command to change the listed values in a data set in a results - file. Using this command does not change any actual model data; it - affects only the values listed in the results file. - - For example, if you start with the following results file: - - and you then issue the following commands: - - The modified results file would look like this: - """ - command = f"MODIFY,{set_},{lstep},{iter_},{cumit},{time},{ktitle}" - return self.run(command, **kwargs) - - def undelete(self, option="", nstart="", nend="", **kwargs): - """Removes results sets from the group of sets selected for editing. - - APDL Command: UNDELETE - - Parameters - ---------- - option - Specifies which sets are to be removed from the selected sets. - - SET - Specifies one or more particular sets in the results file that are to be - removed from the group of sets selected for deletion. - - ALL - Removes all selected sets that are currently selected for deletion. - - nstart - The first set to be removed from the set selected for deletion. - - nend - The final set to be removed from the set selected for deletion. - This field is used only if operating on more than one sequential - set. - - Notes - ----- - Use this command if you have previously marked a set for deletion (with - the DELETE command) and now wish to keep that set instead of deleting - it. - """ - command = f"UNDELETE,{option},{nstart},{nend}" - return self.run(command, **kwargs) - - def delete(self, set_="", nstart="", nend="", **kwargs): - """Specifies sets in the results file to be deleted before postprocessing. - - APDL Command: DELETE - - Parameters - ---------- - set_ - Specifies that sets in the results file are to be deleted. - - nstart - The first set in a results file to be deleted. - - nend - The final set in a results file to be deleted. This field is used - only if deleting more than one sequential sets. - - Notes - ----- - DELETE is a specification command that flags sets in the results - file for deletion. It should be followed by a COMPRESS command, - the corresponding action command that deletes the specified sets. - - The DELETE command is valid only in the results file editing processor - (ANSYS auxiliary processor AUX3). - """ - command = f"DELETE,{set_},{nstart},{nend}" - return self.run(command, **kwargs) diff --git a/src/ansys/mapdl/core/_commands/database/__init__.py b/src/ansys/mapdl/core/_commands/database/__init__.py index d989a660105..473e4f620f2 100644 --- a/src/ansys/mapdl/core/_commands/database/__init__.py +++ b/src/ansys/mapdl/core/_commands/database/__init__.py @@ -20,4 +20,11 @@ # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE # SOFTWARE. -from . import components, coord_sys, picking, selecting, setup, working_plane +from . import ( + components, + coordinate_system, + picking, + selecting, + set_up, + working_plane, +) diff --git a/src/ansys/mapdl/core/_commands/database/components.py b/src/ansys/mapdl/core/_commands/database/components.py index 466b86cbfe8..183de0316bf 100644 --- a/src/ansys/mapdl/core/_commands/database/components.py +++ b/src/ansys/mapdl/core/_commands/database/components.py @@ -20,119 +20,113 @@ # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE # SOFTWARE. -"""These DATABASE commands allow selected subsets of entities to be -named as components for easy selection later on. -""" -from typing import Any, Dict, Literal - class Components: - def cm( - self, - cname: str = "", - entity: Literal["VOLU", "AREA", "LINE", "KP", "ELEM", "NODE", ""] = "", - **kwargs: Dict[Any, Any], - ) -> None: - """Groups geometry items into a component. - APDL Command: CM + def cm(self, cname: str = "", entity: str = "", kopt: str = "", **kwargs): + r"""Groups geometry items into a component. + + Mechanical APDL Command: `CM `_ Parameters ---------- - cname - An alphanumeric name used to identify this component. Cname may be - up to 32 characters, beginning with a letter and containing only - letters, numbers, and underscores. Component names beginning with - an underscore (e.g., _LOOP) are reserved for use by ANSYS and - should be avoided. Components named "ALL," "STAT," and "DEFA" are - not permitted. Overwrites a previously defined name. - - entity + cname : str + An alphanumeric name used to identify this component. ``Cname`` may be up to 256 characters, + beginning with a letter and containing only letters, numbers, dots (.) and underscores (_). + Component names beginning with an underscore (for example, _LOOP) are reserved for use by + Mechanical APDL and should be avoided. Components named "ALL," "STAT," and "DEFA" are not + permitted. Overwrites a previously defined name. + + entity : str Label identifying the type of geometry items to be grouped: - VOLU - Volumes. + * ``VOLU`` - Volumes. + + * ``AREA`` - Areas. - AREA - Areas. + * ``LINE`` - Lines. - LINE - Lines. + * ``KP`` - Keypoints. - KP - Keypoints. + * ``ELEM`` - Elements. - ELEM - Elements. + * ``NODE`` - Nodes. - NODE - Nodes. + kopt : str + Controls how element component contents are updated during `nonlinear mesh adaptivity analysis `_ : + + * 0 - Component is not updated during remeshing and therefore contains only initial mesh elements + (default). + * 1 - Component is updated during remeshing to contain the updated elements. + + This argument is valid only for nonlinear mesh adaptivity analysis with ``Entity`` = ELEM, and for + solid element components only. Notes ----- - Components may be further grouped into assemblies [CMGRP]. The - selected items of the specified entity type will be stored as the - component. Use of this component in the select command [CMSEL] causes - all these items to be selected at once, for convenience. - - A component is a grouping of some geometric entity that can then be - conveniently selected or unselected. A component may be redefined by - reusing a previous component name. The following entity types may - belong to a component: nodes, elements, keypoints, lines, areas, and - volumes. A component may contain only 1 entity type, but an individual - item of any entity may belong to any number of components. Once - defined, the items contained in a component may then be easily selected - or unselected [CMSEL]. Components may be listed [CMLIST], modified - [CMMOD] and deleted [CMDELE]. Components may also be further grouped - into assemblies [CMGRP]. Other entities associated with the entities - in a component (e.g., the lines and keypoints associated with areas) - may be selected by the ALLSEL command. - - An item will be deleted from a component if it has been deleted by - another operation (see the KMODIF command for an example). Components - are automatically updated to reflect deletions of one or more of their - items. Components are automatically deleted and a warning message is - issued if all their items are deleted. Assemblies are also - automatically updated to reflect deletions of one or more of their - components or subassemblies, but are not deleted if all their - components and subassemblies are deleted. - This command is valid in any processor. + .. _CM_notes: + + Components may be further grouped into assemblies ( :ref:`cmgrp` ). The selected items of the + specified entity type will be stored as the component. Use of this component in the select command ( + :ref:`cmsel` ) causes all these items to be selected at once, for convenience. + + A component is a grouping of some geometric entity that can then be conveniently selected or + unselected. A component may be redefined by reusing a previous component name. The following entity + types may belong to a component: nodes, elements, keypoints, lines, areas, and volumes. A component + may contain only 1 entity type, but an individual item of any entity may belong to any number of + components. Once defined, the items contained in a component may then be easily selected or + unselected ( :ref:`cmsel` ). Components may be listed ( :ref:`cmlist` ), modified ( :ref:`cmmod` ) + and deleted ( :ref:`cmdele` ). Components may also be further grouped into assemblies ( :ref:`cmgrp` + ). Other entities associated with the entities in a component (for example, the lines and keypoints + associated with areas) may be selected by the :ref:`allsel` command. + + An item will be deleted from a component if it has been deleted by another operation (see the + :ref:`kmodif` command for an example). Components are automatically updated to reflect deletions of + one or more of their items. Components are automatically deleted and a warning message is issued if + all their items are deleted. Assemblies are also automatically updated to reflect deletions of one + or more of their components or subassemblies, but are not deleted if all their components and + subassemblies are deleted. - Examples - -------- + For `nonlinear mesh adaptivity analysis + `_, an extra + option is available to update the element component contents automatically during the analysis, + applicable in cases where the remeshing region overlaps the defined solid element component region. + By enabling the option, the component element boundary is maintained, and the validity of the + defined component is guaranteed during the entire analysis run; therefore, the component can be used + during both solution and postprocessing. - Create a component selection named ``"PRES_A"`` after - selecting the areas located in the Y plane at `loc`. + Components are often used as input to other commands. Some commands restrict the component name to + 32 characters. For those commands, this limitation is documented within the command description. - >>> mapdl.asel('S', 'LOC', 'Y', loc) - >>> mapdl.cm('PRES_A', 'AREA') + This command is valid in any processor. """ - command = f"CM,{cname}, {entity}" + command = f"CM,{cname},{entity},,{kopt}" return self.run(command, **kwargs) - def cmdele(self, name: str = "", **kwargs: Dict[Any, Any]) -> None: - """Deletes a component or assembly definition. + def cmdele(self, name: str = "", **kwargs): + r"""Deletes a component or assembly definition. - APDL Command: CMDELE + Mechanical APDL Command: `CMDELE `_ Parameters ---------- - name - Name of the component or assembly whose definition is to be - removed. + name : str + Name of the component or assembly whose definition is to be removed. Notes ----- - Entities contained in the component, or the components within the - assembly, are unaffected. Only the grouping relationships are deleted. - Assemblies are automatically updated to reflect deletion of their - components or subassemblies, but they are not automatically deleted - when all their components or subassemblies are deleted. + + .. _CMDELE_notes: + + Entities contained in the component, or the components within the assembly, are unaffected. Only the + grouping relationships are deleted. Assemblies are automatically updated to reflect deletion of + their components or subassemblies, but they are not automatically deleted when all their components + or subassemblies are deleted. This command is valid in any processor. """ - command = f"CMDELE, {name}" + command = f"CMDELE,{name}" return self.run(command, **kwargs) def cmedit( @@ -146,36 +140,54 @@ def cmedit( cnam5: str = "", cnam6: str = "", cnam7: str = "", - **kwargs: Dict[Any, Any], - ) -> None: - """Edits an existing assembly. + **kwargs, + ): + r"""Edits an existing assembly. - APDL Command: CMEDIT + Mechanical APDL Command: `CMEDIT `_ Parameters ---------- - aname + aname : str Name of the assembly to be edited. - oper + oper : str Operation label: - ADD - To add more components. The level of any assembly to be added must be lower - than that of the assembly Aname (see CMGRP command). + * ``ADD`` - To add more components. The level of any assembly to be added must be lower than that of + the assembly ``Aname`` (see :ref:`cmgrp` command). + + * ``DELE`` - To remove components. + + cnam1 : str + Names of components and assemblies to be added to or deleted from the assembly. + + cnam2 : str + Names of components and assemblies to be added to or deleted from the assembly. - DELE - To remove components. + cnam3 : str + Names of components and assemblies to be added to or deleted from the assembly. - cnam1, cnam2, cnam3, . . . , cnam7 - Names of components and assemblies to be added to or deleted from - the assembly. + cnam4 : str + Names of components and assemblies to be added to or deleted from the assembly. + + cnam5 : str + Names of components and assemblies to be added to or deleted from the assembly. + + cnam6 : str + Names of components and assemblies to be added to or deleted from the assembly. + + cnam7 : str + Names of components and assemblies to be added to or deleted from the assembly. Notes ----- + + .. _CMEDIT_notes: + This command is valid in any processor. """ - command = f"CMEDIT,{aname},{oper},{cnam1},{cnam2},{cnam3},{cnam4},{cnam5},{cnam6},{cnam7}" # noqa : E501 + command = f"CMEDIT,{aname},{oper},{cnam1},{cnam2},{cnam3},{cnam4},{cnam5},{cnam6},{cnam7}" return self.run(command, **kwargs) def cmgrp( @@ -189,138 +201,148 @@ def cmgrp( cnam6: str = "", cnam7: str = "", cnam8: str = "", - **kwargs: Dict[Any, Any], - ) -> None: - """Groups components and assemblies into an assembly. + **kwargs, + ): + r"""Groups components and assemblies into an assembly. - APDL Command: CMGRP + Mechanical APDL Command: `CMGRP `_ Parameters ---------- - aname - An alphanumeric name used to identify this assembly. Aname may be - up to 32 characters, beginning with a letter and containing only - letters, numbers, and underscores. Overwrites a previously defined - Aname (and removes it from higher level assemblies, if any). + aname : str + An alphanumeric name used to identify this assembly. ``Aname`` may be up to 256 characters, + beginning with a letter and containing only letters, numbers, dots (.), and underscores (_). + Overwrites a previously defined ``Aname`` (and removes it from higher level assemblies, if any). + + cnam1 : str + Names of existing components or other assemblies to be included in this assembly. + + cnam2 : str + Names of existing components or other assemblies to be included in this assembly. - cnam1, cnam2, cnam3, . . . , cnam8 - Names of existing components or other assemblies to be included in - this assembly. + cnam3 : str + Names of existing components or other assemblies to be included in this assembly. + + cnam4 : str + Names of existing components or other assemblies to be included in this assembly. + + cnam5 : str + Names of existing components or other assemblies to be included in this assembly. + + cnam6 : str + Names of existing components or other assemblies to be included in this assembly. + + cnam7 : str + Names of existing components or other assemblies to be included in this assembly. + + cnam8 : str + Names of existing components or other assemblies to be included in this assembly. Notes ----- - Groups components and other assemblies into an assembly identified by a - name. CMGRP is used for the initial definition of an assembly. An - assembly is used in the same manner as a component. Up to 5 levels of - assemblies within assemblies may be used. - - An assembly is a convenient grouping of previously defined components - and other assemblies. Assemblies may contain components only, other - assemblies, or any combination. A component may belong to any number - of assemblies. Up to 5 levels of nested assemblies may be defined. - Components and assemblies may be added to or deleted from an existing - assembly by the CMEDIT command. Once defined, an assembly may be - listed, deleted, selected, or unselected using the same commands as for - a component. Assemblies are automatically updated to reflect deletions - of one or more of their components or lower-level assemblies. - Assemblies are not automatically deleted when all their components or - subassemblies are deleted. + + .. _CMGRP_notes: + + Groups components and other assemblies into an assembly identified by a name. :ref:`cmgrp` is used + for the initial definition of an assembly. An assembly is used in the same manner as a component. Up + to 5 levels of assemblies within assemblies may be used. + + An assembly is a convenient grouping of previously defined components and other assemblies. + Assemblies may contain components only, other assemblies, or any combination. A component may belong + to any number of assemblies. Up to 5 levels of nested assemblies may be defined. Components and + assemblies may be added to or deleted from an existing assembly by the :ref:`cmedit` command. Once + defined, an assembly may be listed, deleted, selected, or unselected using the same commands as for + a component. Assemblies are automatically updated to reflect deletions of one or more of their + components or lower-level assemblies. Assemblies are not automatically deleted when all their + components or subassemblies are deleted. This command is valid in any processor. """ - command = f"CMGRP,{aname},{cnam1},{cnam2},{cnam3},{cnam4},{cnam5},{cnam6},{cnam7},{cnam8}" # noqa : E501 + command = f"CMGRP,{aname},{cnam1},{cnam2},{cnam3},{cnam4},{cnam5},{cnam6},{cnam7},{cnam8}" return self.run(command, **kwargs) - def cmlist( - self, - name: str = "", - key: str = "", - entity: Literal["VOLU", "AREA", "LINE", "KP", "ELEM", "NODE", ""] = "", - **kwargs: Dict[Any, Any], - ) -> None: - """Lists the contents of a component or assembly. + def cmlist(self, name: str = "", key: int | str = "", entity: str = "", **kwargs): + r"""Lists the contents of a component or assembly. - APDL Command: CMLIST + Mechanical APDL Command: `CMLIST `_ Parameters ---------- - name - Name of the component or assembly to be listed (if blank, list all - selected components and assemblies). If Name is specified, then - Entity is ignored. + name : str + Name of the component or assembly to be listed (if blank, list all selected components and + assemblies). If ``Name`` is specified, then ``Entity`` is ignored. - key + key : int or str Expansion key: - 0 - Do not list individual entities in the component. + * ``0`` - Do not list individual entities in the component. - 1 or EXPA - List individual entities in the component. + * ``1 or EXPA`` - List individual entities in the component. - entity - If Name is blank, then the following entity types can be specified: + entity : str + If ``Name`` is blank, then the following entity types can be specified: - VOLU - List the volume components only. + * ``VOLU`` - List the volume components only. - AREA - List the area components only. + * ``AREA`` - List the area components only. - LINE - List the line components only. + * ``LINE`` - List the line components only. - KP - List the keypoint components only + * ``KP`` - List the keypoint components only - ELEM - List the element components only. + * ``ELEM`` - List the element components only. - NODE - List the node components only. + * ``NODE`` - List the node components only. Notes ----- - This command is valid in any processor. For components, it lists the - type of geometric entity. For assemblies, it lists the components - and/or assemblies that make up the assembly. + + .. _CMLIST_notes: + + This command is valid in any processor. For components, it lists the type of geometric entity. For + assemblies, it lists the components and/or assemblies that make up the assembly. Examples of possible usage: + + * :ref:`cmlist` - List all selected components. + * :ref:`cmlist`, EXPA - List all selected components and for each component list the underlying + entity ID's. + * :ref:`cmlist`, ``Name`` - List the specified component. + * :ref:`cmlist`, ``Name``,EXPA - List specified component along with all underlying entity ID's. + * :ref:`cmlist`, EXPA, ``Entity`` - List all selected components of specified entity type. + For each component also list the underlying entity ID's. """ command = f"CMLIST,{name},{key},{entity}" return self.run(command, **kwargs) - def cmmod( - self, - cname: str = "", - keyword: str = "", - value: str = "", - **kwargs: Dict[Any, Any], - ) -> None: - """Modifies the specification of a component. + def cmmod(self, cname: str = "", keyword: str = "", value: str = "", **kwargs): + r"""Modifies the specification of a component. - APDL Command: CMMOD + Mechanical APDL Command: `CMMOD `_ Parameters ---------- - cname + cname : str Name of the existing component or assembly to be modified. - keyword + keyword : str The label identifying the type of value to be modified. - value - If Keyword is NAME, then the value is the alphanumeric label to be - applied. See the CM command for naming convention details. If a - component named Value already exists, the command will be ignored - and an error message will be generated. + * NAME - Modify the NAME of the component + + value : str + If ``Keyword`` is NAME, then the value is the alphanumeric label to be applied. See the + :ref:`cm` command for naming convention details. If a component named ``Value`` already exists, + the command will be ignored and an error message will be generated. Notes ----- - The naming conventions for components, as specified in the CM command, - apply for CMMOD (32 characters, "ALL", "STAT" and "DEFA" are not - allowed, etc.). However, if you choose a component name that is already - designated for another component, an error message will be issued and + + .. _CMMOD_notes: + + The naming conventions for components, as specified in the :ref:`cm` command, apply for :ref:`cmmod` + ( 256 characters, "ALL", "STAT" and "DEFA" are not allowed, etc.). However, if you choose a + component name that is already designated for another component, an error message will be issued and the command will be ignored. This command is valid in any processor. @@ -328,201 +350,167 @@ def cmmod( command = f"CMMOD,{cname},{keyword},{value}" return self.run(command, **kwargs) - def cmplot( - self, - label: str = "", - entity: str = "", - keyword: str = "", - **kwargs: Dict[Any, Any], - ) -> None: - """Plots the entities contained in a component or assembly. + def cmplot(self, label: str = "", entity: str = "", keyword: str = "", **kwargs): + r"""Plots the entities contained in a component or assembly. - APDL Command: CMPLOT + Mechanical APDL Command: `CMPLOT `_ Parameters ---------- - label + label : str Name of the component or assembly to be plotted. - (blank) - All selected components and assemblies are plotted (default). If fewer than 11 - components are selected, then all are plotted. If more - than 11 components are selected, then only the first 11 - are plotted. + * ``(blank)`` - All selected components and assemblies are plotted (default). If fewer than 11 + components are selected, then all are plotted. If more than 11 components are selected, then only + the first 11 are plotted. - ALL - All selected components are plotted. If number of selected components is - greater than 11, then the legend showing component names will - not be shown. + * ``ALL`` - All selected components are plotted. If number of selected components is greater than + 11, then the legend showing component names will not be shown. - N - Next set of defined components and assemblies is plotted. + * ``N`` - Next set of defined components and assemblies is plotted. - P - Previous set of defined components and assemblies is plotted. + * ``P`` - Previous set of defined components and assemblies is plotted. - Cname - The specified component or assembly is plotted. + * ``Cname`` - The specified component or assembly is plotted. - SetNo. - The specified set number is plotted. + * ``SetNo.`` - The specified set number is plotted. - entity - If Label is BLANK or ALL, then the following entity types can be - specified: + entity : str + If ``Label`` is BLANK or ALL, then the following entity types can be specified: - VOLU - Plot the volume components only. + * ``VOLU`` - Plot the volume components only. - AREA - Plot the area components only. + * ``AREA`` - Plot the area components only. - LINE - Plot the line components only. + * ``LINE`` - Plot the line components only. - KP - Plot the keypoint components only. + * ``KP`` - Plot the keypoint components only. - ELEM - Plot the element components only. + * ``ELEM`` - Plot the element components only. - NODE - Plot the node components only. + * ``NODE`` - Plot the node components only. - keyword - For Keyword = ALL, plot the specified component name in the Label - field in the context of all entities of the same type. Not valid if - Label field is BLANK or ALL. + keyword : str + For ``Keyword`` = ALL, plot the specified component name in the ``Label`` field in the context + of all entities of the same type. Not valid if ``Label`` field is BLANK or ALL. Notes ----- - Components are plotted with their native entities. For assemblies, all - native entities for the underlying component types are plotted - simultaneously. Although more components can be plotted, the legend - displays only 11 at a time. When more than eleven are plotted, the - legend is not displayed. + + .. _CMPLOT_notes: + + Components are plotted with their native entities. For assemblies, all native entities for the + underlying component types are plotted simultaneously. Although more components can be plotted, the + legend displays only 11 at a time. When more than eleven are plotted, the legend is not displayed. Possible usage: + * :ref:`cmplot`, ``CNAME`` - Plots the specified component (if selected). + * :ref:`cmplot`, ``CNAME``, ALL - Plot component in the context of all other selected entity + components of the same type as the component. + * :ref:`cmplot` - Plot the first eleven selected components. + * :ref:`cmplot`,ALL - Plot all selected components. + * :ref:`cmplot`,N or :ref:`cmplot`,P - Plot next or previous set of eleven components. + * :ref:`cmplot`,ALL, ``Entity`` - Plot all selected components of type specified in ``Entity``. + * :ref:`cmplot`, ``Entity`` - Plot components of type specified in ``Entity``, from the first + eleven components. + * :ref:`cmplot`,N, ``Entity`` - Plot components of type specified in ``Entity``, if any, from the + next set of eleven components (substitute P for N to plot from previous set). + This command is valid in any processor. """ command = f"CMPLOT,{label},{entity},{keyword}" return self.run(command, **kwargs) - def cmsel( - self, - type_: str = "", - name: str = "", - entity: Literal["VOLU", "AREA", "LINE", "KP", "ELEM", "NODE", ""] = "", - **kwargs: Dict[Any, Any], - ) -> None: - """Selects a subset of components and assemblies. + def cmsel(self, type_: str = "", name: str = "", entity: str = "", **kwargs): + r"""Selects a subset of components and assemblies. - APDL Command: CMSEL + Mechanical APDL Command: `CMSEL `_ Parameters ---------- - type_ - + type_ : str Label identifying the type of select: - S - Select a new set (default). + * ``S`` - Select a new set (default). - R - Reselect a set from the current set. + * ``R`` - Reselect a set from the current set. - A - Additionally select a set and extend the current set. + * ``A`` - Additionally select a set and extend the current set. - U - Unselect a set from the current set. + * ``U`` - Unselect a set from the current set. - ALL - Also select all components. + * ``ALL`` - Also select all components. - NONE - Unselect all components. + * ``NONE`` - Unselect all components. - name - Name of component or assembly whose items are to be selected (valid - only if Type = S, R, A, or U). + name : str + Name of component or assembly whose items are to be selected (valid only if ``Type`` = S, R, A, + or U). - entity - If Name is blank, then the following entity types can be specified: + Graphical picking is enabled if ``Type`` is blank and ``Name`` = PICK (or simply "P"). - VOLU - Select the volume components only. + entity : str + If ``Name`` is blank, then the following entity types can be specified: - AREA - Select the area components only. + * ``VOLU`` - Select the volume components only. - LINE - Select the line components only. + * ``AREA`` - Select the area components only. - KP - Select the keypoint components only. + * ``LINE`` - Select the line components only. - ELEM - Select the element components only. + * ``KP`` - Select the keypoint components only. - NODE - Select the node components only. + * ``ELEM`` - Select the element components only. + + * ``NODE`` - Select the node components only. Notes ----- - Selecting by component is a convenient adjunct to individual item - selection (e.g., VSEL, ESEL, etc.). CMSEL, ALL allows you to select - components in addition to other items you have already selected. - - If Type = R for an assembly selection [CMSEL,R,], the - reselect operation is performed on each component in the assembly in - the order in which the components make up the assembly. Thus, if one - reselect operation results in an empty set, subsequent operations will - also result in empty sets. For example, if the first reselect - operation tries to reselect node 1 from the selected set of nodes 3, 4, - and 5, the operation results in an empty set (that is, no nodes are - selected). Since the current set is now an empty set, if the second - reselect operation tries to reselect any nodes, the second operation - also results in an empty set, and so on. This is equivalent to - repeating the command CMSEL,R, once for each component - making up the assembly. + + .. _CMSEL_notes: + + Selecting by component is a convenient adjunct to individual item selection (for example, + :ref:`vsel`, :ref:`esel`, etc.). :ref:`cmsel`, ALL allows you to select components **in addition** + to other items you have already selected. + + If ``Type`` = R for an assembly selection ( :ref:`cmsel`,R,< assembly-name >), the reselect + operation is performed on each component in the assembly in the order in which the components make + up the assembly. Thus, if one reselect operation results in an empty set, subsequent operations will + also result in empty sets. For example, if the first reselect operation tries to reselect node 1 + from the selected set of nodes 3, 4, and 5, the operation results in an empty set (that is, no nodes + are selected). Since the current set is now an empty set, if the second reselect operation tries to + reselect any nodes, the second operation also results in an empty set, and so on. This is equivalent + to repeating the command :ref:`cmsel`,R,< component-name > once for each component making up the + assembly. This command is valid in any processor. """ command = f"CMSEL,{type_},{name},{entity}" return self.run(command, **kwargs) - def cmwrite( - self, - fname: str = "", - ext: str = "", - fmat: str = "", - **kwargs: Dict[Any, Any], - ) -> str: - """Writes node and element components and assemblies to a file. + def cmwrite(self, fname: str = "", ext: str = "", fmat: str = "", **kwargs): + r"""Writes node and element components and assemblies to a file. - APDL Command: CMWRITE + Mechanical APDL Command: `CMWRITE `_ 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. - The file name defaults to ``Jobname``. - Ext - Filename extension (eight-character maximum). - The extension defaults to ``CM`` if ``fname`` is blank. - - Fmat - Format of the output file (defaults to ``BLOCKED``). - - * ``BLOCKED``: Blocked format. This format allows faster - reading of the file. - - * ``UNBLOCKED``: Unblocked format. + 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 : str + Filename extension (eight-character maximum). The extension defaults to CM if ``Fname`` is + blank. + + fmat : str + Format of the output file (defaults to BLOCKED). + + * ``BLOCKED`` - Blocked format. This format allows faster reading of the file. + + * ``UNBLOCKED`` - Unblocked format. """ command = f"CMWRITE,{fname},{ext},,,{fmat}" diff --git a/src/ansys/mapdl/core/_commands/database/coord_sys.py b/src/ansys/mapdl/core/_commands/database/coord_sys.py deleted file mode 100644 index ee0e554ecb7..00000000000 --- a/src/ansys/mapdl/core/_commands/database/coord_sys.py +++ /dev/null @@ -1,575 +0,0 @@ -# Copyright (C) 2016 - 2025 ANSYS, Inc. and/or its affiliates. -# SPDX-License-Identifier: MIT -# -# -# Permission is hereby granted, free of charge, to any person obtaining a copy -# of this software and associated documentation files (the "Software"), to deal -# in the Software without restriction, including without limitation the rights -# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -# copies of the Software, and to permit persons to whom the Software is -# furnished to do so, subject to the following conditions: -# -# The above copyright notice and this permission notice shall be included in all -# copies or substantial portions of the Software. -# -# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -# SOFTWARE. - -"""These DATABASE commands define and manipulate coordinate systems.""" - - -class CoordinateSystem: - def clocal( - self, - kcn="", - kcs="", - xl="", - yl="", - zl="", - thxy="", - thyz="", - thzx="", - par1="", - par2="", - **kwargs, - ): - """Defines a local coordinate system relative to the active coordinate - - APDL Command: CLOCAL - system. - - Parameters - ---------- - kcn - Arbitrary reference number assigned to this coordinate system. - Must be greater than 10. A coordinate system previously defined - with this number will be redefined. - - kcs - Coordinate system type: - - 0 or CART - Cartesian - - 1 or CYLIN - Cylindrical (circular or elliptical) - - 2 or SPHE - Spherical (or spheroidal) - - 3 or TORO - Toroidal - - xl, yl, zl - Location (in the active coordinate system) of the origin of the new - coordinate system (R, θ, Z for cylindrical, R, θ,Φ for spherical or - toroidal). - - thxy - First rotation about local Z (positive X toward Y). - - thyz - Second rotation about local X (positive Y toward Z). - - thzx - Third rotation about local Y (positive Z toward X). - - par1 - Used for elliptical, spheroidal, or toroidal systems. If KCS = 1 - or 2, PAR1 is the ratio of the ellipse Y-axis radius to X-axis - radius (defaults to 1.0 (circle)). If KCS = 3, PAR1 is the major - radius of the torus. - - par2 - Used for spheroidal systems. If KCS = 2, PAR2 = ratio of ellipse - Z-axis radius to X-axis radius (defaults to 1.0 (circle)). - - Notes - ----- - Defines and activates a local coordinate system by origin location and - orientation angles relative to the active coordinate system. This - local system becomes the active coordinate system, and is automatically - aligned with the active system (i.e., x is radial if a cylindrical - system is active, etc.). Nonzero rotation angles (degrees) are - relative to this automatic rotation. See the CS, CSKP, CSWPLA, and - LOCAL commands for alternate definitions. Local coordinate systems may - be displayed with the /PSYMB command. - - This command is valid in any processor. - """ - command = "CLOCAL,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s" % ( - str(kcn), - str(kcs), - str(xl), - str(yl), - str(zl), - str(thxy), - str(thyz), - str(thzx), - str(par1), - str(par2), - ) - return self.run(command, **kwargs) - - def cs( - self, kcn="", kcs="", norig="", nxax="", nxypl="", par1="", par2="", **kwargs - ): - """Defines a local coordinate system by three node locations. - - APDL Command: CS - - Parameters - ---------- - kcn - Arbitrary reference number assigned to this coordinate system. - Must be greater than 10. A coordinate system previously defined - with this number will be redefined. - - kcs - Coordinate system type: - - 0 or CART - Cartesian - - 1 or CYLIN - Cylindrical (circular or elliptical) - - 2 or SPHE - Spherical (or spheroidal) - - 3 or TORO - Toroidal - - norig - Node defining the origin of this coordinate system. If NORIG = P, - graphical picking is enabled and all remaining command fields are - ignored (valid only in the GUI). - - nxax - Node defining the positive x-axis orientation of this coordinate - system. - - nxypl - Node defining the x-y plane (with NORIG and NXAX) in the first or - second quadrant of this coordinate system. - - par1 - Used for elliptical, spheroidal, or toroidal systems. If KCS = 1 - or 2, PAR1 is the ratio of the ellipse Y-axis radius to X-axis - radius (defaults to 1.0 (circle)). If KCS = 3, PAR1 is the major - radius of the torus. - - par2 - Used for spheroidal systems. If KCS = 2, PAR2 = ratio of ellipse - Z-axis radius to X-axis radius (defaults to 1.0 (circle)). - - Notes - ----- - Defines and activates a local right-handed coordinate system by - specifying three existing nodes: to locate the origin, to locate the - positive x-axis, and to define the positive x-y plane. This local - system becomes the active coordinate system. See the CLOCAL, CSKP, - CSWPLA, and LOCAL commands for alternate definitions. Local coordinate - systems may be displayed with the /PSYMB command. - - This command is valid in any processor. - """ - command = "CS,%s,%s,%s,%s,%s,%s,%s" % ( - str(kcn), - str(kcs), - str(norig), - str(nxax), - str(nxypl), - str(par1), - str(par2), - ) - return self.run(command, **kwargs) - - def cscir(self, kcn="", kthet="", kphi="", **kwargs): - """Locates the singularity for non-Cartesian local coordinate systems. - - APDL Command: CSCIR - - Parameters - ---------- - kcn - Number of the local coordinate system in which singularity location - is to be changed. Must be greater than 10. - - kthet - Theta singularity location for cylindrical, spherical, and toroidal - systems: - - 0 - Singularity at ±180°. - - 1 - Singularity at 0° (360°). - - kphi - Phi singularity location for toroidal systems: - - 0 - Singularity in phi direction at ±180°. - - 1 - Singularity in phi direction at 0° (360°). - - Notes - ----- - Continuous closed surfaces (circles, cylinders, spheres, etc.) have a - singularity (discontinuity) at θ = ±180°. For local cylindrical, - spherical, and toroidal coordinate systems, this singularity location - may be changed to 0° (360°). - - An additional, similar singularity occurs in the toroidal coordinate - system at: Φ = ±180° and can be moved with KPHI. Additional - singularities occur in the spherical coordinate system at: Φ = ±90°, - but cannot be moved. - - This command is valid in any processor. - """ - command = "CSCIR,%s,%s,%s" % (str(kcn), str(kthet), str(kphi)) - return self.run(command, **kwargs) - - def csdele(self, kcn1="", kcn2="", kcinc="", **kwargs): - """Deletes local coordinate systems. - - APDL Command: CSDELE - - Parameters - ---------- - kcn1, kcn2, kcinc - Delete coordinate systems from KCN1 (must be greater than 10) to - KCN2 (defaults to KCN1) in steps of KCINC (defaults to 1). If KCN1 - = ALL, KCN2 and KCINC are ignored and all coordinate systems are - deleted. - - Notes - ----- - This command is valid in any processor. - """ - command = "CSDELE,%s,%s,%s" % (str(kcn1), str(kcn2), str(kcinc)) - return self.run(command, **kwargs) - - def cskp( - self, kcn="", kcs="", porig="", pxaxs="", pxypl="", par1="", par2="", **kwargs - ): - """Defines a local coordinate system by three keypoint locations. - - APDL Command: CSKP - - Parameters - ---------- - kcn - Arbitrary reference number assigned to this coordinate system. - Must be greater than 10. A coordinate system previously defined - with this number will be redefined. - - kcs - Coordinate system type: - - 0 or CART - Cartesian - - 1 or CYLIN - Cylindrical (circular or elliptical) - - 2 or SPHE - Spherical (or spheroidal) - - 3 or TORO - Toroidal - - porig - Keypoint defining the origin of this coordinate system. If PORIG = - P, graphical picking is enabled and all remaining command fields - are ignored (valid only in the GUI). - - pxaxs - Keypoint defining the positive x-axis orientation of this - coordinate system. - - pxypl - Keypoint defining the x-y plane (with PORIG and PXAXS) in the first - or second quadrant of this coordinate system. - - par1 - Used for elliptical, spheroidal, or toroidal systems. If KCS = 1 - or 2, PAR1 is the ratio of the ellipse Y-axis radius to X-axis - radius (defaults to 1.0 (circle)). If KCS = 3, PAR1 is the major - radius of the torus. - - par2 - Used for spheroidal systems. If KCS = 2, PAR2 = ratio of ellipse - Z-axis radius to X-axis radius (defaults to 1.0 (circle)). - - Notes - ----- - Defines and activates a local right-handed coordinate system by - specifying three existing keypoints: to locate the origin, to locate - the positive x-axis, and to define the positive x-y plane. This local - system becomes the active coordinate system. See the CLOCAL, CS, - CSWPLA, and LOCAL commands for alternate definitions. Local coordinate - systems may be displayed with the /PSYMB command. - - This command is valid in any processor. - """ - command = "CSKP,%s,%s,%s,%s,%s,%s,%s" % ( - str(kcn), - str(kcs), - str(porig), - str(pxaxs), - str(pxypl), - str(par1), - str(par2), - ) - return self.run(command, **kwargs) - - def cslist(self, kcn1="", kcn2="", kcinc="", **kwargs): - """Lists coordinate systems. - - APDL Command: CSLIST - - Parameters - ---------- - kcn1, kcn2, kcinc - List coordinate systems from KCN1 to KCN2 (defaults to KCN1) in - steps of KCINC (defaults to 1). If KCN1 = ALL (default), KCN2 and - KCINC are ignored and all coordinate systems are listed. - - Notes - ----- - This command is valid in any processor. - """ - command = "CSLIST,%s,%s,%s" % (str(kcn1), str(kcn2), str(kcinc)) - return self.run(command, **kwargs) - - def cswpla(self, kcn="", kcs="", par1="", par2="", **kwargs): - """Defines a local coordinate system at the origin of the working plane. - - APDL Command: CSWPLA - - Parameters - ---------- - kcn - Arbitrary reference number assigned to this coordinate system. - Must be greater than 10. A coordinate system previously defined - with this number will be redefined. - - kcs - Coordinate system type: - - 0 or CART - Cartesian - - 1 or CYLIN - Cylindrical (circular or elliptical) - - 2 or SPHE - Spherical (or spheroidal) - - 3 or TORO - Toroidal - - par1 - Used for elliptical, spheroidal, or toroidal systems. If KCS = 1 - or 2, PAR1 is the ratio of the ellipse Y-axis radius to X-axis - radius (defaults to 1.0 (circle)). If KCS = 3, PAR1 is the major - radius of the torus. - - par2 - Used for spheroidal systems. If KCS = 2, PAR2 = ratio of ellipse - Z-axis radius to X-axis radius (defaults to 1.0 (circle)). - - Notes - ----- - Defines and activates a local right-handed coordinate system centered - at the origin of the working plane. The coordinate system's local x-y - plane (for a Cartesian system) or R-θ plane (for a cylindrical or - spherical system) corresponds to the working plane. This local system - becomes the active coordinate system. See the CS, LOCAL, CLOCAL, and - CSKP commands for alternate ways to define a local coordinate system. - Local coordinate systems may be displayed with the /PSYMB command. - - This command is valid in any processor. - """ - command = "CSWPLA,%s,%s,%s,%s" % ( - str(kcn), - str(kcs), - str(par1), - str(par2), - ) - return self.run(command, **kwargs) - - def csys(self, kcn="", **kwargs): - """Activates a previously defined coordinate system. - - APDL Command: CSYS - - Parameters - ---------- - kcn - Specifies the active coordinate system, as follows: - - 0 (default) - Cartesian - - 1 - Cylindrical with global Cartesian Z as the axis of rotation - - 2 - Spherical - - 4 or WP - Working Plane - - 5 - Cylindrical with global Cartesian Y as the axis of rotation - - 11 or greater - Any previously defined local coordinate system - - Notes - ----- - The CSYS command activates a previously defined coordinate system for - geometry input and generation. The LOCAL, CLOCAL, CS, CSKP, and CSWPLA - commands also activate coordinate systems as they are defined. To set - the active element coordinate system attribute pointer, issue the ESYS - command. - - The active coordinate system for files created via the CDWRITE command - is Cartesian - - >>> mapdl.csys(0) - - This command is valid in any processor. - - >>> mapdl.csys(4) - >>> # or - >>> mapdl.csys('WP') - - activates working plane tracking, which updates the - coordinate system to follow working plane changes. To deactivate - working plane tracking, activate any other coordinate system. - - >>> mapdl.csys(5) - - is a cylindrical coordinate system with global Cartesian Y as - the axis. The local x, y and z axes are radial, θ, and axial - (respectively). The R-Theta plane is the global X-Z plane, as it is for - an axisymmetric model. Thus, at `θ = 0.0`, `mapdl.csys(5)` has a specific - orientation: the local x is in the global +X direction, local y is in - the global -Z direction, and local z (the cylindrical axis) is in the - global +Y direction. - - Examples - -------- - Create a cylindrical surface in cylindrical y (CSYS=5) with - a radius of 6 and spanning `30 < θ < -90` and `0 < z < 4`. - - >>> mapdl.csys(5) - >>> mapdl.k(1, 6, 30) - >>> mapdl.k(2, 6, -90) - >>> mapdl.k(3, 6, -90, 4) - >>> mapdl.k(4, 6, 30, 4) - >>> mapdl.a(1, 2, 3, 4) - >>> mapdl.aplot() - - """ - command = "CSYS,%s" % (str(kcn)) - return self.run(command, **kwargs) - - def local( - self, - kcn="", - kcs="", - xc="", - yc="", - zc="", - thxy="", - thyz="", - thzx="", - par1="", - par2="", - **kwargs, - ): - """Defines a local coordinate system by a location and orientation. - - APDL Command: LOCAL - - Parameters - ---------- - kcn - Arbitrary reference number assigned to this coordinate system. - Must be greater than 10. A coordinate system previously defined - with this number will be redefined. - - kcs - Coordinate system type: - - 0 or CART - Cartesian - - 1 or CYLIN - Cylindrical (circular or elliptical) - - 2 or SPHE - Spherical (or spheroidal) - - 3 or TORO - Toroidal - - xc, yc, zc - Location (in the global Cartesian coordinate system) of the origin - of the new coordinate system. - - thxy - First rotation about local Z (positive X toward Y). - - thyz - Second rotation about local X (positive Y toward Z). - - thzx - Third rotation about local Y (positive Z toward X). - - par1 - Used for elliptical, spheroidal, or toroidal systems. If KCS = 1 - or 2, PAR1 is the ratio of the ellipse Y-axis radius to X-axis - radius (defaults to 1.0 (circle)). If KCS = 3, PAR1 is the major - radius of the torus. - - par2 - Used for spheroidal systems. If KCS = 2, PAR2 = ratio of ellipse - Z-axis radius to X-axis radius (defaults to 1.0 (circle)). - - Notes - ----- - Defines a local coordinate system by origin location and orientation - angles. The local coordinate system is parallel to the global - Cartesian system unless rotated. Rotation angles are in degrees and - redefine any previous rotation angles. See the CLOCAL, CS, CSWPLA, and - CSKP commands for alternate definitions. This local system becomes the - active coordinate system [CSYS]. Local coordinate systems may be - displayed with the /PSYMB command. - - This command is valid in any processor. - """ - command = "LOCAL,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s" % ( - str(kcn), - str(kcs), - str(xc), - str(yc), - str(zc), - str(thxy), - str(thyz), - str(thzx), - str(par1), - str(par2), - ) - return self.run(command, **kwargs) diff --git a/src/ansys/mapdl/core/_commands/database/coordinate_system.py b/src/ansys/mapdl/core/_commands/database/coordinate_system.py new file mode 100644 index 00000000000..54182356969 --- /dev/null +++ b/src/ansys/mapdl/core/_commands/database/coordinate_system.py @@ -0,0 +1,545 @@ +# Copyright (C) 2016 - 2025 ANSYS, Inc. and/or its affiliates. +# SPDX-License-Identifier: MIT +# +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to deal +# in the Software without restriction, including without limitation the rights +# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +# copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in all +# copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +# SOFTWARE. + + +class CoordinateSystem: + + def clocal( + self, + kcn: str = "", + kcs: str = "", + xl: str = "", + yl: str = "", + zl: str = "", + thxy: str = "", + thyz: str = "", + thzx: str = "", + par1: str = "", + par2: str = "", + **kwargs, + ): + r"""Defines a local coordinate system relative to the active coordinate system. + + Mechanical APDL Command: `CLOCAL `_ + + Parameters + ---------- + kcn : str + Arbitrary reference number assigned to this coordinate system. Must be greater than 10. A + coordinate system previously defined with this number will be redefined. + + kcs : str + Coordinate system type: + + * ``0 or CART`` - Cartesian + + * ``1 or CYLIN`` - Cylindrical (circular or elliptical) + + * ``2 or SPHE`` - Spherical (or spheroidal) + + * ``3 or TORO`` - Toroidal + + xl : str + Location (in the active coordinate system) of the origin of the new coordinate system (R, θ, Z + for cylindrical, R, θ,Φ for spherical or toroidal). + + yl : str + Location (in the active coordinate system) of the origin of the new coordinate system (R, θ, Z + for cylindrical, R, θ,Φ for spherical or toroidal). + + zl : str + Location (in the active coordinate system) of the origin of the new coordinate system (R, θ, Z + for cylindrical, R, θ,Φ for spherical or toroidal). + + thxy : str + First rotation about local Z (positive X toward Y). + + thyz : str + Second rotation about local X (positive Y toward Z). + + thzx : str + Third rotation about local Y (positive Z toward X). + + par1 : str + Used for elliptical, spheroidal, or toroidal systems. If ``KCS`` = 1 or 2, ``PAR1`` is the ratio + of the ellipse Y-axis radius to X-axis radius (defaults to 1.0 (circle)). If ``KCS`` = 3, + ``PAR1`` is the major radius of the torus. + + par2 : str + Used for spheroidal systems. If ``KCS`` = 2, ``PAR2`` = ratio of ellipse Z-axis radius to X-axis + radius (defaults to 1.0 (circle)). + + Notes + ----- + + .. _CLOCAL_notes: + + Defines and activates a local coordinate system by origin location and orientation angles relative + to the active coordinate system. This local system becomes the active coordinate system, and is + automatically aligned with the active system (that is, x is radial if a cylindrical system is + active, etc.). Nonzero rotation angles (degrees) are relative to this automatic rotation. See the + :ref:`cs`, :ref:`cskp`, :ref:`cswpla`, and :ref:`local` commands for alternate definitions. Local + coordinate systems may be displayed with the :ref:`psymb` command. + + This command is valid in any processor. + """ + command = ( + f"CLOCAL,{kcn},{kcs},{xl},{yl},{zl},{thxy},{thyz},{thzx},{par1},{par2}" + ) + return self.run(command, **kwargs) + + def cs( + self, + kcn: str = "", + kcs: str = "", + norig: str = "", + nxax: str = "", + nxypl: str = "", + par1: str = "", + par2: str = "", + **kwargs, + ): + r"""Defines a local coordinate system by three node locations. + + Mechanical APDL Command: `CS `_ + + Parameters + ---------- + kcn : str + Arbitrary reference number assigned to this coordinate system. Must be greater than 10. A + coordinate system previously defined with this number will be redefined. + + kcs : str + Coordinate system type: + + * ``0 or CART`` - Cartesian + + * ``1 or CYLIN`` - Cylindrical (circular or elliptical) + + * ``2 or SPHE`` - Spherical (or spheroidal) + + * ``3 or TORO`` - Toroidal + + norig : str + Node defining the origin of this coordinate system. If ``NORIG`` = P, graphical picking is + enabled and all remaining command fields are ignored (valid only in the GUI). + + nxax : str + Node defining the positive x-axis orientation of this coordinate system. + + nxypl : str + Node defining the x-y plane (with ``NORIG`` and ``NXAX`` ) in the first or second quadrant of + this coordinate system. + + par1 : str + Used for elliptical, spheroidal, or toroidal systems. If ``KCS`` = 1 or 2, ``PAR1`` is the ratio + of the ellipse Y-axis radius to X-axis radius (defaults to 1.0 (circle)). If ``KCS`` = 3, + ``PAR1`` is the major radius of the torus. + + par2 : str + Used for spheroidal systems. If ``KCS`` = 2, ``PAR2`` = ratio of ellipse Z-axis radius to X-axis + radius (defaults to 1.0 (circle)). + + Notes + ----- + + .. _CS_notes: + + Defines and activates a local right-handed coordinate system by specifying three existing nodes: to + locate the origin, to locate the positive x-axis, and to define the positive x-y plane. This local + system becomes the active coordinate system. See the :ref:`clocal`, :ref:`cskp`, :ref:`cswpla`, and + :ref:`local` commands for alternate definitions. Local coordinate systems may be displayed with the + :ref:`psymb` command. + + This command is valid in any processor. + """ + command = f"CS,{kcn},{kcs},{norig},{nxax},{nxypl},{par1},{par2}" + return self.run(command, **kwargs) + + def cscir( + self, kcn: str = "", kthet: int | str = "", kphi: int | str = "", **kwargs + ): + r"""Locates the singularity for non-Cartesian local coordinate systems. + + Mechanical APDL Command: `CSCIR `_ + + **Command default:** + + .. _CSCIR_default: + + Singularities at ±180°. + + Parameters + ---------- + kcn : str + Number of the local coordinate system in which singularity location is to be changed. Must be + greater than 10. + + kthet : int or str + Theta singularity location for cylindrical, spherical, and toroidal systems: + + * ``0`` - Singularity at ±180°. + + * ``1`` - Singularity at 0° (360°). + + kphi : int or str + Phi singularity location for toroidal systems: + + * ``0`` - Singularity in phi direction at ±180°. + + * ``1`` - Singularity in phi direction at 0° (360°). + + Notes + ----- + + .. _CSCIR_notes: + + Continuous closed surfaces (circles, cylinders, spheres, etc.) have a singularity (discontinuity) at + θ = ±180°. For local cylindrical, spherical, and toroidal coordinate systems, this + singularity location may be changed to 0° (360°). + + An additional, similar singularity occurs in the toroidal coordinate system at Φ = ±180° and can be + moved with ``KPHI``. Additional singularities occur in the spherical coordinate system at Φ = ±90°, + but cannot be moved. + + This command is valid in any processor. + """ + command = f"CSCIR,{kcn},{kthet},{kphi}" + return self.run(command, **kwargs) + + def csdele(self, kcn1: str = "", kcn2: str = "", kcinc: str = "", **kwargs): + r"""Deletes local coordinate systems. + + Mechanical APDL Command: `CSDELE `_ + + Parameters + ---------- + kcn1 : str + Delete coordinate systems from ``KCN1`` (must be greater than 10) to ``KCN2`` (defaults to + ``KCN1`` ) in steps of ``KCINC`` (defaults to 1). If ``KCN1`` = ALL, ``KCN2`` and ``KCINC`` are + ignored and all coordinate systems are deleted. + + kcn2 : str + Delete coordinate systems from ``KCN1`` (must be greater than 10) to ``KCN2`` (defaults to + ``KCN1`` ) in steps of ``KCINC`` (defaults to 1). If ``KCN1`` = ALL, ``KCN2`` and ``KCINC`` are + ignored and all coordinate systems are deleted. + + kcinc : str + Delete coordinate systems from ``KCN1`` (must be greater than 10) to ``KCN2`` (defaults to + ``KCN1`` ) in steps of ``KCINC`` (defaults to 1). If ``KCN1`` = ALL, ``KCN2`` and ``KCINC`` are + ignored and all coordinate systems are deleted. + + Notes + ----- + + .. _CSDELE_notes: + + This command is valid in any processor. + """ + command = f"CSDELE,{kcn1},{kcn2},{kcinc}" + return self.run(command, **kwargs) + + def cskp( + self, + kcn: str = "", + kcs: str = "", + porig: str = "", + pxaxs: str = "", + pxypl: str = "", + par1: str = "", + par2: str = "", + **kwargs, + ): + r"""Defines a local coordinate system by three keypoint locations. + + Mechanical APDL Command: `CSKP `_ + + Parameters + ---------- + kcn : str + Arbitrary reference number assigned to this coordinate system. Must be greater than 10. A + coordinate system previously defined with this number will be redefined. + + kcs : str + Coordinate system type: + + * ``0 or CART`` - Cartesian + + * ``1 or CYLIN`` - Cylindrical (circular or elliptical) + + * ``2 or SPHE`` - Spherical (or spheroidal) + + * ``3 or TORO`` - Toroidal + + porig : str + Keypoint defining the origin of this coordinate system. If ``PORIG`` = P, graphical picking is + enabled and all remaining command fields are ignored (valid only in the GUI). + + pxaxs : str + Keypoint defining the positive x-axis orientation of this coordinate system. + + pxypl : str + Keypoint defining the x-y plane (with ``PORIG`` and ``PXAXS`` ) in the first or second quadrant + of this coordinate system. + + par1 : str + Used for elliptical, spheroidal, or toroidal systems. If ``KCS`` = 1 or 2, ``PAR1`` is the ratio + of the ellipse Y-axis radius to X-axis radius (defaults to 1.0 (circle)). If ``KCS`` = 3, + ``PAR1`` is the major radius of the torus. + + par2 : str + Used for spheroidal systems. If ``KCS`` = 2, ``PAR2`` = ratio of ellipse Z-axis radius to X-axis + radius (defaults to 1.0 (circle)). + + Notes + ----- + + .. _CSKP_notes: + + Defines and activates a local right-handed coordinate system by specifying three existing keypoints: + to locate the origin, to locate the positive x-axis, and to define the positive x-y plane. This + local system becomes the active coordinate system. See the :ref:`clocal`, :ref:`cs`, :ref:`cswpla`, + and :ref:`local` commands for alternate definitions. Local coordinate systems may be displayed with + the :ref:`psymb` command. + + This command is valid in any processor. + """ + command = f"CSKP,{kcn},{kcs},{porig},{pxaxs},{pxypl},{par1},{par2}" + return self.run(command, **kwargs) + + def cslist(self, kcn1: str = "", kcn2: str = "", kcinc: str = "", **kwargs): + r"""Lists coordinate systems. + + Mechanical APDL Command: `CSLIST `_ + + Parameters + ---------- + kcn1 : str + List coordinate systems from ``KCN1`` to ``KCN2`` (defaults to ``KCN1`` ) in steps of ``KCINC`` + (defaults to 1). If ``KCN1`` = ALL (default), ``KCN2`` and ``KCINC`` are ignored and all + coordinate systems are listed. + + kcn2 : str + List coordinate systems from ``KCN1`` to ``KCN2`` (defaults to ``KCN1`` ) in steps of ``KCINC`` + (defaults to 1). If ``KCN1`` = ALL (default), ``KCN2`` and ``KCINC`` are ignored and all + coordinate systems are listed. + + kcinc : str + List coordinate systems from ``KCN1`` to ``KCN2`` (defaults to ``KCN1`` ) in steps of ``KCINC`` + (defaults to 1). If ``KCN1`` = ALL (default), ``KCN2`` and ``KCINC`` are ignored and all + coordinate systems are listed. + + Notes + ----- + + .. _CSLIST_notes: + + This command is valid in any processor. + """ + command = f"CSLIST,{kcn1},{kcn2},{kcinc}" + return self.run(command, **kwargs) + + def cswpla( + self, kcn: str = "", kcs: str = "", par1: str = "", par2: str = "", **kwargs + ): + r"""Defines a local coordinate system at the origin of the working plane. + + Mechanical APDL Command: `CSWPLA `_ + + Parameters + ---------- + kcn : str + Arbitrary reference number assigned to this coordinate system. Must be greater than 10. A + coordinate system previously defined with this number will be redefined. + + kcs : str + Coordinate system type: + + * ``0 or CART`` - Cartesian + + * ``1 or CYLIN`` - Cylindrical (circular or elliptical) + + * ``2 or SPHE`` - Spherical (or spheroidal) + + * ``3 or TORO`` - Toroidal + + par1 : str + Used for elliptical, spheroidal, or toroidal systems. If ``KCS`` = 1 or 2, ``PAR1`` is the ratio + of the ellipse Y-axis radius to X-axis radius (defaults to 1.0 (circle)). If ``KCS`` = 3, + ``PAR1`` is the major radius of the torus. + + par2 : str + Used for spheroidal systems. If ``KCS`` = 2, ``PAR2`` = ratio of ellipse Z-axis radius to X-axis + radius (defaults to 1.0 (circle)). + + Notes + ----- + + .. _CSWPLA_notes: + + Defines and activates a local right-handed coordinate system centered at the origin of the working + plane. The coordinate system's local x-y plane (for a Cartesian system) or R-θ plane (for a + cylindrical or spherical system) corresponds to the working plane. This local system becomes the + active coordinate system. See the :ref:`cs`, :ref:`local`, :ref:`clocal`, and :ref:`cskp` commands + for alternate ways to define a local coordinate system. Local coordinate systems may be displayed + with the :ref:`psymb` command. + + This command is valid in any processor. + """ + command = f"CSWPLA,{kcn},{kcs},{par1},{par2}" + return self.run(command, **kwargs) + + def csys(self, kcn: int | str = "", **kwargs): + r"""Activates a previously defined coordinate system. + + Mechanical APDL Command: `CSYS `_ + + Parameters + ---------- + kcn : int or str + Specifies the active coordinate system, as follows: + + * ``0 (default)`` - Cartesian + + * ``1`` - Cylindrical with global Cartesian Z as the axis of rotation + + * ``2`` - Spherical + + * ``4 or WP`` - Working Plane + + * ``5`` - Cylindrical with global Cartesian Y as the axis of rotation + + * ``6`` - Cylindrical with global Cartesian X as the axis of rotation + + * ``11 or greater`` - Any previously defined local coordinate system + + Notes + ----- + + .. _CSYS_notes: + + The :ref:`csys` command activates a previously defined coordinate system for geometry input and + generation. The :ref:`local`, :ref:`clocal`, :ref:`cs`, :ref:`cskp`, and :ref:`cswpla` commands also + activate coordinate systems as they are defined. To set the active element coordinate system + attribute pointer, issue the :ref:`esys` command. + + The active coordinate system for files created via the :ref:`cdwrite` command is Cartesian ( + :ref:`csys`,0). + + This command is valid in any processor. + + :ref:`csys`,4 (or :ref:`csys`,WP) activates working plane tracking, which updates the coordinate + system to follow working plane changes. To deactivate working plane tracking, activate any other + coordinate system (for example, :ref:`csys`,0 or :ref:`csys`,11). + + :ref:`csys`,5 is a cylindrical coordinate system with global Cartesian Y as the axis of rotation. + The local x, y and z axes are radial, θ, and axial (respectively). The R-Theta plane is the + global X-Z plane, as it is for an axisymmetric model. Thus, at θ = 0.0, :ref:`csys`,5 has a + specific orientation: the local x is in the global +X direction, local y is in the global -Z + direction, and local z (the cylindrical axis) is in the global +Y direction. + + :ref:`csys`,6 is a cylindrical coordinate system with global Cartesian X as the axis of rotation. + The local x, y and z axes are axial, radial, and θ (respectively). The R-Theta plane is the + global Y-Z plane, as it is for an axisymmetric model. Thus, at θ = 0.0, :ref:`csys`,6 has a + specific orientation: the local x is in the global -Z direction, local y is in the global +Y + direction, and local z (the cylindrical axis) is in the global +X direction. + """ + command = f"CSYS,{kcn}" + return self.run(command, **kwargs) + + def local( + self, + kcn: str = "", + kcs: str = "", + xc: str = "", + yc: str = "", + zc: str = "", + thxy: str = "", + thyz: str = "", + thzx: str = "", + par1: str = "", + par2: str = "", + **kwargs, + ): + r"""Defines a local coordinate system by a location and orientation. + + Mechanical APDL Command: `LOCAL `_ + + Parameters + ---------- + kcn : str + Arbitrary reference number assigned to this coordinate system. Must be greater than 10. A + coordinate system previously defined with this number will be redefined. + + kcs : str + Coordinate system type: + + * ``0 or CART`` - Cartesian + + * ``1 or CYLIN`` - Cylindrical (circular or elliptical) + + * ``2 or SPHE`` - Spherical (or spheroidal) + + * ``3 or TORO`` - Toroidal + + xc : str + Location (in the global Cartesian coordinate system) of the origin of the new coordinate system. + + yc : str + Location (in the global Cartesian coordinate system) of the origin of the new coordinate system. + + zc : str + Location (in the global Cartesian coordinate system) of the origin of the new coordinate system. + + thxy : str + First rotation about local Z (positive X toward Y). + + thyz : str + Second rotation about local X (positive Y toward Z). + + thzx : str + Third rotation about local Y (positive Z toward X). + + par1 : str + Used for elliptical, spheroidal, or toroidal systems. If ``KCS`` = 1 or 2, ``PAR1`` is the ratio + of the ellipse Y-axis radius to X-axis radius (defaults to 1.0 (circle)). If ``KCS`` = 3, + ``PAR1`` is the major radius of the torus. + + par2 : str + Used for spheroidal systems. If ``KCS`` = 2, ``PAR2`` = ratio of ellipse Z-axis radius to X-axis + radius (defaults to 1.0 (circle)). + + Notes + ----- + + .. _LOCAL_notes: + + Defines a local coordinate system by origin location and orientation angles. The local coordinate + system is parallel to the global Cartesian system unless rotated. Rotation angles are in degrees and + redefine any previous rotation angles. See the :ref:`clocal`, :ref:`cs`, :ref:`cswpla`, and + :ref:`cskp` commands for alternate definitions. This local system becomes the active coordinate + system ( :ref:`csys` ). Local coordinate systems may be displayed with the :ref:`psymb` command. + + This command is valid in any processor. + """ + command = f"LOCAL,{kcn},{kcs},{xc},{yc},{zc},{thxy},{thyz},{thzx},{par1},{par2}" + return self.run(command, **kwargs) diff --git a/src/ansys/mapdl/core/_commands/database/picking.py b/src/ansys/mapdl/core/_commands/database/picking.py index 3055b203acf..3302d5790d9 100644 --- a/src/ansys/mapdl/core/_commands/database/picking.py +++ b/src/ansys/mapdl/core/_commands/database/picking.py @@ -20,147 +20,137 @@ # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE # SOFTWARE. -""" -These DATABASE commands are generated by the GUI when picking -operations are performed. They can also be used to add additional -parameters to a command. For example, more points to a spline than -would be normally supported. -""" - class Picking: - def fitem(self, nfield="", item="", itemy="", itemz="", **kwargs): - """Identifies items chosen by a picking operation (GUI). - APDL Command: FITEM + def fitem( + self, + nfield: str = "", + item: str = "", + itemy: str = "", + itemz: str = "", + **kwargs, + ): + r"""Identifies items chosen by a picking operation (GUI). + + Mechanical APDL Command: `FITEM `_ Parameters ---------- - nfield - Field number on the command which uses the picking data. (Count - the command name as a field, so that a 2 indicates the first - command argument, 3 the second command argument, etc.) The + nfield : str + Field number on the command which uses the picking data. (Count the command name as a field, so + that a 2 indicates the first command argument, 3 the second command argument, etc.) The corresponding field on the command will have a P51X label. - item - Entity number of the entity picked. Negative entity numbers are - used to indicate a range of entities. If the item picked is a - coordinate location, then this field represents the X-coordinate. - See also the FLST command. + item : str + Entity number of the entity picked. Negative entity numbers are used to indicate a range of + entities. If the item picked is a coordinate location, then this field represents the + X-coordinate. See also the :ref:`flst` command. + + itemy : str + Y and Z coordinates of a picked coordinate location. ``ITEM`` represents the X coordinate. See + also the :ref:`flst` command. - itemy, itemz - Y and Z coordinates of a picked coordinate location. ITEM - represents the X coordinate. See also the FLST command. + itemz : str + Y and Z coordinates of a picked coordinate location. ``ITEM`` represents the X coordinate. See + also the :ref:`flst` command. Notes ----- - This is a command generated by the GUI and will appear in the log file - (Jobname.LOG) if graphical picking is used. This command is not - intended to be typed in directly in an ANSYS session (although it can - be included in an input file for batch input or for use with the /INPUT + + .. _FITEM_notes: + + This is a command generated by the GUI and will appear in the log file ( :file:`Jobname.LOG` ) if + graphical picking is used. This command is not intended to be typed in directly in a session + (although it can be included in an input file for batch input or for use with the :ref:`input` command). - On the log file, a set of FITEM commands is preceded by one FLST - command which defines the picking specifications for that pick - operation. The data listed in the FITEM commands are used by the first - subsequent command containing a P51X label in one of its fields. + On the log file, a set of :ref:`fitem` commands is preceded by one :ref:`flst` command which defines + the picking specifications for that pick operation. The data listed in the :ref:`fitem` commands are + used by the first subsequent command containing a P51X label in one of its fields. - Caution:: : For a given entity type, a list containing an ITEM that is - larger than the maximum defined entity, could deplete the system memory - and produce unpredictable results. + .. warning:: + + For a given entity type, a list containing an ITEMthat is larger than the maximum defined + entity, could deplete the system memory and produce unpredictable results. This command is valid in any processor. """ - command = "FITEM,%s,%s,%s,%s" % ( - str(nfield), - str(item), - str(itemy), - str(itemz), - ) + command = f"FITEM,{nfield},{item},{itemy},{itemz}" return self.run(command, **kwargs) - def flst(self, nfield="", narg="", type_="", otype="", leng="", **kwargs): - """Specifies data required for a picking operation (GUI). + def flst( + self, + nfield: str = "", + narg: str = "", + type_: int | str = "", + otype: str = "", + leng: str = "", + **kwargs, + ): + r"""Specifies data required for a picking operation (GUI). - APDL Command: FLST + Mechanical APDL Command: `FLST `_ Parameters ---------- - nfield - Field number on the command which uses the picking data. (Count - the command name as a field, so that a 2 indicates the first - command argument, 3 for the second command argument, etc.) The + nfield : str + Field number on the command which uses the picking data. (Count the command name as a field, so + that a 2 indicates the first command argument, 3 for the second command argument, etc.) The corresponding field on the command will have a P51X label. - narg + narg : str Number of items in the picked list. - type\\_ + type_ : int or str Type of items picked: - 1 - Node numbers + * ``1`` - Node numbers - 2 - Element numbers + * ``2`` - Element numbers - 3 - Keypoint numbers + * ``3`` - Keypoint numbers - 4 - Line numbers + * ``4`` - Line numbers - 5 - Area numbers + * ``5`` - Area numbers - 6 - Volume numbers + * ``6`` - Volume numbers - 7 - Trace points + * ``7`` - Trace points - 8 - Coordinate locations (in Global Cartesian coordinates) + * ``8`` - Coordinate locations (in Global Cartesian coordinates) - 9 - Screen picks (in X, Y screen coordinates (-1 to 1)) + * ``9`` - Screen picks (in X, Y screen coordinates (-1 to 1)) - otype + otype : str Data order: - NOOR - Data is not ordered (default). + * ``NOOR`` - Data is not ordered (default). - ORDER - Data is in an ordered list (such as for the E,P51X and A,P51X commands, in - which the order of the data items is significant for the picking - operation). + * ``ORDER`` - Data is in an ordered list (such as for the :ref:`e`,P51X and :ref:`a`,P51X commands, + in which the order of the data items is significant for the picking operation). - leng - Length of number of items describing the list (should equal NARG if - Otype = NOOR; default). + leng : str + Length of number of items describing the list (should equal ``NARG`` if ``Otype`` = NOOR; + default). Notes ----- - Specifies data required for the FITEM command during a picking - operation. This is a command generated by the GUI and will appear in - the log file (Jobname.LOG) if graphical picking is used. This command - is not intended to be typed in directly in an ANSYS session (although - it can be included in an input file for batch input or for use with the - /INPUT command). - - On the log file, FLST will always be followed by one or more FITEM - commands which in turn are followed by the ANSYS command that contains - a P51X label in one of its fields. This set of commands should not be - edited. + + .. _FLST_notes: + + Specifies data required for the :ref:`fitem` command during a picking operation. This is a command + generated by the GUI and will appear in the log file ( :file:`Jobname.LOG` ) if graphical picking is + used. This command is not intended to be typed in directly in a session (although it can be included + in an input file for batch input or for use with :ref:`input` ). + + On the log file, :ref:`flst` is always followed by one or more :ref:`fitem` commands which, in turn, + are followed by the Mechanical APDL command containing a P51X label in one of its fields. Do not + edit this + set of commands. This command is valid in any processor. """ - command = "FLST,%s,%s,%s,%s,%s" % ( - str(nfield), - str(narg), - str(type_), - str(otype), - str(leng), - ) + command = f"FLST,{nfield},{narg},{type_},{otype},{leng}" return self.run(command, **kwargs) diff --git a/src/ansys/mapdl/core/_commands/database/selecting.py b/src/ansys/mapdl/core/_commands/database/selecting.py index 17f10b58370..89dc1de2d11 100644 --- a/src/ansys/mapdl/core/_commands/database/selecting.py +++ b/src/ansys/mapdl/core/_commands/database/selecting.py @@ -20,386 +20,454 @@ # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE # SOFTWARE. -"""These DATABASE commands are used to select subsets of database -entities for further operations. -""" - -from typing import Optional, Union - -from ansys.mapdl.core.mapdl_types import MapdlInt - class Selecting: - def allsel(self, labt="", entity="", **kwargs): - """Selects all entities with a single command. - APDL Command: ALLSEL + def allsel(self, labt: str = "", entity: str = "", **kwargs): + r"""Selects all entities with a single command. + + Mechanical APDL Command: `ALLSEL `_ Parameters ---------- - labt + labt : str Type of selection to be made: - ALL - Selects all items of the specified entity type and all - items of lower entity types (default). + * ``ALL`` - Selects all items of the specified entity type and all items of lower entity types + (default). - BELOW - Selects all items directly associated with and below - the selected items of the specified entity type. + * ``BELOW`` - Selects all items directly associated with and below the selected items of the + specified entity type. - entity + entity : str Entity type on which selection is based: - ALL - All entity types (default). + * ``ALL`` - All entity types (default). - VOLU - Volumes. + * ``VOLU`` - Volumes. - AREA - Areas. + * ``AREA`` - Areas. - LINE - Lines. + * ``LINE`` - Lines. - KP - Keypoints. + * ``KP`` - Keypoints. - ELEM - Elements. + * ``ELEM`` - Elements. - NODE - Nodes. + * ``NODE`` - Nodes. Notes ----- - ALLSEL is a convenience command that allows the user to select all - items of a specified entity type or to select items associated with the - selected items of a higher entity. - - An entity hierarchy is used to decide what entities will be available - in the selection process. This hierarchy from top to bottom is as - follows: volumes, areas, lines, keypoints, elements, and nodes. The - hierarchy may also be divided into two branches: the solid model and - the finite element model. The label ALL selects items based on one - branch only, while BELOW uses the entire entity hierarchy. For - example, ALLSEL,ALL,VOLU selects all volumes, areas, lines, and - keypoints in the data base. ALLSEL,BELOW,AREA selects all lines - belonging to the selected areas; all keypoints belonging to those - lines; all elements belonging to those areas, lines, and keypoints; and - all nodes belonging to those elements. - - The $ character should not be used after the ALLSEL command. - This command is valid in any processor. + .. _ALLSEL_notes: - Examples - -------- - >>> mapdl.allsel() - """ - command = "ALLSEL,%s,%s" % (str(labt), str(entity)) - return self.run(command, **kwargs) - - def asll(self, type_="", arkey="", **kwargs): - """Selects those areas containing the selected lines. - - APDL Command: ASLL - - Parameters - ---------- - type\\_ - Label identifying the type of area select: + :ref:`allsel` is a convenience command that allows the user to select all items of a specified + entity type or to select items associated with the selected items of a higher entity. - S - Select a new set (default). + An entity hierarchy is used to decide what entities will be available in the selection process. This + hierarchy from top to bottom is as follows: volumes, areas, lines, keypoints, elements, and nodes. + The hierarchy may also be divided into two branches: the solid model and the finite element model. + The label ALL selects items based on one branch only, while BELOW uses the entire entity hierarchy. + For example, :ref:`allsel`,ALL,VOLU selects all volumes, areas, lines, and keypoints in the data + base. :ref:`allsel`,BELOW,AREA selects all lines belonging to the selected areas; all keypoints + belonging to those lines; all elements belonging to those areas, lines, and keypoints; and all nodes + belonging to those elements. - R - Reselect a set from the current set. + The $ character should not be used after the :ref:`allsel` command. - A - Additionally select a set and extend the current set. - - U - Unselect a set from the current set. - - arkey - Specifies whether all contained area lines must be selected [LSEL]: - - 0 - Select area if any of its lines are in the selected line set. - - 1 - Select area only if all of its lines are in the selected line set. - - Notes - ----- This command is valid in any processor. """ - command = "ASLL,%s,%s" % (str(type_), str(arkey)) + command = f"ALLSEL,{labt},{entity}" return self.run(command, **kwargs) def asel( self, - type_="", - item="", - comp="", - vmin="", - vmax="", - vinc="", - kswp="", + type_: str = "", + item: str = "", + comp: str = "", + vmin: str = "", + vmax: str = "", + vinc: str = "", + kswp: int | str = "", **kwargs, ): - """Selects a subset of areas. + r"""Selects a subset of areas. - APDL Command: ASEL + Mechanical APDL Command: `ASEL `_ .. note:: - Starting with PyMAPDL v0.66.0, you can use "P" as a second - argument to select entities interactively. A window pops up - allowing you to select, unselect, add or reselect entities - depending on the first argument ``type_``. An array with - the ids of new selection is returned when the window is - closed. - You can switch between ``selecting`` and ``unselecting`` - pressing the keyboard key ``U``. + Starting with PyMAPDL v0.66.0, you can use "P" as a second argument to select + entities interactively. A window pops up allowing you to select, unselect, add or + reselect entities depending on the first argument ``type_``. An array with the ids of + new selection is returned when the window is closed. + + **Command default:** + + .. _ASEL_default: + + All areas are selected. Parameters ---------- - type\\_ + type_ : str Label identifying the type of select: - S - Select a new set (default) - - R - Reselect a set from the current set. + * ``S`` - Select a new set (default) - A - Additionally select a set and extend the current set. + * ``R`` - Reselect a set from the current set. - U - Unselect a set from the current set. + * ``A`` - Additionally select a set and extend the current set. - ALL - Restore the full set. + * ``U`` - Unselect a set from the current set. - NONE - Unselect the full set. + * ``ALL`` - Restore the full set. - INVE - Invert the current set (selected becomes unselected and vice versa). + * ``NONE`` - Unselect the full set. - STAT - Display the current select status. + * ``INVE`` - Invert the current set (selected becomes unselected and vice versa). + * ``STAT`` - Display the current select status. - The following fields are used only with Type = S, R, A, or U: + item : str + Label identifying data. Valid item labels are shown in :ref:`asel_tab_1`. Some items also + require a component label. If ``Item`` = PICK (or simply "P"), graphical picking is enabled and + all remaining command fields are ignored (valid only in the GUI). Defaults to AREA. - Item - Label identifying data. Valid item labels are shown in Table 105: - ASEL - Valid Item and Component Labels (p. 185). Some items also - require a component label. If Item = PICK (or simply "P"), graphical - picking is enabled and all remaining command fields are ignored - (valid only in the GUI). Defaults to AREA. + comp : str + Component of the item (if required). Valid component labels are shown in :ref:`asel_tab_1`. - Comp - Component of the item (if required). Valid component labels are - shown in Table 105: ASEL - Valid Item and Component Labels (p. 185). + vmin : str + Minimum value of item range. Ranges are area numbers, coordinate values, attribute numbers, + etc., as appropriate for the item. A component name (as specified on the :ref:`cm` command) may + also be substituted for ``VMIN`` ( ``VMAX`` and ``VINC`` are ignored). If ``Item`` = MAT, TYPE, + REAL, or ESYS and if ``VMIN`` is positive, the absolute value of ``Item`` is compared against + the range for selection; if ``VMIN`` is negative, the signed value of ``Item`` is compared. See + the :ref:`alist` command for a discussion of signed attributes. - VMIN - Minimum value of item range. Ranges are area numbers, coordinate - values, attribute numbers, etc., as appropriate for the item. A - component name (as specified on the CM (p. 338) command) may also be - substituted for VMIN (VMAX and VINC are ignored). If Item = MAT, - TYPE, REAL, or ESYS and if VMIN is positive, the absolute value of - Item is compared against the range for selection; if VMIN is - negative, the signed value of Item is compared. See the ALIST (p. - 106) command for a discussion of signed attributes. + vmax : str + Maximum value of item range. ``VMAX`` defaults to ``VMIN``. - VMAX - Maximum value of item range. VMAX defaults to VMIN. - - VINC + vinc : str Value increment within range. Used only with integer ranges (such as for area numbers). Defaults - to 1. VINC cannot be negative. + to 1. ``VINC`` cannot be negative. - KSWP + kswp : int or str Specifies whether only areas are to be selected: - - `kswp = 0` - Select areas only. - - `kswp = 1` - Select areas, as well as keypoints, lines, nodes, and elements associated with selected areas. - - Valid only with Type = S. + * ``0`` - Select areas only. + * ``1`` - Select areas, as well as keypoints, lines, nodes, and elements associated with selected + areas. Valid only with ``Type`` = S. Notes ----- - Selects a subset of areas. For example, to select those areas with area - numbers 1 through 7, use - >>> mapdl.asel('S','AREA', '', 1, 7) + .. warning:: - The selected subset is then used when the ALL label is entered - (or implied) on other commands, such as + This function contains specificities regarding the argument definitions. + Please refer to the `command documentation `_ + for further explanations. - >>> mapdl.alist('ALL') + .. _ASEL_notes: - Only data identified by area number are selected. Data - are flagged as selected and unselected; no data are actually deleted - from the database. + Selects a subset of areas. For example, to select those areas with area numbers 1 through 7, use + :ref:`asel`,S,AREA,,1,7. The selected subset is then used when the ALL label is entered (or + implied) on other commands, such as :ref:`alist`,ALL. Only data identified by area number are + selected. Data are flagged as selected and unselected; no data are actually deleted from the + database. - In a cyclic symmetry analysis, area hot spots can be modified. - Consequently, the result of an area selection may be different before - and after the CYCLIC command. + In a cyclic symmetry analysis, area hot spots can be modified. Consequently, the result of an area + selection may be different before and after the :ref:`cyclic` command. - If Item = ACCA, the command selects only those areas that were created - by concatenation. The KSWP field is processed, but the Comp, VMIN, - VMAX, and VINC fields are ignored. + If ``Item`` = ACCA, the command selects only those areas that were created by concatenation. The + ``KSWP`` field is processed, but the ``Comp``, ``VMIN``, ``VMAX``, and ``VINC`` fields are ignored. This command is valid in any processor. - For Selects based on non-integer numbers (coordinates, results, etc.), - items that are within the range VMIN-Toler and VMAX+Toler are selected. - The default tolerance Toler is based on the relative values of VMIN and - VMAX as follows: + For Selects based on non-integer numbers (coordinates, results, etc.), items that are within the + range VMIN- ``Toler`` and VMAX+ ``Toler`` are selected. The default tolerance ``Toler`` is based on + the relative values of VMIN and VMAX as follows: + + * If VMIN = VMAX, ``Toler`` = 0.005 x VMIN. + + * If VMIN = VMAX = 0.0, ``Toler`` = 1.0E-6. + + * If VMAX ≠ VMIN, ``Toler`` = 1.0E-8 x (VMAX-VMIN). + + Use the `SELTOL + `_ + :ref:`seltol` command to override this default and specify ``Toler`` explicitly. + + .. _asel_tab_1: + + ASEL - Valid Item and Component Labels + ************************************** + + .. flat-table:: Valid Item and Component Labels :ref:`asel`, ``Type Item,Comp,VMIN,VMAX,VINC,KSWP`` + :header-rows: 1 + + * - Item + - Comp + - Description + * - AREA + - + - Area number. + * - EXT + - + - Area numbers on exterior of selected volumes (ignore remaining fields). + * - LOC + - X, Y, Z + - X, Y, or Z center (picking "hot spot" location in the active coordinate system). + * - HPT + - + - Area number (selects only areas with associated hard points). + * - MAT + - + - Material number associated with the area. + * - TYPE + - + - Element type number associated with the area. + * - REAL + - + - Real constant set number associated with the area. + * - ESYS + - + - Element coordinate system associated with the area. + * - SECN + - + - Section number associated with the area. + * - ACCA + - + - Concatenated areas (selects only areas that were created by area concatenation ( :ref:`accat` )). + + """ + command = f"ASEL,{type_},{item},{comp},{vmin},{vmax},{vinc},{kswp}" + return self.run(command, **kwargs) + + def asll(self, type_: str = "", arkey: int | str = "", **kwargs): + r"""Selects those areas containing the selected lines. - If VMIN = VMAX, Toler = 0.005 x VMIN. + Mechanical APDL Command: `ASLL `_ - If VMIN = VMAX = 0.0, Toler = 1.0E-6. + Parameters + ---------- + type_ : str + Label identifying the type of area select: - If VMAX ≠ VMIN, Toler = 1.0E-8 x (VMAX-VMIN). + * ``S`` - Select a new set (default). - Use the SELTOL command to override this default and specify Toler - explicitly. + * ``R`` - Reselect a set from the current set. - Table: 127:: : ASEL - Valid Item and Component Labels + * ``A`` - Additionally select a set and extend the current set. - Examples - -------- - Select area(s) at location x == 0. Note that value of seltol is - used since ``vmin == vmax``. + * ``U`` - Unselect a set from the current set. + + arkey : int or str + Specifies whether all contained area lines must be selected ( :ref:`lsel` ): - >>> mapdl.asel('S', 'LOC', 'X', 0) + * ``0`` - Select area if any of its lines are in the selected line set. - Select areas between ``y == 2`` and ``y == 4`` + * ``1`` - Select area only if all of its lines are in the selected line set. - >>> mapdl.asel('S', 'LOC', 'Y', 2, 4) + Notes + ----- + .. _ASLL_notes: + + This command is valid in any processor. """ - command = f"ASEL,{type_},{item},{comp},{vmin},{vmax},{vinc},{kswp}" + command = f"ASLL,{type_},{arkey}" return self.run(command, **kwargs) - def aslv(self, type_="", **kwargs): - """Selects those areas contained in the selected volumes. + def aslv(self, type_: str = "", **kwargs): + r"""Selects those areas contained in the selected volumes. - APDL Command: ASLV + Mechanical APDL Command: `ASLV `_ Parameters ---------- - type\\_ + type_ : str Label identifying the type of area select: - S - Select a new set (default). + * ``S`` - Select a new set (default). - R - Reselect a set from the current set. + * ``R`` - Reselect a set from the current set. - A - Additionally select a set and extend the current set. + * ``A`` - Additionally select a set and extend the current set. - U - Unselect a set from the current set. + * ``U`` - Unselect a set from the current set. Notes ----- + + .. _ASLV_notes: + This command is valid in any processor. """ - return self.run(f"ASLV,{type_}", **kwargs) + command = f"ASLV,{type_}" + return self.run(command, **kwargs) def dofsel( self, - type_="", - dof1="", - dof2="", - dof3="", - dof4="", - dof5="", - dof6="", + type_: str = "", + dof1: str = "", + dof2: str = "", + dof3: str = "", + dof4: str = "", + dof5: str = "", + dof6: str = "", **kwargs, ): - """Selects a DOF label set for reference by other commands. + r"""Selects a DOF label set for reference by other commands. + + Mechanical APDL Command: `DOFSEL `_ + + **Command default:** - APDL Command: DOFSEL + .. _DOFSEL_default: + + Degree of freedom (and the corresponding force) labels are determined from the model. Parameters ---------- - type\\_ + type_ : str Label identifying the type of select: - S - Select a new set of labels. - - A - Add labels to the current set. - - U - Unselect (remove) labels from the current set. - - ALL - Restore the full set of labels. - - STAT - Display the current select status. - - dof1, dof2, dof3, . . . , dof6 - Used only with Type = S, A, or U. Valid structural labels: UX, - UY, or UZ (displacements); U (UX, UY, and UZ); ROTX, ROTY, or ROTZ - (rotations); ROT (ROTX, ROTY, and ROTZ); DISP (U and ROT); HDSP - (Hydrostatic pressure). Valid thermal labels: TEMP, TBOT, TE2, TE3, - . . ., TTOP (temperature). Valid acoustic labels: PRES - (pressure); UX, UY, or UZ (displacements for FSI coupled elements). - Valid electric labels: VOLT (voltage); EMF (electromotive force - drop); CURR (current). Valid magnetic labels: MAG (scalar - magnetic potential); AX, AY or AZ (vector magnetic potentials); A - (AX, AY and AZ); CURR (current). Valid structural force labels: - FX, FY, or FZ (forces); F (FX, FY, and FZ); MX, MY, or MZ - (moments); M (MX, MY, and MZ); FORC (F and M); DVOL (fluid mass - flow rate). Valid thermal force labels: HEAT, HBOT, HE2, HE3, . . - ., HTOP (heat flow). Valid fluid flow force labels: FLOW (fluid - flow). Valid electric force labels: AMPS (current flow); CHRG - (electric charge). Valid magnetic force labels: FLUX (scalar - magnetic flux); CSGX, CSGY, or CSGZ (magnetic current segments); - CSG (CSGX, CSGY, and CSGZ). Valid diffusion labels: CONC - (concentration); RATE (diffusion flow rate). + * ``S`` - Select a new set of labels. + + * ``A`` - Add labels to the current set. + + * ``U`` - Unselect (remove) labels from the current set. + + * ``ALL`` - Restore the full set of labels. + + * ``STAT`` - Display the current select status. + + dof1 : str + Used only with ``Type`` = S, A, or U. Valid lables are: + + * **Structural labels** : UX, UY, or UZ (displacements); U (UX, UY, and UZ) ; ROTX, ROTY, or ROTZ + (rotations); ROT (ROTX, ROTY, and ROTZ); DISP (U and ROT); HDSP (Hydrostatic pressure). + * **Thermal labels** : TEMP, TBOT, TE2, TE3,..., TTOP (temperature). + * **Acoustic labels** : PRES (pressure); UX, UY, or UZ (displacements for FSI coupled elements). + * **Electric labels** : VOLT (voltage); EMF (electromotive force drop); CURR (current). + * **Magnetic labels** : MAG (scalar magnetic potential); AZ (vector magnetic potential); A (AZ); + CURR (current). + * **Structural force labels** : FX, FY, or FZ (forces); F (FX, FY, and FZ); MX, MY, or MZ (moments); + M (MX, MY, and MZ); FORC (F and M); DVOL (fluid mass flow rate). + * **Thermal force labels** : HEAT, HBOT, HE2, HE3,..., HTOP (heat flow). + * **Fluid flow force label** : FLOW (fluid flow). + * **Electric force labels** : AMPS (current flow); CHRG (electric charge). + * **Magnetic force labels** : FLUX (scalar magnetic flux); CSGZ (magnetic current segment). + * **Diffusion labels** : CONC (concentration); RATE (diffusion flow rate). + + dof2 : str + Used only with ``Type`` = S, A, or U. Valid lables are: + + * **Structural labels** : UX, UY, or UZ (displacements); U (UX, UY, and UZ) ; ROTX, ROTY, or ROTZ + (rotations); ROT (ROTX, ROTY, and ROTZ); DISP (U and ROT); HDSP (Hydrostatic pressure). + * **Thermal labels** : TEMP, TBOT, TE2, TE3,..., TTOP (temperature). + * **Acoustic labels** : PRES (pressure); UX, UY, or UZ (displacements for FSI coupled elements). + * **Electric labels** : VOLT (voltage); EMF (electromotive force drop); CURR (current). + * **Magnetic labels** : MAG (scalar magnetic potential); AZ (vector magnetic potential); A (AZ); + CURR (current). + * **Structural force labels** : FX, FY, or FZ (forces); F (FX, FY, and FZ); MX, MY, or MZ (moments); + M (MX, MY, and MZ); FORC (F and M); DVOL (fluid mass flow rate). + * **Thermal force labels** : HEAT, HBOT, HE2, HE3,..., HTOP (heat flow). + * **Fluid flow force label** : FLOW (fluid flow). + * **Electric force labels** : AMPS (current flow); CHRG (electric charge). + * **Magnetic force labels** : FLUX (scalar magnetic flux); CSGZ (magnetic current segment). + * **Diffusion labels** : CONC (concentration); RATE (diffusion flow rate). + + dof3 : str + Used only with ``Type`` = S, A, or U. Valid lables are: + + * **Structural labels** : UX, UY, or UZ (displacements); U (UX, UY, and UZ) ; ROTX, ROTY, or ROTZ + (rotations); ROT (ROTX, ROTY, and ROTZ); DISP (U and ROT); HDSP (Hydrostatic pressure). + * **Thermal labels** : TEMP, TBOT, TE2, TE3,..., TTOP (temperature). + * **Acoustic labels** : PRES (pressure); UX, UY, or UZ (displacements for FSI coupled elements). + * **Electric labels** : VOLT (voltage); EMF (electromotive force drop); CURR (current). + * **Magnetic labels** : MAG (scalar magnetic potential); AZ (vector magnetic potential); A (AZ); + CURR (current). + * **Structural force labels** : FX, FY, or FZ (forces); F (FX, FY, and FZ); MX, MY, or MZ (moments); + M (MX, MY, and MZ); FORC (F and M); DVOL (fluid mass flow rate). + * **Thermal force labels** : HEAT, HBOT, HE2, HE3,..., HTOP (heat flow). + * **Fluid flow force label** : FLOW (fluid flow). + * **Electric force labels** : AMPS (current flow); CHRG (electric charge). + * **Magnetic force labels** : FLUX (scalar magnetic flux); CSGZ (magnetic current segment). + * **Diffusion labels** : CONC (concentration); RATE (diffusion flow rate). + + dof4 : str + Used only with ``Type`` = S, A, or U. Valid lables are: + + * **Structural labels** : UX, UY, or UZ (displacements); U (UX, UY, and UZ) ; ROTX, ROTY, or ROTZ + (rotations); ROT (ROTX, ROTY, and ROTZ); DISP (U and ROT); HDSP (Hydrostatic pressure). + * **Thermal labels** : TEMP, TBOT, TE2, TE3,..., TTOP (temperature). + * **Acoustic labels** : PRES (pressure); UX, UY, or UZ (displacements for FSI coupled elements). + * **Electric labels** : VOLT (voltage); EMF (electromotive force drop); CURR (current). + * **Magnetic labels** : MAG (scalar magnetic potential); AZ (vector magnetic potential); A (AZ); + CURR (current). + * **Structural force labels** : FX, FY, or FZ (forces); F (FX, FY, and FZ); MX, MY, or MZ (moments); + M (MX, MY, and MZ); FORC (F and M); DVOL (fluid mass flow rate). + * **Thermal force labels** : HEAT, HBOT, HE2, HE3,..., HTOP (heat flow). + * **Fluid flow force label** : FLOW (fluid flow). + * **Electric force labels** : AMPS (current flow); CHRG (electric charge). + * **Magnetic force labels** : FLUX (scalar magnetic flux); CSGZ (magnetic current segment). + * **Diffusion labels** : CONC (concentration); RATE (diffusion flow rate). + + dof5 : str + Used only with ``Type`` = S, A, or U. Valid lables are: + + * **Structural labels** : UX, UY, or UZ (displacements); U (UX, UY, and UZ) ; ROTX, ROTY, or ROTZ + (rotations); ROT (ROTX, ROTY, and ROTZ); DISP (U and ROT); HDSP (Hydrostatic pressure). + * **Thermal labels** : TEMP, TBOT, TE2, TE3,..., TTOP (temperature). + * **Acoustic labels** : PRES (pressure); UX, UY, or UZ (displacements for FSI coupled elements). + * **Electric labels** : VOLT (voltage); EMF (electromotive force drop); CURR (current). + * **Magnetic labels** : MAG (scalar magnetic potential); AZ (vector magnetic potential); A (AZ); + CURR (current). + * **Structural force labels** : FX, FY, or FZ (forces); F (FX, FY, and FZ); MX, MY, or MZ (moments); + M (MX, MY, and MZ); FORC (F and M); DVOL (fluid mass flow rate). + * **Thermal force labels** : HEAT, HBOT, HE2, HE3,..., HTOP (heat flow). + * **Fluid flow force label** : FLOW (fluid flow). + * **Electric force labels** : AMPS (current flow); CHRG (electric charge). + * **Magnetic force labels** : FLUX (scalar magnetic flux); CSGZ (magnetic current segment). + * **Diffusion labels** : CONC (concentration); RATE (diffusion flow rate). + + dof6 : str + Used only with ``Type`` = S, A, or U. Valid lables are: + + * **Structural labels** : UX, UY, or UZ (displacements); U (UX, UY, and UZ) ; ROTX, ROTY, or ROTZ + (rotations); ROT (ROTX, ROTY, and ROTZ); DISP (U and ROT); HDSP (Hydrostatic pressure). + * **Thermal labels** : TEMP, TBOT, TE2, TE3,..., TTOP (temperature). + * **Acoustic labels** : PRES (pressure); UX, UY, or UZ (displacements for FSI coupled elements). + * **Electric labels** : VOLT (voltage); EMF (electromotive force drop); CURR (current). + * **Magnetic labels** : MAG (scalar magnetic potential); AZ (vector magnetic potential); A (AZ); + CURR (current). + * **Structural force labels** : FX, FY, or FZ (forces); F (FX, FY, and FZ); MX, MY, or MZ (moments); + M (MX, MY, and MZ); FORC (F and M); DVOL (fluid mass flow rate). + * **Thermal force labels** : HEAT, HBOT, HE2, HE3,..., HTOP (heat flow). + * **Fluid flow force label** : FLOW (fluid flow). + * **Electric force labels** : AMPS (current flow); CHRG (electric charge). + * **Magnetic force labels** : FLUX (scalar magnetic flux); CSGZ (magnetic current segment). + * **Diffusion labels** : CONC (concentration); RATE (diffusion flow rate). Notes ----- - Selects a degree of freedom label set for reference by other commands. - The label set is used on certain commands where ALL is either input in - the degree of freedom label field or implied. The active label set has - no effect on the solution degrees of freedom. Specified labels which - are not active in the model (from the ET or DOF command) are ignored. - As a convenience, a set of force labels corresponding to the degree of - freedom labels is also selected. For example, selecting UX also causes - FX to be selected (and vice versa). The force label set is used on - certain commands where ALL is input in the force label field. + + .. _DOFSEL_notes: + + Selects a degree of freedom label set for reference by other commands. The label set is used on + certain commands where ALL is either input in the degree of freedom label field or implied. The + active label set has no effect on the solution degrees of freedom. Specified labels which are not + active in the model (from the :ref:`et` or :ref:`dof` command) are ignored. As a convenience, a set + of force labels corresponding to the degree of freedom labels is also selected. For example, + selecting UX also causes FX to be selected (and vice versa). The force label set is used on certain + commands where ALL is input in the force label field. This command is valid in any processor. """ - command = "DOFSEL,%s,%s,%s,%s,%s,%s,%s" % ( - str(type_), - str(dof1), - str(dof2), - str(dof3), - str(dof4), - str(dof5), - str(dof6), - ) + command = f"DOFSEL,{type_},{dof1},{dof2},{dof3},{dof4},{dof5},{dof6}" return self.run(command, **kwargs) def esel( @@ -407,330 +475,326 @@ def esel( type_: str = "", item: str = "", comp: str = "", - vmin: Union[str, int, float] = "", - vmax: Union[str, int, float] = "", - vinc: MapdlInt = "", - kabs: MapdlInt = "", + vmin: str = "", + vmax: str = "", + vinc: str = "", + kabs: int | str = "", **kwargs, - ) -> Optional[str]: - """Selects a subset of elements. + ): + r"""Selects a subset of elements. - APDL Command: ESEL + Mechanical APDL Command: `ESEL `_ - .. note:: - Starting with PyMAPDL v0.66.0, you can use "P" as a second - argument to select entities interactively. A window pops up - allowing you to select, unselect, add or reselect entities - depending on the first argument ``type_``. An array with - the ids of new selection is returned when the window is - closed. + **Command default:** - You can switch between ``selecting`` and ``unselecting`` - pressing the keyboard key ``U``. + .. _ESEL_default: + + All elements are selected. Parameters ---------- - type\\_ + type_ : str Label identifying the type of select: - S - Select a new set (default). - R - Reselect a set from the current set. - A - Additionally select a set and extend the current set. - U - Unselect a set from the current set. - ALL - Restore the full set. - NONE - Unselect the full set. - INVE - Invert the current set (selected becomes - unselected and vice versa). - STAT - Display the current select status. - - item - Label identifying data, see Table 110: ESEL - Valid Item - and Component Labels. Some items also require a - component label. Defaults to ELEM. If Item = STRA - (straightened), elements are selected whose midside nodes - do not conform to the curved line or non-flat area on - which they should lie. (Such elements are sometimes - formed during volume meshing (VMESH) in an attempt to - avoid excessive element distortion.) You should - graphically examine any such elements to evaluate their - possible effect on solution accuracy. - - comp - Component of the item (if required). Valid component - labels are shown in Table 110: ESEL - Valid Item and - Component Labels below. - - vmin - Minimum value of item range. Ranges are element numbers, - attribute numbers, load values, or result values - as appropriate for the item. A component name (as - specified via the CM command) can also be substituted for - VMIN (in which case VMAX and VINC are ignored). - - vmax - Maximum value of item range. VMAX defaults to VMIN for - input values. For result values, VMAX defaults to infinity if VMIN is - positive, or to zero if VMIN is negative. - - vinc - Value increment within range. Used only with integer - ranges (such as for element and attribute numbers). - Defaults to 1. VINC cannot be negative. - - kabs - Absolute value key: + * ``S`` - Select a new set (default). - `kabs = 0` - Check sign of value during selection. + * ``R`` - Reselect a set from the current set. - `kabs = 1` - Use absolute value during selection (sign - ignored). - - Notes - ----- - The fields `item`, `comp`, `vmin`, `vmax`, `vinc` and `kabs` are - used only with `type_` = `"S"`, `"R"`, `"A"`, or `"U"`. + * ``A`` - Additionally select a set and extend the current set. - Selects elements based on values of a labeled item and - component. For example, to select a new set of elements - based on element numbers 1 - through 7, use + * ``U`` - Unselect a set from the current set. - >>> mapdl.esel('S', 'ELEM', '', 1, 7) + * ``ALL`` - Restore the full set. - The subset is used when the ALL label is entered (or implied) - on other commands, such as + * ``NONE`` - Unselect the full set. - >>> mapdl.elist('ALL') + * ``INVE`` - Invert the current set (selected becomes unselected and vice versa). - Only data identified by element number are - selected. Selected data are internally flagged; no actual - removal of data from the database occurs. Different element - subsets cannot be used for different load steps [SOLVE] in a - /SOLU sequence. The subset used in the first load step - will be used for all subsequent load steps regardless of - subsequent ESEL specifications. + * ``STAT`` - Display the current select status. - This command is valid in any processor. + item : str + Label identifying data, see :ref:`ESEL_tab_1`. Some items also require a component label. If + ``Item`` = PICK (or simply "P"), graphical picking is enabled and all remaining command fields + are ignored (valid only in the GUI). Defaults to ELEM. If ``Item`` = STRA (straightened), + elements are selected whose midside nodes do not conform to the curved line or non-flat area on + which they should lie. (Such elements are sometimes formed during volume meshing ( :ref:`vmesh` + ) in an attempt to avoid excessive element distortion.) You should graphically examine any such + elements to evaluate their possible effect on solution accuracy. - Elements crossing the named path (see PATH command) will be - selected. This option is only available in PREP7 and POST1. - If no geometry data has been mapped to the path (i.e., - via PMAP and PDEF commands), the path will assume the default - mapping option (PMAP,UNIFORM) to map the geometry prior to - selecting the elements. If an invalid path name is - given, the ESEL command is ignored (status of selected - elements is unchanged). If there are no elements crossing the - path, the ESEL command will return zero elements selected. + comp : str + Component of the item (if required). Valid component labels are shown in :ref:`ESEL_tab_1` + below. - For selections based on non-integer numbers (coordinates, - results, etc.), items that are within the range VMIN -Toler - and VMAX + Toler are selected. The default tolerance Toler is - based on the relative values of VMIN and VMAX as follows: + vmin : str + Minimum value of item range. Ranges are element numbers, attribute numbers, load values, or + result values as appropriate for the item. A component name (as specified via the :ref:`cm` + command) can also be substituted for ``VMIN`` (in which case ``VMAX`` and ``VINC`` are ignored). - If VMIN = VMAX, Toler = 0.005 x VMIN. + vmax : str + Maximum value of item range. ``VMAX`` defaults to ``VMIN`` for input values. - If VMIN = VMAX = 0.0, Toler = 1.0E-6. + For result values, ``VMAX`` defaults to infinity if ``VMIN`` is positive, or to zero if ``VMIN`` + is negative. - If VMAX ≠ VMIN, Toler = 1.0E-8 x (VMAX - VMIN). + vinc : str + Value increment within range. Used only with integer ranges (such as for element and attribute + numbers). Defaults to 1. ``VINC`` cannot be negative. - Use the SELTOL command to override this default and specify - Toler explicitly. + kabs : int or str + Absolute value key: - Table: 133:: : ESEL - Valid Item and Component Labels + * ``0`` - Check sign of value during selection. - Examples - -------- - Select elements using material numbers 2, 4 and 6. + * ``1`` - Use absolute value during selection (sign ignored). - >>> mapdl.esel('S', 'MAT', '', 2, 6, 2) + Notes + ----- - Of these, reselect SOLID185 element types + .. warning:: - >>> mapdl.esel('R', 'ENAME', '', 185) + This function contains specificities regarding the argument definitions. + Please refer to the `command documentation `_ + for further explanations. - Select elements assigned to material property 2 + .. _ESEL_notes: - >>> mapdl.esel('S', 'MAT', '', 2) + Selects elements based on values of a labeled item and component. For example, to select a new set + of elements based on element numbers 1 through 7, use :ref:`esel`,S,ELEM,,1,7. The subset is used + when the ALL label is entered (or implied) on other commands, such as :ref:`elist`,ALL. Only data + identified by element number are selected. Selected data are internally flagged; no actual removal + of data from the database occurs. Different element subsets cannot be used for different load steps + ( :ref:`solve` ) in a :ref:`slashsolu` sequence. The subset used in the first load step is used for + all subsequent load steps regardless of subsequent :ref:`esel` specifications. - Note, this command is equivalent to: + This command is valid in any processor. - >>> mapdl.esel('S', 'MAT', vmin=2) + Elements crossing the named path ( :ref:`path` ) are selected. This option is available only in + PREP7 and POST1. If no geometry data has been mapped to the path (via :ref:`pmap` and :ref:`pdef`, + for example), the path assumes the default mapping option ( :ref:`pmap`,UNIFORM) to map the geometry + prior to selecting the elements. If an invalid path name is given, the :ref:`esel` command is + ignored (and the status of selected elements is unchanged). If no elements are crossing the path, + the :ref:`esel` command returns zero elements selected. + + For selections based on non-integer numbers (coordinates, results, etc.), items that are within the + range ``VMIN`` - ``Toler`` and ``VMAX`` + ``Toler`` are selected. The default tolerance ``Toler`` is + based on the relative values of ``VMIN`` and ``VMAX`` as follows: + + * If ``VMIN`` = ``VMAX``, ``Toler`` = 0.005 x ``VMIN``. + + * If ``VMIN`` = ``VMAX`` = 0.0, ``Toler`` = 1.0E-6. + + * If ``VMAX`` ≠ ``VMIN``, ``Toler`` = 1.0E-8 x ( ``VMAX`` - ``VMIN`` ). + + To override this default and specify ``Toler`` explicitly, issue the `SELTOL + `_ + :ref:`seltol` command. + + .. _ESEL_tab_1: + + ESEL - Valid Item and Component Labels + ************************************** + + .. flat-table:: Valid Item and Component Labels :ref:`esel`, ``Type, Item, Comp, VMIN, VMAX, VINC, KABS`` + :header-rows: 1 + + * - Item + - Comp + - Description + * - ELEM + - + - Element number. + * - ADJ + - + - Elements adjacent to element ``VMIN`` ( ``VMAX`` and ``VINC`` fields are ignored). Only elements (of the same dimensionality) adjacent to lateral faces are considered. Progression continues until edge of model or until more than two elements are adjacent at a face. + * - CENT + - X, Y, Z + - X, Y, or Z location in the active coordinate system. + * - TYPE + - + - Element type number. + * - ENAME + - + - Element name (or identifying number). + * - MAT + - + - Material ID number. + * - REAL + - (blank) + - Real constant number. + * - ESYS + - + - Element coordinate system number. + * - OVER + - + - Overlapping contact elements created during contact pair splitting ( :ref:`cncheck`,SPLIT/DMP) + * - LIVE + - + - Active elements ( :ref:`ealive` ). ``VMIN`` and ``VMAX`` fields are ignored. + * - LAYER + - + - Layer number (where only composite elements with a nonzero thickness for the requested layer number are included) ( :ref:`layer` ). + * - SEC + - (blank) + - Cross section ID number ( :ref:`secnum` ) + * - STRA + - + - Straightened. See the description of the ``Item`` argument above. + * - SFE + - PRES + - Element pressure. + * - BFE + - TEMP + - Element temperature. + * - PATH + - ``Lab`` + - Selects all elements being crossed by the path with name ``Lab`` ( :ref:`path` ). If ``Lab`` = ALL, all elements related to all defined paths are selected. + * - Valid item and component labels for element result values are: + * - ETAB + - ``Lab`` + - Any user-defined element table label ( :ref:`etable` ). """ command = f"ESEL,{type_},{item},{comp},{vmin},{vmax},{vinc},{kabs}" return self.run(command, **kwargs) - def esla(self, type_: str = "", **kwargs) -> Optional[str]: - """Selects those elements associated with the selected areas. + def esla(self, type_: str = "", **kwargs): + r"""Selects those elements associated with the selected areas. - APDL Command: ESLA + Mechanical APDL Command: `ESLA `_ Parameters ---------- - type_ + type_ : str Label identifying the type of element select: - S - Select a new set (default). + * ``S`` - Select a new set (default). - R - Reselect a set from the current set. + * ``R`` - Reselect a set from the current set. - A - Additionally select a set and extend the current set. + * ``A`` - Additionally select a set and extend the current set. - U - Unselect a set from the current set. + * ``U`` - Unselect a set from the current set. Notes ----- - Selects area elements belonging to meshed [AMESH], selected - [ASEL] areas. + + .. _ESLA_notes: + + Selects area elements belonging to meshed ( :ref:`amesh` ), selected ( :ref:`asel` ) areas. This command is valid in any processor. """ command = f"ESLA,{type_}" return self.run(command, **kwargs) - def esll(self, type_: str = "", **kwargs) -> Optional[str]: - """Selects those elements associated with the selected lines. + def esll(self, type_: str = "", **kwargs): + r"""Selects those elements associated with the selected lines. - APDL Command: ESLL + Mechanical APDL Command: `ESLL `_ Parameters ---------- - type_ + type_ : str Label identifying the type of element select: - S - Select a new set (default). + * ``S`` - Select a new set (default). - R - Reselect a set from the current set. + * ``R`` - Reselect a set from the current set. - A - Additionally select a set and extend the current set. + * ``A`` - Additionally select a set and extend the current set. - U - Unselect a set from the current set. + * ``U`` - Unselect a set from the current set. Notes ----- - Selects line elements belonging to meshed [LMESH], selected - [LSEL] lines. + + .. _ESLL_notes: + + Selects line elements belonging to meshed ( :ref:`lmesh` ), selected ( :ref:`lsel` ) lines. This command is valid in any processor. """ command = f"ESLL,{type_}" return self.run(command, **kwargs) - def esln( - self, type_: str = "", ekey: MapdlInt = "", nodetype: str = "", **kwargs - ) -> Optional[str]: - """Selects those elements attached to the selected nodes. + def esln(self, type_: str = "", ekey: int | str = "", nodetype: str = "", **kwargs): + r"""Selects those elements attached to the selected nodes. - APDL Command: ESLN + Mechanical APDL Command: `ESLN `_ Parameters ---------- - type_ + type_ : str Label identifying the type of element selected: - S - Select a new set (default). + * ``S`` - Select a new set (default). - R - Reselect a set from the current set. + * ``R`` - Reselect a set from the current set. - A - Additionally select a set and extend the current set. + * ``A`` - Additionally select a set and extend the current set. - U - Unselect a set from the current set. + * ``U`` - Unselect a set from the current set. - ekey + ekey : int or str Node set key: - 0 - Select element if any of its nodes are in the - selected nodal set (default). + * ``0`` - Select element if any of its nodes are in the selected nodal set (default). - 1 - Select element only if all of its nodes are in the - selected nodal set. + * ``1`` - Select element only if all of its nodes are in the selected nodal set. - nodetype + nodetype : str Label identifying type of nodes to consider when selecting: - ALL - Select elements considering all of their nodes ( - default). + * ``ALL`` - Select elements considering all of their nodes (default). - ACTIVE - Select elements considering only their active - nodes. An active node is a node - that contributes DOFs to the model. + * ``ACTIVE`` - Select elements considering only their active nodes. An active node is a node that + contributes DOFs to the model. - INACTIVE - Select elements considering only their - inactive nodes (such as orientation or - radiation nodes). + * ``INACTIVE`` - Select elements considering only their inactive nodes (such as orientation or + radiation nodes). - CORNER - Select elements considering only their corner - nodes. + * ``CORNER`` - Select elements considering only their corner nodes. - MID - Select elements considering only their midside nodes. + * ``MID`` - Select elements considering only their midside nodes. Notes ----- - ESLN selects elements which have any (or all EKEY) NodeType - nodes in the currently-selected set of nodes. Only elements - having nodes in the currently-selected set can be selected. + + .. _ESLN_notes: + + :ref:`esln` selects elements which have any (or all ``EKEY`` ) ``NodeType`` nodes in the + currently-selected set of nodes. Only elements having nodes in the currently-selected set can be + selected. This command is valid in any processor. """ command = f"ESLN,{type_},{ekey},{nodetype}" return self.run(command, **kwargs) - def eslv(self, type_: str = "", **kwargs) -> Optional[str]: - """Selects elements associated with the selected volumes. + def eslv(self, type_: str = "", **kwargs): + r"""Selects elements associated with the selected volumes. - APDL Command: ESLV + Mechanical APDL Command: `ESLV `_ Parameters ---------- - type_ + type_ : str Label identifying the type of element selected: - S - Select a new set (default). + * ``S`` - Select a new set (default). - R - Reselect a set from the current set. + * ``R`` - Reselect a set from the current set. - A - Additionally select a set and extend the current set. + * ``A`` - Additionally select a set and extend the current set. - U - Unselect a set from the current set. + * ``U`` - Unselect a set from the current set. Notes ----- - Selects volume elements belonging to meshed [VMESH], selected - [VSEL] - volumes. + + .. _ESLV_notes: + + Selects volume elements belonging to meshed ( :ref:`vmesh` ), selected ( :ref:`vsel` ) volumes. This command is valid in any processor. """ @@ -739,1134 +803,1295 @@ def eslv(self, type_: str = "", **kwargs) -> Optional[str]: def ksel( self, - type_="", - item="", - comp="", - vmin="", - vmax="", - vinc="", - kabs="", + type_: str = "", + item: str = "", + comp: str = "", + vmin: str = "", + vmax: str = "", + vinc: str = "", + kabs: int | str = "", **kwargs, ): - """Selects a subset of keypoints or hard points. - - APDL Command: KSEL - - .. note:: - Starting with PyMAPDL v0.66.0, you can use "P" as a second - argument to select entities interactively. A window pops up - allowing you to select, unselect, add or reselect entities - depending on the first argument ``type_``. An array with - the ids of new selection is returned when the window is - closed. + r"""Selects a subset of keypoints or hard points. - You can switch between ``selecting`` and ``unselecting`` - pressing the keyboard key ``U``. + Mechanical APDL Command: `KSEL `_ Parameters ---------- - type\\_ + type_ : str Label identifying the type of select: - S - Select a new set (default). + * ``S`` - Select a new set (default). - R - Reselect a set from the current set. + * ``R`` - Reselect a set from the current set. - A - Additionally select a set and extend the current set. + * ``A`` - Additionally select a set and extend the current set. - U - Unselect a set from the current set. + * ``U`` - Unselect a set from the current set. - ALL - Restore the full set. + * ``ALL`` - Restore the full set. - NONE - Unselect the full set. + * ``NONE`` - Unselect the full set. - INVE - Invert the current set (selected becomes unselected and vice versa). + * ``INVE`` - Invert the current set (selected becomes unselected and vice versa). - STAT - Display the current select status. + * ``STAT`` - Display the current select status. + item : str + Label identifying data. Valid item labels are shown in the table below. Some items also require + a component label. If ``Item`` = PICK (or simply "P"), graphical picking is enabled and all + remaining command fields are ignored (valid only in the GUI). Defaults to KP. - The following fields are used only with Type = S, R, A, or U: - - Item - Label identifying data. Valid item labels are shown in the table below. Some items also require a - component label. If Item = PICK (or simply "P"), graphical picking is enabled and all remaining - command fields are ignored (valid only in the GUI). Defaults to KP. - - Comp + comp : str Component of the item (if required). Valid component labels are shown in the table below. - VMIN + vmin : str Minimum value of item range. Ranges are keypoint numbers, coordinate values, attribute numbers, - etc., as appropriate for the item. A component name (as specified on the CM (p. 338) command) - may also be substituted for VMIN (VMAX and VINC are ignored). If Item = MAT, TYPE, REAL, or - ESYS and if VMIN is positive, the absolute value of Item is compared against the range for selection; - if VMIN is negative, the signed value of Item is compared. See the KLIST (p. 942) command for a - discussion of signed attributes. + etc., as appropriate for the item. A component name (as specified on the :ref:`cm` command) may + also be substituted for ``VMIN`` ( ``VMAX`` and ``VINC`` are ignored). If ``Item`` = MAT, TYPE, + REAL, or ESYS and if ``VMIN`` is positive, the absolute value of ``Item`` is compared against + the range for selection; if ``VMIN`` is negative, the signed value of ``Item`` is compared. See + the :ref:`klist` command for a discussion of signed attributes. - VMAX - Maximum value of item range. VMAX defaults to VMIN. + vmax : str + Maximum value of item range. ``VMAX`` defaults to ``VMIN``. - VINC - Value increment within range. Used only with integer ranges (such as for keypoint numbers). Defaults - to 1. VINC cannot be negative. + vinc : str + Value increment within range. Used only with integer ranges (such as for keypoint numbers). + Defaults to 1. ``VINC`` cannot be negative. - KABS + kabs : int or str Absolute value key: - `kabs = 0` - Check sign of value during selection. + * ``0`` - Check sign of value during selection. - `kabs = 1` - Use absolute value during selection (sign ignored). + * ``1`` - Use absolute value during selection (sign ignored). Notes ----- - Selects a subset of keypoints or hard points. For example, to select a - new set of keypoints based on keypoint numbers 1 through 7, use - - >>> mapdl.ksel('S', 'KP', '', 1, 7) - - The selected subset is used when the ALL label is - entered (or implied) on other commands, such as KLIST,ALL. Only data - identified by keypoint number are selected. Data are flagged as - selected and unselected; no data are actually deleted from the - database. - - This command is valid in any processor. - For selections based on non-integer numbers (coordinates, results, - etc.), items that are within the range VMIN -Toler and VMAX + Toler are - selected. The default tolerance Toler is based on the relative values - of VMIN and VMAX as follows: + .. warning:: - If VMIN = VMAX, Toler = 0.005 x VMIN. + This function contains specificities regarding the argument definitions. + Please refer to the `command documentation `_ + for further explanations. - If VMIN = VMAX = 0.0, Toler = 1.0E-6. + .. _KSEL_notes: - If VMAX ≠ VMIN, Toler = 1.0E-8 x (VMAX - VMIN). + Selects a subset of keypoints or hard points. For example, to select a new set of keypoints based on + keypoint numbers 1 through 7, use :ref:`ksel`,S,KP,,1,7. The selected subset is used when the ALL + label is entered (or implied) on other commands, such as :ref:`klist`,ALL. Only data identified by + keypoint number are selected. Data are flagged as selected and unselected; no data are actually + deleted from the database. - Use the SELTOL command to override this default and specify Toler - explicitly. - - Table: 203:: : KSEL - Valid Item and Component Labels + This command is valid in any processor. - Examples - -------- - To select a single keypoint (keypoint 1) + For selections based on non-integer numbers (coordinates, results, etc.), items that are within the + range ``VMIN`` - ``Toler`` and ``VMAX`` + ``Toler`` are selected. The default tolerance ``Toler`` is + based on the relative values of ``VMIN`` and ``VMAX`` as follows: + + * If ``VMIN`` = ``VMAX``, ``Toler`` = 0.005 x ``VMIN``. + + * If ``VMIN`` = ``VMAX`` = 0.0, ``Toler`` = 1.0E-6. + + * If ``VMAX`` ≠ ``VMIN``, ``Toler`` = 1.0E-8 x ( ``VMAX`` - ``VMIN`` ). + + Use the `SELTOL + `_ + :ref:`seltol` command to override this default and specify ``Toler`` explicitly. + + .. _KSEL_tab_1: + + KSEL - Valid Item and Component Labels + ************************************** + + .. flat-table:: Valid Item and Component Labels :ref:`ksel`, ``Type, Item, Comp, VMIN, VMAX, VINC,`` KABS + :header-rows: 1 + + * - Item + - Comp + - Description + * - KP + - + - Keypoint number. + * - EXT + - + - Keypoint numbers on exterior of selected lines (ignore remaining fields). + * - HPT + - + - Hard point number. + * - LOC + - X,Y,Z + - X, Y, or Z location in the active coordinate system. + * - MAT + - + - Material number associated with the keypoint. + * - TYPE + - + - Element type number associated with the keypoint. + * - REAL + - + - Real constant set number associated with the keypoint. + * - ESYS + - + - Element coordinate system associated with the keypoint. - >>> mapdl.ksel('S', 'KP', '', 1) """ - command = "KSEL,%s,%s,%s,%s,%s,%s,%s" % ( - str(type_), - str(item), - str(comp), - str(vmin), - str(vmax), - str(vinc), - str(kabs), - ) + command = f"KSEL,{type_},{item},{comp},{vmin},{vmax},{vinc},{kabs}" return self.run(command, **kwargs) - def ksll(self, type_="", **kwargs): - """Selects those keypoints contained in the selected lines. + def ksll(self, type_: str = "", **kwargs): + r"""Selects those keypoints contained in the selected lines. - APDL Command: KSLL + Mechanical APDL Command: `KSLL `_ Parameters ---------- - type\\_ + type_ : str Label identifying the type of keypoint select: - S - Select a new set (default). + * ``S`` - Select a new set (default). - R - Reselect a set from the current set. + * ``R`` - Reselect a set from the current set. - A - Additionally select a set and extend the current set. + * ``A`` - Additionally select a set and extend the current set. - U - Unselect a set from the current set. + * ``U`` - Unselect a set from the current set. Notes ----- + + .. _KSLL_notes: + This command is valid in any processor. """ - command = "KSLL,%s" % (str(type_)) + command = f"KSLL,{type_}" return self.run(command, **kwargs) - def ksln(self, type_="", **kwargs): - """Selects those keypoints associated with the selected nodes. + def ksln(self, type_: str = "", **kwargs): + r"""Selects those keypoints associated with the selected nodes. - APDL Command: KSLN + Mechanical APDL Command: `KSLN `_ Parameters ---------- - type\\_ + type_ : str Label identifying the type of keypoint select: - S - Select a new set (default). + * ``S`` - Select a new set (default). - R - Reselect a set from the current set. + * ``R`` - Reselect a set from the current set. - A - Additionally select a set and extend the current set. + * ``A`` - Additionally select a set and extend the current set. - U - Unselect a set from the current set. + * ``U`` - Unselect a set from the current set. Notes ----- - Valid only if the nodes were generated by a meshing operation [KMESH, - LMESH, AMESH, VMESH] on a solid model that contains the associated - keypoints. + + .. _KSLN_notes: + + Valid only if the nodes were generated by a meshing operation ( :ref:`kmesh`, :ref:`lmesh`, + :ref:`amesh`, :ref:`vmesh` ) on a solid model that contains the associated keypoints. This command is valid in any processor. """ - command = "KSLN,%s" % (str(type_)) + command = f"KSLN,{type_}" return self.run(command, **kwargs) def lsel( self, - type_="", - item="", - comp="", - vmin="", - vmax="", - vinc="", - kswp="", + type_: str = "", + item: str = "", + comp: str = "", + vmin: str = "", + vmax: str = "", + vinc: str = "", + kswp: int | str = "", **kwargs, ): - """Selects a subset of lines. - - APDL Command: LSEL - - .. note:: - Starting with PyMAPDL v0.66.0, you can use "P" as a second - argument to select entities interactively. A window pops up - allowing you to select, unselect, add or reselect entities - depending on the first argument ``type_``. An array with - the ids of new selection is returned when the window is - closed. + r"""Selects a subset of lines. - You can switch between ``selecting`` and ``unselecting`` - pressing the keyboard key ``U``. + Mechanical APDL Command: `LSEL `_ Parameters ---------- - type\\_ + type_ : str Label identifying the type of select: - S - Select a new set (default). + * ``S`` - Select a new set (default). - R - Reselect a set from the current set. + * ``R`` - Reselect a set from the current set. - A - Additionally select a set and extend the current set. + * ``A`` - Additionally select a set and extend the current set. - U - Unselect a set from the current set. + * ``U`` - Unselect a set from the current set. - ALL - Restore the full set. + * ``ALL`` - Restore the full set. - NONE - Unselect the full set. + * ``NONE`` - Unselect the full set. - INVE - Invert the current set (selected becomes unselected and vice versa). + * ``INVE`` - Invert the current set (selected becomes unselected and vice versa). - STAT - Display the current select status. + * ``STAT`` - Display the current select status. + item : str + Label identifying data. Valid item labels are shown in the table below. Some items also require + a component label. If ``Item`` = PICK (or simply "P"), graphical picking is enabled and all + remaining command fields are ignored (valid only in the GUI). Defaults to LINE. - The following fields are used only with Type = S, R, A, or U: - - Item - Label identifying data. Valid item labels are shown in the table - below. Some items also require a component label. If Item = PICK - (or simply "P"), graphical picking is enabled and all remaining - command fields are ignored (valid only in the GUI). Defaults to - LINE. - - Comp - Component of the item (if required). Valid component labels are - shown in the table below. + comp : str + Component of the item (if required). Valid component labels are shown in the table below. - VMIN - Minimum value of item range. Ranges are line numbers, coordinate - values, attribute numbers, etc., as appropriate for the item. If - VMIN = 0.0, a tolerance of ±1.0E-6 is used, or ±0.005 x VMIN if - VMIN = VMAX. A component name (as specified on the CM (p. 338) - command) may also be substituted for VMIN (VMAX and VINC are - ignored). If Item = MAT, TYPE, REAL, ESYS, or NDIV and if VMIN is - positive, the absolute value of Item is compared against the range - for selection; if VMIN is negative, the signed value of Item is - compared. See the LLIST (p. 1011) command for a discussion of - signed attributes. + vmin : str + Minimum value of item range. Ranges are line numbers, coordinate values, attribute numbers, + etc., as appropriate for the item. If ``VMIN`` = 0.0, a tolerance of ±1.0E-6 is used, or ±0.005 + x ``VMIN`` if ``VMIN`` = ``VMAX``. A component name (as specified on the :ref:`cm` command) may + also be substituted for ``VMIN`` ( ``VMAX`` and ``VINC`` are ignored). If ``Item`` = MAT, TYPE, + REAL, ESYS, or NDIV and if ``VMIN`` is positive, the absolute value of ``Item`` is compared + against the range for selection; if ``VMIN`` is negative, the signed value of ``Item`` is + compared. See the :ref:`llist` command for a discussion of signed attributes. - VMAX - Maximum value of item range. VMAX defaults to VMIN. + vmax : str + Maximum value of item range. ``VMAX`` defaults to ``VMIN``. - VINC - Value increment within range. Used only with integer ranges (such - as for line numbers). Defaults to 1. VINC cannot be negative. + vinc : str + Value increment within range. Used only with integer ranges (such as for line numbers). Defaults + to 1. ``VINC`` cannot be negative. - KSWP + kswp : int or str Specifies whether only lines are to be selected: - ``kswp=0`` - Select lines only. + * ``0`` - Select lines only. - ``kswp=1`` - Select lines, as well as keypoints, nodes, and elements associated with - selected lines. Valid only with ``type="s"``. + * ``1`` - Select lines, as well as keypoints, nodes, and elements associated with selected lines. + Valid only with ``Type`` = S. Notes ----- - Selects lines based on values of a labeled item and component. For - example, to select a new set of lines based on line numbers 1 through - 7, use LSEL,S,LINE,,1,7. The subset is used when the ALL label is - entered (or implied) on other commands, such as LLIST,ALL. Only data - identified by line number are selected. Data are flagged as selected - and unselected; no data are actually deleted from the database. - - If Item = LCCA, the command selects only those lines that were created - by concatenation. The KSWP field is processed, but the Comp, VMIN, - VMAX, and VINC fields are ignored. - - If Item = HPT, the command selects only those lines that contain hard - points. - - Item = RADIUS is only valid for lines that are circular arcs. - - LSEL is valid in any processor. - For selections based on non-integer numbers (coordinates, results, - etc.), items that are within the range VMIN -Toler and VMAX +Toler are - selected. The default tolerance Toler is based on the relative values - of VMIN and VMAX as follows: - - If VMIN = VMAX, Toler = 0.005 x VMIN. - - If VMIN = VMAX = 0.0, Toler = 1.0E-6. - - If VMAX ≠ VMIN, Toler = 1.0E-8 x (VMAX - VMIN). - - Use the SELTOL command to override this default and specify Toler - explicitly. + .. warning:: + + This function contains specificities regarding the argument definitions. + Please refer to the `command documentation `_ + for further explanations. + + .. _LSEL_notes: + + Selects lines based on values of a labeled item and component. For example, to select a new set of + lines based on line numbers 1 through 7, use :ref:`lsel`,S,LINE,,1,7. The subset is used when the + ALL label is entered (or implied) on other commands, such as :ref:`llist`,ALL. Only data identified + by line number are selected. Data are flagged as selected and unselected; no data are actually + deleted from the database. + + If ``Item`` = LCCA, the command selects only those lines that were created by concatenation. The + ``KSWP`` field is processed, but the ``Comp``, ``VMIN``, ``VMAX``, and ``VINC`` fields are ignored. + + If ``Item`` = HPT, the command selects only those lines that contain hard points. + + ``Item`` = RADIUS is only valid for lines that are circular arcs. + + :ref:`lsel` is valid in any processor. + + For selections based on non-integer numbers (coordinates, results, etc.), items that are + within the range ``VMIN`` - ``Toler`` and ``VMAX`` + ``Toler`` are selected. The default tolerance + ``Toler`` is based on the relative values of ``VMIN`` and ``VMAX`` as follows: + + * If ``VMIN`` = ``VMAX``, ``Toler`` = 0.005 x ``VMIN``. + + * If ``VMIN`` = ``VMAX`` = 0.0, ``Toler`` = 1.0E-6. + + * If ``VMAX`` ≠ ``VMIN``, ``Toler`` = 1.0E-8 x ( ``VMAX`` - ``VMIN`` ). + + Use the `SELTOL + `_ + :ref:`seltol` command to override this default and specify ``Toler`` explicitly. + + .. _lsel_tab_1: + + LSEL - Valid Item and Component Labels + ************************************** + + .. flat-table:: Valid Item and Component Labels :ref:`lsel`, ``Type, Item, Comp, VMIN, VMAX, VINC, KSWP`` + :header-rows: 1 + + * - Item + - Comp + - Description + * - LINE + - + - Line number. + * - EXT + - + - Line numbers on exterior of selected area (ignore remaining fields). + * - LOC + - X,Y,Z + - X, Y, or Z center location in the active coordinate system. + * - TAN1 + - X,Y,Z + - Unit vector component of outward tangent at beginning of line. + * - TAN2 + - X,Y,Z + - Unit vector component of outward tangent at end of line. + * - NDIV + - + - Number of divisions within the line. + * - SPACE + - + - Spacing ratio of line divisions. + * - MAT + - + - Material number associated with the line. + * - TYPE + - + - Element type number associated with the line. + * - REAL + - + - Real constant set number associated with the line. + * - ESYS + - + - Element coordinate system associated with the line. + * - SEC + - + - Cross section ID number. ( :ref:`secnum` ) + * - LENGTH + - + - Length of the line. + * - RADIUS + - + - Radius of the line. + * - HPT + - + - Line number (selects only lines with associated hard points). + * - LCCA + - + - Concatenated lines (selects only lines that were created by concatenation ( :ref:`lccat` )). """ - command = "LSEL,%s,%s,%s,%s,%s,%s,%s" % ( - str(type_), - str(item), - str(comp), - str(vmin), - str(vmax), - str(vinc), - str(kswp), - ) + command = f"LSEL,{type_},{item},{comp},{vmin},{vmax},{vinc},{kswp}" return self.run(command, **kwargs) - def lsla(self, type_="", **kwargs): - """Selects those lines contained in the selected areas. + def lsla(self, type_: str = "", **kwargs): + r"""Selects those lines contained in the selected areas. - APDL Command: LSLA + Mechanical APDL Command: `LSLA `_ Parameters ---------- - type\\_ + type_ : str Label identifying the type of line select: - S - Select a new set (default). + * ``S`` - Select a new set (default). - R - Reselect a set from the current set. + * ``R`` - Reselect a set from the current set. - A - Additionally select a set and extend the current set. + * ``A`` - Additionally select a set and extend the current set. - U - Unselect a set from the current set. + * ``U`` - Unselect a set from the current set. Notes ----- + + .. _LSLA_notes: + This command is valid in any processor. """ - command = "LSLA,%s" % (str(type_)) + command = f"LSLA,{type_}" return self.run(command, **kwargs) - def lslk(self, type_="", lskey="", **kwargs): - """Selects those lines containing the selected keypoints. + def lslk(self, type_: str = "", lskey: int | str = "", **kwargs): + r"""Selects those lines containing the selected keypoints. - APDL Command: LSLK + Mechanical APDL Command: `LSLK `_ Parameters ---------- - type\\_ + type_ : str Label identifying the type of line select: - S - Select a new set (default). + * ``S`` - Select a new set (default). - R - Reselect a set from the current set. + * ``R`` - Reselect a set from the current set. - A - Additionally select a set and extend the current set. + * ``A`` - Additionally select a set and extend the current set. - U - Unselect a set from the current set. + * ``U`` - Unselect a set from the current set. - lskey - Specifies whether all contained line keypoints must be selected - [KSEL]: + lskey : int or str + Specifies whether all contained line keypoints must be selected ( :ref:`ksel` ): - 0 - Select line if any of its keypoints are in the selected keypoint set. + * ``0`` - Select line if any of its keypoints are in the selected keypoint set. - 1 - Select line only if all of its keypoints are in the selected keypoint set. + * ``1`` - Select line only if all of its keypoints are in the selected keypoint set. Notes ----- + + .. _LSLK_notes: + This command is valid in any processor. """ - command = "LSLK,%s,%s" % (str(type_), str(lskey)) + command = f"LSLK,{type_},{lskey}" return self.run(command, **kwargs) def nsel( self, - type_="", - item="", - comp="", - vmin="", - vmax="", - vinc="", - kabs="", + type_: str = "", + item: str = "", + comp: str = "", + vmin: str = "", + vmax: str = "", + vinc: str = "", + kabs: int | str = "", **kwargs, ): - """Selects a subset of nodes. + r"""Selects a subset of nodes. - APDL Command: NSEL - - .. note:: - Starting with PyMAPDL v0.66.0, you can use "P" as a second - argument to select entities interactively. A window pops up - allowing you to select, unselect, add or reselect entities - depending on the first argument ``type_``. An array with - the ids of new selection is returned when the window is - closed. - - You can switch between ``selecting`` and ``unselecting`` - pressing the keyboard key ``U``. + Mechanical APDL Command: `NSEL `_ Parameters ---------- - type\\_ + type_ : str Label identifying the type of select: - S - Select a new set (default). - - R - Reselect a set from the current set. + * ``S`` - Select a new set (default). - A - Additionally select a set and extend the current set. + * ``R`` - Reselect a set from the current set. - U - Unselect a set from the current set. + * ``A`` - Additionally select a set and extend the current set. - ALL - Restore the full set. + * ``U`` - Unselect a set from the current set. - NONE - Unselect the full set. + * ``ALL`` - Restore the full set. - INVE - Invert the current set (selected becomes unselected and vice versa). + * ``NONE`` - Unselect the full set. - STAT - Display the current select status. + * ``INVE`` - Invert the current set (selected becomes unselected and vice versa). + * ``STAT`` - Display the current select status. - The following fields are used only with Type = S, R, A, or U: + item : str + Label identifying data. Valid item labels are shown in the table below. Some items also require + a component label. If ``Item`` = PICK (or simply "P"), graphical picking is enabled and all + remaining command fields are ignored (valid only in the GUI). Defaults to NODE. - Item - Label identifying data. Valid item labels are shown in the table below. Some items also require a - component label. If Item = PICK (or simply "P"), graphical picking is enabled and all remaining - command fields are ignored (valid only in the GUI). Defaults to NODE. - - Comp + comp : str Component of the item (if required). Valid component labels are shown in the table below. - VMIN + vmin : str Minimum value of item range. Ranges are node numbers, set numbers, coordinate values, load - values, or result values as appropriate for the item. A component name (as specified on the CM (p. 338) - command) may also be substituted for VMIN (VMAX and VINC are ignored). + values, or result values as appropriate for the item. A component name (as specified on the + :ref:`cm` command) may also be substituted for ``VMIN`` ( ``VMAX`` and ``VINC`` are ignored). - VMAX - Maximum value of item range. VMAX defaults to VMIN for input values. For result values, VMAX - defaults to infinity if VMIN is positive, or to zero if VMIN is negative. + vmax : str + Maximum value of item range. ``VMAX`` defaults to ``VMIN`` for input values. For result values, + ``VMAX`` defaults to infinity if ``VMIN`` is positive, or to zero if ``VMIN`` is negative. - VINC + vinc : str Value increment within range. Used only with integer ranges (such as for node and set numbers). - Defaults to 1. VINC cannot be negative. + Defaults to 1. ``VINC`` cannot be negative. - KABS + kabs : int or str Absolute value key: - - `kabs = 0` - Check sign of value during selection. - - `kabs = 1` - Use absolute value during selection (sign ignored) + * ``0`` - Check sign of value during selection. + + * ``1`` - Use absolute value during selection (sign ignored). Notes ----- - Selects a subset of nodes. For example, to select a new set of nodes - based on node numbers 1 through 7, do - >>> mapdl.nsel('S','NODE','',1,7) + .. warning:: - The subset is used when the `'ALL'` label is entered (or implied) - on other commands, such as + This function contains specificities regarding the argument definitions. + Please refer to the `command documentation `_ + for further explanations. - >>> mapdl.nlist('ALL') + .. _NSEL_notes: - Only data identified by node number are selected. Data - are flagged as selected and unselected; no data are actually deleted - from the database. + Selects a subset of nodes. For example, to select a new set of nodes based on node numbers 1 through + 7, use :ref:`nsel`,S,NODE,,1,7. The subset is used when the ALL label is entered (or implied) on + other commands, such as :ref:`nlist`,ALL. Only data identified by node number are selected. Data are + flagged as selected and unselected; no data are actually deleted from the database. - When selecting nodes by results, the full graphics value is used, - regardless of whether PowerGraphics is on. + When selecting nodes by results, the full graphics value is used, regardless of whether + PowerGraphics is on. - Solution result data consists of two types, 1) nodal degree of freedom - --results initially calculated at the nodes (such as displacement, - temperature, pressure, etc.), and 2) element--results initially - calculated elsewhere (such as at an element integration point or - thickness location) and then recalculated at the nodes (such as - stresses, strains, etc.). Various element results also depend upon the - recalculation method and the selected results location [AVPRIN, RSYS, - FORCE, LAYER and SHELL]. + Solution result data consists of two types, 1) nodal degree of freedom--results initially calculated + at the nodes (such as displacement, temperature, pressure, etc.), and 2) element--results initially + calculated elsewhere (such as at an element integration point or thickness location) and then + recalculated at the nodes (such as stresses, strains, etc.). Various element results also depend + upon the recalculation method and the selected results location ( :ref:`avprin`, :ref:`rsys`, + :ref:`force`, :ref:`layer` and :ref:`shell` ). - You must have all the nodes (corner and midside nodes) on the external - face of the element selected to use Item = EXT. + You must have all the nodes (corner and midside nodes) on the external face of the element selected + to use ``Item`` = EXT. This command is valid in any processor. - For Selects based on non-integer numbers (coordinates, results, etc.), - items that are within the range VMIN-Toler and VMAX+Toler are selected. - The default tolerance Toler is based on the relative values of VMIN and - VMAX as follows: - - If VMIN = VMAX, Toler = 0.005 x VMIN. - - If VMIN = VMAX = 0.0, Toler = 1.0E-6. - - If VMAX ≠ VMIN, Toler = 1.0E-8 x (VMAX-VMIN). - - Use the SELTOL command to override this default and specify Toler - explicitly. - - Table: 208:: : NSEL - Valid Item and Component Labels - - Table: 209:: : NSEL - Valid Item and Component Labels for Nodal DOF - Result Values - - Examples - -------- - Select nodes at `x == 0`, Of these, reselect nodes between ``1 < Y - < 10``, then finally unselect nodes between ``5 < Y < 6``. - - >>> mapdl.nsel('S', 'LOC', 'X', 0) - >>> mapdl.nsel('R', 'LOC', 'Y', 1, 10) - >>> mapdl.nsel('U', 'LOC', 'Y', 5, 6) - - For other coordinate systems activate the coord system first. - First, change to cylindrical coordinate system, select nodes at - ``radius == 5``. Reselect nodes from 0 to 90 degrees. - - >>> mapdl.csys(1) - >>> mapdl.nsel('S', 'LOC', 'X', 5) - >>> mapdl.nsel('R', 'LOC', 'Y', 0, 90) - - Note that the labels X, Y, and Z are always used, regardless of which - coordinate system is activated. They take on different meanings in - different systems Additionally, angles are always in degrees and - NOT radians. - - Select elements assigned to material property 2 - - >>> mapdl.esel('S', 'MAT', '', 2) - - Select the nodes these elements use - - >>> mapdl.nsle() - - Reselect nodes on the element external surfaces - - >>> mapdl.nsel('R', 'EXT') - - Change to cylindrical coordinates - - >>> mapdl.csys(1) - - Reselect nodes with radius=5 - - >>> mapdl.nsel('R', 'LOC', 'X', 5) + For Selects based on non-integer numbers (coordinates, results, etc.), items that are within the + range VMIN- ``Toler`` and VMAX+ ``Toler`` are selected. The default tolerance ``Toler`` is based on + the relative values of VMIN and VMAX as follows: + + * If VMIN = VMAX, ``Toler`` = 0.005 x VMIN. + + * If VMIN = VMAX = 0.0, ``Toler`` = 1.0E-6. + + * If VMAX ≠ VMIN, ``Toler`` = 1.0E-8 x (VMAX-VMIN). + + Use the `SELTOL + `_ + :ref:`seltol` command to override this default and specify ``Toler`` explicitly. + + .. _nsel_tab_1: + + NSEL - Valid Item and Component Labels + ************************************** + + .. flat-table:: Valid Item and Component Labels :ref:`nsel`, ``Type,Item,Comp,VMIN,VMAX,VINC,KABS`` + :header-rows: 2 + + * - Valid item and component labels for input values are: + * - Item + - Comp + - Description + * - NODE + - + - Node number. + * - EXT + - + - Nodes on exterior of selected elements (ignore remaining fields). + * - LOC + - X, Y, Z + - X, Y, or Z location in the active coordinate system. + * - ANG + - XY, YZ, ZX + - THXY, THYZ, or THZX rotation angle. + * - M + - + - Master node number. + * - CP + - + - Coupled set number. + * - CE + - + - Constraint equation set number. + * - D + - U + - Any of X, Y, or Z structural displacements. Amplitude only, if complex. + * - " + - UX, UY, UZ + - X, Y, or Z structural displacement. Amplitude only, if complex. + * - " + - ROT + - Any of X, Y, or Z structural rotations. Amplitude only, if complex. + * - " + - ROTX, ROTY, ROTZ + - X, Y, or Z structural rotation. Amplitude only, if complex. + * - " + - TEMP, TBOT, TE2, TE3,..., TTOP + - Temperature. + * - " + - PRES + - Pressure (for example, PRES degree of freedom for acoustic elements). + * - " + - VOLT + - Electric potential. + * - " + - MAG + - Magnetic scalar potential. + * - " + - V + - Any of X, Y, or Z fluid velocities. + * - " + - VX, VY, VZ + - X, Y, or Z fluid velocity. + * - " + - AZ + - 2D magnetic vector potential. Amplitude only, if complex. + * - " + - CURR + - Current. + * - " + - EMF + - Electromotive force drop. + * - F + - F + - Any of X, Y, or Z structural forces. Amplitude only, if complex. + * - " + - FX, FY, FZ + - X, Y, or Z structural force. Amplitude only, if complex. + * - " + - M + - Any of X, Y, or Z structural moments. Amplitude only, if complex + * - " + - MX, MY, MZ + - X, Y, or Z structural moment. Amplitude only, if complex. + * - " + - HEAT, HBOT, HE2, HE3,..., HTOP + - Heat flow. + * - " + - FLOW + - Fluid flow. + * - " + - AMPS + - Current flow. + * - " + - FLUX + - Magnetic flux. + * - " + - CSGZ + - Magnetic current segment component. Amplitude only, if complex. + * - " + - CHRG + - Electric charge. + * - " + - CHRGD + - Electric charge density. + * - BF + - TEMP + - Nodal temperature. + * - " + - FLUE + - Nodal fluence. + * - " + - HGEN + - Nodal heat generation rate. + * - " + - JS + - Any of X, Y, or Z current densities. Amplitude only, if complex. + * - " + - JSX, JSY, JSZ + - X, Y, or Z current density. Amplitude only, if complex. + * - " + - MVDI + - Magnetic virtual displacements flag. + * - " + - DGEN + - Nodal diffusing substance generation rate. + + + .. _nsel_tab_2: + + NSEL - Valid Item and Component Labels for Nodal DOF Result Values + ****************************************************************** + + .. flat-table:: + :header-rows: 1 + + * - Item + - Comp + - Description + * - U + - X, Y, Z, SUM + - X, Y, or Z structural displacement or vector sum. + * - ROT + - X, Y, Z, SUM + - X, Y, or Z structural rotation or vector sum. + * - TEMP + - + - Temperature. + * - PRES + - + - Pressure. + * - VOLT + - + - Electric potential. + * - MAG + - + - Magnetic scalar potential. + * - V + - X, Y, Z, SUM + - X, Y, or Z fluid velocity or vector sum. + * - A + - X, Y, Z, SUM + - X, Y, or Z magnetic vector potential or vector sum. + * - CONC + - + - Concentration. + * - CURR + - + - Current. + * - EMF + - + - Electromotive force drop. + + + .. _nsel_tab_3: + + NSEL - Valid Item and Component Labels for Element Result Values + **************************************************************** + + .. flat-table:: + :header-rows: 1 + + * - Item + - Comp + - Description + * - S + - X, Y, Z, XY, YZ, XZ + - Component stress. + * - " + - 1, 2, 3 + - Principal stress. + * - " + - INT, EQV + - Stress intensity or equivalent stress. + * - EPTO + - X, Y, Z, XY, YZ, XZ + - Component total strain (EPEL + EPPL + EPCR). + * - " + - 1,2,3 + - Principal total strain. + * - " + - INT, EQV + - Total strain intensity or total equivalent strain. + * - EPEL + - X, Y, Z, XY, YZ, XZ + - Component elastic strain. + * - " + - 1, 2, 3 + - Principal elastic strain. + * - " + - INT, EQV + - Elastic strain intensity or elastic equivalent strain. + * - EPPL + - X, Y, Z, XY, YZ, XZ + - Component plastic strain. + * - " + - 1,2,3 + - Principal plastic strain. + * - " + - INT, EQV + - Plastic strain intensity or plastic equivalent strain. + * - EPCR + - X, Y, Z, XY, YZ, XZ + - Component creep strain. + * - " + - 1,2,3 + - Principal creep strain. + * - " + - INT, EQV + - Creep strain intensity or creep equivalent strain. + * - EPTH + - X, Y, Z, XY, YZ, XZ + - Component thermal strain. + * - " + - 1, 2, 3 + - Principal thermal strain. + * - " + - INT, EQV + - Thermal strain intensity or thermal equivalent strain. + * - EPSW + - + - Swelling strain. + * - EPDI + - X, Y, Z, XY, YZ, XZ + - Component diffusion strain. + * - " + - 1, 2, 3 + - Principal diffusion strain. + * - " + - INT, EQV + - Diffusion strain intensity or diffusion equivalent strain. + * - NL + - SEPL + - Equivalent stress (from stress-strain curve). + * - " + - SRAT + - Stress state ratio. + * - " + - HPRES + - Hydrostatic pressure. + * - " + - EPEQ + - Accumulated equivalent plastic strain. + * - " + - PSV + - Plastic state variable. + * - " + - PLWK + - Plastic work/volume. + * - CONT + - STAT :ref:`NSELcontstat` + - Contact status. + * - " + - PENE + - Contact penetration. + * - " + - PRES + - Contact pressure. + * - " + - SFRIC + - Contact friction stress. + * - " + - STOT + - Contact total stress (pressure plus friction). + * - " + - SLIDE + - Contact sliding distance. + * - TG + - X, Y, Z, SUM + - Component thermal gradient or vector sum. + * - TF + - X, Y, Z, SUM + - Component thermal flux or vector sum. + * - PG + - X, Y, Z, SUM + - Component pressure gradient or vector sum. + * - EF + - X, Y, Z, SUM + - Component electric field or vector sum. + * - D + - X, Y, Z, SUM + - Component electric flux density or vector sum. + * - H + - X, Y, Z, SUM + - Component magnetic field intensity or vector sum. + * - B + - X, Y, Z, SUM + - Component magnetic flux density or vector sum. + * - CG + - X, Y, Z, SUM + - Component concentration gradient or vector sum + * - DF + - X, Y, Z, SUM + - Component diffusion flux density or vector sum + * - FMAG + - X, Y, Z, SUM + - Component electromagnetic forces or vector sum. + + .. _NSELcontstat: + + For more information on the meaning of contact status and its possible values, see `Reviewing + Results in POST1 + `_ """ - command = "NSEL,%s,%s,%s,%s,%s,%s,%s" % ( - str(type_), - str(item), - str(comp), - str(vmin), - str(vmax), - str(vinc), - str(kabs), - ) + command = f"NSEL,{type_},{item},{comp},{vmin},{vmax},{vinc},{kabs}" return self.run(command, **kwargs) - def nsla(self, type_="", nkey="", **kwargs): - """Selects those nodes associated with the selected areas. + def nsla(self, type_: str = "", nkey: int | str = "", **kwargs): + r"""Selects those nodes associated with the selected areas. - APDL Command: NSLA + Mechanical APDL Command: `NSLA `_ Parameters ---------- - type\\_ + type_ : str Label identifying the type of node select: - S - Select a new set (default). + * ``S`` - Select a new set (default). - R - Reselect a set from the current set. + * ``R`` - Reselect a set from the current set. - A - Additionally select a set and extend the current set. + * ``A`` - Additionally select a set and extend the current set. - U - Unselect a set from the current set. + * ``U`` - Unselect a set from the current set. - nkey + nkey : int or str Specifies whether only interior area nodes are to be selected: - 0 - Select only nodes interior to selected areas. + * ``0`` - Select only nodes interior to selected areas. - 1 - Select all nodes (interior to area, interior to lines, and at keypoints) - associated with the selected areas. + * ``1`` - Select all nodes (interior to area, interior to lines, and at keypoints) associated with + the selected areas. Notes ----- - Valid only if the nodes were generated by an area meshing operation - [AMESH, VMESH] on a solid model that contains the selected areas. - - This command is valid in any processor. - - Examples - -------- - Select area(s) at location x=0. Note that the selection tolerance - above and below 0 will depend on the value of ``mapdl.seltol`` - >>> mapdl.asel('S', 'LOC', 'X', 0) + .. _NSLA_notes: - Select nodes residing on those areas. + Valid only if the nodes were generated by an area meshing operation ( :ref:`amesh`, :ref:`vmesh` ) + on a solid model that contains the selected areas. - >>> mapdl.nsla('S', 1) + This command is valid in any processor. """ - command = "NSLA,%s,%s" % (str(type_), str(nkey)) + command = f"NSLA,{type_},{nkey}" return self.run(command, **kwargs) - def nsle(self, type_="", nodetype="", num="", **kwargs): - """Selects those nodes attached to the selected elements. + def nsle(self, type_: str = "", nodetype: str = "", num: str = "", **kwargs): + r"""Selects those nodes attached to the selected elements. - APDL Command: NSLE + Mechanical APDL Command: `NSLE `_ Parameters ---------- - type\\_ + type_ : str Label identifying the type of node select: - S - Select a new set (default). + * ``S`` - Select a new set (default). - R - Reselect a set from the current set. + * ``R`` - Reselect a set from the current set. - A - Additionally select a set and extend the current set. + * ``A`` - Additionally select a set and extend the current set. - U - Unselect a set from the current set. + * ``U`` - Unselect a set from the current set. - nodetype + nodetype : str Label identifying type of nodes to consider when selecting: - ALL - Select all nodes of the selected elements (default). + * ``ALL`` - Select all nodes of the selected elements (default). - ACTIVE - Select only the active nodes. An active node is a node that contributes DOFs to - the model. + * ``ACTIVE`` - Select only the active nodes. An active node is a node that contributes DOFs to the + model. - INACTIVE - Select only inactive nodes (such as orientation or radiation). + * ``INACTIVE`` - Select only inactive nodes (such as orientation or radiation). - CORNER - Select only corner nodes. + * ``CORNER`` - Select only corner nodes. - MID - Select only midside nodes. + * ``MID`` - Select only midside nodes. - POS - Select nodes in position Num. + * ``POS`` - Select nodes in position Num. - FACE - Select nodes on face Num. + * ``FACE`` - Select nodes on face Num. - num - Position or face number for NodeType = POS or FACE. + num : str + Position or face number for NodeType = POS or FACE. Notes ----- - NSLE selects NodeType nodes attached to the currently-selected set of - elements. Only nodes on elements in the currently-selected element set - can be selected. - .. note:: - When using degenerate hexahedral elements, NSLE, U,CORNER and - NSLE,S,MID will not select the same set of nodes because some - nodes appear as both corner and midside nodes. + .. _NSLE_notes: - This command is valid in any processor. + :ref:`nsle` selects ``NodeType`` nodes attached to the currently-selected set of elements. Only + nodes on elements in the currently-selected element set can be selected. - Examples - -------- - Select elements assigned to material property 2 and then select - the nodes these elements use. + When using degenerate hexahedral elements, :ref:`nsle`, ``U``, ``CORNER`` and :ref:`nsle`, ``S``, + ``MID`` will not select the same set of nodes because some nodes appear as both corner and midside + nodes. - >>> mapdl.esel('S', 'MAT', '', 2) - >>> mapdl.nsle() + This command is valid in any processor. """ - command = "NSLE,%s,%s,%s" % (str(type_), str(nodetype), str(num)) + command = f"NSLE,{type_},{nodetype},{num}" return self.run(command, **kwargs) - def nslk(self, type_="", **kwargs): - """Selects those nodes associated with the selected keypoints. + def nslk(self, type_: str = "", **kwargs): + r"""Selects those nodes associated with the selected keypoints. - APDL Command: NSLK + Mechanical APDL Command: `NSLK `_ Parameters ---------- - type\\_ + type_ : str Label identifying the type of node select: - S - Select a new set (default). + * ``S`` - Select a new set (default). - R - Reselect a set from the current set. + * ``R`` - Reselect a set from the current set. - A - Additionally select a set and extend the current set. + * ``A`` - Additionally select a set and extend the current set. - U - Unselect a set from the current set. + * ``U`` - Unselect a set from the current set. Notes ----- - Valid only if the nodes were generated by a keypoint meshing operation - [KMESH, LMESH, AMESH, VMESH] on a solid model that contains the - selected keypoints. + + .. _NSLK_notes: + + Valid only if the nodes were generated by a keypoint meshing operation ( :ref:`kmesh`, :ref:`lmesh`, + :ref:`amesh`, :ref:`vmesh` ) on a solid model that contains the selected keypoints. This command is valid in any processor. """ - command = "NSLK,%s" % (str(type_)) + command = f"NSLK,{type_}" return self.run(command, **kwargs) - def nsll(self, type_="", nkey="", **kwargs): - """Selects those nodes associated with the selected lines. + def nsll(self, type_: str = "", nkey: int | str = "", **kwargs): + r"""Selects those nodes associated with the selected lines. - APDL Command: NSLL + Mechanical APDL Command: `NSLL `_ Parameters ---------- - type\\_ + type_ : str Label identifying the type of node select: - S - Select a new set (default). + * ``S`` - Select a new set (default). - R - Reselect a set from the current set. + * ``R`` - Reselect a set from the current set. - A - Additionally select a set and extend the current set. + * ``A`` - Additionally select a set and extend the current set. - U - Unselect a set from the current set. + * ``U`` - Unselect a set from the current set. - nkey + nkey : int or str Specifies whether only interior line nodes are to be selected: - 0 - Select only nodes interior to selected lines. + * ``0`` - Select only nodes interior to selected lines. - 1 - Select all nodes (interior to line and at keypoints) - associated with the selected lines. + * ``1`` - Select all nodes (interior to line and at keypoints) associated with the selected lines. Notes ----- - Valid only if the nodes were generated by a line meshing - operation [LMESH, AMESH, VMESH] on a solid model that contains - the associated lines. + + .. _NSLL_notes: + + Valid only if the nodes were generated by a line meshing operation ( :ref:`lmesh`, :ref:`amesh`, + :ref:`vmesh` ) on a solid model that contains the associated lines. This command is valid in any processor. """ - command = "NSLL,%s,%s" % (str(type_), str(nkey)) + command = f"NSLL,{type_},{nkey}" return self.run(command, **kwargs) - def nslv(self, type_="", nkey="", **kwargs): - """Selects those nodes associated with the selected volumes. + def nslv(self, type_: str = "", nkey: int | str = "", **kwargs): + r"""Selects those nodes associated with the selected volumes. - APDL Command: NSLV + Mechanical APDL Command: `NSLV `_ Parameters ---------- - type\\_ + type_ : str Label identifying the type of node select: - S - Select a new set (default). + * ``S`` - Select a new set (default). - R - Reselect a set from the current set. + * ``R`` - Reselect a set from the current set. - A - Additionally select a set and extend the current set. + * ``A`` - Additionally select a set and extend the current set. - U - Unselect a set from the current set. + * ``U`` - Unselect a set from the current set. - nkey + nkey : int or str Specifies whether only interior volume nodes are to be selected: - 0 - Select only nodes interior to selected volumes. + * ``0`` - Select only nodes interior to selected volumes. - 1 - Select all nodes (interior to volume, interior to areas, interior to lines, and - at keypoints) associated with the selected volumes. + * ``1`` - Select all nodes (interior to volume, interior to areas, interior to lines, and at + keypoints) associated with the selected volumes. Notes ----- - Valid only if the nodes were generated by a volume meshing operation - [VMESH] on a solid model that contains the selected volumes. + + .. _NSLV_notes: + + Valid only if the nodes were generated by a volume meshing operation ( :ref:`vmesh` ) on a solid + model that contains the selected volumes. This command is valid in any processor. """ - command = "NSLV,%s,%s" % (str(type_), str(nkey)) + command = f"NSLV,{type_},{nkey}" return self.run(command, **kwargs) - def partsel(self, type_="", pmin="", pmax="", pinc="", **kwargs): - """Selects a subset of parts in an explicit dynamic analysis. + def seltol(self, toler: str = "", **kwargs): + r"""Sets the tolerance for subsequent select operations. - APDL Command: PARTSEL + Mechanical APDL Command: `SELTOL `_ Parameters ---------- - type\\_ - Label identifying type of select. Because PARTSEL is a command - macro, the label must be enclosed in single quotes. + toler : str + Tolerance value. If blank, restores the default tolerance logic. - 'S' - Select a new set (default). + Notes + ----- + For selects based on non-integer numbers (e.g. coordinates, results, etc.), items within the range + VMIN - ``Toler`` and VMAX + ``Toler`` are selected, where VMIN and VMAX are the range values input + on the xSEL commands ( `ASEL + `_ + :ref:`asel`, `ESEL + `_ + :ref:`esel`, `KSEL + `_ + :ref:`ksel`, `LSEL + `_ + :ref:`lsel`, `NSEL + `_ + :ref:`nsel`, and `VSEL + `_ + :ref:`vsel` ). - 'R' - Reselect a set from the current set. + The default tolerance logic is based on the relative values of VMIN and VMAX as follows: - 'A' - Additionally select a set and extend the current set. + * If VMIN = VMAX, ``Toler`` = 0.005 x VMIN. - 'U' - Unselect a set from the current set. + * If VMIN = VMAX = 0.0, ``Toler`` = 1.0E-6. - 'ALL' - Select all parts. + * If VMAX ≠ VMIN, ``Toler`` = 1.0E-8 x (VMAX-VMIN). - 'NONE' - Unselect all parts. + This command is typically used when VMAX-VMIN is very large so that the computed default tolerance + is therefore large and the xSEL commands selects more than what is desired. - 'INVE' - Invert the current selected set. + ``Toler`` remains active until respecified by a subsequent :ref:`seltol` command. A :ref:`seltol` < + blank > resets back to the default ``Toler`` logic. - Notes - ----- - PARTSEL invokes an ANSYS macro that selects parts in an explicit - dynamic analysis. When PARTSEL is executed, an element component is - automatically created for each existing part. For example, the elements - that make up PART 1 are grouped into the element component - _PART1. Each time the PARTSEL command is executed, components - for unselected parts will be unselected. To plot selected parts, - choose Utility Menu> Plot> Parts in the GUI or issue the - command PARTSEL,'PLOT'. - - After selecting parts, if you change the selected set of nodes or - elements and then plot parts, the nodes and elements associated with - the previously selected parts (from the last PARTSEL command) will - become the currently selected set. - - Note:: : A more efficient way to select and plot parts is to use the - ESEL (with ITEM = PART) and EPLOT commands. We recommend using ESEL - instead of PARTSEL since PARTSEL will be phased out in a future - release. Note that the menu path mentioned above for plotting parts - does not work with the ESEL command; use Utility Menu> Plot> Elements - instead. - - In an explicit dynamic small restart analysis (EDSTART,2), PARTSEL can - be used to unselect a part during the solution even if it is referenced - in some way (such as in a contact definition). (Note that ESEL cannot - be used for this purpose.) However, in a new analysis or a full restart - analysis (EDSTART,3), all parts that are used in some type of - definition must be selected at the time of solution. - - This command is valid in any processor. + Examples + -------- + Set selection tolarance to 1E-5 - Distributed ANSYS Restriction: This command is not supported in - Distributed ANSYS. + >>> seltol(1E-5) """ - command = "PARTSEL,%s,%s,%s,%s" % ( - str(type_), - str(pmin), - str(pmax), - str(pinc), - ) - return self.run(command, **kwargs) + if toler: + cmd = f"SELTOL,{toler}" + else: + cmd = "SELTOL" + return self.run(cmd, **kwargs) def vsel( self, - type_="", - item="", - comp="", - vmin="", - vmax="", - vinc="", - kswp="", + type_: str = "", + item: str = "", + comp: str = "", + vmin: str = "", + vmax: str = "", + vinc: str = "", + kswp: int | str = "", **kwargs, ): - """Selects a subset of volumes. - - APDL Command: VSEL - - .. note:: - Starting with PyMAPDL v0.66.0, you can use "P" as a second - argument to select entities interactively. A window pops up - allowing you to select, unselect, add or reselect entities - depending on the first argument ``type_``. An array with - the ids of new selection is returned when the window is - closed. + r"""Selects a subset of volumes. - You can switch between ``selecting`` and ``unselecting`` - pressing the keyboard key ``U``. + Mechanical APDL Command: `VSEL `_ Parameters ---------- - type\\_ + type_ : str Label identifying the type of volume select: - S - Select a new set (default). + * ``S`` - Select a new set (default). - R - Reselect a set from the current set. + * ``R`` - Reselect a set from the current set. - A - Additionally select a set and extend the current set. + * ``A`` - Additionally select a set and extend the current set. - U - Unselect a set from the current set. + * ``U`` - Unselect a set from the current set. - ALL - Restore the full set. + * ``ALL`` - Restore the full set. - NONE - Unselect the full set. + * ``NONE`` - Unselect the full set. - INVE - Invert the current set (selected becomes unselected and vice versa). + * ``INVE`` - Invert the current set (selected becomes unselected and vice versa). - STAT - Display the current select status. + * ``STAT`` - Display the current select status. - item : str, optional - Label identifying data. Valid item labels are shown in the table - below. Some items also require a component label. Defaults to - VOLU. + item : str + Label identifying data. Valid item labels are shown in the table below. Some items also require + a component label. If ``Item`` = PICK (or simply "P"), graphical picking is enabled and all + remaining command fields are ignored (valid only in the GUI). Defaults to VOLU. - comp : str, optional - Component of the item (if required). + comp : str + Component of the item (if required). Valid component labels are shown in the table below. - vmin : int, optional - Minimum value of item range. Ranges are volume numbers, coordinate - values, attribute numbers, etc., as appropriate for the item. A - component name (as specified on the CM (p. 338) command) may also - be substituted for VMIN (VMAX and VINC are ignored). If Item = MAT, - TYPE, REAL, or ESYS and if VMIN is positive, the absolute value of - Item is compared against the range for selection; if VMIN is - negative, the signed value of Item is compared. See the VLIST - (p. 2050) command for a discussion of signed attributes. + vmin : str + Minimum value of item range. Ranges are volume numbers, coordinate values, attribute numbers, + etc., as appropriate for the item. A component name (as specified on the :ref:`cm` command) may + also be substituted for ``VMIN`` ( ``VMAX`` and ``VINC`` are ignored). If ``Item`` = MAT, TYPE, + REAL, or ESYS and if ``VMIN`` is positive, the absolute value of ``Item`` is compared against + the range for selection; if ``VMIN`` is negative, the signed value of ``Item`` is compared. See + the :ref:`vlist` command for a discussion of signed attributes. - vmax : int, optional - Maximum value of item range. VMAX defaults to VMIN. + vmax : str + Maximum value of item range. ``VMAX`` defaults to ``VMIN``. - vinc : int, optional - Value increment within range. Used only with integer ranges (such - as for volume numbers). Defaults to 1. VINC cannot be negative. + vinc : str + Value increment within range. Used only with integer ranges (such as for volume numbers). + Defaults to 1. ``VINC`` cannot be negative. - kswp : int, optional + kswp : int or str Specifies whether only volumes are to be selected: - ``kswp=0`` - Select volumes only. - ``kswp=1`` - Select volumes, as well as keypoints, lines, areas, - nodes, and elements associated with selected volumes. Valid only - with Type = S. + * ``0`` - Select volumes only. + + * ``1`` - Select volumes, as well as keypoints, lines, areas, nodes, and elements associated with + selected volumes. Valid only with ``Type`` = S. Notes ----- - Selects volumes based on values of a labeled item and component. For - example, to select a new set of volumes based on volume numbers 1 - through 7, use VSEL,S,VOLU,,1,7. The subset is used when the ALL label - is entered (or implied) on other commands, such as VLIST,ALL. Only - data identified by volume number are selected. Data are flagged as - selected and unselected; no data are actually deleted from the - database. - This command is valid in any processor. + .. warning:: - For Selects based on non-integer numbers (coordinates, results, etc.), - items that are within the range VMIN-Toler and VMAX+Toler are selected. - The default tolerance Toler is based on the relative values of VMIN and - VMAX as follows: + This function contains specificities regarding the argument definitions. + Please refer to the `command documentation `_ + for further explanations. - If VMIN = VMAX, Toler = 0.005 x VMIN. + .. _VSEL_notes: - If VMIN = VMAX = 0.0, Toler = 1.0E-6. + Selects volumes based on values of a labeled item and component. For example, to select a new set of + volumes based on volume numbers 1 through 7, use :ref:`vsel`,S,VOLU,,1,7. The subset is used when + the ALL label is entered (or implied) on other commands, such as :ref:`vlist`,ALL. Only data + identified by volume number are selected. Data are flagged as selected and unselected; no data are + actually deleted from the database. - If VMAX ≠ VMIN, Toler = 1.0E-8 x (VMAX-VMIN). + This command is valid in any processor. - Use the SELTOL command to override this default and specify Toler - explicitly. + For Selects based on non-integer numbers (coordinates, results, etc.), items that are within the + range VMIN- ``Toler`` and VMAX+ ``Toler`` are selected. The default tolerance ``Toler`` is based on + the relative values of VMIN and VMAX as follows: + + * If VMIN = VMAX, ``Toler`` = 0.005 x VMIN. + + * If VMIN = VMAX = 0.0, ``Toler`` = 1.0E-6. + + * If VMAX ≠ VMIN, ``Toler`` = 1.0E-8 x (VMAX-VMIN). + + Use the `SELTOL + `_ + :ref:`seltol` command to override this default and specify ``Toler`` explicitly. + + .. _vsel_tab_1: + + VSEL - Valid Item and Component Labels + ************************************** + + .. flat-table:: :ref:`vsel` ``Type, Item, Comp, VMIN, VMAX, VINC, KABS`` + :header-rows: 1 + + * - Item + - Comp + - Description + * - VOLU + - + - Volume number. + * - LOC + - X, Y, Z + - X, Y, or Z center (picking "hot spot" location in the active coordinate system). + * - MAT + - + - Material number associated with the volume. + * - TYPE + - + - Element type number associated with the volume. + * - REAL + - + - Real constant set number associated with the volume. + * - ESYS + - + - Element coordinate system associated with the volume. """ - command = "VSEL,%s,%s,%s,%s,%s,%s,%s" % ( - str(type_), - str(item), - str(comp), - str(vmin), - str(vmax), - str(vinc), - str(kswp), - ) + command = f"VSEL,{type_},{item},{comp},{vmin},{vmax},{vinc},{kswp}" return self.run(command, **kwargs) - def vsla(self, type_="", vlkey="", **kwargs): - """Selects those volumes containing the selected areas. + def vsla(self, type_: str = "", vlkey: int | str = "", **kwargs): + r"""Selects those volumes containing the selected areas. - APDL Command: VSLA + Mechanical APDL Command: `VSLA `_ Parameters ---------- - type\\_ + type_ : str Label identifying the type of volume select: - S - Select a new set (default). - - R - Reselect a set from the current set. + * ``S`` - Select a new set (default). - A - Additionally select a set and extend the current set. + * ``R`` - Reselect a set from the current set. - U - Unselect a set from the current set. + * ``A`` - Additionally select a set and extend the current set. - vlkey - Specifies whether all contained volume areas must be selected - [ASEL]: + * ``U`` - Unselect a set from the current set. - 0 - Select volume if any of its areas are in the selected area set. + vlkey : int or str + Specifies whether all contained volume areas must be selected ( :ref:`asel` ): - 1 - Select volume only if all of its areas are in the selected area set. + * ``0`` - Select volume if any of its areas are in the selected area set. - Notes - ----- - This command is valid in any processor. - """ - command = "VSLA,%s,%s" % (str(type_), str(vlkey)) - return self.run(command, **kwargs) - - def seltol(self, toler="", **kwargs): - """Select those volumes containing the selected areas. - - APDL Command: SELTOL - - Parameters - ---------- - toler - Tolerance value. If blank or None, restores the default tolerance - logic. + * ``1`` - Select volume only if all of its areas are in the selected area set. Notes ----- - For selects based on non-integer numbers (e.g. coordinates, - results, etc.), items within the range VMIN - Toler and VMAX + - Toler are selected, where VMIN and VMAX are the range values input - on the xSEL commands (ASEL, ESEL, KSEL, LSEL, NSEL, and VSEL). - - The default tolerance logic is based on the relative values of - VMIN and VMAX as follows: - - If ``vmin == vmax``, ``toler = 0.005*vmin`` - - If ``vmin == vmax == 0.0``, ``toler = 1.0E-6``. - - If ``vmax != vmin``, ``toler = 1.0E-8 x (vmax - vmin)``. - This command is typically used when ``vmax - vmin`` is very large so - that the computed default tolerance is therefore large and the - xSEL commands selects more than what is desired. - - Toler remains active until respecified by a subsequent seltol - command. ``seltol()`` resets back to the default toler value. - - Examples - -------- - Set selection tolarance to 1E-5 - - >>> seltol(1E-5) + .. _VSLA_notes: + This command is valid in any processor. """ - if toler: - cmd = f"SELTOL,{toler}" - else: - cmd = "SELTOL" - return self.run(cmd, **kwargs) + command = f"VSLA,{type_},{vlkey}" + return self.run(command, **kwargs) diff --git a/src/ansys/mapdl/core/_commands/database/set_up.py b/src/ansys/mapdl/core/_commands/database/set_up.py new file mode 100644 index 00000000000..93039cc866e --- /dev/null +++ b/src/ansys/mapdl/core/_commands/database/set_up.py @@ -0,0 +1,434 @@ +# Copyright (C) 2016 - 2025 ANSYS, Inc. and/or its affiliates. +# SPDX-License-Identifier: MIT +# +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to deal +# in the Software without restriction, including without limitation the rights +# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +# copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in all +# copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +# SOFTWARE. + + +class SetUp: + + def resume( + self, + fname: str = "", + ext: str = "", + nopar: int | str = "", + knoplot: str = "", + **kwargs, + ): + r"""Resumes the database from the database file. + + Mechanical APDL Command: `RESUME `_ + + Parameters + ---------- + 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 :file:`Jobname`. + + ext : str + Filename extension (eight-character maximum). The extension defaults to DB if ``Fname`` is + blank. + + nopar : int or str + Parameter resume key: + + * ``0`` - All data in the database, including the scalar parameters, are replaced with the data + saved on :file:`Jobname.db` (default). + + * ``1`` - All data in the database, except the scalar parameters, are replaced with the data saved + on :file:`Jobnamedb`. + + knoplot : str + If equal to 1, will suppress automatic plot. Otherwise, if the GUI is on and this :ref:`resume` + command was not read from a file, the selected elements from ``Fname`` are plotted. (If there + are no selected elements, selected nodes are plotted. If no nodes, volumes; if no volumes, + areas; if no areas, lines; if no lines, keypoints. If there are no selected keypoints, the + screen is erased.) + + Notes + ----- + + .. _RESUME_notes: + + The :ref:`resume` command resumes a database file into Mechanical APDL. The command causes the + database + file ( :file:`Jobname.db` ) to be read, thereby resetting the database (including any geometry + settings) either a) as it was at the last :ref:`save` command, or b) as it was saved with the last + ``/EXIT`` command, whichever was last. + + For multiple load step analyses (because only the data for one load step at a time may reside in the + database), the load step data restored to the database will correspond to the load step data written + when the save occurred. + + If the database file was saved in another Ansys, Inc. product, it may contain element type + and :ref:`keyopt` specifications which are invalid in the resuming product. Immediately after the + database resume is completed, you should redefine these invalid element types and :ref:`keyopt` + settings to valid ones ( :ref:`et`, :ref:`keyopt` ). + + The ``NOPAR`` = 1 option should not be used if array parameters are defined, as existing array + parameters might be redefined with arbitrary values. For a more general method of preventing the + replacement of both scalar and array parameters, see :ref:`parsav` and :ref:`parres`.) + + If a radiosity mapping data file ( :file:`.rsm` file) was saved by the previous :ref:`save` command, + that mapping file must be present in the directory along with the database file in order for + radiosity surface elements ( ``SURF251``, ``SURF252`` ) to be correctly mapped onto the model when + :ref:`resume` is issued. + + This command is valid in any processor. If used in the solution processor, this command is valid + only within the first load step. + """ + command = f"RESUME,{fname},{ext},,{nopar},{knoplot}" + return self.run(command, **kwargs) + + def save(self, fname: str = "", ext: str = "", slab: str = "", **kwargs): + r"""Saves all current database information. + + Mechanical APDL Command: `SAVE `_ + + Parameters + ---------- + 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 :file:`Jobname`. + + ext : str + Filename extension (eight-character maximum). The extension defaults to DB if ``Fname`` is + blank. + + slab : str + Mode for saving the database: + + * ``ALL`` - Save the model data, solution data and post data (element tables, etc.). This value is + the default. + + * ``MODEL`` - Save the model data (solid model, finite element model, loadings, etc.) only. + + * ``SOLU`` - Save the model data and the solution data (nodal and element results). + + Notes + ----- + + .. _SAVE_notes: + + Saves all current database information to a file ( :file:`File.DB` ). In interactive mode, an + existing :file:`File.DB` is first written to a backup file ( :file:`File.DBB` ). In batch mode, an + existing :file:`File.DB` is replaced by the current database information with no backup. The command + should be issued periodically to ensure a current file backup in case of a system "crash" or a "line + drop." It may also be issued before a "doubtful" command so that if the result is not what was + intended the database may be easily restored to the previous state. A save may be time consuming for + large models. Repeated use of this command overwrites the previous data on the file (but a backup + file is first written during an interactive run). When issued from within POST1, the nodal boundary + conditions in the database (which were read from the results file) will overwrite the nodal boundary + conditions existing on the database file. + + Internal nodes may be created during solution (for example, via the mixed u-P formulation or + generalized plane strain option for `current-technology elements + `_, + the Lagrangian multiplier method for contact elements or the ``MPC184`` elements, or the quadratic + or cubic option of the ``BEAM188`` and ``PIPE288`` elements). It is sometimes necessary to save the + internal nodes in the database for later operations, such as cutting boundary interpolations ( + :ref:`cbdof` ) for `submodeling + `_. To do so, + issue the :ref:`save` command after the first :ref:`solve` command. + + In general, saving after solving is always a good practice. + + If radiosity surface elements ( ``SURF251`` or ``SURF252`` ) are present in the model, a radiosity + mapping data file, :file:`Fname.RSM,` is also saved when the :ref:`save` command is issued. For more + information, see `Advanced Radiosity Options + `_ + + This command is valid in any processor. + """ + command = f"SAVE,{fname},{ext},,{slab}" + return self.run(command, **kwargs) + + def smbc(self, mode: str = "", **kwargs): + r"""Controls the display of solid model boundary condition symbols and labels. + + Mechanical APDL Command: `/SMBC `_ + + Parameters + ---------- + mode : str + + * ``CENT`` - Solid model boundary condition symbols and labels appear at the centroid of the solid + model entity (default). + + * ``TESS`` - Solid model boundary condition symbols and labels appear inside each constituent + element of the tessellation. + + Notes + ----- + + .. _s-SMBC_notes: + + ``Mode`` = CENT is designed to reduce the clutter of boundary condition symbols in solid model + plots. For example, if you have assigned normal pressure loads to an area, you may choose to display + the pressures as arrows with the :ref:`psf` command using :ref:`psf`,PRES,NORM,2. When ``Mode`` = + CENT, the pressure arrow is displayed at the centroid of the area. When ``Mode`` = TESS, a pressure + arrow is displayed at the centroid of each polygon of the area's tessellation. + + This command is valid in any processor. + """ + command = f"/SMBC,{mode}" + return self.run(command, **kwargs) + + def stat(self, **kwargs): + r"""Displays the status of database settings. + + Mechanical APDL Command: `STAT `_ + + Notes + ----- + + .. _STAT_notes: + + :ref:`stat` is a command generated by the GUI and will appear in the log file ( :file:`Jobname.LOG` + ) if status is requested for some items under Utility Menu> List> Status. Generally, :ref:`stat` + will be preceded by one of the commands listed below, which specifies the particular topic that + status was requested for. + + If entered directly into the program, the :ref:`stat` command should be immediately preceded by the + desired topic command listed below. In processors other than those listed below (for example, + AUX12), no topic command should proceed :ref:`stat`. + + This command is valid in any processor. + + PREP7 topic commands (and their corresponding topics) are: + + This command contains some tables and extra information which can be inspected in the original + documentation pointed above. + + SOLUTION topic commands (and their corresponding topics) are: + + This command contains some tables and extra information which can be inspected in the original + documentation pointed above. + + POST1 topic commands (and their corresponding topics) are: + + This command contains some tables and extra information which can be inspected in the original + documentation pointed above. + + POST26 topic commands (and their corresponding topics) are: + + This command contains some tables and extra information which can be inspected in the original + documentation pointed above. + """ + command = "STAT" + return self.run(command, **kwargs) + + def stitle(self, nline: str = "", title: str = "", **kwargs): + r"""Defines subtitles. + + Mechanical APDL Command: `/STITLE `_ + + Parameters + ---------- + nline : str + Subtitle line number (1 to 4). Defaults to 1. + + title : str + Input up to 70 alphanumeric characters. Parameter substitution may be forced within the title by + enclosing the parameter name or parametric expression within percent (%) signs. If ``Title`` is + blank, this subtitle is deleted. + + Notes + ----- + + .. _s-STITLE_notes: + + Up to four subtitles are displayed in the output along with the main title ( :ref:`title` ). + + Subtitles do not appear in GUI windows or in plot displays. + + The first subtitle is also written to various Mechanical APDL files along with the main title. + + Previous subtitles can be overwritten or deleted. + + Issue :ref:`slashstatus` to display titles. + + This command is valid in any processor. + """ + command = f"/STITLE,{nline},{title}" + return self.run(command, **kwargs) + + def title(self, title: str = "", **kwargs): + r"""Defines a main title. + + Mechanical APDL Command: `/TITLE `_ + + Parameters + ---------- + title : str + Input up to 72 alphanumeric characters. Parameter substitution may be forced within the title by + enclosing the parameter name or parametric expression within percent (%) signs. + + Notes + ----- + + .. _s-TITLE_notes: + + The title is carried through the printout and written on various files. The title written to a file + is the title defined at that time. Special characters may be used within the title text. Subtitles + may also be defined ( :ref:`stitle` ). + + This command is valid in any processor. + """ + command = f"/TITLE,{title}" + return self.run(command, **kwargs) + + def units( + self, + label: str = "", + lenfact: str = "", + massfact: str = "", + timefact: str = "", + tempfact: str = "", + toffst: str = "", + chargefact: str = "", + forcefact: str = "", + heatfact: str = "", + **kwargs, + ): + r"""Annotates the database with the system of units used. + + Mechanical APDL Command: `/UNITS `_ + + Parameters + ---------- + label : str + Label to denote the system of units used in this job: + + * ``USER`` - User-defined system (default). + + * ``SI`` - International system (m, kg, s, K). + + * ``MKS`` - MKS system (m, kg, s, °C). + + * ``uMKS`` - μMKS system (μm, kg, s, °C). + + * ``CGS`` - CGS system (cm, g, s, °C). + + * ``MPA`` - MPA system (mm, Mg, s, °C). + + * ``BFT`` - U. S. Customary system using feet (ft, slug, s, °F). + + * ``BIN`` - U. S. Customary system using inches (in, lbf\2s :sup:`2` /in, s, °F). + + lenfact : str + The description of the argument is missing in the Python function. Please, refer to the `command + documentation + `_ for further + information. + + massfact : str + The description of the argument is missing in the Python function. Please, refer to the `command + documentation + `_ for further + information. + + timefact : str + The description of the argument is missing in the Python function. Please, refer to the `command + documentation + `_ for further + information. + + tempfact : str + The description of the argument is missing in the Python function. Please, refer to the `command + documentation + `_ for further + information. + + toffst : str + The description of the argument is missing in the Python function. Please, refer to the `command + documentation + `_ for further + information. + + chargefact : str + The description of the argument is missing in the Python function. Please, refer to the `command + documentation + `_ for further + information. + + forcefact : str + The description of the argument is missing in the Python function. Please, refer to the `command + documentation + `_ for further + information. + + heatfact : str + The description of the argument is missing in the Python function. Please, refer to the `command + documentation + `_ for further + information. + + Notes + ----- + + .. warning:: + + This function contains specificities regarding the argument definitions. + Please refer to the `command documentation `_ + for further explanations. + + .. _s-UNITS_notes: + + Allows the user to set a marker in the database indicating the system of units used. The setting may + be reviewed with the :ref:`slashstatus` command at the Begin level. The units label and conversion + factors on this command are for user convenience only and have no effect on the analysis or data. + That is, :ref:`units` will not convert database items from one system to another (for example, from + U. S. Customary to SI, etc.). The units setting will be written to the file of IGES data [ + :ref:`igesout` or :ref:`cdwrite` ], which can then be read by many programs that read IGES files. + The user must still use consistent units for the results to be valid. + + If you choose the MKS system of units, the EPZRO option for the :ref:`emunit` command is set to 8.85 + e-12 F/m. (EPZRO specifies alternate free-space permittivity.) + + For micro-electromechanical systems (MEMS), where dimensions are on the order of microns, see the + conversion factors in `System of Units + `_ + in the `Coupled-Field Analysis Guide + `_. + + If you use the Mechanical APDL ADAMS Interface to export model information to the ADAMS program, the + :ref:`units` command is required to ensure the correct transfer of data between Mechanical APDL and + ADAMS. + You can choose a predefined unit system label ( ``Label`` = SI, CGS, etc.) or you can select the + user-defined system option ( ``Label`` = USER) and input the appropriate conversion factors ( + ``LENFACT``, ``MASSFACT``, ``TIMEFACT``, and ``FORCEFACT`` ). The conversion factors are written to + the ADAMS input file :file:`Jobname.MNF` to correctly generate the load. For more information, see + `Export to ADAMS + `_. + + + All differences between the base solution units used by the Mechanical APDL and CFX solvers are + noted in + the Mechanical APDL output file. Unit conversions are applied automatically to all loads transferred + unless + ``Label`` = USER. Unit conversions are not applied to any of the loads transferred between the + Mechanical APDL and CFX solvers if they use a user-defined unit system. + + This command is valid in any processor. + """ + command = f"/UNITS,{label},{lenfact},{massfact},{timefact},{tempfact},{toffst},{chargefact},{forcefact},{heatfact}" + return self.run(command, **kwargs) diff --git a/src/ansys/mapdl/core/_commands/database/setup.py b/src/ansys/mapdl/core/_commands/database/setup.py deleted file mode 100644 index 9294c809d2e..00000000000 --- a/src/ansys/mapdl/core/_commands/database/setup.py +++ /dev/null @@ -1,378 +0,0 @@ -# Copyright (C) 2016 - 2025 ANSYS, Inc. and/or its affiliates. -# SPDX-License-Identifier: MIT -# -# -# Permission is hereby granted, free of charge, to any person obtaining a copy -# of this software and associated documentation files (the "Software"), to deal -# in the Software without restriction, including without limitation the rights -# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -# copies of the Software, and to permit persons to whom the Software is -# furnished to do so, subject to the following conditions: -# -# The above copyright notice and this permission notice shall be included in all -# copies or substantial portions of the Software. -# -# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -# SOFTWARE. - -""" -These DATABASE commands can be used to initialize the database, save -it to a file, or annotate it with titles and systems of units. -""" - - -class Setup: - def resume(self, fname="", ext="", nopar="", knoplot="", **kwargs): - """Resumes the database from the database file. - - APDL Command: RESUME - - 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. - - ext - Filename extension (eight-character maximum). - - nopar - Parameter resume key: - - 0 - All data in the database, including the scalar - parameters, are replaced with the data saved on - File.DB (default). - - 1 - All data in the database, except the scalar - parameters, are replaced with the data saved on - File.DB. - - knoplot - If equal to 1, will suppress automatic plot. Otherwise, if - the GUI is on and this RESUME command was not read from a - file, the selected elements from Fname are plotted. (If - there are no selected elements, selected nodes are - plotted. If no nodes, volumes; if no volumes, areas; if no - areas, lines; if no lines, keypoints. If there are no - selected keypoints, the screen is erased.) - - Notes - ----- - The RESUME command resumes a database file into the ANSYS program. The - command causes the database file (File.DB) to be read, thereby - resetting the database (including any geometry settings) either a) as - it was at the last SAVE command, or b) as it was saved with the last - /EXIT command, whichever was last. - - For multiple load step analyses (because only the data for one load - step at a time may reside in the database), the load step data restored - to the database will correspond to the load step data written when the - save occurred. - - If the database file was saved in another ANSYS, Inc. product, it may - contain element type and KEYOPT specifications which are invalid in the - resuming product. Immediately after the database resume is completed, - you should redefine these invalid element types and KEYOPT settings to - valid ones (ET, KEYOPT). - - The NOPAR = 1 option should not be used if array parameters are - defined, as existing array parameters might be redefined with arbitrary - values. For a more general method of preventing the replacement of both - scalar and array parameters, see PARSAV and PARRES.) - - This command is valid in any processor. If used in the solution - processor, this command is valid only within the first load step. - """ - return self.run(f"RESUME,{fname},{ext},,{nopar},{knoplot}", **kwargs) - - def save(self, fname="", ext="", slab="", **kwargs): - """Saves all current database information. - - APDL Command: SAVE - - 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. - - ext - Filename extension (eight-character maximum). - - slab - Mode for saving the database: - - ALL - Save the model data, solution data and post data - (element tables, etc.). This value is the default. - - MODEL - Save the model data (solid model, finite element - model, loadings, etc.) only. - - SOLU - Save the model data and the solution data (nodal - and element results). - - Notes - ----- - Saves all current database information to a file (File.DB). - In interactive mode, an existing File.DB is first written to a - backup file (File.DBB). In batch mode, an existing File.DB is - replaced by the current database information with no backup. - The command should be issued periodically to ensure a current - file backup in case of a system "crash" or a "line drop." It - may also be issued before a "doubtful" command so that if the - result is not what was intended the database may be easily - restored to the previous state. A save may be time consuming - for large models. Repeated use of this command overwrites the - previous data on the file (but a backup file is first written - during an interactive run). When issued from within POST1, - the nodal boundary conditions in the database (which were read - from the results file) will overwrite the nodal boundary - conditions existing on the database file. - - Internal nodes may be created during solution (for example, - via the mixed u-P formulation or generalized plane strain - option for current- technology elements, the Lagrangian - multiplier method for contact elements or the MPC184 elements, - or the quadratic or cubic option of the BEAM188 and PIPE288 - elements). It is sometimes necessary to save the internal - nodes in the database for later operations, such as cutting - boundary interpolations (CBDOF) for submodeling. To do so, - issue the SAVE command after the first SOLVE command. - - In general, saving after solving is always a good practice. - - This command is valid in any processor. - """ - return self.run(f"SAVE,{fname},{ext},,{slab}", **kwargs) - - def smbc(self, mode="", **kwargs): - """Controls the display of solid model boundary condition symbols and - - APDL Command: /SMBC - labels. - - Parameters - ---------- - mode - CENT - Solid model boundary condition symbols and labels appear at the centroid of the - solid model entity (default). - - TESS - Solid model boundary condition symbols and labels appear inside each - constituent element of the tessellation. - - Notes - ----- - Mode = CENT is designed to reduce the clutter of boundary condition - symbols in solid model plots. For example, if you have assigned normal - pressure loads to an area, you may choose to display the pressures as - arrows with the /PSF command using /PSF,PRES,NORM,2. When Mode = CENT, - the pressure arrow is displayed at the centroid of the area. When Mode - = TESS, a pressure arrow is displayed at the centroid of each polygon - of the area's tessellation. - - This command is valid in any processor. - """ - command = "/SMBC,%s" % (str(mode)) - return self.run(command, **kwargs) - - def stat(self, **kwargs): - """Displays the status of database settings. - - APDL Command: STAT - - Notes - ----- - In the DISPLAY program, STAT will show the current status of the - program settings. - - In the ANSYS program, STAT is a command generated by the GUI and will - appear in the log file (Jobname.LOG) if status is requested for some - items under Utility Menu> List> Status. Generally, STAT will be - preceded by one of the commands listed below, which specifies the - particular topic that status was requested for. - - If entered directly into the program, the STAT command should be - immediately preceded by the desired topic command listed below. In - processors other than those listed below (e.g., AUX12), no topic - command should proceed STAT. - - This command is valid in any processor. - - PREP7 topic commands (and their corresponding topics) are: - - SOLUTION topic commands (and their corresponding topics) are: - - POST1 topic commands (and their corresponding topics) are: - - POST26 topic commands (and their corresponding topics) are: - """ - command = "STAT," - return self.run(command, **kwargs) - - def stitle(self, nline="", title="", **kwargs): - """Defines subtitles. - - APDL Command: /STITLE - - Parameters - ---------- - nline - Subtitle line number (1 to 4). Defaults to 1. - - title - Input up to 70 alphanumeric characters. Parameter substitution may - be forced within the title by enclosing the parameter name or - parametric expression within percent (%) signs. If Title is blank, - this subtitle is deleted. - - Notes - ----- - Subtitles (4 maximum) are displayed in the output along with the main - title [/TITLE]. Subtitles do not appear in GUI windows or in ANSYS - plot displays. The first subtitle is also written to various ANSYS - files along with the main title. Previous subtitles may be overwritten - or deleted. Issue /STATUS to display titles. - - This command is valid in any processor. - """ - command = "/STITLE,%s,%s" % (str(nline), str(title)) - return self.run(command, **kwargs) - - def title(self, title="", **kwargs): - """Defines a main title. - - APDL Command: /TITLE - - Parameters - ---------- - title str - Input up to 72 alphanumeric characters. Parameter substitution may - be forced within the title by enclosing the parameter name or - parametric expression within percent (%) signs. - - Notes - ----- - The title is carried through the printout and written on various files. - The title written to a file is the title defined at that time. Special - characters may be used within the title text. Subtitles may also be - defined [/STITLE]. - - This command is valid in any processor. - """ - return self.run(f"/TITLE,{title}", **kwargs) - - def units( - self, - label="", - lenfact="", - massfact="", - timefact="", - tempfact="", - toffset="", - chargefact="", - forcefact="", - heatfact="", - **kwargs, - ): - """Annotates the database with the system of units used. - - APDL Command: /UNITS - - Parameters - ---------- - label - Label to denote the system of units used in this job: - - USER - User-defined system (default). - - SI - International system (m, kg, s, K). - - MKS - MKS system (m, kg, s, °C). - - uMKS - μMKS system (μm, kg, s, °C). - - CGS - CGS system (cm, g, s, °C). - - MPA - MPA system (mm, Mg, s, °C). - - BFT - U. S. Customary system using feet (ft, slug, s, °F). - - BIN - U. S. Customary system using inches (in, lbf*s2/in, s, °F). - - Notes - ----- - Allows the user to set a marker in the database indicating the system - of units used. The setting may be reviewed with the /STATUS command at - the Begin level. The units label and conversion factors on this - command are for user convenience only and have no effect on the - analysis or data. That is, /UNITS will not convert database items from - one system to another (e.g., from U. S. Customary to SI, etc.). The - units setting will be written to the file of IGES data [IGESOUT or - CDWRITE], which can then be read by many programs that read IGES files. - The user must still use consistent units for the results to be valid. - - If you choose the MKS system of units, the EPZRO option for the EMUNIT - command is set to 8.85 e-12 F/m. (EPZRO specifies alternate free-space - permittivity.) - - For micro-electromechanical systems (MEMS), where dimensions are on the - order of microns, see the conversion factors in System of Units in the - Coupled-Field Analysis Guide. - - If you use the ANSYS ADAMS Interface to export model information to the - ADAMS program, the /UNITS command is required to ensure the correct - transfer of data between ANSYS and ADAMS. You may choose a predefined - unit system label (Label = SI, CGS, etc.) or you can select the user- - defined system option (Label = USER) and input the appropriate - conversion factors (LENFACT, MASSFACT, TIMEFACT, and FORCEFACT). The - conversion factors will be written to the ADAMS input file Jobname.MNF - in order to correctly generate the load. For more information, see - Export to ADAMS in the Substructuring Analysis Guide. - - All differences between the base solution units used by the ANSYS and - CFX solvers will be noted in the ANSYS output file. Unit conversions - are automatically applied to all loads transferred unless Label = USER. - Unit conversions are not applied to any of the loads transferred - between the ANSYS and CFX solvers if they use a user-defined unit - system. - - This command is valid in any processor. - """ - command = "/UNITS,%s,%s,%s,%s,%s,%s,%s,%s,%s" % ( - str(label), - str(lenfact), - str(massfact), - str(timefact), - str(tempfact), - str(toffset), - str(chargefact), - str(forcefact), - str(heatfact), - ) - return self.run(command, **kwargs) diff --git a/src/ansys/mapdl/core/_commands/database/working_plane.py b/src/ansys/mapdl/core/_commands/database/working_plane.py index 757f1fa671e..c3add7d5ec1 100644 --- a/src/ansys/mapdl/core/_commands/database/working_plane.py +++ b/src/ansys/mapdl/core/_commands/database/working_plane.py @@ -22,110 +22,154 @@ class WorkingPlane: + def kwpave( self, - p1="", - p2="", - p3="", - p4="", - p5="", - p6="", - p7="", - p8="", - p9="", + p1: str = "", + p2: str = "", + p3: str = "", + p4: str = "", + p5: str = "", + p6: str = "", + p7: str = "", + p8: str = "", + p9: str = "", **kwargs, ): - """Moves the working plane origin to the average location of keypoints. + r"""Moves the working plane origin to the average location of keypoints. - APDL Command: KWPAVE + Mechanical APDL Command: `KWPAVE `_ Parameters ---------- - p1, p2, p3, . . . , p9 - Keypoints used in calculation of the average. At least one must be - defined. If P1 = P, graphical picking is enabled and all remaining - command fields are ignored (valid only in the GUI). + p1 : str + Keypoints used in calculation of the average. At least one must be defined. If ``P1`` = P, + graphical picking is enabled and all remaining command fields are ignored (valid only in the + GUI). + + p2 : str + Keypoints used in calculation of the average. At least one must be defined. If ``P1`` = P, + graphical picking is enabled and all remaining command fields are ignored (valid only in the + GUI). + + p3 : str + Keypoints used in calculation of the average. At least one must be defined. If ``P1`` = P, + graphical picking is enabled and all remaining command fields are ignored (valid only in the + GUI). + + p4 : str + Keypoints used in calculation of the average. At least one must be defined. If ``P1`` = P, + graphical picking is enabled and all remaining command fields are ignored (valid only in the + GUI). + + p5 : str + Keypoints used in calculation of the average. At least one must be defined. If ``P1`` = P, + graphical picking is enabled and all remaining command fields are ignored (valid only in the + GUI). + + p6 : str + Keypoints used in calculation of the average. At least one must be defined. If ``P1`` = P, + graphical picking is enabled and all remaining command fields are ignored (valid only in the + GUI). + + p7 : str + Keypoints used in calculation of the average. At least one must be defined. If ``P1`` = P, + graphical picking is enabled and all remaining command fields are ignored (valid only in the + GUI). + + p8 : str + Keypoints used in calculation of the average. At least one must be defined. If ``P1`` = P, + graphical picking is enabled and all remaining command fields are ignored (valid only in the + GUI). + + p9 : str + Keypoints used in calculation of the average. At least one must be defined. If ``P1`` = P, + graphical picking is enabled and all remaining command fields are ignored (valid only in the + GUI). Notes ----- - Moves the origin of the working plane to the average of the specified - keypoints. Averaging is based on the active coordinate system. + + .. _KWPAVE_notes: + + Moves the origin of the working plane to the average of the specified keypoints. Averaging is based + on the active coordinate system. This command is valid in any processor. """ command = f"KWPAVE,{p1},{p2},{p3},{p4},{p5},{p6},{p7},{p8},{p9}" return self.run(command, **kwargs) - def kwplan(self, wn="", korig="", kxax="", kplan="", **kwargs): - """Defines the working plane using three keypoints. + def kwplan( + self, wn: str = "", korig: str = "", kxax: str = "", kplan: str = "", **kwargs + ): + r"""Defines the working plane using three keypoints. - APDL Command: KWPLAN + Mechanical APDL Command: `KWPLAN `_ Parameters ---------- - wn - Window number whose viewing direction will be modified to be normal - to the working plane (defaults to 1). If WN is a negative value, - the viewing direction will not be modified. If fewer than three - points are used, the viewing direction of window WN will be used - instead to define the normal to the working plane. - - korig - Keypoint number defining the origin of the working plane coordinate - system. If KORIG = P, graphical picking is enabled and all - remaining command fields are ignored (valid only in the GUI). - - kxax - Keypoint number defining the x-axis orientation (defaults to the - x-axis being parallel to the global X-axis; or if the normal to the - working plane is parallel to the global X-axis, then defaults to - being parallel to the global Y-axis). - - kplan - Keypoint number defining the working plane (the normal defaults to - the present display view [/VIEW] of window WN). + wn : str + Window number whose viewing direction will be modified to be normal to the working plane + (defaults to 1). If ``WN`` is a negative value, the viewing direction will not be modified. If + fewer than three points are used, the viewing direction of window ``WN`` will be used instead to + define the normal to the working plane. + + korig : str + Keypoint number defining the origin of the working plane coordinate system. If ``KORIG`` = P, + graphical picking is enabled and all remaining command fields are ignored (valid only in the + GUI). + + kxax : str + Keypoint number defining the x-axis orientation (defaults to the x-axis being parallel to the + global X-axis; or if the normal to the working plane is parallel to the global X-axis, then + defaults to being parallel to the global Y-axis). + + kplan : str + Keypoint number defining the working plane (the normal defaults to the present display view ( + :ref:`view` ) of window ``WN`` ). Notes ----- - Defines a working plane to assist in picking operations using three - keypoints as an alternate to the WPLANE command. The three keypoints - also define the working plane coordinate system. A minimum of one - keypoint (at the working plane origin) is required. Immediate mode may - also be active. See WPSTYL command to set the style of working plane - display. + + .. _KWPLAN_notes: + + Defines a working plane to assist in picking operations using three keypoints as an alternate to the + :ref:`wplane` command. The three keypoints also define the working plane coordinate system. A + minimum of one keypoint (at the working plane origin) is required. Immediate mode may also be + active. See :ref:`wpstyl` command to set the style of working plane display. This command is valid in any processor. """ command = f"KWPLAN,{wn},{korig},{kxax},{kplan}" return self.run(command, **kwargs) - def lwplan(self, wn="", nl1="", ratio="", **kwargs): - """Defines the working plane normal to a location on a line. + def lwplan(self, wn: str = "", nl1: str = "", ratio: str = "", **kwargs): + r"""Defines the working plane normal to a location on a line. - APDL Command: LWPLAN + Mechanical APDL Command: `LWPLAN `_ Parameters ---------- - wn - Window number whose viewing direction will be modified to be normal - to the working plane (defaults to 1). If WN is a negative value, - the viewing direction will not be modified. + wn : str + Window number whose viewing direction will be modified to be normal to the working plane + (defaults to 1). If ``WN`` is a negative value, the viewing direction will not be modified. - nl1 - Number of line to be used. If NL1 = P, graphical picking is - enabled and all remaining command fields are ignored (valid only in - the GUI). + nl1 : str + Number of line to be used. If ``NL1`` = P, graphical picking is enabled and all remaining + command fields are ignored (valid only in the GUI). - ratio - Location on NL1, specified as a ratio of the line length. Must be - between 0.0 and 1.0. If RATIO = P, use graphical picking to - specify location on the line. + ratio : str + Location on ``NL1``, specified as a ratio of the line length. Must be between 0.0 and 1.0. If + ``RATIO`` = P, use graphical picking to specify location on the line. Notes ----- - Defines a working plane (to assist in picking operations) normal to a - location on a line. See WPSTYL command to set the style of working - plane display. + + .. _LWPLAN_notes: + + Defines a working plane (to assist in picking operations) normal to a location on a line. See + :ref:`wpstyl` command to set the style of working plane display. This command is valid in any processor. """ @@ -134,30 +178,64 @@ def lwplan(self, wn="", nl1="", ratio="", **kwargs): def nwpave( self, - n1="", - n2="", - n3="", - n4="", - n5="", - n6="", - n7="", - n8="", - n9="", + n1: str = "", + n2: str = "", + n3: str = "", + n4: str = "", + n5: str = "", + n6: str = "", + n7: str = "", + n8: str = "", + n9: str = "", **kwargs, ): - """Moves the working plane origin to the average location of nodes. + r"""Moves the working plane origin to the average location of nodes. - APDL Command: NWPAVE + Mechanical APDL Command: `NWPAVE `_ Parameters ---------- - n1, n2, n3, . . . , n9 - Nodes used in calculation of the average. At least one must be - defined. If N1 = P, graphical picking is enabled and all remaining - command fields are ignored (valid only in the GUI). + n1 : str + Nodes used in calculation of the average. At least one must be defined. If ``N1`` = P, graphical + picking is enabled and all remaining command fields are ignored (valid only in the GUI). + + n2 : str + Nodes used in calculation of the average. At least one must be defined. If ``N1`` = P, graphical + picking is enabled and all remaining command fields are ignored (valid only in the GUI). + + n3 : str + Nodes used in calculation of the average. At least one must be defined. If ``N1`` = P, graphical + picking is enabled and all remaining command fields are ignored (valid only in the GUI). + + n4 : str + Nodes used in calculation of the average. At least one must be defined. If ``N1`` = P, graphical + picking is enabled and all remaining command fields are ignored (valid only in the GUI). + + n5 : str + Nodes used in calculation of the average. At least one must be defined. If ``N1`` = P, graphical + picking is enabled and all remaining command fields are ignored (valid only in the GUI). + + n6 : str + Nodes used in calculation of the average. At least one must be defined. If ``N1`` = P, graphical + picking is enabled and all remaining command fields are ignored (valid only in the GUI). + + n7 : str + Nodes used in calculation of the average. At least one must be defined. If ``N1`` = P, graphical + picking is enabled and all remaining command fields are ignored (valid only in the GUI). + + n8 : str + Nodes used in calculation of the average. At least one must be defined. If ``N1`` = P, graphical + picking is enabled and all remaining command fields are ignored (valid only in the GUI). + + n9 : str + Nodes used in calculation of the average. At least one must be defined. If ``N1`` = P, graphical + picking is enabled and all remaining command fields are ignored (valid only in the GUI). Notes ----- + + .. _NWPAVE_notes: + Averaging is based on the active coordinate system. This command is valid in any processor. @@ -165,43 +243,44 @@ def nwpave( command = f"NWPAVE,{n1},{n2},{n3},{n4},{n5},{n6},{n7},{n8},{n9}" return self.run(command, **kwargs) - def nwplan(self, wn="", norig="", nxax="", nplan="", **kwargs): - """Defines the working plane using three nodes. + def nwplan( + self, wn: str = "", norig: str = "", nxax: str = "", nplan: str = "", **kwargs + ): + r"""Defines the working plane using three nodes. - APDL Command: NWPLAN + Mechanical APDL Command: `NWPLAN `_ Parameters ---------- - wn - Window number whose viewing direction will be modified to be normal - to the working plane (defaults to 1). If WN is a negative value, - the viewing direction will not be modified. If fewer than three - points are used, the viewing direction of window WN will be used - instead to define the normal to the working plane. - - norig - Node number defining the origin of the working plane coordinate - system. If NORIG = P, graphical picking is enabled and all - remaining command fields are ignored (valid only in the GUI). - - nxax - Node number defining the x-axis orientation (defaults to the x-axis - being parallel to the global X-axis; or if the normal to the - working plane is parallel to the global X-axis, then defaults to + wn : str + Window number whose viewing direction will be modified to be normal to the working plane + (defaults to 1). If ``WN`` is a negative value, the viewing direction will not be modified. If + fewer than three points are used, the viewing direction of window ``WN`` will be used instead to + define the normal to the working plane. + + norig : str + Node number defining the origin of the working plane coordinate system. If ``NORIG`` = P, + graphical picking is enabled and all remaining command fields are ignored (valid only in the + GUI). + + nxax : str + Node number defining the x-axis orientation (defaults to the x-axis being parallel to the global + X-axis; or if the normal to the working plane is parallel to the global X-axis, then defaults to being parallel to the global Y-axis). - nplan - Node number defining the working plane (the normal defaults to the - present display view [/VIEW] of window WN). + nplan : str + Node number defining the working plane (the normal defaults to the present display view ( + :ref:`view` ) of window ``WN`` ). Notes ----- - Defines a working plane to assist in picking operations using three - nodes as an alternate to the WPLANE command. The three nodes also - define the working plane coordinate system. A minimum of one node (at - the working plane origin) is required. Immediate mode may also be - active. See the WPSTYL command to set the style of the working plane - display. + + .. _NWPLAN_notes: + + Defines a working plane to assist in picking operations using three nodes as an alternate to the + :ref:`wplane` command. The three nodes also define the working plane coordinate system. A minimum of + one node (at the working plane origin) is required. Immediate mode may also be active. See the + :ref:`wpstyl` command to set the style of the working plane display. This command is valid in any processor. """ @@ -210,185 +289,235 @@ def nwplan(self, wn="", norig="", nxax="", nplan="", **kwargs): def wpave( self, - x1="", - y1="", - z1="", - x2="", - y2="", - z2="", - x3="", - y3="", - z3="", + x1: str = "", + y1: str = "", + z1: str = "", + x2: str = "", + y2: str = "", + z2: str = "", + x3: str = "", + y3: str = "", + z3: str = "", **kwargs, ): - """Moves the working plane origin to the average of specified points. + r"""Moves the working plane origin to the average of specified points. - APDL Command: WPAVE + Mechanical APDL Command: `WPAVE `_ Parameters ---------- - x1, y1, z1 - Coordinates (in the active coordinate system) of the first point. - If X1 = P, graphical picking is enabled and all remaining command - fields are ignored (valid only in the GUI). + x1 : str + Coordinates (in the active coordinate system) of the first point. If ``X1`` = P, graphical + picking is enabled and all remaining command fields are ignored (valid only in the GUI). + + y1 : str + Coordinates (in the active coordinate system) of the first point. If ``X1`` = P, graphical + picking is enabled and all remaining command fields are ignored (valid only in the GUI). + + z1 : str + Coordinates (in the active coordinate system) of the first point. If ``X1`` = P, graphical + picking is enabled and all remaining command fields are ignored (valid only in the GUI). + + x2 : str + Coordinates (in the active coordinate system) of the second point. + + y2 : str + Coordinates (in the active coordinate system) of the second point. - x2, y2, z2 + z2 : str Coordinates (in the active coordinate system) of the second point. - x3, y3, z3 + x3 : str + Coordinates (in the active coordinate system) of the third point. + + y3 : str + Coordinates (in the active coordinate system) of the third point. + + z3 : str Coordinates (in the active coordinate system) of the third point. Notes ----- - Moves the origin of the working plane to the average of the specified - points. A point is considered specified only if at least one of its - coordinates is non-blank, and at least one point (1, 2, or 3) must be - specified. Blank coordinates of a specified point are assumed to be - zero. Averaging is based on the active coordinate system. + + .. _WPAVE_notes: + + Moves the origin of the working plane to the average of the specified points. A point is considered + specified only if at least one of its coordinates is non-blank, and at least one point (1, 2, or 3) + must be specified. Blank coordinates of a specified point are assumed to be zero. Averaging is based + on the active coordinate system. This command is valid in any processor. """ command = f"WPAVE,{x1},{y1},{z1},{x2},{y2},{z2},{x3},{y3},{z3}" return self.run(command, **kwargs) - def wpcsys(self, wn="", kcn="", **kwargs): - """Defines the working plane location based on a coordinate system. + def wpcsys(self, wn: str = "", kcn: str = "", **kwargs): + r"""Defines the working plane location based on a coordinate system. - APDL Command: WPCSYS + Mechanical APDL Command: `WPCSYS `_ Parameters ---------- - wn - Window number whose viewing direction will be modified to be normal - to the working plane (defaults to 1). If WN is a negative value, - the viewing direction will not be modified. + wn : str + Window number whose viewing direction will be modified to be normal to the working plane + (defaults to 1). If ``WN`` is a negative value, the viewing direction will not be modified. - kcn - Coordinate system number. KCN may be 0,1,2 or any previously - defined local coordinate system number (defaults to the active - system). + kcn : str + Coordinate system number. ``KCN`` may be 0,1,2 or any previously defined local coordinate system + number (defaults to the active system). Notes ----- - Defines a working plane location and orientation based on an existing - coordinate system. If a Cartesian system is used as the basis (KCN) - for the working plane, the working plane will also be Cartesian, in the - X-Y plane of the base system. If a cylindrical, spherical, or toroidal - base system is used, the working plane will be a polar system in the - R-θ plane of the base system. - - If working plane tracking has been activated (CSYS,WP or CSYS,4), the - updated active coordinate system will be of a similar type, except that - a toroidal system will be updated to a cylindrical system. See the - Modeling and Meshing Guide for more information on working plane - tracking. + + .. _WPCSYS_notes: + + Defines a working plane location and orientation based on an existing coordinate system. If a + Cartesian system is used as the basis ( ``KCN`` ) for the working plane, the working plane will also + be Cartesian, in the X-Y plane of the base system. If a cylindrical, spherical, or toroidal base + system is used, the working plane will be a polar system in the R-θ plane of the base system. + + If working plane tracking has been activated ( :ref:`csys`,WP or :ref:`csys`,4), the updated active + coordinate system will be of a similar type, except that a toroidal system will be updated to a + cylindrical system. See the `Modeling and Meshing Guide + `_ for more + information on working plane tracking. This command is valid in any processor. - Some primitive generation commands will not honor R-theta - transformations for non-cartesian coordinate systems. Refer to the - primitive commands table for more information. + Some primitive generation commands will not honor R-theta transformations for non-cartesian + coordinate systems. Refer to the primitive commands table for more information. """ command = f"WPCSYS,{wn},{kcn}" return self.run(command, **kwargs) def wplane( self, - wn="", - xorig="", - yorig="", - zorig="", - xxax="", - yxax="", - zxax="", - xplan="", - yplan="", - zplan="", + wn: str = "", + xorig: str = "", + yorig: str = "", + zorig: str = "", + xxax: str = "", + yxax: str = "", + zxax: str = "", + xplan: str = "", + yplan: str = "", + zplan: str = "", **kwargs, ): - """Defines a working plane to assist in picking operations. + r"""Defines a working plane to assist in picking operations. - APDL Command: WPLANE + Mechanical APDL Command: `WPLANE `_ Parameters ---------- - wn - Window number whose viewing direction will be modified to be normal - to the working plane (defaults to 1). If WN is a negative value, - the viewing direction will not be modified. If fewer than three - points are used, the viewing direction of window WN will be used - instead to define the normal to the working plane. - - xorig, yorig, zorig - Global Cartesian coordinates of the origin of the working plane - coordinate system. - - xxax, yxax, zxax - Global Cartesian coordinates of a point defining the x-axis - orientation. The x-axis aligns with the projection of the line - from this orientation point to the origin. - - xplan, yplan, zplan - Global Cartesian coordinates of the third point defining the - working plane. This point will also define the location of the - positive XY-sector of the working plane coordinate system. + wn : str + Window number whose viewing direction will be modified to be normal to the working plane + (defaults to 1). If ``WN`` is a negative value, the viewing direction will not be modified. If + fewer than three points are used, the viewing direction of window ``WN`` will be used instead to + define the normal to the working plane. + + xorig : str + Global Cartesian coordinates of the origin of the working plane coordinate system. + + yorig : str + Global Cartesian coordinates of the origin of the working plane coordinate system. + + zorig : str + Global Cartesian coordinates of the origin of the working plane coordinate system. + + xxax : str + Global Cartesian coordinates of a point defining the x-axis orientation. The x-axis aligns with + the projection of the line from this orientation point to the origin. + + yxax : str + Global Cartesian coordinates of a point defining the x-axis orientation. The x-axis aligns with + the projection of the line from this orientation point to the origin. + + zxax : str + Global Cartesian coordinates of a point defining the x-axis orientation. The x-axis aligns with + the projection of the line from this orientation point to the origin. + + xplan : str + Global Cartesian coordinates of the third point defining the working plane. This point will also + define the location of the positive XY-sector of the working plane coordinate system. + + yplan : str + Global Cartesian coordinates of the third point defining the working plane. This point will also + define the location of the positive XY-sector of the working plane coordinate system. + + zplan : str + Global Cartesian coordinates of the third point defining the working plane. This point will also + define the location of the positive XY-sector of the working plane coordinate system. Notes ----- - Defines a working plane to assist in picking operations using the - coordinates of three noncolinear points. The three points also define - the working plane coordinate system. A minimum of one point (the - working plane origin) is required. Immediate mode may also be active. - See WPSTYL command to set the style of working plane display. + + .. _WPLANE_notes: + + Defines a working plane to assist in picking operations using the coordinates of three noncolinear + points. The three points also define the working plane coordinate system. A minimum of one point + (the working plane origin) is required. Immediate mode may also be active. See :ref:`wpstyl` command + to set the style of working plane display. This command is valid in any processor. """ command = f"WPLANE,{wn},{xorig},{yorig},{zorig},{xxax},{yxax},{zxax},{xplan},{yplan},{zplan}" return self.run(command, **kwargs) - def wpoffs(self, xoff="", yoff="", zoff="", **kwargs): - """Offsets the working plane. + def wpoffs(self, xoff: str = "", yoff: str = "", zoff: str = "", **kwargs): + r"""Offsets the working plane. - APDL Command: WPOFFS + Mechanical APDL Command: `WPOFFS `_ Parameters ---------- - xoff, yoff, zoff - Offset increments defined in the working plane coordinate system. - If only ZOFF is used, the working plane will be redefined parallel - to the present plane and offset by ZOFF. + xoff : str + Offset increments defined in the working plane coordinate system. If only ``ZOFF`` is used, the + working plane will be redefined parallel to the present plane and offset by ``ZOFF``. + + yoff : str + Offset increments defined in the working plane coordinate system. If only ``ZOFF`` is used, the + working plane will be redefined parallel to the present plane and offset by ``ZOFF``. + + zoff : str + Offset increments defined in the working plane coordinate system. If only ``ZOFF`` is used, the + working plane will be redefined parallel to the present plane and offset by ``ZOFF``. Notes ----- - Changes the origin of the working plane by translating the working - plane along its coordinate system axes. + + .. _WPOFFS_notes: + + Changes the origin of the working plane by translating the working plane along its coordinate system + axes. This command is valid in any processor. """ command = f"WPOFFS,{xoff},{yoff},{zoff}" return self.run(command, **kwargs) - def wprota(self, thxy="", thyz="", thzx="", **kwargs): - """Rotates the working plane. + def wprota(self, thxy: str = "", thyz: str = "", thzx: str = "", **kwargs): + r"""Rotates the working plane. - APDL Command: WPROTA + Mechanical APDL Command: `WPROTA `_ Parameters ---------- - thxy - First rotation about the working plane Z axis (positive X toward - Y). + thxy : str + First rotation about the working plane Z axis (positive X toward Y). - thyz + thyz : str Second rotation about working plane X axis (positive Y toward Z). - thzx + thzx : str Third rotation about working plane Y axis (positive Z toward X). Notes ----- - The specified angles (in degrees) are relative to the orientation of - the working plane. + + .. _WPROTA_notes: + + The specified angles (in degrees) are relative to the orientation of the working plane. This command is valid in any processor. """ @@ -397,105 +526,102 @@ def wprota(self, thxy="", thyz="", thzx="", **kwargs): def wpstyl( self, - snap="", - grspac="", - grmin="", - grmax="", - wptol="", - wpctyp="", - grtype="", - wpvis="", - snapang="", + snap: str = "", + grspac: str = "", + grmin: str = "", + grmax: str = "", + wptol: str = "", + wpctyp: int | str = "", + grtype: int | str = "", + wpvis: int | str = "", + snapang: str = "", **kwargs, ): - """Controls the display and style of the working plane. + r"""Controls the display and style of the working plane. - APDL Command: WPSTYL + Mechanical APDL Command: `WPSTYL `_ Parameters ---------- - snap - Snap increment for a locational pick (1E-6 minimum). If -1, turn - off snap capability. For example, a picked location of 1.2456 with - a snap of 0.1 gives 1.2, with 0.01 gives 1.25, with 0.001 gives - 1.246, and with 0.025 gives 1.250 (defaults to 0.05). - - grspac - Graphical spacing between grid points. For graphical - representation only and not related to snap points (defaults to - 0.1). - - grmin, grmax - Defines the size of a square grid (if WPCTYP = 0) to be displayed - over a portion of the working plane. The opposite corners of the - grid will be located at grid points nearest the working plane - coordinates of (GRMIN,GRMIN) and (GRMAX,GRMAX). If a polar system - (WPCTYP = 1), GRMAX is the outside radius of grid and GRMIN is - ignored. If GRMIN = GRMAX, no grid will be displayed (defaults to - -1.0 and 1.0 for GRMIN and GRMAX respectively). - - wptol - The tolerance that an entity's location can deviate from the - specified working plane, while still being considered on the plane. - Used only for locational picking of vertices for polygons and - prisms (defaults to 0.003). - - wpctyp + snap : str + Snap increment for a locational pick (1E-6 minimum). If -1, turn off snap capability. For + example, a picked location of 1.2456 with a snap of 0.1 gives 1.2, with 0.01 gives 1.25, with + 0.001 gives 1.246, and with 0.025 gives 1.250 (defaults to 0.05). + + grspac : str + Graphical spacing between grid points. For graphical representation only and not related to snap + points (defaults to 0.1). + + grmin : str + Defines the size of a square grid (if ``WPCTYP`` = 0) to be displayed over a portion of the + working plane. The opposite corners of the grid will be located at grid points nearest the + working plane coordinates of ( ``GRMIN``, ``GRMIN`` ) and ( ``GRMAX``, ``GRMAX`` ). If a polar + system ( ``WPCTYP`` = 1), ``GRMAX`` is the outside radius of grid and ``GRMIN`` is ignored. If + ``GRMIN`` = ``GRMAX``, no grid will be displayed (defaults to -1.0 and 1.0 for ``GRMIN`` and + ``GRMAX`` respectively). + + grmax : str + Defines the size of a square grid (if ``WPCTYP`` = 0) to be displayed over a portion of the + working plane. The opposite corners of the grid will be located at grid points nearest the + working plane coordinates of ( ``GRMIN``, ``GRMIN`` ) and ( ``GRMAX``, ``GRMAX`` ). If a polar + system ( ``WPCTYP`` = 1), ``GRMAX`` is the outside radius of grid and ``GRMIN`` is ignored. If + ``GRMIN`` = ``GRMAX``, no grid will be displayed (defaults to -1.0 and 1.0 for ``GRMIN`` and + ``GRMAX`` respectively). + + wptol : str + The tolerance that an entity's location can deviate from the specified working plane, while + still being considered on the plane. Used only for locational picking of vertices for polygons + and prisms (defaults to 0.003). + + wpctyp : int or str Working plane coordinate system type: - 0 - Cartesian (default). If working plane tracking is on [CSYS,4], the updated - active coordinate system will also be Cartesian. + * ``0`` - Cartesian (default). If working plane tracking is on ( :ref:`csys`,4), the updated active + coordinate system will also be Cartesian. - 1 - Polar. If working plane tracking is on, the updated active coordinate system - will be cylindrical. + * ``1`` - Polar. If working plane tracking is on, the updated active coordinate system will be + cylindrical. - 2 - Polar. If working plane tracking is on, the updated active coordinate system - will be spherical. + * ``2`` - Polar. If working plane tracking is on, the updated active coordinate system will be + spherical. - grtype + grtype : int or str Grid type: - 0 - Grid and WP triad. + * ``0`` - Grid and WP triad. - 1 - Grid only. + * ``1`` - Grid only. - 2 - WP triad only (default). + * ``2`` - WP triad only (default). - wpvis + wpvis : int or str Grid visibility: - 0 - Do not show GRTYPE entities (grid and/or triad) (default). + * ``0`` - Do not show ``GRTYPE`` entities (grid and/or triad) (default). - 1 - Show GRTYPE entities. Cartesian working planes will be displayed with a - Cartesian grid, polar with a polar grid. + * ``1`` - Show ``GRTYPE`` entities. Cartesian working planes will be displayed with a Cartesian + grid, polar with a polar grid. - snapang - Snap angle (0--180) in degrees. Used only if WPCTYP = 1 or 2. - Defaults to 5 degrees. + snapang : str + Snap angle (0--180) in degrees. Used only if ``WPCTYP`` = 1 or 2. Defaults to 5 degrees. Notes ----- - Use WPSTYL,DEFA to reset the working plane to its default location and - style. Use WPSTYL,STAT to list the status of the working plane. Blank - fields will keep present settings. - - It is possible to specify SNAP and WPTOL values that will cause - conflicts during picking operations. Check your values carefully, and - if problems are noted, revert to the default values. - - WPSTYL with no arguments will toggle the grid on and off. The working - plane can be displayed in the non-GUI interactive mode only after - issuing a /PLOPTS,WP,1 command. See the Modeling and Meshing Guide for - more information on working plane tracking. See /PLOPTS command for - control of hidden line working plane. + + .. _WPSTYL_notes: + + Use :ref:`wpstyl`,DEFA to reset the working plane to its default location and style. Use + :ref:`wpstyl`,STAT to list the status of the working plane. Blank fields will keep present settings. + + It is possible to specify ``SNAP`` and ``WPTOL`` values that will cause conflicts during picking + operations. Check your values carefully, and if problems are noted, revert to the default values. + + :ref:`wpstyl` with no arguments will toggle the grid on and off. The working plane can be displayed + in the non-GUI interactive mode only after issuing a :ref:`plopts`,WP,1 command. See the `Modeling + and Meshing Guide + `_ + for more information on working plane tracking. See :ref:`plopts` command for control of hidden line + working plane. This command is valid in any processor. """ diff --git a/src/ansys/mapdl/core/_commands/display_/setup.py b/src/ansys/mapdl/core/_commands/display_/setup.py deleted file mode 100644 index 6bdbf3607bd..00000000000 --- a/src/ansys/mapdl/core/_commands/display_/setup.py +++ /dev/null @@ -1,284 +0,0 @@ -# Copyright (C) 2016 - 2025 ANSYS, Inc. and/or its affiliates. -# SPDX-License-Identifier: MIT -# -# -# Permission is hereby granted, free of charge, to any person obtaining a copy -# of this software and associated documentation files (the "Software"), to deal -# in the Software without restriction, including without limitation the rights -# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -# copies of the Software, and to permit persons to whom the Software is -# furnished to do so, subject to the following conditions: -# -# The above copyright notice and this permission notice shall be included in all -# copies or substantial portions of the Software. -# -# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -# SOFTWARE. - - -class Setup: - def cmap(self, fname="", ext="", kywrd="", ncntr="", **kwargs): - """Changes an existing or creates a new color mapping table. - - APDL Command: /CMAP - - 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. - - ext - Filename extension (eight-character maximum). - - kywrd - Keyword indicating the disposition of the color map file. - - (blank) - Loads existing color map file. - - CREATE - Starts the CMAP utility and modifies or creates - the specified file. - - SAVE - Writes the active color map to the specified file, - which can be imported into future sessions. - - ncntr - Number of contours to be defined. Default = 9 (even if an existing - file is being modified). Maximum = 128. - - Notes - ----- - Reads the color map file (RGB index specifications) to change - from current specifications. Only one color map may be active - at a time. - - For 2-D drivers (especially Win32c), modifying the color map - can produce anomalies, including legend/contour disagreement. - - When Kywrd equals CREATE, the 2-D drivers (X11c and Win32c) - display the CMAP utility with an additional contour color - picker called CONTOURS. Colors selected via the CONTOURS - picker affect result contour displays (such as stresses). No - other drivers offer the CONTOURS picker in the CMAP utility. - - Changing the color map using the /CMAP command changes the - meaning of the color labels on the /COLOR command. See /COLOR - for other color controls. - - This command is valid anywhere. - """ - return self.run(f"/CMAP,{fname},{ext},,{kywrd},{ncntr}", **kwargs) - - def devdisp(self, label="", key="", **kwargs): - """Controls graphics device options. - - APDL Command: /DEVDISP - - Parameters - ---------- - label - Device function label: - - BBOX - Disables display information sorting for PowerGraphics displays. When activated - (KEY = 1 or ON), model rotations and replots are performed - without recalculating edge and surface data. This will speed - up the rotation (especially for 2-D displays) of large - models, although the display information will not be - resolved as quickly (you will see a bounding box instead of - the model during dynamic rotations). The default is OFF (KEY - = 0). - - DITHER - Dithering. When turned on (default), dithering smooths transitions in color - intensity. Applies only to Z-buffered displays. - - FONT - Font selection for the ANSYS graphics window. When Label = FONT, the command - format is: /DEVDISP,FONT,KEY,Val1,Val2,Val3,VAL4,Val5,Val6, - where KEY determines the type of font being controlled, and - values 1 through 6 control various font parameters. Note - that these values are device specific; using the same - command input file [/INPUT] on different machines may yield - different results.The following KEY values determine the - font information that will be supplied to the appropriate - driver (e.g., Postscript, X11, Win32, JPEG, ...): - - KEY = 1 - The command controls the LEGEND (documentation column) font. - - KEY = 2 - The command controls the ENTITY (node and keypoint number) font. - - KEY = 3 - The command controls the ANNOTATION/GRAPH font. - - Linux: Values 1 through 4 are used to find a match in the X11 database of font strings. Values 1, 2, and 3 are character strings; value 4 is a nonzero integer: - Val1 - - Family name (e.g., ``Courier*New``). Substitute an asterisk (``*``) for any blank character that appears in a family name. If Val1 = MENU, all other values are ignored, and a font selection menu appears (GUI must be active). - Val2 - - Weight (e.g., medium) - Val3 - - Slant (e.g., r) - Val4 - - Pixel size (e.g., 14). Note that this value does not affect the annotation fonts (KEY = 3). Use the /TSPEC command to control the pixel size of your annotation fonts. - Val5 - - unused - Val6 - - unused - PC: The values are encoded in a PC logical font structure. Value 1 is a - character string, and the remaining values are integers: - - Val1 - Family name (e.g., ``Courier*New``) Substitute an asterisk (``*``) for any blank - character that appears in a family name. If Val1 = MENU, all - other values are ignored and a font selection menu appears - (GUI must be active). A value containing all blank - characters causes ANSYS to use the first available resource - it finds. - - Val2 - Weight (0 - 1000) - - Val3 - Orientation (in tenths of a degree) - - Val4 - Height (in logical units) Note that this value does not affect the annotation - fonts (KEY =3). Use the /TSPEC command to control the height - of your annotation fonts. - - Val5 - Width (in logical units) - - Val6 - Italics (0 = OFF, 1 = ON) - - TEXT - Text size specification for the ANSYS Graphics window. When Label = TEXT, the - command format is: /DEVDISP,TEXT,KEY,PERCENT, where KEY - determines the type of text being controlled (1 for LEGEND, - and 2 for ENTITY), and PERCENT specifies the new text size - as a percent of the default text size. If PERCENT = 100, - the new text size is precisely the default size. If PERCENT - = 200, the new text size is twice the default text size. - - key - Control key: - - OFF or 0 - Turns specified function off. - - ON or 1 - Turns specified function on. - """ - command = f"/DEVDISP,{label},{key}" - return self.run(command, **kwargs) - - def filedisp(self, fname="", ext="", **kwargs): - """Specifies the file containing the graphics data. - - APDL Command: FILEDISP - - 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. - - ext - Filename extension (eight-character maximum). - - Notes - ----- - Specifies the input file containing the graphics data (defaults to - File.GRPH). - """ - command = f"FILEDISP,{fname},{ext}" - return self.run(command, **kwargs) - - def nocolor(self, key="", **kwargs): - """Removes color from graphics displays. - - APDL Command: NOCOLOR - - Parameters - ---------- - key - Color key: - - 0 - Color the displays. - - 1 - Do not color the displays. - - 2 - Do not shade the displays. - """ - command = f"NOCOLOR,{key}" - return self.run(command, **kwargs) - - def showdisp(self, dname="", ncpl="", **kwargs): - """Defines the display driver name. - - APDL Command: /SHOWDISP - - Parameters - ---------- - dname - Valid driver name (see Getting Started with Graphics in the Basic - Analysis Guide for details): - - - Any linked terminal driver (such as X11, TEKTRONIX, etc.) - - HPGL - Hewlett-Packard Graphics Language - - HPGL2 - Hewlett-Packard Graphics Language with enhanced - color. (See the HPGL command for options.) - Ignores the NCPL field. - - INTERLEAF - Interleaf ASCII Format, OPS Version 5.0 - - POSTSCRIPT - PostScript, Version 1.0 Minimally Conforming - - DUMP - ASCII Text Dump - - ncpl - Number of color planes (4 to 8). Default is device-dependent. - """ - return self.run(f"/SHOWDISP,{dname},,,{ncpl}", **kwargs) - - def trans(self, fname="", ext="", **kwargs): - """Reformats File.GRPH for improved performance with plotters. - - APDL Command: TRANS - - 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. - - ext - Filename extension (eight-character maximum). - - Notes - ----- - Reformats current Fname.GRPH data (based on color) for improved - performance with pen plotters. - """ - command = f"TRANS,{fname},{ext}" - return self.run(command, **kwargs) diff --git a/src/ansys/mapdl/core/_commands/graphics/__init__.py b/src/ansys/mapdl/core/_commands/graphics/__init__.py new file mode 100644 index 00000000000..bc9a75ca366 --- /dev/null +++ b/src/ansys/mapdl/core/_commands/graphics/__init__.py @@ -0,0 +1,31 @@ +# Copyright (C) 2016 - 2025 ANSYS, Inc. and/or its affiliates. +# SPDX-License-Identifier: MIT +# +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to deal +# in the Software without restriction, including without limitation the rights +# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +# copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in all +# copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +# SOFTWARE. + +from . import ( + annotation, + graphs, + labeling, + scaling, + set_up, + style, + views, +) diff --git a/src/ansys/mapdl/core/_commands/graphics/annotation.py b/src/ansys/mapdl/core/_commands/graphics/annotation.py new file mode 100644 index 00000000000..1bac42ede5a --- /dev/null +++ b/src/ansys/mapdl/core/_commands/graphics/annotation.py @@ -0,0 +1,849 @@ +# Copyright (C) 2016 - 2025 ANSYS, Inc. and/or its affiliates. +# SPDX-License-Identifier: MIT +# +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to deal +# in the Software without restriction, including without limitation the rights +# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +# copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in all +# copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +# SOFTWARE. + + +class Annotation: + + def an3d(self, **kwargs): + r"""Specifies 3D annotation functions + + Mechanical APDL Command: `/AN3D `_ + + Notes + ----- + + .. warning:: + + This function contains specificities regarding the argument definitions. + Please refer to the `command documentation `_ + for further explanations. + + .. _AN3D_notes: + + Because 3D annotation is applied in relation to the XYZ coordinates of the anchor, you can transform + your model, and the annotation will maintain the spatial relationship with the model. This works + within reason, and there are instances where changing the perspective or the size of the model will + change the apparent relationship between the annotation and the model. + + The overall 3D dimensions of your model are defined by a bounding box. If portions of your model's + bounding box lie outside of the visible area of your graphics window (if you are zoomed in on a + specific area of your model), it can affect the placement of your 3D annotations. Zooming out will + usually overcome this problem. + + 3D annotation is valid for the Cartesian ( :ref:`csys`,0) coordinate system only. If you want to + annotate a model you created in another coordinate system, use 2D annotation (note that 2D + annotations do not remain anchored for dynamic rotations or transformations). + + When you apply user defined bitmaps, the size of the annotation can vary. Use the options menu of + the 3D annotation widget to adjust the size and placement of your bitmaps. + + You cannot use the "!" and "$" characters in Mechanical APDL text annotation. + + The GUI generates this command during 3D annotation operations and inserts the command into the log + file ( :file:`Jobname.LOG` ). You should NOT type this command directly during a Mechanical APDL + session + (although the command can be included in an input file for batch input or for use with the + :ref:`input` command). + """ + command = "/AN3D" + return self.run(command, **kwargs) + + def annot(self, lab: str = "", val1: str = "", val2: str = "", **kwargs): + r"""Activates graphics for annotating displays (GUI). + + Mechanical APDL Command: `/ANNOT `_ + + Parameters + ---------- + lab : str + Annotation control key: + + * ``OFF`` - Turns off annotation for each subsequent display (default). + + * ``ON`` - Turns on annotation for each subsequent display. + + * ``DELE`` - Deletes all annotation. + + * ``SAVE`` - Saves annotation on a file. Use ``VAL1`` for file name (defaults to :file:`Jobname` ) + and ``VAL2`` for the extension (defaults to ANO). + + * ``SCALE`` - Sets annotation scale factor (direct input only). Use ``VAL1`` for value (0.1 to 10.0) + (defaults to 1.0). + + * ``XORIG`` - Sets the annotation x origin (direct input only). Use ``VAL1`` for value (-3.0 to + 3.0). + + * ``YORIG`` - Sets annotation y origin (direct input only). Use ``VAL1`` for value (-3.0 to 3.0). + + * ``SNAP`` - Sets annotation snap (menu button input only). Use ``VAL1`` for value (0.002 to 0.2) + (defaults to 0.002). + + * ``STAT`` - Displays current annotation status. + + * ``DEFA`` - Sets annotation specifications to the default values. + + * ``REFR`` - Redisplays annotation graphics. + + * ``TMOD`` - Sets the annotation text mode. If ``VAL1`` = 1, annotation text will be drawn in + scalable bitmap fonts (default). If ``VAL1`` = 0, annotation text will be drawn with stroke text. + + val1 : str + Value (or file name) as noted with label above. + + val2 : str + Value (or file name extension) as noted with label above. + + Notes + ----- + + .. _s-ANNOT_notes: + + This is a command generated by the GUI and will appear in the log file ( :file:`Jobname.LOG` ) if + annotation is used. This command is not intended to be typed in directly in a Mechanical APDL + session + (although it can be included in an input file for batch input or for use with the :ref:`input` + command). + + You cannot use the "!" and "$" characters in Mechanical APDL text annotation. + + :ref:`annot` activates annotation graphics for adding annotation to displays. Commands representing + the annotation instructions are automatically created by the annotation functions in the GUI and + written to :file:`JobnameLOG`. + + The annotation commands are :ref:`annot`, :ref:`anum`, :ref:`tlabel`, :ref:`slashline`, + :ref:`slashlarc`, :ref:`lsymbol`, :ref:`polygon`, :ref:`pmore`, :ref:`pcircle`, :ref:`pwedge`, + :ref:`tspec`, :ref:`lspec`, and :ref:`slashpspec`. Annotation graphics are relative to the full + Graphics Window and are not affected by Mechanical APDL window-specific commands ( :ref:`window`, + :ref:`view`, etc.). + + This command is valid in any processor. + """ + command = f"/ANNOT,{lab},{val1},{val2}" + return self.run(command, **kwargs) + + def anum( + self, + num: str = "", + type_: int | str = "", + xhot: str = "", + yhot: str = "", + **kwargs, + ): + r"""Specifies the annotation number, type, and hot spot (GUI). + + Mechanical APDL Command: `/ANUM `_ + + **Command default:** + + .. _s-ANUM_default: + + Number, type, and hot spot are automatically determined. + + Parameters + ---------- + num : str + Annotation number. Mechanical APDL automatically assigns the lowest available number. You cannot + assign a higher number if a lower number is available; the program substitutes the lowest + available number in place of any user-specified higher number. + + type_ : int or str + Annotation internal type number. If ``TYPE`` = DELE, delete annotation ``NUM``. + + * ``1`` - Text + + * ``2`` - Block text (not available in GUI) + + * ``3`` - Dimensions + + * ``4`` - Lines + + * ``5`` - Rectangles + + * ``6`` - Circles + + * ``7`` - Polygons + + * ``8`` - Arcs + + * ``9`` - Wedges, pies + + * ``11`` - Symbols + + * ``12`` - Arrows + + * ``13`` - Bitmap + + xhot : str + X hot spot (-1.0 < X < 2.0). Used for menu button item delete. + + yhot : str + Y hot spot (-1.0 < Y < 1.0). Used for menu button item delete. + + Notes + ----- + + .. _s-ANUM_notes: + + This is a command generated by the GUI and will appear in the log file ( :file:`Jobname.LOG` ) if + annotation is used. This command is not intended to be typed in directly in a Mechanical APDL + session + (although it can be included in an input file for batch input or for use with the :ref:`input` + command). + + Type 13 (bitmap) annotation applies user defined bitmaps defined using the FILE option of the + :ref:`txtre` command. + + This command is valid in any processor. + """ + command = f"/ANUM,{num},{type_},{xhot},{yhot}" + return self.run(command, **kwargs) + + def lspec( + self, lcolor: str = "", linstl: int | str = "", xlnwid: str = "", **kwargs + ): + r"""Specifies annotation line attributes (GUI). + + Mechanical APDL Command: `/LSPEC `_ + + Parameters + ---------- + lcolor : str + + linstl : int or str + Line style: + + * ``0`` - Solid line. + + * ``1`` - Dashed line. + + xlnwid : str + Line width multiplier (1.0 to 20.0). Defaults to 1.0. + + Notes + ----- + + .. _s-LSPEC_notes: + + This command specifies annotation line attributes to control certain characteristics of the lines + created via the :ref:`slashline`, :ref:`slashlarc`, :ref:`lsymbol`, :ref:`polygon`, :ref:`pmore`, + :ref:`pcircle`, and :ref:`pwedge` commands. + + The command is generated by the Graphical User Interface (GUI) and appears in the log file ( + :file:`Jobname.LOG` ) if annotation is used. It is not intended to be typed in directly in a + Mechanical APDL session (although it can be included in an input file for batch input or for use + with the + :ref:`input` command). + + This command is valid in any processor. + """ + command = f"/LSPEC,{lcolor},{linstl},{xlnwid}" + return self.run(command, **kwargs) + + def lsymbol( + self, + x: str = "", + y: str = "", + symang: str = "", + symtyp: int | str = "", + symsiz: str = "", + keybmp: str = "", + **kwargs, + ): + r"""Creates annotation symbols (GUI). + + Mechanical APDL Command: `/LSYMBOL `_ + + Parameters + ---------- + x : str + X location for symbol (-1.0 < X < 2.0). + + y : str + Y location for symbol (-1.0 < Y < 1.0). + + symang : str + Symbol orientation angle. + + symtyp : int or str + Symbol type: + + * ``1`` - Arrow. + + * ``2`` - Tee. + + * ``3`` - Circle. + + * ``4`` - Triangle. + + * ``5`` - Star. + + symsiz : str + Symbol size multiplier (0.1 to 20.0). Defaults to 1.0. + + keybmp : str + If ``KEYBMP`` = 1, the annotation is a bitmap. ``SYMTYP`` will then be a number from 1-99, + indicating the bitmap type (see notes), and ``X`` and ``Y`` will define the lower left corner of + the bitmap. The ``SYMANG``, ``SYMSIZ`` arguments are ignored. If ``KEYBMP`` = 0, or blank, then + the argument definitions above apply. + + Notes + ----- + + .. _s-LSYMBOL_notes: + + Defines annotation symbols to be written directly onto the display at a specified location. This is + a command generated by the GUI and will appear in the log file ( :file:`Jobname.LOG` ) if annotation + is used. This command is not intended to be typed in directly in a Mechanical APDL session (although + it can + be included in an input file for batch input or for use with the :ref:`input` command). + + All symbols are shown on subsequent displays unless the annotation is turned off or deleted. Use the + :ref:`lspec` command to set the attributes of the symbol. + + The ``KEYBMP`` argument reads the symtype argument to determine which bitmap to insert. This bitmap + is defined by an integer between 1 and 99. Numbers 1 through 40 correspond to the standard texture + values found in the :ref:`txtre` command, while numbers 51 through 99 correspond to user supplied + bitmaps, as defined using the Filename option of the :ref:`txtre` command. Numbers 51 through 57 are + predefined (the logos, clamps and arrows available from the GUI) but can be overridden. Numbers 41 + through 50 are reserved. + + This command is valid in any processor. + """ + command = f"/LSYMBOL,{x},{y},{symang},{symtyp},{symsiz},{keybmp}" + return self.run(command, **kwargs) + + def pcircle(self, xcentr: str = "", ycentr: str = "", xlrad: str = "", **kwargs): + r"""Creates an annotation circle (GUI). + + Mechanical APDL Command: `/PCIRCLE `_ + + Parameters + ---------- + xcentr : str + Circle X center location (-1.0 < X < 2.0). + + ycentr : str + Circle Y center location (-1.0 < Y < 1.0). + + xlrad : str + Circle radius length. + + Notes + ----- + + .. _s-PCIRCLE_notes: + + Creates an annotation circle to be written directly onto the display at a specified location. This + is a command generated by the Graphical User Interface (GUI) and appears in the log file ( + :file:`Jobname.LOG` ) if annotation is used. + + This command is not intended to be typed in directly in a Mechanical APDL session (although it can + be + included in an input file for batch input or for use with the :ref:`input` command). + + All circles are shown on subsequent displays unless the annotation is turned off or deleted. Issue + :ref:`lspec` and :ref:`slashpspec` to set the attributes of the circle. + + This command is valid in any processor. + """ + command = f"/PCIRCLE,{xcentr},{ycentr},{xlrad}" + return self.run(command, **kwargs) + + def pmore( + self, + x5: str = "", + y5: str = "", + x6: str = "", + y6: str = "", + x7: str = "", + y7: str = "", + x8: str = "", + y8: str = "", + **kwargs, + ): + r"""Creates an annotation polygon (GUI). + + Mechanical APDL Command: `/PMORE `_ + + Parameters + ---------- + + x5 : str + X location for vertex 5 of polygon (-1.0 < X < 2.0). + + y5 : str + Y location for vertex 5 of polygon (-1.0 < Y < 1.0). + + x6 : str + X location for vertex 6 of polygon (-1.0 < X < 2.0). + + y6 : str + Y location for vertex 6 of polygon (-1.0 < Y < 1.0). + + x7 : str + X location for vertex 7 of polygon (-1.0 < X < 2.0). + + y7 : str + Y location for vertex 7 of polygon (-1.0 < Y < 1.0). + + x8 : str + X location for vertex 8 of polygon (-1.0 < X < 2.0). + + y8 : str + Y location for vertex 8 of polygon (-1.0 < Y < 1.0). + + Notes + ----- + + .. _s-PMORE_notes: + + Defines the 5th through 8th vertices of an annotation polygon ( :ref:`polygon` ). This is a command + generated by the Graphical User Interface (GUI) and appears in the log file ( :file:`Jobname.LOG` ) + if annotation is used. + + The command is not intended to be typed in directly in a Mechanical APDL session (although it can be + included in an input file for batch input or for use with the :ref:`input` command). + + This command is valid in any processor. + """ + command = f"/PMORE,,{x5},{y5},{x6},{y6},{x7},{y7},{x8},{y8}" + return self.run(command, **kwargs) + + def polygon( + self, + nvert: str = "", + x1: str = "", + y1: str = "", + x2: str = "", + y2: str = "", + x3: str = "", + y3: str = "", + x4: str = "", + y4: str = "", + **kwargs, + ): + r"""Creates annotation polygons (GUI). + + Mechanical APDL Command: `/POLYGON `_ + + Parameters + ---------- + nvert : str + Number of vertices of polygon (3 :math:`equation not available` ``NVERT`` :math:`equation not + available` 8). Use :ref:`pmore` for polygons with more than 4 vertices. + + x1 : str + X location for vertex 1 of polygon (-1.0 < X < 2.0). + + y1 : str + Y location for vertex 1 of polygon (-1.0 < Y < 1.0). + + x2 : str + X location for vertex 2 of polygon (-1.0 < X < 2.0). + + y2 : str + Y location for vertex 2 of polygon (-1.0 < Y < 1.0). + + x3 : str + X location for vertex 3 of polygon (-1.0 < X < 2.0). + + y3 : str + Y location for vertex 3 of polygon (-1.0 < Y < 1.0). + + x4 : str + X location for vertex 4 of polygon (-1.0 < X < 2.0). + + y4 : str + Y location for vertex 4 of polygon (-1.0 < Y < 1.0). + + Notes + ----- + + .. _s-POLYGON_notes: + + Creates annotation polygons to be written directly onto the display at a specified location. This is + a command generated by the Graphical User Interface (GUI) and will appear in the log file ( + :file:`Jobname.LOG` ) if annotation is used. + + The command is not intended to be typed in directly in a Mechanical APDL session (although it can be + included in an input file for batch input or for use with :ref:`input` ). + + All polygons are shown on subsequent displays unless the annotation is turned off or deleted. Issue + :ref:`lspec` and :ref:`slashpspec` to set the attributes of the polygon. Issue :ref:`pmore` to + define the 5th through 8th vertices of the polygon. + + This command is valid in any processor. + """ + command = f"/POLYGON,{nvert},{x1},{y1},{x2},{y2},{x3},{y3},{x4},{y4}" + return self.run(command, **kwargs) + + def pwedge( + self, + xcentr: str = "", + ycentr: str = "", + xlrad: str = "", + angle1: str = "", + angle2: str = "", + **kwargs, + ): + r"""Creates an annotation wedge (GUI). + + Mechanical APDL Command: `/PWEDGE `_ + + Parameters + ---------- + xcentr : str + Wedge X center location (-1.0 < X < 2.0). + + ycentr : str + Wedge Y center location (-1.0 < Y < 1.0). + + xlrad : str + Wedge radius length. + + angle1 : str + Starting angle of wedge. + + angle2 : str + Ending angle of wedge. The wedge is drawn counterclockwise from the starting angle, ``ANGLE1``, + to the ending angle, ``ANGLE2``. + + Notes + ----- + + .. _s-PWEDGE_notes: + + Creates an annotation wedge to be written directly onto the display at a specified location. This is + a command generated by the Graphical User Interface (GUI) and will appear in the log file ( + :file:`Jobname.LOG` ) if annotation is used. + + The command is not intended to be typed in directly in a Mechanical APDL session (although it can be + included in an input file for batch input or for use with :ref:`input` ). + + All wedges are shown on subsequent displays unless the annotation is disabled or deleted. Issue + :ref:`lspec` and :ref:`slashpspec` to set the attributes of the wedge. + + This command is valid in any processor. + """ + command = f"/PWEDGE,{xcentr},{ycentr},{xlrad},{angle1},{angle2}" + return self.run(command, **kwargs) + + def slashlarc( + self, + xcentr: str = "", + ycentr: str = "", + xlrad: str = "", + angle1: str = "", + angle2: str = "", + **kwargs, + ): + r"""Creates annotation arcs (GUI). + + Mechanical APDL Command: `/LARC `_ + + Parameters + ---------- + xcentr : str + Arc X center location (-1.0 < X < 1.0). + + ycentr : str + Arc Y center location (-1.0 < Y < 1.0). + + xlrad : str + Arc radius length. + + angle1 : str + Starting angle of arc. + + angle2 : str + Ending angle of arc. The arc is drawn counterclockwise from the starting angle, ``ANGLE1``, to + the ending angle, ``ANGLE2``. + + Notes + ----- + + .. _s-LARC_notes: + + This command defines annotation arcs to be written directly onto the display at a specified + location. + + The command is generated by the Graphical User Interface (GUI) and will appear in the log file ( + :file:`Jobname.LOG` ) if annotation is used. It is not intended to be typed in directly in a + Mechanical APDL session (although it can be included in an input file for batch input or for use + with the + :ref:`input` command). + + All arcs are shown on subsequent displays unless the annotation is turned off or deleted. Issueu + :ref:`lspec` to set the attributes of the arc. + + This command is valid in any processor. + """ + command = f"/LARC,{xcentr},{ycentr},{xlrad},{angle1},{angle2}" + return self.run(command, **kwargs) + + def slashline( + self, x1: str = "", y1: str = "", x2: str = "", y2: str = "", **kwargs + ): + r"""Creates annotation lines (GUI). + + Mechanical APDL Command: `/LINE `_ + + Parameters + ---------- + x1 : str + Line X starting location (-1.0 < X < 2.0). + + y1 : str + Line Y starting location (-1.0 < Y < 1.0). + + x2 : str + Line X ending location (-1.0 < X < 2.0). + + y2 : str + Line Y ending location (-1.0 < Y < 1.0). + + Notes + ----- + + .. _s-LINE_notes: + + This command defines annotation lines to be written directly onto the display at a specified + location. + + The command is generated by the Graphical User Interface (GUI) and appears in the log file ( + :file:`Jobname.LOG` ) if annotation is used. It is not intended to be typed in directly in a + Mechanical APDL session (although it can be included in an input file for batch input or for use + with the + :ref:`input` command). + + All lines are shown on subsequent displays unless the annotation is turned off or deleted. Issue + :ref:`lspec` to set the attributes of the line. + + This command is valid in any processor. + """ + command = f"/LINE,{x1},{y1},{x2},{y2}" + return self.run(command, **kwargs) + + def slashpspec( + self, + pcolor: int | str = "", + kfill: int | str = "", + kbordr: int | str = "", + **kwargs, + ): + r"""Creates annotation polygon attributes (GUI). + + Mechanical APDL Command: `/PSPEC `_ + + Parameters + ---------- + pcolor : int or str + Polygon color (0 :math:`equation not available` ``PCOLOR`` :math:`equation not available` 15): + + * ``0`` - Black. + + * ``1`` - Red-Magenta. + + * ``2`` - Magenta. + + * ``3`` - Blue-Magenta. + + * ``4`` - Blue. + + * ``5`` - Cyan-Blue. + + * ``6`` - Cyan. + + * ``7`` - Green-Cyan. + + * ``8`` - Green. + + * ``9`` - Yellow-Green. + + * ``10`` - Yellow. + + * ``11`` - Orange. + + * ``12`` - Red. + + * ``13`` - Dark Gray. + + * ``14`` - Light Gray. + + * ``15`` - White. + + kfill : int or str + Polygon fill key: + + * ``0`` - Hollow polygon. + + * ``1`` - Filled polygon. + + kbordr : int or str + Polygon border key: + + * ``0`` - No border. + + * ``1`` - Border. + + Notes + ----- + + .. _s-PSPEC_notes: + + Creates annotation polygon attributes to control certain characteristics of the polygons created via + :ref:`polygon`, :ref:`pmore`, :ref:`pcircle`, and :ref:`pwedge`. + + This command is generated by the graphical user interface (GUI) and appears in the log file ( + :file:`Jobname.LOG` ) if annotation is used. It is not intended to be typed in directly in a + Mechanical APDL session (although it can be included in an input file for batch input or for use + with + :ref:`input` ). + + This command is valid in any processor. + """ + command = f"/PSPEC,{pcolor},{kfill},{kbordr}" + return self.run(command, **kwargs) + + def tlabel(self, xloc: str = "", yloc: str = "", text: str = "", **kwargs): + r"""Creates annotation text (GUI). + + Mechanical APDL Command: `/TLABEL `_ + + Parameters + ---------- + xloc : str + Text ``X`` starting location (-1.0 < ``X`` < 1.6). + + yloc : str + Text Y starting location (-1.0 < ``Y`` < 1.0). + + text : str + Text string (60 characters maximum). Parameter substitution may be forced within the text by + enclosing the parameter name or parametric expression within percent (%) signs. + + Notes + ----- + + .. _s-TLABEL_notes: + + Defines annotation text to be written directly onto the display at a specified location. This + command is generated by the Graphical User Interface (GUI) and appears in the log file ( + :file:`Jobname.LOG` ) if annotation is used. + + The command is not intended to be typed in directly in a Mechanical APDL session (although it can be + included in an input file for batch input or for use with :ref:`input` ). + + All text is shown on subsequent displays unless the annotation is disabled or deleted. Issue + :ref:`tspec` to set the attributes of the text. + + This command is valid in any processor. + """ + command = f"/TLABEL,{xloc},{yloc},{text}" + return self.run(command, **kwargs) + + def tspec( + self, + tcolor: int | str = "", + tsize: str = "", + txthic: int | str = "", + pangle: str = "", + iangle: str = "", + **kwargs, + ): + r"""Creates annotation text attributes (GUI). + + Mechanical APDL Command: `/TSPEC `_ + + Parameters + ---------- + tcolor : int or str + Text color (0 :math:`equation not available` ``TCOLOR`` :math:`equation not available` 15): + + * ``0`` - Black. + + * ``1`` - Red-Magenta. + + * ``2`` - Magenta. + + * ``3`` - Blue-Magenta. + + * ``4`` - Blue. + + * ``5`` - Cyan-Blue. + + * ``6`` - Cyan. + + * ``7`` - Green-Cyan. + + * ``8`` - Green. + + * ``9`` - Yellow-Green. + + * ``10`` - Yellow. + + * ``11`` - Orange. + + * ``12`` - Red. + + * ``13`` - Dark Gray. + + * ``14`` - Light Gray. + + * ``15`` - White. + + tsize : str + Text size factor. + + txthic : int or str + Text thickness key: + + * ``1`` - normal. + + * ``2`` - twice as thick. + + * ``3`` - three times as thick. + + * ``4`` - four times as thick. + + pangle : str + Text path angle (0.0 < ``angle`` < 360.0). + + iangle : str + Text italic angle (0.0 < ``angle`` < 45.0). + + Notes + ----- + + .. _s-TSPEC_notes: + + This command defines annotation text attributes to control certain characteristics of the text + created via :ref:`tlabel`. This command is generated by the Graphical User Interface (GUI) and + appears in the log file ( :file:`Jobname.LOG` ) if annotation is used. + + The command is not intended to be typed in directly in a Mechanical APDL session (although it can be + included in an input file for batch input or for use with :ref:`input` ). + + This command is valid in any processor. + """ + command = f"/TSPEC,{tcolor},{tsize},{txthic},{pangle},{iangle}" + return self.run(command, **kwargs) diff --git a/src/ansys/mapdl/core/_commands/graphics/graphs.py b/src/ansys/mapdl/core/_commands/graphics/graphs.py new file mode 100644 index 00000000000..f6e1e89e241 --- /dev/null +++ b/src/ansys/mapdl/core/_commands/graphics/graphs.py @@ -0,0 +1,341 @@ +# Copyright (C) 2016 - 2025 ANSYS, Inc. and/or its affiliates. +# SPDX-License-Identifier: MIT +# +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to deal +# in the Software without restriction, including without limitation the rights +# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +# copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in all +# copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +# SOFTWARE. + + +class Graphs: + + def axlab(self, axis: str = "", lab: str = "", **kwargs): + r"""Labels the X and Y axes on graph displays. + + Mechanical APDL Command: `/AXLAB `_ + + **Command default:** + + .. _s-AXLAB_default: + + Labels are determined by the program. + + Parameters + ---------- + axis : str + Axis specifier: + + * ``X`` - Apply label to X axis. + + * ``Y`` - Apply label to Y axis. + + lab : str + Axis label (user defined text up to 30 characters long). Leave blank to reestablish the default + for ``Axis`` axis. + + Notes + ----- + + .. _s-AXLAB_notes: + + This command is valid in any processor. + """ + command = f"/AXLAB,{axis},{lab}" + return self.run(command, **kwargs) + + def grid(self, key: str = "", **kwargs): + r"""Selects the type of grid on graph displays. + + Mechanical APDL Command: `/GRID `_ + + Parameters + ---------- + key : str + Grid key: + + * ``0 (OFF)`` - No grid. + + * ``1 (ON)`` - Full grid (X and Y grid lines). + + * ``2 (X)`` - Partial grid (X grid lines only). + + * ``3 (Y)`` - Partial grid (Y grid lines only) + + Notes + ----- + + .. _s-GRID_notes: + + Selects the type of grid on graph displays. Graphs with multiple Y-axes can have multiple grids ( + :ref:`grtyp` ). The grid of the first curve is also used as the background grid (above and behind + the curve). Grids for other curves are limited to be under the curves. See also :ref:`gthk` and + :ref:`gropt` for other grid options. + + This command is valid in any processor. + """ + command = f"/GRID,{key}" + return self.run(command, **kwargs) + + def gropt(self, lab: str = "", key: str = "", **kwargs): + r"""Sets various line graph display options. + + Mechanical APDL Command: `/GROPT `_ + + Parameters + ---------- + lab : str + Apply display style as selected from the following labels: + + * ``AXDV`` - Axis division (tick) marks (defaults to ``KEY`` = ON). + + * ``AXNM`` - Axis scale numbers (defaults to ``KEY`` = ON, which puts numbers at the back plane of + the graph). If ``KEY`` = FRONT, numbers are on the front plane of the graph. + + * ``AXNSC`` - Axis number size scale factor. Input the scale value for ``KEY`` (defaults to 1.0). + + * ``ASCAL`` - Automatic scaling of additional Y-axes for multi-curve ( :ref:`grtyp`, 2 or 3) graphs + (defaults to ``KEY`` = ON). If ``KEY`` = OFF, use base Y-axis scaling (see the :ref:`yrange` + command). + + * ``LOGX`` - Log X scale (defaults to ``KEY`` = OFF (linear)). + + * ``LOGY`` - Log Y scale (applies only to the base Y axis) (defaults to ``KEY`` = OFF (linear)). + + * ``FILL`` - Color fill areas under curves (defaults to ``KEY`` = OFF). + + * ``CGRID`` - Superimpose background grid ( :ref:`grid` ) over areas under filled curves (defaults + to ``KEY`` = OFF). + + * ``DIG1`` - Number of significant digits before decimal point for axis values. Input the value for + ``KEY`` (defaults to 4). + + * ``DIG2`` - Number of significant digits after decimal point for axis values. Input the value for + ``KEY`` (defaults to 3). + + * ``VIEW`` - View key for graph displays (defaults to ``KEY`` = OFF, in which case the view is + (0,0,1) for 2D graph displays or (1,2,3) for 3D graph displays). If ``KEY`` = ON, the view settings + for graph displays are the same as the view settings for the model. + + * ``REVX`` - Plots the values on the X-axis in reverse order. + + * ``REVY`` - Plots the values on the Y-axis in reverse order. + + * ``DIVX`` - Determines the number of divisions (grid markers) that will be plotted on the X axis. + + * ``DIVY`` - Determines the number of divisions (grid markers) that will be plotted on the Y axis. + + * ``LTYP`` - Specifies whether program-generated ( ``KEY`` = 1) or system-derived ( ``KEY`` = 0) + fonts are used for the axis labels. + + * ``CURL`` - Determines the position of the curve labels. If ( ``KEY`` = 1), the curve label will be + plotted in the legend column, and the label will be displayed in the same color as the curve. If ( + ``KEY`` = 0) the curve labels will be plotted near the curve. (default). + + * ``XAXO`` - When you use this label, the subsequent ``KEY`` value will determine an offset amount + from the default (along the bottom) location for the X axis. If ``KEY`` = 1.0, a full offset occurs + (the X axis is moved to the top of the graph). If ``KEY`` = 0.5, the axis is offset to the midpoint + of the graph, and if ``KEY`` = 0 the axis remains in the original position, along the bottom of the + graph. For any offset, a grey copy of the original axis (containing the axis numbering) remains at + the original location. + + * ``YAXO`` - When you use this label, the subsequent ``KEY`` value will determine an offset amount + from the default (along the left side of the graph) location for the Y axis. If ``KEY`` = 1.0, a + full offset occurs (the Y axis is moved to the right side of the graph). If ``KEY`` = 0.5, the axis + is offset to the midpoint of the graph, and if ``KEY`` = 0 the axis remains in the original + position, along the left side of the graph. For any offset, a gray copy of the original axis + (containing the axis numbering) remains at the original location. + + key : str + Option values: + + * ``OFF (0)`` - Do not apply selected style. + + * ``ON (1)`` - Apply selected style. + + * ``nnnn`` - If ``Lab`` is DIG1 or DIG2, input the number of digits. + + * ``nn`` - If ``Lab`` is AXNSC, input the scale factor. + + * ``FRONT`` - If ``Lab`` is AXNM, FRONT may also be input. + + * ``Ndiv`` - If ``Lab`` is DIVX or DIVY, determines the number of divisions (1-99) that will be + applied to the axis. + + * ``Kfont`` - If ``Lab`` is LTYP, ``Kfont`` is ON (1) or OFF(0). ON uses program-generated fonts for + the axis labels, while OFF uses SYSTEM (Windows, X-system, etc.) fonts. Default: ``Kfont`` = ON + (Mechanical APDL fonts). + + Notes + ----- + + .. _s-GROPT_notes: + + Sets various line graph display options. Issue :ref:`gropt`,STAT to display the current settings. + + Issue :ref:`gropt`,DEFA to reset default specifications. + + Unless you issue :ref:`gropt`,VIEW,ON, the program indicates that graph-view manipulation is + inactive. + + See :ref:`axlab`, :ref:`grtyp`, :ref:`grid`, and :ref:`gthk` for other graph-control options. + + Automatic scaling using the :ref:`xrange` and :ref:`yrange` commands often yields inappropriate + range values for logarithmic scales ( :ref:`gropt`, LOGX or :ref:`gropt`, LOGY). + + This command is valid in any processor. + """ + command = f"/GROPT,{lab},{key}" + return self.run(command, **kwargs) + + def grtyp(self, kaxis: int | str = "", **kwargs): + r"""Selects single or multiple Y-axes graph displays. + + Mechanical APDL Command: `/GRTYP `_ + + Parameters + ---------- + kaxis : int or str + Axis selection key: + + * ``0 or 1`` - Single Y-axis. Up to 10 curves scaled to a single Y-axis. + + * ``2`` - Additional Y-axes (one for each curve) (3 curves maximum). Allows better scaling of curves + with widely differing numbering ranges. + + * ``3`` - Same as 2 but with additional Y-axis and curves projected out of the plane (6 curves + maximum). Allows clearer display with an isometric view. The default view when ``KAXIS`` = 3 is + View,1,1,2,3. + + Notes + ----- + + .. _s-GRTYP_notes: + + The basic line graph has one or more curves plotted against the same Y and X axes. Multiple curve + graphs can also be plotted with individual Y axes and the same X axis. The Y axis of the first curve + is referred to as the base Y-axis and the Y axes of the other curves as additional Y axes. Curves + are numbered sequentially from 1 (the base curve) in the order in which they are displayed. See the + :ref:`axlab`, :ref:`gropt`, :ref:`grid`, and :ref:`gthk` commands for other display options. + + This command is valid in any processor. + """ + command = f"/GRTYP,{kaxis}" + return self.run(command, **kwargs) + + def gthk(self, label: str = "", thick: int | str = "", **kwargs): + r"""Sets line thicknesses for graph lines. + + Mechanical APDL Command: `/GTHK `_ + + Parameters + ---------- + label : str + Apply thicknesses as selected from the following labels: + + * ``AXIS`` - Modify thickness of ordinate and abscissa axes on graph displays. + + * ``GRID`` - Modify thickness of grid lines on graph displays. + + * ``CURVE`` - Modify thickness of curve lines (when no area fill ( :ref:`gropt` )). + + thick : int or str + Thickness ratio (whole numbers only, from -1 to 10): + + * ``-1`` - Do not draw the curve, but show only the markers specified by :ref:`gmarker`. + + * ``0 or 1`` - Thin lines. + + * ``2`` - The default thickness. + + * ``3`` - 1.5 times the default thickness. + + * ``etc.`` - (up to 10) + + Notes + ----- + + .. _s-GTHK_notes: + + Sets line thicknesses for graph lines (in raster mode only). Use :ref:`gthk`,STAT to show settings. + + This command is valid in any processor. + """ + command = f"/GTHK,{label},{thick}" + return self.run(command, **kwargs) + + def xrange(self, xmin: str = "", xmax: str = "", **kwargs): + r"""Specifies a linear abscissa (X) scale range. + + Mechanical APDL Command: `/XRANGE `_ + + Parameters + ---------- + xmin : str + Minimum abscissa scale value. + + xmax : str + Maximum abscissa scale value. + + Notes + ----- + + .. _s-XRANGE_notes: + + Specifies a linear abscissa (X) scale range for the line graph display. Use :ref:`xrange`,DEFAULT to + return to automatic scaling. + + Automatic scaling will often yield inappropriate range values for logarithmic scales ( :ref:`gropt`, + LOGX). + + This command is valid in any processor. + """ + command = f"/XRANGE,{xmin},{xmax}" + return self.run(command, **kwargs) + + def yrange(self, ymin: str = "", ymax: str = "", num: str = "", **kwargs): + r"""Specifies a linear ordinate (Y) scale range. + + Mechanical APDL Command: `/YRANGE `_ + + Parameters + ---------- + ymin : str + Minimum ordinate scale value. + + ymax : str + Maximum ordinate scale value. + + num : str + Y-axis number to which range applies (defaults to 1). Valid numbers are 1 to 3 for + :ref:`grtyp`,2 and 1 to 6 for :ref:`grtyp`,3. If ALL, apply to all Y-axes. + + Notes + ----- + + .. _s-YRANGE_notes: + + Specifies a linear ordinate (Y) scale range for the line graph display. Use :ref:`yrange`,DEFAULT to + return to automatic scaling. For multiple Y-axes graphs ( :ref:`grtyp` ), see :ref:`gropt`, ASCAL to + automatically scale the additional Y-axes. + + Automatic scaling will often yield inappropriate range values for logarithmic scales ( :ref:`gropt`, + LOGY). + + This command is valid in any processor. + """ + command = f"/YRANGE,{ymin},{ymax},{num}" + return self.run(command, **kwargs) diff --git a/src/ansys/mapdl/core/_commands/graphics/labeling.py b/src/ansys/mapdl/core/_commands/graphics/labeling.py new file mode 100644 index 00000000000..7fe630dcf1c --- /dev/null +++ b/src/ansys/mapdl/core/_commands/graphics/labeling.py @@ -0,0 +1,1251 @@ +# Copyright (C) 2016 - 2025 ANSYS, Inc. and/or its affiliates. +# SPDX-License-Identifier: MIT +# +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to deal +# in the Software without restriction, including without limitation the rights +# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +# copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in all +# copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +# SOFTWARE. + + +class Labeling: + + def cformat(self, nfirst: str = "", nlast: str = "", **kwargs): + r"""Controls the graphical display of alphanumeric character strings for parameters, components, + assemblies, and tables. + + Mechanical APDL Command: `/CFORMAT `_ + + Parameters + ---------- + nfirst : str + Display the first ``n`` characters of the parameter, component, assembly, or table name, up to + 32. Defaults to 32. + + nlast : str + Display the last ``n`` characters of the parameter, component, assembly, or table name, up to + 32. Defaults to 0. + + Notes + ----- + + .. _s-CFORMAT_notes: + + Use this command to control the length of the character string that is shown in the graphics window + for a parameter, component, assembly, or table name. + + The total number of characters ( ``NFIRST`` + ``NLAST`` +3) cannot exceed 32. + + If ``NFIRST`` is greater than zero and ``NLAST`` = 0, only the ``NFIRST`` characters are displayed, + followed by an ellipsis. + + If ``NFIRST`` = 0 and ``NLAST`` is greater than zero, only the ``NLAST`` characters are displayed, + preceded by an ellipsis (...). + + If both ``NFIRST`` and ``NLAST`` are greater than zero, the name will be shown as ``NFIRST``, + followed by an ellipsis (...), followed by ``NLAST``, up to a maximum of 32 characters. + + For example, if ``NFIRST`` = 6 and ``NLAST`` = 3, and the character string is LENGTHOFSIDEONE, then + it will appear in the graphics window as LENGTH...ONE. + + If the actual length of the character string is less than the specified combination of ``NFIRST`` + + ``NLAST`` +3, then the actual string will be used. + + This command is valid in any processor. + """ + command = f"/CFORMAT,{nfirst},{nlast}" + return self.run(command, **kwargs) + + def clabel(self, wn: str = "", key: int | str = "", **kwargs): + r"""Specifies contour labeling. + + Mechanical APDL Command: `/CLABEL `_ + + **Command default:** + + .. _s-CLABEL_default: + + Show contour line labels. + + Parameters + ---------- + wn : str + Window number (or ALL) to which command applies (defaults to 1). + + key : int or str + Labeling key: + + * ``0 or 1`` - Label contours with legend or color (default). + + * ``-1`` - No contour labeling. + + * ``N`` - Same as 1 except show alphabetic legend only on every ``N`` th element. + + Notes + ----- + + .. _s-CLABEL_notes: + + Labels contours for identification with alphabetic legend for vector displays and color for raster + displays. Number of contours is automatically reduced to 9 (or fewer) for clarity. Use + :ref:`contour` command to increase (24 maximum for alphabetic labeling; no limit for color + labeling). + + This command is valid in any processor. + """ + command = f"/CLABEL,{wn},{key}" + return self.run(command, **kwargs) + + def contour( + self, + wn: str = "", + ncont: str = "", + vmin: str = "", + vinc: str = "", + vmax: str = "", + **kwargs, + ): + r"""Specifies the uniform contour values on stress displays. + + Mechanical APDL Command: `/CONTOUR `_ + + **Command default:** + + .. _s-CONTOUR_default: + + Nine contour values uniformly spaced between the extreme values, or no contours if the ratio of + range to minimum value (or range to maximum if minimum = 0) is less than 0.001. + + Parameters + ---------- + wn : str + Window number (or ALL) to which command applies (defaults to 1). + + ncont : str + Number of contour values. ``NCONT`` defaults to 9 for X11 or WIN32 and to 128 for X11c or + WIN32C. The default graphics window display for 3D devices is a smooth continuous shading effect + that spans the maximum of 128 contours available. Use the :ref:`dv3d` command to create defined + banding for your contour values (values of 9 and 128 are displayed in smooth shading only). The + legend, however, will display only nine color boxes, which span the full range of colors + displayed in the graphics window. + + vmin : str + Minimum contour value. If ``VMIN`` = AUTO, automatically calculate contour values based upon + ``NCONT`` uniformly spaced values over the min-max extreme range. Or, if ``VMIN`` = USER, set + contour values to those of the last display (useful when last display automatically calculated + contours). + + vinc : str + Value increment (positive) between contour values. Defaults to ( ``VMAX`` - ``VMIN`` ) + ``/NCONT``. + + vmax : str + Maximum contour value. Ignored if both ``VMIN`` and ``VINC`` are specified. + + Notes + ----- + + .. _s-CONTOUR_notes: + + Values represent contour lines in vector mode, and the algebraic maximum of contour bands in raster + mode. + + Regardless of how many contours ( ``NCONT`` ) are specified, the actual number of contours appearing + on your display depends also on the device name, whether the display is directed to the screen or to + a file, the display mode (vector or raster), and the number of color planes. (All of those items are + controlled via :ref:`show`.) In any case, regardless of whether they are smoothed or banded, only + 128 contours can be displayed. + + For more information about changing the number of contours, see `Creating Geometric Results Displays + `_. + + When the current Mechanical APDL graphics are not displayed as Multi-Plots: + + * If the current device is a 3D device ( :ref:`show`,3D), the model contours in all active windows + are the same, even if separate :ref:`contour` commands are issued for each active window. + * Mechanical APDL maintains a single data structure (segment) containing one set of contours. The + program + displays the same segment in all windows. The view settings of each window constitute the only + differences in the contour plots in the active windows. + + This command is valid in any processor. + + For alternate specifications, see :ref:`cval`. + """ + command = f"/CONTOUR,{wn},{ncont},{vmin},{vinc},{vmax}" + return self.run(command, **kwargs) + + def cval( + self, + wn: str = "", + v1: str = "", + v2: str = "", + v3: str = "", + v4: str = "", + v5: str = "", + v6: str = "", + v7: str = "", + v8: str = "", + **kwargs, + ): + r"""Specifies nonuniform contour values on stress displays. + + Mechanical APDL Command: `/CVAL `_ + + **Command default:** + + .. _s-CVAL_default: + + Nine contour values uniformly spaced between the extreme values. + + Parameters + ---------- + wn : str + Window number (or ALL) to which command applies (defaults to 1). + + v1 : str + Up to 8 contour values may be specified (in ascending order). The 0.0 value (if any) must not be + the last value specified. If no values are specified, all contour specifications are erased and + contours are automatically calculated. + + v2 : str + Up to 8 contour values may be specified (in ascending order). The 0.0 value (if any) must not be + the last value specified. If no values are specified, all contour specifications are erased and + contours are automatically calculated. + + v3 : str + Up to 8 contour values may be specified (in ascending order). The 0.0 value (if any) must not be + the last value specified. If no values are specified, all contour specifications are erased and + contours are automatically calculated. + + v4 : str + Up to 8 contour values may be specified (in ascending order). The 0.0 value (if any) must not be + the last value specified. If no values are specified, all contour specifications are erased and + contours are automatically calculated. + + v5 : str + Up to 8 contour values may be specified (in ascending order). The 0.0 value (if any) must not be + the last value specified. If no values are specified, all contour specifications are erased and + contours are automatically calculated. + + v6 : str + Up to 8 contour values may be specified (in ascending order). The 0.0 value (if any) must not be + the last value specified. If no values are specified, all contour specifications are erased and + contours are automatically calculated. + + v7 : str + Up to 8 contour values may be specified (in ascending order). The 0.0 value (if any) must not be + the last value specified. If no values are specified, all contour specifications are erased and + contours are automatically calculated. + + v8 : str + Up to 8 contour values may be specified (in ascending order). The 0.0 value (if any) must not be + the last value specified. If no values are specified, all contour specifications are erased and + contours are automatically calculated. + + Notes + ----- + + .. _s-CVAL_notes: + + This command is similar to the :ref:`contour` command. With :ref:`cval`, however, you define the + upper level of each contour band instead of having the contours uniformly distributed over the + range. The minimum value (including a zero value for the first band) for a contour band cannot be + specified. If you use both :ref:`contour` and :ref:`cval`, the last command issued takes precedence. + + This command is valid in any processor. + """ + command = f"/CVAL,{wn},{v1},{v2},{v3},{v4},{v5},{v6},{v7},{v8}" + return self.run(command, **kwargs) + + def gformat(self, ftype: str = "", nwidth: str = "", dsignf: str = "", **kwargs): + r"""Specifies the format for the graphical display of numbers. + + Mechanical APDL Command: `/GFORMAT `_ + + Parameters + ---------- + ftype : str + FORTRAN format types (G is the default if this field is left blank.) + + * ``G`` - G ``xx``. ``yy``. ``xx`` and ``yy`` are described below. + + * ``F`` - F ``xx``. ``yy`` + + * ``E`` - E ``xx``. ``yy`` + + nwidth : str + Total width (12 maximum) of the field (the ``xx`` in ``Ftype`` ). Defaults to 12. + + dsignf : str + Number of digits after the decimal point ( ``yy`` in F or E format) or number of significant + digits in G format. Range is 1 to ``xx`` -6 for ``Ftype`` = G or E; and 0 to ``xx`` -3 for + ``Ftype`` = F. The default is a function of ``Ftype`` and ``NWIDTH``. + + Notes + ----- + + .. _s-GFORMAT_notes: + + Enables you to control the format of the graphical display of floating point numbers. + + To display the current settings, issue :ref:`gformat`,STAT.. + + To allow Mechanical APDL to select the format for the graphical display of floating numbers, issue + :ref:`gformat`,DEFA. + + This command is valid in any processor. + """ + command = f"/GFORMAT,{ftype},{nwidth},{dsignf}" + return self.run(command, **kwargs) + + def hbc(self, wn: str = "", key: str = "", **kwargs): + r"""Determines how boundary condition symbols are displayed in a display window. + + Mechanical APDL Command: `/HBC `_ + + Parameters + ---------- + wn : str + Window reference number. This number can be any window numbered 1 to 5, or ALL (for all active + windows). Default = 1. + + key : str + Controls hidden-surface boundary condition display behavior: + + ON, YES or 1 = Enable - Your boundary condition symbols are processed by the hidden-surface + algorithm (for 2D graphics devices) and use an improved pressure-contour display (for 2D and 3D + graphics devices). + + OFF, NO or 0 (default) = Disable (default) - Your boundary condition symbols are not processed + by the hidden-surface algorithm.. + + Notes + ----- + + .. _s-HBC_notes: + + With :ref:`hbc`, ``WN``,ON in effect, Mechanical APDL does not display symbols obscured by the model + in the + current view (that is, symbols inside of or behind the model are not drawn). This behavior lessens + display clutter. + """ + command = f"/HBC,{wn},{key}" + return self.run(command, **kwargs) + + def number(self, nkey: int | str = "", **kwargs): + r"""Specifies whether numbers, colors, or both are used for displays. + + Mechanical APDL Command: `/NUMBER `_ + + Parameters + ---------- + nkey : int or str + Numbering style: + + * ``0`` - Color (terminal dependent) the numbered items and show numbers. + + * ``1`` - Color the numbered items. Do not show the numbers. + + * ``2`` - Show the numbers. Do not color the items. + + * ``-1`` - Do not color the items or show the numbers. For contour plots, the resulting display will + vary (see below). + + Notes + ----- + + .. _s-NUMBER_notes: + + Specifies whether numbers, colors, or both are used for numbering displays ( :ref:`pnum` ) of nodes, + elements, keypoints, lines, areas, and volumes. + + Shading is also available for terminals configured with more than 4 color planes ( :ref:`show` ). + Color automatically appears for certain items and may be manually controlled (off or on) for other + items. + + When you suppress color ( ``NKEY`` = -1) your contour plots will produce different results, + depending on your graphics equipment. For non-3D devices (X11, Win32, etc.) your contour plot will + be white (no color). For 3D devices, such as OpenGL, the resulting display will be in color. + + The following items are automatically given discrete colors: Boundary condition symbols ( :ref:`pbc` + ), curves on graph displays, and distorted geometry on postprocessing displays. Contour lines in + postprocessing displays are automatically colored based upon a continuous, rather than a discrete, + spectrum so that red is associated with the highest contour value. On terminals with raster + capability ( :ref:`show` ), the area between contour lines is filled with the color of the higher + contour. + + Explicit entity colors or the discrete color mapping may be changed with the :ref:`color` command. + + This command is valid in any processor. + """ + command = f"/NUMBER,{nkey}" + return self.run(command, **kwargs) + + def pbc( + self, + item: str = "", + key: int | str = "", + min_: str = "", + max_: str = "", + abs_: str = "", + **kwargs, + ): + r"""Shows boundary condition (BC) symbols and values on displays. + + Mechanical APDL Command: `/PBC `_ + + **Command default:** + + .. _s-PBC_default: + + No symbols displayed. + + Parameters + ---------- + item : str + Label identifying the item: + + * ``U`` - Applied translational constraints (UX, UY, UZ). + + * ``ROT`` - Applied rotational constraints (ROTX, ROTY, ROTZ). + + * ``TEMP`` - Applied temperatures (TEMP, TBOT, TE2, TE3,..., TTOP). + + * ``PRES`` - Applied fluid pressures. + + * ``V`` - Applied flow velocities (VX, VY, VZ). + + * ``VOLT`` - Applied voltages. + + * ``MAG`` - Applied scalar magnetic potentials. + + * ``A`` - Applied vector magnetic potentials. + + * ``CONC`` - Concentration. + + * ``CHRG`` - Applied electric charge. + + * ``F or FORC`` - Applied structural forces (FX, FY, FZ). + + * ``M or MOME`` - Applied structural moments (MX, MY, MZ). + + * ``HEAT`` - Applied heat flows (HEAT, HBOT, HE2, HE3,..., HTOP). + + * ``FLOW`` - Applied fluid flow. + + * ``AMPS`` - Applied current flow. + + * ``FLUX`` - Applied magnetic flux. + + * ``CSG`` - Applied magnetic current segments. + + * ``RATE`` - Diffusion flow rate. + + * ``MAST`` - Master degrees of freedom. + + * ``CP`` - Coupled nodes. + + * ``CE`` - Nodes in constraint equations. + + * ``NFOR`` - POST1 nodal forces. + + * ``NMOM`` - POST1 nodal moments + + * ``RFOR`` - POST1 reaction forces. + + * ``RMOM`` - POST1 reaction moments (MX, MY, MZ). + + * ``PATH`` - Path geometry (undistorted) associated with the :ref:`path` command after a :ref:`pdef` + or :ref:`pvect` command has been issued. + + * ``ACEL`` - Global acceleration (ACELX, ACELY, ACELZ vector). + + * ``OMEG`` - Global angular velocity (OMEGX, OMEGY, OMEGZ vector) and acceleration (DOMEGX, DOMEGY, + DOMEGZ vector). + + * ``ALL`` - Represents all appropriate labels. + + key : int or str + Symbol key: + + * ``0`` - Do not show symbol. + + * ``1`` - Show symbol. + + * ``2`` - Plot value next to symbol. + + min_ : str + Minimum value in a range of values plotted on screen. + + max_ : str + Maximum value in a range of values plotted on screen. + + abs_ : str + Absolute number. If ``KEY`` = 2 and ``ABS`` = 0, a number falling between the ``MIN`` and + ``MAX`` is displayed. If ``ABS`` is not specified, it defaults to 0. If ``KEY`` = 2 and ``ABS`` + = 1, an absolute value falling between the ``MIN`` and ``MAX`` is displayed. ``ABS`` = 1 lets + you eliminate the display of numbers whose absolute values are less than a desired tolerance. + For example, if ``ABS`` = 1, ``MIN`` = 10 and ``MAX`` = 1e8, values such as.83646 and -5.59737 + are not displayed. + + Notes + ----- + + .. _s-PBC_notes: + + The **/PBC** command adds degree of freedom constraint, force load, and other symbols to displays. + + Symbols are applied to the selected nodes only. All arrow and arrowhead symbols are oriented in the + nodal coordinate system and lie in two perpendicular planes. Force arrows are scaled proportional to + their magnitude. (If ``KEY`` = 1, use :ref:`vscale` to change arrow length.) For scalar quantities, + the specific component direction (that is, x, y, or z) of the symbol has no meaning, but the + positive or negative sense (for example, positive or negative x) represents a positive or negative + scalar value, respectively. + + The effects of the **/PBC** command are not cumulative (that is, the command does not modify an + existing setting from a + previously issued **/PBC** command). If you issue multiple **/PBC** commands during an analysis, + only the setting specified by the most recent :ref:`pbc` command applies. + + Use :ref:`pstatus` or :ref:`pbc`,STAT to display settings. Use :ref:`pbc`,DEFA to reset all + specifications back to default. See the :ref:`psf` and :ref:`pbf` commands for other display + symbols. + + In a `cyclic symmetry analysis + `_, the + :ref:`pbc` command is deactivated when `cyclic expansion + `_ + is active ( :ref:`cycexpand`,,ON). To view boundary conditions on the `base sector + `_, + deactivate cyclic expansion ( :ref:`cycexpand`,,OFF) and issue this command: :ref:`pbc`,ALL,,1 + + + Issuing the command :ref:`pbc`,PATH,,1 displays all defined paths. + + The :ref:`pbc` command is valid in any processor. + """ + command = f"/PBC,{item},,{key},{min_},{max_},{abs_}" + return self.run(command, **kwargs) + + def pbf(self, item: str = "", key: int | str = "", **kwargs): + r"""Shows magnitude of body-force loads on displays. + + Mechanical APDL Command: `/PBF `_ + + **Command default:** + + .. _s-PBF_default: + + No body-force load contours displayed. + + Parameters + ---------- + item : str + Label identifying the item: + + * ``TEMP`` - Applied temperatures. + + * ``FLUE`` - Applied fluences. + + * ``HGEN`` - Applied heat generation rates. + + * ``JS`` - Applied current density magnitude. + + * ``JSX`` - X-component of current density. + + * ``JSY`` - Y-component of current density. + + * ``JSZ`` - Z-component of current density. + + * ``PHASE`` - Phase angle of applied load. + + * ``MVDI`` - Applied magnetic virtual displacements flag. + + * ``CHRGD`` - Applied electric charge density. + + key : int or str + Symbol key: + + * ``0`` - Do not show body-force load contours. + + * ``1`` - Show body-force load contours. + + * ``2`` - Show current density as a vector (not a contour). + + Notes + ----- + + .. _s-PBF_notes: + + Shows body-force loads as contours on displays for the selected elements. + + The effects of the **/PBF** command are not cumulative (that is, the command does not modify an + existing setting from a + previously issued **/PBF** command). If you issue multiple **/PBF** commands during an analysis, + only the setting specified by the most recent :ref:`pbf` command applies. + + Use :ref:`pstatus` or :ref:`pbf`,STAT to display settings. Use :ref:`pbf`,DEFA to reset all + specifications back to default. See also the :ref:`psf` and :ref:`pbc` command for other display + contours. + + Portions of this command are not supported by PowerGraphics ( :ref:`graphics`,POWER). + + This command is valid in any processor. + """ + command = f"/PBF,{item},,{key}" + return self.run(command, **kwargs) + + def plopts(self, label: str = "", key: int | str = "", **kwargs): + r"""Controls graphics options on subsequent displays. + + Mechanical APDL Command: `/PLOPTS `_ + + **Command default:** + + .. _s-PLOPTS_default: + + See individual label defaults. + + The Multi-legend mode ( :ref:`plopts`,INFO,3) is the default for contour legend displays. + + Parameters + ---------- + label : str + Apply display items as selected from the following labels: + + * ``INFO`` - Controls the display of the legend (ON or OFF) and allows the choice of preset or + Multi-legend placement. Control is provided by the ``KEY`` values. (Defaults to ``KEY`` =3 when the + GUI is on. Defaults to ``KEY`` = 2 otherwise.) + + * ``LEG1`` - Header portion of legend column (defaults to ON). + + * ``LEG2`` - View portion of legend column (defaults to ON (except off with contour displays)). + + * ``LEG3`` - View the contour section of the legend column (defaults to ON). + + * ``FRAME`` - Frame border lines around windows (defaults to ON). + + * ``TITLE`` - Title (bottom left text) (defaults to ON). + + * ``MINM`` - Min-Max symbols on contour displays (defaults to ON). + + * ``LOGO`` - Ansys logo (defaults to OFF (displayed as text at top of legend column)). If + ``KEY`` = ON, the text is removed from legend column but the logo symbol is displayed in whichever + active window is either in the uppermost right corner and on top, or if there is no window in that + location, then in the window to the furthest right of the screen. Version information remains in the + legend column. + + * ``WINS`` - Controls whether graphics windows automatically stretch or shrink to adjust to screen + size as the legend column is turned off or on ( :ref:`plopts`,INFO) (defaults to ON). If WINS is on + and the legend column is changed from off to on, all windows are shrunk regardless of what their + correct size is. + + * ``WP`` - Working plane (defaults to OFF). The working plane is drawn as part of the display ( not + just an overlaid image as in :ref:`wpstyl` ). This option is best used in combination with a hidden- + line technique ( :ref:`slashtype` ). + + * ``DATE`` - Controls the display of the date and time in your legend. Subsequent ``KEY`` values control the display as follows: + + * 0 - No date or time displays are included in your legend. + * 1 - Only the date is shown. + * 2 - Both the date and time are shown (default). + + * ``FILE`` - Controls the display of the Mechanical APDL jobname in your legend. Subsequent ``KEY`` values control the display as follows: + + * 0 - The Mechanical APDL jobname is not included in your legend (default). + * 1 - The Mechanical APDL jobname is included in your legend. + + key : int or str + Switch: + + * ``OFF or 0`` - Do not apply this display item. For ``Label`` = DATE, no time or date are + displayed. + + * ``ON or 1`` - Apply this display item. For ``Label`` = DATE, show only the date. + + * ``AUTO or 2`` - For ``Label`` = INFO, initiate Auto-legend mode. If the display has contours, the + legend is ON; if the display has no contours, the legend is OFF. For ``Label`` = DATE, display both + the date and time. + + * ``3`` - For ``Label`` = INFO, switch to Multi-legend mode. See the :ref:`udoc` command for the + available legend configurations. + + Notes + ----- + + .. _s-PLOPTS_notes: + + Use :ref:`plopts`,STAT to display settings. Use :ref:`plopts`,DEFA to reset all specifications back + to their defaults. + + When you perform multiple results displays, contours on the legend column may be truncated. To avoid + this, specify :ref:`plopts`,LEG1,0. + + The Multi-legend mode provides a number of legend data item priority and placement options. These + options are accessed via the GUI at Utility Menu> PlotCtrls> Window Controls> Window Options. The + :ref:`udoc` command provides command line o ptions for this capability. + + This command is valid in any processor. + + This command is not available for Academic Research or Teaching level products + """ + command = f"/PLOPTS,{label},{key}" + return self.run(command, **kwargs) + + def pnum(self, label: str = "", key: int | str = "", **kwargs): + r"""Controls entity numbering/coloring on plots. + + Mechanical APDL Command: `/PNUM `_ + + Parameters + ---------- + label : str + Type of numbering/coloring: + + * ``NODE`` - Node numbers on node and element plots. + + * ``ELEM`` - Element numbers and colors on element plots. + + * ``SEC`` - Section numbers and colors on element and solid model plots (see :ref:`s-PNUM_notes` ). + + * ``MAT`` - Material set numbers and colors on element and solid model plots (see + :ref:`s-PNUM_notes` ). + + * ``TYPE`` - Element type reference numbers and colors on element and solid model plots (see + :ref:`s-PNUM_notes` ). + + * ``REAL`` - Real constant set numbers and colors on element and solid model plots (see + :ref:`s-PNUM_notes` ). + + * ``ESYS`` - Element coordinate system numbers on element and solid model plots (see + :ref:`s-PNUM_notes` ). + + * ``LOC`` - Location numbers/colors of the element in matrix assembly order on element plots. + + LOC and ELEM numbers will be the same unless the model has been reordered. + + * ``KP`` - Keypoint numbers on solid model plots. + + * ``LINE`` - Line numbers on solid model plots (both numbers and colors on line plots). + + * ``AREA`` - Area numbers on solid model plots (both numbers and colors on area plots). + + * ``VOLU`` - Volume numbers on solid model plots (both numbers and colors on volume plots). + + * ``SVAL`` - Stress (or any contour) values on postprocessing plots, and surface load values and + colors on model plots when surface load symbols are on ( :ref:`psf` ). For tabular boundary + conditions, the table- evaluated values will be displayed on node, element, or contour displays in + POST1 when load symbols ( :ref:`pbf`, :ref:`psf`, :ref:`pbc` ) are on and TABNAM is OFF. + + * ``TABNAM`` - Table names for tabular boundary conditions. If this label is turned on, the table + name appears next to the appropriate symbol, arrow, face outline, or contour as dictated by the + :ref:`psf`, :ref:`pbc`, and :ref:`pbf` commands. + + * ``STAT`` - Shows current settings for :ref:`pnum`. + + * ``DEFA`` - Resets all :ref:`pnum` specifications back to default. + + key : int or str + Switch: + + * ``0`` - Turns OFF numbers/colors for specified label. + + * ``1`` - Turns ON numbers/colors for specified label. + + Notes + ----- + + .. _s-PNUM_notes: + + This command specifies entity numbering and coloring for subsequent plots. + + The MAT, TYPE, REAL, and ESYS labels activate both the numbering and coloring of the corresponding + attributes for :ref:`eplot`, :ref:`kplot`, :ref:`lplot`, :ref:`aplot`, and :ref:`vplot`. The ELEM, + MAT, TYPE, REAL, ESYS, and LOC labels are mutually exclusive, that is, only one can be specified at + a time. Also, turning on a LINE, AREA, or VOLU label will turn off the MAT, TYPE, and REAL labels. + + PowerGraphics ( :ref:`graphics`,POWER) displays for :ref:`pnum` can be problematic. :ref:`pnum` + ,ELEM will display erratically depending on other display command specifications, while :ref:`pnum` + ,LOC and :ref:`pnum`,ESYS are not supported. + + Element and volume numbers are not visible for 3D elements and volumes when Z-buffering is turned on + ( :ref:`slashtype`,,[6,7, or 8]). + + Use :ref:`pstatus` or :ref:`pnum`,STAT to show settings. Use :ref:`pnum`,DEFA to reset all + specifications back to default. Use the :ref:`number` command to control whether numbers and colors + are displayed together. + + This command is valid in any processor + """ + command = f"/PNUM,{label},{key}" + return self.run(command, **kwargs) + + def psf( + self, + item: str = "", + comp: str = "", + key: int | str = "", + kshell: int | str = "", + color: str = "", + **kwargs, + ): + r"""Shows surface load symbols on model displays. + + Mechanical APDL Command: `/PSF `_ + + **Command default:** + + .. _s-PSF_default: + + No surface load symbols are displayed. + + Parameters + ---------- + item : str + Labels identifying the surface load to be shown; see :ref:`psf_tab_1`. + + comp : str + Labels identifying the surface load to be shown; see :ref:`psf_tab_1`. + + key : int or str + Key to turn surface load symbols on or off: + + * ``0`` - Off (default). + + * ``1`` - On, shown as face outlines. Line surface loads ( :ref:`sfl` ) on solid model plots are + shown as arrows. + + * ``2`` - On, shown as arrows. + + * ``3`` - On, shown as color filled surfaces. Line and area surface loads ( :ref:`sfl` and + :ref:`sfa` ) on solid model plots are shown as arrows. + + kshell : int or str + Visibility key for shell elements. + + * ``0`` - Off (default), surface load symbols are displayed only on visible load faces. + + * ``1`` - On, surface load symbols are displayed even if load face is not visible. + + color : str + Visibility key for contour legend. + + * ``ON`` - The symbols (arrows or face outlines) will show up in color with the legend showing the + corresponding color labels (default). + + * ``OFF`` - The contour legend will not be displayed. The symbols (arrows or face outlines) will + show up in grey. The size of the arrows will be proportional to the applied load. + + Notes + ----- + + .. _s-PSF_notes: + + :ref:`psf` determines whether and how to show surface loads on subsequent model displays. + + If surface loads are applied to solid model entities, only solid model plots show the load symbols; + node and element plots do not show them unless the loads are transferred ( :ref:`sftran` or + :ref:`sbctran` ). Similarly, solid model plots do not show the load symbols if surface loads are + applied to nodes and elements. For node and element plots of shell element models, the surface load + symbols are shown only if the load face is visible from the current viewing direction. + + The effects of the **/PSF** command are not cumulative (that is, the command does not modify an + existing setting from a + previously issued :ref:`psf` command). Only the setting specified via the most recent :ref:`psf` + command applies. + + If you issue a `postprocessing (POST1) + `_ + plot command that produces result contours (such as :ref:`plnsol` ), :ref:`psf` has no effect. This + behavior prevents conflicting contours in the graphics window. + + When using the radiosity method ( ``Item`` = RDSF and ``Comp`` = ENCL) with ``Key`` = 2, the + radiation arrows point outward from any element face. + + :ref:`psf`,STAT displays current :ref:`psf` settings, and :ref:`psf`,DEFA resets them back to + default. + + Other useful commands are :ref:`pnum`,SVAL,1 to show the values of the surface loads, :ref:`vscale` + to change arrow lengths, and :ref:`pbc` and :ref:`pbf` to activate other load symbols. + + For beam elements, only the colors representing shear (GREEN) and normal (RED) pressures are + displayed for the arrows. The color of these arrows does not correspond to the magnitudes in the + contour legend. The length of these arrows does, however, correlate to the relative magnitude of the + pressures. + + For elements ``SURF159``, ``SOLID272``, ``SOLID273``, ``PIPE288`` and ``PIPE289``, :ref:`psf` is not + available when displaying elements with shapes determined from the real constants or section + definition ( :ref:`eshape` ). For ``PIPE288`` and ``PIPE289``, only external loads applied via + :ref:`sfbeam` are displayed. + + This command is valid in any processor. + + .. _psf_tab_1: + + /PSF - Valid Item and Component Labels + ************************************** + + .. flat-table:: + :header-rows: 1 + + * - Item + - Comp + - Description + - Comments + * - :rspan:`14` PRES [ :ref:`psf_labels_fn_1` ] + - NORM (or blank) + - Applied pressure normal to the face (real component only). + - For element types other than ``SURF153``, ``SURF154`` and ``SURF156``. + * - NORM + - Applied pressure normal to the face (real component). + - :rspan:`5` For element types ``SURF153``, ``SURF154`` and ``SURF156`` with KEYOPT(2) = 0. For `supported structural elements `_ with ``KCSYS`` = 0. [ :ref:`psf_labels_fn_2` ] + * - TANX + - Applied pressure in the element tangential x direction (real component). + * - TANY + - Applied pressure in the element tangential- y direction (real component). + * - INRM + - Applied pressure normal to the face (imaginary component). + * - ITNX + - Applied pressure in the element tangential x direction (imaginary component). + * - ITNY + - Applied pressure in the element tangential y direction (imaginary component). + * - LOCX + - Applied pressure in the local x direction (real component). + - :rspan:`5` For element types ``SURF153``, ``SURF154`` and ``SURF156`` with KEYOPT(2) = 1. For `supported structural elements`_ with ``KCSYS`` = 1. [ :ref:`psf_labels_fn_2` ] + * - LOCY + - Applied pressure in the local y direction (real component). + * - LOCZ + - Applied pressure in the local z direction (real component). + * - ILCX + - Applied pressure in the local x direction (imaginary component). + * - ILCY + - Applied pressure in the local y direction (imaginary component). + * - ILCZ + - Applied pressure in the local z direction (imaginary component). + * - RVEC + - Applied pressure in the user-defined direction (real component). + - :rspan:`1` For `supported structural elements`_ with ``KCSYS`` = 2. [ :ref:`psf_labels_fn_2` ] + * - IVEC + - Applied pressure in the user-defined direction (imaginary component). + * - :rspan:`1` CONV + - HCOEF + - Applied convection (film coefficient). + - + * - TBULK + - Applied convection (bulk temperature). + - + * - :rspan:`1` RAD + - EMIS + - Applied radiation (emissivity). + - + * - TAMB + - Applied radiation (ambient temperature). + - + * - :rspan:`1` RDSF + - EMSS + - Radiation emissivity. + - + * - ENCL + - Enclosure number. + - + * - FSIN + - + - Fluid-solid interface number. + - + * - HFLUX + - + - Applied heat flux. + - + * - FSI + - + - Acoustic fluid-structure interface flag. + - + * - IMPD + - + - Applied acoustic impedance. + - + * - :rspan:`1` SHLD + - COND + - Applied conductivity. + - + * - MUR + - Applied relative permeability. + - + * - MXWF + - + - Maxwell force flag. + - + * - INF + - + - Exterior surface flag. + - + * - CHRGS + - + - Applied electric surface charge density. + - + * - BLI + - + - Boundary layer impedance flag. + - + + .. _psf_labels_fn_1: + + Pressure loads apply to the element coordinate system (KEYOPT(2) = 0). Adjust appropriately for a + local coordinate system (KEYOPT(2) = 1). See, and in the Element Reference. + + .. _psf_labels_fn_2: + + ``KCSYS`` is specified when issuing :ref:`sfcontrol`. + """ + command = f"/PSF,{item},{comp},{key},{kshell},{color}" + return self.run(command, **kwargs) + + def psymb(self, label: str = "", key: int | str = "", **kwargs): + r"""Shows various symbols on displays. + + Mechanical APDL Command: `/PSYMB `_ + + Parameters + ---------- + label : str + Show symbols as selected from the following labels: + + * ``CS`` - Local coordinate systems. + + * ``NDIR`` - Nodal coordinate systems (on rotated nodes only). + + * ``ESYS`` - Element coordinate systems (element displays only). + + * ``LDIR`` - Line directions (line displays only). + + * ``LDIV`` - Controls the display of element divisions on lines. + + * ``ADIR`` - Area direction symbol (for keypoint, line, area and volume plots). + + * ``LAYR`` - Layer orientations (relative to the projected element x-axis) or fiber orientations in + smeared reinforcing elements. Used only within an element display. Use ``KEY`` to specify the layer + number. + + * ``ECON`` - Element mesh symbols on keypoints and lines. + + * ``DOT`` - Larger symbols displayed for node and keypoint locations. When ``Label`` = DOT, ``KEY`` + = 1 by default. + + * ``XNOD`` - Extra node of surface or circuit elements. + + * ``FBCS`` - Force boundary condition scaling. Subsequent ``KEY`` value determines whether or not to + scale the applied and derived forces/moments to the same maximum value. + + * ``DEFA`` - Resets the symbol keys so that Mechanical APDL displays none of the symbols controlled by the + :ref:`psymb` command. The value of the ``KEY`` field is ignored. + + * ``STAT`` - Prints the status of the settings of the symbol keys controlled by the :ref:`psymb` + command. The ``KEY`` field is ignored. + + * ``MARK`` - Controls the marker size ( :ref:`gmarker` ). When ``Label`` = MARK, ``KEY`` = 10 by + default. + + key : int or str + Symbol key: + + * ``-1`` - Effective only if ``Label`` = LAYR and solid shape element display ( :ref:`eshape` ) is + active. Orientation of all layers appears with the solid shape element display. + + * ``0`` - No symbol (default). If ``Label`` = LDIV, then ``KEY`` = 0 indicates that the displayed + element divisions will correspond to the existing mesh (the word MESHED or EXISTING can also be + substituted). Also, for ``Label`` = LDIV, if you execute any meshing command (such as :ref:`amesh` + or :ref:`vmesh` ), ``KEY`` is set to 0 (MESHED) automatically. If ``Label`` = FBCS, then ``KEY`` = 0 + indicates that boundary condition scaling will not be common. The applied and derived forces/moments + will be scaled to their respective maximum values. + + * ``1`` - Include symbol. If ``Label`` = LDIV, then ``KEY`` = 1 indicates that the displayed line + divisions will correspond to the value assigned by :ref:`lesize` (the word LESIZE can also be + substituted). Also, for ``Label`` = LDIV, if you execute the :ref:`lesize` command, ``KEY`` is set + to 1 (LESIZE) automatically. If ``Label`` = FBCS, then ``KEY`` = 1 indicates that boundary condition + scaling will be common. The applied and derived forces/moments will be scaled to the same maximum + value. + + * ``N`` - If ``Label`` = LAYR, then ``N`` is equal to the layer number. If ``Label`` = DOT, then + ``N`` can be equal to 0,1,.....15, indicating the dot size. If ``Label`` = MARK, then ``N`` can be + equal to 1,.....10, indicating the marker size. If ``Label`` = LDIV, then ``KEY`` = -1, indicates + that no element divisions will be displayed (the word OFF can also be substituted). + + Notes + ----- + + .. _s-PSYMB_notes: + + Includes various symbols on the display. Triads are right-handed with x displayed as the longest + leg. Where color is displayed, x is white, y is green, and z is blue. For beams, x is always along + the length of the element. For lines, an arrow represents the direction of a line, from the + beginning keypoint to the end keypoint. See :ref:`plopts` command for additional display options. + Use :ref:`pstatus` or :ref:`psymb`,STAT to display settings. Use :ref:`psymb`,DEFA to reset all + specifications back to their defaults. The command :ref:`psymb`,ECON,1 causes the symbol "M" to be + displayed on keypoints and lines associated with meshed entities. When you issue the command + :ref:`psymb`,DOT,1, a larger symbol is displayed for each node and keypoint location. Using + :ref:`psymb`,MARK,1, a smaller marker size can be displayed. + + PowerGraphics ( :ref:`graphics`,POWER) does not support :ref:`psymb`,ESYS and :ref:`psymb`,LAYR. + + If ``KEY`` = ``N`` and PowerGraphics is off, the centroid of the surface elements is connected to + the extra node using a gray line. However, if PowerGraphics is on, the color of the line connecting + the centroid to the extra node is the same as that for the elements themselves (as determined by + :ref:`pnum` ). + + When ``Label`` = LAYR, the layer systems can be visualized with all current-technology layered + elements and the smeared reinforcing element ``REINF265``. To use :ref:`psymb`,LAYR with + ``REINF265``, first set the vector-mode graphics option ( :ref:`device`,VECTOR,1). + + This command is valid in any processor. + """ + command = f"/PSYMB,{label},{key}" + return self.run(command, **kwargs) + + def triad(self, lab: str = "", **kwargs): + r"""Shows the global XYZ coordinate triad on displays. + + Mechanical APDL Command: `/TRIAD `_ + + Parameters + ---------- + lab : str + Display triad as follows: + + * ``ORIG`` - Display triad at global origin (default). + + * ``OFF`` - Turn off triad display. + + * ``LBOT`` - Display triad in lower left screen corner. + + * ``RBOT`` - Display triad in lower right screen corner. + + * ``LTOP`` - Display triad in upper left screen corner. + + * ``RTOP`` - Display triad in upper right screen corner. + + Notes + ----- + + .. _s-TRIAD_notes: + + For efficiency, Mechanical APDL maintains a single data structure (segment) which includes the triad + as a + 3D data object. + + If a 3D device is involved ( :ref:`show`,3D) and the graphics are not being displayed as multi- + plots, the triad location is determined by the view settings for window #1. + + A request for triad display anywhere except for the origin may yield an improper display in windows + 2 through 5. + + The program displays the same segment in all windows. The view settings of each window constitute + the only difference in the display in the active windows. + + This command is valid in any processor. + """ + command = f"/TRIAD,{lab}" + return self.run(command, **kwargs) + + def udoc(self, wind: str = "", class_: str = "", key: str = "", **kwargs): + r"""Determines position and content for the multi-legend options. + + Mechanical APDL Command: `/UDOC `_ + + Parameters + ---------- + wind : str + The window number to which the command applies. (defaults to 1) + + class_ : str + The type (and relative importance) of legend item being displayed: + + * ``CNTR`` - Contour legend. This legend item is controlled separately from the other legend items + (see note below). + + * ``DATE`` - The items in the DATE class include the date and time, or the Mechanical APDL graphical logo ( + :ref:`plopts`,LOGO,1). This item is shown by default in all plots. + + * ``GWIN`` - The items in the GWIN class include the entity acronyms that appear in the legend of a + multiplot of entities (Nodes, Elements, Keypoints, Lines, Areas, Volumes). GWIN items are shown by + default for all :ref:`gplot` displays. + + * ``TYPE`` - Items in the TYPE class include the plot type (e.g. ELEMENTS, MATERIALS, NODAL + SOLUTIONS, etc.). TYPE items are shown by default in all plots. + + * ``TYP2`` - Items in the TYP2 class include supplementary type information, such as DMAX and SMAX + for nodal solutions. TYP2 items are shown by default in all plots. + + * ``INUM`` - Items in the INUM class include the number labels generated by the :ref:`pnum` command. + This class is displayed by default in all plots that contain :ref:`pnum` information. + + * ``BCDC`` - The items in the BCDC class include labels created by the :ref:`pbc` command. This + class is shown by default in all plots which contain :ref:`pbc` information. + + * ``VECT`` - Items in the VECT class include labels created by the :ref:`plvect` command. This class + is shown by default for all :ref:`plvect` plots. + + * ``SURF`` - The items in the SURF class include labels from the :ref:`psf` legend. This class is + shown by default on all plots of surface boundary conditions. + + * ``BODY`` - Items from the BODY class include labels from the :ref:`pbf` legend. This class is + shown by default in all plots of body forces. + + * ``PSTA`` - Items from the PSTA class include stress scaling statistics, such as the :ref:`sscale` + setting. This class is not shown as the default for any type of plot, and must be specifically + referenced to display the included data. + + * ``VIEW`` - The items in the VIEW class include view statistics. This class is not shown as the + default for any type of plot, and must be specifically referenced to display the included data. + + * ``MISC`` - The items in the MISC class include supplementary labels like /EXPANDED and Stress + Section Cross Section. This class is not shown as the default for any type of plot, and must be + specifically referenced to display the included data. + + key : str + Switch: + + This command contains some tables and extra information which can be inspected in the original + documentation pointed above. + + Notes + ----- + + .. _s-UDOC_notes: + + The legend classes conform to the controls specified in the window options panel ( PlotCtrls> Window + Controls> Window Options ). In many instances, the legend controls specified with the :ref:`plopts` + command will take precedence and override :ref:`udoc` specifications. For instance: + + :ref:`plopts`,LEG1,OFF will disable the TYPE, TYP2, INUM, and MISC classes, regardless of the + :ref:`udoc` settings. + + :ref:`plopts`,LEG2,OFF will disable the VIEW class, regardless of the :ref:`udoc` settings. + + :ref:`plopts`,LEG3,OFF will disable the PSTA class, regardless of the :ref:`udoc` settings. + + All items in a class are listed with the same X coordinate (except for contours). The contents of + the text classes are dumped onto the display window from top to bottom, in order of class + importance. + + The font specification for text items that are included in the user-specified legends are controlled + with the :ref:`device` command ( PlotCtrls> Font Controls> Anno/Graph Font ). + + The floating point values for the data presented in the legend(s) are controlled by the + :ref:`gformat` command. + """ + command = f"/UDOC,{wind},{class_},{key}" + return self.run(command, **kwargs) diff --git a/src/ansys/mapdl/core/_commands/graphics/scaling.py b/src/ansys/mapdl/core/_commands/graphics/scaling.py new file mode 100644 index 00000000000..7a8c8be4620 --- /dev/null +++ b/src/ansys/mapdl/core/_commands/graphics/scaling.py @@ -0,0 +1,242 @@ +# Copyright (C) 2016 - 2025 ANSYS, Inc. and/or its affiliates. +# SPDX-License-Identifier: MIT +# +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to deal +# in the Software without restriction, including without limitation the rights +# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +# copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in all +# copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +# SOFTWARE. + + +class Scaling: + + def iclwid(self, factor: str = "", **kwargs): + r"""Scales the line width of circuit builder icons. + + Mechanical APDL Command: `/ICLWID `_ + + Parameters + ---------- + factor : str + Multiplication factor applied to the default line width (defaults to 1). The minimum is 1 and + the maximum is 6. + """ + command = f"/ICLWID,{factor}" + return self.run(command, **kwargs) + + def icscale(self, wn: str = "", factor: str = "", **kwargs): + r"""Scales the icon size for elements supported in the circuit builder. + + Mechanical APDL Command: `/ICSCALE `_ + + Parameters + ---------- + wn : str + Window number (or ALL) to which command applies (defaults to 1). + + factor : str + Factor applied to the default icon size (defaults to 1). + + Notes + ----- + + .. _s-ICSCALE_notes: + + Scaling the icon size can provide better visualization of the circuit components when using the + Circuit Builder (an interactive builder available in the Mechanical APDL GUI). + """ + command = f"/ICSCALE,{wn},{factor}" + return self.run(command, **kwargs) + + def ratio(self, wn: str = "", ratox: str = "", ratoy: str = "", **kwargs): + r"""Distorts the object geometry. + + Mechanical APDL Command: `/RATIO `_ + + Parameters + ---------- + wn : str + Window number (or ALL) to which command applies (defaults to 1). + + ratox : str + Distort object in the window X direction by this factor (defaults to 1.0). + + ratoy : str + Distort object in the window Y direction by this factor (defaults to 1.0). + + Notes + ----- + + .. _s-RATIO_notes: + + Distorts the object geometry in a particular direction. An example of this command's use would be to + allow long narrow sections to be distorted to a more square area for better display visualization. + + This command is valid in any processor. + """ + command = f"/RATIO,{wn},{ratox},{ratoy}" + return self.run(command, **kwargs) + + def shrink(self, ratio: str = "", **kwargs): + r"""Shrinks elements, lines, areas, and volumes for display clarity. + + Mechanical APDL Command: `/SHRINK `_ + + Parameters + ---------- + ratio : str + Shrinkage ratio (input as a decimal (0.0 to 0.5)). Defaults to 0.0 (no shrinkage). Values + greater than 0.5 default to 0.1 (10% shrinkage). + + Notes + ----- + + .. _s-SHRINK_notes: + + Shrinks the elements, lines, areas, and volumes so that adjacent entities are separated for clarity. + Portions of this command are not supported by PowerGraphics ( :ref:`graphics`,POWER). + + If only the common lines of non-coplanar faces are drawn (as per the :ref:`edge` command), then this + command is ignored. + + This command is valid in any processor. + """ + command = f"/SHRINK,{ratio}" + return self.run(command, **kwargs) + + def slashdscale(self, wn: str = "", dmult: int | str = "", **kwargs): + r"""Sets the displacement multiplier for displacement displays. + + Mechanical APDL Command: `/DSCALE `_ + + **Command default:** + + .. _s-DSCALE_default: + + The default value is AUTO or 0 except when: + + * Large deflection effects are included ( :ref:`nlgeom`,ON) and it is not a modal analysis; then the + default is 1. + * It is a spectrum analysis ( :ref:`antype`,SPECTR); then the default is OFF. + * The amplitude of a time-harmonic solution is computed using the :ref:`hrcplx` command (OMEGAT + _font FamName="Agency FB"? ≥ /_font? 360 _font FamName="Agency FB"? ° /_font? ); then the default + is OFF. + * The amplitude of a complex modal or harmonic solution is stored into the database using the + :ref:`set` command ( ``KIMG`` = AMPL); then the default is OFF. + + Parameters + ---------- + wn : str + Window number (or ALL) to which command applies (defaults to 1). + + dmult : int or str + + * ``AUTO or 0`` - Scale displacements automatically so that maximum displacement (vector amplitude) + displays as 5 percent of the maximum model length, as measured in the global Cartesian X, Y, or Z + directions. + + * ``1`` - Do not scale displacements (that is, scale displacements by 1.0, true to geometry). Often + used with large deflection results. + + * ``FACTOR`` - Scale displacements by numerical value input for FACTOR. + + * ``OFF`` - Remove displacement scaling (that is, scale displacements by 0.0, no distortion). + + * ``USER`` - Set ``DMULT`` to that used for last display (useful when last ``DMULT`` value was + automatically calculated). + + Notes + ----- + + .. _s-DSCALE_notes: + + If Multi-Plots are not being displayed, and the current device is a 3D device ( :ref:`show`,3D), + then the displacement scale in all active windows will be the same, even if separate + :ref:`slashdscale` commands are issued for each active window. For efficiency, the program maintains + a single data structure (segment) containing only one displacement scale. The program displays the + same segment (displacement scale) in all windows. Only the view settings will be different in each + of the active windows. + + This command is valid in any processor. + """ + command = f"/DSCALE,{wn},{dmult}" + return self.run(command, **kwargs) + + def sscale(self, wn: str = "", smult: str = "", **kwargs): + r"""Sets the contour multiplier for topographic displays. + + Mechanical APDL Command: `/SSCALE `_ + + Parameters + ---------- + wn : str + Window number (or ALL) to which command applies (defaults to 1). + + smult : str + Contour multiplier that factors in results based on the product of the multiplier and the result + being plotted. Defaults to 0.0 (no topographic effects). + + Notes + ----- + + .. _s-SSCALE_notes: + + Use this command to scale values to the geometry when the contours are shown elevated. For section + displays ( :ref:`slashtype` ), the elevation is performed perpendicular to the section face. + + Nonzero contour multipliers factoring in large results (stresses or displacements) can produce very + large distortion, causing images to disappear. To bring a distorted image back into view, reduce the + contour multiplier value. + + Portions of this command are not supported by PowerGraphics ( :ref:`graphics`,POWER). + """ + command = f"/SSCALE,{wn},{smult}" + return self.run(command, **kwargs) + + def vscale(self, wn: str = "", vratio: str = "", key: int | str = "", **kwargs): + r"""Scales the length of displayed vectors. + + Mechanical APDL Command: `/VSCALE `_ + + Parameters + ---------- + wn : str + Window number (or ALL) to which command applies (defaults to 1). + + vratio : str + Ratio value applied to the automatically calculated scale factor (defaults to 1.0, that is, use + scale factor as automatically calculated). + + key : int or str + Relative scaling key: + + * ``0`` - Use relative length scaling among vectors based on magnitudes. + + * ``1`` - Use uniform length scaling for all vector lengths. + + Notes + ----- + + .. _s-VSCALE_notes: + + Allows scaling of the vector length displayed with the :ref:`plvect` command of POST1 and the + :ref:`pbc` and :ref:`psf` commands. Also allows the scaling of the element (that is, :ref:`psymb` + ,ESYS) and the nodal (that is, :ref:`psymb`,NDIR) coordinate system symbols. + + This command is valid in any processor. + """ + command = f"/VSCALE,{wn},{vratio},{key}" + return self.run(command, **kwargs) diff --git a/src/ansys/mapdl/core/_commands/graphics/set_up.py b/src/ansys/mapdl/core/_commands/graphics/set_up.py new file mode 100644 index 00000000000..72c810c2d7a --- /dev/null +++ b/src/ansys/mapdl/core/_commands/graphics/set_up.py @@ -0,0 +1,1570 @@ +# Copyright (C) 2016 - 2025 ANSYS, Inc. and/or its affiliates. +# SPDX-License-Identifier: MIT +# +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to deal +# in the Software without restriction, including without limitation the rights +# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +# copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in all +# copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +# SOFTWARE. + + +class SetUp: + + def cmap( + self, fname: str = "", ext: str = "", kywrd: str = "", ncntr: str = "", **kwargs + ): + r"""Changes an existing or creates a new color mapping table. + + Mechanical APDL Command: `/CMAP `_ + + **Command default:** + + .. _s-CMAP_default: + + Use predefined Mechanical APDL color map table. + + Parameters + ---------- + 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. If blank, restore color map. + + ext : str + Filename extension (eight-character maximum). + + kywrd : str + Keyword indicating the disposition of the color map file. + + * ``(blank)`` - Loads existing color map file. + + * ``CREATE`` - Starts the CMAP utility and modifies or creates the specified file. + + * ``SAVE`` - Writes the active color map to the specified file, which can be imported into future + sessions. + + ncntr : str + Number of contours to be defined. Default = 9 (even if an existing file is being modified). + Maximum = 128. + + Notes + ----- + + .. _s-CMAP_notes: + + Reads the color map file (RGB index specifications) to change from current specifications. Only one + color map may be active at a time. + + For 2D drivers (especially Win32c), modifying the color map can produce anomalies, including + legend/contour disagreement. + + When ``Kywrd`` equals CREATE, the 2D drivers (X11c and Win32c) display the CMAP utility with an + additional contour color picker called CONTOURS. Colors selected via the CONTOURS picker affect + result contour displays (such as stresses). No other drivers offer the CONTOURS picker in the CMAP + utility. + + Changing the color map using the :ref:`cmap` command changes the meaning of the color labels on the + :ref:`color` command. See :ref:`color` for other color controls. + + This command is valid anywhere. + """ + command = f"/CMAP,{fname},{ext},,{kywrd},{ncntr}" + return self.run(command, **kwargs) + + def color( + self, + lab: str = "", + clab: str = "", + n1: str = "", + n2: str = "", + ninc: str = "", + **kwargs, + ): + r"""Specifies the color mapping for various items. + + Mechanical APDL Command: `/COLOR `_ + + **Command default:** + + .. _s-COLOR_default: + + Use the default color mapping. + + Parameters + ---------- + lab : str + Apply color to the items specified by the following labels: + + * ``AXES`` - Determines the color (specified in next argument, ``Clab`` ) that the axes of a graph + will be plotted in. + + * ``AXNUM`` - Determines the color (specified in next argument, ``Clab`` ) that the numbering on the + axes of a graph will be plotted in. + + * ``NUM`` - Discretely numbered items (such as element types, element materials, etc., as shown on + the :ref:`pnum` command). Also specify number (1 to 11) in the ``N1`` field. For example, + :ref:`color`,NUM,RED,3 will assign the color red to all items having the discrete number 3 (material + displays would show elements having material 3 as red). + + * ``OUTL`` - Outline of elements, areas, and volumes. Ex: :ref:`color`,OUTL,BLUE. + + * ``ELEM`` - Elements. Use ``N1``, ``N2``, ``NINC`` fields for element numbers. + + * ``LINE`` - Solid model lines. Use ``N1``, ``N2``, ``NINC`` fields for line numbers. + + * ``AREA`` - Solid model areas. Use ``N1``, ``N2``, ``NINC`` fields for area numbers. + + * ``VOLU`` - Solid model volumes. Use ``N1``, ``N2``, ``NINC`` fields for volume numbers. + + * ``ISURF`` - Isosurfaces (surfaces of constant stress, etc.). This option is particularly useful + when capturing frames for animating a single isosurface value. + + * ``WBAK`` - Window background. Use ``N1``, ``N2``, ``NINC`` fields for window numbers. The options + that you select using ``Lab`` = PBAK will supersede those applied using ``Lab`` = WBAK. + + * ``b.c.label`` - Boundary condition label. Enter U, ROT, TEMP, PRES, V, VOLT, MAG, A, EMF, CURR, F, + M, HEAT, FLOW, VF, AMPS, FLUX, CSG, CURT, MAST, CP, CE, NFOR, NMOM, RFOR, RMOM, PATH. See the + :ref:`pbc` command for boundary condition label definitions. + + * ``GRBAK`` - Graph background. + + * ``GRID`` - Graph grid lines. + + * ``AXLAB`` - Graph X and Y axis labels. + + * ``CURVE`` - Graph curves (identify curve numbers (1-10) in ``N1``, ``N2``, ``NINC`` fields). + + * ``CM`` - Component group. Use ``N1`` field for component name, ignore ``N2`` and ``NINC``. + + * ``CNTR`` - Mechanical APDL contour stress colors. The maximum number of contours available is 128. The + number of colors that can be specified interactively (GUI) is 9. ( :ref:`contour`, 9). Any other + setting will yield inconsistent results. + + * ``SMAX`` - Specifies that all stress values above the maximum value entered in :ref:`contour` will + be displayed in the color designated in the ``Clab`` field. Defaults to dark grey. + + * ``SMIN`` - Specifies that all stress values below the minimum value entered in :ref:`contour` will + be displayed in the color designated in the ``Clab`` field. Defaults to dark grey. + + * ``PBAK`` - Activates background shading options (see command syntax at end of argument + descriptions below). The options that you select using ``Lab`` = PBAK will supersede those applied + using ``Lab`` = WBAK. + + clab : str + Valid color labels are: + + * ``BLAC (0)`` - Black + + * ``MRED (1)`` - Magenta-Red + + * ``MAGE (2)`` - Magenta + + * ``BMAG (3)`` - Blue-Magenta + + * ``BLUE (4)`` - Blue + + * ``CBLU (5)`` - Cyan-Blue + + * ``CYAN (6)`` - Cyan + + * ``GCYA ((7)`` - Green-Cyan + + * ``GREE (8)`` - Green + + * ``YGRE (9)`` - Yellow-Green + + * ``YELL (10)`` - Yellow + + * ``ORAN (11)`` - Orange + + * ``RED (12)`` - Red + + * ``DGRA (13)`` - Dark Gray + + * ``LGRA (14)`` - Light Gray + + * ``WHIT (15)`` - White + + n1 : str + Apply color to ``Lab`` items numbered ``N1`` to ``N2`` (defaults to ``N1`` ) in steps of + ``NINC`` (defaults to 1). If ``N1`` is blank, apply color to entire selected range. If ``Lab`` + is CM, use component name for ``N1`` and ignore ``N2`` and ``NINC``. If ``N1`` = P, graphical + picking of elements, lines, areas and volumes is enabled; your can assign colors to the entities + via the picker. When picking is enabled, the ``Lab`` and ``Clab`` fields are ignored. + + n2 : str + Apply color to ``Lab`` items numbered ``N1`` to ``N2`` (defaults to ``N1`` ) in steps of + ``NINC`` (defaults to 1). If ``N1`` is blank, apply color to entire selected range. If ``Lab`` + is CM, use component name for ``N1`` and ignore ``N2`` and ``NINC``. If ``N1`` = P, graphical + picking of elements, lines, areas and volumes is enabled; your can assign colors to the entities + via the picker. When picking is enabled, the ``Lab`` and ``Clab`` fields are ignored. + + ninc : str + Apply color to ``Lab`` items numbered ``N1`` to ``N2`` (defaults to ``N1`` ) in steps of + ``NINC`` (defaults to 1). If ``N1`` is blank, apply color to entire selected range. If ``Lab`` + is CM, use component name for ``N1`` and ignore ``N2`` and ``NINC``. If ``N1`` = P, graphical + picking of elements, lines, areas and volumes is enabled; your can assign colors to the entities + via the picker. When picking is enabled, the ``Lab`` and ``Clab`` fields are ignored. + + Notes + ----- + + .. warning:: + + This function contains specificities regarding the argument definitions. + Please refer to the `command documentation `_ + for further explanations. + + .. _s-COLOR_notes: + + Issue :ref:`color`,STAT to display the current color mapping. Issue :ref:`color`,DEFA to reset the + default color mapping. Color labels may also be reassigned any "color" with the :ref:`cmap` command. + + This command is valid anywhere. + """ + command = f"/COLOR,{lab},{clab},{n1},{n2},{ninc}" + return self.run(command, **kwargs) + + def device(self, label: str = "", key: int | str = "", **kwargs): + r"""Controls graphics device options. + + Mechanical APDL Command: `/DEVICE `_ + + **Command default:** + + .. _s-DEVICE_default: + + Vector mode off (that is, raster mode); dithering on. + + Parameters + ---------- + label : str + Device function label: + + * ``BBOX`` - Bounding box mode. For PowerGraphics plots involving elements with :ref:`show`,x11 and + :ref:`show`,win32, Mechanical APDL generally displays dynamic rotations faster. If KEY = 1 (ON), then a + bounding box (not the elements) encompassing the model is displayed and rotated, rather than the + element outlines (ON is default in preprocessing). When KEY = 0 (OFF), then dynamic rotations may be + slower (Mechanical APDL redraws the element outlines) for plots involving elements with :ref:`show`,x11 and + :ref:`show`,win32. OFF is default in postprocessing. This command is ignored if :ref:`edge`,WN,1 is + set for any WN. This is ignored in POST1 and SOLUTION plots. + + For any PowerGraphics plots involving elements, regardless of :ref:`show` settings, plots will + generally be displayed faster. + + * ``VECTOR`` - Vector mode. In vector mode, areas, volumes, elements, and postprocessing display + geometries are shown as outlines (wireframes). When vector mode is off (default), these entities are + shown filled with color. + + * ``DITHER`` - When dithering is turned on (default), color intensity transitions are smoothed. This + selection a + + applies only to smooth-shaded images, that is, Z-buffered ( :ref:`slashtype` ), or raster plots with + Gouraud or Phong shading ( :ref:`shade` ). + + * ``ANIM`` - Select the animation type used on 2D devices on the PC platform. A ``KEY`` value of BMP + (or 0) sets animation mode to the Mechanical APDL animation controller (default). A ``KEY`` value of AVI + (or 2) sets animation mode to AVI movie player file. + + * ``FONT`` - Font selection for the Mechanical APDL graphics window. When ``Label`` = FONT, the command format is: + :ref:`device`,FONT, ``KEY``, ``Val1``, ``Val2``, ``Val3``, ``Val4``, ``Val5``, ``Val6`` where + ``KEY`` determines the type of font being controlled, and values 1 through 6 control various font + parameters. These values are device specific; using the same command input file ( :ref:`input` ) on + different machines may yield different results.. The following ``KEY`` values determine the font + information that will be supplied to the appropriate driver (for example, Postscript, X11, Win32, + JPEG,...): + + * ``KEY = 1`` - The command controls the LEGEND (documentation column) font. + + * ``KEY = 2`` - The command controls the ENTITY (node and keypoint number) font. + + * ``KEY = 3`` - The command controls the ANNOTATION/GRAPH font. + + Linux: Values 1 through 4 are used to find a match in the X11 database of font strings. Values 1, 2, and 3 + are character strings; value 4 is a nonzero integer: + + * ``Val1`` - Family name (for example, Courier). If ``Val1`` = MENU, all other values are ignored + and a font selection menu appears (GUI must be active). + + * ``Val2`` - Weight (for example, medium) + + * ``Val3`` - Slant (for example, r) + + * ``Val4`` - Pixel size (for example, 14). Note that this value does no affect the annotation fonts + ( ``KEY`` = 3). Use the :ref:`tspec` command for annotation font size. + + * ``Val5`` - unused + + * ``Val6`` - unused + + PC: The values are encoded in a PC logical font structure. Value 1 is a character string, and the + remaining values are integers: + + * ``Val1`` - Family name (for example, Courier\2New) Substitute an asterisk (\2) for any blank + character that appears in a family name. If ``Val1`` = MENU, all other values are ignored and a font + selection menu appears (GUI must be active). When this value is blank, Mechanical APDL uses the first + available resource it finds. + + * ``Val2`` - Weight (0 - 1000) + + * ``Val3`` - Orientation (in tenths of a degree) + + * ``Val4`` - Height (in logical units) + + * ``Val5`` - Width (in logical units) + + * ``Val6`` - Italics (0 = OFF, 1 = ON) + + * ``TEXT`` - Text size specification for the Mechanical APDL graphics window. Using this label with the + :ref:`device` command requires the following form: :ref:`device`,TEXT, ``KEY``, ``PERCENT``. ``KEY`` + = 1 for LEGEND fonts; ``KEY`` = 2 for ENTITY fonts. ``PERCENT`` specifies the new text size as a + percent of the default text size. If ``PERCENT`` = 100, the new text size is precisely the default + size. If ``PERCENT`` = 200, the new text size is twice the default text size. + + key : int or str + Control key: + + * ``OFF or 0`` - Turns specified function off. + + * ``ON or 1`` - Turns specified function on or designates the LEGEND font. + + * ``2`` - Designates the ENTITY font. + + * ``3`` - Designates the ANNOTATION/GRAPH font. + + Notes + ----- + + .. _s-DEVICE_notes: + + This command is valid in any processor. + + The :ref:`device`,BBOX command is ignored in POST1 and SOLUTION plots. Also, the elements are + displayed and rotated if you use :ref:`device`,BBOX,ON and :ref:`edge`,WN,1,ANGLE (effectively + ignoring the BBOX option). + """ + command = f"/DEVICE,{label},{key}" + return self.run(command, **kwargs) + + def dsys(self, kcn: str = "", **kwargs): + r"""Activates a display coordinate system for geometry listings and plots. + + Mechanical APDL Command: `DSYS `_ + + **Command default:** + + .. _DSYS_default: + + Global Cartesian ( ``KCN`` = 0) display coordinate system. + + Parameters + ---------- + kcn : str + Coordinate system reference number. ``KCN`` may be 0,1,2 or any previously defined local + coordinate system number. If a cylinder is displayed in its cylindrical coordinate system (with + a 1,0,0 view), it will be unrolled (developed) into a flat plane (with theta along the Y + direction). + + Notes + ----- + + .. _DSYS_notes: + + Boundary condition symbols, vector arrows, and element coordinate system triads are not transformed + to the display coordinate system. The display system orientation (for the default view) is X + horizontal to the right, Y vertical upward, and Z out of the screen (normal). + + Line directions and area directions ( :ref:`psymb`,LDIR and :ref:`psymb`,ADIR) are not plotted for + ``KCN`` >0. + + When you create 3D annotation, the coordinates are stored to the database in the display coordinate + system that was active at the time of creation. Changing the display coordinate system does not + change the annotation coordinate data in the database. + + This command is valid in any processor. + """ + command = f"DSYS,{kcn}" + return self.run(command, **kwargs) + + def dv3d(self, lab: str = "", key: int | str = "", **kwargs): + r"""Sets 3D device option modes. + + Mechanical APDL Command: `/DV3D `_ + + Parameters + ---------- + lab : str + Mode label: + + * ``ACCU`` - Activating the accumulation buffer for OpenGL graphics, providing faster model rotation + when shaded backgrounds are in use. This feature is off by default. + + * ``ACTR`` - Label term to designate the cursor position as the center for automatic dynamic + rotational center capability. The subsequent ``Key`` value (see below) turns this capability on and + off. This feature is on by default. (Available for OpenGL displays only.) + + * ``ANIM`` - Animation mode. The ANIM option allows you to create animation frames in pixmap mode + instead of display list mode. This may improve large model performance, but it eliminates local + manipulation while animation is in progress. This feature is on by default. + + * ``ANTI`` - Label term to control Anti-aliasing, a smoothing technique for your graph plots. (see + below) The subsequent ``Key`` value turns this capability on and off. The default for this feature + is off. (Available for OpenGL displays only). + + * ``CNTR`` - Switches banded contours on (1) or off (0) for your 3D contour display. The default is + 1 (ON). Other contour parameters such as number of contours or the increment and range are defined + using the :ref:`contour` command. When either 9 or 128 contours are specified via :ref:`contour`, + this command is ignored and a smooth contour is always displayed. + + * ``DGEN`` - Local manipulation degenerate mode. You access the DGEN option to set wire-frame local + manipulation mode for 3D devices (device dependent). This feature is off by default. + + * ``DLIST`` - With DLIST, you can specify whether screen updates and redraws will be performed using + the Mechanical APDL display list (off), or the 3D device's display list (on). DLIST is on by default for + Windows systems, but off for Linux. + + * ``DELS`` - You use DELS to suppress contour display screen overwrites when :ref:`noerase` is + active. This prevents the bleed-through that occurs when you overlay contour plots. + + * ``TRIS`` - Triangle strip mode. Tri-stripping provides faster 3D display capabilities and is on by + default. Some display enhancements, such as texturing, are adversely affected by tri-stripping. You + can turn off tri-stripping in order to improve these display functions. Be sure to turn tri- + stripping on after the desired output is obtained. + + key : int or str + The following key options apply to ``Lab`` = ACCU: + + * ``0`` - (OFF) The accumulation buffer is not accessed. (default) + + * ``1`` - (ON) Access to the buffer is enabled. + + The following key options apply to ``Lab`` = ACTR: + + * ``0`` - (OFF) The cursor position has no effect on the existing rotational center for dynamic + operations. + + * ``1`` - (ON) The rotational center for dynamic rotations in OpenGL is determined by the position + of the mouse cursor on (or within 15 pixels of) the model. Any rotations that are initiated with the + cursor more than 15 pixels from the model will occur about the midpoint of the Z-axis at that point + in space. If the Z-buffer has not been refreshed the Z-axis will have an infinite value, and + rotations will appear to occur about an extremely long Z-axis. This behavior stops when the graphics + window is refreshed or replotted. (default) + + Note that when using the GUI in 3D mode, when ACTR = 1, the ``Rotational Center`` option is grayed + out under Utility Menu> PlotCtrls> View Setting because the rotational center is determined strictly + by the position of the mouse cursor. + + The following key options apply to ``Lab`` = ANIM: + + * ``0`` - Display list animation. The object can be dynamically manipulated while animating. No + legend, countour or annotation items are displayed. (see Notes, below) + + * ``1`` - On Linux, device-dependent pixmap animation is used. On the PC, bitmap animation is + provided (default). When you animate in this mode, you cannot dynamically manipulate your model (see + Notes, below). + + * ``2`` - On the PC only, this option provides AVI animation which uses the AVI movie player. + + Although you can create animations of multiple Mechanical APDL window schemes, animations created with + OpenGL display lists ( :ref:`dv3d`, ANIM, 0) do not retain the windowing scheme information. You CAN + save multiple windows via the X11/WIN32 drivers, or via the OpenGL driver with :ref:`dv3d`, ANIM, + KEY in effect (where KEY is not zero). + + The following key options apply to ``Lab`` = ANTI + + * ``0`` - (OFF) Anti-aliasing is not active (default). + + * ``1`` - (ON) The anti-aliasing technique will be applied to smooth the lines in your displays + (valid for OpenGL only). + + The following key options apply to ``Lab`` = DGEN: + + * ``0`` - Normal manipulation. + + * ``1`` - Wireframe Manipulation. + + The following key options apply to ``Lab`` = DLIST: + + * ``0`` - (OFF) The Mechanical APDL display list is used for plotting and dynamic graphics manipulation + (Linux default). + + * ``1`` - (ON) The local (3D device) display list is used for plotting and dynamic rotation (Windows + default). + + The following key options apply to ``Lab`` = TRIS: + + * ``0`` - (OFF) Tri-stripping is off. + + * ``1`` - (ON) Tri-stripping is on (default). + + Notes + ----- + + .. warning:: + + This function contains specificities regarding the argument definitions. + Please refer to the `command documentation `_ + for further explanations. + + Mechanical APDL uses display list animation for its 3D models. This memory resident array method + interfaces + with the OpenGL model information to allow the program to efficiently pan, zoom, rotate and + dynamically manipulate your model during animation. The logo, legend, contour and other annotation + items are produced in 2D and will not appear when :ref:`dv3d`, ANIM, 0 is in effect. To display + these items, use :ref:`dv3d`, ANIM, 1. All screen data will be displayed, but manipulation of the + model will not be possible. + """ + command = f"/DV3D,{lab},{key}" + return self.run(command, **kwargs) + + def gcmd( + self, + wn: str = "", + lab1: str = "", + lab2: str = "", + lab3: str = "", + lab4: str = "", + lab5: str = "", + lab6: str = "", + lab7: str = "", + lab8: str = "", + lab9: str = "", + lab10: str = "", + lab11: str = "", + lab12: str = "", + **kwargs, + ): + r"""Controls the type of element or graph display used for the :ref:`gplot` command. + + Mechanical APDL Command: `/GCMD `_ + + Parameters + ---------- + wn : str + Window number (or ALL) to which this command applies (defaults to 1) + + lab1 : str + Command labels (for example, :ref:`plnsol`,S,X) + + lab2 : str + Command labels (for example, :ref:`plnsol`,S,X) + + lab3 : str + Command labels (for example, :ref:`plnsol`,S,X) + + lab4 : str + Command labels (for example, :ref:`plnsol`,S,X) + + lab5 : str + Command labels (for example, :ref:`plnsol`,S,X) + + lab6 : str + Command labels (for example, :ref:`plnsol`,S,X) + + lab7 : str + Command labels (for example, :ref:`plnsol`,S,X) + + lab8 : str + Command labels (for example, :ref:`plnsol`,S,X) + + lab9 : str + Command labels (for example, :ref:`plnsol`,S,X) + + lab10 : str + Command labels (for example, :ref:`plnsol`,S,X) + + lab11 : str + Command labels (for example, :ref:`plnsol`,S,X) + + lab12 : str + Command labels (for example, :ref:`plnsol`,S,X) + + Notes + ----- + + .. _s-GCMD_notes: + + This command controls the type of element or graph display that appears when you issue the + :ref:`gplot` command when the :ref:`gtype`,,(ELEM or GRPH) entity type is active. If you have + multiple plotting windows enabled, you can also use :ref:`gcmd` to select one window when you wish + to edit its contents. + + For related information, see the descriptions of the :ref:`gplot` and :ref:`gtype` commands in this + manual. + + This command is valid in any processor. + """ + command = f"/GCMD,{wn},{lab1},{lab2},{lab3},{lab4},{lab5},{lab6},{lab7},{lab8},{lab9},{lab10},{lab11},{lab12}" + return self.run(command, **kwargs) + + def gcolumn(self, curve: str = "", string: str = "", **kwargs): + r"""Allows the user to apply a label to a specified curve. + + Mechanical APDL Command: `/GCOLUMN `_ + + Parameters + ---------- + curve : str + Curve number on which label will be applied (integer value between 1 and 10). + + string : str + Name or designation that will be applied to the curve (8 characters max). + + Notes + ----- + + .. _s-GCOLUMN_notes: + + This command is used for an array parameter plot (a plot created by the :ref:`starvplot` command). + Normally the label for curve 1 is COL 1, the label for curve 2 is COL 2 and so on; the column number + is the field containing the dependent variables for that particular curve. Issuing :ref:`gcolumn`, + ``CURVE``, with no string value specified resets the label to the original value. + """ + command = f"/GCOLUMN,{curve},{string}" + return self.run(command, **kwargs) + + def gfile(self, size: str = "", **kwargs): + r"""Specifies the pixel resolution on Z-buffered graphics files. + + Mechanical APDL Command: `/GFILE `_ + + Parameters + ---------- + size : str + Pixel resolution. Defaults to a pixel resolution of 800. Valid values are from 256 to 2400. + + Notes + ----- + + .. _s-GFILE_notes: + + Defines the pixel resolution on subsequently written graphics files (for example, JPEG, PNG, TIFF) + for software Z-buffered displays ( :ref:`slashtype` ). Lowering the pixel resolution produces a + fuzzier image; increasing the resolution produces a sharper image but takes a little longer. + + This command is valid in any processor. + """ + command = f"/GFILE,{size}" + return self.run(command, **kwargs) + + def gplot(self, **kwargs): + r"""Controls general plotting. + + Mechanical APDL Command: `GPLOT `_ + + Notes + ----- + + .. _GPLOT_notes: + + This command displays all entity types as specified via the :ref:`gtype` command. Only selected + entities ( :ref:`nsel`, :ref:`esel`, :ref:`ksel`, :ref:`lsel`, :ref:`asel`, :ref:`vsel` ) will be + displayed. See the descriptions of the :ref:`gtype` and :ref:`gcmd` commands for methods of setting + the entity types displayed. + + This command is valid in any processor. + """ + command = "GPLOT" + return self.run(command, **kwargs) + + def graphics(self, key: str = "", **kwargs): + r"""Defines the type of graphics display. + + Mechanical APDL Command: `/GRAPHICS `_ + + Parameters + ---------- + key : str + Graphics key: + + * ``FULL`` - Display all model geometry and results. + + * ``POWER`` - Activate PowerGraphics (default when GUI is on). + + Notes + ----- + + .. _s-GRAPHICS_notes: + + The :ref:`graphics` command specifies the type of graphics display. ``Key`` = POWER activates the + PowerGraphics capability. PowerGraphics offers faster plotting than the ``Key`` = FULL + option, and speeds up element, results, area, line, and volume displays. + + The default PowerGraphics mode is enabled automatically when accessing the GUI. This action + supersedes all prior macros or start-up routines ( :file:`start.ans`, :file:`config.ans`, etc.). + Full graphics mode is accessed only by issuing :ref:`graphics`,FULL after the GUI is active. + + Results values (both printed and plotted) may differ between the ``Key`` = FULL + and ``Key`` = POWER options because each option specifies a different set of data for + averaging and display. For ``Key`` = FULL, all element and results + values (interior and surface) are included. For ``Key`` = POWER, only + element and results values along the model exterior surface are processed. + + When ``Key`` = FULL, it is possible to deselect an individual node, select all elements (including + the element that contains that node), and then perform postprocessing calculations on those elements + and have that unselected node not be considered in those calculations. If PowerGraphics is active, + however, postprocessing always displays based on selected elements. + + If you have specified one facet per element edge for PowerGraphics displays (via the :ref:`efacet` + command or options from the General Postproc or Utility menu), PowerGraphics does not plot midside + nodes. ( :ref:`efacet` applies to element type displays only.) + + Maximum values shown in plots can differ from printed maximum values. This is due to different + averaging schemes used for plotted and printed maximum values. + + When using solution coordinate systems for results output ( :ref:`rsys`,SOLU) with PowerGraphics, + the deformed or displaced shape in a POST1 contour display can be unexpected (although the contours + are displayed in the expected colors). The program does not rotate displacement values (Ux,Uy,Uz) to + global; instead, the displacements (stored locally) are added directly to the global coordinates + (X,Y,Z). For example, if in PREP7 the nodes are rotated 90 degrees about the z axis and the global + Uy displacements are relatively large, the Ux values will be large, causing the model to display a + large deformation in the global X direction. + + PowerGraphics displays do not average at geometric discontinuities. The printouts in PowerGraphics + will, however, provide averaging information at geometric discontinuities if the models do not + contain shell elements. Carefully inspect the data you obtain at geometric discontinuities. + + PowerGraphics does not support the following diffusion analysis results: CONC, CG, DF, EPDI. + + ``Key`` = FULL is not available for `XFEM-based crack-growth analysis + `_. + + Excepting a few options, PowerGraphics supports these commands: + + This command contains some tables and extra information which can be inspected in the original + documentation pointed above. + + The following commands are executed via the ``Key`` = FULL option, + regardless of whether PowerGraphics is activated: + + This command contains some tables and extra information which can be inspected in the original + documentation pointed above. + """ + command = f"/GRAPHICS,{key}" + return self.run(command, **kwargs) + + def gresume(self, fname: str = "", ext: str = "", **kwargs): + r"""Sets graphics settings to the settings on a file. + + Mechanical APDL Command: `/GRESUME `_ + + Parameters + ---------- + 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 :file:`Jobname`. + + ext : str + Filename extension (eight-character maximum). The extension defaults to GSAV if ``Fname`` is + blank. + + Notes + ----- + + .. _s-GRESUME_notes: + + Causes a file to be read to reset the graphics slash (/) commands as they were at the last + :ref:`gsave` command. + + This command is valid in any processor. + """ + command = f"/GRESUME,{fname},{ext}" + return self.run(command, **kwargs) + + def gsave(self, fname: str = "", ext: str = "", **kwargs): + r"""Saves graphics settings to a file for later use. + + Mechanical APDL Command: `/GSAVE `_ + + Parameters + ---------- + 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 :file:`Jobname`. + + ext : str + Filename extension (eight-character maximum). The extension defaults to GSAV if ``Fname`` is + blank. + + Notes + ----- + + .. _s-GSAVE_notes: + + This command does not save all graphics settings, but only those that may be reset by the + :ref:`slashreset` command. The database remains untouched. Use the :ref:`gresume` command to read + the file. Repeated use of the :ref:`gsave` command overwrites the previous data on the file. The + following commands are saved by :ref:`gsave` : + + This command contains some tables and extra information which can be inspected in the original + documentation pointed above. + + This command is valid in any processor. + """ + command = f"/GSAVE,{fname},{ext}" + return self.run(command, **kwargs) + + def gtype(self, wn: str = "", label: str = "", key: int | str = "", **kwargs): + r"""Controls the entities that the :ref:`gplot` command displays. + + Mechanical APDL Command: `/GTYPE `_ + + Parameters + ---------- + wn : str + Window number (or ALL) to which this command applies (defaults to 1) + + label : str + This represents the type of entity to display: + + * ``NODE`` - Nodes + + * ``ELEM`` - Elements + + * ``KEYP`` - Keypoints + + * ``LINE`` - Lines + + * ``AREA`` - Areas + + * ``VOLU`` - Volumes + + * ``GRPH`` - Graph displays + + key : int or str + Switch: + + * ``0`` - Turns the entity type off. + + * ``1`` - Turns the entity type on. + + Notes + ----- + + .. _s-GTYPE_notes: + + The :ref:`gtype` command controls which entities the :ref:`gplot` command displays. NODE, ELEM, + KEYP, LINE, AREA, and VOLU are on by default. When ELEM is activated, you can control the type of + element displayed via the :ref:`gcmd` command (which also controls the type of graph display). When + the GRPH entity type is activated, all other entity types are deactivated. Conversely, when any of + the NODE, ELEM, KEYP, LINE, AREA, and VOLU entity types are active, the GRPH entity type is + deactivated. + + The :ref:`gtype` command gives you several options for multi-window layout: + + * One window + + * Two windows (left and right or top and bottom of the screen) + + * Three windows (two at the top and one at the bottom of the screen, or one top and two bottom + windows + + * Four windows (two at the top and two at the bottom) + + Once you choose a window layout, you can choose one of the following: multiple plots, replotting, or + no redisplay. + + This command is valid in any processor. + """ + command = f"/GTYPE,{wn},{label},{key}" + return self.run(command, **kwargs) + + def image(self, label: str = "", fname: str = "", ext: str = "", **kwargs): + r"""Allows graphics data to be captured and saved. + + Mechanical APDL Command: `/IMAGE `_ + + Parameters + ---------- + label : str + Label specifying the operation to be performed: + + * ``CAPTURE`` - Capture the image from the graphics window to a new window. + + * ``RESTORE`` - Restore the image from a file to a new window. + + * ``SAVE`` - Save the contents of the graphic window to a file. + + * ``DELETE`` - Delete the window that contains the file. + + 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. + + ext : str + Filename extension (eight-character maximum). If no extension is specified, :file:`bmp` will be + used on Windows systems, and :file:`img` will be used on Linux systems. + """ + command = f"/IMAGE,{label},{fname},{ext}" + return self.run(command, **kwargs) + + def immed(self, key: int | str = "", **kwargs): + r"""Allows immediate display of a model as it is generated. + + Mechanical APDL Command: `IMMED `_ + + Parameters + ---------- + key : int or str + Immediate mode key: + + * ``0`` - Display only upon request, that is, no immediate display (default with the GUI off ). + + * ``1`` - Display immediately as model is generated (default with the GUI on ). + + Notes + ----- + + .. _IMMED_notes: + + The command enables you to control whether or not the model is displayed immediately as it is + generated in an interactive session. Available only during an interactive session at a graphics + display terminal. A valid graphics device name must first be specified ( :ref:`show` ). + + By default in the GUI, your model is immediately displayed in the Graphics window as you create new + entities (such as areas, keypoints, nodes, elements, local coordinate systems, boundary conditions, + etc.), referred to as immediate mode graphics. + + Symbols (such as boundary conditions, local coordinate system triads, etc.) appear immediately and + are present on subsequent displays unless you disable the appropriate symbol (via the GUI plot + controls function or the appropriate graphics-specification command). + + An immediate image is also scaled automatically to fit within the Graphics window. The new scaling + is usually apparent on the automatic replot associated with immediate mode. To suppress automatic + replot, issue :ref:`uis`,REPLOT,0. (With automatic replot suppressed, the immediate image may not + always be scaled correctly.) + + An immediate display in progress should not be aborted with the usual system "break" feature (or + else the Mechanical APDL session itself terminates). When you run Mechanical APDL interactively + without using the + GUI, immediate mode is off by default. + + This command is valid only in PREP7. + """ + command = f"IMMED,{key}" + return self.run(command, **kwargs) + + def jpeg(self, kywrd: str = "", opt: str = "", **kwargs): + r"""Provides JPEG file export for Mechanical APDL displays. + + Mechanical APDL Command: `JPEG `_ + + Parameters + ---------- + kywrd : str + Specifies various JPEG file export options. + + * ``QUAL`` - If ``Kywrd`` = QUAL, then ``OPT`` is an integer value defining the JPEG quality index + on an arbitrary scale ranging from 1 to 100. The default value is 75. + + * ``ORIENT`` - If ``Kywrd`` = ORIENT, then ``OPT`` will determine the orientation of the entire + plot. ``OPT`` can be either Horizontal (default) or Vertical. + + * ``COLOR`` - If ``Kywrd`` = COLOR, then ``OPT`` will determine the color depth of the saved file. + ``OPT`` can be 0, 1, or 2, corresponding to Black and White, Grayscale, and Color (default), + respectively. + + * ``TMOD`` - If ``Kywrd`` = TMOD, then ``OPT`` will determine the text method. ``OPT`` can be either + 1 or 0, corresponding to bitmap text (default) or line stroke text, respectively. + + * ``DEFAULT`` - If ``Kywrd`` = DEFAULT, then all of the default values, for all of the Kywrd + parameters listed above, are active. + + opt : str + ``OPT`` can have the following names or values, depending on the value for ``Kywrd`` (see above). + + * ``1 to 100`` - If ``Kywrd`` = QUAL, a value between 1 and 100 will determine the quality index of + the JPEG file. + + * ``Horizontal, Vertical`` - If ``Kywrd`` = ORIENT, the terms Horizontal or Vertical determine the + orientation of the plot. + + * ``0,1,2`` - If ``Kywrd`` = COLOR, the numbers 0, 1, and 2 correspond to Black and White, Grayscale + and Color, respectively. + + * ``1,0`` - If ``Kywrd`` = TMOD, the values 1 and 0 determine whether bitmap (1) or stroke text (0) + fonts will be used + + """ + command = f"JPEG,{kywrd},{opt}" + return self.run(command, **kwargs) + + def mrep( + self, + name: str = "", + arg1: str = "", + arg2: str = "", + arg3: str = "", + arg4: str = "", + arg5: str = "", + arg6: str = "", + arg7: str = "", + arg8: str = "", + arg9: str = "", + arg10: str = "", + arg11: str = "", + arg12: str = "", + arg13: str = "", + arg14: str = "", + arg15: str = "", + arg16: str = "", + arg17: str = "", + arg18: str = "", + **kwargs, + ): + r"""Enables you to reissue the graphics command macro "name" during a replot or zoom operation. + + Mechanical APDL Command: `/MREP `_ + + Parameters + ---------- + name : str + The name identifying the macro file or macro block on a macro library file. The name can contain + up to eight characters maximum and must begin with a letter. + + arg1 : str + Values to be passed into the file or block. + + arg2 : str + Values to be passed into the file or block. + + arg3 : str + Values to be passed into the file or block. + + arg4 : str + Values to be passed into the file or block. + + arg5 : str + Values to be passed into the file or block. + + arg6 : str + Values to be passed into the file or block. + + arg7 : str + Values to be passed into the file or block. + + arg8 : str + Values to be passed into the file or block. + + arg9 : str + Values to be passed into the file or block. + + arg10 : str + Values to be passed into the file or block. + + arg11 : str + Values to be passed into the file or block. + + arg12 : str + Values to be passed into the file or block. + + arg13 : str + Values to be passed into the file or block. + + arg14 : str + Values to be passed into the file or block. + + arg15 : str + Values to be passed into the file or block. + + arg16 : str + Values to be passed into the file or block. + + arg17 : str + Values to be passed into the file or block. + + arg18 : str + Values to be passed into the file or block. + + Notes + ----- + + .. _s-MREP_notes: + + This command reissues the graphics command macro "name" during a replot operation ( :ref:`replot` ) + or a zoom ( :ref:`zoom` ) operation. The program passes the command macro arguments to the replot + and zoom feature for use by the graphics macro. You should place the ``s-MREP`` command at the end + of the graphics command macro, following the last graphics command within the macro, to enable the + replot or zoom feature. + """ + command = f"/MREP,{name},{arg1},{arg2},{arg3},,{arg4},{arg5},{arg6},{arg7},{arg8},{arg9},{arg10},{arg11},{arg12},{arg13},{arg14},{arg15},{arg16},{arg17},{arg18}" + return self.run(command, **kwargs) + + def noerase(self, **kwargs): + r"""Prevents the screen erase between displays. + + Mechanical APDL Command: `/NOERASE `_ + + Notes + ----- + + .. _s-NOERASE_notes: + + Preventing the normal screen erase between requested displays allows you to overlay multiple views. + + Clearing the screen with the ``ERASE`` command ( Utility Menu> PlotCtrls> Erase Options> Erase + screen ) active simply clears the display area. Subsequent replots will provide the cumulative plots + previously generated by the :ref:`noerase` command. + + For 3D devices, you can issue :ref:`dv3d`,DELS to suppress repeated screen overlays and generate + clear contour plots. + + Use the ``/ERASE`` command to reactivate automatic screen erase. + + For 3D devices ( :ref:`show`,3D), the model in all active windows will be the same, even if you + issue a different display command ( :ref:`nplot`, :ref:`eplot`, etc.) for each active window. Use + the Multi-Plot command ( :ref:`gplot` ) to display different entities, in different windows, on 3D + devices. + + This command is valid in any processor. + """ + command = "/NOERASE" + return self.run(command, **kwargs) + + def pngr(self, kywrd: str = "", opt: str = "", val: int | str = "", **kwargs): + r"""Provides PNG file export for Mechanical APDL displays. + + Mechanical APDL Command: `PNGR `_ + + Parameters + ---------- + kywrd : str + Specifies various PNG file export options. + + * ``COMP`` - If ``Kywrd`` = COMP, then ``OPT`` is either ON or OFF (blank is interpreted as OFF). + This option allows you to turn PNG file compression ON or OFF. If OPT = ON, then The VAL field is + read to determine the degree of compression. See the VALUE argument for acceptable compression + values. + + * ``ORIENT`` - If ``Kywrd`` = ORIENT, then ``OPT`` will determine the orientation of the entire + plot. ``OPT`` can be either Horizontal (default) or Vertical. + + * ``COLOR`` - If ``Kywrd`` = COLOR, then ``OPT`` will determine the color depth of the saved file. + ``OPT`` can be 0, 1, or 2, corresponding to Black and White, Grayscale, and Color (default), + respectively. + + * ``TMOD`` - If ``Kywrd`` = TMOD, then ``OPT`` will determine the text method. ``OPT`` can be either + 1 or 0, corresponding to bitmap text (default) or line stroke text, respectively. + + * ``DEFAULT`` - If ``Kywrd`` = DEFAULT, then all of the default values, for all of the Kywrd + parameters listed above, are active. + + * ``STAT`` - Shows the current status of PNG file export. + + opt : str + ``OPT`` can have the following names or values, depending on the value for ``Kywrd`` (see above). + + * ``ON, OFF`` - If ``Kywrd`` = COMP, the values On and Off control the use of compression. The + degree of compression is determined by VAL + + * ``Horizontal, Vertical`` - If ``Kywrd`` = ORIENT, the terms Horizontal or Vertical determine the + orientation of the plot. + + * ``0, 1, 2`` - If ``Kywrd`` = COLOR, the numbers 0, 1, and 2 correspond to Black and White, + Grayscale and Color, respectively. + + * ``1, 0`` - If ``Kywrd`` = TMOD, the values 1 and 0 determine whether bitmap (1) or stroke text (0) + fonts will be used + + val : int or str + ``VAL`` is active only when ``Kywrd`` = COMP, and determines the degree of compression applied to + the exported file (see above). + + * ``-1`` - Apply the default, optimum value for compression. This value represents the best + combination of speed and compression. It varies according to the release level of the ZLIB + compression package. + + * ``1-9`` - Use this value to specify a specific compression level. 1 is the lowest compression + level (fastest) and 9 is the highest compression level (slowest). + + """ + command = f"PNGR,{kywrd},{opt},{val}" + return self.run(command, **kwargs) + + def pstatus(self, wn: str = "", **kwargs): + r"""Displays the global or window display specifications. + + Mechanical APDL Command: `/PSTATUS `_ + + Parameters + ---------- + wn : str + Window number for status (defaults to global specifications). + + Notes + ----- + + .. _s-PSTATUS_notes: + + Displays the current global or window display specifications. Global display specifications are + common to all windows (e.g. :ref:`show`, etc.). Window display specifications are specific to one + window (e.g. :ref:`view`, :ref:`slashtype`, etc.). + + This command is valid in any processor. + """ + command = f"/PSTATUS,{wn}" + return self.run(command, **kwargs) + + def replot(self, label: str = "", **kwargs): + r"""Reissues the last display command. + + Mechanical APDL Command: `/REPLOT `_ + + Parameters + ---------- + label : str + Controls the type of replot. + + * ``RESIZE`` - Issued internally when a graphics window resize occurs (Default). + + * ``FAST`` - Only applicable for 3D devices that allow a fast redisplay for changes in the view + characteristics only. + + Notes + ----- + + .. _s-REPLOT_notes: + + Reissues the last display command ( :ref:`nplot`, :ref:`eplot`, :ref:`kplot`, :ref:`plnsol`, + :ref:`plvar`, etc.), along with its parameters, for convenience. The current display specifications + are used. + + When the last display command is invalid in a given processor, :ref:`replot` is also invalid in that + processor. However, if you attempt a :ref:`replot` and the last display command is invalid in the + current processor, Mechanical APDL generates an element display ( :ref:`eplot` ) instead, as long as + the + last display command was :ref:`plnsol`, :ref:`plesol`, or :ref:`pldisp`. + + Example: :ref:`replot` Replaced by :ref:`eplot` Automatically + + :ref:`plnsol`, used to display solution results as continuous contours, is a valid command in the + POST1 general postprocessor. + + If you issue :ref:`plnsol` followed by :ref:`replot` while in POST1, :ref:`replot` effectively + reissues your earlier :ref:`plnsol` command, along with its parameters. + + If you then exit POST1, enter the PREP7 preprocessor, and again issue :ref:`replot`, the program + uses :ref:`eplot` internally instead. + + The command substitution occurs because :ref:`plnsol` is not a valid command in PREP7. + + When you click one of the buttons on the `Pan, Zoom, Rotate + `_ + dialog box to manipulate the view of a model, :ref:`replot` is issued internally. Thus, the + substitution of :ref:`replot` with :ref:`eplot` as described above may also occur for operations + that you perform via with the `Pan, Zoom, Rotate + `_ + dialog box. + + :ref:`replot` does not show boundary conditions if they are applied only to a solid model and the + last display command (such as :ref:`eplot` ) displays the finite element model. To show boundary + conditions, the following options are available: + + * Issue :ref:`replot` after you issue :ref:`sbctran` to transfer solid model boundary conditions to + the finite element model. + + * Issue :ref:`replot` after you issue a solid model display command (such as :ref:`vplot` ). + + This command is valid in any processor (except as noted above). + """ + command = f"/REPLOT,{label}" + return self.run(command, **kwargs) + + def seg(self, label: str = "", aviname: str = "", delay: str = "", **kwargs): + r"""Allows graphics data to be stored in the local terminal memory. + + Mechanical APDL Command: `/SEG `_ + + Parameters + ---------- + label : str + Storage key: + + * ``SINGL`` - Store subsequent display in a single segment (overwrites last storage). + + * ``MULTI`` - Store subsequent displays in unique segments ( :ref:`anim` ). + + * ``DELET`` - Delete all currently stored segments. + + * ``OFF`` - Stop storing display data in segments. + + * ``STAT`` - Display segment status. + + * ``PC`` - This option only applies to PC versions of Mechanical APDL and only when animating via the AVI + movie player ( :ref:`device`,ANIM,2). The command appends frames to the :file:`File.AVI`, so that + the animation goes in both directions (that is, forward--backward--forward). You must have a current + animation file to use this option. + + aviname : str + Name of the animation file that will be created when each frame is saved. The :file:`.AVI` + extension is applied automatically. Defaults to :file:`Jobname.AVI` if no filename is specified. + + delay : str + Delay factor between each frame, in seconds. Defaults to 0.015 seconds if no value is specified. + + Notes + ----- + + .. _s-SEG_notes: + + Allows graphics data to be stored in the terminal local memory (device-dependent). Storage occurs + concurrently with the display. + + Although the information from your graphics window is stored as an individual segment, you cannot + plot directly ( :ref:`gplot` ) from the segment memory. + + This command is valid in any processor. + """ + command = f"/SEG,{label},{aviname},{delay}" + return self.run(command, **kwargs) + + def show( + self, + fname: str = "", + option: str = "", + vect: int | str = "", + ncpl: str = "", + **kwargs, + ): + r"""Specifies the device and other parameters for graphics displays. + + Mechanical APDL Command: `/SHOW `_ + + Parameters + ---------- + fname : str + Device name, file name, or keyword, as listed below: + + * ``<, device name >`` - Any valid graphics display device name (for example, X11, 3D etc.). + Defaults to X11 for most systems. See `Getting Started with Graphics + `_ in the `Basic Analysis Guide `_ + for details. A device name must be defined before activating the Graphical User Interface (GUI). + Once the GUI is activated, the device name cannot be changed for that session, except for switching + between X11 and X11C. + + * ``TERM`` - Graphics displays are switched back to the last-specified device name. + + * ``CLOSE`` - This option purges the graphics file buffer. The CLOSE option should be issued any + time you are changing graphics devices or file output types during a session. Graphics displays are + switched back to the last-specified device name, and any open graphics files are closed. The CLOSE + option is similar to the TERM option, however, with the CLOSE option, another process can access the + data in the graphics file. The CLOSE option causes graphics file buffers to be flushed to the + graphics file. + + * ``OFF`` - Graphics display requests are ignored. + + * ``(blank)`` - If blank in interactive mode, graphics will be displayed on screen as requested by + display commands (no file written). + + * ``JPEG`` - Creates JPEG files that are named :file:`Jobnamennn.jpg`, where ``nnn`` is a numeric + value that is incremented by one as each additional file is created; that is, + :file:`Jobname000.jpg`, :file:`Jobname001.jpg`, :file:`Jobname002.jpg`, and so on. Ignores the + ``Ext`` field. + + * ``TIFF`` - Creates tagged image format files that are named :file:`Jobnamennn.tif`, where ``nnn`` + is a numeric value that is incremented by one as each additional file is created; that is, + :file:`Jobname000.tif`, :file:`Jobname001.tif`, :file:`Jobname002.tif`, and so on. This value for + the ``Fname`` argument ignores the ``Ext`` field. (See the :ref:`tiff` command for options.) + + * ``PNG`` - Creates PNG (Portable Network Graphics) files that are named :file:`Jobnamennn.png`, + where ``nnn`` is a numeric value that is incremented by one as each additional file is created; that + is, :file:`Jobname000.png`, :file:`Jobname001.png`, :file:`Jobname002.png`, and so on. This value + for the ``Fname`` argument ignores the ``Ext`` field. (See the :ref:`pngr` command for options.) + + * ``VRML`` - Creates Virtual Reality Meta Language files named :file:`Jobname000.wrl` that can be + displayed on 3D Internet web browsers. Ignores the ``Ext`` and ``NCPL`` fields. + + option : str + Assign a file name extension or specify reverse video output: + + * ``Ext`` - File name extension (eight-character maximum). + + * ``REV`` - Reverse background/image (black/white) colors. Valid with ``Fname`` = PNG (recommended), + JPEG, and TIFF. This option is ignored if a previously specified color map table ( :ref:`cmap` or + :ref:`rgb` ) is in effect. + + vect : int or str + Specifies raster or vector display mode. This affects area, volume, and element displays, as well as + geometric results displays such as contour plots. See the :ref:`device` command for an alternate way to toggle between raster and vector mode. Changing ``VECT`` also resets the :ref:`slashtype` command to its default. + + * ``0`` - Raster display (color filled entities; default) + + * ``1`` - Vector display (outlined entities; that is, "wireframe") + + ncpl : str + Sets the number of color planes (4 to 8). Default is device-dependent. ``NCPL`` is not supported + by all graphics devices. + + Notes + ----- + + .. _s-SHOW_notes: + + Specifies the device to be used for graphics displays, and specifies other graphics display + parameters. Display may be shown at the time of generation (for interactive runs at a graphics + display terminal) or diverted to a file. Issue :ref:`pstatus` for display status. + + Batch runs do not have access to the fonts available on your system. The Courier and Helvetica font + files used for JPEG, PNG and TIFF batch output are copyrighted by Adobe Systems Inc. and Digital + Equipment Corp. Permission to use these trademarks is hereby granted only in association with the + images described above. Batch run JPEG output is produced at the default quality index value of 75, + unless specified otherwise. + + Interactive displays default to eight color planes ( ``NCPL`` = 8) for most monitors, while graph + file output defaults to eight color planes for VRML output, and four color planes for JPEG, PNG, and + TIFF. + + This command is valid in any processor. + """ + command = f"/SHOW,{fname},{option},{vect},{ncpl}" + return self.run(command, **kwargs) + + def slashreset(self, **kwargs): + r"""Resets display specifications to their initial defaults. + + Mechanical APDL Command: `/RESET `_ + + Notes + ----- + + .. _s-RESET_notes: + + Resets slash display specifications ( :ref:`window`, :ref:`slashtype`, :ref:`view`, etc.) back to + their initial default settings (for convenience). Also resets the focus location to the geometric + center of the object. + + This command is valid in any processor. + """ + command = "/RESET" + return self.run(command, **kwargs) + + def tiff(self, kywrd: str = "", opt: str = "", **kwargs): + r"""Provides TIFF file export for Mechanical APDL displays. + + Mechanical APDL Command: `TIFF `_ + + Parameters + ---------- + kywrd : str + Specifies various TIFF file export options. + + * ``COMP`` - If ``Kywrd`` = COMP, then ``OPT`` controls data compression for the output file. If + COMP = 0, then compression is off. If COMP = 1 (default), then compression is on. + + * ``ORIENT`` - If ``Kywrd`` = ORIENT, then ``OPT`` will determine the orientation of the entire + plot. ``OPT`` can be either Horizontal (default) or Vertical. + + * ``COLOR`` - If ``Kywrd`` = COLOR, then ``OPT`` will determine the color attribute of the saved + file. ``OPT`` can be 0, 1, or 2, corresponding to Black and White, Grayscale, and Color (default), + respectively. + + * ``TMOD`` - If ``Kywrd`` = TMOD, then ``OPT`` will determine the text method. ``OPT`` can be either + 1 or 0, corresponding to bitmap text (default) or line stroke text, respectively. + + * ``DEFAULT`` - If ``Kywrd`` = DEFAULT, then all of the default values, for all of the Kywrd + parameters listed above, are active. + + opt : str + ``OPT`` can have the following names or values, depending on the value for ``Kywrd`` (see above). + + * ``1 or 0`` - If ``Kywrd`` = COMP, a value or 1 (on) or 0 (off) will control compression for the + TIFF file. + + * ``Horizontal, Vertical`` - If ``Kywrd`` = ORIENT, the terms Horizontal or Vertical determine the + orientation of the plot. + + * ``0, 1, 2`` - If ``Kywrd`` = COLOR, the numbers 0, 1, and 2 correspond to Black and White, + Grayscale and Color, respectively. + + * ``1, 0`` - If ``Kywrd`` = TMOD, the values 1 and 0 determine whether bitmap (1) or stroke text (0) + fonts will be used + + """ + command = f"TIFF,{kywrd},{opt}" + return self.run(command, **kwargs) + + def window( + self, + wn: str = "", + xmin: str = "", + xmax: str = "", + ymin: str = "", + ymax: str = "", + ncopy: str = "", + **kwargs, + ): + r"""Defines the window size on the screen. + + Mechanical APDL Command: `/WINDOW `_ + + Parameters + ---------- + wn : str + Window reference number (1 to 5). Defaults to 1. This number, or ALL (for all active windows), + may be used on other commands. + + xmin : str + Screen coordinates defining window size. Screen coordinates are measured as -1.0 to 1.67 with + the origin at the screen center. For example, (-1,1.67,-1,1) is full screen, (-1,0,-1,0) is the + left bottom quadrant. If ``XMIN`` = OFF, deactivate this previously defined window; if ON, + reactivate this previously defined window. If FULL, LEFT, RIGH, TOP, BOT, LTOP, LBOT, RTOP, + RBOT, form full, half, or quarter window. If SQUA, form largest square window within the current + graphics area. If DELE, delete this window (cannot be reactivated with ON). + + xmax : str + Screen coordinates defining window size. Screen coordinates are measured as -1.0 to 1.67 with + the origin at the screen center. For example, (-1,1.67,-1,1) is full screen, (-1,0,-1,0) is the + left bottom quadrant. If ``XMIN`` = OFF, deactivate this previously defined window; if ON, + reactivate this previously defined window. If FULL, LEFT, RIGH, TOP, BOT, LTOP, LBOT, RTOP, + RBOT, form full, half, or quarter window. If SQUA, form largest square window within the current + graphics area. If DELE, delete this window (cannot be reactivated with ON). + + ymin : str + Screen coordinates defining window size. Screen coordinates are measured as -1.0 to 1.67 with + the origin at the screen center. For example, (-1,1.67,-1,1) is full screen, (-1,0,-1,0) is the + left bottom quadrant. If ``XMIN`` = OFF, deactivate this previously defined window; if ON, + reactivate this previously defined window. If FULL, LEFT, RIGH, TOP, BOT, LTOP, LBOT, RTOP, + RBOT, form full, half, or quarter window. If SQUA, form largest square window within the current + graphics area. If DELE, delete this window (cannot be reactivated with ON). + + ymax : str + Screen coordinates defining window size. Screen coordinates are measured as -1.0 to 1.67 with + the origin at the screen center. For example, (-1,1.67,-1,1) is full screen, (-1,0,-1,0) is the + left bottom quadrant. If ``XMIN`` = OFF, deactivate this previously defined window; if ON, + reactivate this previously defined window. If FULL, LEFT, RIGH, TOP, BOT, LTOP, LBOT, RTOP, + RBOT, form full, half, or quarter window. If SQUA, form largest square window within the current + graphics area. If DELE, delete this window (cannot be reactivated with ON). + + ncopy : str + Copies the current specifications from window ``NCOPY`` (1 to 5) to this window. If ``NCOPY`` = + 0 (or blank), no specifications are copied. + + Notes + ----- + + .. _s-WINDOW_notes: + + Defines the window size on the screen. Windows may occupy a separate section of the screen or they + may overlap. Requested displays are formed in all windows according to the selected window + specifications. + + This command is valid in any processor. + """ + command = f"/WINDOW,{wn},{xmin},{xmax},{ymin},{ymax},{ncopy}" + return self.run(command, **kwargs) diff --git a/src/ansys/mapdl/core/_commands/graphics/style.py b/src/ansys/mapdl/core/_commands/graphics/style.py new file mode 100644 index 00000000000..8077e2ea6c5 --- /dev/null +++ b/src/ansys/mapdl/core/_commands/graphics/style.py @@ -0,0 +1,928 @@ +# Copyright (C) 2016 - 2025 ANSYS, Inc. and/or its affiliates. +# SPDX-License-Identifier: MIT +# +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to deal +# in the Software without restriction, including without limitation the rights +# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +# copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in all +# copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +# SOFTWARE. + +import warnings + + +class Style: + + def cplane(self, key: int | str = "", **kwargs): + r"""Specifies the cutting plane for section and capped displays. + + Mechanical APDL Command: `/CPLANE `_ + + **Command default:** + + .. _s-CPLANE_default: + + The cutting plane is normal to the viewing vector at the focus point. + + Parameters + ---------- + key : int or str + Specifies the cutting plane: + + * ``0`` - Cutting plane is normal to the viewing vector ( :ref:`view` ) and passes through the focus + point ( :ref:`focus` ) (default). + + * ``1`` - The working plane ( :ref:`wplane` ) is the cutting plane. + + Notes + ----- + + .. _s-CPLANE_notes: + + Defines the cutting plane to be used for section and capped displays ( :ref:`slashtype`,,(1, 5, or + 7)). + + This command is valid in any processor. + """ + command = f"/CPLANE,{key}" + return self.run(command, **kwargs) + + def ctype( + self, + key: int | str = "", + dotd: str = "", + dots: str = "", + dshp: int | str = "", + tlen: str = "", + **kwargs, + ): + r"""Specifies the type of contour display. + + Mechanical APDL Command: `/CTYPE `_ + + **Command default:** + + .. _s-CTYPE_default: + + Standard contour display. + + Parameters + ---------- + key : int or str + Type of display: + + * ``0`` - Standard contour display. + + * ``1`` - Isosurface display. + + * ``2`` - Particle gradient display. + + * ``3`` - Gradient triad display. + + dotd : str + Maximum dot density for particle gradient display ( ``KEY`` = 2). Density is expressed as dots + per screen width (defaults to 30). + + dots : str + Dot size for particle gradient display ( ``KEY`` = 2). Size is expressed as a fraction of the + screen width (defaults to 0.0 (single dot width)). + + dshp : int or str + Spherical dot shape precision for particle gradient display ( ``KEY`` = 2). (3D options are supported only on 3D devices): + + * ``0`` - Flat 2D circular dot. + + * ``1`` - Flat-sided 3D polyhedron. + + * ``n`` - 3D sphere with ``n`` (>1) polygon divisions per 90° of radius. + + tlen : str + Maximum length of triads for gradient triad display ( ``KEY`` = 3). Value is expressed as a + fraction of the screen width (defaults to 0.067). + + Notes + ----- + + .. _s-CTYPE_notes: + + Use :ref:`ctype`,STAT to display the current settings. Only the standard contour display ( + :ref:`ctype`,0) and the isosurface contour display ( :ref:`ctype`,1) are supported by + PowerGraphics ( :ref:`graphics`,POWER). + + This command is valid in any processor. + """ + command = f"/CTYPE,{key},{dotd},{dots},{dshp},{tlen}" + return self.run(command, **kwargs) + + def edge(self, wn: str = "", key: int | str = "", angle: str = "", **kwargs): + r"""Displays only the common lines (“edges”) of an object. + + Mechanical APDL Command: `/EDGE `_ + + **Command default:** + + .. _s-EDGE_default: + + For element plots, display common lines between all adjacent element faces. For contour plots, + display only the common lines between non-coplanar faces. + + Parameters + ---------- + wn : str + Window number (or ALL) to which command applies. The default window is 1. + + key : int or str + Edge key: + + **Elements Plots** + + * ``0`` - Display common lines between all adjacent element faces. + + * ``1`` - Display only the common lines between non-coplanar faces (that is, show only the edges). + + **Contour Plots** + + * ``0`` - Display only the common lines between non-coplanar faces. + + * ``1`` - Display common lines between all element faces. + + angle : str + Largest angle between two faces for which the faces are considered to be coplanar (0° to 180°). + Defaults to 45°. A smaller angle produces more edges, a larger angle produces fewer edges. + + Notes + ----- + + .. _s-EDGE_notes: + + The ``ANGLE`` field is used in PowerGraphics to determine geometric discontinuities. It is a + tolerance measure for the differences between the normals of the surfaces being considered. Values + within the tolerance are accepted as coplanar (geometrically continuous). In postprocessing + displays, results are not averaged across discontinuous surfaces. + + A surface can be displayed as an edge outline without interior detail. This is useful for both + geometry and postprocessing displays. Element outlines are normally shown as solid lines for + geometry and displacement displays. Lines common to adjacent "coplanar" element faces are removed + from the display. Midside nodes of elements are ignored. + + The :ref:`shrink` option is ignored with the edge option. + + :ref:`edge` is not supported for :ref:`plesol` and :ref:`eshape` displays when in PowerGraphics mode + ( :ref:`graphics`,POWER). + + The :ref:`edge` command is valid in any processor. + """ + command = f"/EDGE,{wn},{key},{angle}" + return self.run(command, **kwargs) + + def eshape(self, scale: str = "", key: str = "", **kwargs): + r"""Displays elements with shapes determined from the real constants, section definition, or other + inputs. + + Mechanical APDL Command: `/ESHAPE `_ + + **Command default:** + + .. _s-ESHAPE_default: + + Use simple display of line and area elements ( ``SCALE`` = 0). + + Parameters + ---------- + scale : int or str + Scaling factor: + + * ``0`` - Use simple display of line and area elements. This value is the default. + + * ``1`` - Use real constants, section definition, or other information to form a solid shape display + of the applicable elements. + + * ``FAC`` - Multiply certain real constants, such as thickness, by ``FAC`` (where ``FAC`` > 0.01) + and use them to form a solid shape display of elements. + + key : int or str + Current shell thickness key: + + * ``0`` - Use current thickness in the displaced solid shape display of shell elements (valid for + ``SHELL181``, ``SHELL208``, ``SHELL209``, and ``SHELL281`` ). This value is the default. + + * ``1`` - Use initial thickness in the displaced solid shape display of shell elements. + + Notes + ----- + + .. _s-ESHAPE_notes: + + The :ref:`eshape` command allows beams, shells, current sources, and certain special-purpose + elements or elements with special options to be displayed as solids with the shape determined from + the real constants, section types, or other information. Elements are displayed via the :ref:`eplot` + command. No checks for valid or complete input are made for the display. + + Following are details about using this command with various element types: + + * ``COMBIN14``, ``COMBIN39``, and ``MASS21`` are displayed with a graphics icon, with the offset + determined by the real constants and KEYOPT settings. + + * ``BEAM188``, ``BEAM189``, ``PIPE288``, ``PIPE289`` and ``ELBOW290`` are displayed as solids with + the shape determined via the section-definition commands ( :ref:`sectype` and :ref:`secdata` ). + The arbitrary section option ( ``Subtype`` = ASEC) has no definite shape and appears as a thin + rectangle to indicate the orientation; the thin side represents the beam Y axis and the thick + (longer) side represents the Z axis. The length of thick side is determined by ``TKz``. If ``TKz`` + = 0, the area is used to determine the length of thick side. The thin side is scaled by the + fraction of the thick side, regardless of ``TKy``. If the offsets are defined via ``CGy`` / + ``CGz`` ( :ref:`secdata` or :ref:`secoffset`,USER, ``OFFSETY``, ``OFFSETZ`` ), they are applied to + the plot without scaling. The elements are displayed with internal lines representing the cross- + section mesh. + + * Reduced-integration and lower-order shells ( ``SHELL181`` and ``SHELL208`` with KEYOPT(3)=0) are + displayed with uniform thickness, evaluated at the centroid, to reflect the element behavior. + + * ``SOLID272`` and ``SOLID273`` are displayed as solids with the shape determined via the section- + definition commands ( :ref:`sectype` and :ref:`secdata` ). The 2D master plane is revolved around + the prescribed axis of symmetry. + + * ``PLANE182``, ``PLANE183``, ``PLANE222``, and ``PLANE223`` with KEYOPT(3) = 6 are displayed as 3D + solids with the shape determined by nodal locations and displacements at the nodes. + + * Contour plots are available for these elements in postprocessing for PowerGraphics only ( + :ref:`graphics`,POWER). To view 3D deformed shapes for the elements, issue :ref:`outres`,MISC or + :ref:`outres`,ALL for static or transient analyses. To view 3D mode shapes for a modal or + eigenvalue buckling analysis, expand the modes with element results calculation ON ( ``Elcalc`` = + YES for :ref:`mxpand` ). + + * ``SOURC36``, ``CIRCU124``, and ``TRANS126`` elements always plot using :ref:`eshape` when + PowerGraphics is activated ( :ref:`graphics`,POWER). + + In most cases, :ref:`eshape` renders a thickness representation of your shell, plane and layered + elements more readily in PowerGraphics ( :ref:`graphics`,POWER). This type of representation + employs PowerGraphics to generate the enhanced representation, and will often provide no enhancement + in Full Graphics ( :ref:`graphics`,FULL). This is especially true for POST1 results displays, where + :ref:`eshape` is not supported for most element types with FULL graphics. + + When PowerGraphics is active, :ref:`eshape` may degrade the image if adjacent elements have + overlapping material, such as shell elements which are not co-planar. Additionally, if adjacent + elements have different thicknesses, the polygons depicting the connectivity between the "thicker" + and "thinner" elements along the shared element edges may not always be displayed. + + For POST1 results displays (such as :ref:`plnsol` ), the following limitations apply: + + * If you issue :ref:`rsys`,SOLU before reviewing results for beam or pipe elements, contour plots + for displacement (for example, :ref:`plnsol`,U,X and :ref:`pldisp` ) do not appear in the solution + coordinate system when :ref:`eshape` is active. Instead, the contours appear in the global + Cartesian coordinate system. + + * When shell elements are not co-planar, the resulting :ref:`plnsol` display with :ref:`eshape` will + actually be a :ref:`plesol` display as the non-coincident pseudo-nodes are not averaged. + Additionally, :ref:`eshape` should not be used with coincident elements because the plot may + incorrectly average the displacements of the coincident elements. + + * When nodes are initially coincident and PowerGraphics is active, duplicate polygons are eliminated + to conserve display time and disk space. The command may degrade the image if initially coincident + nodes have different displacements. The tolerance for determining coincidence is 1E-9 times the + model``s bounding box diagonal. + + * If you want to view solution results ( :ref:`plnsol`, etc.) on layered elements (such as + ``SHELL181``, ``SOLSH190``, ``SOLID185`` Layered Solid, ``SOLID186`` Layered Solid, ``SHELL208``, + ``SHELL209``, ``SHELL281``, and ``ELBOW290`` ), set KEYOPT(8) = 1 for the layer elements so that + the data for all layers is stored in the results file. + + * You can plot the through-thickness temperatures of elements ``SHELL131`` and ``SHELL132`` + regardless of the thermal DOFs in use by issuing the :ref:`plnsol`,TEMP command (with + PowerGraphics and :ref:`eshape` active). + + * The :ref:`eshape`,1 and :ref:`eshape`, ``FAC`` commands are incompatible with the :ref:`cycexpand` + command used in cyclic symmetry analyses. + + * The :ref:`eshape`,1 command does not support velocity and acceleration results for elements + ``PLANE182``, ``PLANE183``, ``PLANE222``, or ``PLANE223`` with KEYOPT(3) = 6. + + * For coupled-field elements ``PLANE222`` and ``PLANE223`` with KEYOPT(3) = 6, the :ref:`eshape` + command can be used to visualize structural results. Non-structural results visualization is + limited to gradient and flux displays supported with PowerGraphics. + + This command is valid in any processor. + """ + warnings.warn( + "pymapdl does not support /ESHAPE when plotting in Python using ``mapdl.eplot()``. Use ``mapdl.eplot(backend=GraphicsBackend.MAPDL)`` " + ) + command = f"/ESHAPE,{scale},{key}" + return self.run(command, **kwargs) + + def facet(self, lab: str = "", **kwargs): + r"""Specifies the facet representation used to form solid model displays. + + Mechanical APDL Command: `/FACET `_ + + Parameters + ---------- + lab : str + Valid labels: + + * ``FINE`` - Use finer tessellation to increase the number of facets for the display. Provides the + best representation (but decreases speed of operation). + + * ``NORML`` - Use the basic number of facets for the display (default). + + * ``COAR`` - Use a limited number of facets for the display. This option will increase the speed of + the operations, but may produce poor representations for some imported models. + + * ``WIRE`` - Display model with a wireframe representation (fast, but surfaces will not be shown). + + Notes + ----- + + .. _s-FACET_notes: + + Specifies the facet (or polygon) representation used to form solid model displays. Used only with + the :ref:`aplot`, :ref:`asum`, :ref:`vplot`, and :ref:`vsum` commands. + + This command is valid in any processor. + """ + command = f"/FACET,{lab}" + return self.run(command, **kwargs) + + def gline(self, wn: str = "", style: int | str = "", **kwargs): + r"""Specifies the element outline style. + + Mechanical APDL Command: `/GLINE `_ + + Parameters + ---------- + wn : str + Window number (or ALL) to which command applies (defaults to 1). + + style : int or str + Outline key: + + * ``0`` - Solid element outlines (default) + + * ``1`` - Dashed element outlines + + * ``-1`` - No element outlines + + Notes + ----- + + .. _s-GLINE_notes: + + Determines the element outline style. Often used when node numbers are displayed to prevent element + lin es from overwriting node numbers. + + Unless you are using an OpenGL or Starbase driver, the dashed element outline option ( :ref:`gline`, + ``WN``,1) is not available in the following situations: + + * Z-buffered displays ( :ref:`slashtype`, ``WN``,6). + + * Capped Z-buffered displays ( :ref:`slashtype`, ``WN``,7). + + * Qslice Z-buffered displays ( :ref:`slashtype`, ``WN``,8). + + This command is valid in any processor. + """ + command = f"/GLINE,{wn},{style}" + return self.run(command, **kwargs) + + def gmarker(self, curve: str = "", key: int | str = "", incr: str = "", **kwargs): + r"""Specifies the curve marking style. + + Mechanical APDL Command: `/GMARKER `_ + + Parameters + ---------- + curve : str + Curve number markers will be applied on (integer value between 1 and 10). + + key : int or str + Marker key: + + * ``0`` - No markers will be applied (default). + + * ``1`` - TRIANGLES will be applied. + + * ``2`` - SQUARES will be applied. + + * ``3`` - DIAMONDS will be applied. + + * ``4`` - CROSSES will be applied. + + incr : str + Determines the curve marking frequency. (a whole number value between 1 and 255). If ``INCR`` = + 1, markers are displayed at every data point on the curve. If ``INCR`` = 2 then markers are + displayed at every second data point. If ``INCR`` = 3 then they are displayed at every third + data point. + + Notes + ----- + + .. _s-GMARKER_notes: + + The user-specified markers will not be drawn when the area under the curve is color-filled ( + :ref:`gropt`, FILL). + """ + command = f"/GMARKER,{curve},{key},{incr}" + return self.run(command, **kwargs) + + def gmface(self, lab: str = "", n: str = "", **kwargs): + r"""Specifies the facet representation used to form solid models. + + Mechanical APDL Command: `GMFACE `_ + + Parameters + ---------- + lab : str + Valid Labels: + + * ``FINE`` - Value that determines how coarse the facets will be. + + n : str + An integer value between one (small) and ten (large) that determines the tolerances that will be + applied to the creation of arcs and surfaces. Ten will create many facets, which may in turn + cause Mechanical APDL to run very slowly. One will create fewer facets, which may in turn cause + larger tolerance errors. + """ + command = f"GMFACE,{lab},{n}" + return self.run(command, **kwargs) + + def light( + self, + wn: str = "", + num: int | str = "", + int_: str = "", + xv: str = "", + yv: str = "", + zv: str = "", + refl: str = "", + **kwargs, + ): + r"""Specifies the light direction for the display window. + + Mechanical APDL Command: `/LIGHT `_ + + Parameters + ---------- + wn : str + Window number (or ALL) to which command applies (defaults to 1). + + num : int or str + Ambient or directional light key: + + * ``0`` - Ambient light (default). + + * ``1`` - Directional light. + + int_ : str + Light intensity factor (defaults to 0.3 for ambient, 1.0 for directional). This option is valid + only for 3D devices). + + xv : str + Light direction (valid only for ``NUM`` = 1). The directional light source is parallel to the + line from point ``XV``, ``YV``, ``ZV`` to the origin, in the global Cartesian system origin. + Defaults to the viewing direction ( :ref:`view` ). + + yv : str + Light direction (valid only for ``NUM`` = 1). The directional light source is parallel to the + line from point ``XV``, ``YV``, ``ZV`` to the origin, in the global Cartesian system origin. + Defaults to the viewing direction ( :ref:`view` ). + + zv : str + Light direction (valid only for ``NUM`` = 1). The directional light source is parallel to the + line from point ``XV``, ``YV``, ``ZV`` to the origin, in the global Cartesian system origin. + Defaults to the viewing direction ( :ref:`view` ). + + refl : str + Light reflectance factor (valid only for ``NUM`` = 1 and 3D devices). + + Notes + ----- + + .. _s-LIGHT_notes: + + Defines the light direction for the window. Use this command only with 3D graphics devices or 2D + devices when Z-buffering is used ( :ref:`slashtype`,,(6 or 7)). The ambient light has no direction, + only an intensity. You can position the directional light source by defining a point (in the global + Cartesian coordinate system) representing a point along the light directional line. This point, and + the global Cartesian coordinate system origin, define the line along which the light is positioned + looking toward the origin. You can use any point along the light line; for example, both (1.,1.,1.) + and (2.,2.,2.) give the same light effect. For 3D graphics devices only, the directional light + source also has intensity and reflectance factors. + + By choosing the highest intensity ambient light for 3D graphics devices (via :ref:`light`,WN,0,1), + you can nullify color shading and other effects of directional lighting. + + This command is valid in any processor. + """ + command = f"/LIGHT,{wn},{num},{int_},{xv},{yv},{zv},{refl}" + return self.run(command, **kwargs) + + def normal(self, wn: str = "", key: int | str = "", **kwargs): + r"""Allows displaying area elements by top or bottom faces. + + Mechanical APDL Command: `/NORMAL `_ + + Parameters + ---------- + wn : str + Window number (or ALL) to which command applies (defaults to 1). + + key : int or str + Display key: + + * ``0`` - No face distinction. + + * ``1`` - Show only area elements having their positive normals directed toward the viewing point. + + * ``-1`` - Show only area elements having their positive normals directed away from the viewing + point. + + Notes + ----- + + .. _s-NORMAL_notes: + + :ref:`normal` allows you to select area elements and area plots by the top or bottom faces. It is + useful for checking the normal directions on shell elements. The positive normal (element Z + direction) is defined by the right-hand rule following the node I, J, K, L input direction. This + command is available only with raster or hidden-line displays, for WIN32 or X11 2D displays only. + + This command is valid in any processor. + """ + command = f"/NORMAL,{wn},{key}" + return self.run(command, **kwargs) + + def shade(self, wn: str = "", type_: str = "", **kwargs): + r"""Defines the type of surface shading used with Z-buffering. + + Mechanical APDL Command: `/SHADE `_ + + Parameters + ---------- + wn : str + Window number (or ALL) to which command applies (defaults to 1). + + type_ : str + Shading type: + + * ``FACET or 0`` - Facet shading (one color per area face). + + * ``GOURAUD or 1`` - Gouraud smooth shading (smooth variation of color based on interpolated vertex + colors) (default). + + * ``PHONG or 2`` - Phong smooth shading (smooth variation of color based on interpolated vertex + normals). + + Notes + ----- + + .. _s-SHADE_notes: + + Defines the type of surface shading used on area, volume, and PowerGraphics ( :ref:`graphics`,POWER) + displays when software Z-buffering is enabled ( :ref:`slashtype` ). This command is only functional + for 2D display devices. + + This command is valid in any processor. + """ + command = f"/SHADE,{wn},{type_}" + return self.run(command, **kwargs) + + def slashtype(self, wn: str = "", type_: str = "", **kwargs): + r"""Defines the type of display. + + Mechanical APDL Command: `/TYPE `_ + + Parameters + ---------- + wn : str + Window number (or ALL) to which command applies (defaults to 1). + + type_ : str + Display type. Defaults to ZBUF for raster mode displays or BASIC for vector mode displays: + + * ``BASIC or 0`` - Basic display (no hidden or section operations). + + * ``SECT or 1`` - Section display (plane view). Use the :ref:`cplane` command to define the cutting + plane. + + * ``HIDC or 2`` - Centroid hidden display (based on item centroid sort). + + * ``HIDD or 3`` - Face hidden display (based on face centroid sort). + + * ``HIDP or 4`` - Precise hidden display (like HIDD but with more precise checking). Because all + facets are sorted, this mode can be extremely slow, especially for large models. + + * ``CAP or 5`` - Capped hidden display (same as combined SECT and HIDD with model in front of + section plane removed). + + * ``ZBUF or 6`` - Z-buffered display (like HIDD but using software Z-buffering). + + * ``ZCAP or 7`` - Capped Z-buffered display (same as combined SECT and ZBUF with model in front of + section plane removed). + + * ``ZQSL or 8`` - QSLICE Z-buffered display (same as SECT but the edge lines of the remaining 3D + model are shown). + + * ``HQSL or 9`` - QSLICE precise hidden display (like ZQSL but using precise hidden). + + Notes + ----- + + .. _s-TYPE_notes: + + Defines the type of display, such as section display or hidden-line display. Use the :ref:`device` + command to specify either raster or vector mode. + + The SECT, CAP, ZCAP, ZQSL, and HQSL options produce section displays. The section or "cutting" plane + is specified on the :ref:`cplane` command as either normal to the viewing vector at the focus point + (default), or as the working plane. + + When you use PowerGraphics, the section display options (Section, Slice, and Capped) use different + averaging techniques for the interior and exterior results. Because of the different averaging + schemes, anomalies may appear at the transition areas. In many cases, the automatically computed MIN + and MAX values will differ from the full range of interior values. You can lessen the effect of + these anomalies by issuing :ref:`avres`,,FULL ( Main Menu> General Post Proc> Options for Outp ). + This command sets your legend's automatic contour interval range according to the minimum and + maximum results found throughout the entire model. + + With PowerGraphics active ( :ref:`graphics`,POWER), the averaging scheme for surface data with + interior element data included ( :ref:`avres`,,FULL) and multiple facets per edge ( :ref:`efacet` + ,2 or :ref:`efacet`,4) will yield differing minimum and maximum contour values depending on the + Z-Buffering options ( :ref:`slashtype`,,6 or :ref:`slashtype`,,7). When the Section data is not + included in the averaging schemes ( :ref:`slashtype`,,7), the resulting absolute value for the + midside node is significantly smaller. + + The HIDC, HIDD, HIDP, ZBUF, ZQSL, and HQSL options produce displays with "hidden" lines removed. + Hidden lines are lines obscured from view by another element, area, etc. The choice of non-Z- + buffered hidden-line procedure types is available only for raster mode ( :ref:`device` ) displays. + For vector mode displays, all non-Z-buffered "hidden-line" options use the same procedure (which is + slightly different from the raster procedures). Both geometry and postprocessing displays may be of + the hidden-line type. Interior stress contour lines within solid elements can also be removed as + hidden lines, leaving only the stress contour lines and element outlines on the visible surfaces. + Midside nodes of elements are ignored on postprocessing displays. Overlapping elements will not be + displayed. + + The ZBUF, ZCAP, and ZQSL options use a specific hidden-line technique called software Z-buffering. + This technique allows a more accurate display of overlapping surfaces (common when using Boolean + operations or :ref:`eshape` on element displays), and allows smooth shaded displays on all + interactive graphics displays. Z-buffered displays can be performed faster than HIDP and CAP type + displays for large models. See also the :ref:`light`, :ref:`shade`, and :ref:`gfile` commands for + additional options when Z-buffering is used. + + This command is valid in any processor. + """ + command = f"/TYPE,{wn},{type_}" + return self.run(command, **kwargs) + + def trlcy( + self, + lab: str = "", + tlevel: str = "", + n1: str = "", + n2: str = "", + ninc: str = "", + **kwargs, + ): + r"""Specifies the level of translucency. + + Mechanical APDL Command: `/TRLCY `_ + + Parameters + ---------- + lab : str + Apply translucency level to the items specified by the following labels: + + * ``ELEM`` - Elements. Use ``N1``, ``N2``, ``NINC`` fields for element numbers. + + * ``AREA`` - Solid model areas. Use ``N1``, ``N2``, ``NINC`` fields for area numbers. + + * ``VOLU`` - Solid model volumes. Use ``N1``, ``N2``, ``NINC`` fields for volume numbers. + + * ``ISURF`` - Isosurfaces (surfaces of constant stress, etc., value). Translucency varies with + result value, to a maximum of the specified translucency level. + + * ``CM`` - Component group. Use ``N1`` for component name, ignore ``N2`` and ``NINC``. + + * ``CURVE`` - Filled areas under curves of line graphs. Use ``N1``, ``N2``, ``NINC`` fields for + curve numbers. + + * ``ZCAP`` - If :ref:`slashtype`, ``WN``,ZCAP is the current display type, then :ref:`trlcy`,ZCAP, + ``TLEVEL`` will display the model in window ``WN`` with the portion of the model in front of the + section plane displayed at the translucency level ``TLEVEL``. + + * ``ON, OFF`` - Sets the specified translucency display on or off. All other fields are ignored. + + tlevel : str + Translucency level: 0.0 (opaque) to 1.0 (transparent). + + n1 : str + Used only with labels as noted above. Apply translucency level to ``Lab`` items numbered ``N1`` + to ``N2`` (defaults to ``N1`` ) in steps of ``NINC`` (defaults to 1). If ``N1`` is blank or ALL, + apply specified translucency level to entire selected range. If ``Lab`` is CM, use component + name for ``N1`` and ignore ``N2`` and ``NINC``. A value of ``N1`` = P allows you to graphically + pick elements, areas, and volumes. You can then assign translucency levels to the entities via + the picker. The ``Lab`` and ``TLEVEL`` fields are ignored when translucency is applied by + picking. + + n2 : str + Used only with labels as noted above. Apply translucency level to ``Lab`` items numbered ``N1`` + to ``N2`` (defaults to ``N1`` ) in steps of ``NINC`` (defaults to 1). If ``N1`` is blank or ALL, + apply specified translucency level to entire selected range. If ``Lab`` is CM, use component + name for ``N1`` and ignore ``N2`` and ``NINC``. A value of ``N1`` = P allows you to graphically + pick elements, areas, and volumes. You can then assign translucency levels to the entities via + the picker. The ``Lab`` and ``TLEVEL`` fields are ignored when translucency is applied by + picking. + + ninc : str + Used only with labels as noted above. Apply translucency level to ``Lab`` items numbered ``N1`` + to ``N2`` (defaults to ``N1`` ) in steps of ``NINC`` (defaults to 1). If ``N1`` is blank or ALL, + apply specified translucency level to entire selected range. If ``Lab`` is CM, use component + name for ``N1`` and ignore ``N2`` and ``NINC``. A value of ``N1`` = P allows you to graphically + pick elements, areas, and volumes. You can then assign translucency levels to the entities via + the picker. The ``Lab`` and ``TLEVEL`` fields are ignored when translucency is applied by + picking. + + Notes + ----- + + .. _s-TRLCY_notes: + + Specifies the level of translucency for various items. Issue :ref:`trlcy`,DEFA to reset the default + (0) translucency levels. This command is valid only on selected 2D and 3D graphics devices; see + filename="Hlp_G_BAS11_3.html"? in the `Basic Analysis Guide + `_ for more + information on applying translucency. + + For 2D devices, the program displays only the visible faces of the items being displayed. The + information behind the facing planes is not displayed. Issuing the :ref:`shrink` command will force + the hardware to display information behind the translucent items. + + This command is valid in any processor. + """ + command = f"/TRLCY,{lab},{tlevel},{n1},{n2},{ninc}" + return self.run(command, **kwargs) + + def txtre( + self, + lab: str = "", + num: int | str = "", + n1: str = "", + n2: str = "", + ninc: str = "", + **kwargs, + ): + r"""Controls application of texture to selected items. + + Mechanical APDL Command: `/TXTRE `_ + + Parameters + ---------- + lab : str + You can apply texture according to the following labels: + + * ``ELEM`` - Apply texture to elements ``N1`` through ``N2`` in steps of ``NINC``. + + * ``AREA`` - Apply texture to areas ``N1`` through ``N2`` in steps of ``NINC``. + + * ``VOLU`` - Apply texture to volumes ``N1`` through ``N2`` in steps of ``NINC``. + + * ``CM`` - Apply texture to the component named in ``N1``. ``N2`` and ``NINC`` are ignored. + + * ``ON, OFF`` - Sets the specified texture display on or off. All other fields are ignored. + + * ``File`` - If Lab = File, the command format is :ref:`txtre`, File, ``Key_Index``, ``Fname``, ``Fext``, ``--``, ``Format`` (This variant of the command is applicable to 2D drivers). + + * ``Key_Index`` - The texture index associated with the file. If the number fifty-one (51) is used, + the imported bitmap will be used as the window's logo. + + * ``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. + * ``Fext`` - Filename extension (eight-character maximum). + * ``Format`` - The file format. If ``Format`` = 0, the file is a pixmap (Linux) or Bitmap (PC). The + file cannot contain a compressed image, and the PC file must be 8 or 24 bit BI_RGB format. If + ``Format`` = 1 or JPEG, then the file is in JPEG (Joint Photographic Experts Group) format. If + ``Format`` = 2 or PNG, then the file is in PNG (Portable Network Graphics) format. + + num : int or str + Select the texture index number from the following list: + + * ``0`` - No Texturing + + * ``1`` - Aluminum + + * ``2`` - Aluminum, Brushed + + * ``3`` - Steel With Bumps + + * ``4`` - Steel, Embossed + + * ``5`` - Iron + + * ``6`` - Steel, Pattern + + * ``7`` - Steel, Riveted + + * ``8`` - Steel, Scratched + + * ``9`` - Tin + + * ``10`` - Metal + + * ``11`` - Steel, Etched + + * ``12`` - Metal, Hot + + * ``13`` - Iron, Grainy + + * ``14`` - Metal, Rusty + + * ``15`` - Brick + + * ``16`` - Block + + * ``17`` - Wood + + * ``18`` - Wood, Light + + * ``19`` - Wood, Walnut + + * ``20`` - Plastic, Hard Blue + + * ``21`` - Plastic, Light Blue + + * ``22`` - Plastic, Hard Red + + * ``31`` - Gold + + * ``32`` - Brass + + * ``33`` - Silver + + * ``34`` - Plastic, Black + + * ``35`` - Plastic, Ivory + + * ``36`` - Plastic, Blue + + * ``37`` - Plastic, Red + + * ``38`` - Plastic, Yellow + + * ``39`` - Plastic, Green + + * ``40`` - Plastic, Brown + + n1 : str + Apply texture to ``Lab`` items numbered ``N1`` through ``N2`` in steps of ``NINC`` (defaults to + 1). If ``Lab`` = CM, then N1 is used to for the component name and ``N2`` and ``NINC`` are + ignored. If ``Lab`` = ELEM, AREA, or VOLU and ``N1`` = blank or ALL, then the specified texture + will be applied to all entities of type ``Lab``. If ``N1`` = P, then graphical picking is + enabled. + + n2 : str + Apply texture to ``Lab`` items numbered ``N1`` through ``N2`` in steps of ``NINC`` (defaults to + 1). If ``Lab`` = CM, then N1 is used to for the component name and ``N2`` and ``NINC`` are + ignored. If ``Lab`` = ELEM, AREA, or VOLU and ``N1`` = blank or ALL, then the specified texture + will be applied to all entities of type ``Lab``. If ``N1`` = P, then graphical picking is + enabled. + + ninc : str + Apply texture to ``Lab`` items numbered ``N1`` through ``N2`` in steps of ``NINC`` (defaults to + 1). If ``Lab`` = CM, then N1 is used to for the component name and ``N2`` and ``NINC`` are + ignored. If ``Lab`` = ELEM, AREA, or VOLU and ``N1`` = blank or ALL, then the specified texture + will be applied to all entities of type ``Lab``. If ``N1`` = P, then graphical picking is + enabled. + + Notes + ----- + + .. _s-TXTRE_notes: + + This command is available for 3D Open GL devices. 2D devices are supported **only** for the ``Lab`` + = File variation of the command, allowing imported bitmaps to be used for texturing and annotation. + Textures can affect the speed of many of your display operations. You can increase the speed by + temporarily turning the textures off ( Utility Menu> PlotCtrls> Style> Texturing(3D)> Display + Texturing ). This menu selection toggles your textures on and off. When textures are toggled off, + all of the + texture information is retained and reapplied when texturing is toggled back on. + + For some displays, the texture will appear distorted because of a technique used to enhance 3D + displays ( :ref:`dv3d`,TRIS,1). Disabling this function ( :ref:`dv3d`,TRIS,0) will improve the + quality of some texture displays. Disabling the TRIS option of the :ref:`dv3d` command will slow + down 3D displays significantly. Be sure to reapply the TRIS option after you obtain a satisfactory + output. + + Specifying :ref:`txtre`,DEFA removes all texturing. + """ + command = f"/TXTRE,{lab},{num},{n1},{n2},{ninc}" + return self.run(command, **kwargs) diff --git a/src/ansys/mapdl/core/_commands/graphics/views.py b/src/ansys/mapdl/core/_commands/graphics/views.py new file mode 100644 index 00000000000..d89a57a7947 --- /dev/null +++ b/src/ansys/mapdl/core/_commands/graphics/views.py @@ -0,0 +1,548 @@ +# Copyright (C) 2016 - 2025 ANSYS, Inc. and/or its affiliates. +# SPDX-License-Identifier: MIT +# +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to deal +# in the Software without restriction, including without limitation the rights +# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +# copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in all +# copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +# SOFTWARE. + + +class Views: + + def angle( + self, + wn: str = "", + theta: str = "", + axis: str = "", + kincr: int | str = "", + **kwargs, + ): + r"""Rotates the display about an axis. + + Mechanical APDL Command: `/ANGLE `_ + + Parameters + ---------- + wn : str + Window number (or ALL) to which command applies (defaults to 1). + + theta : str + Angle (degrees) for changing display orientation (positive, counterclockwise about specified + axis). + + axis : str + Rotation axis: XS, YS, or ZS (default) for the screen axes; XM, YM, or ZM for the global + Cartesian model axes. ZS is normal to the screen; all axes pass through the focus point. + + kincr : int or str + Cumulative rotation key: + + * ``0`` - Do not use cumulative successive rotations. + + * ``1`` - Use cumulative rotations. Rotations are relative to the previous rotation. View settings ( + :ref:`view` ) are recalculated. + + Notes + ----- + + .. _s-ANGLE_notes: + + Default orientation is YS vertical. When the :ref:`xfrm` command is set for rotation about two + points, or for entities, the :ref:`angle` command is functional only for ``Axis`` = ZS or ZM and + ``KINCR`` = 1. + + This command is valid in any processor. + """ + command = f"/ANGLE,{wn},{theta},{axis},{kincr}" + return self.run(command, **kwargs) + + def auto(self, wn: str = "", **kwargs): + r"""Resets the focus and distance specifications to "automatically calculated." + + Mechanical APDL Command: `/AUTO `_ + + Parameters + ---------- + wn : str + Window number (or ALL) to which command applies (defaults to 1). + + Notes + ----- + + .. _s-AUTO_notes: + + Focus point and distance will be automatically calculated during next display. Settings may still be + changed with the :ref:`focus` and :ref:`dist` commands after this command has been issued. See also + the :ref:`user` command. + + This command is valid in any processor. + """ + command = f"/AUTO,{wn}" + return self.run(command, **kwargs) + + def dist(self, wn: str = "", dval: str = "", kfact: int | str = "", **kwargs): + r"""Specifies the viewing distance for magnifications and perspective. + + Mechanical APDL Command: `/DIST `_ + + **Command default:** + + .. _s-DIST_default: + + Distance is automatically calculated to produce full window magnification. + + Parameters + ---------- + wn : str + Window number (or ALL) to which command applies (defaults to 1). + + dval : str + Distance along the view line from the observer to the focus point (defaults to value producing + full- window display). Distances "too close" to the object will produce excessive + magnifications. If ``DVAL`` = AUTO, zero, or blank, the program will calculate the distance + automatically. If ``DVAL`` = USER, the distance of last display will be used (useful when last + display automatically calculated distance). + + kfact : int or str + ``DVAL`` interpretation key: + + * ``0`` - Interpret numerical ``DVAL`` values as described above. + + * ``1`` - Interpret ``DVAL`` as a multiplier on the current distance ( ``DVAL`` of 2 gives twice the + current distance; 0.5 gives half the current distance, etc.). + + Notes + ----- + + .. _s-DIST_notes: + + The scale factor is relative to the window shape. For example, for objects centered in a square + window and with parallel projection (no perspective), a distance of :math:`equation not available` + /2 (+10%) producesa full window magnification, where :math:`equation not available` isthe + largest in-plane vertical or horizontal dimension. See also :ref:`auto` and :ref:`user` commands. + + This command is valid in any processor. + """ + command = f"/DIST,{wn},{dval},{kfact}" + return self.run(command, **kwargs) + + def focus( + self, + wn: str = "", + xf: str = "", + yf: str = "", + zf: str = "", + ktrans: int | str = "", + **kwargs, + ): + r"""Specifies the focus point (center of the window). + + Mechanical APDL Command: `/FOCUS `_ + + Parameters + ---------- + wn : str + Window number (or ALL) to which command applies (defaults to 1). + + xf : str + Location of the object to be at the focus point (center of the window) in the global Cartesian + coordinate system. If ``XF`` = AUTO, allow automatic location calculation. If ``XF`` = USER, use + focus location of last display (useful when last display had auto focus). + + yf : str + Location of the object to be at the focus point (center of the window) in the global Cartesian + coordinate system. If ``XF`` = AUTO, allow automatic location calculation. If ``XF`` = USER, use + focus location of last display (useful when last display had auto focus). + + zf : str + Location of the object to be at the focus point (center of the window) in the global Cartesian + coordinate system. If ``XF`` = AUTO, allow automatic location calculation. If ``XF`` = USER, use + focus location of last display (useful when last display had auto focus). + + ktrans : int or str + Translate key: + + * ``0`` - Interpret numerical ``XF``, ``YF``, ``ZF`` values as described above. + + * ``1`` - Interpret ``XF``, ``YF``, ``ZF`` values as multiples of half-screens to translate from the + current position in the screen coordinate system. Example: ``XF`` of 2.4 translates the display + approximately 2.4 half-screens to the left in the screen X (horizontal) direction. + + * ``2`` - Interpret ``XF``, ``YF``, ``ZF`` values as multiples of half-screens to translate from the + current position in the global Cartesian coordinate system. Example: ``XF`` of 1.5 translates the + display approximately 1.5 half-screens in the global Cartesian X direction of the model. + + Notes + ----- + + .. _s-FOCUS_notes: + + Specifies the location on (or off) the model which is to be located at the focus point (center of + the window). For section and capped displays, the cutting plane is also assumed to pass through this + location (unless the working plane is used via :ref:`cplane` ). See also :ref:`auto` and :ref:`user` + commands. + + This command is valid in any processor. + """ + command = f"/FOCUS,{wn},{xf},{yf},{zf},{ktrans}" + return self.run(command, **kwargs) + + def user(self, wn: str = "", **kwargs): + r"""Conveniently resets :ref:`focus` and :ref:`dist` to USER. + + Mechanical APDL Command: `/USER `_ + + Parameters + ---------- + wn : str + Window number (or ALL) to which command applies (defaults to 1). + + Notes + ----- + + .. _s-USER_notes: + + Conveniently resets scale parameters to USER on the :ref:`focus` and :ref:`dist` commands. Scale + parameters will be internally respecified to those used for the last display. Convenient when the + last scale parameters were automatically calculated. User specified parameters hold until changed or + removed ( :ref:`auto` ). Parameters may be reset on the individual commands after this command has + been issued. + + This command is valid in any processor. + """ + command = f"/USER,{wn}" + return self.run(command, **kwargs) + + def vcone(self, wn: str = "", phi: str = "", **kwargs): + r"""Defines the view cone angle for perspective displays. + + Mechanical APDL Command: `/VCONE `_ + + Parameters + ---------- + wn : str + Window number (or ALL) to which command applies (defaults to 1). + + phi : str + View cone angle (0.0 to 85.°) to define perspective. Use ``PHI`` = 45.0° for typical + perspective. Increase angle for more perspective, decrease angle for less. If the distance ( + :ref:`dist` ) is not specified, it will be automatically calculated to give full window + magnification. If the distance is also specified, ``PHI`` controls both the perspective and the + magnification. The larger the angle, the more the perspective and the less the magnification. + Defaults to 0.0 (no perspective). + + Notes + ----- + + .. _s-VCONE_notes: + + Perspective shows the true depth of the object in the display. A variable magnification results + since the back plane of the object is further from the observer than the front plane. The largest + magnification occurs at the front plane. With perspective, the magnification factor (MAGF) is not + only a function of the distance from the object, but also the window shape and the perspective (or + view cone) angle Φ as follows: + + .. math:: + + equation not available + + where :math:`equation not available`, for square windows, is thelargest in-plane vertical or + horizontal dimension, d is the distance fromthe observer to the plane of :math:`equation not + available` (usuallythe front plane of the object), and :math:`\Phi` is the view cone angle + (definedwith the :ref:`vcone` command). The bigger the cone angle, the more the perspective. The + magnification factor proportionally decreases with increasing Φ. The distance can be defined with + the :ref:`dist` or the :ref:`focus` command. Note, the distance input on the :ref:`dist` command is + equal to d only if the focus point is located on the plane of :math:`equation not available`. It is + recommended that if a general perspective is desired(that is, not any specific cone angle), use + :math:`\Phi` = 45.0 (since TAN(45.0) = 1.0)and let the d value be automatically calculated for full + window + magnification. + + Note that any number of :ref:`dist`, :ref:`focus`, and :ref:`vcone` combinations can be used to + produce the same magnification. Distances less than the object depth will produce views from within + the object. + + A magnification factor of 1.0 just fills the window. If the automatic scaling option is used ( + :ref:`auto` ), the magnification factor is fixed at 0.91 (to allow a 10% margin around the object) + and d is automatically calculated for the given :ref:`vcone` and :ref:`focus` values. Any value of Φ + between 0.0 and 85.0 (usually 45.0) may be used to activate the perspective. Views from inside the + object are not possible when d is automatically calculated (use manual scaling ( :ref:`user` ) along + with :ref:`dist` specification). + + This command is valid in any processor. + """ + command = f"/VCONE,{wn},{phi}" + return self.run(command, **kwargs) + + def view(self, wn: str = "", xv: str = "", yv: str = "", zv: str = "", **kwargs): + r"""Defines the viewing direction for the display. + + Mechanical APDL Command: `/VIEW `_ + + Parameters + ---------- + wn : str + Window number (or ALL) to which command applies (defaults to 1). + + xv : str + The object is viewed along the line from point ``XV``, ``YV``, ``ZV`` (in the global coordinate + system) to the global coordinate system origin. For section displays, the cutting plane is + assumed to be perpendicular to this line. If ``XV`` = WP, modify view to be normal to the + currently defined working plane. Defaults to (0,0,1). + + yv : str + The object is viewed along the line from point ``XV``, ``YV``, ``ZV`` (in the global coordinate + system) to the global coordinate system origin. For section displays, the cutting plane is + assumed to be perpendicular to this line. If ``XV`` = WP, modify view to be normal to the + currently defined working plane. Defaults to (0,0,1). + + zv : str + The object is viewed along the line from point ``XV``, ``YV``, ``ZV`` (in the global coordinate + system) to the global coordinate system origin. For section displays, the cutting plane is + assumed to be perpendicular to this line. If ``XV`` = WP, modify view to be normal to the + currently defined working plane. Defaults to (0,0,1). + + Notes + ----- + + .. _s-VIEW_notes: + + The view line is always normal to the screen. The view is selected by defining a point (in the + global Cartesian coordinate system) representing a point along the viewing line. This point, and the + global Cartesian coordinate system origin, define the line along which the object is viewed while + looking toward the origin. Any point along the view line may be used, that is, (1,1,1) and (2,2,2) + give the same view. The display orientation may be changed as desired ( :ref:`angle` ). The display + coordinate system type may be changed (from Cartesian to cylindrical, spherical, toroidal, etc.) + with the :ref:`dsys` command. + + This command is valid in any processor. + """ + command = f"/VIEW,{wn},{xv},{yv},{zv}" + return self.run(command, **kwargs) + + def vup(self, wn: str = "", label: str = "", **kwargs): + r"""Specifies the global Cartesian coordinate system reference orientation. + + Mechanical APDL Command: `/VUP `_ + + Parameters + ---------- + wn : str + Window number (or ALL) to which command applies (defaults to 1). + + label : str + Orientation: + + * ``Y`` - Y vertical upward, X horizontal to the right, Z out from the screen (default). + + * ``-Y`` - Y vertical downward, X horizontal to the left, Z out from the screen. + + * ``X`` - X vertical upward, Y horizontal to the left, Z out from the screen. + + * ``-X`` - X vertical downward, Y horizontal to the right, Z out from the screen. + + * ``Z`` - Z vertical upward, Y horizontal to the right, X out from the screen. With this choice, you + should use a view other than the :ref:`view` default of (0,0,1). + + * ``-Z`` - Z vertical downward, Y horizontal to the left, X out from the screen. With this choice, + you should use a view other than the :ref:`view` default of (0,0,1). + + Notes + ----- + + .. _s-VUP_notes: + + Specifies the global Cartesian coordinate system reference orientation. The :ref:`view` and + :ref:`angle` commands may be used to reorient the view and are relative to this reference + orientation. All coordinate systems are right-handed. + + This command is valid in any processor. + """ + command = f"/VUP,{wn},{label}" + return self.run(command, **kwargs) + + def xfrm( + self, + lab: str = "", + x1: str = "", + y1: str = "", + z1: str = "", + x2: str = "", + y2: str = "", + z2: str = "", + **kwargs, + ): + r"""Controls the centroid or the axis of dynamic rotation. + + Mechanical APDL Command: `/XFRM `_ + + **Command default:** + + .. _s-XFRM_default: + + Issuing :ref:`xfrm`, with no ``LAB`` defined sets the center of rotation at the focal point + specified by the :ref:`focus` command. + + Parameters + ---------- + lab : str + The location or entity (centroid) used to define the center or axis of rotation. + + * ``NODE`` - If NODE is chosen for the center of rotation, the node number will be ``X1``. If the + rotation is to be about an axis, then ``X1`` and ``Y1`` define the two nodes between which a line is + drawn to determine the axis. The remaining arguments are ignored. + + * ``ELEMENT`` - If ELEMENT is chosen for the center of rotation, the element number will be ``X1``. + If the rotation is to be about an axis, then ``X1`` and ``Y1`` define the two elements between which + a line is drawn to determine the axis. The remaining arguments are ignored. + + * ``KP`` - If KP is chosen for the center of rotation, the keypoint number will be ``X1``. If the + rotation is to be about an axis, then ``X1`` and ``Y1`` define the two keypoints between which a + line is drawn to determine the axis. The remaining arguments are ignored. + + * ``LINE`` - If LINE is chosen for the center of rotation, the line number will be ``X1``. If the + rotation is to be about an axis, then ``X1`` and ``Y1`` define the two lines between which a line is + drawn to determine the axis. The remaining arguments are ignored. + + * ``AREA`` - If AREA is chosen for the center of rotation, the area number will be ``X1``. If the + rotation is to be about an axis, then ``X1`` and ``Y1`` define the two areas between which a line is + drawn to determine the axis. The remaining arguments are ignored. + + * ``VOLUME`` - If VOLUME is chosen for the center of rotation, the volume number will be ``X1``. If + the rotation is to be about an axis, then ``X1`` and ``Y1`` define the two volumes between which a + line is drawn to determine the axis. The remaining arguments are ignored. + + * ``XYZ`` - If XYZ is chosen for the center of rotation, the location of that center is determined + by the coordinates ``X1``, ``Y1``, ``Z1``. If values are specified for ``X2``, ``Y2``, ``Z2``, then + the axis of rotation will be about the line between those two points. + + * ``OFF`` - If ``LAB`` = OFF, DEFAULT, FOCUS or if no value is specified, then the center of + rotation is set at the FOCUS point, as defined by the :ref:`focus` command. + + x1 : str + The entity number or X coordinate for the center of rotation. + + y1 : str + The entity number or Y coordinate for the center of rotation. + + z1 : str + The Z coordinate for the center of rotation. + + x2 : str + The X coordinate for the axis of rotation. + + y2 : str + The Y coordinate for the axis of rotation. + + z2 : str + The Z coordinate for the axis of rotation. + + Notes + ----- + + .. _s-XFRM_notes: + + The :ref:`xfrm` command is active only when the cumulative rotation key is specified ON for the + :ref:`angle` command ( ``KINCR`` = 1). This command affects dynamic manipulations only. + + For center rotation, the middle mouse button will rotate the model about the screen Z axis and the + right mouse button will rotate the model about the screen X and Y axis. + + For rotation about an axis, the middle mouse button will rotate the model about the defined axis of + rotation and the right mouse button will be deactivated. + + This command is valid in any processor. + """ + command = f"/XFRM,{lab},{x1},{y1},{z1},{x2},{y2},{z2}" + return self.run(command, **kwargs) + + def zoom( + self, + wn: str = "", + lab: str = "", + x1: str = "", + y1: str = "", + x2: str = "", + y2: str = "", + **kwargs, + ): + r"""Zooms a region of a display window. + + Mechanical APDL Command: `/ZOOM `_ + + Parameters + ---------- + wn : str + Window number to which command applies (defaults to 1). + + lab : str + Label to define the desired type of zoom: + + * ``OFF`` - Turns zoom off (refits image of entire model to the window). + + * ``BACK`` - Goes back to previous zoom setting (five successive back ups, maximum). + + * ``SCRN`` - Interprets X1,Y1 as the screen coordinates of the center of a square zoom region; X2,Y2 + as the screen coordinates of a point on one side of that square. + + * ``RECT`` - Interprets X1,Y1 and X2,Y2 as the screen coordinates of two opposite corners of a + rectangular zoom region. + + x1 : str + The description of the argument is missing in the Python function. Please, refer to the `command + documentation + `_ for further + information. + + y1 : str + The description of the argument is missing in the Python function. Please, refer to the `command + documentation + `_ for further + information. + + x2 : str + The description of the argument is missing in the Python function. Please, refer to the `command + documentation + `_ for further + information. + + y2 : str + The description of the argument is missing in the Python function. Please, refer to the `command + documentation + `_ for further + information. + + Notes + ----- + + .. _s-ZOOM_notes: + + Zooms (centers and magnifies) the specified region of a display window. :ref:`zoom` will operate on + a display that has been formed by an explicit graphics action command ( :ref:`aplot`, :ref:`eplot`, + etc.). :ref:`zoom` has no effect on an "immediate" graphics display. When :ref:`zoom` is executed, + the display is automatically replotted such that the specified zoom region is centered and sized to + fill the window. + + Auto resizing is disabled when you issue the :ref:`zoom` command. To restore auto resizing, issue + the :ref:`auto` command, or select FIT from the `Pan, Zoom, Rotate + `_ + box. + + This command is valid in any processor. + """ + command = f"/ZOOM,{wn},{lab},{x1},{y1},{x2},{y2}" + return self.run(command, **kwargs) diff --git a/src/ansys/mapdl/core/_commands/graphics_/annotation.py b/src/ansys/mapdl/core/_commands/graphics_/annotation.py deleted file mode 100644 index 830a5a9b952..00000000000 --- a/src/ansys/mapdl/core/_commands/graphics_/annotation.py +++ /dev/null @@ -1,871 +0,0 @@ -# Copyright (C) 2016 - 2025 ANSYS, Inc. and/or its affiliates. -# SPDX-License-Identifier: MIT -# -# -# Permission is hereby granted, free of charge, to any person obtaining a copy -# of this software and associated documentation files (the "Software"), to deal -# in the Software without restriction, including without limitation the rights -# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -# copies of the Software, and to permit persons to whom the Software is -# furnished to do so, subject to the following conditions: -# -# The above copyright notice and this permission notice shall be included in all -# copies or substantial portions of the Software. -# -# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -# SOFTWARE. - - -class Annotation: - def an3d(self, kywrd="", key="", **kwargs): - """Specifies 3-D annotation functions - - APDL Command: /AN3D - - Parameters - ---------- - num - Unique number assigned as each annotation is applied to a model. - These numbers are applied sequentially, although when an annotation - entity is deleted, its number is reassigned. - - type - Annotation internal type number (101 = text, 102 = line, 103 = - point, 104 = area, 105 = arrow, 106 = symbol, 108 = bitmap). - - xhot, yhot, zhot - X, Y, Z coordinates for hot spot location. - - Notes - ----- - Because 3-D annotation is applied in relation to the XYZ coordinates of - the anchor, you can transform your model, and the annotation will - maintain the spatial relationship with the model. This works within - reason, and there are instances where changing the perspective or the - size of the model will change the apparent relationship between the - annotation and the model. - - The overall 3-D dimensions of your model are defined by a bounding - box. If portions of your model's bounding box lie outside of the - visible area of your graphics window (if you are zoomed in on a - specific area of your model), it can affect the placement of your 3-D - annotations. Zooming out will usually overcome this problem. - - 3-D annotation is valid for the Cartesian (CSYS,0) coordinate system - only. If you want to annotate a model you created in another coordinate - system, use 2-D annotation (note that 2-D annotations do not remain - anchored for dynamic rotations or transformations). - - When you apply user defined bitmaps, the size of the annotation can - vary. Use the options menu of the 3-D annotation widget to adjust the - size and placement of your bitmaps. - - You cannot use the "!" and "$" characters in ANSYS text annotation. - - The GUI generates this command during 3-D annotation operations and - inserts the command into the log file (Jobname.LOG). You should NOT - type this command directly during an ANSYS session (although the - command can be included in an input file for batch input or for use - with the /INPUT command). - """ - command = f"/AN3D,{kywrd},{key}" - return self.run(command, **kwargs) - - def annot(self, lab="", val1="", val2="", **kwargs): - """Activates graphics for annotating displays (GUI). - - APDL Command: /ANNOT - - Parameters - ---------- - lab - Annotation control key: - - OFF - Turns off annotation for each subsequent display (default). - - ON - Turns on annotation for each subsequent display. - - DELE - Deletes all annotation. - - SAVE - Saves annotation on a file. Use VAL1 for file name (defaults to Jobname) and - VAL2 for the extension (defaults to ANO). - - SCALE - Sets annotation scale factor (direct input only). Use VAL1 for value (0.1 to - 10.0) (defaults to 1.0). - - XORIG - Sets the annotation x origin (direct input only). Use VAL1 for value (-3.0 to - 3.0). - - YORIG - Sets annotation y origin (direct input only). Use VAL1 for value (-3.0 to - 3.0). - - SNAP - Sets annotation snap (menu button input only). Use VAL1 for value (0.002 to - 0.2) (defaults to 0.002). - - STAT - Displays current annotation status. - - DEFA - Sets annotation specifications to the default values. - - REFR - Redisplays annotation graphics. - - TMOD - Sets the annotation text mode. If VAL1 = 1, annotation text will be drawn in - scalable bitmap fonts (default). If VAL1 = 0, annotation - text will be drawn with stroke text. - - val1 - Value (or file name) as noted with label above. - - val2 - Value (or file name extension) as noted with label above. - - Notes - ----- - This is a command generated by the GUI and will appear in the log file - (Jobname.LOG) if annotation is used. This command is not intended to - be typed in directly in an ANSYS session (although it can be included - in an input file for batch input or for use with the /INPUT command). - - You cannot use the "!" and "$" characters in ANSYS text annotation. - - /ANNOT activates annotation graphics for adding annotation to displays. - Commands representing the annotation instructions are automatically - created by the annotation functions in the GUI and written to - Jobname.LOG. The annotation commands are /ANNOT, /ANUM, /TLABEL, - /LINE, /LARC, /LSYMBOL, /POLYGON, /PMORE, /PCIRCLE, /PWEDGE, /TSPEC, - /LSPEC, and /PSPEC. Annotation graphics are relative to the full - Graphics Window and are not affected by ANSYS window-specific commands - (/WINDOW, /VIEW, etc.). - - This command is valid in any processor. - """ - command = f"/ANNOT,{lab},{val1},{val2}" - return self.run(command, **kwargs) - - def anum(self, num="", type_="", xhot="", yhot="", **kwargs): - """Specifies the annotation number, type, and hot spot (GUI). - - APDL Command: /ANUM - - Parameters - ---------- - num - Annotation number. ANSYS automatically assigns the lowest - available number. You cannot assign a higher number if a lower - number is available; ANSYS will substitute the lowest available - number in place of any user-specified higher number. - - type\\_ - Annotation internal type number. If TYPE = DELE, delete annotation - NUM. - - 1 - Text - - 2 - Block text (not available in GUI) - - 3 - Dimensions - - 4 - Lines - - 5 - Rectangles - - 6 - Circles - - 7 - Polygons - - 8 - Arcs - - 9 - Wedges, pies - - 11 - Symbols - - 12 - Arrows - - 13 - Bitmap - - xhot - X hot spot (-1.0 < X < 2.0). Used for menu button item delete. - - yhot - Y hot spot (-1.0 < Y < 1.0). Used for menu button item delete. - - Notes - ----- - This is a command generated by the GUI and will appear in the log file - (Jobname.LOG) if annotation is used. This command is not intended to - be typed in directly in an ANSYS session (although it can be included - in an input file for batch input or for use with the /INPUT command). - - Type 13 (bitmap) annotation applies user defined bitmaps defined using - the FILE option of the /TXTRE command. - - This command is valid in any processor. - """ - command = f"/ANUM,{num},{type_},{xhot},{yhot}" - return self.run(command, **kwargs) - - def slashlarc(self, xcentr="", ycentr="", xlrad="", angle1="", angle2="", **kwargs): - """Creates annotation arcs (GUI). - - APDL Command: /LARC - - Parameters - ---------- - xcentr - Arc X center location (-1.0 < X < 1.0). - - ycentr - Arc Y center location (-1.0 < Y < 1.0). - - xlrad - Arc radius length. - - angle1 - Starting angle of arc. - - angle2 - Ending angle of arc. The arc is drawn counterclockwise from the - starting angle, `angle1`, to the ending angle, `angle2`. - - Notes - ----- - This command defines annotation arcs to be written directly onto the - display at a specified location. The command is generated by the Graphical - User Interface (GUI) and will appear in the log file (`Jobname.LOG`) if - annotation is used. It is not intended to be typed in directly in a - Mechanical APDL session (although it can be included in an input file - for batch input or for use with the `/INPUT` command). - All arcs are shown on subsequent displays unless the annotation is - turned off or deleted. Issueu `/LSPEC` to set the attributes - of the arc. - - This command is valid in any processor. - """ - command = f"/LARC, {xcentr}, {ycentr}, {xlrad}, {angle1}, {angle2}" - return self.run(command, **kwargs) - - def slashline(self, x1="", y1="", x2="", y2="", **kwargs): - """Creates annotation lines (GUI). - - APDL Command: /LINE - - Parameters - ---------- - X1 - Line X starting location (-1.0 < X < 2.0). - Y1 - Line Y starting location (-1.0 < Y < 1.0). - X2 - Line X ending location (-1.0 < X < 2.0). - Y2 - Line Y ending location (-1.0 < Y < 1.0). - - Notes - ----- - This command defines annotation lines to be written directly onto the - display at a specified location. The command is generated by the Graphical - User Interface (GUI) and appears in the log file (`Job-name.LOG`) if - annotation is used. It is not intended to be typed in directly in a - Mechanical APDL session (although it can be included in an input file - for batch input or for use with the `/INPUT` command). All lines are - shown on subsequent displays unless the annotation is turned off or - deleted. Issue `/LSPEC` to set the attributes of the line. - - This command is valid in any processor. - """ - command = f"/LINE, {x1}, {y1}, {x2}, {y2}" - return self.run(command, **kwargs) - - def lspec(self, lcolor="", linstl="", xlnwid="", **kwargs): - """Specifies annotation line attributes (GUI). - - APDL Command: /LSPEC - - Parameters - ---------- - lcolor - Line color: - - 0 - Black - - 1 - Red-Magenta - - 2 - Magenta - - 3 - Blue-Magenta - - 4 - Blue - - 5 - Cyan-Blue - - 6 - Cyan - - 7 - Green-Cyan - - 8 - Green - - 9 - Yellow-Green - - 10 - Yellow - - 11 - Orange - - 12 - Red - - 13 - Dark Gray - - 14 - Light Gray - - 15 - White - - linstl - Line style: - - 0 - Solid line. - - 1 - Dashed line. - - xlnwid - Line width multiplier (1.0 to 20.0). Defaults to 1.0. - - Notes - ----- - Specifies annotation line attributes to control certain characteristics - of the lines created via the /LINE, /LARC, /LSYMBOL, /POLYGON, /PMORE, - /PCIRCLE, and /PWEDGE commands. This is a command generated by the - Graphical User Interface (GUI) and will appear in the log file - (Jobname.LOG) if annotation is used. This command is not intended to - be typed in directly in an ANSYS session (although it can be included - in an input file for batch input or for use with the /INPUT command). - - This command is valid in any processor. - """ - command = f"/LSPEC,{lcolor},{linstl},{xlnwid}" - return self.run(command, **kwargs) - - def lsymbol(self, x="", y="", symang="", symtyp="", symsiz="", keybmp="", **kwargs): - """Creates annotation symbols (GUI). - - APDL Command: /LSYMBOL - - Parameters - ---------- - x - X location for symbol (-1.0 < X < 2.0). - - y - Y location for symbol (-1.0 < Y < 1.0). - - symang - Symbol orientation angle. - - symtyp - Symbol type: - - 1 - Arrow. - - 2 - Tee. - - 3 - Circle. - - 4 - Triangle. - - 5 - Star. - - symsiz - Symbol size multiplier (0.1 to 20.0). Defaults to 1.0. - - keybmp - If KEYBMP = 1, the annotation is a bitmap. SYMTYP will then be a - number from 1-99, indicating the bitmap type (see notes), and X and - Y will define the lower left corner of the bitmap. The SYMANG, - SYMSIZarguments are ignored. If KEYBMP = 0, or blank, then the - argument definitions above apply. - - Notes - ----- - Defines annotation symbols to be written directly onto the display at a - specified location. This is a command generated by the GUI and will - appear in the log file (Jobname.LOG) if annotation is used. This - command is not intended to be typed in directly in an ANSYS session - (although it can be included in an input file for batch input or for - use with the /INPUT command). - - All symbols are shown on subsequent displays unless the annotation is - turned off or deleted. Use the /LSPEC command to set the attributes of - the symbol. - - The KEYBMP argument reads the symtype argument to determine which - bitmap to insert. This bitmap is defined by an integer between 1 and - 99. Numbers 1 through 40 correspond to the standard texture values - found in the /TXTRE command, while numbers 51 through 99 correspond to - user supplied bitmaps, as defined using the Filename option of the - /TXTRE command. Numbers 51 through 57 are predefined (the logos, clamps - and arrows available from the GUI) but can be overridden. Numbers 41 - through 50 are reserved. - - This command is valid in any processor. - """ - command = f"/LSYMBOL,{x},{y},{symang},{symtyp},{symsiz},{keybmp}" - return self.run(command, **kwargs) - - def slash_pcircle(self, xcentr="", ycentr="", xlrad="", **kwargs): - """Creates an annotation circle (GUI). - - APDL Command: /PCIRCLE - - Parameters - ---------- - xcentr - Circle X center location (-1.0 < X < 2.0). - - ycentr - Circle Y center location (-1.0 < Y < 1.0). - - xlrad - Circle radius length. - - Notes - ----- - Creates an annotation circle to be written directly onto the display at - a specified location. This is a command generated by the Graphical - User Interface (GUI) and will appear in the log file (Jobname.LOG) if - annotation is used. This command is not intended to be typed in - directly in an ANSYS session (although it can be included in an input - file for batch input or for use with the /INPUT command). - - All circles are shown on subsequent displays unless the annotation is - turned off or deleted. Use the /LSPEC and the /PSPEC command to set - the attributes of the circle. - - This command is valid in any processor. - """ - command = f"/PCIRCLE,{xcentr},{ycentr},{xlrad}" - return self.run(command, **kwargs) - - def pmore(self, x5="", y5="", x6="", y6="", x7="", y7="", x8="", y8="", **kwargs): - """Creates an annotation polygon (GUI). - - APDL Command: /PMORE - - Parameters - ---------- - x5 - X location for vertex 5 of polygon (-1.0 < X < 2.0). - - y5 - Y location for vertex 5 of polygon (-1.0 < Y < 1.0). - - x6 - X location for vertex 6 of polygon (-1.0 < X < 2.0). - - y6 - Y location for vertex 6 of polygon (-1.0 < Y < 1.0). - - x7 - X location for vertex 7 of polygon (-1.0 < X < 2.0). - - y7 - Y location for vertex 7 of polygon (-1.0 < Y < 1.0). - - x8 - X location for vertex 8 of polygon (-1.0 < X < 2.0). - - y8 - Y location for vertex 8 of polygon (-1.0 < Y < 1.0). - - Notes - ----- - Defines the 5th through 8th vertices of an annotation polygon - [/POLYGON]. This is a command generated by the Graphical User - Interface (GUI) and will appear in the log file (Jobname.LOG) if - annotation is used. This command is not intended to be typed in - directly in an ANSYS session (although it can be included in an input - file for batch input or for use with the /INPUT command). - - This command is valid in any processor. - """ - command = f"/PMORE,,{x5},{y5},{x6},{y6},{x7},{y7},{x8},{y8}" - return self.run(command, **kwargs) - - def polygon( - self, - nvert="", - x1="", - y1="", - x2="", - y2="", - x3="", - y3="", - x4="", - y4="", - **kwargs, - ): - """Creates annotation polygons (GUI). - - APDL Command: /POLYGON - - Parameters - ---------- - nvert - Number of vertices of polygon (3 NVERT 8). Use /PMORE for - polygons with more than 4 vertices. - - x1 - X location for vertex 1 of polygon (-1.0 < X < 2.0). - - y1 - Y location for vertex 1 of polygon (-1.0 < Y < 1.0). - - x2 - X location for vertex 2 of polygon (-1.0 < X < 2.0). - - y2 - Y location for vertex 2 of polygon (-1.0 < Y < 1.0). - - x3 - X location for vertex 3 of polygon (-1.0 < X < 2.0). - - y3 - Y location for vertex 3 of polygon (-1.0 < Y < 1.0). - - x4 - X location for vertex 4 of polygon (-1.0 < X < 2.0). - - y4 - Y location for vertex 4 of polygon (-1.0 < Y < 1.0). - - Notes - ----- - Creates annotation polygons to be written directly onto the display at - a specified location. This is a command generated by the Graphical - User Interface (GUI) and will appear in the log file (Jobname.LOG) if - annotation is used. This command is not intended to be typed in - directly in an ANSYS session (although it can be included in an input - file for batch input or for use with the /INPUT command). - - All polygons are shown on subsequent displays unless the annotation is - turned off or deleted. Use the /LSPEC and the /PSPEC command to set - the attributes of the polygon. Use the /PMORE command to define the - 5th through 8th vertices of the polygon. - - This command is valid in any processor. - """ - command = f"/POLYGON,{nvert},{x1},{y1},{x2},{y2},{x3},{y3},{x4},{y4}" - return self.run(command, **kwargs) - - def pspec(self, pcolor="", kfill="", kbordr="", **kwargs): - """Creates annotation polygon attributes (GUI). - - APDL Command: /PSPEC - - Parameters - ---------- - pcolor - Polygon color (0 PCOLOR 15): - - 0 - Black. - - 1 - Red-Magenta. - - 2 - Magenta. - - 3 - Blue-Magenta. - - 4 - Blue. - - 5 - Cyan-Blue. - - 6 - Cyan. - - 7 - Green-Cyan. - - 8 - Green. - - 9 - Yellow-Green. - - 10 - Yellow. - - 11 - Orange. - - 12 - Red. - - 13 - Dark Gray. - - 14 - Light Gray. - - 15 - White. - - kfill - Polygon fill key: - - 0 - Hollow polygon. - - 1 - Filled polygon. - - kbordr - Polygon border key: - - 0 - No border. - - 1 - Border. - - Notes - ----- - Creates annotation polygon attributes to control certain - characteristics of the polygons created via the /POLYGON, /PMORE, - /PCIRCLE and /PWEDGE commands. This is a command generated by the - Graphical User Interface (GUI) and will appear in the log file - (Jobname.LOG) if annotation is used. This command is not intended to - be typed in directly in an ANSYS session (although it can be included - in an input file for batch input or for use with the /INPUT command). - - This command is valid in any processor. - """ - command = f"/PSPEC,{pcolor},{kfill},{kbordr}" - return self.run(command, **kwargs) - - def pwedge(self, xcentr="", ycentr="", xlrad="", angle1="", angle2="", **kwargs): - """Creates an annotation wedge (GUI). - - APDL Command: /PWEDGE - - Parameters - ---------- - xcentr - Wedge X center location (-1.0 < X < 2.0). - - ycentr - Wedge Y center location (-1.0 < Y < 1.0). - - xlrad - Wedge radius length. - - angle1 - Starting angle of wedge. - - angle2 - Ending angle of wedge. The wedge is drawn counterclockwise from - the starting angle, ANGLE1, to the ending angle, ANGLE2. - - Notes - ----- - Creates an annotation wedge to be written directly onto the display at - a specified location. This is a command generated by the Graphical - User Interface (GUI) and will appear in the log file (Jobname.LOG) if - annotation is used. This command is not intended to be typed in - directly in an ANSYS session (although it can be included in an input - file for batch input or for use with the /INPUT command). - - All wedges are shown on subsequent displays unless the annotation is - turned off or deleted. Use the /LSPEC and the /PSPEC command to set - the attributes of the wedge. - - This command is valid in any processor. - """ - command = f"/PWEDGE,{xcentr},{ycentr},{xlrad},{angle1},{angle2}" - return self.run(command, **kwargs) - - def tlabel(self, xloc="", yloc="", text="", **kwargs): - """Creates annotation text (GUI). - - APDL Command: /TLABEL - - Parameters - ---------- - xloc - Text X starting location (-1.0 < X < 1.6). - - yloc - Text Y starting location (-1.0 < Y < 1.0). - - text - Text string (60 characters maximum). Parameter substitution may be - forced within the text by enclosing the parameter name or - parametric expression within percent (%) signs. - - Notes - ----- - Defines annotation text to be written directly onto the display at a - specified location. This is a command generated by the Graphical User - Interface (GUI) and will appear in the log file (Jobname.LOG) if - annotation is used. This command is not intended to be typed in - directly in an ANSYS session (although it can be included in an input - file for batch input or for use with the /INPUT command). - - All text is shown on subsequent displays unless the annotation is - turned off or deleted. Use the /TSPEC command to set the attributes of - the text. - - This command is valid in any processor. - """ - command = f"/TLABEL,{xloc},{yloc},{text}" - return self.run(command, **kwargs) - - def tspec(self, tcolor="", tsize="", txthic="", pangle="", iangle="", **kwargs): - """Creates annotation text attributes (GUI). - - APDL Command: /TSPEC - - Parameters - ---------- - tcolor - Text color (0 TCOLOR 15): - - 0 - Black. - - 1 - Red-Magenta. - - 2 - Magenta. - - 3 - Blue-Magenta. - - 4 - Blue. - - 5 - Cyan-Blue. - - 6 - Cyan. - - 7 - Green-Cyan. - - 8 - Green. - - 9 - Yellow-Green. - - 10 - Yellow. - - 11 - Orange. - - 12 - Red. - - 13 - Dark Gray. - - 14 - Light Gray. - - 15 - White. - - tsize - Text size factor. - - txthic - Text thickness key: - - 1 - normal. - - 2 - twice as thick. - - 3 - three times as thick. - - 4 - four times as thick. - - pangle - Text path angle (0.0 < angle < 360.0). - - iangle - Text italic angle (0.0 < angle < 45.0). - - Notes - ----- - Defines annotation text attributes to control certain characteristics - of the text created via the /TLABEL command. This is a command - generated by the Graphical User Interface (GUI) and will appear in the - log file (Jobname.LOG) if annotation is used. This command is not - intended to be typed in directly in an ANSYS session (although it can - be included in an input file for batch input or for use with the /INPUT - command). - - This command is valid in any processor. - """ - command = f"/TSPEC,{tcolor},{tsize},{txthic},{pangle},{iangle}" - return self.run(command, **kwargs) diff --git a/src/ansys/mapdl/core/_commands/graphics_/graphs.py b/src/ansys/mapdl/core/_commands/graphics_/graphs.py deleted file mode 100644 index d8bdc591741..00000000000 --- a/src/ansys/mapdl/core/_commands/graphics_/graphs.py +++ /dev/null @@ -1,374 +0,0 @@ -# Copyright (C) 2016 - 2025 ANSYS, Inc. and/or its affiliates. -# SPDX-License-Identifier: MIT -# -# -# Permission is hereby granted, free of charge, to any person obtaining a copy -# of this software and associated documentation files (the "Software"), to deal -# in the Software without restriction, including without limitation the rights -# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -# copies of the Software, and to permit persons to whom the Software is -# furnished to do so, subject to the following conditions: -# -# The above copyright notice and this permission notice shall be included in all -# copies or substantial portions of the Software. -# -# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -# SOFTWARE. - - -class Graphs: - def axlab(self, axis="", lab="", **kwargs): - """Labels the X and Y axes on graph displays. - - APDL Command: /AXLAB - - Parameters - ---------- - axis - Axis specifier: - - X - Apply label to X axis. - - Y - Apply label to Y axis. - - lab - Axis label (user defined text up to 30 characters long). Leave - blank to reestablish the default for Axis axis. - - Notes - ----- - This command is valid in any processor. - """ - command = f"/AXLAB,{axis},{lab}" - return self.run(command, **kwargs) - - def grid(self, key="", **kwargs): - """Selects the type of grid on graph displays. - - APDL Command: /GRID - - Parameters - ---------- - key - Grid key: - - 0 (OFF) - No grid. - - 1 (ON) - Full grid (X and Y grid lines). - - 2 (X) - Partial grid (X grid lines only). - - 3 (Y) - Partial grid (Y grid lines only) - - Notes - ----- - Selects the type of grid on graph displays. Graphs with multiple - Y-axes can have multiple grids [/GRTYP]. The grid of the first curve - is also used as the background grid (above and behind the curve). - Grids for other curves are limited to be under the curves. See also - /GTHK and /GROPT for other grid options. - - This command is valid in any processor. - """ - command = f"/GRID,{key}" - return self.run(command, **kwargs) - - def gropt(self, lab="", key="", **kwargs): - """Sets various line graph display options. - - APDL Command: /GROPT - - Parameters - ---------- - lab - Apply display style as selected from the following labels: - - AXDV - Axis division (tick) marks (defaults to KEY = ON). - - AXNM - Axis scale numbers (defaults to KEY = ON, which puts numbers at the back plane - of the graph). If KEY = FRONT, numbers are on the front - plane of the graph. - - AXNSC - Axis number size scale factor. Input the scale value for KEY (defaults to - 1.0). - - ASCAL - Automatic scaling of additional Y-axes for multi-curve [/GRTYP, 2 or 3] graphs - (defaults to KEY = ON). If KEY = OFF, use base Y-axis - scaling (see the /YRANGE command). - - LOGX - Log X scale (defaults to KEY = OFF (linear)). - - LOGY - Log Y scale (applies only to the base Y axis) (defaults to KEY = OFF (linear)). - - FILL - Color fill areas under curves (defaults to KEY = OFF). - - CGRID - Superimpose background grid [/GRID] over areas under filled curves (defaults to - KEY = OFF). - - DIG1 - Number of significant digits before decimal point for axis values. Input the - value for KEY (defaults to 4). - - DIG2 - Number of significant digits after decimal point for axis values. Input the - value for KEY (defaults to 3). - - VIEW - View key for graph displays (defaults to KEY = OFF, in which case the view is - (0,0,1) for 2-D graph displays or (1,2,3) for 3-D graph - displays). If KEY = ON, the view settings for graph - displays are the same as the view settings for the model. - - REVX - Plots the values on the X-axis in reverse order. - - REVY - Plots the values on the Y-axis in reverse order. - - DIVX - Determines the number of divisions (grid markers) that will be plotted on the X - axis. - - DIVY - Determines the number of divisions (grid markers) that will be plotted on the Y - axis. - - LTYP - Determines whether ANSYS generated (KEY = 1) or system derived (KEY = 0) fonts - will be used for the axis labels. - - CURL - Determines the position of the curve labels. If (KEY = 1), the curve label will - be plotted in the legend column, and the label will be - displayed in the same color as the curve. If (KEY = 0) the - curve labels will be plotted near the curve. (default). - - XAXO - When you use this label, the subsequent KEY value will determine an offset - amount from the default (along the bottom) location for the - X axis. If KEY = 1.0, a full offset occurs (the X axis is - moved to the top of the graph). If KEY = 0.5, the axis is - offset to the midpoint of the graph, and if KEY = 0 the axis - remains in the original position, along the bottom of the - graph. For any offset, a grey copy of the original axis - (containing the axis numbering) remains at the original - location. - - YAXO - When you use this label, the subsequent KEY value will determine an offset - amount from the default (along the left side of the graph) - location for the Y axis. If KEY = 1.0, a full offset occurs - (the Y axis is moved to the right side of the graph). If KEY - = 0.5, the axis is offset to the midpoint of the graph, and - if KEY = 0 the axis remains in the original position, along - the left side of the graph. For any offset, a gray copy of - the original axis (containing the axis numbering) remains at - the original location. - - key - Option values: - - OFF (0) - Do not apply selected style. - - ON (1) - Apply selected style. - - nnnn - If Lab is DIG1 or DIG2, input the number of digits. - - nn - If Lab is AXNSC, input the scale factor. - - FRONT - If Lab is AXNM, FRONT may also be input. - - Ndiv - If Lab is DIVX or DIVY, determines the number of divisions (1-99) that will be - applied to the axis. - - Kfont - If Lab is LTYP, Kfont is ON (1) or OFF(0). ON will use ANSYS generated fonts - for the axis labels, while OFF will use SYSTEM (Windows, - X-system, etc.) fonts. The default value is ON (ANSYS - fonts). - - Notes - ----- - Sets various line graph display options. Issue /GROPT,STAT to display - the current settings. Issue /GROPT,DEFA to reset the default - specifications. ANSYS informs you that graph view manipulation is - inactive unless you have issued the /GROPT,VIEW,ON command. See the - /AXLAB, /GRTYP, /GRID, and /GTHK commands for other graph control - options. - - Automatic scaling using the /XRANGE and /YRANGE commands will often - yield inappropriate range values for logarithmic scales (/GROPT, LOGX - or /GROPT, LOGY). - - This command is valid in any processor. - """ - command = f"/GROPT,{lab},{key}" - return self.run(command, **kwargs) - - def grtyp(self, kaxis="", **kwargs): - """Selects single or multiple Y-axes graph displays. - - APDL Command: /GRTYP - - Parameters - ---------- - kaxis - Axis selection key: - - 0 or 1 - Single Y-axis. Up to 10 curves scaled to a single Y-axis. - - 2 - Additional Y-axes (one for each curve) (3 curves maximum). Allows better - scaling of curves with widely differing numbering ranges. - - 3 - Same as 2 but with additional Y-axis and curves projected out of the plane (6 - curves maximum). Allows clearer display with an isometric - view. The default view when KAXIS = 3 is View,1,1,2,3. - - Notes - ----- - The basic line graph has one or more curves plotted against the same Y - and X axes. Multiple curve graphs can also be plotted with individual - Y axes and the same X axis. The Y axis of the first curve is referred - to as the base Y-axis and the Y axes of the other curves as additional - Y axes. Curves are numbered sequentially from 1 (the base curve) in - the order in which they are displayed. See the /AXLAB, /GROPT, /GRID, - and /GTHK commands for other display options. - - This command is valid in any processor. - """ - command = f"/GRTYP,{kaxis}" - return self.run(command, **kwargs) - - def gthk(self, label="", thick="", **kwargs): - """Sets line thicknesses for graph lines. - - APDL Command: /GTHK - - Parameters - ---------- - label - Apply thicknesses as selected from the following labels: - - AXIS - Modify thickness of ordinate and abscissa axes on graph displays. - - GRID - Modify thickness of grid lines on graph displays. - - CURVE - Modify thickness of curve lines (when no area fill [/GROPT]). - - thick - Thickness ratio (whole numbers only, from -1 to 10): - - -1 - Do not draw the curve, but show only the markers specified by /GMARKER. - - 0 or 1 - Thin lines. - - 2 - The default thickness. - - 3 - 1.5 times the default thickness. - - etc. - (up to 10) - - Notes - ----- - Sets line thicknesses for graph lines (in raster mode only). Use - /GTHK,STAT to show settings. - - This command is valid in any processor. - """ - command = f"/GTHK,{label},{thick}" - return self.run(command, **kwargs) - - def xrange(self, xmin="", xmax="", **kwargs): - """Specifies a linear abscissa (X) scale range. - - APDL Command: /XRANGE - - Parameters - ---------- - xmin - Minimum abscissa scale value. - - xmax - Maximum abscissa scale value. - - Notes - ----- - Specifies a linear abscissa (X) scale range for the line graph display. - Use /XRANGE,DEFAULT to return to automatic scaling. - - Automatic scaling will often yield inappropriate range values for - logarithmic scales (/GROPT, LOGX). - - This command is valid in any processor. - """ - command = f"/XRANGE,{xmin},{xmax}" - return self.run(command, **kwargs) - - def yrange(self, ymin="", ymax="", num="", **kwargs): - """Specifies a linear ordinate (Y) scale range. - - APDL Command: /YRANGE - - Parameters - ---------- - ymin - Minimum ordinate scale value. - - ymax - Maximum ordinate scale value. - - num - Y-axis number to which range applies (defaults to 1). Valid - numbers are 1 to 3 for /GRTYP,2 and 1 to 6 for /GRTYP,3. If ALL, - apply to all Y-axes. - - Notes - ----- - Specifies a linear ordinate (Y) scale range for the line graph display. - Use /YRANGE,DEFAULT to return to automatic scaling. For multiple - Y-axes graphs [/GRTYP], see /GROPT, ASCAL to automatically scale the - additional Y-axes. - - Automatic scaling will often yield inappropriate range values for - logarithmic scales (/GROPT, LOGY). - - This command is valid in any processor. - """ - command = f"/YRANGE,{ymin},{ymax},{num}" - return self.run(command, **kwargs) diff --git a/src/ansys/mapdl/core/_commands/graphics_/labeling.py b/src/ansys/mapdl/core/_commands/graphics_/labeling.py deleted file mode 100644 index 5d773cf5243..00000000000 --- a/src/ansys/mapdl/core/_commands/graphics_/labeling.py +++ /dev/null @@ -1,1224 +0,0 @@ -# Copyright (C) 2016 - 2025 ANSYS, Inc. and/or its affiliates. -# SPDX-License-Identifier: MIT -# -# -# Permission is hereby granted, free of charge, to any person obtaining a copy -# of this software and associated documentation files (the "Software"), to deal -# in the Software without restriction, including without limitation the rights -# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -# copies of the Software, and to permit persons to whom the Software is -# furnished to do so, subject to the following conditions: -# -# The above copyright notice and this permission notice shall be included in all -# copies or substantial portions of the Software. -# -# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -# SOFTWARE. - - -class Labelling: - def cformat(self, nfirst="", nlast="", **kwargs): - """Controls the graphical display of alphanumeric character strings for - - APDL Command: /CFORMAT - parameters, components, assemblies, and tables. - - Parameters - ---------- - nfirst - Display the first n characters of the parameter, component, - assembly, or table name, up to 32. Defaults to 32. - - nlast - Display the last n characters of the parameter, component, - assembly, or table name, up to 32. Defaults to 0. - - Notes - ----- - Use this command to control the length of the character string that is - shown in the graphics window for a parameter, component, assembly, or - table name. - - The total number of characters (NFIRST + NLAST +3) cannot exceed 32. - - If NFIRST is greater than zero and NLAST = 0, only the NFIRST - characters are displayed, followed by an ellipsis. - - If NFIRST = 0 and NLAST is greater than zero, only the NLAST characters - are displayed, preceded by an ellipsis (...). - - If both NFIRST and NLAST are greater than zero, the name will be shown - as NFIRST, followed by an ellipsis (...), followed by NLAST, up to a - maximum of 32 characters. - - For example, if NFIRST = 6 and NLAST = 3, and the character string is - LENGTHOFSIDEONE, then it will appear in the graphics window as - LENGTH...ONE. - - If the actual length of the character string is less than the specified - combination of NFIRST + NLAST +3, then the actual string will be used. - - This command is valid in any processor. - """ - command = f"/CFORMAT,{nfirst},{nlast}" - return self.run(command, **kwargs) - - def clabel(self, wn="", key="", **kwargs): - """Specifies contour labeling. - - APDL Command: /CLABEL - - Parameters - ---------- - wn - Window number (or ALL) to which command applies (defaults to 1). - - key - Labeling key: - - 0 or 1 - Label contours with legend or color (default). - - -1 - No contour labeling. - - N - Same as 1 except show alphabetic legend only on every Nth element. - - Notes - ----- - Labels contours for identification with alphabetic legend for vector - displays and color for raster displays. Number of contours is - automatically reduced to 9 (or fewer) for clarity. Use /CONTOUR - command to increase (24 maximum for alphabetic labeling; no limit for - color labeling). - - This command is valid in any processor. - """ - command = f"/CLABEL,{wn},{key}" - return self.run(command, **kwargs) - - def contour(self, wn="", ncont="", vmin="", vinc="", vmax="", **kwargs): - """Specifies the uniform contour values on stress displays. - - APDL Command: /CONTOUR - - Parameters - ---------- - wn - Window number (or ALL) to which command applies (defaults to 1). - - ncont - Number of contour values. NCONT defaults to 9 for X11 or WIN32 and - to 128 for X11c or WIN32C. The default graphics window display for - 3-D devices is a smooth continuous shading effect that spans the - maximum of 128 contours available. Use the /DV3D command to create - defined banding for your contour values (values of 9 and 128 are - displayed in smooth shading only). The legend, however, will - display only nine color boxes, which span the full range of colors - displayed in the graphics window. - - vmin - Minimum contour value. If VMIN = AUTO, automatically calculate - contour values based upon NCONT uniformly spaced values over the - min-max extreme range. Or, if VMIN = USER, set contour values to - those of the last display (useful when last display automatically - calculated contours). - - vinc - Value increment (positive) between contour values. Defaults to - (VMAX-VMIN)/NCONT. - - vmax - Maximum contour value. Ignored if both VMIN and VINC are - specified. - - Notes - ----- - See the /CVAL command for alternate specifications. Values represent - contour lines in vector mode, and the algebraic maximum of contour - bands in raster mode. - - Note:: : No matter how many contours (NCONT) are specified by /CONTOUR, - the actual number of contours that appear on your display depends also - on the device name, whether the display is directed to the screen or to - a file, the display mode (vector or raster), and the number of color - planes. (All these items are controlled by /SHOW settings.) In any - case, regardless of whether they are smoothed or banded, only 128 - contours can be displayed. See Creating Geometric Results Displays in - the Basic Analysis Guide for more information on changing the number of - contours. - - If the current ANSYS graphics are not displayed as Multi-Plots, then - the following is true: If the current device is a 3-D device - [/SHOW,3D], the model contours in all active windows will be the same, - even if separate /CONTOUR commands are issued for each active window. - For efficiency, ANSYS 3-D graphics logic maintains a single data - structure (segment), which contains precisely one set of contours. The - program displays the same segment in all windows. The view settings of - each window constitute the only differences in the contour plots in the - active windows. - - This command is valid in any processor. - """ - command = f"/CONTOUR,{wn},{ncont},{vmin},{vinc},{vmax}" - return self.run(command, **kwargs) - - def cval( - self, - wn="", - v1="", - v2="", - v3="", - v4="", - v5="", - v6="", - v7="", - v8="", - **kwargs, - ): - """Specifies nonuniform contour values on stress displays. - - APDL Command: /CVAL - - Parameters - ---------- - wn - Window number (or ALL) to which command applies (defaults to 1). - - v1, v2, v3, . . . , v8 - Up to 8 contour values may be specified (in ascending order). The - 0.0 value (if any) must not be the last value specified. If no - values are specified, all contour specifications are erased and - contours are automatically calculated. - - Notes - ----- - This command is similar to the /CONTOUR command. With /CVAL, however, - you define the upper level of each contour band instead of having the - contours uniformly distributed over the range. The minimum value - (including a zero value for the first band) for a contour band cannot - be specified. If you use both /CONTOUR and /CVAL, the last command - issued takes precedence. - - This command is valid in any processor. - """ - command = f"/CVAL,{wn},{v1},{v2},{v3},{v4},{v5},{v6},{v7},{v8}" - return self.run(command, **kwargs) - - def gformat(self, ftype="", nwidth="", dsignf="", **kwargs): - """Specifies the format for the graphical display of numbers. - - APDL Command: /GFORMAT - - Parameters - ---------- - ftype - FORTRAN format types (G is the default if this field is left - blank.) - - G - Gxx.yy. xx and yy are described below. - - F - Fxx.yy - - E - Exx.yy - - nwidth - Total width (12 maximum) of the field (the xx in Ftype). Defaults - to 12. - - dsignf - Number of digits after the decimal point (yy in F or E format) or - number of significant digits in G format. Range is 1 to xx-6 for - Ftype = G or E; and 0 to xx-3 for Ftype = F. The default is a - function of Ftype and NWIDTH. - - Notes - ----- - Lets you control the format of the graphical display of floating point - numbers. Issue /GFORMAT,STAT to display the current settings; issue - /GFORMAT,DEFA to let ANSYS choose the format for the graphical display - of floating numbers. - - This command is valid in any processor. - """ - command = f"/GFORMAT,{ftype},{nwidth},{dsignf}" - return self.run(command, **kwargs) - - def hbc(self, wn="", key="", **kwargs): - """Determines how boundary condition symbols are displayed in a display - - APDL Command: /HBC - window. - - Parameters - ---------- - wn - Window reference number. This number can be any window numbered 1 - to 5, or ALL (for all active windows). Defaults to 1 - - key - Key to enable/disable hidden surface boundary condition symbol - display for 2-D graphics devices and to request improved pressure - contour display for 2-D and 3-D devices: Key = ON, YES or 1 will - show your BC symbols on the hidden surfaces and use an improved - pressure contour display. Key = OFF, NO or 0 (default) will hide - the symbols . - """ - command = f"/HBC,{wn},{key}" - return self.run(command, **kwargs) - - def number(self, nkey="", **kwargs): - """Specifies whether numbers, colors, or both are used for displays. - - APDL Command: /NUMBER - - Parameters - ---------- - nkey - Numbering style: - - * ``0`` : Color (terminal dependent) the numbered items - and show numbers. - - * ``1`` : Color the numbered items. Do not show the - numbers. - - * ``2`` : Show the numbers. Do not color the items. - - * ``-1`` : Do not color the items or show the numbers. For - contour plots, the resulting display will vary (see below). - - Notes - ----- - Specifies whether numbers, colors, or both are used for numbering - displays [/PNUM] of nodes, elements, keypoints, lines, areas, and - volumes. - - Shading is also available for terminals configured with more than 4 - color planes [/SHOW]. Color automatically appears for certain items - and may be manually controlled (off or on) for other items. - - When you suppress color (NKEY = -1) your contour plots will produce - different results, depending on your graphics equipment. For non-3-D - devices (X11, Win32, etc.) your contour plot will be white (no color). - For 3-D devices, such as OpenGL, the resulting display will be in - color. - - The following items are automatically given discrete colors: Boundary - condition symbols [/PBC], curves on graph displays, and distorted - geometry on postprocessing displays. Contour lines in postprocessing - displays are automatically colored based upon a continuous, rather than - a discrete, spectrum so that red is associated with the highest contour - value. On terminals with raster capability [/SHOW], the area between - contour lines is filled with the color of the higher contour. - - Explicit entity colors or the discrete color mapping may be changed - with the /COLOR command. - - This command is valid in any processor. - """ - command = f"/NUMBER,{nkey}" - return self.run(command, **kwargs) - - def pbc(self, item="", key="", min_="", max_="", abs_="", **kwargs): - """Shows boundary condition (BC) symbols and values on displays. - - APDL Command: /PBC - - Parameters - ---------- - item - Label identifying the item: - - U - Applied translational constraints (UX, UY, UZ). - - ROT - Applied rotational constraints (ROTX, ROTY, ROTZ). - - TEMP - Applied temperatures (TEMP, TBOT, TE2, TE3, . . ., TTOP). - - PRES - Applied fluid pressures. - - V - Applied flow velocities (VX, VY, VZ). - - VOLT - Applied voltages. - - MAG - Applied scalar magnetic potentials. - - A - Applied vector magnetic potentials. - - CONC - Concentration. - - CHRG - Applied electric charge. - - F or FORC - Applied structural forces (FX, FY, FZ). - - M or MOME - Applied structural moments (MX, MY, MZ). - - HEAT - Applied heat flows (HEAT, HBOT, HE2, HE3, . . ., HTOP). - - FLOW - Applied fluid flow. - - AMPS - Applied current flow. - - FLUX - Applied magnetic flux. - - CSG - Applied magnetic current segments. - - RATE - Diffusion flow rate. - - MAST - Master degrees of freedom. - - CP - Coupled nodes. - - CE - Nodes in constraint equations. - - NFOR - POST1 nodal forces. - - NMOM - POST1 nodal moments - - RFOR - POST1 reaction forces. - - RMOM - POST1 reaction moments (MX, MY, MZ). - - PATH - Path geometry (undistorted) associated with the PATH command after a PDEF or - PVECT command has been issued. - - ACEL - Global acceleration (ACELX, ACELY, ACELZ vector). - - OMEG - Global angular velocity (OMEGX, OMEGY, OMEGZ vector) and acceleration (DOMEGX, - DOMEGY, DOMEGZ vector). - - WELD - Applied spotwelds (ANSYS LS-DYNA). - - ALL - Represents all appropriate labels. - - key - Symbol key: - - 0 - Do not show symbol. - - 1 - Show symbol. - - 2 - Plot value next to symbol. - - min\\_ - Minimum value in a range of values plotted on screen. - - max\\_ - Maximum value in a range of values plotted on screen. - - abs\\_ - Absolute number. If KEY = 2 and ABS = 0, a number falling between - the MIN and MAX is displayed. If ABS is not specified, it defaults - to 0. If KEY = 2 and ABS = 1, an absolute value falling between - the MIN and MAX is displayed. ABS = 1 lets you eliminate the - display of numbers whose absolute values are less than a desired - tolerance. For example, if ABS = 1, MIN = 10 and MAX = 1e8, values - such as .83646 and -5.59737 are not displayed. - - Notes - ----- - The ``mapdl.pbc`` command adds degree of freedom constraint, force load, and - other symbols to displays. - - Symbols are applied to the selected nodes only. All arrow and - arrowhead symbols are oriented in the nodal coordinate system and lie - in two perpendicular planes. Force arrows are scaled proportional to - their magnitude. (If KEY = 1, use /VSCALE to change arrow length.) - For scalar quantities, the specific component direction (i.e., x, y, or - z) of the symbol has no meaning, but the positive or negative sense - (e.g., positive or negative x) represents a positive or negative scalar - value, respectively. - - The effects of the ``mapdl.pbc`` command are not cumulative (that is, the - command does not modify an existing setting from a previously issued - ``mapdl.pbc`` command). If you issue multiple ``mapdl.pbc`` commands - during an analysis, only the setting specified by the most recent - ``mapdl.pbc`` command applies. - - Use ``mapdl.pstatus()`` or ``mapdl.pbc('STAT')`` to display settings. - Use ``mapdl.pbc('DEFA')`` to reset all specifications back to default. - See the ``mapdl.psf`` and ``mapdl.pbf`` commands for other display symbols. - - In a cyclic symmetry analysis, the ``mapdl.pbc`` command is deactivated when - cyclic expansion is active (/CYCEXPAND,,ON). To view boundary - conditions on the basic sector, deactivate cyclic expansion - (/CYCEXPAND,,OFF) and issue this command: ``mapdl.pbc('ALL', 1)`` - - Issuing the command ``mapdl.pbc('PATH', 1)`` displays all defined paths. - - The ``mapdl.pbc`` command is valid in any processor. - - .. note: - In APDL the /PBC command has an unused 3rd argument. This has been - removed in PyMAPDL because of its redundancy, and should be - kept in mind when translating between the two. - - Examples - -------- - On all subsequent plots (after this command). Activate display of - translational boundary condition symbols. - - >>> mapdl.pbc('U', 1) - - Display enforced nodal temperatures - - >>> mapdl.pbc('TEMP', 1) - """ - command = f"/PBC,{item},,{key},{min_},{max_},{abs_}" - return self.run(command, **kwargs) - - def pbf(self, item="", key="", **kwargs): - """Shows magnitude of body force loads on displays. - - APDL Command: /PBF - - Parameters - ---------- - item - Label identifying the item: - - TEMP - Applied temperatures. - - FLUE - Applied fluences. - - HGEN - Applied heat generation rates. - - JS - Applied current density magnitude. - - JSX - X-component of current density. - - JSY - Y-component of current density. - - JSZ - Z-component of current density. - - PHASE - Phase angle of applied load. - - MVDI - Applied magnetic virtual displacements flag. - - CHRGD - Applied electric charge density. - - VLTG - Applied voltage drop. - - key - Symbol key: - - 0 - Do not show body force load contours. - - 1 - Show body force load contours. - - 2 - Show current density as a vector (not a contour). - - Notes - ----- - Shows body force loads as contours on displays for the selected - elements. - - The effects of the ``mapdl.pbf`` command are not cumulative (that is, the - command does not modify an existing setting from a previously issued - ``mapdl.pbf`` command). If you issue multiple ``mapdl.pbf`` commands - during an analysis, only the setting specified by the most recent - ``mapdl.pbf`` command applies. - - Use ``mapdl.pstatus()`` or ``mapdl.pbf('STAT')`` to display settings. - Use ``mapdl.pbf('DEFA')`` to reset all specifications back to default. - See also the ``mapdl.psf`` and ``mapdl.pbc`` command - for other display contours. - - Portions of this command are not supported by PowerGraphics - [``mapdl.graphics('POWER')``]. - - This command is valid in any processor. - - .. note: - In APDL the /PBF command has an unused 2nd argument. This has been - removed in PyMAPDL because of its redundancy, and should be - kept in mind when translating between the two. - - Examples - -------- - Activate display of body loads of structural temperature on subsequent plots - by showing body force and contours. - - >>> mapdl.pbf('TEMP', 1) - """ - return self.run(f"/PBF,{item},,{key}", **kwargs) - - def plopts(self, label="", key="", **kwargs): - """Controls graphics options on subsequent displays. - - APDL Command: /PLOPTS - - Parameters - ---------- - label - Apply display items as selected from the following labels: - - INFO - Controls the display of the legend (ON or OFF) and allows the choice of preset - or Multi-legend placement. Control is provided by the KEY - values. (Defaults to KEY=3 when the GUI is on. Defaults to - KEY= 2 otherwise.) - - LEG1 - Header portion of legend column (defaults to ON). - - LEG2 - View portion of legend column (defaults to ON (except off with contour - displays)). - - LEG3 - View the contour section of the legend column (defaults to ON). - - FRAME - Frame border lines around windows (defaults to ON). - - TITLE - Title (bottom left text) (defaults to ON). - - MINM - Min-Max symbols on contour displays (defaults to ON). - - LOGO - ANSYS logo (defaults to OFF (displayed as text at top of legend column)). If - KEY = ON, the text is removed from legend column but the - logo symbol is displayed in whichever active window is - either in the uppermost right corner and on top, or if there - is no window in that location, then in the window to the - furthest right of the screen. Version information remains - in the legend column. - - WINS - Controls whether graphics windows automatically stretch or shrink to adjust to - screen size as the legend column is turned off or on - [/PLOPTS,INFO] (defaults to ON). If WINS is on and the - legend column is changed from off to on, all windows are - shrunk regardless of what their correct size is. - - WP - Working plane (defaults to OFF). The working plane is drawn as part of the - display (not just an overlaid image as in WPSTYL). This - option is best used in combination with a hidden-line - technique [/TYPE]. - - DATE - Controls the display of the date and time in your legend. Subsequent KEY values - control the display as follows: - - FILE - Controls the display of the ANSYS jobname in your legend. Subsequent KEY values - control the display as follows: - - key - Switch: - - OFF or 0 - Do not apply this display item. For Label = DATE, no time or date are - displayed. - - ON or 1 - Apply this display item. For Label = DATE, show only the date. - - AUTO or 2 - For Label = INFO, initiate Auto-legend mode. If the display has contours, the - legend is ON; if the display has no contours, the - legend is OFF. For Label = DATE, display both the date - and time. - - 3 - For Label = INFO , switch to Multi-legend mode. See the /UDOC command for the - available legend configurations. - - Notes - ----- - Use /PLOPTS,STAT to display settings. Use /PLOPTS,DEFA to reset all - specifications back to their defaults. - - When you perform multiple results displays, contours on the legend - column may be truncated. To avoid this, specify /PLOPTS,LEG1,0. - - The Multi-legend mode provides a number of legend data item priority - and placement options. These options are accessed via the GUI at - Utility Menu> PlotCtrls> Window Controls> Window Options. The /UDOC - command provides command line options for this capability. - - This command is valid in any processor. - - This command is not available for Academic Research or Teaching level - products - """ - command = f"/PLOPTS,{label},{key}" - return self.run(command, **kwargs) - - def pnum(self, label="", key="", **kwargs): - """Controls entity numbering/coloring on plots. - - APDL Command: /PNUM - - Parameters - ---------- - label - Type of numbering/coloring: - - NODE - Node numbers on node and element plots. - - ELEM - Element numbers and colors on element plots. - - SEC - Section numbers and colors on element and solid model plots (see "Notes"). - - MAT - Material set numbers and colors on element and solid model plots (see - "Notes"). - - TYPE - Element type reference numbers and colors on element and solid model plots (see - "Notes"). - - REAL - Real constant set numbers and colors on element and solid model plots (see - "Notes"). - - ESYS - Element coordinate system numbers on element and solid model plots (see - "Notes"). - - PART - Element part numbers and colors on element plots (applicable to ANSYS LS-DYNA - only). - - LOC - Location numbers/colors of the element in matrix assembly order on element - plots. - - .. note:: ``LOC`` and ``ELEM`` numbers will be the same unless the model has been reordered. - - KP - Keypoint numbers on solid model plots. - - LINE - Line numbers on solid model plots (both numbers and colors on line plots). - - AREA - Area numbers on solid model plots (both numbers and colors on area plots). - - VOLU - Volume numbers on solid model plots (both numbers and colors on volume plots). - - SVAL - Stress (or any contour) values on postprocessing plots, and - surface load values and colors on model plots (when surface load - symbols are on [/PSF]). For tabular boundary conditions, the - table-evaluated values will be displayed on node, element, or - contour displays in POST1 when load symbols (/PBF, /PSF, /PBC) - are on and TABNAM is OFF. - - TABNAM - Table names for tabular boundary conditions. If this label is - turned on, the table name appears next to the appropriate - symbol, arrow, face outline, or contour as dictated by the /PSF, - /PBC, and /PBF commands. - - STAT - Shows current settings for /PNUM. - - DEFA - key - Switch: - - 0 - Turns OFF numbers/colors for specified label. - - 1 - Turns ON numbers/colors for specified label. - - Notes - ----- - This command specifies entity numbering and coloring for subsequent - plots. - - The MAT, TYPE, REAL, and ESYS labels activate both the numbering and - coloring of the corresponding attributes for EPLOT, KPLOT, LPLOT, - APLOT, and VPLOT. The ELEM, MAT, TYPE, REAL, ESYS, PART (ANSYS LS-DYNA - only), and LOC labels are mutually exclusive, i.e., only one can be - specified at a time. Also, turning on a LINE, AREA, or VOLU label will - turn off the MAT, TYPE, REAL, and PART labels. - - PowerGraphics [/GRAPHICS,POWER] displays for/PNUM can be problematic. - /PNUM,ELEM will display erratically depending on other display command - specifications, while /PNUM,LOC and /PNUM,ESYS are not supported. - - Element and volume numbers are not visible for 3-D elements and volumes - when Z-buffering is turned on (/TYPE,,[6,7, or 8]). - - Use /PSTATUS or /PNUM,STAT to show settings. Use /PNUM,DEFA to reset - all specifications back to default. Use the /NUMBER command to control - whether numbers and colors are displayed together. - - This command is valid in any processor - """ - command = f"/PNUM,{label},{key}" - return self.run(command, **kwargs) - - def psf(self, item="", comp="", key="", kshell="", color="", **kwargs): - """Shows surface load symbols on model displays. - - APDL Command: /PSF - - Parameters - ---------- - item, comp - Labels identifying the surface load to be shown; see - Table 227: /PSF Valid Item and Component Labels. - - key - Key to turn surface load symbols on or off: - - 0 - Off (default). - - 1 - On, shown as face outlines. Line surface loads (SFL) on solid model plots are - shown as arrows. - - 2 - On, shown as arrows. - - 3 - On, shown as color filled surfaces. Line and area surface loads (SFL and SFA) - on solid model plots are shown as arrows. - - kshell - Visibility key for shell elements. - - 0 - Off (default), surface load symbols are displayed only on visible load faces. - - 1 - On, surface load symbols are displayed even if load face is not visible. - - color - Visibility key for contour legend. - - ON - The symbols (arrows or face outlines) will show up in color with the legend - showing the corresponding color labels (default). - - OFF - The contour legend will not be displayed. The symbols (arrows or face outlines) - will show up in grey. The size of the arrows will be - proportional to the applied load. - - Notes - ----- - The ``mapdl.psf`` command determines whether and how to show surface loads on - subsequent model displays. - - If surface loads are applied to solid model entities, only solid model - plots show the load symbols; node and element plots do not show them - unless the loads are transferred (SFTRAN or SBCTRAN). Similarly, solid - model plots do not show the load symbols if surface loads are applied - to nodes and elements. For node and element plots of shell element - models, the surface load symbols are shown only if the load face is - visible from the current viewing direction. - - The effects of the ``mapdl.psf`` command are not cumulative (that is, the - command does not modify an existing setting from a previously issued - ``mapdl.psf`` command). Only the setting specified via the most recent - ``mapdl.psf`` command applies. - - If you issue a postprocessing (``mapdl.post1``) plot command that produces result - contours (such as PLNSOL), the ``mapdl.psf`` command has no effect. This - behavior prevents conflicting contours in the graphics window. - - When using the radiosity method (Item = RDSF and Comp = ENCL) with Key - = 2, the radiation arrows point outward from any element face. When - using SURF154 with KEYOPT(2) = 1, set the Item to PRES and leave the - Component Label blank. - - ``mapdl.psf('STAT')`` displays current ``mapdl.psf`` settings, and - ``mapdl.psf('DEFA')`` resets them back to default. - - Other useful commands are ``mapdl.pnum('SVAL', 1)`` to show the values of the - surface loads, ``mapdl.vscale()`` to change arrow lengths, and - ``mapdl.pbc`` and ``mapdl.pbf`` to activate other load symbols. - - For beam elements, only the colors representing shear (GREEN) and - normal (RED) pressures are displayed for the arrows. The color of these - arrows does not correspond to the magnitudes in the contour legend. The - length of these arrows does, however, correlate to the relative - magnitude of the pressures. - - For elements SURF159, SOLID272, SOLID273, PIPE288 and PIPE289, the /PSF - command is not available when displaying elements with shapes - determined from the real constants or section definition (``mapdl.eshape``). - For PIPE288 and PIPE289, only external loads applied via the - ``mapdl.sfbeam`` command are displayed. - - This command is valid in any processor. - - Table: 227:: : /PSF - Valid Item and Component Labels - - Pressure loads apply to the element coordinate system (KEYOPT(2) = 0). - Adjust appropriately for a local coordinate system (KEYOPT(2) = 1). See - Figure: 153.2:: Pressures in the Element Reference. - - Examples - -------- - On subsequent plots display the surface loads of pressure as arrows. - - >>> mapd.psf('PRES', '', 2) - - Activate display of convection on surfaces using the element outline option. - - >>> mapdl.psf('CONV', '', 1) - """ - command = f"/PSF,{item},{comp},{key},{kshell},{color}" - return self.run(command, **kwargs) - - def psymb(self, label="", key="", **kwargs): - """Shows various symbols on displays. - - APDL Command: /PSYMB - - Parameters - ---------- - label - Show symbols as selected from the following labels: - - CS - Local coordinate systems. - - NDIR - Nodal coordinate systems (on rotated nodes only). - - ESYS - Element coordinate systems (element displays only). - - LDIR - Line directions (line displays only). - - LDIV - Controls the display of element divisions on lines. - - ADIR - Area direction symbol (for keypoint, line, area and volume plots). - - LAYR - Layer orientations (relative to the projected element x-axis) or fiber - orientations in smeared reinforcing elements. Used only - within an element display. Use KEY to specify the layer - number. - - ECON - Element mesh symbols on keypoints and lines. - - DOT - Larger symbols displayed for node and keypoint locations. When Label = DOT, - KEY = 1 by default. - - XNOD - Extra node of surface or circuit elements. - - FBCS - Force boundary condition scaling. Subsequent KEY value determines whether or - not to scale the applied and derived forces/moments to the - same maximum value. - - DEFA - Resets the symbol keys so that ANSYS displays none of the symbols controlled by - the /PSYMB command. The value of the KEY field is ignored. - - STAT - Prints the status of the settings of the symbol - keys controlled by the /PSYMB command. The KEY - field is ignored. - - key - Symbol key: - - ``-1`` - Effective only if Label = LAYR and solid shape - element display (/ESHAPE) is active. Orientation of - all layers appears with the solid shape element - display. - - 0 - No symbol (default). If Label = LDIV, then KEY= 0 - indicates that the displayed element divisions will - correspond to the existing mesh (the word MESHED or - EXISTING can also be substituted). Also, for Label = - LDIV, if you execute any meshing command (such as - AMESH or VMESH), KEY is set to 0 (MESHED) - automatically. If Label = FBCS, then KEY= 0 indicates - that boundary condition scaling will not be - common. The applied and derived forces/moments will - be scaled to their respective maximum values. - - 1 - Include symbol. If Label = LDIV, then KEY = 1 - indicates that the displayed line divisions will - correspond to the value assigned by LESIZE (the word - LESIZE can also be substituted). Also, for Label = - LDIV, if you execute the LESIZE command, KEY is set - to 1 (LESIZE) automatically. If Label = FBCS, then - KEY= 1 indicates that boundary condition scaling will - be common. The applied and derived forces/moments - will be scaled to the same maximum value. - - N - If Label = LAYR, then N is equal to the layer - number. If Label = DOT, then N can be equal to - 0,1,.....15, indicating the dot size. If Label = - LDIV, then KEY = -1, indicates that no element - divisions will be displayed (the word OFF can also be - substituted). - - Notes - ----- - Includes various symbols on the display. Triads are right-handed with - x displayed as the longest leg. Where color is displayed, x is white, - y is green, and z is blue. For beams, x is always along the length of - the element. For lines, an arrow represents the direction of a line, - from the beginning keypoint to the end keypoint. See /PLOPTS command - for additional display options. Use /PSTATUS or /PSYMB,STAT to display - settings. Use /PSYMB,DEFA to reset all specifications back to their - defaults. The command /PSYMB,ECON,1 causes the symbol "M" to be - displayed on keypoints and lines associated with meshed entities. When - you issue the command /PSYMB,DOT,1, a larger symbol is displayed for - each node and keypoint location. - - PowerGraphics (/GRAPHICS,POWER) does not support /PSYMB,ESYS and - /PSYMB,LAYR. - - If KEY = N and PowerGraphics is off, the centroid of the surface - elements is connected to the extra node using a gray line. However, if - PowerGraphics is on, the color of the line connecting the centroid to - the extra node is the same as that for the elements themselves (as - determined by /PNUM). - - When Label = LAYR, the layer systems can be visualized with all - current-technology layered elements and the smeared reinforcing element - REINF265. To use /PSYMB,LAYR with REINF265, first set the vector-mode - graphics option (/DEVICE,VECTOR,1). - - This command is valid in any processor. - - """ - command = f"/PSYMB,{label},{key}" - return self.run(command, **kwargs) - - def triad(self, lab="", **kwargs): - """Shows the global XYZ coordinate triad on displays. - - APDL Command: /TRIAD - - Parameters - ---------- - lab - Display triad as follows: - - ORIG - Display triad at global origin (default). - - OFF - Turn off triad display. - - LBOT - Display triad in lower left screen corner. - - RBOT - Display triad in lower right screen corner. - - LTOP - Display triad in upper left screen corner. - - RTOP - Display triad in upper right screen corner. - - Notes - ----- - For efficiency, ANSYS 3-D graphics logic maintains a single data - structure (segment), which includes the triad as a 3-D data object. If - a 3-D device is involved (/SHOW,3D), and the ANSYS graphics are not - being displayed as multi-plots, then the triad location is determined - by the view settings for Window #1. A request for triad display - anywhere except for the origin could yield an improper display in - windows 2 through 5. The program displays the same segment in all - windows. The view settings of each window constitute the only - difference in the display in the active windows. - - This command is valid in any processor. - """ - command = f"/TRIAD,{lab}" - return self.run(command, **kwargs) - - def udoc(self, wind="", cl_ass="", key="", **kwargs): - """Determines position and content for the multi-legend options. - - APDL Command: /UDOC - - Parameters - ---------- - wind - The window number to which the command applies. (defaults to 1) - - class - The type (and relative importance) of legend item being displayed: - - CNTR - Contour legend. This legend item is controlled separately from the other legend - items (see note below). - - DATE - The items in the DATE class include the date and time, or the ANSYS graphical - logo (/PLOPTS,LOGO,1). This item is shown by default in all - plots. - - GWIN - The items in the GWIN class include the entity acronyms that appear in the - legend of a multiplot of entities (Nodes, Elements, - Keypoints, Lines, Areas, Volumes). GWIN items are shown by - default for all GPLOT displays. - - TYPE - Items in the TYPE class include the plot type (e.g. ELEMENTS, MATERIALS, NODAL - SOLUTIONS, etc.). TYPE items are shown by default in all - plots. - - TYP2 - Items in the TYP2 class include supplementary type information, such as DMAX - and SMAX for nodal solutions. TYP2 items are shown by - default in all plots. - - INUM - Items in the INUM class include the number labels generated by the /PNUM - command. This class is displayed by default in all plots - that contain /PNUM information. - - BCDC - The items in the BCDC class include labels created by the /PBC command. This - class is shown by default in all plots which contain /PBC - information. - - VECT - Items in the VECT class include labels created by the PLVECT command. This - class is shown by default for all PLVECT plots. - - SURF - The items in the SURF class include labels from the /PSF legend. This class is - shown by default on all plots of surface boundary - conditions. - - BODY - Items from the BODY class include labels from the /PBF legend. This class is - shown by default in all plots of body forces. - - PSTA - Items from the PSTA class include stress scaling statistics, such as the - /SSCALE setting. This class is not shown as the default for - any type of plot, and must be specifically referenced to - display the included data. - - VIEW - The items in the VIEW class include view statistics. This class is not shown as - the default for any type of plot, and must be specifically - referenced to display the included data. - - MISC - The items in the MISC class include supplementary labels like /EXPANDED and - Stress Section Cross Section. This class is not shown as the - default for any type of plot, and must be specifically - referenced to display the included data. - - key - Switch: - - Notes - ----- - The legend classes conform to the controls specified in the window - options panel (PlotCtrls> Window Controls> Window Options). In many - instances, the legend controls specified with the /PLOPTS command will - take precedence and override /UDOC specifications. For instance: - - /PLOPTS,LEG1,OFF will disable the TYPE, TYP2, INUM, and MISC classes, - regardless of the /UDOC settings. - - /PLOPTS,LEG2,OFF will disable the VIEW class, regardless of the /UDOC - settings. - - /PLOPTS,LEG3,OFF will disable the PSTA class, regardless of the /UDOC - settings. - - All items in a class are listed with the same X coordinate (except for - contours). The contents of the text classes are dumped onto the display - window from top to bottom, in order of class importance. - - The font specification for text items that are included in the user- - specified legends are controlled with the /DEVICE command (PlotCtrls> - Font Controls> Anno/Graph Font). - - The floating point values for the data presented in the legend(s) are - controlled by the /GFORMAT command. - """ - command = f"/UDOC,{wind},{cl_ass},{key}" - return self.run(command, **kwargs) diff --git a/src/ansys/mapdl/core/_commands/graphics_/scaling.py b/src/ansys/mapdl/core/_commands/graphics_/scaling.py deleted file mode 100644 index 3d1460d6cc1..00000000000 --- a/src/ansys/mapdl/core/_commands/graphics_/scaling.py +++ /dev/null @@ -1,447 +0,0 @@ -# Copyright (C) 2016 - 2025 ANSYS, Inc. and/or its affiliates. -# SPDX-License-Identifier: MIT -# -# -# Permission is hereby granted, free of charge, to any person obtaining a copy -# of this software and associated documentation files (the "Software"), to deal -# in the Software without restriction, including without limitation the rights -# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -# copies of the Software, and to permit persons to whom the Software is -# furnished to do so, subject to the following conditions: -# -# The above copyright notice and this permission notice shall be included in all -# copies or substantial portions of the Software. -# -# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -# SOFTWARE. - - -class Scaling: - def slashdscale(self, wn="", dmult="", **kwargs): - """Sets the displacement multiplier for displacement displays. - - APDL Command: /DSCALE - - Parameters - ---------- - wn - Window number (or ALL) to which command applies (defaults to 1). - - dmult - AUTO or 0 - Scale displacements automatically so that maximum displacement - (vector amplitude) displays as 5 percent of the maximum model - length, as measured in the global Cartesian X, Y, or Z - directions. - - 1 - Do not scale displacements (that is, scale displacements by 1.0, - true to geometry). Often used with large deflection results. - - FACTOR - Scale displacements by numerical value input for `FACTOR`. - - OFF - Remove displacement scaling (that is, scale displacements by 0.0, - no distortion). - - USER - Set `dmult` to that used for last display (useful when last `dmult` - value was automatically calculated). - - Notes - ----- - - **Command Default** - - The default value is AUTO or 0 except when: - - * Large deflection effects are included (`NLGEOM,ON`) and it is not a - modal analysis; then the default is 1. - - * It is a spectrum analysis (`ANTYPE,SPECTR`); then the default is `OFF`. - - * The amplitude of a time-harmonic solution is computed using the `HRCPLX` - command (`OMEGAT ≥ 360°`); then the default is `OFF`. - - * The amplitude of a complex modal or harmonic solution is stored into - the database using the `SET` command (`KIMG = AMPL`); then the default - is `OFF`. - - If Multi-Plots are not being displayed, and the current device is a 3D - device (`/SHOW,3D`), then the displacement scale in all active windows - will be the same, even if separate `/DSCALE` commands are issued for - each active window. For efficiency, the program maintains a single data - structure (segment) containing only one displacement scale. The program - displays the same segment (displacement scale) in all windows. Only the - view settings will be different in each of the active windows. - - This command is valid in any processor. - - """ - command = f"/DSCALE, {wn}, {dmult}" - return self.run(command, **kwargs) - - def iclwid(self, factor="", **kwargs): - """Scales the line width of circuit builder icons. - - APDL Command: /ICLWID - - Parameters - ---------- - factor - Multiplication factor applied to the default line width (defaults - to 1). The minimum is 1 and the maximum is 6. - - Notes - ----- - Distributed ANSYS Restriction: This command is not supported in - Distributed ANSYS. - """ - command = f"/ICLWID,{factor}" - return self.run(command, **kwargs) - - def icscale(self, wn="", factor="", **kwargs): - """Scales the icon size for elements supported in the circuit builder. - - APDL Command: /ICSCALE - - Parameters - ---------- - wn - Window number (or ALL) to which command applies (defaults to 1). - - factor - Factor applied to the default icon size (defaults to 1). - - Notes - ----- - Scaling the icon size can provide better visualization of the circuit - components when using the Circuit Builder (an interactive builder - available in the ANSYS GUI). - - Distributed ANSYS Restriction: This command is not supported in - Distributed ANSYS. - """ - command = f"/ICSCALE,{wn},{factor}" - return self.run(command, **kwargs) - - def ratio(self, wn="", ratox="", ratoy="", **kwargs): - """Distorts the object geometry. - - APDL Command: /RATIO - - Parameters - ---------- - wn - Window number (or ALL) to which command applies (defaults to 1). - - ratox - Distort object in the window X direction by this factor (defaults - to 1.0). - - ratoy - Distort object in the window Y direction by this factor (defaults - to 1.0). - - Notes - ----- - Distorts the object geometry in a particular direction. An example of - this command's use would be to allow long narrow sections to be - distorted to a more square area for better display visualization. - - This command is valid in any processor. - """ - command = f"/RATIO,{wn},{ratox},{ratoy}" - return self.run(command, **kwargs) - - def shrink(self, ratio="", **kwargs): - """Shrinks elements, lines, areas, and volumes for display clarity. - - APDL Command: /SHRINK - - Parameters - ---------- - ratio - Shrinkage ratio (input as a decimal (0.0 to 0.5)). Defaults to 0.0 - (no shrinkage). Values greater than 0.5 default to 0.1 (10% - shrinkage). - - Notes - ----- - Shrinks the elements, lines, areas, and volumes so that adjacent - entities are separated for clarity. Portions of this command are not - supported by PowerGraphics [/GRAPHICS,POWER]. - - If only the common lines of non-coplanar faces are drawn (as per the - /EDGE command), then this command is ignored. - - This command is valid in any processor. - """ - command = f"/SHRINK,{ratio}" - return self.run(command, **kwargs) - - def sscale(self, wn="", smult="", **kwargs): - """Sets the contour multiplier for topographic displays. - - APDL Command: /SSCALE - - Parameters - ---------- - wn - Window number (or ALL) to which command applies (defaults to 1). - - smult - Contour multiplier that factors in results based on the product of - the multiplier and the result being plotted. Defaults to 0.0 (no - topographic effects). - - Notes - ----- - Use this command to scale values to the geometry when the contours are - shown elevated. For section displays [/TYPE], the elevation is - performed perpendicular to the section face. - - Nonzero contour multipliers factoring in large results (stresses or - displacements) can produce very large distortion, causing images to - disappear. To bring a distorted image back into view, reduce the - contour multiplier value. - - Portions of this command are not supported by PowerGraphics - [/GRAPHICS,POWER]. - """ - command = f"/SSCALE,{wn},{smult}" - return self.run(command, **kwargs) - - def txtre(self, lab="", num="", n1="", n2="", ninc="", **kwargs): - """Controls application of texture to selected items. - - APDL Command: /TXTRE - - Parameters - ---------- - lab - You can apply texture according to the following labels: - - ELEM - Apply texture to elements N1 through N2 in steps of NINC. - - AREA - Apply texture to areas N1 through N2 in steps of NINC. - - VOLU - Apply texture to volumes N1 through N2 in steps of NINC. - - CM - Apply texture to the component named in N1. N2 and - NINC are ignored. - - ON, OFF - Sets the specified texture display on or - off. All other fields are ignored. - - File - If Lab = File, the command format is /TXTRE, File, - Key_Index, Fname, Fext, --, Format (This variant of - the command is applicable to 2-D drivers). - - Key_Index - The texture index associated with the file. If - the number fifty-one (51) is used, the - imported bitmap will be used as the window's - logo. - - 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. - - Fext - Filename extension (eight-character maximum). - - Format - The file format. If Format = 0, the file is a - pixmap (Linux) or Bitmap (PC). The file cannot - contain a compressed image, and the PC file must - be 8 or 24 bit BI_RGB format. If Format = 1 or - JPEG, then the file is in JPEG (Joint - Photographic Experts Group) format. If Format = 2 - or PNG, then the file is in PNG (Portable Network - Graphics) format. - - num - Select the texture index number from the following list: - - 0 - No Texturing - - 1 - Aluminum - - 2 - Aluminum, Brushed - - 3 - Steel With Bumps - - 4 - Steel, Embossed - - 5 - Iron - - 6 - Steel, Pattern - - 7 - Steel, Riveted - - 8 - Steel, Scratched - - 9 - Tin - - 10 - Metal - - 11 - Steel, Etched - - 12 - Metal, Hot - - 13 - Iron, Grainy - - 14 - Metal, Rusty - - 15 - Brick - - 16 - Block - - 17 - Wood - - 18 - Wood, Light - - 19 - Wood, Walnut - - 20 - Plastic, Hard Blue - - 21 - Plastic, Light Blue - - 22 - Plastic, Hard Red - - 31 - Gold - - 32 - Brass - - 33 - Silver - - 34 - Plastic, Black - - 35 - Plastic, Ivory - - 36 - Plastic, Blue - - 37 - Plastic, Red - - 38 - Plastic, Yellow - - 39 - Plastic, Green - - 40 - Plastic, Brown - - n1, n2, ninc - Apply texture to Lab items numbered N1 through N2 in steps of NINC - (defaults to 1). If Lab = CM, then N1 is used to for the component - name and N2 and NINC are ignored. If Lab = ELEM, AREA, or VOLU and - N1 = blank or ALL, then the specified texture will be applied to - all entities of type Lab. If N1 = P, then graphical picking is - enabled. - - Notes - ----- - This command is available for 3-D Open GL devices. 2-D devices are - supported only for the Lab = File variation of the command, allowing - imported bitmaps to be used for texturing and annotation. Textures can - affect the speed of many of your display operations. You can increase - the speed by temporarily turning the textures off (Utility Menu> - PlotCtrls> Style> Texturing(3D)> Display Texturing). This menu - selection toggles your textures on and off. When textures are toggled - off, all of the texture information is retained and reapplied when - texturing is toggled back on. - - For some displays, the texture will appear distorted because of a - technique used to enhance 3-D displays (/DV3D,TRIS,1). Disabling this - function (/DV3D,TRIS,0) will improve the quality of some texture - displays. Disabling the TRIS option of the /DV3D command will slow down - 3-D displays significantly. Be sure to reapply the TRIS option after - you obtain a satisfactory output. - - Specifying /TXTRE,DEFA removes all texturing. - """ - command = f"/TXTRE,{lab},{num},{n1},{n2},{ninc}" - return self.run(command, **kwargs) - - def vscale(self, wn="", vratio="", key="", **kwargs): - """Scales the length of displayed vectors. - - APDL Command: /VSCALE - - Parameters - ---------- - wn - Window number (or ALL) to which command applies (defaults to 1). - - vratio - Ratio value applied to the automatically calculated scale factor - (defaults to 1.0, i.e., use scale factor as automatically - calculated). - - key - Relative scaling key: - - 0 - Use relative length scaling among vectors based on magnitudes. - - 1 - Use uniform length scaling for all vector lengths. - - Notes - ----- - Allows scaling of the vector length displayed with the PLVECT command - of POST1 and the /PBC and /PSF commands. Also allows the scaling of - the element (i.e., /PSYMB,ESYS) and the nodal (i.e., /PSYMB,NDIR) - coordinate system symbols. - - This command is valid in any processor. - """ - command = f"/VSCALE,{wn},{vratio},{key}" - return self.run(command, **kwargs) diff --git a/src/ansys/mapdl/core/_commands/graphics_/setup.py b/src/ansys/mapdl/core/_commands/graphics_/setup.py deleted file mode 100644 index acc229a52f0..00000000000 --- a/src/ansys/mapdl/core/_commands/graphics_/setup.py +++ /dev/null @@ -1,1313 +0,0 @@ -# Copyright (C) 2016 - 2025 ANSYS, Inc. and/or its affiliates. -# SPDX-License-Identifier: MIT -# -# -# Permission is hereby granted, free of charge, to any person obtaining a copy -# of this software and associated documentation files (the "Software"), to deal -# in the Software without restriction, including without limitation the rights -# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -# copies of the Software, and to permit persons to whom the Software is -# furnished to do so, subject to the following conditions: -# -# The above copyright notice and this permission notice shall be included in all -# copies or substantial portions of the Software. -# -# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -# SOFTWARE. - - -class Setup: - def color(self, lab="", clab="", n1="", n2="", ninc="", **kwargs): - """Specifies the color mapping for various items. - - APDL Command: /COLOR - - Parameters - ---------- - lab - Apply color to the items specified by the following labels: - - AXES - Determines the color (specified in next argument, Clab) that the axes of a - graph will be plotted in. - - AXNUM - Determines the color (specified in next argument, Clab) that the numbering on - the axes of a graph will be plotted in. - - NUM - Discretely numbered items (such as element types, element materials, etc., as - shown on the /PNUM command). Also specify number (1 to 11) - in the N1 field. For example, /COLOR,NUM,RED,3 will assign - the color red to all items having the discrete number 3 - (material displays would show elements having material 3 as - red). - - OUTL - Outline of elements, areas, and volumes. Ex: /COLOR,OUTL,BLUE. - - ELEM - Elements. Use N1, N2, NINC fields for element numbers. - - LINE - Solid model lines. Use N1, N2, NINC fields for line numbers. - - AREA - Solid model areas. Use N1, N2, NINC fields for area numbers. - - VOLU - Solid model volumes. Use N1, N2, NINC fields for volume numbers. - - ISURF - Isosurfaces (surfaces of constant stress, etc.). This option is particularly - useful when capturing frames for animating a single - isosurface value. - - WBAK - Window background. Use N1, N2, NINC fields for window numbers. The options - that you select using Lab = PBAK will supersede those - applied using Lab = WBAK. - - b.c.label - Boundary condition label. Enter U, ROT, TEMP, PRES, V, VOLT, MAG, A, EMF, - CURR, F, M, HEAT, FLOW, VF, AMPS, FLUX, CSG, CURT, - VLTG, MAST, CP, CE, NFOR, NMOM, RFOR, RMOM, PATH. See - the /PBC command for boundary condition label - definitions. - - GRBAK - Graph background. - - GRID - Graph grid lines. - - AXLAB - Graph X and Y axis labels. - - CURVE - Graph curves (identify curve numbers (1-10) in N1, N2, NINC fields). - - CM - Component group. Use N1 field for component name, ignore N2 and NINC. - - CNTR - ANSYS contour stress colors. The maximum number of contours available is 128. - The number of colors that can be specified interactively - (GUI) is 9. (/CONTOUR, , 9). Any other setting will yield - inconsistent results. - - SMAX - Specifies that all stress values above the maximum value entered in /CONTOUR - will be displayed in the color designated in the Clab field. - Defaults to dark grey. - - SMIN - Specifies that all stress values below the minimum value entered in /CONTOUR - will be displayed in the color designated in the Clab field. - Defaults to dark grey. - - PBAK - Activates background shading options (see command syntax at end of argument - descriptions below). The options that you select using Lab = - PBAK will supersede those applied using Lab = WBAK. - - clab - Valid color labels are: - - BLAC (0) - Black - - MRED (1) - Magenta-Red - - MAGE (2) - Magenta - - BMAG (3) - Blue-Magenta - - BLUE (4) - Blue - - CBLU (5) - Cyan-Blue - - CYAN (6) - Cyan - - GCYA ((7) - Green-Cyan - - GREE (8) - Green - - YGRE (9) - Yellow-Green - - YELL (10) - Yellow - - ORAN (11) - Orange - - RED (12) - Red - - DGRA (13) - Dark Gray - - LGRA (14) - Light Gray - - WHIT (15) - White - - n1, n2, ninc - Apply color to Lab items numbered N1 to N2 (defaults to N1) in - steps of NINC (defaults to 1). If N1 is blank, apply color to - entire selected range. If Lab is CM, use component name for N1 and - ignore N2 and NINC. If N1 = P, graphical picking of elements, - lines, areas and volumes is enabled; your can assign colors to the - entities via the picker. When picking is enabled, the Lab and Clab - fields are ignored. - """ - command = f"/COLOR,{lab},{clab},{n1},{n2},{ninc}" - return self.run(command, **kwargs) - - def device(self, label="", key="", **kwargs): - """Controls graphics device options. - - APDL Command: /DEVICE - - Parameters - ---------- - label - Device function label: - - BBOX - Bounding box mode. For PowerGraphics plots involving elements with /SHOW,x11 - and /SHOW,win32, ANSYS generally displays dynamic rotations - faster. If KEY = 1 (ON), then a bounding box (not the - elements) encompassing the model is displayed and rotated, - rather than the element outlines (ON is default in - preprocessing). When KEY = 0 (OFF), then dynamic rotations - may be slower (ANSYS redraws the element outlines) for plots - involving elements with /SHOW,x11 and /SHOW,win32. OFF is - default in postprocessing. This command is ignored if - /EDGE,WN,1 is set for any WN. This is ignored in POST1 and - SOLUTION plots. - - For any PowerGraphics plots involving elements, regardless of /SHOW settings, plots will generally be displayed faster. - VECTOR - - Vector mode. In vector mode, areas, volumes, elements, and postprocessing display geometries are shown as outlines (wireframes). When vector mode is off (default), these entities are shown filled with color. - DITHER - - When dithering is turned on (default), color intensity transitions are smoothed. This selection a - applies only to smooth-shaded images, i.e., Z-buffered [/TYPE], or raster plots - with Gouraud or Phong shading [/SHADE]. - - ANIM - Select the animation type used on 2-D devices on the PC platform. A KEY value - of BMP (or 0) sets animation mode to ANSYS Animation - Controller (default). A KEY value of AVI (or 2) sets - animation mode to AVI movie player file. - - FONT - Font selection for the ANSYS graphics window. When Label = FONT, the command - format is: /DEVICE,FONT,KEY,Val1,Val2,Val3,Val4,Val5,Val6 - where KEY determines the type of font being controlled, and - values 1 through 6 control various font parameters. Note - that these values are device specific; using the same - command input file [/INPUT] on different machines may yield - different results.. The following KEY values determine the - font information that will be supplied to the appropriate - driver (e.g., Postscript, X11, Win32, JPEG, ...): - - KEY = 1 - The command controls the LEGEND (documentation column) font. - - KEY = 2 - The command controls the ENTITY (node and keypoint number) font. - - KEY = 3 - The command controls the ANNOTATION/GRAPH font. - - Linux: Values 1 through 4 are used to find a match in the X11 database of font strings. Values 1, 2, and 3 are character strings; value 4 is a nonzero integer: - Val1 - - Family name (e.g., Courier). If Val1 = MENU, all other values are ignored and a font selection menu appears (GUI must be active). - Val2 - - Weight (e.g., medium) - Val3 - - Slant (e.g., r) - Val4 - - Pixel size (e.g., 14). Note that this value does no affect the annotation fonts (KEY = 3). Use the /TSPEC command for annotation font size. - Val5 - - Val1 - Family name (e.g., ``Courier*New``) Substitute an - asterisk (``*``) for any blank character that - appears in a family name. If Val1 = MENU, all other - values are ignored and a font selection menu - appears (GUI must be active). When this value is - blank ANSYS uses the first available resource it - finds. - - Val2 - Weight (0 - 1000) - - Val3 - Orientation (in tenths of a degree) - - Val4 - Height (in logical units) - - Val5 - Width (in logical units) - - Val6 - Italics (0 = OFF, 1 = ON) - - TEXT - Text size specification for the ANSYS Graphics window. Using this label with - the /DEVICE command requires the following form: - /DEVICE,TEXT,KEY,PERCENT. KEY = 1 for LEGEND fonts; KEY = 2 - for ENTITY fonts. PERCENT specifies the new text size as a - percent of the default text size. If PERCENT = 100, the new - text size is precisely the default size. If PERCENT = 200, - the new text size is twice the default text size. - - key - Control key: - - OFF or 0 - Turns specified function off. - - ON or 1 - Turns specified function on or designates the LEGEND font. - - 2 - Designates the ENTITY font. - - 3 - Designates the ANNOTATION/GRAPH font. - - Notes - ----- - This command is valid in any processor. - - The /DEVICE,BBOX command is ignored in POST1 and SOLUTION plots. Also, - the elements are displayed and rotated if you use /DEVICE,BBOX,ON and - /EDGE,WN,1,ANGLE (effectively ignoring the BBOX option). - """ - command = f"/DEVICE,{label},{key}" - return self.run(command, **kwargs) - - def dsys(self, kcn="", **kwargs): - """Activates a display coordinate system for geometry listings and plots. - - APDL Command: DSYS - - Parameters - ---------- - kcn - Coordinate system reference number. KCN may be 0,1,2 or any - previously defined local coordinate system number. - - Notes - ----- - Boundary condition symbols, vector arrows, and element coordinate - system triads are not transformed to the display coordinate system. The - display system orientation (for the default view) is X horizontal to - the right, Y vertical upward, and Z out of the screen (normal). - - Line directions and area directions (/PSYMB,LDIR and /PSYMB,ADIR) are - not plotted for DSYS > 0. - - When you create ANSYS 3-D annotation, the coordinates are stored to the - database in the DSYS that was active at the time of creation. Changing - the DSYS does not change the annotation coordinate data in the - database. - - This command is valid in any processor. - """ - command = f"DSYS,{kcn}" - return self.run(command, **kwargs) - - def dv3d(self, lab="", key="", **kwargs): - """Sets 3-D device option modes. - - APDL Command: /DV3D - - Parameters - ---------- - lab - Mode label: - - ACCU - Allows ANSYS to use the accumulation buffer for OpenGL graphics. Activating - this feature will provide faster model rotation when shaded - backgrounds are in use. This feature is off by default. - - ACTR - Label term to designate the cursor position as the center for automatic dynamic - rotational center capability. The subsequent Key value (see - below) turns this capability on and off. This feature is on - by default. (Available for OpenGL displays only) - - ANIM - Animation mode. The ANIM option allows you to create animation frames in - pixmap mode instead of display list mode. This may improve - large model performance, but it eliminates local - manipulation while animation is in progress. This feature is - on by default. - - ANTI - Label term to control Anti-aliasing, a smoothing technique for your graph - plots. (see below) The subsequent Key value turns this - capability on and off. The default for this feature is off. - (Available for OpenGL displays only). - - CNTR - Switches banded contours on (1) or off (0) for your 3–D contour display. The - default is 1 (ON). Other contour parameters such as number - of contours or the increment and range are defined using the - /CONTOUR command. When either 9 or 128 contours are - specified via /CONTOUR, this command is ignored and a smooth - contour is always displayed. - - DGEN - Local manipulation degenerate mode. You access the DGEN option to set wire- - frame local manipulation mode for 3-D devices (device - dependent). This feature is off by default. - - DLIST - With DLIST, you can specify whether screen updates and redraws will be - performed using the ANSYS Display List (off), or the 3-D - device's Display List (on). DLIST is on by default for - Windows systems, but off for Linux. - - DELS - You use DELS to suppress contour display screen overwrites when /NOERASE is - active. This prevents the bleed-through that occurs when you - overlay contour plots. - - TRIS - Triangle strip mode. Tri-stripping provides faster 3-D display capabilities and - is on by default. Some display enhancements, such as - texturing, are adversely affected by tri-stripping. You can - turn off tri-stripping in order to improve these display - functions. Be sure to turn tri-stripping on after the - desired output is obtained. - - key - The following key options apply to Lab = ACCU: - - 0 - (OFF) The accumulation buffer is not accessed. (default) - - 1 - (ON) Access to the buffer is enabled. - - Notes - ----- - ANSYS uses display list animation for its 3-D models. This memory - resident array method interfaces with the OpenGL model information to - allow the program to efficiently pan, zoom, rotate and dynamically - manipulate your model during animation. The logo, legend, contour and - other annotation items are produced in 2-D and will not appear when - /DV3D, ANIM, 0 is in effect. To display these items, use /DV3D, ANIM, - 1. All screen data will be displayed, but manipulation of the model - will not be possible. - """ - command = f"/DV3D,{lab},{key}" - return self.run(command, **kwargs) - - def gcmd( - self, - wn="", - lab1="", - lab2="", - lab3="", - lab4="", - lab5="", - lab6="", - lab7="", - lab8="", - lab9="", - lab10="", - lab11="", - lab12="", - **kwargs, - ): - """Controls the type of element or graph display used for the GPLOT - - APDL Command: /GCMD - command. - - Parameters - ---------- - wn - Window number (or ALL) to which this command applies (defaults to - 1) - - lab1, lab2, lab3, . . . , lab12 - Command labels (for example, PLNSOL,S,X) - - Notes - ----- - This command controls the type of element or graph display that appears - when you issue the GPLOT command when the /GTYPE,,(ELEM or GRPH) entity - type is active. If you have multiple plotting windows enabled, you can - also use /GCMD to select one window when you wish to edit its contents. - - For related information, see the descriptions of the GPLOT and /GTYPE - commands in this manual. - - This command is valid in any processor. - """ - command = f"/GCMD,{wn},{lab1},{lab2},{lab3},{lab4},{lab5},{lab6},{lab7},{lab8},{lab9},{lab10},{lab11},{lab12}" - return self.run(command, **kwargs) - - def gcolumn(self, curve="", string="", **kwargs): - """Allows the user to apply a label to a specified curve. - - APDL Command: /GCOLUMN - - Parameters - ---------- - curve - Curve number on which label will be applied (integer value - between 1 and 10). - - string - Name or designation that will be applied to the curve (8 - characters max). - - Notes - ----- - This command is used for an array parameter plot (a plot created by the - ``*VPLOT`` command). Normally the label for curve 1 is "COL 1", the label - for curve 2 is "COL 2" and so on; the column number is the field - containing the dependent variables for that particular curve. Issuing - /GCOLUMN,CURVE, with no string value specified resets the label to the - original value. - """ - command = f"/GCOLUMN,{curve},{string}" - return self.run(command, **kwargs) - - def gfile(self, size="", **kwargs): - """Specifies the pixel resolution on Z-buffered graphics files. - - APDL Command: /GFILE - - Parameters - ---------- - size - Pixel resolution. Defaults to a pixel resolution of 800. Valid - values are from 256 to 2400. - - Notes - ----- - Defines the pixel resolution on subsequently written graphics files - (Jobname.GRPH) for software Z-buffered displays [/TYPE]. Lowering the - pixel resolution produces a "fuzzier" image; increasing the resolution - produces a "sharper" image but takes a little longer. - - This command is valid in any processor. - """ - command = f"/GFILE,{size}" - return self.run(command, **kwargs) - - def gplot(self, **kwargs): - """Controls general plotting. - - APDL Command: GPLOT - - Notes - ----- - This command displays all entity types as specified via the /GTYPE - command. Only selected entities (NSEL, ESEL, KSEL, LSEL, ASEL, VSEL) - will be displayed. See the descriptions of the /GTYPE and /GCMD - commands for methods of setting the entity types displayed. - - This command is valid in any processor. - """ - command = f"GPLOT," - return self.run(command, **kwargs) - - def graphics(self, key="", **kwargs): - """Defines the type of graphics display. - - APDL Command: /GRAPHICS - - Parameters - ---------- - key - Graphics key: - - FULL - Display all model geometry and results. - - POWER - Activate PowerGraphics (default when GUI is on). - - Notes - ----- - The /GRAPHICS command specifies the type of graphics display. Key = - POWER activates the PowerGraphics capability. PowerGraphics offers - faster plotting than the Key = FULL option, and speeds up element, - results, area, line, and volume displays. PowerGraphics mode (the - default) is automatically invoked when the GUI is accessed. This action - supersedes all prior macros or start up routines (start.ans, - config.ans, etc.). Full graphics mode can be accessed only by issuing - /GRAPHICS, FULL after the GUI is active. - - Results values (both printed and plotted) may differ between the Key = - FULL and Key = POWER options because each option specifies a different - set of data for averaging and display. For Key = FULL, all element and - results values (interior and surface) are included. For Key = POWER, - only element and results values along the model exterior surface are - processed. - - Caution:: : If you have specified one facet per element edge for - PowerGraphics displays (via the /EFACET command or via choices from the - General Postproc or Utility Menus), PowerGraphics does not plot midside - nodes. - - The /EFACET command is only applicable to element type displays. (See - the descriptions of these commands for more information.) - - Maximum values shown in plots can differ from printed maximum values. - This is due to different averaging schemes used for plotted and printed - maximum values. - - PowerGraphics displays do not average at geometric discontinuities. The - printouts in PowerGraphics will, however, provide averaging information - at geometric discontinuities if the models do not contain shell - elements. Carefully inspect the data you obtain at geometric - discontinuities. - - PowerGraphics does not support the following diffusion analysis - results: CONC, CG, DF, EPDI. - - Note:: : In Full Graphics mode, it is possible to deselect an - individual node, select all elements (including the element that - contains that node), and then perform postprocessing calculations on - those elements and have that unselected node not be considered in those - calculations. However, if PowerGraphics is active, postprocessing - always displays based on selected elements. - - PowerGraphics does not support membrane shell elements such as SHELL41, - and these elements using the membrane-stiffness-only option (KEYOPT1) = - 1): SHELL181, SHELL208, and SHELL209. - - Commands that are not supported by PowerGraphics are listed below. - These commands are executed using the Key = FULL option, regardless of - whether PowerGraphics is activated. Only certain options for /CTYPE, - /edge, /ESHAPE, ``*GET``, /PNUM, /PSYMB, SHELL, and ``*VGET`` are not supported - by PowerGraphics. (See the descriptions of these commands for more - information.) - """ - command = f"/GRAPHICS,{key}" - return self.run(command, **kwargs) - - def gresume(self, fname="", ext="", **kwargs): - """Sets graphics settings to the settings on a file. - - APDL Command: /GRESUME - - 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. - - ext - Filename extension (eight-character maximum). - - Notes - ----- - Causes a file to be read to reset the graphics slash (/) commands as - they were at the last /GSAVE command. - - This command is valid in any processor. - """ - command = f"/GRESUME,{fname},{ext}" - return self.run(command, **kwargs) - - def gsave(self, fname="", ext="", **kwargs): - """Saves graphics settings to a file for later use. - - APDL Command: /GSAVE - - 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. - - ext - Filename extension (eight-character maximum). - - Notes - ----- - This command does not save all graphics settings, but only those that - may be reset by the /RESET command. The database remains untouched. - Use the /GRESUME command to read the file. Repeated use of the /GSAVE - command overwrites the previous data on the file. The following - commands are saved by /GSAVE: - - This command is valid in any processor. - """ - command = f"/GSAVE,{fname},{ext}" - return self.run(command, **kwargs) - - def gtype(self, wn="", label="", key="", **kwargs): - """Controls the entities that the GPLOT command displays. - - APDL Command: /GTYPE - - Parameters - ---------- - wn - Window number (or ALL) to which this command applies (defaults to - 1) - - label - This represents the type of entity to display: - - NODE - Nodes - - ELEM - Elements - - KEYP - Keypoints - - LINE - Lines - - AREA - Areas - - VOLU - Volumes - - GRPH - Graph displays - - key - Switch: - - 0 - Turns the entity type off. - - 1 - Turns the entity type on. - - Notes - ----- - The /GTYPE command controls which entities the GPLOT command displays. - NODE, ELEM, KEYP, LINE, AREA, and VOLU are on by default. When ELEM is - activated, you can control the type of element displayed via the /GCMD - command (which also controls the type of graph display). When the GRPH - entity type is activated, all other entity types are deactivated. - Conversely, when any of the NODE, ELEM, KEYP, LINE, AREA, and VOLU - entity types are active, the GRPH entity type is deactivated. - - The /GTYPE command gives you several options for multi-window layout: - - One window - - Two windows (left and right or top and bottom of the screen) - - Three windows (two at the top and one at the bottom of the screen, or - one top and two bottom windows - - Four windows (two at the top and two at the bottom) - - - - Once you choose a window layout, you can choose one of the following: - multiple plots, replotting, or no redisplay. - - This command is valid in any processor. - """ - command = f"/GTYPE,{wn},{label},{key}" - return self.run(command, **kwargs) - - def image(self, label="", fname="", ext="", **kwargs): - """Allows graphics data to be captured and saved. - - APDL Command: /IMAGE - - Parameters - ---------- - label - Label specifying the operation to be performed: - - CAPTURE - Capture the image from the graphics window to a new window. - - RESTORE - Restore the image from a file to a new window. - - SAVE - Save the contents of the graphic window to a file. - - DELETE - Delete the window that contains the file. - - 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. - - ext - Filename extension (eight-character maximum). - """ - command = f"/IMAGE,{label},{fname},{ext}" - return self.run(command, **kwargs) - - def jpeg(self, kywrd="", opt="", **kwargs): - """Provides JPEG file export for ANSYS displays. - - APDL Command: JPEG - - Parameters - ---------- - kywrd - Specifies various JPEG file export options. - - QUAL - If Kywrd = QUAL, then OPT is an integer value defining the JPEG quality index - on an arbitrary scale ranging from 1 to 100. The default - value is 75. - - ORIENT - If Kywrd = ORIENT, then OPT will determine the orientation of the entire plot. - OPT can be either Horizontal (default) or Vertical. - - COLOR - If Kywrd = COLOR, then OPT will determine the color depth of the saved file. - OPT can be 0, 1, or 2, corresponding to Black and White, - Grayscale, and Color (default), respectively. - - TMOD - If Kywrd = TMOD, then OPT will determine the text method. OPT can be either 1 - or 0, corresponding to bitmap text (default) or line stroke - text, respectively. - - DEFAULT - If Kywrd = DEFAULT, then all of the default values, for all of the Kywrd - parameters listed above, are active. - - opt - OPT can have the following names or values, depending on the value - for Kywrd (see above). - - 1 to 100 - If Kywrd = QUAL, a value between 1 and 100 will determine the quality index of - the JPEG file. - - Horizontal, Vertical - If Kywrd = ORIENT, the terms Horizontal or Vertical determine the orientation - of the plot. - - 0,1,2 - If Kywrd = COLOR, the numbers 0, 1, and 2 correspond to Black and White, - Grayscale and Color, respectively. - - 1,0 - If Kywrd = TMOD, the values 1 and 0 determine whether bitmap (1) or stroke text - (0) fonts will be used - """ - command = f"JPEG,{kywrd},{opt}" - return self.run(command, **kwargs) - - def mrep( - self, - name="", - arg1="", - arg2="", - arg3="", - arg4="", - arg5="", - arg6="", - arg7="", - arg8="", - arg9="", - arg10="", - arg11="", - arg12="", - arg13="", - arg14="", - arg15="", - arg16="", - arg17="", - arg18="", - **kwargs, - ): - """Enables you to reissue the graphics command macro "name" during a - - APDL Command: /MREP - replot or zoom operation. - - Parameters - ---------- - name - The name identifying the macro file or macro block on a macro - library file. The name can contain up to eight characters maximum - and must begin with a letter. - - arg1, arg2, arg3, . . . , arg18 - Values to be passed into the file or block. - - Notes - ----- - This command reissues the graphics command macro "name" during a replot - operation [/REPLOT] or a zoom [/ZOOM] operation. The ANSYS program - passes the command macro arguments to the replot and zoom feature for - use by the graphics macro. You should place the s-MREP command at the - end of the graphics command macro, following the last graphics command - within the macro, to enable the replot or zoom feature. - """ - command = f"/MREP,{name},{arg1},{arg2},{arg3},{arg4},{arg5},{arg6},{arg7},{arg8},{arg9},{arg10},{arg11},{arg12},{arg13},{arg14},{arg15},{arg16},{arg17},{arg18}" - return self.run(command, **kwargs) - - def pcopy(self, key="", **kwargs): - """Automatically generates hard copies for HP UNIX work stations. - - APDL Command: /PCOPY - - Parameters - ---------- - key - Copy key: - - 0 - No specification setting for automatic hard copy of display. - - 1 - Set specification for automatic hard copy after each display. - - NOW - (Action) Produce hard copy of current display (KEY is not reset to 1). - - Notes - ----- - Sets automatic hard copy specification. This command is available only - on HP work stations, and only during interactive runs with the /SHOW - specification active (for terminals with hard copy capability). - - This command is valid in any processor. - """ - command = f"/PCOPY,{key}" - return self.run(command, **kwargs) - - def pngr(self, kywrd="", opt="", val="", **kwargs): - """Provides PNG file export for ANSYS displays. - - APDL Command: PNGR - - Parameters - ---------- - kywrd - Specifies various PNG file export options. - - COMP - If Kywrd = COMP, then OPT is either ON or OFF (blank is interpreted as OFF). - This option allows you to turn PNG file compression ON or - OFF. If OPT = ON, then The VAL field is read to determine - the degree of compression. See the VALUE argument for - acceptable compression values. - - ORIENT - If Kywrd = ORIENT, then OPT will determine the orientation of the entire plot. - OPT can be either Horizontal (default) or Vertical. - - COLOR - If Kywrd = COLOR, then OPT will determine the color depth of the saved file. - OPT can be 0, 1, or 2, corresponding to Black and White, - Grayscale, and Color (default), respectively. - - TMOD - If Kywrd = TMOD, then OPT will determine the text method. OPT can be either 1 - or 0, corresponding to bitmap text (default) or line stroke - text, respectively. - - DEFAULT - If Kywrd = DEFAULT, then all of the default values, for all of the Kywrd - parameters listed above, are active. - - STAT - Shows the current status of PNG file export. - - opt - OPT can have the following names or values, depending on the value - for Kywrd (see above). - - ON, OFF - If Kywrd = COMP, the values On and Off control the use of compression. The - degree of compression is determined by VAL - - Horizontal, Vertical - If Kywrd = ORIENT, the terms Horizontal or Vertical determine the orientation - of the plot. - - 0, 1, 2 - If Kywrd = COLOR, the numbers 0, 1, and 2 correspond to Black and White, - Grayscale and Color, respectively. - - 1, 0 - If Kywrd = TMOD, the values 1 and 0 determine whether bitmap (1) or stroke text - (0) fonts will be used - - val - VAL is active only when Kywrd = COMP, and determines the degree of - compression applied to the exported file (see above). - - 1 - Apply the default, optimum value for compression. This value represents the - best combination of speed and compression. It varies according - to the release level of the ZLIB compression package. - - 1-9 - Use this value to specify a specific compression level. 1 is the lowest - compression level (fastest) and 9 is the highest compression - level (slowest). - """ - command = f"PNGR,{kywrd},{opt},{val}" - return self.run(command, **kwargs) - - def pscr(self, kywrd="", key="", **kwargs): - """Specifies various PostScript options. - - APDL Command: PSCR - - Parameters - ---------- - index - Color map index (0 to 15, 128 to 255). - - ired - Red intensity (0 to 100). - - igrn - Green intensity (0 to 100). - - iblu - Blue intensity (0 to 100). - - Notes - ----- - This command is available in both the ANSYS and DISPLAY programs. It - is valid for postscript format files chosen in ANSYS with the - /SHOW,PSCR command, or in DISPLAY with /SHOWDISP,POSTSCRIPT. - - An output file is generated for each plot. The ANSYS file is named - JobnameNN.pscr. In the DISPLAY program, this file is named PSCRnn. - This file remains open for a subsequent /NOERASE plot, and will be - incomplete until the program is closed (/EXIT), or until the next file - is opened by the next /ERASE plot request. - - Issuing PSCR,STAT will list paper size, orientation and resolution - modes. - """ - command = f"PSCR,{kywrd},{key}" - return self.run(command, **kwargs) - - def pstatus(self, wn="", **kwargs): - """Displays the global or window display specifications. - - APDL Command: /PSTATUS - - Parameters - ---------- - wn - Window number for status (defaults to global specifications). - - Notes - ----- - Displays the current global or window display specifications. Global - display specifications are common to all windows (e.g. /SHOW, etc.). - Window display specifications are specific to one window (e.g. /VIEW, - /TYPE, etc.). - - This command is valid in any processor. - """ - command = f"/PSTATUS,{wn}" - return self.run(command, **kwargs) - - def replot(self, label="", **kwargs): - """Automatically reissues the last display command for convenience. - - APDL Command: /REPLOT - - Parameters - ---------- - label - Controls the type of replot. - - RESIZE - Issued internally when a graphics window resize occurs (Default). - - FAST - Only applicable for 3-D devices that allow a fast redisplay for changes in the - view characteristics only. - - Notes - ----- - Reissues the last display command (NPLOT, EPLOT, KPLOT, PLNSOL, PLVAR, - etc.), along with its parameters, for convenience. The current display - specifications are used. - - When the last display command is invalid in a particular processor, the - use of the /REPLOT command is also invalid in that processor. However, - if you attempt a /REPLOT and the last display command is invalid in the - current processor, ANSYS produces an element display [EPLOT] instead, - as long as the last display command was PLNSOL, PLESOL, or PLDISP. - ANSYS performs this substitution of /REPLOT with EPLOT for your - convenience. - - For example, the PLNSOL command, which is used to display solution - results as continuous contours, is a valid command in the general - postprocessor [/POST1]. If you issue PLNSOL followed by /REPLOT while - in the general postprocessor, the /REPLOT command effectively reissues - your earlier PLNSOL command, along with its parameters. But if you - then exit the general postprocessor, enter the preprocessor [/PREP7], - and issue the /REPLOT command again, ANSYS internally issues EPLOT - instead. This occurs because PLNSOL is not a valid command in the - preprocessor. - - When you click on one of the buttons on the Pan, Zoom, Rotate dialog - box to manipulate the view of a model, the /REPLOT command is issued - internally. Thus, the substitution of /REPLOT with EPLOT as described - above may occur not only for the PLNSOL, PLESOL, and PLDISP results - display commands, but also for operations that you perform with the - Pan, Zoom, Rotate dialog box. - - /REPLOT will not show boundary conditions if they are only applied to a - solid model and the last display command (for example, EPLOT) displays - the finite element model. To show boundary conditions, the following - options are available: - - Issue /REPLOT after you issue the SBCTRAN command to transfer solid - model boundary conditions to the finite element model. - - Issue /REPLOT after you issue a solid model display command (for - example, VPLOT). - - This command is valid in any processor (except as noted above). - """ - command = f"/REPLOT,{label}" - return self.run(command, **kwargs) - - def slashreset(self, **kwargs): - """Resets display specifications to their initial defaults. - - APDL Command: /RESET - - Notes - ----- - Resets slash display specifications (/WINDOW, /TYPE, /VIEW, etc.) back - to their initial default settings (for convenience). Also resets the - focus location to the geometric center of the object. - - This command is valid in any processor. - """ - command = "/RESET," - return self.run(command, **kwargs) - - def seg(self, label="", aviname="", delay="", **kwargs): - """Allows graphics data to be stored in the local terminal memory. - - APDL Command: /SEG - - Parameters - ---------- - label - Storage key: - - SINGL - Store subsequent display in a single segment (overwrites last storage). - - MULTI - Store subsequent displays in unique segments [ANIM]. - - DELET - Delete all currently stored segments. - - OFF - Stop storing display data in segments. - - STAT - Display segment status. - - PC - This option only applies to PC versions of ANSYS and only when animating via - the AVI movie player (i.e., /DEVICE,ANIM,2). This command - appends frames to the File.AVI, so that the animation goes in - both directions (i.e., forward--backward--forward). You must - have a current animation file to use this option. - - aviname - Name of the animation file that will be created when each frame is - saved. The .AVI extension is applied automatically. Defaults to - Jobname.AVI if no filename is specified. - - delay - Delay factor between each frame, in seconds. Defaults to 0.015 - seconds if no value is specified. - - Notes - ----- - Allows graphics data to be stored in the terminal local memory (device- - dependent). Storage occurs concurrently with the display. - - Although the information from your graphics window is stored as an - individual segment, you cannot plot directly (GPLOT) from the segment - memory. - - For the DISPLAY program, the Aviname and DELAY fields are ignored. - - This command is valid in any processor. - """ - command = f"/SEG,{label},{aviname},{delay}" - return self.run(command, **kwargs) - - def show(self, fname="", option="", vect="", ncpl="", **kwargs): - """Specifies the device and other parameters for graphics displays. - - APDL Command: /SHOW - - Parameters - ---------- - fname - Device name, file name, or keyword, as listed below: - - - Any valid graphics display device name (e.g., X11, 3-D etc.). Defaults to X11 - for most systems. See Getting Started with - Graphics in the Basic Analysis Guide for details. - A device name must be defined before activating the - Graphical User Interface (GUI). Once the GUI is - activated, the device name cannot be changed for - that session, except for switching between X11 and - X11C. - - - Name of graphics file to which graphics displays are to be diverted (248 - characters maximum). Should not be the same as a - valid device name or any other Fname option. Plots are - written to the file Filename.Ext (or just Filename.Ext - if Ext is left blank) in the working directory. This - file can be appended only during the same session; - reissuing the same file name in a new session will - overwrite existing file names from previous sessions. - Although multiple file names can be used within one - session, only the last file created or accessed will - be appended. Issuing /SHOW, CLOSE, or starting a new - session will prevent access to any previously created - files. - - TERM - Graphics displays are switched back to the last-specified device name. - - CLOSE - This option purges the graphics file buffer. The CLOSE option should be issued - any time you are changing graphics devices or file output - types during a session. Graphics displays are switched back - to the last-specified device name, and any open graphics - files are closed. The CLOSE option is similar to the TERM - option, however, with the CLOSE option, another process, - such as the DISPLAY program, can access the data in the - graphics file. The CLOSE option causes graphics file - buffers to be flushed to the graphics file. - - FILE - Graphics displays are switched back to the last-specified file name. - - OFF - Graphics display requests are ignored. - - (blank) - If blank in interactive mode, graphics will be displayed on screen as requested - by display commands (no file written); If blank in batch - mode, graphics data will be written to Jobname.GRPH. - - PSCR - Creates PostScript graphic files that are named Jobnamennn.eps, where nnn is a - numeric value that is incremented by one as each additional - file is created; that is, Jobname000.eps, Jobname001.eps, - Jobname002.eps, and so on . (See the PSCR command for - options.) Ignores the Ext and NCPL fields. - - HPGL - Creates Hewlett-Packard Graphics Language files that are named Jobnamennn.hpgl, - where nnn is a numeric value that is incremented by one as - each additional file is created; that is, Jobname000.hpgl, - Jobname001.hpgl, Jobname002.hpgl, and so on. (See the HPGL - command for options.) Ignores the Ext and NCPL fields. - - HPGL2 - Creates Hewlett-Packard Graphics Language files that are named Jobnamennn.hpgl, - where nn is a numeric value that is incremented by one as - each additional file is created; that is, Jobname000.hpgl, - Jobname001.hpgl, Jobname02.hpgl, and so on. The HPGL2 - files have enhanced color. (See the HPGL command for - options.) Ignores the Ext field. - - JPEG - Creates JPEG files that are named Jobnamennn.jpg, where nnn is a numeric value - that is incremented by one as each additional file is - created; that is, Jobname000.jpg, Jobname001.jpg, - Jobname002.jpg, and so on. Ignores the Ext field. - - TIFF - Creates tagged image format files that are named Jobnamennn.tif, where nnn is a - numeric value that is incremented by one as each additional - file is created; that is, Jobname000.tif, Jobname001.tif, - Jobname002.tif, and so on. This value for the Fname argument - ignores the Ext field. (See the TIFF command for options.) - - PNG - Creates PNG (Portable Network Graphics) files that are named Jobnamennn.png, - where nnn is a numeric value that is incremented by one as - each additional file is created; that is, Jobname000.png, - Jobname001.png, Jobname002.png, and so on. This value for the - Fname argument ignores the Ext field. (See the PNGR command - for options.) - - VRML - Creates Virtual Reality Meta Language files named Jobname000.wrl that can be - displayed on 3-D Internet web browsers. Ignores the Ext and - NCPL fields. - - option - Assign a file name extension or specify reverse video output: - - Ext - File name extension (eight-character maximum). - - REV - Reverse background/image (black/white) colors. Valid with Fname = PNG - (recommended), JPEG, PSCR, TIFF, and HPGL. This option is - ignored if a previously specified color map table (/CMAP or - /RGB) is in effect. - - vect - Specifies raster or vector display mode. This affects area, - volume, and element displays, as well as geometric results displays - such as contour plots. See the /DEVICE command for an alternate - way to toggle between raster and vector mode. Changing VECT also - resets the /TYPE command to its default. - - 0 - Raster display (color filled entities; default) - - 1 - Vector display (outlined entities; i.e., "wireframe") - - ncpl - Sets the number of color planes (4 to 8). Default is device- - dependent. NCPL is not supported by all graphics devices. - - Notes - ----- - Specifies the device to be used for graphics displays, and specifies - other graphics display parameters. Display may be shown at the time of - generation (for interactive runs at a graphics display terminal) or - diverted to a file for later processing with the DISPLAY program. - Issue /PSTATUS for display status. - - Batch runs do not have access to the fonts available on your system. - The Courier and Helvetica font files used for JPEG, PNG and TIFF batch - output are copyrighted by Adobe Systems Inc. and Digital Equipment - Corp. Permission to use these trademarks is hereby granted only in - association with the images described above. Batch run JPEG output is - produced at the default quality index value of 75, unless specified - otherwise. - - Interactive displays default to eight color planes (NCPL = 8) for most - monitors, while graph file output defaults to eight color planes for - VRML output, and four color planes for PSCR, HPGL, HPGL2, JPEG, PNG, - TIFF and FILE33. - - This command is valid in any processor. - """ - command = f"/SHOW,{fname},{option},{vect},{ncpl}" - return self.run(command, **kwargs) - - def tiff(self, kywrd="", opt="", **kwargs): - """Provides TIFF file Export for ANSYS Displays. - - APDL Command: TIFF - - Parameters - ---------- - kywrd - Specifies various TIFF file export options. - - COMP - If Kywrd = COMP, then OPT controls data compression - for the output file. If COMP = 0, then compression - is off. If COMP = 1 (default), then compression is - on. - - ORIENT - If Kywrd = ORIENT, then OPT will determine the - orientation of the entire plot. OPT can be - either Horizontal (default) or Vertical. - - COLOR - If Kywrd = COLOR, then OPT will determine the - color attribute of the saved file. OPT can be 0, - 1, or 2, corresponding to Black and White, - Grayscale, and Color (default), respectively. - - TMOD - If Kywrd = TMOD, then OPT will determine the text - method. OPT can be either 1 or 0, corresponding to - bitmap text (default) or line stroke text, - respectively. - - DEFAULT - If Kywrd = DEFAULT, then all of the default - values, for all of the Kywrd parameters listed - above, are active. - - opt - OPT can have the following names or values, depending on - the value for Kywrd (see above). - - 1 or 0 - If Kywrd = COMP, a value or 1 (on) or 0 (off) - will control compression for the TIFF file. - - Horizontal, Vertical - If Kywrd = ORIENT, the terms - Horizontal or Vertical determine - the orientation of the plot. - - 0, 1, 2 - If Kywrd = COLOR, the numbers 0, 1, and 2 - correspond to Black and White , Grayscale and - Color, respectively. - - 1, 0 - If Kywrd = TMOD, the values 1 and 0 determine - whether bitmap (1) or stroke text (0) fonts will be - used - """ - command = f"TIFF,{kywrd},{opt}" - return self.run(command, **kwargs) - - def window(self, wn="", xmin="", xmax="", ymin="", ymax="", ncopy="", **kwargs): - """Defines the window size on the screen. - - APDL Command: /WINDOW - - Parameters - ---------- - wn - Window reference number (1 to 5). Defaults to 1. This number, or - ALL (for all active windows), may be used on other commands. - - xmin, xmax, ymin, ymax - Screen coordinates defining window size. Screen coordinates are - measured as -1.0 to 1.67 with the origin at the screen center. For - example, (-1,1.67,-1,1) is full screen, (-1,0,-1,0) is the left - bottom quadrant. If XMIN = OFF, deactivate this previously defined - window; if ON, reactivate this previously defined window. If FULL, - LEFT, RIGH, TOP, BOT, LTOP, LBOT, RTOP, RBOT, form full, half, or - quarter window. If SQUA, form largest square window within the - current graphics area. If DELE, delete this window (cannot be - reactivated with ON). - - ncopy - Copies the current specifications from window NCOPY (1 to 5) to - this window. If NCOPY = 0 (or blank), no specifications are - copied. - - Notes - ----- - Defines the window size on the screen. Windows may occupy a separate - section of the screen or they may overlap. Requested displays are - formed in all windows according to the selected window specifications. - - This command is valid in any processor. - """ - command = f"/WINDOW,{wn},{xmin},{xmax},{ymin},{ymax},{ncopy}" - return self.run(command, **kwargs) diff --git a/src/ansys/mapdl/core/_commands/graphics_/style.py b/src/ansys/mapdl/core/_commands/graphics_/style.py deleted file mode 100644 index d6a015f9726..00000000000 --- a/src/ansys/mapdl/core/_commands/graphics_/style.py +++ /dev/null @@ -1,729 +0,0 @@ -# Copyright (C) 2016 - 2025 ANSYS, Inc. and/or its affiliates. -# SPDX-License-Identifier: MIT -# -# -# Permission is hereby granted, free of charge, to any person obtaining a copy -# of this software and associated documentation files (the "Software"), to deal -# in the Software without restriction, including without limitation the rights -# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -# copies of the Software, and to permit persons to whom the Software is -# furnished to do so, subject to the following conditions: -# -# The above copyright notice and this permission notice shall be included in all -# copies or substantial portions of the Software. -# -# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -# SOFTWARE. - -from typing import Optional, Union -import warnings - -from ansys.mapdl.core.mapdl_types import MapdlInt - - -class Style: - def cplane(self, key="", **kwargs): - """Specifies the cutting plane for section and capped displays. - - APDL Command: /CPLANE - - Parameters - ---------- - key - Specifies the cutting plane: - - 0 - Cutting plane is normal to the viewing vector [/VIEW] and passes through the - focus point [/FOCUS] (default). - - 1 - The working plane [WPLANE] is the cutting plane. - - Notes - ----- - Defines the cutting plane to be used for section and capped displays - [/TYPE,,(1, 5, or 7)]. - - This command is valid in any processor. - """ - command = f"/CPLANE,{key}" - return self.run(command, **kwargs) - - def ctype(self, key="", dotd="", dots="", dshp="", tlen="", **kwargs): - """Specifies the type of contour display. - - APDL Command: /CTYPE - - Parameters - ---------- - key - Type of display: - - 0 - Standard contour display. - - 1 - Isosurface display. - - 2 - Particle gradient display. - - 3 - Gradient triad display. - - dotd - Maximum dot density for particle gradient display (KEY = 2). - Density is expressed as dots per screen width (defaults to 30). - - dots - Dot size for particle gradient display (KEY = 2). Size is - expressed as a fraction of the screen width (defaults to 0.0 - (single dot width)). - - dshp - Spherical dot shape precision for particle gradient display (KEY = - 2). (3-D options are supported only on 3-D devices): - - 0 - Flat 2-D circular dot. - - 1 - Flat-sided 3-D polyhedron. - - n - 3-D sphere with n (>1) polygon divisions per 90° of radius. - - tlen - Maximum length of triads for gradient triad display (KEY = 3). - Value is expressed as a fraction of the screen width (defaults to - 0.067). - - Notes - ----- - Use /CTYPE,STAT to display the current settings. Only the standard - contour display [/CTYPE,0) and the isosurface contour display - [/CTYPE,1] are supported by PowerGraphics [/GRAPHICS,POWER]. - - This command is valid in any processor. - """ - command = f"/CTYPE,{key},{dotd},{dots},{dshp},{tlen}" - return self.run(command, **kwargs) - - def edge(self, wn="", key="", angle="", **kwargs): - """Displays only the common lines ("edges") of an object. - - APDL Command: /EDGE - - Parameters - ---------- - wn - Window number (or ALL) to which command applies. The default window - is 1. - - key - Edge key: - - 0 - Display common lines between all adjacent element faces. - - 1 - Display only the common lines between non-coplanar faces (that is, show only - the edges). - - angle - Largest angle between two faces for which the faces are considered - to be coplanar (0° to 180°). Defaults to 45°. A smaller angle - produces more edges, a larger angle produces fewer edges. - - Notes - ----- - The ANGLE field is used in PowerGraphics to determine geometric - discontinuities. It is a tolerance measure for the differences between - the normals of the surfaces being considered. Values within the - tolerance are accepted as coplanar (geometrically continuous). In - postprocessing displays, results are not averaged across discontinuous - surfaces. - - A surface can be displayed as an edge outline without interior detail. - This is useful for both geometry and postprocessing displays. Element - outlines are normally shown as solid lines for geometry and - displacement displays. Lines common to adjacent "coplanar" element - faces are removed from the display. Midside nodes of elements are - ignored. - - The /SHRINK option is ignored with the edge option. - - /EDGE is not supported for PLESOL and /ESHAPE displays when in - PowerGraphics mode (/GRAPHICS,POWER). - - The /EDGE command is valid in any processor. - """ - command = f"/EDGE,{wn},{key},{angle}" - return self.run(command, **kwargs) - - def eshape( - self, scale: Union[str, int] = "", key: MapdlInt = "", **kwargs - ) -> Optional[str]: - """Displays elements with shapes determined from the real constants or section definition. - - APDL Command: /ESHAPE - - - Parameters - ---------- - scale - Scaling factor: - - * 0 - Use simple display of line and area elements. This - value is the default. - - * 1 - Use real constants or section definition to form a - solid shape display of the applicable elements. - - FAC - Multiply certain real constants, such as thickness, - by FAC (where FAC > 0.01) and use them to form a - solid shape display of elements. - - key - Current shell thickness key: - - * 0 - Use current thickness in the displaced solid shape - display of shell elements (valid for SHELL181, - SHELL208, SHELL209, and SHELL281). This value is the - default. - - * 1 - Use initial thickness in the displaced solid shape - display of shell elements. - - Notes - ----- - The /ESHAPE command allows beams, shells, current sources, and - certain special-purpose elements to be displayed as solids - with the shape determined from the real constants or section - types. Elements are displayed via the EPLOT command. No checks - for valid or complete input are made for the display. - - Following are details about using this command with various - element types: - - SOLID65 elements are displayed with internal lines that - represent rebar sizes and orientations (requires vector mode - [/DEVICE] with a basic type of display [/TYPE,,BASIC]). The - rebar with the largest volume ratio in each element plots as a - red line, the next largest as green, and the smallest as blue. - - COMBIN14, COMBIN39, and MASS21 are displayed with a graphics - icon, with the offset determined by the real constants and - KEYOPT settings. - - BEAM188, BEAM189, PIPE288, PIPE289 and ELBOW290 are displayed - as solids with the shape determined via the section-definition - commands (SECTYPE and SECDATA). The arbitrary section option - (Subtype = ASEC) has no definite shape and appears as a thin - rectangle to show orientation. The elements are displayed with - internal lines representing the cross- section mesh. - - SOLID272 and SOLID273 are displayed as solids with the shape - determined via the section-definition commands (SECTYPE and - SECDATA). The 2-D master plane is revolved around the - prescribed axis of symmetry. - - Contour plots are available for these elements in - postprocessing for PowerGraphics only (/GRAPHICS,POWER). To - view 3-D deformed shapes for the elements, issue OUTRES,MISC - or OUTRES,ALL for static or transient analyses. To view 3-D - mode shapes for a modal or eigenvalue buckling analysis, - expand the modes with element results calculation ON (Elcalc = - YES for MXPAND). - - SOURC36, CIRCU124, and TRANS126 elements always plot using - /ESHAPE when PowerGraphics is activated (/GRAPHICS,POWER). - - In most cases, /ESHAPE renders a thickness representation of - your shell, plane and layered elements more readily in - PowerGraphics (/GRAPHICS,POWER). This type of representation - employs PowerGraphics to generate the enhanced representation, - and will often provide no enhancement in Full Graphics - (/GRAPHICS,FULL). This is especially true for POST1 results - displays, where /ESHAPE is not supported for most element - types with FULL graphics. - - When PowerGraphics is active, /ESHAPE may degrade the image if - adjacent elements have overlapping material, such as shell - elements which are not co-planar. Additionally, if adjacent - elements have different thicknesses, the polygons depicting - the connectivity between the "thicker" and "thinner" elements - along the shared element edges may not always be displayed. - - For POST1 results displays (such as PLNSOL), the following - limitations apply: - - Rotational displacements for beam elements are used to create - a more realistic displacement display. When /ESHAPE is active, - displacement plots (via PLNSOL,U,X and PLDISP, for example) - may disagree with your PRNSOL listings. This discrepancy will - become more noticeable when the SCALE value is not equal to - one. - - When shell elements are not co-planar, the resulting PLNSOL - display with /ESHAPE will actually be a PLESOL display as the - non-coincident pseudo-nodes are not averaged. Additionally, - /ESHAPE should not be used with coincident elements because - the plot may incorrectly average the displacements of the - coincident elements. - - When nodes are initially coincident and PowerGraphics is - active, duplicate polygons are eliminated to conserve display - time and disk space. The command may degrade the image if - initially coincident nodes have different displacements. The - tolerance for determining coincidence is 1E-9 times the - model’s bounding box diagonal. - - If you want to view solution results (PLNSOL, etc.) on layered - elements (such as SHELL181, SOLSH190, SOLID185 Layered Solid, - SOLID186 Layered Solid, SHELL208, SHELL209, SHELL281, and - ELBOW290), set KEYOPT(8) = 1 for the layer elements so that - the data for all layers is stored in the results file. - - You can plot the through-thickness temperatures of elements - SHELL131 and SHELL132 regardless of the thermal DOFs in use by - issuing the PLNSOL,TEMP command (with PowerGraphics and - /ESHAPE active). - - The /ESHAPE,1 and /ESHAPE,FAC commands are incompatible with - the /CYCEXPAND command used in cyclic symmetry analyses. - - This command is valid in any processor. - - """ - warnings.warn( - "pymapdl does not support /ESHAPE when plotting in " - "Python using ``mapdl.eplot()``. " - "Use ``mapdl.eplot(backend=GraphicsBackend.MAPDL)`` " - ) - command = f"/ESHAPE,{scale},{key}" - return self.run(command, **kwargs) - - def facet(self, lab="", **kwargs): - """Specifies the facet representation used to form solid model displays. - - APDL Command: /FACET - - Parameters - ---------- - lab - Valid labels: - - FINE - Use finer tessellation to increase the number of facets for the display. - Provides the best representation (but decreases speed of - operation). - - NORML - Use the basic number of facets for the display (default). - - COAR - Use a limited number of facets for the display. This option will increase the - speed of the operations, but may produce poor - representations for some imported models. - - WIRE - Display model with a wireframe representation (fast, but surfaces will not be - shown). - - Notes - ----- - Specifies the facet (or polygon) representation used to form solid - model displays. Used only with the APLOT, ASUM, VPLOT, and VSUM - commands. - - This command is valid in any processor. - """ - command = f"/FACET,{lab}" - return self.run(command, **kwargs) - - def gline(self, wn="", style="", **kwargs): - """Specifies the element outline style. - - APDL Command: /GLINE - - Parameters - ---------- - wn - Window number (or ALL) to which command applies (defaults to 1). - - style - Outline key: - - 0 - Solid element outlines (default) - - 1 - Dashed element outlines - - -1 - No element outlines - - Notes - ----- - Determines the element outline style. Often used when node numbers are - displayed to prevent element lines from overwriting node numbers. - - Unless you are using an OpenGL or Starbase driver, the dashed element - outline option (/GLINE,WN,1) is not available in the following - situations: - - Z-buffered displays (/TYPE,WN,6). - - Capped Z-buffered displays (/TYPE,WN,7). - - Qslice Z-buffered displays (/TYPE,WN,8). - - This command is valid in any processor. - """ - command = f"/GLINE,{wn},{style}" - return self.run(command, **kwargs) - - def gmarker(self, curve="", key="", incr="", **kwargs): - """Specifies the curve marking style. - - APDL Command: /GMARKER - - Parameters - ---------- - curve - Curve number markers will be applied on (integer value between 1 - and 10). - - key - Marker key: - - 0 - No markers will be applied (default). - - 1 - TRIANGLES will be applied. - - 2 - SQUARES will be applied. - - 3 - DIAMONDS will be applied. - - 4 - CROSSES will be applied. - - incr - Determines the curve marking frequency. (a whole number value - between 1 and 255). If INCR = 1, markers are displayed at every - data point on the curve. If INCR = 2 then markers are displayed at - every second data point. If INCR = 3 then they are displayed at - every third data point. - - Notes - ----- - The user-specified markers will not be drawn when the area under the - curve is color-filled (/GROPT, FILL). - """ - command = f"/GMARKER,{curve},{key},{incr}" - return self.run(command, **kwargs) - - def gmface(self, lab="", n="", **kwargs): - """Specifies the facet representation used to form solid models. - - APDL Command: GMFACE - - Parameters - ---------- - lab - Valid Labels: - - FINE - Value that determines how coarse the facets will be. - - n - An integer value between one (small) and ten (large) that - determines the tolerances that will be applied to the creation of - arcs and surfaces. Ten will create many facets, which may in turn - cause ANSYS to run very slowly. One will create fewer facets, which - may in turn cause larger tolerance errors. - """ - command = f"GMFACE,{lab},{n}" - return self.run(command, **kwargs) - - def light(self, wn="", num="", int_="", xv="", yv="", zv="", refl="", **kwargs): - """Specifies the light direction for the display window. - - APDL Command: /LIGHT - - Parameters - ---------- - wn - Window number (or ALL) to which command applies (defaults to 1). - - num - Ambient or directional light key: - - 0 - Ambient light (default). - - 1 - Directional light. - - int\\_ - Light intensity factor (defaults to 0.3 for ambient, 1.0 for - directional). This option is valid only for 3-D devices). - - xv, yv, zv - Light direction (valid only for NUM = 1). The directional light - source is parallel to the line from point XV, YV, ZV to the origin, - in the global Cartesian system origin. Defaults to the viewing - direction [/VIEW]. - - refl - Light reflectance factor (valid only for NUM = 1 and 3-D devices). - - Notes - ----- - Defines the light direction for the window. Use this command only with - 3-D graphics devices or 2-D devices when Z-buffering is used [/TYPE,,(6 - or 7)]. The ambient light has no direction, only an intensity. You - can position the directional light source by defining a point (in the - global Cartesian coordinate system) representing a point along the - light directional line. This point, and the global Cartesian - coordinate system origin, define the line along which the light is - positioned looking toward the origin. You can use any point along the - light line; for example, both (1.,1.,1.) and (2.,2.,2.) give the same - light effect. For 3-D graphics devices only, the directional light - source also has intensity and reflectance factors. - - By choosing the highest intensity ambient light for 3-D graphics - devices (via the command /LIGHT,WN,0,1), you can nullify color shading - and other effects of directional lighting. - - This command is valid in any processor. - """ - command = f"/LIGHT,{wn},{num},{int_},{xv},{yv},{zv},{refl}" - return self.run(command, **kwargs) - - def normal(self, wn="", key="", **kwargs): - """Allows displaying area elements by top or bottom faces. - - APDL Command: /NORMAL - - Parameters - ---------- - wn - Window number (or ALL) to which command applies (defaults to 1). - - key - Display key: - - 0 - No face distinction. - - 1 - Show only area elements having their positive normals directed toward the - viewing point. - - -1 - Show only area elements having their positive normals directed away from the - viewing point. - - Notes - ----- - /NORMAL allows you to select area elements and area plots by the top or - bottom faces. It is useful for checking the normal directions on shell - elements. The positive normal (element Z direction) is defined by the - right-hand rule following the node I, J, K, L input direction. This - command is available only with raster or hidden-line displays, for - WIN32 or X11 2-D displays only. - - This command is valid in any processor. - """ - command = f"/NORMAL,{wn},{key}" - return self.run(command, **kwargs) - - def shade(self, wn="", type_="", **kwargs): - """Defines the type of surface shading used with Z-buffering. - - APDL Command: /SHADE - - Parameters - ---------- - wn - Window number (or ALL) to which command applies (defaults to 1). - - type\\_ - Shading type: - - FACET or 0 - Facet shading (one color per area face) (default). - - GOURAUD or 1 - Gouraud smooth shading (smooth variation of color based on interpolated vertex - colors). - - PHONG or 2 - Phong smooth shading (smooth variation of color based on interpolated vertex - normals). - - Notes - ----- - Defines the type of surface shading used on area, volume, and - PowerGraphics [/GRAPHICS,POWER] displays when software Z-buffering is - enabled [/TYPE]. This command is only functional for 2-D display - devices. - - This command is valid in any processor. - """ - command = f"/SHADE,{wn},{type_}" - return self.run(command, **kwargs) - - def slashtype(self, wn="", type_="", **kwargs): - """Defines the type of display. - - APDL Command: /TYPE - - Parameters - ---------- - wn - Window number (or ALL) to which command applies (defaults to 1). - - type_ - Display type. Defaults to `ZBUF` for raster mode displays or `BASIC` - for vector mode displays: - - BASIC or 0 - Basic display (no hidden or section operations). - - SECT or 1 - Section display (plane view). Use the `/CPLANE` command to - define the cutting plane. - - HIDC or 2 - Centroid hidden display (based on item centroid sort). - - HIDD or 3 - Face hidden display (based on face centroid sort). - - HIDP or 4 - Precise hidden display (like `HIDD` but with more precise checking). - Because all facets are sorted, this mode can be extremely slow, - especially for large models. - - CAP or 5 - Capped hidden display (same as combined `SECT` and `HIDD` with - model in front of section plane removed). - - ZBUF or 6 - Z-buffered display (like `HIDD` but using software Z-buffering). - - ZCAP or 7 - Capped Z-buffered display (same as combined `SECT` and `ZBUF` - with model in front of section plane removed). - - ZQSL or 8 - `QSLICE` Z-buffered display (same as `SECT` but the edge lines - of the remaining 3D model are shown). - - HQSL or 9 - `QSLICE` precise hidden display (like `ZQSL` but using precise hidden). - - Notes - ----- - **Command Default:** `ZBUF` for raster mode displays; `BASIC` for vector - mode displays. - - Defines the type of display, such as section display or hidden-line - display. Use the `/DEVICE` command to specify either raster or - vector mode. - - The `SECT`, `CAP`, `ZCAP`, `ZQSL`, and `HQSL` options produce section - displays. The section or "cutting" plane is specified on the `/CPLANE ` - command as either normal to the viewing vector at the focus point - (default), or as the working plane. - - When you use PowerGraphics, the section display options (`Section`, - `Slice`, and `Capped`) use different averaging techniques for the - interior and exterior results. Because of the different averaging - schemes, anomalies may appear at the transition areas. In many cases, - the automatically computed `MIN` and `MAX` values will differ from the - full range of interior values. You can lessen the effect of these - anomalies by issuing` AVRES,,FULL` (Main Menu> General Post Proc> - Options for Outp). This command sets your legend's automatic contour - interval range according to the minimum and maximum results found - throughout the entire model. - - With PowerGraphics active (`/GRAPHICS,POWER`), the averaging scheme for - surface data with interior element data included (`AVRES,,FULL`) and - multiple facets per edge (`/EFACET,2` or `/EFACET,4`) will yield - differing minimum and maximum contour values depending on the Z- - Buffering options (`/TYPE,,6` or `/TYPE,,7`). When the Section data is - not included in the averaging schemes (`/TYPE,,7`), the resulting - absolute value for the midside node is significantly smaller. - - The `HIDC`, `HIDD`, `HIDP`, `ZBUF`, `ZQSL`, and `HQSL` options produce - displays with "hidden" lines removed. Hidden lines are lines obscured - from view by another element, area, etc. The choice of non-Z-buffered - hidden-line procedure types is available only for raster mode - (`/DEVICE`) displays. For vector mode displays, all non-Z-buffered - "hidden-line" options use the same procedure (which is slightly - different from the raster procedures). Both geometry and postprocessing - displays may be of the hidden- line type. Interior stress contour lines - within solid elements can also be removed as hidden lines, leaving only - the stress contour lines and element outlines on the visible surfaces. - Midside nodes of elements are ignored on postprocessing displays. - Overlapping elements will not be displayed. - - The `ZBUF`, `ZCAP`, and `ZQSL` options use a specific hidden-line - technique called software Z-buffering. This technique allows a more - accurate display of overlapping surfaces (common when using Boolean - operations or `/ESHAPE` on element displays), and allows smooth shaded - displays on all interactive graphics displays. Z-buffered displays can - be performed faster than `HIDP` and `CAP` type displays for large - models. See also the `/LIGHT`, `/SHADE`, and `/GFILE` commands for - additional options when Z-buffering is used. - - This command is valid in any processor. - """ - command = f"/TYPE,{wn},{type_}" - return self.run(command, **kwargs) - - def trlcy(self, lab="", tlevel="", n1="", n2="", ninc="", **kwargs): - """Specifies the level of translucency. - - APDL Command: /TRLCY - - Parameters - ---------- - lab - Apply translucency level to the items specified by the following - labels: - - ELEM - Elements. Use N1, N2, NINC fields for element numbers. - - AREA - Solid model areas. Use N1, N2, NINC fields for area numbers. - - VOLU - Solid model volumes. Use N1, N2, NINC fields for volume numbers. - - ISURF - Isosurfaces (surfaces of constant stress, etc., value). Translucency varies - with result value, to a maximum of the specified - translucency level. - - CM - Component group. Use N1 for component name, ignore N2 and NINC. - - CURVE - Filled areas under curves of line graphs. Use N1, N2, NINC fields for curve - numbers. - - ZCAP - If /TYPE,WN,ZCAP is the current display type, then /TRLCY,ZCAP,TLEVEL will - display the model in window WN with the portion of the model - in front of the section plane displayed at the translucency - level TLEVEL. - - ON, OFF - Sets the specified translucency display on or off. All other fields are - ignored. - - tlevel - Translucency level: 0.0 (opaque) to 1.0 (transparent). - - n1, n2, ninc - Used only with labels as noted above. Apply translucency level to - Lab items numbered N1 to N2 (defaults to N1) in steps of NINC - (defaults to 1). If N1 is blank or ALL, apply specified - translucency level to entire selected range. If Lab is CM, use - component name for N1 and ignore N2 and NINC. A value of N1 = P - allows you to graphically pick elements, areas, and volumes. You - can then assign translucency levels to the entities via the picker. - The Lab and TLEVEL fields are ignored when translucency is applied - by picking. - - Notes - ----- - Specifies the level of translucency for various items. Issue - /TRLCY,DEFA to reset the default (0) translucency levels. This command - is valid only on selected 2-D and 3-D graphics devices; see in the - Basic Analysis Guide for more information on applying translucency. - - For 2-D devices, ANSYS displays only the visible faces of the items - being displayed. The information behind the facing planes is not - displayed. Issuing the /SHRINK command will force the hardware to - display information behind the translucent items. - - This command is valid in any processor. - """ - command = f"/TRLCY,{lab},{tlevel},{n1},{n2},{ninc}" - return self.run(command, **kwargs) diff --git a/src/ansys/mapdl/core/_commands/graphics_/views.py b/src/ansys/mapdl/core/_commands/graphics_/views.py deleted file mode 100644 index fd1e1a3dfe7..00000000000 --- a/src/ansys/mapdl/core/_commands/graphics_/views.py +++ /dev/null @@ -1,457 +0,0 @@ -# Copyright (C) 2016 - 2025 ANSYS, Inc. and/or its affiliates. -# SPDX-License-Identifier: MIT -# -# -# Permission is hereby granted, free of charge, to any person obtaining a copy -# of this software and associated documentation files (the "Software"), to deal -# in the Software without restriction, including without limitation the rights -# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -# copies of the Software, and to permit persons to whom the Software is -# furnished to do so, subject to the following conditions: -# -# The above copyright notice and this permission notice shall be included in all -# copies or substantial portions of the Software. -# -# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -# SOFTWARE. - - -class Views: - def angle(self, wn="", theta="", axis="", kincr="", **kwargs): - """Rotates the display about an axis. - - APDL Command: /ANGLE - - Parameters - ---------- - wn - Window number (or ALL) to which command applies (defaults to 1). - - theta - Angle (degrees) for changing display orientation (positive, - counterclockwise about specified axis). - - axis - Rotation axis: XS, YS, or ZS (default) for the screen axes; XM, - YM, or ZM for the global Cartesian model axes. ZS is normal to the - screen; all axes pass through the focus point. - - kincr - Cumulative rotation key: - - 0 - Do not use cumulative successive rotations. - - 1 - Use cumulative rotations. Rotations are relative to the previous rotation. - View settings (/VIEW) are recalculated. - - Notes - ----- - Default orientation is YS vertical. When the /XFRM command is set for - rotation about two points, or for entities, the /ANGLE command is - functional only for Axis = ZS or ZM and KINCR = 1. - - This command is valid in any processor. - """ - command = f"/ANGLE,{wn},{theta},{axis},{kincr}" - return self.run(command, **kwargs) - - def auto(self, wn="", **kwargs): - """Resets the focus and distance specifications to "automatically - - APDL Command: /AUTO - calculated." - - Parameters - ---------- - wn - Window number (or ALL) to which command applies (defaults to 1). - - Notes - ----- - Focus point and distance will be automatically calculated during next - display. Settings may still be changed with the /FOCUS and /DIST - commands after this command has been issued. See also the /USER - command. - - This command is valid in any processor. - """ - command = f"/AUTO,{wn}" - return self.run(command, **kwargs) - - def dist(self, wn="", dval="", kfact="", **kwargs): - """Specifies the viewing distance for magnifications and perspective. - - APDL Command: /DIST - - Parameters - ---------- - wn - Window number (or ALL) to which command applies (defaults to 1). - - dval - Distance along the view line from the observer to the focus point - (defaults to value producing full-window display). Distances "too - close" to the object will produce excessive magnifications. If - DVAL = AUTO, zero, or blank, the program will calculate the - distance automatically. If DVAL = USER, the distance of last - display will be used (useful when last display automatically - calculated distance). - - kfact - DVAL interpretation key: - - 0 - Interpret numerical DVAL values as described above. - - 1 - Interpret DVAL as a multiplier on the current distance (DVAL of 2 gives twice - the current distance; 0.5 gives half the current distance, - etc.). - - Notes - ----- - The scale factor is relative to the window shape. For example, for - objects centered in a square window and with parallel projection (no - perspective), a distance of : /2 (+10%) produces a full window - magnification, where : is the largest in-plane vertical or horizontal - dimension. See also /AUTO and /USER commands. - - This command is valid in any processor. - """ - command = f"/DIST,{wn},{dval},{kfact}" - return self.run(command, **kwargs) - - def focus(self, wn="", xf="", yf="", zf="", ktrans="", **kwargs): - """Specifies the focus point (center of the window). - - APDL Command: /FOCUS - - Parameters - ---------- - wn - Window number (or ALL) to which command applies (defaults to 1). - - xf, yf, zf - Location of the object to be at the focus point (center of the - window) in the global Cartesian coordinate system. If XF = AUTO, - allow automatic location calculation. If XF = USER, use focus - location of last display (useful when last display had auto focus). - - ktrans - Translate key: - - 0 - Interpret numerical XF, YF, ZF values as described above. - - 1 - Interpret XF, YF, ZF values as multiples of half-screens to translate from the - current position in the screen coordinate system. Example: XF - of 2.4 translates the display approximately 2.4 half-screens to - the left in the screen X (horizontal) direction. - - 2 - Interpret XF, YF, ZF values as multiples of half-screens to translate from the - current position in the global Cartesian coordinate system. - Example: XF of 1.5 translates the display approximately 1.5 - half-screens in the global Cartesian X direction of the model. - - Notes - ----- - Specifies the location on (or off) the model which is to be located at - the focus point (center of the window). For section and capped - displays, the cutting plane is also assumed to pass through this - location (unless the working plane is used via /CPLANE). See also - /AUTO and /USER commands. - - This command is valid in any processor. - """ - command = f"/FOCUS,{wn},{xf},{yf},{zf},{ktrans}" - return self.run(command, **kwargs) - - def user(self, wn="", **kwargs): - """Conveniently resets /FOCUS and /DIST to USER. - - APDL Command: /USER - - Parameters - ---------- - wn - Window number (or ALL) to which command applies (defaults to 1). - - Notes - ----- - Conveniently resets scale parameters to USER on the /FOCUS and /DIST - commands. Scale parameters will be internally respecified to those - used for the last display. Convenient when the last scale parameters - were automatically calculated. User specified parameters hold until - changed or removed [/AUTO]. Parameters may be reset on the individual - commands after this command has been issued. - - This command is valid in any processor. - """ - command = f"/USER,{wn}" - return self.run(command, **kwargs) - - def vcone(self, wn="", phi="", **kwargs): - """Defines the view cone angle for perspective displays. - - APDL Command: /VCONE - - Parameters - ---------- - wn - Window number (or ALL) to which command applies (defaults to 1). - - phi - View cone angle (0.0 to 85.°) to define perspective. Use PHI = - 45.0° for typical perspective. Increase angle for more - perspective, decrease angle for less. If the distance [/DIST] is - not specified, it will be automatically calculated to give full - window magnification. If the distance is also specified, PHI - controls both the perspective and the magnification. The larger - the angle, the more the perspective and the less the magnification. - Defaults to 0.0 (no perspective). - - Notes - ----- - Perspective shows the true depth of the object in the display. A - variable magnification results since the back plane of the object is - further from the observer than the front plane. The largest - magnification occurs at the front plane. With perspective, the - magnification factor (MAGF) is not only a function of the distance from - the object, but also the window shape and the perspective (or view - cone) angle: Φ as follows: - - where , for square windows, is the largest in-plane vertical or - horizontal dimension, d is the distance from the observer to the plane - of: (usually the front plane of the object), and: Φ is the view cone - angle (defined with the /VCONE command). The bigger the cone angle, - the more the perspective. The magnification factor proportionally - decreases with increasing: Φ. The distance can be defined with the - /DIST or the /FOCUS command. Note, the distance input on the /DIST - command is equal to d only if the focus point is located on the plane - of : . It is recommended that if a general perspective is desired - (i.e., not any specific cone angle), use Φ = 45.0 (since TAN(45.0) = - 1.0) and let the d value be automatically calculated for full window - magnification. - - Note that any number of /DIST, /FOCUS, and /VCONE combinations can be - used to produce the same magnification. Distances less than the object - depth will produce views from within the object. - - A magnification factor of 1.0 just fills the window. If the automatic - scaling option is used [/AUTO], the magnification factor is fixed at - 0.91 (to allow a 10% margin around the object) and d is automatically - calculated for the given /VCONE and /FOCUS values. Any value of Φ - between 0.0 and 85.0 (usually 45.0) may be used to activate the - perspective. Views from inside the object are not possible when d is - automatically calculated (use manual scaling [/USER] along with /DIST - specification). - - This command is valid in any processor. - """ - command = f"/VCONE,{wn},{phi}" - return self.run(command, **kwargs) - - def view(self, wn="", xv="", yv="", zv="", **kwargs): - """Defines the viewing direction for the display. - - APDL Command: /VIEW - - Parameters - ---------- - wn - Window number (or ALL) to which command applies (defaults to 1). - - xv, yv, zv - The object is viewed along the line from point XV,YV,ZV (in the - global coordinate system) to the global coordinate system origin. - For section displays, the cutting plane is assumed to be - perpendicular to this line. If XV = WP, modify view to be normal - to the currently defined working plane. Defaults to (0,0,1). - - Notes - ----- - The view line is always normal to the screen. The view is selected by - defining a point (in the global Cartesian coordinate system) - representing a point along the viewing line. This point, and the - global Cartesian coordinate system origin, define the line along which - the object is viewed while looking toward the origin. Any point along - the view line may be used, i.e., (1,1,1) and (2,2,2) give the same - view. The display orientation may be changed as desired [/ANGLE]. The - display coordinate system type may be changed (from Cartesian to - cylindrical, spherical, toroidal, etc.) with the DSYS command. - - This command is valid in any processor. - """ - command = f"/VIEW,{wn},{xv},{yv},{zv}" - return self.run(command, **kwargs) - - def vup(self, wn="", label="", **kwargs): - """Specifies the global Cartesian coordinate system reference orientation. - - APDL Command: /VUP - - Parameters - ---------- - wn - Window number (or ALL) to which command applies (defaults to 1). - - label - Orientation: - - * ``Y`` : Y vertical upward, X horizontal to the right, Z - out from the screen (default). - * ``-Y`` : Y vertical downward, X horizontal to the left, - Z out from the screen. - * ``X`` : X vertical upward, Y horizontal to the left, Z - out from the screen. - * ``-X`` : X vertical downward, Y horizontal to the right, - Z out from the screen. - * ``Z`` : Z vertical upward, Y horizontal to the right, X - out from the screen. With this choice, you should use a - view other than the /VIEW default of (0,0,1). - * ``-Z`` : Z vertical downward, Y horizontal to the left, - X out from the screen. With this choice, you should use - a view other than the /VIEW default of (0,0,1). - - Notes - ----- - Specifies the global Cartesian coordinate system reference orientation. - The /VIEW and /ANGLE commands may be used to reorient the view and are - relative to this reference orientation. All coordinate systems are - right-handed. - - This command is valid in any processor. - """ - command = f"/VUP,{wn},{label}" - return self.run(command, **kwargs) - - def xfrm(self, lab="", x1="", y1="", z1="", x2="", y2="", z2="", **kwargs): - """Controls the centroid or the axis of dynamic rotation. - - APDL Command: /XFRM - - Parameters - ---------- - lab - The location or entity (centroid) used to define the center or axis - of rotation. - - NODE - If NODE is chosen for the center of rotation, the node number will be X1. If - the rotation is to be about an axis, then X1 and Y1 define - the two nodes between which a line is drawn to determine the - axis. The remaining arguments are ignored. - - ELEMENT - If ELEMENT is chosen for the center of rotation, the element number will be X1. - If the rotation is to be about an axis, then X1 and Y1 - define the two elements between which a line is drawn to - determine the axis. The remaining arguments are ignored. - - KP - If KP is chosen for the center of rotation, the keypoint number will be X1. If - the rotation is to be about an axis, then X1 and Y1 define the - two keypoints between which a line is drawn to determine the - axis. The remaining arguments are ignored. - - LINE - If LINE is chosen for the center of rotation, the line number will be X1. If - the rotation is to be about an axis, then X1 and Y1 define - the two lines between which a line is drawn to determine the - axis. The remaining arguments are ignored. - - AREA - If AREA is chosen for the center of rotation, the area number will be X1. If - the rotation is to be about an axis, then X1 and Y1 define - the two areas between which a line is drawn to determine the - axis. The remaining arguments are ignored. - - VOLUME - If VOLUME is chosen for the center of rotation, the volume number will be X1. - If the rotation is to be about an axis, then X1 and Y1 - define the two volumes between which a line is drawn to - determine the axis. The remaining arguments are ignored. - - XYZ - If XYZ is chosen for the center of rotation, the location of that center is - determined by the coordinates X1, Y1, Z1. If values are - specified for X2, Y2, Z2, then the axis of rotation will be - about the line between those two points. - - OFF - If LAB = OFF, DEFAULT, FOCUS or if no value is specified, then the center of - rotation is set at the FOCUS point, as defined by the /FOCUS - command. - - x1 - The entity number or X coordinate for the center of rotation. - - y1 - The entity number or Y coordinate for the center of rotation. - - z1 - The Z coordinate for the center of rotation. - - x2 - The X coordinate for the axis of rotation. - - y2 - The Y coordinate for the axis of rotation. - - z2 - The Z coordinate for the axis of rotation. - - Notes - ----- - The /XFRM command is active only when the cumulative rotation key is - specified ON for the /ANGLE command (KINCR = 1). This command affects - dynamic manipulations only. - - For center rotation, the middle mouse button will rotate the model - about the screen Z axis and the right mouse button will rotate the - model about the screen X and Y axis. - - For rotation about an axis, the middle mouse button will rotate the - model about the defined axis of rotation and the right mouse button - will be deactivated. - - This command is valid in any processor. - """ - command = f"/XFRM,{lab},{x1},{y1},{z1},{x2},{y2},{z2}" - return self.run(command, **kwargs) - - def zoom(self, wn="", lab="", x1="", y1="", x2="", y2="", **kwargs): - """Zooms a region of a display window. - - APDL Command: /ZOOM - - Parameters - ---------- - wn - Window number to which command applies (defaults to 1). - - lab - Label to define the desired type of zoom: - - OFF - Turns zoom off (refits image of entire model to the window). - - BACK - Goes back to previous zoom setting (five successive back ups, maximum). - - SCRN - Interprets X1,Y1 as the screen coordinates of the center of a square zoom - region; X2,Y2 as the screen coordinates of a point on one - side of that square. - - RECT - Interprets X1,Y1 and X2,Y2 as the screen coordinates of two opposite corners of - a rectangular zoom region. - - Notes - ----- - Zooms (centers and magnifies) the specified region of a display window. - /ZOOM will operate on a display that has been formed by an explicit - graphics action command (APLOT, EPLOT, etc.). /ZOOM has no effect on - an "immediate" graphics display. When /ZOOM is executed, the display - is automatically replotted such that the specified zoom region is - centered and sized to fill the window. - - Auto resizing is disabled when you issue the /ZOOM command. To restore - auto resizing, issue the /AUTO command, or select FIT from the Pan, - Zoom, Rotate box. - - This command is valid in any processor. - """ - command = f"/ZOOM,{wn},{lab},{x1},{y1},{x2},{y2}" - return self.run(command, **kwargs) diff --git a/src/ansys/mapdl/core/_commands/reduced/__init__.py b/src/ansys/mapdl/core/_commands/map/__init__.py similarity index 95% rename from src/ansys/mapdl/core/_commands/reduced/__init__.py rename to src/ansys/mapdl/core/_commands/map/__init__.py index 21ba00eea93..c5f0d648e68 100644 --- a/src/ansys/mapdl/core/_commands/reduced/__init__.py +++ b/src/ansys/mapdl/core/_commands/map/__init__.py @@ -20,4 +20,6 @@ # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE # SOFTWARE. -from . import generation, preparation, setup, use_pass +from . import ( + pressure_mapping, +) diff --git a/src/ansys/mapdl/core/_commands/map/pressure_mapping.py b/src/ansys/mapdl/core/_commands/map/pressure_mapping.py new file mode 100644 index 00000000000..ec647322972 --- /dev/null +++ b/src/ansys/mapdl/core/_commands/map/pressure_mapping.py @@ -0,0 +1,323 @@ +# Copyright (C) 2016 - 2025 ANSYS, Inc. and/or its affiliates. +# SPDX-License-Identifier: MIT +# +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to deal +# in the Software without restriction, including without limitation the rights +# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +# copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in all +# copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +# SOFTWARE. + + +class PressureMapping: + + def ftype(self, filetype: str = "", prestype: int | str = "", **kwargs): + r"""Specifies the file type and pressure type for the subsequent import of source points and pressures. + + Mechanical APDL Command: `FTYPE `_ + + Parameters + ---------- + filetype : str + Type of file from which the pressure data will be retrieved (no default): + + * ``CFXTBR`` - File from a CFX Transient Blade Row (TBR) analysis export. + + * ``CFDPOST`` - File from a CFD-Post BC Profile export. + + * ``FORMATTED`` - Formatted file. + + * ``CSV`` - Comma-Separated Values file. + + prestype : int or str + Type of pressure data contained in the file: + + * ``0`` - Only real-valued pressures are on the file. + + * ``1`` - Real-valued and imaginary-valued pressures are on the file (default). + + Notes + ----- + + .. _FTYPE_notes: + + CFX Transient Blade Row files ( ``FileType`` = CFXTBR) are obtained from the **Export Results** Tab + in CFX-Pre, with **[Export Surface Name]: Option** set to Harmonic Forced Response. + + CFD-Post files ( ``FileType`` = CFDPOST) are obtained from the **Export** action in CFD-Post with + **Type** set to BC Profile. + + Formatted files ( ``FileType`` = FORMATTED) contain the coordinates and pressure data in fixed- + format columns in the order x, y, z, pressure. You may have other columns of data in the file which + can be skipped over in the ``Format`` specifier on the :ref:`read` command, but the data must be in + that order. + + Comma-separated values files ( ``FileType`` = CSV) contain the coordinates and pressure data in + comma-separated fields. The data can be in any order, and other fields of data may also be present. + """ + command = f"FTYPE,{filetype},{prestype}" + return self.run(command, **kwargs) + + def map( + self, kdim: int | str = "", kout: int | str = "", limit: str = "", **kwargs + ): + r"""Maps pressures from source points to target surface elements. + + Mechanical APDL Command: `MAP `_ + + Parameters + ---------- + + kdim : int or str + Interpolation key: + + * ``0 or 2`` - Interpolation is done on a surface (default). + + * ``3`` - Interpolation is done within a volume. This option is useful if the supplied source data + is volumetric field data rather than surface data. + + kout : int or str + Key to control how pressure is applied when a target node is outside of the source region: + + * ``0`` - Use the pressure(s) of the nearest source point for target nodes outside of the region + (default). + + * ``1`` - Set pressures outside of the region to zero. + + limit : str + Number of nearby points considered for interpolation. The minimum is 5; the default is 20. Lower + values reduce processing time. However, some distorted or irregular meshes will require a higher + ``LIMIT`` value to find the points encompassing the target node in order to define the region + for interpolation. + + Notes + ----- + + .. _MAP_notes: + + Maps pressures from source points to target surface elements. + """ + command = f"MAP,,{kdim},,{kout},{limit}" + return self.run(command, **kwargs) + + def plgeom(self, item: str = "", nodekey: str = "", **kwargs): + r"""Plots target and source geometries. + + Mechanical APDL Command: `PLGEOM `_ + + Parameters + ---------- + item : str + Items to plot: + + * ``BOTH`` - Plot both target and source geometries (default). + + * ``TARGET`` - Plot only the target geometry. + + * ``SOURCE`` - Plot only the source geometry. + + nodekey : str + If the source data contains faces (that is, surface elements were created upon the :ref:`read` + command), set ``NODEkey`` = 1 to plot only the source nodes rather than both the nodes and the + elements. + + Notes + ----- + + .. _PLGEOM_notes: + + Target faces are displayed in gray and source points in yellow. If the source data contains faces + (that is, surface elements were created upon the :ref:`read` command), the source faces are also + displayed in blue (unless ``NODEkey`` = 1), and both surfaces are made translucent. + """ + command = f"PLGEOM,{item},{nodekey}" + return self.run(command, **kwargs) + + def plmap( + self, item: str = "", nodekey: str = "", imagkey: int | str = "", **kwargs + ): + r"""Plots target and source pressures. + + Mechanical APDL Command: `PLMAP `_ + + Parameters + ---------- + item : str + Items to plot: + + * ``BOTH`` - Plot both target and source pressures (default). + + * ``TARGET`` - Plot only the target pressures. + + * ``SOURCE`` - Plot only the source pressures. + + nodekey : str + If the source data contains faces (that is, surface elements were created upon the :ref:`read` + command), set ``NODEkey`` = 1 to plot only the source nodes rather than both the nodes and the + elements. + + imagkey : int or str + * ``0`` - Plot the real pressures (default). + + * ``1`` - Plot the imaginary pressures. + + Notes + ----- + + .. _PLMAP_notes: + + Pressures on the target faces are displayed as a color contour plot using the command :ref:`psf` + ,PRES,,3. If the source data contains faces (that is, surface elements were created upon the + :ref:`read` command), the source faces are also displayed using a color contour plot by default. If + ``NODEkey`` = 1 or no source faces are available, the source pressures are displayed as colored node + symbols ( :ref:`psymb`,DOT,1 command). + """ + command = f"PLMAP,{item},,{nodekey},{imagkey}" + return self.run(command, **kwargs) + + def read( + self, + fname: str = "", + nskip: str = "", + format_: str = "", + xfield: str = "", + yfield: str = "", + zfield: str = "", + prfield: str = "", + pifield: str = "", + **kwargs, + ): + r"""Reads coordinate and pressure data from a file. + + Mechanical APDL Command: `READ `_ + + Parameters + ---------- + 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. + + nskip : str + Number of lines at the beginning of the file that will be skipped while it is read. Default = 0. + ``NSKIP`` is ignored for ``FileType`` = CFXTBR or CFDPOST on the :ref:`ftype` command. + + format_ : str + For ``FileType`` = FORMATTED on the :ref:`ftype` command, ``Format`` is the read format in the + FORTRAN FORMAT convention enclosed in parentheses; for example: (3e10.0,10x,e10.0,70x,e10.0) + + xfield : str + For ``FileType`` = CSV on the :ref:`ftype` command, these are field numbers locating the + coordinates and real and imaginary (if present) pressures. The field value may not exceed 20. + + yfield : str + For ``FileType`` = CSV on the :ref:`ftype` command, these are field numbers locating the + coordinates and real and imaginary (if present) pressures. The field value may not exceed 20. + + zfield : str + For ``FileType`` = CSV on the :ref:`ftype` command, these are field numbers locating the + coordinates and real and imaginary (if present) pressures. The field value may not exceed 20. + + prfield : str + For ``FileType`` = CSV on the :ref:`ftype` command, these are field numbers locating the + coordinates and real and imaginary (if present) pressures. The field value may not exceed 20. + + pifield : str + For ``FileType`` = CSV on the :ref:`ftype` command, these are field numbers locating the + coordinates and real and imaginary (if present) pressures. The field value may not exceed 20. + + Notes + ----- + + .. _READ_notes: + + Reads coordinate and pressure data from the specified file. The file type must have been previously + specified on the :ref:`ftype` command. + + Upon reading the file, nodes are created for the source points. For ``FileType`` = CFXTBR or CFDPOST + on the :ref:`ftype` command, if face data is available, ``SURF154`` elements are also created. A + nodal component named SOURCENODES and an element component named SOURCEELEMS are created + automatically. + """ + command = f"READ,{fname},{nskip},{format_},{xfield},{yfield},{zfield},{prfield},{pifield}" + return self.run(command, **kwargs) + + def slashmap(self, **kwargs): + r"""Enters the mapping processor. + + Mechanical APDL Command: `/MAP `_ + + Notes + ----- + Enters the mapping processor. This processor is used to read in source data from an external file + and map it to the existing geometry. + + The current database is saved (to :file:`BeforeMapping.DB` ) upon entering the processor, and it is + resumed upon exiting ( :ref:`finish` command). Any nodes or elements not on the target surface are + deleted for easier viewing of the mapping quantities. A database of this mapping geometry ( + :file:`Mapping.DB` ) is also saved at the :ref:`finish` command. + + This command is valid only at the Begin Level. + """ + command = "/MAP" + return self.run(command, **kwargs) + + def target(self, nlist: str = "", **kwargs): + r"""Specifies the target nodes for mapping pressures onto surface effect elements. + + Mechanical APDL Command: `TARGET `_ + + Parameters + ---------- + nlist : str + Nodes defining the surface upon which the pressures will be mapped. Use the label ALL or specify + a nodal component name. If ALL, all selected nodes ( :ref:`nsel` ) are used (default). + Individual nodes may not be entered. + + Notes + ----- + + .. _TARGET_notes: + + The node list specified by ``Nlist`` must contain a sufficient number of nodes to define an element + surface. The surface must be meshed ( :ref:`esurf` command) with ``SURF154`` elements prior to + issuing this command. + """ + command = f"TARGET,{nlist}" + return self.run(command, **kwargs) + + def writemap(self, fname: str = "", **kwargs): + r"""Writes interpolated pressure data to a file. + + Mechanical APDL Command: `WRITEMAP `_ + + Parameters + ---------- + 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. + + Notes + ----- + + .. _WRITEMAP_notes: + + Writes the interpolated pressure data to the specified file. The data is written as :ref:`sfe` + commands applied to the ``SURF154`` elements that are on the target surface. You may read this data + for inclusion in an analysis by using :ref:`input`, ``Fname``. + """ + command = f"WRITEMAP,{fname}" + return self.run(command, **kwargs) diff --git a/src/ansys/mapdl/core/_commands/map_cmd.py b/src/ansys/mapdl/core/_commands/map_cmd.py deleted file mode 100644 index 979ae076d06..00000000000 --- a/src/ansys/mapdl/core/_commands/map_cmd.py +++ /dev/null @@ -1,312 +0,0 @@ -# Copyright (C) 2016 - 2025 ANSYS, Inc. and/or its affiliates. -# SPDX-License-Identifier: MIT -# -# -# Permission is hereby granted, free of charge, to any person obtaining a copy -# of this software and associated documentation files (the "Software"), to deal -# in the Software without restriction, including without limitation the rights -# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -# copies of the Software, and to permit persons to whom the Software is -# furnished to do so, subject to the following conditions: -# -# The above copyright notice and this permission notice shall be included in all -# copies or substantial portions of the Software. -# -# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -# SOFTWARE. - - -class MapCommand: - def ftype(self, filetype="", prestype="", **kwargs): - """Specifies the file type and pressure type for the subsequent import of - - APDL Command: FTYPE - source points and pressures. - - Parameters - ---------- - filetype - Type of file from which the pressure data will be retrieved (no - default): - - CFXTBR - File from a CFX Transient Blade Row (TBR) analysis export. - - CFDPOST - File from a CFD-Post BC Profile export. - - FORMATTED - Formatted file. - - CSV - Comma-Separated Values file. - - prestype - Type of pressure data contained in the file: - - 0 - Only real-valued pressures are on the file. - - 1 - Real-valued and imaginary-valued pressures are on the file (default). - - Notes - ----- - CFX Transient Blade Row files (FileType = CFXTBR) are obtained from the - Export Results Tab in CFX-Pre, with [Export Surface Name]: Option set - to Harmonic Forced Response. - - CFD-Post files (FileType = CFDPOST) are obtained from the Export action - in CFD-Post with Type set to BC Profile. - - Formatted files (FileType = FORMATTED) contain the coordinates and - pressure data in fixed-format columns in the order x, y, z, pressure. - You may have other columns of data in the file which can be skipped - over in the Format specifier on the READ command, but the data must be - in that order. - - Comma-separated values files (FileType = CSV) contain the coordinates - and pressure data in comma-separated fields. The data can be in any - order, and other fields of data may also be present. - """ - command = f"FTYPE,{filetype},{prestype}" - return self.run(command, **kwargs) - - def map(self, kdim="", kout="", limit="", **kwargs): - """Maps pressures from source points to target surface elements. - - APDL Command: MAP - - kdim - Interpolation key: - - * ``"0 or 2"`` : Interpolation is done on a surface (default). - - * ``"3"`` : Interpolation is done within a volume. This option - is useful if the supplied source data is volumetric field - data rather than surface data. - - kout - Key to control how pressure is applied when a target node is - outside of the source region: - - * ``"0"`` : Use the pressure(s) of the nearest source point - for target nodes outside of the region (default). - - * ``"1"`` : Set pressures outside of the region to zero. - - limit - Number of nearby points considered for interpolation. The minimum - is 5; the default is 20. Lower values reduce processing - time. However, some distorted or irregular meshes will require a - higher ``LIMIT`` value to find the points encompassing the target node - in order to define the region for interpolation. - - Notes - ----- - Maps pressures from source points to target surface elements. - """ - return self.run(f"MAP,,{kdim},,{kout},{limit}", **kwargs) - - def plgeom(self, item="", nodekey="", **kwargs): - """Plots target and source geometries. - - APDL Command: PLGEOM - - Parameters - ---------- - item - Items to plot: - - BOTH - Plot both target and source geometries (default). - - TARGET - Plot only the target geometry. - - SOURCE - Plot only the source geometry. - - nodekey - If the source data contains faces (that is, surface elements were - created upon the READ command), set NODEkey = 1 to plot only the - source nodes rather than both the nodes and the elements. - - Notes - ----- - Target faces are displayed in gray and source points in yellow. If the - source data contains faces (that is, surface elements were created upon - the READ command), the source faces are also displayed in blue (unless - NODEkey = 1), and both surfaces are made translucent. - """ - command = f"PLGEOM,{item},{nodekey}" - return self.run(command, **kwargs) - - def plmap(self, item="", nodekey="", imagkey="", **kwargs): - """Plots target and source pressures. - - APDL Command: PLMAP - - Parameters - ---------- - item - Items to plot: - - BOTH - Plot both target and source pressures (default). - - TARGET - Plot only the target pressures. - - SOURCE - Plot only the source pressures. - - nodekey - If the source data contains faces (that is, surface - elements were created upon the READ command), set NODEkey - = 1 to plot only the source nodes rather than both the - nodes and the elements. - - imagkey - 1 - Plot the real pressures (default). - - 0 - Plot the imaginary pressures. - - Notes - ----- - Pressures on the target faces are displayed as a color contour - plot using the command /PSF,PRES,,3. If the source data - contains faces (that is, surface elements were created upon - the READ command), the source faces are also displayed using a - color contour plot by default. If NODEkey = 1 or no source - faces are available, the source pressures are displayed as - colored node symbols (/PSYMB,DOT,1 command). - """ - return self.run(f"PLMAP,{item},,{nodekey},{imagkey}", **kwargs) - - def read( - self, - fname="", - nskip="", - format_="", - xfield="", - yfield="", - zfield="", - prfield="", - pifield="", - **kwargs, - ): - """Reads coordinate and pressure data from a file. - - APDL Command: READ - - 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. - - nskip - Number of lines at the beginning of the file that will be skipped - while it is read. Default = 0. NSKIP is ignored for FileType = - CFXTBR or CFDPOST on the FTYPE command. - - format\\_ - For FileType = FORMATTED on the FTYPE command, Format is the read - format in the FORTRAN FORMAT convention enclosed in parentheses; - for example: (3e10.0,10x,e10.0,70x,e10.0) - - xfield, yfield, zfield, prfield, pifield - For FileType = CSV on the FTYPE command, these are field numbers - locating the coordinates and real and imaginary (if present) - pressures. The field value may not exceed 20. - - Notes - ----- - Reads coordinate and pressure data from the specified file. The file - type must have been previously specified on the FTYPE command. - - Upon reading the file, nodes are created for the source points. For - FileType = CFXTBR or CFDPOST on the FTYPE command, if face data is - available, SURF154 elements are also created. A nodal component named - SOURCENODES and an element component named SOURCEELEMS are created - automatically. - """ - command = f"READ,{fname},{nskip},{format_},{xfield},{yfield},{zfield},{prfield},{pifield}" - return self.run(command, **kwargs) - - def slashmap(self, **kwargs): - """Enters the mapping processor. - - APDL Command: /MAP - - Notes - ----- - Enters the mapping processor. This processor is used to read in source - data from an external file and map it to the existing geometry. - - The current database is saved (to BeforeMapping.DB) upon entering the - processor, and it is resumed upon exiting (FINISH command). Any nodes - or elements not on the target surface are deleted for easier viewing of - the mapping quantities. A database of this mapping geometry - (Mapping.DB) is also saved at the FINISH command. - - This command is valid only at the Begin Level. - """ - command = f"/MAP," - return self.run(command, **kwargs) - - def target(self, nlist="", **kwargs): - """Specifies the target nodes for mapping pressures onto surface effect - - APDL Command: TARGET - elements. - - Parameters - ---------- - nlist - Nodes defining the surface upon which the pressures will be mapped. - Use the label ALL or specify a nodal component name. If ALL, all - selected nodes [NSEL] are used (default). Individual nodes may not - be entered. - - Notes - ----- - The node list specified by Nlist must contain a sufficient number of - nodes to define an element surface. The surface must be meshed (ESURF - command) with SURF154 elements prior to issuing this command. - """ - command = f"TARGET,{nlist}" - return self.run(command, **kwargs) - - def writemap(self, fname="", **kwargs): - """Writes interpolated pressure data to a file. - - APDL Command: WRITEMAP - - 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. - - Notes - ----- - Writes the interpolated pressure data to the specified - file. The data is written as SFE commands applied to the - SURF154 elements that are on the target surface. You may read - this data for inclusion in an analysis by using /INPUT,Fname. - """ - return self.run(f"WRITEMAP,{fname}", **kwargs) diff --git a/src/ansys/mapdl/core/_commands/post1_/__init__.py b/src/ansys/mapdl/core/_commands/post1/__init__.py similarity index 91% rename from src/ansys/mapdl/core/_commands/post1_/__init__.py rename to src/ansys/mapdl/core/_commands/post1/__init__.py index 62488e4ef36..311aecf8468 100644 --- a/src/ansys/mapdl/core/_commands/post1_/__init__.py +++ b/src/ansys/mapdl/core/_commands/post1/__init__.py @@ -21,17 +21,19 @@ # SOFTWARE. from . import ( + _fatigue, + _special_purpose, animation, controls, element_table, failure_criteria, listing, - load_case, - magnetics_calc, + load_case_calculations, + magnetics_calculations, path_operations, results, - setup, - special, + set_up, + special_purpose, status, surface_operations, trace_points, diff --git a/src/ansys/mapdl/core/_commands/post1/_fatigue.py b/src/ansys/mapdl/core/_commands/post1/_fatigue.py new file mode 100644 index 00000000000..d1c78c8337e --- /dev/null +++ b/src/ansys/mapdl/core/_commands/post1/_fatigue.py @@ -0,0 +1,652 @@ +# Copyright (C) 2016 - 2025 ANSYS, Inc. and/or its affiliates. +# SPDX-License-Identifier: MIT +# +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to deal +# in the Software without restriction, including without limitation the rights +# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +# copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in all +# copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +# SOFTWARE. + + +class Fatigue: + + def fe( + self, nev: str = "", cycle: str = "", fact: str = "", title: str = "", **kwargs + ): + r"""Defines a set of fatigue event parameters. + + Mechanical APDL Command: `FE `_ + + Parameters + ---------- + nev : str + Reference number for this event (within ``MXEV`` ). + + cycle : str + Number of required cycles (defaults to 1). If -1, erase all parameters and fatigue stresses for + this event. + + fact : str + Scale factor to be applied to all loadings in this event (defaults to 1.0). + + title : str + User defined identification title for this event (up to 20 characters). + + Notes + ----- + + .. _FE_notes: + + Repeat FE command to define additional sets of event parameters ( ``MXEV`` limit), to redefine event + parameters, or to delete event stress conditions. + + The set of fatigue event parameters is associated with all loadings and all locations. See the + FTSIZE command for the maximum set of events ( ``MXEV`` ) allowed. + + .. warning:: + + This command is archived in the latest version of the software. + + """ + command = f"FE,{nev},{cycle},{fact},{title}" + return self.run(command, **kwargs) + + def felist(self, nev1: str = "", nev2: str = "", ninc: str = "", **kwargs): + r"""Lists the fatigue event parameters. + + Mechanical APDL Command: `FELIST `_ + + Parameters + ---------- + nev1 : str + List event parameters from ``NEV1`` (defaults to 1) to ``NEV2`` (defaults to ``NEV1`` ) in steps + of ``NINC`` (defaults to 1). If ``NEV1`` = ALL, ``NEV2`` and ``NINC`` are ignored and all events + are listed. + + nev2 : str + List event parameters from ``NEV1`` (defaults to 1) to ``NEV2`` (defaults to ``NEV1`` ) in steps + of ``NINC`` (defaults to 1). If ``NEV1`` = ALL, ``NEV2`` and ``NINC`` are ignored and all events + are listed. + + ninc : str + List event parameters from ``NEV1`` (defaults to 1) to ``NEV2`` (defaults to ``NEV1`` ) in steps + of ``NINC`` (defaults to 1). If ``NEV1`` = ALL, ``NEV2`` and ``NINC`` are ignored and all events + are listed. + + Notes + ----- + + .. _FELIST_notes: + + Fatigue event parameters are defined via the FE command. + + .. warning:: + + This command is archived in the latest version of the software. + + """ + command = f"FELIST,{nev1},{nev2},{ninc}" + return self.run(command, **kwargs) + + def fl( + self, + nloc: str = "", + node: str = "", + scfx: str = "", + scfy: str = "", + scfz: str = "", + title: str = "", + **kwargs, + ): + r"""Defines a set of fatigue location parameters. + + Mechanical APDL Command: `FL `_ + + Parameters + ---------- + nloc : str + Reference number for this location (within ``MXLOC`` ). When defining a new location, defaults + to lowest unused location. If the specified ``NODE`` is already associated with a location, + ``NLOC`` defaults to that existing location. + + node : str + Node number corresponding to this location (must be unique). Used only to associate a node with + a new location or to find an existing location (if ``NLOC`` is not input). If ``NODE`` = -1 (or + redefined), erase all parameters and fatigue stresses for this location. + + scfx : str + Stress concentration factors applied to the total stresses. Factors are applied in the global X, + Y, and Z directions unless the axisymmetric option of the :ref:`fssect` is used (that is, + ``RHO`` is nonzero), in which case the factors are applied in the section x, y, and z (radial, + axial, and hoop) directions. + + scfy : str + Stress concentration factors applied to the total stresses. Factors are applied in the global X, + Y, and Z directions unless the axisymmetric option of the :ref:`fssect` is used (that is, + ``RHO`` is nonzero), in which case the factors are applied in the section x, y, and z (radial, + axial, and hoop) directions. + + scfz : str + Stress concentration factors applied to the total stresses. Factors are applied in the global X, + Y, and Z directions unless the axisymmetric option of the :ref:`fssect` is used (that is, + ``RHO`` is nonzero), in which case the factors are applied in the section x, y, and z (radial, + axial, and hoop) directions. + + title : str + User-defined title for this location (up to 20 characters). + + Notes + ----- + + .. _FL_notes: + + Repeat FL command to define additional sets of location parameters ( ``MXLOC`` limit), to redefine + location parameters, or to delete location stress conditions. + + One location must be defined for each node of interest and only one node can be associated with each + location. See the FTSIZE command for the maximum locations ( ``MXLOC`` ) allowed. A location will be + automatically defined for a node not having a location when the FSSECT, FSNODE, or FS command is + issued. Automatically defined locations are assigned the lowest available location number, unity + stress concentration factors, and no title. + + .. warning:: + + This command is archived in the latest version of the software. + + """ + command = f"FL,{nloc},{node},{scfx},{scfy},{scfz},{title}" + return self.run(command, **kwargs) + + def fllist(self, nloc1: str = "", nloc2: str = "", ninc: str = "", **kwargs): + r"""Lists the fatigue location parameters. + + Mechanical APDL Command: `FLLIST `_ + + Parameters + ---------- + nloc1 : str + List location parameters from ``NLOC1`` (defaults to 1) to ``NLOC2`` (defaults to ``NLOC1`` ) in + steps of ``NINC`` (defaults to 1). If ``NLOC1`` = ALL, ``NLOC2`` and ``NINC`` are ignored and + all locations are listed. + + nloc2 : str + List location parameters from ``NLOC1`` (defaults to 1) to ``NLOC2`` (defaults to ``NLOC1`` ) in + steps of ``NINC`` (defaults to 1). If ``NLOC1`` = ALL, ``NLOC2`` and ``NINC`` are ignored and + all locations are listed. + + ninc : str + List location parameters from ``NLOC1`` (defaults to 1) to ``NLOC2`` (defaults to ``NLOC1`` ) in + steps of ``NINC`` (defaults to 1). If ``NLOC1`` = ALL, ``NLOC2`` and ``NINC`` are ignored and + all locations are listed. + + Notes + ----- + + .. _FLLIST_notes: + + No additional usage notes are available for this command. + + .. warning:: + + This command is archived in the latest version of the software. + + """ + command = f"FLLIST,{nloc1},{nloc2},{ninc}" + return self.run(command, **kwargs) + + def fp( + self, + stitm: int | str = "", + c1: str = "", + c2: str = "", + c3: str = "", + c4: str = "", + c5: str = "", + c6: str = "", + **kwargs, + ): + r"""Defines the fatigue S vs. N and Sm vs. T tables. + + Mechanical APDL Command: `FP `_ + + Parameters + ---------- + stitm : int or str + Starting item number for entering properties (defaults to 1). If 1, data input in field ``C1`` of this command is entered as the first item in the list; if 7, data input in field ``C1`` of this command is entered as the seventh item in the list; etc. If the item number is negative, ``C1`` - ``C6`` are ignored and the item is deleted. If -ALL, the table is erased. Items are as follows (items 41-62 are required only if simplified elastic-plastic code calculations are to be performed): + + * ``1,2,...20`` - N1, N2,... N20 + + * ``21,22,...40`` - S1, S2,... S20 + + * ``41,42,...50`` - T1, T2,... T10 + + * ``51,52,...60`` - Sm1, Sm2,..., Sm10 + + * ``61`` - M (first elastic-plastic material parameter) + + * ``62, `` - N (second elastic-plastic material parameter) + + c1 : str + Data inserted into six locations starting with ``STITM``. If a value is already in one of these + locations, it will be redefined. A blank retains the previous value. + + c2 : str + Data inserted into six locations starting with ``STITM``. If a value is already in one of these + locations, it will be redefined. A blank retains the previous value. + + c3 : str + Data inserted into six locations starting with ``STITM``. If a value is already in one of these + locations, it will be redefined. A blank retains the previous value. + + c4 : str + Data inserted into six locations starting with ``STITM``. If a value is already in one of these + locations, it will be redefined. A blank retains the previous value. + + c5 : str + Data inserted into six locations starting with ``STITM``. If a value is already in one of these + locations, it will be redefined. A blank retains the previous value. + + c6 : str + Data inserted into six locations starting with ``STITM``. If a value is already in one of these + locations, it will be redefined. A blank retains the previous value. + + Notes + ----- + + .. _FP_notes: + + Defines the fatigue alternating stress (S) vs. cycles (N) table and the design stress-intensity + value (Sm) vs. temperature (T) table. Can also be used to modify any previously stored property + tables. Log-log interpolation is used in the S vs. N table and linear interpolation is used in the + Sm vs. T table. Cycles and temperatures must be input in ascending order; S and Sm values in + descending order. Table values must be supplied in pairs, that is, every N entry must have a + corresponding S entry, etc. Not all property pairs per curve need be used. If no S vs. N table is + defined, the fatigue evaluation will not produce usage factor results. + + .. warning:: + + This command is archived in the latest version of the software. + + """ + command = f"FP,{stitm},{c1},{c2},{c3},{c4},{c5},{c6}" + return self.run(command, **kwargs) + + def fplist(self, **kwargs): + r"""Lists the property table stored for fatigue evaluation. + + Mechanical APDL Command: `FPLIST `_ + + Notes + ----- + This command has no arguments, and no additional usage notes are available. + + .. warning:: + + This command is archived in the latest version of the software. + + """ + command = "FPLIST" + return self.run(command, **kwargs) + + def fs( + self, + node: str = "", + nev: str = "", + nlod: str = "", + stitm: int | str = "", + c1: str = "", + c2: str = "", + c3: str = "", + c4: str = "", + c5: str = "", + c6: str = "", + **kwargs, + ): + r"""Stores fatigue stress components at a node. + + Mechanical APDL Command: `FS `_ + + Parameters + ---------- + node : str + Node number corresponding to this location. Used only to associate a node with a new location or + to find an existing location. + + nev : str + Event number to be associated with these stresses (defaults to 1). + + nlod : str + Loading number to be associated with these stresses (defaults to 1). + + stitm : int or str + Starting item number for entering stresses (defaults to 1). If 1, data input in field ``C1`` of this command is entered as the first item in the list; if 7, data input in field ``C1`` of this command is entered as the seventh item in the list; etc. Items are as follows: + + * ``1-6`` - SX, SY, SZ, SXY, SYZ, SXZ total stress components + + * ``7`` - Temperature + + * ``8-13`` - SX, SY, SZ, SXY, SYZ, SXZ membrane-plus-bending stress components. + + * ``14`` - Time + + c1 : str + Stresses assigned to six locations starting with ``STITM``. If a value is already in one of + these locations, it will be redefined. A blank retains the previous value (except in the ``C1`` + field, which resets the ``STITM`` item to zero). + + c2 : str + Stresses assigned to six locations starting with ``STITM``. If a value is already in one of + these locations, it will be redefined. A blank retains the previous value (except in the ``C1`` + field, which resets the ``STITM`` item to zero). + + c3 : str + Stresses assigned to six locations starting with ``STITM``. If a value is already in one of + these locations, it will be redefined. A blank retains the previous value (except in the ``C1`` + field, which resets the ``STITM`` item to zero). + + c4 : str + Stresses assigned to six locations starting with ``STITM``. If a value is already in one of + these locations, it will be redefined. A blank retains the previous value (except in the ``C1`` + field, which resets the ``STITM`` item to zero). + + c5 : str + Stresses assigned to six locations starting with ``STITM``. If a value is already in one of + these locations, it will be redefined. A blank retains the previous value (except in the ``C1`` + field, which resets the ``STITM`` item to zero). + + c6 : str + Stresses assigned to six locations starting with ``STITM``. If a value is already in one of + these locations, it will be redefined. A blank retains the previous value (except in the ``C1`` + field, which resets the ``STITM`` item to zero). + + Notes + ----- + + .. _FS_notes: + + Stores fatigue stress components at a node as input on this command instead of from the current data + in the database. Stresses are stored according to the event number and loading number specified. The + location is associated with that previously defined for this node ( :ref:`fl` ) or else it is + automatically defined. May also be used to modify any previously stored stress components. Stresses + input with this command should be consistent with the global coordinate system for any :ref:`fsnode` + or :ref:`fssect` stresses used at the same location. + + .. warning:: + + This command is archived in the latest version of the software. + + """ + command = f"FS,{node},{nev},{nlod},{stitm},{c1},{c2},{c3},{c4},{c5},{c6}" + return self.run(command, **kwargs) + + def fsdele(self, nloc: str = "", nev: str = "", nlod: str = "", **kwargs): + r"""Deletes a stress condition for a fatigue location, event, and loading. + + Mechanical APDL Command: `FSDELE `_ + + Parameters + ---------- + nloc : str + Delete stresses associated with location ``NLOC``. Defaults to zero. + + nev : str + Delete stresses associated with event ``NEV``. Defaults to zero. + + nlod : str + Delete stresses associated with loading ``NLOD``. Defaults to zero. + + Notes + ----- + + .. _FSDELE_notes: + + Deletes a stress condition stored for a particular fatigue location, event, and loading. Use FE + command to delete all stresses for a particular event or FL command to delete all stresses for a + particular location. + + .. warning:: + + This command is archived in the latest version of the software. + + """ + command = f"FSDELE,{nloc},{nev},{nlod}" + return self.run(command, **kwargs) + + def fslist( + self, + nloc1: str = "", + nloc2: str = "", + ninc: str = "", + nev: str = "", + nlod: str = "", + **kwargs, + ): + r"""Lists the stresses stored for fatigue evaluation. + + Mechanical APDL Command: `FSLIST `_ + + Parameters + ---------- + nloc1 : str + List stresses from ``NLOC1`` (defaults to 1) to ``NLOC2`` (defaults to ``NLOC1`` ) in steps of + ``NINC`` (defaults to 1). If ``NLOC1`` = ALL, ``NLOC2`` and ``NINC`` are ignored and stresses + for all locations are listed. + + nloc2 : str + List stresses from ``NLOC1`` (defaults to 1) to ``NLOC2`` (defaults to ``NLOC1`` ) in steps of + ``NINC`` (defaults to 1). If ``NLOC1`` = ALL, ``NLOC2`` and ``NINC`` are ignored and stresses + for all locations are listed. + + ninc : str + List stresses from ``NLOC1`` (defaults to 1) to ``NLOC2`` (defaults to ``NLOC1`` ) in steps of + ``NINC`` (defaults to 1). If ``NLOC1`` = ALL, ``NLOC2`` and ``NINC`` are ignored and stresses + for all locations are listed. + + nev : str + Event number for stress listing (defaults to ALL). + + nlod : str + Loading number for stress listing (defaults to ALL). + + Notes + ----- + + .. _FSLIST_notes: + + Stresses may be listed per location, per event, per loading, or per stress condition. Use FELIST and + FLLIST if only event and location parameters (no stresses) are to be listed. + + .. warning:: + + This command is archived in the latest version of the software. + + """ + command = f"FSLIST,{nloc1},{nloc2},{ninc},{nev},{nlod}" + return self.run(command, **kwargs) + + def fsnode(self, node: str = "", nev: str = "", nlod: str = "", **kwargs): + r"""Calculates and stores the stress components at a node for fatigue. + + Mechanical APDL Command: `FSNODE `_ + + Parameters + ---------- + node : str + Node number for which stress components are stored. + + nev : str + Event number to be associated with these stresses (defaults to 1). + + nlod : str + Loading number to be associated with these stresses (defaults to 1). + + Notes + ----- + + .. _FSNODE_notes: + + Calculates and stores the total stress components at a specified node for fatigue. Stresses are + stored according to the event number and loading number specified. The location is associated with + that previously defined for this node (FL) or else it is automatically defined. Stresses are stored + as six total components (SX through SYZ). Temperature and current time are also stored along with + the total stress components. Calculations are made from the stresses currently in the database (last + :ref:`set` or :ref:`lcase` command). Stresses stored are in global Cartesian coordinates, regardless + of the active results coordinate system ( :ref:`rsys` ). + + You can issue the FSLIST command to list stresses, and the FS command to modify stored stresses. + + .. warning:: + + This command is archived in the latest version of the software. + + """ + command = f"FSNODE,{node},{nev},{nlod}" + return self.run(command, **kwargs) + + def fsplot(self, nloc: str = "", nev: str = "", item: int | str = "", **kwargs): + r"""Displays a fatigue stress item for a fatigue location and event. + + Mechanical APDL Command: `FSPLOT `_ + + Parameters + ---------- + nloc : str + Display stresses associated with location ``NLOC``. + + nev : str + Display stresses associated with event ``NEV``. + + item : int or str + Display stresses associated with item number ``ITEM``. Items are as follows: + + * ``1-6`` - SX, SY, SZ, SXY, SYZ, SXZ total stress components + + * ``7`` - Temperature + + * ``8-13`` - SX, SY, SZ, SXY, SYZ, SXZ membrane-plus-bending stress components. + + * ``14`` - Time + + Notes + ----- + + .. _FSPLOT_notes: + + Displays a fatigue stress item as a function of loading number for a particular fatigue location and + event. + + .. warning:: + + This command is archived in the latest version of the software. + + """ + command = f"FSPLOT,{nloc},{nev},{item}" + return self.run(command, **kwargs) + + def ftcalc(self, nloc: str = "", node: str = "", **kwargs): + r"""Performs fatigue calculations for a given node location. + + Mechanical APDL Command: `FTCALC `_ + + Parameters + ---------- + nloc : str + Location number of stress conditions to be used for fatigue calculation. + + node : str + Node number (used only for convenience if ``NLOC`` is not input). + + Notes + ----- + + .. _FTCALC_notes: + + No additional usage notes are available for this command. + + .. warning:: + + This command is archived in the latest version of the software. + + """ + command = f"FTCALC,{nloc},{node}" + return self.run(command, **kwargs) + + def ftsize(self, mxloc: str = "", mxev: str = "", mxlod: str = "", **kwargs): + r"""Defines the fatigue data storage array. + + Mechanical APDL Command: `FTSIZE `_ + + Parameters + ---------- + mxloc : str + Maximum number of fatigue locations (defaults to 5). + + mxev : str + Maximum number of fatigue events (defaults to 10). + + mxlod : str + Maximum number of loadings in each event (defaults to 3). + + Notes + ----- + + .. _FTSIZE_notes: + + Defines the size and erases the stress conditions for the fatigue data storage array. A stress + condition is a loading (stresses) at a particular location (node) for a particular event. Size is + defined in terms of the maximum number of locations, events, and loadings. The array size cannot be + changed once data storage has begun (without erasing all previously stored data). If a size change + is necessary, see the :ref:`ftwrite` command. + + .. warning:: + + This command is archived in the latest version of the software. + + """ + command = f"FTSIZE,{mxloc},{mxev},{mxlod}" + return self.run(command, **kwargs) + + def ftwrite(self, fname: str = "", ext: str = "", **kwargs): + r"""Writes all currently stored fatigue data on a file. + + Mechanical APDL Command: `FTWRITE `_ + + Parameters + ---------- + fname : str + File name (defaults to :file:`Jobname` ). + + ext : str + File name extension (defaults to FATG if ``Fname`` ). + + Notes + ----- + + .. _FTWRITE_notes: + + Data are written in terms of the equivalent POST1 fatigue commands (FTSIZE, FL, FS, etc.) which you + can then edit and resubmit to POST1 (via the :ref:`input` command). + + After you have created a fatigue data file, each subsequent use of the FTWRITE command overwrites + the contents of that file. + + .. warning:: + + This command is archived in the latest version of the software. + + """ + command = f"FTWRITE,{fname},{ext}" + return self.run(command, **kwargs) diff --git a/src/ansys/mapdl/core/_commands/post1/_special_purpose.py b/src/ansys/mapdl/core/_commands/post1/_special_purpose.py new file mode 100644 index 00000000000..9f75a31c24d --- /dev/null +++ b/src/ansys/mapdl/core/_commands/post1/_special_purpose.py @@ -0,0 +1,154 @@ +# Copyright (C) 2016 - 2025 ANSYS, Inc. and/or its affiliates. +# SPDX-License-Identifier: MIT +# +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to deal +# in the Software without restriction, including without limitation the rights +# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +# copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in all +# copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +# SOFTWARE. + + +class SpecialPurpose: + + def kcalc( + self, + kplan: int | str = "", + mat: str = "", + kcsym: int | str = "", + klocpr: int | str = "", + **kwargs, + ): + r"""Calculates stress intensity factors in fracture mechanics analyses. + + Mechanical APDL Command: `KCALC `_ + + Parameters + ---------- + kplan : int or str + Key to indicate stress state for calculation of stress intensity factors: + + * ``0`` - Plane strain and axisymmetric condition (default). + + * ``1`` - Plane stress condition. + + mat : str + Material number used in the extrapolation (defaults to 1). + + kcsym : int or str + Symmetry key: + + * ``0 or 1`` - Half-crack model with symmetry boundary conditions ( :ref:`dsym` ]) in the crack-tip + coordinate system. K:sub:`II` = K:sub:`III` = 0. Three nodes are required on the path. + + * ``2`` - Like 1 except with antisymmetric boundary conditions (K:sub:`I` = 0). + + * ``3`` - Full-crack model (both faces). Five nodes are required on the path (one at the tip and two + on each face). + + klocpr : int or str + Local displacements print key: + + * ``0`` - Do not print local crack-tip displacements. + + * ``1`` - Print local displacements used in the extrapolation technique. + + Notes + ----- + + .. _KCALC_notes: + + Calculates the stress intensity factors (K:sub:`I`, K:sub:`II`, and K:sub:`III` ) associated with + homogeneous isotropic linear elastic fracture mechanics. + + A displacement extrapolation method is used in the calculation. (See `POST1 - Crack Analysis (KCALC) + `_ + ``KPLAN`` = 1. + + The program uses minor Poisson's ratio ( :ref:`mp`,NUXY) for the stress intensity factor + calculation. + + Issue the :ref:`path` and :ref:`ppath` commands to define a path with the crack face nodes ( + ``NODE1`` at the crack tip, ``NODE2`` and ``NODE3`` on one face, ``NODE4`` and ``NODE5`` on the + other (optional) face). + + A crack-tip coordinate system, having x parallel to the crack face (and perpendicular to the crack + front) and y perpendicular to the crack face, must be the active :ref:`rsys` and :ref:`csys` before + :ref:`kcalc` is issued. + + .. warning:: + + This command is archived in the latest version of the software. + + """ + command = f"KCALC,{kplan},{mat},{kcsym},{klocpr}" + return self.run(command, **kwargs) + + def plcrack(self, loc: int | str = "", num: int | str = "", **kwargs): + r"""Displays cracking and crushing locations in `SOLID65 + `_ + elements. + + Mechanical APDL Command: `PLCRACK `_ + + Parameters + ---------- + loc : int or str + Location at which symbols are to be displayed: + + * ``0`` - Plot symbols at integration points (default). + + * ``1`` - Plot symbol at element centroids (averaged). + + num : int or str + Crack to be displayed: + + * ``0`` - Plot all cracks (default). + + * ``1`` - Plot only the first crack. + + * ``2`` - Plot only the second crack. + + * ``3`` - Plot only the third crack. + + Notes + ----- + + .. _PLCRACK_notes: + + :ref:`plcrack` displays circles at locations of cracking or crushing in concrete elements. Cracking + is shown with a circle outline in the plane of the crack, and crushing is shown with an octahedron + outline. If the crack has opened and then closed, the circle outline will have an X through it. Each + integration point can crack in up to three different planes. The first crack at an integration point + is shown with a red circle outline, the second crack with a green outline, and the third crack with + a blue outline. + + Symbols shown at the element centroid ( ``LOC`` = 1) are based on the status of all of the element's + integration points. If any integration point in the element has crushed, the crushed (octahedron) + symbol is shown at the centroid. If any integration point has cracked or cracked and closed, the + cracked symbol is shown at the element centroid. If at least five integration points have cracked + and closed, the cracked and closed symbol is shown at the element centroid. Finally, if more than + one integration point has cracked, the circle outline at the element centroid shows the average + orientation of all cracked planes for that element. + + Portions of this command are not supported by PowerGraphics ( :ref:`graphics`,POWER). + + .. warning:: + + This command is archived in the latest version of the software. + + """ + command = f"PLCRACK,{loc},{num}" + return self.run(command, **kwargs) diff --git a/src/ansys/mapdl/core/_commands/post1/animation.py b/src/ansys/mapdl/core/_commands/post1/animation.py new file mode 100644 index 00000000000..20f72067a07 --- /dev/null +++ b/src/ansys/mapdl/core/_commands/post1/animation.py @@ -0,0 +1,758 @@ +# Copyright (C) 2016 - 2025 ANSYS, Inc. and/or its affiliates. +# SPDX-License-Identifier: MIT +# +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to deal +# in the Software without restriction, including without limitation the rights +# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +# copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in all +# copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +# SOFTWARE. + + +class Animation: + + def ancntr(self, nfram: str = "", delay: str = "", ncycl: str = "", **kwargs): + r"""Produces an animated sequence of a contoured deformed shape. + + Mechanical APDL Command: `ANCNTR `_ + + Parameters + ---------- + nfram : str + Number of frames captures (defaults to 5). + + delay : str + Time delay during animation (defaults to 0.1 seconds). + + ncycl : str + Number of animation cycles (defaults to 5). Available in non-UI mode only. + + Notes + ----- + + .. _ANCNTR_notes: + + :ref:`ancntr` involves a Mechanical APDL macro which produces an animation of a contoured deformed + shape of + the last plot action command. This command operates only on graphic display platforms supporting the + :ref:`seg` command. After executing :ref:`ancntr`, you can replay the animated sequence by issuing + the :ref:`anim` command. + + The command functions only in the postprocessor. + """ + command = f"ANCNTR,{nfram},{delay},{ncycl}" + return self.run(command, **kwargs) + + def ancut( + self, + nfram: str = "", + delay: str = "", + ncycl: str = "", + qoff: str = "", + ktop: str = "", + topoff: str = "", + node1: str = "", + node2: str = "", + node3: str = "", + **kwargs, + ): + r"""Produces an animated sequence of Q-slices. + + Mechanical APDL Command: `ANCUT `_ + + Parameters + ---------- + nfram : str + Number of frames captures (defaults to 5). + + delay : str + Time delay during animation (defaults to 0.1 seconds). + + ncycl : str + Number of animation cycles (defaults to 5). Available in non-UI mode only. + + qoff : str + Q-slice working plane increment (defaults to.1 half screens). + + ktop : str + Topological effect on or off (YES or NO; default is NO). + + topoff : str + Topological offset (default is.1 half screens). + + node1 : str + Node 1 for start of the Q-slice. + + node2 : str + Node 2 for direction of the Q-slice. + + node3 : str + Node 3 for plane of the Q-slice. + + Notes + ----- + + .. _ANCUT_notes: + + :ref:`ancut` involves a Mechanical APDL macro which produces an animation of Q-slices of the last + plot + action command. This command operates only on graphic display platforms supporting the :ref:`seg` + command. After executing :ref:`ancut`, you can replay the animated sequence by issuing the + :ref:`anim` command. + + The command functions only in the postprocessor. + """ + command = f"ANCUT,{nfram},{delay},{ncycl},{qoff},{ktop},{topoff},{node1},{node2},{node3}" + return self.run(command, **kwargs) + + def ancyc( + self, numframes: str = "", kcycl: int | str = "", delay: str = "", **kwargs + ): + r"""Applies a traveling wave animation to graphics data in a modal cyclic symmetry analysis. + + Mechanical APDL Command: `ANCYC `_ + + **Command default:** + + .. _ANCYC_default: + + The default :ref:`ancyc` command (issuing the command with no arguments) specifies these implicit + argument values: :ref:`ancyc`, 18, 0, 0.1 + + Parameters + ---------- + numframes : str + The number of plot frames for the animation. Valid values range from 5 through 36. The default + is 18. A low value (because it specifies fewer graphical frames) produces a rougher animation + but loads faster. A high value produces a smoother animation but requires more time to load. + + kcycl : int or str + The animation mode: + + * ``0`` - Continuous animation cycle (forward-reverse-forward). + + * ``1`` - Discontinuous animation cycle (forward-reset-forward). This option is the default. + + + + delay : str + The time delay (in seconds) between animation frames. Valid values range from 0.1 through 1.0. + The default is 0.1 seconds, which produces a seemingly real-time animation. A higher value + produces a slower animation. + + Notes + ----- + + .. _ANCYC_notes: + + The :ref:`ancyc` command is valid in a `modal cyclic symmetry analysis + `_ + only. + + The command animates the cyclic symmetry mode shape plot in the General Post Processor ( + :ref:`post1` ). When you issue a nodal- or element-results plot command (for example, :ref:`plnsol`, + :ref:`plesol`, or :ref:`pldisp` ) and then issue the :ref:`ancyc` command, Mechanical APDL applies a + traveling wave animation to the mode shape plot. + + Each frame of the animation is created by expanding the cyclic symmetry mode shape at increasing + phase angles (via the :ref:`cycexpand` command) starting at zero in equal increments over 360°. The + phase-angle increment is 360 / ``NUMFRAMES``. + + The animation display shows the traveling wave of the result quantity being plotted. The traveling + wave animation is applicable only to nodal diameters (harmonic indices) greater than 0 and less than + ``N`` / 2 (where ``N`` is the number of cyclic sectors in the model). + + For more information, see `Applying a Traveling Wave Animation to the Cyclic Model + `_ + in the `Cyclic Symmetry Analysis Guide + `_. + """ + command = f"ANCYC,{numframes},{kcycl},{delay}" + return self.run(command, **kwargs) + + def andata( + self, + delay: str = "", + ncycl: str = "", + rsltdat: int | str = "", + min_: str = "", + max_: str = "", + incr: str = "", + frclst: str = "", + autocont: str = "", + autocntr: str = "", + **kwargs, + ): + r"""Displays animated graphics data for nonlinear problems. + + Mechanical APDL Command: `ANDATA `_ + + Parameters + ---------- + delay : str + Time delay during animation (defaults to 0.5 seconds). + + ncycl : str + Number of animation cycles (defaults to 5). Available in non-UI mode only. + + rsltdat : int or str + The type of results data to be used for the animation sequence. This can be: + + * ``0`` - Current load step data (default). + + * ``1`` - Range of load step data. + + * ``2`` - Range of results data. + + min_ : str + The range minimum value. If left blank or 0, defaults to the first data point. + + max_ : str + The range maximum value. If left blank or 0, defaults to the last data point. + + incr : str + The increment between result data (defaults to 1). + + frclst : str + Key to force the last sub step in a selected load step to be included in the animation (defaults + to 0). + + autocont : str + A value of 1 enables automatic scaling of contour values based on the overall subset range of + values. The default value is 0 (no automatic scaling). + + autocntr : str + A value of 1 disables automatic centering of displaced plots. The default value is 0 (allow + automatic centering). + + Notes + ----- + + .. _ANDATA_notes: + + Use the :ref:`andata` command to create animations for nonlinear problems. The command works by + displaying an individual graphical image for each result data set from the results file. For + information about creating animations for linear problems, see the :ref:`anim` command. + + The command operates only on graphic display platforms supporting the :ref:`seg` command. It uses a + macro to produce an animation based on the last plot action command (for example, :ref:`pldisp` ). + + The results file must have more than one set of results. + + The command implicitly issues :ref:`slashdscale`, 1 for default displacement scaling. Large + displacements may not give good results. + + + This command functions only in the postprocessor. + """ + command = f"ANDATA,{delay},{ncycl},{rsltdat},{min_},{max_},{incr},{frclst},{autocont},,{autocntr}" + return self.run(command, **kwargs) + + def andscl(self, nfram: str = "", delay: str = "", ncycl: str = "", **kwargs): + r"""Produces an animated sequence of a deformed shape. + + Mechanical APDL Command: `ANDSCL `_ + + Parameters + ---------- + nfram : str + Number of frames captured (defaults to 5). + + delay : str + Time delay during animation (defaults to 0.1 seconds). + + ncycl : str + Number of animation cycles (defaults to 5). Available in non-UI mode only. + + Notes + ----- + + .. _ANDSCL_notes: + + :ref:`andscl` involves a Mechanical APDL macro which produces an animation of displacement of the + last plot + action command (for example, :ref:`pldisp` ). This command operates only on graphic display + platforms supporting the :ref:`seg` command. After executing :ref:`andscl`, you can replay the + animated sequence by issuing the :ref:`anim` command. + + The command functions only in the postprocessor. + """ + command = f"ANDSCL,{nfram},{delay},{ncycl}" + return self.run(command, **kwargs) + + def andyna( + self, + delay: str = "", + ncycl: str = "", + start: str = "", + end: str = "", + inc: str = "", + autocontourkey: str = "", + **kwargs, + ): + r"""Produces an animated sequence of contour values through substeps. + + Mechanical APDL Command: `ANDYNA `_ + + Parameters + ---------- + delay : str + Time delay during animation (defaults to 0.1 seconds). + + ncycl : str + Number of animation cycles (defaults to 5). Available in non-UI mode only. + + start : str + Number of the starting substep (defaults to 1). + + end : str + Number of the ending substep (defaults to the maximum substep). + + inc : str + Increment between substeps (defaults to 1). + + autocontourkey : str + Auto-scales contour values, based on the overall subset range of values (defaults to 0, no auto- + scaling). + + Notes + ----- + + .. _ANDYNA_notes: + + :ref:`andyna` involves a Mechanical APDL macro which produces an animation of contour values through + all + the substeps of the last plot action command. This command operates only on graphic display + platforms supporting the :ref:`seg` command. After executing :ref:`andyna`, you can replay the + animated sequence by issuing :ref:`anim`. + + The command functions only in the postprocessor. + """ + command = f"ANDYNA,{delay},{ncycl},{start},{end},{inc},{autocontourkey}" + return self.run(command, **kwargs) + + def anfile(self, lab: str = "", fname: str = "", ext: str = "", **kwargs): + r"""Saves or resumes an animation sequence to or from a file. + + Mechanical APDL Command: `/ANFILE `_ + + Parameters + ---------- + lab : str + Label type. + + * ``SAVE`` - Save the current animation to a file. + + * ``RESUME`` - Resume an animation from a file. + + 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 :file:`Jobname`. + + ext : str + Filename extension (eight-character maximum). The extension defaults to ANIM if ``Fname`` is + blank. + + Notes + ----- + + .. _s-ANFILE_notes: + + This command saves an animation to a file from local terminal segments or resumes an animation from + a file to local terminal segments. See the :ref:`seg` command for details on segment storage. See + the :ref:`ancntr` macro for a convenient method of storing graphics frames in terminal memory + segments. This command is device dependent and is valid in any processor. + """ + command = f"/ANFILE,{lab},{fname},{ext}" + return self.run(command, **kwargs) + + def anflow( + self, + nfram: str = "", + delay: str = "", + ncycl: str = "", + time: str = "", + spacing: str = "", + size: str = "", + length: str = "", + **kwargs, + ): + r"""Produces an animated sequence of a charged particle traveling in an electric or magnetic field. + + Mechanical APDL Command: `ANFLOW `_ + + Parameters + ---------- + nfram : str + Number of frames captured (defaults to 5). + + delay : str + Time delay during animation (defaults to 0.1 seconds). + + ncycl : str + Number of animation cycles (defaults to 5). Non-UI mode only. + + time : str + Total Trace Time (seconds) (defaults to 0, which is the full flow trace). + + spacing : str + Particle spacing in seconds (defaults to 0). + + size : str + Particle size (defaults to 0, which is a line). + + length : str + Particle length fraction (defaults to.1). + + Notes + ----- + + .. _ANFLOW_notes: + + :ref:`anflow` invokes a Mechanical APDL macro which produces an animation of charged particle motion + in an + electric or magnetic field by the last plot action command (that is, :ref:`pltrac` ). This command + is only operational on graphic display platforms supporting the :ref:`seg` command. After executing + :ref:`anflow`, you can replay the animated sequence by issuing the :ref:`anim` command. This command + is functional only in the Postprocessor. + + The ``TIME`` option lets you set the time interval of forward travel for the trace. The ``SPACING`` + option is used to define the particle spacing in seconds from adjacent particles in the stream line. + The ``SIZE`` variable sets the radius of the particle. The ``LENGTH`` variable is used to define the + particle length fraction. By default, the ``LENGTH`` is set to.1, which means the particle occupies + 10% of the trace region and the other 90% is a color-code line. The ``SPACING`` and ``LENGTH`` + variables only make sense when the ``SIZE`` variable is nonzero (that is, the particle is bigger + than the line). + """ + command = f"ANFLOW,{nfram},{delay},{ncycl},{time},{spacing},{size},{length}" + return self.run(command, **kwargs) + + def anharm( + self, + nfram: str = "", + delay: str = "", + ncycl: str = "", + nperiod: str = "", + cms_antype: str = "", + cms_modopt: str = "", + **kwargs, + ): + r"""Produces an animated sequence of time-harmonic results or complex mode shapes. + + Mechanical APDL Command: `ANHARM `_ + + Parameters + ---------- + nfram : str + Number of frame captures per cycle. Defaults to 12. + + delay : str + Time delay (seconds) during animation. Defaults to 0.1 seconds. + + ncycl : str + Number of animation cycles. Defaults to 5. Not available in the GUI. + + nperiod : str + Period number for the second set of frames showing the decay or growth of a mode shape. Only + applies to complex mode shape animation. Defaults to 1, animating the decay or growth on the + first period. Issue -1 to animate without decay or growth. + + cms_antype : str + Analysis type performed in the CMS use pass. No default. + + * ``MODAL`` - Modal analysis + + * ``HARMIC`` - Harmonic analysis + + cms_modopt : str + Mode extraction method selected in the CMS use pass. No default. + + * ``UNSYM`` - Unsymmetric matrix + + * ``DAMP`` - Damped system + + * ``QRDAMP`` - Damped system using QR algorithm + + Notes + ----- + + .. _ANHARM_notes: + + :ref:`anharm` invokes a Mechanical APDL macro which produces an animated sequence of: + + * Time-harmonic results in the case of a harmonic analysis ( :ref:`antype`,HARMIC) + + * Complex mode shapes in the case of a modal analysis ( :ref:`antype`,MODAL). + + In both cases, the results are those of the last plot action (for example, :ref:`plnsol`,B,SUM). + + The animation converts the complex solution variables (real and imaginary sets) into time varying + results over one period. For example, if ``NFRAM`` = 12, then the frame captures are in increments + of 30 degree phase angles. + + A second set of ``NFRAM`` frames will be generated for damped eigenmodes from complex eigensolvers + to visualize any exponential decay or growth of the oscillations. The second set generated will + display frames from the period number specified by ``NPERIOD``. + + In a CMS analysis, the :ref:`anharm` command can be used after the CMS expansion pass or the use + pass. To use :ref:`anharm` after the expansion pass, you must indicate whether a modal analysis or a + harmonic analysis was performed in the CMS use pass by setting ``CMS_ANTYPE`` to either MODAL or + HARMIC. If the use pass was a modal analysis, you must also set the ``CMS_MODOPT`` field to indicate + the mode extraction method that was used (UNSYM, DAMP, or QRDAMP). If ``CMS_MODOPT`` = QRDAMP, it is + assumed that ``CPXMOD`` was set to ON in the :ref:`modopt` command to request complex eigenmodes. If + the :ref:`anharm` command is used after the use pass, it is not necessary to set the ``CMS_ANTYPE`` + or ``CMS_MODOPT`` arguments. + + For more information about complex results postprocessing, see `POST1 and POST26 - Complex Results + Postprocessing + `_ + """ + command = f"ANHARM,{nfram},{delay},{ncycl},{nperiod},{cms_antype},{cms_modopt}" + return self.run(command, **kwargs) + + def anim(self, ncycl: str = "", kcycl: int | str = "", delay: str = "", **kwargs): + r"""Displays animated graphics data for linear problems. + + Mechanical APDL Command: `ANIM `_ + + Parameters + ---------- + ncycl : str + Number of cycles associated with the animation (defaults to 5 in non-GUI mode only) + + kcycl : int or str + Animation mode: + + * ``0`` - Continuous animation cycle (forward-reverse-forward-etc.) (default). + + * ``1`` - Discontinuous animation cycle (forward-reset-forward-etc.). + + delay : str + Time delay (seconds) between animation frames (defaults to 0.1 seconds). + + Notes + ----- + + .. _ANIM_notes: + + Use the :ref:`anim` command to create animations for linear problems only. The command uses the + currently displayed picture based on one particular data set from the results file, and linearly + interpolates that data into different sets, displaying pictures of each interpolated data set in + sequence to create animation. For information about creating animations for nonlinear problems, see + the :ref:`andata` command. + + This command is device-dependent. + + + Do not resize the graphic while animation is in progress; doing so can result in distorted plots. + + For more information, see the :ref:`seg` command for details about segment storage, and the + :ref:`ancntr` macro for a convenient method of storing graphics frames in terminal memory segments. + + This command is valid in any processor. + """ + command = f"ANIM,{ncycl},{kcycl},{delay}" + return self.run(command, **kwargs) + + def anisos(self, nfram: str = "", delay: str = "", ncycl: str = "", **kwargs): + r"""Produces an animated sequence of an isosurface. + + Mechanical APDL Command: `ANISOS `_ + + Parameters + ---------- + nfram : str + Number of frames captures (defaults to 9). + + delay : str + Time delay during animation (defaults to 0.1 seconds). + + ncycl : str + Number of animation cycles (defaults to 5). Available in non-UI mode only. + + Notes + ----- + + .. _ANISOS_notes: + + :ref:`anisos` invokes a Mechanical APDL macro which produces an animation of an isosurface of the + last plot + action command (for example, :ref:`plnsol`,S,EQV). The :ref:`anisos` command operates only on + graphic display platforms supporting the :ref:`seg` command. After executing :ref:`anisos`, you can + replay the animated sequence by issuing the :ref:`anim` command. + + This command functions only in the postprocessor. + """ + command = f"ANISOS,{nfram},{delay},{ncycl}" + return self.run(command, **kwargs) + + def anmode( + self, + nfram: str = "", + delay: str = "", + ncycl: str = "", + kaccel: int | str = "", + **kwargs, + ): + r"""Produces an animated sequence of a mode shape. + + Mechanical APDL Command: `ANMODE `_ + + Parameters + ---------- + nfram : str + Number of frames captures (defaults to 5). + + delay : str + Time delay during animation (defaults to 0.1 seconds). + + ncycl : str + Number of animation cycles (defaults to 5). Available in non-UI mode only. + + kaccel : int or str + Acceleration type: + + * ``0`` - Linear acceleration. + + * ``1`` - Sinusoidal acceleration. + + Notes + ----- + + .. _ANMODE_notes: + + :ref:`anmode` invokes a Mechanical APDL macro which produces an animation of mode shape of the last + plot + action command (for example, :ref:`pldisp` ). The :ref:`anmode` command operates only on graphic + display platforms supporting the :ref:`seg` command. After executing :ref:`anmode`, you can replay + the animated sequence by issuing the :ref:`anim` command. + + This command functions only in the postprocessor. + """ + command = f"ANMODE,{nfram},{delay},{ncycl},{kaccel}" + return self.run(command, **kwargs) + + def antime( + self, + nfram: str = "", + delay: str = "", + ncycl: str = "", + autocntrky: str = "", + rsltdat: int | str = "", + min_: str = "", + max_: str = "", + **kwargs, + ): + r"""Generates a sequential contour animation over a range of time. + + Mechanical APDL Command: `ANTIME `_ + + Parameters + ---------- + nfram : str + Number of frame captures (defaults to 5). + + delay : str + Time delay during animation (defaults to 0.1 seconds). + + ncycl : str + Number of animation cycles (defaults to 5). Available in non-UI mode only. + + autocntrky : str + Auto-scales contour values, based on the overall subset range of values. The auto-scaling option + defaults to 0, no auto-scaling. + + rsltdat : int or str + The results data to be used for the animation sequence. This can be: + + * ``0`` - Current load step data (default). + + * ``1`` - Range of load step data. + + * ``2`` - Range of time data. + + min_ : str + The range minimum value. If left blank defaults to the first data point. + + max_ : str + The range maximum value. If left blank defaults to the last data point. + + Notes + ----- + + .. _ANTIME_notes: + + The :ref:`antime` command operates only on graphic display platforms supporting the :ref:`seg` + command. It uses a Mechanical APDL macro to produce an animation of contour values for the last plot + action + command (for example, :ref:`pldisp` ). After executing :ref:`antime`, the :ref:`anim` command + replays the animated sequence. + + This command functions only in the postprocessor. + """ + command = f"ANTIME,{nfram},{delay},{ncycl},{autocntrky},{rsltdat},{min_},{max_}" + return self.run(command, **kwargs) + + def trtime( + self, + time: str = "", + spacing: str = "", + offset: str = "", + size: str = "", + length: str = "", + **kwargs, + ): + r"""Defines the options used for the :ref:`pltrac` (charged particle trace) command. + + Mechanical APDL Command: `TRTIME `_ + + Parameters + ---------- + time : str + Total Trace Time (seconds) (defaults to 0, which is the full particle trace). + + spacing : str + Particle spacing in seconds (defaults to 0). + + offset : str + Particle offset in seconds (defaults to 0). It is used internally in the :ref:`anflow` macro to + produce an animation of charged particle motion in an electric or magnetic field. + + size : str + Particle size (defaults to 0, which is a line). + + length : str + Particle length fraction (defaults to.1). + + Notes + ----- + + .. _TRTIME_notes: + + The :ref:`trtime` command varies the type of :ref:`pltrac` display produced. Charged particle traces + follow a particle's path in the forward and backward direction of travel. The DOF selected + determines the color of the particle trace. ``SPACING`` defines the particle spacing in seconds from + adjacent particles in the stream line. ``OFFSET`` defines the offset in seconds from the spacing set + by the ``SPACING`` argument. + + ``LENGTH`` defines the particle length fraction. The default value (.1), means the particle occupies + 10% of the trace region, and the other 90% is a color-coded line. + + ``SIZE`` sets the radius of the particle. Use ``SPACING``, ``OFFSET`` and ``LENGTH`` only when + ``SIZE`` is nonzero (that is, the particle is bigger than the line). + """ + command = f"TRTIME,{time},{spacing},{offset},{size},{length}" + return self.run(command, **kwargs) diff --git a/src/ansys/mapdl/core/_commands/post1/controls.py b/src/ansys/mapdl/core/_commands/post1/controls.py new file mode 100644 index 00000000000..bb4e1c25cd8 --- /dev/null +++ b/src/ansys/mapdl/core/_commands/post1/controls.py @@ -0,0 +1,976 @@ +# Copyright (C) 2016 - 2025 ANSYS, Inc. and/or its affiliates. +# SPDX-License-Identifier: MIT +# +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to deal +# in the Software without restriction, including without limitation the rights +# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +# copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in all +# copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +# SOFTWARE. + + +class Controls: + + def avprin(self, key: int | str = "", effnu: str = "", **kwargs): + r"""Specifies how principal and vector sums are to be calculated. + + Mechanical APDL Command: `AVPRIN `_ + + **Command default:** + + .. _AVPRIN_default: + + Average components at common node before principal or vector sum calculation except for the von + Mises equivalent strain (EQV), see below. + + Parameters + ---------- + key : int or str + Averaging key: + + * ``0`` - Average the component values from the elements at a common node, then calculate the + principal or vector sum from the averaged components (default). + + * ``1`` - Calculate the principal or vector sum values on a per element basis, then average these + values from the elements at a common node. + + effnu : str + Effective Poisson's ratio used for computing the von Mises equivalent strain (EQV). This command + option is intended for use with line elements or in load case operations ( :ref:`lcoper` ); the + program automatically selects the most appropriate effective Poisson's ratio, as discussed + below. + + Notes + ----- + + .. _AVPRIN_notes: + + Selects the method of combining components for certain derived nodal results when two or more + elements connect to a common node. The methods apply to the calculations of derived nodal principal + stresses, principal strains, and vector sums for selects, sorts, and output ( :ref:`nsel`, + :ref:`nsort`, :ref:`prnsol`, :ref:`plnsol`, etc.). The calculation of these nodal results excludes + beam and pipe elements. + + This command also defines the effective Poisson's ratio ( ``EFFNU`` ) used for equivalent strain + calculations. If you use ``EFFNU``, the default effective Poisson's ratios shown below will be + overridden for all elements by the ``EFFNU`` value. To return to the default settings, issue the + :ref:`reset` command. The default value for ``EFFNU`` is: + + * Poisson's ratio as defined on the :ref:`mp` commands for EPEL and EPTH + + * 0.5 for EPPL and EPCR + + * 0.5 if the referenced material is hyperelastic + + * 0.0 for line elements (includes beam, link, and pipe elements, as well as discrete elements), + `cyclic symmetry analysis + `_, mode + superposition analyses (with ``MSUPkey`` = YES on the :ref:`mxpand` command), and load case + operations ( :ref:`lcoper` ). + + * For multistage analysis, a value of ``EFFNU`` must always be specified. + + If ``EFFNU`` is specified, the calculation of von Mises equivalent strain (EQV) is performed + according to the ``KEY`` setting. However, if ``EFFNU`` is not specified, or if the :ref:`avprin` + command is not issued, the von Mises equivalent strain is calculated using the average of the + equivalent strains from the elements at a common node (behavior of ``KEY`` =1) irrespective of the + value of the averaging KEY. + + For a random vibration (PSD) analysis (for more details, see `Review the Results + `_ + + * Issuing either :ref:`avprin`,0 or :ref:`avprin`,1 calculates the principal stresses using the + appropriate averaging method. They are then used to determine SEQV. The output will have non-zero + values for the principal stresses. + + * If :ref:`avprin` is not issued, the Segalman-Fulcher method is used to calculate SEQV. This method + does not calculate principal stresses, but directly calculates SEQV from the component stresses; + therefore, the output will have zero values for the principal stresses. + + This command is also valid in POST26, where applicable. + + See `Combined Stresses and Strains + `_ + """ + command = f"AVPRIN,{key},{effnu}" + return self.run(command, **kwargs) + + def avres(self, key: int | str = "", opt: str = "", **kwargs): + r"""Specifies how results data will be averaged when PowerGraphics is enabled. + + Mechanical APDL Command: `AVRES `_ + + Parameters + ---------- + key : int or str + Averaging key. + + * ``1`` - Average results at all common subgrid locations. + + * ``2`` - Average results at all common subgrid locations except where material type ( :ref:`mat` ) + discontinuities exist. (Default.) + + * ``3`` - Average results at all common subgrid locations except where real constant ( :ref:`real` ) + discontinuities exist. + + * ``4`` - Average results at all common subgrid locations except where material type ( :ref:`mat` ) + or real constant ( :ref:`real` ) discontinuities exist. + + opt : str + Option to determine how results data are averaged. + + * ``(blank)`` - Average surface results data using only the exterior element faces (default). + + * ``FULL`` - Average surface results data using the exterior face and interior element data. + + Notes + ----- + + .. _AVRES_notes: + + The :ref:`avres` command specifies how results data will be averaged at subgrid locations that are + common to 2 or more elements. The command is valid only when PowerGraphics is enabled (via the + :ref:`graphics`,POWER command). + + With PowerGraphics active ( :ref:`graphics`,POWER), the averaging scheme for surface data with + interior element data included ( :ref:`avres`,,FULL) and multiple facets per edge ( :ref:`efacet` + ,2 or :ref:`efacet`,4) will yield differing minimum and maximum contour values depending on the + Z-Buffering options ( :ref:`slashtype`,,6 or :ref:`slashtype`,,7). When the Section data is not + included in the averaging schemes ( :ref:`slashtype`,,7), the resulting absolute value for the + midside node is significantly smaller. + + PowerGraphics does not average your stresses across discontinuous surfaces. The normals for various + planes and facets are compared to a tolerance to determine continuity. The ``ANGLE`` value you + specify in the :ref:`edge` command is the tolerance for classifying surfaces as continuous or + "coplanar." + + The command affects nodal solution contour plots ( :ref:`plnsol` ), nodal solution printout ( + :ref:`prnsol` ), and subgrid solution results accessed through the Query Results function (under + General Postprocessing) in the GUI. + + The command has no effect on the nodal degree of freedom solution values (UX, UY, UZ, TEMP, etc.). + + For cyclic symmetry mode-superposition harmonic solutions, :ref:`avres`,,FULL is not supported. + Additionally, averaging does not occur across discontinuous surfaces, and the ``ANGLE`` value on the + :ref:`edge` command has no effect. + + The section-based ( :ref:`mat` ) discontinuity in shells is accommodated via :ref:`eshape`. + + The command is also available in :ref:`slashsolu`. + """ + command = f"AVRES,{key},{opt}" + return self.run(command, **kwargs) + + def efacet(self, num: int | str = "", **kwargs): + r"""Specifies the number of facets per element edge for PowerGraphics displays. + + Mechanical APDL Command: `/EFACET `_ + + **Command default:** + + .. _s-EFACET_default: + + As stated above. + + Parameters + ---------- + num : int or str + Number of facets per element edge for element plots. + + * ``1`` - Use 1 facet per edge (default for h-elements). + + * ``2`` - Use 2 facets per edge. + + * ``4`` - Use 4 facets per edge. + + Notes + ----- + + .. _s-EFACET_notes: + + :ref:`efacet` is valid only when PowerGraphics is enabled ( :ref:`graphics`,POWER), except that it + can be used in FULL graphics mode for element ``CONTA174``. (See the :ref:`graphics` command and + element ``CONTA174`` in the `Element Reference + `_ for more + information.) The :ref:`efacet` command is only + applicable to element type displays. + + :ref:`efacet` controls the fineness of the subgrid that is used for element plots. The element is + subdivided into smaller portions called facets. Facets are piecewise linear surface approximations + of the actual element face. In their most general form, facets are warped planes in 3D space. A + greater number of facets will result in a smoother representation of the element surface for element + plots. :ref:`efacet` may affect results averaging. See `Contour Displays + `_ in the + `Basic Analysis Guide + `_ for more + information. + + For midside node elements, use ``NUM`` = 2; if ``NUM`` = 1, no midside node information is output. + For non-midside node elements, ``NUM`` should be set to 1. See the :ref:`plnsol` and :ref:`prnsol` + commands for more information. + + With PowerGraphics active ( :ref:`graphics`,POWER), the averaging scheme for surface data with + interior element data included ( :ref:`avres`,,FULL) and multiple facets per edge ( :ref:`efacet` + ,2 or :ref:`efacet`,4) will yield differing minimum and maximum contour values depending on the + Z-Buffering options ( :ref:`slashtype`,,6 or :ref:`slashtype`,,7). When the Section data is not + included in the averaging schemes ( :ref:`slashtype`,,7), the resulting absolute value for the + midside node is significantly smaller. + + For cyclic symmetry mode-superposition harmonic solutions, only ``NUM`` = 1 is supported in + postprocessing. + + .. warning:: + + If you specify /EFACET,1, PowerGraphics does not plot midside nodes. You must use /EFACET,2 to + make the nodes visible. + + This command is valid in any processor. + """ + command = f"/EFACET,{num}" + return self.run(command, **kwargs) + + def ernorm(self, key: str = "", **kwargs): + r"""Controls error estimation calculations. + + Mechanical APDL Command: `ERNORM `_ + + **Command default:** + + .. _ERNORM_default: + + Error estimation calculations are performed by default unless PowerGraphics is enabled ( + :ref:`graphics`,POWER). + + Parameters + ---------- + key : str + Control key: + + * ``ON`` - Perform error estimation (default). This option is not valid for PowerGraphics. + + * ``OFF`` - Do not perform error estimation. + + Notes + ----- + + .. _ERNORM_notes: + + Especially for thermal analyses, program speed increases if error estimation is suppressed. + Therefore, it might be desirable to use error estimation only when needed. The value of the + :ref:`ernorm` key is not saved on :file:`file.db`. Consequently, you need to reissue the + :ref:`ernorm` key after a :ref:`resume` if you wish to deactivate error estimation again. + """ + command = f"ERNORM,{key}" + return self.run(command, **kwargs) + + def force(self, lab: str = "", **kwargs): + r"""Selects the element nodal force type for output. + + Mechanical APDL Command: `FORCE `_ + + Parameters + ---------- + lab : str + Type of force to be associated with the force items: + + * ``TOTAL`` - Total forces (static, damping, and inertia). + + * ``STATIC`` - Static forces. + + * ``DAMP`` - Damping forces. + + * ``INERT`` - Inertia forces. + + Notes + ----- + + .. _FORCE_notes: + + :ref:`force` selects the element nodal force type for output with the POST1 :ref:`presol`, + :ref:`plesol`, :ref:`prrfor`, :ref:`nforce`, :ref:`fsum`, etc. commands, the POST26 :ref:`esol` + command, and reaction force plotting ( :ref:`pbc` ). For example, :ref:`force`,STATIC causes item F + of the :ref:`presol` command to be the static forces for the elements processed. Element member + forces (such as those available for beams and shells and processed by Item and Sequence number) are + not affected by this command. The SMISC records extract the static force. + + In a non-spectrum analysis that includes either contact or pretension elements in the model, the + :ref:`prrsol` command is valid with the :ref:`force` command. Otherwise, the :ref:`prrsol` command + is not valid with :ref:`force`. Use the :ref:`prrfor` command, which provides the same functionality + as :ref:`prrsol`, instead. + + Use the :ref:`force` command prior to any load case operations ( :ref:`lcoper` ) to insure the + correct element nodal force combinations. + + In POST26, the :ref:`esol` data stored is based on the active :ref:`force` specification at the time + the data is stored. To store data at various specifications (for example, static and inertia + forces), issue a :ref:`store` command before each new specification. + + The :ref:`force` command cannot be used to extract static, damping, and inertial forces for + ``MPC184`` joint elements. + + To retrieve the different force types, use the :ref:`get` command with ``Entity`` =ELEM and + ``Item1`` =EFOR. + + The :ref:`force` command is not supported in a spectrum analysis. You can specify the force type + directly on the combination method commands ( ``ForceType`` on the :ref:`psdcom`, :ref:`srss`, + :ref:`cqc`, etc. commands). + + The :ref:`force` command is not supported in a modal analysis. + """ + command = f"FORCE,{lab}" + return self.run(command, **kwargs) + + def inres( + self, + item1: str = "", + item2: str = "", + item3: str = "", + item4: str = "", + item5: str = "", + item6: str = "", + item7: str = "", + item8: str = "", + **kwargs, + ): + r"""Identifies the data to be retrieved from the results file. + + Mechanical APDL Command: `INRES `_ + + Parameters + ---------- + item1 : str + Data to be read into the database from the results file. May consist of any of the following labels: + + * ``ALL`` - All solution items (default). + + * ``BASIC`` - NSOL, RSOL, NLOAD, STRS, FGRAD, and FFLUX items. + + * ``NSOL`` - Nodal DOF solution. + + * ``RSOL`` - Nodal reaction loads. + + * ``ESOL`` - Element solution items (includes all of the following): + + * ``NLOAD`` - Element nodal loads. + + * ``STRS`` - Element nodal stresses. + + * ``EPEL`` - Element elastic strains. + + * ``EPTH`` - Element thermal, initial, and swelling strains. + + * ``EPPL`` - Element plastic strains. + + * ``EPCR`` - Element creep strains. + + * ``FGRAD`` - Element nodal gradients. + + * ``FFLUX`` - Element nodal fluxes. + + * ``MISC`` - Element miscellaneous data (SMISC and NMISC). + + * ``NAR`` - `Nodal-averaged result + `_ + items (includes all of the following): + + * ``NDST`` - Nodal-averaged stresses. + + * ``NDEL`` - Nodal-averaged elastic strains. + + * ``NDPL`` - Nodal-averaged plastic strains. + + * ``NDCR`` - Nodal-averaged creep strains. + + * ``NDTH`` - Nodal-averaged thermal and swelling strains. + + item2 : str + Data to be read into the database from the results file. May consist of any of the following labels: + + * ``ALL`` - All solution items (default). + + * ``BASIC`` - NSOL, RSOL, NLOAD, STRS, FGRAD, and FFLUX items. + + * ``NSOL`` - Nodal DOF solution. + + * ``RSOL`` - Nodal reaction loads. + + * ``ESOL`` - Element solution items (includes all of the following): + + * ``NLOAD`` - Element nodal loads. + + * ``STRS`` - Element nodal stresses. + + * ``EPEL`` - Element elastic strains. + + * ``EPTH`` - Element thermal, initial, and swelling strains. + + * ``EPPL`` - Element plastic strains. + + * ``EPCR`` - Element creep strains. + + * ``FGRAD`` - Element nodal gradients. + + * ``FFLUX`` - Element nodal fluxes. + + * ``MISC`` - Element miscellaneous data (SMISC and NMISC). + + * ``NAR`` - `Nodal-averaged result + `_ + items (includes all of the following): + + * ``NDST`` - Nodal-averaged stresses. + + * ``NDEL`` - Nodal-averaged elastic strains. + + * ``NDPL`` - Nodal-averaged plastic strains. + + * ``NDCR`` - Nodal-averaged creep strains. + + * ``NDTH`` - Nodal-averaged thermal and swelling strains. + + item3 : str + Data to be read into the database from the results file. May consist of any of the following labels: + + * ``ALL`` - All solution items (default). + + * ``BASIC`` - NSOL, RSOL, NLOAD, STRS, FGRAD, and FFLUX items. + + * ``NSOL`` - Nodal DOF solution. + + * ``RSOL`` - Nodal reaction loads. + + * ``ESOL`` - Element solution items (includes all of the following): + + * ``NLOAD`` - Element nodal loads. + + * ``STRS`` - Element nodal stresses. + + * ``EPEL`` - Element elastic strains. + + * ``EPTH`` - Element thermal, initial, and swelling strains. + + * ``EPPL`` - Element plastic strains. + + * ``EPCR`` - Element creep strains. + + * ``FGRAD`` - Element nodal gradients. + + * ``FFLUX`` - Element nodal fluxes. + + * ``MISC`` - Element miscellaneous data (SMISC and NMISC). + + * ``NAR`` - `Nodal-averaged result + `_ + items (includes all of the following): + + * ``NDST`` - Nodal-averaged stresses. + + * ``NDEL`` - Nodal-averaged elastic strains. + + * ``NDPL`` - Nodal-averaged plastic strains. + + * ``NDCR`` - Nodal-averaged creep strains. + + * ``NDTH`` - Nodal-averaged thermal and swelling strains. + + item4 : str + Data to be read into the database from the results file. May consist of any of the following labels: + + * ``ALL`` - All solution items (default). + + * ``BASIC`` - NSOL, RSOL, NLOAD, STRS, FGRAD, and FFLUX items. + + * ``NSOL`` - Nodal DOF solution. + + * ``RSOL`` - Nodal reaction loads. + + * ``ESOL`` - Element solution items (includes all of the following): + + * ``NLOAD`` - Element nodal loads. + + * ``STRS`` - Element nodal stresses. + + * ``EPEL`` - Element elastic strains. + + * ``EPTH`` - Element thermal, initial, and swelling strains. + + * ``EPPL`` - Element plastic strains. + + * ``EPCR`` - Element creep strains. + + * ``FGRAD`` - Element nodal gradients. + + * ``FFLUX`` - Element nodal fluxes. + + * ``MISC`` - Element miscellaneous data (SMISC and NMISC). + + * ``NAR`` - `Nodal-averaged result + `_ + items (includes all of the following): + + * ``NDST`` - Nodal-averaged stresses. + + * ``NDEL`` - Nodal-averaged elastic strains. + + * ``NDPL`` - Nodal-averaged plastic strains. + + * ``NDCR`` - Nodal-averaged creep strains. + + * ``NDTH`` - Nodal-averaged thermal and swelling strains. + + item5 : str + Data to be read into the database from the results file. May consist of any of the following labels: + + * ``ALL`` - All solution items (default). + + * ``BASIC`` - NSOL, RSOL, NLOAD, STRS, FGRAD, and FFLUX items. + + * ``NSOL`` - Nodal DOF solution. + + * ``RSOL`` - Nodal reaction loads. + + * ``ESOL`` - Element solution items (includes all of the following): + + * ``NLOAD`` - Element nodal loads. + + * ``STRS`` - Element nodal stresses. + + * ``EPEL`` - Element elastic strains. + + * ``EPTH`` - Element thermal, initial, and swelling strains. + + * ``EPPL`` - Element plastic strains. + + * ``EPCR`` - Element creep strains. + + * ``FGRAD`` - Element nodal gradients. + + * ``FFLUX`` - Element nodal fluxes. + + * ``MISC`` - Element miscellaneous data (SMISC and NMISC). + + * ``NAR`` - `Nodal-averaged result + `_ + items (includes all of the following): + + * ``NDST`` - Nodal-averaged stresses. + + * ``NDEL`` - Nodal-averaged elastic strains. + + * ``NDPL`` - Nodal-averaged plastic strains. + + * ``NDCR`` - Nodal-averaged creep strains. + + * ``NDTH`` - Nodal-averaged thermal and swelling strains. + + item6 : str + Data to be read into the database from the results file. May consist of any of the following labels: + + * ``ALL`` - All solution items (default). + + * ``BASIC`` - NSOL, RSOL, NLOAD, STRS, FGRAD, and FFLUX items. + + * ``NSOL`` - Nodal DOF solution. + + * ``RSOL`` - Nodal reaction loads. + + * ``ESOL`` - Element solution items (includes all of the following): + + * ``NLOAD`` - Element nodal loads. + + * ``STRS`` - Element nodal stresses. + + * ``EPEL`` - Element elastic strains. + + * ``EPTH`` - Element thermal, initial, and swelling strains. + + * ``EPPL`` - Element plastic strains. + + * ``EPCR`` - Element creep strains. + + * ``FGRAD`` - Element nodal gradients. + + * ``FFLUX`` - Element nodal fluxes. + + * ``MISC`` - Element miscellaneous data (SMISC and NMISC). + + * ``NAR`` - `Nodal-averaged result + `_ + items (includes all of the following): + + * ``NDST`` - Nodal-averaged stresses. + + * ``NDEL`` - Nodal-averaged elastic strains. + + * ``NDPL`` - Nodal-averaged plastic strains. + + * ``NDCR`` - Nodal-averaged creep strains. + + * ``NDTH`` - Nodal-averaged thermal and swelling strains. + + item7 : str + Data to be read into the database from the results file. May consist of any of the following labels: + + * ``ALL`` - All solution items (default). + + * ``BASIC`` - NSOL, RSOL, NLOAD, STRS, FGRAD, and FFLUX items. + + * ``NSOL`` - Nodal DOF solution. + + * ``RSOL`` - Nodal reaction loads. + + * ``ESOL`` - Element solution items (includes all of the following): + + * ``NLOAD`` - Element nodal loads. + + * ``STRS`` - Element nodal stresses. + + * ``EPEL`` - Element elastic strains. + + * ``EPTH`` - Element thermal, initial, and swelling strains. + + * ``EPPL`` - Element plastic strains. + + * ``EPCR`` - Element creep strains. + + * ``FGRAD`` - Element nodal gradients. + + * ``FFLUX`` - Element nodal fluxes. + + * ``MISC`` - Element miscellaneous data (SMISC and NMISC). + + * ``NAR`` - `Nodal-averaged result + `_ + items (includes all of the following): + + * ``NDST`` - Nodal-averaged stresses. + + * ``NDEL`` - Nodal-averaged elastic strains. + + * ``NDPL`` - Nodal-averaged plastic strains. + + * ``NDCR`` - Nodal-averaged creep strains. + + * ``NDTH`` - Nodal-averaged thermal and swelling strains. + + item8 : str + Data to be read into the database from the results file. May consist of any of the following labels: + + * ``ALL`` - All solution items (default). + + * ``BASIC`` - NSOL, RSOL, NLOAD, STRS, FGRAD, and FFLUX items. + + * ``NSOL`` - Nodal DOF solution. + + * ``RSOL`` - Nodal reaction loads. + + * ``ESOL`` - Element solution items (includes all of the following): + + * ``NLOAD`` - Element nodal loads. + + * ``STRS`` - Element nodal stresses. + + * ``EPEL`` - Element elastic strains. + + * ``EPTH`` - Element thermal, initial, and swelling strains. + + * ``EPPL`` - Element plastic strains. + + * ``EPCR`` - Element creep strains. + + * ``FGRAD`` - Element nodal gradients. + + * ``FFLUX`` - Element nodal fluxes. + + * ``MISC`` - Element miscellaneous data (SMISC and NMISC). + + * ``NAR`` - `Nodal-averaged result + `_ + items (includes all of the following): + + * ``NDST`` - Nodal-averaged stresses. + + * ``NDEL`` - Nodal-averaged elastic strains. + + * ``NDPL`` - Nodal-averaged plastic strains. + + * ``NDCR`` - Nodal-averaged creep strains. + + * ``NDTH`` - Nodal-averaged thermal and swelling strains. + + Notes + ----- + + .. _INRES_notes: + + Identifies the type of data to be retrieved from the results file for placement into the database + through commands such as :ref:`set`, :ref:`subset`, and :ref:`append`. :ref:`inres` is a companion + command to the :ref:`outres` command controlling data written to the database and the results file. + Since the :ref:`inres` command can only flag data that has already been written to the results file, + care should be taken when using the :ref:`outres` command to include all data you wish to retrieve + for postprocessing later on. + + The ``Item`` = ALL option includes all NAR items. For more information, see `Nodal-Averaged Results + `_ + """ + command = ( + f"INRES,{item1},{item2},{item3},{item4},{item5},{item6},{item7},{item8}" + ) + return self.run(command, **kwargs) + + def layer(self, num: str = "", **kwargs): + r"""Specifies the element layer for which data are to be processed. + + Mechanical APDL Command: `LAYER `_ + + Parameters + ---------- + num : str + Layer-processing mode: + + * ``N`` - The layer number to process. The default value is 0. + + * ``FCMAX`` - Processes the layer with the largest failure criteria. + + Notes + ----- + + .. _LAYER_notes: + + Specifies the element layer for which results data are to be listed, plotted, or otherwise + processed. + + Applies to stress and strain data for layered elements ``SHELL181``, ``SHELL281``, ``ELBOW290``, + ``SOLID185``, ``SOLID186``, ``SOLSH190``, ``SHELL208``, ``SHELL209``, ``REINF264``, and ``REINF265`` + ; heat flux and heat gradient for ``SHELL131`` and ``SHELL132``. + + For `reinforcing + `_ + elements, ``N`` is a given reinforcing member (individual reinforcing). Specifying ``N`` = 0 + (default) or ``N`` = 1 selects the first reinforcing member. + + The :ref:`shell` command can then be used (with shell elements) to specify a location (TOP, MID, + BOT) within the layer for output. (The :ref:`shell` command does not apply to thermal shell elements + ``SHELL131`` and ``SHELL132``.) Transverse shear stresses for MID are linearly averaged from TOP and + BOT, and do not reflect a parabolic distribution. Setting KEYOPT(8) = 2 for ``SHELL181``, + ``SHELL281``, ``SHELL208``, ``SHELL209``, and ``ELBOW290`` writes the mid-surface values directly to + the results file and yields more accurate values than linear averaging. + + Because energy is a per-element quantity, you cannot use this command for energy output. + + When using the :ref:`layer` command with ``SHELL181``, ``SOLID185``, ``SOLID186``, ``SOLSH190``, + ``SHELL208``, ``SHELL209``, ``SHELL281``, and ``ELBOW290``, KEYOPT(8) must be set to 1 (or 2 for + ``SHELL181``, ``SHELL281``, ``ELBOW290``, ``SHELL208``, and ``SHELL209`` ) in order to store results + for all layers. + + When ``NUM`` = FCMAX, you must provide the failure criterion input. If specifying input via the + :ref:`fc` command, all structural elements are processed. For more information, see the + documentation for the :ref:`fc` command. + + Use this command with :ref:`rsys`,LSYS to display results in the layer coordinate system for a + particular layer. + """ + command = f"LAYER,{num}" + return self.run(command, **kwargs) + + def rsys(self, kcn: int | str = "", **kwargs): + r"""Activates a coordinate system for printout or display of element and nodal results. + + Mechanical APDL Command: `RSYS `_ + + Parameters + ---------- + kcn : int or str + The coordinate system to use for results output: + + * ``0`` - Global Cartesian coordinate system (default, except for spectrum analyses). + + * ``1`` - Global cylindrical coordinate system in Z. + + * ``2`` - Global spherical coordinate system. + + * ``5`` - Global cylindrical coordinate system in Y. + + * ``6`` - Global cylindrical coordinate system in X. + + * ``> 10`` - Any existing local coordinate system. + + * ``SOLU`` - Solution coordinate systems. + + * ``LSYS`` - Layer coordinate system (default for spectrum analysis). + + Notes + ----- + + .. _RSYS_notes: + + The :ref:`rsys` command activates a coordinate system for printing or displaying element results + data such as stresses and heat fluxes, and nodal results data such as degrees of freedom and + reactions. + + Mechanical APDL rotates the results data to the specified coordinate system during printout, + display, or + element table operations (such as :ref:`prnsol`, :ref:`presol`, :ref:`plnsol`, and :ref:`etable` ). + + You can define coordinate systems with various Mechanical APDL commands such as :ref:`local`, + :ref:`cs`, + :ref:`clocal`, and :ref:`cskp`. + + The :ref:`rsys` command has no effect on beam or pipe stresses, which Mechanical APDL displays (via + :ref:`eshape`,1 and PowerGraphics) in the element coordinate system. + + Element results such as stresses and heat fluxes are in the element coordinate systems when ``KCN`` + = SOLU. Nodal requests for element results (for example, :ref:`prnsol`,S,COMP) average the element + values at the common node; that is, the orientation of the node is not a factor in the output of + element quantities. + + For nearly all solid elements, the default element coordinate systems are parallel to the global + Cartesian coordinate system. + + For shell elements and the remaining solid elements, the default element coordinate system can + differ from element to element. + + For layered shell and layered solid elements, Mechanical APDL initially selects the element + coordinate + system when ``KCN`` = SOLU. You can then select the layer coordinate system via the :ref:`layer` + command. + + Nodal results such as degrees of freedom and reactions can be properly rotated only if the resulting + component set is consistent with the degree-of-freedom set at the node. The degree-of-freedom set at + a node is determined by the elements attached to the node. + + Example: If a node does not have a UZ degree of freedom during solution, any Z component resulting + from a rotation does not print or display in POST1. Results at nodes with a single degree-of-freedom + (UY only, for example) should therefore not be rotated; that is, they should be viewed only in the + nodal coordinate system or a system parallel to the nodal system. (The default global Cartesian + system cannot be parallel to the nodal system.) + + Results at nodes with a 2D degree-of-freedom set (UX and UY, for example) should not be rotated out + of the 2D plane. + + When ``KCN`` > 10, and the specified system is subsequently redefined, reissue the :ref:`rsys` + command for results to be rotated into the redefined system. + + For element quantities, solution coordinate systems are the element coordinate system for each + element. For nodal quantities, they are the nodal coordinate systems. + + If an element or nodal coordinate system is not defined, Mechanical APDL uses the global Cartesian + coordinate system. + + If you issue a :ref:`layer`, ``N`` command (where ``N`` refers to a layer number), the results + appear in the layer coordinate system. (SOLU is the default for spectrum analyses.) + + The default coordinate system for certain elements, notably shells, is not global Cartesian and is + frequently not aligned at adjacent elements. Avoid setting ``KCN`` = SOLU with such elements, as it + can make nodal averaging of component element results (such as SX, SY, SZ, SXY, SYZ, and SXZ) + invalid. + + When post-processing expanded nodal results in a cyclic symmetry analysis ( :ref:`cycexpand` ), use + of :ref:`rsys`,SOLU is recommended so that the appropriate cyclic nodal coordinate system is used + (see :ref:`cyclic` command). For any other coordinate system (for example, :ref:`rsys`,1), cyclic + rotation is not carried out, and nodal results at all sectors are expressed in the specified + coordinate system ( ``KCN`` ). See `Result Coordinate System + `_ + + For layered shell and solid elements, the results appear in their respective layer coordinate + systems. For a specific layer of interest, issue a :ref:`layer`, ``N`` command (where ``N`` refers + to a layer number). + + If a model has both nonlayered and layered elements, you can use :ref:`rsys`,SOLU and :ref:`rsys` + ,LSYS simultaneously (with :ref:`rsys`,SOLU applicable to nonlayered elements and :ref:`rsys`,LSYS + applicable to layered elements). + + To reverse effects of the LSYS option, issue an :ref:`rsys`,0 command. + + LSYS is the default for spectrum analysis. + + Mechanical APDL plots :ref:`plvect` vector arrow displays (such temperature, velocity, and force) in + the + global Cartesian coordinate system ( :ref:`rsys` = 0). Subsequent operations revert to your original + coordinate system. + + When using solution coordinate systems for results output ( :ref:`rsys`,SOLU), the deformed or + displaced shape in a POST1 contour display can be unexpected (although the contours are displayed in + the expected colors). The program does not rotate displacement values (Ux,Uy,Uz) to global; instead, + the displacements (stored locally) are added directly to the global coordinates (X,Y,Z). For + example, if in PREP7 the nodes are rotated 90 degrees about the z axis and the global Uy + displacements are relatively large, the Ux values will be large, causing the model to display a + large deformation in the global X direction. + + If large deflection is active ( :ref:`nlgeom`,ON), Mechanical APDL rotates the element component + result + directions by the amount of rigid body rotation. + + Mechanical APDL displays the element component results in the initial global coordinate system for + the + following elements: ``SHELL181``, ``SHELL281``, ``ELBOW290``, ``PLANE182``, ``PLANE183``, + ``SOLID185``, ``SOLID186``, ``SOLID187``, ``SOLID272``, ``SOLID273``, ``SOLID285``, ``SOLSH190``, + ``SHELL208``, and ``SHELL209``. + + All other element result transformations, therefore, are also relative to the initial global system. + + Nodal degree-of-freedom results are based on the initial geometry. + + For all other element types, component results displayed in the co-rotated coordinate system include + the element rigid body rotation from the initial global coordinate system, and all other element + result transformations are relative to the rotated global system. + """ + command = f"RSYS,{kcn}" + return self.run(command, **kwargs) + + def shell(self, loc: str = "", **kwargs): + r"""Selects a shell element or shell layer location for results output. + + Mechanical APDL Command: `SHELL `_ + + Parameters + ---------- + loc : str + Location within shell element (or layer) to obtain stress results: + + * ``TOP`` - Top of shell element (or layer) (default). + + * ``MID`` - Middle of shell element (or layer). The default method averages the TOP and BOT values + to obtain a mid value. Setting KEYOPT(8) = 2 for ``SHELL181``, ``SHELL208``, ``SHELL209``, + ``SHELL281``, and ``ELBOW290`` uses MID results obtained directly from the results file. + + * ``BOT`` - Bottom of shell element (or layer). + + Notes + ----- + + .. _SHELL_notes: + + Selects the location within a shell element (or a shell layer) for results output (nodal stresses, + strains, etc.). Applies to POST1 selects, sorts, and output ( :ref:`nsel`, :ref:`nsort`, + :ref:`prnsol`, :ref:`plnsol`, :ref:`prpath`, :ref:`plpath`, etc.), and is used for storage with the + POST26 :ref:`esol` command. For example, :ref:`shell`,TOP causes item S of the POST1 :ref:`prnsol` + command or the POST26 :ref:`esol` command to be the stresses at the top of the shell elements. For + layered shell elements, use the :ref:`layer` (POST1) or :ref:`layerp26` (POST26) command to select + the layer. The :ref:`shell` command does not apply to the layered thermal shell elements, + ``SHELL131`` and ``SHELL132``. + + For PowerGraphics ( :ref:`graphics`,POWER), the :ref:`shell`,MID command affects both the printed + output and the displayed results, while the :ref:`shell` (TOP or BOT) command prints and displays + both the top and bottom layers simultaneously. Note that :ref:`cycexpand`,ON automatically turns on + PowerGraphics; however, for cyclic mode-superposition harmonic postprocessing ( :ref:`cycfiles` ), + the :ref:`shell` command prints and displays only the requested layer. + + In POST26, the :ref:`esol` data stored is based on the active :ref:`shell` specification at the time + the data is stored. To store data at various specifications (for example, stresses at the top and + bottom locations), issue a :ref:`store` command before each new specification. + """ + command = f"SHELL,{loc}" + return self.run(command, **kwargs) diff --git a/src/ansys/mapdl/core/_commands/post1/element_table.py b/src/ansys/mapdl/core/_commands/post1/element_table.py new file mode 100644 index 00000000000..1530b8ab786 --- /dev/null +++ b/src/ansys/mapdl/core/_commands/post1/element_table.py @@ -0,0 +1,1576 @@ +# Copyright (C) 2016 - 2025 ANSYS, Inc. and/or its affiliates. +# SPDX-License-Identifier: MIT +# +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to deal +# in the Software without restriction, including without limitation the rights +# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +# copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in all +# copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +# SOFTWARE. + + +class ElementTable: + + def esort( + self, + item: str = "", + lab: str = "", + order: int | str = "", + kabs: int | str = "", + numb: str = "", + **kwargs, + ): + r"""Sorts the element table. + + Mechanical APDL Command: `ESORT `_ + + **Command default:** + + .. _ESORT_default: + + Use ascending element number order. + + Parameters + ---------- + item : str + Label identifying the item: + + * ``ETAB`` - (currently the only ``Item`` available) + + lab : str + element table label: + + * ``Lab`` - Any user-defined label from the :ref:`etable` command (input in the ``Lab`` field of the + :ref:`etable` command). + + order : int or str + Order of sort operation: + + * ``0`` - Sort into descending order. + + * ``1`` - Sort into ascending order. + + kabs : int or str + Absolute value key: + + * ``0`` - Sort according to real value. + + * ``1`` - Sort according to absolute value. + + numb : str + Number of elements (element table rows) to be sorted in ascending or descending order ( + ``ORDER`` ) before sort is stopped (remainder will be in unsorted sequence) (defaults to all + elements). + + Notes + ----- + + .. _ESORT_notes: + + The element table rows are sorted based on the column containing the ``Lab`` values. Use + :ref:`eusort` to restore the original order. If :ref:`esort` is specified with PowerGraphics on ( + :ref:`graphics`,POWER), then the nodal solution results listing ( :ref:`prnsol` ) will be the same + as with the full graphics mode ( :ref:`graphics`,FULL). + """ + command = f"ESORT,{item},{lab},{order},{kabs},{numb}" + return self.run(command, **kwargs) + + def etable( + self, lab: str = "", item: str = "", comp: str = "", option: str = "", **kwargs + ): + r"""Fills a table of element values for further processing. + + Mechanical APDL Command: `ETABLE `_ + + Parameters + ---------- + lab : str + Any unique user-defined label for use in subsequent commands and output headings. A valid label has + a maximum of eight characters and is not a general predefined ``Item`` label. Default: An eight- + character label formed by concatenating the first four characters of the ``Item`` and ``Comp`` + labels. + + If the same as a previous user label, the result item is included under the same label. Up to 200 + different labels can be defined. + + The following predefined labels are reserved: + + * ``REFL`` - Refills all tables previously defined with the :ref:`etable` commands (not the + :ref:`calc` module commands) according to the latest :ref:`etable` specifications. It is convenient + for refilling tables after the load step ( :ref:`set` ) has changed. Remaining fields are ignored. + + * ``STAT`` - Displays stored table values. + + * ``ERAS`` - Erases the entire table. + + item : str + Label identifying the item. General item labels are shown in the tables below. Some items also + require a component label. Character parameters are valid. ``Item`` = ERAS erases a ``Lab`` + column. + + comp : str + Component of the item (if required). General component labels are shown in the tables below. + Character parameters can be used. + + option : str + Option for storing element table data: + + * ``MIN`` - Store minimum element nodal value of the specified item component. + + * ``MAX`` - Store maximum element nodal value of the specified item component. + + * ``AVG`` - Store averaged element centroid value of the specified item component (default). + + Notes + ----- + + .. _ETABLE_notes: + + :ref:`etable` defines a table of values per element (the element table) for use in further + processing. The element table is organized similar to a spreadsheet, with rows representing all + selected elements and columns consisting of result items which have been moved into the table ( + ``Item``, ``Comp`` ) via :ref:`etable`. Each column of data is identified by a user-defined label ( + ``Lab`` ) for listings and displays. + + After entering the data into the element table, you are not limited to listing or displaying your + data ( :ref:`plesol`, :ref:`presol`, etc.). You can also perform many types of operations on your + data, such as adding or multiplying columns ( :ref:`sadd`, :ref:`smult` ), defining allowable + stresses for safety calculations ( :ref:`sallow` ), or multiplying one column by another ( + :ref:`smult` ). For more information, see `Getting Started + `_ + + For `reinforcing + `_ + elements, this command displays the results of reinforcing member (individual reinforcing) selected + via the :ref:`layer`, ``N`` command (where ``N`` is a given reinforcing member). :ref:`layer`,0 + (default) or :ref:`layer`,1 selects the first reinforcing member. + + Various results data can be stored in the element table. For example, many items for an element are + inherently single-valued (one value per element). The single-valued items include: SERR, SDSG, TERR, + TDSG, SENE, TENE, KENE, ASENE, PSENE, AKENE, PKENE, DENE, WEXT, AENE, JHEAT, JS, VOLU, and CENT. All + other items are multivalued (varying over the element, such that there is a different value at each + node). Because only one value is stored in the element table per element, an average value (based on + the number of contributing nodes) is calculated for multivalued items. Exceptions to this averaging + procedure are FMAG and all element force items, which represent the sum only of the contributing + nodal values. + + Two methods of data access can be used with the :ref:`etable` command. The method you select depends + upon the type of data that you want to store. Some results can be accessed via a generic label + (Component Name method), while others require a label and number (Sequence Number method). + + The component name method is used to access the general element data (that is, element data which is + generally available to most element types or groups of element types). All of the single-valued + items and some of the more general multivalued items are accessible with the Component Name method. + Various element results depend on the calculation method and the selected results location ( + :ref:`avprin`, :ref:`rsys`, :ref:`layer`, :ref:`shell`, and :ref:`esel` ). + + Although nodal data is readily available for listing and display ( :ref:`prnsol`, :ref:`plnsol` ) + without using the element table, you can also use the Component Name method to enter these results + into the element table for further "worksheet" manipulation. (See `Getting Started + `_ ``Item`` and + ``Comp`` labels for the component name method is shown in :ref:`ETABLE_tab_1`. See + :ref:`ETABLE_tab_2` for a list of selected result ( ``Item`` = SRES) ``Comp`` labels. + + The sequence number method enables you to view results for data that is not averaged (such as + pressures at nodes, temperatures at integration points, etc.), or data that is not easily described + in a generic fashion (such as all derived data for structural line elements and contact elements, + all derived data for thermal line elements, layer data for layered elements, etc.). A table + illustrating the ``Items`` (such as LS, LEPEL, LEPTH, SMISC, NMISC, SURF, etc.) and corresponding + sequence numbers for each element is shown in the Output Data section of each element description. + + Some element table data are reported in the results coordinate system. These include all component + results (for example, UX, UY, etc.; SX, SY, etc.). The solution writes component results in the + database and on the results file in the solution coordinate system. When you issue the :ref:`etable` + command, these results are then transformed into the results coordinate system ( :ref:`rsys` ) + before being stored in the element table. The default results coordinate system is global Cartesian + ( :ref:`rsys`,0). All other data are retrieved from the database and stored in the element table + with no coordinate transformation. + + To display the stored table values, issue the :ref:`pretab`, :ref:`pletab`, or :ref:`etable`,STAT + command. To erase the entire table, issue :ref:`etable`,ERAS. To erase a ``Lab`` column, issue + :ref:`etable`, ``Lab``,ERAS. + + When the GUI is enabled, if a **Delete** operation in a Define Element Table Data dialog box writes + this command to a log file ( :file:`Jobname.LOG` or :file:`Jobname.LGW` ), the program sets ``Lab`` + = blank, ``Item`` = ERASE, and ``Comp`` = an integer number. In this case, the program has assigned + a value of ``Comp`` that corresponds to the location of a chosen variable name in the dialog list. + It is not intended that you type in such a location value for ``Comp`` in a session; however, a file + that contains a GUI-generated :ref:`etable` command of this form can be used for batch input or the + :ref:`input` command. + + The MIN and MAX options are not available for thermal elements. + + The element table data option ( ``Option`` ) is not available for all output items. See the table + below for supported items. + + .. _ETABLE_tab_1: + + ETABLE - General Result Item and Component Labels + ************************************************* + + .. flat-table:: General Item and Component Labels :ref:`etable`, ``Lab, Item, Comp`` + :header-rows: 1 + + * - Item + - Comp + - Description + * - Valid Item Labels for Degree of Freedom Results + * - U + - X, Y, Z + - X, Y, or Z structural displacement. + * - ROT + - X, Y, Z + - X, Y, or Z structural rotation. + * - TEMP For ``SHELL131`` and ``SHELL132`` elements with KEYOPT(3) = 0 or 1, use labels TBOT, TE2, TE3, ..., TTOP instead of TEMP. + - + - Temperature. + * - PRES + - + - Pressure. + * - VOLT + - + - Electric potential. + * - GFV1, GFV2, GFV3 + - + - Nonlocal field values 1, 2, and 3. + * - MAG + - + - Magnetic scalar potential. + * - V + - X, Y, Z + - X, Y, or Z fluid velocity. + * - A + - X, Y, Z + - X, Y, or Z magnetic vector potential. + * - CONC + - + - Concentration. + * - CURR + - + - Current. + * - EMF + - + - Electromotive force drop. + * - Valid Item and Component Labels for Element Results + * - :rspan:`3` S Element table option ( ``Option`` ) is available for this element output data item. + - X, Y, Z, XY, YZ, XZ + - Component stress. + * - 1, 2, 3 + - Principal stress. + * - INT + - Stress intensity. + * - EQV + - Equivalent stress. + * - :rspan:`3` EPEL + - X, Y, Z, XY, YZ, XZ + - Component elastic strain. + * - 1, 2, 3 + - Principal elastic strain. + * - INT + - Elastic strain intensity. + * - EQV + - Elastic equivalent strain. + * - :rspan:`3` EPTH + - X, Y, Z, XY, YZ, XZ + - Component thermal strain. + * - 1, 2, 3 + - Principal thermal strain. + * - INT + - Thermal strain intensity. + * - EQV + - Thermal equivalent strain. + * - :rspan:`3` EPDI + - X, Y, Z, XY, YZ, XZ + - Component diffusion strain. + * - 1, 2, 3 + - Principal diffusion strain. + * - EQV + - Diffusion equivalent strain. + * - INT + - Diffusion strain intensity. + * - :rspan:`3` EPPL + - X, Y, Z, XY, YZ, XZ + - Component plastic strain. + * - 1, 2, 3 + - Principal plastic strain. + * - INT + - Plastic strain intensity. + * - EQV + - Plastic equivalent strain. + * - :rspan:`3` EPCR + - X, Y, Z, XY, YZ, XZ + - Component creep strain. + * - 1, 2, 3 + - Principal creep strain. + * - INT + - Creep strain intensity. + * - EQV + - Creep equivalent strain. + * - EPSW + - + - Swelling strain. + * - :rspan:`3` EPTO + - X, Y, Z, XY, YZ, XZ + - Component total mechanical strain ( excluding thermal) (EPEL + EPPL + EPCR). + * - 1, 2, 3 + - Principal total mechanical strain. + * - INT + - Total mechanical strain intensity. + * - EQV + - Total equivalent mechanical strain. + * - :rspan:`3` EPTT + - X, Y, Z, XY, YZ, XZ + - Component total strain including thermal, diffusion, and swelling (EPEL + EPTH + EPPL + EPDI + EPCR + EPSW). + * - 1, 2, 3 + - Principal total strain. + * - INT + - Total strain intensity. + * - EQV + - Total equivalent strain. + * - :rspan:`3` NL + - SEPL + - Equivalent stress (from stress-strain curve). + * - SRAT + - Stress state ratio. + * - HPRES + - Hydrostatic pressure. + * - EPEQ + - Accumulated equivalent plastic strain. + * - :rspan:`7` SEND + - ELASTIC The results for this postprocessing SEND component are invalid for ``ELBOW290`` when that element is used with viscoelastic or viscohyperelastic materials. + - Elastic strain energy density. (For `viscoelastic `_ and `sintering `_ materials, the `stored energy `_.) + * - PLASTIC + - Plastic strain energy density. + * - CREEP + - Creep strain energy density. + * - DAMAGE + - Damage strain energy density. + * - VDAM + - Viscoelastic dissipation energy density. + * - VREG + - Visco-regularization strain energy density. + * - DISS + - Structural-thermal dissipation. + * - ENTO + - Total strain energy density (sum of ELASTIC, PLASTIC, and CREEP strain energy densities). + * - SVAR + - 1 to MAX + - State variable. + * - :rspan:`1` CDM + - DMG + - Damage variable. + * - LM + - Maximum previous strain energy for virgin material. + * - :rspan:`13` FAIL + - MAX For MPC-based contact definitions, the value of STAT can be negative. This indicates that one or more contact constraints were intentionally removed to prevent overconstraint. STAT = -3 is used for MPC bonded contact; STAT = -2 is used for MPC no-separation contact. + - Maximum of all active failure criteria defined at the current location ( :ref:`fctyp` ). + * - EMAX + - Maximum Strain Failure Criterion. + * - SMAX + - Maximum Stress Failure Criterion. + * - TWSI + - Tsai-Wu Strength Index Failure Criterion. + * - TWSR + - Inverse of Tsai-Wu Strength Ratio Index Failure Criterion. + * - HFIB Some element- and material-type limitations apply. For more information, see :ref:`prerr`. + - Hashin Fiber Failure Criterion. + * - HMAT + - Hashin Matrix Failure Criterion. + * - PFIB + - Puck Fiber Failure Criterion. + * - PMAT + - Puck Matrix Failure Criterion. + * - L3FB + - LaRc03 Fiber Failure Criterion. + * - L3MT + - LaRc03 Matrix Failure Criterion. + * - L4FB + - LaRc04 Fiber Failure Criterion. + * - L4MT + - LaRc04 Matrix Failure Criterion. + * - USR1, USR2,..., USR9 When using the :ref:`emft` procedure to calculate electromagnetic force ( ``PLANE121``, ``SOLID122``, ``SOLID123``, ``PLANE233``, ``SOLID236`` or ``SOLID237`` elements only), the FMAG sum will be zero or near zero. + - User-defined failure criteria. + * - :rspan:`4` PFC + - MAX Failure criteria are based on the effective stresses in the damaged material. + - Maximum of all failure criteria defined at current location. + * - FT + - Fiber tensile failure criteria. + * - FC + - Fiber compressive failure criteria. + * - MT + - Matrix tensile failure criteria. + * - MC + - Matrix compressive failure criteria. + * - :rspan:`7` PDMG + - STAT + - Damage status (0 = undamaged, 1 = damaged, 2 = completely damaged). + * - FT + - Fiber tensile damage variable. + * - FC + - Fiber compressive damage variable. + * - MT + - Matrix tensile damage variable. + * - MC + - Matrix compressive damage variable. + * - S + - Shear damage variable (S). + * - SED + - Energy dissipated per unit volume. + * - SEDV + - Energy per unit volume due to viscous damping. + * - :rspan:`2` FCMX + - LAY + - Layer number where the maximum of all active failure criteria over the entire element occurs. + * - FC + - Number of the maximum-failure criterion over the entire element: * 1 - EMAX * 2 - SMAX * 3 - TWSI * 4 - TWSR * 5 - PFIB * 6 - PMAT * 7 - HFIB * 8 - HMAT * 9 - L3FB * 10 - L3MT * 11 - L4FB * 12 - L4MT * 13~21 - USR1~USR9 + * - VAL + - Value of the maximum failure criterion over the entire element. + * - TG ``Comp`` = SUM is not supported for coupled pore-pressure-thermal (CPT ``nnn`` ) elements. + - X, Y, Z, SUM + - Component thermal gradient or vector sum. + * - TF + - X, Y, Z, SUM + - Component thermal flux or vector sum. + * - PG + - X, Y, Z, SUM + - Component pressure gradient or vector sum. + * - EF + - X, Y, Z, SUM + - Component electric field or vector sum. + * - D + - X, Y, Z, SUM + - Component electric flux density or vector sum. + * - H + - X, Y, Z, SUM + - Component magnetic field intensity or vector sum. + * - B + - X, Y, Z, SUM + - Component magnetic flux density or vector sum. + * - CG + - X, Y, Z, SUM + - Component concentration gradient or vector sum. + * - DF + - X, Y, Z, SUM + - Component diffusion flux density or vector sum. + * - FMAG + - X, Y, Z, SUM + - Component electromagnetic forces or vector sum. + * - SERR + - + - Structural error energy. + * - SDSG + - + - Absolute value of maximum variation of any nodal stress component. + * - TERR + - + - Thermal error energy. + * - TDSG + - + - Absolute value of the maximum variation of any nodal thermal gradient component. + * - F + - X, Y, Z + - Component structural force. Sum of element nodal values. + * - M + - X, Y, Z + - Component structural moment. Sum of element nodal values. + * - HEAT + - + - Heat flow. Sum of element nodal values. + * - FLOW + - + - Fluid flow. Sum of element nodal values. + * - AMPS + - + - Current flow. Sum of element nodal values. + * - FLUX + - + - Magnetic flux. Sum of element nodal values. + * - CSG + - X, Y, Z + - Component magnetic current segment. + * - RATE + - + - Diffusion flow rate. Sum of element nodal values. + * - SENE + - + - "Stiffness" energy or thermal heat dissipation (applies to all elements where meaningful). Same as TENE. + * - AENE + - + - Artificial energy of the element. This includes the sum of hourglass control energy and energy generated by in-plane drilling stiffness from shell elements (applies to all elements where meaningful). It also includes artificial energy due to contact stabilization. The energy is used for comparisons to SENE energy to predict the solution error due to artificial stiffness. + * - TENE + - + - Thermal heat dissipation or "stiffness" energy (applies to all elements where meaningful). Same as SENE. + * - KENE + - + - Kinetic energy (applies to all elements where meaningful). + * - ASENE + - + - Amplitude "stiffness" energy. + * - PSENE + - + - Peak "stiffness" energy. + * - AKENE + - + - Amplitude kinetic energy. + * - PKENE + - + - Peak kinetic energy. + * - DENE + - + - Damping energy. + * - WEXT WEXT is calculated for element-based loading only (and not for nodal-force loading). WEXT is stored on elements to which loading has been applied; if surface elements are added on top of other elements, for example, and pressure loading is applied to the surface elements, WEXT is available for the surface elements only. + - + - Work due to external load. + * - STEN + - + - Elemental energy dissipation due to `stabilization `_. + * - JHEAT + - + - Element Joule heat generation. + * - JS + - X, Y, Z, SUM + - Source current density for low-frequency magnetic analyses. Total current density (sum of conduction and displacement current densities) in low frequency electric analyses. Components (X, Y, Z) and vector sum (SUM). + * - JT + - X, Y, Z, SUM + - Total measurable current density in low-frequency electromagnetic analyses. (Conduction current density in a low-frequency electric analysis.) Components (X, Y, Z) and vector sum (SUM). + * - JC + - X, Y, Z, SUM + - Conduction current density for elements that support conduction current calculation. Components (X, Y, Z) and vector sum (SUM). + * - MRE + - + - Magnetics Reynolds number. + * - VOLU + - + - Element volume. Based on unit thickness for 2D plane elements (unless the thickness option is used) and on the full 360 degrees for 2D axisymmetric elements. + * - CENT + - X, Y, Z + - Undeformed X, Y, or Z location (based on shape function) of the element centroid in the active coordinate system. + * - BFE + - TEMP + - Body temperatures (calculated from applied temperatures) as used in solution (area and volume elements only). + * - SMISC + - snum + - Element summable miscellaneous data value at sequence number snum (shown in the Output Data section of each applicable element description). + * - NMISC + - snum + - Element non-summable miscellaneous data value at sequence number snum (shown in the Output Data section of each applicable element description). + * - SURF + - snum + - Element surface data value at sequence number snum. + * - :rspan:`9` CONT + - STAT + - Contact status: * 3 = closed and sticking * 2 = closed and sliding * 1 = open but near contact * 0 = open and not near contact + * - PENE + - Contact penetration (zero or positive). + * - PRES + - Contact pressure. + * - SFRIC + - Contact friction stress. + * - STOT + - Contact total stress (pressure plus friction). + * - SLIDE + - Contact sliding distance. + * - GAP + - Contact gap distance (0 or negative). + * - FLUX + - Total heat flux at contact surface. + * - CNOS + - Total number of contact status changes during substep. + * - FPRS + - Fluid penetration pressure. + * - TOPO + - + - Densities used for topological optimization. + * - CAP + - C0,X0,K0,ZONE, DPLS,VPLS + - Material cap plasticity model only: Cohesion; hydrostatic compaction yielding stress; I1 at the transition point at which the shear and compaction envelopes intersect; zone = 0: elastic state, zone = 1: compaction zone, zone = 2: shear zone, zone = 3: expansion zone; effective deviatoric plastic strain; volume plastic strain. + * - EDPC + - CSIG,CSTR + - Material EDP creep model only (not including the cap model): Equivalent creep stress; equivalent creep strain. + * - :rspan:`3` ESIG + - X,Y,Z,XY,YZ,ZX + - Components of Biot``s effective stress. + * - 1, 2, 3 + - Principal stresses of Biot``s effective stress. + * - INT + - Stress intensity of Biot``s effective stress. + * - EQV + - Equivalent stress of Biot``s effective stress. + * - :rspan:`2` DPAR + - TPOR + - Total porosity (Gurson material model). + * - GPOR + - Porosity due to void growth. + * - NPOR + - Porosity due to void nucleation. + * - FFLX + - X,Y,Z + - Fluid flow flux in poromechanics. + * - FGRA + - X,Y,Z + - Fluid pore pressure gradient in poromechanics. + * - FICT + - TEMP + - Fictive temperature. + * - PMSV + - VRAT, PPRE, DSAT, RPER + - Void volume ratio, pore pressure, degree of saturation, and relative permeability for coupled pore-pressure-thermal elements. + * - YSIDX + - TENS,SHEA + - Yield surface activity status for Mohr-Coulomb, soil, concrete, and joint rock material models: 1 = yielded, 0 = not yielded. + * - FPIDX + - TF01,SF01, TF02,SF02, TF03,SF03, TF04,SF04 + - Failure plane surface activity status for concrete and joint rock material models: 1 = yielded, 0 = not yielded. Tension and shear failure status are available for all four sets of failure planes. + * - NS + - X, Y, Z, XY, YZ, XZ + - `Nominal strain `_ for hyperelastic material, reported in the current configuration (unaffected by :ref:`rsys` ). + * - MPLA + - DMAC, DMAX + - Microplane damage, macroscopic and maximum values. + * - MPDP + - TOTA, TENS, COMP, RW + - Microplane homogenized total, tension, and compression damages (TOTA, TENS, COMP), and split weight factor (RW). + * - DAMAGE + - 1,2,3,MAX + - Damage in directions 1, 2, 3 (1, 2, 3) and the maximum damage (MAX). + * - GDMG + - + - Damage + * - IDIS + - + - Structural-thermal dissipation rate + * - BKS + - X, Y, Z, XY, YZ, XZ + - Total `nonlinear kinematic backstress `_ reported in the current configuration (unaffected by :ref:`rsys` ). Available for 3D, plane strain, and axisymmetric elements. + * - BKS1,..., BKS5 + - X, Y, Z, XY, YZ, XZ + - Superimposed components of the total `nonlinear kinematic backstress`_ reported in the current configuration (unaffected by :ref:`rsys` ). Available for 3D, plane strain, and axisymmetric elements when more than one superimposed back-stress component is defined. + * - EPFR + - + - Free strain in porous media + * - FC1S + - 1,2,3,4,5,6 + - First set of six components of FCC crystal slip. Available for 3D elements only. + * - FC2S + - 1,2,3,4,5,6 + - Second set of six components of FCC crystal slip. Available for 3D elements only. + * - HC1S + - 1,2,3,4,5,6 + - Six components of HCP crystal slip on basal and prismatic systems. Available for 3D elements only. + * - HC2S + - 1,2,3,4,5,6 + - Six components of HCP crystal slip on pyramidal system. Available for 3D elements only. + * - HC3S + - 1,2,3,4,5,6 + - First set of six components of HCP crystal slip on the first-order pyramidal system. Available for 3D elements only. + * - HC4S + - 1,2,3,4,5,6 + - Second set of six components of HCP crystal slip on the first-order pyramidal system. Available for 3D elements only. + * - HC5S + - 1,2,3,4,5,6 + - Six components of HCP crystal slip on the second-order pyramidal system. Available for 3D elements only. + * - BC1S + - 1,2,3,4,5,6 + - First set of six components of BCC slip on 111 plane. Available for 3D elements only. + * - BC2S + - 1,2,3,4,5,6 + - Second set of six components of BCC slip on 111 plane. Available for 3D elements only. + * - BC3S + - 1,2,3,4,5,6 + - First set of six components of BCC slip on 112 plane. Available for 3D elements only. + * - BC4S + - 1,2,3,4,5,6 + - Second set of six components of BCC slip on 112 plane. Available for 3D elements only. + * - BC5S + - 1,2,3,4,5,6 + - First set of six components of BCC slip on 123 plane. Available for 3D elements only. + * - BC6S + - 1,2,3,4,5,6 + - Second set of six components of BCC slip on 123 plane. Available for 3D elements only. + * - BC7S + - 1,2,3,4,5,6 + - Third set of six components of BCC slip on 123 plane. Available for 3D elements only. + * - BC8S + - 1,2,3,4,5,6 + - Fourth set of six components of BCC slip on 123 plane. Available for 3D elements only. + * - FC1H + - 1,2,3,4,5,6 + - First set of six components of FCC crystal hardness. Available for 3D elements only. + * - FC2H + - 1,2,3,4,5,6 + - Second set of six components of FCC crystal hardness. Available for 3D elements only. + * - HC1H + - 1,2,3,4,5,6 + - Sixcomponents of HCP crystal hardness on basal and prismatic systems. Available for 3D elements. + * - HC2H + - 1,2,3,4,5,6 + - Six components of HCP crystal hardness on pyramidal system. Available for 3D elements only. + * - HC3H + - 1,2,3,4,5,6 + - First set of six components of HCP crystal hardness on the first-order pyramidal system. Available for 3D elements only. + * - HC4H + - 1,2,3,4,5,6 + - Second set of six components of HCP crystal hardness on the first-order pyramidal system. Available for 3D elements only. + * - HC5H + - 1,2,3,4,5,6 + - Six components of HCP crystal hardness on the second-order pyramidal system. Available for 3D elements only. + * - BC1H + - 1,2,3,4,5,6 + - First set of six components of BCC hardness on 111 plane. Available for 3D elements only. + * - BC2H + - 1,2,3,4,5,6 + - Second set of six components of BCC hardness on 111 plane. Available for 3D elements only. + * - BC3H + - 1,2,3,4,5,6 + - First set of six components of BCC hardness on 112 plane. Available for 3D elements only. + * - BC4H + - 1,2,3,4,5,6 + - Second set of six components of BCC hardness on 112 plane. Available for 3D elements only. + * - BC5H + - 1,2,3,4,5,6 + - First set of six components of BCC hardness on 123 plane. Available for 3D elements only. + * - BC6H + - 1,2,3,4,5,6 + - Second set of six components of BCC hardness on 123 plane. Available for 3D elements only. + * - BC7H + - 1,2,3,4,5,6 + - Third set of six components of BCC hardness on 123 plane. Available for 3D elements only. + * - BC8H + - 1,2,3,4,5,6 + - Fourth set of six components of BCC hardness on 123 plane. Available for 3D elements only. + * - XELG + - 1,2,3,45,6,EQV + - Crystal Lagrangian strain in 11, 22, 33, 12, 23,13 directions and its equivalent. Available for 3D elements only. + * - SINT + - RHO, ETA, SSTR, GRAIN + - Sintering relative density, viscosity, sintering stress, and average grain size values. + + + .. _ETABLE_tab_2: + + ETABLE - Selected Result Component Labels + ***************************************** + + Selected Result Component Labels :ref:`etable`, ``Lab``,SRES, ``Comp`` + + .. flat-table:: + + * - **Comp** + - **Description** + * - SVAR ``n`` + - The ``n`` th state variable. + * - FLDUF0 ``n`` + - The ``n`` th user-defined field variable. + + """ + command = f"ETABLE,{lab},{item},{comp},{option}" + return self.run(command, **kwargs) + + def eusort(self, **kwargs): + r"""Restores original order of the element table. + + Mechanical APDL Command: `EUSORT `_ + + Notes + ----- + + .. _EUSORT_notes: + + Changing the selected element set ( :ref:`esel` ) also restores the original element order. + """ + command = "EUSORT" + return self.run(command, **kwargs) + + def pletab(self, itlab: str = "", avglab: str = "", **kwargs): + r"""Displays element table items. + + Mechanical APDL Command: `PLETAB `_ + + Parameters + ---------- + itlab : str + User-defined label, as specified with the :ref:`etable` command, of item to be displayed. + + avglab : str + Averaging operation: + + * ``NOAV`` - Do not average element items at common nodes (default). + + * ``AVG`` - Average the element items at common nodes. + + Notes + ----- + + .. _PLETAB_notes: + + Displays items stored in the table defined with the :ref:`etable` command for the selected elements. + For display purposes, items are assumed to be constant over the element and assigned to each of its + nodes. Contour display lines (lines of constant value) are determined by linear interpolation within + each element from the nodal values. These nodal values have the option of being averaged (values are + averaged at a node whenever two or more elements connect to the same node) or not averaged + (discontinuous). The discontinuity between contour lines of adjacent elements is an indication of + the gradient across elements. + + For `reinforcing + `_ + elements, this command displays the results of reinforcing member (individual reinforcing) selected + via the :ref:`layer`, ``N`` command (where ``N`` is a given reinforcing member). :ref:`layer`,0 + (default) or :ref:`layer`,1 selects the first reinforcing member. + + Portions of this command are not supported by PowerGraphics ( :ref:`graphics`,POWER). + """ + command = f"PLETAB,{itlab},{avglab}" + return self.run(command, **kwargs) + + def plls( + self, + labi: str = "", + labj: str = "", + fact: str = "", + kund: int | str = "", + viewup: int | str = "", + **kwargs, + ): + r"""Displays element table items as contoured areas along elements. + + Mechanical APDL Command: `PLLS `_ + + Parameters + ---------- + labi : str + Label of element table item ( :ref:`etable` ) for node I magnitude. + + labj : str + Label of element table item for node J magnitude. + + fact : str + Scale factor for display (defaults to 1). A negative scaling factor may be used to invert the + display. + + kund : int or str + Undisplaced shape key: + + * ``0`` - Display selected items on undeformed shape. + + * ``1`` - Display selected items on deformed shape. + + viewup : int or str + View Up key: + + * ``0`` - Ignore the view-up ( :ref:`vup` ) vector when calculating trapezoid orientation (default). + + * ``1`` - Use the view-up ( :ref:`vup` ) vector to calculate trapezoid orientation. + + Notes + ----- + + .. _PLLS_notes: + + Displays selected items (such as shears and moments) as a contoured area (trapezoid) display along + line elements and 2D axisymmetric shell elements (such as shear and moment diagrams). Three sides of + the trapezoid are formed by the element (one side) and lines at nodes I and J of length proportional + to the item magnitude and displayed normal to the element and the viewing direction (the two + parallel sides). + + When ``ViewUP`` = 1, the trapezoid is oriented within the plane created by the element and the + global Cartesian coordinate system reference orientation (/VUP or view up) vector. In this case, the + program does not perform the calculation involving the element and view direction. + + Portions of this command are not supported by PowerGraphics ( :ref:`graphics`,POWER). + """ + command = f"PLLS,{labi},{labj},{fact},{kund},{viewup}" + return self.run(command, **kwargs) + + def pretab( + self, + lab1: str = "", + lab2: str = "", + lab3: str = "", + lab4: str = "", + lab5: str = "", + lab6: str = "", + lab7: str = "", + lab8: str = "", + lab9: str = "", + **kwargs, + ): + r"""Prints the element table items. + + Mechanical APDL Command: `PRETAB `_ + + Parameters + ---------- + lab1 : str + Print selected items. Valid labels are (blank) or any label as specified with the :ref:`etable` + command. Convenience labels may be used for ``Lab1`` to select groups of labels (10 labels + maximum): GRP1 for first 10 stored items; GRP2 for items 11 to 20; GRP3 for items 21 to 30; GRP4 + for items 31 to 40; GRP5 for items 41 to 50. Enter :ref:`etable`,STAT command to list stored + item order. If all labels are blank, print first 10 stored items (GRP1). + + lab2 : str + Print selected items. Valid labels are (blank) or any label as specified with the :ref:`etable` + command. Convenience labels may be used for ``Lab1`` to select groups of labels (10 labels + maximum): GRP1 for first 10 stored items; GRP2 for items 11 to 20; GRP3 for items 21 to 30; GRP4 + for items 31 to 40; GRP5 for items 41 to 50. Enter :ref:`etable`,STAT command to list stored + item order. If all labels are blank, print first 10 stored items (GRP1). + + lab3 : str + Print selected items. Valid labels are (blank) or any label as specified with the :ref:`etable` + command. Convenience labels may be used for ``Lab1`` to select groups of labels (10 labels + maximum): GRP1 for first 10 stored items; GRP2 for items 11 to 20; GRP3 for items 21 to 30; GRP4 + for items 31 to 40; GRP5 for items 41 to 50. Enter :ref:`etable`,STAT command to list stored + item order. If all labels are blank, print first 10 stored items (GRP1). + + lab4 : str + Print selected items. Valid labels are (blank) or any label as specified with the :ref:`etable` + command. Convenience labels may be used for ``Lab1`` to select groups of labels (10 labels + maximum): GRP1 for first 10 stored items; GRP2 for items 11 to 20; GRP3 for items 21 to 30; GRP4 + for items 31 to 40; GRP5 for items 41 to 50. Enter :ref:`etable`,STAT command to list stored + item order. If all labels are blank, print first 10 stored items (GRP1). + + lab5 : str + Print selected items. Valid labels are (blank) or any label as specified with the :ref:`etable` + command. Convenience labels may be used for ``Lab1`` to select groups of labels (10 labels + maximum): GRP1 for first 10 stored items; GRP2 for items 11 to 20; GRP3 for items 21 to 30; GRP4 + for items 31 to 40; GRP5 for items 41 to 50. Enter :ref:`etable`,STAT command to list stored + item order. If all labels are blank, print first 10 stored items (GRP1). + + lab6 : str + Print selected items. Valid labels are (blank) or any label as specified with the :ref:`etable` + command. Convenience labels may be used for ``Lab1`` to select groups of labels (10 labels + maximum): GRP1 for first 10 stored items; GRP2 for items 11 to 20; GRP3 for items 21 to 30; GRP4 + for items 31 to 40; GRP5 for items 41 to 50. Enter :ref:`etable`,STAT command to list stored + item order. If all labels are blank, print first 10 stored items (GRP1). + + lab7 : str + Print selected items. Valid labels are (blank) or any label as specified with the :ref:`etable` + command. Convenience labels may be used for ``Lab1`` to select groups of labels (10 labels + maximum): GRP1 for first 10 stored items; GRP2 for items 11 to 20; GRP3 for items 21 to 30; GRP4 + for items 31 to 40; GRP5 for items 41 to 50. Enter :ref:`etable`,STAT command to list stored + item order. If all labels are blank, print first 10 stored items (GRP1). + + lab8 : str + Print selected items. Valid labels are (blank) or any label as specified with the :ref:`etable` + command. Convenience labels may be used for ``Lab1`` to select groups of labels (10 labels + maximum): GRP1 for first 10 stored items; GRP2 for items 11 to 20; GRP3 for items 21 to 30; GRP4 + for items 31 to 40; GRP5 for items 41 to 50. Enter :ref:`etable`,STAT command to list stored + item order. If all labels are blank, print first 10 stored items (GRP1). + + lab9 : str + Print selected items. Valid labels are (blank) or any label as specified with the :ref:`etable` + command. Convenience labels may be used for ``Lab1`` to select groups of labels (10 labels + maximum): GRP1 for first 10 stored items; GRP2 for items 11 to 20; GRP3 for items 21 to 30; GRP4 + for items 31 to 40; GRP5 for items 41 to 50. Enter :ref:`etable`,STAT command to list stored + item order. If all labels are blank, print first 10 stored items (GRP1). + + Notes + ----- + + .. _PRETAB_notes: + + Prints the items stored in the table defined with the :ref:`etable` command. Item values will be + listed for the selected elements in the sorted sequence ( :ref:`esort` ). The :ref:`force` command + can be used to define which component of the nodal load is to be used (static, damping, inertia, or + total). + + Portions of this command are not supported by PowerGraphics ( :ref:`graphics`,POWER). + """ + command = ( + f"PRETAB,{lab1},{lab2},{lab3},{lab4},{lab5},{lab6},{lab7},{lab8},{lab9}" + ) + return self.run(command, **kwargs) + + def sabs(self, key: int | str = "", **kwargs): + r"""Specifies absolute values for element table operations. + + Mechanical APDL Command: `SABS `_ + + Parameters + ---------- + key : int or str + Absolute value key: + + * ``0`` - Use algebraic values in operations. + + * ``1`` - Use absolute values in operations. + + Notes + ----- + + .. _SABS_notes: + + Causes absolute values to be used in the :ref:`sadd`, :ref:`smult`, :ref:`smax`, :ref:`smin`, and + :ref:`ssum` operations. + """ + command = f"SABS,{key}" + return self.run(command, **kwargs) + + def sadd( + self, + labr: str = "", + lab1: str = "", + lab2: str = "", + fact1: str = "", + fact2: str = "", + const: str = "", + **kwargs, + ): + r"""Forms an element table item by adding two existing items. + + Mechanical APDL Command: `SADD `_ + + Parameters + ---------- + labr : str + Label assigned to results. If same as existing label, the existing values will be overwritten by + these results. + + lab1 : str + First labeled result item in operation. + + lab2 : str + Second labeled result item in operation (may be blank). + + fact1 : str + Scale factor applied to ``Lab1``. A (blank) or '0' entry defaults to 1.0. + + fact2 : str + Scale factor applied to ``Lab2``. A (blank) or '0' entry defaults to 1.0. + + const : str + Constant value. + + Notes + ----- + + .. _SADD_notes: + + Forms a labeled result (see :ref:`etable` command) for the selected elements by adding two existing + labeled result items according to the operation: + + ``LabR`` = ( ``FACT1`` x ``Lab1`` ) + ( ``FACT2`` x ``Lab2`` ) + ``CONST`` + + May also be used to scale results for a single labeled result item. If absolute values are requested + ( :ref:`sabs`,1), absolute values of ``Lab1`` and ``Lab2`` are used. + """ + command = f"SADD,{labr},{lab1},{lab2},{fact1},{fact2},{const}" + return self.run(command, **kwargs) + + def sallow( + self, + strs1: str = "", + strs2: str = "", + strs3: str = "", + strs4: str = "", + strs5: str = "", + strs6: str = "", + **kwargs, + ): + r"""Defines the allowable stress table for safety factor calculations. + + Mechanical APDL Command: `SALLOW `_ + + Parameters + ---------- + strs1 : str + Input up to six allowable stresses corresponding to the temperature points ( :ref:`tallow` ). + + strs2 : str + Input up to six allowable stresses corresponding to the temperature points ( :ref:`tallow` ). + + strs3 : str + Input up to six allowable stresses corresponding to the temperature points ( :ref:`tallow` ). + + strs4 : str + Input up to six allowable stresses corresponding to the temperature points ( :ref:`tallow` ). + + strs5 : str + Input up to six allowable stresses corresponding to the temperature points ( :ref:`tallow` ). + + strs6 : str + Input up to six allowable stresses corresponding to the temperature points ( :ref:`tallow` ). + + Notes + ----- + + .. _SALLOW_notes: + + Defines the allowable stress table for safety factor calculations ( :ref:`sfact`, :ref:`sfcalc` ). + Use the :ref:`stat` command to list current allowable stress table. Repeat :ref:`sallow` to zero + table and redefine points (6 maximum). + + Safety factor calculations are not supported by PowerGraphics. Both the :ref:`sallow` and + :ref:`tallow` commands must be used with the Full Model Graphics display method active. + """ + command = f"SALLOW,{strs1},{strs2},{strs3},{strs4},{strs5},{strs6}" + return self.run(command, **kwargs) + + def sexp( + self, + labr: str = "", + lab1: str = "", + lab2: str = "", + exp1: str = "", + exp2: str = "", + **kwargs, + ): + r"""Forms an element table item by exponentiating and multiplying. + + Mechanical APDL Command: `SEXP `_ + + Parameters + ---------- + labr : str + Label assigned to results. If same as existing label, the existing values will be overwritten by + these results. + + lab1 : str + First labeled result item in operation. + + lab2 : str + Second labeled result item in operation (may be blank). + + exp1 : str + Exponent applied to ``Lab1``. + + exp2 : str + Exponent applied to ``Lab2``. + + Notes + ----- + + .. _SEXP_notes: + + Forms a labeled result item (see :ref:`etable` command) for the selected elements by exponentiating + and multiplying two existing labeled result items according to the operation: + + ``LabR`` = (\| ``Lab1`` \| :sup:`EXP1` ) x (\| ``Lab2`` \| :sup:`EXP2` ) + + Roots, reciprocals, and divides may also be done with this command. + """ + command = f"SEXP,{labr},{lab1},{lab2},{exp1},{exp2}" + return self.run(command, **kwargs) + + def sfact(self, type_: int | str = "", **kwargs): + r"""Allows safety factor or margin of safety calculations to be made. + + Mechanical APDL Command: `SFACT `_ + + Parameters + ---------- + type_ : int or str + Type of calculation: + + * ``0`` - No nodal safety factor or margin of safety calculations. + + * ``1`` - Calculate and store safety factors in place of nodal stresses. + + * ``2`` - Calculate and store margins of safety in place of nodal stresses. + + Notes + ----- + + .. _SFACT_notes: + + Allows safety factor (SF) or margin of safety (MS) calculations to be made for the average nodal + stresses according to: + + SF = SALLOW/\|Stress\| + + MS = (SALLOW/\|Stress\|) -- 1.0 + + Calculations are done during the display, select, or sort operation in the active coordinate system + ( :ref:`rsys` ) with results stored in place of the nodal stresses. Use the :ref:`prnsol` or + :ref:`plnsol` command to display the results. + + The results are meaningful only for the stress (SIG1, SIGE, etc.) upon which :ref:`sallow` is based. + Nodal temperatures used are those automatically stored for the node. Related commands are + :ref:`sfcalc`, :ref:`sallow`, :ref:`tallow`. + """ + command = f"SFACT,{type_}" + return self.run(command, **kwargs) + + def sfcalc( + self, + labr: str = "", + labs: str = "", + labt: str = "", + type_: int | str = "", + **kwargs, + ): + r"""Calculates the safety factor or margin of safety. + + Mechanical APDL Command: `SFCALC `_ + + Parameters + ---------- + labr : str + Label assigned to results. If same as existing label, the existing values will be overwritten by + these results. + + labs : str + Labeled result item corresponding to the element stress. + + labt : str + Labeled result item corresponding to the element temperature. + + type_ : int or str + Type of calculation: + + * ``0 or 1`` - Use safety factor (SF) calculation. + + * ``2`` - Use margin of safety (MS) calculation. + + * ``3`` - Use 1/SF calculation. + + Notes + ----- + + .. _SFCALC_notes: + + Calculates safety factor (SF) or margin of safety (MS) as described for the :ref:`sfact` command for + any labeled result item (see :ref:`etable` command) for the selected elements. Use the :ref:`pretab` + or :ref:`pletab` command to display results. Allowable element stress is determined from the SALLOW- + TALLOW table ( :ref:`sallow`, :ref:`tallow` ). + """ + command = f"SFCALC,{labr},{labs},{labt},{type_}" + return self.run(command, **kwargs) + + def smax( + self, + labr: str = "", + lab1: str = "", + lab2: str = "", + fact1: str = "", + fact2: str = "", + **kwargs, + ): + r"""Forms an element table item from the maximum of two other items. + + Mechanical APDL Command: `SMAX `_ + + Parameters + ---------- + labr : str + Label assigned to results. If same as existing label, the existing values will be overwritten by + these results. + + lab1 : str + First labeled result item in operation. + + lab2 : str + Second labeled result item in operation (may be blank). + + fact1 : str + Scale factor applied to ``Lab1``. A (blank) or '0' entry defaults to 1.0. + + fact2 : str + Scale factor applied to ``Lab2``. A (blank) or '0' entry defaults to 1.0. + + Notes + ----- + + .. _SMAX_notes: + + Forms a labeled result item (see :ref:`etable` command) for the selected elements by comparing two + existing labeled result items according to the operation: + + ``LabR`` = ( ``FACT1`` x ``Lab1`` ) cmx ( ``FACT2`` x ``Lab2`` ) + + where "cmx" means "compare and save maximum." If absolute values are requested ( :ref:`sabs`,1), the + absolute values of ``Lab1`` and ``Lab2`` are used. + """ + command = f"SMAX,{labr},{lab1},{lab2},{fact1},{fact2}" + return self.run(command, **kwargs) + + def smin( + self, + labr: str = "", + lab1: str = "", + lab2: str = "", + fact1: str = "", + fact2: str = "", + **kwargs, + ): + r"""Forms an element table item from the minimum of two other items. + + Mechanical APDL Command: `SMIN `_ + + Parameters + ---------- + labr : str + Label assigned to results. If same as existing label, the existing values will be overwritten by + these results. + + lab1 : str + First labeled result item in operation. + + lab2 : str + Second labeled result item in operation (may be blank). + + fact1 : str + Scale factor applied to ``Lab1``. A (blank) or '0' entry defaults to 1.0. + + fact2 : str + Scale factor applied to ``Lab2``. A (blank) or '0' entry defaults to 1.0. + + Notes + ----- + + .. _SMIN_notes: + + Forms a labeled result item (see :ref:`etable` command) for the selected elements by comparing two + existing labeled result items according to the operation: + + ``LabR`` = ( ``FACT1`` x ``Lab1`` ) cmn ( ``FACT2`` x ``Lab2`` ) + + where "cmn" means "compare and save minimum." If absolute values are requested ( :ref:`sabs`,1), the + absolute values of ``Lab1`` and ``Lab2`` are used. + """ + command = f"SMIN,{labr},{lab1},{lab2},{fact1},{fact2}" + return self.run(command, **kwargs) + + def smult( + self, + labr: str = "", + lab1: str = "", + lab2: str = "", + fact1: str = "", + fact2: str = "", + **kwargs, + ): + r"""Forms an element table item by multiplying two other items. + + Mechanical APDL Command: `SMULT `_ + + Parameters + ---------- + labr : str + Label assigned to results. If same as existing label, the existing values will be overwritten by + these results. + + lab1 : str + First labeled result item in operation. + + lab2 : str + Second labeled result item in operation (may be blank). + + fact1 : str + Scale factor applied to ``Lab1``. A (blank) or '0' entry defaults to 1.0. + + fact2 : str + Scale factor applied to ``Lab2``. A (blank) or '0' entry defaults to 1.0. + + Notes + ----- + + .. _SMULT_notes: + + Forms a labeled result item (see :ref:`etable` command) for the selected elements by multiplying two + existing labeled result items according to the operation: + + ``LabR`` = ( ``FACT1`` x ``Lab1`` ) x ( ``FACT2`` x ``Lab2`` ) + + May also be used to scale results for a single labeled result item. If absolute values are requested + ( :ref:`sabs`,1), the absolute values of ``Lab1`` and ``Lab2`` are used. + """ + command = f"SMULT,{labr},{lab1},{lab2},{fact1},{fact2}" + return self.run(command, **kwargs) + + def ssum(self, **kwargs): + r"""Calculates and prints the sum of element table items. + + Mechanical APDL Command: `SSUM `_ + + Notes + ----- + + .. _SSUM_notes: + + Calculates and prints the tabular sum of each existing labeled result item ( :ref:`etable` ) for the + selected elements. If absolute values are requested ( :ref:`sabs`,1), absolute values are used. + """ + command = "SSUM" + return self.run(command, **kwargs) + + def tallow( + self, + temp1: str = "", + temp2: str = "", + temp3: str = "", + temp4: str = "", + temp5: str = "", + temp6: str = "", + **kwargs, + ): + r"""Defines the temperature table for safety factor calculations. + + Mechanical APDL Command: `TALLOW `_ + + Parameters + ---------- + temp1 : str + Input up to six temperatures covering the range of nodal temperatures. Temperatures must be + input in ascending order. + + temp2 : str + Input up to six temperatures covering the range of nodal temperatures. Temperatures must be + input in ascending order. + + temp3 : str + Input up to six temperatures covering the range of nodal temperatures. Temperatures must be + input in ascending order. + + temp4 : str + Input up to six temperatures covering the range of nodal temperatures. Temperatures must be + input in ascending order. + + temp5 : str + Input up to six temperatures covering the range of nodal temperatures. Temperatures must be + input in ascending order. + + temp6 : str + Input up to six temperatures covering the range of nodal temperatures. Temperatures must be + input in ascending order. + + Notes + ----- + + .. _TALLOW_notes: + + Defines the temperature table for safety factor calculations ( :ref:`sfact`, :ref:`sallow` ). Use + :ref:`stat` command to list current temperature table. Repeat :ref:`tallow` command to zero table + and redefine points (6 maximum). + + Safety factor calculations are not supported by PowerGraphics. Both the :ref:`sallow` and + :ref:`tallow` commands must be used with the Full Model Graphics display method active. + """ + command = f"TALLOW,{temp1},{temp2},{temp3},{temp4},{temp5},{temp6}" + return self.run(command, **kwargs) + + def vcross( + self, + labxr: str = "", + labyr: str = "", + labzr: str = "", + labx1: str = "", + laby1: str = "", + labz1: str = "", + labx2: str = "", + laby2: str = "", + labz2: str = "", + **kwargs, + ): + r"""Forms element table items from the cross product of two vectors. + + Mechanical APDL Command: `VCROSS `_ + + Parameters + ---------- + labxr : str + Label assigned to X, Y, and Z-component of resultant vector. + + labyr : str + Label assigned to X, Y, and Z-component of resultant vector. + + labzr : str + Label assigned to X, Y, and Z-component of resultant vector. + + labx1 : str + X, Y, and Z-component of first vector label. + + laby1 : str + X, Y, and Z-component of first vector label. + + labz1 : str + X, Y, and Z-component of first vector label. + + labx2 : str + X, Y, and Z-component of second vector label. + + laby2 : str + X, Y, and Z-component of second vector label. + + labz2 : str + X, Y, and Z-component of second vector label. + + Notes + ----- + + .. _VCROSS_notes: + + Forms labeled result items for the selected element from the cross product of two vectors: + + { ``LabXR``, ``LabYR``, ``LabZR`` } = { ``LabX1``, ``LabY1``, ``LabZ1`` } X { ``LabX2``, ``LabY2``, + ``LabZ2`` } + + Data must be in a consistent coordinate system. Labels are those associated with the :ref:`etable` + command. + """ + command = f"VCROSS,{labxr},{labyr},{labzr},{labx1},{laby1},{labz1},{labx2},{laby2},{labz2}" + return self.run(command, **kwargs) + + def vdot( + self, + labr: str = "", + labx1: str = "", + laby1: str = "", + labz1: str = "", + labx2: str = "", + laby2: str = "", + labz2: str = "", + **kwargs, + ): + r"""Forms an element table item from the dot product of two vectors. + + Mechanical APDL Command: `VDOT `_ + + Parameters + ---------- + labr : str + Label assigned to dot product result. + + labx1 : str + X, Y, and Z-component of first vector label. + + laby1 : str + X, Y, and Z-component of first vector label. + + labz1 : str + X, Y, and Z-component of first vector label. + + labx2 : str + X, Y, and Z-component of second vector label. + + laby2 : str + X, Y, and Z-component of second vector label. + + labz2 : str + X, Y, and Z-component of second vector label. + + Notes + ----- + + .. _VDOT_notes: + + Forms labeled result items for the selected element from the dot product of two vectors: + + ``LabR`` = { ``LabX1``, ``LabY1``, ``LabZ1`` } { ``LabX2``, ``LabY2``, ``LabZ2`` } + + Data must be in a consistent coordinate system. Labels are those associated with the :ref:`etable` + command. + """ + command = f"VDOT,{labr},{labx1},{laby1},{labz1},{labx2},{laby2},{labz2}" + return self.run(command, **kwargs) diff --git a/src/ansys/mapdl/core/_commands/post1/failure_criteria.py b/src/ansys/mapdl/core/_commands/post1/failure_criteria.py new file mode 100644 index 00000000000..2332f44b488 --- /dev/null +++ b/src/ansys/mapdl/core/_commands/post1/failure_criteria.py @@ -0,0 +1,86 @@ +# Copyright (C) 2016 - 2025 ANSYS, Inc. and/or its affiliates. +# SPDX-License-Identifier: MIT +# +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to deal +# in the Software without restriction, including without limitation the rights +# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +# copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in all +# copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +# SOFTWARE. + + +class FailureCriteria: + + def fctyp(self, oper: str = "", lab: str = "", **kwargs): + r"""Activates or removes failure-criteria types for postprocessing. + + Mechanical APDL Command: `FCTYP `_ + + Parameters + ---------- + oper : str + Operation key: + + * ``ADD`` - Activate failure-criteria types. This option is the default behavior. + + * ``DELE`` - Remove failure-criteria types. + + lab : str + Valid failure-criteria labels. If ALL, select all available (including user-defined) failure + criteria. + + * ``EMAX`` - Maximum strain criterion (default) + + * ``SMAX`` - Maximum stress criterion (default) + + * ``TWSI`` - Tsai-Wu strength index (default) + + * ``TWSR`` - Inverse of Tsai-Wu strength ratio index (default) + + * ``HFIB`` - Hashin fiber failure criterion + + * ``HMAT`` - Hashin matrix failure criterion + + * ``PFIB`` - Puck fiber failure criterion + + * ``PMAT`` - Puck inter-fiber (matrix) failure criterion + + * ``L3FB`` - LaRc03 fiber failure criterion + + * ``L3MT`` - LaRc03 matrix failure criterion + + * ``L4FB`` - LaRc04 fiber failure criterion + + * ``L4MT`` - LaRc04 matrix failure criterion + + * ``USR1 through USR9`` - User-defined failure criteria + + Notes + ----- + + .. _FCTYP_notes: + + The :ref:`fctyp` command modifies the list of active failure criteria. + + By default, active failure criteria include EMAX, SMAX, TWSI, and TWSR. + + The command affects any subsequent postprocessing listing and plotting commands (such as + :ref:`presol`, :ref:`prnsol`, :ref:`plesol`, :ref:`plnsol`, and :ref:`etable` ). + + A single :ref:`fctyp` command allows up to six failure-criteria labels. If needed, reissue the + command to activate or remove additional failure-criteria types. + """ + command = f"FCTYP,{oper},{lab}" + return self.run(command, **kwargs) diff --git a/src/ansys/mapdl/core/_commands/post1/listing.py b/src/ansys/mapdl/core/_commands/post1/listing.py new file mode 100644 index 00000000000..1c8f873321a --- /dev/null +++ b/src/ansys/mapdl/core/_commands/post1/listing.py @@ -0,0 +1,326 @@ +# Copyright (C) 2016 - 2025 ANSYS, Inc. and/or its affiliates. +# SPDX-License-Identifier: MIT +# +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to deal +# in the Software without restriction, including without limitation the rights +# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +# copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in all +# copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +# SOFTWARE. + + +class Listing: + + def format( + self, + ndigit: str = "", + ftype: str = "", + nwidth: str = "", + dsignf: str = "", + line: str = "", + char_: str = "", + exptype: str = "", + **kwargs, + ): + r"""Specifies format controls for tables. + + Mechanical APDL Command: `/FORMAT `_ + + Parameters + ---------- + ndigit : str + Number of digits (3 to 32) in first table column (usually the node or element number). Initially + defaults to 7. + + ftype : str + FORTRAN format type: + + * ``G`` - G ``xx.yy`` (default) + + * ``F`` - F ``xx.yy`` + + * ``E`` - E ``xx.yy`` + + where ``xx`` and ``yy`` are described below. + + nwidth : str + Total width (9 to 32) of the field ( ``xx`` in ``Ftype`` ). Default = 13. + + dsignf : str + Number of digits after the decimal point ( ``yy`` in F or E format) or number of significant + digits in G format. Range is 2 to ``xx`` -7 for ``Ftype`` = G or E; and 0 to ``xx`` -4 for + ``Ftype`` = F. Default = 5. + + line : str + Number of lines (11 minimum) per page. Default = ``ILINE`` or ``BLINE`` ( :ref:`page` ). + + char_ : str + Number of characters (41 to 240, system-dependent) per line before wraparound. Default = + ``ICHAR`` or ``BCHAR`` ( :ref:`page` ). + + exptype : str + Number of digits for the exponent ( ``Ftype`` = G): + + * ``3`` - Three digits (default). + + * ``2`` - Two digits. + + Notes + ----- + + .. _s-FORMAT_notes: + + Specifies various format controls for tables printed with the POST1 :ref:`prnsol`, :ref:`presol`, + :ref:`pretab`, :ref:`prrsol`, :ref:`prpath`, and :ref:`cyccalc` commands. A blank (or out-of-range) + field on the command retains the current setting. Issue :ref:`format`,STAT to display the current + settings. Issue :ref:`format`,DEFA to reestablish the initial default specifications. + + For the POST26 :ref:`prvar` command, the ``Ftype``, ``NWIDTH``, and ``DSIGNF`` fields control the + time output format. + + When viewing integer output quantities, the floating point format may lead to incorrect output + values for large integers. You should verify large integer output values via the :ref:`get` command + whenever possible. + + This command is valid in any processor. + """ + command = f"/FORMAT,{ndigit},{ftype},{nwidth},{dsignf},{line},{char_},{exptype}" + return self.run(command, **kwargs) + + def header( + self, + header: str = "", + stitle: str = "", + idstmp: str = "", + notes: str = "", + colhed: str = "", + minmax: str = "", + **kwargs, + ): + r"""Sets page and table heading print controls. + + Mechanical APDL Command: `/HEADER `_ + + Parameters + ---------- + header : str + Mechanical APDL page header (system, date, time, version, copyright, title, etc.): + + * ``ON`` - Turns this item on (default for batch mode; not available for interactive mode). + + * ``OFF`` - Turns this item off. + + * ``(blank)`` - Retains the previous setting. + + stitle : str + Subtitles (see :ref:`stitle` command): ON, OFF, or (blank) (see above). + + idstmp : str + Load step information (step number, substep number, time value): ON, OFF, or (blank) (see + above). + + notes : str + Information relative to particular table listings: ON, OFF, or (blank) (see above). + + colhed : str + Column header labels of table listings (currently only for single column tables): ON, OFF, or + (blank) (see above). + + minmax : str + Minimum/maximum information or totals after table listings: ON, OFF, or (blank) (see above). + + Notes + ----- + + .. _s-HEADER_notes: + + Sets specifications on or off for page and table heading print controls associated with the POST1 + :ref:`prnsol`, :ref:`presol`, :ref:`pretab`, :ref:`prrsol`, and :ref:`prpath` commands. If the + printout caused a top-of-form (page eject to top of next page), the top-of-form is also suppressed + with the printout. Issue :ref:`header`,STAT to display the current settings. Issue + :ref:`header`,DEFA to reset the default specifications. + + This command is valid in any processor. + """ + command = f"/HEADER,{header},{stitle},{idstmp},{notes},{colhed},{minmax}" + return self.run(command, **kwargs) + + def irlist(self, **kwargs): + r"""Prints inertia relief summary table. + + Mechanical APDL Command: `IRLIST `_ + + Notes + ----- + + .. _IRLIST_notes: + + Prints the inertia relief summary data, including the mass summary table, the total load summary + table, and the inertia relief summary table resulting from the inertia relief calculations. These + calculations are performed in the solution phase ( :ref:`solve` ) as specified by the :ref:`irlf` + or :ref:`airl` command. + + Inertia relief output is stored in the database rather than in the results file ( + :file:`Jobname.RST` ). When you issue :ref:`irlist` or :ref:`airl`, Mechanical APDL pulls the + information + from the database, which contains the inertia relief output from the most recent solution ( + :ref:`solve` ). + + This command is valid in any processor. + """ + command = "IRLIST" + return self.run(command, **kwargs) + + def page( + self, + iline: str = "", + ichar: str = "", + bline: str = "", + bchar: str = "", + comma: str = "", + **kwargs, + ): + r"""Defines the printout and screen page size. + + Mechanical APDL Command: `/PAGE `_ + + **Command default:** + + .. _s-PAGE_default: + + As defined by the items above. + + Parameters + ---------- + iline : str + Number of lines (11 minimum) per "page" or screen. Defaults to 24. Applies to interactive non- + GUI to the screen output only. + + ichar : str + Number of characters (41 to 132) per line before wraparound. Defaults to 80. Applies to + interactive non-GUI to the screen output only. + + bline : str + Number of lines (11 minimum) per page. Defaults to 56. Applies to batch mode ( ``/BATCH`` ), + diverted ( :ref:`output` ), or interactive GUI ( :ref:`menu` ) output. If negative, no page + headers are output. + + bchar : str + Number of characters (41 to 240 (system dependent)) per line before wraparound. Defaults to 140. + Applies to batch mode ( ``/BATCH`` ), diverted ( :ref:`output` ), or interactive GUI ( + :ref:`menu` ) output. + + comma : str + Input 1 to specify comma-separated output for node ( :ref:`nlist` ) and element ( :ref:`elist` ) + output. + + Notes + ----- + + .. _s-PAGE_notes: + + Defines the printout page size for batch runs and the screen page size for interactive runs. Applies + to the POST1 :ref:`prnsol`, :ref:`presol`, :ref:`pretab`, :ref:`prrsol`, and :ref:`prpath` commands. + See the :ref:`header` command for additional controls (page ejects, headers, etc.) that affect the + amount of printout. A blank (or out-of-range) value retains the previous setting. Issue :ref:`page` + ,STAT to display the current settings. Issue :ref:`page`,DEFA to reset the default specifications. + + This command is valid in any processor. + """ + command = f"/PAGE,{iline},{ichar},{bline},{bchar},{comma}" + return self.run(command, **kwargs) + + def prerr(self, **kwargs): + r"""Prints SEPC and TEPC. + + Mechanical APDL Command: `PRERR `_ + + Notes + ----- + + .. _PRERR_notes: + + Prints the percent error in structural energy norm (SEPC) and the thermal energy norm percent error + (TEPC). Approximations of mesh discretization error associated with a solution are calculated for + analyses having structural or thermal degrees of freedom. + + The structural approximation is based on the energy error (which is similar in concept to the strain + energy) and represents the error associated with the discrepancy between the calculated stress field + and the globally continuous stress field (see `POST1 - Error Approximation Technique + `_ in + the `Mechanical APDL Theory Reference + `_). This + discrepancy is due to the assumption in the elements that only the + displacements are continuous at the nodes. The stress field is calculated from the displacements and + should also be continuous, but generally is not. + + Thermal analyses may use any solid and shell thermal element having only temperature degrees of + freedom. The thermal approximation is based on the total heat flow dissipation and represents the + error associated with the discrepancy between the calculated nodal thermal flux within an element + and a continuous global thermal flux. This continuous thermal flux is calculated with the normal + nodal averaging procedure. + + The volume (result label VOLU) is used to calculate the energy error per element (result label SERR + for the structural energy error and TERR for the thermal energy error). These energy errors, along + with the appropriate energy, are then used to calculate the percent error in energy norm (SEPC for + structural and TEPC for thermal). These percentages can be listed by the :ref:`prerr` command, + retrieved by the :ref:`get` command (with labels SEPC and TEPC) for further calculations, and shown + on the displacement display ( :ref:`pldisp` ), as applicable. + + For structural analyses, the maximum absolute value of nodal stress variation of any stress + component for any node of an element (result item SDSG) is also calculated. Similarly, for thermal + gradient components, TDSG is calculated. Minimum and maximum result bounds considering the possible + effect of discretization error will be shown on contour displays ( :ref:`plnsol` ). For shell + elements, the top surface location is used to produce a meaningful percentage value. SERR, TERR, + SEPC, TEPC, SDSG, and TDSG will be updated whenever the nodal stresses or fluxes are recalculated. + + If the energy error is a significant portion of the total energy, then the analysis should be + repeated using a finer mesh to obtain a more accurate solution. The energy error is relative from + problem to problem but will converge to a zero energy error as the mesh is refined. + + **The following element- and material-type limitations apply:** + + * Valid with most 2D solid, 3D solid, axisymmetric solid, or 3D shell elements. + + * The model should have only structural or thermal degrees of freedom. + + * The analysis must be linear (for both material and geometry). + + * Multi-material (for example, composite) elements are not valid. + + * Transition regions from one material to another are not valid (that is, the entire model should + consist of one material). + + * Anisotropic materials ( :ref:`tb`,ANEL) are not considered. + + """ + command = "PRERR" + return self.run(command, **kwargs) + + def priter(self, **kwargs): + r"""Prints solution summary data. + + Mechanical APDL Command: `PRITER `_ + + Notes + ----- + + .. _PRITER_notes: + + Prints solution summary data (such as time step size, number of equilibrium iterations, convergence + values, etc.) from a static or full transient analysis. All other analyses print zeros for the data. + """ + command = "PRITER" + return self.run(command, **kwargs) diff --git a/src/ansys/mapdl/core/_commands/post1/load_case_calculations.py b/src/ansys/mapdl/core/_commands/post1/load_case_calculations.py new file mode 100644 index 00000000000..9ae4d27d853 --- /dev/null +++ b/src/ansys/mapdl/core/_commands/post1/load_case_calculations.py @@ -0,0 +1,469 @@ +# Copyright (C) 2016 - 2025 ANSYS, Inc. and/or its affiliates. +# SPDX-License-Identifier: MIT +# +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to deal +# in the Software without restriction, including without limitation the rights +# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +# copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in all +# copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +# SOFTWARE. + + +class LoadCaseCalculations: + + def lcabs(self, lcno: str = "", kabs: int | str = "", **kwargs): + r"""Specifies absolute values for load case operations. + + Mechanical APDL Command: `LCABS `_ + + Parameters + ---------- + lcno : str + Load case pointer number. If ALL, apply to all selected load cases ( :ref:`lcsel` ). + + kabs : int or str + Absolute value key: + + * ``0`` - Use algebraic values of load case ``LCNO`` in operations. + + * ``1`` - Use absolute values of load case ``LCNO`` in operations. + + Notes + ----- + + .. _LCABS_notes: + + Causes absolute values to be used in the load case operations ( :ref:`lcase` or :ref:`lcoper` ). + Absolute values are taken prior to assigning a load case factor ( :ref:`lcfact` ) and are applied + only to defined load cases ( :ref:`lcdef` ). + + When :ref:`lcabs` operates on nodal-averaged results, it may yield different numerical values + compared to the same data stored as element results. For more information, see `Nodal-Averaged + Results + `_ + """ + command = f"LCABS,{lcno},{kabs}" + return self.run(command, **kwargs) + + def lcase(self, lcno: str = "", **kwargs): + r"""Reads a load case into the database. + + Mechanical APDL Command: `LCASE `_ + + Parameters + ---------- + lcno : str + Load case pointer number ( :ref:`lcdef`,STAT). Defaults to 1. + + Notes + ----- + + .. _LCASE_notes: + + Reads a load case into the database. Load cases are created as described on the :ref:`lcdef` or + :ref:`lcwrite` commands. The results portion of the database and the applied forces and + displacements are cleared before reading the data in. Absolute values ( :ref:`lcabs` ) and scale + factors ( :ref:`lcfact` ) can be applied during the read operation. + + For details on using load case combination, see `Creating and Combining Load Cases + `_ + """ + command = f"LCASE,{lcno}" + return self.run(command, **kwargs) + + def lcdef( + self, + lcno: str = "", + lstep: str = "", + sbstep: str = "", + kimg: int | str = "", + **kwargs, + ): + r"""Creates a load case from a set of results on a results file. + + Mechanical APDL Command: `LCDEF `_ + + Parameters + ---------- + lcno : str + Arbitrary pointer number (1-99) to be assigned to the load case specified by ``LSTEP``, + ``SBSTEP`` and by the ``FILE`` command. Defaults to 1 + previous value. + + lstep : str + Load step number to be defined as the load case. Defaults to one. + + sbstep : str + Substep number. Defaults to the last substep of the load step. + + kimg : int or str + Used only with results from complex analyses: + + * ``0`` - Use real part of complex solution + + * ``1`` - Use imaginary part. + + Notes + ----- + + .. _LCDEF_notes: + + Creates a load case by establishing a pointer to a set of results on a results file (written during + the analysis solution phase). This pointer ( ``LCNO`` ) can then be used on the :ref:`lcase` or + :ref:`lcoper` commands to read the load case data into the database. + + Issue :ref:`lcdef`,ERASE to delete all load case pointers (and all load case files, if any). Issue + :ref:`lcdef`, ``LCNO``,ERASE to delete only the specific load case pointer ``LCNO`` (and its file, + if any). With the ERASE options, all pointers are deleted; however only files with the default + extension ( :ref:`lcwrite` ) are deleted. Issue :ref:`lcdef`,STAT for status of all selected load + cases ( :ref:`lcsel` ), or :ref:`lcdef`,STAT,ALL for status of all load cases. The :ref:`stat` + command may be used to list all load cases. See also :ref:`lcfile` to establish a pointer to a set + of results on a load case file (written by :ref:`lcwrite` ). Harmonic element data read from a + result file load case is stored at the zero-degree position. + + For details on using load case combination, see `Creating and Combining Load Cases + `_ + """ + command = f"LCDEF,{lcno},{lstep},{sbstep},{kimg}" + return self.run(command, **kwargs) + + def lcfact(self, lcno: str = "", fact: str = "", **kwargs): + r"""Defines scale factors for load case operations. + + Mechanical APDL Command: `LCFACT `_ + + Parameters + ---------- + lcno : str + Load case pointer number. If ALL, apply to all selected load cases ( :ref:`lcsel` ). + + fact : str + Scale factor applied to load case ``LCNO``. Blank defaults to 1.0. + + Notes + ----- + + .. _LCFACT_notes: + + Defines scale factors to be used in the load case operations ( :ref:`lcase` or :ref:`lcoper` ). + Scale factors are applied after an absolute value operation ( :ref:`lcabs` ) and are applied only to + defined load cases ( :ref:`lcdef` ). + + For details on using load case combination, see `Creating and Combining Load Cases + `_ + """ + command = f"LCFACT,{lcno},{fact}" + return self.run(command, **kwargs) + + def lcfile(self, lcno: str = "", fname: str = "", ext: str = "", **kwargs): + r"""Creates a load case from an existing load case file. + + Mechanical APDL Command: `LCFILE `_ + + Parameters + ---------- + lcno : str + Arbitrary (1-99) pointer number assigned to this load case. + + 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 :file:`Jobname`. + + ext : str + Filename extension (eight-character maximum). The extension defaults to the ``LCNO`` value + preceded by an L (for values 10-99) or by an L0 (for values 1-9). + + Notes + ----- + + .. _LCFILE_notes: + + Creates a load case by establishing a pointer to an existing load case file ( :ref:`lcwrite` ). This + pointer ( ``LCNO`` ) can then be used on the :ref:`lcase` or :ref:`lcoper` commands to read the load + case data into the database. This command is typically used to reestablish load case pointers in a + new Mechanical APDL session (pointers are not saved on the database file), or when more than one + pointer to + a single load case is desired. See the :ref:`lcdef` command for status and erase operations. See + also :ref:`lcdef` to establish a pointer to a set of results on a results file (written during the + analysis solution phase). + + For details on using load case combination, see `Creating and Combining Load Cases + `_ + """ + command = f"LCFILE,{lcno},{fname},{ext}" + return self.run(command, **kwargs) + + def lcoper( + self, + oper: str = "", + lcase1: str = "", + oper2: str = "", + lcase2: str = "", + sweepang: str = "", + **kwargs, + ): + r"""Performs load case operations. + + Mechanical APDL Command: `LCOPER `_ + + Parameters + ---------- + oper : str + Valid operations are: + + * ``ZERO`` - Zero results portion of database ( ``LCASE1`` ignored). + + * ``SQUA`` - Square database values ( ``LCASE1`` ignored). + + * ``SQRT`` - Square root of database (absolute) values ( ``LCASE1`` ignored). + + * ``LPRIN`` - Recalculate line element principal stresses ( ``LCASE1`` ignored). Stresses are as + shown for the NMISC items of the :ref:`etable` command for the specific line element type. + + * ``ADD`` - Add ``LCASE1`` to database values. + + * ``SUB`` - Subtract ``LCASE1`` from database values. + + * ``SRSS`` - Square root of the sum of the squares of database and ``LCASE1``. + + * ``MIN`` - Compare and save in database the algebraic minimum of database and ``LCASE1``. + + * ``MAX`` - Compare and save in database the algebraic maximum of database and ``LCASE1``. + + * ``ABMN`` - Compare and save in database the absolute minimum of database and ``LCASE1`` (based on + magnitudes, then apply the corresponding sign). + + * ``ABMX`` - Compare and save in database the absolute maximum of database and ``LCASE1`` (based on + magnitudes, then apply the corresponding sign). + + lcase1 : str + First load case in the operation (if any). See ``LCNO`` of the :ref:`lcdef` command. If ALL, + repeat operations using all selected load cases ( :ref:`lcsel` ). + + oper2 : str + Valid operations are: + + * ``MULT`` - Multiplication: ``LCASE1`` \* ``LCASE2`` + + * ``CPXMAX`` - This option does a phase angle sweep to calculate the maximum of derived stresses, + equivalent strain, and principal strains for a complex solution where ``LCASE1`` is the real part + and ``LCASE2`` is the imaginary part. The ``Oper`` field is not applicable with this option. Also, + the :ref:`lcabs` and :ref:`sumtype` commands have no effect on this option. The value of S3 will be + a minimum. Absolute maximum is obtained for component quantity. This option does not apply to + derived displacement amplitude (USUM). Load case writing ( :ref:`lcwrite` ) is not supported. See + `POST1 and POST26 - Complex Results Postprocessing + `_ + + lcase2 : str + Second load case. Used only with ``Oper2`` operations. + + sweepang : str + Sweep angle increment in degrees for phase sweep. Used only with ``Oper2`` = CPXMAX. (Default = + 1°) + + Notes + ----- + + .. _LCOPER_notes: + + :ref:`lcoper` operates on the database and one or two load cases according to: + + * Database = Database ``Oper`` ( ``LCASE1`` ``Oper2`` ``LCASE2`` ) + + where operations ``Oper`` and ``Oper2`` are as described above. + + Absolute values and scale factors may be applied to the load cases before the operations ( + :ref:`lcabs`, :ref:`lcfact` ). If ``LCASE1`` is not specified, only operation ``Oper`` is performed + on the current database. If ``LCASE2`` is specified, operation ``Oper2`` is performed before + operation ``Oper``. If ``LCASE2`` is not specified, operation ``Oper2`` is ignored. + + Solution items not contained ( :ref:`outres` ) in either the database or the applicable load cases + will result in a null item during a load case operation. Harmonic element data read from a result + file load case are processed at zero degrees. + + Load case combinations must be performed on load cases from the same results file. Combining load + cases from different results files is not supported. + + Load case combinations of element-based solutions are performed in the solution coordinate system, + and the data resulting from load case combinations are stored in the solution coordinate system. The + resultant data are then transformed to the active results coordinate system ( :ref:`rsys` ) when + listed or displayed. Except in the cases of ``Oper`` = LPRIN, ADD, or SUB, you must use + :ref:`rsys`,SOLU to list or display results. In the case of layered elements, the layer ( + :ref:`layer` ) must also be specified. + + If `nodal-averaged results + `_ are + a part of the load case combination, the resulting nodal-averaged result data are in the global + Cartesian coordinate system. Furthermore, the resulting numerical values may differ from the same + :ref:`lcoper` operation performed on the same data stored as element results. The SQUA, SQRT, LPRIN, + and SRSS operations are not valid when applied to nodal averaged results. For more information, see + `Nodal-Averaged Results + `_ + + Use the :ref:`force` command prior to any combination operation to correctly combine the requested + force type. + + If Oper2=CPXMAX, the derived stresses and strain calculation do not apply to line elements. + + For details on using load case combination, see `Creating and Combining Load Cases + `_ + + For cyclic symmetry ( :ref:`cyclic` ), :ref:`lcoper` operates on the raw base and duplicate sector + values. It cannot be used on the expanded values ( :ref:`cycexpand` ). + """ + command = f"LCOPER,{oper},{lcase1},{oper2},{lcase2},{sweepang}" + return self.run(command, **kwargs) + + def lcsel( + self, + type_: str = "", + lcmin: str = "", + lcmax: str = "", + lcinc: str = "", + **kwargs, + ): + r"""Selects a subset of load cases. + + Mechanical APDL Command: `LCSEL `_ + + Parameters + ---------- + type_ : str + Label identifying the type of select: + + * ``S`` - Select a new set. + + * ``R`` - Reselect a set from the current set. + + * ``A`` - Additionally select a set and extend the current set. + + * ``U`` - Unselect a set from the current set. + + * ``ALL`` - Restore the full set. + + * ``NONE`` - Unselect the full set. + + * ``INVE`` - Invert the current set (selected becomes unselected and vice versa). + + * ``STAT`` - Display the current select status. + + lcmin : str + Minimum value of load case pointer range. + + lcmax : str + Maximum value of load case pointer range. ``LCMAX`` defaults to ``LCMIN``. + + lcinc : str + Value increment within range. Defaults to 1. ``LCINC`` cannot be negative. + + Notes + ----- + + .. _LCSEL_notes: + + Selects a subset of load cases for other operations. For example, to select a new set of load cases + based on load cases 1 through 7, use :ref:`lcsel`,S,1,7. The subset is used when the ALL label is + entered (or implied) on other commands, such as :ref:`lcfact`, :ref:`lcabs`, :ref:`lcoper`, etc. + Load cases are flagged as selected and unselected; no load case pointers ( :ref:`lcdef`, + :ref:`lcwrite`, :ref:`lcfile` ) are actually deleted from the database. + + For details on using load case combination, see `Creating and Combining Load Cases + `_ + """ + command = f"LCSEL,{type_},{lcmin},{lcmax},{lcinc}" + return self.run(command, **kwargs) + + def lcwrite(self, lcno: str = "", fname: str = "", ext: str = "", **kwargs): + r"""Creates a load case by writing results to a load case file. + + Mechanical APDL Command: `LCWRITE `_ + + Parameters + ---------- + lcno : str + Arbitrary pointer number (1-99) to be assigned to this load case. + + 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 :file:`Jobname`. + + ext : str + Filename extension (eight-character maximum). The extension defaults to the ``LCNO`` value + preceded by an L (for values 10-99) or by an L0 (for values 1-9). + + Notes + ----- + + .. _LCWRITE_notes: + + Creates a load case by writing the results data in the database to a load case file. The database + remains unchanged by this operation. A pointer is also established to the written set of results on + the load case file. This pointer ( ``LCNO`` ) can then be used on the :ref:`lcase` or :ref:`lcoper` + commands to read the load case data into the database. By default, only summable results data (such + as displacements, stresses, elastic strains) and constant results data (such as volume) are written + to the load case file unless requested ( :ref:`lcsum` command). Non-summable results data (such as + plastic strains, strain energy), boundary conditions, and nodal loads are not written to the load + case file. The load case file may be named by default or by a user name. Rewriting to the same file + overwrites the previous data. See the :ref:`lcdef` command for status and erase operations. + + For details on using load case combination, see `Creating and Combining Load Cases + `_ + """ + command = f"LCWRITE,{lcno},{fname},{ext}" + return self.run(command, **kwargs) + + def lczero(self, **kwargs): + r"""Zeroes the results portion of the database. + + Mechanical APDL Command: `LCZERO `_ + + Notes + ----- + + .. _LCZERO_notes: + + Often used before the :ref:`lcoper` command. Same as :ref:`lcoper`,ZERO. + """ + command = "LCZERO" + return self.run(command, **kwargs) + + def rappnd(self, lstep: str = "", time: str = "", **kwargs): + r"""Appends results data from the database to the results file. + + Mechanical APDL Command: `RAPPND `_ + + Parameters + ---------- + lstep : str + Load step number to be assigned to the results data set. If it is the same as an existing load + step number on the results file, the appended load step will be inaccessible. Defaults to 1. + + time : str + Time value to be assigned to the results data set. Defaults to 0.0. A time value greater than + the last load step should be used. + + Notes + ----- + + .. _RAPPND_notes: + + This command is typically used to append the results from a load case combination to the results + file. See the :ref:`lcwrite` command to create a separate load case file. Only summable and constant + data are written to the results file by default; non-summable data are not written unless requested + ( :ref:`lcsum` command). ``RAPPND`` should not be used to append results from a harmonic analysis. + """ + command = f"RAPPND,{lstep},{time}" + return self.run(command, **kwargs) diff --git a/src/ansys/mapdl/core/_commands/post1/magnetics_calculations.py b/src/ansys/mapdl/core/_commands/post1/magnetics_calculations.py new file mode 100644 index 00000000000..de95af266cc --- /dev/null +++ b/src/ansys/mapdl/core/_commands/post1/magnetics_calculations.py @@ -0,0 +1,306 @@ +# Copyright (C) 2016 - 2025 ANSYS, Inc. and/or its affiliates. +# SPDX-License-Identifier: MIT +# +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to deal +# in the Software without restriction, including without limitation the rights +# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +# copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in all +# copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +# SOFTWARE. + + +class MagneticsCalculations: + + def curr2d(self, **kwargs): + r"""Calculates current flow in a 2D conductor. + + Mechanical APDL Command: `CURR2D `_ + + Notes + ----- + + .. _CURR2D_notes: + + :ref:`curr2d` invokes a macro which calculates the total current flowing in a conducting body for a + 2D planar or axisymmetric magnetic field analysis. The currents may be applied source currents or + induced currents (eddy currents). The elements of the conducting region must be selected before this + command is issued. The total current calculated by the macro is stored in the parameter TCURR. Also, + the total current and total current density are stored on a per-element basis in the element table ( + :ref:`etable` ) with the labels TCURR and JT, respectively. Use the :ref:`pletab` and :ref:`pretab` + commands to plot and list the element table items. + """ + command = "CURR2D" + return self.run(command, **kwargs) + + def emagerr(self, **kwargs): + r"""Calculates the relative error in an electrostatic or electromagnetic field analysis. + + Mechanical APDL Command: `EMAGERR `_ + + Notes + ----- + + .. _EMAGERR_notes: + + The relative error is an approximation of the mesh discretization error associated with a solution. + It is based on the discrepancy between the unaveraged, element-nodal field values and the averaged, + nodal field values. The calculation is valid within a material boundary and does not consider the + error in continuity of fields across dissimilar materials. + + For electrostatics, the field values evaluated are the electric field strength (EFSUM) and the + electric flux density (DSUM). A relative error norm of each is calculated on a per-element basis and + stored in the element table ( :ref:`etable` ) with the labels EF_ERR and D_ERR. Normalized error + values EFN_ERR and DN_ERR are also calculated and stored in the element table. Corresponding + quantities for electromagnetics are H_ERR, B_ERR, HN_ERR, and BN_ERR, which are calculated from the + magnetic field intensity (HSUM) and the magnetic flux density (BSUM). The normalized error value is + the relative error norm value divided by the peak element-nodal field value for the currently + selected elements. + + Use the :ref:`pletab` and :ref:`pretab` commands to plot and list the error norms and normalized + error values. + """ + command = "EMAGERR" + return self.run(command, **kwargs) + + def emf(self, **kwargs): + r"""Calculates the electromotive force (emf), or voltage drop along a predefined path. + + Mechanical APDL Command: `EMF `_ + + Notes + ----- + + .. _EMF_notes: + + :ref:`emf` invokes a Mechanical APDL macro which calculates the electromotive force (emf), or + voltage drop + along a predefined path (specified with the :ref:`path` command). It is valid for both 2D and 3D + electric field analysis. The calculated emf value is stored in the parameter EMF. + + You must define a line path (via the :ref:`path` command) before issuing the :ref:`emf` command + macro. The macro uses calculated values of the electric field (EF), and uses path operations for the + calculations. All path items are cleared when the macro finishes executing. + + The :ref:`emf` macro sets the "ACCURATE" mapping method and "MAT" discontinuity option on the + :ref:`pmap` command. The program retains these settings after executing the macro. + """ + command = "EMF" + return self.run(command, **kwargs) + + def emft(self, **kwargs): + r"""Summarizes electromagnetic forces and torques. + + Mechanical APDL Command: `EMFT `_ + + Notes + ----- + Use this command to summarize electromagnetic force and torque in both static electric and magnetic + problems. To use this command, select the nodes in the region of interest and make sure that all + elements are selected. If :ref:`rsys` = 0, the force is reported in the global Cartesian coordinate + system. If :ref:`rsys` ≠ 0, force is reported in the specified coordinate system. However, for + torque, if :ref:`rsys` ≠ 0, this command will account for the shift and rotation as specified by + :ref:`rsys`, but will report only the Cartesian components. + + Forces are stored as items _FXSUM, _FYSUM, _FZSUM, and _FSSUM. Torque is stored as items _TXSUM, + _TYSUM, _TZSUM, and _TSSUM. + + This command is valid only with ``PLANE121``, ``SOLID122``, ``SOLID123``, ``PLANE222``, + ``PLANE223``, ``SOLID225``, ``SOLID226``, ``SOLID227``, ``PLANE233``, ``SOLID236`` and ``SOLID237`` + elements. + """ + command = "EMFT" + return self.run(command, **kwargs) + + def fluxv(self, **kwargs): + r"""Calculates the flux passing through a closed contour. + + Mechanical APDL Command: `FLUXV `_ + + Notes + ----- + + .. _FLUXV_notes: + + :ref:`fluxv` invokes a Mechanical APDL macro which calculates the flux passing through a closed + contour + (path) predefined by :ref:`path`. + + The calculated flux is stored in the parameter FLUX. + + In a 2D analysis, at least two nodes must be defined on the path. In 3D, a path of nodes describing + a closed contour must be specified (that is, the first and last node in the path specification must + be the same). + + A counterclockwise ordering of nodes on the :ref:`ppath` command gives the correct sign on flux. + + Path operations are used for the calculations, and all path items are cleared upon completion. + + This macro is available for vector potential formulations only. + """ + command = "FLUXV" + return self.run(command, **kwargs) + + def mmf(self, **kwargs): + r"""Calculates the magnetomotive force along a path. + + Mechanical APDL Command: `MMF `_ + + Notes + ----- + + .. _MMF_notes: + + :ref:`mmf` invokes a Mechanical APDL macro which calculates the magnetomotive force (mmf) along a + predefined path ( :ref:`path` ). It is valid for both 2D and 3D magnetic field analyses. The + calculated mmf value is stored in the parameter MMF. + + A closed path ( :ref:`path` ), passing through the magnetic circuit for which mmf is to be + calculated, must be defined before this command is issued. A counterclockwise ordering of points on + the :ref:`ppath` command will yield the correct sign on the mmf. The mmf is based on Ampere's Law. + The macro makes use of calculated values of field intensity (H), and uses path operations for the + calculations. All path items are cleared upon completion. The :ref:`mmf` macro sets the "ACCURATE" + mapping method and "MAT" discontinuity option of the :ref:`pmap` command. + """ + command = "MMF" + return self.run(command, **kwargs) + + def plf2d( + self, + ncont: str = "", + olay: int | str = "", + anum: str = "", + win: str = "", + **kwargs, + ): + r"""Generates a contour line plot of equipotentials. + + Mechanical APDL Command: `PLF2D `_ + + Parameters + ---------- + ncont : str + Number of contour lines to display. Issue in multiples of 9 (that is, 9, 18, 27, etc.). Default + is 27 contour lines. + + olay : int or str + Overlay: + + * ``0`` - Overlay edge outlines by material number. + + * ``1`` - Overlay edge outlines by real constant number. + + anum : str + Highest material or real constant attribute number. Command will cycle through ``ANUM`` element + display overlays. Defaults to 10. + + win : str + Window number to which command applies. Defaults to 1. + + Notes + ----- + + .. _PLF2D_notes: + + :ref:`plf2d` invokes a Mechanical APDL macro which plots equipotentials of the degree of freedom AZ. + The + equipotential lines are parallel to flux lines and thus give a good representation of flux patterns. + + In the axisymmetric case, the display is actually r * AZ where r is the node radius. + + The macro overlays ( ``OLAY`` ) edge outlines by material number or real constant number ( ``ANUM`` + ) and enables you to control the number of contour lines to display ( ``NCONT`` ). + """ + command = f"PLF2D,{ncont},{olay},{anum},{win}" + return self.run(command, **kwargs) + + def powerh(self, **kwargs): + r"""Calculates the rms power loss in a conductor or lossy dielectric. + + Mechanical APDL Command: `POWERH `_ + + Notes + ----- + + .. _POWERH_notes: + + :ref:`powerh` invokes a Mechanical APDL macro which calculates the time-averaged (rms) power loss in + a + conductor or lossy dielectric material from a harmonic analysis. The power loss is stored in the + parameter PAVG. + + Conductor losses include solid conductors and surface conductors approximated by impedance or + shielding boundary conditions. The power-loss density for solid conductors or dielectrics is + stored in the element table with the label PLOSSD and may be listed ( :ref:`pretab` ) or displayed ( + :ref:`pletab` ). PLOSSD does not include surface losses. + + The elements of the conducting region must be selected before this command is issued. + + :ref:`powerh` is valid for 2D and 3D analyses. + """ + command = "POWERH" + return self.run(command, **kwargs) + + def senergy(self, opt: int | str = "", antype: int | str = "", **kwargs): + r"""Determines the stored magnetic energy or co-energy. + + Mechanical APDL Command: `SENERGY `_ + + Parameters + ---------- + opt : int or str + Item to be calculated: + + * ``0`` - Stored magnetic energy. + + * ``1`` - Stored magnetic co-energy. + + antype : int or str + Analysis type: + + * ``0`` - Static or transient. + + * ``1`` - Harmonic. + + Notes + ----- + + .. _SENERGY_notes: + + :ref:`senergy` invokes a Mechanical APDL macro which calculates the stored magnetic energy or co- + energy for + all selected elements. (For a harmonic analysis, the macro calculates a time-averaged (rms) stored + energy.) + + A summary table listing the energy by material number is generated. The energy density is also + calculated and stored on a per-element basis in the element table ( :ref:`etable` ) with the label + MG_ENG (energy density) or MG_COENG (co-energy density). The macro erases all other items in the + element table and retains only the energy density or co-energy density. + + Issue :ref:`pletab` and :ref:`pretab` to plot and list the energy density. + + The macro is valid for static and low-frequency magnetic field formulations. + + The macro will not calculate stored energy and co-energy for the following cases: + + * Orthotropic nonlinear permanent magnets. + + * Orthotropic nonlinear permeable materials. + + * Temperature dependent materials. + + :ref:`senergy` is restricted to MKSA units. + """ + command = f"SENERGY,{opt},{antype}" + return self.run(command, **kwargs) diff --git a/src/ansys/mapdl/core/_commands/post1/path_operations.py b/src/ansys/mapdl/core/_commands/post1/path_operations.py new file mode 100644 index 00000000000..e9240eee4b9 --- /dev/null +++ b/src/ansys/mapdl/core/_commands/post1/path_operations.py @@ -0,0 +1,1426 @@ +# Copyright (C) 2016 - 2025 ANSYS, Inc. and/or its affiliates. +# SPDX-License-Identifier: MIT +# +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to deal +# in the Software without restriction, including without limitation the rights +# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +# copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in all +# copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +# SOFTWARE. + + +class PathOperations: + + def fssect( + self, + rho: str = "", + nev: str = "", + nlod: str = "", + kbr: int | str = "", + **kwargs, + ): + r"""Calculates and stores total linearized stress components. + + Mechanical APDL Command: `FSSECT `_ + + Parameters + ---------- + rho : str + In-plane (X-Y) average radius of curvature of the inside and outside surfaces of an axisymmetric + section. If zero (or blank), a plane or 3D structure is assumed. If nonzero, an axisymmetric + structure is assumed. Use a suitably large number (see the `Mechanical APDL Theory Reference + `_) or use -1 + for an axisymmetric straight section. + + nev : str + Event number to be associated with these stresses (defaults to 1). + + nlod : str + Loading number to be associated with these stresses (defaults to 1). + + kbr : int or str + For an axisymmetric analysis ( ``RHO`` ≠ 0): + + * ``0`` - Include the thickness-direction bending stresses + + * ``1`` - Ignore the thickness-direction bending stresses + + * ``2`` - Include the thickness-direction bending stress using the same formula as the Y (axial + direction ) bending stress. Also use the same formula for the shear stress. + + Notes + ----- + + .. _FSSECT_notes: + + Calculates and stores the total linearized stress components at the ends of a section path ( + :ref:`path` ) (as defined by the first two nodes with the :ref:`ppath` command). The path must be + entirely within the selected elements (that is, there must not be any element gaps along the path). + Stresses are stored according to the fatigue event number and loading number specified. Locations + (one for each node) are associated with those previously defined for these nodes (FL) or else they + are automatically defined. Stresses are separated into six total components (SX through SXZ) and six + membrane-plus-bending (SX through SXZ) components. The temperature at each end point and the current + time are also stored along with the total stress components. Calculations are made from the stresses + currently in the database (last :ref:`set` or :ref:`lcase` command). Stresses are stored as section + coordinate components if axisymmetric or as global Cartesian coordinate components otherwise, + regardless of the active results coordinate system ( :ref:`rsys` ). The FSLIST command may be used + to list stresses. The FS command can be used to modify stored stresses. See also the :ref:`prsect` + and :ref:`plsect` commands for similar calculations. + """ + command = f"FSSECT,{rho},{nev},{nlod},{kbr}" + return self.run(command, **kwargs) + + def padele(self, delopt: str = "", **kwargs): + r"""Deletes a defined path. + + Mechanical APDL Command: `PADELE `_ + + **Command default:** + + .. _PADELE_default: + + Deletes the currently active path. + + Parameters + ---------- + delopt : str + Path delete option (one of the following): + + * ``ALL`` - Delete all defined paths. + + * ``NAME`` - Delete a specific path from the list of path definitions. (Substitute the actual path + name for NAME.) + + Notes + ----- + + .. _PADELE_notes: + + Paths are identified by individual path names. To review the current list of path names, issue the + command :ref:`path`,STATUS. + + This command is valid in the general postprocessor. + """ + command = f"PADELE,{delopt}" + return self.run(command, **kwargs) + + def paget(self, parray: str = "", popt: str = "", **kwargs): + r"""Writes current path information into an array variable. + + Mechanical APDL Command: `PAGET `_ + + Parameters + ---------- + parray : str + The name of the array parameter that Mechanical APDL creates to store the path information. If + the array parameter already exists, it will be replaced with the current path information. + + popt : str + Determines how data will be stored in the parameter specified with ``PARRAY`` : + + * ``POINTS`` - Store the path points, the nodes (if any), and coordinate system. (For information on + defining paths and path points, see the descriptions of the :ref:`path` and :ref:`ppath` commands.) + + * ``TABLE`` - Store the path data items. (See the :ref:`pdef` command description for path data + items.) + + * ``LABEL`` - Stores path data labels. + + Notes + ----- + + .. _PAGET_notes: + + Use the :ref:`paget` command with the :ref:`paput` command to store and retrieve path data in array + variables for archiving purposes. + + When retrieving path information, restore the path points (POINTS option) first, then the path data + (TABLE option), and then the path labels (LABEL option). + """ + command = f"PAGET,{parray},{popt}" + return self.run(command, **kwargs) + + def paput(self, parray: str = "", popt: str = "", **kwargs): + r"""Retrieves path information from an array variable. + + Mechanical APDL Command: `PAPUT `_ + + Parameters + ---------- + parray : str + Name of the array variable containing the path information. + + popt : str + Specifies which path data to retrieve: + + * ``POINTS`` - Retrieve path point information (specified with the :ref:`ppath` command and stored + with the :ref:`paget`,POINTS command). The path data name will be assigned to the path points. + + * ``TABLE`` - Retrieve path data items (defined via the :ref:`pdef` command and stored with the + :ref:`paget`,,TABLE command). + + * ``LABEL`` - Retrieve path labels stored with the :ref:`paget`,,LABEL command. + + Notes + ----- + + .. _PAPUT_notes: + + When retrieving path information, restore path points (POINTS option) first, then the path data + (TABLE option), and then the path labels (LABEL option). + """ + command = f"PAPUT,{parray},{popt}" + return self.run(command, **kwargs) + + def paresu(self, lab: str = "", fname: str = "", ext: str = "", **kwargs): + r"""Restores previously saved paths from a file. + + Mechanical APDL Command: `PARESU `_ + + Parameters + ---------- + lab : str + Read operation: + + * ``ALL`` - Read all paths from the selected file (default). + + 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 :file:`Jobname`. + + ext : str + Filename extension (eight-character maximum). The extension defaults to PATH if ``Fname`` is + blank. + + Notes + ----- + + .. _PARESU_notes: + + This command removes all paths from virtual memory and then reads path data from a file written with + the :ref:`pasave` command. All paths on the file will be restored. All paths currently in memory + will be deleted. + """ + command = f"PARESU,{lab},{fname},{ext}" + return self.run(command, **kwargs) + + def pasave(self, lab: str = "", fname: str = "", ext: str = "", **kwargs): + r"""Saves selected paths to an external file. + + Mechanical APDL Command: `PASAVE `_ + + Parameters + ---------- + lab : str + Write operation: + + * ``S`` - Saves only selected paths. + + * ``ALL`` - Saves all paths (default). + + * ``Pname`` - Saves the named path (from the :ref:`psel` command). + + 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 :file:`Jobname`. + + ext : str + Filename extension (eight-character maximum). + + The extension defaults to PATH if ``Fname`` is blank. + + Notes + ----- + + .. _PASAVE_notes: + + Saves the paths selected with the :ref:`psel` command to an external file (default + :file:`Jobname.path` ). + + Previous paths on this file, if any, are overwritten. The path file can be read via :ref:`paresu`. + + This command is valid in POST1. + """ + command = f"PASAVE,{lab},{fname},{ext}" + return self.run(command, **kwargs) + + def path( + self, name: str = "", npts: str = "", nsets: str = "", ndiv: str = "", **kwargs + ): + r"""Defines a path name and establishes parameters for the path. + + Mechanical APDL Command: `PATH `_ + + Parameters + ---------- + name : str + Name for this path (eight characters maximum. If ``nPts`` is blank, set the current path to the + path with this name. If ``nPts`` is greater than zero, create a path of this name. If a path + with this name already exists, replace it with a new path. If the ``NAME`` value is STATUS, + display the status for path settings. + + npts : str + The number of points used to define this path. The minimum number is two, and the maximum is + 1000. Default is 2. + + nsets : str + The number of sets of data which you can map to this path. You must specify at least four: X, Y, + Z, and S. Default is 30. + + ndiv : str + The number of divisions between adjacent points. Default is 20. There is no maximum number of + divisions. + + Notes + ----- + + .. _PATH_notes: + + The :ref:`path` command is used to define parameters for establishing a path. The path geometry is + created by the :ref:`ppath` command. Multiple paths may be defined and named; however, only one path + may be active for data interpolation ( :ref:`pdef` ) and data operations ( :ref:`pcalc`, etc.). Path + geometry points and data are stored in memory while in POST1. If you leave POST1, the path + information is erased. Path geometry and data may be saved in a file by archiving the data using the + :ref:`pasave` command. Path information may be restored by retrieving the data using the + :ref:`paresu` command. + + For overlapping nodes, the lowest numbered node is assigned to the path. + + The number of divisions defined using ``nDiv`` does NOT affect the number of divisions used by + :ref:`plsect` and :ref:`prsect`. + + For information on displaying paths you have defined, see `Mapping Results onto a Path + `_ + """ + command = f"PATH,{name},{npts},{nsets},{ndiv}" + return self.run(command, **kwargs) + + def pcalc( + self, + oper: str = "", + labr: str = "", + lab1: str = "", + lab2: str = "", + fact1: str = "", + fact2: str = "", + const: str = "", + **kwargs, + ): + r"""Forms additional labeled path items by operating on existing path items. + + Mechanical APDL Command: `PCALC `_ + + Parameters + ---------- + oper : str + Type of operation to be performed. See :ref:`PCALC_notes` below for specific descriptions of each operation: + + * ``ADD`` - Adds two existing path items. + + * ``MULT`` - Multiplies two existing path items. + + * ``DIV`` - Divides two existing path items (a divide by zero results in a value of zero). + + * ``EXP`` - Exponentiates and adds existing path items. + + * ``DERI`` - Finds a derivative. + + * ``INTG`` - Finds an integral. + + * ``SIN`` - Sine. + + * ``COS`` - Cosine. + + * ``ASIN`` - Arcsine. + + * ``ACOS`` - Arccosine. + + * ``LOG`` - Natural log. + + labr : str + Label assigned to the resulting path item. + + lab1 : str + First labeled path item in operation. + + lab2 : str + Second labeled path item in operation. ``Lab2`` must not be blank for the MULT, DIV, DERI, and + INTG operations. + + fact1 : str + Factor applied to ``Lab1``. A (blank) or '0' entry defaults to 1.0. + + fact2 : str + Factor applied to ``Lab2``. A (blank) or '0' entry defaults to 1.0. + + const : str + Constant value (defaults to 0.0). + + Notes + ----- + + .. _PCALC_notes: + + If ``Oper`` = ADD, the command format is: + + :ref:`pcalc`,ADD, ``LabR``, ``Lab1``, ``Lab2``, ``FACT1``, ``FACT2``, ``CONST`` + + This operation adds two existing path items according to the operation: + + ``LabR`` = ( ``FACT1`` x ``Lab1`` ) + ( ``FACT2`` x ``Lab2`` ) + ``CONST`` + + It may be used to scale the results for a single path item. + + If ``Oper`` = MULT, the command format is: + + :ref:`pcalc`,MULT, ``LabR``, ``Lab1``, ``Lab2``, ``FACT1`` + + ``Lab2`` must not be blank. This operation multiplies two existing path items according to the + operation: + + ``LabR`` = ``Lab1`` x ``Lab2`` x ``FACT1`` + + If ``Oper`` = DIV, the command format is: + + :ref:`pcalc`,DIV, ``LabR``, ``Lab1``, ``Lab2``, ``FACT1`` + + ``Lab2`` must not be blank. This operation divides two existing path items according to the + operation: + + ``LabR`` = ( ``Lab1`` / ``Lab2`` ) x ``FACT1`` + + If ``Oper`` = EXP, the command format is: + + :ref:`pcalc`,EXP, ``LabR``, ``Lab1``, ``Lab2``, ``FACT1``, ``FACT2`` + + This operation exponentiates and adds existing path items according to the operation: + + ``LabR`` = (\| ``Lab1`` \| :sup:`FACT1` ) + (\| ``Lab2`` \| :sup:`FACT2` \|) + + If ``Oper`` = DERI, the command format is: + + :ref:`pcalc`,DERI, ``LabR``, ``Lab1``, ``Lab2``, ``FACT1`` + + ``Lab2`` must not be blank. This operation finds a derivative according to the operation: + + ``LabR`` = ``FACT1`` x d( ``Lab1`` )/d( ``Lab2`` ) + + If ``Oper`` = INTG, the command format is: + + :ref:`pcalc`,INTG, ``LabR``, ``Lab1``, ``Lab2``, ``FACT1`` + + ``Lab2`` must not be blank. This operation finds an integral according to the operation: + + .. math:: + + equation not available + + Use S for ``Lab2`` to integrate ``Lab1`` with respect to the path length. S, the distance along the + path, is automatically calculated by the program when a path item is created with the :ref:`pdef` + command. + + If ``Oper`` = SIN, COS, ASIN, ACOS, or LOG, the command format is: + + :ref:`pcalc`,Oper, ``LabR``, ``Lab1``, ``FACT1``, ``CONST`` + + where the function (SIN, COS, ASIN, ACOS or LOG) is substituted for ``Oper`` and ``Lab2`` is blank. + + The operation finds the resulting path item according to one of the following formulas: + + ``LabR`` = FACT2 x ``sin(FACT1 x Lab1) + CONST`` + + ``LabR`` = FACT2 x ``cos(FACT1 x Lab1) + CONST`` + + ``LabR`` = FACT2 x ``sin`` -1(FACT1 x Lab1) + CONST + + ``LabR`` = FACT2 x ``cos`` -1(FACT1 x Lab1) + CONST + + ``LabR`` = FACT2 x ``log(FACT1 x Lab1) + CONST`` + + """ + command = f"PCALC,{oper},{labr},{lab1},{lab2},{fact1},{fact2},{const}" + return self.run(command, **kwargs) + + def pcross( + self, + labxr: str = "", + labyr: str = "", + labzr: str = "", + labx1: str = "", + laby1: str = "", + labz1: str = "", + labx2: str = "", + laby2: str = "", + labz2: str = "", + **kwargs, + ): + r"""Calculates the cross product of two path vectors along the current path. + + Mechanical APDL Command: `PCROSS `_ + + Parameters + ---------- + labxr : str + Label assigned to X-component of resultant vector. + + labyr : str + Label assigned to Y-component of resultant vector. + + labzr : str + Label assigned to Z-component of resultant vector. + + labx1 : str + X-component of first vector label (labeled path item). + + laby1 : str + Y-component of first vector label. + + labz1 : str + Z-component of first vector label. + + labx2 : str + X-component of second vector label (labeled path item). + + laby2 : str + Y-component of second vector label. + + labz2 : str + Z-component of second vector label. + """ + command = f"PCROSS,{labxr},{labyr},{labzr},{labx1},{laby1},{labz1},{labx2},{laby2},{labz2}" + return self.run(command, **kwargs) + + def pdef( + self, lab: str = "", item: str = "", comp: str = "", avglab: str = "", **kwargs + ): + r"""Interpolates an item onto a path. + + Mechanical APDL Command: `PDEF `_ + + Parameters + ---------- + lab : str + Label assigned to the resulting path item (8 characters maximum). This item may be used as input + for other path operations. + + item : str + Label identifying the item for interpolation. Valid item labels are shown in :ref:`pdef_tab_1` + below. Some items also require a component label. + + comp : str + Component of the item (if required). Valid component labels are shown in :ref:`pdef_tab_1` + below. + + avglab : str + Option to average across element boundaries: + + * ``AVG`` - Average element results across elements (default). + + * ``NOAV`` - Do not average element results across elements. If the parameter ``DISCON`` = MAT on + the :ref:`pmap` command, this option is automatically invoked. + + Notes + ----- + + .. _PDEF_notes: + + Defines and interpolates a labeled path item along a predefined path ( :ref:`path` ). Path item + results are in the global Cartesian coordinate directions unless transformed ( :ref:`rsys` ). A path + item must be defined before it can be used with other path operations. Additional path items may be + defined from the :ref:`pvect`, :ref:`pcalc`, :ref:`pdot`, and :ref:`pcross` commands. Path items may + be listed ( :ref:`prpath` ) or displayed ( :ref:`plpath`, :ref:`plpagm` ). A maximum number of path + items permitted is established by the ``nSets`` argument specified with the :ref:`path` command. + + When you create the first path item ( :ref:`pdef` or :ref:`pvect` ), the program automatically + interpolates four path items which are used to describe the geometry of the path. These predefined + items are the position of the interpolated path points (labels XG, YG, and ZG) in global Cartesian + coordinates, and the path length (label S). For alternate methods of mapping the path geometry (to + include, for example, material discontinuity) see the :ref:`pmap` command. These items may also be + listed or displayed with the :ref:`prpath`, :ref:`plpath`, and :ref:`plpagm` commands. + + If specifying that load case operations act on principal/equivalent stresses ( :ref:`sumtype`,PRIN), + derived quantities (principal and equivalent stresses/strains) will be zero for path plots. A + typical use for such a case involves mode combinations in a response spectrum analysis. + + The number of interpolation points on the path is defined by the ``nDiv`` argument on the + :ref:`path` command. See `Mapping Nodal and Element Data onto the Path + `_ + :ref:`pdef`,STAT to list the path item labels. Use :ref:`pdef`,CLEAR to erase all labeled path + items, except the path geometry items (XG, YG, ZG, S). + + See also `Mapping Results onto a Path + `_ + + .. _pdef_tab_1: + + PDEF - Valid Item and Component Labels + ************************************** + + .. flat-table:: + :header-rows: 1 + + * - Item + - Comp + - Description + * - Valid item and component labels for nodal degree of freedom results are: + * - U + - X, Y, Z, SUM + - X, Y, or Z structural displacement or vector sum. + * - ROT + - X, Y, Z, SUM + - X, Y, or Z structural rotation or vector sum. + * - TEMP[ :ref:`PDEF_temp` ] + - + - Temperature. + * - PRES + - + - Pressure. + * - VOLT + - + - Electric potential. + * - MAG + - + - Magnetic scalar potential. + * - V + - X, Y, Z, SUM + - X, Y, or Z fluid velocity or vector sum. + * - A + - X, Y, Z, SUM + - X, Y, or Z magnetic vector potential or vector sum. + * - CONC + - + - Concentration. + * - CURR + - + - Current. + * - EMF + - + - Electromotive force drop. + * - Valid item and component labels for element results are: + * - S + - X, Y, Z, XY, YZ, XZ + - Component stress. + * - " + - 1, 2, 3 + - Principal stress. + * - " + - INT, EQV + - Stress intensity or Equivalent stress. + * - EPTO + - X, Y, Z, XY, YZ, XZ + - Component total strain (EPEL + EPPL + EPCR). + * - " + - 1, 2, 3 + - Principal total strain. + * - " + - INT, EQV + - Total strain intensity or total equivalent strain. + * - EPEL + - X, Y, Z, XY, YZ, XZ + - Component elastic strain. + * - " + - 1, 2, 3 + - Principal elastic strain. + * - " + - INT, EQV + - Elastic strain intensity or elastic equivalent strain. + * - EPPL + - X, Y, Z, XY, YZ, XZ + - Component plastic strain. + * - " + - 1, 2, 3 + - Principal plastic strain. + * - " + - INT, EQV + - Plastic strain intensity or plastic equivalent strain. + * - EPCR + - X, Y, Z, XY, YZ, XZ + - Component creep strain. + * - " + - 1, 2, 3 + - Principal creep strain. + * - " + - INT, EQV + - Creep strain intensity or creep equivalent strain. + * - EPTH + - X, Y, Z, XY, YZ, XZ + - Component thermal strain. + * - " + - 1, 2, 3 + - Principal thermal strain. + * - " + - INT, EQV + - Thermal strain intensity or thermal equivalent strain. + * - EPSW + - + - Swelling strain. + * - NL + - SEPL + - Equivalent stress (from stress-strain curve). + * - " + - SRAT + - Stress state ratio. + * - " + - HPRES + - Hydrostatic pressure. + * - " + - EPEQ + - Accumulated equivalent plastic strain. + * - " + - PSV + - Plastic state variable. + * - " + - PLWK + - Plastic work/volume. + * - For contact results PowerGraphics is applicable for 3D models only. + * - CONT + - STAT :ref:`PDEFcontstat` + - Contact status. + * - " + - PENE + - Contact penetration. + * - " + - PRES + - Contact pressure. + * - " + - SFRIC + - Contact friction stress. + * - " + - STOT + - Contact total stress (pressure plus friction). + * - " + - SLIDE + - Contact sliding distance. + * - " + - GAP + - Contact gap distance. + * - " + - FLUX + - Total heat flux at contact surface. + * - TG + - X, Y, Z, SUM + - Component thermal gradient or vector sum. + * - TF + - X, Y, Z, SUM + - Component thermal flux or vector sum. + * - PG + - X, Y, Z, SUM + - Component pressure gradient or vector sum. + * - EF + - X, Y, Z, SUM + - Component electric field or vector sum. + * - D + - X, Y, Z, SUM + - Component electric flux density or vector sum. + * - JC + - X, Y, Z, SUM + - Component conduction current density or vector sum (for elements that support conduction current calculation) + * - H + - X, Y, Z, SUM + - Component magnetic field intensity or vector sum. + * - B + - X, Y, Z, SUM + - Component magnetic flux density or vector sum. + * - CG + - X, Y, Z, SUM + - Component concentration gradient or vector sum + * - DF + - X, Y, Z, SUM + - Component diffusion flux density or vector sum + * - FMAG + - X, Y, Z, SUM + - Component electromagnetic force or vector sum. + * - ETAB + - Lab + - Any user-defined element table label (see :ref:`etable` command). + * - BFE + - TEMP + - Applied and calculated temperatures along a defined path. + * - SPL + - + - Sound pressure level. + * - SPLA + - + - A-weighted sound pressure level (dBA). + + .. _PDEF_temp: + + For ``SHELL131`` and ``SHELL132`` elements with KEYOPT(3) = 0 or 1, use the labels TBOT, TE2, + TE3,..., TTOP instead of TEMP. + + .. _PDEFcontstat: + + For more information on the meaning of contact status and its possible values, see `Reviewing + Results in POST1 + `_ + """ + command = f"PDEF,{lab},{item},{comp},{avglab}" + return self.run(command, **kwargs) + + def pdot( + self, + labr: str = "", + labx1: str = "", + laby1: str = "", + labz1: str = "", + labx2: str = "", + laby2: str = "", + labz2: str = "", + **kwargs, + ): + r"""Calculates the dot product of two path vectors along the current path. + + Mechanical APDL Command: `PDOT `_ + + Parameters + ---------- + labr : str + Label assigned to dot product result. + + labx1 : str + X-component of first vector label (labeled path item). + + laby1 : str + Y-component of first vector label (labeled path item). + + labz1 : str + Z-component of first vector label (labeled path item). + + labx2 : str + X-component of second vector label (labeled path item). + + laby2 : str + Y-component of second vector label (labeled path item). + + labz2 : str + Z-component of second vector label (labeled path item). + """ + command = f"PDOT,{labr},{labx1},{laby1},{labz1},{labx2},{laby2},{labz2}" + return self.run(command, **kwargs) + + def plpagm(self, item: str = "", gscale: str = "", nopt: str = "", **kwargs): + r"""Displays path items along the path geometry. + + Mechanical APDL Command: `PLPAGM `_ + + Parameters + ---------- + item : str + The path data item to be displayed on the currently active path (defined by the :ref:`path` + command). Valid path items are those defined with the :ref:`pdef` or :ref:`plnear` commands. + + gscale : str + Scale factor for the offset from the path for the path data item displays. Defaults to 1.0. + + nopt : str + Determines how data is displayed: + + * ``(blank)`` - Do not display nodes, and scale the display based on the currently selected node set + (default). + + * ``NODE`` - Display path item data along with the currently selected set of nodes. The display + geometry is scaled to the selected node set. + + Notes + ----- + + .. _PLPAGM_notes: + + You can use the ``Gscale`` argument to scale the contour display offset from the path for clarity. + You need to type all six characters to issue this command. + + Fore more information, see `Mapping Results onto a Path + `_ + """ + command = f"PLPAGM,{item},{gscale},{nopt}" + return self.run(command, **kwargs) + + def plpath( + self, + lab1: str = "", + lab2: str = "", + lab3: str = "", + lab4: str = "", + lab5: str = "", + lab6: str = "", + **kwargs, + ): + r"""Displays path items on a graph. + + Mechanical APDL Command: `PLPATH `_ + + Parameters + ---------- + lab1 : str + Labels identifying the path items to be displayed. Up to six items may be drawn per frame. + Predefined path geometry items XG, YG, ZG, and S ( :ref:`pdef` ) may also be displayed. + + lab2 : str + Labels identifying the path items to be displayed. Up to six items may be drawn per frame. + Predefined path geometry items XG, YG, ZG, and S ( :ref:`pdef` ) may also be displayed. + + lab3 : str + Labels identifying the path items to be displayed. Up to six items may be drawn per frame. + Predefined path geometry items XG, YG, ZG, and S ( :ref:`pdef` ) may also be displayed. + + lab4 : str + Labels identifying the path items to be displayed. Up to six items may be drawn per frame. + Predefined path geometry items XG, YG, ZG, and S ( :ref:`pdef` ) may also be displayed. + + lab5 : str + Labels identifying the path items to be displayed. Up to six items may be drawn per frame. + Predefined path geometry items XG, YG, ZG, and S ( :ref:`pdef` ) may also be displayed. + + lab6 : str + Labels identifying the path items to be displayed. Up to six items may be drawn per frame. + Predefined path geometry items XG, YG, ZG, and S ( :ref:`pdef` ) may also be displayed. + + Notes + ----- + + .. _PLPATH_notes: + + The path must have been defined by the :ref:`path` and :ref:`ppath` commands. Path items and their + labels must have been defined with the :ref:`pdef`, :ref:`pvect`, :ref:`pcalc`, :ref:`pdot`, + :ref:`pcross`, or :ref:`plnear` commands. Path items may also be printed with the :ref:`prpath` + command. Graph scaling may be controlled with the :ref:`xrange`, :ref:`yrange`, and :ref:`prange` + commands. You need to type all six characters to issue this command. + + Fore more information, see `Mapping Results onto a Path + `_ + """ + command = f"PLPATH,{lab1},{lab2},{lab3},{lab4},{lab5},{lab6}" + return self.run(command, **kwargs) + + def plsect( + self, + item: str = "", + comp: str = "", + rho: str = "", + kbr: int | str = "", + kbr3d: int | str = "", + **kwargs, + ): + r"""Displays membrane and membrane-plus-bending linearized stresses. + + Mechanical APDL Command: `PLSECT `_ + + Parameters + ---------- + item : str + Label identifying the item to be processed. Valid item labels are shown in :ref:`plsect_tab_1` + below. Items also require a component label. + + comp : str + Component of the item. Valid component labels are shown in :ref:`plsect_tab_1` below. + + rho : str + In-plane (X-Y) average radius of curvature of the inside and outside surfaces of an axisymmetric + section. If zero (or blank), a plane or 3D structure is assumed. If nonzero, an axisymmetric + structure is assumed. Use a very large number (or -1) for an axisymmetric straight section. + + kbr : int or str + Through-thickness bending stresses key for an axisymmetric analysis ( ``RHO`` ≠ 0): + + * ``0`` - Include the thickness-direction bending stresses. + + * ``1`` - Ignore the thickness-direction bending stresses. + + * ``2`` - Include the thickness-direction bending stress using the same formula as the Y (axial + direction ) bending stress. Also use the same formula for the shear stress. + + kbr3d : int or str + Through-thickness bending stresses key for 3D geometry ( ``RHO`` = 0): + + * ``0`` - Include the thickness-direction bending stresses. + + * ``1`` - Ignore the following thickness-direction bending stresses: SX, SXY, SXZ + + Notes + ----- + + .. _PLSECT_notes: + + Calculates and displays the membrane and membrane-plus-bending linearized stresses (as described for + the :ref:`prsect` command) along a path section ( :ref:`path` ) as a graph. The path section is + defined by two points specified with the :ref:`ppath` command. For linearized stress calculations, + the path must be defined with nodes. The path must be entirely within the selected elements (that + is, there must not be any element gaps along the path). The total stress (equivalent to the + :ref:`plpath` display) is also displayed. This command always uses 48 divisions along the path, + regardless of the number of divisions defined by :ref:`path`. + + In analyses of 3D models with ``RHO`` = 0, ignoring the calculated out-of-plane bending stresses is + recommended in some scenarios when determining the linearized bending stresses. If ``KBR3D`` = 0, + all calculated stresses are included in the linearized bending-stress calculations. If ``KBR3D`` = + 1, these calculated out-of-plane bending stresses are ignored in the linearized bending-stress + calculations: SX, SXY, SXZ. (The principal bending-stress calculation for S1, S2, S3, SINT, and SEQV + is performed with these zeroed components.) + + Portions of this command are not supported by PowerGraphics ( :ref:`graphics`,POWER). + + .. _plsect_tab_1: + + PLSECT - Valid Item and Component Labels + **************************************** + + .. flat-table:: + :header-rows: 1 + + * - Item + - Comp + - Description + * - Valid item and component labels for element results are: + * - S + - X, Y, Z, XY, YZ, XZ + - Component stress. + * - " + - 1, 2, 3 + - Principal stress. + * - " + - INT, EQV + - Stress intensity or equivalent stress. + + """ + command = f"PLSECT,{item},{comp},{rho},{kbr},{kbr3d}" + return self.run(command, **kwargs) + + def pmap(self, form: str = "", discon: str = "", **kwargs): + r"""Creates mapping of the path geometry by defining path interpolation division points. + + Mechanical APDL Command: `PMAP `_ + + Parameters + ---------- + form : str + Defines the mapping method: + + * ``UNIFORM`` - Maps uniform divisions (specified on the ``nDiv`` argument of the :ref:`path` + command) between specified points. This is the default. + + * ``ACCURATE`` - Map geometry using a small division at the beginning and end of each segment. This + gives you accurate derivatives, integrals, tangents, and normals for curves which do not have + continuous slopes at the specified points. To create nonuniform divisions, the ``nDiv`` argument of + the :ref:`path` command must be greater than 2. + + discon : str + Sets mapping for discontinuities in the field. The divisions are modified to put a point just + before and just after the discontinuity. The valid label is MAT, for a material discontinuity. + No discontinuity is the default. Discontinuity mapping involves the NOAV option on the + :ref:`pdef` command. + """ + command = f"PMAP,{form},{discon}" + return self.run(command, **kwargs) + + def ppath( + self, + point: str = "", + node: str = "", + x: str = "", + y: str = "", + z: str = "", + cs: str = "", + **kwargs, + ): + r"""Defines a path by picking or defining nodes, or locations on the currently active working plane, or + by entering specific coordinate locations. + + Mechanical APDL Command: `PPATH `_ + + Parameters + ---------- + point : str + The point number. It must be greater than zero and less than or equal to the ``nPts`` value + specified on the :ref:`path` command if graphical picking is not being used. + + node : str + The node number defining this point. If blank, use the X, Y, Z coordinates to define the point. + A valid node number will override ``X``, ``Y``, ``Z`` coordinate arguments. + + x : str + The location of the point in the global Cartesian coordinate system. Use these arguments only if + you omit the ``NODE`` argument. + + y : str + The location of the point in the global Cartesian coordinate system. Use these arguments only if + you omit the ``NODE`` argument. + + z : str + The location of the point in the global Cartesian coordinate system. Use these arguments only if + you omit the ``NODE`` argument. + + cs : str + The coordinate system for interpolation of the path between the previous point and this point. + Omit this argument if you wish to use the currently active ( :ref:`csys` ) coordinate system. If + the coordinate system of two adjacent points is different, the ``CS`` value of the latter point + will be used. + + Notes + ----- + + .. _PPATH_notes: + + For linearized stress calculations, the path must be defined with nodes. + + This command is designed and works best in interactive (GUI) mode, using the menu paths listed + below. For command line operations, issue :ref:`ppath`,P to define your path by picking nodes. + + For information on displaying paths you have defined, see `Mapping Results onto a Path + `_ + """ + command = f"PPATH,{point},{node},{x},{y},{z},{cs}" + return self.run(command, **kwargs) + + def prange( + self, linc: str = "", vmin: str = "", vmax: str = "", xvar: str = "", **kwargs + ): + r"""Determines the path range. + + Mechanical APDL Command: `PRANGE `_ + + **Command default:** + + .. _PRANGE_default: + + Include every interpolation point and entire path distance. + + Parameters + ---------- + linc : str + Set the range for listing or displaying the table locations between a minimum value ( ``VMIN`` ) + and a maximum value ( ``VMAX`` ) of the path distance with a location increment of ``LINC`` + (defaults to 1). The first location begins at ``VMIN``. + + vmin : str + Set the range for listing or displaying the table locations between a minimum value ( ``VMIN`` ) + and a maximum value ( ``VMAX`` ) of the path distance with a location increment of ``LINC`` + (defaults to 1). The first location begins at ``VMIN``. + + vmax : str + Set the range for listing or displaying the table locations between a minimum value ( ``VMIN`` ) + and a maximum value ( ``VMAX`` ) of the path distance with a location increment of ``LINC`` + (defaults to 1). The first location begins at ``VMIN``. + + xvar : str + Path variable item to be used as the x-axis plot variable. Any valid path variable may be used ( + :ref:`pdef` command). Default variable is the path distance, S. + + Notes + ----- + + .. _PRANGE_notes: + + Determines the path distance range for use with the :ref:`prpath` and :ref:`plpath` commands. + """ + command = f"PRANGE,{linc},{vmin},{vmax},{xvar}" + return self.run(command, **kwargs) + + def prpath( + self, + lab1: str = "", + lab2: str = "", + lab3: str = "", + lab4: str = "", + lab5: str = "", + lab6: str = "", + **kwargs, + ): + r"""Prints path items along a geometry path. + + Mechanical APDL Command: `PRPATH `_ + + Parameters + ---------- + lab1 : str + Labels identifying the path items to be printed. Up to six items may be printed at a time. + Predefined path geometry items XG, YZ, ZG, and S ( :ref:`pdef` ) may also be printed. + + lab2 : str + Labels identifying the path items to be printed. Up to six items may be printed at a time. + Predefined path geometry items XG, YZ, ZG, and S ( :ref:`pdef` ) may also be printed. + + lab3 : str + Labels identifying the path items to be printed. Up to six items may be printed at a time. + Predefined path geometry items XG, YZ, ZG, and S ( :ref:`pdef` ) may also be printed. + + lab4 : str + Labels identifying the path items to be printed. Up to six items may be printed at a time. + Predefined path geometry items XG, YZ, ZG, and S ( :ref:`pdef` ) may also be printed. + + lab5 : str + Labels identifying the path items to be printed. Up to six items may be printed at a time. + Predefined path geometry items XG, YZ, ZG, and S ( :ref:`pdef` ) may also be printed. + + lab6 : str + Labels identifying the path items to be printed. Up to six items may be printed at a time. + Predefined path geometry items XG, YZ, ZG, and S ( :ref:`pdef` ) may also be printed. + + Notes + ----- + + .. _PRPATH_notes: + + Prints path items with respect to a geometry path (as defined by the :ref:`path` and :ref:`ppath` + commands). Path items and their labels must have been defined with the :ref:`pdef`, :ref:`pvect`, + :ref:`pcalc`, :ref:`pdot`, :ref:`pcross`, or :ref:`prnear` commands. Path items may also be + displayed with the :ref:`plpath` and :ref:`plpagm` commands. See the :ref:`prange` command for range + control of the path. + + Fore more information, see `Mapping Results onto a Path + `_ + """ + command = f"PRPATH,{lab1},{lab2},{lab3},{lab4},{lab5},{lab6}" + return self.run(command, **kwargs) + + def prsect( + self, rho: str = "", kbr: int | str = "", kbr3d: int | str = "", **kwargs + ): + r"""Calculates and prints linearized stresses along a section path. + + Mechanical APDL Command: `PRSECT `_ + + Parameters + ---------- + rho : str + In-plane (X-Y) average radius of curvature of the inside and outside surfaces of an axisymmetric + section. If zero (or blank), a plane or 3D structure is assumed. If nonzero, an axisymmetric + structure is assumed. Use any large number (or -1) for an axisymmetric straight section. + + kbr : int or str + Through-thickness bending stresses key for an axisymmetric analysis ( ``RHO`` ≠ 0): + + * ``0`` - Include the thickness-direction bending stresses. + + * ``1`` - Ignore the thickness-direction bending stresses. + + * ``2`` - Include the thickness-direction bending stress using the same formula as the Y (axial + direction ) bending stress. Also use the same formula for the shear stress. + + kbr3d : int or str + Through-thickness bending stresses key for 3D geometry ( ``RHO`` = 0): + + * ``0`` - Include the thickness-direction bending stresses. + + * ``1`` - Ignore the following thickness-direction bending stresses: SX, SXY, SXZ + + Notes + ----- + + .. _PRSECT_notes: + + You may want to linearize the stresses through a section and separate them into categories for + various code calculations. :ref:`prsect` calculates and reports linearized stresses along a section + path. The linearized stresses are also separated into membrane, bending, membrane plus bending, + peak, and total stress categories. + + Define your section path ( :ref:`path` and :ref:`ppath` with the NODE option). Your path must lie + entirely within the selected set of elements (that is, no element gaps may exist along the path). + :ref:`path` and :ref:`ppath` only retrieve the two end nodes; the path data is not retained. The + section path is defined by the two end nodes, and by 47 intermediate points that are automatically + determined by linear interpolation in the active display coordinate system ( :ref:`dsys` ). The + number and location of the intermediate points are not affected by the number of divisions set by + :ref:`path`,, ``nDiv``. + + Your linearized component stress values are obtained by interpolating each element``s average corner + nodal values along the section path points within each path element. :ref:`prsect` reports the + linearized component and principal stresses for each stress category at the beginning, mid-length, + and end of the section path. :ref:`prpath` can be used to report the total stresses at the + intermediate points. + + Section paths can be through any set of solid (2D plane, 2D axisymmetric or 3D) elements; however, + section paths are usually defined to be through the thickness of the structure and normal to the + inner and outer structure surfaces. Section paths (in-plane only) can also be defined for shell + element structures. + + If the ``RHO`` option is set to indicate the axisymmetric option (non-zero), :ref:`prsect` reports + the linearized stresses in the section coordinates (SX - along the path, SY - normal to the path, + and SZ - hoop direction). If the ``RHO`` option is set to indicate the 2D planar or 3D option (zero + or blank), :ref:`prsect` reports the linearized stresses in the active results coordinate system ( + :ref:`rsys` ]. If the ``RHO`` option is zero or blank and either :ref:`rsys`, SOLU or :ref:`rsys`, + -1 are active, the linearized stresses are calculated and reported in the global Cartesian + coordinate system. + + Linearized stress calculations should be performed in a rectangular coordinate system. Principal + stresses are recalculated from the component stresses and are invariant with the coordinate system + as long as SX is in the same direction at all points along the defined path. The :ref:`plsect` + command displays the linearized stresses in the same coordinate system as reported by :ref:`prsect`. + + Stress components through the section are linearized by a line integral method and separated into + constant membrane stresses, bending stresses varying linearly between end points, and peak stresses + (defined as the difference between the actual (total) stress and the membrane plus bending + combination). + + For nonaxisymmetric structures, the bending stresses are calculated such that the neutral axis is at + the midpoint of the path. Axisymmetric results include the effects of both the radius of revolution + (automatically determined from the node locations) and the in-plane average radius of curvature of + the section surfaces (user input). + + For axisymmetric cases, Mechanical APDL calculates the linearized bending stress in the through- + thickness + direction as the difference between the total outer fiber stress and the membrane stress if ``KBR`` + = 0. The calculation method may be conservative for locations with a highly nonlinear variation of + stress in the through-thickness direction. Alternatively, you can specify ``KBR`` = 2 to calculate + the bending stress using the same method and formula as the Y (axial direction) bending stress. For + more information, see the discussion of `axisymmetric cases + `_ + (specifically ) in the `Mechanical APDL Theory Reference + `_. + + In analyses of 3D models with ``RHO`` = 0, ignoring the calculated out-of-plane bending stresses is + recommended in some scenarios when determining the linearized bending stresses. If ``KBR3D`` = 0, + all calculated stresses are included in the linearized bending-stress calculations. If ``KBR3D`` = + 1, these calculated out-of-plane bending stresses are ignored in the linearized bending-stress + calculations: SX, SXY, SXZ. (The principal bending-stress calculation for S1, S2, S3, SINT, and SEQV + is performed with these zeroed components.) + + Portions of this command are not supported by PowerGraphics ( :ref:`graphics`,POWER]. + """ + command = f"PRSECT,{rho},{kbr},{kbr3d}" + return self.run(command, **kwargs) + + def psel( + self, + type_: str = "", + pname1: str = "", + pname2: str = "", + pname3: str = "", + pname4: str = "", + pname5: str = "", + pname6: str = "", + pname7: str = "", + pname8: str = "", + pname9: str = "", + pname10: str = "", + **kwargs, + ): + r"""Selects a path or paths. + + Mechanical APDL Command: `PSEL `_ + + Parameters + ---------- + type_ : str + Label identifying the type of select: + + * ``S`` - Select a new path. + + * ``R`` - Reselect a path from the current set of paths. + + * ``A`` - Additionally select a path and extend the current set of paths. + + * ``U`` - Unselect a path from the current set of paths. + + * ``ALL`` - Restore the full set of paths. + + * ``NONE`` - Unselect the full set of paths. + + * ``INV`` - Invert the current set of paths (selected becomes unselected and vice versa). + + pname1 : str + Name of existing path(s). + + pname2 : str + Name of existing path(s). + + pname3 : str + Name of existing path(s). + + pname4 : str + Name of existing path(s). + + pname5 : str + Name of existing path(s). + + pname6 : str + Name of existing path(s). + + pname7 : str + Name of existing path(s). + + pname8 : str + Name of existing path(s). + + pname9 : str + Name of existing path(s). + + pname10 : str + Name of existing path(s). + + Notes + ----- + + .. _PSEL_notes: + + Selects a path or multiple paths, up to ten. Data are flagged as selected and unselected; no data + are actually deleted from the database. There is no default for this command; you must specify a + type and pathname. + """ + command = f"PSEL,{type_},{pname1},{pname2},{pname3},{pname4},{pname5},{pname6},{pname7},{pname8},{pname9},{pname10}" + return self.run(command, **kwargs) + + def pvect( + self, + oper: str = "", + labxr: str = "", + labyr: str = "", + labzr: str = "", + **kwargs, + ): + r"""Interpolates a set of items onto a path. + + Mechanical APDL Command: `PVECT `_ + + Parameters + ---------- + oper : str + Valid operations for geometry operations along a path are: + + * ``NORM`` - Defines a unit normal vector at each interpolation point in the direction of the cross + product of the tangent to the path and the active Z axis. Resulting vector components are in the + active coordinate system (which must be Cartesian). + + * ``TANG`` - Defines a unit vector tangent to the path at each interpolation point. Vector + components are in the active coordinate system (which must be Cartesian). + + * ``RADI`` - Defines the position vector of each interpolation point of the path from the center of + the active coordinate system (which must be Cartesian). + + labxr : str + Label (8 characters maximum) assigned to X-component of the resulting vector. + + labyr : str + Label (8 characters maximum) assigned to Y-component of the resulting vector. + + labzr : str + Label (8 characters maximum) assigned to Z-component of the resulting vector. + + Notes + ----- + + .. _PVECT_notes: + + Defines and interpolates a set of labeled path items along predefined path ( :ref:`path` ) and + performs various geometric operations on these path items. A path item must be defined before it can + be used with other path operations. Additional path items may be defined with the :ref:`pdef`, + :ref:`pcalc`, :ref:`pdot`, and :ref:`pcross` commands. Path items may be listed or displayed with + the :ref:`plpath`, :ref:`plpagm` and :ref:`prpath` commands. Path geometry items (XG, YG, ZG, S) are + automatically interpolated (in the active CSYS) if not done so previously with the :ref:`pdef` + command. + """ + command = f"PVECT,{oper},{labxr},{labyr},{labzr}" + return self.run(command, **kwargs) diff --git a/src/ansys/mapdl/core/_commands/post1/results.py b/src/ansys/mapdl/core/_commands/post1/results.py new file mode 100644 index 00000000000..0a2d24a6a0b --- /dev/null +++ b/src/ansys/mapdl/core/_commands/post1/results.py @@ -0,0 +1,3746 @@ +# Copyright (C) 2016 - 2025 ANSYS, Inc. and/or its affiliates. +# SPDX-License-Identifier: MIT +# +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to deal +# in the Software without restriction, including without limitation the rights +# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +# copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in all +# copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +# SOFTWARE. + + +class Results: + + def lcsum(self, lab: str = "", **kwargs): + r"""Specifies whether to process non-summable items in load case operations. + + Mechanical APDL Command: `LCSUM `_ + + Parameters + ---------- + lab : str + Combination option + + * ``(blank)`` - Only combine summable items [default]. + + * ``ALL`` - Combine all items including non summable items. + + Notes + ----- + + .. _LCSUM_notes: + + Allows non-summable items (e.g. plastic strains) to be included in load combinations. Issue + :ref:`lcsum`,ALL before the first load case operation ( **LC** ``XX`` command). May also be used to + include nonsummable items in the appending of a results file ( :ref:`rappnd` command). + + For details on using load case combination, see `Creating and Combining Load Cases + `_ + """ + command = f"LCSUM,{lab}" + return self.run(command, **kwargs) + + def nsort( + self, + item: str = "", + comp: str = "", + order: int | str = "", + kabs: int | str = "", + numb: str = "", + sel: str = "", + **kwargs, + ): + r"""Sorts nodal data. + + Mechanical APDL Command: `NSORT `_ + + Parameters + ---------- + item : str + Label identifying the item to be sorted on. Valid item labels are shown in the table below. Some + items also require a component label. + + comp : str + Component of the item (if required). Valid component labels are shown in the table below. + + order : int or str + Order of sort operation: + + * ``0`` - Sort into descending order. + + * ``1`` - Sort into ascending order. + + kabs : int or str + Absolute value key: + + * ``0`` - Sort according to real value. + + * ``1`` - Sort according to absolute value. + + numb : str + Number of nodal data records to be sorted in ascending or descending order ( ``ORDER`` ) before + sort is stopped (remainder will be in unsorted sequence) (defaults to all nodes). + + sel : str + Allows selection of nodes in the sorted field. + + * ``(blank)`` - No selection (default). + + * ``SELECT`` - Select the nodes in the sorted list. + + Notes + ----- + + .. _NSORT_notes: + + Values are in the active coordinate system ( :ref:`csys` for input data or :ref:`rsys` for results + data). Various element results also depend upon the recalculation method and the selected results + location ( :ref:`avprin`, :ref:`rsys`, :ref:`shell`, :ref:`esel`, and :ref:`nsel` ). If simultaneous + load cases are stored, the last sorted sequence formed from any load case applies to all load cases. + Use :ref:`nusort` to restore the original order. This command is not valid with PowerGraphics. + + .. _nsort_tab_1: + + NSORT - Valid Item and Component Labels + *************************************** + + .. flat-table:: Valid Item and Component Labels :ref:`nsort`, ``Item,Comp,ORDER,KABS,NUMB,SEL`` + :header-rows: 2 + + * - Valid item and component labels for input values are: + * - Item + - Comp + - Description + * - LOC + - X, Y, Z + - X, Y, or Z location. + * - ANG + - XY, YZ, ZX + - THXY, THYZ, or THZX rotation angle. + + + .. _nsort_tab_2: + + NSORT - Valid Item and Component Labels for Nodal DOF Result Values + ******************************************************************* + + .. flat-table:: + :header-rows: 1 + + * - Item + - Comp + - Description + * - U + - X, Y, Z, SUM + - X, Y, or Z structural displacement or vector sum. + * - ROT + - X, Y, Z, SUM + - X, Y, or Z structural rotation or vector sum. + * - TEMP + - + - Temperature (includes TEMP, TBOT, TE2, TE3,..., TTOP values). + * - PRES + - + - Pressure. + * - VOLT + - + - Electric potential. + * - MAG + - + - Magnetic scalar potential. + * - V + - X, Y, Z, SUM + - X, Y, or Z fluid velocity or vector sum. + * - A + - X, Y, Z, SUM + - X, Y, or Z magnetic vector potential or vector sum. + * - CONC + - + - Concentration + * - CURR + - + - Current. + * - EMF + - + - Electromotive force drop. + + + .. _nsort_tab_3: + + NSORT - Valid Item and Component Labels for Element Result Values + ***************************************************************** + + .. flat-table:: + :header-rows: 1 + + * - Item + - Comp + - Description + * - S + - X, Y, Z, XY, YZ, XZ + - Component stress. + * - " + - 1, 2,3 + - Principal stress. + * - " + - INT, EQV + - Stress intensity or equivalent stress. + * - EPTO + - X, Y, Z, XY, YZ, XZ + - Component total strain (EPEL + EPPL + EPCR). + * - " + - 1, 2, 3 + - Principal total strain. + * - " + - INT, EQV + - Total strain intensity or total equivalent strain. + * - EPEL + - X, Y, Z, XY, YZ, XZ + - Component elastic strain. + * - " + - 1, 2, 3 + - Principal elastic strain. + * - " + - INT, EQV + - Elastic strain intensity or elastic equivalent strain. + * - EPPL + - X, Y, Z, XY, YZ, XZ + - Component plastic strain. + * - " + - 1, 2, 3 + - Principal plastic strain. + * - " + - INT, EQV + - Plastic strain intensity or plastic equivalent strain. + * - EPCR + - X, Y, Z, XY, YZ, XZ + - Component creep strain. + * - " + - 1, 2, 3 + - Principal creep strain. + * - " + - INT, EQV + - Creep strain intensity or creep equivalent strain. + * - EPTH + - X, Y, Z, XY, YZ, XZ + - Component thermal strain. + * - " + - 1, 2, 3 + - Principal thermal strain. + * - " + - INT, EQV + - Thermal strain intensity or thermal equivalent strain. + * - EPSW + - + - Swelling strain. + * - EPDI + - X, Y, Z, XY, YZ, XZ + - Component diffusion strain. + * - " + - 1, 2, 3 + - Principal diffusion strain. + * - " + - INT, EQV + - Diffusion strain intensity or diffusion equivalent strain. + * - NL + - SEPL + - Equivalent stress (from stress-strain curve). + * - " + - SRAT + - Stress state ratio. + * - " + - HPRES + - Hydrostatic pressure. + * - " + - EPEQ + - Accumulated equivalent plastic strain. + * - " + - PSV + - Plastic state variable. + * - " + - PLWK + - Plastic work/volume. + * - FAIL + - MAX + - Maximum of all active failure criteria defined at the current location. (See the :ref:`fctyp` command for details.) [ :ref:`NSORTinputneed` ] + * - " + - EMAX + - Maximum Strain Failure Criterion [ :ref:`NSORTinputneed` ] + * - " + - SMAX + - Maximum Stress Failure Criterion [ :ref:`NSORTinputneed` ] + * - " + - TWSI + - Tsai-Wu Strength Index Failure Criterion [ :ref:`NSORTinputneed` ] + * - " + - TWSR + - Inverse of Tsai-Wu Strength Ratio Index Failure Criterion [ :ref:`NSORTinputneed` ] + * - " + - HFIB + - Hashin Fiber Failure Criterion. [ :ref:`NSORTinputneed` ][ :ref:`nsort_tab_elemlim` ] + * - " + - HMAT + - Hashin Matrix Failure Criterion. [ :ref:`NSORTinputneed` ][ :ref:`nsort_tab_elemlim` ] + * - " + - PFIB + - Puck Fiber Failure Criterion. [ :ref:`NSORTinputneed` ][ :ref:`nsort_tab_elemlim` ] + * - " + - PMAT + - Puck Matrix Failure Criterion. [ :ref:`NSORTinputneed` ][ :ref:`nsort_tab_elemlim` ] + * - " + - USR1, USR2,..., USR9 + - User-defined failure criteria [ :ref:`NSORTinputneed` ][ :ref:`nsort_tab_elemlim` ][ :ref:`NSORT_ftnote_failcritroutine` ] + * - CONT + - STAT [ :ref:`NSORTcontstat` ] + - Contact status. + * - " + - PENE + - Contact penetration. + * - " + - PRES + - Contact pressure. + * - " + - SFRIC + - Contact friction stress. + * - " + - STOT + - Contact total stress (pressure plus friction). + * - " + - SLIDE + - Contact sliding distance. + * - TG + - X, Y, Z, SUM + - Component thermal gradient or vector sum. + * - TF + - X, Y, Z, SUM + - Component thermal flux or vector sum. + * - PG + - X, Y, Z, SUM + - Component pressure gradient or vector sum. + * - EF + - X, Y, Z, SUM + - Component electric field or vector sum. + * - D + - X, Y, Z, SUM + - Component electric flux density or vector sum. + * - H + - X, Y, Z, SUM + - Component magnetic field intensity or vector sum. + * - B + - X, Y, Z, SUM + - Component magnetic flux density or vector sum. + * - CG + - X, Y, Z, SUM + - Component concentration gradient or vector sum + * - DF + - X, Y, Z, SUM + - Component diffusion flux density or vector sum + * - FMAG + - X, Y, Z, SUM + - Component electromagnetic forces or vector sum. + + .. _NSORTinputneed: + + Works only if failure criteria information is provided. (For more information, see the documentation + for the :ref:`fc` and :ref:`tb` commands.) + + .. _nsort_tab_elemlim: + + Must be added via the :ref:`fctyp` command first. + + .. _NSORT_ftnote_failcritroutine: + + Works only if user failure criteria routine is provided. + + .. _NSORTcontstat: + + For more information about contact status and its possible values, see `Reviewing Results in POST1 + `_ + """ + command = f"NSORT,{item},{comp},{order},{kabs},{numb},{sel}" + return self.run(command, **kwargs) + + def nusort(self, **kwargs): + r"""Restores original order for nodal data. + + Mechanical APDL Command: `NUSORT `_ + + Notes + ----- + + .. _NUSORT_notes: + + This command restores the nodal data to its original order (sorted in ascending node number + sequence) after an :ref:`nsort` command. Changing the selected nodal set ( :ref:`nsel` ) also + restores the original nodal order. + """ + command = "NUSORT" + return self.run(command, **kwargs) + + def plcint( + self, + action: str = "", + id_: str = "", + node: str = "", + cont: str = "", + dtype: str = "", + **kwargs, + ): + r"""Plots the fracture parameter ( :ref:`cint` ) result data. + + Mechanical APDL Command: `PLCINT `_ + + Parameters + ---------- + action : str + * ``PATH`` - Plots :ref:`cint` quantities according to path number (default). + + * ``FRONT`` - Plots :ref:`cint` quantities distribution along the crack front. + + id_ : str + Crack ID number. + + node : str + Crack tip node number (default = ALL). + + Use only for ``ACTION`` = PATH. Plots :ref:`cint` contour for an individual crack tip node. + + cont : str + Contour number (Default = ALL). + + Use only for ``ACTION`` = FRONT. Plots :ref:`cint` distribution along the crack for a given + path. + + dtype : str + Data type to output: + + * ``JINT`` - J-integral (default) + + * ``IIN1`` - Interaction integral 1 + + * ``IIN2`` - Interaction integral 2 + + * ``IIN3`` - Interaction integral 3 + + * ``K1`` - Mode 1 stress-intensity factor + + * ``K2`` - Mode 2 stress-intensity factor + + * ``K3`` - Mode 3 stress-intensity factor + + * ``G1`` - Mode 1 energy release rate + + * ``G2`` - Mode 2 energy release rate + + * ``G3`` - Mode 3 energy release rate + + * ``GT`` - Total energy release rate + + * ``MFTX`` - Total material force X + + * ``MFTY`` - Total material force Y + + * ``MFTZ`` - Total material force Z + + * ``TSTRESS`` - T-stress + + * ``CEXT`` - Crack extension + + * ``CSTAR`` - C\2-integral + + Notes + ----- + + .. _PLCINT_notes: + + The :ref:`plcint` command is not available for `XFEM-based crack-growth + `_ + analyses results processing. + """ + command = f"PLCINT,{action},{id_},{node},{cont},{dtype}" + return self.run(command, **kwargs) + + def plcksurf(self, modeldisplay: int | str = "", **kwargs): + r"""Plots the Φ = 0 level set surface in an `XFEM-based crack analysis + `_ + + Mechanical APDL Command: `PLCKSURF `_ + + Parameters + ---------- + modeldisplay : int or str + Solid model display behavior: + + * ``0`` - No display of the solid model (default). + + * ``1`` - Solid model displayed with translucency and edges disabled. + + Notes + ----- + + .. _PLCKSURF_notes: + + The :ref:`plcksurf` command is available only for `XFEM-based crack analysis + `_ + during results processing. + """ + command = f"PLCKSURF,{modeldisplay}" + return self.run(command, **kwargs) + + def pldisp(self, kund: int | str = "", **kwargs): + r"""Displays the displaced structure. + + Mechanical APDL Command: `PLDISP `_ + + Parameters + ---------- + kund : int or str + Undisplaced shape key: + + * ``0`` - Display only displaced structure. + + * ``1`` - Overlay displaced display with similar undisplaced display (appearance is system- + dependent). + + * ``2`` - Same as 1 except overlay with undisplaced edge display (appearance is system-dependent). + + Notes + ----- + + .. _PLDISP_notes: + + Displays the displaced structure for the selected elements. + + For information on true scale plots, refer to the description of the :ref:`slashdscale` command ( + :ref:`slashdscale`,,1.0). + """ + command = f"PLDISP,{kund}" + return self.run(command, **kwargs) + + def plesol( + self, + item: str = "", + comp: str = "", + kund: int | str = "", + fact: str = "", + avg: int | str = "", + **kwargs, + ): + r"""Displays solution results as discontinuous element contours. + + Mechanical APDL Command: `PLESOL `_ + + Parameters + ---------- + item : str + Label identifying the item. Valid item labels are shown in the table below. Some items also + require a component label. + + comp : str + Component of the item (if required). Valid component labels are shown in the table below. + + kund : int or str + Undisplaced shape key: + + * ``0`` - Do not overlay undeformed structure display. + + * ``1`` - Overlay displaced contour plot with undeformed display (appearance is system-dependent). + + * ``2`` - Overlay displaced contour plot with undeformed edge display (appearance is system- + dependent). + + fact : str + Scale factor for 2D display of contact items. Default = 1. To invert the display, specify a + negative scaling factor. + + avg : int or str + Specifies whether results of reinforcing members within the same reinforcing element are smoothed: + + * ``0`` - Disable smoothing. + + * ``1`` - Enable smoothing (default), displaying constant results of reinforcing members if the base + elements are low-order, and linear results when the base elements are high-order. + + Notes + ----- + + .. _PLESOL_notes: + + :ref:`plesol` displays the solution results as element contours discontinuous across element + boundaries for the selected elements. + + For example, :ref:`plesol`,S,X displays the X component of stress S (that is, the SX stress + component). Various element results depend on the calculation method and the selected results + location ( :ref:`avprin`, :ref:`rsys`, and :ref:`esel` ). + + Contours are determined by linear interpolation within each element, unaffected by the surrounding + elements; that is, no nodal averaging occurs. The discontinuity between contours of adjacent + elements is an indication of the gradient across elements. Component results are displayed in the + active results coordinate system ( :ref:`rsys` [default is global Cartesian]). + + To display items not available via :ref:`plesol` (such as line element results), see :ref:`etable` + and :ref:`pletab`. + + For PowerGraphics displays ( :ref:`graphics`,POWER), results are plotted only for the model exterior + surface. Items not supported by PowerGraphics are noted in :ref:`plesol_tab_1`. + + The results displayed by :ref:`plesol` are unaffected by any requested nodal-averaged results ( + :ref:`outres`,NAR). For more information, see `Nodal-Averaged Results + `_ + + For ``Item`` = SRES, selected result ( :ref:`osresult` ) values are output. See :ref:`PLESOL_tab_2`. + + .. _plesol_tab_1: + + PLESOL - General Result Item and Component Labels + ************************************************* + + .. flat-table:: General Item and Component Labels :ref:`plesol`, ``Item, Comp`` + :header-rows: 1 + + * - Item + - Comp + - Description + * - :rspan:`3` S + - X, Y, Z, XY, YZ, XZ + - Component stress. + * - 1, 2, 3 + - Principal stress. + * - INT + - Stress intensity. + * - EQV + - Equivalent stress. + * - :rspan:`3` EPEL + - X, Y, Z, XY, YZ, XZ + - Component elastic strain. + * - 1, 2, 3 + - Principal elastic strain. + * - INT + - Elastic strain intensity. + * - EQV + - Elastic equivalent strain. + * - :rspan:`3` EPDI + - X, Y, Z, XY, YZ, XZ + - Component diffusion strain. Not supported by PowerGraphics. + * - 1, 2, 3 + - Principal diffusion strain. + * - EQV + - Diffusion equivalent strain. + * - INT + - Diffusion strain intensity. + * - :rspan:`3` EPPL + - X, Y, Z, XY, YZ, XZ + - Component plastic strain. + * - 1, 2, 3 + - Principal plastic strain. + * - INT + - Plastic strain intensity. + * - EQV + - Plastic equivalent strain. + * - :rspan:`3` EPCR + - X, Y, Z, XY, YZ, XZ + - Component creep strain. + * - 1, 2, 3 + - Principal creep strain. + * - INT + - Creep strain intensity. + * - EQV + - Creep equivalent strain. + * - :rspan:`3` EPTH + - X, Y, Z, XY, YZ, XZ + - Component thermal strain. + * - 1, 2, 3 + - Principal thermal strain. + * - INT + - Thermal strain intensity. + * - EQV + - Thermal equivalent strain. + * - EPSW + - + - Swelling strain. + * - :rspan:`3` EPTO + - X, Y, Z, XY, YZ, XZ + - Component total mechanical strain (EPEL + EPPL + EPCR). + * - 1, 2, 3 + - Principal total mechanical strain. + * - INT + - Total mechanical strain intensity. + * - EQV + - Total mechanical equivalent strain. + * - :rspan:`3` EPTT + - X, Y, Z, XY, YZ, XZ + - Total mechanical, thermal, diffusion, and swelling strain (EPEL + EPPL + EPCR + EPTH + EPDI + EPSW). + * - 1, 2, 3 + - Principal total mechanical, thermal, diffusion, and swelling strain. + * - INT + - Total mechanical, thermal, diffusion, and swelling strain intensity. + * - EQV + - Total mechanical, thermal, diffusion, and swelling equivalent strain. + * - :rspan:`6` NL + - SEPL + - Equivalent stress (from stress-strain curve). + * - SRAT + - Stress state ratio. + * - HPRES + - Hydrostatic pressure. + * - EPEQ + - Accumulated equivalent plastic strain. + * - CREQ + - Accumulated equivalent creep strain. + * - PSV + - Plastic state variable. + * - PLWK + - Plastic work/volume. + * - :rspan:`7` SEND + - ELASTIC The results for this postprocessing SEND component are invalid for ``ELBOW290`` if that element is used with viscoelastic or viscohyperelastic materials. + - Elastic strain energy density. (For `viscoelastic `_ and `sintering `_ materials, the `stored energy `_.) + * - PLASTIC + - Plastic strain energy density. + * - CREEP + - Creep strain energy density. + * - DAMAGE + - Damage strain energy density. + * - VDAM + - Viscoelastic dissipation energy density. + * - VREG + - Visco-regularization strain energy density. + * - DISS + - Structural-thermal dissipation. + * - ENTO + - Total strain energy density (sum of ELASTIC, PLASTIC, and CREEP strain energy densities). + * - :rspan:`1` CDM + - DMG + - Damage variable. + * - LM + - Maximum previous strain energy for virgin material. + * - :rspan:`13` FAIL + - MAX + - Maximum of all active failure criteria defined at the current location. Works only if failure criteria are provided ( :ref:`fc` and :ref:`tb` ). + * - EMAX + - Maximum Strain Failure Criterion. + * - SMAX + - Maximum Stress Failure Criterion. + * - TWSI + - Tsai-Wu Strength Index Failure Criterion. + * - TWSR + - Inverse of Tsai-Wu Strength Ratio Index Failure Criterion + * - HFIB + - Hashin Fiber Failure Criterion. Must first be added ( :ref:`fctyp`. + * - HMAT + - Hashin Matrix Failure Criterion. + * - PFIB + - Puck Fiber Failure Criterion. + * - PMAT + - Puck Matrix Failure Criterion. + * - L3FB + - LaRc03 Fiber Failure Criterion. + * - L3MT + - LaRc03 Matrix Failure Criterion. + * - L4FB + - LaRc04 Fiber Failure Criterion. + * - L4MT + - LaRc04 Matrix Failure Criterion. + * - USR1, USR2,..., USR9 + - User-defined failure criteria. USR1 through USR9 require a failure-criteria routine. + * - :rspan:`4` PFC + - MAX Failure criteria are based on the effective stresses in the damaged material. + - Maximum of all failure criteria defined at current location. + * - FT + - Fiber tensile failure criteria. + * - FC + - Fiber compressive failure criteria. + * - MT + - Matrix tensile failure criteria. + * - MC + - Matrix compressive failure criteria. + * - :rspan:`7` PDMG + - STAT + - Damage status (0 = undamaged, 1 = damaged, 2 = completely damaged). + * - FT + - Fiber tensile damage variable. + * - FC + - Fiber compressive damage variable. + * - MT + - Matrix tensile damage variable. + * - MC + - Matrix compressive damage variable. + * - S + - Shear damage variable (S). + * - SED + - Energy dissipated per unit volume. + * - SEDV + - Energy per unit volume due to viscous damping. + * - :rspan:`2` FCMX + - LAY + - Layer number where the maximum of all active failure criteria over the entire element occurs. + * - FC + - Number of the maximum-failure criterion over the entire element: * 1 = EMAX * 2 = SMAX * 3 = TWSI * 4 = TWSR * 5 = PFIB * 6 = PMAT * 7 = HFIB * 8 = HMAT * 9 = L3FB * 10 = L3MT * 11 = L4FB * 12 = L4MT * 13~21 = USR1~USR9 + * - VAL + - Value of the maximum failure criterion over the entire element: + * - SVAR + - 1, 2, 3,... N + - State variable. + * - GKS + - X, XY, XZ + - Gasket component stress. + * - GKD + - X, XY, XZ + - Gasket component total closure. + * - GKDI + - X, XY, XZ + - Gasket component total inelastic closure. + * - GKTH + - X, XY, XZ + - Gasket component thermal closure. + * - SS + - X, XY, XZ + - Interface traction (stress). + * - SD + - X, XY, XZ + - Interface separation. + * - :rspan:`9` CONT + - STAT + - Contact status: For MPC-based contact definitions, the value of STAT can be negative, indicating that one or more contact constraints were intentionally removed to prevent overconstraint. STAT = -3 is used for MPC bonded contact; STAT = -2 is used for MPC no-separation contact. * 3 = closed and sticking * 2 = closed and sliding * 1 = open but near contact * 0 = open and not near contact + * - PENE + - Contact penetration. + * - PRES + - Contact pressure. + * - SFRIC + - Contact friction stress. + * - STOT + - Contact total stress (pressure plus friction). + * - SLIDE + - Contact sliding distance. + * - GAP + - Contact gap distance. + * - FLUX + - Total heat flux at contact surface. + * - CNOS + - Total number of contact status changes during substep. + * - FPRS + - Fluid penetration pressure. + * - TG ``Comp`` = SUM is not supported for coupled pore-pressure-thermal (CPT ``nnn`` ) elements. + - X, Y, Z, SUM + - Component thermal gradient or vector sum. + * - TF + - X, Y, Z, SUM + - Component thermal flux or vector sum. + * - PG + - X, Y, Z, SUM + - Component or vector sum of velocity or energy density flux (room acoustics). + * - EF + - X, Y, Z, SUM + - Component electric field or vector sum. + * - D + - X, Y, Z, SUM + - Component electric flux density or vector sum. + * - H + - X, Y, Z, SUM + - Component magnetic field intensity or vector sum. + * - B + - X, Y, Z, SUM + - Component magnetic flux density or vector sum. + * - CG + - X, Y, Z, SUM + - Component concentration gradient or vector sum. + * - DF + - X, Y, Z, SUM + - Component diffusion flux density or vector sum. + * - FMAG + - X, Y, Z, SUM + - Component electromagnetic force or vector sum. + * - P + - X, Y, Z, SUM + - Poynting vector component or sum. + * - SERR Some element- and material-type limitations apply. (See :ref:`prerr`.) + - + - Structural error energy. + * - SDSG + - + - Absolute value of the maximum variation of any nodal stress component. + * - TERR + - + - Thermal error energy. + * - TDSG + - + - Absolute value of the maximum variation of any nodal thermal gradient component. + * - F + - X, Y, Z + - X, Y, or Z structural force. Do not use :ref:`plesol` to obtain contact force values for contact elements. (The force values reported may not be accurate for these elements.) Use :ref:`etable` instead. + * - M + - X, Y, Z + - X, Y, or Z structural moment. + * - HEAT + - + - Heat flow. + * - FLOW + - + - Fluid flow. + * - AMPS + - + - Current flow. Use :ref:`force` for type. + * - CHRG + - + - Charge. Use :ref:`force` for type. + * - FLUX + - + - Magnetic flux. + * - CSG + - X, Y, Z + - X, Y, or Z magnetic current segment component. + * - RATE + - + - Diffusion flow rate. + * - SENE + - + - "Stiffness" energy or thermal heat dissipation. Same as TENE. + * - STEN + - + - Elemental energy dissipation due to `stabilization `_. + * - TENE + - + - Thermal heat dissipation or "stiffness" energy. Same as SENE. + * - KENE + - + - Kinetic energy. + * - ASENE + - + - Amplitude "stiffness" energy. + * - PSENE + - + - Peak "stiffness" energy. + * - AKENE + - + - Amplitude kinetic energy. + * - PKENE + - + - Peak kinetic energy. + * - DENE + - + - Damping energy. + * - WEXT WEXT is calculated for element-based loading only (and not for nodal-force loading). WEXT is stored on elements to which loading has been applied; if surface elements are added on top of other elements, for example, and pressure loading is applied to the surface elements, WEXT is available for the surface elements only. + - + - Work due to external load. + * - AENE + - + - Artificial energy due to hourglass control/drill stiffness or due to contact stabilization. + * - JHEAT + - + - Element Joule heat generation. + * - JS + - X, Y, Z, SUM + - Source current density for low-frequency magnetic analyses. Total current density (sum of conduction and displacement current densities) in low frequency electric analyses. Components (X, Y, Z) and vector sum (SUM). + * - JT + - X, Y, Z, SUM + - Total measurable current density in low-frequency electromagnetic analyses. (Conduction current density in a low-frequency electric analysis.) Components (X, Y, Z) and vector sum (SUM). + * - JC + - X, Y, Z, SUM + - Conduction current density for elements that support conduction current calculation. Components (X, Y, Z) and vector sum (SUM). + * - MRE + - + - Magnetic Reynolds number. + * - VOLU + - + - Volume of volume element. + * - CENT + - X, Y, Z + - Centroid X, Y, or Z location (based on shape function) in the active coordinate system. + * - BFE + - TEMP For `reinforcing `_ elements ``REINF264`` and ``REINF265``, issue :ref:`plesol` ,BFE,TEMP to plot the corner-point temperature of each member. You can also plot intersection-point temperature gradients ( :ref:`plesol`,TG) and intersection-point heat flux ( :ref:`plesol`,TF). For higher-order reinforcing members (generated when using higher-order base elements), the midpoint values are not available for the reinforcing members. + - Body temperatures (calculated from applied temperatures) as used in solution (area and volume elements only). For ``SOLID278`` and ``SOLID279`` with KEYOPT(3) = 2, use :ref:`plesol`,BFE,TEMP to plot the temperature distribution through the thickness of the element. When other thermal elements are included in the model, they should be unselected to avoid plotting undefined information. + * - SMISC + - ``snum`` + - Element summable miscellaneous data value at sequence number ``snum`` (shown in the Output Data section of each element description. + * - NMISC + - ``snum`` + - Element non-summable miscellaneous data value at sequence number ``snum`` (shown in the Output Data section of each element description. + * - CAP + - C0,X0,K0,ZONE, DPLS,VPLS + - Material cap plasticity model only: Cohesion; hydrostatic compaction yielding stress; I1 at the transition point at which the shear and compaction envelopes intersect; zone = 0: elastic state, zone = 1: compaction zone, zone = 2: shear zone, zone = 3: expansion zone; effective deviatoric plastic strain; volume plastic strain. + * - EDPC + - CSIG,CSTR + - Material EDP creep model only (not including the cap model): Equivalent creep stress; equivalent creep strain. + * - FICT + - TEMP + - Fictive temperature. + * - :rspan:`3` ESIG + - X,Y,Z,XY,YZ,ZX + - Components of Biot``s effective stress. + * - 1, 2, 3 + - Principal stresses of Biot``s effective stress. + * - INT + - Stress intensity of Biot``s effective stress. + * - EQV + - Equivalent stress of Biot``s effective stress. + * - :rspan:`2` DPAR + - TPOR + - Total porosity (Gurson material model). + * - GPOR + - Porosity due to void growth. + * - NPOR + - Porosity due to void nucleation. + * - FFLX + - X,Y,Z + - Fluid flow flux in poromechanics. + * - FGRA + - X,Y,Z + - Fluid pore-pressure gradient in poromechanics. + * - MENE + - + - Acoustic potential energy. + * - PMSV + - VRAT, PPRE, DSAT, RPER + - Void volume ratio, pore pressure, degree of saturation, and relative permeability for coupled pore-pressure-thermal elements. + * - YSIDX + - TENS,SHEA + - Yield surface activity status for Mohr-Coulomb, soil, concrete, and joint rock material models: 1 = yielded, 0 = not yielded. + * - FPIDX + - TF01,SF01, TF02,SF02, TF03,SF03, TF04,SF04 + - Failure plane surface activity status for concrete and joint rock material models: 1 = yielded, 0 = not yielded. Tension and shear failure status are available for all four sets of failure planes. + * - NS + - X, Y, Z, XY, YZ, XZ + - `Nominal strain `_ for hyperelastic material, reported in the current configuration (unaffected by :ref:`rsys` ). + * - MPLA + - DMAC, DMAX + - Microplane damage, macroscopic and maximum values. + * - MPDP + - TOTA, TENS, COMP, RW + - Microplane homogenized total, tension, and compression damages (TOTA, TENS, COMP), and split weight factor (RW). + * - DAMAGE + - 1,2,3,MAX + - Damage in directions 1, 2, 3 (1, 2, 3) and the maximum damage (MAX). + * - GDMG + - + - Damage + * - IDIS + - + - Structural-thermal dissipation rate + * - BKS + - X, Y, Z, XY, YZ, XZ + - Total `nonlinear kinematic backstress `_ reported in the current configuration (unaffected by :ref:`rsys` ). Available for 3D, plane strain, and axisymmetric elements. + * - BKS1,...,BKS5 + - X, Y, Z, XY, YZ, XZ + - Superimposed components of the total `nonlinear kinematic backstress`_ reported in the current configuration (unaffected by :ref:`rsys` ). Available for 3D, plane strain, and axisymmetric elements when more than one superimposed back-stress component is defined. + * - EPFR + - + - Free strain in porous media + * - SNDI + - X, Y, Z, SUM + - Component sound intensity or vector sum. + * - FC1S + - 1,2,3,4,5,6 + - First set of six components of FCC crystal slip. Available for 3D elements only. + * - FC2S + - 1,2,3,4,5,6 + - Second set of six components of FCC crystal slip. Available for 3D elements only. + * - HC1S + - 1,2,3,4,5,6 + - Six components of HCP crystal slip on basal and prismatic systems. Available for 3D elements only. + * - HC2S + - 1,2,3,4,5,6 + - Six components of HCP crystal slip on pyramidal system. Available for 3D elements only. + * - HC3S + - 1,2,3,4,5,6 + - First set of six components of HCP crystal slip on the first-order pyramidal system. Available for 3D elements only. + * - HC4S + - 1,2,3,4,5,6 + - Second set of six components of HCP crystal slip on the first-order pyramidal system. Available for 3D elements only. + * - HC5S + - 1,2,3,4,5,6 + - Six components of HCP crystal slip on the second-order pyramidal system. Available for 3D elements only. + * - BC1S + - 1,2,3,4,5,6 + - First set of six components of BCC slip on 111 plane. Available for 3D elements only. + * - BC2S + - 1,2,3,4,5,6 + - Second set of six components of BCC slip on 111 plane. Available for 3D elements only. + * - BC3S + - 1,2,3,4,5,6 + - First set of six components of BCC slip on 112 plane. Available for 3D elements only. + * - BC4S + - 1,2,3,4,5,6 + - Second set of six components of BCC slip on 112 plane. Available for 3D elements only. + * - BC5S + - 1,2,3,4,5,6 + - First set of six components of BCC slip on 123 plane. Available for 3D elements only. + * - BC6S + - 1,2,3,4,5,6 + - Second set of six components of BCC slip on 123 plane. Available for 3D elements only. + * - BC7S + - 1,2,3,4,5,6 + - Third set of six components of BCC slip on 123 plane. Available for 3D elements only. + * - BC8S + - 1,2,3,4,5,6 + - Fourth set of six components of BCC slip on 123 plane. Available for 3D elements only. + * - FC1H + - 1,2,3,4,5,6 + - First set of six components of FCC crystal hardness. Available for 3D elements only. + * - FC2H + - 1,2,3,4,5,6 + - Second set of six components of FCC crystal hardness. Available for 3D elements only. + * - HC1H + - 1,2,3,4,5,6 + - Sixcomponents of HCP crystal hardness on basal and prismatic systems. Available for 3D elements. + * - HC2H + - 1,2,3,4,5,6 + - Six components of HCP crystal hardness on pyramidal system. Available for 3D elements only. + * - HC3H + - 1,2,3,4,5,6 + - First set of six components of HCP crystal hardness on the first-order pyramidal system. Available for 3D elements only. + * - HC4H + - 1,2,3,4,5,6 + - Second set of six components of HCP crystal hardness on the first-order pyramidal system. Available for 3D elements only. + * - HC5H + - 1,2,3,4,5,6 + - Six components of HCP crystal hardness on the second-order pyramidal system. Available for 3D elements only. + * - BC1H + - 1,2,3,4,5,6 + - First set of six components of BCC hardness on 111 plane. Available for 3D elements only. + * - BC2H + - 1,2,3,4,5,6 + - Second set of six components of BCC hardness on 111 plane. Available for 3D elements only. + * - BC3H + - 1,2,3,4,5,6 + - First set of six components of BCC hardness on 112 plane. Available for 3D elements only. + * - BC4H + - 1,2,3,4,5,6 + - Second set of six components of BCC hardness on 112 plane. Available for 3D elements only. + * - BC5H + - 1,2,3,4,5,6 + - First set of six components of BCC hardness on 123 plane. Available for 3D elements only. + * - BC6H + - 1,2,3,4,5,6 + - Second set of six components of BCC hardness on 123 plane. Available for 3D elements only. + * - BC7H + - 1,2,3,4,5,6 + - Third set of six components of BCC hardness on 123 plane. Available for 3D elements only. + * - BC8H + - 1,2,3,4,5,6 + - Fourth set of six components of BCC hardness on 123 plane. Available for 3D elements only. + * - XELG + - 1,2,3,45,6,EQV + - Crystal Lagrangian strain in 11, 22, 33, 12, 23,13 directions and its equivalent. Available for 3D elements only. + * - SINT + - RHO, ETA, SSTR, GRAIN + - Sintering relative density, viscosity, sintering stress, and average grain size values. + + + .. _PLESOL_tab_2: + + PLESOL - Selected Result Component Labels + ***************************************** + + .. flat-table:: Selected Result Component Labels :ref:`plesol`,SRES, ``Comp`` + :header-rows: 1 + + * - Comp + - Description + * - SVAR ``n`` + - The ``n`` th state variable. + * - FLDUF0 ``n`` + - The ``n`` th user-defined field variable. + + """ + command = f"PLESOL,{item},{comp},{kund},{fact},{avg}" + return self.run(command, **kwargs) + + def plnsol( + self, + item: str = "", + comp: str = "", + kund: int | str = "", + fact: str = "", + fileid: str = "", + avg: str = "", + datakey: str = "", + **kwargs, + ): + r"""Displays solution results as continuous element contours. + + Mechanical APDL Command: `PLNSOL `_ + + Parameters + ---------- + item : str + Label identifying the item. Valid item labels are shown in the table below. Some items also + require a component label. + + comp : str + Component of the item (if required). Valid component labels are shown in the table below. + + kund : int or str + Undisplaced shape key: + + * ``0`` - Do not overlay undeformed structure display. + + * ``1`` - Overlay displaced contour plot with undeformed display (appearance is system-dependent). + + * ``2`` - Overlay displaced contour plot with undeformed edge display (appearance is system- + dependent). + + fact : str + Scale factor for 2D display for contact items. Default value is 1. A negative scaling factor + inverts the display. + + fileid : str + The file index number (obtained via :ref:`nldiag`,NRRE,ON). Valid only for ``Item`` = NRRE. + + avg : str + Specifies whether random acoustic results are averaged. Valid only for ``Item`` = U and PRES. + + * ``(blank)`` - No averaging (default). + + * ``AVG`` - Display averaged results for random acoustics. + + datakey : str + Key to specify which data is plotted: + + * ``AUTO`` - `Nodal-averaged results + `_ are + used, if available; otherwise, the element-based data is used, if available. (Default.) + + * ``ESOL`` - Only element-based results are used. If they are not available, the command is ignored. + + * ``NAR`` - Only nodal-averaged results are used. If they are not available, the command is ignored. + + Notes + ----- + + .. _PLNSOL_notes: + + :ref:`plnsol` displays the solution results as continuous contours across element boundaries for the + selected nodes and elements. + + For example, :ref:`plnsol`,S,X displays the X component of stress S (that is, the SX stress + component). Various element results depend upon the recalculation method and the selected results + location ( :ref:`avprin`, :ref:`rsys`, :ref:`layer`, :ref:`shell`, and :ref:`nsel` ). + + Contours are determined by linear interpolation within each element from the nodal values, averaged + at a node whenever two or more elements connect to the same node. (The exception is FMAG, which is + summed at the node.) + + For `reinforcing + `_ + elements (REINF ``nnn`` ), contours are determined by interpolation within each reinforcing member + of reinforcing elements from the results of the base elements. Element results of members within the + same reinforcing element are smoothed based on the order of its base element. :ref:`plnsol` displays + constant results for a reinforcing element if the base elements are low-order, and linear results + when the base elements are high-order. + + For PowerGraphics displays ( :ref:`graphics`,POWER), results are plotted for the model exterior + surface only. Items not supported by PowerGraphics are noted in :ref:`plnsol_tab_1`. + + To plot midside nodes, first issue :ref:`efacet`,2. + + If `nodal-averaged results + `_ ( + :ref:`outres`,NAR or another nodal-averaged label) are in the database, then :ref:`plnsol` uses the + nodal-averaged data for the applicable items (S, EPEL, EPPL, EPCR, EPTH, EPSW) by default. You can + change this behavior via the ``DataKey`` argument. Keep these points in mind when using nodal- + averaged results: + + * The :ref:`layer` and :ref:`rsys`,SOLU commands are not valid with nodal-averaged results. If these + commands are used, the element solution is plotted instead if applicable. + + * Issuing :ref:`esel` before plotting nodal-averaged results has no effect on the output. + + * PowerGraphics is supported. The output is equivalent to the full model graphics output, but only + the appropriate surface nodes are plotted. See `Postprocessing Nodal-Averaged Results + `_ + + For ``Item`` = SRES, selected result ( :ref:`osresult` ) values are output. See :ref:`PLNSOL_tab_2`. + + .. _plnsol_tab_1: + + PLNSOL - Valid Item and Component Labels + **************************************** + + .. flat-table:: General Item and Component Labels :ref:`plnsol`, ``Item, Comp`` + :header-rows: 1 + + * - Item + - Comp + - Description + * - **Valid item and component labels for nodal degree of freedom results are:** + * - U + - X, Y, Z, SUM + - X, Y, or Z structural displacement or vector sum. + * - ROT + - X, Y, Z, SUM + - X, Y, or Z structural rotation or vector sum. + * - TEMP For ``SHELL131`` and ``SHELL132`` elements with KEYOPT(3) = 0 or 1, use the labels TBOT, TE2, TE3, ..., TTOP instead of TEMP to view the individual temperature degree of freedom. When other thermal elements are included in the model, deselect them to avoid plotting undefined information. To view all temperatures in the same plot, set :ref:`eshape` ,1 and :ref:`graphics`,POWER and issue :ref:`plnsol`,TEMP. + - + - Temperature. + * - PRES + - + - Pressure. + * - GFV1, GFV2, GFV3 + - + - Nonlocal field values 1, 2, and 3. + * - VOLT + - + - Electric potential. + * - MAG + - + - Magnetic scalar potential. + * - CONC + - + - Concentration. Not supported by PowerGraphics. + * - V + - X, Y, Z, SUM + - X, Y, or Z fluid velocity or vector sum in a fluid analysis. + * - A + - X, Y, Z, SUM + - X, Y, or Z magnetic vector potential or vector sum in an electromagnetic analysis. + * - VEL + - X, Y, Z, SUM + - X, Y, or Z velocity or vector sum in a structural transient dynamic analysis ( :ref:`antype`,TRANS). + * - ACC + - X, Y, Z, SUM + - X, Y, or Z acceleration or vector sum in a structural transient dynamic analysis ( :ref:`antype`,TRANS). + * - OMG + - X, Y, Z, SUM + - X, Y, or Z rotational velocity or vector sum in a structural transient dynamic analysis ( :ref:`antype`,TRANS). + * - DMG + - X, Y, Z, SUM + - X, Y, or Z rotational acceleration or vector sum in a structural transient dynamic analysis ( :ref:`antype`,TRANS). + * - WARP + - + - Warping. + * - :rspan:`1` NRRE + - FX, FY, FZ, FNRM, MX, MY, MZ, MNRM + - Plot the Newton-Raphson residuals from the file you obtained via the :ref:`nldiag`,NRRE,ON command. The FNRM and MNRM labels are computed as the square root of the sum of the squares of the residual component forces or moments (FX,FY,FZ, MX, MY, MZ). When plotting Newton-Raphson residual items ( ``Item`` = NRRE) from a file on the deformed geometry, the displacements are based on the current set of results in the database. These displacements may not correspond to the loadstep and substep in the :file:`.nrxxxxx` file. (For more information about :file:`.nrxxxxx` files and nonlinear diagnostics postprocessing, see the description of the :ref:`nldpost` command and.) + * - SPL + - + - Sound pressure level. + * - SPLA + - + - A-weighted sound pressure level (dBA). + * - VNS + - + - Normal velocity on the structural surface. Valid only for ``SHELL181``, ``SOLID185``, ``SOLID186``, ``SOLID187``, ``SOLSH190``, and ``SHELL281``. + * - ENKE + - + - Acoustic diffusion energy density + * - **Valid item and component labels for element results are:** + * - :rspan:`3` S + - X, Y, Z, XY, YZ, XZ + - Component stress. This item plots the solution using `nodal-averaged results `_ if they are available on the results file. + * - 1, 2, 3 + - Principal stress. + * - INT + - Stress intensity. + * - EQV + - Equivalent stress. + * - :rspan:`3` EPEL + - X, Y, Z, XY, YZ, XZ + - Component elastic strain. + * - 1, 2, 3 + - Principal elastic strain. + * - INT + - Elastic strain intensity. + * - EQV + - Elastic equivalent strain. + * - :rspan:`3` EPTH + - X, Y, Z, XY, YZ, XZ + - Component thermal strain. + * - 1, 2, 3 + - Principal thermal strain. + * - INT + - Thermal strain intensity. + * - EQV + - Thermal equivalent strain. + * - :rspan:`3` EPDI + - X, Y, Z, XY, YZ, XZ + - Component diffusion strain. + * - 1, 2, 3 + - Principal diffusion strain. + * - INT + - Diffusion strain intensity. + * - EQV + - Diffusion equivalent strain. + * - :rspan:`3` EPPL + - X, Y, Z, XY, YZ, XZ + - Component plastic strain. + * - 1, 2, 3 + - Principal plastic strain. + * - INT + - Plastic strain intensity. + * - EQV + - Plastic equivalent strain. + * - :rspan:`3` EPCR + - X, Y, Z, XY, YZ, XZ + - Component creep strain. + * - 1, 2, 3 + - Principal creep strain. + * - INT + - Creep strain intensity. + * - EQV + - Creep equivalent strain. + * - EPSW + - + - Swelling strain. + * - :rspan:`3` EPTO + - X, Y, Z, XY, YZ, XZ + - Component total mechanical strain (EPEL + EPPL + EPCR). + * - 1, 2, 3 + - Principal total mechanical strain. + * - INT + - Total mechanical strain intensity. + * - EQV + - Total mechanical equivalent strain. + * - :rspan:`3` EPTT + - X, Y, Z, XY, YZ, XZ + - Component total mechanical, thermal, diffusion, and swelling strain (EPEL + EPPL + EPCR + EPTH + EPDI + EPSW). + * - 1, 2, 3 + - Principal total, mechanical, thermal, diffusion, and swelling strain. + * - INT + - Total mechanical, thermal, diffusion, and swelling strain intensity. + * - EQV + - Total mechanical, thermal, diffusion, and swelling equivalent strain. + * - :rspan:`3` ESIG + - X,Y,Z,XY,YZ,ZX + - Components of Biot``s effective stress. + * - 1, 2, 3 + - Principal stresses of Biot``s effective stress. + * - INT + - Stress intensity of Biot``s effective stress. + * - EQV + - Equivalent stress of Biot``s effective stress. + * - :rspan:`2` DPAR + - TPOR + - Total porosity (Gurson material model). + * - GPOR + - Porosity due to void growth. + * - NPOR + - Porosity due to void nucleation. + * - :rspan:`6` NL + - SEPL + - Equivalent stress (from stress-strain curve). + * - SRAT + - Stress state ratio. + * - HPRES + - Hydrostatic pressure. + * - EPEQ + - Accumulated equivalent plastic strain. + * - CREQ + - Accumulated equivalent creep strain. + * - PSV + - Plastic state variable. + * - PLWK + - Plastic work/volume. + * - :rspan:`7` SEND + - ELASTIC The results for this postprocessing SEND component are invalid for ``ELBOW290`` if that element is used with viscoelastic or viscohyperelastic materials. + - Elastic strain energy density. (For `viscoelastic `_ and `sintering `_ materials, the `stored energy `_.) + * - PLASTIC + - Plastic strain energy density. + * - CREEP + - Creep strain energy density. + * - DAMAGE + - Damage strain energy density. + * - VDAM + - Viscoelastic dissipation energy density. + * - VREG + - Visco-regularization strain energy density. + * - DISS + - Structural-thermal dissipation. + * - ENTO + - Total strain energy density (sum of ELASTIC, PLASTIC, and CREEP strain energy densities). + * - :rspan:`1` CDM + - DMG + - Damage variable. + * - LM + - Maximum previous strain energy for virgin material. + * - :rspan:`13` FAIL + - MAX + - Maximum of all active failure criteria defined at the current location. (See :ref:`fctyp`.) Works only if failure criteria are provided ( :ref:`fc` and :ref:`tb` ). + * - EMAX + - Maximum Strain Failure Criterion. + * - SMAX + - Maximum Stress Failure Criterion. + * - TWSI + - Tsai-Wu Strength Index Failure Criterion. + * - TWSR + - Inverse of Tsai-Wu Strength Ratio Index Failure Criterion. + * - HFIB + - Hashin Fiber Failure Criterion. Must first be added ( :ref:`fctyp` ). + * - HMAT + - Hashin Matrix Failure Criterion. + * - PFIB + - Puck Fiber Failure Criterion. + * - PMAT + - Puck Matrix Failure Criterion. + * - L3FB + - LaRc03 Fiber Failure Criterion. + * - L3MT + - LaRc03 Matrix Failure Criterion. + * - L4FB + - LaRc04 Fiber Failure Criterion. + * - L4MT + - LaRc04 Matrix Failure Criterion. + * - USR1, USR2,..., USR9 + - User-defined failure criteria. USR1 through USR9 require a failure-criteria routine. + * - :rspan:`4` PFC + - MAX Failure criteria are based on the effective stresses in the damaged material. + - Maximum of all failure criteria defined at current location. + * - FT + - Fiber tensile failure criteria. + * - FC + - Fiber compressive failure criteria. + * - MT + - Matrix tensile failure criteria. + * - MC + - Matrix compressive failure criteria. + * - :rspan:`7` PDMG + - STAT + - Damage status (0 = undamaged, 1 = damaged, 2 = completely damaged). + * - FT + - Fiber tensile damage variable. + * - FC + - Fiber compressive damage variable. + * - MT + - Matrix tensile damage variable. + * - MC + - Matrix compressive damage variable. + * - S + - Shear damage variable (S). + * - SED + - Energy dissipated per unit volume. + * - SEDV + - Energy per unit volume due to viscous damping. + * - SVAR + - 1, 2, 3,... N + - State variable. + * - GKS + - X, XY, XZ + - Gasket component stress. + * - GKD + - X, XY, XZ + - Gasket component total closure. + * - GKDI + - X, XY, XZ + - Gasket component total inelastic closure. + * - GKTH + - X, XY, XZ + - Gasket component thermal closure. + * - SS + - X, XY, XZ + - Interface traction (stress). + * - SD + - X, XY, XZ + - Interface separation. + * - FICT + - TEMP + - Fictive temperature. + * - :rspan:`9` CONT For contact results, PowerGraphics is supported for 3D models only. For the CONT items for elements ``CONTA172``, ``CONTA174``, ``CONTA175``, and ``CONTA177``, the reported data is averaged across the element. To obtain a more meaningful STAT value, use :ref:`plesol`. + - STAT + - Contact status For MPC-based contact definitions, the value of STAT can be negative, indicating that one or more contact constraints were intentionally removed to prevent overconstraint. STAT = -3 is used for MPC bonded contact; STAT = -2 is used for MPC no-separation contact. : * 3 = closed and sticking * 2 = closed and sliding * 1 = open but near contact * 0 = open and not near contact + * - PENE + - Contact penetration. + * - PRES + - Contact pressure. + * - SFRIC + - Contact friction stress. + * - STOT + - Contact total stress (pressure plus friction). + * - SLIDE + - Contact sliding distance. + * - GAP + - Contact gap distance. + * - FLUX + - Total heat flux at contact surface. + * - CNOS + - Total number of contact status changes during substep. + * - FPRS + - Fluid penetration pressure. + * - TG ``Comp`` = SUM is not supported for coupled pore-pressure-thermal (CPT ``nnn`` ) elements. + - X, Y, Z, SUM + - Component thermal gradient or vector sum. + * - TF + - X, Y, Z, SUM + - Component thermal flux or vector sum. + * - PG + - X, Y, Z, SUM + - Component or vector sum of velocity or energy density flux (room acoustics). + * - EF + - X, Y, Z, SUM + - Component electric field or vector sum. + * - D + - X, Y, Z, SUM + - Component electric flux density or vector sum. + * - H + - X, Y, Z, SUM + - Component magnetic field intensity or vector sum. + * - B + - X, Y, Z, SUM + - Component magnetic flux density or vector sum. + * - CG + - X, Y, Z, SUM + - Component concentration gradient or vector sum. + * - DF + - X, Y, Z, SUM + - Component diffusion flux density or vector sum. + * - CAP + - C0,X0,K0,ZONE, DPLS,VPLS + - Material cap plasticity model only: Cohesion; hydrostatic compaction yielding stress; I1 at the transition point at which the shear and compaction envelopes intersect; zone = 0: elastic state, zone = 1: compaction zone, zone = 2: shear zone, zone = 3: expansion zone; effective deviatoric plastic strain; volume plastic strain. + * - EDPC + - CSIG,CSTR + - Material EDP creep model only (not including the cap model): Equivalent creep stress; equivalent creep strain. + * - FFLX + - X,Y,Z + - Fluid flow flux in poromechanics. + * - FGRA + - X,Y,Z + - Fluid pore-pressure gradient in poromechanics. + * - FMAG + - X, Y, Z, SUM + - Component electromagnetic force or vector sum. + * - JC + - X, Y, Z, SUM + - Conduction current density for elements that support conduction current calculation. Components (X, Y, Z) and vector sum (SUM). + * - BFE + - TEMP + - Body temperatures (calculated from applied temperatures) as used in solution (area and volume elements only). + * - PMSV + - VRAT, PPRE, DSAT, RPER + - Void volume ratio, pore pressure, degree of saturation, and relative permeability for coupled pore-pressure-thermal elements. + * - NS + - X, Y, Z, XY, YZ, XZ + - `Nominal strain `_ for hyperelastic material, reported in the current configuration (unaffected by :ref:`rsys` ). + * - MPLA + - DMAC, DMAX + - Microplane damage, macroscopic and maximum values. + * - MPDP + - TOTA, TENS, COMP, RW + - Microplane homogenized total, tension, and compression damages (TOTA, TENS, COMP), and split weight factor (RW). + * - DAMAGE + - 1,2,3,MAX + - Damage in directions 1, 2, 3 (1, 2, 3) and the maximum damage (MAX). + * - GDMG + - + - Damage + * - IDIS + - + - Structural-thermal dissipation rate + * - BKS + - X, Y, Z, XY, YZ, XZ + - Total `nonlinear kinematic backstress `_ reported in the current configuration (unaffected by :ref:`rsys` ). Available for 3D, plane strain, and axisymmetric elements. + * - BKS1,...,BKS5 + - X, Y, Z, XY, YZ, XZ + - Superimposed components of the total `nonlinear kinematic backstress`_ reported in the current configuration (unaffected by :ref:`rsys` ). Available for 3D, plane strain, and axisymmetric elements when more than one superimposed back-stress component is defined. + * - EPFR + - + - Free strain in porous media + * - SNDI + - X, Y, Z, SUM + - Component sound intensity or vector sum. + * - FC1S + - 1,2,3,4,5,6 + - First set of six components of FCC crystal slip. Available for 3D elements only. + * - FC2S + - 1,2,3,4,5,6 + - Second set of six components of FCC crystal slip. Available for 3D elements only. + * - HC1S + - 1,2,3,4,5,6 + - Six components of HCP crystal slip on basal and prismatic systems. Available for 3D elements only. + * - HC2S + - 1,2,3,4,5,6 + - Six components of HCP crystal slip on pyramidal system. Available for 3D elements only. + * - HC3S + - 1,2,3,4,5,6 + - First set of six components of HCP crystal slip on the first-order pyramidal system. Available for 3D elements only. + * - HC4S + - 1,2,3,4,5,6 + - Second set of six components of HCP crystal slip on the first-order pyramidal system. Available for 3D elements only. + * - HC5S + - 1,2,3,4,5,6 + - Six components of HCP crystal slip on the second-order pyramidal system. Available for 3D elements only. + * - BC1S + - 1,2,3,4,5,6 + - First set of six components of BCC slip on 111 plane. Available for 3D elements only. + * - BC2S + - 1,2,3,4,5,6 + - Second set of six components of BCC slip on 111 plane. Available for 3D elements only. + * - BC3S + - 1,2,3,4,5,6 + - First set of six components of BCC slip on 112 plane. Available for 3D elements only. + * - BC4S + - 1,2,3,4,5,6 + - Second set of six components of BCC slip on 112 plane. Available for 3D elements only. + * - BC5S + - 1,2,3,4,5,6 + - First set of six components of BCC slip on 123 plane. Available for 3D elements only. + * - BC6S + - 1,2,3,4,5,6 + - Second set of six components of BCC slip on 123 plane. Available for 3D elements only. + * - BC7S + - 1,2,3,4,5,6 + - Third set of six components of BCC slip on 123 plane. Available for 3D elements only. + * - BC8S + - 1,2,3,4,5,6 + - Fourth set of six components of BCC slip on 123 plane. Available for 3D elements only. + * - FC1H + - 1,2,3,4,5,6 + - First set of six components of FCC crystal hardness. Available for 3D elements only. + * - FC2H + - 1,2,3,4,5,6 + - Second set of six components of FCC crystal hardness. Available for 3D elements only. + * - HC1H + - 1,2,3,4,5,6 + - Sixcomponents of HCP crystal hardness on basal and prismatic systems. Available for 3D elements. + * - HC2H + - 1,2,3,4,5,6 + - Six components of HCP crystal hardness on pyramidal system. Available for 3D elements only. + * - HC3H + - 1,2,3,4,5,6 + - First set of six components of HCP crystal hardness on the first-order pyramidal system. Available for 3D elements only. + * - HC4H + - 1,2,3,4,5,6 + - Second set of six components of HCP crystal hardness on the first-order pyramidal system. Available for 3D elements only. + * - HC5H + - 1,2,3,4,5,6 + - Six components of HCP crystal hardness on the second-order pyramidal system. Available for 3D elements only. + * - BC1H + - 1,2,3,4,5,6 + - First set of six components of BCC hardness on 111 plane. Available for 3D elements only. + * - BC2H + - 1,2,3,4,5,6 + - Second set of six components of BCC hardness on 111 plane. Available for 3D elements only. + * - BC3H + - 1,2,3,4,5,6 + - First set of six components of BCC hardness on 112 plane. Available for 3D elements only. + * - BC4H + - 1,2,3,4,5,6 + - Second set of six components of BCC hardness on 112 plane. Available for 3D elements only. + * - BC5H + - 1,2,3,4,5,6 + - First set of six components of BCC hardness on 123 plane. Available for 3D elements only. + * - BC6H + - 1,2,3,4,5,6 + - Second set of six components of BCC hardness on 123 plane. Available for 3D elements only. + * - BC7H + - 1,2,3,4,5,6 + - Third set of six components of BCC hardness on 123 plane. Available for 3D elements only. + * - BC8H + - 1,2,3,4,5,6 + - Fourth set of six components of BCC hardness on 123 plane. Available for 3D elements only. + * - XELG + - 1,2,3,45,6,EQV + - Crystal Lagrangian strain in 11, 22, 33, 12, 23,13 directions and its equivalent. Available for 3D elements only. + * - SINT + - RHO, ETA, SSTR, GRAIN + - Sintering relative density, viscosity, sintering stress, and average grain size values. + + + .. _PLNSOL_tab_2: + + PLNSOL - Selected Result Component Labels + ***************************************** + + .. flat-table:: Selected Result Component Labels :ref:`plnsol`,SRES, ``Comp`` + :header-rows: 1 + + * - Comp + - Description + * - SVAR ``n`` + - The ``n`` th state variable. + * - FLDUF0 ``n`` + - The ``n`` th user-defined field variable. + + """ + command = f"PLNSOL,{item},{comp},{kund},{fact},{fileid},{avg},{datakey}" + return self.run(command, **kwargs) + + def plorb(self, **kwargs): + r"""Displays the orbital motion of a rotating structure + + Mechanical APDL Command: `PLORB `_ + + Notes + ----- + When a structure is rotating and the Coriolis or gyroscopic effect is taken into account ( + :ref:`coriolis` ), nodes lying on the rotation axis generally exhibit an elliptical orbital motion. + The :ref:`plorb` command displays the `orbit + `_ + of each rotating node as well as the deformed shape at time t = 0 (the real part of the solution). + + To print the characteristics of the orbital path traversed by each node, issue the :ref:`prorb` + command. + + The :ref:`plorb` command is valid for line elements (such as ``BEAM188``, ``BEAM189``, ``PIPE288``, + and ``PIPE289`` ). :ref:`plorb` is not supported for beam elements with the warping degree of + freedom activated. + + Your model must also involve a rotational velocity ( :ref:`omega` or :ref:`cmomega` ) with Coriolis + enabled ( :ref:`coriolis` ). + + Because orbit data is written in the database, a :ref:`set` command must be issued after the + :ref:`plorb` command to ensure proper output for subsequent postprocessing commands. + + The coordinate system for displaying nodal results must be global Cartesian ( :ref:`rsys`, ``KCN`` = + 0). :ref:`plorb` is not supported if nodes are rotated in a cylindrical coordinate system. + """ + command = "PLORB" + return self.run(command, **kwargs) + + def plvect( + self, + item: str = "", + lab2: str = "", + lab3: str = "", + labp: str = "", + mode: str = "", + loc: str = "", + edge: str = "", + kund: int | str = "", + **kwargs, + ): + r"""Displays results as vectors. + + Mechanical APDL Command: `PLVECT `_ + + Parameters + ---------- + item : str + Predefined vector item (from :ref:`plvect_tab_1` below) or a label identifying the i-component + of a user-defined vector. + + lab2 : str + Label identifying the j-component of a user-defined vector. In most cases, this value must be + blank if ``Item`` is selected from :ref:`plvect_tab_1`. Individual principal stresses ( ``Item`` + = S) or principal strains ( ``Item`` = EP ``xx`` ) may be plotted by specifying the value as 1, + 2, or 3. + + lab3 : str + Label identifying the k-component of a user-defined vector. Must be blank if ``Item`` is + selected from list below or for 2D user defined vector. + + labp : str + Label assigned to resultant vector for display labeling (defaults to ``Item`` ). + + mode : str + Vector or raster mode override key: + + * ``(blank)`` - Use the setting of ``KEY`` on the :ref:`device` command. + + * ``RAST`` - Use raster mode for :ref:`plvect` displays. + + * ``VECT`` - Use vector mode for :ref:`plvect` displays. + + loc : str + Vector location for display of field element results: + + * ``ELEM`` - Display at element centroid (default). + + * ``NODE`` - Display at element nodes. + + Nodal results quantities will only be displayed at nodes, not at element centroids. + + edge : str + Edge display override key: + + * ``(blank)`` - Use the setting of Key on the :ref:`edge` command. + + * ``OFF`` - Deactivate the edge display. + + * ``ON`` - Activate the edge display. + + kund : int or str + Undisplaced shape key: + + * ``0`` - Display vectors on undeformed mesh or geometry. + + * ``1`` - Display vectors on deformed mesh or geometry. + + Notes + ----- + + .. _PLVECT_notes: + + Displays various solution results as vectors (arrows) for the selected nodes and/or elements + (elements must contain at least three nodes that are not colinear). For example, :ref:`plvect`,U + displays the displacement vector for all selected nodes. For section displays ( :ref:`slashtype` ), + the vectors are shown only on the section face (that is, cutting plane). The :ref:`plvect` display + of principal strains and stresses ( ``Item`` = S, EPTO, EPEL, EPPL, EPCR, or EPTH) on a "cut" of the + model ( :ref:`slashtype`,,1,5,7,8, or 9) is not supported. The resulting plot displays the vectors + on all selected elements, not on just the sliced surface. See the :ref:`vscale` command to scale + vector lengths. Vector magnitudes may be shown as a contour display with the :ref:`plnsol` command. + Various results also depend upon the recalculation method and the selected results location ( + :ref:`layer`, :ref:`shell`, and :ref:`nsel` ). + + Items may be selected from a set of recognized vector labels ( ``Item`` ) or a vector may be defined + from up to three scalar labels ( ``Item``, ``Lab2``, ``Lab3`` ). Scalar labels may be user-defined + with the :ref:`etable` command. The vectors appear on an element display as arrows showing the + relative magnitude of the vector and its direction. The predefined items will be shown either at the + node or at the element centroid, depending on what item is being displayed and depending on the + ``Loc`` setting. User defined :ref:`etable` items will be shown at the element centroid, regardless + of the ``Loc`` setting. Stress vectors appear as arrows at the element centroid, with the arrowheads + pointing away from each other for tension and toward each other for compression. + + For PowerGraphics, vector arrow displays are generated in Global Cartesian ( :ref:`rsys` = 0). All + subsequent displays will revert to your original coordinate system. + + When vector mode is active ( ``Mode`` = VECT), use the Z-buffered display type ( :ref:`slashtype` + ,,6) to maximize speed of :ref:`plvect` plots (other hidden display types may make plotting slow). + For PowerGraphics ( :ref:`graphics`,POWER), the items marked with [ :ref:`plvect_tab3-43note1` ] are + not supported by PowerGraphics. + + It is possible to plot principal stresses ( ``Item`` = S) or principal strains ( ``Item`` = EP + ``xx`` ) individually. To do so, specify a ``Lab2`` value of 1, 2, or 3. For example, the following + are valid commands: + + * :ref:`plvect`,S,1,,,VECT,ELEM,ON,0 + * :ref:`plvect`,EPEL,3,,,VECT,NODE,ON,0 + + .. _plvect_tab_1: + + PLVECT - Valid Item Labels + ************************** + + .. flat-table:: + :header-rows: 1 + + * - Item + - Description + * - **Valid item labels for nodal degree of freedom vector results are:** + * - U + - Structural displacement vector. + * - ROT + - Structural rotation vector. + * - V + - Velocity vector. + * - A + - Magnetic vector potential vector. + * - FFLX + - Fluid flux in poromechanics. + * - **Valid item labels for structural element results are:** + * - S + - Principal stresses [ :ref:`plvect_tab3-43note1` ]. + * - EPTO + - Principal total strain (EPEL + EPPL + EPCR) [ :ref:`plvect_tab3-43note1` ]. + * - EPEL + - Principal elastic strains [ :ref:`plvect_tab3-43note1` ]. + * - EPPL + - Principal plastic strains [ :ref:`plvect_tab3-43note1` ]. + * - EPCR + - Principal creep strains [ :ref:`plvect_tab3-43note1` ]. + * - EPTH + - Principal thermal strains [ :ref:`plvect_tab3-43note1` ]. + * - EPDI + - Principal diffusion strains [ :ref:`plvect_tab3-43note1` ]. + * - **Valid item labels for field element results are:** + * - TG + - Thermal gradient vector. + * - TF + - Thermal flux vector. + * - PG + - Velocity vector or energy density flux vector (room acoustics). + * - EF + - Electric field vector. + * - D + - Electric flux density vector. + * - H + - Magnetic field intensity vector. If Lab2 is blank, Item is interpreted as one of the predefined labels; otherwise, Item is interpreted as a user-defined :ref:`et` label and the program requests a nonblank Lab2 / Lab3 according to the dimension of the problem. + * - B + - Magnetic flux density vector. + * - CG + - Concentration gradient vector. + * - DF + - Diffusion flux density vector. + * - FMAG + - Electromagnetic force vector. + * - P + - Poynting vector. + * - JS + - Source current density vector for low-frequency magnetic analyses. Total current density vector (sum of conduction and displacement current densities) in low frequency electric analyses. + * - JT + - Total measurable current density vector in low-frequency electromagnetic analyses. (Conduction current density vector in a low-frequency electric analysis.) + * - JC + - Conduction current density vector for elements that support conduction current calculation. + * - SNDI + - Sound intensity vector [ :ref:`plvect_tab3-43note1` ]. + + .. _plvect_tab3-43note1: + + Not supported by PowerGraphics + """ + command = f"PLVECT,{item},{lab2},{lab3},{labp},{mode},{loc},{edge},{kund}" + return self.run(command, **kwargs) + + def prcint(self, id_: str = "", node: str = "", dtype: str = "", **kwargs): + r"""Lists fracture parameter ( :ref:`cint` ) results data. + + Mechanical APDL Command: `PRCINT `_ + + Parameters + ---------- + id_ : str + Crack ID number. + + node : str + Crack tip node number. Default = ALL. Valid only for 3D analysis. + + dtype : str + Data type to output: + + * ``JINT`` - J-integral + + * ``IIN1`` - Interaction integral 1 + + * ``IIN2`` - Interaction integral 2 + + * ``IIN3`` - Interaction integral 3 + + * ``K1`` - Mode 1 stress-intensity factor + + * ``K2`` - Mode 2 stress-intensity factor + + * ``K3`` - Mode 3 stress-intensity factor + + * ``G1`` - Mode 1 energy release rate + + * ``G2`` - Mode 2 energy release rate + + * ``G3`` - Mode 3 energy release rate + + * ``GT`` - Total energy release rate + + * ``MFTX`` - Total material force X + + * ``MFTY`` - Total material force Y + + * ``MFTZ`` - Total material force Z + + * ``TSTRESS`` - T-stress + + * ``CEXT`` - Crack extension + + * ``CSTAR`` - C\2-integral + + * ``STTMAX`` - Maximum circumferential stress + + * ``PSMAX`` - Maximum circumferential stress when :math:`equation not available` + + * ``DLTA`` - Incremental crack extension in a `fatigue crack-growth analysis + `_ + + * ``DLTN`` - Number of incremental cycles in a fatigue crack-growth analysis + + * ``DLTK`` - Equivalent stress intensity factors in a fatigue crack-growth analysis + + * ``R`` - Stress (load) ratio in a fatigue crack-growth analysis + + * ``UFAC`` - U-factor (crack closure) in a fatigue crack-growth analysis + + * ``CRDX`` - X coordinate of the crack tip + + * ``CRDY`` - Y coordinate of the crack tip + + * ``CRDZ`` - Z coordinate of the crack tip + + * ``APOS`` - Position attribute of the crack-tip node: + + * ``Positive integer`` - The subcrack Subcracks typically appear in `SMART + `_ + crack-growth analyses and are uncommon in other types of fracture analyses. + + ID number to which this tip belongs. For a crack with only a single subcrack, this value is 1. + + * ``Negative integer`` - The absolute value of the negative integer is the subcrack ID number to + which this tip belongs. + + The negative sign indicates that this crack tip is the end of this subcrack, and that this subcrack + is a closed polygon. It must be connected to the first tip of this subcrack when the crack front is + plotted. + + For more information, see :ref:`aposexamples`. + + Notes + ----- + **Examples: APOS Usage** + + .. _aposexamples: + + The following examples show how APOS values Issuing :ref:`get` is an effective way to obtain APOS + values. + + are applied in several cases for fracture analysis. + + The most common situation is that an open crack exists in ``N`` crack tips, and all tips are + connected into a single subcrack. The APOS values for each tip are: + + This command contains some tables and extra information which can be inspected in the original + documentation pointed above. + + For a closed crack without extra subcracks, the APOS values are: + + This command contains some tables and extra information which can be inspected in the original + documentation pointed above. + + The following crack has two subcracks, the first open and the second closed. Assuming ``M`` tips on + the first subcrack and ``N`` tips on the second, the APOS values are: + + This command contains some tables and extra information which can be inspected in the original + documentation pointed above. + + .. _PRCINT_notes: + + When a crack tip node is defined, the values associated with the specified node are listed. + + ``Dtype`` = STTMAX or PSMAX are valid for `phantom-node-based + `_ + XFEM analyses only. + + ``Dtype`` = CRDX, CRDY, CRDZ, and APOS are valid only in a fatigue/static crack-growth analysis + using `SMART + `_ + or `singularity-based + `_ + XFEM. + + ``Dtype`` = DLTA, DLTN, DLTK, R are valid only in a `fatigue crack-growth analysis + `_ using `SMART + `_ + or `singularity-based + `_ + XFEM. + + ``Dtype`` = UFAC is valid only in a fatigue crack-growth analysis using `SMART + `_. + """ + command = f"PRCINT,{id_},{node},{dtype}" + return self.run(command, **kwargs) + + def prenergy( + self, + energytype: str = "", + cname1: str = "", + cname2: str = "", + cname3: str = "", + cname4: str = "", + cname5: str = "", + cname6: str = "", + **kwargs, + ): + r"""Prints the total energies of a model or the energies of the specified components. + + Mechanical APDL Command: `PRENERGY `_ + + Parameters + ---------- + energytype : str + Type of energies to be printed: + + * ``ALL`` - All energies are printed: potential, kinetic, artificial hourglass/drill stiffness, + contact stabilization energy, and artificial stabilization energy when applicable. This is the + default. + + * ``SENE`` - Potential energy (stiffness energy). + + * ``KENE`` - Kinetic energy. + + * ``DENE`` - Damping energy. + + * ``WEXT`` - Work done by external loads. + + cname1 : str + Component names for energies of the components printout. + + If ``Cname1`` is blank, the total energies are listed. + + If ``Cname1`` = ALL, the energies are listed for all selected components. + + If ``Cname1`` is neither blank nor ALL, it is the name of an existing component. The energies + are listed for up to 6 selected components named in ``Cname1`` to ``Cname6``. + + cname2 : str + Component names for energies of the components printout. + + If ``Cname1`` is blank, the total energies are listed. + + If ``Cname1`` = ALL, the energies are listed for all selected components. + + If ``Cname1`` is neither blank nor ALL, it is the name of an existing component. The energies + are listed for up to 6 selected components named in ``Cname1`` to ``Cname6``. + + cname3 : str + Component names for energies of the components printout. + + If ``Cname1`` is blank, the total energies are listed. + + If ``Cname1`` = ALL, the energies are listed for all selected components. + + If ``Cname1`` is neither blank nor ALL, it is the name of an existing component. The energies + are listed for up to 6 selected components named in ``Cname1`` to ``Cname6``. + + cname4 : str + Component names for energies of the components printout. + + If ``Cname1`` is blank, the total energies are listed. + + If ``Cname1`` = ALL, the energies are listed for all selected components. + + If ``Cname1`` is neither blank nor ALL, it is the name of an existing component. The energies + are listed for up to 6 selected components named in ``Cname1`` to ``Cname6``. + + cname5 : str + Component names for energies of the components printout. + + If ``Cname1`` is blank, the total energies are listed. + + If ``Cname1`` = ALL, the energies are listed for all selected components. + + If ``Cname1`` is neither blank nor ALL, it is the name of an existing component. The energies + are listed for up to 6 selected components named in ``Cname1`` to ``Cname6``. + + cname6 : str + Component names for energies of the components printout. + + If ``Cname1`` is blank, the total energies are listed. + + If ``Cname1`` = ALL, the energies are listed for all selected components. + + If ``Cname1`` is neither blank nor ALL, it is the name of an existing component. The energies + are listed for up to 6 selected components named in ``Cname1`` to ``Cname6``. + + Notes + ----- + + .. _PRENERGY_Notes: + + The :ref:`prenergy` command prints out either the total energies of the entire model or the energies + of the components depending on the ``Cname1`` specification. + + Only existing components based on elements (defined with the :ref:`cm` command) are supported when + component energies are listed. + + Damping energy (DENE) and work done by external loads (WEXT) are available only if the following + were set prior to the analysis solution: ``EngCalc`` = YES on the :ref:`trnopt`, :ref:`hrout` or + :ref:`mxpand` command; and ``Item`` = VENG, ESOL, or ALL on the :ref:`outres` command. + + If ``EngCalc`` = YES on the :ref:`hrout` or :ref:`mxpand` command, average, amplitude, and peak + values are returned for potential (SENE) and kinetic (KENE) energies. + + The energy values can be retrieved using the :ref:`get` command with ``Entity`` = PRENERGY. + + This command applies to structural elements only. + """ + command = f"PRENERGY,{energytype},{cname1},{cname2},{cname3},{cname4},{cname5},{cname6}" + return self.run(command, **kwargs) + + def presol(self, item: str = "", comp: str = "", **kwargs): + r"""Prints the solution results for elements. + + Mechanical APDL Command: `PRESOL `_ + + Parameters + ---------- + item : str + Label identifying the item. Valid item labels are shown in the table below. Some items also + require a component label. + + comp : str + Component of the item (if required). Valid component labels are shown in the table below. + + Notes + ----- + + .. _PRESOL_notes: + + :ref:`presol` prints the solution results for the selected elements in the sorted sequence. + + For example, :ref:`presol`,S prints the stress items SX, SY, SZ, SXY, SYZ, and SXZ for the node + locations of the element. Various element results depend on the calculation method ( :ref:`avprin` + ). + + Component results are in the global Cartesian coordinate directions unless transformed ( :ref:`rsys` + ). + + Shell elements print values at the top, then bottom of the element (or layer). If KEYOPT(8) = 2 (for + ``SHELL181``, ``SHELL208``, ``SHELL209``, ``SHELL281``, or ``ELBOW290`` ), the results are printed + in the order TOP, BOT and then MID of each element, (or layer). The MID value is the actual value to + the results file. + + Items are listed as columns of a table versus element number. An exception occurs for item ELEM, + which uses an element format (where all applicable line element results are listed per element) + instead of a tabular format. + + You can issue :ref:`force` to define which component of the nodal load is to be used (static, + damping, inertia, or total). + + To print items not available via :ref:`presol` (such as line element results), see :ref:`etable` and + :ref:`pretab`. + + For PowerGraphics ( :ref:`graphics`,POWER), results are listed only for the element surface. Items + not supported by PowerGraphics are noted in :ref:`presol_tab_1`. + + The results printed by :ref:`presol` are unaffected by any requested nodal-averaged results ( + :ref:`outres`,NAR). For more information, see `Nodal-Averaged Results + `_ + + For ``Item`` = SRES, selected result components ( :ref:`osresult` ) are output. See + :ref:`presol_tab_2`. + + .. _presol_tab_1: + + PRESOL - General Result Item and Component Labels + ************************************************* + + .. flat-table:: General Item and Component Labels :ref:`presol`, ``Item, Comp`` + :header-rows: 1 + + * - Item + - Comp + - Description + * - :rspan:`1` S + - COMP or blank + - Component (X, Y, Z, XY, YZ, XZ) stresses. + * - PRIN + - Principal stresses (1, 2, 3), stress intensity (INT), and equivalent stress (EQV). + * - :rspan:`1` EPEL + - COMP or blank + - Component (X, Y, Z, XY, YZ, XZ) elastic strains. + * - PRIN + - Principal elastic strains (1, 2, 3), strain intensity (INT), and equivalent strain (EQV). + * - :rspan:`1` EPTH + - COMP or blank + - Component (X, Y, Z, XY, YZ, XZ) thermal strains. + * - PRIN + - Principal thermal strains (1, 2, 3), strain intensity (INT), and equivalent strain (EQV). + * - :rspan:`1` EPDI + - COMP or blank + - Component (X, Y, Z, XY, YZ, XZ) diffusion strains. + * - PRIN + - Principal diffusion strains (1, 2, 3), strain intensity (INT), and equivalent strain (EQV). + * - :rspan:`1` EPPL + - COMP or blank + - Component (X, Y, Z, XY, YZ, XZ) plastic strains. + * - PRIN + - Principal plastic strains (1, 2, 3), strain intensity (INT), and equivalent strain (EQV). + * - :rspan:`1` EPCR + - COMP or blank + - Component (X, Y, Z, XY, YZ, XZ) creep strains. + * - PRIN + - Principal creep strains (1, 2, 3), strain intensity (INT), and equivalent strain (EQV). + * - EPSW + - + - Swelling strain. + * - :rspan:`1` EPTO + - COMP or blank + - Component (X, Y, Z, XY, YZ, XZ) total mechanical strains (EPEL + EPPL + EPCR). + * - PRIN + - Principal total mechanical strains (1, 2, 3), strain intensity (INT), and equivalent strain (EQV). + * - :rspan:`1` EPTT + - COMP or blank + - Component (X, Y, Z, XY, YZ, XZ) total mechanical, thermal, diffusion, and swelling strains (EPEL + EPPL + EPCR + EPTH + EPDI + EPSW). + * - PRIN + - Principal total mechanical, diffusion, thermal, and swelling strains (1, 2, 3), strain intensity (INT), and equivalent strain (EQV). + * - NL + - + - Nonlinear items (SEPL, SRAT, HPRES, EPEQ, CREQ, PSV, PLWK). + * - :rspan:`7` SEND + - ELASTIC The results for this postprocessing SEND component are invalid for ``ELBOW290`` if that element is used with viscoelastic or viscohyperelastic materials. + - Elastic strain energy density. (For `viscoelastic `_ and `sintering `_ materials, the `stored energy `_.) + * - PLASTIC + - Plastic strain energy density. + * - CREEP + - Creep strain energy density. + * - DAMAGE + - Damage strain energy density. + * - VDAM + - Viscoelastic dissipation energy density. + * - VREG + - Visco-regularization strain energy density. + * - DISS + - Structural-thermal dissipation. + * - ENTO + - Total strain energy density (sum of ELASTIC, PLASTIC, and CREEP strain energy densities). + * - :rspan:`1` CDM + - DMG + - Damage variable. + * - LM + - Maximum previous strain energy for virgin material. + * - FAIL + - + - Failure criteria for virgin material. Not supported by PowerGraphics. Works only if failure criteria are provided ( :ref:`fc` and :ref:`tb` ). **Default components:** Maximum of all failure criteria defined at current location (MAX), maximum strain (EMAX), maximum stress (SMAX), Tsai-Wu Strength Index (TWSI), inverse of Tsai-Wu Strength Ratio Index (TWSR). **Other available components:** Hashin Fiber Failure (HFIB), Hashin Matrix Failure (HMAT), Puck Fiber Failure (PFIB), Puck Matrix Failure (PMAT), LaRc03 Fiber Failure (L3FB), LaRc03 Matrix Failure (L3MT), LaRc04 Fiber Failure (L4FB), LaRc04 Matrix Failure (L4MT), and any user-defined failure criteria (USR1 through USR9). USR1 through USR9 require a failure-criteria routine. Issue :ref:`fctyp` to activate or remove failure criteria. + * - PFC + - + - Failure criteria based on the effective stresses in the damaged material. **Components:** Maximum of all failure criteria defined at current location (MAX), fiber tensile failure (FT), fiber compressive failure (FC), matrix tensile failure (MT), and matrix compressive (MC). + * - PDMG + - + - Progressive damage parameters. **Components:** Damage status (STAT, 0 = undamaged, 1 = damaged, 2 = complete damage), fiber tensile damage variable (FT), fiber compressive damage variable (FC), matrix tensile damage variable (MT), matrix compressive damage variable (MC), shear damage variable (S), energy dissipated per unit volume (SED), energy per unit volume due to viscous damping (SEDV). + * - FCMX + - + - Maximum failure criterion over the entire element. **Components:** Layer number where the maximum occurs (LAY), name of the maximum failure criterion (FC), and value of the maximum failure criterion (VAL). + * - SVAR + - 1,2,3,... N + - State variable. + * - GKS + - + - Gasket component (X, XY, XZ) stress. + * - GKD + - + - Gasket component (X, XY, XZ) total closure. + * - GKDI + - + - Gasket component (X, XY, XZ) total inelastic closure. + * - GKTH + - + - Gasket component (X, XY, XZ) thermal closure. + * - CONT + - + - Contact items (STAT, PENE, PRES, SFRIC, STOT, SLIDE, GAP, FLUX, CNOS, FPRS). See component descriptions in :ref:`plesol`. + * - TG + - + - Component (X, Y, Z) thermal gradients and vector sum (SUM). No vector sum is calculated for coupled pore-pressure-thermal (CPT ``nnn`` ) elements. + * - TF + - + - Component (X, Y, Z) thermal fluxes and vector sum (SUM). + * - PG + - + - Component (X, Y, Z) and vector sum (SUM) for velocity or energy density flux (room acoustics). + * - EF + - + - Component (X, Y, Z) electric fields and vector sum (SUM). + * - D + - + - Component (X, Y, Z) electric flux densities and vector sum (SUM). + * - H + - + - Component (X, Y, Z) magnetic field intensities and vector sum (SUM). + * - B + - + - Component (X, Y, Z) magnetic flux densities and vector sum (SUM). + * - CG + - + - Component concentration gradient or vector sum. + * - DF + - + - Component diffusion flux density or vector sum. + * - FMAG + - + - Component (X, Y, Z) electromagnetic forces and vector sum (SUM). + * - P + - + - Poynting vector components (X, Y, Z) and sum (SUM). + * - CG + - + - Concentration gradient. + * - F + - + - Component (X, Y, Z) structural forces. Use :ref:`force` for type. Do not use :ref:`presol` to obtain contact forces for contact elements, as the force values reported may not be accurate for these elements. Use :ref:`etable` instead. + * - M + - + - Component (X, Y, Z) structural moments. + * - HEAT + - + - Heat flow. + * - FLOW + - + - Fluid flow. + * - AMPS + - + - Current flow. + * - CHRG + - + - Charge. + * - FLUX + - + - Magnetic flux. + * - CSG + - + - Component (X, Y, Z) magnetic current segments. + * - FORC + - + - All available force items (F to CSG above). (10 maximum). + * - RATE + - + - Diffusion flow rate. + * - BFE + - TEMP For reinforcing elements ``REINF264`` and ``REINF265``, issue :ref:`presol` ,BFE,TEMP to print the intersection-point temperature of each member. You can also print intersection-point temperature gradients ( :ref:`presol`,TG) and intersection-point heat flux ( :ref:`plesol`,TF). For higher- order reinforcing members (generated when using higher-order base elements), the midpoint values are not available for the reinforcing members. + - Body temperatures (calculated from applied temperatures) as used in solution (area and volume elements only). + * - ELEM + - + - All applicable element results (available only for ``LINK180`` and previous-generation structural line elements). + * - SERR Some element- and material-type limitations apply. See :ref:`prerr`. + - + - Structural error energy. + * - SDSG + - + - Absolute value of the maximum variation of any nodal stress component. + * - TERR + - + - Thermal error energy. + * - TDSG + - + - Absolute value of the maximum variation of any nodal thermal gradient component. + * - SENE + - + - "Stiffness" energy or thermal heat dissipation. Same as TENE. + * - STEN + - + - Elemental energy dissipation due to `stabilization `_. + * - TENE + - + - Thermal heat dissipation or "stiffness" energy. Same as SENE. + * - KENE + - + - Kinetic energy. + * - ASENE + - + - Amplitude "stiffness" energy. + * - PSENE + - + - Peak "stiffness" energy. + * - AKENE + - + - Amplitude kinetic energy. + * - PKENE + - + - Peak kinetic energy. + * - DENE + - + - Damping energy. + * - WEXT WEXT is calculated for element-based loading only (and not for nodal-force loading). WEXT is stored on elements to which loading has been applied; if surface elements are added on top of other elements, for example, and pressure loading is applied to the surface elements, WEXT is available for the surface elements only. + - + - Work due to external load. + * - AENE + - + - Artificial energy due to hourglass control/drill stiffness or due to contact stabilization. + * - JHEAT + - + - Element Joule heat generation (coupled-field calculation). + * - JS + - + - Source current density for low-frequency magnetic analyses. Total current density (sum of conduction and displacement current densities) in low frequency electric analyses. Components (X, Y, Z) and vector sum (SUM). + * - JT + - + - Total measurable current density in low-frequency electromagnetic analyses. (Conduction current density in a low-frequency electric analysis.) Components (X, Y, Z) and vector sum (SUM). + * - JC + - + - Conduction current density for elements that support conduction current calculation. Components (X, Y, Z) and vector sum (SUM). + * - MRE + - + - Magnetic Reynolds number. + * - VOLU + - + - Volume of volume element. + * - CENT + - + - Centroid X, Y, or Z location (based on shape function) in the active coordinate system. + * - LOCI + - + - Integration point location. + * - SMISC + - ``snum`` + - Element summable miscellaneous data value at sequence number ``snum`` (shown in the Output Data section of each element description). + * - NMISC + - ``snum`` + - Element nonsummable miscellaneous data value at sequence number ``snum`` (shown in the Output Data section of each element description). + * - CAP + - + - Material cap plasticity model only: Cohesion (C0); hydrostatic compaction yielding stress (X0); I1 at the transition point at which the shear and compaction envelopes intersect (K0); ZONE = 0: elastic state, ZONE = 1: compaction zone, ZONE = 2: shear zone, ZONE = 3: expansion zone; effective deviatoric plastic strain (DPLS); volume plastic strain (VPLS). + * - EDPC + - + - Material EDP creep model only (not including the cap model): Equivalent creep stress (CSIG); equivalent creep strain (CSTR). + * - FICT + - TEMP + - Fictive temperature. + * - :rspan:`3` ESIG + - COMP or blank + - Components of Biot``s effective stress. + * - PRIN + - Principal stresses of Biot``s effective stress. + * - INT + - Stress intensity of Biot``s effective stress. + * - EQV + - Equivalent stress of Biot``s effective stress. + * - :rspan:`2` DPAR + - TPOR + - Total porosity (Gurson material model). + * - GPOR + - Porosity due to void growth. + * - NPOR + - Porosity due to void nucleation. + * - FFLX + - COMP + - Fluid flow flux components in poromechanics. + * - FGRA + - COMP + - Fluid pore-pressure gradient components in poromechanics. + * - MENE + - + - Acoustic potential energy. + * - PMSV + - COMP + - Void volume ratio, pore pressure, degree of saturation, and relative permeability for coupled pore-pressure CPT elements. + * - FPIDX + - TF01,SF01, TF02,SF02, TF03,SF03, TF04,SF04 + - Failure plane surface activity status for concrete and joint rock material models: 1 = yielded, 0 = not yielded. Tension and shear failure status are available for all four sets of failure planes. + * - YSIDX + - TENS,SHEA + - Yield surface activity status for Mohr-Coulomb, soil, concrete, and joint rock material models: 1 = yielded, 0 = not yielded. + * - NS + - COMP + - `Nominal strain `_ for hyperelastic material, reported in the current configuration (unaffected by :ref:`rsys` ). + * - MPLA + - DMAC,DMAX + - Microplane damage, macroscopic and maximum values. + * - MPDP + - + - Microplane homogenized total, tension, and compression damages (TOTA, TENS, COMP), and split weight factor (RW). + * - DAMAGE + - + - Damage in directions 1, 2, 3 (1, 2, 3) and the maximum damage (MAX). + * - GDMG + - + - Damage + * - IDIS + - + - Structural-thermal dissipation rate + * - BKS + - X, Y, Z, XY, YZ, XZ + - Total `nonlinear kinematic backstress `_ reported in the current configuration (unaffected by :ref:`rsys` ). Available for 3D, plane strain, and axisymmetric elements. + * - BKS1,...,BKS5 + - X, Y, Z, XY, YZ, XZ + - Superimposed components of the total `nonlinear kinematic backstress`_ reported in the current configuration (unaffected by :ref:`rsys` ). Available for 3D, plane strain, and axisymmetric elements when more than one superimposed back-stress component is defined. + * - EPFR + - + - Free strain in porous media + * - SNDI + - + - Component (X, Y, Z) sound intensity and vector sum (SUM). + * - FC1S + - 1,2,3,4,5,6 + - First set of six components of FCC crystal slip. Available for 3D elements only. + * - FC2S + - 1,2,3,4,5,6 + - Second set of six components of FCC crystal slip. Available for 3D elements only. + * - HC1S + - 1,2,3,4,5,6 + - Six components of HCP crystal slip on basal and prismatic systems. Available for 3D elements only. + * - HC2S + - 1,2,3,4,5,6 + - Six components of HCP crystal slip on pyramidal system. Available for 3D elements only. + * - HC3S + - 1,2,3,4,5,6 + - First set of six components of HCP crystal slip on the first-order pyramidal system. Available for 3D elements only. + * - HC4S + - 1,2,3,4,5,6 + - Second set of six components of HCP crystal slip on the first-order pyramidal system. Available for 3D elements only. + * - HC5S + - 1,2,3,4,5,6 + - Six components of HCP crystal slip on the second-order pyramidal system. Available for 3D elements only. + * - BC1S + - 1,2,3,4,5,6 + - First set of six components of BCC slip on 111 plane. Available for 3D elements only. + * - BC2S + - 1,2,3,4,5,6 + - Second set of six components of BCC slip on 111 plane. Available for 3D elements only. + * - BC3S + - 1,2,3,4,5,6 + - First set of six components of BCC slip on 112 plane. Available for 3D elements only. + * - BC4S + - 1,2,3,4,5,6 + - Second set of six components of BCC slip on 112 plane. Available for 3D elements only. + * - BC5S + - 1,2,3,4,5,6 + - First set of six components of BCC slip on 123 plane. Available for 3D elements only. + * - BC6S + - 1,2,3,4,5,6 + - Second set of six components of BCC slip on 123 plane. Available for 3D elements only. + * - BC7S + - 1,2,3,4,5,6 + - Third set of six components of BCC slip on 123 plane. Available for 3D elements only. + * - BC8S + - 1,2,3,4,5,6 + - Fourth set of six components of BCC slip on 123 plane. Available for 3D elements only. + * - FC1H + - 1,2,3,4,5,6 + - First set of six components of FCC crystal hardness. Available for 3D elements only. + * - FC2H + - 1,2,3,4,5,6 + - Second set of six components of FCC crystal hardness. Available for 3D elements only. + * - HC1H + - 1,2,3,4,5,6 + - Sixcomponents of HCP crystal hardness on basal and prismatic systems. Available for 3D elements. + * - HC2H + - 1,2,3,4,5,6 + - Six components of HCP crystal hardness on pyramidal system. Available for 3D elements only. + * - HC3H + - 1,2,3,4,5,6 + - First set of six components of HCP crystal hardness on the first-order pyramidal system. Available for 3D elements only. + * - HC4H + - 1,2,3,4,5,6 + - Second set of six components of HCP crystal hardness on the first-order pyramidal system. Available for 3D elements only. + * - HC5H + - 1,2,3,4,5,6 + - Six components of HCP crystal hardness on the second-order pyramidal system. Available for 3D elements only. + * - BC1H + - 1,2,3,4,5,6 + - First set of six components of BCC hardness on 111 plane. Available for 3D elements only. + * - BC2H + - 1,2,3,4,5,6 + - Second set of six components of BCC hardness on 111 plane. Available for 3D elements only. + * - BC3H + - 1,2,3,4,5,6 + - First set of six components of BCC hardness on 112 plane. Available for 3D elements only. + * - BC4H + - 1,2,3,4,5,6 + - Second set of six components of BCC hardness on 112 plane. Available for 3D elements only. + * - BC5H + - 1,2,3,4,5,6 + - First set of six components of BCC hardness on 123 plane. Available for 3D elements only. + * - BC6H + - 1,2,3,4,5,6 + - Second set of six components of BCC hardness on 123 plane. Available for 3D elements only. + * - BC7H + - 1,2,3,4,5,6 + - Third set of six components of BCC hardness on 123 plane. Available for 3D elements only. + * - BC8H + - 1,2,3,4,5,6 + - Fourth set of six components of BCC hardness on 123 plane. Available for 3D elements only. + * - XELG + - 1,2,3,45,6,EQV + - Crystal Lagrangian strain in 11, 22, 33, 12, 23,13 directions and its equivalent. Available for 3D elements only. + * - SINT + - RHO, ETA, SSTR, GRAIN + - Sintering relative density, viscosity, sintering stress, and average grain size values. + + + .. _presol_tab_2: + + PRESOL - Selected Result Component Labels + ***************************************** + + .. flat-table:: Selected Result Component Labels :ref:`presol`,SRES, ``Comp`` + :header-rows: 1 + + * - Comp + - Description + * - SVAR ``n`` + - The ``n`` th state variable. + * - FLDUF0 ``n`` + - The ``n`` th user-defined field variable. + + """ + command = f"PRESOL,{item},{comp}" + return self.run(command, **kwargs) + + def prjsol(self, item: str = "", comp: str = "", **kwargs): + r"""Prints joint element output. + + Mechanical APDL Command: `PRJSOL `_ + + Parameters + ---------- + item : str + Label identifying the item. Some items also require a component label. + + * ``DISP`` - Relative displacements. + + * ``ROT`` - Relative rotations. + + * ``VEL`` - Relative linear velocities. + + * ``OMG`` - Relative angular velocities. + + * ``ACC`` - Relative linear accelerations. + + * ``DMG`` - Relative angular accelerations. + + * ``SMISC`` - Summable miscellaneous quantities. + + comp : str + Component of the item (if required). For ``Item`` = DISP, ROT, VEL, OMG, ACC, and DMG, enter the + direction label, X, Y, or Z. For ``Item`` = SMISC, enter a valid number. + + Notes + ----- + + .. _PRJSOL_notes: + + Prints element output for the ``MPC184`` joint element. The joint element quantities printed are the + values for the free or unconstrained relative degrees of freedom. + + Only :ref:`prjsol`,SMISC is available in linear, modal, and linear perturbation analyses. + + This command is valid in POST1 only. + """ + command = f"PRJSOL,{item},{comp}" + return self.run(command, **kwargs) + + def prnld(self, lab: str = "", tol: int | str = "", item: str = "", **kwargs): + r"""Prints the summed element nodal loads. + + Mechanical APDL Command: `PRNLD `_ + + Parameters + ---------- + lab : str + Nodal reaction load type. If blank, use the first ten of all available labels. Valid labels are: + + * **Structural force labels** : FX, FY or FZ (forces); F (FX, FY and FZ); MX, MY or MZ (moments); M + (MX, MY and MZ). + * **Thermal force labels** : HEAT, HBOT, HE2, HE3,..., HTOP (heat flow). + * **Fluid force labels** : FLOW (fluid flow); VFX, VFY and VFZ (fluid "forces"); VF (VFX, VFY and + VFZ). + * **Electric force labels** : AMPS (current flow); CHRG (charge); CURT (current); VLTG (voltage + drop). + * **Magnetic force labels** : FLUX (magnetic flux); CSGZ (magnetic current segment). + * **Diffusion label** : RATE (diffusion flow rate). + + tol : int or str + Tolerance value about zero within which loads are not printed, as follows: + + * ``> 0`` - Relative tolerance about zero within which loads are not printed. In this case, the tolerance is ``TOL`` \* ``Load``, where ``Load`` is the absolute value of the maximum load on the selected nodes. + + * ``0`` - Print all nodal loads. + + * ``> 0`` - Absolute tolerance about zero within which loads are not printed. + + Defaults to 1.0E-9 times the absolute value of the maximum load on the selected nodes. + + item : str + Selected set of nodes. + + * ``(blank)`` - Prints the summed element nodal loads for all selected nodes (default), excluding + contact elements. + + * ``CONT`` - Prints the summed element nodal loads for contact nodes only. + + * ``BOTH`` - Prints the summed element nodal loads for all selected nodes, including contact nodes. + + Notes + ----- + + .. _PRNLD_notes: + + Prints the summed element nodal loads (forces, moments, heat flows, flux, etc.) for the selected + nodes in the sorted sequence. Results are in the global Cartesian coordinate directions unless + transformed ( :ref:`rsys` ). Zero values (within a tolerance range) are not printed. Loads applied + to a constrained degree of freedom are not included. The :ref:`force` command can be used to define + which component of the nodal load is to be used (static, damping, inertia, or total). + + By default, :ref:`prnld` excludes elements ``TARGE169`` - ``CONTA177``. Setting ``ITEM`` = CONT will + only account for nodal forces on selected contact elements ( ``CONTA172``, ``CONTA174``, + ``CONTA175``, and ``CONTA177`` ). Setting ``ITEM`` = BOTH will account for nodal forces on all + selected nodes, including contact nodes. + + **Using PRNLD in a Spectrum or PSD Analysis ( ANTYPE, SPECTR)** + When using :ref:`prnld` in a spectrum analysis (after the combination file has been input through + :ref:`input`,,MCOM and when :ref:`spopt` has not been issued with ``Elcalc`` = YES during the + spectrum analysis), or in a PSD analysis when postprocessing 1-sigma results (loadstep 3, 4, or 5), + the following message will display in the printout header: + + (Spectrum analysis summation is used) + + This message means that the summation of the element nodal forces is performed prior to the + combination of those forces. In this case, :ref:`rsys` does not apply. The forces are in the nodal + coordinate systems, and the vector sum is always printed in the global coordinate system. + + The spectrum analysis summation is available when the element results are written to the mode file, + :file:`Jobname.mode` ( ``MSUPkey`` = Yes on the :ref:`mxpand` command). + + Because modal displacements cannot be used to calculate contact element nodal forces, ``ITEM`` does + not apply to spectrum and PSD analyses. + """ + command = f"PRNLD,{lab},{tol},{item}" + return self.run(command, **kwargs) + + def prnsol( + self, item: str = "", comp: str = "", avg: str = "", datakey: str = "", **kwargs + ): + r"""Prints nodal solution results. + + Mechanical APDL Command: `PRNSOL `_ + + Parameters + ---------- + item : str + Label identifying the item. Valid item labels are shown in the table below. Some items also + require a component label. + + comp : str + Component of the item (if required). Valid component labels are shown in the table below. + Default = COMP. + + avg : str + Specifies whether random acoustic results are averaged. Valid only for ``Item`` = U and PRES. + + * ``(blank)`` - No averaging (default). + + * ``AVG`` - Print averaged results for random acoustics. + + datakey : str + Key to specify which data is printed: + + * ``AUTO`` - `Nodal-averaged results + `_ are + used if available; otherwise, the element-based data is used, if available. (Default.) + + * ``ESOL`` - Only element-based results are used. If they are not available, the command is ignored. + + * ``NAR`` - Only nodal-averaged results are used. If they are not available, the command is ignored. + + Notes + ----- + + .. _PRNSOL_notes: + + Prints the nodal solution results for the selected nodes in the sorted sequence. For `reinforcing + `_ + elements (REINF ``nnn`` ), results are printed at intersection points of reinforcing elements and + base elements. + + For example, :ref:`prnsol`,U,X prints the X component of displacement vector U (that is, the UX + degree of freedom). + + Component results are in the global Cartesian coordinate directions unless transformed ( :ref:`rsys` + ). + + Various element results also depend upon the recalculation method and the selected results location + ( :ref:`avprin`, :ref:`rsys`, :ref:`layer`, :ref:`shell`, and :ref:`nsel` ). + + If :ref:`layer` is issued, the resulting output is listed in full graphics mode ( + :ref:`graphics`,FULL). + + You can define which component of the nodal load (static, damping, inertia, or total) should be used + ( :ref:`force` ). + + PowerGraphics can affect your nodal solution listings. For PowerGraphics ( :ref:`graphics`,POWER), + results are listed for the model exterior surfaces only. + + When shell element types are present, results are output on a surface-by-surface basis. For shell + elements (such as ``SHELL181`` or ``SHELL281`` ), and for ``ELBOW290``, printed output is for both + the top and bottom surfaces. For solid elements such as ``SOLID185``, the output is averaged for + each surface and printed as follows: + + * **Node at a vertex:** Three lines are output (one printed line for each surface). + + * **Node on an edge:** Two lines are output (one printed line for each surface). + + * **Nodes on a face:** One value is output. + + * **Nodes interior to the volume:** No printed values are output. + + If a node is common to more than one element, or if a geometric discontinuity exists, several + conflicting listings may result. For example, a corner node incorporating results from solid + elements and shell elements could yield as many as nine different results; the printed output would + be averages at the top and bottom for the three shell surfaces plus averages at the three surfaces + for the solid, for a total of nine lines of output. The program does not average result listings + across geometric discontinuities when shell element types are present. It is important to analyze + the listings at discontinuities to ascertain the significance of each set of data. + + When only `reinforcing + `_ + elements (REINF ``nnn`` ) are selected, results are listed for intersection points of reinforcing + elements and base elements. Prints include coordinates of intersection points in global Cartesian + coordinate system and results. Results are interpolated from the results of base elements. If a + point is common to more than one reinforcing element, or reinforcing member within one reinforcing + element, averaged results are printed. Prints also include minimum and maximum values. + + The printed output for full graphics ( :ref:`graphics`,FULL) averages results at the node. For shell + elements, the default for display is TOP so that the results for the top of the shell are averaged + with the other elements attached to that node. + + If :ref:`nsort`, :ref:`esort` or :ref:`eshape` is issued with PowerGraphics enabled ( + :ref:`graphics`,POWER), :ref:`prnsol` behaves as though full graphics mode is enabled ( + :ref:`graphics`,FULL). + + Items not supported by PowerGraphics are noted in :ref:`prnsol_tab_1`. + + For ``Item`` = SRES, selected result component ( :ref:`osresult` ) values are output. See + :ref:`PRNSOL_tab_2`. + + To print midside nodes, first issue :ref:`efacet`,2. + + To learn more about the specific behaviors of :ref:`prnsol` in a cyclic symmetry analysis and + printing results for nodes at cyclic edges, see `Using the /CYCEXPAND Command + `_ + + If `nodal-averaged results + `_ ( + :ref:`outres`,NAR or another nodal-averaged label) are in the database, then :ref:`prnsol` uses the + nodal-averaged data for the applicable items (S, EPEL, EPPL, EPCR, EPTH, EPSW) by default. You can + change this behavior via the ``DataKey`` argument. Keep these points in mind when using nodal- + averaged results: + + * The :ref:`layer` and :ref:`rsys`,SOLU commands are not valid with nodal-averaged results. If these + commands are used, the element solution is printed instead if applicable. + + * Issuing :ref:`esel` before printing nodal-averaged results has no effect on the output. + + * PowerGraphics is supported. The output is equivalent to the full model graphics output, but only + the appropriate surface nodes are printed. See `Postprocessing Nodal-Averaged Results + `_ + + .. _prnsol_tab_1: + + PRNSOL - General Result Item and Component Labels + ************************************************* + + .. flat-table:: General Item and Component Labels :ref:`prnsol`, ``Item,Comp`` + :header-rows: 1 + + * - Item + - Comp + - Description + * - **Valid item and component labels for nodal degree of freedom results are:** + * - :rspan:`1` U + - X, Y, Z + - X, Y, or Z structural displacement. + * - COMP + - X, Y, and Z structural displacements and vector sum. + * - :rspan:`1` ROT + - X, Y, Z + - X, Y, or Z structural rotation. + * - COMP + - X, Y, and Z structural rotations and vector sum. + * - TEMP For ``SHELL131`` and ``SHELL132`` elements with KEYOPT(3) = 0 or 1, use the labels TBOT, TE2, TE3, ..., TTOP instead of TEMP. + - + - Temperature. + * - PRES + - + - Pressure. + * - VOLT + - + - Electric potential. + * - GFV1, GFV2, GFV3 + - + - Nonlocal field values 1, 2, and 3. + * - MAG + - + - Magnetic scalar potential. + * - CONC + - + - Concentration. Not supported by PowerGraphics. + * - :rspan:`1` V + - X, Y, Z + - X, Y, or Z fluid velocity in a fluid analysis. + * - COMP + - X, Y, and Z fluid velocity and vector sum in a fluid analysis. + * - :rspan:`1` A + - X, Y, Z + - X, Y, or Z magnetic vector potential in an electromagnetic analysis. + * - COMP + - X, Y, and Z magnetic vector potential and vector sum in an electromagnetic analysis. + * - :rspan:`1` VEL + - X, Y, Z + - X, Y, or Z velocity in a structural transient dynamic analysis ( :ref:`antype`,TRANS). + * - COMP + - X, Y, and Z velocity and vector sum in a structural transient dynamic analysis ( :ref:`antype`,TRANS). + * - :rspan:`1` ACC + - X, Y, Z + - X, Y, or Z acceleration in a structural transient dynamic analysis ( :ref:`antype`,TRANS). + * - COMP + - X, Y, and Z acceleration and vector sum in a structural transient dynamic analysis ( :ref:`antype`,TRANS). + * - :rspan:`1` OMG + - X, Y, Z + - X, Y, or Z rotational velocity in a structural transient dynamic analysis ( :ref:`antype`,TRANS). + * - COMP + - X, Y, and Z rotational velocity and vector sum in a structural transient dynamic analysis ( :ref:`antype`,TRANS). + * - :rspan:`1` DMG + - X, Y, Z + - X, Y, or Z rotational acceleration in a structural transient dynamic analysis ( :ref:`antype`,TRANS). + * - COMP + - X, Y, and Z rotational acceleration and vector sum in a structural transient dynamic analysis ( :ref:`antype`,TRANS). + * - CURR + - + - Current. + * - EMF + - + - Electromotive force drop. + * - DOF + - + - All available degree of freedom labels (10 maximum). + * - FICT + - TEMP + - Fictive temperature. + * - SPL + - + - Sound pressure level. + * - SPLA + - + - A-weighted sound pressure level (dBA). + * - VNS + - + - Normal velocity on the structural surface. Valid only for ``SHELL181``, ``SOLID185``, ``SOLID186``, ``SOLID187``, ``SOLSH190``, and ``SHELL281``. + * - ENKE + - + - Acoustic diffusion energy density + * - **Valid item and component labels for element results are:** + * - :rspan:`1` S + - COMP + - X, Y, Z, XY, YZ, and XZ component stresses. This item outputs `nodal-averaged results `_ if they are available on the results file. + * - PRIN + - S1, S2, S3 principal stresses, SINT stress intensity, and SEQV equivalent stress. + * - :rspan:`2` EPEL + - COMP + - Component elastic strains. + * - PRIN + - Principal elastic strains, strain intensity, and equivalent strain. + * - FAIL + - Maximum Strain Failure Criteria. Works only if failure criteria are provided ( :ref:`fc` and :ref:`tb` ). + * - :rspan:`1` EPTH + - COMP + - Component thermal strains. + * - PRIN + - Principal thermal strains, strain intensity, and equivalent strain. + * - :rspan:`1` EPDI + - COMP + - Component diffusion strains. + * - PRIN + - Principal diffusion strains, strain intensity, and equivalent strain. + * - :rspan:`1` EPPL + - COMP + - Component plastic strains. + * - PRIN + - Principal plastic strains, strain intensity, and equivalent strain. + * - :rspan:`1` EPCR + - COMP + - Component creep strains. + * - PRIN + - Principal creep strains, strain intensity, and equivalent strain. + * - EPSW + - + - Swelling strain. + * - :rspan:`1` EPTO + - COMP + - Component total mechanical strains (EPEL + EPPL + EPCR). + * - PRIN + - Principal total mechanical strains, strain intensity, and equivalent strain. + * - :rspan:`1` EPTT + - COMP + - Component total mechanical, thermal, diffusion, and swelling strains (EPEL + EPPL + EPCR + EPTH + EPDI + EPSW). + * - PRIN + - Principal total mechanical, thermal, diffusion, and swelling strains, strain intensity, and equivalent strain. + * - NL + - + - Nonlinear items (SEPL, SRAT, HPRES, EPEQ, CREQ, PSV, PLWK). + * - :rspan:`7` SEND + - ELASTIC The results for this postprocessing SEND component are invalid for ``ELBOW290`` if that element is used with viscoelastic or viscohyperelastic materials. + - Elastic strain energy density. (For `viscoelastic `_ and `sintering `_ materials, the `stored energy `_.) + * - PLASTIC + - Plastic strain energy density. + * - CREEP + - Creep strain energy density. + * - DAMAGE + - Damage strain energy density. + * - VDAM + - Viscoelastic dissipation energy density. + * - VREG + - Visco-regularization strain energy density. + * - DISS + - Structural-thermal dissipation. + * - ENTO + - Total strain energy density (sum of ELASTIC, PLASTIC, and CREEP strain energy densities). + * - :rspan:`1` CDM + - DMG + - Damage variable. + * - LM + - Maximum previous strain energy for virgin material. + * - FAIL + - + - Failure criteria. **Default components:** Maximum of all failure criteria defined at current location (MAX), maximum strain (EMAX), maximum stress (SMAX), Tsai-Wu Strength Index (TWSI), inverse of Tsai-Wu Strength Ratio Index (TWSR). **Other available components:** Other available components: Hashin Fiber Failure (HFIB), Hashin Matrix Failure (HMAT), Puck Fiber Failure (PFIB), Puck Matrix Failure (PMAT), LaRc03 Fiber Failure (L3FB), LaRc03 Matrix Failure (L3MT), LaRc04 Fiber Failure (L4FB), LaRc04 Matrix Failure (L4MT), and any user-defined failure criteria (USR1 through USR9). USR1 through USR9 require a failure-criteria routine. Issue :ref:`fctyp` to activate or remove failure criteria. + * - PFC + - + - Failure criteria based on the effective stresses in the damaged material. **Components:** Maximum of all failure criteria defined at current location (MAX), fiber tensile failure (FT), fiber compressive failure (FC), matrix tensile failure (MT), and matrix compressive (MC). + * - PDMG + - + - Progressive damage parameters. **Components:** Damage status (STAT, 0 = undamaged, 1 = damaged, 2 = complete damage), fiber tensile damage variable (FT), fiber compressive damage variable (FC), matrix tensile damage variable (MT), matrix compressive damage variable (MC), shear damage variable (S), energy dissipated per unit volume (SED), energy per unit volume due to viscous damping (SEDV). + * - SVAR Not supported by PowerGraphics. + - 1, 2, 3,... N + - State variable. + * - GKS + - COMP + - X, XY, XZ component gasket stress. + * - GKD + - COMP + - X, XY, XZ component gasket total closure. + * - GKDI + - COMP + - X, XY, XZ component gasket total inelastic closure. + * - GKTH + - COMP + - X, XY, XZ component thermal closure. + * - SS + - X, XY, XZ + - Interface traction (stress). + * - SD + - X, XY, XZ + - Interface separation. + * - CONT + - + - Contact items (STAT For contact elements ``CONTA172``, ``CONTA174``, ``CONTA175``, and ``CONTA177``, the reported data are averaged across the element. To obtain a more meaningful STAT value, use :ref:`presol`., PENE, PRES, SFRIC, STOT, SLIDE, GAP, FLUX, CNOS, FPRS). See component descriptions in :ref:`plnsol`. + * - TG + - COMP + - Component thermal gradients and vector sum. No vector sum is calculated for coupled pore-pressure-thermal (CPT ``nnn`` ) elements. + * - TF + - COMP + - Component thermal fluxes and vector sum. + * - PG + - COMP + - Components and vector sum for velocity or energy density flux (room acoustics). + * - EF + - COMP + - Component electric fields and vector sum. + * - D + - COMP + - Component electric flux densities and vector sum. + * - H + - COMP + - Component magnetic field intensities and vector sum. + * - B + - COMP + - Component magnetic flux densities and vector sum. + * - CG + - COMP + - Component concentration gradient or vector sum. + * - DF + - COMP + - Component diffusion flux density or vector sum. + * - FMAG + - COMP + - Component electromagnetic forces and vector sum. + * - JC + - COMP + - Conduction current density for elements that support conduction current calculation. Components (X, Y, Z) and vector sum (SUM). + * - BFE + - + - Body temperatures (calculated from applied temperatures) as used in solution (area and volume elements only). + * - CAP + - + - Material cap plasticity model only: Cohesion (C0); hydrostatic compaction yielding stress (X0); I1 at the transition point at which the shear and compaction envelopes intersect (K0); ZONE = 0: elastic state, ZONE = 1: compaction zone, ZONE = 2: shear zone, ZONE = 3: expansion zone; effective deviatoric plastic strain (DPLS); volume plastic strain (VPLS). + * - EDPC + - + - Material EDP creep model only (not including the cap model): Equivalent creep stress (CSIG); equivalent creep strain (CSTR). + * - :rspan:`3` ESIG + - COMP or blank + - Components of Biot``s effective stress. + * - PRIN + - Principal stresses of Biot``s effective stress. + * - INT + - Stress intensity of Biot``s effective stress. + * - EQV + - Equivalent stress of Biot``s effective stress. + * - :rspan:`2` DPAR + - TPOR + - Total porosity (Gurson material model). + * - GPOR + - Porosity due to void growth. + * - NPOR + - Porosity due to void nucleation. + * - FFLX + - COMP + - Fluid flow flux in poromechanics. + * - FGRA + - COMP + - Fluid pore pressure gradient components in poromechanics. + * - PMSV + - COMP + - Void volume ratio, pore pressure, degree of saturation, and relative permeability for coupled pore-pressure CPT elements. + * - NS + - COMP + - `Nominal strain `_ for hyperelastic material, reported in the current configuration (unaffected by :ref:`rsys` ). + * - MPLA + - DMAC, DMAX + - Microplane damage, macroscopic and maximum values. + * - MPDP + - + - Microplane homogenized total, tension, and compression damages (TOTA, TENS, COMP), and split weight factor (RW). + * - DAMAGE + - + - Damage in directions 1, 2, 3 (1, 2, 3) and the maximum damage (MAX). + * - GDMG + - + - Damage + * - IDIS + - + - Structural-thermal dissipation rate + * - BKS + - X, Y, Z, XY, YZ, XZ + - Total `nonlinear kinematic backstress `_ reported in the current configuration (unaffected by :ref:`rsys` ). Available for 3D, plane strain, and axisymmetric elements. + * - BKS1,...,BKS5 + - X, Y, Z, XY, YZ, XZ + - Superimposed components of the total `nonlinear kinematic backstress`_ reported in the current configuration (unaffected by :ref:`rsys` ). Available for 3D, plane strain, and axisymmetric elements when more than one superimposed back-stress component is defined. + * - EPFR + - + - Free strain in porous media + * - SNDI + - COMP + - Component sound intensity and vector sum. + * - FC1S + - 1,2,3,4,5,6 + - First set of six components of FCC crystal slip. Available for 3D elements only. + * - FC2S + - 1,2,3,4,5,6 + - Second set of six components of FCC crystal slip. Available for 3D elements only. + * - HC1S + - 1,2,3,4,5,6 + - Six components of HCP crystal slip on basal and prismatic systems. Available for 3D elements only. + * - HC2S + - 1,2,3,4,5,6 + - Six components of HCP crystal slip on pyramidal system. Available for 3D elements only. + * - HC3S + - 1,2,3,4,5,6 + - First set of six components of HCP crystal slip on the first-order pyramidal system. Available for 3D elements only. + * - HC4S + - 1,2,3,4,5,6 + - Second set of six components of HCP crystal slip on the first-order pyramidal system. Available for 3D elements only. + * - HC5S + - 1,2,3,4,5,6 + - Six components of HCP crystal slip on the second-order pyramidal system. Available for 3D elements only. + * - BC1S + - 1,2,3,4,5,6 + - First set of six components of BCC slip on 111 plane. Available for 3D elements only. + * - BC2S + - 1,2,3,4,5,6 + - Second set of six components of BCC slip on 111 plane. Available for 3D elements only. + * - BC3S + - 1,2,3,4,5,6 + - First set of six components of BCC slip on 112 plane. Available for 3D elements only. + * - BC4S + - 1,2,3,4,5,6 + - Second set of six components of BCC slip on 112 plane. Available for 3D elements only. + * - BC5S + - 1,2,3,4,5,6 + - First set of six components of BCC slip on 123 plane. Available for 3D elements only. + * - BC6S + - 1,2,3,4,5,6 + - Second set of six components of BCC slip on 123 plane. Available for 3D elements only. + * - BC7S + - 1,2,3,4,5,6 + - Third set of six components of BCC slip on 123 plane. Available for 3D elements only. + * - BC8S + - 1,2,3,4,5,6 + - Fourth set of six components of BCC slip on 123 plane. Available for 3D elements only. + * - FC1H + - 1,2,3,4,5,6 + - First set of six components of FCC crystal hardness. Available for 3D elements only. + * - FC2H + - 1,2,3,4,5,6 + - Second set of six components of FCC crystal hardness. Available for 3D elements only. + * - HC1H + - 1,2,3,4,5,6 + - Sixcomponents of HCP crystal hardness on basal and prismatic systems. Available for 3D elements. + * - HC2H + - 1,2,3,4,5,6 + - Six components of HCP crystal hardness on pyramidal system. Available for 3D elements only. + * - HC3H + - 1,2,3,4,5,6 + - First set of six components of HCP crystal hardness on the first-order pyramidal system. Available for 3D elements only. + * - HC4H + - 1,2,3,4,5,6 + - Second set of six components of HCP crystal hardness on the first-order pyramidal system. Available for 3D elements only. + * - HC5H + - 1,2,3,4,5,6 + - Six components of HCP crystal hardness on the second-order pyramidal system. Available for 3D elements only. + * - BC1H + - 1,2,3,4,5,6 + - First set of six components of BCC hardness on 111 plane. Available for 3D elements only. + * - BC2H + - 1,2,3,4,5,6 + - Second set of six components of BCC hardness on 111 plane. Available for 3D elements only. + * - BC3H + - 1,2,3,4,5,6 + - First set of six components of BCC hardness on 112 plane. Available for 3D elements only. + * - BC4H + - 1,2,3,4,5,6 + - Second set of six components of BCC hardness on 112 plane. Available for 3D elements only. + * - BC5H + - 1,2,3,4,5,6 + - First set of six components of BCC hardness on 123 plane. Available for 3D elements only. + * - BC6H + - 1,2,3,4,5,6 + - Second set of six components of BCC hardness on 123 plane. Available for 3D elements only. + * - BC7H + - 1,2,3,4,5,6 + - Third set of six components of BCC hardness on 123 plane. Available for 3D elements only. + * - BC8H + - 1,2,3,4,5,6 + - Fourth set of six components of BCC hardness on 123 plane. Available for 3D elements only. + * - XELG + - 1,2,3,45,6,EQV + - Crystal Lagrangian strain in 11, 22, 33, 12, 23,13 directions and its equivalent. Available for 3D elements only. + * - SINT + - RHO, ETA, SSTR, GRAIN + - Sintering relative density, viscosity, sintering stress, and average grain size values. + + + .. _PRNSOL_tab_2: + + PRNSOL - Selected Result Component Labels + ***************************************** + + .. flat-table:: Selected Result Component Labels :ref:`prnsol`,SRES, ``Comp`` + :header-rows: 1 + + * - Comp + - Description + * - SVAR ``n`` + - The ``n`` th state variable. + * - FLDUF0 ``n`` + - The ``n`` th user-defined field variable. + + """ + command = f"PRNSOL,{item},{comp},,,,{avg},{datakey}" + return self.run(command, **kwargs) + + def prorb(self, whrlnodkey: str = "", **kwargs): + r"""Prints the orbital motion characteristics of a rotating structure + + Mechanical APDL Command: `PRORB `_ + + Parameters + ---------- + whrlnodkey : str + Flag to print the whirl for each node: + + * ``1 (ON or YES)`` - Print the whirl for each node. + + * ``0 (OFF or NO)`` - No printout. This value is the default. + + Notes + ----- + When a structure is rotating and the Coriolis or gyroscopic effect is taken into account ( + :ref:`coriolis` ), nodes lying on the rotation axis generally exhibit an elliptical orbital motion. + The :ref:`prorb` command prints out the `orbit + `_ + characteristics A, B, PSI, PHI, YMAX, ZMAX, and Whirl of each rotating node, where + + * A is the semi-major axis. + * B is the semi-minor axis. + * PSI is the angle between local y axis and major axis. + * PHI is the angle between initial position (t = 0) and major axis. + * YMAX is the maximum displacement along local y axis. + * ZMAX is the maximum displacement along local z axis. + * Whirl is the direction of an orbital motion (BW for backward whirl and FW for forward whirl). + + Angles PSI and PHI are in degrees and within the range of -180 through +180. + + To display the characteristics of the orbital path traversed by each node, issue the :ref:`plorb` + command. + + The :ref:`prorb` command is valid for line elements (such as ``BEAM188``, ``BEAM189``, ``PIPE288``, + and ``PIPE289`` ). :ref:`prorb` is not supported for beam elements with the warping degree of + freedom activated. + + Your model must also involve a rotational velocity ( :ref:`omega` or :ref:`cmomega` ) with Coriolis + enabled ( :ref:`coriolis` ). + + Because orbit data is written in the database, a :ref:`set` command must be issued after the + :ref:`prorb` command to ensure proper output for subsequent postprocessing commands. + + The coordinate system for displaying nodal results must be global Cartesian ( :ref:`rsys`, ``KCN`` = + 0). :ref:`prorb` is not supported if nodes are rotated in a cylindrical coordinate system. + """ + command = f"PRORB,{whrlnodkey}" + return self.run(command, **kwargs) + + def prrfor(self, lab: str = "", **kwargs): + r"""Prints the constrained node reaction solution. Used with the :ref:`force` command. + + Mechanical APDL Command: `PRRFOR `_ + + Parameters + ---------- + lab : str + Nodal reaction load type. If blank, use the first ten of all available labels. Valid labels are: + + * **Structural force labels** : FX, FY or FZ (forces); F (FX, FY and FZ); MX, MY or MZ (moments); M + (MX, MY and MZ). + * **Thermal force labels** : HEAT, HBOT, HE2, HE3,..., HTOP (heat flow). + * **Fluid force labels** : FLOW (fluid flow); VFX, VFY and VFZ (fluid forces); VF (VFX, VFY and + VFZ). + * **Electric force labels** : AMPS (current flow); CHRG (charge); CURT (current); VLTG (voltage + drop). + * **Magnetic force labels** : FLUX (magnetic flux); CSGZ (magnetic current segment); CURT (current), + VLTG (voltage drop). + * **Diffusion labels** : RATE (diffusion flow rate). + + Notes + ----- + + .. _PRRFOR_notes: + + :ref:`prrfor` has the same functionality as the :ref:`prrsol` command; use :ref:`prrfor` instead of + :ref:`prrsol` when a :ref:`force` command has been issued. + + In a non-spectrum analysis, if either contact or pretension elements exist in the model, + :ref:`prrfor` uses the :ref:`prrsol` command internally and the :ref:`force` setting is ignored. + + Because modal displacements cannot be used to calculate contact element nodal forces, those forces + are not included in the spectrum and PSD analyses reaction solution. As a consequence, the + :ref:`prrfor` command is not supported when constraints on contact element pilot nodes are present. + + :ref:`prrfor` is not valid when using the amplitude or phase results set ( ``KIMG`` = AMPL or PHAS + on the :ref:`set` command). Use :ref:`prrsol` instead. + + **Using PRRFOR in a Spectrum or PSD Analysis ( ANTYPE,SPECTR)** + When using :ref:`prrfor` in a spectrum analysis (after the combination file has been input through + :ref:`input`,,MCOM and when :ref:`spopt` has not been issued with ``Elcalc`` = YES during the + spectrum analysis), or in a PSD analysis when postprocessing 1-sigma results (loadstep 3, 4, or 5), + the following message will display in the printout header: + + .. code:: apdl + + (Spectrum analysis summation is used) + + This message means that the summation of the element nodal forces is performed prior to the + combination of those forces. In this case, :ref:`rsys` does not apply, and the reaction forces are + in the nodal coordinate systems. Unlike :ref:`prrsol`, which retrieves the forces from the database, + the :ref:`prrfor` command calculates the forces in the postprocessor. + + The spectrum analysis summation is available when the element results are written to the mode file, + :file:`Jobname.mode` ( ``MSUPkey`` = Yes on :ref:`mxpand` ). + + The spectrum analysis summation is not available after reading a load case ( :ref:`lcwrite`, + :ref:`lczero`, :ref:`lcase` ). + """ + command = f"PRRFOR,{lab}" + return self.run(command, **kwargs) + + def prrsol(self, lab: str = "", **kwargs): + r"""Prints the constrained node reaction solution. + + Mechanical APDL Command: `PRRSOL `_ + + Parameters + ---------- + lab : str + Nodal reaction load type. If blank, use the first ten of all available labels. Valid labels are: + + * **Structural force labels** : FX, FY or FZ (forces); F (FX, FY and FZ); MX, MY or MZ (moments); M + (MX, MY and MZ); BMOM (bimoments). + * **Thermal force labels** : HEAT, HBOT, HE2, HE3,..., HTOP (heat flow). + * **Fluid force labels** : FLOW (fluid flow); VFX, VFY and VFZ (fluid forces); VF (VFX, VFY and + VFZ). + * **Electric force labels** : AMPS (current flow); CHRG (charge); CURT (current); VLTG (voltage + drop). + * **Magnetic force labels** : FLUX (magnetic flux); CSGZ (magnetic current segment); CURT (current), + VLTG (voltage drop). + * **Diffusion labels** : RATE (diffusion flow rate). + + Notes + ----- + + .. _PRRSOL_notes: + + Prints the constrained node reaction solution for the selected nodes in the sorted sequence. For + coupled nodes and nodes in constraint equations, the sum of all reactions in the coupled or + constraint equation set appears at the primary node of the set. Results are in the global Cartesian + coordinate directions unless transformed ( :ref:`rsys` ). + + :ref:`prrsol` is not valid if any load is applied to a constrained node in the direction of the + constraint and any of the following is true: + + * :ref:`lcoper` has been used. + + * :ref:`lcase` has been used to read from a load case file. + + * The applied loads and constraints in the database are not the ones used to create the results data + being processed. + + :ref:`prrsol` provides the total reaction solution (static, plus damping, plus inertial, as + appropriate based on the analysis type); however, modal reactions include only the static + contribution. + + Use :ref:`prrfor` instead of :ref:`prrsol` with the :ref:`force` command to obtain only the static, + damping, or inertial components. + + When using distributed-memory parallel processing, in a spectrum analysis or a PSD analysis + performed with ``Elcalc`` = YES on the :ref:`spopt` command, use :ref:`prrfor` instead of + :ref:`prrsol` to print the maximum reaction forces (spectrum analysis) or reaction forces variances + of 1-σ solutions, as :ref:`prrsol` may lead to more conservative results. + """ + command = f"PRRSOL,{lab}" + return self.run(command, **kwargs) + + def prvect( + self, item: str = "", lab2: str = "", lab3: str = "", labp: str = "", **kwargs + ): + r"""Prints results as vector magnitude and direction cosines. + + Mechanical APDL Command: `PRVECT `_ + + Parameters + ---------- + item : str + Predefined vector item (from :ref:`prvect_tab_1` below) or a label identifying the i-component + of a user-defined vector. + + lab2 : str + Label identifying the j-component of a user-defined vector. In most cases, this value must be + blank if ``Item`` is selected from :ref:`prvect_tab_1`. Individual principal stresses ( ``Item`` + = S) or principal strains ( ``Item`` = EP ``xx`` ) may be printed by specifying the value as 1, + 2, or 3. + + lab3 : str + Label identifying the k-component of a user-defined vector. Must be blank if ``Item`` is + selected from list below or for 2D user defined vector. + + labp : str + Label assigned to resultant vector for printout labeling (defaults to ``Item`` ). + + Notes + ----- + + .. _PRVECT_notes: + + Prints various solution results as vector magnitude and direction cosines for the selected nodes + and/or elements. For example, :ref:`prvect`,U prints the displacement magnitude and its direction + cosines for all selected nodes. For nodal degree of freedom vector results, direction cosines are + with respect to the results coordinate system RSYS. For element results, direction cosines are with + respect to the global Cartesian system. Item components may be printed with the :ref:`prnsol` + command. Various results also depend upon the recalculation method and the selected results location + ( :ref:`layer`, :ref:`shell`, :ref:`nsel`, and :ref:`esel` ). Items may be selected from a set of + recognized vector labels ( ``Item`` ) or a vector may be defined from up to three scalar labels ( + ``Item``, ``Lab2``, ``Lab3`` ). Scalar labels may be user-defined with the :ref:`etable` command. + + Portions of this command are not supported by PowerGraphics ( :ref:`graphics`,POWER). + + .. _prvect_tab_1: + + PRVECT - Valid Item and Component Labels + **************************************** + + .. flat-table:: + :header-rows: 1 + + * - Item + - Comp + - Description + * - Valid item labels for nodal degree of freedom vector results are: + * - U + - + - Structural displacement vector magnitude and direction cosines. + * - ROT + - + - Structural rotation vector magnitude and direction cosines. + * - V + - + - Velocity vector magnitude and direction cosines. + * - A + - + - Magnetic vector potential vector magnitude and direction cosines. + * - Valid item labels for element results are: + * - S + - + - Principal stresses and direction cosines. + * - EPTO + - + - Principal total strains (EPEL + EPPL + EPCR) and direction cosines. + * - EPEL + - + - Principal elastic strains and direction cosines. + * - EPPL + - + - Principal plastic strains and direction cosines. + * - EPCR + - + - Principal creep strains and direction cosines. + * - EPTH + - + - Principal thermal strains and direction cosines. + * - EPDI + - + - Principal diffusion strains and direction cosines. + * - TG + - + - Thermal gradient vector sum and direction cosines. + * - TF + - + - Thermal flux vector sum and direction cosines. + * - PG + - + - Velocity or energy density flux (room acoustics) vector sum and direction cosines. + * - EF + - + - Electric field vector sum and direction cosines. + * - D + - + - Electric flux density vector sum and direction cosines. + * - H + - + - Magnetic field intensity vector sum and direction cosines. If ``Lab2`` is blank, Item is interpreted as one of the predefined labels; otherwise, Item is interpreted as a user-defined :ref:`et` label and the program requests a non-blank ``Lab2`` / ``Lab3`` according to the dimension of the problem. + * - B + - + - Magnetic flux density vector sum and direction cosines. + * - CG + - + - Concentration gradient vector sum and direction cosines. + * - DF + - + - Diffusion flux density vector sum and direction cosines. + * - FMAG + - + - Electromagnetic force vector sum and direction cosines. + * - P + - + - Poynting vector sum and direction cosines. + * - JS + - + - Source current density vector sum and direction cosines for low-frequency magnetic analyses. Total current density vector sum and direction cosines (sum of conduction and displacement current densities) in low frequency electric analyses. + * - JT + - + - Total measurable current density vector sum and direction cosines in low-frequency electromagnetic analyses. (Conduction current density vector sum and direction cosines in a low-frequency electric analysis.) + * - JC + - + - Conduction current density vector sum and direction cosines for elements that support conduction current calculation. + * - SNDI + - + - Sound intensity vector sum and direction cosines. + + """ + command = f"PRVECT,{item},{lab2},{lab3},{labp}" + return self.run(command, **kwargs) + + def sumtype(self, label: str = "", **kwargs): + r"""Sets the type of summation to be used in the following load case operations. + + Mechanical APDL Command: `SUMTYPE `_ + + Parameters + ---------- + label : str + Summation type + + * ``COMP`` - Combine element component stresses only. Stresses such as average nodal stresses, + principal stresses, equivalent stresses, and stress intensities are derived from the combined + element component stresses. Default. + + * ``PRIN`` - Combine principal stress, equivalent stress, and stress intensity directly as stored on + the results file. Component stresses are not available with this option. + + Notes + ----- + + .. _SUMTYPE_notes: + + Issue :ref:`sumtype`,PRIN when you want to have a load case operation ( :ref:`lcoper` ) act on the + principal / equivalent stresses instead of the component stresses. Also issue :ref:`sumtype`,PRIN + when you want to read in load cases ( :ref:`lcase` ). Note that the :ref:`sumtype` setting is not + maintained between /POS T1 sessions. + + :ref:`sumtype`,PRIN also causes principal nodal values to be the average of the contributing + principal element nodal values (see :ref:`avprin`,1). + + ``BEAM188`` and ``BEAM189`` elements compute principal stress, equivalent stress, and stress + intensity values on request instead of storing them on the results file; :ref:`sumtype`,PRIN does + not apply for these elements. + """ + command = f"SUMTYPE,{label}" + return self.run(command, **kwargs) diff --git a/src/ansys/mapdl/core/_commands/post1/set_up.py b/src/ansys/mapdl/core/_commands/post1/set_up.py new file mode 100644 index 00000000000..692d3c68c98 --- /dev/null +++ b/src/ansys/mapdl/core/_commands/post1/set_up.py @@ -0,0 +1,1140 @@ +# Copyright (C) 2016 - 2025 ANSYS, Inc. and/or its affiliates. +# SPDX-License-Identifier: MIT +# +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to deal +# in the Software without restriction, including without limitation the rights +# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +# copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in all +# copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +# SOFTWARE. + + +class SetUp: + + def append( + self, + lstep: str = "", + sbstep: str = "", + fact: str = "", + kimg: int | str = "", + time: str = "", + angle: str = "", + nset: str = "", + **kwargs, + ): + r"""Reads data from the results file and appends it to the database. + + Mechanical APDL Command: `APPEND `_ + + Parameters + ---------- + lstep : str + Load step number of the data set to be read. Defaults to 1. If FIRST, ignore ``SBSTEP`` and + ``TIME`` and read the first data set. If LAST, ignore ``SBSTEP`` and ``TIME`` and read the last + data set. If NEXT, ignore ``SBSTEP`` and ``TIME`` and read the next data set. If already at the + last data set, the next set is the first data set. If NEAR, ignore ``SBSTEP`` and read the data + set nearest to ``TIME``. If ``TIME`` is blank, read the first data set. If LIST, scan the + results file to produce a summary of each load step ( ``FACT``, ``KIMG``, ``TIME`` and ``ANGLE`` + are ignored). + + sbstep : str + Substep number (within ``LSTEP`` ) (defaults to last substep of load step). For the Buckling ( + :ref:`antype`,BUCKLE) or Modal ( :ref:`antype`,MODAL) analysis, the substep corresponds to the + mode number (defaults to first mode). If ``LSTEP`` = LIST, ``SBSTEP`` = 0 or 1 will list the + basic load step information; ``SBSTEP`` = 2 will also list the load step title, and label the + imaginary data sets if they exist. + + fact : str + Scale factor applied to data read from the file. If zero (or blank), a value of 1.0 is used. + Harmonic velocities or accelerations may be calculated from the displacement results from a + modal or harmonic ( :ref:`antype`,HARMIC) analyses. If ``FACT`` = VELO, the harmonic velocities + (v) are calculated from the displacements (d) at a particular frequency (f) according to the + relationship v = 2 πfd. Similarly, if ``FACT`` = ACEL, the harmonic accelerations (a) are + calculated as a = (2 πf) :sup:`2` d. + + kimg : int or str + Used only with results from complex analyses: + + * ``0`` - Store real part of complex solution. + + * ``1`` - Store imaginary part. + + time : str + Time-point identifying the data set to be read. For harmonic analyses, time corresponds to the + frequency. For the buckling analysis, time corresponds to the load factor. Used only in the + following cases: If ``LSTEP`` is NEAR, read the data set nearest to ``TIME``. If both ``LSTEP`` + and ``SBSTEP`` are zero (or blank), read data set at time = ``TIME``. If ``TIME`` is between two + solution time points on the results file, a linear interpolation is done between the two data + sets. Solution items not written to the results file ( :ref:`outres` ) for either data set will + result in a null item after data set interpolation. If ``TIME`` is beyond the last time point on + the file, the last time point is used. + + angle : str + Circumferential location (0° to 360°). Defines the circumferential location for the harmonic + calculations used when reading from the results file. The harmonic factor (based on the + circumferential angle) is applied to the harmonic elements ( ``PLANE25``, ``PLANE75``, + ``PLANE78``, ``PLANE83``, and ``SHELL61`` ) of the load case. See the `Mechanical APDL Theory + Reference `_ + for details. Note that factored values of applied constraints and loads will overwrite any + values existing in the database. + + nset : str + Data set number of the data set to be read. If a positive value for ``NSET`` is entered, + ``LSTEP``, ``SBSTEP``, ``KIMG``, and ``TIME`` are ignored. Available set numbers can be + determined by :ref:`append`,LIST. To determine if data sets are real or imaginary, issue + :ref:`append`,LIST,2 which labels imaginary data sets. + + Notes + ----- + + .. _APPEND_notes: + + Reads a data set from the results file and appends it to the existing data in the database for the + selected model only. The existing database is not cleared (or overwritten in total), allowing the + requested results data to be merged into the database. Various operations may also be performed + during the read operation. The database must have the model geometry available (or used the + :ref:`resume` command before the :ref:`append` command to restore the geometry from :file:`File.DB` + ). + """ + command = f"APPEND,{lstep},{sbstep},{fact},{kimg},{time},{angle},{nset}" + return self.run(command, **kwargs) + + def desol( + self, + elem: str = "", + node: str = "", + item: str = "", + comp: str = "", + v1: str = "", + v2: str = "", + v3: str = "", + v4: str = "", + v5: str = "", + v6: str = "", + **kwargs, + ): + r"""Defines or modifies solution results at a node of an element. + + Mechanical APDL Command: `DESOL `_ + + Parameters + ---------- + elem : str + Element number for which results are defined or modified. If ALL, apply to all selected elements + ( :ref:`esel` ). + + node : str + Node of element (actual node number, not the position) to which results are specified. If ALL, + specify results for all selected nodes ( :ref:`nsel` ) of element. If ``NODE`` = P, graphical + picking is enabled and all remaining command fields are ignored (valid only in the GUI). A + component name may also be substituted for ``NODE``. + + item : str + Label identifying results. Valid item labels are shown in :ref:`DESOL_tab_1` below. Some items + also require a component label ( ``Comp`` ). + + comp : str + Component of the item (if required); see :ref:`DESOL_tab_1`. + + v1 : str + Additional values (if any) assigned to the remaining components (in the order corresponding to + the ``Comp`` list shown below) for the specified ``Item`` (starting from the specified ``Comp`` + label and proceeding to the right). + + v2 : str + Additional values (if any) assigned to the remaining components (in the order corresponding to + the ``Comp`` list shown below) for the specified ``Item`` (starting from the specified ``Comp`` + label and proceeding to the right). + + v3 : str + Additional values (if any) assigned to the remaining components (in the order corresponding to + the ``Comp`` list shown below) for the specified ``Item`` (starting from the specified ``Comp`` + label and proceeding to the right). + + v4 : str + Additional values (if any) assigned to the remaining components (in the order corresponding to + the ``Comp`` list shown below) for the specified ``Item`` (starting from the specified ``Comp`` + label and proceeding to the right). + + v5 : str + Additional values (if any) assigned to the remaining components (in the order corresponding to + the ``Comp`` list shown below) for the specified ``Item`` (starting from the specified ``Comp`` + label and proceeding to the right). + + v6 : str + Additional values (if any) assigned to the remaining components (in the order corresponding to + the ``Comp`` list shown below) for the specified ``Item`` (starting from the specified ``Comp`` + label and proceeding to the right). + + Notes + ----- + + .. _DESOL_notes: + + The :ref:`desol` command defines or modifies solution results in the database at a node of an area + or volume element. For example, :ref:`desol`,35,50,S,X,1000,2000,1000 assigns values 1000, 2000, and + 1000 to SX, SY, and SZ (respectively) of node 50 of element 35. + + The settings of the POST1 :ref:`force`, :ref:`shell`, and :ref:`layer` commands, if applicable, + further specify which database items are affected. + + For layered composite shells, specify the current element layer ( :ref:`layer` ) before issuing the + :ref:`desol` command. + + All data is stored in the solution coordinate system but is displayed in the results coordinate + system ( :ref:`rsys` ). To list the current results, use the :ref:`presol` command. + + Modified solution results are not saved automatically. To save separate records of modified results, + use either the :ref:`rappnd` or :ref:`lcwrite` command. + + Result items are available depending on element type; check the individual element for availability. + Valid item and component labels for element results are: + + .. _DESOL_tab_1: + + DESOL - Valid Item and Component Labels + *************************************** + + .. flat-table:: + :header-rows: 1 + + * - Item + - Comp + - Description + * - ELEM + - + - Element number. + * - S + - X, Y, Z, XY, YZ, XZ + - Component stress. + * - EPEL + - X, Y, Z, XY, YZ, XZ + - Component elastic strain. + * - EPTH + - X, Y, Z, XY, YZ, XZ + - Component thermal strain. + * - EPPL + - X, Y, Z, XY, YZ, XZ + - Component plastic strain. + * - EPCR + - X, Y, Z, XY, YZ, XZ + - Component creep strain. + * - EPSW + - + - Swelling strain. + * - NL + - SEPL + - Equivalent stress (from stress-strain curve). + * - " + - SRAT + - Stress state ratio. + * - " + - HPRES + - Hydrostatic pressure. + * - " + - EPEQ + - Accumulated equivalent plastic strain. + * - " + - PSV + - Plastic state variable. + * - " + - PLWK + - Plastic work/volume. + * - SEND + - ELASTIC + - Elastic strain energy density. + * - " + - PLASTIC + - Plastic strain energy density. + * - " + - CREEP + - Creep strain energy density. + * - TG + - X, Y, Z + - Component thermal gradient. + * - TF + - X, Y, Z + - Component thermal flux. + * - PG + - X, Y, Z + - Component pressure gradient. + * - EF + - X, Y, Z + - Component electric field. + * - D + - X, Y, Z + - Component electric flux density. + * - H + - X, Y, Z + - Component magnetic field intensity. + * - B + - X, Y, Z + - Component magnetic flux density. + * - CG + - X, Y, Z + - Concentration gradient + * - DF + - X, Y, Z + - Diffusion flux density + * - FMAG + - X, Y, Z + - Component electromagnetic force. + * - F + - X, Y, Z + - X, Y, or Z structural force. + * - M + - X, Y, Z + - X, Y, or Z structural moment. + * - HEAT + - + - Heat flow. + * - FLOW + - + - Fluid flow. + * - AMPS + - + - Current flow. + * - FLUX + - + - Magnetic flux. + * - CSG + - X, Y, Z + - X, Y, or Z magnetic current segment component. + * - RATE + - + - Diffusion flow rate + + """ + command = f"DESOL,{elem},{node},{item},{comp},{v1},{v2},{v3},{v4},{v5},{v6}" + return self.run(command, **kwargs) + + def detab( + self, + elem: str = "", + lab: str = "", + v1: str = "", + v2: str = "", + v3: str = "", + v4: str = "", + v5: str = "", + v6: str = "", + **kwargs, + ): + r"""Modifies element table results in the database. + + Mechanical APDL Command: `DETAB `_ + + Parameters + ---------- + elem : str + Element for which results are to be modified. If ALL, modify all selected elements ( :ref:`esel` + ) results. If ``ELEM`` = P, graphical picking is enabled and all remaining command fields are + ignored (valid only in the GUI). A component name may also be substituted for ``ELEM``. + + lab : str + Label identifying results. Valid labels are as defined with the :ref:`etable` command. Issue + :ref:`etable`, ``STAT`` to display labels and values. + + v1 : str + Additional values (if any) assigned to consecutive element table columns. + + v2 : str + Additional values (if any) assigned to consecutive element table columns. + + v3 : str + Additional values (if any) assigned to consecutive element table columns. + + v4 : str + Additional values (if any) assigned to consecutive element table columns. + + v5 : str + Additional values (if any) assigned to consecutive element table columns. + + v6 : str + Additional values (if any) assigned to consecutive element table columns. + + Notes + ----- + + .. _DETAB_notes: + + Modifies element table ( :ref:`etable` ) results in the database. For example, :ref:`detab` + ,35,ABC,1000,2000,1000 assigns 1000, 2000, and 1000 to the first three table columns starting with + label ABC for element 35. Use the :ref:`pretab` command to list the current results. After deleting + a column of data using :ref:`etable`, ``Lab``,ERASE, the remaining columns of data are not shifted + to compress the empty slot. Therefore, the user must allocate null (blank) values for ``V1``, + ``V2``... ``V6`` for any ETABLE entries which have been deleted by issuing :ref:`etable`, + ``Lab``,ERASE. All data are stored in the solution coordinate system but will be displayed in the + results coordinate system ( :ref:`rsys` ). + """ + command = f"DETAB,{elem},{lab},{v1},{v2},{v3},{v4},{v5},{v6}" + return self.run(command, **kwargs) + + def dnsol( + self, + node: str = "", + item: str = "", + comp: str = "", + v1: str = "", + v2: str = "", + v3: str = "", + v4: str = "", + v5: str = "", + v6: str = "", + datakey: str = "", + **kwargs, + ): + r"""Defines or modifies solution results at a node. + + Mechanical APDL Command: `DNSOL `_ + + Parameters + ---------- + node : str + Node for which results are specified. If ALL, apply to all selected nodes ( :ref:`nsel` ). If + ``NODE`` = P, graphical picking is enabled and all remaining command fields are ignored (valid + only in the GUI). A component name may also be substituted for ``NODE``. + + item : str + Label identifying results, see :ref:`DNSOL_tab_1`. Some items also require a component label. + + comp : str + Component of the item. Valid component labels are shown :ref:`DNSOL_tab_1` below. + + v1 : str + Value assigned to result. If zero, a zero value will be assigned. If blank, the value remains + unchanged. Additional values (if any) assigned to the remaining components (in the order + corresponding to the ``Comp`` list shown below for the specified ``Item`` (starting from the + specified ``Comp`` label and proceeding to the right). + + v2 : str + Value assigned to result. If zero, a zero value will be assigned. If blank, the value remains + unchanged. Additional values (if any) assigned to the remaining components (in the order + corresponding to the ``Comp`` list shown below for the specified ``Item`` (starting from the + specified ``Comp`` label and proceeding to the right). + + v3 : str + Value assigned to result. If zero, a zero value will be assigned. If blank, the value remains + unchanged. Additional values (if any) assigned to the remaining components (in the order + corresponding to the ``Comp`` list shown below for the specified ``Item`` (starting from the + specified ``Comp`` label and proceeding to the right). + + v4 : str + Value assigned to result. If zero, a zero value will be assigned. If blank, the value remains + unchanged. Additional values (if any) assigned to the remaining components (in the order + corresponding to the ``Comp`` list shown below for the specified ``Item`` (starting from the + specified ``Comp`` label and proceeding to the right). + + v5 : str + Value assigned to result. If zero, a zero value will be assigned. If blank, the value remains + unchanged. Additional values (if any) assigned to the remaining components (in the order + corresponding to the ``Comp`` list shown below for the specified ``Item`` (starting from the + specified ``Comp`` label and proceeding to the right). + + v6 : str + Value assigned to result. If zero, a zero value will be assigned. If blank, the value remains + unchanged. Additional values (if any) assigned to the remaining components (in the order + corresponding to the ``Comp`` list shown below for the specified ``Item`` (starting from the + specified ``Comp`` label and proceeding to the right). + + datakey : str + Key to specify which data is modified: + + * ``AUTO`` - `Nodal-averaged results + `_ are + used if available. Otherwise, the element-based data is used if available. (Default) + + * ``ESOL`` - Only element-based results are used. If they are not available, the command is ignored. + + * ``NAR`` - Only nodal-averaged results are used. If they are not available, the command is ignored. + + Notes + ----- + + .. _DNSOL_notes: + + :ref:`dnsol` can be used only with FULL graphics activated ( :ref:`graphics`,FULL); it will not work + correctly with PowerGraphics activated. + + :ref:`dnsol` defines or modifies solution results in the database at a node. For example, + :ref:`dnsol`,35,U,X,.001,.002,.001 assigns values 0.001, 0.002, and 0.001 to UX, UY, and UZ + (respectively) for node 35. All results that are changed in the database, including the nodal degree + of freedom results, are available for all subsequent operations. All data is stored in the solution + coordinate system but is displayed in the results coordinate system ( :ref:`rsys` ). Use + :ref:`prnsol` to list the current results. + + Data input by :ref:`dnsol` is stored in temporary space and does not replace information in the + database. Therefore, data input by this command may be overwritten if a change is made to the + selected set of nodes or if an output operation acts on a new ``Item``. + + Issuing :ref:`dnsol` requires you to place the data type (stress/strain) in the element nodal + records. To work around this requirement, use the :ref:`desol` command or equivalent path to add a + dummy element stress/strain record. + + Result items are available depending on element type; check the individual element for availability. + Valid item and component labels for element results are shown in :ref:`DNSOL_tab_1`. + + Using :ref:`dnsol` with Nodal-Averaged Results + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + + If `nodal-averaged results + `_ ( + :ref:`outres`,NAR or another nodal-averaged label) are in the database, then :ref:`dnsol` acts on + the nodal-averaged data for the applicable items (S, EPEL, EPPL, EPCR, EPTH, EPSW) by default. You + can change this behavior via the ``DataKey`` argument. + + :ref:`dnsol` behavior differs when the command acts on `nodal-averaged results + `_. + The nodal-averaged results that are defined or modified will be apparent in subsequent command + operations (for example :ref:`prnsol`, :ref:`plnsol` ) in both full model graphics mode ( + :ref:`graphics`,FULL) and PowerGraphics mode ( :ref:`graphics`,POWER). The resultant data is stored + in the global Cartesian coordinate system but is displayed in the results coordinate system ( + :ref:`rsys` ). :ref:`dnsol` can only be applied to nodal-averaged results if they are already in the + database; otherwise, the modifications are applied to the element-based solution in temporary + memory. The modified nodal-averaged results are not saved to the results file automatically. To save + separate records of modified nodal-averaged results, use :ref:`lcwrite`, :ref:`rappnd`, or + :ref:`reswrite`. + + :ref:`dnsol` can only modify component values ( ``Comp`` = X, Y, Z, XY, YZ, or XZ) for nodal- + averaged results. If you attempt to modify principal values using :ref:`dnsol` with ``DataKey`` = + AUTO, then the modification is applied to element-based results if they are available. + + .. _DNSOL_tab_1: + + DNSOL - Valid Item and Component Labels + *************************************** + + .. flat-table:: Valid Item and Component Labels for Nodal DOF Results + :header-rows: 1 + + * - Item + - Comp + - Description + * - U + - X, Y, Z + - X, Y, or Z structural displacement. + * - ROT + - X, Y, Z + - X, Y, or Z structural rotation. + * - TEMP[ :ref:`DNSOL_temp` ] + - + - Temperature. + * - PRES + - + - Pressure. + * - VOLT + - + - Electric potential. + * - MAG + - + - Magnetic scalar potential. + * - V + - X, Y, Z + - X, Y, or Z fluid velocity. + * - A + - X, Y, Z + - X, Y, or Z magnetic vector potential. + * - CONC + - + - Concentration. + + + This command contains some tables and extra information which can be inspected in the original + documentation pointed above. + + .. _DNSOL_temp: + + For ``SHELL131`` and ``SHELL132`` elements with KEYOPT(3) = 0 or 1, use the labels TBOT, TE2, + TE3,..., TTOP instead of TEMP. + + .. _DNSOL_NAR: + + For these component values, `nodal-averaged results + `_ are + modified if they are available in the results file and ``DataKey`` = AUTO or NAR. + + .. _DNSOL_NAR_2: + + Modifying principal values of nodal-averaged results is not supported. + """ + command = f"DNSOL,{node},{item},{comp},{v1},{v2},{v3},{v4},{v5},{v6},{datakey}" + return self.run(command, **kwargs) + + def hrcplx( + self, + loadstep: str = "", + substep: str = "", + omegat: str = "", + firstlcase: str = "", + secondlcase: str = "", + **kwargs, + ): + r"""Computes and stores in the database the time-harmonic solution at a prescribed phase angle. + + Mechanical APDL Command: `HRCPLX `_ + + Parameters + ---------- + loadstep : str + Load step number of the data set to be read (defaults to 1). + + substep : str + Substep number within ``LOADSTEP``. + + omegat : str + Angle in degrees (Ω (angle) times T (time)). + + * If ≥ 360°, the amplitude is supplied. + + * All others supply results at that angle. For example, if the angle is set to 0.0°, the real part + of the solution is supplied. If the angle is set to -90° the imaginary part of the solution is + supplied. + + firstlcase : str + First load case number (defaults to 1). + + secondlcase : str + Second load case number (defaults to 2). + + Notes + ----- + + .. _HRCPLX_notes: + + :ref:`hrcplx` invokes a macro that combines the real and imaginary parts of the solution. If the + angle is specified, it produces the following: + + .. math:: + + equation not available + + R:sub:`R` and R:sub:`I` are, respectively, the real and imaginary parts of the results quantity + (e.g. the nodal displacements, the reaction forces,...). + + α is the angle (OMEGAT). + + ``1STLCASE`` and ``2NDLCASE`` are internally generated load cases. You may want to specify these to + avoid overwriting an existing load case number 1 or 2. + + Not all results computed by this command are valid. See `Summable, Non-Summable and Constant Data + `_ in + the `Basic Analysis Guide + `_ for more + information. When the amplitude of the solution is requested ( ``OMEGAT`` >= + 360°), averaged values (such as the nodal component stresses, which are an average of element nodal + component stresses) are calculated by averaging the amplitudes. Because the degrees of freedom + results have different phases, derived results (such as the equivalent stress SEQV) are not valid. + See `POST1 and POST26 - Complex Results Postprocessing + `_ + + For postprocessing amplitudes, the only appropriate coordinate system is the solution coordinate + system ( :ref:`rsys`,SOLU). When displaying the displacement amplitudes, use a contour display ( + :ref:`plnsol` command). Because a deformed shape display ( :ref:`pldisp` command) could lead to a + non-physical shape, the displacement scaling is off by default ( :ref:`slashdscale`,,OFF). + + For postprocessing cylindrical geometry, it is suggested that you rotate the element coordinate + systems into the appropriate cylindrical system ( ``EMODIF,,ESYS`` ) before running the solution and + then view the results in this system ( ``RSYS,SOLU`` ) in POST1. + + Since :ref:`hrcplx` performs load case combinations, it alters most of the data in the database. In + particular, it alters applied loads such as forces and imposed displacements. To restore the + original loads in the database for a subsequent analysis, reissue the :ref:`set` command in POST1 to + retrieve the real and imaginary set data. + + To animate the solution over one period, use the :ref:`anharm` command. + + ``OMEGAT`` is not equal to the phase shift. + + This command is not supported after a cyclic symmetry analysis; use :ref:`cycexpand`,,PHASEANG + instead. + """ + command = f"HRCPLX,{loadstep},{substep},{omegat},{firstlcase},{secondlcase}" + return self.run(command, **kwargs) + + def rescombine( + self, + numfiles: str = "", + fname: str = "", + ext: str = "", + lstep: str = "", + sbstep: str = "", + fact: str = "", + kimg: str = "", + time: str = "", + angle: str = "", + nset: str = "", + order: str = "", + **kwargs, + ): + r"""Reads results from local results files into the database after a distributed-memory parallel + solution. + + Mechanical APDL Command: `RESCOMBINE `_ + + Parameters + ---------- + numfiles : str + Number of local results files that are to be read into the database from the distributed-memory + parallel solution. This number should be equal to the number of processes used in the parallel + solution. + + fname : str + File name (jobname) used during the distributed parallel solution. The file name must be an + alphanumeric string (up to 32 characters) enclosed in single quotes. + + ext : str + File extension for the results files (for example, RST, RTH, RMG, etc.). The file extension must + be an alphanumeric string (up to 8 characters) enclosed in single quotes. + + lstep : str + Load step number of the data set to be read (defaults to 1): + + * ``N`` - Read load step ``N``. + + * ``FIRST`` - Read the first data set ( ``Sbstep`` and ``TIME`` are ignored). + + * ``LAST`` - Read the last data set ( ``Sbstep`` and ``TIME`` are ignored). + + * ``NEXT`` - Read the next data set ( ``Sbstep`` and ``TIME`` are ignored). If at the last data set, + the first data set will be read as the next. + + * ``PREVIOUS`` - Read the previous data set ( ``Sbstep`` and ``TIME`` are ignored). If at the first + data set, the last data set will be read as the previous. + + * ``NEAR`` - Read the data set nearest to ``TIME`` ( ``Sbstep`` is ignored). If ``TIME`` is blank, + read the first data set. + + * ``LIST`` - Scan the results files and list a summary of each load step ( ``KIMG``, ``TIME``, + ``ANGLE``, ``NSET``, and ``ORDER`` are ignored.) + + sbstep : str + Substep number within ``Lstep`` (defaults to the last substep of the load step). For a buckling + ( :ref:`antype`,BUCKLE) or modal ( :ref:`antype`,MODAL) analysis, ``Sbstep`` corresponds to the + mode number (defaults to the first mode). Specify ``Sbstep`` = LAST to store the last substep + for the specified load step. + + If ``Lstep`` = LIST, ``Sbstep`` = 0 or 1 lists the basic step information; ``Sbstep`` = 2 also + lists the basic step information, but includes the load step title, and labels imaginary data + sets if they exist. + + fact : str + Scale factor applied to data read from the files. If zero (or blank), a value of 1.0 is used. A + nonzero factor excludes non-summable items. Harmonic velocities or accelerations may be + calculated from the displacement results from a modal ( :ref:`antype`,MODAL) or harmonic ( + :ref:`antype`,HARMIC) analysis. If ``Fact`` = VELO, the harmonic velocities (v) are calculated + from the displacements (d) at a particular frequency (f) according to the relationship v = 2πfd. + Similarly, if ``Fact`` = ACEL, the harmonic accelerations (a) are calculated as a = (2πf) + :sup:`2` d. + + kimg : str + Used only with complex results (harmonic and complex modal analyses). + + * ``0 or REAL`` - Store the real part of a complex solution (default). + + * ``1, 2 or IMAG`` - Store the imaginary part of a complex solution. + + time : str + Time-point identifying the data set to be read. For a harmonic analysis, time corresponds to the + frequency. For a buckling analysis, time corresponds to the load factor. Used only in the + following cases: If ``Lstep`` = NEAR, read the data set nearest to ``TIME``. If both ``Lstep`` + and ``Sbstep`` are zero (or blank), read data set at time = ``TIME``. If ``TIME`` is between two + solution time points on the results file, a linear interpolation is done between the two data + sets. Solution items not written to the results file ( :ref:`outres` ) for either data set will + result in a null item after data set interpolation. If ``TIME`` is beyond the last time point on + the file, the last time point will be used. + + angle : str + Circumferential location (0.0 to 360°). Defines the circumferential location for the harmonic + calculations used when reading from the results file. The harmonic factor (based on the + circumferential angle) is applied to the harmonic elements ( ``PLANE25``, ``PLANE75``, + ``PLANE78``, ``PLANE83``, and ``SHELL61`` ) of the load case. See the `Mechanical APDL Theory + Reference `_ + for details. Note that factored values of applied constraints and loads will overwrite any + values existing in the database. + + nset : str + Data set number of the data set to be read. If a positive value for ``NSET`` is entered, + ``Lstep``, ``Sbstep``, ``KIMG``, and ``TIME`` are ignored. Available set numbers can be + determined by :ref:`rescombine`,,,,LIST. + + order : str + Key to sort the harmonic index results. This option applies to `cyclic symmetry `_ buckling and modal analyses only, and is valid only when ``Lstep`` = FIRST, LAST, NEXT, PREVIOUS, NEAR or LIST. + + * ``ORDER`` - Sort the harmonic index results in ascending order of eigenfrequencies or buckling + load multipliers. + + * ``(blank)`` - No sorting takes place. + + Notes + ----- + + .. _RESCOMBINE_notes: + + :ref:`rescombine` is a Mechanical APDL command macro enabling you to combine results from a + distributed- + memory parallel ( DMP ) solution. A character string input for any argument must be enclosed in + single quotes (for example, 'FIRST' input for ``Lstep`` ). + + In a distributed memory parallel solution, a global results file is saved by default. However, if + you issued :ref:`dmpoption`,RST,NO in the parallel solution, no global results file is written and + all local results files will be kept. In this case, you can use :ref:`rescombine` in the general + postprocessor ( :ref:`post1` ) to read results into the database for postprocessing. + + :ref:`rescombine` cannot be used to combine results from local files generated during a distributed- + memory parallel solution that used the frequency or cyclic harmonic index domain decomposition + method ( :ref:`ddoption`,FREQ or :ref:`ddoption`,CYCHI). + + To use :ref:`rescombine`, all local results files from the distributed-memory parallel solution must + be in the current working directory. If running on a single machine, the local results files are + saved in the working directory by default. If running on a cluster, the local results files are kept + in the working directory on each compute node. For the latter case, copy the local results files to + the working directory on the primary compute node. + + Similar to :ref:`set`, :ref:`rescombine` defines the data set to be read from the results files into + the database. Various operations can also be performed during the read operation. (See :ref:`set` + for more information.) The database must have the model data available (or issue :ref:`resume` + before :ref:`rescombine` to restore the geometry from :file:`Jobname.DB` ). + + After issuing :ref:`rescombine` to combine a set of data into the database, you can issue + :ref:`reswrite` to write the data set into a new results file. The new results file will essentially + contain the current set of results data for the entire (that is, global) model. + + Upon completion of a :ref:`rescombine` operation, the current file for postprocessing ( ``FILE`` ) + is set to the last local results file specified via :ref:`rescombine`. For example, if reading in + four local results files, the results file for POST1 is specified as :file:`Jobname3.RST` when + :ref:`rescombine` is complete. Therefore, be aware that some downstream postprocessing actions (such + as :ref:`set` ) may be operating on only this one local results file. + + :ref:`rescombine` is intended for use in POST1. If you want to postprocess DMP solution results + using the POST26 time-history postprocessor, combine your local results files into one global + results file ( :ref:`dmpoption`,RST,YES). + + The load case commands in the general postprocessor (such as :ref:`lcdef`, :ref:`lcfile`, + :ref:`lcoper`, etc.) are not supported when using :ref:`rescombine`. Those commands set up pointers + in the results file used for postprocessing; they cannot be used with the local results files used + by :ref:`rescombine`. + + :ref:`cycexpand`, which performs a cyclic expansion, cannot be used with :ref:`rescombine`. + """ + command = f"RESCOMBINE,{numfiles},{fname},{ext},{lstep},{sbstep},{fact},{kimg},{time},{angle},{nset},{order}" + return self.run(command, **kwargs) + + def reset(self, **kwargs): + r"""Resets all POST1 or POST26 specifications to initial defaults. + + Mechanical APDL Command: `RESET `_ + + Notes + ----- + + .. _RESET_notes: + + Has the same effect as entering the processor the first time within the run. In POST1, resets all + specifications to initial defaults, erases all element table items, path table data, and load case + pointers. In POST26, resets all specifications to initial defaults, erases all variables defined, + and zeroes the data storage space. + """ + command = "RESET" + return self.run(command, **kwargs) + + def set( + self, + lstep: str = "", + sbstep: str = "", + fact: str = "", + kimg: str = "", + time: str = "", + angle: str = "", + nset: str = "", + order: str = "", + **kwargs, + ): + r"""Defines the data set to be read from the results file. + + Mechanical APDL Command: `SET `_ + + .. note:: + + From version 0.64 you can use the methods ``to_list`` and ``to_array`` on the object + returning from ``mapdl.set("list")``. + + Parameters + ---------- + lstep : str + Load step number of the data set to be read (defaults to 1): + + * ``N`` - Read load step ``N``. + + * ``FIRST`` - Read the first data set ( ``Sbstep`` and ``TIME`` are ignored). + + * ``LAST`` - Read the last data set ( ``Sbstep`` and ``TIME`` are ignored). + + * ``NEXT`` - Read the next data set ( ``Sbstep`` and ``TIME`` are ignored). If at the last data set, + the first data set will be read as the next. + + * ``PREVIOUS`` - Read the previous data set ( ``Sbstep`` and ``TIME`` are ignored). If at the first + data set, the last data set will be read as the previous. + + * ``NEAR`` - Read the data set nearest to ``TIME`` ( ``Sbstep`` is ignored). If ``TIME`` is blank, + read the first data set. + + * ``LIST`` - Scan the results file and list a summary of each load step. ( ``KIMG``, ``TIME``, + ``ANGLE``, and ``NSET`` are ignored.) + + sbstep : str + Substep number (within ``Lstep`` ). Defaults to the last substep of the load step (except in a + buckling or modal analysis). For a buckling ( :ref:`antype`,BUCKLE) or modal ( :ref:`antype` + ,MODAL) analysis, ``Sbstep`` corresponds to the mode number. Specify ``Sbstep`` = LAST to store + the last substep for the specified load step (that is, issue a :ref:`set`, ``Lstep``,LAST + command). + + If ``Lstep`` = LIST, ``Sbstep`` = 0 or 1 lists the basic step information. ``Sbstep`` = 2 also + lists the basic step information, but includes the load step title, and labels imaginary data + sets if they exist. + + fact : str + Scale factor applied to data read from the file. If zero (or blank), a value of 1.0 is used. A + nonzero factor excludes non-summable items. + + Harmonic velocities or accelerations can be calculated from the displacement results from a + modal ( :ref:`antype`,MODAL) or harmonic ( :ref:`antype`,HARMIC) analysis. If ``Fact`` = VELO, + the harmonic velocities (v) are calculated from the displacements (d) at a particular frequency + (f) according to the relationship v = 2 πfd. Similarly, if ``Fact`` = ACEL, the harmonic + accelerations (a) are calculated as a = (2 πf) :sup:`2` d. + + If ``Lstep`` = LIST in an analysis using rezoning, ``Fact`` across all rezoning data sets is + listed. + + kimg : str + Used only with complex results (harmonic and complex modal analyses). + + * ``0 or REAL`` - Store the real part of complex solution (default). + + * ``1, 2 or IMAG`` - Store the imaginary part of a complex solution. + + * ``3 or AMPL`` - Store the amplitude + + * ``4 or PHAS`` - Store the phase angle. The angle value, expressed in degrees, will be between + -180° and +180°. + + time : str + Time-point identifying the data set to be read. For a harmonic analyses, time corresponds to the + frequency. + + For a buckling analysis, time corresponds to the load factor. + + Used only in the following cases: If ``Lstep`` = NEAR, read the data set nearest to ``TIME``. If + both ``Lstep`` and ``Sbstep`` are zero (or blank), read data set at time = ``TIME``. + + Do not use ``TIME`` to identify the data set to be read if you used the arc-length method ( + :ref:`arclen` ) in your solution. + + If ``TIME`` is between two solution time points in the results file, a linear interpolation + occurs between the two data sets (except in cases where `rezoning + `_ or + selected results output ( :ref:`osresult` ) is used). + + Solution items not written to the results file ( :ref:`outres` ) for either data set will result + in a null item after data set interpolation. + + If ``TIME`` is beyond the last time point on the file, the last time point will be used. + + If ``TIME`` is between two solution time points and both ``Lstep`` and ``Sbstep`` are zero (or + blank), no interpolation is performed for the :ref:`prcint` / :ref:`plcint` commands. (That is, + for results generated by the :ref:`cint` command, only the data set associated with the lower of + the solution time points is used.) + + angle : str + For harmonic elements ( ``PLANE25``, ``PLANE75``, ``PLANE78``, ``PLANE83``, and ``SHELL61`` ), + ``ANGLE`` specifies the circumferential location (0.0 to 360°) used when reading from the + results file. The harmonic factor (based on the circumferential angle) is applied to the + displacements and element results, and to the applied constraints and loads which overwrites any + values existing in the database. If ``ANGLE`` = NONE, all harmonic factors are set to 1 and + postprocessing yields the solution output. + + When using ``ANGLE`` = NONE with ``MODE`` > 0, the combined stresses and strains are not valid. + + The default value of ``ANGLE`` is 0.0; however if the :ref:`set` command is not used, the + effective default is NONE. + + For full harmonic analyses with the amplitude option ( ``KIMG`` = 3 or AMPL), ``ANGLE`` is the + prescribed phase angle at which the amplitude is computed. + + nset : str + Data set number of the data set to be read. If a positive value for ``NSET`` is entered, + ``Lstep``, ``Sbstep``, ``KIMG``, and ``TIME`` are ignored. Available set numbers can be + determined by :ref:`set`,LIST. + + order : str + Key to sort the harmonic index results. This option applies to `cyclic symmetry `_ buckling and modal analyses only, and is valid only when ``Lstep`` = FIRST, LAST, NEXT, PREVIOUS, NEAR or LIST. + + * ``ORDER`` - Sort the harmonic index results in ascending order of eigenfrequencies or buckling + load multipliers. + + * ``(blank)`` - No sorting takes place. + + Notes + ----- + + .. _SET_notes: + + Defines the data set to be read from the results file into the database. Various operations may also + be performed during the read operation. The database must have the model geometry available (or use + the :ref:`resume` command before the :ref:`set` command to restore the geometry from + :file:`Jobname.DB` ). Values for applied constraints ( :ref:`d` ) and loads ( :ref:`f` ) in the + database will be replaced by their corresponding values on the results file, if available. (See the + description of the :ref:`outres` command.) In a single load step analysis, these values are usually + the same, except for results from harmonic elements. (See the description of the ``ANGLE`` value + above.) + + In an interactive run, the sorted list ( ``ORDER`` option) is also available for results-set reading + via a GUI pick option. + + You can postprocess results without issuing a :ref:`set` command if the solution results were saved + to the database file ( :file:`Jobname.db` ). A distributed-memory parallel simulation, however, can + only postprocess using the results file (for example, :file:`Jobname.rst` ) and cannot use the + :file:`Jobname.db` file since no solution results are written to the database. Therefore, you must + issue a :ref:`set` command or a :ref:`rescombine` command before postprocessing in a distributed- + memory parallel run. + + When postprocessing amplitudes or phases ( ``KIMG`` = AMPL or PHAS): + + * The only appropriate coordinate system is the solution coordinate system ( :ref:`rsys`,SOLU). For + layered elements, a layer ( :ref:`layer` ) must also be specified. When displaying the + displacement amplitudes, use a contour display ( :ref:`plnsol` command). Because a deformed shape + display ( :ref:`pldisp` command) could lead to a non-physical shape, the displacement scaling is + off by default ( :ref:`slashdscale`,,OFF). + + * The conversion is not valid for averaged results, derived results (such as principal + stress/strain, equivalent stress/strain, and USUM), or summed results obtained using :ref:`fsum`, + :ref:`nforce`, :ref:`prnld`, and :ref:`prrfor`. + + * Cyclic symmetry and multistage cyclic symmetry analysis results are not supported. + + * Coupled-field analysis results are supported when ``KIMG`` = AMPL, but they are not supported when + ``KIMG`` = PHAS. + + Issuing :ref:`expand` in a Cyclic Symmetry Modal Analysis + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + + After issuing :ref:`expand`, ``Nrepeat`` in a cyclic symmetry modal analysis, subsequent :ref:`set` + commands read data from the results file and expand them to ``Nrepeat`` sectors. + + Issuing :ref:`msopt`,EXPAND in a Multistage Cyclic Symmetry Analysis + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + + When issuing :ref:`msopt`,EXPAND in a multistage cyclic symmetry analysis, subsequent :ref:`set` + commands read the data set from the specified results file and expand the nodes and elements to the + stages and sectors specified via :ref:`msopt`,EXPAND. + """ + command = f"SET,{lstep},{sbstep},{fact},{kimg},{time},{angle},{nset},{order}" + return self.run(command, **kwargs) + + def subset( + self, + lstep: str = "", + sbstep: str = "", + fact: str = "", + kimg: int | str = "", + time: str = "", + angle: str = "", + nset: str = "", + **kwargs, + ): + r"""Reads results for the selected portions of the model. + + Mechanical APDL Command: `SUBSET `_ + + Parameters + ---------- + lstep : str + Load step number of the data set to be read (defaults to 1): + + * ``N`` - Read load step ``N``. + + * ``FIRST`` - Read the first data set ( ``SBSTEP`` and ``TIME`` are ignored). + + * ``LAST`` - Read the last data set ( ``SBSTEP`` and ``TIME`` are ignored). + + * ``NEXT`` - Read the next data set ( ``SBSTEP`` and ``TIME`` are ignored). If at the last data set, + the first data set will be read as the next. + + * ``NEAR`` - Read the data set nearest to ``TIME`` ( ``SBSTEP`` is ignored). If ``TIME`` is blank, + read the first data set. + + * ``LIST`` - Scan the results file and list a summary of each load step. ( ``FACT``, ``KIMG``, + ``TIME`` and ``ANGLE`` are ignored.) + + sbstep : str + Substep number (within ``Lstep`` ). For the buckling ( :ref:`antype`,BUCKLE) analysis or the + modal ( :ref:`antype`,MODAL) analysis, the substep corresponds to the mode number. Defaults to + last substep of load step (except for :ref:`antype`,BUCKLE or MODAL). If ``Lstep`` = LIST, + ``SBSTEP`` = 0 or 1 lists the basic step information, whereas ``SBSTEP`` = 2 also lists the load + step title, and labels imaginary data sets if they exist. + + fact : str + Scale factor applied to data read from the file. If zero (or blank), a value of 1.0 is used. + Harmonic velocities or accelerations may be calculated from the displacement results from a + modal ( :ref:`antype`,MODAL) or harmonic ( :ref:`antype`,HARMIC) analyses. If ``FACT`` = VELO, + the harmonic velocities (v) are calculated from the displacements (d) at a particular frequency + (f) according to the relationship v = 2 πfd. Similarly, if ``FACT`` = ACEL, the harmonic + accelerations (a) are calculated as a = (2 πf) :sup:`2` d. + + kimg : int or str + Used only with results from complex analyses: + + * ``0`` - Store real part of complex solution + + * ``1`` - Store imaginary part. + + time : str + Time-point identifying the data set to be read. For harmonic analyses, time corresponds to the + frequency. For the buckling analysis, time corresponds to the load factor. Used only in the + following cases: If ``Lstep`` is NEAR, read the data set nearest to ``TIME``. If both ``Lstep`` + and ``SBSTEP`` are zero (or blank), read data set at time = ``TIME``. If ``TIME`` is between two + solution time points on the results file, a linear interpolation is done between the two data + sets. Solution items not written to the results file ( :ref:`outres` ) for either data set will + result in a null item after data set interpolation. If ``TIME`` is beyond the last time point on + the file, use the last time point. + + angle : str + Circumferential location (0.0 to 360°). Defines the circumferential location for the harmonic + calculations used when reading from the results file. The harmonic factor (based on the + circumferential angle) is applied to the harmonic elements ( ``PLANE25``, ``PLANE75``, + ``PLANE78``, ``PLANE83``, and ``SHELL61`` ) of the load case. See the `Mechanical APDL Theory + Reference `_ + for details. Note that factored values of applied constraints and loads will overwrite any + values existing in the database. + + nset : str + Data set number of the data set to be read. If a positive value for ``NSET`` is entered, + ``Lstep``, ``SBSTEP``, ``KIMG``, and ``TIME`` are ignored. Available set numbers can be + determined by :ref:`set`,LIST. + + Notes + ----- + + .. _SUBSET_notes: + + Reads a data set from the results file into the database for the selected portions of the model + only. Data that has not been specified for retrieval from the results file by the :ref:`inres` + command will be listed as having a zero value. Each time that the :ref:`subset` command is issued, + the data currently in the database will be overwritten with a new set of data. Various operations + may also be performed during the read operation. The database must have the model geometry available + (or used the :ref:`resume` command before the :ref:`subset` command to restore the geometry from + :file:`File.DB` ). + """ + command = f"SUBSET,{lstep},{sbstep},{fact},{kimg},{time},{angle},{nset}" + return self.run(command, **kwargs) diff --git a/src/ansys/mapdl/core/_commands/post1/special_purpose.py b/src/ansys/mapdl/core/_commands/post1/special_purpose.py new file mode 100644 index 00000000000..8899094dbd9 --- /dev/null +++ b/src/ansys/mapdl/core/_commands/post1/special_purpose.py @@ -0,0 +1,4248 @@ +# Copyright (C) 2016 - 2025 ANSYS, Inc. and/or its affiliates. +# SPDX-License-Identifier: MIT +# +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to deal +# in the Software without restriction, including without limitation the rights +# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +# copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in all +# copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +# SOFTWARE. + + +class SpecialPurpose: + + def bfint( + self, + fname1: str = "", + ext1: str = "", + fname2: str = "", + ext2: str = "", + kpos: int | str = "", + clab: str = "", + kshs: int | str = "", + tolout: str = "", + tolhgt: str = "", + **kwargs, + ): + r"""Activates the body force interpolation operation. + + Mechanical APDL Command: `BFINT `_ + + Parameters + ---------- + fname1 : str + File name and directory path (248 characters maximum, including directory) from which to read + data for interpolation. If you do not specify a directory path, it will default to your working + directory and you can use all 248 characters for the file name. + + The file name defaults to :file:`Jobname`. + + ext1 : str + Filename extension (eight-character maximum). The extension defaults to NODE if ``Fname1`` is + blank. + + fname2 : str + File name and directory path (248 characters maximum, including directory) to which **BF** commands are written. If you do not specify a directory path, it will default to your working + directory and you can use all 248 characters for the file name. + + The file name defaults to :file:`Jobname`. + + ext2 : str + Filename extension (eight-character maximum). The extension defaults to BFIN if ``Fname2`` is + blank. + + kpos : int or str + Position on ``Fname2`` to write block of **BF** commands: + + * ``0`` - Beginning of file (overwrite existing file). + + * ``1`` - End of file (append to existing file). + + clab : str + Label (8 characters maximum, including the colon) for this block of **BF** commands in ``Fname2``. This label is appended to the colon (:). Defaults to BF ``n``, where ``n`` is the cumulative iteration number for the data set currently in the database. + + kshs : int or str + Shell-to-solid submodeling key: + + * ``0`` - Solid-to-solid or shell-to-shell submodel. + + * ``1`` - Shell-to-solid submodel. + + tolout : str + Extrapolation tolerance about elements, based on a fraction of the element dimension. Submodel + nodes outside the element by more than ``TOLOUT`` are not accepted as candidates for DOF + extrapolation. Defaults to 0.5 (50%). + + tolhgt : str + Height tolerance above or below shell elements, in units of length. Used only for shell-to-shell + submodeling ( ``KSHS`` = 0). Submodel nodes off the element surface by more than ``TOLHGT`` are not + accepted as candidates for DOF interpolation or extrapolation. Defaults to 0.0001 times the maximum + element dimension. + + .. warning:: + + Relaxing this tolerance to allow submodel nodes to be found may cause poor submodel results. + + Notes + ----- + + .. _BFINT_notes: + + File ``Fname1`` should contain a node list for which body forces are to be interpolated ( + :ref:`nwrite` ). File ``Fname2`` is created, and contains interpolated body forces written as a + block of nodal :ref:`bf` commands. + + Body forces are interpolated from elements having TEMP as a valid body force or degree of freedom, + and only the label TEMP is written on the nodal :ref:`bf` commands. Interpolation is performed for + all nodes on file ``Fname1`` using the results data currently in the database. For layered elements, + use the :ref:`layer` command to select the locations of the temperatures to be used for + interpolation. Default locations are the bottom of the bottom layer and the top of the top layer. + + The block of :ref:`bf` commands begins with an identifying colon label command and ends with a + ``/EOF`` command. The colon label command has the form : ``Clab``. Interpolation from multiple + results sets can be performed by looping through the results file in a user-defined macro. + Additional blocks can be appended to ``Fname2`` by using ``KPOS`` and unique colon labels. Issue + :ref:`input`, with the appropriate colon label, to read the block of commands. + + If the model has coincident (or very close) nodes, :ref:`bfint` must be applied to each part of the + model separately to ensure that the mapping of the nodes is correct. For example, if nodes belonging + to two adjacent parts linked by springs are coincident, the operation should be performed on each + part of the model separately. + """ + command = f"BFINT,{fname1},{ext1},,{fname2},{ext2},,{kpos},{clab},{kshs},{tolout},{tolhgt}" + return self.run(command, **kwargs) + + def cbdof( + self, + fname1: str = "", + ext1: str = "", + fname2: str = "", + ext2: str = "", + kpos: int | str = "", + clab: str = "", + kshs: int | str = "", + tolout: str = "", + tolhgt: str = "", + tolthk: str = "", + **kwargs, + ): + r"""Activates cut-boundary interpolation (for submodeling). + + Mechanical APDL Command: `CBDOF `_ + + Parameters + ---------- + fname1 : str + File name and directory path (248 characters maximum, including directory) from which to read + boundary node data. If no specified directory path exists, the path defaults to your working + directory and you can use all 248 characters for the file name. + + The file name defaults to :file:`Jobname`. + + ext1 : str + Filename extension (eight-character maximum). The extension defaults to NODE if ``Fname1`` is + blank. + + fname2 : str + File name and directory path (248 characters maximum, including directory) to which cut-boundary **D** commands are written. If no specified directory path exists, the path defaults to your working + directory and you can use all 248 characters for the file name. + + The file name defaults to :file:`Jobname`. + + ext2 : str + Filename extension (eight-character maximum). The extension defaults to CBDO if ``Fname2`` is + blank. + + kpos : int or str + Position on ``Fname2`` to write block of :ref:`d` commands: + + * ``0`` - Beginning of file (overwrite existing file). + + * ``1`` - End of file (append to existing file). + + clab : str + Label (eight characters maximum, including the colon) for this block of :ref:`d` commands on + ``Fname2``. his label is appended to the colon (:). Defaults to CB ``n``, where ``n`` is the + cumulative iteration number for the data set currently in the database. For imaginary data (see + KIMG on the :ref:`starset` command), ``Clab`` defaults to CI ``n``. + + kshs : int or str + Shell-to-solid submodeling key: + + * ``0`` - Solid-to-solid or shell-to-shell submodel. + + * ``1`` - Shell-to-solid submodel. + + tolout : str + Extrapolation tolerance about elements, based on a fraction of the element dimension. Submodel + nodes outside the element by more than ``TOLOUT`` are not accepted as candidates for DOF + extrapolation. Defaults to 0.5 (50 percent). + + tolhgt : str + Height tolerance above or below shell elements, in units of length. Used only for shell-to-shell + submodeling ( ``KSHS`` = 0). Submodel nodes off the element surface by more than ``TOLHGT`` are + not accepted as candidates for degree-of-freedom interpolation or extrapolation. Defaults to + 0.0001 times the maximum element dimension. + + tolthk : str + Height tolerance above or below shell elements, based on a fraction of the shell element + thickness. Used only for shell-to-solid submodeling (KSHS = 1). Submodel nodes off the element + surface by more than ``TOLTHK`` are not accepted as candidates for DOF interpolation or + extrapolation. Defaults to 0.1 times the average shell thickness. + + Notes + ----- + + .. _CBDOF_notes: + + File ``Fname1`` should contain a node list for which boundary conditions are to be interpolated ( + :ref:`nwrite` ). File ``Fname2`` is created to contain interpolated boundary conditions written as a + block of :ref:`d` commands. + + Boundary conditions are written for the active degree-of-freedom set for the element from which + interpolation is performed. Interpolation occurs on the selected set of elements. The block of + :ref:`d` commands begins with an identifying colon label and ends with a ``/EOF`` command. The colon + label is of the form : ``Clab`` (described above). + + Interpolation from multiple results sets can be performed by looping through the results file in a + user-defined macro. Additional blocks can be appended to ``Fname2`` by using ``KPOS`` and unique + colon labels. To read the block of commands, issue the :ref:`input` command with the appropriate + colon label. + + If the model has coincident (or very close) nodes, the :ref:`cbdof` must be applied to each part of + the model separately to ensure that the mapping of the nodes is correct. For example, if nodes + belonging to two adjacent parts linked by springs are coincident, the operation should be performed + on each part of the model separately. + + Resume the coarse model database at the beginning of the cut-boundary procedure. The database should + have been saved after the first coarse model solution, as the number of nodes in the database and + the results file must match, and internal nodes are sometimes created during the solution. + + This command cannot be used to interpolate the magnetic edge-flux (AZ) degree of freedom. + + .. warning:: + + Relaxing the TOLHGTor TOLTHKtolerances to allow submodel nodes to be “found” can produce poor + submodel results. + """ + command = f"CBDOF,{fname1},{ext1},,{fname2},{ext2},,{kpos},{clab},{kshs},{tolout},{tolhgt},{tolthk}" + return self.run(command, **kwargs) + + def cmsfile( + self, + option: str = "", + fname: str = "", + ext: str = "", + cmskey: str = "", + **kwargs, + ): + r"""Specifies a list of component mode synthesis (CMS) results files for plotting results on the + assembly. + + Mechanical APDL Command: `CMSFILE `_ + + **Command default:** + + .. _CMSFILE_default: + + If issued with no arguments, the :ref:`cmsfile` command uses these defaults: + + :ref:`cmsfile`,ADD, ``Jobname``,rst,ON + + The command adds the component results file :file:`Jobnamerst`. + + Parameters + ---------- + option : str + Specifies the command operation: + + * ``ADD`` - Add the specified component results file ( ``Fname`` ) to the list of files to plot. + This option is the default. + + * ``DELETE`` - Remove the specified component results file ( ``Fname`` ) from the list of files to + plot. + + * ``LIST`` - List all specified component results files. + + * ``CLEAR`` - Clear all previous files added. + + * ``ALL`` - Add all component results ( :file:`.rst` ) files from the working directory to the list + of files to plot. + + fname : str + The file name (with full directory path) of the component results file. The default file name is + the :file:`Jobname` (specified via the :ref:`filname` command). + + ext : str + The file name ( ``Fname`` ) extension. The default extension is :file:`rst`. + + cmskey : str + Valid only when adding a results file ( ``Option`` = ADD or ALL), this key specifies whether or not to check the specified :file:`.rst` file to determine if it was created via a CMS expansion pass: + + * ``ON`` - Check (default). + + * ``OFF`` - Do not check. + + Notes + ----- + + .. _CMSFILE_notes: + + The :ref:`cmsfile` command specifies the list of component mode synthesis (CMS) results files to + include when plotting the mode shape of an assembly. + + During postprocessing ( :ref:`post1` ) of a CMS analysis, issue the :ref:`cmsfile` command to point + to component results files of interest. (You can issue the command as often as needed to include all + or some of the component results files.) Issue the :ref:`set` command to acquire the frequencies and + mode shapes from substeps for all specified results files. Execute a plot ( :ref:`plnsol` ) or print + ( :ref:`prnsol` ) operation to display the mode shape of the entire assembly. + + When you specify a results file to add to the plot list, the default behavior of the command ( + ``CmsKey`` = ON) is to first verify that the file is from a CMS analysis and that the frequencies of + the result sets on the file match the frequencies on the first file in the list. If ``CmsKey`` = + OFF, you can add any :file:`.rst` file to the list of files to plot, even if the file was not + expanded via a CMS expansion pass. + + If ``CmsKey`` = ON (default), output from the command appears as: ``ADD CMS FILE =`` filename.rst + ``CmsKey`` = OFF, output from the command appears as: ``ADD FILE =`` filename.rst + + If ``Option`` = DELETE or CLEAR, you must clear the database ( ``/CLEAR`` ), then re-enter the + postprocessor ( :ref:`post1` ) and issue a :ref:`set` command for the change to take effect on + subsequent plots. + + Clearing the database does not clear the list of files specified via the :ref:`cmsfile` command. + Specify ``Option`` = CLEAR to clear the list of files. + """ + command = f"CMSFILE,{option},{fname},{ext},{cmskey}" + return self.run(command, **kwargs) + + def cyccalc( + self, fileprefix: str = "", fileformat: str = "", separator: str = "", **kwargs + ): + r"""Calculates results from a cyclic harmonic mode-superposition analysis using the specifications + defined by :ref:`cycspec`. + + Mechanical APDL Command: `CYCCALC `_ + + **Command default:** + + .. _CYCCALC_default: + + Write the result tables to the output file. + + Parameters + ---------- + fileprefix : str + Each result table (corresponding to each :ref:`cycspec` specification) is written to a file + beginning with ``FilePrefix``. If blank (default), the result tables are written to the output + file. + + fileformat : str + If ``FilePrefix`` is specified, then use ``FileFormat`` to specify the format of the file to be + written: + + * ``FORM`` - Formatted file (default) + + * ``CSV`` - Comma-separated value file + + separator : str + If ``FileFormat`` is CSV, use ``Separator`` to specify the field separator: + + * ``COMMA`` - Use a comma () as the field separator (default) + + * ``COLON`` - Use a colon (:) as the field separator + + * ``DOT`` - Use a period (.) as the field separator + + Notes + ----- + + .. _CYCCALC_notes: + + :ref:`cyccalc` loops through the specification given by :ref:`cycspec` and computes the requested + outputs. The outputs are given in a table format, with the rows corresponding to each frequency + solution from the harmonic analysis, and the columns corresponding to each sector. The table entries + are the maximum value of the specified quantity at the specified location in the sector. In + addition, columns containing the maximum value at the frequency, the sector in which it occurs, and + the node in the sector at which it occurs are output. + + If ``FilePrefix`` is specified, a file is created for each output table with the name + :file:`FilePrefix_node_type.ext`, where ``node`` is the node number or component name, ``type`` is + the item/component requested, and the file extension ``.ext`` is either :file:`.txt` or + :file:`.csv`, depending on ``FileFormat``. + + A :ref:`set` command must precede the :ref:`cyccalc` command. + + The :ref:`cyccalc` results are based on the currently active :ref:`rsys`, :ref:`shell`, + :ref:`layer`, and :ref:`avprin` settings. + + The :ref:`cyccalc` command only supports matched nodes. For more details on matching cyclic edge + node pairs see `Edge Component Pairs + `_ + """ + command = f"CYCCALC,{fileprefix},{fileformat},{separator}" + return self.run(command, **kwargs) + + def cycfiles( + self, + fnamerst: str = "", + extrst: str = "", + fnamerfrq: str = "", + extrfrq: str = "", + **kwargs, + ): + r"""Specifies the data files where results are to be found for a cyclic symmetry mode-superposition + harmonic analysis. + + Mechanical APDL Command: `CYCFILES `_ + + **Command default:** + + .. _CYCFILES_default: + + No defaults are available for the :ref:`cycfiles` command. You must issue this command to properly + postprocess the results of a cyclic symmetry mode-superposition harmonic analysis. If issued with no + arguments, the postprocessing will be done using :file:`Jobname.rst` and :file:`Jobname.rfrq` from + the current working directory. + + Parameters + ---------- + fnamerst : str + The file name and directory path of the results file from the cyclic modal solution. Defaults to + :file:`Jobname`. + + extrst : str + File name extension for ``FnameRst``. Defaults to :file:`rst`. + + fnamerfrq : str + The file name and directory path of the results file from the cyclic mode-superposition harmonic + solution. Defaults to the value of the ``FnameRst`` argument. + + extrfrq : str + File name extension for ``FnameRfrq``. Defaults to :file:`rfrq`. + """ + command = f"CYCFILES,{fnamerst},{extrst},{fnamerfrq},{extrfrq}" + return self.run(command, **kwargs) + + def cycphase(self, type_: str = "", option: str = "", **kwargs): + r"""Provides tools for determining minimum and maximum possible result values from frequency couplets + produced in a modal cyclic symmetry analysis. + + Mechanical APDL Command: `CYCPHASE `_ + + **Command default:** + + .. _CYCPHASE_default: + + No defaults are available for the :ref:`cycphase` command. You must specify an argument ( ``TYPE`` ) + when issuing the command. Other values which may be necessary ( ``OPTION`` ) depend upon which + ``TYPE`` argument you specify. + + Parameters + ---------- + type_ : str + The type of operation requested: + + * ``DISP`` - Calculate the maximum and minimum possible displacement at each node in the original + sector model. Store the values and the phase angle at which they occurred. + + * ``STRESS`` - Calculate the maximum and minimum possible stresses at each node in the original + sector model. Store the values and the phase angle at which they occurred. + + * ``STRAIN`` - Calculate the maximum and minimum possible strains at each node in the original + sector model. Store the values and the phase angle at which they occurred. + + * ``ALL`` - Calculate the maximum and minimum possible displacement, stress and strain at each node + in the original sector model. Store the values and the phase angle at which they occurred. + + * ``GET`` - Places the value of a MAX or MIN item into the _CYCVALUE parameter, the node for that + value in the _CYCNODE parameter, and the phase angle for the value in the _CYCPHASE parameter. + + * ``PUT`` - Put resulting sweep values for printing (via the :ref:`prnsol` command ) or plotting + (via the :ref:`plnsol` command). + + * ``LIST`` - List the current minimum/maximum displacement, stress and strain nodal values. + + * ``STAT`` - Summarize the results of the last phase sweep. + + * ``CLEAR`` - Clear phase-sweep information from the database. + + option : str + If TYPE = DISP, STRAIN, STRESS or ALL, controls the sweep angle increment to use in the search: + + * ``Angle`` - The sweep angle increment in degrees, greater than 0.1 and less than 10. The default + is 1. + + If TYPE = PUT, controls which values are placed onto the model: + + * ``MAX`` - Put all existing nodal maximum values onto the model. This option is the default. + + * ``MIN`` - Put all existing nodal minimum values onto the model. + + If TYPE = GET, controls the values placed into cyclic parameters: + + * ``Item`` - Specifies the type of values on which to operate: + + * U -- Displacement + * S -- Stress + * EPEL -- Strain + * ``Comp`` - Specifies the specific component of displacement, stress or strain for which to get information: + + * X,Y,Z -- Basic components + * XY,YZ,XZ -- Shear components + * 1,2,3 -- Principal values + * EQV -- Equivalent value + * SUM -- USUM + * ``MxMn`` - Specifies whether the requested value information is for the maximum or minimum value: + + * MAX -- Maximum value. + * MIN -- Minimum value. + + Notes + ----- + + .. _CYCPHASE_notes: + + When you `expand the results of a modal cyclic symmetry analysis + `_ + (via the :ref:`cycexpand` or :ref:`expand` command), the program combines the real and imaginary + results for a given nodal diameter, assuming no phase shift between them; however, the modal + response can occur at any phase shift. + + :ref:`cycphase` response results are valid only for the first cyclic sector. To obtain the response + at any part of the expanded model, Ansys, Inc. recommends using `cyclic symmetry results + expansion + `_ + at the phase angle obtained via :ref:`cycphase`. + + The phase angles returned by :ref:`cycphase` contain the minimum and maximum values for USUM, SEQV + and other scalar principal stress and strain quantities; however, they do not always return the true + minimum and maximum values for directional quantities like UX or SX unless the values fall in the + first sector. + + :ref:`cycphase` does not consider midside node values when evaluating maximum and minimum values, + which may affect display quantities but no others. (Typically, the program ignores midside node + stresses and strains during postprocessing.) + + Issuing :ref:`cycphase`,PUT clears the result values for midside nodes on high order elements; + therefore, this option sets element faceting ( :ref:`efacet` ) to 1. The command reports that + midside nodal values are set to zero and indicates that element faceting is set to 1. + + If the sweep values are available after issuing a :ref:`cycphase`,PUT command, the :ref:`prnsol` or + :ref:`plnsol` command will print or plot (respectively) the sweep values of structure displacement + Ux, Uy, Uz, component stress/strain X, Y, Z, XY, YZ, ZX, principal stress/strain 1, 2, 3 and + equivalent stress/strain EQV. The vector sum of displacement (USUM) and stress/strain intensity + (SINT) are not valid phase-sweep results. + + You can specify any coordinate system via the :ref:`rsys` command for displaying or printing + :ref:`cycphase` results. However, after :ref:`cycphase` results have been extracted, you cannot then + transform them via the :ref:`rsys` command. If you try to do so, the program issues a warning + message. + + The :ref:`cycphase` command is valid in :ref:`post1` and for cyclically symmetric models only. + + To learn more about analyzing a cyclically symmetric structure, see the `Cyclic Symmetry Analysis + Guide `_. + """ + command = f"CYCPHASE,{type_},{option}" + return self.run(command, **kwargs) + + def cycspec( + self, label: str = "", node: str = "", item: str = "", comp: str = "", **kwargs + ): + r"""Defines the set of result items for a subsequent :ref:`cyccalc` command in postprocessing a cyclic + harmonic mode-superposition analysis. + + Mechanical APDL Command: `CYCSPEC `_ + + **Command default:** + + .. _CYCSPEC_default: + + No defaults are available for the :ref:`cycspec` command. You must issue this command to define the + set of result items for evaluation in a subsequent :ref:`cyccalc` command used in computing results + of a cyclic harmonic mode-superposition analysis. + + Parameters + ---------- + label : str + One of the following labels: + + * ``ADD`` - Adds a new specification to the set (default). The maximum number of specifications that + can be defined is 50. + + * ``LIST`` - Lists the current set of specifications. ``Node``, ``Item``, ``Comp`` are ignored. + + * ``ERASE`` - Erases the current set of specifications. ``Node``, ``Item``, ``Comp`` are ignored. + + * ``DELETE`` - Deletes an existing specification. ``Item``, ``Comp`` are ignored. + + node : str + The node at which to evaluate the results. If ``Node`` is a nodal component, then all nodes in + the component are included. All sectors containing this node (or set of nodes) are evaluated. + + For ``LABEL`` = DELETE, use ``Node`` to indicate which specification in the set to delete. + + item : str + Specifies the type of values to evaluate: + + * ``U`` - Displacement + + * ``S`` - Stress + + * ``EPEL`` - Elastic strain + + comp : str + Specifies the specific component of displacement, stress, or strain to evaluate: + + * ``X,Y,Z`` - Direct components + + * ``XY,YZ,XZ`` - Shear components (stress and strain only) + + * ``1,2,3`` - Principal values (stress and strain only) + + * ``EQV`` - Equivalent value (stress and strain only) + + * ``SUM`` - Vector sum (displacement only) + + * ``NORM`` - L2 norm for the set of nodes (displacement only) + + Notes + ----- + + .. _CYCSPEC_notes: + + Up to 50 specifications can be defined for use in a subsequent :ref:`cyccalc` command. If more than + 50 specifications are desired, erase the table after the :ref:`cyccalc` operation and add new + specifications and repeat the :ref:`cyccalc` command. All the specified nodes, items, and components + are evaluated for all sectors and the maximum amplitude value output. For combined stresses and + strains ( ``Comp`` = 1,2,3 or EQV) or displacement vector sum ( ``Comp`` = SUM), a 360 degree phase + sweep is performed at each location to determine the maximum. + + Additional POST1 controls are used to refine the specification. For component values, components are + in the :ref:`rsys` direction. For shell elements, the results are at the :ref:`shell` location. For + EPEL,EQV, the results are based on the ``EFFNU`` value on the :ref:`avprin` command. The controls + active when the :ref:`cyccalc` command is issued determine the result values. If results at another + :ref:`shell` location are desired, issue the new :ref:`shell` command and then re-issue the + :ref:`cyccalc` command. + + If a single node is input, the ``Item`` / ``Comp`` value at that location in each sector is output. + If a node component is given, then the maximum ``Item`` / ``Comp`` value within the set of nodes of + each sector is output, one value for each sector (the node of the maximum may vary from sector to + sector). For stress and strain items, only corner nodes are valid. + + For the displacement norm option ( ``Item`` = U, ``Comp`` = NORM), the L2 norm computed from all the + nodes in the component is output, one per sector. + """ + command = f"CYCSPEC,{label},{node},{item},{comp}" + return self.run(command, **kwargs) + + def exoption(self, ldtype: str = "", option: str = "", value: str = "", **kwargs): + r"""Specifies the :ref:`exprofile` options for the Mechanical APDL to Ansys CFX profile file transfer. + + Mechanical APDL Command: `EXOPTION `_ + + Parameters + ---------- + ldtype : str + Load type: + + * ``SURF`` - Surface load + + * ``VOLU`` - Volume load + + option : str + Surface options: + + * ``Precision`` - Number of significant digits for the fractional part of real data + + * ``Connectivity`` - Key to include face connectivity in the exported profile file + + Volume options: + + * ``Precision`` - Number of significant digits after the decimal for real data + + value : str + Specify the value for either Precision or Connectivity. + + For Precision, specify the number of significant digits. Can be any value between 1 to 20, default + 8. When 0 or an invalid value is specified, the program will use the default value of 8 and issue a + warning message. + + For Connectivity, specify the key to include the element face connectivity data for surface loads + (does not support volume loads): + + * ``OFF`` - Do not include the connectivity data in the exported file (default) + + * ``ON`` - Include the connectivity data in the exported file + """ + command = f"EXOPTION,{ldtype},{option},{value}" + return self.run(command, **kwargs) + + def expand( + self, + nrepeat: str = "", + modal: str = "", + hindex: str = "", + icsys: str = "", + sctang: str = "", + phase: str = "", + **kwargs, + ): + r"""Displays the results of a modal cyclic symmetry analysis. + + Mechanical APDL Command: `EXPAND `_ + + Parameters + ---------- + nrepeat : str + Number of sector repetitions for expansion. The default is 0 (no expansion). + + modal : str + Specifies that the expansion is for a modal cyclic symmetry analysis. + + hindex : str + The harmonic index ID for the results to expand. + + icsys : str + The coordinate system number used in the modal cyclic symmetry solution. The default is the + global cylindrical coordinate system (specified via the :ref:`csys` command where ``KCN`` = 1). + + sctang : str + The sector angle in degrees, equal to 360 divided by the number of cyclic sectors. + + phase : str + The phase angle in degrees to use for the expansion. The default is 0. Typically, the value is + the peak displacement (or stress/strain) phase angle obtained via the :ref:`cycphase` command. + + Notes + ----- + + .. _EXPAND_notes: + + Issue this command to display the results of a modal cyclic symmetry analysis. + + When you issue the :ref:`expand`, ``Nrepeat`` command, subsequent :ref:`set` commands read data from + the results file and expand them to ``Nrepeat`` sectors. As long as no entities have been modified, + this expansion can be negated (that is, reverted to single sector) by issuing :ref:`expand` with no + arguments. If you modify entities and wish to return to the partial model, use the Session Editor + (see Restoring Database Contents in the `Operations Guide + `_). + + :ref:`expand` displays the results and allows you to print them, as if for a full model. The + harmonic index (automatically retrieved from the results file) appears in the legend column. + + When plotting or printing element strain energy (SENE), the :ref:`expand` command works with brick + or tet models only. Element kinetic energy (KENE) plotting or printing is not supported. + + :ref:`expand` is a specification command valid only in POST1. It is significantly different from the + :ref:`cycexpand` command in several respects, (although you can use either command to display the + results of a modal cyclic symmetry analysis): + + * :ref:`expand` has none of the limitations of the :ref:`cycexpand` command. + + * :ref:`expand` changes the database by modifying the geometry, the nodal displacements, and element + stresses as they are read from the results file, whereas the :ref:`cycexpand` command does not + change the database. + + .. warning:: + + The EXPAND command creates new nodes and elements; therefore, saving (or issuing the /EXIT, ALL + command) after issuing the EXPAND command can result in large databases. + """ + command = f"EXPAND,{nrepeat},{modal},{hindex},{icsys},{sctang},,{phase}" + return self.run(command, **kwargs) + + def exprofile( + self, + ldtype: str = "", + load: str = "", + value: str = "", + pname: str = "", + fname: str = "", + fext: str = "", + fdir: str = "", + **kwargs, + ): + r"""Exports Mechanical APDL interface data on selected nodes to an Ansys CFX Profile file. + + Mechanical APDL Command: `EXPROFILE `_ + + Parameters + ---------- + ldtype : str + Load type: + + * ``SURF`` - Surface load. + + * ``VOLU`` - Volumetric load. + + load : str + Surface loads: + + * ``DISP`` - Displacement (in a static analysis) or mode shape and global parameters (in a modal + analysis). + + * ``MODE`` - Normalized mode shape and global parameters (in a modal analysis only). + + * ``TEMP`` - Temperature. + + * ``HFLU`` - Heat flux. + + Volumetric loads: + + * ``DISP`` - Displacement. + + * ``FORC`` - Force. + + * ``HGEN`` - Heat generation. + + value : str + If a positive integer, specifies the number of the surface or volume interface. If zero + (default), the selected nodes or Named Selection are used. + + pname : str + Field name in CFX Profile file (32-character maximum). Defaults to :file:`jobname_bcploadnumber` + for a surface load and :file:`jobname_subdloadnumber` for volumetric load. + + fname : str + The CFX Profile filename (248-character maximum). Defaults to :file:`jobname_bcploadnumber` for + a surface load and :file:`jobname_subdloadnumber` for a volumetric load. + + fext : str + The Profile file extension (8-character maximum). Defaults to :file:`csv`. + + fdir : str + The Profile file directory (248-character maximum). Defaults to current directory. + + Notes + ----- + By default, the :ref:`exprofile` command assumes the data it writes to the Profile file are in SI + units. For models not described in SI units, issue the :ref:`exunit` command as needed to write the + correct unit labels on the Profile file. + + For a modal analysis, if ``Load`` = DISP or MODE, global parameters including mass, frequency, and + maximum displacement are also written to the Ansys CFX Profile file. You should therefore issue the + :ref:`exunit` command for DISP, TIME, and MASS. + + Verify that the coordinate system is set to the global Cartesian ( :ref:`rsys`,0) before using this + command. + + To transfer multiple loads across an interface, specify a unique file name and extension for each + load. + + Force (FORC) and heat generation (HGEN) are per-unit volume. + + For modal analysis, this command will write global parameters including mass, frequency, and maximum + displacement to the profile file. If using cyclic symmetry analysis, this command will also write + harmonic indices to the profile file. + + For modal analysis, this command does not support the following mode-extraction methods ( + :ref:`modopt` ): unsymmetric matrix (UNSYM), the damped system (DAMP), or the QR-damped system + (QRDAMP). + + To write the normalized (instead of non-normalized) mode shapes from a modal analysis to the file: + + * Use ``Load`` = MODE. + + * Verify that the mode shapes are normalized to the mass matrix ( :ref:`modopt`,,,,,,OFF), the + default behavior. + + * Verify that the scale factor is set to 1.0 ( :ref:`set`,,,1.0), the default value. + + The nodes and underlying elements must be selected in order to be exported. See for details. + + For loads not specified directly via commands (such as :ref:`sf` and :ref:`bf` ), loads must first + be read into the database ( :ref:`set` or :ref:`lcase` ). + """ + command = f"EXPROFILE,{ldtype},{load},{value},{pname},{fname},{fext},{fdir}" + return self.run(command, **kwargs) + + def exunit( + self, + ldtype: str = "", + load: str = "", + untype: str = "", + name: str = "", + **kwargs, + ): + r"""Specifies the interface data unit labels to be written to the profile file from Mechanical APDL to + Ansys CFX transfer. + + Mechanical APDL Command: `EXUNIT `_ + + Parameters + ---------- + ldtype : str + Load type: + + * ``SURF`` - Surface load. + + * ``VOLU`` - Volumetric load. + + load : str + Surface loads: + + * ``DISP`` - Displacement in a static analysis. Mode shape in a modal analysis. + + * ``TIME`` - Time. The unit for frequency is the inverse of the unit for time. + + * ``MASS`` - Mass. + + * ``TEMP`` - Temperature. + + * ``HFLU`` - Heat flux. + + Volumetric loads: + + * ``DISP`` - Displacement. + + * ``FORC`` - Force + + * ``HGEN`` - Heat generation + + untype : str + Unit type: + + * ``COMM`` - Predefined unit + + * ``USER`` - User-specified unit + + name : str + Commonly used predefined unit name or user-specified unit name. + + * ``SI`` - International System of units (meter-kilogram-second) (default) + + * ``FT`` - English System of units (feet-pound-second) + + In the SI system, surface loads are in units of m for DISP, degrees K for TEMP, and W/m :sup:`2` for + HFLU; volumetric loads are in units of m for DISP, N/m :sup:`3` for FORC, and W/m :sup:`3` for HGEN. + + In the English system, surface loads are in units of ft for DISP, degrees F for TEMP, and BTU/sec-ft + :sup:`2` for HFLU; volumetric loads are in units of ft for DISP, pdl/ft :sup:`3` for FORC, and + BTU/sec-ft :sup:`3` for HGEN. A pdl is a poundal, and 32.174 pdl = 1 lbf. + + Notes + ----- + This command only specifies which unit labels are to be written to the file when the + :ref:`exprofile` is issued. It does not perform unit conversions. + """ + command = f"EXUNIT,{ldtype},{load},{untype},{name}" + return self.run(command, **kwargs) + + def fssparm(self, port1: str = "", port2: str = "", **kwargs): + r"""Calculates reflection and transmission properties of a frequency selective surface. + + Mechanical APDL Command: `FSSPARM `_ + + Parameters + ---------- + port1 : str + Port number of input port. Defaults to 1. + + port2 : str + Port number of output port. Defaults to 1. + + Notes + ----- + :ref:`fssparm` calculates reflection and transmission coefficients, power reflection and + transmission coefficients, and return and insertion losses of a frequency selective surface. + """ + command = f"FSSPARM,{port1},{port2}" + return self.run(command, **kwargs) + + def fsum(self, lab: str = "", item: str = "", **kwargs): + r"""Sums the nodal force and moment contributions of elements. + + Mechanical APDL Command: `FSUM `_ + + Parameters + ---------- + lab : str + Coordinate system in which to perform summation. + + * ``(blank)`` - Sum all nodal forces in global Cartesian coordinate system (default). + + * ``RSYS`` - Sum all nodal forces in the currently active RSYS coordinate system. + + item : str + Selected set of nodes. + + * ``(blank)`` - Sum all nodal forces for all selected nodes (default), excluding contact elements. + + * ``CONT`` - Sum all nodal forces for contact nodes only. + + * ``BOTH`` - Sum all nodal forces for all selected nodes, including contact elements. + + Notes + ----- + + .. _FSUM_notes: + + Sums and prints, in each component direction for the total selected node set, the nodal force and + moment contributions of the selected elements attached to the node set. Selecting a subset of nodes + ( :ref:`nsel` ) and then issuing this command will give the total force acting on that set of nodes + (default), excluding surface-to-surface, node-to-surface, line-to-line, and line-to-surface contact + elements ( ``TARGE169``, ``TARGE170``, ``CONTA172``, ``CONTA174``, ``CONTA175``, and ``CONTA177`` ). + + Setting ``ITEM`` = CONT sums the nodal forces and moment contributions of the selected contact + elements ( ``CONTA172``, ``CONTA174``, ``CONTA175``, and ``CONTA177`` ). Setting ``ITEM`` = BOTH + sums the nodal forces for all selected nodes, including contact elements. + + Nodal forces associated with surface loads are not included. The effects of nodal coupling and + constraint equations are ignored. Moment summations are about the global origin unless another point + is specified with the :ref:`spoint` command. This vector sum is printed in the global Cartesian + system unless it is transformed ( :ref:`rsys` ) and a point is specified with the :ref:`spoint` + command. By default, the sum is done in global Cartesian, and the resulting vector is transformed to + the requested system. + + The ``LAB`` = RSYS option transforms each of the nodal forces into the active coordinate system + before summing and printing. The :ref:`force` command can be used to specify which component + (static, damping, inertia, or total) of the nodal load is to be used. This command output is + included in the :ref:`nforce` command. + + The command should not be used with axisymmetric elements because it might calculate a moment where + none exists. Consider, for example, the axial load on a pipe modeled with an axisymmetric shell + element. The reaction force on the end of the pipe is the total force (for the full 360 degrees) at + that location. The net moment about the centerline of the pipe would be zero, but the program would + incorrectly calculate a moment at the end of the element as the force multiplied by the radius. + + The command is not valid for elements that operate solely within the nodal coordinate system with 1D + option activated and rotated nodes ( :ref:`nrotat` ). + + **Using FSUM with the NLGEOM Command** + If you have activated large deflection ( :ref:`nlgeom`, ON ), the :ref:`fsum` command generates the + following message: + + Summations based on final geometry and will not agree with solution reactions. + + The message warns that the moment summations may not equal the real moment reactions. When + calculating moment summations, the :ref:`fsum` command assumes that the summation of rotations + applies; however, it does not apply for large rotations, which require pseudovector representation + to sum the rotations. + + In contrast, the results for force reactions will be correct because they depend upon linear + displacement vectors (which can be added). + + **Using FSUM in a Spectrum or PSD Analysis ( ANTYPE, SPECTR)** + When using :ref:`fsum` in a spectrum analysis (after the combination file has been input through + :ref:`input`,,MCOM and when :ref:`spopt` has not been issued with ``Elcalc`` = YES during the + spectrum analysis), or in a PSD analysis when postprocessing 1-sigma results (loadstep 3, 4, or 5), + the following message will display in the printout header: + + (Spectrum analysis summation is used) + + This message means that the summation of the element nodal forces is performed prior to the + combination of those forces. In this case, :ref:`rsys` does not apply. The forces are in the nodal + coordinate systems, and the vector sum is always printed in the global coordinate system. + + The spectrum analysis summation is available when the element results are written to the mode file, + :file:`Jobname.mode` ( ``MSUPkey`` = Yes on the :ref:`mxpand` command). + + Because modal displacements cannot be used to calculate contact element nodal forces, ``ITEM`` does + not apply to spectrum and PSD analyses. + """ + command = f"FSUM,{lab},{item}" + return self.run(command, **kwargs) + + def hfang( + self, + lab: str = "", + phi1: str = "", + phi2: str = "", + theta1: str = "", + theta2: str = "", + **kwargs, + ): + r"""Defines or displays spatial angles of a spherical radiation surface for sound radiation parameter + calculations. + + Mechanical APDL Command: `HFANG `_ + + Parameters + ---------- + lab : str + Spatial angle label. + + * ``ANGLE`` - Define spatial angles (default). + + * ``STATE`` - Display spatial angles. ``PHI1``, ``PHI2``, ``THETA1``, and ``THETA2`` are ignored. + + phi1 : str + Starting and ending ϕ angles (degrees) in the spherical coordinate system. ``PHI1`` defaults to + 0 and ``PHI2`` defaults to 360. + + phi2 : str + Starting and ending ϕ angles (degrees) in the spherical coordinate system. ``PHI1`` defaults to + 0 and ``PHI2`` defaults to 360. + + theta1 : str + Starting and ending θ angles (degrees) in the spherical coordinate system. ``THETA1`` defaults + to 0 and ``THETA2`` defaults to 180. + + theta2 : str + Starting and ending θ angles (degrees) in the spherical coordinate system. ``THETA1`` defaults + to 0 and ``THETA2`` defaults to 180. + + Notes + ----- + + .. _HFANG_notes: + + Defines or displays spatial angles of a spherical radiation surface. + + Use this command only with :ref:`plfar`, ``Lab`` = PRES, or :ref:`prfar`, ``Lab`` = PRES. + """ + command = f"HFANG,{lab},{phi1},{phi2},{theta1},{theta2}" + return self.run(command, **kwargs) + + def hfsym( + self, kcn: str = "", xkey: str = "", ykey: str = "", zkey: str = "", **kwargs + ): + r"""Indicates the presence of symmetry planes for the computation of acoustic fields in the near and far + field domains (beyond the finite element region). + + Mechanical APDL Command: `HFSYM `_ + + Parameters + ---------- + kcn : str + Coordinate system reference number. ``KCN`` may be 0 (Cartesian), or any previously defined + local Cartesian coordinate system number (>10). Defaults to 0. + + xkey : str + Key for acoustic field boundary condition, as prescribed for the solution, corresponding to the x = + constant plane: + + * ``None`` - No sound soft or sound hard boundary conditions (default). + + * ``SSB`` - Sound soft boundary (pressure = 0). + + * ``SHB`` - Sound hard boundary (normal velocity = 0). + + ykey : str + Key for acoustic field boundary condition, as prescribed for the solution, corresponding to the y = + constant plane: + + * ``None`` - No sound soft or sound hard boundary conditions (default). + + * ``SSB`` - Sound soft boundary (pressure = 0). + + * ``SHB`` - Sound hard boundary (normal velocity = 0). + + zkey : str + Key for acoustic field boundary condition, as prescribed for the solution, corresponding to the z = + constant plane: + + * ``None`` - No sound soft or sound hard boundary conditions (default). + + * ``SSB`` - Sound soft boundary (pressure = 0). + + * ``SHB`` - Sound hard boundary (normal velocity = 0). + + Notes + ----- + + .. _HFSYM_notes: + + :ref:`hfsym` uses the image principle to indicate symmetry planes (x, y, or z = constant plane) for + acoustic field computations outside the modeled domain. A sound hard boundary condition must be + indicated even though it occurs as a natural boundary condition. + + No menu paths are available for acoustic applications. + """ + command = f"HFSYM,{kcn},{xkey},{ykey},{zkey}" + return self.run(command, **kwargs) + + def macopt(self, **kwargs): + r"""Specifies modal assurance criterion (MAC) or frequency response function (FRF) correlation criteria + calculation options for :ref:`rstmac`. + + Mechanical APDL Command: `MACOPT `_ + + **Command default:** + If :ref:`macopt` is not issued prior to :ref:`rstmac`, node matching based on location is used by + default in MAC calculations performed by :ref:`rstmac`. Unless otherwise specified, an absolute + tolerance (ABSTOLN) value of 0.01 is used for the node matching. + + Notes + ----- + + .. _MACOPT_notes: + + The :ref:`rstmac` command calculates the MAC or FRF criteria values based on the options specified + via :ref:`macopt`. The :ref:`macopt` command must be issued before the :ref:`rstmac` command. These + commands enable you to compare nodal solutions from two results files ( :file:`.rst` or + :file:`.rstp` ) or from one results file and one Universal Format file ( :file:`.unv` ). Multiple + :ref:`macopt` commands can be issued to specify which results are compared and how. + + As listed in the table above, model solutions can be compared using three different mehtods: + matching nodes based on location, matching nodes based on node number, or by node mapping and + solution interpolation. + + When node mapping and solution interpolation is performed ( ``Option`` = NODMAP), the following + applies: + + * ``File1`` on :ref:`rstmac` must correspond to a model meshed in solid and/or shell elements. Other + types of elements can be present, but the node mapping is not performed for these elements. + + * You should only compare solutions of models having the same dimension (both models are 2D or both + models are 3D). Comparing models with different dimensions may lead to incorrect results if the + solution at mapped/matched nodes is not representative of the global solution. + + * Interpolation is performed on UX, UY, and UZ degrees of freedom. + + Node pair MAC computation ( ``Option`` = NMAC) is only supported when a matching procedure is used + and a specific substep number is requested for each solution ( ``Sbstep1``, ``Sbstep2`` on + :ref:`rstmac` command). + + Non-structural degrees of freedom in coupled-field analyses are supported for the matching methods ( + ``Option`` = ABSTOLN or NUMMATCH). Multiple :ref:`macopt`, DOF commands can be issued consecutively + to combine different degrees of freedom. + + The FRF option is not compatible with any MAC calculation options (DOF, NMAC and KEYMASS) and can + only be used with node matching procedures. + + **Example Usage** + + .. _MACOPT_example: + + For a detailed discussion on using :ref:`macopt` with examples, see `Comparing Nodal Solutions From + Two Models or From One Model and Experimental Data (RSTMAC) + `_ + """ + command = "MACOPT" + return self.run(command, **kwargs) + + def nforce(self, item: str = "", **kwargs): + r"""Sums the nodal forces and moments of elements attached to nodes. + + Mechanical APDL Command: `NFORCE `_ + + Parameters + ---------- + item : str + Specifies the selected set of nodes for summing forces and moments for contact elements. + + * ``(blank)`` - Sums the nodal forces of elements for all selected nodes and excludes contact + elements (elements 169-177). + + * ``CONT`` - Sums the nodal forces of elements for contact nodes only. + + * ``BOTH`` - Sums the nodal forces of elements for all selected nodes, including contact elements. + + Notes + ----- + + .. _NFORCE_notes: + + Sums and prints, in each component direction for each selected node, the nodal force and moment + contributions of the selected elements attached to the node. If all elements are selected, the sums + are usually zero except where constraints or loads are applied. The nodal forces and moments may be + displayed ( :ref:`pbc`,FORC and :ref:`pbc`,MOME). Use :ref:`presol` to print nodal forces and + moments on an element-by-element basis. You can use the :ref:`force` command to specify which + component (static, damping, inertia, or total) of the nodal load is to be used. Nodal forces + associated with surface loads are not included. + + This vector sum is printed in the global Cartesian system. Moment summations are about the global + origin unless another point is specified with the :ref:`spoint` command. The summations for each + node are printed in the global Cartesian system unless transformed ( :ref:`rsys` ). This command is + generally not applicable to axisymmetric models because moment information from the NFORCE command + is not correct for axisymmetric elements. + + Selecting a subset of elements ( :ref:`esel` ) and then issuing this command will give the forces + and moments required to maintain equilibrium of that set of elements. The effects of nodal coupling + and constraint equations are ignored. The option ``ITEM`` = CONT provides the forces and moments for + the contact elements ( ``CONTA172``, ``CONTA174``, ``CONTA175``, and ``CONTA177`` ). Setting + ``ITEM`` = BOTH provides the forces and moments for all selected nodes, including contact elements. + + This command also includes the :ref:`fsum` command function which vectorially sums and prints, in + each component direction for the total selected node set, the nodal force and moment contributions + of the selected elements attached to the selected node set. + + **Using NFORCE in a Spectrum or PSD Analysis ( ANTYPE, SPECTR)** + When using :ref:`nforce` in a spectrum analysis (after the combination file has been input through + :ref:`input`,,MCOM and when :ref:`spopt` has not been issued with ``Elcalc`` = YES during the + spectrum analysis), or in a PSD analysis when postprocessing 1-sigma results (loadstep 3, 4, or 5), + the following message will display in the printout header: + + (Spectrum analysis summation is used) + + This message means that the summation of the element nodal forces is performed prior to the + combination of those forces. In this case, :ref:`rsys` does not apply. The forces are in the nodal + coordinate systems, and the vector sum is always printed in the global coordinate system. + + The spectrum analysis summation is available when the element results are written to the mode file, + :file:`Jobname.MODE` ( ``MSUPkey`` = Yes on the :ref:`mxpand` command). + + Because modal displacements cannot be used to calculate contact element nodal forces, ``ITEM`` does + not apply to spectrum and PSD analyses. + """ + command = f"NFORCE,{item}" + return self.run(command, **kwargs) + + def nldpost( + self, + label: str = "", + key: str = "", + fileid: str = "", + prefix: str = "", + **kwargs, + ): + r"""Gets element component information from nonlinear diagnostic files. + + Mechanical APDL Command: `NLDPOST `_ + + Parameters + ---------- + label : str + Specifies the type of command operation: + + * ``EFLG`` - Element flag for nonlinear diagnostics. + + * ``NRRE`` - Newton-Raphson residuals. + + key : str + Specifies the command action: + + * ``STAT`` - List information about the diagnostic files ( :file:`Jobname.ndxxx` or + :file:`Jobname.nrxxx` ) in the current directory. + + For ``Label`` = EFLG, the listing gives a summary that associates the loadstep, substep, time, + equilibrium iteration number, cumulative iteration number, and the number of elements that fail each + criteria with a specific file ID ( :file:`Jobname.ndxxx` ). Use the list to create element + components (via the CM option) based on the cumulative iteration number. + + For ``Label`` = NRRE, the listing provides a summary that associates the loadstep, substep, time, + equilibrium iteration number, and cumulative iteration number with a specific file ID ( + :file:`Jobname.nrxxx` ). Use the list to identify the respective file ID for creating Newton-Raphson + residual contour plots ( :ref:`plnsol`,NRRE,..., ``FileID`` ). + + * ``DEL`` - Delete :file:`Jobname.ndxxx` or :file:`Jobname.nrxxx` files in the working directory, if + any exist. + + * ``CM`` - Create components for elements that violate criteria. This value is valid only when + ``Label`` = EFLG. + + fileid : str + Valid only when ``Label`` = EFLG and ``Key`` = CM, this value specifies file IDs: + + * ``IDnum`` - The file ID number. Creates the element components from the diagnostic files + corresponding to the specified file ID number in the working directory. + + * ``ALL`` - Creates element components from all available diagnostic files residing in the working + directory. This value is the default if you do not specify an ``IDnum`` value. + + prefix : str + Sets the prefix name for components. Specify up to 21 alphanumeric characters. + + Notes + ----- + + .. _NLDPOST_notes: + + Based on the nonlinear diagnostic results (created via the :ref:`nldiag`,EFLG command), the + :ref:`nldpost` command creates element components with predefined names. + + The following table lists the diagnostic criteria and component names (with specified prefix and + without). Here ``xxx`` corresponds to the file ID ( ``FileID`` ) of :file:`Jobname.ndxxx` or + :file:`Jobnamenrxxx`. + + This command contains some tables and extra information which can be inspected in the original + documentation pointed above. + + If you have trouble viewing specific element components, see `Viewing Hidden Element Components + `_ + + For more information, see Performing Nonlinear Diagnostics. + """ + command = f"NLDPOST,{label},{key},{fileid},{prefix}" + return self.run(command, **kwargs) + + def plas( + self, + lab: str = "", + ldstep: str = "", + substep: str = "", + freqb: str = "", + freqe: str = "", + logopt: str = "", + plottype: str = "", + val1: str = "", + val2: str = "", + val3: str = "", + val4: str = "", + val5: str = "", + val6: str = "", + **kwargs, + ): + r"""Plots a specified acoustic quantity during postprocessing of an acoustic analysis. + + Mechanical APDL Command: `PLAS `_ + + Parameters + ---------- + lab : str + The acoustic quantity to calculate: + + * ``SIMP`` - Specific acoustic impedance on the selected surface. + + * ``AIMP`` - Acoustic impedance on the selected surface. + + * ``MIMP`` - Mechanical impedance on the selected surface. + + * ``PRES`` - Average pressure on the selected surface. + + * ``FORC`` - Force on the selected surface. + + * ``POWE`` - Acoustic power on the selected surface. + + * ``ERP`` - Equivalent radiated power on the selected structural surface (valid only for + ``SHELL181``, ``SOLID185``, ``SOLID186``, ``SOLID187``, ``SOLSH190``, ``SOLID225``, ``SOLID226``, + ``SOLID227``, and ``SHELL281`` ). + + * ``ERPL`` - Equivalent radiated power level on the selected structural surface (valid only for + ``SHELL181``, ``SOLID185``, ``SOLID186``, ``SOLID187``, ``SOLSH190``, ``SOLID225``, ``SOLID226``, + ``SOLID227``, and ``SHELL281`` ). + + * ``BSPL`` - Frequency-band sound pressure level on selected nodes. + + * ``BSPA`` - A-weighted frequency-band sound pressure level on selected nodes. + + * ``MENE`` - Acoustic potential energy on the selected elements. + + * ``KENE`` - Acoustic kinetic energy on the selected elements. + + * ``TENE`` - Acoustic total energy on the selected elements. + + * ``PL2V`` - Average square of the L2 norm of pressure on the selected elements. + + * ``LWIN`` - Input sound power level on defined port. + + * ``LWOUT`` - Output sound power level on defined driven port. + + * ``RL`` - Return loss on defined port. + + * ``ALPHA`` - Absorption coefficient on defined port. + + * ``TL`` - Transmission loss on defined ports. + + * ``DFSTL`` - Transmission loss of random acoustic analysis. + + * ``DFSPW`` - Radiated power in random acoustic analysis. + + ldstep : str + Specified load step. Defaults to the load step number specified on the :ref:`set` command, or defaults to 1 if :ref:`set` has not been issued. This default applies to all ``Lab`` values except DFSTL and DFSPW. + + * ``n`` - Load step number. + + * ``ALL`` - All load steps. + + * ``AVG or 0`` - Average result of multiple samplings in a random acoustic analysis (see the + :ref:`msolve` command). This option is used only for ``Lab`` = DFSTL and DFSPW, and it is the + default for these labels. + + substep : str + Specified substep. Defaults to the substep number specified on the :ref:`set` command, or defaults to ALL (all substeps at the specified load step) if :ref:`set` has not been issued. For ``Lab`` = BSPL or BSPA, ALL is the only valid value. + + * ``n`` - Substep number. + + * ``ALL`` - All substeps. + + freqb : str + Frequency value representing one of the following: + + * Beginning frequency of the frequency range ( ``FREQB`` to ``FREQE`` ) for the defined load step(s) + and substeps ( ``SUBSTEP`` = ALL). If a ``SUBSTEP`` value is specified, ``FREQB`` is invalid. + + * Central frequency of octave bands, used when ``LogOpt`` = OB1, OB2, OB3, OB6, OB12, or OB24 and + ``FREQE`` is blank. + + freqe : str + Ending frequency of the frequency range ( ``FREQB`` to ``FREQE`` ) for the defined load step(s) + and substeps ( ``SUBSTEP`` = ALL). If blank, ``FREQE`` is set to ``FREQB``. If a ``SUBSTEP`` + value is specified, ``FREQE`` is invalid. + + logopt : str + Octave bands: + + * ``OB0`` - Narrow bands (default). + + * ``OB1`` - Octave bands. + + * ``OB2`` - 1/2 octave bands. + + * ``OB3`` - 1/3 octave bands. + + * ``OB6`` - 1/6 octave bands. + + * ``OB12`` - 1/12 octave bands. + + * ``OB24`` - 1/24 octave bands. + + plottype : str + Type of plot: + + * ``LINE`` - Line plot (default). + + * ``BAR`` - Bar pattern plot, used only for ``Lab`` = BSPL or BSPA. + + * ``CONT`` - Waterfall diagram, used only for ``Lab`` = ERP or ERPL. + + val1 : str + Input port number for ``Lab`` = LWIN, LWOUT, RL, ALPHA, or TL. + + val2 : str + Output port number for ``Lab`` = TL. + + val3 : str + Reference power for ``Lab`` = LWIN, LWOUT, or EPRL (defaults to 1x10 :sup:`-12` W). + + val4 : str + Fluid mass density for ``Lab`` = ERP or ERPL (defaults to 1.2041 kg/m :sup:`3` ). + + val5 : str + Speed of sound in the fluid for ``Lab`` = ERP or ERPL (defaults to 343.25 m/s). + + val6 : str + Radiation efficiency for ``Lab`` = ERP or ERPL (defaults to 1). + + Notes + ----- + The :ref:`plas` command plots the specified acoustic quantity on the selected exterior surface, the + energy on selected elements, or the sound pressure level over frequency bands. The calculation is + based on the pressure and velocity solution or the frequency-band sound pressure level (SPL). + + The total pressure and velocity are used if the selected surface is the excitation source surface. + To calculate the incoming and outgoing acoustic power and other sound power parameters on the input + and output surfaces, issue the :ref:`sf`,,PORT command in the preprocessor to define port numbers. + + The sound pressure level of the octave bands and general frequency band (defined via the + :ref:`harfrq` command) is calculated at the selected nodes in the model. + """ + command = f"PLAS,{lab},{ldstep},{substep},{freqb},{freqe},{logopt},{plottype},{val1},{val2},{val3},{val4},{val5},{val6}" + return self.run(command, **kwargs) + + def plcamp( + self, + option: str = "", + slope: str = "", + unit: str = "", + freqb: str = "", + cname: str = "", + stabval: int | str = "", + keyallfreq: str = "", + keynegfreq: str = "", + **kwargs, + ): + r"""Plots Campbell diagram data for applications involving rotating structure dynamics. + + Mechanical APDL Command: `PLCAMP `_ + + Parameters + ---------- + option : str + Flag to activate or deactivate sorting of forward or backward whirl frequencies: + + * ``0 (OFF, or NO)`` - No sorting. + + * ``1 (ON, or YES)`` - Sort. This value is the default. + + slope : str + The slope of the line to be printed. This value must be positive. + + * ``SLOPE > 0`` - In the stationary reference frame ( ``RefFrame`` = YES on the :ref:`coriolis` + command), 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. + + In the rotating reference frame ( ``RefFrame`` = NO on the :ref:`coriolis` command), the line + represents the number of excitations per revolution of the rotor minus 1. + + * ``SLOPE = 0`` - The line represents the stability threshold for stability values or logarithmic + decrements printout ( ``STABVAL`` = 1, 2, or 3 ) + + unit : str + Specifies the unit of measurement for rotational angular velocities: + + * ``RDS`` - Rotational angular velocities in radians per second (rad/s). This value is the default. + + * ``RPM`` - Rotational angular velocities in revolutions per minute (RPMs). + + freqb : str + The beginning, or lower end, of the frequency range of interest. The default is zero. + + cname : str + The rotating component name. + + stabval : int or str + Flag to plot the stability values: + + * ``0 (OFF, or NO)`` - Plot the frequencies (the imaginary parts of the eigenvalues in Hz). This + value is the default. + + * ``1 (ON, or YES)`` - Plot the stability values (the real parts of the eigenvalues in Hz). + + * ``2`` - Plot the inverse of the logarithmic decrements. A negative logarithmic decrement indicates + stable motion. + + * ``3`` - Plot the logarithmic decrements. A positive logarithmic decrement indicates stable motion + and is consistent with API (American Petroleum Institute) standards. + + For more information about complex eigenmodes and corresponding logarithmic decrements, see `Complex + Eigensolutions + `_ + in the `Mechanical APDL Theory Reference `_. + + keyallfreq : str + Key to specify if all frequencies above FREQB are plotted: + + * ``0 (OFF, or NO)`` - A maximum of 10 frequencies are plotted. This value is the default. + + * ``1 (ON, or YES)`` - All frequencies are plotted. + + keynegfreq : str + Key to specify if the negative frequencies are plotted. It only applies to solutions obtained with + the damped eigensolver ( ``Method`` = DAMP on the :ref:`modopt` command): + + * ``0 (OFF, or NO)`` - Only positive frequencies are plotted. This value is the default. + + * ``1 (ON, or YES)`` - Negative and positive frequencies are plotted. + + Notes + ----- + The following items are required when generating a Campbell diagram: + + * Activate the Coriolis effect ( :ref:`coriolis` command) in the solution phase ( :ref:`slashsolu` + ). + + * Run a modal analysis using the QR damped ( :ref:`modopt`,QRDAMP) or damped ( :ref:`modopt`,DAMP) + method. Complex eigenmodes are necessary ( :ref:`modopt`,QRDAMP, ``Cpxmod`` = ON), and you must + specify the number of modes to expand ( :ref:`mxpand` ). + + * Define two or more load step results with an ascending order of rotational velocity ( :ref:`omega` + or :ref:`cmomega` ). + + In some cases where modes are not in the same order from one load step to the other, sorting the + frequencies ( ``Option`` = 1) can help to obtain a correct plot. Sorting is based on the comparison + between complex mode shapes calculated at two successive load steps. + + At each load step, the application compares the mode shape to the loads at other load steps to + determine whirl direction at the load step. If applicable, a label appears (in the plot legend) + representing each whirl mode (BW for backward whirl and FW for forward whirl). + + At each load step, the program checks for instability (based on the sign of the real part of the + eigenvalue). The labels "stable" or "unstable" appear in the plot legend for each frequency curve. + + The rotational velocities of a named component ( ``Cname`` ) are displayed on the X-axis. + + For information on plotting a Campbell diagram for a prestressed structure, see `Solving for a + Subsequent Campbell Analysis of a Prestressed Structure Using the Linear Perturbation Procedure + `_ + + For a usage example of the :ref:`plcamp` command, see `Campbell Diagram + `_ + + Damped modal cyclic symmetry ( :ref:`cyclic` ) analyses do not support the :ref:`plcamp` command. + """ + command = f"PLCAMP,{option},{slope},{unit},{freqb},{cname},{stabval},{keyallfreq},{keynegfreq}" + return self.run(command, **kwargs) + + def plcfreq(self, spec: str = "", sectbeg: str = "", sectend: str = "", **kwargs): + r"""Plots the frequency response for the given :ref:`cycspec` specification. + + Mechanical APDL Command: `PLCFREQ `_ + + Parameters + ---------- + spec : str + :ref:`cycspec` specification number (ordered 1 to N in the order input; use :ref:`cycspec`,LIST + to view the current list order). Defaults to 1. + + sectbeg : str + Beginning sector number to plot. Defaults to 1. + + sectend : str + Ending sector number to plot. Defaults to the total number of sectors expanded ( + :ref:`cycexpand` ). + + Notes + ----- + + .. _PLCFREQ_notes: + + Following a cyclic mode-superposition harmonic analysis, this command plots the result item given by + a :ref:`cycspec` specification versus the harmonic frequency, one curve for each of the specified + sectors. A :ref:`cyccalc` command must have been issued prior to this command. + """ + command = f"PLCFREQ,{spec},{sectbeg},{sectend}" + return self.run(command, **kwargs) + + def plchist(self, spec: str = "", freqpt: str = "", **kwargs): + r"""Plots a histogram of the frequency response of each sector for the given :ref:`cycspec` + specification. + + Mechanical APDL Command: `PLCHIST `_ + + Parameters + ---------- + spec : str + :ref:`cycspec` specification number (ordered 1 to N in the order input; use :ref:`cycspec`,LIST + to view the current list order). Defaults to 1. + + freqpt : str + Harmonic frequency point to plot (the data set number NSET or CUMULATIVE on :ref:`set`,LIST). + Defaults to the current :ref:`set` frequency. + + Notes + ----- + + .. _PLCHIST_notes: + + Following a cyclic mode-superposition harmonic analysis, this command creates a histogram plot of + the result item given by a :ref:`cycspec` specification versus the sector number. A :ref:`cyccalc` + command must have been issued prior to this command. + """ + command = f"PLCHIST,{spec},{freqpt}" + return self.run(command, **kwargs) + + def plfar( + self, + lab: str = "", + option: str = "", + var1b: str = "", + var1e: str = "", + nvar1: str = "", + var2b: str = "", + var2e: str = "", + nvar2: str = "", + val1: str = "", + val2: str = "", + val3: str = "", + val4: str = "", + val5: str = "", + ldstep: str = "", + substep: str = "", + freqb: str = "", + freqe: str = "", + plottype: str = "", + logopt: str = "", + **kwargs, + ): + r"""Plots pressure far fields and far-field parameters. + + Mechanical APDL Command: `PLFAR `_ + + Parameters + ---------- + lab : str + Parameters to plot : + + * ``PRES`` - Acoustic parameters + + * ``PROT`` - Acoustic parameters with the y-axis rotated extrusion (not valid for 2D elements) + + * ``PLAT`` - Acoustic parameters radiated by a vibrating structural panel (not valid for 2D + elements) + + option : str + Plot option, based on the specified plot parameter type: + + This command contains some tables and extra information which can be inspected in the original + documentation pointed above. + + var1b : str + Starting and ending values for the first variable associated with ``PlotType`` as described + below. + + When ``PlotType`` = blank (default) or SPHR: Starting and ending phi (φ) angles (in degrees) in + the spherical coordinate system. Defaults to 0. + + When ``PlotType`` = PLXY: Starting and ending x value in the Cartesian coordinate system. + Defaults to 0. + + When ``PlotType`` = PLYZ: Starting and ending y value in the Cartesian coordinate system. + Defaults to 0. + + When ``PlotType`` = PLXZ: Starting and ending x value in the Cartesian coordinate system. + Defaults to 0. + + var1e : str + Starting and ending values for the first variable associated with ``PlotType`` as described + below. + + When ``PlotType`` = blank (default) or SPHR: Starting and ending phi (φ) angles (in degrees) in + the spherical coordinate system. Defaults to 0. + + When ``PlotType`` = PLXY: Starting and ending x value in the Cartesian coordinate system. + Defaults to 0. + + When ``PlotType`` = PLYZ: Starting and ending y value in the Cartesian coordinate system. + Defaults to 0. + + When ``PlotType`` = PLXZ: Starting and ending x value in the Cartesian coordinate system. + Defaults to 0. + + nvar1 : str + Number of divisions between the starting and ending ``VAR1`` values for data computations. + Defaults to 0. + + var2b : str + Starting and ending values for the second variable associated with ``PlotType`` as described + below. + + When ``PlotType`` = blank (default) or SPHR: Starting and ending theta (θ) angles (in degrees) + in the spherical coordinate system. Defaults to 0 for a 3D model and 90 for a 2D extrusion + model. + + When ``PlotType`` = PLXY: Starting and ending y value in the Cartesian coordinate system. + Defaults to 0. + + When ``PlotType`` = PLYZ: Starting and ending z value in the Cartesian coordinate system. + Defaults to 0. + + When ``PlotType`` = PLXZ: Starting and ending z value in the Cartesian coordinate system. + Defaults to 0. + + var2e : str + Starting and ending values for the second variable associated with ``PlotType`` as described + below. + + When ``PlotType`` = blank (default) or SPHR: Starting and ending theta (θ) angles (in degrees) + in the spherical coordinate system. Defaults to 0 for a 3D model and 90 for a 2D extrusion + model. + + When ``PlotType`` = PLXY: Starting and ending y value in the Cartesian coordinate system. + Defaults to 0. + + When ``PlotType`` = PLYZ: Starting and ending z value in the Cartesian coordinate system. + Defaults to 0. + + When ``PlotType`` = PLXZ: Starting and ending z value in the Cartesian coordinate system. + Defaults to 0. + + nvar2 : str + Number of divisions between the starting and ending ``VAR2`` values for data computations. + Defaults to 0. + + val1 : str + ``VAL1`` is additional input. Its meaning depends on the ``PlotType`` argument as described + below. + + When ``PlotType`` = blank (default) or SPHR: Radius of the sphere surface. + + When ``PlotType`` = PLXY: Fixed z value for an X-Y plane in the Cartesian coordinate system. + Defaults to 0. + + When ``PlotType`` = PLYZ: Fixed x value for a Y-Z plane in the Cartesian coordinate system. + Defaults to 0. + + When ``PlotType`` = PLXZ: Fixed y value for an X-Z plane in the Cartesian coordinate system, + Defaults to 0. + + val2 : str + When ``Option`` = SPLC, SPLP, SPAC, or SPAP: Reference rms sound pressure. Defaults to 2x10 + :sup:`-5` Pa. + + When ``Option`` = PWL: Reference sound power. Defaults to 1x10 :sup:`-12` watts. + + val3 : str + When ``Lab`` = PRES: Thickness of 2D model extrusion in the z direction (no default). + + When ``Lab`` = PROT: Angle of the y-axis rotated extrusion model (no default). + + val4 : str + When ``Lab`` = PLAT: Mass density of acoustic fluid. + + val5 : str + When ``Lab`` = PLAT: Sound speed in acoustic fluid. + + ldstep : str + Specified load step. Defaults to the load step number specified on the :ref:`set` command, or defaults to 1 if :ref:`set` has not been issued. + + * ``n`` - Load step number. + + * ``ALL`` - All load steps. + + substep : str + Specified substep. Defaults to the substep number specified on the :ref:`set` command, or defaults to ALL (all substeps at the specified load step) if :ref:`set` has not been issued. + + * ``n`` - Substep number. + + * ``ALL`` - All substeps. + + freqb : str + Frequency value representing one of the following: + + * Beginning frequency of the frequency range ( ``FREQB`` to ``FREQE`` ) for the defined load step(s) + and substeps ( ``SUBSTEP`` = ALL). If a ``SUBSTEP`` value is specified, ``FREQB`` is invalid. + + * Central frequency of octave bands, used when ``LogOpt`` = OB1, OB2, OB3, OB6, OB12, or OB24 and + ``FREQE`` is blank. + + freqe : str + Ending frequency of the frequency range ( ``FREQB`` to ``FREQE`` ) for the defined load step(s) + and substeps ( ``SUBSTEP`` = ALL). If blank, ``FREQE`` is set to ``FREQB``. If a ``SUBSTEP`` + value is specified, ``FREQE`` is invalid. + + plottype : str + Type of plot: + + * ``ANGX`` - x-y chart with angle as the x-axis variable (default). + + * ``FRQX`` - x-y chart with frequency as the x-axis variable. + + * ``CONT`` - Waterfall diagram of a field parameter with variables (frequency, angle). + + * ``MRPM`` - Waterfall diagram of a field parameter with variables (frequency, RPM). + + * ``PLXY`` - Contour plot on an X-Y plane. + + * ``PLYZ`` - Contour plot on a Y-Z plane. + + * ``PLXZ`` - Contour plot on an X-Z plane. + + * ``SPHR`` - Contour plot on a sphere surface. + + logopt : str + Octave bands (used only when Option = SPLC, SPLP, SPAC, SPAP, or PWL) : + + * ``OB0`` - Narrow bands (default). + + * ``OB1`` - Octave bands. + + * ``OB2`` - 1/2 octave bands. + + * ``OB3`` - 1/3 octave bands. + + * ``OB6`` - 1/6 octave bands. + + * ``OB12`` - 1/12 octave bands. + + * ``OB24`` - 1/24 octave bands. + + Notes + ----- + + .. warning:: + + This function contains specificities regarding the argument definitions. + Please refer to the `command documentation `_ + for further explanations. + + .. _PLFAR_notes: + + The :ref:`plfar` command plots pressure far fields and far-field parameters as determined by the + equivalent source principle. Use this command to plot pressure and acoustic parameters. See the + :ref:`hfsym` command for the model symmetry and the :ref:`hfang` command for spatial radiation + angles. + + Plotting acoustic parameters radiated by a vibrating structural panel ( ``Lab`` = PLAT) is supported + by elements ``SOLID185``, ``SOLID186``, ``SOLID187``, ``SHELL181``, ``SHELL281``, and ``SOLSH190``. + The vibration surface of the panel must be flagged by the :ref:`sf`,,MXWF command. + + A maximum of ten curves can be plotted on a 2D chart. + + The waterfall diagram is plotted only in Cartesian coordinates. + """ + command = f"PLFAR,{lab},{option},{var1b},{var1e},{nvar1},{var2b},{var2e},{nvar2},{val1},{val2},{val3},{val4},{val5},{ldstep},{substep},{freqb},{freqe},{plottype},{logopt}" + return self.run(command, **kwargs) + + def plmc( + self, + lstep: str = "", + sbstep: str = "", + timfrq: str = "", + kimg: int | str = "", + hibeg: str = "", + hiend: str = "", + **kwargs, + ): + r"""Plots the modal coordinates from a mode-superposition solution. + + Mechanical APDL Command: `PLMC `_ + + Parameters + ---------- + lstep : str + Plot the solution identified as load step ``LSTEP`` and substep ``SBSTEP`` + + sbstep : str + Plot the solution identified as load step ``LSTEP`` and substep ``SBSTEP`` + + timfrq : str + As an alternative to ``LSTEP`` and ``SBSTEP``, plot the solution at the time value ``TIMFRQ`` + (for :ref:`antype`,TRANS) or frequency value ``TIMFRQ`` (for :ref:`antype`,HARMIC). ``LSTEP`` + and ``SBSTEP`` should be left blank. + + kimg : int or str + Key for plotting real or imaginary solution. Valid only for :ref:`antype`,HARMIC. + + * ``0 (or blank)`` - Plot the real solution (default). + + * ``1`` - Plot the imaginary solution. + + * ``2`` - Plot the amplitude. + + hibeg : str + For cyclic symmetry solutions, plot the solutions in the harmonic index solution range ``HIbeg`` + to ``HIend``. Defaults to all harmonic indices (all modes). + + hiend : str + For cyclic symmetry solutions, plot the solutions in the harmonic index solution range ``HIbeg`` + to ``HIend``. Defaults to all harmonic indices (all modes). + + Notes + ----- + + .. _PLMC_notes: + + :ref:`plmc` plots a histogram of the modal coordinates (the factors which modes may be multiplied by + to obtain their contribution to the response) at a certain time point (transient analyses) or + frequency point (harmonic analyses). The absolute values of the modal coordinates are plotted. Use + :ref:`xrange` to plot only modes in a certain range, if desired. + + For transient analyses, a :file:`.rdsp` None file must be available. For harmonic analyses, a + :file:`.rfrq` None file must be available. The content of these files depends on the :ref:`outres` + command settings. Note that the default for mode-superposition transient analysis is to write the + reduced displacement file every 4th substep. For more information, see Command Default in the + :ref:`outres` command description. + + For a cyclic harmonic mode-superposition analysis, use the :ref:`cycfiles` command to identify the + :file:`.rfrq` None and modal :file:`.rst` None file. For other analyses, use the ``FILE`` command to + specify the :file:`.rdsp` or :file:`.rfrq` file. + + You may limit the plot to display only those modes in a certain harmonic index range. The modes + having the same harmonic index are each plotted in a unique color. If there are less than 10 + harmonic indices, they are identified in the graphics legend. + + This is a graphical representation of the optional :file:`Jobname.mcf` text file (see the + :ref:`trnopt` and :ref:`hropt` commands). To print the modal coordinates, use the :ref:`prmc` + command. For more information on modal coordinates, see `Mode-Superposition Method + `_ + in the `Mechanical APDL Theory Reference + `_. + + **Example Usage** + + .. _PLMC_examples: + + `Example Mode-Superposition Harmonic Cyclic Symmetry Analysis with Mistuning + `_ + + Example: Forced Response with Mistuning and Aero Coupling + """ + command = f"PLMC,{lstep},{sbstep},{timfrq},{kimg},{hibeg},{hiend}" + return self.run(command, **kwargs) + + def plnear( + self, + lab: str = "", + opt: str = "", + kcn: str = "", + val1: str = "", + val2: str = "", + val3: str = "", + val4: str = "", + val5: str = "", + val6: str = "", + val7: str = "", + val8: str = "", + val9: str = "", + **kwargs, + ): + r"""Plots the pressure in the near zone exterior to the equivalent source surface. + + Mechanical APDL Command: `PLNEAR `_ + + Parameters + ---------- + lab : str + Plot the maximum pressure or sound pressure level: + + * ``SPHERE`` - on the spherical structure + + * ``PATH`` - along the path + + opt : str + * ``PSUM`` - Maximum complex pressure for acoustics. + + * ``PHAS`` - Phase angle of complex pressure for acoustics. + + * ``SPL`` - Sound pressure level for acoustics. + + * ``SPLA`` - A-weighted sound pressure level for acoustics (dBA). + + kcn : str + KCN is the coordinate system reference number. It may be 0 (Cartesian) or any previously defined + local coordinate system number (>10). Defaults to 0. + + val1 : str + For ``LAB`` = SPHERE: + + * ``VAL1`` - Radius of spherical surface in spherical coordinate system. + + * ``VAL2`` - Starting φ angle (degree) in the spherical coordinate system. Defaults to 0. + + * ``VAL3`` - Ending φ angle (degree) in the spherical coordinate system. Defaults to 0. + + * ``VAL4`` - Number of divisions between the starting and ending φ angles for data + computations. Defaults to 0. + + * ``VAL5`` - Starting θ angle (degrees) in the spherical coordinate system. Defaults to 0 in 3D + and 90 in 2D extension. + + * ``VAL6`` - Ending θ angle (degrees) in the spherical coordinate system. Defaults to 0 in 3D + and 90 in 2D extension. + + * ``VAL7`` - Number of divisions between the starting and ending θ angles for data + computations. Defaults to 0. + + * ``VAL8`` - Reference rms sound pressure. Defaults to 2x10 :sup:`-5` Pa. + + * ``VAL9`` - Thickness of 2D model extension in z direction (defaults to 0). + + For ``Lab`` = :ref:`path`, :ref:`plnear` computes the electric field or pressure for the path data + points for the path currently defined by the :ref:`path` and :ref:`ppath` commands. + + val2 : str + For ``LAB`` = SPHERE: + + * ``VAL1`` - Radius of spherical surface in spherical coordinate system. + + * ``VAL2`` - Starting φ angle (degree) in the spherical coordinate system. Defaults to 0. + + * ``VAL3`` - Ending φ angle (degree) in the spherical coordinate system. Defaults to 0. + + * ``VAL4`` - Number of divisions between the starting and ending φ angles for data + computations. Defaults to 0. + + * ``VAL5`` - Starting θ angle (degrees) in the spherical coordinate system. Defaults to 0 in 3D + and 90 in 2D extension. + + * ``VAL6`` - Ending θ angle (degrees) in the spherical coordinate system. Defaults to 0 in 3D + and 90 in 2D extension. + + * ``VAL7`` - Number of divisions between the starting and ending θ angles for data + computations. Defaults to 0. + + * ``VAL8`` - Reference rms sound pressure. Defaults to 2x10 :sup:`-5` Pa. + + * ``VAL9`` - Thickness of 2D model extension in z direction (defaults to 0). + + For ``Lab`` = :ref:`path`, :ref:`plnear` computes the electric field or pressure for the path data + points for the path currently defined by the :ref:`path` and :ref:`ppath` commands. + + val3 : str + For ``LAB`` = SPHERE: + + * ``VAL1`` - Radius of spherical surface in spherical coordinate system. + + * ``VAL2`` - Starting φ angle (degree) in the spherical coordinate system. Defaults to 0. + + * ``VAL3`` - Ending φ angle (degree) in the spherical coordinate system. Defaults to 0. + + * ``VAL4`` - Number of divisions between the starting and ending φ angles for data + computations. Defaults to 0. + + * ``VAL5`` - Starting θ angle (degrees) in the spherical coordinate system. Defaults to 0 in 3D + and 90 in 2D extension. + + * ``VAL6`` - Ending θ angle (degrees) in the spherical coordinate system. Defaults to 0 in 3D + and 90 in 2D extension. + + * ``VAL7`` - Number of divisions between the starting and ending θ angles for data + computations. Defaults to 0. + + * ``VAL8`` - Reference rms sound pressure. Defaults to 2x10 :sup:`-5` Pa. + + * ``VAL9`` - Thickness of 2D model extension in z direction (defaults to 0). + + For ``Lab`` = :ref:`path`, :ref:`plnear` computes the electric field or pressure for the path data + points for the path currently defined by the :ref:`path` and :ref:`ppath` commands. + + val4 : str + For ``LAB`` = SPHERE: + + * ``VAL1`` - Radius of spherical surface in spherical coordinate system. + + * ``VAL2`` - Starting φ angle (degree) in the spherical coordinate system. Defaults to 0. + + * ``VAL3`` - Ending φ angle (degree) in the spherical coordinate system. Defaults to 0. + + * ``VAL4`` - Number of divisions between the starting and ending φ angles for data + computations. Defaults to 0. + + * ``VAL5`` - Starting θ angle (degrees) in the spherical coordinate system. Defaults to 0 in 3D + and 90 in 2D extension. + + * ``VAL6`` - Ending θ angle (degrees) in the spherical coordinate system. Defaults to 0 in 3D + and 90 in 2D extension. + + * ``VAL7`` - Number of divisions between the starting and ending θ angles for data + computations. Defaults to 0. + + * ``VAL8`` - Reference rms sound pressure. Defaults to 2x10 :sup:`-5` Pa. + + * ``VAL9`` - Thickness of 2D model extension in z direction (defaults to 0). + + For ``Lab`` = :ref:`path`, :ref:`plnear` computes the electric field or pressure for the path data + points for the path currently defined by the :ref:`path` and :ref:`ppath` commands. + + val5 : str + For ``LAB`` = SPHERE: + + * ``VAL1`` - Radius of spherical surface in spherical coordinate system. + + * ``VAL2`` - Starting φ angle (degree) in the spherical coordinate system. Defaults to 0. + + * ``VAL3`` - Ending φ angle (degree) in the spherical coordinate system. Defaults to 0. + + * ``VAL4`` - Number of divisions between the starting and ending φ angles for data + computations. Defaults to 0. + + * ``VAL5`` - Starting θ angle (degrees) in the spherical coordinate system. Defaults to 0 in 3D + and 90 in 2D extension. + + * ``VAL6`` - Ending θ angle (degrees) in the spherical coordinate system. Defaults to 0 in 3D + and 90 in 2D extension. + + * ``VAL7`` - Number of divisions between the starting and ending θ angles for data + computations. Defaults to 0. + + * ``VAL8`` - Reference rms sound pressure. Defaults to 2x10 :sup:`-5` Pa. + + * ``VAL9`` - Thickness of 2D model extension in z direction (defaults to 0). + + For ``Lab`` = :ref:`path`, :ref:`plnear` computes the electric field or pressure for the path data + points for the path currently defined by the :ref:`path` and :ref:`ppath` commands. + + val6 : str + For ``LAB`` = SPHERE: + + * ``VAL1`` - Radius of spherical surface in spherical coordinate system. + + * ``VAL2`` - Starting φ angle (degree) in the spherical coordinate system. Defaults to 0. + + * ``VAL3`` - Ending φ angle (degree) in the spherical coordinate system. Defaults to 0. + + * ``VAL4`` - Number of divisions between the starting and ending φ angles for data + computations. Defaults to 0. + + * ``VAL5`` - Starting θ angle (degrees) in the spherical coordinate system. Defaults to 0 in 3D + and 90 in 2D extension. + + * ``VAL6`` - Ending θ angle (degrees) in the spherical coordinate system. Defaults to 0 in 3D + and 90 in 2D extension. + + * ``VAL7`` - Number of divisions between the starting and ending θ angles for data + computations. Defaults to 0. + + * ``VAL8`` - Reference rms sound pressure. Defaults to 2x10 :sup:`-5` Pa. + + * ``VAL9`` - Thickness of 2D model extension in z direction (defaults to 0). + + For ``Lab`` = :ref:`path`, :ref:`plnear` computes the electric field or pressure for the path data + points for the path currently defined by the :ref:`path` and :ref:`ppath` commands. + + val7 : str + For ``LAB`` = SPHERE: + + * ``VAL1`` - Radius of spherical surface in spherical coordinate system. + + * ``VAL2`` - Starting φ angle (degree) in the spherical coordinate system. Defaults to 0. + + * ``VAL3`` - Ending φ angle (degree) in the spherical coordinate system. Defaults to 0. + + * ``VAL4`` - Number of divisions between the starting and ending φ angles for data + computations. Defaults to 0. + + * ``VAL5`` - Starting θ angle (degrees) in the spherical coordinate system. Defaults to 0 in 3D + and 90 in 2D extension. + + * ``VAL6`` - Ending θ angle (degrees) in the spherical coordinate system. Defaults to 0 in 3D + and 90 in 2D extension. + + * ``VAL7`` - Number of divisions between the starting and ending θ angles for data + computations. Defaults to 0. + + * ``VAL8`` - Reference rms sound pressure. Defaults to 2x10 :sup:`-5` Pa. + + * ``VAL9`` - Thickness of 2D model extension in z direction (defaults to 0). + + For ``Lab`` = :ref:`path`, :ref:`plnear` computes the electric field or pressure for the path data + points for the path currently defined by the :ref:`path` and :ref:`ppath` commands. + + val8 : str + For ``LAB`` = SPHERE: + + * ``VAL1`` - Radius of spherical surface in spherical coordinate system. + + * ``VAL2`` - Starting φ angle (degree) in the spherical coordinate system. Defaults to 0. + + * ``VAL3`` - Ending φ angle (degree) in the spherical coordinate system. Defaults to 0. + + * ``VAL4`` - Number of divisions between the starting and ending φ angles for data + computations. Defaults to 0. + + * ``VAL5`` - Starting θ angle (degrees) in the spherical coordinate system. Defaults to 0 in 3D + and 90 in 2D extension. + + * ``VAL6`` - Ending θ angle (degrees) in the spherical coordinate system. Defaults to 0 in 3D + and 90 in 2D extension. + + * ``VAL7`` - Number of divisions between the starting and ending θ angles for data + computations. Defaults to 0. + + * ``VAL8`` - Reference rms sound pressure. Defaults to 2x10 :sup:`-5` Pa. + + * ``VAL9`` - Thickness of 2D model extension in z direction (defaults to 0). + + For ``Lab`` = :ref:`path`, :ref:`plnear` computes the electric field or pressure for the path data + points for the path currently defined by the :ref:`path` and :ref:`ppath` commands. + + val9 : str + For ``LAB`` = SPHERE: + + * ``VAL1`` - Radius of spherical surface in spherical coordinate system. + + * ``VAL2`` - Starting φ angle (degree) in the spherical coordinate system. Defaults to 0. + + * ``VAL3`` - Ending φ angle (degree) in the spherical coordinate system. Defaults to 0. + + * ``VAL4`` - Number of divisions between the starting and ending φ angles for data + computations. Defaults to 0. + + * ``VAL5`` - Starting θ angle (degrees) in the spherical coordinate system. Defaults to 0 in 3D + and 90 in 2D extension. + + * ``VAL6`` - Ending θ angle (degrees) in the spherical coordinate system. Defaults to 0 in 3D + and 90 in 2D extension. + + * ``VAL7`` - Number of divisions between the starting and ending θ angles for data + computations. Defaults to 0. + + * ``VAL8`` - Reference rms sound pressure. Defaults to 2x10 :sup:`-5` Pa. + + * ``VAL9`` - Thickness of 2D model extension in z direction (defaults to 0). + + For ``Lab`` = :ref:`path`, :ref:`plnear` computes the electric field or pressure for the path data + points for the path currently defined by the :ref:`path` and :ref:`ppath` commands. + + Notes + ----- + + .. _PLNEAR_notes: + + :ref:`plnear` uses the equivalent source principle to calculate the pressure in the near zone + exterior to the equivalent source surface (flagged with the Maxwell surface flag in the + preprocessor) for one of the following locations: + + * A spherical surface in the KCN coordinate system + + * A path defined by the :ref:`path` and :ref:`ppath` commands + + To plot the pressure results for a path, use the :ref:`plpagm` or :ref:`plpath` commands. See the + :ref:`hfsym` command for the model symmetry. + + To retrieve saved equivalent source data, issue the :ref:`set`, ``Lstep``, ``Sbstep``,,REAL command. + """ + command = f"PLNEAR,{lab},{opt},{kcn},{val1},{val2},{val3},{val4},{val5},{val6},{val7},{val8},{val9}" + return self.run(command, **kwargs) + + def plzz(self, rotvel: str = "", deltarotvel: str = "", **kwargs): + r"""Plots the interference diagram from a cyclic modal analysis. + + Mechanical APDL Command: `PLZZ `_ + + Parameters + ---------- + rotvel : str + Rotational speed in revolutions per minute (RPM) used to define the speed line. If blank, use + the rotational speed (from :ref:`omega` ) specified in the prestressing step of the linear + perturbation analysis. If explicitly input as 0, or if the linear perturbation was not used, no + speed lines are plotted. + + deltarotvel : str + Adds speed lines about the ``RotVel`` speed line corresponding to ``RotVel`` ± ``DeltaRotVel``. + Only plotted if ``RotVel`` is known. + + Notes + ----- + + .. _PLZZ_notes: + + :ref:`plzz` plots the cyclic modal frequencies as points on a frequency vs. harmonic index (nodal + diameter) graph. If rotational speed ( ``RotVel`` ) is provided, the speed line is also plotted, + leading to the interference diagram (also known as the SAFE or ZZENF diagram). If ``DeltaRotVel`` is + also provided, two additional speed lines are plotted, enveloping the safe speed line itself. + + For more information, see `Postprocessing a Modal Cyclic Symmetry Analysis + `_ + """ + command = f"PLZZ,{rotvel},{deltarotvel}" + return self.run(command, **kwargs) + + def pras( + self, + lab: str = "", + ldstep: str = "", + substep: str = "", + freqb: str = "", + freqe: str = "", + logopt: str = "", + val1: str = "", + val2: str = "", + val3: str = "", + val4: str = "", + val5: str = "", + val6: str = "", + **kwargs, + ): + r"""Prints a specified acoustic quantity during postprocessing of an acoustic analysis. + + Mechanical APDL Command: `PRAS `_ + + Parameters + ---------- + lab : str + The acoustic quantity to calculate: + + * ``SIMP`` - Specific acoustic impedance on the selected surface. + + * ``AIMP`` - Acoustic impedance on the selected surface. + + * ``MIMP`` - Mechanical impedance on the selected surface. + + * ``PRES`` - Average pressure on the selected surface. + + * ``FORC`` - Force on the selected surface. + + * ``POWE`` - Acoustic power on the selected surface. + + * ``ERP`` - Equivalent radiated power on the selected structural surface (valid only for + ``SHELL181``, ``SOLID185``, ``SOLID186``, ``SOLID187``, ``SOLSH190``, ``SOLID225``, ``SOLID226``, + ``SOLID227``, and ``SHELL281`` ). + + * ``ERPL`` - Equivalent radiated power level on the selected structural surface (valid only for + ``SHELL181``, ``SOLID185``, ``SOLID186``, ``SOLID187``, ``SOLSH190``, ``SOLID225``, ``SOLID226``, + ``SOLID227``, and ``SHELL281`` ). + + * ``BSPL`` - Frequency-band sound pressure level on selected nodes. + + * ``BSPA`` - A-weighted frequency-band sound pressure level on selected nodes. + + * ``MENE`` - Acoustic potential energy on the selected elements. + + * ``KENE`` - Acoustic kinetic energy on the selected elements. + + * ``TENE`` - Acoustic total energy on the selected elements. + + * ``PL2V`` - Average square of the L2 norm of pressure on the selected elements. + + * ``LWIN`` - Input sound power level on defined port. + + * ``LWOUT`` - Output sound power level on defined driven port. + + * ``RL`` - Return loss on defined port. + + * ``ALPHA`` - Absorption coefficient on defined port. + + * ``TL`` - Transmission loss on defined ports. + + * ``PALL`` - All port-related parameters (LWIN, LWOUT, RL, ALPHA, TL). + + * ``DFSTL`` - Transmission loss of random acoustic analysis. + + * ``DFSPW`` - Radiated power in random acoustic analysis. + + * ``DALL`` - All random acoustic related parameters (DFSTL, DFSPW). + + ldstep : str + Specified load step. Defaults to the load step number specified on the :ref:`set` command, or defaults to 1 if :ref:`set` has not been issued. This default applies to all ``Lab`` values except DFSTL, DFSPW, and DALL. + + * ``n`` - Load step number. + + * ``ALL`` - All load steps. + + * ``AVG or 0`` - Average result of multiple samplings in a random acoustic analysis (see the + :ref:`msolve` command). This option is used only for ``Lab`` = DFSTL, DFSPW, and DALL, and it is the + default for these labels. + + substep : str + Specified substep. Defaults to the substep number specified on the :ref:`set` command, or defaults to ALL (all substeps at the specified load step) if :ref:`set` has not been issued. For ``Lab`` = BSPL or BSPA, ALL is the only valid value. + + * ``n`` - Substep number. + + * ``ALL`` - All substeps. + + freqb : str + Frequency value representing one of the following: + + * Beginning frequency of the frequency range ( ``FREQB`` to ``FREQE`` ) for the defined load step(s) + and substeps ( ``SUBSTEP`` = ALL). If a ``SUBSTEP`` value is specified, ``FREQB`` is invalid. + + * Central frequency of octave bands, used when ``LogOpt`` = OB1, OB2, OB3, OB6, OB12, or OB24 and + ``FREQE`` is blank. + + freqe : str + Ending frequency of the frequency range ( ``FREQB`` to ``FREQE`` ) for the defined load step(s) + and substeps ( ``SUBSTEP`` = ALL). If blank, ``FREQE`` is set to ``FREQB``. If a ``SUBSTEP`` + value is specified, ``FREQE`` is invalid. + + logopt : str + Octave bands: + + * ``OB0`` - Narrow bands (default). + + * ``OB1`` - Octave bands. + + * ``OB2`` - 1/2 octave bands. + + * ``OB3`` - 1/3 octave bands. + + * ``OB6`` - 1/6 octave bands. + + * ``OB12`` - 1/12 octave bands. + + * ``OB24`` - 1/24 octave bands. + + val1 : str + Input port number for ``Lab`` = LWIN, LWOUT, RL, ALPHA, TL, or PALL. + + val2 : str + Output port number for ``Lab`` = TL or PALL. + + val3 : str + Reference power for ``Lab`` = LWIN, LWOUT, PALL or EPRL (defaults to 1x10 :sup:`-12` W). + + val4 : str + Fluid mass density for ``Lab`` = ERP or ERPL (defaults to 1.2041 kg/m :sup:`3` ). + + val5 : str + Speed of sound in the fluid for ``Lab`` = ERP or ERPL (defaults to 343.25 m/s). + + val6 : str + Radiation efficiency for ``Lab`` = ERP or ERPL (defaults to 1). + + Notes + ----- + The :ref:`pras` command lists the specified acoustic quantity on the selected exterior surface, the + energy on selected elements, or the sound pressure level over frequency bands. The calculation is + based on the pressure and velocity solution or the frequency-band sound pressure level (SPL). + + The total pressure and velocity are used if the selected surface is the excitation source surface. + To calculate the incoming and outgoing acoustic power and other sound power parameters on the input + and output surfaces, issue the :ref:`sf`,,PORT command in the preprocessor to define port numbers. + + The sound pressure level of the octave bands and general frequency band (defined via the + :ref:`harfrq` command) is calculated at the selected nodes in the model. + """ + command = f"PRAS,{lab},{ldstep},{substep},{freqb},{freqe},{logopt},,{val1},{val2},{val3},{val4},{val5},{val6}" + return self.run(command, **kwargs) + + def prcamp( + self, + option: str = "", + slope: str = "", + unit: str = "", + freqb: str = "", + cname: str = "", + stabval: int | str = "", + keyallfreq: str = "", + keynegfreq: str = "", + keywhirl: str = "", + **kwargs, + ): + r"""Prints Campbell diagram data for applications involving rotating structure dynamics. + + Mechanical APDL Command: `PRCAMP `_ + + Parameters + ---------- + option : str + Flag to activate or deactivate sorting of forward or backward whirl frequencies: + + * ``0 (OFF, or NO)`` - No sorting. + + * ``1 (ON, or YES)`` - Sort. This value is the default. + + slope : str + The slope of the line to be printed. This value must be positive. + + * ``SLOPE > 0`` - In the stationary reference frame ( ``RefFrame`` = YES on the :ref:`coriolis` + command), 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. + + In the rotating reference frame ( ``RefFrame`` = NO on the :ref:`coriolis` command), the line + represents the number of excitations per revolution of the rotor minus 1. + + * ``SLOPE = 0`` - The line represents the stability threshold for stability values or logarithmic + decrements printout ( ``STABVAL`` = 1, 2, or 3 ) + + unit : str + Specifies the unit of measurement for rotational angular velocities: + + * ``RDS`` - Rotational angular velocities in radians per second (rad/s). This value is the default. + + * ``RPM`` - Rotational angular velocities in revolutions per minute (RPMs). + + freqb : str + The beginning, or lower end, of the frequency range of interest. The default is zero. + + cname : str + The rotating component name. + + stabval : int or str + 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. + + * ``1 (ON, or YES)`` - Print the stability values (the real parts of the eigenvalues in Hz). + + * ``2`` - Print the inverse of the logarithmic decrements. A negative logarithmic decrement + indicates stable motion. + + * ``3`` - Print the logarithmic decrements. A positive logarithmic decrement indicates stable motion + and is consistent with API (American Petroleum Institute) standards. + + For more information about complex eigenmodes and corresponding logarithmic decrements, see `Complex + Eigensolutions + `_ + in the `Mechanical APDL Theory Reference `_. + + keyallfreq : str + 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 :ref:`plcamp` command. This value is the default. + + * ``1 (ON, or YES)`` - All frequencies are printed out. + + keynegfreq : str + Key to specify if the negative frequencies are printed out. It only applies to solutions obtained + with the damped eigensolver ( ``Method`` =DAMP on the :ref:`modopt` command): + + * ``0 (OFF, or NO)`` - Only positive frequencies are printed out. This value is the default. + + * ``1 (ON, or YES)`` - Negative and positive frequencies are printed out. + + keywhirl : str + 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: + + * Activate the Coriolis effect ( :ref:`coriolis` command) in the solution phase ( :ref:`slashsolu` + ). + + * Run a modal analysis using the QR damped ( :ref:`modopt`,QRDAMP) or damped ( :ref:`modopt`,DAMP) + method. Complex eigenmodes are necessary ( :ref:`modopt`,QRDAMP, ``Cpxmod`` = ON), and you must + specify the number of modes to expand ( :ref:`mxpand` ). + + * Define two or more load step results with an ascending order of rotational velocity ( :ref:`omega` + or :ref:`cmomega` ). + + In some cases where modes are not in the same order from one load step to the other, sorting the + frequencies ( ``Option`` = 1) can help to obtain a correct printout. Sorting is based on the + comparison between complex mode shapes calculated at two successive load steps. + + At each load step, the application compares the mode shape to the loads to determine the whirl + direction. If applicable, a label appears (on the rows of output data) representing the whirl mode + (BW for backward whirl and FW for forward whirl). + + If you specify a non-zero slope ( ``SLOPE`` > 0), the command prints the critical speeds + corresponding to the intersection points of the frequency curves and the added line. In the case of + a named component ( ``Cname`` ), critical speeds relate to the rotational velocity of the component. + Critical speeds are available only if the frequencies are printed ( STABVAL = OFF). + + If you specify a zero slope ( ``SLOPE`` = 0), the command prints the stability threshold + corresponding to the sign change of the stability values (or logarithmic decrements). In the case of + a named component ( ``Cname`` ), stability thresholds relate to the rotational velocity of the + component. Stability thresholds are available only if the stability values or logarithmic decrements + are printed ( ``STABVAL`` = 1, 2, or 3 ). + + At each load step, the program checks for instability (based on the sign of the real part of the + eigenvalue). The label "U" appears on the printout for each unstable frequency. + + If specified, the rotational velocities of the named component ( ``Cname`` ) are printed out along + with the natural frequencies. + + For information on printing a Campbell diagram for a prestressed structure, see `Solving for a + Subsequent Campbell Analysis of a Prestressed Structure Using the Linear Perturbation Procedure + `_ + + For a usage example of the companion command :ref:`plcamp` (used for plotting a Campbell diagram), + see `Example: Campbell Diagram Analysis of a Simply Supported Beam + `_ + + For more information on Campbell diagram generation, see `Campbell Diagram + `_ + + Damped modal cyclic symmetry ( :ref:`cyclic` ) analyses do not support the :ref:`prcamp` command. + """ + command = f"PRCAMP,{option},{slope},{unit},{freqb},{cname},{stabval},{keyallfreq},{keynegfreq},{keywhirl}" + return self.run(command, **kwargs) + + def prfar( + self, + lab: str = "", + option: str = "", + var1b: str = "", + var1e: str = "", + nvar1: str = "", + var2b: str = "", + var2e: str = "", + nvar2: str = "", + val1: str = "", + val2: str = "", + val3: str = "", + val4: str = "", + val5: str = "", + ldstep: str = "", + substep: str = "", + freqb: str = "", + freqe: str = "", + printtype: str = "", + logopt: str = "", + **kwargs, + ): + r"""Prints acoustic far field parameters. + + Mechanical APDL Command: `PRFAR `_ + + Parameters + ---------- + lab : str + Parameters to print: + + * ``PRES`` - Acoustic parameters + + * ``PROT`` - Acoustic parameters with the y-axis rotated extrusion (not valid for 2D elements) + + * ``PLAT`` - Acoustic parameters radiated by a vibrating structural panel (not valid for 2D + elements) + + option : str + Print option, based on the specified print parameter type: + + This command contains some tables and extra information which can be inspected in the original + documentation pointed above. + + var1b : str + Starting and ending values for the first variable associated with ``PrintType`` as described + below. + + When ``PrintType`` = blank (default) or SPHR: Starting and ending phi (φ) angles (in degrees) in + the spherical coordinate system. Defaults to 0. + + When ``PrintType`` = PLXY: Starting and ending x value in the Cartesian coordinate system. + Defaults to 0. + + When ``PrintType`` = PLYZ: Starting and ending y value in the Cartesian coordinate system. + Defaults to 0. + + When ``PrintType`` = PLXZ: Starting and ending x value in the Cartesian coordinate system. + Defaults to 0. + + var1e : str + Starting and ending values for the first variable associated with ``PrintType`` as described + below. + + When ``PrintType`` = blank (default) or SPHR: Starting and ending phi (φ) angles (in degrees) in + the spherical coordinate system. Defaults to 0. + + When ``PrintType`` = PLXY: Starting and ending x value in the Cartesian coordinate system. + Defaults to 0. + + When ``PrintType`` = PLYZ: Starting and ending y value in the Cartesian coordinate system. + Defaults to 0. + + When ``PrintType`` = PLXZ: Starting and ending x value in the Cartesian coordinate system. + Defaults to 0. + + nvar1 : str + Number of divisions between the starting and ending ``VAR1`` values for data computations. + Defaults to 0. + + var2b : str + Starting and ending values for the second variable associated with ``PrintType`` as described + below. + + When ``PrintType`` = blank (default) or SPHR: Starting and ending theta (θ) angles (in degrees) + in the spherical coordinate system. Defaults to 0 for a 3D model and 90 for a 2D extrusion + model. + + When ``PrintType`` = PLXY: Starting and ending y value in the Cartesian coordinate system. + Defaults to 0. + + When ``PrintType`` = PLYZ: Starting and ending z value in the Cartesian coordinate system. + Defaults to 0. + + When ``PrintType`` = PLXZ: Starting and ending z value in the Cartesian coordinate system. + Defaults to 0. + + var2e : str + Starting and ending values for the second variable associated with ``PrintType`` as described + below. + + When ``PrintType`` = blank (default) or SPHR: Starting and ending theta (θ) angles (in degrees) + in the spherical coordinate system. Defaults to 0 for a 3D model and 90 for a 2D extrusion + model. + + When ``PrintType`` = PLXY: Starting and ending y value in the Cartesian coordinate system. + Defaults to 0. + + When ``PrintType`` = PLYZ: Starting and ending z value in the Cartesian coordinate system. + Defaults to 0. + + When ``PrintType`` = PLXZ: Starting and ending z value in the Cartesian coordinate system. + Defaults to 0. + + nvar2 : str + Number of divisions between the starting and ending ``VAR2`` values for data computations. + Defaults to 0. + + val1 : str + ``VAL1`` is additional input. Its meaning depends on the ``PrintType`` argument as described + below. + + When ``PrintType`` = blank (default) or SPHR: Radius of the sphere surface. + + When ``PrintType`` = PLXY: Fixed z value for an X-Y plane in the Cartesian coordinate system. + Defaults to 0. + + When ``PrintType`` = PLYZ: Fixed x value for a Y-Z plane in the Cartesian coordinate system. + Defaults to 0. + + When ``PrintType`` = PLXZ: Fixed y value for an X-Z plane in the Cartesian coordinate system, + Defaults to 0. + + val2 : str + When ``Option`` = SPLC or SPAC: Reference rms sound pressure. Defaults to 2x10 :sup:`-5` Pa. + + When ``Option`` = PWL: Reference sound power. Defaults to 1x10 :sup:`-12` watts. + + val3 : str + When ``Lab`` = PRES: Thickness of 2D model extrusion in the z direction (no default). + + When ``Lab`` = PROT: Angle of the y-axis rotated extrusion model (no default) + + val4 : str + When ``Lab`` = PLAT: Mass density of acoustic fluid. + + val5 : str + When ``Lab`` = PLAT: Sound speed in acoustic fluid. + + ldstep : str + Specified load step. Defaults to the load step number specified on the :ref:`set` command, or defaults to 1 if :ref:`set` has not been issued. + + * ``n`` - Load step number. + + * ``ALL`` - All load steps. + + substep : str + Specified substep. Defaults to the substep number specified on the :ref:`set` command, or defaults to ALL (all substeps at the specified load step) if :ref:`set` has not been issued. + + * ``n`` - Substep number. + + * ``ALL`` - All substeps. + + freqb : str + Frequency value representing one of the following: + + * Beginning frequency of the frequency range ( ``FREQB`` to ``FREQE`` ) for the defined load step(s) + and substeps ( ``SUBSTEP`` = ALL). If a ``SUBSTEP`` value is specified, ``FREQB`` is invalid. + + * Central frequency of octave bands, used when ``LogOpt`` = OB1, OB2, OB3, OB6, OB12, or OB24 and + ``FREQE`` is blank. + + freqe : str + Ending frequency of the frequency range ( ``FREQB`` to ``FREQE`` ) for the defined load step(s) + and substeps ( ``SUBSTEP`` = ALL). If blank, ``FREQE`` is set to ``FREQB``. If a ``SUBSTEP`` + value is specified, ``FREQE`` is invalid. + + printtype : str + Print out far-field parameters on a plane or sphere (used when ``Option`` = SUMC, PHSC, SPLC, SPAC, DGCT, PSCT, or TSCT). No default. + + * ``PLXY`` - On an X-Y plane. + + * ``PLYZ`` - On a Y-Z plane. + + * ``PLXZ`` - On an X-Z plane. + + * ``SPHR`` - On a sphere surface. + + logopt : str + Octave bands (used only when Option = SPLC, SPAC, or PWL) : + + * ``OB0`` - Narrow bands (default). + + * ``OB1`` - Octave bands. + + * ``OB2`` - 1/2 octave bands. + + * ``OB3`` - 1/3 octave bands. + + * ``OB6`` - 1/6 octave bands. + + * ``OB12`` - 1/12 octave bands. + + * ``OB24`` - 1/24 octave bands. + + Notes + ----- + + .. warning:: + + This function contains specificities regarding the argument definitions. + Please refer to the `command documentation `_ + for further explanations. + + .. _PRFAR_notes: + + The :ref:`prfar` command prints pressure far fields and far field parameters as determined by the + equivalent source principle. Use this command to print pressure and acoustic parameters. See the + :ref:`hfsym` command for the model symmetry and the :ref:`hfang` command for spatial radiation + angles. + + Printing acoustic parameters radiated by a vibrating structural panel ( ``Lab`` = PLAT) is supported + by elements ``SOLID185``, ``SOLID186``, ``SOLID187``, ``SHELL181``, ``SHELL281``, and ``SOLSH190``. + The vibration surface of the panel must be flagged by the :ref:`sf`,MXWF command. + """ + command = f"PRFAR,{lab},{option},{var1b},{var1e},{nvar1},{var2b},{var2e},{nvar2},{val1},{val2},{val3},{val4},{val5},{ldstep},{substep},{freqb},{freqe},{printtype},{logopt}" + return self.run(command, **kwargs) + + def prmc( + self, + lstep: str = "", + sbstep: str = "", + timfrq: str = "", + kimg: int | str = "", + hibeg: str = "", + hiend: str = "", + matrix: str = "", + **kwargs, + ): + r"""Prints the modal coordinates from a mode-superposition solution. + + Mechanical APDL Command: `PRMC `_ + + Parameters + ---------- + lstep : str + Print the solution identified as load step ``LSTEP`` and substep ``SBSTEP``. + + sbstep : str + Print the solution identified as load step ``LSTEP`` and substep ``SBSTEP``. + + timfrq : str + As an alternative to ``LSTEP`` and ``SBSTEP``, print the solution at the time value ``TIMFRQ`` + (for :ref:`antype`,TRANS) or frequency value ``TIMFRQ`` (for :ref:`antype`,HARMIC). ``LSTEP`` + and ``SBSTEP`` should be left blank. + + kimg : int or str + Key for printing real or imaginary solution. Valid only for :ref:`antype`,HARMIC. + + * ``0 (or blank)`` - Print the real solution (default). + + * ``1`` - Print the imaginary solution. + + * ``2`` - Print the amplitude. + + hibeg : str + For cyclic symmetry solutions, print the solutions in the harmonic index solution range + ``HIbeg`` to ``HIend``. Defaults to all harmonic indices (all modes). + + hiend : str + For cyclic symmetry solutions, print the solutions in the harmonic index solution range + ``HIbeg`` to ``HIend``. Defaults to all harmonic indices (all modes). + + matrix : str + Create an APDL Math dense matrix with the name entered on this field (up to 32 characters; for + nomenclature guidelines see `Guidelines for Parameter Names + `_ + ``Matrix`` = blank), no APDL Math matrix is created. + + Notes + ----- + + .. _PRMC_notes: + + :ref:`prmc` prints the modal coordinates (the factors which modes may be multiplied by to obtain + their contribution to the response) at a certain time point (transient analyses) or frequency point + (harmonic analyses). + + The printout contains four columns: the mode number (labelled MODE), the modal frequency (labelled + FREQ), the modal coordinate or mode multiplier (labelled MULT), and the normalized modal coordinate + (labelled NORM). The normalized modal coordinate is the ratio of absolute value of the mode + multiplier divided by the sum of the absolute values of all multipliers listed (at a solution + time/frequency and harmonic index). It may be useful for identifying the dominant modes. Maximum + values of each column are also listed at the end of each report. + + By default, the real part of the modal coordinate values are printed even if the modal coordinates + are complex. + + When ``Matrix`` is specified, an APDL Math dense matrix similar to the one created with the + :ref:`dmat` command is created. If :ref:`prmc` is issued multiple times with the same name entered + on ``Matrix`` or if a matrix with the specified name already exists, the matrix is overwritten. This + matrix contains four to five columns depending on the analysis. The first four columns are the ones + printed by :ref:`prmc`. The fifth column contains the harmonic index for cyclic analysis only. This + matrix can then be used in APDL Math data processing and file handling (See `APDL Math + `_ :ref:`export` + can be issued to export the :ref:`prmc` data to a :file:`.csv` file. + + For transient analyses, a :file:`.rdsp` None file must be available. For harmonic analyses, a + :file:`.rfrq` None file must be available. The content of these files depends on the :ref:`outres` + command settings. Note that the default for mode-superposition transient analysis is to write the + reduced displacement file every 4th substep. For more information, see Command Default in the + :ref:`outres` command description. + + For a cyclic harmonic mode-superposition analysis, use the :ref:`cycfiles` command to identify the + :file:`.rfrq` None and modal :file:`.rst` None files. For other analyses, use the ``FILE`` command + to specify the :file:`.rdsp` or :file:`.rfrq` file. + + This information can also be obtained from the optional :file:`Jobname.mcf` text file (see the + :ref:`trnopt` and :ref:`hropt` commands), and it can be plotted using the :ref:`plmc` command. For + more information on modal coordinates, see `Mode-Superposition Method + `_ + in the `Mechanical APDL Theory Reference + `_ + + **Example Usage** + + .. code:: apdl + + /POST1 + + FILE,,rdsp ! Specify Jobname.rdsp file from a previous MSUP transient analysis ! Print modal + coordinates from the second loadstep and fourth substep PRMC,2,4,,,,,MAT ! also create an APDL Math + matrix called MAT \*EXPORT,MAT,CSV,PRMCFILE.CSV ! Export MAT to a.csv file + """ + command = f"PRMC,{lstep},{sbstep},{timfrq},{kimg},{hibeg},{hiend},{matrix}" + return self.run(command, **kwargs) + + def prnear( + self, + lab: str = "", + opt: str = "", + kcn: str = "", + val1: str = "", + val2: str = "", + val3: str = "", + val4: str = "", + val5: str = "", + val6: str = "", + val7: str = "", + val8: str = "", + val9: str = "", + **kwargs, + ): + r"""Prints the pressure in the near zone exterior to the equivalent source surface. + + Mechanical APDL Command: `PRNEAR `_ + + Parameters + ---------- + lab : str + Print the maximum pressure or sound pressure level: + + * ``POINT`` - at the point (x,y,z) + + * ``SPHERE`` - on the spherical structure + + * ``PATH`` - along the path + + opt : str + * ``PSUM`` - Maximum complex pressure for acoustics. + + * ``PHAS`` - Phase angle of complex pressure for acoustics. + + * ``SPL`` - Sound pressure level for acoustics. + + * ``SPLA`` - A-weighted sound pressure level for acoustics (dBA). + + kcn : str + KCN is the coordinate system reference number. It may be 0 (Cartesian) or any previously defined + local coordinate system number (>10). Defaults to 0. + + val1 : str + For ``Lab`` = POINT: + + * ``VAL1`` - x coordinate value + + * ``VAL2`` - y coordinate value + + * ``VAL3`` - z coordinate value + + * ``VAL4 -, VAL8`` - not used + + * ``VAL9`` - Thickness of model in z direction (defaults to 0). + + For ``LAB`` = SPHERE: + + * ``VAL1`` - Radius of spherical surface in spherical coordinate system. + + * ``VAL2`` - Starting φ angle (degree) in the spherical coordinate system. Defaults to 0. + + * ``VAL3`` - Ending φ angle (degree) in the spherical coordinate system. Defaults to 0. + + * ``VAL4`` - Number of divisions between the starting and ending φ angles for data + computations. Defaults to 0. + + * ``VAL5`` - Starting θ angle (degrees) in the spherical coordinate system. Defaults to 0 in 3D + and 90 in 2D extension. + + * ``VAL6`` - Ending θ angle (degrees) in the spherical coordinate system. Defaults to 0 in 3D + and 90 in 2D extension. + + * ``VAL7`` - Number of divisions between the starting and ending θ angles for data + computations. Defaults to 0. + + * ``VAL8`` - Reference rms sound pressure. Defaults to 2x10 :sup:`-5` Pa. + + * ``VAL9`` - Thickness of 2D model extension in z direction (defaults to 0). + + For ``Lab`` = :ref:`path`, :ref:`prnear` computes the pressure for the path data points for the path + currently defined by the :ref:`path` and :ref:`ppath` commands. + + val2 : str + For ``Lab`` = POINT: + + * ``VAL1`` - x coordinate value + + * ``VAL2`` - y coordinate value + + * ``VAL3`` - z coordinate value + + * ``VAL4 -, VAL8`` - not used + + * ``VAL9`` - Thickness of model in z direction (defaults to 0). + + For ``LAB`` = SPHERE: + + * ``VAL1`` - Radius of spherical surface in spherical coordinate system. + + * ``VAL2`` - Starting φ angle (degree) in the spherical coordinate system. Defaults to 0. + + * ``VAL3`` - Ending φ angle (degree) in the spherical coordinate system. Defaults to 0. + + * ``VAL4`` - Number of divisions between the starting and ending φ angles for data + computations. Defaults to 0. + + * ``VAL5`` - Starting θ angle (degrees) in the spherical coordinate system. Defaults to 0 in 3D + and 90 in 2D extension. + + * ``VAL6`` - Ending θ angle (degrees) in the spherical coordinate system. Defaults to 0 in 3D + and 90 in 2D extension. + + * ``VAL7`` - Number of divisions between the starting and ending θ angles for data + computations. Defaults to 0. + + * ``VAL8`` - Reference rms sound pressure. Defaults to 2x10 :sup:`-5` Pa. + + * ``VAL9`` - Thickness of 2D model extension in z direction (defaults to 0). + + For ``Lab`` = :ref:`path`, :ref:`prnear` computes the pressure for the path data points for the path + currently defined by the :ref:`path` and :ref:`ppath` commands. + + val3 : str + For ``Lab`` = POINT: + + * ``VAL1`` - x coordinate value + + * ``VAL2`` - y coordinate value + + * ``VAL3`` - z coordinate value + + * ``VAL4 -, VAL8`` - not used + + * ``VAL9`` - Thickness of model in z direction (defaults to 0). + + For ``LAB`` = SPHERE: + + * ``VAL1`` - Radius of spherical surface in spherical coordinate system. + + * ``VAL2`` - Starting φ angle (degree) in the spherical coordinate system. Defaults to 0. + + * ``VAL3`` - Ending φ angle (degree) in the spherical coordinate system. Defaults to 0. + + * ``VAL4`` - Number of divisions between the starting and ending φ angles for data + computations. Defaults to 0. + + * ``VAL5`` - Starting θ angle (degrees) in the spherical coordinate system. Defaults to 0 in 3D + and 90 in 2D extension. + + * ``VAL6`` - Ending θ angle (degrees) in the spherical coordinate system. Defaults to 0 in 3D + and 90 in 2D extension. + + * ``VAL7`` - Number of divisions between the starting and ending θ angles for data + computations. Defaults to 0. + + * ``VAL8`` - Reference rms sound pressure. Defaults to 2x10 :sup:`-5` Pa. + + * ``VAL9`` - Thickness of 2D model extension in z direction (defaults to 0). + + For ``Lab`` = :ref:`path`, :ref:`prnear` computes the pressure for the path data points for the path + currently defined by the :ref:`path` and :ref:`ppath` commands. + + val4 : str + For ``Lab`` = POINT: + + * ``VAL1`` - x coordinate value + + * ``VAL2`` - y coordinate value + + * ``VAL3`` - z coordinate value + + * ``VAL4 -, VAL8`` - not used + + * ``VAL9`` - Thickness of model in z direction (defaults to 0). + + For ``LAB`` = SPHERE: + + * ``VAL1`` - Radius of spherical surface in spherical coordinate system. + + * ``VAL2`` - Starting φ angle (degree) in the spherical coordinate system. Defaults to 0. + + * ``VAL3`` - Ending φ angle (degree) in the spherical coordinate system. Defaults to 0. + + * ``VAL4`` - Number of divisions between the starting and ending φ angles for data + computations. Defaults to 0. + + * ``VAL5`` - Starting θ angle (degrees) in the spherical coordinate system. Defaults to 0 in 3D + and 90 in 2D extension. + + * ``VAL6`` - Ending θ angle (degrees) in the spherical coordinate system. Defaults to 0 in 3D + and 90 in 2D extension. + + * ``VAL7`` - Number of divisions between the starting and ending θ angles for data + computations. Defaults to 0. + + * ``VAL8`` - Reference rms sound pressure. Defaults to 2x10 :sup:`-5` Pa. + + * ``VAL9`` - Thickness of 2D model extension in z direction (defaults to 0). + + For ``Lab`` = :ref:`path`, :ref:`prnear` computes the pressure for the path data points for the path + currently defined by the :ref:`path` and :ref:`ppath` commands. + + val5 : str + For ``Lab`` = POINT: + + * ``VAL1`` - x coordinate value + + * ``VAL2`` - y coordinate value + + * ``VAL3`` - z coordinate value + + * ``VAL4 -, VAL8`` - not used + + * ``VAL9`` - Thickness of model in z direction (defaults to 0). + + For ``LAB`` = SPHERE: + + * ``VAL1`` - Radius of spherical surface in spherical coordinate system. + + * ``VAL2`` - Starting φ angle (degree) in the spherical coordinate system. Defaults to 0. + + * ``VAL3`` - Ending φ angle (degree) in the spherical coordinate system. Defaults to 0. + + * ``VAL4`` - Number of divisions between the starting and ending φ angles for data + computations. Defaults to 0. + + * ``VAL5`` - Starting θ angle (degrees) in the spherical coordinate system. Defaults to 0 in 3D + and 90 in 2D extension. + + * ``VAL6`` - Ending θ angle (degrees) in the spherical coordinate system. Defaults to 0 in 3D + and 90 in 2D extension. + + * ``VAL7`` - Number of divisions between the starting and ending θ angles for data + computations. Defaults to 0. + + * ``VAL8`` - Reference rms sound pressure. Defaults to 2x10 :sup:`-5` Pa. + + * ``VAL9`` - Thickness of 2D model extension in z direction (defaults to 0). + + For ``Lab`` = :ref:`path`, :ref:`prnear` computes the pressure for the path data points for the path + currently defined by the :ref:`path` and :ref:`ppath` commands. + + val6 : str + For ``Lab`` = POINT: + + * ``VAL1`` - x coordinate value + + * ``VAL2`` - y coordinate value + + * ``VAL3`` - z coordinate value + + * ``VAL4 -, VAL8`` - not used + + * ``VAL9`` - Thickness of model in z direction (defaults to 0). + + For ``LAB`` = SPHERE: + + * ``VAL1`` - Radius of spherical surface in spherical coordinate system. + + * ``VAL2`` - Starting φ angle (degree) in the spherical coordinate system. Defaults to 0. + + * ``VAL3`` - Ending φ angle (degree) in the spherical coordinate system. Defaults to 0. + + * ``VAL4`` - Number of divisions between the starting and ending φ angles for data + computations. Defaults to 0. + + * ``VAL5`` - Starting θ angle (degrees) in the spherical coordinate system. Defaults to 0 in 3D + and 90 in 2D extension. + + * ``VAL6`` - Ending θ angle (degrees) in the spherical coordinate system. Defaults to 0 in 3D + and 90 in 2D extension. + + * ``VAL7`` - Number of divisions between the starting and ending θ angles for data + computations. Defaults to 0. + + * ``VAL8`` - Reference rms sound pressure. Defaults to 2x10 :sup:`-5` Pa. + + * ``VAL9`` - Thickness of 2D model extension in z direction (defaults to 0). + + For ``Lab`` = :ref:`path`, :ref:`prnear` computes the pressure for the path data points for the path + currently defined by the :ref:`path` and :ref:`ppath` commands. + + val7 : str + For ``Lab`` = POINT: + + * ``VAL1`` - x coordinate value + + * ``VAL2`` - y coordinate value + + * ``VAL3`` - z coordinate value + + * ``VAL4 -, VAL8`` - not used + + * ``VAL9`` - Thickness of model in z direction (defaults to 0). + + For ``LAB`` = SPHERE: + + * ``VAL1`` - Radius of spherical surface in spherical coordinate system. + + * ``VAL2`` - Starting φ angle (degree) in the spherical coordinate system. Defaults to 0. + + * ``VAL3`` - Ending φ angle (degree) in the spherical coordinate system. Defaults to 0. + + * ``VAL4`` - Number of divisions between the starting and ending φ angles for data + computations. Defaults to 0. + + * ``VAL5`` - Starting θ angle (degrees) in the spherical coordinate system. Defaults to 0 in 3D + and 90 in 2D extension. + + * ``VAL6`` - Ending θ angle (degrees) in the spherical coordinate system. Defaults to 0 in 3D + and 90 in 2D extension. + + * ``VAL7`` - Number of divisions between the starting and ending θ angles for data + computations. Defaults to 0. + + * ``VAL8`` - Reference rms sound pressure. Defaults to 2x10 :sup:`-5` Pa. + + * ``VAL9`` - Thickness of 2D model extension in z direction (defaults to 0). + + For ``Lab`` = :ref:`path`, :ref:`prnear` computes the pressure for the path data points for the path + currently defined by the :ref:`path` and :ref:`ppath` commands. + + val8 : str + For ``Lab`` = POINT: + + * ``VAL1`` - x coordinate value + + * ``VAL2`` - y coordinate value + + * ``VAL3`` - z coordinate value + + * ``VAL4 -, VAL8`` - not used + + * ``VAL9`` - Thickness of model in z direction (defaults to 0). + + For ``LAB`` = SPHERE: + + * ``VAL1`` - Radius of spherical surface in spherical coordinate system. + + * ``VAL2`` - Starting φ angle (degree) in the spherical coordinate system. Defaults to 0. + + * ``VAL3`` - Ending φ angle (degree) in the spherical coordinate system. Defaults to 0. + + * ``VAL4`` - Number of divisions between the starting and ending φ angles for data + computations. Defaults to 0. + + * ``VAL5`` - Starting θ angle (degrees) in the spherical coordinate system. Defaults to 0 in 3D + and 90 in 2D extension. + + * ``VAL6`` - Ending θ angle (degrees) in the spherical coordinate system. Defaults to 0 in 3D + and 90 in 2D extension. + + * ``VAL7`` - Number of divisions between the starting and ending θ angles for data + computations. Defaults to 0. + + * ``VAL8`` - Reference rms sound pressure. Defaults to 2x10 :sup:`-5` Pa. + + * ``VAL9`` - Thickness of 2D model extension in z direction (defaults to 0). + + For ``Lab`` = :ref:`path`, :ref:`prnear` computes the pressure for the path data points for the path + currently defined by the :ref:`path` and :ref:`ppath` commands. + + val9 : str + For ``Lab`` = POINT: + + * ``VAL1`` - x coordinate value + + * ``VAL2`` - y coordinate value + + * ``VAL3`` - z coordinate value + + * ``VAL4 -, VAL8`` - not used + + * ``VAL9`` - Thickness of model in z direction (defaults to 0). + + For ``LAB`` = SPHERE: + + * ``VAL1`` - Radius of spherical surface in spherical coordinate system. + + * ``VAL2`` - Starting φ angle (degree) in the spherical coordinate system. Defaults to 0. + + * ``VAL3`` - Ending φ angle (degree) in the spherical coordinate system. Defaults to 0. + + * ``VAL4`` - Number of divisions between the starting and ending φ angles for data + computations. Defaults to 0. + + * ``VAL5`` - Starting θ angle (degrees) in the spherical coordinate system. Defaults to 0 in 3D + and 90 in 2D extension. + + * ``VAL6`` - Ending θ angle (degrees) in the spherical coordinate system. Defaults to 0 in 3D + and 90 in 2D extension. + + * ``VAL7`` - Number of divisions between the starting and ending θ angles for data + computations. Defaults to 0. + + * ``VAL8`` - Reference rms sound pressure. Defaults to 2x10 :sup:`-5` Pa. + + * ``VAL9`` - Thickness of 2D model extension in z direction (defaults to 0). + + For ``Lab`` = :ref:`path`, :ref:`prnear` computes the pressure for the path data points for the path + currently defined by the :ref:`path` and :ref:`ppath` commands. + + Notes + ----- + + .. _PRNEAR_notes: + + The command uses the equivalent source principle to calculate the pressure in the near zone exterior + to the equivalent source surface (flagged with the Maxwell surface flag in the preprocessor) for one + of the following locations: + + * A point X, Y, Z in the KCN coordinate system + + * A spherical surface in the KCN coordinate system + + * A path defined by the :ref:`path` and :ref:`ppath` commands + + To list the pressure results for a path, use the :ref:`prpath` command. See :ref:`hfsym` command for + the model symmetry. + + To retrieve saved equivalent source data, issue the :ref:`set`, ``Lstep``, ``Sbstep``,,REAL command. + """ + command = f"PRNEAR,{lab},{opt},{kcn},{val1},{val2},{val3},{val4},{val5},{val6},{val7},{val8},{val9}" + return self.run(command, **kwargs) + + def reswrite(self, fname: str = "", cflag: int | str = "", **kwargs): + r"""Appends results data from the database to a results file. + + Mechanical APDL Command: `RESWRITE `_ + + Parameters + ---------- + 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 extension varies as follows: + + * :file:`.rst` for structural, fluid, or coupled-field analyses + * :file:`.rth` for thermal or electrical analyses + * :file:`.rmg` for magnetic analyses + + cflag : int or str + * ``0`` - The complex results flag is set to 0 in the results file header. This is the default + option. + + * ``1`` - The complex results flag is set to 1 in the results file header. + + Notes + ----- + + .. _RESWRITE_notes: + + The :ref:`reswrite` command appends a data set to the specified file by writing the results data + currently in the database. If the intended results file does not exist, it will be created and will + include the geometry records. The current load step, substep, and time (or frequency) value are + maintained. All data (summable and nonsummable) are written. + + When complex results are appended, ``cFlag`` must be set to 1 so that the header is consistent with + the results written on the file. + + The command is primarily intended for use in a top-down substructuring analysis, where the full + model is resumed and the results data read from the `use pass + `_ + results file ( :ref:`set` ), and subsequently from all substructure `expansion pass + `_ + results files ( :ref:`append` ). The full set of data in memory can then be written out via the + :ref:`reswrite` command to create a complete results file (as though you had run a nonsubstructured + analysis). + + The :ref:`reswrite` command can also be used to write a global results file for a distributed-memory + parallel ( DMP ) solution. This should only be necessary if the :ref:`rescombine` command was used + to combine results from local results files into the database. The :ref:`reswrite` command can then + be used to write the combined results into a new results file. This new results file will + essentially contain the current set of results data for the entire (that is, global) model. + """ + command = f"RESWRITE,{fname},,,,{cflag}" + return self.run(command, **kwargs) + + def rmflvec(self, **kwargs): + r"""Writes eigenvectors of fluid nodes to a file for use in damping parameter extraction. + + Mechanical APDL Command: `RMFLVEC `_ + + Notes + ----- + + .. _RMFLVEC_notes: + + :ref:`rmflvec` extracts the modal information from the modal results file for all nodes specified in + a node component called 'FLUN'. This component should include all nodes which are located at the + fluid-structural interface. Mode shapes, element normal orientation, and a scaling factor are + computed and stored in a file :file:`Jobname.EFL`. For damping parameter extraction, use the + :ref:`dmpext` command macro. See for more information on thin film analyses. + + ``FLUID136`` and ``FLUID138`` are used to model the fluid interface. Both the structural and fluid + element types must be active. The fluid interface nodes must be grouped into a component 'FLUN'. A + results file of the last modal analysis must be available. + """ + command = "RMFLVEC" + return self.run(command, **kwargs) + + def rsplit( + self, + option: str = "", + label: str = "", + name1: str = "", + name2: str = "", + name3: str = "", + name4: str = "", + name5: str = "", + name6: str = "", + name7: str = "", + name8: str = "", + name9: str = "", + name10: str = "", + name11: str = "", + name12: str = "", + name13: str = "", + name14: str = "", + name15: str = "", + name16: str = "", + **kwargs, + ): + r"""Creates one or more results file(s) from the current results file based on subsets of elements. + + Mechanical APDL Command: `RSPLIT `_ + + **Command default:** + Write all data available for the element subset. + + Parameters + ---------- + option : str + Specify which results to include for the subset of elements. + + * ``ALL`` - Write all nodal and element results based on the subset of elements (default). + + * ``EXT`` - Write only the nodal and element results that are on the exterior surface of the element + subset. The results data will be averaged as in PowerGraphics (see :ref:`avres` ) when this results + file is brought into POST1. Only valid for solid elements. + + label : str + Define where the element subset is coming from. + + * ``ALL`` - Use all selected element components ( :ref:`cmsel` ) (default). + + * ``ESEL`` - Use the currently selected ( :ref:`esel` ) set of elements. ``Name1`` defines the + results file name. + + * ``LIST`` - Use ``Name1`` to ``Name16`` to list the element component and/or assembly names (that + contain element components). + + name1 : str + Up to 16 element component and/or assembly names (that contain element components). + + name2 : str + Up to 16 element component and/or assembly names (that contain element components). + + name3 : str + Up to 16 element component and/or assembly names (that contain element components). + + name4 : str + Up to 16 element component and/or assembly names (that contain element components). + + name5 : str + Up to 16 element component and/or assembly names (that contain element components). + + name6 : str + Up to 16 element component and/or assembly names (that contain element components). + + name7 : str + Up to 16 element component and/or assembly names (that contain element components). + + name8 : str + Up to 16 element component and/or assembly names (that contain element components). + + name9 : str + Up to 16 element component and/or assembly names (that contain element components). + + name10 : str + Up to 16 element component and/or assembly names (that contain element components). + + name11 : str + Up to 16 element component and/or assembly names (that contain element components). + + name12 : str + Up to 16 element component and/or assembly names (that contain element components). + + name13 : str + Up to 16 element component and/or assembly names (that contain element components). + + name14 : str + Up to 16 element component and/or assembly names (that contain element components). + + name15 : str + Up to 16 element component and/or assembly names (that contain element components). + + name16 : str + Up to 16 element component and/or assembly names (that contain element components). + + Notes + ----- + Results files will be named based on the element component or assembly name, for example, + :file:`Cname.rst`, except for the ESEL option, for which you must specify the results file name (no + extension) using the ``Name1`` field. Note that the :file:`.rst` filename will be written in all + uppercase letters ( :file:`CNAME.rst` ) (unless using the ESEL option); when you read the file, you + must specify the filename using all uppercase letters (that is, :file:`file`,CNAME). You may repeat + the :ref:`rsplit` command as often as needed. All results sets on the results file are processed. + Use :ref:`aux3` to produce a results file with just a subset of the results sets. + + Use :ref:`inres` to limit the results data written to the results files. + + The subset geometry is also written so that no database file is required to postprocess the subset + results files. You must not resume any database when postprocessing one of these results files. The + input results file must have geometry written to it (that is, do not use :ref:`config`,NORSTGM,1). + + Applied forces and reaction forces are not apportioned if their nodes are shared by multiple element + subsets. Their full values are written to each results file. + + Each results file renumbers its nodes and elements starting with 1. + + This feature is useful when working with large models. For more information on the advantages and + uses of the :ref:`rsplit` command, see `Splitting Large Results Files + `_ in the + `Basic Analysis Guide + `_. + """ + command = f"RSPLIT,{option},{label},{name1},{name2},{name3},{name4},{name5},{name6},{name7},{name8},{name9},{name10},{name11},{name12},{name13},{name14},{name15},{name16}" + return self.run(command, **kwargs) + + def rstmac( + self, + file1: str = "", + lstep1: str = "", + sbstep1: str = "", + file2: str = "", + lstep2: str = "", + sbstep2: str = "", + maclim: str = "", + cname: str = "", + keyprint: int | str = "", + **kwargs, + ): + r"""Calculates modal assurance criterion (MAC/FRF) and matches nodal solutions from two results files or + from one results file and one universal format file. + + Mechanical APDL Command: `RSTMAC `_ + + Parameters + ---------- + file1 : str + File name ( 248 characters maximum) corresponding to the first results file ( :file:`.rst` or + :file:`.rstp` file). If the file name does not contain the extension, it defaults to + :file:`rst`. + + lstep1 : str + Load step number of the results to be read in ``File1``. + + * ``N`` - Reads load step ``N``. Defaults to 1. + + sbstep1 : str + Substep number of the results to be read in ``File1``. + + * ``N`` - Reads substep ``N``. Only valid for MAC. + + * ``All`` - Reads all substeps. This value is the default. + + file2 : str + File name ( 248 characters maximum) corresponding to the second file ( :file:`.rst`, + :file:`.rstp`, or :file:`.unv` file). If the file name does not contain the extension, it + defaults to :file:`rst`. + + lstep2 : str + Load step number of the results to be read in ``File2``. + + * ``N`` - Reads load step ``N``. Defaults to 1. + + sbstep2 : str + Substep number of the results to be read in ``File2``. + + * ``N`` - Reads substep ``N``. Only valid for MAC. + + * ``All`` - Reads all substeps. This value is the default. + + maclim : str + Smallest acceptable criterion value. Must be :math:`equation not available` 0 and + :math:`equation not available` 1. The default value is 0.90. + + cname : str + Name of the component from the first file ( ``File1`` ). The component must be based on nodes. + If unspecified, all nodes are matched and used for MAC calculations. If a component name is + specified, only nodes included in the specified component are used. Not applicable to node + mapping ( ``Option`` = NODMAP on :ref:`macopt` ). + + keyprint : int or str + Printout options: + + * ``0`` - Printout matched solutions table. This value is the default. + + * ``1`` - Printout matched solutions table and full MAC table. + + * ``2`` - Printout matched solutions table, full MAC table and matched nodes table. + + Notes + ----- + The :ref:`rstmac` command allows the comparison of the solutions from either: + + * Two different results files. Valid only for MAC calculations. + + * One result file ( :file:`.rst` ) and one universal format file ( :file:`.unv` ). + + Either the modal assurance criterion (MAC) or the frequency response function (FRF) correlation + method is used. (For more details see `POST1 - Modal Assurance Criterion (MAC) + `_ + `POST1 - Frequency response function correlation + `_ + + The meshes read from ``File1`` and ``File2`` may be different. The nodes of ``File1`` are matched + with the nodes of ``File2`` based on either node location (default) or node number. The solutions + are compared for the identified pair of matched nodes. The nodes can also be mapped and the + solutions interpolated from ``File1``. See the :ref:`macopt` command for all options. + + Units and coordinate systems must be the same for both models. + + Results may be real or complex; however, if results in ``File1`` have a different type than results + in ``File2``, only the real parts of the solutions are taken into account in MAC calculations. The + analysis type can be arbitrary for MAC while only harmonic analysis is supported for FRF criteria + calculations. + + Non-structural degrees of freedom can be considered. Degrees of freedom can vary between ``File1`` + and ``File2``, but at least one common degree of freedom must exist. + + The solutions read on the results files are not all written to the database; therefore, subsequent + plotting or printing of solutions is not possible. A :ref:`set` command must be issued after the + :ref:`rstmac` command to post-process each solution. + + The corresponding database file ( :file:`.db` ) for :file:`File1` on :ref:`rstmac` must be resumed + before running the command in the following cases: + + * A component ( ``Cname`` ) is used on :ref:`rstmac`. + + * The nodes are mapped ( :ref:`macopt`,NODMAP,YES). + + * The nodes are matched using a relative tolerance ( :ref:`macopt`,RELTOLN). + + :ref:`rstmac` comparison on cyclic symmetry analysis works only if the number of sectors on + ``File1`` and ``File2`` are the same, and the database is saved after the solution is finished. + Also, a comparison cannot be made between cyclic symmetry results and the full 360 degree model + results ( ``File1`` - cyclic solution, ``File2`` - full 360 degree model solution). Comparing cyclic + symmetry solutions written on a selected set of nodes ( :ref:`outres` ) is not supported. + + The modal assurance criterion values can be retrieved as parameters using the :ref:`get` command ( + ``Entity`` = :ref:`rstmac` ). + + FRF correlation is only supported for the comparison of an :file:`.rst` and a :file:`.unv` file. All + substeps are considered for both files to define the frequency domain for criteria calculations. The + printout options consist of listing the table of the criterion results for each frequency in the + frequency domain ( ``KeyPrint`` = 0, 1, or 2) and the matched nodes table ( ``KeyPrint`` = 2). + + **Example Usage** + + .. _RSTMAC_example: + + For a detailed discussion on using RSTMAC with examples see `Comparing Nodal Solutions From Two + Models (RSTMAC) + `_ RSTMAC ) in + the `Basic Analysis Guide + `_. + """ + command = f"RSTMAC,{file1},{lstep1},{sbstep1},{file2},{lstep2},{sbstep2},,{maclim},{cname},{keyprint}" + return self.run(command, **kwargs) + + def slashexpand( + self, + nrepeat1: str = "", + type1: str = "", + method1: str = "", + dx1: str = "", + dy1: str = "", + dz1: str = "", + nrepeat2: str = "", + type2: str = "", + method2: str = "", + dx2: str = "", + dy2: str = "", + dz2: str = "", + nrepeat3: str = "", + type3: str = "", + method3: str = "", + dx3: str = "", + dy3: str = "", + dz3: str = "", + **kwargs, + ): + r"""Allows the creation of a larger graphic display than represented by the actual finite element + analysis model. + + Mechanical APDL Command: `/EXPAND `_ + + Parameters + ---------- + nrepeat1 : str + The number of repetitions required for the element pattern. The default is 0 (no expansion). + + type1 : str + The type of expansion requested. + + * ``RECT`` - Causes a Cartesian transformation of DX, DY, and DZ for each pattern (default). + + * ``POLAR`` - Causes a polar transformation of DR, D-Theta and DZ for each pattern. + + * ``AXIS`` - Causes 2D axisymmetric expansion (that is, rotates a 2D model created in the X-Y plane + about the Y axis to create a 3D model). + + * ``LRECT`` - Causes a Cartesian transformation of DX, DY, and DZ for each pattern about the current + local coordinate system (specified via the :ref:`csys` command). + + * ``LPOLAR`` - Causes a polar transformation of DR, D-Theta, and DZ for each pattern about the local + coordinate system (specified via the :ref:`csys` command). + + method1 : str + The method by which the pattern is repeated. + + * ``FULL`` - Causes a normal repeat of the pattern (default). + + * ``HALF`` - Uses a symmetry transformation for alternate repeats (to produce an image of a complete + circular gear from the image of half a tooth, for example). + + dx1 : str + The Cartesian or polar increments between the repeated patterns. Also determines the reflection + plane. Reflection is about the plane defined by the normal vector (DX, DY, DZ). If you want no + translation, specify a small nonzero value. For a half-image expansion, the increment DX, DY, or + DZ is doubled so that POLAR,HALF,,45 produces full images on 90° centers, and RECT,HALF,,1 + produces full images on 2-meter centers. + + dy1 : str + The Cartesian or polar increments between the repeated patterns. Also determines the reflection + plane. Reflection is about the plane defined by the normal vector (DX, DY, DZ). If you want no + translation, specify a small nonzero value. For a half-image expansion, the increment DX, DY, or + DZ is doubled so that POLAR,HALF,,45 produces full images on 90° centers, and RECT,HALF,,1 + produces full images on 2-meter centers. + + dz1 : str + The Cartesian or polar increments between the repeated patterns. Also determines the reflection + plane. Reflection is about the plane defined by the normal vector (DX, DY, DZ). If you want no + translation, specify a small nonzero value. For a half-image expansion, the increment DX, DY, or + DZ is doubled so that POLAR,HALF,,45 produces full images on 90° centers, and RECT,HALF,,1 + produces full images on 2-meter centers. + + nrepeat2 : str + The number of repetitions required for the element pattern. The default is 0 (no expansion). + + type2 : str + The type of expansion requested. + + * ``RECT`` - Causes a Cartesian transformation of DX, DY, and DZ for each pattern (default). + + * ``POLAR`` - Causes a polar transformation of DR, D-Theta and DZ for each pattern. + + * ``AXIS`` - Causes 2D axisymmetric expansion (that is, rotates a 2D model created in the X-Y plane + about the Y axis to create a 3D model). + + * ``LRECT`` - Causes a Cartesian transformation of DX, DY, and DZ for each pattern about the current + local coordinate system (specified via the :ref:`csys` command). + + * ``LPOLAR`` - Causes a polar transformation of DR, D-Theta, and DZ for each pattern about the local + coordinate system (specified via the :ref:`csys` command). + + method2 : str + The method by which the pattern is repeated. + + * ``FULL`` - Causes a normal repeat of the pattern (default). + + * ``HALF`` - Uses a symmetry transformation for alternate repeats (to produce an image of a complete + circular gear from the image of half a tooth, for example). + + dx2 : str + The Cartesian or polar increments between the repeated patterns. Also determines the reflection + plane. Reflection is about the plane defined by the normal vector (DX, DY, DZ). If you want no + translation, specify a small nonzero value. For a half-image expansion, the increment DX, DY, or + DZ is doubled so that POLAR,HALF,,45 produces full images on 90° centers, and RECT,HALF,,1 + produces full images on 2-meter centers. + + dy2 : str + The Cartesian or polar increments between the repeated patterns. Also determines the reflection + plane. Reflection is about the plane defined by the normal vector (DX, DY, DZ). If you want no + translation, specify a small nonzero value. For a half-image expansion, the increment DX, DY, or + DZ is doubled so that POLAR,HALF,,45 produces full images on 90° centers, and RECT,HALF,,1 + produces full images on 2-meter centers. + + dz2 : str + The Cartesian or polar increments between the repeated patterns. Also determines the reflection + plane. Reflection is about the plane defined by the normal vector (DX, DY, DZ). If you want no + translation, specify a small nonzero value. For a half-image expansion, the increment DX, DY, or + DZ is doubled so that POLAR,HALF,,45 produces full images on 90° centers, and RECT,HALF,,1 + produces full images on 2-meter centers. + + nrepeat3 : str + The number of repetitions required for the element pattern. The default is 0 (no expansion). + + type3 : str + The type of expansion requested. + + * ``RECT`` - Causes a Cartesian transformation of DX, DY, and DZ for each pattern (default). + + * ``POLAR`` - Causes a polar transformation of DR, D-Theta and DZ for each pattern. + + * ``AXIS`` - Causes 2D axisymmetric expansion (that is, rotates a 2D model created in the X-Y plane + about the Y axis to create a 3D model). + + * ``LRECT`` - Causes a Cartesian transformation of DX, DY, and DZ for each pattern about the current + local coordinate system (specified via the :ref:`csys` command). + + * ``LPOLAR`` - Causes a polar transformation of DR, D-Theta, and DZ for each pattern about the local + coordinate system (specified via the :ref:`csys` command). + + method3 : str + The method by which the pattern is repeated. + + * ``FULL`` - Causes a normal repeat of the pattern (default). + + * ``HALF`` - Uses a symmetry transformation for alternate repeats (to produce an image of a complete + circular gear from the image of half a tooth, for example). + + dx3 : str + The Cartesian or polar increments between the repeated patterns. Also determines the reflection + plane. Reflection is about the plane defined by the normal vector (DX, DY, DZ). If you want no + translation, specify a small nonzero value. For a half-image expansion, the increment DX, DY, or + DZ is doubled so that POLAR,HALF,,45 produces full images on 90° centers, and RECT,HALF,,1 + produces full images on 2-meter centers. + + dy3 : str + The Cartesian or polar increments between the repeated patterns. Also determines the reflection + plane. Reflection is about the plane defined by the normal vector (DX, DY, DZ). If you want no + translation, specify a small nonzero value. For a half-image expansion, the increment DX, DY, or + DZ is doubled so that POLAR,HALF,,45 produces full images on 90° centers, and RECT,HALF,,1 + produces full images on 2-meter centers. + + dz3 : str + The Cartesian or polar increments between the repeated patterns. Also determines the reflection + plane. Reflection is about the plane defined by the normal vector (DX, DY, DZ). If you want no + translation, specify a small nonzero value. For a half-image expansion, the increment DX, DY, or + DZ is doubled so that POLAR,HALF,,45 produces full images on 90° centers, and RECT,HALF,,1 + produces full images on 2-meter centers. + + Notes + ----- + + .. _s-EXPAND_notes: + + You can use the :ref:`slashexpand` command to perform up to three symmetry expansions at once (that + is, X, Y, and Z which is equal to going from a 1/8 model to a full model). Polar expansions allow + you to expand a wheel section into a half wheel, then into the half section, and then into the + whole. + + The command displays elements/results when you issue the :ref:`eplot` command or postprocessing + commands. + + The command works on all element and result displays, except as noted below. As the graphic display + is created, the elements (and results) are repeated as many times as necessary, expanding the + geometry and, if necessary, the displacements and stresses. + + Derived results are not supported. + + The :ref:`slashexpand` command has the following limitations: + + * It does not support solid model entities. + + * POLAR, FULL or HALF operations are meaningful only in global cylindrical systems and are + unaffected by the :ref:`rsys` or :ref:`dsys` commands. Cartesian symmetry or unsymmetric + operations also occur about the global Cartesian system. + + * It does not average nodal results across sector boundaries, even for averaged plots (such as those + obtained via the :ref:`plnsol` command). + + * Axisymmetric harmonic element results are not supported for ``Type`` = AXIS. + + The :ref:`slashexpand` command differs significantly from the :ref:`expand` command in several + respects: + + * The uses of :ref:`slashexpand` are of a more general nature, whereas the :ref:`expand` command is + intended primarily to expand modal cyclic symmetry results. + + * :ref:`slashexpand` does not change the database as does the :ref:`expand` command. + + * You cannot print results displayed via :ref:`slashexpand`. + + """ + command = f"/EXPAND,{nrepeat1},{type1},{method1},{dx1},{dy1},{dz1},{nrepeat2},{type2},{method2},{dx2},{dy2},{dz2},{nrepeat3},{type3},{method3},{dx3},{dy3},{dz3}" + return self.run(command, **kwargs) + + def spmwrite( + self, + method: str = "", + nmode: str = "", + inputs: str = "", + inputlabels: str = "", + outputs: str = "", + outputlabels: str = "", + nic: str = "", + velacckey: str = "", + fileformat: int | str = "", + **kwargs, + ): + r"""Calculates the state-space matrices and writes them to the SPM file. + + Mechanical APDL Command: `SPMWRITE `_ + + Parameters + ---------- + method : str + Reduction method for the calculation of the state-space matrices. + + * ``MODAL`` - Method based on modal analysis results from LANB, LANPCG, SNODE, or SUBSP eigensolver + (default). + + nmode : str + Number of modes to be used. Defaults to all modes. + + inputs : str + Definition of the inputs. Defaults to all load vectors on the MODE file. + + If an integer is entered, it specifies the number of load vectors from the MODE file used for + the definition of the inputs. The first ``Inputs`` load vectors are used. + + If ``Inputs`` is an array parameter, the first column is the node number and the second column + is the structural degree of freedom (1=UX, 2=UY, 3=UZ, 4=ROTX, 5=ROTY, 6=ROTZ) indicating input + points. The number of rows in the array parameter is equal to the number of inputs. + + inputlabels : str + Definition of the input labels. Defaults to the load vector numbers or input definition (node + and degree of freedom array parameter), depending on the ``Inputs`` specification. + + If a character array parameter is entered (Type=CHAR in the :ref:`dim` command), each 8 + character string represents an input label. Only valid when ``Inputs`` is an array parameter + + outputs : str + Definition of the outputs. Defaults to the inputs. + + If an array parameter is entered, the first column is the node number and the second column is + the structural degree of freedom (1=UX, 2=UY, 3=UZ, 4=ROTX, 5=ROTY, 6=ROTZ) of the output + points. The number of rows in the array parameter is equal to the number of outputs. + + outputlabels : str + Definition of the output labels. Defaults to the output definition (node and degree of freedom) + if used, else defaults to the ``InputLabels``. + + If a character array parameter is entered (Type=CHAR in the \*DIM command), each 8 character + string represents an output label. + + nic : str + Load vector on the ``MODE`` file used for the calculation of the initial conditions. Defaults to + no initial condition. + + velacckey : str + Output velocities and accelerations key. + + * ``OFF`` - Output displacements only (default). + + * ``ON`` - Output displacements, velocities and accelerations. + + fileformat : int or str + The format of the SPM file. + + * ``0`` - Dense format. + + * ``1`` - Matrix Market Exchange format (non-zero terms only). + + * ``2`` - Twin Builder SML format without reference (default). + + * ``3`` - Twin Builder SML format with common reference. + + * ``4`` - Twin Builder SML format with independent references. + + Notes + ----- + + .. _SPMWRITE_notes: + + The SPMWRITE generates the file :file:`Jobname.SPM` containing the state-space matrices and other + information. + + The following applies to the SML formats (FileFormat = 2, 3, and 4): + + * For conservative systems where the outputs are equal to the inputs ( ``Outputs`` is left blank): + + * The labels for the inputs ( ``InputLabels`` ) are required. + + * The ``Inputs`` must use the array parameter option so that the input degrees of freedom (DOFs) are + known. + + * For non-conservative systems where the outputs are not equal to the inputs: + + * The labels for the outputs ( ``OutputLabels`` ) are required. + + * The file formats with references ( ``FileFormat`` = 3 and 4) do not apply. + + * Velocity and acceleration results are not included in the state-space matrices calculation + (VelAccKey = OFF) + + * File format with common reference (FileFormat = 3) does not apply if the inputs are based on DOFs + of a different nature. All input DOFs must be either all rotational or all translational and not a + mix of the two. + + * A graphics file ( :file:`Jobname_SPM.PNG` ) is generated. It contains an element plot of the + model. + + For more details about the reduction method and the generation of the state-space matrices, see + `Reduced-Order Modeling for State-Space Matrices Export + `_ + + For examples of the command usage, see `State-Space Matrices Export + `_ + """ + command = f"SPMWRITE,{method},{nmode},{inputs},{inputlabels},{outputs},{outputlabels},{nic},{velacckey},{fileformat}" + return self.run(command, **kwargs) + + def spoint( + self, + node: str = "", + x: str = "", + y: str = "", + z: str = "", + inertiakey: str = "", + **kwargs, + ): + r"""Defines a point for force/moment summations or inertia calculation + + Mechanical APDL Command: `SPOINT `_ + + Parameters + ---------- + node : str + Node number of the desired point. If zero, use ``X``, ``Y``, ``Z`` to describe point. + + x : str + Global Cartesian coordinates of the desired summation point. Used if ``NODE`` is 0. Defaults to + (0,0,0). + + y : str + Global Cartesian coordinates of the desired summation point. Used if ``NODE`` is 0. Defaults to + (0,0,0). + + z : str + Global Cartesian coordinates of the desired summation point. Used if ``NODE`` is 0. Defaults to + (0,0,0). + + inertiakey : str + Inertia key: + + * ``OFF`` - Point or node is used for the force/moment summations (default). + + * ``ON`` - Point or node is used for the calculation of total inertia. + + Notes + ----- + + .. _SPOINT_notes: + + By default ( ``InertiaKey`` = OFF), defines a point (any point other than the origin) about which + the tabular moment summations are computed. If force summations are desired in other than the global + Cartesian directions, a node number must be specified on the ``NODE`` field, and the desired + coordinate system must be activated with :ref:`rsys`. The command must be issued in the :ref:`post1` + module. + + When the inertia key is activated ( ``InertiaKey`` = ON), the total inertia printed in the precise + mass summary is calculated with respect to the point or node in the global Cartesian system. In this + case, the command must be issued during the first load step in the :ref:`slashsolu` module. + """ + command = f"SPOINT,{node},{x},{y},{z},{inertiakey}" + return self.run(command, **kwargs) + + def vtkwrite(self, fname: str = "", item: str = "", **kwargs): + r"""Writes the current displacement data to a :file:`.VTK` file. + + Mechanical APDL Command: `VTKWRITE `_ + + Parameters + ---------- + 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. Default: :file:`Jobname`. + + item : str + The output item (U, S, EPEL, or EPPL) to write to the file. Default: U. + + Notes + ----- + + .. _VTKWRITE_notes: + + Writes the requested data currently in memory ( :ref:`set` ) to a :file:`.VTK` file that can be read + by any VTK-compatible viewer (such as ParaView). + + Only data associated with the currently selected element set is written. + + Support is available for the displacements of 8-node brick elements (such as ``SOLID185`` ) only. If + your model uses multiple element types, select only the 8-node elements before issuing + :ref:`vtkwrite`. + """ + command = f"VTKWRITE,{fname},{item}" + return self.run(command, **kwargs) diff --git a/src/ansys/mapdl/core/_commands/post1/status.py b/src/ansys/mapdl/core/_commands/post1/status.py new file mode 100644 index 00000000000..ed8598e1647 --- /dev/null +++ b/src/ansys/mapdl/core/_commands/post1/status.py @@ -0,0 +1,216 @@ +# Copyright (C) 2016 - 2025 ANSYS, Inc. and/or its affiliates. +# SPDX-License-Identifier: MIT +# +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to deal +# in the Software without restriction, including without limitation the rights +# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +# copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in all +# copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +# SOFTWARE. + + +class Status: + + def calc(self, **kwargs): + r"""Specifies "Calculation settings" as the subsequent status topic. + + Mechanical APDL Command: `CALC `_ + + Notes + ----- + + .. _CALC_notes: + + This is a status ( :ref:`stat` ) topic command. Status topic commands are generated by the GUI and + will appear in the log file ( :file:`Jobname.LOG` ) if status is requested for some items under + Utility Menu> List> Status. This command will be immediately followed by a :ref:`stat` command, + which will report the status for the specified topic. + + If entered directly into the program, the :ref:`stat` command should immediately follow this + command. + """ + command = "CALC" + return self.run(command, **kwargs) + + def datadef(self, **kwargs): + r"""Specifies "Directly defined data status" as the subsequent status topic. + + Mechanical APDL Command: `DATADEF `_ + + Notes + ----- + + .. _DATADEF_notes: + + This is a status ( :ref:`stat` ) topic command. Status topic commands are generated by the GUI and + will appear in the log file ( :file:`Jobname.LOG` ) if status is requested for some items under + Utility Menu> List> Status. This command will be immediately followed by a :ref:`stat` command, + which will report the status for the specified topic. + + If entered directly into the program, the :ref:`stat` command should immediately follow this + command. + """ + command = "DATADEF" + return self.run(command, **kwargs) + + def define(self, **kwargs): + r"""Specifies "Data definition settings" as the subsequent status topic. + + Mechanical APDL Command: `DEFINE `_ + + Notes + ----- + + .. _DEFINE_notes: + + This is a status ( :ref:`stat` ) topic command. Status topic commands are generated by the GUI and + will appear in the log file ( :file:`Jobname.LOG` ) if status is requested for some items under + Utility Menu> List> Status. This command will be immediately followed by a :ref:`stat` command, + which will report the status for the specified topic. + + If entered directly into the program, the :ref:`stat` command should immediately follow this + command. + """ + command = "DEFINE" + return self.run(command, **kwargs) + + def display(self, **kwargs): + r"""Specifies "Display settings" as the subsequent status topic. + + Mechanical APDL Command: `DISPLAY `_ + + Notes + ----- + + .. _DISPLAY_notes: + + This is a status ( :ref:`stat` ) topic command. Status topic commands are generated by the GUI and + will appear in the log file ( :file:`Jobname.LOG` ) if status is requested for some items under + Utility Menu> List> Status. This command will be immediately followed by a :ref:`stat` command, + which will report the status for the specified topic. + + If entered directly into the program, the :ref:`stat` command should immediately follow this + command. + """ + command = "DISPLAY" + return self.run(command, **kwargs) + + def lccalc(self, **kwargs): + r"""Specifies "Load case settings" as the subsequent status topic. + + Mechanical APDL Command: `LCCALC `_ + + Notes + ----- + + .. _LCCALC_notes: + + This is a status ( :ref:`stat` ) topic command. Status topic commands are generated by the GUI and + will appear in the log file ( :file:`Jobname.LOG` ) if status is requested for some items under + Utility Menu> List> Status. This command will be immediately followed by a :ref:`stat` command, + which will report the status for the specified topic. + + If entered directly into the program, the :ref:`stat` command should immediately follow this + command. + + This command is also valid for `rezoning + `_. + """ + command = "LCCALC" + return self.run(command, **kwargs) + + def point(self, **kwargs): + r"""Specifies "Point flow tracing settings" as the subsequent status topic. + + Mechanical APDL Command: `POINT `_ + + Notes + ----- + + .. _POINT_notes: + + This is a status ( :ref:`stat` ) topic command. Status topic commands are generated by the GUI and + will appear in the log file ( :file:`Jobname.LOG` ) if status is requested for some items under + Utility Menu> List> Status. This command will be immediately followed by a :ref:`stat` command, + which will report the status for the specified topic. + + If entered directly into the program, the :ref:`stat` command should immediately follow this + command. + """ + command = "POINT" + return self.run(command, **kwargs) + + def print(self, **kwargs): + r"""Specifies "Print settings" as the subsequent status topic. + + Mechanical APDL Command: `PRINT `_ + + Notes + ----- + + .. _PRINT_notes: + + This is a status ( :ref:`stat` ) topic command. Status topic commands are generated by the GUI and + will appear in the log file ( :file:`Jobname.LOG` ) if status is requested for some items under + Utility Menu> List> Status. This command will be immediately followed by a :ref:`stat` command, + which will report the status for the specified topic. + + If entered directly into the program, the :ref:`stat` command should immediately follow this + command. + """ + command = "PRINT" + return self.run(command, **kwargs) + + def sort(self, **kwargs): + r"""Specifies "Sort settings" as the subsequent status topic. + + Mechanical APDL Command: `SORT `_ + + Notes + ----- + + .. _SORT_notes: + + This is a status ( :ref:`stat` ) topic command. Status topic commands are generated by the GUI and + will appear in the log file ( :file:`Jobname.LOG` ) if status is requested for some items under + Utility Menu> List> Status. This command will be immediately followed by a :ref:`stat` command, + which will report the status for the specified topic. + + If entered directly into the program, the :ref:`stat` command should immediately follow this + command. + """ + command = "SORT" + return self.run(command, **kwargs) + + def spec(self, **kwargs): + r"""Specifies "Miscellaneous specifications" as the subsequent status topic. + + Mechanical APDL Command: `SPEC `_ + + Notes + ----- + + .. _SPEC_notes: + + This is a status ( :ref:`stat` ) topic command. Status topic commands are generated by the GUI and + will appear in the log file ( :file:`Jobname.LOG` ) if status is requested for some items under + Utility Menu> List> Status. This command will be immediately followed by a :ref:`stat` command, + which will report the status for the specified topic. + + If entered directly into the program, the :ref:`stat` command should immediately follow this + command. + """ + command = "SPEC" + return self.run(command, **kwargs) diff --git a/src/ansys/mapdl/core/_commands/post1/surface_operations.py b/src/ansys/mapdl/core/_commands/post1/surface_operations.py new file mode 100644 index 00000000000..03047189ca8 --- /dev/null +++ b/src/ansys/mapdl/core/_commands/post1/surface_operations.py @@ -0,0 +1,561 @@ +# Copyright (C) 2016 - 2025 ANSYS, Inc. and/or its affiliates. +# SPDX-License-Identifier: MIT +# +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to deal +# in the Software without restriction, including without limitation the rights +# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +# copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in all +# copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +# SOFTWARE. + + +class SurfaceOperations: + + def sucalc( + self, + rsetname: str = "", + lab1: str = "", + oper: str = "", + lab2: str = "", + fact1: str = "", + fact2: str = "", + const: str = "", + **kwargs, + ): + r"""Create new result data by operating on two existing result data sets on a given surface. + + Mechanical APDL Command: `SUCALC `_ + + Parameters + ---------- + rsetname : str + Eight character name for new result data. + + lab1 : str + First result data upon which to operate. + + oper : str + Mathematical operation to perform. + + * ``ADD`` - ( ``lab1`` + ``lab2`` + ``const`` ) + + * ``SUB`` - ( ``lab1`` - ``lab2`` + ``const`` ) + + * ``MULT`` - ( ``lab1`` \* ``lab2`` + ``const`` ) + + * ``DIV`` - ( ``lab1`` / ``lab2`` + ``const`` ) + + * ``EXP`` - ( ``lab1`` ^ ``fact1`` + ``lab2`` ^ ``fact2`` + ``const`` ) + + * ``COS`` - (cos ( ``lab1`` ) + ``const`` ) + + * ``SIN`` - (sin ( ``lab1`` ) + ``const`` ) + + * ``ACOS`` - (acos ( ``lab1`` ) + ``const`` ) + + * ``ASIN`` - (asin ( ``lab1`` ) + ``const`` ) + + * ``ATAN`` - (atan ( ``lab1`` ) + ``const`` ) + + * ``ATA2`` - (atan2 ( ``lab1`` / ``lab2`` ) + ``const`` ) + + * ``LOG`` - (log ( ``lab1`` ) + ``const`` ) + + * ``ABS`` - (abs ( ``lab1`` ) + ``const`` ) + + * ``ZERO`` - (0 + ``const`` ) + + lab2 : str + Second result data upon which to operate. + + fact1 : str + First scaling factor (for EXP option only). + + fact2 : str + Second scaling factor (for EXP option only). + + const : str + Constant added to the values in the resulting data. + """ + command = f"SUCALC,{rsetname},{lab1},{oper},{lab2},{fact1},{fact2},{const}" + return self.run(command, **kwargs) + + def sucr( + self, + surfname: str = "", + surftype: str = "", + nrefine: str = "", + radius: str = "", + tolout: str = "", + **kwargs, + ): + r"""Create a surface. + + Mechanical APDL Command: `SUCR `_ + + Parameters + ---------- + surfname : str + Eight character surface name. + + surftype : str + Surface type. + + * ``CPLANE`` - Surface is defined by the cutting plane in window one (controlled by the working + plane (/CPLANE,1), NOT the view settings (/CPLANE,0)). + + * ``SPHERE`` - Surface is defined by a spherical surface centered about the working plane origin. + + * ``INFC`` - Surface is defined by a cylindrical surface centered about the working plane origin and + extending indefinitely in the positive and negative Z directions. + + nrefine : str + Refinement level. + + * ``For SurfType = CPLANE`` - The refinement level of the surface mesh. This will be an integer + between 0 and 3 (default = 0). See Notes below. + + * ``For SurfType = SPHERE`` - The number of divisions along a 90° arc (minimum = 9). The default is + 9. + + * ``For SurfType = INFC`` - The number of divisions along a 90° arc (minimum = 9). The default is 9. + + radius : str + Appropriate radius value (for INFC or SPHERE). + + tolout : str + Tolerance value for inclusion of element facets within a prescribed volume. (for INFC) + + Notes + ----- + + .. _SUCR_notes: + + This command creates a new surface and stores the following data for that surface: + + * GCX, GCY, GCZ - global Cartesian coordinates at each point on the surface. + * NORMX, NORMY, NORMZ - components of the unit normal at each point on the surface. + * DA - the contributory area of each point. + + For ``SurfType`` = CPLANE, ``nRefine`` refers to the number of points that define the surface. An + ``nRefine`` value of zero is used for points where the element face intersects the cutting plane. + + If ``SurfType`` = CPLANE and ``nRefine`` = 0, the points reside at the section cuts where the + element intersects the cutting plane. Increasing ``nRefine`` from 0 to 1 will subdivide each surface + facet into 4 subfacets, and increase the number of points at which results can be interpolated. + + For ``SurfType`` = CPLANE, the setting from the :ref:`efacet` command will affect the creation of + surface facets and the quality of the fit of the surface in the model. :ref:`sucr` employs geometry + data from PowerGraphics to aid in determining where the surface intersects the model. If + :ref:`efacet`,1 is in effect when the :ref:`sucr` command is issued, then the curvature of high + order elements (that is, elements with midside nodes) will be ignored. If your model contains high + order elements, you can see a better fit for your surface if /EFACET,2 is in effect when the + :ref:`sucr` command is issued. Currently, the :ref:`sucr` command interprets :ref:`efacet`,4 to + mean :ref:`efacet`,2. + + For ``SurfType`` = INFC, a default tolerance of 0.01 will be applied to include the vertices of any + facets that fall out of the cylinder definition. This tolerance increases the facet size by one + percent to check for inclusion. Excluding facets under such a small tolerance may yield unacceptable + (aesthetically) results. Increasing the tolerance by a larger amount (0.1 or 10%) will sometimes + yield smother edges along the surface you create. + + + """ + command = f"SUCR,{surfname},{surftype},{nrefine},{radius},,,{tolout}" + return self.run(command, **kwargs) + + def sudel(self, surfname: str = "", **kwargs): + r"""Delete geometry information as well as any mapped results for specified surface. + + Mechanical APDL Command: `SUDEL `_ + + Parameters + ---------- + surfname : str + Eight character surface name. + + ``SurfName`` = ALL will delete all surface geometry and result information. + """ + command = f"SUDEL,{surfname}" + return self.run(command, **kwargs) + + def sueval(self, parm: str = "", lab1: str = "", oper: str = "", **kwargs): + r"""Perform operations on a mapped item and store result in a scalar parameter. + + Mechanical APDL Command: `SUEVAL `_ + + Parameters + ---------- + parm : str + APDL parameter name. + + lab1 : str + Eight character set name for the first set used in calculation. + + oper : str + Operation to perform: + + * ``SUM`` - Sum of ``lab1`` result values. + + * ``INTG`` - Integral of ``lab1`` over surface. + + * ``AVG`` - Area-weighted average of a result item [Σ( ``lab1`` \*DA) / Σ(DA)] + + Notes + ----- + + .. _SUEVAL_notes: + + The result of this operation is a scalar APDL parameter value. If multiple surfaces are selected + when this command is issued, then the operation is carried out on each surface individually and the + parameter represents the cumulative value of the operation on all selected surfaces. + """ + command = f"SUEVAL,{parm},{lab1},{oper}" + return self.run(command, **kwargs) + + def suget( + self, + surfname: str = "", + rsetname: str = "", + parm: str = "", + geom: str = "", + **kwargs, + ): + r"""Moves surface geometry and mapped results to an array parameter. + + Mechanical APDL Command: `SUGET `_ + + Parameters + ---------- + surfname : str + Eight character surface name. + + rsetname : str + Eight character result name. + + parm : str + APDL array parameter name (up to 32 characters). + + geom : str + Switch controlling how data is written. + + * ``ON (or 1 or YES)`` - Writes geometry data and interpolated results information to the parameter. + + * ``OFF (or 0 or NO)`` - Writes only interpolated results information to the parameter. (Default) + + Notes + ----- + + .. _SUGET_notes: + + For ``Geom`` = OFF (or 0 or NO), only results information is written to this parameter. + + For ``Geom`` = ON (or 1 or YES), both geometry data and results information are written to this + parameter. Geometry data includes 7 data items: (GCX, GCY, GCZ, NORMX, NORMY, NORMZ, and DA). + Results information is then written to the 8th column of the parameter. SetNames of GCX, GCY, GCZ, + NORMX, NORMY, NORMZ, and DA are predefined and computed when :ref:`sucr` is issued. + """ + command = f"SUGET,{surfname},{rsetname},{parm},{geom}" + return self.run(command, **kwargs) + + def sumap(self, rsetname: str = "", item: str = "", comp: str = "", **kwargs): + r"""Map results onto selected surface(s). + + Mechanical APDL Command: `SUMAP `_ + + Parameters + ---------- + rsetname : str + Eight-character name for the result being mapped. + + item : str + Label identifying the item. + + Valid item labels are defined via :ref:`plnsol`. Some items also require a component label. + + If ``Item`` = CLEAR, the specified result set is deleted from all selected surfaces + + comp : str + Component label of item (if required). + + Notes + ----- + + .. _SUMAP_notes: + + The :ref:`sumap` command maps results in the current coordinate system ( :ref:`rsys` ) using the + selected set of elements. + + The command interpolates and stores the results data on to each of the selected surfaces. + + :ref:`sumap`,ALL,CLEAR deletes all results sets from all selected surfaces. + """ + command = f"SUMAP,{rsetname},{item},{comp}" + return self.run(command, **kwargs) + + def supl( + self, surfname: str = "", rsetname: str = "", kwire: int | str = "", **kwargs + ): + r"""Plot result data on all selected surfaces or on a specified surface. + + Mechanical APDL Command: `SUPL `_ + + Parameters + ---------- + surfname : str + Eight-character surface name. ALL plots all selected surfaces. + + rsetname : str + Eight-character result name. + + kwire : int or str + Plot in context of model. + + * ``0`` - Plot results without the outline of selected elements. + + * ``1`` - Plot results with the outline of selected elements. + + Notes + ----- + + .. _SUPL_notes: + + If ``RSetName`` is not specified, the surface geometry is plotted. If the Setname portion of the + argument is a vector prefix (that is, if result sets of name SetNameX, SetNameY, and SetNameZ + exist), Mechanical APDL plots the vectors on the surface as arrows. For example, + :ref:`supl`,ALL,NORM plots + the surface normals as vectors on all selected surfaces, as NORMX, NORMY, and NORMZ are predefined + geometry items. + """ + command = f"SUPL,{surfname},{rsetname},{kwire}" + return self.run(command, **kwargs) + + def supr(self, surfname: str = "", rsetname: str = "", **kwargs): + r"""Print global status, geometry information and/or result information. + + Mechanical APDL Command: `SUPR `_ + + Parameters + ---------- + surfname : str + Eight character surface name. If ``SurfName`` = ALL, repeat printout for all selected surfaces. + + rsetname : str + Eight character result set name. + + Notes + ----- + + .. _SUPR_notes: + + When no arguments are specified, :ref:`supr` generates a global status summary of all defined + surfaces. If only ``SurfName`` is specified, the geometry information for that surface is printed. + If both ``SurfName`` and ``RSetName`` are specified, the value of the results set at each point, in + addition to the geometry information, is printed. + """ + command = f"SUPR,{surfname},{rsetname}" + return self.run(command, **kwargs) + + def suresu(self, fname: str = "", fext: str = "", fdir: str = "", **kwargs): + r"""Read a set of surface definitions and result items from a file and make them the current set. + + Mechanical APDL Command: `SURESU `_ + + Parameters + ---------- + + fname : str + Eight character name. + + fext : str + Extension name. + + fdir : str + Optional path specification. + + Notes + ----- + + .. _SURESU_notes: + + Reading (and therefore resuming) surface and result definitions from a file overwritea any existing + surface definitions. + + Reading surfaces back into the postprocessor ( :ref:`post1` ) does not insure that the surfaces (and + their results) are appropriate for the model currently residing in :ref:`post1`. + """ + command = f"SURESU,,{fname},{fext},{fdir}" + return self.run(command, **kwargs) + + def susave( + self, lab: str = "", fname: str = "", fext: str = "", fdir: str = "", **kwargs + ): + r"""Saves surface definitions to a file. + + Mechanical APDL Command: `SUSAVE `_ + + Parameters + ---------- + lab : str + Eight-character surface name. + + If ``Lab`` = ALL (default), then all surfaces are saved to the file. + + If ``Lab`` = S, only currently selected surfaces are saved to the file. + + fname : str + File name and directory path (248 character maximum, including directory). If you do not specify + a directory path, the default is your working directory and you can use all 248 characters for + the file name. The file name defaults to the jobname. + + fext : str + File name extension (eight-character maximum). The extension defaults to "surf". + + fdir : str + Optional path specification. + + Notes + ----- + + .. _SUSAVE_notes: + + The :ref:`susave` command saves surface definitions (geometry information)--and any result items + mapped onto the surfaces--to a file. + + Issuing the :ref:`susave` command has no effect on the database. The database remains unchanged. + + Subsequent executions of the :ref:`susave` command overwrite previous data in the file. + + To read the contents of the file created via the :ref:`susave` command, issue the :ref:`suresu` + command. + """ + command = f"SUSAVE,{lab},{fname},{fext},{fdir}" + return self.run(command, **kwargs) + + def susel( + self, + type_: str = "", + name1: str = "", + name2: str = "", + name3: str = "", + name4: str = "", + name5: str = "", + name6: str = "", + name7: str = "", + name8: str = "", + **kwargs, + ): + r"""Selects a subset of surfaces + + Mechanical APDL Command: `SUSEL `_ + + Parameters + ---------- + type_ : str + Label identifying the type of select: + + * ``S`` - Selects a new set (default). + + * ``R`` - Reselects a set from the current set. + + * ``A`` - Additionally selects a set and extends the current set. + + * ``U`` - Unselects a set from the current set. + + * ``ALL`` - Also selects all surfaces. + + * ``NONE`` - Unselects all surfaces. + + name1 : str + Eight character surface names + + name2 : str + Eight character surface names + + name3 : str + Eight character surface names + + name4 : str + Eight character surface names + + name5 : str + Eight character surface names + + name6 : str + Eight character surface names + + name7 : str + Eight character surface names + + name8 : str + Eight character surface names + + Notes + ----- + + .. _SUSEL_notes: + + The selected set of surfaces is used in the following operations: :ref:`sumap`, :ref:`sudel`, + :ref:`sucalc`, :ref:`sueval`, and :ref:`suvect`. + """ + command = f"SUSEL,{type_},{name1},{name2},{name3},{name4},{name5},{name6},{name7},{name8}" + return self.run(command, **kwargs) + + def suvect( + self, + rsetname: str = "", + lab1: str = "", + oper: str = "", + lab2: str = "", + offset: str = "", + **kwargs, + ): + r"""Create new result data by operating on two existing result vectors on a given surface. + + Mechanical APDL Command: `SUVECT `_ + + Parameters + ---------- + rsetname : str + Eight character name of the result data output. There will be one or three ``RSetName`` values + depending on the operation specified in ``Oper``. + + lab1 : str + Eight character name of the mapped data that forms vector 1. Specified sets must exist on all + selected surfaces for this operation to take place. The names NORM and GC will be reserved for + normals and for global (x, y, z). + + oper : str + * ``DOT`` - Computes dot product between ``lab1`` and ``lab2`` vectors. The result is a scalar + parameter ( ``RSetName`` ) and each value within the set can be modified (incremented) via + ``Offset``. + + * ``CROSS`` - Computes cross product between ``lab1`` and ``lab2`` vectors. Each X, Y, Z value in + the result can be modified (incremented) via ``Offset``. + + * ``SMULT`` - Scales (lab1x, lab1y, lab1z) vector by scalar ``lab2``. Each X,Y,Z value in the result + can be modified (incremented) via ``Offset``. + + lab2 : str + Eight character name of the mapped data that forms vector 2. Sets with names Lab2X, Lab2Y, and + Lab2Z must exist on all selected surfaces for operation to take place. For ``Oper`` = SMULT a + scalar value or another predefined scalar item (for example, DA) can be supplied. + + offset : str + An offset value to be applied to the resultant ``RSetName``. One value is specified for ``Oper`` + = DOT, and three values are specified for ``Oper`` = SMULT. + """ + command = f"SUVECT,{rsetname},{lab1},{oper},{lab2},{offset}" + return self.run(command, **kwargs) diff --git a/src/ansys/mapdl/core/_commands/post1/trace_points.py b/src/ansys/mapdl/core/_commands/post1/trace_points.py new file mode 100644 index 00000000000..fa928d14378 --- /dev/null +++ b/src/ansys/mapdl/core/_commands/post1/trace_points.py @@ -0,0 +1,295 @@ +# Copyright (C) 2016 - 2025 ANSYS, Inc. and/or its affiliates. +# SPDX-License-Identifier: MIT +# +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to deal +# in the Software without restriction, including without limitation the rights +# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +# copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in all +# copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +# SOFTWARE. + + +class TracePoints: + + def pltrac( + self, + analopt: str = "", + item: str = "", + comp: str = "", + trpnum: str = "", + name: str = "", + mxloop: str = "", + toler: str = "", + escl: str = "", + mscl: str = "", + **kwargs, + ): + r"""Displays a charged particle trace on an element display. + + Mechanical APDL Command: `PLTRAC `_ + + Parameters + ---------- + analopt : str + Analysis option + + * ``ELEC`` - Particle trace in electric field + + * ``MAGN`` - Particle trace in magnetic field + + * ``EMAG`` - Particle trace in presence of both electric and magnetic fields (default) + + item : str + Label identifying the item to be contoured. Valid item labels are shown in :ref:`pltrac_tab_1` + below. Some items also require a component label. If ``Item`` is blank, display only the path + trajectory. + + comp : str + Component of the item (if required). Valid component labels are shown in :ref:`pltrac_tab_1` + below. + + trpnum : str + Trace point number for storing trajectory data for use with :ref:`path` logic. Defaults to 0 (no + trajectory path data is stored for further processing with :ref:`path` logic). + + name : str + Name of prefix of array variable. Defaults to TRAC. ``Name`` POIN stores trajectory path points + for trace point number ``TRPNum``. If ``Analopt`` = ELEC, MAGN, or EMAG, two additional array + parameters, ``Name`` DATA and ``Name`` LABL, store trajectory path data and labels for the same + ``TRPNum``. + + mxloop : str + Maximum number of loops traced by a particle. Defaults to 1000. + + toler : str + Length tolerance used for particle trajectory geometry calculation. Valid for ``Analopt`` = + ELEC, MAGN, or EMAG. If particle trace appears to terminate inside an element, adjusting the + length tolerance may be necessary. Defaults to 1.0 x 10 :sup:`-8`. + + escl : str + Electric field scale factor. Setting this scale factor affects only the tracing, not the field + solution results. A negative factor corresponds to the opposite vector direction. Valid only for + ``Analopt`` = ELEC or EMAG. Defaults to 1. + + mscl : str + Magnetic field scale factor. Setting this scale factor affects only the tracing, not the field + solution results. A negative factor corresponds to the opposite vector direction. Valid only for + ``Analopt`` = MAGN or EMAG. Defaults to 1. + + Notes + ----- + + .. _PLTRAC_notes: + + For a specified item, the variation of the item is displayed along the particle trace as a color- + contoured ribbon. The :ref:`trpoin` command must be used to define a point on the trajectory path. + Multiple traces may be displayed simultaneously by defining multiple trace points. Issue the + :ref:`trplis` command to list the current tracing points. Issue the :ref:`trpdel` command to delete + tracing points defined earlier. Use the :ref:`paput` command with the POIN option to retrieve the + particle trajectory points as path points. + + The model must be 3D for the ELEC, MAGN, and EMAG analysis options. + + Three array parameters are created at the time of the particle trace: TRACPOIN, TRACDATA and + TRACLABL. These array parameters can be used to put the particle velocity and the elapsed time into + path form. The procedure to put the arrays into a path named PATHNAME is as follows: + + .. code:: apdl + + *get,npts,PARM,TRACPOIN,DIM,x + PATH,PATHNAME,npts,9,1 + PAPUT,TRACPOIN,POINTS + PAPUT,TRACDATA,TABLES + PAPUT,TRACLABL,LABELS + PRPATH,S,T_TRACE,VX_TRACE,VY_TRACE,VZ_TRACE,VS_TRACE + + If working in the GUI, use the "All information" option to retrieve information from all three + arrays at once. + + .. _pltrac_tab_1: + + PLTRAC - Valid Item and Component Labels + **************************************** + + .. flat-table:: + :header-rows: 1 + + * - Item + - Comp + - Description + * - **Valid item labels for** ``Analopt`` = ELEC nodal results are: + * - VOLT + - + - Electric potential. + * - **Valid item labels for** ``Analopt`` = MAGN or EMAG nodal results are: + * - None + - + - Color contour displayed. + + See the `Basic Analysis Guide + `_ for more + information on charged particle traces. See `Animation + `_ in the + `Basic Analysis Guide + `_ for information + on particle trace animation. + """ + command = f"PLTRAC,{analopt},{item},{comp},{trpnum},{name},{mxloop},{toler},,{escl},{mscl}" + return self.run(command, **kwargs) + + def trpdel(self, ntrp1: str = "", ntrp2: str = "", trpinc: str = "", **kwargs): + r"""Deletes charged particle trace points. + + Mechanical APDL Command: `TRPDEL `_ + + Parameters + ---------- + ntrp1 : str + Delete points from ``NTRP1`` to ``NTRP2`` (defaults to ``NTRP1`` ) in steps of ``TRPINC`` + (defaults to 1). If ``NTRP1`` = ALL, ``NTRP2`` and ``TRPINC`` are ignored and all trace points + are deleted. If ``NTRP1`` = P, graphical picking is enabled and all remaining command fields are + ignored (valid only in the GUI). + + ntrp2 : str + Delete points from ``NTRP1`` to ``NTRP2`` (defaults to ``NTRP1`` ) in steps of ``TRPINC`` + (defaults to 1). If ``NTRP1`` = ALL, ``NTRP2`` and ``TRPINC`` are ignored and all trace points + are deleted. If ``NTRP1`` = P, graphical picking is enabled and all remaining command fields are + ignored (valid only in the GUI). + + trpinc : str + Delete points from ``NTRP1`` to ``NTRP2`` (defaults to ``NTRP1`` ) in steps of ``TRPINC`` + (defaults to 1). If ``NTRP1`` = ALL, ``NTRP2`` and ``TRPINC`` are ignored and all trace points + are deleted. If ``NTRP1`` = P, graphical picking is enabled and all remaining command fields are + ignored (valid only in the GUI). + + Notes + ----- + + .. _TRPDEL_notes: + + Deletes charged particle trace points defined with the :ref:`trpoin` command. + """ + command = f"TRPDEL,{ntrp1},{ntrp2},{trpinc}" + return self.run(command, **kwargs) + + def trplis( + self, + ntrp1: str = "", + ntrp2: str = "", + trpinc: str = "", + opt: str = "", + **kwargs, + ): + r"""Lists charged particle trace points. + + Mechanical APDL Command: `TRPLIS `_ + + Parameters + ---------- + ntrp1 : str + List points from ``NTRP1`` to ``NTRP2`` (defaults to ``NTRP1`` ) in steps of ``TRPINC`` + (defaults to 1). If ``NTRP1`` = ALL, ``NTRP2`` and ``TRPINC`` are ignored and all trace points + are listed. If ``NTRP1`` = P, graphical picking is enabled and all remaining command fields are + ignored (valid only in the GUI). + + ntrp2 : str + List points from ``NTRP1`` to ``NTRP2`` (defaults to ``NTRP1`` ) in steps of ``TRPINC`` + (defaults to 1). If ``NTRP1`` = ALL, ``NTRP2`` and ``TRPINC`` are ignored and all trace points + are listed. If ``NTRP1`` = P, graphical picking is enabled and all remaining command fields are + ignored (valid only in the GUI). + + trpinc : str + List points from ``NTRP1`` to ``NTRP2`` (defaults to ``NTRP1`` ) in steps of ``TRPINC`` + (defaults to 1). If ``NTRP1`` = ALL, ``NTRP2`` and ``TRPINC`` are ignored and all trace points + are listed. If ``NTRP1`` = P, graphical picking is enabled and all remaining command fields are + ignored (valid only in the GUI). + + opt : str + ``Opt`` = LOC lists the trace point number location (X, Y, Z). Default. + + ``Opt`` = PART lists the trace point number particle settings (velocity, charge, mass). + + Notes + ----- + + .. _TRPLIS_notes: + + Lists the charged particle trace points in the active display coordinate system ( :ref:`dsys` ). + Trace points are defined with the :ref:`trpoin` command. + """ + command = f"TRPLIS,{ntrp1},{ntrp2},{trpinc},{opt}" + return self.run(command, **kwargs) + + def trpoin( + self, + x: str = "", + y: str = "", + z: str = "", + vx: str = "", + vy: str = "", + vz: str = "", + chrg: str = "", + mass: str = "", + **kwargs, + ): + r"""Defines a point through which a charged particle trace will travel. + + Mechanical APDL Command: `TRPOIN `_ + + Parameters + ---------- + x : str + Coordinate location of the trace point (in the active coordinate system). If ``X`` = P, + graphical picking is enabled and all remaining command fields are ignored (valid only in the + GUI). + + y : str + Coordinate location of the trace point (in the active coordinate system). If ``X`` = P, + graphical picking is enabled and all remaining command fields are ignored (valid only in the + GUI). + + z : str + Coordinate location of the trace point (in the active coordinate system). If ``X`` = P, + graphical picking is enabled and all remaining command fields are ignored (valid only in the + GUI). + + vx : str + Particle velocities in the X, Y and Z directions (in the active coordinate system). + + vy : str + Particle velocities in the X, Y and Z directions (in the active coordinate system). + + vz : str + Particle velocities in the X, Y and Z directions (in the active coordinate system). + + chrg : str + Particle charge. + + mass : str + Particle mass. + + Notes + ----- + + .. _TRPOIN_notes: + + Defines a point through which a charged particle trace ( :ref:`pltrac` ) will travel. Multiple + points (50 maximum) may be defined which will result in multiple particle traces. Use :ref:`trplis` + to list the currently defined trace points and :ref:`trpdel` to delete trace points. + + The VX, VY, VZ, CHRG, and MASS arguments only apply to charged particles. + """ + command = f"TRPOIN,{x},{y},{z},{vx},{vy},{vz},{chrg},{mass}" + return self.run(command, **kwargs) diff --git a/src/ansys/mapdl/core/_commands/post1_/animation.py b/src/ansys/mapdl/core/_commands/post1_/animation.py deleted file mode 100644 index 9a9718d7159..00000000000 --- a/src/ansys/mapdl/core/_commands/post1_/animation.py +++ /dev/null @@ -1,815 +0,0 @@ -# Copyright (C) 2016 - 2025 ANSYS, Inc. and/or its affiliates. -# SPDX-License-Identifier: MIT -# -# -# Permission is hereby granted, free of charge, to any person obtaining a copy -# of this software and associated documentation files (the "Software"), to deal -# in the Software without restriction, including without limitation the rights -# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -# copies of the Software, and to permit persons to whom the Software is -# furnished to do so, subject to the following conditions: -# -# The above copyright notice and this permission notice shall be included in all -# copies or substantial portions of the Software. -# -# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -# SOFTWARE. - - -class Animation: - def ancntr(self, nfram="", delay="", ncycl="", **kwargs): - """Produces an animated sequence of a contoured deformed shape. - - APDL Command: ANCNTR - - Parameters - ---------- - nfram - Number of frames captures (defaults to 5). - - delay - Time delay during animation (defaults to 0.1 seconds). - - ncycl - Number of animation cycles (defaults to 5). Available in non-UI - mode only. - - Notes - ----- - ANCNTR involves an ANSYS macro which produces an animation of a - contoured deformed shape of the last plot action command. This command - operates only on graphic display platforms supporting the /SEG command. - After executing ANCNTR, you can replay the animated sequence by issuing - the ANIM command. - - The command functions only in the postprocessor. - """ - command = f"ANCNTR,{nfram},{delay},{ncycl}" - return self.run(command, **kwargs) - - def ancut( - self, - nfram="", - delay="", - ncycl="", - qoff="", - ktop="", - topoff="", - node1="", - node2="", - node3="", - **kwargs, - ): - """Produces an animated sequence of Q-slices. - - APDL Command: ANCUT - - Parameters - ---------- - nfram - Number of frames captures (defaults to 5). - - delay - Time delay during animation (defaults to 0.1 seconds). - - ncycl - Number of animation cycles (defaults to 5). Available in non-UI - mode only. - - qoff - Q-slice working plane increment (defaults to .1 half screens). - - ktop - Topological effect on or off (YES or NO; default is NO). - - topoff - Topological offset (default is .1 half screens). - - node1 - Node 1 for start of the Q-slice. - - node2 - Node 2 for direction of the Q-slice. - - node3 - Node 3 for plane of the Q-slice. - - Notes - ----- - ANCUT involves an ANSYS macro which produces an animation of Q-slices - of the last plot action command. This command operates only on graphic - display platforms supporting the /SEG command. After executing ANCUT, - you can replay the animated sequence by issuing the ANIM command. - - The command functions only in the postprocessor. - """ - command = f"ANCUT,{nfram},{delay},{ncycl},{qoff},{ktop},{topoff},{node1},{node2},{node3}" - return self.run(command, **kwargs) - - def andata( - self, - delay="", - ncycl="", - rsltdat="", - min_="", - max_="", - incr="", - frclst="", - autocont="", - autocntr="", - **kwargs, - ): - """Displays animated graphics data for nonlinear problems. - - APDL Command: ANDATA - - Parameters - ---------- - delay - Time delay during animation (defaults to 0.5 seconds). - - ncycl - Number of animation cycles (defaults to 5). Available in non-UI - mode only. - - rsltdat - The type of results data to be used for the animation sequence. - This can be: - - 0 - Current load step data (default). - - 1 - Range of load step data. - - 2 - Range of results data. - - min\\_ - The range minimum value. If left blank or 0, defaults to the first - data point. - - max\\_ - The range maximum value. If left blank or 0, defaults to the last - data point. - - incr - The increment between result data (defaults to 1). - - frclst - Key to force the last sub step in a selected load step to be - included in the animation (defaults to 0). - - autocont - A value of 1 enables automatic scaling of contour values based on - the overall subset range of values. The default value is 0 (no - automatic scaling). - - autocntr - A value of 1 disables automatic centering of displaced plots. The - default value is 0 (allow automatic centering). - - Notes - ----- - Use the ANDATA command to create animations for nonlinear problems. The - command works by displaying an individual graphical image for each - result data set from the results file. For information about creating - animations for linear problems, see the ANIM command. - - The command operates only on graphic display platforms supporting the - /SEG command. It uses a macro to produce an animation based on the last - plot action command (for example, PLDISP). - - The results file must have more than one set of results. - - The command implicitly issues /DSCALE, 1 for default displacement - scaling. Large displacements may not give good results. - - This command functions only in the postprocessor. - """ - command = f"ANDATA,{delay},{ncycl},{rsltdat},{min_},{max_},{incr},{frclst},{autocont},,{autocntr}" - return self.run(command, **kwargs) - - def andscl(self, nfram="", delay="", ncycl="", **kwargs): - """Produces an animated sequence of a deformed shape. - - APDL Command: ANDSCL - - Parameters - ---------- - nfram - Number of frames captured (defaults to 5). - - delay - Time delay during animation (defaults to 0.1 seconds). - - ncycl - Number of animation cycles (defaults to 5). Available in non-UI - mode only. - - Notes - ----- - ANDSCL involves an ANSYS macro which produces an animation of - displacement of the last plot action command (for example, PLDISP). - This command operates only on graphic display platforms supporting the - /SEG command. After executing ANDSCL, you can replay the animated - sequence by issuing the ANIM command. - - The command functions only in the postprocessor. - """ - command = f"ANDSCL,{nfram},{delay},{ncycl}" - return self.run(command, **kwargs) - - def ancyc(self, numframes="", kcycl="", delay="", **kwargs): - """Applies a traveling wave animation to graphics data in a modal cyclic - - APDL Command: ANCYC - symmetry analysis. - - Parameters - ---------- - numframes - The number of plot frames for the animation. Valid values range - from 5 through 36. The default is 18. A low value (because it - specifies fewer graphical frames) produces a rougher animation but - loads faster. A high value produces a smoother animation but - requires more time to load. - - kcycl - The animation mode: - - 0 - Continuous animation cycle (forward-reverse-forward). - - 1 - Discontinuous animation cycle (forward-reset-forward). This option is the - default. - - delay - The time delay (in seconds) between animation frames. Valid values - range from 0.1 through 1.0. The default is 0.1 seconds, which - produces a seemingly real-time animation. A higher value produces a - slower animation. - - Notes - ----- - The ANCYC command is valid in a modal cyclic symmetry analysis only. - - The command animates the cyclic symmetry mode shape plot in the General - Post Processor (/POST1). When you issue a nodal- or element-results - plot command (for example, PLNSOL, PLESOL, or PLDISP) and then issue - the ANCYC command, ANSYS applies a traveling wave animation to the mode - shape plot. - - Each frame of the animation is created by expanding the cyclic symmetry - mode shape at increasing phase angles (via the /CYCEXPAND command) - starting at zero in equal increments over 360°. The phase-angle - increment is 360 / NUMFRAMES. - - The animation display shows the traveling wave of the result quantity - being plotted. The traveling wave animation is applicable only to nodal - diameters (harmonic indices) greater than 0 and less than N / 2 (where - N is the number of cyclic sectors in the model). - - For more information, see Applying a Traveling Wave Animation to the - Cyclic Model in the Cyclic Symmetry Analysis Guide. - """ - command = f"ANCYC,{numframes},{kcycl},{delay}" - return self.run(command, **kwargs) - - def andyna( - self, - delay="", - ncycl="", - start="", - end="", - inc="", - autocontourkey="", - **kwargs, - ): - """Produces an animated sequence of contour values through substeps. - - APDL Command: ANDYNA - - Parameters - ---------- - delay - Time delay during animation (defaults to 0.1 seconds). - - ncycl - Number of animation cycles (defaults to 5). Available in non-UI - mode only. - - start - Number of the starting substep (defaults to 1). - - end - Number of the ending substep (defaults to the maximum substep). - - inc - Increment between substeps (defaults to 1). - - autocontourkey - Auto-scales contour values, based on the overall subset range of - values (defaults to 0, no auto-scaling). - - Notes - ----- - ANDYNA involves an ANSYS macro which produces an animation of contour - values through all the substeps of the last plot action command. This - command operates only on graphic display platforms supporting the /SEG - command. After executing ANDYNA, you can replay the animated sequence - by issuing the ANIM command. - - The command functions only in the postprocessor. - """ - command = f"ANDYNA,{delay},{ncycl},{start},{end},{inc},{autocontourkey}" - return self.run(command, **kwargs) - - def anfile(self, lab="", fname="", ext="", **kwargs): - """Saves or resumes an animation sequence to or from a file. - - APDL Command: /ANFILE - - Parameters - ---------- - lab - Label type. - - SAVE - Save the current animation to a file. - - RESUME - Resume an animation from a file. - - 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. - - ext - Filename extension (eight-character maximum). - - Notes - ----- - This command saves an animation to a file from local terminal segments - or resumes an animation from a file to local terminal segments. See - the /SEG command for details on segment storage. See the ANCNTR macro - for a convenient method of storing graphics frames in terminal memory - segments. This command is device dependent and is valid in any - processor. - """ - command = f"/ANFILE,{lab},{fname},{ext}" - return self.run(command, **kwargs) - - def anflow( - self, - nfram="", - delay="", - ncycl="", - time="", - spacing="", - size="", - length="", - **kwargs, - ): - """Produces an animated sequence of particle flow in a flowing fluid or a charged particle traveling in an electric or magnetic field. - - APDL Command: ANFLOW - - Parameters - ---------- - nfram - Number of frames captured (defaults to 5). - - delay - Time delay during animation (defaults to 0.1 seconds). - - ncycl - Number of animation cycles (defaults to 5). Non-UI mode only. - - time - Total Trace Time (seconds) (defaults to 0, which is the full flow - trace). - - spacing - Particle spacing in seconds (defaults to 0). - - size - Particle size (defaults to 0, which is a line). - - length - Particle length fraction (defaults to .1). - - Notes - ----- - ANFLOW invokes an ANSYS macro which produces an animation of particle - flow in a flowing fluid or charged particle motion in an electric or - magnetic field by the last plot action command (i.e., PLTRAC). This - command is only operational on graphic display platforms supporting the - /SEG command. After executing ANFLOW, you can replay the animated - sequence by issuing the ANIM command. This command is functional only - in the Postprocessor. - - The TIME option lets you set the time interval of forward travel for - the trace. The SPACING option is used to define the particle spacing - in seconds from adjacent particles in the stream line. The SIZE - variable sets the radius of the particle. The LENGTH variable is used - to define the particle length fraction. By default, the LENGTH is set - to .1, which means the particle occupies 10% of the flow region and the - other 90% is a color-code line. The SPACING and LENGTH variables only - make sense when the SIZE variable is nonzero (i.e., the particle is - bigger than the line). - """ - command = f"ANFLOW,{nfram},{delay},{ncycl},{time},{spacing},{size},{length}" - return self.run(command, **kwargs) - - def anharm( - self, - nfram="", - delay="", - ncycl="", - nperiod="", - cms_antype="", - cms_modopt="", - **kwargs, - ): - """Produces an animated sequence of time-harmonic results or complex mode - - APDL Command: ANHARM - shapes. - - Parameters - ---------- - nfram - Number of frame captures per cycle. Defaults to 12. - - delay - Time delay (seconds) during animation. Defaults to 0.1 seconds. - - ncycl - Number of animation cycles. Defaults to 5. Not available in the - GUI. - - nperiod - Period number for the second set of frames showing the decay or - growth of a mode shape. Only applies to complex mode shape - animation. Defaults to 1, animating the decay or growth on the - first period. Issue -1 to animate without decay or growth. - - cms_antype - Analysis type performed in the CMS use pass. No default. - - MODAL - Modal analysis - - HARMIC - Harmonic analysis - - cms_modopt - Mode extraction method selected in the CMS use pass. No default. - - UNSYM - Unsymmetric matrix - - DAMP - Damped system - - QRDAMP - Damped system using QR algorithm - - Notes - ----- - ANHARM invokes an ANSYS macro which produces an animated sequence of: - - Time-harmonic results in the case of a harmonic analysis - (ANTYPE,HARMIC) - - Complex mode shapes in the case of a modal analysis (ANTYPE,MODAL). - - In both cases, the results are those of the last plot action (for - example, PLNSOL,B,SUM). - - The animation converts the complex solution variables (real and - imaginary sets) into time varying results over one period. For example, - if NFRAM = 12, then the frame captures are in increments of 30 degree - phase angles. - - A second set of NFRAM frames will be generated for damped eigenmodes - from complex eigensolvers to visualize any exponential decay or growth - of the oscillations. The second set generated will display frames from - the period number specified by NPERIOD. - - In a CMS analysis, the ANHARM command can be used after the CMS - expansion pass or the use pass. To use ANHARM after the expansion pass, - you must indicate whether a modal analysis or a harmonic analysis was - performed in the CMS use pass by setting CMS_ANTYPE to either MODAL or - HARMIC. If the use pass was a modal analysis, you must also set the - CMS_MODOPT field to indicate the mode extraction method that was used - (UNSYM, DAMP, or QRDAMP). If CMS_MODOPT = QRDAMP, it is assumed that - CPXMOD was set to ON in the MODOPT command to request complex - eigenmodes. If the ANHARM command is used after the use pass, it is not - necessary to set the CMS_ANTYPE or CMS_MODOPT arguments. - - For more information about complex results postprocessing, see POST1 - and POST26 – Complex Results Postprocessing in the Mechanical APDL - Theory Reference - """ - command = f"ANHARM,{nfram},{delay},{ncycl},{nperiod},{cms_antype},{cms_modopt}" - return self.run(command, **kwargs) - - def anim(self, ncycl="", kcycl="", delay="", **kwargs): - """Displays animated graphics data for linear problems. - - APDL Command: ANIM - - Parameters - ---------- - ncycl - Number of cycles associated with the animation (defaults to 5 in - non-GUI mode only) - - kcycl - Animation mode: - - 0 - Continuous animation cycle (forward-reverse-forward-etc.) (default). - - 1 - Discontinuous animation cycle (forward-reset-forward-etc.). - - delay - Time delay (seconds) between animation frames (defaults to 0.1 - seconds). - - Notes - ----- - Use the ANIM command to create animations for linear problems only. The - command uses the currently displayed picture based on one particular - data set from the results file, and linearly interpolates that data - into different sets, displaying pictures of each interpolated data set - in sequence to create animation. For information about creating - animations for nonlinear problems, see the ANDATA command. - - This command is device-dependent. - - Do not resize the graphic while animation is in progress; doing so can - result in distorted plots. - - For more information, see the /SEG command for details about segment - storage, and the ANCNTR macro for a convenient method of storing - graphics frames in terminal memory segments. - - This command is valid in any processor. - """ - command = f"ANIM,{ncycl},{kcycl},{delay}" - return self.run(command, **kwargs) - - def anisos(self, nfram="", delay="", ncycl="", **kwargs): - """Produces an animated sequence of an isosurface. - - APDL Command: ANISOS - - Parameters - ---------- - nfram - Number of frames captures (defaults to 9). - - delay - Time delay during animation (defaults to 0.1 seconds). - - ncycl - Number of animation cycles (defaults to 5). Available in non-UI - mode only. - - Notes - ----- - ANISOS involves an ANSYS macro which produces an animation of an - isosurface of the last plot action command (for example, - PLNSOL,S,EQV). The ANISOS command operates only on graphic display - platforms supporting the /SEG command. After executing ANISOS, you can - replay the animated sequence by issuing the ANIM command. - - This command functions only in the postprocessor. - """ - command = f"ANISOS,{nfram},{delay},{ncycl}" - return self.run(command, **kwargs) - - def anmode(self, nfram="", delay="", ncycl="", kaccel="", **kwargs): - """Produces an animated sequence of a mode shape. - - APDL Command: ANMODE - - Parameters - ---------- - nfram - Number of frames captures (defaults to 5). - - delay - Time delay during animation (defaults to 0.1 seconds). - - ncycl - Number of animation cycles (defaults to 5). Available in non-UI - mode only. - - kaccel - Acceleration type: - - 0 - Linear acceleration. - - 1 - Sinusoidal acceleration. - - Notes - ----- - ANMODE involves an ANSYS macro which produces an animation of mode - shape of the last plot action command (for example, PLDISP). The - ANMODE command operates only on graphic display platforms supporting - the /SEG command. After executing ANMODE, you can replay the animated - sequence by issuing the ANIM command. - - This command functions only in the postprocessor. - """ - command = f"ANMODE,{nfram},{delay},{ncycl},{kaccel}" - return self.run(command, **kwargs) - - def anmres( - self, - delay="", - min_="", - max_="", - inc="", - autocntrky="", - freq="", - ext="", - **kwargs, - ): - """Performs animation of results over multiple results files in an - - APDL Command: ANMRES - explicit dynamic structural analysis or fluid flow analysis with - remeshing. - - Parameters - ---------- - delay - Time delay during animation (default = 0.5 seconds). - - min\\_ - Minimum results file number to animate. Default = 1 (for - Jobname.RS01). - - max\\_ - Maximum results file number to animate. Defaults to the highest - numbered results file, Jobname.RSnn. - - inc - Increment between results file numbers. Default = 1. - - autocntrky - Automatic contour scaling option. - - 0 - No auto-scaling (default). - - 1 - Auto-scaling on. - - freq - Results frequency key. - - 0 or 1 - Animate every results set in each Jobname.EXT file (default). - - 2 - Animate every other results set in each Jobname.EXT file. - - n - Animate every nth results set in each Jobname.EXT file. - - ext - Extension of result files - - 'rfl' - Animate Jobname.rflnn - - 'rs' - Animate Jobname.rsnn. Default = 'rs'. - - Notes - ----- - ANMRES invokes an ANSYS macro that performs animation across multiple - results files (Jobname.EXT, Jobname.EXT, etc.) produced by an explicit - dynamic structural analysis or fluid flow analysis with remeshing. - Multiple results files typically occur when adaptive meshing is used in - an explicit dynamic structural analysis or fluid flow analysis with - remeshing. Each results file must have more than one set of results. - ANMRES cannot be used for multiple results files that are caused by - file splitting. - - ANMRES animates results from files having the currently specified - jobname (Jobname.EXT - Jobname.EXT). To change the current jobname, - use the /FILNAME command. The animation is based on the last plot - command (e.g., PLDISP). - - Distributed ANSYS Restriction: This command is not supported in - Distributed ANSYS. - """ - command = f"ANMRES,{delay},{min_},{max_},{inc},{autocntrky},{freq},{ext}" - return self.run(command, **kwargs) - - def antime( - self, - nfram="", - delay="", - ncycl="", - autocntrky="", - rsltdat="", - min_="", - max_="", - **kwargs, - ): - """Produces a sequential contour animation over a range of time. - - APDL Command: ANTIME - - Parameters - ---------- - nfram - Number of frame captures (defaults to 5). - - delay - Time delay during animation (defaults to 0.1 seconds). - - ncycl - Number of animation cycles (defaults to 5). Available in non-UI - mode only. - - autocntrky - Auto-scales contour values, based on the overall subset range of - values. The auto-scaling option defaults to 0, no auto-scaling. - - rsltdat - The results data to be used for the animation sequence. This can - be: - - 0 - Current load step data (default). - - 1 - Range of load step data. - - 2 - Range of time data. - - min\\_ - The range minimum value. If left blank defaults to the first data - point. - - max\\_ - The range maximum value. If left blank defaults to the last data - point. - - Notes - ----- - The ANTIME command operates only on graphic display platforms - supporting the /SEG command. It uses an ANSYS macro to produce an - animation of contour values for the last plot action command (for - example, PLDISP). After executing ANTIME, the ANIM command will replay - the animated sequence. - - This command functions only in the postprocessor. - """ - command = f"ANTIME,{nfram},{delay},{ncycl},{autocntrky},{rsltdat},{min_},{max_}" - return self.run(command, **kwargs) - - def trtime(self, time="", spacing="", offset="", size="", length="", **kwargs): - """Defines the options used for the PLTRAC (particle flow or charged - - APDL Command: TRTIME - particle trace) command. - - Parameters - ---------- - time - Total Trace Time (seconds) (defaults to 0, which is the full flow - trace). - - spacing - Particle spacing in seconds (defaults to 0). - - offset - Particle offset in seconds (defaults to 0). It is used internally - in the ANFLOW macro to produce an animation of particle flow in a - flowing fluid or charged particle motion in an electric or magnetic - field. - - size - Particle size (defaults to 0, which is a line). - - length - Particle length fraction (defaults to .1). - - Notes - ----- - The TRTIME command varies the type of PLTRAC display produced. - Particle flow or charged particle traces follow a particle's path in - the forward and backward direction of travel. The DOF selected - determines the color of the particle trace. SPACING defines the - particle spacing in seconds from adjacent particles in the stream line. - OFFSET defines the offset in seconds from the spacing set by the - SPACING argument. - - LENGTH defines the particle length fraction. The default value (.1), - means the particle occupies 10% of the flow region, and the other 90% - is a color-coded line. - - SIZE sets the radius of the particle. Use SPACING, OFFSET and LENGTH - only when SIZE is nonzero (i.e., the particle is bigger than the line). - - Distributed ANSYS Restriction: This command is not supported in - Distributed ANSYS. - """ - command = f"TRTIME,{time},{spacing},{offset},{size},{length}" - return self.run(command, **kwargs) diff --git a/src/ansys/mapdl/core/_commands/post1_/controls.py b/src/ansys/mapdl/core/_commands/post1_/controls.py deleted file mode 100644 index b42d089c628..00000000000 --- a/src/ansys/mapdl/core/_commands/post1_/controls.py +++ /dev/null @@ -1,513 +0,0 @@ -# Copyright (C) 2016 - 2025 ANSYS, Inc. and/or its affiliates. -# SPDX-License-Identifier: MIT -# -# -# Permission is hereby granted, free of charge, to any person obtaining a copy -# of this software and associated documentation files (the "Software"), to deal -# in the Software without restriction, including without limitation the rights -# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -# copies of the Software, and to permit persons to whom the Software is -# furnished to do so, subject to the following conditions: -# -# The above copyright notice and this permission notice shall be included in all -# copies or substantial portions of the Software. -# -# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -# SOFTWARE. - - -class Controls: - def avprin(self, key="", effnu="", **kwargs): - """Specifies how principal and vector sums are to be calculated. - - APDL Command: AVPRIN - - Parameters - ---------- - key - Averaging key: - - 0 - Average the component values from the elements at a common node, then calculate - the principal or vector sum from the averaged components - (default). - - 1 - Calculate the principal or vector sum values on a per element basis, then - average these values from the elements at a common node. - - effnu - Effective Poisson's ratio used for computing the von Mises - equivalent strain (EQV). This command option is intended for use - with line elements or in load case operations (LCOPER) only; ANSYS - automatically selects the most appropriate effective Poisson's - ratio, as discussed below. - - Notes - ----- - Selects the method of combining components for certain derived nodal - results when two or more elements connect to a common node. The - methods apply to the calculations of derived nodal principal stresses, - principal strains, and vector sums for selects, sorts, and output - [NSEL, NSORT, PRNSOL, PLNSOL, etc.]. - - This command also defines the effective Poisson's ratio (EFFNU) used - for equivalent strain calculations. If you use EFFNU, the default - effective Poisson's ratios shown below will be overridden for all - elements by the EFFNU value. To return to the default settings, issue - the RESET command. The default value for EFFNU is: - - Poisson's ratio as defined on the MP commands for EPEL and EPTH - - 0.5 for EPPL and EPCR - - 0.5 if the referenced material is hyperelastic - - 0.0 for line elements (includes beam, link, and pipe elements, as well - as discrete elements), cyclic symmetry analysis, mode superposition - analyses (with MSUPkey = YES on the MXPAND command), and load case - operations (LCOPER). - - For the von Mises equivalent strain (EQV), it is always computed using - the average of the equivalent strains from the elements at a common - node irrespective of the value of the averaging KEY. If EFFNU is input, - though, the calculation will be performed according to the KEY setting. - - For a random vibration (PSD) analysis, issuing either AVPRIN,0 or - AVPRIN,1 calculates the principal stresses using the appropriate - averaging method. They are then used to determine SEQV. The output - will have non-zero values for the principal stresses. - - If AVPRIN is not issued, the Segalman-Fulcher method is used to - calculate SEQV. This method does not calculate principal stresses, but - directly calculates SEQV from the component stresses; therefore, the - output will have zero values for the principal stresses. Beam and pipe - elements are excluded - - This command is also valid in POST26, where applicable. - - See Combined Stresses and Strains in the Mechanical APDL Theory - Reference for more information. - """ - command = f"AVPRIN,{key},{effnu}" - return self.run(command, **kwargs) - - def avres(self, key="", opt="", **kwargs): - """Specifies how results data will be averaged when PowerGraphics is - - APDL Command: AVRES - enabled. - - Parameters - ---------- - key - Averaging key. - - 1 - Average results at all common subgrid locations. - - 2 - Average results at all common subgrid locations except where material type - [MAT] discontinuities exist. This option is the default. - - 3 - Average results at all common subgrid locations except where real constant - [REAL] discontinuities exist. - - 4 - Average results at all common subgrid locations except where material type - [MAT] or real constant [REAL] discontinuities exist. - - opt - Option to determine how results data are averaged. - - (blank) - Average surface results data using only the exterior element faces (default). - - FULL - Average surface results data using the exterior face and interior element data. - - Notes - ----- - The AVRES command specifies how results data will be averaged at - subgrid locations that are common to 2 or more elements. The command - is valid only when PowerGraphics is enabled (via the /GRAPHICS,POWER - command). - - With PowerGraphics active (/GRAPHICS,POWER), the averaging scheme for - surface data with interior element data included (AVRES,,FULL) and - multiple facets per edge (/EFACET,2 or /EFACET,4) will yield differing - minimum and maximum contour values depending on the Z-Buffering - options (/TYPE,,6 or /TYPE,,7). When the Section data is not included - in the averaging schemes (/TYPE,,7), the resulting absolute value for - the midside node is significantly smaller. - - PowerGraphics does not average your stresses across discontinuous - surfaces. The normals for various planes and facets are compared to a - tolerance to determine continuity. The ANGLE value you specify in the - /EDGE command is the tolerance for classifying surfaces as continuous - or "coplanar." - - The command affects nodal solution contour plots (PLNSOL), nodal - solution printout (PRNSOL), and subgrid solution results accessed - through the Query Results function (under General Postprocessing) in - the GUI. - - The command has no effect on the nodal degree of freedom solution - values (UX, UY, UZ, TEMP, etc.). - - For cyclic symmetry mode-superposition harmonic solutions, AVRES,,FULL - is not supported. Additionally, averaging does not occur across - discontinuous surfaces, and the ANGLE value on the /EDGE command has no - effect. - - The command is also available in /SOLU. - """ - command = f"AVRES,{key},{opt}" - return self.run(command, **kwargs) - - def efacet(self, num="", **kwargs): - """Specifies the number of facets per element edge for PowerGraphics - - APDL Command: /EFACET - displays. - - .. warning:: - This will not change element plotting within PyMAPDL with - ``eplot()`` - - Parameters - ---------- - num - Number of facets per element edge for element plots. - - 1 - Use 1 facet per edge (default for h-elements). - - 2 - Use 2 facets per edge. - - 4 - Use 4 facets per edge. - - Notes - ----- - /EFACET is valid only when PowerGraphics is enabled [/GRAPHICS,POWER], - except that it can be used in FULL graphics mode for element CONTA174. - (See the /GRAPHICS command and element CONTA174 in the Element - Reference for more information.) The /EFACET command is only applicable - to element type displays. - - /EFACET controls the fineness of the subgrid that is used for element - plots. The element is subdivided into smaller portions called facets. - Facets are piecewise linear surface approximations of the actual - element face. In their most general form, facets are warped planes in - 3-D space. A greater number of facets will result in a smoother - representation of the element surface for element plots. /EFACET may - affect results averaging. See Contour Displays in the Basic Analysis - Guide for more information. - - For midside node elements, use NUM = 2; if NUM = 1, no midside node - information is output. For non-midside node elements, NUM should be set - to 1. See the PLNSOL and PRNSOL commands for more information. - - With PowerGraphics active (/GRAPHICS,POWER), the averaging scheme for - surface data with interior element data included (AVRES,,FULL) and - multiple facets per edge (/EFACET,2 or /EFACET,4) will yield differing - minimum and maximum contour values depending on the Z-Buffering - options (/TYPE,,6 or /TYPE,,7). When the Section data is not included - in the averaging schemes (/TYPE,,7), the resulting absolute value for - the midside node is significantly smaller. - - For cyclic symmetry mode-superposition harmonic solutions, only NUM = 1 - is supported in postprocessing. - - Caution:: : If you specify /EFACET,1, PowerGraphics does not plot - midside nodes. You must use /EFACET,2 to make the nodes visible. - - This command is valid in any processor. - """ - command = f"/EFACET,{num}" - return self.run(command, **kwargs) - - def ernorm(self, key="", **kwargs): - """Controls error estimation calculations. - - APDL Command: ERNORM - - Parameters - ---------- - key - Control key: - - ON - Perform error estimation (default). This option is - not valid for PowerGraphics. - - OFF - Do not perform error estimation. - - Notes - ----- - Especially for thermal analyses, program speed increases if - error estimation is suppressed. Therefore, it might be - desirable to use error estimation only when needed. The value - of the ERNORM key is not saved on file.db. Consequently, you - need to reissue the ERNORM key after a RESUME if you wish to - deactivate error estimation again. - """ - return self.run("ERNORM,%s" % (str(key)), **kwargs) - - def inres( - self, - item1="", - item2="", - item3="", - item4="", - item5="", - item6="", - item7="", - item8="", - **kwargs, - ): - """Identifies the data to be retrieved from the results file. - - APDL Command: INRES - - Parameters - ---------- - item1, item2, item3, . . . , item8 - Data to be read into the database from the results file. May - consist of any of the following labels: - - ALL - All solution items (default). - - BASIC - NSOL, RSOL, NLOAD, STRS, FGRAD, and FFLUX items. - - NSOL - Nodal DOF solution. - - RSOL - Nodal reaction loads. - - ESOL - Element solution items (includes all of the following): - - NLOAD - Element nodal loads. - - STRS - Element nodal stresses. - - EPEL - Element elastic strains. - - EPTH - Element thermal, initial, and swelling strains. - - EPPL - Element plastic strains. - - EPCR - Element creep strains. - - FGRAD - Element nodal gradients. - - FFLUX - Element nodal fluxes. - - MISC - Element miscellaneous data (SMISC and NMISC). - - Notes - ----- - Identifies the type of data to be retrieved from the results file for - placement into the database through commands such as SET, SUBSET, and - APPEND. INRES is a companion command to the OUTRES command controlling - data written to the database and the results file. Since the INRES - command can only flag data that has already been written to the results - file, care should be taken when using the OUTRES command to include all - data you wish to retrieve for postprocessing later on. - """ - command = ( - f"INRES,{item1},{item2},{item3},{item4},{item5},{item6},{item7},{item8}" - ) - return self.run(command, **kwargs) - - def layer(self, num="", **kwargs): - """Specifies the element layer for which data are to be processed. - - APDL Command: LAYER - - Parameters - ---------- - num - Layer-processing mode: - - N - The layer number to process. The default value is 0. - - FCMAX - Processes the layer with the largest failure criteria. - - Notes - ----- - Specifies the element layer for which results data are to be listed, - plotted, or otherwise processed. - - Applies to stress and strain data for layered elements SHELL163, - SHELL181, SHELL281, ELBOW290, SOLID185, SOLID186, SOLSH190, SHELL208, - SHELL209, REINF264, and REINF265; heat flux and heat gradient for - SHELL131 and SHELL132. - - The SHELL command may then be used (with shell elements) to specify a - location (TOP, MID, BOT) within the layer for output. (The SHELL - command does not apply to thermal shell elements SHELL131 and - SHELL132.) Transverse shear stresses for MID are linearly averaged from - TOP and BOT, and do not reflect a parabolic distribution. Setting - KEYOPT(8) = 2 for SHELL181, SHELL281, SHELL208, SHELL209, and ELBOW290 - writes the mid-surface values directly to the results file and yields - more accurate values than linear averaging. - - Because energy is a per-element quantity, you cannot use this command - for energy output. - - When using the LAYER command with SHELL181, SOLID185, SOLID186, - SOLSH190, SHELL208, SHELL209, SHELL281, and ELBOW290, KEYOPT(8) must be - set to 1 (or 2 for SHELL181, SHELL281, ELBOW290, SHELL208, and - SHELL209) in order to store results for all layers. - - When NUM = FCMAX, you must provide the failure criterion input. If - specifying input via the FC command, all structural elements are - processed. For more information, see the documentation for the FC - command. - - Use this command with RSYS,LSYS to display results in the layer - coordinate system for a particular layer. - - For the ANSYS LS-DYNA product, this command works differently than - described above. For SHELL163, you must first use EDINT during the - solution phase to define the integration points for which you want - output data. Be aware that the output location for SHELL163 data is - always at the integration point, so "top" and "bottom" refer to the top - or bottom integration point, not necessarily the top or bottom surface. - For more information, see the ANSYS LS-DYNA User's Guide. - """ - command = f"LAYER,{num}" - return self.run(command, **kwargs) - - def rsys(self, kcn="", **kwargs): - """Activates a coordinate system for printout or display of element and - - APDL Command: RSYS - nodal results. - - Parameters - ---------- - kcn - The coordinate system to use for results output: - - 0 - Global Cartesian coordinate system (default, except for spectrum analyses). - - 1 - Global cylindrical coordinate system. - - 2 - Global spherical coordinate system. - - > 10 - Any existing local coordinate system. - - SOLU - Solution coordinate systems. For element quantities, these are the element - coordinate system for each element. For nodal quantities, - these are the nodal coordinate systems. If an element or - nodal coordinate system is not defined, ANSYS uses the - global Cartesian coordinate system. If you issue a LAYER,N - command (where N refers to a layer number), the results - appear in the layer coordinate system. (SOLU is the default - for spectrum analyses.) - - LSYS - Layer coordinate system. For layered shell and solid elements, the results - appear in their respective layer coordinate systems. For a - specific layer of interest, issue a LAYER,N command (where N - refers to a layer number). If a model has both nonlayered - and layered elements, you can use RSYS,SOLU and RSYS,LSYS - simultaneously (with RSYS,SOLU applicable to nonlayered - elements and RSYS,LSYS applicable to layered elements). To - reverse effects of the LSYS option, issue an RSYS,0 command. - LSYS is the default for spectrum analysis. - - Notes - ----- - The RSYS command activates a coordinate system for printing or - displaying element results data such as stresses and heat fluxes, and - nodal results data such as degrees of freedom and reactions. ANSYS - rotates the results data to the specified coordinate system during - printout, display, or element table operations (such as PRNSOL, PRESOL, - PLNSOL, and ETABLE). You can define coordinate systems with various - ANSYS commands such as LOCAL, CS, CLOCAL, and CSKP. - - If you issue RSYS with KCN > 10 (indicating a local coordinate system), - and the specified system is subsequently redefined, you must reissue - RSYS for results to be rotated into the redefined system. - - Note:: : The default coordinate system for certain elements, notably - shells, is not global Cartesian and is frequently not aligned at - adjacent elements. - - The use of RSYS,SOLU with these elements can make nodal averaging of - component element results, such as SX, SY, SZ, SXY, SYZ, and SXZ, - invalid and is not recommended. - - The RSYS command has no effect on beam or pipe stresses, which ANSYS - displays (via /ESHAPE,1 and PowerGraphics) in the element coordinate - system. - - Element results such as stresses and heat fluxes are in the element - coordinate systems when KCN = SOLU. Nodal requests for element results - (for example, PRNSOL,S,COMP) average the element values at the common - node; that is, the orientation of the node is not a factor in the - output of element quantities. For nearly all solid elements, the - default element coordinate systems are parallel to the global Cartesian - coordinate system. For shell elements and the remaining solid elements, - the default element coordinate system can differ from element to - element. For layered shell and layered solid elements, ANSYS initially - selects the element coordinate system when KCN = SOLU; you can then - select the layer coordinate system via the LAYER command. - - Nodal results such as degrees of freedom and reactions can be properly - rotated only if the resulting component set is consistent with the - degree-of-freedom set at the node. (The degree-of-freedom set at a node - is determined by the elements attached to the node.) For example, if a - node does not have a UZ degree of freedom during solution, then any Z - component resulting from a rotation does not print or display in POST1. - Therefore, results at nodes with a single degree-of-freedom (UY only, - for example) should not be rotated; that is, they should be viewed only - in the nodal coordinate system or a system parallel to the nodal - system. (The global Cartesian system--the RSYS command default--may not - be parallel to the nodal system.) Results at nodes with a 2-D degree- - of-freedom set (UX and UY, for example) should not be rotated out of - the 2-D plane. - - PowerGraphics - - For PowerGraphics, ANSYS plots PLVECT vector arrow displays (such - temperature, velocity, and force) in the global Cartesian coordinate - system (RSYS = 0). Subsequent operations revert to your original - coordinate system. - - PGR File - - When you generate a .PGR file in SOLUTION, you can use the Results - Viewer to display your stresses only in the coordinate system in which - you write your .PGR file. To view stresses in other coordinate systems, - load your results file into the Results Viewer and regenerate the data. - - Large Deflections - - If large deflection is active (NLGEOM,ON), ANSYS rotates the element - component result directions by the amount of rigid body rotation. - - ANSYS displays the element component results in the initial global - coordinate system for the following elements: SHELL181, SHELL281, - ELBOW290, PLANE182, PLANE183, SOLID185, SOLID186, SOLID187, SOLID272, - SOLID273, SOLID285, SOLSH190, SHELL208, and SHELL209. All other element - result transformations are, therefore, also relative to the initial - global system. Nodal degree-of-freedom results are based on the initial - (and not the updated) geometry. For all other element types, component - results displayed in the co-rotated coordinate system include the - element rigid body rotation from the initial global coordinate system, - and all other element result transformations are relative to the - rotated global system. - - LS-DYNA - - You can use the RSYS command to rotate stress data for all explicit - (ANSYS LS-DYNA) elements except BEAM161, COMBI165, and composite - SHELL163 (KEYOPT(3) = 1). In models that contain these element types - combined with other explicit elements, you must unselect the - unsupported elements before issuing the RSYS command. The command does - not support strain data for any explicit element types. If you request - strain results for explicit elements when RSYS is not set to the global - Cartesian coordinate system (KCN = 0), ANSYS ignores the printing or - plotting command. (ANSYS always rotates displacements into the results - coordinate system, independent of the explicit element type.) - """ - command = f"RSYS,{kcn}" - return self.run(command, **kwargs) diff --git a/src/ansys/mapdl/core/_commands/post1_/element_table.py b/src/ansys/mapdl/core/_commands/post1_/element_table.py deleted file mode 100644 index 7152d8eb289..00000000000 --- a/src/ansys/mapdl/core/_commands/post1_/element_table.py +++ /dev/null @@ -1,924 +0,0 @@ -# Copyright (C) 2016 - 2025 ANSYS, Inc. and/or its affiliates. -# SPDX-License-Identifier: MIT -# -# -# Permission is hereby granted, free of charge, to any person obtaining a copy -# of this software and associated documentation files (the "Software"), to deal -# in the Software without restriction, including without limitation the rights -# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -# copies of the Software, and to permit persons to whom the Software is -# furnished to do so, subject to the following conditions: -# -# The above copyright notice and this permission notice shall be included in all -# copies or substantial portions of the Software. -# -# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -# SOFTWARE. - -from typing import Optional - -from ansys.mapdl.core.mapdl_types import MapdlInt - - -class ElementTable: - def detab( - self, - elem="", - lab="", - v1="", - v2="", - v3="", - v4="", - v5="", - v6="", - **kwargs, - ): - """Modifies element table results in the database. - - APDL Command: DETAB - - Parameters - ---------- - elem - Element for which results are to be modified. If ALL, modify all - selected elements [ESEL] results. If ELEM = P, graphical picking - is enabled and all remaining command fields are ignored (valid only - in the GUI). A component name may also be substituted for ELEM. - - lab - Label identifying results. Valid labels are as defined with the - ETABLE command. Issue ETABLE,STAT to display labels and values. - - v1 - Value assigned to this element table result in the database. If - zero, a zero value will be assigned. If blank, value remains - unchanged. - - v2, v3, v4, . . . , v6 - Additional values (if any) assigned to consecutive element table - columns. - - Notes - ----- - Modifies element table [ETABLE] results in the database. For example, - DETAB,35,ABC,1000,2000,1000 assigns 1000, 2000, and 1000 to the first - three table columns starting with label ABC for element 35. Use the - PRETAB command to list the current results. After deleting a column of - data using ETABLE,Lab,ERASE, the remaining columns of data are not - shifted to compress the empty slot. Therefore, the user must allocate - null (blank) values for V1, V2...V6 for any ETABLE entries which have - been deleted by issuing ETABLE,Lab,ERASE. All data are stored in the - solution coordinate system but will be displayed in the results - coordinate system [RSYS]. - """ - command = f"DETAB,{elem},{lab},{v1},{v2},{v3},{v4},{v5},{v6}" - return self.run(command, **kwargs) - - def esort( - self, - item: str = "", - lab: str = "", - order: MapdlInt = "", - kabs: MapdlInt = "", - numb: MapdlInt = "", - **kwargs, - ) -> Optional[str]: - """Sorts the element table. - - APDL Command: ESORT - - Parameters - ---------- - item - Label identifying the item: - ETAB - (currently the only Item available) - - lab - element table label: Lab - Any user-defined label from - the ETABLE command (input in the Lab field of the ETABLE - command). - - order - Order of sort operation: - - 0 - Sort into descending order. - - 1 - Sort into ascending order. - - kabs - Absolute value key: - - 0 - Sort according to real value. - - 1 - Sort according to absolute value. - - numb - Number of elements (element table rows) to be sorted in - ascending or descending order (ORDER) before sort is - stopped (remainder will be in unsorted sequence) - (defaults to all elements). - - Notes - ----- - The element table rows are sorted based on the column - containing the Lab values. Use EUSORT to restore the original - order. If ESORT is specified with PowerGraphics on - [/GRAPHICS,POWER], then the nodal solution results listing - [PRNSOL] will be the same as with the full graphics mode - [/GRAPHICS,FULL]. - """ - command = f"ESORT,{item},{lab},{order},{kabs},{numb}" - return self.run(command, **kwargs) - - def etable( - self, - lab: str = "", - item: str = "", - comp: str = "", - option: str = "", - **kwargs, - ) -> Optional[str]: - """Fills a table of element values for further processing. - - APDL Command: ETABLE - - The ETABLE command defines a table of values per element (the - element table) for use in further processing. The element - table is organized similar to spreadsheet, with rows - representing all selected elements and columns consisting of - result items which have been moved into the table (Item,Comp) - via ETABLE. Each column of data is identified by a - user-defined label (Lab) for listings and displays. - - After entering the data into the element table, you are not - limited to merely listing or displaying your data (PLESOL, - PRESOL, etc.). You may also perform many types of operations - on your data, such as adding or multiplying columns (SADD, - SMULT), defining allowable stresses for safety calculations - (SALLOW), or multiplying one column by another (SMULT). See - Getting Started in the Basic Analysis Guide for more - information. - - Various results data can be stored in the element table. For - example, many items for an element are inherently - single-valued (one value per element). The single-valued items - include: SERR, SDSG, TERR, TDSG, SENE, SEDN, TENE, KENE, AENE, - JHEAT, JS, VOLU, and CENT. All other items are multivalued - (varying over the element, such that there is a different - value at each node). Because only one value is stored in the - element table per element, an average value (based on the - number of contributing nodes) is calculated for multivalued - items. Exceptions to this averaging procedure are FMAG and all - element force items, which represent the sum only of the - contributing nodal values. - - Two methods of data access can be used with the ETABLE - command. The method you select depends upon the type of data - that you want to store. Some results can be accessed via a - generic label (Component Name method), while others require a - label and number (Sequence Number method). - - The Component Name method is used to access the General - element data (that is, element data which is generally - available to most element types or groups of element - types). All of the single-valued items and some of the more - general multivalued items are accessible with the Component - Name method. Various element results depend on the - calculation method and the selected results location (AVPRIN, - RSYS, LAYER, SHELL, and ESEL). - - Although nodal data is readily available for listings and - displays (PRNSOL, PLNSOL) without using the element table, you - may also use the Component Name method to enter these results - into the element table for further "worksheet" - manipulation. (See Getting Started in theBasic Analysis Guide - for more information.) A listing of the General Item and Comp - labels for the Component Name method is shown below. - - The Sequence Number method allows you to view results for data - that is not averaged (such as pressures at nodes, temperatures - at integration points, etc.), or data that is not easily - described in a generic fashion (such as all derived data for - structural line elements and contact elements, all derived - data for thermal line elements, layer data for layered - elements, etc.). A table illustrating the Items (such as LS, - LEPEL, LEPTH, SMISC, NMISC, SURF, etc.) and corresponding - sequence numbers for each element is shown in the Output Data - section of each element description found in the Element - Reference. - - Some element table data are reported in the results coordinate - system. These include all component results (for example, UX, - UY, etc.; SX, SY, etc.). The solution writes component results - in the database and on the results file in the solution - coordinate system. When you issue the ETABLE command, these - results are then transformed into the results coordinate - system (RSYS) before being stored in the element table. The - default results coordinate system is global Cartesian - (RSYS,0). All other data are retrieved from the database and - stored in the element table with no coordinate transformation. - - Use the PRETAB, PLETAB, or ETABLE,STAT commands to display the - stored table values. Issue ETABLE,ERAS to erase the entire - table. Issue ETABLE,Lab,ERAS to erase a Lab column. - - The element table data option (Option) is not available for - all output items. - - Parameters - ---------- - lab - Any unique user defined label for use in subsequent - commands and output headings (maximum of eight characters - and not a General predefined Item label). Defaults to an - eight character label formed by concatenating the first - four characters of the Item and Comp labels. If the same - as a previous user label, this result item will be - included under the same label. Up to 200 different labels - may be defined. The following labels are predefined and - are not available for user-defined labels: ``'REFL''`, - ``'STAT'``, and ``'ERAS'``. ``lab='REFL'`` refills all - tables previously defined with the :meth:`etable` commands - (not the CALC module commands) according to the latest - ETABLE specifications and is convenient for refilling - tables after the load step (SET) has been - changed. Remaining fields will be ignored if - ``Lab='REFL'``. ``lab='STAT'`` displays stored table - values. ``lab='ERAS'`` erases the entire table. - - item - Label identifying the item. General item labels are shown - in the table below. Some items also require a component - label. Character parameters may be used. ``item='eras'`` - erases a Lab column. - - comp - Component of the item (if required). General component - labels are shown in the table below. Character parameters - may be used. - - option - Option for storing element table data: - - * ``'MIN'`` - Store minimum element nodal value of the specified - item component. - * ``'MAX'`` - Store maximum element nodal value of the specified - item component. - * ``'AVG'`` - Store averaged element centroid value of the - specified item component (default). - - Examples - -------- - Print the volume of individual elements. - - >>> mapdl.clear() - >>> output = mapdl.input(examples.vmfiles['vm6']) - >>> mapdl.post1() - >>> label = 'MYVOLU' - >>> mapdl.etable(label, 'VOLU') - >>> print(mapdl.pretab(label)) - PRINT ELEMENT TABLE ITEMS PER ELEMENT - *****ANSYS VERIFICATION RUN ONLY***** - DO NOT USE RESULTS FOR PRODUCTION - ***** POST1 ELEMENT TABLE LISTING ***** - STAT CURRENT - ELEM XDISP - 1 0.59135E-001 - 2 0.59135E-001 - 3 0.59135E-001 - ... - - """ - command = f"ETABLE,{lab},{item},{comp},{option}" - return self.run(command, **kwargs) - - def eusort(self, **kwargs) -> Optional[str]: - """Restore original order of the element table. - - APDL Command: EUSORT - - Notes - ----- - Changing the selected element set [ESEL] also restores the original - element order. - - Examples - -------- - >>> mapdl.post1() - >>> mapdl.eusort() - 'ELEMENT SORT REMOVED' - - """ - return self.run("EUSORT", **kwargs) - - def pletab(self, itlab="", avglab="", **kwargs): - """Displays element table items. - - APDL Command: PLETAB - - Parameters - ---------- - itlab - User-defined label, as specified with the ETABLE command, of item - to be displayed. - - avglab - Averaging operation: - - NOAV - Do not average element items at common nodes (default). - - AVG - Average the element items at common nodes. - - Notes - ----- - Displays items stored in the table defined with the ETABLE command for - the selected elements. For display purposes, items are assumed to be - constant over the element and assigned to each of its nodes. Contour - display lines (lines of constant value) are determined by linear - interpolation within each element from the nodal values. These nodal - values have the option of being averaged (values are averaged at a node - whenever two or more elements connect to the same node) or not averaged - (discontinuous). The discontinuity between contour lines of adjacent - elements is an indication of the gradient across elements. - - Portions of this command are not supported by PowerGraphics - [/GRAPHICS,POWER]. - """ - command = f"PLETAB,{itlab},{avglab}" - return self.run(command, **kwargs) - - def plls(self, labi="", labj="", fact="", kund="", viewup="", **kwargs): - """Displays element table items as contoured areas along elements. - - APDL Command: PLLS - - Parameters - ---------- - labi - Label of element table item (ETABLE) for node I magnitude. - - labj - Label of element table item for node J magnitude. - - fact - Scale factor for display (defaults to 1). A negative scaling - factor may be used to invert the display. - - kund - Undisplaced shape key: - - 0 - Display selected items on undeformed shape. - - 1 - Display selected items on deformed shape. - - viewup - View Up key: - - 0 - Ignore the view-up (/VUP) vector when calculating trapezoid orientation - (default). - - 1 - Use the view-up (/VUP) vector to calculate trapezoid orientation. - - Notes - ----- - Displays selected items (such as shears and moments) as a contoured - area (trapezoid) display along line elements and 2-D axisymmetric shell - elements (such as shear and moment diagrams). Three sides of the - trapezoid are formed by the element (one side) and lines at nodes I and - J of length proportional to the item magnitude and displayed normal to - the element and the viewing direction (the two parallel sides). - - When ViewUP = 1, the trapezoid is oriented within the plane created by - the element and the global Cartesian coordinate system reference - orientation (/VUP or view up) vector. In this case, the program does - not perform the calculation involving the element and view direction. - - Portions of this command are not supported by PowerGraphics - [/GRAPHICS,POWER]. - """ - command = f"PLLS,{labi},{labj},{fact},{kund},{viewup}" - return self.run(command, **kwargs) - - def pretab( - self, - lab1="", - lab2="", - lab3="", - lab4="", - lab5="", - lab6="", - lab7="", - lab8="", - lab9="", - **kwargs, - ): - """Print the element table items. - - APDL Command: PRETAB - - Parameters - ---------- - lab1, lab2, lab3, ... , lab9 - Print selected items. Valid labels are ``""`` or any - label as specified with the ETABLE command. Convenience - labels may be used for Lab1 to select groups of labels (10 - labels maximum): GRP1 for first 10 stored items; GRP2 for - items 11 to 20; GRP3 for items 21 to 30; GRP4 for items 31 - to 40; GRP5 for items 41 to 50. Run ``etable("stat")`` - command to list stored item order. If all labels are - blank, print first 10 stored items (GRP1). - - Notes - ----- - Prints the items stored in the table defined with the - :func:`etable() ` command. - Item values will be listed for the selected elements in the - sorted sequence [ESORT]. :func:`force() - ` can be used to define which - component of the nodal load is to be used (static, damping, - inertia, or total). - - Examples - -------- - Print out element displacement results. - - >>> mapdl.etable("values", "U", "X") - STORE VALUES FROM ITEM=U COMP=X FOR ALL SELECTED ELEMENTS - - Now print out the table. - - >>> mapdl.pretab().splitlines()[:4] - ['PRINT ELEMENT TABLE ITEMS PER ELEMENT', - ' 1 0.1073961540E-005 0.1073961540E-005', - ' 2 0.3156317304E-005 0.3156317304E-005', - ' 3 0.5125435148E-005 0.5125435148E-005'] - - Note that can access the array directly from APDL: - - >>> mapdl.get_array("elem", 1, "ETAB", "values") - array([1.07396154e-06, 3.15631730e-06, 5.12543515e-06, ..., - 5.41204700e-06, 3.33649806e-06, 1.13836132e-06]) - - """ - return self.run( - f"PRETAB,{lab1},{lab2},{lab3},{lab4},{lab5},{lab6},{lab7},{lab8},{lab9}", - **kwargs, - ) - - def sabs(self, key="", **kwargs): - """Specifies absolute values for element table operations. - - APDL Command: SABS - - Parameters - ---------- - key - Absolute value key: - - 0 - Use algebraic values in operations. - - 1 - Use absolute values in operations. - - Notes - ----- - Causes absolute values to be used in the SADD, SMULT, SMAX, SMIN, and - SSUM operations. - """ - command = f"SABS,{key}" - return self.run(command, **kwargs) - - def sadd(self, labr="", lab1="", lab2="", fact1="", fact2="", const="", **kwargs): - """Forms an element table item by adding two existing items. - - APDL Command: SADD - - Parameters - ---------- - labr - Label assigned to results. If same as existing label, the existing - values will be overwritten by these results. - - lab1 - First labeled result item in operation. - - lab2 - Second labeled result item in operation (may be blank). - - fact1 - Scale factor applied to Lab1. A (blank) or '0' entry defaults to - 1.0. - - fact2 - Scale factor applied to Lab2. A (blank) or '0' entry defaults to - 1.0. - - const - Constant value. - - Notes - ----- - Forms a labeled result (see ETABLE command) for the selected elements - by adding two existing labeled result items according to the operation: - - LabR = (FACT1 x Lab1) + (FACT2 x Lab2) + CONST - - May also be used to scale results for a single labeled result item. If - absolute values are requested [SABS,1], absolute values of Lab1 and - Lab2 are used. - """ - command = f"SADD,{labr},{lab1},{lab2},{fact1},{fact2},{const}" - return self.run(command, **kwargs) - - def sallow( - self, - strs1="", - strs2="", - strs3="", - strs4="", - strs5="", - strs6="", - **kwargs, - ): - """Defines the allowable stress table for safety factor calculations. - - APDL Command: SALLOW - - Parameters - ---------- - strs1, strs2, strs3, . . . , strs6 - Input up to six allowable stresses corresponding to the temperature - points [TALLOW]. - - Notes - ----- - Defines the allowable stress table for safety factor calculations - [SFACT,SFCALC]. Use the STAT command to list current allowable stress - table. Repeat SALLOW to zero table and redefine points (6 maximum). - - Safety factor calculations are not supported by PowerGraphics. Both the - SALLOW and TALLOW commands must be used with the Full Model Graphics - display method active. - """ - command = f"SALLOW,{strs1},{strs2},{strs3},{strs4},{strs5},{strs6}" - return self.run(command, **kwargs) - - def sexp(self, labr="", lab1="", lab2="", exp1="", exp2="", **kwargs): - """Forms an element table item by exponentiating and multiplying. - - APDL Command: SEXP - - Parameters - ---------- - labr - Label assigned to results. If same as existing label, the existing - values will be overwritten by these results. - - lab1 - First labeled result item in operation. - - lab2 - Second labeled result item in operation (may be blank). - - exp1 - Exponent applied to Lab1. - - exp2 - Exponent applied to Lab2. - - Notes - ----- - Forms a labeled result item (see ETABLE command) for the selected - elements by exponentiating and multiplying two existing labeled result - items according to the operation: - - ``LabR = (|Lab1|EXP1) x (|Lab2|EXP2)`` - - Roots, reciprocals, and divides may also be done with this command. - """ - command = f"SEXP,{labr},{lab1},{lab2},{exp1},{exp2}" - return self.run(command, **kwargs) - - def sfact(self, type_="", **kwargs): - """Allows safety factor or margin of safety calculations to be made. - - APDL Command: SFACT - - Parameters - ---------- - type\\_ - Type of calculation: - - 0 - No nodal safety factor or margin of safety calculations. - - 1 - Calculate and store safety factors in place of nodal stresses. - - 2 - Calculate and store margins of safety in place of nodal stresses. - - Notes - ----- - Allows safety factor (SF) or margin of safety (MS) calculations to be - made for the average nodal stresses according to: - - ``SF = SALLOW/|Stress|`` - - ``MS = (SALLOW/|Stress|) -- 1.0`` - - Calculations are done during the display, select, or sort operation (in - the active coordinate system [RSYS]) with results stored in place of - the nodal stresses. Use the PRNSOL or PLNSOL command to display the - results. - - The results are meaningful only for the stress (SIG1, SIGE, - etc.) upon which SALLOW is based. Nodal temperatures used are those - automatically stored for the node. Related commands are SFCALC, - SALLOW, TALLOW. - """ - command = f"SFACT,{type_}" - return self.run(command, **kwargs) - - def sfcalc(self, labr="", labs="", labt="", type_="", **kwargs): - """Calculates the safety factor or margin of safety. - - APDL Command: SFCALC - - Parameters - ---------- - labr - Label assigned to results. If same as existing label, the existing - values will be overwritten by these results. - - labs - Labeled result item corresponding to the element stress. - - labt - Labeled result item corresponding to the element temperature. - - type\\_ - Type of calculation: - - 0 or 1 - Use safety factor (SF) calculation. - - 2 - Use margin of safety (MS) calculation. - - 3 - Use 1/SF calculation. - - Notes - ----- - Calculates safety factor (SF) or margin of safety (MS) as described for - the SFACT command for any labeled result item (see ETABLE command) for - the selected elements. Use the PRETAB or PLETAB command to display - results. Allowable element stress is determined from the SALLOW-TALLOW - table [SALLOW, TALLOW]. - """ - command = f"SFCALC,{labr},{labs},{labt},{type_}" - return self.run(command, **kwargs) - - def smax(self, labr="", lab1="", lab2="", fact1="", fact2="", **kwargs): - """Forms an element table item from the maximum of two other items. - - APDL Command: SMAX - - Parameters - ---------- - labr - Label assigned to results. If same as existing label, the existing - values will be overwritten by these results. - - lab1 - First labeled result item in operation. - - lab2 - Second labeled result item in operation (may be blank). - - fact1 - Scale factor applied to Lab1. A (blank) or '0' entry defaults to - 1.0. - - fact2 - Scale factor applied to Lab2. A (blank) or '0' entry defaults to - 1.0. - - Notes - ----- - Forms a labeled result item (see ETABLE command) for the selected - elements by comparing two existing labeled result items according to - the operation: - - LabR = (FACT1 x Lab1) cmx (FACT2 x Lab2) - - where "cmx" means "compare and save maximum." If absolute values are - requested [SABS,1], the absolute values of Lab1 and Lab2 are used. - """ - command = f"SMAX,{labr},{lab1},{lab2},{fact1},{fact2}" - return self.run(command, **kwargs) - - def smin(self, labr="", lab1="", lab2="", fact1="", fact2="", **kwargs): - """Forms an element table item from the minimum of two other items. - - APDL Command: SMIN - - Parameters - ---------- - labr - Label assigned to results. If same as existing label, the existing - values will be overwritten by these results. - - lab1 - First labeled result item in operation. - - lab2 - Second labeled result item in operation (may be blank). - - fact1 - Scale factor applied to Lab1. A (blank) or '0' entry defaults to - 1.0. - - fact2 - Scale factor applied to Lab2. A (blank) or '0' entry defaults to - 1.0. - - Notes - ----- - Forms a labeled result item (see ETABLE command) for the selected - elements by comparing two existing labeled result items according to - the operation: - - LabR = (FACT1 x Lab1) cmn (FACT2 x Lab2) - - where "cmn" means "compare and save minimum." If absolute values are - requested [SABS,1], the absolute values of Lab1 and Lab2 are used. - """ - command = f"SMIN,{labr},{lab1},{lab2},{fact1},{fact2}" - return self.run(command, **kwargs) - - def smult(self, labr="", lab1="", lab2="", fact1="", fact2="", **kwargs): - """Forms an element table item by multiplying two other items. - - APDL Command: SMULT - - Parameters - ---------- - labr - Label assigned to results. If same as existing label, the existing - values will be overwritten by these results. - - lab1 - First labeled result item in operation. - - lab2 - Second labeled result item in operation (may be blank). - - fact1 - Scale factor applied to Lab1. A (blank) or '0' entry defaults to - 1.0. - - fact2 - Scale factor applied to Lab2. A (blank) or '0' entry defaults to - 1.0. - - Notes - ----- - Forms a labeled result item (see ETABLE command) for the selected - elements by multiplying two existing labeled result items according to - the operation: - - LabR = (FACT1 x Lab1) x (FACT2 x Lab2) - - May also be used to scale results for a single labeled result item. If - absolute values are requested [SABS,1], the absolute values of Lab1 and - Lab2 are used. - """ - command = f"SMULT,{labr},{lab1},{lab2},{fact1},{fact2}" - return self.run(command, **kwargs) - - def ssum(self, **kwargs): - """Calculates and prints the sum of element table items. - - APDL Command: SSUM - - Notes - ----- - Calculates and prints the tabular sum of each existing labeled result - item [ETABLE] for the selected elements. If absolute values are - requested [SABS,1], absolute values are used. - """ - command = f"SSUM," - return self.run(command, **kwargs) - - def tallow( - self, - temp1="", - temp2="", - temp3="", - temp4="", - temp5="", - temp6="", - **kwargs, - ): - """Defines the temperature table for safety factor calculations. - - APDL Command: TALLOW - - Parameters - ---------- - temp1, temp2, temp3, . . . , temp6 - Input up to six temperatures covering the range of nodal - temperatures. Temperatures must be input in ascending order. - - Notes - ----- - Defines the temperature table for safety factor calculations [SFACT, - SALLOW]. Use STAT command to list current temperature table. Repeat - TALLOW command to zero table and redefine points (6 maximum). - - Safety factor calculations are not supported by PowerGraphics. Both the - SALLOW and TALLOW commands must be used with the Full Model Graphics - display method active. - """ - command = f"TALLOW,{temp1},{temp2},{temp3},{temp4},{temp5},{temp6}" - return self.run(command, **kwargs) - - def vcross( - self, - labxr="", - labyr="", - labzr="", - labx1="", - laby1="", - labz1="", - labx2="", - laby2="", - labz2="", - **kwargs, - ): - """Forms element table items from the cross product of two vectors. - - APDL Command: VCROSS - - Parameters - ---------- - labxr, labyr, labzr - Label assigned to X, Y, and Z-component of resultant vector. - - labx1, laby1, labz1 - X, Y, and Z-component of first vector label. - - labx2, laby2, labz2 - X, Y, and Z-component of second vector label. - - Notes - ----- - Forms labeled result items for the selected element from the cross - product of two vectors: - - {LabXR, LabYR, LabZR} = {LabX1, LabY1, LabZ1} X {LabX2, LabY2, LabZ2} - - Data must be in a consistent coordinate system. Labels are those - associated with the ETABLE command. - """ - command = f"VCROSS,{labxr},{labyr},{labzr},{labx1},{laby1},{labz1},{labx2},{laby2},{labz2}" - return self.run(command, **kwargs) - - def vdot( - self, - labr="", - labx1="", - laby1="", - labz1="", - labx2="", - laby2="", - labz2="", - **kwargs, - ): - """Forms an element table item from the dot product of two vectors. - - APDL Command: VDOT - - Parameters - ---------- - labr - Label assigned to dot product result. - - labx1, laby1, labz1 - X, Y, and Z-component of first vector label. - - labx2, laby2, labz2 - X, Y, and Z-component of second vector label. - - Notes - ----- - Forms labeled result items for the selected element from the dot - product of two vectors: - - LabR = {LabX1, LabY1, LabZ1} : : {LabX2, LabY2, LabZ2} - - Data must be in a consistent coordinate system. Labels are those - associated with the ETABLE command. - """ - command = f"VDOT,{labr},{labx1},{laby1},{labz1},{labx2},{laby2},{labz2}" - return self.run(command, **kwargs) diff --git a/src/ansys/mapdl/core/_commands/post1_/failure_criteria.py b/src/ansys/mapdl/core/_commands/post1_/failure_criteria.py deleted file mode 100644 index b401a7e3d8a..00000000000 --- a/src/ansys/mapdl/core/_commands/post1_/failure_criteria.py +++ /dev/null @@ -1,249 +0,0 @@ -# Copyright (C) 2016 - 2025 ANSYS, Inc. and/or its affiliates. -# SPDX-License-Identifier: MIT -# -# -# Permission is hereby granted, free of charge, to any person obtaining a copy -# of this software and associated documentation files (the "Software"), to deal -# in the Software without restriction, including without limitation the rights -# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -# copies of the Software, and to permit persons to whom the Software is -# furnished to do so, subject to the following conditions: -# -# The above copyright notice and this permission notice shall be included in all -# copies or substantial portions of the Software. -# -# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -# SOFTWARE. - - -class FailureCriteria: - def fc( - self, - mat="", - lab1="", - lab2="", - data1="", - data2="", - data3="", - data4="", - data5="", - data6="", - **kwargs, - ): - """Provides failure criteria information and activates a data - - APDL Command: FC - table to input temperature-dependent stress and strain limits. - - Parameters - ---------- - mat - Material reference number. You can define failure criteria - for up to 250 different materials. - - lab1 - Type of data. - - TEMP - Temperatures. Each of the materials you define can - have a different set of temperatures to define the failure - criteria. - - EPEL - Strains. - - S - Stresses. - - lab2 - Specific criteria. Not used if Lab1 = TEMP. - - XTEN - Allowable tensile stress or strain in the - x-direction. (Must be positive.) - - XCMP - Allowable compressive stress or strain in the - x-direction. (Defaults to negative of XTEN.) - - YTEN - Allowable tensile stress or strain in the - y-direction. (Must be positive.) - - YCMP - Allowable compressive stress or strain in the - y-direction. (Defaults to negative of YTEN.) - - ZTEN - Allowable tensile stress or strain in the - z-direction. (Must be positive.) - - ZCMP - Allowable compressive stress or strain in the - z-direction. (Defaults to negative of ZTEN.) - - XY - Allowable XY stress or shear strain. (Must be - positive.) - - YZ - Allowable YZ stress or shear strain. (Must be - positive.) - - XZ - Allowable XZ stress or shear strain. (Must be - positive.) - - XYCP - XY coupling coefficient (Used only if Lab1 = - S). Defaults to -1.0. [1] - - YZCP - YZ coupling coefficient (Used only if Lab1 = - S). Defaults to -1.0. [1] - - XZCP - XZ coupling coefficient (Used only if Lab1 = - S). Defaults to -1.0. [1] - - data1, data2, data3, . . . , data6 - Description of DATA1 through DATA6. - - T1, T2, T3, T4, T5, T6 - Temperature at which limit data - is input. Used only when Lab1 = TEMP. - - V1, V2, V3, V4, V5, V6 - Value of limit stress or strain - at temperature T1 through T6. Used only when Lab1 = S or - EPEL. - - Notes - ----- - The data table can be input in either PREP7 or POST1. This - table is used only in POST1. When you postprocess failure - criteria results defined via the FC command (PLESOL, PRESOL, - PLNSOL, PRNSOL, PRRSOL, etc.), the active coordinate system - must be the coordinate system of the material being - analyzed. You do this using RSYS, SOLU. For layered - applications, you also use the LAYER command. See the specific - element documentation in the Element Reference for information - on defining your coordinate system for layers. - - Some plotting and printing functions will not support Failure - Criteria for your PowerGraphics displays. This could result in - minor changes to other data when Failure Criteria are - applied. See the appropriate plot or print command - documentation for more information. - """ - command = "FC,%s,%s,%s,%s,%s,%s,%s,%s,%s" % ( - str(mat), - str(lab1), - str(lab2), - str(data1), - str(data2), - str(data3), - str(data4), - str(data5), - str(data6), - ) - return self.run(command, **kwargs) - - def fccheck(self, **kwargs): - """Checks both the strain and stress input criteria for all materials. - - APDL Command: FCCHECK - - Notes - ----- - Issue the FCCHECK command to check the completeness of the input during - the input phase. - """ - command = "FCCHECK," - return self.run(command, **kwargs) - - def fcdele(self, mat="", **kwargs): - """Deletes previously defined failure criterion data for the given - - APDL Command: FCDELE - material. - - Parameters - ---------- - mat - Material number. Deletes all FC command input for this material. - - Notes - ----- - This command is also valid in POST1. - """ - command = "FCDELE,%s" % (str(mat)) - return self.run(command, **kwargs) - - def fclist(self, mat="", temp="", **kwargs): - """To list what the failure criteria is that you have input. - - APDL Command: FCLIST - - Parameters - ---------- - mat - Material number (defaults to ALL for all materials). - - temp - Temperature to be evaluated at (defaults to TUNIF). - - Notes - ----- - This command allows you to see what you have already input for failure - criteria using the FC commands. - """ - return self.run(f"FCLIST,{mat},,{temp}", **kwargs) - - def fctyp(self, oper="", lab="", **kwargs): - """Activates or removes failure-criteria types for postprocessing. - - APDL Command: FCTYP - - Parameters - ---------- - oper - Operation key: - - ADD - Activate failure-criteria types. This option is the default behavior. - - DELE - Remove failure-criteria types. - - lab - Valid failure-criteria labels. If ALL, select all available - (including user-defined) failure criteria. - - EMAX - Maximum strain criterion (default) - - SMAX - Maximum stress criterion (default) - - TWSI - Tsai-Wu strength index (default) - - TWSR - Inverse of Tsai-Wu strength ratio index (default) - - HFIB - Hashin fiber failure criterion - - HMAT - Hashin matrix failure criterion - - PFIB - Puck fiber failure criterion - - PMAT - Puck inter-fiber (matrix) failure criterion - - L3FB - LaRc03 fiber failure criterion - - L3MT - LaRc03 matrix failure criterion - - L4FB - LaRc04 fiber failure criterion - - L4MT - LaRc04 matrix failure criterion - - USR1 through USR9 - User-defined failure criteria - - Notes - ----- - The FCTYP command modifies the list of active failure criteria. - - By default, active failure criteria include EMAX, SMAX, TWSI, and TWSR. - - The command affects any subsequent postprocessing listing and plotting - commands (such as PRESOL, PRNSOL, PLESOL, PLNSOL, and ETABLE). - - A single FCTYP command allows up to six failure-criteria labels. If - needed, reissue the command to activate or remove additional failure- - criteria types. - """ - command = f"FCTYP,{oper},{lab}" - return self.run(command, **kwargs) diff --git a/src/ansys/mapdl/core/_commands/post1_/listing.py b/src/ansys/mapdl/core/_commands/post1_/listing.py deleted file mode 100644 index 7e52cc50276..00000000000 --- a/src/ansys/mapdl/core/_commands/post1_/listing.py +++ /dev/null @@ -1,307 +0,0 @@ -# Copyright (C) 2016 - 2025 ANSYS, Inc. and/or its affiliates. -# SPDX-License-Identifier: MIT -# -# -# Permission is hereby granted, free of charge, to any person obtaining a copy -# of this software and associated documentation files (the "Software"), to deal -# in the Software without restriction, including without limitation the rights -# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -# copies of the Software, and to permit persons to whom the Software is -# furnished to do so, subject to the following conditions: -# -# The above copyright notice and this permission notice shall be included in all -# copies or substantial portions of the Software. -# -# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -# SOFTWARE. - - -class Listing: - def format( - self, - ndigit="", - ftype="", - nwidth="", - dsignf="", - line="", - char="", - **kwargs, - ): - """Specifies format controls for tables. - - APDL Command: /FORMAT - - Parameters - ---------- - ndigit - Number of digits (3 to 32) in first table column (usually the node - or element number). Initially defaults to 7. - - ftype - FORTRAN format types (initially defaults to G): - - G - Gxx.yy. xx and yy are described below. - - F - Fxx.yy - - E - Exx.yy - - nwidth - Total width (9 to 32) of the field (the xx in Ftype). Initially - defaults to 12. - - dsignf - Number of digits after the decimal point (yy in F or E format) or - number of significant digits in G format. Range is 2 to xx-7 for - Ftype = G or E; and 0 to xx-4 for Ftype = F. Initially defaults to - 5. - - line - Number of lines (11 minimum) per page. Defaults to ILINE or BLINE - from the /PAGE command. - - char - Number of characters (41 to 240, system-dependent) per line before - wraparound. Defaults to ICHAR or BCHAR from the /PAGE command. - - Notes - ----- - Specifies various format controls for tables printed with the POST1 - PRNSOL, PRESOL, PRETAB, PRRSOL, PRPATH, and CYCCALC commands. A blank - (or out-of-range) field on the command retains the current setting. - Issue /FORMAT,STAT to display the current settings. Issue /FORMAT,DEFA - to reestablish the initial default specifications. - - For the POST26 PRVAR command, the Ftype, NWIDTH, and DSIGNF fields - control the time output format. - - This command is valid in any processor. - """ - command = f"/FORMAT,{ndigit},{ftype},{nwidth},{dsignf},{line},{char}" - return self.run(command, **kwargs) - - def header( - self, - header="", - stitle="", - idstmp="", - notes="", - colhed="", - minmax="", - **kwargs, - ): - """Sets page and table heading print controls. - - APDL Command: /HEADER - - Parameters - ---------- - header - ANSYS page header (system, date, time, version, copyright, title, - etc.): - - ON - Turns this item on (default for batch mode; not available for interactive - mode). - - OFF - Turns this item off. - - (blank) - Retains the previous setting. - - stitle - Subtitles (see /STITLE command): ON, OFF, or (blank) (see above). - - idstmp - Load step information (step number, substep number, time value): - ON, OFF, or (blank) (see above). - - notes - Information relative to particular table listings: ON, OFF, or - (blank) (see above). - - colhed - Column header labels of table listings (currently only for single - column tables): ON, OFF, or (blank) (see above). - - minmax - Minimum/maximum information or totals after table listings: ON, - OFF, or (blank) (see above). - - Notes - ----- - Sets specifications on or off for page and table heading print controls - associated with the POST1 PRNSOL, PRESOL, PRETAB, PRRSOL, and PRPATH - commands. - - Note:: : If the printout caused a top-of-form (page eject to top of - next page), the top-of-form is also suppressed with the printout. - Issue /HEADER,STAT to display the current settings. Issue /HEADER,DEFA - to reset the default specifications. - - This command is valid in any processor. - """ - command = f"/HEADER,{header},{stitle},{idstmp},{notes},{colhed},{minmax}" - return self.run(command, **kwargs) - - def irlist(self, **kwargs): - """Prints inertia relief summary table. - - APDL Command: IRLIST - - Notes - ----- - Prints the inertia relief summary data, including the mass summary - table, the total load summary table, and the inertia relief summary - table resulting from the inertia relief calculations. These - calculations are performed in the solution phase [SOLVE] as specified - by the IRLF command. - - Inertia relief output is stored in the database rather than in the - results file (Jobname.RST). When you issue IRLIST, ANSYS pulls the - information from the database, which contains the inertia relief output - from the most recent solution [SOLVE]. - - This command is valid in any processor. - """ - command = f"IRLIST," - return self.run(command, **kwargs) - - def page(self, iline="", ichar="", bline="", bchar="", comma="", **kwargs): - """Defines the printout and screen page size. - - APDL Command: /PAGE - - Parameters - ---------- - iline - Number of lines (11 minimum) per "page" or screen. Defaults to 24. - Applies to interactive non-GUI to the screen output only. - - ichar - Number of characters (41 to 132) per line before wraparound. - Defaults to 80. Applies to interactive non-GUI to the screen - output only. - - bline - Number of lines (11 minimum) per page. Defaults to 56. Applies to - batch mode [/BATCH], diverted [/OUTPUT], or interactive GUI [/MENU] - output. If negative, no page headers are output. - - bchar - Number of characters (41 to 240 (system dependent)) per line before - wraparound. Defaults to 132. Applies to batch mode [/BATCH], - diverted [/OUTPUT], or interactive GUI [/MENU] output. - - comma - Input 1 to specify comma-separated output for node [NLIST] and - element [ELIST] output. - - Notes - ----- - Defines the printout page size for batch runs and the screen page size - for interactive runs. Applies to the POST1 PRNSOL, PRESOL, PRETAB, - PRRSOL, and PRPATH commands. See the /HEADER command for additional - controls (page ejects, headers, etc.) that affect the amount of - printout. A blank (or out-of-range) value retains the previous - setting. Issue /PAGE,STAT to display the current settings. Issue - /PAGE,DEFA to reset the default specifications. - - This command is valid in any processor. - """ - command = f"/PAGE,{iline},{ichar},{bline},{bchar},{comma}" - return self.run(command, **kwargs) - - def prerr(self, **kwargs): - """Prints SEPC and TEPC. - - APDL Command: PRERR - - Notes - ----- - Prints the percent error in structural energy norm (SEPC) and the - thermal energy norm percent error (TEPC). Approximations of mesh - discretization error associated with a solution are calculated for - analyses having structural or thermal degrees of freedom. - - The structural approximation is based on the energy error (which is - similar in concept to the strain energy) and represents the error - associated with the discrepancy between the calculated stress field and - the globally continuous stress field (see POST1 - Error Approximation - Technique in the Mechanical APDL Theory Reference). This discrepancy - is due to the assumption in the elements that only the displacements - are continuous at the nodes. The stress field is calculated from the - displacements and should also be continuous, but generally is not. - - Thermal analyses may use any solid and shell thermal element having - only temperature degrees of freedom. The thermal approximation is - based on the total heat flow dissipation and represents the error - associated with the discrepancy between the calculated nodal thermal - flux within an element and a continuous global thermal flux. This - continuous thermal flux is calculated with the normal nodal averaging - procedure. - - The volume (result label VOLU) is used to calculate the energy error - per element (result label SERR for the structural energy error and TERR - for the thermal energy error). These energy errors, along with the - appropriate energy, are then used to calculate the percent error in - energy norm (SEPC for structural and TEPC for thermal). These - percentages can be listed by the PRERR command, retrieved by the ``*GET`` - command (with labels SEPC and TEPC) for further calculations, and shown - on the displacement display (PLDISP), as applicable. - - For structural analyses, the maximum absolute value of nodal stress - variation of any stress component for any node of an element (result - item SDSG) is also calculated. Similarly, for thermal gradient - components, TDSG is calculated. Minimum and maximum result bounds - considering the possible effect of discretization error will be shown - on contour displays (PLNSOL). For shell elements, the top surface - location is used to produce a meaningful percentage value. SERR, TERR, - SEPC, TEPC, SDSG, and TDSG will be updated whenever the nodal stresses - or fluxes are recalculated. - - If the energy error is a significant portion of the total energy, then - the analysis should be repeated using a finer mesh to obtain a more - accurate solution. The energy error is relative from problem to - problem but will converge to a zero energy error as the mesh is - refined. An automated adaptive meshing procedure using this energy - error is described with the ADAPT macro. - - The following element- and material-type limitations apply: - - Valid with most 2-D solid, 3-D solid, axisymmetric solid, or 3-D shell - elements. - - The following element types are not valid: SHELL28, SHELL41, and - SOLID65. - - The model should have only structural or thermal degrees of freedom. - - The analysis must be linear (for both material and geometry). - - Multi-material (for example, composite) elements are not valid. - - Transition regions from one material to another are not valid (that is, - the entire model should consist of one material). - - Anisotropic materials (TB,ANEL) are not considered. - """ - command = f"PRERR," - return self.run(command, **kwargs) - - def priter(self, **kwargs): - """Prints solution summary data. - - APDL Command: PRITER - - Notes - ----- - Prints solution summary data (such as time step size, number of - equilibrium iterations, convergence values, etc.) from a static or full - transient analysis. All other analyses print zeros for the data. - """ - command = f"PRITER," - return self.run(command, **kwargs) diff --git a/src/ansys/mapdl/core/_commands/post1_/load_case.py b/src/ansys/mapdl/core/_commands/post1_/load_case.py deleted file mode 100644 index 6bfccd82949..00000000000 --- a/src/ansys/mapdl/core/_commands/post1_/load_case.py +++ /dev/null @@ -1,447 +0,0 @@ -# Copyright (C) 2016 - 2025 ANSYS, Inc. and/or its affiliates. -# SPDX-License-Identifier: MIT -# -# -# Permission is hereby granted, free of charge, to any person obtaining a copy -# of this software and associated documentation files (the "Software"), to deal -# in the Software without restriction, including without limitation the rights -# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -# copies of the Software, and to permit persons to whom the Software is -# furnished to do so, subject to the following conditions: -# -# The above copyright notice and this permission notice shall be included in all -# copies or substantial portions of the Software. -# -# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -# SOFTWARE. - - -class LoadCase: - def lcabs(self, lcno="", kabs="", **kwargs): - """Specifies absolute values for load case operations. - - APDL Command: LCABS - - Parameters - ---------- - lcno - Load case pointer number. If ALL, apply to all selected load cases - [LCSEL]. - - kabs - Absolute value key: - - 0 - Use algebraic values of load case LCNO in operations. - - 1 - Use absolute values of load case LCNO in operations. - - Notes - ----- - Causes absolute values to be used in the load case operations [LCASE or - LCOPER]. Absolute values are taken prior to assigning a load case - factor [LCFACT] and are applied only to defined load cases [LCDEF]. - """ - command = f"LCABS,{lcno},{kabs}" - return self.run(command, **kwargs) - - def lcase(self, lcno="", **kwargs): - """Reads a load case into the database. - - APDL Command: LCASE - - Parameters - ---------- - lcno - Load case pointer number [LCDEF,STAT]. Defaults to 1. - - Notes - ----- - Reads a load case into the database. Load cases are created as - described on the LCDEF or LCWRITE commands. The results portion of the - database and the applied forces and displacements are cleared before - reading the data in. Absolute values [LCABS] and scale factors - [LCFACT] can be applied during the read operation. - """ - command = f"LCASE,{lcno}" - return self.run(command, **kwargs) - - def lcdef(self, lcno="", lstep="", sbstep="", kimg="", **kwargs): - """Creates a load case from a set of results on a results file. - - APDL Command: LCDEF - - Parameters - ---------- - lcno - Arbitrary pointer number (1-99) to be assigned to the load case - specified by LSTEP, SBSTEP and by the FILE command. Defaults to 1 - + previous value. - - lstep - Load step number to be defined as the load case. Defaults to one. - - sbstep - Substep number. Defaults to the last substep of the load step. - - kimg - Used only with results from complex analyses: - - 0 - Use real part of complex solution - - 1 - Use imaginary part. - - Notes - ----- - Creates a load case by establishing a pointer to a set of results on a - results file (written during the ANSYS solution phase). This pointer - (LCNO) can then be used on the LCASE or LCOPER commands to read the - load case data into the database. - - Issue LCDEF,ERASE to delete all load case pointers (and all load case - files, if any). Issue LCDEF,LCNO,ERASE to delete only the specific - load case pointer LCNO (and its file, if any). With the ERASE options, - all pointers are deleted; however only files with the default extension - [LCWRITE] are deleted. Issue LCDEF,STAT for status of all selected - load cases [LCSEL], or LCDEF,STAT,ALL for status of all load cases. - The STAT command may be used to list all load cases. See also LCFILE - to establish a pointer to a set of results on a load case file (written - by LCWRITE). Harmonic element data read from a result file load case is - stored at the zero-degree position. - """ - command = f"LCDEF,{lcno},{lstep},{sbstep},{kimg}" - return self.run(command, **kwargs) - - def lcfact(self, lcno="", fact="", **kwargs): - """Defines scale factors for load case operations. - - APDL Command: LCFACT - - Parameters - ---------- - lcno - Load case pointer number. If ALL, apply to all selected load cases - [LCSEL]. - - fact - Scale factor applied to load case LCNO. Blank defaults to 1.0. - - Notes - ----- - Defines scale factors to be used in the load case operations [LCASE or - LCOPER]. Scale factors are applied after an absolute value operation - [LCABS] and are applied only to defined load cases [LCDEF]. - """ - command = f"LCFACT,{lcno},{fact}" - return self.run(command, **kwargs) - - def lcfile(self, lcno="", fname="", ext="", **kwargs): - """Creates a load case from an existing load case file. - - APDL Command: LCFILE - - Parameters - ---------- - lcno - Arbitrary (1-99) pointer number assigned to this load case. - - 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. - - ext - Filename extension (eight-character maximum). - - Notes - ----- - Creates a load case by establishing a pointer to an existing load case - file [LCWRITE]. This pointer (LCNO) can then be used on the LCASE or - LCOPER commands to read the load case data into the database. This - command is typically used to reestablish load case pointers in a new - ANSYS session (pointers are not saved on the database file), or when - more than one pointer to a single load case is desired. See the LCDEF - command for status and erase operations. See also LCDEF to establish a - pointer to a set of results on a results file (written during the ANSYS - solution phase). - """ - command = f"LCFILE,{lcno},{fname},{ext}" - return self.run(command, **kwargs) - - def lcoper(self, oper="", lcase1="", oper2="", lcase2="", **kwargs): - """Performs load case operations. - - APDL Command: LCOPER - - Parameters - ---------- - oper - Valid operations are: - - ZERO - Zero results portion of database (LCASE1 ignored). - - SQUA - Square database values (LCASE1 ignored). - - SQRT - Square root of database (absolute) values (LCASE1 ignored). - - LPRIN - Recalculate line element principal stresses (LCASE1 ignored). Stresses are as - shown for the NMISC items of the ETABLE command for the - specific line element type. - - ADD - Add LCASE1 to database values. - - SUB - Subtract LCASE1 from database values. - - SRSS - Square root of the sum of the squares of database and LCASE1. - - MIN - Compare and save in database the algebraic minimum of database and LCASE1. - - MAX - Compare and save in database the algebraic maximum of database and LCASE1. - - ABMN - Compare and save in database the absolute minimum of database and LCASE1 (based - on magnitudes, then apply the corresponding sign). - - ABMX - Compare and save in database the absolute maximum of database and LCASE1 (based - on magnitudes, then apply the corresponding sign). - - lcase1 - First load case in the operation (if any). See LCNO of the LCDEF - command. If ALL, repeat operations using all selected load cases - [LCSEL]. - - oper2 - Valid operations are: - - MULT - Multiplication: ``LCASE1*LCASE2`` - - CPXMAX - This option does a phase angle sweep to calculate the maximum of derived - stresses and equivalent strain for a complex solution - where LCASE1 is the real part and LCASE2 is the imaginary - part. The Oper field is not applicable with this option. - Also, the LCABS and SUMTYPE commands have no effect on - this option. The value of S3 will be a minimum. This - option does not apply to derived displacement amplitude - (USUM). Load case writing (LCWRITE) is not supported. See - POST1 and POST26 – Complex Results Postprocessing in the - Mechanical APDL Theory Reference for more information. - - lcase2 - Second load case. Used only with Oper2 operations. - - Notes - ----- - LCOPER operates on the database and one or two load cases according to: - - Database = Database Oper (LCASE1 Oper2 LCASE2) - - where operations Oper and Oper2 are as described above. Absolute - values and scale factors may be applied to the load cases before the - operations [LCABS, LCFACT]. If LCASE1 is not specified, only operation - Oper is performed on the current database. If LCASE2 is specified, - operation Oper2 will be performed before operation Oper. If LCASE2 is - not specified, operation Oper2 is ignored. Solution items not - contained [OUTRES] in either the database or the applicable load cases - will result in a null item during a load case operation. Harmonic - element data read from a result file load case are processed at zero - degrees. All load case combinations are performed in the solution - coordinate system, and the data resulting from load case combinations - are stored in the solution coordinate system. The resultant data are - then transformed to the active results coordinate system [RSYS] when - listed or displayed. Except in the cases of Oper = LPRIN, ADD, or SUB, - you must use RSYS,SOLU to list or display, and in the case of layered - elements, the layer (LAYER) must also be specified. - - Use the FORCE command prior to any combination operation to correctly - combine the requested force type. - - If Oper2=CPXMAX, the derived stresses and strain calculation do not - apply to line elements. - """ - command = f"LCOPER,{oper},{lcase1},{oper2},{lcase2}" - return self.run(command, **kwargs) - - def lcsel(self, type_="", lcmin="", lcmax="", lcinc="", **kwargs): - """Selects a subset of load cases. - - APDL Command: LCSEL - - Parameters - ---------- - type\\_ - Label identifying the type of select: - - S - Select a new set. - - R - Reselect a set from the current set. - - A - Additionally select a set and extend the current set. - - U - Unselect a set from the current set. - - ALL - Restore the full set. - - NONE - Unselect the full set. - - INVE - Invert the current set (selected becomes unselected and vice versa). - - STAT - Display the current select status. - - lcmin - Minimum value of load case pointer range. - - lcmax - Maximum value of load case pointer range. LCMAX defaults to LCMIN. - - lcinc - Value increment within range. Defaults to 1. LCINC cannot be - negative. - - Notes - ----- - Selects a subset of load cases for other operations. For example, to - select a new set of load cases based on load cases 1 through 7, use - LCSEL,S,1,7. The subset is used when the ALL label is entered (or - implied) on other commands, such as LCFACT, LCABS, LCOPER, etc. Load - cases are flagged as selected and unselected; no load case pointers - [LCDEF, LCWRITE, LCFILE] are actually deleted from the database. - """ - command = f"LCSEL,{type_},{lcmin},{lcmax},{lcinc}" - return self.run(command, **kwargs) - - def lcsum(self, lab="", **kwargs): - """Specifies whether to process non-summable items in load case - - APDL Command: LCSUM - operations. - - Parameters - ---------- - lab - Combination option - - (blank) - Only combine summable items [default]. - - ALL - Combine all items including non summable items. - - Notes - ----- - Allows non-summable items (e.g. plastic strains) to be included in load - combinations. Issue LCSUM,ALL before the first load case operation - (LCXX command). May also be used to include nonsummable items in the - appending of a results file (RAPPND command). - """ - command = f"LCSUM,{lab}" - return self.run(command, **kwargs) - - def lcwrite(self, lcno="", fname="", ext="", **kwargs): - """Creates a load case by writing results to a load case file. - - APDL Command: LCWRITE - - Parameters - ---------- - lcno - Arbitrary pointer number (1-99) to be assigned to this load case. - - 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. - - ext - Filename extension (eight-character maximum). - - Notes - ----- - Creates a load case by writing the results data in the database to a - load case file. The database remains unchanged by this operation. A - pointer is also established to the written set of results on the load - case file. This pointer (LCNO) can then be used on the LCASE or LCOPER - commands to read the load case data into the database. By default, - only summable results data (such as displacements, stresses, elastic - strains) and constant results data (such as volume) are written to the - load case file unless requested (LCSUM command). Non-summable results - data (such as plastic strains, strain energy), boundary conditions, and - nodal loads are not written to the load case file. The load case file - may be named by default or by a user name. Rewriting to the same file - overwrites the previous data. See the LCDEF command for status and - erase operations. - """ - command = f"LCWRITE,{lcno},{fname},{ext}" - return self.run(command, **kwargs) - - def lczero(self, **kwargs): - """Zeroes the results portion of the database. - - APDL Command: LCZERO - - Notes - ----- - Often used before the LCOPER command. Same as LCOPER,ZERO. - """ - command = f"LCZERO," - return self.run(command, **kwargs) - - def rappnd(self, lstep="", time="", **kwargs): - """Appends results data from the database to the results file. - - APDL Command: RAPPND - - Parameters - ---------- - lstep - Load step number to be assigned to the results data set. If it is - the same as an existing load step number on the results file, the - appended load step will be inaccessible. Defaults to 1. - - time - Time value to be assigned to the results data set. Defaults to - 0.0. A time value greater than the last load step should be used. - - Notes - ----- - This command is typically used to append the results from a load case - combination to the results file. See the LCWRITE command to create a - separate load case file. Only summable and constant data are written - to the results file by default; non-summable data are not written - unless requested (LCSUM command). RAPPND should not be used to append - results from a harmonic analysis. - - Distributed ANSYS Restriction: This command is not supported in - Distributed ANSYS. - """ - command = f"RAPPND,{lstep},{time}" - return self.run(command, **kwargs) diff --git a/src/ansys/mapdl/core/_commands/post1_/magnetics_calc.py b/src/ansys/mapdl/core/_commands/post1_/magnetics_calc.py deleted file mode 100644 index 640e6fbcfde..00000000000 --- a/src/ansys/mapdl/core/_commands/post1_/magnetics_calc.py +++ /dev/null @@ -1,297 +0,0 @@ -# Copyright (C) 2016 - 2025 ANSYS, Inc. and/or its affiliates. -# SPDX-License-Identifier: MIT -# -# -# Permission is hereby granted, free of charge, to any person obtaining a copy -# of this software and associated documentation files (the "Software"), to deal -# in the Software without restriction, including without limitation the rights -# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -# copies of the Software, and to permit persons to whom the Software is -# furnished to do so, subject to the following conditions: -# -# The above copyright notice and this permission notice shall be included in all -# copies or substantial portions of the Software. -# -# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -# SOFTWARE. - - -class MagneticsCalc: - def curr2d(self, **kwargs): - """Calculates current flow in a 2-D conductor. - - APDL Command: CURR2D - - Notes - ----- - CURR2D invokes an ANSYS macro which calculates the total current - flowing in a conducting body for a 2-D planar or axisymmetric magnetic - field analysis. The currents may be applied source currents or induced - currents (eddy currents). The elements of the conducting region must - be selected before this command is issued. The total current - calculated by the macro is stored in the parameter TCURR. Also, the - total current and total current density are stored on a per-element - basis in the element table [ETABLE] with the labels TCURR and JT, - respectively. Use the PLETAB and PRETAB commands to plot and list the - element table items. - - Distributed ANSYS Restriction: This command is not supported in - Distributed ANSYS. - """ - command = f"CURR2D," - return self.run(command, **kwargs) - - def emagerr(self, **kwargs): - """Calculates the relative error in an electrostatic or electromagnetic - - APDL Command: EMAGERR - field analysis. - - Notes - ----- - The relative error is an approximation of the mesh discretization error - associated with a solution. It is based on the discrepancy between the - unaveraged, element-nodal field values and the averaged, nodal field - values. The calculation is valid within a material boundary and does - not consider the error in continuity of fields across dissimilar - materials. - - For electrostatics, the field values evaluated are the electric field - strength (EFSUM) and the electric flux density (DSUM). A relative error - norm of each is calculated on a per-element basis and stored in the - element table [ETABLE] with the labels EF_ERR and D_ERR. Normalized - error values EFN_ERR and DN_ERR are also calculated and stored in the - element table. Corresponding quantities for electromagnetics are H_ERR, - B_ERR, HN_ERR, and BN_ERR, which are calculated from the magnetic field - intensity (HSUM) and the magnetic flux density (BSUM). The normalized - error value is the relative error norm value divided by the peak - element-nodal field value for the currently selected elements. - - Use the PLETAB and PRETAB commands to plot and list the error norms and - normalized error values. - - Distributed ANSYS Restriction: This command is not supported in - Distributed ANSYS. - """ - command = f"EMAGERR," - return self.run(command, **kwargs) - - def emf(self, **kwargs): - """Calculates the electromotive force (emf), or voltage drop along a - - APDL Command: EMF - predefined path. - - Notes - ----- - EMF invokes an ANSYS macro which calculates the electromotive force - (emf), or voltage drop along a predefined path (specified with the PATH - command). It is valid for both 2-D and 3-D electric field analysis or - high-frequency electromagnetic field analysis. The calculated emf value - is stored in the parameter EMF. - - You must define a line path (via the PATH command) before issuing the - EMF command macro. The macro uses calculated values of the electric - field (EF), and uses path operations for the calculations. All path - items are cleared when the macro finishes executing. - - The EMF macro sets the "ACCURATE" mapping method and "MAT" - discontinuity option on the PMAP command. The ANSYS program retains - these settings after executing the macro. - - Distributed ANSYS Restriction: This command is not supported in - Distributed ANSYS. - """ - command = f"EMF," - return self.run(command, **kwargs) - - def emft(self, **kwargs): - """Summarizes electromagnetic forces and torques. - - APDL Command: EMFT - - Notes - ----- - Use this command to summarize electromagnetic force and torque in both - static electric and magnetic problems. To use this command, select the - nodes in the region of interest and make sure that all elements are - selected. If RSYS = 0, the force is reported in the global Cartesian - coordinate system. If RSYS ≠ 0, force is reported in the specified - coordinate system. However, for torque, if RSYS ≠ 0, this command will - account for the shift and rotation as specified by RSYS, but will - report only the Cartesian components. - - Forces are stored as items _FXSUM, _FYSUM, _FZSUM, and _FSSUM. Torque - is stored as items _TXSUM, _TYSUM, _TZSUM, and _TSSUM. - - This command is valid only with PLANE121, SOLID122, SOLID123, PLANE233, - SOLID236 and SOLID237 elements. For any other elements, you must use - FMAGSUM. - """ - command = f"EMFT," - return self.run(command, **kwargs) - - def fluxv(self, **kwargs): - """Calculates the flux passing through a closed contour. - - APDL Command: FLUXV - - Notes - ----- - FLUXV invokes an ANSYS macro which calculates the flux passing through - a closed contour (path) predefined by PATH. The calculated flux is - stored in the parameter FLUX. In a 2-D analysis, at least two nodes - must be defined on the path. In 3-D, a path of nodes describing a - closed contour must be specified (i.e., the first and last node in the - path specification must be the same). A counterclockwise ordering of - nodes on the PPATH command will give the correct sign on flux. Path - operations are used for the calculations, and all path items are - cleared upon completion. This macro is only available for vector - potential formulations. - """ - command = f"FLUXV," - return self.run(command, **kwargs) - - def mmf(self, **kwargs): - """Calculates the magnetomotive force along a path. - - APDL Command: MMF - - Notes - ----- - MMF invokes an ANSYS macro which calculates the magnetomotive force - (mmf) along a predefined path [PATH]. It is valid for both 2-D and - 3-D magnetic field analyses. The calculated mmf value is stored in the - parameter MMF. - - A closed path [PATH], passing through the magnetic circuit for which - mmf is to be calculated, must be defined before this command is issued. - A counterclockwise ordering of points on the PPATH command will yield - the correct sign on the mmf. The mmf is based on Ampere's Law. The - macro makes use of calculated values of field intensity (H), and uses - path operations for the calculations. All path items are cleared upon - completion. The MMF macro sets the "ACCURATE" mapping method and "MAT" - discontinuity option of the PMAP command. - - Distributed ANSYS Restriction: This command is not supported in - Distributed ANSYS. - """ - command = f"MMF," - return self.run(command, **kwargs) - - def plf2d(self, ncont="", olay="", anum="", win="", **kwargs): - """Generates a contour line plot of equipotentials. - - APDL Command: PLF2D - - Parameters - ---------- - ncont - Number of contour lines to display. Issue in multiples of 9 (i.e., - 9, 18, 27, etc.). Default is 27 contour lines. - - olay - Overlay: - - 0 - Overlay edge outlines by material number. - - 1 - Overlay edge outlines by real constant number. - - anum - Highest material or real constant attribute number. Command will - cycle through ANUM element display overlays. Defaults to 10. - - win - Window number to which command applies. Defaults to 1. - - Notes - ----- - PLF2D invokes an ANSYS macro which plots equipotentials of the degree - of freedom AZ. These equipotential lines are parallel to flux lines - and thus give a good representation of flux patterns. In the - axisymmetric case, the display is actually ``r*AZ`` where "r" is the node - radius. The macro overlays (OLAY) edge outlines by material number or - real constant number (ANUM) and allows user control over the number of - contour lines to display (NCONT). - - Distributed ANSYS Restriction: This command is not supported in - Distributed ANSYS. - """ - command = f"PLF2D,{ncont},{olay},{anum},{win}" - return self.run(command, **kwargs) - - def powerh(self, **kwargs): - """Calculates the rms power loss in a conductor or lossy dielectric. - - APDL Command: POWERH - - Notes - ----- - POWERH invokes an ANSYS macro which calculates the time-averaged (rms) - power loss in a conductor or lossy dielectric material from a harmonic - analysis. The power loss is stored in the parameter PAVG. Conductor - losses include solid conductors and surface conductors approximated by - impedance or shielding boundary conditions. The power loss density for - solid conductors or dielectrics is stored in the element table with the - label PLOSSD and may be listed [PRETAB] or displayed [PLETAB]. PLOSSD - does not include surface losses. The elements of the conducting region - must be selected before this command is issued. POWERH is valid for - 2-D and 3-D analyses. - """ - command = f"POWERH," - return self.run(command, **kwargs) - - def senergy(self, opt="", antype="", **kwargs): - """Determines the stored magnetic energy or co-energy. - - APDL Command: SENERGY - - Parameters - ---------- - opt - Item to be calculated: - - 0 - Stored magnetic energy. - - 1 - Stored magnetic co-energy. - - antype - Analysis type: - - 0 - Static or transient. - - 1 - Harmonic. - - Notes - ----- - SENERGY invokes an ANSYS macro which calculates the stored magnetic - energy or co-energy for all selected elements. (For a harmonic - analysis, the macro calculates a time-averaged (rms) stored energy.) A - summary table listing the energy by material number is produced. The - energy density is also calculated and stored on a per-element basis in - the element table [ETABLE] with the label MG_ENG (energy density) or - MG_COENG (co-energy density). The macro erases all other items in the - element table [ETABLE] and only retains the energy density or co-energy - density. Use the PLETAB and PRETAB commands to plot and list the - energy density. The macro is valid for static and low-frequency - magnetic field formulations. The macro will not calculate stored - energy and co-energy for the following cases: - - Orthotropic nonlinear permanent magnets. - - Orthotropic nonlinear permeable materials. - - Temperature dependent materials. - - SENERGY is restricted to MKSA units. - - Distributed ANSYS Restriction: This command is not supported in - Distributed ANSYS. - """ - command = f"SENERGY,{opt},{antype}" - return self.run(command, **kwargs) diff --git a/src/ansys/mapdl/core/_commands/post1_/path_operations.py b/src/ansys/mapdl/core/_commands/post1_/path_operations.py deleted file mode 100644 index ba7794fb839..00000000000 --- a/src/ansys/mapdl/core/_commands/post1_/path_operations.py +++ /dev/null @@ -1,986 +0,0 @@ -# Copyright (C) 2016 - 2025 ANSYS, Inc. and/or its affiliates. -# SPDX-License-Identifier: MIT -# -# -# Permission is hereby granted, free of charge, to any person obtaining a copy -# of this software and associated documentation files (the "Software"), to deal -# in the Software without restriction, including without limitation the rights -# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -# copies of the Software, and to permit persons to whom the Software is -# furnished to do so, subject to the following conditions: -# -# The above copyright notice and this permission notice shall be included in all -# copies or substantial portions of the Software. -# -# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -# SOFTWARE. - - -class PathOperations: - def padele(self, delopt="", **kwargs): - """Deletes a defined path. - - APDL Command: PADELE - - Parameters - ---------- - delopt - Path delete option (one of the following): - - ALL - Delete all defined paths. - - NAME - Delete a specific path from the list of path definitions. (Substitute the - actual path name for NAME.) - - Notes - ----- - Paths are identified by individual path names. To review the current - list of path names, issue the command PATH,STATUS. - - This command is valid in the general postprocessor. - """ - command = f"PADELE,{delopt}" - return self.run(command, **kwargs) - - def paget(self, parray="", popt="", **kwargs): - """Writes current path information into an array variable. - - APDL Command: PAGET - - Parameters - ---------- - parray - The name of the array parameter that the ANSYS program creates to - store the path information. If the array parameter already exists, - it will be replaced with the current path information. - - popt - Determines how data will be stored in the parameter specified with - PARRAY: - - POINTS - Store the path points, the nodes (if any), and coordinate system. (For - information on defining paths and path points, see the - descriptions of the PATH and PPATH commands.) - - TABLE - Store the path data items. (See the PDEF command description for path data - items.) - - LABEL - Stores path data labels. - - Notes - ----- - Use the PAGET command together with the PAPUT command to store and - retrieve path data in array variables for archiving purposes. When - retrieving path information, restore the path points (POINTS option) - first, then the path data (TABLE option), and then the path labels - (LABEL option). - """ - command = f"PAGET,{parray},{popt}" - return self.run(command, **kwargs) - - def paput(self, parray="", popt="", **kwargs): - """Retrieves path information from an array variable. - - APDL Command: PAPUT - - Parameters - ---------- - parray - Name of the array variable containing the path information. - - popt - Specifies which path data to retrieve: - - POINTS - Retrieve path point information (specified with the PPATH command and stored - with the PAGET,POINTS command). The path data name will - be assigned to the path points. - - TABLE - Retrieve path data items (defined via the PDEF command and stored with the - PAGET,,TABLE command). - - LABEL - Retrieve path labels stored with the PAGET,,LABEL command. - - Notes - ----- - When retrieving path information, restore path points (POINTS option) - first, then the path data (TABLE option), and then the path labels - (LABEL option). - """ - command = f"PAPUT,{parray},{popt}" - return self.run(command, **kwargs) - - def paresu(self, lab="", fname="", ext="", **kwargs): - """Restores previously saved paths from a file. - - APDL Command: PARESU - - Parameters - ---------- - lab - Read operation: - - S - Saves only selected paths. - - ALL - Read all paths from the selected file (default). - - Pname - Saves the named path (from the PSEL command). - - 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. - - The file name defaults to Jobname. - - ext - Filename extension (eight-character maximum). The - extension defaults to PATH if Fname is blank. - - Notes - ----- - This command removes all paths from virtual memory and then - reads path data from a file written with the PASAVE command. - All paths on the file will be restored. All paths currently - in memory will be deleted. - """ - command = f"PARESU,{lab},{fname},{ext}" - return self.run(command, **kwargs) - - def pasave(self, lab="", fname="", ext="", **kwargs): - """Saves selected paths to an external file. - - APDL Command: PASAVE - - Parameters - ---------- - lab - Write operation: - - S - Saves only selected paths. - - ALL - Saves all paths (default). - - Pname - Saves the named path (from the PSEL command). - - 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. - - ext - Filename extension (eight-character maximum). - - Notes - ----- - Saves the paths selected with the PSEL command to an external file - (Jobname.path by default). Previous paths on this file, if any, will - be overwritten. The path file may be read with the PARESU command. - - This command is valid in POST1. - """ - command = f"PASAVE,{lab},{fname},{ext}" - return self.run(command, **kwargs) - - def path(self, name="", npts="", nsets="", ndiv="", **kwargs): - """Defines a path name and establishes parameters for the path. - - APDL Command: PATH - - Parameters - ---------- - name - Name for this path (eight characters maximum. If nPts is blank, set - the current path to the path with this name. If nPts is greater - than zero, create a path of this name. If a path with this name - already exists, replace it with a new path. If the NAME value is - STATUS, display the status for path settings. - - npts - The number of points used to define this path. The minimum number - is two, and the maximum is 1000. Default is 2. - - nsets - The number of sets of data which you can map to this path. You - must specify at least four: X, Y, Z, and S. Default is 30. - - ndiv - The number of divisions between adjacent points. Default is 20. - There is no maximum number of divisions. - - Notes - ----- - The PATH command is used to define parameters for establishing a path. - The path geometry is created by the PPATH command. Multiple paths may - be defined and named; however, only one path may be active for data - interpolation [PDEF] and data operations [PCALC, etc.]. Path geometry - points and data are stored in memory while in POST1. If you leave - POST1, the path information is erased. Path geometry and data may be - saved in a file by archiving the data using the PASAVE command. Path - information may be restored by retrieving the data using the PARESU - command. - - For overlapping nodes, the lowest numbered node is assigned to the - path. - - The number of divisions defined using nDiv does NOT affect the number - of divisions used by PLSECT and PRSECT. - - For information on displaying paths you have defined, see the Basic - Analysis Guide. - """ - command = f"PATH,{name},{npts},{nsets},{ndiv}" - return self.run(command, **kwargs) - - def pcalc( - self, - oper="", - labr="", - lab1="", - lab2="", - fact1="", - fact2="", - const="", - **kwargs, - ): - """Forms additional labeled path items by operating on existing path - - APDL Command: PCALC - items. - - Parameters - ---------- - oper - Type of operation to be performed. See "Notes" below for specific - descriptions of each operation: - - ADD - Adds two existing path items. - - MULT - Multiplies two existing path items. - - DIV - Divides two existing path items (a divide by zero results in a value of zero). - - EXP - Exponentiates and adds existing path items. - - DERI - Finds a derivative. - - INTG - Finds an integral. - - SIN - Sine. - - COS - Cosine. - - ASIN - Arcsine. - - ACOS - Arccosine. - - LOG - Natural log. - - labr - Label assigned to the resulting path item. - - lab1 - First labeled path item in operation. - - lab2 - Second labeled path item in operation. Lab2 must not be blank for - the MULT, DIV, DERI, and INTG operations. - - fact1 - Factor applied to Lab1. A (blank) or '0' entry defaults to 1.0. - - fact2 - Factor applied to Lab2. A (blank) or '0' entry defaults to 1.0. - - const - Constant value (defaults to 0.0). - - Notes - ----- - If Oper = ADD, the command format is: - - PCALC,ADD,LabR,Lab1,Lab2,FACT1,FACT2,CONST - - This operation adds two existing path items according to the operation: - - LabR = (FACT1 x Lab1) + (FACT2 x Lab2) + CONST - - It may be used to scale the results for a single path item. - - If Oper = MULT, the command format is: - - PCALC,MULT,LabR,Lab1,Lab2,FACT1 - - Lab2 must not be blank. This operation multiplies two existing path - items according to the operation: - - LabR = Lab1 x Lab2 x FACT1 - - If Oper = DIV, the command format is: - - PCALC,DIV,LabR,Lab1,Lab2,FACT1 - - Lab2 must not be blank. This operation divides two existing path items - according to the operation: - - LabR = (Lab1/Lab2) x FACT1 - - If Oper = EXP, the command format is: - - PCALC,EXP,LabR,Lab1,Lab2,FACT1,FACT2 - - This operation exponentiates and adds existing path items according to - the operation: - - ``LabR = (|Lab1|FACT1) + (|Lab2|FACT2|)`` - - If Oper = DERI, the command format is: - - ``PCALC,DERI,LabR,Lab1,Lab2,FACT1`` - - Lab2 must not be blank. This operation finds a derivative according to - the operation: - - ``LabR = FACT1 x d(Lab1)/d(Lab2)`` - - If Oper = INTG, the command format is: - - ``PCALC,INTG,LabR,Lab1,Lab2,FACT1`` - - Lab2 must not be blank. This operation finds an integral according to - the operation: - - Use S for Lab2 to integrate Lab1 with respect to the path length. S, - the distance along the path, is automatically calculated by the program - when a path item is created with the PDEF command. - - If Oper = SIN, COS, ASIN, ACOS, or LOG, the command format is: - - ``PCALC,Oper,LabR,Lab1,,FACT1,CONST`` - - where the function (SIN, COS, ASIN, ACOS or LOG) is substituted for - Oper and Lab2 is blank. - - The operation finds the resulting path item according to one of the - following formulas: - - ``LabR = FACT2 x sin(FACT1 x Lab1) + CONST`` - - ``LabR = FACT2 x cos(FACT1 x Lab1) + CONST`` - - ``LabR = FACT2 x sin-1(FACT1 x Lab1) + CONST`` - - ``LabR = FACT2 x cos-1(FACT1 x Lab1) + CONST`` - - ``LabR = FACT2 x log(FACT1 x Lab1) + CONST`` - """ - command = f"PCALC,{oper},{labr},{lab1},{lab2},{fact1},{fact2},{const}" - return self.run(command, **kwargs) - - def pcross( - self, - labxr="", - labyr="", - labzr="", - labx1="", - laby1="", - labz1="", - labx2="", - laby2="", - labz2="", - **kwargs, - ): - """Calculates the cross product of two path vectors along the current - - APDL Command: PCROSS - path. - - Parameters - ---------- - labxr - Label assigned to X-component of resultant vector. - - labyr - Label assigned to Y-component of resultant vector. - - labzr - Label assigned to Z-component of resultant vector. - - labx1 - X-component of first vector label (labeled path item). - - laby1 - Y-component of first vector label. - - labz1 - Z-component of first vector label. - - labx2 - X-component of second vector label (labeled path item). - - laby2 - Y-component of second vector label. - - labz2 - Z-component of second vector label. - """ - command = f"PCROSS,{labxr},{labyr},{labzr},{labx1},{laby1},{labz1},{labx2},{laby2},{labz2}" - return self.run(command, **kwargs) - - def pdef(self, lab="", item="", comp="", avglab="", **kwargs): - """Interpolates an item onto a path. - - APDL Command: PDEF - - Parameters - ---------- - lab - Label assigned to the resulting path item (8 characters maximum). - This item may be used as input for other path operations. - - item - Label identifying the item for interpolation. Valid item labels - are shown in Table 216: PDEF - valid Item and Component Labels - below. Some items also require a component label. - - comp - Component of the item (if required). Valid component labels are - shown in Table 216: PDEF - valid Item and Component Labels below. - - avglab - Option to average across element boundaries: - - AVG - Average element results across elements (default). - - NOAV - Do not average element results across elements. If the parameter DISCON = MAT - on the PMAP command, this option is automatically invoked. - - Notes - ----- - Defines and interpolates a labeled path item along a predefined path - (PATH). Path item results are in the global Cartesian coordinate - directions unless transformed (RSYS). A path item must be defined - before it can be used with other path operations. Additional path - items may be defined from the PVECT, PCALC, PDOT, and PCROSS commands. - Path items may be listed (PRPATH) or displayed (PLPATH, PLPAGM). A - maximum number of path items permitted is established by the nSets - argument specified with the PATH command. - - When you create the first path item (PDEF or PVECT), the program - automatically interpolates four path items which are used to describe - the geometry of the path. These predefined items are the position of - the interpolated path points (labels XG, YG, and ZG) in global - Cartesian coordinates, and the path length (label S). For alternate - methods of mapping the path geometry (to include, for example, material - discontinuity) see the PMAP command. These items may also be listed or - displayed with the PRPATH, PLPATH, and PLPAGM commands. - - If specifying that load case operations act on principal/equivalent - stresses (SUMTYPE,PRIN), derived quantities (principal and equivalent - stresses/strains) will be zero for path plots. A typical use for such a - case involves mode combinations in a response spectrum analysis. - - The number of interpolation points on the path is defined by the nDiv - argument on the PATH command. See Mapping Nodal and Element Data onto - the Path in the Mechanical APDL Theory Reference for details. Use - PDEF,STAT to list the path item labels. Use PDEF,CLEAR to erase all - labeled path items, except the path geometry items (XG, YG, ZG, S). - - For SHELL131 and SHELL132 elements with KEYOPT(3) = 0 or 1, use the - labels TBOT, TE2, TE3, ..., TTOP instead of TEMP. - - For more information on the meaning of contact status and its possible - values, see Reviewing Results in POST1 in the Contact Technology Guide. - """ - command = f"PDEF,{lab},{item},{comp},{avglab}" - return self.run(command, **kwargs) - - def pdot( - self, - labr="", - labx1="", - laby1="", - labz1="", - labx2="", - laby2="", - labz2="", - **kwargs, - ): - """Calculates the dot product of two path vectors along the current path. - - APDL Command: PDOT - - Parameters - ---------- - labr - Label assigned to dot product result. - - labx1 - X-component of first vector label (labeled path item). - - laby1 - Y-component of first vector label (labeled path item). - - labz1 - Z-component of first vector label (labeled path item). - - labx2 - X-component of second vector label (labeled path item). - - laby2 - Y-component of second vector label (labeled path item). - - labz2 - Z-component of second vector label (labeled path item). - """ - command = f"PDOT,{labr},{labx1},{laby1},{labz1},{labx2},{laby2},{labz2}" - return self.run(command, **kwargs) - - def plpagm(self, item="", gscale="", nopt="", **kwargs): - """Displays path items along the path geometry. - - APDL Command: PLPAGM - - Parameters - ---------- - item - The path data item to be displayed on the currently active path - (defined by the PATH command). Valid path items are those defined - with the PDEF or PLNEAR commands. - - gscale - Scale factor for the offset from the path for the path data item - displays. Defaults to 1.0. - - nopt - Determines how data is displayed: - - (blank) - Do not display nodes, and scale the display based on the currently selected - node set (default). - - NODE - Display path item data along with the currently selected set of nodes. The - display geometry is scaled to the selected node set. - - Notes - ----- - You can use the Gscale argument to scale the contour display offset - from the path for clarity. You need to type all six characters to issue - this command. - """ - command = f"PLPAGM,{item},{gscale},{nopt}" - return self.run(command, **kwargs) - - def plpath(self, lab1="", lab2="", lab3="", lab4="", lab5="", lab6="", **kwargs): - """Displays path items on a graph. - - APDL Command: PLPATH - - Parameters - ---------- - lab1, lab2, lab3, . . . , lab6 - Labels identifying the path items to be displayed. Up to six items - may be drawn per frame. Predefined path geometry items XG, YG, ZG, - and S [PDEF] may also be displayed. - - Notes - ----- - The path must have been defined by the PATH and PPATH commands. Path - items and their labels must have been defined with the PDEF, PVECT, - PCALC, PDOT, PCROSS, or PLNEAR commands. Path items may also be - printed with the PRPATH command. Graph scaling may be controlled with - the /XRANGE, /YRANGE, and PRANGE commands. You need to type all six - characters to issue this command. - """ - command = f"PLPATH,{lab1},{lab2},{lab3},{lab4},{lab5},{lab6}" - return self.run(command, **kwargs) - - def plsect(self, item="", comp="", rho="", kbr="", **kwargs): - """Displays membrane and membrane-plus-bending linearized stresses. - - APDL Command: PLSECT - - Parameters - ---------- - item - Label identifying the item to be processed. Valid item labels are - shown in Table 221: PLSECT - Valid Item and Component Labels below. - Items also require a component label. - - comp - Component of the item. Valid component labels are shown in - Table 221: PLSECT - Valid Item and Component Labels below. - - rho - In-plane (X-Y) average radius of curvature of the inside and - outside surfaces of an axisymmetric section. If zero (or blank), a - plane or 3-D structure is assumed. If nonzero, an axisymmetric - structure is assumed. Use a very large number (or -1) for an - axisymmetric straight section. - - kbr - Through-thickness bending stresses key for an axisymmetric analysis - (RHO ≠ 0): - - 0 - Include the thickness-direction bending stresses. - - 1 - Ignore the thickness-direction bending stresses. - - 2 - Include the thickness-direction bending stress using the same formula as the Y - (axial direction ) bending stress. Also use the same formula - for the shear stress. - - Notes - ----- - Calculates and displays the membrane and membrane-plus-bending - linearized stresses (as described for the PRSECT command) along a path - section [PATH] as a graph. The path section is defined by two points - specified with the PPATH command. For linearized stress calculations, - the path must be defined with nodes. The path must be entirely within - the selected elements (that is, there must not be any element gaps - along the path). The total stress (equivalent to the PLPATH display) is - also displayed. This command always uses 48 divisions along the path, - regardless of the number of divisions defined by PATH. - - Portions of this command are not supported by PowerGraphics - [/GRAPHICS,POWER]. - - Table: 221:: : PLSECT - Valid Item and Component Labels - """ - command = f"PLSECT,{item},{comp},{rho},{kbr}" - return self.run(command, **kwargs) - - def pmap(self, form="", discon="", **kwargs): - """Creates mapping of the path geometry by defining path interpolation - - APDL Command: PMAP - division points. - - Parameters - ---------- - form - Defines the mapping method: - - UNIFORM - Maps uniform divisions (specified on the nDiv argument of the PATH command) - between specified points. This is the default. - - ACCURATE - Map geometry using a small division at the beginning and end of each segment. - This gives you accurate derivatives, integrals, - tangents, and normals for curves which do not have - continuous slopes at the specified points. To create - nonuniform divisions, the nDiv argument of the PATH - command must be greater than 2. - - discon - Sets mapping for discontinuities in the field. The divisions are - modified to put a point just before and just after the - discontinuity. The valid label is MAT, for a material - discontinuity. No discontinuity is the default. Discontinuity - mapping involves the NOAV option on the PDEF command. - """ - command = f"PMAP,{form},{discon}" - return self.run(command, **kwargs) - - def ppath(self, point="", node="", x="", y="", z="", cs="", **kwargs): - """Defines a path by picking or defining nodes, or locations on the - - APDL Command: PPATH - currently active working plane, or by entering specific coordinate - locations. - - Parameters - ---------- - point - The point number. It must be greater than zero and less than or - equal to the nPts value specified on the PATH command if graphical - picking is not being used. - - node - The node number defining this point. If blank, use the X, Y, Z - coordinates to define the point. A valid node number will override - X, Y, Z coordinate arguments. - - x, y, z - The location of the point in the global Cartesian coordinate - system. Use these arguments only if you omit the NODE argument. - - cs - The coordinate system for interpolation of the path between the - previous point and this point. Omit this argument if you wish to - use the currently active (CSYS) coordinate system. If the - coordinate system of two adjacent points is different, the CS value - of the latter point will be used. - - Notes - ----- - For linearized stress calculations, the path must be defined with - nodes. - - This command is designed and works best in interactive (GUI) mode, - using the menu paths listed below. For command line operations, issue - PPATH,P to define your path by picking nodes. - - For information on displaying paths you have defined, see Defining Data - to be Retrieved in the Basic Analysis Guide. - """ - command = f"PPATH,{point},{node},{x},{y},{z},{cs}" - return self.run(command, **kwargs) - - def prange(self, linc="", vmin="", vmax="", xvar="", **kwargs): - """Determines the path range. - - APDL Command: PRANGE - - Parameters - ---------- - linc, vmin, vmax - Set the range for listing or displaying the table locations between - a minimum value (VMIN) and a maximum value (VMAX) of the path - distance with a location increment of LINC (defaults to 1). The - first location begins at VMIN. - - xvar - Path variable item to be used as the x-axis plot variable. Any - valid path variable may be used (PDEF command). Default variable - is the path distance, S. - - Notes - ----- - Determines the path distance range for use with the PRPATH and PLPATH - commands. - """ - command = f"PRANGE,{linc},{vmin},{vmax},{xvar}" - return self.run(command, **kwargs) - - def prpath(self, lab1="", lab2="", lab3="", lab4="", lab5="", lab6="", **kwargs): - """Prints path items along a geometry path. - - APDL Command: PRPATH - - Parameters - ---------- - lab1, lab2, lab3, . . . , lab6 - Labels identifying the path items to be printed. Up to six items - may be printed at a time. Predefined path geometry items XG, YZ, - ZG, and S [PDEF] may also be printed. - - Notes - ----- - Prints path items with respect to a geometry path (as defined by the - PATH and PPATH commands). Path items and their labels must have been - defined with the PDEF, PVECT, PCALC, PDOT, PCROSS, or PRNEAR commands. - Path items may also be displayed with the PLPATH and PLPAGM commands. - See the PRANGE command for range control of the path. - """ - command = f"PRPATH,{lab1},{lab2},{lab3},{lab4},{lab5},{lab6}" - return self.run(command, **kwargs) - - def prsect(self, rho="", kbr="", **kwargs): - """Calculates and prints linearized stresses along a section path. - - APDL Command: PRSECT - - Parameters - ---------- - rho - In-plane (X-Y) average radius of curvature of the inside and - outside surfaces of an axisymmetric section. If zero (or blank), a - plane or 3-D structure is assumed. If nonzero, an axisymmetric - structure is assumed. Use any large number (or -1) for an - axisymmetric straight section. - - kbr - Through-thickness bending stresses key for an axisymmetric analysis - (RHO ≠ 0): - - 0 - Include the thickness-direction bending stresses. - - 1 - Ignore the thickness-direction bending stresses. - - 2 - Include the thickness-direction bending stress using the same formula as the Y - (axial direction ) bending stress. Also use the same formula - for the shear stress. - - Notes - ----- - You may choose to linearize the stresses through a section and separate - them into categories for various code calculations. PRSECT calculates - and reports linearized stresses along a section path. The linearized - stresses are also separated into membrane, bending, membrane plus - bending, peak, and total stress categories. - - First, define your section path using the PATH and PPATH (with the NODE - option) commands. Your path must lie entirely within the selected set - of elements (that is, there must be no element gaps along the path). - PATH and PPATH are used only to retrieve the two end nodes. The path - data is not retained. The section path is defined by the two end - nodes, and by 47 intermediate points that are automatically determined - by linear interpolation in the active display coordinate system [DSYS]. - The number and location of the intermediate points are not affected by - the number of divisions set by PATH,,,,nDiv. - - Your linearized component stress values are obtained by interpolating - each element’s average corner nodal values along the section path - points within each path element. PRSECT reports the linearized - component and principal stresses for each stress category at the - beginning, mid-length, and end of the section path. PRPATH can be used - to report the total stresses at the intermediate points. - - Section paths may be through any set of solid (2-D plane, 2-D - axisymmetric or 3-D) elements. However, section paths are usually - defined to be through the thickness of the structure and normal to the - inner and outer structure surfaces. Section paths (in-plane only) may - also be defined for shell element structures. See the Mechanical APDL - Theory Reference for details. - - If the RHO option is set to indicate the axisymmetric option (non- - zero), PRSECT reports the linearized stresses in the section - coordinates (SX – along the path, SY – normal to the path, and SZ – - hoop direction). If the RHO option is set to indicate the 2-D planar - or 3-D option (zero or blank), PRSECT reports the linearized stresses - in the active results coordinate system [RSYS]. If the RHO option is - zero or blank and either RSYS, SOLU or RSYS, -1 are active, the - linearized stresses are calculated and reported in the global Cartesian - coordinate system. It is recommended that linearized stress - calculations be performed in a rectangular coordinate system. - Principal stresses are recalculated from the component stresses and are - invariant with the coordinate system as long as SX is in the same - direction at all points along the defined path. The PLSECT command - displays the linearized stresses in the same coordinate system as - reported by PRSECT. - - Stress components through the section are linearized by a line integral - method and separated into constant membrane stresses, bending stresses - varying linearly between end points, and peak stresses (defined as the - difference between the actual (total) stress and the membrane plus - bending combination). - - For nonaxisymmetric structures, the bending stresses are calculated - such that the neutral axis is at the midpoint of the path. - Axisymmetric results include the effects of both the radius of - revolution (automatically determined from the node locations) and the - in-plane average radius of curvature of the section surfaces (user - input). - - For axisymmetric cases, Mechanical APDL calculates the linearized - bending stress in the through-thickness direction as the difference - between the total outer fiber stress and the membrane stress if KBR = - 1. The calculation method may be conservative for locations with a - highly nonlinear variation of stress in the through-thickness - direction. Alternatively, you can specify KBR = 2 to calculate the - bending stress using the same method and formula as the Y (axial - direction) bending stress. For more information, see the discussion of - axisymmetric cases (specifically Equation: 17–40) in the Mechanical - APDL Theory Reference. - - Portions of this command are not supported by PowerGraphics - [/GRAPHICS,POWER]. - """ - command = f"PRSECT,{rho},{kbr}" - return self.run(command, **kwargs) - - def psel( - self, - type_="", - pname1="", - pname2="", - pname3="", - pname4="", - pname5="", - pname6="", - pname7="", - pname8="", - pname9="", - pname10="", - **kwargs, - ): - """Selects a path or paths. - - APDL Command: PSEL - - Parameters - ---------- - type\\_ - Label identifying the type of select: - - S - Select a new path. - - R - Reselect a path from the current set of paths. - - A - Additionally select a path and extend the current set of paths. - - U - Unselect a path from the current set of paths. - - ALL - Restore the full set of paths. - - NONE - Unselect the full set of paths. - - INV - Invert the current set of paths (selected becomes unselected and vice versa). - - pname1, pname2, pname3, . . . , pname10 - Name of existing path(s). - - Notes - ----- - Selects a path or multiple paths, up to ten. Data are flagged as - selected and unselected; no data are actually deleted from the - database. There is no default for this command; you must specify a - type and pathname. - """ - command = f"PSEL,{type_},{pname1},{pname2},{pname3},{pname4},{pname5},{pname6},{pname7},{pname8},{pname9},{pname10}" - return self.run(command, **kwargs) - - def pvect(self, oper="", labxr="", labyr="", labzr="", **kwargs): - """Interpolates a set of items onto a path. - - APDL Command: PVECT - - Parameters - ---------- - oper - Valid operations for geometry operations along a path are: - - NORM - Defines a unit normal vector at each interpolation point in the direction of - the cross product of the tangent to the path and the active - Z axis. Resulting vector components are in the active - coordinate system (which must be Cartesian). - - TANG - Defines a unit vector tangent to the path at each interpolation point. Vector - components are in the active coordinate system (which must - be Cartesian). - - RADI - Defines the position vector of each interpolation point of the path from the - center of the active coordinate system (which must be - Cartesian). - - labxr - Label (8 characters maximum) assigned to X-component of the - resulting vector. - - labyr - Label (8 characters maximum) assigned to Y-component of the - resulting vector. - - labzr - Label (8 characters maximum) assigned to Z-component of the - resulting vector. - - Notes - ----- - Defines and interpolates a set of labeled path items along predefined - path [PATH] and performs various geometric operations on these path - items. A path item must be defined before it can be used with other - path operations. Additional path items may be defined with the PDEF, - PCALC, PDOT, and PCROSS commands. Path items may be listed or - displayed with the PLPATH, PLPAGM and PRPATH commands. Path geometry - items (XG, YG, ZG, S) are automatically interpolated (in the active - CSYS) if not done so previously with the PDEF command. - """ - command = f"PVECT,{oper},{labxr},{labyr},{labzr}" - return self.run(command, **kwargs) diff --git a/src/ansys/mapdl/core/_commands/post1_/results.py b/src/ansys/mapdl/core/_commands/post1_/results.py deleted file mode 100644 index 1b588fad576..00000000000 --- a/src/ansys/mapdl/core/_commands/post1_/results.py +++ /dev/null @@ -1,1037 +0,0 @@ -# Copyright (C) 2016 - 2025 ANSYS, Inc. and/or its affiliates. -# SPDX-License-Identifier: MIT -# -# -# Permission is hereby granted, free of charge, to any person obtaining a copy -# of this software and associated documentation files (the "Software"), to deal -# in the Software without restriction, including without limitation the rights -# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -# copies of the Software, and to permit persons to whom the Software is -# furnished to do so, subject to the following conditions: -# -# The above copyright notice and this permission notice shall be included in all -# copies or substantial portions of the Software. -# -# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -# SOFTWARE. - - -class Results: - def nsort(self, item="", comp="", order="", kabs="", numb="", sel="", **kwargs): - """Sorts nodal data. - - APDL Command: NSORT - - Parameters - ---------- - item - Label identifying the item to be sorted on. Valid item labels are - shown in the table below. Some items also require a component - label. - - comp - Component of the item (if required). Valid component labels are - shown in the table below. - - order - Order of sort operation: - - 0 - Sort into descending order. - - 1 - Sort into ascending order. - - kabs - Absolute value key: - - 0 - Sort according to real value. - - 1 - Sort according to absolute value. - - numb - Number of nodal data records to be sorted in ascending or - descending order (ORDER) before sort is stopped (remainder will be - in unsorted sequence) (defaults to all nodes). - - sel - Allows selection of nodes in the sorted field. - - (blank) - No selection (default). - - SELECT - Select the nodes in the sorted list. - - Notes - ----- - Values are in the active coordinate system [CSYS for input data or RSYS - for results data]. Various element results also depend upon the - recalculation method and the selected results location [AVPRIN, RSYS, - SHELL, ESEL, and NSEL]. If simultaneous load cases are stored, the - last sorted sequence formed from any load case applies to all load - cases. Use NUSORT to restore the original order. This command is not - valid with PowerGraphics. - - Table: 213:: : NSORT - Valid Item and Component Labels - - Table: 214:: : NSORT - Valid Item and Component Labels for Nodal DOF - Result Values - - Table: 215:: : NSORT - Valid Item and Component Labels for Element - Result Values - - Works only if failure criteria information is provided. (For more - information, see the documentation for the FC and TB commands.) - - Must be added via the FCTYP command first. - """ - command = f"NSORT,{item},{comp},{order},{kabs},{numb},{sel}" - return self.run(command, **kwargs) - - def nusort(self, **kwargs): - """Restores original order for nodal data. - - APDL Command: NUSORT - - Notes - ----- - This command restores the nodal data to its original order (sorted in - ascending node number sequence) after an NSORT command. Changing the - selected nodal set [NSEL] also restores the original nodal order. - """ - command = f"NUSORT," - return self.run(command, **kwargs) - - def plcint(self, action="", id_="", node="", cont="", dtype="", **kwargs): - """Plots the fracture parameter (CINT) result data. - - APDL Command: PLCINT - - Parameters - ---------- - action - PATH - - PATH - Plots CINT quantities according to path number (default). - - FRONT - Plots CINT quantities distribution along the crack front. - - id\\_ - Crack ID number. - - node - Crack tip node number (default = ALL). - - cont - Contour number (Default = ALL). - - dtype - Data type to output: - - JINT - J-integral (default) - - IIN1 - Interaction integral 1 - - IIN2 - Interaction integral 2 - - IIN3 - Interaction integral 3 - - K1 - Mode 1 stress-intensity factor - - K2 - Mode 2 stress-intensity factor - - K3 - Mode 3 stress-intensity factor - - G1 - Mode 1 energy release rate - - G2 - Mode 2 energy release rate - - G3 - Mode 3 energy release rate - - GT - Total energy release rate - - MFTX - Total material force X - - MFTY - Total material force Y - - MFTZ - Total material force Z - - TSTRESS - T-stress - - CEXT - Crack extension - - CSTAR - C*-integral - - Notes - ----- - The PLCINT command is not available for XFEM-based crack growth - analyses results processing. - """ - command = f"PLCINT,{action},{id_},{node},{cont},{dtype}" - return self.run(command, **kwargs) - - def pldisp(self, kund="", **kwargs): - """Displays the displaced structure. - - APDL Command: PLDISP - - Parameters - ---------- - kund - Undisplaced shape key: - - 0 - Display only displaced structure. - - 1 - Overlay displaced display with similar undisplaced - display (appearance is system-dependent). - - 2 - Same as 1 except overlay with undisplaced edge display - (appearance is system-dependent). - - Notes - ----- - Displays the displaced structure for the selected elements. - - For information on true scale plots, refer to the description of the - /DSCALE command [/DSCALE,,1.0]. - """ - command = f"PLDISP,{kund}" - return self.run(command, **kwargs) - - def plesol(self, item="", comp="", kund="", fact="", **kwargs): - """Displays the solution results as discontinuous element contours. - - APDL Command: PLESOL - - Parameters - ---------- - item - Label identifying the item. Valid item labels are shown in - Table 219: PLESOL - Valid Item and Component Labels for Element - Results below. Some items also require a component label. - - comp - Component of the item (if required). Valid component labels are - shown in Table 219: PLESOL - Valid Item and Component Labels for - Element Results below. - - kund - Undisplaced shape key: - - 0 - Do not overlay undeformed structure display - - 1 - Overlay displaced contour plot with undeformed display (appearance is system- - dependent) - - 2 - Overlay displaced contour plot with undeformed edge display (appearance is - system-dependent) - - fact - Scale factor for 2-D display of contact items (defaults to 1). A - negative scaling factor may be used to invert the display. - - Notes - ----- - Displays the solution results as element contours discontinuous across - element boundaries for the selected elements. For example, PLESOL,S,X - displays the X component of stress S (that is, the SX stress - component). Various element results depend on the calculation method - and the selected results location (AVPRIN, RSYS, and ESEL). Contours - are determined by linear interpolation within each element, unaffected - by the surrounding elements (i.e., no nodal averaging is performed). - The discontinuity between contours of adjacent elements is an - indication of the gradient across elements. Component results are - displayed in the active results coordinate system [RSYS] (default is - the global Cartesian). See the ETABLE and PLETAB commands for - displaying items not available through this command (such as line - element results). - - For PowerGraphics displays [/GRAPHICS,POWER], results are plotted only - for the model exterior surface. The items marked with [1] in Table: - 219:: PLESOL - Valid Item and Component Labels for Element Results are - not supported by PowerGraphics. - - Table: 219:: : PLESOL - Valid Item and Component Labels for Element - Results - """ - command = f"PLESOL,{item},{comp},{kund},{fact}" - return self.run(command, **kwargs) - - def plnsol(self, item="", comp="", kund="", fact="", fileid="", **kwargs): - """Displays results as continuous contours. - - APDL Command: PLNSOL - - Parameters - ---------- - item - Label identifying the item. Valid item labels are shown in - Table 220: PLNSOL - Valid Item and Component Labels below. Some - items also require a component label. - - comp - Component of the item (if required). Valid component labels are - shown in Table 220: PLNSOL - Valid Item and Component Labels - below. - - kund - Undisplaced shape key: - - 0 - Do not overlay undeformed structure display - - 1 - Overlay displaced contour plot with undeformed display (appearance is system- - dependent) - - 2 - Overlay displaced contour plot with undeformed edge display (appearance is - system-dependent) - - fact - Scale factor for 2-D display for contact items. Default value is - 1. A negative scaling factor may be used to invert the display. - - fileid - The file index number (obtained via the NLDIAG,NRRE,ON command). - Valid only for Item = NRRE. - - Notes - ----- - Displays the solution results as continuous contours across element - boundaries for the selected nodes and elements. For example, PLNSOL,S,X - displays the X component of stress S (that is, the SX stress - component). Various element results depend upon the recalculation - method and the selected results location [AVPRIN, RSYS, LAYER, SHELL, - and NSEL]. Contours are determined by linear interpolation within each - element from the nodal values, which are averaged at a node whenever - two or more elements connect to the same node (except for FMAG, which - is summed at the node). - - For PowerGraphics displays [/GRAPHICS,POWER], results are plotted only - for the model exterior surface. The items marked with [2] are not - supported by PowerGraphics. To plot midside nodes, you must first issue - /EFACET,2. - - Table: 220:: : PLNSOL - Valid Item and Component Labels - """ - command = f"PLNSOL,{item},{comp},{kund},{fact},{fileid}" - return self.run(command, **kwargs) - - def plorb(self, **kwargs): - """Displays the orbital motion of a rotating structure - - APDL Command: PLORB - - Notes - ----- - When a structure is rotating and the Coriolis or gyroscopic effect is - taken into account (CORIOLIS), nodes lying on the rotation axis - generally exhibit an elliptical orbital motion. The PLORB command - displays the orbit of each rotating node as well as the deformed shape - at time t = 0 (the real part of the solution). - - To print the characteristics of the orbital path traversed by each - node, issue the PRORB command. - - The PLORB command is valid for line elements (such as BEAM188, BEAM189, - PIPE288, and PIPE289). - - Your model must also involve a rotational velocity (OMEGA or CMOMEGA) - with Coriolis enabled in a stationary reference frame - (CORIOLIS,,,,RefFrame = ON). - - A SET command should be issued after PLORB to ensure proper output for - subsequent postprocessing commands. - - The coordinate system for displaying nodal results must be global - Cartesian (RSYS,KCN = 0). - """ - command = f"PLORB," - return self.run(command, **kwargs) - - def prenergy( - self, - energytype="", - cname1="", - cname2="", - cname3="", - cname4="", - cname5="", - cname6="", - **kwargs, - ): - """Prints the total energies of a model or the energies of the specified - - APDL Command: PRENERGY - components. - - Parameters - ---------- - energytype - Type of energies to be printed: - - ALL - All energies are printed: potential, kinetic, artificial hourglass/drill - stiffness, contact stabilization energy, and artificial - stabilization energy when applicable. This is the default. - - SENE - Potential energy. - - KENE - Kinetic energy. - - cname1, cname2, cname3,… - Component names for energies of the components printout. - - Notes - ----- - The PRENERGY command prints out either the total energies of the entire - model or the energies of the components depending on the Cname1 - specification. - - Only existing components based on elements (defined with the CM - command) are supported when component energies are listed. - - This command applies to structural elements only. - """ - command = f"PRENERGY,{energytype},{cname1},{cname2},{cname3},{cname4},{cname5},{cname6}" - return self.run(command, **kwargs) - - def prorb(self, **kwargs): - """Prints the orbital motion characteristics of a rotating structure - - APDL Command: PRORB - - Notes - ----- - When a structure is rotating and the Coriolis or gyroscopic effect is - taken into account (CORIOLIS), nodes lying on the rotation axis - generally exhibit an elliptical orbital motion. The PRORB command - prints out the orbit characteristics A, B, PSI, PHI, YMAX and ZMAX of - each rotating node, where - - Angles PSI and PHI are in degrees and within the range of -180 through - +180. For more information about orbit definition, see Orbits in the - Advanced Analysis Guide. - - To display the characteristics of the orbital path traversed by each - node, issue the PLORB command. - - The PRORB command is valid for line elements (such as BEAM188, BEAM189, - PIPE288, and PIPE289). - - Your model must also involve a rotational velocity (OMEGA or CMOMEGA) - with Coriolis enabled in a stationary reference frame - (CORIOLIS,,,,RefFrame = ON). - - A SET command should be issued after PRORB to ensure proper output for - subsequent postprocessing commands. - - The coordinate system for displaying nodal results must be global - Cartesian (RSYS,KCN = 0). - """ - command = f"PRORB," - return self.run(command, **kwargs) - - def plvect( - self, - item="", - lab2="", - lab3="", - labp="", - mode="", - loc="", - edge="", - kund="", - **kwargs, - ): - """Displays results as vectors. - - APDL Command: PLVECT - - Parameters - ---------- - item - Predefined vector item (from Table 223: PLVECT - Valid Item Labels - below) or a label identifying the i-component of a user-defined - vector. - - lab2 - Label identifying the j-component of a user-defined vector. In most - cases, this value must be blank if Item is selected from - Table 223: PLVECT - Valid Item Labels. Individual principal - stresses (Item = S) or principal strains (Item = EPxx) may be - plotted by specifying the value as 1, 2, or 3. - - lab3 - Label identifying the k-component of a user-defined vector. Must - be blank if Item is selected from list below or for 2-D user - defined vector. - - labp - Label assigned to resultant vector for display labeling (defaults - to Item). - - mode - Vector or raster mode override key: - - (blank) - Use the setting of KEY on the /DEVICE command. - - RAST - Use raster mode for PLVECT displays. - - VECT - Use vector mode for PLVECT displays. - - loc - Vector location for display of field element results: - - ELEM - Display at element centroid (default). - - NODE - Display at element nodes. - - edge - Edge display override key: - - (blank) - Use the setting of Key on the /EDGE command. - - OFF - Deactivate the edge display. - - ON - Activate the edge display. - - kund - Undisplaced shape key: - - 0 - Display vectors on undeformed mesh or geometry. - - 1 - Display vectors on deformed mesh or geometry. - - Notes - ----- - Displays various solution results as vectors (arrows) for the selected - nodes and/or elements (elements must contain at least three nodes that - are not colinear). For example, PLVECT,U displays the displacement - vector for all selected nodes. For section displays [/TYPE], the - vectors are shown only on the section face (i.e., cutting plane). The - PLVECT display of principal strains and stresses (Item = S, EPTO, - EPEL, EPPL, EPCR, or EPTH) on a "cut" of the model (/TYPE,,1 ,5,7,8, or - 9) is not supported. The resulting plot displays the vectors on all - selected elements, not on just the sliced surface. See the /VSCALE - command to scale vector lengths. Vector magnitudes may be shown as a - contour display with the PLNSOL command. Various results also depend - upon the recalculation method and the selected results location [LAYER, - SHELL, and NSEL]. - - Items may be selected from a set of recognized vector labels (Item) or - a vector may be defined from up to three scalar labels - (Item,Lab2,Lab3). Scalar labels may be user-defined with the ETABLE - command. The vectors appear on an element display as arrows showing - the relative magnitude of the vector and its direction. The predefined - items will be shown either at the node or at the element centroid, - depending on what item is being displayed and depending on the Loc - setting. User defined ETABLE items will be shown at the element - centroid, regardless of the Loc setting. Stress vectors appear as - arrows at the element centroid, with the arrowheads pointing away from - each other for tension and toward each other for compression. - - For PowerGraphics, vector arrow displays are generated in Global - Cartesian (RSYS = 0). All subsequent displays will revert to your - original coordinate system. - - When vector mode is active (Mode = VECT), use the Z-buffered display - type [/TYPE,,6] to maximize speed of PLVECT plots (other hidden - display types may make plotting slow). For PowerGraphics - [/GRAPHICS,POWER], the items marked with [1] are not supported by - PowerGraphics. - - It is possible to plot principal stresses (Item = S) or principal - strains (Item = EPxx) individually. To do so, specify a Lab2 value of - 1, 2, or 3. For example, the following are valid commands: - - Table: 223:: : PLVECT - Valid Item Labels - - Not supported by PowerGraphics - """ - command = f"PLVECT,{item},{lab2},{lab3},{labp},{mode},{loc},{edge},{kund}" - return self.run(command, **kwargs) - - def prcint(self, id_="", node="", dtype="", **kwargs): - """Lists the fracture parameter (CINT) results data. - - APDL Command: PRCINT - - Parameters - ---------- - id\\_ - Crack ID number. - - node - Crack tip node number. Default = ALL. Valid only for 3-D analysis. - - dtype - Data type to output: - - JINT - J-integral - - IIN1 - Interaction integral 1 - - IIN2 - Interaction integral 2 - - IIN3 - Interaction integral 3 - - K1 - Mode 1 stress-intensity factor - - K2 - Mode 2 stress-intensity factor - - K3 - Mode 3 stress-intensity factor - - G1 - Mode 1 energy release rate - - G2 - Mode 2 energy release rate - - G3 - Mode 3 energy release rate - - GT - Total energy release rate - - MFTX - Total material force X - - MFTY - Total material force Y - - MFTZ - Total material force Z - - TSTRESS - T-stress - - CEXT - Crack extension - - CSTAR - C*-integral - - STTMAX - Maximum circumferential stress - - PSMAX - Maximum circumferential stress when - - Notes - ----- - When a crack tip node is defined, the values associated with the - specified node are listed. - - Dtype = STTMAX or PSMAX are valid for XFEM-based crack growth analyses - only. - - In an XFEM-based analysis, issue the command using this syntax: - - PRCINT, ID, , STTMAX (or PSMAX) - """ - command = f"PRCINT,{id_},{node},{dtype}" - return self.run(command, **kwargs) - - def presol(self, item="", comp="", **kwargs): - """Prints the solution results for elements. - - APDL Command: PRESOL - - Parameters - ---------- - item - Label identifying the item. Valid item labels are shown in - Table 224: PRESOL - Valid Item and Component Labels for Element - Results below. Some items also require a component label. - - comp - Component of the item (if required). Valid component labels are - shown in Table 224: PRESOL - Valid Item and Component Labels for - Element Results below. - - Notes - ----- - Prints the solution results for the selected elements in the sorted - sequence. For example, PRESOL,S prints the stress items SX, SY, SZ, - SXY, SYZ, and SXZ for the node locations of the element. Component - results are in the global Cartesian coordinate directions unless - transformed (RSYS). - - Shell elements print values at the top, then bottom of the element (or - layer). If KEYOPT(8) = 2 (for SHELL181, SHELL208, SHELL209, SHELL281, - or ELBOW290), the results are printed in the order TOP, BOT and then - MID of each element, (or layer). The MID value will be the actual value - as written to the results file. - - Items are listed as columns of a table versus element number. An - exception occurs for item ELEM which uses an element format (all - applicable line element results are listed per element) instead of a - tabular format. - - The FORCE command can be used to define which component of the nodal - load is to be used (static, damping, inertia, or total). See the - ETABLE and PRETAB commands for printing items not available through - this command (such as line element results). - - For PowerGraphics [/GRAPHICS,POWER], results are listed only for the - element surface. The items marked with [1] are not supported by - PowerGraphics. - - Table: 224:: : PRESOL - Valid Item and Component Labels for Element - Results - - Failure criteria for virgin material [1][2]. - - Default components: Maximum of all failure criteria defined at current - location (MAX), maximum strain (EMAX), maximum stress (SMAX), Tsai-Wu - Strength Index (TWSI), inverse of Tsai-Wu Strength Ratio Index (TWSR). - - Other available components: Hashin Fiber Failure (HFIB), Hashin Matrix - Failure (HMAT), Puck Fiber Failure (PFIB), Puck Matrix Failure (PMAT), - LaRc03 Fiber Failure (L3FB), LaRc03 Matrix Failure (L3MT), LaRc04 - Fiber Failure (L4FB), LaRc04 Matrix Failure (L4MT), and any user- - defined failure criteria (USR1 through USR9) [4]. - - Issue the FCTYP command to activate or remove failure criteria. - - Failure criteria based on the effective stresses in the damaged - material. - - Components: Maximum of all failure criteria defined at current location - (MAX), fiber tensile failure (FT), fiber compressive failure (FC), - matrix tensile failure (MT), and matrix compressive (MC). - - Progressive damage parameters. - - Components: Damage status (STAT, 0 - undamaged, 1 - damaged, 2 - - complete damage), fiber tensile damage variable (FT), fiber compressive - damage variable (FC), matrix tensile damage variable (MT), matrix - compressive damage variable (MC), shear damage variable (S), energy - dissipated per unit volume (SED), energy per unit volume due to viscous - damping (SEDV). - """ - command = f"PRESOL,{item},{comp}" - return self.run(command, **kwargs) - - def prjsol(self, item="", comp="", **kwargs): - """Prints joint element output. - - APDL Command: PRJSOL - - Parameters - ---------- - item - Label identifying the item. Some items also require a component - label. - - DISP - Relative displacements. - - ROT - Relative rotations. - - VEL - Relative linear velocities. - - OMG - Relative angular velocities. - - ACC - Relative linear accelerations. - - DMG - Relative angular accelerations. - - SMISC - Summable miscellaneous quantities. - - comp - Component of the item (if required). For Item = DISP, ROT, VEL, - OMG, ACC, and DMG, enter the direction label, X, Y, or Z. For Item - = SMISC, enter a valid number. - - Notes - ----- - Prints element output for the MPC184 joint element. The joint element - quantities printed are the values for the free or unconstrained - relative degrees of freedom. - - This command is valid in POST1 only. - """ - command = f"PRJSOL,{item},{comp}" - return self.run(command, **kwargs) - - def prnld(self, lab="", tol="", item="", **kwargs): - """Prints the summed element nodal loads. - - APDL Command: PRNLD - - Parameters - ---------- - lab - Nodal reaction load type. If blank, use the first ten of all - available labels. Valid labels are: - - tol - Tolerance value about zero within which loads are not printed, as - follows: - - > 0 - Relative tolerance about zero within which loads are not printed. In this case, - the tolerance is TOL * Load, where Load is the absolute - value of the maximum load on the selected nodes. - - 0 - Print all nodal loads. - - > 0 - Absolute tolerance about zero within which loads are not printed. - - item - Selected set of nodes. - - (blank) - Prints the summed element nodal loads for all selected nodes (default), - excluding contact elements. - - CONT - Prints the summed element nodal loads for contact nodes only. - - BOTH - Prints the summed element nodal loads for all selected nodes, including contact - nodes. - - Notes - ----- - Prints the summed element nodal loads (forces, moments, heat flows, - flux, etc.) for the selected nodes in the sorted sequence. Results are - in the global Cartesian coordinate directions unless transformed - [RSYS]. Zero values (within a tolerance range) are not printed. Loads - applied to a constrained degree of freedom are not included. The FORCE - command can be used to define which component of the nodal load is to - be used (static, damping, inertia, or total). - - By default, PRNLD excludes elements TARGE169 - CONTA177. Setting ITEM = - CONT will only account for nodal forces on selected contact elements - (CONTA171 - CONTA177). Setting ITEM = BOTH will account for nodal - forces on all selected nodes, including contact nodes. - """ - command = f"PRNLD,{lab},{tol},{item}" - return self.run(command, **kwargs) - - def prnsol(self, item="", comp="", **kwargs): - """Prints nodal solution results. - - APDL Command: PRNSOL - - Parameters - ---------- - item - Label identifying the item. Valid item labels are shown in - Table 225: PRNSOL - Valid Item and Component Labels below. Some - items also require a component label. - - comp - Component of the item (if required). Valid component labels are - shown in Table 225: PRNSOL - Valid Item and Component Labels below. - Defaults to COMP. - - Notes - ----- - Prints the nodal solution results for the selected nodes in the sorted - sequence. For example, PRNSOL,U,X prints the X component of - displacement vector U (that is, the UX degree of freedom). Component - results are in the global Cartesian coordinate directions unless - transformed (RSYS). Various element results also depend upon the - recalculation method and the selected results location (AVPRIN, RSYS, - LAYER, SHELL, and NSEL). If the LAYER command is issued, then the - resulting output is listed in full graphics mode (/GRAPHICS,FULL). You - can use the FORCE command to define which component of the nodal load - (static, damping, inertia, or total) should be used. - - PowerGraphics can affect your nodal solution listings. For - PowerGraphics (/GRAPHICS,POWER), results are listed only for the model - exterior surfaces. - - When shell element types are present, results are output on a surface- - by-surface basis. For shell elements, such as SHELL181 or SHELL281, and - for ELBOW290, printed output is for both the top and bottom surfaces. - For solid elements such as SOLID185, the output is averaged for each - surface and printed as follows: - - For a node at a vertex, three lines are output (one printed line for - each surface). - - For a node on an edge, two lines are output (one printed line for each - surface). - - For nodes on a face, one value is output. - - For nodes interior to the volume, no printed values are output. - - If a node is common to more than one element, or if a geometric - discontinuity exists, several conflicting listings may result. For - example, a corner node incorporating results from solid elements and - shell elements could yield as many as nine different results; the - printed output would be averages at the top and bottom for the three - shell surfaces plus averages at the three surfaces for the solid, for a - total of nine lines of output. ANSYS does not average result listings - across geometric discontinuities when shell element types are present. - It is important to analyze the listings at discontinuities to ascertain - the significance of each set of data. - - The printed output for full graphics (/GRAPHICS,FULL) follows the - standard ANSYS convention of averaging results at the node. For shell - elements, the default for display is TOP so that the results for the - top of the shell are averaged with the other elements attached to that - node. - - If an NSORT, ESORT or /ESHAPE command is issued with PowerGraphics - activated, then the PRNSOL listings will be the same as in full - graphics mode (/GRAPHICS,FULL). The items marked with [2] are not - supported by PowerGraphics. To print midside nodes, you must first - issue an /EFACET,2 command. - - Table: 225:: : PRNSOL - Valid Item and Component Labels - - Failure criteria [2][4]. - - Default components: Maximum of all failure criteria defined at current - location (MAX), maximum strain (EMAX), maximum stress (SMAX), Tsai-Wu - Strength Index (TWSI), inverse of Tsai-Wu Strength Ratio Index (TWSR). - """ - command = f"PRNSOL,{item},{comp}" - return self.run(command, **kwargs) - - def prrfor(self, lab="", **kwargs): - """Prints the constrained node reaction solution. Used with the FORCE - - APDL Command: PRRFOR - command. - - Parameters - ---------- - lab - Nodal reaction load type. If blank, use the first ten of all - available labels. Valid labels are: - - Notes - ----- - PRRFOR has the same functionality as the PRRSOL command; use PRRFOR - instead of PRRSOL when a FORCE command has been issued. - - In a non-spectrum analysis, if either contact or pretension elements - exist in the model, PRRFOR uses the PRRSOL command internally and the - FORCE setting is ignored. - - Because modal displacements cannot be used to calculate contact element - nodal forces,: those forces are not included in the spectrum and PSD - analyses reaction solution. As a consequence, the: PRRFOR: command is - not supported when constraints on contact element pilot nodes are - present. - """ - command = f"PRRFOR,{lab}" - return self.run(command, **kwargs) - - def prrsol(self, lab="", **kwargs): - """Prints the constrained node reaction solution. - - APDL Command: PRRSOL - - Parameters - ---------- - lab - Nodal reaction load type. If blank, use the first ten of all - available labels. Valid labels are: - - Notes - ----- - Prints the constrained node reaction solution for the selected nodes in - the sorted sequence. For coupled nodes and nodes in constraint - equations, the sum of all reactions in the coupled or constraint - equation set appears at the primary node of the set. Results are in - the global Cartesian coordinate directions unless transformed (RSYS). - - PRRSOL is not valid if any load is applied to a constrained node in the - direction of the constraint and any of the following is true: - - LCOPER has been used. - - LCASE has been used to read from a load case file. - - The applied loads and constraints in the database are not the ones used - to create the results data being processed. - - PRRSOL provides the total reaction solution (static, plus damping, plus - inertial, as appropriate based on the analysis type); however, modal - reactions include only the static contribution. - - Use PRRFOR instead of PRRSOL with the FORCE command to obtain only the - static, damping, or inertial components. - """ - command = f"PRRSOL,{lab}" - return self.run(command, **kwargs) - - def prvect(self, item="", lab2="", lab3="", labp="", **kwargs): - """Prints results as vector magnitude and direction cosines. - - APDL Command: PRVECT - - Parameters - ---------- - item - Predefined vector item (from Table 226: PRVECT - Valid Item and - Component Labels below) or a label identifying the i-component of a - user-defined vector. - - lab2 - Label identifying the j-component of a user-defined vector. In most - cases, this value must be blank if Item is selected from - Table 226: PRVECT - Valid Item and Component Labels. Individual - principal stresses (Item = S) or principal strains (Item = EPxx) - may be printed by specifying the value as 1, 2, or 3. - - lab3 - Label identifying the k-component of a user-defined vector. Must - be blank if Item is selected from list below or for 2-D user - defined vector. - - labp - Label assigned to resultant vector for printout labeling (defaults - to Item). - - Notes - ----- - Prints various solution results as vector magnitude and direction - cosines for the selected nodes and/or elements. For example, PRVECT,U - prints the displacement magnitude and its direction cosines for all - selected nodes. For nodal degree of freedom vector results, direction - cosines are with respect to the results coordinate system RSYS. For - element results, direction cosines are with respect to the global - Cartesian system. Item components may be printed with the PRNSOL - command. Various results also depend upon the recalculation method and - the selected results location [LAYER, SHELL, NSEL, and ESEL]. Items - may be selected from a set of recognized vector labels (Item) or a - vector may be defined from up to three scalar labels (Item,Lab2,Lab3). - Scalar labels may be user-defined with the ETABLE command. - - Portions of this command are not supported by PowerGraphics - [/GRAPHICS,POWER]. - - Table: 226:: : PRVECT - Valid Item and Component Labels - """ - command = f"PRVECT,{item},{lab2},{lab3},{labp}" - return self.run(command, **kwargs) - - def sumtype(self, label="", **kwargs): - """Sets the type of summation to be used in the following load case - - APDL Command: SUMTYPE - operations. - - Parameters - ---------- - label - Summation type - - COMP - Combine element component stresses only. Stresses such as average nodal - stresses, principal stresses, equivalent stresses, and - stress intensities are derived from the combined element - component stresses. Default. - - PRIN - Combine principal stress, equivalent stress, and stress intensity directly as - stored on the results file. Component stresses are not - available with this option. - - Notes - ----- - Issue SUMTYPE,PRIN when you want to have a load case operation (LCOPER) - act on the principal / equivalent stresses instead of the component - stresses. Also issue SUMTYPE,PRIN when you want to read in load cases - (LCASE). Note that the SUMTYPE setting is not maintained between /POST1 - sessions. - - SUMTYPE,PRIN also causes principal nodal values to be the average of - the contributing principal element nodal values (see AVPRIN,1). - - BEAM188 and BEAM189 elements compute principal stress, equivalent - stress, and stress intensity values on request instead of storing them - on the results file; SUMTYPE,PRIN does not apply for these elements. - """ - command = f"SUMTYPE,{label}" - return self.run(command, **kwargs) diff --git a/src/ansys/mapdl/core/_commands/post1_/setup.py b/src/ansys/mapdl/core/_commands/post1_/setup.py deleted file mode 100644 index cea5f10075d..00000000000 --- a/src/ansys/mapdl/core/_commands/post1_/setup.py +++ /dev/null @@ -1,768 +0,0 @@ -# Copyright (C) 2016 - 2025 ANSYS, Inc. and/or its affiliates. -# SPDX-License-Identifier: MIT -# -# -# Permission is hereby granted, free of charge, to any person obtaining a copy -# of this software and associated documentation files (the "Software"), to deal -# in the Software without restriction, including without limitation the rights -# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -# copies of the Software, and to permit persons to whom the Software is -# furnished to do so, subject to the following conditions: -# -# The above copyright notice and this permission notice shall be included in all -# copies or substantial portions of the Software. -# -# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -# SOFTWARE. - - -class Setup: - def append( - self, - lstep="", - sbstep="", - fact="", - kimg="", - time="", - angle="", - nset="", - **kwargs, - ): - """Reads data from the results file and appends it to the database. - - APDL Command: APPEND - - Parameters - ---------- - lstep - Load step number of the data set to be read. Defaults to 1. If - FIRST, ignore SBSTEP and TIME and read the first data set. If - LAST, ignore SBSTEP and TIME and read the last data set. If NEXT, - ignore SBSTEP and TIME and read the next data set. If already at - the last data set, the next set is the first data set. If NEAR, - ignore SBSTEP and read the data set nearest to TIME. If TIME is - blank, read the first data set. If LIST, scan the results file to - produce a summary of each load step (FACT, KIMG, TIME and ANGLE - are ignored). - - sbstep - Substep number (within LSTEP) (defaults to last substep of load - step). For the Buckling (ANTYPE,BUCKLE) or Modal (ANTYPE,MODAL) - analysis, the substep corresponds to the mode number (defaults to - first mode). If LSTEP = LIST, SBSTEP = 0 or 1 will list the basic - load step information; SBSTEP = 2 will also list the load step - title, and label the imaginary data sets if they exist. - - fact - Scale factor applied to data read from the file. If zero (or - blank), a value of 1.0 is used. Harmonic velocities or - accelerations may be calculated from the displacement results from - a modal or harmonic (ANTYPE,HARMIC) analyses. If FACT = VELO, the - harmonic velocities (v) are calculated from the displacements (d) - at a particular frequency (f) according to the relationship v = - 2 πfd. Similarly, if FACT = ACEL, the harmonic accelerations (a) - are calculated as a = (2 πf)2d. - - kimg - Used only with results from complex analyses: - - 0 - Store real part of complex solution. - - 1 - Store imaginary part. - - time - Time-point identifying the data set to be read. For harmonic - analyses, time corresponds to the frequency. For the buckling - analysis, time corresponds to the load factor. Used only in the - following cases: If LSTEP is NEAR, read the data set nearest to - TIME. If both LSTEP and SBSTEP are zero (or blank), read data set - at time = TIME. If TIME is between two solution time points on the - results file, a linear interpolation is done between the two data - sets. Solution items not written to the results file [OUTRES] for - either data set will result in a null item after data set - interpolation. If TIME is beyond the last time point on the file, - the last time point is used. - - angle - Circumferential location (0° to 360°). Defines the circumferential - location for the harmonic calculations used when reading from the - results file. The harmonic factor (based on the circumferential - angle) is applied to the harmonic elements (PLANE25, PLANE75, - PLANE78, PLANE83, and SHELL61) of the load case. See the - Mechanical APDL Theory Reference for details. Note that factored - values of applied constraints and loads will overwrite any values - existing in the database. - - nset - Data set number of the data set to be read. If a positive value - for NSET is entered, LSTEP, SBSTEP, KIMG, and TIME are ignored. - Available set numbers can be determined by APPEND,LIST. To - determine if data sets are real or imaginary, issue APPEND,LIST,2 - which labels imaginary data sets. - - Notes - ----- - Reads a data set from the results file and appends it to the existing - data in the database for the selected model only. The existing - database is not cleared (or overwritten in total), allowing the - requested results data to be merged into the database. Various - operations may also be performed during the read operation. The - database must have the model geometry available (or used the RESUME - command before the APPEND command to restore the geometry from - File.DB). - """ - command = f"APPEND,{lstep},{sbstep},{fact},{kimg},{time},{angle},{nset}" - return self.run(command, **kwargs) - - def desol( - self, - elem="", - node="", - item="", - comp="", - v1="", - v2="", - v3="", - v4="", - v5="", - v6="", - **kwargs, - ): - """Defines or modifies solution results at a node of an element. - - APDL Command: DESOL - - Parameters - ---------- - elem - Element number for which results are defined or modified. If ALL, - apply to all selected elements [ESEL]. - - node - Node of element (actual node number, not the position) to which - results are specified. If ALL, specify results for all selected - nodes [NSEL] of element. If NODE = P, graphical picking is enabled - and all remaining command fields are ignored (valid only in the - GUI). A component name may also be substituted for NODE. - - item - Label identifying results. Valid item labels are shown in - Table 129: DESOL - Valid Item and Component Labels below. Some - items also require a component label (Comp). - - comp - Component of the item (if required); see Table 129: DESOL - Valid - Item and Component Labels. - - v1 - Value (in the element coordinate system) assigned to the database - item (and component, if any). If zero, a zero value will be - assigned. If blank, value remains unchanged. - - v2, v3, v4, . . . , v6 - Additional values (if any) assigned to the remaining components (in - the order corresponding to the Comp list shown below) for the - specified Item (starting from the specified Comp label and - proceeding to the right). - - Notes - ----- - The DESOL command defines or modifies solution results in the database - at a node of an area or volume element. For example, - DESOL,35,50,S,X,1000,2000,1000 assigns values 1000, 2000, and 1000 to - SX, SY, and SZ (respectively) of node 50 of element 35. - - The settings of the POST1 FORCE, SHELL, and LAYER commands, if - applicable, further specify which database items are affected. - - For layered composite shells, specify the current element layer (LAYER) - before issuing the DESOL command. - - All data is stored in the solution coordinate system but is displayed - in the results coordinate system (RSYS). To list the current results, - use the PRESOL command. - - Modified solution results are not saved automatically. To save separate - records of modified results, use either the RAPPND or LCWRITE command. - - Result items are available depending on element type; check the - individual element for availability. Valid item and component labels - for element results are: - - Table: 129:: : DESOL - Valid Item and Component Labels - """ - command = f"DESOL,{elem},{node},{item},{comp},{v1},{v2},{v3},{v4},{v5},{v6}" - return self.run(command, **kwargs) - - def dnsol( - self, - node="", - item="", - comp="", - v1="", - v2="", - v3="", - v4="", - v5="", - v6="", - **kwargs, - ): - """Defines or modifies solution results at a node. - - APDL Command: DNSOL - - Parameters - ---------- - node - Node for which results are specified. If ALL, apply to all - selected nodes [NSEL]. If NODE = P, graphical picking is enabled - and all remaining command fields are ignored (valid only in the - GUI). A component name may also be substituted for NODE. - - item - Label identifying results, see Table 131: DNSOL - Valid Item and - Component Labels. Items also require a component label. - - comp - Component of the item. Valid component labels are shown - Table 131: DNSOL - Valid Item and Component Labels below. - - v1, v2, v3, . . . , v6 - Value assigned to result. If zero, a zero value will be assigned. - If blank, the value remains unchanged. Additional values (if any) - assigned to the remaining components (in the order corresponding to - the Comp list shown below for the specified Item (starting from the - specified Comp label and proceeding to the right). - - Notes - ----- - DNSOL can be used only with FULL graphics activated (/GRAPHICS,FULL); - it will not work correctly with PowerGraphics activated. - - DNSOL defines or modifies solution results in the database at a node. - For example, DNSOL,35,U,X,.001,.002,.001 assigns values 0.001, 0.002, - and 0.001 to UX, UY, and UZ (respectively) for node 35. All results - that are changed in the database, including the nodal degree of freedom - results, are available for all subsequent operations. All data is - stored in the solution coordinate system, but will be displayed in the - results coordinate system [RSYS]. Use the PRNSOL command to list the - current results. - - Data input by DNSOL is stored in temporary space and does not replace - information in the database. Therefore, data input by this command may - be overwritten if a change is made to the selected set of nodes. - - Issuing the DNSOL command or its GUI equivalent requires you to place - the data type (stress/strain) in the element nodal records. To get - around this requirement, use the DESOL command or equivalent path to - add a "dummy" element stress/strain record. - - Result items are available depending on element type; check the - individual element for availability. Valid item and component labels - for element results are: - - Table: 131:: : DNSOL - Valid Item and Component Labels - - For SHELL131 and SHELL132 elements with KEYOPT(3) = 0 or 1, use the - labels TBOT, TE2, TE3, ..., TTOP instead of TEMP. - """ - command = f"DNSOL,{node},{item},{comp},{v1},{v2},{v3},{v4},{v5},{v6}" - return self.run(command, **kwargs) - - def hrcplx( - self, - loadstep="", - substep="", - omegat="", - firstlc_ase="", - secondlc_ase="", - **kwargs, - ): - """Computes and stores in the database the time-harmonic solution at a - - APDL Command: HRCPLX - prescribed phase angle. - - Parameters - ---------- - loadstep - Load step number of the data set to be read (defaults to 1). - - substep - Substep number within LOADSTEP. - - omegat - Angle in degrees (Ω (angle) times T (time)). - - 1stlcase - First load case number (defaults to 1). - - 2ndlcase - Second load case number (defaults to 2). - - Notes - ----- - HRCPLX invokes a macro that combines the real and imaginary parts of - the solution. If the angle is specified, it produces the following: - - Where: - - RR and RI are, respectively, the real and imaginary parts of the - results quantity (e.g. the nodal displacements, the reaction forces, - ...). - - α is the angle (OMEGAT). - - 1STLCASE and 2NDLCASE are internally generated load cases. You may want - to specify these to avoid overwriting an existing load case number 1 or - 2. - - Not all results computed by this command are valid. See Summable, Non- - Summable and Constant Data in the Basic Analysis Guide for more - information. When the amplitude of the solution is requested (OMEGAT >= - 360°), averaged values (such as the nodal component stresses, which are - an average of element nodal component stresses) are calculated by - averaging the amplitudes. Because the degrees of freedom results have - different phases, derived results (such as the equivalent stress SEQV) - are not valid. See POST1 and POST26 – Complex Results Postprocessing - for more details about post-processing complex results. - - For postprocessing amplitudes, the only appropriate coordinate system - is the solution coordinate system (RSYS ,SOLU). When displaying the - displacement amplitudes, use a contour display (PLNSOL command). - Because a deformed shape display (PLDISP command) could lead to a non- - physical shape, the displacement scaling is off by default - (/DSCALE,,OFF). - - For postprocessing cylindrical geometry, it is suggested that you - rotate the element coordinate systems into the appropriate cylindrical - system (EMODIF,,ESYS) before running the solution and then view the - results in this system (RSYS,SOLU) in POST1. - - Since HRCPLX performs load case combinations, it alters most of the - data in the database. In particular, it alters applied loads such as - forces and imposed displacements. To restore the original loads in the - database for a subsequent analysis, reissue the SET command in POST1 to - retrieve the real and imaginary set data. - - To animate the solution over one period, use the ANHARM command. - - OMEGAT is not equal to the phase shift. - - This command is not supported after a cyclic symmetry analysis; use - /CYCEXPAND,,PHASEANG instead. - """ - command = f"HRCPLX,{loadstep},{substep},{omegat},{firstlc_ase},{secondlc_ase}" - return self.run(command, **kwargs) - - def rescombine( - self, - numfiles="", - fname="", - ext="", - lstep="", - sbstep="", - fact="", - kimg="", - time="", - angle="", - nset="", - order="", - **kwargs, - ): - """Reads results from local results files into the database after a - - APDL Command: RESCOMBINE - distributed memory parallel (Distributed ANSYS) solution. - - Parameters - ---------- - numfiles - Number of local results files that are to be read into the database - from the distributed memory parallel solution. This number should - be equal to the number of processes used in the parallel solution. - - fname - File name (jobname) used during the distributed parallel solution. - The file name must be an alphanumeric string (up to 32 characters) - enclosed in single quotes. - - ext - File extension for the results files (for example, RST, RTH, RMG, - etc.). The file extension must be an alphanumeric string (up to 8 - characters) enclosed in single quotes. - - lstep - Load step number of the data set to be read (defaults to 1): - - N - Read load step N. - - FIRST - Read the first data set (Sbstep and TIME are ignored). - - LAST - Read the last data set (Sbstep and TIME are ignored). - - NEXT - Read the next data set (Sbstep and TIME are ignored). If at the last data set, - the first data set will be read as the next. - - PREVIOUS - Read the previous data set (Sbstep and TIME are ignored). If at the first data - set, the last data set will be read as the previous. - - NEAR - Read the data set nearest to TIME (Sbstep is ignored). If TIME is blank, read - the first data set. - - LIST - Scan the results files and list a summary of each load step (KIMG, TIME, ANGLE, - NSET, and ORDER are ignored.) - - sbstep - Substep number within Lstep (defaults to the last substep of the - load step). For a buckling (ANTYPE,BUCKLE) or modal (ANTYPE,MODAL) - analysis, Sbstep corresponds to the mode number (defaults to the - first mode). Specify Sbstep = LAST to store the last substep for - the specified load step. - - fact - Scale factor applied to data read from the files. If zero (or - blank), a value of 1.0 is used. A nonzero factor excludes non- - summable items. Harmonic velocities or accelerations may be - calculated from the displacement results from a modal - (ANTYPE,MODAL) or harmonic (ANTYPE,HARMIC) analysis. If Fact = - VELO, the harmonic velocities (v) are calculated from the - displacements (d) at a particular frequency (f) according to the - relationship v = 2πfd. Similarly, if Fact = ACEL, the harmonic - accelerations (a) are calculated as a = (2πf)2d. - - kimg - Used only with complex results (harmonic and complex modal - analyses). - - 0 or REAL - Store the real part of a complex solution (default). - - 1, 2 or IMAG - Store the imaginary part of a complex solution. - - 3 or AMPL - Store the amplitude. - - 4 or PHAS - Store the phase angle. The angle value, expressed in degrees, will be between - -180° and +180°. - - time - Time-point identifying the data set to be read. For a harmonic - analysis, time corresponds to the frequency. For a buckling - analysis, time corresponds to the load factor. Used only in the - following cases: If Lstep = NEAR, read the data set nearest to - TIME. If both Lstep and Sbstep are zero (or blank), read data set - at time = TIME. If TIME is between two solution time points on the - results file, a linear interpolation is done between the two data - sets. Solution items not written to the results file (OUTRES) for - either data set will result in a null item after data set - interpolation. If TIME is beyond the last time point on the file, - the last time point will be used. - - angle - Circumferential location (0.0 to 360°). Defines the circumferential - location for the harmonic calculations used when reading from the - results file. The harmonic factor (based on the circumferential - angle) is applied to the harmonic elements (PLANE25, PLANE75, - PLANE78, PLANE83, and SHELL61) of the load case. See the Mechanical - APDL Theory Reference for details. Note that factored values of - applied constraints and loads will overwrite any values existing in - the database. - - nset - Data set number of the data set to be read. If a positive value for - NSET is entered, Lstep, Sbstep, KIMG, and TIME are ignored. - Available set numbers can be determined by RESCOMBINE,,,,LIST. - - order - Key to sort the harmonic index results. This option applies to - cyclic symmetry buckling and modal analyses only, and is valid only - when Lstep = FIRST, LAST, NEXT, PREVIOUS, NEAR or LIST. - - ORDER - Sort the harmonic index results in ascending order of eigenfrequencies or - buckling load multipliers. - - (blank) - No sorting takes place. - - Notes - ----- - RESCOMBINE is an ANSYS command macro that allows you to combine results - from a distributed memory parallel (Distributed ANSYS) solution. In a - distributed memory parallel solution, a global results file is saved by - default. However, if you issued DMPOPTION,RST,NO in the parallel - solution, no global results file is written and all local results files - will be kept. In this case, you can use the RESCOMBINE command macro in - the general postprocessor (/POST1) to read results into the database - for postprocessing. - - In order to use the RESCOMBINE command, all local results files from - the distributed memory parallel solution must be in the current working - directory. If running on a single machine, the local results files are - saved in the working directory by default. If running on a cluster, the - local results files are kept in the working directory on each compute - node. For this latter case, you must copy the local results files to - the working directory on the primary compute node. - - Similar to the SET command, the RESCOMBINE command macro defines the - data set to be read from the results files into the database. Various - operations may also be performed during the read operation (see the SET - command for more details). The database must have the model data - available (or use the RESUME command before the RESCOMBINE command to - restore the geometry from Jobname.DB). - - After a set of data is combined into the database using RESCOMBINE, the - RESWRITE command can be used to write this set of data into a new - results file. This new results file will essentially contain the - current set of results data for the entire (i.e., global) model. - """ - command = f"RESCOMBINE,{numfiles},{fname},{ext},{lstep},{sbstep},{fact},{kimg},{time},{angle},{nset},{order}" - return self.run(command, **kwargs) - - def set( - self, - lstep="", - sbstep="", - fact="", - kimg="", - time="", - angle="", - nset="", - order="", - **kwargs, - ): - """Defines the data set to be read from the results file. - - APDL Command: SET - - Parameters - ---------- - lstep - Load step number of the data set to be read (defaults to 1): - - N - Read load step N. - - FIRST - Read the first data set (``Sbstep`` and ``TIME`` are ignored). - - LAST - Read the last data set (``Sbstep`` and ``TIME`` are ignored). - - NEXT - Read the next data set (``Sbstep`` and ``TIME`` are ignored). If at the last data set, - the first data set will be read as the next. - - PREVIOUS - Read the previous data set (``Sbstep`` and ``TIME`` are ignored). If at the first data - set, the last data set will be read as the previous. - - NEAR - Read the data set nearest to ``TIME`` (``Sbstep`` is ignored). If ``TIME`` is blank, read - the first data set. - - LIST - Scan the results file and list a summary of each load step. (``KIMG``, ``TIME``, - ``ANGLE``, and ``NSET`` are ignored.) - - .. versionchanged:: 0.64 - From version 0.64 you can use the methods ``to_list`` and - ``to_array`` on the object returning from ``mapdl.set("list")``. - - sbstep - Substep number (within Lstep). Defaults to the last substep of the - load step (except in a buckling or modal analysis). For a buckling - (``ANTYPE,BUCKLE``) or modal (``ANTYPE,MODAL``) analysis, ``Sbstep`` - corresponds to the mode number. Specify ``Sbstep = LAST`` to store the - last substep for the specified load step (that is, issue a - ``SET,Lstep,LAST`` command). - - fact - Scale factor applied to data read from the file. If zero (or - blank), a value of 1.0 is used. This scale factor is only applied - to displacement and stress results. A nonzero factor excludes non- - summable items. - - kimg - Used only with complex results (harmonic and complex modal - analyses). - - 0 or REAL - Store the real part of complex solution (default). - - 1, 2 or IMAG - Store the imaginary part of a complex solution. - - 3 or AMPL - Store the amplitude - - 4 or PHAS - Store the phase angle. The angle value, expressed in degrees, - will be between -180° and +180°. - - time - Time-point identifying the data set to be read. For a harmonic - analyses, time corresponds to the frequency. - - angle - Circumferential location (0.0 to 360°). Defines the - circumferential location for the harmonic calculations used when - reading from the results file. - - nset - Data set number of the data set to be read. If a positive value - for ``NSET`` is entered, ``Lstep``, ``Sbstep``, ``KIMG``, and ``TIME`` are ignored. - Available set numbers can be determined by ``SET,LIST``. - - order - Key to sort the harmonic index results. This option applies to - cyclic symmetry buckling and modal analyses only, and is valid only - when ``Lstep = FIRST, LAST, NEXT, PREVIOUS, NEAR or LIST``. - - ORDER - Sort the harmonic index results in ascending order of eigenfrequencies or - buckling load multipliers. - - (blank) - No sorting takes place. - - Notes - ----- - Defines the data set to be read from the results file into the - database. Various operations may also be performed during the read - operation. The database must have the model geometry available (or use - the ``RESUME`` command before the ``SET`` command to restore the geometry from - ````). Values for applied constraints [``D``] and loads [``F``] in the - database will be replaced by their corresponding values on the results - file, if available. (See the description of the ``OUTRES`` command.) In a - single load step analysis, these values are usually the same, except - for results from harmonic elements. (See the description of the ANGLE - value above.) - - In an interactive run, the sorted list (``ORDER`` option) is also available - for results-set reading via a GUI pick option. - - You can postprocess results without issuing a ``SET`` command if the - solution results were saved to the database file (````). - Distributed ANSYS, however, can only postprocess using the results file - (for example, Jobname.RST) and cannot use the ```` file since no - solution results are written to the database. Therefore, you must issue - a ``SET`` command or a ``RESCOMBINE`` command before postprocessing in - Distributed ANSYS. - """ - command = f"SET,{lstep},{sbstep},{fact},{kimg},{time},{angle},{nset},{order}" - return self.run(command, **kwargs) - - def subset( - self, - lstep="", - sbstep="", - fact="", - kimg="", - time="", - angle="", - nset="", - **kwargs, - ): - """Reads results for the selected portions of the model. - - APDL Command: SUBSET - - Parameters - ---------- - lstep - Load step number of the data set to be read (defaults to 1): - - N - Read load step N. - - FIRST - Read the first data set (``SBSTEP`` and ``TIME`` are ignored). - - LAST - Read the last data set (``SBSTEP`` and ``TIME`` are ignored). - - NEXT - Read the next data set (``SBSTEP`` and ``TIME`` are ignored). If at the last data set, - the first data set will be read as the next. - - NEAR - Read the data set nearest to ``TIME`` (``SBSTEP`` is ignored). If ``TIME`` is blank, read - the first data set. - - LIST - Scan the results file and list a summary of each load step. (``FACT``, ``KIMG``, ``TIME`` - and ``ANGLE`` are ignored.) - - sbstep - Substep number (within Lstep). For the buckling (``ANTYPE,BUCKLE``) - analysis or the modal (``ANTYPE,MODAL``) analysis, the substep - corresponds to the mode number. Defaults to last substep of load - step (except for ``ANTYPE,BUCKLE or MODAL``). If ``Lstep = LIST, SBSTEP - = 0 or 1`` lists the basic step information, whereas ``SBSTEP = 2`` also - lists the load step title, and labels imaginary data sets if they - exist. - - fact - Scale factor applied to data read from the file. If zero (or - blank), a value of 1.0 is used. Harmonic velocities or - accelerations may be calculated from the displacement results from - a modal (``ANTYPE,MODAL``) or harmonic (``ANTYPE,HARMIC``) analyses. If - ``FACT = VELO``, the harmonic velocities (v) are calculated from the - displacements (d) at a particular frequency (f) according to the - relationship v = 2 πfd. Similarly, if ``FACT = ACEL``, the harmonic - accelerations (a) are calculated as a = (2 πf)2d. - - kimg - Used only with results from complex analyses: - - 0 - Store real part of complex solution - - 1 - Store imaginary part. - - time - Time-point identifying the data set to be read. For harmonic - analyses, time corresponds to the frequency. For the buckling - analysis, time corresponds to the load factor. Used only in the - following cases: If Lstep is ``NEAR``, read the data set nearest to - ``TIME``. If both Lstep and ``SBSTEP`` are zero (or blank), read data set - at time = ``TIME``. If ``TIME`` is between two solution time points on the - results file, a linear interpolation is done between the two data - sets. Solution items not written to the results file [OUTRES] for - either data set will result in a null item after data set - interpolation. If ``TIME`` is beyond the last time point on the file, - use the last time point. - - angle - Circumferential location (0.0 to 360°). Defines the - circumferential location for the harmonic calculations used when - reading from the results file. The harmonic factor (based on the - circumferential angle) is applied to the harmonic elements - (``PLANE25``, ``PLANE75``, ``PLANE78``, ``PLANE83``, and ``SHELL61``) of the load case. - See the Mechanical APDL Theory Reference for details. Note that - factored values of applied constraints and loads will overwrite any - values existing in the database. - - nset - Data set number of the data set to be read. If a positive value - for ``NSET`` is entered, ``Lstep``, ``SBSTEP``, ``KIMG``, and ``TIME`` are ignored. - Available set numbers can be determined by ``*SET,LIST``. - - Notes - ----- - Reads a data set from the results file into the database for the - selected portions of the model only. Data that has not been specified - for retrieval from the results file by the ``INRES`` command will be listed - as having a zero value. Each time that the ``SUBSET`` command is issued, - the data currently in the database will be overwritten with a new set - of data. Various operations may also be performed during the read - operation. The database must have the model geometry available (or - used the RESUME command before the ``SUBSET`` command to restore the - geometry from ``File.DB``). - """ - command = f"SUBSET,{lstep},{sbstep},{fact},{kimg},{time},{angle},{nset}" - return self.run(command, **kwargs) diff --git a/src/ansys/mapdl/core/_commands/post1_/special.py b/src/ansys/mapdl/core/_commands/post1_/special.py deleted file mode 100644 index 2f3333963fb..00000000000 --- a/src/ansys/mapdl/core/_commands/post1_/special.py +++ /dev/null @@ -1,2523 +0,0 @@ -# Copyright (C) 2016 - 2025 ANSYS, Inc. and/or its affiliates. -# SPDX-License-Identifier: MIT -# -# -# Permission is hereby granted, free of charge, to any person obtaining a copy -# of this software and associated documentation files (the "Software"), to deal -# in the Software without restriction, including without limitation the rights -# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -# copies of the Software, and to permit persons to whom the Software is -# furnished to do so, subject to the following conditions: -# -# The above copyright notice and this permission notice shall be included in all -# copies or substantial portions of the Software. -# -# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -# SOFTWARE. - - -class Special: - def bfint( - self, - fname1="", - ext1="", - fname2="", - ext2="", - kpos="", - clab="", - kshs="", - tolout="", - tolhgt="", - **kwargs, - ): - """Activates the body force interpolation operation. - - APDL Command: BFINT - - Parameters - ---------- - fname1 - File name and directory path (248 characters maximum, - including directory) from which to read data for - interpolation. If you do not specify a directory path, it - will default to your working directory and you can use all - 248 characters for the file name. - - ext1 - Filename extension (eight-character maximum). - - fname2 - File name and directory path (248 characters maximum, - including directory) to which BF commands are written. If - you do not specify a directory path, it will default to - your working directory and you can use all 248 characters - for the file name. - - ext2 - Filename extension (eight-character maximum). - - kpos - Position on Fname2 to write block of BF commands: - - 0 - Beginning of file (overwrite existing file). - - 1 - End of file (append to existing file). - - clab - Label (8 characters maximum, including the colon) for this - block of BF commands in Fname2. This label is appended to - the colon (:). Defaults to BFn, where n is the cumulative - iteration number for the data set currently in the - database. - - kshs - Shell-to-solid submodeling key: - - 0 - Solid-to-solid or shell-to-shell submodel. - - 1 - Shell-to-solid submodel. - - tolout - Extrapolation tolerance about elements, based on a - fraction of the element dimension. Submodel nodes outside - the element by more than TOLOUT are not accepted as - candidates for DOF extrapolation. Defaults to 0.5 (50%). - - tolhgt - Height tolerance above or below shell elements, in units - of length. Used only for shell-to-shell submodeling (KSHS - = 0). Submodel nodes off the element surface by more than - TOLHGT are not accepted as candidates for DOF - interpolation or extrapolation. Defaults to 0.0001 times - the maximum element dimension. - - Notes - ----- - File Fname1 should contain a node list for which body forces are to be - interpolated [NWRITE]. File Fname2 is created, and contains - interpolated body forces written as a block of nodal BF commands. - - Body forces are interpolated from elements having TEMP as a valid body - force or degree of freedom, and only the label TEMP is written on the - nodal BF commands. Interpolation is performed for all nodes on file - Fname1 using the results data currently in the database. For layered - elements, use the LAYER command to select the locations of the - temperatures to be used for interpolation. Default locations are the - bottom of the bottom layer and the top of the top layer. - - The block of BF commands begins with an identifying colon label command - and ends with a /EOF command. The colon label command is of the form - :Clab, where Clab is described above. Interpolation from multiple - results sets can be performed by looping through the results file in a - user-defined macro. Additional blocks can be appended to Fname2 by - using KPOS and unique colon labels. A /INPUT command, with the - appropriate colon label, may be used to read the block of commands. - - If the model has coincident (or very close) nodes, BFINT must be - applied to each part of the model separately to ensure that the mapping - of the nodes is correct. For example, if nodes belonging to two - adjacent parts linked by springs are coincident, the operation should - be performed on each part of the model separately. - """ - command = f"BFINT,{fname1},{ext1},,{fname2},{ext2},,{kpos},{clab},{kshs},{tolout},{tolhgt}" - return self.run(command, **kwargs) - - def cbdof( - self, - fname1="", - ext1="", - fname2="", - ext2="", - kpos="", - clab="", - kshs="", - tolout="", - tolhgt="", - tolthk="", - **kwargs, - ): - """Activates cut-boundary interpolation (for submodeling). - - APDL Command: CBDOF - - Parameters - ---------- - fname1 - File name and directory path (248 characters maximum, - including directory) from which to read boundary node - data. If no specified directory path exists, the path - defaults to your working directory and you can use all 248 - characters for the file name. - - ext1 - Filename extension (eight-character maximum). - - fname2 - File name and directory path (248 characters maximum, - including directory) to which cut-boundary D commands are - written. If no specified directory path exists, the path - defaults to your working directory and you can use all 248 - characters for the file name. - - ext2 - Filename extension (eight-character maximum). - - kpos - Position on Fname2 to write block of D commands: - - 0 - Beginning of file (overwrite existing file). - - 1 - End of file (append to existing file). - - clab - Label (eight characters maximum, including the colon) for - this block of D commands on Fname2. his label is appended - to the colon (:). Defaults to CBn, where n is the - cumulative iteration number for the data set currently in - the database. For imaginary data (see KIMG on the ``*SET`` - command), Clab defaults to CIn. - - kshs - Shell-to-solid submodeling key: - - 0 - Solid-to-solid or shell-to-shell submodel. - - 1 - Shell-to-solid submodel. - - tolout - Extrapolation tolerance about elements, based on a - fraction of the element dimension. Submodel nodes outside - the element by more than TOLOUT are not accepted as - candidates for DOF extrapolation. Defaults to 0.5 (50 - percent). - - tolhgt - Height tolerance above or below shell elements, in units - of length. Used only for shell-to-shell submodeling (KSHS - = 0). Submodel nodes off the element surface by more than - TOLHGT are not accepted as candidates for - degree-of-freedom interpolation or extrapolation. - Defaults to 0.0001 times the maximum element dimension. - - tolthk - Height tolerance above or below shell elements, based on a - fraction of the shell element thickness. Used only for - shell-to-solid submodeling (KSHS = 1). Submodel nodes off - the element surface by more than TOLTHK are not accepted - as candidates for DOF interpolation or - extrapolation. Defaults to 0.1 times the average shell - thickness. - - Notes - ----- - File Fname1 should contain a node list for which boundary - conditions are to be interpolated (NWRITE). File Fname2 is - created to contain interpolated boundary conditions written as - a block of D commands. - - Boundary conditions are written for the active - degree-of-freedom set for the element from which interpolation - is performed. Interpolation occurs on the selected set of - elements. The block of D commands begins with an identifying - colon label and ends with a /EOF command. The colon label is - of the form :Clab (described above). - - Interpolation from multiple results sets can be performed by - looping through the results file in a user-defined macro. - Additional blocks can be appended to Fname2 by using KPOS and - unique colon labels. To read the block of commands, issue the - /INPUT command with the appropriate colon label. - - If the model has coincident (or very close) nodes, the CBDOF - must be applied to each part of the model separately to ensure - that the mapping of the nodes is correct. For example, if - nodes belonging to two adjacent parts linked by springs are - coincident, the operation should be performed on each part of - the model separately. - - Resume the coarse model database at the beginning of the - cut-boundary procedure. The database should have been saved - after the first coarse model solution, as the number of nodes - in the database and the results file must match, and internal - nodes are sometimes created during the solution. - - Caution: Relaxing the TOLHGT or TOLTHK tolerances to allow - submodel nodes to be "found" can produce poor submodel - results. - """ - command = f"CBDOF,{fname1},{ext1},,{fname2},{ext2},,{kpos},{clab},{kshs},{tolout},{tolhgt},{tolthk}" - return self.run(command, **kwargs) - - def cmsfile(self, option="", fname="", ext="", cmskey="", **kwargs): - """Specifies a list of component mode synthesis (CMS) results files for - - APDL Command: CMSFILE - plotting results on the assembly. - - Parameters - ---------- - option - Specifies the command operation: - - ADD - Add the specified component results file (Fname) to the list of files to plot. - This option is the default. - - DELETE - Remove the specified component results file (Fname) from the list of files to - plot. - - LIST - List all specified component results files. - - CLEAR - Clear all previous files added. - - ALL - Add all component results (.rst) files from the working directory to the list - of files to plot. - - fname - The file name (with full directory path) of the component results - file. The default file name is the Jobname (specified via the - /FILNAME command). - - ext - The file name (Fname) extension. The default extension is .rst. - - cmskey - Valid only when adding a results file (Option = ADD or ALL), this - key specifies whether or not to check the specified .rst file to - determine if it was created via a CMS expansion pass: - - ON - Check (default). - - OFF - Do not check. - - Notes - ----- - The CMSFILE command specifies the list of component mode synthesis - (CMS) results files to include when plotting the mode shape of an - assembly. - - During postprocessing (/POST1) of a CMS analysis, issue the CMSFILE - command to point to component results files of interest. (You can issue - the command as often as needed to include all or some of the component - results files.) Issue the SET command to acquire the frequencies and - mode shapes from substeps for all specified results files. Execute a - plot (PLNSOL) or print (PRNSOL) operation to display the mode shape of - the entire assembly. - - When you specify a results file to add to the plot list, the default - behavior of the command (CmsKey = ON) is to first verify that the file - is from a CMS analysis and that the frequencies of the result sets on - the file match the frequencies on the first file in the list. If CmsKey - = OFF, you can add any .rst file to the list of files to plot, even if - the file was not expanded via a CMS expansion pass. - - If CmsKey = ON (default), output from the command appears as: ADD CMS - FILE = filename.rst. : If CmsKey = OFF, output from the command appears - as: ADD FILE = filename.rst. - - If Option = DELETE or CLEAR, you must clear the database (/CLEAR), then - re-enter the postprocessor (/POST1) and issue a SET command for the - change to take effect on subsequent plots. - - Clearing the database does not clear the list of files specified via - the CMSFILE command. Specify Option = CLEAR to clear the list of files. - """ - command = f"CMSFILE,{option},{fname},{ext},{cmskey}" - return self.run(command, **kwargs) - - def cyccalc(self, fileprefix="", fileformat="", **kwargs): - """Calculates results from a cyclic harmonic mode-superposition analysis - - APDL Command: CYCCALC - using the specifications defined by CYCSPEC. - - Parameters - ---------- - fileprefix - Each result table (corresponding to each CYCSPEC specification) is - written to a file beginning with FilePrefix. If blank (default), - the result tables are written to the output file. - - fileformat - If FilePrefix is specified, then use FileFormat to specify the - format of the file to be written: - - FORM - Formatted file (default) - - CSV - Comma-separated value file - - Notes - ----- - CYCCALC loops through the specification given by CYCSPEC and computes - the requested outputs. The outputs are given in a table format, with - the rows corresponding to each frequency solution from the harmonic - analysis, and the columns corresponding to each sector. The table - entries are the maximum value of the specified quantity at the - specified location in the sector. In addition, columns containing the - maximum value at the frequency, the sector in which it occurs, and the - node in the sector at which it occurs are output. - - If FilePrefix is specified, a file is created for each output table - with the name FilePrefix_node_type.ext, where node is the node number - or component name, type is the item/component requested, and the file - extension .ext is either .txt or .csv, depending on FileFormat. - - A SET command must precede the CYCCALC command. - - The CYCCALC results are based on the currently active RSYS, SHELL, - LAYER, and AVPRIN settings. - """ - command = f"CYCCALC,{fileprefix},{fileformat}" - return self.run(command, **kwargs) - - def cycfiles(self, fnamerst="", extrst="", fnamerfrq="", extrfrq="", **kwargs): - """Specifies the data files where results are to be found for a cyclic - - APDL Command: CYCFILES - symmetry mode-superposition harmonic analysis. - - Parameters - ---------- - fnamerst - The file name and directory path of the results file from the - cyclic modal solution. Defaults to Jobname. - - extrst - File name extension for FnameRst. Defaults to rst. - - fnamerfrq - The file name and directory path of the results file from the - cyclic mode-superposition harmonic solution. Defaults to the value - of the FnameRst argument. - - extrfrq - File name extension for FnameRfrq. Defaults to rfrq. - """ - command = f"CYCFILES,{fnamerst},{extrst},{fnamerfrq},{extrfrq}" - return self.run(command, **kwargs) - - def cycphase(self, type_="", option="", **kwargs): - """Provides tools for determining minimum and maximum possible result - - APDL Command: CYCPHASE - values from frequency couplets produced in a modal cyclic symmetry - analysis. - - Parameters - ---------- - type\\_ - The type of operation requested: - - DISP - Calculate the maximum and minimum possible displacement at each node in the - original sector model. Store the values and the phase angle - at which they occurred. - - STRESS - Calculate the maximum and minimum possible stresses at each node in the - original sector model. Store the values and the phase - angle at which they occurred. - - STRAIN - Calculate the maximum and minimum possible strains at each node in the original - sector model. Store the values and the phase angle at - which they occurred. - - ALL - Calculate the maximum and minimum possible displacement, stress and strain at - each node in the original sector model. Store the values and - the phase angle at which they occurred. - - GET - Places the value of a MAX or MIN item into the _CYCVALUE parameter, the node - for that value in the _CYCNODE parameter, and the phase angle - for the value in the _CYCPHASE parameter. - - PUT - Put resulting sweep values for printing (via the PRNSOL command ) or plotting - (via the PLNSOL command). - - LIST - List the current minimum/maximum displacement, stress and strain nodal values. - - STAT - Summarize the results of the last phase sweep. - - CLEAR - Clear phase-sweep information from the database. - - option - If TYPE = DISP, STRAIN, STRESS or ALL, controls the sweep angle - increment to use in the search: - - Angle - The sweep angle increment in degrees, greater than 0.1 and less than 10. The - default is 1. - - Notes - ----- - When you expand the results of a modal cyclic symmetry analysis (via - the /CYCEXPAND or EXPAND command), ANSYS combines the real and - imaginary results for a given nodal diameter, assuming no phase shift - between them; however, the modal response can occur at any phase shift. - - CYCPHASE response results are valid only for the first cyclic sector. - To obtain the response at any part of the expanded model, ANSYS, Inc. - recommends using cyclic symmetry results expansion at the phase angle - obtained via CYCPHASE. - - The phase angles returned by CYCPHASE contain the minimum and maximum - values for USUM, SEQV and other scalar principal stress and strain - quantities; however, they do not always return the true minimum and - maximum values for directional quantities like UX or SX unless the - values fall in the first sector. - - CYCPHASE does not consider midside node values when evaluating maximum - and minimum values, which may affect DISPLAY quantities but no others. - (Typically, ANSYS ignores midside node stresses and strains during - postprocessing.) - - Issuing CYCPHASE,PUT clears the result values for midside nodes on high - order elements; therefore, this option sets element faceting (/EFACET) - to 1. The command reports that midside nodal values are set to zero and - indicates that element faceting is set to 1. - - If the sweep values are available after issuing a CYCPHASE,PUT command, - the PRNSOL or PLNSOL command will print or plot (respectively) the - sweep values of structure displacement Ux, Uy, Uz, component - stress/strain X, Y, Z, XY, YZ, ZX, principal stress/strain 1, 2, 3 and - equivalent stress/strain EQV. The vector sum of displacement (USUM) - and stress/strain intensity (SINT) are not valid phase-sweep results. - - You can specify any coordinate system via the RSYS command for - displaying or printing CYCPHASE results. However, after CYCPHASE - results have been extracted, you cannot then transform them via the - RSYS command. If you try to do so, ANSYS issues a warning message. - - The CYCPHASE command is valid in /POST1 and for cyclically symmetric - models only. - - To learn more about analyzing a cyclically symmetric structure, see the - Cyclic Symmetry Analysis Guide. - """ - command = f"CYCPHASE,{type_},{option}" - return self.run(command, **kwargs) - - def cycspec(self, label="", node="", item="", comp="", **kwargs): - """Defines the set of result items for a subsequent CYCCALC command in - - APDL Command: CYCSPEC - postprocessing a cyclic harmonic mode-superposition analysis. - - Parameters - ---------- - label - One of the following labels: - - ADD - Adds a new specification to the set (default). The maximum number of - specifications that can be defined is 50. - - LIST - Lists the current set of specifications. Node, Item, Comp are ignored. - - ERASE - Erases the current set of specifications. Node, Item, Comp are ignored. - - DELETE - Deletes an existing specification. Item, Comp are ignored. - - node - The node at which to evaluate the results. If Node is a nodal - component, then all nodes in the component are included. All - sectors containing this node (or set of nodes) are evaluated. - - item - Specifies the type of values to evaluate: - - U - Displacement - - S - Stress - - EPEL - Elastic strain - - comp - Specifies the specific component of displacement, stress, or strain - to evaluate: - - X,Y,Z - Direct components - - XY,YZ,XZ - Shear components (stress and strain only) - - 1,2,3 - Principal values (stress and strain only) - - EQV - Equivalent value (stress and strain only) - - SUM - Vector sum (displacement only) - - NORM - L2 norm for the set of nodes (displacement only) - - Notes - ----- - Up to 50 specifications can be defined for use in a subsequent CYCCALC - command. If more than 50 specifications are desired, erase the table - after the CYCCALC operation and add new specifications and repeat the - CYCCALC command. All the specified nodes, items, and components are - evaluated for all sectors and the maximum amplitude value output. For - combined stresses and strains (Comp = 1,2,3 or EQV) or displacement - vector sum (Comp = SUM), a 360 degree phase sweep is performed at each - location to determine the maximum. - - Additional POST1 controls are used to refine the specification. For - component values, components are in the RSYS direction. For shell - elements, the results are at the SHELL location. For EPEL,EQV, the - results are based on the EFFNU value on the AVPRIN command. The - controls active when the CYCCALC command is issued determine the result - values. If results at another SHELL location are desired, issue the new - SHELL command and then re-issue the CYCCALC command. - - If a single node is input, the Item/Comp value at that location in each - sector is output. If a node component is given, then the maximum - Item/Comp value within the set of nodes of each sector is output, one - value for each sector (the node of the maximum may vary from sector to - sector). For stress and strain items, only corner nodes are valid. - - For the displacement norm option (Item = U, Comp = NORM), the L2 norm - computed from all the nodes in the component is output, one per sector. - """ - command = f"CYCSPEC,{label},{node},{item},{comp}" - return self.run(command, **kwargs) - - def exoption(self, ldtype="", option="", value="", **kwargs): - """Specifies the EXPROFILE options for the Mechanical APDL to ANSYS CFX profile file transfer. - - APDL Command: EXOPTION - - Parameters - ---------- - ldtype - Load type: - - * ``"SURF"`` : Surface load - - * ``"VOLU"`` : Volume load - - option - Surface options: - - * ``"Precision"`` : Number of significant digits for the - fractional part of real data - - * ``"Connectivity"`` : Key to include face connectivity in the - exported profile file - - * ``"Precision"`` : Number of significant digits after the - decimal for real data - - value - Specify the value for either Precision or Connectivity. - - For Precision, specify the number of significant digits. Can - be any value between 1 to 20, default 8. When 0 or an invalid - value is specified, the program will use the default value of - 8 and issue a warning message. - - For Connectivity, specify the key to include the element face - connectivity data for surface loads (does not support volume - loads): - - * ``"OFF"`` : Do not include the connectivity data in the exported file (default) - - * ``"ON"`` : Include the connectivity data in the exported file - - Notes - ----- - This command is not supported in Distributed ANSYS. - """ - return self.run(f"EXOPTION,{ldtype},{option},{value}", **kwargs) - - def expand(self, nrepeat="", hindex="", icsys="", sctang="", phase="", **kwargs): - """Displays the results of a modal cyclic symmetry analysis. - - APDL Command: EXPAND - - Parameters - ---------- - nrepeat - Number of sector repetitions for expansion. The default is 0 (no - expansion). - - modal - Specifies that the expansion is for a modal cyclic symmetry - analysis. - - hindex - The harmonic index ID for the results to expand. - - icsys - The coordinate system number used in the modal cyclic symmetry - solution. The default is the global cylindrical coordinate system - (specified via the CSYS command where KCN = 1). - - sctang - The sector angle in degrees, equal to 360 divided by the number of - cyclic sectors. - - -- - This field is reserved for future use. - - phase - The phase angle in degrees to use for the expansion. The default is - 0. Typically, the value is the peak displacement (or stress/strain) - phase angle obtained via the CYCPHASE command. - - Notes - ----- - Issue this command to display the results of a modal cyclic symmetry - analysis. - - When you issue the EXPAND,Nrepeat command, subsequent SET commands read - data from the results file and expand them to Nrepeat sectors. As long - as no entities have been modified, this expansion can be negated (that - is, reverted to single sector) by issuing EXPAND with no arguments. If - you modify entities and wish to return to the partial model, use the - Session Editor (see Restoring Database Contents in the Operations - Guide). - - EXPAND displays the results and allows you to print them, as if for a - full model. The harmonic index (automatically retrieved from the - results file) appears in the legend column. - - When plotting or printing element strain energy (SENE), the EXPAND - command works with brick or tet models only. Element kinetic energy - (KENE) plotting or printing is not supported. - - EXPAND is a specification command valid only in POST1. It is - significantly different from the /CYCEXPAND command in several - respects, (although you can use either command to display the results - of a modal cyclic symmetry analysis): - - EXPAND has none of the limitations of the /CYCEXPAND command. - - EXPAND changes the database by modifying the geometry, the nodal - displacements, and element stresses as they are read from the results - file, whereas the /CYCEXPAND command does not change the database. - - Caution:: : The EXPAND command creates new nodes and elements; - therefore, saving (or issuing the /EXIT, ALL command) after issuing the - EXPAND command can result in large databases. - - Distributed ANSYS Restriction: This command is not supported in - Distributed ANSYS. - """ - command = f"EXPAND,{nrepeat},{hindex},{icsys},{sctang},{phase}" - return self.run(command, **kwargs) - - def exprofile( - self, - ldtype="", - load="", - value="", - pname="", - fname="", - fext="", - fdir="", - **kwargs, - ): - """Exports interface loads or loads on selected nodes to an ANSYS CFX - - APDL Command: EXPROFILE - Profile file. - - Parameters - ---------- - ldtype - Load type: - - SURF - Surface load. - - VOLU - Volumetric load. - - load - Surface loads: - - DISP - Displacement (in a static analysis) or mode shape and global parameters (in a - modal analysis). - - MODE - Normalized mode shape and global parameters (in a modal analysis only). - - TEMP - Temperature. - - HFLU - Heat flux. - - value - If a positive integer, specifies the number of the surface or - volume interface. If 0 (zero), the selected nodes or Named - Selection are used. - - pname - Field name in CFX Profile file (32-character maximum). Defaults to - jobname_bcploadnumber for a surface load and jobname_subdloadnumber - for volumetric load. - - fname - The CFX Profile filename (248-character maximum). Defaults to - jobname_bcploadnumber for a surface load and jobname_subdloadnumber - for a volumetric load. - - fext - The Profile file extension (8-character maximum). Defaults to.csv. - - fdir - The Profile file directory (8-character maximum). Defaults to - current directory. - - Notes - ----- - By default, the EXPROFILE command assumes the data it writes to the - Profile file are in SI units. For models not described in SI units, - issue the EXUNIT command as needed to write the correct unit labels on - the Profile file. - - For a modal analysis, if Load = DISP or MODE, global parameters - including mass, frequency, and maximum displacement are also written to - the ANSYS CFX Profile file. You should therefore issue the EXUNIT - command for DISP, TIME, and MASS. - - Verify that the coordinate system is set to the global Cartesian - (RSYS,0) before using this command. - - To transfer multiple loads across an interface, specify a unique file - name and extension for each load. - - Force (FORC) and heat generation (HGEN) are per-unit volume. - - For modal analysis, this command does not support the following mode- - extraction methods (MODOPT): unsymmetric matrix (UNSYM), the damped - system (DAMP), or the QR-damped system (QRDAMP). - - To write the normalized (instead of non-normalized) mode shapes from a - modal analysis to the file: - - Use Load = MODE. - - Verify that the mode shapes are normalized to the mass matrix - (MODOPT,,,,,,OFF), the default behavior. - - Verify that the scale factor is set to 1.0 (SET,,,1.0), the default - value. - - For loads not specified directly via commands (such as SF and BF), - loads must first be read into the database (SET or LCASE). - - Distributed ANSYS Restriction: This command is not supported in - Distributed ANSYS. - """ - command = f"EXPROFILE,{ldtype},{load},{value},{pname},{fname},{fext},{fdir}" - return self.run(command, **kwargs) - - def exunit(self, ldtype="", load="", untype="", name="", **kwargs): - """Specifies the interface load unit labels to be written to the export - - APDL Command: EXUNIT - file for ANSYS to CFX transfer. - - Parameters - ---------- - ldtype - Load type: - - SURF - Surface load. - - VOLU - Volumetric load. - - load - Surface loads: - - DISP - Displacement in a static analysis. Mode shape in a modal analysis. - - TIME - Time. The unit for frequency is the inverse of the unit for time. - - MASS - Mass. - - TEMP - Temperature. - - HFLU - Heat flux. - - untype - Unit type: - - COMM - Predefined unit - - USER - User-specified unit - - name - Commonly used predefined unit name or user-specified unit name. - - SI - International System of units (meter-kilogram-second) (default) - - FT - English System of units (feet-pound-second) - - Notes - ----- - This command only specifies which unit labels are to be written to the - file when the EXPROFILE is issued. It does not perform unit - conversions. - - Distributed ANSYS Restriction: This command is not supported in - Distributed ANSYS. - """ - command = f"EXUNIT,{ldtype},{load},{untype},{name}" - return self.run(command, **kwargs) - - def fssparm(self, port1="", port2="", **kwargs): - """Calculates reflection and transmission properties of a frequency - - APDL Command: FSSPARM - selective surface. - - Parameters - ---------- - port1 - Port number of input port. Defaults to 1. - - port2 - Port number of output port. Defaults to 1. - - Notes - ----- - FSSPARM calculates reflection and transmission coefficients, power - reflection and transmission coefficients, and return and insertion - losses of a frequency selective surface. - """ - command = f"FSSPARM,{port1},{port2}" - return self.run(command, **kwargs) - - def fsum(self, lab="", item="", **kwargs): - """Sums the nodal force and moment contributions of elements. - - APDL Command: FSUM - - Parameters - ---------- - lab - Coordinate system in which to perform summation. - - (blank) - Sum all nodal forces in global Cartesian coordinate system (default). - - RSYS - Sum all nodal forces in the currently active RSYS coordinate system. - - item - Selected set of nodes. - - (blank) - Sum all nodal forces for all selected nodes (default), excluding contact - elements. - - CONT - Sum all nodal forces for contact nodes only. - - BOTH - Sum all nodal forces for all selected nodes, including contact elements. - - Notes - ----- - Sums and prints, in each component direction for the total selected - node set, the nodal force and moment contributions of the selected - elements attached to the node set. Selecting a subset of nodes [NSEL] - and then issuing this command will give the total force acting on that - set of nodes (default), excluding surface-to-surface, node-to-surface, - line-to-line, and line-to-surface contact elements (TARGE169, TARGE170, - CONTA171, CONTA172, CONTA173, CONTA174, CONTA175, CONTA176, and - CONTA177). - - Setting ITEM = CONT sums the nodal forces and moment contributions of - the selected contact elements (CONTA171, CONTA172, CONTA173, CONTA174, - CONTA175, CONTA176, and CONTA177). Setting ITEM = BOTH sums the nodal - forces for all selected nodes, including contact elements. - - Nodal forces associated with surface loads are not included. The - effects of nodal coupling and constraint equations are ignored. Moment - summations are about the global origin unless another point is - specified with the SPOINT command. This vector sum is printed in the - global Cartesian system unless it is transformed [RSYS] and a point is - specified with the SPOINT command. By default, the sum is done in - global Cartesian, and the resulting vector is transformed to the - requested system. - - The LAB = RSYS option transforms each of the nodal forces into the - active coordinate system before summing and printing. The FORCE command - can be used to specify which component (static, damping, inertia, or - total) of the nodal load is to be used. This command output is included - in the NFORCE command. - - The command should not be used with axisymmetric elements because it - might calculate a moment where none exists. Consider, for example, the - axial load on a pipe modeled with an axisymmetric shell element. The - reaction force on the end of the pipe is the total force (for the full - 360 degrees) at that location. The net moment about the centerline of - the pipe would be zero, but the program would incorrectly calculate a - moment at the end of the element as the force multiplied by the radius. - - The command is not valid for elements that operate solely within the - nodal coordinate system with 1-D option activated and rotated nodes - (NROTAT). - """ - command = f"FSUM,{lab},{item}" - return self.run(command, **kwargs) - - def hfang(self, lab="", phi1="", phi2="", theta1="", theta2="", **kwargs): - """Defines or displays spatial angles of a spherical radiation surface for - - APDL Command: HFANG - sound radiation parameter calculations. - - Parameters - ---------- - lab - Spatial angle label. - - ANGLE - Define spatial angles (default). - - STATE - Display spatial angles. PHI1, PHI2, THETA1, and THETA2 are ignored. - - phi1, phi2 - Starting and ending ϕ angles (degrees) in the spherical coordinate - system. Defaults to 0. - - theta1, theta2 - Starting and ending θ angles (degrees) in the spherical coordinate - system. Defaults to 0. - - Notes - ----- - Defines or displays spatial angles of a spherical radiation surface. - - Use this command only with PLFAR,Lab = PRES, or PRFAR,Lab = PRES. - """ - command = f"HFANG,{lab},{phi1},{phi2},{theta1},{theta2}" - return self.run(command, **kwargs) - - def hfsym(self, kcn="", xkey="", ykey="", zkey="", **kwargs): - """Indicates the presence of symmetry planes for the computation of - - APDL Command: HFSYM - acoustic fields in the near and far field domains (beyond the finite - element region). - - Parameters - ---------- - kcn - Coordinate system reference number. KCN may be 0 (Cartesian), or - any previously defined local Cartesian coordinate system number - (>10). Defaults to 0. - - xkey - Key for acoustic field boundary condition, as prescribed for the - solution, corresponding to the x = constant plane: - - None - No sound soft or sound hard boundary conditions (default). - - SSB - Sound soft boundary (pressure = 0). - - SHB - Sound hard boundary (normal velocity = 0). - - ykey - Key for acoustic field boundary condition, as prescribed for the - solution, corresponding to the y = constant plane: - - None - No sound soft or sound hard boundary conditions (default). - - SSB - Sound soft boundary (pressure = 0). - - SHB - Sound hard boundary (normal velocity = 0). - - zkey - Key for acoustic field boundary condition, as prescribed for the - solution, corresponding to the z = constant plane: - - None - No sound soft or sound hard boundary conditions (default). - - SSB - Sound soft boundary (pressure = 0). - - SHB - Sound hard boundary (normal velocity = 0). - - Notes - ----- - HFSYM uses the image principle to indicate symmetry planes (x, y, or z - = constant plane) for acoustic field computations outside the modeled - domain. A sound hard boundary condition must be indicated even though - it occurs as a natural boundary condition. - - No menu paths are available for acoustic applications. - """ - command = f"HFSYM,{kcn},{xkey},{ykey},{zkey}" - return self.run(command, **kwargs) - - def intsrf(self, lab="", **kwargs): - """Integrates nodal results on an exterior surface. - - APDL Command: INTSRF - - Parameters - ---------- - lab - Label indicating degree of freedom to be integrated: - - PRES - Pressure. - - TAUW - Wall shear stress. - - FLOW - Both pressure and wall shear stress. - - Notes - ----- - Integrates nodal results on a surface. Use node selection (such as the - EXT option of the NSEL command) to indicate the surface(s) of element - faces to be used in the integration. A surface can be "created" by - unselecting elements (such as unselecting non-fluid elements that are - adjacent to fluid elements for the postprocessing of fluid flow - result). Element faces attached to the selected nodes will be - automatically determined. All nodes on a face must be selected for the - face to be used. The integration results will cancel for nodes on - common faces of adjacent selected elements. - - Integration results are in the active coordinate system (see the RSYS - command). The type of results coordinate system must match the type - used in the analysis. However, you may translate and rotate forces and - moments as needed. Use the ``*GET`` command (Utility Menu> Parameters> Get - Scalar Data) to retrieve the results. - """ - command = f"INTSRF,{lab}" - return self.run(command, **kwargs) - - def kcalc(self, kplan="", mat="", kcsym="", klocpr="", **kwargs): - """Calculates stress intensity factors in fracture mechanics analyses. - - APDL Command: KCALC - - Parameters - ---------- - kplan - Key to indicate stress state for calculation of stress intensity - factors: - - 0 - Plane strain and axisymmetric condition (default). - - 1 - Plane stress condition. - - mat - Material number used in the extrapolation (defaults to 1). - - kcsym - Symmetry key: - - 0 or 1 - Half-crack model with symmetry boundary conditions [DSYM] in the crack-tip - coordinate system. KII = KIII = 0. Three nodes are - required on the path. - - 2 - Like 1 except with antisymmetric boundary conditions (KI = 0). - - 3 - Full-crack model (both faces). Five nodes are required on the path (one at the - tip and two on each face). - - klocpr - Local displacements print key: - - 0 - Do not print local crack-tip displacements. - - 1 - Print local displacements used in the extrapolation technique. - - Notes - ----- - Calculates the stress intensity factors (KI, KII, and KIII) associated - with homogeneous isotropic linear elastic fracture mechanics. A - displacement extrapolation method is used in the calculation (see POST1 - - Crack Analysis in the Mechanical APDL Theory Reference). This method - assumes that the displacement calculations are for the plane strain - state. If the displacement calculations are performed using a plane - stress formulation, the calculation of the stress intensity factors can - be converted to the plane strain state by using KPLAN = 1. ANSYS Uses - minor Poisson's ratio (MP,NUXY) for the stress intensity factor - calculation, therefore the material's Poisson's ratio must be defined - using MP,NUXY command. The PATH and PPATH commands must be used to - define a path with the crack face nodes (NODE1 at the crack tip, NODE2 - and NODE3 on one face, NODE4 and NODE5 on the other (optional) face). - A crack-tip coordinate system, having x parallel to the crack face (and - perpendicular to the crack front) and y perpendicular to the crack - face, must be the active RSYS and CSYS before KCALC is issued. - """ - command = f"KCALC,{kplan},{mat},{kcsym},{klocpr}" - return self.run(command, **kwargs) - - def nforce(self, item="", **kwargs): - """Sums the nodal forces and moments of elements attached to nodes. - - APDL Command: NFORCE - - Parameters - ---------- - item - Specifies the selected set of nodes for summing forces and moments - for contact elements. - - (blank) - Sums the nodal forces of elements for all selected nodes and excludes contact - elements (elements 169-177). - - CONT - Sums the nodal forces of elements for contact nodes only. - - BOTH - Sums the nodal forces of elements for all selected nodes, including contact - elements. - - Notes - ----- - Sums and prints, in each component direction for each selected node, - the nodal force and moment contributions of the selected elements - attached to the node. If all elements are selected, the sums are - usually zero except where constraints or loads are applied. The nodal - forces and moments may be displayed [/PBC,FORC and /PBC,MOME]. Use - PRESOL to print nodal forces and moments on an element-by-element - basis. You can use the FORCE command to specify which component - (static, damping, inertia, or total) of the nodal load is to be used. - Nodal forces associated with surface loads are not included. - - This vector sum is printed in the global Cartesian system. Moment - summations are about the global origin unless another point is - specified with the SPOINT command. The summations for each node are - printed in the global Cartesian system unless transformed [RSYS]. This - command is generally not applicable to axisymmetric models because - moment information from the NFORCE command is not correct for - axisymmetric elements. - - Selecting a subset of elements [ESEL] and then issuing this command - will give the forces and moments required to maintain equilibrium of - that set of elements. The effects of nodal coupling and constraint - equations are ignored. The option ITEM = CONT provides the forces and - moments for the contact elements (CONTA171, CONTA172, CONTA173, - CONTA174, CONTA175, CONTA176, and CONTA177). Setting ITEM = BOTH - provides the forces and moments for all selected nodes, including - contact elements. - - This command also includes the FSUM command function which vectorially - sums and prints, in each component direction for the total selected - node set, the nodal force and moment contributions of the selected - elements attached to the selected node set. - """ - command = f"NFORCE,{item}" - return self.run(command, **kwargs) - - def nldpost(self, label="", key="", fileid="", prefix="", **kwargs): - """Gets element component information from nonlinear diagnostic files. - - APDL Command: NLDPOST - - Parameters - ---------- - label - Specifies the type of command operation: - - EFLG - Element flag for nonlinear diagnostics. - - NRRE - Newton-Raphson residuals. - - key - Specifies the command action: - - STAT - List information about the diagnostic files (Jobname.ndxxx or Jobname.nrxxx) in - the current directory. - - For Label = EFLG, the listing gives a summary that associates the loadstep, substep, time, equilibrium iteration number, cumulative iteration number, and the number of elements that fail each criteria with a specific file ID (Jobname.ndxxx). Use the list to create element components (via the CM option) based on the cumulative iteration number. - For Label = NRRE, the listing provides a summary that associates the loadstep, - substep, time, equilibrium iteration number, and - cumulative iteration number with a specific file - ID (Jobname.nrxxx). Use the list to identify the - respective file ID for creating Newton-Raphson - residual contour plots (PLNSOL,NRRE,…,FileID). - - DEL - Delete Jobname.ndxxx or Jobname.nrxxx files in the working directory, if any - exist. - - CM - Create components for elements that violate criteria. This value is valid only - when Label = EFLG. - - fileid - Valid only when Label = EFLG and Key = CM, this value specifies - file IDs: - - IDnum - The file ID number. Creates the element components from the diagnostic files - corresponding to the specified file ID number in the - working directory. - - ALL - Creates element components from all available diagnostic files residing in the - working directory. This value is the default if you do not - specify an IDnum value. - - prefix - Sets the prefix name for components. Specify up to 21 alphanumeric - characters. - - Notes - ----- - Based on the nonlinear diagnostic results (created via the NLDIAG,EFLG - command), the NLDPOST command creates element components with - predefined names. - - The following table lists the diagnostic criteria and component names - (with specified prefix and without). Here xxx corresponds to the file - ID (FileID) of Jobname.ndxxx or Jobname.nrxxx. - - If you have trouble viewing specific element components, see Viewing - Hidden Element Components in the Basic Analysis Guide. - - For more information, see Performing Nonlinear Diagnostics. - """ - command = f"NLDPOST,{label},{key},{fileid},{prefix}" - return self.run(command, **kwargs) - - def plcamp( - self, - option="", - slope="", - unit="", - freqb="", - cname="", - stabval="", - keyallfreq="", - keynegfreq="", - **kwargs, - ): - """Plots Campbell diagram data for applications involving rotating - - APDL Command: PLCAMP - structure dynamics. - - Parameters - ---------- - option - Flag to activate or deactivate sorting of forward or backward whirl - frequencies: - - 0 (OFF or NO) - No sorting. - - 1 (ON or YES) - Sort. This value is the default. - - 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 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. - - RPM - Rotational angular velocities in revolutions per minute (RPMs). - - freqb - The beginning, or lower end, of the frequency range of interest. - The default is zero. - - cname - The rotating component name. - - stabval - Flag to plot the stability values: - - 0 (OFF or NO) - Plot the frequencies (the imaginary parts of the eigenvalues in Hz). This value - is the default. - - 1 (ON or YES) - Plot the stability values (the real parts of the eigenvalues in Hz). - - 2 - Plot the logarithmic decrements. - - keyallfreq - Key to specify if all frequencies above FREQB are plotted: - - 0 (OFF or NO) - A maximum of 10 frequencies are plotted. This value is the default. - - 1 (ON or YES) - All frequencies are plotted. - - keynegfreq - Key to specify if the negative frequencies are plotted. It only - applies to solutions obtained with the damped eigensolver (Method = - DAMP on the MODOPT command): - - 0 (OFF or NO) - Only positive frequencies are plotted. This value is the default. - - 1 (ON or YES) - Negative and positive frequencies are plotted. - - Notes - ----- - The following items are required when generating a Campbell diagram: - - Take the gyroscopic effect into account by issuing the CORIOLIS command - in the SOLUTION module. - - Run a modal analysis using the QR damped (MODOPT,QRDAMP) or damped - (MODOPT,DAMP) method. Complex eigenmodes are necessary - (MODOPT,QRDAMP,,,,Cpxmod = ON), and you must specify the number of - modes to expand (MXPAND). - - Define two or more load step results with an ascending order of - rotational velocity (OMEGA or CMOMEGA). - - In some cases where modes are not in the same order from one load step - to the other, sorting the frequencies (Option = 1) can help to obtain a - correct plot. Sorting is based on the comparison between complex mode - shapes calculated at two successive load steps. - - At each load step, the application compares the mode shape to the loads - at other load steps to determine whirl direction at the load step. If - applicable, a label appears (in the plot legend) representing each - whirl mode (BW for backward whirl and FW for forward whirl). - - At each load step, the program checks for instability (based on the - sign of the real part of the eigenvalue). The labels "stable" or - "unstable" appear in the plot legend for each frequency curve. - - The rotational velocities of a named component (Cname) are displayed on - the X-axis. - - For information on plotting a Campbell diagram for a prestressed - structure, see Solving for a Subsequent Campbell Analysis of a - Prestressed Structure Using the Linear Perturbation Procedure in the - Rotordynamic Analysis Guide. - - In general, plotting a Campbell diagram is recommended only when your - analysis is performed in a stationary reference frame - (CORIOLIS,,,,RefFrame = ON). - - For a usage example of the PLCAMP command, see Campbell Diagram in the - Rotordynamic Analysis Guide. - - Distributed ANSYS Restriction: This command is not supported in - Distributed ANSYS. - """ - command = f"PLCAMP,{option},{slope},{unit},{freqb},{cname},{stabval},{keyallfreq},{keynegfreq}" - return self.run(command, **kwargs) - - def plcfreq(self, spec="", sectbeg="", sectend="", **kwargs): - """Plots the frequency response for the given CYCSPEC specification. - - APDL Command: PLCFREQ - - Parameters - ---------- - spec - CYCSPEC specification number (ordered 1 to N in the order input; - use CYCSPEC,LIST to view the current list order). Defaults to 1. - - sectbeg - Beginning sector number to plot. Defaults to 1. - - sectend - Ending sector number to plot. Defaults to the total number of - sectors expanded (/CYCEXPAND). - - Notes - ----- - Following a cyclic mode-superposition harmonic analysis, this command - plots the result item given by a CYCSPEC specification versus the - harmonic frequency, one curve for each of the specified sectors. A - CYCCALC command must have been issued prior to this command. - """ - command = f"PLCFREQ,{spec},{sectbeg},{sectend}" - return self.run(command, **kwargs) - - def plchist(self, spec="", freqpt="", **kwargs): - """Plots a histogram of the frequency response of each sector for the - - APDL Command: PLCHIST - given CYCSPEC specification. - - Parameters - ---------- - spec - CYCSPEC specification number (ordered 1 to N in the order input; - use CYCSPEC,LIST to view the current list order). Defaults to 1. - - freqpt - Harmonic frequency point to plot (the data set number NSET or - CUMULATIVE on SET,LIST). Defaults to the current SET frequency. - - Notes - ----- - Following a cyclic mode-superposition harmonic analysis, this command - creates a histogram plot of the result item given by a CYCSPEC - specification versus the sector number. A CYCCALC command must have - been issued prior to this command. - """ - command = f"PLCHIST,{spec},{freqpt}" - return self.run(command, **kwargs) - - def plfar( - self, - lab="", - option="", - phi1="", - phi2="", - nph1="", - theta1="", - theta2="", - ntheta="", - val1="", - val2="", - val3="", - **kwargs, - ): - """Plots pressure far fields and far field parameters. - - APDL Command: PLFAR - - Parameters - ---------- - lab - Parameters to plot : - - PRES - Acoustic parameters - - PROT - Acoustic parameters with the y-axis rotated extrusion - - option - Plot option, based on the specified plot parameter type: - - phi1, phi2 - Starting and ending φ angles (degrees) in the spherical coordinate - system. Defaults to 0. - - nphi - Number of divisions between the starting and ending φ angles for - data computations. Defaults to 0. - - theta1, theta2 - Starting and ending θ angles (degrees) in the spherical coordinate - system. Defaults to 0 in 3-D and 90 in 2-D. - - ntheta - Number of divisions between the starting and ending θ angles for - data computations. Defaults to 0. - - val1 - Radius of the sphere surface. Used only when Option = SUMC, SUMP, - PHSC, PHSP, SPLC, SPLP, SPAC, SPAP, PSCT, PSPL, TSCT, or TSPL. - - val2 - When Option = SPLC, SPLP, SPAC, or SPAP: Reference rms sound - pressure. Defaults to 2x10-5 Pa. - - val3 - When Lab = PRES: Thickness of 2-D model extrusion in the z - direction (no default). - - Notes - ----- - The PLFAR command plots pressure far fields and far field parameters as - determined by the equivalent source principle. Use this command to plot - pressure and acoustic parameters. See the HFSYM command for the - model symmetry and the HFANG command for spatial radiation angles. - - When Option = PWL no plot is generated, but the sound power level - appears in the output. - - To retrieve saved equivalent source data, issue the - SET,Lstep,Sbstep,,REAL command. - - Distributed ANSYS Restriction: This command is not supported in - Distributed ANSYS. - """ - command = f"PLFAR,{lab},{option},{phi1},{phi2},{nph1},{theta1},{theta2},{ntheta},{val1},{val2},{val3}" - return self.run(command, **kwargs) - - def plmc( - self, - lstep="", - sbstep="", - timfrq="", - kimg="", - hibeg="", - hiend="", - **kwargs, - ): - """Plots the modal coordinates from a mode-superposition solution. - - APDL Command: PLMC - - Parameters - ---------- - lstep, sbstep - Plot the solution identified as load step LSTEP and substep SBSTEP - - timfrq - As an alternative to LSTEP and SBSTEP, plot the solution at the - time value TIMFRQ (for ANTYPE,TRANS) or frequency value TIMFRQ (for - ANTYPE,HARMIC). LSTEP and SBSTEP should be left blank. - - kimg - If 0 (or blank), plot the real solution. If 1, plot the imaginary - solution. Only valid for ANTYPE,HARMIC. - - hibeg, hiend - For cyclic symmetry solutions, plot the solutions in the harmonic - index solution range HIbeg to HIend. Defaults to all harmonic - indices (all modes). - - Notes - ----- - PLMC plots a histogram of the modal coordinates (the response - amplitudes applied to each mode shape) at a certain time point - (transient analyses) or frequency point (harmonic analyses). The - absolute values of the modal coordinates are plotted. Use /XRANGE to - plot only modes in a certain range, if desired. - - For transient analyses, the Jobname.RDSP file must be available. For - harmonic analyses, the Jobname.RFRQ must be available. No SET command - is required and no expansion pass is required. - - For a cyclic harmonic mode-superposition analysis, use the CYCFILES - command to identify the Jobname.RFRQ and modal Jobname.RST file. You - may limit the plot to display only those modes in a certain harmonic - index range. The modes having the same harmonic index are each plotted - in a unique color. If there are less than 10 harmonic indices, they are - identified in the graphics legend. - - This is a graphical representation of the optional Jobname.MCF text - file. (see the TRNOPT and HROPT commands). For more information on - modal coordinates, see Mode-Superposition Method in the Mechanical APDL - Theory Reference. - """ - command = f"PLMC,{lstep},{sbstep},{timfrq},{kimg},{hibeg},{hiend}" - return self.run(command, **kwargs) - - def plnear( - self, - lab="", - opt="", - kcn="", - val1="", - val2="", - val3="", - val4="", - val5="", - val6="", - val7="", - val8="", - val9="", - **kwargs, - ): - """Plots the pressure in the near zone exterior to the equivalent source - - APDL Command: PLNEAR - surface. - - Parameters - ---------- - lab - Plot the maximum pressure or sound pressure level: - - SPHERE - on the spherical structure - - PATH - along the path - - opt - PSUM - - PSUM - Maximum complex pressure for acoustics. - - PHAS - Phase angle of complex pressure for acoustics. - - SPL - Sound pressure level for acoustics. - - SPLA - A-weighted sound pressure level for acoustics (dBA). - - kcn - KCN is the coordinate system reference number. It may be 0 - (Cartesian) or any previously defined local coordinate system - number (>10). Defaults to 0. - - val1, val2, val3, . . . , val9 - For LAB = SPHERE: - - VAL1 - Radius of spherical surface in spherical coordinate system. - - VAL2 - Starting φ angle (degree) in the spherical coordinate system. Defaults to 0. - - VAL3 - Ending φ angle (degree) in the spherical coordinate system. Defaults to 0. - - VAL4 - Number of divisions between the starting and ending φ angles for data - computations. Defaults to 0. - - VAL5 - Starting θ angle (degrees) in the spherical coordinate system. Defaults to 0 in - 3-D and 90 in 2-D extension. - - VAL6 - Ending θ angle (degrees) in the spherical coordinate system. Defaults to 0 in - 3-D and 90 in 2-D extension. - - VAL7 - Number of divisions between the starting and ending θ angles for data - computations. Defaults to 0. - - VAL8 - Reference rms sound pressure. Defaults to 2x10-5 Pa. - - VAL9 - Thickness of 2-D model extension in z direction (defaults to 0). - - Notes - ----- - PLNEAR uses the equivalent source principle to calculate the pressure - in the near zone exterior to the equivalent source surface (flagged - with the Maxwell surface flag in the preprocessor) for one of the - following locations: - - A spherical surface in the KCN coordinate system - - A path defined by the PATH and PPATH commands - - To plot the pressure results for a path, use the PLPAGM or PLPATH - commands. See the HFSYM command for the model symmetry. - - To retrieve saved equivalent source data, issue the - SET,Lstep,Sbstep,,REAL command. - - Distributed ANSYS Restriction: This command is not supported in - Distributed ANSYS. - """ - command = f"PLNEAR,{lab},{opt},{kcn},{val1},{val2},{val3},{val4},{val5},{val6},{val7},{val8},{val9}" - return self.run(command, **kwargs) - - def plzz(self, rotvel="", deltarotvel="", **kwargs): - """Plots the interference diagram from a cyclic modal analysis. - - APDL Command: PLZZ - - Parameters - ---------- - rotvel - Rotational speed in revolutions per minute (RPM) used to define the - speed line. If blank, use the rotational speed (from OMEGA) - specified in the prestressing step of the linear perturbation - analysis. If explicitly input as 0, or if the linear perturbation - was not used, no speed lines are plotted. - - deltarotvel - Adds speed lines about the RotVel speed line corresponding to - RotVel ± DeltaRotVel. Only plotted if RotVel is known. - - Notes - ----- - PLZZ plots the cyclic modal frequencies as points on a frequency vs. - harmonic index (nodal diameter) graph. If rotational speed (RotVel) is - provided, the speed line is also plotted, leading to the interference - diagram (also known as the SAFE or ZZENF diagram). If DeltaRotVel is - also provided, two additional speed lines are plotted, enveloping the - safe speed line itself. - - For more information, see Postprocessing a Modal Cyclic Symmetry - Analysis in the Cyclic Symmetry Analysis Guide. - """ - command = f"PLZZ,{rotvel},{deltarotvel}" - return self.run(command, **kwargs) - - def pras(self, quantity="", loadstep="", substep="", **kwargs): - """Calculates a specified acoustic quantity on the selected exterior - - APDL Command: PRAS - surface or the frequency-band sound pressure level (SPL). - - Parameters - ---------- - quantity - The acoustic quantity to calculate: - - SIMP - Specific acoustic impedance on the selected surface. - - AIMP - Acoustic impedance on the selected surface. - - MIMP - Mechanical impedance on the selected surface. - - PRES - Average pressure on the selected surface. - - FORC - Force on the selected surface. - - POWE - Acoustic power on the selected surface. - - BSPL - Frequency-band sound pressure level. - - BSPA - A-weighted frequency-band sound pressure level. - - loadstep - Specified load step. Default = 1. - - substep - Specified substep. Default = All substeps at the specified load - step. Not valid for Quantity = BSPL or BSPA. - - Notes - ----- - The PRAS command calculates a specified acoustic quantity on the - selected exterior surface in postprocessing. The calculation is based - on the pressure and velocity solution or the frequency-band sound - pressure level (SPL). - - The total pressure and velocity are used if the selected surface is the - excitation source surface. To calculate the incoming and outgoing - acoustic power, and other sound power parameters, on the excitation - source surface, issue the SF,,PORT and SPOWER commands. - - The sound pressure level of the octave bands and general frequency band - (defined via the HARFRQ command) is calculated at the selected nodes in - the model. - """ - command = f"PRAS,{quantity},{loadstep},{substep}" - return self.run(command, **kwargs) - - def prcamp( - self, - option="", - slope="", - unit="", - freqb="", - cname="", - stabval="", - keyallfreq="", - keynegfreq="", - keywhirl="", - **kwargs, - ): - """Prints Campbell diagram data for applications involving rotating - - APDL Command: PRCAMP - structure dynamics. - - Parameters - ---------- - option - Flag to activate or deactivate sorting of forward or backward whirl - frequencies: - - 0 (OFF or NO) - No sorting. - - 1 (ON or YES) - Sort. This value is the default. - - 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 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. - - RPM - Rotational angular velocities in revolutions per minute (RPMs). - - freqb - The beginning, or lower end, of the frequency range of interest. - The default is zero. - - cname - The rotating component name. - - 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. - - 1 (ON or YES) - Print the stability values (the real parts of the eigenvalues in Hz). - - 2 - Print the logarithmic decrements. - - 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. - - 1 (ON or YES) - All frequencies are printed out. - - keynegfreq - Key to specify if the negative frequencies are printed out. It only - applies to solutions obtained with the damped eigensolver - (Method=DAMP on the MODOPT command): - - 0 (OFF or NO) - Only positive frequencies are printed out. This value is the default. - - 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: - - Take the gyroscopic effect into account by issuing the CORIOLIS command - in the SOLUTION module. - - Run a modal analysis using the QR damped (MODOPT,QRDAMP) or damped - (MODOPT,DAMP) method. Complex eigenmodes are necessary - (MODOPT,QRDAMP,,,,Cpxmod = ON), and you must specify the number of - modes to expand (MXPAND). - - Define two or more load step results with an ascending order of - rotational velocity (OMEGA or CMOMEGA). - - In some cases where modes are not in the same order from one load step - to the other, sorting the frequencies (Option = 1) can help to obtain a - correct printout. Sorting is based on the comparison between complex - mode shapes calculated at two successive load steps. - - At each load step, the application compares the mode shape to the loads - to determine the whirl direction. If applicable, a label appears (on - the rows of output data) representing the whirl mode (BW for backward - whirl and FW for forward whirl). - - If you specify a non-zero slope (SLOPE > 0), the command prints the - critical speeds corresponding to the intersection points of the - frequency curves and the added line. In the case of a named component - (Cname), critical speeds relate to the rotational velocity of the - component. Critical speeds are available only if the frequencies are - printed (STABVAL = OFF). - - If you specify a zero slope (SLOPE = 0), the command prints the - stability threshold corresponding to the sign change of the stability - values (or logarithmic decrements). In the case of a named component - (Cname), stability thresholds relate to the rotational velocity of the - component. Stability thresholds are available only if the stability - values or logarithmic decrements are printed (STABVAL = 1 or 2). - - At each load step, the program checks for instability (based on the - sign of the real part of the eigenvalue). The label "U" appears on the - printout for each unstable frequency. - - If specified, the rotational velocities of the named component (Cname) - are printed out along with the natural frequencies. - - In general, printing a Campbell diagram is recommended only when your - analysis is performed in a stationary reference frame - (CORIOLIS,,,,RefFrame = ON). - - For information on printing a Campbell diagram for a prestressed - structure, see Solving for a Subsequent Campbell Analysis of a - Prestressed Structure Using the Linear Perturbation Procedure in the - Rotordynamic Analysis Guide. - - For a usage example of the companion command PLCAMP (used for plotting - a Campbell diagram), see Example Campbell Diagram Analysis. - - For more information on Campbell diagram generation, see Campbell - Diagram in the Rotordynamic Analysis Guide. - - Distributed ANSYS Restriction: This command is not supported in - Distributed ANSYS. - """ - command = f"PRCAMP,{option},{slope},{unit},{freqb},{cname},{stabval},{keyallfreq},{keynegfreq},{keywhirl}" - return self.run(command, **kwargs) - - def prfar( - self, - lab="", - option="", - phi1="", - phi2="", - nph1="", - theta1="", - theta2="", - ntheta="", - val1="", - val2="", - val3="", - **kwargs, - ): - """Prints pressure far fields and far field parameters. - - APDL Command: PRFAR - - Parameters - ---------- - lab - Parameters to print: - - PRES - Acoustic parameters - - PROT - Acoustic parameters with the y-axis rotated extrusion - - option - Print option, based on the specified print parameter type: - - phi1, phi2 - Starting and ending φ angles (degrees) in the spherical coordinate - system. Defaults to 0. - - nphi - Number of divisions between the starting and ending φ angles for - data computations. Defaults to 0. - - theta1, theta2 - Starting and ending θ angles (degrees) in the spherical coordinate - system. Defaults to 0 in 3-D and 90 in 2-D. - - ntheta - Number of divisions between the starting and ending θ angles for - data computations. Defaults to 0. - - val1 - Radius of the sphere surface. Used only when Option = SUMC, PHSC, - SPLC, SPAC, PSCT, or TSCT. - - val2 - When Option = SPLC or SPAC: Reference rms sound pressure. Defaults - to 2x10-5 Pa. - - val3 - When Lab = PRES: Thickness of 2-D model extrusion in the z - direction (no default). - - Notes - ----- - The PRFAR command prints pressure far fields and far field parameters - as determined by the equivalent source principle. Use this command - to print pressure and acoustic parameters. See the HFSYM command for - the model symmetry and the HFANG command for spatial radiation - angles. - - To retrieve saved equivalent source data, issue the - SET,Lstep,Sbstep,,REAL command. - - Distributed ANSYS Restriction: This command is not supported in - Distributed ANSYS. - """ - command = f"PRFAR,{lab},{option},{phi1},{phi2},{nph1},{theta1},{theta2},{ntheta},{val1},{val2},{val3}" - return self.run(command, **kwargs) - - def prnear( - self, - lab="", - opt="", - kcn="", - val1="", - val2="", - val3="", - val4="", - val5="", - val6="", - val7="", - val8="", - val9="", - **kwargs, - ): - """Prints the pressure in the near zone exterior to the equivalent source - - APDL Command: PRNEAR - surface. - - Parameters - ---------- - lab - Print the maximum pressure or sound pressure level: - - POINT - at the point (x,y,z) - - SPHERE - on the spherical structure - - PATH - along the path - - opt - PSUM - - PSUM - Maximum complex pressure for acoustics. - - PHAS - Phase angle of complex pressure for acoustics. - - SPL - Sound pressure level for acoustics. - - SPLA - A-weighted sound pressure level for acoustics (dBA). - - kcn - KCN is the coordinate system reference number. It may be 0 - (Cartesian) or any previously defined local coordinate system - number (>10). Defaults to 0. - - val1, val2, val3, . . . , val9 - For Lab = POINT: - - VAL1 - x coordinate value - - VAL2 - y coordinate value - - VAL3 - z coordinate value - - VAL4 - VAL8 - not used - - VAL9 - Thickness of model in z direction (defaults to 0). - - Notes - ----- - The command uses the equivalent source principle to calculate the - pressure in the near zone exterior to the equivalent source surface - (flagged with the Maxwell surface flag in the preprocessor) for one of - the following locations: - - A point X, Y, Z in the KCN coordinate system - - A spherical surface in the KCN coordinate system - - A path defined by the PATH and PPATH commands - - To list the pressure results for a path, use the PRPATH command. See - HFSYM command for the model symmetry. - - To retrieve saved equivalent source data, issue the - SET,Lstep,Sbstep,,REAL command. - - Distributed ANSYS Restriction: This command is not supported in - Distributed ANSYS. - """ - command = f"PRNEAR,{lab},{opt},{kcn},{val1},{val2},{val3},{val4},{val5},{val6},{val7},{val8},{val9}" - return self.run(command, **kwargs) - - def reswrite(self, fname="", cflag="", **kwargs): - """Appends results data from the database to a results file. - - APDL Command: RESWRITE - - 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. The file name extension - varies as follows: - - - .RST for structural, fluid, or coupled-field analyses - - .RTH for thermal or electrical analyses - - .RMG for magnetic analyses - - cflag - 0 - The complex results flag is set to 0 in the results - file header. This is the default option. - - 1 - The complex results flag is set to 1 in the results - file header. - - Notes - ----- - The RESWRITE command appends a data set to the specified file - by writing the results data currently in the database. If the - intended results file does not exist, it will be created and - will include the geometry records. The current load step, - substep, and time (or frequency) value are maintained. All - data (summable and nonsummable) are written. - - When complex results are appended, cFlag must be set to 1 so - that the header is consistent with the results written on the - file. - - The command is primarily intended for use in a top-down - substructuring analysis, where the full model is resumed and - the results data read from the use pass results file (SET), - and subsequently from all substructure expansion pass results - files (APPEND). The full set of data in memory can then be - written out via the RESWRITE command to create a complete - results file (as though you had run a nonsubstructured - analysis). - - The RESWRITE command can also be used to write a global - results file for a distributed parallel (Distributed ANSYS) - solution. This should only be necessary if the RESCOMBINE - command was used to combine results from local results files - into the database. The RESWRITE command can then be used to - write the combined results into a new results file. This new - results file will essentially contain the current set of - results data for the entire (i.e., global) model. - """ - - return self.run(f"RESWRITE,{fname},,,,{cflag}", **kwargs) - - def rmflvec(self, **kwargs): - """Writes eigenvectors of fluid nodes to a file for use in damping - - APDL Command: RMFLVEC - parameter extraction. - - Notes - ----- - RMFLVEC extracts the modal information from the modal results file for - all nodes specified in a node component called 'FLUN'. This component - should include all nodes which are located at the fluid-structural - interface. Mode shapes, element normal orientation, and a scaling - factor are computed and stored in a file Jobname.EFL. For damping - parameter extraction, use the DMPEXT command macro. See Introduction - for more information on thin film analyses. - - FLUID136 and FLUID138 are used to model the fluid interface. Both the - structural and fluid element types must be active. The fluid interface - nodes must be grouped into a component 'FLUN'. A results file of the - last modal analysis must be available. - - Distributed ANSYS Restriction: This command is not supported in - Distributed ANSYS. - """ - command = f"RMFLVEC," - return self.run(command, **kwargs) - - def rsplit( - self, - option="", - label="", - name1="", - name2="", - name3="", - name4="", - name5="", - name6="", - name7="", - name8="", - name9="", - name10="", - name11="", - name12="", - name13="", - name14="", - name15="", - name16="", - **kwargs, - ): - """Creates one or more results file(s) from the current results file based - - APDL Command: RSPLIT - on subsets of elements. - - Parameters - ---------- - option - Specify which results to include for the subset of elements. - - ALL - Write all nodal and element results based on the subset of elements (default). - - EXT - Write only the nodal and element results that are on the exterior surface of - the element subset. The results data will be averaged as in - PowerGraphics (see AVRES) when this results file is brought - into POST1. Only valid for solid elements. - - label - Define where the element subset is coming from. - - ALL - Use all selected element components (CMSEL) (default). - - ESEL - Use the currently selected (ESEL) set of elements. Name1 defines the results - file name. - - LIST - Use Name1 to Name16 to list the element component and/or assembly names (that - contain element components). - - name1, name2, name3, . . . , name16 - Up to 16 element component and/or assembly names (that contain - element components). - - Notes - ----- - Results files will be named based on the element component or assembly - name, e.g., Cname.rst, except for the ESEL option, for which you must - specify the results file name (no extension) using the Name1 field. - Note that the .rst filename will be written in all uppercase letters - (CNAME.rst) (unless using the ESEL option); when you read the file, you - must specify the filename using all uppercase letters (i.e., - file,CNAME). You may repeat the RSPLIT command as often as needed. All - results sets on the results file are processed. Use /AUX3 to produce a - results file with just a subset of the results sets. - - Use INRES to limit the results data written to the results files. - - The subset geometry is also written so that no database file is - required to postprocess the subset results files. You must not resume - any database when postprocessing one of these results files. The input - results file must have geometry written to it (i.e., do not use - /CONFIG,NORSTGM,1). - - Applied forces and reaction forces are not apportioned if their nodes - are shared by multiple element subsets. Their full values are written - to each results file. - - Each results file renumbers its nodes and elements starting with 1. - - This feature is useful when working with large models. For more - information on the advantages and uses of the RSPLIT command, see - Splitting Large Results Files in the Basic Analysis Guide. - """ - command = f"RSPLIT,{option},{label},{name1},{name2},{name3},{name4},{name5},{name6},{name7},{name8},{name9},{name10},{name11},{name12},{name13},{name14},{name15},{name16}" - return self.run(command, **kwargs) - - def rstmac( - self, - file1="", - lstep1="", - sbstep1="", - file2="", - lstep2="", - sbstep2="", - maclim="", - cname="", - keyprint="", - **kwargs, - ): - """APDL Command: RSTMAC - - Calculates modal assurance criterion (MAC) and matches nodal solutions - from two results files or from one results file and one universal - format file. - - Parameters - ---------- - file1 - File name (32 characters maximum) corresponding to the first - results file (.rst or .rstp file). If the file name does not - contain the extension, it defaults to .rst. - - lstep1 - Load step number of the results to be read in File1. - - N - Reads load step N. Defaults to 1. - - sbstep1 - Substep number of the results to be read in File1. - - N - Reads substep N. - - All - Reads all substeps. This value is the default. - - file2 - File name (32 characters maximum) corresponding to the second file - (.rst, .rstp, or .unv file). If the file name does not contain the - extension, it defaults to .rst. - - lstep2 - Load step number of the results to be read in File2. - - N - Reads load step N. Defaults to 1. - - sbstep2 - Substep number of the results to be read in File2. - - N - Reads substep N. - - All - Reads all substeps. This value is the default. - - maclim - Smallest acceptable MAC value. Must be 0 and 1. The default value - is 0.90. - - cname - Name of the component from the first file (File1). The component - must be based on nodes. If unspecified, all nodes are matched and - used for MAC calculations. If a component name is specified, only - nodes included in the specified component are used. Not applicable - to node mapping (TolerN=-1). - - keyprint - Printout options: - - 0 - Printout matched solutions table. This value is the default. - - 1 - Printout matched solutions table and full MAC table. - - 2 - Printout matched solutions table, full MAC table and matched nodes table. - - Notes - ----- - The RSTMAC command allows the comparison of the solutions from - either: - - Two different results files - - One result file and one universal format file - - The modal assurance criterion (MAC) is used. - - The meshes read on File1 and File2 may be different. If TolerN>0, - the nodes are matched. This is the default. If TolerN = -1, the - nodes are mapped and the solutions are interpolated from File1. - - Units and coordinate systems must be the same for both - models. When a universal format file is used, the nodal - coordinates can be scaled using UNVscale. - - The corresponding database file (.db) for File1 must be resumed - before running the command only if a component (Cname) is used or - if the nodes are mapped (TolerN = -1). - - Results may be real or complex; however, if results from File1 - have a different type from results in File2, only the real parts - of the solutions are taken into account in MAC calculations. The - analysis type can be arbitrary. - - Only structural degrees of freedom are considered. Degrees of - freedom can vary between File1 and File2, but at least one common - degree of freedom must exist. - - When node mapping and solution interpolation is performed - (TolerN=-1), File1 must correspond to a model meshed in solid - and/or shell elements. Other types of elements can be present but - the node mapping is not performed for those - elements. Interpolation is performed on UX, UY, and UZ degrees of - freedom. - - The solutions read on the results files are not all written to the - database, therefore, subsequent plotting or printing of solutions - is not possible. A SET command must be issued after the RSTMAC - command to post-process each solution. - - RSTMAC comparison on cyclic symmetry analysis works only if the - number of sectors on File1 and File2 are the same. Also comparison - cannot be made between cyclic symmetry results and full 360 degree - model results (File1 – cyclic solution, File2 – full 360 degree - model solution). Comparing cyclic symmetry solutions written on - selected set of node (OUTRES) is not supported. - - The modal assurance criterion values can be retrieved as - parameters using the ``*GET`` command (Entity = RSTMAC). - - For more information and an example, see Comparing Nodal Solutions - From Two Models (RSTMAC) in the Basic Analysis Guide. - """ - command = f"RSTMAC,{file1},{lstep1},{sbstep1},{file2},{lstep2},{sbstep2},,{maclim},{cname},{keyprint}" - return self.run(command, **kwargs) - - def spoint(self, node="", x="", y="", z="", **kwargs): - """Defines a point for moment summations. - - APDL Command: SPOINT - - Parameters - ---------- - node - Node number of the desired point. If zero, use X,Y,Z to describe - point. - - x, y, z - Global Cartesian coordinates of the desired summation point. Used - if NODE is 0. Defaults to (0,0,0). - - Notes - ----- - Defines a point (any point other than the origin) about which the - tabular moment summations are computed [NFORCE, FSUM]. If force - summations are desired in other than the global Cartesian directions, a - node number must be specified on the NODE field, and the desired - coordinate system must be activated with RSYS. - """ - command = f"SPOINT,{node},{x},{y},{z}" - return self.run(command, **kwargs) - - def spmwrite( - self, - method="", - nmode="", - inputs="", - inputlabels="", - outputs="", - outputlabels="", - nic="", - velacckey="", - fileformat="", - **kwargs, - ): - """Calculates the state-space matrices and writes them to the SPM file. - - APDL Command: SPMWRITE - - Parameters - ---------- - method - Reduction method for the calculation of the state-space matrices. - - MODAL - Method based on modal analysis results from LANB, LANPCG, SNODE, or SUBSP - eigensolver (default). - - nmode - Number of modes to be used. Defaults to all modes. - - inputs - Definition of the inputs. Defaults to all load vectors on the MODE - file. - - inputlabels - Definition of the input labels. Defaults to the load vector numbers - or input definition (node and degree of freedom array parameter), - depending on the Inputs specification. - - outputs - Definition of the outputs. Defaults to the inputs. - - outputlabels - Definition of the output labels. Defaults to the output definition - (node and degree of freedom) if used, else defaults to the - InputLabels. - - nic - Load vector on the MODE file used for the calculation of the - initial conditions. Defaults to no initial condition. - - velacckey - Output velocities and accelerations key. - - OFF - Output displacements only (default). - - ON - Output displacements, velocities and accelerations. - - fileformat - The format of the SPM file. - - 0 - Dense format. - - 1 - Matrix Market Exchange format (non-zero terms only). - - 2 - Simplorer SML format without reference (default). - - 3 - Simplorer SML format with common reference. - - 4 - Simplorer SML format with independent references. - - Notes - ----- - The SPMWRITE generates the file Jobname.SPM containing the state-space - matrices and other information. - - The following applies to the SML formats (FileFormat = 2, 3, and 4): - - For conservative systems where the outputs are equal to the inputs - (Outputs is left blank): - - The labels for the inputs (InputLabels) are required. - - The Inputs must use the array parameter option so that the input - degrees of freedom (DOFs) are known. - - For non-conservative systems where the outputs are not equal to the - inputs: - - The labels for the outputs (OutputLabels) are required. - - The file formats with references (FileFormat = 3 and 4) do not apply. - - Velocity and acceleration results are not included in the state-space - matrices calculation (VelAccKey = OFF) - - File format with common reference (FileFormat = 3) does not apply if - the inputs are based on DOFs of a different nature. All input DOFs - must be either all rotational or all translational and not a mix of the - two. - - A graphics file (Jobname_SPM.PNG) is generated. It contains an element - plot of the model. - - For more details about the reduction method and the generation of the - state-space matrices, see Reduced-Order Modeling for State-Space - Matrices Export in the Mechanical APDL Theory Reference. - - For examples of the command usage, see State-Space Matrices Export. - """ - command = f"SPMWRITE,{method},{nmode},{inputs},{inputlabels},{outputs},{outputlabels},{nic},{velacckey},{fileformat}" - return self.run(command, **kwargs) diff --git a/src/ansys/mapdl/core/_commands/post1_/status.py b/src/ansys/mapdl/core/_commands/post1_/status.py deleted file mode 100644 index f636aa22079..00000000000 --- a/src/ansys/mapdl/core/_commands/post1_/status.py +++ /dev/null @@ -1,141 +0,0 @@ -# Copyright (C) 2016 - 2025 ANSYS, Inc. and/or its affiliates. -# SPDX-License-Identifier: MIT -# -# -# Permission is hereby granted, free of charge, to any person obtaining a copy -# of this software and associated documentation files (the "Software"), to deal -# in the Software without restriction, including without limitation the rights -# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -# copies of the Software, and to permit persons to whom the Software is -# furnished to do so, subject to the following conditions: -# -# The above copyright notice and this permission notice shall be included in all -# copies or substantial portions of the Software. -# -# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -# SOFTWARE. - - -class Status: - def calc(self, **kwargs): - """Specifies "Calculation settings" as the subsequent status topic. - - APDL Command: CALC - - Notes - ----- - This is a status [STAT] topic command. Status topic commands are - generated by the GUI and will appear in the log file (Jobname.LOG) if - status is requested for some items under Utility Menu> List> Status. - This command will be immediately followed by a STAT command, which will - report the status for the specified topic. - - If entered directly into the program, the STAT command should - immediately follow this command. - """ - command = f"CALC," - return self.run(command, **kwargs) - - def datadef(self, **kwargs): - """Specifies "Directly defined data status" as the subsequent status - - APDL Command: DATADEF - topic. - - Notes - ----- - This is a status [STAT] topic command. Status topic commands are - generated by the GUI and will appear in the log file (Jobname.LOG) if - status is requested for some items under Utility Menu> List> Status. - This command will be immediately followed by a STAT command, which will - report the status for the specified topic. - - If entered directly into the program, the STAT command should - immediately follow this command. - """ - command = f"DATADEF," - return self.run(command, **kwargs) - - def display(self, **kwargs): - """Specifies "Display settings" as the subsequent status topic. - - APDL Command: DISPLAY - - Notes - ----- - This is a status [STAT] topic command. Status topic commands are - generated by the GUI and will appear in the log file (Jobname.LOG) if - status is requested for some items under Utility Menu> List> Status. - This command will be immediately followed by a STAT command, which will - report the status for the specified topic. - - If entered directly into the program, the STAT command should - immediately follow this command. - """ - command = f"DISPLAY," - return self.run(command, **kwargs) - - def lccalc(self, **kwargs): - """Specifies "Load case settings" as the subsequent status topic. - - APDL Command: LCCALC - - Notes - ----- - This is a status [STAT] topic command. Status topic commands are - generated by the GUI and will appear in the log file (Jobname.LOG) if - status is requested for some items under Utility Menu> List> Status. - This command will be immediately followed by a STAT command, which will - report the status for the specified topic. - - If entered directly into the program, the STAT command should - immediately follow this command. - - This command is also valid for rezoning. - """ - command = f"LCCALC," - return self.run(command, **kwargs) - - def point(self, **kwargs): - """Specifies "Point flow tracing settings" as the subsequent status topic. - - APDL Command: POINT - - Notes - ----- - This is a status [STAT] topic command. Status topic commands are - generated by the GUI and will appear in the log file (Jobname.LOG) if - status is requested for some items under Utility Menu> List> Status. - This command will be immediately followed by a STAT command, which will - report the status for the specified topic. - - If entered directly into the program, the STAT command should - immediately follow this command. - """ - command = f"POINT," - return self.run(command, **kwargs) - - def spec(self, **kwargs): - """Specifies "Miscellaneous specifications" as the subsequent status - - APDL Command: SPEC - topic. - - Notes - ----- - This is a status [STAT] topic command. Status topic commands are - generated by the GUI and will appear in the log file (Jobname.LOG) if - status is requested for some items under Utility Menu> List> Status. - This command will be immediately followed by a STAT command, which will - report the status for the specified topic. - - If entered directly into the program, the STAT command should - immediately follow this command. - """ - command = f"SPEC," - return self.run(command, **kwargs) diff --git a/src/ansys/mapdl/core/_commands/post1_/surface_operations.py b/src/ansys/mapdl/core/_commands/post1_/surface_operations.py deleted file mode 100644 index d60f543ca6b..00000000000 --- a/src/ansys/mapdl/core/_commands/post1_/surface_operations.py +++ /dev/null @@ -1,512 +0,0 @@ -# Copyright (C) 2016 - 2025 ANSYS, Inc. and/or its affiliates. -# SPDX-License-Identifier: MIT -# -# -# Permission is hereby granted, free of charge, to any person obtaining a copy -# of this software and associated documentation files (the "Software"), to deal -# in the Software without restriction, including without limitation the rights -# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -# copies of the Software, and to permit persons to whom the Software is -# furnished to do so, subject to the following conditions: -# -# The above copyright notice and this permission notice shall be included in all -# copies or substantial portions of the Software. -# -# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -# SOFTWARE. - - -class SurfaceOperations: - def sucalc( - self, - rsetname="", - lab1="", - oper="", - lab2="", - fact1="", - fact2="", - const="", - **kwargs, - ): - """Create new result data by operating on two existing result data sets on - - APDL Command: SUCALC - a given surface. - - Parameters - ---------- - rsetname - Eight character name for new result data. - - lab1 - First result data upon which to operate. - - oper - Mathematical operation to perform. - - ADD - (lab1 + lab2 + const) - - SUB - (lab1 - lab2 + const) - - MULT - (lab1 * lab2 + const) - - DIV - (lab1 / lab2 + const) - - EXP - (lab1 ^ fact1 + lab2 ^ fact2 + const) - - COS - (cos (lab1) + const) - - SIN - (sin (lab1) + const) - - ACOS - (acos (lab1) + const) - - ASIN - (asin (lab1) + const) - - ATAN - (atan (lab1) + const) - - ATA2 - (atan2 (lab1 / lab2) + const) - - LOG - (log (lab1) + const) - - ABS - (abs (lab1) + const) - - ZERO - (0 + const) - - lab2 - Second result data upon which to operate. - - fact1 - First scaling factor (for EXP option only). - - fact2 - Second scaling factor (for EXP option only). - - const - Constant added to the values in the resulting data. - """ - command = f"SUCALC,{rsetname},{lab1},{oper},{lab2},{fact1},{fact2},{const}" - return self.run(command, **kwargs) - - def sucr( - self, - surfname="", - surftype="", - nrefine="", - radius="", - tolout="", - **kwargs, - ): - """Create a surface. - - APDL Command: SUCR - - Parameters - ---------- - surfname - Eight character surface name. - - surftype - Surface type. - - CPLANE - Surface is defined by the cutting plane in window one (controlled by the - working plane (/CPLANE,1), NOT the view settings - (/CPLANE,0)). - - SPHERE - Surface is defined by a spherical surface centered about the working plane - origin. - - INFC - Surface is defined by a cylindrical surface centered about the working plane - origin and extending indefinitely in the positive and - negative Z directions. - - nrefine - Refinement level. - - For SurfType = CPLANE - The refinement level of the surface "mesh". This will be an integer between 0 - and 3 (default = 0). See Notes below. - - For SurfType = SPHERE - The number of divisions along a 90° arc (minimum = 9). The default is 9. - - For SurfType = INFC - The number of divisions along a 90° arc (minimum = 9). The default is 9. - - radius - Appropriate radius value (for INFC or SPHERE). - - tolout - Tolerance value for inclusion of element facets within a prescribed - volume. (for INFC) - - Notes - ----- - This command creates a new surface and stores the following data for - that surface: - - For SurfType = CPLANE, nRefine refers to the number of points that - define the surface. An nRefine value of zero is used for points where - the element face intersects the cutting plane. - - If SurfType = CPLANE and nRefine = 0, the points reside at the section - cuts where the element intersects the cutting plane. Increasing nRefine - from 0 to 1 will subdivide each surface facet into 4 subfacets, and - increase the number of points at which results can be interpolated. - - For SurfType = CPLANE , the setting from the /EFACET command will - affect the creation of surface facets and the quality of the fit of the - surface in the model. SUCR employs geometry data from PowerGraphics to - aid in determining where the surface intersects the model. If - /EFACET,1 is in effect when the SUCR command is issued, then the - curvature of high order elements (that is, elements with midside nodes) - will be ignored. If your model contains high order elements, you can - see a better fit for your surface if /EFACET,2 is in effect when the - SUCR command is issued. Currently, the SUCR command interprets - /EFACET,4 to mean /EFACET,2. - - For SurfType = INFC, a default tolerance of 0.01 will be applied to - include the vertices of any facets that fall out of the cylinder - definition. This tolerance increases the facet size by one percent to - check for inclusion. Excluding facets under such a small tolerance may - yield unacceptable (aesthetically) results. Increasing the tolerance by - a larger amount (0.1 or 10%) will sometimes yield smother edges along - the surface you create. - """ - command = f"SUCR,{surfname},{surftype},{nrefine},{radius},{tolout}" - return self.run(command, **kwargs) - - def sudel(self, surfname="", **kwargs): - """Delete geometry information as well as any mapped results for specified - - APDL Command: SUDEL - surface. - - Parameters - ---------- - surfname - Eight character surface name. - """ - command = f"SUDEL,{surfname}" - return self.run(command, **kwargs) - - def sueval(self, parm="", lab1="", oper="", **kwargs): - """Perform operations on a mapped item and store result in a scalar - - APDL Command: SUEVAL - parameter. - - Parameters - ---------- - parm - APDL parameter name. - - lab1 - Eight character set name for the first set used in calculation. - - oper - Operation to perform: - - SUM - Sum of lab1 result values. - - INTG - Integral of lab1 over surface. - - AVG - Area-weighted average of a result item ``[Σ(lab1*DA) / Σ(DA)]`` - - Notes - ----- - The result of this operation is a scalar APDL parameter value. If - multiple surfaces are selected when this command is issued, then the - operation is carried out on each surface individually and the parameter - represents the cumulative value of the operation on all selected - surfaces. - """ - command = f"SUEVAL,{parm},{lab1},{oper}" - return self.run(command, **kwargs) - - def suget(self, surfname="", rsetname="", parm="", geom="", **kwargs): - """Moves surface geometry and mapped results to an array parameter. - - APDL Command: SUGET - - Parameters - ---------- - surfname - Eight character surface name. - - rsetname - Eight character result name. - - parm - APDL array parameter name (up to 32 characters). - - geom - Switch controlling how data is written. - - ON (or 1 or YES) - Writes geometry data and interpolated - results information to the parameter. - - OFF (or 0 or NO) - Writes only interpolated results - information to the parameter. (Default) - - Notes - ----- - For Geom = OFF (or 0 or NO), only results information is written to - this parameter. - - For Geom = ON (or 1 or YES), both geometry data and results information - are written to this parameter. Geometry data includes 7 data items: - (GCX, GCY, GCZ, NORMX, NORMY, NORMZ, and DA). Results information is - then written to the 8th column of the parameter. SetNames of GCX, GCY, - GCZ, NORMX, NORMY, NORMZ, and DA are predefined and computed when SUCR - is issued. - """ - command = f"SUGET,{surfname},{rsetname},{parm},{geom}" - return self.run(command, **kwargs) - - def sumap(self, rsetname="", item="", comp="", **kwargs): - """Map results onto selected surface(s). - - APDL Command: SUMAP - - Parameters - ---------- - rsetname - Eight-character name for the result being mapped. - - item - Label identifying the item. - - comp - Component label of item (if required). - - Notes - ----- - The SUMAP command maps results in the current coordinate system (RSYS) - using the selected set of elements. - - The command interpolates and stores the results data on to each of the - selected surfaces. - - SUMAP,ALL,CLEAR deletes all results sets from all selected surfaces. - """ - command = f"SUMAP,{rsetname},{item},{comp}" - return self.run(command, **kwargs) - - def supl(self, surfname="", rsetname="", kwire="", **kwargs): - """Plot result data on all selected surfaces or on a specified surface. - - APDL Command: SUPL - - Parameters - ---------- - surfname - Eight character surface name. ALL will plot all selected surfaces. - - rsetname - Eight character result name. - - kwire - Plot in context of model. - - 0 - Plot results without the outline of selected elements. - - 1 - Plot results with the outline of selected elements. - - Notes - ----- - If RSetName is left blank, then the surface geometry will be plotted. - If the Setname portion of the argument is a vector prefix (i.e. if - result sets of name SetNameX, SetNameY and SetNameZ exist), ANSYS will - plot these vectors on the surface as arrows. For example, SUPL, ALL, - NORM will plot the surface normals as vectors on all selected surfaces, - since NORMX NORMY and NORMZ are pre-defined geometry items. - """ - command = f"SUPL,{surfname},{rsetname},{kwire}" - return self.run(command, **kwargs) - - def supr(self, surfname="", rsetname="", **kwargs): - """Print global status, geometry information and/or result information. - - APDL Command: SUPR - - Parameters - ---------- - surfname - Eight character surface name. If SurfName = ALL, repeat printout - for all selected surfaces. - - rsetname - Eight character result set name. - - Notes - ----- - When no arguments are specified, SUPR generates a global status summary - of all defined surfaces. If only SurfName is specified, the geometry - information for that surface is printed. If both SurfName and RSetName - are specified, the value of the results set at each point, in addition - to the geometry information, is printed. - """ - command = f"SUPR,{surfname},{rsetname}" - return self.run(command, **kwargs) - - def suresu(self, fname="", fext="", fdir="", **kwargs): - """Read a set of surface definitions and result items from a file - - APDL Command: SURESU - and make them the current set. - - Parameters - ---------- - fname - Eight character name. - - fext - Extension name. - - fdir - Optional path specification. - - Notes - ----- - Reading (and therefore resuming) surface and result - definitions from a file overwritea any existing surface - definitions. - - Reading surfaces back into the postprocessor (/POST1) does not - insure that the surfaces (and their results) are appropriate - for the model currently residing in /POST1. - """ - return self.run(f"SURESU,,{fname},{fext},{fdir}", **kwargs) - - def susave(self, lab="", fname="", fext="", fdir="", **kwargs): - """Saves surface definitions to a file. - - APDL Command: SUSAVE - - Parameters - ---------- - lab - Eight-character surface name. - - fname - File name and directory path (248 character maximum, including - directory). If you do not specify a directory path, the default is - your working directory and you can use all 248 characters for the - file name. The file name defaults to the jobname. - - fext - File name extension (eight-character maximum). The extension - defaults to "surf". - - fdir - Optional path specification. - - Notes - ----- - The SUSAVE command saves surface definitions (geometry - information)--and any result items mapped onto the surfaces--to a file. - - Issuing the SUSAVE command has no effect on the database. The database - remains unchanged. - - Subsequent executions of the SUSAVE command overwrite previous data in - the file. - - To read the contents of the file created via the SUSAVE command, issue - the SURESU command. - """ - command = f"SUSAVE,{lab},{fname},{fext},{fdir}" - return self.run(command, **kwargs) - - def susel( - self, - type_="", - name1="", - name2="", - name3="", - name4="", - name5="", - name6="", - name7="", - name8="", - **kwargs, - ): - """Selects a subset of surfaces - - APDL Command: SUSEL - - Parameters - ---------- - type\\_ - Label identifying the type of select: - - S - Selects a new set (default). - - R - Reselects a set from the current set. - - A - Additionally selects a set and extends the current set. - - U - Unselects a set from the current set. - - ALL - Also selects all surfaces. - - NONE - Unselects all surfaces. - - name1, name2, name3, . . . , name8 - Eight character surface names - - Notes - ----- - The selected set of surfaces is used in the following operations: - SUMAP, SUDEL, SUCALC, SUEVAL, and SUVECT. - """ - command = f"SUSEL,{type_},{name1},{name2},{name3},{name4},{name5},{name6},{name7},{name8}" - return self.run(command, **kwargs) - - def suvect(self, rsetname="", lab1="", oper="", lab2="", offset="", **kwargs): - """Create new result data by operating on two existing result vectors on a - - APDL Command: SUVECT - given surface. - - Parameters - ---------- - rsetname - Eight character name of the result data output. There will be one - or three RSetName values depending on the operation specified in - Oper. - - lab1 - Eight character name of the mapped data that forms vector 1. - Specified sets must exist on all selected surfaces for this - operation to take place. The names NORM and GC will be reserved for - normals and for global (x, y, z). - - oper - DOT - - DOT - Computes dot product between lab1 and lab2 vectors. The result is a scalar - parameter (RSetName) and each value within the set can be - modified (incremented) via Offset. - - CROSS - Computes cross product between lab1 and lab2 vectors. Each X, Y, Z value in the - result can be modified (incremented) via Offset. - - SMULT - Scales (lab1x, lab1y, lab1z) vector by scalar lab2. Each X,Y,Z value in the - result can be modified (incremented) via Offset. - - lab2 - Eight character name of the mapped data that forms vector 2. Sets - with names Lab2X, Lab2Y, and Lab2Z must exist on all selected - surfaces for operation to take place. For Oper = SMULT a scalar - value or another predefined scalar item (e.g., DA) can be supplied. - - offset - An offset value to be applied to the resultant RSetName. One value - is specified for Oper = DOT, and three values are specified for - Oper = SMULT. - """ - command = f"SUVECT,{rsetname},{lab1},{oper},{lab2},{offset}" - return self.run(command, **kwargs) diff --git a/src/ansys/mapdl/core/_commands/post1_/trace_points.py b/src/ansys/mapdl/core/_commands/post1_/trace_points.py deleted file mode 100644 index c0e81cb8fba..00000000000 --- a/src/ansys/mapdl/core/_commands/post1_/trace_points.py +++ /dev/null @@ -1,237 +0,0 @@ -# Copyright (C) 2016 - 2025 ANSYS, Inc. and/or its affiliates. -# SPDX-License-Identifier: MIT -# -# -# Permission is hereby granted, free of charge, to any person obtaining a copy -# of this software and associated documentation files (the "Software"), to deal -# in the Software without restriction, including without limitation the rights -# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -# copies of the Software, and to permit persons to whom the Software is -# furnished to do so, subject to the following conditions: -# -# The above copyright notice and this permission notice shall be included in all -# copies or substantial portions of the Software. -# -# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -# SOFTWARE. - - -class TracePoints: - def pltrac( - self, - analopt="", - item="", - comp="", - trpnum="", - name="", - mxloop="", - toler="", - option="", - escl="", - mscl="", - **kwargs, - ): - """Displays a particle flow or charged particle trace on an element - - APDL Command: PLTRAC - display. - - Parameters - ---------- - analopt - Analysis option - - FLUID - Particle trace in fluid flow (default) - - ELEC - Particle trace in electric field - - MAGN - Particle trace in magnetic field - - EMAG - Particle trace in presence of both electric and magnetic fields - - item - Label identifying the item to be contoured. Valid item labels are - shown in Table 222: PLTRAC - Valid Item and Component Labels - below. Some items also require a component label. If Item is - blank, display only the path trajectory. - - comp - Component of the item (if required). Valid component labels are - shown in Table 222: PLTRAC - Valid Item and Component Labels below. - - trpnum - Trace point number for storing trajectory data for use with PATH - logic. Defaults to 0 (no trajectory path data is stored for further - processing with PATH logic). - - name - Name of prefix of array variable. Defaults to TRAC. NamePOIN stores - trajectory path points for trace point number TRPNum. If Analopt = - ELEC, MAGN, or EMAG, two additional array parameters, NameDATA and - NameLABL, store trajectory path data and labels for the same - TRPNum. - - mxloop - Maximum number of loops traced by a particle. Defaults to 25 for - Opt = FLUID; otherwise, defaults to 1000. - - toler - Length tolerance used for particle trajectory geometry calculation. - Valid only for Analopt = ELEC, MAGN, or EMAG. If particle trace - appears to terminate inside an element, adjusting the length - tolerance may be necessary. Defaults to 1.0 x 10-8. - - option - Flow trace option: - - 0 - Use the undeformed mesh for computing the flow trace. - - 1 - Use the deformed mesh for computing the flow trace. - - escl - Electric field scale factor. Setting this scale factor affects only - the tracing, not the field solution results. A negative factor - corresponds to the opposite vector direction. Valid only for - Analopt = ELEC or EMAG. Defaults to 1. - - mscl - Magnetic field scale factor. Setting this scale factor affects only - the tracing, not the field solution results. A negative factor - corresponds to the opposite vector direction. Valid only for - Analopt = MAGN or EMAG. Defaults to 1. - - Notes - ----- - For a specified item, the variation of the item is displayed along the - particle trace as a color-contoured ribbon. The TRPOIN command must be - used to define a point on the trajectory path. Multiple traces may be - displayed simultaneously by defining multiple trace points. Issue the - TRPLIS command to list the current tracing points. Issue the TRPDEL - command to delete tracing points defined earlier. Use the PAPUT - command with the POIN option to retrieve the particle trajectory points - as path points. - - The model must be 3-D for the ELEC, MAGN, and EMAG analysis options. - - Three array parameters are created at the time of the particle trace: - TRACPOIN, TRACDATA and TRACLABL. These array parameters can be used to - put the particle velocity and the elapsed time into path form. The - procedure to put the arrays into a path named PATHNAME is as follows: - - Not used if Analopt = FLUID. If working in the GUI, use the "All - information" option to retrieve information from all three arrays at - once. - - If OPTION is set to 1, the deformed mesh is based on the displacement - degrees of freedom UX, UY, and UZ, which must be available in the load - step. - - Table: 222:: : PLTRAC - Valid Item and Component Labels - - See the Basic Analysis Guide for more information on particle flow and - charged particle traces. See Animation in the Basic Analysis Guide for - information on particle trace animation. - - Distributed ANSYS Restriction: This command is not supported in - Distributed ANSYS. - """ - command = f"PLTRAC,{analopt},{item},{comp},{trpnum},{name},{mxloop},{toler},{option},{escl},{mscl}" - return self.run(command, **kwargs) - - def trpdel(self, ntrp1="", ntrp2="", trpinc="", **kwargs): - """Deletes particle flow or charged particle trace points. - - APDL Command: TRPDEL - - Parameters - ---------- - ntrp1, ntrp2, trpinc - Delete points from NTRP1 to NTRP2 (defaults to NTRP1) in steps of - TRPINC (defaults to 1). If NTRP1 = ALL, NTRP2 and TRPINC are - ignored and all trace points are deleted. If NTRP1 = P, graphical - picking is enabled and all remaining command fields are ignored - (valid only in the GUI). - - Notes - ----- - Deletes particle flow or charged particle trace points defined with the - TRPOIN command. - - Distributed ANSYS Restriction: This command is not supported in - Distributed ANSYS. - """ - command = f"TRPDEL,{ntrp1},{ntrp2},{trpinc}" - return self.run(command, **kwargs) - - def trplis(self, ntrp1="", ntrp2="", trpinc="", opt="", **kwargs): - """Lists the particle flow or charged particle trace points. - - APDL Command: TRPLIS - - Parameters - ---------- - ntrp1, ntrp2, trpinc - List points from NTRP1 to NTRP2 (defaults to NTRP1) in steps of - TRPINC (defaults to 1). If NTRP1 = ALL, NTRP2 and TRPINC are - ignored and all trace points are listed. If NTRP1 = P, graphical - picking is enabled and all remaining command fields are ignored - (valid only in the GUI). - - opt - Opt = LOC lists the trace point number location (X, Y, Z). Default. - - Notes - ----- - Lists the particle flow or charged particle trace points in the active - display coordinate system [DSYS]. Trace points are defined with the - TRPOIN command. - - Distributed ANSYS Restriction: This command is not supported in - Distributed ANSYS. - """ - command = f"TRPLIS,{ntrp1},{ntrp2},{trpinc},{opt}" - return self.run(command, **kwargs) - - def trpoin(self, x="", y="", z="", vx="", vy="", vz="", chrg="", mass="", **kwargs): - """Defines a point through which a particle flow or charged particle trace - - APDL Command: TRPOIN - will travel. - - Parameters - ---------- - x, y, z - Coordinate location of the trace point (in the active coordinate - system). If X = P, graphical picking is enabled and all remaining - command fields are ignored (valid only in the GUI). - - vx, vy, vz - Particle velocities in the X, Y and Z directions (in the active - coordinate system). - - chrg - Particle charge. - - mass - Particle mass. - - Notes - ----- - Defines a point through which a particle flow or charged particle trace - [PLTRAC] will travel. Multiple points (50 maximum) may be defined - which will result in multiple flow traces. Use TRPLIS to list the - currently defined trace points and TRPDEL to delete trace points. - - The VX, VY, VZ, CHRG, and MASS arguments only apply to charged - particles. - - Distributed ANSYS Restriction: This command is not supported in - Distributed ANSYS. - """ - command = f"TRPOIN,{x},{y},{z},{vx},{vy},{vz},{chrg},{mass}" - return self.run(command, **kwargs) diff --git a/src/ansys/mapdl/core/_commands/post26/__init__.py b/src/ansys/mapdl/core/_commands/post26/__init__.py new file mode 100644 index 00000000000..7002ecee1b8 --- /dev/null +++ b/src/ansys/mapdl/core/_commands/post26/__init__.py @@ -0,0 +1,32 @@ +# Copyright (C) 2016 - 2025 ANSYS, Inc. and/or its affiliates. +# SPDX-License-Identifier: MIT +# +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to deal +# in the Software without restriction, including without limitation the rights +# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +# copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in all +# copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +# SOFTWARE. + +from . import ( + _set_up, + controls, + display, + listing, + operations, + set_up, + special_purpose, + status, +) diff --git a/src/ansys/mapdl/core/_commands/post26/_set_up.py b/src/ansys/mapdl/core/_commands/post26/_set_up.py new file mode 100644 index 00000000000..c2a10558cca --- /dev/null +++ b/src/ansys/mapdl/core/_commands/post26/_set_up.py @@ -0,0 +1,60 @@ +# Copyright (C) 2016 - 2025 ANSYS, Inc. and/or its affiliates. +# SPDX-License-Identifier: MIT +# +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to deal +# in the Software without restriction, including without limitation the rights +# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +# copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in all +# copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +# SOFTWARE. + + +class SetUp: + + def gapf(self, nvar: str = "", num: str = "", name: str = "", **kwargs): + r"""Defines the gap force data to be stored in a variable. + + Mechanical APDL Command: `GAPF `_ + + Parameters + ---------- + nvar : str + Arbitrary reference number assigned to this variable (2 to ``NV`` on :ref:`numvar` ). Overwrites + any existing results for this variable. + + num : str + Number identifying gap number for which the gap force is to be stored. Issue the :ref:`gplist` + command to display gap numbers. + + name : str + Thirty-two character name for identifying the item on the printout and displays (defaults to the + name :ref:`gapf` ). + + Notes + ----- + + .. _GAPF_notes: + + Defines the gap force data to be stored in a variable. Applicable only to the expansion pass of the + mode-superposition linear transient dynamic ( :ref:`antype`,TRANS) analysis. The data is usually on + :file:`FnameRDSP`. + + .. warning:: + + This command is archived in the latest version of the software. + + """ + command = f"GAPF,{nvar},{num},{name}" + return self.run(command, **kwargs) diff --git a/src/ansys/mapdl/core/_commands/post26/controls.py b/src/ansys/mapdl/core/_commands/post26/controls.py new file mode 100644 index 00000000000..633aedc26fc --- /dev/null +++ b/src/ansys/mapdl/core/_commands/post26/controls.py @@ -0,0 +1,152 @@ +# Copyright (C) 2016 - 2025 ANSYS, Inc. and/or its affiliates. +# SPDX-License-Identifier: MIT +# +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to deal +# in the Software without restriction, including without limitation the rights +# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +# copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in all +# copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +# SOFTWARE. + + +class Controls: + + def cfact( + self, + rfacta: str = "", + ifacta: str = "", + rfactb: str = "", + ifactb: str = "", + rfactc: str = "", + ifactc: str = "", + **kwargs, + ): + r"""Defines complex scaling factors to be used with operations. + + Mechanical APDL Command: `CFACT `_ + + **Command default:** + + .. _CFACT_default: + + Use the real factors as described with the operation command. + + Parameters + ---------- + rfacta : str + Real portion of the complex scale factor used in place of ``FACTA``. + + ifacta : str + Imaginary portion of the complex scale factor used in place of ``FACTA``. + + rfactb : str + Real portion of the complex scale factor used in place of ``FACTB``. + + ifactb : str + Imaginary portion of the complex scale factor used in place of ``FACTB``. + + rfactc : str + Real portion of the complex scale factor used in place of ``FACTC``. + + ifactc : str + Imaginary portion of the complex scale factor used in place of ``FACTC``. + + Notes + ----- + + .. _CFACT_notes: + + Defines complex scale factors to be used with the operations ( :ref:`add`, :ref:`prod`, etc.). If + this command is supplied, these complex factors override any real factors ( ``FACTA``, ``FACTB``, + ``FACTC`` ) supplied on the operation commands. Factors are typically involved in scaling a + specified variable, such as in the term ``FACTA`` x ``IA`` of the :ref:`add` command to scale + variable ``IA`` before the ADD operation. + + When the :ref:`cfact` command is active, defaults are as follows: 1) if the complex factor is not + specified, but the variable upon which it acts (such as ``IA`` ) is specified, the factor defaults + to 1.0+ i 0.0; 2) if the variable upon which the factor operates is not specified, but the factor is + specified, the variable defaults to 1.0 so that the term in the operation becomes the complex factor + itself; 3) if neither the factor nor the variable number is supplied, the term is omitted from the + operation. Once the operation (such as the :ref:`add` command) has been processed, the :ref:`cfact` + command becomes inactive and must be specified again if it is to be used. + """ + command = f"CFACT,{rfacta},{ifacta},{rfactb},{ifactb},{rfactc},{ifactc}" + return self.run(command, **kwargs) + + def layerp26(self, num: str = "", **kwargs): + r"""Specifies the element layer for which data are to be stored. + + Mechanical APDL Command: `LAYERP26 `_ + + Parameters + ---------- + num : str + Layer-processing mode: + + * ``N`` - The layer number to process. The default value is 1. + + Notes + ----- + + .. _LAYERP26_notes: + + Defines the element layer for which results data are to be stored for postprocessing. Applies to + stress and strain data for layered elements ``SHELL181``, ``SOLID185``, ``SOLID186``, ``SOLSH190``, + ``SHELL208``, ``SHELL209``, ``SHELL281``, ``REINF265``, and ``ELBOW290``. + + The :ref:`shell` command can be used (for shell elements) to specify a location (TOP, MID, BOT) + within the layer for selection on the :ref:`esol` command. Transverse shear stresses for MID are + linearly averaged from TOP and BOT, and do not reflect a parabolic distribution. Setting KEYOPT(8) = + 2 for ``SHELL181``, ``SHELL208``, ``SHELL209``, ``SHELL281``, and ``ELBOW290`` writes the mid- + surface values directly to the results file and yields more accurate values than linear averaging. + + That this command cannot be used for energy output, as energy is a per-element quantity. + + When using the :ref:`layerp26` command with ``SHELL181``, ``SOLID185``, ``SOLID186``, ``SOLSH190``, + ``SHELL208``, or ``SHELL209``, KEYOPT(8) must be set to 1 (or 2 for ``SHELL181``, ``SHELL208``, + ``SHELL209``, ``SHELL281``, and ``ELBOW290`` ) in order to store results for all layers. + + In POST26, the :ref:`esol` data stored is based on the active :ref:`layerp26` specification at the + time the data is stored. To store data at various specifications (for example, layers 2 and 5), + issue a :ref:`store` command before each new specification. + """ + command = f"LAYERP26,{num}" + return self.run(command, **kwargs) + + def tvar(self, key: int | str = "", **kwargs): + r"""Changes time to the cumulative iteration number. + + Mechanical APDL Command: `TVAR `_ + + Parameters + ---------- + key : int or str + Time key: + + * ``0`` - Time is used for the variable ``TIME``. + + * ``1`` - NCUMIT is used for the variable ``TIME``. + + Notes + ----- + + .. _TVAR_notes: + + Changes the meaning of the time variable to the cumulative iteration number (NCUMIT) variable. Data + can be read from the file, printed, and displayed as a function of NCUMIT rather than time. All + POST26 descriptions applying to TIME then apply to NCUMIT. + """ + command = f"TVAR,{key}" + return self.run(command, **kwargs) diff --git a/src/ansys/mapdl/core/_commands/post26/display.py b/src/ansys/mapdl/core/_commands/post26/display.py new file mode 100644 index 00000000000..745fcbb1438 --- /dev/null +++ b/src/ansys/mapdl/core/_commands/post26/display.py @@ -0,0 +1,250 @@ +# Copyright (C) 2016 - 2025 ANSYS, Inc. and/or its affiliates. +# SPDX-License-Identifier: MIT +# +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to deal +# in the Software without restriction, including without limitation the rights +# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +# copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in all +# copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +# SOFTWARE. + + +class Display: + + def keep(self, key: str = "", **kwargs): + r"""Stores POST26 definitions and data during active session. + + Mechanical APDL Command: `KEEP `_ + + Parameters + ---------- + key : str + State or value + + * ``On or 1`` - Allows you to exit and reenter :ref:`post26` without losing your current time + history variable information. Keeps a cache of the :ref:`post26` variable information including the + active file name ( ``FILE`` ), variable definitions ( :ref:`nsol`, :ref:`esol`, :ref:`rforce`, and + :ref:`solu` ) and stored variable data in memory for the current Mechanical APDL session. + + * ``Off or 0`` - :ref:`post26` variable information is deleted when you exit :ref:`post26`. + + Notes + ----- + + .. _KEEP_notes: + + Your variable information is saved in memory only for the current active Mechanical APDL session. It + is + deleted when you exit Mechanical APDL. This information is also deleted when you issue ``/CLEAR``, + :ref:`resume`, :ref:`solve`, or :ref:`reset`. + + When you reenter :ref:`post26` all time history variable data is available for use. When you issue + :ref:`store`, NEW, variable definitions created by math operations such as :ref:`add` or :ref:`prod` + will not be restored. However, variables defined with :ref:`nsol`, :ref:`esol`, :ref:`rforce`, and + :ref:`solu` will be restored. Only the last active results file name is kept in memory ( ``FILE`` + ). + + Commands such as :ref:`layerp26`, :ref:`shell`, and :ref:`force` that specify the location or a + component of data to be stored will retain the setting at the time of exiting :ref:`post26`. + """ + command = f"KEEP,{key}" + return self.run(command, **kwargs) + + def plcplx(self, key: int | str = "", **kwargs): + r"""Specifies the part of a complex variable to display. + + Mechanical APDL Command: `PLCPLX `_ + + Parameters + ---------- + key : int or str + Complex variable part: + + * ``0`` - Amplitude. + + * ``1`` - Phase angle. + + * ``2`` - Real part. + + * ``3`` - Imaginary part. + + Notes + ----- + + .. _PLCPLX_notes: + + Used only with harmonic analyses ( :ref:`antype`,HARMIC). + + All results data are stored in the form of real and imaginary components and converted to amplitude + and/or phase angle as specified via the :ref:`plcplx` command. The conversion is not valid for + derived results (such as principal stress/strain, equivalent stress/strain and USUM). + """ + command = f"PLCPLX,{key}" + return self.run(command, **kwargs) + + def pltime(self, tmin: str = "", tmax: str = "", **kwargs): + r"""Defines the time range for which data are to be displayed. + + Mechanical APDL Command: `PLTIME `_ + + **Command default:** + + .. _PLTIME_default: + + Use the previously defined range ( :ref:`timerange` ). + + Parameters + ---------- + tmin : str + Minimum time (defaults to the first point stored). + + tmax : str + Maximum time (defaults to the last point stored). + + Notes + ----- + + .. _PLTIME_notes: + + Defines the time (or frequency) range (within the range stored) for which data are to be displayed. + Time is always displayed in the Z-axis direction for 3D graph displays. If XVAR = 1, time is also + displayed in the X-axis direction and this control also sets the abscissa scale range. + """ + command = f"PLTIME,{tmin},{tmax}" + return self.run(command, **kwargs) + + def plvar( + self, + nvar1: str = "", + nvar2: str = "", + nvar3: str = "", + nvar4: str = "", + nvar5: str = "", + nvar6: str = "", + nvar7: str = "", + nvar8: str = "", + nvar9: str = "", + nvar10: str = "", + **kwargs, + ): + r"""Displays up to ten variables in the form of a graph. + + Mechanical APDL Command: `PLVAR `_ + + Parameters + ---------- + nvar1 : str + Variables to be displayed, defined either by the reference number or a unique thirty-two + character name. If duplicate names are used the command will plot the data for the lowest- + numbered variable with that name. + + nvar2 : str + Variables to be displayed, defined either by the reference number or a unique thirty-two + character name. If duplicate names are used the command will plot the data for the lowest- + numbered variable with that name. + + nvar3 : str + Variables to be displayed, defined either by the reference number or a unique thirty-two + character name. If duplicate names are used the command will plot the data for the lowest- + numbered variable with that name. + + nvar4 : str + Variables to be displayed, defined either by the reference number or a unique thirty-two + character name. If duplicate names are used the command will plot the data for the lowest- + numbered variable with that name. + + nvar5 : str + Variables to be displayed, defined either by the reference number or a unique thirty-two + character name. If duplicate names are used the command will plot the data for the lowest- + numbered variable with that name. + + nvar6 : str + Variables to be displayed, defined either by the reference number or a unique thirty-two + character name. If duplicate names are used the command will plot the data for the lowest- + numbered variable with that name. + + nvar7 : str + Variables to be displayed, defined either by the reference number or a unique thirty-two + character name. If duplicate names are used the command will plot the data for the lowest- + numbered variable with that name. + + nvar8 : str + Variables to be displayed, defined either by the reference number or a unique thirty-two + character name. If duplicate names are used the command will plot the data for the lowest- + numbered variable with that name. + + nvar9 : str + Variables to be displayed, defined either by the reference number or a unique thirty-two + character name. If duplicate names are used the command will plot the data for the lowest- + numbered variable with that name. + + nvar10 : str + Variables to be displayed, defined either by the reference number or a unique thirty-two + character name. If duplicate names are used the command will plot the data for the lowest- + numbered variable with that name. + + Notes + ----- + + .. _PLVAR_notes: + + Variables are displayed vs. variable ``N`` on the :ref:`xvar` command. The string value will be a + predefined, unique name. For complex variables, the amplitude is displayed by default ( + :ref:`plcplx` ). Each :ref:`plvar` command produces a new frame. See the :ref:`grtyp` command for + displaying multiple variables in a single frame with separate Y-axes. + """ + command = f"PLVAR,{nvar1},{nvar2},{nvar3},{nvar4},{nvar5},{nvar6},{nvar7},{nvar8},{nvar9},{nvar10}" + return self.run(command, **kwargs) + + def spread(self, value: str = "", **kwargs): + r"""Turns on a dashed tolerance curve for the subsequent curve plots. + + Mechanical APDL Command: `SPREAD `_ + + Parameters + ---------- + value : str + Amount of tolerance. For example, 0.1 is ± 10%. + """ + command = f"SPREAD,{value}" + return self.run(command, **kwargs) + + def xvar(self, n: int | str = "", **kwargs): + r"""Specifies the X variable to be displayed. + + Mechanical APDL Command: `XVAR `_ + + Parameters + ---------- + n : int or str + X variable number: + + * ``0 or 1`` - Display :ref:`plvar` values vs. time (or frequency). + + * ``n`` - Display :ref:`plvar` values vs. variable ``n`` (2 to ``NV`` ( :ref:`numvar` )). + + * ``1`` - Interchange time and :ref:`plvar` variable numbers with time as the curve parameter. + :ref:`plvar` variable numbers are displayed uniformly spaced along X-axis from position 1 to 10. + + Notes + ----- + + .. _XVAR_notes: + + Defines the X variable (displayed along the abscissa) against which the Y variable(s) ( :ref:`plvar` + ) are to be displayed. + """ + command = f"XVAR,{n}" + return self.run(command, **kwargs) diff --git a/src/ansys/mapdl/core/_commands/post26/listing.py b/src/ansys/mapdl/core/_commands/post26/listing.py new file mode 100644 index 00000000000..f52961ca80c --- /dev/null +++ b/src/ansys/mapdl/core/_commands/post26/listing.py @@ -0,0 +1,213 @@ +# Copyright (C) 2016 - 2025 ANSYS, Inc. and/or its affiliates. +# SPDX-License-Identifier: MIT +# +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to deal +# in the Software without restriction, including without limitation the rights +# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +# copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in all +# copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +# SOFTWARE. + + +class Listing: + + def extrem(self, nvar1: str = "", nvar2: str = "", ninc: str = "", **kwargs): + r"""Lists the extreme values for variables. + + Mechanical APDL Command: `EXTREM `_ + + Parameters + ---------- + nvar1 : str + List extremes for variables ``NVAR1`` through ``NVAR2`` in steps of ``NINC``. Variable range + defaults to its maximum. ``NINC`` defaults to 1. + + nvar2 : str + List extremes for variables ``NVAR1`` through ``NVAR2`` in steps of ``NINC``. Variable range + defaults to its maximum. ``NINC`` defaults to 1. + + ninc : str + List extremes for variables ``NVAR1`` through ``NVAR2`` in steps of ``NINC``. Variable range + defaults to its maximum. ``NINC`` defaults to 1. + + Notes + ----- + + .. _EXTREM_notes: + + Lists the extreme values (and the corresponding times) for stored and calculated variables. Extremes + for stored variables are automatically listed as they are stored. Only the real part of a complex + number is used. Extreme values may also be assigned to parameters ( :ref:`get` ). + """ + command = f"EXTREM,{nvar1},{nvar2},{ninc}" + return self.run(command, **kwargs) + + def lines(self, n: str = "", **kwargs): + r"""Specifies the length of a printed page. + + Mechanical APDL Command: `LINES `_ + + Parameters + ---------- + n : str + Number of lines per page (defaults to 20). (Minimum allowed = 11). + + Notes + ----- + + .. _LINES_notes: + + Specifies the length of a printed page (for use in reports, etc.). + """ + command = f"LINES,{n}" + return self.run(command, **kwargs) + + def nprint(self, n: str = "", **kwargs): + r"""Defines which time points stored are to be listed. + + Mechanical APDL Command: `NPRINT `_ + + Parameters + ---------- + n : str + List data associated with every ``N`` time (or frequency) point(s), beginning with the first + point stored (defaults to 1). + + Notes + ----- + + .. _NPRINT_notes: + + Defines which time (or frequency) points within the range stored are to be listed. + """ + command = f"NPRINT,{n}" + return self.run(command, **kwargs) + + def prcplx(self, key: int | str = "", **kwargs): + r"""Defines the output form for complex variables. + + Mechanical APDL Command: `PRCPLX `_ + + Parameters + ---------- + key : int or str + Output form key: + + * ``0`` - Real and imaginary parts. + + * ``1`` - Amplitude and phase angle. Stored real and imaginary data are converted to amplitude and + phase angle upon output. Data remain stored as real and imaginary parts. + + Notes + ----- + + .. _PRCPLX_notes: + + Defines the output form for complex variables. Used only with harmonic analyses ( + :ref:`antype`,HARMIC). + + All results data are stored in the form of real and imaginary components and converted to amplitude + and/or phase angle as specified via the :ref:`prcplx` command. The conversion is not valid for + derived results (such as principal stress/strain, equivalent stress/strain and USUM). + """ + command = f"PRCPLX,{key}" + return self.run(command, **kwargs) + + def prtime(self, tmin: str = "", tmax: str = "", **kwargs): + r"""Defines the time range for which data are to be listed. + + Mechanical APDL Command: `PRTIME `_ + + **Command default:** + + .. _PRTIME_default: + + Use the previously defined range ( :ref:`timerange` ). + + Parameters + ---------- + tmin : str + Minimum time (defaults to the first point stored). + + tmax : str + Maximum time (defaults to the last point stored). + + Notes + ----- + + .. _PRTIME_notes: + + Defines the time (or frequency) range (within the range stored) for which data are to be listed. + """ + command = f"PRTIME,{tmin},{tmax}" + return self.run(command, **kwargs) + + def prvar( + self, + nvar1: str = "", + nvar2: str = "", + nvar3: str = "", + nvar4: str = "", + nvar5: str = "", + nvar6: str = "", + **kwargs, + ): + r"""Lists variables vs. time (or frequency). + + Mechanical APDL Command: `PRVAR `_ + + Parameters + ---------- + nvar1 : str + Variables to be displayed, defined either by the reference number or a unique thirty-two + character name. If duplicate names are used the command will print the data for the lowest- + numbered variable with that name. + + nvar2 : str + Variables to be displayed, defined either by the reference number or a unique thirty-two + character name. If duplicate names are used the command will print the data for the lowest- + numbered variable with that name. + + nvar3 : str + Variables to be displayed, defined either by the reference number or a unique thirty-two + character name. If duplicate names are used the command will print the data for the lowest- + numbered variable with that name. + + nvar4 : str + Variables to be displayed, defined either by the reference number or a unique thirty-two + character name. If duplicate names are used the command will print the data for the lowest- + numbered variable with that name. + + nvar5 : str + Variables to be displayed, defined either by the reference number or a unique thirty-two + character name. If duplicate names are used the command will print the data for the lowest- + numbered variable with that name. + + nvar6 : str + Variables to be displayed, defined either by the reference number or a unique thirty-two + character name. If duplicate names are used the command will print the data for the lowest- + numbered variable with that name. + + Notes + ----- + + .. _PRVAR_notes: + + Lists variables vs. time (or frequency). Up to six variables may be listed across the line. Time + column output format can be changed using the :ref:`format` command arguments ``Ftype``, ``NWIDTH``, + and ``DSIGNF``. + """ + command = f"PRVAR,{nvar1},{nvar2},{nvar3},{nvar4},{nvar5},{nvar6}" + return self.run(command, **kwargs) diff --git a/src/ansys/mapdl/core/_commands/post26/operations.py b/src/ansys/mapdl/core/_commands/post26/operations.py new file mode 100644 index 00000000000..faab1cff9d1 --- /dev/null +++ b/src/ansys/mapdl/core/_commands/post26/operations.py @@ -0,0 +1,863 @@ +# Copyright (C) 2016 - 2025 ANSYS, Inc. and/or its affiliates. +# SPDX-License-Identifier: MIT +# +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to deal +# in the Software without restriction, including without limitation the rights +# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +# copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in all +# copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +# SOFTWARE. + + +class Operations: + + def abs( + self, ir: str = "", ia: str = "", name: str = "", facta: str = "", **kwargs + ): + r"""Forms the absolute value of a variable. + + Mechanical APDL Command: `ABS `_ + + Parameters + ---------- + ir : str + Arbitrary reference number assigned to the resulting variable (2 to NV ( :ref:`numvar` )). If + this number is the same as for a previously defined variable, the previously defined variable + will be overwritten with this result. + + ia : str + Reference number of the variable to be operated on. + + name : str + Thirty-two character name for identifying the variable on the printout and displays. Embedded + blanks are compressed upon output. + + facta : str + Scaling factor (positive or negative) applied to variable ``IA`` (defaults to 1.0). + + Notes + ----- + + .. _ABS_notes: + + The new variable is calculated as: + + IR = \| FACTA x IA \| + + For a complex number (a + i b), the absolute value is the magnitude, where the ``IA`` values are + obtained from: + + .. math:: + + equation not available + + See `POST26 - Data Operations + `_ + in the `Mechanical APDL Theory Reference + `_ for details. + """ + command = f"ABS,{ir},{ia},,,{name},,,{facta}" + return self.run(command, **kwargs) + + def add( + self, + ir: str = "", + ia: str = "", + ib: str = "", + ic: str = "", + name: str = "", + facta: str = "", + factb: str = "", + factc: str = "", + **kwargs, + ): + r"""Adds (sums) variables. + + Mechanical APDL Command: `ADD `_ + + Parameters + ---------- + ir : str + Arbitrary reference number assigned to the resulting variable (2 to NV ( :ref:`numvar` )). If + this number is the same as for a previously defined variable, the previously defined variable + will be overwritten with this result. + + ia : str + Reference numbers of the three variables to be operated on. If only two variables, leave ``IC`` + blank. If only one, leave ``IB`` and ``IC`` blank. + + ib : str + Reference numbers of the three variables to be operated on. If only two variables, leave ``IC`` + blank. If only one, leave ``IB`` and ``IC`` blank. + + ic : str + Reference numbers of the three variables to be operated on. If only two variables, leave ``IC`` + blank. If only one, leave ``IB`` and ``IC`` blank. + + name : str + Thirty-two character name for identifying the variable on the printout and displays. Embedded + blanks are compressed upon output. + + facta : str + Scaling factors (positive or negative) applied to the corresponding variables (default to 1.0). + + factb : str + Scaling factors (positive or negative) applied to the corresponding variables (default to 1.0). + + factc : str + Scaling factors (positive or negative) applied to the corresponding variables (default to 1.0). + + Notes + ----- + + .. _ADD_notes: + + Adds variables (up to three at once) according to the operation: + + ``IR`` = ( ``FACTA`` x ``IA`` ) + ( ``FACTB`` x ``IB`` ) + ( ``FACTC`` x ``IC`` ) + + """ + command = f"ADD,{ir},{ia},{ib},{ic},{name},,,{facta},{factb},{factc}" + return self.run(command, **kwargs) + + def atan( + self, ir: str = "", ia: str = "", name: str = "", facta: str = "", **kwargs + ): + r"""Forms the arctangent of a complex variable. + + Mechanical APDL Command: `ATAN `_ + + Parameters + ---------- + ir : str + Arbitrary reference number assigned to the resulting variable (2 to ``NV`` ( :ref:`numvar` )). + If this number is the same as for a previously defined variable, the previously defined variable + will be overwritten with this result. + + ia : str + Reference number of the complex variable to be operated on. + + name : str + Thirty-two character name for identifying the variable on the printout and displays. Embedded + blanks are compressed upon output. + + facta : str + Scaling factor (positive or negative) applied to variable ``IA`` (defaults to 1.0). Usually + ``FACTA`` should be set to 1. ``FACTA`` may affect the position of the angle by a multiple of π, + resulting in a quadrant change. + + Notes + ----- + + .. _ATAN_notes: + + Forms the arctangent of a complex variable according to the operation: + + ``IR`` = ATAN( ``FACTA`` X b / a ) + + where a and b are the real and imaginary parts, respectively, of the complex variable ``IA`` (which + is of the form a + i b ). The arctangent represents the phase angle (in radians), and is valid only + for a harmonic analysis ( :ref:`antype`,HARMIC). + + Since the scaling factor is applied uniformly to b / a, applying any positive or negative scaling + factor will not affect the size of the phase angle, with the exception that a negative scaling + factor will change the results quadrant by π. The magnitude of a complex number is still obtained + through the :ref:`abs` command. See `POST26 - Data Operations + `_ + in the `Mechanical APDL Theory Reference + `_ for details. + """ + command = f"ATAN,{ir},{ia},,,{name},,,{facta}" + return self.run(command, **kwargs) + + def clog( + self, + ir: str = "", + ia: str = "", + name: str = "", + facta: str = "", + factb: str = "", + **kwargs, + ): + r"""Forms the common log of a variable + + Mechanical APDL Command: `CLOG `_ + + Parameters + ---------- + ir : str + Arbitrary reference number assigned to the resulting variable (2 to NV ( :ref:`numvar` )). If + this number is the same as for a previously defined variable, the previously defined variable + will be overwritten with this result. + + ia : str + Reference number of the variable to be operated on. + + name : str + Thirty-two character name for identifying the variable on printouts and displays. Embedded + blanks are compressed for output. + + facta : str + Scaling factor applied to variable ``IA`` (defaults to 1.0). + + factb : str + Scaling factor (positive or negative) applied to the operation (defaults to 1.0). + + Notes + ----- + + .. _CLOG_notes: + + Forms the common log of a variable according to the operation: + + ``IR`` = ``FACTB`` \*LOG( ``FACTA`` x ``IA`` ) + """ + command = f"CLOG,{ir},{ia},,,{name},,,{facta},{factb}" + return self.run(command, **kwargs) + + def conjug( + self, ir: str = "", ia: str = "", name: str = "", facta: str = "", **kwargs + ): + r"""Forms the complex conjugate of a variable. + + Mechanical APDL Command: `CONJUG `_ + + Parameters + ---------- + ir : str + Arbitrary reference number assigned to the resulting variable (2 to NV ( :ref:`numvar` )). If + this number is the same as for a previously defined variable, the previously defined variable + will be overwritten with this result. + + ia : str + Reference number of the variable to be operated on. + + name : str + Thirty-two character name for identifying the variable on printouts and displays. Embedded + blanks are compressed for output. + + facta : str + Scaling factor (positive or negative) applied to variable (default to 1.0). + + Notes + ----- + + .. _CONJUG_notes: + + Used only with harmonic analyses ( :ref:`antype`,HARMIC). + """ + command = f"CONJUG,{ir},{ia},,,{name},,,{facta}" + return self.run(command, **kwargs) + + def deriv( + self, + ir: str = "", + iy: str = "", + ix: str = "", + name: str = "", + facta: str = "", + **kwargs, + ): + r"""Differentiates a variable. + + Mechanical APDL Command: `DERIV `_ + + Parameters + ---------- + ir : str + Arbitrary reference number assigned to the resulting variable (2 to NV ( :ref:`numvar` )). If + this number is the same as for a previously defined variable, the previously defined variable + will be overwritten with this result. + + iy : str + Reference numbers of variables to be operated on. ``IY`` is differentiated with respect to + ``IX``. + + ix : str + Reference numbers of variables to be operated on. ``IY`` is differentiated with respect to + ``IX``. + + name : str + Thirty-two character name for identifying the variable on printouts and displays. Embedded + blanks are compressed for output. + + facta : str + Scaling factor (positive or negative) applied as shown below (defaults to 1.0). + + Notes + ----- + + .. _DERIV_notes: + + Differentiates variables according to the operation: + + ``IR`` = ``FACTA`` x d( ``IY`` )/d( ``IX`` ) + + Variable ``IX`` must be in ascending order. + """ + command = f"DERIV,{ir},{iy},{ix},,{name},,,{facta}" + return self.run(command, **kwargs) + + def exp( + self, + ir: str = "", + ia: str = "", + name: str = "", + facta: str = "", + factb: str = "", + **kwargs, + ): + r"""Forms the exponential of a variable. + + Mechanical APDL Command: `EXP `_ + + Parameters + ---------- + ir : str + Arbitrary reference number assigned to the resulting variable (2 to NV ( :ref:`numvar` )). If + this number is the same as for a previously defined variable, the previously defined variable + will be overwritten with this result. + + ia : str + Reference number of the variable to be operated on. + + name : str + Thirty-two character name for identifying the variable on the printout and displays. Embedded + blanks are compressed upon output. + + facta : str + Scaling factor applied to variable ``IA`` (defaults to 1.0). + + factb : str + Scaling factor (positive or negative) applied to the operation (defaults to 1.0). + + Notes + ----- + + .. _EXP_notes: + + Forms the exponential of a variable according to the operation: + + ``IR`` = ``FACTB`` \*EXP( ``FACTA`` x ``IA`` ) + + """ + command = f"EXP,{ir},{ia},,,{name},,,{facta},{factb}" + return self.run(command, **kwargs) + + def filldata( + self, + ir: str = "", + lstrt: str = "", + lstop: str = "", + linc: str = "", + value: str = "", + dval: str = "", + **kwargs, + ): + r"""Fills a variable by a ramp function. + + Mechanical APDL Command: `FILLDATA `_ + + Parameters + ---------- + ir : str + Define data table as variable ``IR`` (2 to ``NV`` ( :ref:`numvar` )). + + lstrt : str + Start at location ``LSTRT`` (defaults to 1). + + lstop : str + Stop at location ``LSTOP`` (defaults to maximum location as determined from data previously + stored. + + linc : str + Fill every ``LINC`` location between ``LSTRT`` and ``LSTOP`` (defaults to 1). + + value : str + Value assigned to location ``LSTRT``. + + dval : str + Increment value of previous filled location by ``DVAL`` and assign sum to next location to be + filled (may be positive or negative.) + + Notes + ----- + + .. _FILLDATA_notes: + + Locations may be filled continuously or at regular intervals ( ``LINC`` ). Previously defined data + at a location will be overwritten. + """ + command = f"FILLDATA,{ir},{lstrt},{lstop},{linc},{value},{dval}" + return self.run(command, **kwargs) + + def imagin( + self, ir: str = "", ia: str = "", name: str = "", facta: str = "", **kwargs + ): + r"""Forms an imaginary variable from a complex variable. + + Mechanical APDL Command: `IMAGIN `_ + + Parameters + ---------- + ir : str + Arbitrary reference number assigned to the resulting variable (2 to ``NV`` ( :ref:`numvar` )). + If this number is the same as for a previously defined variable, the previously defined variable + will be overwritten with this result. + + ia : str + Reference number of the variable to be operated on. + + name : str + Thirty-two character name for identifying the variable on the printout and displays. Embedded + blanks are compressed upon output. + + facta : str + Scaling factor (positive or negative) applied to variable ``IA`` (defaults to 1.0). + + Notes + ----- + + .. _IMAGIN_notes: + + This command forms a new variable from a complex variable by storing the imaginary part as the real + part. The imaginary part can then be used in other operations. Used only with harmonic analyses ( + :ref:`antype`,HARMIC). + + Complex variables are stored in two-column arrays with the real component stored in the first column + and the imaginary component stored in the second column. This command extracts the value stored in + the second column (that is, imaginary component). However, with harmonic analyses, all variables are + stored in two-column arrays as complex variables. If the variable is not complex, then the same + value is stored in both columns. This command will extract the variable in the second column of the + array, even if this variable is not the imaginary component of a complex variable. + """ + command = f"IMAGIN,{ir},{ia},,,{name},,,{facta}" + return self.run(command, **kwargs) + + def int1( + self, + ir: str = "", + iy: str = "", + ix: str = "", + name: str = "", + facta: str = "", + factb: str = "", + const: str = "", + **kwargs, + ): + r"""Integrates a variable. + + Mechanical APDL Command: `INT1 `_ + + Parameters + ---------- + ir : str + Arbitrary reference number assigned to the resulting variable (2 to ``NV`` ( :ref:`numvar` )). + If this number is the same as for a previously defined variable, the previously defined variable + will be overwritten with this result. Table values represent integrated sum of ``IY`` to current + table position of ``IX``. + + iy : str + Integrate variable ``IY`` with respect to ``IX``. + + ix : str + Integrate variable ``IY`` with respect to ``IX``. + + name : str + Thirty-two character name for identifying the variable on the printout and displays. Embedded + blanks are compressed upon output. + + facta : str + Scaling factors (positive or negative) applied to the corresponding variables (default to 1.0). + + factb : str + Scaling factors (positive or negative) applied to the corresponding variables (default to 1.0). + + const : str + Initial value. + + Notes + ----- + + .. _INT1_notes: + + Integrates variables according to the operation: + + ``IR`` = ∫ ( ``FACTA`` x ``IY`` ) d( ``FACTB`` x ``IX`` ) + ``CONST`` + + """ + command = f"INT1,{ir},{iy},{ix},,{name},,,{facta},{factb},{const}" + return self.run(command, **kwargs) + + def large( + self, + ir: str = "", + ia: str = "", + ib: str = "", + ic: str = "", + name: str = "", + facta: str = "", + factb: str = "", + factc: str = "", + **kwargs, + ): + r"""Finds the largest (the envelope) of three variables. + + Mechanical APDL Command: `LARGE `_ + + Parameters + ---------- + ir : str + Arbitrary reference number assigned to the resulting variable (2 to ``NV`` ( :ref:`numvar` )). + If this number is the same as for a previously defined variable, the previously defined variable + will be overwritten with this result. + + ia : str + Reference numbers of the three variables to be operated on. If only two, leave ``IC`` blank. If + only one, leave ``IB`` blank also. + + ib : str + Reference numbers of the three variables to be operated on. If only two, leave ``IC`` blank. If + only one, leave ``IB`` blank also. + + ic : str + Reference numbers of the three variables to be operated on. If only two, leave ``IC`` blank. If + only one, leave ``IB`` blank also. + + name : str + Thirty-two character name for identifying the variable on the printout and displays. Embedded + blanks are compressed upon output. + + facta : str + Scaling factors (positive or negative) applied to the corresponding variables (default to 1.0). + + factb : str + Scaling factors (positive or negative) applied to the corresponding variables (default to 1.0). + + factc : str + Scaling factors (positive or negative) applied to the corresponding variables (default to 1.0). + + Notes + ----- + + .. _LARGE_notes: + + Creates a new variable by finding the largest of up to three variables according to the operation: + + ``IR`` = Largest of ( ``FACTA`` x ``IA``, ``FACTB`` x ``IB``, ``FACTC`` x ``IC`` ) + + The comparison is done at each time location, so that the new variable is the "envelope" of the + three existing variables. + """ + command = f"LARGE,{ir},{ia},{ib},{ic},{name},,,{facta},{factb},{factc}" + return self.run(command, **kwargs) + + def nlog( + self, + ir: str = "", + ia: str = "", + name: str = "", + facta: str = "", + factb: str = "", + **kwargs, + ): + r"""Forms the natural log of a variable. + + Mechanical APDL Command: `NLOG `_ + + Parameters + ---------- + ir : str + Arbitrary reference number assigned to the resulting variable (2 to NV ( :ref:`numvar` )). If + this number is the same as for a previously defined variable, the previously defined variable + will be overwritten with this result. + + ia : str + Reference number of the variable to be operated on. + + name : str + Thirty-two character name identifying the variable on printouts and displays. Embedded blanks + are compressed for output. + + facta : str + Scaling factor applied to variable ``IA`` (defaults to 1.0). + + factb : str + Scaling factor (positive or negative) applied to the operation (defaults to 1.0). + + Notes + ----- + + .. _NLOG_notes: + + Forms the natural log of a variable according to the operation: + + ``IR`` = ``FACTB`` \*LN( ``FACTA`` x ``IA`` ) + + """ + command = f"NLOG,{ir},{ia},,,{name},,,{facta},{factb}" + return self.run(command, **kwargs) + + def prod( + self, + ir: str = "", + ia: str = "", + ib: str = "", + ic: str = "", + name: str = "", + facta: str = "", + factb: str = "", + factc: str = "", + **kwargs, + ): + r"""Multiplies variables. + + Mechanical APDL Command: `PROD `_ + + Parameters + ---------- + ir : str + Arbitrary reference number assigned to the resulting variable (2 to NV ( :ref:`numvar` )). If + this number is the same as for a previously defined variable, the previously defined variable + will be overwritten with this result. + + ia : str + Reference numbers of the three variables to be operated on. If only two leave ``IC`` blank. If + only one, leave ``IB`` blank also. + + ib : str + Reference numbers of the three variables to be operated on. If only two leave ``IC`` blank. If + only one, leave ``IB`` blank also. + + ic : str + Reference numbers of the three variables to be operated on. If only two leave ``IC`` blank. If + only one, leave ``IB`` blank also. + + name : str + Thirty-two character name identifying the variable on printouts and displays. Embedded blanks + are compressed for output. + + facta : str + Scaling factors (positive or negative) applied to the corresponding variables (default to 1.0). + + factb : str + Scaling factors (positive or negative) applied to the corresponding variables (default to 1.0). + + factc : str + Scaling factors (positive or negative) applied to the corresponding variables (default to 1.0). + + Notes + ----- + + .. _PROD_notes: + + Multiplies variables (up to three at once) according to the operation: + + ``IR`` = ( ``FACTA`` x ``IA`` ) x ( ``FACTB`` x ``IB`` ) x ( ``FACTC`` x ``IC`` ) + + """ + command = f"PROD,{ir},{ia},{ib},{ic},{name},,,{facta},{factb},{factc}" + return self.run(command, **kwargs) + + def quot( + self, + ir: str = "", + ia: str = "", + ib: str = "", + name: str = "", + facta: str = "", + factb: str = "", + **kwargs, + ): + r"""Divides two variables. + + Mechanical APDL Command: `QUOT `_ + + Parameters + ---------- + ir : str + Arbitrary reference number assigned to the resulting variable (2 to ``NV`` ( :ref:`numvar` )). + If this number is the same as for a previously defined variable, the previously defined variable + will be overwritten with this result. + + ia : str + Reference numbers of the two variables to be operated on. + + ib : str + Reference numbers of the two variables to be operated on. + + name : str + Thirty-two character name identifying the variable on printouts and displays. Embedded blanks + are compressed for output. + + facta : str + Scaling factors (positive or negative) applied to the corresponding variables (default to 1.0). + + factb : str + Scaling factors (positive or negative) applied to the corresponding variables (default to 1.0). + + Notes + ----- + + .. _QUOT_notes: + + Divides two variables according to the operation: + + ``IR`` = ( ``FACTA`` x ``IA`` )/( ``FACTB`` x ``IB`` ) + + """ + command = f"QUOT,{ir},{ia},{ib},,{name},,,{facta},{factb}" + return self.run(command, **kwargs) + + def realvar( + self, ir: str = "", ia: str = "", name: str = "", facta: str = "", **kwargs + ): + r"""Forms a variable using only the real part of a complex variable. + + Mechanical APDL Command: `REALVAR `_ + + Parameters + ---------- + ir : str + Arbitrary reference number assigned to the resulting variable (2 to NV ( :ref:`numvar` )). If + this number is the same as for a previously defined variable, the previously defined variable + will be overwritten with this result. + + ia : str + Reference number of the variable to be operated on. + + name : str + Thirty-two character name identifying the variable on printouts and displays. Embedded blanks + are compressed for output. + + facta : str + Scaling factor (positive or negative) applied to variable ``IA`` (defaults to 1.0). + + Notes + ----- + + .. _REALVAR_notes: + + Forms a variable using only the real part of a variable. Used only with harmonic analyses ( + :ref:`antype`,HARMIC). + + Complex variables are stored in two-column arrays with the real component stored in the first column + and the imaginary component stored in the second column. This command extracts the value stored in + the first column (that is, real component). However with harmonic analyses, all variables are stored + in two-column arrays as complex variables. If the variable is not complex, then the same value is + stored in both columns. This command will extract the variable in the first column of the array, + even if this variable is not the real component of a complex variable. + """ + command = f"REALVAR,{ir},{ia},,,{name},,,{facta}" + return self.run(command, **kwargs) + + def small( + self, + ir: str = "", + ia: str = "", + ib: str = "", + ic: str = "", + name: str = "", + facta: str = "", + factb: str = "", + factc: str = "", + **kwargs, + ): + r"""Finds the smallest of three variables. + + Mechanical APDL Command: `SMALL `_ + + Parameters + ---------- + ir : str + Arbitrary reference number assigned to the resulting variable (2 to ``NV`` ( :ref:`numvar` )). + If this number is the same as for a previously defined variable, the previously defined variable + will be overwritten with this result. + + ia : str + Reference numbers of the three variables to be operated on. If only two, leave ``IC`` blank. If + only one, leave ``IB`` blank also. + + ib : str + Reference numbers of the three variables to be operated on. If only two, leave ``IC`` blank. If + only one, leave ``IB`` blank also. + + ic : str + Reference numbers of the three variables to be operated on. If only two, leave ``IC`` blank. If + only one, leave ``IB`` blank also. + + name : str + Thirty-two character name identifying the variable on printouts and displays. Embedded blanks + are compressed for output. + + facta : str + Scaling factors (positive or negative) applied to the corresponding variables (defaults to 1.0). + + factb : str + Scaling factors (positive or negative) applied to the corresponding variables (defaults to 1.0). + + factc : str + Scaling factors (positive or negative) applied to the corresponding variables (defaults to 1.0). + + Notes + ----- + + .. _SMALL_notes: + + Finds the smallest of three variables according to the operation: + + ``IR`` = smallest of ( ``FACTA`` x ``IA``, ``FACTB`` x ``IB``, ``FACTC`` x ``IC`` ) + + """ + command = f"SMALL,{ir},{ia},{ib},{ic},{name},,,{facta},{factb},{factc}" + return self.run(command, **kwargs) + + def sqrt( + self, ir: str = "", ia: str = "", name: str = "", facta: str = "", **kwargs + ): + r"""Forms the square root of a variable. + + Mechanical APDL Command: `SQRT `_ + + Parameters + ---------- + ir : str + Arbitrary reference number assigned to the resulting variable (2 to ``NV`` ( :ref:`numvar` )). + If this number is the same as for a previously defined variable, the previously defined variable + will be overwritten with this result. + + ia : str + Reference number of the variable to be operated on. + + name : str + Thirty-two character name identifying the variable on printouts and displays. Embedded blanks + are compressed for output. + + facta : str + Scaling factor (positive or negative) applied to variable ``IA`` (defaults to 1.0). + + Notes + ----- + + .. _SQRT_notes: + + Forms the square root of a variable according to the operation: + + .. math:: + + equation not available + """ + command = f"SQRT,{ir},{ia},,,{name},,,{facta}" + return self.run(command, **kwargs) diff --git a/src/ansys/mapdl/core/_commands/post26/set_up.py b/src/ansys/mapdl/core/_commands/post26/set_up.py new file mode 100644 index 00000000000..80d4e3ec26e --- /dev/null +++ b/src/ansys/mapdl/core/_commands/post26/set_up.py @@ -0,0 +1,1667 @@ +# Copyright (C) 2016 - 2025 ANSYS, Inc. and/or its affiliates. +# SPDX-License-Identifier: MIT +# +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to deal +# in the Software without restriction, including without limitation the rights +# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +# copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in all +# copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +# SOFTWARE. + + +class SetUp: + + def ansol( + self, + nvar: str = "", + node: str = "", + item: str = "", + comp: str = "", + name: str = "", + mat: str = "", + real: str = "", + ename: str = "", + datakey: str = "", + **kwargs, + ): + r"""Specifies averaged element nodal data to be stored from the results file. + + Mechanical APDL Command: `ANSOL `_ + + Parameters + ---------- + nvar : str + Arbitrary reference number assigned to this variable (2 to ``NV`` ( :ref:`numvar` )). Overwrites + any existing results for this variable. + + node : str + Node number for which data are to be stored. + + item : str + Label identifying the item. General item labels are shown in :ref:`ANSOL_tab_1` below. Some + items also require a component label. + + comp : str + Component of the item (if required). General component labels are shown in :ref:`ANSOL_tab_1`. + Selected result components ( ``Item`` = SRES) are shown in :ref:`ANSOL_tab_2`. + + name : str + 32-character name to identify the item on the printout and displays. Default: An eight-character + label formed by concatenating the first four characters of the ``Item`` and ``Comp`` labels. + + mat : str + Material number. Average is calculated based on the subset of elements with the specified + material number. Default: Use all elements in the active set unless ``Real`` and/or ``Ename`` is + specified. + + real : str + Real number. Average is calculated based on the subset of elements with the specified real + number. Default: Use all elements in the active set unless ``Mat`` and/or ``Ename`` is + specified. + + ename : str + Element type name. Average is calculated based on the subset of elements with the specified + element type name. Default: Use all elements in the active set unless ``Mat`` and/or ``Real`` is + specified. + + datakey : str + Key to specify which data is stored: + + * ``AUTO`` - `Nodal-averaged results + `_ are + used if they are available for the first applicable time step; otherwise, the element-based data is + used, if available. (Default.) + + * ``ESOL`` - Only element-based results are used. If they are not available, the command is ignored. + + * ``NAR`` - Only nodal-averaged results are used. If they are not available, the command is ignored. + + ``Mat``, ``Real``, and ``Ename`` are ignored when nodal-averaged results are used. + + Notes + ----- + + .. _ANSOL_notes: + + Valid item and component labels for element nodal results are listed in :ref:`ANSOL_tab_1`. + + :ref:`ansol` defines element nodal results data to be stored from a results file ( ``FILE`` ). Not + all items are valid for all nodes. See the input and output summary tables of each element attached + to the node for the available items. + + If `nodal-averaged results + `_ ( + :ref:`outres`,NAR or another nodal-averaged label) are available, then :ref:`ansol` uses the nodal- + averaged data for the applicable items (S, EPEL, EPPL, EPCR, EPTH) as dictated by the by ``DataKey`` + argument. By default, ( ``DataKey`` = AUTO), the availability of nodal-averaged results or element- + based data is determined at the first load step that has results for the associated item. For more + information, see `Postprocessing Nodal-Averaged Results + `_ + + **Coordinate systems:** Generally, element nodal quantities stored by :ref:`ansol` are obtained in + the solution coordinate system ( :ref:`rsys`, SOLU) and then averaged. There are some exceptions as + listed below. :ref:`ansol` does not transform results from :ref:`rsys`,SOLU (or from the coordinate + systems described for the exceptions below) to other coordinate systems. Verify that all elements + attached to the subject node have the same coordinate system before using :ref:`ansol`. + + * Layered element results are in the layer coordinate system ( :ref:`rsys`,LSYS). You can further + specify the element nodal results, for some elements, with the :ref:`shell`, :ref:`layerp26`, and + :ref:`force` commands. + + * When :ref:`ansol` is used to store nodal-averaged result data (based on the ``DataType`` setting), + the global Cartesian coordinate system ( :ref:`rsys`,0) is used. + + **Shell elements:** The default shell element coordinate system is based on node ordering. For shell + elements the + adjacent elements could have a different :ref:`rsys`,SOLU, making the resultant averaged data + inconsistent. A message to this effect is issued when :ref:`ansol` is used in models containing + shell elements. Ensure that consistent coordinate systems are active for all associated elements + used by the :ref:`ansol` command. + + **Derived quantities:** Some of the result items supported by :ref:`ansol` ( :ref:`ANSOL_tab_1` ) + are derived from the component quantities. Issue :ref:`avprin` to specify the principal and vector + sum quantity averaging methods. + + **Default:** If ``Mat``, ``Real``, and ``Ename`` are not specified, all elements attached to the + node are considered. When a material ID, real constant ID, or element-type discontinuity is detected + at a node, a message is issued. For example, in a FSI analysis, a ``FLUID30`` element at the + structure interface would be considered; however, because it contains no SX result, it is not used + during :ref:`store` operations. + + .. _ANSOL_tab_1: + + ANSOL - General Result Item and Component Labels + ************************************************ + + .. flat-table:: General Item and Component Labels :ref:`ansol`, ``NVAR,NODE,Item,Comp,Name,Mat,Real,Ename,DataType`` + :header-rows: 1 + + * - Item + - Comp + - Description + * - :rspan:`3` S + - X, Y, Z, XY, YZ, XZ + - Component stress. This item stores `nodal-averaged results `_ if they are available on the results file. + * - 1, 2, 3 + - Principal stress. + * - INT + - Stress intensity. + * - EQV + - Equivalent stress. + * - :rspan:`3` EPEL + - X, Y, Z, XY, YZ, XZ + - Component elastic strain. + * - 1, 2, 3 + - Principal elastic strain. + * - INT + - Elastic strain intensity. + * - EQV + - Elastic equivalent strain. + * - :rspan:`3` EPPL + - X, Y, Z, XY, YZ, XZ + - Component plastic strain. + * - 1, 2, 3 + - Principal plastic strain. + * - INT + - Plastic strain intensity. + * - EQV + - Plastic equivalent strain. + * - :rspan:`3` EPCR + - X, Y, Z, XY, YZ, XZ + - Component creep strain. + * - 1,2,3 + - Principal creep strain. + * - INT + - Creep strain intensity. + * - EQV + - Creep equivalent strain. + * - :rspan:`3` EPTH + - X, Y, Z, XY, YZ, XZ + - Component thermal strain. + * - 1, 2, 3 + - Principal thermal strain. + * - INT + - Thermal strain intensity. + * - EQV + - Thermal equivalent strain. + * - :rspan:`3` ESIG + - X, Y, Z, XY, YZ, XZ + - Components of Biot``s effective stress. + * - 1, 2, 3 + - Principal stresses of Biot's effective stress. + * - INT + - Stress intensity of Biot's effective stress. + * - EQV + - Equivalent stress of Biot's effective stress. + * - :rspan:`6` NL + - SEPL + - Equivalent stress (from stress-strain curve). + * - SRAT + - Stress state ratio. + * - HPRES + - Hydrostatic pressure. + * - EPEQ + - Accumulated equivalent plastic strain. + * - CREQ + - Accumulated equivalent creep strain. + * - PSV + - Plastic state variable. + * - PLWK + - Plastic work/volume. + * - :rspan:`9` CONT + - STAT For more information about the meaning of contact status and its possible values, see `Reviewing Results in POST1 `_ + - Contact status. + * - PENE + - Contact penetration. + * - PRES + - Contact pressure. + * - SFRIC + - Contact friction stress. + * - STOT + - Contact total stress (pressure plus friction). + * - SLIDE + - Contact sliding distance. + * - GAP + - Contact gap distance. + * - FLUX + - Total heat flux at contact surface. + * - CNOS + - Total number of contact status changes during substep. + * - FPRS + - Fluid penetration pressure. + * - TG + - X, Y, Z, SUM ``Comp`` = SUM is not supported for coupled pore-pressure-thermal (CPT ``nnn`` ) elements. + - Component thermal gradient or vector sum. + * - TF + - X, Y, Z, SUM + - Component thermal flux or vector sum. + * - PG + - X, Y, Z, SUM + - Component pressure gradient or vector sum. + * - EF + - X, Y, Z, SUM + - Component electric field or vector sum. + * - D + - X, Y, Z, SUM + - Component electric flux density or vector sum. + * - H + - X, Y, Z, SUM + - Component magnetic field intensity or vector sum. + * - B + - X, Y, Z, SUM + - Component magnetic flux density or vector sum. + * - CG + - X, Y, Z, SUM + - Component concentration gradient or vector sum. + * - DF + - X, Y, Z, SUM + - Component diffusion flux density or vector sum. + * - JC + - X, Y, Z, SUM + - Conduction current density for elements that support conduction current calculation. Components (X, Y, Z) and vector sum (SUM). + * - FFLX + - X, Y, Z + - Fluid-flow flux in poromechanics. + * - FGRA + - X, Y, Z + - Fluid pore-pressure gradient in poromechanics. + * - PMSV + - VRAT, PPRE, DSAT, RPER + - Void volume ratio, pore pressure, degree of saturation, and relative permeability for coupled pore-pressure-thermal elements. + * - NS + - X, Y, Z, XY, YZ, XZ + - `Nominal strain `_ for hyperelastic material, reported in the current configuration (unaffected by :ref:`rsys` ). + * - MPLA + - DMAC, DMAX + - Microplane damage, macroscopic and maximum values. + * - MPDP + - TOTA, TENS, COMP, RW + - Microplane homogenized total, tension, and compression damages (TOTA, TENS, COMP), and split weight factor (RW). + * - EPFR + - + - Free strain in porous media + * - DAMAGE + - 1,2,3,MAX + - Damage in directions 1, 2, 3 (1, 2, 3) and the maximum damage (MAX). + * - GDMG + - + - Damage + * - IDIS + - + - Structural-thermal dissipation rate + + + .. _ANSOL_tab_2: + + ANSOL - Selected Result Component Labels + **************************************** + + .. flat-table:: Selected Result Component Labels :ref:`ansol`, ``NVAR``, ``NODE``,SRES, ``Comp``, ``Name``, ``Mat``, ``Real``, ``Ename`` + :header-rows: 1 + + * - Comp + - Description + * - SVAR ``n`` + - The ``n`` th state variable. + * - FLDUF0 ``n`` + - The ``n`` th user-defined field variable. + + """ + command = ( + f"ANSOL,{nvar},{node},{item},{comp},{name},{mat},{real},{ename},{datakey}" + ) + return self.run(command, **kwargs) + + def cisol( + self, + n: str = "", + id_: str = "", + node: str = "", + cont: str = "", + dtype: str = "", + **kwargs, + ): + r"""Stores fracture parameter information in a variable. + + Mechanical APDL Command: `CISOL `_ + + Parameters + ---------- + n : str + Arbitrary reference number or name assigned to this variable. Number must be >1 but `_ + + Parameters + ---------- + ir : str + Arbitrary reference number assigned to the resulting variable (2 to NV ( :ref:`numvar` )). If + this number is the same as for a previously defined variable, the previously defined variable + will be overwritten with this result. + + lstrt : str + Start at location ``LSTRT`` (defaults to 1). + + lstop : str + Stop at location ``LSTOP`` (defaults to ``LSTRT`` ). Maximum location available is determined + from data previously stored. + + linc : str + Fill every ``LINC`` location between ``LSTRT`` and ``LSTOP`` (defaults to 1). + + name : str + Eight character name for identifying the variable on the printout and displays. Embedded blanks + are compressed upon output. + + kcplx : int or str + Complex number key: + + * ``0`` - Data stored as the real part of the complex number. + + * ``1`` - Data stored as the imaginary part of the complex number. + + Notes + ----- + + .. _DATA_notes: + + This command must be followed by a format statement (on the next line) and the subsequent data + records, and all must be on the same file (that may then be read with the :ref:`input` command). The + format specifies the number of fields to be read per record, the field width, and the placement of + the decimal point (if one is not included in the data value). The read operation follows the + available FORTRAN FORMAT conventions of the system. See the system FORTRAN manual for details. Any + standard FORTRAN real format (such as (4F6.0), (F2.0,2X,F12.0), etc.) may be used. Integer (I), + character (A), and list-directed (\2) descriptors may not be used. The parentheses must be included + in the format. Up to 80 columns per record may be read. Locations may be filled within a range. + Previous data in the range will be overwritten. + """ + command = f"DATA,{ir},{lstrt},{lstop},{linc},{name},{kcplx}" + return self.run(command, **kwargs) + + def enersol(self, nvar: str = "", item: str = "", name: str = "", **kwargs): + r"""Specifies the total energies to be stored. + + Mechanical APDL Command: `ENERSOL `_ + + Parameters + ---------- + nvar : str + Arbitrary reference number assigned to this variable (2 to NV). + + item : str + + * ``SENE`` - Potential energy (stiffness energy) + + * ``KENE`` - Kinetic energy + + * ``DENE`` - Damping energy + + * ``WEXT`` - Work done by external load + + * ``AENE`` - Artificial energy due to hourglass control/drill stiffness or due to contact + stabilization damping + + * ``STEN`` - Artificial energy due to nonlinear stabilization + + name : str + A 32-character name identifying the item on printouts and displays. Defaults to a 4-character + label formed by the four characters of the ``Item`` value. + + Notes + ----- + + .. _ENERSOL_Notes: + + Damping energy (DENE) and work done by external loads (WEXT) are available only if the following + were set prior to the analysis solution: ``EngCalc`` = YES on the :ref:`trnopt`, :ref:`hrout` or + :ref:`mxpand` command; and ``Item`` = VENG, ESOL, or ALL on the :ref:`outres` command. + + If ``EngCalc`` = YES on the :ref:`hrout` or :ref:`mxpand` command, ``Item`` = SENE and KENE are the + average potential and kinetic energies, respectively. + """ + command = f"ENERSOL,{nvar},{item},,{name}" + return self.run(command, **kwargs) + + def esol( + self, + nvar: str = "", + elem: str = "", + node: str = "", + item: str = "", + comp: str = "", + name: str = "", + **kwargs, + ): + r"""Specifies element data to be stored from the results file. + + Mechanical APDL Command: `ESOL `_ + + Parameters + ---------- + nvar : str + Arbitrary reference number assigned to this variable (2 to ``NV`` ( :ref:`numvar` )). Overwrites + any existing results for this variable. + + elem : str + Element for which data are to be stored. If ``ELEM`` = P, graphical picking is enabled (valid + only in the GUI). + + node : str + Node number on this element for which data are to be stored. If blank, store the average element + value (except for ``FMAG`` values, which are summed instead of averaged). If ``NODE`` = P, + graphical picking is enabled (valid only in the GUI). + + item : str + Label identifying the item. General item labels are shown in :ref:`ESOL_tab_1`. Some items also + require a component label. + + comp : str + Component of the item (if required). General component labels are shown in :ref:`ESOL_tab_1` + below. If ``Comp`` is a sequence number ( ``n`` ), the ``NODE`` field is ignored. + + name : str + 32-character name for identifying the item on the printout and displays. Defaults to a label + formed by concatenating the first four characters of the ``Item`` and ``Comp`` labels. + + Notes + ----- + + .. _ESOL_notes: + + See :ref:`ESOL_tab_1` for a list of item and component labels for element (excluding line element) + results. See :ref:`ESOL_tab_2` for a list of valid selected result ( ``Item`` = SRES) components. + + :ref:`esol` defines element results data to be stored from a results file ( ``FILE`` ). Not all + items are valid for all elements. To see the available items for a given element, refer to the input + and output summary tables in the documentation for that element. + + Two methods of data access are available via the :ref:`esol` command. You can access some data by + using a generic label ( component name method ), while others require a label and number ( sequence + number method ). + + Use the component name method to access general element data (that is, element data generally + available to most element types or groups of element types). Element results are in the element + coordinate system, except for layered elements where results are in the layer coordinate system. + Element forces and moments are in the nodal coordinate system. Results are obtainable for an element + at a specified node. Further location specifications can be made for some elements via :ref:`shell`, + :ref:`layerp26`, and :ref:`force`. + + The sequence number method is required for data that is not averaged (such as pressures at nodes and + temperatures at integration points), or data that is not easily described generically (such as all + derived data for structural line elements and contact elements, all derived data for thermal line + elements, and layer data for layered elements). + + In a `2D to 3D analysis + `_, this + command not supported in the POST26 postprocessor and is ignored. + + .. _ESOL_tab_1: + + ESOL - General Result Item and Component Labels + *********************************************** + + .. flat-table:: Component Name Method + :header-rows: 1 + + * - Item + - Comp + - Description + * - :rspan:`3` S + - X, Y, Z, XY, YZ, XZ + - Component stress. + * - 1, 2, 3 + - Principal stress. + * - INT + - Stress intensity. + * - EQV + - Equivalent stress. + * - :rspan:`3` EPEL + - X, Y, Z, XY, YZ, XZ + - Component elastic strain. + * - 1, 2, 3 + - Principal elastic strain. + * - INT + - Elastic strain intensity. + * - EQV + - Elastic equivalent strain. + * - :rspan:`3` EPTH + - X, Y, Z, XY, YZ, XZ + - Component thermal strain. + * - 1, 2, 3 + - Principal thermal strain. + * - INT + - Thermal strain intensity. + * - EQV + - Thermal equivalent strain. + * - :rspan:`3` EPPL + - X, Y, Z, XY, YZ, XZ + - Component plastic strain. + * - 1, 2, 3 + - Principal plastic strain. + * - INT + - Plastic strain intensity. + * - EQV + - Plastic equivalent strain. + * - :rspan:`3` EPCR + - X, Y, Z, XY, YZ, XZ + - Component creep strain. + * - 1,2,3 + - Principal creep strain. + * - INT + - Creep strain intensity. + * - EQV + - Creep equivalent strain. + * - :rspan:`3` EPDI + - X, Y, Z, XY, YZ, XZ + - Component diffusion strain. + * - 1, 2, 3 + - Principal diffusion strain. + * - INT + - Diffusion strain intensity. + * - EQV + - Diffusion equivalent strain. + * - :rspan:`6` NL + - SEPL + - Equivalent stress (from stress-strain curve). + * - SRAT + - Stress state ratio. + * - HPRES + - Hydrostatic pressure. + * - EPEQ + - Accumulated equivalent plastic strain. + * - CREQ + - Accumulated equivalent creep strain. + * - PSV + - Plastic state variable. + * - PLWK + - Plastic work/volume. + * - :rspan:`7` SEND + - ELASTIC The results for this postprocessing SEND component are invalid for ``ELBOW290`` if that element is used with viscoelastic or viscohyperelastic materials. + - Elastic strain energy density. (For `viscoelastic `_ and `sintering `_ materials, the `stored energy `_.) + * - PLASTIC + - Plastic strain energy density. + * - CREEP + - Creep strain energy density. + * - DAMAGE + - Damage strain energy density. + * - VDAM + - Viscoelastic dissipation energy density. + * - VREG + - Visco-regularization strain energy density. + * - DISS + - Structural-thermal dissipation. + * - ENTO + - Total strain energy density (sum of ELASTIC, PLASTIC, and CREEP strain energy densities). + * - :rspan:`1` CDM + - DMG + - Damage variable. + * - LM + - Maximum previous strain energy for virgin material. + * - GKS + - X + - Gasket component stress (also gasket pressure). + * - GKD + - X + - Gasket component total closure. + * - GKDI + - X + - Gasket component total inelastic closure. + * - GKTH + - X + - Gasket component thermal closure. + * - SS + - X, XY, XZ + - Interface traction (stress). + * - SD + - X,XY,XZ + - Interface separation. + * - :rspan:`9` CONT + - STAT For more information about the meaning of contact status and its possible values, see `Reviewing Results in POST1 `_ + - Contact status. + * - PENE + - Contact penetration. + * - PRES + - Contact pressure. + * - SFRIC + - Contact friction stress. + * - STOT + - Contact total stress (pressure plus friction). + * - SLIDE + - Contact sliding distance. + * - GAP + - Contact gap distance. + * - FLUX + - Total heat flux at contact surface. + * - CNOS + - Total number of contact status changes during substep. + * - FPRS + - Fluid penetration pressure. + * - TG For ``SHELL131`` and ``SHELL132`` elements with KEYOPT(3) = 0 or 1, use the labels HBOT, HE2, HE3, ..., HTOP instead of HEAT. + - X, Y, Z, SUM + - Component thermal gradient or vector sum. + * - TF + - X, Y, Z, SUM + - Component thermal flux or vector sum. + * - PG + - X, Y, Z, SUM + - Component pressure gradient or vector sum. + * - EF + - X, Y, Z, SUM + - Component electric field or vector sum. + * - D + - X, Y, Z, SUM + - Component electric flux density or vector sum. + * - H + - X, Y, Z, SUM + - Component magnetic field intensity or vector sum. + * - B + - X, Y, Z, SUM + - Component magnetic flux density or vector sum. + * - CG + - X, Y, Z, SUM + - Component concentration gradient or vector sum. + * - DF + - X, Y, Z, SUM + - Component diffusion flux density or vector sum. + * - FMAG + - X, Y, Z, SUM + - Component electromagnetic forces or vector sum. + * - P + - X, Y, Z, SUM + - Poynting vector components or vector sum + * - F + - X, Y, Z + - Component structural force. + * - M + - X, Y, Z + - Component structural moment. + * - HEAT + - + - Heat flow. + * - FLOW + - + - Fluid flow. + * - AMPS + - + - Current flow. + * - FLUX + - + - Magnetic flux. + * - CSG + - X, Y, Z + - Component magnetic current segment. + * - RATE + - + - Diffusion flow rate. + * - SENE + - + - "Stiffness" energy. + * - STEN + - + - Elemental energy dissipation due to `stabilization `_. + * - KENE + - + - Kinetic energy. + * - ASENE + - + - Amplitude stiffness energy. + * - PSENE + - + - Peak stiffness energy. + * - AKENE + - + - Amplitude kinetic energy. + * - PKENE + - + - Peak kinetic energy. + * - DENE + - + - Damping energy. + * - WEXT WEXT is calculated for element-based loading only (and not for nodal-force loading). WEXT is stored on elements to which loading has been applied; if surface elements are added on top of other elements, for example, and pressure loading is applied to the surface elements, WEXT is available for the surface elements only. + - + - Work due to external load. + * - AENE + - + - Artificial energy due to hourglass control/drill stiffness or due to contact stabilization. + * - JHEAT + - + - Element Joule heat generation. + * - JC + - X, Y, Z, SUM + - Conduction current density for elements that support conduction current calculation. Components (X, Y, Z) and vector sum (SUM). + * - JS + - X, Y, Z + - Source current density for low-frequency magnetic analyses. Total current density (sum of conduction and displacement current densities) in low-frequency electric analyses. Components (X, Y, Z). + * - JT + - X, Y, Z, SUM + - Total measurable current density in low-frequency electromagnetic analyses. (Conduction current density in a low-frequency electric analysis.) Components (X, Y, Z) and vector sum (SUM). + * - MRE + - + - Magnetics Reynolds number. + * - VOLU + - + - Volume of volume element. + * - BFE + - TEMP + - Body temperatures (calculated from applied temperatures) as used in solution (area and volume elements only). + * - FICT + - TEMP + - Fictive temperature. + * - CAP + - C0,X0,K0,ZONE, DPLS,VPLS + - Material cap plasticity model only: Cohesion; hydrostatic compaction yielding stress; I1 at the transition point at which the shear and compaction envelopes intersect; zone = 0: elastic state, zone = 1: compaction zone, zone = 2: shear zone, zone = 3: expansion zone; effective deviatoric plastic strain; volume plastic strain. + * - EDPC + - CSIG,CSTR + - Material EDP creep model only (not including the cap model): Equivalent creep stress; equivalent creep strain. + * - FFLX + - X, Y, Z + - Fluid flux flow in poromechanics. + * - FGRA + - X, Y, Z + - Fluid pore pressure gradient in poromechanics. + * - PMSV + - VRAT, PPRE, DSAT, RPER + - Void volume ratio, pore pressure, degree of saturation, and relative permeability for coupled pore-pressure-thermal elements. + * - YSIDX + - TENS,SHEA + - Yield surface activity status for Mohr-Coulomb, soil, concrete, and joint rock material models: 1 = yielded, 0 = not yielded. + * - FPIDX + - TF01,SF01, TF02,SF02, TF03,SF03, TF04,SF04 + - Failure plane surface activity status for concrete and joint rock material models: 1 = yielded, 0 = not yielded. Tension and shear failure status are available for all four sets of failure planes. + * - NS + - X, Y, Z, XY, YZ, XZ + - `Nominal strain `_ for hyperelastic material, reported in the current configuration (unaffected by :ref:`rsys` ). + * - MPLA + - DMAC, DMAX + - Microplane damage, macroscopic and maximum values. + * - MPDP + - TOTA, TENS, COMP, RW + - Microplane homogenized total, tension, and compression damages (TOTA, TENS, COMP), and split weight factor (RW). + * - DAMAGE + - 1,2,3,MAX + - Damage in directions 1, 2, 3 (1, 2, 3) and the maximum damage (MAX). + * - GDMG + - + - Damage + * - IDIS + - + - Structural-thermal dissipation rate + * - BKS + - X, Y, Z, XY, YZ, XZ + - Total `nonlinear kinematic backstress `_ reported in the current configuration (unaffected by :ref:`rsys` ). Available for 3D, plane strain, and axisymmetric elements. + * - BKS1,...,BKS5 + - X, Y, Z, XY, YZ, XZ + - Superimposed components of the total `nonlinear kinematic backstress`_ reported in the current configuration (unaffected by :ref:`rsys` ). Available for 3D, plane strain, and axisymmetric elements when more than one superimposed back-stress component is defined. + * - EPFR + - + - Free strain in porous media + * - FC1S + - 1,2,3,4,5,6 + - First set of six components of FCC crystal slip. Available for 3D elements only. + * - FC2S + - 1,2,3,4,5,6 + - Second set of six components of FCC crystal slip. Available for 3D elements only. + * - HC1S + - 1,2,3,4,5,6 + - Six components of HCP crystal slip on basal and prismatic systems. Available for 3D elements only. + * - HC2S + - 1,2,3,4,5,6 + - Six components of HCP crystal slip on pyramidal system. Available for 3D elements only. + * - HC3S + - 1,2,3,4,5,6 + - First set of six components of HCP crystal slip on the first-order pyramidal system. Available for 3D elements only. + * - HC4S + - 1,2,3,4,5,6 + - Second set of six components of HCP crystal slip on the first-order pyramidal system. Available for 3D elements only. + * - HC5S + - 1,2,3,4,5,6 + - Six components of HCP crystal slip on the second-order pyramidal system. Available for 3D elements only. + * - BC1S + - 1,2,3,4,5,6 + - First set of six components of BCC slip on 111 plane. Available for 3D elements only. + * - BC2S + - 1,2,3,4,5,6 + - Second set of six components of BCC slip on 111 plane. Available for 3D elements only. + * - BC3S + - 1,2,3,4,5,6 + - First set of six components of BCC slip on 112 plane. Available for 3D elements only. + * - BC4S + - 1,2,3,4,5,6 + - Second set of six components of BCC slip on 112 plane. Available for 3D elements only. + * - BC5S + - 1,2,3,4,5,6 + - First set of six components of BCC slip on 123 plane. Available for 3D elements only. + * - BC6S + - 1,2,3,4,5,6 + - Second set of six components of BCC slip on 123 plane. Available for 3D elements only. + * - BC7S + - 1,2,3,4,5,6 + - Third set of six components of BCC slip on 123 plane. Available for 3D elements only. + * - BC8S + - 1,2,3,4,5,6 + - Fourth set of six components of BCC slip on 123 plane. Available for 3D elements only. + * - FC1H + - 1,2,3,4,5,6 + - First set of six components of FCC crystal hardness. Available for 3D elements only. + * - FC2H + - 1,2,3,4,5,6 + - Second set of six components of FCC crystal hardness. Available for 3D elements only. + * - HC1H + - 1,2,3,4,5,6 + - Sixcomponents of HCP crystal hardness on basal and prismatic systems. Available for 3D elements. + * - HC2H + - 1,2,3,4,5,6 + - Six components of HCP crystal hardness on pyramidal system. Available for 3D elements only. + * - HC3H + - 1,2,3,4,5,6 + - First set of six components of HCP crystal hardness on the first-order pyramidal system. Available for 3D elements only. + * - HC4H + - 1,2,3,4,5,6 + - Second set of six components of HCP crystal hardness on the first-order pyramidal system. Available for 3D elements only. + * - HC5H + - 1,2,3,4,5,6 + - Six components of HCP crystal hardness on the second-order pyramidal system. Available for 3D elements only. + * - BC1H + - 1,2,3,4,5,6 + - First set of six components of BCC hardness on 111 plane. Available for 3D elements only. + * - BC2H + - 1,2,3,4,5,6 + - Second set of six components of BCC hardness on 111 plane. Available for 3D elements only. + * - BC3H + - 1,2,3,4,5,6 + - First set of six components of BCC hardness on 112 plane. Available for 3D elements only. + * - BC4H + - 1,2,3,4,5,6 + - Second set of six components of BCC hardness on 112 plane. Available for 3D elements only. + * - BC5H + - 1,2,3,4,5,6 + - First set of six components of BCC hardness on 123 plane. Available for 3D elements only. + * - BC6H + - 1,2,3,4,5,6 + - Second set of six components of BCC hardness on 123 plane. Available for 3D elements only. + * - BC7H + - 1,2,3,4,5,6 + - Third set of six components of BCC hardness on 123 plane. Available for 3D elements only. + * - BC8H + - 1,2,3,4,5,6 + - Fourth set of six components of BCC hardness on 123 plane. Available for 3D elements only. + * - XELG + - 1,2,3,45,6,EQV + - Crystal Lagrangian strain in 11, 22, 33, 12, 23,13 directions and its equivalent. Available for 3D elements only. + * - SINT + - RHO, ETA, SSTR, GRAIN + - Sintering relative density, viscosity, sintering stress, and average grain size values. + * - **Sequence Number Method** + * - **Item** + - **Comp** + - **Description** + * - SMISC + - ``snum`` + - Summable items. + * - NMISC + - ``snum`` + - Nonsummable items. + * - LS + - ``snum`` + - Line element elastic stresses. + * - LEPEL + - ``snum`` + - Line element strains. + * - LEPTH + - ``snum`` + - Line element thermal strains. + * - LEPPL + - ``snum`` + - Line element plastic strains. + * - LEPCR + - ``snum`` + - Line element creep strains. + * - LBFE + - ``snum`` + - Line element temperatures. + + + .. _ESOL_tab_2: + + ESOL - Selected Result Component Labels + *************************************** + + .. flat-table:: + :header-rows: 1 + + * - Comp + - Description + * - SVAR ``n`` + - The ``n`` th state variable. + * - FLDUF0 ``n`` + - The ``n`` th user-defined field variable. + + """ + command = f"ESOL,{nvar},{elem},{node},{item},{comp},{name}" + return self.run(command, **kwargs) + + def gssol( + self, nvar: str = "", item: str = "", comp: str = "", name: str = "", **kwargs + ): + r"""Specifies which results to store from the results file when using generalized plane strain. + + Mechanical APDL Command: `GSSOL `_ + + Parameters + ---------- + nvar : str + Arbitrary reference number or name assigned to this variable. Variable numbers can be 2 to + ``NV`` ( :ref:`numvar` ) while the name can be an eight byte character string. Overwrites any + existing results for this variable. + + item : str + Label identifying item to be stored. + + * ``LENGTH`` - Change of fiber length at the ending point. + + * ``ROT`` - Rotation of the ending plane during deformation. + + * ``F`` - Reaction force at the ending point in the fiber direction. + + * ``M`` - Reaction moment applied on the ending plane. + + comp : str + Component of the item, if Item = ROT or M. + + * ``X`` - The rotation angle or reaction moment of the ending plane about X. + + * ``Y`` - The rotation angle or reaction moment of the ending plane about Y. + + name : str + Thirty-two character name identifying the item on the printout and display. Defaults to the + label formed by concatenating the first four characters of the ``Item`` and ``Comp`` labels. + + Notes + ----- + + .. _GSSOL_notes: + + This command stores the results (new position of the ending plane after deformation) for generalized + plane strain. All outputs are in the global Cartesian coordinate system. For more information about + the generalized plane strain feature, see Generalized Plane Strain Option of Current-Technology + Solid Elements in the `Element Reference + `_. + """ + command = f"GSSOL,{nvar},{item},{comp},{name}" + return self.run(command, **kwargs) + + def jsol( + self, + nvar: str = "", + elem: str = "", + item: str = "", + comp: str = "", + name: str = "", + **kwargs, + ): + r"""Specifies result items to be stored for the joint element. + + Mechanical APDL Command: `JSOL `_ + + Parameters + ---------- + nvar : str + Arbitrary reference number or name assigned to this variable. Variable numbers can be 2 to + ``NV`` ( :ref:`numvar` ) while the name can be an eight-byte character string. Overwrites any + existing results for this variable. + + elem : str + Element number for which to store results. + + item : str + Label identifying the item. Valid item labels are shown in :ref:`jsol_tab_1` below. + + comp : str + Component of the ``Item`` (if required). Valid component labels are shown in :ref:`jsol_tab_1` + below. + + name : str + Thirty-two character name identifying the item on printouts and displays. Defaults to a label + formed by concatenating the first four characters of the ``Item`` and ``Comp`` labels. + + Notes + ----- + + .. _JSOL_notes: + + This command is valid for the ``MPC184`` joint elements. The values stored are for the free or + unconstrained degrees of freedom of a joint element. Relative reaction forces and moments are + available only if stiffness, damping, or friction is associated with the joint element. + .. _jsol_tab_1: + + JSOL - Valid Item and Component Labels + ************************************** + + .. flat-table:: + :header-rows: 1 + + * - Item + - Comp + - Description + * - U + - X, Y, Z + - x, y, or z relative displacement. + * - ROT + - X, Y, Z + - x, y, or z relative rotation. + * - VEL + - X, Y, Z + - x, y, or z relative linear velocity. + * - OMG + - X, Y, Z + - x, y, or z relative angular velocity. + * - ACC + - X, Y, Z + - x, y, or z relative linear acceleration. + * - DMG + - X, Y, Z + - x, y, or z relative angular acceleration. + * - RF + - X, Y, Z + - Relative reaction forces in the local x, y, or z direction. + * - RM + - X, Y, Z + - Relative reaction moments in the local x, y, or z direction. + + """ + command = f"JSOL,{nvar},{elem},{item},{comp},{name}" + return self.run(command, **kwargs) + + def nsol( + self, + nvar: str = "", + node: str = "", + item: str = "", + comp: str = "", + name: str = "", + sector: str = "", + **kwargs, + ): + r"""Specifies nodal data to be stored from the results file. + + Mechanical APDL Command: `NSOL `_ + + Parameters + ---------- + nvar : str + Arbitrary reference number assigned to this variable. Variable numbers can be 2 to ``NV`` ( + :ref:`numvar` ). Overwrites any existing results for this variable. + + node : str + Node for which data are to be stored. + + item : str + Label identifying the item. Valid item labels are shown in the table below. Some items also + require a component label. + + comp : str + Component of the item (if required). Valid component labels are shown in the table below. + + name : str + Thirty-two character name identifying the item on printouts and displays. Defaults to a label + formed by concatenating the first four characters of the ``Item`` and ``Comp`` labels. + + sector : str + For a full harmonic cyclic symmetry solution, the sector number for which the results from NODE + are to be stored. + + Notes + ----- + + .. _NSOL_notes: + + Stores nodal degree of freedom and solution results in a variable. For more information, see Data + Interpreted in the Nodal Coordinate System in the `Modeling and Meshing Guide + `_. + + For ``SECTOR`` >1, the result is in the nodal coordinate system of the base sector, and it is + rotated to the expanded sector``s location. Refer to `Using the /CYCEXPAND Command + `_ + + .. _nsol_tab_1: + + NSOL - Valid Item and Component Labels + ************************************** + + .. flat-table:: Valid Item and Component Labels :ref:`nsol`, ``NVAR,NODE,Item,Comp,Name`` + :header-rows: 2 + + * - Valid item and component labels for nodal degree of freedom results are: + * - Item + - Comp + - Description + * - U + - X, Y, Z + - X, Y, or Z structural displacement. + * - ROT + - X, Y, Z + - X, Y, or Z structural rotation. + * - TEMP[ :ref:`NSOL_temp` ] + - + - Temperature. + * - PRES + - + - Pressure. + * - GFV1, GFV2, GFV3 + - + - Nonlocal field values 1, 2, and 3. + * - VOLT + - + - Electric potential. + * - MAG + - + - Magnetic scalar potential. + * - V + - X, Y, Z + - X, Y, or Z fluid velocity in a fluid analysis. + * - A + - X, Y, Z + - X, Y, or Z magnetic vector potential in an electromagnetic analysis. + * - CONC + - + - Concentration. + * - VEL + - X, Y, Z + - X, Y, or Z velocity in a structural transient dynamic analysis ( :ref:`antype`,TRANS). + * - ACC + - X, Y, Z + - X, Y, or Z acceleration in a structural transient dynamic analysis ( :ref:`antype`,TRANS). + * - OMG + - X, Y, Z + - X, Y, or Z rotational velocity in a structural transient dynamic analysis ( :ref:`antype`,TRANS). + * - DMG + - X, Y, Z + - X, Y, or Z rotational acceleration in a structural transient dynamic analysis ( :ref:`antype`,TRANS). + * - CURR + - + - Current. + * - EMF + - + - Electromotive force drop. + * - SPL + - + - Sound pressure level. + * - SPLA + - + - A-weighted sound pressure level (dBA). + * - ENKE + - + - Acoustic energy density + + .. _NSOL_temp: + + For ``SHELL131`` and ``SHELL132`` elements with KEYOPT(3) = 0 or 1, use the labels TBOT, TE2, TE3,. + .., TTOP instead of TEMP. + """ + command = f"NSOL,{nvar},{node},{item},{comp},{name},{sector}" + return self.run(command, **kwargs) + + def nstore(self, tinc: str = "", **kwargs): + r"""Defines which time points are to be stored. + + Mechanical APDL Command: `NSTORE `_ + + Parameters + ---------- + tinc : str + Store data associated with every ``TINC`` time (or frequency) point(s), within the previously + defined range of ``TMIN`` to ``TMAX`` ( :ref:`timerange` ). (Defaults to 1) + + Notes + ----- + + .. _NSTORE_notes: + + Defines which time (or frequency) points within the range are to be stored. + """ + command = f"NSTORE,{tinc}" + return self.run(command, **kwargs) + + def numvar(self, nv: str = "", **kwargs): + r"""Specifies the number of variables allowed in POST26. + + Mechanical APDL Command: `NUMVAR `_ + + Parameters + ---------- + nv : str + Allow storage for ``NV`` variables. 200 maximum are allowed. Defaults to 10. TIME (variable 1) + should also be included in this number. + + Notes + ----- + + .. _NUMVAR_notes: + + Specifies the number of variables allowed for data read from the results file and for data resulting + from an operation (if any). For efficiency, ``NV`` should not be larger than necessary. ``NV`` + cannot be changed after data storage begins. + """ + command = f"NUMVAR,{nv}" + return self.run(command, **kwargs) + + def rforce( + self, + nvar: str = "", + node: str = "", + item: str = "", + comp: str = "", + name: str = "", + **kwargs, + ): + r"""Specifies the total reaction force data to be stored. + + Mechanical APDL Command: `RFORCE `_ + + Parameters + ---------- + nvar : str + Arbitrary reference number assigned to this variable (2 to NV ( :ref:`numvar` )). Overwrites any + existing results for this variable. + + node : str + Node for which data are to be stored. If ``NODE`` = P, graphical picking is enabled (valid only + in the GUI). + + item : str + Label identifying the item. Valid item labels are shown in the table below. Some items also + require a component label. + + comp : str + Component of the item (if required). Valid component labels are shown in the table below. + + name : str + Thirty-two character name identifying the item on printouts and displays. Defaults to an eight + character label formed by concatenating the first four characters of the ``Item`` and ``Comp`` + labels. + + Notes + ----- + + .. _RFORCE_notes: + + Defines the total reaction force data (static, damping, and inertial components) to be stored from + single pass ( :ref:`antype`,STATIC or TRANS) solutions or from the expansion pass of mode- + superposition ( :ref:`antype`,HARMIC or TRANS) solutions. + + .. _rforce_tab_1: + + RFORCE - Valid Item and Component Labels + **************************************** + + .. flat-table:: Valid item and component labels for node results are: + :header-rows: 1 + + * - Item + - Comp + - Description + * - F + - X,Y,Z + - X, Y, or Z structural force + * - M + - X,Y,Z + - X, Y, or Z structural moment + * - HEAT[ :ref:`rforce_table1_note1` ] + - + - Heat flow + * - FLOW + - + - Fluid flow + * - AMPS + - + - Current flow + * - FLUX + - + - Magnetic flux + * - CSG + - X,Y,Z + - X, Y, or Z magnetic current segment component + * - RATE + - + - Diffusion flow rate + * - VLTG + - + - Voltage drop + * - CURT + - + - Current + * - CHRG + - + - Charge + + .. _rforce_table1_note1: + + For ``SHELL131`` and ``SHELL132`` elements with KEYOPT(3) = 0 or 1, use the labels HBOT, HE2, HE3,. + .., HTOP instead of HEAT. + """ + command = f"RFORCE,{nvar},{node},{item},{comp},{name}" + return self.run(command, **kwargs) + + def rgb( + self, + kywrd: str = "", + pred: str = "", + pgrn: str = "", + pblu: str = "", + n1: str = "", + n2: str = "", + ninc: str = "", + ncntr: str = "", + **kwargs, + ): + r"""Specifies the RGB color values for indices and contours. + + Mechanical APDL Command: `/RGB `_ + + Parameters + ---------- + kywrd : str + Determines how RGB modifications will be applied. + + * ``INDEX`` - Specifies that subsequent color values apply to Mechanical APDL color indices (0-15). + + * ``CNTR`` - Specifies that subsequent color values apply to contours (1-128). Applies to C-option + devices only (i.e. X11C or Win32C). + + pred : str + Intensity of the color red, expressed as a percentage. + + pgrn : str + Intensity of the color green, expressed as a percentage. + + pblu : str + Intensity of the color blue, expressed as a percentage. + + n1 : str + First index (0-15), or contour (1-128) to which the designated RGB values apply. + + n2 : str + Final index (0-15), or contour (1-128) to which the designated RGB values apply. + + ninc : str + The step increment between the values ``N1`` and ``N2`` determining which contours or indices + will be controlled by the specified RGB values. + + ncntr : str + The new maximum number of contours (1-128). + + Notes + ----- + + .. _s-RGB_notes: + + Issuing the :ref:`cmap` command (with no filename) will restore the default color settings. + """ + command = f"/RGB,{kywrd},{pred},{pgrn},{pblu},{n1},{n2},{ninc},{ncntr}" + return self.run(command, **kwargs) + + def solu( + self, nvar: str = "", item: str = "", comp: str = "", name: str = "", **kwargs + ): + r"""Specifies solution summary data per substep to be stored. + + Mechanical APDL Command: `SOLU `_ + + Parameters + ---------- + nvar : str + Arbitrary reference number assigned to this variable (2 to ``NV`` ( :ref:`numvar` )). + + item : str + Label identifying the item. Valid item labels are shown in the table below. Some items may also + require a component label. + + comp : str + Component of the item (if required). Valid component labels are shown in the table below. None + are currently required. + + name : str + Thirty-two character name identifying the item on printouts and displays. Defaults to an eight + character label formed by concatenating the first four characters of the ``Item`` and ``Comp`` + labels. + + Notes + ----- + + .. _SOLU_notes: + + See also the :ref:`priter` command of POST1 to display some of these items directly. Valid for a + static or full transient analysis. All other analyses have zeros for the data. Valid item and + component labels for solution summary values are: + + This command contains some tables and extra information which can be inspected in the original + documentation pointed above. + """ + command = f"SOLU,{nvar},{item},{comp},{name}" + return self.run(command, **kwargs) + + def store( + self, + lab: str = "", + npts: str = "", + freq: str = "", + toler: str = "", + cluster: str = "", + **kwargs, + ): + r"""Stores data in the database for the defined variables. + + Mechanical APDL Command: `STORE `_ + + Parameters + ---------- + lab : str + Valid labels: + + * ``MERGE`` - Merge data from results file for the time points in memory with the existing data + using current specifications (default). + + * ``NEW`` - Store a new set of data, replacing any previously stored data with current result file + specifications and deleting any previously-calculated variables (see ). + + Variables defined using the :ref:`ansol` command are also deleted if they represent element-based + results. Variables created using `nodal-averaged results + `_ are + not deleted. + + * ``APPEN`` - Append data from results file to the existing data. + + * ``ALLOC`` - Allocate (and zero) space for ``NPTS`` data points. + + * ``PSD`` - Create a new set of frequency points for PSD calculations (replacing any previously + stored data and erasing any previously calculated data). + + npts : str + The number of time points (or frequency points) for storage (used only with ``Lab`` = ALLOC or + PSD). The value may be input when using POST26 with data supplied from other than a results + file. This value is automatically determined from the results file data with the NEW, APPEN, and + MERGE options. For the PSD option, ``NPTS`` determines the resolution of the frequency vector + (valid numbers are between 1 and 10, defaults to 5). + + freq : str + A frequency value, or an array containing frequency values (Hz). Use :ref:`dim` to define the + array and enclose the array name in percent signs (for example, :ref:`store`,,,,``arrayname``). + A default value of 1% of damping is considered for clustering around the user-input frequency + values. Supported for ``Lab`` = PSD only. + + toler : str + Tolerance to determine if a user-input frequency value ( ``FREQ`` ) is a duplicate and can be + ignored. Two frequency values are considered duplicates if their difference is smaller than the + frequency range multiplied by the tolerance. The default value is 10 :sup:`-5`. Supported for + ``Lab`` = PSD and ``Cluster`` = YES only. + + cluster : str + Key to control whether or not to consider the clustering frequencies around each of the user-input + array values. Available only when a user-defined frequency array is used ( ``FREQ`` ). + + * ``YES`` - Merge the clustering frequencies around both the natural frequencies and the frequency + values entered in the user-defined array ( ``FREQ`` ) (default). + + * ``NO`` - Do not include clustering frequencies, and use only natural frequencies and the + frequencies in the user-defined array ( ``FREQ`` ). + + Notes + ----- + + .. _STORE_notes: + + This command stores data from the results file in the database for the defined variables ( + :ref:`ansol`, :ref:`nsol`, :ref:`esol`, :ref:`solu`, :ref:`jsol` ) per specification ( + :ref:`avprin`, :ref:`force`, :ref:`layerp26`, :ref:`shell` ). See `Storing the Variable + `_ + + The :ref:`store`,PSD command creates a new frequency vector (variable 1) for response PSD + calculations ( :ref:`rpsd` ). This command should first be issued before defining variables ( + :ref:`nsol`, :ref:`esol`, :ref:`rforce` ) for which response PSD's are to be calculated. + + If the frequencies in the user-defined array are relevant, turning off clustering ( ``Cluster`` = + NO) reduces calculation costs without significant loss of accuracy. You can check the frequencies by + initially issuing a default :ref:`rpsd` (with clustering) to obtain a reference plot of the + response. + """ + command = f"STORE,{lab},{npts},,{freq},{toler},{cluster}" + return self.run(command, **kwargs) + + def timerange(self, tmin: str = "", tmax: str = "", **kwargs): + r"""Specifies the time range for which data are to be stored. + + Mechanical APDL Command: `TIMERANGE `_ + + Parameters + ---------- + tmin : str + Minimum time (defaults to first time (or frequency) point on the file). + + tmax : str + Maximum time (defaults to last time (or frequency) point on the file). + + Notes + ----- + + .. _TIMERANGE_notes: + + Defines the time (or frequency) range for which data are to be read from the file and stored in + memory. Use the :ref:`nstore` command to define the time increment. + + Use :ref:`prtime` or :ref:`pltime` to specify the time (frequency) range for cyclic mode- + superposition harmonic analyses. + """ + command = f"TIMERANGE,{tmin},{tmax}" + return self.run(command, **kwargs) + + def vardel(self, nvar: str = "", **kwargs): + r"""Deletes a variable (GUI). + + Mechanical APDL Command: `VARDEL `_ + + Parameters + ---------- + nvar : str + The reference number of the variable to be deleted. ``NVAR`` is as defined by :ref:`nsol`, + :ref:`esol`, etc. + + Notes + ----- + + .. _VARDEL_notes: + + Deletes a POST26 solution results variable. This command is generated by the Graphical User + Interface (GUI). It appears in the log file ( :file:`Jobname.LOG` ) if a POST26 variable is deleted + from the Defined Time-History Variables dialog box. + + The command is not intended to be typed in directly in a Mechanical APDL session (although it can be + included in an input file for batch input or for use with :ref:`input` ). + """ + command = f"VARDEL,{nvar}" + return self.run(command, **kwargs) + + def varnam(self, ir: str = "", name: str = "", **kwargs): + r"""Names (or renames) a variable. + + Mechanical APDL Command: `VARNAM `_ + + Parameters + ---------- + ir : str + Reference number of the variable (2 to NV ( :ref:`numvar` )). + + name : str + Thirty-two character name for identifying variable on printouts and displays. Embedded blanks + are compressed for output. + """ + command = f"VARNAM,{ir},{name}" + return self.run(command, **kwargs) diff --git a/src/ansys/mapdl/core/_commands/post26/special_purpose.py b/src/ansys/mapdl/core/_commands/post26/special_purpose.py new file mode 100644 index 00000000000..2bd60d3f1cc --- /dev/null +++ b/src/ansys/mapdl/core/_commands/post26/special_purpose.py @@ -0,0 +1,589 @@ +# Copyright (C) 2016 - 2025 ANSYS, Inc. and/or its affiliates. +# SPDX-License-Identifier: MIT +# +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to deal +# in the Software without restriction, including without limitation the rights +# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +# copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in all +# copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +# SOFTWARE. + + +class SpecialPurpose: + + def cvar( + self, + ir: str = "", + ia: str = "", + ib: str = "", + itype: int | str = "", + datum: int | str = "", + name: str = "", + **kwargs, + ): + r"""Computes covariance between two quantities. + + Mechanical APDL Command: `CVAR `_ + + Parameters + ---------- + ir : str + Arbitrary reference number assigned to the resulting variable (2 to ``NV`` ( :ref:`numvar` )). + If this number is the same as for a previous variable, the previous variable will be overwritten + with this result. + + ia : str + Reference numbers of the two variables to be operated on. If only one, leave ``IB`` blank. + + ib : str + Reference numbers of the two variables to be operated on. If only one, leave ``IB`` blank. + + itype : int or str + Defines the type of response PSD to be calculated: + + * ``0,1`` - Displacement (default). + + * ``2`` - Velocity. + + * ``3`` - Acceleration. + + datum : int or str + Defines the reference with respect to which covariance is to be calculated: + + * ``1`` - Absolute value. + + * ``2`` - Relative to base (default). + + name : str + Thirty-two character name for identifying the variable on listings and displays. Embedded blanks + are compressed upon output. + + Notes + ----- + + .. _CVAR_notes: + + This command computes the covariance value for the variables referenced by the reference numbers + ``IA`` and ``IB``. If ``DATUM`` = 2, the variable referenced by ``IR`` will contain the individual + modal contributions (that is, the dynamic or relative values). If ``DATUM`` = 1, the variable + referenced by ``IR`` will contain the modal contributions followed by the contributions of pseudo- + static and covariance between dynamic and pseudo-static responses. :file:`File.PSD` must be + available for the calculations to occur. + """ + command = f"CVAR,{ir},{ia},{ib},{itype},{datum},{name}" + return self.run(command, **kwargs) + + def pmgtran( + self, + fname: str = "", + freq: str = "", + fcnam1: str = "", + fcnam2: str = "", + pcnam1: str = "", + pcnam2: str = "", + ecnam1: str = "", + ccnam1: str = "", + **kwargs, + ): + r"""Summarizes electromagnetic results from a transient analysis. + + Mechanical APDL Command: `PMGTRAN `_ + + Parameters + ---------- + fname : str + File name (8 characters maximum) to which tabular data and plot files will be written. Must be + enclosed in single quotes when the command is manually typed in. Defaults to MG_TRNS. The data + file extension is :file:`.OUT` and the plot file extension is. :file:`PLT`. + + freq : str + Frequency of solution output. Defaults to 1. Every ``FREQ`` th solution on the results file is + output. + + fcnam1 : str + Names of element components for force calculation. Must be enclosed in single quotes when the + command is manually typed in. + + fcnam2 : str + Names of element components for force calculation. Must be enclosed in single quotes when the + command is manually typed in. + + pcnam1 : str + Names of element components for power loss calculation. Must be enclosed in single quotes when + the command is manually typed in. + + pcnam2 : str + Names of element components for power loss calculation. Must be enclosed in single quotes when + the command is manually typed in. + + ecnam1 : str + Names of element components for energy and total current calculations, respectively. Must be + enclosed in single quotes when the command is manually typed in. + + ccnam1 : str + Names of element components for energy and total current calculations, respectively. Must be + enclosed in single quotes when the command is manually typed in. + + Notes + ----- + + .. _PMGTRAN_notes: + + :ref:`pmgtran` invokes a Mechanical APDL macro which calculates and summarizes electromagnetic + results from + a transient analysis. The results are summarized by element components and listed on the screen as + well as written to a file ( :file:`Fname.OUT` ). + + You can select two components for the summary of electromagnetic forces, two for power loss, and one + each for stored energy (see :ref:`senergy` ) and total current (see :ref:`curr2d` ). See the + referenced commands for other restrictions. + + :ref:`pmgtran` is restricted to MKSA units. + """ + command = f"PMGTRAN,{fname},{freq},{fcnam1},{fcnam2},{pcnam1},{pcnam2},{ecnam1},{ccnam1}" + return self.run(command, **kwargs) + + def rcyc( + self, ir: str = "", ia: str = "", sector: str = "", name: str = "", **kwargs + ): + r"""Calculates cyclic results for a mode-superposition harmonic solution. + + Mechanical APDL Command: `RCYC `_ + + Parameters + ---------- + ir : str + Arbitrary reference number assigned to the resulting variable (2 to ``NV`` ( :ref:`numvar` )). + If this number is the same as for a previous variable, the previous variable will be overwritten + with this result. + + ia : str + Reference number of the variable to be operated on. + + sector : str + Sector number to calculate the results for. + + name : str + Thirty-two character name identifying the variable on listings and displays. Embedded blanks are + compressed for output. + + Notes + ----- + + .. _RCYC_notes: + + This command calculates the harmonic response in the sector specified by ``SECTOR`` for the variable + referenced by the reference number ``IA``. Only component values for ``IA`` are valid (no principles + or sums). The variable specified by ``IR`` will contain the harmonic solution. :file:`Jobname.RFRQ` + from the cyclic mode-superposition harmonic solve and :file:`Jobname.RST` or :file:`Jobname.RSTP` + from the cyclic modal solve must be available for the calculations to occur. The Jobname must be the + same for the cyclic modal solve and the cyclic mode-superposition harmonic solve. + + For ``SECTOR`` > 1, the result is in the nodal coordinate system of the base sector, and it is + rotated to the expanded sector``s location. Refer to `Using the /CYCEXPAND Command + `_ + + See also `Mode-Superposition Harmonic Cyclic Symmetry Analysis + `_ + """ + command = f"RCYC,{ir},{ia},{sector},{name}" + return self.run(command, **kwargs) + + def resp( + self, + ir: str = "", + lftab: str = "", + ldtab: str = "", + spectype: int | str = "", + dampratio: str = "", + dtime: str = "", + tmin: str = "", + tmax: str = "", + inputtype: int | str = "", + **kwargs, + ): + r"""Generates a response spectrum. + + Mechanical APDL Command: `RESP `_ + + Parameters + ---------- + ir : str + Arbitrary reference number assigned to the response spectrum results (2 to NV ( :ref:`numvar` + )). If this number is the same as for a previously defined variable, the previously defined + variable will be overwritten with these results. + + lftab : str + Reference number of variable containing frequency table (created with :ref:`filldata` or + :ref:`data` command). The frequency table defines the number and frequency of oscillating + systems used to determine the response spectrum. The frequency interval need not be constant + over the entire range. Frequencies must be input in ascending order. + + ldtab : str + Reference number of variable containing the input time-history. + + spectype : int or str + Defines the type of response spectrum to be calculated: + + * ``0 or 1`` - Displacement (relative to base excitation) + + * ``2`` - Velocity (relative to base excitation) + + * ``3`` - Acceleration response spectrum (absolute) + + * ``4`` - Pseudo-velocity + + * ``5`` - Pseudo-acceleration + + dampratio : str + Ratio of viscous damping to critical damping (input as a decimal number). + + dtime : str + Integration time step. This value should be equal to or greater than the integration time step + used in the initial transient analysis performed to generate the input time-history ( ``LDTAB`` + ). + + ``DTIME`` defaults to a value of 1/(20\*FMAX), where FMAX is the highest frequency in the + frequency table ( ``LFTAB`` ) except when the time-history is read from the reduced displacement + ( :file:`RDSP` ) file following a mode-superposition transient analysis without an expansion + pass. In this case, ``DTIME`` defaults to the time step value used in the analysis. + + tmin : str + Specifies a subset of the input time-history ( ``LDTAB`` ) to be used in the response spectrum + calculation. Defaults to the full time range. + + tmax : str + Specifies a subset of the input time-history ( ``LDTAB`` ) to be used in the response spectrum + calculation. Defaults to the full time range. + + inputtype : int or str + Defines the type of the input time-history: + + * ``0`` - Displacement (default) + + * ``1`` - Acceleration + + Notes + ----- + + .. _RESP_notes: + + This command generates a response spectrum from a displacement or acceleration time-history and + frequency data. The response spectrum is defined as the maximum response of single degree of freedom + systems of varying frequency (or period) to a given input support excitation. + + A response spectrum analysis ( :ref:`antype`, SPECTR with :ref:`spopt`, SPRS or MPRS) requires a + response spectrum input. This input can be determined from the response spectrum printout or display + of this command. + + If a response spectrum is to be calculated from a given displacement (or acceleration) time-history, + the displacement time-history may be input to a single one-element reduced linear transient dynamic + ( :ref:`antype`,TRANS) analysis, so that the calculated output (which should be the same as the + input) will be properly located on the file. + + The integration time step (argument ``DTIME`` on the :ref:`resp` command) and the damping + coefficient (argument ``dampRatio`` ) are constant over the frequency range. The number of + calculations done per response spectrum curve is the product of the number of input solution points + ( ``TMAX`` - ``TMIN`` )/ ``DTIME`` and the number of frequency points (frequencies located in + variable ``LFTAB`` ). + + Input solution points requested (using ``DTIME`` and the frequency range) at a time not + corresponding to an actual displacement solution time on the file are linearly interpolated with + respect to the existing points. + + For the theory of the response spectrum calculation, see `POST26 - Response Spectrum Generator + (RESP) + `_ + + For an example of the command usage, see `Generating a Response Spectrum + `_ + """ + command = f"RESP,{ir},{lftab},{ldtab},{spectype},{dampratio},{dtime},{tmin},{tmax},{inputtype}" + return self.run(command, **kwargs) + + def rpsd( + self, + ir: str = "", + ia: str = "", + ib: str = "", + itype: int | str = "", + datum: int | str = "", + name: str = "", + signif: str = "", + **kwargs, + ): + r"""Calculates response power spectral density (PSD). + + Mechanical APDL Command: `RPSD `_ + + Parameters + ---------- + ir : str + Arbitrary reference number assigned to the resulting variable (2 to ``NV`` ( :ref:`numvar` )). + If this number is the same as for a previous variable, the previous variable will be overwritten + with this result. + + ia : str + Reference numbers of the two variables to be operated on. If only one, leave ``IB`` blank. + + ib : str + Reference numbers of the two variables to be operated on. If only one, leave ``IB`` blank. + + itype : int or str + Defines the type of response PSD to be calculated: + + * ``0,1`` - Displacement (default). + + * ``2`` - Velocity. + + * ``3`` - Acceleration. + + datum : int or str + Defines the reference with respect to which response PSD is to be calculated: + + * ``1`` - Absolute value. + + * ``2`` - Relative to base (default). + + name : str + Thirty-two character name identifying variable on listings and displays. Embedded blanks are + compressed for output. + + signif : str + Combine only those modes whose significance level exceeds the ``SIGNIF`` threshold. The + significance level is defined as the modal covariance matrix term divided by the maximum of all + the modal covariance matrix terms. Any term whose significance level is less than ``SIGNIF`` is + considered insignificant and does not contribute to the response. All modes are taken into + account by default ( ``SIGNIF`` = 0.0). + + The significance level definition is identical to the one used for the combination ( ``SIGNIF`` + on the :ref:`psdcom` command); however, the default value is different. + + The significance does not apply to spatial correlation ( :ref:`psdspl` ) and wave propagation ( + :ref:`psdwav` ) response power spectral density. + + Notes + ----- + + .. _RPSD_notes: + + This command calculates response power spectral density (PSD) for the variables referenced by the + reference numbers ``IA`` and ``IB``. The variable referred by ``IR`` will contain the response PSD. + You must issue the :ref:`store`,PSD command first; :file:`File.PSD` must be available for the + calculations to occur. + + 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}" + return self.run(command, **kwargs) + + def smooth( + self, + vect1: str = "", + vect2: str = "", + datap: str = "", + fitpt: int | str = "", + vect3: str = "", + vect4: str = "", + disp: int | str = "", + **kwargs, + ): + r"""Allows smoothing of noisy data and provides a graphical representation of the data. + + Mechanical APDL Command: `SMOOTH `_ + + Parameters + ---------- + vect1 : str + Name of the first vector that contains the noisy data set (that is, independent variable). You + must create and fill this vector before issuing :ref:`smooth`. + + vect2 : str + Name of the second vector that contains the dependent set of data. Must be the same length as + the first vector. You must create and fill this vector before issuing :ref:`smooth`. + + datap : str + Number of data points to be fitted, starting from the beginning of the vector. If left blank, + the entire vector will be fitted. The maximum number of data points is 100,000 (or greater, + depending on the memory of the computer). + + fitpt : int or str + Order of the fitting curve that will be used as a smooth representation of the data. This number + should be less than or equal to the number of the data points. Default (blank) is one-half the + number of data points. Maximum number of smoothed data fitting order is the number of data points up + to 50. Depending on this number, the smoothed curve will be one of the following: + + * ``1`` - Curve is the absolute average of all of the data points. + + * ``2`` - Curve is the least square average of all of the data points. + + * ``3 or more`` - Curve is a polynomial of the order (n-1), where n is the number of data fitting + order points. + + vect3 : str + Name of the vector that contains the smoothed data of the independent variable. This vector + should have a length equal to or greater than the number of smoothed data points. In batch + (command) mode, you must create this vector before issuing the :ref:`smooth` command. In + interactive mode, the GUI automatically creates this vector (if it does not exist). If you do + not specify a vector name, the GUI will name the vector smth_ind. + + vect4 : str + Name of the vector that contains the smoothed data of the dependent variable. This vector must + be the same length as ``Vect3``. In batch (command) mode, you must create this vector before + issuing the :ref:`smooth` command. In interactive mode, the GUI automatically creates this + vector (if it does not exist). If you do not specify a vector name, the GUI will name the vector + smth_dep. + + disp : int or str + Specifies how you want to display data. No default; you must specify an option. + + * ``1`` - Unsmoothed data only + + * ``2`` - Smoothed data only + + * ``3`` - Both smoothed and unsmoothed data + + Notes + ----- + + .. _SMOOTH_notes: + + This command enables you to control the attributes of the graph using standard Mechanical APDL + controls ( + :ref:`grid`, :ref:`gthk`, :ref:`color`, etc.). + + If working interactively, the controls appear in this dialog box for convenience, as well as in + their standard dialog boxes. + + You must always create ``Vect1`` and ``Vect2`` (using :ref:`dim` ) and fill these vectors before + smoothing the data. If working interactively, the program automatically creates ``Vect3`` and + ``Vect4``. If working in batch (command) mode, you must create ``Vect3`` and ``Vect4`` (using + :ref:`dim` ) before issuing :ref:`smooth`. ``Vect3`` and ``Vect4`` are then filled automatically by + the program. + + The program also creates an additional TABLE type array that contains the smoothed array and the + unsmoothed data to enable plotting later with :ref:`starvplot`. Column 1 in the table corresponds + to ``Vect1``, column 2 to ``Vect2``, and column 3 to ``Vect4``. The array is named ``Vect3`` + _SMOOTH, up to a limit of 32 characters. For example, if the array name is X1, the table name is + X1_SMOOTH. + + This command is also valid in PREP7 and SOLUTION. + """ + command = f"SMOOTH,{vect1},{vect2},{datap},{fitpt},{vect3},{vect4},{disp}" + return self.run(command, **kwargs) + + def vget( + self, + par: str = "", + ir: str = "", + tstrt: str = "", + kcplx: int | str = "", + **kwargs, + ): + r"""Moves a variable into an array parameter vector. + + Mechanical APDL Command: `VGET `_ + + Parameters + ---------- + par : str + Array parameter vector in the operation. + + ir : str + Reference number of the variable (1 to NV ( :ref:`numvar` )). + + tstrt : str + Time (or frequency) corresponding to start of ``IR`` data. If between values, the nearer value + is used. + + kcplx : int or str + Complex number key: + + * ``0`` - Use the real part of the ``IR`` data. + + * ``1`` - Use the imaginary part of the ``IR`` data. + + Notes + ----- + + .. _VGET_notes: + + Moves a variable into an array parameter vector. The starting array element number must be defined. + For example, :ref:`vget`,A(1),2 moves variable 2 (starting at time 0.0) to array parameter A. + Looping continues from array element A(1) with the index number incremented by one until the + variable is filled. The number of loops may be controlled with the `\*VLEN + `_ :ref:`vlen` + command (except that loop skipping ( ``NINC`` ) is not allowed). For multi-dimensioned array + parameters, only the first (row) subscript is incremented. + """ + command = f"VGET,{par},{ir},{tstrt},{kcplx}" + return self.run(command, **kwargs) + + def vput( + self, + par: str = "", + ir: str = "", + tstrt: str = "", + kcplx: int | str = "", + name: str = "", + **kwargs, + ): + r"""Moves an array parameter vector into a variable. + + Mechanical APDL Command: `VPUT `_ + + Parameters + ---------- + par : str + Array parameter vector in the operation. + + ir : str + Arbitrary reference number assigned to this variable (1 to ``NV`` ( :ref:`numvar` )). + Overwrites any existing results for this variable. + + tstrt : str + Time (or frequency) corresponding to start of ``IR`` data. If between values, the nearer value + is used. + + kcplx : int or str + Complex number key: + + * ``0`` - Use the real part of the ``IR`` data. + + * ``1`` - Use the imaginary part of the ``IR`` data. + + name : str + Thirty-two character name identifying the item on printouts and displays. Defaults to the label + formed by concatenating VPUT with the reference number ``IR``. + + Notes + ----- + + .. _VPUT_notes: + + At least one variable should be defined ( :ref:`nsol`, :ref:`esol`, :ref:`rforce`, etc.) before + using this command. The starting array element number must be defined. For example, + :ref:`vput`,A(1),2 moves array parameter A to variable 2 starting at time 0.0. Looping continues + from array element A(1) with the index number incremented by one until the variable is filled. + Unfilled variable locations are assigned a zero value. The number of loops may be controlled with + the :ref:`vlen` command (except that loop skipping (NINC) is not allowed). For multi-dimensioned + array parameters, only the first (row) subscript is incremented. + """ + command = f"VPUT,{par},{ir},{tstrt},{kcplx},{name}" + return self.run(command, **kwargs) diff --git a/src/ansys/mapdl/core/_commands/post26/status.py b/src/ansys/mapdl/core/_commands/post26/status.py new file mode 100644 index 00000000000..ac5383a480f --- /dev/null +++ b/src/ansys/mapdl/core/_commands/post26/status.py @@ -0,0 +1,66 @@ +# Copyright (C) 2016 - 2025 ANSYS, Inc. and/or its affiliates. +# SPDX-License-Identifier: MIT +# +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to deal +# in the Software without restriction, including without limitation the rights +# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +# copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in all +# copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +# SOFTWARE. + + +class Status: + + def operate(self, **kwargs): + r"""Specifies "Operation data" as the subsequent status topic. + + Mechanical APDL Command: `OPERATE `_ + + Notes + ----- + + .. _OPERATE_notes: + + This is a status ( :ref:`stat` ) topic command. Status topic commands are generated by the GUI and + will appear in the log file ( :file:`Jobname.LOG` ) if status is requested for some items under + Utility Menu> List> Status. This command will be immediately followed by a :ref:`stat` command, + which will report the status for the specified topic. + + If entered directly into the program, the :ref:`stat` command should immediately follow this + command. + """ + command = "OPERATE" + return self.run(command, **kwargs) + + def plotting(self, **kwargs): + r"""Specifies "Plotting settings" as the subsequent status topic. + + Mechanical APDL Command: `PLOTTING `_ + + Notes + ----- + + .. _PLOTTING_notes: + + This is a status ( :ref:`stat` ) topic command. Status topic commands are generated by the GUI and + will appear in the log file ( :file:`Jobname.LOG` ) if status is requested for some items under + Utility Menu> List> Status. This command will be immediately followed by a :ref:`stat` command, + which will report the status for the specified topic. + + If entered directly into the program, the :ref:`stat` command should immediately follow this + command. + """ + command = "PLOTTING" + return self.run(command, **kwargs) diff --git a/src/ansys/mapdl/core/_commands/post26_/__init__.py b/src/ansys/mapdl/core/_commands/post26_/__init__.py deleted file mode 100644 index 5f396473ecd..00000000000 --- a/src/ansys/mapdl/core/_commands/post26_/__init__.py +++ /dev/null @@ -1,23 +0,0 @@ -# Copyright (C) 2016 - 2025 ANSYS, Inc. and/or its affiliates. -# SPDX-License-Identifier: MIT -# -# -# Permission is hereby granted, free of charge, to any person obtaining a copy -# of this software and associated documentation files (the "Software"), to deal -# in the Software without restriction, including without limitation the rights -# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -# copies of the Software, and to permit persons to whom the Software is -# furnished to do so, subject to the following conditions: -# -# The above copyright notice and this permission notice shall be included in all -# copies or substantial portions of the Software. -# -# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -# SOFTWARE. - -from . import controls, display, listing, operations, setup, special, status diff --git a/src/ansys/mapdl/core/_commands/post26_/controls.py b/src/ansys/mapdl/core/_commands/post26_/controls.py deleted file mode 100644 index 7e281b7a5f3..00000000000 --- a/src/ansys/mapdl/core/_commands/post26_/controls.py +++ /dev/null @@ -1,259 +0,0 @@ -# Copyright (C) 2016 - 2025 ANSYS, Inc. and/or its affiliates. -# SPDX-License-Identifier: MIT -# -# -# Permission is hereby granted, free of charge, to any person obtaining a copy -# of this software and associated documentation files (the "Software"), to deal -# in the Software without restriction, including without limitation the rights -# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -# copies of the Software, and to permit persons to whom the Software is -# furnished to do so, subject to the following conditions: -# -# The above copyright notice and this permission notice shall be included in all -# copies or substantial portions of the Software. -# -# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -# SOFTWARE. - - -class Controls: - def cfact( - self, - rfacta="", - ifacta="", - rfactb="", - ifactb="", - rfactc="", - ifactc="", - **kwargs, - ): - """Defines complex scaling factors to be used with operations. - - APDL Command: CFACT - - Parameters - ---------- - rfacta - Real portion of the complex scale factor used in place of FACTA. - - ifacta - Imaginary portion of the complex scale factor used in place of - FACTA. - - rfactb - Real portion of the complex scale factor used in place of FACTB. - - ifactb - Imaginary portion of the complex scale factor used in place of - FACTB. - - rfactc - Real portion of the complex scale factor used in place of FACTC. - - ifactc - Imaginary portion of the complex scale factor used in place of - FACTC. - - Notes - ----- - Defines complex scale factors to be used with the operations [ADD, - PROD, etc.]. If this command is supplied, these complex factors - override any real factors (FACTA, FACTB, FACTC) supplied on the - operation commands. Factors are typically involved in scaling a - specified variable, such as in the term FACTA x IA of the ADD command - to scale variable IA before the ADD operation. - - When the CFACT command is active, defaults are as follows: 1) if the - complex factor is not specified, but the variable upon which it acts - (such as IA) is specified, the factor defaults to 1.0+i0.0; 2) if the - variable upon which the factor operates is not specified, but the - factor is specified, the variable defaults to 1.0 so that the term in - the operation becomes the complex factor itself; 3) if neither the - factor nor the variable number is supplied, the term is omitted from - the operation. Once the operation (such as the ADD command) has been - processed, the CFACT command becomes inactive and must be specified - again if it is to be used. - """ - command = f"CFACT,{rfacta},{ifacta},{rfactb},{ifactb},{rfactc},{ifactc}" - return self.run(command, **kwargs) - - def force(self, lab="", **kwargs): - """Selects the element nodal force type for output. - - APDL Command: FORCE - - Parameters - ---------- - lab - Type of force to be associated with the force items: - - TOTAL - Total forces (static, damping, and inertia). - - STATIC - Static forces. - - DAMP - Damping forces. - - INERT - Inertia forces. - - Notes - ----- - FORCE selects the element nodal force type for output with the POST1 - PRESOL, PLESOL, PRRFOR, NFORCE, FSUM, etc. commands, the POST26 ESOL - command, and reaction force plotting [/PBC]. For example, FORCE,STATIC - causes item F of the PRESOL command to be the static forces for the - elements processed. Element member forces (such as those available for - beams and shells and processed by Item and Sequence number) are not - affected by this command. The SMISC records extract the static force. - - The PRRSOL command is not valid with FORCE. Use the PRRFOR command, - which provides the same functionality as PRRSOL, instead. - - Use the FORCE command prior to any load case operations (LCOPER) to - insure the correct element nodal force combinations. - - In POST26, the ESOL data stored is based on the active FORCE - specification at the time the data is stored. To store data at various - specifications (for example, static and inertia forces), issue a STORE - command before each new specification. - - The FORCE command cannot be used to extract static, damping, and - inertial forces for MPC184 joint elements. - - To retrieve the different force types, use the ``*GET`` command with - Entity=ELEM and Item1=EFOR. - - The FORCE command is not supported in a spectrum analysis. You can - specify the force type directly on the combination method commands - (ForceType on the PSDCOM, SRSS, CQC, etc. commands). - - The FORCE command is not supported in a modal analysis. - """ - command = f"FORCE,{lab}" - return self.run(command, **kwargs) - - def layerp26(self, num="", **kwargs): - """Specifies the element layer for which data are to be stored. - - APDL Command: LAYERP26 - - Parameters - ---------- - num - Layer-processing mode: - - N - The layer number to process. The default value is 1. - - Notes - ----- - Defines the element layer for which results data are to be stored for - postprocessing. Applies to stress and strain data for layered elements - BEAM161, SHELL163, SHELL181, SOLID185, SOLID186, SOLSH190, SHELL208, - SHELL209, SHELL281, REINF265, and ELBOW290. - - The SHELL command can be used (for shell elements) to specify a - location (TOP, MID, BOT) within the layer for selection on the ESOL - command. Transverse shear stresses for MID are linearly averaged from - TOP and BOT, and do not reflect a parabolic distribution. Setting - KEYOPT(8) = 2 for SHELL181, SHELL208, SHELL209, SHELL281, and ELBOW290 - writes the mid-surface values directly to the results file and yields - more accurate values than linear averaging. - - That this command cannot be used for energy output, as energy is a per- - element quantity. - - When using the LAYERP26 command with SHELL181, SOLID185, SOLID186, - SOLSH190, SHELL208, or SHELL209, KEYOPT(8) must be set to 1 (or 2 for - SHELL181, SHELL208, SHELL209, SHELL281, and ELBOW290) in order to store - results for all layers. - - For the ANSYS LS-DYNA product, this command works differently than - described above. For SHELL163 and BEAM161, you must first use EDINT - during the solution phase to define the integration points for which - you want output data. Be aware that the output location for SHELL163 - data is always at the integration point, so "top" and "bottom" refer to - the top or bottom integration point, not necessarily the top or bottom - surface. For more information, see the ANSYS LS-DYNA User's Guide. - - In POST26, the ESOL data stored is based on the active LAYERP26 - specification at the time the data is stored. To store data at various - specifications (for example, layers 2 and 5), issue a STORE command - before each new specification. - """ - command = f"LAYERP26,{num}" - return self.run(command, **kwargs) - - def shell(self, loc="", **kwargs): - """Selects a shell element or shell layer location for results output. - - APDL Command: SHELL - - Parameters - ---------- - loc - Location within shell element (or layer) to obtain stress results: - - TOP - Top of shell element (or layer) (default). - - MID - Middle of shell element (or layer). The default method averages the TOP and BOT - values to obtain a mid value. Setting KEYOPT(8) = 2 for - SHELL181, SHELL208, SHELL209, and ELBOW290 uses MID results - obtained directly from the results file. - - BOT - Bottom of shell element (or layer). - - Notes - ----- - Selects the location within a shell element (or a shell layer) for - results output (nodal stresses, strains, etc.). Applies to POST1 - selects, sorts, and output [NSEL, NSORT, PRNSOL, PLNSOL, PRPATH, - PLPATH, etc.], and is used for storage with the POST26 ESOL command. - For example, SHELL,TOP causes item S of the POST1 PRNSOL command or the - POST26 ESOL command to be the stresses at the top of the shell - elements. For layered shell elements, use the LAYER (POST1) or - LAYERP26 (POST26) command to select the layer. The SHELL command does - not apply to the layered thermal shell elements, SHELL131 and SHELL132. - - For PowerGraphics [/GRAPHICS,POWER], the SHELL,MID command affects both - the printed output and the displayed results, while the SHELL (TOP or - BOT) command prints and displays both the top and bottom layers - simultaneously. Note that /CYCEXPAND,ON automatically turns on - PowerGraphics; however, for cyclic mode-superposition harmonic - postprocessing (CYCFILES), the SHELL command prints and displays only - the requested layer. - - In POST26, the ESOL data stored is based on the active SHELL - specification at the time the data is stored. To store data at various - specifications (for example, stresses at the top and bottom locations), - issue a STORE command before each new specification. - """ - command = f"SHELL,{loc}" - return self.run(command, **kwargs) - - def tvar(self, key="", **kwargs): - """Changes time to the cumulative iteration number. - - APDL Command: TVAR - - Parameters - ---------- - key - Time key: - - 0 - Time is used for the variable TIME. - - 1 - NCUMIT is used for the variable TIME. - - Notes - ----- - Changes the meaning of the time variable to the cumulative iteration - number (NCUMIT) variable. Data can be read from the file, printed, and - displayed as a function of NCUMIT rather than time. All POST26 - descriptions applying to TIME then apply to NCUMIT. - """ - command = f"TVAR,{key}" - return self.run(command, **kwargs) diff --git a/src/ansys/mapdl/core/_commands/post26_/display.py b/src/ansys/mapdl/core/_commands/post26_/display.py deleted file mode 100644 index 93550a5d469..00000000000 --- a/src/ansys/mapdl/core/_commands/post26_/display.py +++ /dev/null @@ -1,193 +0,0 @@ -# Copyright (C) 2016 - 2025 ANSYS, Inc. and/or its affiliates. -# SPDX-License-Identifier: MIT -# -# -# Permission is hereby granted, free of charge, to any person obtaining a copy -# of this software and associated documentation files (the "Software"), to deal -# in the Software without restriction, including without limitation the rights -# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -# copies of the Software, and to permit persons to whom the Software is -# furnished to do so, subject to the following conditions: -# -# The above copyright notice and this permission notice shall be included in all -# copies or substantial portions of the Software. -# -# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -# SOFTWARE. - - -class Display: - def keep(self, key="", **kwargs): - """Stores POST26 definitions and data during active session. - - APDL Command: KEEP - - Parameters - ---------- - key - State or value - - On or 1 - Allows you to exit and reenter /POST26 without losing your current time history - variable information. Keeps a cache of the /POST26 - variable information including the active file name - (FILE), variable definitions (NSOL, ESOL, GAPF, RFORCE, - SOLU, and EDREAD) and stored variable data in memory for - the current ANSYS session. - - Off or 0 - /POST26 variable information is deleted when you exit /POST26. - - Notes - ----- - Your variable information is saved in memory only for the current - active ANSYS session. It is deleted when you exit ANSYS. This - information is also deleted when you issue /CLEAR, RESUME, SOLVE, or - RESET. - - When you reenter /POST26 all time history variable data is available - for use. When you issue STORE,NEW, variable definitions created by math - operations such as ADD or PROD will not be restored. However, variables - defined with NSOL, ESOL, GAPF, RFORCE, SOLU, and EDREAD will be - restored. Only the last active results file name is kept in memory - (FILE). - - Commands such as LAYERP26, SHELL, and FORCE that specify the location - or a component of data to be stored will retain the setting at the time - of exiting /POST26 . - """ - command = f"KEEP,{key}" - return self.run(command, **kwargs) - - def plcplx(self, key="", **kwargs): - """Specifies the part of a complex variable to display. - - APDL Command: PLCPLX - - Parameters - ---------- - key - Complex variable part: - - 0 - Amplitude. - - 1 - Phase angle. - - 2 - Real part. - - 3 - Imaginary part. - - Notes - ----- - Used only with harmonic analyses (ANTYPE,HARMIC). - - All results data are stored in the form of real and imaginary - components and converted to amplitude and/or phase angle as specified - via the PLCPLX command. The conversion is not valid for derived - results (such as principal stress/strain, equivalent stress/strain and - USUM). - """ - command = f"PLCPLX,{key}" - return self.run(command, **kwargs) - - def pltime(self, tmin="", tmax="", **kwargs): - """Defines the time range for which data are to be displayed. - - APDL Command: PLTIME - - Parameters - ---------- - tmin - Minimum time (defaults to the first point stored). - - tmax - Maximum time (defaults to the last point stored). - - Notes - ----- - Defines the time (or frequency) range (within the range stored) for - which data are to be displayed. Time is always displayed in the Z-axis - direction for 3-D graph displays. If XVAR = 1, time is also displayed - in the X-axis direction and this control also sets the abscissa scale - range. - """ - command = f"PLTIME,{tmin},{tmax}" - return self.run(command, **kwargs) - - def plvar( - self, - nvar1="", - nvar2="", - nvar3="", - nvar4="", - nvar5="", - nvar6="", - nvar7="", - nvar8="", - nvar9="", - nvar10="", - **kwargs, - ): - """Displays up to ten variables in the form of a graph. - - APDL Command: PLVAR - - Parameters - ---------- - nvar1, nvar2, nvar3, . . . , nvar10 - Variables to be displayed, defined either by the reference number - or a unique thirty-two character name. If duplicate names are used - the command will plot the data for the lowest-numbered variable - with that name. - - Notes - ----- - Variables are displayed vs. variable N on the XVAR command. The string - value will be a predefined, unique name. For complex variables, the - amplitude is displayed by default [PLCPLX]. Each PLVAR command - produces a new frame. See the /GRTYP command for displaying multiple - variables in a single frame with separate Y-axes. - """ - command = f"PLVAR,{nvar1},{nvar2},{nvar3},{nvar4},{nvar5},{nvar6},{nvar7},{nvar8},{nvar9},{nvar10}" - return self.run(command, **kwargs) - - def spread(self, value="", **kwargs): - """Turns on a dashed tolerance curve for the subsequent curve plots. - - APDL Command: SPREAD - - Parameters - ---------- - value - Amount of tolerance. For example, 0.1 is ± 10%. - """ - return self.run("SPREAD,%s" % (str(value)), **kwargs) - - def xvar(self, n="", **kwargs): - """Specifies the X variable to be displayed. - - APDL Command: XVAR - - Parameters - ---------- - n - X variable number: - - 0 or 1 - Display PLVAR values vs. time (or frequency). - - n - Display PLVAR values vs. variable n (2 to NV [NUMVAR]). - - 1 - Interchange time and PLVAR variable numbers with time as the curve parameter. - PLVAR variable numbers are displayed uniformly spaced along - X-axis from position 1 to 10. - - Notes - ----- - Defines the X variable (displayed along the abscissa) against which the - Y variable(s) [PLVAR] are to be displayed. - """ - command = f"XVAR,{n}" - return self.run(command, **kwargs) diff --git a/src/ansys/mapdl/core/_commands/post26_/listing.py b/src/ansys/mapdl/core/_commands/post26_/listing.py deleted file mode 100644 index f4290fde890..00000000000 --- a/src/ansys/mapdl/core/_commands/post26_/listing.py +++ /dev/null @@ -1,162 +0,0 @@ -# Copyright (C) 2016 - 2025 ANSYS, Inc. and/or its affiliates. -# SPDX-License-Identifier: MIT -# -# -# Permission is hereby granted, free of charge, to any person obtaining a copy -# of this software and associated documentation files (the "Software"), to deal -# in the Software without restriction, including without limitation the rights -# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -# copies of the Software, and to permit persons to whom the Software is -# furnished to do so, subject to the following conditions: -# -# The above copyright notice and this permission notice shall be included in all -# copies or substantial portions of the Software. -# -# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -# SOFTWARE. - - -class Listing: - def extrem(self, nvar1="", nvar2="", ninc="", **kwargs): - """Lists the extreme values for variables. - - APDL Command: EXTREM - - Parameters - ---------- - nvar1, nvar2, ninc - List extremes for variables NVAR1 through NVAR2 in steps of NINC. - Variable range defaults to its maximum. NINC defaults to 1. - - Notes - ----- - Lists the extreme values (and the corresponding times) for stored and - calculated variables. Extremes for stored variables are automatically - listed as they are stored. Only the real part of a complex number is - used. Extreme values may also be assigned to parameters [``*GET``]. - """ - command = f"EXTREM,{nvar1},{nvar2},{ninc}" - return self.run(command, **kwargs) - - def lines(self, n="", **kwargs): - """Specifies the length of a printed page. - - APDL Command: LINES - - Parameters - ---------- - n - Number of lines per page (defaults to 20). (Minimum allowed = 11). - - Notes - ----- - Specifies the length of a printed page (for use in reports, etc.). - """ - command = f"LINES,{n}" - return self.run(command, **kwargs) - - def nprint(self, n="", **kwargs): - """Defines which time points stored are to be listed. - - APDL Command: NPRINT - - Parameters - ---------- - n - List data associated with every N time (or frequency) point(s), - beginning with the first point stored (defaults to 1). - - Notes - ----- - Defines which time (or frequency) points within the range stored are to - be listed. - """ - command = f"NPRINT,{n}" - return self.run(command, **kwargs) - - def prcplx(self, key="", **kwargs): - """Defines the output form for complex variables. - - APDL Command: PRCPLX - - Parameters - ---------- - key - Output form key: - - 0 - Real and imaginary parts. - - 1 - Amplitude and phase angle. Stored real and imaginary data are converted to - amplitude and phase angle upon output. Data remain stored as - real and imaginary parts. - - Notes - ----- - Defines the output form for complex variables. Used only with harmonic - analyses (ANTYPE,HARMIC). - - All results data are stored in the form of real and imaginary - components and converted to amplitude and/or phase angle as specified - via the PRCPLX command. The conversion is not valid for derived - results (such as principal stress/strain, equivalent stress/strain and - USUM). - """ - command = f"PRCPLX,{key}" - return self.run(command, **kwargs) - - def prtime(self, tmin="", tmax="", **kwargs): - """Defines the time range for which data are to be listed. - - APDL Command: PRTIME - - Parameters - ---------- - tmin - Minimum time (defaults to the first point stored). - - tmax - Maximum time (defaults to the last point stored). - - Notes - ----- - Defines the time (or frequency) range (within the range stored) for - which data are to be listed. - """ - command = f"PRTIME,{tmin},{tmax}" - return self.run(command, **kwargs) - - def prvar( - self, - nvar1="", - nvar2="", - nvar3="", - nvar4="", - nvar5="", - nvar6="", - **kwargs, - ): - """Lists variables vs. time (or frequency). - - APDL Command: PRVAR - - Parameters - ---------- - nvar1, nvar2, nvar3, . . . , nvar6 - Variables to be displayed, defined either by the reference number - or a unique thirty-two character name. If duplicate names are used - the command will print the data for the lowest-numbered variable - with that name. - - Notes - ----- - Lists variables vs. time (or frequency). Up to six variables may be - listed across the line. Time column output format can be changed using - the /FORMAT command arguments Ftype, NWIDTH, and DSIGNF. - """ - command = f"PRVAR,{nvar1},{nvar2},{nvar3},{nvar4},{nvar5},{nvar6}" - return self.run(command, **kwargs) diff --git a/src/ansys/mapdl/core/_commands/post26_/operations.py b/src/ansys/mapdl/core/_commands/post26_/operations.py deleted file mode 100644 index 7e72716c0e3..00000000000 --- a/src/ansys/mapdl/core/_commands/post26_/operations.py +++ /dev/null @@ -1,711 +0,0 @@ -# Copyright (C) 2016 - 2025 ANSYS, Inc. and/or its affiliates. -# SPDX-License-Identifier: MIT -# -# -# Permission is hereby granted, free of charge, to any person obtaining a copy -# of this software and associated documentation files (the "Software"), to deal -# in the Software without restriction, including without limitation the rights -# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -# copies of the Software, and to permit persons to whom the Software is -# furnished to do so, subject to the following conditions: -# -# The above copyright notice and this permission notice shall be included in all -# copies or substantial portions of the Software. -# -# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -# SOFTWARE. - - -class Operations: - def abs(self, ir="", ia="", name="", facta="", **kwargs): - """Forms the absolute value of a variable. - - APDL Command: ABS - - Parameters - ---------- - ir - Arbitrary reference number assigned to the resulting - variable (2 to NV [NUMVAR]). If this number is the same - as for a previously defined variable, the previously - defined variable will be overwritten with this result. - - ia - Reference number of the variable to be operated on. - - name - Thirty-two character name for identifying the variable on - the printout and displays. Embedded blanks are compressed - upon output. - - facta - Scaling factor (positive or negative) applied to variable - IA (defaults to 1.0). - - Notes - ----- - The new variable is calculated as: - - IR = | FACTA x IA | - - For a complex number (a + ib), the absolute value is the - magnitude, where the IA values are obtained from: - ``sqrt(a**2 + b**2)`` - - See POST26 - Data Operations in the Mechanical APDL Theory - Reference for details. - """ - return self.run(f"ABS,{ir},{ia},,,{name},,,{facta}", **kwargs) - - def add( - self, - ir="", - ia="", - ib="", - ic="", - name="", - facta="", - factb="", - factc="", - **kwargs, - ): - """Adds (sums) variables. - - APDL Command: ADD - - Parameters - ---------- - ir - Arbitrary reference number assigned to the resulting variable (2 to - NV [NUMVAR]). If this number is the same as for a previously - defined variable, the previously defined variable will be - overwritten with this result. - - ia, ib, ic - Reference numbers of the three variables to be operated on. If - only two variables, leave IC blank. If only one, leave IB and IC - blank. - - name - Thirty-two character name for identifying the variable on the - printout and displays. Embedded blanks are compressed upon output. - - facta, factb, factc - Scaling factors (positive or negative) applied to the corresponding - variables (default to 1.0). - - Notes - ----- - Adds variables (up to three at once) according to the operation: - - IR = (FACTA x IA) + (FACTB x IB) + (FACTC x IC) - """ - command = f"ADD,{ir},{ia},{ib},{ic},{name},,,{facta},{factb},{factc}" - return self.run(command, **kwargs) - - def atan(self, ir="", ia="", name="", facta="", **kwargs): - """Forms the arctangent of a complex variable. - - APDL Command: ATAN - - Parameters - ---------- - ir - Arbitrary reference number assigned to the resulting variable (2 to - NV [NUMVAR]). If this number is the same as for a previously - defined variable, the previously defined variable will be - overwritten with this result. - - ia - Reference number of the complex variable to be operated on. - - name - Thirty-two character name for identifying the variable on the - printout and displays. Embedded blanks are compressed upon output. - - facta - Scaling factor (positive or negative) applied to variable - IA (defaults to 1.0). Usually FACTA should be set to 1. - FACTA may affect the position of the angle by a multiple - of π, resulting in a quadrant change. - - Notes - ----- - Forms the arctangent of a complex variable according to the - operation: - - IR = ATAN(FACTA X b/a) - - where a and b are the real and imaginary parts, respectively, - of the complex variable IA (which is of the form a + ib). The - arctangent represents the phase angle (in radians), and is - valid only for a harmonic analysis (ANTYPE,HARMIC). - - Since the scaling factor is applied uniformly to b/a, applying - any positive or negative scaling factor will not affect the - size of the phase angle, with the exception that a negative - scaling factor will change the results quadrant by : π. The - magnitude of a complex number is still obtained through the - ABS command. See POST26 - Data Operations in the Mechanical - APDL Theory Reference for details. - """ - command = f"ATAN,{ir},{ia},,,{name},,,{facta}" - return self.run(command, **kwargs) - - def clog(self, ir="", ia="", name="", facta="", factb="", **kwargs): - """Forms the common log of a variable - - APDL Command: CLOG - - Parameters - ---------- - ir - Arbitrary reference number assigned to the resulting - variable (2 to NV [NUMVAR]). If this number is the same - as for a previously defined variable, the previously - defined variable will be overwritten with this result. - - ia - Reference number of the variable to be operated on. - - name - Thirty-two character name for identifying the variable on - printouts and displays. Embedded blanks are compressed - for output. - - facta - Scaling factor applied to variable IA (defaults to 1.0). - - factb - Scaling factor (positive or negative) applied to the operation - (defaults to 1.0). - - Notes - ----- - Forms the common log of a variable according to the operation: - - ``IR = FACTB*LOG(FACTA x IA)`` - """ - return self.run(f"CLOG,{ir},{ia},,,{name},,,{facta},{factb}", **kwargs) - - def conjug(self, ir="", ia="", name="", facta="", **kwargs): - """Forms the complex conjugate of a variable. - - APDL Command: CONJUG - - Parameters - ---------- - ir - Arbitrary reference number assigned to the resulting variable (2 to - NV [NUMVAR]). If this number is the same as for a previously - defined variable, the previously defined variable will be - overwritten with this result. - - ia - Reference number of the variable to be operated on. - - name - Thirty-two character name for identifying the variable on printouts - and displays. Embedded blanks are compressed for output. - - facta - Scaling factor (positive or negative) applied to variable (default - to 1.0). - - Notes - ----- - Used only with harmonic analyses (ANTYPE,HARMIC). - """ - return self.run(f"CONJUG,{ir},{ia},,,{name},,,{facta}", **kwargs) - - def deriv(self, ir="", iy="", ix="", name="", facta="", **kwargs): - """Differentiates a variable. - - APDL Command: DERIV - - Parameters - ---------- - ir - Arbitrary reference number assigned to the resulting - variable (2 to NV [NUMVAR]). If this number is the same - as for a previously defined variable, the previously - defined variable will be overwritten with this result. - - iy, ix - Reference numbers of variables to be operated on. IY is - differentiated with respect to IX. - - name - Thirty-two character name for identifying the variable on - printouts and displays. Embedded blanks are compressed for - output. - - facta - Scaling factor (positive or negative) applied as shown - below (defaults to 1.0). - - Notes - ----- - Differentiates variables according to the operation: - - IR = FACTA x d(IY)/d(IX) - """ - return self.run(f"DERIV,{ir},{iy},{ix},,{name},,,{facta}", **kwargs) - - def exp(self, ir="", ia="", name="", facta="", factb="", **kwargs): - """Forms the exponential of a variable. - - APDL Command: EXP - - Parameters - ---------- - ir - Arbitrary reference number assigned to the resulting - variable (2 to NV [NUMVAR]). If this number is the same as - for a previously defined variable, the previously defined - variable will be overwritten with this result. - - ia - Reference number of the variable to be operated on. - - name - Thirty-two character name for identifying the variable on - the printout and displays. Embedded blanks are compressed - upon output. - - facta - Scaling factor applied to variable IA (defaults to 1.0). - - factb - Scaling factor (positive or negative) applied to the operation - (defaults to 1.0). - - Notes - ----- - Forms the exponential of a variable according to the operation: - - ``IR = FACTB*EXP(FACTA x IA)`` - """ - return self.run(f"EXP,{ir},{ia},,,{name},,,{facta},{factb}", **kwargs) - - def filldata(self, ir="", lstrt="", lstop="", linc="", value="", dval="", **kwargs): - """Fills a variable by a ramp function. - - APDL Command: FILLDATA - - Parameters - ---------- - ir - Define data table as variable IR (2 to NV [NUMVAR]). - - lstrt - Start at location LSTRT (defaults to 1). - - lstop - Stop at location LSTOP (defaults to maximum location as determined - from data previously stored. - - linc - Fill every LINC location between LSTRT and LSTOP (defaults to 1). - - value - Value assigned to location LSTRT. - - dval - Increment value of previous filled location by DVAL and assign sum - to next location to be filled (may be positive or negative.) - - Notes - ----- - Locations may be filled continuously or at regular intervals (LINC). - Previously defined data at a location will be overwritten. - """ - command = f"FILLDATA,{ir},{lstrt},{lstop},{linc},{value},{dval}" - return self.run(command, **kwargs) - - def imagin(self, ir="", ia="", name="", facta="", **kwargs): - """Forms an imaginary variable from a complex variable. - - APDL Command: IMAGIN - - Parameters - ---------- - ir - Arbitrary reference number assigned to the resulting - variable (2 to NV [NUMVAR]). If this number is the same - as for a previously defined variable, the previously - defined variable will be overwritten with this result. - - ia - Reference number of the variable to be operated on. - - name - Thirty-two character name for identifying the variable on - the printout and displays. Embedded blanks are compressed - upon output. - - facta - Scaling factor (positive or negative) applied to variable IA - (defaults to 1.0). - - Notes - ----- - This command forms a new variable from a complex variable by - storing the imaginary part as the real part. The imaginary - part can then be used in other operations. Used only with - harmonic analyses (ANTYPE,HARMIC). - - Complex variables are stored in two-column arrays with the - real component stored in the first column and the imaginary - component stored in the second column. This command extracts - the value stored in the second column (i.e., imaginary - component). However, with harmonic analyses, all variables - are stored in two-column arrays as complex variables. If the - variable is not complex, then the same value is stored in both - columns. This command will extract the variable in the second - column of the array, even if this variable is not the - imaginary component of a complex variable. - """ - return self.run(f"IMAGIN,{ir},{ia},,,{name},,,{facta}", **kwargs) - - def int1( - self, - ir="", - iy="", - ix="", - name="", - facta="", - factb="", - const="", - **kwargs, - ): - """Integrates a variable. - - APDL Command: INT1 - - Parameters - ---------- - ir - Arbitrary reference number assigned to the resulting - variable (2 to NV [NUMVAR]). If this number is the same - as for a previously defined variable, the previously - defined variable will be overwritten with this result. - Table values represent integrated sum of IY to current - table position of IX. - - iy, ix - Integrate variable IY with respect to IX. - - name - Thirty-two character name for identifying the variable on - the printout and displays. Embedded blanks are compressed - upon output. - - facta, factb - Scaling factors (positive or negative) applied to the - corresponding variables (default to 1.0). - - const - Initial value. - - Notes - ----- - Integrates variables according to the operation: - - IR = ∫ (FACTA x IY) d(FACTB x IX) + CONST - """ - command = f"INT1,{ir},{iy},{ix},,{name},,,{facta},{factb},{const}" - return self.run(command, **kwargs) - - def large( - self, - ir="", - ia="", - ib="", - ic="", - name="", - facta="", - factb="", - factc="", - **kwargs, - ): - """Finds the largest (the envelope) of three variables. - - APDL Command: LARGE - - Parameters - ---------- - ir - Arbitrary reference number assigned to the resulting variable (2 to - NV [NUMVAR]). If this number is the same as for a previously - defined variable, the previously defined variable will be - overwritten with this result. - - ia, ib, ic - Reference numbers of the three variables to be operated on. If - only two, leave IC blank. If only one, leave IB blank also. - - name - Thirty-two character name for identifying the variable on the - printout and displays. Embedded blanks are compressed upon output. - - facta, factb, factc - Scaling factors (positive or negative) applied to the corresponding - variables (default to 1.0). - - Notes - ----- - Creates a new variable by finding the largest of up to three variables - according to the operation: - - IR = Largest of (FACTA x IA, FACTB x IB, FACTC x IC) - - The comparison is done at each time location, so that the new variable - is the "envelope" of the three existing variables. - """ - command = f"LARGE,{ir},{ia},{ib},{ic},{name},,,{facta},{factb},{factc}" - return self.run(command, **kwargs) - - def nlog(self, ir="", ia="", name="", facta="", factb="", **kwargs): - """Forms the natural log of a variable. - - APDL Command: NLOG - - Parameters - ---------- - ir - Arbitrary reference number assigned to the resulting - variable (2 to NV [NUMVAR]). If this number is the same - as for a previously defined variable, the previously - defined variable will be overwritten with this result. - - ia - Reference number of the variable to be operated on. - - name - Thirty-two character name identifying the variable on - printouts and displays. Embedded blanks are compressed - for output. - - facta - Scaling factor applied to variable IA (defaults to 1.0). - - factb - Scaling factor (positive or negative) applied to the operation - (defaults to 1.0). - - Notes - ----- - Forms the natural log of a variable according to the operation: - - ``IR = FACTB*LN(FACTA x IA)`` - """ - return self.run(f"NLOG,{ir},{ia},,,{name},,,{facta},{factb}", **kwargs) - - def prod( - self, - ir="", - ia="", - ib="", - ic="", - name="", - facta="", - factb="", - factc="", - **kwargs, - ): - """Multiplies variables. - - APDL Command: PROD - - Parameters - ---------- - ir - Arbitrary reference number assigned to the resulting - variable (2 to NV [NUMVAR]). If this number is the same - as for a previously defined variable, the previously - defined variable will be overwritten with this result. - - ia, ib, ic - Reference numbers of the three variables to be operated - on. If only two leave IC blank. If only one, leave IB - blank also. - - name - Thirty-two character name identifying the variable on - printouts and displays. Embedded blanks are compressed - for output. - - facta, factb, factc - Scaling factors (positive or negative) applied to the - corresponding variables (default to 1.0). - - Notes - ----- - Multiplies variables (up to three at once) according to the - operation: - - ``IR = (FACTA x IA) x (FACTB x IB) x (FACTC x IC)`` - """ - return self.run( - f"PROD,{ir},{ia},{ib},{ic},{name},,,{facta},{factb},{factc}", - **kwargs, - ) - - def quot(self, ir="", ia="", ib="", name="", facta="", factb="", **kwargs): - """Divides two variables. - - APDL Command: QUOT - - Parameters - ---------- - ir - Arbitrary reference number assigned to the resulting variable (2 to - NV [NUMVAR]). If this number is the same as for a previously - defined variable, the previously defined variable will be - overwritten with this result. - - ia, ib - Reference numbers of the two variables to be operated on. - - name - Thirty-two character name identifying the variable on printouts and - displays. Embedded blanks are compressed for output. - - facta, factb - Scaling factors (positive or negative) applied to the corresponding - variables (default to 1.0). - - Notes - ----- - Divides two variables according to the operation: - - IR = (FACTA x IA)/(FACTB x IB) - """ - return self.run(f"QUOT,{ir},{ia},{ib},,{name},,,{facta},{factb}", **kwargs) - - def realvar(self, ir="", ia="", name="", facta="", **kwargs): - """Forms a variable using only the real part of a complex variable. - - APDL Command: REALVAR - - Parameters - ---------- - ir - Arbitrary reference number assigned to the resulting variable (2 to - NV [NUMVAR]). If this number is the same as for a previously - defined variable, the previously defined variable will be - overwritten with this result. - - ia - Reference number of the variable to be operated on. - - name - Thirty-two character name identifying the variable on printouts and - displays. Embedded blanks are compressed for output. - - facta - Scaling factor (positive or negative) applied to variable IA - (defaults to 1.0). - - Notes - ----- - Forms a variable using only the real part of a variable. Used only - with harmonic analyses (ANTYPE,HARMIC). - - Complex variables are stored in two-column arrays with the - real component stored in the first column and the imaginary - component stored in the second column. This command extracts - the value stored in the first column (i.e., real component). - However with harmonic analyses, all variables are stored in - two-column arrays as complex variables. If the variable is - not complex, then the same value is stored in both columns. - This command will extract the variable in the first column of - the array, even if this variable is not the real component of - a complex variable. - """ - command = f"REALVAR,{ir},{ia},,,{name},,,{facta}" - return self.run(command, **kwargs) - - def small( - self, - ir="", - ia="", - ib="", - ic="", - name="", - facta="", - factb="", - factc="", - **kwargs, - ): - """Finds the smallest of three variables. - - APDL Command: SMALL - - Parameters - ---------- - ir - Arbitrary reference number assigned to the resulting - variable (2 to NV [NUMVAR]). If this number is the same - as for a previously defined variable, the previously - defined variable will be overwritten with this result. - - ia, ib, ic - Reference numbers of the three variables to be operated - on. If only two, leave IC blank. If only one, leave IB - blank also. - - name - Thirty-two character name identifying the variable on - printouts and displays. Embedded blanks are compressed - for output. - - facta, factb, factc - Scaling factors (positive or negative) applied to the - corresponding variables (defaults to 1.0). - - Notes - ----- - Finds the smallest of three variables according to the operation: - - ``IR = min(FACTA x IA, FACTB x IB, FACTC x IC)`` - """ - command = f"SMALL,{ir},{ia},{ib},{ic},{name},,,{facta},{factb},{factc}" - return self.run(command, **kwargs) - - def sqrt(self, ir="", ia="", name="", facta="", **kwargs): - """Forms the square root of a variable. - - APDL Command: SQRT - - Parameters - ---------- - ir - Arbitrary reference number assigned to the resulting variable (2 to - NV [NUMVAR]). If this number is the same as for a previously - defined variable, the previously defined variable will be - overwritten with this result. - - ia - Reference number of the variable to be operated on. - - name - Thirty-two character name identifying the variable on printouts and - displays. Embedded blanks are compressed for output. - - facta - Scaling factor (positive or negative) applied to variable IA - (defaults to 1.0). - - Notes - ----- - Forms the square root of a variable according to the operation: - ``IR=sqrt(FACTA*IA)`` - """ - return self.run(f"SQRT,{ir},{ia},,,{name},,,{facta}", **kwargs) diff --git a/src/ansys/mapdl/core/_commands/post26_/setup.py b/src/ansys/mapdl/core/_commands/post26_/setup.py deleted file mode 100644 index 845f66fda20..00000000000 --- a/src/ansys/mapdl/core/_commands/post26_/setup.py +++ /dev/null @@ -1,920 +0,0 @@ -# Copyright (C) 2016 - 2025 ANSYS, Inc. and/or its affiliates. -# SPDX-License-Identifier: MIT -# -# -# Permission is hereby granted, free of charge, to any person obtaining a copy -# of this software and associated documentation files (the "Software"), to deal -# in the Software without restriction, including without limitation the rights -# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -# copies of the Software, and to permit persons to whom the Software is -# furnished to do so, subject to the following conditions: -# -# The above copyright notice and this permission notice shall be included in all -# copies or substantial portions of the Software. -# -# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -# SOFTWARE. - -from typing import Optional - -from ansys.mapdl.core.mapdl_types import MapdlInt - - -class Setup: - def ansol( - self, - nvar="", - node="", - item="", - comp="", - name="", - mat="", - real="", - ename="", - **kwargs, - ): - """Specifies averaged nodal data to be stored from the results file in the - - APDL Command: ANSOL - solution coordinate system. - - Parameters - ---------- - nvar - Arbitrary reference number assigned to this variable (2 to NV - [NUMVAR]). Overwrites any existing results for this variable. - - node - Node number for which data are to be stored. - - item - Label identifying the item. General item labels are shown in - Table 126: ANSOL - General Item and Component Labels below. Some - items also require a component label. - - comp - Component of the item (if required). General component labels are - shown in Table 126: ANSOL - General Item and Component Labels - below. - - name - Thirty-two character name for identifying the item on the printout - and displays. Defaults to an eight character label formed by - concatenating the first four characters of the Item and Comp - labels. - - mat - The material number. Average will be computed based on the subset - of elements with the specified material number. DEFAULT: Use all - elements in the active set unless Real and/or Ename is specified. - - real - The real number. Average will be computed based on the subset of - elements with the specified real number. DEFAULT: Use all elements - in the active set unless Mat and/or Ename is specified. - - ename - The element type name. Average will be computed based on the subset - of elements with the specified element type name. DEFAULT: Use all - elements in the active set unless Mat and/or Real is specified. - - Notes - ----- - Valid item and component labels for averaged nodal results are listed - in Table: 126:: ANSOL - General Item and Component Labels, below. - - All element nodal quantities are obtained in RSYS, Solu and then - averaged. - - The ANSOL command defines averaged nodal results data to be stored from - a results file [FILE]. Not all items are valid for all nodes. See the - input and output summary tables of the Element Reference of each - element that is attached to the node for the available items. - - COORDINATE SYSTEMS: All element nodal results used by ANSOL for - averaging are in the element coordinate system, except for layered - elements. Layered element results are in the layer coordinate system. - You can further specify the element nodal results, for some elements, - with the SHELL, LAYERP26, and FORCE commands. - - ANSOL does not transform results from RSYS, SOLU to other coordinate - systems. Verify that all elements attached to the subject node have the - same coordinate system before using ANSOL. - - SHELL ELEMENTS: The default shell element coordinate system is based on - node ordering. For shell elements the adjacent elements could have a - different RSYS,SOLU, making the resultant averaged data inconsistent. A - note to this effect is issued when ANSOL is used in models containing - shell elements. Ensure that consistent coordinate systems are active - for all associated elements used by the ANSOL command. - - DERIVED QUANTITIES: Some of the result items supported by ANSOL (see - Table: 126:: ANSOL - General Item and Component Labels) are derived - from the component quantities. Use AVPRIN to specify the principal and - vector sum quantity averaging methods. - - DEFAULT: If Mat, Real , and Ename are not specified, all of the - elements attached to the node will be considered. When a material ID, - real constant ID, or element type discontinuity is detected at a node, - a note is issued. For example, in a FSI analysis, a FLUID30 element at - the structure interface would be considered. But since it contains no - SX result, it will not be used during STORE operations. - - Table: 126:: : ANSOL - General Item and Component Labels - - For more information on the meaning of contact status and its possible - values, see Reviewing Results in POST1 in the Contact Technology Guide. - """ - command = f"ANSOL,{nvar},{node},{item},{comp},{name},{mat},{real},{ename}" - return self.run(command, **kwargs) - - def cisol(self, n="", id_="", node="", cont="", dtype="", **kwargs): - """Stores fracture parameter information in a variable. - - APDL Command: CISOL - - Parameters - ---------- - n - Arbitrary reference number or name assigned to this variable. - Number must be >1 but Optional[str]: - """Specify element data to be stored from the results file. - - /POST26 APDL Command: ESOL - - Parameters - ---------- - nvar - Arbitrary reference number assigned to this variable (2 to - NV [NUMVAR]). Overwrites any existing results for this - variable. - - elem - Element for which data are to be stored. - - node - Node number on this element for which data are to be - stored. If blank, store the average element value (except - for FMAG values, which are summed instead of averaged). - - item - Label identifying the item. General item labels are shown - in Table 134: ESOL - General Item and Component Labels - below. Some items also require a component label. - - comp - Component of the item (if required). General component - labels are shown in Table 134: ESOL - General Item and - Component Labels below. If Comp is a sequence number (n), - the NODE field will be ignored. - - name - Thirty-two character name for identifying the item on the - printout and displays. Defaults to a label formed by - concatenating the first four characters of the Item and - Comp labels. - - Notes - ----- - See Table: 134:: ESOL - General Item and Component Labels for - a list of valid item and component labels for element (except - line element) results. - - The ESOL command defines element results data to be stored - from a results file (FILE). Not all items are valid for all - elements. To see the available items for a given element, - refer to the input and output summary tables in the - documentation for that element. - - Two methods of data access are available via the ESOL - command. You can access some simply by using a generic label - (component name method), while others require a label and - number (sequence number method). - - Use the component name method to access general element data - (that is, element data generally available to most element - types or groups of element types). - - The sequence number method is required for data that is not - averaged (such as pressures at nodes and temperatures at - integration points), or data that is not easily described in a - generic fashion (such as all derived data for structural line - elements and contact elements, all derived data for thermal - line elements, and layer data for layered elements). - - Element results are in the element coordinate system, except - for layered elements where results are in the layer coordinate - system. Element forces and moments are in the nodal - coordinate system. Results are obtainable for an element at a - specified node. Further location specifications can be made - for some elements via the SHELL, LAYERP26, and FORCE commands. - - For more information on the meaning of contact status and its - possible values, see Reviewing Results in POST1 in the Contact - Technology Guide. - - Examples - -------- - Switch to the time-history postprocessor - - >>> mapdl.post26() - - Store the stress in the X direction for element 1 at node 1 - - >>> nvar = 2 - >>> mapdl.esol(nvar, 1, 1, 'S', 'X') - - Move the value to an array and access it via mapdl.parameters - - >>> mapdl.dim('ARR', 'ARRAY', 1) - >>> mapdl.vget('ARR', nvar) - >>> mapdl.parameters['ARR'] - array(-1991.40234375) - - """ - command = f"ESOL,{nvar},{elem},{node},{item},{comp},{name}" - return self.run(command, **kwargs) - - def gapf(self, nvar="", num="", name="", **kwargs): - """Defines the gap force data to be stored in a variable. - - APDL Command: GAPF - - Parameters - ---------- - nvar - Arbitrary reference number assigned to this variable (2 to NV - [NUMVAR]). Overwrites any existing results for this variable. - - num - Number identifying gap number for which the gap force is to be - stored. Issue the GPLIST command to display gap numbers. - - name - Thirty-two character name for identifying the item on the printout - and displays (defaults to the name GAPF). - - Notes - ----- - Defines the gap force data to be stored in a variable. Applicable only - to the expansion pass of the mode-superposition linear transient - dynamic (ANTYPE,TRANS) analysis. The data is usually on Fname.RDSP. - """ - command = f"GAPF,{nvar},{num},{name}" - return self.run(command, **kwargs) - - def gssol(self, nvar="", item="", comp="", name="", **kwargs): - """Specifies which results to store from the results file when using - - APDL Command: GSSOL - generalized plane strain. - - Parameters - ---------- - nvar - Arbitrary reference number or name assigned to this variable. - Variable numbers can be 2 to NV (NUMVAR) while the name can be an - eight byte character string. Overwrites any existing results for - this variable. - - item - Label identifying item to be stored. - - LENGTH - Change of fiber length at the ending point. - - ROT - Rotation of the ending plane during deformation. - - F - Reaction force at the ending point in the fiber direction. - - M - Reaction moment applied on the ending plane. - - comp - Component of the item, if Item = ROT or M. - - X - The rotation angle or reaction moment of the ending plane about X. - - Y - The rotation angle or reaction moment of the ending plane about Y. - - name - Thirty-two character name identifying the item on the printout and - display. Defaults to the label formed by concatenating the first - four characters of the Item and Comp labels. - - Notes - ----- - This command stores the results (new position of the ending plane after - deformation) for generalized plane strain. All outputs are in the - global Cartesian coordinate system. For more information about the - generalized plane strain feature, see Generalized Plane Strain Option - of Current-Technology Solid Elements in the Element Reference. - """ - command = f"GSSOL,{nvar},{item},{comp},{name}" - return self.run(command, **kwargs) - - def jsol(self, nvar="", elem="", item="", comp="", name="", **kwargs): - """Specifies result items to be stored for the joint element. - - APDL Command: JSOL - - Parameters - ---------- - nvar - Arbitrary reference number or name assigned to this variable. - Variable numbers can be 2 to NV (NUMVAR) while the name can be an - eight-byte character string. Overwrites any existing results for - this variable. - - elem - Element number for which to store results. - - item - Label identifying the item. Valid item labels are shown in - Table 202: JSOL - Valid Item and Component Labels below. - - comp - Component of the Item (if required). Valid component labels are - shown in Table 202: JSOL - Valid Item and Component Labels below. - - name - Thirty-two character name identifying the item on printouts and - displays. Defaults to a label formed by concatenating the first - four characters of the Item and Comp labels. - - Notes - ----- - This command is valid for the MPC184 joint elements. The values stored - are for the free or unconstrained degrees of freedom of a joint - element. Relative reaction forces and moments are available only if - stiffness, damping, or friction is associated with the joint element. - - Table: 202:: : JSOL - Valid Item and Component Labels - - - """ - command = f"JSOL,{nvar},{elem},{item},{comp},{name}" - return self.run(command, **kwargs) - - def nsol(self, nvar="", node="", item="", comp="", name="", sector="", **kwargs): - """Specifies nodal data to be stored from the results file. - - APDL Command: NSOL - - Parameters - ---------- - nvar - Arbitrary reference number or name assigned to this variable. - Variable numbers can be 2 to NV (NUMVAR) while the name can be an - eight byte character string. Overwrites any existing results for - this variable. - - node - Node for which data are to be stored. - - item - Label identifying the item. Valid item labels are shown in the - table below. Some items also require a component label. - - comp - Component of the item (if required). Valid component labels are - shown in the table below. - - name - Thirty-two character name identifying the item on printouts and - displays. Defaults to a label formed by concatenating the first - four characters of the Item and Comp labels. - - sector - For a full harmonic cyclic symmetry solution, the sector number for - which the results from NODE are to be stored. - - Notes - ----- - Stores nodal degree of freedom and solution results in a variable. For - more information, see Data Interpreted in the Nodal Coordinate System - in the Modeling and Meshing Guide. - - For SECTOR>1, the result is in the nodal coordinate system of the base - sector, and it is rotated to the expanded sector’s location. Refer to - Using the /CYCEXPAND Command in the Cyclic Symmetry Analysis Guide for - more information. - - For SHELL131 and SHELL132 elements with KEYOPT(3) = 0 or 1, use the - labels TBOT, TE2, TE3, . . ., TTOP instead of TEMP. - """ - command = f"NSOL,{nvar},{node},{item},{comp},{name},{sector}" - return self.run(command, **kwargs) - - def nstore(self, tinc="", **kwargs): - """Defines which time points are to be stored. - - APDL Command: NSTORE - - Parameters - ---------- - tinc - Store data associated with every TINC time (or frequency) point(s), - within the previously defined range of TMIN to TMAX [TIMERANGE]. - (Defaults to 1) - - Notes - ----- - Defines which time (or frequency) points within the range are to be - stored. - """ - command = f"NSTORE,{tinc}" - return self.run(command, **kwargs) - - def numvar(self, nv="", **kwargs): - """Specifies the number of variables allowed in POST26. - - APDL Command: NUMVAR - - Parameters - ---------- - nv - Allow storage for NV variables. 200 maximum are allowed. Defaults - to 10 (except for an explicit dynamics analysis, which defaults to - 30). TIME (variable 1) should also be included in this number. - - Notes - ----- - Specifies the number of variables allowed for data read from the - results file and for data resulting from an operation (if any). For - efficiency, NV should not be larger than necessary. NV cannot be - changed after data storage begins. - """ - command = f"NUMVAR,{nv}" - return self.run(command, **kwargs) - - def reset(self, **kwargs): - """Resets all POST1 or POST26 specifications to initial defaults. - - APDL Command: RESET - - Notes - ----- - Has the same effect as entering the processor the first time within the - run. In POST1, resets all specifications to initial defaults, erases - all element table items, path table data, fatigue table data, and load - case pointers. In POST26, resets all specifications to initial - defaults, erases all variables defined, and zeroes the data storage - space. - """ - command = f"RESET," - return self.run(command, **kwargs) - - def rforce(self, nvar="", node="", item="", comp="", name="", **kwargs): - """Specifies the total reaction force data to be stored. - - APDL Command: RFORCE - - Parameters - ---------- - nvar - Arbitrary reference number assigned to this variable (2 to NV - [NUMVAR]). Overwrites any existing results for this variable. - - node - Node for which data are to be stored. If NODE = P, graphical - picking is enabled (valid only in the GUI). - - item - Label identifying the item. Valid item labels are shown in the - table below. Some items also require a component label. - - comp - Component of the item (if required). Valid component labels are - shown in the table below. - - name - Thirty-two character name identifying the item on printouts and - displays. Defaults to an eight character label formed by - concatenating the first four characters of the Item and Comp - labels. - - Notes - ----- - Defines the total reaction force data (static, damping, and inertial - components) to be stored from single pass (ANTYPE,STATIC or TRANS) - solutions or from the expansion pass of mode-superposition - (ANTYPE,HARMIC or TRANS) solutions. - - Table: 228:: : RFORCE - Valid Item and Component Labels - - For SHELL131 and SHELL132 elements with KEYOPT(3) = 0 or 1, use the - labels HBOT, HE2, HE3, . . ., HTOP instead of HEAT. - """ - command = f"RFORCE,{nvar},{node},{item},{comp},{name}" - return self.run(command, **kwargs) - - def rgb( - self, - kywrd="", - pred="", - pgrn="", - pblu="", - n1="", - n2="", - ninc="", - ncntr="", - **kwargs, - ): - """Specifies the RGB color values for indices and contours. - - APDL Command: /RGB - - Parameters - ---------- - kywrd - Determines how RGB modifications will be applied. - - INDEX - Specifies that subsequent color values apply to ANSYS color indices (0-15). - - CNTR - Specifies that subsequent color values apply to contours (1-128). Applies to - C-option devices only (i.e. X11C or Win32C). - - pred - Intensity of the color red, expressed as a percentage. - - pgrn - Intensity of the color green, expressed as a percentage. - - pblu - Intensity of the color blue, expressed as a percentage. - - n1 - First index (0-15), or contour (1-128) to which the designated RGB - values apply. - - n2 - Final index (0-15), or contour (1-128) to which the designated RGB - values apply. - - ninc - The step increment between the values N1 and N2 determining which - contours or indices will be controlled by the specified RGB values. - - ncntr - The new maximum number of contours (1-128). - - Notes - ----- - Issuing the /CMAP command (with no filename) will restore the default - color settings. - """ - command = f"/RGB,{kywrd},{pred},{pgrn},{pblu},{n1},{n2},{ninc},{ncntr}" - return self.run(command, **kwargs) - - def solu(self, nvar="", item="", comp="", name="", **kwargs): - """Specifies solution summary data per substep to be stored. - - APDL Command: SOLU - - Parameters - ---------- - nvar - Arbitrary reference number assigned to this variable (2 to NV - [NUMVAR]). - - item - Label identifying the item. Valid item labels are shown in the - table below. Some items may also require a component label. - - comp - Component of the item (if required). Valid component labels are - shown in the table below. None are currently required. - - name - Thirty-two character name identifying the item on printouts and - displays. Defaults to an eight character label formed by - concatenating the first four characters of the Item and Comp - labels. - - Notes - ----- - See also the PRITER command of POST1 to display some of these items - directly. Valid for a static or full transient analysis. All other - analyses have zeros for the data. Valid item and component labels for - solution summary values are: - """ - command = f"SOLU,{nvar},{item},{comp},{name}" - return self.run(command, **kwargs) - - def store(self, lab="", npts="", **kwargs): - """Stores data in the database for the defined variables. - - APDL Command: STORE - - Parameters - ---------- - lab - Valid labels: - - MERGE - Merge data from results file for the time points in memory with the existing - data using current specifications (default). - - NEW - Store a new set of data, replacing any previously stored data with current - result file specifications and deleting any previously- - calculated (OPER) variables. Variables defined using the - ANSOL command are also deleted. - - APPEN - Append data from results file to the existing data. - - ALLOC - Allocate (and zero) space for NPTS data points. - - PSD - Create a new set of frequency points for PSD calculations (replacing any - previously stored data and erasing any previously calculated - data). - - npts - The number of time points (or frequency points) for storage (used - only with Lab = ALLOC or PSD). The value may be input when using - POST26 with data supplied from other than a results file. This - value is automatically determined from the results file data with - the NEW, APPEN, and MERGE options. For the PSD option, NPTS - determines the resolution of the frequency vector (valid numbers - are between 1 and 10, defaults to 5). - - Notes - ----- - This command stores data from the results file in the database for the - defined variables [NSOL, ESOL, SOLU, JSOL] per specification [FORCE, - LAYERP26, SHELL]. See the Basic Analysis Guide for more information. - - The STORE,PSD command will create a new frequency vector (variable 1) - for response PSD calculations [RPSD]. This command should first be - issued before defining variables [NSOL, ESOL, RFORCE] for which - response PSD's are to be calculated. - """ - command = f"STORE,{lab},{npts}" - return self.run(command, **kwargs) - - def timerange(self, tmin="", tmax="", **kwargs): - """Specifies the time range for which data are to be stored. - - APDL Command: TIMERANGE - - Parameters - ---------- - tmin - Minimum time (defaults to first time (or frequency) point on the - file). - - tmax - Maximum time (defaults to last time (or frequency) point on the - file). - - Notes - ----- - Defines the time (or frequency) range for which data are to be read - from the file and stored in memory. Use the NSTORE command to define - the time increment. - - Use PRTIME or PLTIME to specify the time (frequency) range for cyclic - mode-superposition harmonic analyses. - """ - command = f"TIMERANGE,{tmin},{tmax}" - return self.run(command, **kwargs) - - def vardel(self, nvar="", **kwargs): - """Deletes a variable (GUI). - - APDL Command: VARDEL - - Parameters - ---------- - nvar - The reference number of the variable to be deleted. NVAR is as - defined by NSOL, ESOL, etc. - - Notes - ----- - Deletes a POST26 solution results variable. This is a command - generated by the Graphical User Interface (GUI). It will appear in the - log file (Jobname.LOG) if a POST26 variable is deleted from the - "Defined Time-History Variables" dialog box. This command is not - intended to be typed in directly in an ANSYS session (although it can - be included in an input file for batch input or for use with the /INPUT - command). - """ - command = f"VARDEL,{nvar}" - return self.run(command, **kwargs) - - def varnam(self, ir="", name="", **kwargs): - """Names (or renames) a variable. - - APDL Command: VARNAM - - Parameters - ---------- - ir - Reference number of the variable (2 to NV [NUMVAR]). - - name - Thirty-two character name for identifying variable on printouts and - displays. Embedded blanks are compressed for output. - """ - command = f"VARNAM,{ir},{name}" - return self.run(command, **kwargs) diff --git a/src/ansys/mapdl/core/_commands/post26_/special.py b/src/ansys/mapdl/core/_commands/post26_/special.py deleted file mode 100644 index 695d44e3ac7..00000000000 --- a/src/ansys/mapdl/core/_commands/post26_/special.py +++ /dev/null @@ -1,539 +0,0 @@ -# Copyright (C) 2016 - 2025 ANSYS, Inc. and/or its affiliates. -# SPDX-License-Identifier: MIT -# -# -# Permission is hereby granted, free of charge, to any person obtaining a copy -# of this software and associated documentation files (the "Software"), to deal -# in the Software without restriction, including without limitation the rights -# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -# copies of the Software, and to permit persons to whom the Software is -# furnished to do so, subject to the following conditions: -# -# The above copyright notice and this permission notice shall be included in all -# copies or substantial portions of the Software. -# -# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -# SOFTWARE. - - -class Special: - def cvar(self, ir="", ia="", ib="", itype="", datum="", name="", **kwargs): - """Computes covariance between two quantities. - - APDL Command: CVAR - - Parameters - ---------- - ir - Arbitrary reference number assigned to the resulting variable (2 to - NV [NUMVAR]). If this number is the same as for a previous - variable, the previous variable will be overwritten with this - result. - - ia, ib - Reference numbers of the two variables to be operated on. If only - one, leave ``IB`` blank. - - itype - Defines the type of response PSD to be calculated: - - * ``0,1`` - Displacement (default). - - * ``2`` - Velocity. - - * ``3`` - Acceleration. - - datum - Defines the reference with respect to which covariance is to be - calculated: - - * ``1`` - Absolute value. - - * ``2`` - Relative to base (default). - - name - Thirty-two character name for identifying the variable on listings - and displays. Embedded blanks are compressed upon output. - - Notes - ----- - This command computes the covariance value for the variables referenced - by the reference numbers IA and IB. If DATUM = 2, the variable - referenced by IR will contain the individual modal contributions (i.e., - the dynamic or relative values). If DATUM = 1, the variable referenced - by IR will contain the modal contributions followed by the - contributions of pseudo-static and covariance between dynamic and - pseudo-static responses. File.PSD must be available for the - calculations to occur. - """ - command = f"CVAR,{ir},{ia},{ib},{itype},{datum},{name}" - return self.run(command, **kwargs) - - def pmgtran( - self, - fname="", - freq="", - fcnam1="", - fcnam2="", - pcnam1="", - pcnam2="", - ecnam1="", - ccnam1="", - **kwargs, - ): - """Summarizes electromagnetic results from a transient analysis. - - APDL Command: PMGTRAN - - Parameters - ---------- - fname - File name (8 characters maximum) to which tabular data and plot - files will be written. Must be enclosed in single quotes when the - command is manually typed in. Defaults to ``MG_TRNS``. The data file - extension is ``.OUT`` and the plot file extension is ``.PLT``. - - freq - Frequency of solution output. Defaults to 1. Every FREQth - solution on the results file is output. - - fcnam1, fcnam2 - Names of element components for force calculation. Must be - enclosed in single quotes when the command is manually typed in. - - pcnam1, pcnam2 - Names of element components for power loss calculation. Must be - enclosed in single quotes when the command is manually typed in. - - ecnam1, ccnam1 - Names of element components for energy and total current - calculations, respectively. Must be enclosed in single quotes when - the command is manually typed in. - - Notes - ----- - ``PMGTRAN`` invokes an ANSYS macro which calculates and summarizes - electromagnetic results from a transient analysis. The results are - summarized by element components and listed on the screen as well as - written to a file (``Fname.OUT``). Also, graph plots of results as a - function of time are created and written to a file (``Fname.PLT``) for use - in the ``DISPLAY`` program. - - Two components may be selected for the summary of electromagnetic - forces (see ``FMAGSUM``), two for power loss, and one each for stored - energy (see ``SENERGY``) and total current (see ``CURR2D``). See the - referenced commands for other restrictions. - - PMGTRAN is restricted to MKSA units. - - Distributed ANSYS Restriction: This command is not supported in - Distributed ANSYS. - """ - command = f"PMGTRAN,{fname},{freq},{fcnam1},{fcnam2},{pcnam1},{pcnam2},{ecnam1},{ccnam1}" - return self.run(command, **kwargs) - - def rcyc(self, ir="", ia="", sector="", name="", **kwargs): - """Calculates cyclic results for a mode-superposition harmonic solution. - - APDL Command: RCYC - - Parameters - ---------- - ir - Arbitrary reference number assigned to the resulting variable (2 to - NV [NUMVAR]). If this number is the same as for a previous - variable, the previous variable will be overwritten with this - result. - - ia - Reference number of the variable to be operated on. - - sector - Sector number to calculate the results for. - - name - Thirty-two character name identifying the variable on listings and - displays. Embedded blanks are compressed for output. - - Notes - ----- - This command calculates the harmonic response in the sector specified - by SECTOR for the variable referenced by the reference number IA. Only - component values for IA are valid (no principles or sums). The variable - specified by IR will contain the harmonic solution. Jobname.RFRQ from - the cyclic mode-superposition harmonic solve and Jobname.RST or - Jobname.RSTP from the cyclic modal solve must be available for the - calculations to occur. The Jobname must be the same for the cyclic - modal solve and the cyclic mode-superposition harmonic solve. - - For SECTOR > 1, the result is in the nodal coordinate system of the - base sector, and it is rotated to the expanded sector’s location. Refer - to Using the /CYCEXPAND Command in the Cyclic Symmetry Analysis Guide - for more information. - - See also Mode-Superposition Harmonic Cyclic Symmetry Analysis in the - Cyclic Symmetry Analysis Guide. - """ - command = f"RCYC,{ir},{ia},{sector},{name}" - return self.run(command, **kwargs) - - def resp( - self, - ir="", - lftab="", - ldtab="", - spectype="", - dampratio="", - dtime="", - tmin="", - tmax="", - inputtype="", - **kwargs, - ): - """Generates a response spectrum. - - APDL Command: RESP - - Parameters - ---------- - ir - Arbitrary reference number assigned to the response spectrum - results (2 to NV [NUMVAR]). If this number is the same as for a - previously defined variable, the previously defined variable will - be overwritten with these results. - - lftab - Reference number of variable containing frequency table (created - with FILLDATA or DATA command). The frequency table defines the - number and frequency of oscillating systems used to determine the - response spectrum. The frequency interval need not be constant over - the entire range. Frequencies must be input in ascending order. - - ldtab - Reference number of variable containing the input time-history. - - spectype - Defines the type of response spectrum to be calculated: - - * ``0`` or ``1`` - Displacement (relative to base excitation) - - * ``2`` - Velocity (relative to base excitation) - - * ``3`` - Acceleration response spectrum (absolute) - - * ``4`` - Pseudo-velocity - - * ``5`` - Pseudo-acceleration - - dampratio - Ratio of viscous damping to critical damping (input as a decimal - number). - - dtime - Integration time step. This value should be equal to or greater - than the integration time step used in the initial transient - analysis performed to generate the input time-history (LDTAB). - - tmin, tmax - Specifies a subset of the displacement-time history to be used in - the response spectrum calculation. Defaults to the full time - range. - - inputtype - Defines the type of the input time-history: - - * ``0`` - Displacement (default) - - * ``1`` - Acceleration - - Notes - ----- - This command generates a response spectrum from a displacement or - acceleration time-history and frequency data. The response spectrum is - defined as the maximum response of single degree of freedom systems of - varying frequency (or period) to a given input support excitation. - - A response spectrum analysis (``ANTYPE, SPECTR`` with ``SPOPT``, ``SPRS`` or ``MPRS``) - requires a response spectrum input. This input can be determined from - the response spectrum printout or display of this command. - - If a response spectrum is to be calculated from a given displacement - (or acceleration) time-history, the displacement time-history may be - input to a single one-element reduced linear transient dynamic - (``ANTYPE,TRANS``) analysis, so that the calculated output (which should be - the same as the input) will be properly located on the file. - - The integration time step (argument ``DTIME`` on the RESP command) and the - damping coefficient (argument dampRatio) are constant over the - frequency range. The number of calculations done per response spectrum - curve is the product of the number of input solution points ``(TMAX- - TMIN)/DTIME`` and the number of frequency points (frequencies located in - variable LFTAB). - - Input solution points requested (using ``DTIME`` and the frequency range) - at a time not corresponding to an actual displacement solution time on - the file are linearly interpolated with respect to the existing points. - - For the details of the response spectrum calculation, see POST26 - - Response Spectrum Generator (RESP). - """ - command = f"RESP,{ir},{lftab},{ldtab},{spectype},{dampratio},{dtime},{tmin},{tmax},{inputtype}" - return self.run(command, **kwargs) - - def rpsd( - self, - ir="", - ia="", - ib="", - itype="", - datum="", - name="", - signif="", - **kwargs, - ): - """Calculates response power spectral density (PSD). - - APDL Command: RPSD - - Parameters - ---------- - ir - Arbitrary reference number assigned to the resulting variable (2 to - NV [NUMVAR]). If this number is the same as for a previous - variable, the previous variable will be overwritten with this - result. - - ia, ib - Reference numbers of the two variables to be operated on. If only - one, leave ``IB`` blank. - - itype - Defines the type of response PSD to be calculated: - - * ``0,1`` - Displacement (default). - - * ``2`` - Velocity. - - * ``3`` - Acceleration. - - datum - Defines the reference with respect to which response PSD is to be - calculated: - - * ``1`` - Absolute value. - - * ``2`` - Relative to base (default). - - name - Thirty-two character name identifying variable on listings and - displays. Embedded blanks are compressed for output. - - signif - Combine only those modes whose significance level exceeds the - ``SIGNIF`` threshold. The significance level is defined as the modal - covariance matrix term divided by the maximum of all the modal - covariance matrix terms. Any term whose significance level is less - than ``SIGNIF`` is considered insignificant and does not contribute to - the response. All modes are taken into account by default (``SIGNIF = - 0.0``). - - Notes - ----- - This command calculates response power spectral density (PSD) for the - variables referenced by the reference numbers IA and IB. The variable - referred by IR will contain the response PSD. You must issue the - STORE,PSD command first; File.PSD must be available for the - calculations to occur. - - 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}" - return self.run(command, **kwargs) - - def smooth( - self, - vect1="", - vect2="", - datap="", - fitpt="", - vect3="", - vect4="", - disp="", - **kwargs, - ): - """Allows smoothing of noisy data and provides a graphical representation - - APDL Command: SMOOTH - of the data. - - Parameters - ---------- - vect1 - Name of the first vector that contains the noisy data set (i.e., - independent variable). You must create and fill this vector before - issuing ``SMOOTH``. - - vect2 - Name of the second vector that contains the dependent set of data. - Must be the same length as the first vector. You must create and - fill this vector before issuing ``SMOOTH``. - - datap - Number of data points to be fitted, starting from the beginning of - the vector. If left blank, the entire vector will be fitted. The - maximum number of data points is 100,000 (or greater, depending on - the memory of the computer). - - fitpt - Order of the fitting curve that will be used as a smooth - representation of the data. This number should be less than or - equal to the number of the data points. Default (blank) is one-half - the number of data points. Maximum number of smoothed data fitting - order is the number of data points up to 50. Depending on this - number, the smoothed curve will be one of the following: - - * ``1`` - Curve is the absolute average of all of the data points. - - * ``2`` - Curve is the least square average of all of the data points. - - * ``3`` or more - Curve is a polynomial of the order (n-1), where n is the number of data fitting - order points. - - vect3 - Name of the vector that contains the smoothed data of the - independent variable. This vector should have a length equal to or - greater than the number of smoothed data points. In batch (command) - mode, you must create this vector before issuing the ``SMOOTH`` - command. In interactive mode, the GUI automatically creates this - vector (if it does not exist). If you do not specify a vector name, - the GUI will name the vector smth_ind. - - vect4 - Name of the vector that contains the smoothed data of the dependent - variable. This vector must be the same length as Vect3. In batch - (command) mode, you must create this vector before issuing the - ``SMOOTH`` command. In interactive mode, the GUI automatically creates - this vector (if it does not exist). If you do not specify a vector - name, the GUI will name the vector smth_dep. - - disp - Specifies how you want to display data. No default; you must - specify an option. - - * ``1`` - Unsmoothed data only - - * ``2`` - Smoothed data only - - * ``3`` - Both smoothed and unsmoothed data - - Notes - ----- - You can control the attributes of the graph using standard ANSYS - controls (``/GRID``, ``/GTHK``, ``/COLOR``, etc.). If working interactively, these - controls appear in this dialog box for convenience, as well as in their - standard dialog boxes. You must always create Vect1 and Vect2 (using - ``*DIM``) and fill these vectors before smoothing the data. If you're - working interactively, ANSYS automatically creates Vect3 and Vect4, but - if you're working in batch (command) mode, you must create Vect3 and - Vect4 (using ``*DIM``) before issuing SMOOTH. Vect3 and Vect4 are then - filled automatically by ANSYS. In addition, ANSYS creates an - additional TABLE type array that contains the smoothed array and the - unsmoothed data to allow for plotting later with ``*VPLOT``. Column 1 in - this table corresponds to Vect1, column 2 to Vect2, and column 3 to - Vect4. This array is named Vect3_SMOOTH, up to a limit of 32 - characters. For example, if the array name is X1, the table name is - X1_SMOOTH. - - This command is also valid in PREP7 and SOLUTION. - """ - command = f"SMOOTH,{vect1},{vect2},{datap},{fitpt},{vect3},{vect4},{disp}" - return self.run(command, **kwargs) - - def vget(self, par="", ir="", tstrt="", kcplx="", **kwargs): - """Moves a variable into an array parameter vector. - - APDL Command: VGET - - Parameters - ---------- - par - Array parameter vector in the operation. - - ir - Reference number of the variable (1 to NV [NUMVAR]). - - tstrt - Time (or frequency) corresponding to start of IR data. If between - values, the nearer value is used. - - kcplx - Complex number key: - - * ``0`` - Use the real part of the IR data. - - * ``1`` - Use the imaginary part of the IR data. - - Notes - ----- - Moves a variable into an array parameter vector. The starting array - element number must be defined. For example, ``VGET,A(1),2`` moves - variable 2 (starting at time 0.0) to array parameter A. Looping - continues from array element ``A(1)`` with the index number incremented by - one until the variable is filled. The number of loops may be - controlled with the ``*VLEN`` command (except that loop skipping (``NINC``) is - not allowed). For multi-dimensioned array parameters, only the first - (row) subscript is incremented. - """ - command = f"VGET,{par},{ir},{tstrt},{kcplx}" - return self.run(command, **kwargs) - - def vput(self, par="", ir="", tstrt="", kcplx="", name="", **kwargs): - """Moves an array parameter vector into a variable. - - APDL Command: VPUT - - Parameters - ---------- - par - Array parameter vector in the operation. - - ir - Arbitrary reference number assigned to this variable (1 to NV - [NUMVAR]). Overwrites any existing results for this variable. - - tstrt - Time (or frequency) corresponding to start of IR data. If between - values, the nearer value is used. - - kcplx - Complex number key: - - * ``0`` - Use the real part of the IR data. - - * ``1`` - Use the imaginary part of the IR data. - - name - Thirty-two character name identifying the item on printouts and - displays. Defaults to the label formed by concatenating VPUT with - the reference number IR. - - Notes - ----- - At least one variable should be defined (``NSOL``, ``ESOL``, ``RFORCE``, etc.) - before using this command. The starting array element number must be - defined. For example,`` VPUT,A(1),2`` moves array parameter A to variable - 2 starting at time 0.0. Looping continues from array element ``A(1)`` with - the index number incremented by one until the variable is filled. - Unfilled variable locations are assigned a zero value. The number of - loops may be controlled with the ``*VLEN`` command (except that loop - skipping (``NINC``) is not allowed). For multi-dimensioned array - parameters, only the first (row) subscript is incremented. - """ - command = f"VPUT,{par},{ir},{tstrt},{kcplx},{name}" - return self.run(command, **kwargs) diff --git a/src/ansys/mapdl/core/_commands/post26_/status.py b/src/ansys/mapdl/core/_commands/post26_/status.py deleted file mode 100644 index fa3b84fc5db..00000000000 --- a/src/ansys/mapdl/core/_commands/post26_/status.py +++ /dev/null @@ -1,99 +0,0 @@ -# Copyright (C) 2016 - 2025 ANSYS, Inc. and/or its affiliates. -# SPDX-License-Identifier: MIT -# -# -# Permission is hereby granted, free of charge, to any person obtaining a copy -# of this software and associated documentation files (the "Software"), to deal -# in the Software without restriction, including without limitation the rights -# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -# copies of the Software, and to permit persons to whom the Software is -# furnished to do so, subject to the following conditions: -# -# The above copyright notice and this permission notice shall be included in all -# copies or substantial portions of the Software. -# -# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -# SOFTWARE. - - -class Status: - def define(self, **kwargs): - """Specifies "Data definition settings" as the subsequent status topic. - - APDL Command: DEFINE - - Notes - ----- - This is a status [STAT] topic command. Status topic commands are - generated by the GUI and will appear in the log file (Jobname.LOG) if - status is requested for some items under Utility Menu> List> Status. - This command will be immediately followed by a STAT command, which will - report the status for the specified topic. - - If entered directly into the program, the STAT command should - immediately follow this command. - """ - command = f"DEFINE," - return self.run(command, **kwargs) - - def operate(self, **kwargs): - """Specifies "Operation data" as the subsequent status topic. - - APDL Command: OPERATE - - Notes - ----- - This is a status [STAT] topic command. Status topic commands are - generated by the GUI and will appear in the log file (Jobname.LOG) if - status is requested for some items under Utility Menu> List> Status. - This command will be immediately followed by a STAT command, which will - report the status for the specified topic. - - If entered directly into the program, the STAT command should - immediately follow this command. - """ - command = f"OPERATE," - return self.run(command, **kwargs) - - def plotting(self, **kwargs): - """Specifies "Plotting settings" as the subsequent status topic. - - APDL Command: PLOTTING - - Notes - ----- - This is a status [STAT] topic command. Status topic commands are - generated by the GUI and will appear in the log file (Jobname.LOG) if - status is requested for some items under Utility Menu> List> Status. - This command will be immediately followed by a STAT command, which will - report the status for the specified topic. - - If entered directly into the program, the STAT command should - immediately follow this command. - """ - command = f"PLOTTING," - return self.run(command, **kwargs) - - def print(self, **kwargs): - """Specifies "Print settings" as the subsequent status topic. - - APDL Command: PRINT - - Notes - ----- - This is a status [STAT] topic command. Status topic commands are - generated by the GUI and will appear in the log file (Jobname.LOG) if - status is requested for some items under Utility Menu> List> Status. - This command will be immediately followed by a STAT command, which will - report the status for the specified topic. - - If entered directly into the program, the STAT command should - immediately follow this command. - """ - command = f"PRINT," - return self.run(command, **kwargs) diff --git a/src/ansys/mapdl/core/_commands/reduced/generation.py b/src/ansys/mapdl/core/_commands/reduced/generation.py deleted file mode 100644 index 699b5469049..00000000000 --- a/src/ansys/mapdl/core/_commands/reduced/generation.py +++ /dev/null @@ -1,493 +0,0 @@ -# Copyright (C) 2016 - 2025 ANSYS, Inc. and/or its affiliates. -# SPDX-License-Identifier: MIT -# -# -# Permission is hereby granted, free of charge, to any person obtaining a copy -# of this software and associated documentation files (the "Software"), to deal -# in the Software without restriction, including without limitation the rights -# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -# copies of the Software, and to permit persons to whom the Software is -# furnished to do so, subject to the following conditions: -# -# The above copyright notice and this permission notice shall be included in all -# copies or substantial portions of the Software. -# -# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -# SOFTWARE. - - -class Generation: - def rmalist(self, **kwargs): - """Lists all defined master nodes for a ROM method. - - APDL Command: RMALIST - - Notes - ----- - Distributed ANSYS Restriction: This command is not supported in - Distributed ANSYS. - """ - command = f"RMALIST," - return self.run(command, **kwargs) - - def rmanl(self, fname="", ext="", dimn="", oper="", **kwargs): - """Assigns model database, dimensionality, and operating - - APDL Command: RMANL - direction for the ROM method. - - Parameters - ---------- - fname - Database file name and directory path (248 characters maximum, - including directory). The file name defaults to Jobname. - - ext - File extension (8 character maximum). The extension defaults to db. - - dimn - Model dimensionality: - - 2 - 2-D models - - 3 - 3-D Models - - oper - Primary operating direction: - - X - direction - - Y - direction - - Z - direction - - Notes - ----- - Required Inputs: - - Distributed ANSYS Restriction: This command is not supported in - Distributed ANSYS. - """ - return self.run(f"RMANL,{fname},{ext},,{dimn},{oper}", **kwargs) - - def rmaster(self, node="", lab="", **kwargs): - """Defines master nodes for the ROM method. - - APDL Command: RMASTER - - Parameters - ---------- - node - Node number at which master degree of freedom is defined If Node = - P, graphical picking is enabled and all remaining command fields - are ignored (valid only in the GUI). - - lab - Valid labels are "ADD" (default) and "DEL". - - Notes - ----- - Defines master nodes for the ROM. Master nodes are used to track the - total displacement of a structure in the operating direction [RMANL]. - They may be used as attachment points for 1-D structural elements - during a ROM use pass via the UX degree of freedom. - - Distributed ANSYS Restriction: This command is not supported in - Distributed ANSYS. - """ - command = f"RMASTER,{node},{lab}" - return self.run(command, **kwargs) - - def rmcap(self, refname="", c1="", c2="", **kwargs): - """Defines lumped capacitance pairs between conductors C1 and C2 for a ROM - - APDL Command: RMCAP - method. - - Parameters - ---------- - refname - Reference name for capacitance pair definition. - - c1 - First conductor (between 1 and 5). - - c2 - Second conductor (between 1 and 5). - - Notes - ----- - For a capacitance definition between conductor C1 and C2, node - components COND%C1% and COND%C2% (see CM command) must be present - containing the conductor nodes. If C1 and C2 are blank, the capacitance - definition with RefName will be deleted. (For example, if C1 = 1, and - C2 = 2, then node components COND1 and COND2 must be defined). - - Distributed ANSYS Restriction: This command is not supported in - Distributed ANSYS. - """ - command = f"RMCAP,{refname},{c1},{c2}" - return self.run(command, **kwargs) - - def rmclist(self, **kwargs): - """Lists all lumped capacitance pairs defined. - - APDL Command: RMCLIST - - Notes - ----- - Distributed ANSYS Restriction: This command is not supported in - Distributed ANSYS. - """ - command = f"RMCLIST," - return self.run(command, **kwargs) - - def rmmlist(self, **kwargs): - """Lists all mode specifications for the ROM method. - - APDL Command: RMMLIST - - Notes - ----- - Distributed ANSYS Restriction: This command is not supported in - Distributed ANSYS. - """ - command = f"RMMLIST," - return self.run(command, **kwargs) - - def rmmrange( - self, - mode="", - key="", - min_="", - max_="", - nstep="", - damp="", - scale="", - **kwargs, - ): - """Defines and edits various modal parameters for the ROM method. - - APDL Command: RMMRANGE - - Parameters - ---------- - mode - Mode number. Must be lower or equal to the number of modes - extracted via the RMNEVEC command. - - key - Mode classification key. Valid keys are: - - DOMINANT - Dominant mode - - min\\_ - Lower bound for fit range of mode. - - max\\_ - Upper bound for fit range of mode. - - nstep - Number of equidistant steps in fit range of mode. - - damp - Modal damping factor. Defaults to 0.0. - - scale - Modal scaling factor. - - Notes - ----- - When selected manually (RMMSELECT), modes must be classified as - dominant, relevant, or unused. Dominant modes (Key = DOMINANT) are - basis functions with large amplitudes. Relevant modes (Key = RELEVANT) - are influenced by the dominant modes but do not cause interactions - among themselves due to the small amplitude. This assumption leads to - essential speed up of the sample point generator (see RMSMPLE). - - Distributed ANSYS Restriction: This command is not supported in - Distributed ANSYS. - """ - command = f"RMMRANGE,{mode},{key},{min_},{max_},{nstep},{damp},{scale}" - return self.run(command, **kwargs) - - def rmmselect(self, nmode="", method="", dmin="", dmax="", **kwargs): - """Selects modes for the ROM method. - - APDL Command: RMMSELECT - - Parameters - ---------- - nmode - Total number of modes to be selected - - method - Method for mode selection. Valid methods are: - - TMOD - Automated selection using a test load. TMOD must be enclosed in single quotes. - - dmin - Lower bound for total deflection range. - - dmax - Upper bound for total deflection range. - - Notes - ----- - Select pertinent modes for use in a ROM. Pertinent mode selection may - be enhanced by using the deflection state of the structure - representative of the operating nature of the device (Method = TMOD). A - static analysis with an applied Test Load may be used. The test load - displacements must be extracted at the neutral plane of the device (if - the device is stress-stiffened), or at any plane of the device (non- - stress-stiffened). A node component "NEUN" must be defined for the - plane of nodes, and the displacements extracted using the RMNDISP - command prior to issuing this command. If Method = NMOD, use the first - Nmode eigenmodes to select the pertinent modes for the ROM tool. Only - those modes are selected that act in the operating direction of the - structure [RMANL]. - - Distributed ANSYS Restriction: This command is not supported in - Distributed ANSYS. - - jobname.evx, jobname.evy, jobname.evz, jobname.evn, jobname.evl - - Test load and element load neutral plane displacement files: - jobname.tld, jobname.eld - """ - command = f"RMMSELECT,{nmode},{method},{dmin},{dmax}" - return self.run(command, **kwargs) - - def rmporder( - self, - ord1="", - ord2="", - ord3="", - ord4="", - ord5="", - ord6="", - ord7="", - ord8="", - ord9="", - **kwargs, - ): - """Defines polynomial orders for ROM functions. - - APDL Command: RMPORDER - - Parameters - ---------- - ord1, ord2, ord3, . . . , ord9 - Polynomial orders for modes. Ordi specifies the polynomial order - for modei. Modes are ordered as extracted from a modal analysis - using the RMNEVEC command. Defaults to 0 if mode i is unused; - default to nstep(i) -1 for dominant or relevant modes, where - nstep(i) is the number of equidistant steps in fit range of mode i. - nstep(i) is automatically set by RMMSELECT or modified by the - RMMRANGE command. - - Notes - ----- - Distributed ANSYS Restriction: This command is not supported in - Distributed ANSYS. - """ - command = ( - f"RMPORDER,{ord1},{ord2},{ord3},{ord4},{ord5},{ord6},{ord7},{ord8},{ord9}" - ) - return self.run(command, **kwargs) - - def rmrgenerate(self, **kwargs): - """Performs fitting procedure for all ROM functions to generate response - - APDL Command: RMRGENERATE - surfaces. - - Notes - ----- - The fitting procedure uses modal analysis data and function data - generated using the RMSMPLE command and specifications set forth in the - RMROPTIONS command. The files jobname_ijk.pcs (modes i, j, k) will be - generated containing the coefficients of the response surfaces. These - files are needed for the ROM Use Pass along with a ROM data base file - [RMSAVE]. - - Distributed ANSYS Restriction: This command is not supported in - Distributed ANSYS. - - Strain energy and capacitance data file jobname_ijk.dec - - Response surface coefficients jobname_ijk.pcs (modes i, j, k) - """ - command = f"RMRGENERATE," - return self.run(command, **kwargs) - - def rmroptions(self, refname="", type_="", invert="", **kwargs): - """Defines options for ROM response surface fitting. - - APDL Command: RMROPTIONS - - Parameters - ---------- - refname - Reference name of ROM function to be fitted. Valid reference names - are "SENE" for the strain energy of the structural domain and any - capacitance reference name previously defined by means of RMCAP - command for the electrostatic domain. - - type\\_ - Type of fitting function to be applied for regression analysis. - Valid types are: - - LAGRANGE - Lagrange type (default) - - invert - Flag to specify whether data should be inverted prior to fitting. - - 0 - Do not invert data (default for SENE) - - Notes - ----- - The objective of response surface fit is to compute an analytical - expression for the strain energy and the capacitance as functions of - modal amplitudes. - - Distributed ANSYS Restriction: This command is not supported in - Distributed ANSYS. - """ - command = f"RMROPTIONS,{refname},{type_},{invert}" - return self.run(command, **kwargs) - - def rmrplot(self, refname="", type_="", mode1="", mode2="", **kwargs): - """Plots response surface of ROM function or its derivatives with respect - - APDL Command: RMRPLOT - to the dominant mode(s). - - Parameters - ---------- - refname - Reference name of ROM function. Valid reference names are "SENE" - for the strain energy of the mechanical domain and any capacitance - definition, previously defined by means of the RMCAP command, for - the electrostatic domain. - - type\\_ - Type of data to be plotted. Valid types are: - - FUNC - Response surface (default) - - mode1 - First mode number (used for Type = "FIRST" and Type = "SECOND" - only). - - mode2 - Second mode number (used for Type = "SECOND" only). - - Notes - ----- - The objective of response surface fit is to compute an analytical - expression for the strain energy and the capacitance as functions of - modal amplitudes. This command assumes that the coefficient files - jobnam_ijk.pcs are available [RMRGENERATE]. Visualization of the - response surface will help to evaluate the validity of the function - fit. - - Distributed ANSYS Restriction: This command is not supported in - Distributed ANSYS. - """ - command = f"RMRPLOT,{refname},{type_},{mode1},{mode2}" - return self.run(command, **kwargs) - - def rmrstatus(self, refname="", **kwargs): - """Prints status of response surface for ROM function. - - APDL Command: RMRSTATUS - - Parameters - ---------- - refname - Reference name of ROM function. Valid reference names are "SENE" - for the strain energy of the mechanical domain and any capacitance - reference names [RMCAP], for the electrostatic domain. - - Notes - ----- - Distributed ANSYS Restriction: This command is not supported in - Distributed ANSYS. - """ - command = f"RMRSTATUS,{refname}" - return self.run(command, **kwargs) - - def rmsmple(self, nlgeom="", cap="", seqslv="", eeqslv="", **kwargs): - """Runs finite element solutions and obtains sample points for the ROM - - APDL Command: RMSMPLE - method. - - Parameters - ---------- - nlgeom - Specify whether a large or small deflection analysis is to be - performed for the mechanical domain: - - OFF (or 0) - Perform small deflection analysis (default). - - cap - Capacitance calculation method. - - CHARGE - Compute capacitance based on the charge voltage relationship (default). - - seqslv - Solver for structural analysis: - - SPARSE - Sparse direct equation solver (default). - - eeqslv - Solver for electrostatic analysis: - - SPARSE - Sparse direct equation solver (default). - - Notes - ----- - This command prepares and runs multiple finite element solutions on the - Structural domain and the Electrostatic domain of a model to collect - sample points of data for ROM response curve fitting. The command - requires a model database [RMANL] and two Physics Files (Structural - domain, titled "STRU" and an Electrostatic domain, titled "ELEC"; see - PHYSICS command). Also required is a complete ROM database generated - from the ROM Tools. The Cap = CHARGE method is preferred when - capacitance to "infinity" is not required. Capacitance conductor pairs - are defined by the RMCAP command. - - Distributed ANSYS Restriction: This command is not supported in - Distributed ANSYS. - - Strain energy and capacitance data files jobname_ijk.dec (mode i, j, - k). - """ - command = f"RMSMPLE,{nlgeom},{cap},{seqslv},{eeqslv}" - return self.run(command, **kwargs) - - def rmxport(self, **kwargs): - """Exports ROM model to external VHDL-AMS simulator. - - APDL Command: RMXPORT - - Notes - ----- - Use this command to generate all files necessary to run the ROM - analysis in an external VHDL-AMS Simulator. - - Distributed ANSYS Restriction: This command is not supported in - Distributed ANSYS. - - VHDL files: Initial.vhd, S_ams_ijk.vhd, Cxxx_ams_ijk.vhd, - transducer.vhd. - """ - command = f"RMXPORT," - return self.run(command, **kwargs) diff --git a/src/ansys/mapdl/core/_commands/reduced/preparation.py b/src/ansys/mapdl/core/_commands/reduced/preparation.py deleted file mode 100644 index 74e9c0f6c2d..00000000000 --- a/src/ansys/mapdl/core/_commands/reduced/preparation.py +++ /dev/null @@ -1,96 +0,0 @@ -# Copyright (C) 2016 - 2025 ANSYS, Inc. and/or its affiliates. -# SPDX-License-Identifier: MIT -# -# -# Permission is hereby granted, free of charge, to any person obtaining a copy -# of this software and associated documentation files (the "Software"), to deal -# in the Software without restriction, including without limitation the rights -# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -# copies of the Software, and to permit persons to whom the Software is -# furnished to do so, subject to the following conditions: -# -# The above copyright notice and this permission notice shall be included in all -# copies or substantial portions of the Software. -# -# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -# SOFTWARE. - - -class Preparation: - def rmndisp(self, loadt="", loc="", **kwargs): - """Extracts neutral plane displacements from a test load or element load - - APDL Command: RMNDISP - solution for the ROM method. - - Parameters - ---------- - loadt - Load type. Load type must be an alphanumeric string enclosed in - single quotes. Valid load types are 'TLOAD' for the test load and - 'ELOAD' for the element load. - - loc - Determines whether file will be overwritten or appended. Valid - labels are 'WRITE' or 'APPEND'. Defaults to 'WRITE' for test load. - - Notes - ----- - This command extracts the displacements at a neutral plane of a model. - If LoadT = 'TLOAD', extract displacements for a test load on a - structure that represents the expected deflection state. A test load - is used to assist in the automatic mode selection for the ROM mode - characterization. If LoadT = 'ELOAD', extract the neutral plane - displacements for an element load that will be used in the use pass of - a ROM analysis. Typical element loads are gravity, and pressure - loading. The element loads may be scaled [RMLVSCALE] during the use - pass. - - The command requires a node component named "NEUN" to be defined. These - nodes represent the nodes at the neutral plane of a structure (in the - case of a stress-stiffened structure), or at any plane in the structure - (non stress-stiffened case). - - For LoadT = 'TLOAD', node displacements are written to the file - jobname.tld. For LoadT = 'ELOAD', node displacements are written to - the file jobname.eld. Up to 5 element load cases may be written to the - file jobname.eld. - - This command is only valid in POST1. - - Distributed ANSYS Restriction: This command is not supported in - Distributed ANSYS. - """ - command = f"RMNDISP,{loadt},{loc}" - return self.run(command, **kwargs) - - def rmnevec(self, **kwargs): - """Extracts neutral plane eigenvectors from a modal analysis for the ROM - - APDL Command: RMNEVEC - method. - - Notes - ----- - This command extracts the eigenvectors at a neutral plane of a model - from a modal analysis. The modal analysis must have expanded modes - [MXPAND] in order to process the data. Only the first 9 modes are - considered. The command requires a node component named "NEUN" to be - defined. These nodes represent the nodes at the neutral plane of a - structure (in the case of a stress-stiffened structure), or at any - plane in the structure (non stress-stiffened case). - - This command is only valid in POST1. - - Distributed ANSYS Restriction: This command is not supported in - Distributed ANSYS. - - jobname.evx, jobname.evy, jobname.evz, jobname.evn, jobname.evl - """ - command = f"RMNEVEC," - return self.run(command, **kwargs) diff --git a/src/ansys/mapdl/core/_commands/reduced/use_pass.py b/src/ansys/mapdl/core/_commands/reduced/use_pass.py deleted file mode 100644 index 0589ea1c7a8..00000000000 --- a/src/ansys/mapdl/core/_commands/reduced/use_pass.py +++ /dev/null @@ -1,158 +0,0 @@ -# Copyright (C) 2016 - 2025 ANSYS, Inc. and/or its affiliates. -# SPDX-License-Identifier: MIT -# -# -# Permission is hereby granted, free of charge, to any person obtaining a copy -# of this software and associated documentation files (the "Software"), to deal -# in the Software without restriction, including without limitation the rights -# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -# copies of the Software, and to permit persons to whom the Software is -# furnished to do so, subject to the following conditions: -# -# The above copyright notice and this permission notice shall be included in all -# copies or substantial portions of the Software. -# -# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -# SOFTWARE. - - -class UsePass: - def dcvswp( - self, - option="", - elem="", - cnum="", - vmax="", - vinc1="", - vinc2="", - gap="", - **kwargs, - ): - """Performs a DC voltage sweep on a ROM element. - - APDL Command: DCVSWP - - Parameters - ---------- - option - Sweep option: - - GV - Perform voltage sweep up to given voltage Vmax. - - elem - Element number of the ROM element for the ROM use pass analysis. - - cnum - Number of sweep conductor. - - vmax - Maximum voltage. For the PI option, this voltage should be below - the pull-in voltage value. - - vinc1 - Voltage increment for Vmax (default = Vmax/20). - - vinc2 - Voltage increment for pull-in voltage (default = 1). - - gap - Gap elements option: - - 0 - Create gap elements (COMBIN40) (default). - - Notes - ----- - Vinc1 is used to ramp the sweep conductor voltage from 0 to Vmax. Vinc2 - is used to increase the sweep conductor voltage from Vmax to the pull- - in value if the PI sweep option is used. - - Because ramping the voltage may lead to the unstable region of an - electromechanical system, DCVSWP might not converge when the sweep - conductor voltage approaches the pull-in value. To avoid non-converged - solutions, you should use the gap option to create a set of spring-gap - elements (COMBIN40). By default, DCVSWP creates two spring-gap elements - with opposite orientations for each active modal displacement DOF of - the ROM element. The gap size is set to the maximum absolute values of - the deflection range for the corresponding mode, as calculated by - RMMSELECT or modified using the RMMRANGE command. The spring constants - are set to 1.E5 for all the COMBIN40 elements. Along with the spring- - gap elements, DCVSWP creates a set of constraint equations relating the - ROM element modal displacements DOF (EMF) and the displacement DOF (UX) - of the gap elements. Constraining the modal displacements using the - spring-gap elements allows DCVSWP to converge in the pull-in range. The - DCVSWP macro has a limit of 900 equilibrium iterations. If this limit - is not sufficient to reach convergence, try the advanced techniques - given in Overcoming Convergence Problems in the Structural Analysis - Guide. For more information on gap elements, see Using Gap Elements - with ROM144 in the Coupled-Field Analysis Guide. - - Distributed ANSYS Restriction: This command is not supported in - Distributed ANSYS. - """ - command = f"DCVSWP,{option},{elem},{cnum},{vmax},{vinc1},{vinc2},{gap}" - return self.run(command, **kwargs) - - def rmlvscale( - self, - nload="", - fact1="", - fact2="", - fact3="", - fact4="", - fact5="", - **kwargs, - ): - """Defines element load vector scaling for a ROM use pass. - - APDL Command: RMLVSCALE - - Parameters - ---------- - nload - Total number of load cases to be considered within a ROM use pass. - If Nload = "DELETE", all defined load vectors are deleted. - - fact1, fact2, fact3, . . . , fact5 - Scale factors applied to load vectors (maximum 5). Defaults to 0. - - Notes - ----- - Specifies the element load scale factor applied to a ROM analysis use - pass. Element load vectors are extracted from a Static Analysis using - the RMNDISP command. Up to 5 element load vectors may be scaled and - applied to a ROM use pass. - - Distributed ANSYS Restriction: This command is not supported in - Distributed ANSYS. - """ - command = f"RMLVSCALE,{nload},{fact1},{fact2},{fact3},{fact4},{fact5}" - return self.run(command, **kwargs) - - def rmuse(self, option="", usefil="", **kwargs): - """Activates ROM use pass for ROM elements. - - APDL Command: RMUSE - - Parameters - ---------- - option - Type of data to be plotted. Valid types are: - - 1 or "ON" - Activates ROM use pass. - - usefil - Name of the reduced displacement file (.rdsp) created by the ROM - Use Pass (required field only for the Expansion Pass). - - Notes - ----- - Distributed ANSYS Restriction: This command is not supported in - Distributed ANSYS. - """ - command = f"RMUSE,{option},{usefil}" - return self.run(command, **kwargs) diff --git a/src/ansys/mapdl/core/_commands/session/__init__.py b/src/ansys/mapdl/core/_commands/session/__init__.py index eff5c0cf7fb..43083dd6224 100644 --- a/src/ansys/mapdl/core/_commands/session/__init__.py +++ b/src/ansys/mapdl/core/_commands/session/__init__.py @@ -20,4 +20,9 @@ # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE # SOFTWARE. -from . import files, list_controls, processor_entry, run_controls +from . import ( + files, + list_controls, + processor_entry, + run_controls, +) diff --git a/src/ansys/mapdl/core/_commands/session/files.py b/src/ansys/mapdl/core/_commands/session/files.py index 438e3f4cc26..b83d9636e53 100644 --- a/src/ansys/mapdl/core/_commands/session/files.py +++ b/src/ansys/mapdl/core/_commands/session/files.py @@ -20,676 +20,744 @@ # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE # SOFTWARE. -"""These SESSION commands are for file operations, such as deleting, copying, and listing.""" - class Files: - def anstoasas(self, fname="", key="", **kwargs): - """Creates an ASAS input file from the current ANSYS model. - APDL Command: ANSTOASAS + def anstoaqwa( + self, + fname: str = "", + vertaxis: str = "", + gc: str = "", + rho: str = "", + hwl: str = "", + diffkey: int | str = "", + symxkey: int | str = "", + symykey: int | str = "", + **kwargs, + ): + r"""Creates an AQWA-LINE input file from the current Mechanical APDL model. + + Mechanical APDL Command: `ANSTOAQWA `_ Parameters ---------- - fname - ASAS file name. Defaults to Jobname. + fname : str + AQWA file name. Defaults to :file:`Jobname`. - key - Key indicating type of file to produce: + vertaxis : str + Axis in the vertical direction: + + * ``Y (or 2)`` - Global Y axis. + + * ``Z (or 3)`` - Global Z axis (default). + + gc : str + Gravitational acceleration. Defaults to 9.81. + + rho : str + Density of water. Defaults to 1025.0. + + hwl : str + Waterline height in model coordinates. Defaults to 0.0. + + diffkey : int or str + Diffracting model key: + + * ``0`` - Create a non-diffracting AQWA model. + + * ``1`` - Create a diffracting AQWA model (default). + + symxkey : int or str + Key indicating if model is symmetric about the global XZ plane: - 0 - ASAS file for use by ANSYS Aqwa (no loads written). Creates the file - Fname.asas. + * ``0`` - No symmetry about XZ plane (default). - 1 - ASAS file (all data written, including loads). Creates the file Fname.asas. + * ``1`` - Use symmetry about XZ plane. Only include (or select) half the model. - 2 - ASAS(NL) file. Creates the file Fname.asnl. + symykey : int or str + Key indicating if model is symmetric about the global YZ plane: + + * ``0`` - No symmetry about YZ plane (default). + + * ``1`` - Use symmetry about YZ plane. Only include (or select) half the model. Notes ----- - This command creates an input file for the ANSYS Asas Finite Element - Analysis System from the model and loads currently in the database, - based on the currently selected set of elements. Most common structural - element types are written, as well as sections (or real constants), - materials, boundary conditions and loads, and solution and load step - options. - Data Written + .. _ANSTOAQWA_notes: - The following data is written: + This command creates the input file ``Fname``.aqwa for the Ansys Aqwa Multi-Body Hydrodynamics + System + for diffraction analysis in AQWA-LINE from the model currently in the database, based on the + currently selected set of elements. The selected set must only include the hull envelope; no + internal structure should be selected. - Solution control options + There should be a line of nodes defined at the waterline. Only those elements that are entirely + below the waterline will be specified as diffracting. If there are no waterline nodes, there will be + no diffracting elements at the waterline, which will severely reduce the accuracy of the diffraction + analysis. - Nodes + The translator maps PLANE42, SHELL63, and ``SHELL181`` elements to PANELs, and maps PIPE16 and + PIPE59 elements to TUBEs. It does not recognize any other element types. Any material or geometric + properties can be used for the shell elements, as AQWA does not need any properties at all and the + command does not use them. All the shell elements below the water must have their normals pointing + outward. - Elements + TUBE elements in AQWA have material density, outside diameter, wall thickness, added mass, and drag + coefficients, so appropriate properties should be used in the Mechanical APDL model. PIPE59 elements + can + have added mass and damping coefficients; these will be written to the file. The Mechanical APDL + program + uses the inertia coefficient C:sub:`M`, whereas AQWA uses the added mass coefficient C:sub:`A`, + where C:sub:`M` = (1 + C:sub:`A` ). This correction is made automatically. - Material data + This command contains some tables and extra information which can be inspected in the original + documentation pointed above. - Geometry data + In AQWA the vertical axis is always the Z-axis. The command can convert a model built with either + the Y or Z-axis vertical, but the X-axis must be horizontal and should preferably be along the + fore/aft axis of the vessel. If the structure is symmetric and you wish to use the symmetry options, + you must only select one half or one quarter of the model, as appropriate. If you model a complete + vessel and specify X symmetry, the AQWA model will contain two sets of coincident elements. - Section data + If you are working from a model created for a structural analysis, it will probably be necessary to + remesh the model as the structural mesh is most likely finer than needed for a diffraction analysis. - ANSYS element components (ASAS sets) + If you enter this command interactively (with the GUI active) and no data is provided for the + command options, the application prompts you for their values. - Boundary conditions + You must verify the completeness and accuracy of the data written. - Loads + **AQWA-LINE Notes** - Added mass (via MASS21 element) + .. _ANSTOAQWA_aqwa: - Details are provided in the following sections. + The file will specify restart stages 1-2 only. It has no options except REST, so AQWA may fail if + any of the elements are badly shaped. - Not all data is written. You must verify the completeness and accuracy - of the data. Only loading at the current step is transferred; hence, no - load step history is captured. + The total mass is obtained by integrating over the wetted surface area and adding the TUBE masses, + so it should be reasonably accurate. However, the integration used is not as accurate as that in + AQWA, so there may be a small difference between the weight and buoyancy, particularly if tubes + represent a large portion of the model. - Solution Control Options + The position of the CG is unknown. A point mass is placed at the water-line above the CB, but you + should change this to the correct position. - The ASAS project name is defined as "ANSYS". + The moments of inertia are estimated based on the overall dimensions of the model and using standard + formulae for a ship. You should change these to the correct values. - The solution control options are converted as follows: + The maximum frequency is calculated from the maximum side length of the underwater elements. The + range of frequencies runs from 0.1 rad/s to the calculated maximum, in steps of 0.1 rad/s. - JOB: STAT SPIT: KGEOM + The directions are in steps of 15° over a range that is determined by the symmetry you have + specified, in accordance with the requirements of AQWA. + """ + command = f"ANSTOAQWA,{fname},{vertaxis},{gc},{rho},{hwl},{diffkey},{symxkey},{symykey}" + return self.run(command, **kwargs) - JOB: STAT SPIT: KGEOM + def anstoasas(self, fname: str = "", key: int | str = "", **kwargs): + r"""Creates an ASAS input file from the current Mechanical APDL model. - For conversion to ASAS(NL), the large displacement option is set based - on NLGEOM, final load solution time is set based on TIME, and sub-step - times are set based on DELTIM or NSUBST (assuming constant step size). + Mechanical APDL Command: `ANSTOASAS `_ - Element Data + Parameters + ---------- + fname : str + ASAS file name. Defaults to :file:`Jobname`. - If you intend to use the data only with AQWA-WAVE, only the elements - that form the wetted surface are required. Selecting these elements - before invoking the ANSTOASAS command will improve performance. In - order for AQWA-WAVE to identify the direction of the wave loading, all - elements must be defined by nodes in a clockwise direction. For further - information, refer to the AQWA-WAVE manual. + key : int or str + Key indicating type of file to produce: - The element types are converted as follows: + * ``0`` - ASAS file for use by Ansys Aqwa (no loads written). Creates the file ``Fname``.asas. - SPR1: SPR2: if: rotational: spring: FLA2: (ASAS(L): only): if: - nodes: are: not: coincident: and: longitudinal: spring: + * ``1`` - ASAS file (all data written, including loads). Creates the file ``Fname``.asas. - QUM4: TRM3: -: if: Triangular + * ``2`` - ASAS(NL) file. Creates the file ``Fname``.asnl. - BRK8: TET4: -: if: Tetrahedral: BRK6: -: if: Prism + Notes + ----- - QUS4: TBC3: -: if: Triangular + .. _ANSTOASAS_notes: - QUM8: TRM6: -: if: Triangular + This command creates an input file for the Ansys Asas Finite Element Analysis System from the model + and loads currently in the database, based on the currently selected set of elements. Most common + structural element types are written, as well as sections (or real constants), materials, boundary + conditions and loads, and solution and load step options. - BR20: TE10: -: if: Tetrahedral: : BR15: -: if: Prism + **Data Written** - QUS4: TBC3: -: if: Triangular + The following data is written: - QUM4: TRM3: -: if: Triangular + * :ref:`Solution control options ` - QUM8: TRM6: -: if: Triangular + * Nodes - BRK8: TET4: -: if: Tetrahedral: BRK6: -: if: Prism + * :ref:`Elements ` - BR20: TE10: -: if: Tetrahedral: BR15: -: if: Prism + * :ref:`Material data ` - TCBM: -: if: ASAS(L): STF4: -: if: ASAS(NL) + * :ref:`Geometry data ` - Documentation for this legacy element type appears in the Feature - Archive. + * :ref:`Section data ` - Material Data + * Mechanical APDL element components (ASAS sets) - Linear isotropic material conversion is supported for ASAS and - ASAS(NL). + * :ref:`Boundary conditions ` - Geometry Data - """ - command = "ANSTOASAS,%s,%s" % (str(fname), str(key)) - return self.run(command, **kwargs) + * :ref:`Loads ` - def anstoaqwa( - self, - fname="", - vertaxis="", - gc="", - rho="", - hwl="", - diffkey="", - symxkey="", - symykey="", - **kwargs, - ): - """Creates an AQWA-LINE input file from the current ANSYS model. + * Added mass (via ``MASS21`` element) - APDL Command: ANSTOAQWA + Details are provided in the following sections. - Parameters - ---------- - fname - AQWA file name. Defaults to Jobname. + Not all data is written. You must verify the completeness and accuracy of the data. Only loading at + the current step is transferred; hence, no load step history is captured. - vertaxis - Axis in the vertical direction: + .. _solconop: - Y (or 2) - Global Y axis. + .. rubric:: **Solution Control Options** - Z (or 3) - Global Z axis (default). + The ASAS project name is defined as "Ansys". - gc - Gravitational acceleration. Defaults to 9.81. + The solution control options are converted as follows: - rho - Density of water. Defaults to 1025.0. + This command contains some tables and extra information which can be inspected in the original + documentation pointed above. - hwl - Waterline height in model coordinates. Defaults to 0.0. + For conversion to ASAS(NL), the large displacement option is set based on :ref:`nlgeom`, final load + solution time is set based on :ref:`time`, and sub-step times are set based on :ref:`deltim` or + :ref:`nsubst` (assuming constant step size). - diffkey - Diffracting model key: + .. _elemdat: - 0 - Create a non-diffracting AQWA model. + .. rubric:: **Element Data** - 1 - Create a diffracting AQWA model (default). + If you intend to use the data only with AQWA-WAVE, only the elements that form the wetted surface + are required. Selecting these elements before invoking the :ref:`anstoasas` command will improve + performance. In order for AQWA-WAVE to identify the direction of the wave loading, all elements must + be defined by nodes in a clockwise direction. For further information, refer to the AQWA-WAVE + manual. - symxkey - Key indicating if model is symmetric about the global XZ plane: + The element types are converted as follows: - 0 - No symmetry about XZ plane (default). + This command contains some tables and extra information which can be inspected in the original + documentation pointed above. - 1 - Use symmetry about XZ plane. Only include (or select) half the model. + .. _anstoasas_fn1: - symykey - Key indicating if model is symmetric about the global YZ plane: + Documentation for this archived element type appears in the `Feature Archive + `_. - 0 - No symmetry about YZ plane (default). + .. _matdat: - 1 - Use symmetry about YZ plane. Only include (or select) half the model. + .. rubric:: **Material Data** - Notes - ----- - This command creates the input file Fname.aqwa for the ANSYS Aqwa - Multi-Body Hydrodynamics System for diffraction analysis in AQWA-LINE - from the model currently in the database, based on the currently - selected set of elements. The selected set must only include the hull - envelope; no internal structure should be selected. - - There should be a line of nodes defined at the waterline. Only those - elements that are entirely below the waterline will be specified as - diffracting. If there are no waterline nodes, there will be no - diffracting elements at the waterline, which will severely reduce the - accuracy of the diffraction analysis. - - The translator maps PLANE42, SHELL41, SHELL63, and SHELL181 elements to - PANELs, and maps PIPE16 and PIPE59 elements to TUBEs. It does not - recognize any other element types. Any material or geometric properties - can be used for the shell elements, as AQWA does not need any - properties at all and the command does not use them. All the shell - elements below the water must have their normals pointing outward. - - TUBE elements in AQWA have material density, outside diameter, wall - thickness, added mass, and drag coefficients, so appropriate properties - should be used in the ANSYS model. PIPE59 elements can have added mass - and damping coefficients; these will be written to the file. The ANSYS - program uses the inertia coefficient CM, whereas AQWA uses the added - mass coefficient CA, where CM = (1 + CA). This correction is made - automatically. - - In AQWA the vertical axis is always the Z-axis. The command can convert - a model built with either the Y or Z-axis vertical, but the X-axis must - be horizontal and should preferably be along the fore/aft axis of the - vessel. If the structure is symmetric and you wish to use the symmetry - options, you must only select one half or one quarter of the model, as - appropriate. If you model a complete vessel and specify X symmetry, the - AQWA model will contain two sets of coincident elements. - - If you are working from a model created for a structural analysis, it - will probably be necessary to remesh the model as the structural mesh - is most likely finer than needed for a diffraction analysis. - - If you enter this command interactively (with the GUI active) and no - data is provided for the command options, you will be prompted for - their values. + Linear isotropic material conversion is supported for ASAS and ASAS(NL). - You must verify the completeness and accuracy of the data written. - """ - command = "ANSTOAQWA,%s,%s,%s,%s,%s,%s,%s,%s" % ( - str(fname), - str(vertaxis), - str(gc), - str(rho), - str(hwl), - str(diffkey), - str(symxkey), - str(symykey), - ) - return self.run(command, **kwargs) + .. _geomdat: - def assign(self, ident="", fname="", ext="", lgkey="", **kwargs): - """Reassigns a file name to an ANSYS file identifier. + .. rubric:: **Geometry Data** - APDL Command: /ASSIGN + The following ASAS element geometry data is supported: - Parameters - ---------- - ident - ANSYS file name identifier. Valid identifiers are: CMS, EMAT, - EROT, ESAV, FULL, LN07, LN09, LN11, LN20, LN21, LN22, LN25, LN31, - LN32, MODE, OSAV, RDSP, RFRQ, RMG, RST, RSTP, RTH, SELD, and SSCR. - See File Management and Files for file descriptions. If blank, - list currently reassigned files. - - 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. - - ext - Filename extension (eight-character maximum). + This command contains some tables and extra information which can be inspected in the original + documentation pointed above. - lgkey - Key to specify local or global file name control for the specified - file identifier in a distributed-memory parallel processing - (Distributed ANSYS) run. For more information on local and global - files, see File Handling Conventions in the Parallel Processing - Guide. + For all beam elements, the third node position must be explicitly defined. If the position is not + defined, the program generates an error code (-1) in the output file. - BOTH - Reassign the file name for both the local and global files (default). + .. _sectdat: - LOCAL - Reassign the file name for only the local files. + .. rubric:: **Section Data** - GLOBAL - Reassign the file name for only the global file. + No user sections are generated if AQWA-WAVE data is selected. - Notes - ----- - The reassignment of file names is valid only if it is done before the - file is used. All file reassignments are retained (not cleared) even - if the database is cleared [/CLEAR] or the Jobname is changed - [/FILNAME]. Assigned files may be overwritten. If file name arguments - (Fname, Ext, --) are blank, the default ANSYS assignment is restored. - Use SEOPT for SUB files and SEEXP for DSUB files. + The following sections are converted for ASAS and ASAS(NL): - This command is valid only at the Begin Level. + This command contains some tables and extra information which can be inspected in the original + documentation pointed above. + + .. _boundcon: + + .. rubric:: **Boundary Conditions** + + The following boundary conditions are converted for ASAS and ASAS(NL): + + This command contains some tables and extra information which can be inspected in the original + documentation pointed above. + + .. _loadsasas: - This command also checks to ensure that the path/file is valid and can - be written by the user. If it is not valid, an error message will be - returned. Ensure that the directory exists prior to using /ASSIGN - command. + .. rubric:: **Loads** + + No user loading is generated if AQWA-WAVE data is selected. However, a load case (number 1000) is + automatically defined to identify the wetted surface of the elements for use by AQWA-WAVE based on + the normal surface loads applied to the solid or shell elements. + + Pressure loads from ``SURF154`` elements are converted to equivalent nodal loads for ASAS. For AQWA- + WAVE, the ``SURF154`` pressures are used to identify the wetted surface of the underlying elements. + The following loads are converted for ASAS: + + This command contains some tables and extra information which can be inspected in the original + documentation pointed above. """ - return self.run(f"/ASSIGN,{ident},{fname},{ext},,{lgkey}", **kwargs) + command = f"ANSTOASAS,{fname},{key}" + return self.run(command, **kwargs) - def slashclog(self, fname="", ext="", **kwargs): - """APDL Command: /CLOG + def assign( + self, ident: str = "", fname: str = "", ext: str = "", lgkey: str = "", **kwargs + ): + r"""Reassigns a file name to a Mechanical APDL file identifier. - Copies the session log file to a named file. + Mechanical APDL Command: `/ASSIGN `_ Parameters ---------- - fname - File name and directory path to which the log file is to be copied - (248 characters maximum, including directory). If you do not - specify a directory path, it will default to your working directory - and you can use all 248 characters for the file name. - - ext + ident : str + Mechanical APDL file name identifier. Valid identifiers are: CMS, EMAT, EROT, ESAV, FULL, LN07, + LN09, LN11, LN20, LN21, LN22, LN25, LN31, LN32, MODE, OSAV, RDSP, RFRQ, RMG, RST, RSTP, RTH, + SELD, and SSCR. See `File Management and Files + `_ + + 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. + + ext : str Filename extension (eight-character maximum). + lgkey : str + Key to specify local or global file name control for the specified file identifier in a distributed- + memory parallel processing run. For more information on local and global files, see File Handling Conventions in the `Parallel Processing Guide `_. + + * ``BOTH`` - Reassign the file name for both the local and global files (default). + + * ``LOCAL`` - Reassign the file name for only the local files. + + * ``GLOBAL`` - Reassign the file name for only the global file. + Notes ----- - This command is valid in any processor, but only during an interactive - run. + + .. _s-ASSIGN_notes: + + The reassignment of file names is valid only if it is done before the file is used. All file + reassignments are retained (not cleared) even if the database is cleared ( ``/CLEAR`` ) or the + Jobname is changed ( :ref:`filname` ). Assigned files may be overwritten. If file name arguments + (``Fname``, ``Ext``, ``--``) are blank, the default Mechanical APDL assignment is restored. Use + :ref:`seopt` for SUB files + and :ref:`seexp` for DSUB files. + + This command is valid only at the Begin level. + + This command also checks to ensure that the path/file is valid and can be written by the user. If it + is not valid, an error message will be returned. Ensure that the directory exists prior to using + :ref:`assign` command. """ - command = "/CLOG,%s,%s" % (str(fname), str(ext)) + command = f"/ASSIGN,{ident},{fname},{ext},,{lgkey}" return self.run(command, **kwargs) - def copy(self, fname1="", ext1="", fname2="", ext2="", distkey="", **kwargs): - """Copies a file. + def copy( + self, + fname1: str = "", + ext1: str = "", + fname2: str = "", + ext2: str = "", + distkey: str = "", + **kwargs, + ): + r"""Copies a file. - APDL Command: /COPY + Mechanical APDL Command: `/COPY `_ Parameters ---------- - fname1 - File name to be copied and its directory path (248 - characters maximum for both file name and directory). If - you do not specify a directory path, it will default to - your working directory and you can use all 248 characters - for the file name. - - ext1 - Filename extension (eight-character maximum). + fname1 : str + File name to be copied and its directory path (248 characters maximum for both file name and + directory). If you do not specify a directory path, it will default to your working directory + and you can use all 248 characters for the file name. - fname2 - File name to be created and its directory path (248 - characters maximum for both file name and directory). If - you do not specify a directory path, it will default to - your working directory and you can use all 248 characters - for the file name. + The file name defaults to the current :file:`Jobname`. - ext2 + ext1 : str Filename extension (eight-character maximum). - distkey - Key that specifies whether the copy operation is performed - on all processes in distributed parallel mode (Distributed - ANSYS): + fname2 : str + File name to be created and its directory path (248 characters maximum for both file name and + directory). If you do not specify a directory path, it will default to your working directory + and you can use all 248 characters for the file name. + + ``Fname2`` defaults to ``Fname1``. - 0 (OFF or NO) - The program performs the copy operation - only on the master process (default). + ext2 : str + Filename extension (eight-character maximum). ``Ext2`` defaults to ``Ext1``. - 1 (ON or YES) - The program performs the copy operation - locally on each process. + distkey : str + Key that specifies which copy operation is performed on all processes in distributed-memory parallel + mode : - 2 or BOTH - The program performs the copy operation for - Fname.Ext on the master process and for FnameN.Ext on all - processes. + * ``0 (OFF or NO)`` - The program performs the copy operation only on the master process (default). + + * ``1 (ON or YES)`` - The program performs the copy operation locally on each process. + + * ``2 or BOTH`` - The program performs the copy operation for ``Fname``. ``Ext`` on the master + process and for ``FnameN``. ``Ext`` on all processes. Notes ----- - The original file is untouched. Ex: /COPY,A,,,B copies file A - to B in the same directory. /COPY,A,DAT,,,INP copies the file - A.DAT to A.INP. See the Operations Guide for details. ANSYS - binary and ASCII files can be copied. - - In distributed parallel mode (Distributed ANSYS), only the - master process will copy Fname1.Ext1 to Fname2.Ext2 by - default. However, when DistKey is set to 1 (or ON or YES), the - command is executed by all processes. In this case, Fname1 and - Fname2 will automatically have the process rank appended to - them. This means Fname1N.Ext1 will be copied to Fname2N.Ext2 - by all processes, where N is the Distributed ANSYS process - rank. For more information see Differences in General - Behavior in the Parallel Processing Guide. + + .. _s-COPY_notes: + + The original file is untouched. Ex: :ref:`copy`,A,,,B copies file A to B in the same directory. + :ref:`copy`,A,DAT,,,INP copies the file :file:`A.DAT` to :file:`A.INP`. See the `Operations Guide + `_ for + details. Mechanical APDL binary and ASCII files can be copied. + + In distributed-memory parallel (DMP) mode, only the master process will copy ``Fname1``. ``Ext1`` + to ``Fname2``. ``Ext2`` by default. However, when ``DistKey`` is set to 1 (or ON, or YES) or 2 (or + BOTH), the command is executed by all processes. In this case, ``Fname1`` and ``Fname2`` will + automatically have the process rank appended to them. This means ``Fname1N``. ``Ext1`` will be + copied to ``Fname2N``. ``Ext2`` by all processes, where ``N`` is the DMP process rank. For more + information see in the `Parallel Processing Guide + `_. """ command = f"/COPY,{fname1},{ext1},,{fname2},{ext2},,{distkey}" return self.run(command, **kwargs) def fclean(self, **kwargs): - """Deletes all local files in all processors in a distributed parallel processing run. + r"""Deletes all local files in all processors in a distributed parallel processing run. - APDL Command: /FCLEAN - - Deletes all local files (``.rst``, ``.esav``, ``.emat``, ``.mode``, ``.mlv``, - ``.seld``, ``.dsub``, ``.ist``, ``.full``, ``.rdsp``, ``.rfrq``, ``.rnnn``, - ``.resf``, ``.stat``, ``.modesym``, ``.osave``, ``.erot``, ``.log``) - in all processors in a distributed parallel processing run. - - .. warning:: Because ``/FCLEAN`` deletes all local files, it should only be issued if you are sure that - none of those files are needed in downstream analyses. Deleting files that are necessary for - the next substep, load step, or analysis will prevent continuation of the run. + Mechanical APDL Command: `/FCLEAN `_ Notes ----- - Issue ``/FCLEAN`` to delete all local files having the current Jobname (``/FILNAME``) and save - disk space in a distributed parallel processing run. Like other file deletion commands, deletion happens - immediately upon issuing this command. Different than other file deletion commands, it enables the - convenience of deleting all ``Jobname.*`` local files without having to issue separate commands specifying - each file type + .. _s-FCLEAN_notes: - This command is valid only at the Begin Level. + Issue :ref:`fclean` to delete all local files having the current ``Jobname`` ( :ref:`filname` ) and + save disk space in a distributed parallel processing run. Like other file deletion commands, + deletion happens immediately upon issuing this command. Different than other file deletion commands, + it enables the convenience of deleting all :file:`Jobname.\*` local files without having to issue + separate commands specifying each file type. + + All :file:`.log` files except the master ( :file:`Jobname0.log` ) are deleted. + + .. warning:: + + Because /FCLEAN deletes all local files, it should only be issued if you are sure that none of + those files are needed in any downstream analyses. Deleting files that are necessary for + subsequent substeps, load steps, commands, or analyses will prevent continuation of the run. For + example, since the local files are combined into global files when you issue FINISH in the + solution processor, issuing /FCLEAN before FINISH in /SOLU will result in a program crash. """ - return self.run("/FCLEAN", **kwargs) + command = "/FCLEAN" + return self.run(command, **kwargs) + + def fcomp(self, ident: str = "", level: int | str = "", **kwargs): + r"""Specifies file-compression options. - def fcomp(self, ident="", level="", **kwargs): - """Specifies file compression level. + Mechanical APDL Command: `/FCOMP `_ Parameters ---------- - ident - ANSYS file name identifier. Input the label RST to compress - the following results files: .RST, .RSTP, .RTH, and .RMG. See - File Management and Files for file descriptions. + ident : str + Mechanical APDL file identifier. There is no default. Valid labels are: + + * ``RST`` - Results file. + + * ``DB`` - Database file. - level - Compression level. Valid input values are 0 (no compression - - default) to 5 (maximum compression). + * ``RNNN`` - Restart file. + + * ``OSAV`` - File created during a nonlinear analysis that contains a copy of :file:`ESAV` file from + the last converged substep. + + level : int or str + Compression level: + + * ``SPARSE`` - Use a sparsification scheme for file compression (default). + + * ``0`` - No file compression occurs. + + * ``n`` - A zlib-based file compression occurs using level number ``n``, which ranges from 1 to 5. Notes ----- - Command Default - File compression is not performed. - Specifies file compression for results files (.RST, .RSTP, .RTH, - and .RMG files). Records are compressed as they are written and - uncompressed as they are read (for example, by the SET command). + .. _s-FCOMP_notes: + + Specifies file compression options for results files ( :file:`.rst`, :file:`.rstp`, :file:`.rth`, + and :file:`.rmg` files), database files ( :file:`.db` and :file:`.rdb` ), certain restart files ( + :file:`.Rnnn` ), and the :file:`.osav` file created during a nonlinear analysis. (See `Program- + Generated Files + `_ + :ref:`set` command or the :ref:`resume` command). - See File Compression in the Basic Analysis Guide for more details. + For results files compressed using the sparsification scheme ( ``LEVEL`` = SPARSE, which is the + default), use the ``*XPL`` command to uncompress the file. For third party tools that need to read + the results file, use the method described in `Accessing Mechanical APDL Binary Files + `_ + + See in the `Basic Analysis Guide + `_ for more + details. + + This command is valid only at the Begin Level. """ - return self.run(f"/FCOMP,{ident},{level}", **kwargs) + command = f"/FCOMP,{ident},{level}" + return self.run(command, **kwargs) - def lgwrite(self, fname="", ext="", kedit="", remove_grpc_extra=True, **kwargs): - """Writes the database command log to a file. + def lgwrite(self, fname: str = "", ext: str = "", kedit: str = "", **kwargs): + r"""Writes the database command log to a file. - APDL Command: LGWRITE + Mechanical APDL Command: `LGWRITE `_ Parameters ---------- - fname : str, optional - 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. + 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 :file:`Jobname`. - ext : str, optional - Filename extension (eight-character maximum). + ext : str + Filename extension (eight-character maximum). The extension defaults to LGW if ``Fname`` and + ``Ext`` are blank. - kedit : str, optional + kedit : str Flag to suppress nonessential commands: - * ``"NONE"`` - Do not suppress any commands (default). - * ``"COMMENT"`` - Write nonessential commands as comments (starting with !). - * ``"REMOVE"`` - Do not write nonessential commands or comments. + * ``NONE`` - Do not suppress any commands (default). + + * ``COMMENT`` - Write nonessential commands as comments (starting with !). - remove_grpc_extra : bool, default: True - Remove gRPC related content (like ``/OUT,anstmp``). This will be - ignored when MAPDL is not in gRPC mode. + * ``REMOVE`` - Do not write nonessential commands or comments. Notes ----- - Writes the database command log to a named file. The database - command log contains all commands that were used to create the - current database. These commands are recorded in the database - as they are issued, and saved in the database file (File.DB) - whenever the database is saved. The LGWRITE command extracts - these commands from the database and writes them to a file. - Nonessential commands (for listing, graphics displays, help, - etc.) can be excluded from the file by using the Kedit field. - The file resulting from LGWRITE can be used as command input - to the program. This command is most useful if the session - log file (File.LOG), which is normally saved during an - interactive session, has been lost or corrupted. - - This command is valid in any processor. - - Examples - -------- - Output the database command log to the local directory. - - >>> import os - >>> mapdl.prep7() - >>> mapdl.k(1, 0, 0, 0, mute=True) - >>> mapdl.k(2, 2, 0, 0) - >>> filename = os.path.join(os.getcwd(), 'log.txt') - >>> mapdl.lgwrite(filename, kedit='REMOVE') - Print the output from the log file. + .. _LGWRITE_notes: - >>> with open(filename) as fid: - ... lines = fid.readlines() - >>> print(''.join(lines)) - /BATCH - /PREP7, - K,1,0,0,0 - K,2,2,0,0 + Writes the database command log to a named file. The database command log contains all commands that + were used to create the current database. These commands are recorded in the database as they are + issued, and saved in the database file ( :file:`File.DB` ) whenever the database is saved. The + :ref:`lgwrite` command extracts these commands from the database and writes them to a file. + Nonessential commands (for listing, graphics displays, help, etc.) can be excluded from the file by + using the ``Kedit`` field. The file resulting from :ref:`lgwrite` can be used as command input to + the program. This command is most useful if the session log file ( :file:`File.LOG` ), which is + normally saved during an interactive session, has been lost or corrupted. + This command is valid in any processor. """ - return self.run(f"LGWRITE,{fname},{ext},,{kedit}") + command = f"LGWRITE,{fname},{ext},,{kedit}" + return self.run(command, **kwargs) - def starlist(self, fname="", ext="", **kwargs): - """Displays the contents of an external, coded file. + def slashclog(self, fname: str = "", ext: str = "", **kwargs): + r"""Copies the session log file to a named file. - APDL Command: ``*LIST`` + Mechanical APDL Command: `/CLOG `_ 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. - - ext + fname : str + File name and directory path to which the log file is to be copied (248 characters maximum, + including directory). If you do not specify a directory path, it will default to your working + directory and you can use all 248 characters for the file name. + + ext : str Filename extension (eight-character maximum). Notes ----- - Displays the contents of an external, coded file. The file to be - listed cannot be in use (open) at the time (except for the error - file, File.ERR, which may be displayed with ``*LIST,ERR``). - This command is valid in any processor. + .. _s-CLOG_notes: + + This command is valid in any processor, but only during an interactive run. """ - command = f"*LIST,{fname},{ext}" + command = f"/CLOG,{fname},{ext}" return self.run(command, **kwargs) - def rename(self, fname1="", ext1="", fname2="", ext2="", distkey="", **kwargs): - """Renames a file. + def slashdelete(self, fname: str = "", ext: str = "", distkey: str = "", **kwargs): + r"""Deletes a file. - APDL Command: /RENAME + Mechanical APDL Command: `/DELETE `_ Parameters ---------- - fname1 - The file to be renamed. You can also include an optional - directory path as part of the specified file name; if not, - the default file location is the working directory. + 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`. - ext1 + ext : str Filename extension (eight-character maximum). - fname2 - The new name for the file. You can also include an - optional directory path as part of the new file name; if - not, the default is the working directory. A maximum of - 248 characters is allowed for the file name (or combined - file name and directory path, if both are specified). - - ext2 - Filename extension (eight-character maximum). + distkey : str + Key that specifies which file deletion action is performed on all processes in distributed-memory + parallel mode: - distkey - Key that specifies whether the rename operation is - performed on all processes in distributed parallel mode - (Distributed ANSYS): + * ``0 (OFF or NO)`` - The program performs the file deletion only on the master process (default). - 1 (ON or YES) - The program performs the rename operation - locally on each process. + * ``1 (ON or YES)`` - The program performs the file deletion locally on each process. - 0 (OFF or NO) - The program performs the rename operation - only on the master process (default). + * ``2 or BOTH`` - The program performs file deletion for ``Fname``. ``Ext`` on the master process + and for ``FnameN``. ``Ext`` on all processes. Notes ----- - Renames a file. Ex: /RENAME,A,,,B renames file A to B in the - same directory. /RENAME,A,DAT,,,INP renames file A.DAT to - A.INP. On all systems, this command will overwrite any - existing file named B. See the Operations Guide for - details. Only ANSYS binary files should be renamed. Use /SYS - and system renaming commands for other files. - - In distributed parallel mode (Distributed ANSYS), only the - master process will rename Fname1.Ext1 to Fname2.Ext2 by - default. However, when DistKey is set to 1 (or ON or YES), the - command is executed by all processes. In this case, Fname1 and - Fname2 will automatically have the process rank appended to - them. This means Fname1N.Ext1 will be renamed to Fname2N.Ext2 - by all processes, where N is the Distributed ANSYS process - rank. For more information see Differences in General Behavior - in the Parallel Processing Guide. - - Renaming across system partitions may be internally done by a - copy and delete operation on some systems. - - This command is valid only at the Begin Level. + In distributed-memory parallel (DMP) mode, only the master process will delete ``Fname``. ``Ext`` + by default. However, when ``DistKey`` is set to 1 (or ON, or YES) or 2 (or BOTH), the command is + executed by all processes. In this case, ``Fname`` will automatically have the process rank appended + to it. This means ``FnameN``. ``Ext`` will be deleted by all processes, where ``N`` is the DMP + process rank. For more information see in the `Parallel Processing Guide + `_. """ - return self.run( - f"/RENAME,{fname1},{ext1},,{fname2},{ext2},,{distkey}", **kwargs - ) + command = f"/DELETE,{fname},{ext},,{distkey}" + return self.run(command, **kwargs) - def slashfdele(self, ident="", stat="", **kwargs): - """Deletes a binary file after it is used. + def slashfdele(self, ident: str = "", stat: str = "", **kwargs): + r"""Deletes a binary file after it is used. - APDL Command: /FDELE + Mechanical APDL Command: `/FDELE `_ Parameters ---------- - ident - ANSYS file name identifier. Valid identifiers are: EMAT, ESAV, - FULL, SUB, MODE, DSUB, USUB, OSAV, and SELD. See the Basic - Analysis Guide for file descriptions. + ident : str + Mechanical APDL file name identifier. Valid identifiers are: EMAT, ESAV, FULL, SUB, MODE, DSUB, + USUB, OSAV, and SELD. See the `Basic Analysis Guide + `_ for file + descriptions. - stat + stat : str Keep or delete key: - KEEP - Keep this file. + * ``KEEP`` - Keep this file. - DELE - Delete (or do not write, if not necessary) this file. + * ``DELE`` - Delete (or do not write, if not necessary) this file. Notes ----- - Deletes as soon as possible (or prevents writing) a binary file created - by the ANSYS program to save space. + + .. _s-FDELE_notes: + + Deletes as soon as possible (or prevents writing) a binary file created by Mechanical APDL to save + space. .. warning:: - Deleting files that are necessary for the next substep, - load step, or analysis will prevent continuation of the - run. - This command is valid only at the Begin Level. + Deleting files that are necessary for the next substep, load step, or analysis will prevent + continuation of the run. + + This command is valid only at the Begin level. """ command = f"/FDELE,{ident},{stat}" return self.run(command, **kwargs) - def slashdelete(self, fname="", ext="", distkey="", **kwargs): - """Deletes a file. + def slashrename( + self, + fname1: str = "", + ext1: str = "", + fname2: str = "", + ext2: str = "", + distkey: str = "", + **kwargs, + ): + r"""Renames a file. - APDL Command: /DELETE + Mechanical APDL Command: `/RENAME `_ 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. - - ext + fname1 : str + The file to be renamed. You can also include an optional directory path as part of the specified + file name; if not, the default file location is the working directory. + + File name defaults to the current :file:`Jobname`. + + ext1 : str Filename extension (eight-character maximum). - distkey - Key that specifies whether the file deletion is performed - on all processes in distributed parallel mode (Distributed - ANSYS): + fname2 : str + The new name for the file. You can also include an optional directory path as part of the new + file name; if not, the default is the working directory. A maximum of 248 characters is allowed + for the file name (or combined file name and directory path, if both are specified). + + ``Fname2`` defaults to ``Fname1``. + + ext2 : str + Filename extension (eight-character maximum). ``Ext2`` defaults to ``Ext1``. - 1 (ON or YES) - The program performs the file deletion - locally on each process. + distkey : str + Key that specifies which rename operation is performed on all processes in distributed-memory + parallel mode: - 0 (OFF or NO) - The program performs the file deletion - only on the master process (default). + * ``0 (OFF or NO)`` - The program performs the rename operation only on the master process + (default). + + * ``1 (ON or YES)`` - The program performs the rename operation locally on each process. + + * ``2 or BOTH`` - The program performs the rename operation for ``Fname``. ``Ext`` on the master + process and for ``FnameN``. ``Ext`` on all processes. Notes ----- - In distributed parallel mode (Distributed ANSYS), only the - master process will delete Fname.Ext by default. However, when - DistKey is set to 1 (or ON or YES), the command is executed by - all processes. In this case, Fname will automatically have the - process rank appended to it. This means FnameN.Ext will be - deleted by all processes, where N is the Distributed ANSYS - process rank. For more information see Differences in General - Behavior in the Parallel Processing Guide. + + .. _s-RENAME_notes: + + Renames a file. Ex: :ref:`slashrename`,A,,,B renames file A to B in the same directory. + :ref:`slashrename`,A,DAT,,,INP renames file A.DAT to A.INP. On all systems, this command will + overwrite any existing file named B. See the `Operations Guide + `_ for details. Only + Mechanical APDL binary files should + be renamed. Use :ref:`sys` and system renaming commands for other files. + + In distributed-memory parallel (DMP) mode, only the master process will rename ``Fname1``. ``Ext1`` + to ``Fname2``. ``Ext2`` by default. However, when ``DistKey`` is set to 1 (or ON, or YES) or 2 (or + BOTH), the command is executed by all processes. In this case, ``Fname1`` and ``Fname2`` will + automatically have the process rank appended to them. This means ``Fname1N``. ``Ext1`` will be + renamed to ``Fname2N``. ``Ext2`` by all processes, where ``N`` is the DMP process rank. For more + information see in the `Parallel Processing Guide + `_. + + Renaming across system partitions may be internally done by a copy and delete operation on some + systems. + + This command is valid only at the Begin level. """ - return self.run(f"/DELETE,{fname},{ext},,{distkey}", **kwargs) + command = f"/RENAME,{fname1},{ext1},,{fname2},{ext2},,{distkey}" + return self.run(command, **kwargs) + + def starlist(self, fname: str = "", ext: str = "", **kwargs): + r"""Displays the contents of an external, coded file. + + Mechanical APDL Command: `\*LIST `_ + + Parameters + ---------- + 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. + + ext : str + Filename extension (eight-character maximum). + + Notes + ----- + + .. _a-LIST_notes: + + Displays the contents of an external, coded file. The file to be listed cannot be in use (open) at + the time (except for the error file, :file:`Jobname.err` None, which may be displayed with + :ref:`starlist`,ERR). + + Use caution when you are listing active Mechanical APDL files via the List> Files> Other and File> + List> + Other menu paths. File I/O buffer and system configurations can result in incomplete listings unless + the files are closed. + + This command is valid in any processor. + """ + command = f"*LIST,{fname},{ext}" + return self.run(command, **kwargs) diff --git a/src/ansys/mapdl/core/_commands/session/list_controls.py b/src/ansys/mapdl/core/_commands/session/list_controls.py index ef12613c01e..4771121a0f9 100644 --- a/src/ansys/mapdl/core/_commands/session/list_controls.py +++ b/src/ansys/mapdl/core/_commands/session/list_controls.py @@ -22,101 +22,136 @@ class ListControls: - def com(self, comment="", **kwargs): - """Places a comment in the output. - APDL Command: /COM + def com(self, comment: str = "", **kwargs): + r"""Places a comment in the output. + + Mechanical APDL Command: `/COM `_ Parameters ---------- - comment + comment : str Comment string, up to 75 characters. Notes ----- - The output from this command consists of the comment string. This - command is similar to C*** except that the comment produced by C*** is - more easily identified in the output. Parameter substitution within the - comment occurs for every valid expression delimited by percent (%) - signs. Enclosing such an expression in single quotes prevents parameter - substitution. - - Another way to include a comment is to precede it with a ! character - (on the same line). The ! may be placed anywhere on the line, and any - input following it is ignored as a comment. No output is produced by - such a comment, but the comment line is included on the log file. This - is a convenient way to annotate the log file. + + .. _s-COM_notes: + + The output from this command consists of the comment string. This command is similar to ``C***`` + except that the comment produced by ``C***`` is more easily identified in the output. Parameter + substitution within the comment occurs for every valid expression delimited by percent (%) signs. + Enclosing such an expression in single quotes prevents parameter substitution. + + Another way to include a comment is to precede it with a ! character (on the same line). The ! may + be placed anywhere on the line, and any input following it is ignored as a comment. No output is + produced by such a comment, but the comment line is included on the log file. This is a convenient + way to annotate the log file. This command is valid anywhere. """ - command = f"/COM, {comment}" + command = f"/COM,{comment}" return self.run(command, **kwargs) def golist(self, **kwargs): - """Reactivates the suppressed data input listing. + r"""Reactivates the suppressed data input listing. - APDL Command: /GOLIST + Mechanical APDL Command: `/GOLIST `_ Notes ----- - Reactivates printout of the data input listing suppressed with /NOLIST. - This command is valid in any processor, but only within a batch run - [/BATCH]. + .. _s-GOLIST_notes: + + Reactivates printout of the data input listing suppressed with :ref:`nolist`. + + This command is valid in any processor, but only within a batch run ( ``/BATCH`` ). """ - command = "/GOLIST," + command = "/GOLIST" return self.run(command, **kwargs) def gopr(self, **kwargs): - """Reactivates suppressed printout. + r"""Reactivates suppressed printout. - APDL Command: /GOPR + Mechanical APDL Command: `/GOPR `_ Notes ----- - Reactivates printout suppressed with the /NOPR command. The /GO - command has the same function except that it does not produce a command - response from the program. + + .. _s-GOPR_notes: + + Reactivates printout suppressed with the :ref:`nopr` command. The :ref:`slashgo` command has the + same function except that it does not produce a command response from the program. This command is valid in any processor. """ - command = "/GOPR," + command = "/GOPR" return self.run(command, **kwargs) def nolist(self, **kwargs): - """Suppresses the data input listing. + r"""Suppresses the data input listing. - APDL Command: /NOLIST + Mechanical APDL Command: `/NOLIST `_ Notes ----- - Printout is suppressed until a /GOLIST command is read or the end of - the listing is encountered. - This command is valid in any processor, but only within a batch run - [/BATCH]. + .. _s-NOLIST_notes: + + Printout is suppressed until a :ref:`golist` command is read or the end of the listing is + encountered. + + This command is valid in any processor, but only within a batch run ( ``/BATCH`` ). """ - command = "/NOLIST," + command = "/NOLIST" return self.run(command, **kwargs) def nopr(self, **kwargs): - """Suppresses the expanded interpreted input data listing. + r"""Suppresses the expanded interpreted input data listing. - APDL Command: /NOPR + Mechanical APDL Command: `/NOPR `_ + + .. warning:: + + PyMAPDL uses the console output to parse and retrieve information from the MAPDL + instance. Hence, it is strongly advised to **NOT** use this command unless you really + know what you are doing. In case of an accidental ``NOPR`` activation, you can run + `mapdl.gopr()` to reactivate console output. Notes ----- - Suppresses printout of interpreted input data, including information - labeled as "Notes." When this printout is not suppressed, the data - input to the analysis is echoed to the output file in an expanded - format. Printout is suppressed until a /GOPR or /GO command is read. - Use of /NOPR is not recommended when the graphical user interface (GUI) - is active. The GUI sometimes issues "hidden" /NOPR and /GOPR command - sequences, which will countermand user-issued /NOPR commands, thus - making the use of /NOPR in the GUI environment unpredictable. + .. _s-NOPR_notes: + + Suppresses printout of interpreted input data, including information labeled as "Notes." When this + printout is not suppressed, the data input to the analysis is echoed to the output file in an + expanded format. Printout is suppressed until a :ref:`gopr` or :ref:`slashgo` command is read. + + Use of :ref:`nopr` is not recommended when the graphical user interface (GUI) is active. The GUI + sometimes issues "hidden" :ref:`nopr` and :ref:`gopr` command sequences, which will countermand + user-issued :ref:`nopr` commands, thus making the use of :ref:`nopr` in the GUI environment + unpredictable. + + This command is valid in any processor. + """ + command = "/NOPR" + return self.run(command, **kwargs) + + def slashgo(self, **kwargs): + r"""Reactivates suppressed printout. + + Mechanical APDL Command: `/GO `_ + + Notes + ----- + + .. _s-GO_notes: + + Reactivates printout suppressed with the :ref:`nopr` command without producing any output. The + :ref:`gopr` command has the same function except that it also produces a command response from the + program. This command is valid in any processor. """ - command = "/NOPR," + command = "/GO" return self.run(command, **kwargs) diff --git a/src/ansys/mapdl/core/_commands/session/processor_entry.py b/src/ansys/mapdl/core/_commands/session/processor_entry.py index 4a86f311e86..69d6c50607d 100644 --- a/src/ansys/mapdl/core/_commands/session/processor_entry.py +++ b/src/ansys/mapdl/core/_commands/session/processor_entry.py @@ -20,173 +20,123 @@ # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE # SOFTWARE. -"""These SESSION commands are used to enter and exit the various -processors in the program. -""" - class ProcessorEntry: - def aux2(self, **kwargs): - """Enters the binary file dumping processor. - - APDL Command: /AUX2 - - Notes - ----- - Enters the binary file dumping processor (ANSYS auxiliary processor - AUX2). This processor is used to dump the contents of certain ANSYS - binary files for visual examination. - This command is valid only at the Begin Level. - """ - command = "/AUX2," - return self.run(command, **kwargs) - - def aux3(self, **kwargs): - """Enters the results file editing processor. + def finish(self, **kwargs): + r"""Exits normally from a processor. - APDL Command: /AUX3 + Mechanical APDL Command: `FINISH `_ Notes ----- - Enters the results file editing processor (ANSYS auxiliary processor - AUX3). This processor is used to edit ANSYS results files. - This command is valid only at the Begin Level. - """ - command = "/AUX3," - return self.run(command, **kwargs) + .. _FINISH_notes: - def aux12(self, **kwargs): - """Enters the radiation processor. + This command exits any of the Mechanical APDL processors. - APDL Command: /AUX12 + When exiting the Mechanical APDL processors, data remains intact in the database, but the database + is not + automatically written to a file. (Issue :ref:`save` to write the database to a file.) - Notes - ----- - Enters the radiation processor (ANSYS auxiliary processor AUX12). This - processor supports the Radiation Matrix and the Radiosity Solver - methods. - - This command is valid only at the Begin Level. - """ - command = "/AUX12," - return self.run(command, **kwargs) + If exiting POST1 or POST26: - def aux15(self, **kwargs): - """Enters the IGES file transfer processor. + * POST1: Data in the database remains intact (including the POST1 element table data, the path table + data, the fatigue table data, and the load case pointers). - APDL Command: /AUX15 + * POST26: Data in the database remains intact, except that POST26 variables are erased and + specification commands (such as ``FILE``, :ref:`prtime`, and :ref:`nprint` ) are reset. Issue + :ref:`quit` to exit the processor and bypass these exceptions. - Notes - ----- - Enters the IGES file transfer processor (ANSYS auxiliary processor - AUX15), used to read an IGES data file into the ANSYS program. + See :ref:`quit` for an alternate processor exit command. - This command is valid only at the Begin Level. + This command is valid in any processor. This command is not valid at the Begin level. """ - command = "/AUX15," + command = "FINISH" return self.run(command, **kwargs) - def finish(self, **kwargs): - """Exits normally from a processor. + def post1(self, **kwargs): + r"""Enters the database results postprocessor. - APDL Command: FINISH + Mechanical APDL Command: `/POST1 `_ Notes ----- - Exits any of the ANSYS processors or the DISPLAY program. For the - ANSYS processors, data will remain intact in the database but the - database is not automatically written to a file (use the SAVE command - to write the database to a file). See also the /QUIT command for an - alternate processor exit command. If exiting POST1, POST26, or OPT, - see additional notes below. - - POST1: Data in the database will remain intact, including the POST1 - element table data, the path table data, the fatigue table data, and - the load case pointers. - - POST26: Data in the database will remain intact, except that POST26 - variables are erased and specification commands (such as FILE, PRTIME, - NPRINT, etc.) are reset. Use the /QUIT command to exit the processor - and bypass these exceptions. - - This command is valid in any processor. This command is not valid at - the Begin level. - """ - command = "FINISH," - return self.run(command, **kwargs) - def post1(self, **kwargs): - """Enters the database results postprocessor. + .. _s-POST1_notes: - APDL Command: /POST1 - - Notes - ----- - Enters the general database results postprocessor (POST1). All load - symbols (/PBC, /PSF, or /PBF) are automatically turned off with this - command. + Enters the general database results postprocessor (POST1). All load symbols ( :ref:`pbc`, + :ref:`psf`, or :ref:`pbf` ) are automatically turned off with this command. This command is valid only at the Begin Level. """ - command = "/POST1," + command = "/POST1" return self.run(command, **kwargs) def post26(self, **kwargs): - """Enters the time-history results postprocessor. + r"""Enters the time-history results postprocessor. - APDL Command: /POST26 + Mechanical APDL Command: `/POST26 `_ Notes ----- + + .. _s-POST26_notes: + Enters the time-history results postprocessor (POST26). This command is valid only at the Begin Level. """ - command = "/POST26," + command = "/POST26" return self.run(command, **kwargs) def prep7(self, **kwargs): - """Enters the model creation preprocessor. + r"""Enters the model creation preprocessor. - APDL Command: /PREP7 + Mechanical APDL Command: `/PREP7 `_ Notes ----- + + .. _s-PREP7_notes: + Enters the general input data preprocessor (PREP7). This command is valid only at the Begin Level. """ - command = "/PREP7," + command = "/PREP7" return self.run(command, **kwargs) def quit(self, **kwargs): - """Exits a processor. + r"""Exits a processor. - APDL Command: /QUIT + Mechanical APDL Command: `/QUIT `_ Notes ----- - This is an alternative to the FINISH command. If any cleanup or file - writing is normally done by the FINISH command, it is bypassed if the - /QUIT command is used instead. A new processor may be entered after - this command. See the /EXIT command to terminate the run. - This command is valid in any processor. This command is not valid at - the Begin level. + .. _s-QUIT_notes: + + This is an alternative to the :ref:`finish` command. If any cleanup or file writing is normally done + by the :ref:`finish` command, it is bypassed if the :ref:`quit` command is used instead. A new + processor may be entered after this command. See the ``/EXIT`` command to terminate the run. + + This command is valid in any processor. This command is not valid at the Begin level. """ - command = "/QUIT," + command = "/QUIT" return self.run(command, **kwargs) def slashsolu(self, **kwargs): - """Enters the solution processor. + r"""Enters the solution processor. - APDL Command: /SOLU + Mechanical APDL Command: `/SOLU `_ Notes ----- + + .. _s-SOLU_notes: + This command is valid only at the Begin Level. """ - command = "/SOLU," + command = "/SOLU" return self.run(command, **kwargs) diff --git a/src/ansys/mapdl/core/_commands/session/run_controls.py b/src/ansys/mapdl/core/_commands/session/run_controls.py index 0c23e188861..73059923b53 100644 --- a/src/ansys/mapdl/core/_commands/session/run_controls.py +++ b/src/ansys/mapdl/core/_commands/session/run_controls.py @@ -20,137 +20,160 @@ # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE # SOFTWARE. -"""These SESSION commands control the overall characteristics of the -session, including the jobname, Graphical User Interface behavior, and -file switching. -""" from ansys.mapdl.core.errors import MapdlRuntimeError class RunControls: - def config(self, lab="", value="", **kwargs): - """Assigns values to ANSYS configuration parameters. - APDL Command: /CONFIG + def config(self, lab: str = "", val: str = "", **kwargs): + r"""Assigns values to Mechanical APDL configuration parameters. + + Mechanical APDL Command: `/CONFIG `_ Parameters ---------- - lab + lab : str Configuration parameter to be changed: - NORSTGM - Option to write or not write geometry data to - the results file. VALUE is either 0 (write - geometry data) or 1 (do not write geometry - data). Useful when complex analyses will create - abnormally large files. Default is 0. + * ``NORSTGM`` - Option to write or not write geometry data to the results file: + + * When ``VAL`` = 0, write geometry data (default). + * When ``VAL`` = 1, does not write geometry data. + + Useful when complex analyses are likely to create abnormally large files. + + * ``NBUF`` - The number of buffers ( ``VAL`` = 1 to 32) per file in the solver. Default: ``VAL`` = + 4. + + * ``LOCFL`` - File open and close actions: + + * When ``VAL`` = 0, global (default). + * When ``VAL`` = 1, local. + + Applies to :file:`File.EROT`, :file:`File.ESAV`, and :file:`FileEMAT`. + + Typically used for large problems where locally closed files may be deleted earlier in the run via + :ref:`slashfdele`. + + * ``SZBIO`` - Record size ( ``VAL`` = 1024 to 4194304) of binary files (in integer words). + + Default: ``VAL`` = 16384 (system-dependent). + + * ``FSPLIT`` - Defines split points for binary files. ``VAL`` is the file split point in megawords. + + Default: ``VAL`` = Maximum file size for the system. + + * ``MXND`` - Maximum number of nodes. + + Default: ``VAL`` = 100 at first encounter. + + Dynamically expanded by doubling, even at first encounter, when the maximum is exceeded. + + * ``MXEL`` - Maximum number of elements. Default and expansion as for MXND. + + * ``MXKP`` - Maximum number of keypoints. Default and expansion as for MXND. - NBUF - VALUE is the number of buffers (1 to 32) per file - in the solver. Defaults to 4. + * ``MXLS`` - Maximum number of lines. Default and expansion as for MXND. - LOCFL - File open and close actions. For VALUE use: 0 for - global (default); 1 for local. Applicable to - File.EROT, File.ESAV, and File.EMAT. Typically - used for large problems where locally closed files - may be deleted earlier in the run with the /FDELE - command. + * ``MXAR`` - Maximum number of areas. Default and expansion as for MXND. - SZBIO - VALUE is the record size (1024 to 4194304) of - binary files (in integer words). Defaults to - 16384 (system dependent). + * ``MXVL`` - Maximum number of volumes. Default and expansion as for MXND. - ORDER - Automatic reordering scheme. For VALUE use: 0 for - WSORT,ALL; 1 for WAVES; 2 for both WSORT,ALL and - WAVES (default). + * ``MXRL`` - Maximum number of sets of real constants (element attributes). Default and expansion as + for MXND. - FSPLIT - Defines split points for binary files. VALUE is - the file split point in megawords and defaults to - the maximum file size for the system. + * ``MXCP`` - Maximum number of sets of coupled degrees of freedom. Default and expansion as for + MXND. - MXND - Maximum number of nodes. If not specified, defaults - to 100 at first encounter. Dynamically expanded by - doubling, even at first encounter, when maximum is - exceeded. + * ``MXCE`` - Maximum number of constraint equations. Default and expansion as for MXND. - MXEL - Maximum number of elements. Default and expansion as for MXND. + * ``NOELDB`` - Option to write or not write results into the database after a solution. - MXKP - Maximum number of keypoints. Default and expansion as for MXND. + * When ``VAL`` = 0 (default), writes results into the database. + * When ``VAL`` = 1, does not write results into the database. + * ``NUMLV`` - Maximum number of load vectors written on :file:`Jobname.MODE` file when ``MSUPkey`` = + YES on the :ref:`mxpand` command. - MXLS - Maximum number of lines. Default and expansion as for MXND. + Default: ``VAL`` = 1000 at first encounter. - MXAR - Maximum number of areas. Default and expansion as for MXND. + When the maximum is exceeded, the value is not expanded. - MXVL - Maximum number of volumes. Default and expansion as for MXND. + The NUMLV option is not supported for fast load vector generation ( ``FastLV`` = ON on the + :ref:`modcont` command). - MXRL - Maximum number of sets of real constants (element - attributes). Default and expansion as for MXND. + * ``NUMSUBLV`` - Maximum number of load vectors written on :file:`Jobname.SUB` file in + substructure/CMS generation pass. - MXCP - Maximum number of sets of coupled degrees of - freedom. Default and expansion as for MXND. + Default: ``VAL`` = 31 at first encounter. - MXCE - Maximum number of constraint equations. Default - and expansion as for MXND. + When the maximum is exceeded, the value is not expanded. - NOELDB - Option to write or not write results into the - database after a solution. When VALUE = 0 - (default), write results into the database. When - VALUE = 1, do not write results into the - database. + * ``GRW_NBUF`` - Option to automatically grow the number of file buffers for most binary files ( :file:`.ESAV`, + :file:`.EMAT`, :file:`.FULL`, and so on), with the exception of the results file and files written + by the sparse and PCG equation solvers (for example, :file:`.DSPxxxx` and :file:`.PCn` ). - DYNA_DBL - Option to invoke the double precision version - of the explicit dynamics solver LS-DYNA. When - VALUE = 0 (default), the single precision - version is used. When VALUE = 1, the double - precision version is used. + * When ``VAL`` = -1, the number of file buffers does not grow automatically for any file. + * When ``VAL`` = 0 (default), the number of file buffers may or may not grow automatically. The + logic is program-controlled. + * When ``VAL`` = 1, the number of file buffers automatically grows for most binary files to reduce + the amount of I/O. This option may require a significantly greater amount of memory than the + default behavior ( ``VAL`` = 0). + * ``MEBA_LIC`` - Option to control automatic checkout of a Mechanical batch license during solution when the + capability is not enabled, useful for PrepPost sessions: - STAT - Displays current values set by the /CONFIG command. + * When ``VAL`` = 0 (default), check out a license automatically when needed. + * When ``VAL`` = 1, bypass automatic license checkout. + * ``STAT`` - Displays current values set by the :ref:`config` command. - value - Value (an integer number) assigned to the configuration parameter. + val : str + Value (an integer number) assigned to the specified configuration parameter. Notes ----- - All configuration parameters have initial defaults, which in most cases - do not need to be changed. Where a specially configured version of the - ANSYS program is desired, the parameters may be changed with this - command. Issue /CONFIG,STAT to display current values. Changes must - be defined before the parameter is required. These changes (and - others) may also be incorporated into the config162.ans file which is - read upon execution of the program (see The Configuration File in the - Basic Analysis Guide). If the same configuration parameter appears in - both the configuration file and this command, this command overrides. - - Distributed ANSYS uses the default FSPLIT value, and forces NOELDB = 1 - and NORSTGM = 0 for all results files. The FSPLIT, NOELDB, and NORSTGM - options cannot be changed when using Distributed ANSYS. - - The /CONFIG command is not valid for the ANSYS Multiphysics 1, 2, or 3 - products. - - The ANSYS Multi-field solver (MFS and MFX) does not support - /CONFIG,NOELDB,1. The ANSYS Multi-field solver needs the updated ANSYS - database. + + .. _s-CONFIG_notes: + + All configuration parameters have initial defaults, which in most cases do not need to be changed. + Where a specially configured version of the Mechanical APDL program is desired, the parameters can + be + changed with this command. + + Issue :ref:`config`,STAT to display current values. + + Define changes before the parameter is required. + + These changes (and others) may also be incorporated into the :file:`config.ans` file, read in upon + execution of the program. (See `The Configuration File + `_ + in the `Basic Analysis Guide + `_.) If the same + configuration parameter appears in both the configuration file and + this command, this command overrides. + + Distributed-memory parallel DMP solutions use the default FSPLIT value and force NOELDB = 1 for all + results files. You cannot change the FSPLIT and NOELDB options for a DMP solution. """ - command = "/CONFIG,%s,%s" % (str(lab), str(value)) + command = f"/CONFIG,{lab},{val}" return self.run(command, **kwargs) - def cwd(self, dirpath="", **kwargs): - """Changes the current working directory. + def cwd(self, dirpath: str = "", **kwargs): + r"""Changes the current working directory. - ``dirpath`` must not contain any singular quotations/apostrophes. - These are not supported in APDL. - - APDL Command: /CWD + Mechanical APDL Command: `/CWD `_ Parameters ---------- - dirpath + dirpath : str The full path name of the new working directory. Notes ----- - After issuing the /CWD command, all new files opened with no default - directory specified (via the FILE, /COPY, or RESUME commands, for - example) default to the new ``dirpath`` directory. + + .. _s-CWD_notes: + + After issuing the /CWD command, all new files opened with no default directory specified (via the + ``FILE``, :ref:`copy`, or :ref:`resume` commands, for example) default to the new ``DIRPATH`` + directory. Examples -------- @@ -162,7 +185,6 @@ def cwd(self, dirpath="", **kwargs): MAPDL on Linux example: >>> mapdl.cwd("/tmp/") - """ dirpath = str(dirpath) if not (dirpath.startswith("'") and dirpath.endswith("'")) and "'" in dirpath: @@ -171,519 +193,930 @@ def cwd(self, dirpath="", **kwargs): ) return self.run(f"/CWD,'{dirpath}'", **kwargs) - def filname(self, fname="", key="", **kwargs): - """Changes the Jobname for the analysis. + def filname(self, fname: str = "", key: str = "", **kwargs): + r"""Changes the Jobname for the analysis. - APDL Command: /FILNAME + Mechanical APDL Command: `/FILNAME `_ Parameters ---------- - fname - Name (32 characters maximum) to be used as the Jobname. Defaults - to the initial Jobname as specified on the ANSYS execution command, - or to file if none specified. + fname : str + Name (32 characters maximum) to be used as the :file:`Jobname`. Defaults to the initial + :file:`Jobname` as specified on the Mechanical APDL execution command, or to :file:`file` if + none specified. - key - Specify whether to use the existing log, error, lock, page, and - output files (.LOG, .ERR, .LOCK, .PAGE and .OUT) or start new - files. + key : str + Specify whether to use the existing log, error, lock, page, and output files ( :file:`.LOG`, :file:`.ERR`, :file:`.LOCK`, :file:`.PAGE` and :file:`.OUT` ) or + start new files. - 0, OFF - Continue using current log, error, lock, page, and output files. + * ``0, OFF`` - Continue using current log, error, lock, page, and output files. - 1, ON - Start new log, error, lock, page, and output files - (old log and error files are closed and saved, but - old lock, page, and output files are - deleted). Existing log and error files are - appended. + * ``1, ON`` - Start new log, error, lock, page, and output files (old log and error files are closed + and saved, but old lock, page, and output files are deleted). Existing log and error files are + appended. Notes ----- - All subsequently created files will be named with this Jobname if Key = - 0. Use Key = 1 to start new log, error, lock, page, and output files. - The previous Jobname is typically defined on the ANSYS program - execution line (see the Operations Guide). This command is useful when - different groups of files created throughout the run are to have - different names. For example, the command may be used before each - substructure pass to avoid overwriting files or having to rename each - file individually. + + .. _s-FILNAME_notes: + + All subsequently created files will be named with this :file:`Jobname` if ``Key`` = 0. Use ``Key`` = + 1 to start new log, error, lock, page, and output files. The previous :file:`Jobname` is typically + defined on the Mechanical APDL program execution line. (See the `Operations Guide + `_. + + This command is useful when different groups of files created throughout the run are to have + different names. For example, the command may be used before each substructure pass to avoid + overwriting files or having to rename each file individually. This command is valid only at the Begin level. """ - command = "/FILNAME,%s,%s" % (str(fname), str(key)) + command = f"/FILNAME,{fname},{key}" return self.run(command, **kwargs) - def input(self, fname="", ext="", dir="", line="", log="", **kwargs): - """Switches the input file for the commands that follow. + def input( + self, + fname: str = "", + ext: str = "", + dir_: str = "", + line: str = "", + log: int | str = "", + **kwargs, + ): + r"""Switches the input file for the commands that follow. - APDL Command: /INPUT + Mechanical APDL Command: `/INPUT `_ 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. - - ext + 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 ``Ext`` is specified. + + ext : str Filename extension (eight-character maximum). - dir - Directory path (64 characters maximum). Defaults to current - directory. + dir_ : str + Directory path (64 characters maximum). Defaults to current directory. - line - A value indicating either a line number in the file or a user- - defined label in the file from which to begin reading the - input file. + line : str + A value indicating either a line number in the file or a user-defined label in the file from which + to begin reading the input file. - (blank), 0, or 1 - Begins reading from the top of the file (default). + * ``(blank), 0, or 1`` - Begins reading from the top of the file (default). - LINE_NUMBER - Begins reading from the specified line number in the file. + * ``LINE_NUMBER`` - Begins reading from the specified line number in the file. - :label - Begins reading from the first line beginning with the - matching user-defined label :label (beginning with a - colon (:), 8 characters maximum). + * ``label`` - Begins reading from the first line beginning with the matching user-defined label : + ``label`` (beginning with a colon (:), 8 characters maximum). - log - Indicates whether secondary input from this command should be - recorded in the command log (File.LOG) and the database log: + log : int or str + Indicates whether secondary input from this command should be recorded in the command log ( :file:`File.LOG` ) and the database log: - 0 - Record only the /INPUT command on the log (default). + * ``0`` - Record only the :ref:`input` command on the log (default). - 1 - Record commands in the specified secondary file as they are executed. + * ``1`` - Record commands in the specified secondary file as they are executed. Notes ----- - Switches the input file for the next commands. Commands are read - from this file until an end-of-file or another file switching - directive is read. An end-of-file occurs after the last record of - the file or when a /EOF command is read. An automatic switch back - one level (to the previous file) occurs when an end-of-file is - encountered. Twenty levels of nested file switching are allowed. - Note that files including ``*DO``, ``*USE``, ``*ULIB``, and the "Unknown - Command" Macro have less nesting available because each of these - operations also uses a level of file switching. For an - interactive run, a /INPUT,TERM switches to the terminal for the - next input. A /EOF read from the terminal then switches back to - the previous file. A /INPUT (with a blank second field) switches - back to the primary input file. - - Setting LOG = 1 on /INPUT causes all commands read from the - specified file to be recorded in the command log (File.LOG) and - the internal database command log [LGWRITE]. This option is - recommended if the log file will be used later . The LOG = 1 - option is only valid when the /INPUT occurs in the primary input - file. Using LOG = 1 on a nested /INPUT or on a /INPUT within a - do-loop will have no effect (i.e., commands in the secondary input + + .. _s-INPUT_notes: + + Switches the input file for the next commands. Commands are read from this file until an end-of-file + or another file switching directive is read. An end-of-file occurs after the last record of the file + or when a ``/EOF`` command is read. An automatic switch back one level (to the previous file) occurs + when an end-of-file is encountered. Twenty levels of nested file switching are allowed. Note that + files including ``*DO``, :ref:`use`, :ref:`ulib`, and the "Unknown Command" Macro have less nesting + available because each of these operations also uses a level of file switching. For an interactive + run, a :ref:`input`,TERM switches to the terminal for the next input. A ``/EOF`` read from the + terminal then switches back to the previous file. A :ref:`input` (with a blank second field) + switches back to the primary input file. + + Setting ``LOG`` = 1 on :ref:`input` causes all commands read from the specified file to be recorded + in the command log ( :file:`File.LOG` ) and the internal database command log ( :ref:`lgwrite` ). + This option is recommended if the log file will be used later. The ``LOG`` = 1 option is only valid + when the :ref:`input` occurs in the primary input file. Using ``LOG`` = 1 on a nested :ref:`input` + or on a :ref:`input` within a do-loop will have no effect (that is, commands in the secondary input file are not written to the command log). - The Dir option is optional as the directory path can be included - directly in Fname. + The ``Dir`` option is optional as the directory path can be included directly in ``Fname``. - Examples - -------- - Run an input file relative to the location of MAPDL. + This command is valid in any processor. + """ + command = f"/INPUT,{fname},{ext},{dir_},{line},{log}" + return self.run(command, **kwargs) + + def keyw(self, **kwargs): + r"""Sets a keyword used by the GUI for context filtering (GUI). - >>> mapdl.input('my_input_file.inp') + Mechanical APDL Command: `KEYW `_ + Notes + ----- + + .. _KEYW_notes: + + This is a program-generated command and is not intended for your use. It is included here in the + documentation because it might appear in the log file ( :file:`Jobname.log` ). When using log files, + or portions of log files, as input, any included :ref:`keyw` commands may be left as is, or removed, + without consequence. """ - return self.run(f"/INPUT,{fname},{ext},{dir},{line},{log}", **kwargs) + command = "KEYW" + return self.run(command, **kwargs) - def keyw(self, keyword="", key="", **kwargs): - """Sets a keyword used by the GUI for context filtering (GUI). + def memm(self, lab: str = "", kywrd: str = "", **kwargs): + r"""Allows the current session to keep allocated memory - APDL Command: KEYW + Mechanical APDL Command: `MEMM `_ Parameters ---------- - keyword - A keyword which, when set to either true or false, changes the - behavior of the GUI. + lab : str + When ``Lab`` = KEEP, the memory manager's ability to acquire and keep memory is controlled by + ``Kywrd`` + + kywrd : str + Turns the memory "keep" mode on or off + + * ``ON`` - Keep any memory allocated during the analysis. - key - Keyword switch: + * ``OFF`` - Use memory dynamically and free it up to other users after use (default). - 0 - Sets the keyword to "false." + Notes + ----- + + .. _MEMM_notes: + + You can use the :ref:`memm` command to ensure that memory intensive operations will always have the + same memory available when the operations occur intermittently. Normally, if a large amount of + memory is allocated for a specific operation, it will be returned to the system once the operation + is finished. This option always maintains the highest level used during the analysis until the + analysis is finished. + + The :ref:`memm` command does not affect the value you specify with the -m switch. When you allocate + memory with the -m switch, that amount will always be available. However, if dynamic memory + allocation in excess of the -m value occurs, you can use the :ref:`memm` command to ensure that + amount is retained until the end of your analysis. + """ + command = f"MEMM,{lab},{kywrd}" + return self.run(command, **kwargs) + + def menu(self, key: str = "", **kwargs): + r"""Activates the Graphical User Interface (GUI). - 1 - Sets the keyword to "true." + Mechanical APDL Command: `/MENU `_ + + Parameters + ---------- + key : str + Activation key: + + * ``ON`` - Activates the menu system (device dependent). Notes ----- - Defines a keyword used by the GUI for context filtering. This is a - command generated by the GUI and may appear in the log file - (Jobname.LOG) if the GUI is used. This command is usually not typed in - directly in an ANSYS session. + + .. _s-MENU_notes: + + Activates the Graphical User Interface (GUI). + + .. warning:: + + if you include the /MENU,ON command in your start.ans, it should be the lastcommand in the + file. Any commands after /MENU,ON may be ignored. (It is not necessary to include the /SHOW and + /MENU,ON commands in start.ansif you will be using the launcher to enter the Mechanical APDL program.) This command is valid in any processor. """ - command = "KEYW,%s,%s" % (str(keyword), str(key)) + command = f"/MENU,{key}" return self.run(command, **kwargs) - def memm(self, lab="", kywrd="", **kwargs): - """Allows the current session to keep allocated memory. + def mstart(self, label: str = "", key: str = "", **kwargs): + r"""Controls the initial GUI components. - APDL Command: MEMM + Mechanical APDL Command: `/MSTART `_ Parameters ---------- - lab - When Lab = KEEP, the memory manager's ability to acquire and keep - memory is controlled by Kywrd + label : str + Label identifying the GUI component: - kywrd - Turns the memory "keep" mode on or off + * ``ZOOM`` - `Pan, Zoom, Rotate + `_ + dialog box, off by default. + + * ``WORK`` - `Offset Working Plane + `_ + dialog box, off by default. + + * ``WPSET`` - `Working Plane Settings + `_ + dialog box, off by default. + + * ``ABBR`` - `Edit Toolbar/Abbreviations + `_ + dialog box, off by default. + + * ``PARM`` - `Scalar Parameters + `_ + dialog box, off by default. + + * ``SELE`` - Select Entities dialog box, off by default. + + * ``ANNO`` - Annotation dialog box, off by default. + + * ``HARD`` - Hard Copy dialog box, off by default. - ON - Keep any memory allocated during the analysis. + * ``UTIL`` - Activates the pre-6.1 (UIDL) GUI (off by default). - OFF - Use memory dynamically and free it up to other users after use (default). + key : str + Switch value: + + * ``OFF or 0`` - Component does not appear when GUI is initialized. + + * ``ON or 1`` - Component appears when GUI is initialized. Notes ----- - You can use the MEMM command to ensure that memory intensive operations - will always have the same memory available when the operations occur - intermittently. Normally, if a large amount of memory is allocated for - a specific operation, it will be returned to the system once the - operation is finished. This option always maintains the highest level - used during the analysis until the analysis is finished. - - The MEMM command does not affect the value you specify with the -m - switch. When you allocate memory with the -m switch, that amount will - always be available. However, if dynamic memory allocation in excess of - the-m value occurs, you can use the MEMM command to ensure that amount - is retained until the end of your analysis. + + .. _s-MSTART_notes: + + Controls which components appear when the Graphical User Interface (GUI) is initially brought up. + This command is valid only before the GUI is brought up ( :ref:`menu`,ON) and is intended to be used + in the :file:`start.ans` file. It only affects how the GUI is initialized ; you can always bring up + or close any component once you are in the GUI. + + This command is valid only at the Begin Level. """ - command = "MEMM,%s,%s" % (str(lab), str(kywrd)) + command = f"/MSTART,{label},{key}" return self.run(command, **kwargs) - def nerr(self, nmerr="", nmabt="", abort="", ifkey="", num="", **kwargs): - """Limits the number of warning and error messages displayed. + def nerr( + self, + nmerr: str = "", + nmabt: str = "", + ifkey: str = "", + num: int | str = "", + **kwargs, + ): + r"""Limits the number of warning and error messages displayed. - APDL Command: /NERR + Mechanical APDL Command: `/NERR `_ Parameters ---------- - nmerr - Maximum number of warning and error messages displayed per - command. Defaults to 5 for interactive runs with the GUI - turned on, 20 for interactive runs with the GUI turned - off, 200 for batch runs. If NMERR is negative, the - absolute value of NMERR is used as the maximum number of - warning and error messages written to the error file - (file.ERR) per command, as well as the maximum number of - messages displayed per command. - - nmabt - Maximum number of warning and error messages allowed per - command before run aborts (must be greater than zero). - Maximum value is 99,999,999. Defaults to 10,000. - - abort - Abort level key. Set to 0 for default abort behavior, -1 - to never abort, and -2 to abort after ``nmabt`` errors. - Altering the abort level key is not recommended, but can - be helpful for avoiding an abort within /BATCH mode but - using ``pyansys`` interactively. - - ifkey - Specifies whether or not to abort if an error occurs during a - /INPUT operation: - - 0 or OFF - Do not abort. This option is the default. - - 1 or ON - Abort. - - num - The number of invalid command warnings before a stop warning will - be issued: - - 0 - Disables the stop warning/error function. - - n - An integer value representing the number of warnings that will be encountered - before prompting the user to stop (default = 5). The first - error encountered will ALWAYS result in a prompt. + nmerr : str + Maximum number of warning and error messages displayed per command. Defaults to 5 for + interactive runs with the GUI turned on, 20 for interactive runs with the GUI turned off, 200 + for batch runs. If ``NMERR`` is negative, the absolute value of ``NMERR`` is used as the maximum + number of warning and error messages written to the error file ( :file:`Jobname.ERR` ) per + command, as well as the maximum number of messages displayed per command. + + nmabt : str + Maximum number of warning and error messages allowed per command before run aborts (must be + greater than zero). Maximum value is 99,999,999. Defaults to 10,000. + + ifkey : str + Specifies whether or not to abort if an error occurs during a :ref:`input` operation: + + * ``0, or OFF`` - Do not abort. This option is the default. + + * ``1, or ON`` - Abort. + + num : int or str + The number of invalid command warnings before a stop warning will be issued: + + * ``0`` - Disables the stop warning/error function. + + * ``n`` - An integer value representing the number of warnings that will be encountered before + prompting the user to stop (default = 5). The first error encountered will ALWAYS result in a + prompt. + + Invalid command warnings and error tracking are mutually exclusive. Notes ----- - Limits the number of warning and error messages displayed for any one - command in an interactive run. - Warning and error messages continue to be written to Jobname.ERR - regardless of these limits (unless NMERR is negative). + .. _s-NERR_notes: - Issue this command with NUM = n to specify the number of "invalid - command" warnings to be encountered before the user is prompted to - stop. You can then continue or abort the run. If you choose to abort - the run, the log file can be saved so that any of the processing up to - that point can be appended to an input that rectifies the condition. A - batch run always aborts on the first error. Issue /NERR,STAT to list - current settings. + Limits the number of warning and error messages displayed for any one command in an interactive run. - Issue /NERR,DEFA to reset values to initial defaults. + Warning and error messages continue to be written to :file:`Jobname.ERR` regardless of these limits, + unless ``NMERR`` is negative. There is no way to totally suppress writing of warning and error + messages to the error file. - An IFKEY value of 1 or ON causes the ANSYS program to abort immediately - upon encountering an error during a file /INPUT operation. However, use - of this option may cause the following conditions to occur: + Issue this command with ``NUM`` = ``n`` to specify the number of invalid command warnings to be + encountered before the user is prompted to stop. You can then continue or abort the run. If you + choose to abort the run, the log file can be saved so that any of the processing up to that point + can be appended to an input that rectifies the condition. A batch run always aborts on the first + error. Issue :ref:`nerr`,STAT to list current settings. - The /INPUT command may abort if issued for a log file (jobname.log). + Issue :ref:`nerr`,DEFA to reset values to initial defaults. - Some macros may abort. + An ``IFKEY`` value of 1 or ON causes Mechanical APDL to terminate immediately upon encountering an + error during a file :ref:`input` operation. However, use of this option may cause the following + conditions to occur: - A CAD connection may fail after reading only a small portion of a CAD - model. + * The :ref:`input` command may abort if issued for a log file ( :file:`jobname.log` ). + + * Some macros may terminate. + + * A CAD connection may fail after reading only a small portion of a CAD model. The command is valid in any processor. """ - command = "/NERR,%s,%s,%s,%s,%s" % ( - str(nmerr), - str(nmabt), - str(abort), - str(ifkey), - str(num), - ) + command = f"/NERR,{nmerr},{nmabt},,{ifkey},{num}" + return self.run(command, **kwargs) + + def output(self, fname: str = "", ext: str = "", loc: str = "", **kwargs): + r"""Redirects text output to a file or to the screen. + + Mechanical APDL Command: `/OUTPUT `_ + + Parameters + ---------- + fname : str + Filename and directory path (248 character maximum, including directory) to which text output + will be redirected (defaults to :file:`Jobname` if ``Ext`` is specified). For interactive runs, + ``Fname`` = TERM (or blank) redirects output to the screen. For batch runs, ``Fname`` = blank + (with all remaining command arguments blank) redirects output to the default system output file. + + ext : str + Filename extension (eight-character maximum). + + loc : str + Location within a file to which output will be written: + + * ``(blank)`` - Output is written starting at the top of the file (default). + + * ``APPEND`` - Output is appended to the existing file. + + Notes + ----- + + .. _s-OUTPUT_notes: + + Text output includes responses to every command and GUI function, notes, warnings, errors, and other + informational messages. Upon execution of :ref:`output`, ``Fname``, ``Ext``, ``...``, all subsequent + text output is redirected to the file :file:`Fname.Ext`. To redirect output back to the default + location, issue :ref:`output` (no arguments). + + When using the GUI, output from list operations ( :ref:`nlist`, :ref:`dlist`, etc.) is always sent + to a list window regardless of the :ref:`output` setting. The output can then be saved on a file or + copied to the :ref:`output` location using the File menu in the list window. + + This command is valid in any processor. + """ + command = f"/OUTPUT,{fname},{ext},,{loc}" return self.run(command, **kwargs) def pause(self, **kwargs): - """Temporarily releases the current product license. + r"""Temporarily releases the current product license. - APDL Command: PAUSE + Mechanical APDL Command: `PAUSE `_ Notes ----- - The PAUSE command temporarily releases (or pauses) the current product - license so that another application can use it. - This application consumes a license as soon as you launch it, and - retains that license until it is finished. If you launch the product - interactively, the license is retained until you either close the - application or issue a PAUSE command via the command line. + .. _PAUSE_notes: + + The :ref:`pause` command temporarily releases (or pauses) the current product license so that + another application can use it. - No other operation (other than SAVE or /EXIT) is possible in the - current application while use of the product license is paused. + This application consumes a license as soon as you launch it, and retains that license until it is + finished. If you launch the product interactively, the license is retained until you either close + the application or issue a :ref:`pause` command via the command line. - When the second application has finished and releases the license, - issue an UNPAUSE command via the command line to restore use of the - license to the current application. + No other operation (other than :ref:`save` or ``/EXIT`` ) is possible in the current application + while use of the product license is paused. - For more information, see the ANSYS, Inc. Licensing Guide. + When the second application has finished and releases the license, issue an :ref:`unpause` command + via the command line to restore use of the license to the current application. + + For more information, see the `Ansys Licensing Guide + `_. """ - command = "PAUSE," + command = "PAUSE" return self.run(command, **kwargs) - def slashstatus(self, lab="", **kwargs): - """Lists the status of items for the run. + def slashstatus(self, lab: str = "", **kwargs): + r"""Lists the status of items for the run. - APDL Command: /STATUS + Mechanical APDL Command: `/STATUS `_ Parameters ---------- - lab + lab : str Items to list status for: - ALL - List all below (default). + * ``ALL`` - List all below (default). - TITLE - List only titles, Jobname, and revision number. + * ``TITLE`` - List only titles, :file:`Jobname`, and revision number. - UNITS - List only units. + * ``UNITS`` - List only units. - MEM - List only memory data statistics. + * ``MEM`` - List only memory data statistics. - DB - List only database statistics + * ``DB`` - List only database statistics - CONFIG - List only configuration parameters. + * ``CONFIG`` - List only configuration parameters. - GLOBAL - Provides a global status summary. + * ``GLOBAL`` - Provides a global status summary. - SOLU - Provides a solution status summary. + * ``SOLU`` - Provides a solution status summary. - PROD - Provides a product summary. + * ``PROD`` - Provides a product summary. Notes ----- - Displays various items active for the run (such as the ANSYS revision - number, Jobname, titles, units, configuration parameters, database - statistics, etc.). + + .. _s-STATUS_notes: + + Displays various items active for the run (such as the Mechanical APDL revision number, + :file:`Jobname`, + titles, units, configuration parameters, database statistics, etc.). This command is valid in any processor. """ - return self.run(f"/STATUS,{lab}", **kwargs) + command = f"/STATUS,{lab}" + return self.run(command, **kwargs) - def starstatus( + def syp( self, - par="", - imin="", - imax="", - jmin="", - jmax="", - kmin="", - kmax="", - lmin="", - lmax="", - mmin="", - mmax="", - kpri="", + string: str = "", + arg1: str = "", + arg2: str = "", + arg3: str = "", + arg4: str = "", + arg5: str = "", + arg6: str = "", + arg7: str = "", + arg8: str = "", **kwargs, ): - """Lists the current parameters and abbreviations. + r"""Passes a command string and arguments to the operating system. - APDL Command: ``*STATUS`` + Mechanical APDL Command: `/SYP `_ Parameters ---------- - par - Specifies the parameter or sets of parameters listed. For array - parameters, use IMIN, IMAX, etc. to specify ranges. Use ``*DIM`` to - define array parameters. Use ``*VEDIT`` to review array parameters - interactively. Use ``*VWRITE`` to print array values in a formatted - output. If Par is blank, list all scalar parameter values, array - parameter dimensions, and abbreviations. If ARGX, list the active - set of local macro parameters (ARG1 to ARG9 and AR10 to AR99) - [``*USE``]. + string : str + Command string (cannot include commas). See also the :ref:`sys` command. + + arg1 : str + Arguments to be appended to the command string, separated by blanks, commas, or other delimiter + characters (see the `Operations Guide + `_). The + arguments may be numbers, parameters, or parametric expressions. + + arg2 : str + Arguments to be appended to the command string, separated by blanks, commas, or other delimiter + characters (see the `Operations Guide + `_). The + arguments may be numbers, parameters, or parametric expressions. + + arg3 : str + Arguments to be appended to the command string, separated by blanks, commas, or other delimiter + characters (see the `Operations Guide + `_). The + arguments may be numbers, parameters, or parametric expressions. + + arg4 : str + Arguments to be appended to the command string, separated by blanks, commas, or other delimiter + characters (see the `Operations Guide + `_). The + arguments may be numbers, parameters, or parametric expressions. + + arg5 : str + Arguments to be appended to the command string, separated by blanks, commas, or other delimiter + characters (see the `Operations Guide + `_). The + arguments may be numbers, parameters, or parametric expressions. + + arg6 : str + Arguments to be appended to the command string, separated by blanks, commas, or other delimiter + characters (see the `Operations Guide + `_). The + arguments may be numbers, parameters, or parametric expressions. + + arg7 : str + Arguments to be appended to the command string, separated by blanks, commas, or other delimiter + characters (see the `Operations Guide + `_). The + arguments may be numbers, parameters, or parametric expressions. + + arg8 : str + Arguments to be appended to the command string, separated by blanks, commas, or other delimiter + characters (see the `Operations Guide + `_). The + arguments may be numbers, parameters, or parametric expressions. - Lists all parameters (except local macro parameters and those with names beginning or ending with an underbar) and toolbar abbreviations. - Lists only parameters with names beginning with an underbar (_). These are - ANSYS internal parameters. + Notes + ----- - Lists only parameters with names ending with an underbar (_). A good APDL programming convention is to ensure that all parameters created by your system programmer are named with a trailing underbar. - Lists all toolbar abbreviations. + .. _s-SYP_notes: - Lists all parameters (except local macro parameters and those with names beginning or ending with an underbar). - Lists all APDL Math parameters, including vectors, matrices, and linear - solvers. + Passes a command string to the operating system for execution, along with arguments to be appended + to the command string. See the `Operations Guide + `_ for details. + Mechanical APDL may not be aware of your specific user + environment. For example, on Linux this command may not recognize aliases, depending on the hardware + platform and user environment. - Lists only the parameter specified. PARNAME cannot be a local macro parameter name. - Lists all local macro parameter values (ARG1- AR99) that are non-zero or non- - blank. + This command is valid in any processor. + """ + command = ( + f"/SYP,{string},{arg1},{arg2},{arg3},{arg4},{arg5},{arg6},{arg7},{arg8}" + ) + return self.run(command, **kwargs) - imin, imax, jmin, jmax, kmin, kmax, lmin, lmax, mmin, mmax - Range of array elements to display (in terms of the dimensions - (row, column, plane, book, and shelf). Minimum values default to - 1. Maximum values default to the maximum dimension values. Zero - may be input for IMIN, JMIN, and KMIN to display the index numbers. - See ``*TAXIS`` command to list index numbers of 4- and 5-D tables. + def sys(self, string: str = "", **kwargs): + r"""Passes a command string to the operating system. - kpri - Use this field to list your primary variable labels (X, Y, Z, TIME, - etc.). + Mechanical APDL Command: `/SYS `_ - List the labels (default). YES, Y, or ON are also valid entries. - Do not list the labels. NO, N, or OFF are also valid entries. + Parameters + ---------- + string : str + Command string, up to 639 characters (including blanks, commas, etc.). The specified string is + passed verbatim to the operating system, that is, no parameter substitution is performed. Notes ----- - You cannot obtain the value for a single local parameter (e.g., - ``*STATUS,ARG2``). You can only request all local parameters simultaneously - using ``*STATUS,ARGX``. + + .. _s-SYS_notes: + + Passes a command string to the operating system for execution (see the `Operations Guide + `_). Typical strings + are system commands such as list, copy, rename, etc. Control returns to Mechanical APDL after the + system + procedure is completed. Mechanical APDL may not be aware of your specific user environment. For + example, on + Linux this command may not recognize aliases, depending on the hardware platform and user + environment. This command is valid in any processor. """ - command = "*STATUS,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s" % ( - str(par), - str(imin), - str(imax), - str(jmin), - str(jmax), - str(kmin), - str(kmax), - str(lmin), - str(lmax), - str(mmin), - str(mmax), - str(kpri), - ) + command = f"/SYS,{string}" return self.run(command, **kwargs) - def syp( + def ui( self, - string="", - arg1="", - arg2="", - arg3="", - arg4="", - arg5="", - arg6="", - arg7="", - arg8="", + func: str = "", + type_: str = "", + format_: str = "", + screen: str = "", + color: str = "", + krev: str = "", + orient: str = "", + compress: str = "", + quality: str = "", **kwargs, ): - """Passes a command string and arguments to the operating system. + r"""Activates specified GUI dialog boxes. - APDL Command: /SYP + Mechanical APDL Command: `/UI `_ Parameters ---------- - string - Command string (cannot include commas). See also the /SYS command. + func : str + Label identifying the dialog box to be activated: + + * ``HELP`` - Activates the online help system. + + * ``VIEW`` - Activates the Pan, Zoom, Rotate dialog box + + * ``WPSE`` - Activates the Working Plane Settings dialog box. + + * ``WPVI`` - Activates the Offset Working Plane dialog box. + + * ``RESULT`` - Activates the Query Picking Menu for reviewing results. + + * ``QUERY`` - Activates the Query Picked Entities (preprocess) dialog box. + + * ``COPY`` - Activates the Hard Copy dialog box. + + * ``ANNO`` - Activates the 2D Annotation dialog box. + + * ``AN3D`` - Activates the 3D Annotation dialog box. + + * ``SELECT`` - Activates the Select Entities dialog box. + + * ``NSEL`` - Activates a picking menu to select nodes. + + * ``ESEL`` - Activates a picking menu to select elements. + + * ``KSEL`` - Activates a picking menu to select keypoints. + + * ``LSEL`` - Activates a picking menu to select lines. + + * ``ASEL`` - Activates a picking menu to select areas. + + * ``VSEL`` - Activates a picking menu to select volumes. + + * ``REFRESH`` - Refreshes the graphics window (non-UI mode only). + + * ``COLL`` - Controls the collapse of the Mechanical APDL main menu when a :ref:`finish` command is issued. + See Type below for a discussion of the arguments. + + type_ : str + Label identifying the type of select operation. Valid only for the following ``Func`` labels; NSEL, ESEL, KSEL, LSEL, ASEL, and VSEL: + + * ``S`` - Select a new set. + + * ``R`` - Reselect a set from the current set. + + * ``A`` - Additionally select a set and extend the current set. + + * ``U`` - Unselect a set from the current set. + + Label identifying the type of results data to be queried. Valid only for ``Func`` = RESULT: + + * ``NODE`` - Nodal solution data (h-elements only). + + * ``ELEMENT`` - Element solution data. + + Label specifying the behavior of the Mechanical APDL main menu after a :ref:`finish` command is issued. User interaction with the main menu is unaffected. Valid only for ``Func`` = COLL: + + * ``YES, 1 or blank`` - Allows the Main Menu to collapse after :ref:`finish` command. + + * ``NO or 0`` - Prevents Main Menu collapse after :ref:`finish` command. - arg1, arg2, arg3, . . . , arg8 - Arguments to be appended to the command string, separated by - blanks, commas, or other delimiter characters (see the Operations - Guide). The arguments may be numbers, parameters, or parametric - expressions. + format_ : str + + * ``TIFF`` - Tagged Image File Format. + + * ``BMP`` - (PC only) Bitmap (Windows) file format. + + * ``WMF`` - (PC only) Windows Metafile format. + + * ``EMF`` - (PC only) Enhanced Metafile format. + + * ``JPEG`` - JPEG (Joint Photographic Experts Group) file format. + + screen : str + + * ``FULL`` - Saves the entire screen in the specified format. + + * ``GRAPH`` - Saves only the Mechanical APDL graphic window. + + color : str + + * ``MONO`` - A two color (black and white) file is saved. + + * ``GRAY`` - The specified file format is saved in gray scale. + + * ``COLOR`` - The file is saved at the specified color depth. + + krev : str + + * ``NORM`` - Saves file as shown on the screen. + + * ``REVERSE`` - Saves file with the background color reversed. + + orient : str + + * ``LANDSCAPE`` - Saves file in landscape mode. + + * ``PORTRAIT`` - Saves file in portrait mode. + + compress : str + + * ``YES`` - Compresses TIFF files and EPS files with TIFF preview (default). + + * ``NO`` - Saves files with no compression. + + quality : str + + * ``1,2,,,100`` - JPEG quality index, with 100 being the maximum quality level. Notes ----- - Passes a command string to the operating system for execution, along - with arguments to be appended to the command string. See the - Operations Guide for details. ANSYS may not be aware of your specific - user environment. For example, on Linux this command may not recognize - aliases, depending on the hardware platform and user environment. - This command is valid in any processor. + .. warning:: + + This function contains specificities regarding the argument definitions. + Please refer to the `command documentation `_ + for further explanations. + + .. _s-UI_notes: + + Allows you to activate specified GUI dialog boxes directly in either GUI or non-GUI mode. + + The :ref:`ui` command itself is valid in any processor, however certain dialog boxes are accessible + only in a particular processor (for example, :ref:`ui`,RESULT,... is valid only in the General + Postprocessor). + + Mechanical APDL JPEG software is based in part on the work of the Independent JPEG Group, Copyright + 1998, + Thomas G. Lane. """ - command = "/SYP,%s,%s,%s,%s,%s,%s,%s,%s,%s" % ( - str(string), - str(arg1), - str(arg2), - str(arg3), - str(arg4), - str(arg5), - str(arg6), - str(arg7), - str(arg8), - ) + command = f"/UI,{func},{type_},{format_},{screen},{color},{krev},{orient},{compress},{quality}" return self.run(command, **kwargs) - def sys(self, string="", **kwargs): - """Passes a command string to the operating system. + def uis(self, label: str = "", value: int | str = "", **kwargs): + r"""Controls the GUI behavior. - APDL Command: /SYS + Mechanical APDL Command: `/UIS `_ Parameters ---------- - string - Command string, up to 639 characters (including blanks, commas, - etc.). The specified string is passed verbatim to the operating - system, i.e., no parameter substitution is performed. + label : str + Behavior control key: + + * ``BORD`` - Controls the functionality of the mouse buttons for dynamic viewing mode only. When + ``Label`` = BORD, the three values that follow control the functionality of the LEFT, MIDDLE and + RIGHT buttons, respectively (see below). + + * ``MSGPOP`` - Controls which messages from the Mechanical APDL error-message subroutine are displayed in a + message dialog box. + + * ``REPLOT`` - Controls whether or not an automatic replot occurs after functions affecting the + model are executed. + + * ``ABORT`` - Controls whether or not the program displays dialog boxes to show the status of an + operation in progress and to cancel that operation. + + * ``DYNA`` - Controls whether the dynamic mode preview is a bounding box or the edge outline of the + model. This label only applies to 2D display devices (that is, :ref:`show`,XII or + :ref:`show`,WIN32). This "model edge outline" mode is only supported in PowerGraphics ( + :ref:`graphics`,POWER) and is intended for element, line, results, area, or volume displays. + + * ``PICK`` - Controls how graphical entities are highlighted from within the the Select menu. + + * ``POWER`` - Controls whether or not PowerGraphics is active when the GUI is initiated. Mechanical APDL + default status is PowerGraphics "ON"; this command is used (placed in the :file:`start.ans` file) + when full graphics is desired on start up. + + * ``DPRO`` - Controls whether or not the input window displays a dynamic prompt. The dynamic prompt + shows the correct command syntax for the command, as you are entering it. + + * ``UNDO`` - Controls whether or not the session editor includes nonessential commands or comments + in the file it creates. You can use this option to include comments and other materials in the + session editor file. + + * ``LEGE`` - Controls whether or not the multi-legend is activated when you start the GUI. The + multi-legend enables you to specify the location of your legend items in each of the five graphics + windows. You can place this option in your :file:`start.ans` file and have the GUI start with the + legend items in a pre-specified location. + + * ``PBAK`` - Controls whether or not the background shading is activated when you start the GUI. You + can place this option in your :file:`start.ans` file. + + * ``ZPIC`` - Controls the sorting order for entities that are coincident (directly in front of or + behind each other) to a picked spot on your model. When you pick a spot on your model that could + indicate two or more entities, a message warns you of this condition, and a list of the coincident + entities can be generated. The ``VALUE`` term (below) will determine the sort order. + + * ``HPOP`` - Controls the prioritization of your GUI windows when the contents are ported to a plot + or print file ( :ref:`ui`,COPY,SAVE). OpenGL (3D) graphics devices require that the Mechanical APDL + graphics window contents be set in front of all overlying windows in order to port them to a printer + or a file. This operation can sometimes conflict with :ref:`noerase` settings. See the ``VALUE`` + term (below) to determine the available control options. + + value : int or str + Values controlling behavior if ``Label`` = BORD: + + (These values control the operation according to syntax : :ref:`uis`,BORD, LEFT, MIDDLE, RIGHT ) + + * ``1`` - PAN, controls dynamic translations. + + * ``2`` - ZOOM, controls zoom, and dynamic rotation about the view vector. + + * ``3`` - ROTATE, controls dynamic rotation about the screen X and Y axes. + + You can designate any value for any button, or designate the same value for all three buttons. If no + value is specified, default is LEFT = PAN, MIDDLE = ZOOM and RIGHT = ROTATE. + + Values controlling behavior if ``Label`` = MSGPOP: + + * ``0`` - All messages displayed. + + * ``1`` - Only notes, warnings, and errors displayed. + + * ``2`` - Only warnings and errors displayed (default). + + * ``3`` - Only errors displayed. + + Values controlling behavior if ``Label`` = REPLOT: + + * ``0`` - No automatic replot. + + * ``1`` - Automatic replot (default). + + Values controlling behavior if ``Label`` = ABORT: + + * ``ON`` - Display status and cancellation dialog boxes (default). + + * ``OFF`` - Do not display status and cancellation dialog boxes. + + * ``1`` - Same as ON. + + * ``0`` - Same as OFF. + + Values controlling behavior if ``Label`` = DYNA: + + * ``0`` - Use model edge outline when possible (default). + + * ``1`` - Use bounding box preview. + + Values controlling behavior if ``Label`` = PICK: + + * ``0`` - Picked keypoints and nodes are enclosed by a square. Picked lines are overlaid by a + thicker line. Picked areas, volumes, and elements (non-point/non-line) are redrawn with highlighting + colors. However, if the pick is a box, circle, or polygon pick, the highlighting for all entitles + consists only of a square placed around the entity's centroid. + + * ``1`` - Picked entities are not highlighted. + + * ``2`` - 5.1 highlighting (that is, no XOR). + + * ``3`` - Picked entities are highlighted as in ``VALUE`` = 0, except that, for a box, circle, or + polygon pick, the picked areas, volumes, and elements (non-point/non-line) are redrawn with + highlighting colors. This technique is slower than the ``VALUE`` = 0 technique. + + Values controlling behavior if ``Label`` = POWER: + + * ``0`` - Start GUI in Full Graphics mode. + + * ``1`` - Start GUI in PowerGraphics mode (default). + + Values controlling behavior if ``Label`` = DPRO: + + * ``0 or OFF`` - Do not display the dynamic prompt. + + * ``1 or ON`` - Display the dynamic prompt (default). + + Values controlling behavior if ``Label`` = UNDO: + + * ``0 or None`` - Do not suppress any commands (default). + + * ``1 or Comment`` - Write the nonessential commands to the session editor file as comments (with a + ! at the beginning). + + * ``2 or Remove`` - Do not write nonessential commands or comments. + + Values controlling behavior if ``Label`` = LEGE: + + * ``0 or OFF`` - Start GUI with the enhanced legend off (default). + + * ``1 or ON`` - Start GUI with the enhanced legend capability activated. + + Values controlling behavior if ``Label`` = PBAK: + + * ``0 or OFF`` - Start the GUI with the no background shading (default). + + * ``1 or ON`` - Start the GUI with background shading activated. + + Values controlling behavior if ``Label`` = HPOP: + + * ``0 or OFF`` - No rewrite operations are performed to compensate for items that obscure or overlay + the graphics window (default). + + * ``1 or ON`` - The Graphics screen contents are replotted to ensure that they are situated in front + of all other windows. If :ref:`noerase` is detected, this operation is suppressed. Notes ----- - Passes a command string to the operating system for execution (see the - Operations Guide). Typical strings are system commands such as list, - copy, rename, etc. Control returns to the ANSYS program after the - system procedure is completed. ANSYS may not be aware of your - specific user environment. For example, on Linux this command may not - recognize aliases, depending on the hardware platform and user - environment. + + .. _s-UIS_notes: + + Controls certain features of the Graphical User Interface (GUI), including whether Mechanical APDL + displays + dialog boxes to show you the status of an operation (such as meshing or solution) in progress and to + enable you to cancel that operation. Issue :ref:`uis`,STAT for current status. Issue :ref:`uis` + ,DEFA to reset default values for all labels. Issue :ref:`uis`, ``Label``,STAT and :ref:`uis`, + ``Label``,DEFA for status and to reset a specific ``Label`` item. + + A :ref:`uis`,HPOP,1 command employs a fast redraw method which does not allow entering the legend + logic for a :ref:`plopts`,INFO,1 or :ref:`plopts`,INFO,2 command. However, the legend is redrawn + for :ref:`plopts`,INFO,3 because that command also allows a fast redraw. This command is valid in any processor. """ - command = f"/SYS,{string}" + command = f"/UIS,{label},{value}" return self.run(command, **kwargs) def unpause(self, **kwargs): - """Restores use of a temporarily released product license. + r"""Restores use of a temporarily released product license. - APDL Command: UNPAUSE + Mechanical APDL Command: `UNPAUSE `_ Notes ----- - The UNPAUSE command restores use of a temporarily released (paused) - product license. The command is valid only after a previously issued - PAUSE command. - When use of the product license is paused via the PAUSE command, no - other operation (other than SAVE or /EXIT) is possible until you issue - the UNPAUSE command. + .. _UNPAUSE_notes: + + The :ref:`unpause` command restores use of a temporarily released (paused) product license. The + command is valid only after a previously issued :ref:`pause` command. + + When use of the product license is paused via the :ref:`pause` command, no other operation (other + than :ref:`save` or ``/EXIT`` ) is possible until you issue the :ref:`unpause` command. - For more information, see the documentation for the PAUSE command and - the ANSYS, Inc. Licensing Guide. + For more information, see the documentation for the :ref:`pause` command and the `Ansys Licensing + Guide `_. """ - command = "UNPAUSE," + command = "UNPAUSE" return self.run(command, **kwargs) diff --git a/src/ansys/mapdl/core/commands.py b/src/ansys/mapdl/core/commands.py index cfdb7007343..f9c5e3e1426 100644 --- a/src/ansys/mapdl/core/commands.py +++ b/src/ansys/mapdl/core/commands.py @@ -33,22 +33,20 @@ from ._commands import ( apdl, - aux2_, - aux3_, - aux12_, - aux15_, + aux2, + aux3, + aux12, + aux15, conn, database, - display_, - graphics_, + graphics, hidden, inq_func, - map_cmd, + map, misc, - post1_, - post26_, + post1, + post26, preproc, - reduced, session, solution, ) @@ -357,52 +355,68 @@ class PreprocessorCommands( pass -class APDLCommands( +class Apdl( apdl.abbreviations.Abbreviations, - apdl.array_param.ArrayParam, + apdl.array_parameters.ArrayParameters, + apdl.encryption_decryption.EncryptionDecryption, apdl.macro_files.MacroFiles, - apdl.matrix_op.MatrixOP, + apdl.matrix_operations.MatrixOperations, apdl.parameter_definition.ParameterDefinition, apdl.process_controls.ProcessControls, ): pass -class Aux2Commands(aux2_.bin_dump.BinDump, aux2_.bin_manip.BinManip): +class Aux2Commands( + aux2.binary_file_dump.BinaryFileDump, + aux2.binary_file_manipulation.BinaryFileManipulation, +): + pass + + +class Aux3Commands(aux3.results_files.ResultsFiles): pass class Aux12Commands( - aux12_.radiosity_solver.RadiositySolver, - aux12_.radiation_mat.RadiationMat, - aux12_.general_radiation.GeneralRadiation, + aux12.general_radiation.GeneralRadiation, + aux12.radiation_matrix_method.RadiationMatrixMethod, + aux12.radiosity_solver.RadiositySolver, +): + pass + + +class Aux15Commands( + aux15.iges.Iges, ): pass class DatabaseCommands( - database.setup.Setup, + database.components.Components, + database.coordinate_system.CoordinateSystem, database.picking.Picking, - database.coord_sys.CoordinateSystem, database.selecting.Selecting, + database.set_up.SetUp, database.working_plane.WorkingPlane, - database.components.Components, ): pass -class DisplayCommands(display_.setup.Setup): +class GraphicsCommands( + graphics.annotation.Annotation, + graphics.graphs.Graphs, + graphics.labeling.Labeling, + graphics.scaling.Scaling, + graphics.set_up.SetUp, + graphics.style.Style, + graphics.views.Views, +): pass -class GraphicsCommands( - graphics_.annotation.Annotation, - graphics_.graphs.Graphs, - graphics_.labeling.Labelling, - graphics_.scaling.Scaling, - graphics_.setup.Setup, - graphics_.style.Style, - graphics_.views.Views, +class MapCommands( + map.pressure_mapping.PressureMapping, ): pass @@ -412,41 +426,35 @@ class MiscCommands(misc.misc.Misc): class Post1Commands( - post1_.animation.Animation, - post1_.controls.Controls, - post1_.element_table.ElementTable, - post1_.failure_criteria.FailureCriteria, - post1_.listing.Listing, - post1_.load_case.LoadCase, - post1_.magnetics_calc.MagneticsCalc, - post1_.path_operations.PathOperations, - post1_.results.Results, - post1_.setup.Setup, - post1_.special.Special, - post1_.status.Status, - post1_.surface_operations.SurfaceOperations, - post1_.trace_points.TracePoints, + post1._fatigue.Fatigue, + post1._special_purpose.SpecialPurpose, + post1.animation.Animation, + post1.controls.Controls, + post1.element_table.ElementTable, + post1.failure_criteria.FailureCriteria, + post1.listing.Listing, + post1.load_case_calculations.LoadCaseCalculations, + post1.magnetics_calculations.MagneticsCalculations, + post1.path_operations.PathOperations, + post1.results.Results, + post1.set_up.SetUp, + post1.special_purpose.SpecialPurpose, + post1.status.Status, + post1.surface_operations.SurfaceOperations, + post1.trace_points.TracePoints, ): pass class Post26Commands( - post26_.controls.Controls, - post26_.display.Display, - post26_.listing.Listing, - post26_.operations.Operations, - post26_.setup.Setup, - post26_.special.Special, - post26_.status.Status, -): - pass - - -class ReducedCommands( - reduced.generation.Generation, - reduced.preparation.Preparation, - reduced.setup.Setup, - reduced.use_pass.UsePass, + post26._set_up.SetUp, + post26.controls.Controls, + post26.display.Display, + post26.listing.Listing, + post26.operations.Operations, + post26.set_up.SetUp, + post26.special_purpose.SpecialPurpose, + post26.status.Status, ): pass @@ -500,24 +508,22 @@ class InqFunctions(inq_func.inq_function): class Commands( - APDLCommands, + Apdl, Aux2Commands, + Aux3Commands, Aux12Commands, + Aux15Commands, DatabaseCommands, - DisplayCommands, GraphicsCommands, + MapCommands, MiscCommands, Post1Commands, Post26Commands, PreprocessorCommands, - ReducedCommands, SessionCommands, SolutionCommands, - aux3_.Aux3, - aux15_.Aux15, conn.Conn, hidden._Hidden, - map_cmd.MapCommand, InqFunctions, ): """Wrapped MAPDL commands""" diff --git a/src/ansys/mapdl/core/mapdl_core.py b/src/ansys/mapdl/core/mapdl_core.py index d79d24c79bd..73bf426c821 100644 --- a/src/ansys/mapdl/core/mapdl_core.py +++ b/src/ansys/mapdl/core/mapdl_core.py @@ -1621,7 +1621,6 @@ def open_apdl_log( """ if self._apdl_log is not None: raise MapdlRuntimeError("APDL command logging already enabled") - self._log.debug("Opening ANSYS log file at %s", filename) if mode not in ["w", "a", "x"]: diff --git a/src/ansys/mapdl/core/mapdl_grpc.py b/src/ansys/mapdl/core/mapdl_grpc.py index 92965f2b669..cdc6349559e 100644 --- a/src/ansys/mapdl/core/mapdl_grpc.py +++ b/src/ansys/mapdl/core/mapdl_grpc.py @@ -963,8 +963,10 @@ def _launch(self, start_parm, timeout=10): @supress_logging def _set_no_abort(self): """Do not abort MAPDL.""" - self._log.debug("Setting no abort") - self.nerr(abort=-1, mute=True) + self._log.debug("Setting to no abort") + self.run( + "/NERR,,,-1", mute=True + ) # ABORT argument is not surfaced in PyMAPDL because it is not documented in the manual def _run_at_connect(self): """Run house-keeping commands when initially connecting to MAPDL.""" @@ -1793,7 +1795,7 @@ def input( ext : str, optional Filename extension (eight-character maximum). - dir : str, optional + dir_ : str, optional Directory path. The default is the current working directory. line : int, optional diff --git a/src/ansys/mapdl/core/plotting/__init__.py b/src/ansys/mapdl/core/plotting/__init__.py index ae2fb594029..39fb194d051 100644 --- a/src/ansys/mapdl/core/plotting/__init__.py +++ b/src/ansys/mapdl/core/plotting/__init__.py @@ -23,8 +23,7 @@ from enum import Enum from ansys.mapdl.core import _HAS_VISUALIZER -from ansys.mapdl.core.plotting.consts import ( # noqa: F401 - ALLOWED_TARGETS, +from ansys.mapdl.core.plotting.consts import ( BC_D, BC_F, BCS, @@ -32,6 +31,7 @@ FIELDS_ORDERED_LABELS, POINT_SIZE, ) +from ansys.mapdl.core.plotting.consts import ALLOWED_TARGETS # noqa: F401 class GraphicsBackend(Enum): diff --git a/tests/test_krylov.py b/tests/test_krylov.py index 898d7a21447..64fd290ba73 100644 --- a/tests/test_krylov.py +++ b/tests/test_krylov.py @@ -38,7 +38,7 @@ PATH = os.path.dirname(os.path.abspath(__file__)) -# Krylov Apdl Macro Files +# Krylov APDL Macro Files lib_path = os.path.join(PATH, "test_files") # Results from APDL Macro to compare with PyMAPDL results