Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TYpe ERROR #58

Open
Wangmmstar opened this issue Mar 28, 2023 · 0 comments
Open

TYpe ERROR #58

Wangmmstar opened this issue Mar 28, 2023 · 0 comments

Comments

@Wangmmstar
Copy link

When I optimize the tpd file, it keeps throwing error. ANy advice?

python scripts/optimise.py /mnt/study/mengjun/end-effector/passive-gripper/build/test1

================================================================================
ToPy problem definition (TPD) file successfully parsed.
TPD file name: /mnt/study/mengjun/end-effector/passive-gripper/build/test1 (v2007)

Domain discretisation (NUM_ELEM_X x NUM_ELEM_Y x NUM_ELEM_Z) = 60 x 77 x 66
Element type (ELEM_K) = H8
Filter radius (FILT_RAD) = 1.8
Number of iterations (NUM_ITER) = 50
Problem type (PROB_TYPE) = comp
Problem name (PROB_NAME) = test1
Damping factor (ETA) = 0.40
Passive elements (PASV_ELEM) specified
No active elements (ACTV_ELEM) specified

Iter | Obj. func. | Vol. | Change | P_FAC | Q_FAC | Ave ETA | S-V frac.

ToPy: Solution for FEA converged after 537 iterations.
Traceback (most recent call last):
File "scripts/optimise.py", line 20, in
optimise(argv[1])
File "scripts/optimise.py", line 16, in optimise
topy.optimise(t)
File "/home/niux/anaconda3/envs/topy/lib/python2.7/site-packages/topy/optimisation.py", line 67, in optimise
_optimise(topology)
File "/home/niux/anaconda3/envs/topy/lib/python2.7/site-packages/topy/optimisation.py", line 23, in _optimise
t.update_desvars_oc()
File "/home/niux/anaconda3/envs/topy/lib/python2.7/site-packages/topy/topology.py", line 535, in update_desvars_oc
pasv = np.take(idx, self.pasv) # new indices
File "/home/niux/anaconda3/envs/topy/lib/python2.7/site-packages/numpy/core/fromnumeric.py", line 189, in take
return _wrapfunc(a, 'take', indices, axis=axis, out=out, mode=mode)
File "/home/niux/anaconda3/envs/topy/lib/python2.7/site-packages/numpy/core/fromnumeric.py", line 66, in _wrapfunc
return _wrapit(obj, method, *args, **kwds)
File "/home/niux/anaconda3/envs/topy/lib/python2.7/site-packages/numpy/core/fromnumeric.py", line 46, in _wrapit
result = getattr(asarray(obj), method)(*args, **kwds)
TypeError: Cannot cast array data from dtype('float64') to dtype('int64') according to the rule 'safe'

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant