Use DPF to get Real Constant information

Jim Kosloski
Jim Kosloski Member, Employee Posts: 29
Second Anniversary 10 Comments Name Dropper Ansys Employee
✭✭✭✭

How can I use DPF to get the real constant ID of an element and then get the values of that real constant?

Tagged:

Answers

  • Rajesh Meena
    Rajesh Meena Moderator, Employee Posts: 125
    100 Comments Second Anniversary 5 Answers Solution Developer Community of Practice Member
    ✭✭✭✭
    edited December 2024

    @Jim Kosloski

    It is possible to get real_id for elements now:

    from ansys.dpf import core as dpf
    
    ds = dpf.DataSources(result_path=r"StaticStructural\file.rst")
    
    model = dpf.Model(ds)
    ms =model.metadata.meshed_region
    op = dpf.operators.metadata.mesh_property_provider()
    op.inputs.mesh_scoping.connect(ms.elements.scoping)
    op.inputs.streams_container.connect(model.metadata.streams_provider)
    
    op.inputs.property_name.connect('apdl_real_id')
    fld = op.outputs.property_as_property_field()
    

    But for getting real_contants value, I think operator is not available in 2025.1, It is available in 2025R2 server. Below is example of it.

    real_op = dpf.Operator('real_constants_provider')
    real_op.connect(3, model.metadata.streams_provider)
    real_constant_data= real_op.eval()