Skip to content

Commit 2129ac0

Browse files
authored
Merge branch 'master' into doc/new-tutorials-section
2 parents fb3b6d9 + 3eac5a9 commit 2129ac0

File tree

58 files changed

+344
-333
lines changed

Some content is hidden

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

58 files changed

+344
-333
lines changed

doc/source/_static/dpf_operators.html

Lines changed: 83 additions & 82 deletions
Large diffs are not rendered by default.

examples/06-plotting/00-basic_plotting.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@
3636

3737
# Plot the bare mesh of a model
3838
model = dpf.Model(examples.find_multishells_rst())
39+
print(model)
3940
model.plot(color="w", show_edges=True, title="Model", text="Model plot")
4041
# # Additional PyVista kwargs are supported, such as:
4142
model.plot(
@@ -55,6 +56,9 @@
5556

5657
# Plot a field on its supporting mesh
5758
stress = model.results.stress()
59+
# We request the stress as nodal to bypass a bug for DPF 2025 R1 and below
60+
# which prevents from plotting ElementalNodal data on shells
61+
stress.inputs.requested_location.connect(dpf.locations.nodal)
5862
fc = stress.outputs.fields_container()
5963
field = fc[0]
6064
field.plot(notebook=False, shell_layers=None, show_axes=True, title="Field", text="Field plot")

src/ansys/dpf/core/operators/metadata/real_constants_provider.py

Lines changed: 10 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -31,8 +31,7 @@ class real_constants_provider(Operator):
3131
3232
Returns
3333
-------
34-
real_constants1: Field
35-
real_constants2: Field
34+
real_constants: Field
3635
3736
Examples
3837
--------
@@ -57,8 +56,7 @@ class real_constants_provider(Operator):
5756
... )
5857
5958
>>> # Get output data
60-
>>> result_real_constants1 = op.outputs.real_constants1()
61-
>>> result_real_constants2 = op.outputs.real_constants2()
59+
>>> result_real_constants = op.outputs.real_constants()
6260
"""
6361

6462
def __init__(
@@ -108,13 +106,7 @@ def _spec() -> Specification:
108106
},
109107
map_output_pin_spec={
110108
0: PinSpecification(
111-
name="real_constants1",
112-
type_names=["field"],
113-
optional=False,
114-
document=r"""""",
115-
),
116-
1: PinSpecification(
117-
name="real_constants2",
109+
name="real_constants",
118110
type_names=["field"],
119111
optional=False,
120112
document=r"""""",
@@ -269,42 +261,19 @@ class OutputsRealConstantsProvider(_Outputs):
269261
>>> from ansys.dpf import core as dpf
270262
>>> op = dpf.operators.metadata.real_constants_provider()
271263
>>> # Connect inputs : op.inputs. ...
272-
>>> result_real_constants1 = op.outputs.real_constants1()
273-
>>> result_real_constants2 = op.outputs.real_constants2()
264+
>>> result_real_constants = op.outputs.real_constants()
274265
"""
275266

