How to get extract results via DPF using APDL Result expressions as input?
Ayush Kumar
Member, Moderator, Employee Posts: 470
✭✭✭✭
Answers
-
To connect we need to use correct input / output pin number, for more info. refer to DPF HTML doc.
import mech_dpf mech_dpf.setExtAPI(ExtAPI) import Ans.DataProcessing as dpf dpf.DataProcessingCore.LoadLibrary("math", r"C:\Program Files\ANSYS Inc\v211\aisol\bin\winx64\Ans.Dpf.Math.dll") ds = mech_dpf.GetDataSources(2) timeProvider = dpf.operators.metadata.time_freq_provider() timeProvider.inputs.data_sources.Connect(ds) freqs = timeProvider.outputs.time_freq_support.GetData() numSets = freqs.NumberSets ids = [i + 1 for i in range(numSets)] freq_scoping = dpf.data.Scoping() freq_scoping.Ids = ids node_scoping = dpf.data.Scoping() node_scoping.Ids = [45] op = dpf.Operator('UY') # Result expression same as Mechanical result objects op.Connect(4, ds) # Data-sources pin op.Connect(0, freq_scoping) # Time scoping pin op.Connect(1, node_scoping) # Mesh scoping pin output = op.GetOutputAsFieldsContainer(0)
8