Custom result - set averaging option

Pernelle Marone-Hitz
Pernelle Marone-Hitz Member, Moderator, Employee Posts: 871
100 Answers 500 Comments 250 Likes First Anniversary
✭✭✭✭
edited June 2023 in Structures

While creating a custom result based on derived data (stress, heat flux…) that are unaveraged by nature, I would like to return nodal information, thus average values, to the end user. Do I need to perform the averaging manually or does ACT provide an automated solution for that?

Tagged:

Answers

  • Pernelle Marone-Hitz
    Pernelle Marone-Hitz Member, Moderator, Employee Posts: 871
    100 Answers 500 Comments 250 Likes First Anniversary
    ✭✭✭✭
    Answer ✓

    It is indeed possible to benefit from Mechanical averaging capabilities using a custom results. In that goal an “elemnode” result must be created and therefore unaveraged values need to be returned to the collector in callback. The averaging option (average, unaverage, elemental mean…) accessible using “ResultAveraging” property of the result allows to choose what is finally displayed to the end user.

    The .xml file should be similar to:

            <result name="ResultAveraging" version="1" caption="ResultAveraging" unit="Stress" icon="result" location="elemnode" type="scalar">
              <callbacks>
                <evaluate>Eval_ResultAveraging</evaluate>
              </callbacks>
              <property name="Geometry" caption="Geometry" control="scoping"></property>
              <property name="DisplayOption" caption="Display Option" control="select" default="Unaverage">
                <attributes options="Unaverage,Average,Elemental Mean"></attributes>
                <callbacks>
                  <onvalidate>onvalidate_changedisplayopt</onvalidate>
                </callbacks>
              </property>
            </result>
    

    And onvalidate_changedisplayplot() function in .py file should be similar to:

        def onvalidate_changedisplayopt(result, prop):
    
            displayOpt = result.Properties["DisplayOption"].Value
            if displayOpt == "Unaverage":
                result.ResultAveraging = ResultAveragingEnum.Unaverage
            elif displayOpt == "Average":
                result.ResultAveraging = ResultAveragingEnum.Average
            elif displayOpt == "Elemental Mean":
                result.ResultAveraging = ResultAveragingEnum.ElementalMean