Skip to content

Commit cf413c5

Browse files
committed
Merge branch 'main' into release/0.60
2 parents 0eebf0c + fd53302 commit cf413c5

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

46 files changed

+3398
-204
lines changed

.github/workflows/nightly-doc-build.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
name: Nightly Documentation Build
22

33
on:
4-
pull_request:
54
schedule: # UTC at 0400
65
- cron: '0 4 * * *'
76
workflow_dispatch:

README.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ PyMAPDL
44
:target: https://pypi.org/project/ansys-mapdl-core/
55

66
.. image:: https://github.com/pyansys/pymapdl/actions/workflows/ci.yml/badge.svg
7-
:target: https://github.com/pyansys/pymapdl/actions/workflows/tci.yml
7+
:target: https://github.com/pyansys/pymapdl/actions/workflows/ci.yml
88

99
.. image:: https://zenodo.org/badge/70696039.svg
1010
:target: https://zenodo.org/badge/latestdoi/70696039
@@ -32,7 +32,7 @@ MAPDL and supports:
3232

3333
Here's a quick demo of PyMAPDL within VSCode:
3434

35-
.. image:: https://github.com/pyansys/pymapdl/raw/fix/auto_complete_vscode/doc/landing_page_demo.gif
35+
.. image:: https://github.com/pyansys/pymapdl/raw/main/doc/landing_page_demo.gif
3636

3737
PyMAPDL works within Jupyter Notebooks, the standard Python console,
3838
or in batch mode on Windows, Linux, and even Mac OS.

ansys/mapdl/core/_commands/database/selecting.py

