How to access shell information with DPF.

Hi! I would like to know how to query the following shell layer information with DPF (C++):

  • Thickness
  • Orientation angle
  • Number of integration points
  • Material ID

Thanks in advance!
Victor Trejo.

Tagged:

Best Answers

  • Mike.Thompson
    Mike.Thompson Member, Employee Posts: 240
    First Anniversary First Comment 5 Likes Ansys Employee
    Answer ✓

    Seems like you want this operator:
    https://dpf.docs.pyansys.com/version/stable/operator_reference_load.html

    op = dpf.operators.result.mapdl_section() # operator instantiation
    op.inputs.properties_name.connect(my_properties_name)
    op.inputs.section.connect(my_section)# optional
    op.inputs.streams_container.connect(my_streams_container)
    op.inputs.data_sources.connect(my_data_sources)
    op.inputs.layer_property.connect(my_layer_property)# optional
    op.inputs.layers_requested.connect(my_layers_requested)# optional
    my_properties_value = op.outputs.properties_value()
    my_layers_per_section = op.outputs.layers_per_section()

  • Ayush Kumar
    Ayush Kumar Member, Moderator, Employee Posts: 389
    First Anniversary Ansys Employee Solution Developer Community of Practice Member First Answer
    Answer ✓

    @Victor Trejo can you please confirm which version of DPF Server are you using?
    layer_property and its results are only supported from 2024R1 which will be released next month.
    For 2023R2 you can only extract Thickness, NumLayers.

Answers

  • Victor Trejo
    Victor Trejo Member Posts: 7
    Name Dropper First Comment

    Thank you very much, Mike!

    That indeed looks like what I am looking for. Would you happen to have the equivalent in C++? Alternatively, could you please point me to a similar workflow in C++? I am confused about some of the input pins, particularly about the streams_container.

  • Mike.Thompson
    Mike.Thompson Member, Employee Posts: 240
    First Anniversary First Comment 5 Likes Ansys Employee

    I don’t believe you need to use the streams container if you point to a data source like a result file.

  • Victor Trejo
    Victor Trejo Member Posts: 7
    Name Dropper First Comment

    You are right. I tried without the streams container and it worked correctly. Thank you very much, Mike!

  • Victor Trejo
    Victor Trejo Member Posts: 7
    Name Dropper First Comment

    I have the impression that the layer_property pin is being ignored. I am getting the expected data for Thickness and NumLayers, but I am getting all zeroes for Orientation and NumIntPoints.

    Also, when I try to get the layers_per_section properties field by calling mapdl.getOutputPropertyField(1), I get the following runtime error:
    "DPF error - runtime error: self_call; requested result not found".

    Am I misusing DPF?

    This is my code snippet:

    ansys::dpf::Operator mapdl("mapdl_section_properties");
    mapdl.connect(4, dataSources);
    mapdl.connect(5, true); // layer property
    mapdl.connect(0, std::vector<std::string>{"Thickness", "NumLayers", "Orientation", "NumIntPoints"});
    auto fieldContainer = mapdl.getOutputFieldsContainer(0);
    auto size = fieldContainer.size();
    
    std::cout << "thickness\n";
    auto thickness = fieldContainer.at(0);
    std::cout << thickness.describe() << '\n';
    
    std::cout << "numLayers\n";
    auto numLayers = fieldContainer.at(1);
    std::cout << numLayers.describe() << '\n';
    
    std::cout << "orientation\n";
    auto orientation = fieldContainer.at(2);
    std::cout << orientation.describe() << '\n';
    
    std::cout << "integrationPointsCount\n";
    auto integrationPointsCount = fieldContainer.at(3);
    std::cout << integrationPointsCount.describe() << '\n';
    
    std::cout << "layersPerSection\n";
    mapdl.run();
    auto layersPerSection = mapdl.getOutputPropertyField(1);
    std::cout << layersPerSection.describe() << '\n';
    
  • Victor Trejo
    Victor Trejo Member Posts: 7
    Name Dropper First Comment

    Hi! I was wondering if anyone had any insight into my last question. It would be really appreciated since this is currently blocking my progress.

    Thanks in advance!
    Victor.

  • Mike.Thompson
    Mike.Thompson Member, Employee Posts: 240
    First Anniversary First Comment 5 Likes Ansys Employee

    @Victor Trejo if you think there is a legitimate defect in the code, please file it in the appropriate GitHub system.
    I don’t have a direct solution for you currently, but one of the thing to look into would be PyMAPDL where you could also retrieve this data in a different way through more traditional APDL methods.

  • Victor Trejo
    Victor Trejo Member Posts: 7
    Name Dropper First Comment

    Thank you very much for your answer, @Mike.Thompson!

    Which is the appropriate GitHub system for DPF (C++, not PyDPF)?

    Using PyMAPDL is not an option for the project I am working on, it needs to be the C++ DPF library for legal reasons.

  • Victor Trejo
    Victor Trejo Member Posts: 7
    Name Dropper First Comment

    Hi @Ayush Kumar,

    Thank you very much for the information. We are using DPF 20230723.1, it looks like I have to wait until next month. Could you please share the release date?

  • Ayush Kumar
    Ayush Kumar Member, Moderator, Employee Posts: 389
    First Anniversary Ansys Employee Solution Developer Community of Practice Member First Answer

    Hi @Victor Trejo,
    sorry I don't have any official date yet. Please check customer portal for further information.