[Top][All Lists]

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

Re: [ESPResSo-users] attribution errors on swimming feature

From: Le Qiao
Subject: Re: [ESPResSo-users] attribution errors on swimming feature
Date: Sat, 28 Oct 2017 00:53:09 -0400

Hi Henri,

Thanks very much for the help. You are right, I did misunderstood the returns from the interactive examples. As for the tutorial, there is no more errors shown after I rebuilt the ESPResSo (same version I used before).I can't even recover the errors myself, so I probably did something stupid when change the configurations to ran different scripts.


On Oct 27, 2017, at 11:39 PM, Henri <address@hidden> wrote:

Dear Le,

I'm very sorry but I can't reproduce your issue with the latest python branch.  Here I show the
steps I took to get the example working on my machine

git clone espresso
mkdir build
cd build
cmake ..
cp myconfig-sample.hpp myconfig.hpp
# Uncomment features from your mailing in myconfig.hpp
cmake ..

Then I run the tutorial script using

./pypresso ../doc/tutorials/python/06-active_matter/SOLUTIONS/ 1.0

and it works for me without errors.

At the same time it seems like you are using a different version of ESPResSo to run the interactive
example and the tutorial code, because the interactive example does not show any errors
(The <espressomd.particle_data.ParticleHandle ...> bit is only a representation of the return value
of system.part.add).

Kind regards,

On Wed, 2017-10-25 at 17:15 -0400, Le Qiao wrote:

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

            >>> 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>

I also tried the example code from tutorial directory:  doc/tutorials/python/06-

I got following error:
Traceback (most recent call last):
  File "", 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
  File "espressomd/particle_data.pyx", line 1772, in
  File "espressomd/particle_data.pyx", line 1476, in
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 MASS
  #define ENGINE
  #define ROTATION
  #define LB


reply via email to

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