From db0524278a694bf0f676c424fdb6ca71d37d4fe3 Mon Sep 17 00:00:00 2001 From: Anders Hafreager Date: Mon, 7 Nov 2016 19:58:27 +0100 Subject: [PATCH] Initializing pointers in PERI, QEQ and REPLICA --- src/PERI/compute_damage_atom.cpp | 3 +-- src/QEQ/fix_qeq.cpp | 6 +++++- src/REPLICA/compute_event_displace.cpp | 2 +- src/REPLICA/fix_event.cpp | 11 ++--------- src/REPLICA/fix_neb.cpp | 5 ++++- src/REPLICA/verlet_split.cpp | 2 +- 6 files changed, 14 insertions(+), 15 deletions(-) diff --git a/src/PERI/compute_damage_atom.cpp b/src/PERI/compute_damage_atom.cpp index 305ab4e716..a3bc580f7a 100644 --- a/src/PERI/compute_damage_atom.cpp +++ b/src/PERI/compute_damage_atom.cpp @@ -32,7 +32,7 @@ using namespace LAMMPS_NS; /* ---------------------------------------------------------------------- */ ComputeDamageAtom::ComputeDamageAtom(LAMMPS *lmp, int narg, char **arg) : - Compute(lmp, narg, arg) + Compute(lmp, narg, arg), damage(NULL) { if (narg != 3) error->all(FLERR,"Illegal compute damage/atom command"); @@ -40,7 +40,6 @@ ComputeDamageAtom::ComputeDamageAtom(LAMMPS *lmp, int narg, char **arg) : size_peratom_cols = 0; nmax = 0; - damage = NULL; } /* ---------------------------------------------------------------------- */ diff --git a/src/QEQ/fix_qeq.cpp b/src/QEQ/fix_qeq.cpp index 3c6b1530fa..01d51e12ed 100644 --- a/src/QEQ/fix_qeq.cpp +++ b/src/QEQ/fix_qeq.cpp @@ -46,7 +46,11 @@ using namespace FixConst; /* ---------------------------------------------------------------------- */ FixQEq::FixQEq(LAMMPS *lmp, int narg, char **arg) : - Fix(lmp, narg, arg) + Fix(lmp, narg, arg), list(NULL), chi(NULL), eta(NULL), + gamma(NULL), zeta(NULL), zcore(NULL), chizj(NULL), shld(NULL), + s(NULL), t(NULL), s_hist(NULL), t_hist(NULL), Hdia_inv(NULL), b_s(NULL), + b_t(NULL), p(NULL), q(NULL), r(NULL), d(NULL), + qf(NULL), q1(NULL), q2(NULL), qv(NULL) { if (narg < 8) error->all(FLERR,"Illegal fix qeq command"); diff --git a/src/REPLICA/compute_event_displace.cpp b/src/REPLICA/compute_event_displace.cpp index 7ff803459e..cdd0e5de40 100644 --- a/src/REPLICA/compute_event_displace.cpp +++ b/src/REPLICA/compute_event_displace.cpp @@ -36,7 +36,7 @@ using namespace LAMMPS_NS; /* ---------------------------------------------------------------------- */ ComputeEventDisplace::ComputeEventDisplace(LAMMPS *lmp, int narg, char **arg) : - Compute(lmp, narg, arg) + Compute(lmp, narg, arg), id_event(NULL), fix_event(NULL) { if (narg != 4) error->all(FLERR,"Illegal compute event/displace command"); diff --git a/src/REPLICA/fix_event.cpp b/src/REPLICA/fix_event.cpp index f3276178e2..f688550a65 100644 --- a/src/REPLICA/fix_event.cpp +++ b/src/REPLICA/fix_event.cpp @@ -33,7 +33,8 @@ using namespace FixConst; /* ---------------------------------------------------------------------- */ FixEvent::FixEvent(LAMMPS *lmp, int narg, char **arg) : - Fix(lmp, narg, arg) + Fix(lmp, narg, arg), xevent(NULL), xold(NULL), vold(NULL), + imageold(NULL), xorig(NULL), vorig(NULL), imageorig(NULL) { if (narg != 3) error->all(FLERR,"Illegal fix event command"); @@ -42,14 +43,6 @@ FixEvent::FixEvent(LAMMPS *lmp, int narg, char **arg) : // perform initial allocation of atom-based array // register with Atom class - xevent = NULL; - xold = NULL; - vold = NULL; - imageold = NULL; - xorig = NULL; - vorig = NULL; - imageorig = NULL; - grow_arrays(atom->nmax); atom->add_callback(0); } diff --git a/src/REPLICA/fix_neb.cpp b/src/REPLICA/fix_neb.cpp index 959db84262..939e4d7fac 100644 --- a/src/REPLICA/fix_neb.cpp +++ b/src/REPLICA/fix_neb.cpp @@ -36,7 +36,10 @@ enum{SINGLE_PROC_DIRECT,SINGLE_PROC_MAP,MULTI_PROC}; /* ---------------------------------------------------------------------- */ FixNEB::FixNEB(LAMMPS *lmp, int narg, char **arg) : - Fix(lmp, narg, arg) + Fix(lmp, narg, arg), id_pe(NULL), pe(NULL), xprev(NULL), xnext(NULL), + tangent(NULL), xsend(NULL), xrecv(NULL), tagsend(NULL), tagrecv(NULL), + xsendall(NULL), xrecvall(NULL), tagsendall(NULL), tagrecvall(NULL), + counts(NULL), displacements(NULL) { if (narg != 4) error->all(FLERR,"Illegal fix neb command"); diff --git a/src/REPLICA/verlet_split.cpp b/src/REPLICA/verlet_split.cpp index 80d8f58f0d..4572170f34 100644 --- a/src/REPLICA/verlet_split.cpp +++ b/src/REPLICA/verlet_split.cpp @@ -43,7 +43,7 @@ using namespace LAMMPS_NS; /* ---------------------------------------------------------------------- */ VerletSplit::VerletSplit(LAMMPS *lmp, int narg, char **arg) : - Verlet(lmp, narg, arg) + Verlet(lmp, narg, arg), qsize(NULL), qdisp(NULL), xsize(NULL), xdisp(NULL), f_kspace(NULL) { // error checks on partitions