Skip to content

Commit a1fb859

Browse files
authored
Merge branch 'master' into maint/update-contributors-file
2 parents bd146f4 + 6a59b5a commit a1fb859

File tree

104 files changed

+6196
-462
lines changed

Some content is hidden

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

104 files changed

+6196
-462
lines changed

doc/source/_static/dpf_operators.html

Lines changed: 5675 additions & 126 deletions
Large diffs are not rendered by default.

doc/source/conf.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -252,6 +252,7 @@ def reset_servers(gallery_conf, fname, when):
252252
"own_page_level": "class",
253253
"type": "python",
254254
"options": [
255+
"inherited-members",
255256
"members",
256257
"undoc-members",
257258
"show-inheritance",

examples/00-basic/02-basic_field_containers.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@
101101
min_max_op = dpf.operators.min_max.min_max(field)
102102
print(min_max_op.outputs.field_max().data)
103103

104-
# Out of conveience, you can simply take the max of the field with:
104+
# Out of convenience, you can simply take the max of the field with:
105105
print(field.max().data)
106106

107107
# The above yields a result identical to:

examples/05-file-IO/02-hdf5_serialize_and_read.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,7 @@
115115
h5_stream_prov_op = dpf.operators.metadata.streams_provider()
116116
h5_stream_prov_op.inputs.data_sources.connect(h5_all_times_ds)
117117
res_deser_all_times_list = []
118-
h5_read_op = dpf.operators.result.custom()
118+
h5_read_op = dpf.operators.result.result_provider()
119119
h5_read_op.inputs.streams_container.connect(h5_stream_prov_op.outputs)
120120
h5_read_op.inputs.time_scoping.connect(dpf.Scoping(ids=list(range(1, 54)), location="time"))
121121
for i, res_name in enumerate(result_names_on_all_time_steps):
@@ -134,7 +134,7 @@
134134
h5_stream_prov_op_2 = dpf.operators.metadata.streams_provider()
135135
h5_stream_prov_op_2.inputs.data_sources.connect(h5_set_per_set_ds)
136136
res_deser_set_per_set_list = []
137-
h5_read_op_2 = dpf.operators.result.custom()
137+
h5_read_op_2 = dpf.operators.result.result_provider()
138138
h5_read_op_2.inputs.streams_container.connect(h5_stream_prov_op_2.outputs)
139139
for i, res_name in enumerate(result_names_time_per_time):
140140
h5_read_op_2.inputs.result_name.connect(res_name)

requirements/requirements_docs.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
ansys-sphinx-theme[autoapi]==1.3.2
2-
enum-tools[sphinx]==0.12.0
2+
enum-tools[sphinx]==0.13.0
33
graphviz==0.20.1
44
imageio==2.37.0
55
imageio-ffmpeg==0.6.0
@@ -11,7 +11,7 @@ sphinx-copybutton==0.5.2
1111
sphinx-gallery==0.19.0
1212
sphinx-jinja==2.0.2
1313
sphinx-notfound-page==1.1.0
14-
sphinx-reredirects==0.1.3
14+
sphinx-reredirects==0.1.6
1515
sphinx_design==0.6.1
1616
sphinxcontrib-napoleon==0.7
1717
vtk==9.3.1

src/ansys/dpf/core/operators/build.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@
2222
"support_provider_cyclic": "mapdl::rst::support_provider_cyclic",
2323
"NMISC": "mapdl::nmisc",
2424
"SMISC": "mapdl::smisc",
25+
"result_provider": "custom",
2526
}
2627

2728
def build_docstring(specification_description):

src/ansys/dpf/core/operators/mesh/skin.py

