Dear STKO team,
can you please let us know how the MpcAttributeType.QuantityMatrix is populated from the STKO preprocessor?
We are trying to implement automatically the Pressure Independent Multi Yield material as shown below:
meta = doc.metaDataPhysicalProperty('materials.nD.PressureIndependMultiYield')
xobj = MpcXObject.createInstanceOf(meta)
xobj.getAttribute('nd').integer = 3
xobj.getAttribute('rho').quantityScalar.value = 20
xobj.getAttribute('refShearModul').quantityScalar.value = 12
xobj.getAttribute('refBulkModul').quantityScalar.value = 25
xobj.getAttribute('cohesi').quantityScalar.value = 3.14
xobj.getAttribute('peakShearStra').real = 23
xobj.getAttribute('Optional').boolean = True
xobj.getAttribute('frictionAng').real = 250
xobj.getAttribute('refPress').quantityScalar.value = 123
xobj.getAttribute('pressDependCoe').real = 2500
xobj.getAttribute('surface').string = 'User defined surfaces'
xobj.getAttribute('r_Gs').quantityMatrix.value = ?
Unfortunately, we are unable to understand how to complete the last line for the user-defined case.
Thank you in advance for your help.
Best wishes,
Raffaele
MpcAttributeType.QuantityMatrix
-
marafini.f
- Posts: 363
- Joined: Fri Nov 13, 2020 1:52 pm
Re: MpcAttributeType.QuantityMatrix
Dear Raffaele,
you can define the dimension of the matrix as follows:
p.XObject.getAttribute('r_Gs').quantityMatrix.value = Math.mat(20,20)
where mat(rows,cols) passes the number of rows and columns as arguments
then you can set the values inside the matrix with the method setValueAt(i,value) or setValueAt(i,j,value)
in the first instance, you are using the matrix numbering which identifies positions counting them by columns from top to bottom, in the second you just give the row index and column index to identify your position.
For example:
p.XObject.getAttribute('r_Gs').quantityMatrix.setValueAt(1,1,1)
Remember it's all in base 0
Let us know if you need more help.
Francesca
you can define the dimension of the matrix as follows:
p.XObject.getAttribute('r_Gs').quantityMatrix.value = Math.mat(20,20)
where mat(rows,cols) passes the number of rows and columns as arguments
then you can set the values inside the matrix with the method setValueAt(i,value) or setValueAt(i,j,value)
in the first instance, you are using the matrix numbering which identifies positions counting them by columns from top to bottom, in the second you just give the row index and column index to identify your position.
For example:
p.XObject.getAttribute('r_Gs').quantityMatrix.setValueAt(1,1,1)
Remember it's all in base 0
Let us know if you need more help.
Francesca