forked from lijiext/lammps
git-svn-id: svn://svn.icms.temple.edu/lammps-ro/trunk@9847 f3b2605a-c512-4ea7-a41b-209d697bcdaa
This commit is contained in:
parent
bfdbe3ab87
commit
7018102f9f
|
@ -94,6 +94,7 @@ PPPMGPU::PPPMGPU(LAMMPS *lmp, int narg, char **arg) : PPPM(lmp, narg, arg)
|
|||
{
|
||||
if (narg != 1) error->all(FLERR,"Illegal kspace_style pppm/gpu command");
|
||||
|
||||
triclinic_support = 0;
|
||||
density_brick_gpu = vd_brick = NULL;
|
||||
kspace_split = false;
|
||||
im_real_space = false;
|
||||
|
|
|
@ -99,7 +99,8 @@ void Ewald::init()
|
|||
domain->boundary[2][0] != 1 || domain->boundary[2][1] != 1)
|
||||
error->all(FLERR,"Incorrect boundaries with slab Ewald");
|
||||
if (domain->triclinic)
|
||||
error->all(FLERR,"Cannot (yet) use Ewald with triclinic box and slab correction");
|
||||
error->all(FLERR,"Cannot (yet) use Ewald with triclinic box "
|
||||
"and slab correction");
|
||||
}
|
||||
|
||||
// extract short-range Coulombic cutoff from pair style
|
||||
|
|
|
@ -142,7 +142,9 @@ void MSM::init()
|
|||
|
||||
if (order%2 != 0) error->all(FLERR,"MSM order must be 4, 6, 8, or 10");
|
||||
|
||||
if (sizeof(FFT_SCALAR) != 8) error->all(FLERR,"Cannot (yet) use single precision with MSM (remove -DFFT_SINGLE from Makefile and recompile)");
|
||||
if (sizeof(FFT_SCALAR) != 8)
|
||||
error->all(FLERR,"Cannot (yet) use single precision with MSM "
|
||||
"(remove -DFFT_SINGLE from Makefile and recompile)");
|
||||
|
||||
pair_check();
|
||||
|
||||
|
|
|
@ -48,10 +48,10 @@ MSMCG::MSMCG(LAMMPS *lmp, int narg, char **arg) : MSM(lmp, narg, arg)
|
|||
if ((narg < 1) || (narg > 2))
|
||||
error->all(FLERR,"Illegal kspace_style msm/cg command");
|
||||
|
||||
if (narg == 2)
|
||||
smallq = atof(arg[1]);
|
||||
else
|
||||
smallq = SMALLQ;
|
||||
triclinic_support = 0;
|
||||
|
||||
if (narg == 2) smallq = atof(arg[1]);
|
||||
else smallq = SMALLQ;
|
||||
|
||||
num_charged = -1;
|
||||
is_charged = NULL;
|
||||
|
@ -66,7 +66,6 @@ MSMCG::~MSMCG()
|
|||
memory->destroy(is_charged);
|
||||
}
|
||||
|
||||
|
||||
/* ----------------------------------------------------------------------
|
||||
compute the MSM long-range force, energy, virial
|
||||
------------------------------------------------------------------------- */
|
||||
|
@ -289,7 +288,6 @@ void MSMCG::compute(int eflag, int vflag)
|
|||
|
||||
}
|
||||
|
||||
|
||||
/* ----------------------------------------------------------------------
|
||||
find center grid pt for each of my particles
|
||||
check that full stencil for the particle will fit in my 3d brick
|
||||
|
|
|
@ -172,9 +172,11 @@ void PPPM::init()
|
|||
// error check
|
||||
|
||||
if (domain->triclinic && differentiation_flag == 1)
|
||||
error->all(FLERR,"Cannot (yet) use PPPM with triclinic box and 'kspace_modify diff ad'");
|
||||
error->all(FLERR,"Cannot (yet) use PPPM with triclinic box "
|
||||
"and kspace_modify diff a'");
|
||||
if (domain->triclinic && slabflag)
|
||||
error->all(FLERR,"Cannot (yet) use PPPM with triclinic box and slab correction");
|
||||
error->all(FLERR,"Cannot (yet) use PPPM with triclinic box and "
|
||||
"slab correction");
|
||||
if (domain->dimension == 2) error->all(FLERR,
|
||||
"Cannot use PPPM with 2d simulation");
|
||||
|
||||
|
|
|
@ -53,10 +53,10 @@ PPPMCG::PPPMCG(LAMMPS *lmp, int narg, char **arg) : PPPM(lmp, narg, arg)
|
|||
if ((narg < 1) || (narg > 2))
|
||||
error->all(FLERR,"Illegal kspace_style pppm/cg command");
|
||||
|
||||
if (narg == 2)
|
||||
smallq = atof(arg[1]);
|
||||
else
|
||||
smallq = SMALLQ;
|
||||
triclinic_support = 0;
|
||||
|
||||
if (narg == 2) smallq = atof(arg[1]);
|
||||
else smallq = SMALLQ;
|
||||
|
||||
num_charged = -1;
|
||||
is_charged = NULL;
|
||||
|
@ -78,7 +78,6 @@ PPPMCG::~PPPMCG()
|
|||
|
||||
void PPPMCG::compute(int eflag, int vflag)
|
||||
{
|
||||
|
||||
// set energy/virial flags
|
||||
// invoke allocate_peratom() if needed for first time
|
||||
|
||||
|
|
|
@ -68,6 +68,7 @@ PPPMDisp::PPPMDisp(LAMMPS *lmp, int narg, char **arg) : KSpace(lmp, narg, arg)
|
|||
{
|
||||
if (narg < 1) error->all(FLERR,"Illegal kspace_style pppm/disp command");
|
||||
|
||||
triclinic_support = 0;
|
||||
pppmflag = dispersionflag = 1;
|
||||
accuracy_relative = atof(arg[0]);
|
||||
|
||||
|
@ -203,8 +204,7 @@ void PPPMDisp::init()
|
|||
if (logfile) fprintf(logfile,"PPPMDisp initialization ...\n");
|
||||
}
|
||||
|
||||
if (domain->triclinic)
|
||||
error->all(FLERR,"Cannot (yet) use PPPMDisp with triclinic box");
|
||||
triclinic_check();
|
||||
if (domain->dimension == 2)
|
||||
error->all(FLERR,"Cannot use PPPMDisp with 2d simulation");
|
||||
|
||||
|
@ -227,8 +227,6 @@ void PPPMDisp::init()
|
|||
deallocate_peratom();
|
||||
peratom_allocate_flag = 0;
|
||||
|
||||
|
||||
|
||||
// set scale
|
||||
|
||||
scale = 1.0;
|
||||
|
|
|
@ -44,6 +44,7 @@ using namespace MathConst;
|
|||
PPPMDispTIP4P::PPPMDispTIP4P(LAMMPS *lmp, int narg, char **arg) :
|
||||
PPPMDisp(lmp, narg, arg)
|
||||
{
|
||||
triclinic_support = 0;
|
||||
tip4pflag = 1;
|
||||
}
|
||||
|
||||
|
|
|
@ -60,6 +60,7 @@ PPPMOld::PPPMOld(LAMMPS *lmp, int narg, char **arg) : KSpace(lmp, narg, arg)
|
|||
{
|
||||
if (narg < 1) error->all(FLERR,"Illegal kspace_style pppm command");
|
||||
|
||||
triclinic_support = 0;
|
||||
pppmflag = 1;
|
||||
group_group_enable = 1;
|
||||
|
||||
|
@ -123,8 +124,7 @@ void PPPMOld::init()
|
|||
|
||||
// error check
|
||||
|
||||
if (domain->triclinic)
|
||||
error->all(FLERR,"Cannot (yet) use PPPM with triclinic box");
|
||||
triclinic_check();
|
||||
if (domain->dimension == 2) error->all(FLERR,
|
||||
"Cannot use PPPM with 2d simulation");
|
||||
|
||||
|
|
|
@ -42,6 +42,7 @@ using namespace MathConst;
|
|||
PPPMTIP4P::PPPMTIP4P(LAMMPS *lmp, int narg, char **arg) :
|
||||
PPPM(lmp, narg, arg)
|
||||
{
|
||||
triclinic_support = 0;
|
||||
tip4pflag = 1;
|
||||
}
|
||||
|
||||
|
|
|
@ -109,6 +109,8 @@ PPPMCuda::PPPMCuda(LAMMPS *lmp, int narg, char **arg) :
|
|||
#ifndef FFT_CUFFT
|
||||
error->all(FLERR,"Using kspace_style pppm/cuda without cufft is not possible. Compile with cufft=1 to include cufft. Aborting.");
|
||||
#endif
|
||||
|
||||
triclinic_support = 0;
|
||||
accuracy_relative = atof(arg[0]);
|
||||
|
||||
nfactors = 3;
|
||||
|
@ -209,8 +211,7 @@ void PPPMCuda::init()
|
|||
|
||||
// error check
|
||||
|
||||
if (domain->triclinic)
|
||||
error->all(FLERR,"Cannot (yet) use PPPMCuda with triclinic box");
|
||||
triclinic_check();
|
||||
if (domain->dimension == 2) error->all(FLERR,"Cannot use PPPMCuda with 2d simulation");
|
||||
|
||||
if (!atom->q_flag) error->all(FLERR,"Kspace style requires atom attribute q");
|
||||
|
|
|
@ -37,6 +37,7 @@ using namespace MathConst;
|
|||
EwaldOMP::EwaldOMP(LAMMPS *lmp, int narg, char **arg)
|
||||
: Ewald(lmp, narg, arg), ThrOMP(lmp, THR_KSPACE)
|
||||
{
|
||||
triclinic_support = 0;
|
||||
suffix_flag |= Suffix::OMP;
|
||||
}
|
||||
|
||||
|
|
|
@ -49,10 +49,10 @@ MSMCGOMP::MSMCGOMP(LAMMPS *lmp, int narg, char **arg) : MSMOMP(lmp, narg, arg)
|
|||
if ((narg < 1) || (narg > 2))
|
||||
error->all(FLERR,"Illegal kspace_style msm/cg/omp command");
|
||||
|
||||
if (narg == 2)
|
||||
smallq = atof(arg[1]);
|
||||
else
|
||||
smallq = SMALLQ;
|
||||
triclinic_support = 0;
|
||||
|
||||
if (narg == 2) smallq = atof(arg[1]);
|
||||
else smallq = SMALLQ;
|
||||
|
||||
num_charged = -1;
|
||||
is_charged = NULL;
|
||||
|
@ -67,7 +67,6 @@ MSMCGOMP::~MSMCGOMP()
|
|||
memory->destroy(is_charged);
|
||||
}
|
||||
|
||||
|
||||
/* ----------------------------------------------------------------------
|
||||
compute the MSM long-range force, energy, virial
|
||||
------------------------------------------------------------------------- */
|
||||
|
|
|
@ -38,6 +38,7 @@ using namespace LAMMPS_NS;
|
|||
MSMOMP::MSMOMP(LAMMPS *lmp, int narg, char **arg) :
|
||||
MSM(lmp, narg, arg), ThrOMP(lmp, THR_KSPACE)
|
||||
{
|
||||
triclinic_support = 0;
|
||||
suffix_flag |= Suffix::OMP;
|
||||
}
|
||||
|
||||
|
|
|
@ -49,6 +49,7 @@ using namespace MathSpecial;
|
|||
PPPMCGOMP::PPPMCGOMP(LAMMPS *lmp, int narg, char **arg) :
|
||||
PPPMCG(lmp, narg, arg), ThrOMP(lmp, THR_KSPACE)
|
||||
{
|
||||
triclinic_support = 0;
|
||||
suffix_flag |= Suffix::OMP;
|
||||
}
|
||||
|
||||
|
|
|
@ -46,6 +46,7 @@ using namespace MathConst;
|
|||
PPPMDispOMP::PPPMDispOMP(LAMMPS *lmp, int narg, char **arg) :
|
||||
PPPMDisp(lmp, narg, arg), ThrOMP(lmp, THR_KSPACE)
|
||||
{
|
||||
triclinic_support = 0;
|
||||
suffix_flag |= Suffix::OMP;
|
||||
}
|
||||
|
||||
|
|
|
@ -47,6 +47,7 @@ using namespace MathSpecial;
|
|||
PPPMDispTIP4POMP::PPPMDispTIP4POMP(LAMMPS *lmp, int narg, char **arg) :
|
||||
PPPMDispTIP4P(lmp, narg, arg), ThrOMP(lmp, THR_KSPACE)
|
||||
{
|
||||
triclinic_support = 0;
|
||||
tip4pflag = 1;
|
||||
suffix_flag |= Suffix::OMP;
|
||||
}
|
||||
|
|
|
@ -47,6 +47,7 @@ using namespace MathSpecial;
|
|||
PPPMOMP::PPPMOMP(LAMMPS *lmp, int narg, char **arg) :
|
||||
PPPM(lmp, narg, arg), ThrOMP(lmp, THR_KSPACE)
|
||||
{
|
||||
triclinic_support = 0;
|
||||
suffix_flag |= Suffix::OMP;
|
||||
}
|
||||
|
||||
|
|
|
@ -48,6 +48,7 @@ using namespace MathSpecial;
|
|||
PPPMTIP4POMP::PPPMTIP4POMP(LAMMPS *lmp, int narg, char **arg) :
|
||||
PPPMTIP4P(lmp, narg, arg), ThrOMP(lmp, THR_KSPACE)
|
||||
{
|
||||
triclinic_support = 0;
|
||||
suffix_flag |= Suffix::OMP;
|
||||
}
|
||||
|
||||
|
|
|
@ -33,6 +33,7 @@ KSpace::KSpace(LAMMPS *lmp, int narg, char **arg) : Pointers(lmp)
|
|||
energy = 0.0;
|
||||
virial[0] = virial[1] = virial[2] = virial[3] = virial[4] = virial[5] = 0.0;
|
||||
|
||||
triclinic_support = 1;
|
||||
ewaldflag = pppmflag = msmflag = dispersionflag = tip4pflag = 0;
|
||||
compute_flag = 1;
|
||||
group_group_enable = 0;
|
||||
|
@ -128,6 +129,14 @@ KSpace::~KSpace()
|
|||
|
||||
/* ---------------------------------------------------------------------- */
|
||||
|
||||
void KSpace::triclinic_check()
|
||||
{
|
||||
if (domain->triclinic && triclinic_support != 1)
|
||||
error->all(FLERR,"KSpace style does not yet support triclinic geometries");
|
||||
}
|
||||
|
||||
/* ---------------------------------------------------------------------- */
|
||||
|
||||
void KSpace::compute_dummy(int eflag, int vflag)
|
||||
{
|
||||
if (eflag || vflag) ev_setup(eflag,vflag);
|
||||
|
|
12
src/kspace.h
12
src/kspace.h
|
@ -30,12 +30,13 @@ class KSpace : protected Pointers {
|
|||
friend class ThrOMP;
|
||||
friend class FixOMP;
|
||||
public:
|
||||
double energy; // accumulated energy
|
||||
double energy; // accumulated energies
|
||||
double energy_1,energy_6;
|
||||
double virial[6]; // accumlated virial
|
||||
double *eatom,**vatom; // accumulated per-atom energy/virial
|
||||
double e2group; // accumulated group-group energy
|
||||
double f2group[3]; // accumulated group-group force
|
||||
double virial[6]; // accumlated virial
|
||||
double *eatom,**vatom; // accumulated per-atom energy/virial
|
||||
double e2group; // accumulated group-group energy
|
||||
double f2group[3]; // accumulated group-group force
|
||||
int triclinic_support; // 1 if supports triclinic geometries
|
||||
|
||||
int ewaldflag; // 1 if a Ewald solver
|
||||
int pppmflag; // 1 if a PPPM solver
|
||||
|
@ -58,6 +59,7 @@ class KSpace : protected Pointers {
|
|||
|
||||
KSpace(class LAMMPS *, int, char **);
|
||||
virtual ~KSpace();
|
||||
void triclinic_check();
|
||||
void modify_params(int, char **);
|
||||
void *extract(const char *);
|
||||
void compute_dummy(int, int);
|
||||
|
|
Loading…
Reference in New Issue