diff --git a/src/compute.cpp b/src/compute.cpp index 153116e4d5a64f466ac73430f57a41e32aa73f7b..96bf6ceb54857886d2ec72efe9588ee83ac00a57 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), vbiasall(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 9301d3ed7d3e7f0d65168c53f3ac64f99e137299..a9fe0f817e1ecf078d6de8de95db6f46ff9519e8 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 031d4856b58669d4095a54fce5801624f4fa6d18..2ea78311a2b00cd866def9a14f98bdc37aa56831 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 5e88f5bc25c46bdcd7f7aa6058d45aa7bf536632..98c6ea044110e211e28c00765bc45a0c3a4384a2 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 241702d67276db9461cf5f79609a3b9a02731105..29869713e72237f0ebd5e2574ff882e2084ee1dd 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 9cea55de585529a2f76fa607ac8d7e85a7ff8d9c..f7917acd2b24fa94cc6541e95ab768103ba79df2 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 3640b11269f38ba9e534d4c7fd405a55b24208c8..3f88095d770a51f70a06b748b5566b17319bb134 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 b9286ea482246684d9334a57ebe22a860d07e18a..7b578611f02dfc481dffbe67837f7a60915ee489 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"); diff --git a/src/compute_cluster_atom.cpp b/src/compute_cluster_atom.cpp index c81785f2152464bf293144efdea23ed1004ba0e7..80c002d39fe418d099445ebd6944c6f702285805 100644 --- a/src/compute_cluster_atom.cpp +++ b/src/compute_cluster_atom.cpp @@ -34,7 +34,8 @@ using namespace LAMMPS_NS; /* ---------------------------------------------------------------------- */ ComputeClusterAtom::ComputeClusterAtom(LAMMPS *lmp, int narg, char **arg) : - Compute(lmp, narg, arg) + Compute(lmp, narg, arg), + clusterID(NULL) { if (narg != 4) error->all(FLERR,"Illegal compute cluster/atom command"); @@ -46,7 +47,6 @@ ComputeClusterAtom::ComputeClusterAtom(LAMMPS *lmp, int narg, char **arg) : comm_forward = 1; nmax = 0; - clusterID = NULL; } /* ---------------------------------------------------------------------- */ diff --git a/src/compute_cna_atom.cpp b/src/compute_cna_atom.cpp index 46c6726b0007edcf508b37522ace3c1fd166d69c..024a95d9d1a9b64a45b23ec89d16295ab1d5523f 100644 --- a/src/compute_cna_atom.cpp +++ b/src/compute_cna_atom.cpp @@ -42,7 +42,8 @@ enum{NCOMMON,NBOND,MAXBOND,MINBOND}; /* ---------------------------------------------------------------------- */ ComputeCNAAtom::ComputeCNAAtom(LAMMPS *lmp, int narg, char **arg) : - Compute(lmp, narg, arg) + Compute(lmp, narg, arg), + nearest(NULL), nnearest(NULL), pattern(NULL) { if (narg != 4) error->all(FLERR,"Illegal compute cna/atom command"); @@ -54,9 +55,6 @@ ComputeCNAAtom::ComputeCNAAtom(LAMMPS *lmp, int narg, char **arg) : cutsq = cutoff*cutoff; nmax = 0; - nearest = NULL; - nnearest = NULL; - pattern = NULL; } /* ---------------------------------------------------------------------- */ diff --git a/src/compute_com_chunk.cpp b/src/compute_com_chunk.cpp index ebf2b30f6e14036315fe11e7bbfe741f9059e083..3eb686783b2511e4db32e7e048aa8b52f1e527a6 100644 --- a/src/compute_com_chunk.cpp +++ b/src/compute_com_chunk.cpp @@ -28,7 +28,8 @@ enum{ONCE,NFREQ,EVERY}; /* ---------------------------------------------------------------------- */ ComputeCOMChunk::ComputeCOMChunk(LAMMPS *lmp, int narg, char **arg) : - Compute(lmp, narg, arg) + Compute(lmp, narg, arg), + idchunk(NULL), masstotal(NULL), massproc(NULL), com(NULL), comall(NULL) { if (narg != 4) error->all(FLERR,"Illegal compute com/chunk command"); @@ -50,8 +51,6 @@ ComputeCOMChunk::ComputeCOMChunk(LAMMPS *lmp, int narg, char **arg) : nchunk = 1; maxchunk = 0; - massproc = masstotal = NULL; - com = comall = NULL; allocate(); firstflag = massneed = 1; diff --git a/src/compute_contact_atom.cpp b/src/compute_contact_atom.cpp index 99c4766b6bbc0d8f50d56b199dd5bf4fa9df420a..c86829bc14e03f9534aa54d6b51aa4b562dc2443 100644 --- a/src/compute_contact_atom.cpp +++ b/src/compute_contact_atom.cpp @@ -32,7 +32,8 @@ using namespace LAMMPS_NS; /* ---------------------------------------------------------------------- */ ComputeContactAtom::ComputeContactAtom(LAMMPS *lmp, int narg, char **arg) : - Compute(lmp, narg, arg) + Compute(lmp, narg, arg), + contact(NULL) { if (narg != 3) error->all(FLERR,"Illegal compute contact/atom command"); @@ -41,7 +42,6 @@ ComputeContactAtom::ComputeContactAtom(LAMMPS *lmp, int narg, char **arg) : comm_reverse = 1; nmax = 0; - contact = NULL; // error checks diff --git a/src/compute_coord_atom.cpp b/src/compute_coord_atom.cpp index c6aa561eb6be808fe8e736bb635a85c3e16bdff3..5747c869dc6fc565bd14ebcfff28ab652b8cdac1 100644 --- a/src/compute_coord_atom.cpp +++ b/src/compute_coord_atom.cpp @@ -32,7 +32,8 @@ using namespace LAMMPS_NS; /* ---------------------------------------------------------------------- */ ComputeCoordAtom::ComputeCoordAtom(LAMMPS *lmp, int narg, char **arg) : - Compute(lmp, narg, arg) + Compute(lmp, narg, arg), + typelo(NULL), typehi(NULL), cvec(NULL), carray(NULL) { if (narg < 4) error->all(FLERR,"Illegal compute coord/atom command"); @@ -65,8 +66,6 @@ ComputeCoordAtom::ComputeCoordAtom(LAMMPS *lmp, int narg, char **arg) : else size_peratom_cols = ncol; nmax = 0; - cvec = NULL; - carray = NULL; } /* ---------------------------------------------------------------------- */ diff --git a/src/compute_dihedral.cpp b/src/compute_dihedral.cpp index c6cb97c0dd751e8f1770ed076314449c1c22305e..bbd7fe20384e6b83dbd4585a62264365571f78a0 100644 --- a/src/compute_dihedral.cpp +++ b/src/compute_dihedral.cpp @@ -24,7 +24,8 @@ using namespace LAMMPS_NS; /* ---------------------------------------------------------------------- */ ComputeDihedral::ComputeDihedral(LAMMPS *lmp, int narg, char **arg) : - Compute(lmp, narg, arg) + Compute(lmp, narg, arg), + emine(NULL) { if (narg != 3) error->all(FLERR,"Illegal compute dihedral command"); diff --git a/src/compute_dihedral_local.cpp b/src/compute_dihedral_local.cpp index 66523d00a18be8405ac0bc4364b56d82ab1747e6..f50f49fa11326f3b05164d4eb125eebf292ab9ce 100644 --- a/src/compute_dihedral_local.cpp +++ b/src/compute_dihedral_local.cpp @@ -34,7 +34,8 @@ using namespace MathConst; /* ---------------------------------------------------------------------- */ ComputeDihedralLocal::ComputeDihedralLocal(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 dihedral/local command"); @@ -56,8 +57,6 @@ ComputeDihedralLocal::ComputeDihedralLocal(LAMMPS *lmp, int narg, char **arg) : } nmax = 0; - vector = NULL; - array = NULL; } /* ---------------------------------------------------------------------- */ diff --git a/src/compute_dipole_chunk.cpp b/src/compute_dipole_chunk.cpp index cb618055f677f864a9c0b6c7b98dcab0d25cedfb..4bdf23e2734d2770bcdacf5df05cb471c45cabb1 100644 --- a/src/compute_dipole_chunk.cpp +++ b/src/compute_dipole_chunk.cpp @@ -30,7 +30,9 @@ enum { MASSCENTER, GEOMCENTER }; /* ---------------------------------------------------------------------- */ ComputeDipoleChunk::ComputeDipoleChunk(LAMMPS *lmp, int narg, char **arg) : - Compute(lmp, narg, arg) + Compute(lmp, narg, arg), + idchunk(NULL), massproc(NULL), masstotal(NULL), chrgproc(NULL), chrgtotal(NULL), com(NULL), + comall(NULL), dipole(NULL), dipoleall(NULL) { if ((narg != 4) && (narg != 5)) error->all(FLERR,"Illegal compute dipole/chunk command"); @@ -60,10 +62,6 @@ ComputeDipoleChunk::ComputeDipoleChunk(LAMMPS *lmp, int narg, char **arg) : nchunk = 1; maxchunk = 0; - massproc = masstotal = NULL; - chrgproc = chrgtotal = NULL; - com = comall = NULL; - dipole = dipoleall = NULL; allocate(); } diff --git a/src/compute_displace_atom.cpp b/src/compute_displace_atom.cpp index f274c32f5db8908a45667fcd61449f7063a56949..03a56b2bc40e8e3e713fede865398f7f54cf0e1f 100644 --- a/src/compute_displace_atom.cpp +++ b/src/compute_displace_atom.cpp @@ -29,7 +29,8 @@ using namespace LAMMPS_NS; /* ---------------------------------------------------------------------- */ ComputeDisplaceAtom::ComputeDisplaceAtom(LAMMPS *lmp, int narg, char **arg) : - Compute(lmp, narg, arg) + Compute(lmp, narg, arg), + id_fix(NULL), displace(NULL) { if (narg != 3) error->all(FLERR,"Illegal compute displace/atom command"); @@ -76,7 +77,6 @@ ComputeDisplaceAtom::ComputeDisplaceAtom(LAMMPS *lmp, int narg, char **arg) : // per-atom displacement array nmax = 0; - displace = NULL; } /* ---------------------------------------------------------------------- */ diff --git a/src/compute_erotate_sphere_atom.cpp b/src/compute_erotate_sphere_atom.cpp index ed6946e8c87abf9521654759f3564627624c4ee7..b29c18c1e3438085a630197146af2457e083c6d0 100644 --- a/src/compute_erotate_sphere_atom.cpp +++ b/src/compute_erotate_sphere_atom.cpp @@ -29,7 +29,8 @@ using namespace LAMMPS_NS; ComputeErotateSphereAtom:: ComputeErotateSphereAtom(LAMMPS *lmp, int narg, char **arg) : - Compute(lmp, narg, arg) + Compute(lmp, narg, arg), + erot(NULL) { if (narg != 3) error->all(FLERR,"Illegal compute erotate/sphere//atom command"); @@ -43,7 +44,6 @@ ComputeErotateSphereAtom(LAMMPS *lmp, int narg, char **arg) : error->all(FLERR,"Compute erotate/sphere/atom requires atom style sphere"); nmax = 0; - erot = NULL; } /* ---------------------------------------------------------------------- */ diff --git a/src/compute_group_group.cpp b/src/compute_group_group.cpp index 741d4a667beeea7432d029e24894e2d6a11c67ae..4b5e6ad05bab0ca3d74f81cb4591b602a3b1f570 100644 --- a/src/compute_group_group.cpp +++ b/src/compute_group_group.cpp @@ -42,7 +42,8 @@ using namespace MathConst; /* ---------------------------------------------------------------------- */ ComputeGroupGroup::ComputeGroupGroup(LAMMPS *lmp, int narg, char **arg) : - Compute(lmp, narg, arg) + Compute(lmp, narg, arg), + group2(NULL) { if (narg < 4) error->all(FLERR,"Illegal compute group/group command"); diff --git a/src/compute_gyration_chunk.cpp b/src/compute_gyration_chunk.cpp index 58fe33bc3cea6f3df13f5a17b28f219b8d7745c1..f7e774566b89df1c5354e68cc94131d22a17a346 100644 --- a/src/compute_gyration_chunk.cpp +++ b/src/compute_gyration_chunk.cpp @@ -27,7 +27,9 @@ using namespace LAMMPS_NS; /* ---------------------------------------------------------------------- */ ComputeGyrationChunk::ComputeGyrationChunk(LAMMPS *lmp, int narg, char **arg) : - Compute(lmp, narg, arg) + Compute(lmp, narg, arg), + idchunk(NULL), massproc(NULL), masstotal(NULL), com(NULL), comall(NULL), rg(NULL), + rgall(NULL), rgt(NULL), rgtall(NULL) { if (narg < 4) error->all(FLERR,"Illegal compute gyration/chunk command"); @@ -67,10 +69,6 @@ ComputeGyrationChunk::ComputeGyrationChunk(LAMMPS *lmp, int narg, char **arg) : nchunk = 1; maxchunk = 0; - massproc = masstotal = NULL; - com = comall = NULL; - rg = rgall = NULL; - rgt = rgtall = NULL; allocate(); } diff --git a/src/compute_heat_flux.cpp b/src/compute_heat_flux.cpp index 33e7f7a4498daa8bfdf41f7bb10bfae8fb7dde8d..108691aec240b46907fa4189199d99af5dc428a5 100644 --- a/src/compute_heat_flux.cpp +++ b/src/compute_heat_flux.cpp @@ -33,7 +33,8 @@ using namespace LAMMPS_NS; /* ---------------------------------------------------------------------- */ ComputeHeatFlux::ComputeHeatFlux(LAMMPS *lmp, int narg, char **arg) : - Compute(lmp, narg, arg) + Compute(lmp, narg, arg), + id_ke(NULL), id_pe(NULL), id_stress(NULL) { if (narg != 6) error->all(FLERR,"Illegal compute heat/flux command"); diff --git a/src/compute_hexorder_atom.cpp b/src/compute_hexorder_atom.cpp index cf9bd6d09f3cf0dcc4b0951eed35977c16558273..93b84080bc90a23a766e5db0031d65ce679ebb5d 100644 --- a/src/compute_hexorder_atom.cpp +++ b/src/compute_hexorder_atom.cpp @@ -44,7 +44,8 @@ using namespace MathConst; /* ---------------------------------------------------------------------- */ ComputeHexOrderAtom::ComputeHexOrderAtom(LAMMPS *lmp, int narg, char **arg) : - Compute(lmp, narg, arg) + Compute(lmp, narg, arg), + distsq(NULL), nearest(NULL), qnarray(NULL) { if (narg < 3 ) error->all(FLERR,"Illegal compute hexorder/atom command"); @@ -87,10 +88,7 @@ ComputeHexOrderAtom::ComputeHexOrderAtom(LAMMPS *lmp, int narg, char **arg) : size_peratom_cols = ncol; nmax = 0; - qnarray = NULL; maxneigh = 0; - distsq = NULL; - nearest = NULL; } /* ---------------------------------------------------------------------- */ diff --git a/src/compute_improper.cpp b/src/compute_improper.cpp index 961ddb2c1e114b7892d8eefc8228e494c3978350..32c5811af13ff272be9829a8656b5553f9074821 100644 --- a/src/compute_improper.cpp +++ b/src/compute_improper.cpp @@ -24,7 +24,8 @@ using namespace LAMMPS_NS; /* ---------------------------------------------------------------------- */ ComputeImproper::ComputeImproper(LAMMPS *lmp, int narg, char **arg) : - Compute(lmp, narg, arg) + Compute(lmp, narg, arg), + emine(NULL) { if (narg != 3) error->all(FLERR,"Illegal compute improper command"); diff --git a/src/compute_improper_local.cpp b/src/compute_improper_local.cpp index 3c0af24a106cd9c158404a705c67e550a2a48dd9..b9d69dc5b89eee3b8d6663291282112bfc2ddd8a 100644 --- a/src/compute_improper_local.cpp +++ b/src/compute_improper_local.cpp @@ -35,7 +35,8 @@ using namespace MathConst; /* ---------------------------------------------------------------------- */ ComputeImproperLocal::ComputeImproperLocal(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 improper/local command"); @@ -57,8 +58,6 @@ ComputeImproperLocal::ComputeImproperLocal(LAMMPS *lmp, int narg, char **arg) : } nmax = 0; - vector = NULL; - array = NULL; } /* ---------------------------------------------------------------------- */ diff --git a/src/compute_inertia_chunk.cpp b/src/compute_inertia_chunk.cpp index c4e83fa4a1e4a246014d8ff68866748a78ad9ca3..1e3c595ed1db93406d9a8e1c1528ac09413f9e1b 100644 --- a/src/compute_inertia_chunk.cpp +++ b/src/compute_inertia_chunk.cpp @@ -26,7 +26,9 @@ using namespace LAMMPS_NS; /* ---------------------------------------------------------------------- */ ComputeInertiaChunk::ComputeInertiaChunk(LAMMPS *lmp, int narg, char **arg) : - Compute(lmp, narg, arg) + Compute(lmp, narg, arg), + idchunk(NULL), massproc(NULL), masstotal(NULL), com(NULL), comall(NULL), + inertia(NULL), inertiaall(NULL) { if (narg != 4) error->all(FLERR,"Illegal compute inertia/chunk command"); @@ -48,9 +50,6 @@ ComputeInertiaChunk::ComputeInertiaChunk(LAMMPS *lmp, int narg, char **arg) : nchunk = 1; maxchunk = 0; - massproc = masstotal = NULL; - com = comall = NULL; - inertia = inertiaall = NULL; allocate(); } diff --git a/src/compute_ke_atom.cpp b/src/compute_ke_atom.cpp index aa893981a40542860ec4beab09f012395f24a764..da159669dea4f88f615639f4379fbc9b36776ac6 100644 --- a/src/compute_ke_atom.cpp +++ b/src/compute_ke_atom.cpp @@ -26,7 +26,8 @@ using namespace LAMMPS_NS; /* ---------------------------------------------------------------------- */ ComputeKEAtom::ComputeKEAtom(LAMMPS *lmp, int narg, char **arg) : - Compute(lmp, narg, arg) + Compute(lmp, narg, arg), + ke(NULL) { if (narg != 3) error->all(FLERR,"Illegal compute ke/atom command"); @@ -34,7 +35,6 @@ ComputeKEAtom::ComputeKEAtom(LAMMPS *lmp, int narg, char **arg) : size_peratom_cols = 0; nmax = 0; - ke = NULL; } /* ---------------------------------------------------------------------- */ diff --git a/src/compute_msd.cpp b/src/compute_msd.cpp index 7f005d27593a7e75d98e6c169442ff99c2c5ddd6..f2e82fe23943f663423e8a2be58da041e2bf0926 100644 --- a/src/compute_msd.cpp +++ b/src/compute_msd.cpp @@ -26,7 +26,8 @@ using namespace LAMMPS_NS; /* ---------------------------------------------------------------------- */ ComputeMSD::ComputeMSD(LAMMPS *lmp, int narg, char **arg) : - Compute(lmp, narg, arg) + Compute(lmp, narg, arg), + id_fix(NULL) { if (narg < 3) error->all(FLERR,"Illegal compute msd command"); diff --git a/src/compute_msd_chunk.cpp b/src/compute_msd_chunk.cpp index 30eee1d64ac3aa7681ea9d67ed5b33984a9a9cf7..bc5a374fadb8c53f713c1d176f1998a0ebe93437 100644 --- a/src/compute_msd_chunk.cpp +++ b/src/compute_msd_chunk.cpp @@ -28,7 +28,8 @@ using namespace LAMMPS_NS; /* ---------------------------------------------------------------------- */ ComputeMSDChunk::ComputeMSDChunk(LAMMPS *lmp, int narg, char **arg) : - Compute(lmp, narg, arg) + Compute(lmp, narg, arg), + idchunk(NULL), id_fix(NULL), massproc(NULL), masstotal(NULL), com(NULL), comall(NULL), msd(NULL) { if (narg != 4) error->all(FLERR,"Illegal compute msd/chunk command"); @@ -47,10 +48,6 @@ ComputeMSDChunk::ComputeMSDChunk(LAMMPS *lmp, int narg, char **arg) : firstflag = 1; init(); - massproc = masstotal = NULL; - com = comall = NULL; - msd = NULL; - // create a new fix STORE style for reference positions // id = compute-ID + COMPUTE_STORE, fix group = compute group // do not know size of array at this point, just allocate 1x3 array diff --git a/src/compute_omega_chunk.cpp b/src/compute_omega_chunk.cpp index 54e0b8f9066ba977318c85b5a40ba4a8795e63a4..58acc19c37eb24f7cfdd19795071d12095f93162 100644 --- a/src/compute_omega_chunk.cpp +++ b/src/compute_omega_chunk.cpp @@ -26,7 +26,8 @@ using namespace LAMMPS_NS; /* ---------------------------------------------------------------------- */ ComputeOmegaChunk::ComputeOmegaChunk(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 omega/chunk command"); @@ -48,9 +49,6 @@ ComputeOmegaChunk::ComputeOmegaChunk(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_orientorder_atom.cpp b/src/compute_orientorder_atom.cpp index fd3493cd7ea0e43f5f37d1c6abbb29f1cabaa1ce..6c5a2c0c0e10b0df9e0d32521a7e0230ca1c2eb8 100644 --- a/src/compute_orientorder_atom.cpp +++ b/src/compute_orientorder_atom.cpp @@ -45,7 +45,8 @@ using namespace std; /* ---------------------------------------------------------------------- */ ComputeOrientOrderAtom::ComputeOrientOrderAtom(LAMMPS *lmp, int narg, char **arg) : - Compute(lmp, narg, arg) + Compute(lmp, narg, arg), + distsq(NULL), nearest(NULL), rlist(NULL), qlist(NULL), qnarray(NULL), qnm_r(NULL), qnm_i(NULL) { if (narg < 3 ) error->all(FLERR,"Illegal compute orientorder/atom command"); @@ -109,13 +110,7 @@ ComputeOrientOrderAtom::ComputeOrientOrderAtom(LAMMPS *lmp, int narg, char **arg size_peratom_cols = ncol; nmax = 0; - qnarray = NULL; maxneigh = 0; - distsq = NULL; - nearest = NULL; - rlist = NULL; - qnm_r = NULL; - qnm_i = NULL; } /* ---------------------------------------------------------------------- */ diff --git a/src/compute_pair.cpp b/src/compute_pair.cpp index 62661b43e618339dad63a5dad9f29f160a03c6b9..b00944e1bcc6b42a9eae7d9170fd402421a38d37 100644 --- a/src/compute_pair.cpp +++ b/src/compute_pair.cpp @@ -26,7 +26,8 @@ enum{EPAIR,EVDWL,ECOUL}; /* ---------------------------------------------------------------------- */ ComputePair::ComputePair(LAMMPS *lmp, int narg, char **arg) : - Compute(lmp, narg, arg) + Compute(lmp, narg, arg), + pstyle(NULL), pair(NULL), one(NULL) { if (narg < 4 || narg > 5) error->all(FLERR,"Illegal compute pair command"); diff --git a/src/compute_pair_local.cpp b/src/compute_pair_local.cpp index 13dccc578705dc6813af7d3eac77d52e34bf1f08..6ba4b75728ab696e293552207053d1145697863b 100644 --- a/src/compute_pair_local.cpp +++ b/src/compute_pair_local.cpp @@ -36,7 +36,8 @@ enum{TYPE,RADIUS}; /* ---------------------------------------------------------------------- */ ComputePairLocal::ComputePairLocal(LAMMPS *lmp, int narg, char **arg) : - Compute(lmp, narg, arg) + Compute(lmp, narg, arg), + pstyle(NULL), pindex(NULL), vector(NULL), array(NULL) { if (narg < 4) error->all(FLERR,"Illegal compute pair/local command"); @@ -96,8 +97,6 @@ ComputePairLocal::ComputePairLocal(LAMMPS *lmp, int narg, char **arg) : if (pstyle[i] != DIST) singleflag = 1; nmax = 0; - vector = NULL; - array = NULL; } /* ---------------------------------------------------------------------- */ diff --git a/src/compute_pe_atom.cpp b/src/compute_pe_atom.cpp index c04edb09f506b7a3db6284d9f02c2f49bd24531d..f83c91b94cd7e71397a0090c8ba81b9ca9df4e37 100755 --- a/src/compute_pe_atom.cpp +++ b/src/compute_pe_atom.cpp @@ -33,7 +33,8 @@ using namespace LAMMPS_NS; /* ---------------------------------------------------------------------- */ ComputePEAtom::ComputePEAtom(LAMMPS *lmp, int narg, char **arg) : - Compute(lmp, narg, arg) + Compute(lmp, narg, arg), + energy(NULL) { if (narg < 3) error->all(FLERR,"Illegal compute pe/atom command"); @@ -68,7 +69,6 @@ ComputePEAtom::ComputePEAtom(LAMMPS *lmp, int narg, char **arg) : } nmax = 0; - energy = NULL; } /* ---------------------------------------------------------------------- */ diff --git a/src/compute_pressure.cpp b/src/compute_pressure.cpp index ca493e46fd5ec2891f9dac637dc57e807e7ead13..fde19a277ac23eb7af5f91c6ebd8de7534b8d07f 100644 --- a/src/compute_pressure.cpp +++ b/src/compute_pressure.cpp @@ -34,7 +34,8 @@ using namespace LAMMPS_NS; /* ---------------------------------------------------------------------- */ ComputePressure::ComputePressure(LAMMPS *lmp, int narg, char **arg) : - Compute(lmp, narg, arg) + Compute(lmp, narg, arg), + vptr(NULL), id_temp(NULL) { if (narg < 4) error->all(FLERR,"Illegal compute pressure command"); if (igroup) error->all(FLERR,"Compute pressure must use group all"); diff --git a/src/compute_property_atom.cpp b/src/compute_property_atom.cpp index c9575dba5f78a87047322f0e6ad7bc5d18dfd63a..2ce10fdb687ba5367f31069611f8ac99481632d0 100644 --- a/src/compute_property_atom.cpp +++ b/src/compute_property_atom.cpp @@ -32,7 +32,8 @@ using namespace LAMMPS_NS; /* ---------------------------------------------------------------------- */ ComputePropertyAtom::ComputePropertyAtom(LAMMPS *lmp, int narg, char **arg) : - Compute(lmp, narg, arg) + Compute(lmp, narg, arg), + index(NULL), vector(NULL), array(NULL), pack_choice(NULL) { if (narg < 4) error->all(FLERR,"Illegal compute property/atom command"); @@ -352,8 +353,6 @@ ComputePropertyAtom::ComputePropertyAtom(LAMMPS *lmp, int narg, char **arg) : } nmax = 0; - vector = NULL; - array = NULL; } /* ---------------------------------------------------------------------- */ diff --git a/src/compute_property_chunk.cpp b/src/compute_property_chunk.cpp index 95677489189e061ca9e3d44e4a6ca9ec13c5b65e..1461a83ad237fe7e275771af2c8b493e4f6db7c2 100644 --- a/src/compute_property_chunk.cpp +++ b/src/compute_property_chunk.cpp @@ -25,7 +25,8 @@ using namespace LAMMPS_NS; /* ---------------------------------------------------------------------- */ ComputePropertyChunk::ComputePropertyChunk(LAMMPS *lmp, int narg, char **arg) : - Compute(lmp, narg, arg) + Compute(lmp, narg, arg), + idchunk(NULL), count_one(NULL), count_all(NULL) { if (narg < 5) error->all(FLERR,"Illegal compute property/chunk command"); @@ -78,9 +79,6 @@ ComputePropertyChunk::ComputePropertyChunk(LAMMPS *lmp, int narg, char **arg) : nchunk = 1; maxchunk = 0; - vector = NULL; - array = NULL; - count_one = count_all = NULL; allocate(); if (nvalues == 1) { diff --git a/src/compute_property_local.cpp b/src/compute_property_local.cpp index 60460f271af222bdc0228faeda083c9337873207..b9472cb45b6d09420b7502ab59d6eacf43141575 100644 --- a/src/compute_property_local.cpp +++ b/src/compute_property_local.cpp @@ -34,7 +34,8 @@ enum{TYPE,RADIUS}; /* ---------------------------------------------------------------------- */ ComputePropertyLocal::ComputePropertyLocal(LAMMPS *lmp, int narg, char **arg) : - Compute(lmp, narg, arg) + Compute(lmp, narg, arg), + vector(NULL), array(NULL), indices(NULL), pack_choice(NULL) { if (narg < 4) error->all(FLERR,"Illegal compute property/local command"); @@ -253,9 +254,6 @@ ComputePropertyLocal::ComputePropertyLocal(LAMMPS *lmp, int narg, char **arg) : error->all(FLERR,"Compute property/local requires atom attribute radius"); nmax = 0; - vector = NULL; - array = NULL; - indices = NULL; } /* ---------------------------------------------------------------------- */ diff --git a/src/compute_rdf.cpp b/src/compute_rdf.cpp index 14a12bb5c6d647cb0588f864c58d96d5648fd501..86245080178d4f19853df130e934ec6edd0cdd43 100644 --- a/src/compute_rdf.cpp +++ b/src/compute_rdf.cpp @@ -38,7 +38,9 @@ using namespace MathConst; /* ---------------------------------------------------------------------- */ ComputeRDF::ComputeRDF(LAMMPS *lmp, int narg, char **arg) : - Compute(lmp, narg, arg) + Compute(lmp, narg, arg), + rdfpair(NULL), nrdfpair(NULL), ilo(NULL), ihi(NULL), jlo(NULL), jhi(NULL), + hist(NULL), histall(NULL), typecount(NULL), icount(NULL), jcount(NULL), duplicates(NULL) { if (narg < 4 || (narg-4) % 2) error->all(FLERR,"Illegal compute rdf command"); diff --git a/src/compute_reduce.cpp b/src/compute_reduce.cpp index 7ea3c2aafef057ea3ff7401baa9832ea3ae8de40..dc6896f27b03727efc5466f180b1662c94c51297 100644 --- a/src/compute_reduce.cpp +++ b/src/compute_reduce.cpp @@ -43,7 +43,9 @@ enum{PERATOM,LOCAL}; /* ---------------------------------------------------------------------- */ ComputeReduce::ComputeReduce(LAMMPS *lmp, int narg, char **arg) : - Compute(lmp, narg, arg) + Compute(lmp, narg, arg), + nvalues(0), which(NULL), argindex(NULL), flavor(NULL), value2index(NULL), ids(NULL), + onevec(NULL), replace(NULL), indices(NULL), owner(NULL), idregion(NULL), varatom(NULL) { int iarg = 0; if (strcmp(style,"reduce") == 0) { diff --git a/src/compute_slice.cpp b/src/compute_slice.cpp index d2c3c18de4f99cddaa09d9b8f265655b57eaef6e..da077ddfc034e02524e3321eff833fab35cbbaa8 100644 --- a/src/compute_slice.cpp +++ b/src/compute_slice.cpp @@ -34,7 +34,8 @@ enum{COMPUTE,FIX,VARIABLE}; /* ---------------------------------------------------------------------- */ ComputeSlice::ComputeSlice(LAMMPS *lmp, int narg, char **arg) : - Compute(lmp, narg, arg) + Compute(lmp, narg, arg), + nvalues(0), which(NULL), argindex(NULL), value2index(NULL), ids(NULL) { if (narg < 7) error->all(FLERR,"Illegal compute slice command"); diff --git a/src/compute_stress_atom.cpp b/src/compute_stress_atom.cpp index 3455d9eb0865879ded3ea864714dbc3f8546d8dc..46ee2ec3c52e4e906449280e3330e7eec3eaf34f 100644 --- a/src/compute_stress_atom.cpp +++ b/src/compute_stress_atom.cpp @@ -36,7 +36,8 @@ enum{NOBIAS,BIAS}; /* ---------------------------------------------------------------------- */ ComputeStressAtom::ComputeStressAtom(LAMMPS *lmp, int narg, char **arg) : - Compute(lmp, narg, arg) + Compute(lmp, narg, arg), + id_temp(NULL), stress(NULL) { if (narg < 4) error->all(FLERR,"Illegal compute stress/atom command"); @@ -98,7 +99,6 @@ ComputeStressAtom::ComputeStressAtom(LAMMPS *lmp, int narg, char **arg) : } nmax = 0; - stress = NULL; } /* ---------------------------------------------------------------------- */ diff --git a/src/compute_temp_chunk.cpp b/src/compute_temp_chunk.cpp index 87d6e11864c0d76a0a33d2edeaa828e063cc9ff7..8daaeb0621e574f93cc396defa67d8382036a845 100644 --- a/src/compute_temp_chunk.cpp +++ b/src/compute_temp_chunk.cpp @@ -29,7 +29,9 @@ enum{TEMP,KECOM,INTERNAL}; /* ---------------------------------------------------------------------- */ ComputeTempChunk::ComputeTempChunk(LAMMPS *lmp, int narg, char **arg) : - Compute(lmp, narg, arg) + Compute(lmp, narg, arg), + which(NULL), idchunk(NULL), id_bias(NULL), sum(NULL), sumall(NULL), count(NULL), + countall(NULL), massproc(NULL), masstotal(NULL), vcm(NULL), vcmall(NULL) { if (narg < 4) error->all(FLERR,"Illegal compute temp/chunk command"); @@ -129,12 +131,7 @@ ComputeTempChunk::ComputeTempChunk(LAMMPS *lmp, int narg, char **arg) : nchunk = 1; maxchunk = 0; - sum = sumall = NULL; - count = countall = NULL; - massproc = masstotal = NULL; - vcm = vcmall = NULL; - array = NULL; - + if (nvalues) { array_flag = 1; size_array_cols = nvalues; diff --git a/src/compute_temp_profile.cpp b/src/compute_temp_profile.cpp index 654bea7ebecc7c759c4191985f96d1c482f5874a..1c6e56359d83b356e3ef799de02e95c52db1951e 100644 --- a/src/compute_temp_profile.cpp +++ b/src/compute_temp_profile.cpp @@ -31,7 +31,8 @@ enum{TENSOR,BIN}; /* ---------------------------------------------------------------------- */ ComputeTempProfile::ComputeTempProfile(LAMMPS *lmp, int narg, char **arg) : - Compute(lmp, narg, arg) + Compute(lmp, narg, arg), + bin(NULL), vbin(NULL), binave(NULL), tbin(NULL), tbinall(NULL) { if (narg < 7) error->all(FLERR,"Illegal compute temp/profile command"); @@ -138,7 +139,6 @@ ComputeTempProfile::ComputeTempProfile(LAMMPS *lmp, int narg, char **arg) : } maxatom = 0; - bin = NULL; } /* ---------------------------------------------------------------------- */ diff --git a/src/compute_temp_region.cpp b/src/compute_temp_region.cpp index 33e07bfb1e8a785d47037fe36837395e040be96b..e636669344394f1f87197af02bc6a31b45c20e13 100644 --- a/src/compute_temp_region.cpp +++ b/src/compute_temp_region.cpp @@ -28,7 +28,8 @@ using namespace LAMMPS_NS; /* ---------------------------------------------------------------------- */ ComputeTempRegion::ComputeTempRegion(LAMMPS *lmp, int narg, char **arg) : - Compute(lmp, narg, arg) + Compute(lmp, narg, arg), + idregion(NULL) { if (narg != 4) error->all(FLERR,"Illegal compute temp/region command"); diff --git a/src/compute_temp_sphere.cpp b/src/compute_temp_sphere.cpp index 64b23308e2253bafcf9e5f10a8f679825d972612..50995dfa8405eff4ae937eb05b4441839b381948 100644 --- a/src/compute_temp_sphere.cpp +++ b/src/compute_temp_sphere.cpp @@ -33,7 +33,8 @@ enum{ROTATE,ALL}; /* ---------------------------------------------------------------------- */ ComputeTempSphere::ComputeTempSphere(LAMMPS *lmp, int narg, char **arg) : - Compute(lmp, narg, arg) + Compute(lmp, narg, arg), + id_bias(NULL) { if (narg < 3) error->all(FLERR,"Illegal compute temp/sphere command"); @@ -44,7 +45,6 @@ ComputeTempSphere::ComputeTempSphere(LAMMPS *lmp, int narg, char **arg) : tempflag = 1; tempbias = 0; - id_bias = NULL; mode = ALL; int iarg = 3; diff --git a/src/compute_torque_chunk.cpp b/src/compute_torque_chunk.cpp index 5462debcfc1c611667e27c11722ad56f8ab31172..25386ad40d7873e836dd40738f2a022072de8107 100644 --- a/src/compute_torque_chunk.cpp +++ b/src/compute_torque_chunk.cpp @@ -26,7 +26,8 @@ using namespace LAMMPS_NS; /* ---------------------------------------------------------------------- */ ComputeTorqueChunk::ComputeTorqueChunk(LAMMPS *lmp, int narg, char **arg) : - Compute(lmp, narg, arg) + Compute(lmp, narg, arg), + idchunk(NULL), massproc(NULL), masstotal(NULL), com(NULL), comall(NULL), torque(NULL), torqueall(NULL) { if (narg != 4) error->all(FLERR,"Illegal compute torque/chunk command"); @@ -48,9 +49,6 @@ ComputeTorqueChunk::ComputeTorqueChunk(LAMMPS *lmp, int narg, char **arg) : nchunk = 1; maxchunk = 0; - massproc = masstotal = NULL; - com = comall = NULL; - torque = torqueall = NULL; allocate(); } diff --git a/src/compute_vacf.cpp b/src/compute_vacf.cpp index c06113a770e8068def324f97687ffc48301979ff..6ba272e579857daed749610646039b423ae7d4a0 100755 --- a/src/compute_vacf.cpp +++ b/src/compute_vacf.cpp @@ -25,7 +25,8 @@ using namespace LAMMPS_NS; /* ---------------------------------------------------------------------- */ ComputeVACF::ComputeVACF(LAMMPS *lmp, int narg, char **arg) : - Compute(lmp, narg, arg) + Compute(lmp, narg, arg), + id_fix(NULL) { if (narg < 3) error->all(FLERR,"Illegal compute vacf command"); diff --git a/src/compute_vcm_chunk.cpp b/src/compute_vcm_chunk.cpp index cd864b2aa805df0ce4b55ea08bfbff0430c8a7b8..0661bf44574d1f0a2ace74caa8fba70bc5172adf 100644 --- a/src/compute_vcm_chunk.cpp +++ b/src/compute_vcm_chunk.cpp @@ -28,7 +28,8 @@ enum{ONCE,NFREQ,EVERY}; /* ---------------------------------------------------------------------- */ ComputeVCMChunk::ComputeVCMChunk(LAMMPS *lmp, int narg, char **arg) : - Compute(lmp, narg, arg) + Compute(lmp, narg, arg), + idchunk(NULL), massproc(NULL), masstotal(NULL), vcm(NULL), vcmall(NULL) { if (narg != 4) error->all(FLERR,"Illegal compute vcm/chunk command"); @@ -50,8 +51,6 @@ ComputeVCMChunk::ComputeVCMChunk(LAMMPS *lmp, int narg, char **arg) : nchunk = 1; maxchunk = 0; - massproc = masstotal = NULL; - vcm = vcmall = NULL; allocate(); firstflag = massneed = 1;