Skip to content

TYpe ERROR #58

@Wangmmstar

Description

@Wangmmstar

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'

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions