espressomd-users
[Top][All Lists]
Advanced

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

Re: [ESPResSo-users] particle does not exist


From: Xikai Jiang
Subject: Re: [ESPResSo-users] particle does not exist
Date: Wed, 18 Jun 2014 10:16:57 -0400

Dr. Arnold:

Thank you for your hints. That's a beautiful snippet.

Xikai

Am Jun 18, 2014 um 3:27 schrieb "Axel Arnold" <address@hidden>:

On 06/18/2014 05:06 AM, Xikai Jiang wrote:
When I retrieve the deleted particle position, Espresso will return a value of "na", to
find which atom is deleted, I find that one way is to compare it with a number such as:

if { [part $id print pos] >=100 } {
   puts "it's deleted particle"
}

You could also just ask for the type of the particle, that works with any property. However, there is a second possibility which avoids the overhead of an extra "part print". Tcl can catch errors, so you can just delete the particles like this:

if {[catch {part $id delete}]} {
    puts "it's deleted particle"
} {
    puts "just deleted particle $id"
}

Using this snippet, you get the message if the particle doesn't exist, but if it did, it immediately gets deleted.

Best,
Axel



> Subject: Re: [ESPResSo-users] particle does not exist
> From: address@hidden
> Date: Tue, 17 Jun 2014 19:00:49 +0200
> CC: address@hidden
> To: address@hidden
>
> Dear Xikai,
> please check the content of confout for particle 4633. There must be a section like
> Are you sure that there is something like { particle 4633 pos 1 2 3 } in there?
> Just after reading the configuration you should then be able to e.g. print its position,
> puts [ part 4633 print pos ]
> and also to delete it. It is very likely that this is a simple error in your particle indexing or something similar.
> Cheers and good luck
> Stefan
>
> On Jun 17, 2014, at 6:54 PM, Xikai Jiang <address@hidden> wrote:
>
> > Dear all:
> >
> > I've got a question about deleting particles from a simulation continued
> > from previous one.
> >
> > In the older simulation, I wrote blockfiles to store particle information such as pid,
> > positions, velocities.
> >
> > When the old simulation finished, I continued to run it by reading saved blockfiles by
> > the following command:
> >
> > set last [open "confout" "r"]
> > while { [ blockfile $last read auto] != "eof" } { }
> > close $last
> >
> > The simulation can continue running without problem, however, when I attempt to
> > delete a particle, it said "particle 4633 does not exist and cannot be removed".
> > I'm sure that particle 4633 exists in the saved configuration file.
> >
> > Does anyone encounter this problem before?
> >
> > Thanks for your time!
> >
> > XIkai
>


-- 
JP Dr. Axel Arnold
ICP, Universit├Ąt Stuttgart
Allmandring 3
70569 Stuttgart, Germany
Email: address@hidden
Tel: +49 711 685 67609

reply via email to

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