[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [ESPResSo-users] Trying to understand force_calc
From: |
Evyatar Arad |
Subject: |
Re: [ESPResSo-users] Trying to understand force_calc |
Date: |
Sun, 15 Mar 2015 15:28:33 +0200 |
Relevant code follows.
In addition,
I’ve been inspecting propagate_vel_pos and noticed two main loops.
The first runs ‘local_cells.n' times
and the secondary one runs 'cell->n' times.
What do these values mean?
While running the example script ‘simplebilayer.tcl’ the values are a steady
125 for the first loop (local_cells.n) and a random number (0 - ~30) in for the
second loop (cell->n).
Thanks again.
void propagate_vel_pos()
…
...
for (c = 0; c < local_cells.n; c++) {
cell = local_cells.cell[c];
p = cell->part;
np = cell->n;
printf("c,np= %d, %d \n",local_cells.n,np); //my addition
for(i = 0; i < np; i++) {
#ifdef VIRTUAL_SITES
if (ifParticleIsVirtual(&p[i])) continue;
#endif
for(j=0; j < 3; j++){
#ifdef EXTERNAL_FORCES
if (!(p[i].l.ext_flag & COORD_FIXED(j)))
#endif
{
/* Propagate velocities: v(t+0.5*dt) = v(t) + 0.5*dt * f(t) */
p[i].m.v[j] += p[i].f.f[j];
/* Propagate positions (only NVT): p(t + dt) = p(t) + dt *
v(t+0.5*dt) */
p[i].r.p[j] += p[i].m.v[j];
}
}
…
...
> On Mar 15, 2015, at 2:13 PM, Evyatar Arad <address@hidden> wrote:
>
> Hello again everyone,
>
> While going through the code of Velocity-Verlet integrator, I’ve noticed the
> 3rd integration step is preformed with a call to “force_calc”.
> One of the comments describing the function stated that the forces are
> initialised with “friction_thermo_langevin” from the thermostat.cpp code (
> "Initialise forces with: \ref friction_thermo_langevin (ghost forces with
> zero)”).
> This may come as trivial, why are the langevin coefficients needed to
> initialise the particle forces?
> Also, I couldn’t actually find any reference in the “force_calc” function’s
> body to “friction_thermo_langevin” or “init_local_particle_force”. When and
> where does “friction_thermo_langevin” actually gets called?
>
> Have a great week, thanks in advance,
> Evyatar.