git-svn-id: svn://svn.icms.temple.edu/lammps-ro/trunk@2755 f3b2605a-c512-4ea7-a41b-209d697bcdaa
This commit is contained in:
@ -14,8 +14,10 @@
|
|||||||
#include "string.h"
|
#include "string.h"
|
||||||
#include "fix_freeze.h"
|
#include "fix_freeze.h"
|
||||||
#include "atom.h"
|
#include "atom.h"
|
||||||
|
#include "update.h"
|
||||||
#include "modify.h"
|
#include "modify.h"
|
||||||
#include "comm.h"
|
#include "comm.h"
|
||||||
|
#include "respa.h"
|
||||||
#include "error.h"
|
#include "error.h"
|
||||||
|
|
||||||
using namespace LAMMPS_NS;
|
using namespace LAMMPS_NS;
|
||||||
@ -37,6 +39,7 @@ int FixFreeze::setmask()
|
|||||||
{
|
{
|
||||||
int mask = 0;
|
int mask = 0;
|
||||||
mask |= POST_FORCE;
|
mask |= POST_FORCE;
|
||||||
|
mask |= POST_FORCE_RESPA;
|
||||||
return mask;
|
return mask;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -57,7 +60,16 @@ void FixFreeze::init()
|
|||||||
|
|
||||||
void FixFreeze::setup(int vflag)
|
void FixFreeze::setup(int vflag)
|
||||||
{
|
{
|
||||||
|
if (strcmp(update->integrate_style,"verlet") == 0)
|
||||||
post_force(vflag);
|
post_force(vflag);
|
||||||
|
else {
|
||||||
|
int nlevels_respa = ((Respa *) update->integrate)->nlevels;
|
||||||
|
for (int ilevel = 0; ilevel < nlevels_respa; ilevel++) {
|
||||||
|
((Respa *) update->integrate)->copy_flevel_f(ilevel);
|
||||||
|
post_force_respa(vflag,ilevel,0);
|
||||||
|
((Respa *) update->integrate)->copy_f_flevel(ilevel);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/* ---------------------------------------------------------------------- */
|
/* ---------------------------------------------------------------------- */
|
||||||
@ -80,3 +92,11 @@ void FixFreeze::post_force(int vflag)
|
|||||||
torque[i][2] = 0.0;
|
torque[i][2] = 0.0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* ---------------------------------------------------------------------- */
|
||||||
|
|
||||||
|
void FixFreeze::post_force_respa(int vflag, int ilevel, int iloop)
|
||||||
|
{
|
||||||
|
post_force(vflag);
|
||||||
|
}
|
||||||
|
|
||||||
|
|||||||
@ -25,6 +25,7 @@ class FixFreeze : public Fix {
|
|||||||
void init();
|
void init();
|
||||||
void setup(int);
|
void setup(int);
|
||||||
void post_force(int);
|
void post_force(int);
|
||||||
|
void post_force_respa(int, int, int);
|
||||||
};
|
};
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -25,6 +25,7 @@
|
|||||||
#include "force.h"
|
#include "force.h"
|
||||||
#include "pair.h"
|
#include "pair.h"
|
||||||
#include "modify.h"
|
#include "modify.h"
|
||||||
|
#include "respa.h"
|
||||||
#include "memory.h"
|
#include "memory.h"
|
||||||
#include "error.h"
|
#include "error.h"
|
||||||
|
|
||||||
@ -202,6 +203,7 @@ int FixWallGran::setmask()
|
|||||||
{
|
{
|
||||||
int mask = 0;
|
int mask = 0;
|
||||||
mask |= POST_FORCE;
|
mask |= POST_FORCE;
|
||||||
|
mask |= POST_FORCE_RESPA;
|
||||||
return mask;
|
return mask;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -211,6 +213,9 @@ void FixWallGran::init()
|
|||||||
{
|
{
|
||||||
dt = update->dt;
|
dt = update->dt;
|
||||||
|
|
||||||
|
if (strcmp(update->integrate_style,"respa") == 0)
|
||||||
|
nlevels_respa = ((Respa *) update->integrate)->nlevels;
|
||||||
|
|
||||||
// set pairstyle from granular pair style
|
// set pairstyle from granular pair style
|
||||||
|
|
||||||
if (force->pair_match("gran/hooke",1))
|
if (force->pair_match("gran/hooke",1))
|
||||||
@ -226,7 +231,13 @@ void FixWallGran::init()
|
|||||||
|
|
||||||
void FixWallGran::setup(int vflag)
|
void FixWallGran::setup(int vflag)
|
||||||
{
|
{
|
||||||
|
if (strcmp(update->integrate_style,"verlet") == 0)
|
||||||
post_force(vflag);
|
post_force(vflag);
|
||||||
|
else {
|
||||||
|
((Respa *) update->integrate)->copy_flevel_f(nlevels_respa-1);
|
||||||
|
post_force_respa(vflag,nlevels_respa-1,0);
|
||||||
|
((Respa *) update->integrate)->copy_f_flevel(nlevels_respa-1);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/* ---------------------------------------------------------------------- */
|
/* ---------------------------------------------------------------------- */
|
||||||
@ -328,6 +339,13 @@ void FixWallGran::post_force(int vflag)
|
|||||||
|
|
||||||
/* ---------------------------------------------------------------------- */
|
/* ---------------------------------------------------------------------- */
|
||||||
|
|
||||||
|
void FixWallGran::post_force_respa(int vflag, int ilevel, int iloop)
|
||||||
|
{
|
||||||
|
if (ilevel == nlevels_respa-1) post_force(vflag);
|
||||||
|
}
|
||||||
|
|
||||||
|
/* ---------------------------------------------------------------------- */
|
||||||
|
|
||||||
void FixWallGran::hooke(double rsq, double dx, double dy, double dz,
|
void FixWallGran::hooke(double rsq, double dx, double dy, double dz,
|
||||||
double *vwall, double *v,
|
double *vwall, double *v,
|
||||||
double *f, double *omega, double *torque,
|
double *f, double *omega, double *torque,
|
||||||
|
|||||||
@ -26,6 +26,7 @@ class FixWallGran : public Fix {
|
|||||||
void init();
|
void init();
|
||||||
void setup(int);
|
void setup(int);
|
||||||
void post_force(int);
|
void post_force(int);
|
||||||
|
void post_force_respa(int, int, int);
|
||||||
|
|
||||||
double memory_usage();
|
double memory_usage();
|
||||||
void grow_arrays(int);
|
void grow_arrays(int);
|
||||||
@ -44,6 +45,7 @@ class FixWallGran : public Fix {
|
|||||||
double lo,hi,cylradius;
|
double lo,hi,cylradius;
|
||||||
double amplitude,period,omega,time_origin,vshear;
|
double amplitude,period,omega,time_origin,vshear;
|
||||||
double dt;
|
double dt;
|
||||||
|
int nlevels_respa;
|
||||||
|
|
||||||
int *touch;
|
int *touch;
|
||||||
double **shear;
|
double **shear;
|
||||||
|
|||||||
@ -19,6 +19,7 @@
|
|||||||
#include "atom.h"
|
#include "atom.h"
|
||||||
#include "update.h"
|
#include "update.h"
|
||||||
#include "domain.h"
|
#include "domain.h"
|
||||||
|
#include "respa.h"
|
||||||
#include "error.h"
|
#include "error.h"
|
||||||
|
|
||||||
using namespace LAMMPS_NS;
|
using namespace LAMMPS_NS;
|
||||||
@ -97,6 +98,7 @@ int FixGravity::setmask()
|
|||||||
{
|
{
|
||||||
int mask = 0;
|
int mask = 0;
|
||||||
mask |= POST_FORCE;
|
mask |= POST_FORCE;
|
||||||
|
mask |= POST_FORCE_RESPA;
|
||||||
return mask;
|
return mask;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -104,6 +106,9 @@ int FixGravity::setmask()
|
|||||||
|
|
||||||
void FixGravity::init()
|
void FixGravity::init()
|
||||||
{
|
{
|
||||||
|
if (strcmp(update->integrate_style,"respa") == 0)
|
||||||
|
nlevels_respa = ((Respa *) update->integrate)->nlevels;
|
||||||
|
|
||||||
dt = update->dt;
|
dt = update->dt;
|
||||||
|
|
||||||
xacc = magnitude*xgrav;
|
xacc = magnitude*xgrav;
|
||||||
@ -115,7 +120,13 @@ void FixGravity::init()
|
|||||||
|
|
||||||
void FixGravity::setup(int vflag)
|
void FixGravity::setup(int vflag)
|
||||||
{
|
{
|
||||||
|
if (strcmp(update->integrate_style,"verlet") == 0)
|
||||||
post_force(vflag);
|
post_force(vflag);
|
||||||
|
else {
|
||||||
|
((Respa *) update->integrate)->copy_flevel_f(nlevels_respa-1);
|
||||||
|
post_force_respa(vflag,nlevels_respa-1,0);
|
||||||
|
((Respa *) update->integrate)->copy_f_flevel(nlevels_respa-1);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/* ---------------------------------------------------------------------- */
|
/* ---------------------------------------------------------------------- */
|
||||||
@ -170,3 +181,10 @@ void FixGravity::post_force(int vflag)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* ---------------------------------------------------------------------- */
|
||||||
|
|
||||||
|
void FixGravity::post_force_respa(int vflag, int ilevel, int iloop)
|
||||||
|
{
|
||||||
|
if (ilevel == nlevels_respa-1) post_force(vflag);
|
||||||
|
}
|
||||||
|
|||||||
@ -27,6 +27,7 @@ class FixGravity : public Fix {
|
|||||||
void init();
|
void init();
|
||||||
void setup(int);
|
void setup(int);
|
||||||
void post_force(int);
|
void post_force(int);
|
||||||
|
void post_force_respa(int, int, int);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
int style,time_initial;
|
int style,time_initial;
|
||||||
@ -35,6 +36,7 @@ class FixGravity : public Fix {
|
|||||||
double xdir,ydir,zdir;
|
double xdir,ydir,zdir;
|
||||||
double xgrav,ygrav,zgrav,xacc,yacc,zacc;
|
double xgrav,ygrav,zgrav,xacc,yacc,zacc;
|
||||||
double degree2rad;
|
double degree2rad;
|
||||||
|
int nlevels_respa;
|
||||||
};
|
};
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user