19.15.5.1. Display Results for Shared Shell Topologies

This workflow is an example of how to display results on shells for multiple bodies that share topology. In this case, displacement results. The unique feature of this example is that the result field is created from scratch.

import mech_dpf 
import Ans.DataProcessing as dpf 
mech_dpf.setExtAPI(ExtAPI) 
dataSource = dpf.DataSources(analysis.ResultFileName) 
Script Example

#Read a mesh from a results file
  mesh_op = dpf.operators.mesh.mesh_provider() 
  mesh_op.inputs.data_sources.Connect(dataSource) 
  mesh = mesh_op.outputs.mesh.GetData() 

#Create a field of results from scratch with these attributes
#Location : "Nodal"
#Mesh support : mesh 
#Shell Layers definition: Layer Independent  
#Geometries with shells can be defined by: 
#NoneLayer 
#LayerIndependent, 
#TopBottom 
#TopBottomMid 

  my_field = dpf.FieldsFactory.CreateScalarField(numEntities=0, location='Nodal') 
  my_field.MeshedRegionSupport = mesh 
  my_field.eShellLayers = dpf.enums.shellLayers.LayerIndependent 

#Adding the results at nodes to the field (here with no physical sense)
  for i in mesh.NodeIds: 
  my_field.Add(i,[float(i)]) 

#Use the forward operator to plot the field
  forward = dpf.operators.utility.forward_field() 
  forward.inputs.field.Connect(my_field) 

  dpf_workflow = dpf.Workflow() 
  dpf_workflow.Add(forward) 
  dpf_workflow.SetOutputContour(forward,dpf.enums.GFXContourType.FENodalScoping) 
  dpf_workflow.Record('wf_id', False) 
  this.WorkflowId = dpf_workflow.GetRecordedId() 

For this specific use-case of shared topology with shell elements, you can face issues concerning the result display. If the eShelLayers attribute is not set, the shared shell elements (here at the edge between the two topologies) will not appear.

To ensure that the contours on these shared elements are displayed, you must ensure that the attribute eShelLayers is set when creating the field.