Closed alexdiem closed 6 years ago
Hi, could you try on this line to wrap the filter in list. I mean
points_inside = np.array(list(filter(self.rule, points)))
Thanks, this fixed that issue, but now I get
Calling FFC just-in-time (JIT) compiler, this may take some time.
Calling FFC just-in-time (JIT) compiler, this may take some time.
Calling DOLFIN just-in-time (JIT) compiler, this may take some time.
--- Instant: compiling ---
Traceback (most recent call last):
File "demo/demo_LagrangianParticles.py", line 21, in <module>
lp.scatter(fig)
File "/usr/local/lib/python3.5/dist-packages/fenicstools/LagrangianParticles.py", line 376, in scatter
for cwp in p_map.itervalues()
AttributeError: 'CellParticleMap' object has no attribute 'itervalues'
Aborted (core dumped)
If I'm not mistaken this happens because thing.itervalues() was replaced by iter(thing.values()) in Python 3.
Yes, the Python 3 compatibility is clearly not 100%. For your example, values
should already be an iterator so iter
is not needed.
Ok thank you for your quick responses!
Hi, I have trouble running the LagrangianParicles demo. I setup FEniCS 2018.1 using Docker via
and then installed fenicstools within the Docker using
sudo python3 setup.py install
When I run
python3 demo/demo_LagrangianParticles.py
I get
How can I fix this?