git-svn-id: svn://svn.icms.temple.edu/lammps-ro/trunk@951 f3b2605a-c512-4ea7-a41b-209d697bcdaa
This commit is contained in:
@ -583,9 +583,9 @@ int AtomVecEllipsoid::data_vel_hybrid(int m, char **values)
|
|||||||
return # of bytes of allocated memory
|
return # of bytes of allocated memory
|
||||||
------------------------------------------------------------------------- */
|
------------------------------------------------------------------------- */
|
||||||
|
|
||||||
int AtomVecEllipsoid::memory_usage()
|
double AtomVecEllipsoid::memory_usage()
|
||||||
{
|
{
|
||||||
int bytes = 0;
|
double bytes = 0.0;
|
||||||
|
|
||||||
if (atom->memcheck("tag")) bytes += nmax * sizeof(int);
|
if (atom->memcheck("tag")) bytes += nmax * sizeof(int);
|
||||||
if (atom->memcheck("type")) bytes += nmax * sizeof(int);
|
if (atom->memcheck("type")) bytes += nmax * sizeof(int);
|
||||||
|
|||||||
@ -40,7 +40,7 @@ class AtomVecEllipsoid : public AtomVec {
|
|||||||
int data_atom_hybrid(int, char **);
|
int data_atom_hybrid(int, char **);
|
||||||
void data_vel(int, char **);
|
void data_vel(int, char **);
|
||||||
int data_vel_hybrid(int, char **);
|
int data_vel_hybrid(int, char **);
|
||||||
int memory_usage();
|
double memory_usage();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
int *tag,*type,*mask,*image;
|
int *tag,*type,*mask,*image;
|
||||||
|
|||||||
@ -281,11 +281,7 @@ void PairLJClass2CoulLong::init_style()
|
|||||||
|
|
||||||
if (force->kspace == NULL)
|
if (force->kspace == NULL)
|
||||||
error->all("Pair style is incompatible with KSpace style");
|
error->all("Pair style is incompatible with KSpace style");
|
||||||
else if (strcmp(force->kspace_style,"ewald") == 0)
|
g_ewald = force->kspace->g_ewald;
|
||||||
g_ewald = force->kspace->g_ewald;
|
|
||||||
else if (strcmp(force->kspace_style,"pppm") == 0)
|
|
||||||
g_ewald = force->kspace->g_ewald;
|
|
||||||
else error->all("Pair style is incompatible with KSpace style");
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/* ----------------------------------------------------------------------
|
/* ----------------------------------------------------------------------
|
||||||
@ -477,7 +473,8 @@ void PairLJClass2CoulLong::single(int i, int j, int itype, int jtype,
|
|||||||
|
|
||||||
/* ---------------------------------------------------------------------- */
|
/* ---------------------------------------------------------------------- */
|
||||||
|
|
||||||
void PairLJClass2CoulLong::extract_long(double *p_cut_coul)
|
void *PairLJClass2CoulLong::extract(char *str)
|
||||||
{
|
{
|
||||||
*p_cut_coul = cut_coul;
|
if (strcmp(str,"cut_coul") == 0) return (void *) &cut_coul;
|
||||||
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -32,8 +32,7 @@ class PairLJClass2CoulLong : public Pair {
|
|||||||
void write_restart_settings(FILE *);
|
void write_restart_settings(FILE *);
|
||||||
void read_restart_settings(FILE *);
|
void read_restart_settings(FILE *);
|
||||||
void single(int, int, int, int, double, double, double, int, One &);
|
void single(int, int, int, int, double, double, double, int, One &);
|
||||||
|
void *extract(char *);
|
||||||
void extract_long(double *);
|
|
||||||
|
|
||||||
private:
|
private:
|
||||||
double cut_lj_global;
|
double cut_lj_global;
|
||||||
|
|||||||
@ -638,9 +638,9 @@ int AtomVecDipole::data_vel_hybrid(int m, char **values)
|
|||||||
return # of bytes of allocated memory
|
return # of bytes of allocated memory
|
||||||
------------------------------------------------------------------------- */
|
------------------------------------------------------------------------- */
|
||||||
|
|
||||||
int AtomVecDipole::memory_usage()
|
double AtomVecDipole::memory_usage()
|
||||||
{
|
{
|
||||||
int bytes = 0;
|
double bytes = 0.0;
|
||||||
|
|
||||||
if (atom->memcheck("tag")) bytes += nmax * sizeof(int);
|
if (atom->memcheck("tag")) bytes += nmax * sizeof(int);
|
||||||
if (atom->memcheck("type")) bytes += nmax * sizeof(int);
|
if (atom->memcheck("type")) bytes += nmax * sizeof(int);
|
||||||
|
|||||||
@ -45,7 +45,7 @@ class AtomVecDipole : public AtomVec {
|
|||||||
int data_atom_hybrid(int, char **);
|
int data_atom_hybrid(int, char **);
|
||||||
void data_vel(int, char **);
|
void data_vel(int, char **);
|
||||||
int data_vel_hybrid(int, char **);
|
int data_vel_hybrid(int, char **);
|
||||||
int memory_usage();
|
double memory_usage();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
int *tag,*type,*mask,*image;
|
int *tag,*type,*mask,*image;
|
||||||
|
|||||||
@ -711,9 +711,9 @@ int AtomVecGranular::data_vel_hybrid(int m, char **values)
|
|||||||
return # of bytes of allocated memory
|
return # of bytes of allocated memory
|
||||||
------------------------------------------------------------------------- */
|
------------------------------------------------------------------------- */
|
||||||
|
|
||||||
int AtomVecGranular::memory_usage()
|
double AtomVecGranular::memory_usage()
|
||||||
{
|
{
|
||||||
int bytes = 0;
|
double bytes = 0.0;
|
||||||
|
|
||||||
if (atom->memcheck("tag")) bytes += nmax * sizeof(int);
|
if (atom->memcheck("tag")) bytes += nmax * sizeof(int);
|
||||||
if (atom->memcheck("type")) bytes += nmax * sizeof(int);
|
if (atom->memcheck("type")) bytes += nmax * sizeof(int);
|
||||||
|
|||||||
@ -46,7 +46,7 @@ class AtomVecGranular : public AtomVec {
|
|||||||
int data_atom_hybrid(int, char **);
|
int data_atom_hybrid(int, char **);
|
||||||
void data_vel(int, char **);
|
void data_vel(int, char **);
|
||||||
int data_vel_hybrid(int, char **);
|
int data_vel_hybrid(int, char **);
|
||||||
int memory_usage();
|
double memory_usage();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
double PI;
|
double PI;
|
||||||
|
|||||||
@ -114,15 +114,20 @@ int FixGranDiag::setmask()
|
|||||||
|
|
||||||
void FixGranDiag::init()
|
void FixGranDiag::init()
|
||||||
{
|
{
|
||||||
// insure use of granular pair_style
|
|
||||||
// set local values from Pair values
|
// set local values from Pair values
|
||||||
|
|
||||||
pair = force->pair_match("gran");
|
if (force->pair == NULL)
|
||||||
if (pair == NULL)
|
|
||||||
error->all("Fix gran/diag is incompatible with Pair style");
|
error->all("Fix gran/diag is incompatible with Pair style");
|
||||||
int dampflag;
|
double *p_xkk = (double *) force->pair->extract("xkk");
|
||||||
double gamman;
|
double *p_gamman = (double *) force->pair->extract("gamman");
|
||||||
pair->extract_gran(&xkk,&gamman,&xmu,&dampflag);
|
double *p_xmu = (double *) force->pair->extract("xmu");
|
||||||
|
int *p_dampflag = (int *) force->pair->extract("dampflag");
|
||||||
|
if (!p_xkk || !p_gamman || !p_xmu || !p_dampflag)
|
||||||
|
error->all("Fix gran/diag is incompatible with Pair style");
|
||||||
|
xkk = *p_xkk;
|
||||||
|
double gamman = *p_gamman;
|
||||||
|
xmu = *p_xmu;
|
||||||
|
int dampflag = *p_dampflag;
|
||||||
|
|
||||||
// same initialization as in pair_gran_history::init_style()
|
// same initialization as in pair_gran_history::init_style()
|
||||||
|
|
||||||
|
|||||||
@ -171,15 +171,13 @@ int FixWallGran::setmask()
|
|||||||
|
|
||||||
void FixWallGran::init()
|
void FixWallGran::init()
|
||||||
{
|
{
|
||||||
// insure use of granular pair_style
|
|
||||||
// set local values from Pair values
|
// set local values from Pair values
|
||||||
|
|
||||||
Pair *pair = force->pair_match("gran");
|
if (force->pair == NULL)
|
||||||
if (pair == NULL)
|
|
||||||
error->all("Fix wall/gran is incompatible with Pair style");
|
error->all("Fix wall/gran is incompatible with Pair style");
|
||||||
int itmp;
|
double *p_xkk = (double *) force->pair->extract("xkk");
|
||||||
double tmp1,tmp2;
|
if (!p_xkk) error->all("Fix wall/gran is incompatible with Pair style");
|
||||||
pair->extract_gran(&xkk,&tmp1,&tmp2,&itmp);
|
xkk = *p_xkk;
|
||||||
|
|
||||||
// same initialization as in pair_gran_history::init_style()
|
// same initialization as in pair_gran_history::init_style()
|
||||||
|
|
||||||
@ -648,10 +646,10 @@ void FixWallGran::hertzian(double rsq, double dx, double dy, double dz,
|
|||||||
memory usage of local atom-based arrays
|
memory usage of local atom-based arrays
|
||||||
------------------------------------------------------------------------- */
|
------------------------------------------------------------------------- */
|
||||||
|
|
||||||
int FixWallGran::memory_usage()
|
double FixWallGran::memory_usage()
|
||||||
{
|
{
|
||||||
int nmax = atom->nmax;
|
int nmax = atom->nmax;
|
||||||
int bytes = nmax * sizeof(int);
|
double bytes = nmax * sizeof(int);
|
||||||
bytes += 3*nmax * sizeof(double);
|
bytes += 3*nmax * sizeof(double);
|
||||||
return bytes;
|
return bytes;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -27,7 +27,7 @@ class FixWallGran : public Fix {
|
|||||||
void setup();
|
void setup();
|
||||||
void post_force(int);
|
void post_force(int);
|
||||||
|
|
||||||
int memory_usage();
|
double memory_usage();
|
||||||
void grow_arrays(int);
|
void grow_arrays(int);
|
||||||
void copy_arrays(int, int);
|
void copy_arrays(int, int);
|
||||||
int pack_exchange(int, double *);
|
int pack_exchange(int, double *);
|
||||||
|
|||||||
@ -479,11 +479,11 @@ void PairGranHistory::read_restart_settings(FILE *fp)
|
|||||||
|
|
||||||
/* ---------------------------------------------------------------------- */
|
/* ---------------------------------------------------------------------- */
|
||||||
|
|
||||||
void PairGranHistory::extract_gran(double *p_xkk, double *p_gamman,
|
void *PairGranHistory::extract(char *str)
|
||||||
double *p_xmu, int *p_dampflag)
|
|
||||||
{
|
{
|
||||||
*p_xkk = xkk;
|
if (strcmp(str,"xkk") == 0) return (void *) &xkk;
|
||||||
*p_gamman = gamman;
|
else if (strcmp(str,"gamman") == 0) return (void *) &gamman;
|
||||||
*p_xmu = xmu;
|
else if (strcmp(str,"xmu") == 0) return (void *) &xmu;
|
||||||
*p_dampflag = dampflag;
|
else if (strcmp(str,"dampflag") == 0) return (void *) &dampflag;
|
||||||
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -32,8 +32,7 @@ class PairGranHistory : public Pair {
|
|||||||
void read_restart(FILE *);
|
void read_restart(FILE *);
|
||||||
void write_restart_settings(FILE *);
|
void write_restart_settings(FILE *);
|
||||||
void read_restart_settings(FILE *);
|
void read_restart_settings(FILE *);
|
||||||
|
void *extract(char *);
|
||||||
void extract_gran(double *, double *, double *, int *);
|
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
double xkk,xkkt,xmu;
|
double xkk,xkkt,xmu;
|
||||||
|
|||||||
@ -93,18 +93,16 @@ void Ewald::init()
|
|||||||
error->all("Incorrect boundaries with slab Ewald");
|
error->all("Incorrect boundaries with slab Ewald");
|
||||||
}
|
}
|
||||||
|
|
||||||
// insure use of long (or table) pair_style with long-range Coulombics
|
// extract short-range Coulombic cutoff from pair style
|
||||||
// set cutoff to Pair's short-range Coulombic cutoff
|
|
||||||
|
|
||||||
qqrd2e = force->qqrd2e;
|
qqrd2e = force->qqrd2e;
|
||||||
|
|
||||||
Pair *pair = force->pair_match("long");
|
if (force->pair == NULL)
|
||||||
if (pair == NULL) pair = force->pair_match("table");
|
error->all("KSpace style is incompatible with Pair style");
|
||||||
if (pair == NULL) error->all("KSpace style is incompatible with Pair style");
|
double *p_cutoff = (double *) force->pair->extract("cut_coul");
|
||||||
double cutoff;
|
if (p_cutoff == NULL)
|
||||||
pair->extract_long(&cutoff);
|
error->all("KSpace style is incompatible with Pair style");
|
||||||
|
double cutoff = *p_cutoff;
|
||||||
// compute qsum & qsqsum and warn if not charge-neutral
|
|
||||||
|
|
||||||
qsum = qsqsum = 0.0;
|
qsum = qsqsum = 0.0;
|
||||||
for (int i = 0; i < atom->nlocal; i++) {
|
for (int i = 0; i < atom->nlocal; i++) {
|
||||||
@ -835,9 +833,9 @@ void Ewald::slabcorr(int eflag)
|
|||||||
memory usage of local arrays
|
memory usage of local arrays
|
||||||
------------------------------------------------------------------------- */
|
------------------------------------------------------------------------- */
|
||||||
|
|
||||||
int Ewald::memory_usage()
|
double Ewald::memory_usage()
|
||||||
{
|
{
|
||||||
int bytes = 3 * kmax3d * sizeof(int);
|
double bytes = 3 * kmax3d * sizeof(int);
|
||||||
bytes += (1 + 3 + 6) * kmax3d * sizeof(double);
|
bytes += (1 + 3 + 6) * kmax3d * sizeof(double);
|
||||||
bytes += 4 * kmax3d * sizeof(double);
|
bytes += 4 * kmax3d * sizeof(double);
|
||||||
bytes += nmax*3 * sizeof(double);
|
bytes += nmax*3 * sizeof(double);
|
||||||
|
|||||||
@ -25,7 +25,7 @@ class Ewald : public KSpace {
|
|||||||
void init();
|
void init();
|
||||||
void setup();
|
void setup();
|
||||||
void compute(int, int);
|
void compute(int, int);
|
||||||
int memory_usage();
|
double memory_usage();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
double PI;
|
double PI;
|
||||||
|
|||||||
@ -311,13 +311,9 @@ void PairBuckCoulLong::init_style()
|
|||||||
|
|
||||||
// insure use of KSpace long-range solver, set g_ewald
|
// insure use of KSpace long-range solver, set g_ewald
|
||||||
|
|
||||||
if (force->kspace == NULL)
|
if (force->kspace == NULL)
|
||||||
error->all("Pair style is incompatible with KSpace style");
|
error->all("Pair style is incompatible with KSpace style");
|
||||||
else if (strcmp(force->kspace_style,"ewald") == 0)
|
g_ewald = force->kspace->g_ewald;
|
||||||
g_ewald = force->kspace->g_ewald;
|
|
||||||
else if (strcmp(force->kspace_style,"pppm") == 0)
|
|
||||||
g_ewald = force->kspace->g_ewald;
|
|
||||||
else error->all("Pair style is incompatible with KSpace style");
|
|
||||||
|
|
||||||
int irequest = neighbor->request(this);
|
int irequest = neighbor->request(this);
|
||||||
}
|
}
|
||||||
@ -448,8 +444,9 @@ void PairBuckCoulLong::single(int i, int j, int itype, int jtype,
|
|||||||
|
|
||||||
/* ---------------------------------------------------------------------- */
|
/* ---------------------------------------------------------------------- */
|
||||||
|
|
||||||
void PairBuckCoulLong::extract_long(double *p_cut_coul)
|
void *PairBuckCoulLong::extract(char *str)
|
||||||
{
|
{
|
||||||
*p_cut_coul = cut_coul;
|
if (strcmp(str,"cut_coul") == 0) return (void *) &cut_coul;
|
||||||
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -32,8 +32,7 @@ class PairBuckCoulLong : public Pair {
|
|||||||
void write_restart_settings(FILE *);
|
void write_restart_settings(FILE *);
|
||||||
void read_restart_settings(FILE *);
|
void read_restart_settings(FILE *);
|
||||||
void single(int, int, int, int, double, double, double, int, One &);
|
void single(int, int, int, int, double, double, double, int, One &);
|
||||||
|
void *extract(char *);
|
||||||
void extract_long(double *);
|
|
||||||
|
|
||||||
private:
|
private:
|
||||||
double cut_lj_global;
|
double cut_lj_global;
|
||||||
|
|||||||
@ -262,11 +262,7 @@ void PairCoulLong::init_style()
|
|||||||
|
|
||||||
if (force->kspace == NULL)
|
if (force->kspace == NULL)
|
||||||
error->all("Pair style is incompatible with KSpace style");
|
error->all("Pair style is incompatible with KSpace style");
|
||||||
else if (strcmp(force->kspace_style,"ewald") == 0)
|
g_ewald = force->kspace->g_ewald;
|
||||||
g_ewald = force->kspace->g_ewald;
|
|
||||||
else if (strcmp(force->kspace_style,"pppm") == 0)
|
|
||||||
g_ewald = force->kspace->g_ewald;
|
|
||||||
else error->all("Pair style is incompatible with KSpace style");
|
|
||||||
|
|
||||||
// setup force tables
|
// setup force tables
|
||||||
|
|
||||||
@ -572,7 +568,8 @@ void PairCoulLong::single(int i, int j, int itype, int jtype,
|
|||||||
|
|
||||||
/* ---------------------------------------------------------------------- */
|
/* ---------------------------------------------------------------------- */
|
||||||
|
|
||||||
void PairCoulLong::extract_long(double *p_cut_coul)
|
void *PairCoulLong::extract(char *str)
|
||||||
{
|
{
|
||||||
*p_cut_coul = cut_coul;
|
if (strcmp(str,"cut_coul") == 0) return (void *) &cut_coul;
|
||||||
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -32,8 +32,7 @@ class PairCoulLong : public Pair {
|
|||||||
void write_restart_settings(FILE *);
|
void write_restart_settings(FILE *);
|
||||||
void read_restart_settings(FILE *);
|
void read_restart_settings(FILE *);
|
||||||
void single(int, int, int, int, double, double, double, int, One &);
|
void single(int, int, int, int, double, double, double, int, One &);
|
||||||
|
void *extract(char *);
|
||||||
void extract_long(double *);
|
|
||||||
|
|
||||||
private:
|
private:
|
||||||
double cut_coul,cut_coulsq;
|
double cut_coul,cut_coulsq;
|
||||||
|
|||||||
@ -52,6 +52,7 @@ PairLJCharmmCoulLong::PairLJCharmmCoulLong(LAMMPS *lmp) : Pair(lmp)
|
|||||||
{
|
{
|
||||||
respa_enable = 1;
|
respa_enable = 1;
|
||||||
ftable = NULL;
|
ftable = NULL;
|
||||||
|
implicit = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* ---------------------------------------------------------------------- */
|
/* ---------------------------------------------------------------------- */
|
||||||
@ -801,13 +802,7 @@ void PairLJCharmmCoulLong::init_style()
|
|||||||
|
|
||||||
if (force->kspace == NULL)
|
if (force->kspace == NULL)
|
||||||
error->all("Pair style is incompatible with KSpace style");
|
error->all("Pair style is incompatible with KSpace style");
|
||||||
else if (strcmp(force->kspace_style,"ewald") == 0)
|
g_ewald = force->kspace->g_ewald;
|
||||||
g_ewald = force->kspace->g_ewald;
|
|
||||||
else if (strcmp(force->kspace_style,"pppm") == 0)
|
|
||||||
g_ewald = force->kspace->g_ewald;
|
|
||||||
else if (strcmp(force->kspace_style,"pppm2") == 0)
|
|
||||||
g_ewald = force->kspace->g_ewald;
|
|
||||||
else error->all("Pair style is incompatible with KSpace style");
|
|
||||||
|
|
||||||
// setup force tables
|
// setup force tables
|
||||||
|
|
||||||
@ -1217,22 +1212,13 @@ void PairLJCharmmCoulLong::single(int i, int j, int itype, int jtype,
|
|||||||
|
|
||||||
/* ---------------------------------------------------------------------- */
|
/* ---------------------------------------------------------------------- */
|
||||||
|
|
||||||
void PairLJCharmmCoulLong::extract_charmm(double ***p_lj14_1,
|
void *PairLJCharmmCoulLong::extract(char *str)
|
||||||
double ***p_lj14_2,
|
|
||||||
double ***p_lj14_3,
|
|
||||||
double ***p_lj14_4,
|
|
||||||
int *p_implicit_flag)
|
|
||||||
{
|
{
|
||||||
*p_lj14_1 = lj14_1;
|
if (strcmp(str,"lj14_1") == 0) return (void *) lj14_1;
|
||||||
*p_lj14_2 = lj14_2;
|
else if (strcmp(str,"lj14_2") == 0) return (void *) lj14_2;
|
||||||
*p_lj14_3 = lj14_3;
|
else if (strcmp(str,"lj14_3") == 0) return (void *) lj14_3;
|
||||||
*p_lj14_4 = lj14_4;
|
else if (strcmp(str,"lj14_4") == 0) return (void *) lj14_4;
|
||||||
*p_implicit_flag = 0;
|
else if (strcmp(str,"implicit") == 0) return (void *) &implicit;
|
||||||
}
|
else if (strcmp(str,"cut_coul") == 0) return (void *) &cut_coul;
|
||||||
|
return NULL;
|
||||||
/* ---------------------------------------------------------------------- */
|
|
||||||
|
|
||||||
void PairLJCharmmCoulLong::extract_long(double *p_cut_coul)
|
|
||||||
{
|
|
||||||
*p_cut_coul = cut_coul;
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -37,10 +37,10 @@ class PairLJCharmmCoulLong : public Pair {
|
|||||||
void compute_inner();
|
void compute_inner();
|
||||||
void compute_middle();
|
void compute_middle();
|
||||||
void compute_outer(int, int);
|
void compute_outer(int, int);
|
||||||
void extract_charmm(double ***, double ***, double ***, double ***, int *);
|
void *extract(char *);
|
||||||
void extract_long(double *);
|
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
|
int implicit;
|
||||||
double cut_lj_inner,cut_lj;
|
double cut_lj_inner,cut_lj;
|
||||||
double cut_lj_innersq,cut_ljsq;
|
double cut_lj_innersq,cut_ljsq;
|
||||||
double cut_coul,cut_coulsq;
|
double cut_coul,cut_coulsq;
|
||||||
|
|||||||
@ -736,13 +736,9 @@ void PairLJCutCoulLong::init_style()
|
|||||||
|
|
||||||
// insure use of KSpace long-range solver, set g_ewald
|
// insure use of KSpace long-range solver, set g_ewald
|
||||||
|
|
||||||
if (force->kspace == NULL)
|
if (force->kspace == NULL)
|
||||||
error->all("Pair style is incompatible with KSpace style");
|
error->all("Pair style is incompatible with KSpace style");
|
||||||
else if (strcmp(force->kspace_style,"ewald") == 0)
|
g_ewald = force->kspace->g_ewald;
|
||||||
g_ewald = force->kspace->g_ewald;
|
|
||||||
else if (strcmp(force->kspace_style,"pppm") == 0)
|
|
||||||
g_ewald = force->kspace->g_ewald;
|
|
||||||
else error->all("Pair style is incompatible with KSpace style");
|
|
||||||
|
|
||||||
// setup force tables
|
// setup force tables
|
||||||
|
|
||||||
@ -1159,7 +1155,8 @@ void PairLJCutCoulLong::single(int i, int j, int itype, int jtype,
|
|||||||
|
|
||||||
/* ---------------------------------------------------------------------- */
|
/* ---------------------------------------------------------------------- */
|
||||||
|
|
||||||
void PairLJCutCoulLong::extract_long(double *p_cut_coul)
|
void *PairLJCutCoulLong::extract(char *str)
|
||||||
{
|
{
|
||||||
*p_cut_coul = cut_coul;
|
if (strcmp(str,"cut_coul") == 0) return (void *) &cut_coul;
|
||||||
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -37,7 +37,7 @@ class PairLJCutCoulLong : public Pair {
|
|||||||
void compute_inner();
|
void compute_inner();
|
||||||
void compute_middle();
|
void compute_middle();
|
||||||
void compute_outer(int, int);
|
void compute_outer(int, int);
|
||||||
void extract_long(double *);
|
void *extract(char *);
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
double cut_lj_global;
|
double cut_lj_global;
|
||||||
|
|||||||
@ -577,13 +577,12 @@ void PairLJCutCoulLongTIP4P::find_M(int i, int &iH1, int &iH2, double *xM)
|
|||||||
|
|
||||||
/* ---------------------------------------------------------------------- */
|
/* ---------------------------------------------------------------------- */
|
||||||
|
|
||||||
void PairLJCutCoulLongTIP4P::extract_tip4p(double *p_qdist,
|
void *PairLJCutCoulLongTIP4P::extract(char *str)
|
||||||
int *p_typeO, int *p_typeH,
|
|
||||||
int *p_typeA, int *p_typeB)
|
|
||||||
{
|
{
|
||||||
*p_qdist = qdist;
|
if (strcmp(str,"qdist") == 0) return (void *) &qdist;
|
||||||
*p_typeO = typeO;
|
else if (strcmp(str,"typeO") == 0) return (void *) &typeO;
|
||||||
*p_typeH = typeH;
|
else if (strcmp(str,"typeH") == 0) return (void *) &typeH;
|
||||||
*p_typeA = typeA;
|
else if (strcmp(str,"typeA") == 0) return (void *) &typeA;
|
||||||
*p_typeB = typeB;
|
else if (strcmp(str,"typeB") == 0) return (void *) &typeB;
|
||||||
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -26,8 +26,7 @@ class PairLJCutCoulLongTIP4P : public PairLJCutCoulLong {
|
|||||||
void init_style();
|
void init_style();
|
||||||
void write_restart_settings(FILE *fp);
|
void write_restart_settings(FILE *fp);
|
||||||
void read_restart_settings(FILE *fp);
|
void read_restart_settings(FILE *fp);
|
||||||
|
void *extract(char *);
|
||||||
void extract_tip4p(double *, int *, int *, int *, int *);
|
|
||||||
|
|
||||||
private:
|
private:
|
||||||
int typeH,typeO; // atom types of TIP4P water H and O atoms
|
int typeH,typeO; // atom types of TIP4P water H and O atoms
|
||||||
|
|||||||
@ -129,29 +129,37 @@ void PPPM::init()
|
|||||||
|
|
||||||
deallocate();
|
deallocate();
|
||||||
|
|
||||||
// insure use of long (or table) pair_style with long-range Coulombics
|
// extract short-range Coulombic cutoff from pair style
|
||||||
// set cutoff to Pair's short-range Coulombic cutoff
|
|
||||||
|
|
||||||
qqrd2e = force->qqrd2e;
|
qqrd2e = force->qqrd2e;
|
||||||
|
|
||||||
Pair *pair = force->pair_match("long");
|
if (force->pair == NULL)
|
||||||
if (pair == NULL) pair = force->pair_match("table");
|
error->all("KSpace style is incompatible with Pair style");
|
||||||
if (pair == NULL) error->all("KSpace style is incompatible with Pair style");
|
double *p_cutoff = (double *) force->pair->extract("cut_coul");
|
||||||
pair->extract_long(&cutoff);
|
if (p_cutoff == NULL)
|
||||||
|
error->all("KSpace style is incompatible with Pair style");
|
||||||
|
cutoff = *p_cutoff;
|
||||||
|
|
||||||
// insure use of TIP4P pair_style with TIP4P long-range Coulombics
|
// if kspace is TIP4P, extract TIP4P params from pair style
|
||||||
// set TIP4P params from Pair's params
|
|
||||||
|
|
||||||
qdist = 0.0;
|
qdist = 0.0;
|
||||||
|
|
||||||
pair = force->pair_match("tip4p");
|
if (strcmp(force->kspace_style,"pppm/tip4p") == 0) {
|
||||||
if (strcmp(force->kspace_style,"pppm/tip4p") != 0 && pair != NULL)
|
if (force->pair == NULL)
|
||||||
error->all("KSpace style is incompatible with Pair style");
|
error->all("KSpace style is incompatible with Pair style");
|
||||||
if (strcmp(force->kspace_style,"pppm/tip4p") == 0 && pair == NULL)
|
double *p_qdist = (double *) force->pair->extract("qdist");
|
||||||
error->all("KSpace style is incompatible with Pair style");
|
int *p_typeO = (int *) force->pair->extract("typeO");
|
||||||
if (pair) {
|
int *p_typeH = (int *) force->pair->extract("typeH");
|
||||||
int typeA,typeB;
|
int *p_typeA = (int *) force->pair->extract("typeA");
|
||||||
pair->extract_tip4p(&qdist,&typeO,&typeH,&typeA,&typeB);
|
int *p_typeB = (int *) force->pair->extract("typeB");
|
||||||
|
if (!p_qdist || !p_typeO || !p_typeH || !p_typeA || !p_typeB)
|
||||||
|
error->all("KSpace style is incompatible with Pair style");
|
||||||
|
qdist = *p_qdist;
|
||||||
|
typeO = *p_typeO;
|
||||||
|
typeH = *p_typeH;
|
||||||
|
int typeA = *p_typeA;
|
||||||
|
int typeB = *p_typeB;
|
||||||
|
|
||||||
if (force->angle == NULL || force->bond == NULL)
|
if (force->angle == NULL || force->bond == NULL)
|
||||||
error->all("Bond and angle potentials must be defined for TIP4P");
|
error->all("Bond and angle potentials must be defined for TIP4P");
|
||||||
double theta = force->angle->equilibrium_angle(typeA);
|
double theta = force->angle->equilibrium_angle(typeA);
|
||||||
@ -1881,9 +1889,9 @@ void PPPM::timing(int n, double &time3d, double &time1d)
|
|||||||
memory usage of local arrays
|
memory usage of local arrays
|
||||||
------------------------------------------------------------------------- */
|
------------------------------------------------------------------------- */
|
||||||
|
|
||||||
int PPPM::memory_usage()
|
double PPPM::memory_usage()
|
||||||
{
|
{
|
||||||
int bytes = nmax*3 * sizeof(double);
|
double bytes = nmax*3 * sizeof(double);
|
||||||
int nbrick = (nxhi_out-nxlo_out+1) * (nyhi_out-nylo_out+1) *
|
int nbrick = (nxhi_out-nxlo_out+1) * (nyhi_out-nylo_out+1) *
|
||||||
(nzhi_out-nzlo_out+1);
|
(nzhi_out-nzlo_out+1);
|
||||||
bytes += 4 * nbrick * sizeof(double);
|
bytes += 4 * nbrick * sizeof(double);
|
||||||
|
|||||||
@ -26,7 +26,7 @@ class PPPM : public KSpace {
|
|||||||
void setup();
|
void setup();
|
||||||
void compute(int, int);
|
void compute(int, int);
|
||||||
void timing(int, double &, double &);
|
void timing(int, double &, double &);
|
||||||
int memory_usage();
|
double memory_usage();
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
int me,nprocs;
|
int me,nprocs;
|
||||||
|
|||||||
@ -870,9 +870,9 @@ void PairEAM::unpack_reverse_comm(int n, int *list, double *buf)
|
|||||||
memory usage of local atom-based arrays
|
memory usage of local atom-based arrays
|
||||||
------------------------------------------------------------------------- */
|
------------------------------------------------------------------------- */
|
||||||
|
|
||||||
int PairEAM::memory_usage()
|
double PairEAM::memory_usage()
|
||||||
{
|
{
|
||||||
int bytes = 2 * nmax * sizeof(double);
|
double bytes = 2 * nmax * sizeof(double);
|
||||||
return bytes;
|
return bytes;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -880,7 +880,7 @@ int PairEAM::memory_usage()
|
|||||||
swap fp array with one passed in by caller
|
swap fp array with one passed in by caller
|
||||||
------------------------------------------------------------------------- */
|
------------------------------------------------------------------------- */
|
||||||
|
|
||||||
void PairEAM::extract_eam(double *fp_caller, double **fp_caller_hold)
|
void PairEAM::swap_eam(double *fp_caller, double **fp_caller_hold)
|
||||||
{
|
{
|
||||||
double *tmp = fp;
|
double *tmp = fp;
|
||||||
fp = fp_caller;
|
fp = fp_caller;
|
||||||
|
|||||||
@ -35,9 +35,8 @@ class PairEAM : public Pair {
|
|||||||
void unpack_comm(int, int, double *);
|
void unpack_comm(int, int, double *);
|
||||||
int pack_reverse_comm(int, int, double *);
|
int pack_reverse_comm(int, int, double *);
|
||||||
void unpack_reverse_comm(int, int *, double *);
|
void unpack_reverse_comm(int, int *, double *);
|
||||||
int memory_usage();
|
double memory_usage();
|
||||||
|
void swap_eam(double *, double **);
|
||||||
void extract_eam(double *, double **);
|
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
double cutforcesq,cutmax;
|
double cutforcesq,cutmax;
|
||||||
|
|||||||
@ -251,9 +251,9 @@ double AngleHybrid::single(int type, int i1, int i2, int i3)
|
|||||||
memory usage
|
memory usage
|
||||||
------------------------------------------------------------------------- */
|
------------------------------------------------------------------------- */
|
||||||
|
|
||||||
int AngleHybrid::memory_usage()
|
double AngleHybrid::memory_usage()
|
||||||
{
|
{
|
||||||
int bytes = 0;
|
double bytes = 0.0;
|
||||||
for (int m = 0; m < nstyles; m++) bytes += maxangle[m]*4 * sizeof(int);
|
for (int m = 0; m < nstyles; m++) bytes += maxangle[m]*4 * sizeof(int);
|
||||||
for (int m = 0; m < nstyles; m++)
|
for (int m = 0; m < nstyles; m++)
|
||||||
if (styles[m]) bytes += styles[m]->memory_usage();
|
if (styles[m]) bytes += styles[m]->memory_usage();
|
||||||
|
|||||||
@ -30,7 +30,7 @@ class AngleHybrid : public Angle {
|
|||||||
void write_restart(FILE *);
|
void write_restart(FILE *);
|
||||||
void read_restart(FILE *);
|
void read_restart(FILE *);
|
||||||
double single(int, int, int, int);
|
double single(int, int, int, int);
|
||||||
int memory_usage();
|
double memory_usage();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
int nstyles; // # of different angle styles
|
int nstyles; // # of different angle styles
|
||||||
|
|||||||
@ -631,9 +631,9 @@ int AtomVecAngle::data_atom_hybrid(int nlocal, char **values)
|
|||||||
return # of bytes of allocated memory
|
return # of bytes of allocated memory
|
||||||
------------------------------------------------------------------------- */
|
------------------------------------------------------------------------- */
|
||||||
|
|
||||||
int AtomVecAngle::memory_usage()
|
double AtomVecAngle::memory_usage()
|
||||||
{
|
{
|
||||||
int bytes = 0;
|
double bytes = 0.0;
|
||||||
|
|
||||||
if (atom->memcheck("tag")) bytes += nmax * sizeof(int);
|
if (atom->memcheck("tag")) bytes += nmax * sizeof(int);
|
||||||
if (atom->memcheck("type")) bytes += nmax * sizeof(int);
|
if (atom->memcheck("type")) bytes += nmax * sizeof(int);
|
||||||
|
|||||||
@ -40,7 +40,7 @@ class AtomVecAngle : public AtomVec {
|
|||||||
void create_atom(int, double *);
|
void create_atom(int, double *);
|
||||||
void data_atom(double *, int, char **);
|
void data_atom(double *, int, char **);
|
||||||
int data_atom_hybrid(int, char **);
|
int data_atom_hybrid(int, char **);
|
||||||
int memory_usage();
|
double memory_usage();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
int *tag,*type,*mask,*image;
|
int *tag,*type,*mask,*image;
|
||||||
|
|||||||
@ -572,9 +572,9 @@ int AtomVecBond::data_atom_hybrid(int nlocal, char **values)
|
|||||||
return # of bytes of allocated memory
|
return # of bytes of allocated memory
|
||||||
------------------------------------------------------------------------- */
|
------------------------------------------------------------------------- */
|
||||||
|
|
||||||
int AtomVecBond::memory_usage()
|
double AtomVecBond::memory_usage()
|
||||||
{
|
{
|
||||||
int bytes = 0;
|
double bytes = 0.0;
|
||||||
|
|
||||||
if (atom->memcheck("tag")) bytes += nmax * sizeof(int);
|
if (atom->memcheck("tag")) bytes += nmax * sizeof(int);
|
||||||
if (atom->memcheck("type")) bytes += nmax * sizeof(int);
|
if (atom->memcheck("type")) bytes += nmax * sizeof(int);
|
||||||
|
|||||||
@ -40,7 +40,7 @@ class AtomVecBond : public AtomVec {
|
|||||||
void create_atom(int, double *);
|
void create_atom(int, double *);
|
||||||
void data_atom(double *, int, char **);
|
void data_atom(double *, int, char **);
|
||||||
int data_atom_hybrid(int, char **);
|
int data_atom_hybrid(int, char **);
|
||||||
int memory_usage();
|
double memory_usage();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
int *tag,*type,*mask,*image;
|
int *tag,*type,*mask,*image;
|
||||||
|
|||||||
@ -782,9 +782,9 @@ int AtomVecFull::data_atom_hybrid(int nlocal, char **values)
|
|||||||
return # of bytes of allocated memory
|
return # of bytes of allocated memory
|
||||||
------------------------------------------------------------------------- */
|
------------------------------------------------------------------------- */
|
||||||
|
|
||||||
int AtomVecFull::memory_usage()
|
double AtomVecFull::memory_usage()
|
||||||
{
|
{
|
||||||
int bytes = 0;
|
double bytes = 0.0;
|
||||||
|
|
||||||
if (atom->memcheck("tag")) bytes += nmax * sizeof(int);
|
if (atom->memcheck("tag")) bytes += nmax * sizeof(int);
|
||||||
if (atom->memcheck("type")) bytes += nmax * sizeof(int);
|
if (atom->memcheck("type")) bytes += nmax * sizeof(int);
|
||||||
|
|||||||
@ -40,7 +40,7 @@ class AtomVecFull : public AtomVec {
|
|||||||
void create_atom(int, double *);
|
void create_atom(int, double *);
|
||||||
void data_atom(double *, int, char **);
|
void data_atom(double *, int, char **);
|
||||||
int data_atom_hybrid(int, char **);
|
int data_atom_hybrid(int, char **);
|
||||||
int memory_usage();
|
double memory_usage();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
int *tag,*type,*mask,*image;
|
int *tag,*type,*mask,*image;
|
||||||
|
|||||||
@ -766,9 +766,9 @@ int AtomVecMolecular::data_atom_hybrid(int nlocal, char **values)
|
|||||||
return # of bytes of allocated memory
|
return # of bytes of allocated memory
|
||||||
------------------------------------------------------------------------- */
|
------------------------------------------------------------------------- */
|
||||||
|
|
||||||
int AtomVecMolecular::memory_usage()
|
double AtomVecMolecular::memory_usage()
|
||||||
{
|
{
|
||||||
int bytes = 0;
|
double bytes = 0.0;
|
||||||
|
|
||||||
if (atom->memcheck("tag")) bytes += nmax * sizeof(int);
|
if (atom->memcheck("tag")) bytes += nmax * sizeof(int);
|
||||||
if (atom->memcheck("type")) bytes += nmax * sizeof(int);
|
if (atom->memcheck("type")) bytes += nmax * sizeof(int);
|
||||||
|
|||||||
@ -40,7 +40,7 @@ class AtomVecMolecular : public AtomVec {
|
|||||||
void create_atom(int, double *);
|
void create_atom(int, double *);
|
||||||
void data_atom(double *, int, char **);
|
void data_atom(double *, int, char **);
|
||||||
int data_atom_hybrid(int, char **);
|
int data_atom_hybrid(int, char **);
|
||||||
int memory_usage();
|
double memory_usage();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
int *tag,*type,*mask,*image;
|
int *tag,*type,*mask,*image;
|
||||||
|
|||||||
@ -261,9 +261,9 @@ void BondHybrid::single(int type, double rsq, int i, int j,
|
|||||||
memory usage
|
memory usage
|
||||||
------------------------------------------------------------------------- */
|
------------------------------------------------------------------------- */
|
||||||
|
|
||||||
int BondHybrid::memory_usage()
|
double BondHybrid::memory_usage()
|
||||||
{
|
{
|
||||||
int bytes = 0;
|
double bytes = 0.0;
|
||||||
for (int m = 0; m < nstyles; m++) bytes += maxbond[m]*3 * sizeof(int);
|
for (int m = 0; m < nstyles; m++) bytes += maxbond[m]*3 * sizeof(int);
|
||||||
for (int m = 0; m < nstyles; m++)
|
for (int m = 0; m < nstyles; m++)
|
||||||
if (styles[m]) bytes += styles[m]->memory_usage();
|
if (styles[m]) bytes += styles[m]->memory_usage();
|
||||||
|
|||||||
@ -275,7 +275,7 @@ void DihedralCharmm::compute(int eflag, int vflag)
|
|||||||
r2inv = 1.0/rsq;
|
r2inv = 1.0/rsq;
|
||||||
r6inv = r2inv*r2inv*r2inv;
|
r6inv = r2inv*r2inv*r2inv;
|
||||||
|
|
||||||
if (implicit_flag) forcecoul = qqrd2e * q[i1]*q[i4]*r2inv;
|
if (implicit) forcecoul = qqrd2e * q[i1]*q[i4]*r2inv;
|
||||||
else forcecoul = qqrd2e * q[i1]*q[i4]*sqrt(r2inv);
|
else forcecoul = qqrd2e * q[i1]*q[i4]*sqrt(r2inv);
|
||||||
forcelj = r6inv * (lj14_1[itype][jtype]*r6inv - lj14_2[itype][jtype]);
|
forcelj = r6inv * (lj14_1[itype][jtype]*r6inv - lj14_2[itype][jtype]);
|
||||||
fforce = weight[type] * (forcelj+forcecoul)*r2inv;
|
fforce = weight[type] * (forcelj+forcecoul)*r2inv;
|
||||||
@ -391,10 +391,16 @@ void DihedralCharmm::init_style()
|
|||||||
if (weight[i] > 0.0) weightflag = 1;
|
if (weight[i] > 0.0) weightflag = 1;
|
||||||
|
|
||||||
if (weightflag) {
|
if (weightflag) {
|
||||||
Pair *pair = force->pair_match("charmm");
|
if (force->pair == NULL)
|
||||||
if (pair == NULL)
|
|
||||||
error->all("Dihedral charmm is incompatible with Pair style");
|
error->all("Dihedral charmm is incompatible with Pair style");
|
||||||
pair->extract_charmm(&lj14_1,&lj14_2,&lj14_3,&lj14_4,&implicit_flag);
|
lj14_1 = (double **) force->pair->extract("lj14_1");
|
||||||
|
lj14_2 = (double **) force->pair->extract("lj14_2");
|
||||||
|
lj14_3 = (double **) force->pair->extract("lj14_3");
|
||||||
|
lj14_4 = (double **) force->pair->extract("lj14_4");
|
||||||
|
int *ptr = (int *) force->pair->extract("implicit");
|
||||||
|
if (!lj14_1 || !lj14_2 || !lj14_3 || !lj14_4 || !ptr)
|
||||||
|
error->all("Dihedral charmm is incompatible with Pair style");
|
||||||
|
implicit = *ptr;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -33,7 +33,7 @@ class DihedralCharmm : public Dihedral {
|
|||||||
double *k,*weight,*cos_shift,*sin_shift;
|
double *k,*weight,*cos_shift,*sin_shift;
|
||||||
int *multiplicity,*shift;
|
int *multiplicity,*shift;
|
||||||
double **lj14_1,**lj14_2,**lj14_3,**lj14_4;
|
double **lj14_1,**lj14_2,**lj14_3,**lj14_4;
|
||||||
int implicit_flag;
|
int implicit;
|
||||||
|
|
||||||
void allocate();
|
void allocate();
|
||||||
};
|
};
|
||||||
|
|||||||
@ -248,9 +248,9 @@ void DihedralHybrid::read_restart(FILE *fp)
|
|||||||
memory usage
|
memory usage
|
||||||
------------------------------------------------------------------------- */
|
------------------------------------------------------------------------- */
|
||||||
|
|
||||||
int DihedralHybrid::memory_usage()
|
double DihedralHybrid::memory_usage()
|
||||||
{
|
{
|
||||||
int bytes = 0;
|
double bytes = 0.0;
|
||||||
for (int m = 0; m < nstyles; m++) bytes += maxdihedral[m]*5 * sizeof(int);
|
for (int m = 0; m < nstyles; m++) bytes += maxdihedral[m]*5 * sizeof(int);
|
||||||
for (int m = 0; m < nstyles; m++)
|
for (int m = 0; m < nstyles; m++)
|
||||||
if (styles[m]) bytes += styles[m]->memory_usage();
|
if (styles[m]) bytes += styles[m]->memory_usage();
|
||||||
|
|||||||
@ -29,7 +29,7 @@ class DihedralHybrid : public Dihedral {
|
|||||||
void init_style();
|
void init_style();
|
||||||
void write_restart(FILE *);
|
void write_restart(FILE *);
|
||||||
void read_restart(FILE *);
|
void read_restart(FILE *);
|
||||||
int memory_usage();
|
double memory_usage();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
int nstyles; // # of different dihedral styles
|
int nstyles; // # of different dihedral styles
|
||||||
|
|||||||
@ -235,9 +235,9 @@ void ImproperHybrid::read_restart(FILE *fp)
|
|||||||
memory usage
|
memory usage
|
||||||
------------------------------------------------------------------------- */
|
------------------------------------------------------------------------- */
|
||||||
|
|
||||||
int ImproperHybrid::memory_usage()
|
double ImproperHybrid::memory_usage()
|
||||||
{
|
{
|
||||||
int bytes = 0;
|
double bytes = 0.0;
|
||||||
for (int m = 0; m < nstyles; m++) bytes += maximproper[m]*5 * sizeof(int);
|
for (int m = 0; m < nstyles; m++) bytes += maximproper[m]*5 * sizeof(int);
|
||||||
for (int m = 0; m < nstyles; m++)
|
for (int m = 0; m < nstyles; m++)
|
||||||
if (styles[m]) bytes += styles[m]->memory_usage();
|
if (styles[m]) bytes += styles[m]->memory_usage();
|
||||||
|
|||||||
@ -28,7 +28,7 @@ class ImproperHybrid : public Improper {
|
|||||||
void coeff(int, int, char **);
|
void coeff(int, int, char **);
|
||||||
void write_restart(FILE *);
|
void write_restart(FILE *);
|
||||||
void read_restart(FILE *);
|
void read_restart(FILE *);
|
||||||
int memory_usage();
|
double memory_usage();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
int nstyles; // # of different improper styles
|
int nstyles; // # of different improper styles
|
||||||
|
|||||||
@ -18,6 +18,7 @@
|
|||||||
#include "math.h"
|
#include "math.h"
|
||||||
#include "stdio.h"
|
#include "stdio.h"
|
||||||
#include "stdlib.h"
|
#include "stdlib.h"
|
||||||
|
#include "string.h"
|
||||||
#include "pair_lj_charmm_coul_charmm.h"
|
#include "pair_lj_charmm_coul_charmm.h"
|
||||||
#include "atom.h"
|
#include "atom.h"
|
||||||
#include "comm.h"
|
#include "comm.h"
|
||||||
@ -34,7 +35,10 @@ using namespace LAMMPS_NS;
|
|||||||
|
|
||||||
/* ---------------------------------------------------------------------- */
|
/* ---------------------------------------------------------------------- */
|
||||||
|
|
||||||
PairLJCharmmCoulCharmm::PairLJCharmmCoulCharmm(LAMMPS *lmp) : Pair(lmp) {}
|
PairLJCharmmCoulCharmm::PairLJCharmmCoulCharmm(LAMMPS *lmp) : Pair(lmp)
|
||||||
|
{
|
||||||
|
implicit = 0;
|
||||||
|
}
|
||||||
|
|
||||||
/* ---------------------------------------------------------------------- */
|
/* ---------------------------------------------------------------------- */
|
||||||
|
|
||||||
@ -496,15 +500,12 @@ void PairLJCharmmCoulCharmm::single(int i, int j, int itype, int jtype,
|
|||||||
|
|
||||||
/* ---------------------------------------------------------------------- */
|
/* ---------------------------------------------------------------------- */
|
||||||
|
|
||||||
void PairLJCharmmCoulCharmm::extract_charmm(double ***p_lj14_1,
|
void *PairLJCharmmCoulCharmm::extract(char *str)
|
||||||
double ***p_lj14_2,
|
|
||||||
double ***p_lj14_3,
|
|
||||||
double ***p_lj14_4,
|
|
||||||
int *p_implicit_flag)
|
|
||||||
{
|
{
|
||||||
*p_lj14_1 = lj14_1;
|
if (strcmp(str,"lj14_1") == 0) return (void *) lj14_1;
|
||||||
*p_lj14_2 = lj14_2;
|
else if (strcmp(str,"lj14_2") == 0) return (void *) lj14_2;
|
||||||
*p_lj14_3 = lj14_3;
|
else if (strcmp(str,"lj14_3") == 0) return (void *) lj14_3;
|
||||||
*p_lj14_4 = lj14_4;
|
else if (strcmp(str,"lj14_4") == 0) return (void *) lj14_4;
|
||||||
*p_implicit_flag = 0;
|
else if (strcmp(str,"implicit") == 0) return (void *) &implicit;
|
||||||
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -32,11 +32,10 @@ class PairLJCharmmCoulCharmm : public Pair {
|
|||||||
void write_restart_settings(FILE *);
|
void write_restart_settings(FILE *);
|
||||||
void read_restart_settings(FILE *);
|
void read_restart_settings(FILE *);
|
||||||
virtual void single(int, int, int, int, double, double, double, int, One &);
|
virtual void single(int, int, int, int, double, double, double, int, One &);
|
||||||
|
virtual void *extract(char *);
|
||||||
virtual void extract_charmm(double ***, double ***,
|
|
||||||
double ***, double ***, int *);
|
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
|
int implicit;
|
||||||
double cut_lj_inner,cut_lj,cut_coul_inner,cut_coul;
|
double cut_lj_inner,cut_lj,cut_coul_inner,cut_coul;
|
||||||
double cut_lj_innersq,cut_ljsq,cut_coul_innersq,cut_coulsq,cut_bothsq;
|
double cut_lj_innersq,cut_ljsq,cut_coul_innersq,cut_coulsq,cut_bothsq;
|
||||||
double denom_lj,denom_coul;
|
double denom_lj,denom_coul;
|
||||||
|
|||||||
@ -12,6 +12,7 @@
|
|||||||
------------------------------------------------------------------------- */
|
------------------------------------------------------------------------- */
|
||||||
|
|
||||||
#include "math.h"
|
#include "math.h"
|
||||||
|
#include "string.h"
|
||||||
#include "pair_lj_charmm_coul_charmm_implicit.h"
|
#include "pair_lj_charmm_coul_charmm_implicit.h"
|
||||||
#include "atom.h"
|
#include "atom.h"
|
||||||
#include "force.h"
|
#include "force.h"
|
||||||
@ -22,7 +23,10 @@ using namespace LAMMPS_NS;
|
|||||||
/* ---------------------------------------------------------------------- */
|
/* ---------------------------------------------------------------------- */
|
||||||
|
|
||||||
PairLJCharmmCoulCharmmImplicit::PairLJCharmmCoulCharmmImplicit(LAMMPS *lmp) :
|
PairLJCharmmCoulCharmmImplicit::PairLJCharmmCoulCharmmImplicit(LAMMPS *lmp) :
|
||||||
PairLJCharmmCoulCharmm(lmp) {}
|
PairLJCharmmCoulCharmm(lmp)
|
||||||
|
{
|
||||||
|
implicit = 1;
|
||||||
|
}
|
||||||
|
|
||||||
/* ---------------------------------------------------------------------- */
|
/* ---------------------------------------------------------------------- */
|
||||||
|
|
||||||
@ -217,15 +221,12 @@ void PairLJCharmmCoulCharmmImplicit::single(int i, int j, int itype, int jtype,
|
|||||||
|
|
||||||
/* ---------------------------------------------------------------------- */
|
/* ---------------------------------------------------------------------- */
|
||||||
|
|
||||||
void PairLJCharmmCoulCharmmImplicit::extract_charmm(double ***p_lj14_1,
|
void *PairLJCharmmCoulCharmmImplicit::extract(char *str)
|
||||||
double ***p_lj14_2,
|
|
||||||
double ***p_lj14_3,
|
|
||||||
double ***p_lj14_4,
|
|
||||||
int *p_implicit_flag)
|
|
||||||
{
|
{
|
||||||
*p_lj14_1 = lj14_1;
|
if (strcmp(str,"lj14_1") == 0) return (void *) lj14_1;
|
||||||
*p_lj14_2 = lj14_2;
|
else if (strcmp(str,"lj14_2") == 0) return (void *) lj14_2;
|
||||||
*p_lj14_3 = lj14_3;
|
else if (strcmp(str,"lj14_3") == 0) return (void *) lj14_3;
|
||||||
*p_lj14_4 = lj14_4;
|
else if (strcmp(str,"lj14_4") == 0) return (void *) lj14_4;
|
||||||
*p_implicit_flag = 1;
|
else if (strcmp(str,"implicit") == 0) return (void *) &implicit;
|
||||||
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -23,8 +23,7 @@ class PairLJCharmmCoulCharmmImplicit : public PairLJCharmmCoulCharmm {
|
|||||||
PairLJCharmmCoulCharmmImplicit(class LAMMPS *);
|
PairLJCharmmCoulCharmmImplicit(class LAMMPS *);
|
||||||
void compute(int, int);
|
void compute(int, int);
|
||||||
void single(int, int, int, int, double, double, double, int, One &);
|
void single(int, int, int, int, double, double, double, int, One &);
|
||||||
|
void *extract(char *);
|
||||||
void extract_charmm(double ***, double ***, double ***, double ***, int *);
|
|
||||||
};
|
};
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -15,17 +15,6 @@
|
|||||||
Contributing author: Pieter J. in 't Veld (SNL)
|
Contributing author: Pieter J. in 't Veld (SNL)
|
||||||
------------------------------------------------------------------------- */
|
------------------------------------------------------------------------- */
|
||||||
|
|
||||||
/* ----------------------------------------------------------------------
|
|
||||||
module: ewald_n.cpp
|
|
||||||
author: Pieter J. in 't Veld for SNL
|
|
||||||
date: September 13, 2006.
|
|
||||||
usage: kspace ewald/n precision
|
|
||||||
precision set precision of all orders
|
|
||||||
remarks: - cut off and precision are assumed identical for all orders
|
|
||||||
- coulombics from Macromolecules 1989, 93, 7320
|
|
||||||
- dipoles from J. Chem. Phys. 2000, 113, 10913
|
|
||||||
* ---------------------------------------------------------------------- */
|
|
||||||
|
|
||||||
#include "mpi.h"
|
#include "mpi.h"
|
||||||
#include "string.h"
|
#include "string.h"
|
||||||
#include "stdio.h"
|
#include "stdio.h"
|
||||||
@ -78,9 +67,10 @@ EwaldN::~EwaldN()
|
|||||||
|
|
||||||
void EwaldN::init()
|
void EwaldN::init()
|
||||||
{
|
{
|
||||||
nkvec = nkvec_max = nevec = nevec_max = bytes = 0;
|
nkvec = nkvec_max = nevec = nevec_max = 0;
|
||||||
nfunctions = nsums = sums = 0;
|
nfunctions = nsums = sums = 0;
|
||||||
nbox = -1;
|
nbox = -1;
|
||||||
|
bytes = 0.0;
|
||||||
|
|
||||||
if (!comm->me) { // output message
|
if (!comm->me) { // output message
|
||||||
if (screen) fprintf(screen,"EwaldN initialization ...\n");
|
if (screen) fprintf(screen,"EwaldN initialization ...\n");
|
||||||
@ -103,11 +93,12 @@ void EwaldN::init()
|
|||||||
mumurd2e = dielectric = 1.0;
|
mumurd2e = dielectric = 1.0;
|
||||||
|
|
||||||
Pair *pair = force->pair;
|
Pair *pair = force->pair;
|
||||||
void *ptr = pair ? pair->extract_ptr("ewald_order") : NULL;
|
int *ptr = pair ? (int *) pair->extract("ewald_order") : NULL;
|
||||||
if (!ptr) error->all("KSpace style is incompatible with Pair style");
|
double *cutoff = pair ? (double *) pair->extract("cut_coul") : NULL;
|
||||||
int ewald_order = *((int *) ptr);
|
if (!(ptr||cutoff))
|
||||||
int ewald_mix = *((int *) pair->extract_ptr("ewald_mix"));
|
error->all("KSpace style is incompatible with Pair style");
|
||||||
double cutoff = *((double *) pair->extract_ptr("ewald_cut"));
|
int ewald_order = ptr ? *((int *) ptr) : 1<<1;
|
||||||
|
int ewald_mix = ptr ? *((int *) pair->extract("ewald_mix")) : GEOMETRIC;
|
||||||
memset(function, 0, EWALD_NFUNCS*sizeof(int));
|
memset(function, 0, EWALD_NFUNCS*sizeof(int));
|
||||||
for (int i=0; i<=EWALD_NORDER; ++i) // transcribe order
|
for (int i=0; i<=EWALD_NORDER; ++i) // transcribe order
|
||||||
if (ewald_order&(1<<i)) { // from pair_style
|
if (ewald_order&(1<<i)) { // from pair_style
|
||||||
@ -131,7 +122,7 @@ void EwaldN::init()
|
|||||||
nsums += n[k];
|
nsums += n[k];
|
||||||
}
|
}
|
||||||
|
|
||||||
g_ewald = (1.35 - 0.15*log(precision))/cutoff; // determine resolution
|
g_ewald = (1.35 - 0.15*log(precision))/ *cutoff; // determine resolution
|
||||||
g2_max = -4.0*g_ewald*g_ewald*log(precision);
|
g2_max = -4.0*g_ewald*g_ewald*log(precision);
|
||||||
|
|
||||||
if (!comm->me) { // output results
|
if (!comm->me) { // output results
|
||||||
@ -305,15 +296,15 @@ void EwaldN::init_coeffs() // local pair coeffs
|
|||||||
int n = atom->ntypes;
|
int n = atom->ntypes;
|
||||||
|
|
||||||
if (function[1]) { // geometric 1/r^6
|
if (function[1]) { // geometric 1/r^6
|
||||||
double **b = (double **) force->pair->extract_ptr("B");
|
double **b = (double **) force->pair->extract("B");
|
||||||
delete [] B;
|
delete [] B;
|
||||||
B = new double[n+1];
|
B = new double[n+1];
|
||||||
bytes += (n+1)*sizeof(double);
|
bytes += (n+1)*sizeof(double);
|
||||||
for (int i=0; i<=n; ++i) B[i] = sqrt(fabs(b[i][i]));
|
for (int i=0; i<=n; ++i) B[i] = sqrt(fabs(b[i][i]));
|
||||||
}
|
}
|
||||||
if (function[2]) { // arithmetic 1/r^6
|
if (function[2]) { // arithmetic 1/r^6
|
||||||
double **epsilon = (double **) force->pair->extract_ptr("epsilon");
|
double **epsilon = (double **) force->pair->extract("epsilon");
|
||||||
double **sigma = (double **) force->pair->extract_ptr("sigma");
|
double **sigma = (double **) force->pair->extract("sigma");
|
||||||
if (!(epsilon&&sigma))
|
if (!(epsilon&&sigma))
|
||||||
error->all("epsilon or sigma reference not set by pair style in ewald/n");
|
error->all("epsilon or sigma reference not set by pair style in ewald/n");
|
||||||
double eps_i, sigma_i, sigma_n, *bi = B = new double[7*n+7];
|
double eps_i, sigma_i, sigma_n, *bi = B = new double[7*n+7];
|
||||||
|
|||||||
@ -35,14 +35,15 @@ class EwaldN : public KSpace {
|
|||||||
void init();
|
void init();
|
||||||
void setup();
|
void setup();
|
||||||
void compute(int, int);
|
void compute(int, int);
|
||||||
int memory_usage() { return bytes; }
|
double memory_usage() {return bytes;}
|
||||||
|
|
||||||
private:
|
private:
|
||||||
double unit[6];
|
double unit[6];
|
||||||
int function[EWALD_NFUNCS], first_output;
|
int function[EWALD_NFUNCS], first_output;
|
||||||
|
|
||||||
int nkvec, nkvec_max, nevec, nevec_max,
|
int nkvec, nkvec_max, nevec, nevec_max,
|
||||||
nbox, nfunctions, nsums, bytes, sums;
|
nbox, nfunctions, nsums, sums;
|
||||||
|
double bytes;
|
||||||
double precision, g2_max;
|
double precision, g2_max;
|
||||||
double *kenergy, energy_self[EWALD_NFUNCS];
|
double *kenergy, energy_self[EWALD_NFUNCS];
|
||||||
double *kvirial, virial_self[EWALD_NFUNCS];
|
double *kvirial, virial_self[EWALD_NFUNCS];
|
||||||
|
|||||||
@ -15,21 +15,6 @@
|
|||||||
Contributing author: Pieter J. in 't Veld (SNL)
|
Contributing author: Pieter J. in 't Veld (SNL)
|
||||||
------------------------------------------------------------------------- */
|
------------------------------------------------------------------------- */
|
||||||
|
|
||||||
/* ----------------------------------------------------------------------
|
|
||||||
module: pair_buck_coul.cpp
|
|
||||||
author: Pieter J. in 't Veld for SNL
|
|
||||||
date: October 2, 2006.
|
|
||||||
purpose: definition of short and long range buckingham and coulombic
|
|
||||||
pair potentials.
|
|
||||||
usage: pair_style buck/coul
|
|
||||||
long|cut|off control r^-6 contribution
|
|
||||||
long|cut|off control r^-1 contribution
|
|
||||||
rcut6 set r^-6 cut off
|
|
||||||
[rcut1] set r^-1 cut off
|
|
||||||
remarks: rcut1 cannot be set when both contributions are set to long,
|
|
||||||
rcut1 = rcut6 when ommited.
|
|
||||||
* ---------------------------------------------------------------------- */
|
|
||||||
|
|
||||||
#include "math.h"
|
#include "math.h"
|
||||||
#include "stdio.h"
|
#include "stdio.h"
|
||||||
#include "stdlib.h"
|
#include "stdlib.h"
|
||||||
@ -40,6 +25,7 @@
|
|||||||
#include "comm.h"
|
#include "comm.h"
|
||||||
#include "neighbor.h"
|
#include "neighbor.h"
|
||||||
#include "neigh_list.h"
|
#include "neigh_list.h"
|
||||||
|
#include "neigh_request.h"
|
||||||
#include "force.h"
|
#include "force.h"
|
||||||
#include "kspace.h"
|
#include "kspace.h"
|
||||||
#include "update.h"
|
#include "update.h"
|
||||||
@ -184,25 +170,19 @@ void PairBuckCoul::allocate()
|
|||||||
extract protected data from object
|
extract protected data from object
|
||||||
------------------------------------------------------------------------- */
|
------------------------------------------------------------------------- */
|
||||||
|
|
||||||
void *PairBuckCoul::extract_ptr(char *id)
|
void *PairBuckCoul::extract(char *id)
|
||||||
{
|
{
|
||||||
char *ids[] = {
|
char *ids[] = {
|
||||||
"B", "sigma", "epsilon", "ewald_order", "ewald_cut", "ewald_mix", NULL};
|
"B", "sigma", "epsilon", "ewald_order", "ewald_cut", "ewald_mix",
|
||||||
|
"cut_coul", NULL};
|
||||||
void *ptrs[] = {
|
void *ptrs[] = {
|
||||||
buck_c, NULL, NULL, &ewald_order, &cut_coul, &mix_flag, NULL};
|
buck_c, NULL, NULL, &ewald_order, &cut_coul, &mix_flag, &cut_coul, NULL};
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
for (i=0; ids[i]&&strcmp(ids[i], id); ++i);
|
for (i=0; ids[i]&&strcmp(ids[i], id); ++i);
|
||||||
return ptrs[i];
|
return ptrs[i];
|
||||||
}
|
}
|
||||||
|
|
||||||
/* ---------------------------------------------------------------------- */
|
|
||||||
|
|
||||||
void PairBuckCoul::extract_long(double *p_cut_coul)
|
|
||||||
{
|
|
||||||
*p_cut_coul = cut_coul;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* ----------------------------------------------------------------------
|
/* ----------------------------------------------------------------------
|
||||||
set coeffs for one or more type pairs
|
set coeffs for one or more type pairs
|
||||||
------------------------------------------------------------------------- */
|
------------------------------------------------------------------------- */
|
||||||
@ -307,18 +287,12 @@ void PairBuckCoul::init_style()
|
|||||||
if (ewald_order&(1<<1)) { // r^-1 kspace
|
if (ewald_order&(1<<1)) { // r^-1 kspace
|
||||||
if (force->kspace == NULL)
|
if (force->kspace == NULL)
|
||||||
error->all("Pair style is incompatible with KSpace style");
|
error->all("Pair style is incompatible with KSpace style");
|
||||||
else if (strcmp(force->kspace_style,"ewald") == 0)
|
g_ewald = force->kspace->g_ewald;
|
||||||
g_ewald = force->kspace->g_ewald;
|
|
||||||
else if (strcmp(force->kspace_style,"ewald/n") == 0)
|
|
||||||
g_ewald = force->kspace->g_ewald;
|
|
||||||
else if (strcmp(force->kspace_style,"pppm") == 0)
|
|
||||||
g_ewald = force->kspace->g_ewald;
|
|
||||||
else error->all("Pair style is incompatible with KSpace style");
|
|
||||||
}
|
}
|
||||||
if (ewald_order&(1<<6)) { // r^-6 kspace
|
if (ewald_order&(1<<6)) { // r^-6 kspace
|
||||||
if (!force->kspace && strcmp(force->kspace_style,"ewald/n"))
|
if (!force->kspace && strcmp(force->kspace_style,"ewald/n"))
|
||||||
error->all("Pair style is incompatible with KSpace style");
|
error->all("Pair style is incompatible with KSpace style");
|
||||||
else g_ewald = force->kspace->g_ewald;
|
g_ewald = force->kspace->g_ewald;
|
||||||
}
|
}
|
||||||
|
|
||||||
// setup force tables
|
// setup force tables
|
||||||
|
|||||||
@ -37,8 +37,7 @@ class PairBuckCoul : public Pair {
|
|||||||
void write_restart_settings(FILE *);
|
void write_restart_settings(FILE *);
|
||||||
void read_restart_settings(FILE *);
|
void read_restart_settings(FILE *);
|
||||||
void single(int, int, int, int, double, double, double, int, One &);
|
void single(int, int, int, int, double, double, double, int, One &);
|
||||||
void *extract_ptr(char *);
|
void *extract(char *);
|
||||||
void extract_long(double *);
|
|
||||||
|
|
||||||
void compute_inner();
|
void compute_inner();
|
||||||
void compute_middle();
|
void compute_middle();
|
||||||
|
|||||||
@ -15,22 +15,6 @@
|
|||||||
Contributing author: Pieter J. in 't Veld (SNL)
|
Contributing author: Pieter J. in 't Veld (SNL)
|
||||||
------------------------------------------------------------------------- */
|
------------------------------------------------------------------------- */
|
||||||
|
|
||||||
/* ----------------------------------------------------------------------
|
|
||||||
module: pair_lj_coul.cpp
|
|
||||||
author: Pieter J. in 't Veld for SNL
|
|
||||||
date: September 21, 2006.
|
|
||||||
purpose: definition of short and long range lj and coulombic pair
|
|
||||||
potentials.
|
|
||||||
usage: pair_style lj/coul
|
|
||||||
long|cut|off control r^-6 contribution
|
|
||||||
long|cut|off control r^-1 contribution
|
|
||||||
rcut6 set r^-6 cut off
|
|
||||||
[rcut1] set r^-1 cut off
|
|
||||||
remarks: - rcut1 cannot be set when both contributions are set to long,
|
|
||||||
rcut1 = rcut6 when ommited
|
|
||||||
- coulombics from Macromolecules 1989, 93, 7320
|
|
||||||
* ---------------------------------------------------------------------- */
|
|
||||||
|
|
||||||
#include "math.h"
|
#include "math.h"
|
||||||
#include "stdio.h"
|
#include "stdio.h"
|
||||||
#include "stdlib.h"
|
#include "stdlib.h"
|
||||||
@ -41,6 +25,7 @@
|
|||||||
#include "comm.h"
|
#include "comm.h"
|
||||||
#include "neighbor.h"
|
#include "neighbor.h"
|
||||||
#include "neigh_list.h"
|
#include "neigh_list.h"
|
||||||
|
#include "neigh_request.h"
|
||||||
#include "force.h"
|
#include "force.h"
|
||||||
#include "kspace.h"
|
#include "kspace.h"
|
||||||
#include "update.h"
|
#include "update.h"
|
||||||
@ -181,25 +166,19 @@ void PairLJCoul::allocate()
|
|||||||
extract protected data from object
|
extract protected data from object
|
||||||
------------------------------------------------------------------------- */
|
------------------------------------------------------------------------- */
|
||||||
|
|
||||||
void *PairLJCoul::extract_ptr(char *id)
|
void *PairLJCoul::extract(char *id)
|
||||||
{
|
{
|
||||||
char *ids[] = {
|
char *ids[] = {
|
||||||
"B", "sigma", "epsilon", "ewald_order", "ewald_cut", "ewald_mix", NULL};
|
"B", "sigma", "epsilon", "ewald_order", "ewald_cut", "ewald_mix",
|
||||||
|
"cut_coul", NULL};
|
||||||
void *ptrs[] = {
|
void *ptrs[] = {
|
||||||
lj4, sigma, epsilon, &ewald_order, &cut_coul, &mix_flag, NULL};
|
lj4, sigma, epsilon, &ewald_order, &cut_coul, &mix_flag, &cut_coul, NULL};
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
for (i=0; ids[i]&&strcmp(ids[i], id); ++i);
|
for (i=0; ids[i]&&strcmp(ids[i], id); ++i);
|
||||||
return ptrs[i];
|
return ptrs[i];
|
||||||
}
|
}
|
||||||
|
|
||||||
/* ---------------------------------------------------------------------- */
|
|
||||||
|
|
||||||
void PairLJCoul::extract_long(double *p_cut_coul)
|
|
||||||
{
|
|
||||||
*p_cut_coul = cut_coul;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* ----------------------------------------------------------------------
|
/* ----------------------------------------------------------------------
|
||||||
set coeffs for one or more type pairs
|
set coeffs for one or more type pairs
|
||||||
------------------------------------------------------------------------- */
|
------------------------------------------------------------------------- */
|
||||||
|
|||||||
@ -36,8 +36,7 @@ class PairLJCoul : public Pair {
|
|||||||
void write_restart_settings(FILE *);
|
void write_restart_settings(FILE *);
|
||||||
void read_restart_settings(FILE *);
|
void read_restart_settings(FILE *);
|
||||||
void single(int, int, int, int, double, double, double, int, One &);
|
void single(int, int, int, int, double, double, double, int, One &);
|
||||||
void *extract_ptr(char *);
|
void *extract(char *);
|
||||||
void extract_long(double *);
|
|
||||||
|
|
||||||
void compute_inner();
|
void compute_inner();
|
||||||
void compute_middle();
|
void compute_middle();
|
||||||
|
|||||||
@ -111,9 +111,9 @@ void DumpXTC::init()
|
|||||||
return # of bytes of allocated memory in buf and global coords array
|
return # of bytes of allocated memory in buf and global coords array
|
||||||
------------------------------------------------------------------------- */
|
------------------------------------------------------------------------- */
|
||||||
|
|
||||||
int DumpXTC::memory_usage()
|
double DumpXTC::memory_usage()
|
||||||
{
|
{
|
||||||
int bytes = maxbuf * sizeof(double);
|
double bytes = maxbuf * sizeof(double);
|
||||||
bytes += 3*natoms * sizeof(float);
|
bytes += 3*natoms * sizeof(float);
|
||||||
return bytes;
|
return bytes;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -25,7 +25,7 @@ class DumpXTC : public Dump {
|
|||||||
DumpXTC(class LAMMPS *, int, char**);
|
DumpXTC(class LAMMPS *, int, char**);
|
||||||
~DumpXTC();
|
~DumpXTC();
|
||||||
void init();
|
void init();
|
||||||
int memory_usage();
|
double memory_usage();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
int natoms,ntotal;
|
int natoms,ntotal;
|
||||||
|
|||||||
@ -37,7 +37,7 @@ class Angle : protected Pointers {
|
|||||||
virtual void write_restart(FILE *) = 0;
|
virtual void write_restart(FILE *) = 0;
|
||||||
virtual void read_restart(FILE *) = 0;
|
virtual void read_restart(FILE *) = 0;
|
||||||
virtual double single(int, int, int, int) = 0;
|
virtual double single(int, int, int, int) = 0;
|
||||||
virtual int memory_usage() {return 0;}
|
virtual double memory_usage() {return 0.0;}
|
||||||
};
|
};
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1282,13 +1282,13 @@ void Atom::update_callback(int ifix)
|
|||||||
add in global to local mapping storage
|
add in global to local mapping storage
|
||||||
------------------------------------------------------------------------- */
|
------------------------------------------------------------------------- */
|
||||||
|
|
||||||
int Atom::memory_usage()
|
double Atom::memory_usage()
|
||||||
{
|
{
|
||||||
memlength = DELTA_MEMSTR;
|
memlength = DELTA_MEMSTR;
|
||||||
memstr = (char *) memory->smalloc(memlength*sizeof(char),"atom:memstr");
|
memstr = (char *) memory->smalloc(memlength*sizeof(char),"atom:memstr");
|
||||||
memstr[0] = '\0';
|
memstr[0] = '\0';
|
||||||
|
|
||||||
int bytes = avec->memory_usage();
|
double bytes = avec->memory_usage();
|
||||||
if (map_style == 1)
|
if (map_style == 1)
|
||||||
bytes += map_tag_max * sizeof(int);
|
bytes += map_tag_max * sizeof(int);
|
||||||
else if (map_style == 2) {
|
else if (map_style == 2) {
|
||||||
|
|||||||
@ -135,7 +135,7 @@ class Atom : protected Pointers {
|
|||||||
void delete_callback(const char *, int);
|
void delete_callback(const char *, int);
|
||||||
void update_callback(int);
|
void update_callback(int);
|
||||||
|
|
||||||
int memory_usage();
|
double memory_usage();
|
||||||
int memcheck(const char *);
|
int memcheck(const char *);
|
||||||
|
|
||||||
// functions for global to local ID mapping
|
// functions for global to local ID mapping
|
||||||
|
|||||||
@ -71,7 +71,7 @@ class AtomVec : protected Pointers {
|
|||||||
virtual void data_vel(int, char **);
|
virtual void data_vel(int, char **);
|
||||||
virtual int data_vel_hybrid(int, char **) {return 0;}
|
virtual int data_vel_hybrid(int, char **) {return 0;}
|
||||||
|
|
||||||
virtual int memory_usage() = 0;
|
virtual double memory_usage() = 0;
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
int nmax; // local copy of atom->nmax
|
int nmax; // local copy of atom->nmax
|
||||||
|
|||||||
@ -444,9 +444,9 @@ int AtomVecAtomic::data_atom_hybrid(int nlocal, char **values)
|
|||||||
return # of bytes of allocated memory
|
return # of bytes of allocated memory
|
||||||
------------------------------------------------------------------------- */
|
------------------------------------------------------------------------- */
|
||||||
|
|
||||||
int AtomVecAtomic::memory_usage()
|
double AtomVecAtomic::memory_usage()
|
||||||
{
|
{
|
||||||
int bytes = 0;
|
double bytes = 0.0;
|
||||||
|
|
||||||
if (atom->memcheck("tag")) bytes += nmax * sizeof(int);
|
if (atom->memcheck("tag")) bytes += nmax * sizeof(int);
|
||||||
if (atom->memcheck("type")) bytes += nmax * sizeof(int);
|
if (atom->memcheck("type")) bytes += nmax * sizeof(int);
|
||||||
|
|||||||
@ -38,7 +38,7 @@ class AtomVecAtomic : public AtomVec {
|
|||||||
void create_atom(int, double *);
|
void create_atom(int, double *);
|
||||||
void data_atom(double *, int, char **);
|
void data_atom(double *, int, char **);
|
||||||
int data_atom_hybrid(int, char **);
|
int data_atom_hybrid(int, char **);
|
||||||
int memory_usage();
|
double memory_usage();
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
int *tag,*type,*mask,*image;
|
int *tag,*type,*mask,*image;
|
||||||
|
|||||||
@ -484,9 +484,9 @@ int AtomVecCharge::data_atom_hybrid(int nlocal, char **values)
|
|||||||
return # of bytes of allocated memory
|
return # of bytes of allocated memory
|
||||||
------------------------------------------------------------------------- */
|
------------------------------------------------------------------------- */
|
||||||
|
|
||||||
int AtomVecCharge::memory_usage()
|
double AtomVecCharge::memory_usage()
|
||||||
{
|
{
|
||||||
int bytes = 0;
|
double bytes = 0.0;
|
||||||
|
|
||||||
if (atom->memcheck("tag")) bytes += nmax * sizeof(int);
|
if (atom->memcheck("tag")) bytes += nmax * sizeof(int);
|
||||||
if (atom->memcheck("type")) bytes += nmax * sizeof(int);
|
if (atom->memcheck("type")) bytes += nmax * sizeof(int);
|
||||||
|
|||||||
@ -39,7 +39,7 @@ class AtomVecCharge : public AtomVec {
|
|||||||
void create_atom(int, double *);
|
void create_atom(int, double *);
|
||||||
void data_atom(double *, int, char **);
|
void data_atom(double *, int, char **);
|
||||||
int data_atom_hybrid(int, char **);
|
int data_atom_hybrid(int, char **);
|
||||||
int memory_usage();
|
double memory_usage();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
int *tag,*type,*mask,*image;
|
int *tag,*type,*mask,*image;
|
||||||
|
|||||||
@ -523,9 +523,9 @@ void AtomVecHybrid::data_vel(int m, char **values)
|
|||||||
return # of bytes of allocated memory
|
return # of bytes of allocated memory
|
||||||
------------------------------------------------------------------------- */
|
------------------------------------------------------------------------- */
|
||||||
|
|
||||||
int AtomVecHybrid::memory_usage()
|
double AtomVecHybrid::memory_usage()
|
||||||
{
|
{
|
||||||
int bytes = 0;
|
double bytes = 0.0;
|
||||||
for (int k = 0; k < nstyles; k++) bytes += styles[k]->memory_usage();
|
for (int k = 0; k < nstyles; k++) bytes += styles[k]->memory_usage();
|
||||||
return bytes;
|
return bytes;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -44,7 +44,7 @@ class AtomVecHybrid : public AtomVec {
|
|||||||
void data_atom(double *, int, char **);
|
void data_atom(double *, int, char **);
|
||||||
int data_atom_hybrid(int, char **) {return 0;}
|
int data_atom_hybrid(int, char **) {return 0;}
|
||||||
void data_vel(int, char **);
|
void data_vel(int, char **);
|
||||||
int memory_usage();
|
double memory_usage();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
int *tag,*type,*mask,*image;
|
int *tag,*type,*mask,*image;
|
||||||
|
|||||||
@ -39,7 +39,7 @@ class Bond : protected Pointers {
|
|||||||
virtual void write_restart(FILE *) = 0;
|
virtual void write_restart(FILE *) = 0;
|
||||||
virtual void read_restart(FILE *) = 0;
|
virtual void read_restart(FILE *) = 0;
|
||||||
virtual void single(int, double, int, int, int, double &, double &) = 0;
|
virtual void single(int, double, int, int, int, double &, double &) = 0;
|
||||||
virtual int memory_usage() {return 0;}
|
virtual double memory_usage() {return 0.0;}
|
||||||
};
|
};
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -33,7 +33,7 @@ class BondHybrid : public Bond {
|
|||||||
void write_restart(FILE *);
|
void write_restart(FILE *);
|
||||||
void read_restart(FILE *);
|
void read_restart(FILE *);
|
||||||
void single(int, double, int, int, int, double &, double &);
|
void single(int, double, int, int, int, double &, double &);
|
||||||
int memory_usage();
|
double memory_usage();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
int nstyles; // # of different bond styles
|
int nstyles; // # of different bond styles
|
||||||
|
|||||||
@ -1476,9 +1476,9 @@ void Comm::set(int narg, char **arg)
|
|||||||
return # of bytes of allocated memory
|
return # of bytes of allocated memory
|
||||||
------------------------------------------------------------------------- */
|
------------------------------------------------------------------------- */
|
||||||
|
|
||||||
int Comm::memory_usage()
|
double Comm::memory_usage()
|
||||||
{
|
{
|
||||||
int bytes = 0;
|
double bytes = 0.0;
|
||||||
|
|
||||||
for (int i = 0; i < nswap; i++) bytes += maxsendlist[i] * sizeof(int);
|
for (int i = 0; i < nswap; i++) bytes += maxsendlist[i] * sizeof(int);
|
||||||
bytes += maxsend * sizeof(double);
|
bytes += maxsend * sizeof(double);
|
||||||
|
|||||||
@ -53,7 +53,7 @@ class Comm : protected Pointers {
|
|||||||
void irregular(); // irregular communication across all procs
|
void irregular(); // irregular communication across all procs
|
||||||
|
|
||||||
void set(int, char **); // set communication style
|
void set(int, char **); // set communication style
|
||||||
int memory_usage(); // tally memory usage
|
double memory_usage();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
int triclinic; // 0 if domain is orthog, 1 if triclinic
|
int triclinic; // 0 if domain is orthog, 1 if triclinic
|
||||||
|
|||||||
@ -61,7 +61,7 @@ class Compute : protected Pointers {
|
|||||||
virtual int pack_reverse_comm(int, int, double *) {return 0;}
|
virtual int pack_reverse_comm(int, int, double *) {return 0;}
|
||||||
virtual void unpack_reverse_comm(int, int *, double *) {}
|
virtual void unpack_reverse_comm(int, int *, double *) {}
|
||||||
|
|
||||||
virtual int memory_usage() {return 0;}
|
virtual double memory_usage() {return 0.0;}
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
int extra_dof,dynamic;
|
int extra_dof,dynamic;
|
||||||
|
|||||||
@ -180,9 +180,9 @@ void ComputeAttributeAtom::compute_peratom()
|
|||||||
memory usage of local atom-based array
|
memory usage of local atom-based array
|
||||||
------------------------------------------------------------------------- */
|
------------------------------------------------------------------------- */
|
||||||
|
|
||||||
int ComputeAttributeAtom::memory_usage()
|
double ComputeAttributeAtom::memory_usage()
|
||||||
{
|
{
|
||||||
int bytes = 0;
|
double bytes = 0.0;
|
||||||
if (allocate) {
|
if (allocate) {
|
||||||
if (size_peratom == 0) bytes = nmax * sizeof(double);
|
if (size_peratom == 0) bytes = nmax * sizeof(double);
|
||||||
else bytes = size_peratom * nmax * sizeof(double);
|
else bytes = size_peratom * nmax * sizeof(double);
|
||||||
|
|||||||
@ -24,7 +24,7 @@ class ComputeAttributeAtom : public Compute {
|
|||||||
~ComputeAttributeAtom();
|
~ComputeAttributeAtom();
|
||||||
void init() {}
|
void init() {}
|
||||||
void compute_peratom();
|
void compute_peratom();
|
||||||
int memory_usage();
|
double memory_usage();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
int which,allocate,nmax;
|
int which,allocate,nmax;
|
||||||
|
|||||||
@ -307,8 +307,8 @@ void ComputeCentroAtom::select2(int k, int n, double *arr, int *iarr)
|
|||||||
memory usage of local atom-based array
|
memory usage of local atom-based array
|
||||||
------------------------------------------------------------------------- */
|
------------------------------------------------------------------------- */
|
||||||
|
|
||||||
int ComputeCentroAtom::memory_usage()
|
double ComputeCentroAtom::memory_usage()
|
||||||
{
|
{
|
||||||
int bytes = nmax * sizeof(double);
|
double bytes = nmax * sizeof(double);
|
||||||
return bytes;
|
return bytes;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -25,7 +25,7 @@ class ComputeCentroAtom : public Compute {
|
|||||||
void init();
|
void init();
|
||||||
void init_list(int, class NeighList *);
|
void init_list(int, class NeighList *);
|
||||||
void compute_peratom();
|
void compute_peratom();
|
||||||
int memory_usage();
|
double memory_usage();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
int nmax,maxneigh;
|
int nmax,maxneigh;
|
||||||
|
|||||||
@ -146,8 +146,8 @@ void ComputeCoordAtom::compute_peratom()
|
|||||||
memory usage of local atom-based array
|
memory usage of local atom-based array
|
||||||
------------------------------------------------------------------------- */
|
------------------------------------------------------------------------- */
|
||||||
|
|
||||||
int ComputeCoordAtom::memory_usage()
|
double ComputeCoordAtom::memory_usage()
|
||||||
{
|
{
|
||||||
int bytes = nmax * sizeof(double);
|
double bytes = nmax * sizeof(double);
|
||||||
return bytes;
|
return bytes;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -25,7 +25,7 @@ class ComputeCoordAtom : public Compute {
|
|||||||
void init();
|
void init();
|
||||||
void init_list(int, class NeighList *);
|
void init_list(int, class NeighList *);
|
||||||
void compute_peratom();
|
void compute_peratom();
|
||||||
int memory_usage();
|
double memory_usage();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
int nmax;
|
int nmax;
|
||||||
|
|||||||
@ -159,8 +159,8 @@ void ComputeEbondAtom::unpack_reverse_comm(int n, int *list, double *buf)
|
|||||||
memory usage of local atom-based array
|
memory usage of local atom-based array
|
||||||
------------------------------------------------------------------------- */
|
------------------------------------------------------------------------- */
|
||||||
|
|
||||||
int ComputeEbondAtom::memory_usage()
|
double ComputeEbondAtom::memory_usage()
|
||||||
{
|
{
|
||||||
int bytes = nmax * sizeof(double);
|
double bytes = nmax * sizeof(double);
|
||||||
return bytes;
|
return bytes;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -26,7 +26,7 @@ class ComputeEbondAtom : public Compute {
|
|||||||
void compute_peratom();
|
void compute_peratom();
|
||||||
int pack_reverse_comm(int, int, double *);
|
int pack_reverse_comm(int, int, double *);
|
||||||
void unpack_reverse_comm(int, int *, double *);
|
void unpack_reverse_comm(int, int *, double *);
|
||||||
int memory_usage();
|
double memory_usage();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
int nmax;
|
int nmax;
|
||||||
|
|||||||
@ -224,8 +224,8 @@ void ComputeEpairAtom::unpack_reverse_comm(int n, int *list, double *buf)
|
|||||||
memory usage of local atom-based array
|
memory usage of local atom-based array
|
||||||
------------------------------------------------------------------------- */
|
------------------------------------------------------------------------- */
|
||||||
|
|
||||||
int ComputeEpairAtom::memory_usage()
|
double ComputeEpairAtom::memory_usage()
|
||||||
{
|
{
|
||||||
int bytes = nmax * sizeof(double);
|
double bytes = nmax * sizeof(double);
|
||||||
return bytes;
|
return bytes;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -27,7 +27,7 @@ class ComputeEpairAtom : public Compute {
|
|||||||
void compute_peratom();
|
void compute_peratom();
|
||||||
int pack_reverse_comm(int, int, double *);
|
int pack_reverse_comm(int, int, double *);
|
||||||
void unpack_reverse_comm(int, int *, double *);
|
void unpack_reverse_comm(int, int *, double *);
|
||||||
int memory_usage();
|
double memory_usage();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
int nmax,eamstyle;
|
int nmax,eamstyle;
|
||||||
|
|||||||
@ -98,8 +98,8 @@ void ComputeKEAtom::compute_peratom()
|
|||||||
memory usage of local atom-based array
|
memory usage of local atom-based array
|
||||||
------------------------------------------------------------------------- */
|
------------------------------------------------------------------------- */
|
||||||
|
|
||||||
int ComputeKEAtom::memory_usage()
|
double ComputeKEAtom::memory_usage()
|
||||||
{
|
{
|
||||||
int bytes = nmax * sizeof(double);
|
double bytes = nmax * sizeof(double);
|
||||||
return bytes;
|
return bytes;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -24,7 +24,7 @@ class ComputeKEAtom : public Compute {
|
|||||||
~ComputeKEAtom();
|
~ComputeKEAtom();
|
||||||
void init();
|
void init();
|
||||||
void compute_peratom();
|
void compute_peratom();
|
||||||
int memory_usage();
|
double memory_usage();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
int nmax;
|
int nmax;
|
||||||
|
|||||||
@ -369,8 +369,8 @@ void ComputeStressAtom::unpack_reverse_comm(int n, int *list, double *buf)
|
|||||||
memory usage of local atom-based array
|
memory usage of local atom-based array
|
||||||
------------------------------------------------------------------------- */
|
------------------------------------------------------------------------- */
|
||||||
|
|
||||||
int ComputeStressAtom::memory_usage()
|
double ComputeStressAtom::memory_usage()
|
||||||
{
|
{
|
||||||
int bytes = nmax*6 * sizeof(double);
|
double bytes = nmax*6 * sizeof(double);
|
||||||
return bytes;
|
return bytes;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -28,7 +28,7 @@ class ComputeStressAtom : public Compute {
|
|||||||
void compute_peratom();
|
void compute_peratom();
|
||||||
int pack_reverse_comm(int, int, double *);
|
int pack_reverse_comm(int, int, double *);
|
||||||
void unpack_reverse_comm(int, int *, double *);
|
void unpack_reverse_comm(int, int *, double *);
|
||||||
int memory_usage();
|
double memory_usage();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
int pairrequest,bondrequest,kerequest;
|
int pairrequest,bondrequest,kerequest;
|
||||||
|
|||||||
@ -149,9 +149,9 @@ void ComputeSumAtom::compute_peratom()
|
|||||||
memory usage of local atom-based array
|
memory usage of local atom-based array
|
||||||
------------------------------------------------------------------------- */
|
------------------------------------------------------------------------- */
|
||||||
|
|
||||||
int ComputeSumAtom::memory_usage()
|
double ComputeSumAtom::memory_usage()
|
||||||
{
|
{
|
||||||
int bytes = 0;
|
double bytes = 0.0;
|
||||||
if (size_peratom == 0) bytes = nmax * sizeof(double);
|
if (size_peratom == 0) bytes = nmax * sizeof(double);
|
||||||
else bytes = nmax*size_peratom * sizeof(double);
|
else bytes = nmax*size_peratom * sizeof(double);
|
||||||
return bytes;
|
return bytes;
|
||||||
|
|||||||
@ -24,7 +24,7 @@ class ComputeSumAtom : public Compute {
|
|||||||
~ComputeSumAtom();
|
~ComputeSumAtom();
|
||||||
void init();
|
void init();
|
||||||
void compute_peratom();
|
void compute_peratom();
|
||||||
int memory_usage();
|
double memory_usage();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
int nmax;
|
int nmax;
|
||||||
|
|||||||
@ -87,8 +87,8 @@ void ComputeVariableAtom::compute_peratom()
|
|||||||
memory usage of local atom-based array
|
memory usage of local atom-based array
|
||||||
------------------------------------------------------------------------- */
|
------------------------------------------------------------------------- */
|
||||||
|
|
||||||
int ComputeVariableAtom::memory_usage()
|
double ComputeVariableAtom::memory_usage()
|
||||||
{
|
{
|
||||||
int bytes = nmax * sizeof(double);
|
double bytes = nmax * sizeof(double);
|
||||||
return bytes;
|
return bytes;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -24,7 +24,7 @@ class ComputeVariableAtom : public Compute {
|
|||||||
~ComputeVariableAtom();
|
~ComputeVariableAtom();
|
||||||
void init();
|
void init();
|
||||||
void compute_peratom();
|
void compute_peratom();
|
||||||
int memory_usage();
|
double memory_usage();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
int nmax,ivariable;
|
int nmax,ivariable;
|
||||||
|
|||||||
@ -38,7 +38,7 @@ class Dihedral : protected Pointers {
|
|||||||
virtual void coeff(int, int, char **) = 0;
|
virtual void coeff(int, int, char **) = 0;
|
||||||
virtual void write_restart(FILE *) = 0;
|
virtual void write_restart(FILE *) = 0;
|
||||||
virtual void read_restart(FILE *) = 0;
|
virtual void read_restart(FILE *) = 0;
|
||||||
virtual int memory_usage() {return 0;}
|
virtual double memory_usage() {return 0.0;}
|
||||||
};
|
};
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -255,9 +255,9 @@ void Dump::modify_params(int narg, char **arg)
|
|||||||
return # of bytes of allocated memory in buf
|
return # of bytes of allocated memory in buf
|
||||||
------------------------------------------------------------------------- */
|
------------------------------------------------------------------------- */
|
||||||
|
|
||||||
int Dump::memory_usage()
|
double Dump::memory_usage()
|
||||||
{
|
{
|
||||||
int bytes = maxbuf * sizeof(double);
|
double bytes = maxbuf * sizeof(double);
|
||||||
return bytes;
|
return bytes;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -48,7 +48,7 @@ class Dump : protected Pointers {
|
|||||||
virtual void init() {}
|
virtual void init() {}
|
||||||
void write();
|
void write();
|
||||||
void modify_params(int, char **);
|
void modify_params(int, char **);
|
||||||
virtual int memory_usage();
|
virtual double memory_usage();
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
double boxxlo,boxxhi; // local copies of domain values
|
double boxxlo,boxxhi; // local copies of domain values
|
||||||
|
|||||||
@ -1002,9 +1002,9 @@ int DumpCustom::modify_param(int narg, char **arg)
|
|||||||
return # of bytes of allocated memory in buf and choose and local arrays
|
return # of bytes of allocated memory in buf and choose and local arrays
|
||||||
------------------------------------------------------------------------- */
|
------------------------------------------------------------------------- */
|
||||||
|
|
||||||
int DumpCustom::memory_usage()
|
double DumpCustom::memory_usage()
|
||||||
{
|
{
|
||||||
int bytes = maxbuf * sizeof(double);
|
double bytes = maxbuf * sizeof(double);
|
||||||
bytes += maxlocal * sizeof(int);
|
bytes += maxlocal * sizeof(int);
|
||||||
bytes += maxlocal * sizeof(double);
|
bytes += maxlocal * sizeof(double);
|
||||||
return bytes;
|
return bytes;
|
||||||
|
|||||||
@ -23,7 +23,7 @@ class DumpCustom : public Dump {
|
|||||||
DumpCustom(class LAMMPS *, int, char **);
|
DumpCustom(class LAMMPS *, int, char **);
|
||||||
~DumpCustom();
|
~DumpCustom();
|
||||||
void init();
|
void init();
|
||||||
int memory_usage();
|
double memory_usage();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
int nevery; // dump frequency to check Fix against
|
int nevery; // dump frequency to check Fix against
|
||||||
|
|||||||
@ -103,9 +103,9 @@ void DumpDCD::init()
|
|||||||
return # of bytes of allocated memory in buf and global coords array
|
return # of bytes of allocated memory in buf and global coords array
|
||||||
------------------------------------------------------------------------- */
|
------------------------------------------------------------------------- */
|
||||||
|
|
||||||
int DumpDCD::memory_usage()
|
double DumpDCD::memory_usage()
|
||||||
{
|
{
|
||||||
int bytes = maxbuf * sizeof(double);
|
double bytes = maxbuf * sizeof(double);
|
||||||
bytes += 3*natoms * sizeof(float);
|
bytes += 3*natoms * sizeof(float);
|
||||||
return bytes;
|
return bytes;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -25,7 +25,7 @@ class DumpDCD : public Dump {
|
|||||||
DumpDCD(LAMMPS *, int, char**);
|
DumpDCD(LAMMPS *, int, char**);
|
||||||
~DumpDCD();
|
~DumpDCD();
|
||||||
void init();
|
void init();
|
||||||
int memory_usage();
|
double memory_usage();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
int natoms,ntotal,headerflag,nevery_save,nframes;
|
int natoms,ntotal,headerflag,nevery_save,nframes;
|
||||||
|
|||||||
@ -80,9 +80,9 @@ void DumpXYZ::init()
|
|||||||
return # of bytes of allocated memory in buf and global coords array
|
return # of bytes of allocated memory in buf and global coords array
|
||||||
------------------------------------------------------------------------- */
|
------------------------------------------------------------------------- */
|
||||||
|
|
||||||
int DumpXYZ::memory_usage()
|
double DumpXYZ::memory_usage()
|
||||||
{
|
{
|
||||||
int bytes = maxbuf * sizeof(double);
|
double bytes = maxbuf * sizeof(double);
|
||||||
if (igroup == 0) {
|
if (igroup == 0) {
|
||||||
bytes += natoms * sizeof(int);
|
bytes += natoms * sizeof(int);
|
||||||
bytes += 3*natoms * sizeof(float);
|
bytes += 3*natoms * sizeof(float);
|
||||||
|
|||||||
@ -23,7 +23,7 @@ class DumpXYZ : public Dump {
|
|||||||
DumpXYZ(class LAMMPS *, int, char**);
|
DumpXYZ(class LAMMPS *, int, char**);
|
||||||
~DumpXYZ();
|
~DumpXYZ();
|
||||||
void init();
|
void init();
|
||||||
int memory_usage();
|
double memory_usage();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
int natoms,ntotal;
|
int natoms,ntotal;
|
||||||
|
|||||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user