From ca5c9217022b19ebe1cafba818b0e16060e9ac8a Mon Sep 17 00:00:00 2001 From: Sam Cameron Date: Thu, 3 Dec 2020 13:00:21 +0000 Subject: [PATCH 01/22] added brownian dynamics integrator fix bd/sphere. --- doc/src/fix_bd_sphere.rst | 168 ++++++++++++++++++++++++ src/fix_bd_sphere.cpp | 264 ++++++++++++++++++++++++++++++++++++++ src/fix_bd_sphere.h | 104 +++++++++++++++ src/random_mars.cpp | 16 +++ src/random_mars.h | 2 + 5 files changed, 554 insertions(+) create mode 100644 doc/src/fix_bd_sphere.rst create mode 100644 src/fix_bd_sphere.cpp create mode 100644 src/fix_bd_sphere.h diff --git a/doc/src/fix_bd_sphere.rst b/doc/src/fix_bd_sphere.rst new file mode 100644 index 0000000000..2ab184e4fb --- /dev/null +++ b/doc/src/fix_bd_sphere.rst @@ -0,0 +1,168 @@ +.. index:: fix bd/sphere + +fix bd/sphere command +====================== + +Syntax +"""""" + +.. parsed-literal:: + + fix ID group-ID bd/sphere gamma_t gamma_r diff_t diff_r seed keyword args + +* ID, group-ID are documented in :doc:`fix ` command +* bd/sphere = style name of this fix command +* gamma_t = translational friction coefficient +* gamma_r = rotational friction coefficient +* diff_t = translational diffusion coefficient +* diff_r = rotational diffusion coefficient +* zero or more keyword/value pairs may be appended +* keyword = *rng* or *rotate_planar* + + .. parsed-literal:: + + *rng* arg = *uniform* or *gaussian* or *none* + uniform = use uniform random number generator + gaussian = use gaussian random number generator + none = turn off noise + *rotate_planar* arg = *yes* or *no* + yes = only allow rotations in 2D plane (2D simulation only) + no = allow for full 3D rotations + +Examples +"""""""" + +.. code-block:: LAMMPS + + fix 1 all bd/sphere 1.0 1.0 1.0 1.0 1294019 + fix 1 all bd/sphere 1.0 1.0 1.0 1.0 19581092 rng none + fix 1 all bd/sphere 1.0 1.0 1.0 1.0 19581092 rotate_planar yes + fix 1 all bd/sphere 1.0 1.0 1.0 1.0 19581092 rotate_planar no rng gaussian + + +Description +""""""""""" + +Perform Brownian Dynamics integration to update position, velocity, +angular velocity, and dipole moment for finite-size spherical particles +in the group each timestep. Brownian Dynamics uses Newton's laws of +motion in the limit that inertial forces are negligible compared to +viscous forces. The stochastic equations of motion are + +.. math:: + + dr = \frac{F}{\gamma_t}dt+\sqrt{2D_t}dW_t, \\ + d\Omega = \frac{T}{\gamma_r}dt + \sqrt{2D_r}dW_r, + +where :math:`d\Omega` is an infinitesimal rotation vector (see e.g. +Chapter 4 of :ref:`(GoldsteinCM) `), :math:`dW_t` and +:math:`dW_r` are Wiener processes (see e.g. :ref:`(GardinerC) `). +The dipole vectors :math:`e_i` are updated using the rotation matrix + +.. math:: + + e_i(t+dt) = e^{\theta_X} e_i(t),\\ + +where :math:`\omega=d\Omega/dt` is the angular velocity, +:math:`\Delta\theta=|\omega|dt` is the rotation angle about +the :math:`\omega` axis, and +:math:`(\theta_X)_{ij}=-\epsilon_{ijk}d\Omega_k` is the +infinitesimal rotation matrix (see e.g. :ref:`(Callegari1) `, +section 7.4). + +IMPORTANT NOTE: This integrator is designed for generic non-equilibrium +simulations with additive noise. There are two important cases which +(conceptually) reduce the number of free parameters in this fix. +(a) In equilibrium simulations +(where fluctuation dissipation theorems are obeyed), one can define +the thermal energy :math:`k_bT=D_t\gamma_t=D_r\gamma_r`. +(b) When a no-slip boundary condition is expected between the spheres and +the surrounding medium, the condition +:math:`\gamma_t=3\gamma_r/\sigma^2` must be explicitly +accounted for (e.g. by setting *gamma_t* to 3 and *gamma_r* to 1) where +:math:`sigma` is the particle diameter. +If both (a) and (b) are true, then one must ensure this explicitly via +the above relationships. + +If the *rng* keyword is used with the *uniform* value, then the noise +is generated from a uniform distribution (see +:ref:`(Dunweg) ` for why this works). This is the same method +of noise generation as used in :doc:`fix_langevin `. + +If the *rng* keyword is used with the *gaussian* value, then the noise +is generated from a gaussian distribution. Typically this added +complexity is unnecessary, and one should be fine using the *uniform* +value for reasons argued in :ref:`(Dunweg) `. + +If the *rng* keyword is used with the *none* value, then the noise +terms are set to zero. + +If the *rotate_planar* keyword is used with the *yes* value, then only +two dimensional rotational diffusion occurs (i.e. only the z-component +of the angular momentum is non-zero). This option is only available to +2D simulations. + +If the *rotate_planar* keyword is used with the *no* value, then three +dimensional rotational diffusion occurs regardless of the simulation +dimension. + +---------- + +.. include:: accel_styles.rst + +---------- + +Restart, fix_modify, output, run start/stop, minimize info +""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +No information about this fix is written to :doc:`binary restart files `. +None of the :doc:`fix_modify ` options +are relevant to this fix. No global or per-atom quantities are stored +by this fix for access by various :doc:`output commands `. +No parameter of this fix can be used with the *start/stop* keywords of +the :doc:`run ` command. This fix is not invoked during +:doc:`energy minimization `. + +Restrictions +"""""""""""" + +This fix requires that atoms store torque and angular velocity (omega) +as defined by the :doc:`atom_style sphere ` command. +They must also store a dipole moment as defined by the +:doc:`atom_style dipole ` command. + +All particles in the group must be finite-size spheres. They cannot +be point particles. + +Related commands +"""""""""""""""" + +:doc:`fix langevin `, :doc:`fix nve/sphere `, +:doc:`atom style ` + +Default +""""""" + +The default for *rng* is *uniform* and the default for *rotate_planar* +is *no*. + +---------- + +.. _GoldsteinCM: + +**(GoldsteinCM)** Goldstein, Poole, and Safko, Classical Mechanics, 3rd Ed. (2001). + +.. _GardinerC: + +**(GardinerC)** Gardiner, A Handbook for the Natural and Social Sciences 4th Ed. (2009). + +.. _Callegari1: + +**(Callegari1)** Callegari and Volpe, *Numerical Simulations of Active Brownian +Particles*, Flowing Matter, 211-238 (2019). + +.. _Dunweg1: + +**(Dunweg)** Dunweg and Paul, Int J of Modern Physics C, 2, 817-27 (1991). + + diff --git a/src/fix_bd_sphere.cpp b/src/fix_bd_sphere.cpp new file mode 100644 index 0000000000..a30e8150f6 --- /dev/null +++ b/src/fix_bd_sphere.cpp @@ -0,0 +1,264 @@ +/* ---------------------------------------------------------------------- + LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator + http://lammps.sandia.gov, Sandia National Laboratories + Steve Plimpton, sjplimp@sandia.gov + + Copyright (2003) Sandia Corporation. Under the terms of Contract + DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains + certain rights in this software. This software is distributed under + the GNU General Public License. + + See the README file in the top-level LAMMPS directory. +------------------------------------------------------------------------- */ + +/* ---------------------------------------------------------------------- + Originally modified from USER-CGDNA/fix_nve_dotc_langevin.cpp. + + Contributing author: Sam Cameron (University of Bristol) +------------------------------------------------------------------------- */ + +#include +#include +#include +#include "fix_bd_sphere.h" +#include "math_extra.h" +#include "atom.h" +#include "force.h" +#include "update.h" +#include "comm.h" +#include "domain.h" +#include "random_mars.h" +#include "memory.h" +#include "error.h" + +using namespace LAMMPS_NS; +using namespace FixConst; + +/* ---------------------------------------------------------------------- */ + +FixBdSphere::FixBdSphere(LAMMPS *lmp, int narg, char **arg) : + Fix(lmp, narg, arg) +{ + time_integrate = 1; + + if (narg != 8 && narg != 10 && narg != 12) + error->all(FLERR,"Illegal fix bd/sphere command."); + + if (!atom->sphere_flag) + error->all(FLERR,"Fix bd/sphere requires atom style sphere"); + if (!atom->mu_flag) + error->all(FLERR,"Fix bd/sphere requires atom attribute mu"); + + gamma_t = force->numeric(FLERR,arg[3]); + if (gamma_t <= 0.0) + error->all(FLERR,"Fix bd/sphere translational viscous drag " + "coefficient must be > 0."); + + gamma_r = force->numeric(FLERR,arg[4]); + if (gamma_t <= 0.0) + error->all(FLERR,"Fix bd/sphere rotational viscous drag " + "coefficient must be > 0."); + + diff_t = force->numeric(FLERR,arg[5]); + if (diff_t <= 0.0) + error->all(FLERR,"Fix bd/sphere translational diffusion " + "coefficient must be > 0."); + + diff_r = force->numeric(FLERR,arg[6]); + if (diff_r <= 0.0) + error->all(FLERR,"Fix bd/sphere rotational diffusion " + "coefficient must be > 0."); + + seed = force->inumeric(FLERR,arg[7]); + if (seed <= 0) error->all(FLERR,"Fix bd/sphere seed must be > 0."); + + noise_flag = 1; + gaussian_noise_flag = 0; + rotate_planar_flag = 0; + + int iarg == 8; + + while (iarg < narg) { + if (strcmp(arg[iarg],"rng") == 0) { + if (strcmp(arg[iarg + 1],"uniform") == 0) { + noise_flag = 1; + } else if (strcmp(arg[iarg + 1],"gaussian") == 0) { + noise_flag = 1; + gaussian_noise_flag = 1; + } else if (strcmp(arg[iarg + 1],"none") == 0) { + noise_flag = 0; + } else { + error->all(FLERR,"Illegal fix/bd/sphere command."); + } + } else if (strcmp(arg[iarg],"rotate_planar") == 0) { + + if (strcmp(arg[iarg + 1],"yes") == 0) { + rotate_planar_flag = 1; + if (domain->dimension != 2) { + error->all(FLERR,"Cannot constrain rotational degrees of freedom " + "to the xy plane if the simulation is in 3D " + "(in fix/bd/sphere)."); + } + } else if (strcmp(arg[iarg + 1],"no") == 0) { + rotate_planar_flag = 0; + } else { + error->all(FLERR,"Illegal fix/bd/sphere command."); + } + } else { + error->all(FLERR,"Illegal fix/bd/sphere command."); + } + iarg = iarg + 2; + } + + + // initialize Marsaglia RNG with processor-unique seed + random = new RanMars(lmp,seed + comm->me); + + +} + +/* ---------------------------------------------------------------------- */ + +int FixBdSphere::setmask() +{ + int mask = 0; + mask |= INITIAL_INTEGRATE; + return mask; +} + +/* ---------------------------------------------------------------------- */ + +FixBdSphere::~FixBdSphere() +{ + + delete random; + +} + + +/* ---------------------------------------------------------------------- */ + +void FixBdSphere::init() +{ + + g1 = force->ftm2v/gamma_t; + g3 = force->ftm2v/gamma_r; + if (noise_flag == 0) { + g2 = 0; + g4 = 0; + rng_func = &RanMars::zero_rng; + } else if (gaussian_noise_flag == 1) { + g2 = sqrt(2 * diff_t); + g4 = sqrt(2 * diff_r); + rng_func = &RanMars::gaussian; + } else { + g2 = sqrt( 24 * diff_t); + g4 = sqrt( 24 * diff_r ); + rng_func = &RanMars::uniform_middle; + } + + if (domain->dimension == 2 && rotate_planar_flag == 0) { + error->warning(FLERR,"Using a 2D simulation, but allowing for " + "full (3D) rotation (in fix/bd/sphere)."); + } + + +} + +/* ---------------------------------------------------------------------- */ + +void FixBdSphere::initial_integrate(int /* vflag */) +{ + double **x = atom->x; + double **v = atom->v; + double **mu = atom->mu; + double **f = atom->f; + double **omega = atom->omega; + int *mask = atom->mask; + int nlocal = atom->nlocal; + double dx,dy,dz; + double dtheta; + double mux,muy,muz,mu_tmp,wx,wy,wz; + double prefac_1, prefac_2; + + if (igroup == atom->firstgroup) nlocal = atom->nfirst; + + // set timestep here since dt may have changed + dt = update->dt; + sqrtdt = sqrt(dt); + + int d3rot; // whether to compute angular momentum in xy plane + + if (rotate_planar_flag) { + d3rot = 0; + } else { + d3rot = 1; + } + + + for (int i = 0; i < nlocal; i++) { + if (mask[i] & groupbit) { + + dx = (dt * g1 * f[i][0] + + sqrtdt * g2 * (random->*rng_func)()); + x[i][0] += dx; + v[i][0] = dx/dt; + dy = (dt * g1 * f[i][1] + + sqrtdt * g2 * (random->*rng_func)()); + x[i][1] += dy; + v[i][1] = dy/dt; + + dz = (dt * g1 * f[i][2] + + sqrtdt * g2 * (random->*rng_func)()); + x[i][2] += dz; + v[i][2] = dz/dt; + + + omega[i][0] = d3rot*(g3* torque[i][0] + + g4 * (random->*rng_func)()/sqrtdt); + omega[i][1] = d3rot*(g3* torque[i][1] + + g4 * (random->*rng_func)()/sqrtdt); + omega[i][2] = (g3* torque[i][2] + + g4 * (random->*rng_func)()/sqrtdt); + + dtheta = sqrt((omega[i][0]*dt)**2+(omega[i][1]*dt)**2+(omega[i][2]*dt)**2); + + if (abs(dtheta) < 1e-14) { + prefac_1 = dt; + prefac_2 = 0.5*dt*dt; + } else { + prefac_1 = dt*sin(dtheta)/dtheta; + prefac_2 = dt*dt*(1-cos(dtheta))/(dtheta*dtheta); + } + + mux = mu[i][0]; + muy = mu[i][1]; + muz = mu[i][2]; + + wx = omega[i][0]; + wy = omega[i][1]; + wz = omega[i][2]; + + mu[i][0] = (mux + prefac_1 * ( -wz*muy + wy*muz ) + + prefac_2 * ( -1*( wz*wz + wy*wy ) * mux + + ( wz*muz + wy*muy ) * wx)); + + mu[i][1] = (muy + prefac_1 * ( wz*mux - wx*muz ) + + prefac_2 * ( -1*(wz*wz + wx*wx) * muy + + ( wz*muz + wx*mux ) * wy)); + + mu[i][2] = (muz + prefac_1 * ( -wy*mux + wx*muy ) + + prefac_2 * ( -1*( wx*wx + wy*wy ) * muz + + ( wy*muy + wx*mux ) * wz)); + + mu_tmp = sqrt(mu[i][0]*mu[i][0]+mu[i][1]*mu[i][1]+mu[i][2]*mu[i][2]); + + mu[i][0] = mu[i][0]/mu_tmp; + mu[i][1] = mu[i][1]/mu_tmp; + mu[i][2] = mu[i][2]/mu_tmp; + + } + } + + return; +} diff --git a/src/fix_bd_sphere.h b/src/fix_bd_sphere.h new file mode 100644 index 0000000000..2777427bc8 --- /dev/null +++ b/src/fix_bd_sphere.h @@ -0,0 +1,104 @@ +/* -*- c++ -*- ---------------------------------------------------------- + LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator + http://lammps.sandia.gov, Sandia National Laboratories + Steve Plimpton, sjplimp@sandia.gov + + Copyright (2003) Sandia Corporation. Under the terms of Contract + DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains + certain rights in this software. This software is distributed under + the GNU General Public License. + + See the README file in the top-level LAMMPS directory. +------------------------------------------------------------------------- */ + +#ifdef FIX_CLASS + +FixStyle(bd/sphere,FixBdSphere) + +#else + +#ifndef LMP_FIX_BD_SPHERE_H +#define LMP_FIX_BD_SPHERE_H + +#include "fix_nve.h" + +namespace LAMMPS_NS { + +class FixBdSphere : public Fix { + public: + FixBdSphere(class LAMMPS *, int, char **); + virtual ~FixBdSphere(); + void init(); + void initial_integrate(int); + int setmask(); + + private: + typedef double (RanMars::*rng_member)(); + rng_member rng_func; // placeholder for RNG function + int seed; // RNG seed + + double dt, sqrtdt; // time step interval and its sqrt + + + double gamma_t,gamma_r; // translational and rotational damping params + double diff_t,diff_r; // translational and rotational diffusion coeffs + + double g1,g2, g3, g4; // prefactors in time stepping + int noise_flag; // 0/1 for noise off/on + int gaussian_noise_flag; // 0/1 for uniform/gaussian noise + int rotate_planar_flag; // 0/1 for 2D/3D rotational dof + +protected: + class RanMars *random; + + int activity_flag; +}; + +} +#endif +#endif + +/* ERROR/WARNING messages: + +E: Illegal fix bd/sphere command. + +Wrong number/type of input arguments. + +E: Compute bd/sphere requires atom style sphere + +Self-explanatory. + +E: Compute bd/sphere requires atom attribute mu + +Self-explanatory. + +E: Fix bd/sphere translational viscous drag coefficient must be > 0. + +Self-explanatory. + +E: Fix bd/sphere rotational viscous drag coefficient must be > 0. + +Self-explanatory. + +E: Fix bd/sphere translational diffusion coefficient must be > 0. + +Self-explanatory. + +E: Fix bd/sphere rotational diffusion coefficient must be > 0. + +Self-explanatory. + +E: Fix bd/sphere seed must be > 0. + +E: Cannot constrain rotational degrees of freedom + to the xy plane if the simulation is in 3D (in fix/bd/sphere). + +Self-explanatory. + +W: Using a 2D simulation, but allowing for full (3D) rotation + (in fix/bd/sphere). + +Self-explanatory. + + +*/ diff --git a/src/random_mars.cpp b/src/random_mars.cpp index 621d7d3008..f31a92624a 100644 --- a/src/random_mars.cpp +++ b/src/random_mars.cpp @@ -94,6 +94,22 @@ double RanMars::uniform() return uni; } +/* ---------------------------------------------------------------------- + uniform RN shifted to be symmetric about zero (for fix bd/sphere). +------------------------------------------------------------------------- */ +double RanMars::uniform_middle() +{ + return uniform()-0.5; +} + +/* ---------------------------------------------------------------------- + Return 0 (for fix/bd/sphere). +------------------------------------------------------------------------- */ +double RanMars::zero_rng() +{ + return 0.0; +} + /* ---------------------------------------------------------------------- gaussian RN ------------------------------------------------------------------------- */ diff --git a/src/random_mars.h b/src/random_mars.h index 1bcd16b051..7028ef54d2 100644 --- a/src/random_mars.h +++ b/src/random_mars.h @@ -23,6 +23,8 @@ class RanMars : protected Pointers { RanMars(class LAMMPS *, int); ~RanMars(); double uniform(); + double uniform_middle(); + double zero_rng(); double gaussian(); double gaussian(double mu, double sigma); double rayleigh(double sigma); From a7d2059d8610b7f259c7efb7f9ea8dc068ac4a3b Mon Sep 17 00:00:00 2001 From: Sam Cameron Date: Sat, 5 Dec 2020 09:33:15 +0000 Subject: [PATCH 02/22] Fixed some issues after initial testing. --- src/fix_bd_sphere.cpp | 23 +++++++++++++---------- src/fix_bd_sphere.h | 5 ++--- 2 files changed, 15 insertions(+), 13 deletions(-) diff --git a/src/fix_bd_sphere.cpp b/src/fix_bd_sphere.cpp index a30e8150f6..50f6964d6a 100644 --- a/src/fix_bd_sphere.cpp +++ b/src/fix_bd_sphere.cpp @@ -17,10 +17,10 @@ Contributing author: Sam Cameron (University of Bristol) ------------------------------------------------------------------------- */ -#include -#include -#include #include "fix_bd_sphere.h" + +#include +#include #include "math_extra.h" #include "atom.h" #include "force.h" @@ -49,34 +49,34 @@ FixBdSphere::FixBdSphere(LAMMPS *lmp, int narg, char **arg) : if (!atom->mu_flag) error->all(FLERR,"Fix bd/sphere requires atom attribute mu"); - gamma_t = force->numeric(FLERR,arg[3]); + gamma_t = utils::numeric(FLERR,arg[3],false,lmp); if (gamma_t <= 0.0) error->all(FLERR,"Fix bd/sphere translational viscous drag " "coefficient must be > 0."); - gamma_r = force->numeric(FLERR,arg[4]); + gamma_r = utils::numeric(FLERR,arg[4],false,lmp); if (gamma_t <= 0.0) error->all(FLERR,"Fix bd/sphere rotational viscous drag " "coefficient must be > 0."); - diff_t = force->numeric(FLERR,arg[5]); + diff_t = utils::numeric(FLERR,arg[5],false,lmp); if (diff_t <= 0.0) error->all(FLERR,"Fix bd/sphere translational diffusion " "coefficient must be > 0."); - diff_r = force->numeric(FLERR,arg[6]); + diff_r = utils::numeric(FLERR,arg[6],false,lmp); if (diff_r <= 0.0) error->all(FLERR,"Fix bd/sphere rotational diffusion " "coefficient must be > 0."); - seed = force->inumeric(FLERR,arg[7]); + seed = utils::inumeric(FLERR,arg[7],false,lmp); if (seed <= 0) error->all(FLERR,"Fix bd/sphere seed must be > 0."); noise_flag = 1; gaussian_noise_flag = 0; rotate_planar_flag = 0; - int iarg == 8; + int iarg = 8; while (iarg < narg) { if (strcmp(arg[iarg],"rng") == 0) { @@ -174,6 +174,7 @@ void FixBdSphere::initial_integrate(int /* vflag */) double **mu = atom->mu; double **f = atom->f; double **omega = atom->omega; + double **torque = atom->torque; int *mask = atom->mask; int nlocal = atom->nlocal; double dx,dy,dz; @@ -221,7 +222,9 @@ void FixBdSphere::initial_integrate(int /* vflag */) omega[i][2] = (g3* torque[i][2] + g4 * (random->*rng_func)()/sqrtdt); - dtheta = sqrt((omega[i][0]*dt)**2+(omega[i][1]*dt)**2+(omega[i][2]*dt)**2); + dtheta = sqrt((omega[i][0]*dt)*(omega[i][0]*dt) + +(omega[i][1]*dt)*(omega[i][1]*dt) + +(omega[i][2]*dt)*(omega[i][2]*dt)); if (abs(dtheta) < 1e-14) { prefac_1 = dt; diff --git a/src/fix_bd_sphere.h b/src/fix_bd_sphere.h index 2777427bc8..2188684db7 100644 --- a/src/fix_bd_sphere.h +++ b/src/fix_bd_sphere.h @@ -33,8 +33,6 @@ class FixBdSphere : public Fix { int setmask(); private: - typedef double (RanMars::*rng_member)(); - rng_member rng_func; // placeholder for RNG function int seed; // RNG seed double dt, sqrtdt; // time step interval and its sqrt @@ -50,8 +48,9 @@ class FixBdSphere : public Fix { protected: class RanMars *random; + typedef double (RanMars::*rng_member)(); + rng_member rng_func; // placeholder for RNG function - int activity_flag; }; } From 3c918029f0d1b1e753702ad82a3faef61e861e51 Mon Sep 17 00:00:00 2001 From: Sam Cameron Date: Sun, 6 Dec 2020 19:23:15 +0000 Subject: [PATCH 03/22] Added virial flag to fix_bd_sphere. --- doc/src/fix_bd_sphere.rst | 34 +++++------ src/fix_bd_sphere.cpp | 120 +++++++++++++++++++++++++------------- src/fix_bd_sphere.h | 5 +- 3 files changed, 98 insertions(+), 61 deletions(-) diff --git a/doc/src/fix_bd_sphere.rst b/doc/src/fix_bd_sphere.rst index 2ab184e4fb..013d0604bb 100644 --- a/doc/src/fix_bd_sphere.rst +++ b/doc/src/fix_bd_sphere.rst @@ -17,7 +17,7 @@ Syntax * diff_t = translational diffusion coefficient * diff_r = rotational diffusion coefficient * zero or more keyword/value pairs may be appended -* keyword = *rng* or *rotate_planar* +* keyword = *rng* .. parsed-literal:: @@ -25,9 +25,6 @@ Syntax uniform = use uniform random number generator gaussian = use gaussian random number generator none = turn off noise - *rotate_planar* arg = *yes* or *no* - yes = only allow rotations in 2D plane (2D simulation only) - no = allow for full 3D rotations Examples """""""" @@ -36,8 +33,8 @@ Examples fix 1 all bd/sphere 1.0 1.0 1.0 1.0 1294019 fix 1 all bd/sphere 1.0 1.0 1.0 1.0 19581092 rng none - fix 1 all bd/sphere 1.0 1.0 1.0 1.0 19581092 rotate_planar yes - fix 1 all bd/sphere 1.0 1.0 1.0 1.0 19581092 rotate_planar no rng gaussian + fix 1 all bd/sphere 1.0 1.0 1.0 1.0 19581092 rng uniform + fix 1 all bd/sphere 1.0 1.0 1.0 1.0 19581092 rng gaussian Description @@ -70,6 +67,12 @@ the :math:`\omega` axis, and infinitesimal rotation matrix (see e.g. :ref:`(Callegari1) `, section 7.4). +The :doc:`fix_modify ` *virial* option is supported by this +fix to add the contribution due to the added forces on atoms to the +system's virial as part of :doc:`thermodynamic output `. +The default is *virial no* + + IMPORTANT NOTE: This integrator is designed for generic non-equilibrium simulations with additive noise. There are two important cases which (conceptually) reduce the number of free parameters in this fix. @@ -84,6 +87,13 @@ accounted for (e.g. by setting *gamma_t* to 3 and *gamma_r* to 1) where If both (a) and (b) are true, then one must ensure this explicitly via the above relationships. +IMPORTANT NOTE: The diffusion coefficient :math:`D_t` is measured +in units of (length*length)/time and the diffusion coefficient +:math:`D_r` is measured in units of 1/time, where time and length +are in the units specified on the :doc:`units ` page. Similarly, +:math:`\gamma_t` and :math:`\gamma_r` are measured in +units of mass/time and (mass*length*length)/(time). + If the *rng* keyword is used with the *uniform* value, then the noise is generated from a uniform distribution (see :ref:`(Dunweg) ` for why this works). This is the same method @@ -97,15 +107,6 @@ value for reasons argued in :ref:`(Dunweg) `. If the *rng* keyword is used with the *none* value, then the noise terms are set to zero. -If the *rotate_planar* keyword is used with the *yes* value, then only -two dimensional rotational diffusion occurs (i.e. only the z-component -of the angular momentum is non-zero). This option is only available to -2D simulations. - -If the *rotate_planar* keyword is used with the *no* value, then three -dimensional rotational diffusion occurs regardless of the simulation -dimension. - ---------- .. include:: accel_styles.rst @@ -143,8 +144,7 @@ Related commands Default """"""" -The default for *rng* is *uniform* and the default for *rotate_planar* -is *no*. +The default for *rng* is *uniform*. ---------- diff --git a/src/fix_bd_sphere.cpp b/src/fix_bd_sphere.cpp index 50f6964d6a..3a8a0811b9 100644 --- a/src/fix_bd_sphere.cpp +++ b/src/fix_bd_sphere.cpp @@ -31,6 +31,7 @@ #include "memory.h" #include "error.h" + using namespace LAMMPS_NS; using namespace FixConst; @@ -39,9 +40,11 @@ using namespace FixConst; FixBdSphere::FixBdSphere(LAMMPS *lmp, int narg, char **arg) : Fix(lmp, narg, arg) { + virial_flag = 1; + time_integrate = 1; - if (narg != 8 && narg != 10 && narg != 12) + if (narg != 8 && narg != 10) error->all(FLERR,"Illegal fix bd/sphere command."); if (!atom->sphere_flag) @@ -59,6 +62,7 @@ FixBdSphere::FixBdSphere(LAMMPS *lmp, int narg, char **arg) : error->all(FLERR,"Fix bd/sphere rotational viscous drag " "coefficient must be > 0."); + // note that diffusion is in units of epsilon**2*tau**3/(m**2*sigma**2) diff_t = utils::numeric(FLERR,arg[5],false,lmp); if (diff_t <= 0.0) error->all(FLERR,"Fix bd/sphere translational diffusion " @@ -74,7 +78,6 @@ FixBdSphere::FixBdSphere(LAMMPS *lmp, int narg, char **arg) : noise_flag = 1; gaussian_noise_flag = 0; - rotate_planar_flag = 0; int iarg = 8; @@ -90,20 +93,6 @@ FixBdSphere::FixBdSphere(LAMMPS *lmp, int narg, char **arg) : } else { error->all(FLERR,"Illegal fix/bd/sphere command."); } - } else if (strcmp(arg[iarg],"rotate_planar") == 0) { - - if (strcmp(arg[iarg + 1],"yes") == 0) { - rotate_planar_flag = 1; - if (domain->dimension != 2) { - error->all(FLERR,"Cannot constrain rotational degrees of freedom " - "to the xy plane if the simulation is in 3D " - "(in fix/bd/sphere)."); - } - } else if (strcmp(arg[iarg + 1],"no") == 0) { - rotate_planar_flag = 0; - } else { - error->all(FLERR,"Illegal fix/bd/sphere command."); - } } else { error->all(FLERR,"Illegal fix/bd/sphere command."); } @@ -123,6 +112,7 @@ int FixBdSphere::setmask() { int mask = 0; mask |= INITIAL_INTEGRATE; + mask |= POST_FORCE; return mask; } @@ -136,11 +126,13 @@ FixBdSphere::~FixBdSphere() } + /* ---------------------------------------------------------------------- */ void FixBdSphere::init() { + g1 = force->ftm2v/gamma_t; g3 = force->ftm2v/gamma_r; if (noise_flag == 0) { @@ -148,21 +140,22 @@ void FixBdSphere::init() g4 = 0; rng_func = &RanMars::zero_rng; } else if (gaussian_noise_flag == 1) { - g2 = sqrt(2 * diff_t); - g4 = sqrt(2 * diff_r); + g2 = gamma_t*sqrt(2 * diff_t)/force->ftm2v; + g4 = gamma_r*sqrt(2 * diff_r)/force->ftm2v; rng_func = &RanMars::gaussian; } else { - g2 = sqrt( 24 * diff_t); - g4 = sqrt( 24 * diff_r ); + g2 = gamma_t*sqrt( 24 * diff_t)/force->ftm2v; + g4 = gamma_r*sqrt( 24 * diff_r )/force->ftm2v; rng_func = &RanMars::uniform_middle; } - if (domain->dimension == 2 && rotate_planar_flag == 0) { - error->warning(FLERR,"Using a 2D simulation, but allowing for " - "full (3D) rotation (in fix/bd/sphere)."); - } + dt = update->dt; + sqrtdt = sqrt(dt); +} - +void FixBdSphere::setup(int vflag) +{ + post_force(vflag); } /* ---------------------------------------------------------------------- */ @@ -181,16 +174,15 @@ void FixBdSphere::initial_integrate(int /* vflag */) double dtheta; double mux,muy,muz,mu_tmp,wx,wy,wz; double prefac_1, prefac_2; - + if (igroup == atom->firstgroup) nlocal = atom->nfirst; - // set timestep here since dt may have changed + int d3rot; // whether to compute angular momentum in xy plane + dt = update->dt; sqrtdt = sqrt(dt); - - int d3rot; // whether to compute angular momentum in xy plane - if (rotate_planar_flag) { + if (domain->dimension==2) { d3rot = 0; } else { d3rot = 1; @@ -200,27 +192,22 @@ void FixBdSphere::initial_integrate(int /* vflag */) for (int i = 0; i < nlocal; i++) { if (mask[i] & groupbit) { - dx = (dt * g1 * f[i][0] - + sqrtdt * g2 * (random->*rng_func)()); + dx = dt * g1 * f[i][0]; x[i][0] += dx; v[i][0] = dx/dt; - dy = (dt * g1 * f[i][1] - + sqrtdt * g2 * (random->*rng_func)()); + + dy = dt * g1 * f[i][1]; x[i][1] += dy; v[i][1] = dy/dt; - dz = (dt * g1 * f[i][2] - + sqrtdt * g2 * (random->*rng_func)()); + dz = dt * g1 * f[i][2]; x[i][2] += dz; v[i][2] = dz/dt; - omega[i][0] = d3rot*(g3* torque[i][0] - + g4 * (random->*rng_func)()/sqrtdt); - omega[i][1] = d3rot*(g3* torque[i][1] - + g4 * (random->*rng_func)()/sqrtdt); - omega[i][2] = (g3* torque[i][2] - + g4 * (random->*rng_func)()/sqrtdt); + omega[i][0] = d3rot * g3* torque[i][0]; + omega[i][1] = d3rot * g3* torque[i][1]; + omega[i][2] = g3* torque[i][2]; dtheta = sqrt((omega[i][0]*dt)*(omega[i][0]*dt) +(omega[i][1]*dt)*(omega[i][1]*dt) @@ -265,3 +252,52 @@ void FixBdSphere::initial_integrate(int /* vflag */) return; } + +/* ---------------------------------------------------------------------- + apply random force, stolen from MISC/fix_efield.cpp +------------------------------------------------------------------------- */ + +void FixBdSphere::post_force(int vflag) +{ + double **f = atom->f; + double **x = atom->x; + double **torque = atom->torque; + int *mask = atom->mask; + imageint *image = atom->image; + int nlocal = atom->nlocal; + + // virial setup + + if (vflag) v_setup(vflag); + else evflag = 0; + + + + double fx,fy,fz; + double v[6]; + + for (int i = 0; i < nlocal; i++) + if (mask[i] & groupbit) { + + fx = g2 * (random->*rng_func)()/sqrtdt; + fy = g2 * (random->*rng_func)()/sqrtdt; + fz = g2 * (random->*rng_func)()/sqrtdt; + f[i][0] += fx; + f[i][1] += fy; + f[i][2] += fz; + + torque[i][0] = g4*(random->*rng_func)()/sqrtdt; + torque[i][1] = g4*(random->*rng_func)()/sqrtdt; + torque[i][2] = g4*(random->*rng_func)()/sqrtdt; + + if (evflag) { + v[0] = fx*x[i][0]; + v[1] = fy*x[i][1]; + v[2] = fz*x[i][2]; + v[3] = fx*x[i][1]; + v[4] = fx*x[i][2]; + v[5] = fy*x[i][2]; + v_tally(i, v); + } + } +} diff --git a/src/fix_bd_sphere.h b/src/fix_bd_sphere.h index 2188684db7..873ba9ef2a 100644 --- a/src/fix_bd_sphere.h +++ b/src/fix_bd_sphere.h @@ -20,7 +20,7 @@ FixStyle(bd/sphere,FixBdSphere) #ifndef LMP_FIX_BD_SPHERE_H #define LMP_FIX_BD_SPHERE_H -#include "fix_nve.h" +#include "fix.h" namespace LAMMPS_NS { @@ -30,6 +30,8 @@ class FixBdSphere : public Fix { virtual ~FixBdSphere(); void init(); void initial_integrate(int); + void setup(int); + void post_force(int); int setmask(); private: @@ -44,7 +46,6 @@ class FixBdSphere : public Fix { double g1,g2, g3, g4; // prefactors in time stepping int noise_flag; // 0/1 for noise off/on int gaussian_noise_flag; // 0/1 for uniform/gaussian noise - int rotate_planar_flag; // 0/1 for 2D/3D rotational dof protected: class RanMars *random; From 9848492d93657617efe0caa18afd5bdecac3a5cc Mon Sep 17 00:00:00 2001 From: Sam Cameron Date: Tue, 8 Dec 2020 11:16:42 +0000 Subject: [PATCH 04/22] Added example input scripts for fix_bd_sphere code. --- examples/bd_sphere/README.txt | 22 ++ examples/bd_sphere/in2d.bd | 76 +++++ examples/bd_sphere/in3d_virial_on.bd | 77 ++++++ .../log_gaussian_4_1_7_13_2d.lammps.log | 259 ++++++++++++++++++ .../log_uniform_10_1_5_15_3d.lammps.log | 259 ++++++++++++++++++ 5 files changed, 693 insertions(+) create mode 100644 examples/bd_sphere/README.txt create mode 100644 examples/bd_sphere/in2d.bd create mode 100644 examples/bd_sphere/in3d_virial_on.bd create mode 100644 examples/bd_sphere/log_gaussian_4_1_7_13_2d.lammps.log create mode 100644 examples/bd_sphere/log_uniform_10_1_5_15_3d.lammps.log diff --git a/examples/bd_sphere/README.txt b/examples/bd_sphere/README.txt new file mode 100644 index 0000000000..b044f11edc --- /dev/null +++ b/examples/bd_sphere/README.txt @@ -0,0 +1,22 @@ +The input file in2d.bd demonstrates how to run a 2d simulation +of particles undergoing overdamped brownian motion in both +translational and rotational degrees of freedom. + +The input file in3d_virial_on.bd demonstrates how to run a +similar simulation but in 3d. In this case, the virial +contribution of the brownian dynamics (the sum +sum_i /(3*volume) where W is +a random variable with mean 0 and variance dt) is +calculated via the fix_modify command. For long +enough times, this will be equal to rho*D_t*gamma_t +(the ideal gas term in equilibrium systems). + +To confirm rotational diffusion is working correctly, +run the above simulations with dump files on and +measure \sum_i, and one should +find that this decays as an exponential with +timescale 1/((d-1)*D_r). + +Note that both of the simulations above are not long +enough to get good statistics on e.g. ideal gas +pressure, rotational diffusion, or translational diffusion. diff --git a/examples/bd_sphere/in2d.bd b/examples/bd_sphere/in2d.bd new file mode 100644 index 0000000000..c11381ad5a --- /dev/null +++ b/examples/bd_sphere/in2d.bd @@ -0,0 +1,76 @@ +# 2d overdamped brownian dynamics + +variable rng string gaussian +variable gamma_t equal 4.0 +variable gamma_r equal 1.0 +variable D_t equal 7.0 +variable D_r equal 13.0 +variable seed equal 1974019 + + +variable params string ${rng}_${gamma_t}_${gamma_r}_${D_t}_${D_r} + + +log log_${params}_2d.lammps.log +units lj +atom_style hybrid dipole sphere +dimension 2 +newton off + + +lattice sq 0.4 +region box block -16 16 -16 16 -0.2 0.2 +create_box 1 box +create_atoms 1 box +mass * 1.0 +set type * dipole/random ${seed} 1.0 +velocity all create 1.0 1 loop geom + + +neighbor 1.0 bin +neigh_modify every 1 delay 1 check yes + + + +pair_style none + + + +#compute d all property/atom mux muy muz + +fix 1 all bd/sphere ${gamma_t} ${gamma_r} ${D_t} ${D_r} ${seed} rng ${rng} +fix 2 all enforce2d + +compute press all pressure NULL virial + +thermo_style custom step temp epair c_press + +#equilibration +timestep 0.0000000001 +thermo 50001 +run 50000 +reset_timestep 0 + + +#initialisation for the main run + +# MSD +compute msd all msd + + +thermo_style custom step temp epair c_msd[*] c_press + + +# write trajectory and thermo in a log-scale frequency +# uncomment next three lines for dump output +#dump 1 all custom 2000 dump_${params}_2d.lammpstrj id type & +# x y xu yu mux muy muz fx fy fz +#dump_modify 1 first yes sort id + +timestep 0.00001 +thermo 1000 + +# main run +run 120000 + + diff --git a/examples/bd_sphere/in3d_virial_on.bd b/examples/bd_sphere/in3d_virial_on.bd new file mode 100644 index 0000000000..1ef88930c1 --- /dev/null +++ b/examples/bd_sphere/in3d_virial_on.bd @@ -0,0 +1,77 @@ +# 3d overdamped brownian dynamics + + +variable rng string uniform +variable gamma_t equal 10.0 +variable gamma_r equal 1.0 +variable D_t equal 5.0 +variable D_r equal 15.0 +variable seed equal 553910 + + +variable params string ${rng}_${gamma_t}_${gamma_r}_${D_t}_${D_r} + + +log log_${params}_3d.lammps.log +units lj +atom_style hybrid dipole sphere +dimension 3 +newton off + + +lattice sc 0.4 +region box block -8 8 -8 8 -8 8 +create_box 1 box +create_atoms 1 box +mass * 1.0 +set type * dipole/random ${seed} 1.0 +velocity all create 1.0 1 loop geom + + +neighbor 1.0 bin +neigh_modify every 1 delay 1 check yes + + + +pair_style none + + + +#compute d all property/atom mux muy muz + +fix 1 all bd/sphere ${gamma_t} ${gamma_r} ${D_t} ${D_r} ${seed} rng ${rng} +fix_modify 1 virial yes + +compute press all pressure NULL virial + +thermo_style custom step temp epair c_press + +#equilibration +timestep 0.0000000001 +thermo 50001 +run 50000 +reset_timestep 0 + + +#initialisation for the main run + +# MSD +compute msd all msd + + +thermo_style custom step temp epair c_msd[*] c_press + + +# write trajectory and thermo in a log-scale frequency +# uncomment the next three lines for dump file +#dump 1 all custom 10000 dump_${params}_3d.lammpstrj id type & +# x y xu yu mux muy muz fx fy fz +#dump_modify 1 first yes sort id + +timestep 0.00001 +thermo 1000 + +# main run +run 120000 + + diff --git a/examples/bd_sphere/log_gaussian_4_1_7_13_2d.lammps.log b/examples/bd_sphere/log_gaussian_4_1_7_13_2d.lammps.log new file mode 100644 index 0000000000..72b90efe0e --- /dev/null +++ b/examples/bd_sphere/log_gaussian_4_1_7_13_2d.lammps.log @@ -0,0 +1,259 @@ +units lj +atom_style hybrid dipole sphere +WARNING: Atom_style hybrid defines both pertype and peratom masses - both must be set, only peratom masses will be used (src/atom_vec_hybrid.cpp:157) +dimension 2 +newton off + + +lattice sq 0.4 +Lattice spacing in x,y,z = 1.5811388 1.5811388 1.5811388 +region box block -16 16 -16 16 -0.2 0.2 +create_box 1 box +Created orthogonal box = (-25.298221 -25.298221 -0.31622777) to (25.298221 25.298221 0.31622777) + 1 by 1 by 1 MPI processor grid +create_atoms 1 box +Created 1024 atoms + create_atoms CPU = 0.002 seconds +mass * 1.0 +set type * dipole/random ${seed} 1.0 +set type * dipole/random 1974019 1.0 +Setting atom values ... + 1024 settings made for dipole/random +velocity all create 1.0 1 loop geom + + +neighbor 1.0 bin +neigh_modify every 1 delay 1 check yes + + + +pair_style none + + + +#compute d all property/atom mux muy muz + +fix 1 all bd/sphere ${gamma_t} ${gamma_r} ${D_t} ${D_r} ${seed} rng ${rng} +fix 1 all bd/sphere 4 ${gamma_r} ${D_t} ${D_r} ${seed} rng ${rng} +fix 1 all bd/sphere 4 1 ${D_t} ${D_r} ${seed} rng ${rng} +fix 1 all bd/sphere 4 1 7 ${D_r} ${seed} rng ${rng} +fix 1 all bd/sphere 4 1 7 13 ${seed} rng ${rng} +fix 1 all bd/sphere 4 1 7 13 1974019 rng ${rng} +fix 1 all bd/sphere 4 1 7 13 1974019 rng gaussian +fix 2 all enforce2d + +compute press all pressure NULL virial + +thermo_style custom step temp epair c_press + +#equilibration +timestep 0.0000000001 +thermo 50001 +run 50000 +WARNING: No pairwise cutoff or binsize set. Atom sorting therefore disabled. (src/atom.cpp:2118) +WARNING: Communication cutoff is 0.0. No ghost atoms will be generated. Atoms may get lost. (src/comm_brick.cpp:167) +Per MPI rank memory allocation (min/avg/max) = 4.289 | 4.289 | 4.289 Mbytes +Step Temp E_pair c_press + 0 1 0 0 + 50000 7.3671759e+10 0 0 +Loop time of 10.2295 on 1 procs for 50000 steps with 1024 atoms + +Performance: 0.042 tau/day, 4887.825 timesteps/s +100.0% CPU use with 1 MPI tasks x 1 OpenMP threads + +MPI task timing breakdown: +Section | min time | avg time | max time |%varavg| %total +--------------------------------------------------------------- +Pair | 0 | 0 | 0 | 0.0 | 0.00 +Neigh | 0 | 0 | 0 | 0.0 | 0.00 +Comm | 0.033217 | 0.033217 | 0.033217 | 0.0 | 0.32 +Output | 2.1435e-05 | 2.1435e-05 | 2.1435e-05 | 0.0 | 0.00 +Modify | 10.047 | 10.047 | 10.047 | 0.0 | 98.21 +Other | | 0.1497 | | | 1.46 + +Nlocal: 1024.00 ave 1024 max 1024 min +Histogram: 1 0 0 0 0 0 0 0 0 0 +Nghost: 65.0000 ave 65 max 65 min +Histogram: 1 0 0 0 0 0 0 0 0 0 +Neighs: 0.00000 ave 0 max 0 min +Histogram: 1 0 0 0 0 0 0 0 0 0 + +Total # of neighbors = 0 +Ave neighs/atom = 0.0000000 +Neighbor list builds = 0 +Dangerous builds = 0 +reset_timestep 0 + + +#initialisation for the main run + +# MSD +compute msd all msd + + +thermo_style custom step temp epair c_msd[*] c_press + + +# write trajectory and thermo in a log-scale frequency +# uncomment next three lines for dump output +#dump 1 all custom 2000 dump_${params}_2d.lammpstrj id type # x y xu yu mux muy muz fx fy fz +#dump_modify 1 first yes sort id + +timestep 0.00001 +thermo 1000 + +# main run +run 120000 +WARNING: Communication cutoff is 0.0. No ghost atoms will be generated. Atoms may get lost. (src/comm_brick.cpp:167) +Per MPI rank memory allocation (min/avg/max) = 4.664 | 4.664 | 4.664 Mbytes +Step Temp E_pair c_msd[1] c_msd[2] c_msd[3] c_msd[4] c_press + 0 7.3671759e+10 0 0 0 0 0 0 + 1000 710744.42 0 0.1332856 0.13577642 0 0.26906203 0 + 2000 705025.5 0 0.27078701 0.27355073 0 0.54433774 0 + 3000 750845.29 0 0.41036556 0.39710766 0 0.80747321 0 + 4000 752542.47 0 0.53097803 0.53654063 0 1.0675187 0 + 5000 731812.26 0 0.66927129 0.65872533 0 1.3279966 0 + 6000 716119.24 0 0.79097615 0.76825364 0 1.5592298 0 + 7000 726294.28 0 0.93322099 0.91220222 0 1.8454232 0 + 8000 673771.54 0 1.0789689 1.031843 0 2.1108119 0 + 9000 757173.95 0 1.2328252 1.2024778 0 2.435303 0 + 10000 693711.95 0 1.3972184 1.3045575 0 2.7017759 0 + 11000 774897.65 0 1.584036 1.4168797 0 3.0009157 0 + 12000 764910.09 0 1.7344079 1.5751172 0 3.3095251 0 + 13000 752859.5 0 1.8538323 1.7336107 0 3.5874429 0 + 14000 746333.26 0 2.0392353 1.9027299 0 3.9419652 0 + 15000 735704.24 0 2.1714465 2.000952 0 4.1723985 0 + 16000 722768.01 0 2.258542 2.1084289 0 4.3669709 0 + 17000 741408.63 0 2.4194247 2.2469958 0 4.6664206 0 + 18000 713609.29 0 2.5366244 2.3325203 0 4.8691447 0 + 19000 770066.65 0 2.6662758 2.4726928 0 5.1389686 0 + 20000 739828.53 0 2.792873 2.6188232 0 5.4116962 0 + 21000 719478.96 0 2.9109491 2.7872008 0 5.6981499 0 + 22000 737448.77 0 3.0162218 2.9213733 0 5.9375951 0 + 23000 714695.3 0 3.1309486 3.0325142 0 6.1634628 0 + 24000 712386.78 0 3.31348 3.1323675 0 6.4458475 0 + 25000 747298.11 0 3.5148965 3.2978465 0 6.812743 0 + 26000 737240.19 0 3.7117818 3.4245004 0 7.1362822 0 + 27000 720878.36 0 3.8342853 3.5681829 0 7.4024682 0 + 28000 776824.55 0 3.9904931 3.6853691 0 7.6758622 0 + 29000 714696.4 0 4.0733919 3.8807741 0 7.954166 0 + 30000 725827.3 0 4.2213715 4.0552488 0 8.2766204 0 + 31000 737978.89 0 4.2918759 4.1795647 0 8.4714407 0 + 32000 766620.93 0 4.4620184 4.2765194 0 8.7385378 0 + 33000 714739.71 0 4.5942749 4.426881 0 9.0211559 0 + 34000 694821.06 0 4.686348 4.5057433 0 9.1920912 0 + 35000 721948.38 0 4.7526371 4.5689873 0 9.3216245 0 + 36000 713621.16 0 4.8645036 4.6355302 0 9.5000339 0 + 37000 704079.85 0 4.9652601 4.8235856 0 9.7888457 0 + 38000 706914.29 0 5.1045998 4.9585169 0 10.063117 0 + 39000 736940.33 0 5.2172626 5.1168713 0 10.334134 0 + 40000 738302.73 0 5.3720228 5.3207578 0 10.692781 0 + 41000 746518.85 0 5.5376524 5.5192708 0 11.056923 0 + 42000 719970.82 0 5.7610696 5.6335312 0 11.394601 0 + 43000 736875.87 0 5.8769052 5.7504356 0 11.627341 0 + 44000 765218.38 0 6.0308866 5.9650683 0 11.995955 0 + 45000 739382.69 0 6.1577029 6.0736304 0 12.231333 0 + 46000 730967.87 0 6.3846223 6.2090389 0 12.593661 0 + 47000 758881.95 0 6.5604053 6.3883315 0 12.948737 0 + 48000 751135.53 0 6.6160248 6.5199017 0 13.135926 0 + 49000 721058.97 0 6.6124519 6.6938253 0 13.306277 0 + 50000 686287.15 0 6.8527601 6.8518895 0 13.70465 0 + 51000 735175.7 0 6.9928329 6.8663476 0 13.85918 0 + 52000 760085.67 0 7.1009497 7.0345784 0 14.135528 0 + 53000 741211.89 0 7.2287282 7.2318431 0 14.460571 0 + 54000 723668.97 0 7.3732634 7.3847301 0 14.757994 0 + 55000 751846.88 0 7.5566634 7.4927365 0 15.0494 0 + 56000 762648.27 0 7.7651818 7.5379796 0 15.303161 0 + 57000 710175.2 0 7.9051989 7.6644542 0 15.569653 0 + 58000 740068.94 0 8.0296854 7.8307471 0 15.860433 0 + 59000 728119.43 0 8.1562433 8.039333 0 16.195576 0 + 60000 728768.48 0 8.316192 8.1643843 0 16.480576 0 + 61000 707538.83 0 8.3727565 8.3895027 0 16.762259 0 + 62000 713931.41 0 8.4657927 8.5517529 0 17.017546 0 + 63000 742604.95 0 8.6550684 8.7189851 0 17.374053 0 + 64000 738981.54 0 8.7331005 8.9208616 0 17.653962 0 + 65000 701685.87 0 8.898571 8.977933 0 17.876504 0 + 66000 716151.39 0 9.0229699 9.1292403 0 18.15221 0 + 67000 732641.29 0 9.151611 9.3249179 0 18.476529 0 + 68000 740870.85 0 9.233452 9.4667607 0 18.700213 0 + 69000 733159.17 0 9.1743719 9.5648134 0 18.739185 0 + 70000 693562.75 0 9.3414089 9.7425241 0 19.083933 0 + 71000 748694.53 0 9.5036102 9.8686571 0 19.372267 0 + 72000 721046.02 0 9.7116931 10.0195 0 19.731193 0 + 73000 736631.66 0 9.7095662 10.205306 0 19.914872 0 + 74000 751264.08 0 9.9413234 10.327844 0 20.269167 0 + 75000 729223.27 0 10.211903 10.412516 0 20.624419 0 + 76000 747811 0 10.332266 10.544251 0 20.876517 0 + 77000 717505.01 0 10.521195 10.737774 0 21.258969 0 + 78000 712288.89 0 10.712514 10.874932 0 21.587446 0 + 79000 728912.34 0 10.755227 10.968257 0 21.723484 0 + 80000 743505.67 0 11.026063 11.070234 0 22.096298 0 + 81000 732218.14 0 11.321417 11.31773 0 22.639147 0 + 82000 777186.61 0 11.480074 11.401465 0 22.881539 0 + 83000 734805.95 0 11.7524 11.62552 0 23.37792 0 + 84000 753703.38 0 11.863318 11.833925 0 23.697243 0 + 85000 755730.75 0 12.068564 11.937143 0 24.005707 0 + 86000 725021.19 0 12.258195 12.034586 0 24.292781 0 + 87000 731844.67 0 12.341844 12.331792 0 24.673636 0 + 88000 707368.15 0 12.431452 12.547314 0 24.978766 0 + 89000 784756.28 0 12.405699 12.686021 0 25.09172 0 + 90000 760278.97 0 12.542669 12.851925 0 25.394593 0 + 91000 753765.97 0 12.703534 13.08092 0 25.784454 0 + 92000 705869.22 0 12.971838 13.210092 0 26.18193 0 + 93000 741699.59 0 13.110745 13.383115 0 26.49386 0 + 94000 717372.41 0 13.252109 13.466388 0 26.718497 0 + 95000 721820.49 0 13.373146 13.660605 0 27.033751 0 + 96000 777409.97 0 13.596822 13.886961 0 27.483782 0 + 97000 741480.91 0 13.752545 14.204624 0 27.957169 0 + 98000 725755.72 0 13.918302 14.219292 0 28.137594 0 + 99000 729710.24 0 14.065417 14.213142 0 28.278559 0 + 100000 700366.74 0 14.278054 14.324135 0 28.602189 0 + 101000 722737.18 0 14.398464 14.46904 0 28.867505 0 + 102000 758930.85 0 14.408098 14.637964 0 29.046061 0 + 103000 725233.66 0 14.526482 14.719688 0 29.24617 0 + 104000 752416.52 0 14.641393 14.952087 0 29.59348 0 + 105000 769047.5 0 14.780788 15.182945 0 29.963733 0 + 106000 734849.98 0 14.840982 15.316112 0 30.157094 0 + 107000 720210.74 0 15.010029 15.372792 0 30.382821 0 + 108000 741216.55 0 15.113143 15.488575 0 30.601718 0 + 109000 714158.43 0 15.057499 15.592865 0 30.650364 0 + 110000 743262.25 0 15.381281 15.798368 0 31.179649 0 + 111000 728836.92 0 15.488226 16.034645 0 31.522871 0 + 112000 753490.67 0 15.679979 16.350819 0 32.030799 0 + 113000 730699.5 0 15.82813 16.680136 0 32.508266 0 + 114000 705526.22 0 16.099699 16.920095 0 33.019794 0 + 115000 752408.36 0 16.393466 17.053935 0 33.447401 0 + 116000 713697.16 0 16.634939 17.35349 0 33.98843 0 + 117000 690041.5 0 16.727379 17.457936 0 34.185315 0 + 118000 745594.37 0 16.838659 17.585392 0 34.424052 0 + 119000 714487.42 0 17.064214 17.743478 0 34.807692 0 + 120000 716557.14 0 17.105558 17.845925 0 34.951483 0 +Loop time of 25.2131 on 1 procs for 120000 steps with 1024 atoms + +Performance: 4112.144 tau/day, 4759.427 timesteps/s +99.9% CPU use with 1 MPI tasks x 1 OpenMP threads + +MPI task timing breakdown: +Section | min time | avg time | max time |%varavg| %total +--------------------------------------------------------------- +Pair | 0 | 0 | 0 | 0.0 | 0.00 +Neigh | 0.0016123 | 0.0016123 | 0.0016123 | 0.0 | 0.01 +Comm | 0.025898 | 0.025898 | 0.025898 | 0.0 | 0.10 +Output | 0.0037882 | 0.0037882 | 0.0037882 | 0.0 | 0.02 +Modify | 24.767 | 24.767 | 24.767 | 0.0 | 98.23 +Other | | 0.4146 | | | 1.64 + +Nlocal: 1024.00 ave 1024 max 1024 min +Histogram: 1 0 0 0 0 0 0 0 0 0 +Nghost: 0.00000 ave 0 max 0 min +Histogram: 1 0 0 0 0 0 0 0 0 0 +Neighs: 0.00000 ave 0 max 0 min +Histogram: 1 0 0 0 0 0 0 0 0 0 + +Total # of neighbors = 0 +Ave neighs/atom = 0.0000000 +Neighbor list builds = 1049 +Dangerous builds = 0 + + +Total wall time: 0:00:35 diff --git a/examples/bd_sphere/log_uniform_10_1_5_15_3d.lammps.log b/examples/bd_sphere/log_uniform_10_1_5_15_3d.lammps.log new file mode 100644 index 0000000000..fda48dc71a --- /dev/null +++ b/examples/bd_sphere/log_uniform_10_1_5_15_3d.lammps.log @@ -0,0 +1,259 @@ +units lj +atom_style hybrid dipole sphere +WARNING: Atom_style hybrid defines both pertype and peratom masses - both must be set, only peratom masses will be used (src/atom_vec_hybrid.cpp:157) +dimension 3 +newton off + + +lattice sc 0.4 +Lattice spacing in x,y,z = 1.3572088 1.3572088 1.3572088 +region box block -8 8 -8 8 -8 8 +create_box 1 box +Created orthogonal box = (-10.857670 -10.857670 -10.857670) to (10.857670 10.857670 10.857670) + 1 by 1 by 1 MPI processor grid +create_atoms 1 box +Created 4096 atoms + create_atoms CPU = 0.003 seconds +mass * 1.0 +set type * dipole/random ${seed} 1.0 +set type * dipole/random 553910 1.0 +Setting atom values ... + 4096 settings made for dipole/random +velocity all create 1.0 1 loop geom + + +neighbor 1.0 bin +neigh_modify every 1 delay 1 check yes + + + +pair_style none + + + +#compute d all property/atom mux muy muz + +fix 1 all bd/sphere ${gamma_t} ${gamma_r} ${D_t} ${D_r} ${seed} rng ${rng} +fix 1 all bd/sphere 10 ${gamma_r} ${D_t} ${D_r} ${seed} rng ${rng} +fix 1 all bd/sphere 10 1 ${D_t} ${D_r} ${seed} rng ${rng} +fix 1 all bd/sphere 10 1 5 ${D_r} ${seed} rng ${rng} +fix 1 all bd/sphere 10 1 5 15 ${seed} rng ${rng} +fix 1 all bd/sphere 10 1 5 15 553910 rng ${rng} +fix 1 all bd/sphere 10 1 5 15 553910 rng uniform +fix_modify 1 virial yes + +compute press all pressure NULL virial + +thermo_style custom step temp epair c_press + +#equilibration +timestep 0.0000000001 +thermo 50001 +run 50000 +WARNING: No pairwise cutoff or binsize set. Atom sorting therefore disabled. (src/atom.cpp:2118) +WARNING: Communication cutoff is 0.0. No ghost atoms will be generated. Atoms may get lost. (src/comm_brick.cpp:167) +Per MPI rank memory allocation (min/avg/max) = 4.362 | 4.362 | 4.362 Mbytes +Step Temp E_pair c_press + 0 1 0 -32553.271 + 50000 5.2351457e+10 0 -15026.42 +Loop time of 18.6303 on 1 procs for 50000 steps with 4096 atoms + +Performance: 0.023 tau/day, 2683.804 timesteps/s +100.0% CPU use with 1 MPI tasks x 1 OpenMP threads + +MPI task timing breakdown: +Section | min time | avg time | max time |%varavg| %total +--------------------------------------------------------------- +Pair | 0 | 0 | 0 | 0.0 | 0.00 +Neigh | 0 | 0 | 0 | 0.0 | 0.00 +Comm | 0.31439 | 0.31439 | 0.31439 | 0.0 | 1.69 +Output | 5.5046e-05 | 5.5046e-05 | 5.5046e-05 | 0.0 | 0.00 +Modify | 17.718 | 17.718 | 17.718 | 0.0 | 95.11 +Other | | 0.5974 | | | 3.21 + +Nlocal: 4096.00 ave 4096 max 4096 min +Histogram: 1 0 0 0 0 0 0 0 0 0 +Nghost: 817.000 ave 817 max 817 min +Histogram: 1 0 0 0 0 0 0 0 0 0 +Neighs: 0.00000 ave 0 max 0 min +Histogram: 1 0 0 0 0 0 0 0 0 0 + +Total # of neighbors = 0 +Ave neighs/atom = 0.0000000 +Neighbor list builds = 0 +Dangerous builds = 0 +reset_timestep 0 + + +#initialisation for the main run + +# MSD +compute msd all msd + + +thermo_style custom step temp epair c_msd[*] c_press + + +# write trajectory and thermo in a log-scale frequency +# uncomment the next three lines for dump file +#dump 1 all custom 10000 dump_${params}_3d.lammpstrj id type # x y xu yu mux muy muz fx fy fz +#dump_modify 1 first yes sort id + +timestep 0.00001 +thermo 1000 + +# main run +run 120000 +WARNING: Communication cutoff is 0.0. No ghost atoms will be generated. Atoms may get lost. (src/comm_brick.cpp:167) +Per MPI rank memory allocation (min/avg/max) = 4.737 | 4.737 | 4.737 Mbytes +Step Temp E_pair c_msd[1] c_msd[2] c_msd[3] c_msd[4] c_press + 0 5.2351457e+10 0 0 0 0 0 -233.83012 + 1000 522590.88 0 0.10259269 0.10487519 0.10391005 0.31137793 -13.730626 + 2000 521776.08 0 0.20662097 0.2118237 0.20371673 0.62216139 -141.90848 + 3000 529408.9 0 0.30711557 0.3105565 0.30293728 0.92060935 28.335187 + 4000 518069.42 0 0.39918073 0.40643835 0.40168024 1.2072993 -12.262269 + 5000 520487.75 0 0.50222348 0.50854461 0.50304351 1.5138116 303.56775 + 6000 527970.5 0 0.60443861 0.60363711 0.59884932 1.806925 218.55799 + 7000 519424.68 0 0.69529071 0.70025532 0.70347351 2.0990195 -363.51723 + 8000 521925.72 0 0.80545039 0.81520807 0.79930708 2.4199655 510.47732 + 9000 518397.28 0 0.91236827 0.9050426 0.89431985 2.7117307 537.74151 + 10000 525696.47 0 0.99494325 0.99433832 0.98574884 2.9750304 411.56896 + 11000 524505.88 0 1.0863677 1.1232636 1.0810609 3.2906921 32.652569 + 12000 525350.08 0 1.1816136 1.2412674 1.189996 3.612877 45.304061 + 13000 524598.12 0 1.2841566 1.3381915 1.2906249 3.912973 -376.50739 + 14000 525438.09 0 1.3964076 1.4420032 1.3915611 4.2299719 -31.273339 + 15000 523531.08 0 1.4829127 1.5436611 1.4892074 4.5157811 -357.26366 + 16000 532366.43 0 1.5871965 1.6432286 1.6020146 4.8324397 435.10667 + 17000 523629.21 0 1.6968632 1.7574539 1.6967316 5.1510487 280.59816 + 18000 521432.94 0 1.7973983 1.8462477 1.8087416 5.4523876 134.69384 + 19000 530778.78 0 1.888653 1.9328611 1.9268155 5.7483296 -64.346115 + 20000 525623.21 0 1.9718697 2.0048196 2.0068177 5.983507 73.884028 + 21000 524862.26 0 2.0414226 2.0967449 2.0878261 6.2259936 163.95173 + 22000 529123.04 0 2.143889 2.1850282 2.1972491 6.5261662 234.87793 + 23000 519629.76 0 2.2297952 2.2661611 2.2805197 6.776476 57.65702 + 24000 523746.18 0 2.3293654 2.3658544 2.3842082 7.079428 46.291089 + 25000 515851.07 0 2.4177426 2.4559274 2.5029961 7.3766661 -16.353546 + 26000 515592.59 0 2.5352044 2.5438918 2.5657776 7.6448738 -65.259248 + 27000 527764.96 0 2.6498176 2.6423592 2.6715377 7.9637146 324.48367 + 28000 527177.18 0 2.7405087 2.7431537 2.7702133 8.2538757 -47.906223 + 29000 521079.66 0 2.8294642 2.8410515 2.8546167 8.5251323 -135.36173 + 30000 526092.8 0 2.961898 2.9361476 2.9319586 8.8300042 206.28635 + 31000 529595.93 0 3.0638234 3.0128995 3.0434232 9.1201461 -35.946596 + 32000 521173.83 0 3.159344 3.1397814 3.1455147 9.4446401 328.73193 + 33000 522989.77 0 3.2567127 3.2348491 3.2444068 9.7359686 362.33435 + 34000 522930.45 0 3.3489514 3.3433962 3.3391822 10.03153 178.73773 + 35000 530664.64 0 3.4445399 3.4843743 3.4205275 10.349442 146.02898 + 36000 521443.26 0 3.520475 3.6171115 3.5179112 10.655498 244.07172 + 37000 529669.54 0 3.6076942 3.7233869 3.6169718 10.948053 79.46077 + 38000 527521.93 0 3.7093699 3.8275855 3.7451165 11.282072 -91.131074 + 39000 523237.65 0 3.8088585 3.9559041 3.8748751 11.639638 -70.265271 + 40000 522798.75 0 3.89319 4.0420406 3.9196106 11.854841 91.631855 + 41000 524228.77 0 3.9863379 4.1602581 4.0393136 12.18591 113.26515 + 42000 524546.08 0 4.0969366 4.2738786 4.1218115 12.492627 313.83957 + 43000 515948.22 0 4.2161418 4.3700009 4.2178962 12.804039 92.993253 + 44000 527319.42 0 4.3267431 4.4688062 4.3274029 13.122952 -118.91153 + 45000 526222.74 0 4.4289127 4.5531203 4.4604075 13.442441 -474.98113 + 46000 524617.54 0 4.5422968 4.6316235 4.5445894 13.71851 -303.23458 + 47000 524067.07 0 4.6284944 4.6989745 4.5884153 13.915884 -343.41107 + 48000 535659.25 0 4.7221068 4.7505302 4.7212887 14.193926 149.75872 + 49000 527425.65 0 4.8098179 4.8761354 4.8362998 14.522253 -272.18936 + 50000 516588.98 0 4.9077783 4.9950242 4.9826783 14.885481 -52.925733 + 51000 522291.86 0 5.0022325 5.0659091 5.0525647 15.120706 -52.985883 + 52000 530056.07 0 5.123751 5.1470734 5.1603805 15.431205 -231.29334 + 53000 525624.96 0 5.2412036 5.2543541 5.2717587 15.767316 294.19678 + 54000 524407.27 0 5.3530927 5.359043 5.342451 16.054587 -55.282671 + 55000 519989.37 0 5.4458173 5.4781678 5.413865 16.33785 -135.28414 + 56000 524987.68 0 5.5282178 5.5825979 5.5127172 16.623533 84.654044 + 57000 525610.66 0 5.6202713 5.6925409 5.5964466 16.909259 407.16526 + 58000 523097.93 0 5.7390671 5.7830376 5.6921201 17.214225 -271.05243 + 59000 525357.74 0 5.8037507 5.8654514 5.7920744 17.461276 -213.07815 + 60000 522185.96 0 5.9067925 5.9909357 5.903525 17.801253 330.09637 + 61000 527694.33 0 6.0576096 6.0907943 6.0202838 18.168688 310.22884 + 62000 522936.57 0 6.1422565 6.1888677 6.124212 18.455336 -24.591697 + 63000 526642.55 0 6.2261061 6.2832608 6.2023277 18.711695 -130.32823 + 64000 514826.49 0 6.3032614 6.3628539 6.3184362 18.984552 195.43036 + 65000 529338.23 0 6.4152502 6.4482512 6.4241507 19.287652 -77.817059 + 66000 527425.07 0 6.5122194 6.5052947 6.5518104 19.569324 8.0143425 + 67000 525258.85 0 6.6292334 6.6417881 6.6438938 19.914915 152.1905 + 68000 527067.89 0 6.7569918 6.6951219 6.7357134 20.187827 -337.54654 + 69000 522395.33 0 6.8401085 6.7836633 6.8243746 20.448146 34.755329 + 70000 522200.34 0 6.9549662 6.8773008 6.9537894 20.786056 352.30283 + 71000 527550.11 0 7.0441399 6.9837133 7.0860791 21.113932 171.42143 + 72000 529564.22 0 7.1744229 7.0581688 7.1507041 21.383296 269.04569 + 73000 524175.53 0 7.248828 7.1693905 7.2974868 21.715705 -84.993601 + 74000 528604.1 0 7.3358903 7.2983204 7.390523 22.024734 -6.8495991 + 75000 519136.15 0 7.445248 7.4224403 7.4690469 22.336735 250.23521 + 76000 518470.58 0 7.5747768 7.5354904 7.5612252 22.671492 274.53956 + 77000 518459.51 0 7.6660567 7.6557812 7.7020797 23.023918 430.07722 + 78000 516646.23 0 7.7596088 7.7130901 7.7896654 23.262364 536.21298 + 79000 517511.57 0 7.9021784 7.82098 7.8840028 23.607161 193.80468 + 80000 520654.84 0 7.991107 7.8932454 8.0049184 23.889271 -6.0066355 + 81000 522331.74 0 8.0616391 7.9990606 8.0954141 24.156114 47.271954 + 82000 521540.3 0 8.1268306 8.0763829 8.1861513 24.389365 36.265762 + 83000 529154.07 0 8.2537975 8.1854268 8.2745822 24.713807 113.94154 + 84000 525977.29 0 8.2999431 8.26591 8.2970498 24.862903 -72.444836 + 85000 520505.41 0 8.3872349 8.3551374 8.4251458 25.167518 -346.6703 + 86000 516334.67 0 8.4947842 8.4504822 8.5238751 25.469142 -3.8332672 + 87000 524745.34 0 8.5405071 8.5348571 8.6344387 25.709803 -149.22382 + 88000 521384.87 0 8.5798155 8.6260785 8.7133565 25.919251 22.009599 + 89000 519680.71 0 8.6657392 8.6857605 8.8319304 26.18343 -180.94487 + 90000 522482.4 0 8.7310324 8.7844751 8.9636862 26.479194 -102.50361 + 91000 527450.69 0 8.8250902 8.8445728 9.0456076 26.715271 325.68024 + 92000 519060.77 0 8.9054775 8.9412744 9.1259074 26.972659 130.73028 + 93000 518170.14 0 9.0378587 9.0315875 9.2346184 27.304065 -111.68498 + 94000 531639.53 0 9.1268874 9.0952299 9.3437063 27.565824 -26.423328 + 95000 519776.1 0 9.2332576 9.1903006 9.4516001 27.875158 -113.46356 + 96000 527082.72 0 9.2993234 9.2533436 9.534409 28.087076 -46.720611 + 97000 526965.16 0 9.3485677 9.3197496 9.6631942 28.331512 159.18386 + 98000 529790.04 0 9.4759113 9.5177629 9.783846 28.77752 343.32872 + 99000 520964.82 0 9.6488022 9.6573355 9.882432 29.18857 -257.85576 + 100000 520863.58 0 9.7452168 9.7659565 9.9878877 29.499061 -108.52324 + 101000 526760.86 0 9.8073751 9.8508213 10.127532 29.785728 120.22249 + 102000 519249.89 0 9.9315855 9.9767409 10.221605 30.129931 -176.50647 + 103000 525003.9 0 10.023982 10.062451 10.315002 30.401435 422.1401 + 104000 519112.73 0 10.086117 10.136879 10.415222 30.638218 -147.66505 + 105000 517898.24 0 10.180438 10.240942 10.525346 30.946725 158.63054 + 106000 528046.35 0 10.258163 10.41411 10.601663 31.273936 -128.04669 + 107000 527105.8 0 10.364015 10.485036 10.795177 31.644228 183.82165 + 108000 522024.28 0 10.450786 10.544065 10.902961 31.897812 -39.692553 + 109000 519497.83 0 10.556206 10.61633 11.046222 32.218758 173.75988 + 110000 521070.8 0 10.64856 10.745382 11.071387 32.465329 -128.45389 + 111000 525657.64 0 10.830485 10.852954 11.188295 32.871734 -214.60249 + 112000 519426.33 0 10.987769 10.97575 11.26012 33.223639 292.35901 + 113000 526472.45 0 11.029941 11.086376 11.418772 33.535089 189.69245 + 114000 520070.28 0 11.107229 11.183295 11.454757 33.745281 -40.433571 + 115000 525812.59 0 11.153992 11.305378 11.537521 33.99689 -106.38733 + 116000 524464.26 0 11.256779 11.413082 11.633295 34.303156 -159.59643 + 117000 519838.94 0 11.344413 11.480104 11.706366 34.530883 -2.0346135 + 118000 524075.83 0 11.441416 11.597533 11.783056 34.822005 -350.05313 + 119000 533816.71 0 11.52766 11.681986 11.917713 35.127359 -521.58975 + 120000 524509.31 0 11.63865 11.792667 12.080379 35.511696 273.09647 +Loop time of 46.6725 on 1 procs for 120000 steps with 4096 atoms + +Performance: 2221.438 tau/day, 2571.109 timesteps/s +100.0% CPU use with 1 MPI tasks x 1 OpenMP threads + +MPI task timing breakdown: +Section | min time | avg time | max time |%varavg| %total +--------------------------------------------------------------- +Pair | 0 | 0 | 0 | 0.0 | 0.00 +Neigh | 0.0063169 | 0.0063169 | 0.0063169 | 0.0 | 0.01 +Comm | 0.057082 | 0.057082 | 0.057082 | 0.0 | 0.12 +Output | 0.0068489 | 0.0068489 | 0.0068489 | 0.0 | 0.01 +Modify | 44.98 | 44.98 | 44.98 | 0.0 | 96.37 +Other | | 1.622 | | | 3.48 + +Nlocal: 4096.00 ave 4096 max 4096 min +Histogram: 1 0 0 0 0 0 0 0 0 0 +Nghost: 0.00000 ave 0 max 0 min +Histogram: 1 0 0 0 0 0 0 0 0 0 +Neighs: 0.00000 ave 0 max 0 min +Histogram: 1 0 0 0 0 0 0 0 0 0 + +Total # of neighbors = 0 +Ave neighs/atom = 0.0000000 +Neighbor list builds = 992 +Dangerous builds = 0 + + +Total wall time: 0:01:05 From 6b51bf104a3b19adee21ac1305f6ba6882cbfc1f Mon Sep 17 00:00:00 2001 From: Sam Cameron Date: Tue, 8 Dec 2020 14:52:28 +0000 Subject: [PATCH 05/22] Added unit test for fix bd/sphere. --- unittest/force-styles/tests/data.bdsphere | 86 +++++++++++++++++++ .../tests/fix-timestep-bd_sphere.yaml | 80 +++++++++++++++++ unittest/force-styles/tests/in.bdsphere | 16 ++++ 3 files changed, 182 insertions(+) create mode 100644 unittest/force-styles/tests/data.bdsphere create mode 100644 unittest/force-styles/tests/fix-timestep-bd_sphere.yaml create mode 100644 unittest/force-styles/tests/in.bdsphere diff --git a/unittest/force-styles/tests/data.bdsphere b/unittest/force-styles/tests/data.bdsphere new file mode 100644 index 0000000000..3fbad7d05e --- /dev/null +++ b/unittest/force-styles/tests/data.bdsphere @@ -0,0 +1,86 @@ +LAMMPS data file via write_data, version 30 Nov 2020, timestep = 120000 + +32 atoms +1 atom types + +-2.7144176165949063 2.7144176165949063 xlo xhi +-2.7144176165949063 2.7144176165949063 ylo yhi +-1.3572088082974532 1.3572088082974532 zlo zhi + +Masses + +1 1 + +Pair Coeffs # zero + +1 + +Atoms # hybrid + +1 1 0.8174385639059338 -1.5010271964354949 1.0637924298773633 0 0.6257069940596588 -0.111108944542851 -0.7721046302331049 1 1 -1 0 -1 +2 1 -1.5885878110813303 2.2401728691740113 0.47068930278928994 0 -0.5102593570021903 0.8585717488647711 -0.049899305035241655 1 1 0 -1 -1 +3 1 -1.1818944957014061 -2.6848623178033457 -1.1800939297629425 0 -0.004166477179696561 0.19766436575888424 0.9802609035236738 1 1 0 0 0 +4 1 0.1720589621174558 1.3643946759490944 -1.1522506184595422 0 0.11721568749368932 0.2990753541702089 -0.9470028590945996 1 1 0 -1 0 +5 1 -2.5038595242428823 -1.624930716630223 -1.1484315973168586 0 -0.3868419197154481 -0.6136739748888413 0.6883005024660352 1 1 0 0 0 +6 1 -1.2345478646498314 -0.3224402671532977 0.5533955773621407 0 0.24969915142093102 -0.15640101573329426 -0.9556092590893315 1 1 0 0 -1 +7 1 1.1946150666115714 0.4921384424233923 -0.516829526742452 0 0.0036359783326705107 -0.4590891155800383 -0.8883827798969893 1 1 0 0 -1 +8 1 1.8342027600045443 1.516095010832566 0.043843911607852545 0 -0.8435468778359277 0.11782686457134713 -0.5239708912511688 1 1 0 -1 -1 +9 1 -0.5406701027756321 2.23952568921304 0.5241488585364904 0 0.045872039042421424 0.13268297551853248 -0.9900964518882184 1 1 0 0 -1 +10 1 -0.3972258497968314 0.7566024687022016 -0.2323435643206888 0 0.655171514572036 -0.43050189344470563 0.6208207520966965 1 1 0 0 -1 +11 1 -0.7183933447005026 1.1587411649504586 0.20950093049531074 0 0.22933670283280452 -0.6843477395075139 -0.6921508854034168 1 1 0 0 -1 +12 1 1.022524253197315 0.17877446802634833 0.29899480569943504 0 0.6711103355965887 -0.41621190608313047 -0.6134969981100816 1 1 0 0 -2 +13 1 -1.4250800612966135 -2.4056565408365356 0.21801121763465003 0 -0.5029961497078136 0.46126362983367525 -0.7309108955076378 1 1 0 1 0 +14 1 -1.7432369014700662 1.621196939810902 0.07955801420882219 0 -0.7988534279257005 0.3194109740977685 -0.5097154405325315 1 1 0 0 -1 +15 1 -0.9908151496097626 -2.6488792381485773 -1.1948117198271224 0 0.5516163133238324 -0.6234158094772195 0.5541409309633126 1 1 0 1 0 +16 1 2.6948716697156523 0.41280900513864877 0.1548529904178103 0 -0.8512724888069316 0.23988291811633639 0.4666811924605956 1 1 0 0 -1 +17 1 -1.5494542712095147 -0.53420074244155 -0.6250925146711168 0 -0.07678144567993991 -0.03950496198488684 0.9962650087089635 1 1 0 0 0 +18 1 -2.3151948315996678 -2.6221617748715036 -0.1899804833264763 0 -0.7569384929404162 -0.33315612552157964 -0.562184234866597 1 1 0 0 0 +19 1 2.1590179665621467 1.6095466091914918 -1.2253859221608403 0 0.20879037375649698 -0.06905534931949565 0.9755193173674137 1 1 0 -1 0 +20 1 2.202409043221526 0.14395355359028536 1.335860415061412 0 -0.14984238844204667 -0.9847320173066201 0.08860086183112265 1 1 0 -1 -1 +21 1 -1.4500395490531754 -1.5281375693866057 0.00020797713894412338 0 -0.9915462127271186 0.08451237717795997 0.09845692525281326 1 1 0 0 0 +22 1 -1.0657362106538344 0.6350242518491277 -0.7513800843604899 0 -0.6569043427466144 -0.07223746743273625 0.7505054515321944 1 1 0 -1 0 +23 1 -0.5619632776222234 1.8699713384517294 -0.9467270322768698 0 0.7911745431454184 0.5177930983571434 -0.3254737310019788 1 1 0 0 0 +24 1 -2.1040517028343215 -2.247249268720423 0.11322260281322279 0 -0.04193441020358475 0.2313330374822751 -0.9719704373128341 1 1 1 0 -1 +25 1 -0.868354233492487 -0.14640654973697223 -0.9035771863161228 0 -0.15652971300701132 0.0848859275832726 -0.9840187133608133 1 1 0 0 0 +26 1 -0.4652717213714348 0.12334049868763304 -0.3826888902964762 0 0.6487662426744875 0.7578954080882759 0.06853402632804934 1 1 -1 0 -1 +27 1 -1.0478542019398558 2.3814414358320106 1.2039965288246885 0 0.10846325104076994 -0.6457073741173193 -0.7558423844851409 1 1 0 0 -1 +28 1 2.500698605198214 -0.728008572758278 0.48410831318342695 0 -0.3622892345018212 0.911584495321123 0.19431988692415955 1 1 0 0 -1 +29 1 -1.416084269787537 -1.7066588654378656 0.8328319180724224 0 -0.08971242415920104 -0.44687722085944426 0.8900856309526737 1 1 0 1 -1 +30 1 -0.6370519124977301 0.47113373856505564 -0.08549434306971403 0 -0.6030496979424049 -0.7976847581640081 -0.0054852898193420265 1 1 0 0 0 +31 1 0.8225325721319097 -0.441545584269452 0.3381678086542899 0 -0.6909877678544062 -0.7162885851668209 0.09729628685258002 1 1 0 0 0 +32 1 2.1861742760925518 1.5740929150306235 -0.01693950575830974 0 0.890366016527044 0.3247001065794207 0.3190896385047258 1 1 0 0 0 + +Velocities + +1 -524.6769664299819 215.42199277006424 -112.27005568908588 -462.03530876082846 -551.9512642384534 -196.46403300264745 +2 391.3416799472542 48.7957761872576 -623.1311508507263 489.33832403519347 -260.3072072833973 -529.7105564646685 +3 109.86388293585976 665.5499875054874 -583.4371492475789 -678.3137468561738 622.6210695594215 37.427168579931944 +4 398.4814329387423 -117.47798197974335 -376.25882363220865 44.966011242133156 -720.7197483734453 654.1933839835833 +5 584.5314601424474 159.82839534760055 -199.69054648577074 298.5492685852273 657.8565691587017 -616.4449676099423 +6 609.4975570025578 738.2439586459146 284.06966373218285 143.74329023895925 256.75048911205783 -57.96098774586574 +7 -27.968041606728725 752.3634409363073 223.6145040530379 -496.9033910070852 198.22198514310026 -81.32767873220877 +8 -451.1189781565461 -759.642533657806 547.0603381420482 316.5054412546416 669.7302717449263 -447.9786170711034 +9 -54.531235862640735 -115.1466962517251 -610.7279757582849 -731.9703465871636 -735.0301879611621 -584.8114323501295 +10 748.6292469789635 701.8693636792311 -498.1997398935133 208.99011146198362 -538.4269075676226 130.16593091403558 +11 -174.9453247974202 153.40962619436522 390.8158086666639 -381.20607659097726 548.6301954978544 225.4382939850729 +12 -393.58450479962613 562.7494007708912 -512.2495061493412 425.83486537187855 260.1521699032197 -605.409242525273 +13 294.0485676041469 -416.4803586200817 -678.9550420350499 284.48925268723156 -67.2753269810592 559.4386740115784 +14 -764.1287373972617 733.8169442814999 720.6030317274988 357.0913464046234 521.8205481343224 173.7714175822938 +15 -91.18940426263303 224.9036504882129 284.4326488075122 -207.62866349692237 501.5282881027212 445.99895870682315 +16 179.07740801693492 -535.4403834538152 -318.55850921823156 266.7175735768374 444.97898080245074 -381.12832705309194 +17 -428.2045641732463 -491.50884735767914 -270.6175162521197 727.5062118970601 128.20058511314278 270.88345291377027 +18 395.0795674693432 306.1681692632796 -13.216405710204159 671.3857274637012 102.79070644890297 322.4136674209789 +19 -203.6409986589429 -54.701509197392014 581.0635722032287 -186.75568274826543 476.4083542709755 -601.0363388843747 +20 -115.92502268264624 -762.0000436955148 -223.1167962036293 489.85643882981896 -247.41158767130918 -365.8330907652003 +21 658.7418242889948 586.715926671846 -624.8573383343708 -10.66175165422313 359.69577124554525 -340.2786090411881 +22 56.13036471905219 261.41167548131494 373.8653013382346 673.5607754029996 -245.8613985477709 353.0482780954667 +23 -252.99394908800596 -466.09490577221976 -670.846651689147 -616.9981712696467 -541.8114132827196 -369.70154580103025 +24 -627.059810991902 278.53716543954556 457.18418082455213 -101.65170342061822 225.64771910612274 649.9004460194175 +25 -542.388717452386 -105.31239543953356 69.1170307021082 -204.78231016519337 -522.3497436231834 -357.49930063072486 +26 -213.4605252121538 -534.3449644895232 244.1099101456221 275.4530388773477 212.2684271906576 -165.97485643999994 +27 595.2153731851414 626.5401264322599 -736.723964414168 -188.93350086112284 -459.44316502268424 -484.4606024327521 +28 -400.55444615195614 606.638183855102 121.6628831751137 359.49918126198475 668.2849798601502 -135.04633035091715 +29 -347.6624143232117 -365.7917228400548 -541.6372617049859 160.0398519292602 -624.5129134218859 -448.13097661684066 +30 -104.98117502101249 500.1388613847156 731.4317325082025 -481.0858846642298 -574.8809141763269 122.21267028742885 +31 754.8558584263326 -34.937336585228245 -726.0948084688208 -103.81133072710576 431.8053281041717 -479.89267857331 +32 140.02839515740888 643.0847109951975 -535.5893264521633 -373.10470401809016 -661.5529040774077 37.5722333352976 diff --git a/unittest/force-styles/tests/fix-timestep-bd_sphere.yaml b/unittest/force-styles/tests/fix-timestep-bd_sphere.yaml new file mode 100644 index 0000000000..66a65bc3ba --- /dev/null +++ b/unittest/force-styles/tests/fix-timestep-bd_sphere.yaml @@ -0,0 +1,80 @@ +--- +lammps_version: 24 Aug 2020 +date_generated: Tue Dec 08 12:28:40 2020 +epsilon: 1e-12 +prerequisites: ! | + atom hybrid dipole sphere + fix bd_sphere +pre_commands: ! "" +post_commands: ! | + fix test solute bd_sphere 1.0 1.0 1.0 1.0 1049270 + fix_modify test virial yes +input_file: in.bdsphere +natoms: 32 +run_pos: ! |2 +1 0.8198132185477983 -1.5120221815010249 1.069236010215717 +2 -1.583657719347759 2.2448791290372445 0.48185576252150486 +3 -1.1880610036164596 -2.678219122115848 -1.1824396130063375 +4 0.1908794667962731 1.3593710068293134 -1.1524405138570022 +5 -2.502067366922716 -1.6291621715156412 -1.155308629818198 +6 -1.214213515524568 -0.33667539680264325 0.5468489960944642 +7 1.2020658999364164 0.5045561046001554 -0.5265404283266816 +8 1.8138899397447894 1.5212405777462397 0.04943268689972926 +9 -0.547736141448719 2.2385521615789026 0.5146647473679599 +10 -0.38821952892982114 0.7570899758491753 -0.23554333362488367 +11 -0.7101567507222957 1.1587573566149103 0.19674801175715137 +12 1.0217947252204158 0.1732739652383159 0.3064332055619567 +13 -1.43254480550968 -2.4145346257525504 0.22508495277327453 +14 -1.7469141674373843 1.605802890508775 0.07604534549063337 +15 -0.9840165887382163 -2.631709004347024 -1.1933270065258215 +16 2.6947076505094056 0.4027838910781582 0.16197472527708037 +17 -1.553343026077184 -0.5326249015108566 -0.6372569894483383 +18 -2.32697929027452 -2.6229660088889384 -0.1908463010722981 +19 2.161025566743724 1.613342829181601 -1.2185964188334404 +20 2.200299550516107 0.13388691832171218 1.3492239308384593 +21 -1.444652156145116 -1.5251851082502694 -0.01486082239207267 +22 -1.069098522661769 0.6345737477571621 -0.7476592232484849 +23 -0.5530156382651018 1.8581482829486815 -0.9359906503001887 +24 -2.1057002294256346 -2.2411635326026076 0.1027461222133986 +25 -0.846470575235486 -0.16100145290710122 -0.8945542130124591 +26 -0.4600833044897612 0.1168099650353831 -0.3780372490219117 +27 -1.0507601010756238 2.380597031527799 1.2042435415073673 +28 2.4951223446270854 -0.7272384746662179 0.49148118274363145 +29 -1.4227701815513125 -1.7103131555856865 0.8522428843219197 +30 -0.6362527497446904 0.4809930863631752 -0.09023977411046079 +31 0.8307577317570568 -0.43366523738108803 0.3435388363003548 +32 2.193071783870056 1.5720818983016567 -0.002617308630618007 +run_vel: ! |2 +1 -199.33264006196603 -425.90458140644324 687.4446082626521 +2 -437.96841023792416 91.79431782876951 428.57844526457393 +3 256.4136360073004 753.6546188320922 -477.2093961250793 +4 566.9823183079484 -598.4626629699561 -572.6010613373849 +5 193.3673483203161 517.2757090545375 86.71381952181962 +6 330.2395000638781 -14.096120493379578 -736.8264608358458 +7 772.6058378438489 335.4342218605717 -492.47120565202727 +8 -379.69346948872095 328.07026948905315 212.8907928502149 +9 -32.22616772317161 520.1349898628745 -354.5179475075607 +10 1.0828608441585152 -152.03654350035677 -287.63229160711455 +11 -8.398427517515586 462.54972999070884 -696.8949630195855 +12 -35.97938353895289 590.1362599649709 750.3193298672243 +13 -738.0063700936831 2.1036698005985586 521.0581963709241 +14 734.7145728536893 -576.3310076952716 -212.8973489276375 +15 462.14962458969075 517.8011186395346 582.1970348843957 +16 579.8864331189503 -723.7080269305067 -397.93358494791835 +17 -74.75036331228799 -271.6937286797369 318.88308122021147 +18 -390.80278885093725 -625.5459111419849 -678.090840223804 +19 -598.6933260882906 41.7579655827356 750.013779723682 +20 158.9763823000137 310.0053213378944 226.83667759758563 +21 -578.1763126419472 755.241466585726 -387.1851268613029 +22 -686.649568451259 496.2326396493665 -392.30182210275524 +23 139.72339904857833 686.4901911325059 460.94182891802774 +24 625.6387119562066 -178.79780516572728 194.63377933230842 +25 761.5753760889415 -550.6374632586046 -355.3666363468769 +26 -167.9925585211552 -748.0176849962858 537.6949353742531 +27 -687.973065038564 -637.3675344653028 -231.07938308121751 +28 -480.2313784604401 372.9809695991278 24.972745276651647 +29 67.21410614540838 54.58636231646205 639.3712010004265 +30 -469.9090654062959 715.7242943947524 -386.21519675922724 +31 -380.59017466972404 487.7214660680053 177.24466119039292 +32 138.31144158562722 31.005629253137737 621.8772779588675 +... diff --git a/unittest/force-styles/tests/in.bdsphere b/unittest/force-styles/tests/in.bdsphere new file mode 100644 index 0000000000..1fb583f51d --- /dev/null +++ b/unittest/force-styles/tests/in.bdsphere @@ -0,0 +1,16 @@ +variable newton_pair index on +variable newton_bond index on +variable units index lj +variable input_dir index . +variable data_file index ${input_dir}/data.bdsphere +variable pair_style index 'zero 8.0' + +atom_style hybrid dipole sphere +atom_modify map array +neigh_modify delay 2 every 2 check no +units ${units} +timestep 0.00001 +newton ${newton_pair} ${newton_bond} + +pair_style ${pair_style} +read_data ${data_file} From dab4c7409accde6198c59f4bad28e7cd12c06986 Mon Sep 17 00:00:00 2001 From: Sam Cameron Date: Wed, 9 Dec 2020 21:04:23 +0000 Subject: [PATCH 06/22] Changes for pull request 2511. --- doc/src/Commands_fix.rst | 1 + doc/src/fix.rst | 1 + doc/src/fix_bd_sphere.rst | 38 ++--- examples/bd_sphere/README.txt | 12 +- examples/bd_sphere/{in2d.bd => in2ddipole.bd} | 2 +- examples/bd_sphere/in3d_virial_on.bd | 12 +- .../log_gaussian_4_1_7_13_2d.lammps.log | 46 +++---- .../log_uniform_10_1_5_15_3d.lammps.log | 50 +++---- src/fix_bd_sphere.cpp | 130 ++++++++++-------- src/fix_bd_sphere.h | 13 +- .../tests/fix-timestep-bd_sphere.yaml | 2 +- 11 files changed, 152 insertions(+), 155 deletions(-) rename examples/bd_sphere/{in2d.bd => in2ddipole.bd} (98%) diff --git a/doc/src/Commands_fix.rst b/doc/src/Commands_fix.rst index d1bc20c9ca..1be5348bfe 100644 --- a/doc/src/Commands_fix.rst +++ b/doc/src/Commands_fix.rst @@ -39,6 +39,7 @@ OPT. * :doc:`ave/time ` * :doc:`aveforce ` * :doc:`balance ` + * :doc:`bd/sphere ` * :doc:`bocs ` * :doc:`bond/break ` * :doc:`bond/create ` diff --git a/doc/src/fix.rst b/doc/src/fix.rst index 37ddbbeb3e..0993a885a5 100644 --- a/doc/src/fix.rst +++ b/doc/src/fix.rst @@ -181,6 +181,7 @@ accelerated styles exist. * :doc:`ave/histo/weight ` - weighted version of fix ave/histo * :doc:`ave/time ` - compute/output global time-averaged quantities * :doc:`aveforce ` - add an averaged force to each atom +* :doc:`bd/sphere ` - overdamped translational and rotational brownian dynamics * :doc:`balance ` - perform dynamic load-balancing * :doc:`bocs ` - NPT style time integration with pressure correction * :doc:`bond/break ` - break bonds on the fly diff --git a/doc/src/fix_bd_sphere.rst b/doc/src/fix_bd_sphere.rst index 013d0604bb..ee731c47d8 100644 --- a/doc/src/fix_bd_sphere.rst +++ b/doc/src/fix_bd_sphere.rst @@ -17,14 +17,15 @@ Syntax * diff_t = translational diffusion coefficient * diff_r = rotational diffusion coefficient * zero or more keyword/value pairs may be appended -* keyword = *rng* +* keyword = *rng* or *dipole* .. parsed-literal:: - *rng* arg = *uniform* or *gaussian* or *none* - uniform = use uniform random number generator - gaussian = use gaussian random number generator - none = turn off noise + *rng* value = *uniform* or *gaussian* or *none* + *uniform* = use uniform random number generator + *gaussian* = use gaussian random number generator + *none* = turn off noise + *dipole* value = none = update orientation of dipoles during integration Examples """""""" @@ -32,9 +33,9 @@ Examples .. code-block:: LAMMPS fix 1 all bd/sphere 1.0 1.0 1.0 1.0 1294019 - fix 1 all bd/sphere 1.0 1.0 1.0 1.0 19581092 rng none + fix 1 all bd/sphere 1.0 1.0 1.0 1.0 19581092 rng none dipole fix 1 all bd/sphere 1.0 1.0 1.0 1.0 19581092 rng uniform - fix 1 all bd/sphere 1.0 1.0 1.0 1.0 19581092 rng gaussian + fix 1 all bd/sphere 1.0 1.0 1.0 1.0 19581092 dipole rng gaussian Description @@ -52,8 +53,8 @@ viscous forces. The stochastic equations of motion are d\Omega = \frac{T}{\gamma_r}dt + \sqrt{2D_r}dW_r, where :math:`d\Omega` is an infinitesimal rotation vector (see e.g. -Chapter 4 of :ref:`(GoldsteinCM) `), :math:`dW_t` and -:math:`dW_r` are Wiener processes (see e.g. :ref:`(GardinerC) `). +Chapter 4 of :ref:`(Goldstein) `), :math:`dW_t` and +:math:`dW_r` are Wiener processes (see e.g. :ref:`(Gardiner) `). The dipole vectors :math:`e_i` are updated using the rotation matrix .. math:: @@ -64,13 +65,13 @@ where :math:`\omega=d\Omega/dt` is the angular velocity, :math:`\Delta\theta=|\omega|dt` is the rotation angle about the :math:`\omega` axis, and :math:`(\theta_X)_{ij}=-\epsilon_{ijk}d\Omega_k` is the -infinitesimal rotation matrix (see e.g. :ref:`(Callegari1) `, +infinitesimal rotation matrix (see e.g. :ref:`(Callegari) `, section 7.4). The :doc:`fix_modify ` *virial* option is supported by this fix to add the contribution due to the added forces on atoms to the system's virial as part of :doc:`thermodynamic output `. -The default is *virial no* +The default is *virial no*. IMPORTANT NOTE: This integrator is designed for generic non-equilibrium @@ -96,17 +97,20 @@ units of mass/time and (mass*length*length)/(time). If the *rng* keyword is used with the *uniform* value, then the noise is generated from a uniform distribution (see -:ref:`(Dunweg) ` for why this works). This is the same method +:ref:`(Dunweg) ` for why this works). This is the same method of noise generation as used in :doc:`fix_langevin `. If the *rng* keyword is used with the *gaussian* value, then the noise is generated from a gaussian distribution. Typically this added complexity is unnecessary, and one should be fine using the *uniform* -value for reasons argued in :ref:`(Dunweg) `. +value for reasons argued in :ref:`(Dunweg) `. If the *rng* keyword is used with the *none* value, then the noise terms are set to zero. +If the *dipole* keyword is used, then the dipole moments of the particles +are updated as described above. + ---------- .. include:: accel_styles.rst @@ -150,18 +154,18 @@ The default for *rng* is *uniform*. .. _GoldsteinCM: -**(GoldsteinCM)** Goldstein, Poole, and Safko, Classical Mechanics, 3rd Ed. (2001). +**(Goldstein)** Goldstein, Poole, and Safko, Classical Mechanics, 3rd Ed. (2001). .. _GardinerC: -**(GardinerC)** Gardiner, A Handbook for the Natural and Social Sciences 4th Ed. (2009). +**(Gardiner)** Gardiner, A Handbook for the Natural and Social Sciences 4th Ed. (2009). .. _Callegari1: -**(Callegari1)** Callegari and Volpe, *Numerical Simulations of Active Brownian +**(Callegari)** Callegari and Volpe, *Numerical Simulations of Active Brownian Particles*, Flowing Matter, 211-238 (2019). -.. _Dunweg1: +.. _Dunweg6: **(Dunweg)** Dunweg and Paul, Int J of Modern Physics C, 2, 817-27 (1991). diff --git a/examples/bd_sphere/README.txt b/examples/bd_sphere/README.txt index b044f11edc..2f66504581 100644 --- a/examples/bd_sphere/README.txt +++ b/examples/bd_sphere/README.txt @@ -1,6 +1,8 @@ -The input file in2d.bd demonstrates how to run a 2d simulation +The input file in2ddipole.bd demonstrates how to run a 2d simulation of particles undergoing overdamped brownian motion in both -translational and rotational degrees of freedom. +translational and rotational degrees of freedom. Dipole +updating is turned on, so the package DIPOLE must be built +for this example to work. The input file in3d_virial_on.bd demonstrates how to run a similar simulation but in 3d. In this case, the virial @@ -9,11 +11,13 @@ sum_i /(3*volume) where W is a random variable with mean 0 and variance dt) is calculated via the fix_modify command. For long enough times, this will be equal to rho*D_t*gamma_t -(the ideal gas term in equilibrium systems). +(the ideal gas term in equilibrium systems). Note that +no dipole updating is performed. To confirm rotational diffusion is working correctly, run the above simulations with dump files on and -measure \sum_i, and one should +measure \sum_i where e_i is the +dipole vector of particle i, and one should find that this decays as an exponential with timescale 1/((d-1)*D_r). diff --git a/examples/bd_sphere/in2d.bd b/examples/bd_sphere/in2ddipole.bd similarity index 98% rename from examples/bd_sphere/in2d.bd rename to examples/bd_sphere/in2ddipole.bd index c11381ad5a..1f7898207f 100644 --- a/examples/bd_sphere/in2d.bd +++ b/examples/bd_sphere/in2ddipole.bd @@ -38,7 +38,7 @@ pair_style none #compute d all property/atom mux muy muz -fix 1 all bd/sphere ${gamma_t} ${gamma_r} ${D_t} ${D_r} ${seed} rng ${rng} +fix 1 all bd/sphere ${gamma_t} ${gamma_r} ${D_t} ${D_r} ${seed} rng ${rng} dipole fix 2 all enforce2d compute press all pressure NULL virial diff --git a/examples/bd_sphere/in3d_virial_on.bd b/examples/bd_sphere/in3d_virial_on.bd index 1ef88930c1..0e2f02beb0 100644 --- a/examples/bd_sphere/in3d_virial_on.bd +++ b/examples/bd_sphere/in3d_virial_on.bd @@ -14,7 +14,7 @@ variable params string ${rng}_${gamma_t}_${gamma_r}_${D_t}_${D_r} log log_${params}_3d.lammps.log units lj -atom_style hybrid dipole sphere +atom_style sphere dimension 3 newton off @@ -23,22 +23,16 @@ lattice sc 0.4 region box block -8 8 -8 8 -8 8 create_box 1 box create_atoms 1 box -mass * 1.0 -set type * dipole/random ${seed} 1.0 +#mass * 1.0 velocity all create 1.0 1 loop geom neighbor 1.0 bin neigh_modify every 1 delay 1 check yes - - pair_style none - -#compute d all property/atom mux muy muz - fix 1 all bd/sphere ${gamma_t} ${gamma_r} ${D_t} ${D_r} ${seed} rng ${rng} fix_modify 1 virial yes @@ -65,7 +59,7 @@ thermo_style custom step temp epair c_msd[*] c_press # write trajectory and thermo in a log-scale frequency # uncomment the next three lines for dump file #dump 1 all custom 10000 dump_${params}_3d.lammpstrj id type & -# x y xu yu mux muy muz fx fy fz +# x y xu yu fx fy fz #dump_modify 1 first yes sort id timestep 0.00001 diff --git a/examples/bd_sphere/log_gaussian_4_1_7_13_2d.lammps.log b/examples/bd_sphere/log_gaussian_4_1_7_13_2d.lammps.log index 72b90efe0e..a735ea6baa 100644 --- a/examples/bd_sphere/log_gaussian_4_1_7_13_2d.lammps.log +++ b/examples/bd_sphere/log_gaussian_4_1_7_13_2d.lammps.log @@ -13,7 +13,7 @@ Created orthogonal box = (-25.298221 -25.298221 -0.31622777) to (25.298221 25.29 1 by 1 by 1 MPI processor grid create_atoms 1 box Created 1024 atoms - create_atoms CPU = 0.002 seconds + create_atoms CPU = 0.001 seconds mass * 1.0 set type * dipole/random ${seed} 1.0 set type * dipole/random 1974019 1.0 @@ -33,13 +33,13 @@ pair_style none #compute d all property/atom mux muy muz -fix 1 all bd/sphere ${gamma_t} ${gamma_r} ${D_t} ${D_r} ${seed} rng ${rng} -fix 1 all bd/sphere 4 ${gamma_r} ${D_t} ${D_r} ${seed} rng ${rng} -fix 1 all bd/sphere 4 1 ${D_t} ${D_r} ${seed} rng ${rng} -fix 1 all bd/sphere 4 1 7 ${D_r} ${seed} rng ${rng} -fix 1 all bd/sphere 4 1 7 13 ${seed} rng ${rng} -fix 1 all bd/sphere 4 1 7 13 1974019 rng ${rng} -fix 1 all bd/sphere 4 1 7 13 1974019 rng gaussian +fix 1 all bd/sphere ${gamma_t} ${gamma_r} ${D_t} ${D_r} ${seed} rng ${rng} dipole +fix 1 all bd/sphere 4 ${gamma_r} ${D_t} ${D_r} ${seed} rng ${rng} dipole +fix 1 all bd/sphere 4 1 ${D_t} ${D_r} ${seed} rng ${rng} dipole +fix 1 all bd/sphere 4 1 7 ${D_r} ${seed} rng ${rng} dipole +fix 1 all bd/sphere 4 1 7 13 ${seed} rng ${rng} dipole +fix 1 all bd/sphere 4 1 7 13 1974019 rng ${rng} dipole +fix 1 all bd/sphere 4 1 7 13 1974019 rng gaussian dipole fix 2 all enforce2d compute press all pressure NULL virial @@ -56,9 +56,9 @@ Per MPI rank memory allocation (min/avg/max) = 4.289 | 4.289 | 4.289 Mbytes Step Temp E_pair c_press 0 1 0 0 50000 7.3671759e+10 0 0 -Loop time of 10.2295 on 1 procs for 50000 steps with 1024 atoms +Loop time of 11.2219 on 1 procs for 50000 steps with 1024 atoms -Performance: 0.042 tau/day, 4887.825 timesteps/s +Performance: 0.038 tau/day, 4455.573 timesteps/s 100.0% CPU use with 1 MPI tasks x 1 OpenMP threads MPI task timing breakdown: @@ -66,10 +66,10 @@ Section | min time | avg time | max time |%varavg| %total --------------------------------------------------------------- Pair | 0 | 0 | 0 | 0.0 | 0.00 Neigh | 0 | 0 | 0 | 0.0 | 0.00 -Comm | 0.033217 | 0.033217 | 0.033217 | 0.0 | 0.32 -Output | 2.1435e-05 | 2.1435e-05 | 2.1435e-05 | 0.0 | 0.00 -Modify | 10.047 | 10.047 | 10.047 | 0.0 | 98.21 -Other | | 0.1497 | | | 1.46 +Comm | 0.028513 | 0.028513 | 0.028513 | 0.0 | 0.25 +Output | 2.0981e-05 | 2.0981e-05 | 2.0981e-05 | 0.0 | 0.00 +Modify | 11.048 | 11.048 | 11.048 | 0.0 | 98.45 +Other | | 0.1458 | | | 1.30 Nlocal: 1024.00 ave 1024 max 1024 min Histogram: 1 0 0 0 0 0 0 0 0 0 @@ -228,20 +228,20 @@ Step Temp E_pair c_msd[1] c_msd[2] c_msd[3] c_msd[4] c_press 118000 745594.37 0 16.838659 17.585392 0 34.424052 0 119000 714487.42 0 17.064214 17.743478 0 34.807692 0 120000 716557.14 0 17.105558 17.845925 0 34.951483 0 -Loop time of 25.2131 on 1 procs for 120000 steps with 1024 atoms +Loop time of 27.2068 on 1 procs for 120000 steps with 1024 atoms -Performance: 4112.144 tau/day, 4759.427 timesteps/s -99.9% CPU use with 1 MPI tasks x 1 OpenMP threads +Performance: 3810.806 tau/day, 4410.656 timesteps/s +100.0% CPU use with 1 MPI tasks x 1 OpenMP threads MPI task timing breakdown: Section | min time | avg time | max time |%varavg| %total --------------------------------------------------------------- Pair | 0 | 0 | 0 | 0.0 | 0.00 -Neigh | 0.0016123 | 0.0016123 | 0.0016123 | 0.0 | 0.01 -Comm | 0.025898 | 0.025898 | 0.025898 | 0.0 | 0.10 -Output | 0.0037882 | 0.0037882 | 0.0037882 | 0.0 | 0.02 -Modify | 24.767 | 24.767 | 24.767 | 0.0 | 98.23 -Other | | 0.4146 | | | 1.64 +Neigh | 0.0015633 | 0.0015633 | 0.0015633 | 0.0 | 0.01 +Comm | 0.021682 | 0.021682 | 0.021682 | 0.0 | 0.08 +Output | 0.0032539 | 0.0032539 | 0.0032539 | 0.0 | 0.01 +Modify | 26.802 | 26.802 | 26.802 | 0.0 | 98.51 +Other | | 0.3781 | | | 1.39 Nlocal: 1024.00 ave 1024 max 1024 min Histogram: 1 0 0 0 0 0 0 0 0 0 @@ -256,4 +256,4 @@ Neighbor list builds = 1049 Dangerous builds = 0 -Total wall time: 0:00:35 +Total wall time: 0:00:38 diff --git a/examples/bd_sphere/log_uniform_10_1_5_15_3d.lammps.log b/examples/bd_sphere/log_uniform_10_1_5_15_3d.lammps.log index fda48dc71a..57f90193ac 100644 --- a/examples/bd_sphere/log_uniform_10_1_5_15_3d.lammps.log +++ b/examples/bd_sphere/log_uniform_10_1_5_15_3d.lammps.log @@ -1,6 +1,5 @@ units lj -atom_style hybrid dipole sphere -WARNING: Atom_style hybrid defines both pertype and peratom masses - both must be set, only peratom masses will be used (src/atom_vec_hybrid.cpp:157) +atom_style sphere dimension 3 newton off @@ -13,26 +12,17 @@ Created orthogonal box = (-10.857670 -10.857670 -10.857670) to (10.857670 10.857 1 by 1 by 1 MPI processor grid create_atoms 1 box Created 4096 atoms - create_atoms CPU = 0.003 seconds -mass * 1.0 -set type * dipole/random ${seed} 1.0 -set type * dipole/random 553910 1.0 -Setting atom values ... - 4096 settings made for dipole/random + create_atoms CPU = 0.001 seconds +#mass * 1.0 velocity all create 1.0 1 loop geom neighbor 1.0 bin neigh_modify every 1 delay 1 check yes - - pair_style none - -#compute d all property/atom mux muy muz - fix 1 all bd/sphere ${gamma_t} ${gamma_r} ${D_t} ${D_r} ${seed} rng ${rng} fix 1 all bd/sphere 10 ${gamma_r} ${D_t} ${D_r} ${seed} rng ${rng} fix 1 all bd/sphere 10 1 ${D_t} ${D_r} ${seed} rng ${rng} @@ -52,13 +42,13 @@ thermo 50001 run 50000 WARNING: No pairwise cutoff or binsize set. Atom sorting therefore disabled. (src/atom.cpp:2118) WARNING: Communication cutoff is 0.0. No ghost atoms will be generated. Atoms may get lost. (src/comm_brick.cpp:167) -Per MPI rank memory allocation (min/avg/max) = 4.362 | 4.362 | 4.362 Mbytes +Per MPI rank memory allocation (min/avg/max) = 3.581 | 3.581 | 3.581 Mbytes Step Temp E_pair c_press 0 1 0 -32553.271 50000 5.2351457e+10 0 -15026.42 -Loop time of 18.6303 on 1 procs for 50000 steps with 4096 atoms +Loop time of 16.0183 on 1 procs for 50000 steps with 4096 atoms -Performance: 0.023 tau/day, 2683.804 timesteps/s +Performance: 0.027 tau/day, 3121.426 timesteps/s 100.0% CPU use with 1 MPI tasks x 1 OpenMP threads MPI task timing breakdown: @@ -66,10 +56,10 @@ Section | min time | avg time | max time |%varavg| %total --------------------------------------------------------------- Pair | 0 | 0 | 0 | 0.0 | 0.00 Neigh | 0 | 0 | 0 | 0.0 | 0.00 -Comm | 0.31439 | 0.31439 | 0.31439 | 0.0 | 1.69 -Output | 5.5046e-05 | 5.5046e-05 | 5.5046e-05 | 0.0 | 0.00 -Modify | 17.718 | 17.718 | 17.718 | 0.0 | 95.11 -Other | | 0.5974 | | | 3.21 +Comm | 0.074984 | 0.074984 | 0.074984 | 0.0 | 0.47 +Output | 3.0041e-05 | 3.0041e-05 | 3.0041e-05 | 0.0 | 0.00 +Modify | 15.366 | 15.366 | 15.366 | 0.0 | 95.93 +Other | | 0.5772 | | | 3.60 Nlocal: 4096.00 ave 4096 max 4096 min Histogram: 1 0 0 0 0 0 0 0 0 0 @@ -96,7 +86,7 @@ thermo_style custom step temp epair c_msd[*] c_press # write trajectory and thermo in a log-scale frequency # uncomment the next three lines for dump file -#dump 1 all custom 10000 dump_${params}_3d.lammpstrj id type # x y xu yu mux muy muz fx fy fz +#dump 1 all custom 10000 dump_${params}_3d.lammpstrj id type # x y xu yu fx fy fz #dump_modify 1 first yes sort id timestep 0.00001 @@ -105,7 +95,7 @@ thermo 1000 # main run run 120000 WARNING: Communication cutoff is 0.0. No ghost atoms will be generated. Atoms may get lost. (src/comm_brick.cpp:167) -Per MPI rank memory allocation (min/avg/max) = 4.737 | 4.737 | 4.737 Mbytes +Per MPI rank memory allocation (min/avg/max) = 3.956 | 3.956 | 3.956 Mbytes Step Temp E_pair c_msd[1] c_msd[2] c_msd[3] c_msd[4] c_press 0 5.2351457e+10 0 0 0 0 0 -233.83012 1000 522590.88 0 0.10259269 0.10487519 0.10391005 0.31137793 -13.730626 @@ -228,20 +218,20 @@ Step Temp E_pair c_msd[1] c_msd[2] c_msd[3] c_msd[4] c_press 118000 524075.83 0 11.441416 11.597533 11.783056 34.822005 -350.05313 119000 533816.71 0 11.52766 11.681986 11.917713 35.127359 -521.58975 120000 524509.31 0 11.63865 11.792667 12.080379 35.511696 273.09647 -Loop time of 46.6725 on 1 procs for 120000 steps with 4096 atoms +Loop time of 39.6359 on 1 procs for 120000 steps with 4096 atoms -Performance: 2221.438 tau/day, 2571.109 timesteps/s +Performance: 2615.809 tau/day, 3027.557 timesteps/s 100.0% CPU use with 1 MPI tasks x 1 OpenMP threads MPI task timing breakdown: Section | min time | avg time | max time |%varavg| %total --------------------------------------------------------------- Pair | 0 | 0 | 0 | 0.0 | 0.00 -Neigh | 0.0063169 | 0.0063169 | 0.0063169 | 0.0 | 0.01 -Comm | 0.057082 | 0.057082 | 0.057082 | 0.0 | 0.12 -Output | 0.0068489 | 0.0068489 | 0.0068489 | 0.0 | 0.01 -Modify | 44.98 | 44.98 | 44.98 | 0.0 | 96.37 -Other | | 1.622 | | | 3.48 +Neigh | 0.0059817 | 0.0059817 | 0.0059817 | 0.0 | 0.02 +Comm | 0.039473 | 0.039473 | 0.039473 | 0.0 | 0.10 +Output | 0.0063653 | 0.0063653 | 0.0063653 | 0.0 | 0.02 +Modify | 38.085 | 38.085 | 38.085 | 0.0 | 96.09 +Other | | 1.499 | | | 3.78 Nlocal: 4096.00 ave 4096 max 4096 min Histogram: 1 0 0 0 0 0 0 0 0 0 @@ -256,4 +246,4 @@ Neighbor list builds = 992 Dangerous builds = 0 -Total wall time: 0:01:05 +Total wall time: 0:00:55 diff --git a/src/fix_bd_sphere.cpp b/src/fix_bd_sphere.cpp index 3a8a0811b9..ba7cd2a81c 100644 --- a/src/fix_bd_sphere.cpp +++ b/src/fix_bd_sphere.cpp @@ -35,6 +35,10 @@ using namespace LAMMPS_NS; using namespace FixConst; +#define SMALL 1e-14 + +enum{NONE,DIPOLE}; + /* ---------------------------------------------------------------------- */ FixBdSphere::FixBdSphere(LAMMPS *lmp, int narg, char **arg) : @@ -43,14 +47,14 @@ FixBdSphere::FixBdSphere(LAMMPS *lmp, int narg, char **arg) : virial_flag = 1; time_integrate = 1; - - if (narg != 8 && narg != 10) + + extra = NONE; + + if (narg > 11 || narg < 8 ) error->all(FLERR,"Illegal fix bd/sphere command."); if (!atom->sphere_flag) error->all(FLERR,"Fix bd/sphere requires atom style sphere"); - if (!atom->mu_flag) - error->all(FLERR,"Fix bd/sphere requires atom attribute mu"); gamma_t = utils::numeric(FLERR,arg[3],false,lmp); if (gamma_t <= 0.0) @@ -62,7 +66,7 @@ FixBdSphere::FixBdSphere(LAMMPS *lmp, int narg, char **arg) : error->all(FLERR,"Fix bd/sphere rotational viscous drag " "coefficient must be > 0."); - // note that diffusion is in units of epsilon**2*tau**3/(m**2*sigma**2) + diff_t = utils::numeric(FLERR,arg[5],false,lmp); if (diff_t <= 0.0) error->all(FLERR,"Fix bd/sphere translational diffusion " @@ -83,6 +87,9 @@ FixBdSphere::FixBdSphere(LAMMPS *lmp, int narg, char **arg) : while (iarg < narg) { if (strcmp(arg[iarg],"rng") == 0) { + if (narg == iarg + 1) { + error->all(FLERR,"Illegal fix/bd/sphere command."); + } if (strcmp(arg[iarg + 1],"uniform") == 0) { noise_flag = 1; } else if (strcmp(arg[iarg + 1],"gaussian") == 0) { @@ -93,17 +100,21 @@ FixBdSphere::FixBdSphere(LAMMPS *lmp, int narg, char **arg) : } else { error->all(FLERR,"Illegal fix/bd/sphere command."); } + iarg = iarg + 2; + } else if (strcmp(arg[iarg],"dipole") == 0) { + extra = DIPOLE; + iarg = iarg + 1; } else { error->all(FLERR,"Illegal fix/bd/sphere command."); } - iarg = iarg + 2; } - + if (extra == DIPOLE && !atom->mu_flag) + error->all(FLERR,"Fix bd/sphere update dipole requires atom attribute mu"); + // initialize Marsaglia RNG with processor-unique seed random = new RanMars(lmp,seed + comm->me); - } /* ---------------------------------------------------------------------- */ @@ -120,9 +131,7 @@ int FixBdSphere::setmask() FixBdSphere::~FixBdSphere() { - delete random; - } @@ -131,8 +140,7 @@ FixBdSphere::~FixBdSphere() void FixBdSphere::init() { - - + g1 = force->ftm2v/gamma_t; g3 = force->ftm2v/gamma_r; if (noise_flag == 0) { @@ -164,16 +172,12 @@ void FixBdSphere::initial_integrate(int /* vflag */) { double **x = atom->x; double **v = atom->v; - double **mu = atom->mu; double **f = atom->f; double **omega = atom->omega; double **torque = atom->torque; int *mask = atom->mask; int nlocal = atom->nlocal; double dx,dy,dz; - double dtheta; - double mux,muy,muz,mu_tmp,wx,wy,wz; - double prefac_1, prefac_2; if (igroup == atom->firstgroup) nlocal = atom->nfirst; @@ -188,7 +192,6 @@ void FixBdSphere::initial_integrate(int /* vflag */) d3rot = 1; } - for (int i = 0; i < nlocal; i++) { if (mask[i] & groupbit) { @@ -204,49 +207,62 @@ void FixBdSphere::initial_integrate(int /* vflag */) x[i][2] += dz; v[i][2] = dz/dt; - omega[i][0] = d3rot * g3* torque[i][0]; omega[i][1] = d3rot * g3* torque[i][1]; omega[i][2] = g3* torque[i][2]; - - dtheta = sqrt((omega[i][0]*dt)*(omega[i][0]*dt) - +(omega[i][1]*dt)*(omega[i][1]*dt) - +(omega[i][2]*dt)*(omega[i][2]*dt)); - - if (abs(dtheta) < 1e-14) { - prefac_1 = dt; - prefac_2 = 0.5*dt*dt; - } else { - prefac_1 = dt*sin(dtheta)/dtheta; - prefac_2 = dt*dt*(1-cos(dtheta))/(dtheta*dtheta); + + } + } + + if (extra == DIPOLE) { + + double **mu = atom->mu; + double dtheta; + double mux,muy,muz,mu_tmp,wx,wy,wz; + double prefac_1, prefac_2; + + for (int i = 0; i < nlocal; i++) { + if (mask[i] & groupbit) { + + dtheta = sqrt((omega[i][0]*dt)*(omega[i][0]*dt) + +(omega[i][1]*dt)*(omega[i][1]*dt) + +(omega[i][2]*dt)*(omega[i][2]*dt)); + + + if (fabs(dtheta) < SMALL) { + prefac_1 = dt; + prefac_2 = 0.5*dt*dt; + } else { + prefac_1 = dt*sin(dtheta)/dtheta; + prefac_2 = dt*dt*(1-cos(dtheta))/(dtheta*dtheta); + } + + mux = mu[i][0]; + muy = mu[i][1]; + muz = mu[i][2]; + + wx = omega[i][0]; + wy = omega[i][1]; + wz = omega[i][2]; + + mu[i][0] = (mux + prefac_1 * ( -wz*muy + wy*muz ) + + prefac_2 * ( -1*( wz*wz + wy*wy ) * mux + + ( wz*muz + wy*muy ) * wx)); + + mu[i][1] = (muy + prefac_1 * ( wz*mux - wx*muz ) + + prefac_2 * ( -1*(wz*wz + wx*wx) * muy + + ( wz*muz + wx*mux ) * wy)); + + mu[i][2] = (muz + prefac_1 * ( -wy*mux + wx*muy ) + + prefac_2 * ( -1*( wx*wx + wy*wy ) * muz + + ( wy*muy + wx*mux ) * wz)); + + mu_tmp = sqrt(mu[i][0]*mu[i][0]+mu[i][1]*mu[i][1]+mu[i][2]*mu[i][2]); + + mu[i][0] = mu[i][0]/mu_tmp; + mu[i][1] = mu[i][1]/mu_tmp; + mu[i][2] = mu[i][2]/mu_tmp; } - - mux = mu[i][0]; - muy = mu[i][1]; - muz = mu[i][2]; - - wx = omega[i][0]; - wy = omega[i][1]; - wz = omega[i][2]; - - mu[i][0] = (mux + prefac_1 * ( -wz*muy + wy*muz ) - + prefac_2 * ( -1*( wz*wz + wy*wy ) * mux - + ( wz*muz + wy*muy ) * wx)); - - mu[i][1] = (muy + prefac_1 * ( wz*mux - wx*muz ) - + prefac_2 * ( -1*(wz*wz + wx*wx) * muy - + ( wz*muz + wx*mux ) * wy)); - - mu[i][2] = (muz + prefac_1 * ( -wy*mux + wx*muy ) - + prefac_2 * ( -1*( wx*wx + wy*wy ) * muz - + ( wy*muy + wx*mux ) * wz)); - - mu_tmp = sqrt(mu[i][0]*mu[i][0]+mu[i][1]*mu[i][1]+mu[i][2]*mu[i][2]); - - mu[i][0] = mu[i][0]/mu_tmp; - mu[i][1] = mu[i][1]/mu_tmp; - mu[i][2] = mu[i][2]/mu_tmp; - } } @@ -271,8 +287,6 @@ void FixBdSphere::post_force(int vflag) if (vflag) v_setup(vflag); else evflag = 0; - - double fx,fy,fz; double v[6]; diff --git a/src/fix_bd_sphere.h b/src/fix_bd_sphere.h index 873ba9ef2a..245e04274e 100644 --- a/src/fix_bd_sphere.h +++ b/src/fix_bd_sphere.h @@ -36,7 +36,7 @@ class FixBdSphere : public Fix { private: int seed; // RNG seed - + int extra; // set if dipole is used double dt, sqrtdt; // time step interval and its sqrt @@ -90,15 +90,4 @@ Self-explanatory. E: Fix bd/sphere seed must be > 0. -E: Cannot constrain rotational degrees of freedom - to the xy plane if the simulation is in 3D (in fix/bd/sphere). - -Self-explanatory. - -W: Using a 2D simulation, but allowing for full (3D) rotation - (in fix/bd/sphere). - -Self-explanatory. - - */ diff --git a/unittest/force-styles/tests/fix-timestep-bd_sphere.yaml b/unittest/force-styles/tests/fix-timestep-bd_sphere.yaml index 66a65bc3ba..b69f37e206 100644 --- a/unittest/force-styles/tests/fix-timestep-bd_sphere.yaml +++ b/unittest/force-styles/tests/fix-timestep-bd_sphere.yaml @@ -7,7 +7,7 @@ prerequisites: ! | fix bd_sphere pre_commands: ! "" post_commands: ! | - fix test solute bd_sphere 1.0 1.0 1.0 1.0 1049270 + fix test solute bd_sphere 1.0 1.0 1.0 1.0 1049270 dipole fix_modify test virial yes input_file: in.bdsphere natoms: 32 From ee99a2e960b1072e750b6bcd2c1e1f2000a3faa9 Mon Sep 17 00:00:00 2001 From: Sam Cameron Date: Thu, 10 Dec 2020 09:12:21 +0000 Subject: [PATCH 07/22] Added reset_dt() function. Have not moved files to USER-MISC folder yet (waiting to hear back on some comments). --- src/fix_bd_sphere.cpp | 10 +++++++--- src/fix_bd_sphere.h | 1 + 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/src/fix_bd_sphere.cpp b/src/fix_bd_sphere.cpp index ba7cd2a81c..cc3c788349 100644 --- a/src/fix_bd_sphere.cpp +++ b/src/fix_bd_sphere.cpp @@ -182,9 +182,6 @@ void FixBdSphere::initial_integrate(int /* vflag */) if (igroup == atom->firstgroup) nlocal = atom->nfirst; int d3rot; // whether to compute angular momentum in xy plane - - dt = update->dt; - sqrtdt = sqrt(dt); if (domain->dimension==2) { d3rot = 0; @@ -315,3 +312,10 @@ void FixBdSphere::post_force(int vflag) } } } + +void FixBdSphere::reset_dt() +{ + + dt = update->dt; + sqrtdt = sqrt(dt); +} diff --git a/src/fix_bd_sphere.h b/src/fix_bd_sphere.h index 245e04274e..8a3df214a6 100644 --- a/src/fix_bd_sphere.h +++ b/src/fix_bd_sphere.h @@ -33,6 +33,7 @@ class FixBdSphere : public Fix { void setup(int); void post_force(int); int setmask(); + void reset_dt(); private: int seed; // RNG seed From f81a17abbd922674bb4630610bd5e59feae202fa Mon Sep 17 00:00:00 2001 From: Sam Cameron Date: Fri, 11 Dec 2020 12:11:02 +0000 Subject: [PATCH 08/22] Moved fix_bd_sphere to src/USER-MISC folder, examples to examples/USER/misc folder, and added one-liner on README file. --- doc/src/fix_bd_sphere.rst | 4 ++++ examples/{ => USER/misc}/bd_sphere/README.txt | 0 examples/{ => USER/misc}/bd_sphere/in2ddipole.bd | 0 examples/{ => USER/misc}/bd_sphere/in3d_virial_on.bd | 0 .../misc}/bd_sphere/log_gaussian_4_1_7_13_2d.lammps.log | 0 .../misc}/bd_sphere/log_uniform_10_1_5_15_3d.lammps.log | 0 src/USER-MISC/README | 1 + src/{ => USER-MISC}/fix_bd_sphere.cpp | 0 src/{ => USER-MISC}/fix_bd_sphere.h | 0 9 files changed, 5 insertions(+) rename examples/{ => USER/misc}/bd_sphere/README.txt (100%) rename examples/{ => USER/misc}/bd_sphere/in2ddipole.bd (100%) rename examples/{ => USER/misc}/bd_sphere/in3d_virial_on.bd (100%) rename examples/{ => USER/misc}/bd_sphere/log_gaussian_4_1_7_13_2d.lammps.log (100%) rename examples/{ => USER/misc}/bd_sphere/log_uniform_10_1_5_15_3d.lammps.log (100%) rename src/{ => USER-MISC}/fix_bd_sphere.cpp (100%) rename src/{ => USER-MISC}/fix_bd_sphere.h (100%) diff --git a/doc/src/fix_bd_sphere.rst b/doc/src/fix_bd_sphere.rst index ee731c47d8..f1c9756a78 100644 --- a/doc/src/fix_bd_sphere.rst +++ b/doc/src/fix_bd_sphere.rst @@ -136,6 +136,10 @@ as defined by the :doc:`atom_style sphere ` command. They must also store a dipole moment as defined by the :doc:`atom_style dipole ` command. +This fix is part of the USER-MISC package. It is only enabled if +LAMMPS was built with that package. See the :doc:`Build package ` +doc page for more info. + All particles in the group must be finite-size spheres. They cannot be point particles. diff --git a/examples/bd_sphere/README.txt b/examples/USER/misc/bd_sphere/README.txt similarity index 100% rename from examples/bd_sphere/README.txt rename to examples/USER/misc/bd_sphere/README.txt diff --git a/examples/bd_sphere/in2ddipole.bd b/examples/USER/misc/bd_sphere/in2ddipole.bd similarity index 100% rename from examples/bd_sphere/in2ddipole.bd rename to examples/USER/misc/bd_sphere/in2ddipole.bd diff --git a/examples/bd_sphere/in3d_virial_on.bd b/examples/USER/misc/bd_sphere/in3d_virial_on.bd similarity index 100% rename from examples/bd_sphere/in3d_virial_on.bd rename to examples/USER/misc/bd_sphere/in3d_virial_on.bd diff --git a/examples/bd_sphere/log_gaussian_4_1_7_13_2d.lammps.log b/examples/USER/misc/bd_sphere/log_gaussian_4_1_7_13_2d.lammps.log similarity index 100% rename from examples/bd_sphere/log_gaussian_4_1_7_13_2d.lammps.log rename to examples/USER/misc/bd_sphere/log_gaussian_4_1_7_13_2d.lammps.log diff --git a/examples/bd_sphere/log_uniform_10_1_5_15_3d.lammps.log b/examples/USER/misc/bd_sphere/log_uniform_10_1_5_15_3d.lammps.log similarity index 100% rename from examples/bd_sphere/log_uniform_10_1_5_15_3d.lammps.log rename to examples/USER/misc/bd_sphere/log_uniform_10_1_5_15_3d.lammps.log diff --git a/src/USER-MISC/README b/src/USER-MISC/README index 538fdb7952..2dd16d23ac 100644 --- a/src/USER-MISC/README +++ b/src/USER-MISC/README @@ -53,6 +53,7 @@ dihedral_style table/cut, Mike Salerno, ksalerno@pha.jhu.edu, 11 May 18 fix accelerate/cos, Zheng Gong (ENS de Lyon), z.gong@outlook.com, 24 Apr 20 fix addtorque, Laurent Joly (U Lyon), ljoly.ulyon at gmail.com, 8 Aug 11 fix ave/correlate/long, Jorge Ramirez (UPM Madrid), jorge.ramirez at upm.es, 21 Oct 2015 +fix bd/sphere, Sam Cameron (U of Bristol), samuel.j.m.cameron at gmail.com, 10 Dec 2020 fix electron/stopping/fit, James Stewart (SNL), jstewa .at. sandia.gov, 23 Sep 2020 fix electron/stopping, Konstantin Avchaciov, k.avchachov at gmail.com, 26 Feb 2019 fix ffl, David Wilkins (EPFL Lausanne), david.wilkins @ epfl.ch, 28 Sep 2018 diff --git a/src/fix_bd_sphere.cpp b/src/USER-MISC/fix_bd_sphere.cpp similarity index 100% rename from src/fix_bd_sphere.cpp rename to src/USER-MISC/fix_bd_sphere.cpp diff --git a/src/fix_bd_sphere.h b/src/USER-MISC/fix_bd_sphere.h similarity index 100% rename from src/fix_bd_sphere.h rename to src/USER-MISC/fix_bd_sphere.h From 86ebe0a9d38c5cdd0066930ad18f7d2805d6514b Mon Sep 17 00:00:00 2001 From: Sam Cameron Date: Sun, 13 Dec 2020 16:56:00 +0000 Subject: [PATCH 09/22] Minor change to doc for bd/sphere. --- doc/src/fix_bd_sphere.rst | 63 ++++++++++++++++++++------------------- 1 file changed, 33 insertions(+), 30 deletions(-) diff --git a/doc/src/fix_bd_sphere.rst b/doc/src/fix_bd_sphere.rst index f1c9756a78..177af6e6d7 100644 --- a/doc/src/fix_bd_sphere.rst +++ b/doc/src/fix_bd_sphere.rst @@ -25,7 +25,7 @@ Syntax *uniform* = use uniform random number generator *gaussian* = use gaussian random number generator *none* = turn off noise - *dipole* value = none = update orientation of dipoles during integration + *dipole* value = none = update orientation of dipoles during integration Examples """""""" @@ -68,32 +68,32 @@ the :math:`\omega` axis, and infinitesimal rotation matrix (see e.g. :ref:`(Callegari) `, section 7.4). -The :doc:`fix_modify ` *virial* option is supported by this -fix to add the contribution due to the added forces on atoms to the -system's virial as part of :doc:`thermodynamic output `. -The default is *virial no*. +.. note:: + This integrator is designed for generic non-equilibrium + simulations with additive noise. There are two important cases which + (conceptually) reduce the number of free parameters in this fix. + (a) In equilibrium simulations + (where fluctuation dissipation theorems are obeyed), one can define + the thermal energy :math:`k_bT=D_t\gamma_t=D_r\gamma_r`. + (b) When a no-slip boundary condition is expected between the spheres and + the surrounding medium, the condition + :math:`\gamma_t=3\gamma_r/\sigma^2` must be explicitly + accounted for (e.g. by setting *gamma_t* to 3 and *gamma_r* to 1) where + :math:`sigma` is the particle diameter. + If both (a) and (b) are true, then one must ensure this explicitly via + the above relationships. +--------- -IMPORTANT NOTE: This integrator is designed for generic non-equilibrium -simulations with additive noise. There are two important cases which -(conceptually) reduce the number of free parameters in this fix. -(a) In equilibrium simulations -(where fluctuation dissipation theorems are obeyed), one can define -the thermal energy :math:`k_bT=D_t\gamma_t=D_r\gamma_r`. -(b) When a no-slip boundary condition is expected between the spheres and -the surrounding medium, the condition -:math:`\gamma_t=3\gamma_r/\sigma^2` must be explicitly -accounted for (e.g. by setting *gamma_t* to 3 and *gamma_r* to 1) where -:math:`sigma` is the particle diameter. -If both (a) and (b) are true, then one must ensure this explicitly via -the above relationships. +.. note:: + The diffusion coefficient :math:`D_t` is measured + in units of (length*length)/time and the diffusion coefficient + :math:`D_r` is measured in units of 1/time, where time and length + are in the units specified on the :doc:`units ` page. Similarly, + :math:`\gamma_t` and :math:`\gamma_r` are measured in + units of mass/time and (mass*length*length)/(time). -IMPORTANT NOTE: The diffusion coefficient :math:`D_t` is measured -in units of (length*length)/time and the diffusion coefficient -:math:`D_r` is measured in units of 1/time, where time and length -are in the units specified on the :doc:`units ` page. Similarly, -:math:`\gamma_t` and :math:`\gamma_r` are measured in -units of mass/time and (mass*length*length)/(time). +--------- If the *rng* keyword is used with the *uniform* value, then the noise is generated from a uniform distribution (see @@ -121,9 +121,14 @@ Restart, fix_modify, output, run start/stop, minimize info """"""""""""""""""""""""""""""""""""""""""""""""""""""""""" No information about this fix is written to :doc:`binary restart files `. -None of the :doc:`fix_modify ` options -are relevant to this fix. No global or per-atom quantities are stored +No global or per-atom quantities are stored by this fix for access by various :doc:`output commands `. + +The :doc:`fix_modify ` *virial* option is supported by this +fix to add the contribution due to the added forces on atoms to the +system's virial as part of :doc:`thermodynamic output `. +The default is *virial no*. + No parameter of this fix can be used with the *start/stop* keywords of the :doc:`run ` command. This fix is not invoked during :doc:`energy minimization `. @@ -133,15 +138,13 @@ Restrictions This fix requires that atoms store torque and angular velocity (omega) as defined by the :doc:`atom_style sphere ` command. -They must also store a dipole moment as defined by the -:doc:`atom_style dipole ` command. +If the *dipole* keyword is used, they must also store a dipole moment +as defined by the :doc:`atom_style dipole ` command. This fix is part of the USER-MISC package. It is only enabled if LAMMPS was built with that package. See the :doc:`Build package ` doc page for more info. -All particles in the group must be finite-size spheres. They cannot -be point particles. Related commands """""""""""""""" From f2e7f5263e85e7ea02685d9c420db2d4126737ab Mon Sep 17 00:00:00 2001 From: Sam Cameron Date: Wed, 16 Dec 2020 16:14:13 +0000 Subject: [PATCH 10/22] Added bd integrator for ellipsoidal particles as well. --- doc/src/Commands_fix.rst | 1 + doc/src/fix.rst | 3 +- doc/src/fix_bd_asphere.rst | 149 +++++++ examples/USER/misc/bd_asphere/README.txt | 2 + examples/USER/misc/bd_asphere/in3d.bd | 71 ++++ .../log_gaussian_4_1_7_13_3d.lammps.log | 154 +++++++ src/USER-MISC/README | 3 +- src/USER-MISC/fix_bd_asphere.cpp | 392 ++++++++++++++++++ src/USER-MISC/fix_bd_asphere.h | 103 +++++ 9 files changed, 876 insertions(+), 2 deletions(-) create mode 100644 doc/src/fix_bd_asphere.rst create mode 100644 examples/USER/misc/bd_asphere/README.txt create mode 100644 examples/USER/misc/bd_asphere/in3d.bd create mode 100644 examples/USER/misc/bd_asphere/log_gaussian_4_1_7_13_3d.lammps.log create mode 100644 src/USER-MISC/fix_bd_asphere.cpp create mode 100644 src/USER-MISC/fix_bd_asphere.h diff --git a/doc/src/Commands_fix.rst b/doc/src/Commands_fix.rst index 1be5348bfe..8be0908a1a 100644 --- a/doc/src/Commands_fix.rst +++ b/doc/src/Commands_fix.rst @@ -40,6 +40,7 @@ OPT. * :doc:`aveforce ` * :doc:`balance ` * :doc:`bd/sphere ` + * :doc:`bd/asphere ` * :doc:`bocs ` * :doc:`bond/break ` * :doc:`bond/create ` diff --git a/doc/src/fix.rst b/doc/src/fix.rst index 0993a885a5..c395489a58 100644 --- a/doc/src/fix.rst +++ b/doc/src/fix.rst @@ -181,8 +181,9 @@ accelerated styles exist. * :doc:`ave/histo/weight ` - weighted version of fix ave/histo * :doc:`ave/time ` - compute/output global time-averaged quantities * :doc:`aveforce ` - add an averaged force to each atom -* :doc:`bd/sphere ` - overdamped translational and rotational brownian dynamics * :doc:`balance ` - perform dynamic load-balancing +* :doc:`bd/asphere ` - integrate positions and orientations in overdamped motion +* :doc:`bd/sphere ` - overdamped translational and rotational brownian dynamics * :doc:`bocs ` - NPT style time integration with pressure correction * :doc:`bond/break ` - break bonds on the fly * :doc:`bond/create ` - create bonds on the fly diff --git a/doc/src/fix_bd_asphere.rst b/doc/src/fix_bd_asphere.rst new file mode 100644 index 0000000000..8c0337cb5e --- /dev/null +++ b/doc/src/fix_bd_asphere.rst @@ -0,0 +1,149 @@ +.. index:: fix bd/asphere + +fix bd/asphere command +====================== + +Syntax +"""""" + +.. parsed-literal:: + + fix ID group-ID bd/asphere gamma_t gamma_r diff_t diff_r seed keyword args + +* ID, group-ID are documented in :doc:`fix ` command +* bd/asphere = style name of this fix command +* gamma_t = translational friction coefficient +* gamma_r = rotational friction coefficient +* diff_t = translational diffusion coefficient +* diff_r = rotational diffusion coefficient +* zero or more keyword/value pairs may be appended +* keyword = *rng* or *dipole* + + .. parsed-literal:: + + *rng* value = *uniform* or *gaussian* or *none* + *uniform* = use uniform random number generator + *gaussian* = use gaussian random number generator + *none* = turn off noise + *dipole* value = none = update orientation of dipoles during integration + +Examples +"""""""" + +.. code-block:: LAMMPS + + fix 1 all bd/asphere 1.0 1.0 1.0 1.0 1294019 + fix 1 all bd/asphere 1.0 1.0 1.0 1.0 19581092 rng none dipole + fix 1 all bd/asphere 1.0 1.0 1.0 1.0 19581092 rng uniform + fix 1 all bd/asphere 1.0 1.0 1.0 1.0 19581092 dipole rng gaussian + + +Description +""""""""""" + +Perform Brownian Dynamics integration to update position, velocity, +angular velocity, particle orientation, and dipole moment for +finite-size elipsoidal particles in the group each timestep. +Brownian Dynamics uses Newton's laws of +motion in the limit that inertial forces are negligible compared to +viscous forces. The stochastic equations of motion are + +.. math:: + + dr = \frac{F}{\gamma_t}dt+\sqrt{2D_t}dW_t, \\ + d\Omega = \frac{T}{\gamma_r}dt + \sqrt{2D_r}dW_r, + +where :math:`d\Omega` is an infinitesimal rotation vector (see e.g. +Chapter 4 of :ref:`(Goldstein) `), :math:`dW_t` and +:math:`dW_r` are Wiener processes (see e.g. :ref:`(Gardiner) `). +The quaternions :math:`q` of the ellipsoid are updated each timestep from +the angular velocity vector. + +See :doc:`fix bd/sphere ` for discussion on the +values of :math:`\gamma_t`, :math:`\gamma_r`, :math:`D_t`, +and :math:`D_r` when simulating equilibrium systems. + + +If the *rng* keyword is used with the *uniform* value, then the noise +is generated from a uniform distribution (see +:ref:`(Dunweg) ` for why this works). This is the same method +of noise generation as used in :doc:`fix_langevin `. + +If the *rng* keyword is used with the *gaussian* value, then the noise +is generated from a gaussian distribution. Typically this added +complexity is unnecessary, and one should be fine using the *uniform* +value for reasons argued in :ref:`(Dunweg) `. + +If the *rng* keyword is used with the *none* value, then the noise +terms are set to zero. + +If the *dipole* keyword is used, then the dipole moments of the particles +are updated by setting them along the x axis of the ellipsoidal frames of +reference. + +---------- + +.. include:: accel_styles.rst + +---------- + +Restart, fix_modify, output, run start/stop, minimize info +""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +No information about this fix is written to :doc:`binary restart files `. +No global or per-atom quantities are stored +by this fix for access by various :doc:`output commands `. + +The :doc:`fix_modify ` *virial* option is supported by this +fix to add the contribution due to the added forces on atoms to the +system's virial as part of :doc:`thermodynamic output `. +The default is *virial no*. + +No parameter of this fix can be used with the *start/stop* keywords of +the :doc:`run ` command. This fix is not invoked during +:doc:`energy minimization `. + + +Restrictions +"""""""""""" + +This fix requires that atoms store torque and angular velocity (omega) +as defined by the :doc:`atom_style sphere ` command, as well +as atoms which have a definite orientation as defined by the +:doc:`atom_style ellipsoid ` command. +Optionally, they can also store a dipole moment as defined by the +:doc:`atom_style dipole ` command. + +This fix is part of the USER-MISC package. It is only enabled if +LAMMPS was built with that package. See the :doc:`Build package ` +doc page for more info. + +All particles in the group must be finite-size ellipsoids. They cannot +be point particles. + +Related commands +"""""""""""""""" + +:doc:`fix bd/sphere `, :doc:`fix langevin `, +:doc:`fix nve/asphere `, :doc:`atom style ` + +Default +""""""" + +The default for *rng* is *uniform*. + +---------- + +.. _GoldsteinCM1: + +**(Goldstein)** Goldstein, Poole, and Safko, Classical Mechanics, 3rd Ed. (2001). + +.. _GardinerC1: + +**(Gardiner)** Gardiner, A Handbook for the Natural and Social Sciences 4th Ed. (2009). + +.. _Dunweg7: + +**(Dunweg)** Dunweg and Paul, Int J of Modern Physics C, 2, 817-27 (1991). + + diff --git a/examples/USER/misc/bd_asphere/README.txt b/examples/USER/misc/bd_asphere/README.txt new file mode 100644 index 0000000000..7cb5d2e8e6 --- /dev/null +++ b/examples/USER/misc/bd_asphere/README.txt @@ -0,0 +1,2 @@ +The input file in2d.bd demonstrates how to run a 2d simulation +of ellipsoidal particles undergoing overdamped brownian motion. diff --git a/examples/USER/misc/bd_asphere/in3d.bd b/examples/USER/misc/bd_asphere/in3d.bd new file mode 100644 index 0000000000..6163eb0c58 --- /dev/null +++ b/examples/USER/misc/bd_asphere/in3d.bd @@ -0,0 +1,71 @@ +# 3d overdamped brownian dynamics + +variable rng string gaussian +variable gamma_t equal 4.0 +variable gamma_r equal 1.0 +variable D_t equal 7.0 +variable D_r equal 13.0 +variable seed equal 1974019 + +variable params string ${rng}_${gamma_t}_${gamma_r}_${D_t}_${D_r} + + +log log_${params}_3d.lammps.log +units lj +atom_style hybrid dipole sphere ellipsoid +dimension 3 +newton off + + +lattice sc 0.4 +region box block -4 4 -4 4 -4 4 +create_box 1 box +create_atoms 1 box +mass * 1.0 +set type * dipole/random ${seed} 1.0 +set type * shape 1 1 1 +set type * quat/random ${seed} +velocity all create 1.0 1 loop geom + + +neighbor 1.0 bin +neigh_modify every 1 delay 1 check yes + + + +pair_style none + + +fix 1 all bd/asphere ${gamma_t} ${gamma_r} ${D_t} ${D_r} ${seed} rng ${rng} dipole + + +compute press all pressure NULL virial + +thermo_style custom step temp epair c_press + +#equilibration +timestep 0.0000000001 +thermo 50000 +run 50000 +reset_timestep 0 + + +#initialisation for the main run + +# MSD +compute msd all msd + + +thermo_style custom step temp epair c_msd[*] c_press + + +# write trajectory and thermo in a log-scale frequency +#dump 1 all custom 1000 dump_${params}_3d.lammpstrj id type & +# x y xu yu mux muy muz fx fy fz +#dump_modify 1 first yes sort id + +timestep 0.00001 +thermo 10000 + +# main run +run 120000 diff --git a/examples/USER/misc/bd_asphere/log_gaussian_4_1_7_13_3d.lammps.log b/examples/USER/misc/bd_asphere/log_gaussian_4_1_7_13_3d.lammps.log new file mode 100644 index 0000000000..c6926dbccf --- /dev/null +++ b/examples/USER/misc/bd_asphere/log_gaussian_4_1_7_13_3d.lammps.log @@ -0,0 +1,154 @@ +units lj +atom_style hybrid dipole sphere ellipsoid +WARNING: Atom_style hybrid defines both pertype and peratom masses - both must be set, only peratom masses will be used (src/atom_vec_hybrid.cpp:157) +WARNING: Peratom rmass is in multiple sub-styles - must be used consistently (src/atom_vec_hybrid.cpp:219) +dimension 3 +newton off + + +lattice sc 0.4 +Lattice spacing in x,y,z = 1.3572088 1.3572088 1.3572088 +region box block -4 4 -4 4 -4 4 +create_box 1 box +Created orthogonal box = (-5.4288352 -5.4288352 -5.4288352) to (5.4288352 5.4288352 5.4288352) + 1 by 1 by 1 MPI processor grid +create_atoms 1 box +Created 512 atoms + create_atoms CPU = 0.001 seconds +mass * 1.0 +set type * dipole/random ${seed} 1.0 +set type * dipole/random 1974019 1.0 +Setting atom values ... + 512 settings made for dipole/random +set type * shape 1 1 1 +Setting atom values ... + 512 settings made for shape +set type * quat/random ${seed} +set type * quat/random 1974019 +Setting atom values ... + 512 settings made for quat/random +velocity all create 1.0 1 loop geom + + +neighbor 1.0 bin +neigh_modify every 1 delay 1 check yes + + + +pair_style none + + +fix 1 all bd/asphere ${gamma_t} ${gamma_r} ${D_t} ${D_r} ${seed} rng ${rng} dipole +fix 1 all bd/asphere 4 ${gamma_r} ${D_t} ${D_r} ${seed} rng ${rng} dipole +fix 1 all bd/asphere 4 1 ${D_t} ${D_r} ${seed} rng ${rng} dipole +fix 1 all bd/asphere 4 1 7 ${D_r} ${seed} rng ${rng} dipole +fix 1 all bd/asphere 4 1 7 13 ${seed} rng ${rng} dipole +fix 1 all bd/asphere 4 1 7 13 1974019 rng ${rng} dipole +fix 1 all bd/asphere 4 1 7 13 1974019 rng gaussian dipole + + +compute press all pressure NULL virial + +thermo_style custom step temp epair c_press + +#equilibration +timestep 0.0000000001 +thermo 50000 +run 50000 +WARNING: No pairwise cutoff or binsize set. Atom sorting therefore disabled. (src/atom.cpp:2118) +WARNING: Communication cutoff is 0.0. No ghost atoms will be generated. Atoms may get lost. (src/comm_brick.cpp:167) +Per MPI rank memory allocation (min/avg/max) = 5.379 | 5.379 | 5.379 Mbytes +Step Temp E_pair c_press + 0 1 0 0 + 50000 1.3923773e+11 0 0 +Loop time of 5.68636 on 1 procs for 50000 steps with 512 atoms + +Performance: 0.076 tau/day, 8792.977 timesteps/s +100.0% CPU use with 1 MPI tasks x 1 OpenMP threads + +MPI task timing breakdown: +Section | min time | avg time | max time |%varavg| %total +--------------------------------------------------------------- +Pair | 0 | 0 | 0 | 0.0 | 0.00 +Neigh | 0 | 0 | 0 | 0.0 | 0.00 +Comm | 0.11589 | 0.11589 | 0.11589 | 0.0 | 2.04 +Output | 2.1155e-05 | 2.1155e-05 | 2.1155e-05 | 0.0 | 0.00 +Modify | 5.4911 | 5.4911 | 5.4911 | 0.0 | 96.57 +Other | | 0.07936 | | | 1.40 + +Nlocal: 512.000 ave 512 max 512 min +Histogram: 1 0 0 0 0 0 0 0 0 0 +Nghost: 217.000 ave 217 max 217 min +Histogram: 1 0 0 0 0 0 0 0 0 0 +Neighs: 0.00000 ave 0 max 0 min +Histogram: 1 0 0 0 0 0 0 0 0 0 + +Total # of neighbors = 0 +Ave neighs/atom = 0.0000000 +Neighbor list builds = 0 +Dangerous builds = 0 +reset_timestep 0 + + +#initialisation for the main run + +# MSD +compute msd all msd + + +thermo_style custom step temp epair c_msd[*] c_press + + +# write trajectory and thermo in a log-scale frequency +dump 1 all custom 1000 dump_${params}_2d.lammpstrj id type x y xu yu mux muy muz fx fy fz +dump 1 all custom 1000 dump_gaussian_4_1_7_13_2d.lammpstrj id type x y xu yu mux muy muz fx fy fz +dump_modify 1 first yes sort id + +timestep 0.00001 +thermo 10000 + +# main run +run 120000 +WARNING: Communication cutoff is 0.0. No ghost atoms will be generated. Atoms may get lost. (src/comm_brick.cpp:167) +Per MPI rank memory allocation (min/avg/max) = 7.103 | 7.103 | 7.103 Mbytes +Step Temp E_pair c_msd[1] c_msd[2] c_msd[3] c_msd[4] c_press + 0 1.3923773e+11 0 0 0 0 0 0 + 10000 1413805.2 0 1.3943053 1.4055827 1.4346505 4.2345385 0 + 20000 1380788.4 0 2.8560158 2.6537192 2.698195 8.2079299 0 + 30000 1368735.7 0 4.2694087 4.1286924 3.9635117 12.361613 0 + 40000 1349446 0 5.4328386 6.0271243 5.3571941 16.817157 0 + 50000 1366690 0 7.0372792 7.3342977 6.7676981 21.139275 0 + 60000 1413212.4 0 8.6092241 8.3859529 8.3650987 25.360276 0 + 70000 1401310 0 10.085131 9.4972009 9.7949174 29.377249 0 + 80000 1419160.7 0 11.413946 10.964643 11.007284 33.385873 0 + 90000 1298713.5 0 12.556318 12.457196 12.055966 37.06948 0 + 100000 1430838.3 0 14.104796 13.817001 13.596538 41.518335 0 + 110000 1364246.8 0 15.382464 15.09201 15.017312 45.491785 0 + 120000 1389237.6 0 16.632972 16.343173 16.015748 48.991892 0 +Loop time of 13.595 on 1 procs for 120000 steps with 512 atoms + +Performance: 7626.329 tau/day, 8826.770 timesteps/s +100.0% CPU use with 1 MPI tasks x 1 OpenMP threads + +MPI task timing breakdown: +Section | min time | avg time | max time |%varavg| %total +--------------------------------------------------------------- +Pair | 0 | 0 | 0 | 0.0 | 0.00 +Neigh | 0.00079148 | 0.00079148 | 0.00079148 | 0.0 | 0.01 +Comm | 0.029132 | 0.029132 | 0.029132 | 0.0 | 0.21 +Output | 0.15178 | 0.15178 | 0.15178 | 0.0 | 1.12 +Modify | 13.222 | 13.222 | 13.222 | 0.0 | 97.25 +Other | | 0.1916 | | | 1.41 + +Nlocal: 512.000 ave 512 max 512 min +Histogram: 1 0 0 0 0 0 0 0 0 0 +Nghost: 0.00000 ave 0 max 0 min +Histogram: 1 0 0 0 0 0 0 0 0 0 +Neighs: 0.00000 ave 0 max 0 min +Histogram: 1 0 0 0 0 0 0 0 0 0 + +Total # of neighbors = 0 +Ave neighs/atom = 0.0000000 +Neighbor list builds = 1110 +Dangerous builds = 0 +Total wall time: 0:00:19 diff --git a/src/USER-MISC/README b/src/USER-MISC/README index 2dd16d23ac..ac41d60dfd 100644 --- a/src/USER-MISC/README +++ b/src/USER-MISC/README @@ -53,7 +53,8 @@ dihedral_style table/cut, Mike Salerno, ksalerno@pha.jhu.edu, 11 May 18 fix accelerate/cos, Zheng Gong (ENS de Lyon), z.gong@outlook.com, 24 Apr 20 fix addtorque, Laurent Joly (U Lyon), ljoly.ulyon at gmail.com, 8 Aug 11 fix ave/correlate/long, Jorge Ramirez (UPM Madrid), jorge.ramirez at upm.es, 21 Oct 2015 -fix bd/sphere, Sam Cameron (U of Bristol), samuel.j.m.cameron at gmail.com, 10 Dec 2020 +fix bd/sphere, Sam Cameron (U of Bristol), samuel.j.m.cameron at gmail.com, 13 Dec 2020 +fix bd/asphere, Sam Cameron (U of Bristol), samuel.j.m.cameron at gmail.com, 13 Dec 2020 fix electron/stopping/fit, James Stewart (SNL), jstewa .at. sandia.gov, 23 Sep 2020 fix electron/stopping, Konstantin Avchaciov, k.avchachov at gmail.com, 26 Feb 2019 fix ffl, David Wilkins (EPFL Lausanne), david.wilkins @ epfl.ch, 28 Sep 2018 diff --git a/src/USER-MISC/fix_bd_asphere.cpp b/src/USER-MISC/fix_bd_asphere.cpp new file mode 100644 index 0000000000..88772b9237 --- /dev/null +++ b/src/USER-MISC/fix_bd_asphere.cpp @@ -0,0 +1,392 @@ +/* ---------------------------------------------------------------------- + LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator + http://lammps.sandia.gov, Sandia National Laboratories + Steve Plimpton, sjplimp@sandia.gov + + Copyright (2003) Sandia Corporation. Under the terms of Contract + DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains + certain rights in this software. This software is distributed under + the GNU General Public License. + + See the README file in the top-level LAMMPS directory. +------------------------------------------------------------------------- */ + +/* ---------------------------------------------------------------------- + Originally modified from USER-CGDNA/fix_nve_dotc_langevin.cpp. + + Contributing author: Sam Cameron (University of Bristol) +------------------------------------------------------------------------- */ + +#include "fix_bd_asphere.h" + +#include +#include +#include "math_extra.h" +#include "atom.h" +#include "atom_vec_ellipsoid.h" +#include "force.h" +#include "update.h" +#include "comm.h" +#include "domain.h" +#include "random_mars.h" +#include "memory.h" +#include "error.h" + + +using namespace LAMMPS_NS; +using namespace FixConst; + +#define SMALL 1e-14 + +enum{NODIPOLE,DIPOLE}; + +/* ---------------------------------------------------------------------- */ + +FixBdAsphere::FixBdAsphere(LAMMPS *lmp, int narg, char **arg) : + Fix(lmp, narg, arg) +{ + virial_flag = 1; + + time_integrate = 1; + + dipole_flag = NODIPOLE; + + + if (narg > 11 || narg < 8 ) + error->all(FLERR,"Illegal fix bd/asphere command."); + + if (!atom->sphere_flag) + error->all(FLERR,"Fix bd/asphere requires atom style sphere"); + + gamma_t = utils::numeric(FLERR,arg[3],false,lmp); + if (gamma_t <= 0.0) + error->all(FLERR,"Fix bd/asphere translational viscous drag " + "coefficient must be > 0."); + + gamma_r = utils::numeric(FLERR,arg[4],false,lmp); + if (gamma_t <= 0.0) + error->all(FLERR,"Fix bd/asphere rotational viscous drag " + "coefficient must be > 0."); + + + diff_t = utils::numeric(FLERR,arg[5],false,lmp); + if (diff_t <= 0.0) + error->all(FLERR,"Fix bd/asphere translational diffusion " + "coefficient must be > 0."); + + diff_r = utils::numeric(FLERR,arg[6],false,lmp); + if (diff_r <= 0.0) + error->all(FLERR,"Fix bd/asphere rotational diffusion " + "coefficient must be > 0."); + + seed = utils::inumeric(FLERR,arg[7],false,lmp); + if (seed <= 0) error->all(FLERR,"Fix bd/asphere seed must be > 0."); + + noise_flag = 1; + gaussian_noise_flag = 0; + + int iarg = 8; + + while (iarg < narg) { + if (strcmp(arg[iarg],"rng") == 0) { + if (narg == iarg + 1) { + error->all(FLERR,"Illegal fix/bd/asphere command."); + } + if (strcmp(arg[iarg + 1],"uniform") == 0) { + noise_flag = 1; + } else if (strcmp(arg[iarg + 1],"gaussian") == 0) { + noise_flag = 1; + gaussian_noise_flag = 1; + } else if (strcmp(arg[iarg + 1],"none") == 0) { + noise_flag = 0; + } else { + error->all(FLERR,"Illegal fix/bd/asphere command."); + } + iarg = iarg + 2; + } else if (strcmp(arg[iarg],"dipole") == 0) { + dipole_flag = DIPOLE; + iarg = iarg + 1; + } else { + error->all(FLERR,"Illegal fix/bd/asphere command."); + } + } + + if (dipole_flag == DIPOLE && !atom->mu_flag) + error->all(FLERR,"Fix bd/asphere dipole requires atom attribute mu"); + + // initialize Marsaglia RNG with processor-unique seed + random = new RanMars(lmp,seed + comm->me); + +} + +/* ---------------------------------------------------------------------- */ + +int FixBdAsphere::setmask() +{ + int mask = 0; + mask |= INITIAL_INTEGRATE; + mask |= POST_FORCE; + return mask; +} + +/* ---------------------------------------------------------------------- */ + +FixBdAsphere::~FixBdAsphere() +{ + delete random; +} + + + +/* ---------------------------------------------------------------------- */ + +void FixBdAsphere::init() +{ + + + avec = (AtomVecEllipsoid *) atom->style_match("ellipsoid"); + if (!avec) + error->all(FLERR,"Compute bd/asphere requires " + "atom style ellipsoid"); + + // check that all particles are finite-size ellipsoids + // no point particles allowed, spherical is OK + + int *ellipsoid = atom->ellipsoid; + int *mask = atom->mask; + int nlocal = atom->nlocal; + + for (int i = 0; i < nlocal; i++) + if (mask[i] & groupbit) + if (ellipsoid[i] < 0) + error->one(FLERR,"Fix bd/asphere requires extended particles"); + + + if (dipole_flag == DIPOLE) { + + double f_act[3] = { 1.0, 0.0, 0.0 }; + double f_rot[3]; + double *quat; + int *ellipsoid = atom->ellipsoid; + AtomVecEllipsoid::Bonus *bonus = avec->bonus; + + double Q[3][3]; + + double **mu = atom->mu; + + for (int i = 0; i < nlocal; i++) { + if (mask[i] & groupbit) { + quat = bonus[ellipsoid[i]].quat; + MathExtra::quat_to_mat( quat, Q ); + MathExtra::matvec( Q, f_act, f_rot ); + + mu[i][0] = f_rot[0]; + mu[i][1] = f_rot[1]; + mu[i][2] = f_rot[2]; + + } + } + } + + g1 = force->ftm2v/gamma_t; + g3 = force->ftm2v/gamma_r; + if (noise_flag == 0) { + g2 = 0; + g4 = 0; + rng_func = &RanMars::zero_rng; + } else if (gaussian_noise_flag == 1) { + g2 = gamma_t*sqrt(2 * diff_t)/force->ftm2v; + g4 = gamma_r*sqrt(2 * diff_r)/force->ftm2v; + rng_func = &RanMars::gaussian; + } else { + g2 = gamma_t*sqrt( 24 * diff_t)/force->ftm2v; + g4 = gamma_r*sqrt( 24 * diff_r )/force->ftm2v; + rng_func = &RanMars::uniform_middle; + } + + dt = update->dt; + sqrtdt = sqrt(dt); +} + +void FixBdAsphere::setup(int vflag) +{ + post_force(vflag); +} + +/* ---------------------------------------------------------------------- */ + + +void FixBdAsphere::initial_integrate(int /* vflag */) +{ + double **x = atom->x; + double **v = atom->v; + double **f = atom->f; + double **omega = atom->omega; + double **torque = atom->torque; + int *mask = atom->mask; + int nlocal = atom->nlocal; + + if (igroup == atom->firstgroup) nlocal = atom->nfirst; + + int d3rot; // whether to compute angular momentum in xy plane + + if (domain->dimension==2) { + d3rot = 0; + } else { + d3rot = 1; + } + + if (dipole_flag == DIPOLE) { + + // if dipole is being tracked, then update it along with + // quaternions accordingly along with angular velocity + + double wq[4]; + + double *quat; + int *ellipsoid = atom->ellipsoid; + AtomVecEllipsoid::Bonus *bonus = avec->bonus; + + // project dipole along x axis of quat + double f_act[3] = { 1.0, 0.0, 0.0 }; + double f_rot[3]; + + double Q[3][3]; + + double **mu = atom->mu; + + + for (int i = 0; i < nlocal; i++) { + if (mask[i] & groupbit) { + + update_x_and_omega(x[i],v[i],omega[i],f[i],torque[i],d3rot); + + quat = bonus[ellipsoid[i]].quat; + + MathExtra::vecquat(omega[i],quat,wq); + + quat[0] = quat[0] + 0.5*dt*wq[0]; + quat[1] = quat[1] + 0.5*dt*wq[1]; + quat[2] = quat[2] + 0.5*dt*wq[2]; + quat[3] = quat[3] + 0.5*dt*wq[3]; + MathExtra::qnormalize(quat); + + MathExtra::quat_to_mat( quat, Q ); + MathExtra::matvec( Q, f_act, f_rot ); + + mu[i][0] = f_rot[0]; + mu[i][1] = f_rot[1]; + mu[i][2] = f_rot[2]; + + } + } + } else { + + // if no dipole, just update quaternions and + // angular velocity + + + double wq[4]; + + double *quat; + int *ellipsoid = atom->ellipsoid; + AtomVecEllipsoid::Bonus *bonus = avec->bonus; + + for (int i = 0; i < nlocal; i++) { + if (mask[i] & groupbit) { + + update_x_and_omega(x[i],v[i],omega[i],f[i],torque[i],d3rot); + + quat = bonus[ellipsoid[i]].quat; + + MathExtra::vecquat(omega[i],quat,wq); + + quat[0] = quat[0] + 0.5*dt*wq[0]; + quat[1] = quat[1] + 0.5*dt*wq[1]; + quat[2] = quat[2] + 0.5*dt*wq[2]; + quat[3] = quat[3] + 0.5*dt*wq[3]; + MathExtra::qnormalize(quat); + + } + } + } + return; +} + +void FixBdAsphere::update_x_and_omega(double *x, double *v, double *omega, + double *f, double *torque, int d3rot) +{ + double dx, dy, dz; + + dx = dt * g1 * f[0]; + x[0] += dx; + v[0] = dx/dt; + + dy = dt * g1 * f[1]; + x[1] += dy; + v[1] = dy/dt; + + dz = dt * g1 * f[2]; + x[2] += dz; + v[2] = dz/dt; + + omega[0] = d3rot * g3* torque[0]; + omega[1] = d3rot * g3* torque[1]; + omega[2] = g3* torque[2]; + + return; +} + +/* ---------------------------------------------------------------------- + apply random force, stolen from MISC/fix_efield.cpp +------------------------------------------------------------------------- */ + +void FixBdAsphere::post_force(int vflag) +{ + double **f = atom->f; + double **x = atom->x; + double **torque = atom->torque; + int *mask = atom->mask; + imageint *image = atom->image; + int nlocal = atom->nlocal; + + // virial setup + + if (vflag) v_setup(vflag); + else evflag = 0; + + double fx,fy,fz; + double v[6]; + + for (int i = 0; i < nlocal; i++) + if (mask[i] & groupbit) { + + fx = g2 * (random->*rng_func)()/sqrtdt; + fy = g2 * (random->*rng_func)()/sqrtdt; + fz = g2 * (random->*rng_func)()/sqrtdt; + f[i][0] += fx; + f[i][1] += fy; + f[i][2] += fz; + + torque[i][0] = g4*(random->*rng_func)()/sqrtdt; + torque[i][1] = g4*(random->*rng_func)()/sqrtdt; + torque[i][2] = g4*(random->*rng_func)()/sqrtdt; + + if (evflag) { + v[0] = fx*x[i][0]; + v[1] = fy*x[i][1]; + v[2] = fz*x[i][2]; + v[3] = fx*x[i][1]; + v[4] = fx*x[i][2]; + v[5] = fy*x[i][2]; + v_tally(i, v); + } + } +} + +void FixBdAsphere::reset_dt() +{ + + dt = update->dt; + sqrtdt = sqrt(dt); +} diff --git a/src/USER-MISC/fix_bd_asphere.h b/src/USER-MISC/fix_bd_asphere.h new file mode 100644 index 0000000000..696b659729 --- /dev/null +++ b/src/USER-MISC/fix_bd_asphere.h @@ -0,0 +1,103 @@ +/* -*- c++ -*- ---------------------------------------------------------- + LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator + http://lammps.sandia.gov, Sandia National Laboratories + Steve Plimpton, sjplimp@sandia.gov + + Copyright (2003) Sandia Corporation. Under the terms of Contract + DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains + certain rights in this software. This software is distributed under + the GNU General Public License. + + See the README file in the top-level LAMMPS directory. +------------------------------------------------------------------------- */ + +#ifdef FIX_CLASS + +FixStyle(bd/asphere,FixBdAsphere) + +#else + +#ifndef LMP_FIX_BD_ASPHERE_H +#define LMP_FIX_BD_ASPHERE_H + +#include "fix.h" + +namespace LAMMPS_NS { + +class FixBdAsphere : public Fix { + public: + FixBdAsphere(class LAMMPS *, int, char **); + virtual ~FixBdAsphere(); + void init(); + void initial_integrate(int); + void setup(int); + void post_force(int); + int setmask(); + void reset_dt(); + void update_x_and_omega(double *, double *, double *, + double *, double *, int ); + + + private: + int seed; // RNG seed + int dipole_flag; // set if dipole is used + double dt, sqrtdt; // time step interval and its sqrt + + + double gamma_t,gamma_r; // translational and rotational damping params + double diff_t,diff_r; // translational and rotational diffusion coeffs + + double g1,g2, g3, g4; // prefactors in time stepping + int noise_flag; // 0/1 for noise off/on + int gaussian_noise_flag; // 0/1 for uniform/gaussian noise + + class AtomVecEllipsoid *avec; + +protected: + class RanMars *random; + typedef double (RanMars::*rng_member)(); + rng_member rng_func; // placeholder for RNG function + +}; + +} +#endif +#endif + +/* ERROR/WARNING messages: + +E: Illegal fix bd/asphere command. + +Wrong number/type of input arguments. + +E: Compute bd/asphere requires atom style sphere + +Self-explanatory. + +E: Compute bd/asphere requires atom style ellipsoid + +Self-explanatory. + +E: Compute bd/asphere dipole requires atom attribute mu + +Self-explanatory. + +E: Fix bd/asphere translational viscous drag coefficient must be > 0. + +Self-explanatory. + +E: Fix bd/asphere rotational viscous drag coefficient must be > 0. + +Self-explanatory. + +E: Fix bd/asphere translational diffusion coefficient must be > 0. + +Self-explanatory. + +E: Fix bd/asphere rotational diffusion coefficient must be > 0. + +Self-explanatory. + +E: Fix bd/asphere seed must be > 0. + +*/ From d9440a582c66086fd6c18e78f0f7716a4a969d8a Mon Sep 17 00:00:00 2001 From: Sam Cameron Date: Wed, 16 Dec 2020 17:30:28 +0000 Subject: [PATCH 11/22] Final touches on docs to discuss temperature in overdamped dynamics. --- doc/src/fix_bd_asphere.rst | 2 +- doc/src/fix_bd_sphere.rst | 14 ++++++++++++++ 2 files changed, 15 insertions(+), 1 deletion(-) diff --git a/doc/src/fix_bd_asphere.rst b/doc/src/fix_bd_asphere.rst index 8c0337cb5e..67d32e2038 100644 --- a/doc/src/fix_bd_asphere.rst +++ b/doc/src/fix_bd_asphere.rst @@ -61,7 +61,7 @@ the angular velocity vector. See :doc:`fix bd/sphere ` for discussion on the values of :math:`\gamma_t`, :math:`\gamma_r`, :math:`D_t`, -and :math:`D_r` when simulating equilibrium systems. +:math:`D_r`, and temperature when simulating equilibrium systems. If the *rng* keyword is used with the *uniform* value, then the noise diff --git a/doc/src/fix_bd_sphere.rst b/doc/src/fix_bd_sphere.rst index 177af6e6d7..eeaaca470c 100644 --- a/doc/src/fix_bd_sphere.rst +++ b/doc/src/fix_bd_sphere.rst @@ -85,6 +85,16 @@ section 7.4). --------- +.. note:: + Temperature computation using the :doc:`compute temp ` + will not correctly compute temperature of these overdamped dynamics + since we are explicitly neglecting inertial effects. + See e.g. chapter 6 of :ref:`(Doi) ` for more details on this. + Temperature is instead defined in terms of the note above (for + equilibrium systems). + +--------- + .. note:: The diffusion coefficient :math:`D_t` is measured in units of (length*length)/time and the diffusion coefficient @@ -172,6 +182,10 @@ The default for *rng* is *uniform*. **(Callegari)** Callegari and Volpe, *Numerical Simulations of Active Brownian Particles*, Flowing Matter, 211-238 (2019). +.. _Doi1: + +**(Doi)** Doi, Soft Matter Physics (2013). + .. _Dunweg6: **(Dunweg)** Dunweg and Paul, Int J of Modern Physics C, 2, 817-27 (1991). From 4c1f44935039a8ec85186fee7635e3cd08405f7e Mon Sep 17 00:00:00 2001 From: Sam Cameron Date: Sat, 19 Dec 2020 17:42:47 +0000 Subject: [PATCH 12/22] Moved brownian dynamics files to be in USER-BROWNIAN package --- cmake/CMakeLists.txt | 2 +- doc/src/Commands_fix.rst | 4 +- doc/src/fix.rst | 4 +- ...d_asphere.rst => fix_brownian_asphere.rst} | 22 ++++---- ..._bd_sphere.rst => fix_brownian_sphere.rst} | 18 +++---- .../{misc => brownian}/bd_asphere/README.txt | 0 .../bd_asphere/in3d.brownian} | 2 +- .../log_gaussian_4_1_7_13_3d.lammps.log | 49 +++++++++-------- .../{misc => brownian}/bd_sphere/README.txt | 10 ++-- .../bd_sphere/in2ddipole.brownian} | 2 +- .../bd_sphere/in3d_virial_on.brownian} | 2 +- .../log_gaussian_4_1_7_13_2d.lammps.log | 53 ++++++++++--------- .../log_uniform_10_1_5_15_3d.lammps.log | 0 .../fix_brownian_asphere.cpp} | 46 ++++++++-------- .../fix_brownian_asphere.h} | 30 +++++------ .../fix_brownian_sphere.cpp} | 40 +++++++------- .../fix_brownian_sphere.h} | 28 +++++----- src/USER-MISC/README | 2 - .../tests/{data.bdsphere => data.brownian} | 0 ...sphere.yaml => fix-timestep-brownian.yaml} | 6 +-- .../tests/{in.bdsphere => in.brownian} | 2 +- 21 files changed, 160 insertions(+), 162 deletions(-) rename doc/src/{fix_bd_asphere.rst => fix_brownian_asphere.rst} (86%) rename doc/src/{fix_bd_sphere.rst => fix_brownian_sphere.rst} (92%) rename examples/USER/{misc => brownian}/bd_asphere/README.txt (100%) rename examples/USER/{misc/bd_asphere/in3d.bd => brownian/bd_asphere/in3d.brownian} (93%) rename examples/USER/{misc => brownian}/bd_asphere/log_gaussian_4_1_7_13_3d.lammps.log (74%) rename examples/USER/{misc => brownian}/bd_sphere/README.txt (73%) rename examples/USER/{misc/bd_sphere/in2ddipole.bd => brownian/bd_sphere/in2ddipole.brownian} (93%) rename examples/USER/{misc/bd_sphere/in3d_virial_on.bd => brownian/bd_sphere/in3d_virial_on.brownian} (93%) rename examples/USER/{misc => brownian}/bd_sphere/log_gaussian_4_1_7_13_2d.lammps.log (89%) rename examples/USER/{misc => brownian}/bd_sphere/log_uniform_10_1_5_15_3d.lammps.log (100%) rename src/{USER-MISC/fix_bd_asphere.cpp => USER-BROWNIAN/fix_brownian_asphere.cpp} (85%) rename src/{USER-MISC/fix_bd_asphere.h => USER-BROWNIAN/fix_brownian_asphere.h} (69%) rename src/{USER-MISC/fix_bd_sphere.cpp => USER-BROWNIAN/fix_brownian_sphere.cpp} (85%) rename src/{USER-MISC/fix_bd_sphere.h => USER-BROWNIAN/fix_brownian_sphere.h} (70%) rename unittest/force-styles/tests/{data.bdsphere => data.brownian} (100%) rename unittest/force-styles/tests/{fix-timestep-bd_sphere.yaml => fix-timestep-brownian.yaml} (97%) rename unittest/force-styles/tests/{in.bdsphere => in.brownian} (88%) diff --git a/cmake/CMakeLists.txt b/cmake/CMakeLists.txt index 42e6d12ffb..26d86e0a06 100644 --- a/cmake/CMakeLists.txt +++ b/cmake/CMakeLists.txt @@ -112,7 +112,7 @@ set(STANDARD_PACKAGES ASPHERE BODY CLASS2 COLLOID COMPRESS DIPOLE USER-MANIFOLD USER-MEAMC USER-MESONT USER-MGPT USER-MISC USER-MOFFF USER-MOLFILE USER-NETCDF USER-PHONON USER-PLUMED USER-PTM USER-QTB USER-REACTION USER-REAXC USER-SCAFACOS USER-SDPD USER-SMD USER-SMTBQ USER-SPH USER-TALLY - USER-UEF USER-VTK USER-QUIP USER-QMMM USER-YAFF USER-ADIOS) + USER-UEF USER-VTK USER-QUIP USER-QMMM USER-YAFF USER-ADIOS USER-BROWNIAN) set(SUFFIX_PACKAGES CORESHELL USER-OMP KOKKOS OPT USER-INTEL GPU) foreach(PKG ${STANDARD_PACKAGES} ${SUFFIX_PACKAGES}) option(PKG_${PKG} "Build ${PKG} Package" OFF) diff --git a/doc/src/Commands_fix.rst b/doc/src/Commands_fix.rst index 8be0908a1a..361ec7e982 100644 --- a/doc/src/Commands_fix.rst +++ b/doc/src/Commands_fix.rst @@ -39,8 +39,8 @@ OPT. * :doc:`ave/time ` * :doc:`aveforce ` * :doc:`balance ` - * :doc:`bd/sphere ` - * :doc:`bd/asphere ` + * :doc:`brownian/asphere ` + * :doc:`brownian/sphere ` * :doc:`bocs ` * :doc:`bond/break ` * :doc:`bond/create ` diff --git a/doc/src/fix.rst b/doc/src/fix.rst index c395489a58..5efe002f31 100644 --- a/doc/src/fix.rst +++ b/doc/src/fix.rst @@ -182,8 +182,8 @@ accelerated styles exist. * :doc:`ave/time ` - compute/output global time-averaged quantities * :doc:`aveforce ` - add an averaged force to each atom * :doc:`balance ` - perform dynamic load-balancing -* :doc:`bd/asphere ` - integrate positions and orientations in overdamped motion -* :doc:`bd/sphere ` - overdamped translational and rotational brownian dynamics +* :doc:`brownian/asphere ` - overdamped translational and rotational brownian for ellipsoids +* :doc:`brownian/sphere ` - overdamped translational and rotational brownian for spheres * :doc:`bocs ` - NPT style time integration with pressure correction * :doc:`bond/break ` - break bonds on the fly * :doc:`bond/create ` - create bonds on the fly diff --git a/doc/src/fix_bd_asphere.rst b/doc/src/fix_brownian_asphere.rst similarity index 86% rename from doc/src/fix_bd_asphere.rst rename to doc/src/fix_brownian_asphere.rst index 67d32e2038..58dd453de9 100644 --- a/doc/src/fix_bd_asphere.rst +++ b/doc/src/fix_brownian_asphere.rst @@ -1,17 +1,17 @@ -.. index:: fix bd/asphere +.. index:: fix brownian/asphere -fix bd/asphere command -====================== +fix brownian/asphere command +============================ Syntax """""" .. parsed-literal:: - fix ID group-ID bd/asphere gamma_t gamma_r diff_t diff_r seed keyword args + fix ID group-ID brownian/asphere gamma_t gamma_r diff_t diff_r seed keyword args * ID, group-ID are documented in :doc:`fix ` command -* bd/asphere = style name of this fix command +* brownian/asphere = style name of this fix command * gamma_t = translational friction coefficient * gamma_r = rotational friction coefficient * diff_t = translational diffusion coefficient @@ -32,10 +32,10 @@ Examples .. code-block:: LAMMPS - fix 1 all bd/asphere 1.0 1.0 1.0 1.0 1294019 - fix 1 all bd/asphere 1.0 1.0 1.0 1.0 19581092 rng none dipole - fix 1 all bd/asphere 1.0 1.0 1.0 1.0 19581092 rng uniform - fix 1 all bd/asphere 1.0 1.0 1.0 1.0 19581092 dipole rng gaussian + fix 1 all brownian/asphere 1.0 1.0 1.0 1.0 1294019 + fix 1 all brownian/asphere 1.0 1.0 1.0 1.0 19581092 rng none dipole + fix 1 all brownian/asphere 1.0 1.0 1.0 1.0 19581092 rng uniform + fix 1 all brownian/asphere 1.0 1.0 1.0 1.0 19581092 dipole rng gaussian Description @@ -59,7 +59,7 @@ Chapter 4 of :ref:`(Goldstein) `), :math:`dW_t` and The quaternions :math:`q` of the ellipsoid are updated each timestep from the angular velocity vector. -See :doc:`fix bd/sphere ` for discussion on the +See :doc:`fix brownian/sphere ` for discussion on the values of :math:`\gamma_t`, :math:`\gamma_r`, :math:`D_t`, :math:`D_r`, and temperature when simulating equilibrium systems. @@ -124,7 +124,7 @@ be point particles. Related commands """""""""""""""" -:doc:`fix bd/sphere `, :doc:`fix langevin `, +:doc:`fix brownian/sphere `, :doc:`fix langevin `, :doc:`fix nve/asphere `, :doc:`atom style ` Default diff --git a/doc/src/fix_bd_sphere.rst b/doc/src/fix_brownian_sphere.rst similarity index 92% rename from doc/src/fix_bd_sphere.rst rename to doc/src/fix_brownian_sphere.rst index eeaaca470c..231486dee1 100644 --- a/doc/src/fix_bd_sphere.rst +++ b/doc/src/fix_brownian_sphere.rst @@ -1,17 +1,17 @@ -.. index:: fix bd/sphere +.. index:: fix brownian/sphere -fix bd/sphere command -====================== +fix brownian/sphere command +=========================== Syntax """""" .. parsed-literal:: - fix ID group-ID bd/sphere gamma_t gamma_r diff_t diff_r seed keyword args + fix ID group-ID brownian/sphere gamma_t gamma_r diff_t diff_r seed keyword args * ID, group-ID are documented in :doc:`fix ` command -* bd/sphere = style name of this fix command +* brownian/sphere = style name of this fix command * gamma_t = translational friction coefficient * gamma_r = rotational friction coefficient * diff_t = translational diffusion coefficient @@ -32,10 +32,10 @@ Examples .. code-block:: LAMMPS - fix 1 all bd/sphere 1.0 1.0 1.0 1.0 1294019 - fix 1 all bd/sphere 1.0 1.0 1.0 1.0 19581092 rng none dipole - fix 1 all bd/sphere 1.0 1.0 1.0 1.0 19581092 rng uniform - fix 1 all bd/sphere 1.0 1.0 1.0 1.0 19581092 dipole rng gaussian + fix 1 all brownian/sphere 1.0 1.0 1.0 1.0 1294019 + fix 1 all brownian/sphere 1.0 1.0 1.0 1.0 19581092 rng none dipole + fix 1 all brownian/sphere 1.0 1.0 1.0 1.0 19581092 rng uniform + fix 1 all brownian/sphere 1.0 1.0 1.0 1.0 19581092 dipole rng gaussian Description diff --git a/examples/USER/misc/bd_asphere/README.txt b/examples/USER/brownian/bd_asphere/README.txt similarity index 100% rename from examples/USER/misc/bd_asphere/README.txt rename to examples/USER/brownian/bd_asphere/README.txt diff --git a/examples/USER/misc/bd_asphere/in3d.bd b/examples/USER/brownian/bd_asphere/in3d.brownian similarity index 93% rename from examples/USER/misc/bd_asphere/in3d.bd rename to examples/USER/brownian/bd_asphere/in3d.brownian index 6163eb0c58..67d95a82b9 100644 --- a/examples/USER/misc/bd_asphere/in3d.bd +++ b/examples/USER/brownian/bd_asphere/in3d.brownian @@ -36,7 +36,7 @@ neigh_modify every 1 delay 1 check yes pair_style none -fix 1 all bd/asphere ${gamma_t} ${gamma_r} ${D_t} ${D_r} ${seed} rng ${rng} dipole +fix 1 all brownian/asphere ${gamma_t} ${gamma_r} ${D_t} ${D_r} ${seed} rng ${rng} dipole compute press all pressure NULL virial diff --git a/examples/USER/misc/bd_asphere/log_gaussian_4_1_7_13_3d.lammps.log b/examples/USER/brownian/bd_asphere/log_gaussian_4_1_7_13_3d.lammps.log similarity index 74% rename from examples/USER/misc/bd_asphere/log_gaussian_4_1_7_13_3d.lammps.log rename to examples/USER/brownian/bd_asphere/log_gaussian_4_1_7_13_3d.lammps.log index c6926dbccf..21bd04f7da 100644 --- a/examples/USER/misc/bd_asphere/log_gaussian_4_1_7_13_3d.lammps.log +++ b/examples/USER/brownian/bd_asphere/log_gaussian_4_1_7_13_3d.lammps.log @@ -38,13 +38,13 @@ neigh_modify every 1 delay 1 check yes pair_style none -fix 1 all bd/asphere ${gamma_t} ${gamma_r} ${D_t} ${D_r} ${seed} rng ${rng} dipole -fix 1 all bd/asphere 4 ${gamma_r} ${D_t} ${D_r} ${seed} rng ${rng} dipole -fix 1 all bd/asphere 4 1 ${D_t} ${D_r} ${seed} rng ${rng} dipole -fix 1 all bd/asphere 4 1 7 ${D_r} ${seed} rng ${rng} dipole -fix 1 all bd/asphere 4 1 7 13 ${seed} rng ${rng} dipole -fix 1 all bd/asphere 4 1 7 13 1974019 rng ${rng} dipole -fix 1 all bd/asphere 4 1 7 13 1974019 rng gaussian dipole +fix 1 all brownian/asphere ${gamma_t} ${gamma_r} ${D_t} ${D_r} ${seed} rng ${rng} dipole +fix 1 all brownian/asphere 4 ${gamma_r} ${D_t} ${D_r} ${seed} rng ${rng} dipole +fix 1 all brownian/asphere 4 1 ${D_t} ${D_r} ${seed} rng ${rng} dipole +fix 1 all brownian/asphere 4 1 7 ${D_r} ${seed} rng ${rng} dipole +fix 1 all brownian/asphere 4 1 7 13 ${seed} rng ${rng} dipole +fix 1 all brownian/asphere 4 1 7 13 1974019 rng ${rng} dipole +fix 1 all brownian/asphere 4 1 7 13 1974019 rng gaussian dipole compute press all pressure NULL virial @@ -61,9 +61,9 @@ Per MPI rank memory allocation (min/avg/max) = 5.379 | 5.379 | 5.379 Mbytes Step Temp E_pair c_press 0 1 0 0 50000 1.3923773e+11 0 0 -Loop time of 5.68636 on 1 procs for 50000 steps with 512 atoms +Loop time of 5.61345 on 1 procs for 50000 steps with 512 atoms -Performance: 0.076 tau/day, 8792.977 timesteps/s +Performance: 0.077 tau/day, 8907.171 timesteps/s 100.0% CPU use with 1 MPI tasks x 1 OpenMP threads MPI task timing breakdown: @@ -71,10 +71,10 @@ Section | min time | avg time | max time |%varavg| %total --------------------------------------------------------------- Pair | 0 | 0 | 0 | 0.0 | 0.00 Neigh | 0 | 0 | 0 | 0.0 | 0.00 -Comm | 0.11589 | 0.11589 | 0.11589 | 0.0 | 2.04 -Output | 2.1155e-05 | 2.1155e-05 | 2.1155e-05 | 0.0 | 0.00 -Modify | 5.4911 | 5.4911 | 5.4911 | 0.0 | 96.57 -Other | | 0.07936 | | | 1.40 +Comm | 0.11822 | 0.11822 | 0.11822 | 0.0 | 2.11 +Output | 2.0199e-05 | 2.0199e-05 | 2.0199e-05 | 0.0 | 0.00 +Modify | 5.4135 | 5.4135 | 5.4135 | 0.0 | 96.44 +Other | | 0.0817 | | | 1.46 Nlocal: 512.000 ave 512 max 512 min Histogram: 1 0 0 0 0 0 0 0 0 0 @@ -100,9 +100,8 @@ thermo_style custom step temp epair c_msd[*] c_press # write trajectory and thermo in a log-scale frequency -dump 1 all custom 1000 dump_${params}_2d.lammpstrj id type x y xu yu mux muy muz fx fy fz -dump 1 all custom 1000 dump_gaussian_4_1_7_13_2d.lammpstrj id type x y xu yu mux muy muz fx fy fz -dump_modify 1 first yes sort id +#dump 1 all custom 1000 dump_${params}_3d.lammpstrj id type # x y xu yu mux muy muz fx fy fz +#dump_modify 1 first yes sort id timestep 0.00001 thermo 10000 @@ -110,7 +109,7 @@ thermo 10000 # main run run 120000 WARNING: Communication cutoff is 0.0. No ghost atoms will be generated. Atoms may get lost. (src/comm_brick.cpp:167) -Per MPI rank memory allocation (min/avg/max) = 7.103 | 7.103 | 7.103 Mbytes +Per MPI rank memory allocation (min/avg/max) = 5.754 | 5.754 | 5.754 Mbytes Step Temp E_pair c_msd[1] c_msd[2] c_msd[3] c_msd[4] c_press 0 1.3923773e+11 0 0 0 0 0 0 10000 1413805.2 0 1.3943053 1.4055827 1.4346505 4.2345385 0 @@ -125,20 +124,20 @@ Step Temp E_pair c_msd[1] c_msd[2] c_msd[3] c_msd[4] c_press 100000 1430838.3 0 14.104796 13.817001 13.596538 41.518335 0 110000 1364246.8 0 15.382464 15.09201 15.017312 45.491785 0 120000 1389237.6 0 16.632972 16.343173 16.015748 48.991892 0 -Loop time of 13.595 on 1 procs for 120000 steps with 512 atoms +Loop time of 13.2439 on 1 procs for 120000 steps with 512 atoms -Performance: 7626.329 tau/day, 8826.770 timesteps/s +Performance: 7828.487 tau/day, 9060.749 timesteps/s 100.0% CPU use with 1 MPI tasks x 1 OpenMP threads MPI task timing breakdown: Section | min time | avg time | max time |%varavg| %total --------------------------------------------------------------- Pair | 0 | 0 | 0 | 0.0 | 0.00 -Neigh | 0.00079148 | 0.00079148 | 0.00079148 | 0.0 | 0.01 -Comm | 0.029132 | 0.029132 | 0.029132 | 0.0 | 0.21 -Output | 0.15178 | 0.15178 | 0.15178 | 0.0 | 1.12 -Modify | 13.222 | 13.222 | 13.222 | 0.0 | 97.25 -Other | | 0.1916 | | | 1.41 +Neigh | 0.00075178 | 0.00075178 | 0.00075178 | 0.0 | 0.01 +Comm | 0.0282 | 0.0282 | 0.0282 | 0.0 | 0.21 +Output | 0.00032692 | 0.00032692 | 0.00032692 | 0.0 | 0.00 +Modify | 13.017 | 13.017 | 13.017 | 0.0 | 98.29 +Other | | 0.1976 | | | 1.49 Nlocal: 512.000 ave 512 max 512 min Histogram: 1 0 0 0 0 0 0 0 0 0 @@ -151,4 +150,4 @@ Total # of neighbors = 0 Ave neighs/atom = 0.0000000 Neighbor list builds = 1110 Dangerous builds = 0 -Total wall time: 0:00:19 +Total wall time: 0:00:18 diff --git a/examples/USER/misc/bd_sphere/README.txt b/examples/USER/brownian/bd_sphere/README.txt similarity index 73% rename from examples/USER/misc/bd_sphere/README.txt rename to examples/USER/brownian/bd_sphere/README.txt index 2f66504581..8987a23601 100644 --- a/examples/USER/misc/bd_sphere/README.txt +++ b/examples/USER/brownian/bd_sphere/README.txt @@ -1,11 +1,11 @@ -The input file in2ddipole.bd demonstrates how to run a 2d simulation -of particles undergoing overdamped brownian motion in both -translational and rotational degrees of freedom. Dipole +The input file in2ddipole.brownian demonstrates how to run a +2d simulation of particles undergoing overdamped brownian motion +in both translational and rotational degrees of freedom. Dipole updating is turned on, so the package DIPOLE must be built for this example to work. -The input file in3d_virial_on.bd demonstrates how to run a -similar simulation but in 3d. In this case, the virial +The input file in3d_virial_on.brownian demonstrates how to run +a similar simulation but in 3d. In this case, the virial contribution of the brownian dynamics (the sum sum_i /(3*volume) where W is a random variable with mean 0 and variance dt) is diff --git a/examples/USER/misc/bd_sphere/in2ddipole.bd b/examples/USER/brownian/bd_sphere/in2ddipole.brownian similarity index 93% rename from examples/USER/misc/bd_sphere/in2ddipole.bd rename to examples/USER/brownian/bd_sphere/in2ddipole.brownian index 1f7898207f..73d90e4ebf 100644 --- a/examples/USER/misc/bd_sphere/in2ddipole.bd +++ b/examples/USER/brownian/bd_sphere/in2ddipole.brownian @@ -38,7 +38,7 @@ pair_style none #compute d all property/atom mux muy muz -fix 1 all bd/sphere ${gamma_t} ${gamma_r} ${D_t} ${D_r} ${seed} rng ${rng} dipole +fix 1 all brownian/sphere ${gamma_t} ${gamma_r} ${D_t} ${D_r} ${seed} rng ${rng} dipole fix 2 all enforce2d compute press all pressure NULL virial diff --git a/examples/USER/misc/bd_sphere/in3d_virial_on.bd b/examples/USER/brownian/bd_sphere/in3d_virial_on.brownian similarity index 93% rename from examples/USER/misc/bd_sphere/in3d_virial_on.bd rename to examples/USER/brownian/bd_sphere/in3d_virial_on.brownian index 0e2f02beb0..481d9bc1b4 100644 --- a/examples/USER/misc/bd_sphere/in3d_virial_on.bd +++ b/examples/USER/brownian/bd_sphere/in3d_virial_on.brownian @@ -33,7 +33,7 @@ neigh_modify every 1 delay 1 check yes pair_style none -fix 1 all bd/sphere ${gamma_t} ${gamma_r} ${D_t} ${D_r} ${seed} rng ${rng} +fix 1 all brownian/sphere ${gamma_t} ${gamma_r} ${D_t} ${D_r} ${seed} rng ${rng} fix_modify 1 virial yes compute press all pressure NULL virial diff --git a/examples/USER/misc/bd_sphere/log_gaussian_4_1_7_13_2d.lammps.log b/examples/USER/brownian/bd_sphere/log_gaussian_4_1_7_13_2d.lammps.log similarity index 89% rename from examples/USER/misc/bd_sphere/log_gaussian_4_1_7_13_2d.lammps.log rename to examples/USER/brownian/bd_sphere/log_gaussian_4_1_7_13_2d.lammps.log index a735ea6baa..b10f77f0cd 100644 --- a/examples/USER/misc/bd_sphere/log_gaussian_4_1_7_13_2d.lammps.log +++ b/examples/USER/brownian/bd_sphere/log_gaussian_4_1_7_13_2d.lammps.log @@ -13,7 +13,7 @@ Created orthogonal box = (-25.298221 -25.298221 -0.31622777) to (25.298221 25.29 1 by 1 by 1 MPI processor grid create_atoms 1 box Created 1024 atoms - create_atoms CPU = 0.001 seconds + create_atoms CPU = 0.002 seconds mass * 1.0 set type * dipole/random ${seed} 1.0 set type * dipole/random 1974019 1.0 @@ -33,13 +33,13 @@ pair_style none #compute d all property/atom mux muy muz -fix 1 all bd/sphere ${gamma_t} ${gamma_r} ${D_t} ${D_r} ${seed} rng ${rng} dipole -fix 1 all bd/sphere 4 ${gamma_r} ${D_t} ${D_r} ${seed} rng ${rng} dipole -fix 1 all bd/sphere 4 1 ${D_t} ${D_r} ${seed} rng ${rng} dipole -fix 1 all bd/sphere 4 1 7 ${D_r} ${seed} rng ${rng} dipole -fix 1 all bd/sphere 4 1 7 13 ${seed} rng ${rng} dipole -fix 1 all bd/sphere 4 1 7 13 1974019 rng ${rng} dipole -fix 1 all bd/sphere 4 1 7 13 1974019 rng gaussian dipole +fix 1 all brownian/sphere ${gamma_t} ${gamma_r} ${D_t} ${D_r} ${seed} rng ${rng} dipole +fix 1 all brownian/sphere 4 ${gamma_r} ${D_t} ${D_r} ${seed} rng ${rng} dipole +fix 1 all brownian/sphere 4 1 ${D_t} ${D_r} ${seed} rng ${rng} dipole +fix 1 all brownian/sphere 4 1 7 ${D_r} ${seed} rng ${rng} dipole +fix 1 all brownian/sphere 4 1 7 13 ${seed} rng ${rng} dipole +fix 1 all brownian/sphere 4 1 7 13 1974019 rng ${rng} dipole +fix 1 all brownian/sphere 4 1 7 13 1974019 rng gaussian dipole fix 2 all enforce2d compute press all pressure NULL virial @@ -56,9 +56,9 @@ Per MPI rank memory allocation (min/avg/max) = 4.289 | 4.289 | 4.289 Mbytes Step Temp E_pair c_press 0 1 0 0 50000 7.3671759e+10 0 0 -Loop time of 11.2219 on 1 procs for 50000 steps with 1024 atoms +Loop time of 11.2532 on 1 procs for 50000 steps with 1024 atoms -Performance: 0.038 tau/day, 4455.573 timesteps/s +Performance: 0.038 tau/day, 4443.198 timesteps/s 100.0% CPU use with 1 MPI tasks x 1 OpenMP threads MPI task timing breakdown: @@ -66,10 +66,10 @@ Section | min time | avg time | max time |%varavg| %total --------------------------------------------------------------- Pair | 0 | 0 | 0 | 0.0 | 0.00 Neigh | 0 | 0 | 0 | 0.0 | 0.00 -Comm | 0.028513 | 0.028513 | 0.028513 | 0.0 | 0.25 -Output | 2.0981e-05 | 2.0981e-05 | 2.0981e-05 | 0.0 | 0.00 -Modify | 11.048 | 11.048 | 11.048 | 0.0 | 98.45 -Other | | 0.1458 | | | 1.30 +Comm | 0.031456 | 0.031456 | 0.031456 | 0.0 | 0.28 +Output | 2.0958e-05 | 2.0958e-05 | 2.0958e-05 | 0.0 | 0.00 +Modify | 11.067 | 11.067 | 11.067 | 0.0 | 98.35 +Other | | 0.1546 | | | 1.37 Nlocal: 1024.00 ave 1024 max 1024 min Histogram: 1 0 0 0 0 0 0 0 0 0 @@ -96,8 +96,9 @@ thermo_style custom step temp epair c_msd[*] c_press # write trajectory and thermo in a log-scale frequency # uncomment next three lines for dump output -#dump 1 all custom 2000 dump_${params}_2d.lammpstrj id type # x y xu yu mux muy muz fx fy fz -#dump_modify 1 first yes sort id +dump 1 all custom 2000 dump_${params}_2d.lammpstrj id type x y xu yu mux muy muz fx fy fz +dump 1 all custom 2000 dump_gaussian_4_1_7_13_2d.lammpstrj id type x y xu yu mux muy muz fx fy fz +dump_modify 1 first yes sort id timestep 0.00001 thermo 1000 @@ -105,7 +106,7 @@ thermo 1000 # main run run 120000 WARNING: Communication cutoff is 0.0. No ghost atoms will be generated. Atoms may get lost. (src/comm_brick.cpp:167) -Per MPI rank memory allocation (min/avg/max) = 4.664 | 4.664 | 4.664 Mbytes +Per MPI rank memory allocation (min/avg/max) = 6.113 | 6.113 | 6.113 Mbytes Step Temp E_pair c_msd[1] c_msd[2] c_msd[3] c_msd[4] c_press 0 7.3671759e+10 0 0 0 0 0 0 1000 710744.42 0 0.1332856 0.13577642 0 0.26906203 0 @@ -228,20 +229,20 @@ Step Temp E_pair c_msd[1] c_msd[2] c_msd[3] c_msd[4] c_press 118000 745594.37 0 16.838659 17.585392 0 34.424052 0 119000 714487.42 0 17.064214 17.743478 0 34.807692 0 120000 716557.14 0 17.105558 17.845925 0 34.951483 0 -Loop time of 27.2068 on 1 procs for 120000 steps with 1024 atoms +Loop time of 28.1507 on 1 procs for 120000 steps with 1024 atoms -Performance: 3810.806 tau/day, 4410.656 timesteps/s -100.0% CPU use with 1 MPI tasks x 1 OpenMP threads +Performance: 3683.037 tau/day, 4262.774 timesteps/s +99.9% CPU use with 1 MPI tasks x 1 OpenMP threads MPI task timing breakdown: Section | min time | avg time | max time |%varavg| %total --------------------------------------------------------------- Pair | 0 | 0 | 0 | 0.0 | 0.00 -Neigh | 0.0015633 | 0.0015633 | 0.0015633 | 0.0 | 0.01 -Comm | 0.021682 | 0.021682 | 0.021682 | 0.0 | 0.08 -Output | 0.0032539 | 0.0032539 | 0.0032539 | 0.0 | 0.01 -Modify | 26.802 | 26.802 | 26.802 | 0.0 | 98.51 -Other | | 0.3781 | | | 1.39 +Neigh | 0.0016237 | 0.0016237 | 0.0016237 | 0.0 | 0.01 +Comm | 0.027064 | 0.027064 | 0.027064 | 0.0 | 0.10 +Output | 0.1712 | 0.1712 | 0.1712 | 0.0 | 0.61 +Modify | 27.545 | 27.545 | 27.545 | 0.0 | 97.85 +Other | | 0.4062 | | | 1.44 Nlocal: 1024.00 ave 1024 max 1024 min Histogram: 1 0 0 0 0 0 0 0 0 0 @@ -256,4 +257,4 @@ Neighbor list builds = 1049 Dangerous builds = 0 -Total wall time: 0:00:38 +Total wall time: 0:00:39 diff --git a/examples/USER/misc/bd_sphere/log_uniform_10_1_5_15_3d.lammps.log b/examples/USER/brownian/bd_sphere/log_uniform_10_1_5_15_3d.lammps.log similarity index 100% rename from examples/USER/misc/bd_sphere/log_uniform_10_1_5_15_3d.lammps.log rename to examples/USER/brownian/bd_sphere/log_uniform_10_1_5_15_3d.lammps.log diff --git a/src/USER-MISC/fix_bd_asphere.cpp b/src/USER-BROWNIAN/fix_brownian_asphere.cpp similarity index 85% rename from src/USER-MISC/fix_bd_asphere.cpp rename to src/USER-BROWNIAN/fix_brownian_asphere.cpp index 88772b9237..123a7a5f5f 100644 --- a/src/USER-MISC/fix_bd_asphere.cpp +++ b/src/USER-BROWNIAN/fix_brownian_asphere.cpp @@ -17,7 +17,7 @@ Contributing author: Sam Cameron (University of Bristol) ------------------------------------------------------------------------- */ -#include "fix_bd_asphere.h" +#include "fix_brownian_asphere.h" #include #include @@ -42,7 +42,7 @@ enum{NODIPOLE,DIPOLE}; /* ---------------------------------------------------------------------- */ -FixBdAsphere::FixBdAsphere(LAMMPS *lmp, int narg, char **arg) : +FixBrownianAsphere::FixBrownianAsphere(LAMMPS *lmp, int narg, char **arg) : Fix(lmp, narg, arg) { virial_flag = 1; @@ -53,34 +53,34 @@ FixBdAsphere::FixBdAsphere(LAMMPS *lmp, int narg, char **arg) : if (narg > 11 || narg < 8 ) - error->all(FLERR,"Illegal fix bd/asphere command."); + error->all(FLERR,"Illegal fix brownian/asphere command."); if (!atom->sphere_flag) - error->all(FLERR,"Fix bd/asphere requires atom style sphere"); + error->all(FLERR,"Fix brownian/asphere requires atom style sphere"); gamma_t = utils::numeric(FLERR,arg[3],false,lmp); if (gamma_t <= 0.0) - error->all(FLERR,"Fix bd/asphere translational viscous drag " + error->all(FLERR,"Fix brownian/asphere translational viscous drag " "coefficient must be > 0."); gamma_r = utils::numeric(FLERR,arg[4],false,lmp); if (gamma_t <= 0.0) - error->all(FLERR,"Fix bd/asphere rotational viscous drag " + error->all(FLERR,"Fix brownian/asphere rotational viscous drag " "coefficient must be > 0."); diff_t = utils::numeric(FLERR,arg[5],false,lmp); if (diff_t <= 0.0) - error->all(FLERR,"Fix bd/asphere translational diffusion " + error->all(FLERR,"Fix brownian/asphere translational diffusion " "coefficient must be > 0."); diff_r = utils::numeric(FLERR,arg[6],false,lmp); if (diff_r <= 0.0) - error->all(FLERR,"Fix bd/asphere rotational diffusion " + error->all(FLERR,"Fix brownian/asphere rotational diffusion " "coefficient must be > 0."); seed = utils::inumeric(FLERR,arg[7],false,lmp); - if (seed <= 0) error->all(FLERR,"Fix bd/asphere seed must be > 0."); + if (seed <= 0) error->all(FLERR,"Fix brownian/asphere seed must be > 0."); noise_flag = 1; gaussian_noise_flag = 0; @@ -90,7 +90,7 @@ FixBdAsphere::FixBdAsphere(LAMMPS *lmp, int narg, char **arg) : while (iarg < narg) { if (strcmp(arg[iarg],"rng") == 0) { if (narg == iarg + 1) { - error->all(FLERR,"Illegal fix/bd/asphere command."); + error->all(FLERR,"Illegal fix/brownian/asphere command."); } if (strcmp(arg[iarg + 1],"uniform") == 0) { noise_flag = 1; @@ -100,19 +100,19 @@ FixBdAsphere::FixBdAsphere(LAMMPS *lmp, int narg, char **arg) : } else if (strcmp(arg[iarg + 1],"none") == 0) { noise_flag = 0; } else { - error->all(FLERR,"Illegal fix/bd/asphere command."); + error->all(FLERR,"Illegal fix/brownian/asphere command."); } iarg = iarg + 2; } else if (strcmp(arg[iarg],"dipole") == 0) { dipole_flag = DIPOLE; iarg = iarg + 1; } else { - error->all(FLERR,"Illegal fix/bd/asphere command."); + error->all(FLERR,"Illegal fix/brownian/asphere command."); } } if (dipole_flag == DIPOLE && !atom->mu_flag) - error->all(FLERR,"Fix bd/asphere dipole requires atom attribute mu"); + error->all(FLERR,"Fix brownian/asphere dipole requires atom attribute mu"); // initialize Marsaglia RNG with processor-unique seed random = new RanMars(lmp,seed + comm->me); @@ -121,7 +121,7 @@ FixBdAsphere::FixBdAsphere(LAMMPS *lmp, int narg, char **arg) : /* ---------------------------------------------------------------------- */ -int FixBdAsphere::setmask() +int FixBrownianAsphere::setmask() { int mask = 0; mask |= INITIAL_INTEGRATE; @@ -131,7 +131,7 @@ int FixBdAsphere::setmask() /* ---------------------------------------------------------------------- */ -FixBdAsphere::~FixBdAsphere() +FixBrownianAsphere::~FixBrownianAsphere() { delete random; } @@ -140,13 +140,13 @@ FixBdAsphere::~FixBdAsphere() /* ---------------------------------------------------------------------- */ -void FixBdAsphere::init() +void FixBrownianAsphere::init() { avec = (AtomVecEllipsoid *) atom->style_match("ellipsoid"); if (!avec) - error->all(FLERR,"Compute bd/asphere requires " + error->all(FLERR,"Compute brownian/asphere requires " "atom style ellipsoid"); // check that all particles are finite-size ellipsoids @@ -159,7 +159,7 @@ void FixBdAsphere::init() for (int i = 0; i < nlocal; i++) if (mask[i] & groupbit) if (ellipsoid[i] < 0) - error->one(FLERR,"Fix bd/asphere requires extended particles"); + error->one(FLERR,"Fix brownian/asphere requires extended particles"); if (dipole_flag == DIPOLE) { @@ -208,7 +208,7 @@ void FixBdAsphere::init() sqrtdt = sqrt(dt); } -void FixBdAsphere::setup(int vflag) +void FixBrownianAsphere::setup(int vflag) { post_force(vflag); } @@ -216,7 +216,7 @@ void FixBdAsphere::setup(int vflag) /* ---------------------------------------------------------------------- */ -void FixBdAsphere::initial_integrate(int /* vflag */) +void FixBrownianAsphere::initial_integrate(int /* vflag */) { double **x = atom->x; double **v = atom->v; @@ -313,7 +313,7 @@ void FixBdAsphere::initial_integrate(int /* vflag */) return; } -void FixBdAsphere::update_x_and_omega(double *x, double *v, double *omega, +void FixBrownianAsphere::update_x_and_omega(double *x, double *v, double *omega, double *f, double *torque, int d3rot) { double dx, dy, dz; @@ -341,7 +341,7 @@ void FixBdAsphere::update_x_and_omega(double *x, double *v, double *omega, apply random force, stolen from MISC/fix_efield.cpp ------------------------------------------------------------------------- */ -void FixBdAsphere::post_force(int vflag) +void FixBrownianAsphere::post_force(int vflag) { double **f = atom->f; double **x = atom->x; @@ -384,7 +384,7 @@ void FixBdAsphere::post_force(int vflag) } } -void FixBdAsphere::reset_dt() +void FixBrownianAsphere::reset_dt() { dt = update->dt; diff --git a/src/USER-MISC/fix_bd_asphere.h b/src/USER-BROWNIAN/fix_brownian_asphere.h similarity index 69% rename from src/USER-MISC/fix_bd_asphere.h rename to src/USER-BROWNIAN/fix_brownian_asphere.h index 696b659729..31ccf4fc8b 100644 --- a/src/USER-MISC/fix_bd_asphere.h +++ b/src/USER-BROWNIAN/fix_brownian_asphere.h @@ -13,21 +13,21 @@ #ifdef FIX_CLASS -FixStyle(bd/asphere,FixBdAsphere) +FixStyle(brownian/asphere,FixBrownianAsphere) #else -#ifndef LMP_FIX_BD_ASPHERE_H -#define LMP_FIX_BD_ASPHERE_H +#ifndef LMP_FIX_BROWNIAN_ASPHERE_H +#define LMP_FIX_BROWNIAN_ASPHERE_H #include "fix.h" namespace LAMMPS_NS { -class FixBdAsphere : public Fix { +class FixBrownianAsphere : public Fix { public: - FixBdAsphere(class LAMMPS *, int, char **); - virtual ~FixBdAsphere(); + FixBrownianAsphere(class LAMMPS *, int, char **); + virtual ~FixBrownianAsphere(); void init(); void initial_integrate(int); void setup(int); @@ -66,38 +66,38 @@ protected: /* ERROR/WARNING messages: -E: Illegal fix bd/asphere command. +E: Illegal fix brownian/asphere command. Wrong number/type of input arguments. -E: Compute bd/asphere requires atom style sphere +E: Compute brownian/asphere requires atom style sphere Self-explanatory. -E: Compute bd/asphere requires atom style ellipsoid +E: Compute brownian/asphere requires atom style ellipsoid Self-explanatory. -E: Compute bd/asphere dipole requires atom attribute mu +E: Compute brownian/asphere dipole requires atom attribute mu Self-explanatory. -E: Fix bd/asphere translational viscous drag coefficient must be > 0. +E: Fix brownian/asphere translational viscous drag coefficient must be > 0. Self-explanatory. -E: Fix bd/asphere rotational viscous drag coefficient must be > 0. +E: Fix brownian/asphere rotational viscous drag coefficient must be > 0. Self-explanatory. -E: Fix bd/asphere translational diffusion coefficient must be > 0. +E: Fix brownian/asphere translational diffusion coefficient must be > 0. Self-explanatory. -E: Fix bd/asphere rotational diffusion coefficient must be > 0. +E: Fix brownian/asphere rotational diffusion coefficient must be > 0. Self-explanatory. -E: Fix bd/asphere seed must be > 0. +E: Fix brownian/asphere seed must be > 0. */ diff --git a/src/USER-MISC/fix_bd_sphere.cpp b/src/USER-BROWNIAN/fix_brownian_sphere.cpp similarity index 85% rename from src/USER-MISC/fix_bd_sphere.cpp rename to src/USER-BROWNIAN/fix_brownian_sphere.cpp index cc3c788349..c3e0cd2457 100644 --- a/src/USER-MISC/fix_bd_sphere.cpp +++ b/src/USER-BROWNIAN/fix_brownian_sphere.cpp @@ -17,7 +17,7 @@ Contributing author: Sam Cameron (University of Bristol) ------------------------------------------------------------------------- */ -#include "fix_bd_sphere.h" +#include "fix_brownian_sphere.h" #include #include @@ -41,7 +41,7 @@ enum{NONE,DIPOLE}; /* ---------------------------------------------------------------------- */ -FixBdSphere::FixBdSphere(LAMMPS *lmp, int narg, char **arg) : +FixBrownianSphere::FixBrownianSphere(LAMMPS *lmp, int narg, char **arg) : Fix(lmp, narg, arg) { virial_flag = 1; @@ -51,34 +51,34 @@ FixBdSphere::FixBdSphere(LAMMPS *lmp, int narg, char **arg) : extra = NONE; if (narg > 11 || narg < 8 ) - error->all(FLERR,"Illegal fix bd/sphere command."); + error->all(FLERR,"Illegal fix brownian/sphere command."); if (!atom->sphere_flag) - error->all(FLERR,"Fix bd/sphere requires atom style sphere"); + error->all(FLERR,"Fix brownian/sphere requires atom style sphere"); gamma_t = utils::numeric(FLERR,arg[3],false,lmp); if (gamma_t <= 0.0) - error->all(FLERR,"Fix bd/sphere translational viscous drag " + error->all(FLERR,"Fix brownian/sphere translational viscous drag " "coefficient must be > 0."); gamma_r = utils::numeric(FLERR,arg[4],false,lmp); if (gamma_t <= 0.0) - error->all(FLERR,"Fix bd/sphere rotational viscous drag " + error->all(FLERR,"Fix brownian/sphere rotational viscous drag " "coefficient must be > 0."); diff_t = utils::numeric(FLERR,arg[5],false,lmp); if (diff_t <= 0.0) - error->all(FLERR,"Fix bd/sphere translational diffusion " + error->all(FLERR,"Fix brownian/sphere translational diffusion " "coefficient must be > 0."); diff_r = utils::numeric(FLERR,arg[6],false,lmp); if (diff_r <= 0.0) - error->all(FLERR,"Fix bd/sphere rotational diffusion " + error->all(FLERR,"Fix brownian/sphere rotational diffusion " "coefficient must be > 0."); seed = utils::inumeric(FLERR,arg[7],false,lmp); - if (seed <= 0) error->all(FLERR,"Fix bd/sphere seed must be > 0."); + if (seed <= 0) error->all(FLERR,"Fix brownian/sphere seed must be > 0."); noise_flag = 1; gaussian_noise_flag = 0; @@ -88,7 +88,7 @@ FixBdSphere::FixBdSphere(LAMMPS *lmp, int narg, char **arg) : while (iarg < narg) { if (strcmp(arg[iarg],"rng") == 0) { if (narg == iarg + 1) { - error->all(FLERR,"Illegal fix/bd/sphere command."); + error->all(FLERR,"Illegal fix/brownian/sphere command."); } if (strcmp(arg[iarg + 1],"uniform") == 0) { noise_flag = 1; @@ -98,19 +98,19 @@ FixBdSphere::FixBdSphere(LAMMPS *lmp, int narg, char **arg) : } else if (strcmp(arg[iarg + 1],"none") == 0) { noise_flag = 0; } else { - error->all(FLERR,"Illegal fix/bd/sphere command."); + error->all(FLERR,"Illegal fix/brownian/sphere command."); } iarg = iarg + 2; } else if (strcmp(arg[iarg],"dipole") == 0) { extra = DIPOLE; iarg = iarg + 1; } else { - error->all(FLERR,"Illegal fix/bd/sphere command."); + error->all(FLERR,"Illegal fix/brownian/sphere command."); } } if (extra == DIPOLE && !atom->mu_flag) - error->all(FLERR,"Fix bd/sphere update dipole requires atom attribute mu"); + error->all(FLERR,"Fix brownian/sphere update dipole requires atom attribute mu"); // initialize Marsaglia RNG with processor-unique seed random = new RanMars(lmp,seed + comm->me); @@ -119,7 +119,7 @@ FixBdSphere::FixBdSphere(LAMMPS *lmp, int narg, char **arg) : /* ---------------------------------------------------------------------- */ -int FixBdSphere::setmask() +int FixBrownianSphere::setmask() { int mask = 0; mask |= INITIAL_INTEGRATE; @@ -129,7 +129,7 @@ int FixBdSphere::setmask() /* ---------------------------------------------------------------------- */ -FixBdSphere::~FixBdSphere() +FixBrownianSphere::~FixBrownianSphere() { delete random; } @@ -138,7 +138,7 @@ FixBdSphere::~FixBdSphere() /* ---------------------------------------------------------------------- */ -void FixBdSphere::init() +void FixBrownianSphere::init() { g1 = force->ftm2v/gamma_t; @@ -161,14 +161,14 @@ void FixBdSphere::init() sqrtdt = sqrt(dt); } -void FixBdSphere::setup(int vflag) +void FixBrownianSphere::setup(int vflag) { post_force(vflag); } /* ---------------------------------------------------------------------- */ -void FixBdSphere::initial_integrate(int /* vflag */) +void FixBrownianSphere::initial_integrate(int /* vflag */) { double **x = atom->x; double **v = atom->v; @@ -270,7 +270,7 @@ void FixBdSphere::initial_integrate(int /* vflag */) apply random force, stolen from MISC/fix_efield.cpp ------------------------------------------------------------------------- */ -void FixBdSphere::post_force(int vflag) +void FixBrownianSphere::post_force(int vflag) { double **f = atom->f; double **x = atom->x; @@ -313,7 +313,7 @@ void FixBdSphere::post_force(int vflag) } } -void FixBdSphere::reset_dt() +void FixBrownianSphere::reset_dt() { dt = update->dt; diff --git a/src/USER-MISC/fix_bd_sphere.h b/src/USER-BROWNIAN/fix_brownian_sphere.h similarity index 70% rename from src/USER-MISC/fix_bd_sphere.h rename to src/USER-BROWNIAN/fix_brownian_sphere.h index 8a3df214a6..8d30001fdd 100644 --- a/src/USER-MISC/fix_bd_sphere.h +++ b/src/USER-BROWNIAN/fix_brownian_sphere.h @@ -13,21 +13,21 @@ #ifdef FIX_CLASS -FixStyle(bd/sphere,FixBdSphere) +FixStyle(brownian/sphere,FixBrownianSphere) #else -#ifndef LMP_FIX_BD_SPHERE_H -#define LMP_FIX_BD_SPHERE_H +#ifndef LMP_FIX_BROWNIAN_SPHERE_H +#define LMP_FIX_BROWNIAN_SPHERE_H #include "fix.h" namespace LAMMPS_NS { -class FixBdSphere : public Fix { +class FixBrownianSphere : public Fix { public: - FixBdSphere(class LAMMPS *, int, char **); - virtual ~FixBdSphere(); + FixBrownianSphere(class LAMMPS *, int, char **); + virtual ~FixBrownianSphere(); void init(); void initial_integrate(int); void setup(int); @@ -61,34 +61,34 @@ protected: /* ERROR/WARNING messages: -E: Illegal fix bd/sphere command. +E: Illegal fix brownian/sphere command. Wrong number/type of input arguments. -E: Compute bd/sphere requires atom style sphere +E: Compute brownian/sphere requires atom style sphere Self-explanatory. -E: Compute bd/sphere requires atom attribute mu +E: Compute brownian/sphere requires atom attribute mu Self-explanatory. -E: Fix bd/sphere translational viscous drag coefficient must be > 0. +E: Fix brownian/sphere translational viscous drag coefficient must be > 0. Self-explanatory. -E: Fix bd/sphere rotational viscous drag coefficient must be > 0. +E: Fix brownian/sphere rotational viscous drag coefficient must be > 0. Self-explanatory. -E: Fix bd/sphere translational diffusion coefficient must be > 0. +E: Fix brownian/sphere translational diffusion coefficient must be > 0. Self-explanatory. -E: Fix bd/sphere rotational diffusion coefficient must be > 0. +E: Fix brownian/sphere rotational diffusion coefficient must be > 0. Self-explanatory. -E: Fix bd/sphere seed must be > 0. +E: Fix brownian/sphere seed must be > 0. */ diff --git a/src/USER-MISC/README b/src/USER-MISC/README index ac41d60dfd..538fdb7952 100644 --- a/src/USER-MISC/README +++ b/src/USER-MISC/README @@ -53,8 +53,6 @@ dihedral_style table/cut, Mike Salerno, ksalerno@pha.jhu.edu, 11 May 18 fix accelerate/cos, Zheng Gong (ENS de Lyon), z.gong@outlook.com, 24 Apr 20 fix addtorque, Laurent Joly (U Lyon), ljoly.ulyon at gmail.com, 8 Aug 11 fix ave/correlate/long, Jorge Ramirez (UPM Madrid), jorge.ramirez at upm.es, 21 Oct 2015 -fix bd/sphere, Sam Cameron (U of Bristol), samuel.j.m.cameron at gmail.com, 13 Dec 2020 -fix bd/asphere, Sam Cameron (U of Bristol), samuel.j.m.cameron at gmail.com, 13 Dec 2020 fix electron/stopping/fit, James Stewart (SNL), jstewa .at. sandia.gov, 23 Sep 2020 fix electron/stopping, Konstantin Avchaciov, k.avchachov at gmail.com, 26 Feb 2019 fix ffl, David Wilkins (EPFL Lausanne), david.wilkins @ epfl.ch, 28 Sep 2018 diff --git a/unittest/force-styles/tests/data.bdsphere b/unittest/force-styles/tests/data.brownian similarity index 100% rename from unittest/force-styles/tests/data.bdsphere rename to unittest/force-styles/tests/data.brownian diff --git a/unittest/force-styles/tests/fix-timestep-bd_sphere.yaml b/unittest/force-styles/tests/fix-timestep-brownian.yaml similarity index 97% rename from unittest/force-styles/tests/fix-timestep-bd_sphere.yaml rename to unittest/force-styles/tests/fix-timestep-brownian.yaml index b69f37e206..76477d874e 100644 --- a/unittest/force-styles/tests/fix-timestep-bd_sphere.yaml +++ b/unittest/force-styles/tests/fix-timestep-brownian.yaml @@ -4,12 +4,12 @@ date_generated: Tue Dec 08 12:28:40 2020 epsilon: 1e-12 prerequisites: ! | atom hybrid dipole sphere - fix bd_sphere + fix brownian/sphere pre_commands: ! "" post_commands: ! | - fix test solute bd_sphere 1.0 1.0 1.0 1.0 1049270 dipole + fix test solute brownian/sphere 1.0 1.0 1.0 1.0 1049270 dipole fix_modify test virial yes -input_file: in.bdsphere +input_file: in.brownian natoms: 32 run_pos: ! |2 1 0.8198132185477983 -1.5120221815010249 1.069236010215717 diff --git a/unittest/force-styles/tests/in.bdsphere b/unittest/force-styles/tests/in.brownian similarity index 88% rename from unittest/force-styles/tests/in.bdsphere rename to unittest/force-styles/tests/in.brownian index 1fb583f51d..cf85742e59 100644 --- a/unittest/force-styles/tests/in.bdsphere +++ b/unittest/force-styles/tests/in.brownian @@ -2,7 +2,7 @@ variable newton_pair index on variable newton_bond index on variable units index lj variable input_dir index . -variable data_file index ${input_dir}/data.bdsphere +variable data_file index ${input_dir}/data.brownian variable pair_style index 'zero 8.0' atom_style hybrid dipole sphere From 05ecf8613423679a8fb065ef5702c0e95884c947 Mon Sep 17 00:00:00 2001 From: Sam Cameron Date: Sun, 20 Dec 2020 16:39:04 +0000 Subject: [PATCH 13/22] Made changes to propel/self. Kept all features of previous version (and tested they stayed the same), but additionally added dipole option for direction of self-propulsion. Also updated examples. --- doc/src/fix_propel_self.rst | 178 +++++++--- .../{bd_asphere => asphere}/README.txt | 0 .../{bd_asphere => asphere}/in3d.brownian | 0 .../log_gaussian_4_1_7_13_3d.lammps.log | 0 .../brownian/{bd_sphere => sphere}/README.txt | 0 .../{bd_sphere => sphere}/in2ddipole.brownian | 0 .../in3d_virial_on.brownian | 0 .../log_gaussian_4_1_7_13_2d.lammps.log | 0 .../log_uniform_10_1_5_15_3d.lammps.log | 0 .../USER/brownian/spherical_ABP/in.2d_abp | 70 ++++ .../brownian/spherical_ABP/in.3d_ideal_abp | 74 +++++ .../log_WCA_1_1_1_3_4_2d.lammps.log | 163 +++++++++ .../log_ideal_1_1_1_3_4_3d.lammps.log | 150 +++++++++ .../propel_self/2d_velocity/in.2d_langevin | 54 --- .../propel_self/2d_velocity/in.2d_viscous | 37 --- .../3d_quaternion/in.3d_quaternion | 40 --- src/USER-BROWNIAN/fix_propel_self.cpp | 312 ++++++++++++++++++ .../fix_propel_self.h | 51 ++- src/USER-MISC/README | 1 - src/USER-MISC/fix_propel_self.cpp | 258 --------------- 20 files changed, 919 insertions(+), 469 deletions(-) rename examples/USER/brownian/{bd_asphere => asphere}/README.txt (100%) rename examples/USER/brownian/{bd_asphere => asphere}/in3d.brownian (100%) rename examples/USER/brownian/{bd_asphere => asphere}/log_gaussian_4_1_7_13_3d.lammps.log (100%) rename examples/USER/brownian/{bd_sphere => sphere}/README.txt (100%) rename examples/USER/brownian/{bd_sphere => sphere}/in2ddipole.brownian (100%) rename examples/USER/brownian/{bd_sphere => sphere}/in3d_virial_on.brownian (100%) rename examples/USER/brownian/{bd_sphere => sphere}/log_gaussian_4_1_7_13_2d.lammps.log (100%) rename examples/USER/brownian/{bd_sphere => sphere}/log_uniform_10_1_5_15_3d.lammps.log (100%) create mode 100644 examples/USER/brownian/spherical_ABP/in.2d_abp create mode 100644 examples/USER/brownian/spherical_ABP/in.3d_ideal_abp create mode 100644 examples/USER/brownian/spherical_ABP/log_WCA_1_1_1_3_4_2d.lammps.log create mode 100644 examples/USER/brownian/spherical_ABP/log_ideal_1_1_1_3_4_3d.lammps.log delete mode 100644 examples/USER/misc/propel_self/2d_velocity/in.2d_langevin delete mode 100644 examples/USER/misc/propel_self/2d_velocity/in.2d_viscous delete mode 100644 examples/USER/misc/propel_self/3d_quaternion/in.3d_quaternion create mode 100644 src/USER-BROWNIAN/fix_propel_self.cpp rename src/{USER-MISC => USER-BROWNIAN}/fix_propel_self.h (55%) delete mode 100644 src/USER-MISC/fix_propel_self.cpp diff --git a/doc/src/fix_propel_self.rst b/doc/src/fix_propel_self.rst index 3a1bfb3166..6644d97d46 100644 --- a/doc/src/fix_propel_self.rst +++ b/doc/src/fix_propel_self.rst @@ -8,53 +8,117 @@ Syntax .. parsed-literal:: - fix ID group-ID propel/self mode magnitude keyword values ... + fix ID group-ID propel/self magnitude keyword values * ID, group-ID are documented in :doc:`fix ` command * propel/self = style name of this fix command -* mode = velocity or quat -* magnitude = magnitude of the active force -* one or more keyword/value pairs may be appended to args -* keyword = *types* +* magnitude = magnitude of self-propulsion force +* one (and only one) keyword/value pair must be appended to args +* keyword = *dipole* or *velocity* or *quat* + + .. parsed-literal:: + + *dipole* value = none = apply force along dipole direction + *velocity* value = none = apply force along velocity direction + *quat* values = direction vector *sx* and *sy* and *sz* + *sx* = x component of force direction in ellipsoid frame + *sy* = y component of force direction in ellipsoid frame + *sz* = z component of force direction in ellipsoid frame + - *types* values = one or more atom types Examples """""""" .. code-block:: LAMMPS - fix active_group all propel/self velocity 1.0 - fix constant_velocity all viscous 1.0 - - fix active_group all propel/self quat 1.0 - - fix active all propel/self quat 1.0 types 1 2 4 + fix propel/self all 40.0 dipole + fix propel/self all 10.0 velocity + fix propel/self all 15.7 quat 1.0 0.0 0.0 Description """"""""""" -Adds a force of a constant magnitude to each atom in the group. The nature in -which the force is added depends on the mode. +Add a force to each atom in the group due to a self-propulsion force. The +force is given by -For *mode* = *velocity*, the active force acts along the velocity vector of -each atom. This can be interpreted as a velocity-dependent friction, -such as proposed by :ref:`(Erdmann) `. +.. math:: -For *mode* = *quat* the force is applied along the axis obtained -by rotating the x-axis along the atom's quaternion. In other words, the -force is along the x-axis in the atom's body frame. This mode requires -all atoms in the group to have a quaternion, so atom_style should -either be ellipsoid or body. In combination with Langevin thermostat -for translation and rotation in the overdamped regime, the quaternion -mode corresponds to the active Brownian particle model introduced by -:ref:`(Henkes) `, :ref:`(Bialke) ` and :ref:`(Fily) -`. + F_i = f_P e_i -By default, this fix is applied to all atoms in the group. You can -override this behavior by specifying the atom types the fix should work -on through the *types* keyword. +where *i* is the particle the force is being applied to, :math:`f_P` +is the magnitude of the force, and :math:`e_i` is the vector direction +of the force. The specification of :math:`e_i` is based on which of the +three keywords (*dipole* or *velocity* or *quat*) one selects. +For keyword *dipole*, :math:`e_i` is just equal to +the dipole vectors of the atoms in the group. Therefore, if the dipoles +are not unit vectors, the :math:`e_i` will not be unit vectors. + +.. note:: + + If another command changes the magnitude of the dipole, this force will + change accordingly (since :math:`|e_i|` will change, which is physically + equivalent to re-scaling :math:`f_P` while keeping :math:`|e_i|` constant), + and no warning will be provided by LAMMPS. This is almost never what you + want, so ensure you aren't changing dipole magnitudes with another LAMMPS + fix or pair style. Furthermore, self-propulsion forces (almost) always + set :math:`e_i` to be a unit vector for all times, so it's best to set + all the dipole magnitudes to 1.0 unless you have a good reason not to + (see the :doc:`set ` command on how to do this). + +For keyword *velocity*, :math:`e_i` points in the direction +of the current velocity (a unit-vector). This can be interpreted as a +velocity-dependent friction, as proposed by e.g. :ref:`(Erdmann) `. + +For keyword *quat*, :math:`e_i` points in the direction of the unit +vector defined by its arguments *sx*, *sy*, and *sz*, which are +themselves defined within the coordinate frame of the atom's +ellipsoid. For instance, for an ellipsoid with long axis along +its x-direction, if one wanted the self-propulsion force to also +be along this axis, set *sx* equal to 1 and *sy*, *sz* both equal +to zero. For *quat*, :math:`e_i` will always be a unit vector, +so multiplying all three arguments *sx*, *sy*, and *sz* by a +positive scalar will not change the self-propulsion force +(multiplying by a negative scalar will change the sign of the +force). + +Along with adding a force contribution, this fix can also +contribute to the virial (pressure) of the system, defined as +:math:`f_P \sum_i /(d V)`, where :math:`r_i` is the +*unwrapped* coordinate of particle i in the case of periodic +boundary conditions. See :ref:`(Winkler) ` for a +discussion of this active pressure contribution. + +For keywords *dipole* and *quat*, this fix is by default +included in pressure computations. + +For keyword *velocity*, this fix is by default not included +in pressure computations. + + +.. note:: + + In contrast to equilibrium systems, pressure of active systems + in general depends on the geometry of the container. + The active pressure contribution as calculated in this fix + is only valid for certain boundary conditions (spherical + walls, rectangular walls, or periodic boundary conditions). + For other geometries, the pressure must be measured via + explicit calculation of the force per unit area on a wall, + and so one must not calculate it using this fix. + (Use :doc:`fix_modify ` as described below + to turn off the virial contribution of this fix). Again, + see :ref:`(Winkler) ` for discussion of why this + is the case. + + Furthermore, when dealing with active systems, the temperature + is no longer well defined. Therefore, one should ensure that + the *virial* flag is used in the + :doc:`compute pressure ` command (turning + off temperature contributions). + + ---------- Restart, fix_modify, output, run start/stop, minimize info @@ -62,40 +126,48 @@ Restart, fix_modify, output, run start/stop, minimize info No information about this fix is written to :doc:`binary restart files `. -This fix is not imposed during minimization. +The :doc:`fix_modify ` *virial* option is supported by this +fix to add the contribution due to the added forces on atoms to the +system's virial as part of :doc:`thermodynamic output `. +The default is *virial yes* for keywords *dipole* and *quat*. The +default is *virial no* for keyword *velocity*. + + +No parameter of this fix can be used with the *start/stop* keywords of +the :doc:`run ` command. + Restrictions """""""""""" -In quat mode, this fix makes use of per-atom quaternions to take -into account the fact that the orientation can rotate and hence the -direction of the active force can change. The quat mode -of this fix only works with atom_style ellipsoid. +With keyword *dipole*, this fix only works when the DIPOLE package is enabled. +See the :doc:`Build package ` doc page for more info. + +This fix is part of the USER-BROWNIAN package. It is only enabled if +LAMMPS was built with that package. See the :doc:`Build package ` +doc page for more info. + Related commands """""""""""""""" -:doc:`fix setforce `, :doc:`fix addforce ` - -.. _Erdmann: - -**(Erdmann)** U. Erdmann , W. Ebeling, L. Schimansky-Geier, and F. Schweitzer, -Eur. Phys. J. B 15, 105-113, 2000. - -.. _Henkes: - -**(Henkes)** Henkes, S, Fily, Y., and Marchetti, M. C. Phys. Rev. E, 84, 040301(R), 2011. - -.. _Bialke: - -**(Bialke)** J. Bialke, T. Speck, and H Loewen, Phys. Rev. Lett. 108, 168301, 2012. - -.. _Fily: - -**(Fily)** Y. Fily and M.C. Marchetti, Phys. Rev. Lett. 108, 235702, 2012. +:doc:`fix efield ` , :doc:`fix setforce `, +:doc:`fix addforce ` Default """"""" -types +none +---------- + + +.. _Erdmann1: + +**(Erdmann)** U. Erdmann , W. Ebeling, L. Schimansky-Geier, and F. Schweitzer, +Eur. Phys. J. B 15, 105-113, 2000. + + +.. _Winkler1: + +**(Winkler)** Winkler, Wysocki, and Gompper, Soft Matter, 11, 6680 (2015). diff --git a/examples/USER/brownian/bd_asphere/README.txt b/examples/USER/brownian/asphere/README.txt similarity index 100% rename from examples/USER/brownian/bd_asphere/README.txt rename to examples/USER/brownian/asphere/README.txt diff --git a/examples/USER/brownian/bd_asphere/in3d.brownian b/examples/USER/brownian/asphere/in3d.brownian similarity index 100% rename from examples/USER/brownian/bd_asphere/in3d.brownian rename to examples/USER/brownian/asphere/in3d.brownian diff --git a/examples/USER/brownian/bd_asphere/log_gaussian_4_1_7_13_3d.lammps.log b/examples/USER/brownian/asphere/log_gaussian_4_1_7_13_3d.lammps.log similarity index 100% rename from examples/USER/brownian/bd_asphere/log_gaussian_4_1_7_13_3d.lammps.log rename to examples/USER/brownian/asphere/log_gaussian_4_1_7_13_3d.lammps.log diff --git a/examples/USER/brownian/bd_sphere/README.txt b/examples/USER/brownian/sphere/README.txt similarity index 100% rename from examples/USER/brownian/bd_sphere/README.txt rename to examples/USER/brownian/sphere/README.txt diff --git a/examples/USER/brownian/bd_sphere/in2ddipole.brownian b/examples/USER/brownian/sphere/in2ddipole.brownian similarity index 100% rename from examples/USER/brownian/bd_sphere/in2ddipole.brownian rename to examples/USER/brownian/sphere/in2ddipole.brownian diff --git a/examples/USER/brownian/bd_sphere/in3d_virial_on.brownian b/examples/USER/brownian/sphere/in3d_virial_on.brownian similarity index 100% rename from examples/USER/brownian/bd_sphere/in3d_virial_on.brownian rename to examples/USER/brownian/sphere/in3d_virial_on.brownian diff --git a/examples/USER/brownian/bd_sphere/log_gaussian_4_1_7_13_2d.lammps.log b/examples/USER/brownian/sphere/log_gaussian_4_1_7_13_2d.lammps.log similarity index 100% rename from examples/USER/brownian/bd_sphere/log_gaussian_4_1_7_13_2d.lammps.log rename to examples/USER/brownian/sphere/log_gaussian_4_1_7_13_2d.lammps.log diff --git a/examples/USER/brownian/bd_sphere/log_uniform_10_1_5_15_3d.lammps.log b/examples/USER/brownian/sphere/log_uniform_10_1_5_15_3d.lammps.log similarity index 100% rename from examples/USER/brownian/bd_sphere/log_uniform_10_1_5_15_3d.lammps.log rename to examples/USER/brownian/sphere/log_uniform_10_1_5_15_3d.lammps.log diff --git a/examples/USER/brownian/spherical_ABP/in.2d_abp b/examples/USER/brownian/spherical_ABP/in.2d_abp new file mode 100644 index 0000000000..d626445926 --- /dev/null +++ b/examples/USER/brownian/spherical_ABP/in.2d_abp @@ -0,0 +1,70 @@ +# 2D overdamped active brownian particle dynamics (ABP) +# with WCA potential + +variable gamma_t equal 1.0 +variable gamma_r equal 1.0 +variable D_t equal 1.0 +variable D_r equal 3.0 +variable seed equal 1974019 +variable fp equal 4.0 + +variable params string ${gamma_t}_${gamma_r}_${D_t}_${D_r}_${fp} + + +log log_WCA_${params}_2d.lammps.log +units lj +atom_style hybrid dipole sphere +dimension 2 +newton off + + +lattice sq 0.4 +region box block -16 16 -16 16 -0.2 0.2 +create_box 1 box +create_atoms 1 box +mass * 1.0 +set type * dipole/random ${seed} 1.0 +velocity all create 1.0 1 loop geom + +# more careful with neighbors since higher diffusion in abps +neighbor 1.0 bin +neigh_modify every 1 delay 1 check yes + + +# WCA potential (purely repulsive) +pair_style lj/cut 2.5 +pair_coeff * * 1.0 1.0 1.1224 +pair_modify shift yes + + + +# overdamped brownian dynamics time-step +fix step all brownian/sphere ${gamma_t} ${gamma_r} ${D_t} ${D_r} ${seed} dipole +# self-propulsion force along the dipole direction +fix activity all propel/self ${fp} dipole +fix 2 all enforce2d + + +compute press all pressure NULL virial + +thermo_style custom step temp epair c_press + +#equilibration +timestep 0.0000000001 +thermo 50001 +run 50000 +reset_timestep 0 + + +# MSD +compute msd all msd + + +thermo_style custom step temp epair c_msd[*] c_press + + +timestep 0.00001 +thermo 10000 + +# main run +run 200000 diff --git a/examples/USER/brownian/spherical_ABP/in.3d_ideal_abp b/examples/USER/brownian/spherical_ABP/in.3d_ideal_abp new file mode 100644 index 0000000000..e131d07059 --- /dev/null +++ b/examples/USER/brownian/spherical_ABP/in.3d_ideal_abp @@ -0,0 +1,74 @@ +# 3D overdamped active brownian dynamics with no interactions + +variable gamma_t equal 1.0 +variable gamma_r equal 1.0 +variable D_t equal 1.0 +variable D_r equal 3.0 +variable seed equal 1974019 +variable fp equal 4.0 + +variable params string ${gamma_t}_${gamma_r}_${D_t}_${D_r}_${fp} + + +log log_ideal_${params}_3d.lammps.log +units lj +atom_style hybrid dipole sphere +dimension 3 +newton off + + +lattice sc 0.4 +region box block -8 8 -8 8 -8 8 +create_box 1 box +create_atoms 1 box +mass * 1.0 +set type * dipole/random ${seed} 1.0 +velocity all create 1.0 1 loop geom + +pair_style none + +# overdamped brownian dynamics time-step +fix step all brownian/sphere ${gamma_t} ${gamma_r} ${D_t} ${D_r} ${seed} dipole +# self-propulsion force along the dipole direction +fix activity all propel/self ${fp} dipole + + +compute press all pressure NULL virial + +thermo_style custom step temp epair c_press + +#equilibration +timestep 0.0000000001 +thermo 50001 +run 50000 +reset_timestep 0 + + +# MSD to demonstrate expected diffusive behaviour for ideal active +# brownian motion, which is +# +# MSD = (2*d*D_t + 2*fp**2/(gamma_t**2*(d-1)*D_r))*t +# +# with d being simulation dimension +compute msd all msd + + +thermo_style custom step temp epair c_msd[*] c_press + + +timestep 0.00001 +thermo 10000 + +# main run +run 120000 + +# if you want to check that rotational diffusion is behaving as expected, +# uncomment next three lines for dump output and then plot , +# which should decay exponentially with timescale (d-1)*D_r (with d +# being simulation dimension) + +#dump 1 all custom 2000 dump_ideal_${params}_3d.lammpstrj id type & +# x y xu yu mux muy muz fx fy fz +#dump_modify 1 first yes sort id + +#run 120000 \ No newline at end of file diff --git a/examples/USER/brownian/spherical_ABP/log_WCA_1_1_1_3_4_2d.lammps.log b/examples/USER/brownian/spherical_ABP/log_WCA_1_1_1_3_4_2d.lammps.log new file mode 100644 index 0000000000..0c51314cca --- /dev/null +++ b/examples/USER/brownian/spherical_ABP/log_WCA_1_1_1_3_4_2d.lammps.log @@ -0,0 +1,163 @@ +units lj +atom_style hybrid dipole sphere +WARNING: Atom_style hybrid defines both pertype and peratom masses - both must be set, only peratom masses will be used (src/atom_vec_hybrid.cpp:157) +dimension 2 +newton off + + +lattice sq 0.4 +Lattice spacing in x,y,z = 1.5811388 1.5811388 1.5811388 +region box block -16 16 -16 16 -0.2 0.2 +create_box 1 box +Created orthogonal box = (-25.298221 -25.298221 -0.31622777) to (25.298221 25.298221 0.31622777) + 2 by 2 by 1 MPI processor grid +create_atoms 1 box +Created 1024 atoms + create_atoms CPU = 0.001 seconds +mass * 1.0 +set type * dipole/random ${seed} 1.0 +set type * dipole/random 1974019 1.0 +Setting atom values ... + 1024 settings made for dipole/random +velocity all create 1.0 1 loop geom + +# more careful with neighbors since higher diffusion in abps +neighbor 1.0 bin +neigh_modify every 1 delay 1 check yes + + +# WCA potential (purely repulsive) +pair_style lj/cut 2.5 +pair_coeff * * 1.0 1.0 1.1224 +pair_modify shift yes + + + +# overdamped brownian dynamics time-step +fix step all brownian/sphere ${gamma_t} ${gamma_r} ${D_t} ${D_r} ${seed} dipole +fix step all brownian/sphere 1 ${gamma_r} ${D_t} ${D_r} ${seed} dipole +fix step all brownian/sphere 1 1 ${D_t} ${D_r} ${seed} dipole +fix step all brownian/sphere 1 1 1 ${D_r} ${seed} dipole +fix step all brownian/sphere 1 1 1 3 ${seed} dipole +fix step all brownian/sphere 1 1 1 3 1974019 dipole +# self-propulsion force along the dipole direction +fix activity all propel/self ${fp} dipole +fix activity all propel/self 4 dipole +fix 2 all enforce2d + + +compute press all pressure NULL virial + +thermo_style custom step temp epair c_press + +#equilibration +timestep 0.0000000001 +thermo 50001 +run 50000 +Neighbor list info ... + update every 1 steps, delay 1 steps, check yes + max neighbors/atom: 2000, page size: 100000 + master list distance cutoff = 2.1224 + ghost atom cutoff = 2.1224 + binsize = 1.0612, bins = 48 48 1 + 1 neighbor lists, perpetual/occasional/extra = 1 0 0 + (1) pair lj/cut, perpetual + attributes: half, newton off + pair build: half/bin/newtoff + stencil: half/bin/2d/newtoff + bin: standard +Per MPI rank memory allocation (min/avg/max) = 5.052 | 5.052 | 5.052 Mbytes +Step Temp E_pair c_press + 0 1 0 -0.53979198 + 50000 1.0371295e+10 0 -0.542818 +Loop time of 2.25396 on 4 procs for 50000 steps with 1024 atoms + +Performance: 0.192 tau/day, 22183.200 timesteps/s +99.8% CPU use with 4 MPI tasks x 1 OpenMP threads + +MPI task timing breakdown: +Section | min time | avg time | max time |%varavg| %total +--------------------------------------------------------------- +Pair | 0.1034 | 0.10382 | 0.10438 | 0.1 | 4.61 +Neigh | 0 | 0 | 0 | 0.0 | 0.00 +Comm | 0.26698 | 0.26833 | 0.26924 | 0.2 | 11.90 +Output | 2.2284e-05 | 2.4926e-05 | 3.2332e-05 | 0.0 | 0.00 +Modify | 1.7222 | 1.7237 | 1.727 | 0.1 | 76.48 +Other | | 0.1581 | | | 7.01 + +Nlocal: 256.000 ave 256 max 256 min +Histogram: 4 0 0 0 0 0 0 0 0 0 +Nghost: 105.000 ave 105 max 105 min +Histogram: 4 0 0 0 0 0 0 0 0 0 +Neighs: 544.000 ave 544 max 544 min +Histogram: 4 0 0 0 0 0 0 0 0 0 + +Total # of neighbors = 2176 +Ave neighs/atom = 2.1250000 +Neighbor list builds = 0 +Dangerous builds = 0 +reset_timestep 0 + + +# MSD +compute msd all msd + + +thermo_style custom step temp epair c_msd[*] c_press + + +timestep 0.00001 +thermo 10000 + +# main run +run 200000 +Per MPI rank memory allocation (min/avg/max) = 5.427 | 5.427 | 5.427 Mbytes +Step Temp E_pair c_msd[1] c_msd[2] c_msd[3] c_msd[4] c_press + 0 1.0371295e+10 0 0 0 0 0 -0.542818 + 10000 107356.09 0.079828495 0.19584264 0.19679822 0 0.39264086 0.00078740793 + 20000 101692.44 0.11317533 0.40847364 0.42097802 0 0.82945167 0.74111888 + 30000 105763.55 0.10261852 0.68303669 0.66125751 0 1.3442942 0.71112533 + 40000 105127.29 0.12371743 0.97990144 0.94005552 0 1.919957 1.0574552 + 50000 101579.58 0.12771813 1.3059069 1.2364468 0 2.5423537 1.059263 + 60000 104914.36 0.12055843 1.6215593 1.525488 0 3.1470473 0.79873537 + 70000 106629.18 0.1278745 1.9639958 1.8682794 0 3.8322752 0.91950208 + 80000 103286.54 0.13927689 2.3201565 2.2373383 0 4.5574948 1.1875034 + 90000 106451.61 0.093479681 2.6287902 2.5753347 0 5.2041249 1.0861163 + 100000 102199.72 0.13269425 2.9127976 2.9369237 0 5.8497214 1.4841998 + 110000 105229.73 0.10594209 3.1798718 3.3495317 0 6.5294035 1.5444784 + 120000 106262.36 0.11902575 3.6267452 3.7188125 0 7.3455578 1.3366518 + 130000 109388.12 0.10562576 3.929973 4.0226942 0 7.9526672 1.324534 + 140000 107697.35 0.13028752 4.231893 4.3780995 0 8.6099925 1.7406167 + 150000 103928.72 0.12278994 4.5826286 4.7578662 0 9.3404948 1.3024003 + 160000 103370.23 0.11391216 4.8767011 5.1181189 0 9.99482 1.4325241 + 170000 103821.53 0.11163256 5.153318 5.3785963 0 10.531914 1.4569115 + 180000 106824.99 0.13225083 5.4080929 5.7399804 0 11.148073 1.334984 + 190000 101794.6 0.10632938 5.7384925 6.080955 0 11.819448 0.81285422 + 200000 102128.67 0.13703498 6.0414673 6.4511058 0 12.492573 0.42904128 +Loop time of 9.60419 on 4 procs for 200000 steps with 1024 atoms + +Performance: 17992.140 tau/day, 20824.236 timesteps/s +100.0% CPU use with 4 MPI tasks x 1 OpenMP threads + +MPI task timing breakdown: +Section | min time | avg time | max time |%varavg| %total +--------------------------------------------------------------- +Pair | 0.71756 | 0.75121 | 0.79008 | 3.0 | 7.82 +Neigh | 0.018158 | 0.018773 | 0.019357 | 0.3 | 0.20 +Comm | 1.0469 | 1.0597 | 1.0738 | 1.2 | 11.03 +Output | 0.00051435 | 0.00057078 | 0.00070838 | 0.0 | 0.01 +Modify | 6.8012 | 6.9883 | 7.1513 | 4.9 | 72.76 +Other | | 0.7857 | | | 8.18 + +Nlocal: 256.000 ave 265 max 240 min +Histogram: 1 0 0 0 0 0 1 0 0 2 +Nghost: 88.5000 ave 91 max 87 min +Histogram: 1 0 2 0 0 0 0 0 0 1 +Neighs: 678.500 ave 713 max 597 min +Histogram: 1 0 0 0 0 0 0 0 1 2 + +Total # of neighbors = 2714 +Ave neighs/atom = 2.6503906 +Neighbor list builds = 241 +Dangerous builds = 0 +Total wall time: 0:00:11 diff --git a/examples/USER/brownian/spherical_ABP/log_ideal_1_1_1_3_4_3d.lammps.log b/examples/USER/brownian/spherical_ABP/log_ideal_1_1_1_3_4_3d.lammps.log new file mode 100644 index 0000000000..be6c1d5d41 --- /dev/null +++ b/examples/USER/brownian/spherical_ABP/log_ideal_1_1_1_3_4_3d.lammps.log @@ -0,0 +1,150 @@ +units lj +atom_style hybrid dipole sphere +WARNING: Atom_style hybrid defines both pertype and peratom masses - both must be set, only peratom masses will be used (src/atom_vec_hybrid.cpp:157) +dimension 3 +newton off + + +lattice sc 0.4 +Lattice spacing in x,y,z = 1.3572088 1.3572088 1.3572088 +region box block -8 8 -8 8 -8 8 +create_box 1 box +Created orthogonal box = (-10.857670 -10.857670 -10.857670) to (10.857670 10.857670 10.857670) + 2 by 1 by 2 MPI processor grid +create_atoms 1 box +Created 4096 atoms + create_atoms CPU = 0.002 seconds +mass * 1.0 +set type * dipole/random ${seed} 1.0 +set type * dipole/random 1974019 1.0 +Setting atom values ... + 4096 settings made for dipole/random +velocity all create 1.0 1 loop geom + +pair_style none + +# overdamped brownian dynamics time-step +fix step all brownian/sphere ${gamma_t} ${gamma_r} ${D_t} ${D_r} ${seed} dipole +fix step all brownian/sphere 1 ${gamma_r} ${D_t} ${D_r} ${seed} dipole +fix step all brownian/sphere 1 1 ${D_t} ${D_r} ${seed} dipole +fix step all brownian/sphere 1 1 1 ${D_r} ${seed} dipole +fix step all brownian/sphere 1 1 1 3 ${seed} dipole +fix step all brownian/sphere 1 1 1 3 1974019 dipole +# self-propulsion force along the dipole direction +fix activity all propel/self ${fp} dipole +fix activity all propel/self 4 dipole + + +compute press all pressure NULL virial + +thermo_style custom step temp epair c_press + +#equilibration +timestep 0.0000000001 +thermo 50001 +run 50000 +WARNING: No pairwise cutoff or binsize set. Atom sorting therefore disabled. (src/atom.cpp:2118) +WARNING: Communication cutoff is 0.0. No ghost atoms will be generated. Atoms may get lost. (src/comm_brick.cpp:167) +Per MPI rank memory allocation (min/avg/max) = 4.319 | 4.319 | 4.319 Mbytes +Step Temp E_pair c_press + 0 1 0 0.068021726 + 50000 1.046425e+10 0 0.067505633 +Loop time of 7.83903 on 4 procs for 50000 steps with 4096 atoms + +Performance: 0.055 tau/day, 6378.340 timesteps/s +97.9% CPU use with 4 MPI tasks x 1 OpenMP threads + +MPI task timing breakdown: +Section | min time | avg time | max time |%varavg| %total +--------------------------------------------------------------- +Pair | 0 | 0 | 0 | 0.0 | 0.00 +Neigh | 0 | 0 | 0 | 0.0 | 0.00 +Comm | 0.50238 | 0.51891 | 0.53617 | 1.7 | 6.62 +Output | 2.6343e-05 | 3.6075e-05 | 4.6997e-05 | 0.0 | 0.00 +Modify | 6.9536 | 6.9732 | 7.0105 | 0.8 | 88.95 +Other | | 0.3469 | | | 4.43 + +Nlocal: 1024.00 ave 1024 max 1024 min +Histogram: 4 0 0 0 0 0 0 0 0 0 +Nghost: 353.000 ave 353 max 353 min +Histogram: 4 0 0 0 0 0 0 0 0 0 +Neighs: 0.00000 ave 0 max 0 min +Histogram: 4 0 0 0 0 0 0 0 0 0 + +Total # of neighbors = 0 +Ave neighs/atom = 0.0000000 +Neighbor list builds = 0 +Dangerous builds = 0 +reset_timestep 0 + + +# MSD to demonstrate expected diffusive behaviour for ideal active +# brownian motion, which is +# +# MSD = (2*d*D_t + 2*fp**2/(gamma_t**2*(d-1)*D_r))*t +# +# with d being simulation dimension +compute msd all msd + + +thermo_style custom step temp epair c_msd[*] c_press + + +timestep 0.00001 +thermo 10000 + +# main run +run 120000 +WARNING: Communication cutoff is 0.0. No ghost atoms will be generated. Atoms may get lost. (src/comm_brick.cpp:167) +Per MPI rank memory allocation (min/avg/max) = 4.694 | 4.694 | 4.694 Mbytes +Step Temp E_pair c_msd[1] c_msd[2] c_msd[3] c_msd[4] c_press + 0 1.046425e+10 0 0 0 0 0 0.067505633 + 10000 106340.56 0 0.2469318 0.23662295 0.2441413 0.72769605 0.19939966 + 20000 104620.27 0 0.55429324 0.5231436 0.54976641 1.6272032 0.26601423 + 30000 106130.45 0 0.87562668 0.84813496 0.89321299 2.6169746 0.30836996 + 40000 105773.31 0 1.2262635 1.1899278 1.2626926 3.6788838 0.35392219 + 50000 103804.88 0 1.5851624 1.5645815 1.6434185 4.7931624 0.33326997 + 60000 105746.45 0 1.9928016 1.9347072 1.9837329 5.9112417 0.2550878 + 70000 104500.3 0 2.3269429 2.2774077 2.3368821 6.9412326 0.25218225 + 80000 105381.46 0 2.7114959 2.6937299 2.7171132 8.122339 0.36940892 + 90000 104542.79 0 3.0828648 3.084417 3.0783207 9.2456025 0.36106481 + 100000 104246.75 0 3.4635513 3.5105066 3.4545226 10.42858 0.3712313 + 110000 103099.55 0 3.8471061 3.9389997 3.8220676 11.608173 0.38466185 + 120000 103098.45 0 4.2014598 4.3456831 4.1888659 12.736009 0.36710217 +Loop time of 22.8893 on 4 procs for 120000 steps with 4096 atoms + +Performance: 4529.619 tau/day, 5242.615 timesteps/s +100.0% CPU use with 4 MPI tasks x 1 OpenMP threads + +MPI task timing breakdown: +Section | min time | avg time | max time |%varavg| %total +--------------------------------------------------------------- +Pair | 0 | 0 | 0 | 0.0 | 0.00 +Neigh | 0.0049489 | 0.0050479 | 0.0050978 | 0.1 | 0.02 +Comm | 0.082752 | 0.084491 | 0.085332 | 0.4 | 0.37 +Output | 0.00054352 | 0.0006034 | 0.00064793 | 0.0 | 0.00 +Modify | 21.069 | 21.521 | 21.964 | 7.0 | 94.02 +Other | | 1.278 | | | 5.58 + +Nlocal: 1024.00 ave 1050 max 1010 min +Histogram: 2 0 0 1 0 0 0 0 0 1 +Nghost: 0.00000 ave 0 max 0 min +Histogram: 4 0 0 0 0 0 0 0 0 0 +Neighs: 0.00000 ave 0 max 0 min +Histogram: 4 0 0 0 0 0 0 0 0 0 + +Total # of neighbors = 0 +Ave neighs/atom = 0.0000000 +Neighbor list builds = 2169 +Dangerous builds = 0 + +# if you want to check that rotational diffusion is behaving as expected, +# uncomment next three lines for dump output and then plot , +# which should decay exponentially with timescale (d-1)*D_r (with d +# being simulation dimension) + +#dump 1 all custom 2000 dump_ideal_${params}_3d.lammpstrj id type # x y xu yu mux muy muz fx fy fz +#dump_modify 1 first yes sort id + +#run 120000 +Total wall time: 0:00:30 diff --git a/examples/USER/misc/propel_self/2d_velocity/in.2d_langevin b/examples/USER/misc/propel_self/2d_velocity/in.2d_langevin deleted file mode 100644 index 6a23e0d005..0000000000 --- a/examples/USER/misc/propel_self/2d_velocity/in.2d_langevin +++ /dev/null @@ -1,54 +0,0 @@ -dimension 2 -boundary p p p - -variable L equal 20 -region total block -$L $L -$L $L -0.5 0.5 -lattice hex 0.3 -create_box 2 total -create_atoms 1 box - -# Set random fraction to passive: -set type 1 type/fraction 2 0.5 1337 - -# Purely repulsive particles: -variable rc equal "2^(1.0/6.0)" -pair_style lj/cut ${rc} -pair_coeff * * 1.0 1.0 -pair_modify shift yes - -mass * 1.0 - -fix step all nve -fix temp all langevin 1.0 1.0 1.0 13 -fix twod all enforce2d - -neighbor 0.6 bin - -dump traj all custom 250 2d_active.dump.bin id type x y z - -thermo_style custom time step pe ke etotal temp -thermo 1000 -run 5000 - -group one type 1 -group two type 2 - -compute ke1 one ke -compute ke2 two ke - -thermo_style custom step pe ke etotal temp c_ke1 c_ke2 - -fix active all propel/self velocity 1.0 - -# With active force there is more motion so increase bin size: -neighbor 1.0 bin -run 10000 - -# Only make type 1 active: -fix active all propel/self velocity 1.0 types 1 - -# With active force there is more motion so increase bin size: -neighbor 1.0 bin -run 10000 - - diff --git a/examples/USER/misc/propel_self/2d_velocity/in.2d_viscous b/examples/USER/misc/propel_self/2d_velocity/in.2d_viscous deleted file mode 100644 index 1283a5d574..0000000000 --- a/examples/USER/misc/propel_self/2d_velocity/in.2d_viscous +++ /dev/null @@ -1,37 +0,0 @@ -dimension 2 -boundary p p p - -variable L equal 20 -region total block -$L $L -$L $L -0.5 0.5 -lattice hex 0.3 -create_box 2 total -create_atoms 1 box - -# Set random fraction to passive: -set type 1 type/fraction 2 0.5 1337 - -# Purely repulsive particles: -variable rc equal "2^(1.0/6.0)" -pair_style lj/cut ${rc} -pair_coeff * * 1.0 1.0 -pair_modify shift yes - -mass * 1.0 - -fix step all nve -fix twod all enforce2d - -neighbor 0.6 bin - -dump traj all custom 250 2d_active.dump.bin id type x y z - -thermo_style custom step pe ke etotal temp -thermo 1000 -run 10000 - -fix active all propel/self velocity 1.0 -fix fric all viscous 1.0 - -# With active force there is more motion so increase bin size: -neighbor 1.0 bin -run 10000 diff --git a/examples/USER/misc/propel_self/3d_quaternion/in.3d_quaternion b/examples/USER/misc/propel_self/3d_quaternion/in.3d_quaternion deleted file mode 100644 index d6b6aff7dd..0000000000 --- a/examples/USER/misc/propel_self/3d_quaternion/in.3d_quaternion +++ /dev/null @@ -1,40 +0,0 @@ -dimension 3 -boundary p p p - -atom_style ellipsoid -variable L equal 20 -region total block -$L $L -$L $L -$L $L -lattice sc 0.1 -create_box 2 total -create_atoms 1 box - -# Set random fraction to passive: -set type 1 type/fraction 2 0.5 1337 - -# Purely repulsive particles: -variable rc equal "2^(1.0/6.0)" -pair_style lj/cut ${rc} -pair_coeff * * 1.0 1.0 -pair_modify shift yes - -# mass * 1.0 -set type * shape 1.0 1.0 1.0 -set type * density 1.9098593171027443 -set type * quat 0 0 1 0 - -fix step all nve/asphere -fix temp all langevin 1.0 1.0 1.0 13 angmom 3.333333333 - -neighbor 0.6 bin - -dump traj all custom 100 3d_active.dump.bin id type x y z fx fy fz - -thermo_style custom step pe ke etotal temp -thermo 100 -run 500 - -fix active all propel/self quat 1.0 - -# With active force there is more motion so increase bin size: -neighbor 1.0 bin -run 500 diff --git a/src/USER-BROWNIAN/fix_propel_self.cpp b/src/USER-BROWNIAN/fix_propel_self.cpp new file mode 100644 index 0000000000..1755f59840 --- /dev/null +++ b/src/USER-BROWNIAN/fix_propel_self.cpp @@ -0,0 +1,312 @@ +/* ---------------------------------------------------------------------- + LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator + http://lammps.sandia.gov, Sandia National Laboratories + Steve Plimpton, sjplimp@sandia.gov + + Copyright (2003) Sandia Corporation. Under the terms of Contract + DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains + certain rights in this software. This software is distributed under + the GNU General Public License. + + See the README file in the top-level LAMMPS directory. +------------------------------------------------------------------------- */ + +/* ----------------------------------------------------------------------- + Contributed by Stefan Paquay @ Brandeis University + + Thanks to Liesbeth Janssen @ Eindhoven University for useful discussions! + + Current maintainer: Sam Cameron @ University of Bristol + +----------------------------------------------------------------------- */ + +#include +#include +#include +#include "fix_propel_self.h" +#include "math_extra.h" +#include "atom.h" +#include "atom_vec_ellipsoid.h" +#include "force.h" +#include "update.h" +#include "comm.h" +#include "domain.h" +#include "memory.h" +#include "error.h" + +using namespace LAMMPS_NS; +using namespace FixConst; + +enum{DIPOLE,VELOCITY,QUAT}; + +#define TOL 1e-14 + +/* ---------------------------------------------------------------------- */ + +FixPropelSelf::FixPropelSelf(LAMMPS *lmp, int narg, char **arg) : + Fix(lmp, narg, arg) +{ + + virial_flag = 1; + + if (narg < 5) + error->all(FLERR,"Illegal fix propel/self command"); + + + magnitude = utils::numeric(FLERR,arg[3],false,lmp); + + if (strcmp(arg[4],"velocity") == 0) { + mode = VELOCITY; + thermo_virial = 0; + if (narg != 5) { + error->all(FLERR,"Illegal fix propel/self command"); + } + } else if (strcmp(arg[4],"dipole") == 0) { + mode = DIPOLE; + thermo_virial = 1; + if (narg != 5) { + error->all(FLERR,"Illegal fix propel/self command"); + } + } else if (strcmp(arg[4],"quat") == 0) { + mode = QUAT; + thermo_virial = 1; + if (narg != 8) { + error->all(FLERR,"Illegal fix propel/self command"); + } else { + sx = utils::numeric(FLERR,arg[5],false,lmp); + sy = utils::numeric(FLERR,arg[6],false,lmp); + sz = utils::numeric(FLERR,arg[7],false,lmp); + double qnorm = sqrt(sx*sx + sy*sy + sz*sz); + sx = sx/qnorm; + sy = sy/qnorm; + sz = sz/qnorm; + } + } else { + error->all(FLERR,"Illegal fix propel/self command"); + } + + + + +} + +/* ---------------------------------------------------------------------- */ + +int FixPropelSelf::setmask() +{ + int mask = 0; + mask |= POST_FORCE; + return mask; +} + +/* ---------------------------------------------------------------------- */ + +FixPropelSelf::~FixPropelSelf() +{ + +} + + +/* ---------------------------------------------------------------------- */ + +void FixPropelSelf::init() +{ + if (mode == DIPOLE && !atom->mu_flag) + error->all(FLERR,"Fix propel/self requires atom attribute mu " + "with option dipole."); + + if (mode == QUAT) { + avec = (AtomVecEllipsoid *) atom->style_match("ellipsoid"); + if (!avec) + error->all(FLERR,"Fix propel/self requires " + "atom style ellipsoid with option quat."); + + // check that all particles are finite-size ellipsoids + // no point particles allowed, spherical is OK + + int *ellipsoid = atom->ellipsoid; + int *mask = atom->mask; + int nlocal = atom->nlocal; + + for (int i = 0; i < nlocal; i++) + if (mask[i] & groupbit) + if (ellipsoid[i] < 0) + error->one(FLERR,"Fix propel/self requires extended particles " + "with option quat."); + } + +} + +void FixPropelSelf::setup(int vflag) +{ + post_force(vflag); +} + +void FixPropelSelf::post_force(int vflag) +{ + if (mode == DIPOLE) + post_force_dipole(vflag); + else if (mode == VELOCITY) + post_force_velocity(vflag); + else if (mode == QUAT) + post_force_quaternion(vflag); + +} + + +void FixPropelSelf::post_force_dipole(int vflag) +{ + double **f = atom->f; + int *mask = atom->mask; + int nlocal = atom->nlocal; + double **x = atom->x; + double **mu = atom->mu; + double fx,fy,fz; + + + // energy and virial setup + double vi[6]; + if (vflag) v_setup(vflag); + else evflag = 0; + + // if domain has PBC, need to unwrap for virial + double unwrap[3]; + imageint *image = atom->image; + + // Add the active force to the atom force: + for (int i = 0; i < nlocal; i++) + if (mask[i] & groupbit) { + + fx = magnitude*mu[i][0]; + fy = magnitude*mu[i][1]; + fz = magnitude*mu[i][2]; + f[i][0] += fx; + f[i][1] += fy; + f[i][2] += fz; + + if (evflag) { + domain->unmap(x[i],image[i],unwrap); + vi[0] = fx*unwrap[0]; + vi[1] = fy*unwrap[1]; + vi[2] = fz*unwrap[2]; + vi[3] = fx*unwrap[1]; + vi[4] = fx*unwrap[2]; + vi[5] = fy*unwrap[2]; + v_tally(i, vi); + } + } +} + + +void FixPropelSelf::post_force_velocity(int vflag) +{ + double **f = atom->f; + double **v = atom->v; + double **x = atom->x; + int *mask = atom->mask; + int nlocal = atom->nlocal; + int *type = atom->type; + double nv2,fnorm,fx,fy,fz; + + + // energy and virial setup + double vi[6]; + if (vflag) v_setup(vflag); + else evflag = 0; + + // if domain has PBC, need to unwrap for virial + double unwrap[3]; + imageint *image = atom->image; + + // Add the active force to the atom force: + for(int i = 0; i < nlocal; ++i) { + if( mask[i] & groupbit ){ + + nv2 = v[i][0]*v[i][0] + v[i][1]*v[i][1] + v[i][2]*v[i][2]; + fnorm = 0.0; + + if (nv2 > TOL) { + + // Without this check you can run into numerical + // issues because fnorm will blow up. + + fnorm = magnitude / sqrt(nv2); + } + fx = fnorm * v[i][0]; + fy = fnorm * v[i][1]; + fz = fnorm * v[i][2]; + + f[i][0] += fx; + f[i][1] += fy; + f[i][2] += fz; + + if (evflag) { + domain->unmap(x[i],image[i],unwrap); + vi[0] = fx*unwrap[0]; + vi[1] = fy*unwrap[1]; + vi[2] = fz*unwrap[2]; + vi[3] = fx*unwrap[1]; + vi[4] = fx*unwrap[2]; + vi[5] = fy*unwrap[2]; + v_tally(i, vi); + } + } + } +} + +void FixPropelSelf::post_force_quaternion(int vflag) +{ + double **f = atom->f; + double **x = atom->x; + int *mask = atom->mask; + int nlocal = atom->nlocal; + int *type = atom->type; + int* ellipsoid = atom->ellipsoid; + + // ellipsoidal properties + AtomVecEllipsoid::Bonus *bonus = avec->bonus; + double f_act[3] = { sx, sy, sz }; + double f_rot[3]; + double *quat; + double Q[3][3]; + double fx,fy,fz; + + + // energy and virial setup + double vi[6]; + if (vflag) v_setup(vflag); + else evflag = 0; + + // if domain has PBC, need to unwrap for virial + double unwrap[3]; + imageint *image = atom->image; + + // Add the active force to the atom force: + for( int i = 0; i < nlocal; ++i ){ + if( mask[i] & groupbit ){ + + quat = bonus[ellipsoid[i]].quat; + MathExtra::quat_to_mat( quat, Q ); + MathExtra::matvec( Q, f_act, f_rot ); + + fx = magnitude*f_rot[0]; + fy = magnitude*f_rot[1]; + fz = magnitude*f_rot[2]; + + f[i][0] += fx; + f[i][1] += fy; + f[i][2] += fz; + + if (evflag) { + domain->unmap(x[i],image[i],unwrap); + vi[0] = fx*unwrap[0]; + vi[1] = fy*unwrap[1]; + vi[2] = fz*unwrap[2]; + vi[3] = fx*unwrap[1]; + vi[4] = fx*unwrap[2]; + vi[5] = fy*unwrap[2]; + v_tally(i, vi); + } + } + } +} diff --git a/src/USER-MISC/fix_propel_self.h b/src/USER-BROWNIAN/fix_propel_self.h similarity index 55% rename from src/USER-MISC/fix_propel_self.h rename to src/USER-BROWNIAN/fix_propel_self.h index 47d1e1255b..a51ffe671b 100644 --- a/src/USER-MISC/fix_propel_self.h +++ b/src/USER-BROWNIAN/fix_propel_self.h @@ -21,51 +21,50 @@ FixStyle(propel/self,FixPropelSelf) #define LMP_FIX_PROPEL_SELF_H #include "fix.h" - namespace LAMMPS_NS { class FixPropelSelf : public Fix { public: - FixPropelSelf(class LAMMPS *, int, char **); virtual ~FixPropelSelf(); - virtual int setmask(); - virtual void post_force(int); + void init(); + void post_force(int); + void setup(int); + int setmask(); - double memory_usage(); - - protected: - enum operation_modes { - VELOCITY = 0, - QUATERNION = 1 - }; - -private: + private: double magnitude; + double sx,sy,sz; int mode; - // If 0, apply fix to everything in group. If > 0, apply only to those - // types i for which i <= n_types_filter _and_ apply_to_type[i] == 1: - int n_types_filter; - int *apply_to_type; //< Specifies, per type, if the fix applies to it or not. + void post_force_dipole(int); + void post_force_velocity(int); + void post_force_quaternion(int); + class AtomVecEllipsoid *avec; - int atoms_have_quaternion(); - - template void post_force_velocity(int); - template void post_force_quaternion(int); }; -} +} #endif #endif /* ERROR/WARNING messages: -E: Illegal ... command +E: Illegal fix propel/self command. -Self-explanatory. Check the input script syntax and compare to the -documentation for the command. You can use -echo screen as a -command-line option when running LAMMPS to see the offending line. +Wrong number/type of input arguments. + +E: Fix propel/self requires atom attribute mu with option dipole. + +Self-explanatory. + +E: Fix propel/self requires atom style ellipsoid with option quat. + +Self-explanatory. + +Fix propel/self requires extended particles with option quat. + +Self-explanatory. */ diff --git a/src/USER-MISC/README b/src/USER-MISC/README index 538fdb7952..b7199906a3 100644 --- a/src/USER-MISC/README +++ b/src/USER-MISC/README @@ -68,7 +68,6 @@ fix nvk, Efrem Braun (UC Berkeley), efrem.braun at gmail.com, https://github.com fix orient/eco Adrian A. Schratt and Volker Mohles (Ruhr-Uni Bochum), volker.mohles at rub.de, 6 Jun 2020 fix pafi, Thomas Swinburne (CNRS), swinburne at cinam.univ-mrs.fr, 1st Sep 2020 fix pimd, Yuxing Peng (U Chicago), yuxing at uchicago.edu, 24 Nov 2014 -fix propel/self, Stefan Paquay (Brandeis U), stefanpaquay at gmail.com, 20 Jan 2020 fix rhok, Ulf Pedersen (Roskilde U), ulf at urp.dk, 25 Sep 2017 fix smd, Axel Kohlmeyer, akohlmey at gmail.com, 19 May 2008 fix ti/spring, Rodrigo Freitas (Unicamp/Brazil), rodrigohb at gmail.com, 7 Nov 2013 diff --git a/src/USER-MISC/fix_propel_self.cpp b/src/USER-MISC/fix_propel_self.cpp deleted file mode 100644 index 9299f4d23b..0000000000 --- a/src/USER-MISC/fix_propel_self.cpp +++ /dev/null @@ -1,258 +0,0 @@ -/* ---------------------------------------------------------------------- - LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories - Steve Plimpton, sjplimp@sandia.gov - - Copyright (2003) Sandia Corporation. Under the terms of Contract - DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains - certain rights in this software. This software is distributed under - the GNU General Public License. - - See the README file in the top-level LAMMPS directory. -------------------------------------------------------------------------- */ - -/* ----------------------------------------------------------------------- - Contributed by Stefan Paquay @ Brandeis University - - Thanks to Liesbeth Janssen @ Eindhoven University for useful discussions! ------------------------------------------------------------------------ */ - -#include "fix_propel_self.h" - -#include "atom.h" -#include "atom_vec_ellipsoid.h" -#include "error.h" -#include "math_const.h" -#include "math_extra.h" - -#include -#include -#include - -using namespace LAMMPS_NS; -using namespace FixConst; -using namespace MathConst; - -#define PRINT_DEBUG_OUTPUT 0 - -/* ---------------------------------------------------------------------- */ - -FixPropelSelf::FixPropelSelf( LAMMPS *lmp, int narg, char **argv ) - : Fix(lmp, narg, argv), magnitude(0.0), - mode(VELOCITY), n_types_filter(0), apply_to_type(nullptr) -{ - if (narg < 5) error->all(FLERR, "Illegal fix propel/self command"); - - // The fix is to support the following cases: - // 1. Simple atoms, in which case the force points along the velocity - // 2. Aspherical particles with an orientation. - // The first argument (mode) is used to differentiate between these. - - // args: fix ID all propel/self mode magnitude - // Optional args are - - const char *mode_str = argv[3]; - - if (strcmp(mode_str, "velocity") == 0) { - mode = VELOCITY; - - } else if (strcmp(mode_str, "quat") == 0) { - - // This mode should only be supported if the atom style has - // a quaternion (and if all atoms in the group have it) - - if (!atoms_have_quaternion()) { - error->all(FLERR, "All fix atoms need to be extended particles"); - } - mode = QUATERNION; - - } else { - char msg[2048]; - sprintf(msg, "Illegal mode \"%s\" for fix propel/self", mode_str); - error->all(FLERR, msg); - } - - magnitude = utils::numeric( FLERR, argv[4] ,false,lmp); - - // Handle rest of args: - - int iarg = 5; - while (iarg < narg) { - - if (strcmp(argv[iarg],"types") == 0) { - - apply_to_type = new int[atom->ntypes+1]; - memset(apply_to_type, 0, atom->ntypes * sizeof(int)); - - // consume all following numerical arguments as types - - iarg++; - int flag=0; - while (iarg < narg) { - if (isdigit(argv[iarg][0])) { - int thistype = utils::inumeric(FLERR,argv[iarg],false,lmp); - if ((thistype < 1) || (thistype > atom->ntypes)) - error->all(FLERR,"Illegal atom type to types keyword"); - apply_to_type[thistype] = 1; - flag = 1; - iarg++; - } else break; - } - if (!flag) - error->all(FLERR,"'types' keyword requires at least one type"); - else - n_types_filter = 1; - - } else { - error->all(FLERR,"Illegal fix propel/self command."); - } - } -} - -/* ---------------------------------------------------------------------- */ - -FixPropelSelf::~FixPropelSelf() -{ - delete[] apply_to_type; -} -/* ---------------------------------------------------------------------- */ - -int FixPropelSelf::setmask() -{ - int mask = 0; - mask |= POST_FORCE; - - return mask; -} - -/* ---------------------------------------------------------------------- */ - -double FixPropelSelf::memory_usage() -{ - // magnitude + thermostat_orient + mode + n_types_filter + apply_to_type - double bytes = sizeof(double) + 3*sizeof(int) + sizeof(int*); - bytes += sizeof(int)*atom->ntypes*n_types_filter; - - return bytes; -} - -/* ---------------------------------------------------------------------- */ - -void FixPropelSelf::post_force(int vflag ) -{ - switch(mode) { - case QUATERNION: - if (n_types_filter) post_force_quaternion<1>(vflag); - else post_force_quaternion<0>(vflag); - break; - case VELOCITY: - if (n_types_filter) post_force_velocity<1>(vflag); - else post_force_velocity<0>(vflag); - break; - default: - ; - } -} - -/* ---------------------------------------------------------------------- */ - -template -void FixPropelSelf::post_force_quaternion(int /* vflag */ ) -{ - double **f = atom->f; - - int *mask = atom->mask; - int nlocal = atom->nlocal; - int *type = atom->type; - int* ellipsoid = atom->ellipsoid; - - AtomVecEllipsoid *av = static_cast(atom->style_match("ellipsoid")); - AtomVecEllipsoid::Bonus *bonus = av->bonus; - - // Add the active force to the atom force: - - for( int i = 0; i < nlocal; ++i ){ - if( mask[i] & groupbit ){ - if (filter_by_type && !apply_to_type[type[i]]) { - continue; - } - - double f_act[3] = { 1.0, 0.0, 0.0 }; - double f_rot[3]; - - double *quat = bonus[ellipsoid[i]].quat; - - double Q[3][3]; - MathExtra::quat_to_mat( quat, Q ); - MathExtra::matvec( Q, f_act, f_rot ); - - f[i][0] += magnitude * f_rot[0]; - f[i][1] += magnitude * f_rot[1]; - f[i][2] += magnitude * f_rot[2]; - } - } -} - -/* ---------------------------------------------------------------------- */ - -template -void FixPropelSelf::post_force_velocity(int /*vflag*/) -{ - double **f = atom->f; - double **v = atom->v; - int *mask = atom->mask; - int nlocal = atom->nlocal; - int *type = atom->type; - - // Add the active force to the atom force: - - for(int i = 0; i < nlocal; ++i) { - if( mask[i] & groupbit ){ - if (filter_by_type && !apply_to_type[type[i]]) { - continue; - } - - const double *vi = v[i]; - double f_act[3] = { vi[0], vi[1], vi[2] }; - double nv2 = vi[0]*vi[0] + vi[1]*vi[1] + vi[2]*vi[2]; - double fnorm = 0.0; - const double TOL = 1e-14; - - if (nv2 > TOL) { - - // Without this check you can run into numerical - // issues because fnorm will blow up. - - fnorm = magnitude / sqrt(nv2); - } - - f[i][0] += fnorm * f_act[0]; - f[i][1] += fnorm * f_act[1]; - f[i][2] += fnorm * f_act[2]; - } - } -} - -/* ---------------------------------------------------------------------- */ - -int FixPropelSelf::atoms_have_quaternion() -{ - if (!atom->ellipsoid_flag) { - error->all(FLERR, "Mode 'quat' requires atom style ellipsoid"); - return 0; - } - - int *mask = atom->mask; - int flag=0,flagall=0; - - // Make sure all atoms have ellipsoid data: - - for (int i = 0; i < atom->nlocal; ++i) - if (mask[i] & groupbit) - if (atom->ellipsoid[i] < 0) ++flag; - - MPI_Allreduce(&flag,&flagall,1,MPI_INT,MPI_SUM,world); - if (flagall > 0) return 0; - - return 1; -} From 129210c7a0e87045ff888bdb28d91936d8536734 Mon Sep 17 00:00:00 2001 From: Sam Cameron Date: Sun, 20 Dec 2020 17:38:32 +0000 Subject: [PATCH 14/22] Updated examples and docs, and added basic brownian dynamics integrator (no rotational degrees of freedom). --- doc/src/Commands_fix.rst | 1 + doc/src/fix.rst | 5 +- doc/src/fix_brownian.rst | 151 +++++++++++ doc/src/fix_brownian_asphere.rst | 21 +- doc/src/fix_brownian_sphere.rst | 43 ++- doc/src/fix_propel_self.rst | 7 +- .../USER/brownian/2d_velocity/in.2d_velocity | 64 +++++ .../2d_velocity/log_1_1_4_2d.lammps.log | 248 ++++++++++++++++++ examples/USER/brownian/asphere/README.txt | 2 +- examples/USER/brownian/asphere/in3d.brownian | 30 +-- .../log_gaussian_1_0.33_1_3_3d.lammps.log | 141 ++++++++++ .../USER/brownian/sphere/in2ddipole.brownian | 25 +- .../brownian/sphere/in3d_virial_on.brownian | 22 +- .../USER/brownian/translational/in.brownian | 65 +++++ .../brownian/translational/log_1_1.lammps.log | 246 +++++++++++++++++ src/USER-BROWNIAN/fix_brownian.cpp | 217 +++++++++++++++ src/USER-BROWNIAN/fix_brownian.h | 79 ++++++ 17 files changed, 1268 insertions(+), 99 deletions(-) create mode 100644 doc/src/fix_brownian.rst create mode 100644 examples/USER/brownian/2d_velocity/in.2d_velocity create mode 100644 examples/USER/brownian/2d_velocity/log_1_1_4_2d.lammps.log create mode 100644 examples/USER/brownian/asphere/log_gaussian_1_0.33_1_3_3d.lammps.log create mode 100644 examples/USER/brownian/translational/in.brownian create mode 100644 examples/USER/brownian/translational/log_1_1.lammps.log create mode 100644 src/USER-BROWNIAN/fix_brownian.cpp create mode 100644 src/USER-BROWNIAN/fix_brownian.h diff --git a/doc/src/Commands_fix.rst b/doc/src/Commands_fix.rst index 361ec7e982..9ee699faea 100644 --- a/doc/src/Commands_fix.rst +++ b/doc/src/Commands_fix.rst @@ -39,6 +39,7 @@ OPT. * :doc:`ave/time ` * :doc:`aveforce ` * :doc:`balance ` + * :doc:`brownian ` * :doc:`brownian/asphere ` * :doc:`brownian/sphere ` * :doc:`bocs ` diff --git a/doc/src/fix.rst b/doc/src/fix.rst index 5efe002f31..373e5ac29f 100644 --- a/doc/src/fix.rst +++ b/doc/src/fix.rst @@ -182,8 +182,9 @@ accelerated styles exist. * :doc:`ave/time ` - compute/output global time-averaged quantities * :doc:`aveforce ` - add an averaged force to each atom * :doc:`balance ` - perform dynamic load-balancing -* :doc:`brownian/asphere ` - overdamped translational and rotational brownian for ellipsoids -* :doc:`brownian/sphere ` - overdamped translational and rotational brownian for spheres +* :doc:`brownian ` - overdamped translational brownian motion +* :doc:`brownian/asphere ` - overdamped translational and rotational brownian motion for ellipsoids +* :doc:`brownian/sphere ` - overdamped translational and rotational brownian motion for spheres * :doc:`bocs ` - NPT style time integration with pressure correction * :doc:`bond/break ` - break bonds on the fly * :doc:`bond/create ` - create bonds on the fly diff --git a/doc/src/fix_brownian.rst b/doc/src/fix_brownian.rst new file mode 100644 index 0000000000..e3f3a2679f --- /dev/null +++ b/doc/src/fix_brownian.rst @@ -0,0 +1,151 @@ +.. index:: fix brownian + +fix brownian command +==================== + +Syntax +"""""" + +.. parsed-literal:: + + fix ID group-ID brownian gamma_t diff_t seed keyword args + +* ID, group-ID are documented in :doc:`fix ` command +* brownian/sphere = style name of this fix command +* gamma_t = translational friction coefficient +* diff_t = translational diffusion coefficient +* zero or more keyword/value pairs may be appended +* keyword = *rng* + + .. parsed-literal:: + + *rng* value = *uniform* or *gaussian* or *none* + *uniform* = use uniform random number generator + *gaussian* = use gaussian random number generator + *none* = turn off noise + +Examples +"""""""" + +.. code-block:: LAMMPS + + fix 1 all brownian 1.0 3.0 1294019 + fix 1 all brownian 1.0 3.0 19581092 rng none + fix 1 all brownian 1.0 3.0 19581092 rng uniform + fix 1 all brownian 1.0 3.0 19581092 rng gaussian + + +Description +""""""""""" + +Perform Brownian Dynamics integration to update position and velocity +of atoms in the group each timestep. Brownian Dynamics uses Newton's laws of +motion in the limit that inertial forces are negligible compared to +viscous forces. The stochastic equation of motion is + +.. math:: + + dr = \frac{F}{\gamma_t}dt+\sqrt{2D_t}dW_t, \\ + +where :math:`dW_t` is a Wiener processes (see e.g. :ref:`(Gardiner) `). + +.. note:: + This integrator is designed for generic non-equilibrium + simulations with additive noise. There are two important cases which + (conceptually) reduce the number of free parameters in this fix. + (a) In equilibrium simulations + (where fluctuation dissipation theorems are obeyed), one can define + the thermal energy :math:`k_bT=D_t\gamma_t`. + +--------- + +.. note:: + Temperature computation using the :doc:`compute temp ` + will not correctly compute temperature of these overdamped dynamics + since we are explicitly neglecting inertial effects. + See e.g. chapter 6 of :ref:`(Doi) ` for more details on this. + Temperature is instead defined in terms of the note above (for + equilibrium systems). + +--------- + +.. note:: + The diffusion coefficient :math:`D_t` is measured + in units of (length*length)/time, where time and length + are in the units specified on the :doc:`units ` page. + Similarly, :math:`\gamma_t` is measured in + units of mass/time. + +--------- + +If the *rng* keyword is used with the *uniform* value, then the noise +is generated from a uniform distribution (see +:ref:`(Dunweg) ` for why this works). This is the same method +of noise generation as used in :doc:`fix_langevin `. + +If the *rng* keyword is used with the *gaussian* value, then the noise +is generated from a gaussian distribution. Typically this added +complexity is unnecessary, and one should be fine using the *uniform* +value for reasons argued in :ref:`(Dunweg) `. + +If the *rng* keyword is used with the *none* value, then the noise +terms are set to zero. + + +---------- + +.. include:: accel_styles.rst + +---------- + +Restart, fix_modify, output, run start/stop, minimize info +""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +No information about this fix is written to :doc:`binary restart files `. +No global or per-atom quantities are stored +by this fix for access by various :doc:`output commands `. + +The :doc:`fix_modify ` *virial* option is supported by this +fix to add the contribution due to the added forces on atoms to the +system's virial as part of :doc:`thermodynamic output `. +The default is *virial no*. + +No parameter of this fix can be used with the *start/stop* keywords of +the :doc:`run ` command. This fix is not invoked during +:doc:`energy minimization `. + +Restrictions +"""""""""""" + +This fix is part of the USER-BROWNIAN package. It is only enabled if +LAMMPS was built with that package. See the :doc:`Build package ` +doc page for more info. + + +Related commands +"""""""""""""""" + +:doc:`fix langevin `, :doc:`fix nve/sphere `, +:doc:`fix brownian/sphere `, +:doc:`fix brownian/asphere ` + +Default +""""""" + +The default for *rng* is *uniform*. + +---------- + +.. _GardinerC1: + +**(Gardiner)** Gardiner, A Handbook for the Natural and Social Sciences 4th Ed. (2009). + +.. _Doi1: + +**(Doi)** Doi, Soft Matter Physics (2013). + +.. _Dunweg6: + +**(Dunweg)** Dunweg and Paul, Int J of Modern Physics C, 2, 817-27 (1991). + + diff --git a/doc/src/fix_brownian_asphere.rst b/doc/src/fix_brownian_asphere.rst index 58dd453de9..c59774ca65 100644 --- a/doc/src/fix_brownian_asphere.rst +++ b/doc/src/fix_brownian_asphere.rst @@ -54,8 +54,8 @@ viscous forces. The stochastic equations of motion are d\Omega = \frac{T}{\gamma_r}dt + \sqrt{2D_r}dW_r, where :math:`d\Omega` is an infinitesimal rotation vector (see e.g. -Chapter 4 of :ref:`(Goldstein) `), :math:`dW_t` and -:math:`dW_r` are Wiener processes (see e.g. :ref:`(Gardiner) `). +Chapter 4 of :ref:`(Goldstein) `), :math:`dW_t` and +:math:`dW_r` are Wiener processes (see e.g. :ref:`(Gardiner) `). The quaternions :math:`q` of the ellipsoid are updated each timestep from the angular velocity vector. @@ -66,13 +66,13 @@ values of :math:`\gamma_t`, :math:`\gamma_r`, :math:`D_t`, If the *rng* keyword is used with the *uniform* value, then the noise is generated from a uniform distribution (see -:ref:`(Dunweg) ` for why this works). This is the same method +:ref:`(Dunweg) ` for why this works). This is the same method of noise generation as used in :doc:`fix_langevin `. If the *rng* keyword is used with the *gaussian* value, then the noise is generated from a gaussian distribution. Typically this added complexity is unnecessary, and one should be fine using the *uniform* -value for reasons argued in :ref:`(Dunweg) `. +value for reasons argued in :ref:`(Dunweg) `. If the *rng* keyword is used with the *none* value, then the noise terms are set to zero. @@ -114,7 +114,7 @@ as atoms which have a definite orientation as defined by the Optionally, they can also store a dipole moment as defined by the :doc:`atom_style dipole ` command. -This fix is part of the USER-MISC package. It is only enabled if +This fix is part of the USER-BROWNIAN package. It is only enabled if LAMMPS was built with that package. See the :doc:`Build package ` doc page for more info. @@ -124,8 +124,9 @@ be point particles. Related commands """""""""""""""" -:doc:`fix brownian/sphere `, :doc:`fix langevin `, -:doc:`fix nve/asphere `, :doc:`atom style ` +:doc:`fix brownian `, :doc:`fix brownian/sphere `, +:doc:`fix propel/self `, :doc:`fix langevin `, +:doc:`fix nve/asphere ` Default """"""" @@ -134,15 +135,15 @@ The default for *rng* is *uniform*. ---------- -.. _GoldsteinCM1: +.. _GoldsteinCM2: **(Goldstein)** Goldstein, Poole, and Safko, Classical Mechanics, 3rd Ed. (2001). -.. _GardinerC1: +.. _GardinerC3: **(Gardiner)** Gardiner, A Handbook for the Natural and Social Sciences 4th Ed. (2009). -.. _Dunweg7: +.. _Dunweg8: **(Dunweg)** Dunweg and Paul, Int J of Modern Physics C, 2, 817-27 (1991). diff --git a/doc/src/fix_brownian_sphere.rst b/doc/src/fix_brownian_sphere.rst index 231486dee1..7e73226e08 100644 --- a/doc/src/fix_brownian_sphere.rst +++ b/doc/src/fix_brownian_sphere.rst @@ -53,8 +53,8 @@ viscous forces. The stochastic equations of motion are d\Omega = \frac{T}{\gamma_r}dt + \sqrt{2D_r}dW_r, where :math:`d\Omega` is an infinitesimal rotation vector (see e.g. -Chapter 4 of :ref:`(Goldstein) `), :math:`dW_t` and -:math:`dW_r` are Wiener processes (see e.g. :ref:`(Gardiner) `). +Chapter 4 of :ref:`(Goldstein) `), :math:`dW_t` and +:math:`dW_r` are Wiener processes (see e.g. :ref:`(Gardiner) `). The dipole vectors :math:`e_i` are updated using the rotation matrix .. math:: @@ -85,35 +85,31 @@ section 7.4). --------- -.. note:: - Temperature computation using the :doc:`compute temp ` - will not correctly compute temperature of these overdamped dynamics - since we are explicitly neglecting inertial effects. - See e.g. chapter 6 of :ref:`(Doi) ` for more details on this. - Temperature is instead defined in terms of the note above (for - equilibrium systems). +See note on the unphysical result of using :doc:`compute temp ` +with this fix in :doc:`fix brownian `. --------- .. note:: - The diffusion coefficient :math:`D_t` is measured - in units of (length*length)/time and the diffusion coefficient - :math:`D_r` is measured in units of 1/time, where time and length - are in the units specified on the :doc:`units ` page. Similarly, - :math:`\gamma_t` and :math:`\gamma_r` are measured in + The diffusion coefficient :math:`D_t` and the translational + drag coefficient :math:`\gamma_t` are discussed in + :doc:`fix brownian `. The diffusion coefficient + :math:`D_r` is measured in units of 1/time, where time is in the + units specified on the :doc:`units ` page. Similarly, + and :math:`\gamma_r` is measured in units of mass/time and (mass*length*length)/(time). --------- If the *rng* keyword is used with the *uniform* value, then the noise is generated from a uniform distribution (see -:ref:`(Dunweg) ` for why this works). This is the same method +:ref:`(Dunweg) ` for why this works). This is the same method of noise generation as used in :doc:`fix_langevin `. If the *rng* keyword is used with the *gaussian* value, then the noise is generated from a gaussian distribution. Typically this added complexity is unnecessary, and one should be fine using the *uniform* -value for reasons argued in :ref:`(Dunweg) `. +value for reasons argued in :ref:`(Dunweg) `. If the *rng* keyword is used with the *none* value, then the noise terms are set to zero. @@ -151,7 +147,7 @@ as defined by the :doc:`atom_style sphere ` command. If the *dipole* keyword is used, they must also store a dipole moment as defined by the :doc:`atom_style dipole ` command. -This fix is part of the USER-MISC package. It is only enabled if +This fix is part of the USER-BROWNIAN package. It is only enabled if LAMMPS was built with that package. See the :doc:`Build package ` doc page for more info. @@ -159,8 +155,9 @@ doc page for more info. Related commands """""""""""""""" +:doc:`fix brownian `, :doc:`fix brownian/asphere `, +:doc:`fix propel/self `, :doc:`fix langevin `, :doc:`fix nve/sphere `, -:doc:`atom style ` Default """"""" @@ -169,11 +166,11 @@ The default for *rng* is *uniform*. ---------- -.. _GoldsteinCM: +.. _GoldsteinCM1: **(Goldstein)** Goldstein, Poole, and Safko, Classical Mechanics, 3rd Ed. (2001). -.. _GardinerC: +.. _GardinerC2: **(Gardiner)** Gardiner, A Handbook for the Natural and Social Sciences 4th Ed. (2009). @@ -182,11 +179,7 @@ The default for *rng* is *uniform*. **(Callegari)** Callegari and Volpe, *Numerical Simulations of Active Brownian Particles*, Flowing Matter, 211-238 (2019). -.. _Doi1: - -**(Doi)** Doi, Soft Matter Physics (2013). - -.. _Dunweg6: +.. _Dunweg7: **(Dunweg)** Dunweg and Paul, Int J of Modern Physics C, 2, 817-27 (1991). diff --git a/doc/src/fix_propel_self.rst b/doc/src/fix_propel_self.rst index 6644d97d46..582d9e4294 100644 --- a/doc/src/fix_propel_self.rst +++ b/doc/src/fix_propel_self.rst @@ -21,10 +21,9 @@ Syntax *dipole* value = none = apply force along dipole direction *velocity* value = none = apply force along velocity direction *quat* values = direction vector *sx* and *sy* and *sz* - *sx* = x component of force direction in ellipsoid frame - *sy* = y component of force direction in ellipsoid frame - *sz* = z component of force direction in ellipsoid frame - + *sx* = x component of force direction in ellipsoid frame + *sy* = y component of force direction in ellipsoid frame + *sz* = z component of force direction in ellipsoid frame Examples diff --git a/examples/USER/brownian/2d_velocity/in.2d_velocity b/examples/USER/brownian/2d_velocity/in.2d_velocity new file mode 100644 index 0000000000..b731f5f477 --- /dev/null +++ b/examples/USER/brownian/2d_velocity/in.2d_velocity @@ -0,0 +1,64 @@ +# 2d overdamped brownian dynamics with self-propulsion +# force in direction of velocity. + +variable gamma_t equal 1.0 +variable D_t equal 1.0 +variable seed equal 1974019 +variable fp equal 4.0 + +variable params string ${gamma_t}_${D_t}_${fp} + + +log log_${params}_2d.lammps.log +units lj +dimension 2 +newton off + + +lattice sq 0.4 +region box block -16 16 -16 16 -0.2 0.2 +create_box 1 box +create_atoms 1 box +mass * 1.0 +velocity all create 1.0 1 loop geom + + +neighbor 1.0 bin +neigh_modify every 1 delay 1 check yes + + + +pair_style none + +fix step all brownian ${gamma_t} ${D_t} ${seed} +fix vel all propel/self ${fp} velocity +fix 2 all enforce2d +fix_modify vel virial yes + +compute press all pressure NULL virial + +thermo_style custom step temp epair c_press + +#equilibration +timestep 0.0000000001 +thermo 50001 +run 50000 +reset_timestep 0 + + +#initialisation for the main run + +# MSD +compute msd all msd + + +thermo_style custom step temp epair c_msd[*] c_press + + +timestep 0.00001 +thermo 1000 + +# main run +run 120000 + + diff --git a/examples/USER/brownian/2d_velocity/log_1_1_4_2d.lammps.log b/examples/USER/brownian/2d_velocity/log_1_1_4_2d.lammps.log new file mode 100644 index 0000000000..f6b234e9ee --- /dev/null +++ b/examples/USER/brownian/2d_velocity/log_1_1_4_2d.lammps.log @@ -0,0 +1,248 @@ +units lj +dimension 2 +newton off + + +lattice sq 0.4 +Lattice spacing in x,y,z = 1.5811388 1.5811388 1.5811388 +region box block -16 16 -16 16 -0.2 0.2 +create_box 1 box +Created orthogonal box = (-25.298221 -25.298221 -0.31622777) to (25.298221 25.298221 0.31622777) + 1 by 1 by 1 MPI processor grid +create_atoms 1 box +Created 1024 atoms + create_atoms CPU = 0.001 seconds +mass * 1.0 +velocity all create 1.0 1 loop geom + + +neighbor 1.0 bin +neigh_modify every 1 delay 1 check yes + + + +pair_style none + + + +#compute d all property/atom mux muy muz + +fix step all brownian ${gamma_t} ${D_t} ${seed} +fix step all brownian 1 ${D_t} ${seed} +fix step all brownian 1 1 ${seed} +fix step all brownian 1 1 1974019 +fix vel all propel/self ${fp} velocity +fix vel all propel/self 4 velocity +fix 2 all enforce2d +fix_modify vel virial yes + +compute press all pressure NULL virial + +thermo_style custom step temp epair c_press + +#equilibration +timestep 0.0000000001 +thermo 50001 +run 50000 +WARNING: No pairwise cutoff or binsize set. Atom sorting therefore disabled. (src/atom.cpp:2118) +WARNING: Communication cutoff is 0.0. No ghost atoms will be generated. Atoms may get lost. (src/comm_brick.cpp:167) +Per MPI rank memory allocation (min/avg/max) = 2.289 | 2.289 | 2.289 Mbytes +Step Temp E_pair c_press + 0 1 0 -0.18336111 + 50000 1.9663098e+10 0 -0.75033044 +Loop time of 2.45902 on 1 procs for 50000 steps with 1024 atoms + +Performance: 0.176 tau/day, 20333.276 timesteps/s +100.0% CPU use with 1 MPI tasks x 1 OpenMP threads + +MPI task timing breakdown: +Section | min time | avg time | max time |%varavg| %total +--------------------------------------------------------------- +Pair | 0 | 0 | 0 | 0.0 | 0.00 +Neigh | 0 | 0 | 0 | 0.0 | 0.00 +Comm | 0.0078395 | 0.0078395 | 0.0078395 | 0.0 | 0.32 +Output | 2.2947e-05 | 2.2947e-05 | 2.2947e-05 | 0.0 | 0.00 +Modify | 2.332 | 2.332 | 2.332 | 0.0 | 94.83 +Other | | 0.1192 | | | 4.85 + +Nlocal: 1024.00 ave 1024 max 1024 min +Histogram: 1 0 0 0 0 0 0 0 0 0 +Nghost: 65.0000 ave 65 max 65 min +Histogram: 1 0 0 0 0 0 0 0 0 0 +Neighs: 0.00000 ave 0 max 0 min +Histogram: 1 0 0 0 0 0 0 0 0 0 + +Total # of neighbors = 0 +Ave neighs/atom = 0.0000000 +Neighbor list builds = 0 +Dangerous builds = 0 +reset_timestep 0 + + +#initialisation for the main run + +# MSD +compute msd all msd + + +thermo_style custom step temp epair c_msd[*] c_press + + +timestep 0.00001 +thermo 1000 + +# main run +run 120000 +WARNING: Communication cutoff is 0.0. No ghost atoms will be generated. Atoms may get lost. (src/comm_brick.cpp:167) +Per MPI rank memory allocation (min/avg/max) = 2.664 | 2.664 | 2.664 Mbytes +Step Temp E_pair c_msd[1] c_msd[2] c_msd[3] c_msd[4] c_press + 0 1.9663098e+10 0 0 0 0 0 -0.75033044 + 1000 199346.07 0 0.01933096 0.020555579 0 0.039886539 -0.45701943 + 2000 198310 0 0.040165459 0.041283119 0 0.081448577 0.34264096 + 3000 204115.93 0 0.057654441 0.060411193 0 0.11806563 -0.41710363 + 4000 196903.18 0 0.075874071 0.08470884 0 0.16058291 -0.18627889 + 5000 201382.13 0 0.097484871 0.1049401 0 0.20242497 -0.12876225 + 6000 195317.96 0 0.11872475 0.12469358 0 0.24341834 -0.3084651 + 7000 192139.34 0 0.14148561 0.14363452 0 0.28512013 0.0032867364 + 8000 201737.84 0 0.16055109 0.16405717 0 0.32460826 0.36435453 + 9000 199390.58 0 0.17897382 0.18795928 0 0.3669331 0.025659298 + 10000 207807.41 0 0.19680417 0.20733821 0 0.40414239 -0.35368379 + 11000 201936.29 0 0.21666426 0.22702132 0 0.44368558 0.044253449 + 12000 196863.68 0 0.2394452 0.24672678 0 0.48617198 0.059027892 + 13000 199368.34 0 0.26647368 0.2700584 0 0.53653208 0.27090461 + 14000 201246.39 0 0.28799289 0.29823282 0 0.58622571 0.59883778 + 15000 195355.47 0 0.29975278 0.32348787 0 0.62324065 -0.70763643 + 16000 198372.41 0 0.32191014 0.34434864 0 0.66625878 -0.36543908 + 17000 193442.08 0 0.33927003 0.36811239 0 0.70738242 0.28541473 + 18000 197441 0 0.36067818 0.38982011 0 0.75049829 -0.45670227 + 19000 208769.5 0 0.37965583 0.41015661 0 0.78981244 -0.47803396 + 20000 198311.2 0 0.3968078 0.42701175 0 0.82381955 -0.18642397 + 21000 201365.22 0 0.4151043 0.44909345 0 0.86419775 0.86839756 + 22000 198253.24 0 0.4396583 0.46388261 0 0.90354091 -0.19592545 + 23000 204598.51 0 0.45382292 0.49253671 0 0.94635963 -0.24169987 + 24000 211421.88 0 0.46086338 0.51831304 0 0.97917642 0.49751915 + 25000 198690.71 0 0.47110913 0.53640271 0 1.0075118 -0.24475563 + 26000 203981.49 0 0.49265476 0.55310571 0 1.0457605 0.20237224 + 27000 201128.99 0 0.52865208 0.57516064 0 1.1038127 -0.40826104 + 28000 198529.77 0 0.54479087 0.59876678 0 1.1435576 0.41576857 + 29000 205024.27 0 0.56195744 0.61217109 0 1.1741285 -0.79146635 + 30000 201565.62 0 0.58276132 0.63743585 0 1.2201972 -0.065832917 + 31000 197893.43 0 0.61132665 0.66126375 0 1.2725904 0.47907079 + 32000 201395.11 0 0.61904956 0.67520462 0 1.2942542 -0.7408472 + 33000 202064.22 0 0.64760511 0.69087605 0 1.3384812 -0.14601514 + 34000 191227.75 0 0.65698736 0.73857849 0 1.3955659 0.2177548 + 35000 199474.65 0 0.66491543 0.76604575 0 1.4309612 -0.64627039 + 36000 195252.77 0 0.67565581 0.79911139 0 1.4747672 0.0293298 + 37000 198167.14 0 0.68899202 0.81268008 0 1.5016721 -0.0055245918 + 38000 202995.35 0 0.70224976 0.82436547 0 1.5266152 -0.2826768 + 39000 197129.03 0 0.71270072 0.8579444 0 1.5706451 0.063623666 + 40000 199153.69 0 0.73777312 0.88820969 0 1.6259828 -0.26740551 + 41000 205347.31 0 0.75613153 0.9006214 0 1.6567529 0.82415354 + 42000 199423.73 0 0.76864739 0.92457092 0 1.6932183 -0.16636304 + 43000 198052 0 0.79841199 0.93832523 0 1.7367372 -0.016241224 + 44000 205205.39 0 0.81727188 0.96823569 0 1.7855076 -0.10405924 + 45000 199116.46 0 0.83208052 0.99352694 0 1.8256075 0.040835286 + 46000 198759.48 0 0.84291542 1.0038949 0 1.8468104 0.46109436 + 47000 189676.9 0 0.86430719 1.0131299 0 1.8774371 -0.67947102 + 48000 199801.4 0 0.90662572 1.0286589 0 1.9352846 -0.5293946 + 49000 199730.89 0 0.93530132 1.0568273 0 1.9921286 -0.27562311 + 50000 203272.56 0 0.96366375 1.0790026 0 2.0426664 -0.10629234 + 51000 196992.09 0 0.97818106 1.1030549 0 2.0812359 0.31719382 + 52000 204063.62 0 1.0068773 1.1239506 0 2.130828 -7.1998264e-05 + 53000 204349.41 0 1.0277098 1.1546477 0 2.1823575 0.16897786 + 54000 203207.3 0 1.0415673 1.1881409 0 2.2297082 -0.25033492 + 55000 194841.07 0 1.0600954 1.2179033 0 2.2779987 0.0062433629 + 56000 198601.58 0 1.071562 1.2363958 0 2.3079578 -0.13124124 + 57000 196654.6 0 1.0997086 1.2486573 0 2.3483659 -0.46425912 + 58000 197781.48 0 1.112526 1.2706195 0 2.3831455 0.26007922 + 59000 199853.9 0 1.1295132 1.2978402 0 2.4273533 -0.030877018 + 60000 201698.14 0 1.1690892 1.3228782 0 2.4919675 -0.23190043 + 61000 199260.52 0 1.1870513 1.3431945 0 2.5302458 -0.040373885 + 62000 196909.15 0 1.2007194 1.3683525 0 2.5690719 0.21318495 + 63000 203927.79 0 1.2442809 1.3964232 0 2.6407041 0.10156282 + 64000 205322.27 0 1.2721207 1.4159422 0 2.6880629 0.33393307 + 65000 199142.6 0 1.2989685 1.4330729 0 2.7320414 -0.65644005 + 66000 205023.06 0 1.2948208 1.4255094 0 2.7203302 0.22290721 + 67000 209750.01 0 1.3127511 1.4369628 0 2.7497139 -0.40241279 + 68000 200205.19 0 1.3355277 1.4541568 0 2.7896846 0.6665415 + 69000 198653.01 0 1.3500764 1.4962697 0 2.8463461 -0.28396983 + 70000 207485.71 0 1.3825583 1.5095552 0 2.8921135 0.34774599 + 71000 203918.68 0 1.4090995 1.5246756 0 2.9337751 0.071958672 + 72000 199038.47 0 1.4246969 1.5612784 0 2.9859753 -0.42129173 + 73000 197380.7 0 1.445835 1.6025372 0 3.0483722 -0.099854135 + 74000 205006.49 0 1.4703253 1.606784 0 3.0771093 0.137244 + 75000 196040.42 0 1.4897388 1.6297195 0 3.1194583 -0.46715263 + 76000 200022.09 0 1.5178017 1.6560075 0 3.1738092 -0.21504553 + 77000 200766.4 0 1.5184584 1.6673791 0 3.1858374 0.54447858 + 78000 199636.76 0 1.5344452 1.6845098 0 3.2189549 0.021903761 + 79000 204188.86 0 1.5567356 1.7205197 0 3.2772553 0.15356898 + 80000 199862.31 0 1.5669731 1.7265239 0 3.2934969 -0.26342032 + 81000 198557.57 0 1.5735674 1.7468943 0 3.3204617 0.22068216 + 82000 203675.4 0 1.5898596 1.7646027 0 3.3544624 0.51221445 + 83000 203412.56 0 1.6066548 1.7813624 0 3.3880172 0.33512263 + 84000 200896.36 0 1.6112635 1.812552 0 3.4238154 1.1657793 + 85000 198987.17 0 1.652135 1.8336748 0 3.4858098 -0.20419704 + 86000 203027.04 0 1.6728041 1.864244 0 3.5370481 0.61746313 + 87000 203913.8 0 1.6783324 1.8762967 0 3.554629 0.28428076 + 88000 205061.23 0 1.6781682 1.879458 0 3.5576262 0.089285353 + 89000 198210.89 0 1.7017682 1.9029345 0 3.6047027 -0.23977904 + 90000 196170.91 0 1.7291253 1.9258436 0 3.6549689 0.15806438 + 91000 202846.79 0 1.7592339 1.9431644 0 3.7023983 0.17723099 + 92000 198976.91 0 1.762318 1.9742003 0 3.7365183 0.25668658 + 93000 194578.12 0 1.7880716 2.0009816 0 3.7890532 0.20231476 + 94000 200319.82 0 1.7854494 2.020855 0 3.8063044 0.14729427 + 95000 202430.33 0 1.7925005 2.0480213 0 3.8405218 -0.28291245 + 96000 200145.58 0 1.8113602 2.0621043 0 3.8734644 0.05547277 + 97000 194617.53 0 1.8286924 2.0729365 0 3.9016289 -0.59829377 + 98000 200829.37 0 1.8485835 2.077731 0 3.9263145 0.78242718 + 99000 198197.55 0 1.8537119 2.0873455 0 3.9410573 -0.52970118 + 100000 204149.63 0 1.8897394 2.0942927 0 3.9840321 0.58118967 + 101000 198654.59 0 1.9126448 2.1380708 0 4.0507156 -0.61766977 + 102000 201198.05 0 1.9433521 2.143049 0 4.0864011 0.15570108 + 103000 200383.43 0 1.9669578 2.1361518 0 4.1031095 -0.10556532 + 104000 204363.26 0 1.9827272 2.1564095 0 4.1391367 -0.060748593 + 105000 198267.87 0 1.9904164 2.1804141 0 4.1708305 0.40995747 + 106000 202082.12 0 1.993709 2.1925288 0 4.1862378 -0.52458386 + 107000 200209.49 0 2.015427 2.219161 0 4.234588 -0.67350679 + 108000 203112.58 0 2.0467303 2.2405372 0 4.2872675 0.25033168 + 109000 203844.13 0 2.056314 2.2623929 0 4.3187068 0.3384149 + 110000 201740.33 0 2.0706519 2.285547 0 4.3561989 0.35582365 + 111000 202493.05 0 2.0725826 2.308685 0 4.3812676 -0.26487212 + 112000 205404.09 0 2.0969613 2.3252767 0 4.422238 0.58346057 + 113000 201223.54 0 2.0876103 2.3316941 0 4.4193044 0.37747414 + 114000 208649.11 0 2.1095116 2.3488008 0 4.4583124 0.068129648 + 115000 202708.5 0 2.1233837 2.3701129 0 4.4934966 -0.23734073 + 116000 202482.42 0 2.1221907 2.4262516 0 4.5484424 -0.087142119 + 117000 200384.65 0 2.1487723 2.4619437 0 4.6107161 -0.13673271 + 118000 196885.36 0 2.158057 2.4818335 0 4.6398905 0.31912412 + 119000 194064.42 0 2.1821315 2.5032336 0 4.6853651 0.17615749 + 120000 195203.09 0 2.1939678 2.539838 0 4.7338058 0.5106086 +Loop time of 6.05038 on 1 procs for 120000 steps with 1024 atoms + +Performance: 17136.102 tau/day, 19833.451 timesteps/s +100.0% CPU use with 1 MPI tasks x 1 OpenMP threads + +MPI task timing breakdown: +Section | min time | avg time | max time |%varavg| %total +--------------------------------------------------------------- +Pair | 0 | 0 | 0 | 0.0 | 0.00 +Neigh | 0.00031301 | 0.00031301 | 0.00031301 | 0.0 | 0.01 +Comm | 0.0072472 | 0.0072472 | 0.0072472 | 0.0 | 0.12 +Output | 0.0036492 | 0.0036492 | 0.0036492 | 0.0 | 0.06 +Modify | 5.7173 | 5.7173 | 5.7173 | 0.0 | 94.50 +Other | | 0.3218 | | | 5.32 + +Nlocal: 1024.00 ave 1024 max 1024 min +Histogram: 1 0 0 0 0 0 0 0 0 0 +Nghost: 0.00000 ave 0 max 0 min +Histogram: 1 0 0 0 0 0 0 0 0 0 +Neighs: 0.00000 ave 0 max 0 min +Histogram: 1 0 0 0 0 0 0 0 0 0 + +Total # of neighbors = 0 +Ave neighs/atom = 0.0000000 +Neighbor list builds = 154 +Dangerous builds = 0 + + +Total wall time: 0:00:08 diff --git a/examples/USER/brownian/asphere/README.txt b/examples/USER/brownian/asphere/README.txt index 7cb5d2e8e6..47e79353c6 100644 --- a/examples/USER/brownian/asphere/README.txt +++ b/examples/USER/brownian/asphere/README.txt @@ -1,2 +1,2 @@ -The input file in2d.bd demonstrates how to run a 2d simulation +The input file in3d.brownian demonstrates how to run a 3d simulation of ellipsoidal particles undergoing overdamped brownian motion. diff --git a/examples/USER/brownian/asphere/in3d.brownian b/examples/USER/brownian/asphere/in3d.brownian index 67d95a82b9..19487978ce 100644 --- a/examples/USER/brownian/asphere/in3d.brownian +++ b/examples/USER/brownian/asphere/in3d.brownian @@ -1,10 +1,14 @@ -# 3d overdamped brownian dynamics +# 3d overdamped brownian dynamics for ellipsoids +# with dipole moment also being updated +# choose variables to obey thermal equilibrium +# (fluctuation dissipation theorem) and no-slip +# boundary condition variable rng string gaussian -variable gamma_t equal 4.0 -variable gamma_r equal 1.0 -variable D_t equal 7.0 -variable D_r equal 13.0 +variable gamma_t equal 1.0 +variable gamma_r equal 0.33 +variable D_t equal 1.0 +variable D_r equal 3.0 variable seed equal 1974019 variable params string ${rng}_${gamma_t}_${gamma_r}_${D_t}_${D_r} @@ -27,16 +31,11 @@ set type * shape 1 1 1 set type * quat/random ${seed} velocity all create 1.0 1 loop geom - -neighbor 1.0 bin -neigh_modify every 1 delay 1 check yes - - - pair_style none -fix 1 all brownian/asphere ${gamma_t} ${gamma_r} ${D_t} ${D_r} ${seed} rng ${rng} dipole +fix 1 all brownian/asphere ${gamma_t} ${gamma_r} ${D_t} ${D_r} & + ${seed} rng ${rng} dipole compute press all pressure NULL virial @@ -50,8 +49,6 @@ run 50000 reset_timestep 0 -#initialisation for the main run - # MSD compute msd all msd @@ -59,11 +56,6 @@ compute msd all msd thermo_style custom step temp epair c_msd[*] c_press -# write trajectory and thermo in a log-scale frequency -#dump 1 all custom 1000 dump_${params}_3d.lammpstrj id type & -# x y xu yu mux muy muz fx fy fz -#dump_modify 1 first yes sort id - timestep 0.00001 thermo 10000 diff --git a/examples/USER/brownian/asphere/log_gaussian_1_0.33_1_3_3d.lammps.log b/examples/USER/brownian/asphere/log_gaussian_1_0.33_1_3_3d.lammps.log new file mode 100644 index 0000000000..2ed81ec8ba --- /dev/null +++ b/examples/USER/brownian/asphere/log_gaussian_1_0.33_1_3_3d.lammps.log @@ -0,0 +1,141 @@ +units lj +atom_style hybrid dipole sphere ellipsoid +WARNING: Atom_style hybrid defines both pertype and peratom masses - both must be set, only peratom masses will be used (src/atom_vec_hybrid.cpp:157) +WARNING: Peratom rmass is in multiple sub-styles - must be used consistently (src/atom_vec_hybrid.cpp:219) +dimension 3 +newton off + + +lattice sc 0.4 +Lattice spacing in x,y,z = 1.3572088 1.3572088 1.3572088 +region box block -4 4 -4 4 -4 4 +create_box 1 box +Created orthogonal box = (-5.4288352 -5.4288352 -5.4288352) to (5.4288352 5.4288352 5.4288352) + 1 by 1 by 1 MPI processor grid +create_atoms 1 box +Created 512 atoms + create_atoms CPU = 0.002 seconds +mass * 1.0 +set type * dipole/random ${seed} 1.0 +set type * dipole/random 1974019 1.0 +Setting atom values ... + 512 settings made for dipole/random +set type * shape 1 1 1 +Setting atom values ... + 512 settings made for shape +set type * quat/random ${seed} +set type * quat/random 1974019 +Setting atom values ... + 512 settings made for quat/random +velocity all create 1.0 1 loop geom + +pair_style none + + +fix 1 all brownian/asphere ${gamma_t} ${gamma_r} ${D_t} ${D_r} ${seed} rng ${rng} dipole +fix 1 all brownian/asphere 1 ${gamma_r} ${D_t} ${D_r} ${seed} rng ${rng} dipole +fix 1 all brownian/asphere 1 0.33 ${D_t} ${D_r} ${seed} rng ${rng} dipole +fix 1 all brownian/asphere 1 0.33 1 ${D_r} ${seed} rng ${rng} dipole +fix 1 all brownian/asphere 1 0.33 1 3 ${seed} rng ${rng} dipole +fix 1 all brownian/asphere 1 0.33 1 3 1974019 rng ${rng} dipole +fix 1 all brownian/asphere 1 0.33 1 3 1974019 rng gaussian dipole + + +compute press all pressure NULL virial + +thermo_style custom step temp epair c_press + +#equilibration +timestep 0.0000000001 +thermo 50000 +run 50000 +WARNING: No pairwise cutoff or binsize set. Atom sorting therefore disabled. (src/atom.cpp:2118) +WARNING: Communication cutoff is 0.0. No ghost atoms will be generated. Atoms may get lost. (src/comm_brick.cpp:167) +Per MPI rank memory allocation (min/avg/max) = 5.379 | 5.379 | 5.379 Mbytes +Step Temp E_pair c_press + 0 1 0 0 + 50000 1.9891104e+10 0 0 +Loop time of 5.53749 on 1 procs for 50000 steps with 512 atoms + +Performance: 0.078 tau/day, 9029.362 timesteps/s +100.0% CPU use with 1 MPI tasks x 1 OpenMP threads + +MPI task timing breakdown: +Section | min time | avg time | max time |%varavg| %total +--------------------------------------------------------------- +Pair | 0 | 0 | 0 | 0.0 | 0.00 +Neigh | 0 | 0 | 0 | 0.0 | 0.00 +Comm | 0.11711 | 0.11711 | 0.11711 | 0.0 | 2.11 +Output | 2.034e-05 | 2.034e-05 | 2.034e-05 | 0.0 | 0.00 +Modify | 5.3401 | 5.3401 | 5.3401 | 0.0 | 96.44 +Other | | 0.08027 | | | 1.45 + +Nlocal: 512.000 ave 512 max 512 min +Histogram: 1 0 0 0 0 0 0 0 0 0 +Nghost: 217.000 ave 217 max 217 min +Histogram: 1 0 0 0 0 0 0 0 0 0 +Neighs: 0.00000 ave 0 max 0 min +Histogram: 1 0 0 0 0 0 0 0 0 0 + +Total # of neighbors = 0 +Ave neighs/atom = 0.0000000 +Neighbor list builds = 0 +Dangerous builds = 0 +reset_timestep 0 + + +# MSD +compute msd all msd + + +thermo_style custom step temp epair c_msd[*] c_press + + +timestep 0.00001 +thermo 10000 + +# main run +run 120000 +WARNING: Communication cutoff is 0.0. No ghost atoms will be generated. Atoms may get lost. (src/comm_brick.cpp:167) +Per MPI rank memory allocation (min/avg/max) = 5.754 | 5.754 | 5.754 Mbytes +Step Temp E_pair c_msd[1] c_msd[2] c_msd[3] c_msd[4] c_press + 0 1.9891104e+10 0 0 0 0 0 0 + 10000 201972.17 0 0.19918647 0.20079752 0.20495007 0.60493407 0 + 20000 197255.49 0 0.40800225 0.37910274 0.38545643 1.1725614 0 + 30000 195533.67 0 0.60991554 0.5898132 0.56621596 1.7659447 0 + 40000 192777.99 0 0.7761198 0.86101776 0.76531344 2.402451 0 + 50000 195241.43 0 1.0053256 1.0477568 0.96681401 3.0198964 0 + 60000 201887.49 0 1.2298892 1.1979933 1.1950141 3.6228965 0 + 70000 200187.14 0 1.4407329 1.356743 1.3992739 4.1967498 0 + 80000 202737.24 0 1.6305637 1.5663775 1.5724692 4.7694104 0 + 90000 185530.51 0 1.7937597 1.7795995 1.7222809 5.2956401 0 + 100000 204405.47 0 2.0149709 1.9738573 1.9423625 5.9311907 0 + 110000 194892.4 0 2.1974948 2.1560014 2.1453303 6.4988264 0 + 120000 198462.51 0 2.3761388 2.334739 2.287964 6.9988418 0 +Loop time of 13.0463 on 1 procs for 120000 steps with 512 atoms + +Performance: 7947.110 tau/day, 9198.044 timesteps/s +100.0% CPU use with 1 MPI tasks x 1 OpenMP threads + +MPI task timing breakdown: +Section | min time | avg time | max time |%varavg| %total +--------------------------------------------------------------- +Pair | 0 | 0 | 0 | 0.0 | 0.00 +Neigh | 0.0011789 | 0.0011789 | 0.0011789 | 0.0 | 0.01 +Comm | 0.030109 | 0.030109 | 0.030109 | 0.0 | 0.23 +Output | 0.00030614 | 0.00030614 | 0.00030614 | 0.0 | 0.00 +Modify | 12.834 | 12.834 | 12.834 | 0.0 | 98.38 +Other | | 0.1803 | | | 1.38 + +Nlocal: 512.000 ave 512 max 512 min +Histogram: 1 0 0 0 0 0 0 0 0 0 +Nghost: 0.00000 ave 0 max 0 min +Histogram: 1 0 0 0 0 0 0 0 0 0 +Neighs: 0.00000 ave 0 max 0 min +Histogram: 1 0 0 0 0 0 0 0 0 0 + +Total # of neighbors = 0 +Ave neighs/atom = 0.0000000 +Neighbor list builds = 1748 +Dangerous builds = 0 +Total wall time: 0:00:18 diff --git a/examples/USER/brownian/sphere/in2ddipole.brownian b/examples/USER/brownian/sphere/in2ddipole.brownian index 73d90e4ebf..e7a8374984 100644 --- a/examples/USER/brownian/sphere/in2ddipole.brownian +++ b/examples/USER/brownian/sphere/in2ddipole.brownian @@ -1,4 +1,5 @@ -# 2d overdamped brownian dynamics +# 2d overdamped brownian dynamics of a sphere +# with dipole also being updated variable rng string gaussian variable gamma_t equal 4.0 @@ -26,19 +27,10 @@ mass * 1.0 set type * dipole/random ${seed} 1.0 velocity all create 1.0 1 loop geom - -neighbor 1.0 bin -neigh_modify every 1 delay 1 check yes - - - pair_style none - - -#compute d all property/atom mux muy muz - -fix 1 all brownian/sphere ${gamma_t} ${gamma_r} ${D_t} ${D_r} ${seed} rng ${rng} dipole +fix 1 all brownian/sphere ${gamma_t} ${gamma_r} ${D_t} & + ${D_r} ${seed} rng ${rng} dipole fix 2 all enforce2d compute press all pressure NULL virial @@ -51,9 +43,6 @@ thermo 50001 run 50000 reset_timestep 0 - -#initialisation for the main run - # MSD compute msd all msd @@ -61,12 +50,6 @@ compute msd all msd thermo_style custom step temp epair c_msd[*] c_press -# write trajectory and thermo in a log-scale frequency -# uncomment next three lines for dump output -#dump 1 all custom 2000 dump_${params}_2d.lammpstrj id type & -# x y xu yu mux muy muz fx fy fz -#dump_modify 1 first yes sort id - timestep 0.00001 thermo 1000 diff --git a/examples/USER/brownian/sphere/in3d_virial_on.brownian b/examples/USER/brownian/sphere/in3d_virial_on.brownian index 481d9bc1b4..2fb08cbb17 100644 --- a/examples/USER/brownian/sphere/in3d_virial_on.brownian +++ b/examples/USER/brownian/sphere/in3d_virial_on.brownian @@ -1,4 +1,6 @@ -# 3d overdamped brownian dynamics +# 3d overdamped brownian dynamics of sphere, with +# virial contribution (i.e. ideal gas pressure) +# included variable rng string uniform @@ -16,7 +18,6 @@ log log_${params}_3d.lammps.log units lj atom_style sphere dimension 3 -newton off lattice sc 0.4 @@ -26,14 +27,11 @@ create_atoms 1 box #mass * 1.0 velocity all create 1.0 1 loop geom - -neighbor 1.0 bin -neigh_modify every 1 delay 1 check yes - pair_style none -fix 1 all brownian/sphere ${gamma_t} ${gamma_r} ${D_t} ${D_r} ${seed} rng ${rng} +fix 1 all brownian/sphere ${gamma_t} ${gamma_r} ${D_t} & + ${D_r} ${seed} rng ${rng} fix_modify 1 virial yes compute press all pressure NULL virial @@ -46,22 +44,12 @@ thermo 50001 run 50000 reset_timestep 0 - -#initialisation for the main run - # MSD compute msd all msd thermo_style custom step temp epair c_msd[*] c_press - -# write trajectory and thermo in a log-scale frequency -# uncomment the next three lines for dump file -#dump 1 all custom 10000 dump_${params}_3d.lammpstrj id type & -# x y xu yu fx fy fz -#dump_modify 1 first yes sort id - timestep 0.00001 thermo 1000 diff --git a/examples/USER/brownian/translational/in.brownian b/examples/USER/brownian/translational/in.brownian new file mode 100644 index 0000000000..fbf43e68c6 --- /dev/null +++ b/examples/USER/brownian/translational/in.brownian @@ -0,0 +1,65 @@ +# 3d overdamped brownian dynamics + +variable gamma_t equal 1.0 +variable D_t equal 1.0 +variable seed equal 1974019 + +variable params string ${gamma_t}_${D_t} + + +log log_${params}.lammps.log +units lj +dimension 3 +newton off + + +lattice sc 0.4 +region box block -8 8 -8 8 -8 8 +create_box 1 box +create_atoms 1 box +mass * 1.0 +velocity all create 1.0 1 loop geom + + +neighbor 1.0 bin +neigh_modify every 1 delay 1 check yes + + + +pair_style none + +# simple overdamped brownian dynamics time-stepper +fix step all brownian ${gamma_t} ${D_t} ${seed} + +# turn on the virial contribution from the noise +# (this is the ideal gas pressure, but it is really noisy +# for small systems) +fix_modify step virial yes + +compute press all pressure NULL virial + +thermo_style custom step temp epair c_press + +#equilibration +timestep 0.0000000001 +thermo 50001 +run 50000 +reset_timestep 0 + + +#initialisation for the main run + +# MSD +compute msd all msd + + +thermo_style custom step temp epair c_msd[*] c_press + + +timestep 0.00001 +thermo 1000 + +# main run +run 120000 + + diff --git a/examples/USER/brownian/translational/log_1_1.lammps.log b/examples/USER/brownian/translational/log_1_1.lammps.log new file mode 100644 index 0000000000..0fdba989bd --- /dev/null +++ b/examples/USER/brownian/translational/log_1_1.lammps.log @@ -0,0 +1,246 @@ +units lj +dimension 3 +newton off + + +lattice sc 0.4 +Lattice spacing in x,y,z = 1.3572088 1.3572088 1.3572088 +region box block -8 8 -8 8 -8 8 +create_box 1 box +Created orthogonal box = (-10.857670 -10.857670 -10.857670) to (10.857670 10.857670 10.857670) + 1 by 1 by 1 MPI processor grid +create_atoms 1 box +Created 4096 atoms + create_atoms CPU = 0.002 seconds +mass * 1.0 +velocity all create 1.0 1 loop geom + + +neighbor 1.0 bin +neigh_modify every 1 delay 1 check yes + + + +pair_style none + +# simple overdamped brownian dynamics time-stepper +fix step all brownian ${gamma_t} ${D_t} ${seed} +fix step all brownian 1 ${D_t} ${seed} +fix step all brownian 1 1 ${seed} +fix step all brownian 1 1 1974019 + +# turn on the virial contribution from the noise +# (this is the ideal gas pressure, but it is really noisy +# for small systems) +fix_modify step virial yes + +compute press all pressure NULL virial + +thermo_style custom step temp epair c_press + +#equilibration +timestep 0.0000000001 +thermo 50001 +run 50000 +WARNING: No pairwise cutoff or binsize set. Atom sorting therefore disabled. (src/atom.cpp:2118) +WARNING: Communication cutoff is 0.0. No ghost atoms will be generated. Atoms may get lost. (src/comm_brick.cpp:167) +Per MPI rank memory allocation (min/avg/max) = 2.319 | 2.319 | 2.319 Mbytes +Step Temp E_pair c_press + 0 1 0 1500.0667 + 50000 2.0204192e+10 0 809.28898 +Loop time of 8.36695 on 1 procs for 50000 steps with 4096 atoms + +Performance: 0.052 tau/day, 5975.895 timesteps/s +100.0% CPU use with 1 MPI tasks x 1 OpenMP threads + +MPI task timing breakdown: +Section | min time | avg time | max time |%varavg| %total +--------------------------------------------------------------- +Pair | 0 | 0 | 0 | 0.0 | 0.00 +Neigh | 0 | 0 | 0 | 0.0 | 0.00 +Comm | 0.081773 | 0.081773 | 0.081773 | 0.0 | 0.98 +Output | 3.0396e-05 | 3.0396e-05 | 3.0396e-05 | 0.0 | 0.00 +Modify | 7.8039 | 7.8039 | 7.8039 | 0.0 | 93.27 +Other | | 0.4812 | | | 5.75 + +Nlocal: 4096.00 ave 4096 max 4096 min +Histogram: 1 0 0 0 0 0 0 0 0 0 +Nghost: 817.000 ave 817 max 817 min +Histogram: 1 0 0 0 0 0 0 0 0 0 +Neighs: 0.00000 ave 0 max 0 min +Histogram: 1 0 0 0 0 0 0 0 0 0 + +Total # of neighbors = 0 +Ave neighs/atom = 0.0000000 +Neighbor list builds = 0 +Dangerous builds = 0 +reset_timestep 0 + + +#initialisation for the main run + +# MSD +compute msd all msd + + +thermo_style custom step temp epair c_msd[*] c_press + + +timestep 0.00001 +thermo 1000 + +# main run +run 120000 +WARNING: Communication cutoff is 0.0. No ghost atoms will be generated. Atoms may get lost. (src/comm_brick.cpp:167) +Per MPI rank memory allocation (min/avg/max) = 2.694 | 2.694 | 2.694 Mbytes +Step Temp E_pair c_msd[1] c_msd[2] c_msd[3] c_msd[4] c_press + 0 2.0204192e+10 0 0 0 0 0 3.053092 + 1000 199589.87 0 0.020515986 0.019445659 0.020084014 0.060045658 -10.855191 + 2000 202255.37 0 0.039423387 0.039839097 0.041243768 0.12050625 -7.8484884 + 3000 197932.37 0 0.058057959 0.060232381 0.061205106 0.17949545 14.441358 + 4000 201354.42 0 0.08020915 0.080140903 0.081351793 0.24170185 -2.7088264 + 5000 201599.34 0 0.10065125 0.099423954 0.10004367 0.30011888 10.000367 + 6000 198355.3 0 0.12039302 0.12228165 0.12136204 0.36403671 -7.7331104 + 7000 201842.08 0 0.13901495 0.14401324 0.14070032 0.42372851 1.049759 + 8000 200224.96 0 0.16063188 0.16389028 0.16409878 0.48862093 14.748306 + 9000 198468.62 0 0.18050666 0.18555949 0.18441359 0.55047975 -7.2751841 + 10000 197958.21 0 0.20229316 0.20438608 0.20471694 0.61139618 -8.8169492 + 11000 200852.8 0 0.22244961 0.22388152 0.22417791 0.67050904 -0.56323783 + 12000 200135.84 0 0.24070342 0.23964066 0.24829459 0.72863867 -20.246433 + 13000 199160.33 0 0.26021951 0.2581362 0.27210493 0.79046065 6.2400743 + 14000 200016.58 0 0.28005738 0.27429833 0.29107673 0.84543244 9.8390268 + 15000 200805.25 0 0.30110658 0.29756813 0.31002936 0.90870407 -9.7474978 + 16000 201221.83 0 0.31982855 0.31758368 0.33140494 0.96881716 -11.937757 + 17000 199690.18 0 0.33896659 0.33908504 0.35143307 1.0294847 -11.627541 + 18000 197165.97 0 0.35589324 0.3605585 0.37062404 1.0870758 17.045279 + 19000 202921.66 0 0.36968243 0.3825335 0.38579438 1.1380103 -3.2942099 + 20000 200415.26 0 0.39189833 0.39811842 0.40650662 1.1965234 -0.55679809 + 21000 198882.79 0 0.41394816 0.42495341 0.42660986 1.2655114 0.26572202 + 22000 199352.13 0 0.43200564 0.44555233 0.44842807 1.325986 5.9839474 + 23000 200565.11 0 0.45248704 0.46736174 0.4633773 1.3832261 0.51141727 + 24000 197632.73 0 0.47648878 0.49070755 0.48561349 1.4528098 11.301781 + 25000 203284.74 0 0.50103025 0.5117464 0.50162451 1.5144012 4.0966379 + 26000 200458.42 0 0.52111051 0.53245594 0.52193205 1.5754985 -9.2090189 + 27000 197553.02 0 0.54097922 0.553215 0.5440757 1.6382699 -6.0708365 + 28000 200874.32 0 0.55707209 0.57015852 0.56334199 1.6905726 -17.349073 + 29000 199494.43 0 0.57734934 0.59276209 0.58014344 1.7502549 -7.0407471 + 30000 199898.09 0 0.60161157 0.6156313 0.60516078 1.8224036 -1.3770813 + 31000 200867.7 0 0.62383361 0.64008503 0.6272796 1.8911982 -8.3200079 + 32000 198811.59 0 0.64361889 0.66089102 0.64987533 1.9543852 -0.21133799 + 33000 198224.12 0 0.66695348 0.67669734 0.67749939 2.0211502 0.87075722 + 34000 202553.2 0 0.69470773 0.69930784 0.69600623 2.0900218 1.7428524 + 35000 199227.86 0 0.71973625 0.72255845 0.71991572 2.1622104 2.4381317 + 36000 200719.05 0 0.73772312 0.74086704 0.74438632 2.2229765 -8.8184183 + 37000 198054.45 0 0.75901548 0.76107029 0.76677002 2.2868558 9.0699905 + 38000 198496.92 0 0.77679013 0.78067416 0.78055585 2.3380201 -8.8374756 + 39000 199224.19 0 0.79689891 0.8074183 0.79624042 2.4005576 -2.3099574 + 40000 199514.11 0 0.81493522 0.8271518 0.81729253 2.4593796 8.5411105 + 41000 199926.55 0 0.82918834 0.84950171 0.83531381 2.5140039 -6.8276624 + 42000 201659.21 0 0.84991161 0.87416096 0.86612093 2.5901935 -11.006396 + 43000 201502.51 0 0.87967597 0.89570393 0.88920119 2.6645811 9.4305203 + 44000 194956.27 0 0.9022655 0.91604833 0.90539218 2.723706 1.7636771 + 45000 201853.02 0 0.92302957 0.93661741 0.93225051 2.7918975 9.6483674 + 46000 200572.92 0 0.94062662 0.94933155 0.94953376 2.8394919 1.0882497 + 47000 202008.49 0 0.95397524 0.97655157 0.96534559 2.8958724 -7.9450141 + 48000 199748.89 0 0.97441115 0.99687233 0.98429144 2.9555749 5.0525854 + 49000 203008.7 0 0.99757948 1.0095536 0.99836015 3.0054932 28.410878 + 50000 198810.18 0 1.0182591 1.0287254 1.0110652 3.0580497 22.596989 + 51000 201716 0 1.0414747 1.0448379 1.0361279 3.1224404 -0.3397634 + 52000 200682.63 0 1.0640391 1.0597767 1.0596255 3.1834413 8.9163814 + 53000 201068.23 0 1.0804112 1.0740541 1.077586 3.2320513 8.9631815 + 54000 203379.33 0 1.0965663 1.0832317 1.0981473 3.2779453 -7.8020084 + 55000 197117.81 0 1.1145489 1.1008769 1.1259188 3.3413446 13.723633 + 56000 201100.37 0 1.1420502 1.1311309 1.1425839 3.415765 10.39045 + 57000 199911.61 0 1.1641357 1.1461183 1.1598876 3.4701416 -1.5384143 + 58000 202180.4 0 1.1787793 1.1703422 1.1794284 3.5285498 4.9552552 + 59000 202359.35 0 1.2017068 1.1846051 1.1912556 3.5775675 14.774737 + 60000 196182.35 0 1.2297664 1.2087508 1.2116928 3.65021 12.484104 + 61000 201858.45 0 1.2505094 1.2255583 1.2330327 3.7091004 3.6962199 + 62000 198313.02 0 1.2756755 1.2437434 1.2514738 3.7708927 -6.5600779 + 63000 198423.1 0 1.2998594 1.262369 1.2656961 3.8279245 3.1919497 + 64000 202601.56 0 1.3177969 1.2812961 1.2841642 3.8832572 7.1735962 + 65000 201270.73 0 1.3353533 1.3006911 1.306668 3.9427124 3.7612957 + 66000 199480.32 0 1.3502663 1.3165416 1.3300249 3.9968327 -8.0484056 + 67000 202829.47 0 1.3628924 1.3369328 1.339246 4.0390712 -2.962791 + 68000 200269.53 0 1.3901352 1.3600404 1.3528283 4.1030039 29.395886 + 69000 201514.31 0 1.4135333 1.3834796 1.3719116 4.1689245 9.5358653 + 70000 198898.14 0 1.4323413 1.4056025 1.4015088 4.2394526 13.713608 + 71000 198446.83 0 1.4424061 1.4229225 1.4231698 4.2884984 9.5266069 + 72000 199550.94 0 1.4730822 1.4438093 1.4436864 4.360578 5.4060926 + 73000 201536.57 0 1.4860349 1.4557531 1.4673417 4.4091297 2.7527606 + 74000 201688.68 0 1.5078921 1.4770318 1.4889958 4.4739197 -2.5507167 + 75000 203168.01 0 1.5264946 1.4942757 1.5095341 4.5303045 13.955087 + 76000 198782.86 0 1.5363851 1.5145529 1.5306446 4.5815826 1.6748995 + 77000 199306.04 0 1.55336 1.5308045 1.5501462 4.6343107 1.4463705 + 78000 199420.52 0 1.5679804 1.5445387 1.5765555 4.6890745 -15.926362 + 79000 198711.33 0 1.5818761 1.5651424 1.5966885 4.743707 -23.662716 + 80000 202734.35 0 1.6045976 1.5878467 1.6155179 4.8079623 1.4177771 + 81000 199953.12 0 1.6266918 1.6125491 1.6370893 4.8763302 14.40188 + 82000 201254.27 0 1.6418366 1.6362867 1.6497081 4.9278313 -4.3503 + 83000 200442.35 0 1.6671772 1.6544269 1.6638838 4.9854878 -5.5569751 + 84000 201442.09 0 1.6772029 1.6819435 1.6824211 5.0415676 -17.634517 + 85000 202012.75 0 1.7026782 1.7059915 1.7079961 5.1166659 8.8311485 + 86000 198613.4 0 1.725679 1.7251262 1.7235885 5.1743936 10.070509 + 87000 198650.79 0 1.748013 1.7447674 1.7397963 5.2325767 7.3326989 + 88000 199753.54 0 1.7793864 1.7677848 1.7548586 5.3020298 -3.8460869 + 89000 200851.56 0 1.7992856 1.7843281 1.7671516 5.3507653 10.274664 + 90000 202029.24 0 1.8178051 1.8010651 1.7886511 5.4075213 1.1705818 + 91000 200963.98 0 1.8425785 1.8123748 1.8079693 5.4629226 -8.0390883 + 92000 200443.4 0 1.8743616 1.8355736 1.8340515 5.5439867 -12.186363 + 93000 197974.1 0 1.8911764 1.8440063 1.8442582 5.579441 10.189145 + 94000 201285.41 0 1.9040394 1.8567044 1.8663386 5.6270824 7.8537148 + 95000 198472.81 0 1.9268236 1.8638624 1.8855767 5.6762627 11.556616 + 96000 198171.93 0 1.9378011 1.8811168 1.9024245 5.7213424 -7.3493903 + 97000 200055.5 0 1.9539002 1.9031647 1.9221125 5.7791774 -7.2823252 + 98000 200350.77 0 1.973424 1.9255707 1.9393139 5.8383087 2.3526328 + 99000 198923.17 0 1.9946733 1.9416292 1.9616759 5.8979785 -8.6362233 + 100000 196205.31 0 2.015688 1.967164 1.9801696 5.9630216 1.5261152 + 101000 198842.45 0 2.0402634 1.9858628 1.9939889 6.0201151 6.8070808 + 102000 199060.56 0 2.0583018 2.0040652 2.0225396 6.0849067 5.4626963 + 103000 204892.64 0 2.0788003 2.0245826 2.0405395 6.1439224 -19.988675 + 104000 198709.07 0 2.0990457 2.0519007 2.0571079 6.2080544 -21.365135 + 105000 198916.99 0 2.1089408 2.0758832 2.0899796 6.2748037 4.3696238 + 106000 202191.68 0 2.1172909 2.0923523 2.1208274 6.3304706 8.2072292 + 107000 202428.89 0 2.1387532 2.114944 2.1418816 6.3955788 4.1099611 + 108000 197690.67 0 2.1620575 2.136726 2.1703555 6.469139 5.7183695 + 109000 200098.73 0 2.1814376 2.1464455 2.1828177 6.5107008 7.4366333 + 110000 197901.18 0 2.1955124 2.1764141 2.1994286 6.5713551 -6.4288954 + 111000 199478.54 0 2.2167884 2.1900638 2.2140739 6.6209261 22.379137 + 112000 198391.65 0 2.249996 2.2100316 2.2309406 6.6909682 -20.040892 + 113000 200542.42 0 2.2634106 2.2313768 2.2610988 6.7558862 0.2953844 + 114000 202117.15 0 2.28441 2.2517036 2.2787302 6.8148438 16.75177 + 115000 200004.06 0 2.2957226 2.2730837 2.2901883 6.8589947 -4.3125612 + 116000 200648.11 0 2.3184059 2.2934521 2.3257075 6.9375656 5.7210624 + 117000 198600.57 0 2.3413891 2.3102468 2.3511234 7.0027593 -2.9987639 + 118000 199817.34 0 2.3732051 2.3347741 2.3601752 7.0681544 -3.3658539 + 119000 200556.96 0 2.3873448 2.3595646 2.3774937 7.1244031 20.860601 + 120000 200997.81 0 2.4097258 2.3736031 2.3871081 7.170437 -5.3623487 +Loop time of 20.5037 on 1 procs for 120000 steps with 4096 atoms + +Performance: 5056.640 tau/day, 5852.593 timesteps/s +99.9% CPU use with 1 MPI tasks x 1 OpenMP threads + +MPI task timing breakdown: +Section | min time | avg time | max time |%varavg| %total +--------------------------------------------------------------- +Pair | 0 | 0 | 0 | 0.0 | 0.00 +Neigh | 0.0012425 | 0.0012425 | 0.0012425 | 0.0 | 0.01 +Comm | 0.015074 | 0.015074 | 0.015074 | 0.0 | 0.07 +Output | 0.006156 | 0.006156 | 0.006156 | 0.0 | 0.03 +Modify | 19.243 | 19.243 | 19.243 | 0.0 | 93.85 +Other | | 1.238 | | | 6.04 + +Nlocal: 4096.00 ave 4096 max 4096 min +Histogram: 1 0 0 0 0 0 0 0 0 0 +Nghost: 0.00000 ave 0 max 0 min +Histogram: 1 0 0 0 0 0 0 0 0 0 +Neighs: 0.00000 ave 0 max 0 min +Histogram: 1 0 0 0 0 0 0 0 0 0 + +Total # of neighbors = 0 +Ave neighs/atom = 0.0000000 +Neighbor list builds = 205 +Dangerous builds = 0 + + +Total wall time: 0:00:28 diff --git a/src/USER-BROWNIAN/fix_brownian.cpp b/src/USER-BROWNIAN/fix_brownian.cpp new file mode 100644 index 0000000000..f25f6d6b32 --- /dev/null +++ b/src/USER-BROWNIAN/fix_brownian.cpp @@ -0,0 +1,217 @@ +/* ---------------------------------------------------------------------- + LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator + http://lammps.sandia.gov, Sandia National Laboratories + Steve Plimpton, sjplimp@sandia.gov + + Copyright (2003) Sandia Corporation. Under the terms of Contract + DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains + certain rights in this software. This software is distributed under + the GNU General Public License. + + See the README file in the top-level LAMMPS directory. +------------------------------------------------------------------------- */ + +/* ---------------------------------------------------------------------- + Originally modified from USER-CGDNA/fix_nve_dotc_langevin.cpp. + + Contributing author: Sam Cameron (University of Bristol) +------------------------------------------------------------------------- */ + +#include "fix_brownian.h" + +#include +#include +#include "math_extra.h" +#include "atom.h" +#include "force.h" +#include "update.h" +#include "comm.h" +#include "domain.h" +#include "random_mars.h" +#include "memory.h" +#include "error.h" + + +using namespace LAMMPS_NS; +using namespace FixConst; + +/* ---------------------------------------------------------------------- */ + +FixBrownian::FixBrownian(LAMMPS *lmp, int narg, char **arg) : + Fix(lmp, narg, arg) +{ + virial_flag = 1; + + time_integrate = 1; + + if (narg != 6 && narg != 8) + error->all(FLERR,"Illegal fix brownian command."); + + gamma_t = utils::numeric(FLERR,arg[3],false,lmp); + if (gamma_t <= 0.0) + error->all(FLERR,"Fix brownian viscous drag " + "coefficient must be > 0."); + + diff_t = utils::numeric(FLERR,arg[4],false,lmp); + if (diff_t <= 0.0) + error->all(FLERR,"Fix brownian diffusion " + "coefficient must be > 0."); + + seed = utils::inumeric(FLERR,arg[5],false,lmp); + if (seed <= 0) error->all(FLERR,"Fix brownian seed must be > 0."); + + noise_flag = 1; + gaussian_noise_flag = 0; + + if (narg == 8) { + + if (strcmp(arg[6],"rng") == 0) { + if (strcmp(arg[7],"uniform") == 0) { + noise_flag = 1; + } else if (strcmp(arg[7],"gaussian") == 0) { + noise_flag = 1; + gaussian_noise_flag = 1; + } else if (strcmp(arg[7],"none") == 0) { + noise_flag = 0; + } else { + error->all(FLERR,"Illegal fix brownian command."); + } + } else { + error->all(FLERR,"Illegal fix brownian command."); + } + } + + // initialize Marsaglia RNG with processor-unique seed + random = new RanMars(lmp,seed + comm->me); + +} + +/* ---------------------------------------------------------------------- */ + +int FixBrownian::setmask() +{ + int mask = 0; + mask |= INITIAL_INTEGRATE; + mask |= POST_FORCE; + return mask; +} + +/* ---------------------------------------------------------------------- */ + +FixBrownian::~FixBrownian() +{ + delete random; +} + + + +/* ---------------------------------------------------------------------- */ + +void FixBrownian::init() +{ + + g1 = force->ftm2v/gamma_t; + if (noise_flag == 0) { + g2 = 0; + rng_func = &RanMars::zero_rng; + } else if (gaussian_noise_flag == 1) { + g2 = gamma_t*sqrt(2 * diff_t)/force->ftm2v; + rng_func = &RanMars::gaussian; + } else { + g2 = gamma_t*sqrt( 24 * diff_t)/force->ftm2v; + rng_func = &RanMars::uniform_middle; + } + + dt = update->dt; + sqrtdt = sqrt(dt); +} + +void FixBrownian::setup(int vflag) +{ + post_force(vflag); +} + +/* ---------------------------------------------------------------------- */ + +void FixBrownian::initial_integrate(int /* vflag */) +{ + double **x = atom->x; + double **v = atom->v; + double **f = atom->f; + int *mask = atom->mask; + int nlocal = atom->nlocal; + double dx,dy,dz; + + if (igroup == atom->firstgroup) nlocal = atom->nfirst; + + + for (int i = 0; i < nlocal; i++) { + if (mask[i] & groupbit) { + + dx = dt * g1 * f[i][0]; + x[i][0] += dx; + v[i][0] = dx/dt; + + dy = dt * g1 * f[i][1]; + x[i][1] += dy; + v[i][1] = dy/dt; + + dz = dt * g1 * f[i][2]; + x[i][2] += dz; + v[i][2] = dz/dt; + + } + } + + + return; +} + +/* ---------------------------------------------------------------------- + apply random force, stolen from MISC/fix_efield.cpp +------------------------------------------------------------------------- */ + +void FixBrownian::post_force(int vflag) +{ + double **f = atom->f; + double **x = atom->x; + int *mask = atom->mask; + imageint *image = atom->image; + int nlocal = atom->nlocal; + + // virial setup + + if (vflag) v_setup(vflag); + else evflag = 0; + + double fx,fy,fz; + double v[6]; + + for (int i = 0; i < nlocal; i++) + if (mask[i] & groupbit) { + + fx = g2 * (random->*rng_func)()/sqrtdt; + fy = g2 * (random->*rng_func)()/sqrtdt; + fz = g2 * (random->*rng_func)()/sqrtdt; + f[i][0] += fx; + f[i][1] += fy; + f[i][2] += fz; + + if (evflag) { + v[0] = fx*x[i][0]; + v[1] = fy*x[i][1]; + v[2] = fz*x[i][2]; + v[3] = fx*x[i][1]; + v[4] = fx*x[i][2]; + v[5] = fy*x[i][2]; + v_tally(i, v); + } + } +} + +void FixBrownian::reset_dt() +{ + + dt = update->dt; + sqrtdt = sqrt(dt); +} diff --git a/src/USER-BROWNIAN/fix_brownian.h b/src/USER-BROWNIAN/fix_brownian.h new file mode 100644 index 0000000000..fb56edb39e --- /dev/null +++ b/src/USER-BROWNIAN/fix_brownian.h @@ -0,0 +1,79 @@ +/* -*- c++ -*- ---------------------------------------------------------- + LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator + http://lammps.sandia.gov, Sandia National Laboratories + Steve Plimpton, sjplimp@sandia.gov + + Copyright (2003) Sandia Corporation. Under the terms of Contract + DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains + certain rights in this software. This software is distributed under + the GNU General Public License. + + See the README file in the top-level LAMMPS directory. +------------------------------------------------------------------------- */ + +#ifdef FIX_CLASS + +FixStyle(brownian,FixBrownian) + +#else + +#ifndef LMP_FIX_BROWNIAN_H +#define LMP_FIX_BROWNIAN_H + +#include "fix.h" + +namespace LAMMPS_NS { + +class FixBrownian : public Fix { + public: + FixBrownian(class LAMMPS *, int, char **); + virtual ~FixBrownian(); + void init(); + void initial_integrate(int); + void setup(int); + void post_force(int); + int setmask(); + void reset_dt(); + + private: + int seed; // RNG seed + double dt, sqrtdt; // time step interval and its sqrt + + + double gamma_t; // translational damping param + double diff_t; // translational diffusion coeff + + double g1,g2; // prefactors in time stepping + int noise_flag; // 0/1 for noise off/on + int gaussian_noise_flag; // 0/1 for uniform/gaussian noise + +protected: + class RanMars *random; + typedef double (RanMars::*rng_member)(); + rng_member rng_func; // placeholder for RNG function + +}; + +} +#endif +#endif + +/* ERROR/WARNING messages: + +E: Illegal fix brownian command. + +Wrong number/type of input arguments. + +E: Fix brownian viscous drag coefficient must be > 0. + +Self-explanatory. + +E: Fix brownian diffusion coefficient must be > 0. + +Self-explanatory. + +E: Fix brownian seed must be > 0. + +Self-explanatory. + +*/ From 5a3cb38705ee169fa5da4b96cd17716f3a24bb8c Mon Sep 17 00:00:00 2001 From: Sam Cameron Date: Mon, 21 Dec 2020 10:58:27 +0000 Subject: [PATCH 15/22] Made requested changes to fix propel/self. Last thing to change would be to re-introduce the types keyword into this fix if that was deemed to be best. --- doc/src/fix_propel_self.rst | 55 ++++---- .../USER/brownian/2d_velocity/in.2d_velocity | 2 +- .../USER/brownian/spherical_ABP/in.2d_abp | 2 +- .../brownian/spherical_ABP/in.3d_ideal_abp | 2 +- .../log_WCA_1_1_1_3_4_2d.lammps.log | 126 +++++++++--------- .../log_ideal_1_1_1_3_4_3d.lammps.log | 92 ++++++------- src/USER-BROWNIAN/fix_propel_self.cpp | 52 ++++---- 7 files changed, 170 insertions(+), 161 deletions(-) diff --git a/doc/src/fix_propel_self.rst b/doc/src/fix_propel_self.rst index 582d9e4294..ba8c48cf6b 100644 --- a/doc/src/fix_propel_self.rst +++ b/doc/src/fix_propel_self.rst @@ -8,22 +8,19 @@ Syntax .. parsed-literal:: - fix ID group-ID propel/self magnitude keyword values + fix ID group-ID propel/self mode magnitude keyword values * ID, group-ID are documented in :doc:`fix ` command * propel/self = style name of this fix command +* mode = *dipole* or *velocity* or *quat* * magnitude = magnitude of self-propulsion force -* one (and only one) keyword/value pair must be appended to args -* keyword = *dipole* or *velocity* or *quat* +* zero or one keyword/value pairs may be appended +* keyword = *qvector* .. parsed-literal:: - *dipole* value = none = apply force along dipole direction - *velocity* value = none = apply force along velocity direction - *quat* values = direction vector *sx* and *sy* and *sz* - *sx* = x component of force direction in ellipsoid frame - *sy* = y component of force direction in ellipsoid frame - *sz* = z component of force direction in ellipsoid frame + *qvector* value = direction of force in ellipsoid frame + *sx*, *sy*, *sz* = components of *qvector* Examples @@ -31,9 +28,9 @@ Examples .. code-block:: LAMMPS - fix propel/self all 40.0 dipole - fix propel/self all 10.0 velocity - fix propel/self all 15.7 quat 1.0 0.0 0.0 + fix active all propel/self dipole 40.0 + fix active all propel/self velocity 10.0 + fix active all propel/self quat 15.7 qvector 1.0 0.0 0.0 Description """"""""""" @@ -50,7 +47,7 @@ is the magnitude of the force, and :math:`e_i` is the vector direction of the force. The specification of :math:`e_i` is based on which of the three keywords (*dipole* or *velocity* or *quat*) one selects. -For keyword *dipole*, :math:`e_i` is just equal to +For mode *dipole*, :math:`e_i` is just equal to the dipole vectors of the atoms in the group. Therefore, if the dipoles are not unit vectors, the :math:`e_i` will not be unit vectors. @@ -66,21 +63,31 @@ are not unit vectors, the :math:`e_i` will not be unit vectors. all the dipole magnitudes to 1.0 unless you have a good reason not to (see the :doc:`set ` command on how to do this). -For keyword *velocity*, :math:`e_i` points in the direction +For mode *velocity*, :math:`e_i` points in the direction of the current velocity (a unit-vector). This can be interpreted as a velocity-dependent friction, as proposed by e.g. :ref:`(Erdmann) `. -For keyword *quat*, :math:`e_i` points in the direction of the unit -vector defined by its arguments *sx*, *sy*, and *sz*, which are -themselves defined within the coordinate frame of the atom's +For mode *quat*, :math:`e_i` points in the direction of a unit +vector, oriented in the coordinate frame of the ellipsoidal particles, +which defaults to point along the x-direction. This default behaviour +can be changed by via the *quatvec* keyword. + +The optional *quatvec* keyword specifies the direction of self-propulsion +via a unit vector (sx,sy,sz). The arguments *sx*, *sy*, and *sz*, are +defined within the coordinate frame of the atom's ellipsoid. For instance, for an ellipsoid with long axis along its x-direction, if one wanted the self-propulsion force to also be along this axis, set *sx* equal to 1 and *sy*, *sz* both equal -to zero. For *quat*, :math:`e_i` will always be a unit vector, -so multiplying all three arguments *sx*, *sy*, and *sz* by a -positive scalar will not change the self-propulsion force -(multiplying by a negative scalar will change the sign of the -force). +to zero. This keyword may only be specified for mode *quat*. + +.. note:: + + In using keyword *quatvec*, the three arguments *sx*, + *sy*, and *sz* will be automatically normalised to components + of a unit vector internally to avoid users having to explicitly + do so themselves. Therefore, in mode *quat*, the vectors :math:`e_i` + will always be of unit length. + Along with adding a force contribution, this fix can also contribute to the virial (pressure) of the system, defined as @@ -89,10 +96,10 @@ contribute to the virial (pressure) of the system, defined as boundary conditions. See :ref:`(Winkler) ` for a discussion of this active pressure contribution. -For keywords *dipole* and *quat*, this fix is by default +For modes *dipole* and *quat*, this fix is by default included in pressure computations. -For keyword *velocity*, this fix is by default not included +For mode *velocity*, this fix is by default not included in pressure computations. diff --git a/examples/USER/brownian/2d_velocity/in.2d_velocity b/examples/USER/brownian/2d_velocity/in.2d_velocity index b731f5f477..cbd7d543cb 100644 --- a/examples/USER/brownian/2d_velocity/in.2d_velocity +++ b/examples/USER/brownian/2d_velocity/in.2d_velocity @@ -31,7 +31,7 @@ neigh_modify every 1 delay 1 check yes pair_style none fix step all brownian ${gamma_t} ${D_t} ${seed} -fix vel all propel/self ${fp} velocity +fix vel all propel/self velocity ${fp} fix 2 all enforce2d fix_modify vel virial yes diff --git a/examples/USER/brownian/spherical_ABP/in.2d_abp b/examples/USER/brownian/spherical_ABP/in.2d_abp index d626445926..9db5a46cf6 100644 --- a/examples/USER/brownian/spherical_ABP/in.2d_abp +++ b/examples/USER/brownian/spherical_ABP/in.2d_abp @@ -41,7 +41,7 @@ pair_modify shift yes # overdamped brownian dynamics time-step fix step all brownian/sphere ${gamma_t} ${gamma_r} ${D_t} ${D_r} ${seed} dipole # self-propulsion force along the dipole direction -fix activity all propel/self ${fp} dipole +fix activity all propel/self dipole ${fp} fix 2 all enforce2d diff --git a/examples/USER/brownian/spherical_ABP/in.3d_ideal_abp b/examples/USER/brownian/spherical_ABP/in.3d_ideal_abp index e131d07059..4c3d403f20 100644 --- a/examples/USER/brownian/spherical_ABP/in.3d_ideal_abp +++ b/examples/USER/brownian/spherical_ABP/in.3d_ideal_abp @@ -30,7 +30,7 @@ pair_style none # overdamped brownian dynamics time-step fix step all brownian/sphere ${gamma_t} ${gamma_r} ${D_t} ${D_r} ${seed} dipole # self-propulsion force along the dipole direction -fix activity all propel/self ${fp} dipole +fix activity all propel/self dipole ${fp} compute press all pressure NULL virial diff --git a/examples/USER/brownian/spherical_ABP/log_WCA_1_1_1_3_4_2d.lammps.log b/examples/USER/brownian/spherical_ABP/log_WCA_1_1_1_3_4_2d.lammps.log index 0c51314cca..8f334c77fb 100644 --- a/examples/USER/brownian/spherical_ABP/log_WCA_1_1_1_3_4_2d.lammps.log +++ b/examples/USER/brownian/spherical_ABP/log_WCA_1_1_1_3_4_2d.lammps.log @@ -10,10 +10,10 @@ Lattice spacing in x,y,z = 1.5811388 1.5811388 1.5811388 region box block -16 16 -16 16 -0.2 0.2 create_box 1 box Created orthogonal box = (-25.298221 -25.298221 -0.31622777) to (25.298221 25.298221 0.31622777) - 2 by 2 by 1 MPI processor grid + 1 by 1 by 1 MPI processor grid create_atoms 1 box Created 1024 atoms - create_atoms CPU = 0.001 seconds + create_atoms CPU = 0.002 seconds mass * 1.0 set type * dipole/random ${seed} 1.0 set type * dipole/random 1974019 1.0 @@ -41,8 +41,8 @@ fix step all brownian/sphere 1 1 1 ${D_r} ${seed} dipole fix step all brownian/sphere 1 1 1 3 ${seed} dipole fix step all brownian/sphere 1 1 1 3 1974019 dipole # self-propulsion force along the dipole direction -fix activity all propel/self ${fp} dipole -fix activity all propel/self 4 dipole +fix activity all propel/self dipole ${fp} +fix activity all propel/self dipole 4 fix 2 all enforce2d @@ -66,34 +66,34 @@ Neighbor list info ... pair build: half/bin/newtoff stencil: half/bin/2d/newtoff bin: standard -Per MPI rank memory allocation (min/avg/max) = 5.052 | 5.052 | 5.052 Mbytes +Per MPI rank memory allocation (min/avg/max) = 5.066 | 5.066 | 5.066 Mbytes Step Temp E_pair c_press 0 1 0 -0.53979198 - 50000 1.0371295e+10 0 -0.542818 -Loop time of 2.25396 on 4 procs for 50000 steps with 1024 atoms + 50000 1.0902879e+10 0 -0.53710405 +Loop time of 6.3887 on 1 procs for 50000 steps with 1024 atoms -Performance: 0.192 tau/day, 22183.200 timesteps/s -99.8% CPU use with 4 MPI tasks x 1 OpenMP threads +Performance: 0.068 tau/day, 7826.319 timesteps/s +100.0% CPU use with 1 MPI tasks x 1 OpenMP threads MPI task timing breakdown: Section | min time | avg time | max time |%varavg| %total --------------------------------------------------------------- -Pair | 0.1034 | 0.10382 | 0.10438 | 0.1 | 4.61 +Pair | 0.34323 | 0.34323 | 0.34323 | 0.0 | 5.37 Neigh | 0 | 0 | 0 | 0.0 | 0.00 -Comm | 0.26698 | 0.26833 | 0.26924 | 0.2 | 11.90 -Output | 2.2284e-05 | 2.4926e-05 | 3.2332e-05 | 0.0 | 0.00 -Modify | 1.7222 | 1.7237 | 1.727 | 0.1 | 76.48 -Other | | 0.1581 | | | 7.01 +Comm | 0.070232 | 0.070232 | 0.070232 | 0.0 | 1.10 +Output | 2.5077e-05 | 2.5077e-05 | 2.5077e-05 | 0.0 | 0.00 +Modify | 5.8232 | 5.8232 | 5.8232 | 0.0 | 91.15 +Other | | 0.152 | | | 2.38 -Nlocal: 256.000 ave 256 max 256 min -Histogram: 4 0 0 0 0 0 0 0 0 0 -Nghost: 105.000 ave 105 max 105 min -Histogram: 4 0 0 0 0 0 0 0 0 0 -Neighs: 544.000 ave 544 max 544 min -Histogram: 4 0 0 0 0 0 0 0 0 0 +Nlocal: 1024.00 ave 1024 max 1024 min +Histogram: 1 0 0 0 0 0 0 0 0 0 +Nghost: 201.000 ave 201 max 201 min +Histogram: 1 0 0 0 0 0 0 0 0 0 +Neighs: 2112.00 ave 2112 max 2112 min +Histogram: 1 0 0 0 0 0 0 0 0 0 -Total # of neighbors = 2176 -Ave neighs/atom = 2.1250000 +Total # of neighbors = 2112 +Ave neighs/atom = 2.0625000 Neighbor list builds = 0 Dangerous builds = 0 reset_timestep 0 @@ -111,53 +111,53 @@ thermo 10000 # main run run 200000 -Per MPI rank memory allocation (min/avg/max) = 5.427 | 5.427 | 5.427 Mbytes +Per MPI rank memory allocation (min/avg/max) = 5.441 | 5.441 | 5.441 Mbytes Step Temp E_pair c_msd[1] c_msd[2] c_msd[3] c_msd[4] c_press - 0 1.0371295e+10 0 0 0 0 0 -0.542818 - 10000 107356.09 0.079828495 0.19584264 0.19679822 0 0.39264086 0.00078740793 - 20000 101692.44 0.11317533 0.40847364 0.42097802 0 0.82945167 0.74111888 - 30000 105763.55 0.10261852 0.68303669 0.66125751 0 1.3442942 0.71112533 - 40000 105127.29 0.12371743 0.97990144 0.94005552 0 1.919957 1.0574552 - 50000 101579.58 0.12771813 1.3059069 1.2364468 0 2.5423537 1.059263 - 60000 104914.36 0.12055843 1.6215593 1.525488 0 3.1470473 0.79873537 - 70000 106629.18 0.1278745 1.9639958 1.8682794 0 3.8322752 0.91950208 - 80000 103286.54 0.13927689 2.3201565 2.2373383 0 4.5574948 1.1875034 - 90000 106451.61 0.093479681 2.6287902 2.5753347 0 5.2041249 1.0861163 - 100000 102199.72 0.13269425 2.9127976 2.9369237 0 5.8497214 1.4841998 - 110000 105229.73 0.10594209 3.1798718 3.3495317 0 6.5294035 1.5444784 - 120000 106262.36 0.11902575 3.6267452 3.7188125 0 7.3455578 1.3366518 - 130000 109388.12 0.10562576 3.929973 4.0226942 0 7.9526672 1.324534 - 140000 107697.35 0.13028752 4.231893 4.3780995 0 8.6099925 1.7406167 - 150000 103928.72 0.12278994 4.5826286 4.7578662 0 9.3404948 1.3024003 - 160000 103370.23 0.11391216 4.8767011 5.1181189 0 9.99482 1.4325241 - 170000 103821.53 0.11163256 5.153318 5.3785963 0 10.531914 1.4569115 - 180000 106824.99 0.13225083 5.4080929 5.7399804 0 11.148073 1.334984 - 190000 101794.6 0.10632938 5.7384925 6.080955 0 11.819448 0.81285422 - 200000 102128.67 0.13703498 6.0414673 6.4511058 0 12.492573 0.42904128 -Loop time of 9.60419 on 4 procs for 200000 steps with 1024 atoms + 0 1.0902879e+10 0 0 0 0 0 -0.53710405 + 10000 103498.6 0.087662767 0.18719065 0.2007338 0 0.38792445 0.16080254 + 20000 104785.56 0.12719481 0.4197551 0.40722743 0 0.82698253 0.5007164 + 30000 103183.73 0.1126518 0.67800477 0.67921667 0 1.3572214 0.36634317 + 40000 102912.87 0.092584777 0.96234448 0.97188884 0 1.9342333 0.46170129 + 50000 103516.68 0.12761757 1.2381642 1.3203398 0 2.558504 0.85712805 + 60000 104999.77 0.14482924 1.5437166 1.6177103 0 3.1614269 1.1403162 + 70000 103925.7 0.11302021 1.886 1.9262949 0 3.8122949 1.1056086 + 80000 105000.14 0.14502228 2.205833 2.2668945 0 4.4727275 1.0757792 + 90000 105980.8 0.12089413 2.515801 2.647111 0 5.162912 1.1160525 + 100000 106557.86 0.10934038 2.7977098 2.8965145 0 5.6942242 0.56901933 + 110000 104241.46 0.12719985 3.1612652 3.2283956 0 6.3896608 0.95100999 + 120000 101910.56 0.12002691 3.5844099 3.5366227 0 7.1210326 1.2526653 + 130000 104435.28 0.10695039 3.8328815 3.8286503 0 7.6615318 1.6198184 + 140000 104864.99 0.11226471 4.1822059 4.285915 0 8.4681209 1.5190757 + 150000 103209.43 0.11229036 4.430069 4.5491143 0 8.9791833 1.1568204 + 160000 106692.61 0.11151476 4.7593714 5.0322819 0 9.7916533 1.2337266 + 170000 105232.19 0.12039818 5.0665907 5.3612901 0 10.427881 1.3881139 + 180000 107126.86 0.10793969 5.4129878 5.6391008 0 11.052089 1.6691607 + 190000 103814.36 0.096916503 5.7355093 5.9557837 0 11.691293 1.3863335 + 200000 103976.84 0.10928015 6.1871603 6.3393786 0 12.526539 1.1687077 +Loop time of 27.4513 on 1 procs for 200000 steps with 1024 atoms -Performance: 17992.140 tau/day, 20824.236 timesteps/s -100.0% CPU use with 4 MPI tasks x 1 OpenMP threads +Performance: 6294.793 tau/day, 7285.640 timesteps/s +100.0% CPU use with 1 MPI tasks x 1 OpenMP threads MPI task timing breakdown: Section | min time | avg time | max time |%varavg| %total --------------------------------------------------------------- -Pair | 0.71756 | 0.75121 | 0.79008 | 3.0 | 7.82 -Neigh | 0.018158 | 0.018773 | 0.019357 | 0.3 | 0.20 -Comm | 1.0469 | 1.0597 | 1.0738 | 1.2 | 11.03 -Output | 0.00051435 | 0.00057078 | 0.00070838 | 0.0 | 0.01 -Modify | 6.8012 | 6.9883 | 7.1513 | 4.9 | 72.76 -Other | | 0.7857 | | | 8.18 +Pair | 3.2525 | 3.2525 | 3.2525 | 0.0 | 11.85 +Neigh | 0.054678 | 0.054678 | 0.054678 | 0.0 | 0.20 +Comm | 0.26582 | 0.26582 | 0.26582 | 0.0 | 0.97 +Output | 0.0006103 | 0.0006103 | 0.0006103 | 0.0 | 0.00 +Modify | 23.265 | 23.265 | 23.265 | 0.0 | 84.75 +Other | | 0.6131 | | | 2.23 -Nlocal: 256.000 ave 265 max 240 min -Histogram: 1 0 0 0 0 0 1 0 0 2 -Nghost: 88.5000 ave 91 max 87 min -Histogram: 1 0 2 0 0 0 0 0 0 1 -Neighs: 678.500 ave 713 max 597 min -Histogram: 1 0 0 0 0 0 0 0 1 2 +Nlocal: 1024.00 ave 1024 max 1024 min +Histogram: 1 0 0 0 0 0 0 0 0 0 +Nghost: 166.000 ave 166 max 166 min +Histogram: 1 0 0 0 0 0 0 0 0 0 +Neighs: 2634.00 ave 2634 max 2634 min +Histogram: 1 0 0 0 0 0 0 0 0 0 -Total # of neighbors = 2714 -Ave neighs/atom = 2.6503906 -Neighbor list builds = 241 +Total # of neighbors = 2634 +Ave neighs/atom = 2.5722656 +Neighbor list builds = 238 Dangerous builds = 0 -Total wall time: 0:00:11 +Total wall time: 0:00:33 diff --git a/examples/USER/brownian/spherical_ABP/log_ideal_1_1_1_3_4_3d.lammps.log b/examples/USER/brownian/spherical_ABP/log_ideal_1_1_1_3_4_3d.lammps.log index be6c1d5d41..c5cbe4936d 100644 --- a/examples/USER/brownian/spherical_ABP/log_ideal_1_1_1_3_4_3d.lammps.log +++ b/examples/USER/brownian/spherical_ABP/log_ideal_1_1_1_3_4_3d.lammps.log @@ -10,10 +10,10 @@ Lattice spacing in x,y,z = 1.3572088 1.3572088 1.3572088 region box block -8 8 -8 8 -8 8 create_box 1 box Created orthogonal box = (-10.857670 -10.857670 -10.857670) to (10.857670 10.857670 10.857670) - 2 by 1 by 2 MPI processor grid + 1 by 1 by 1 MPI processor grid create_atoms 1 box Created 4096 atoms - create_atoms CPU = 0.002 seconds + create_atoms CPU = 0.003 seconds mass * 1.0 set type * dipole/random ${seed} 1.0 set type * dipole/random 1974019 1.0 @@ -31,8 +31,8 @@ fix step all brownian/sphere 1 1 1 ${D_r} ${seed} dipole fix step all brownian/sphere 1 1 1 3 ${seed} dipole fix step all brownian/sphere 1 1 1 3 1974019 dipole # self-propulsion force along the dipole direction -fix activity all propel/self ${fp} dipole -fix activity all propel/self 4 dipole +fix activity all propel/self dipole ${fp} +fix activity all propel/self dipole 4 compute press all pressure NULL virial @@ -45,31 +45,31 @@ thermo 50001 run 50000 WARNING: No pairwise cutoff or binsize set. Atom sorting therefore disabled. (src/atom.cpp:2118) WARNING: Communication cutoff is 0.0. No ghost atoms will be generated. Atoms may get lost. (src/comm_brick.cpp:167) -Per MPI rank memory allocation (min/avg/max) = 4.319 | 4.319 | 4.319 Mbytes +Per MPI rank memory allocation (min/avg/max) = 4.362 | 4.362 | 4.362 Mbytes Step Temp E_pair c_press 0 1 0 0.068021726 - 50000 1.046425e+10 0 0.067505633 -Loop time of 7.83903 on 4 procs for 50000 steps with 4096 atoms + 50000 1.0486812e+10 0 0.068203091 +Loop time of 25.3706 on 1 procs for 50000 steps with 4096 atoms -Performance: 0.055 tau/day, 6378.340 timesteps/s -97.9% CPU use with 4 MPI tasks x 1 OpenMP threads +Performance: 0.017 tau/day, 1970.786 timesteps/s +100.0% CPU use with 1 MPI tasks x 1 OpenMP threads MPI task timing breakdown: Section | min time | avg time | max time |%varavg| %total --------------------------------------------------------------- Pair | 0 | 0 | 0 | 0.0 | 0.00 Neigh | 0 | 0 | 0 | 0.0 | 0.00 -Comm | 0.50238 | 0.51891 | 0.53617 | 1.7 | 6.62 -Output | 2.6343e-05 | 3.6075e-05 | 4.6997e-05 | 0.0 | 0.00 -Modify | 6.9536 | 6.9732 | 7.0105 | 0.8 | 88.95 -Other | | 0.3469 | | | 4.43 +Comm | 0.31005 | 0.31005 | 0.31005 | 0.0 | 1.22 +Output | 3.2633e-05 | 3.2633e-05 | 3.2633e-05 | 0.0 | 0.00 +Modify | 24.471 | 24.471 | 24.471 | 0.0 | 96.45 +Other | | 0.5897 | | | 2.32 -Nlocal: 1024.00 ave 1024 max 1024 min -Histogram: 4 0 0 0 0 0 0 0 0 0 -Nghost: 353.000 ave 353 max 353 min -Histogram: 4 0 0 0 0 0 0 0 0 0 +Nlocal: 4096.00 ave 4096 max 4096 min +Histogram: 1 0 0 0 0 0 0 0 0 0 +Nghost: 817.000 ave 817 max 817 min +Histogram: 1 0 0 0 0 0 0 0 0 0 Neighs: 0.00000 ave 0 max 0 min -Histogram: 4 0 0 0 0 0 0 0 0 0 +Histogram: 1 0 0 0 0 0 0 0 0 0 Total # of neighbors = 0 Ave neighs/atom = 0.0000000 @@ -96,46 +96,46 @@ thermo 10000 # main run run 120000 WARNING: Communication cutoff is 0.0. No ghost atoms will be generated. Atoms may get lost. (src/comm_brick.cpp:167) -Per MPI rank memory allocation (min/avg/max) = 4.694 | 4.694 | 4.694 Mbytes +Per MPI rank memory allocation (min/avg/max) = 4.737 | 4.737 | 4.737 Mbytes Step Temp E_pair c_msd[1] c_msd[2] c_msd[3] c_msd[4] c_press - 0 1.046425e+10 0 0 0 0 0 0.067505633 - 10000 106340.56 0 0.2469318 0.23662295 0.2441413 0.72769605 0.19939966 - 20000 104620.27 0 0.55429324 0.5231436 0.54976641 1.6272032 0.26601423 - 30000 106130.45 0 0.87562668 0.84813496 0.89321299 2.6169746 0.30836996 - 40000 105773.31 0 1.2262635 1.1899278 1.2626926 3.6788838 0.35392219 - 50000 103804.88 0 1.5851624 1.5645815 1.6434185 4.7931624 0.33326997 - 60000 105746.45 0 1.9928016 1.9347072 1.9837329 5.9112417 0.2550878 - 70000 104500.3 0 2.3269429 2.2774077 2.3368821 6.9412326 0.25218225 - 80000 105381.46 0 2.7114959 2.6937299 2.7171132 8.122339 0.36940892 - 90000 104542.79 0 3.0828648 3.084417 3.0783207 9.2456025 0.36106481 - 100000 104246.75 0 3.4635513 3.5105066 3.4545226 10.42858 0.3712313 - 110000 103099.55 0 3.8471061 3.9389997 3.8220676 11.608173 0.38466185 - 120000 103098.45 0 4.2014598 4.3456831 4.1888659 12.736009 0.36710217 -Loop time of 22.8893 on 4 procs for 120000 steps with 4096 atoms + 0 1.0486812e+10 0 0 0 0 0 0.068203091 + 10000 104209.87 0 0.25428952 0.2512451 0.23617807 0.74171269 0.1910208 + 20000 104433.46 0 0.55611319 0.57499464 0.54362634 1.6747342 0.27977792 + 30000 104615.53 0 0.88377871 0.8933002 0.88683731 2.6639162 0.31709969 + 40000 105930.5 0 1.2301515 1.262995 1.2479624 3.7411089 0.26149988 + 50000 105556.39 0 1.5798848 1.6402779 1.6392277 4.8593905 0.34401188 + 60000 104644.58 0 1.9782384 1.9902061 2.0327974 6.0012419 0.26709167 + 70000 104314.31 0 2.3681872 2.3695505 2.4241916 7.1619294 0.24191407 + 80000 105700 0 2.7109374 2.7434271 2.8309194 8.2852839 0.28355159 + 90000 103411.61 0 3.1023448 3.0881218 3.1599155 9.350382 0.3070844 + 100000 105432.12 0 3.4853878 3.4372177 3.5153198 10.437925 0.28141015 + 110000 105723.04 0 3.8405786 3.7967805 3.8738332 11.511192 0.33248553 + 120000 104734.31 0 4.2454301 4.1714561 4.2234474 12.640334 0.3603781 +Loop time of 63.7803 on 1 procs for 120000 steps with 4096 atoms -Performance: 4529.619 tau/day, 5242.615 timesteps/s -100.0% CPU use with 4 MPI tasks x 1 OpenMP threads +Performance: 1625.581 tau/day, 1881.459 timesteps/s +100.0% CPU use with 1 MPI tasks x 1 OpenMP threads MPI task timing breakdown: Section | min time | avg time | max time |%varavg| %total --------------------------------------------------------------- Pair | 0 | 0 | 0 | 0.0 | 0.00 -Neigh | 0.0049489 | 0.0050479 | 0.0050978 | 0.1 | 0.02 -Comm | 0.082752 | 0.084491 | 0.085332 | 0.4 | 0.37 -Output | 0.00054352 | 0.0006034 | 0.00064793 | 0.0 | 0.00 -Modify | 21.069 | 21.521 | 21.964 | 7.0 | 94.02 -Other | | 1.278 | | | 5.58 +Neigh | 0.013032 | 0.013032 | 0.013032 | 0.0 | 0.02 +Comm | 0.093045 | 0.093045 | 0.093045 | 0.0 | 0.15 +Output | 0.00069845 | 0.00069845 | 0.00069845 | 0.0 | 0.00 +Modify | 62.279 | 62.279 | 62.279 | 0.0 | 97.65 +Other | | 1.394 | | | 2.19 -Nlocal: 1024.00 ave 1050 max 1010 min -Histogram: 2 0 0 1 0 0 0 0 0 1 +Nlocal: 4096.00 ave 4096 max 4096 min +Histogram: 1 0 0 0 0 0 0 0 0 0 Nghost: 0.00000 ave 0 max 0 min -Histogram: 4 0 0 0 0 0 0 0 0 0 +Histogram: 1 0 0 0 0 0 0 0 0 0 Neighs: 0.00000 ave 0 max 0 min -Histogram: 4 0 0 0 0 0 0 0 0 0 +Histogram: 1 0 0 0 0 0 0 0 0 0 Total # of neighbors = 0 Ave neighs/atom = 0.0000000 -Neighbor list builds = 2169 +Neighbor list builds = 2174 Dangerous builds = 0 # if you want to check that rotational diffusion is behaving as expected, @@ -147,4 +147,4 @@ Dangerous builds = 0 #dump_modify 1 first yes sort id #run 120000 -Total wall time: 0:00:30 +Total wall time: 0:01:29 diff --git a/src/USER-BROWNIAN/fix_propel_self.cpp b/src/USER-BROWNIAN/fix_propel_self.cpp index 1755f59840..59bb080cc5 100644 --- a/src/USER-BROWNIAN/fix_propel_self.cpp +++ b/src/USER-BROWNIAN/fix_propel_self.cpp @@ -16,8 +16,7 @@ Thanks to Liesbeth Janssen @ Eindhoven University for useful discussions! - Current maintainer: Sam Cameron @ University of Bristol - + Current maintainer: Sam Cameron @ University of Bristol ----------------------------------------------------------------------- */ #include @@ -49,44 +48,47 @@ FixPropelSelf::FixPropelSelf(LAMMPS *lmp, int narg, char **arg) : virial_flag = 1; - if (narg < 5) + if (narg != 5 && narg != 9) error->all(FLERR,"Illegal fix propel/self command"); - - magnitude = utils::numeric(FLERR,arg[3],false,lmp); - if (strcmp(arg[4],"velocity") == 0) { + if (strcmp(arg[3],"velocity") == 0) { mode = VELOCITY; thermo_virial = 0; - if (narg != 5) { - error->all(FLERR,"Illegal fix propel/self command"); - } - } else if (strcmp(arg[4],"dipole") == 0) { + } else if (strcmp(arg[3],"dipole") == 0) { mode = DIPOLE; thermo_virial = 1; - if (narg != 5) { - error->all(FLERR,"Illegal fix propel/self command"); - } - } else if (strcmp(arg[4],"quat") == 0) { + } else if (strcmp(arg[3],"quat") == 0) { mode = QUAT; thermo_virial = 1; - if (narg != 8) { - error->all(FLERR,"Illegal fix propel/self command"); - } else { - sx = utils::numeric(FLERR,arg[5],false,lmp); - sy = utils::numeric(FLERR,arg[6],false,lmp); - sz = utils::numeric(FLERR,arg[7],false,lmp); - double qnorm = sqrt(sx*sx + sy*sy + sz*sz); - sx = sx/qnorm; - sy = sy/qnorm; - sz = sz/qnorm; - } } else { error->all(FLERR,"Illegal fix propel/self command"); } + magnitude = utils::numeric(FLERR,arg[4],false,lmp); + // check for keyword + if (narg == 9) { + if (mode != QUAT) { + error->all(FLERR,"Illegal fix propel/self command"); + } + if (strcmp(arg[5],"qvector") == 0) { + sx = utils::numeric(FLERR,arg[6],false,lmp); + sy = utils::numeric(FLERR,arg[7],false,lmp); + sz = utils::numeric(FLERR,arg[8],false,lmp); + double snorm = sqrt(sx*sx + sy*sy + sz*sz); + sx = sx/snorm; + sy = sy/snorm; + sz = sz/snorm; + } else { + error->all(FLERR,"Illegal fix propel/self command"); + } + } else { + sx = 1.0; + sy = 0.0; + sz = 0.0; + } } From b88cdd6890f8b45dc7bc5fa61b569831629635ad Mon Sep 17 00:00:00 2001 From: Sam Cameron Date: Fri, 30 Apr 2021 16:30:04 +0100 Subject: [PATCH 16/22] Corrected implementation of ellipsoidal dynamics, made ashared base class for the time-integrators, templated the time-integrators (and so reversed changes that this PR had previously made to random_mars src files), combined docs of all three integrators. --- doc/src/Commands_fix.rst | 4 +- doc/src/fix.rst | 4 +- doc/src/fix_brownian.rst | 164 ++++-- doc/src/fix_brownian_asphere.rst | 150 ------ doc/src/fix_brownian_sphere.rst | 186 ------- .../{in.2d_velocity => in2d.velocity} | 9 +- .../2d_velocity/log_1_1_4_2d.lammps.log | 290 ++++++----- examples/USER/brownian/asphere/README.txt | 2 - examples/USER/brownian/asphere/in2d.ellipsoid | 72 +++ examples/USER/brownian/asphere/in3d.brownian | 63 --- examples/USER/brownian/asphere/in3d.ellipsoid | 73 +++ .../log_gaussian_1_0.33_1_3_3d.lammps.log | 141 ------ .../log_gaussian_4_1_7_13_3d.lammps.log | 153 ------ examples/USER/brownian/point/in2d.point | 62 +++ examples/USER/brownian/point/in3d.point | 61 +++ examples/USER/brownian/sphere/README.txt | 26 - examples/USER/brownian/sphere/in2d.sphere | 66 +++ .../USER/brownian/sphere/in2ddipole.brownian | 59 --- examples/USER/brownian/sphere/in3d.sphere | 65 +++ .../brownian/sphere/in3d_virial_on.brownian | 59 --- .../log_gaussian_4_1_7_13_2d.lammps.log | 260 ---------- .../log_uniform_10_1_5_15_3d.lammps.log | 249 --------- .../spherical_ABP/{in.2d_abp => in2d.abp} | 13 +- .../{in.3d_ideal_abp => in3d.ideal_abp} | 16 +- .../USER/brownian/translational/in.brownian | 65 --- .../brownian/translational/log_1_1.lammps.log | 246 --------- src/USER-BROWNIAN/fix_brownian.cpp | 199 +++----- src/USER-BROWNIAN/fix_brownian.h | 24 +- src/USER-BROWNIAN/fix_brownian_asphere.cpp | 473 ++++++++---------- src/USER-BROWNIAN/fix_brownian_asphere.h | 37 +- src/USER-BROWNIAN/fix_brownian_base.cpp | 250 +++++++++ src/USER-BROWNIAN/fix_brownian_base.h | 100 ++++ src/USER-BROWNIAN/fix_brownian_sphere.cpp | 371 ++++++-------- src/USER-BROWNIAN/fix_brownian_sphere.h | 31 +- src/random_mars.cpp | 15 - src/random_mars.h | 2 - 36 files changed, 1485 insertions(+), 2575 deletions(-) delete mode 100644 doc/src/fix_brownian_asphere.rst delete mode 100644 doc/src/fix_brownian_sphere.rst rename examples/USER/brownian/2d_velocity/{in.2d_velocity => in2d.velocity} (80%) delete mode 100644 examples/USER/brownian/asphere/README.txt create mode 100644 examples/USER/brownian/asphere/in2d.ellipsoid delete mode 100644 examples/USER/brownian/asphere/in3d.brownian create mode 100644 examples/USER/brownian/asphere/in3d.ellipsoid delete mode 100644 examples/USER/brownian/asphere/log_gaussian_1_0.33_1_3_3d.lammps.log delete mode 100644 examples/USER/brownian/asphere/log_gaussian_4_1_7_13_3d.lammps.log create mode 100644 examples/USER/brownian/point/in2d.point create mode 100644 examples/USER/brownian/point/in3d.point delete mode 100644 examples/USER/brownian/sphere/README.txt create mode 100644 examples/USER/brownian/sphere/in2d.sphere delete mode 100644 examples/USER/brownian/sphere/in2ddipole.brownian create mode 100644 examples/USER/brownian/sphere/in3d.sphere delete mode 100644 examples/USER/brownian/sphere/in3d_virial_on.brownian delete mode 100644 examples/USER/brownian/sphere/log_gaussian_4_1_7_13_2d.lammps.log delete mode 100644 examples/USER/brownian/sphere/log_uniform_10_1_5_15_3d.lammps.log rename examples/USER/brownian/spherical_ABP/{in.2d_abp => in2d.abp} (81%) rename examples/USER/brownian/spherical_ABP/{in.3d_ideal_abp => in3d.ideal_abp} (78%) delete mode 100644 examples/USER/brownian/translational/in.brownian delete mode 100644 examples/USER/brownian/translational/log_1_1.lammps.log create mode 100644 src/USER-BROWNIAN/fix_brownian_base.cpp create mode 100644 src/USER-BROWNIAN/fix_brownian_base.h diff --git a/doc/src/Commands_fix.rst b/doc/src/Commands_fix.rst index 9ee699faea..4a0b44fd90 100644 --- a/doc/src/Commands_fix.rst +++ b/doc/src/Commands_fix.rst @@ -40,8 +40,8 @@ OPT. * :doc:`aveforce ` * :doc:`balance ` * :doc:`brownian ` - * :doc:`brownian/asphere ` - * :doc:`brownian/sphere ` + * :doc:`brownian/asphere ` + * :doc:`brownian/sphere ` * :doc:`bocs ` * :doc:`bond/break ` * :doc:`bond/create ` diff --git a/doc/src/fix.rst b/doc/src/fix.rst index 373e5ac29f..69c381bfa2 100644 --- a/doc/src/fix.rst +++ b/doc/src/fix.rst @@ -183,8 +183,8 @@ accelerated styles exist. * :doc:`aveforce ` - add an averaged force to each atom * :doc:`balance ` - perform dynamic load-balancing * :doc:`brownian ` - overdamped translational brownian motion -* :doc:`brownian/asphere ` - overdamped translational and rotational brownian motion for ellipsoids -* :doc:`brownian/sphere ` - overdamped translational and rotational brownian motion for spheres +* :doc:`brownian/asphere ` - overdamped translational and rotational brownian motion for ellipsoids +* :doc:`brownian/sphere ` - overdamped translational and rotational brownian motion for spheres * :doc:`bocs ` - NPT style time integration with pressure correction * :doc:`bond/break ` - break bonds on the fly * :doc:`bond/create ` - create bonds on the fly diff --git a/doc/src/fix_brownian.rst b/doc/src/fix_brownian.rst index e3f3a2679f..7a82c2ffea 100644 --- a/doc/src/fix_brownian.rst +++ b/doc/src/fix_brownian.rst @@ -1,21 +1,30 @@ .. index:: fix brownian +.. index:: fix brownian/sphere +.. index:: fix brownian/asphere fix brownian command -==================== +=========================== + +fix brownian/sphere command +=========================== + +fix brownian/sphere command +=========================== + Syntax """""" .. parsed-literal:: - fix ID group-ID brownian gamma_t diff_t seed keyword args + fix ID group-ID style_name temp seed keyword args * ID, group-ID are documented in :doc:`fix ` command -* brownian/sphere = style name of this fix command -* gamma_t = translational friction coefficient -* diff_t = translational diffusion coefficient -* zero or more keyword/value pairs may be appended -* keyword = *rng* +* style_name = *brownian* or *brownian/sphere* or *brownian/asphere* +* temp = temperature +* seed = random number generator seed +* one or more keyword/value pairs may be appended +* keyword = *rng* or *dipole* or *gamma_r_eigen* or *gamma_t_eigen* or *gamma_r* or *gamma_t* .. parsed-literal:: @@ -23,39 +32,79 @@ Syntax *uniform* = use uniform random number generator *gaussian* = use gaussian random number generator *none* = turn off noise + *dipole* value = *mux* and *muy* and *muz* for *brownian/asphere* + *mux*, *muy*, and *muz* = update orientation of dipole having direction (*mux*,*muy*,*muz*) in body frame of rigid body + *gamma_r_eigen* values = *gr1* and *gr2* and *gr3* for *brownian/asphere* + *gr1*, *gr2*, and *gr3* = diagonal entries of body frame rotational friction tensor + *gamma_r* values = *gr* for *brownian/sphere* + *gr* = magnitude of the (isotropic) rotational friction tensor + *gamma_t_eigen* values = *gt1* and *gt2* and *gt3* for *brownian/asphere* + *gt1*, *gt2*, and *gt3* = diagonal entries of body frame translational friction tensor + *gamma_t* values = *gt* for *brownian* and *brownian/sphere* + *gt* = magnitude of the (isotropic) translational friction tensor + + Examples """""""" .. code-block:: LAMMPS - fix 1 all brownian 1.0 3.0 1294019 - fix 1 all brownian 1.0 3.0 19581092 rng none - fix 1 all brownian 1.0 3.0 19581092 rng uniform - fix 1 all brownian 1.0 3.0 19581092 rng gaussian + fix 1 all brownian 1.0 12908410 gamma_t 1.0 + fix 1 all brownian 1.0 12908410 gamma_t 3.0 rng gaussian + fix 1 all brownian/sphere 1.0 1294019 gamma_t 3.0 gamma_r 1.0 + fix 1 all brownian/sphere 1.0 19581092 gamma_t 1.0 gamma_r 0.3 rng none + fix 1 all brownian/asphere 1.0 1294019 gamma_t_eigen 1.0 2.0 3.0 gamma_r_eigen 4.0 7.0 8.0 rng gaussian + fix 1 all brownian/asphere 1.0 1294019 gamma_t_eigen 1.0 2.0 3.0 gamma_r_eigen 4.0 7.0 8.0 dipole 1.0 0.0 0.0 Description """"""""""" -Perform Brownian Dynamics integration to update position and velocity -of atoms in the group each timestep. Brownian Dynamics uses Newton's laws of +Perform Brownian Dynamics integration to update position, velocity, +dipole orientation (for spheres) and quaternion orientation (for ellipsoids, +with optional dipole update as well) in the group each timestep. +Brownian Dynamics uses Newton's laws of motion in the limit that inertial forces are negligible compared to -viscous forces. The stochastic equation of motion is +viscous forces. The stochastic equation of motion for the centre of mass +positions are .. math:: - dr = \frac{F}{\gamma_t}dt+\sqrt{2D_t}dW_t, \\ + d\mathbf{r} = \mathbf{\gamma}_t^{-1}\mathbf{F}dt+\sqrt{2k_BT}\mathbf{\gamma}_t^{-1/2}d\mathbf{W}_t, -where :math:`dW_t` is a Wiener processes (see e.g. :ref:`(Gardiner) `). +in the lab-frame (i.e. :math:`\mathbf{\gamma}_t` is not diagonal, but only depends on +orientation and so the noise is still additive). + +The rotational motion for the spherical and ellipsoidal particles is not as simple an +expression, but is chosen to replicate the Boltzmann distribution for the case of +conservative torques (see :ref:`(Ilie) ` or :ref:`(Delong) `). + +For the style *brownian*, only the positions of the particles are updated. This is +therefore suitable for point particle simulations. + +For the style *brownian/sphere*, the positions of the particles are updated, and a dipole +slaved to the spherical orientation is also updated. This style therefore requires the +hybrid atom style :doc:`atom_style dipole ` and +:doc:`atom_style sphere `. + +For the style *brownian/asphere*, the centre of mass positions and the quaternions of +ellipsoidal particles are updated. This fix style is suitable for equations of motion +where the rotational and translational friction tensors are diagonalisable in a certain +(body) reference frame. + + +--------- .. note:: - This integrator is designed for generic non-equilibrium - simulations with additive noise. There are two important cases which - (conceptually) reduce the number of free parameters in this fix. - (a) In equilibrium simulations - (where fluctuation dissipation theorems are obeyed), one can define - the thermal energy :math:`k_bT=D_t\gamma_t`. + This integrator does not by default assume a relationship between the + rotational and translational friction tensors, though such a relationship + should exist in the case of no-slip boundary conditions between the particles and + the surrounding (implicit) solvent. E.g. in the case of spherical particles, + the condition :math:`\gamma_t=3\gamma_r/\sigma^2` must be explicitly + accounted for by setting *gamma_t* to 3x and *gamma_r* to x (where + :math:`\sigma` is the spherical diameter). A similar (though more complex) + relationship holds for ellipsoids and rod-like particles. --------- @@ -63,38 +112,52 @@ where :math:`dW_t` is a Wiener processes (see e.g. :ref:`(Gardiner) Temperature computation using the :doc:`compute temp ` will not correctly compute temperature of these overdamped dynamics since we are explicitly neglecting inertial effects. - See e.g. chapter 6 of :ref:`(Doi) ` for more details on this. - Temperature is instead defined in terms of the note above (for - equilibrium systems). + Furthermore, this time integrator does not add the stochastic terms or + viscous terms to the force and/or torques. Rather, they are just added + in to the equations of motion to update the degrees of freedom. --------- -.. note:: - The diffusion coefficient :math:`D_t` is measured - in units of (length*length)/time, where time and length - are in the units specified on the :doc:`units ` page. - Similarly, :math:`\gamma_t` is measured in - units of mass/time. - ---------- If the *rng* keyword is used with the *uniform* value, then the noise is generated from a uniform distribution (see -:ref:`(Dunweg) ` for why this works). This is the same method +:ref:`(Dunweg) ` for why this works). This is the same method of noise generation as used in :doc:`fix_langevin `. If the *rng* keyword is used with the *gaussian* value, then the noise is generated from a gaussian distribution. Typically this added complexity is unnecessary, and one should be fine using the *uniform* -value for reasons argued in :ref:`(Dunweg) `. +value for reasons argued in :ref:`(Dunweg) `. If the *rng* keyword is used with the *none* value, then the noise terms are set to zero. +The *gamma_t* keyword sets the (isotropic) translational viscous damping. +Required for (and only compatible with) *brownian* and *brownian/sphere*. +The units of *gamma_t* are mass/time. + +The *gamma_r* keyword sets the (isotropic) rotational viscous damping. +Required for (and only compatible with) *brownian/sphere*. +The units of *gamma_r* are mass*length**2/time. + +The *gamma_r_eigen*, and *gamma_t_eigen* keywords are the eigenvalues of +the rotational and viscous damping tensors (having the same units as +their isotropic counterparts). Required for (and only compatible with) +*brownian/asphere*. For a 2D system, the first two values of *gamma_r_eigen* +must be inf (only rotation in xy plane), and the third value of *gamma_t_eigen* +must be inf (only diffusion in xy plane). + +If the *dipole* keyword is used, then the dipole moments of the particles +are updated as described above. Only compatible with *brownian/asphere* +(as *brownian/sphere* updates dipoles automatically). + ---------- -.. include:: accel_styles.rst +.. note:: + For style *brownian/asphere*, the components *gamma_t_eigen* =(x,x,x) and + *gamma_r_eigen* = (y,y,y), the dynamics will replicate those of the + *brownian/sphere* style with *gamma_t* = x and *gamma_r* = y. ---------- @@ -105,10 +168,6 @@ No information about this fix is written to :doc:`binary restart files No global or per-atom quantities are stored by this fix for access by various :doc:`output commands `. -The :doc:`fix_modify ` *virial* option is supported by this -fix to add the contribution due to the added forces on atoms to the -system's virial as part of :doc:`thermodynamic output `. -The default is *virial no*. No parameter of this fix can be used with the *start/stop* keywords of the :doc:`run ` command. This fix is not invoked during @@ -117,6 +176,13 @@ the :doc:`run ` command. This fix is not invoked during Restrictions """""""""""" +The style *brownian/sphere* fix requires that atoms store torque and angular velocity (omega) +as defined by the :doc:`atom_style sphere ` command. +The style *brownian/asphere* fix requires that atoms store torque and quaternions +as defined by the :doc:`atom_style ellipsoid ` command. +If the *dipole* keyword is used, they must also store a dipole moment +as defined by the :doc:`atom_style dipole ` command. + This fix is part of the USER-BROWNIAN package. It is only enabled if LAMMPS was built with that package. See the :doc:`Build package ` doc page for more info. @@ -125,26 +191,28 @@ doc page for more info. Related commands """""""""""""""" +:doc:`fix propel/self `, :doc:`fix langevin `, :doc:`fix nve/sphere `, -:doc:`fix brownian/sphere `, -:doc:`fix brownian/asphere ` Default """"""" -The default for *rng* is *uniform*. +The default for *rng* is *uniform*. The default for the rotational and translational friction +tensors are the identity tensor. ---------- -.. _GardinerC1: -**(Gardiner)** Gardiner, A Handbook for the Natural and Social Sciences 4th Ed. (2009). +.. _Ilie1: -.. _Doi1: +**(Ilie)** Ilie, Briels, den Otter, Journal of Chemical Physics, 142, 114103 (2015). -**(Doi)** Doi, Soft Matter Physics (2013). -.. _Dunweg6: +.. _Delong1: + +**(Delong)** Delong, Usabiaga, Donev, Journal of Chemical Physics. 143, 144107 (2015) + +.. _Dunweg7: **(Dunweg)** Dunweg and Paul, Int J of Modern Physics C, 2, 817-27 (1991). diff --git a/doc/src/fix_brownian_asphere.rst b/doc/src/fix_brownian_asphere.rst deleted file mode 100644 index c59774ca65..0000000000 --- a/doc/src/fix_brownian_asphere.rst +++ /dev/null @@ -1,150 +0,0 @@ -.. index:: fix brownian/asphere - -fix brownian/asphere command -============================ - -Syntax -"""""" - -.. parsed-literal:: - - fix ID group-ID brownian/asphere gamma_t gamma_r diff_t diff_r seed keyword args - -* ID, group-ID are documented in :doc:`fix ` command -* brownian/asphere = style name of this fix command -* gamma_t = translational friction coefficient -* gamma_r = rotational friction coefficient -* diff_t = translational diffusion coefficient -* diff_r = rotational diffusion coefficient -* zero or more keyword/value pairs may be appended -* keyword = *rng* or *dipole* - - .. parsed-literal:: - - *rng* value = *uniform* or *gaussian* or *none* - *uniform* = use uniform random number generator - *gaussian* = use gaussian random number generator - *none* = turn off noise - *dipole* value = none = update orientation of dipoles during integration - -Examples -"""""""" - -.. code-block:: LAMMPS - - fix 1 all brownian/asphere 1.0 1.0 1.0 1.0 1294019 - fix 1 all brownian/asphere 1.0 1.0 1.0 1.0 19581092 rng none dipole - fix 1 all brownian/asphere 1.0 1.0 1.0 1.0 19581092 rng uniform - fix 1 all brownian/asphere 1.0 1.0 1.0 1.0 19581092 dipole rng gaussian - - -Description -""""""""""" - -Perform Brownian Dynamics integration to update position, velocity, -angular velocity, particle orientation, and dipole moment for -finite-size elipsoidal particles in the group each timestep. -Brownian Dynamics uses Newton's laws of -motion in the limit that inertial forces are negligible compared to -viscous forces. The stochastic equations of motion are - -.. math:: - - dr = \frac{F}{\gamma_t}dt+\sqrt{2D_t}dW_t, \\ - d\Omega = \frac{T}{\gamma_r}dt + \sqrt{2D_r}dW_r, - -where :math:`d\Omega` is an infinitesimal rotation vector (see e.g. -Chapter 4 of :ref:`(Goldstein) `), :math:`dW_t` and -:math:`dW_r` are Wiener processes (see e.g. :ref:`(Gardiner) `). -The quaternions :math:`q` of the ellipsoid are updated each timestep from -the angular velocity vector. - -See :doc:`fix brownian/sphere ` for discussion on the -values of :math:`\gamma_t`, :math:`\gamma_r`, :math:`D_t`, -:math:`D_r`, and temperature when simulating equilibrium systems. - - -If the *rng* keyword is used with the *uniform* value, then the noise -is generated from a uniform distribution (see -:ref:`(Dunweg) ` for why this works). This is the same method -of noise generation as used in :doc:`fix_langevin `. - -If the *rng* keyword is used with the *gaussian* value, then the noise -is generated from a gaussian distribution. Typically this added -complexity is unnecessary, and one should be fine using the *uniform* -value for reasons argued in :ref:`(Dunweg) `. - -If the *rng* keyword is used with the *none* value, then the noise -terms are set to zero. - -If the *dipole* keyword is used, then the dipole moments of the particles -are updated by setting them along the x axis of the ellipsoidal frames of -reference. - ----------- - -.. include:: accel_styles.rst - ----------- - -Restart, fix_modify, output, run start/stop, minimize info -""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" - -No information about this fix is written to :doc:`binary restart files `. -No global or per-atom quantities are stored -by this fix for access by various :doc:`output commands `. - -The :doc:`fix_modify ` *virial* option is supported by this -fix to add the contribution due to the added forces on atoms to the -system's virial as part of :doc:`thermodynamic output `. -The default is *virial no*. - -No parameter of this fix can be used with the *start/stop* keywords of -the :doc:`run ` command. This fix is not invoked during -:doc:`energy minimization `. - - -Restrictions -"""""""""""" - -This fix requires that atoms store torque and angular velocity (omega) -as defined by the :doc:`atom_style sphere ` command, as well -as atoms which have a definite orientation as defined by the -:doc:`atom_style ellipsoid ` command. -Optionally, they can also store a dipole moment as defined by the -:doc:`atom_style dipole ` command. - -This fix is part of the USER-BROWNIAN package. It is only enabled if -LAMMPS was built with that package. See the :doc:`Build package ` -doc page for more info. - -All particles in the group must be finite-size ellipsoids. They cannot -be point particles. - -Related commands -"""""""""""""""" - -:doc:`fix brownian `, :doc:`fix brownian/sphere `, -:doc:`fix propel/self `, :doc:`fix langevin `, -:doc:`fix nve/asphere ` - -Default -""""""" - -The default for *rng* is *uniform*. - ----------- - -.. _GoldsteinCM2: - -**(Goldstein)** Goldstein, Poole, and Safko, Classical Mechanics, 3rd Ed. (2001). - -.. _GardinerC3: - -**(Gardiner)** Gardiner, A Handbook for the Natural and Social Sciences 4th Ed. (2009). - -.. _Dunweg8: - -**(Dunweg)** Dunweg and Paul, Int J of Modern Physics C, 2, 817-27 (1991). - - diff --git a/doc/src/fix_brownian_sphere.rst b/doc/src/fix_brownian_sphere.rst deleted file mode 100644 index 7e73226e08..0000000000 --- a/doc/src/fix_brownian_sphere.rst +++ /dev/null @@ -1,186 +0,0 @@ -.. index:: fix brownian/sphere - -fix brownian/sphere command -=========================== - -Syntax -"""""" - -.. parsed-literal:: - - fix ID group-ID brownian/sphere gamma_t gamma_r diff_t diff_r seed keyword args - -* ID, group-ID are documented in :doc:`fix ` command -* brownian/sphere = style name of this fix command -* gamma_t = translational friction coefficient -* gamma_r = rotational friction coefficient -* diff_t = translational diffusion coefficient -* diff_r = rotational diffusion coefficient -* zero or more keyword/value pairs may be appended -* keyword = *rng* or *dipole* - - .. parsed-literal:: - - *rng* value = *uniform* or *gaussian* or *none* - *uniform* = use uniform random number generator - *gaussian* = use gaussian random number generator - *none* = turn off noise - *dipole* value = none = update orientation of dipoles during integration - -Examples -"""""""" - -.. code-block:: LAMMPS - - fix 1 all brownian/sphere 1.0 1.0 1.0 1.0 1294019 - fix 1 all brownian/sphere 1.0 1.0 1.0 1.0 19581092 rng none dipole - fix 1 all brownian/sphere 1.0 1.0 1.0 1.0 19581092 rng uniform - fix 1 all brownian/sphere 1.0 1.0 1.0 1.0 19581092 dipole rng gaussian - - -Description -""""""""""" - -Perform Brownian Dynamics integration to update position, velocity, -angular velocity, and dipole moment for finite-size spherical particles -in the group each timestep. Brownian Dynamics uses Newton's laws of -motion in the limit that inertial forces are negligible compared to -viscous forces. The stochastic equations of motion are - -.. math:: - - dr = \frac{F}{\gamma_t}dt+\sqrt{2D_t}dW_t, \\ - d\Omega = \frac{T}{\gamma_r}dt + \sqrt{2D_r}dW_r, - -where :math:`d\Omega` is an infinitesimal rotation vector (see e.g. -Chapter 4 of :ref:`(Goldstein) `), :math:`dW_t` and -:math:`dW_r` are Wiener processes (see e.g. :ref:`(Gardiner) `). -The dipole vectors :math:`e_i` are updated using the rotation matrix - -.. math:: - - e_i(t+dt) = e^{\theta_X} e_i(t),\\ - -where :math:`\omega=d\Omega/dt` is the angular velocity, -:math:`\Delta\theta=|\omega|dt` is the rotation angle about -the :math:`\omega` axis, and -:math:`(\theta_X)_{ij}=-\epsilon_{ijk}d\Omega_k` is the -infinitesimal rotation matrix (see e.g. :ref:`(Callegari) `, -section 7.4). - -.. note:: - This integrator is designed for generic non-equilibrium - simulations with additive noise. There are two important cases which - (conceptually) reduce the number of free parameters in this fix. - (a) In equilibrium simulations - (where fluctuation dissipation theorems are obeyed), one can define - the thermal energy :math:`k_bT=D_t\gamma_t=D_r\gamma_r`. - (b) When a no-slip boundary condition is expected between the spheres and - the surrounding medium, the condition - :math:`\gamma_t=3\gamma_r/\sigma^2` must be explicitly - accounted for (e.g. by setting *gamma_t* to 3 and *gamma_r* to 1) where - :math:`sigma` is the particle diameter. - If both (a) and (b) are true, then one must ensure this explicitly via - the above relationships. - ---------- - -See note on the unphysical result of using :doc:`compute temp ` -with this fix in :doc:`fix brownian `. - ---------- - -.. note:: - The diffusion coefficient :math:`D_t` and the translational - drag coefficient :math:`\gamma_t` are discussed in - :doc:`fix brownian `. The diffusion coefficient - :math:`D_r` is measured in units of 1/time, where time is in the - units specified on the :doc:`units ` page. Similarly, - and :math:`\gamma_r` is measured in - units of mass/time and (mass*length*length)/(time). - ---------- - -If the *rng* keyword is used with the *uniform* value, then the noise -is generated from a uniform distribution (see -:ref:`(Dunweg) ` for why this works). This is the same method -of noise generation as used in :doc:`fix_langevin `. - -If the *rng* keyword is used with the *gaussian* value, then the noise -is generated from a gaussian distribution. Typically this added -complexity is unnecessary, and one should be fine using the *uniform* -value for reasons argued in :ref:`(Dunweg) `. - -If the *rng* keyword is used with the *none* value, then the noise -terms are set to zero. - -If the *dipole* keyword is used, then the dipole moments of the particles -are updated as described above. - ----------- - -.. include:: accel_styles.rst - ----------- - -Restart, fix_modify, output, run start/stop, minimize info -""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" - -No information about this fix is written to :doc:`binary restart files `. -No global or per-atom quantities are stored -by this fix for access by various :doc:`output commands `. - -The :doc:`fix_modify ` *virial* option is supported by this -fix to add the contribution due to the added forces on atoms to the -system's virial as part of :doc:`thermodynamic output `. -The default is *virial no*. - -No parameter of this fix can be used with the *start/stop* keywords of -the :doc:`run ` command. This fix is not invoked during -:doc:`energy minimization `. - -Restrictions -"""""""""""" - -This fix requires that atoms store torque and angular velocity (omega) -as defined by the :doc:`atom_style sphere ` command. -If the *dipole* keyword is used, they must also store a dipole moment -as defined by the :doc:`atom_style dipole ` command. - -This fix is part of the USER-BROWNIAN package. It is only enabled if -LAMMPS was built with that package. See the :doc:`Build package ` -doc page for more info. - - -Related commands -"""""""""""""""" - -:doc:`fix brownian `, :doc:`fix brownian/asphere `, -:doc:`fix propel/self `, -:doc:`fix langevin `, :doc:`fix nve/sphere `, - -Default -""""""" - -The default for *rng* is *uniform*. - ----------- - -.. _GoldsteinCM1: - -**(Goldstein)** Goldstein, Poole, and Safko, Classical Mechanics, 3rd Ed. (2001). - -.. _GardinerC2: - -**(Gardiner)** Gardiner, A Handbook for the Natural and Social Sciences 4th Ed. (2009). - -.. _Callegari1: - -**(Callegari)** Callegari and Volpe, *Numerical Simulations of Active Brownian -Particles*, Flowing Matter, 211-238 (2019). - -.. _Dunweg7: - -**(Dunweg)** Dunweg and Paul, Int J of Modern Physics C, 2, 817-27 (1991). - - diff --git a/examples/USER/brownian/2d_velocity/in.2d_velocity b/examples/USER/brownian/2d_velocity/in2d.velocity similarity index 80% rename from examples/USER/brownian/2d_velocity/in.2d_velocity rename to examples/USER/brownian/2d_velocity/in2d.velocity index cbd7d543cb..454396b959 100644 --- a/examples/USER/brownian/2d_velocity/in.2d_velocity +++ b/examples/USER/brownian/2d_velocity/in2d.velocity @@ -1,12 +1,11 @@ -# 2d overdamped brownian dynamics with self-propulsion -# force in direction of velocity. +##### 2d overdamped brownian dynamics with self-propulsion force in direction of velocity. ##### variable gamma_t equal 1.0 -variable D_t equal 1.0 +variable temp equal 1.0 variable seed equal 1974019 variable fp equal 4.0 -variable params string ${gamma_t}_${D_t}_${fp} +variable params string ${gamma_t}_${temp}_${fp} log log_${params}_2d.lammps.log @@ -30,7 +29,7 @@ neigh_modify every 1 delay 1 check yes pair_style none -fix step all brownian ${gamma_t} ${D_t} ${seed} +fix step all brownian ${temp} ${seed} gamma_t ${gamma_t} fix vel all propel/self velocity ${fp} fix 2 all enforce2d fix_modify vel virial yes diff --git a/examples/USER/brownian/2d_velocity/log_1_1_4_2d.lammps.log b/examples/USER/brownian/2d_velocity/log_1_1_4_2d.lammps.log index f6b234e9ee..655b04f665 100644 --- a/examples/USER/brownian/2d_velocity/log_1_1_4_2d.lammps.log +++ b/examples/USER/brownian/2d_velocity/log_1_1_4_2d.lammps.log @@ -23,16 +23,12 @@ neigh_modify every 1 delay 1 check yes pair_style none - - -#compute d all property/atom mux muy muz - -fix step all brownian ${gamma_t} ${D_t} ${seed} -fix step all brownian 1 ${D_t} ${seed} -fix step all brownian 1 1 ${seed} -fix step all brownian 1 1 1974019 -fix vel all propel/self ${fp} velocity -fix vel all propel/self 4 velocity +fix step all brownian ${temp} ${seed} gamma_t ${gamma_t} +fix step all brownian 1 ${seed} gamma_t ${gamma_t} +fix step all brownian 1 1974019 gamma_t ${gamma_t} +fix step all brownian 1 1974019 gamma_t 1 +fix vel all propel/self velocity ${fp} +fix vel all propel/self velocity 4 fix 2 all enforce2d fix_modify vel virial yes @@ -49,10 +45,10 @@ WARNING: Communication cutoff is 0.0. No ghost atoms will be generated. Atoms ma Per MPI rank memory allocation (min/avg/max) = 2.289 | 2.289 | 2.289 Mbytes Step Temp E_pair c_press 0 1 0 -0.18336111 - 50000 1.9663098e+10 0 -0.75033044 -Loop time of 2.45902 on 1 procs for 50000 steps with 1024 atoms + 50000 2.0329082e+10 0 -0.30450754 +Loop time of 1.76045 on 1 procs for 50000 steps with 1024 atoms -Performance: 0.176 tau/day, 20333.276 timesteps/s +Performance: 0.245 tau/day, 28401.873 timesteps/s 100.0% CPU use with 1 MPI tasks x 1 OpenMP threads MPI task timing breakdown: @@ -60,10 +56,10 @@ Section | min time | avg time | max time |%varavg| %total --------------------------------------------------------------- Pair | 0 | 0 | 0 | 0.0 | 0.00 Neigh | 0 | 0 | 0 | 0.0 | 0.00 -Comm | 0.0078395 | 0.0078395 | 0.0078395 | 0.0 | 0.32 -Output | 2.2947e-05 | 2.2947e-05 | 2.2947e-05 | 0.0 | 0.00 -Modify | 2.332 | 2.332 | 2.332 | 0.0 | 94.83 -Other | | 0.1192 | | | 4.85 +Comm | 0.008736 | 0.008736 | 0.008736 | 0.0 | 0.50 +Output | 2.3562e-05 | 2.3562e-05 | 2.3562e-05 | 0.0 | 0.00 +Modify | 1.6284 | 1.6284 | 1.6284 | 0.0 | 92.50 +Other | | 0.1233 | | | 7.00 Nlocal: 1024.00 ave 1024 max 1024 min Histogram: 1 0 0 0 0 0 0 0 0 0 @@ -96,141 +92,141 @@ run 120000 WARNING: Communication cutoff is 0.0. No ghost atoms will be generated. Atoms may get lost. (src/comm_brick.cpp:167) Per MPI rank memory allocation (min/avg/max) = 2.664 | 2.664 | 2.664 Mbytes Step Temp E_pair c_msd[1] c_msd[2] c_msd[3] c_msd[4] c_press - 0 1.9663098e+10 0 0 0 0 0 -0.75033044 - 1000 199346.07 0 0.01933096 0.020555579 0 0.039886539 -0.45701943 - 2000 198310 0 0.040165459 0.041283119 0 0.081448577 0.34264096 - 3000 204115.93 0 0.057654441 0.060411193 0 0.11806563 -0.41710363 - 4000 196903.18 0 0.075874071 0.08470884 0 0.16058291 -0.18627889 - 5000 201382.13 0 0.097484871 0.1049401 0 0.20242497 -0.12876225 - 6000 195317.96 0 0.11872475 0.12469358 0 0.24341834 -0.3084651 - 7000 192139.34 0 0.14148561 0.14363452 0 0.28512013 0.0032867364 - 8000 201737.84 0 0.16055109 0.16405717 0 0.32460826 0.36435453 - 9000 199390.58 0 0.17897382 0.18795928 0 0.3669331 0.025659298 - 10000 207807.41 0 0.19680417 0.20733821 0 0.40414239 -0.35368379 - 11000 201936.29 0 0.21666426 0.22702132 0 0.44368558 0.044253449 - 12000 196863.68 0 0.2394452 0.24672678 0 0.48617198 0.059027892 - 13000 199368.34 0 0.26647368 0.2700584 0 0.53653208 0.27090461 - 14000 201246.39 0 0.28799289 0.29823282 0 0.58622571 0.59883778 - 15000 195355.47 0 0.29975278 0.32348787 0 0.62324065 -0.70763643 - 16000 198372.41 0 0.32191014 0.34434864 0 0.66625878 -0.36543908 - 17000 193442.08 0 0.33927003 0.36811239 0 0.70738242 0.28541473 - 18000 197441 0 0.36067818 0.38982011 0 0.75049829 -0.45670227 - 19000 208769.5 0 0.37965583 0.41015661 0 0.78981244 -0.47803396 - 20000 198311.2 0 0.3968078 0.42701175 0 0.82381955 -0.18642397 - 21000 201365.22 0 0.4151043 0.44909345 0 0.86419775 0.86839756 - 22000 198253.24 0 0.4396583 0.46388261 0 0.90354091 -0.19592545 - 23000 204598.51 0 0.45382292 0.49253671 0 0.94635963 -0.24169987 - 24000 211421.88 0 0.46086338 0.51831304 0 0.97917642 0.49751915 - 25000 198690.71 0 0.47110913 0.53640271 0 1.0075118 -0.24475563 - 26000 203981.49 0 0.49265476 0.55310571 0 1.0457605 0.20237224 - 27000 201128.99 0 0.52865208 0.57516064 0 1.1038127 -0.40826104 - 28000 198529.77 0 0.54479087 0.59876678 0 1.1435576 0.41576857 - 29000 205024.27 0 0.56195744 0.61217109 0 1.1741285 -0.79146635 - 30000 201565.62 0 0.58276132 0.63743585 0 1.2201972 -0.065832917 - 31000 197893.43 0 0.61132665 0.66126375 0 1.2725904 0.47907079 - 32000 201395.11 0 0.61904956 0.67520462 0 1.2942542 -0.7408472 - 33000 202064.22 0 0.64760511 0.69087605 0 1.3384812 -0.14601514 - 34000 191227.75 0 0.65698736 0.73857849 0 1.3955659 0.2177548 - 35000 199474.65 0 0.66491543 0.76604575 0 1.4309612 -0.64627039 - 36000 195252.77 0 0.67565581 0.79911139 0 1.4747672 0.0293298 - 37000 198167.14 0 0.68899202 0.81268008 0 1.5016721 -0.0055245918 - 38000 202995.35 0 0.70224976 0.82436547 0 1.5266152 -0.2826768 - 39000 197129.03 0 0.71270072 0.8579444 0 1.5706451 0.063623666 - 40000 199153.69 0 0.73777312 0.88820969 0 1.6259828 -0.26740551 - 41000 205347.31 0 0.75613153 0.9006214 0 1.6567529 0.82415354 - 42000 199423.73 0 0.76864739 0.92457092 0 1.6932183 -0.16636304 - 43000 198052 0 0.79841199 0.93832523 0 1.7367372 -0.016241224 - 44000 205205.39 0 0.81727188 0.96823569 0 1.7855076 -0.10405924 - 45000 199116.46 0 0.83208052 0.99352694 0 1.8256075 0.040835286 - 46000 198759.48 0 0.84291542 1.0038949 0 1.8468104 0.46109436 - 47000 189676.9 0 0.86430719 1.0131299 0 1.8774371 -0.67947102 - 48000 199801.4 0 0.90662572 1.0286589 0 1.9352846 -0.5293946 - 49000 199730.89 0 0.93530132 1.0568273 0 1.9921286 -0.27562311 - 50000 203272.56 0 0.96366375 1.0790026 0 2.0426664 -0.10629234 - 51000 196992.09 0 0.97818106 1.1030549 0 2.0812359 0.31719382 - 52000 204063.62 0 1.0068773 1.1239506 0 2.130828 -7.1998264e-05 - 53000 204349.41 0 1.0277098 1.1546477 0 2.1823575 0.16897786 - 54000 203207.3 0 1.0415673 1.1881409 0 2.2297082 -0.25033492 - 55000 194841.07 0 1.0600954 1.2179033 0 2.2779987 0.0062433629 - 56000 198601.58 0 1.071562 1.2363958 0 2.3079578 -0.13124124 - 57000 196654.6 0 1.0997086 1.2486573 0 2.3483659 -0.46425912 - 58000 197781.48 0 1.112526 1.2706195 0 2.3831455 0.26007922 - 59000 199853.9 0 1.1295132 1.2978402 0 2.4273533 -0.030877018 - 60000 201698.14 0 1.1690892 1.3228782 0 2.4919675 -0.23190043 - 61000 199260.52 0 1.1870513 1.3431945 0 2.5302458 -0.040373885 - 62000 196909.15 0 1.2007194 1.3683525 0 2.5690719 0.21318495 - 63000 203927.79 0 1.2442809 1.3964232 0 2.6407041 0.10156282 - 64000 205322.27 0 1.2721207 1.4159422 0 2.6880629 0.33393307 - 65000 199142.6 0 1.2989685 1.4330729 0 2.7320414 -0.65644005 - 66000 205023.06 0 1.2948208 1.4255094 0 2.7203302 0.22290721 - 67000 209750.01 0 1.3127511 1.4369628 0 2.7497139 -0.40241279 - 68000 200205.19 0 1.3355277 1.4541568 0 2.7896846 0.6665415 - 69000 198653.01 0 1.3500764 1.4962697 0 2.8463461 -0.28396983 - 70000 207485.71 0 1.3825583 1.5095552 0 2.8921135 0.34774599 - 71000 203918.68 0 1.4090995 1.5246756 0 2.9337751 0.071958672 - 72000 199038.47 0 1.4246969 1.5612784 0 2.9859753 -0.42129173 - 73000 197380.7 0 1.445835 1.6025372 0 3.0483722 -0.099854135 - 74000 205006.49 0 1.4703253 1.606784 0 3.0771093 0.137244 - 75000 196040.42 0 1.4897388 1.6297195 0 3.1194583 -0.46715263 - 76000 200022.09 0 1.5178017 1.6560075 0 3.1738092 -0.21504553 - 77000 200766.4 0 1.5184584 1.6673791 0 3.1858374 0.54447858 - 78000 199636.76 0 1.5344452 1.6845098 0 3.2189549 0.021903761 - 79000 204188.86 0 1.5567356 1.7205197 0 3.2772553 0.15356898 - 80000 199862.31 0 1.5669731 1.7265239 0 3.2934969 -0.26342032 - 81000 198557.57 0 1.5735674 1.7468943 0 3.3204617 0.22068216 - 82000 203675.4 0 1.5898596 1.7646027 0 3.3544624 0.51221445 - 83000 203412.56 0 1.6066548 1.7813624 0 3.3880172 0.33512263 - 84000 200896.36 0 1.6112635 1.812552 0 3.4238154 1.1657793 - 85000 198987.17 0 1.652135 1.8336748 0 3.4858098 -0.20419704 - 86000 203027.04 0 1.6728041 1.864244 0 3.5370481 0.61746313 - 87000 203913.8 0 1.6783324 1.8762967 0 3.554629 0.28428076 - 88000 205061.23 0 1.6781682 1.879458 0 3.5576262 0.089285353 - 89000 198210.89 0 1.7017682 1.9029345 0 3.6047027 -0.23977904 - 90000 196170.91 0 1.7291253 1.9258436 0 3.6549689 0.15806438 - 91000 202846.79 0 1.7592339 1.9431644 0 3.7023983 0.17723099 - 92000 198976.91 0 1.762318 1.9742003 0 3.7365183 0.25668658 - 93000 194578.12 0 1.7880716 2.0009816 0 3.7890532 0.20231476 - 94000 200319.82 0 1.7854494 2.020855 0 3.8063044 0.14729427 - 95000 202430.33 0 1.7925005 2.0480213 0 3.8405218 -0.28291245 - 96000 200145.58 0 1.8113602 2.0621043 0 3.8734644 0.05547277 - 97000 194617.53 0 1.8286924 2.0729365 0 3.9016289 -0.59829377 - 98000 200829.37 0 1.8485835 2.077731 0 3.9263145 0.78242718 - 99000 198197.55 0 1.8537119 2.0873455 0 3.9410573 -0.52970118 - 100000 204149.63 0 1.8897394 2.0942927 0 3.9840321 0.58118967 - 101000 198654.59 0 1.9126448 2.1380708 0 4.0507156 -0.61766977 - 102000 201198.05 0 1.9433521 2.143049 0 4.0864011 0.15570108 - 103000 200383.43 0 1.9669578 2.1361518 0 4.1031095 -0.10556532 - 104000 204363.26 0 1.9827272 2.1564095 0 4.1391367 -0.060748593 - 105000 198267.87 0 1.9904164 2.1804141 0 4.1708305 0.40995747 - 106000 202082.12 0 1.993709 2.1925288 0 4.1862378 -0.52458386 - 107000 200209.49 0 2.015427 2.219161 0 4.234588 -0.67350679 - 108000 203112.58 0 2.0467303 2.2405372 0 4.2872675 0.25033168 - 109000 203844.13 0 2.056314 2.2623929 0 4.3187068 0.3384149 - 110000 201740.33 0 2.0706519 2.285547 0 4.3561989 0.35582365 - 111000 202493.05 0 2.0725826 2.308685 0 4.3812676 -0.26487212 - 112000 205404.09 0 2.0969613 2.3252767 0 4.422238 0.58346057 - 113000 201223.54 0 2.0876103 2.3316941 0 4.4193044 0.37747414 - 114000 208649.11 0 2.1095116 2.3488008 0 4.4583124 0.068129648 - 115000 202708.5 0 2.1233837 2.3701129 0 4.4934966 -0.23734073 - 116000 202482.42 0 2.1221907 2.4262516 0 4.5484424 -0.087142119 - 117000 200384.65 0 2.1487723 2.4619437 0 4.6107161 -0.13673271 - 118000 196885.36 0 2.158057 2.4818335 0 4.6398905 0.31912412 - 119000 194064.42 0 2.1821315 2.5032336 0 4.6853651 0.17615749 - 120000 195203.09 0 2.1939678 2.539838 0 4.7338058 0.5106086 -Loop time of 6.05038 on 1 procs for 120000 steps with 1024 atoms + 0 2.0329082e+10 0 0 0 0 0 -0.30450754 + 1000 194002.24 0 0.019541352 0.020412616 0 0.039953968 0.17960144 + 2000 201170.68 0 0.037773433 0.040755027 0 0.078528461 0.030184783 + 3000 200206.8 0 0.058949662 0.060726886 0 0.11967655 0.080592855 + 4000 205243 0 0.084357492 0.084713582 0 0.16907107 -0.9284229 + 5000 201741.41 0 0.1024163 0.10453135 0 0.20694765 0.31035655 + 6000 203143.61 0 0.12337925 0.12397645 0 0.2473557 -0.88772072 + 7000 202627.98 0 0.14537908 0.14173625 0 0.28711534 0.17510592 + 8000 200688.93 0 0.15993736 0.16450382 0 0.32444118 0.20926033 + 9000 200360.25 0 0.18277138 0.18597743 0 0.36874881 0.14728415 + 10000 203691.46 0 0.20588386 0.20467547 0 0.41055933 -0.041058877 + 11000 203028.99 0 0.2282616 0.21792715 0 0.44618875 0.14648625 + 12000 195738.49 0 0.24584925 0.22877733 0 0.47462658 0.11242329 + 13000 198977.93 0 0.26808832 0.25467835 0 0.52276667 -0.82500263 + 14000 193395.28 0 0.29074728 0.27404624 0 0.56479352 0.29664298 + 15000 200408 0 0.30241331 0.29063643 0 0.59304975 0.22506685 + 16000 194570.8 0 0.32914382 0.30896611 0 0.63810992 -0.011781021 + 17000 201699.18 0 0.34741469 0.33153019 0 0.67894488 -0.073195501 + 18000 198665.14 0 0.35708615 0.35032716 0 0.7074133 0.33684482 + 19000 201011.15 0 0.37328322 0.36518777 0 0.73847099 -0.20884796 + 20000 201387.99 0 0.39484415 0.3783921 0 0.77323625 -0.30200013 + 21000 202952.38 0 0.41838333 0.3958867 0 0.81427003 -0.98801165 + 22000 205150.98 0 0.44071908 0.42001514 0 0.86073422 -0.65548109 + 23000 200164.9 0 0.46156041 0.44411636 0 0.90567677 0.24186828 + 24000 196027.89 0 0.4834982 0.46586728 0 0.94936548 -0.43593925 + 25000 198438.08 0 0.50328321 0.4865808 0 0.98986402 -0.25516412 + 26000 200569.69 0 0.52535125 0.52102617 0 1.0463774 -0.41486705 + 27000 200598.31 0 0.52958053 0.53142647 0 1.061007 0.011109738 + 28000 205592.24 0 0.54694416 0.5464941 0 1.0934383 -0.18134038 + 29000 199085.55 0 0.57222754 0.57188852 0 1.1441161 -0.46788121 + 30000 201398.39 0 0.59813146 0.58520822 0 1.1833397 -0.15341079 + 31000 197674.44 0 0.61191002 0.60572867 0 1.2176387 0.25394145 + 32000 205188.42 0 0.63435682 0.63745001 0 1.2718068 0.26362999 + 33000 202316.72 0 0.66509392 0.65462302 0 1.3197169 -0.37062797 + 34000 200673.31 0 0.67923697 0.69170315 0 1.3709401 -0.36342828 + 35000 199626.58 0 0.71214435 0.71976006 0 1.4319044 0.14520308 + 36000 206317.51 0 0.73098443 0.75421862 0 1.4852031 -0.049274455 + 37000 200878.1 0 0.75404669 0.77976535 0 1.533812 -0.020890744 + 38000 204399.3 0 0.77905716 0.80048467 0 1.5795418 0.41855233 + 39000 194807.41 0 0.80901097 0.83413027 0 1.6431412 0.061887194 + 40000 197736.05 0 0.82530638 0.85259329 0 1.6778997 -0.21390647 + 41000 196234.62 0 0.84399769 0.87823172 0 1.7222294 -0.069449607 + 42000 202916.17 0 0.84692321 0.90553215 0 1.7524554 0.014080553 + 43000 199860.49 0 0.87526292 0.92743523 0 1.8026981 0.14037107 + 44000 195023.53 0 0.88991314 0.95932182 0 1.849235 -0.33208549 + 45000 195356.87 0 0.91402747 0.98447964 0 1.8985071 -0.54494657 + 46000 208076.31 0 0.92947502 1.0151107 0 1.9445857 -0.62483899 + 47000 196855.73 0 0.94724593 1.0592619 0 2.0065078 -0.20412571 + 48000 201398.95 0 0.98527482 1.0801565 0 2.0654313 -0.12234755 + 49000 196643.46 0 0.9999414 1.115902 0 2.1158434 -0.014252649 + 50000 195863.57 0 1.0150887 1.1141794 0 2.1292681 0.75335013 + 51000 206236.4 0 1.060301 1.1367091 0 2.1970101 -0.22091636 + 52000 202457.92 0 1.0661594 1.1431793 0 2.2093387 0.20119657 + 53000 200285.87 0 1.0911263 1.1652507 0 2.256377 0.64981185 + 54000 192647.27 0 1.1240369 1.1911613 0 2.3151982 -0.31991262 + 55000 203771.16 0 1.1340164 1.2059129 0 2.3399293 -0.69282837 + 56000 208567.7 0 1.1644643 1.2358751 0 2.4003394 -0.31413258 + 57000 197231.77 0 1.1817765 1.2580471 0 2.4398236 0.0033296714 + 58000 203466.84 0 1.2256115 1.297949 0 2.5235605 0.5978746 + 59000 204071.73 0 1.2635225 1.3217703 0 2.5852928 0.080439812 + 60000 204497.78 0 1.280816 1.3529427 0 2.6337587 -0.13596951 + 61000 201581.53 0 1.3062524 1.3840896 0 2.6903421 0.2402402 + 62000 201808.73 0 1.3158468 1.40441 0 2.7202568 -0.49735816 + 63000 195485.7 0 1.3246003 1.4115588 0 2.7361591 -0.034708225 + 64000 203289.43 0 1.3515942 1.4270935 0 2.7786877 -0.47288139 + 65000 198360.38 0 1.3655219 1.4410644 0 2.8065863 -0.60256944 + 66000 207037.46 0 1.4024293 1.447203 0 2.8496323 0.19886918 + 67000 197118.92 0 1.4400601 1.4746068 0 2.914667 0.53432407 + 68000 202323.37 0 1.4737023 1.4757925 0 2.9494948 -0.50123703 + 69000 202679.62 0 1.4996722 1.4982292 0 2.9979014 -0.36930796 + 70000 197067.46 0 1.5202881 1.5079024 0 3.0281905 0.20627183 + 71000 201481.55 0 1.5292493 1.5243374 0 3.0535868 0.1664502 + 72000 197565.37 0 1.5649605 1.5415579 0 3.1065184 0.1538837 + 73000 198996.68 0 1.5823587 1.5687541 0 3.1511128 0.33347453 + 74000 196056.36 0 1.5876207 1.5880262 0 3.1756469 0.51039007 + 75000 196383.82 0 1.6238368 1.6126393 0 3.2364761 0.58359751 + 76000 198050.9 0 1.6332373 1.6444992 0 3.2777365 -0.30732735 + 77000 198867.35 0 1.6713412 1.6649495 0 3.3362907 -0.77019295 + 78000 197809.01 0 1.7072475 1.6978103 0 3.4050578 0.062786188 + 79000 198410.74 0 1.7408508 1.7258001 0 3.4666509 0.13736398 + 80000 203417.5 0 1.757256 1.748869 0 3.506125 -0.020989175 + 81000 195062.76 0 1.7608203 1.7602204 0 3.5210407 0.013727312 + 82000 200632.52 0 1.7755665 1.7921425 0 3.567709 -0.052325244 + 83000 191576.45 0 1.7959579 1.8241176 0 3.6200755 -0.20352178 + 84000 200502.95 0 1.8249302 1.8426066 0 3.6675369 -0.38424345 + 85000 201308.33 0 1.8545228 1.8747626 0 3.7292854 0.68968471 + 86000 203836.21 0 1.8649352 1.9007982 0 3.7657335 -0.56168571 + 87000 208433.36 0 1.8740109 1.9350895 0 3.8091003 0.14026532 + 88000 198009.97 0 1.9059077 1.9537513 0 3.859659 0.017064255 + 89000 200694.98 0 1.9312351 1.9704954 0 3.9017306 -0.19090346 + 90000 200436.01 0 1.9567279 2.0115534 0 3.9682814 0.48791684 + 91000 201810.57 0 1.9784333 2.0255054 0 4.0039386 -0.21421409 + 92000 208365.35 0 2.0050623 2.049849 0 4.0549113 0.30465483 + 93000 197213.15 0 2.017481 2.0689265 0 4.0864075 0.22419309 + 94000 201428.76 0 2.0426301 2.0972527 0 4.1398828 -0.24230583 + 95000 198472.77 0 2.0677457 2.111042 0 4.1787877 0.13071029 + 96000 201070.22 0 2.1019013 2.1226741 0 4.2245754 0.15711614 + 97000 197899.22 0 2.1019041 2.1575764 0 4.2594805 -0.18586251 + 98000 196679.32 0 2.1162285 2.170629 0 4.2868575 -0.34056846 + 99000 197724.36 0 2.1326497 2.1886854 0 4.321335 0.58967646 + 100000 205354.32 0 2.1612412 2.2209085 0 4.3821498 0.044930992 + 101000 201516.54 0 2.1954542 2.2365787 0 4.4320329 0.065295032 + 102000 204976.1 0 2.2029662 2.2694803 0 4.4724465 0.11481479 + 103000 194476.8 0 2.2257884 2.2955314 0 4.5213197 -0.11610949 + 104000 203736.97 0 2.2268211 2.2907985 0 4.5176196 0.015187894 + 105000 196842.81 0 2.2620115 2.3381811 0 4.6001926 0.32154947 + 106000 202018.95 0 2.2836727 2.3560537 0 4.6397264 0.33256726 + 107000 198280.55 0 2.2802504 2.3840825 0 4.6643329 0.50865119 + 108000 198415.05 0 2.299079 2.402819 0 4.7018979 0.028090763 + 109000 214429.79 0 2.326329 2.4071902 0 4.7335192 0.33519083 + 110000 206059.4 0 2.3452258 2.431054 0 4.7762798 0.012116372 + 111000 198624.14 0 2.3484889 2.4352672 0 4.7837561 -0.35529818 + 112000 201890.76 0 2.3810208 2.4718016 0 4.8528225 -0.55980456 + 113000 199303.2 0 2.4011131 2.5070887 0 4.9082018 0.21744731 + 114000 207834.3 0 2.4341043 2.5221162 0 4.9562204 0.11696186 + 115000 202055.54 0 2.4714851 2.5576047 0 5.0290898 -0.42272945 + 116000 203298.5 0 2.5043401 2.5626771 0 5.0670173 0.17688701 + 117000 194028.49 0 2.5273873 2.5945816 0 5.1219689 -0.70088882 + 118000 201726.79 0 2.5475583 2.6532013 0 5.2007596 0.22458895 + 119000 200037.8 0 2.599892 2.6701733 0 5.2700653 0.036916228 + 120000 194969.52 0 2.623779 2.6921819 0 5.3159609 -0.6067451 +Loop time of 4.32114 on 1 procs for 120000 steps with 1024 atoms -Performance: 17136.102 tau/day, 19833.451 timesteps/s +Performance: 23993.668 tau/day, 27770.449 timesteps/s 100.0% CPU use with 1 MPI tasks x 1 OpenMP threads MPI task timing breakdown: Section | min time | avg time | max time |%varavg| %total --------------------------------------------------------------- Pair | 0 | 0 | 0 | 0.0 | 0.00 -Neigh | 0.00031301 | 0.00031301 | 0.00031301 | 0.0 | 0.01 -Comm | 0.0072472 | 0.0072472 | 0.0072472 | 0.0 | 0.12 -Output | 0.0036492 | 0.0036492 | 0.0036492 | 0.0 | 0.06 -Modify | 5.7173 | 5.7173 | 5.7173 | 0.0 | 94.50 -Other | | 0.3218 | | | 5.32 +Neigh | 0.00029646 | 0.00029646 | 0.00029646 | 0.0 | 0.01 +Comm | 0.0079174 | 0.0079174 | 0.0079174 | 0.0 | 0.18 +Output | 0.0044738 | 0.0044738 | 0.0044738 | 0.0 | 0.10 +Modify | 3.9818 | 3.9818 | 3.9818 | 0.0 | 92.15 +Other | | 0.3267 | | | 7.56 Nlocal: 1024.00 ave 1024 max 1024 min Histogram: 1 0 0 0 0 0 0 0 0 0 @@ -241,8 +237,8 @@ Histogram: 1 0 0 0 0 0 0 0 0 0 Total # of neighbors = 0 Ave neighs/atom = 0.0000000 -Neighbor list builds = 154 +Neighbor list builds = 153 Dangerous builds = 0 -Total wall time: 0:00:08 +Total wall time: 0:00:06 diff --git a/examples/USER/brownian/asphere/README.txt b/examples/USER/brownian/asphere/README.txt deleted file mode 100644 index 47e79353c6..0000000000 --- a/examples/USER/brownian/asphere/README.txt +++ /dev/null @@ -1,2 +0,0 @@ -The input file in3d.brownian demonstrates how to run a 3d simulation -of ellipsoidal particles undergoing overdamped brownian motion. diff --git a/examples/USER/brownian/asphere/in2d.ellipsoid b/examples/USER/brownian/asphere/in2d.ellipsoid new file mode 100644 index 0000000000..f36ab3b19b --- /dev/null +++ b/examples/USER/brownian/asphere/in2d.ellipsoid @@ -0,0 +1,72 @@ +##### overdamped dynamics of non-interacting ellipsoids in 2D ##### + + +variable rng string gaussian +variable seed string 198098 + + +variable temp string 1.0 + +variable gamma_r_1 string inf +variable gamma_r_2 string inf +variable gamma_r_3 string 0.1 + +variable gamma_t_1 string 5.0 +variable gamma_t_2 string 7.0 +variable gamma_t_3 string inf + +variable params string ${rng}_${temp}_${gamma_r_1}_${gamma_r_2}_${gamma_r_3}_${gamma_t_1}_${gamma_t_2}_${gamma_t_3} + + +log log_${params}_2d.lammps.log +units lj +atom_style hybrid dipole ellipsoid +dimension 2 +newton off + + +lattice sq 0.4 +region box block -30 30 -30 30 -0.2 0.2 +create_box 1 box +create_atoms 1 box +mass * 1.0 +set type * dipole/random ${seed} 1.0 +set type * shape 3.0 1.0 1.0 +set type * quat/random ${seed} +velocity all create 1.0 1 loop geom + + +neighbor 1.0 bin +neigh_modify every 1 delay 1 check yes + + + +pair_style none + + + +fix 1 all brownian/asphere ${temp} ${seed} rng ${rng} & + gamma_r_eigen ${gamma_r_1} ${gamma_r_2} ${gamma_r_3} & + gamma_t_eigen ${gamma_t_1} ${gamma_t_2} ${gamma_t_3} & + dipole 1.0 0.0 0.0 + + + +#initialisation for the main run + +# MSD +compute msd all msd + + +thermo_style custom step temp epair c_msd[*] + + +dump 1 all custom 1000 dump_${params}_2d.lammpstrj id type & + x y z xu yu zu mux muy muz fx fy fz +dump_modify 1 first yes sort id + +timestep 0.00001 +thermo 50 + +# main run +run 30000 diff --git a/examples/USER/brownian/asphere/in3d.brownian b/examples/USER/brownian/asphere/in3d.brownian deleted file mode 100644 index 19487978ce..0000000000 --- a/examples/USER/brownian/asphere/in3d.brownian +++ /dev/null @@ -1,63 +0,0 @@ -# 3d overdamped brownian dynamics for ellipsoids -# with dipole moment also being updated - -# choose variables to obey thermal equilibrium -# (fluctuation dissipation theorem) and no-slip -# boundary condition -variable rng string gaussian -variable gamma_t equal 1.0 -variable gamma_r equal 0.33 -variable D_t equal 1.0 -variable D_r equal 3.0 -variable seed equal 1974019 - -variable params string ${rng}_${gamma_t}_${gamma_r}_${D_t}_${D_r} - - -log log_${params}_3d.lammps.log -units lj -atom_style hybrid dipole sphere ellipsoid -dimension 3 -newton off - - -lattice sc 0.4 -region box block -4 4 -4 4 -4 4 -create_box 1 box -create_atoms 1 box -mass * 1.0 -set type * dipole/random ${seed} 1.0 -set type * shape 1 1 1 -set type * quat/random ${seed} -velocity all create 1.0 1 loop geom - -pair_style none - - -fix 1 all brownian/asphere ${gamma_t} ${gamma_r} ${D_t} ${D_r} & - ${seed} rng ${rng} dipole - - -compute press all pressure NULL virial - -thermo_style custom step temp epair c_press - -#equilibration -timestep 0.0000000001 -thermo 50000 -run 50000 -reset_timestep 0 - - -# MSD -compute msd all msd - - -thermo_style custom step temp epair c_msd[*] c_press - - -timestep 0.00001 -thermo 10000 - -# main run -run 120000 diff --git a/examples/USER/brownian/asphere/in3d.ellipsoid b/examples/USER/brownian/asphere/in3d.ellipsoid new file mode 100644 index 0000000000..b8aa230a61 --- /dev/null +++ b/examples/USER/brownian/asphere/in3d.ellipsoid @@ -0,0 +1,73 @@ +##### overdamped dynamics of non-interacting ellipsoids in 3D ##### + + +variable rng string uniform +variable seed string 198098 + + +variable temp string 1.0 + +variable gamma_r_1 string 2.0 +variable gamma_r_2 string 0.25 +variable gamma_r_3 string 0.1 + +variable gamma_t_1 string 5.0 +variable gamma_t_2 string 7.0 +variable gamma_t_3 string 9.0 + +variable params string ${rng}_${temp}_${gamma_r_1}_${gamma_r_2}_${gamma_r_3}_${gamma_t_1}_${gamma_t_2}_${gamma_t_3} + + +log log_${params}_3d.lammps.log +units lj +atom_style hybrid dipole ellipsoid +dimension 3 +newton off + + +lattice sc 0.4 +region box block -8 8 -8 8 -8 8 +create_box 1 box +create_atoms 1 box +mass * 1.0 +set type * dipole/random ${seed} 1.0 +set type * shape 3.0 1.0 1.0 +set type * quat/random ${seed} +velocity all create 1.0 1 loop geom + + +neighbor 1.0 bin +neigh_modify every 1 delay 1 check yes + + + +pair_style none + + + + +fix 1 all brownian/asphere ${temp} ${seed} rng ${rng} & + gamma_r_eigen ${gamma_r_1} ${gamma_r_2} ${gamma_r_3} & + gamma_t_eigen ${gamma_t_1} ${gamma_t_2} ${gamma_t_3} & + dipole 1.0 0.0 0.0 + + + +#initialisation for the main run + +# MSD +compute msd all msd + + +thermo_style custom step temp epair c_msd[*] + + +dump 1 all custom 1000 dump_${params}_3d.lammpstrj id type & + x y z xu yu zu mux muy muz fx fy fz +dump_modify 1 first yes sort id + +timestep 0.00001 +thermo 50 + +# main run +run 30000 diff --git a/examples/USER/brownian/asphere/log_gaussian_1_0.33_1_3_3d.lammps.log b/examples/USER/brownian/asphere/log_gaussian_1_0.33_1_3_3d.lammps.log deleted file mode 100644 index 2ed81ec8ba..0000000000 --- a/examples/USER/brownian/asphere/log_gaussian_1_0.33_1_3_3d.lammps.log +++ /dev/null @@ -1,141 +0,0 @@ -units lj -atom_style hybrid dipole sphere ellipsoid -WARNING: Atom_style hybrid defines both pertype and peratom masses - both must be set, only peratom masses will be used (src/atom_vec_hybrid.cpp:157) -WARNING: Peratom rmass is in multiple sub-styles - must be used consistently (src/atom_vec_hybrid.cpp:219) -dimension 3 -newton off - - -lattice sc 0.4 -Lattice spacing in x,y,z = 1.3572088 1.3572088 1.3572088 -region box block -4 4 -4 4 -4 4 -create_box 1 box -Created orthogonal box = (-5.4288352 -5.4288352 -5.4288352) to (5.4288352 5.4288352 5.4288352) - 1 by 1 by 1 MPI processor grid -create_atoms 1 box -Created 512 atoms - create_atoms CPU = 0.002 seconds -mass * 1.0 -set type * dipole/random ${seed} 1.0 -set type * dipole/random 1974019 1.0 -Setting atom values ... - 512 settings made for dipole/random -set type * shape 1 1 1 -Setting atom values ... - 512 settings made for shape -set type * quat/random ${seed} -set type * quat/random 1974019 -Setting atom values ... - 512 settings made for quat/random -velocity all create 1.0 1 loop geom - -pair_style none - - -fix 1 all brownian/asphere ${gamma_t} ${gamma_r} ${D_t} ${D_r} ${seed} rng ${rng} dipole -fix 1 all brownian/asphere 1 ${gamma_r} ${D_t} ${D_r} ${seed} rng ${rng} dipole -fix 1 all brownian/asphere 1 0.33 ${D_t} ${D_r} ${seed} rng ${rng} dipole -fix 1 all brownian/asphere 1 0.33 1 ${D_r} ${seed} rng ${rng} dipole -fix 1 all brownian/asphere 1 0.33 1 3 ${seed} rng ${rng} dipole -fix 1 all brownian/asphere 1 0.33 1 3 1974019 rng ${rng} dipole -fix 1 all brownian/asphere 1 0.33 1 3 1974019 rng gaussian dipole - - -compute press all pressure NULL virial - -thermo_style custom step temp epair c_press - -#equilibration -timestep 0.0000000001 -thermo 50000 -run 50000 -WARNING: No pairwise cutoff or binsize set. Atom sorting therefore disabled. (src/atom.cpp:2118) -WARNING: Communication cutoff is 0.0. No ghost atoms will be generated. Atoms may get lost. (src/comm_brick.cpp:167) -Per MPI rank memory allocation (min/avg/max) = 5.379 | 5.379 | 5.379 Mbytes -Step Temp E_pair c_press - 0 1 0 0 - 50000 1.9891104e+10 0 0 -Loop time of 5.53749 on 1 procs for 50000 steps with 512 atoms - -Performance: 0.078 tau/day, 9029.362 timesteps/s -100.0% CPU use with 1 MPI tasks x 1 OpenMP threads - -MPI task timing breakdown: -Section | min time | avg time | max time |%varavg| %total ---------------------------------------------------------------- -Pair | 0 | 0 | 0 | 0.0 | 0.00 -Neigh | 0 | 0 | 0 | 0.0 | 0.00 -Comm | 0.11711 | 0.11711 | 0.11711 | 0.0 | 2.11 -Output | 2.034e-05 | 2.034e-05 | 2.034e-05 | 0.0 | 0.00 -Modify | 5.3401 | 5.3401 | 5.3401 | 0.0 | 96.44 -Other | | 0.08027 | | | 1.45 - -Nlocal: 512.000 ave 512 max 512 min -Histogram: 1 0 0 0 0 0 0 0 0 0 -Nghost: 217.000 ave 217 max 217 min -Histogram: 1 0 0 0 0 0 0 0 0 0 -Neighs: 0.00000 ave 0 max 0 min -Histogram: 1 0 0 0 0 0 0 0 0 0 - -Total # of neighbors = 0 -Ave neighs/atom = 0.0000000 -Neighbor list builds = 0 -Dangerous builds = 0 -reset_timestep 0 - - -# MSD -compute msd all msd - - -thermo_style custom step temp epair c_msd[*] c_press - - -timestep 0.00001 -thermo 10000 - -# main run -run 120000 -WARNING: Communication cutoff is 0.0. No ghost atoms will be generated. Atoms may get lost. (src/comm_brick.cpp:167) -Per MPI rank memory allocation (min/avg/max) = 5.754 | 5.754 | 5.754 Mbytes -Step Temp E_pair c_msd[1] c_msd[2] c_msd[3] c_msd[4] c_press - 0 1.9891104e+10 0 0 0 0 0 0 - 10000 201972.17 0 0.19918647 0.20079752 0.20495007 0.60493407 0 - 20000 197255.49 0 0.40800225 0.37910274 0.38545643 1.1725614 0 - 30000 195533.67 0 0.60991554 0.5898132 0.56621596 1.7659447 0 - 40000 192777.99 0 0.7761198 0.86101776 0.76531344 2.402451 0 - 50000 195241.43 0 1.0053256 1.0477568 0.96681401 3.0198964 0 - 60000 201887.49 0 1.2298892 1.1979933 1.1950141 3.6228965 0 - 70000 200187.14 0 1.4407329 1.356743 1.3992739 4.1967498 0 - 80000 202737.24 0 1.6305637 1.5663775 1.5724692 4.7694104 0 - 90000 185530.51 0 1.7937597 1.7795995 1.7222809 5.2956401 0 - 100000 204405.47 0 2.0149709 1.9738573 1.9423625 5.9311907 0 - 110000 194892.4 0 2.1974948 2.1560014 2.1453303 6.4988264 0 - 120000 198462.51 0 2.3761388 2.334739 2.287964 6.9988418 0 -Loop time of 13.0463 on 1 procs for 120000 steps with 512 atoms - -Performance: 7947.110 tau/day, 9198.044 timesteps/s -100.0% CPU use with 1 MPI tasks x 1 OpenMP threads - -MPI task timing breakdown: -Section | min time | avg time | max time |%varavg| %total ---------------------------------------------------------------- -Pair | 0 | 0 | 0 | 0.0 | 0.00 -Neigh | 0.0011789 | 0.0011789 | 0.0011789 | 0.0 | 0.01 -Comm | 0.030109 | 0.030109 | 0.030109 | 0.0 | 0.23 -Output | 0.00030614 | 0.00030614 | 0.00030614 | 0.0 | 0.00 -Modify | 12.834 | 12.834 | 12.834 | 0.0 | 98.38 -Other | | 0.1803 | | | 1.38 - -Nlocal: 512.000 ave 512 max 512 min -Histogram: 1 0 0 0 0 0 0 0 0 0 -Nghost: 0.00000 ave 0 max 0 min -Histogram: 1 0 0 0 0 0 0 0 0 0 -Neighs: 0.00000 ave 0 max 0 min -Histogram: 1 0 0 0 0 0 0 0 0 0 - -Total # of neighbors = 0 -Ave neighs/atom = 0.0000000 -Neighbor list builds = 1748 -Dangerous builds = 0 -Total wall time: 0:00:18 diff --git a/examples/USER/brownian/asphere/log_gaussian_4_1_7_13_3d.lammps.log b/examples/USER/brownian/asphere/log_gaussian_4_1_7_13_3d.lammps.log deleted file mode 100644 index 21bd04f7da..0000000000 --- a/examples/USER/brownian/asphere/log_gaussian_4_1_7_13_3d.lammps.log +++ /dev/null @@ -1,153 +0,0 @@ -units lj -atom_style hybrid dipole sphere ellipsoid -WARNING: Atom_style hybrid defines both pertype and peratom masses - both must be set, only peratom masses will be used (src/atom_vec_hybrid.cpp:157) -WARNING: Peratom rmass is in multiple sub-styles - must be used consistently (src/atom_vec_hybrid.cpp:219) -dimension 3 -newton off - - -lattice sc 0.4 -Lattice spacing in x,y,z = 1.3572088 1.3572088 1.3572088 -region box block -4 4 -4 4 -4 4 -create_box 1 box -Created orthogonal box = (-5.4288352 -5.4288352 -5.4288352) to (5.4288352 5.4288352 5.4288352) - 1 by 1 by 1 MPI processor grid -create_atoms 1 box -Created 512 atoms - create_atoms CPU = 0.001 seconds -mass * 1.0 -set type * dipole/random ${seed} 1.0 -set type * dipole/random 1974019 1.0 -Setting atom values ... - 512 settings made for dipole/random -set type * shape 1 1 1 -Setting atom values ... - 512 settings made for shape -set type * quat/random ${seed} -set type * quat/random 1974019 -Setting atom values ... - 512 settings made for quat/random -velocity all create 1.0 1 loop geom - - -neighbor 1.0 bin -neigh_modify every 1 delay 1 check yes - - - -pair_style none - - -fix 1 all brownian/asphere ${gamma_t} ${gamma_r} ${D_t} ${D_r} ${seed} rng ${rng} dipole -fix 1 all brownian/asphere 4 ${gamma_r} ${D_t} ${D_r} ${seed} rng ${rng} dipole -fix 1 all brownian/asphere 4 1 ${D_t} ${D_r} ${seed} rng ${rng} dipole -fix 1 all brownian/asphere 4 1 7 ${D_r} ${seed} rng ${rng} dipole -fix 1 all brownian/asphere 4 1 7 13 ${seed} rng ${rng} dipole -fix 1 all brownian/asphere 4 1 7 13 1974019 rng ${rng} dipole -fix 1 all brownian/asphere 4 1 7 13 1974019 rng gaussian dipole - - -compute press all pressure NULL virial - -thermo_style custom step temp epair c_press - -#equilibration -timestep 0.0000000001 -thermo 50000 -run 50000 -WARNING: No pairwise cutoff or binsize set. Atom sorting therefore disabled. (src/atom.cpp:2118) -WARNING: Communication cutoff is 0.0. No ghost atoms will be generated. Atoms may get lost. (src/comm_brick.cpp:167) -Per MPI rank memory allocation (min/avg/max) = 5.379 | 5.379 | 5.379 Mbytes -Step Temp E_pair c_press - 0 1 0 0 - 50000 1.3923773e+11 0 0 -Loop time of 5.61345 on 1 procs for 50000 steps with 512 atoms - -Performance: 0.077 tau/day, 8907.171 timesteps/s -100.0% CPU use with 1 MPI tasks x 1 OpenMP threads - -MPI task timing breakdown: -Section | min time | avg time | max time |%varavg| %total ---------------------------------------------------------------- -Pair | 0 | 0 | 0 | 0.0 | 0.00 -Neigh | 0 | 0 | 0 | 0.0 | 0.00 -Comm | 0.11822 | 0.11822 | 0.11822 | 0.0 | 2.11 -Output | 2.0199e-05 | 2.0199e-05 | 2.0199e-05 | 0.0 | 0.00 -Modify | 5.4135 | 5.4135 | 5.4135 | 0.0 | 96.44 -Other | | 0.0817 | | | 1.46 - -Nlocal: 512.000 ave 512 max 512 min -Histogram: 1 0 0 0 0 0 0 0 0 0 -Nghost: 217.000 ave 217 max 217 min -Histogram: 1 0 0 0 0 0 0 0 0 0 -Neighs: 0.00000 ave 0 max 0 min -Histogram: 1 0 0 0 0 0 0 0 0 0 - -Total # of neighbors = 0 -Ave neighs/atom = 0.0000000 -Neighbor list builds = 0 -Dangerous builds = 0 -reset_timestep 0 - - -#initialisation for the main run - -# MSD -compute msd all msd - - -thermo_style custom step temp epair c_msd[*] c_press - - -# write trajectory and thermo in a log-scale frequency -#dump 1 all custom 1000 dump_${params}_3d.lammpstrj id type # x y xu yu mux muy muz fx fy fz -#dump_modify 1 first yes sort id - -timestep 0.00001 -thermo 10000 - -# main run -run 120000 -WARNING: Communication cutoff is 0.0. No ghost atoms will be generated. Atoms may get lost. (src/comm_brick.cpp:167) -Per MPI rank memory allocation (min/avg/max) = 5.754 | 5.754 | 5.754 Mbytes -Step Temp E_pair c_msd[1] c_msd[2] c_msd[3] c_msd[4] c_press - 0 1.3923773e+11 0 0 0 0 0 0 - 10000 1413805.2 0 1.3943053 1.4055827 1.4346505 4.2345385 0 - 20000 1380788.4 0 2.8560158 2.6537192 2.698195 8.2079299 0 - 30000 1368735.7 0 4.2694087 4.1286924 3.9635117 12.361613 0 - 40000 1349446 0 5.4328386 6.0271243 5.3571941 16.817157 0 - 50000 1366690 0 7.0372792 7.3342977 6.7676981 21.139275 0 - 60000 1413212.4 0 8.6092241 8.3859529 8.3650987 25.360276 0 - 70000 1401310 0 10.085131 9.4972009 9.7949174 29.377249 0 - 80000 1419160.7 0 11.413946 10.964643 11.007284 33.385873 0 - 90000 1298713.5 0 12.556318 12.457196 12.055966 37.06948 0 - 100000 1430838.3 0 14.104796 13.817001 13.596538 41.518335 0 - 110000 1364246.8 0 15.382464 15.09201 15.017312 45.491785 0 - 120000 1389237.6 0 16.632972 16.343173 16.015748 48.991892 0 -Loop time of 13.2439 on 1 procs for 120000 steps with 512 atoms - -Performance: 7828.487 tau/day, 9060.749 timesteps/s -100.0% CPU use with 1 MPI tasks x 1 OpenMP threads - -MPI task timing breakdown: -Section | min time | avg time | max time |%varavg| %total ---------------------------------------------------------------- -Pair | 0 | 0 | 0 | 0.0 | 0.00 -Neigh | 0.00075178 | 0.00075178 | 0.00075178 | 0.0 | 0.01 -Comm | 0.0282 | 0.0282 | 0.0282 | 0.0 | 0.21 -Output | 0.00032692 | 0.00032692 | 0.00032692 | 0.0 | 0.00 -Modify | 13.017 | 13.017 | 13.017 | 0.0 | 98.29 -Other | | 0.1976 | | | 1.49 - -Nlocal: 512.000 ave 512 max 512 min -Histogram: 1 0 0 0 0 0 0 0 0 0 -Nghost: 0.00000 ave 0 max 0 min -Histogram: 1 0 0 0 0 0 0 0 0 0 -Neighs: 0.00000 ave 0 max 0 min -Histogram: 1 0 0 0 0 0 0 0 0 0 - -Total # of neighbors = 0 -Ave neighs/atom = 0.0000000 -Neighbor list builds = 1110 -Dangerous builds = 0 -Total wall time: 0:00:18 diff --git a/examples/USER/brownian/point/in2d.point b/examples/USER/brownian/point/in2d.point new file mode 100644 index 0000000000..e502bc0b98 --- /dev/null +++ b/examples/USER/brownian/point/in2d.point @@ -0,0 +1,62 @@ +##### dynamics of non-interacting point particles in 2D ##### + +variable rng string gaussian +variable seed string 198098 + + +variable temp string 5.0 + +variable gamma_t string 1.0 + + + +variable params string ${rng}_${temp}_${gamma_t} + + +log log_${params}_2d.lammps.log +units lj +atom_style atomic +dimension 2 +newton off + + +lattice sq 0.4 +region box block -30 30 -30 30 -0.2 0.2 +create_box 1 box +create_atoms 1 box +mass * 1.0 +velocity all create 1.0 1 loop geom + + +neighbor 1.0 bin +neigh_modify every 1 delay 1 check yes + + + +pair_style none + + +fix 1 all brownian ${temp} ${seed} rng ${rng} & + gamma_t ${gamma_t} + + + +#initialisation for the main run + +# MSD +compute msd all msd + + +thermo_style custom step temp epair c_msd[*] + + +dump 1 all custom 1000 dump_${params}_3d.lammpstrj id type & + x y z xu yu zu fx fy fz +dump_modify 1 first yes sort id + +timestep 0.00001 +thermo 50 + +# main run +run 30000 + diff --git a/examples/USER/brownian/point/in3d.point b/examples/USER/brownian/point/in3d.point new file mode 100644 index 0000000000..b30d01e4d1 --- /dev/null +++ b/examples/USER/brownian/point/in3d.point @@ -0,0 +1,61 @@ +##### overdamped dynamics of non-interacting point particles in 3D ##### + +variable rng string gaussian +variable seed string 198098 + + +variable temp string 5.0 + +variable gamma_t string 1.0 + + + +variable params string ${rng}_${temp}_${gamma_t} + +log log_${params}_3d.lammps.log +units lj +atom_style atomic +dimension 3 +newton off + + +lattice sc 0.4 +region box block -8 8 -8 8 -8 8 +create_box 1 box +create_atoms 1 box +mass * 1.0 +velocity all create 1.0 1 loop geom + + +neighbor 1.0 bin +neigh_modify every 1 delay 1 check yes + + + +pair_style none + + +fix 1 all brownian ${temp} ${seed} rng ${rng} & + gamma_t ${gamma_t} + + + +#initialisation for the main run + +# MSD +compute msd all msd + + +thermo_style custom step temp epair c_msd[*] + + +dump 1 all custom 1000 dump_${params}_3d.lammpstrj id type & + x y z xu yu zu fx fy fz +dump_modify 1 first yes sort id + +timestep 0.00001 +thermo 50 + +# main run +run 30000 + diff --git a/examples/USER/brownian/sphere/README.txt b/examples/USER/brownian/sphere/README.txt deleted file mode 100644 index 8987a23601..0000000000 --- a/examples/USER/brownian/sphere/README.txt +++ /dev/null @@ -1,26 +0,0 @@ -The input file in2ddipole.brownian demonstrates how to run a -2d simulation of particles undergoing overdamped brownian motion -in both translational and rotational degrees of freedom. Dipole -updating is turned on, so the package DIPOLE must be built -for this example to work. - -The input file in3d_virial_on.brownian demonstrates how to run -a similar simulation but in 3d. In this case, the virial -contribution of the brownian dynamics (the sum -sum_i /(3*volume) where W is -a random variable with mean 0 and variance dt) is -calculated via the fix_modify command. For long -enough times, this will be equal to rho*D_t*gamma_t -(the ideal gas term in equilibrium systems). Note that -no dipole updating is performed. - -To confirm rotational diffusion is working correctly, -run the above simulations with dump files on and -measure \sum_i where e_i is the -dipole vector of particle i, and one should -find that this decays as an exponential with -timescale 1/((d-1)*D_r). - -Note that both of the simulations above are not long -enough to get good statistics on e.g. ideal gas -pressure, rotational diffusion, or translational diffusion. diff --git a/examples/USER/brownian/sphere/in2d.sphere b/examples/USER/brownian/sphere/in2d.sphere new file mode 100644 index 0000000000..f0d5c26262 --- /dev/null +++ b/examples/USER/brownian/sphere/in2d.sphere @@ -0,0 +1,66 @@ +##### overdamped dynamics of a sphere (with dipole attached to it) in 2D ##### + +variable rng string uniform +variable seed string 198098 + + +variable temp string 1.0 + +variable gamma_t string 5.0 + +variable gamma_r string 0.7 + + + +variable params string ${rng}_${temp}_${gamma_r}_${gamma_t} + + +log log_${params}_2d.lammps.log +units lj +atom_style hybrid dipole sphere +dimension 2 +newton off + + +lattice sq 0.4 +region box block -30 30 -30 30 -0.2 0.2 +create_box 1 box +create_atoms 1 box +mass * 1.0 +set type * dipole/random ${seed} 1.0 +velocity all create 1.0 1 loop geom + + +neighbor 1.0 bin +neigh_modify every 1 delay 1 check yes + + + +pair_style none + + + + +fix 1 all brownian/sphere ${temp} ${seed} rng ${rng} & + gamma_r ${gamma_r} gamma_t ${gamma_t} + + + +#initialisation for the main run + +# MSD +compute msd all msd + + +thermo_style custom step temp epair c_msd[*] + + +dump 1 all custom 1000 dump_${params}_2d.lammpstrj id type & + x y z xu yu zu mux muy muz fx fy fz +dump_modify 1 first yes sort id + +timestep 0.00001 +thermo 50 + +# main run +run 30000 diff --git a/examples/USER/brownian/sphere/in2ddipole.brownian b/examples/USER/brownian/sphere/in2ddipole.brownian deleted file mode 100644 index e7a8374984..0000000000 --- a/examples/USER/brownian/sphere/in2ddipole.brownian +++ /dev/null @@ -1,59 +0,0 @@ -# 2d overdamped brownian dynamics of a sphere -# with dipole also being updated - -variable rng string gaussian -variable gamma_t equal 4.0 -variable gamma_r equal 1.0 -variable D_t equal 7.0 -variable D_r equal 13.0 -variable seed equal 1974019 - - -variable params string ${rng}_${gamma_t}_${gamma_r}_${D_t}_${D_r} - - -log log_${params}_2d.lammps.log -units lj -atom_style hybrid dipole sphere -dimension 2 -newton off - - -lattice sq 0.4 -region box block -16 16 -16 16 -0.2 0.2 -create_box 1 box -create_atoms 1 box -mass * 1.0 -set type * dipole/random ${seed} 1.0 -velocity all create 1.0 1 loop geom - -pair_style none - -fix 1 all brownian/sphere ${gamma_t} ${gamma_r} ${D_t} & - ${D_r} ${seed} rng ${rng} dipole -fix 2 all enforce2d - -compute press all pressure NULL virial - -thermo_style custom step temp epair c_press - -#equilibration -timestep 0.0000000001 -thermo 50001 -run 50000 -reset_timestep 0 - -# MSD -compute msd all msd - - -thermo_style custom step temp epair c_msd[*] c_press - - -timestep 0.00001 -thermo 1000 - -# main run -run 120000 - - diff --git a/examples/USER/brownian/sphere/in3d.sphere b/examples/USER/brownian/sphere/in3d.sphere new file mode 100644 index 0000000000..06ca649c4c --- /dev/null +++ b/examples/USER/brownian/sphere/in3d.sphere @@ -0,0 +1,65 @@ +##### overdamped dynamics of a sphere (with dipole attached to it) in 3D##### + +variable rng string uniform +variable seed string 198098 + + +variable temp string 1.0 + +variable gamma_t string 5.0 + +variable gamma_r string 0.7 + + + +variable params string ${rng}_${temp}_${gamma_r}_${gamma_t} + + +log log_${params}_3d.lammps.log +units lj +atom_style hybrid dipole sphere +dimension 3 +newton off + + +lattice sc 0.4 +region box block -8 8 -8 8 -8 8 +create_box 1 box +create_atoms 1 box +mass * 1.0 +set type * dipole/random ${seed} 1.0 +velocity all create 1.0 1 loop geom + + +neighbor 1.0 bin +neigh_modify every 1 delay 1 check yes + + + +pair_style none + + + +fix 1 all brownian/sphere ${temp} ${seed} rng ${rng} & + gamma_r ${gamma_r} gamma_t ${gamma_t} + + + +#initialisation for the main run + +# MSD +compute msd all msd + + +thermo_style custom step temp epair c_msd[*] + + +dump 1 all custom 1000 dump_${params}_3d.lammpstrj id type & + x y z xu yu zu mux muy muz fx fy fz +dump_modify 1 first yes sort id + +timestep 0.00001 +thermo 50 + +# main run +run 30000 diff --git a/examples/USER/brownian/sphere/in3d_virial_on.brownian b/examples/USER/brownian/sphere/in3d_virial_on.brownian deleted file mode 100644 index 2fb08cbb17..0000000000 --- a/examples/USER/brownian/sphere/in3d_virial_on.brownian +++ /dev/null @@ -1,59 +0,0 @@ -# 3d overdamped brownian dynamics of sphere, with -# virial contribution (i.e. ideal gas pressure) -# included - - -variable rng string uniform -variable gamma_t equal 10.0 -variable gamma_r equal 1.0 -variable D_t equal 5.0 -variable D_r equal 15.0 -variable seed equal 553910 - - -variable params string ${rng}_${gamma_t}_${gamma_r}_${D_t}_${D_r} - - -log log_${params}_3d.lammps.log -units lj -atom_style sphere -dimension 3 - - -lattice sc 0.4 -region box block -8 8 -8 8 -8 8 -create_box 1 box -create_atoms 1 box -#mass * 1.0 -velocity all create 1.0 1 loop geom - -pair_style none - - -fix 1 all brownian/sphere ${gamma_t} ${gamma_r} ${D_t} & - ${D_r} ${seed} rng ${rng} -fix_modify 1 virial yes - -compute press all pressure NULL virial - -thermo_style custom step temp epair c_press - -#equilibration -timestep 0.0000000001 -thermo 50001 -run 50000 -reset_timestep 0 - -# MSD -compute msd all msd - - -thermo_style custom step temp epair c_msd[*] c_press - -timestep 0.00001 -thermo 1000 - -# main run -run 120000 - - diff --git a/examples/USER/brownian/sphere/log_gaussian_4_1_7_13_2d.lammps.log b/examples/USER/brownian/sphere/log_gaussian_4_1_7_13_2d.lammps.log deleted file mode 100644 index b10f77f0cd..0000000000 --- a/examples/USER/brownian/sphere/log_gaussian_4_1_7_13_2d.lammps.log +++ /dev/null @@ -1,260 +0,0 @@ -units lj -atom_style hybrid dipole sphere -WARNING: Atom_style hybrid defines both pertype and peratom masses - both must be set, only peratom masses will be used (src/atom_vec_hybrid.cpp:157) -dimension 2 -newton off - - -lattice sq 0.4 -Lattice spacing in x,y,z = 1.5811388 1.5811388 1.5811388 -region box block -16 16 -16 16 -0.2 0.2 -create_box 1 box -Created orthogonal box = (-25.298221 -25.298221 -0.31622777) to (25.298221 25.298221 0.31622777) - 1 by 1 by 1 MPI processor grid -create_atoms 1 box -Created 1024 atoms - create_atoms CPU = 0.002 seconds -mass * 1.0 -set type * dipole/random ${seed} 1.0 -set type * dipole/random 1974019 1.0 -Setting atom values ... - 1024 settings made for dipole/random -velocity all create 1.0 1 loop geom - - -neighbor 1.0 bin -neigh_modify every 1 delay 1 check yes - - - -pair_style none - - - -#compute d all property/atom mux muy muz - -fix 1 all brownian/sphere ${gamma_t} ${gamma_r} ${D_t} ${D_r} ${seed} rng ${rng} dipole -fix 1 all brownian/sphere 4 ${gamma_r} ${D_t} ${D_r} ${seed} rng ${rng} dipole -fix 1 all brownian/sphere 4 1 ${D_t} ${D_r} ${seed} rng ${rng} dipole -fix 1 all brownian/sphere 4 1 7 ${D_r} ${seed} rng ${rng} dipole -fix 1 all brownian/sphere 4 1 7 13 ${seed} rng ${rng} dipole -fix 1 all brownian/sphere 4 1 7 13 1974019 rng ${rng} dipole -fix 1 all brownian/sphere 4 1 7 13 1974019 rng gaussian dipole -fix 2 all enforce2d - -compute press all pressure NULL virial - -thermo_style custom step temp epair c_press - -#equilibration -timestep 0.0000000001 -thermo 50001 -run 50000 -WARNING: No pairwise cutoff or binsize set. Atom sorting therefore disabled. (src/atom.cpp:2118) -WARNING: Communication cutoff is 0.0. No ghost atoms will be generated. Atoms may get lost. (src/comm_brick.cpp:167) -Per MPI rank memory allocation (min/avg/max) = 4.289 | 4.289 | 4.289 Mbytes -Step Temp E_pair c_press - 0 1 0 0 - 50000 7.3671759e+10 0 0 -Loop time of 11.2532 on 1 procs for 50000 steps with 1024 atoms - -Performance: 0.038 tau/day, 4443.198 timesteps/s -100.0% CPU use with 1 MPI tasks x 1 OpenMP threads - -MPI task timing breakdown: -Section | min time | avg time | max time |%varavg| %total ---------------------------------------------------------------- -Pair | 0 | 0 | 0 | 0.0 | 0.00 -Neigh | 0 | 0 | 0 | 0.0 | 0.00 -Comm | 0.031456 | 0.031456 | 0.031456 | 0.0 | 0.28 -Output | 2.0958e-05 | 2.0958e-05 | 2.0958e-05 | 0.0 | 0.00 -Modify | 11.067 | 11.067 | 11.067 | 0.0 | 98.35 -Other | | 0.1546 | | | 1.37 - -Nlocal: 1024.00 ave 1024 max 1024 min -Histogram: 1 0 0 0 0 0 0 0 0 0 -Nghost: 65.0000 ave 65 max 65 min -Histogram: 1 0 0 0 0 0 0 0 0 0 -Neighs: 0.00000 ave 0 max 0 min -Histogram: 1 0 0 0 0 0 0 0 0 0 - -Total # of neighbors = 0 -Ave neighs/atom = 0.0000000 -Neighbor list builds = 0 -Dangerous builds = 0 -reset_timestep 0 - - -#initialisation for the main run - -# MSD -compute msd all msd - - -thermo_style custom step temp epair c_msd[*] c_press - - -# write trajectory and thermo in a log-scale frequency -# uncomment next three lines for dump output -dump 1 all custom 2000 dump_${params}_2d.lammpstrj id type x y xu yu mux muy muz fx fy fz -dump 1 all custom 2000 dump_gaussian_4_1_7_13_2d.lammpstrj id type x y xu yu mux muy muz fx fy fz -dump_modify 1 first yes sort id - -timestep 0.00001 -thermo 1000 - -# main run -run 120000 -WARNING: Communication cutoff is 0.0. No ghost atoms will be generated. Atoms may get lost. (src/comm_brick.cpp:167) -Per MPI rank memory allocation (min/avg/max) = 6.113 | 6.113 | 6.113 Mbytes -Step Temp E_pair c_msd[1] c_msd[2] c_msd[3] c_msd[4] c_press - 0 7.3671759e+10 0 0 0 0 0 0 - 1000 710744.42 0 0.1332856 0.13577642 0 0.26906203 0 - 2000 705025.5 0 0.27078701 0.27355073 0 0.54433774 0 - 3000 750845.29 0 0.41036556 0.39710766 0 0.80747321 0 - 4000 752542.47 0 0.53097803 0.53654063 0 1.0675187 0 - 5000 731812.26 0 0.66927129 0.65872533 0 1.3279966 0 - 6000 716119.24 0 0.79097615 0.76825364 0 1.5592298 0 - 7000 726294.28 0 0.93322099 0.91220222 0 1.8454232 0 - 8000 673771.54 0 1.0789689 1.031843 0 2.1108119 0 - 9000 757173.95 0 1.2328252 1.2024778 0 2.435303 0 - 10000 693711.95 0 1.3972184 1.3045575 0 2.7017759 0 - 11000 774897.65 0 1.584036 1.4168797 0 3.0009157 0 - 12000 764910.09 0 1.7344079 1.5751172 0 3.3095251 0 - 13000 752859.5 0 1.8538323 1.7336107 0 3.5874429 0 - 14000 746333.26 0 2.0392353 1.9027299 0 3.9419652 0 - 15000 735704.24 0 2.1714465 2.000952 0 4.1723985 0 - 16000 722768.01 0 2.258542 2.1084289 0 4.3669709 0 - 17000 741408.63 0 2.4194247 2.2469958 0 4.6664206 0 - 18000 713609.29 0 2.5366244 2.3325203 0 4.8691447 0 - 19000 770066.65 0 2.6662758 2.4726928 0 5.1389686 0 - 20000 739828.53 0 2.792873 2.6188232 0 5.4116962 0 - 21000 719478.96 0 2.9109491 2.7872008 0 5.6981499 0 - 22000 737448.77 0 3.0162218 2.9213733 0 5.9375951 0 - 23000 714695.3 0 3.1309486 3.0325142 0 6.1634628 0 - 24000 712386.78 0 3.31348 3.1323675 0 6.4458475 0 - 25000 747298.11 0 3.5148965 3.2978465 0 6.812743 0 - 26000 737240.19 0 3.7117818 3.4245004 0 7.1362822 0 - 27000 720878.36 0 3.8342853 3.5681829 0 7.4024682 0 - 28000 776824.55 0 3.9904931 3.6853691 0 7.6758622 0 - 29000 714696.4 0 4.0733919 3.8807741 0 7.954166 0 - 30000 725827.3 0 4.2213715 4.0552488 0 8.2766204 0 - 31000 737978.89 0 4.2918759 4.1795647 0 8.4714407 0 - 32000 766620.93 0 4.4620184 4.2765194 0 8.7385378 0 - 33000 714739.71 0 4.5942749 4.426881 0 9.0211559 0 - 34000 694821.06 0 4.686348 4.5057433 0 9.1920912 0 - 35000 721948.38 0 4.7526371 4.5689873 0 9.3216245 0 - 36000 713621.16 0 4.8645036 4.6355302 0 9.5000339 0 - 37000 704079.85 0 4.9652601 4.8235856 0 9.7888457 0 - 38000 706914.29 0 5.1045998 4.9585169 0 10.063117 0 - 39000 736940.33 0 5.2172626 5.1168713 0 10.334134 0 - 40000 738302.73 0 5.3720228 5.3207578 0 10.692781 0 - 41000 746518.85 0 5.5376524 5.5192708 0 11.056923 0 - 42000 719970.82 0 5.7610696 5.6335312 0 11.394601 0 - 43000 736875.87 0 5.8769052 5.7504356 0 11.627341 0 - 44000 765218.38 0 6.0308866 5.9650683 0 11.995955 0 - 45000 739382.69 0 6.1577029 6.0736304 0 12.231333 0 - 46000 730967.87 0 6.3846223 6.2090389 0 12.593661 0 - 47000 758881.95 0 6.5604053 6.3883315 0 12.948737 0 - 48000 751135.53 0 6.6160248 6.5199017 0 13.135926 0 - 49000 721058.97 0 6.6124519 6.6938253 0 13.306277 0 - 50000 686287.15 0 6.8527601 6.8518895 0 13.70465 0 - 51000 735175.7 0 6.9928329 6.8663476 0 13.85918 0 - 52000 760085.67 0 7.1009497 7.0345784 0 14.135528 0 - 53000 741211.89 0 7.2287282 7.2318431 0 14.460571 0 - 54000 723668.97 0 7.3732634 7.3847301 0 14.757994 0 - 55000 751846.88 0 7.5566634 7.4927365 0 15.0494 0 - 56000 762648.27 0 7.7651818 7.5379796 0 15.303161 0 - 57000 710175.2 0 7.9051989 7.6644542 0 15.569653 0 - 58000 740068.94 0 8.0296854 7.8307471 0 15.860433 0 - 59000 728119.43 0 8.1562433 8.039333 0 16.195576 0 - 60000 728768.48 0 8.316192 8.1643843 0 16.480576 0 - 61000 707538.83 0 8.3727565 8.3895027 0 16.762259 0 - 62000 713931.41 0 8.4657927 8.5517529 0 17.017546 0 - 63000 742604.95 0 8.6550684 8.7189851 0 17.374053 0 - 64000 738981.54 0 8.7331005 8.9208616 0 17.653962 0 - 65000 701685.87 0 8.898571 8.977933 0 17.876504 0 - 66000 716151.39 0 9.0229699 9.1292403 0 18.15221 0 - 67000 732641.29 0 9.151611 9.3249179 0 18.476529 0 - 68000 740870.85 0 9.233452 9.4667607 0 18.700213 0 - 69000 733159.17 0 9.1743719 9.5648134 0 18.739185 0 - 70000 693562.75 0 9.3414089 9.7425241 0 19.083933 0 - 71000 748694.53 0 9.5036102 9.8686571 0 19.372267 0 - 72000 721046.02 0 9.7116931 10.0195 0 19.731193 0 - 73000 736631.66 0 9.7095662 10.205306 0 19.914872 0 - 74000 751264.08 0 9.9413234 10.327844 0 20.269167 0 - 75000 729223.27 0 10.211903 10.412516 0 20.624419 0 - 76000 747811 0 10.332266 10.544251 0 20.876517 0 - 77000 717505.01 0 10.521195 10.737774 0 21.258969 0 - 78000 712288.89 0 10.712514 10.874932 0 21.587446 0 - 79000 728912.34 0 10.755227 10.968257 0 21.723484 0 - 80000 743505.67 0 11.026063 11.070234 0 22.096298 0 - 81000 732218.14 0 11.321417 11.31773 0 22.639147 0 - 82000 777186.61 0 11.480074 11.401465 0 22.881539 0 - 83000 734805.95 0 11.7524 11.62552 0 23.37792 0 - 84000 753703.38 0 11.863318 11.833925 0 23.697243 0 - 85000 755730.75 0 12.068564 11.937143 0 24.005707 0 - 86000 725021.19 0 12.258195 12.034586 0 24.292781 0 - 87000 731844.67 0 12.341844 12.331792 0 24.673636 0 - 88000 707368.15 0 12.431452 12.547314 0 24.978766 0 - 89000 784756.28 0 12.405699 12.686021 0 25.09172 0 - 90000 760278.97 0 12.542669 12.851925 0 25.394593 0 - 91000 753765.97 0 12.703534 13.08092 0 25.784454 0 - 92000 705869.22 0 12.971838 13.210092 0 26.18193 0 - 93000 741699.59 0 13.110745 13.383115 0 26.49386 0 - 94000 717372.41 0 13.252109 13.466388 0 26.718497 0 - 95000 721820.49 0 13.373146 13.660605 0 27.033751 0 - 96000 777409.97 0 13.596822 13.886961 0 27.483782 0 - 97000 741480.91 0 13.752545 14.204624 0 27.957169 0 - 98000 725755.72 0 13.918302 14.219292 0 28.137594 0 - 99000 729710.24 0 14.065417 14.213142 0 28.278559 0 - 100000 700366.74 0 14.278054 14.324135 0 28.602189 0 - 101000 722737.18 0 14.398464 14.46904 0 28.867505 0 - 102000 758930.85 0 14.408098 14.637964 0 29.046061 0 - 103000 725233.66 0 14.526482 14.719688 0 29.24617 0 - 104000 752416.52 0 14.641393 14.952087 0 29.59348 0 - 105000 769047.5 0 14.780788 15.182945 0 29.963733 0 - 106000 734849.98 0 14.840982 15.316112 0 30.157094 0 - 107000 720210.74 0 15.010029 15.372792 0 30.382821 0 - 108000 741216.55 0 15.113143 15.488575 0 30.601718 0 - 109000 714158.43 0 15.057499 15.592865 0 30.650364 0 - 110000 743262.25 0 15.381281 15.798368 0 31.179649 0 - 111000 728836.92 0 15.488226 16.034645 0 31.522871 0 - 112000 753490.67 0 15.679979 16.350819 0 32.030799 0 - 113000 730699.5 0 15.82813 16.680136 0 32.508266 0 - 114000 705526.22 0 16.099699 16.920095 0 33.019794 0 - 115000 752408.36 0 16.393466 17.053935 0 33.447401 0 - 116000 713697.16 0 16.634939 17.35349 0 33.98843 0 - 117000 690041.5 0 16.727379 17.457936 0 34.185315 0 - 118000 745594.37 0 16.838659 17.585392 0 34.424052 0 - 119000 714487.42 0 17.064214 17.743478 0 34.807692 0 - 120000 716557.14 0 17.105558 17.845925 0 34.951483 0 -Loop time of 28.1507 on 1 procs for 120000 steps with 1024 atoms - -Performance: 3683.037 tau/day, 4262.774 timesteps/s -99.9% CPU use with 1 MPI tasks x 1 OpenMP threads - -MPI task timing breakdown: -Section | min time | avg time | max time |%varavg| %total ---------------------------------------------------------------- -Pair | 0 | 0 | 0 | 0.0 | 0.00 -Neigh | 0.0016237 | 0.0016237 | 0.0016237 | 0.0 | 0.01 -Comm | 0.027064 | 0.027064 | 0.027064 | 0.0 | 0.10 -Output | 0.1712 | 0.1712 | 0.1712 | 0.0 | 0.61 -Modify | 27.545 | 27.545 | 27.545 | 0.0 | 97.85 -Other | | 0.4062 | | | 1.44 - -Nlocal: 1024.00 ave 1024 max 1024 min -Histogram: 1 0 0 0 0 0 0 0 0 0 -Nghost: 0.00000 ave 0 max 0 min -Histogram: 1 0 0 0 0 0 0 0 0 0 -Neighs: 0.00000 ave 0 max 0 min -Histogram: 1 0 0 0 0 0 0 0 0 0 - -Total # of neighbors = 0 -Ave neighs/atom = 0.0000000 -Neighbor list builds = 1049 -Dangerous builds = 0 - - -Total wall time: 0:00:39 diff --git a/examples/USER/brownian/sphere/log_uniform_10_1_5_15_3d.lammps.log b/examples/USER/brownian/sphere/log_uniform_10_1_5_15_3d.lammps.log deleted file mode 100644 index 57f90193ac..0000000000 --- a/examples/USER/brownian/sphere/log_uniform_10_1_5_15_3d.lammps.log +++ /dev/null @@ -1,249 +0,0 @@ -units lj -atom_style sphere -dimension 3 -newton off - - -lattice sc 0.4 -Lattice spacing in x,y,z = 1.3572088 1.3572088 1.3572088 -region box block -8 8 -8 8 -8 8 -create_box 1 box -Created orthogonal box = (-10.857670 -10.857670 -10.857670) to (10.857670 10.857670 10.857670) - 1 by 1 by 1 MPI processor grid -create_atoms 1 box -Created 4096 atoms - create_atoms CPU = 0.001 seconds -#mass * 1.0 -velocity all create 1.0 1 loop geom - - -neighbor 1.0 bin -neigh_modify every 1 delay 1 check yes - -pair_style none - - -fix 1 all bd/sphere ${gamma_t} ${gamma_r} ${D_t} ${D_r} ${seed} rng ${rng} -fix 1 all bd/sphere 10 ${gamma_r} ${D_t} ${D_r} ${seed} rng ${rng} -fix 1 all bd/sphere 10 1 ${D_t} ${D_r} ${seed} rng ${rng} -fix 1 all bd/sphere 10 1 5 ${D_r} ${seed} rng ${rng} -fix 1 all bd/sphere 10 1 5 15 ${seed} rng ${rng} -fix 1 all bd/sphere 10 1 5 15 553910 rng ${rng} -fix 1 all bd/sphere 10 1 5 15 553910 rng uniform -fix_modify 1 virial yes - -compute press all pressure NULL virial - -thermo_style custom step temp epair c_press - -#equilibration -timestep 0.0000000001 -thermo 50001 -run 50000 -WARNING: No pairwise cutoff or binsize set. Atom sorting therefore disabled. (src/atom.cpp:2118) -WARNING: Communication cutoff is 0.0. No ghost atoms will be generated. Atoms may get lost. (src/comm_brick.cpp:167) -Per MPI rank memory allocation (min/avg/max) = 3.581 | 3.581 | 3.581 Mbytes -Step Temp E_pair c_press - 0 1 0 -32553.271 - 50000 5.2351457e+10 0 -15026.42 -Loop time of 16.0183 on 1 procs for 50000 steps with 4096 atoms - -Performance: 0.027 tau/day, 3121.426 timesteps/s -100.0% CPU use with 1 MPI tasks x 1 OpenMP threads - -MPI task timing breakdown: -Section | min time | avg time | max time |%varavg| %total ---------------------------------------------------------------- -Pair | 0 | 0 | 0 | 0.0 | 0.00 -Neigh | 0 | 0 | 0 | 0.0 | 0.00 -Comm | 0.074984 | 0.074984 | 0.074984 | 0.0 | 0.47 -Output | 3.0041e-05 | 3.0041e-05 | 3.0041e-05 | 0.0 | 0.00 -Modify | 15.366 | 15.366 | 15.366 | 0.0 | 95.93 -Other | | 0.5772 | | | 3.60 - -Nlocal: 4096.00 ave 4096 max 4096 min -Histogram: 1 0 0 0 0 0 0 0 0 0 -Nghost: 817.000 ave 817 max 817 min -Histogram: 1 0 0 0 0 0 0 0 0 0 -Neighs: 0.00000 ave 0 max 0 min -Histogram: 1 0 0 0 0 0 0 0 0 0 - -Total # of neighbors = 0 -Ave neighs/atom = 0.0000000 -Neighbor list builds = 0 -Dangerous builds = 0 -reset_timestep 0 - - -#initialisation for the main run - -# MSD -compute msd all msd - - -thermo_style custom step temp epair c_msd[*] c_press - - -# write trajectory and thermo in a log-scale frequency -# uncomment the next three lines for dump file -#dump 1 all custom 10000 dump_${params}_3d.lammpstrj id type # x y xu yu fx fy fz -#dump_modify 1 first yes sort id - -timestep 0.00001 -thermo 1000 - -# main run -run 120000 -WARNING: Communication cutoff is 0.0. No ghost atoms will be generated. Atoms may get lost. (src/comm_brick.cpp:167) -Per MPI rank memory allocation (min/avg/max) = 3.956 | 3.956 | 3.956 Mbytes -Step Temp E_pair c_msd[1] c_msd[2] c_msd[3] c_msd[4] c_press - 0 5.2351457e+10 0 0 0 0 0 -233.83012 - 1000 522590.88 0 0.10259269 0.10487519 0.10391005 0.31137793 -13.730626 - 2000 521776.08 0 0.20662097 0.2118237 0.20371673 0.62216139 -141.90848 - 3000 529408.9 0 0.30711557 0.3105565 0.30293728 0.92060935 28.335187 - 4000 518069.42 0 0.39918073 0.40643835 0.40168024 1.2072993 -12.262269 - 5000 520487.75 0 0.50222348 0.50854461 0.50304351 1.5138116 303.56775 - 6000 527970.5 0 0.60443861 0.60363711 0.59884932 1.806925 218.55799 - 7000 519424.68 0 0.69529071 0.70025532 0.70347351 2.0990195 -363.51723 - 8000 521925.72 0 0.80545039 0.81520807 0.79930708 2.4199655 510.47732 - 9000 518397.28 0 0.91236827 0.9050426 0.89431985 2.7117307 537.74151 - 10000 525696.47 0 0.99494325 0.99433832 0.98574884 2.9750304 411.56896 - 11000 524505.88 0 1.0863677 1.1232636 1.0810609 3.2906921 32.652569 - 12000 525350.08 0 1.1816136 1.2412674 1.189996 3.612877 45.304061 - 13000 524598.12 0 1.2841566 1.3381915 1.2906249 3.912973 -376.50739 - 14000 525438.09 0 1.3964076 1.4420032 1.3915611 4.2299719 -31.273339 - 15000 523531.08 0 1.4829127 1.5436611 1.4892074 4.5157811 -357.26366 - 16000 532366.43 0 1.5871965 1.6432286 1.6020146 4.8324397 435.10667 - 17000 523629.21 0 1.6968632 1.7574539 1.6967316 5.1510487 280.59816 - 18000 521432.94 0 1.7973983 1.8462477 1.8087416 5.4523876 134.69384 - 19000 530778.78 0 1.888653 1.9328611 1.9268155 5.7483296 -64.346115 - 20000 525623.21 0 1.9718697 2.0048196 2.0068177 5.983507 73.884028 - 21000 524862.26 0 2.0414226 2.0967449 2.0878261 6.2259936 163.95173 - 22000 529123.04 0 2.143889 2.1850282 2.1972491 6.5261662 234.87793 - 23000 519629.76 0 2.2297952 2.2661611 2.2805197 6.776476 57.65702 - 24000 523746.18 0 2.3293654 2.3658544 2.3842082 7.079428 46.291089 - 25000 515851.07 0 2.4177426 2.4559274 2.5029961 7.3766661 -16.353546 - 26000 515592.59 0 2.5352044 2.5438918 2.5657776 7.6448738 -65.259248 - 27000 527764.96 0 2.6498176 2.6423592 2.6715377 7.9637146 324.48367 - 28000 527177.18 0 2.7405087 2.7431537 2.7702133 8.2538757 -47.906223 - 29000 521079.66 0 2.8294642 2.8410515 2.8546167 8.5251323 -135.36173 - 30000 526092.8 0 2.961898 2.9361476 2.9319586 8.8300042 206.28635 - 31000 529595.93 0 3.0638234 3.0128995 3.0434232 9.1201461 -35.946596 - 32000 521173.83 0 3.159344 3.1397814 3.1455147 9.4446401 328.73193 - 33000 522989.77 0 3.2567127 3.2348491 3.2444068 9.7359686 362.33435 - 34000 522930.45 0 3.3489514 3.3433962 3.3391822 10.03153 178.73773 - 35000 530664.64 0 3.4445399 3.4843743 3.4205275 10.349442 146.02898 - 36000 521443.26 0 3.520475 3.6171115 3.5179112 10.655498 244.07172 - 37000 529669.54 0 3.6076942 3.7233869 3.6169718 10.948053 79.46077 - 38000 527521.93 0 3.7093699 3.8275855 3.7451165 11.282072 -91.131074 - 39000 523237.65 0 3.8088585 3.9559041 3.8748751 11.639638 -70.265271 - 40000 522798.75 0 3.89319 4.0420406 3.9196106 11.854841 91.631855 - 41000 524228.77 0 3.9863379 4.1602581 4.0393136 12.18591 113.26515 - 42000 524546.08 0 4.0969366 4.2738786 4.1218115 12.492627 313.83957 - 43000 515948.22 0 4.2161418 4.3700009 4.2178962 12.804039 92.993253 - 44000 527319.42 0 4.3267431 4.4688062 4.3274029 13.122952 -118.91153 - 45000 526222.74 0 4.4289127 4.5531203 4.4604075 13.442441 -474.98113 - 46000 524617.54 0 4.5422968 4.6316235 4.5445894 13.71851 -303.23458 - 47000 524067.07 0 4.6284944 4.6989745 4.5884153 13.915884 -343.41107 - 48000 535659.25 0 4.7221068 4.7505302 4.7212887 14.193926 149.75872 - 49000 527425.65 0 4.8098179 4.8761354 4.8362998 14.522253 -272.18936 - 50000 516588.98 0 4.9077783 4.9950242 4.9826783 14.885481 -52.925733 - 51000 522291.86 0 5.0022325 5.0659091 5.0525647 15.120706 -52.985883 - 52000 530056.07 0 5.123751 5.1470734 5.1603805 15.431205 -231.29334 - 53000 525624.96 0 5.2412036 5.2543541 5.2717587 15.767316 294.19678 - 54000 524407.27 0 5.3530927 5.359043 5.342451 16.054587 -55.282671 - 55000 519989.37 0 5.4458173 5.4781678 5.413865 16.33785 -135.28414 - 56000 524987.68 0 5.5282178 5.5825979 5.5127172 16.623533 84.654044 - 57000 525610.66 0 5.6202713 5.6925409 5.5964466 16.909259 407.16526 - 58000 523097.93 0 5.7390671 5.7830376 5.6921201 17.214225 -271.05243 - 59000 525357.74 0 5.8037507 5.8654514 5.7920744 17.461276 -213.07815 - 60000 522185.96 0 5.9067925 5.9909357 5.903525 17.801253 330.09637 - 61000 527694.33 0 6.0576096 6.0907943 6.0202838 18.168688 310.22884 - 62000 522936.57 0 6.1422565 6.1888677 6.124212 18.455336 -24.591697 - 63000 526642.55 0 6.2261061 6.2832608 6.2023277 18.711695 -130.32823 - 64000 514826.49 0 6.3032614 6.3628539 6.3184362 18.984552 195.43036 - 65000 529338.23 0 6.4152502 6.4482512 6.4241507 19.287652 -77.817059 - 66000 527425.07 0 6.5122194 6.5052947 6.5518104 19.569324 8.0143425 - 67000 525258.85 0 6.6292334 6.6417881 6.6438938 19.914915 152.1905 - 68000 527067.89 0 6.7569918 6.6951219 6.7357134 20.187827 -337.54654 - 69000 522395.33 0 6.8401085 6.7836633 6.8243746 20.448146 34.755329 - 70000 522200.34 0 6.9549662 6.8773008 6.9537894 20.786056 352.30283 - 71000 527550.11 0 7.0441399 6.9837133 7.0860791 21.113932 171.42143 - 72000 529564.22 0 7.1744229 7.0581688 7.1507041 21.383296 269.04569 - 73000 524175.53 0 7.248828 7.1693905 7.2974868 21.715705 -84.993601 - 74000 528604.1 0 7.3358903 7.2983204 7.390523 22.024734 -6.8495991 - 75000 519136.15 0 7.445248 7.4224403 7.4690469 22.336735 250.23521 - 76000 518470.58 0 7.5747768 7.5354904 7.5612252 22.671492 274.53956 - 77000 518459.51 0 7.6660567 7.6557812 7.7020797 23.023918 430.07722 - 78000 516646.23 0 7.7596088 7.7130901 7.7896654 23.262364 536.21298 - 79000 517511.57 0 7.9021784 7.82098 7.8840028 23.607161 193.80468 - 80000 520654.84 0 7.991107 7.8932454 8.0049184 23.889271 -6.0066355 - 81000 522331.74 0 8.0616391 7.9990606 8.0954141 24.156114 47.271954 - 82000 521540.3 0 8.1268306 8.0763829 8.1861513 24.389365 36.265762 - 83000 529154.07 0 8.2537975 8.1854268 8.2745822 24.713807 113.94154 - 84000 525977.29 0 8.2999431 8.26591 8.2970498 24.862903 -72.444836 - 85000 520505.41 0 8.3872349 8.3551374 8.4251458 25.167518 -346.6703 - 86000 516334.67 0 8.4947842 8.4504822 8.5238751 25.469142 -3.8332672 - 87000 524745.34 0 8.5405071 8.5348571 8.6344387 25.709803 -149.22382 - 88000 521384.87 0 8.5798155 8.6260785 8.7133565 25.919251 22.009599 - 89000 519680.71 0 8.6657392 8.6857605 8.8319304 26.18343 -180.94487 - 90000 522482.4 0 8.7310324 8.7844751 8.9636862 26.479194 -102.50361 - 91000 527450.69 0 8.8250902 8.8445728 9.0456076 26.715271 325.68024 - 92000 519060.77 0 8.9054775 8.9412744 9.1259074 26.972659 130.73028 - 93000 518170.14 0 9.0378587 9.0315875 9.2346184 27.304065 -111.68498 - 94000 531639.53 0 9.1268874 9.0952299 9.3437063 27.565824 -26.423328 - 95000 519776.1 0 9.2332576 9.1903006 9.4516001 27.875158 -113.46356 - 96000 527082.72 0 9.2993234 9.2533436 9.534409 28.087076 -46.720611 - 97000 526965.16 0 9.3485677 9.3197496 9.6631942 28.331512 159.18386 - 98000 529790.04 0 9.4759113 9.5177629 9.783846 28.77752 343.32872 - 99000 520964.82 0 9.6488022 9.6573355 9.882432 29.18857 -257.85576 - 100000 520863.58 0 9.7452168 9.7659565 9.9878877 29.499061 -108.52324 - 101000 526760.86 0 9.8073751 9.8508213 10.127532 29.785728 120.22249 - 102000 519249.89 0 9.9315855 9.9767409 10.221605 30.129931 -176.50647 - 103000 525003.9 0 10.023982 10.062451 10.315002 30.401435 422.1401 - 104000 519112.73 0 10.086117 10.136879 10.415222 30.638218 -147.66505 - 105000 517898.24 0 10.180438 10.240942 10.525346 30.946725 158.63054 - 106000 528046.35 0 10.258163 10.41411 10.601663 31.273936 -128.04669 - 107000 527105.8 0 10.364015 10.485036 10.795177 31.644228 183.82165 - 108000 522024.28 0 10.450786 10.544065 10.902961 31.897812 -39.692553 - 109000 519497.83 0 10.556206 10.61633 11.046222 32.218758 173.75988 - 110000 521070.8 0 10.64856 10.745382 11.071387 32.465329 -128.45389 - 111000 525657.64 0 10.830485 10.852954 11.188295 32.871734 -214.60249 - 112000 519426.33 0 10.987769 10.97575 11.26012 33.223639 292.35901 - 113000 526472.45 0 11.029941 11.086376 11.418772 33.535089 189.69245 - 114000 520070.28 0 11.107229 11.183295 11.454757 33.745281 -40.433571 - 115000 525812.59 0 11.153992 11.305378 11.537521 33.99689 -106.38733 - 116000 524464.26 0 11.256779 11.413082 11.633295 34.303156 -159.59643 - 117000 519838.94 0 11.344413 11.480104 11.706366 34.530883 -2.0346135 - 118000 524075.83 0 11.441416 11.597533 11.783056 34.822005 -350.05313 - 119000 533816.71 0 11.52766 11.681986 11.917713 35.127359 -521.58975 - 120000 524509.31 0 11.63865 11.792667 12.080379 35.511696 273.09647 -Loop time of 39.6359 on 1 procs for 120000 steps with 4096 atoms - -Performance: 2615.809 tau/day, 3027.557 timesteps/s -100.0% CPU use with 1 MPI tasks x 1 OpenMP threads - -MPI task timing breakdown: -Section | min time | avg time | max time |%varavg| %total ---------------------------------------------------------------- -Pair | 0 | 0 | 0 | 0.0 | 0.00 -Neigh | 0.0059817 | 0.0059817 | 0.0059817 | 0.0 | 0.02 -Comm | 0.039473 | 0.039473 | 0.039473 | 0.0 | 0.10 -Output | 0.0063653 | 0.0063653 | 0.0063653 | 0.0 | 0.02 -Modify | 38.085 | 38.085 | 38.085 | 0.0 | 96.09 -Other | | 1.499 | | | 3.78 - -Nlocal: 4096.00 ave 4096 max 4096 min -Histogram: 1 0 0 0 0 0 0 0 0 0 -Nghost: 0.00000 ave 0 max 0 min -Histogram: 1 0 0 0 0 0 0 0 0 0 -Neighs: 0.00000 ave 0 max 0 min -Histogram: 1 0 0 0 0 0 0 0 0 0 - -Total # of neighbors = 0 -Ave neighs/atom = 0.0000000 -Neighbor list builds = 992 -Dangerous builds = 0 - - -Total wall time: 0:00:55 diff --git a/examples/USER/brownian/spherical_ABP/in.2d_abp b/examples/USER/brownian/spherical_ABP/in2d.abp similarity index 81% rename from examples/USER/brownian/spherical_ABP/in.2d_abp rename to examples/USER/brownian/spherical_ABP/in2d.abp index 9db5a46cf6..7c53717038 100644 --- a/examples/USER/brownian/spherical_ABP/in.2d_abp +++ b/examples/USER/brownian/spherical_ABP/in2d.abp @@ -1,14 +1,13 @@ # 2D overdamped active brownian particle dynamics (ABP) # with WCA potential -variable gamma_t equal 1.0 -variable gamma_r equal 1.0 -variable D_t equal 1.0 -variable D_r equal 3.0 +variable gamma_t string 1.0 +variable gamma_r string 1.0 +variable temp string 1.0 variable seed equal 1974019 -variable fp equal 4.0 +variable fp string 4.0 -variable params string ${gamma_t}_${gamma_r}_${D_t}_${D_r}_${fp} +variable params string ${temp}_${gamma_t}_${gamma_r}_${fp} log log_WCA_${params}_2d.lammps.log @@ -39,7 +38,7 @@ pair_modify shift yes # overdamped brownian dynamics time-step -fix step all brownian/sphere ${gamma_t} ${gamma_r} ${D_t} ${D_r} ${seed} dipole +fix step all brownian/sphere ${temp} ${seed} gamma_t ${gamma_t} gamma_r ${gamma_r} # self-propulsion force along the dipole direction fix activity all propel/self dipole ${fp} fix 2 all enforce2d diff --git a/examples/USER/brownian/spherical_ABP/in.3d_ideal_abp b/examples/USER/brownian/spherical_ABP/in3d.ideal_abp similarity index 78% rename from examples/USER/brownian/spherical_ABP/in.3d_ideal_abp rename to examples/USER/brownian/spherical_ABP/in3d.ideal_abp index 4c3d403f20..dfe782525c 100644 --- a/examples/USER/brownian/spherical_ABP/in.3d_ideal_abp +++ b/examples/USER/brownian/spherical_ABP/in3d.ideal_abp @@ -1,13 +1,12 @@ # 3D overdamped active brownian dynamics with no interactions -variable gamma_t equal 1.0 -variable gamma_r equal 1.0 -variable D_t equal 1.0 -variable D_r equal 3.0 +variable gamma_t string 3.0 +variable gamma_r string 1.0 +variable temp string 1.0 variable seed equal 1974019 -variable fp equal 4.0 +variable fp string 4.0 -variable params string ${gamma_t}_${gamma_r}_${D_t}_${D_r}_${fp} +variable params string ${temp}_${gamma_t}_${gamma_r}_${fp} log log_ideal_${params}_3d.lammps.log @@ -28,7 +27,7 @@ velocity all create 1.0 1 loop geom pair_style none # overdamped brownian dynamics time-step -fix step all brownian/sphere ${gamma_t} ${gamma_r} ${D_t} ${D_r} ${seed} dipole +fix step all brownian/sphere ${temp} ${seed} gamma_t ${gamma_t} gamma_r ${gamma_r} # self-propulsion force along the dipole direction fix activity all propel/self dipole ${fp} @@ -47,7 +46,8 @@ reset_timestep 0 # MSD to demonstrate expected diffusive behaviour for ideal active # brownian motion, which is # -# MSD = (2*d*D_t + 2*fp**2/(gamma_t**2*(d-1)*D_r))*t +# MSD = (2*d*kb*T/gamma_t + 2*fp**2*gamma_r/(kb*T*gamma_t**2*(d-1)))*t +# + 2*fp**2*gamma_r**2/(gamma_t**2*(d-1)**2*(kb*T)**2)*(e^(-(d-1)*t*kb*T/gamma_r)-1) # # with d being simulation dimension compute msd all msd diff --git a/examples/USER/brownian/translational/in.brownian b/examples/USER/brownian/translational/in.brownian deleted file mode 100644 index fbf43e68c6..0000000000 --- a/examples/USER/brownian/translational/in.brownian +++ /dev/null @@ -1,65 +0,0 @@ -# 3d overdamped brownian dynamics - -variable gamma_t equal 1.0 -variable D_t equal 1.0 -variable seed equal 1974019 - -variable params string ${gamma_t}_${D_t} - - -log log_${params}.lammps.log -units lj -dimension 3 -newton off - - -lattice sc 0.4 -region box block -8 8 -8 8 -8 8 -create_box 1 box -create_atoms 1 box -mass * 1.0 -velocity all create 1.0 1 loop geom - - -neighbor 1.0 bin -neigh_modify every 1 delay 1 check yes - - - -pair_style none - -# simple overdamped brownian dynamics time-stepper -fix step all brownian ${gamma_t} ${D_t} ${seed} - -# turn on the virial contribution from the noise -# (this is the ideal gas pressure, but it is really noisy -# for small systems) -fix_modify step virial yes - -compute press all pressure NULL virial - -thermo_style custom step temp epair c_press - -#equilibration -timestep 0.0000000001 -thermo 50001 -run 50000 -reset_timestep 0 - - -#initialisation for the main run - -# MSD -compute msd all msd - - -thermo_style custom step temp epair c_msd[*] c_press - - -timestep 0.00001 -thermo 1000 - -# main run -run 120000 - - diff --git a/examples/USER/brownian/translational/log_1_1.lammps.log b/examples/USER/brownian/translational/log_1_1.lammps.log deleted file mode 100644 index 0fdba989bd..0000000000 --- a/examples/USER/brownian/translational/log_1_1.lammps.log +++ /dev/null @@ -1,246 +0,0 @@ -units lj -dimension 3 -newton off - - -lattice sc 0.4 -Lattice spacing in x,y,z = 1.3572088 1.3572088 1.3572088 -region box block -8 8 -8 8 -8 8 -create_box 1 box -Created orthogonal box = (-10.857670 -10.857670 -10.857670) to (10.857670 10.857670 10.857670) - 1 by 1 by 1 MPI processor grid -create_atoms 1 box -Created 4096 atoms - create_atoms CPU = 0.002 seconds -mass * 1.0 -velocity all create 1.0 1 loop geom - - -neighbor 1.0 bin -neigh_modify every 1 delay 1 check yes - - - -pair_style none - -# simple overdamped brownian dynamics time-stepper -fix step all brownian ${gamma_t} ${D_t} ${seed} -fix step all brownian 1 ${D_t} ${seed} -fix step all brownian 1 1 ${seed} -fix step all brownian 1 1 1974019 - -# turn on the virial contribution from the noise -# (this is the ideal gas pressure, but it is really noisy -# for small systems) -fix_modify step virial yes - -compute press all pressure NULL virial - -thermo_style custom step temp epair c_press - -#equilibration -timestep 0.0000000001 -thermo 50001 -run 50000 -WARNING: No pairwise cutoff or binsize set. Atom sorting therefore disabled. (src/atom.cpp:2118) -WARNING: Communication cutoff is 0.0. No ghost atoms will be generated. Atoms may get lost. (src/comm_brick.cpp:167) -Per MPI rank memory allocation (min/avg/max) = 2.319 | 2.319 | 2.319 Mbytes -Step Temp E_pair c_press - 0 1 0 1500.0667 - 50000 2.0204192e+10 0 809.28898 -Loop time of 8.36695 on 1 procs for 50000 steps with 4096 atoms - -Performance: 0.052 tau/day, 5975.895 timesteps/s -100.0% CPU use with 1 MPI tasks x 1 OpenMP threads - -MPI task timing breakdown: -Section | min time | avg time | max time |%varavg| %total ---------------------------------------------------------------- -Pair | 0 | 0 | 0 | 0.0 | 0.00 -Neigh | 0 | 0 | 0 | 0.0 | 0.00 -Comm | 0.081773 | 0.081773 | 0.081773 | 0.0 | 0.98 -Output | 3.0396e-05 | 3.0396e-05 | 3.0396e-05 | 0.0 | 0.00 -Modify | 7.8039 | 7.8039 | 7.8039 | 0.0 | 93.27 -Other | | 0.4812 | | | 5.75 - -Nlocal: 4096.00 ave 4096 max 4096 min -Histogram: 1 0 0 0 0 0 0 0 0 0 -Nghost: 817.000 ave 817 max 817 min -Histogram: 1 0 0 0 0 0 0 0 0 0 -Neighs: 0.00000 ave 0 max 0 min -Histogram: 1 0 0 0 0 0 0 0 0 0 - -Total # of neighbors = 0 -Ave neighs/atom = 0.0000000 -Neighbor list builds = 0 -Dangerous builds = 0 -reset_timestep 0 - - -#initialisation for the main run - -# MSD -compute msd all msd - - -thermo_style custom step temp epair c_msd[*] c_press - - -timestep 0.00001 -thermo 1000 - -# main run -run 120000 -WARNING: Communication cutoff is 0.0. No ghost atoms will be generated. Atoms may get lost. (src/comm_brick.cpp:167) -Per MPI rank memory allocation (min/avg/max) = 2.694 | 2.694 | 2.694 Mbytes -Step Temp E_pair c_msd[1] c_msd[2] c_msd[3] c_msd[4] c_press - 0 2.0204192e+10 0 0 0 0 0 3.053092 - 1000 199589.87 0 0.020515986 0.019445659 0.020084014 0.060045658 -10.855191 - 2000 202255.37 0 0.039423387 0.039839097 0.041243768 0.12050625 -7.8484884 - 3000 197932.37 0 0.058057959 0.060232381 0.061205106 0.17949545 14.441358 - 4000 201354.42 0 0.08020915 0.080140903 0.081351793 0.24170185 -2.7088264 - 5000 201599.34 0 0.10065125 0.099423954 0.10004367 0.30011888 10.000367 - 6000 198355.3 0 0.12039302 0.12228165 0.12136204 0.36403671 -7.7331104 - 7000 201842.08 0 0.13901495 0.14401324 0.14070032 0.42372851 1.049759 - 8000 200224.96 0 0.16063188 0.16389028 0.16409878 0.48862093 14.748306 - 9000 198468.62 0 0.18050666 0.18555949 0.18441359 0.55047975 -7.2751841 - 10000 197958.21 0 0.20229316 0.20438608 0.20471694 0.61139618 -8.8169492 - 11000 200852.8 0 0.22244961 0.22388152 0.22417791 0.67050904 -0.56323783 - 12000 200135.84 0 0.24070342 0.23964066 0.24829459 0.72863867 -20.246433 - 13000 199160.33 0 0.26021951 0.2581362 0.27210493 0.79046065 6.2400743 - 14000 200016.58 0 0.28005738 0.27429833 0.29107673 0.84543244 9.8390268 - 15000 200805.25 0 0.30110658 0.29756813 0.31002936 0.90870407 -9.7474978 - 16000 201221.83 0 0.31982855 0.31758368 0.33140494 0.96881716 -11.937757 - 17000 199690.18 0 0.33896659 0.33908504 0.35143307 1.0294847 -11.627541 - 18000 197165.97 0 0.35589324 0.3605585 0.37062404 1.0870758 17.045279 - 19000 202921.66 0 0.36968243 0.3825335 0.38579438 1.1380103 -3.2942099 - 20000 200415.26 0 0.39189833 0.39811842 0.40650662 1.1965234 -0.55679809 - 21000 198882.79 0 0.41394816 0.42495341 0.42660986 1.2655114 0.26572202 - 22000 199352.13 0 0.43200564 0.44555233 0.44842807 1.325986 5.9839474 - 23000 200565.11 0 0.45248704 0.46736174 0.4633773 1.3832261 0.51141727 - 24000 197632.73 0 0.47648878 0.49070755 0.48561349 1.4528098 11.301781 - 25000 203284.74 0 0.50103025 0.5117464 0.50162451 1.5144012 4.0966379 - 26000 200458.42 0 0.52111051 0.53245594 0.52193205 1.5754985 -9.2090189 - 27000 197553.02 0 0.54097922 0.553215 0.5440757 1.6382699 -6.0708365 - 28000 200874.32 0 0.55707209 0.57015852 0.56334199 1.6905726 -17.349073 - 29000 199494.43 0 0.57734934 0.59276209 0.58014344 1.7502549 -7.0407471 - 30000 199898.09 0 0.60161157 0.6156313 0.60516078 1.8224036 -1.3770813 - 31000 200867.7 0 0.62383361 0.64008503 0.6272796 1.8911982 -8.3200079 - 32000 198811.59 0 0.64361889 0.66089102 0.64987533 1.9543852 -0.21133799 - 33000 198224.12 0 0.66695348 0.67669734 0.67749939 2.0211502 0.87075722 - 34000 202553.2 0 0.69470773 0.69930784 0.69600623 2.0900218 1.7428524 - 35000 199227.86 0 0.71973625 0.72255845 0.71991572 2.1622104 2.4381317 - 36000 200719.05 0 0.73772312 0.74086704 0.74438632 2.2229765 -8.8184183 - 37000 198054.45 0 0.75901548 0.76107029 0.76677002 2.2868558 9.0699905 - 38000 198496.92 0 0.77679013 0.78067416 0.78055585 2.3380201 -8.8374756 - 39000 199224.19 0 0.79689891 0.8074183 0.79624042 2.4005576 -2.3099574 - 40000 199514.11 0 0.81493522 0.8271518 0.81729253 2.4593796 8.5411105 - 41000 199926.55 0 0.82918834 0.84950171 0.83531381 2.5140039 -6.8276624 - 42000 201659.21 0 0.84991161 0.87416096 0.86612093 2.5901935 -11.006396 - 43000 201502.51 0 0.87967597 0.89570393 0.88920119 2.6645811 9.4305203 - 44000 194956.27 0 0.9022655 0.91604833 0.90539218 2.723706 1.7636771 - 45000 201853.02 0 0.92302957 0.93661741 0.93225051 2.7918975 9.6483674 - 46000 200572.92 0 0.94062662 0.94933155 0.94953376 2.8394919 1.0882497 - 47000 202008.49 0 0.95397524 0.97655157 0.96534559 2.8958724 -7.9450141 - 48000 199748.89 0 0.97441115 0.99687233 0.98429144 2.9555749 5.0525854 - 49000 203008.7 0 0.99757948 1.0095536 0.99836015 3.0054932 28.410878 - 50000 198810.18 0 1.0182591 1.0287254 1.0110652 3.0580497 22.596989 - 51000 201716 0 1.0414747 1.0448379 1.0361279 3.1224404 -0.3397634 - 52000 200682.63 0 1.0640391 1.0597767 1.0596255 3.1834413 8.9163814 - 53000 201068.23 0 1.0804112 1.0740541 1.077586 3.2320513 8.9631815 - 54000 203379.33 0 1.0965663 1.0832317 1.0981473 3.2779453 -7.8020084 - 55000 197117.81 0 1.1145489 1.1008769 1.1259188 3.3413446 13.723633 - 56000 201100.37 0 1.1420502 1.1311309 1.1425839 3.415765 10.39045 - 57000 199911.61 0 1.1641357 1.1461183 1.1598876 3.4701416 -1.5384143 - 58000 202180.4 0 1.1787793 1.1703422 1.1794284 3.5285498 4.9552552 - 59000 202359.35 0 1.2017068 1.1846051 1.1912556 3.5775675 14.774737 - 60000 196182.35 0 1.2297664 1.2087508 1.2116928 3.65021 12.484104 - 61000 201858.45 0 1.2505094 1.2255583 1.2330327 3.7091004 3.6962199 - 62000 198313.02 0 1.2756755 1.2437434 1.2514738 3.7708927 -6.5600779 - 63000 198423.1 0 1.2998594 1.262369 1.2656961 3.8279245 3.1919497 - 64000 202601.56 0 1.3177969 1.2812961 1.2841642 3.8832572 7.1735962 - 65000 201270.73 0 1.3353533 1.3006911 1.306668 3.9427124 3.7612957 - 66000 199480.32 0 1.3502663 1.3165416 1.3300249 3.9968327 -8.0484056 - 67000 202829.47 0 1.3628924 1.3369328 1.339246 4.0390712 -2.962791 - 68000 200269.53 0 1.3901352 1.3600404 1.3528283 4.1030039 29.395886 - 69000 201514.31 0 1.4135333 1.3834796 1.3719116 4.1689245 9.5358653 - 70000 198898.14 0 1.4323413 1.4056025 1.4015088 4.2394526 13.713608 - 71000 198446.83 0 1.4424061 1.4229225 1.4231698 4.2884984 9.5266069 - 72000 199550.94 0 1.4730822 1.4438093 1.4436864 4.360578 5.4060926 - 73000 201536.57 0 1.4860349 1.4557531 1.4673417 4.4091297 2.7527606 - 74000 201688.68 0 1.5078921 1.4770318 1.4889958 4.4739197 -2.5507167 - 75000 203168.01 0 1.5264946 1.4942757 1.5095341 4.5303045 13.955087 - 76000 198782.86 0 1.5363851 1.5145529 1.5306446 4.5815826 1.6748995 - 77000 199306.04 0 1.55336 1.5308045 1.5501462 4.6343107 1.4463705 - 78000 199420.52 0 1.5679804 1.5445387 1.5765555 4.6890745 -15.926362 - 79000 198711.33 0 1.5818761 1.5651424 1.5966885 4.743707 -23.662716 - 80000 202734.35 0 1.6045976 1.5878467 1.6155179 4.8079623 1.4177771 - 81000 199953.12 0 1.6266918 1.6125491 1.6370893 4.8763302 14.40188 - 82000 201254.27 0 1.6418366 1.6362867 1.6497081 4.9278313 -4.3503 - 83000 200442.35 0 1.6671772 1.6544269 1.6638838 4.9854878 -5.5569751 - 84000 201442.09 0 1.6772029 1.6819435 1.6824211 5.0415676 -17.634517 - 85000 202012.75 0 1.7026782 1.7059915 1.7079961 5.1166659 8.8311485 - 86000 198613.4 0 1.725679 1.7251262 1.7235885 5.1743936 10.070509 - 87000 198650.79 0 1.748013 1.7447674 1.7397963 5.2325767 7.3326989 - 88000 199753.54 0 1.7793864 1.7677848 1.7548586 5.3020298 -3.8460869 - 89000 200851.56 0 1.7992856 1.7843281 1.7671516 5.3507653 10.274664 - 90000 202029.24 0 1.8178051 1.8010651 1.7886511 5.4075213 1.1705818 - 91000 200963.98 0 1.8425785 1.8123748 1.8079693 5.4629226 -8.0390883 - 92000 200443.4 0 1.8743616 1.8355736 1.8340515 5.5439867 -12.186363 - 93000 197974.1 0 1.8911764 1.8440063 1.8442582 5.579441 10.189145 - 94000 201285.41 0 1.9040394 1.8567044 1.8663386 5.6270824 7.8537148 - 95000 198472.81 0 1.9268236 1.8638624 1.8855767 5.6762627 11.556616 - 96000 198171.93 0 1.9378011 1.8811168 1.9024245 5.7213424 -7.3493903 - 97000 200055.5 0 1.9539002 1.9031647 1.9221125 5.7791774 -7.2823252 - 98000 200350.77 0 1.973424 1.9255707 1.9393139 5.8383087 2.3526328 - 99000 198923.17 0 1.9946733 1.9416292 1.9616759 5.8979785 -8.6362233 - 100000 196205.31 0 2.015688 1.967164 1.9801696 5.9630216 1.5261152 - 101000 198842.45 0 2.0402634 1.9858628 1.9939889 6.0201151 6.8070808 - 102000 199060.56 0 2.0583018 2.0040652 2.0225396 6.0849067 5.4626963 - 103000 204892.64 0 2.0788003 2.0245826 2.0405395 6.1439224 -19.988675 - 104000 198709.07 0 2.0990457 2.0519007 2.0571079 6.2080544 -21.365135 - 105000 198916.99 0 2.1089408 2.0758832 2.0899796 6.2748037 4.3696238 - 106000 202191.68 0 2.1172909 2.0923523 2.1208274 6.3304706 8.2072292 - 107000 202428.89 0 2.1387532 2.114944 2.1418816 6.3955788 4.1099611 - 108000 197690.67 0 2.1620575 2.136726 2.1703555 6.469139 5.7183695 - 109000 200098.73 0 2.1814376 2.1464455 2.1828177 6.5107008 7.4366333 - 110000 197901.18 0 2.1955124 2.1764141 2.1994286 6.5713551 -6.4288954 - 111000 199478.54 0 2.2167884 2.1900638 2.2140739 6.6209261 22.379137 - 112000 198391.65 0 2.249996 2.2100316 2.2309406 6.6909682 -20.040892 - 113000 200542.42 0 2.2634106 2.2313768 2.2610988 6.7558862 0.2953844 - 114000 202117.15 0 2.28441 2.2517036 2.2787302 6.8148438 16.75177 - 115000 200004.06 0 2.2957226 2.2730837 2.2901883 6.8589947 -4.3125612 - 116000 200648.11 0 2.3184059 2.2934521 2.3257075 6.9375656 5.7210624 - 117000 198600.57 0 2.3413891 2.3102468 2.3511234 7.0027593 -2.9987639 - 118000 199817.34 0 2.3732051 2.3347741 2.3601752 7.0681544 -3.3658539 - 119000 200556.96 0 2.3873448 2.3595646 2.3774937 7.1244031 20.860601 - 120000 200997.81 0 2.4097258 2.3736031 2.3871081 7.170437 -5.3623487 -Loop time of 20.5037 on 1 procs for 120000 steps with 4096 atoms - -Performance: 5056.640 tau/day, 5852.593 timesteps/s -99.9% CPU use with 1 MPI tasks x 1 OpenMP threads - -MPI task timing breakdown: -Section | min time | avg time | max time |%varavg| %total ---------------------------------------------------------------- -Pair | 0 | 0 | 0 | 0.0 | 0.00 -Neigh | 0.0012425 | 0.0012425 | 0.0012425 | 0.0 | 0.01 -Comm | 0.015074 | 0.015074 | 0.015074 | 0.0 | 0.07 -Output | 0.006156 | 0.006156 | 0.006156 | 0.0 | 0.03 -Modify | 19.243 | 19.243 | 19.243 | 0.0 | 93.85 -Other | | 1.238 | | | 6.04 - -Nlocal: 4096.00 ave 4096 max 4096 min -Histogram: 1 0 0 0 0 0 0 0 0 0 -Nghost: 0.00000 ave 0 max 0 min -Histogram: 1 0 0 0 0 0 0 0 0 0 -Neighs: 0.00000 ave 0 max 0 min -Histogram: 1 0 0 0 0 0 0 0 0 0 - -Total # of neighbors = 0 -Ave neighs/atom = 0.0000000 -Neighbor list builds = 205 -Dangerous builds = 0 - - -Total wall time: 0:00:28 diff --git a/src/USER-BROWNIAN/fix_brownian.cpp b/src/USER-BROWNIAN/fix_brownian.cpp index f25f6d6b32..128bd92042 100644 --- a/src/USER-BROWNIAN/fix_brownian.cpp +++ b/src/USER-BROWNIAN/fix_brownian.cpp @@ -38,69 +38,24 @@ using namespace FixConst; /* ---------------------------------------------------------------------- */ FixBrownian::FixBrownian(LAMMPS *lmp, int narg, char **arg) : - Fix(lmp, narg, arg) + FixBrownianBase(lmp, narg, arg) { - virial_flag = 1; - time_integrate = 1; - - if (narg != 6 && narg != 8) + if (dipole_flag || gamma_t_eigen_flag || gamma_r_eigen_flag || gamma_r_flag) { error->all(FLERR,"Illegal fix brownian command."); + } - gamma_t = utils::numeric(FLERR,arg[3],false,lmp); - if (gamma_t <= 0.0) - error->all(FLERR,"Fix brownian viscous drag " - "coefficient must be > 0."); - - diff_t = utils::numeric(FLERR,arg[4],false,lmp); - if (diff_t <= 0.0) - error->all(FLERR,"Fix brownian diffusion " - "coefficient must be > 0."); - - seed = utils::inumeric(FLERR,arg[5],false,lmp); - if (seed <= 0) error->all(FLERR,"Fix brownian seed must be > 0."); - - noise_flag = 1; - gaussian_noise_flag = 0; - - if (narg == 8) { - - if (strcmp(arg[6],"rng") == 0) { - if (strcmp(arg[7],"uniform") == 0) { - noise_flag = 1; - } else if (strcmp(arg[7],"gaussian") == 0) { - noise_flag = 1; - gaussian_noise_flag = 1; - } else if (strcmp(arg[7],"none") == 0) { - noise_flag = 0; - } else { - error->all(FLERR,"Illegal fix brownian command."); - } - } else { - error->all(FLERR,"Illegal fix brownian command."); - } + if (!gamma_t_flag) { + error->all(FLERR,"Illegal fix brownian command."); } - // initialize Marsaglia RNG with processor-unique seed - random = new RanMars(lmp,seed + comm->me); - } -/* ---------------------------------------------------------------------- */ - -int FixBrownian::setmask() -{ - int mask = 0; - mask |= INITIAL_INTEGRATE; - mask |= POST_FORCE; - return mask; -} /* ---------------------------------------------------------------------- */ FixBrownian::~FixBrownian() { - delete random; } @@ -109,109 +64,99 @@ FixBrownian::~FixBrownian() void FixBrownian::init() { + + FixBrownianBase::init(); - g1 = force->ftm2v/gamma_t; - if (noise_flag == 0) { - g2 = 0; - rng_func = &RanMars::zero_rng; - } else if (gaussian_noise_flag == 1) { - g2 = gamma_t*sqrt(2 * diff_t)/force->ftm2v; - rng_func = &RanMars::gaussian; - } else { - g2 = gamma_t*sqrt( 24 * diff_t)/force->ftm2v; - rng_func = &RanMars::uniform_middle; - } + g1 /= gamma_t; + g2 *= sqrt(gamma_t); - dt = update->dt; - sqrtdt = sqrt(dt); -} - -void FixBrownian::setup(int vflag) -{ - post_force(vflag); } /* ---------------------------------------------------------------------- */ -void FixBrownian::initial_integrate(int /* vflag */) +void FixBrownian::initial_integrate(int /*vflag */) +{ + + if (domain->dimension == 2) { + if (!noise_flag) { + initial_integrate_templated<0,0,1>(); + } else if (gaussian_noise_flag) { + initial_integrate_templated<0,1,1>(); + } else { + initial_integrate_templated<1,0,1>(); + } + } else { + if (!noise_flag) { + initial_integrate_templated<0,0,0>(); + } else if (gaussian_noise_flag) { + initial_integrate_templated<0,1,0>(); + } else { + initial_integrate_templated<1,0,0>(); + } + } + return; +} + +/* ---------------------------------------------------------------------- */ + +template < int Tp_UNIFORM, int Tp_GAUSS, int Tp_2D > +void FixBrownian::initial_integrate_templated() { double **x = atom->x; double **v = atom->v; double **f = atom->f; int *mask = atom->mask; int nlocal = atom->nlocal; - double dx,dy,dz; - + if (igroup == atom->firstgroup) nlocal = atom->nfirst; - + double dx,dy,dz; + for (int i = 0; i < nlocal; i++) { if (mask[i] & groupbit) { + + if (Tp_2D) { + dz = 0; + if (Tp_UNIFORM) { + dx = dt * (g1 * f[i][0] + g2 * (random->uniform()-0.5)); + dy = dt * (g1 * f[i][1] + g2 * (random->uniform()-0.5)); + + } else if (Tp_GAUSS) { + dx = dt * (g1 * f[i][0] + g2 * random->gaussian()); + dy = dt * (g1 * f[i][1] + g2 * random->gaussian()); + } else { + dx = dt * g1 * f[i][0]; + dy = dt * g1 * f[i][1]; + } + } else { + if (Tp_UNIFORM) { + dx = dt * (g1 * f[i][0] + g2 * (random->uniform()-0.5)); + dy = dt * (g1 * f[i][1] + g2 * (random->uniform()-0.5)); + dz = dt * (g1 * f[i][2] + g2 * (random->uniform()-0.5)); + } else if (Tp_GAUSS) { + dx = dt * (g1 * f[i][0] + g2 * random->gaussian()); + dy = dt * (g1 * f[i][1] + g2 * random->gaussian()); + dz = dt * (g1 * f[i][2] + g2 * random->gaussian()); + } else { + dx = dt * g1 * f[i][0]; + dy = dt * g1 * f[i][1]; + dz = dt * g1 * f[i][2]; + } + } - dx = dt * g1 * f[i][0]; x[i][0] += dx; v[i][0] = dx/dt; - dy = dt * g1 * f[i][1]; + x[i][1] += dy; v[i][1] = dy/dt; - dz = dt * g1 * f[i][2]; + x[i][2] += dz; v[i][2] = dz/dt; - + + } } - - return; } - -/* ---------------------------------------------------------------------- - apply random force, stolen from MISC/fix_efield.cpp -------------------------------------------------------------------------- */ - -void FixBrownian::post_force(int vflag) -{ - double **f = atom->f; - double **x = atom->x; - int *mask = atom->mask; - imageint *image = atom->image; - int nlocal = atom->nlocal; - - // virial setup - - if (vflag) v_setup(vflag); - else evflag = 0; - - double fx,fy,fz; - double v[6]; - - for (int i = 0; i < nlocal; i++) - if (mask[i] & groupbit) { - - fx = g2 * (random->*rng_func)()/sqrtdt; - fy = g2 * (random->*rng_func)()/sqrtdt; - fz = g2 * (random->*rng_func)()/sqrtdt; - f[i][0] += fx; - f[i][1] += fy; - f[i][2] += fz; - - if (evflag) { - v[0] = fx*x[i][0]; - v[1] = fy*x[i][1]; - v[2] = fz*x[i][2]; - v[3] = fx*x[i][1]; - v[4] = fx*x[i][2]; - v[5] = fy*x[i][2]; - v_tally(i, v); - } - } -} - -void FixBrownian::reset_dt() -{ - - dt = update->dt; - sqrtdt = sqrt(dt); -} diff --git a/src/USER-BROWNIAN/fix_brownian.h b/src/USER-BROWNIAN/fix_brownian.h index fb56edb39e..7260eb15e3 100644 --- a/src/USER-BROWNIAN/fix_brownian.h +++ b/src/USER-BROWNIAN/fix_brownian.h @@ -20,38 +20,22 @@ FixStyle(brownian,FixBrownian) #ifndef LMP_FIX_BROWNIAN_H #define LMP_FIX_BROWNIAN_H -#include "fix.h" +#include "fix_brownian_base.h" namespace LAMMPS_NS { -class FixBrownian : public Fix { +class FixBrownian : public FixBrownianBase { public: FixBrownian(class LAMMPS *, int, char **); virtual ~FixBrownian(); void init(); void initial_integrate(int); - void setup(int); - void post_force(int); - int setmask(); - void reset_dt(); private: - int seed; // RNG seed - double dt, sqrtdt; // time step interval and its sqrt + template < int Tp_UNIFORM, int Tp_GAUSS, int Tp_2D > + void initial_integrate_templated(); - double gamma_t; // translational damping param - double diff_t; // translational diffusion coeff - - double g1,g2; // prefactors in time stepping - int noise_flag; // 0/1 for noise off/on - int gaussian_noise_flag; // 0/1 for uniform/gaussian noise - -protected: - class RanMars *random; - typedef double (RanMars::*rng_member)(); - rng_member rng_func; // placeholder for RNG function - }; } diff --git a/src/USER-BROWNIAN/fix_brownian_asphere.cpp b/src/USER-BROWNIAN/fix_brownian_asphere.cpp index 123a7a5f5f..98c201230a 100644 --- a/src/USER-BROWNIAN/fix_brownian_asphere.cpp +++ b/src/USER-BROWNIAN/fix_brownian_asphere.cpp @@ -36,104 +36,34 @@ using namespace LAMMPS_NS; using namespace FixConst; -#define SMALL 1e-14 - -enum{NODIPOLE,DIPOLE}; /* ---------------------------------------------------------------------- */ FixBrownianAsphere::FixBrownianAsphere(LAMMPS *lmp, int narg, char **arg) : - Fix(lmp, narg, arg) + FixBrownianBase(lmp, narg, arg) { - virial_flag = 1; - - time_integrate = 1; - - dipole_flag = NODIPOLE; - if (narg > 11 || narg < 8 ) - error->all(FLERR,"Illegal fix brownian/asphere command."); - - if (!atom->sphere_flag) - error->all(FLERR,"Fix brownian/asphere requires atom style sphere"); - - gamma_t = utils::numeric(FLERR,arg[3],false,lmp); - if (gamma_t <= 0.0) - error->all(FLERR,"Fix brownian/asphere translational viscous drag " - "coefficient must be > 0."); - - gamma_r = utils::numeric(FLERR,arg[4],false,lmp); - if (gamma_t <= 0.0) - error->all(FLERR,"Fix brownian/asphere rotational viscous drag " - "coefficient must be > 0."); - - - diff_t = utils::numeric(FLERR,arg[5],false,lmp); - if (diff_t <= 0.0) - error->all(FLERR,"Fix brownian/asphere translational diffusion " - "coefficient must be > 0."); - - diff_r = utils::numeric(FLERR,arg[6],false,lmp); - if (diff_r <= 0.0) - error->all(FLERR,"Fix brownian/asphere rotational diffusion " - "coefficient must be > 0."); - - seed = utils::inumeric(FLERR,arg[7],false,lmp); - if (seed <= 0) error->all(FLERR,"Fix brownian/asphere seed must be > 0."); - - noise_flag = 1; - gaussian_noise_flag = 0; - - int iarg = 8; - - while (iarg < narg) { - if (strcmp(arg[iarg],"rng") == 0) { - if (narg == iarg + 1) { - error->all(FLERR,"Illegal fix/brownian/asphere command."); - } - if (strcmp(arg[iarg + 1],"uniform") == 0) { - noise_flag = 1; - } else if (strcmp(arg[iarg + 1],"gaussian") == 0) { - noise_flag = 1; - gaussian_noise_flag = 1; - } else if (strcmp(arg[iarg + 1],"none") == 0) { - noise_flag = 0; - } else { - error->all(FLERR,"Illegal fix/brownian/asphere command."); - } - iarg = iarg + 2; - } else if (strcmp(arg[iarg],"dipole") == 0) { - dipole_flag = DIPOLE; - iarg = iarg + 1; - } else { - error->all(FLERR,"Illegal fix/brownian/asphere command."); - } + if (!gamma_t_eigen_flag || !gamma_r_eigen_flag) { + error->all(FLERR,"Illegal fix brownian command."); } + + if (gamma_t_flag || gamma_r_flag) { + error->all(FLERR,"Illegal fix brownian command."); + } + - if (dipole_flag == DIPOLE && !atom->mu_flag) + + if (dipole_flag && !atom->mu_flag) error->all(FLERR,"Fix brownian/asphere dipole requires atom attribute mu"); - // initialize Marsaglia RNG with processor-unique seed - random = new RanMars(lmp,seed + comm->me); - -} - -/* ---------------------------------------------------------------------- */ - -int FixBrownianAsphere::setmask() -{ - int mask = 0; - mask |= INITIAL_INTEGRATE; - mask |= POST_FORCE; - return mask; + } /* ---------------------------------------------------------------------- */ FixBrownianAsphere::~FixBrownianAsphere() { - delete random; } @@ -162,9 +92,8 @@ void FixBrownianAsphere::init() error->one(FLERR,"Fix brownian/asphere requires extended particles"); - if (dipole_flag == DIPOLE) { + if (dipole_flag) { - double f_act[3] = { 1.0, 0.0, 0.0 }; double f_rot[3]; double *quat; int *ellipsoid = atom->ellipsoid; @@ -178,7 +107,7 @@ void FixBrownianAsphere::init() if (mask[i] & groupbit) { quat = bonus[ellipsoid[i]].quat; MathExtra::quat_to_mat( quat, Q ); - MathExtra::matvec( Q, f_act, f_rot ); + MathExtra::matvec( Q, dipole_body, f_rot ); mu[i][0] = f_rot[0]; mu[i][1] = f_rot[1]; @@ -188,205 +117,243 @@ void FixBrownianAsphere::init() } } - g1 = force->ftm2v/gamma_t; - g3 = force->ftm2v/gamma_r; - if (noise_flag == 0) { - g2 = 0; - g4 = 0; - rng_func = &RanMars::zero_rng; - } else if (gaussian_noise_flag == 1) { - g2 = gamma_t*sqrt(2 * diff_t)/force->ftm2v; - g4 = gamma_r*sqrt(2 * diff_r)/force->ftm2v; - rng_func = &RanMars::gaussian; - } else { - g2 = gamma_t*sqrt( 24 * diff_t)/force->ftm2v; - g4 = gamma_r*sqrt( 24 * diff_r )/force->ftm2v; - rng_func = &RanMars::uniform_middle; - } + FixBrownianBase::init(); - dt = update->dt; - sqrtdt = sqrt(dt); -} -void FixBrownianAsphere::setup(int vflag) -{ - post_force(vflag); } /* ---------------------------------------------------------------------- */ +void FixBrownianAsphere::initial_integrate(int /*vflag */) +{ -void FixBrownianAsphere::initial_integrate(int /* vflag */) + if (domain->dimension == 2) { + if (dipole_flag) { + if (!noise_flag) { + initial_integrate_templated<0,0,1,1>(); + } else if (gaussian_noise_flag) { + initial_integrate_templated<0,1,1,1>(); + } else { + initial_integrate_templated<1,0,1,1>(); + } + } else { + if (!noise_flag) { + initial_integrate_templated<0,0,0,1>(); + } else if (gaussian_noise_flag) { + initial_integrate_templated<0,1,0,1>(); + } else { + initial_integrate_templated<1,0,0,1>(); + } + } + } else { + if (dipole_flag) { + if (!noise_flag) { + initial_integrate_templated<0,0,1,0>(); + } else if (gaussian_noise_flag) { + initial_integrate_templated<0,1,1,0>(); + } else { + initial_integrate_templated<1,0,1,0>(); + } + } else { + if (!noise_flag) { + initial_integrate_templated<0,0,0,0>(); + } else if (gaussian_noise_flag) { + initial_integrate_templated<0,1,0,0>(); + } else { + initial_integrate_templated<1,0,0,0>(); + } + } + } + return; +} + +/* ---------------------------------------------------------------------- */ + +template < int Tp_UNIFORM, int Tp_GAUSS, int Tp_DIPOLE, int Tp_2D > +void FixBrownianAsphere::initial_integrate_templated() { double **x = atom->x; double **v = atom->v; double **f = atom->f; - double **omega = atom->omega; - double **torque = atom->torque; int *mask = atom->mask; int nlocal = atom->nlocal; + + AtomVecEllipsoid::Bonus *bonus = avec->bonus; + + + double **mu = atom->mu; + double **torque = atom->torque; + + double qw[4]; + + double *quat; + int *ellipsoid = atom->ellipsoid; if (igroup == atom->firstgroup) nlocal = atom->nfirst; - int d3rot; // whether to compute angular momentum in xy plane + + + // project dipole along x axis of quat + double f_rot[3]; - if (domain->dimension==2) { - d3rot = 0; - } else { - d3rot = 1; - } - - if (dipole_flag == DIPOLE) { - - // if dipole is being tracked, then update it along with - // quaternions accordingly along with angular velocity - - double wq[4]; + double rotationmatrix_transpose[3][3]; - double *quat; - int *ellipsoid = atom->ellipsoid; - AtomVecEllipsoid::Bonus *bonus = avec->bonus; - - // project dipole along x axis of quat - double f_act[3] = { 1.0, 0.0, 0.0 }; - double f_rot[3]; + double tmp[3]; + double dv[3]; + + for (int i = 0; i < nlocal; i++) { + if (mask[i] & groupbit) { + + // update orientation first + + quat = bonus[ellipsoid[i]].quat; + + MathExtra::quat_to_mat_trans( quat, rotationmatrix_transpose ); + + // tmp holds angular velocity in body frame + MathExtra::matvec(rotationmatrix_transpose,torque[i],tmp); - double Q[3][3]; - - double **mu = atom->mu; - - - for (int i = 0; i < nlocal; i++) { - if (mask[i] & groupbit) { + if (Tp_2D) { + tmp[0] = tmp[1] = 0.0; + if (Tp_UNIFORM) { + tmp[2] = g1*tmp[2]*gamma_r_inv[2] + gamma_r_invsqrt[2]*(random->uniform()-0.5)*g2; + + } else if (Tp_GAUSS) { + tmp[2] = g1*tmp[2]*gamma_r_inv[2] + gamma_r_invsqrt[2]*random->gaussian()*g2; - update_x_and_omega(x[i],v[i],omega[i],f[i],torque[i],d3rot); + } else { + tmp[2] = g1*tmp[2]*gamma_r_inv[2]; + + } + } else { + if (Tp_UNIFORM) { + + tmp[0] = g1*tmp[0]*gamma_r_inv[0] + gamma_r_invsqrt[0]*(random->uniform()-0.5)*g2; + tmp[1] = g1*tmp[1]*gamma_r_inv[1] + gamma_r_invsqrt[1]*(random->uniform()-0.5)*g2; + tmp[2] = g1*tmp[2]*gamma_r_inv[2] + gamma_r_invsqrt[2]*(random->uniform()-0.5)*g2; + + } else if (Tp_GAUSS) { + + tmp[0] = g1*tmp[0]*gamma_r_inv[0] + gamma_r_invsqrt[0]*random->gaussian()*g2; + tmp[1] = g1*tmp[1]*gamma_r_inv[1] + gamma_r_invsqrt[1]*random->gaussian()*g2; + tmp[2] = g1*tmp[2]*gamma_r_inv[2] + gamma_r_invsqrt[2]*random->gaussian()*g2; + + } else { + tmp[0] = g1*tmp[0]*gamma_r_inv[0]; + tmp[1] = g1*tmp[1]*gamma_r_inv[1]; + tmp[2] = g1*tmp[2]*gamma_r_inv[2]; + + } + } + + // convert body frame angular velocity to quaternion + MathExtra::quatvec(quat,tmp,qw); + quat[0] = quat[0] + 0.5*dt*qw[0]; + quat[1] = quat[1] + 0.5*dt*qw[1]; + quat[2] = quat[2] + 0.5*dt*qw[2]; + quat[3] = quat[3] + 0.5*dt*qw[3]; + + // normalisation introduces the stochastic drift term + // to recover the Boltzmann distribution for the case of conservative torques + MathExtra::qnormalize(quat); + + // next, update centre of mass positions and velocities + + // tmp now holds force in body frame + MathExtra::matvec(rotationmatrix_transpose,f[i],tmp); + // and then converts to gamma_t^{-1} * F (velocity) in body frame - quat = bonus[ellipsoid[i]].quat; + if (Tp_2D) { + tmp[2] = 0.0; + if (Tp_UNIFORM) { + tmp[0] = g1*tmp[0]*gamma_t_inv[0] + + gamma_t_invsqrt[0]*(random->uniform()-0.5)*g2; + tmp[1] = g1*tmp[1]*gamma_t_inv[1] + + gamma_t_invsqrt[1]*(random->uniform()-0.5)*g2; + + } else if (Tp_GAUSS) { + tmp[0] = g1*tmp[0]*gamma_t_inv[0] + + gamma_t_invsqrt[0]*random->gaussian()*g2; + tmp[1] = g1*tmp[1]*gamma_t_inv[1] + + gamma_t_invsqrt[1]*random->gaussian()*g2; + + } else { + tmp[0] = g1*tmp[0]*gamma_t_inv[0]; + tmp[1] = g1*tmp[1]*gamma_t_inv[1]; + + } + } else { + if (Tp_UNIFORM) { + + tmp[0] = g1*tmp[0]*gamma_t_inv[0] + + gamma_t_invsqrt[0]*(random->uniform()-0.5)*g2; + tmp[1] = g1*tmp[1]*gamma_t_inv[1] + + gamma_t_invsqrt[1]*(random->uniform()-0.5)*g2; + tmp[2] = g1*tmp[2]*gamma_t_inv[2] + + gamma_t_invsqrt[2]*(random->uniform()-0.5)*g2; + + } else if (Tp_GAUSS) { + + tmp[0] = g1*tmp[0]*gamma_t_inv[0] + + gamma_t_invsqrt[0]*random->gaussian()*g2; + tmp[1] = g1*tmp[1]*gamma_t_inv[1] + + gamma_t_invsqrt[1]*random->gaussian()*g2; + tmp[2] = g1*tmp[2]*gamma_t_inv[2] + + gamma_t_invsqrt[2]*random->gaussian()*g2; + + + } else { + + tmp[0] = g1*tmp[0]*gamma_t_inv[0]; + tmp[1] = g1*tmp[1]*gamma_t_inv[1]; + tmp[2] = g1*tmp[2]*gamma_t_inv[2]; + } + } + + + + // finally, convert this back to lab-frame velocity and store in dv + MathExtra::transpose_matvec(rotationmatrix_transpose, tmp, dv ); + + + /* + if (Tp_UNIFORM) { + dv[0] = dt * (g1 * f[i][0] + g2 * (random->uniform()-0.5)); + dv[1] = dt * (g1 * f[i][1] + g2 * (random->uniform()-0.5)); + dv[2] = dt * (g1 * f[i][2] + g2 * (random->uniform()-0.5)); - MathExtra::vecquat(omega[i],quat,wq); + } else if (Tp_GAUSS) { + dv[0] = dt * (g1 * f[i][0] + g2 * random->gaussian()); + dv[1] = dt * (g1 * f[i][1] + g2 * random->gaussian()); + dv[2] = dt * (g1 * f[i][2] + g2 * random->gaussian()); + + } else { + dv[0] = dt * g1 * f[i][0]; + dv[1] = dt * g1 * f[i][1]; + dv[2] = dt * g1 * f[i][2]; + + } + */ + v[i][0] = dv[0]; + v[i][1] = dv[1]; + v[i][2] = dv[2]; + + x[i][0] += dv[0]*dt; + x[i][1] += dv[1]*dt; + x[i][2] += dv[2]*dt; + + if (Tp_DIPOLE) { + + MathExtra::quat_to_mat_trans( quat, rotationmatrix_transpose ); + MathExtra::transpose_matvec(rotationmatrix_transpose, dipole_body, f_rot ); - quat[0] = quat[0] + 0.5*dt*wq[0]; - quat[1] = quat[1] + 0.5*dt*wq[1]; - quat[2] = quat[2] + 0.5*dt*wq[2]; - quat[3] = quat[3] + 0.5*dt*wq[3]; - MathExtra::qnormalize(quat); - - MathExtra::quat_to_mat( quat, Q ); - MathExtra::matvec( Q, f_act, f_rot ); - mu[i][0] = f_rot[0]; mu[i][1] = f_rot[1]; mu[i][2] = f_rot[2]; - } } - } else { - - // if no dipole, just update quaternions and - // angular velocity - - - double wq[4]; - - double *quat; - int *ellipsoid = atom->ellipsoid; - AtomVecEllipsoid::Bonus *bonus = avec->bonus; - for (int i = 0; i < nlocal; i++) { - if (mask[i] & groupbit) { - - update_x_and_omega(x[i],v[i],omega[i],f[i],torque[i],d3rot); - - quat = bonus[ellipsoid[i]].quat; - - MathExtra::vecquat(omega[i],quat,wq); - - quat[0] = quat[0] + 0.5*dt*wq[0]; - quat[1] = quat[1] + 0.5*dt*wq[1]; - quat[2] = quat[2] + 0.5*dt*wq[2]; - quat[3] = quat[3] + 0.5*dt*wq[3]; - MathExtra::qnormalize(quat); - - } - } } - return; -} - -void FixBrownianAsphere::update_x_and_omega(double *x, double *v, double *omega, - double *f, double *torque, int d3rot) -{ - double dx, dy, dz; - - dx = dt * g1 * f[0]; - x[0] += dx; - v[0] = dx/dt; - - dy = dt * g1 * f[1]; - x[1] += dy; - v[1] = dy/dt; - - dz = dt * g1 * f[2]; - x[2] += dz; - v[2] = dz/dt; - - omega[0] = d3rot * g3* torque[0]; - omega[1] = d3rot * g3* torque[1]; - omega[2] = g3* torque[2]; return; } - -/* ---------------------------------------------------------------------- - apply random force, stolen from MISC/fix_efield.cpp -------------------------------------------------------------------------- */ - -void FixBrownianAsphere::post_force(int vflag) -{ - double **f = atom->f; - double **x = atom->x; - double **torque = atom->torque; - int *mask = atom->mask; - imageint *image = atom->image; - int nlocal = atom->nlocal; - - // virial setup - - if (vflag) v_setup(vflag); - else evflag = 0; - - double fx,fy,fz; - double v[6]; - - for (int i = 0; i < nlocal; i++) - if (mask[i] & groupbit) { - - fx = g2 * (random->*rng_func)()/sqrtdt; - fy = g2 * (random->*rng_func)()/sqrtdt; - fz = g2 * (random->*rng_func)()/sqrtdt; - f[i][0] += fx; - f[i][1] += fy; - f[i][2] += fz; - - torque[i][0] = g4*(random->*rng_func)()/sqrtdt; - torque[i][1] = g4*(random->*rng_func)()/sqrtdt; - torque[i][2] = g4*(random->*rng_func)()/sqrtdt; - - if (evflag) { - v[0] = fx*x[i][0]; - v[1] = fy*x[i][1]; - v[2] = fz*x[i][2]; - v[3] = fx*x[i][1]; - v[4] = fx*x[i][2]; - v[5] = fy*x[i][2]; - v_tally(i, v); - } - } -} - -void FixBrownianAsphere::reset_dt() -{ - - dt = update->dt; - sqrtdt = sqrt(dt); -} diff --git a/src/USER-BROWNIAN/fix_brownian_asphere.h b/src/USER-BROWNIAN/fix_brownian_asphere.h index 31ccf4fc8b..c229ff1c8b 100644 --- a/src/USER-BROWNIAN/fix_brownian_asphere.h +++ b/src/USER-BROWNIAN/fix_brownian_asphere.h @@ -20,44 +20,29 @@ FixStyle(brownian/asphere,FixBrownianAsphere) #ifndef LMP_FIX_BROWNIAN_ASPHERE_H #define LMP_FIX_BROWNIAN_ASPHERE_H -#include "fix.h" +#include "fix_brownian_base.h" namespace LAMMPS_NS { -class FixBrownianAsphere : public Fix { +class FixBrownianAsphere : public FixBrownianBase { public: FixBrownianAsphere(class LAMMPS *, int, char **); virtual ~FixBrownianAsphere(); - void init(); void initial_integrate(int); - void setup(int); - void post_force(int); - int setmask(); - void reset_dt(); - void update_x_and_omega(double *, double *, double *, - double *, double *, int ); + void init(); - private: - int seed; // RNG seed - int dipole_flag; // set if dipole is used - double dt, sqrtdt; // time step interval and its sqrt - - - double gamma_t,gamma_r; // translational and rotational damping params - double diff_t,diff_r; // translational and rotational diffusion coeffs - - double g1,g2, g3, g4; // prefactors in time stepping - int noise_flag; // 0/1 for noise off/on - int gaussian_noise_flag; // 0/1 for uniform/gaussian noise - + protected: class AtomVecEllipsoid *avec; -protected: - class RanMars *random; - typedef double (RanMars::*rng_member)(); - rng_member rng_func; // placeholder for RNG function + private: + template < int Tp_UNIFORM, int Tp_GAUSS, int Tp_DIPOLE, int Tp_2D > + void initial_integrate_templated(); + + + + }; } diff --git a/src/USER-BROWNIAN/fix_brownian_base.cpp b/src/USER-BROWNIAN/fix_brownian_base.cpp new file mode 100644 index 0000000000..1a571c7a74 --- /dev/null +++ b/src/USER-BROWNIAN/fix_brownian_base.cpp @@ -0,0 +1,250 @@ +/* ---------------------------------------------------------------------- + LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator + http://lammps.sandia.gov, Sandia National Laboratories + Steve Plimpton, sjplimp@sandia.gov + + Copyright (2003) Sandia Corporation. Under the terms of Contract + DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains + certain rights in this software. This software is distributed under + the GNU General Public License. + + See the README file in the top-level LAMMPS directory. +------------------------------------------------------------------------- */ + +/* ---------------------------------------------------------------------- + Originally modified from USER-CGDNA/fix_nve_dotc_langevin.cpp. + + Contributing author: Sam Cameron (University of Bristol) +------------------------------------------------------------------------- */ + +#include "fix_brownian.h" + +#include +#include +#include "math_extra.h" +#include "atom.h" +#include "force.h" +#include "update.h" +#include "comm.h" +#include "domain.h" +#include "random_mars.h" +#include "memory.h" +#include "error.h" + + +using namespace LAMMPS_NS; +using namespace FixConst; + +/* ---------------------------------------------------------------------- */ + +FixBrownianBase::FixBrownianBase(LAMMPS *lmp, int narg, char **arg) : + Fix(lmp, narg, arg) +{ + + time_integrate = 1; + + noise_flag = 1; + gaussian_noise_flag = 0; + gamma_t_flag = gamma_r_flag = 0; + gamma_t_eigen_flag = gamma_r_eigen_flag = 0; + dipole_flag = 0; + + if (narg < 5) + error->all(FLERR,"Illegal fix brownian command."); + + temp = utils::numeric(FLERR,arg[3],false,lmp); + if (temp <= 0) error->all(FLERR,"Fix brownian temp must be > 0."); + + seed = utils::inumeric(FLERR,arg[4],false,lmp); + if (seed <= 0) error->all(FLERR,"Fix brownian seed must be > 0."); + + + int iarg = 5; + while (iarg < narg) { + if (strcmp(arg[iarg],"rng") == 0) { + if (narg == iarg + 1) { + error->all(FLERR,"Illegal fix brownian command."); + } + if (strcmp(arg[iarg + 1],"uniform") == 0) { + noise_flag = 1; + } else if (strcmp(arg[iarg + 1],"gaussian") == 0) { + noise_flag = 1; + gaussian_noise_flag = 1; + } else if (strcmp(arg[iarg + 1],"none") == 0) { + noise_flag = 0; + } else { + error->all(FLERR,"Illegal fix brownian command."); + } + iarg = iarg + 2; + } else if (strcmp(arg[iarg],"dipole") == 0) { + if (narg == iarg + 3) { + error->all(FLERR,"Illegal fix brownian command."); + } + + dipole_flag = 1; + dipole_body = new double[3]; + + dipole_body[0] = utils::numeric(FLERR,arg[iarg+1],false,lmp); + dipole_body[1] = utils::numeric(FLERR,arg[iarg+2],false,lmp); + dipole_body[2] = utils::numeric(FLERR,arg[iarg+3],false,lmp); + iarg = iarg + 4; + + } else if (strcmp(arg[iarg],"gamma_t_eigen") == 0) { + if (narg == iarg + 3) { + error->all(FLERR,"Illegal fix brownian command."); + } + + gamma_t_eigen_flag = 1; + gamma_t_inv = new double[3]; + gamma_t_invsqrt = new double[3]; + gamma_t_inv[0] = 1./utils::numeric(FLERR,arg[iarg+1],false,lmp); + gamma_t_inv[1] = 1./utils::numeric(FLERR,arg[iarg+2],false,lmp); + + if (domain->dimension == 2) { + if (strcmp(arg[iarg+3],"inf") != 0) { + error->all(FLERR,"Fix brownian gamma_t_eigen third value must be inf for 2D system."); + } + gamma_t_inv[2] = 0; + } else { + gamma_t_inv[2] = 1./utils::numeric(FLERR,arg[iarg+3],false,lmp); + } + + if (gamma_t_inv[0] < 0 || gamma_t_inv[1] < 0 || gamma_t_inv[2] < 0) + error->all(FLERR,"Fix brownian gamma_t_eigen values must be > 0."); + + gamma_t_invsqrt[0] = sqrt(gamma_t_inv[0]); + gamma_t_invsqrt[1] = sqrt(gamma_t_inv[1]); + gamma_t_invsqrt[2] = sqrt(gamma_t_inv[2]); + iarg = iarg + 4; + + } else if (strcmp(arg[iarg],"gamma_r_eigen") == 0) { + if (narg == iarg + 3) { + error->all(FLERR,"Illegal fix brownian command."); + } + + gamma_r_eigen_flag = 1; + gamma_r_inv = new double[3]; + gamma_r_invsqrt = new double[3]; + + + if (domain->dimension == 2) { + if (strcmp(arg[iarg+1],"inf") != 0) { + error->all(FLERR,"Fix brownian gamma_r_eigen first value must be inf for 2D system."); + } + gamma_r_inv[0] = 0; + + if (strcmp(arg[iarg+2],"inf") != 0) { + error->all(FLERR,"Fix brownian gamma_r_eigen second value must be inf for 2D system."); + } + gamma_r_inv[1] = 0; + } else { + + gamma_r_inv[0] = 1./utils::numeric(FLERR,arg[iarg+1],false,lmp); + gamma_r_inv[1] = 1./utils::numeric(FLERR,arg[iarg+2],false,lmp); + + } + + gamma_r_inv[2] = 1./utils::numeric(FLERR,arg[iarg+3],false,lmp); + + if (gamma_r_inv[0] < 0 || gamma_r_inv[1] < 0 || gamma_r_inv[2] < 0) + error->all(FLERR,"Fix brownian gamma_r_eigen values must be > 0."); + + gamma_r_invsqrt[0] = sqrt(gamma_r_inv[0]); + gamma_r_invsqrt[1] = sqrt(gamma_r_inv[1]); + gamma_r_invsqrt[2] = sqrt(gamma_r_inv[2]); + iarg = iarg + 4; + + } else if (strcmp(arg[iarg],"gamma_t") == 0) { + if (narg == iarg + 1) { + error->all(FLERR,"Illegal fix brownian command."); + } + + gamma_t_flag = 1; + gamma_t = utils::numeric(FLERR,arg[iarg+1],false,lmp); + if (gamma_t <= 0) + error->all(FLERR,"Fix brownian gamma_t must be > 0."); + iarg = iarg + 2; + + } else if (strcmp(arg[iarg],"gamma_r") == 0) { + if (narg == iarg + 1) { + error->all(FLERR,"Illegal fix brownian command."); + } + + gamma_r_flag = 1; + gamma_r = utils::numeric(FLERR,arg[iarg+1],false,lmp); + if (gamma_r <= 0) + error->all(FLERR,"Fix brownian gamma_r must be > 0."); + iarg = iarg + 2; + + } else { + error->all(FLERR,"Illegal fix brownian command."); + } + } + + // initialize Marsaglia RNG with processor-unique seed + random = new RanMars(lmp,seed + comm->me); + +} + +/* ---------------------------------------------------------------------- */ + +int FixBrownianBase::setmask() +{ + int mask = 0; + mask |= INITIAL_INTEGRATE; + return mask; +} + +/* ---------------------------------------------------------------------- */ + +FixBrownianBase::~FixBrownianBase() +{ + + if (gamma_t_eigen_flag) { + delete [] gamma_t_inv; + delete [] gamma_t_invsqrt; + } + if (gamma_r_eigen_flag) { + delete [] gamma_r_inv; + delete [] gamma_r_invsqrt; + } + + if (dipole_flag) { + delete [] dipole_body; + } + + + delete random; +} + + + +/* ---------------------------------------------------------------------- */ + +void FixBrownianBase::init() +{ + dt = update->dt; + sqrtdt = sqrt(dt); + + g1 = force->ftm2v; + if (noise_flag == 0) { + g2 = 0; + } else if (gaussian_noise_flag == 1) { + g2 = sqrt(2 * force->boltz*temp/dt/force->mvv2e); + } else { + g2 = sqrt( 24 * force->boltz*temp/dt/force->mvv2e); + } + + +} + + + +void FixBrownianBase::reset_dt() +{ + double sqrtdt_old = sqrtdt; + dt = update->dt; + sqrtdt = sqrt(dt); + g2 *= sqrtdt_old/sqrtdt; + +} diff --git a/src/USER-BROWNIAN/fix_brownian_base.h b/src/USER-BROWNIAN/fix_brownian_base.h new file mode 100644 index 0000000000..356742f314 --- /dev/null +++ b/src/USER-BROWNIAN/fix_brownian_base.h @@ -0,0 +1,100 @@ +/* -*- c++ -*- ---------------------------------------------------------- + LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator + http://lammps.sandia.gov, Sandia National Laboratories + Steve Plimpton, sjplimp@sandia.gov + + Copyright (2003) Sandia Corporation. Under the terms of Contract + DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains + certain rights in this software. This software is distributed under + the GNU General Public License. + + See the README file in the top-level LAMMPS directory. +------------------------------------------------------------------------- */ + + +#ifndef LMP_FIX_BROWNIAN_BASE_H +#define LMP_FIX_BROWNIAN_BASE_H + +#include "fix.h" + +namespace LAMMPS_NS { + + +class FixBrownianBase : public Fix { + public: + FixBrownianBase(class LAMMPS *, int, char **); + virtual ~FixBrownianBase(); + void init(); + int setmask(); + void reset_dt(); + + protected: + int seed; // RNG seed + double dt, sqrtdt; // time step interval and its sqrt + + int gamma_t_flag; // 0/1 if isotropic translational damping is unset/set + int gamma_r_flag; // 0/1 if isotropic rotational damping is unset/set + double gamma_t,gamma_r; // translational and rotational (isotropic) damping params + + + int gamma_t_eigen_flag; // 0/1 if anisotropic translational damping is unset/set + int gamma_r_eigen_flag; // 0/1 if anisotropic rotational damping is unset/set + + double *gamma_t_inv; // anisotropic damping parameter eigenvalues + double *gamma_r_inv; + double *gamma_t_invsqrt; + double *gamma_r_invsqrt; + + + int dipole_flag; // set if dipole is used for asphere + double *dipole_body; // direction dipole is slaved to in body frame + + int noise_flag; // 0/1 for noise off/on + int gaussian_noise_flag; // 0/1 for uniform/gaussian noise + + double temp; // temperature + + + + double g1,g2; // prefactors in time stepping + + + class RanMars *random; + + +}; + +} +#endif + +/* ERROR/WARNING messages: + +E: Illegal fix brownian command. + +Wrong number/type of input arguments. + +E: Fix brownian gamma_t_eigen values must be > 0. + +Self-explanatory. + +E: Fix brownian gamma_r_eigen values must be > 0. + +Self-explanatory. + +E: Fix brownian seed must be > 0. + +Self-explanatory. + +E: Fix brownian temp must be > 0. + +Self-explanatory. + +E: Fix brownian gamma_t must be > 0. + +Self-explanatory. + +E: Fix brownian gamma_r must be > 0. + +Self-explanatory. + +*/ diff --git a/src/USER-BROWNIAN/fix_brownian_sphere.cpp b/src/USER-BROWNIAN/fix_brownian_sphere.cpp index c3e0cd2457..a01eaac719 100644 --- a/src/USER-BROWNIAN/fix_brownian_sphere.cpp +++ b/src/USER-BROWNIAN/fix_brownian_sphere.cpp @@ -35,103 +35,34 @@ using namespace LAMMPS_NS; using namespace FixConst; -#define SMALL 1e-14 -enum{NONE,DIPOLE}; /* ---------------------------------------------------------------------- */ FixBrownianSphere::FixBrownianSphere(LAMMPS *lmp, int narg, char **arg) : - Fix(lmp, narg, arg) + FixBrownianBase(lmp, narg, arg) { - virial_flag = 1; - time_integrate = 1; - - extra = NONE; - - if (narg > 11 || narg < 8 ) - error->all(FLERR,"Illegal fix brownian/sphere command."); - - if (!atom->sphere_flag) - error->all(FLERR,"Fix brownian/sphere requires atom style sphere"); - - gamma_t = utils::numeric(FLERR,arg[3],false,lmp); - if (gamma_t <= 0.0) - error->all(FLERR,"Fix brownian/sphere translational viscous drag " - "coefficient must be > 0."); - - gamma_r = utils::numeric(FLERR,arg[4],false,lmp); - if (gamma_t <= 0.0) - error->all(FLERR,"Fix brownian/sphere rotational viscous drag " - "coefficient must be > 0."); - - - diff_t = utils::numeric(FLERR,arg[5],false,lmp); - if (diff_t <= 0.0) - error->all(FLERR,"Fix brownian/sphere translational diffusion " - "coefficient must be > 0."); - - diff_r = utils::numeric(FLERR,arg[6],false,lmp); - if (diff_r <= 0.0) - error->all(FLERR,"Fix brownian/sphere rotational diffusion " - "coefficient must be > 0."); - - seed = utils::inumeric(FLERR,arg[7],false,lmp); - if (seed <= 0) error->all(FLERR,"Fix brownian/sphere seed must be > 0."); - - noise_flag = 1; - gaussian_noise_flag = 0; - - int iarg = 8; - - while (iarg < narg) { - if (strcmp(arg[iarg],"rng") == 0) { - if (narg == iarg + 1) { - error->all(FLERR,"Illegal fix/brownian/sphere command."); - } - if (strcmp(arg[iarg + 1],"uniform") == 0) { - noise_flag = 1; - } else if (strcmp(arg[iarg + 1],"gaussian") == 0) { - noise_flag = 1; - gaussian_noise_flag = 1; - } else if (strcmp(arg[iarg + 1],"none") == 0) { - noise_flag = 0; - } else { - error->all(FLERR,"Illegal fix/brownian/sphere command."); - } - iarg = iarg + 2; - } else if (strcmp(arg[iarg],"dipole") == 0) { - extra = DIPOLE; - iarg = iarg + 1; - } else { - error->all(FLERR,"Illegal fix/brownian/sphere command."); - } + if (gamma_t_eigen_flag || gamma_r_eigen_flag) { + error->all(FLERR,"Illegal fix brownian command."); } + + if (!gamma_t_flag || !gamma_r_flag) { + error->all(FLERR,"Illegal fix brownian command."); + } + - if (extra == DIPOLE && !atom->mu_flag) - error->all(FLERR,"Fix brownian/sphere update dipole requires atom attribute mu"); - - // initialize Marsaglia RNG with processor-unique seed - random = new RanMars(lmp,seed + comm->me); + if (!atom->mu_flag) + error->all(FLERR,"Fix brownian/sphere requires atom attribute mu"); + } -/* ---------------------------------------------------------------------- */ - -int FixBrownianSphere::setmask() -{ - int mask = 0; - mask |= INITIAL_INTEGRATE; - mask |= POST_FORCE; - return mask; -} /* ---------------------------------------------------------------------- */ FixBrownianSphere::~FixBrownianSphere() { - delete random; } @@ -140,182 +71,162 @@ FixBrownianSphere::~FixBrownianSphere() void FixBrownianSphere::init() { + + FixBrownianBase::init(); - g1 = force->ftm2v/gamma_t; - g3 = force->ftm2v/gamma_r; - if (noise_flag == 0) { - g2 = 0; - g4 = 0; - rng_func = &RanMars::zero_rng; - } else if (gaussian_noise_flag == 1) { - g2 = gamma_t*sqrt(2 * diff_t)/force->ftm2v; - g4 = gamma_r*sqrt(2 * diff_r)/force->ftm2v; - rng_func = &RanMars::gaussian; - } else { - g2 = gamma_t*sqrt( 24 * diff_t)/force->ftm2v; - g4 = gamma_r*sqrt( 24 * diff_r )/force->ftm2v; - rng_func = &RanMars::uniform_middle; - } + g3 = g1/gamma_r; + g4 = g2/sqrt(gamma_r); + + g1 /= gamma_t; + g2 /= sqrt(gamma_t); - dt = update->dt; - sqrtdt = sqrt(dt); -} -void FixBrownianSphere::setup(int vflag) -{ - post_force(vflag); } /* ---------------------------------------------------------------------- */ -void FixBrownianSphere::initial_integrate(int /* vflag */) +void FixBrownianSphere::initial_integrate(int /*vflag */) { - double **x = atom->x; - double **v = atom->v; - double **f = atom->f; - double **omega = atom->omega; - double **torque = atom->torque; - int *mask = atom->mask; - int nlocal = atom->nlocal; - double dx,dy,dz; - - if (igroup == atom->firstgroup) nlocal = atom->nfirst; - int d3rot; // whether to compute angular momentum in xy plane + if (domain->dimension == 2) { - if (domain->dimension==2) { - d3rot = 0; - } else { - d3rot = 1; - } - - for (int i = 0; i < nlocal; i++) { - if (mask[i] & groupbit) { - - dx = dt * g1 * f[i][0]; - x[i][0] += dx; - v[i][0] = dx/dt; - - dy = dt * g1 * f[i][1]; - x[i][1] += dy; - v[i][1] = dy/dt; - - dz = dt * g1 * f[i][2]; - x[i][2] += dz; - v[i][2] = dz/dt; - - omega[i][0] = d3rot * g3* torque[i][0]; - omega[i][1] = d3rot * g3* torque[i][1]; - omega[i][2] = g3* torque[i][2]; - + if (!noise_flag) { + initial_integrate_templated<0,0,1>(); + } else if (gaussian_noise_flag) { + initial_integrate_templated<0,1,1>(); + } else { + initial_integrate_templated<1,0,1>(); } - } - - if (extra == DIPOLE) { - - double **mu = atom->mu; - double dtheta; - double mux,muy,muz,mu_tmp,wx,wy,wz; - double prefac_1, prefac_2; - - for (int i = 0; i < nlocal; i++) { - if (mask[i] & groupbit) { - - dtheta = sqrt((omega[i][0]*dt)*(omega[i][0]*dt) - +(omega[i][1]*dt)*(omega[i][1]*dt) - +(omega[i][2]*dt)*(omega[i][2]*dt)); - - - if (fabs(dtheta) < SMALL) { - prefac_1 = dt; - prefac_2 = 0.5*dt*dt; - } else { - prefac_1 = dt*sin(dtheta)/dtheta; - prefac_2 = dt*dt*(1-cos(dtheta))/(dtheta*dtheta); - } - - mux = mu[i][0]; - muy = mu[i][1]; - muz = mu[i][2]; - - wx = omega[i][0]; - wy = omega[i][1]; - wz = omega[i][2]; - - mu[i][0] = (mux + prefac_1 * ( -wz*muy + wy*muz ) - + prefac_2 * ( -1*( wz*wz + wy*wy ) * mux - + ( wz*muz + wy*muy ) * wx)); - - mu[i][1] = (muy + prefac_1 * ( wz*mux - wx*muz ) - + prefac_2 * ( -1*(wz*wz + wx*wx) * muy - + ( wz*muz + wx*mux ) * wy)); - - mu[i][2] = (muz + prefac_1 * ( -wy*mux + wx*muy ) - + prefac_2 * ( -1*( wx*wx + wy*wy ) * muz - + ( wy*muy + wx*mux ) * wz)); - - mu_tmp = sqrt(mu[i][0]*mu[i][0]+mu[i][1]*mu[i][1]+mu[i][2]*mu[i][2]); - - mu[i][0] = mu[i][0]/mu_tmp; - mu[i][1] = mu[i][1]/mu_tmp; - mu[i][2] = mu[i][2]/mu_tmp; - } + } else { + if (!noise_flag) { + initial_integrate_templated<0,0,0>(); + } else if (gaussian_noise_flag) { + initial_integrate_templated<0,1,0>(); + } else { + initial_integrate_templated<1,0,0>(); } } return; } -/* ---------------------------------------------------------------------- - apply random force, stolen from MISC/fix_efield.cpp -------------------------------------------------------------------------- */ -void FixBrownianSphere::post_force(int vflag) +/* ---------------------------------------------------------------------- */ + +template < int Tp_UNIFORM, int Tp_GAUSS, int Tp_2D > +void FixBrownianSphere::initial_integrate_templated() { - double **f = atom->f; double **x = atom->x; - double **torque = atom->torque; + double **v = atom->v; + double **f = atom->f; int *mask = atom->mask; - imageint *image = atom->image; int nlocal = atom->nlocal; + double wx,wy,wz; + double **torque = atom->torque; + double **mu = atom->mu; + double mux,muy,muz,mulen; - // virial setup - - if (vflag) v_setup(vflag); - else evflag = 0; - - double fx,fy,fz; - double v[6]; - - for (int i = 0; i < nlocal; i++) + if (igroup == atom->firstgroup) nlocal = atom->nfirst; + + + double dx,dy,dz; + + for (int i = 0; i < nlocal; i++) { if (mask[i] & groupbit) { - - fx = g2 * (random->*rng_func)()/sqrtdt; - fy = g2 * (random->*rng_func)()/sqrtdt; - fz = g2 * (random->*rng_func)()/sqrtdt; - f[i][0] += fx; - f[i][1] += fy; - f[i][2] += fz; - torque[i][0] = g4*(random->*rng_func)()/sqrtdt; - torque[i][1] = g4*(random->*rng_func)()/sqrtdt; - torque[i][2] = g4*(random->*rng_func)()/sqrtdt; - - if (evflag) { - v[0] = fx*x[i][0]; - v[1] = fy*x[i][1]; - v[2] = fz*x[i][2]; - v[3] = fx*x[i][1]; - v[4] = fx*x[i][2]; - v[5] = fy*x[i][2]; - v_tally(i, v); + if (Tp_2D) { + dz = 0; + wx = wy = 0; + if (Tp_UNIFORM) { + dx = dt * (g1 * f[i][0] + g2 * (random->uniform()-0.5)); + dy = dt * (g1 * f[i][1] + g2 * (random->uniform()-0.5)); + wz = (random->uniform()-0.5)*g4; + + } else if (Tp_GAUSS) { + dx = dt * (g1 * f[i][0] + g2 * random->gaussian()); + dy = dt * (g1 * f[i][1] + g2 * random->gaussian()); + wz = random->gaussian()*g4; + + + } else { + dx = dt * g1 * f[i][0]; + dy = dt * g1 * f[i][1]; + wz = 0; + } + } else { + if (Tp_UNIFORM) { + dx = dt * (g1 * f[i][0] + g2 * (random->uniform()-0.5)); + dy = dt * (g1 * f[i][1] + g2 * (random->uniform()-0.5)); + dz = dt * (g1 * f[i][2] + g2 * (random->uniform()-0.5)); + wx = (random->uniform()-0.5)*g4; + wy = (random->uniform()-0.5)*g4; + wz = (random->uniform()-0.5)*g4; + + } else if (Tp_GAUSS) { + dx = dt * (g1 * f[i][0] + g2 * random->gaussian()); + dy = dt * (g1 * f[i][1] + g2 * random->gaussian()); + dz = dt * (g1 * f[i][2] + g2 * random->gaussian()); + wx = random->gaussian()*g4; + wy = random->gaussian()*g4; + wz = random->gaussian()*g4; + + + } else { + dx = dt * g1 * f[i][0]; + dy = dt * g1 * f[i][1]; + dz = dt * g1 * f[i][2]; + wx = wy = wz = 0; + + } + } + + x[i][0] += dx; + v[i][0] = dx/dt; + + + x[i][1] += dy; + v[i][1] = dy/dt; + + + x[i][2] += dz; + v[i][2] = dz/dt; + + + + wx += g3*torque[i][0]; + wy += g3*torque[i][1]; + wz += g3*torque[i][2]; + + + // store length of dipole as we need to convert it to a unit vector and + // then back again + + mulen = sqrt(mu[i][0]*mu[i][0] + mu[i][1]*mu[i][1] + mu[i][2]*mu[i][2]); + + // unit vector at time t + mux = mu[i][0]/mulen; + muy = mu[i][1]/mulen; + muz = mu[i][2]/mulen; + + + + // un-normalised unit vector at time t + dt + mu[i][0] = mux + (wy*muz - wz*muy)*dt; + mu[i][1] = muy + (wz*mux - wx*muz)*dt; + mu[i][2] = muz + (wx*muy - wy*mux)*dt; + + // normalisation introduces the stochastic drift term due to changing from + // Stratonovich to Ito interpretation + MathExtra::norm3(mu[i]); + + // multiply by original magnitude to obtain dipole of same length + mu[i][0] = mu[i][0]*mulen; + mu[i][1] = mu[i][1]*mulen; + mu[i][2] = mu[i][2]*mulen; + } -} + } -void FixBrownianSphere::reset_dt() -{ - - dt = update->dt; - sqrtdt = sqrt(dt); + return; } diff --git a/src/USER-BROWNIAN/fix_brownian_sphere.h b/src/USER-BROWNIAN/fix_brownian_sphere.h index 8d30001fdd..e518d28db3 100644 --- a/src/USER-BROWNIAN/fix_brownian_sphere.h +++ b/src/USER-BROWNIAN/fix_brownian_sphere.h @@ -20,39 +20,22 @@ FixStyle(brownian/sphere,FixBrownianSphere) #ifndef LMP_FIX_BROWNIAN_SPHERE_H #define LMP_FIX_BROWNIAN_SPHERE_H -#include "fix.h" +#include "fix_brownian_base.h" namespace LAMMPS_NS { -class FixBrownianSphere : public Fix { +class FixBrownianSphere : public FixBrownianBase { public: FixBrownianSphere(class LAMMPS *, int, char **); virtual ~FixBrownianSphere(); void init(); - void initial_integrate(int); - void setup(int); - void post_force(int); - int setmask(); - void reset_dt(); + void initial_integrate(int /*vflag */); + private: - int seed; // RNG seed - int extra; // set if dipole is used - double dt, sqrtdt; // time step interval and its sqrt - - - double gamma_t,gamma_r; // translational and rotational damping params - double diff_t,diff_r; // translational and rotational diffusion coeffs - - double g1,g2, g3, g4; // prefactors in time stepping - int noise_flag; // 0/1 for noise off/on - int gaussian_noise_flag; // 0/1 for uniform/gaussian noise - -protected: - class RanMars *random; - typedef double (RanMars::*rng_member)(); - rng_member rng_func; // placeholder for RNG function - + template < int Tp_UNIFORM, int Tp_GAUSS, int Tp_2D > + void initial_integrate_templated(); + double g3,g4; }; } diff --git a/src/random_mars.cpp b/src/random_mars.cpp index f31a92624a..2844bde417 100644 --- a/src/random_mars.cpp +++ b/src/random_mars.cpp @@ -94,21 +94,6 @@ double RanMars::uniform() return uni; } -/* ---------------------------------------------------------------------- - uniform RN shifted to be symmetric about zero (for fix bd/sphere). -------------------------------------------------------------------------- */ -double RanMars::uniform_middle() -{ - return uniform()-0.5; -} - -/* ---------------------------------------------------------------------- - Return 0 (for fix/bd/sphere). -------------------------------------------------------------------------- */ -double RanMars::zero_rng() -{ - return 0.0; -} /* ---------------------------------------------------------------------- gaussian RN diff --git a/src/random_mars.h b/src/random_mars.h index 7028ef54d2..1bcd16b051 100644 --- a/src/random_mars.h +++ b/src/random_mars.h @@ -23,8 +23,6 @@ class RanMars : protected Pointers { RanMars(class LAMMPS *, int); ~RanMars(); double uniform(); - double uniform_middle(); - double zero_rng(); double gaussian(); double gaussian(double mu, double sigma); double rayleigh(double sigma); From 632e0d6a52d5ad53657169f6e62fd2ed72a5f7fe Mon Sep 17 00:00:00 2001 From: Axel Kohlmeyer Date: Tue, 11 May 2021 17:59:02 -0400 Subject: [PATCH 17/22] add USER-BROWNIAN package to various package management files --- cmake/presets/most.cmake | 6 +++--- src/.gitignore | 7 +++++-- src/Makefile | 13 +++++++------ 3 files changed, 15 insertions(+), 11 deletions(-) diff --git a/cmake/presets/most.cmake b/cmake/presets/most.cmake index 5dc58b735b..064b22595f 100644 --- a/cmake/presets/most.cmake +++ b/cmake/presets/most.cmake @@ -5,9 +5,9 @@ set(ALL_PACKAGES ASPHERE BODY CLASS2 COLLOID COMPRESS CORESHELL DIPOLE GRANULAR KSPACE MANYBODY MC MISC MLIAP MOLECULE OPT PERI PLUGIN POEMS PYTHON QEQ REPLICA RIGID SHOCK SNAP SPIN SRD VORONOI - USER-BOCS USER-CGDNA USER-CGSDK USER-COLVARS USER-DIFFRACTION - USER-DPD USER-DRUDE USER-EFF USER-FEP USER-MEAMC USER-MESODPD - USER-MISC USER-MOFFF USER-OMP USER-PHONON USER-REACTION + USER-BROWNIAN USER-BOCS USER-CGDNA USER-CGSDK USER-COLVARS + USER-DIFFRACTION USER-DPD USER-DRUDE USER-EFF USER-FEP USER-MEAMC + USER-MESODPD USER-MISC USER-MOFFF USER-OMP USER-PHONON USER-REACTION USER-REAXC USER-SDPD USER-SPH USER-SMD USER-UEF USER-YAFF) foreach(PKG ${ALL_PACKAGES}) diff --git a/src/.gitignore b/src/.gitignore index 64452b3e08..20a0bde94e 100644 --- a/src/.gitignore +++ b/src/.gitignore @@ -27,6 +27,11 @@ /*_ssa.h /*_ssa.cpp +/fix_brownian*.cpp +/fix_brownian*.h +/fix_propel_self.cpp +/fix_propel_self.h + /kim_*.cpp /kim_*.h /pair_kim.cpp @@ -700,8 +705,6 @@ /fix_poems.h /fix_pour.cpp /fix_pour.h -/fix_propel_self.cpp -/fix_propel_self.h /fix_qeq_comb.cpp /fix_qeq_comb.h /fix_qeq_reax.cpp diff --git a/src/Makefile b/src/Makefile index 1606f9b239..6523870d75 100644 --- a/src/Makefile +++ b/src/Makefile @@ -51,12 +51,13 @@ PACKAGE = asphere body class2 colloid compress coreshell dipole gpu \ mliap molecule mpiio mscg opt peri plugin poems \ python qeq replica rigid shock snap spin srd voronoi -PACKUSER = user-adios user-atc user-awpmd user-bocs user-cgdna user-cgsdk user-colvars \ - user-diffraction user-dpd user-drude user-eff user-fep user-h5md \ - user-intel user-lb user-manifold user-meamc user-mesodpd user-mesont \ - user-mgpt user-misc user-mofff user-molfile \ - user-netcdf user-omp user-phonon user-pace user-plumed user-ptm user-qmmm \ - user-qtb user-quip user-reaction user-reaxc user-scafacos user-smd user-smtbq \ +PACKUSER = user-adios user-atc user-awpmd user-brownian user-bocs user-cgdna \ + user-cgsdk user-colvars user-diffraction user-dpd user-drude \ + user-eff user-fep user-h5md user-intel user-lb user-manifold \ + user-meamc user-mesodpd user-mesont user-mgpt user-misc \ + user-mofff \user-molfile user-netcdf user-omp user-phonon \ + user-pace user-plumed user-ptm user-qmmm user-qtb user-quip \ + user-reaction user-reaxc user-scafacos user-smd user-smtbq \ user-sdpd user-sph user-tally user-uef user-vtk user-yaff PACKLIB = compress gpu kim kokkos latte message mpiio mscg poems python voronoi \ From ed75618ad6188448b30043054df1d08594427a59 Mon Sep 17 00:00:00 2001 From: Axel Kohlmeyer Date: Tue, 11 May 2021 18:31:59 -0400 Subject: [PATCH 18/22] integrate USER-BROWNIAN package into the documentation proper --- doc/src/Packages_details.rst | 21 ++++++++ doc/src/Packages_user.rst | 2 + doc/src/fix_brownian.rst | 56 ++++++++++----------- doc/src/fix_propel_self.rst | 6 +-- doc/utils/sphinx-config/false_positives.txt | 10 ++++ 5 files changed, 63 insertions(+), 32 deletions(-) diff --git a/doc/src/Packages_details.rst b/doc/src/Packages_details.rst index f1c590d850..d6f40b3228 100644 --- a/doc/src/Packages_details.rst +++ b/doc/src/Packages_details.rst @@ -69,6 +69,7 @@ page gives those details. * :ref:`USER-ATC ` * :ref:`USER-AWPMD ` * :ref:`USER-BOCS ` + * :ref:`USER-BROWNIAN ` * :ref:`USER-CGDNA ` * :ref:`USER-CGSDK ` * :ref:`USER-COLVARS ` @@ -1266,6 +1267,26 @@ Example inputs are in the examples/USER/bocs folder. ---------- +.. _PKG-USER-BROWNIAN: + +USER-BROWNIAN package +--------------------- + +**Contents:** + +This package provides :doc:`fix brownian, fix brownian/sphere, and +fix brownian/asphere ` as well as +:doc:`fix propel/self ` which allow to do Brownian +Dynamics time integration of point, spherical and aspherical particles +and also support self-propelled particles. + +**Authors:** Sam Cameron (University of Bristol), +Stefan Paquay (while at Brandeis University) (initial version of fix propel/self) + +Example inputs are in the examples/USER/brownian folder. + +---------- + .. _PKG-USER-CGDNA: USER-CGDNA package diff --git a/doc/src/Packages_user.rst b/doc/src/Packages_user.rst index 00d1dfb67b..23325e8357 100644 --- a/doc/src/Packages_user.rst +++ b/doc/src/Packages_user.rst @@ -39,6 +39,8 @@ package: +------------------------------------------------+-----------------------------------------------------------------+-------------------------------------------------------------------------------+------------------------------------------------------+---------+ | :ref:`USER-BOCS ` | BOCS bottom up coarse graining | :doc:`fix bocs ` | USER/bocs | no | +------------------------------------------------+-----------------------------------------------------------------+-------------------------------------------------------------------------------+------------------------------------------------------+---------+ +| :ref:`USER-BROWNIAN ` | Brownian dynamics and self-propelled particles | :doc:`fix brownian `, :doc:`fix propel/self ` | USER/brownian | no | ++------------------------------------------------+-----------------------------------------------------------------+-------------------------------------------------------------------------------+------------------------------------------------------+---------+ | :ref:`USER-CGDNA ` | coarse-grained DNA force fields | src/USER-CGDNA/README | USER/cgdna | no | +------------------------------------------------+-----------------------------------------------------------------+-------------------------------------------------------------------------------+------------------------------------------------------+---------+ | :ref:`USER-CGSDK ` | SDK coarse-graining model | :doc:`pair_style lj/sdk ` | USER/cgsdk | no | diff --git a/doc/src/fix_brownian.rst b/doc/src/fix_brownian.rst index 7a82c2ffea..ac8863bdd5 100644 --- a/doc/src/fix_brownian.rst +++ b/doc/src/fix_brownian.rst @@ -4,7 +4,7 @@ fix brownian command =========================== - + fix brownian/sphere command =========================== @@ -43,7 +43,6 @@ Syntax *gamma_t* values = *gt* for *brownian* and *brownian/sphere* *gt* = magnitude of the (isotropic) translational friction tensor - Examples """""""" @@ -61,42 +60,45 @@ Examples Description """"""""""" -Perform Brownian Dynamics integration to update position, velocity, -dipole orientation (for spheres) and quaternion orientation (for ellipsoids, -with optional dipole update as well) in the group each timestep. -Brownian Dynamics uses Newton's laws of +Perform Brownian Dynamics time integration to update position, velocity, +dipole orientation (for spheres) and quaternion orientation (for +ellipsoids, with optional dipole update as well) of all particles in the +fix group in each timestep. Brownian Dynamics uses Newton's laws of motion in the limit that inertial forces are negligible compared to -viscous forces. The stochastic equation of motion for the centre of mass -positions are +viscous forces. The stochastic equation of motion for the center of mass +positions is .. math:: d\mathbf{r} = \mathbf{\gamma}_t^{-1}\mathbf{F}dt+\sqrt{2k_BT}\mathbf{\gamma}_t^{-1/2}d\mathbf{W}_t, -in the lab-frame (i.e. :math:`\mathbf{\gamma}_t` is not diagonal, but only depends on -orientation and so the noise is still additive). +in the lab-frame (i.e. :math:`\mathbf{\gamma}_t` is not diagonal, but +only depends on orientation and so the noise is still additive). -The rotational motion for the spherical and ellipsoidal particles is not as simple an -expression, but is chosen to replicate the Boltzmann distribution for the case of -conservative torques (see :ref:`(Ilie) ` or :ref:`(Delong) `). +The rotational motion for the spherical and ellipsoidal particles is not +as simple an expression, but is chosen to replicate the Boltzmann +distribution for the case of conservative torques (see :ref:`(Ilie) +` or :ref:`(Delong) `). -For the style *brownian*, only the positions of the particles are updated. This is -therefore suitable for point particle simulations. +For the style *brownian*, only the positions of the particles are +updated. This is therefore suitable for point particle simulations. -For the style *brownian/sphere*, the positions of the particles are updated, and a dipole -slaved to the spherical orientation is also updated. This style therefore requires the -hybrid atom style :doc:`atom_style dipole ` and -:doc:`atom_style sphere `. +For the style *brownian/sphere*, the positions of the particles are +updated, and a dipole slaved to the spherical orientation is also +updated. This style therefore requires the hybrid atom style +:doc:`atom_style dipole ` and :doc:`atom_style sphere +`. -For the style *brownian/asphere*, the centre of mass positions and the quaternions of -ellipsoidal particles are updated. This fix style is suitable for equations of motion -where the rotational and translational friction tensors are diagonalisable in a certain -(body) reference frame. +For the style *brownian/asphere*, the center of mass positions and the +quaternions of ellipsoidal particles are updated. This fix style is +suitable for equations of motion where the rotational and translational +friction tensors can be diagonalized in a certain (body) reference frame. --------- .. note:: + This integrator does not by default assume a relationship between the rotational and translational friction tensors, though such a relationship should exist in the case of no-slip boundary conditions between the particles and @@ -109,11 +111,12 @@ where the rotational and translational friction tensors are diagonalisable in a --------- .. note:: + Temperature computation using the :doc:`compute temp ` will not correctly compute temperature of these overdamped dynamics since we are explicitly neglecting inertial effects. Furthermore, this time integrator does not add the stochastic terms or - viscous terms to the force and/or torques. Rather, they are just added + viscous terms to the force and/or torques. Rather, they are just added in to the equations of motion to update the degrees of freedom. --------- @@ -132,7 +135,6 @@ value for reasons argued in :ref:`(Dunweg) `. If the *rng* keyword is used with the *none* value, then the noise terms are set to zero. - The *gamma_t* keyword sets the (isotropic) translational viscous damping. Required for (and only compatible with) *brownian* and *brownian/sphere*. The units of *gamma_t* are mass/time. @@ -202,12 +204,10 @@ tensors are the identity tensor. ---------- - .. _Ilie1: **(Ilie)** Ilie, Briels, den Otter, Journal of Chemical Physics, 142, 114103 (2015). - .. _Delong1: **(Delong)** Delong, Usabiaga, Donev, Journal of Chemical Physics. 143, 144107 (2015) @@ -215,5 +215,3 @@ tensors are the identity tensor. .. _Dunweg7: **(Dunweg)** Dunweg and Paul, Int J of Modern Physics C, 2, 817-27 (1991). - - diff --git a/doc/src/fix_propel_self.rst b/doc/src/fix_propel_self.rst index ba8c48cf6b..85dd53cd62 100644 --- a/doc/src/fix_propel_self.rst +++ b/doc/src/fix_propel_self.rst @@ -57,7 +57,7 @@ are not unit vectors, the :math:`e_i` will not be unit vectors. change accordingly (since :math:`|e_i|` will change, which is physically equivalent to re-scaling :math:`f_P` while keeping :math:`|e_i|` constant), and no warning will be provided by LAMMPS. This is almost never what you - want, so ensure you aren't changing dipole magnitudes with another LAMMPS + want, so ensure you are not changing dipole magnitudes with another LAMMPS fix or pair style. Furthermore, self-propulsion forces (almost) always set :math:`e_i` to be a unit vector for all times, so it's best to set all the dipole magnitudes to 1.0 unless you have a good reason not to @@ -69,7 +69,7 @@ velocity-dependent friction, as proposed by e.g. :ref:`(Erdmann) `. For mode *quat*, :math:`e_i` points in the direction of a unit vector, oriented in the coordinate frame of the ellipsoidal particles, -which defaults to point along the x-direction. This default behaviour +which defaults to point along the x-direction. This default behavior can be changed by via the *quatvec* keyword. The optional *quatvec* keyword specifies the direction of self-propulsion @@ -83,7 +83,7 @@ to zero. This keyword may only be specified for mode *quat*. .. note:: In using keyword *quatvec*, the three arguments *sx*, - *sy*, and *sz* will be automatically normalised to components + *sy*, and *sz* will be automatically normalized to components of a unit vector internally to avoid users having to explicitly do so themselves. Therefore, in mode *quat*, the vectors :math:`e_i` will always be of unit length. diff --git a/doc/utils/sphinx-config/false_positives.txt b/doc/utils/sphinx-config/false_positives.txt index fc40ad004c..aa932fbc2d 100644 --- a/doc/utils/sphinx-config/false_positives.txt +++ b/doc/utils/sphinx-config/false_positives.txt @@ -312,6 +312,7 @@ br Branduardi Branicio brennan +Briels Brien Brilliantov Broadwell @@ -626,6 +627,7 @@ delflag Dellago delocalization delocalized +Delong delr deltaHf Dendrimer @@ -709,6 +711,7 @@ dodgerblue dof doi Donadio +Donev dotc Doty doxygen @@ -1143,6 +1146,7 @@ GMock gneb GNEB Goldfarb +Gompper Gonzalez-Melchor googlemail googletest @@ -1321,6 +1325,7 @@ ijk ijkl ik Ikeshoji +Ilie ilmenau Ilmenau ilp @@ -3109,6 +3114,7 @@ Swinburne Swol Swope Sx +sx sy Sy symplectic @@ -3118,6 +3124,7 @@ sysdim Syst systemd Sz +sz Tabbernor tabinner Tadmor @@ -3358,6 +3365,7 @@ upenn upto Urbakh Urbana +Usabiaga usec uSemiParallel userguide @@ -3502,6 +3510,7 @@ Wikipedia Wildcard wildcard wildcards +Winkler Wirnsberger wirtes witin @@ -3513,6 +3522,7 @@ Worley Wriggers Wuppertal Wurtzite +Wysocki www wx Wx From 0d4cca5af98e633605fa6bb6f6c214be0b647360 Mon Sep 17 00:00:00 2001 From: Axel Kohlmeyer Date: Tue, 11 May 2021 18:32:18 -0400 Subject: [PATCH 19/22] fix compilation issues --- src/MOLECULE/bond_fene_expand.h | 2 +- src/USER-BROWNIAN/fix_propel_self.cpp | 4 +--- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/src/MOLECULE/bond_fene_expand.h b/src/MOLECULE/bond_fene_expand.h index 6c79b1cfd0..49a8b8ab8e 100644 --- a/src/MOLECULE/bond_fene_expand.h +++ b/src/MOLECULE/bond_fene_expand.h @@ -13,7 +13,7 @@ #ifdef BOND_CLASS -BondStyle(fene / expand, BondFENEExpand) +BondStyle(fene/expand, BondFENEExpand) #else diff --git a/src/USER-BROWNIAN/fix_propel_self.cpp b/src/USER-BROWNIAN/fix_propel_self.cpp index 54b1dac61b..067fec3bf8 100644 --- a/src/USER-BROWNIAN/fix_propel_self.cpp +++ b/src/USER-BROWNIAN/fix_propel_self.cpp @@ -46,7 +46,7 @@ FixPropelSelf::FixPropelSelf(LAMMPS *lmp, int narg, char **arg) : Fix(lmp, narg, arg) { - virial_flag = 1; + virial_global_flag = virial_peratom_flag = 1; if (narg != 5 && narg != 9) error->all(FLERR,"Illegal fix propel/self command"); @@ -207,7 +207,6 @@ void FixPropelSelf::post_force_velocity(int vflag) double **x = atom->x; int *mask = atom->mask; int nlocal = atom->nlocal; - int *type = atom->type; double nv2,fnorm,fx,fy,fz; @@ -262,7 +261,6 @@ void FixPropelSelf::post_force_quaternion(int vflag) double **x = atom->x; int *mask = atom->mask; int nlocal = atom->nlocal; - int *type = atom->type; int* ellipsoid = atom->ellipsoid; // ellipsoidal properties From 8a507cc7da50ff76232f74f81d7e3b2fb4f574c1 Mon Sep 17 00:00:00 2001 From: Axel Kohlmeyer Date: Tue, 11 May 2021 19:32:57 -0400 Subject: [PATCH 20/22] reformat with clang-format and related changes --- src/USER-BROWNIAN/fix_brownian.cpp | 136 ++++----- src/USER-BROWNIAN/fix_brownian.h | 14 +- src/USER-BROWNIAN/fix_brownian_asphere.cpp | 325 ++++++++------------- src/USER-BROWNIAN/fix_brownian_asphere.h | 21 +- src/USER-BROWNIAN/fix_brownian_base.cpp | 208 ++++++------- src/USER-BROWNIAN/fix_brownian_base.h | 40 +-- src/USER-BROWNIAN/fix_brownian_sphere.cpp | 221 ++++++-------- src/USER-BROWNIAN/fix_brownian_sphere.h | 18 +- src/USER-BROWNIAN/fix_propel_self.cpp | 165 +++++------ src/USER-BROWNIAN/fix_propel_self.h | 14 +- 10 files changed, 468 insertions(+), 694 deletions(-) diff --git a/src/USER-BROWNIAN/fix_brownian.cpp b/src/USER-BROWNIAN/fix_brownian.cpp index 128bd92042..92a969661b 100644 --- a/src/USER-BROWNIAN/fix_brownian.cpp +++ b/src/USER-BROWNIAN/fix_brownian.cpp @@ -12,86 +12,67 @@ ------------------------------------------------------------------------- */ /* ---------------------------------------------------------------------- - Originally modified from USER-CGDNA/fix_nve_dotc_langevin.cpp. + Originally modified from USER-CGDNA/fix_nve_dotc_langevin.cpp. Contributing author: Sam Cameron (University of Bristol) ------------------------------------------------------------------------- */ #include "fix_brownian.h" -#include -#include -#include "math_extra.h" #include "atom.h" -#include "force.h" -#include "update.h" #include "comm.h" #include "domain.h" -#include "random_mars.h" -#include "memory.h" #include "error.h" +#include "force.h" +#include "math_extra.h" +#include "memory.h" +#include "random_mars.h" +#include "update.h" +#include +#include using namespace LAMMPS_NS; using namespace FixConst; /* ---------------------------------------------------------------------- */ -FixBrownian::FixBrownian(LAMMPS *lmp, int narg, char **arg) : - FixBrownianBase(lmp, narg, arg) +FixBrownian::FixBrownian(LAMMPS *lmp, int narg, char **arg) : FixBrownianBase(lmp, narg, arg) { - if (dipole_flag || gamma_t_eigen_flag || gamma_r_eigen_flag || gamma_r_flag) { - error->all(FLERR,"Illegal fix brownian command."); + error->all(FLERR, "Illegal fix brownian command."); } - - if (!gamma_t_flag) { - error->all(FLERR,"Illegal fix brownian command."); - } - + if (!gamma_t_flag) { error->all(FLERR, "Illegal fix brownian command."); } } - -/* ---------------------------------------------------------------------- */ - -FixBrownian::~FixBrownian() -{ -} - - - /* ---------------------------------------------------------------------- */ void FixBrownian::init() { - FixBrownianBase::init(); - - g1 /= gamma_t; - g2 *= sqrt(gamma_t); - + g1 /= gamma_t; + g2 *= sqrt(gamma_t); } /* ---------------------------------------------------------------------- */ void FixBrownian::initial_integrate(int /*vflag */) { - if (domain->dimension == 2) { if (!noise_flag) { - initial_integrate_templated<0,0,1>(); + initial_integrate_templated<0, 0, 1>(); } else if (gaussian_noise_flag) { - initial_integrate_templated<0,1,1>(); + initial_integrate_templated<0, 1, 1>(); } else { - initial_integrate_templated<1,0,1>(); + initial_integrate_templated<1, 0, 1>(); } } else { if (!noise_flag) { - initial_integrate_templated<0,0,0>(); + initial_integrate_templated<0, 0, 0>(); } else if (gaussian_noise_flag) { - initial_integrate_templated<0,1,0>(); + initial_integrate_templated<0, 1, 0>(); } else { - initial_integrate_templated<1,0,0>(); + initial_integrate_templated<1, 0, 0>(); } } return; @@ -99,8 +80,7 @@ void FixBrownian::initial_integrate(int /*vflag */) /* ---------------------------------------------------------------------- */ -template < int Tp_UNIFORM, int Tp_GAUSS, int Tp_2D > -void FixBrownian::initial_integrate_templated() +template void FixBrownian::initial_integrate_templated() { double **x = atom->x; double **v = atom->v; @@ -110,52 +90,46 @@ void FixBrownian::initial_integrate_templated() if (igroup == atom->firstgroup) nlocal = atom->nfirst; - double dx,dy,dz; - + double dx, dy, dz; + for (int i = 0; i < nlocal; i++) { if (mask[i] & groupbit) { - if (Tp_2D) { - dz = 0; - if (Tp_UNIFORM) { - dx = dt * (g1 * f[i][0] + g2 * (random->uniform()-0.5)); - dy = dt * (g1 * f[i][1] + g2 * (random->uniform()-0.5)); - - } else if (Tp_GAUSS) { - dx = dt * (g1 * f[i][0] + g2 * random->gaussian()); - dy = dt * (g1 * f[i][1] + g2 * random->gaussian()); - } else { - dx = dt * g1 * f[i][0]; - dy = dt * g1 * f[i][1]; - } + dz = 0; + if (Tp_UNIFORM) { + dx = dt * (g1 * f[i][0] + g2 * (rng->uniform() - 0.5)); + dy = dt * (g1 * f[i][1] + g2 * (rng->uniform() - 0.5)); + } else if (Tp_GAUSS) { + dx = dt * (g1 * f[i][0] + g2 * rng->gaussian()); + dy = dt * (g1 * f[i][1] + g2 * rng->gaussian()); + } else { + dx = dt * g1 * f[i][0]; + dy = dt * g1 * f[i][1]; + } } else { - if (Tp_UNIFORM) { - dx = dt * (g1 * f[i][0] + g2 * (random->uniform()-0.5)); - dy = dt * (g1 * f[i][1] + g2 * (random->uniform()-0.5)); - dz = dt * (g1 * f[i][2] + g2 * (random->uniform()-0.5)); - } else if (Tp_GAUSS) { - dx = dt * (g1 * f[i][0] + g2 * random->gaussian()); - dy = dt * (g1 * f[i][1] + g2 * random->gaussian()); - dz = dt * (g1 * f[i][2] + g2 * random->gaussian()); - } else { - dx = dt * g1 * f[i][0]; - dy = dt * g1 * f[i][1]; - dz = dt * g1 * f[i][2]; - } + if (Tp_UNIFORM) { + dx = dt * (g1 * f[i][0] + g2 * (rng->uniform() - 0.5)); + dy = dt * (g1 * f[i][1] + g2 * (rng->uniform() - 0.5)); + dz = dt * (g1 * f[i][2] + g2 * (rng->uniform() - 0.5)); + } else if (Tp_GAUSS) { + dx = dt * (g1 * f[i][0] + g2 * rng->gaussian()); + dy = dt * (g1 * f[i][1] + g2 * rng->gaussian()); + dz = dt * (g1 * f[i][2] + g2 * rng->gaussian()); + } else { + dx = dt * g1 * f[i][0]; + dy = dt * g1 * f[i][1]; + dz = dt * g1 * f[i][2]; + } } - - x[i][0] += dx; - v[i][0] = dx/dt; - - - x[i][1] += dy; - v[i][1] = dy/dt; - - - x[i][2] += dz; - v[i][2] = dz/dt; - - + + x[i][0] += dx; + v[i][0] = dx / dt; + + x[i][1] += dy; + v[i][1] = dy / dt; + + x[i][2] += dz; + v[i][2] = dz / dt; } } return; diff --git a/src/USER-BROWNIAN/fix_brownian.h b/src/USER-BROWNIAN/fix_brownian.h index 7260eb15e3..97705f4f48 100644 --- a/src/USER-BROWNIAN/fix_brownian.h +++ b/src/USER-BROWNIAN/fix_brownian.h @@ -12,9 +12,9 @@ ------------------------------------------------------------------------- */ #ifdef FIX_CLASS - -FixStyle(brownian,FixBrownian) - +// clang-format off +FixStyle(brownian,FixBrownian); +// clang-format on #else #ifndef LMP_FIX_BROWNIAN_H @@ -27,18 +27,16 @@ namespace LAMMPS_NS { class FixBrownian : public FixBrownianBase { public: FixBrownian(class LAMMPS *, int, char **); - virtual ~FixBrownian(); + virtual ~FixBrownian() {}; void init(); void initial_integrate(int); private: - template < int Tp_UNIFORM, int Tp_GAUSS, int Tp_2D > + template void initial_integrate_templated(); - - }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/USER-BROWNIAN/fix_brownian_asphere.cpp b/src/USER-BROWNIAN/fix_brownian_asphere.cpp index 98c201230a..e7b6eb2728 100644 --- a/src/USER-BROWNIAN/fix_brownian_asphere.cpp +++ b/src/USER-BROWNIAN/fix_brownian_asphere.cpp @@ -12,155 +12,127 @@ ------------------------------------------------------------------------- */ /* ---------------------------------------------------------------------- - Originally modified from USER-CGDNA/fix_nve_dotc_langevin.cpp. + Originally modified from USER-CGDNA/fix_nve_dotc_langevin.cpp. Contributing author: Sam Cameron (University of Bristol) ------------------------------------------------------------------------- */ #include "fix_brownian_asphere.h" -#include -#include -#include "math_extra.h" #include "atom.h" #include "atom_vec_ellipsoid.h" -#include "force.h" -#include "update.h" #include "comm.h" #include "domain.h" -#include "random_mars.h" -#include "memory.h" #include "error.h" +#include "force.h" +#include "math_extra.h" +#include "memory.h" +#include "random_mars.h" +#include "update.h" +#include +#include using namespace LAMMPS_NS; using namespace FixConst; - /* ---------------------------------------------------------------------- */ FixBrownianAsphere::FixBrownianAsphere(LAMMPS *lmp, int narg, char **arg) : - FixBrownianBase(lmp, narg, arg) + FixBrownianBase(lmp, narg, arg) { - - if (!gamma_t_eigen_flag || !gamma_r_eigen_flag) { - error->all(FLERR,"Illegal fix brownian command."); + error->all(FLERR, "Illegal fix brownian command."); } - if (gamma_t_flag || gamma_r_flag) { - error->all(FLERR,"Illegal fix brownian command."); - } - - + if (gamma_t_flag || gamma_r_flag) error->all(FLERR, "Illegal fix brownian command."); if (dipole_flag && !atom->mu_flag) - error->all(FLERR,"Fix brownian/asphere dipole requires atom attribute mu"); - - + error->all(FLERR, "Fix brownian/asphere dipole requires atom attribute mu"); } -/* ---------------------------------------------------------------------- */ - -FixBrownianAsphere::~FixBrownianAsphere() -{ -} - - - /* ---------------------------------------------------------------------- */ void FixBrownianAsphere::init() { - - avec = (AtomVecEllipsoid *) atom->style_match("ellipsoid"); - if (!avec) - error->all(FLERR,"Compute brownian/asphere requires " - "atom style ellipsoid"); - + if (!avec) error->all(FLERR, "Compute brownian/asphere requires atom style ellipsoid"); + // check that all particles are finite-size ellipsoids // no point particles allowed, spherical is OK - + int *ellipsoid = atom->ellipsoid; int *mask = atom->mask; int nlocal = atom->nlocal; - + for (int i = 0; i < nlocal; i++) if (mask[i] & groupbit) - if (ellipsoid[i] < 0) - error->one(FLERR,"Fix brownian/asphere requires extended particles"); - - + if (ellipsoid[i] < 0) error->one(FLERR, "Fix brownian/asphere requires extended particles"); + if (dipole_flag) { - + double f_rot[3]; double *quat; int *ellipsoid = atom->ellipsoid; AtomVecEllipsoid::Bonus *bonus = avec->bonus; - + double Q[3][3]; - double **mu = atom->mu; - + for (int i = 0; i < nlocal; i++) { if (mask[i] & groupbit) { - quat = bonus[ellipsoid[i]].quat; - MathExtra::quat_to_mat( quat, Q ); - MathExtra::matvec( Q, dipole_body, f_rot ); - - mu[i][0] = f_rot[0]; - mu[i][1] = f_rot[1]; - mu[i][2] = f_rot[2]; - + quat = bonus[ellipsoid[i]].quat; + MathExtra::quat_to_mat(quat, Q); + MathExtra::matvec(Q, dipole_body, f_rot); + + mu[i][0] = f_rot[0]; + mu[i][1] = f_rot[1]; + mu[i][2] = f_rot[2]; } - } + } } FixBrownianBase::init(); - - } /* ---------------------------------------------------------------------- */ void FixBrownianAsphere::initial_integrate(int /*vflag */) { - if (domain->dimension == 2) { if (dipole_flag) { if (!noise_flag) { - initial_integrate_templated<0,0,1,1>(); + initial_integrate_templated<0, 0, 1, 1>(); } else if (gaussian_noise_flag) { - initial_integrate_templated<0,1,1,1>(); + initial_integrate_templated<0, 1, 1, 1>(); } else { - initial_integrate_templated<1,0,1,1>(); + initial_integrate_templated<1, 0, 1, 1>(); } } else { if (!noise_flag) { - initial_integrate_templated<0,0,0,1>(); + initial_integrate_templated<0, 0, 0, 1>(); } else if (gaussian_noise_flag) { - initial_integrate_templated<0,1,0,1>(); + initial_integrate_templated<0, 1, 0, 1>(); } else { - initial_integrate_templated<1,0,0,1>(); + initial_integrate_templated<1, 0, 0, 1>(); } } } else { if (dipole_flag) { if (!noise_flag) { - initial_integrate_templated<0,0,1,0>(); + initial_integrate_templated<0, 0, 1, 0>(); } else if (gaussian_noise_flag) { - initial_integrate_templated<0,1,1,0>(); + initial_integrate_templated<0, 1, 1, 0>(); } else { - initial_integrate_templated<1,0,1,0>(); + initial_integrate_templated<1, 0, 1, 0>(); } } else { if (!noise_flag) { - initial_integrate_templated<0,0,0,0>(); + initial_integrate_templated<0, 0, 0, 0>(); } else if (gaussian_noise_flag) { - initial_integrate_templated<0,1,0,0>(); + initial_integrate_templated<0, 1, 0, 0>(); } else { - initial_integrate_templated<1,0,0,0>(); + initial_integrate_templated<1, 0, 0, 0>(); } } } @@ -169,7 +141,7 @@ void FixBrownianAsphere::initial_integrate(int /*vflag */) /* ---------------------------------------------------------------------- */ -template < int Tp_UNIFORM, int Tp_GAUSS, int Tp_DIPOLE, int Tp_2D > +template void FixBrownianAsphere::initial_integrate_templated() { double **x = atom->x; @@ -179,180 +151,121 @@ void FixBrownianAsphere::initial_integrate_templated() int nlocal = atom->nlocal; AtomVecEllipsoid::Bonus *bonus = avec->bonus; - - + double **mu = atom->mu; double **torque = atom->torque; - double qw[4]; - double *quat; int *ellipsoid = atom->ellipsoid; - + if (igroup == atom->firstgroup) nlocal = atom->nfirst; - - // project dipole along x axis of quat double f_rot[3]; - double rotationmatrix_transpose[3][3]; - double tmp[3]; double dv[3]; - + for (int i = 0; i < nlocal; i++) { if (mask[i] & groupbit) { - + // update orientation first - + quat = bonus[ellipsoid[i]].quat; - - MathExtra::quat_to_mat_trans( quat, rotationmatrix_transpose ); - + MathExtra::quat_to_mat_trans(quat, rotationmatrix_transpose); + // tmp holds angular velocity in body frame - MathExtra::matvec(rotationmatrix_transpose,torque[i],tmp); + MathExtra::matvec(rotationmatrix_transpose, torque[i], tmp); if (Tp_2D) { - tmp[0] = tmp[1] = 0.0; - if (Tp_UNIFORM) { - tmp[2] = g1*tmp[2]*gamma_r_inv[2] + gamma_r_invsqrt[2]*(random->uniform()-0.5)*g2; - - } else if (Tp_GAUSS) { - tmp[2] = g1*tmp[2]*gamma_r_inv[2] + gamma_r_invsqrt[2]*random->gaussian()*g2; - - } else { - tmp[2] = g1*tmp[2]*gamma_r_inv[2]; - - } + tmp[0] = tmp[1] = 0.0; + if (Tp_UNIFORM) { + tmp[2] = g1 * tmp[2] * gamma_r_inv[2] + gamma_r_invsqrt[2] * (rng->uniform() - 0.5) * g2; + } else if (Tp_GAUSS) { + tmp[2] = g1 * tmp[2] * gamma_r_inv[2] + gamma_r_invsqrt[2] * rng->gaussian() * g2; + } else { + tmp[2] = g1 * tmp[2] * gamma_r_inv[2]; + } } else { - if (Tp_UNIFORM) { - - tmp[0] = g1*tmp[0]*gamma_r_inv[0] + gamma_r_invsqrt[0]*(random->uniform()-0.5)*g2; - tmp[1] = g1*tmp[1]*gamma_r_inv[1] + gamma_r_invsqrt[1]*(random->uniform()-0.5)*g2; - tmp[2] = g1*tmp[2]*gamma_r_inv[2] + gamma_r_invsqrt[2]*(random->uniform()-0.5)*g2; - - } else if (Tp_GAUSS) { - - tmp[0] = g1*tmp[0]*gamma_r_inv[0] + gamma_r_invsqrt[0]*random->gaussian()*g2; - tmp[1] = g1*tmp[1]*gamma_r_inv[1] + gamma_r_invsqrt[1]*random->gaussian()*g2; - tmp[2] = g1*tmp[2]*gamma_r_inv[2] + gamma_r_invsqrt[2]*random->gaussian()*g2; - - } else { - tmp[0] = g1*tmp[0]*gamma_r_inv[0]; - tmp[1] = g1*tmp[1]*gamma_r_inv[1]; - tmp[2] = g1*tmp[2]*gamma_r_inv[2]; - - } + if (Tp_UNIFORM) { + tmp[0] = g1 * tmp[0] * gamma_r_inv[0] + gamma_r_invsqrt[0] * (rng->uniform() - 0.5) * g2; + tmp[1] = g1 * tmp[1] * gamma_r_inv[1] + gamma_r_invsqrt[1] * (rng->uniform() - 0.5) * g2; + tmp[2] = g1 * tmp[2] * gamma_r_inv[2] + gamma_r_invsqrt[2] * (rng->uniform() - 0.5) * g2; + } else if (Tp_GAUSS) { + tmp[0] = g1 * tmp[0] * gamma_r_inv[0] + gamma_r_invsqrt[0] * rng->gaussian() * g2; + tmp[1] = g1 * tmp[1] * gamma_r_inv[1] + gamma_r_invsqrt[1] * rng->gaussian() * g2; + tmp[2] = g1 * tmp[2] * gamma_r_inv[2] + gamma_r_invsqrt[2] * rng->gaussian() * g2; + } else { + tmp[0] = g1 * tmp[0] * gamma_r_inv[0]; + tmp[1] = g1 * tmp[1] * gamma_r_inv[1]; + tmp[2] = g1 * tmp[2] * gamma_r_inv[2]; + } } - + // convert body frame angular velocity to quaternion - MathExtra::quatvec(quat,tmp,qw); - quat[0] = quat[0] + 0.5*dt*qw[0]; - quat[1] = quat[1] + 0.5*dt*qw[1]; - quat[2] = quat[2] + 0.5*dt*qw[2]; - quat[3] = quat[3] + 0.5*dt*qw[3]; - + MathExtra::quatvec(quat, tmp, qw); + quat[0] = quat[0] + 0.5 * dt * qw[0]; + quat[1] = quat[1] + 0.5 * dt * qw[1]; + quat[2] = quat[2] + 0.5 * dt * qw[2]; + quat[3] = quat[3] + 0.5 * dt * qw[3]; + // normalisation introduces the stochastic drift term // to recover the Boltzmann distribution for the case of conservative torques MathExtra::qnormalize(quat); - + // next, update centre of mass positions and velocities - + // tmp now holds force in body frame - MathExtra::matvec(rotationmatrix_transpose,f[i],tmp); + MathExtra::matvec(rotationmatrix_transpose, f[i], tmp); // and then converts to gamma_t^{-1} * F (velocity) in body frame if (Tp_2D) { - tmp[2] = 0.0; - if (Tp_UNIFORM) { - tmp[0] = g1*tmp[0]*gamma_t_inv[0] - + gamma_t_invsqrt[0]*(random->uniform()-0.5)*g2; - tmp[1] = g1*tmp[1]*gamma_t_inv[1] - + gamma_t_invsqrt[1]*(random->uniform()-0.5)*g2; - - } else if (Tp_GAUSS) { - tmp[0] = g1*tmp[0]*gamma_t_inv[0] - + gamma_t_invsqrt[0]*random->gaussian()*g2; - tmp[1] = g1*tmp[1]*gamma_t_inv[1] - + gamma_t_invsqrt[1]*random->gaussian()*g2; - - } else { - tmp[0] = g1*tmp[0]*gamma_t_inv[0]; - tmp[1] = g1*tmp[1]*gamma_t_inv[1]; - - } + tmp[2] = 0.0; + if (Tp_UNIFORM) { + tmp[0] = g1 * tmp[0] * gamma_t_inv[0] + gamma_t_invsqrt[0] * (rng->uniform() - 0.5) * g2; + tmp[1] = g1 * tmp[1] * gamma_t_inv[1] + gamma_t_invsqrt[1] * (rng->uniform() - 0.5) * g2; + } else if (Tp_GAUSS) { + tmp[0] = g1 * tmp[0] * gamma_t_inv[0] + gamma_t_invsqrt[0] * rng->gaussian() * g2; + tmp[1] = g1 * tmp[1] * gamma_t_inv[1] + gamma_t_invsqrt[1] * rng->gaussian() * g2; + } else { + tmp[0] = g1 * tmp[0] * gamma_t_inv[0]; + tmp[1] = g1 * tmp[1] * gamma_t_inv[1]; + } } else { - if (Tp_UNIFORM) { - - tmp[0] = g1*tmp[0]*gamma_t_inv[0] - + gamma_t_invsqrt[0]*(random->uniform()-0.5)*g2; - tmp[1] = g1*tmp[1]*gamma_t_inv[1] - + gamma_t_invsqrt[1]*(random->uniform()-0.5)*g2; - tmp[2] = g1*tmp[2]*gamma_t_inv[2] - + gamma_t_invsqrt[2]*(random->uniform()-0.5)*g2; - - } else if (Tp_GAUSS) { - - tmp[0] = g1*tmp[0]*gamma_t_inv[0] - + gamma_t_invsqrt[0]*random->gaussian()*g2; - tmp[1] = g1*tmp[1]*gamma_t_inv[1] - + gamma_t_invsqrt[1]*random->gaussian()*g2; - tmp[2] = g1*tmp[2]*gamma_t_inv[2] - + gamma_t_invsqrt[2]*random->gaussian()*g2; - - - } else { - - tmp[0] = g1*tmp[0]*gamma_t_inv[0]; - tmp[1] = g1*tmp[1]*gamma_t_inv[1]; - tmp[2] = g1*tmp[2]*gamma_t_inv[2]; - } - } - - - - // finally, convert this back to lab-frame velocity and store in dv - MathExtra::transpose_matvec(rotationmatrix_transpose, tmp, dv ); - - - /* - if (Tp_UNIFORM) { - dv[0] = dt * (g1 * f[i][0] + g2 * (random->uniform()-0.5)); - dv[1] = dt * (g1 * f[i][1] + g2 * (random->uniform()-0.5)); - dv[2] = dt * (g1 * f[i][2] + g2 * (random->uniform()-0.5)); - - } else if (Tp_GAUSS) { - dv[0] = dt * (g1 * f[i][0] + g2 * random->gaussian()); - dv[1] = dt * (g1 * f[i][1] + g2 * random->gaussian()); - dv[2] = dt * (g1 * f[i][2] + g2 * random->gaussian()); - - } else { - dv[0] = dt * g1 * f[i][0]; - dv[1] = dt * g1 * f[i][1]; - dv[2] = dt * g1 * f[i][2]; - + if (Tp_UNIFORM) { + tmp[0] = g1 * tmp[0] * gamma_t_inv[0] + gamma_t_invsqrt[0] * (rng->uniform() - 0.5) * g2; + tmp[1] = g1 * tmp[1] * gamma_t_inv[1] + gamma_t_invsqrt[1] * (rng->uniform() - 0.5) * g2; + tmp[2] = g1 * tmp[2] * gamma_t_inv[2] + gamma_t_invsqrt[2] * (rng->uniform() - 0.5) * g2; + } else if (Tp_GAUSS) { + tmp[0] = g1 * tmp[0] * gamma_t_inv[0] + gamma_t_invsqrt[0] * rng->gaussian() * g2; + tmp[1] = g1 * tmp[1] * gamma_t_inv[1] + gamma_t_invsqrt[1] * rng->gaussian() * g2; + tmp[2] = g1 * tmp[2] * gamma_t_inv[2] + gamma_t_invsqrt[2] * rng->gaussian() * g2; + } else { + tmp[0] = g1 * tmp[0] * gamma_t_inv[0]; + tmp[1] = g1 * tmp[1] * gamma_t_inv[1]; + tmp[2] = g1 * tmp[2] * gamma_t_inv[2]; + } } - */ + + // finally, convert this back to lab-frame velocity and store in dv + MathExtra::transpose_matvec(rotationmatrix_transpose, tmp, dv); + v[i][0] = dv[0]; v[i][1] = dv[1]; v[i][2] = dv[2]; - - x[i][0] += dv[0]*dt; - x[i][1] += dv[1]*dt; - x[i][2] += dv[2]*dt; - + + x[i][0] += dv[0] * dt; + x[i][1] += dv[1] * dt; + x[i][2] += dv[2] * dt; + if (Tp_DIPOLE) { - - MathExtra::quat_to_mat_trans( quat, rotationmatrix_transpose ); - MathExtra::transpose_matvec(rotationmatrix_transpose, dipole_body, f_rot ); - - mu[i][0] = f_rot[0]; - mu[i][1] = f_rot[1]; - mu[i][2] = f_rot[2]; + MathExtra::quat_to_mat_trans(quat, rotationmatrix_transpose); + MathExtra::transpose_matvec(rotationmatrix_transpose, dipole_body, f_rot); + mu[i][0] = f_rot[0]; + mu[i][1] = f_rot[1]; + mu[i][2] = f_rot[2]; } } - } return; diff --git a/src/USER-BROWNIAN/fix_brownian_asphere.h b/src/USER-BROWNIAN/fix_brownian_asphere.h index c229ff1c8b..23a88ddaba 100644 --- a/src/USER-BROWNIAN/fix_brownian_asphere.h +++ b/src/USER-BROWNIAN/fix_brownian_asphere.h @@ -12,9 +12,9 @@ ------------------------------------------------------------------------- */ #ifdef FIX_CLASS - -FixStyle(brownian/asphere,FixBrownianAsphere) - +// clang-format off +FixStyle(brownian/asphere,FixBrownianAsphere); +// clang-format on #else #ifndef LMP_FIX_BROWNIAN_ASPHERE_H @@ -27,25 +27,18 @@ namespace LAMMPS_NS { class FixBrownianAsphere : public FixBrownianBase { public: FixBrownianAsphere(class LAMMPS *, int, char **); - virtual ~FixBrownianAsphere(); + virtual ~FixBrownianAsphere() {}; void initial_integrate(int); - void init(); protected: class AtomVecEllipsoid *avec; - + private: - template < int Tp_UNIFORM, int Tp_GAUSS, int Tp_DIPOLE, int Tp_2D > + template void initial_integrate_templated(); - - - - - }; - -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/USER-BROWNIAN/fix_brownian_base.cpp b/src/USER-BROWNIAN/fix_brownian_base.cpp index 1a571c7a74..93990681bd 100644 --- a/src/USER-BROWNIAN/fix_brownian_base.cpp +++ b/src/USER-BROWNIAN/fix_brownian_base.cpp @@ -12,35 +12,33 @@ ------------------------------------------------------------------------- */ /* ---------------------------------------------------------------------- - Originally modified from USER-CGDNA/fix_nve_dotc_langevin.cpp. + Originally modified from USER-CGDNA/fix_nve_dotc_langevin.cpp. Contributing author: Sam Cameron (University of Bristol) ------------------------------------------------------------------------- */ #include "fix_brownian.h" -#include -#include -#include "math_extra.h" #include "atom.h" -#include "force.h" -#include "update.h" #include "comm.h" #include "domain.h" -#include "random_mars.h" -#include "memory.h" #include "error.h" +#include "force.h" +#include "math_extra.h" +#include "memory.h" +#include "random_mars.h" +#include "update.h" +#include +#include using namespace LAMMPS_NS; using namespace FixConst; /* ---------------------------------------------------------------------- */ -FixBrownianBase::FixBrownianBase(LAMMPS *lmp, int narg, char **arg) : - Fix(lmp, narg, arg) +FixBrownianBase::FixBrownianBase(LAMMPS *lmp, int narg, char **arg) : Fix(lmp, narg, arg) { - time_integrate = 1; noise_flag = 1; @@ -48,142 +46,123 @@ FixBrownianBase::FixBrownianBase(LAMMPS *lmp, int narg, char **arg) : gamma_t_flag = gamma_r_flag = 0; gamma_t_eigen_flag = gamma_r_eigen_flag = 0; dipole_flag = 0; - - if (narg < 5) - error->all(FLERR,"Illegal fix brownian command."); - temp = utils::numeric(FLERR,arg[3],false,lmp); - if (temp <= 0) error->all(FLERR,"Fix brownian temp must be > 0."); - - seed = utils::inumeric(FLERR,arg[4],false,lmp); - if (seed <= 0) error->all(FLERR,"Fix brownian seed must be > 0."); + if (narg < 5) error->all(FLERR, "Illegal fix brownian command."); + temp = utils::numeric(FLERR, arg[3], false, lmp); + if (temp <= 0) error->all(FLERR, "Fix brownian temp must be > 0."); + + seed = utils::inumeric(FLERR, arg[4], false, lmp); + if (seed <= 0) error->all(FLERR, "Fix brownian seed must be > 0."); int iarg = 5; while (iarg < narg) { - if (strcmp(arg[iarg],"rng") == 0) { - if (narg == iarg + 1) { - error->all(FLERR,"Illegal fix brownian command."); - } - if (strcmp(arg[iarg + 1],"uniform") == 0) { - noise_flag = 1; - } else if (strcmp(arg[iarg + 1],"gaussian") == 0) { - noise_flag = 1; - gaussian_noise_flag = 1; - } else if (strcmp(arg[iarg + 1],"none") == 0) { - noise_flag = 0; + if (strcmp(arg[iarg], "rng") == 0) { + if (narg == iarg + 1) error->all(FLERR, "Illegal fix brownian command."); + if (strcmp(arg[iarg + 1], "uniform") == 0) { + noise_flag = 1; + } else if (strcmp(arg[iarg + 1], "gaussian") == 0) { + noise_flag = 1; + gaussian_noise_flag = 1; + } else if (strcmp(arg[iarg + 1], "none") == 0) { + noise_flag = 0; } else { - error->all(FLERR,"Illegal fix brownian command."); + error->all(FLERR, "Illegal fix brownian command."); } iarg = iarg + 2; - } else if (strcmp(arg[iarg],"dipole") == 0) { - if (narg == iarg + 3) { - error->all(FLERR,"Illegal fix brownian command."); - } + } else if (strcmp(arg[iarg], "dipole") == 0) { + if (narg == iarg + 3) error->all(FLERR, "Illegal fix brownian command."); dipole_flag = 1; dipole_body = new double[3]; - - dipole_body[0] = utils::numeric(FLERR,arg[iarg+1],false,lmp); - dipole_body[1] = utils::numeric(FLERR,arg[iarg+2],false,lmp); - dipole_body[2] = utils::numeric(FLERR,arg[iarg+3],false,lmp); + + dipole_body[0] = utils::numeric(FLERR, arg[iarg + 1], false, lmp); + dipole_body[1] = utils::numeric(FLERR, arg[iarg + 2], false, lmp); + dipole_body[2] = utils::numeric(FLERR, arg[iarg + 3], false, lmp); iarg = iarg + 4; - - } else if (strcmp(arg[iarg],"gamma_t_eigen") == 0) { - if (narg == iarg + 3) { - error->all(FLERR,"Illegal fix brownian command."); - } + + } else if (strcmp(arg[iarg], "gamma_t_eigen") == 0) { + if (narg == iarg + 3) error->all(FLERR, "Illegal fix brownian command."); gamma_t_eigen_flag = 1; gamma_t_inv = new double[3]; gamma_t_invsqrt = new double[3]; - gamma_t_inv[0] = 1./utils::numeric(FLERR,arg[iarg+1],false,lmp); - gamma_t_inv[1] = 1./utils::numeric(FLERR,arg[iarg+2],false,lmp); + gamma_t_inv[0] = 1. / utils::numeric(FLERR, arg[iarg + 1], false, lmp); + gamma_t_inv[1] = 1. / utils::numeric(FLERR, arg[iarg + 2], false, lmp); if (domain->dimension == 2) { - if (strcmp(arg[iarg+3],"inf") != 0) { - error->all(FLERR,"Fix brownian gamma_t_eigen third value must be inf for 2D system."); - } - gamma_t_inv[2] = 0; - } else { - gamma_t_inv[2] = 1./utils::numeric(FLERR,arg[iarg+3],false,lmp); + if (strcmp(arg[iarg + 3], "inf") != 0) { + error->all(FLERR, "Fix brownian gamma_t_eigen third value must be inf for 2D system."); + } + gamma_t_inv[2] = 0; + } else { + gamma_t_inv[2] = 1.0 / utils::numeric(FLERR, arg[iarg + 3], false, lmp); } - if (gamma_t_inv[0] < 0 || gamma_t_inv[1] < 0 || gamma_t_inv[2] < 0) - error->all(FLERR,"Fix brownian gamma_t_eigen values must be > 0."); - + if (gamma_t_inv[0] < 0 || gamma_t_inv[1] < 0 || gamma_t_inv[2] < 0) + error->all(FLERR, "Fix brownian gamma_t_eigen values must be > 0."); + gamma_t_invsqrt[0] = sqrt(gamma_t_inv[0]); gamma_t_invsqrt[1] = sqrt(gamma_t_inv[1]); - gamma_t_invsqrt[2] = sqrt(gamma_t_inv[2]); + gamma_t_invsqrt[2] = sqrt(gamma_t_inv[2]); iarg = iarg + 4; - } else if (strcmp(arg[iarg],"gamma_r_eigen") == 0) { - if (narg == iarg + 3) { - error->all(FLERR,"Illegal fix brownian command."); - } + } else if (strcmp(arg[iarg], "gamma_r_eigen") == 0) { + if (narg == iarg + 3) error->all(FLERR, "Illegal fix brownian command."); - gamma_r_eigen_flag = 1; + gamma_r_eigen_flag = 1; gamma_r_inv = new double[3]; gamma_r_invsqrt = new double[3]; - if (domain->dimension == 2) { - if (strcmp(arg[iarg+1],"inf") != 0) { - error->all(FLERR,"Fix brownian gamma_r_eigen first value must be inf for 2D system."); - } - gamma_r_inv[0] = 0; + if (strcmp(arg[iarg + 1], "inf") != 0) { + error->all(FLERR, "Fix brownian gamma_r_eigen first value must be inf for 2D system."); + } + gamma_r_inv[0] = 0; - if (strcmp(arg[iarg+2],"inf") != 0) { - error->all(FLERR,"Fix brownian gamma_r_eigen second value must be inf for 2D system."); - } - gamma_r_inv[1] = 0; + if (strcmp(arg[iarg + 2], "inf") != 0) { + error->all(FLERR, "Fix brownian gamma_r_eigen second value must be inf for 2D system."); + } + gamma_r_inv[1] = 0; } else { - gamma_r_inv[0] = 1./utils::numeric(FLERR,arg[iarg+1],false,lmp); - gamma_r_inv[1] = 1./utils::numeric(FLERR,arg[iarg+2],false,lmp); - + gamma_r_inv[0] = 1. / utils::numeric(FLERR, arg[iarg + 1], false, lmp); + gamma_r_inv[1] = 1. / utils::numeric(FLERR, arg[iarg + 2], false, lmp); } - - gamma_r_inv[2] = 1./utils::numeric(FLERR,arg[iarg+3],false,lmp); - if (gamma_r_inv[0] < 0 || gamma_r_inv[1] < 0 || gamma_r_inv[2] < 0) - error->all(FLERR,"Fix brownian gamma_r_eigen values must be > 0."); - + gamma_r_inv[2] = 1. / utils::numeric(FLERR, arg[iarg + 3], false, lmp); + + if (gamma_r_inv[0] < 0 || gamma_r_inv[1] < 0 || gamma_r_inv[2] < 0) + error->all(FLERR, "Fix brownian gamma_r_eigen values must be > 0."); + gamma_r_invsqrt[0] = sqrt(gamma_r_inv[0]); gamma_r_invsqrt[1] = sqrt(gamma_r_inv[1]); gamma_r_invsqrt[2] = sqrt(gamma_r_inv[2]); iarg = iarg + 4; - - } else if (strcmp(arg[iarg],"gamma_t") == 0) { - if (narg == iarg + 1) { - error->all(FLERR,"Illegal fix brownian command."); - } - + + } else if (strcmp(arg[iarg], "gamma_t") == 0) { + if (narg == iarg + 1) { error->all(FLERR, "Illegal fix brownian command."); } + gamma_t_flag = 1; - gamma_t = utils::numeric(FLERR,arg[iarg+1],false,lmp); - if (gamma_t <= 0) - error->all(FLERR,"Fix brownian gamma_t must be > 0."); + gamma_t = utils::numeric(FLERR, arg[iarg + 1], false, lmp); + if (gamma_t <= 0) error->all(FLERR, "Fix brownian gamma_t must be > 0."); iarg = iarg + 2; - } else if (strcmp(arg[iarg],"gamma_r") == 0) { - if (narg == iarg + 1) { - error->all(FLERR,"Illegal fix brownian command."); - } + } else if (strcmp(arg[iarg], "gamma_r") == 0) { + if (narg == iarg + 1) { error->all(FLERR, "Illegal fix brownian command."); } gamma_r_flag = 1; - gamma_r = utils::numeric(FLERR,arg[iarg+1],false,lmp); - if (gamma_r <= 0) - error->all(FLERR,"Fix brownian gamma_r must be > 0."); + gamma_r = utils::numeric(FLERR, arg[iarg + 1], false, lmp); + if (gamma_r <= 0) error->all(FLERR, "Fix brownian gamma_r must be > 0."); iarg = iarg + 2; } else { - error->all(FLERR,"Illegal fix brownian command."); + error->all(FLERR, "Illegal fix brownian command."); } } - - // initialize Marsaglia RNG with processor-unique seed - random = new RanMars(lmp,seed + comm->me); + // initialize Marsaglia RNG with processor-unique seed + rng = new RanMars(lmp, seed + comm->me); } /* ---------------------------------------------------------------------- */ @@ -201,50 +180,39 @@ FixBrownianBase::~FixBrownianBase() { if (gamma_t_eigen_flag) { - delete [] gamma_t_inv; - delete [] gamma_t_invsqrt; + delete[] gamma_t_inv; + delete[] gamma_t_invsqrt; } if (gamma_r_eigen_flag) { - delete [] gamma_r_inv; - delete [] gamma_r_invsqrt; + delete[] gamma_r_inv; + delete[] gamma_r_invsqrt; } - if (dipole_flag) { - delete [] dipole_body; - } - - - delete random; + if (dipole_flag) { delete[] dipole_body; } + delete rng; } - - /* ---------------------------------------------------------------------- */ void FixBrownianBase::init() { dt = update->dt; sqrtdt = sqrt(dt); - - g1 = force->ftm2v; + + g1 = force->ftm2v; if (noise_flag == 0) { g2 = 0; } else if (gaussian_noise_flag == 1) { - g2 = sqrt(2 * force->boltz*temp/dt/force->mvv2e); + g2 = sqrt(2 * force->boltz * temp / dt / force->mvv2e); } else { - g2 = sqrt( 24 * force->boltz*temp/dt/force->mvv2e); + g2 = sqrt(24 * force->boltz * temp / dt / force->mvv2e); } - - } - - void FixBrownianBase::reset_dt() { double sqrtdt_old = sqrtdt; dt = update->dt; sqrtdt = sqrt(dt); - g2 *= sqrtdt_old/sqrtdt; - + g2 *= sqrtdt_old / sqrtdt; } diff --git a/src/USER-BROWNIAN/fix_brownian_base.h b/src/USER-BROWNIAN/fix_brownian_base.h index 356742f314..5d3b7fe69b 100644 --- a/src/USER-BROWNIAN/fix_brownian_base.h +++ b/src/USER-BROWNIAN/fix_brownian_base.h @@ -11,14 +11,12 @@ See the README file in the top-level LAMMPS directory. ------------------------------------------------------------------------- */ - #ifndef LMP_FIX_BROWNIAN_BASE_H #define LMP_FIX_BROWNIAN_BASE_H #include "fix.h" namespace LAMMPS_NS { - class FixBrownianBase : public Fix { public: @@ -29,42 +27,32 @@ class FixBrownianBase : public Fix { void reset_dt(); protected: - int seed; // RNG seed - double dt, sqrtdt; // time step interval and its sqrt + int seed; // RNG seed + double dt, sqrtdt; // time step interval and its sqrt + int gamma_t_flag; // 0/1 if isotropic translational damping is unset/set + int gamma_r_flag; // 0/1 if isotropic rotational damping is unset/set + int gamma_t_eigen_flag; // 0/1 if anisotropic translational damping is unset/set + int gamma_r_eigen_flag; // 0/1 if anisotropic rotational damping is unset/set - int gamma_t_flag; // 0/1 if isotropic translational damping is unset/set - int gamma_r_flag; // 0/1 if isotropic rotational damping is unset/set - double gamma_t,gamma_r; // translational and rotational (isotropic) damping params - - - int gamma_t_eigen_flag; // 0/1 if anisotropic translational damping is unset/set - int gamma_r_eigen_flag; // 0/1 if anisotropic rotational damping is unset/set - - double *gamma_t_inv; // anisotropic damping parameter eigenvalues + double gamma_t, gamma_r; // translational and rotational (isotropic) damping params + double *gamma_t_inv; // anisotropic damping parameter eigenvalues double *gamma_r_inv; double *gamma_t_invsqrt; double *gamma_r_invsqrt; - int dipole_flag; // set if dipole is used for asphere double *dipole_body; // direction dipole is slaved to in body frame - int noise_flag; // 0/1 for noise off/on - int gaussian_noise_flag; // 0/1 for uniform/gaussian noise - - double temp; // temperature - - - - double g1,g2; // prefactors in time stepping - - - class RanMars *random; + int noise_flag; // 0/1 for noise off/on + int gaussian_noise_flag; // 0/1 for uniform/gaussian noise + double temp; // temperature + double g1, g2; // prefactors in time stepping + class RanMars *rng; }; -} +} // namespace LAMMPS_NS #endif /* ERROR/WARNING messages: diff --git a/src/USER-BROWNIAN/fix_brownian_sphere.cpp b/src/USER-BROWNIAN/fix_brownian_sphere.cpp index a01eaac719..00893d77e7 100644 --- a/src/USER-BROWNIAN/fix_brownian_sphere.cpp +++ b/src/USER-BROWNIAN/fix_brownian_sphere.cpp @@ -12,108 +12,81 @@ ------------------------------------------------------------------------- */ /* ---------------------------------------------------------------------- - Originally modified from USER-CGDNA/fix_nve_dotc_langevin.cpp. + Originally modified from USER-CGDNA/fix_nve_dotc_langevin.cpp. Contributing author: Sam Cameron (University of Bristol) ------------------------------------------------------------------------- */ #include "fix_brownian_sphere.h" -#include -#include -#include "math_extra.h" #include "atom.h" -#include "force.h" -#include "update.h" #include "comm.h" #include "domain.h" -#include "random_mars.h" -#include "memory.h" #include "error.h" +#include "force.h" +#include "math_extra.h" +#include "memory.h" +#include "random_mars.h" +#include "update.h" +#include +#include using namespace LAMMPS_NS; using namespace FixConst; - - /* ---------------------------------------------------------------------- */ FixBrownianSphere::FixBrownianSphere(LAMMPS *lmp, int narg, char **arg) : - FixBrownianBase(lmp, narg, arg) + FixBrownianBase(lmp, narg, arg) { - if (gamma_t_eigen_flag || gamma_r_eigen_flag) { - error->all(FLERR,"Illegal fix brownian command."); + error->all(FLERR, "Illegal fix brownian command."); } - if (!gamma_t_flag || !gamma_r_flag) { - error->all(FLERR,"Illegal fix brownian command."); - } - - - if (!atom->mu_flag) - error->all(FLERR,"Fix brownian/sphere requires atom attribute mu"); - - + if (!gamma_t_flag || !gamma_r_flag) { error->all(FLERR, "Illegal fix brownian command."); } + if (!atom->mu_flag) error->all(FLERR, "Fix brownian/sphere requires atom attribute mu"); } - -/* ---------------------------------------------------------------------- */ - -FixBrownianSphere::~FixBrownianSphere() -{ -} - - - /* ---------------------------------------------------------------------- */ void FixBrownianSphere::init() { - FixBrownianBase::init(); - - g3 = g1/gamma_r; - g4 = g2/sqrt(gamma_r); - + + g3 = g1 / gamma_r; + g4 = g2 / sqrt(gamma_r); g1 /= gamma_t; g2 /= sqrt(gamma_t); - - } /* ---------------------------------------------------------------------- */ void FixBrownianSphere::initial_integrate(int /*vflag */) { - if (domain->dimension == 2) { - if (!noise_flag) { - initial_integrate_templated<0,0,1>(); + initial_integrate_templated<0, 0, 1>(); } else if (gaussian_noise_flag) { - initial_integrate_templated<0,1,1>(); + initial_integrate_templated<0, 1, 1>(); } else { - initial_integrate_templated<1,0,1>(); + initial_integrate_templated<1, 0, 1>(); } } else { if (!noise_flag) { - initial_integrate_templated<0,0,0>(); + initial_integrate_templated<0, 0, 0>(); } else if (gaussian_noise_flag) { - initial_integrate_templated<0,1,0>(); + initial_integrate_templated<0, 1, 0>(); } else { - initial_integrate_templated<1,0,0>(); + initial_integrate_templated<1, 0, 0>(); } } - return; } - /* ---------------------------------------------------------------------- */ -template < int Tp_UNIFORM, int Tp_GAUSS, int Tp_2D > +template void FixBrownianSphere::initial_integrate_templated() { double **x = atom->x; @@ -121,112 +94,92 @@ void FixBrownianSphere::initial_integrate_templated() double **f = atom->f; int *mask = atom->mask; int nlocal = atom->nlocal; - double wx,wy,wz; + double wx, wy, wz; double **torque = atom->torque; double **mu = atom->mu; - double mux,muy,muz,mulen; - + double mux, muy, muz, mulen; + if (igroup == atom->firstgroup) nlocal = atom->nfirst; - - - double dx,dy,dz; - + + double dx, dy, dz; + for (int i = 0; i < nlocal; i++) { if (mask[i] & groupbit) { - if (Tp_2D) { - dz = 0; - wx = wy = 0; - if (Tp_UNIFORM) { - dx = dt * (g1 * f[i][0] + g2 * (random->uniform()-0.5)); - dy = dt * (g1 * f[i][1] + g2 * (random->uniform()-0.5)); - wz = (random->uniform()-0.5)*g4; - - } else if (Tp_GAUSS) { - dx = dt * (g1 * f[i][0] + g2 * random->gaussian()); - dy = dt * (g1 * f[i][1] + g2 * random->gaussian()); - wz = random->gaussian()*g4; - - - } else { - dx = dt * g1 * f[i][0]; - dy = dt * g1 * f[i][1]; - wz = 0; - - } + dz = 0; + wx = wy = 0; + if (Tp_UNIFORM) { + dx = dt * (g1 * f[i][0] + g2 * (rng->uniform() - 0.5)); + dy = dt * (g1 * f[i][1] + g2 * (rng->uniform() - 0.5)); + wz = (rng->uniform() - 0.5) * g4; + } else if (Tp_GAUSS) { + dx = dt * (g1 * f[i][0] + g2 * rng->gaussian()); + dy = dt * (g1 * f[i][1] + g2 * rng->gaussian()); + wz = rng->gaussian() * g4; + } else { + dx = dt * g1 * f[i][0]; + dy = dt * g1 * f[i][1]; + wz = 0; + } } else { - if (Tp_UNIFORM) { - dx = dt * (g1 * f[i][0] + g2 * (random->uniform()-0.5)); - dy = dt * (g1 * f[i][1] + g2 * (random->uniform()-0.5)); - dz = dt * (g1 * f[i][2] + g2 * (random->uniform()-0.5)); - wx = (random->uniform()-0.5)*g4; - wy = (random->uniform()-0.5)*g4; - wz = (random->uniform()-0.5)*g4; - - } else if (Tp_GAUSS) { - dx = dt * (g1 * f[i][0] + g2 * random->gaussian()); - dy = dt * (g1 * f[i][1] + g2 * random->gaussian()); - dz = dt * (g1 * f[i][2] + g2 * random->gaussian()); - wx = random->gaussian()*g4; - wy = random->gaussian()*g4; - wz = random->gaussian()*g4; - - - } else { - dx = dt * g1 * f[i][0]; - dy = dt * g1 * f[i][1]; - dz = dt * g1 * f[i][2]; - wx = wy = wz = 0; - - } + if (Tp_UNIFORM) { + dx = dt * (g1 * f[i][0] + g2 * (rng->uniform() - 0.5)); + dy = dt * (g1 * f[i][1] + g2 * (rng->uniform() - 0.5)); + dz = dt * (g1 * f[i][2] + g2 * (rng->uniform() - 0.5)); + wx = (rng->uniform() - 0.5) * g4; + wy = (rng->uniform() - 0.5) * g4; + wz = (rng->uniform() - 0.5) * g4; + } else if (Tp_GAUSS) { + dx = dt * (g1 * f[i][0] + g2 * rng->gaussian()); + dy = dt * (g1 * f[i][1] + g2 * rng->gaussian()); + dz = dt * (g1 * f[i][2] + g2 * rng->gaussian()); + wx = rng->gaussian() * g4; + wy = rng->gaussian() * g4; + wz = rng->gaussian() * g4; + } else { + dx = dt * g1 * f[i][0]; + dy = dt * g1 * f[i][1]; + dz = dt * g1 * f[i][2]; + wx = wy = wz = 0; + } } - - x[i][0] += dx; - v[i][0] = dx/dt; - - - x[i][1] += dy; - v[i][1] = dy/dt; - - - x[i][2] += dz; - v[i][2] = dz/dt; + x[i][0] += dx; + v[i][0] = dx / dt; + + x[i][1] += dy; + v[i][1] = dy / dt; + + x[i][2] += dz; + v[i][2] = dz / dt; + + wx += g3 * torque[i][0]; + wy += g3 * torque[i][1]; + wz += g3 * torque[i][2]; - - wx += g3*torque[i][0]; - wy += g3*torque[i][1]; - wz += g3*torque[i][2]; - - // store length of dipole as we need to convert it to a unit vector and // then back again - - mulen = sqrt(mu[i][0]*mu[i][0] + mu[i][1]*mu[i][1] + mu[i][2]*mu[i][2]); + + mulen = sqrt(mu[i][0] * mu[i][0] + mu[i][1] * mu[i][1] + mu[i][2] * mu[i][2]); // unit vector at time t - mux = mu[i][0]/mulen; - muy = mu[i][1]/mulen; - muz = mu[i][2]/mulen; - - + mux = mu[i][0] / mulen; + muy = mu[i][1] / mulen; + muz = mu[i][2] / mulen; // un-normalised unit vector at time t + dt - mu[i][0] = mux + (wy*muz - wz*muy)*dt; - mu[i][1] = muy + (wz*mux - wx*muz)*dt; - mu[i][2] = muz + (wx*muy - wy*mux)*dt; - + mu[i][0] = mux + (wy * muz - wz * muy) * dt; + mu[i][1] = muy + (wz * mux - wx * muz) * dt; + mu[i][2] = muz + (wx * muy - wy * mux) * dt; + // normalisation introduces the stochastic drift term due to changing from // Stratonovich to Ito interpretation MathExtra::norm3(mu[i]); // multiply by original magnitude to obtain dipole of same length - mu[i][0] = mu[i][0]*mulen; - mu[i][1] = mu[i][1]*mulen; - mu[i][2] = mu[i][2]*mulen; - + mu[i][0] = mu[i][0] * mulen; + mu[i][1] = mu[i][1] * mulen; + mu[i][2] = mu[i][2] * mulen; } } - - return; } diff --git a/src/USER-BROWNIAN/fix_brownian_sphere.h b/src/USER-BROWNIAN/fix_brownian_sphere.h index e518d28db3..19e86204ad 100644 --- a/src/USER-BROWNIAN/fix_brownian_sphere.h +++ b/src/USER-BROWNIAN/fix_brownian_sphere.h @@ -12,9 +12,9 @@ ------------------------------------------------------------------------- */ #ifdef FIX_CLASS - -FixStyle(brownian/sphere,FixBrownianSphere) - +// clang-format off +FixStyle(brownian/sphere,FixBrownianSphere); +// clang-format on #else #ifndef LMP_FIX_BROWNIAN_SPHERE_H @@ -27,18 +27,16 @@ namespace LAMMPS_NS { class FixBrownianSphere : public FixBrownianBase { public: FixBrownianSphere(class LAMMPS *, int, char **); - virtual ~FixBrownianSphere(); + virtual ~FixBrownianSphere() {}; void init(); - void initial_integrate(int /*vflag */); - + void initial_integrate(int); private: - template < int Tp_UNIFORM, int Tp_GAUSS, int Tp_2D > + template void initial_integrate_templated(); - double g3,g4; + double g3, g4; }; - -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/USER-BROWNIAN/fix_propel_self.cpp b/src/USER-BROWNIAN/fix_propel_self.cpp index 067fec3bf8..9adb49d039 100644 --- a/src/USER-BROWNIAN/fix_propel_self.cpp +++ b/src/USER-BROWNIAN/fix_propel_self.cpp @@ -36,60 +36,54 @@ using namespace LAMMPS_NS; using namespace FixConst; -enum{DIPOLE,VELOCITY,QUAT}; +enum { DIPOLE, VELOCITY, QUAT }; #define TOL 1e-14 /* ---------------------------------------------------------------------- */ -FixPropelSelf::FixPropelSelf(LAMMPS *lmp, int narg, char **arg) : - Fix(lmp, narg, arg) +FixPropelSelf::FixPropelSelf(LAMMPS *lmp, int narg, char **arg) : Fix(lmp, narg, arg) { virial_global_flag = virial_peratom_flag = 1; - if (narg != 5 && narg != 9) - error->all(FLERR,"Illegal fix propel/self command"); + if (narg != 5 && narg != 9) error->all(FLERR, "Illegal fix propel/self command"); - - if (strcmp(arg[3],"velocity") == 0) { + if (strcmp(arg[3], "velocity") == 0) { mode = VELOCITY; thermo_virial = 0; - } else if (strcmp(arg[3],"dipole") == 0) { + } else if (strcmp(arg[3], "dipole") == 0) { mode = DIPOLE; thermo_virial = 1; - } else if (strcmp(arg[3],"quat") == 0) { + } else if (strcmp(arg[3], "quat") == 0) { mode = QUAT; thermo_virial = 1; } else { - error->all(FLERR,"Illegal fix propel/self command"); + error->all(FLERR, "Illegal fix propel/self command"); } - magnitude = utils::numeric(FLERR,arg[4],false,lmp); + magnitude = utils::numeric(FLERR, arg[4], false, lmp); // check for keyword if (narg == 9) { - if (mode != QUAT) { - error->all(FLERR,"Illegal fix propel/self command"); - } - if (strcmp(arg[5],"qvector") == 0) { - sx = utils::numeric(FLERR,arg[6],false,lmp); - sy = utils::numeric(FLERR,arg[7],false,lmp); - sz = utils::numeric(FLERR,arg[8],false,lmp); - double snorm = sqrt(sx*sx + sy*sy + sz*sz); - sx = sx/snorm; - sy = sy/snorm; - sz = sz/snorm; + if (mode != QUAT) { error->all(FLERR, "Illegal fix propel/self command"); } + if (strcmp(arg[5], "qvector") == 0) { + sx = utils::numeric(FLERR, arg[6], false, lmp); + sy = utils::numeric(FLERR, arg[7], false, lmp); + sz = utils::numeric(FLERR, arg[8], false, lmp); + double snorm = sqrt(sx * sx + sy * sy + sz * sz); + sx = sx / snorm; + sy = sy / snorm; + sz = sz / snorm; } else { - error->all(FLERR,"Illegal fix propel/self command"); + error->all(FLERR, "Illegal fix propel/self command"); } } else { sx = 1.0; sy = 0.0; sz = 0.0; } - } /* ---------------------------------------------------------------------- */ @@ -101,27 +95,16 @@ int FixPropelSelf::setmask() return mask; } -/* ---------------------------------------------------------------------- */ - -FixPropelSelf::~FixPropelSelf() -{ - -} - - /* ---------------------------------------------------------------------- */ void FixPropelSelf::init() { if (mode == DIPOLE && !atom->mu_flag) - error->all(FLERR,"Fix propel/self requires atom attribute mu " - "with option dipole."); + error->all(FLERR, "Fix propel/self requires atom attribute mu with option dipole"); if (mode == QUAT) { avec = (AtomVecEllipsoid *) atom->style_match("ellipsoid"); - if (!avec) - error->all(FLERR,"Fix propel/self requires " - "atom style ellipsoid with option quat."); + if (!avec) error->all(FLERR, "Fix propel/self requires atom style ellipsoid with option quat"); // check that all particles are finite-size ellipsoids // no point particles allowed, spherical is OK @@ -133,17 +116,19 @@ void FixPropelSelf::init() for (int i = 0; i < nlocal; i++) if (mask[i] & groupbit) if (ellipsoid[i] < 0) - error->one(FLERR,"Fix propel/self requires extended particles " - "with option quat."); + error->one(FLERR, "Fix propel/self requires extended particles with option quat"); } - } +/* ---------------------------------------------------------------------- */ + void FixPropelSelf::setup(int vflag) { post_force(vflag); } +/* ---------------------------------------------------------------------- */ + void FixPropelSelf::post_force(int vflag) { if (mode == DIPOLE) @@ -152,9 +137,9 @@ void FixPropelSelf::post_force(int vflag) post_force_velocity(vflag); else if (mode == QUAT) post_force_quaternion(vflag); - } +/* ---------------------------------------------------------------------- */ void FixPropelSelf::post_force_dipole(int vflag) { @@ -163,13 +148,14 @@ void FixPropelSelf::post_force_dipole(int vflag) int nlocal = atom->nlocal; double **x = atom->x; double **mu = atom->mu; - double fx,fy,fz; - + double fx, fy, fz; // energy and virial setup double vi[6]; - if (vflag) v_setup(vflag); - else evflag = 0; + if (vflag) + v_setup(vflag); + else + evflag = 0; // if domain has PBC, need to unwrap for virial double unwrap[3]; @@ -179,26 +165,27 @@ void FixPropelSelf::post_force_dipole(int vflag) for (int i = 0; i < nlocal; i++) if (mask[i] & groupbit) { - fx = magnitude*mu[i][0]; - fy = magnitude*mu[i][1]; - fz = magnitude*mu[i][2]; + fx = magnitude * mu[i][0]; + fy = magnitude * mu[i][1]; + fz = magnitude * mu[i][2]; f[i][0] += fx; f[i][1] += fy; f[i][2] += fz; if (evflag) { - domain->unmap(x[i],image[i],unwrap); - vi[0] = fx*unwrap[0]; - vi[1] = fy*unwrap[1]; - vi[2] = fz*unwrap[2]; - vi[3] = fx*unwrap[1]; - vi[4] = fx*unwrap[2]; - vi[5] = fy*unwrap[2]; + domain->unmap(x[i], image[i], unwrap); + vi[0] = fx * unwrap[0]; + vi[1] = fy * unwrap[1]; + vi[2] = fz * unwrap[2]; + vi[3] = fx * unwrap[1]; + vi[4] = fx * unwrap[2]; + vi[5] = fy * unwrap[2]; v_tally(i, vi); } } } +/* ---------------------------------------------------------------------- */ void FixPropelSelf::post_force_velocity(int vflag) { @@ -207,23 +194,24 @@ void FixPropelSelf::post_force_velocity(int vflag) double **x = atom->x; int *mask = atom->mask; int nlocal = atom->nlocal; - double nv2,fnorm,fx,fy,fz; - + double nv2, fnorm, fx, fy, fz; // energy and virial setup double vi[6]; - if (vflag) v_setup(vflag); - else evflag = 0; + if (vflag) + v_setup(vflag); + else + evflag = 0; // if domain has PBC, need to unwrap for virial double unwrap[3]; imageint *image = atom->image; // Add the active force to the atom force: - for(int i = 0; i < nlocal; ++i) { - if(mask[i] & groupbit) { + for (int i = 0; i < nlocal; ++i) { + if (mask[i] & groupbit) { - nv2 = v[i][0]*v[i][0] + v[i][1]*v[i][1] + v[i][2]*v[i][2]; + nv2 = v[i][0] * v[i][0] + v[i][1] * v[i][1] + v[i][2] * v[i][2]; fnorm = 0.0; if (nv2 > TOL) { @@ -242,69 +230,72 @@ void FixPropelSelf::post_force_velocity(int vflag) f[i][2] += fz; if (evflag) { - domain->unmap(x[i],image[i],unwrap); - vi[0] = fx*unwrap[0]; - vi[1] = fy*unwrap[1]; - vi[2] = fz*unwrap[2]; - vi[3] = fx*unwrap[1]; - vi[4] = fx*unwrap[2]; - vi[5] = fy*unwrap[2]; + domain->unmap(x[i], image[i], unwrap); + vi[0] = fx * unwrap[0]; + vi[1] = fy * unwrap[1]; + vi[2] = fz * unwrap[2]; + vi[3] = fx * unwrap[1]; + vi[4] = fx * unwrap[2]; + vi[5] = fy * unwrap[2]; v_tally(i, vi); } } } } +/* ---------------------------------------------------------------------- */ + void FixPropelSelf::post_force_quaternion(int vflag) { double **f = atom->f; double **x = atom->x; int *mask = atom->mask; int nlocal = atom->nlocal; - int* ellipsoid = atom->ellipsoid; + int *ellipsoid = atom->ellipsoid; // ellipsoidal properties AtomVecEllipsoid::Bonus *bonus = avec->bonus; - double f_act[3] = { sx, sy, sz }; + double f_act[3] = {sx, sy, sz}; double f_rot[3]; double *quat; double Q[3][3]; - double fx,fy,fz; - + double fx, fy, fz; // energy and virial setup double vi[6]; - if (vflag) v_setup(vflag); - else evflag = 0; + if (vflag) + v_setup(vflag); + else + evflag = 0; // if domain has PBC, need to unwrap for virial double unwrap[3]; imageint *image = atom->image; // Add the active force to the atom force: - for(int i = 0; i < nlocal; ++i) { - if(mask[i] & groupbit) { + for (int i = 0; i < nlocal; ++i) { + if (mask[i] & groupbit) { quat = bonus[ellipsoid[i]].quat; MathExtra::quat_to_mat(quat, Q); MathExtra::matvec(Q, f_act, f_rot); - fx = magnitude*f_rot[0]; - fy = magnitude*f_rot[1]; - fz = magnitude*f_rot[2]; + fx = magnitude * f_rot[0]; + fy = magnitude * f_rot[1]; + fz = magnitude * f_rot[2]; f[i][0] += fx; f[i][1] += fy; f[i][2] += fz; if (evflag) { - domain->unmap(x[i],image[i],unwrap); - vi[0] = fx*unwrap[0]; - vi[1] = fy*unwrap[1]; - vi[2] = fz*unwrap[2]; - vi[3] = fx*unwrap[1]; - vi[4] = fx*unwrap[2]; - vi[5] = fy*unwrap[2]; + domain->unmap(x[i], image[i], unwrap); + vi[0] = fx * unwrap[0]; + vi[1] = fy * unwrap[1]; + vi[2] = fz * unwrap[2]; + vi[3] = fx * unwrap[1]; + vi[4] = fx * unwrap[2]; + vi[5] = fy * unwrap[2]; v_tally(i, vi); } } diff --git a/src/USER-BROWNIAN/fix_propel_self.h b/src/USER-BROWNIAN/fix_propel_self.h index 154cef0e2d..9874635818 100644 --- a/src/USER-BROWNIAN/fix_propel_self.h +++ b/src/USER-BROWNIAN/fix_propel_self.h @@ -12,9 +12,9 @@ ------------------------------------------------------------------------- */ #ifdef FIX_CLASS - -FixStyle(propel/self,FixPropelSelf) - +// clang-format off +FixStyle(propel/self,FixPropelSelf); +// clang-format on #else #ifndef LMP_FIX_PROPEL_SELF_H @@ -26,7 +26,7 @@ namespace LAMMPS_NS { class FixPropelSelf : public Fix { public: FixPropelSelf(class LAMMPS *, int, char **); - virtual ~FixPropelSelf(); + virtual ~FixPropelSelf() {}; void init(); void post_force(int); void setup(int); @@ -34,7 +34,7 @@ class FixPropelSelf : public Fix { private: double magnitude; - double sx,sy,sz; + double sx, sy, sz; int mode; void post_force_dipole(int); @@ -42,10 +42,8 @@ class FixPropelSelf : public Fix { void post_force_quaternion(int); class AtomVecEllipsoid *avec; - }; - -} +} // namespace LAMMPS_NS #endif #endif From 57a2f217576a9567bcf2083ee4bf07b88ef4fa3b Mon Sep 17 00:00:00 2001 From: Axel Kohlmeyer Date: Tue, 11 May 2021 21:13:10 -0400 Subject: [PATCH 21/22] add/update USER-BROWNIAN example inputs and logs --- .../USER/brownian/2d_velocity/in2d.velocity | 32 +-- .../log.11May2021.in2d_velocity.g++.1 | 151 +++++++++++ .../log.11May2021.in2d_velocity.g++.4 | 151 +++++++++++ .../2d_velocity/log_1_1_4_2d.lammps.log | 244 ------------------ examples/USER/brownian/asphere/in2d.ellipsoid | 62 ++--- examples/USER/brownian/asphere/in3d.ellipsoid | 63 ++--- .../log.11May2021.in2d.ellipsoid.g++.1 | 145 +++++++++++ .../log.11May2021.in2d.ellipsoid.g++.4 | 145 +++++++++++ .../log.11May2021.in3d.ellipsoid.g++.1 | 145 +++++++++++ .../log.11May2021.in3d.ellipsoid.g++.4 | 145 +++++++++++ examples/USER/brownian/point/in2d.point | 45 +--- examples/USER/brownian/point/in3d.point | 43 +-- .../point/log.11May2021.in2d.point.g++.1 | 119 +++++++++ .../point/log.11May2021.in2d.point.g++.4 | 119 +++++++++ .../point/log.11May2021.in3d.point.g++.1 | 119 +++++++++ .../point/log.11May2021.in3d.point.g++.4 | 119 +++++++++ examples/USER/brownian/sphere/in2d.sphere | 49 +--- examples/USER/brownian/sphere/in3d.sphere | 48 +--- .../sphere/log.11May2021.in2d.sphere.g++.1 | 126 +++++++++ .../sphere/log.11May2021.in2d.sphere.g++.4 | 126 +++++++++ .../sphere/log.11May2021.in3d.sphere.g++.1 | 126 +++++++++ .../sphere/log.11May2021.in3d.sphere.g++.4 | 126 +++++++++ examples/USER/brownian/spherical_ABP/in2d.abp | 39 ++- .../brownian/spherical_ABP/in3d.ideal_abp | 39 ++- .../log.11May2021.in2d.apb.g++.1 | 221 ++++++++++++++++ .../log.11May2021.in2d.apb.g++.4 | 221 ++++++++++++++++ .../log.11May2021.in3d.ideal_apb.g++.1 | 210 +++++++++++++++ .../log.11May2021.in3d.ideal_apb.g++.4 | 210 +++++++++++++++ .../log_WCA_1_1_1_3_4_2d.lammps.log | 163 ------------ .../log_ideal_1_1_1_3_4_3d.lammps.log | 150 ----------- 30 files changed, 2864 insertions(+), 837 deletions(-) create mode 100644 examples/USER/brownian/2d_velocity/log.11May2021.in2d_velocity.g++.1 create mode 100644 examples/USER/brownian/2d_velocity/log.11May2021.in2d_velocity.g++.4 delete mode 100644 examples/USER/brownian/2d_velocity/log_1_1_4_2d.lammps.log create mode 100644 examples/USER/brownian/asphere/log.11May2021.in2d.ellipsoid.g++.1 create mode 100644 examples/USER/brownian/asphere/log.11May2021.in2d.ellipsoid.g++.4 create mode 100644 examples/USER/brownian/asphere/log.11May2021.in3d.ellipsoid.g++.1 create mode 100644 examples/USER/brownian/asphere/log.11May2021.in3d.ellipsoid.g++.4 create mode 100644 examples/USER/brownian/point/log.11May2021.in2d.point.g++.1 create mode 100644 examples/USER/brownian/point/log.11May2021.in2d.point.g++.4 create mode 100644 examples/USER/brownian/point/log.11May2021.in3d.point.g++.1 create mode 100644 examples/USER/brownian/point/log.11May2021.in3d.point.g++.4 create mode 100644 examples/USER/brownian/sphere/log.11May2021.in2d.sphere.g++.1 create mode 100644 examples/USER/brownian/sphere/log.11May2021.in2d.sphere.g++.4 create mode 100644 examples/USER/brownian/sphere/log.11May2021.in3d.sphere.g++.1 create mode 100644 examples/USER/brownian/sphere/log.11May2021.in3d.sphere.g++.4 create mode 100644 examples/USER/brownian/spherical_ABP/log.11May2021.in2d.apb.g++.1 create mode 100644 examples/USER/brownian/spherical_ABP/log.11May2021.in2d.apb.g++.4 create mode 100644 examples/USER/brownian/spherical_ABP/log.11May2021.in3d.ideal_apb.g++.1 create mode 100644 examples/USER/brownian/spherical_ABP/log.11May2021.in3d.ideal_apb.g++.4 delete mode 100644 examples/USER/brownian/spherical_ABP/log_WCA_1_1_1_3_4_2d.lammps.log delete mode 100644 examples/USER/brownian/spherical_ABP/log_ideal_1_1_1_3_4_3d.lammps.log diff --git a/examples/USER/brownian/2d_velocity/in2d.velocity b/examples/USER/brownian/2d_velocity/in2d.velocity index 454396b959..fcfae0554b 100644 --- a/examples/USER/brownian/2d_velocity/in2d.velocity +++ b/examples/USER/brownian/2d_velocity/in2d.velocity @@ -1,19 +1,15 @@ ##### 2d overdamped brownian dynamics with self-propulsion force in direction of velocity. ##### -variable gamma_t equal 1.0 -variable temp equal 1.0 -variable seed equal 1974019 -variable fp equal 4.0 +variable gamma_t equal 1.0 +variable temp equal 1.0 +variable seed equal 1974019 +variable fp equal 4.0 +variable params string ${gamma_t}_${temp}_${fp} -variable params string ${gamma_t}_${temp}_${fp} - - -log log_${params}_2d.lammps.log units lj dimension 2 newton off - lattice sq 0.4 region box block -16 16 -16 16 -0.2 0.2 create_box 1 box @@ -21,16 +17,13 @@ create_atoms 1 box mass * 1.0 velocity all create 1.0 1 loop geom - neighbor 1.0 bin neigh_modify every 1 delay 1 check yes - - pair_style none fix step all brownian ${temp} ${seed} gamma_t ${gamma_t} -fix vel all propel/self velocity ${fp} +fix vel all propel/self velocity ${fp} fix 2 all enforce2d fix_modify vel virial yes @@ -40,24 +33,21 @@ thermo_style custom step temp epair c_press #equilibration timestep 0.0000000001 -thermo 50001 -run 50000 +thermo 500 +run 5000 reset_timestep 0 - #initialisation for the main run -# MSD +# MSD compute msd all msd - -thermo_style custom step temp epair c_msd[*] c_press - +thermo_style custom step ke pe c_msd[*] c_press timestep 0.00001 thermo 1000 # main run -run 120000 +run 12000 diff --git a/examples/USER/brownian/2d_velocity/log.11May2021.in2d_velocity.g++.1 b/examples/USER/brownian/2d_velocity/log.11May2021.in2d_velocity.g++.1 new file mode 100644 index 0000000000..a5a58ba9f0 --- /dev/null +++ b/examples/USER/brownian/2d_velocity/log.11May2021.in2d_velocity.g++.1 @@ -0,0 +1,151 @@ +LAMMPS (8 Apr 2021) + using 1 OpenMP thread(s) per MPI task +##### 2d overdamped brownian dynamics with self-propulsion force in direction of velocity. ##### + +variable gamma_t equal 1.0 +variable temp equal 1.0 +variable seed equal 1974019 +variable fp equal 4.0 +variable params string ${gamma_t}_${temp}_${fp} +variable params string 1_${temp}_${fp} +variable params string 1_1_${fp} +variable params string 1_1_4 + +units lj +dimension 2 +newton off + +lattice sq 0.4 +Lattice spacing in x,y,z = 1.5811388 1.5811388 1.5811388 +region box block -16 16 -16 16 -0.2 0.2 +create_box 1 box +Created orthogonal box = (-25.298221 -25.298221 -0.31622777) to (25.298221 25.298221 0.31622777) + 1 by 1 by 1 MPI processor grid +create_atoms 1 box +Created 1024 atoms + create_atoms CPU = 0.001 seconds +mass * 1.0 +velocity all create 1.0 1 loop geom + +neighbor 1.0 bin +neigh_modify every 1 delay 1 check yes + +pair_style none + +fix step all brownian ${temp} ${seed} gamma_t ${gamma_t} +fix step all brownian 1 ${seed} gamma_t ${gamma_t} +fix step all brownian 1 1974019 gamma_t ${gamma_t} +fix step all brownian 1 1974019 gamma_t 1 +fix vel all propel/self velocity ${fp} +fix vel all propel/self velocity 4 +fix 2 all enforce2d +fix_modify vel virial yes + +compute press all pressure NULL virial + +thermo_style custom step temp epair c_press + +#equilibration +timestep 0.0000000001 +thermo 500 +run 5000 +WARNING: No pairwise cutoff or binsize set. Atom sorting therefore disabled. (src/atom.cpp:2141) +WARNING: Communication cutoff is 0.0. No ghost atoms will be generated. Atoms may get lost. (src/comm_brick.cpp:167) +Per MPI rank memory allocation (min/avg/max) = 2.289 | 2.289 | 2.289 Mbytes +Step Temp E_pair c_press + 0 1 0 -0.18336111 + 500 2.0519273e+10 0 -0.048238222 + 1000 1.9821717e+10 0 -0.4711053 + 1500 1.9697609e+10 0 -0.13539588 + 2000 2.0209443e+10 0 0.0094958039 + 2500 1.9591299e+10 0 0.40117118 + 3000 2.089566e+10 0 -0.036548251 + 3500 1.978692e+10 0 0.28282578 + 4000 2.0657848e+10 0 0.17618064 + 4500 2.0837353e+10 0 -0.080724651 + 5000 2.0348316e+10 0 -0.17471195 +Loop time of 0.575164 on 1 procs for 5000 steps with 1024 atoms + +Performance: 0.075 tau/day, 8693.168 timesteps/s +99.9% CPU use with 1 MPI tasks x 1 OpenMP threads + +MPI task timing breakdown: +Section | min time | avg time | max time |%varavg| %total +--------------------------------------------------------------- +Pair | 0 | 0 | 0 | 0.0 | 0.00 +Neigh | 0 | 0 | 0 | 0.0 | 0.00 +Comm | 0.0036819 | 0.0036819 | 0.0036819 | 0.0 | 0.64 +Output | 0.00027752 | 0.00027752 | 0.00027752 | 0.0 | 0.05 +Modify | 0.51999 | 0.51999 | 0.51999 | 0.0 | 90.41 +Other | | 0.05121 | | | 8.90 + +Nlocal: 1024.00 ave 1024 max 1024 min +Histogram: 1 0 0 0 0 0 0 0 0 0 +Nghost: 65.0000 ave 65 max 65 min +Histogram: 1 0 0 0 0 0 0 0 0 0 +Neighs: 0.00000 ave 0 max 0 min +Histogram: 1 0 0 0 0 0 0 0 0 0 + +Total # of neighbors = 0 +Ave neighs/atom = 0.0000000 +Neighbor list builds = 0 +Dangerous builds = 0 +reset_timestep 0 + +#initialisation for the main run + +# MSD +compute msd all msd + +thermo_style custom step ke pe c_msd[*] c_press + +timestep 0.00001 +thermo 1000 + +# main run +run 12000 +WARNING: Communication cutoff is 0.0. No ghost atoms will be generated. Atoms may get lost. (src/comm_brick.cpp:167) +Per MPI rank memory allocation (min/avg/max) = 2.664 | 2.664 | 2.664 Mbytes +Step KinEng PotEng c_msd[1] c_msd[2] c_msd[3] c_msd[4] c_press + 0 2.0328444e+10 0 0 0 0 0 -0.17471195 + 1000 197017.59 0 0.018147562 0.019839233 0 0.037986796 -0.71897807 + 2000 197030.23 0 0.03909867 0.041721342 0 0.080820011 -0.30051929 + 3000 201997.2 0 0.065694399 0.06235257 0 0.12804697 -0.85167039 + 4000 199927.76 0 0.085698715 0.080328815 0 0.16602753 0.18493117 + 5000 198665.7 0 0.10896054 0.097021266 0 0.2059818 -0.090735406 + 6000 199277.78 0 0.13081111 0.11724814 0 0.24805925 -0.18189034 + 7000 199850.54 0 0.14721838 0.13806858 0 0.28528696 0.11334674 + 8000 191577.11 0 0.16582149 0.15935853 0 0.32518002 -0.73284569 + 9000 197331.29 0 0.17995704 0.18652927 0 0.3664863 -0.015558407 + 10000 197048.17 0 0.2034106 0.20329856 0 0.40670916 0.36985211 + 11000 200105.54 0 0.21809835 0.21966463 0 0.43776298 0.36437 + 12000 203180.39 0 0.23810386 0.23666184 0 0.47476569 -0.072006034 +Loop time of 1.37465 on 1 procs for 12000 steps with 1024 atoms + +Performance: 7542.303 tau/day, 8729.517 timesteps/s +99.8% CPU use with 1 MPI tasks x 1 OpenMP threads + +MPI task timing breakdown: +Section | min time | avg time | max time |%varavg| %total +--------------------------------------------------------------- +Pair | 0 | 0 | 0 | 0.0 | 0.00 +Neigh | 0.00012231 | 0.00012231 | 0.00012231 | 0.0 | 0.01 +Comm | 0.0024607 | 0.0024607 | 0.0024607 | 0.0 | 0.18 +Output | 0.00068665 | 0.00068665 | 0.00068665 | 0.0 | 0.05 +Modify | 1.2479 | 1.2479 | 1.2479 | 0.0 | 90.78 +Other | | 0.1235 | | | 8.98 + +Nlocal: 1024.00 ave 1024 max 1024 min +Histogram: 1 0 0 0 0 0 0 0 0 0 +Nghost: 0.00000 ave 0 max 0 min +Histogram: 1 0 0 0 0 0 0 0 0 0 +Neighs: 0.00000 ave 0 max 0 min +Histogram: 1 0 0 0 0 0 0 0 0 0 + +Total # of neighbors = 0 +Ave neighs/atom = 0.0000000 +Neighbor list builds = 15 +Dangerous builds = 0 + + +Total wall time: 0:00:01 diff --git a/examples/USER/brownian/2d_velocity/log.11May2021.in2d_velocity.g++.4 b/examples/USER/brownian/2d_velocity/log.11May2021.in2d_velocity.g++.4 new file mode 100644 index 0000000000..df9ff24070 --- /dev/null +++ b/examples/USER/brownian/2d_velocity/log.11May2021.in2d_velocity.g++.4 @@ -0,0 +1,151 @@ +LAMMPS (8 Apr 2021) + using 1 OpenMP thread(s) per MPI task +##### 2d overdamped brownian dynamics with self-propulsion force in direction of velocity. ##### + +variable gamma_t equal 1.0 +variable temp equal 1.0 +variable seed equal 1974019 +variable fp equal 4.0 +variable params string ${gamma_t}_${temp}_${fp} +variable params string 1_${temp}_${fp} +variable params string 1_1_${fp} +variable params string 1_1_4 + +units lj +dimension 2 +newton off + +lattice sq 0.4 +Lattice spacing in x,y,z = 1.5811388 1.5811388 1.5811388 +region box block -16 16 -16 16 -0.2 0.2 +create_box 1 box +Created orthogonal box = (-25.298221 -25.298221 -0.31622777) to (25.298221 25.298221 0.31622777) + 2 by 2 by 1 MPI processor grid +create_atoms 1 box +Created 1024 atoms + create_atoms CPU = 0.001 seconds +mass * 1.0 +velocity all create 1.0 1 loop geom + +neighbor 1.0 bin +neigh_modify every 1 delay 1 check yes + +pair_style none + +fix step all brownian ${temp} ${seed} gamma_t ${gamma_t} +fix step all brownian 1 ${seed} gamma_t ${gamma_t} +fix step all brownian 1 1974019 gamma_t ${gamma_t} +fix step all brownian 1 1974019 gamma_t 1 +fix vel all propel/self velocity ${fp} +fix vel all propel/self velocity 4 +fix 2 all enforce2d +fix_modify vel virial yes + +compute press all pressure NULL virial + +thermo_style custom step temp epair c_press + +#equilibration +timestep 0.0000000001 +thermo 500 +run 5000 +WARNING: No pairwise cutoff or binsize set. Atom sorting therefore disabled. (src/atom.cpp:2141) +WARNING: Communication cutoff is 0.0. No ghost atoms will be generated. Atoms may get lost. (src/comm_brick.cpp:167) +Per MPI rank memory allocation (min/avg/max) = 2.289 | 2.289 | 2.289 Mbytes +Step Temp E_pair c_press + 0 1 0 -0.18336111 + 500 1.9862591e+10 0 -0.32013566 + 1000 2.0093184e+10 0 -0.36609742 + 1500 1.9562283e+10 0 -0.53349351 + 2000 1.9903977e+10 0 0.63783249 + 2500 2.0260128e+10 0 0.30046413 + 3000 1.9948065e+10 0 -0.63093105 + 3500 1.9507486e+10 0 0.48762848 + 4000 2.0049087e+10 0 0.40289309 + 4500 1.9975813e+10 0 0.57649363 + 5000 2.0129291e+10 0 -0.41288352 +Loop time of 0.238949 on 4 procs for 5000 steps with 1024 atoms + +Performance: 0.181 tau/day, 20924.952 timesteps/s +92.6% CPU use with 4 MPI tasks x 1 OpenMP threads + +MPI task timing breakdown: +Section | min time | avg time | max time |%varavg| %total +--------------------------------------------------------------- +Pair | 0 | 0 | 0 | 0.0 | 0.00 +Neigh | 0 | 0 | 0 | 0.0 | 0.00 +Comm | 0.0080078 | 0.024718 | 0.031782 | 6.2 | 10.34 +Output | 0.0001812 | 0.00029999 | 0.00063467 | 0.0 | 0.13 +Modify | 0.13401 | 0.14401 | 0.15438 | 2.4 | 60.27 +Other | | 0.06992 | | | 29.26 + +Nlocal: 256.000 ave 256 max 256 min +Histogram: 4 0 0 0 0 0 0 0 0 0 +Nghost: 33.0000 ave 33 max 33 min +Histogram: 4 0 0 0 0 0 0 0 0 0 +Neighs: 0.00000 ave 0 max 0 min +Histogram: 4 0 0 0 0 0 0 0 0 0 + +Total # of neighbors = 0 +Ave neighs/atom = 0.0000000 +Neighbor list builds = 0 +Dangerous builds = 0 +reset_timestep 0 + +#initialisation for the main run + +# MSD +compute msd all msd + +thermo_style custom step ke pe c_msd[*] c_press + +timestep 0.00001 +thermo 1000 + +# main run +run 12000 +WARNING: Communication cutoff is 0.0. No ghost atoms will be generated. Atoms may get lost. (src/comm_brick.cpp:167) +Per MPI rank memory allocation (min/avg/max) = 2.664 | 2.664 | 2.664 Mbytes +Step KinEng PotEng c_msd[1] c_msd[2] c_msd[3] c_msd[4] c_press + 0 2.0109634e+10 0 0 0 0 0 -0.41288352 + 1000 195711.46 0 0.020076462 0.020523099 0 0.040599561 -0.32125126 + 2000 203263.85 0 0.039242992 0.039661282 0 0.078904274 0.11008705 + 3000 197417.54 0 0.064938128 0.057716419 0 0.12265455 0.16967601 + 4000 200505.97 0 0.086511225 0.074975267 0 0.16148649 0.31338473 + 5000 199373.77 0 0.10583263 0.098175658 0 0.20400829 0.34205791 + 6000 192881.14 0 0.12152088 0.11706037 0 0.23858125 -0.27870467 + 7000 203045.3 0 0.1383248 0.13629503 0 0.27461983 -0.046936646 + 8000 198544.08 0 0.16064738 0.1582206 0 0.31886798 -0.18803452 + 9000 205450.74 0 0.17926529 0.1829047 0 0.36216999 0.47191228 + 10000 200371.73 0 0.20084273 0.20365189 0 0.40449463 0.093098262 + 11000 202911.93 0 0.21569236 0.22221715 0 0.43790952 -0.38430031 + 12000 192590.04 0 0.24041439 0.24114487 0 0.48155926 -0.1677052 +Loop time of 0.443026 on 4 procs for 12000 steps with 1024 atoms + +Performance: 23402.683 tau/day, 27086.439 timesteps/s +97.7% CPU use with 4 MPI tasks x 1 OpenMP threads + +MPI task timing breakdown: +Section | min time | avg time | max time |%varavg| %total +--------------------------------------------------------------- +Pair | 0 | 0 | 0 | 0.0 | 0.00 +Neigh | 3.2663e-05 | 3.3855e-05 | 3.4809e-05 | 0.0 | 0.01 +Comm | 0.0030291 | 0.0030628 | 0.0030825 | 0.0 | 0.69 +Output | 0.00027895 | 0.00051624 | 0.001184 | 0.0 | 0.12 +Modify | 0.31607 | 0.33372 | 0.37391 | 4.0 | 75.33 +Other | | 0.1057 | | | 23.86 + +Nlocal: 256.000 ave 259 max 253 min +Histogram: 1 0 0 1 0 0 1 0 0 1 +Nghost: 0.00000 ave 0 max 0 min +Histogram: 4 0 0 0 0 0 0 0 0 0 +Neighs: 0.00000 ave 0 max 0 min +Histogram: 4 0 0 0 0 0 0 0 0 0 + +Total # of neighbors = 0 +Ave neighs/atom = 0.0000000 +Neighbor list builds = 15 +Dangerous builds = 0 + + +Total wall time: 0:00:00 diff --git a/examples/USER/brownian/2d_velocity/log_1_1_4_2d.lammps.log b/examples/USER/brownian/2d_velocity/log_1_1_4_2d.lammps.log deleted file mode 100644 index 655b04f665..0000000000 --- a/examples/USER/brownian/2d_velocity/log_1_1_4_2d.lammps.log +++ /dev/null @@ -1,244 +0,0 @@ -units lj -dimension 2 -newton off - - -lattice sq 0.4 -Lattice spacing in x,y,z = 1.5811388 1.5811388 1.5811388 -region box block -16 16 -16 16 -0.2 0.2 -create_box 1 box -Created orthogonal box = (-25.298221 -25.298221 -0.31622777) to (25.298221 25.298221 0.31622777) - 1 by 1 by 1 MPI processor grid -create_atoms 1 box -Created 1024 atoms - create_atoms CPU = 0.001 seconds -mass * 1.0 -velocity all create 1.0 1 loop geom - - -neighbor 1.0 bin -neigh_modify every 1 delay 1 check yes - - - -pair_style none - -fix step all brownian ${temp} ${seed} gamma_t ${gamma_t} -fix step all brownian 1 ${seed} gamma_t ${gamma_t} -fix step all brownian 1 1974019 gamma_t ${gamma_t} -fix step all brownian 1 1974019 gamma_t 1 -fix vel all propel/self velocity ${fp} -fix vel all propel/self velocity 4 -fix 2 all enforce2d -fix_modify vel virial yes - -compute press all pressure NULL virial - -thermo_style custom step temp epair c_press - -#equilibration -timestep 0.0000000001 -thermo 50001 -run 50000 -WARNING: No pairwise cutoff or binsize set. Atom sorting therefore disabled. (src/atom.cpp:2118) -WARNING: Communication cutoff is 0.0. No ghost atoms will be generated. Atoms may get lost. (src/comm_brick.cpp:167) -Per MPI rank memory allocation (min/avg/max) = 2.289 | 2.289 | 2.289 Mbytes -Step Temp E_pair c_press - 0 1 0 -0.18336111 - 50000 2.0329082e+10 0 -0.30450754 -Loop time of 1.76045 on 1 procs for 50000 steps with 1024 atoms - -Performance: 0.245 tau/day, 28401.873 timesteps/s -100.0% CPU use with 1 MPI tasks x 1 OpenMP threads - -MPI task timing breakdown: -Section | min time | avg time | max time |%varavg| %total ---------------------------------------------------------------- -Pair | 0 | 0 | 0 | 0.0 | 0.00 -Neigh | 0 | 0 | 0 | 0.0 | 0.00 -Comm | 0.008736 | 0.008736 | 0.008736 | 0.0 | 0.50 -Output | 2.3562e-05 | 2.3562e-05 | 2.3562e-05 | 0.0 | 0.00 -Modify | 1.6284 | 1.6284 | 1.6284 | 0.0 | 92.50 -Other | | 0.1233 | | | 7.00 - -Nlocal: 1024.00 ave 1024 max 1024 min -Histogram: 1 0 0 0 0 0 0 0 0 0 -Nghost: 65.0000 ave 65 max 65 min -Histogram: 1 0 0 0 0 0 0 0 0 0 -Neighs: 0.00000 ave 0 max 0 min -Histogram: 1 0 0 0 0 0 0 0 0 0 - -Total # of neighbors = 0 -Ave neighs/atom = 0.0000000 -Neighbor list builds = 0 -Dangerous builds = 0 -reset_timestep 0 - - -#initialisation for the main run - -# MSD -compute msd all msd - - -thermo_style custom step temp epair c_msd[*] c_press - - -timestep 0.00001 -thermo 1000 - -# main run -run 120000 -WARNING: Communication cutoff is 0.0. No ghost atoms will be generated. Atoms may get lost. (src/comm_brick.cpp:167) -Per MPI rank memory allocation (min/avg/max) = 2.664 | 2.664 | 2.664 Mbytes -Step Temp E_pair c_msd[1] c_msd[2] c_msd[3] c_msd[4] c_press - 0 2.0329082e+10 0 0 0 0 0 -0.30450754 - 1000 194002.24 0 0.019541352 0.020412616 0 0.039953968 0.17960144 - 2000 201170.68 0 0.037773433 0.040755027 0 0.078528461 0.030184783 - 3000 200206.8 0 0.058949662 0.060726886 0 0.11967655 0.080592855 - 4000 205243 0 0.084357492 0.084713582 0 0.16907107 -0.9284229 - 5000 201741.41 0 0.1024163 0.10453135 0 0.20694765 0.31035655 - 6000 203143.61 0 0.12337925 0.12397645 0 0.2473557 -0.88772072 - 7000 202627.98 0 0.14537908 0.14173625 0 0.28711534 0.17510592 - 8000 200688.93 0 0.15993736 0.16450382 0 0.32444118 0.20926033 - 9000 200360.25 0 0.18277138 0.18597743 0 0.36874881 0.14728415 - 10000 203691.46 0 0.20588386 0.20467547 0 0.41055933 -0.041058877 - 11000 203028.99 0 0.2282616 0.21792715 0 0.44618875 0.14648625 - 12000 195738.49 0 0.24584925 0.22877733 0 0.47462658 0.11242329 - 13000 198977.93 0 0.26808832 0.25467835 0 0.52276667 -0.82500263 - 14000 193395.28 0 0.29074728 0.27404624 0 0.56479352 0.29664298 - 15000 200408 0 0.30241331 0.29063643 0 0.59304975 0.22506685 - 16000 194570.8 0 0.32914382 0.30896611 0 0.63810992 -0.011781021 - 17000 201699.18 0 0.34741469 0.33153019 0 0.67894488 -0.073195501 - 18000 198665.14 0 0.35708615 0.35032716 0 0.7074133 0.33684482 - 19000 201011.15 0 0.37328322 0.36518777 0 0.73847099 -0.20884796 - 20000 201387.99 0 0.39484415 0.3783921 0 0.77323625 -0.30200013 - 21000 202952.38 0 0.41838333 0.3958867 0 0.81427003 -0.98801165 - 22000 205150.98 0 0.44071908 0.42001514 0 0.86073422 -0.65548109 - 23000 200164.9 0 0.46156041 0.44411636 0 0.90567677 0.24186828 - 24000 196027.89 0 0.4834982 0.46586728 0 0.94936548 -0.43593925 - 25000 198438.08 0 0.50328321 0.4865808 0 0.98986402 -0.25516412 - 26000 200569.69 0 0.52535125 0.52102617 0 1.0463774 -0.41486705 - 27000 200598.31 0 0.52958053 0.53142647 0 1.061007 0.011109738 - 28000 205592.24 0 0.54694416 0.5464941 0 1.0934383 -0.18134038 - 29000 199085.55 0 0.57222754 0.57188852 0 1.1441161 -0.46788121 - 30000 201398.39 0 0.59813146 0.58520822 0 1.1833397 -0.15341079 - 31000 197674.44 0 0.61191002 0.60572867 0 1.2176387 0.25394145 - 32000 205188.42 0 0.63435682 0.63745001 0 1.2718068 0.26362999 - 33000 202316.72 0 0.66509392 0.65462302 0 1.3197169 -0.37062797 - 34000 200673.31 0 0.67923697 0.69170315 0 1.3709401 -0.36342828 - 35000 199626.58 0 0.71214435 0.71976006 0 1.4319044 0.14520308 - 36000 206317.51 0 0.73098443 0.75421862 0 1.4852031 -0.049274455 - 37000 200878.1 0 0.75404669 0.77976535 0 1.533812 -0.020890744 - 38000 204399.3 0 0.77905716 0.80048467 0 1.5795418 0.41855233 - 39000 194807.41 0 0.80901097 0.83413027 0 1.6431412 0.061887194 - 40000 197736.05 0 0.82530638 0.85259329 0 1.6778997 -0.21390647 - 41000 196234.62 0 0.84399769 0.87823172 0 1.7222294 -0.069449607 - 42000 202916.17 0 0.84692321 0.90553215 0 1.7524554 0.014080553 - 43000 199860.49 0 0.87526292 0.92743523 0 1.8026981 0.14037107 - 44000 195023.53 0 0.88991314 0.95932182 0 1.849235 -0.33208549 - 45000 195356.87 0 0.91402747 0.98447964 0 1.8985071 -0.54494657 - 46000 208076.31 0 0.92947502 1.0151107 0 1.9445857 -0.62483899 - 47000 196855.73 0 0.94724593 1.0592619 0 2.0065078 -0.20412571 - 48000 201398.95 0 0.98527482 1.0801565 0 2.0654313 -0.12234755 - 49000 196643.46 0 0.9999414 1.115902 0 2.1158434 -0.014252649 - 50000 195863.57 0 1.0150887 1.1141794 0 2.1292681 0.75335013 - 51000 206236.4 0 1.060301 1.1367091 0 2.1970101 -0.22091636 - 52000 202457.92 0 1.0661594 1.1431793 0 2.2093387 0.20119657 - 53000 200285.87 0 1.0911263 1.1652507 0 2.256377 0.64981185 - 54000 192647.27 0 1.1240369 1.1911613 0 2.3151982 -0.31991262 - 55000 203771.16 0 1.1340164 1.2059129 0 2.3399293 -0.69282837 - 56000 208567.7 0 1.1644643 1.2358751 0 2.4003394 -0.31413258 - 57000 197231.77 0 1.1817765 1.2580471 0 2.4398236 0.0033296714 - 58000 203466.84 0 1.2256115 1.297949 0 2.5235605 0.5978746 - 59000 204071.73 0 1.2635225 1.3217703 0 2.5852928 0.080439812 - 60000 204497.78 0 1.280816 1.3529427 0 2.6337587 -0.13596951 - 61000 201581.53 0 1.3062524 1.3840896 0 2.6903421 0.2402402 - 62000 201808.73 0 1.3158468 1.40441 0 2.7202568 -0.49735816 - 63000 195485.7 0 1.3246003 1.4115588 0 2.7361591 -0.034708225 - 64000 203289.43 0 1.3515942 1.4270935 0 2.7786877 -0.47288139 - 65000 198360.38 0 1.3655219 1.4410644 0 2.8065863 -0.60256944 - 66000 207037.46 0 1.4024293 1.447203 0 2.8496323 0.19886918 - 67000 197118.92 0 1.4400601 1.4746068 0 2.914667 0.53432407 - 68000 202323.37 0 1.4737023 1.4757925 0 2.9494948 -0.50123703 - 69000 202679.62 0 1.4996722 1.4982292 0 2.9979014 -0.36930796 - 70000 197067.46 0 1.5202881 1.5079024 0 3.0281905 0.20627183 - 71000 201481.55 0 1.5292493 1.5243374 0 3.0535868 0.1664502 - 72000 197565.37 0 1.5649605 1.5415579 0 3.1065184 0.1538837 - 73000 198996.68 0 1.5823587 1.5687541 0 3.1511128 0.33347453 - 74000 196056.36 0 1.5876207 1.5880262 0 3.1756469 0.51039007 - 75000 196383.82 0 1.6238368 1.6126393 0 3.2364761 0.58359751 - 76000 198050.9 0 1.6332373 1.6444992 0 3.2777365 -0.30732735 - 77000 198867.35 0 1.6713412 1.6649495 0 3.3362907 -0.77019295 - 78000 197809.01 0 1.7072475 1.6978103 0 3.4050578 0.062786188 - 79000 198410.74 0 1.7408508 1.7258001 0 3.4666509 0.13736398 - 80000 203417.5 0 1.757256 1.748869 0 3.506125 -0.020989175 - 81000 195062.76 0 1.7608203 1.7602204 0 3.5210407 0.013727312 - 82000 200632.52 0 1.7755665 1.7921425 0 3.567709 -0.052325244 - 83000 191576.45 0 1.7959579 1.8241176 0 3.6200755 -0.20352178 - 84000 200502.95 0 1.8249302 1.8426066 0 3.6675369 -0.38424345 - 85000 201308.33 0 1.8545228 1.8747626 0 3.7292854 0.68968471 - 86000 203836.21 0 1.8649352 1.9007982 0 3.7657335 -0.56168571 - 87000 208433.36 0 1.8740109 1.9350895 0 3.8091003 0.14026532 - 88000 198009.97 0 1.9059077 1.9537513 0 3.859659 0.017064255 - 89000 200694.98 0 1.9312351 1.9704954 0 3.9017306 -0.19090346 - 90000 200436.01 0 1.9567279 2.0115534 0 3.9682814 0.48791684 - 91000 201810.57 0 1.9784333 2.0255054 0 4.0039386 -0.21421409 - 92000 208365.35 0 2.0050623 2.049849 0 4.0549113 0.30465483 - 93000 197213.15 0 2.017481 2.0689265 0 4.0864075 0.22419309 - 94000 201428.76 0 2.0426301 2.0972527 0 4.1398828 -0.24230583 - 95000 198472.77 0 2.0677457 2.111042 0 4.1787877 0.13071029 - 96000 201070.22 0 2.1019013 2.1226741 0 4.2245754 0.15711614 - 97000 197899.22 0 2.1019041 2.1575764 0 4.2594805 -0.18586251 - 98000 196679.32 0 2.1162285 2.170629 0 4.2868575 -0.34056846 - 99000 197724.36 0 2.1326497 2.1886854 0 4.321335 0.58967646 - 100000 205354.32 0 2.1612412 2.2209085 0 4.3821498 0.044930992 - 101000 201516.54 0 2.1954542 2.2365787 0 4.4320329 0.065295032 - 102000 204976.1 0 2.2029662 2.2694803 0 4.4724465 0.11481479 - 103000 194476.8 0 2.2257884 2.2955314 0 4.5213197 -0.11610949 - 104000 203736.97 0 2.2268211 2.2907985 0 4.5176196 0.015187894 - 105000 196842.81 0 2.2620115 2.3381811 0 4.6001926 0.32154947 - 106000 202018.95 0 2.2836727 2.3560537 0 4.6397264 0.33256726 - 107000 198280.55 0 2.2802504 2.3840825 0 4.6643329 0.50865119 - 108000 198415.05 0 2.299079 2.402819 0 4.7018979 0.028090763 - 109000 214429.79 0 2.326329 2.4071902 0 4.7335192 0.33519083 - 110000 206059.4 0 2.3452258 2.431054 0 4.7762798 0.012116372 - 111000 198624.14 0 2.3484889 2.4352672 0 4.7837561 -0.35529818 - 112000 201890.76 0 2.3810208 2.4718016 0 4.8528225 -0.55980456 - 113000 199303.2 0 2.4011131 2.5070887 0 4.9082018 0.21744731 - 114000 207834.3 0 2.4341043 2.5221162 0 4.9562204 0.11696186 - 115000 202055.54 0 2.4714851 2.5576047 0 5.0290898 -0.42272945 - 116000 203298.5 0 2.5043401 2.5626771 0 5.0670173 0.17688701 - 117000 194028.49 0 2.5273873 2.5945816 0 5.1219689 -0.70088882 - 118000 201726.79 0 2.5475583 2.6532013 0 5.2007596 0.22458895 - 119000 200037.8 0 2.599892 2.6701733 0 5.2700653 0.036916228 - 120000 194969.52 0 2.623779 2.6921819 0 5.3159609 -0.6067451 -Loop time of 4.32114 on 1 procs for 120000 steps with 1024 atoms - -Performance: 23993.668 tau/day, 27770.449 timesteps/s -100.0% CPU use with 1 MPI tasks x 1 OpenMP threads - -MPI task timing breakdown: -Section | min time | avg time | max time |%varavg| %total ---------------------------------------------------------------- -Pair | 0 | 0 | 0 | 0.0 | 0.00 -Neigh | 0.00029646 | 0.00029646 | 0.00029646 | 0.0 | 0.01 -Comm | 0.0079174 | 0.0079174 | 0.0079174 | 0.0 | 0.18 -Output | 0.0044738 | 0.0044738 | 0.0044738 | 0.0 | 0.10 -Modify | 3.9818 | 3.9818 | 3.9818 | 0.0 | 92.15 -Other | | 0.3267 | | | 7.56 - -Nlocal: 1024.00 ave 1024 max 1024 min -Histogram: 1 0 0 0 0 0 0 0 0 0 -Nghost: 0.00000 ave 0 max 0 min -Histogram: 1 0 0 0 0 0 0 0 0 0 -Neighs: 0.00000 ave 0 max 0 min -Histogram: 1 0 0 0 0 0 0 0 0 0 - -Total # of neighbors = 0 -Ave neighs/atom = 0.0000000 -Neighbor list builds = 153 -Dangerous builds = 0 - - -Total wall time: 0:00:06 diff --git a/examples/USER/brownian/asphere/in2d.ellipsoid b/examples/USER/brownian/asphere/in2d.ellipsoid index f36ab3b19b..4b1a88bba7 100644 --- a/examples/USER/brownian/asphere/in2d.ellipsoid +++ b/examples/USER/brownian/asphere/in2d.ellipsoid @@ -1,72 +1,54 @@ ##### overdamped dynamics of non-interacting ellipsoids in 2D ##### +variable rng string gaussian +variable seed string 198098 +variable temp string 1.0 +variable gamma_r_1 string inf +variable gamma_r_2 string inf +variable gamma_r_3 string 0.1 +variable gamma_t_1 string 5.0 +variable gamma_t_2 string 7.0 +variable gamma_t_3 string inf +variable params string ${rng}_${temp}_${gamma_r_1}_${gamma_r_2}_${gamma_r_3}_${gamma_t_1}_${gamma_t_2}_${gamma_t_3} -variable rng string gaussian -variable seed string 198098 - - -variable temp string 1.0 - -variable gamma_r_1 string inf -variable gamma_r_2 string inf -variable gamma_r_3 string 0.1 - -variable gamma_t_1 string 5.0 -variable gamma_t_2 string 7.0 -variable gamma_t_3 string inf - -variable params string ${rng}_${temp}_${gamma_r_1}_${gamma_r_2}_${gamma_r_3}_${gamma_t_1}_${gamma_t_2}_${gamma_t_3} - - -log log_${params}_2d.lammps.log units lj atom_style hybrid dipole ellipsoid dimension 2 newton off - lattice sq 0.4 region box block -30 30 -30 30 -0.2 0.2 create_box 1 box create_atoms 1 box mass * 1.0 set type * dipole/random ${seed} 1.0 -set type * shape 3.0 1.0 1.0 -set type * quat/random ${seed} +set type * shape 3.0 1.0 1.0 +set type * quat/random ${seed} velocity all create 1.0 1 loop geom - neighbor 1.0 bin neigh_modify every 1 delay 1 check yes - - pair_style none - - fix 1 all brownian/asphere ${temp} ${seed} rng ${rng} & - gamma_r_eigen ${gamma_r_1} ${gamma_r_2} ${gamma_r_3} & - gamma_t_eigen ${gamma_t_1} ${gamma_t_2} ${gamma_t_3} & - dipole 1.0 0.0 0.0 - - + gamma_r_eigen ${gamma_r_1} ${gamma_r_2} ${gamma_r_3} & + gamma_t_eigen ${gamma_t_1} ${gamma_t_2} ${gamma_t_3} & + dipole 1.0 0.0 0.0 #initialisation for the main run -# MSD +# MSD compute msd all msd +thermo_style custom step ke pe c_msd[*] -thermo_style custom step temp epair c_msd[*] - - -dump 1 all custom 1000 dump_${params}_2d.lammpstrj id type & - x y z xu yu zu mux muy muz fx fy fz -dump_modify 1 first yes sort id +#dump 1 all custom 1000 dump_${params}_2d.lammpstrj id type & +# x y z xu yu zu mux muy muz fx fy fz +#dump_modify 1 first yes sort id timestep 0.00001 -thermo 50 +thermo 100 # main run -run 30000 +run 3000 diff --git a/examples/USER/brownian/asphere/in3d.ellipsoid b/examples/USER/brownian/asphere/in3d.ellipsoid index b8aa230a61..34f2684ee7 100644 --- a/examples/USER/brownian/asphere/in3d.ellipsoid +++ b/examples/USER/brownian/asphere/in3d.ellipsoid @@ -1,73 +1,54 @@ ##### overdamped dynamics of non-interacting ellipsoids in 3D ##### +variable rng string uniform +variable seed string 198098 +variable temp string 1.0 +variable gamma_r_1 string 2.0 +variable gamma_r_2 string 0.25 +variable gamma_r_3 string 0.1 +variable gamma_t_1 string 5.0 +variable gamma_t_2 string 7.0 +variable gamma_t_3 string 9.0 +variable params string ${rng}_${temp}_${gamma_r_1}_${gamma_r_2}_${gamma_r_3}_${gamma_t_1}_${gamma_t_2}_${gamma_t_3} -variable rng string uniform -variable seed string 198098 - - -variable temp string 1.0 - -variable gamma_r_1 string 2.0 -variable gamma_r_2 string 0.25 -variable gamma_r_3 string 0.1 - -variable gamma_t_1 string 5.0 -variable gamma_t_2 string 7.0 -variable gamma_t_3 string 9.0 - -variable params string ${rng}_${temp}_${gamma_r_1}_${gamma_r_2}_${gamma_r_3}_${gamma_t_1}_${gamma_t_2}_${gamma_t_3} - - -log log_${params}_3d.lammps.log units lj atom_style hybrid dipole ellipsoid dimension 3 newton off - lattice sc 0.4 region box block -8 8 -8 8 -8 8 create_box 1 box create_atoms 1 box mass * 1.0 set type * dipole/random ${seed} 1.0 -set type * shape 3.0 1.0 1.0 -set type * quat/random ${seed} +set type * shape 3.0 1.0 1.0 +set type * quat/random ${seed} velocity all create 1.0 1 loop geom - neighbor 1.0 bin neigh_modify every 1 delay 1 check yes - - pair_style none - - - fix 1 all brownian/asphere ${temp} ${seed} rng ${rng} & - gamma_r_eigen ${gamma_r_1} ${gamma_r_2} ${gamma_r_3} & - gamma_t_eigen ${gamma_t_1} ${gamma_t_2} ${gamma_t_3} & - dipole 1.0 0.0 0.0 - - + gamma_r_eigen ${gamma_r_1} ${gamma_r_2} ${gamma_r_3} & + gamma_t_eigen ${gamma_t_1} ${gamma_t_2} ${gamma_t_3} & + dipole 1.0 0.0 0.0 #initialisation for the main run -# MSD +# MSD compute msd all msd +thermo_style custom step ke pe c_msd[*] -thermo_style custom step temp epair c_msd[*] - - -dump 1 all custom 1000 dump_${params}_3d.lammpstrj id type & - x y z xu yu zu mux muy muz fx fy fz -dump_modify 1 first yes sort id +#dump 1 all custom 1000 dump_${params}_3d.lammpstrj id type & +# x y z xu yu zu mux muy muz fx fy fz +#dump_modify 1 first yes sort id timestep 0.00001 -thermo 50 +thermo 100 # main run -run 30000 +run 3000 diff --git a/examples/USER/brownian/asphere/log.11May2021.in2d.ellipsoid.g++.1 b/examples/USER/brownian/asphere/log.11May2021.in2d.ellipsoid.g++.1 new file mode 100644 index 0000000000..619ab937c9 --- /dev/null +++ b/examples/USER/brownian/asphere/log.11May2021.in2d.ellipsoid.g++.1 @@ -0,0 +1,145 @@ +LAMMPS (8 Apr 2021) + using 1 OpenMP thread(s) per MPI task +##### overdamped dynamics of non-interacting ellipsoids in 2D ##### + +variable rng string gaussian +variable seed string 198098 +variable temp string 1.0 +variable gamma_r_1 string inf +variable gamma_r_2 string inf +variable gamma_r_3 string 0.1 +variable gamma_t_1 string 5.0 +variable gamma_t_2 string 7.0 +variable gamma_t_3 string inf +variable params string ${rng}_${temp}_${gamma_r_1}_${gamma_r_2}_${gamma_r_3}_${gamma_t_1}_${gamma_t_2}_${gamma_t_3} +variable params string gaussian_${temp}_${gamma_r_1}_${gamma_r_2}_${gamma_r_3}_${gamma_t_1}_${gamma_t_2}_${gamma_t_3} +variable params string gaussian_1.0_${gamma_r_1}_${gamma_r_2}_${gamma_r_3}_${gamma_t_1}_${gamma_t_2}_${gamma_t_3} +variable params string gaussian_1.0_inf_${gamma_r_2}_${gamma_r_3}_${gamma_t_1}_${gamma_t_2}_${gamma_t_3} +variable params string gaussian_1.0_inf_inf_${gamma_r_3}_${gamma_t_1}_${gamma_t_2}_${gamma_t_3} +variable params string gaussian_1.0_inf_inf_0.1_${gamma_t_1}_${gamma_t_2}_${gamma_t_3} +variable params string gaussian_1.0_inf_inf_0.1_5.0_${gamma_t_2}_${gamma_t_3} +variable params string gaussian_1.0_inf_inf_0.1_5.0_7.0_${gamma_t_3} +variable params string gaussian_1.0_inf_inf_0.1_5.0_7.0_inf + +units lj +atom_style hybrid dipole ellipsoid +WARNING: Atom style hybrid defines both, per-type and per-atom masses; both must be set, but only per-atom masses will be used (src/atom_vec_hybrid.cpp:156) +dimension 2 +newton off + +lattice sq 0.4 +Lattice spacing in x,y,z = 1.5811388 1.5811388 1.5811388 +region box block -30 30 -30 30 -0.2 0.2 +create_box 1 box +Created orthogonal box = (-47.434165 -47.434165 -0.31622777) to (47.434165 47.434165 0.31622777) + 1 by 1 by 1 MPI processor grid +create_atoms 1 box +Created 3600 atoms + create_atoms CPU = 0.005 seconds +mass * 1.0 +set type * dipole/random ${seed} 1.0 +set type * dipole/random 198098 1.0 +Setting atom values ... + 3600 settings made for dipole/random +set type * shape 3.0 1.0 1.0 +Setting atom values ... + 3600 settings made for shape +set type * quat/random ${seed} +set type * quat/random 198098 +Setting atom values ... + 3600 settings made for quat/random +velocity all create 1.0 1 loop geom + +neighbor 1.0 bin +neigh_modify every 1 delay 1 check yes + +pair_style none + +fix 1 all brownian/asphere ${temp} ${seed} rng ${rng} gamma_r_eigen ${gamma_r_1} ${gamma_r_2} ${gamma_r_3} gamma_t_eigen ${gamma_t_1} ${gamma_t_2} ${gamma_t_3} dipole 1.0 0.0 0.0 +fix 1 all brownian/asphere 1.0 ${seed} rng ${rng} gamma_r_eigen ${gamma_r_1} ${gamma_r_2} ${gamma_r_3} gamma_t_eigen ${gamma_t_1} ${gamma_t_2} ${gamma_t_3} dipole 1.0 0.0 0.0 +fix 1 all brownian/asphere 1.0 198098 rng ${rng} gamma_r_eigen ${gamma_r_1} ${gamma_r_2} ${gamma_r_3} gamma_t_eigen ${gamma_t_1} ${gamma_t_2} ${gamma_t_3} dipole 1.0 0.0 0.0 +fix 1 all brownian/asphere 1.0 198098 rng gaussian gamma_r_eigen ${gamma_r_1} ${gamma_r_2} ${gamma_r_3} gamma_t_eigen ${gamma_t_1} ${gamma_t_2} ${gamma_t_3} dipole 1.0 0.0 0.0 +fix 1 all brownian/asphere 1.0 198098 rng gaussian gamma_r_eigen inf ${gamma_r_2} ${gamma_r_3} gamma_t_eigen ${gamma_t_1} ${gamma_t_2} ${gamma_t_3} dipole 1.0 0.0 0.0 +fix 1 all brownian/asphere 1.0 198098 rng gaussian gamma_r_eigen inf inf ${gamma_r_3} gamma_t_eigen ${gamma_t_1} ${gamma_t_2} ${gamma_t_3} dipole 1.0 0.0 0.0 +fix 1 all brownian/asphere 1.0 198098 rng gaussian gamma_r_eigen inf inf 0.1 gamma_t_eigen ${gamma_t_1} ${gamma_t_2} ${gamma_t_3} dipole 1.0 0.0 0.0 +fix 1 all brownian/asphere 1.0 198098 rng gaussian gamma_r_eigen inf inf 0.1 gamma_t_eigen 5.0 ${gamma_t_2} ${gamma_t_3} dipole 1.0 0.0 0.0 +fix 1 all brownian/asphere 1.0 198098 rng gaussian gamma_r_eigen inf inf 0.1 gamma_t_eigen 5.0 7.0 ${gamma_t_3} dipole 1.0 0.0 0.0 +fix 1 all brownian/asphere 1.0 198098 rng gaussian gamma_r_eigen inf inf 0.1 gamma_t_eigen 5.0 7.0 inf dipole 1.0 0.0 0.0 + +#initialisation for the main run + +# MSD +compute msd all msd + +thermo_style custom step ke pe c_msd[*] + +#dump 1 all custom 1000 dump_${params}_2d.lammpstrj id type # x y z xu yu zu mux muy muz fx fy fz +#dump_modify 1 first yes sort id + +timestep 0.00001 +thermo 100 + +# main run +run 3000 +WARNING: No pairwise cutoff or binsize set. Atom sorting therefore disabled. (src/atom.cpp:2141) +WARNING: Communication cutoff is 0.0. No ghost atoms will be generated. Atoms may get lost. (src/comm_brick.cpp:167) +Per MPI rank memory allocation (min/avg/max) = 5.114 | 5.114 | 5.114 Mbytes +Step KinEng PotEng c_msd[1] c_msd[2] c_msd[3] c_msd[4] + 0 0.99972222 0 0 0 0 0 + 100 34376.187 0 0.00034728749 0.00034318997 0 0.00069047747 + 200 36135.708 0 0.00067452936 0.0006818928 0 0.0013564222 + 300 34444.929 0 0.0010189319 0.00099849203 0 0.002017424 + 400 35668.312 0 0.0013648699 0.0013311884 0 0.0026960583 + 500 35388.615 0 0.0017330203 0.0016077184 0 0.0033407387 + 600 35180.065 0 0.002052223 0.0019394635 0 0.0039916865 + 700 34035.38 0 0.0024329956 0.0022664905 0 0.0046994861 + 800 34581.664 0 0.002783885 0.0025794872 0 0.0053633723 + 900 34579.945 0 0.003163442 0.0029351952 0 0.0060986372 + 1000 34158.066 0 0.0035589034 0.0032627605 0 0.0068216639 + 1100 33453.827 0 0.0038861895 0.003565372 0 0.0074515615 + 1200 33608.06 0 0.0041325698 0.0038943268 0 0.0080268966 + 1300 34381.633 0 0.004405682 0.0043294156 0 0.0087350976 + 1400 32925.746 0 0.0047383547 0.0046803517 0 0.0094187065 + 1500 34809.764 0 0.0051149571 0.0049309746 0 0.010045932 + 1600 33580.096 0 0.0054893472 0.0052465377 0 0.010735885 + 1700 34596.275 0 0.00581894 0.0056500316 0 0.011468972 + 1800 33926.736 0 0.0062129617 0.0059796125 0 0.012192574 + 1900 35577.131 0 0.0065668637 0.0062530163 0 0.01281988 + 2000 34224.967 0 0.0070005917 0.006598912 0 0.013599504 + 2100 33991.406 0 0.0073134826 0.0069119252 0 0.014225408 + 2200 34647.054 0 0.007659301 0.0073434715 0 0.015002772 + 2300 33956.835 0 0.007965191 0.0076318537 0 0.015597045 + 2400 35272.549 0 0.0082467116 0.007929202 0 0.016175914 + 2500 33901.494 0 0.0086251299 0.0082790757 0 0.016904206 + 2600 34138.227 0 0.0089419364 0.0086639744 0 0.017605911 + 2700 33691.013 0 0.0093083376 0.0090219118 0 0.018330249 + 2800 34716.817 0 0.0095840095 0.0094118945 0 0.018995904 + 2900 34473.982 0 0.0099773501 0.0098167668 0 0.019794117 + 3000 33406.776 0 0.010391969 0.010098625 0 0.020490594 +Loop time of 3.67112 on 1 procs for 3000 steps with 3600 atoms + +Performance: 706.051 tau/day, 817.189 timesteps/s +99.9% CPU use with 1 MPI tasks x 1 OpenMP threads + +MPI task timing breakdown: +Section | min time | avg time | max time |%varavg| %total +--------------------------------------------------------------- +Pair | 0 | 0 | 0 | 0.0 | 0.00 +Neigh | 0 | 0 | 0 | 0.0 | 0.00 +Comm | 0.037973 | 0.037973 | 0.037973 | 0.0 | 1.03 +Output | 0.0040674 | 0.0040674 | 0.0040674 | 0.0 | 0.11 +Modify | 3.515 | 3.515 | 3.515 | 0.0 | 95.75 +Other | | 0.1141 | | | 3.11 + +Nlocal: 3600.00 ave 3600 max 3600 min +Histogram: 1 0 0 0 0 0 0 0 0 0 +Nghost: 121.000 ave 121 max 121 min +Histogram: 1 0 0 0 0 0 0 0 0 0 +Neighs: 0.00000 ave 0 max 0 min +Histogram: 1 0 0 0 0 0 0 0 0 0 + +Total # of neighbors = 0 +Ave neighs/atom = 0.0000000 +Neighbor list builds = 0 +Dangerous builds = 0 +Total wall time: 0:00:03 diff --git a/examples/USER/brownian/asphere/log.11May2021.in2d.ellipsoid.g++.4 b/examples/USER/brownian/asphere/log.11May2021.in2d.ellipsoid.g++.4 new file mode 100644 index 0000000000..b3da385dda --- /dev/null +++ b/examples/USER/brownian/asphere/log.11May2021.in2d.ellipsoid.g++.4 @@ -0,0 +1,145 @@ +LAMMPS (8 Apr 2021) + using 1 OpenMP thread(s) per MPI task +##### overdamped dynamics of non-interacting ellipsoids in 2D ##### + +variable rng string gaussian +variable seed string 198098 +variable temp string 1.0 +variable gamma_r_1 string inf +variable gamma_r_2 string inf +variable gamma_r_3 string 0.1 +variable gamma_t_1 string 5.0 +variable gamma_t_2 string 7.0 +variable gamma_t_3 string inf +variable params string ${rng}_${temp}_${gamma_r_1}_${gamma_r_2}_${gamma_r_3}_${gamma_t_1}_${gamma_t_2}_${gamma_t_3} +variable params string gaussian_${temp}_${gamma_r_1}_${gamma_r_2}_${gamma_r_3}_${gamma_t_1}_${gamma_t_2}_${gamma_t_3} +variable params string gaussian_1.0_${gamma_r_1}_${gamma_r_2}_${gamma_r_3}_${gamma_t_1}_${gamma_t_2}_${gamma_t_3} +variable params string gaussian_1.0_inf_${gamma_r_2}_${gamma_r_3}_${gamma_t_1}_${gamma_t_2}_${gamma_t_3} +variable params string gaussian_1.0_inf_inf_${gamma_r_3}_${gamma_t_1}_${gamma_t_2}_${gamma_t_3} +variable params string gaussian_1.0_inf_inf_0.1_${gamma_t_1}_${gamma_t_2}_${gamma_t_3} +variable params string gaussian_1.0_inf_inf_0.1_5.0_${gamma_t_2}_${gamma_t_3} +variable params string gaussian_1.0_inf_inf_0.1_5.0_7.0_${gamma_t_3} +variable params string gaussian_1.0_inf_inf_0.1_5.0_7.0_inf + +units lj +atom_style hybrid dipole ellipsoid +WARNING: Atom style hybrid defines both, per-type and per-atom masses; both must be set, but only per-atom masses will be used (src/atom_vec_hybrid.cpp:156) +dimension 2 +newton off + +lattice sq 0.4 +Lattice spacing in x,y,z = 1.5811388 1.5811388 1.5811388 +region box block -30 30 -30 30 -0.2 0.2 +create_box 1 box +Created orthogonal box = (-47.434165 -47.434165 -0.31622777) to (47.434165 47.434165 0.31622777) + 2 by 2 by 1 MPI processor grid +create_atoms 1 box +Created 3600 atoms + create_atoms CPU = 0.007 seconds +mass * 1.0 +set type * dipole/random ${seed} 1.0 +set type * dipole/random 198098 1.0 +Setting atom values ... + 3600 settings made for dipole/random +set type * shape 3.0 1.0 1.0 +Setting atom values ... + 3600 settings made for shape +set type * quat/random ${seed} +set type * quat/random 198098 +Setting atom values ... + 3600 settings made for quat/random +velocity all create 1.0 1 loop geom + +neighbor 1.0 bin +neigh_modify every 1 delay 1 check yes + +pair_style none + +fix 1 all brownian/asphere ${temp} ${seed} rng ${rng} gamma_r_eigen ${gamma_r_1} ${gamma_r_2} ${gamma_r_3} gamma_t_eigen ${gamma_t_1} ${gamma_t_2} ${gamma_t_3} dipole 1.0 0.0 0.0 +fix 1 all brownian/asphere 1.0 ${seed} rng ${rng} gamma_r_eigen ${gamma_r_1} ${gamma_r_2} ${gamma_r_3} gamma_t_eigen ${gamma_t_1} ${gamma_t_2} ${gamma_t_3} dipole 1.0 0.0 0.0 +fix 1 all brownian/asphere 1.0 198098 rng ${rng} gamma_r_eigen ${gamma_r_1} ${gamma_r_2} ${gamma_r_3} gamma_t_eigen ${gamma_t_1} ${gamma_t_2} ${gamma_t_3} dipole 1.0 0.0 0.0 +fix 1 all brownian/asphere 1.0 198098 rng gaussian gamma_r_eigen ${gamma_r_1} ${gamma_r_2} ${gamma_r_3} gamma_t_eigen ${gamma_t_1} ${gamma_t_2} ${gamma_t_3} dipole 1.0 0.0 0.0 +fix 1 all brownian/asphere 1.0 198098 rng gaussian gamma_r_eigen inf ${gamma_r_2} ${gamma_r_3} gamma_t_eigen ${gamma_t_1} ${gamma_t_2} ${gamma_t_3} dipole 1.0 0.0 0.0 +fix 1 all brownian/asphere 1.0 198098 rng gaussian gamma_r_eigen inf inf ${gamma_r_3} gamma_t_eigen ${gamma_t_1} ${gamma_t_2} ${gamma_t_3} dipole 1.0 0.0 0.0 +fix 1 all brownian/asphere 1.0 198098 rng gaussian gamma_r_eigen inf inf 0.1 gamma_t_eigen ${gamma_t_1} ${gamma_t_2} ${gamma_t_3} dipole 1.0 0.0 0.0 +fix 1 all brownian/asphere 1.0 198098 rng gaussian gamma_r_eigen inf inf 0.1 gamma_t_eigen 5.0 ${gamma_t_2} ${gamma_t_3} dipole 1.0 0.0 0.0 +fix 1 all brownian/asphere 1.0 198098 rng gaussian gamma_r_eigen inf inf 0.1 gamma_t_eigen 5.0 7.0 ${gamma_t_3} dipole 1.0 0.0 0.0 +fix 1 all brownian/asphere 1.0 198098 rng gaussian gamma_r_eigen inf inf 0.1 gamma_t_eigen 5.0 7.0 inf dipole 1.0 0.0 0.0 + +#initialisation for the main run + +# MSD +compute msd all msd + +thermo_style custom step ke pe c_msd[*] + +#dump 1 all custom 1000 dump_${params}_2d.lammpstrj id type # x y z xu yu zu mux muy muz fx fy fz +#dump_modify 1 first yes sort id + +timestep 0.00001 +thermo 100 + +# main run +run 3000 +WARNING: No pairwise cutoff or binsize set. Atom sorting therefore disabled. (src/atom.cpp:2141) +WARNING: Communication cutoff is 0.0. No ghost atoms will be generated. Atoms may get lost. (src/comm_brick.cpp:167) +Per MPI rank memory allocation (min/avg/max) = 5.102 | 5.102 | 5.102 Mbytes +Step KinEng PotEng c_msd[1] c_msd[2] c_msd[3] c_msd[4] + 0 0.99972222 0 0 0 0 0 + 100 33874.438 0 0.0003458147 0.00033165629 0 0.00067747099 + 200 34893.188 0 0.00066290209 0.00068146332 0 0.0013443654 + 300 34494.226 0 0.0010064902 0.0010276646 0 0.0020341548 + 400 34537.887 0 0.0013457339 0.0014057042 0 0.0027514381 + 500 34458.46 0 0.0017006949 0.0017120083 0 0.0034127033 + 600 33229.977 0 0.0020841613 0.0020485346 0 0.0041326959 + 700 33288.631 0 0.0024270272 0.0023673304 0 0.0047943576 + 800 35317.512 0 0.0027924435 0.0026950912 0 0.0054875347 + 900 33094.299 0 0.0031503627 0.0030789319 0 0.0062292946 + 1000 35801.751 0 0.003489398 0.0034594626 0 0.0069488607 + 1100 33427.701 0 0.0038547506 0.0038375809 0 0.0076923316 + 1200 34675.07 0 0.0041824195 0.0042017298 0 0.0083841493 + 1300 33080.294 0 0.0045258945 0.0045816356 0 0.0091075301 + 1400 34927.288 0 0.0048252992 0.0049215701 0 0.0097468693 + 1500 34338.558 0 0.0051959155 0.0053020102 0 0.010497926 + 1600 34686.248 0 0.0055111463 0.0056220225 0 0.011133169 + 1700 34336.158 0 0.0059240394 0.0059060319 0 0.011830071 + 1800 34315.859 0 0.0063027944 0.0063004467 0 0.012603241 + 1900 35096.721 0 0.0066098525 0.00672222 0 0.013332073 + 2000 33544.18 0 0.0069401261 0.007074124 0 0.01401425 + 2100 33863.219 0 0.0072726502 0.0074175954 0 0.014690246 + 2200 34705.892 0 0.0075586722 0.0077552683 0 0.015313941 + 2300 34025.357 0 0.0079046728 0.0081760519 0 0.016080725 + 2400 34741.849 0 0.008252969 0.0085203087 0 0.016773278 + 2500 34406.959 0 0.0085370091 0.0088556377 0 0.017392647 + 2600 34062.63 0 0.0088134153 0.0092536326 0 0.018067048 + 2700 34677.666 0 0.0090592854 0.0096225881 0 0.018681874 + 2800 33464.216 0 0.0093984162 0.0099647695 0 0.019363186 + 2900 32920.721 0 0.0098222985 0.010366517 0 0.020188816 + 3000 34539.66 0 0.010133317 0.01068102 0 0.020814337 +Loop time of 1.12143 on 4 procs for 3000 steps with 3600 atoms + +Performance: 2311.341 tau/day, 2675.163 timesteps/s +96.1% CPU use with 4 MPI tasks x 1 OpenMP threads + +MPI task timing breakdown: +Section | min time | avg time | max time |%varavg| %total +--------------------------------------------------------------- +Pair | 0 | 0 | 0 | 0.0 | 0.00 +Neigh | 0 | 0 | 0 | 0.0 | 0.00 +Comm | 0.036017 | 0.042828 | 0.051558 | 2.7 | 3.82 +Output | 0.0012608 | 0.0025993 | 0.0063775 | 4.3 | 0.23 +Modify | 0.9002 | 0.93095 | 0.99546 | 3.9 | 83.01 +Other | | 0.1451 | | | 12.93 + +Nlocal: 900.000 ave 900 max 900 min +Histogram: 4 0 0 0 0 0 0 0 0 0 +Nghost: 61.0000 ave 61 max 61 min +Histogram: 4 0 0 0 0 0 0 0 0 0 +Neighs: 0.00000 ave 0 max 0 min +Histogram: 4 0 0 0 0 0 0 0 0 0 + +Total # of neighbors = 0 +Ave neighs/atom = 0.0000000 +Neighbor list builds = 0 +Dangerous builds = 0 +Total wall time: 0:00:01 diff --git a/examples/USER/brownian/asphere/log.11May2021.in3d.ellipsoid.g++.1 b/examples/USER/brownian/asphere/log.11May2021.in3d.ellipsoid.g++.1 new file mode 100644 index 0000000000..a193fc98e2 --- /dev/null +++ b/examples/USER/brownian/asphere/log.11May2021.in3d.ellipsoid.g++.1 @@ -0,0 +1,145 @@ +LAMMPS (8 Apr 2021) + using 1 OpenMP thread(s) per MPI task +##### overdamped dynamics of non-interacting ellipsoids in 3D ##### + +variable rng string uniform +variable seed string 198098 +variable temp string 1.0 +variable gamma_r_1 string 2.0 +variable gamma_r_2 string 0.25 +variable gamma_r_3 string 0.1 +variable gamma_t_1 string 5.0 +variable gamma_t_2 string 7.0 +variable gamma_t_3 string 9.0 +variable params string ${rng}_${temp}_${gamma_r_1}_${gamma_r_2}_${gamma_r_3}_${gamma_t_1}_${gamma_t_2}_${gamma_t_3} +variable params string uniform_${temp}_${gamma_r_1}_${gamma_r_2}_${gamma_r_3}_${gamma_t_1}_${gamma_t_2}_${gamma_t_3} +variable params string uniform_1.0_${gamma_r_1}_${gamma_r_2}_${gamma_r_3}_${gamma_t_1}_${gamma_t_2}_${gamma_t_3} +variable params string uniform_1.0_2.0_${gamma_r_2}_${gamma_r_3}_${gamma_t_1}_${gamma_t_2}_${gamma_t_3} +variable params string uniform_1.0_2.0_0.25_${gamma_r_3}_${gamma_t_1}_${gamma_t_2}_${gamma_t_3} +variable params string uniform_1.0_2.0_0.25_0.1_${gamma_t_1}_${gamma_t_2}_${gamma_t_3} +variable params string uniform_1.0_2.0_0.25_0.1_5.0_${gamma_t_2}_${gamma_t_3} +variable params string uniform_1.0_2.0_0.25_0.1_5.0_7.0_${gamma_t_3} +variable params string uniform_1.0_2.0_0.25_0.1_5.0_7.0_9.0 + +units lj +atom_style hybrid dipole ellipsoid +WARNING: Atom style hybrid defines both, per-type and per-atom masses; both must be set, but only per-atom masses will be used (src/atom_vec_hybrid.cpp:156) +dimension 3 +newton off + +lattice sc 0.4 +Lattice spacing in x,y,z = 1.3572088 1.3572088 1.3572088 +region box block -8 8 -8 8 -8 8 +create_box 1 box +Created orthogonal box = (-10.857670 -10.857670 -10.857670) to (10.857670 10.857670 10.857670) + 1 by 1 by 1 MPI processor grid +create_atoms 1 box +Created 4096 atoms + create_atoms CPU = 0.005 seconds +mass * 1.0 +set type * dipole/random ${seed} 1.0 +set type * dipole/random 198098 1.0 +Setting atom values ... + 4096 settings made for dipole/random +set type * shape 3.0 1.0 1.0 +Setting atom values ... + 4096 settings made for shape +set type * quat/random ${seed} +set type * quat/random 198098 +Setting atom values ... + 4096 settings made for quat/random +velocity all create 1.0 1 loop geom + +neighbor 1.0 bin +neigh_modify every 1 delay 1 check yes + +pair_style none + +fix 1 all brownian/asphere ${temp} ${seed} rng ${rng} gamma_r_eigen ${gamma_r_1} ${gamma_r_2} ${gamma_r_3} gamma_t_eigen ${gamma_t_1} ${gamma_t_2} ${gamma_t_3} dipole 1.0 0.0 0.0 +fix 1 all brownian/asphere 1.0 ${seed} rng ${rng} gamma_r_eigen ${gamma_r_1} ${gamma_r_2} ${gamma_r_3} gamma_t_eigen ${gamma_t_1} ${gamma_t_2} ${gamma_t_3} dipole 1.0 0.0 0.0 +fix 1 all brownian/asphere 1.0 198098 rng ${rng} gamma_r_eigen ${gamma_r_1} ${gamma_r_2} ${gamma_r_3} gamma_t_eigen ${gamma_t_1} ${gamma_t_2} ${gamma_t_3} dipole 1.0 0.0 0.0 +fix 1 all brownian/asphere 1.0 198098 rng uniform gamma_r_eigen ${gamma_r_1} ${gamma_r_2} ${gamma_r_3} gamma_t_eigen ${gamma_t_1} ${gamma_t_2} ${gamma_t_3} dipole 1.0 0.0 0.0 +fix 1 all brownian/asphere 1.0 198098 rng uniform gamma_r_eigen 2.0 ${gamma_r_2} ${gamma_r_3} gamma_t_eigen ${gamma_t_1} ${gamma_t_2} ${gamma_t_3} dipole 1.0 0.0 0.0 +fix 1 all brownian/asphere 1.0 198098 rng uniform gamma_r_eigen 2.0 0.25 ${gamma_r_3} gamma_t_eigen ${gamma_t_1} ${gamma_t_2} ${gamma_t_3} dipole 1.0 0.0 0.0 +fix 1 all brownian/asphere 1.0 198098 rng uniform gamma_r_eigen 2.0 0.25 0.1 gamma_t_eigen ${gamma_t_1} ${gamma_t_2} ${gamma_t_3} dipole 1.0 0.0 0.0 +fix 1 all brownian/asphere 1.0 198098 rng uniform gamma_r_eigen 2.0 0.25 0.1 gamma_t_eigen 5.0 ${gamma_t_2} ${gamma_t_3} dipole 1.0 0.0 0.0 +fix 1 all brownian/asphere 1.0 198098 rng uniform gamma_r_eigen 2.0 0.25 0.1 gamma_t_eigen 5.0 7.0 ${gamma_t_3} dipole 1.0 0.0 0.0 +fix 1 all brownian/asphere 1.0 198098 rng uniform gamma_r_eigen 2.0 0.25 0.1 gamma_t_eigen 5.0 7.0 9.0 dipole 1.0 0.0 0.0 + +#initialisation for the main run + +# MSD +compute msd all msd + +thermo_style custom step ke pe c_msd[*] + +#dump 1 all custom 1000 dump_${params}_3d.lammpstrj id type # x y z xu yu zu mux muy muz fx fy fz +#dump_modify 1 first yes sort id + +timestep 0.00001 +thermo 100 + +# main run +run 3000 +WARNING: No pairwise cutoff or binsize set. Atom sorting therefore disabled. (src/atom.cpp:2141) +WARNING: Communication cutoff is 0.0. No ghost atoms will be generated. Atoms may get lost. (src/comm_brick.cpp:167) +Per MPI rank memory allocation (min/avg/max) = 5.219 | 5.219 | 5.219 Mbytes +Step KinEng PotEng c_msd[1] c_msd[2] c_msd[3] c_msd[4] + 0 1.4996338 0 0 0 0 0 + 100 45690.838 0 0.00029994317 0.00029953902 0.00030002809 0.00089951027 + 200 45571.166 0 0.00061376797 0.00060955238 0.00061153551 0.0018348559 + 300 44693.418 0 0.00093058034 0.00089383536 0.00091554588 0.0027399616 + 400 44831.846 0 0.001250227 0.0012230128 0.0012120517 0.0036852914 + 500 45028.015 0 0.0015448869 0.0015339549 0.0014978843 0.0045767262 + 600 45895.442 0 0.0018621952 0.0018169905 0.0018352784 0.0055144641 + 700 45858.744 0 0.0021617097 0.0021137714 0.0021360394 0.0064115206 + 800 45155.215 0 0.002428445 0.0024288837 0.0024516737 0.0073090023 + 900 45427.427 0 0.0027265978 0.0027662531 0.0027329878 0.0082258387 + 1000 45398.166 0 0.0030685345 0.0030805014 0.0029765916 0.0091256275 + 1100 44622.428 0 0.0033766954 0.0033976168 0.0032745406 0.010048853 + 1200 45500.277 0 0.0036410565 0.0036840528 0.0035831659 0.010908275 + 1300 45265.8 0 0.0039143146 0.0039419334 0.0038761633 0.011732411 + 1400 45482.435 0 0.0042006542 0.0043373651 0.004164002 0.012702021 + 1500 45126.629 0 0.0044647379 0.0046021855 0.004487041 0.013553965 + 1600 45178.172 0 0.0047726618 0.0049110287 0.0048012671 0.014484958 + 1700 44918.685 0 0.005104787 0.0052522662 0.0050844375 0.015441491 + 1800 44776.678 0 0.0054395368 0.0056092038 0.0054623875 0.016511128 + 1900 46035.987 0 0.0057735872 0.0059357043 0.0057296009 0.017438892 + 2000 45436.517 0 0.0060837459 0.0063485717 0.0059769119 0.018409229 + 2100 45871.502 0 0.0063736337 0.0066551978 0.0063077439 0.019336575 + 2200 45511.847 0 0.0066419141 0.0069700452 0.0065553318 0.020167291 + 2300 45597.047 0 0.0069251517 0.0073015716 0.0068945654 0.021121289 + 2400 44832.007 0 0.0071894253 0.0076238221 0.0071638554 0.021977103 + 2500 45668.42 0 0.0074351304 0.0079594991 0.0075390719 0.022933701 + 2600 45248.483 0 0.007781496 0.008293944 0.0077956068 0.023871047 + 2700 45308.515 0 0.0080302993 0.0086329679 0.0081457335 0.024809001 + 2800 45637.72 0 0.0083889026 0.0089173198 0.0086032427 0.025909465 + 2900 45909.343 0 0.0087169392 0.009181179 0.0088778569 0.026775975 + 3000 45213.613 0 0.0090508891 0.0094253485 0.0092660321 0.02774227 +Loop time of 4.13937 on 1 procs for 3000 steps with 4096 atoms + +Performance: 626.183 tau/day, 724.749 timesteps/s +99.9% CPU use with 1 MPI tasks x 1 OpenMP threads + +MPI task timing breakdown: +Section | min time | avg time | max time |%varavg| %total +--------------------------------------------------------------- +Pair | 0 | 0 | 0 | 0.0 | 0.00 +Neigh | 0 | 0 | 0 | 0.0 | 0.00 +Comm | 0.24709 | 0.24709 | 0.24709 | 0.0 | 5.97 +Output | 0.004636 | 0.004636 | 0.004636 | 0.0 | 0.11 +Modify | 3.7604 | 3.7604 | 3.7604 | 0.0 | 90.85 +Other | | 0.1272 | | | 3.07 + +Nlocal: 4096.00 ave 4096 max 4096 min +Histogram: 1 0 0 0 0 0 0 0 0 0 +Nghost: 817.000 ave 817 max 817 min +Histogram: 1 0 0 0 0 0 0 0 0 0 +Neighs: 0.00000 ave 0 max 0 min +Histogram: 1 0 0 0 0 0 0 0 0 0 + +Total # of neighbors = 0 +Ave neighs/atom = 0.0000000 +Neighbor list builds = 0 +Dangerous builds = 0 +Total wall time: 0:00:04 diff --git a/examples/USER/brownian/asphere/log.11May2021.in3d.ellipsoid.g++.4 b/examples/USER/brownian/asphere/log.11May2021.in3d.ellipsoid.g++.4 new file mode 100644 index 0000000000..7f6d8a81f0 --- /dev/null +++ b/examples/USER/brownian/asphere/log.11May2021.in3d.ellipsoid.g++.4 @@ -0,0 +1,145 @@ +LAMMPS (8 Apr 2021) + using 1 OpenMP thread(s) per MPI task +##### overdamped dynamics of non-interacting ellipsoids in 3D ##### + +variable rng string uniform +variable seed string 198098 +variable temp string 1.0 +variable gamma_r_1 string 2.0 +variable gamma_r_2 string 0.25 +variable gamma_r_3 string 0.1 +variable gamma_t_1 string 5.0 +variable gamma_t_2 string 7.0 +variable gamma_t_3 string 9.0 +variable params string ${rng}_${temp}_${gamma_r_1}_${gamma_r_2}_${gamma_r_3}_${gamma_t_1}_${gamma_t_2}_${gamma_t_3} +variable params string uniform_${temp}_${gamma_r_1}_${gamma_r_2}_${gamma_r_3}_${gamma_t_1}_${gamma_t_2}_${gamma_t_3} +variable params string uniform_1.0_${gamma_r_1}_${gamma_r_2}_${gamma_r_3}_${gamma_t_1}_${gamma_t_2}_${gamma_t_3} +variable params string uniform_1.0_2.0_${gamma_r_2}_${gamma_r_3}_${gamma_t_1}_${gamma_t_2}_${gamma_t_3} +variable params string uniform_1.0_2.0_0.25_${gamma_r_3}_${gamma_t_1}_${gamma_t_2}_${gamma_t_3} +variable params string uniform_1.0_2.0_0.25_0.1_${gamma_t_1}_${gamma_t_2}_${gamma_t_3} +variable params string uniform_1.0_2.0_0.25_0.1_5.0_${gamma_t_2}_${gamma_t_3} +variable params string uniform_1.0_2.0_0.25_0.1_5.0_7.0_${gamma_t_3} +variable params string uniform_1.0_2.0_0.25_0.1_5.0_7.0_9.0 + +units lj +atom_style hybrid dipole ellipsoid +WARNING: Atom style hybrid defines both, per-type and per-atom masses; both must be set, but only per-atom masses will be used (src/atom_vec_hybrid.cpp:156) +dimension 3 +newton off + +lattice sc 0.4 +Lattice spacing in x,y,z = 1.3572088 1.3572088 1.3572088 +region box block -8 8 -8 8 -8 8 +create_box 1 box +Created orthogonal box = (-10.857670 -10.857670 -10.857670) to (10.857670 10.857670 10.857670) + 2 by 1 by 2 MPI processor grid +create_atoms 1 box +Created 4096 atoms + create_atoms CPU = 0.002 seconds +mass * 1.0 +set type * dipole/random ${seed} 1.0 +set type * dipole/random 198098 1.0 +Setting atom values ... + 4096 settings made for dipole/random +set type * shape 3.0 1.0 1.0 +Setting atom values ... + 4096 settings made for shape +set type * quat/random ${seed} +set type * quat/random 198098 +Setting atom values ... + 4096 settings made for quat/random +velocity all create 1.0 1 loop geom + +neighbor 1.0 bin +neigh_modify every 1 delay 1 check yes + +pair_style none + +fix 1 all brownian/asphere ${temp} ${seed} rng ${rng} gamma_r_eigen ${gamma_r_1} ${gamma_r_2} ${gamma_r_3} gamma_t_eigen ${gamma_t_1} ${gamma_t_2} ${gamma_t_3} dipole 1.0 0.0 0.0 +fix 1 all brownian/asphere 1.0 ${seed} rng ${rng} gamma_r_eigen ${gamma_r_1} ${gamma_r_2} ${gamma_r_3} gamma_t_eigen ${gamma_t_1} ${gamma_t_2} ${gamma_t_3} dipole 1.0 0.0 0.0 +fix 1 all brownian/asphere 1.0 198098 rng ${rng} gamma_r_eigen ${gamma_r_1} ${gamma_r_2} ${gamma_r_3} gamma_t_eigen ${gamma_t_1} ${gamma_t_2} ${gamma_t_3} dipole 1.0 0.0 0.0 +fix 1 all brownian/asphere 1.0 198098 rng uniform gamma_r_eigen ${gamma_r_1} ${gamma_r_2} ${gamma_r_3} gamma_t_eigen ${gamma_t_1} ${gamma_t_2} ${gamma_t_3} dipole 1.0 0.0 0.0 +fix 1 all brownian/asphere 1.0 198098 rng uniform gamma_r_eigen 2.0 ${gamma_r_2} ${gamma_r_3} gamma_t_eigen ${gamma_t_1} ${gamma_t_2} ${gamma_t_3} dipole 1.0 0.0 0.0 +fix 1 all brownian/asphere 1.0 198098 rng uniform gamma_r_eigen 2.0 0.25 ${gamma_r_3} gamma_t_eigen ${gamma_t_1} ${gamma_t_2} ${gamma_t_3} dipole 1.0 0.0 0.0 +fix 1 all brownian/asphere 1.0 198098 rng uniform gamma_r_eigen 2.0 0.25 0.1 gamma_t_eigen ${gamma_t_1} ${gamma_t_2} ${gamma_t_3} dipole 1.0 0.0 0.0 +fix 1 all brownian/asphere 1.0 198098 rng uniform gamma_r_eigen 2.0 0.25 0.1 gamma_t_eigen 5.0 ${gamma_t_2} ${gamma_t_3} dipole 1.0 0.0 0.0 +fix 1 all brownian/asphere 1.0 198098 rng uniform gamma_r_eigen 2.0 0.25 0.1 gamma_t_eigen 5.0 7.0 ${gamma_t_3} dipole 1.0 0.0 0.0 +fix 1 all brownian/asphere 1.0 198098 rng uniform gamma_r_eigen 2.0 0.25 0.1 gamma_t_eigen 5.0 7.0 9.0 dipole 1.0 0.0 0.0 + +#initialisation for the main run + +# MSD +compute msd all msd + +thermo_style custom step ke pe c_msd[*] + +#dump 1 all custom 1000 dump_${params}_3d.lammpstrj id type # x y z xu yu zu mux muy muz fx fy fz +#dump_modify 1 first yes sort id + +timestep 0.00001 +thermo 100 + +# main run +run 3000 +WARNING: No pairwise cutoff or binsize set. Atom sorting therefore disabled. (src/atom.cpp:2141) +WARNING: Communication cutoff is 0.0. No ghost atoms will be generated. Atoms may get lost. (src/comm_brick.cpp:167) +Per MPI rank memory allocation (min/avg/max) = 5.152 | 5.152 | 5.152 Mbytes +Step KinEng PotEng c_msd[1] c_msd[2] c_msd[3] c_msd[4] + 0 1.4996338 0 0 0 0 0 + 100 45236.508 0 0.00030817418 0.00030717742 0.0003019227 0.0009172743 + 200 45564.566 0 0.00062027526 0.00062110132 0.0006080391 0.0018494157 + 300 46232.801 0 0.00091155216 0.00094473459 0.00093009391 0.0027863807 + 400 45250.414 0 0.0011980791 0.0012538262 0.0012201461 0.0036720513 + 500 45217.133 0 0.0015186813 0.0015752994 0.001509437 0.0046034177 + 600 45531.276 0 0.0018194588 0.0019243758 0.0018209246 0.0055647592 + 700 44834.624 0 0.0021277747 0.0022417115 0.0021352036 0.0065046898 + 800 45413.998 0 0.0024558838 0.0025741787 0.0024088704 0.0074389329 + 900 45668.624 0 0.0027366171 0.002858242 0.0027580782 0.0083529374 + 1000 45809.223 0 0.0030331425 0.003186293 0.0030414906 0.0092609261 + 1100 45193.019 0 0.0033199824 0.0034668659 0.003298885 0.010085733 + 1200 44522.927 0 0.0036503132 0.0037490684 0.0036089852 0.011008367 + 1300 45214.567 0 0.0039958617 0.0040881934 0.0038709079 0.011954963 + 1400 45217.997 0 0.004276499 0.0044624985 0.0041104891 0.012849487 + 1500 45497.171 0 0.0045943272 0.0047116875 0.0044113504 0.013717365 + 1600 45905.187 0 0.0049004996 0.0049982014 0.0047394999 0.014638201 + 1700 45551.346 0 0.0051540939 0.0053187249 0.0050861052 0.015558924 + 1800 45347.782 0 0.0054101891 0.0056306 0.0053515873 0.016392376 + 1900 45107.895 0 0.005743705 0.0059584896 0.0056220384 0.017324233 + 2000 45043.389 0 0.0059803588 0.006230449 0.005911555 0.018122363 + 2100 45433.293 0 0.0062610364 0.0066140744 0.0062152977 0.019090408 + 2200 45804.217 0 0.0064995183 0.0068831274 0.0064971789 0.019879825 + 2300 45697.516 0 0.0067910846 0.0071845673 0.0068046192 0.020780271 + 2400 45447.422 0 0.0071022706 0.0074743709 0.0070983185 0.02167496 + 2500 45395.18 0 0.0073817023 0.0077467991 0.0074263196 0.022554821 + 2600 45943.044 0 0.0075953233 0.007997707 0.0076508583 0.023243889 + 2700 45859.978 0 0.0079082128 0.0082090043 0.0078853376 0.024002555 + 2800 45822.007 0 0.0082607534 0.0084510061 0.0081985549 0.024910314 + 2900 45438.456 0 0.0085958203 0.0088807705 0.0084755353 0.025952126 + 3000 45060.957 0 0.0089017992 0.0090966159 0.0086718875 0.026670303 +Loop time of 1.23282 on 4 procs for 3000 steps with 4096 atoms + +Performance: 2102.502 tau/day, 2433.452 timesteps/s +97.9% CPU use with 4 MPI tasks x 1 OpenMP threads + +MPI task timing breakdown: +Section | min time | avg time | max time |%varavg| %total +--------------------------------------------------------------- +Pair | 0 | 0 | 0 | 0.0 | 0.00 +Neigh | 8.5831e-06 | 8.5831e-06 | 8.5831e-06 | 0.0 | 0.00 +Comm | 0.10931 | 0.11473 | 0.11748 | 0.9 | 9.31 +Output | 0.001375 | 0.0018924 | 0.0034099 | 2.0 | 0.15 +Modify | 0.97744 | 0.99158 | 1.0089 | 1.3 | 80.43 +Other | | 0.1246 | | | 10.11 + +Nlocal: 1024.00 ave 1035 max 1016 min +Histogram: 2 0 0 0 0 0 1 0 0 1 +Nghost: 0.00000 ave 0 max 0 min +Histogram: 4 0 0 0 0 0 0 0 0 0 +Neighs: 0.00000 ave 0 max 0 min +Histogram: 4 0 0 0 0 0 0 0 0 0 + +Total # of neighbors = 0 +Ave neighs/atom = 0.0000000 +Neighbor list builds = 1 +Dangerous builds = 0 +Total wall time: 0:00:01 diff --git a/examples/USER/brownian/point/in2d.point b/examples/USER/brownian/point/in2d.point index e502bc0b98..bf790f8fc2 100644 --- a/examples/USER/brownian/point/in2d.point +++ b/examples/USER/brownian/point/in2d.point @@ -1,25 +1,16 @@ ##### dynamics of non-interacting point particles in 2D ##### -variable rng string gaussian -variable seed string 198098 +variable rng string gaussian +variable seed string 198098 +variable temp string 5.0 +variable gamma_t string 1.0 +variable params string ${rng}_${temp}_${gamma_t} - -variable temp string 5.0 - -variable gamma_t string 1.0 - - - -variable params string ${rng}_${temp}_${gamma_t} - - -log log_${params}_2d.lammps.log units lj atom_style atomic dimension 2 newton off - lattice sq 0.4 region box block -30 30 -30 30 -0.2 0.2 create_box 1 box @@ -27,36 +18,26 @@ create_atoms 1 box mass * 1.0 velocity all create 1.0 1 loop geom - neighbor 1.0 bin neigh_modify every 1 delay 1 check yes - - pair_style none - -fix 1 all brownian ${temp} ${seed} rng ${rng} & - gamma_t ${gamma_t} - - +fix 1 all brownian ${temp} ${seed} rng ${rng} gamma_t ${gamma_t} #initialisation for the main run -# MSD +# MSD compute msd all msd +thermo_style custom step ke pe c_msd[*] -thermo_style custom step temp epair c_msd[*] - - -dump 1 all custom 1000 dump_${params}_3d.lammpstrj id type & - x y z xu yu zu fx fy fz -dump_modify 1 first yes sort id +#dump 1 all custom 1000 dump_${params}_2d.lammpstrj id type & +# x y z xu yu zu fx fy fz +#dump_modify 1 first yes sort id timestep 0.00001 -thermo 50 +thermo 100 # main run -run 30000 - +run 3000 diff --git a/examples/USER/brownian/point/in3d.point b/examples/USER/brownian/point/in3d.point index b30d01e4d1..974f08866d 100644 --- a/examples/USER/brownian/point/in3d.point +++ b/examples/USER/brownian/point/in3d.point @@ -1,24 +1,16 @@ ##### overdamped dynamics of non-interacting point particles in 3D ##### -variable rng string gaussian -variable seed string 198098 +variable rng string gaussian +variable seed string 198098 +variable temp string 5.0 +variable gamma_t string 1.0 +variable params string ${rng}_${temp}_${gamma_t} - -variable temp string 5.0 - -variable gamma_t string 1.0 - - - -variable params string ${rng}_${temp}_${gamma_t} - -log log_${params}_3d.lammps.log units lj atom_style atomic dimension 3 newton off - lattice sc 0.4 region box block -8 8 -8 8 -8 8 create_box 1 box @@ -26,36 +18,27 @@ create_atoms 1 box mass * 1.0 velocity all create 1.0 1 loop geom - neighbor 1.0 bin neigh_modify every 1 delay 1 check yes - - pair_style none - -fix 1 all brownian ${temp} ${seed} rng ${rng} & - gamma_t ${gamma_t} - - +fix 1 all brownian ${temp} ${seed} rng ${rng} gamma_t ${gamma_t} #initialisation for the main run -# MSD +# MSD compute msd all msd +thermo_style custom step ke pe c_msd[*] -thermo_style custom step temp epair c_msd[*] - - -dump 1 all custom 1000 dump_${params}_3d.lammpstrj id type & - x y z xu yu zu fx fy fz -dump_modify 1 first yes sort id +#dump 1 all custom 1000 dump_${params}_3d.lammpstrj id type & +# x y z xu yu zu fx fy fz +#dump_modify 1 first yes sort id timestep 0.00001 -thermo 50 +thermo 100 # main run -run 30000 +run 3000 diff --git a/examples/USER/brownian/point/log.11May2021.in2d.point.g++.1 b/examples/USER/brownian/point/log.11May2021.in2d.point.g++.1 new file mode 100644 index 0000000000..b875ccedad --- /dev/null +++ b/examples/USER/brownian/point/log.11May2021.in2d.point.g++.1 @@ -0,0 +1,119 @@ +LAMMPS (8 Apr 2021) + using 1 OpenMP thread(s) per MPI task +##### dynamics of non-interacting point particles in 2D ##### + +variable rng string gaussian +variable seed string 198098 +variable temp string 5.0 +variable gamma_t string 1.0 +variable params string ${rng}_${temp}_${gamma_t} +variable params string gaussian_${temp}_${gamma_t} +variable params string gaussian_5.0_${gamma_t} +variable params string gaussian_5.0_1.0 + +units lj +atom_style atomic +dimension 2 +newton off + +lattice sq 0.4 +Lattice spacing in x,y,z = 1.5811388 1.5811388 1.5811388 +region box block -30 30 -30 30 -0.2 0.2 +create_box 1 box +Created orthogonal box = (-47.434165 -47.434165 -0.31622777) to (47.434165 47.434165 0.31622777) + 1 by 1 by 1 MPI processor grid +create_atoms 1 box +Created 3600 atoms + create_atoms CPU = 0.003 seconds +mass * 1.0 +velocity all create 1.0 1 loop geom + +neighbor 1.0 bin +neigh_modify every 1 delay 1 check yes + +pair_style none + +fix 1 all brownian ${temp} ${seed} rng ${rng} gamma_t ${gamma_t} +fix 1 all brownian 5.0 ${seed} rng ${rng} gamma_t ${gamma_t} +fix 1 all brownian 5.0 198098 rng ${rng} gamma_t ${gamma_t} +fix 1 all brownian 5.0 198098 rng gaussian gamma_t ${gamma_t} +fix 1 all brownian 5.0 198098 rng gaussian gamma_t 1.0 + +#initialisation for the main run + +# MSD +compute msd all msd + +thermo_style custom step ke pe c_msd[*] + +#dump 1 all custom 1000 dump_${params}_2d.lammpstrj id type # x y z xu yu zu fx fy fz +#dump_modify 1 first yes sort id + +timestep 0.00001 +thermo 100 + +# main run +run 3000 +WARNING: No pairwise cutoff or binsize set. Atom sorting therefore disabled. (src/atom.cpp:2141) +WARNING: Communication cutoff is 0.0. No ghost atoms will be generated. Atoms may get lost. (src/comm_brick.cpp:167) +Per MPI rank memory allocation (min/avg/max) = 2.664 | 2.664 | 2.664 Mbytes +Step KinEng PotEng c_msd[1] c_msd[2] c_msd[3] c_msd[4] + 0 0.99972222 0 0 0 0 0 + 100 1022861.2 0 0.010252464 0.0095481044 0 0.019800568 + 200 986781.19 0 0.020552091 0.019485252 0 0.040037343 + 300 1030219 0 0.030642552 0.028377678 0 0.05902023 + 400 1003322.5 0 0.040610693 0.038179284 0 0.078789978 + 500 989343.12 0 0.049978908 0.047445856 0 0.097424764 + 600 1029781.3 0 0.059551719 0.057941149 0 0.11749287 + 700 999447.72 0 0.06979546 0.067552325 0 0.13734778 + 800 995373.97 0 0.080049251 0.078006344 0 0.1580556 + 900 1011991.4 0 0.089753134 0.087065214 0 0.17681835 + 1000 1006017.1 0 0.10041092 0.097934217 0 0.19834514 + 1100 997762.63 0 0.11229742 0.10841547 0 0.22071289 + 1200 1011707.8 0 0.12006388 0.1190115 0 0.23907538 + 1300 1012099.1 0 0.13097486 0.12996632 0 0.26094117 + 1400 997602.43 0 0.14345778 0.13830585 0 0.28176362 + 1500 1005358.1 0 0.15441686 0.14927539 0 0.30369225 + 1600 1007081.8 0 0.16496828 0.15936363 0 0.3243319 + 1700 990284.9 0 0.1747286 0.16818246 0 0.34291106 + 1800 969006.97 0 0.18228778 0.17972813 0 0.3620159 + 1900 998066.69 0 0.19338277 0.19226121 0 0.38564397 + 2000 972300.66 0 0.20352485 0.20145928 0 0.40498413 + 2100 985025.88 0 0.21283854 0.21090075 0 0.42373929 + 2200 1010964.6 0 0.22279055 0.22110734 0 0.44389789 + 2300 975819.44 0 0.23128131 0.23226488 0 0.46354619 + 2400 977043.53 0 0.24284105 0.24301689 0 0.48585794 + 2500 969708.21 0 0.25415238 0.25354284 0 0.50769522 + 2600 981969.5 0 0.26457173 0.26318018 0 0.52775192 + 2700 987261.1 0 0.27497004 0.27761213 0 0.55258218 + 2800 1005751.1 0 0.28530448 0.28715428 0 0.57245876 + 2900 975930.11 0 0.29394811 0.29896948 0 0.59291759 + 3000 997388.08 0 0.30674701 0.31193573 0 0.61868274 +Loop time of 1.501 on 1 procs for 3000 steps with 3600 atoms + +Performance: 1726.852 tau/day, 1998.672 timesteps/s +99.9% CPU use with 1 MPI tasks x 1 OpenMP threads + +MPI task timing breakdown: +Section | min time | avg time | max time |%varavg| %total +--------------------------------------------------------------- +Pair | 0 | 0 | 0 | 0.0 | 0.00 +Neigh | 0.00059271 | 0.00059271 | 0.00059271 | 0.0 | 0.04 +Comm | 0.0055437 | 0.0055437 | 0.0055437 | 0.0 | 0.37 +Output | 0.0039999 | 0.0039999 | 0.0039999 | 0.0 | 0.27 +Modify | 1.3852 | 1.3852 | 1.3852 | 0.0 | 92.28 +Other | | 0.1057 | | | 7.04 + +Nlocal: 3600.00 ave 3600 max 3600 min +Histogram: 1 0 0 0 0 0 0 0 0 0 +Nghost: 0.00000 ave 0 max 0 min +Histogram: 1 0 0 0 0 0 0 0 0 0 +Neighs: 0.00000 ave 0 max 0 min +Histogram: 1 0 0 0 0 0 0 0 0 0 + +Total # of neighbors = 0 +Ave neighs/atom = 0.0000000 +Neighbor list builds = 21 +Dangerous builds = 0 + +Total wall time: 0:00:01 diff --git a/examples/USER/brownian/point/log.11May2021.in2d.point.g++.4 b/examples/USER/brownian/point/log.11May2021.in2d.point.g++.4 new file mode 100644 index 0000000000..d12d71118e --- /dev/null +++ b/examples/USER/brownian/point/log.11May2021.in2d.point.g++.4 @@ -0,0 +1,119 @@ +LAMMPS (8 Apr 2021) + using 1 OpenMP thread(s) per MPI task +##### dynamics of non-interacting point particles in 2D ##### + +variable rng string gaussian +variable seed string 198098 +variable temp string 5.0 +variable gamma_t string 1.0 +variable params string ${rng}_${temp}_${gamma_t} +variable params string gaussian_${temp}_${gamma_t} +variable params string gaussian_5.0_${gamma_t} +variable params string gaussian_5.0_1.0 + +units lj +atom_style atomic +dimension 2 +newton off + +lattice sq 0.4 +Lattice spacing in x,y,z = 1.5811388 1.5811388 1.5811388 +region box block -30 30 -30 30 -0.2 0.2 +create_box 1 box +Created orthogonal box = (-47.434165 -47.434165 -0.31622777) to (47.434165 47.434165 0.31622777) + 2 by 2 by 1 MPI processor grid +create_atoms 1 box +Created 3600 atoms + create_atoms CPU = 0.001 seconds +mass * 1.0 +velocity all create 1.0 1 loop geom + +neighbor 1.0 bin +neigh_modify every 1 delay 1 check yes + +pair_style none + +fix 1 all brownian ${temp} ${seed} rng ${rng} gamma_t ${gamma_t} +fix 1 all brownian 5.0 ${seed} rng ${rng} gamma_t ${gamma_t} +fix 1 all brownian 5.0 198098 rng ${rng} gamma_t ${gamma_t} +fix 1 all brownian 5.0 198098 rng gaussian gamma_t ${gamma_t} +fix 1 all brownian 5.0 198098 rng gaussian gamma_t 1.0 + +#initialisation for the main run + +# MSD +compute msd all msd + +thermo_style custom step ke pe c_msd[*] + +#dump 1 all custom 1000 dump_${params}_2d.lammpstrj id type # x y z xu yu zu fx fy fz +#dump_modify 1 first yes sort id + +timestep 0.00001 +thermo 100 + +# main run +run 3000 +WARNING: No pairwise cutoff or binsize set. Atom sorting therefore disabled. (src/atom.cpp:2141) +WARNING: Communication cutoff is 0.0. No ghost atoms will be generated. Atoms may get lost. (src/comm_brick.cpp:167) +Per MPI rank memory allocation (min/avg/max) = 2.664 | 2.664 | 2.664 Mbytes +Step KinEng PotEng c_msd[1] c_msd[2] c_msd[3] c_msd[4] + 0 0.99972222 0 0 0 0 0 + 100 1017972.1 0 0.010094052 0.0097502899 0 0.019844342 + 200 1004552.1 0 0.020125116 0.01957629 0 0.039701406 + 300 1017712.9 0 0.030271373 0.029411656 0 0.059683029 + 400 1016693.8 0 0.040610061 0.038605869 0 0.07921593 + 500 999527.84 0 0.049451389 0.049042225 0 0.098493614 + 600 961157.92 0 0.059691948 0.059033176 0 0.11872512 + 700 1006804.9 0 0.071205977 0.069972106 0 0.14117808 + 800 1007321.8 0 0.081136977 0.079825976 0 0.16096295 + 900 1002801.7 0 0.091236148 0.090833816 0 0.18206996 + 1000 1010134.7 0 0.10091362 0.10023906 0 0.20115269 + 1100 990246.55 0 0.1118367 0.11141049 0 0.22324719 + 1200 1010555.5 0 0.12091736 0.12355456 0 0.24447192 + 1300 997117.19 0 0.13099592 0.13292775 0 0.26392367 + 1400 1020817.1 0 0.14167961 0.14172898 0 0.28340859 + 1500 1015048.1 0 0.15225884 0.15162948 0 0.30388833 + 1600 990291.98 0 0.16460973 0.16251919 0 0.32712891 + 1700 980848.58 0 0.17380313 0.17351201 0 0.34731513 + 1800 1000673.8 0 0.18383991 0.18175453 0 0.36559445 + 1900 1009388.9 0 0.19411523 0.19367453 0 0.38778976 + 2000 1005935.9 0 0.2015342 0.20585359 0 0.40738779 + 2100 985500.56 0 0.21161056 0.21238463 0 0.42399519 + 2200 997241.34 0 0.21841986 0.22117922 0 0.43959908 + 2300 1011672.3 0 0.22688099 0.23155741 0 0.4584384 + 2400 989837.68 0 0.23849839 0.24219 0 0.48068839 + 2500 1035706.8 0 0.24541408 0.24947563 0 0.49488971 + 2600 992370.08 0 0.25537803 0.25758332 0 0.51296135 + 2700 990586.56 0 0.26542605 0.26762286 0 0.53304892 + 2800 1002767.3 0 0.27570392 0.27874972 0 0.55445363 + 2900 995307.27 0 0.28580946 0.29115624 0 0.5769657 + 3000 1024317.7 0 0.29493208 0.30208924 0 0.59702132 +Loop time of 0.413047 on 4 procs for 3000 steps with 3600 atoms + +Performance: 6275.312 tau/day, 7263.093 timesteps/s +98.0% CPU use with 4 MPI tasks x 1 OpenMP threads + +MPI task timing breakdown: +Section | min time | avg time | max time |%varavg| %total +--------------------------------------------------------------- +Pair | 0 | 0 | 0 | 0.0 | 0.00 +Neigh | 0.00016236 | 0.00016338 | 0.00016403 | 0.0 | 0.04 +Comm | 0.0026367 | 0.0030084 | 0.0031497 | 0.4 | 0.73 +Output | 0.0011849 | 0.0013574 | 0.0018065 | 0.7 | 0.33 +Modify | 0.34447 | 0.35223 | 0.36357 | 1.2 | 85.28 +Other | | 0.05629 | | | 13.63 + +Nlocal: 900.000 ave 906 max 891 min +Histogram: 1 0 0 0 0 0 1 0 1 1 +Nghost: 0.00000 ave 0 max 0 min +Histogram: 4 0 0 0 0 0 0 0 0 0 +Neighs: 0.00000 ave 0 max 0 min +Histogram: 4 0 0 0 0 0 0 0 0 0 + +Total # of neighbors = 0 +Ave neighs/atom = 0.0000000 +Neighbor list builds = 22 +Dangerous builds = 0 + +Total wall time: 0:00:00 diff --git a/examples/USER/brownian/point/log.11May2021.in3d.point.g++.1 b/examples/USER/brownian/point/log.11May2021.in3d.point.g++.1 new file mode 100644 index 0000000000..febb7657e7 --- /dev/null +++ b/examples/USER/brownian/point/log.11May2021.in3d.point.g++.1 @@ -0,0 +1,119 @@ +LAMMPS (8 Apr 2021) + using 1 OpenMP thread(s) per MPI task +##### overdamped dynamics of non-interacting point particles in 3D ##### + +variable rng string gaussian +variable seed string 198098 +variable temp string 5.0 +variable gamma_t string 1.0 +variable params string ${rng}_${temp}_${gamma_t} +variable params string gaussian_${temp}_${gamma_t} +variable params string gaussian_5.0_${gamma_t} +variable params string gaussian_5.0_1.0 + +units lj +atom_style atomic +dimension 3 +newton off + +lattice sc 0.4 +Lattice spacing in x,y,z = 1.3572088 1.3572088 1.3572088 +region box block -8 8 -8 8 -8 8 +create_box 1 box +Created orthogonal box = (-10.857670 -10.857670 -10.857670) to (10.857670 10.857670 10.857670) + 1 by 1 by 1 MPI processor grid +create_atoms 1 box +Created 4096 atoms + create_atoms CPU = 0.002 seconds +mass * 1.0 +velocity all create 1.0 1 loop geom + +neighbor 1.0 bin +neigh_modify every 1 delay 1 check yes + +pair_style none + +fix 1 all brownian ${temp} ${seed} rng ${rng} gamma_t ${gamma_t} +fix 1 all brownian 5.0 ${seed} rng ${rng} gamma_t ${gamma_t} +fix 1 all brownian 5.0 198098 rng ${rng} gamma_t ${gamma_t} +fix 1 all brownian 5.0 198098 rng gaussian gamma_t ${gamma_t} +fix 1 all brownian 5.0 198098 rng gaussian gamma_t 1.0 + +#initialisation for the main run + +# MSD +compute msd all msd + +thermo_style custom step ke pe c_msd[*] + +#dump 1 all custom 1000 dump_${params}_3d.lammpstrj id type # x y z xu yu zu fx fy fz +#dump_modify 1 first yes sort id + +timestep 0.00001 +thermo 100 + +# main run +run 3000 +WARNING: No pairwise cutoff or binsize set. Atom sorting therefore disabled. (src/atom.cpp:2141) +WARNING: Communication cutoff is 0.0. No ghost atoms will be generated. Atoms may get lost. (src/comm_brick.cpp:167) +Per MPI rank memory allocation (min/avg/max) = 2.694 | 2.694 | 2.694 Mbytes +Step KinEng PotEng c_msd[1] c_msd[2] c_msd[3] c_msd[4] + 0 1.4996338 0 0 0 0 0 + 100 1500286.3 0 0.0098123603 0.010352169 0.010242435 0.030406964 + 200 1488308 0 0.019934427 0.019968198 0.020471735 0.06037436 + 300 1484472.4 0 0.029397156 0.030749312 0.030121294 0.090267762 + 400 1517938.7 0 0.039217504 0.041440617 0.040512943 0.12117106 + 500 1492769.5 0 0.04890343 0.051561801 0.050614941 0.15108017 + 600 1510159.6 0 0.059770181 0.061650364 0.061298117 0.18271866 + 700 1485424.1 0 0.070537955 0.071144877 0.071141546 0.21282438 + 800 1496377.2 0 0.081291995 0.082546059 0.080653381 0.24449144 + 900 1484409.1 0 0.090940427 0.093298981 0.091328056 0.27556746 + 1000 1503322.4 0 0.10176921 0.10246052 0.10151773 0.30574747 + 1100 1503322.4 0 0.11295993 0.11052632 0.11053406 0.33402031 + 1200 1489236.2 0 0.12509723 0.11961982 0.12146498 0.36618203 + 1300 1476050.3 0 0.13449034 0.12941323 0.1309765 0.39488007 + 1400 1520818.7 0 0.14613571 0.13788044 0.14083944 0.42485558 + 1500 1498936.4 0 0.15752286 0.15057712 0.15063399 0.45873397 + 1600 1507524.1 0 0.16793678 0.16095681 0.16063531 0.4895289 + 1700 1480581.2 0 0.17748019 0.172614 0.16922383 0.51931802 + 1800 1505353.6 0 0.18850931 0.18304171 0.18063119 0.55218221 + 1900 1491234.7 0 0.19836402 0.19306339 0.1929707 0.58439811 + 2000 1519868.8 0 0.20698191 0.20211344 0.20328302 0.61237838 + 2100 1493919.5 0 0.21453524 0.21186097 0.21423293 0.64062914 + 2200 1517098.6 0 0.2257338 0.22381647 0.22474081 0.67429108 + 2300 1481270.7 0 0.23499747 0.23348379 0.23498244 0.70346369 + 2400 1495445.1 0 0.24535894 0.24290239 0.24229161 0.73055293 + 2500 1522839.3 0 0.25695938 0.25109669 0.25214541 0.76020148 + 2600 1518697.4 0 0.26680819 0.26120216 0.2604112 0.78842155 + 2700 1529283.1 0 0.27524422 0.26942681 0.27148042 0.81615146 + 2800 1500557.5 0 0.28436226 0.27957592 0.27935619 0.84329437 + 2900 1509711.1 0 0.2948528 0.28562401 0.29055956 0.87103637 + 3000 1522712.8 0 0.30347033 0.2975063 0.30121685 0.90219348 +Loop time of 2.35056 on 1 procs for 3000 steps with 4096 atoms + +Performance: 1102.718 tau/day, 1276.293 timesteps/s +99.9% CPU use with 1 MPI tasks x 1 OpenMP threads + +MPI task timing breakdown: +Section | min time | avg time | max time |%varavg| %total +--------------------------------------------------------------- +Pair | 0 | 0 | 0 | 0.0 | 0.00 +Neigh | 0.00077772 | 0.00077772 | 0.00077772 | 0.0 | 0.03 +Comm | 0.010985 | 0.010985 | 0.010985 | 0.0 | 0.47 +Output | 0.0045807 | 0.0045807 | 0.0045807 | 0.0 | 0.19 +Modify | 2.2116 | 2.2116 | 2.2116 | 0.0 | 94.09 +Other | | 0.1226 | | | 5.22 + +Nlocal: 4096.00 ave 4096 max 4096 min +Histogram: 1 0 0 0 0 0 0 0 0 0 +Nghost: 0.00000 ave 0 max 0 min +Histogram: 1 0 0 0 0 0 0 0 0 0 +Neighs: 0.00000 ave 0 max 0 min +Histogram: 1 0 0 0 0 0 0 0 0 0 + +Total # of neighbors = 0 +Ave neighs/atom = 0.0000000 +Neighbor list builds = 24 +Dangerous builds = 0 + +Total wall time: 0:00:02 diff --git a/examples/USER/brownian/point/log.11May2021.in3d.point.g++.4 b/examples/USER/brownian/point/log.11May2021.in3d.point.g++.4 new file mode 100644 index 0000000000..6a41a12f0f --- /dev/null +++ b/examples/USER/brownian/point/log.11May2021.in3d.point.g++.4 @@ -0,0 +1,119 @@ +LAMMPS (8 Apr 2021) + using 1 OpenMP thread(s) per MPI task +##### overdamped dynamics of non-interacting point particles in 3D ##### + +variable rng string gaussian +variable seed string 198098 +variable temp string 5.0 +variable gamma_t string 1.0 +variable params string ${rng}_${temp}_${gamma_t} +variable params string gaussian_${temp}_${gamma_t} +variable params string gaussian_5.0_${gamma_t} +variable params string gaussian_5.0_1.0 + +units lj +atom_style atomic +dimension 3 +newton off + +lattice sc 0.4 +Lattice spacing in x,y,z = 1.3572088 1.3572088 1.3572088 +region box block -8 8 -8 8 -8 8 +create_box 1 box +Created orthogonal box = (-10.857670 -10.857670 -10.857670) to (10.857670 10.857670 10.857670) + 2 by 1 by 2 MPI processor grid +create_atoms 1 box +Created 4096 atoms + create_atoms CPU = 0.001 seconds +mass * 1.0 +velocity all create 1.0 1 loop geom + +neighbor 1.0 bin +neigh_modify every 1 delay 1 check yes + +pair_style none + +fix 1 all brownian ${temp} ${seed} rng ${rng} gamma_t ${gamma_t} +fix 1 all brownian 5.0 ${seed} rng ${rng} gamma_t ${gamma_t} +fix 1 all brownian 5.0 198098 rng ${rng} gamma_t ${gamma_t} +fix 1 all brownian 5.0 198098 rng gaussian gamma_t ${gamma_t} +fix 1 all brownian 5.0 198098 rng gaussian gamma_t 1.0 + +#initialisation for the main run + +# MSD +compute msd all msd + +thermo_style custom step ke pe c_msd[*] + +#dump 1 all custom 1000 dump_${params}_3d.lammpstrj id type # x y z xu yu zu fx fy fz +#dump_modify 1 first yes sort id + +timestep 0.00001 +thermo 100 + +# main run +run 3000 +WARNING: No pairwise cutoff or binsize set. Atom sorting therefore disabled. (src/atom.cpp:2141) +WARNING: Communication cutoff is 0.0. No ghost atoms will be generated. Atoms may get lost. (src/comm_brick.cpp:167) +Per MPI rank memory allocation (min/avg/max) = 2.672 | 2.672 | 2.672 Mbytes +Step KinEng PotEng c_msd[1] c_msd[2] c_msd[3] c_msd[4] + 0 1.4996338 0 0 0 0 0 + 100 1515328.2 0 0.010465453 0.010044629 0.0097242319 0.030234314 + 200 1510820.8 0 0.020658886 0.019954762 0.020008864 0.060622512 + 300 1482006.5 0 0.030402195 0.029802874 0.030047586 0.090252655 + 400 1492228.5 0 0.039622543 0.038899144 0.040381854 0.11890354 + 500 1494985.5 0 0.050523465 0.050022913 0.050186478 0.15073286 + 600 1516047.4 0 0.061111845 0.061433818 0.059195364 0.18174103 + 700 1510021.8 0 0.071636778 0.072829755 0.06946406 0.21393059 + 800 1505964.7 0 0.08240965 0.08433785 0.078799851 0.24554735 + 900 1491035.9 0 0.093659937 0.094517749 0.08812559 0.27630328 + 1000 1516599.6 0 0.10436496 0.10431759 0.097480868 0.30616342 + 1100 1495170.3 0 0.11468757 0.111397 0.1069763 0.33306087 + 1200 1500630.6 0 0.12360977 0.12264534 0.11583999 0.3620951 + 1300 1474889.5 0 0.13432447 0.13471694 0.12702491 0.39606632 + 1400 1487145.8 0 0.14573239 0.14431493 0.13669403 0.42674135 + 1500 1519496.7 0 0.15610742 0.15505416 0.14600182 0.4571634 + 1600 1525674.1 0 0.16728653 0.1649354 0.15562133 0.48784325 + 1700 1540725.4 0 0.17846447 0.17666562 0.16531781 0.52044791 + 1800 1512334.8 0 0.18872753 0.18538847 0.17450009 0.54861609 + 1900 1498371.4 0 0.19688928 0.19333299 0.18581712 0.5760394 + 2000 1546459.4 0 0.20955053 0.20243854 0.19613897 0.60812803 + 2100 1509712.9 0 0.21922567 0.20940597 0.20567239 0.63430404 + 2200 1509630.4 0 0.23067999 0.21856734 0.21619911 0.66544645 + 2300 1483929.1 0 0.24160803 0.231048 0.22617193 0.69882797 + 2400 1488492.1 0 0.25399491 0.24082678 0.23972356 0.73454526 + 2500 1508107.9 0 0.26608734 0.25316913 0.2486814 0.76793787 + 2600 1511952.1 0 0.27523956 0.2623673 0.25706539 0.79467225 + 2700 1488888.8 0 0.28518299 0.27425585 0.26728622 0.82672506 + 2800 1515428.4 0 0.29595429 0.28589969 0.27781327 0.85966725 + 2900 1504312.1 0 0.30393798 0.29533034 0.28725362 0.88652194 + 3000 1521521.3 0 0.31445132 0.30117607 0.29959324 0.91522062 +Loop time of 0.708196 on 4 procs for 3000 steps with 4096 atoms + +Performance: 3660.004 tau/day, 4236.115 timesteps/s +97.2% CPU use with 4 MPI tasks x 1 OpenMP threads + +MPI task timing breakdown: +Section | min time | avg time | max time |%varavg| %total +--------------------------------------------------------------- +Pair | 0 | 0 | 0 | 0.0 | 0.00 +Neigh | 0.00020647 | 0.00021023 | 0.0002141 | 0.0 | 0.03 +Comm | 0.0045607 | 0.0050649 | 0.0053098 | 0.4 | 0.72 +Output | 0.0013759 | 0.002265 | 0.0037355 | 1.9 | 0.32 +Modify | 0.57353 | 0.58931 | 0.6109 | 1.8 | 83.21 +Other | | 0.1113 | | | 15.72 + +Nlocal: 1024.00 ave 1043 max 1001 min +Histogram: 1 0 0 0 0 2 0 0 0 1 +Nghost: 0.00000 ave 0 max 0 min +Histogram: 4 0 0 0 0 0 0 0 0 0 +Neighs: 0.00000 ave 0 max 0 min +Histogram: 4 0 0 0 0 0 0 0 0 0 + +Total # of neighbors = 0 +Ave neighs/atom = 0.0000000 +Neighbor list builds = 25 +Dangerous builds = 0 + +Total wall time: 0:00:00 diff --git a/examples/USER/brownian/sphere/in2d.sphere b/examples/USER/brownian/sphere/in2d.sphere index f0d5c26262..a194f967cc 100644 --- a/examples/USER/brownian/sphere/in2d.sphere +++ b/examples/USER/brownian/sphere/in2d.sphere @@ -1,27 +1,17 @@ ##### overdamped dynamics of a sphere (with dipole attached to it) in 2D ##### -variable rng string uniform -variable seed string 198098 +variable rng string uniform +variable seed string 198098 +variable temp string 1.0 +variable gamma_t string 5.0 +variable gamma_r string 0.7 +variable params string ${rng}_${temp}_${gamma_r}_${gamma_t} - -variable temp string 1.0 - -variable gamma_t string 5.0 - -variable gamma_r string 0.7 - - - -variable params string ${rng}_${temp}_${gamma_r}_${gamma_t} - - -log log_${params}_2d.lammps.log units lj atom_style hybrid dipole sphere dimension 2 newton off - lattice sq 0.4 region box block -30 30 -30 30 -0.2 0.2 create_box 1 box @@ -30,37 +20,26 @@ mass * 1.0 set type * dipole/random ${seed} 1.0 velocity all create 1.0 1 loop geom - neighbor 1.0 bin neigh_modify every 1 delay 1 check yes - - pair_style none - - - -fix 1 all brownian/sphere ${temp} ${seed} rng ${rng} & - gamma_r ${gamma_r} gamma_t ${gamma_t} - - +fix 1 all brownian/sphere ${temp} ${seed} rng ${rng} gamma_r ${gamma_r} gamma_t ${gamma_t} #initialisation for the main run -# MSD +# MSD compute msd all msd +thermo_style custom step ke pe c_msd[*] -thermo_style custom step temp epair c_msd[*] - - -dump 1 all custom 1000 dump_${params}_2d.lammpstrj id type & - x y z xu yu zu mux muy muz fx fy fz -dump_modify 1 first yes sort id +#dump 1 all custom 1000 dump_${params}_2d.lammpstrj id type & +# x y z xu yu zu mux muy muz fx fy fz +#dump_modify 1 first yes sort id timestep 0.00001 -thermo 50 +thermo 100 # main run -run 30000 +run 3000 diff --git a/examples/USER/brownian/sphere/in3d.sphere b/examples/USER/brownian/sphere/in3d.sphere index 06ca649c4c..d3264ee450 100644 --- a/examples/USER/brownian/sphere/in3d.sphere +++ b/examples/USER/brownian/sphere/in3d.sphere @@ -1,27 +1,17 @@ ##### overdamped dynamics of a sphere (with dipole attached to it) in 3D##### -variable rng string uniform -variable seed string 198098 +variable rng string uniform +variable seed string 198098 +variable temp string 1.0 +variable gamma_t string 5.0 +variable gamma_r string 0.7 +variable params string ${rng}_${temp}_${gamma_r}_${gamma_t} - -variable temp string 1.0 - -variable gamma_t string 5.0 - -variable gamma_r string 0.7 - - - -variable params string ${rng}_${temp}_${gamma_r}_${gamma_t} - - -log log_${params}_3d.lammps.log units lj atom_style hybrid dipole sphere dimension 3 newton off - lattice sc 0.4 region box block -8 8 -8 8 -8 8 create_box 1 box @@ -30,36 +20,26 @@ mass * 1.0 set type * dipole/random ${seed} 1.0 velocity all create 1.0 1 loop geom - neighbor 1.0 bin neigh_modify every 1 delay 1 check yes - - pair_style none - - -fix 1 all brownian/sphere ${temp} ${seed} rng ${rng} & - gamma_r ${gamma_r} gamma_t ${gamma_t} - - +fix 1 all brownian/sphere ${temp} ${seed} rng ${rng} gamma_r ${gamma_r} gamma_t ${gamma_t} #initialisation for the main run -# MSD +# MSD compute msd all msd +thermo_style custom step ke pe c_msd[*] -thermo_style custom step temp epair c_msd[*] - - -dump 1 all custom 1000 dump_${params}_3d.lammpstrj id type & - x y z xu yu zu mux muy muz fx fy fz -dump_modify 1 first yes sort id +#dump 1 all custom 1000 dump_${params}_3d.lammpstrj id type & +# x y z xu yu zu mux muy muz fx fy fz +#dump_modify 1 first yes sort id timestep 0.00001 -thermo 50 +thermo 100 # main run -run 30000 +run 3000 diff --git a/examples/USER/brownian/sphere/log.11May2021.in2d.sphere.g++.1 b/examples/USER/brownian/sphere/log.11May2021.in2d.sphere.g++.1 new file mode 100644 index 0000000000..917f2b63fb --- /dev/null +++ b/examples/USER/brownian/sphere/log.11May2021.in2d.sphere.g++.1 @@ -0,0 +1,126 @@ +LAMMPS (8 Apr 2021) + using 1 OpenMP thread(s) per MPI task +##### overdamped dynamics of a sphere (with dipole attached to it) in 2D ##### + +variable rng string uniform +variable seed string 198098 +variable temp string 1.0 +variable gamma_t string 5.0 +variable gamma_r string 0.7 +variable params string ${rng}_${temp}_${gamma_r}_${gamma_t} +variable params string uniform_${temp}_${gamma_r}_${gamma_t} +variable params string uniform_1.0_${gamma_r}_${gamma_t} +variable params string uniform_1.0_0.7_${gamma_t} +variable params string uniform_1.0_0.7_5.0 + +units lj +atom_style hybrid dipole sphere +WARNING: Atom style hybrid defines both, per-type and per-atom masses; both must be set, but only per-atom masses will be used (src/atom_vec_hybrid.cpp:156) +dimension 2 +newton off + +lattice sq 0.4 +Lattice spacing in x,y,z = 1.5811388 1.5811388 1.5811388 +region box block -30 30 -30 30 -0.2 0.2 +create_box 1 box +Created orthogonal box = (-47.434165 -47.434165 -0.31622777) to (47.434165 47.434165 0.31622777) + 1 by 1 by 1 MPI processor grid +create_atoms 1 box +Created 3600 atoms + create_atoms CPU = 0.005 seconds +mass * 1.0 +set type * dipole/random ${seed} 1.0 +set type * dipole/random 198098 1.0 +Setting atom values ... + 3600 settings made for dipole/random +velocity all create 1.0 1 loop geom + +neighbor 1.0 bin +neigh_modify every 1 delay 1 check yes + +pair_style none + +fix 1 all brownian/sphere ${temp} ${seed} rng ${rng} gamma_r ${gamma_r} gamma_t ${gamma_t} +fix 1 all brownian/sphere 1.0 ${seed} rng ${rng} gamma_r ${gamma_r} gamma_t ${gamma_t} +fix 1 all brownian/sphere 1.0 198098 rng ${rng} gamma_r ${gamma_r} gamma_t ${gamma_t} +fix 1 all brownian/sphere 1.0 198098 rng uniform gamma_r ${gamma_r} gamma_t ${gamma_t} +fix 1 all brownian/sphere 1.0 198098 rng uniform gamma_r 0.7 gamma_t ${gamma_t} +fix 1 all brownian/sphere 1.0 198098 rng uniform gamma_r 0.7 gamma_t 5.0 + +#initialisation for the main run + +# MSD +compute msd all msd + +thermo_style custom step ke pe c_msd[*] + +#dump 1 all custom 1000 dump_${params}_2d.lammpstrj id type # x y z xu yu zu mux muy muz fx fy fz +#dump_modify 1 first yes sort id + +timestep 0.00001 +thermo 100 + +# main run +run 3000 +WARNING: No pairwise cutoff or binsize set. Atom sorting therefore disabled. (src/atom.cpp:2141) +WARNING: Communication cutoff is 0.0. No ghost atoms will be generated. Atoms may get lost. (src/comm_brick.cpp:167) +Per MPI rank memory allocation (min/avg/max) = 4.664 | 4.664 | 4.664 Mbytes +Step KinEng PotEng c_msd[1] c_msd[2] c_msd[3] c_msd[4] + 0 0.99972222 0 0 0 0 0 + 100 20867.136 0 0.00040006704 0.00039570887 0 0.00079577592 + 200 20835.491 0 0.00077560901 0.00080455484 0 0.0015801638 + 300 20813.122 0 0.0011737739 0.0012172689 0 0.0023910428 + 400 21137.397 0 0.0015587675 0.0016096093 0 0.0031683768 + 500 21167.188 0 0.0019294105 0.0020251322 0 0.0039545428 + 600 21345.908 0 0.0023105313 0.0024111742 0 0.0047217054 + 700 21086.272 0 0.0027236116 0.0027846006 0 0.0055082122 + 800 20840.906 0 0.0031505299 0.0031810732 0 0.0063316031 + 900 20916.456 0 0.0035525852 0.0035981301 0 0.0071507153 + 1000 20752.249 0 0.0039147929 0.0039791172 0 0.0078939101 + 1100 20643.612 0 0.0042977921 0.0043701484 0 0.0086679405 + 1200 21085.63 0 0.0045584242 0.0047475091 0 0.0093059332 + 1300 20900.794 0 0.0049718803 0.0051481706 0 0.010120051 + 1400 20980.731 0 0.0054234603 0.0054230724 0 0.010846533 + 1500 20916.308 0 0.0058502946 0.0058114313 0 0.011661726 + 1600 20949.786 0 0.0062258463 0.006208129 0 0.012433975 + 1700 20531.205 0 0.0066276219 0.006595921 0 0.013223543 + 1800 21418.472 0 0.0070077409 0.007030461 0 0.014038202 + 1900 21291.928 0 0.0074052208 0.0074333041 0 0.014838525 + 2000 20893.895 0 0.0077407477 0.007901402 0 0.01564215 + 2100 21218.001 0 0.0080384756 0.0082611258 0 0.016299601 + 2200 21116.189 0 0.0084325164 0.008617977 0 0.017050493 + 2300 20718.83 0 0.0089455345 0.0091768161 0 0.018122351 + 2400 20719.164 0 0.0093666455 0.0095272546 0 0.0188939 + 2500 20991.382 0 0.009706795 0.0098256506 0 0.019532446 + 2600 20515.74 0 0.0099247069 0.010329841 0 0.020254548 + 2700 21001.55 0 0.010448354 0.010693502 0 0.021141855 + 2800 21363.824 0 0.010990971 0.011142092 0 0.022133063 + 2900 20497.025 0 0.011399704 0.011504868 0 0.022904573 + 3000 20726.572 0 0.011785354 0.01187482 0 0.023660175 +Loop time of 1.76023 on 1 procs for 3000 steps with 3600 atoms + +Performance: 1472.538 tau/day, 1704.326 timesteps/s +99.9% CPU use with 1 MPI tasks x 1 OpenMP threads + +MPI task timing breakdown: +Section | min time | avg time | max time |%varavg| %total +--------------------------------------------------------------- +Pair | 0 | 0 | 0 | 0.0 | 0.00 +Neigh | 0 | 0 | 0 | 0.0 | 0.00 +Comm | 0.026518 | 0.026518 | 0.026518 | 0.0 | 1.51 +Output | 0.0040107 | 0.0040107 | 0.0040107 | 0.0 | 0.23 +Modify | 1.6194 | 1.6194 | 1.6194 | 0.0 | 92.00 +Other | | 0.1103 | | | 6.27 + +Nlocal: 3600.00 ave 3600 max 3600 min +Histogram: 1 0 0 0 0 0 0 0 0 0 +Nghost: 121.000 ave 121 max 121 min +Histogram: 1 0 0 0 0 0 0 0 0 0 +Neighs: 0.00000 ave 0 max 0 min +Histogram: 1 0 0 0 0 0 0 0 0 0 + +Total # of neighbors = 0 +Ave neighs/atom = 0.0000000 +Neighbor list builds = 0 +Dangerous builds = 0 +Total wall time: 0:00:01 diff --git a/examples/USER/brownian/sphere/log.11May2021.in2d.sphere.g++.4 b/examples/USER/brownian/sphere/log.11May2021.in2d.sphere.g++.4 new file mode 100644 index 0000000000..95602a809c --- /dev/null +++ b/examples/USER/brownian/sphere/log.11May2021.in2d.sphere.g++.4 @@ -0,0 +1,126 @@ +LAMMPS (8 Apr 2021) + using 1 OpenMP thread(s) per MPI task +##### overdamped dynamics of a sphere (with dipole attached to it) in 2D ##### + +variable rng string uniform +variable seed string 198098 +variable temp string 1.0 +variable gamma_t string 5.0 +variable gamma_r string 0.7 +variable params string ${rng}_${temp}_${gamma_r}_${gamma_t} +variable params string uniform_${temp}_${gamma_r}_${gamma_t} +variable params string uniform_1.0_${gamma_r}_${gamma_t} +variable params string uniform_1.0_0.7_${gamma_t} +variable params string uniform_1.0_0.7_5.0 + +units lj +atom_style hybrid dipole sphere +WARNING: Atom style hybrid defines both, per-type and per-atom masses; both must be set, but only per-atom masses will be used (src/atom_vec_hybrid.cpp:156) +dimension 2 +newton off + +lattice sq 0.4 +Lattice spacing in x,y,z = 1.5811388 1.5811388 1.5811388 +region box block -30 30 -30 30 -0.2 0.2 +create_box 1 box +Created orthogonal box = (-47.434165 -47.434165 -0.31622777) to (47.434165 47.434165 0.31622777) + 2 by 2 by 1 MPI processor grid +create_atoms 1 box +Created 3600 atoms + create_atoms CPU = 0.002 seconds +mass * 1.0 +set type * dipole/random ${seed} 1.0 +set type * dipole/random 198098 1.0 +Setting atom values ... + 3600 settings made for dipole/random +velocity all create 1.0 1 loop geom + +neighbor 1.0 bin +neigh_modify every 1 delay 1 check yes + +pair_style none + +fix 1 all brownian/sphere ${temp} ${seed} rng ${rng} gamma_r ${gamma_r} gamma_t ${gamma_t} +fix 1 all brownian/sphere 1.0 ${seed} rng ${rng} gamma_r ${gamma_r} gamma_t ${gamma_t} +fix 1 all brownian/sphere 1.0 198098 rng ${rng} gamma_r ${gamma_r} gamma_t ${gamma_t} +fix 1 all brownian/sphere 1.0 198098 rng uniform gamma_r ${gamma_r} gamma_t ${gamma_t} +fix 1 all brownian/sphere 1.0 198098 rng uniform gamma_r 0.7 gamma_t ${gamma_t} +fix 1 all brownian/sphere 1.0 198098 rng uniform gamma_r 0.7 gamma_t 5.0 + +#initialisation for the main run + +# MSD +compute msd all msd + +thermo_style custom step ke pe c_msd[*] + +#dump 1 all custom 1000 dump_${params}_2d.lammpstrj id type # x y z xu yu zu mux muy muz fx fy fz +#dump_modify 1 first yes sort id + +timestep 0.00001 +thermo 100 + +# main run +run 3000 +WARNING: No pairwise cutoff or binsize set. Atom sorting therefore disabled. (src/atom.cpp:2141) +WARNING: Communication cutoff is 0.0. No ghost atoms will be generated. Atoms may get lost. (src/comm_brick.cpp:167) +Per MPI rank memory allocation (min/avg/max) = 4.664 | 4.664 | 4.664 Mbytes +Step KinEng PotEng c_msd[1] c_msd[2] c_msd[3] c_msd[4] + 0 0.99972222 0 0 0 0 0 + 100 21085.797 0 0.00042014118 0.00040399828 0 0.00082413946 + 200 20598.717 0 0.00081715618 0.00082613236 0 0.0016432885 + 300 21040.226 0 0.0012412527 0.0012520475 0 0.0024933002 + 400 21289.734 0 0.0016129899 0.001634482 0 0.003247472 + 500 20951.595 0 0.0020104279 0.0020197694 0 0.0040301973 + 600 20984.974 0 0.0023965593 0.0024277086 0 0.0048242679 + 700 21252.602 0 0.0028349303 0.0028407812 0 0.0056757114 + 800 20951.95 0 0.0032674595 0.0032573476 0 0.0065248071 + 900 20828.611 0 0.003647953 0.0036650963 0 0.0073130493 + 1000 21073.256 0 0.0040238604 0.0040103537 0 0.0080342142 + 1100 21104.396 0 0.0043694059 0.0044146515 0 0.0087840574 + 1200 20580.591 0 0.0047638237 0.0047646659 0 0.0095284896 + 1300 20667.623 0 0.0051512568 0.0051134445 0 0.010264701 + 1400 20466.72 0 0.0055921578 0.005517863 0 0.011110021 + 1500 20842.366 0 0.0059747304 0.0059374031 0 0.011912134 + 1600 20867.02 0 0.0065493697 0.0064163066 0 0.012965676 + 1700 21021.077 0 0.0070208005 0.0068164842 0 0.013837285 + 1800 21191.183 0 0.0073708939 0.0073226521 0 0.014693546 + 1900 20792.8 0 0.0076984189 0.0077400043 0 0.015438423 + 2000 21296.326 0 0.0081882545 0.0081503672 0 0.016338622 + 2100 21085.097 0 0.008596146 0.0086041272 0 0.017200273 + 2200 20506.523 0 0.0089905439 0.0091045462 0 0.01809509 + 2300 21068.555 0 0.0094163509 0.0094703314 0 0.018886682 + 2400 21128.867 0 0.0097349212 0.0098535832 0 0.019588504 + 2500 21009.514 0 0.010218059 0.010244621 0 0.020462679 + 2600 21177.52 0 0.01060437 0.010642719 0 0.021247089 + 2700 20832.56 0 0.011052623 0.011078899 0 0.022131522 + 2800 21298.053 0 0.011439708 0.011587702 0 0.023027411 + 2900 21002.28 0 0.011863624 0.01199682 0 0.023860443 + 3000 20737.939 0 0.012229608 0.012324579 0 0.024554186 +Loop time of 0.492798 on 4 procs for 3000 steps with 3600 atoms + +Performance: 5259.763 tau/day, 6087.689 timesteps/s +96.5% CPU use with 4 MPI tasks x 1 OpenMP threads + +MPI task timing breakdown: +Section | min time | avg time | max time |%varavg| %total +--------------------------------------------------------------- +Pair | 0 | 0 | 0 | 0.0 | 0.00 +Neigh | 0 | 0 | 0 | 0.0 | 0.00 +Comm | 0.018005 | 0.021524 | 0.025207 | 2.2 | 4.37 +Output | 0.0013187 | 0.0018334 | 0.0032332 | 1.9 | 0.37 +Modify | 0.37545 | 0.38775 | 0.40664 | 1.9 | 78.68 +Other | | 0.08169 | | | 16.58 + +Nlocal: 900.000 ave 900 max 900 min +Histogram: 4 0 0 0 0 0 0 0 0 0 +Nghost: 61.0000 ave 61 max 61 min +Histogram: 4 0 0 0 0 0 0 0 0 0 +Neighs: 0.00000 ave 0 max 0 min +Histogram: 4 0 0 0 0 0 0 0 0 0 + +Total # of neighbors = 0 +Ave neighs/atom = 0.0000000 +Neighbor list builds = 0 +Dangerous builds = 0 +Total wall time: 0:00:00 diff --git a/examples/USER/brownian/sphere/log.11May2021.in3d.sphere.g++.1 b/examples/USER/brownian/sphere/log.11May2021.in3d.sphere.g++.1 new file mode 100644 index 0000000000..20048f96f1 --- /dev/null +++ b/examples/USER/brownian/sphere/log.11May2021.in3d.sphere.g++.1 @@ -0,0 +1,126 @@ +LAMMPS (8 Apr 2021) + using 1 OpenMP thread(s) per MPI task +##### overdamped dynamics of a sphere (with dipole attached to it) in 3D##### + +variable rng string uniform +variable seed string 198098 +variable temp string 1.0 +variable gamma_t string 5.0 +variable gamma_r string 0.7 +variable params string ${rng}_${temp}_${gamma_r}_${gamma_t} +variable params string uniform_${temp}_${gamma_r}_${gamma_t} +variable params string uniform_1.0_${gamma_r}_${gamma_t} +variable params string uniform_1.0_0.7_${gamma_t} +variable params string uniform_1.0_0.7_5.0 + +units lj +atom_style hybrid dipole sphere +WARNING: Atom style hybrid defines both, per-type and per-atom masses; both must be set, but only per-atom masses will be used (src/atom_vec_hybrid.cpp:156) +dimension 3 +newton off + +lattice sc 0.4 +Lattice spacing in x,y,z = 1.3572088 1.3572088 1.3572088 +region box block -8 8 -8 8 -8 8 +create_box 1 box +Created orthogonal box = (-10.857670 -10.857670 -10.857670) to (10.857670 10.857670 10.857670) + 1 by 1 by 1 MPI processor grid +create_atoms 1 box +Created 4096 atoms + create_atoms CPU = 0.005 seconds +mass * 1.0 +set type * dipole/random ${seed} 1.0 +set type * dipole/random 198098 1.0 +Setting atom values ... + 4096 settings made for dipole/random +velocity all create 1.0 1 loop geom + +neighbor 1.0 bin +neigh_modify every 1 delay 1 check yes + +pair_style none + +fix 1 all brownian/sphere ${temp} ${seed} rng ${rng} gamma_r ${gamma_r} gamma_t ${gamma_t} +fix 1 all brownian/sphere 1.0 ${seed} rng ${rng} gamma_r ${gamma_r} gamma_t ${gamma_t} +fix 1 all brownian/sphere 1.0 198098 rng ${rng} gamma_r ${gamma_r} gamma_t ${gamma_t} +fix 1 all brownian/sphere 1.0 198098 rng uniform gamma_r ${gamma_r} gamma_t ${gamma_t} +fix 1 all brownian/sphere 1.0 198098 rng uniform gamma_r 0.7 gamma_t ${gamma_t} +fix 1 all brownian/sphere 1.0 198098 rng uniform gamma_r 0.7 gamma_t 5.0 + +#initialisation for the main run + +# MSD +compute msd all msd + +thermo_style custom step ke pe c_msd[*] + +#dump 1 all custom 1000 dump_${params}_3d.lammpstrj id type # x y z xu yu zu mux muy muz fx fy fz +#dump_modify 1 first yes sort id + +timestep 0.00001 +thermo 100 + +# main run +run 3000 +WARNING: No pairwise cutoff or binsize set. Atom sorting therefore disabled. (src/atom.cpp:2141) +WARNING: Communication cutoff is 0.0. No ghost atoms will be generated. Atoms may get lost. (src/comm_brick.cpp:167) +Per MPI rank memory allocation (min/avg/max) = 4.737 | 4.737 | 4.737 Mbytes +Step KinEng PotEng c_msd[1] c_msd[2] c_msd[3] c_msd[4] + 0 1.4996338 0 0 0 0 0 + 100 32032.279 0 0.00040227568 0.00039159837 0.00040147813 0.0011953522 + 200 31673.093 0 0.00077657885 0.00077292327 0.00079963705 0.0023491392 + 300 31476.164 0 0.0011712083 0.0011606723 0.0012089537 0.0035408343 + 400 31911.374 0 0.0015803424 0.001562091 0.0016042321 0.0047466655 + 500 31182.011 0 0.0019677217 0.0019269105 0.0020015977 0.0058962298 + 600 31206.05 0 0.0023360975 0.0023134398 0.0024213372 0.0070708745 + 700 31278.057 0 0.0026966955 0.0027129858 0.0028721373 0.0082818187 + 800 31677.724 0 0.0031197964 0.003134834 0.0032726303 0.0095272607 + 900 31312.741 0 0.0035636612 0.0035573653 0.0037328373 0.010853864 + 1000 31426.075 0 0.0039774626 0.003952159 0.0041879386 0.01211756 + 1100 31361.699 0 0.0044256852 0.004320566 0.004638132 0.013384383 + 1200 31559.778 0 0.0048338539 0.0047210601 0.0050296056 0.01458452 + 1300 31716.797 0 0.0052239651 0.0050796723 0.0054794684 0.015783106 + 1400 31231.077 0 0.0055890568 0.005472377 0.0059264123 0.016987846 + 1500 31605.513 0 0.0059876582 0.0058974054 0.0063452478 0.018230311 + 1600 31551.402 0 0.006413094 0.0062665632 0.0067442106 0.019423868 + 1700 31725.868 0 0.0068244611 0.0067189707 0.0071424779 0.02068591 + 1800 31385.794 0 0.0071570297 0.0070502303 0.0075240296 0.02173129 + 1900 31754.094 0 0.0075638662 0.0074243015 0.0079935325 0.0229817 + 2000 31668.959 0 0.0080059944 0.0079019753 0.0084000614 0.024308031 + 2100 31781.994 0 0.0084108141 0.0082719077 0.0088004977 0.02548322 + 2200 31455.021 0 0.0088844434 0.0086931769 0.0091916929 0.026769313 + 2300 31273.079 0 0.0093155639 0.0091027782 0.0095364621 0.027954804 + 2400 31283.781 0 0.0098441686 0.0094496218 0.0099279073 0.029221698 + 2500 31758.315 0 0.010372129 0.0097843406 0.010334653 0.030491123 + 2600 31780.442 0 0.010770862 0.010313119 0.010637545 0.031721525 + 2700 31552.277 0 0.011268703 0.010693437 0.01110762 0.033069759 + 2800 31124.693 0 0.011661333 0.011100115 0.011480624 0.034242072 + 2900 31438.795 0 0.012068847 0.011346633 0.011842006 0.035257486 + 3000 31574.258 0 0.012482632 0.011691477 0.012210207 0.036384317 +Loop time of 2.8531 on 1 procs for 3000 steps with 4096 atoms + +Performance: 908.486 tau/day, 1051.488 timesteps/s +99.9% CPU use with 1 MPI tasks x 1 OpenMP threads + +MPI task timing breakdown: +Section | min time | avg time | max time |%varavg| %total +--------------------------------------------------------------- +Pair | 0 | 0 | 0 | 0.0 | 0.00 +Neigh | 3.2425e-05 | 3.2425e-05 | 3.2425e-05 | 0.0 | 0.00 +Comm | 0.13219 | 0.13219 | 0.13219 | 0.0 | 4.63 +Output | 0.0045686 | 0.0045686 | 0.0045686 | 0.0 | 0.16 +Modify | 2.5857 | 2.5857 | 2.5857 | 0.0 | 90.63 +Other | | 0.1307 | | | 4.58 + +Nlocal: 4096.00 ave 4096 max 4096 min +Histogram: 1 0 0 0 0 0 0 0 0 0 +Nghost: 0.00000 ave 0 max 0 min +Histogram: 1 0 0 0 0 0 0 0 0 0 +Neighs: 0.00000 ave 0 max 0 min +Histogram: 1 0 0 0 0 0 0 0 0 0 + +Total # of neighbors = 0 +Ave neighs/atom = 0.0000000 +Neighbor list builds = 1 +Dangerous builds = 0 +Total wall time: 0:00:02 diff --git a/examples/USER/brownian/sphere/log.11May2021.in3d.sphere.g++.4 b/examples/USER/brownian/sphere/log.11May2021.in3d.sphere.g++.4 new file mode 100644 index 0000000000..57dc6d5f11 --- /dev/null +++ b/examples/USER/brownian/sphere/log.11May2021.in3d.sphere.g++.4 @@ -0,0 +1,126 @@ +LAMMPS (8 Apr 2021) + using 1 OpenMP thread(s) per MPI task +##### overdamped dynamics of a sphere (with dipole attached to it) in 3D##### + +variable rng string uniform +variable seed string 198098 +variable temp string 1.0 +variable gamma_t string 5.0 +variable gamma_r string 0.7 +variable params string ${rng}_${temp}_${gamma_r}_${gamma_t} +variable params string uniform_${temp}_${gamma_r}_${gamma_t} +variable params string uniform_1.0_${gamma_r}_${gamma_t} +variable params string uniform_1.0_0.7_${gamma_t} +variable params string uniform_1.0_0.7_5.0 + +units lj +atom_style hybrid dipole sphere +WARNING: Atom style hybrid defines both, per-type and per-atom masses; both must be set, but only per-atom masses will be used (src/atom_vec_hybrid.cpp:156) +dimension 3 +newton off + +lattice sc 0.4 +Lattice spacing in x,y,z = 1.3572088 1.3572088 1.3572088 +region box block -8 8 -8 8 -8 8 +create_box 1 box +Created orthogonal box = (-10.857670 -10.857670 -10.857670) to (10.857670 10.857670 10.857670) + 2 by 1 by 2 MPI processor grid +create_atoms 1 box +Created 4096 atoms + create_atoms CPU = 0.006 seconds +mass * 1.0 +set type * dipole/random ${seed} 1.0 +set type * dipole/random 198098 1.0 +Setting atom values ... + 4096 settings made for dipole/random +velocity all create 1.0 1 loop geom + +neighbor 1.0 bin +neigh_modify every 1 delay 1 check yes + +pair_style none + +fix 1 all brownian/sphere ${temp} ${seed} rng ${rng} gamma_r ${gamma_r} gamma_t ${gamma_t} +fix 1 all brownian/sphere 1.0 ${seed} rng ${rng} gamma_r ${gamma_r} gamma_t ${gamma_t} +fix 1 all brownian/sphere 1.0 198098 rng ${rng} gamma_r ${gamma_r} gamma_t ${gamma_t} +fix 1 all brownian/sphere 1.0 198098 rng uniform gamma_r ${gamma_r} gamma_t ${gamma_t} +fix 1 all brownian/sphere 1.0 198098 rng uniform gamma_r 0.7 gamma_t ${gamma_t} +fix 1 all brownian/sphere 1.0 198098 rng uniform gamma_r 0.7 gamma_t 5.0 + +#initialisation for the main run + +# MSD +compute msd all msd + +thermo_style custom step ke pe c_msd[*] + +#dump 1 all custom 1000 dump_${params}_3d.lammpstrj id type # x y z xu yu zu mux muy muz fx fy fz +#dump_modify 1 first yes sort id + +timestep 0.00001 +thermo 100 + +# main run +run 3000 +WARNING: No pairwise cutoff or binsize set. Atom sorting therefore disabled. (src/atom.cpp:2141) +WARNING: Communication cutoff is 0.0. No ghost atoms will be generated. Atoms may get lost. (src/comm_brick.cpp:167) +Per MPI rank memory allocation (min/avg/max) = 4.694 | 4.694 | 4.694 Mbytes +Step KinEng PotEng c_msd[1] c_msd[2] c_msd[3] c_msd[4] + 0 1.4996338 0 0 0 0 0 + 100 30882.707 0 0.00040787161 0.00039391576 0.00040796913 0.0012097565 + 200 31370.751 0 0.00081742036 0.00078240455 0.0008195167 0.0024193416 + 300 31469.51 0 0.0012118299 0.0011819412 0.0012477119 0.003641483 + 400 31696.58 0 0.0015540547 0.0015849689 0.0015836091 0.0047226327 + 500 31488.269 0 0.0019638041 0.0019659637 0.0020547832 0.005984551 + 600 30942.589 0 0.0023273784 0.0023572171 0.0024715245 0.00715612 + 700 31228.473 0 0.0027821732 0.002735338 0.0028734675 0.0083909787 + 800 31426.92 0 0.0031663838 0.0031092782 0.0033231014 0.0095987634 + 900 31447.595 0 0.003539588 0.003564381 0.003753036 0.010857005 + 1000 31363.911 0 0.0039854308 0.003937555 0.0041203919 0.012043378 + 1100 31522.958 0 0.0043009285 0.0043676491 0.0044799414 0.013148519 + 1200 31403.033 0 0.0046361199 0.0047513598 0.0049014974 0.014288977 + 1300 31752.182 0 0.0049824718 0.0051327113 0.0053130614 0.015428244 + 1400 31336.955 0 0.0054251445 0.0055442325 0.0057472998 0.016716677 + 1500 31224.306 0 0.0059295596 0.0059920697 0.0061375228 0.018059152 + 1600 31744.535 0 0.0063845142 0.0063600989 0.0064833215 0.019227935 + 1700 31472.081 0 0.0068360092 0.0067985824 0.0069464303 0.020581022 + 1800 31577.334 0 0.0073001079 0.0071355564 0.0073400543 0.021775719 + 1900 31521.234 0 0.0077178677 0.0074371106 0.007708008 0.022862986 + 2000 31045.148 0 0.0080515968 0.0078583776 0.0081000219 0.024009996 + 2100 31289.809 0 0.0084280175 0.0082322226 0.0084475904 0.02510783 + 2200 31505.455 0 0.008802925 0.0085708943 0.0087648194 0.026138639 + 2300 31882.722 0 0.0092223105 0.0089242925 0.0092643028 0.027410906 + 2400 31028.15 0 0.0095737559 0.0093585981 0.0096771837 0.028609538 + 2500 31581.041 0 0.0099316284 0.009785264 0.010100235 0.029817127 + 2600 31272.119 0 0.010332986 0.01007291 0.010474606 0.030880502 + 2700 31537.8 0 0.010751592 0.010565273 0.01093107 0.032247935 + 2800 31060.697 0 0.011156729 0.011010751 0.011260025 0.033427506 + 2900 31541.612 0 0.011542003 0.011499419 0.011642873 0.034684295 + 3000 31305.382 0 0.011876832 0.011866445 0.012052577 0.035795854 +Loop time of 1.00142 on 4 procs for 3000 steps with 4096 atoms + +Performance: 2588.329 tau/day, 2995.751 timesteps/s +95.2% CPU use with 4 MPI tasks x 1 OpenMP threads + +MPI task timing breakdown: +Section | min time | avg time | max time |%varavg| %total +--------------------------------------------------------------- +Pair | 0 | 0 | 0 | 0.0 | 0.00 +Neigh | 0 | 0 | 0 | 0.0 | 0.00 +Comm | 0.084416 | 0.10685 | 0.12695 | 5.7 | 10.67 +Output | 0.001471 | 0.0019466 | 0.0033245 | 1.8 | 0.19 +Modify | 0.66585 | 0.70645 | 0.78995 | 6.0 | 70.54 +Other | | 0.1862 | | | 18.59 + +Nlocal: 1024.00 ave 1024 max 1024 min +Histogram: 4 0 0 0 0 0 0 0 0 0 +Nghost: 353.000 ave 353 max 353 min +Histogram: 4 0 0 0 0 0 0 0 0 0 +Neighs: 0.00000 ave 0 max 0 min +Histogram: 4 0 0 0 0 0 0 0 0 0 + +Total # of neighbors = 0 +Ave neighs/atom = 0.0000000 +Neighbor list builds = 0 +Dangerous builds = 0 +Total wall time: 0:00:01 diff --git a/examples/USER/brownian/spherical_ABP/in2d.abp b/examples/USER/brownian/spherical_ABP/in2d.abp index 7c53717038..bd7dce13b6 100644 --- a/examples/USER/brownian/spherical_ABP/in2d.abp +++ b/examples/USER/brownian/spherical_ABP/in2d.abp @@ -1,22 +1,18 @@ # 2D overdamped active brownian particle dynamics (ABP) # with WCA potential -variable gamma_t string 1.0 -variable gamma_r string 1.0 -variable temp string 1.0 -variable seed equal 1974019 -variable fp string 4.0 +variable gamma_t string 1.0 +variable gamma_r string 1.0 +variable temp string 1.0 +variable seed equal 1974019 +variable fp string 4.0 +variable params string ${temp}_${gamma_t}_${gamma_r}_${fp} -variable params string ${temp}_${gamma_t}_${gamma_r}_${fp} - - -log log_WCA_${params}_2d.lammps.log units lj -atom_style hybrid dipole sphere +atom_style hybrid dipole sphere dimension 2 newton off - lattice sq 0.4 region box block -16 16 -16 16 -0.2 0.2 create_box 1 box @@ -29,41 +25,36 @@ velocity all create 1.0 1 loop geom neighbor 1.0 bin neigh_modify every 1 delay 1 check yes - # WCA potential (purely repulsive) pair_style lj/cut 2.5 pair_coeff * * 1.0 1.0 1.1224 pair_modify shift yes - - # overdamped brownian dynamics time-step fix step all brownian/sphere ${temp} ${seed} gamma_t ${gamma_t} gamma_r ${gamma_r} # self-propulsion force along the dipole direction -fix activity all propel/self dipole ${fp} -fix 2 all enforce2d - +fix activity all propel/self dipole ${fp} +fix 2 all enforce2d compute press all pressure NULL virial -thermo_style custom step temp epair c_press +thermo_style custom step pe ke c_press #equilibration timestep 0.0000000001 -thermo 50001 -run 50000 +thermo 100 +run 5000 reset_timestep 0 -# MSD +# MSD compute msd all msd - thermo_style custom step temp epair c_msd[*] c_press timestep 0.00001 -thermo 10000 +thermo 1000 # main run -run 200000 +run 20000 diff --git a/examples/USER/brownian/spherical_ABP/in3d.ideal_abp b/examples/USER/brownian/spherical_ABP/in3d.ideal_abp index dfe782525c..6a6575b510 100644 --- a/examples/USER/brownian/spherical_ABP/in3d.ideal_abp +++ b/examples/USER/brownian/spherical_ABP/in3d.ideal_abp @@ -1,21 +1,17 @@ # 3D overdamped active brownian dynamics with no interactions -variable gamma_t string 3.0 -variable gamma_r string 1.0 -variable temp string 1.0 -variable seed equal 1974019 -variable fp string 4.0 +variable gamma_t string 3.0 +variable gamma_r string 1.0 +variable temp string 1.0 +variable seed equal 1974019 +variable fp string 4.0 +variable params string ${temp}_${gamma_t}_${gamma_r}_${fp} -variable params string ${temp}_${gamma_t}_${gamma_r}_${fp} - - -log log_ideal_${params}_3d.lammps.log units lj -atom_style hybrid dipole sphere +atom_style hybrid dipole sphere dimension 3 newton off - lattice sc 0.4 region box block -8 8 -8 8 -8 8 create_box 1 box @@ -29,20 +25,18 @@ pair_style none # overdamped brownian dynamics time-step fix step all brownian/sphere ${temp} ${seed} gamma_t ${gamma_t} gamma_r ${gamma_r} # self-propulsion force along the dipole direction -fix activity all propel/self dipole ${fp} - +fix activity all propel/self dipole ${fp} compute press all pressure NULL virial -thermo_style custom step temp epair c_press +thermo_style custom step ke pe c_press #equilibration timestep 0.0000000001 -thermo 50001 -run 50000 +thermo 100 +run 5000 reset_timestep 0 - # MSD to demonstrate expected diffusive behaviour for ideal active # brownian motion, which is # @@ -52,15 +46,14 @@ reset_timestep 0 # with d being simulation dimension compute msd all msd - -thermo_style custom step temp epair c_msd[*] c_press +thermo_style custom step ke pe c_msd[*] c_press timestep 0.00001 -thermo 10000 +thermo 1000 # main run -run 120000 +run 12000 # if you want to check that rotational diffusion is behaving as expected, # uncomment next three lines for dump output and then plot , @@ -68,7 +61,7 @@ run 120000 # being simulation dimension) #dump 1 all custom 2000 dump_ideal_${params}_3d.lammpstrj id type & -# x y xu yu mux muy muz fx fy fz +# x y xu yu mux muy muz fx fy fz #dump_modify 1 first yes sort id -#run 120000 \ No newline at end of file +#run 120000 diff --git a/examples/USER/brownian/spherical_ABP/log.11May2021.in2d.apb.g++.1 b/examples/USER/brownian/spherical_ABP/log.11May2021.in2d.apb.g++.1 new file mode 100644 index 0000000000..452d8a3d52 --- /dev/null +++ b/examples/USER/brownian/spherical_ABP/log.11May2021.in2d.apb.g++.1 @@ -0,0 +1,221 @@ +LAMMPS (8 Apr 2021) + using 1 OpenMP thread(s) per MPI task +# 2D overdamped active brownian particle dynamics (ABP) +# with WCA potential + +variable gamma_t string 1.0 +variable gamma_r string 1.0 +variable temp string 1.0 +variable seed equal 1974019 +variable fp string 4.0 +variable params string ${temp}_${gamma_t}_${gamma_r}_${fp} +variable params string 1.0_${gamma_t}_${gamma_r}_${fp} +variable params string 1.0_1.0_${gamma_r}_${fp} +variable params string 1.0_1.0_1.0_${fp} +variable params string 1.0_1.0_1.0_4.0 + +units lj +atom_style hybrid dipole sphere +WARNING: Atom style hybrid defines both, per-type and per-atom masses; both must be set, but only per-atom masses will be used (src/atom_vec_hybrid.cpp:156) +dimension 2 +newton off + +lattice sq 0.4 +Lattice spacing in x,y,z = 1.5811388 1.5811388 1.5811388 +region box block -16 16 -16 16 -0.2 0.2 +create_box 1 box +Created orthogonal box = (-25.298221 -25.298221 -0.31622777) to (25.298221 25.298221 0.31622777) + 1 by 1 by 1 MPI processor grid +create_atoms 1 box +Created 1024 atoms + create_atoms CPU = 0.002 seconds +mass * 1.0 +set type * dipole/random ${seed} 1.0 +set type * dipole/random 1974019 1.0 +Setting atom values ... + 1024 settings made for dipole/random +velocity all create 1.0 1 loop geom + +# more careful with neighbors since higher diffusion in abps +neighbor 1.0 bin +neigh_modify every 1 delay 1 check yes + +# WCA potential (purely repulsive) +pair_style lj/cut 2.5 +pair_coeff * * 1.0 1.0 1.1224 +pair_modify shift yes + +# overdamped brownian dynamics time-step +fix step all brownian/sphere ${temp} ${seed} gamma_t ${gamma_t} gamma_r ${gamma_r} +fix step all brownian/sphere 1.0 ${seed} gamma_t ${gamma_t} gamma_r ${gamma_r} +fix step all brownian/sphere 1.0 1974019 gamma_t ${gamma_t} gamma_r ${gamma_r} +fix step all brownian/sphere 1.0 1974019 gamma_t 1.0 gamma_r ${gamma_r} +fix step all brownian/sphere 1.0 1974019 gamma_t 1.0 gamma_r 1.0 +# self-propulsion force along the dipole direction +fix activity all propel/self dipole ${fp} +fix activity all propel/self dipole 4.0 +fix 2 all enforce2d + +compute press all pressure NULL virial + +thermo_style custom step pe ke c_press + +#equilibration +timestep 0.0000000001 +thermo 100 +run 5000 +Neighbor list info ... + update every 1 steps, delay 1 steps, check yes + max neighbors/atom: 2000, page size: 100000 + master list distance cutoff = 2.1224 + ghost atom cutoff = 2.1224 + binsize = 1.0612, bins = 48 48 1 + 1 neighbor lists, perpetual/occasional/extra = 1 0 0 + (1) pair lj/cut, perpetual + attributes: half, newton off + pair build: half/bin/newtoff + stencil: half/bin/2d/newtoff + bin: standard +Per MPI rank memory allocation (min/avg/max) = 5.066 | 5.066 | 5.066 Mbytes +Step PotEng KinEng c_press + 0 0 0.99902344 -0.53979198 + 100 0 1.026585e+10 -0.5398101 + 200 0 1.0630628e+10 -0.53977393 + 300 0 1.03483e+10 -0.53977041 + 400 0 1.049279e+10 -0.53974314 + 500 0 1.0832067e+10 -0.53979451 + 600 0 1.0403632e+10 -0.53976233 + 700 0 1.0334726e+10 -0.53976174 + 800 0 1.0119596e+10 -0.53969338 + 900 0 1.0786136e+10 -0.53970415 + 1000 0 1.0539036e+10 -0.53974577 + 1100 0 1.0643695e+10 -0.53982431 + 1200 0 1.0234642e+10 -0.53976823 + 1300 0 1.036268e+10 -0.53981454 + 1400 0 1.0605702e+10 -0.53988117 + 1500 0 1.0517916e+10 -0.53989207 + 1600 0 1.0564482e+10 -0.53993016 + 1700 0 1.0460152e+10 -0.53984454 + 1800 0 1.0468566e+10 -0.53985574 + 1900 0 1.0474075e+10 -0.53985439 + 2000 0 1.0683568e+10 -0.53987349 + 2100 0 1.0269077e+10 -0.53990709 + 2200 0 1.0386943e+10 -0.53990068 + 2300 0 1.0406078e+10 -0.53978402 + 2400 0 1.0482072e+10 -0.53980757 + 2500 0 1.0442975e+10 -0.53982657 + 2600 0 1.0292103e+10 -0.53985533 + 2700 0 1.1106453e+10 -0.53991861 + 2800 0 1.0395289e+10 -0.53990138 + 2900 0 1.034021e+10 -0.53992375 + 3000 0 1.0434718e+10 -0.53995566 + 3100 0 1.0194094e+10 -0.53993997 + 3200 0 1.0411552e+10 -0.54000097 + 3300 0 1.0214175e+10 -0.53999884 + 3400 0 1.0434719e+10 -0.54000005 + 3500 0 1.0529638e+10 -0.53998281 + 3600 0 1.0406541e+10 -0.54000141 + 3700 0 1.0577151e+10 -0.54002354 + 3800 0 1.0488249e+10 -0.53996003 + 3900 0 1.0316153e+10 -0.54002024 + 4000 0 1.0491289e+10 -0.5400259 + 4100 0 1.0587981e+10 -0.5399811 + 4200 0 1.0332035e+10 -0.53997951 + 4300 0 1.0776469e+10 -0.53994151 + 4400 0 1.0982142e+10 -0.53983842 + 4500 0 1.0796919e+10 -0.5398414 + 4600 0 1.0324249e+10 -0.53979712 + 4700 0 1.0420899e+10 -0.53981967 + 4800 0 1.0274188e+10 -0.53976759 + 4900 0 1.0411535e+10 -0.5397757 + 5000 0 1.0399215e+10 -0.53980199 +Loop time of 1.34285 on 1 procs for 5000 steps with 1024 atoms + +Performance: 0.032 tau/day, 3723.422 timesteps/s +99.8% CPU use with 1 MPI tasks x 1 OpenMP threads + +MPI task timing breakdown: +Section | min time | avg time | max time |%varavg| %total +--------------------------------------------------------------- +Pair | 0.25309 | 0.25309 | 0.25309 | 0.0 | 18.85 +Neigh | 0 | 0 | 0 | 0.0 | 0.00 +Comm | 0.068734 | 0.068734 | 0.068734 | 0.0 | 5.12 +Output | 0.0012887 | 0.0012887 | 0.0012887 | 0.0 | 0.10 +Modify | 0.96552 | 0.96552 | 0.96552 | 0.0 | 71.90 +Other | | 0.05422 | | | 4.04 + +Nlocal: 1024.00 ave 1024 max 1024 min +Histogram: 1 0 0 0 0 0 0 0 0 0 +Nghost: 201.000 ave 201 max 201 min +Histogram: 1 0 0 0 0 0 0 0 0 0 +Neighs: 2112.00 ave 2112 max 2112 min +Histogram: 1 0 0 0 0 0 0 0 0 0 + +Total # of neighbors = 2112 +Ave neighs/atom = 2.0625000 +Neighbor list builds = 0 +Dangerous builds = 0 +reset_timestep 0 + + +# MSD +compute msd all msd + +thermo_style custom step temp epair c_msd[*] c_press + + +timestep 0.00001 +thermo 1000 + +# main run +run 20000 +Per MPI rank memory allocation (min/avg/max) = 5.441 | 5.441 | 5.441 Mbytes +Step Temp E_pair c_msd[1] c_msd[2] c_msd[3] c_msd[4] c_press + 0 1.0409381e+10 0 0 0 0 0 -0.53980199 + 1000 107022.73 0.0080050427 0.020451432 0.021388798 0 0.04184023 -0.54900967 + 2000 107475.82 0.017262846 0.040669645 0.044251149 0 0.084920794 -0.42740968 + 3000 105388.35 0.042257875 0.062828995 0.05845782 0 0.12128682 -0.31792184 + 4000 106238.38 0.052733384 0.079036841 0.079396453 0 0.15843329 -0.24243699 + 5000 102904.54 0.088524456 0.095977642 0.099533961 0 0.1955116 -0.093468615 + 6000 105274.15 0.065334999 0.11591691 0.11675531 0 0.23267222 -0.21904478 + 7000 108903.41 0.06724271 0.13694218 0.13914947 0 0.27609164 -0.15913012 + 8000 101451.44 0.097201152 0.15704893 0.16178845 0 0.31883738 -0.055786965 + 9000 106808.72 0.084301668 0.18029391 0.175753 0 0.3560469 0.014898739 + 10000 107381.19 0.088583354 0.2000753 0.19569789 0 0.39577319 0.19417596 + 11000 102105.78 0.081066654 0.22042599 0.21914042 0 0.43956641 0.060574143 + 12000 105384.94 0.098716908 0.24382064 0.24673594 0 0.49055657 0.17067875 + 13000 107479.53 0.099989043 0.26942088 0.27207566 0 0.54149654 0.25514896 + 14000 102938.12 0.093252916 0.28529564 0.28698837 0 0.57228401 0.19976355 + 15000 104408.02 0.11900926 0.31291315 0.31195058 0 0.62486373 0.36956014 + 16000 103447.68 0.09627777 0.34145225 0.33159885 0 0.6730511 0.29857404 + 17000 108400.05 0.11433561 0.36561966 0.36068301 0 0.72630267 0.41922801 + 18000 103363.68 0.11040153 0.38709746 0.39228677 0 0.77938423 0.38111686 + 19000 103310.43 0.10660536 0.41406235 0.40975085 0 0.8238132 0.36022184 + 20000 102692.1 0.13517651 0.43870812 0.44138776 0 0.88009588 0.51144366 +Loop time of 5.66207 on 1 procs for 20000 steps with 1024 atoms + +Performance: 3051.889 tau/day, 3532.279 timesteps/s +99.9% CPU use with 1 MPI tasks x 1 OpenMP threads + +MPI task timing breakdown: +Section | min time | avg time | max time |%varavg| %total +--------------------------------------------------------------- +Pair | 1.3123 | 1.3123 | 1.3123 | 0.0 | 23.18 +Neigh | 0.011856 | 0.011856 | 0.011856 | 0.0 | 0.21 +Comm | 0.2747 | 0.2747 | 0.2747 | 0.0 | 4.85 +Output | 0.0011516 | 0.0011516 | 0.0011516 | 0.0 | 0.02 +Modify | 3.8451 | 3.8451 | 3.8451 | 0.0 | 67.91 +Other | | 0.2169 | | | 3.83 + +Nlocal: 1024.00 ave 1024 max 1024 min +Histogram: 1 0 0 0 0 0 0 0 0 0 +Nghost: 184.000 ave 184 max 184 min +Histogram: 1 0 0 0 0 0 0 0 0 0 +Neighs: 2558.00 ave 2558 max 2558 min +Histogram: 1 0 0 0 0 0 0 0 0 0 + +Total # of neighbors = 2558 +Ave neighs/atom = 2.4980469 +Neighbor list builds = 23 +Dangerous builds = 0 +Total wall time: 0:00:07 diff --git a/examples/USER/brownian/spherical_ABP/log.11May2021.in2d.apb.g++.4 b/examples/USER/brownian/spherical_ABP/log.11May2021.in2d.apb.g++.4 new file mode 100644 index 0000000000..aa902fbe80 --- /dev/null +++ b/examples/USER/brownian/spherical_ABP/log.11May2021.in2d.apb.g++.4 @@ -0,0 +1,221 @@ +LAMMPS (8 Apr 2021) + using 1 OpenMP thread(s) per MPI task +# 2D overdamped active brownian particle dynamics (ABP) +# with WCA potential + +variable gamma_t string 1.0 +variable gamma_r string 1.0 +variable temp string 1.0 +variable seed equal 1974019 +variable fp string 4.0 +variable params string ${temp}_${gamma_t}_${gamma_r}_${fp} +variable params string 1.0_${gamma_t}_${gamma_r}_${fp} +variable params string 1.0_1.0_${gamma_r}_${fp} +variable params string 1.0_1.0_1.0_${fp} +variable params string 1.0_1.0_1.0_4.0 + +units lj +atom_style hybrid dipole sphere +WARNING: Atom style hybrid defines both, per-type and per-atom masses; both must be set, but only per-atom masses will be used (src/atom_vec_hybrid.cpp:156) +dimension 2 +newton off + +lattice sq 0.4 +Lattice spacing in x,y,z = 1.5811388 1.5811388 1.5811388 +region box block -16 16 -16 16 -0.2 0.2 +create_box 1 box +Created orthogonal box = (-25.298221 -25.298221 -0.31622777) to (25.298221 25.298221 0.31622777) + 2 by 2 by 1 MPI processor grid +create_atoms 1 box +Created 1024 atoms + create_atoms CPU = 0.001 seconds +mass * 1.0 +set type * dipole/random ${seed} 1.0 +set type * dipole/random 1974019 1.0 +Setting atom values ... + 1024 settings made for dipole/random +velocity all create 1.0 1 loop geom + +# more careful with neighbors since higher diffusion in abps +neighbor 1.0 bin +neigh_modify every 1 delay 1 check yes + +# WCA potential (purely repulsive) +pair_style lj/cut 2.5 +pair_coeff * * 1.0 1.0 1.1224 +pair_modify shift yes + +# overdamped brownian dynamics time-step +fix step all brownian/sphere ${temp} ${seed} gamma_t ${gamma_t} gamma_r ${gamma_r} +fix step all brownian/sphere 1.0 ${seed} gamma_t ${gamma_t} gamma_r ${gamma_r} +fix step all brownian/sphere 1.0 1974019 gamma_t ${gamma_t} gamma_r ${gamma_r} +fix step all brownian/sphere 1.0 1974019 gamma_t 1.0 gamma_r ${gamma_r} +fix step all brownian/sphere 1.0 1974019 gamma_t 1.0 gamma_r 1.0 +# self-propulsion force along the dipole direction +fix activity all propel/self dipole ${fp} +fix activity all propel/self dipole 4.0 +fix 2 all enforce2d + +compute press all pressure NULL virial + +thermo_style custom step pe ke c_press + +#equilibration +timestep 0.0000000001 +thermo 100 +run 5000 +Neighbor list info ... + update every 1 steps, delay 1 steps, check yes + max neighbors/atom: 2000, page size: 100000 + master list distance cutoff = 2.1224 + ghost atom cutoff = 2.1224 + binsize = 1.0612, bins = 48 48 1 + 1 neighbor lists, perpetual/occasional/extra = 1 0 0 + (1) pair lj/cut, perpetual + attributes: half, newton off + pair build: half/bin/newtoff + stencil: half/bin/2d/newtoff + bin: standard +Per MPI rank memory allocation (min/avg/max) = 5.052 | 5.052 | 5.052 Mbytes +Step PotEng KinEng c_press + 0 0 0.99902344 -0.53979198 + 100 0 1.0503521e+10 -0.53983092 + 200 0 1.0390343e+10 -0.5398287 + 300 0 1.0493441e+10 -0.53979247 + 400 0 1.0545991e+10 -0.53978678 + 500 0 1.0266398e+10 -0.53986297 + 600 0 1.0484775e+10 -0.53978746 + 700 0 1.0583596e+10 -0.53969114 + 800 0 1.0521919e+10 -0.53968754 + 900 0 1.0492019e+10 -0.53958643 + 1000 0 1.0298052e+10 -0.53949872 + 1100 0 1.0531424e+10 -0.53955431 + 1200 0 1.0635635e+10 -0.53960048 + 1300 0 1.0633405e+10 -0.53966331 + 1400 0 1.0195401e+10 -0.53968849 + 1500 0 1.0593758e+10 -0.53969763 + 1600 0 1.0425238e+10 -0.53971936 + 1700 0 1.0470017e+10 -0.53981957 + 1800 0 1.0545953e+10 -0.53987747 + 1900 0 1.0425015e+10 -0.53990412 + 2000 0 1.0655092e+10 -0.5399511 + 2100 0 1.0197224e+10 -0.53988687 + 2200 0 1.0448012e+10 -0.53986066 + 2300 0 1.0355268e+10 -0.53980415 + 2400 0 1.0246979e+10 -0.53979737 + 2500 0 1.0021539e+10 -0.5397919 + 2600 0 1.0200824e+10 -0.5397575 + 2700 0 1.0721591e+10 -0.53973512 + 2800 0 1.0354562e+10 -0.5397127 + 2900 0 1.0306795e+10 -0.5396946 + 3000 0 1.0301339e+10 -0.53968642 + 3100 0 1.0435826e+10 -0.53970945 + 3200 0 1.019524e+10 -0.53969746 + 3300 0 1.0550481e+10 -0.53967977 + 3400 0 1.0283446e+10 -0.53971102 + 3500 0 1.0956695e+10 -0.53976173 + 3600 0 1.0271033e+10 -0.53983632 + 3700 0 1.0389461e+10 -0.53977293 + 3800 0 1.0680515e+10 -0.53977425 + 3900 0 1.0072183e+10 -0.53982922 + 4000 0 1.0458036e+10 -0.53980042 + 4100 0 1.0588689e+10 -0.53971405 + 4200 0 1.0068308e+10 -0.5398033 + 4300 0 1.0502064e+10 -0.53981291 + 4400 0 1.0590544e+10 -0.5398346 + 4500 0 1.0411612e+10 -0.5397916 + 4600 0 1.0518596e+10 -0.53984868 + 4700 0 1.0386105e+10 -0.53977803 + 4800 0 1.029525e+10 -0.53970882 + 4900 0 1.0519112e+10 -0.53969616 + 5000 0 1.0335841e+10 -0.53976477 +Loop time of 0.471663 on 4 procs for 5000 steps with 1024 atoms + +Performance: 0.092 tau/day, 10600.781 timesteps/s +95.8% CPU use with 4 MPI tasks x 1 OpenMP threads + +MPI task timing breakdown: +Section | min time | avg time | max time |%varavg| %total +--------------------------------------------------------------- +Pair | 0.067099 | 0.07105 | 0.077898 | 1.6 | 15.06 +Neigh | 0 | 0 | 0 | 0.0 | 0.00 +Comm | 0.0581 | 0.066084 | 0.072322 | 2.0 | 14.01 +Output | 0.0014644 | 0.002618 | 0.0037239 | 1.6 | 0.56 +Modify | 0.24817 | 0.25719 | 0.26697 | 1.3 | 54.53 +Other | | 0.07472 | | | 15.84 + +Nlocal: 256.000 ave 256 max 256 min +Histogram: 4 0 0 0 0 0 0 0 0 0 +Nghost: 105.000 ave 105 max 105 min +Histogram: 4 0 0 0 0 0 0 0 0 0 +Neighs: 544.000 ave 544 max 544 min +Histogram: 4 0 0 0 0 0 0 0 0 0 + +Total # of neighbors = 2176 +Ave neighs/atom = 2.1250000 +Neighbor list builds = 0 +Dangerous builds = 0 +reset_timestep 0 + + +# MSD +compute msd all msd + +thermo_style custom step temp epair c_msd[*] c_press + + +timestep 0.00001 +thermo 1000 + +# main run +run 20000 +Per MPI rank memory allocation (min/avg/max) = 5.427 | 5.427 | 5.427 Mbytes +Step Temp E_pair c_msd[1] c_msd[2] c_msd[3] c_msd[4] c_press + 0 1.0345945e+10 0 0 0 0 0 -0.53976477 + 1000 100114.28 0.0029703577 0.020320684 0.020950989 0 0.041271673 -0.43948247 + 2000 106825.83 0.020969054 0.039616412 0.039459167 0 0.079075578 -0.22765541 + 3000 105287.4 0.037343571 0.056828177 0.058639835 0 0.11546801 -0.11728136 + 4000 104522.23 0.052237136 0.080264931 0.080863543 0 0.16112847 0.033230576 + 5000 103277.94 0.053791862 0.099188864 0.10141444 0 0.20060331 0.073591503 + 6000 104252.87 0.073304776 0.11964238 0.1215576 0 0.24119999 0.22062305 + 7000 105184.19 0.089054043 0.13691291 0.14216478 0 0.27907769 0.29015692 + 8000 104211.82 0.072577918 0.15820522 0.15658491 0 0.31479013 0.25908291 + 9000 99242.172 0.071616004 0.17658708 0.17479704 0 0.35138412 0.26305532 + 10000 105070.83 0.077009979 0.20175025 0.19871513 0 0.40046538 0.34120567 + 11000 106421.07 0.098623061 0.22472634 0.22671582 0 0.45144216 0.44021335 + 12000 103209.85 0.12032847 0.25004966 0.25368441 0 0.50373406 0.57344873 + 13000 107156.89 0.1058386 0.27283231 0.2744873 0 0.54731961 0.47957408 + 14000 108119.3 0.1204768 0.29333677 0.30054535 0 0.59388213 0.51832639 + 15000 105477.62 0.12510026 0.32217621 0.32806599 0 0.6502422 0.50174158 + 16000 106676.27 0.10893618 0.34980866 0.36031184 0 0.7101205 0.44769198 + 17000 103048.41 0.10625673 0.3781797 0.37970499 0 0.75788468 0.42803898 + 18000 109454.8 0.10555778 0.40997694 0.41396777 0 0.82394471 0.41380982 + 19000 107459.73 0.11267582 0.43757738 0.43577856 0 0.87335594 0.4917748 + 20000 101991.9 0.084279008 0.45363612 0.46278076 0 0.91641688 0.41707912 +Loop time of 1.80877 on 4 procs for 20000 steps with 1024 atoms + +Performance: 9553.439 tau/day, 11057.221 timesteps/s +98.5% CPU use with 4 MPI tasks x 1 OpenMP threads + +MPI task timing breakdown: +Section | min time | avg time | max time |%varavg| %total +--------------------------------------------------------------- +Pair | 0.34461 | 0.36424 | 0.40948 | 4.4 | 20.14 +Neigh | 0.0031493 | 0.003215 | 0.0032432 | 0.1 | 0.18 +Comm | 0.19538 | 0.20419 | 0.2104 | 1.2 | 11.29 +Output | 0.00054121 | 0.00087297 | 0.0018425 | 0.0 | 0.05 +Modify | 0.98335 | 1.0156 | 1.0791 | 3.8 | 56.15 +Other | | 0.2207 | | | 12.20 + +Nlocal: 256.000 ave 261 max 252 min +Histogram: 1 1 0 0 0 0 1 0 0 1 +Nghost: 93.0000 ave 100 max 83 min +Histogram: 1 0 0 0 0 0 1 1 0 1 +Neighs: 662.250 ave 693 max 635 min +Histogram: 1 0 1 0 0 0 1 0 0 1 + +Total # of neighbors = 2649 +Ave neighs/atom = 2.5869141 +Neighbor list builds = 23 +Dangerous builds = 0 +Total wall time: 0:00:02 diff --git a/examples/USER/brownian/spherical_ABP/log.11May2021.in3d.ideal_apb.g++.1 b/examples/USER/brownian/spherical_ABP/log.11May2021.in3d.ideal_apb.g++.1 new file mode 100644 index 0000000000..0820471faa --- /dev/null +++ b/examples/USER/brownian/spherical_ABP/log.11May2021.in3d.ideal_apb.g++.1 @@ -0,0 +1,210 @@ +LAMMPS (8 Apr 2021) + using 1 OpenMP thread(s) per MPI task +# 3D overdamped active brownian dynamics with no interactions + +variable gamma_t string 3.0 +variable gamma_r string 1.0 +variable temp string 1.0 +variable seed equal 1974019 +variable fp string 4.0 +variable params string ${temp}_${gamma_t}_${gamma_r}_${fp} +variable params string 1.0_${gamma_t}_${gamma_r}_${fp} +variable params string 1.0_3.0_${gamma_r}_${fp} +variable params string 1.0_3.0_1.0_${fp} +variable params string 1.0_3.0_1.0_4.0 + +units lj +atom_style hybrid dipole sphere +WARNING: Atom style hybrid defines both, per-type and per-atom masses; both must be set, but only per-atom masses will be used (src/atom_vec_hybrid.cpp:156) +dimension 3 +newton off + +lattice sc 0.4 +Lattice spacing in x,y,z = 1.3572088 1.3572088 1.3572088 +region box block -8 8 -8 8 -8 8 +create_box 1 box +Created orthogonal box = (-10.857670 -10.857670 -10.857670) to (10.857670 10.857670 10.857670) + 1 by 1 by 1 MPI processor grid +create_atoms 1 box +Created 4096 atoms + create_atoms CPU = 0.004 seconds +mass * 1.0 +set type * dipole/random ${seed} 1.0 +set type * dipole/random 1974019 1.0 +Setting atom values ... + 4096 settings made for dipole/random +velocity all create 1.0 1 loop geom + +pair_style none + +# overdamped brownian dynamics time-step +fix step all brownian/sphere ${temp} ${seed} gamma_t ${gamma_t} gamma_r ${gamma_r} +fix step all brownian/sphere 1.0 ${seed} gamma_t ${gamma_t} gamma_r ${gamma_r} +fix step all brownian/sphere 1.0 1974019 gamma_t ${gamma_t} gamma_r ${gamma_r} +fix step all brownian/sphere 1.0 1974019 gamma_t 3.0 gamma_r ${gamma_r} +fix step all brownian/sphere 1.0 1974019 gamma_t 3.0 gamma_r 1.0 +# self-propulsion force along the dipole direction +fix activity all propel/self dipole ${fp} +fix activity all propel/self dipole 4.0 + +compute press all pressure NULL virial + +thermo_style custom step ke pe c_press + +#equilibration +timestep 0.0000000001 +thermo 100 +run 5000 +WARNING: No pairwise cutoff or binsize set. Atom sorting therefore disabled. (src/atom.cpp:2141) +WARNING: Communication cutoff is 0.0. No ghost atoms will be generated. Atoms may get lost. (src/comm_brick.cpp:167) +Per MPI rank memory allocation (min/avg/max) = 4.362 | 4.362 | 4.362 Mbytes +Step KinEng PotEng c_press + 0 1.4996338 0 0.068021726 + 100 5.184227e+09 0 0.06801544 + 200 5.2165482e+09 0 0.068010729 + 300 5.2782092e+09 0 0.068009058 + 400 5.3244927e+09 0 0.068003481 + 500 5.2376606e+09 0 0.067998237 + 600 5.2735634e+09 0 0.067998037 + 700 5.2692439e+09 0 0.068025402 + 800 5.2667984e+09 0 0.068030143 + 900 5.242057e+09 0 0.0680246 + 1000 5.2557468e+09 0 0.068028348 + 1100 5.2975687e+09 0 0.068029528 + 1200 5.2081927e+09 0 0.068017542 + 1300 5.2636873e+09 0 0.068012572 + 1400 5.2187907e+09 0 0.06802049 + 1500 5.2349541e+09 0 0.0680373 + 1600 5.216092e+09 0 0.068056885 + 1700 5.2598019e+09 0 0.068069504 + 1800 5.2569065e+09 0 0.068065306 + 1900 5.2072055e+09 0 0.068074863 + 2000 5.2092961e+09 0 0.068061619 + 2100 5.2918572e+09 0 0.068076418 + 2200 5.2680626e+09 0 0.068072149 + 2300 5.242958e+09 0 0.06806486 + 2400 5.2494099e+09 0 0.06805038 + 2500 5.2055798e+09 0 0.068072194 + 2600 5.2264829e+09 0 0.068069312 + 2700 5.3557342e+09 0 0.068064812 + 2800 5.2186177e+09 0 0.068042942 + 2900 5.2652497e+09 0 0.068044214 + 3000 5.1894899e+09 0 0.068044801 + 3100 5.241524e+09 0 0.068056675 + 3200 5.1915006e+09 0 0.06805641 + 3300 5.2367825e+09 0 0.068049946 + 3400 5.2288011e+09 0 0.068060182 + 3500 5.2704335e+09 0 0.068070881 + 3600 5.2886558e+09 0 0.068050439 + 3700 5.1976022e+09 0 0.068045927 + 3800 5.1525512e+09 0 0.068054494 + 3900 5.2212395e+09 0 0.068061432 + 4000 5.2309575e+09 0 0.068070842 + 4100 5.2260184e+09 0 0.068078378 + 4200 5.2829349e+09 0 0.068071652 + 4300 5.2204917e+09 0 0.068083072 + 4400 5.255242e+09 0 0.068066175 + 4500 5.2435681e+09 0 0.068050802 + 4600 5.2483356e+09 0 0.06805658 + 4700 5.2365098e+09 0 0.068041845 + 4800 5.2254325e+09 0 0.068038583 + 4900 5.1842852e+09 0 0.068028401 + 5000 5.2240722e+09 0 0.068031544 +Loop time of 5.14275 on 1 procs for 5000 steps with 4096 atoms + +Performance: 0.008 tau/day, 972.242 timesteps/s +99.9% CPU use with 1 MPI tasks x 1 OpenMP threads + +MPI task timing breakdown: +Section | min time | avg time | max time |%varavg| %total +--------------------------------------------------------------- +Pair | 0 | 0 | 0 | 0.0 | 0.00 +Neigh | 0 | 0 | 0 | 0.0 | 0.00 +Comm | 0.26842 | 0.26842 | 0.26842 | 0.0 | 5.22 +Output | 0.0035088 | 0.0035088 | 0.0035088 | 0.0 | 0.07 +Modify | 4.6588 | 4.6588 | 4.6588 | 0.0 | 90.59 +Other | | 0.212 | | | 4.12 + +Nlocal: 4096.00 ave 4096 max 4096 min +Histogram: 1 0 0 0 0 0 0 0 0 0 +Nghost: 817.000 ave 817 max 817 min +Histogram: 1 0 0 0 0 0 0 0 0 0 +Neighs: 0.00000 ave 0 max 0 min +Histogram: 1 0 0 0 0 0 0 0 0 0 + +Total # of neighbors = 0 +Ave neighs/atom = 0.0000000 +Neighbor list builds = 0 +Dangerous builds = 0 +reset_timestep 0 + +# MSD to demonstrate expected diffusive behaviour for ideal active +# brownian motion, which is +# +# MSD = (2*d*kb*T/gamma_t + 2*fp**2*gamma_r/(kb*T*gamma_t**2*(d-1)))*t +# + 2*fp**2*gamma_r**2/(gamma_t**2*(d-1)**2*(kb*T)**2)*(e^(-(d-1)*t*kb*T/gamma_r)-1) +# +# with d being simulation dimension +compute msd all msd + +thermo_style custom step ke pe c_msd[*] c_press + + +timestep 0.00001 +thermo 1000 + +# main run +run 12000 +WARNING: Communication cutoff is 0.0. No ghost atoms will be generated. Atoms may get lost. (src/comm_brick.cpp:167) +Per MPI rank memory allocation (min/avg/max) = 4.737 | 4.737 | 4.737 Mbytes +Step KinEng PotEng c_msd[1] c_msd[2] c_msd[3] c_msd[4] c_press + 0 5.2240722e+09 0 0 0 0 0 0.068031544 + 1000 52651.581 0 0.0066842466 0.0067977045 0.0066831353 0.020165086 0.060774985 + 2000 52835.806 0 0.013693443 0.014008773 0.013518945 0.041221161 0.094748037 + 3000 52097.629 0 0.020666918 0.021696789 0.020665685 0.063029392 0.10673866 + 4000 52579.452 0 0.028145318 0.028504548 0.02830967 0.084959536 0.13358122 + 5000 51255.456 0 0.035019271 0.034644123 0.03638843 0.10605182 0.13507609 + 6000 52730.035 0 0.041412307 0.042689213 0.043339117 0.12744064 0.16497663 + 7000 52247.642 0 0.048119396 0.050556395 0.050706527 0.14938232 0.16360301 + 8000 52169.849 0 0.055241196 0.058678631 0.059373122 0.17329295 0.1676169 + 9000 52520.526 0 0.063519587 0.066592779 0.066988842 0.19710121 0.17142694 + 10000 53519.297 0 0.07164814 0.074576535 0.075619236 0.22184391 0.15619444 + 11000 52937.293 0 0.077992504 0.083184462 0.082988794 0.24416576 0.15257327 + 12000 51762.283 0 0.085959749 0.090992292 0.08984213 0.26679417 0.15996211 +Loop time of 11.6748 on 1 procs for 12000 steps with 4096 atoms + +Performance: 888.063 tau/day, 1027.851 timesteps/s +99.9% CPU use with 1 MPI tasks x 1 OpenMP threads + +MPI task timing breakdown: +Section | min time | avg time | max time |%varavg| %total +--------------------------------------------------------------- +Pair | 0 | 0 | 0 | 0.0 | 0.00 +Neigh | 0.0024164 | 0.0024164 | 0.0024164 | 0.0 | 0.02 +Comm | 0.048127 | 0.048127 | 0.048127 | 0.0 | 0.41 +Output | 0.0019393 | 0.0019393 | 0.0019393 | 0.0 | 0.02 +Modify | 11.12 | 11.12 | 11.12 | 0.0 | 95.24 +Other | | 0.5027 | | | 4.31 + +Nlocal: 4096.00 ave 4096 max 4096 min +Histogram: 1 0 0 0 0 0 0 0 0 0 +Nghost: 0.00000 ave 0 max 0 min +Histogram: 1 0 0 0 0 0 0 0 0 0 +Neighs: 0.00000 ave 0 max 0 min +Histogram: 1 0 0 0 0 0 0 0 0 0 + +Total # of neighbors = 0 +Ave neighs/atom = 0.0000000 +Neighbor list builds = 75 +Dangerous builds = 0 + +# if you want to check that rotational diffusion is behaving as expected, +# uncomment next three lines for dump output and then plot , +# which should decay exponentially with timescale (d-1)*D_r (with d +# being simulation dimension) + +#dump 1 all custom 2000 dump_ideal_${params}_3d.lammpstrj id type # x y xu yu mux muy muz fx fy fz +#dump_modify 1 first yes sort id + +#run 120000 +Total wall time: 0:00:16 diff --git a/examples/USER/brownian/spherical_ABP/log.11May2021.in3d.ideal_apb.g++.4 b/examples/USER/brownian/spherical_ABP/log.11May2021.in3d.ideal_apb.g++.4 new file mode 100644 index 0000000000..c6e5b82090 --- /dev/null +++ b/examples/USER/brownian/spherical_ABP/log.11May2021.in3d.ideal_apb.g++.4 @@ -0,0 +1,210 @@ +LAMMPS (8 Apr 2021) + using 1 OpenMP thread(s) per MPI task +# 3D overdamped active brownian dynamics with no interactions + +variable gamma_t string 3.0 +variable gamma_r string 1.0 +variable temp string 1.0 +variable seed equal 1974019 +variable fp string 4.0 +variable params string ${temp}_${gamma_t}_${gamma_r}_${fp} +variable params string 1.0_${gamma_t}_${gamma_r}_${fp} +variable params string 1.0_3.0_${gamma_r}_${fp} +variable params string 1.0_3.0_1.0_${fp} +variable params string 1.0_3.0_1.0_4.0 + +units lj +atom_style hybrid dipole sphere +WARNING: Atom style hybrid defines both, per-type and per-atom masses; both must be set, but only per-atom masses will be used (src/atom_vec_hybrid.cpp:156) +dimension 3 +newton off + +lattice sc 0.4 +Lattice spacing in x,y,z = 1.3572088 1.3572088 1.3572088 +region box block -8 8 -8 8 -8 8 +create_box 1 box +Created orthogonal box = (-10.857670 -10.857670 -10.857670) to (10.857670 10.857670 10.857670) + 2 by 1 by 2 MPI processor grid +create_atoms 1 box +Created 4096 atoms + create_atoms CPU = 0.002 seconds +mass * 1.0 +set type * dipole/random ${seed} 1.0 +set type * dipole/random 1974019 1.0 +Setting atom values ... + 4096 settings made for dipole/random +velocity all create 1.0 1 loop geom + +pair_style none + +# overdamped brownian dynamics time-step +fix step all brownian/sphere ${temp} ${seed} gamma_t ${gamma_t} gamma_r ${gamma_r} +fix step all brownian/sphere 1.0 ${seed} gamma_t ${gamma_t} gamma_r ${gamma_r} +fix step all brownian/sphere 1.0 1974019 gamma_t ${gamma_t} gamma_r ${gamma_r} +fix step all brownian/sphere 1.0 1974019 gamma_t 3.0 gamma_r ${gamma_r} +fix step all brownian/sphere 1.0 1974019 gamma_t 3.0 gamma_r 1.0 +# self-propulsion force along the dipole direction +fix activity all propel/self dipole ${fp} +fix activity all propel/self dipole 4.0 + +compute press all pressure NULL virial + +thermo_style custom step ke pe c_press + +#equilibration +timestep 0.0000000001 +thermo 100 +run 5000 +WARNING: No pairwise cutoff or binsize set. Atom sorting therefore disabled. (src/atom.cpp:2141) +WARNING: Communication cutoff is 0.0. No ghost atoms will be generated. Atoms may get lost. (src/comm_brick.cpp:167) +Per MPI rank memory allocation (min/avg/max) = 4.319 | 4.319 | 4.319 Mbytes +Step KinEng PotEng c_press + 0 1.4996338 0 0.068021726 + 100 5.2484581e+09 0 0.068010768 + 200 5.277936e+09 0 0.068024039 + 300 5.2651427e+09 0 0.068014821 + 400 5.2066432e+09 0 0.068027583 + 500 5.2250276e+09 0 0.068030242 + 600 5.239771e+09 0 0.068018406 + 700 5.1953674e+09 0 0.068017081 + 800 5.2097107e+09 0 0.068010167 + 900 5.2559863e+09 0 0.068012923 + 1000 5.2743197e+09 0 0.068017855 + 1100 5.1999741e+09 0 0.068014189 + 1200 5.3216344e+09 0 0.068005604 + 1300 5.2839264e+09 0 0.067982558 + 1400 5.2462761e+09 0 0.067977843 + 1500 5.2208208e+09 0 0.067979594 + 1600 5.2740284e+09 0 0.067972573 + 1700 5.1919692e+09 0 0.067974452 + 1800 5.2497614e+09 0 0.067966417 + 1900 5.2910442e+09 0 0.067976096 + 2000 5.27238e+09 0 0.067963979 + 2100 5.3305398e+09 0 0.06795661 + 2200 5.205471e+09 0 0.067970212 + 2300 5.1803713e+09 0 0.067931775 + 2400 5.2134311e+09 0 0.067941825 + 2500 5.2367424e+09 0 0.067963456 + 2600 5.2246738e+09 0 0.067957556 + 2700 5.2514573e+09 0 0.067960724 + 2800 5.2601577e+09 0 0.067965167 + 2900 5.2422855e+09 0 0.067956561 + 3000 5.1796674e+09 0 0.067946764 + 3100 5.2308189e+09 0 0.067946585 + 3200 5.1835395e+09 0 0.067951909 + 3300 5.2762112e+09 0 0.067963199 + 3400 5.3224133e+09 0 0.067944918 + 3500 5.2314242e+09 0 0.06795318 + 3600 5.2760337e+09 0 0.067958005 + 3700 5.2549349e+09 0 0.06795228 + 3800 5.3343065e+09 0 0.067944561 + 3900 5.2440993e+09 0 0.067947433 + 4000 5.2565026e+09 0 0.067962624 + 4100 5.1766738e+09 0 0.067949542 + 4200 5.2058437e+09 0 0.067959946 + 4300 5.2777775e+09 0 0.067945883 + 4400 5.2020331e+09 0 0.067953495 + 4500 5.1417619e+09 0 0.067944161 + 4600 5.2672994e+09 0 0.067936777 + 4700 5.222847e+09 0 0.067943025 + 4800 5.2467842e+09 0 0.06794191 + 4900 5.2784378e+09 0 0.067939495 + 5000 5.2563969e+09 0 0.067940246 +Loop time of 1.55848 on 4 procs for 5000 steps with 4096 atoms + +Performance: 0.028 tau/day, 3208.260 timesteps/s +97.1% CPU use with 4 MPI tasks x 1 OpenMP threads + +MPI task timing breakdown: +Section | min time | avg time | max time |%varavg| %total +--------------------------------------------------------------- +Pair | 0 | 0 | 0 | 0.0 | 0.00 +Neigh | 0 | 0 | 0 | 0.0 | 0.00 +Comm | 0.15304 | 0.15677 | 0.16459 | 1.2 | 10.06 +Output | 0.0012078 | 0.0021182 | 0.0047011 | 3.2 | 0.14 +Modify | 1.1966 | 1.2236 | 1.2761 | 2.8 | 78.51 +Other | | 0.176 | | | 11.29 + +Nlocal: 1024.00 ave 1024 max 1024 min +Histogram: 4 0 0 0 0 0 0 0 0 0 +Nghost: 353.000 ave 353 max 353 min +Histogram: 4 0 0 0 0 0 0 0 0 0 +Neighs: 0.00000 ave 0 max 0 min +Histogram: 4 0 0 0 0 0 0 0 0 0 + +Total # of neighbors = 0 +Ave neighs/atom = 0.0000000 +Neighbor list builds = 0 +Dangerous builds = 0 +reset_timestep 0 + +# MSD to demonstrate expected diffusive behaviour for ideal active +# brownian motion, which is +# +# MSD = (2*d*kb*T/gamma_t + 2*fp**2*gamma_r/(kb*T*gamma_t**2*(d-1)))*t +# + 2*fp**2*gamma_r**2/(gamma_t**2*(d-1)**2*(kb*T)**2)*(e^(-(d-1)*t*kb*T/gamma_r)-1) +# +# with d being simulation dimension +compute msd all msd + +thermo_style custom step ke pe c_msd[*] c_press + + +timestep 0.00001 +thermo 1000 + +# main run +run 12000 +WARNING: Communication cutoff is 0.0. No ghost atoms will be generated. Atoms may get lost. (src/comm_brick.cpp:167) +Per MPI rank memory allocation (min/avg/max) = 4.694 | 4.694 | 4.694 Mbytes +Step KinEng PotEng c_msd[1] c_msd[2] c_msd[3] c_msd[4] c_press + 0 5.2563969e+09 0 0 0 0 0 0.067940246 + 1000 52568.549 0 0.0067249858 0.0066478843 0.0066014231 0.019974293 0.066777589 + 2000 52836.937 0 0.013611101 0.013799663 0.013161144 0.040571907 0.066769693 + 3000 52129.467 0 0.020360834 0.02089829 0.01995025 0.061209374 0.060026879 + 4000 52075.177 0 0.027638751 0.028062314 0.026895904 0.082596969 0.078290387 + 5000 52203.996 0 0.034087112 0.034933104 0.033832559 0.10285278 0.083657551 + 6000 52986.764 0 0.041562413 0.042238976 0.040542538 0.12434393 0.11542014 + 7000 51941.229 0 0.049216989 0.049250201 0.047598008 0.1460652 0.13739893 + 8000 52618.713 0 0.057198947 0.057409217 0.05404895 0.16865711 0.13681938 + 9000 52501.332 0 0.066447829 0.065262287 0.062271789 0.19398191 0.14306596 + 10000 52545.628 0 0.073800792 0.072510553 0.070100713 0.21641206 0.14689578 + 11000 52416.561 0 0.081881868 0.080638809 0.078969817 0.24149049 0.15608324 + 12000 52271.578 0 0.090521937 0.088555992 0.08592156 0.26499949 0.1474981 +Loop time of 3.13506 on 4 procs for 12000 steps with 4096 atoms + +Performance: 3307.113 tau/day, 3827.677 timesteps/s +99.2% CPU use with 4 MPI tasks x 1 OpenMP threads + +MPI task timing breakdown: +Section | min time | avg time | max time |%varavg| %total +--------------------------------------------------------------- +Pair | 0 | 0 | 0 | 0.0 | 0.00 +Neigh | 0.00060225 | 0.00060934 | 0.00061345 | 0.0 | 0.02 +Comm | 0.029197 | 0.029376 | 0.029582 | 0.1 | 0.94 +Output | 0.00060606 | 0.00087148 | 0.0016448 | 0.0 | 0.03 +Modify | 2.84 | 2.8773 | 2.8942 | 1.3 | 91.78 +Other | | 0.2269 | | | 7.24 + +Nlocal: 1024.00 ave 1037 max 999 min +Histogram: 1 0 0 0 0 0 0 1 1 1 +Nghost: 0.00000 ave 0 max 0 min +Histogram: 4 0 0 0 0 0 0 0 0 0 +Neighs: 0.00000 ave 0 max 0 min +Histogram: 4 0 0 0 0 0 0 0 0 0 + +Total # of neighbors = 0 +Ave neighs/atom = 0.0000000 +Neighbor list builds = 73 +Dangerous builds = 0 + +# if you want to check that rotational diffusion is behaving as expected, +# uncomment next three lines for dump output and then plot , +# which should decay exponentially with timescale (d-1)*D_r (with d +# being simulation dimension) + +#dump 1 all custom 2000 dump_ideal_${params}_3d.lammpstrj id type # x y xu yu mux muy muz fx fy fz +#dump_modify 1 first yes sort id + +#run 120000 +Total wall time: 0:00:04 diff --git a/examples/USER/brownian/spherical_ABP/log_WCA_1_1_1_3_4_2d.lammps.log b/examples/USER/brownian/spherical_ABP/log_WCA_1_1_1_3_4_2d.lammps.log deleted file mode 100644 index 8f334c77fb..0000000000 --- a/examples/USER/brownian/spherical_ABP/log_WCA_1_1_1_3_4_2d.lammps.log +++ /dev/null @@ -1,163 +0,0 @@ -units lj -atom_style hybrid dipole sphere -WARNING: Atom_style hybrid defines both pertype and peratom masses - both must be set, only peratom masses will be used (src/atom_vec_hybrid.cpp:157) -dimension 2 -newton off - - -lattice sq 0.4 -Lattice spacing in x,y,z = 1.5811388 1.5811388 1.5811388 -region box block -16 16 -16 16 -0.2 0.2 -create_box 1 box -Created orthogonal box = (-25.298221 -25.298221 -0.31622777) to (25.298221 25.298221 0.31622777) - 1 by 1 by 1 MPI processor grid -create_atoms 1 box -Created 1024 atoms - create_atoms CPU = 0.002 seconds -mass * 1.0 -set type * dipole/random ${seed} 1.0 -set type * dipole/random 1974019 1.0 -Setting atom values ... - 1024 settings made for dipole/random -velocity all create 1.0 1 loop geom - -# more careful with neighbors since higher diffusion in abps -neighbor 1.0 bin -neigh_modify every 1 delay 1 check yes - - -# WCA potential (purely repulsive) -pair_style lj/cut 2.5 -pair_coeff * * 1.0 1.0 1.1224 -pair_modify shift yes - - - -# overdamped brownian dynamics time-step -fix step all brownian/sphere ${gamma_t} ${gamma_r} ${D_t} ${D_r} ${seed} dipole -fix step all brownian/sphere 1 ${gamma_r} ${D_t} ${D_r} ${seed} dipole -fix step all brownian/sphere 1 1 ${D_t} ${D_r} ${seed} dipole -fix step all brownian/sphere 1 1 1 ${D_r} ${seed} dipole -fix step all brownian/sphere 1 1 1 3 ${seed} dipole -fix step all brownian/sphere 1 1 1 3 1974019 dipole -# self-propulsion force along the dipole direction -fix activity all propel/self dipole ${fp} -fix activity all propel/self dipole 4 -fix 2 all enforce2d - - -compute press all pressure NULL virial - -thermo_style custom step temp epair c_press - -#equilibration -timestep 0.0000000001 -thermo 50001 -run 50000 -Neighbor list info ... - update every 1 steps, delay 1 steps, check yes - max neighbors/atom: 2000, page size: 100000 - master list distance cutoff = 2.1224 - ghost atom cutoff = 2.1224 - binsize = 1.0612, bins = 48 48 1 - 1 neighbor lists, perpetual/occasional/extra = 1 0 0 - (1) pair lj/cut, perpetual - attributes: half, newton off - pair build: half/bin/newtoff - stencil: half/bin/2d/newtoff - bin: standard -Per MPI rank memory allocation (min/avg/max) = 5.066 | 5.066 | 5.066 Mbytes -Step Temp E_pair c_press - 0 1 0 -0.53979198 - 50000 1.0902879e+10 0 -0.53710405 -Loop time of 6.3887 on 1 procs for 50000 steps with 1024 atoms - -Performance: 0.068 tau/day, 7826.319 timesteps/s -100.0% CPU use with 1 MPI tasks x 1 OpenMP threads - -MPI task timing breakdown: -Section | min time | avg time | max time |%varavg| %total ---------------------------------------------------------------- -Pair | 0.34323 | 0.34323 | 0.34323 | 0.0 | 5.37 -Neigh | 0 | 0 | 0 | 0.0 | 0.00 -Comm | 0.070232 | 0.070232 | 0.070232 | 0.0 | 1.10 -Output | 2.5077e-05 | 2.5077e-05 | 2.5077e-05 | 0.0 | 0.00 -Modify | 5.8232 | 5.8232 | 5.8232 | 0.0 | 91.15 -Other | | 0.152 | | | 2.38 - -Nlocal: 1024.00 ave 1024 max 1024 min -Histogram: 1 0 0 0 0 0 0 0 0 0 -Nghost: 201.000 ave 201 max 201 min -Histogram: 1 0 0 0 0 0 0 0 0 0 -Neighs: 2112.00 ave 2112 max 2112 min -Histogram: 1 0 0 0 0 0 0 0 0 0 - -Total # of neighbors = 2112 -Ave neighs/atom = 2.0625000 -Neighbor list builds = 0 -Dangerous builds = 0 -reset_timestep 0 - - -# MSD -compute msd all msd - - -thermo_style custom step temp epair c_msd[*] c_press - - -timestep 0.00001 -thermo 10000 - -# main run -run 200000 -Per MPI rank memory allocation (min/avg/max) = 5.441 | 5.441 | 5.441 Mbytes -Step Temp E_pair c_msd[1] c_msd[2] c_msd[3] c_msd[4] c_press - 0 1.0902879e+10 0 0 0 0 0 -0.53710405 - 10000 103498.6 0.087662767 0.18719065 0.2007338 0 0.38792445 0.16080254 - 20000 104785.56 0.12719481 0.4197551 0.40722743 0 0.82698253 0.5007164 - 30000 103183.73 0.1126518 0.67800477 0.67921667 0 1.3572214 0.36634317 - 40000 102912.87 0.092584777 0.96234448 0.97188884 0 1.9342333 0.46170129 - 50000 103516.68 0.12761757 1.2381642 1.3203398 0 2.558504 0.85712805 - 60000 104999.77 0.14482924 1.5437166 1.6177103 0 3.1614269 1.1403162 - 70000 103925.7 0.11302021 1.886 1.9262949 0 3.8122949 1.1056086 - 80000 105000.14 0.14502228 2.205833 2.2668945 0 4.4727275 1.0757792 - 90000 105980.8 0.12089413 2.515801 2.647111 0 5.162912 1.1160525 - 100000 106557.86 0.10934038 2.7977098 2.8965145 0 5.6942242 0.56901933 - 110000 104241.46 0.12719985 3.1612652 3.2283956 0 6.3896608 0.95100999 - 120000 101910.56 0.12002691 3.5844099 3.5366227 0 7.1210326 1.2526653 - 130000 104435.28 0.10695039 3.8328815 3.8286503 0 7.6615318 1.6198184 - 140000 104864.99 0.11226471 4.1822059 4.285915 0 8.4681209 1.5190757 - 150000 103209.43 0.11229036 4.430069 4.5491143 0 8.9791833 1.1568204 - 160000 106692.61 0.11151476 4.7593714 5.0322819 0 9.7916533 1.2337266 - 170000 105232.19 0.12039818 5.0665907 5.3612901 0 10.427881 1.3881139 - 180000 107126.86 0.10793969 5.4129878 5.6391008 0 11.052089 1.6691607 - 190000 103814.36 0.096916503 5.7355093 5.9557837 0 11.691293 1.3863335 - 200000 103976.84 0.10928015 6.1871603 6.3393786 0 12.526539 1.1687077 -Loop time of 27.4513 on 1 procs for 200000 steps with 1024 atoms - -Performance: 6294.793 tau/day, 7285.640 timesteps/s -100.0% CPU use with 1 MPI tasks x 1 OpenMP threads - -MPI task timing breakdown: -Section | min time | avg time | max time |%varavg| %total ---------------------------------------------------------------- -Pair | 3.2525 | 3.2525 | 3.2525 | 0.0 | 11.85 -Neigh | 0.054678 | 0.054678 | 0.054678 | 0.0 | 0.20 -Comm | 0.26582 | 0.26582 | 0.26582 | 0.0 | 0.97 -Output | 0.0006103 | 0.0006103 | 0.0006103 | 0.0 | 0.00 -Modify | 23.265 | 23.265 | 23.265 | 0.0 | 84.75 -Other | | 0.6131 | | | 2.23 - -Nlocal: 1024.00 ave 1024 max 1024 min -Histogram: 1 0 0 0 0 0 0 0 0 0 -Nghost: 166.000 ave 166 max 166 min -Histogram: 1 0 0 0 0 0 0 0 0 0 -Neighs: 2634.00 ave 2634 max 2634 min -Histogram: 1 0 0 0 0 0 0 0 0 0 - -Total # of neighbors = 2634 -Ave neighs/atom = 2.5722656 -Neighbor list builds = 238 -Dangerous builds = 0 -Total wall time: 0:00:33 diff --git a/examples/USER/brownian/spherical_ABP/log_ideal_1_1_1_3_4_3d.lammps.log b/examples/USER/brownian/spherical_ABP/log_ideal_1_1_1_3_4_3d.lammps.log deleted file mode 100644 index c5cbe4936d..0000000000 --- a/examples/USER/brownian/spherical_ABP/log_ideal_1_1_1_3_4_3d.lammps.log +++ /dev/null @@ -1,150 +0,0 @@ -units lj -atom_style hybrid dipole sphere -WARNING: Atom_style hybrid defines both pertype and peratom masses - both must be set, only peratom masses will be used (src/atom_vec_hybrid.cpp:157) -dimension 3 -newton off - - -lattice sc 0.4 -Lattice spacing in x,y,z = 1.3572088 1.3572088 1.3572088 -region box block -8 8 -8 8 -8 8 -create_box 1 box -Created orthogonal box = (-10.857670 -10.857670 -10.857670) to (10.857670 10.857670 10.857670) - 1 by 1 by 1 MPI processor grid -create_atoms 1 box -Created 4096 atoms - create_atoms CPU = 0.003 seconds -mass * 1.0 -set type * dipole/random ${seed} 1.0 -set type * dipole/random 1974019 1.0 -Setting atom values ... - 4096 settings made for dipole/random -velocity all create 1.0 1 loop geom - -pair_style none - -# overdamped brownian dynamics time-step -fix step all brownian/sphere ${gamma_t} ${gamma_r} ${D_t} ${D_r} ${seed} dipole -fix step all brownian/sphere 1 ${gamma_r} ${D_t} ${D_r} ${seed} dipole -fix step all brownian/sphere 1 1 ${D_t} ${D_r} ${seed} dipole -fix step all brownian/sphere 1 1 1 ${D_r} ${seed} dipole -fix step all brownian/sphere 1 1 1 3 ${seed} dipole -fix step all brownian/sphere 1 1 1 3 1974019 dipole -# self-propulsion force along the dipole direction -fix activity all propel/self dipole ${fp} -fix activity all propel/self dipole 4 - - -compute press all pressure NULL virial - -thermo_style custom step temp epair c_press - -#equilibration -timestep 0.0000000001 -thermo 50001 -run 50000 -WARNING: No pairwise cutoff or binsize set. Atom sorting therefore disabled. (src/atom.cpp:2118) -WARNING: Communication cutoff is 0.0. No ghost atoms will be generated. Atoms may get lost. (src/comm_brick.cpp:167) -Per MPI rank memory allocation (min/avg/max) = 4.362 | 4.362 | 4.362 Mbytes -Step Temp E_pair c_press - 0 1 0 0.068021726 - 50000 1.0486812e+10 0 0.068203091 -Loop time of 25.3706 on 1 procs for 50000 steps with 4096 atoms - -Performance: 0.017 tau/day, 1970.786 timesteps/s -100.0% CPU use with 1 MPI tasks x 1 OpenMP threads - -MPI task timing breakdown: -Section | min time | avg time | max time |%varavg| %total ---------------------------------------------------------------- -Pair | 0 | 0 | 0 | 0.0 | 0.00 -Neigh | 0 | 0 | 0 | 0.0 | 0.00 -Comm | 0.31005 | 0.31005 | 0.31005 | 0.0 | 1.22 -Output | 3.2633e-05 | 3.2633e-05 | 3.2633e-05 | 0.0 | 0.00 -Modify | 24.471 | 24.471 | 24.471 | 0.0 | 96.45 -Other | | 0.5897 | | | 2.32 - -Nlocal: 4096.00 ave 4096 max 4096 min -Histogram: 1 0 0 0 0 0 0 0 0 0 -Nghost: 817.000 ave 817 max 817 min -Histogram: 1 0 0 0 0 0 0 0 0 0 -Neighs: 0.00000 ave 0 max 0 min -Histogram: 1 0 0 0 0 0 0 0 0 0 - -Total # of neighbors = 0 -Ave neighs/atom = 0.0000000 -Neighbor list builds = 0 -Dangerous builds = 0 -reset_timestep 0 - - -# MSD to demonstrate expected diffusive behaviour for ideal active -# brownian motion, which is -# -# MSD = (2*d*D_t + 2*fp**2/(gamma_t**2*(d-1)*D_r))*t -# -# with d being simulation dimension -compute msd all msd - - -thermo_style custom step temp epair c_msd[*] c_press - - -timestep 0.00001 -thermo 10000 - -# main run -run 120000 -WARNING: Communication cutoff is 0.0. No ghost atoms will be generated. Atoms may get lost. (src/comm_brick.cpp:167) -Per MPI rank memory allocation (min/avg/max) = 4.737 | 4.737 | 4.737 Mbytes -Step Temp E_pair c_msd[1] c_msd[2] c_msd[3] c_msd[4] c_press - 0 1.0486812e+10 0 0 0 0 0 0.068203091 - 10000 104209.87 0 0.25428952 0.2512451 0.23617807 0.74171269 0.1910208 - 20000 104433.46 0 0.55611319 0.57499464 0.54362634 1.6747342 0.27977792 - 30000 104615.53 0 0.88377871 0.8933002 0.88683731 2.6639162 0.31709969 - 40000 105930.5 0 1.2301515 1.262995 1.2479624 3.7411089 0.26149988 - 50000 105556.39 0 1.5798848 1.6402779 1.6392277 4.8593905 0.34401188 - 60000 104644.58 0 1.9782384 1.9902061 2.0327974 6.0012419 0.26709167 - 70000 104314.31 0 2.3681872 2.3695505 2.4241916 7.1619294 0.24191407 - 80000 105700 0 2.7109374 2.7434271 2.8309194 8.2852839 0.28355159 - 90000 103411.61 0 3.1023448 3.0881218 3.1599155 9.350382 0.3070844 - 100000 105432.12 0 3.4853878 3.4372177 3.5153198 10.437925 0.28141015 - 110000 105723.04 0 3.8405786 3.7967805 3.8738332 11.511192 0.33248553 - 120000 104734.31 0 4.2454301 4.1714561 4.2234474 12.640334 0.3603781 -Loop time of 63.7803 on 1 procs for 120000 steps with 4096 atoms - -Performance: 1625.581 tau/day, 1881.459 timesteps/s -100.0% CPU use with 1 MPI tasks x 1 OpenMP threads - -MPI task timing breakdown: -Section | min time | avg time | max time |%varavg| %total ---------------------------------------------------------------- -Pair | 0 | 0 | 0 | 0.0 | 0.00 -Neigh | 0.013032 | 0.013032 | 0.013032 | 0.0 | 0.02 -Comm | 0.093045 | 0.093045 | 0.093045 | 0.0 | 0.15 -Output | 0.00069845 | 0.00069845 | 0.00069845 | 0.0 | 0.00 -Modify | 62.279 | 62.279 | 62.279 | 0.0 | 97.65 -Other | | 1.394 | | | 2.19 - -Nlocal: 4096.00 ave 4096 max 4096 min -Histogram: 1 0 0 0 0 0 0 0 0 0 -Nghost: 0.00000 ave 0 max 0 min -Histogram: 1 0 0 0 0 0 0 0 0 0 -Neighs: 0.00000 ave 0 max 0 min -Histogram: 1 0 0 0 0 0 0 0 0 0 - -Total # of neighbors = 0 -Ave neighs/atom = 0.0000000 -Neighbor list builds = 2174 -Dangerous builds = 0 - -# if you want to check that rotational diffusion is behaving as expected, -# uncomment next three lines for dump output and then plot , -# which should decay exponentially with timescale (d-1)*D_r (with d -# being simulation dimension) - -#dump 1 all custom 2000 dump_ideal_${params}_3d.lammpstrj id type # x y xu yu mux muy muz fx fy fz -#dump_modify 1 first yes sort id - -#run 120000 -Total wall time: 0:01:29 From e874446b7c3080e8b7c895a14d8e51a0f8832dcc Mon Sep 17 00:00:00 2001 From: Axel Kohlmeyer Date: Tue, 11 May 2021 21:20:29 -0400 Subject: [PATCH 22/22] fix whitespace in doc files --- doc/src/fix_brownian.rst | 11 +++++------ doc/src/fix_propel_self.rst | 11 +++++------ 2 files changed, 10 insertions(+), 12 deletions(-) diff --git a/doc/src/fix_brownian.rst b/doc/src/fix_brownian.rst index ac8863bdd5..d032346617 100644 --- a/doc/src/fix_brownian.rst +++ b/doc/src/fix_brownian.rst @@ -21,7 +21,7 @@ Syntax * ID, group-ID are documented in :doc:`fix ` command * style_name = *brownian* or *brownian/sphere* or *brownian/asphere* -* temp = temperature +* temp = temperature * seed = random number generator seed * one or more keyword/value pairs may be appended * keyword = *rng* or *dipole* or *gamma_r_eigen* or *gamma_t_eigen* or *gamma_r* or *gamma_t* @@ -51,7 +51,7 @@ Examples fix 1 all brownian 1.0 12908410 gamma_t 1.0 fix 1 all brownian 1.0 12908410 gamma_t 3.0 rng gaussian - fix 1 all brownian/sphere 1.0 1294019 gamma_t 3.0 gamma_r 1.0 + fix 1 all brownian/sphere 1.0 1294019 gamma_t 3.0 gamma_r 1.0 fix 1 all brownian/sphere 1.0 19581092 gamma_t 1.0 gamma_r 0.3 rng none fix 1 all brownian/asphere 1.0 1294019 gamma_t_eigen 1.0 2.0 3.0 gamma_r_eigen 4.0 7.0 8.0 rng gaussian fix 1 all brownian/asphere 1.0 1294019 gamma_t_eigen 1.0 2.0 3.0 gamma_r_eigen 4.0 7.0 8.0 dipole 1.0 0.0 0.0 @@ -107,7 +107,7 @@ friction tensors can be diagonalized in a certain (body) reference frame. accounted for by setting *gamma_t* to 3x and *gamma_r* to x (where :math:`\sigma` is the spherical diameter). A similar (though more complex) relationship holds for ellipsoids and rod-like particles. - + --------- .. note:: @@ -141,7 +141,7 @@ The units of *gamma_t* are mass/time. The *gamma_r* keyword sets the (isotropic) rotational viscous damping. Required for (and only compatible with) *brownian/sphere*. -The units of *gamma_r* are mass*length**2/time. +The units of *gamma_r* are mass*length**2/time. The *gamma_r_eigen*, and *gamma_t_eigen* keywords are the eigenvalues of the rotational and viscous damping tensors (having the same units as @@ -159,7 +159,7 @@ are updated as described above. Only compatible with *brownian/asphere* .. note:: For style *brownian/asphere*, the components *gamma_t_eigen* =(x,x,x) and *gamma_r_eigen* = (y,y,y), the dynamics will replicate those of the - *brownian/sphere* style with *gamma_t* = x and *gamma_r* = y. + *brownian/sphere* style with *gamma_t* = x and *gamma_r* = y. ---------- @@ -189,7 +189,6 @@ This fix is part of the USER-BROWNIAN package. It is only enabled if LAMMPS was built with that package. See the :doc:`Build package ` doc page for more info. - Related commands """""""""""""""" diff --git a/doc/src/fix_propel_self.rst b/doc/src/fix_propel_self.rst index 85dd53cd62..ddc96817f9 100644 --- a/doc/src/fix_propel_self.rst +++ b/doc/src/fix_propel_self.rst @@ -28,8 +28,8 @@ Examples .. code-block:: LAMMPS - fix active all propel/self dipole 40.0 - fix active all propel/self velocity 10.0 + fix active all propel/self dipole 40.0 + fix active all propel/self velocity 10.0 fix active all propel/self quat 15.7 qvector 1.0 0.0 0.0 Description @@ -81,12 +81,12 @@ be along this axis, set *sx* equal to 1 and *sy*, *sz* both equal to zero. This keyword may only be specified for mode *quat*. .. note:: - + In using keyword *quatvec*, the three arguments *sx*, *sy*, and *sz* will be automatically normalized to components of a unit vector internally to avoid users having to explicitly do so themselves. Therefore, in mode *quat*, the vectors :math:`e_i` - will always be of unit length. + will always be of unit length. Along with adding a force contribution, this fix can also @@ -117,14 +117,13 @@ in pressure computations. to turn off the virial contribution of this fix). Again, see :ref:`(Winkler) ` for discussion of why this is the case. - + Furthermore, when dealing with active systems, the temperature is no longer well defined. Therefore, one should ensure that the *virial* flag is used in the :doc:`compute pressure ` command (turning off temperature contributions). - ---------- Restart, fix_modify, output, run start/stop, minimize info