mirror of https://github.com/lammps/lammps.git
Fixed initialization of arrays in fixes
This commit is contained in:
parent
fd05a1325e
commit
265cc14125
|
@ -37,7 +37,8 @@ enum{ISO,ANISO};
|
||||||
/* ---------------------------------------------------------------------- */
|
/* ---------------------------------------------------------------------- */
|
||||||
|
|
||||||
FixPressBerendsen::FixPressBerendsen(LAMMPS *lmp, int narg, char **arg) :
|
FixPressBerendsen::FixPressBerendsen(LAMMPS *lmp, int narg, char **arg) :
|
||||||
Fix(lmp, narg, arg)
|
Fix(lmp, narg, arg),
|
||||||
|
id_temp(NULL), id_press(NULL), tflag(0), pflag(0)
|
||||||
{
|
{
|
||||||
if (narg < 5) error->all(FLERR,"Illegal fix press/berendsen command");
|
if (narg < 5) error->all(FLERR,"Illegal fix press/berendsen command");
|
||||||
|
|
||||||
|
|
|
@ -28,7 +28,8 @@ using namespace FixConst;
|
||||||
/* ---------------------------------------------------------------------- */
|
/* ---------------------------------------------------------------------- */
|
||||||
|
|
||||||
FixPrint::FixPrint(LAMMPS *lmp, int narg, char **arg) :
|
FixPrint::FixPrint(LAMMPS *lmp, int narg, char **arg) :
|
||||||
Fix(lmp, narg, arg)
|
Fix(lmp, narg, arg),
|
||||||
|
fp(NULL), string(NULL), copy(NULL), work(NULL)
|
||||||
{
|
{
|
||||||
if (narg < 5) error->all(FLERR,"Illegal fix print command");
|
if (narg < 5) error->all(FLERR,"Illegal fix print command");
|
||||||
nevery = force->inumeric(FLERR,arg[3]);
|
nevery = force->inumeric(FLERR,arg[3]);
|
||||||
|
|
|
@ -29,7 +29,8 @@ enum{MOLECULE,CHARGE,RMASS,INTEGER,DOUBLE};
|
||||||
/* ---------------------------------------------------------------------- */
|
/* ---------------------------------------------------------------------- */
|
||||||
|
|
||||||
FixPropertyAtom::FixPropertyAtom(LAMMPS *lmp, int narg, char **arg) :
|
FixPropertyAtom::FixPropertyAtom(LAMMPS *lmp, int narg, char **arg) :
|
||||||
Fix(lmp, narg, arg)
|
Fix(lmp, narg, arg),
|
||||||
|
nvalue(0), style(NULL), index(NULL), astyle(NULL)
|
||||||
{
|
{
|
||||||
if (narg < 4) error->all(FLERR,"Illegal fix property/atom command");
|
if (narg < 4) error->all(FLERR,"Illegal fix property/atom command");
|
||||||
|
|
||||||
|
|
|
@ -23,7 +23,8 @@ using namespace FixConst;
|
||||||
/* ---------------------------------------------------------------------- */
|
/* ---------------------------------------------------------------------- */
|
||||||
|
|
||||||
FixReadRestart::FixReadRestart(LAMMPS *lmp, int narg, char **arg) :
|
FixReadRestart::FixReadRestart(LAMMPS *lmp, int narg, char **arg) :
|
||||||
Fix(lmp, narg, arg)
|
Fix(lmp, narg, arg),
|
||||||
|
count(NULL), extra(NULL)
|
||||||
{
|
{
|
||||||
nextra = force->inumeric(FLERR,arg[3]);
|
nextra = force->inumeric(FLERR,arg[3]);
|
||||||
int nfix = force->inumeric(FLERR,arg[4]);
|
int nfix = force->inumeric(FLERR,arg[4]);
|
||||||
|
@ -31,8 +32,6 @@ FixReadRestart::FixReadRestart(LAMMPS *lmp, int narg, char **arg) :
|
||||||
// perform initial allocation of atom-based array
|
// perform initial allocation of atom-based array
|
||||||
// register with Atom class
|
// register with Atom class
|
||||||
|
|
||||||
count = NULL;
|
|
||||||
extra = NULL;
|
|
||||||
grow_arrays(atom->nmax);
|
grow_arrays(atom->nmax);
|
||||||
atom->add_callback(0);
|
atom->add_callback(0);
|
||||||
|
|
||||||
|
|
|
@ -24,7 +24,8 @@ using namespace FixConst;
|
||||||
/* ---------------------------------------------------------------------- */
|
/* ---------------------------------------------------------------------- */
|
||||||
|
|
||||||
FixRespa::FixRespa(LAMMPS *lmp, int narg, char **arg) :
|
FixRespa::FixRespa(LAMMPS *lmp, int narg, char **arg) :
|
||||||
Fix(lmp, narg, arg)
|
Fix(lmp, narg, arg),
|
||||||
|
store_torque(0), f_level(NULL), t_level(NULL)
|
||||||
{
|
{
|
||||||
// nlevels = # of rRESPA levels
|
// nlevels = # of rRESPA levels
|
||||||
|
|
||||||
|
|
|
@ -44,7 +44,8 @@ enum{BOND,ANGLE,DIHEDRAL};
|
||||||
/* ---------------------------------------------------------------------- */
|
/* ---------------------------------------------------------------------- */
|
||||||
|
|
||||||
FixRestrain::FixRestrain(LAMMPS *lmp, int narg, char **arg) :
|
FixRestrain::FixRestrain(LAMMPS *lmp, int narg, char **arg) :
|
||||||
Fix(lmp, narg, arg)
|
Fix(lmp, narg, arg),
|
||||||
|
rstyle(NULL), ids(NULL), kstart(NULL), kstop(NULL), target(NULL), cos_target(NULL), sin_target(NULL)
|
||||||
{
|
{
|
||||||
if (narg < 4) error->all(FLERR,"Illegal fix restrain command");
|
if (narg < 4) error->all(FLERR,"Illegal fix restrain command");
|
||||||
|
|
||||||
|
@ -57,11 +58,7 @@ FixRestrain::FixRestrain(LAMMPS *lmp, int narg, char **arg) :
|
||||||
// parse args
|
// parse args
|
||||||
|
|
||||||
nrestrain = maxrestrain = 0;
|
nrestrain = maxrestrain = 0;
|
||||||
rstyle = NULL;
|
|
||||||
ids = NULL;
|
|
||||||
kstart = kstop = NULL;
|
|
||||||
target = cos_target = sin_target = NULL;
|
|
||||||
|
|
||||||
int iarg = 3;
|
int iarg = 3;
|
||||||
while (iarg < narg) {
|
while (iarg < narg) {
|
||||||
if (nrestrain == maxrestrain) {
|
if (nrestrain == maxrestrain) {
|
||||||
|
|
|
@ -34,7 +34,8 @@ enum{NONE,CONSTANT,EQUAL,ATOM};
|
||||||
/* ---------------------------------------------------------------------- */
|
/* ---------------------------------------------------------------------- */
|
||||||
|
|
||||||
FixSetForce::FixSetForce(LAMMPS *lmp, int narg, char **arg) :
|
FixSetForce::FixSetForce(LAMMPS *lmp, int narg, char **arg) :
|
||||||
Fix(lmp, narg, arg)
|
Fix(lmp, narg, arg),
|
||||||
|
xstr(NULL), ystr(NULL), zstr(NULL), idregion(NULL), sforce(NULL)
|
||||||
{
|
{
|
||||||
if (narg < 6) error->all(FLERR,"Illegal fix setforce command");
|
if (narg < 6) error->all(FLERR,"Illegal fix setforce command");
|
||||||
|
|
||||||
|
|
|
@ -34,7 +34,8 @@ enum{NPARTNER,PERPARTNER};
|
||||||
/* ---------------------------------------------------------------------- */
|
/* ---------------------------------------------------------------------- */
|
||||||
|
|
||||||
FixShearHistory::FixShearHistory(LAMMPS *lmp, int narg, char **arg) :
|
FixShearHistory::FixShearHistory(LAMMPS *lmp, int narg, char **arg) :
|
||||||
Fix(lmp, narg, arg)
|
Fix(lmp, narg, arg),
|
||||||
|
npartner(NULL), partner(NULL), shearpartner(NULL), ipage(NULL), dpage(NULL)
|
||||||
{
|
{
|
||||||
if (narg != 4) error->all(FLERR,"Illegal fix SHEAR_HISTORY commmand");
|
if (narg != 4) error->all(FLERR,"Illegal fix SHEAR_HISTORY commmand");
|
||||||
|
|
||||||
|
@ -57,15 +58,10 @@ FixShearHistory::FixShearHistory(LAMMPS *lmp, int narg, char **arg) :
|
||||||
// perform initial allocation of atom-based arrays
|
// perform initial allocation of atom-based arrays
|
||||||
// register with atom class
|
// register with atom class
|
||||||
|
|
||||||
npartner = NULL;
|
|
||||||
partner = NULL;
|
|
||||||
shearpartner = NULL;
|
|
||||||
grow_arrays(atom->nmax);
|
grow_arrays(atom->nmax);
|
||||||
atom->add_callback(0);
|
atom->add_callback(0);
|
||||||
atom->add_callback(1);
|
atom->add_callback(1);
|
||||||
|
|
||||||
ipage = NULL;
|
|
||||||
dpage = NULL;
|
|
||||||
pgsize = oneatom = 0;
|
pgsize = oneatom = 0;
|
||||||
|
|
||||||
// initialize npartner to 0 so neighbor list creation is OK the 1st time
|
// initialize npartner to 0 so neighbor list creation is OK the 1st time
|
||||||
|
|
|
@ -37,7 +37,8 @@ enum{TETHER,COUPLE};
|
||||||
/* ---------------------------------------------------------------------- */
|
/* ---------------------------------------------------------------------- */
|
||||||
|
|
||||||
FixSpring::FixSpring(LAMMPS *lmp, int narg, char **arg) :
|
FixSpring::FixSpring(LAMMPS *lmp, int narg, char **arg) :
|
||||||
Fix(lmp, narg, arg)
|
Fix(lmp, narg, arg),
|
||||||
|
group2(NULL)
|
||||||
{
|
{
|
||||||
if (narg < 9) error->all(FLERR,"Illegal fix spring command");
|
if (narg < 9) error->all(FLERR,"Illegal fix spring command");
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue