How to access a value in a 'Properties' block

From KratosWiki
Revision as of 13:50, 14 April 2015 by Maceli (Talk | contribs)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

To access the value of a certain variable (i.e. YOUNG_MODULUS) included in a Properties block with a certain Id (i.e. 2), do the following:

  value = model_part.GetProperties()[2][YOUNG_MODULUS]


Explanation:


 model_part.GetProperties()

will return all the blocks of Properties in the model part (in Mesh 0 of the model part, to be exact).


 [2]

specifies the Id of the Properties block you want to visit.


 [YOUNG_MODULUS] 

specifies the variable whose variable we want to be returned.

Personal tools
Categories