espressomd-users
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[ESPResSo-users] attribution errors on swimming feature


From: Le Qiao
Subject: [ESPResSo-users] attribution errors on swimming feature
Date: Wed, 25 Oct 2017 17:15:32 -0400

Hi,

I’m trying add a self propelling particle with the swimming feature on by using the code example:

            Examples
            --------
            >>> import espressomd
            >>> 
            >>> system = espressomd.System()
            >>> 
            >>> # Usage with Langevin
            >>> system.part.add(id=0, pos=[1,0,0],swimming={'f_swim':0.03})
            >>> 
            >>> # Usage with LB
            >>> system.part.add(id=1, pos=[2,0,0],swimming={
            >>>    'f_swim':0.01, 'mode':'pusher', 'dipole_length':2.0, 'rotational_friction':20})

However, it kept giving me errors:

./pypresso 
Python 2.7.14 (default, Sep 25 2017, 09:54:19) 
[GCC 4.2.1 Compatible Apple LLVM 9.0.0 (clang-900.0.37)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import espressomd
>>> system = espressomd.System()
>>> system.part.add(id=0, pos=[1,0,0],swimming={'f_swim':0.03})
<espressomd.particle_data.ParticleHandle object at 0x10947a8a0>
>>> 
>>> system.part.add(id=1, pos=[2,0,0],swimming={'f_swim':0.01, 'mode':'pusher', 'dipole_length':2.0, 'rotational_friction':20})
<espressomd.particle_data.ParticleHandle object at 0x10947aee0>
>>> exit()




I also tried the example code from tutorial directory:  doc/tutorials/python/06-active_matter/SOLUTIONS/enhanced_diffusion.py


I got following error:
Traceback (most recent call last):
  File "enhanced_diffusion.py", line 87, in <module>
    system.part.add(pos=[5.0, 5.0, 5.0],swimming={ 'v_swim' : vel },rotation=[1,1,1])
  File "espressomd/particle_data.pyx", line 1744, in espressomd.particle_data.ParticleList.add (/home/mbcx/project/Work/test/espresso/build/src/python/espressomd/particle_data.cpp:14337)
  File "espressomd/particle_data.pyx", line 1772, in espressomd.particle_data.ParticleList._place_new_particle (/home/mbcx/project/Work/test/espresso/build/src/python/espressomd/particle_data.cpp:14674)
  File "espressomd/particle_data.pyx", line 1476, in espressomd.particle_data.ParticleHandle.update (/home/mbcx/project/Work/test/espresso/build/src/python/espressomd/particle_data.cpp:10383)
AttributeError: 'espressomd.particle_data.ParticleHandle' object has no attribute 'swimming'

But I did enable the engine feature, Does anyone know what is the cause of the errors? 


Enabled features in myconfig.hpp
  #define CONSTRAINTS
  #define MASS
  #define ENGINE
  #define ROTATION
  #define ROTATIONAL_INERTIA
  #define LB
  #define LB_BOUNDARIES
  #define LENNARD_JONES

Cheers
Le

reply via email to

[Prev in Thread] Current Thread [Next in Thread]