How to access a value in a 'Properties' block

From KratosWiki
(Difference between revisions)
Jump to: navigation, search
(Created page with "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()...")
 
 
Line 15: Line 15:
 
   [2]
 
   [2]
  
specifies the Id of the Properties block you want to visit
+
specifies the Id of the Properties block you want to visit.
  
  
 
   [YOUNG_MODULUS]  
 
   [YOUNG_MODULUS]  
  
specifies the variable whose variable we want to be returned
+
specifies the variable whose variable we want to be returned.

Latest revision as of 13:50, 14 April 2015

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