Jump to content

Access script object


---
 Share

Recommended Posts

Dear all,

i am trying to export surface component on which von Mises strain is shown as a CSV file. For that I want to use a script. Under script objects I can see my surface component (Fig1). It shows that it is a  Data array (size [160, 5901, 3]). However, if I try to access this array in the script I get only NaN (see Fig2). Why does it show as NaN?

Further observations: What I am figuring is the contents of the array is:

160 - nr of stages

5901 - my surface component points

3 - coordinates of each of those points

Furthermore, the shape of "Scalar value of element" in Fig 1 is Data array (size [160, 5901, 1]). This suggests that each of the x,y,z, points has von Mises strain associated. But I am not able to access these as well - also showing as NaN.

 

All the best,

Thanks

Fig1.thumb.png.6016822eb20bf561454028a22c02309a.png

Fig2.png.55018a996b9b5056e18e514460ff46b8.png

Link to comment
Share on other sites

Dear Mr. Saarna,

I'm not an expert in this field, but my guess is that there simply are no valid computation result for the selected points.

I tried a this with a different project and got similar results:

# -*- coding: utf-8 -*-

import gom
import numpy as np

a = np.array (gom.app.project.inspection['Surface component_1.phiM'].data.coordinate)
b = np.array (gom.app.project.inspection['Surface component_1.phiM'].data.scalar_value)

print(a.shape)
print(b.shape)

for point in [0, 500]:
	print("Point #", point)
	for s in range(23):
		print(a[s][point])

	for s in range(23):
		print(b[s][point])
(23, 12983, 3)
(23, 12983, 1)
Point # 0
[ 0.23043814 44.05475379 -0.08537407]
[ 0.30014222 44.82112556 -0.23165192]
[nan nan nan]
[nan nan nan]
[nan nan nan]
[nan nan nan]
[nan nan nan]
[nan nan nan]
[nan nan nan]
[nan nan nan]
[nan nan nan]
[nan nan nan]
[nan nan nan]
[nan nan nan]
[nan nan nan]
[nan nan nan]
[nan nan nan]
[nan nan nan]
[nan nan nan]
[nan nan nan]
[nan nan nan]
[nan nan nan]
[nan nan nan]
[0.]
[0.68799549]
[nan]
[nan]
[nan]
[nan]
[nan]
[nan]
[nan]
[nan]
[nan]
[nan]
[nan]
[nan]
[nan]
[nan]
[nan]
[nan]
[nan]
[nan]
[nan]
[nan]
[nan]
Point # 500
[17.6790147  11.18677551 -0.09242096]
[17.65089071 11.5638292  -0.12791365]
[17.61052254 11.98717482 -0.12953273]
[17.57434513 12.38810413 -0.13939174]
[17.54221074 12.81123063 -0.14940507]
[17.52088602 13.22036383 -0.16497711]
[17.4845557  13.61196885 -0.16948594]
[17.47897897 13.80562377 -0.17308054]
[17.44744833 14.21311332 -0.17318839]
[17.42783941 14.62347131 -0.19165491]
[17.41562041 15.04991794 -0.1761889 ]
[17.3787708  15.44771077 -0.19727733]
[17.36304034 15.86548575 -0.21428676]
[17.33316128 16.3024232  -0.22263852]
[17.30972669 16.70732846 -0.23582728]
[17.27424972 17.15810323 -0.23256656]
[17.25253028 17.60272263 -0.22540163]
[17.23975098 18.02373786 -0.27275953]
[17.22039675 18.44485297 -0.28343167]
[17.20261379 18.90940494 -0.27173562]
[17.17220256 19.32360576 -0.30878841]
[1.73431777e+01 1.97856612e+01 8.10996516e-06]
[17.32994137 19.32105726  0.05879889]
[0.]
[1.07832026]
[2.16510677]
[3.19080353]
[4.27986479]
[5.40676403]
[6.43292809]
[6.95828629]
[8.04720783]
[9.18151855]
[10.28483105]
[11.35570908]
[12.52295303]
[13.62343025]
[14.74345875]
[15.82089233]
[16.96941185]
[18.0873909]
[19.14001465]
[20.21841431]
[21.36225128]
[22.44451523]
[21.30035782]

For the first point (#0), only the first two stages contain valid data. For the second point (#500) all stages contain valid data.

Best regards,

Matthias Prinke

Link to comment
Share on other sites

  • 2 weeks later...
 Share

×
×
  • Create New...