espressomd-users
[Top][All Lists]
Advanced

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

Re: [ESPResSo-users] Grand canonical thermostat


From: Peter Košovan
Subject: Re: [ESPResSo-users] Grand canonical thermostat
Date: Fri, 27 Feb 2015 09:15:42 +0100

Dear Salim,

I can hardly imagine a situation, when you would need to add/delete particles every 10 integration steps. Our rule of thumb is to adjust the GC exchange rate such, that the autocorrelation time of the concentration fluctutations and of other (slow) variables in your system is on the same order of magnitude. Please check this and I believe that you find out that GC exchange rate >1e3 integration steps is sufficient (depends on your simulated system). You can also do several GC steps, and then a longer sequence of MD steps.

Greetings,

peter

2015-02-27 7:02 GMT+01:00 Axel Arnold <address@hidden>:
Hi!

Am 26.02.2015 um 23:17 schrieb Salim Maduar <address@hidden>:

Hello, everyone
 
I want to use grand canonical thermostat in Espresso in order to fix the chemical potential of species. There is a possibility of using this thermostat through TCL interface.
However, if I have a lot of particles it gets very slow. Essentially because I have to add/delete particles in TCL every 10-20 integration steps.
It seems that there is no such Grand canonical thermostat in Espresso yet (?) which works at c-code level.
If there is such a thermostat, could anyone explain how to use it.

No, there isn’t.

 
If there is no such thermostat, then could anyone explain how to implement it in c-code. I think it would dramatically accelerate the simulation if it addition/deletion of particles will be implemented in c-code without returning frequently to TCL interface.

I don’t think so, actually. The reason is that adding/deleting particles in the Espresso structures is relatively expensive, because Espresso isn’t optimized for this use case. Espresso can only completely rebuild the Verlet list, which happens every time you add/delete a particle.  Also, we need to reallocate the ghost particle buffers, which we again can do only completely. This costs much more time than leaving to Tcl, and adapting the Verlet lists is a pretty complex thing that would require deep changes in the infrastructure of Espresso.

It would be helpful to know which files and perhaps functions I have to change in this case.
I think  that some of the existing thermostats should be modified so that before integration step it deletes or removes particles.

It is not that easy. The thermostats do their work during integration, i.e., when Espresso is running MPI-parallel. The C-routines for adding/deleting particles however need to be called only on the master node, because all nodes need to be aware that the number of particles changes when communicating ghosts. So, you need to decide on the master node only whether or not to add/delete a particle, and leave the integration loop on C-level. But again, the main cost is not leaving the C-level, but rather the full rebuild of communication buffers and Verlet lists, which is much more demanding to fix.

Note also that you need to be careful when adding particles so often. The Langevin thermostat needs a while to establish the desired temperature, namely roughly 1/gamma/dt time steps. So, for gamma=1 and dt=0.01 you need about 100 steps to “heal” the overall temperature. You can accelerate that by increasing gamma, however, also the product of gamma and dt can’t be too large. 20 time steps is already critical, and 10 time steps is from my experience not enough to get the temperature correct.

Best,
Axel

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




--
Dr. Peter Košovan

Departmtent of Physical and Macromolecular Chemistry
Faculty of Science, Charles University in Prague, Czech Republic

Katedra fyzikální a makromolekulární chemie
Přírodovědecká fakulta Univerzity Karlovy v Praze

www.natur.cuni.cz/chemistry/fyzchem/
Tel. +420221951290
Fax +420224919752


Pokud je tento e-mail součástí obchodního jednání, Přírodovědecká fakulta Univerzity Karlovy v Praze:
a) si vyhrazuje právo jednání kdykoliv ukončit a to i bez uvedení důvodu,
b) stanovuje, že smlouva musí mít písemnou formu,
c) vylučuje přijetí nabídky s dodatkem či odchylkou,
d) stanovuje, že smlouva je uzavřena teprve výslovným dosažením shody na všech náležitostech smlouvy.

reply via email to

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