276267
def __init__(self, op: Operator):
277268
super().__init__(real_constants_provider._spec().outputs, op)
278-
self._real_constants1 = Output(
269+
self._real_constants = Output(
279270
real_constants_provider._spec().output_pin(0), 0, op
280271
)
281-
self._outputs.append(self._real_constants1)
282-
self._real_constants2 = Output(
283-
real_constants_provider._spec().output_pin(1), 1, op
284-
)
285-
self._outputs.append(self._real_constants2)
286-
287-
@property
288-
def real_constants1(self) -> Output:
289-
r"""Allows to get real_constants1 output of the operator
290-
291-
Returns
292-
-------
293-
output:
294-
An Output instance for this pin.
295-
296-
Examples
297-
--------
298-
>>> from ansys.dpf import core as dpf
299-
>>> op = dpf.operators.metadata.real_constants_provider()
300-
>>> # Get the output from op.outputs. ...
301-
>>> result_real_constants1 = op.outputs.real_constants1()
302-
"""
303-
return self._real_constants1
272+
self._outputs.append(self._real_constants)
304273

305274
@property
306-
def real_constants2(self) -> Output:
307-
r"""Allows to get real_constants2 output of the operator
275+
def real_constants(self) -> Output:
276+
r"""Allows to get real_constants output of the operator
308277
309278
Returns
310279
-------
@@ -316,6 +285,6 @@ def real_constants2(self) -> Output:
316285
>>> from ansys.dpf import core as dpf
317286
>>> op = dpf.operators.metadata.real_constants_provider()
318287
>>> # Get the output from op.outputs. ...
319-
>>> result_real_constants2 = op.outputs.real_constants2()
288+
>>> result_real_constants = op.outputs.real_constants()
320289
"""
321-
return self._real_constants2
290+
return self._real_constants

src/ansys/dpf/core/operators/result/beam_axial_force.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616

1717

1818
class beam_axial_force(Operator):
19-
r"""Read Beam Axial Force (LSDyna) by calling the readers defined by the
19+
r"""Read Beam X Axial Force by calling the readers defined by the
2020
datasources.
2121
2222
@@ -31,7 +31,7 @@ class beam_axial_force(Operator):
3131
data_sources: DataSources
3232
result file path container, used if no streams are set
3333
unit_system: int or str or UnitSystem, optional
34-
Unit System ID (int), semicolon-separated list of base unit strings (str) or UnitSystem instance
34+
(LSDyna) Unit System ID (int), semicolon-separated list of base unit strings (str) or UnitSystem instance
3535
3636
Returns
3737
-------
@@ -95,7 +95,7 @@ def __init__(
9595

9696
@staticmethod
9797
def _spec() -> Specification:
98-
description = r"""Read Beam Axial Force (LSDyna) by calling the readers defined by the
98+
description = r"""Read Beam X Axial Force by calling the readers defined by the
9999
datasources.
100100
"""
101101
spec = Specification(
@@ -140,7 +140,7 @@ def _spec() -> Specification:
140140
"class dataProcessing::unit::CUnitSystem",
141141
],
142142
optional=True,
143-
document=r"""Unit System ID (int), semicolon-separated list of base unit strings (str) or UnitSystem instance""",
143+
document=r"""(LSDyna) Unit System ID (int), semicolon-separated list of base unit strings (str) or UnitSystem instance""",
144144
),
145145
},
146146
map_output_pin_spec={
@@ -321,7 +321,7 @@ def data_sources(self) -> Input:
321321
def unit_system(self) -> Input:
322322
r"""Allows to connect unit_system input to the operator.
323323
324-
Unit System ID (int), semicolon-separated list of base unit strings (str) or UnitSystem instance
324+
(LSDyna) Unit System ID (int), semicolon-separated list of base unit strings (str) or UnitSystem instance
325325
326326
Returns
327327
-------

src/ansys/dpf/core/operators/result/beam_axial_plastic_strain.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ class beam_axial_plastic_strain(Operator):
3333
integration_point: int, optional
3434
integration point where the result will be read from. Default value: 0 (first integration point).
3535
unit_system: int or str or UnitSystem, optional
36-
Unit System ID (int), semicolon-separated list of base unit strings (str) or UnitSystem instance
36+
(LSDyna) Unit System ID (int), semicolon-separated list of base unit strings (str) or UnitSystem instance
3737
3838
Returns
3939
-------
@@ -154,7 +154,7 @@ def _spec() -> Specification:
154154
"class dataProcessing::unit::CUnitSystem",
155155
],
156156
optional=True,
157-
document=r"""Unit System ID (int), semicolon-separated list of base unit strings (str) or UnitSystem instance""",
157+
document=r"""(LSDyna) Unit System ID (int), semicolon-separated list of base unit strings (str) or UnitSystem instance""",
158158
),
159159
},
160160
map_output_pin_spec={
@@ -370,7 +370,7 @@ def integration_point(self) -> Input:
370370
def unit_system(self) -> Input:
371371
r"""Allows to connect unit_system input to the operator.
372372
373-
Unit System ID (int), semicolon-separated list of base unit strings (str) or UnitSystem instance
373+
(LSDyna) Unit System ID (int), semicolon-separated list of base unit strings (str) or UnitSystem instance
374374
375375
Returns
376376
-------

src/ansys/dpf/core/operators/result/beam_axial_stress.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616

1717

1818
class beam_axial_stress(Operator):
19-
r"""Read Beam Axial Stress (LSDyna) by calling the readers defined by the
19+
r"""Read Beam X Axial Stress by calling the readers defined by the
2020
datasources.
2121
2222
@@ -33,7 +33,7 @@ class beam_axial_stress(Operator):
3333
integration_point: int, optional
3434
integration point where the result will be read from. Default value: 0 (first integration point).
3535
unit_system: int or str or UnitSystem, optional
36-
Unit System ID (int), semicolon-separated list of base unit strings (str) or UnitSystem instance
36+
(LSDyna) Unit System ID (int), semicolon-separated list of base unit strings (str) or UnitSystem instance
3737
3838
Returns
3939
-------
@@ -103,7 +103,7 @@ def __init__(
103103

104104
@staticmethod
105105
def _spec() -> Specification:
106-
description = r"""Read Beam Axial Stress (LSDyna) by calling the readers defined by the
106+
description = r"""Read Beam X Axial Stress by calling the readers defined by the
107107
datasources.
108108
"""
109109
spec = Specification(
@@ -154,7 +154,7 @@ def _spec() -> Specification:
154154
"class dataProcessing::unit::CUnitSystem",
155155
],
156156
optional=True,
157-
document=r"""Unit System ID (int), semicolon-separated list of base unit strings (str) or UnitSystem instance""",
157+
document=r"""(LSDyna) Unit System ID (int), semicolon-separated list of base unit strings (str) or UnitSystem instance""",
158158
),
159159
},
160160
map_output_pin_spec={
@@ -362,7 +362,7 @@ def integration_point(self) -> Input:
362362
def unit_system(self) -> Input:
363363
r"""Allows to connect unit_system input to the operator.
364364
365-
Unit System ID (int), semicolon-separated list of base unit strings (str) or UnitSystem instance
365+
(LSDyna) Unit System ID (int), semicolon-separated list of base unit strings (str) or UnitSystem instance
366366
367367
Returns
368368
-------

src/ansys/dpf/core/operators/result/beam_axial_total_strain.py

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,8 @@
1616

1717

1818
class beam_axial_total_strain(Operator):
19-
r"""Read Beam Axial Total strain (LSDyna) by calling the readers defined by
20-
the datasources.
19+
r"""Read Beam X Axial Total strain by calling the readers defined by the
20+
datasources.
2121
2222
2323
Parameters
@@ -33,7 +33,7 @@ class beam_axial_total_strain(Operator):
3333
integration_point: int, optional
3434
integration point where the result will be read from. Default value: 0 (first integration point).
3535
unit_system: int or str or UnitSystem, optional
36-
Unit System ID (int), semicolon-separated list of base unit strings (str) or UnitSystem instance
36+
(LSDyna) Unit System ID (int), semicolon-separated list of base unit strings (str) or UnitSystem instance
3737
3838
Returns
3939
-------
@@ -103,8 +103,8 @@ def __init__(
103103

104104
@staticmethod
105105
def _spec() -> Specification:
106-
description = r"""Read Beam Axial Total strain (LSDyna) by calling the readers defined by
107-
the datasources.
106+
description = r"""Read Beam X Axial Total strain by calling the readers defined by the
107+
datasources.
108108
"""
109109
spec = Specification(
110110
description=description,
@@ -154,7 +154,7 @@ def _spec() -> Specification:
154154
"class dataProcessing::unit::CUnitSystem",
155155
],
156156
optional=True,
157-
document=r"""Unit System ID (int), semicolon-separated list of base unit strings (str) or UnitSystem instance""",
157+
document=r"""(LSDyna) Unit System ID (int), semicolon-separated list of base unit strings (str) or UnitSystem instance""",
158158
),
159159
},
160160
map_output_pin_spec={
@@ -370,7 +370,7 @@ def integration_point(self) -> Input:
370370
def unit_system(self) -> Input:
371371
r"""Allows to connect unit_system input to the operator.
372372
373-
Unit System ID (int), semicolon-separated list of base unit strings (str) or UnitSystem instance
373+
(LSDyna) Unit System ID (int), semicolon-separated list of base unit strings (str) or UnitSystem instance
374374
375375
Returns
376376
-------

src/ansys/dpf/core/operators/result/beam_rs_shear_stress.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ class beam_rs_shear_stress(Operator):
3333
integration_point: int, optional
3434
integration point where the result will be read from. Default value: 0 (first integration point).
3535
unit_system: int or str or UnitSystem, optional
36-
Unit System ID (int), semicolon-separated list of base unit strings (str) or UnitSystem instance
36+
(LSDyna) Unit System ID (int), semicolon-separated list of base unit strings (str) or UnitSystem instance
3737
3838
Returns
3939
-------
@@ -154,7 +154,7 @@ def _spec() -> Specification:
154154
"class dataProcessing::unit::CUnitSystem",
155155
],
156156
optional=True,
157-
document=r"""Unit System ID (int), semicolon-separated list of base unit strings (str) or UnitSystem instance""",
157+
document=r"""(LSDyna) Unit System ID (int), semicolon-separated list of base unit strings (str) or UnitSystem instance""",
158158
),
159159
},
160160
map_output_pin_spec={
@@ -364,7 +364,7 @@ def integration_point(self) -> Input:
364364
def unit_system(self) -> Input:
365365
r"""Allows to connect unit_system input to the operator.
366366
367-
Unit System ID (int), semicolon-separated list of base unit strings (str) or UnitSystem instance
367+
(LSDyna) Unit System ID (int), semicolon-separated list of base unit strings (str) or UnitSystem instance
368368
369369
Returns
370370
-------

src/ansys/dpf/core/operators/result/beam_s_bending_moment.py

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,8 @@
1616

1717

1818
class beam_s_bending_moment(Operator):
19-
r"""Read Beam S Bending Moment (LSDyna) by calling the readers defined by
20-
the datasources.
19+
r"""Read Beam S/Y Bending Moment by calling the readers defined by the
20+
datasources.
2121
2222
2323
Parameters
@@ -31,7 +31,7 @@ class beam_s_bending_moment(Operator):
3131
data_sources: DataSources
3232
result file path container, used if no streams are set
3333
unit_system: int or str or UnitSystem, optional
34-
Unit System ID (int), semicolon-separated list of base unit strings (str) or UnitSystem instance
34+
(LSDyna) Unit System ID (int), semicolon-separated list of base unit strings (str) or UnitSystem instance
3535
3636
Returns
3737
-------
@@ -95,8 +95,8 @@ def __init__(
9595

9696
@staticmethod
9797
def _spec() -> Specification:
98-
description = r"""Read Beam S Bending Moment (LSDyna) by calling the readers defined by
99-
the datasources.
98+
description = r"""Read Beam S/Y Bending Moment by calling the readers defined by the
99+
datasources.
100100
"""
101101
spec = Specification(
102102
description=description,
@@ -140,7 +140,7 @@ def _spec() -> Specification:
140140
"class dataProcessing::unit::CUnitSystem",
141141
],
142142
optional=True,
143-
document=r"""Unit System ID (int), semicolon-separated list of base unit strings (str) or UnitSystem instance""",
143+
document=r"""(LSDyna) Unit System ID (int), semicolon-separated list of base unit strings (str) or UnitSystem instance""",
144144
),
145145
},
146146
map_output_pin_spec={
@@ -329,7 +329,7 @@ def data_sources(self) -> Input:
329329
def unit_system(self) -> Input:
330330
r"""Allows to connect unit_system input to the operator.
331331
332-
Unit System ID (int), semicolon-separated list of base unit strings (str) or UnitSystem instance
332+
(LSDyna) Unit System ID (int), semicolon-separated list of base unit strings (str) or UnitSystem instance
333333
334334
Returns
335335
-------

src/ansys/dpf/core/operators/result/beam_s_shear_force.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616

1717

1818
class beam_s_shear_force(Operator):
19-
r"""Read Beam S Shear Force (LSDyna) by calling the readers defined by the
19+
r"""Read Beam S/Y Shear Force by calling the readers defined by the
2020
datasources.
2121
2222
@@ -31,7 +31,7 @@ class beam_s_shear_force(Operator):
3131
data_sources: DataSources
3232
result file path container, used if no streams are set
3333
unit_system: int or str or UnitSystem, optional
34-
Unit System ID (int), semicolon-separated list of base unit strings (str) or UnitSystem instance
34+
(LSDyna) Unit System ID (int), semicolon-separated list of base unit strings (str) or UnitSystem instance
3535
3636
Returns
3737
-------
@@ -95,7 +95,7 @@ def __init__(
9595

9696
@staticmethod
9797
def _spec() -> Specification:
98-
description = r"""Read Beam S Shear Force (LSDyna) by calling the readers defined by the
98+
description = r"""Read Beam S/Y Shear Force by calling the readers defined by the
9999
datasources.
100100
"""
101101
spec = Specification(
@@ -140,7 +140,7 @@ def _spec() -> Specification:
140140
"class dataProcessing::unit::CUnitSystem",
141141
],
142142
optional=True,
143-
document=r"""Unit System ID (int), semicolon-separated list of base unit strings (str) or UnitSystem instance""",
143+
document=r"""(LSDyna) Unit System ID (int), semicolon-separated list of base unit strings (str) or UnitSystem instance""",
144144
),
145145
},
146146
map_output_pin_spec={
@@ -321,7 +321,7 @@ def data_sources(self) -> Input:
321321
def unit_system(self) -> Input:
322322
r"""Allows to connect unit_system input to the operator.
323323
324-
Unit System ID (int), semicolon-separated list of base unit strings (str) or UnitSystem instance
324+
(LSDyna) Unit System ID (int), semicolon-separated list of base unit strings (str) or UnitSystem instance
325325
326326
Returns
327327
-------

0 commit comments

Comments
 (0)