Skip to content

Commit 0d76749

Browse files
committed
Add extend_to_mid_nodes operation and fix elementalnodal size computation when quadratic elements are present.
1 parent 9d7e7e5 commit 0d76749

File tree

2 files changed

+7
-1
lines changed

2 files changed

+7
-1
lines changed

src/ansys/dpf/core/meshed_region.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -739,7 +739,7 @@ def get_elemental_nodal_size_list(self):
739739
# Get the field of element types
740740
element_types_field = self.elements.element_types_field
741741
# get the number of nodes for each possible element type
742-
size_map = dict([(e_type.value, element_types.descriptor(e_type).n_corner_nodes)
742+
size_map = dict([(e_type.value, element_types.descriptor(e_type).n_nodes)
743743
for e_type in element_types])
744744
keys = list(size_map.keys())
745745
sort_idx = np.argsort(keys)

src/ansys/dpf/core/plotter.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1022,6 +1022,12 @@ def plot_contour(
10221022
unit = field.unit
10231023
break
10241024

1025+
# If ElementalNodal, first extend results to mid-nodes
1026+
if location == locations.elemental_nodal:
1027+
fields_container = dpf.core.operators.averaging.extend_to_mid_nodes_fc(
1028+
fields_container=fields_container
1029+
).eval()
1030+
10251031
location_data_len = mesh.location_data_len(location) # 3751 nodes # 3000 elements # 24000 elemental nodal # field.data 72000
10261032
if location == locations.nodal:
10271033
mesh_location = mesh.nodes

0 commit comments

Comments
 (0)