Anyone know the DPF operator to display pentration between bodies as a contour plot in mechanical?

amusthaf
amusthaf Member Posts: 16
First Anniversary Name Dropper First Comment
**
edited March 21 in Structures

I am trying to calculate the pentration between bodies for a deformed mesh at a specific load step.
On exploring a bit, I found the contact_pentration operator. But, I am not sure how it can be used. If anyone has any ideas/experience, please help!!

Comments

  • Pernelle Marone-Hitz
    Pernelle Marone-Hitz Member, Moderator, Employee Posts: 871
    100 Answers 500 Comments 250 Likes First Anniversary
    ✭✭✭✭
    import mech_dpf
    import Ans.DataProcessing as dpf
    mech_dpf.setExtAPI(ExtAPI)
    
    #Get path to result file, set data sources and model
    analysis = ExtAPI.DataModel.Project.Model.Analyses[0]
    filepath = analysis.ResultFileName
    dataSources = dpf.DataSources()
    dataSources.SetResultFilePath(filepath)
    model=dpf.Model(dataSources)
    
    # Define mesh
    my_mesh = model.Mesh
    
    # Define time scoping
    my_time_scoping = [1]
    
    # Define elemental scoping
    my_scoping = dpf.Scoping()
    my_scoping.Location = "Elemental"
    my_scoping.Ids = cont_elems
    
    # Get penetration results
    contact_penetration = dpf.operators.result.contact_penetration() 
    contact_penetration.inputs.time_scoping.Connect(my_time_scoping)
    contact_penetration.inputs.data_sources.Connect(dataSources)
    my_fields_container = contact_penetration.outputs.fields_container.GetData()