Lines changed: 165 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -130,6 +130,43 @@ def asel(
130130
131131
STAT - Display the current select status.
132132
133+
134+
The following fields are used only with Type = S, R, A, or U:
135+
136+
Item
137+
Label identifying data. Valid item labels are shown in Table 105: ASEL - Valid Item and Component
138+
Labels (p. 185). Some items also require a component label. If Item = PICK (or simply "P"), graphical
139+
picking is enabled and all remaining command fields are ignored (valid only in the GUI). Defaults
140+
to AREA.
141+
142+
Comp
143+
Component of the item (if required). Valid component labels are shown in Table 105: ASEL - Valid
144+
Item and Component Labels (p. 185).
145+
146+
VMIN
147+
Minimum value of item range. Ranges are area numbers, coordinate values, attribute numbers, etc.,
148+
as appropriate for the item. A component name (as specified on the CM (p. 338) command) may
149+
also be substituted for VMIN (VMAX and VINC are ignored). If Item = MAT, TYPE, REAL, or ESYS
150+
and if VMIN is positive, the absolute value of Item is compared against the range for selection; if
151+
VMIN is negative, the signed value of Item is compared. See the ALIST (p. 106) command for a
152+
discussion of signed attributes.
153+
154+
VMAX
155+
Maximum value of item range. VMAX defaults to VMIN.
156+
157+
VINC
158+
Value increment within range. Used only with integer ranges (such as for area numbers). Defaults
159+
to 1. VINC cannot be negative.
160+
161+
KSWP
162+
Specifies whether only areas are to be selected:
163+
164+
- `kswp = 0` - Select areas only.
165+
- `kswp = 1` - Select areas, as well as keypoints, lines, nodes, and elements associated with selected areas.
166+
167+
Valid only with Type = S.
168+
169+
133170
Notes
134171
-----
135172
Selects a subset of areas. For example, to select those areas with area
@@ -597,6 +634,38 @@ def ksel(
597634
598635
STAT - Display the current select status.
599636
637+
638+
The following fields are used only with Type = S, R, A, or U:
639+
640+
Item
641+
Label identifying data. Valid item labels are shown in the table below. Some items also require a
642+
component label. If Item = PICK (or simply "P"), graphical picking is enabled and all remaining
643+
command fields are ignored (valid only in the GUI). Defaults to KP.
644+
645+
Comp
646+
Component of the item (if required). Valid component labels are shown in the table below.
647+
648+
VMIN
649+
Minimum value of item range. Ranges are keypoint numbers, coordinate values, attribute numbers,
650+
etc., as appropriate for the item. A component name (as specified on the CM (p. 338) command)
651+
may also be substituted for VMIN (VMAX and VINC are ignored). If Item = MAT, TYPE, REAL, or
652+
ESYS and if VMIN is positive, the absolute value of Item is compared against the range for selection;
653+
if VMIN is negative, the signed value of Item is compared. See the KLIST (p. 942) command for a
654+
discussion of signed attributes.
655+
656+
VMAX
657+
Maximum value of item range. VMAX defaults to VMIN.
658+
659+
VINC
660+
Value increment within range. Used only with integer ranges (such as for keypoint numbers). Defaults
661+
to 1. VINC cannot be negative.
662+
663+
KABS
664+
Absolute value key:
665+
666+
- `kabs = 0` - Check sign of value during selection.
667+
- `kabs = 1` - Use absolute value during selection (sign ignored).
668+
600669
Notes
601670
-----
602671
Selects a subset of keypoints or hard points. For example, to select a
@@ -727,6 +796,40 @@ def lsel(
727796
728797
STAT - Display the current select status.
729798
799+
800+
The following fields are used only with Type = S, R, A, or U:
801+
802+
Item
803+
Label identifying data. Valid item labels are shown in the table below. Some items also require a
804+
component label. If Item = PICK (or simply "P"), graphical picking is enabled and all remaining
805+
command fields are ignored (valid only in the GUI). Defaults to LINE.
806+
807+
Comp
808+
Component of the item (if required). Valid component labels are shown in the table below.
809+
810+
VMIN
811+
Minimum value of item range. Ranges are line numbers, coordinate values, attribute numbers, etc.,
812+
as appropriate for the item. If VMIN = 0.0, a tolerance of ±1.0E-6 is used, or ±0.005 x VMIN if VMIN
813+
= VMAX. A component name (as specified on the CM (p. 338) command) may also be substituted
814+
for VMIN (VMAX and VINC are ignored). If Item = MAT, TYPE, REAL, ESYS, or NDIV and if VMIN is
815+
positive, the absolute value of Item is compared against the range for selection; if VMIN is negative,
816+
the signed value of Item is compared. See the LLIST (p. 1011) command for a discussion of signed
817+
attributes.
818+
819+
VMAX
820+
Maximum value of item range. VMAX defaults to VMIN.
821+
822+
VINC
823+
Value increment within range. Used only with integer ranges (such as for line numbers). Defaults
824+
to 1. VINC cannot be negative.
825+
826+
KSWP
827+
Specifies whether only lines are to be selected:
828+
829+
- `kswp = 0` - Select lines only.
830+
- `kswp = 1` - Select lines, as well as keypoints, nodes, and elements associated with selected lines. Valid
831+
only with Type = S.
832+
730833
Notes
731834
-----
732835
Selects lines based on values of a labeled item and component. For
@@ -860,6 +963,36 @@ def nsel(
860963
861964
STAT - Display the current select status.
862965
966+
967+
The following fields are used only with Type = S, R, A, or U:
968+
969+
Item
970+
Label identifying data. Valid item labels are shown in the table below. Some items also require a
971+
component label. If Item = PICK (or simply "P"), graphical picking is enabled and all remaining
972+
command fields are ignored (valid only in the GUI). Defaults to NODE.
973+
974+
Comp
975+
Component of the item (if required). Valid component labels are shown in the table below.
976+
977+
VMIN
978+
Minimum value of item range. Ranges are node numbers, set numbers, coordinate values, load
979+
values, or result values as appropriate for the item. A component name (as specified on the CM (p. 338)
980+
command) may also be substituted for VMIN (VMAX and VINC are ignored).
981+
982+
VMAX
983+
Maximum value of item range. VMAX defaults to VMIN for input values. For result values, VMAX
984+
defaults to infinity if VMIN is positive, or to zero if VMIN is negative.
985+
986+
VINC
987+
Value increment within range. Used only with integer ranges (such as for node and set numbers).
988+
Defaults to 1. VINC cannot be negative.
989+
990+
KABS
991+
Absolute value key:
992+
993+
- `kabs = 0` - Check sign of value during selection.
994+
- `kabs = 1` - Use absolute value during selection (sign ignored)
995+
863996
Notes
864997
-----
865998
Selects a subset of nodes. For example, to select a new set of nodes
@@ -1268,6 +1401,38 @@ def vsel(
12681401
12691402
STAT - Display the current select status.
12701403
1404+
The following fields are used only with Type = S, R, A, or U:
1405+
1406+
Item
1407+
Label identifying data. Valid item labels are shown in the table below. Some items also require a
1408+
component label. If Item = PICK (or simply "P"), graphical picking is enabled and all remaining
1409+
command fields are ignored (valid only in the GUI). Defaults to VOLU.
1410+
1411+
Comp
1412+
Component of the item (if required). Valid component labels are shown in the table below.
1413+
1414+
VMIN
1415+
Minimum value of item range. Ranges are volume numbers, coordinate values, attribute numbers,
1416+
etc., as appropriate for the item. A component name (as specified on the CM (p. 338) command)
1417+
may also be substituted for VMIN (VMAX and VINC are ignored). If Item = MAT, TYPE, REAL, or
1418+
ESYS and if VMIN is positive, the absolute value of Item is compared against the range for selection;
1419+
if VMIN is negative, the signed value of Item is compared. See the VLIST (p. 2050) command for a
1420+
discussion of signed attributes.
1421+
1422+
VMAX
1423+
Maximum value of item range. VMAX defaults to VMIN.
1424+
1425+
VINC
1426+
Value increment within range. Used only with integer ranges (such as for volume numbers). Defaults
1427+
to 1. VINC cannot be negative.
1428+
1429+
KSWP
1430+
Specifies whether only volumes are to be selected:
1431+
1432+
- `kswp = 0` - Select volumes only.
1433+
- `kswp = 1` - Select volumes, as well as keypoints, lines, areas,
1434+
nodes, and elements associated with selected volumes. Valid only with Type = S.
1435+
12711436
Notes
12721437
-----
12731438
Selects volumes based on values of a labeled item and component. For

ansys/mapdl/core/_commands/parse.py

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -44,30 +44,34 @@ def parse_e(msg: Optional[str]) -> Optional[int]:
4444

4545

4646
def parse_kpoint(msg):
47+
"""Parse create keypoint message and return keypoint number."""
4748
if msg:
4849
res = re.search(r"kpoint=\s+(\d+)\s+", msg)
4950
if res is not None:
5051
return int(res.group(1))
5152

5253

5354
def parse_output_areas(msg):
54-
"""Parse create area message and return area number"""
55+
"""Parse create area message and return area number."""
5556
if msg:
5657
res = re.search(r"(OUTPUT AREAS =\s*)([0-9]+)", msg)
5758
if res is not None:
5859
return int(res.group(2))
60+
res = re.search(r"(OUTPUT AREA\(S\) =\s*)([0-9]+)", msg)
61+
if res is not None:
62+
return int(res.group(2))
5963

6064

6165
def parse_a(msg):
62-
"""Parse create area message and return area number"""
66+
"""Parse create area message and return area number."""
6367
if msg:
6468
res = re.search(r"(AREA NUMBER =\s*)([0-9]+)", msg)
6569
if res is not None:
6670
return int(res.group(2))
6771

6872

6973
def parse_line_no(msg):
70-
"""Parse create area message and return area number"""
74+
"""Parse create line message and return line number."""
7175
if msg:
7276
res = re.search(r"LINE NO[.]=\s+(\d+)", msg)
7377
if res is not None:

ansys/mapdl/core/_commands/post1_/element_table.py

Lines changed: 39 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -381,36 +381,57 @@ def pretab(
381381
lab9="",
382382
**kwargs,
383383
):
384-
"""Prints the element table items.
384+
"""Print the element table items.
385385
386386
APDL Command: PRETAB
387387
388388
Parameters
389389
----------
390-
lab1, lab2, lab3, . . . , lab9
391-
Print selected items. Valid labels are (blank) or any label as
392-
specified with the ETABLE command. Convenience labels may be used
393-
for Lab1 to select groups of labels (10 labels maximum): GRP1 for
394-
first 10 stored items; GRP2 for items 11 to 20; GRP3 for items 21
395-
to 30; GRP4 for items 31 to 40; GRP5 for items 41 to 50. Enter
396-
ETABLE,STAT command to list stored item order. If all labels are
390+
lab1, lab2, lab3, ... , lab9
391+
Print selected items. Valid labels are ``""`` or any
392+
label as specified with the ETABLE command. Convenience
393+
labels may be used for Lab1 to select groups of labels (10
394+
labels maximum): GRP1 for first 10 stored items; GRP2 for
395+
items 11 to 20; GRP3 for items 21 to 30; GRP4 for items 31
396+
to 40; GRP5 for items 41 to 50. Run ``etable("stat")``
397+
command to list stored item order. If all labels are
397398
blank, print first 10 stored items (GRP1).
398399
399400
Notes
400401
-----
401-
Prints the items stored in the table defined with the ETABLE command.
402-
Item values will be listed for the selected elements in the sorted
403-
sequence [ESORT]. The FORCE command can be used to define which
404-
component of the nodal load is to be used (static, damping, inertia,
405-
or total).
402+
Prints the items stored in the table defined with the
403+
:func:`etable() <ansys.mapdl.core.Mapdl.etable>` command.
404+
Item values will be listed for the selected elements in the
405+
sorted sequence [ESORT]. :func:`force()
406+
<ansys.mapdl.core.Mapdl.force>` can be used to define which
407+
component of the nodal load is to be used (static, damping,
408+
inertia, or total).
409+
410+
Examples
411+
--------
412+
Print out element displacement results.
413+
414+
>>> mapdl.etable("values", "U", "X")
415+
STORE VALUES FROM ITEM=U COMP=X FOR ALL SELECTED ELEMENTS
416+
417+
Now print out the table.
418+
419+
>>> mapdl.pretab().splitlines()[:4]
420+
['PRINT ELEMENT TABLE ITEMS PER ELEMENT',
421+
' 1 0.1073961540E-005 0.1073961540E-005',
422+
' 2 0.3156317304E-005 0.3156317304E-005',
423+
' 3 0.5125435148E-005 0.5125435148E-005']
424+
425+
Note that can access the array directly from APDL:
426+
427+
>>> mapdl.get_array("elem", 1, "ETAB", "values")
428+
array([1.07396154e-06, 3.15631730e-06, 5.12543515e-06, ...,
429+
5.41204700e-06, 3.33649806e-06, 1.13836132e-06])
406430
407-
Portions of this command are not supported by PowerGraphics
408-
[/GRAPHICS,POWER].
409431
"""
410-
command = (
411-
f"PRETAB,{lab1},{lab2},{lab3},{lab4},{lab5},{lab6},{lab7},{lab8},{lab9}"
432+
return self.run(
433+
f"PRETAB,{lab1},{lab2},{lab3},{lab4},{lab5},{lab6},{lab7},{lab8},{lab9}", **kwargs
412434
)
413-
return self.run(command, **kwargs)
414435

415436
def sabs(self, key="", **kwargs):
416437
"""Specifies absolute values for element table operations.

ansys/mapdl/core/_commands/preproc/booleans.py

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,9 +36,20 @@ def aadd(
3636
conditions assigned to the original entities will not be
3737
transferred to the new entities generated. Concatenated entities
3838
are not valid with this command.
39+
40+
Examples
41+
--------
42+
Generate two areas and combine them.
43+
44+
>>> a1 = mapdl.rectng(2.5, 3.5, 0, 10)
45+
>>> a2 = mapdl.cyl4(0, 10, 2.5, 0, 3.5, 90)
46+
>>> a_comb = mapdl.aadd(a1, a2)
47+
>>> a_comb
48+
3
49+
3950
"""
4051
command = f"AADD,{na1},{na2},{na3},{na4},{na5},{na6},{na7},{na8},{na9}"
41-
return self.run(command, **kwargs)
52+
return parse.parse_output_areas(self.run(command, **kwargs))
4253

4354
def aglue(
4455
self,

ansys/mapdl/core/_commands/preproc/volumes.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -862,10 +862,9 @@ def vrotat(
862862
nseg="",
863863
**kwargs,
864864
) -> str:
865-
"""Generate cylindrical volumes by rotating an area pattern about
865+
"""Generate cylindrical volumes by rotating an area pattern about an axis.
866866
867867
APDL Command: VROTAT
868-
an axis.
869868
870869
Generates cylindrical volumes (and their corresponding
871870
keypoints, lines, and areas) by rotating an area pattern (and

0 commit comments

Comments
 (0)