diff --git a/src/compute.cpp b/src/compute.cpp index 153116e4d5..20cb88ad8a 100644 --- a/src/compute.cpp +++ b/src/compute.cpp @@ -38,10 +38,13 @@ int Compute::instance_total = 0; /* ---------------------------------------------------------------------- */ -Compute::Compute(LAMMPS *lmp, int narg, char **arg) : Pointers(lmp) +Compute::Compute(LAMMPS *lmp, int narg, char **arg) : Pointers(lmp), + id(NULL), style(NULL), + vector(NULL), array(NULL), vector_atom(NULL), array_atom(NULL), vector_local(NULL), array_local(NULL), + tlist(NULL) { instance_me = instance_total++; - + if (narg < 3) error->all(FLERR,"Illegal compute command"); // compute ID, group, and style @@ -93,8 +96,7 @@ Compute::Compute(LAMMPS *lmp, int narg, char **arg) : Pointers(lmp) // setup list of timesteps ntime = maxtime = 0; - tlist = NULL; - + // data masks datamask = ALL_MASK; @@ -105,11 +107,6 @@ Compute::Compute(LAMMPS *lmp, int narg, char **arg) : Pointers(lmp) datamask_modify = ALL_MASK; copymode = 0; - - // force init to zero in case these are used as logicals - - vector = vector_atom = vector_local = NULL; - array = array_atom = array_local = NULL; } /* ---------------------------------------------------------------------- */ diff --git a/src/compute_angle.cpp b/src/compute_angle.cpp index 9301d3ed7d..a9fe0f817e 100644 --- a/src/compute_angle.cpp +++ b/src/compute_angle.cpp @@ -24,7 +24,8 @@ using namespace LAMMPS_NS; /* ---------------------------------------------------------------------- */ ComputeAngle::ComputeAngle(LAMMPS *lmp, int narg, char **arg) : - Compute(lmp, narg, arg) + Compute(lmp, narg, arg), + emine(NULL) { if (narg != 3) error->all(FLERR,"Illegal compute angle command"); diff --git a/src/compute_angle_local.cpp b/src/compute_angle_local.cpp index 031d4856b5..2ea78311a2 100644 --- a/src/compute_angle_local.cpp +++ b/src/compute_angle_local.cpp @@ -33,7 +33,8 @@ using namespace MathConst; /* ---------------------------------------------------------------------- */ ComputeAngleLocal::ComputeAngleLocal(LAMMPS *lmp, int narg, char **arg) : - Compute(lmp, narg, arg) + Compute(lmp, narg, arg), + vector(NULL), array(NULL) { if (narg < 4) error->all(FLERR,"Illegal compute angle/local command"); @@ -55,8 +56,6 @@ ComputeAngleLocal::ComputeAngleLocal(LAMMPS *lmp, int narg, char **arg) : } nmax = 0; - vector = NULL; - array = NULL; } /* ---------------------------------------------------------------------- */ diff --git a/src/compute_angmom_chunk.cpp b/src/compute_angmom_chunk.cpp index 5e88f5bc25..98c6ea0441 100644 --- a/src/compute_angmom_chunk.cpp +++ b/src/compute_angmom_chunk.cpp @@ -26,7 +26,8 @@ using namespace LAMMPS_NS; /* ---------------------------------------------------------------------- */ ComputeAngmomChunk::ComputeAngmomChunk(LAMMPS *lmp, int narg, char **arg) : - Compute(lmp, narg, arg) + Compute(lmp, narg, arg), + idchunk(NULL), massproc(NULL), masstotal(NULL), com(NULL), comall(NULL), angmom(NULL), angmomall(NULL) { if (narg != 4) error->all(FLERR,"Illegal compute angmom/chunk command"); @@ -48,9 +49,6 @@ ComputeAngmomChunk::ComputeAngmomChunk(LAMMPS *lmp, int narg, char **arg) : nchunk = 1; maxchunk = 0; - massproc = masstotal = NULL; - com = comall = NULL; - angmom = angmomall = NULL; allocate(); } diff --git a/src/compute_bond.cpp b/src/compute_bond.cpp index 241702d672..29869713e7 100644 --- a/src/compute_bond.cpp +++ b/src/compute_bond.cpp @@ -24,7 +24,8 @@ using namespace LAMMPS_NS; /* ---------------------------------------------------------------------- */ ComputeBond::ComputeBond(LAMMPS *lmp, int narg, char **arg) : - Compute(lmp, narg, arg) + Compute(lmp, narg, arg), + emine(NULL) { if (narg != 3) error->all(FLERR,"Illegal compute bond command"); diff --git a/src/compute_bond_local.cpp b/src/compute_bond_local.cpp index 9cea55de58..f7917acd2b 100644 --- a/src/compute_bond_local.cpp +++ b/src/compute_bond_local.cpp @@ -33,7 +33,8 @@ enum{DIST,ENG,FORCE}; /* ---------------------------------------------------------------------- */ ComputeBondLocal::ComputeBondLocal(LAMMPS *lmp, int narg, char **arg) : - Compute(lmp, narg, arg) + Compute(lmp, narg, arg), + bstyle(NULL), vector(NULL), array(NULL) { if (narg < 4) error->all(FLERR,"Illegal compute bond/local command"); @@ -62,8 +63,6 @@ ComputeBondLocal::ComputeBondLocal(LAMMPS *lmp, int narg, char **arg) : if (bstyle[i] != DIST) singleflag = 1; nmax = 0; - vector = NULL; - array = NULL; } /* ---------------------------------------------------------------------- */ diff --git a/src/compute_centro_atom.cpp b/src/compute_centro_atom.cpp index 3640b11269..3f88095d77 100644 --- a/src/compute_centro_atom.cpp +++ b/src/compute_centro_atom.cpp @@ -36,7 +36,8 @@ using namespace LAMMPS_NS; /* ---------------------------------------------------------------------- */ ComputeCentroAtom::ComputeCentroAtom(LAMMPS *lmp, int narg, char **arg) : - Compute(lmp, narg, arg) + Compute(lmp, narg, arg), + distsq(NULL), nearest(NULL), centro(NULL) { if (narg < 4 || narg > 6) error->all(FLERR,"Illegal compute centro/atom command"); @@ -69,11 +70,7 @@ ComputeCentroAtom::ComputeCentroAtom(LAMMPS *lmp, int narg, char **arg) : else size_peratom_cols = 10; nmax = 0; - centro = NULL; maxneigh = 0; - distsq = NULL; - nearest = NULL; - array_atom = NULL; } /* ---------------------------------------------------------------------- */ diff --git a/src/compute_chunk_atom.cpp b/src/compute_chunk_atom.cpp index b9286ea482..7b578611f0 100644 --- a/src/compute_chunk_atom.cpp +++ b/src/compute_chunk_atom.cpp @@ -56,7 +56,10 @@ ComputeChunkAtom *ComputeChunkAtom::cptr; /* ---------------------------------------------------------------------- */ ComputeChunkAtom::ComputeChunkAtom(LAMMPS *lmp, int narg, char **arg) : - Compute(lmp, narg, arg) + Compute(lmp, narg, arg), + id_fix(NULL), chunk(NULL), ichunk(NULL), exclude(NULL), + chunk_volume_vec(NULL), coord(NULL), chunkID(NULL), idregion(NULL), cfvid(NULL), + hash(NULL), varatom(NULL) { if (narg < 4) error->all(FLERR,"Illegal compute chunk/atom command");