Merge branch 'master' into thermo-energy
# Conflicts: # doc/src/fix_ti_spring.rst # src/RIGID/fix_rigid_small.cpp # src/fix_langevin.cpp # src/fix_temp_berendsen.cpp # src/fix_temp_csld.cpp # src/fix_temp_csvr.cpp # src/fix_temp_rescale.cpp # src/thermo.cpp
This commit is contained in:
@ -60,28 +60,22 @@ FixEfield::FixEfield(LAMMPS *lmp, int narg, char **arg) :
|
||||
qe2f = force->qe2f;
|
||||
xstr = ystr = zstr = nullptr;
|
||||
|
||||
if (strstr(arg[3],"v_") == arg[3]) {
|
||||
int n = strlen(&arg[3][2]) + 1;
|
||||
xstr = new char[n];
|
||||
strcpy(xstr,&arg[3][2]);
|
||||
if (utils::strmatch(arg[3],"^v_")) {
|
||||
xstr = utils::strdup(arg[3]+2);
|
||||
} else {
|
||||
ex = qe2f * utils::numeric(FLERR,arg[3],false,lmp);
|
||||
xstyle = CONSTANT;
|
||||
}
|
||||
|
||||
if (strstr(arg[4],"v_") == arg[4]) {
|
||||
int n = strlen(&arg[4][2]) + 1;
|
||||
ystr = new char[n];
|
||||
strcpy(ystr,&arg[4][2]);
|
||||
if (utils::strmatch(arg[4],"^v_")) {
|
||||
ystr = utils::strdup(arg[4]+2);
|
||||
} else {
|
||||
ey = qe2f * utils::numeric(FLERR,arg[4],false,lmp);
|
||||
ystyle = CONSTANT;
|
||||
}
|
||||
|
||||
if (strstr(arg[5],"v_") == arg[5]) {
|
||||
int n = strlen(&arg[5][2]) + 1;
|
||||
zstr = new char[n];
|
||||
strcpy(zstr,&arg[5][2]);
|
||||
if (utils::strmatch(arg[5],"^v_")) {
|
||||
zstr = utils::strdup(arg[5]+2);
|
||||
} else {
|
||||
ez = qe2f * utils::numeric(FLERR,arg[5],false,lmp);
|
||||
zstyle = CONSTANT;
|
||||
@ -100,16 +94,12 @@ FixEfield::FixEfield(LAMMPS *lmp, int narg, char **arg) :
|
||||
iregion = domain->find_region(arg[iarg+1]);
|
||||
if (iregion == -1)
|
||||
error->all(FLERR,"Region ID for fix efield does not exist");
|
||||
int n = strlen(arg[iarg+1]) + 1;
|
||||
idregion = new char[n];
|
||||
strcpy(idregion,arg[iarg+1]);
|
||||
idregion = utils::strdup(arg[iarg+1]);
|
||||
iarg += 2;
|
||||
} else if (strcmp(arg[iarg],"energy") == 0) {
|
||||
if (iarg+2 > narg) error->all(FLERR,"Illegal fix efield command");
|
||||
if (strstr(arg[iarg+1],"v_") == arg[iarg+1]) {
|
||||
int n = strlen(&arg[iarg+1][2]) + 1;
|
||||
estr = new char[n];
|
||||
strcpy(estr,&arg[iarg+1][2]);
|
||||
if (utils::strmatch(arg[iarg+1],"^v_")) {
|
||||
estr = utils::strdup(arg[iarg+1]+2);
|
||||
} else error->all(FLERR,"Illegal fix efield command");
|
||||
iarg += 2;
|
||||
} else error->all(FLERR,"Illegal fix efield command");
|
||||
|
||||
@ -487,7 +487,7 @@ void FixGLD::reset_dt()
|
||||
|
||||
double FixGLD::memory_usage()
|
||||
{
|
||||
double bytes = atom->nmax*3*prony_terms*sizeof(double);
|
||||
double bytes = (double)atom->nmax*3*prony_terms*sizeof(double);
|
||||
return bytes;
|
||||
}
|
||||
|
||||
|
||||
@ -595,7 +595,7 @@ int FixOrientBCC::compare(const void *pi, const void *pj)
|
||||
|
||||
double FixOrientBCC::memory_usage()
|
||||
{
|
||||
double bytes = nmax * sizeof(Nbr);
|
||||
bytes += 2*nmax * sizeof(double);
|
||||
double bytes = (double)nmax * sizeof(Nbr);
|
||||
bytes += (double)2*nmax * sizeof(double);
|
||||
return bytes;
|
||||
}
|
||||
|
||||
@ -593,7 +593,7 @@ int FixOrientFCC::compare(const void *pi, const void *pj)
|
||||
|
||||
double FixOrientFCC::memory_usage()
|
||||
{
|
||||
double bytes = nmax * sizeof(Nbr);
|
||||
bytes += 2*nmax * sizeof(double);
|
||||
double bytes = (double)nmax * sizeof(Nbr);
|
||||
bytes += (double)2*nmax * sizeof(double);
|
||||
return bytes;
|
||||
}
|
||||
|
||||
@ -558,8 +558,8 @@ void FixTTM::end_of_step()
|
||||
double FixTTM::memory_usage()
|
||||
{
|
||||
double bytes = 0.0;
|
||||
bytes += 5*total_nnodes * sizeof(int);
|
||||
bytes += 14*total_nnodes * sizeof(double);
|
||||
bytes += (double)5*total_nnodes * sizeof(int);
|
||||
bytes += (double)14*total_nnodes * sizeof(double);
|
||||
return bytes;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user