How can I obtain the structural moment components for beam elements in PyDPF? (The result where Item corresponds to M in the APDL command PRESOL) The element_nodal_forces operator only returns force components.
The element_nodal_forces operator has an option called split_force_components.
split_force_components
Setting this to True outputs results with the translational and rotational components separated. Among these, the one with dofs=1 corresponds to the rotational component, i.e., the moment.
For details on the operator, please refer to the following:
element_nodal_forces — PyDPF-Core
Sample code:
# read file result information with pyDPF from ansys.dpf import core as dpf # Define the path to the result file result_file_path = r"file.rst" # Load the result file into a DPF model model = dpf.Model(result_file_path) op = dpf.operators.result.element_nodal_forces() op.inputs.data_sources.connect(model.metadata.data_sources) op.inputs.read_beams.connect(True) op.inputs.split_force_components.connect(True) # outputs force and moment components separately moments = op.outputs.fields_container()[1] # Get the moments field print(moments)