Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
27 commits
Select commit Hold shift + click to select a range
0999d90
feat: expose `PropertyFieldsContainer` class properly
moe-ad Dec 8, 2025
4305e7e
test: comment out new grpc method
moe-ad Dec 8, 2025
1cafee0
test: reorder
moe-ad Dec 8, 2025
5fe6649
feat: implement review suggestion and add tests
moe-ad Dec 8, 2025
2c738ed
feat: remove commented code
moe-ad Dec 8, 2025
24c0f02
fix: codestyle
moe-ad Dec 8, 2025
868f122
fix: doctest
moe-ad Dec 8, 2025
0a5c504
fix: test
moe-ad Dec 8, 2025
418e608
fix: test cases
moe-ad Dec 9, 2025
ad56e7d
fix: rename file
moe-ad Dec 9, 2025
4e0babd
Merge branch 'main' into feat/expose-property-fields-container
moe-ad Dec 9, 2025
e8f5e92
fix: rename file
moe-ad Dec 9, 2025
3d6801d
fix: add renamed test file
moe-ad Dec 9, 2025
8db86ef
fix: avoid circular import
moe-ad Dec 9, 2025
0164ad0
fix: codestyle
moe-ad Dec 9, 2025
9f1e1aa
Merge branch 'main' into feat/expose-property-fields-container
moe-ad Dec 9, 2025
e8226d7
feat: update code generation scripts
moe-ad Dec 10, 2025
24da8ec
feat: further updates to code generation scripts
moe-ad Dec 10, 2025
b36c921
test: skip tests for server versions < 8.1
moe-ad Dec 10, 2025
2195aa7
fix: codestyle
moe-ad Dec 10, 2025
6f3e2c0
feat: update code generation script
moe-ad Dec 10, 2025
82b63f0
fix: retain original operator name
moe-ad Dec 10, 2025
c06d363
fix: revert to property fields container
moe-ad Dec 10, 2025
e1da5d1
fix: final fix
moe-ad Dec 10, 2025
56bb467
fix: codestyle
moe-ad Dec 10, 2025
c68be03
Merge branch 'main' into feat/expose-property-fields-container
moe-ad Dec 10, 2025
063cbc6
Update generated code for DPF 261 on feat/expose-property-fields-cont…
pyansys-ci-bot Dec 11, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions src/ansys/dpf/core/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@
from ansys.dpf.core.custom_type_field import CustomTypeField # noqa: F401
from ansys.dpf.core.dimensionality import Dimensionality
from ansys.dpf.core.property_field import PropertyField
from ansys.dpf.core.property_fields_container import PropertyFieldsContainer
from ansys.dpf.core.string_field import StringField
from ansys.dpf.core.fields_container import FieldsContainer
from ansys.dpf.core.meshes_container import MeshesContainer
Expand Down
3 changes: 3 additions & 0 deletions src/ansys/dpf/core/mapping_types.py
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,9 @@
map_types_to_cpp["float"] = "double"
map_types_to_cpp["UnitSystem"] = "class dataProcessing::unit::CUnitSystem"
map_types_to_cpp["dict"] = "label_space"
map_types_to_cpp["PropertyFieldsContainer"] = (
"class dataProcessing::DpfTypeCollection<class dataProcessing::CPropertyField>"
)


class _smart_dict_snake(dict):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
from ansys.dpf.core.fields_container import FieldsContainer
from ansys.dpf.core.meshed_region import MeshedRegion
from ansys.dpf.core.meshes_container import MeshesContainer
from ansys.dpf.core.property_fields_container import PropertyFieldsContainer
from ansys.dpf.core.scoping import Scoping
from ansys.dpf.core.scopings_container import ScopingsContainer

Expand Down Expand Up @@ -52,8 +53,7 @@ class elemental_nodal_to_nodal_fc(Operator):
Outputs
-------
fields_container: FieldsContainer
weights: Class Dataprocessing::Dpftypecollection&lt;Class
Dataprocessing::Cpropertyfield&gt;
weights: PropertyFieldsContainer
Gives for each node, the number of times it was found in the Elemental Nodal field. Can be used to average later.

