19.15.5.6. Total Deformation Scoped on Time Step using Property Provider

This workflow enables you to read a displacement from an analysis and compute its norm at a specified time step by using the Property Provider pane. The Property Provider pane enables you to add custom properties to the Python Result object.

Below is the Property Provider tab in the Python Result.

Comment Line 5 as shown below to add the properties for the python result. Assume there are 10 steps in the current analysis. Line 31 can also be modified for a better time set scoping.

Right-click on the Python Result object and select Reload.

The properties defined in the sample code will be added in the result Details view and requires an input for the Double Property 1 under Group 1. With a valid input, the status of the Python Result will change from Underdefined to Needs to be Updated.

The workflow below is an example of use of the time scoping pin and connected to the value 5 read from Double Property 1.

Total Deformation Scoped on Time Step via Property Provider Pane

  import mech_dpf
  import Ans.DataProcessing as dpf
  dataSource = dpf.DataSources(analysis.ResultFileName)
  u = dpf.operators.result.displacement()
  nrm = dpf.operators.math.norm_fc()
  prop_val = this.GetCustomPropertyByPath("Group 1/Double Property 1").Value
  timeScop = dpf.Scoping()
  timeScop.Ids = [int(prop_val)]
  u.inputs.time_scoping.Connect(timeScop)
  u.inputs.data_sources.Connect(dataSource)
  nrm.Connect(u)
  dpf_workflow = dpf.Workflow()
  dpf_workflow.Add(u)
  dpf_workflow.Add(nrm)
  dpf_workflow.SetOutputContour(nrm)
  dpf_workflow.Record('wf_id', True)
  this.WorkflowId = dpf_workflow.GetRecordedId()