How to extract information aboout converged or unconverged solution

Massimo
Massimo Member Posts: 4
First Comment
**
edited June 2023 in Structures

Hello,

I need to extract by means of a Python script the information if a solution is converged or not (i.e.: how to read in the solution object the value for Substep, something like "if Substep equal 999999 not converged...")

Thank you very much

Best Answer

Answers

  • Mike.Thompson
    Mike.Thompson Member, Employee Posts: 361
    25 Answers 100 Comments Second Anniversary 25 Likes
    ✭✭✭✭

    Are you only wanting to know if the solution converged or not, or do you need information about which step and substep the solution diverged?

    If you are only looking for if the solution completed or not you can look at the Solution object ObjectState property

  • Massimo
    Massimo Member Posts: 4
    First Comment
    **

    Hello Mike

    Thank you for your reply; I need to extarct which step and substep the simulation diverged

    Best

  • Massimo
    Massimo Member Posts: 4
    First Comment
    **

    Hello Mike

    Just to clarify my goal; I'm currrently read results from result file and by means of the following script I'm setting the final substep of the final step; but I'm assuming that the final result set is valid (converged); if not (how to know?) I need to read the last but one result

    Thank you very much for your help

    Massimo

    reader = ExtAPI.DataModel.Project.Model.Analyses[0].GetResultsData()

    result_sets = reader.ListTimeFreq

    lastRes=len(result_sets)-1

    reader.CurrentTimeFreq = result_sets[lastRes] # Set last result set

  • Massimo
    Massimo Member Posts: 4
    First Comment
    **

    Hello Rajesh,

    thank you very much for your reply, this will be very helpful for my purpose and it solved my issue

    Best regards