Examples
Expand Down Expand Up @@ -507,7 +507,7 @@ def __init__(self, op: Operator):
elemental_nodal_to_nodal_fc._spec().output_pin(0), 0, op
)
self._outputs.append(self._fields_container)
self._weights: Output = Output(
self._weights: Output[PropertyFieldsContainer] = Output(
elemental_nodal_to_nodal_fc._spec().output_pin(1), 1, op
)
self._outputs.append(self._weights)
Expand All @@ -531,7 +531,7 @@ def fields_container(self) -> Output[FieldsContainer]:
return self._fields_container

@property
def weights(self) -> Output:
def weights(self) -> Output[PropertyFieldsContainer]:
r"""Allows to get weights output of the operator

Gives for each node, the number of times it was found in the Elemental Nodal field. Can be used to average later.
Expand Down
1 change: 0 additions & 1 deletion src/ansys/dpf/core/operators/build.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,6 @@
"MeshSelectionManager",
"Class Dataprocessing::Dpftypecollection<Class Dataprocessing::Cpropertyfield>",
"Struct Iansdispatch",
"PropertyFieldsContainer",
"Class Dataprocessing::Crstfilewrapper",
"Char",
)
Expand Down
5 changes: 3 additions & 2 deletions src/ansys/dpf/core/operators/logic/enrich_materials.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@

if TYPE_CHECKING:
from ansys.dpf.core.fields_container import FieldsContainer
from ansys.dpf.core.property_fields_container import PropertyFieldsContainer
from ansys.dpf.core.streams_container import StreamsContainer


Expand Down Expand Up @@ -191,7 +192,7 @@ def __init__(self, op: Operator):
enrich_materials._spec().input_pin(1), 1, op, -1
)
self._inputs.append(self._streams)
self._streams_mapping: Input = Input(
self._streams_mapping: Input[PropertyFieldsContainer] = Input(
enrich_materials._spec().input_pin(2), 2, op, -1
)
self._inputs.append(self._streams_mapping)
Expand Down Expand Up @@ -235,7 +236,7 @@ def streams(self) -> Input[StreamsContainer | FieldsContainer]:
return self._streams

@property
def streams_mapping(self) -> Input:
def streams_mapping(self) -> Input[PropertyFieldsContainer]:
r"""Allows to connect streams_mapping input to the operator.

Returns
Expand Down
12 changes: 8 additions & 4 deletions src/ansys/dpf/core/operators/logic/identical_pfc.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
"""

from __future__ import annotations
from typing import TYPE_CHECKING

from warnings import warn
from ansys.dpf.core.dpf_operator import Operator
Expand All @@ -14,6 +15,9 @@
from ansys.dpf.core.config import Config
from ansys.dpf.core.server_types import AnyServerType

if TYPE_CHECKING:
from ansys.dpf.core.property_fields_container import PropertyFieldsContainer


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

def __init__(self, op: Operator):
super().__init__(identical_pfc._spec().inputs, op)
self._property_fields_containerA: Input = Input(
self._property_fields_containerA: Input[PropertyFieldsContainer] = Input(
identical_pfc._spec().input_pin(0), 0, op, -1
)
self._inputs.append(self._property_fields_containerA)
self._property_fields_containerB: Input = Input(
self._property_fields_containerB: Input[PropertyFieldsContainer] = Input(
identical_pfc._spec().input_pin(1), 1, op, -1
)
self._inputs.append(self._property_fields_containerB)

@property
def property_fields_containerA(self) -> Input:
def property_fields_containerA(self) -> Input[PropertyFieldsContainer]:
r"""Allows to connect property_fields_containerA input to the operator.

Returns
Expand All @@ -201,7 +205,7 @@ def property_fields_containerA(self) -> Input:
return self._property_fields_containerA

@property
def property_fields_containerB(self) -> Input:
def property_fields_containerB(self) -> Input[PropertyFieldsContainer]:
r"""Allows to connect property_fields_containerB input to the operator.

Returns
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@

if TYPE_CHECKING:
from ansys.dpf.core.fields_container import FieldsContainer
from ansys.dpf.core.property_fields_container import PropertyFieldsContainer


class mapdl_split_to_acmo_facet_indices(Operator):
Expand Down Expand Up @@ -182,9 +183,9 @@ def __init__(self, op: Operator):
mapdl_split_to_acmo_facet_indices._spec().input_pin(0), 0, op, -1
)
self._inputs.append(self._fields_container)
self._property_fields_container_element_types: Input = Input(
mapdl_split_to_acmo_facet_indices._spec().input_pin(1), 1, op, -1
)
self._property_fields_container_element_types: Input[
PropertyFieldsContainer
] = Input(mapdl_split_to_acmo_facet_indices._spec().input_pin(1), 1, op, -1)
self._inputs.append(self._property_fields_container_element_types)

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

@property
def property_fields_container_element_types(self) -> Input:
def property_fields_container_element_types(self) -> Input[PropertyFieldsContainer]:
r"""Allows to connect property_fields_container_element_types input to the operator.

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.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@

if TYPE_CHECKING:
from ansys.dpf.core.property_field import PropertyField
from ansys.dpf.core.property_fields_container import PropertyFieldsContainer
from ansys.dpf.core.scoping import Scoping


Expand Down Expand Up @@ -187,7 +188,7 @@ class InputsRescopePropertyField(_Inputs):

def __init__(self, op: Operator):
super().__init__(rescope_property_field._spec().inputs, op)
self._fields: Input[PropertyField] = Input(
self._fields: Input[PropertyFieldsContainer | PropertyField] = Input(
rescope_property_field._spec().input_pin(0), 0, op, -1
)
self._inputs.append(self._fields)
Expand All @@ -201,7 +202,7 @@ def __init__(self, op: Operator):
self._inputs.append(self._default_value)

@property
def fields(self) -> Input[PropertyField]:
def fields(self) -> Input[PropertyFieldsContainer | PropertyField]:
r"""Allows to connect fields input to the operator.

Returns
Expand Down
3 changes: 3 additions & 0 deletions src/ansys/dpf/core/operators/utility/extract_scoping.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
from ansys.dpf.core.meshed_region import MeshedRegion
from ansys.dpf.core.meshes_container import MeshesContainer
from ansys.dpf.core.property_field import PropertyField
from ansys.dpf.core.property_fields_container import PropertyFieldsContainer
from ansys.dpf.core.scoping import Scoping
from ansys.dpf.core.scopings_container import ScopingsContainer
from ansys.dpf.core.string_field import StringField
Expand Down Expand Up @@ -196,6 +197,7 @@ def __init__(self, op: Operator):
Field
| FieldsContainer
| PropertyField
| PropertyFieldsContainer
| CustomTypeField
| StringField
| Scoping
Expand All @@ -216,6 +218,7 @@ def field_or_fields_container(
Field
| FieldsContainer
| PropertyField
| PropertyFieldsContainer
| CustomTypeField
| StringField
| Scoping
Expand Down
9 changes: 5 additions & 4 deletions src/ansys/dpf/core/operators/utility/merge_property_fields.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@

if TYPE_CHECKING:
from ansys.dpf.core.property_field import PropertyField
from ansys.dpf.core.property_fields_container import PropertyFieldsContainer


class merge_property_fields(Operator):
Expand Down Expand Up @@ -187,11 +188,11 @@ def __init__(self, op: Operator):
merge_property_fields._spec().input_pin(-201), -201, op, -1
)
self._inputs.append(self._naive_merge)
self._property_fields1: Input[PropertyField] = Input(
self._property_fields1: Input[PropertyField | PropertyFieldsContainer] = Input(
merge_property_fields._spec().input_pin(0), 0, op, 0
)
self._inputs.append(self._property_fields1)
self._property_fields2: Input[PropertyField] = Input(
self._property_fields2: Input[PropertyField | PropertyFieldsContainer] = Input(
merge_property_fields._spec().input_pin(1), 1, op, 1
)
self._inputs.append(self._property_fields2)
Expand All @@ -218,7 +219,7 @@ def naive_merge(self) -> Input[bool]:
return self._naive_merge

@property
def property_fields1(self) -> Input[PropertyField]:
def property_fields1(self) -> Input[PropertyField | PropertyFieldsContainer]:
r"""Allows to connect property_fields1 input to the operator.

Either a property fields container, a vector of property fields to merge or property fields from pin 0 to ...
Expand All @@ -239,7 +240,7 @@ def property_fields1(self) -> Input[PropertyField]:
return self._property_fields1

@property
def property_fields2(self) -> Input[PropertyField]:
def property_fields2(self) -> Input[PropertyField | PropertyFieldsContainer]:
r"""Allows to connect property_fields2 input to the operator.

Either a property fields container, a vector of property fields to merge or property fields from pin 0 to ...
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@

if TYPE_CHECKING:
from ansys.dpf.core.fields_container import FieldsContainer
from ansys.dpf.core.property_fields_container import PropertyFieldsContainer


class merge_weighted_fields_containers(Operator):
Expand All @@ -36,11 +37,9 @@ class merge_weighted_fields_containers(Operator):
A vector of fields containers to merge or fields containers from pin 0 to ...
fields_containers2: FieldsContainer
A vector of fields containers to merge or fields containers from pin 0 to ...
weights1: Class Dataprocessing::Dpftypecollection&lt;Class
Dataprocessing::Cpropertyfield&gt;
weights1: PropertyFieldsContainer
Weights to apply to each field from pin 1000 to ...
weights2: Class Dataprocessing::Dpftypecollection&lt;Class
Dataprocessing::Cpropertyfield&gt;
weights2: PropertyFieldsContainer
Weights to apply to each field from pin 1000 to ...

Outputs
Expand All @@ -65,9 +64,9 @@ class merge_weighted_fields_containers(Operator):
>>> op.inputs.fields_containers1.connect(my_fields_containers1)
>>> my_fields_containers2 = dpf.FieldsContainer()
>>> op.inputs.fields_containers2.connect(my_fields_containers2)
>>> my_weights1 = dpf.Class Dataprocessing::Dpftypecollection&lt;Class Dataprocessing::Cpropertyfield&gt;()
>>> my_weights1 = dpf.PropertyFieldsContainer()
>>> op.inputs.weights1.connect(my_weights1)
>>> my_weights2 = dpf.Class Dataprocessing::Dpftypecollection&lt;Class Dataprocessing::Cpropertyfield&gt;()
>>> my_weights2 = dpf.PropertyFieldsContainer()
>>> op.inputs.weights2.connect(my_weights2)

>>> # Instantiate operator and connect inputs in one line
Expand Down Expand Up @@ -254,9 +253,9 @@ class InputsMergeWeightedFieldsContainers(_Inputs):
>>> op.inputs.fields_containers1.connect(my_fields_containers1)
>>> my_fields_containers2 = dpf.FieldsContainer()
>>> op.inputs.fields_containers2.connect(my_fields_containers2)
>>> my_weights1 = dpf.Class Dataprocessing::Dpftypecollection&lt;Class Dataprocessing::Cpropertyfield&gt;()
>>> my_weights1 = dpf.PropertyFieldsContainer()
>>> op.inputs.weights1.connect(my_weights1)
>>> my_weights2 = dpf.Class Dataprocessing::Dpftypecollection&lt;Class Dataprocessing::Cpropertyfield&gt;()
>>> my_weights2 = dpf.PropertyFieldsContainer()
>>> op.inputs.weights2.connect(my_weights2)
"""

Expand All @@ -282,11 +281,11 @@ def __init__(self, op: Operator):
merge_weighted_fields_containers._spec().input_pin(1), 1, op, 1
)
self._inputs.append(self._fields_containers2)
self._weights1: Input = Input(
self._weights1: Input[PropertyFieldsContainer] = Input(
merge_weighted_fields_containers._spec().input_pin(1000), 1000, op, 0
)
self._inputs.append(self._weights1)
self._weights2: Input = Input(
self._weights2: Input[PropertyFieldsContainer] = Input(
merge_weighted_fields_containers._spec().input_pin(1001), 1001, op, 1
)
self._inputs.append(self._weights2)
Expand Down Expand Up @@ -397,7 +396,7 @@ def fields_containers2(self) -> Input[FieldsContainer]:
return self._fields_containers2

@property
def weights1(self) -> Input:
def weights1(self) -> Input[PropertyFieldsContainer]:
r"""Allows to connect weights1 input to the operator.

Weights to apply to each field from pin 1000 to ...
Expand All @@ -418,7 +417,7 @@ def weights1(self) -> Input:
return self._weights1

@property
def weights2(self) -> Input:
def weights2(self) -> Input[PropertyFieldsContainer]:
r"""Allows to connect weights2 input to the operator.

Weights to apply to each field from pin 1000 to ...
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@

if TYPE_CHECKING:
from ansys.dpf.core.property_field import PropertyField
from ansys.dpf.core.property_fields_container import PropertyFieldsContainer


class propertyfield_get_attribute(Operator):
Expand Down Expand Up @@ -173,7 +174,7 @@ class InputsPropertyfieldGetAttribute(_Inputs):

def __init__(self, op: Operator):
super().__init__(propertyfield_get_attribute._spec().inputs, op)
self._property_field: Input[PropertyField] = Input(
self._property_field: Input[PropertyField | PropertyFieldsContainer] = Input(
propertyfield_get_attribute._spec().input_pin(0), 0, op, -1
)
self._inputs.append(self._property_field)
Expand All @@ -183,7 +184,7 @@ def __init__(self, op: Operator):
self._inputs.append(self._property_name)

@property
def property_field(self) -> Input[PropertyField]:
def property_field(self) -> Input[PropertyField | PropertyFieldsContainer]:
r"""Allows to connect property_field input to the operator.

Returns
Expand Down
Loading
Loading