Skip to content

Commit 73640db

Browse files
authored
Associate the mesh to the Nodes.coordinates field (#1473)
* Associate the mesh to the returned Nodes.coordinates field for plotting and further handling by Post Signed-off-by: paul.profizi <[email protected]> * Add test Signed-off-by: paul.profizi <[email protected]> --------- Signed-off-by: paul.profizi <[email protected]>
1 parent 5c553aa commit 73640db

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

src/ansys/dpf/core/nodes.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -225,7 +225,9 @@ def coordinates_field(self):
225225
DPFArray([0.015, 0.045, 0.03 ]...
226226
227227
"""
228-
return self._get_coordinates_field()
228+
cf = self._get_coordinates_field()
229+
cf.meshed_region = self._mesh
230+
return cf
229231

230232
@coordinates_field.setter
231233
@version_requires("3.0")

tests/test_meshregion.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -98,6 +98,7 @@ def test_get_coordinates_field_meshedregion(simple_bar_model):
9898

9999
coordinates = mesh.property_field(dpf.core.common.nodal_properties.coordinates)
100100
assert np.allclose(coordinates.data, field_coordinates.data)
101+
assert np.all(coordinates.meshed_region.nodes.scoping.ids == mesh.nodes.scoping.ids)
101102

102103

103104
@conftest.raises_for_servers_version_under("3.0")

0 commit comments

Comments
 (0)