Hi All,
I have resolved the issue in a previous question regarding getting the mesh and stress from the last step of an adapted mesh (adapted mesh using DPF, associated stress tensor only available through ACT passed into main script called by ACT).
ACT supplies the elemental nodal stress tensor at the corner nodes. I then use the operators below to extend this to midside nodes. I am converting the mesh and nodal stress to a 3rd party code.
If I compare the corner node stress between Mechanical and the imported results these align exactly. However, the midside stress is quite different. I am struggling to undertand this and would appreciate any insights.


-------------------------------------------------------------------------------------------------------------------------
# create stress field
stress_field = dpf.Field(
nature=dpf.natures.symmatrix,
location=dpf.locations.elemental_nodal
)
for i in range(nelem_f):
stress_field.append(
data=stress[i],
scopingid = act_elemid[i]
)
# map stress tensor to node
scoping_op = dpf.operators.scoping.from_mesh()
scoping_op.inputs.mesh.connect(mesh_f)
scoping_op.inputs.requested_location.connect(dpf.locations.elemental_nodal)
target_scoping = scoping_op.outputs.scoping()
rescope_op = dpf.operators.scoping.rescope(
fields=stress_field, # original ACT-ordered field
mesh_scoping=target_scoping # ordered DPF reference layout
)
reordered_stress_field = rescope_op.outputs.fields_as_field()
# extend to mid-side nodes
mid_op = dpf.operators.averaging.extend_to_mid_nodes()
mid_op.inputs.field.connect(reordered_stress_field)
mid_op.inputs.mesh.connect(mesh_f)
full_stress_field = mid_op.outputs.field()
# nodal averaging
avg_op = dpf.operators.averaging.elemental_nodal_to_nodal(
field=full_stress_field,
mesh=mesh_f,
extend_to_mid_nodes=False
)
stress_nodal = avg_op.outputs.field()
stress_data = stress_nodal.data