DPF Error: The Label Space Request in this collection has more than one entry

I am currently working with a model that has a "surface coating" applied in Mechanical and trying to pull results using the DPF.

Essentially it appears the DPF is pulling two different element shapes from my selected mesh ids (most likely both the 3D elements on the part and the 2D shells created by the surface coating).

Is there a specific command that needs to be used to specify the shape when pulling values using DPF? I don't see a way to specify the specific shape type with "GetFieldByTimeId". The documentation has a "requested location" option, but its input is a string which is a little confusing what should be entered.

        stress_op = dpf.operators.result.stress_principal_1()
        stress_fields_container = stress_op.outputs.fields_container.GetData()


  • Mike.Thompson
    Mike.Thompson Member, Employee Posts: 94
    5 Answers 10 Comments Ansys Employee 5 Likes

    I assume you want the stresses on the surface elements. You can get rid of the multiple element shapes by using a mesh scoping that is set to only the Ids of the surface elements. You should also set the location property of the scoping to be elemental.

    You can still request nodal, elemental, or element-nodal results, but the mesh scoping is elemental as you only want the results from the surface elements.

    Below is an example of requesting the nodal averaged stresses of ONLY a particular surface element. You could use the list of all surface element Ids to expand to all the 2D elements.

    TimeScoping = dpf.Scoping()
    TimeScoping.Ids = [TimeId]
    MeshScoping.Location = dpf.locations.elemental
    FC = Op.outputs.fields_container.GetData()

    Here is also a useful snippet to get the element ids from a surface coating object in the tree since those elements don't exist in Mechanical. Assumes the first analysis and an object named "Surface Coating"

    #Get the APDL material ID of the coating
    SolverData = Analysis.Solution.SolverData
    Coating = ExtAPI.DataModel.GetObjectsByName("Surface Coating")[0]
    Data = SolverData.GetObjectData(Coating)
    MatId = Data.MaterialId
    #Use the material ID to get the element scoping
    DataSource = dpf.DataSources(Analysis.ResultFileName)
    scop_ename = dpf.operators.scoping.on_property()
    my_mesh_scoping = scop_ename.outputs.mesh_scoping.GetData()

  • dafedin
    dafedin Member Posts: 12
    Name Dropper First Comment
    edited September 16

    In this case, do I get results on shell elements in the local (elemental) coordinate system? if so, how do I translate results to a global coordinate system? Can I use the following DPF operator for this purpose: