Hi everyone!
Having some trouble debugging some unusual errors that are triggering on pretty innocuous looking lines that I can’t see the problems with! Would be amazing if someone could help me to interpret what the error is saying and see if maybe I can figure out why they’re throwing! I’ll paste the error here:
Traceback (most recent call last):
File "wabisabi.py", line 87, in <module>
solver.simulate()
File "/home/josh/Desktop/FastIPC/projects/brittle/DFGMPMSolver.py", line 1719, in simulate
self.substep()
File "/home/josh/Desktop/FastIPC/projects/brittle/DFGMPMSolver.py", line 1465, in substep
self.G2P()
File "/home/josh/.local/lib/python3.6/site-packages/taichi/lang/kernel.py", line 605, in __call__
return self._primal(self._kernel_owner, *args, **kwargs)
File "/home/josh/.local/lib/python3.6/site-packages/taichi/lang/kernel.py", line 501, in __call__
self.materialize(key=key, args=args, arg_features=arg_features)
File "/home/josh/.local/lib/python3.6/site-packages/taichi/lang/kernel.py", line 370, in materialize
taichi_kernel = taichi_kernel.define(taichi_ast_generator)
File "/home/josh/.local/lib/python3.6/site-packages/taichi/lang/kernel.py", line 367, in taichi_ast_generator
compiled()
File "/home/josh/Desktop/FastIPC/projects/brittle/DFGMPMSolver.py", line 1118, in G2P
self.x[p] += self.dt * new_v_PIC # advection, use PIC velocity for advection regardless of PIC, FLIP, or APIC
File "/home/josh/.local/lib/python3.6/site-packages/taichi/lang/common_ops.py", line 240, in augassign
self += x
File "/home/josh/.local/lib/python3.6/site-packages/taichi/lang/common_ops.py", line 184, in __iadd__
self.atomic_add(other)
File "/home/josh/.local/lib/python3.6/site-packages/taichi/lang/common_ops.py", line 160, in atomic_add
return ti.atomic_add(self, other)
File "/home/josh/.local/lib/python3.6/site-packages/taichi/lang/ops.py", line 136, in wrapped
return a.element_wise_writeback_binary(imp_foo, b)
File "/home/josh/.local/lib/python3.6/site-packages/taichi/lang/matrix.py", line 176, in element_wise_writeback_binary
ret.entries[i] = foo(self.entries[i], other)
File "/home/josh/.local/lib/python3.6/site-packages/taichi/lang/ops.py", line 130, in imp_foo
return foo(x, wrap_if_not_expr(y))
File "/home/josh/.local/lib/python3.6/site-packages/taichi/lang/ops.py", line 31, in wrap_if_not_expr
return Expr(a) if not is_taichi_expr(a) else a
File "/home/josh/.local/lib/python3.6/site-packages/taichi/lang/expr.py", line 33, in __init__
self.ptr = impl.make_constant_expr(arg).ptr
File "/home/josh/.local/lib/python3.6/site-packages/taichi/lang/util.py", line 199, in wrapped
return func(*args, **kwargs)
File "/home/josh/.local/lib/python3.6/site-packages/taichi/lang/impl.py", line 280, in make_constant_expr
return Expr(taichi_lang_core.make_const_expr_f64(val))
TypeError: make_const_expr_f64(): incompatible function arguments. The following argument types are supported:
1. (arg0: float) -> taichi_core.Expr
Invoked with: array([<ti.Expr>, <ti.Expr>, <ti.Expr>], dtype=object)
To me, it seems the problematic line here looks to be:
self.x[p] += self.dt * new_v_PIC
And previously, I had this exact same looking error throwing on this line:
new_v_FLIP = self.v[p] + (self.dt * new_v_FLIP)
BUT, the error went away and instead became the one above when I changed this line to this:
new_v_FLIP *= self.dt
new_v_FLIP += self.v[p]
Could someone help me to interpret what might be going on here based on the error? Not sure I understand what ti.Expr is