Optimization with GeoPy using Young Modulus

· 3 · 1346
*

FabianeGommes

  • *
  • Posts: 9
    • View Profile
Optimization with GeoPy using Young Modulus
« on: September 11, 2023, 02:47:58 PM »
Hello,

I'm having difficulty accessing the value of the 'YoungModulus' in the ResultMap.

I'm using the code presented below, but it gives an error on the line "young_modulus = float(gdr['ResultMap']['Strain']['Isotropic']['YoungModulus'])".

....
gdr_name = gd.runCmd("ElastoDict:SolveFeelMathVOX", SolveFeelMathVOX_args_1, Header['Release'])

import stringmap
young_modulus = gdr['Strain']['Isotropic']['YoungModulus']
gd.msgBox(young_modulus)

May I suggest another way? My code aims to perform an optimization, which will be based on the 'YoungModulus'.

*

Aaron Widera

  • Math2Market Employee
  • *****
  • Posts: 63
    • View Profile
    • Math2Market GmbH
  • Position: Sales Engineer Digital Material R&D
Re: Optimization with GeoPy using Young Modulus
« Reply #1 on: September 11, 2023, 03:04:16 PM »
Dear Fabiane,

in order to access a gdr from GeoPy you first have to parse the gdr:
Code: [Select]
import stringmap
gdr = stringmap.parseGDR("PathToGDRFile")
When the gdr was parsed you then can access the information for example the young's modulus:
Code: [Select]
young_modulus = gdr.getDouble('ResultMap:Strain:Isotropic:YoungModulus')Further details can be found in our GeoPy User Guide https://www.math2market.com/fileadmin/UserGuide/GeoDict2023/Automation2023.pdf on page 70

*

FabianeGommes

  • *
  • Posts: 9
    • View Profile
Re: Optimization with GeoPy using Young Modulus
« Reply #2 on: September 11, 2023, 05:47:36 PM »
Now it works, thank you very much