Skip to content

Commit 70b13a9

Browse files
moe-adpyansys-ci-botPProfizi
authored
feat: expose PropertyFieldsContainer class properly (#2816)
Co-authored-by: PyAnsys CI Bot <[email protected]> Co-authored-by: Paul Profizi <[email protected]>
1 parent ad5fe42 commit 70b13a9

15 files changed

+241
-281
lines changed

doc/source/conf.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,6 @@
104104
"*/gate/*",
105105
"*/gatebin/*",
106106
"*/grpc/*",
107-
"*/property_fields_container.py"
108107
]
109108

110109
# -- General configuration ---------------------------------------------------

src/ansys/dpf/core/__init__.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@
3939
from ansys.dpf.core.custom_type_field import CustomTypeField # noqa: F401
4040
from ansys.dpf.core.dimensionality import Dimensionality
4141
from ansys.dpf.core.property_field import PropertyField
42+
from ansys.dpf.core.property_fields_container import PropertyFieldsContainer # noqa: F401
4243
from ansys.dpf.core.string_field import StringField
4344
from ansys.dpf.core.fields_container import FieldsContainer
4445
from ansys.dpf.core.meshes_container import MeshesContainer

src/ansys/dpf/core/mapping_types.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,9 @@
6161
map_types_to_cpp["float"] = "double"
6262
map_types_to_cpp["UnitSystem"] = "class dataProcessing::unit::CUnitSystem"
6363
map_types_to_cpp["dict"] = "label_space"
64+
map_types_to_cpp["PropertyFieldsContainer"] = (
65+
"class dataProcessing::DpfTypeCollection<class dataProcessing::CPropertyField>"
66+
)
6467

6568

6669
class _smart_dict_snake(dict):

src/ansys/dpf/core/operators/averaging/elemental_nodal_to_nodal_fc.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919
from ansys.dpf.core.fields_container import FieldsContainer
2020
from ansys.dpf.core.meshed_region import MeshedRegion
2121
from ansys.dpf.core.meshes_container import MeshesContainer
22+
from ansys.dpf.core.property_fields_container import PropertyFieldsContainer
2223
from ansys.dpf.core.scoping import Scoping
2324
from ansys.dpf.core.scopings_container import ScopingsContainer
2425

