git-svn-id: svn://svn.icms.temple.edu/lammps-ro/trunk@951 f3b2605a-c512-4ea7-a41b-209d697bcdaa

This commit is contained in:
sjplimp 2007-10-04 17:57:04 +00:00
parent ab2a54ab6a
commit aef3f32236
145 changed files with 401 additions and 442 deletions

View File

@ -583,9 +583,9 @@ int AtomVecEllipsoid::data_vel_hybrid(int m, char **values)
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("type")) bytes += nmax * sizeof(int);

View File

@ -40,7 +40,7 @@ class AtomVecEllipsoid : public AtomVec {
int data_atom_hybrid(int, char **);
void data_vel(int, char **);
int data_vel_hybrid(int, char **);
int memory_usage();
double memory_usage();
private:
int *tag,*type,*mask,*image;

View File

@ -281,11 +281,7 @@ void PairLJClass2CoulLong::init_style()
if (force->kspace == NULL)
error->all("Pair style is incompatible with KSpace style");
else if (strcmp(force->kspace_style,"ewald") == 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");
g_ewald = force->kspace->g_ewald;
}
/* ----------------------------------------------------------------------
@ -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;
}

View File

@ -32,8 +32,7 @@ class PairLJClass2CoulLong : public Pair {
void write_restart_settings(FILE *);
void read_restart_settings(FILE *);
void single(int, int, int, int, double, double, double, int, One &);
void extract_long(double *);
void *extract(char *);
private:
double cut_lj_global;

View File

@ -638,9 +638,9 @@ int AtomVecDipole::data_vel_hybrid(int m, char **values)
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("type")) bytes += nmax * sizeof(int);

View File

@ -45,7 +45,7 @@ class AtomVecDipole : public AtomVec {
int data_atom_hybrid(int, char **);
void data_vel(int, char **);
int data_vel_hybrid(int, char **);
int memory_usage();
double memory_usage();
private:
int *tag,*type,*mask,*image;

View File

@ -711,9 +711,9 @@ int AtomVecGranular::data_vel_hybrid(int m, char **values)
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("type")) bytes += nmax * sizeof(int);

View File

@ -46,7 +46,7 @@ class AtomVecGranular : public AtomVec {
int data_atom_hybrid(int, char **);
void data_vel(int, char **);
int data_vel_hybrid(int, char **);
int memory_usage();
double memory_usage();
private:
double PI;

View File

@ -114,15 +114,20 @@ int FixGranDiag::setmask()
void FixGranDiag::init()
{
// insure use of granular pair_style
// set local values from Pair values
pair = force->pair_match("gran");
if (pair == NULL)
if (force->pair == NULL)
error->all("Fix gran/diag is incompatible with Pair style");
int dampflag;
double gamman;
pair->extract_gran(&xkk,&gamman,&xmu,&dampflag);
double *p_xkk = (double *) force->pair->extract("xkk");
double *p_gamman = (double *) force->pair->extract("gamman");
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()

View File

@ -171,15 +171,13 @@ int FixWallGran::setmask()
void FixWallGran::init()
{
// insure use of granular pair_style
// set local values from Pair values
Pair *pair = force->pair_match("gran");
if (pair == NULL)
if (force->pair == NULL)
error->all("Fix wall/gran is incompatible with Pair style");
int itmp;
double tmp1,tmp2;
pair->extract_gran(&xkk,&tmp1,&tmp2,&itmp);
double *p_xkk = (double *) force->pair->extract("xkk");
if (!p_xkk) error->all("Fix wall/gran is incompatible with Pair style");
xkk = *p_xkk;
// 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
------------------------------------------------------------------------- */
int FixWallGran::memory_usage()
double FixWallGran::memory_usage()
{
int nmax = atom->nmax;
int bytes = nmax * sizeof(int);
double bytes = nmax * sizeof(int);
bytes += 3*nmax * sizeof(double);
return bytes;
}

View File

@ -27,7 +27,7 @@ class FixWallGran : public Fix {
void setup();
void post_force(int);
int memory_usage();
double memory_usage();
void grow_arrays(int);
void copy_arrays(int, int);
int pack_exchange(int, double *);

View File

@ -479,11 +479,11 @@ void PairGranHistory::read_restart_settings(FILE *fp)
/* ---------------------------------------------------------------------- */
void PairGranHistory::extract_gran(double *p_xkk, double *p_gamman,
double *p_xmu, int *p_dampflag)
void *PairGranHistory::extract(char *str)
{
*p_xkk = xkk;
*p_gamman = gamman;
*p_xmu = xmu;
*p_dampflag = dampflag;
if (strcmp(str,"xkk") == 0) return (void *) &xkk;
else if (strcmp(str,"gamman") == 0) return (void *) &gamman;
else if (strcmp(str,"xmu") == 0) return (void *) &xmu;
else if (strcmp(str,"dampflag") == 0) return (void *) &dampflag;
return NULL;
}

View File

@ -32,8 +32,7 @@ class PairGranHistory : public Pair {
void read_restart(FILE *);
void write_restart_settings(FILE *);
void read_restart_settings(FILE *);
void extract_gran(double *, double *, double *, int *);
void *extract(char *);
protected:
double xkk,xkkt,xmu;

View File

@ -93,18 +93,16 @@ void Ewald::init()
error->all("Incorrect boundaries with slab Ewald");
}
// insure use of long (or table) pair_style with long-range Coulombics
// set cutoff to Pair's short-range Coulombic cutoff
// extract short-range Coulombic cutoff from pair style
qqrd2e = force->qqrd2e;
Pair *pair = force->pair_match("long");
if (pair == NULL) pair = force->pair_match("table");
if (pair == NULL) error->all("KSpace style is incompatible with Pair style");
double cutoff;
pair->extract_long(&cutoff);
// compute qsum & qsqsum and warn if not charge-neutral
if (force->pair == NULL)
error->all("KSpace style is incompatible with Pair style");
double *p_cutoff = (double *) force->pair->extract("cut_coul");
if (p_cutoff == NULL)
error->all("KSpace style is incompatible with Pair style");
double cutoff = *p_cutoff;
qsum = qsqsum = 0.0;
for (int i = 0; i < atom->nlocal; i++) {
@ -835,9 +833,9 @@ void Ewald::slabcorr(int eflag)
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 += 4 * kmax3d * sizeof(double);
bytes += nmax*3 * sizeof(double);

View File

@ -25,7 +25,7 @@ class Ewald : public KSpace {
void init();
void setup();
void compute(int, int);
int memory_usage();
double memory_usage();
private:
double PI;

View File

@ -311,13 +311,9 @@ void PairBuckCoulLong::init_style()
// 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");
else if (strcmp(force->kspace_style,"ewald") == 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");
g_ewald = force->kspace->g_ewald;
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;
}

View File

@ -32,8 +32,7 @@ class PairBuckCoulLong : public Pair {
void write_restart_settings(FILE *);
void read_restart_settings(FILE *);
void single(int, int, int, int, double, double, double, int, One &);
void extract_long(double *);
void *extract(char *);
private:
double cut_lj_global;

View File

@ -262,11 +262,7 @@ void PairCoulLong::init_style()
if (force->kspace == NULL)
error->all("Pair style is incompatible with KSpace style");
else if (strcmp(force->kspace_style,"ewald") == 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");
g_ewald = force->kspace->g_ewald;
// 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;
}

View File

@ -32,8 +32,7 @@ class PairCoulLong : public Pair {
void write_restart_settings(FILE *);
void read_restart_settings(FILE *);
void single(int, int, int, int, double, double, double, int, One &);
void extract_long(double *);
void *extract(char *);
private:
double cut_coul,cut_coulsq;

View File

@ -52,6 +52,7 @@ PairLJCharmmCoulLong::PairLJCharmmCoulLong(LAMMPS *lmp) : Pair(lmp)
{
respa_enable = 1;
ftable = NULL;
implicit = 0;
}
/* ---------------------------------------------------------------------- */
@ -799,16 +800,10 @@ void PairLJCharmmCoulLong::init_style()
// 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");
else if (strcmp(force->kspace_style,"ewald") == 0)
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");
g_ewald = force->kspace->g_ewald;
// setup force tables
if (ncoultablebits) init_tables();
@ -1217,22 +1212,13 @@ void PairLJCharmmCoulLong::single(int i, int j, int itype, int jtype,
/* ---------------------------------------------------------------------- */
void PairLJCharmmCoulLong::extract_charmm(double ***p_lj14_1,
double ***p_lj14_2,
double ***p_lj14_3,
double ***p_lj14_4,
int *p_implicit_flag)
void *PairLJCharmmCoulLong::extract(char *str)
{
*p_lj14_1 = lj14_1;
*p_lj14_2 = lj14_2;
*p_lj14_3 = lj14_3;
*p_lj14_4 = lj14_4;
*p_implicit_flag = 0;
}
/* ---------------------------------------------------------------------- */
void PairLJCharmmCoulLong::extract_long(double *p_cut_coul)
{
*p_cut_coul = cut_coul;
if (strcmp(str,"lj14_1") == 0) return (void *) lj14_1;
else if (strcmp(str,"lj14_2") == 0) return (void *) lj14_2;
else if (strcmp(str,"lj14_3") == 0) return (void *) lj14_3;
else if (strcmp(str,"lj14_4") == 0) return (void *) lj14_4;
else if (strcmp(str,"implicit") == 0) return (void *) &implicit;
else if (strcmp(str,"cut_coul") == 0) return (void *) &cut_coul;
return NULL;
}

View File

@ -37,10 +37,10 @@ class PairLJCharmmCoulLong : public Pair {
void compute_inner();
void compute_middle();
void compute_outer(int, int);
void extract_charmm(double ***, double ***, double ***, double ***, int *);
void extract_long(double *);
void *extract(char *);
protected:
int implicit;
double cut_lj_inner,cut_lj;
double cut_lj_innersq,cut_ljsq;
double cut_coul,cut_coulsq;

View File

@ -736,13 +736,9 @@ void PairLJCutCoulLong::init_style()
// 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");
else if (strcmp(force->kspace_style,"ewald") == 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");
g_ewald = force->kspace->g_ewald;
// 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;
}

View File

@ -37,7 +37,7 @@ class PairLJCutCoulLong : public Pair {
void compute_inner();
void compute_middle();
void compute_outer(int, int);
void extract_long(double *);
void *extract(char *);
protected:
double cut_lj_global;

View File

@ -577,13 +577,12 @@ void PairLJCutCoulLongTIP4P::find_M(int i, int &iH1, int &iH2, double *xM)
/* ---------------------------------------------------------------------- */
void PairLJCutCoulLongTIP4P::extract_tip4p(double *p_qdist,
int *p_typeO, int *p_typeH,
int *p_typeA, int *p_typeB)
void *PairLJCutCoulLongTIP4P::extract(char *str)
{
*p_qdist = qdist;
*p_typeO = typeO;
*p_typeH = typeH;
*p_typeA = typeA;
*p_typeB = typeB;
if (strcmp(str,"qdist") == 0) return (void *) &qdist;
else if (strcmp(str,"typeO") == 0) return (void *) &typeO;
else if (strcmp(str,"typeH") == 0) return (void *) &typeH;
else if (strcmp(str,"typeA") == 0) return (void *) &typeA;
else if (strcmp(str,"typeB") == 0) return (void *) &typeB;
return NULL;
}

View File

@ -26,8 +26,7 @@ class PairLJCutCoulLongTIP4P : public PairLJCutCoulLong {
void init_style();
void write_restart_settings(FILE *fp);
void read_restart_settings(FILE *fp);
void extract_tip4p(double *, int *, int *, int *, int *);
void *extract(char *);
private:
int typeH,typeO; // atom types of TIP4P water H and O atoms

View File

@ -129,29 +129,37 @@ void PPPM::init()
deallocate();
// insure use of long (or table) pair_style with long-range Coulombics
// set cutoff to Pair's short-range Coulombic cutoff
// extract short-range Coulombic cutoff from pair style
qqrd2e = force->qqrd2e;
Pair *pair = force->pair_match("long");
if (pair == NULL) pair = force->pair_match("table");
if (pair == NULL) error->all("KSpace style is incompatible with Pair style");
pair->extract_long(&cutoff);
if (force->pair == NULL)
error->all("KSpace style is incompatible with Pair style");
double *p_cutoff = (double *) force->pair->extract("cut_coul");
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
// set TIP4P params from Pair's params
// if kspace is TIP4P, extract TIP4P params from pair style
qdist = 0.0;
pair = force->pair_match("tip4p");
if (strcmp(force->kspace_style,"pppm/tip4p") != 0 && pair != NULL)
error->all("KSpace style is incompatible with Pair style");
if (strcmp(force->kspace_style,"pppm/tip4p") == 0 && pair == NULL)
error->all("KSpace style is incompatible with Pair style");
if (pair) {
int typeA,typeB;
pair->extract_tip4p(&qdist,&typeO,&typeH,&typeA,&typeB);
if (strcmp(force->kspace_style,"pppm/tip4p") == 0) {
if (force->pair == NULL)
error->all("KSpace style is incompatible with Pair style");
double *p_qdist = (double *) force->pair->extract("qdist");
int *p_typeO = (int *) force->pair->extract("typeO");
int *p_typeH = (int *) force->pair->extract("typeH");
int *p_typeA = (int *) force->pair->extract("typeA");
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)
error->all("Bond and angle potentials must be defined for TIP4P");
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
------------------------------------------------------------------------- */
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) *
(nzhi_out-nzlo_out+1);
bytes += 4 * nbrick * sizeof(double);

View File

@ -26,7 +26,7 @@ class PPPM : public KSpace {
void setup();
void compute(int, int);
void timing(int, double &, double &);
int memory_usage();
double memory_usage();
protected:
int me,nprocs;

View File

@ -870,9 +870,9 @@ void PairEAM::unpack_reverse_comm(int n, int *list, double *buf)
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;
}
@ -880,7 +880,7 @@ int PairEAM::memory_usage()
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;
fp = fp_caller;

View File

@ -35,9 +35,8 @@ class PairEAM : public Pair {
void unpack_comm(int, int, double *);
int pack_reverse_comm(int, int, double *);
void unpack_reverse_comm(int, int *, double *);
int memory_usage();
void extract_eam(double *, double **);
double memory_usage();
void swap_eam(double *, double **);
protected:
double cutforcesq,cutmax;

View File

@ -251,9 +251,9 @@ double AngleHybrid::single(int type, int i1, int i2, int i3)
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++)
if (styles[m]) bytes += styles[m]->memory_usage();

View File

@ -30,7 +30,7 @@ class AngleHybrid : public Angle {
void write_restart(FILE *);
void read_restart(FILE *);
double single(int, int, int, int);
int memory_usage();
double memory_usage();
private:
int nstyles; // # of different angle styles

View File

@ -631,9 +631,9 @@ int AtomVecAngle::data_atom_hybrid(int nlocal, char **values)
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("type")) bytes += nmax * sizeof(int);

View File

@ -40,7 +40,7 @@ class AtomVecAngle : public AtomVec {
void create_atom(int, double *);
void data_atom(double *, int, char **);
int data_atom_hybrid(int, char **);
int memory_usage();
double memory_usage();
private:
int *tag,*type,*mask,*image;

View File

@ -572,9 +572,9 @@ int AtomVecBond::data_atom_hybrid(int nlocal, char **values)
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("type")) bytes += nmax * sizeof(int);

View File

@ -40,7 +40,7 @@ class AtomVecBond : public AtomVec {
void create_atom(int, double *);
void data_atom(double *, int, char **);
int data_atom_hybrid(int, char **);
int memory_usage();
double memory_usage();
private:
int *tag,*type,*mask,*image;

View File

@ -782,9 +782,9 @@ int AtomVecFull::data_atom_hybrid(int nlocal, char **values)
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("type")) bytes += nmax * sizeof(int);

View File

@ -40,7 +40,7 @@ class AtomVecFull : public AtomVec {
void create_atom(int, double *);
void data_atom(double *, int, char **);
int data_atom_hybrid(int, char **);
int memory_usage();
double memory_usage();
private:
int *tag,*type,*mask,*image;

View File

@ -766,9 +766,9 @@ int AtomVecMolecular::data_atom_hybrid(int nlocal, char **values)
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("type")) bytes += nmax * sizeof(int);

View File

@ -40,7 +40,7 @@ class AtomVecMolecular : public AtomVec {
void create_atom(int, double *);
void data_atom(double *, int, char **);
int data_atom_hybrid(int, char **);
int memory_usage();
double memory_usage();
private:
int *tag,*type,*mask,*image;

View File

@ -261,9 +261,9 @@ void BondHybrid::single(int type, double rsq, int i, int j,
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++)
if (styles[m]) bytes += styles[m]->memory_usage();

View File

@ -275,7 +275,7 @@ void DihedralCharmm::compute(int eflag, int vflag)
r2inv = 1.0/rsq;
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);
forcelj = r6inv * (lj14_1[itype][jtype]*r6inv - lj14_2[itype][jtype]);
fforce = weight[type] * (forcelj+forcecoul)*r2inv;
@ -391,10 +391,16 @@ void DihedralCharmm::init_style()
if (weight[i] > 0.0) weightflag = 1;
if (weightflag) {
Pair *pair = force->pair_match("charmm");
if (pair == NULL)
if (force->pair == NULL)
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;
}
}

View File

@ -33,7 +33,7 @@ class DihedralCharmm : public Dihedral {
double *k,*weight,*cos_shift,*sin_shift;
int *multiplicity,*shift;
double **lj14_1,**lj14_2,**lj14_3,**lj14_4;
int implicit_flag;
int implicit;
void allocate();
};

View File

@ -248,9 +248,9 @@ void DihedralHybrid::read_restart(FILE *fp)
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++)
if (styles[m]) bytes += styles[m]->memory_usage();

View File

@ -29,7 +29,7 @@ class DihedralHybrid : public Dihedral {
void init_style();
void write_restart(FILE *);
void read_restart(FILE *);
int memory_usage();
double memory_usage();
private:
int nstyles; // # of different dihedral styles

View File

@ -235,9 +235,9 @@ void ImproperHybrid::read_restart(FILE *fp)
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++)
if (styles[m]) bytes += styles[m]->memory_usage();

View File

@ -28,7 +28,7 @@ class ImproperHybrid : public Improper {
void coeff(int, int, char **);
void write_restart(FILE *);
void read_restart(FILE *);
int memory_usage();
double memory_usage();
private:
int nstyles; // # of different improper styles

View File

@ -18,6 +18,7 @@
#include "math.h"
#include "stdio.h"
#include "stdlib.h"
#include "string.h"
#include "pair_lj_charmm_coul_charmm.h"
#include "atom.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,
double ***p_lj14_2,
double ***p_lj14_3,
double ***p_lj14_4,
int *p_implicit_flag)
void *PairLJCharmmCoulCharmm::extract(char *str)
{
*p_lj14_1 = lj14_1;
*p_lj14_2 = lj14_2;
*p_lj14_3 = lj14_3;
*p_lj14_4 = lj14_4;
*p_implicit_flag = 0;
if (strcmp(str,"lj14_1") == 0) return (void *) lj14_1;
else if (strcmp(str,"lj14_2") == 0) return (void *) lj14_2;
else if (strcmp(str,"lj14_3") == 0) return (void *) lj14_3;
else if (strcmp(str,"lj14_4") == 0) return (void *) lj14_4;
else if (strcmp(str,"implicit") == 0) return (void *) &implicit;
return NULL;
}

View File

@ -32,11 +32,10 @@ class PairLJCharmmCoulCharmm : public Pair {
void write_restart_settings(FILE *);
void read_restart_settings(FILE *);
virtual void single(int, int, int, int, double, double, double, int, One &);
virtual void extract_charmm(double ***, double ***,
double ***, double ***, int *);
virtual void *extract(char *);
protected:
int implicit;
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 denom_lj,denom_coul;

View File

@ -12,6 +12,7 @@
------------------------------------------------------------------------- */
#include "math.h"
#include "string.h"
#include "pair_lj_charmm_coul_charmm_implicit.h"
#include "atom.h"
#include "force.h"
@ -22,7 +23,10 @@ using namespace LAMMPS_NS;
/* ---------------------------------------------------------------------- */
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,
double ***p_lj14_2,
double ***p_lj14_3,
double ***p_lj14_4,
int *p_implicit_flag)
void *PairLJCharmmCoulCharmmImplicit::extract(char *str)
{
*p_lj14_1 = lj14_1;
*p_lj14_2 = lj14_2;
*p_lj14_3 = lj14_3;
*p_lj14_4 = lj14_4;
*p_implicit_flag = 1;
if (strcmp(str,"lj14_1") == 0) return (void *) lj14_1;
else if (strcmp(str,"lj14_2") == 0) return (void *) lj14_2;
else if (strcmp(str,"lj14_3") == 0) return (void *) lj14_3;
else if (strcmp(str,"lj14_4") == 0) return (void *) lj14_4;
else if (strcmp(str,"implicit") == 0) return (void *) &implicit;
return NULL;
}

View File

@ -23,8 +23,7 @@ class PairLJCharmmCoulCharmmImplicit : public PairLJCharmmCoulCharmm {
PairLJCharmmCoulCharmmImplicit(class LAMMPS *);
void compute(int, int);
void single(int, int, int, int, double, double, double, int, One &);
void extract_charmm(double ***, double ***, double ***, double ***, int *);
void *extract(char *);
};
}

View File

@ -15,17 +15,6 @@
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 "string.h"
#include "stdio.h"
@ -78,9 +67,10 @@ EwaldN::~EwaldN()
void EwaldN::init()
{
nkvec = nkvec_max = nevec = nevec_max = bytes = 0;
nkvec = nkvec_max = nevec = nevec_max = 0;
nfunctions = nsums = sums = 0;
nbox = -1;
bytes = 0.0;
if (!comm->me) { // output message
if (screen) fprintf(screen,"EwaldN initialization ...\n");
@ -103,11 +93,12 @@ void EwaldN::init()
mumurd2e = dielectric = 1.0;
Pair *pair = force->pair;
void *ptr = pair ? pair->extract_ptr("ewald_order") : NULL;
if (!ptr) error->all("KSpace style is incompatible with Pair style");
int ewald_order = *((int *) ptr);
int ewald_mix = *((int *) pair->extract_ptr("ewald_mix"));
double cutoff = *((double *) pair->extract_ptr("ewald_cut"));
int *ptr = pair ? (int *) pair->extract("ewald_order") : NULL;
double *cutoff = pair ? (double *) pair->extract("cut_coul") : NULL;
if (!(ptr||cutoff))
error->all("KSpace style is incompatible with Pair style");
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));
for (int i=0; i<=EWALD_NORDER; ++i) // transcribe order
if (ewald_order&(1<<i)) { // from pair_style
@ -131,7 +122,7 @@ void EwaldN::init()
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);
if (!comm->me) { // output results
@ -305,15 +296,15 @@ void EwaldN::init_coeffs() // local pair coeffs
int n = atom->ntypes;
if (function[1]) { // geometric 1/r^6
double **b = (double **) force->pair->extract_ptr("B");
double **b = (double **) force->pair->extract("B");
delete [] B;
B = new double[n+1];
bytes += (n+1)*sizeof(double);
for (int i=0; i<=n; ++i) B[i] = sqrt(fabs(b[i][i]));
}
if (function[2]) { // arithmetic 1/r^6
double **epsilon = (double **) force->pair->extract_ptr("epsilon");
double **sigma = (double **) force->pair->extract_ptr("sigma");
double **epsilon = (double **) force->pair->extract("epsilon");
double **sigma = (double **) force->pair->extract("sigma");
if (!(epsilon&&sigma))
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];

View File

@ -35,14 +35,15 @@ class EwaldN : public KSpace {
void init();
void setup();
void compute(int, int);
int memory_usage() { return bytes; }
double memory_usage() {return bytes;}
private:
double unit[6];
int function[EWALD_NFUNCS], first_output;
int nkvec, nkvec_max, nevec, nevec_max,
nbox, nfunctions, nsums, bytes, sums;
nbox, nfunctions, nsums, sums;
double bytes;
double precision, g2_max;
double *kenergy, energy_self[EWALD_NFUNCS];
double *kvirial, virial_self[EWALD_NFUNCS];

View File

@ -15,21 +15,6 @@
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 "stdio.h"
#include "stdlib.h"
@ -40,6 +25,7 @@
#include "comm.h"
#include "neighbor.h"
#include "neigh_list.h"
#include "neigh_request.h"
#include "force.h"
#include "kspace.h"
#include "update.h"
@ -184,25 +170,19 @@ void PairBuckCoul::allocate()
extract protected data from object
------------------------------------------------------------------------- */
void *PairBuckCoul::extract_ptr(char *id)
void *PairBuckCoul::extract(char *id)
{
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[] = {
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;
for (i=0; ids[i]&&strcmp(ids[i], id); ++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
------------------------------------------------------------------------- */
@ -307,18 +287,12 @@ void PairBuckCoul::init_style()
if (ewald_order&(1<<1)) { // r^-1 kspace
if (force->kspace == NULL)
error->all("Pair style is incompatible with KSpace style");
else if (strcmp(force->kspace_style,"ewald") == 0)
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");
g_ewald = force->kspace->g_ewald;
}
if (ewald_order&(1<<6)) { // r^-6 kspace
if (!force->kspace && strcmp(force->kspace_style,"ewald/n"))
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

View File

@ -37,8 +37,7 @@ class PairBuckCoul : public Pair {
void write_restart_settings(FILE *);
void read_restart_settings(FILE *);
void single(int, int, int, int, double, double, double, int, One &);
void *extract_ptr(char *);
void extract_long(double *);
void *extract(char *);
void compute_inner();
void compute_middle();

View File

@ -15,22 +15,6 @@
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 "stdio.h"
#include "stdlib.h"
@ -41,6 +25,7 @@
#include "comm.h"
#include "neighbor.h"
#include "neigh_list.h"
#include "neigh_request.h"
#include "force.h"
#include "kspace.h"
#include "update.h"
@ -181,25 +166,19 @@ void PairLJCoul::allocate()
extract protected data from object
------------------------------------------------------------------------- */
void *PairLJCoul::extract_ptr(char *id)
void *PairLJCoul::extract(char *id)
{
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[] = {
lj4, sigma, epsilon, &ewald_order, &cut_coul, &mix_flag, NULL};
lj4, sigma, epsilon, &ewald_order, &cut_coul, &mix_flag, &cut_coul, NULL};
int i;
for (i=0; ids[i]&&strcmp(ids[i], id); ++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
------------------------------------------------------------------------- */

View File

@ -36,8 +36,7 @@ class PairLJCoul : public Pair {
void write_restart_settings(FILE *);
void read_restart_settings(FILE *);
void single(int, int, int, int, double, double, double, int, One &);
void *extract_ptr(char *);
void extract_long(double *);
void *extract(char *);
void compute_inner();
void compute_middle();

View File

@ -111,9 +111,9 @@ void DumpXTC::init()
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);
return bytes;
}

View File

@ -25,7 +25,7 @@ class DumpXTC : public Dump {
DumpXTC(class LAMMPS *, int, char**);
~DumpXTC();
void init();
int memory_usage();
double memory_usage();
private:
int natoms,ntotal;

View File

@ -37,7 +37,7 @@ class Angle : protected Pointers {
virtual void write_restart(FILE *) = 0;
virtual void read_restart(FILE *) = 0;
virtual double single(int, int, int, int) = 0;
virtual int memory_usage() {return 0;}
virtual double memory_usage() {return 0.0;}
};
}

View File

@ -1282,13 +1282,13 @@ void Atom::update_callback(int ifix)
add in global to local mapping storage
------------------------------------------------------------------------- */
int Atom::memory_usage()
double Atom::memory_usage()
{
memlength = DELTA_MEMSTR;
memstr = (char *) memory->smalloc(memlength*sizeof(char),"atom:memstr");
memstr[0] = '\0';
int bytes = avec->memory_usage();
double bytes = avec->memory_usage();
if (map_style == 1)
bytes += map_tag_max * sizeof(int);
else if (map_style == 2) {

View File

@ -135,7 +135,7 @@ class Atom : protected Pointers {
void delete_callback(const char *, int);
void update_callback(int);
int memory_usage();
double memory_usage();
int memcheck(const char *);
// functions for global to local ID mapping

View File

@ -71,7 +71,7 @@ class AtomVec : protected Pointers {
virtual void data_vel(int, char **);
virtual int data_vel_hybrid(int, char **) {return 0;}
virtual int memory_usage() = 0;
virtual double memory_usage() = 0;
protected:
int nmax; // local copy of atom->nmax

View File

@ -444,9 +444,9 @@ int AtomVecAtomic::data_atom_hybrid(int nlocal, char **values)
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("type")) bytes += nmax * sizeof(int);

View File

@ -38,7 +38,7 @@ class AtomVecAtomic : public AtomVec {
void create_atom(int, double *);
void data_atom(double *, int, char **);
int data_atom_hybrid(int, char **);
int memory_usage();
double memory_usage();
protected:
int *tag,*type,*mask,*image;

View File

@ -484,9 +484,9 @@ int AtomVecCharge::data_atom_hybrid(int nlocal, char **values)
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("type")) bytes += nmax * sizeof(int);

View File

@ -39,7 +39,7 @@ class AtomVecCharge : public AtomVec {
void create_atom(int, double *);
void data_atom(double *, int, char **);
int data_atom_hybrid(int, char **);
int memory_usage();
double memory_usage();
private:
int *tag,*type,*mask,*image;

View File

@ -523,9 +523,9 @@ void AtomVecHybrid::data_vel(int m, char **values)
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();
return bytes;
}

View File

@ -44,7 +44,7 @@ class AtomVecHybrid : public AtomVec {
void data_atom(double *, int, char **);
int data_atom_hybrid(int, char **) {return 0;}
void data_vel(int, char **);
int memory_usage();
double memory_usage();
private:
int *tag,*type,*mask,*image;

View File

@ -39,7 +39,7 @@ class Bond : protected Pointers {
virtual void write_restart(FILE *) = 0;
virtual void read_restart(FILE *) = 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;}
};
}

View File

@ -33,7 +33,7 @@ class BondHybrid : public Bond {
void write_restart(FILE *);
void read_restart(FILE *);
void single(int, double, int, int, int, double &, double &);
int memory_usage();
double memory_usage();
private:
int nstyles; // # of different bond styles

View File

@ -1476,9 +1476,9 @@ void Comm::set(int narg, char **arg)
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);
bytes += maxsend * sizeof(double);

View File

@ -53,7 +53,7 @@ class Comm : protected Pointers {
void irregular(); // irregular communication across all procs
void set(int, char **); // set communication style
int memory_usage(); // tally memory usage
double memory_usage();
private:
int triclinic; // 0 if domain is orthog, 1 if triclinic

View File

@ -61,7 +61,7 @@ class Compute : protected Pointers {
virtual int pack_reverse_comm(int, int, double *) {return 0;}
virtual void unpack_reverse_comm(int, int *, double *) {}
virtual int memory_usage() {return 0;}
virtual double memory_usage() {return 0.0;}
protected:
int extra_dof,dynamic;

View File

@ -180,9 +180,9 @@ void ComputeAttributeAtom::compute_peratom()
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 (size_peratom == 0) bytes = nmax * sizeof(double);
else bytes = size_peratom * nmax * sizeof(double);

View File

@ -24,7 +24,7 @@ class ComputeAttributeAtom : public Compute {
~ComputeAttributeAtom();
void init() {}
void compute_peratom();
int memory_usage();
double memory_usage();
private:
int which,allocate,nmax;

View File

@ -307,8 +307,8 @@ void ComputeCentroAtom::select2(int k, int n, double *arr, int *iarr)
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;
}

View File

@ -25,7 +25,7 @@ class ComputeCentroAtom : public Compute {
void init();
void init_list(int, class NeighList *);
void compute_peratom();
int memory_usage();
double memory_usage();
private:
int nmax,maxneigh;

View File

@ -146,8 +146,8 @@ void ComputeCoordAtom::compute_peratom()
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;
}

View File

@ -25,7 +25,7 @@ class ComputeCoordAtom : public Compute {
void init();
void init_list(int, class NeighList *);
void compute_peratom();
int memory_usage();
double memory_usage();
private:
int nmax;

View File

@ -159,8 +159,8 @@ void ComputeEbondAtom::unpack_reverse_comm(int n, int *list, double *buf)
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;
}

View File

@ -26,7 +26,7 @@ class ComputeEbondAtom : public Compute {
void compute_peratom();
int pack_reverse_comm(int, int, double *);
void unpack_reverse_comm(int, int *, double *);
int memory_usage();
double memory_usage();
private:
int nmax;

View File

@ -224,8 +224,8 @@ void ComputeEpairAtom::unpack_reverse_comm(int n, int *list, double *buf)
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;
}

View File

@ -27,7 +27,7 @@ class ComputeEpairAtom : public Compute {
void compute_peratom();
int pack_reverse_comm(int, int, double *);
void unpack_reverse_comm(int, int *, double *);
int memory_usage();
double memory_usage();
private:
int nmax,eamstyle;

View File

@ -98,8 +98,8 @@ void ComputeKEAtom::compute_peratom()
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;
}

View File

@ -24,7 +24,7 @@ class ComputeKEAtom : public Compute {
~ComputeKEAtom();
void init();
void compute_peratom();
int memory_usage();
double memory_usage();
private:
int nmax;

View File

@ -369,8 +369,8 @@ void ComputeStressAtom::unpack_reverse_comm(int n, int *list, double *buf)
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;
}

View File

@ -28,7 +28,7 @@ class ComputeStressAtom : public Compute {
void compute_peratom();
int pack_reverse_comm(int, int, double *);
void unpack_reverse_comm(int, int *, double *);
int memory_usage();
double memory_usage();
private:
int pairrequest,bondrequest,kerequest;

View File

@ -149,9 +149,9 @@ void ComputeSumAtom::compute_peratom()
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);
else bytes = nmax*size_peratom * sizeof(double);
return bytes;

View File

@ -24,7 +24,7 @@ class ComputeSumAtom : public Compute {
~ComputeSumAtom();
void init();
void compute_peratom();
int memory_usage();
double memory_usage();
private:
int nmax;

View File

@ -87,8 +87,8 @@ void ComputeVariableAtom::compute_peratom()
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;
}

View File

@ -24,7 +24,7 @@ class ComputeVariableAtom : public Compute {
~ComputeVariableAtom();
void init();
void compute_peratom();
int memory_usage();
double memory_usage();
private:
int nmax,ivariable;

View File

@ -38,7 +38,7 @@ class Dihedral : protected Pointers {
virtual void coeff(int, int, char **) = 0;
virtual void write_restart(FILE *) = 0;
virtual void read_restart(FILE *) = 0;
virtual int memory_usage() {return 0;}
virtual double memory_usage() {return 0.0;}
};
}

View File

@ -255,9 +255,9 @@ void Dump::modify_params(int narg, char **arg)
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;
}

View File

@ -48,7 +48,7 @@ class Dump : protected Pointers {
virtual void init() {}
void write();
void modify_params(int, char **);
virtual int memory_usage();
virtual double memory_usage();
protected:
double boxxlo,boxxhi; // local copies of domain values

View File

@ -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
------------------------------------------------------------------------- */
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(double);
return bytes;

View File

@ -23,7 +23,7 @@ class DumpCustom : public Dump {
DumpCustom(class LAMMPS *, int, char **);
~DumpCustom();
void init();
int memory_usage();
double memory_usage();
private:
int nevery; // dump frequency to check Fix against

View File

@ -103,9 +103,9 @@ void DumpDCD::init()
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);
return bytes;
}

View File

@ -25,7 +25,7 @@ class DumpDCD : public Dump {
DumpDCD(LAMMPS *, int, char**);
~DumpDCD();
void init();
int memory_usage();
double memory_usage();
private:
int natoms,ntotal,headerflag,nevery_save,nframes;

View File

@ -80,9 +80,9 @@ void DumpXYZ::init()
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) {
bytes += natoms * sizeof(int);
bytes += 3*natoms * sizeof(float);

View File

@ -23,7 +23,7 @@ class DumpXYZ : public Dump {
DumpXYZ(class LAMMPS *, int, char**);
~DumpXYZ();
void init();
int memory_usage();
double memory_usage();
private:
int natoms,ntotal;

Some files were not shown because too many files have changed in this diff Show More