Lines changed: 41 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,8 @@ class skin(Operator):
2727
Nodal scoping to restrict the skin extraction to a set of nodes. If provided, a skin element is added to the skin mesh if all its nodes are in the scoping.
2828
duplicate_shell: bool, optional
2929
If input mesh contains shell elements, output mesh shell elements (boolean = 1) are duplicated, one per each orientation, or (boolean = 0) remain unchanged.
30-
add_beam: bool, optional
31-
If input mesh contains beam elements, output mesh beam elements (boolean = 1) are added or (boolean = 0) are ignored.
30+
add_beam_point: bool, optional
31+
If input mesh contains beam or point elements, output mesh beam point elements (boolean = 1) are added or (boolean = 0) are ignored. Default: False
3232
3333
Returns
3434
-------
@@ -55,15 +55,15 @@ class skin(Operator):
5555
>>> op.inputs.mesh_scoping.connect(my_mesh_scoping)
5656
>>> my_duplicate_shell = bool()
5757
>>> op.inputs.duplicate_shell.connect(my_duplicate_shell)
58-
>>> my_add_beam = bool()
59-
>>> op.inputs.add_beam.connect(my_add_beam)
58+
>>> my_add_beam_point = bool()
59+
>>> op.inputs.add_beam_point.connect(my_add_beam_point)
6060
6161
>>> # Instantiate operator and connect inputs in one line
6262
>>> op = dpf.operators.mesh.skin(
6363
... mesh=my_mesh,
6464
... mesh_scoping=my_mesh_scoping,
6565
... duplicate_shell=my_duplicate_shell,
66-
... add_beam=my_add_beam,
66+
... add_beam_point=my_add_beam_point,
6767
... )
6868
6969
>>> # Get output data
@@ -79,9 +79,10 @@ def __init__(
7979
mesh=None,
8080
mesh_scoping=None,
8181
duplicate_shell=None,
82-
add_beam=None,
82+
add_beam_point=None,
8383
config=None,
8484
server=None,
85+
add_beam=None,
8586
):
8687
super().__init__(name="meshed_skin_sector", config=config, server=server)
8788
self._inputs = InputsSkin(self)
@@ -92,8 +93,15 @@ def __init__(
9293
self.inputs.mesh_scoping.connect(mesh_scoping)
9394
if duplicate_shell is not None:
9495
self.inputs.duplicate_shell.connect(duplicate_shell)
95-
if add_beam is not None:
96-
self.inputs.add_beam.connect(add_beam)
96+
if add_beam_point is not None:
97+
self.inputs.add_beam_point.connect(add_beam_point)
98+
elif add_beam is not None:
99+
warn(
100+
DeprecationWarning(
101+
f'Operator skin: Input name "add_beam" is deprecated in favor of "add_beam_point".'
102+
)
103+
)
104+
self.inputs.add_beam_point.connect(add_beam)
97105

98106
@staticmethod
99107
def _spec() -> Specification:
@@ -122,10 +130,11 @@ def _spec() -> Specification:
122130
document=r"""If input mesh contains shell elements, output mesh shell elements (boolean = 1) are duplicated, one per each orientation, or (boolean = 0) remain unchanged.""",
123131
),
124132
3: PinSpecification(
125-
name="add_beam",
133+
name="add_beam_point",
126134
type_names=["bool"],
127135
optional=True,
128-
document=r"""If input mesh contains beam elements, output mesh beam elements (boolean = 1) are added or (boolean = 0) are ignored.""",
136+
document=r"""If input mesh contains beam or point elements, output mesh beam point elements (boolean = 1) are added or (boolean = 0) are ignored. Default: False""",
137+
aliases=["add_beam"],
129138
),
130139
},
131140
map_output_pin_spec={
@@ -221,8 +230,8 @@ class InputsSkin(_Inputs):
221230
>>> op.inputs.mesh_scoping.connect(my_mesh_scoping)
222231
>>> my_duplicate_shell = bool()
223232
>>> op.inputs.duplicate_shell.connect(my_duplicate_shell)
224-
>>> my_add_beam = bool()
225-
>>> op.inputs.add_beam.connect(my_add_beam)
233+
>>> my_add_beam_point = bool()
234+
>>> op.inputs.add_beam_point.connect(my_add_beam_point)
226235
"""
227236

228237
def __init__(self, op: Operator):
@@ -233,8 +242,8 @@ def __init__(self, op: Operator):
233242
self._inputs.append(self._mesh_scoping)
234243
self._duplicate_shell = Input(skin._spec().input_pin(2), 2, op, -1)
235244
self._inputs.append(self._duplicate_shell)
236-
self._add_beam = Input(skin._spec().input_pin(3), 3, op, -1)
237-
self._inputs.append(self._add_beam)
245+
self._add_beam_point = Input(skin._spec().input_pin(3), 3, op, -1)
246+
self._inputs.append(self._add_beam_point)
238247

239248
@property
240249
def mesh(self) -> Input:
@@ -298,10 +307,10 @@ def duplicate_shell(self) -> Input:
298307
return self._duplicate_shell
299308

300309
@property
301-
def add_beam(self) -> Input:
302-
r"""Allows to connect add_beam input to the operator.
310+
def add_beam_point(self) -> Input:
311+
r"""Allows to connect add_beam_point input to the operator.
303312
304-
If input mesh contains beam elements, output mesh beam elements (boolean = 1) are added or (boolean = 0) are ignored.
313+
If input mesh contains beam or point elements, output mesh beam point elements (boolean = 1) are added or (boolean = 0) are ignored. Default: False
305314
306315
Returns
307316
-------
@@ -312,11 +321,23 @@ def add_beam(self) -> Input:
312321
--------
313322
>>> from ansys.dpf import core as dpf
314323
>>> op = dpf.operators.mesh.skin()
315-
>>> op.inputs.add_beam.connect(my_add_beam)
324+
>>> op.inputs.add_beam_point.connect(my_add_beam_point)
316325
>>> # or
317-
>>> op.inputs.add_beam(my_add_beam)
326+
>>> op.inputs.add_beam_point(my_add_beam_point)
318327
"""
319-
return self._add_beam
328+
return self._add_beam_point
329+
330+
def __getattr__(self, name):
331+
if name in ["add_beam"]:
332+
warn(
333+
DeprecationWarning(
334+
f'Operator skin: Input name "{name}" is deprecated in favor of "add_beam_point".'
335+
)
336+
)
337+
return self.add_beam_point
338+
raise AttributeError(
339+
f"'{self.__class__.__name__}' object has no attribute '{name}'."
340+
)
320341

321342

322343
class OutputsSkin(_Outputs):

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,6 @@
5959
from .coordinates import coordinates
6060
from .creep_strain_energy_density import creep_strain_energy_density
6161
from .current_density import current_density
62-
from .custom import custom
6362
from .cyclic_analytic_seqv_max import cyclic_analytic_seqv_max
6463
from .cyclic_analytic_usum_max import cyclic_analytic_usum_max
6564
from .cyclic_expansion import cyclic_expansion
@@ -246,6 +245,7 @@
246245
from .recombine_harmonic_indeces_cyclic import recombine_harmonic_indeces_cyclic
247246
from .remove_rigid_body_motion import remove_rigid_body_motion
248247
from .remove_rigid_body_motion_fc import remove_rigid_body_motion_fc
248+
from .result_provider import result_provider
249249
from .rigid_transformation import rigid_transformation
250250
from .rigid_transformation_provider import rigid_transformation_provider
251251
from .rms_static_pressure import rms_static_pressure

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ class acceleration(Operator):
3333
data_sources: DataSources
3434
result file path container, used if no streams are set
3535
bool_rotate_to_global: bool, optional
36-
if true the field is rotated to global coordinate system (default true)
36+
if true the field is rotated to global coordinate system (default true). Please check your results carefully if 'false' is used for Elemental or ElementalNodal results averaged to the Nodes when adjacent elements do not share the same coordinate system, as results may be incorrect.
3737
mesh: MeshedRegion or MeshesContainer, optional
3838
mesh. If cylic expansion is to be done, mesh of the base sector
3939
read_cyclic: int, optional
@@ -190,7 +190,7 @@ def _spec() -> Specification:
190190
name="bool_rotate_to_global",
191191
type_names=["bool"],
192192
optional=True,
193-
document=r"""if true the field is rotated to global coordinate system (default true)""",
193+
document=r"""if true the field is rotated to global coordinate system (default true). Please check your results carefully if 'false' is used for Elemental or ElementalNodal results averaged to the Nodes when adjacent elements do not share the same coordinate system, as results may be incorrect.""",
194194
),
195195
7: PinSpecification(
196196
name="mesh",
@@ -448,7 +448,7 @@ def data_sources(self) -> Input:
448448
def bool_rotate_to_global(self) -> Input:
449449
r"""Allows to connect bool_rotate_to_global input to the operator.
450450
451-
if true the field is rotated to global coordinate system (default true)
451+
if true the field is rotated to global coordinate system (default true). Please check your results carefully if 'false' is used for Elemental or ElementalNodal results averaged to the Nodes when adjacent elements do not share the same coordinate system, as results may be incorrect.
452452
453453
Returns
454454
-------

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ class accu_eqv_creep_strain(Operator):
3535
data_sources: DataSources
3636
result file path container, used if no streams are set
3737
bool_rotate_to_global: bool, optional
38-
if true the field is rotated to global coordinate system (default true)
38+
if true the field is rotated to global coordinate system (default true). Please check your results carefully if 'false' is used for Elemental or ElementalNodal results averaged to the Nodes when adjacent elements do not share the same coordinate system, as results may be incorrect.
3939
mesh: MeshedRegion or MeshesContainer, optional
4040
prevents from reading the mesh in the result files
4141
requested_location: str, optional
@@ -194,7 +194,7 @@ def _spec() -> Specification:
194194
name="bool_rotate_to_global",
195195
type_names=["bool"],
196196
optional=True,
197-
document=r"""if true the field is rotated to global coordinate system (default true)""",
197+
document=r"""if true the field is rotated to global coordinate system (default true). Please check your results carefully if 'false' is used for Elemental or ElementalNodal results averaged to the Nodes when adjacent elements do not share the same coordinate system, as results may be incorrect.""",
198198
),
199199
7: PinSpecification(
200200
name="mesh",
@@ -468,7 +468,7 @@ def data_sources(self) -> Input:
468468
def bool_rotate_to_global(self) -> Input:
469469
r"""Allows to connect bool_rotate_to_global input to the operator.
470470
471-
if true the field is rotated to global coordinate system (default true)
471+
if true the field is rotated to global coordinate system (default true). Please check your results carefully if 'false' is used for Elemental or ElementalNodal results averaged to the Nodes when adjacent elements do not share the same coordinate system, as results may be incorrect.
472472
473473
Returns
474474
-------

0 commit comments

Comments
 (0)