@@ -52,8 +53,7 @@ class elemental_nodal_to_nodal_fc(Operator):
5253
Outputs
5354
-------
5455
fields_container: FieldsContainer
55-
weights: Class Dataprocessing::Dpftypecollection&lt;Class
56-
Dataprocessing::Cpropertyfield&gt;
56+
weights: PropertyFieldsContainer
5757
Gives for each node, the number of times it was found in the Elemental Nodal field. Can be used to average later.
5858
5959
Examples
@@ -507,7 +507,7 @@ def __init__(self, op: Operator):
507507
elemental_nodal_to_nodal_fc._spec().output_pin(0), 0, op
508508
)
509509
self._outputs.append(self._fields_container)
510-
self._weights: Output = Output(
510+
self._weights: Output[PropertyFieldsContainer] = Output(
511511
elemental_nodal_to_nodal_fc._spec().output_pin(1), 1, op
512512
)
513513
self._outputs.append(self._weights)
@@ -531,7 +531,7 @@ def fields_container(self) -> Output[FieldsContainer]:
531531
return self._fields_container
532532

533533
@property
534-
def weights(self) -> Output:
534+
def weights(self) -> Output[PropertyFieldsContainer]:
535535
r"""Allows to get weights output of the operator
536536
537537
Gives for each node, the number of times it was found in the Elemental Nodal field. Can be used to average later.

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

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,6 @@
4343
"MeshSelectionManager",
4444
"Class Dataprocessing::Dpftypecollection<Class Dataprocessing::Cpropertyfield>",
4545
"Struct Iansdispatch",
46-
"PropertyFieldsContainer",
4746
"Class Dataprocessing::Crstfilewrapper",
4847
"Char",
4948
)

src/ansys/dpf/core/operators/logic/enrich_materials.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717

1818
if TYPE_CHECKING:
1919
from ansys.dpf.core.fields_container import FieldsContainer
20+
from ansys.dpf.core.property_fields_container import PropertyFieldsContainer
2021
from ansys.dpf.core.streams_container import StreamsContainer
2122

2223

@@ -191,7 +192,7 @@ def __init__(self, op: Operator):
191192
enrich_materials._spec().input_pin(1), 1, op, -1
192193
)
193194
self._inputs.append(self._streams)
194-
self._streams_mapping: Input = Input(
195+
self._streams_mapping: Input[PropertyFieldsContainer] = Input(
195196
enrich_materials._spec().input_pin(2), 2, op, -1
196197
)
197198
self._inputs.append(self._streams_mapping)
@@ -235,7 +236,7 @@ def streams(self) -> Input[StreamsContainer | FieldsContainer]:
235236
return self._streams
236237

237238
@property
238-
def streams_mapping(self) -> Input:
239+
def streams_mapping(self) -> Input[PropertyFieldsContainer]:
239240
r"""Allows to connect streams_mapping input to the operator.
240241
241242
Returns

src/ansys/dpf/core/operators/logic/identical_pfc.py

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
"""
66

77
from __future__ import annotations
8+
from typing import TYPE_CHECKING
89

910
from warnings import warn
1011
from ansys.dpf.core.dpf_operator import Operator
@@ -14,6 +15,9 @@
1415
from ansys.dpf.core.config import Config
1516
from ansys.dpf.core.server_types import AnyServerType
1617

18+
if TYPE_CHECKING:
19+
from ansys.dpf.core.property_fields_container import PropertyFieldsContainer
20+
1721

1822
class identical_pfc(Operator):
1923
r"""Checks if two property_fields_container are identical.
@@ -172,17 +176,17 @@ class InputsIdenticalPfc(_Inputs):
172176

173177
def __init__(self, op: Operator):
174178
super().__init__(identical_pfc._spec().inputs, op)
175-
self._property_fields_containerA: Input = Input(
179+
self._property_fields_containerA: Input[PropertyFieldsContainer] = Input(
176180
identical_pfc._spec().input_pin(0), 0, op, -1
177181
)
178182
self._inputs.append(self._property_fields_containerA)
179-
self._property_fields_containerB: Input = Input(
183+
self._property_fields_containerB: Input[PropertyFieldsContainer] = Input(
180184
identical_pfc._spec().input_pin(1), 1, op, -1
181185
)
182186
self._inputs.append(self._property_fields_containerB)
183187

184188
@property
185-
def property_fields_containerA(self) -> Input:
189+
def property_fields_containerA(self) -> Input[PropertyFieldsContainer]:
186190
r"""Allows to connect property_fields_containerA input to the operator.
187191
188192
Returns
@@ -201,7 +205,7 @@ def property_fields_containerA(self) -> Input:
201205
return self._property_fields_containerA
202206

203207
@property
204-
def property_fields_containerB(self) -> Input:
208+
def property_fields_containerB(self) -> Input[PropertyFieldsContainer]:
205209
r"""Allows to connect property_fields_containerB input to the operator.
206210
207211
Returns

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

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717

1818
if TYPE_CHECKING:
1919
from ansys.dpf.core.fields_container import FieldsContainer
20+
from ansys.dpf.core.property_fields_container import PropertyFieldsContainer
2021

2122

2223
class mapdl_split_to_acmo_facet_indices(Operator):
@@ -182,9 +183,9 @@ def __init__(self, op: Operator):
182183
mapdl_split_to_acmo_facet_indices._spec().input_pin(0), 0, op, -1
183184
)
184185
self._inputs.append(self._fields_container)
185-
self._property_fields_container_element_types: Input = Input(
186-
mapdl_split_to_acmo_facet_indices._spec().input_pin(1), 1, op, -1
187-
)
186+
self._property_fields_container_element_types: Input[
187+
PropertyFieldsContainer
188+
] = Input(mapdl_split_to_acmo_facet_indices._spec().input_pin(1), 1, op, -1)
188189
self._inputs.append(self._property_fields_container_element_types)
189190

190191
@property
@@ -209,7 +210,7 @@ def fields_container(self) -> Input[FieldsContainer]:
209210
return self._fields_container
210211

211212
@property
212-
def property_fields_container_element_types(self) -> Input:
213+
def property_fields_container_element_types(self) -> Input[PropertyFieldsContainer]:
213214
r"""Allows to connect property_fields_container_element_types input to the operator.
214215
215216
It should only have the 'facet' label. For each facet, it stores a PropertyField with the element types of the corresponding elements.The scoping should be the same as the scoping of the corresponding Field in input 0.

src/ansys/dpf/core/operators/scoping/rescope_property_field.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818

1919
if TYPE_CHECKING:
2020
from ansys.dpf.core.property_field import PropertyField
21+
from ansys.dpf.core.property_fields_container import PropertyFieldsContainer
2122
from ansys.dpf.core.scoping import Scoping
2223

2324

@@ -187,7 +188,7 @@ class InputsRescopePropertyField(_Inputs):
187188

188189
def __init__(self, op: Operator):
189190
super().__init__(rescope_property_field._spec().inputs, op)
190-
self._fields: Input[PropertyField] = Input(
191+
self._fields: Input[PropertyFieldsContainer | PropertyField] = Input(
191192
rescope_property_field._spec().input_pin(0), 0, op, -1
192193
)
193194
self._inputs.append(self._fields)
@@ -201,7 +202,7 @@ def __init__(self, op: Operator):
201202
self._inputs.append(self._default_value)
202203

203204
@property
204-
def fields(self) -> Input[PropertyField]:
205+
def fields(self) -> Input[PropertyFieldsContainer | PropertyField]:
205206
r"""Allows to connect fields input to the operator.
206207
207208
Returns

src/ansys/dpf/core/operators/utility/extract_scoping.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@
2323
from ansys.dpf.core.meshed_region import MeshedRegion
2424
from ansys.dpf.core.meshes_container import MeshesContainer
2525
from ansys.dpf.core.property_field import PropertyField
26+
from ansys.dpf.core.property_fields_container import PropertyFieldsContainer
2627
from ansys.dpf.core.scoping import Scoping
2728
from ansys.dpf.core.scopings_container import ScopingsContainer
2829
from ansys.dpf.core.string_field import StringField
@@ -196,6 +197,7 @@ def __init__(self, op: Operator):
196197
Field
197198
| FieldsContainer
198199
| PropertyField
200+
| PropertyFieldsContainer
199201
| CustomTypeField
200202
| StringField
201203
| Scoping
@@ -216,6 +218,7 @@ def field_or_fields_container(
216218
Field
217219
| FieldsContainer
218220
| PropertyField
221+
| PropertyFieldsContainer
219222
| CustomTypeField
220223
| StringField
221224
| Scoping

0 commit comments

Comments
 (0)