Merge pull request #263 from andeplane/IP_RIGID_SHOCK

Initialize pointers in RIGID and SHOCK
This commit is contained in:
sjplimp
2016-11-09 11:51:36 -07:00
committed by GitHub
14 changed files with 59 additions and 23 deletions

View File

@ -27,7 +27,7 @@ using namespace LAMMPS_NS;
/* ---------------------------------------------------------------------- */
ComputeERotateRigid::ComputeERotateRigid(LAMMPS *lmp, int narg, char **arg) :
Compute(lmp, narg, arg)
Compute(lmp, narg, arg), rfix(NULL)
{
if (narg != 4) error->all(FLERR,"Illegal compute erotate/rigid command");

View File

@ -27,7 +27,7 @@ using namespace LAMMPS_NS;
/* ---------------------------------------------------------------------- */
ComputeKERigid::ComputeKERigid(LAMMPS *lmp, int narg, char **arg) :
Compute(lmp, narg, arg)
Compute(lmp, narg, arg), rfix(NULL)
{
if (narg != 4) error->all(FLERR,"Illegal compute ke/rigid command");

View File

@ -33,7 +33,7 @@ enum{ID,MOL,MASS,X,Y,Z,XU,YU,ZU,VX,VY,VZ,FX,FY,FZ,IX,IY,IZ,
/* ---------------------------------------------------------------------- */
ComputeRigidLocal::ComputeRigidLocal(LAMMPS *lmp, int narg, char **arg) :
Compute(lmp, narg, arg)
Compute(lmp, narg, arg), rstyle(NULL), idrigid(NULL), fixrigid(NULL)
{
if (narg < 5) error->all(FLERR,"Illegal compute rigid/local command");
@ -90,7 +90,6 @@ ComputeRigidLocal::ComputeRigidLocal(LAMMPS *lmp, int narg, char **arg) :
ncount = nmax = 0;
vector = NULL;
array = NULL;
fixrigid = NULL;
}
/* ---------------------------------------------------------------------- */

View File

@ -49,7 +49,9 @@ enum{CONSTANT,EQUAL,ATOM};
/* ---------------------------------------------------------------------- */
FixEHEX::FixEHEX(LAMMPS *lmp, int narg, char **arg) : Fix(lmp, narg, arg)
FixEHEX::FixEHEX(LAMMPS *lmp, int narg, char **arg) : Fix(lmp, narg, arg),
idregion(NULL), x(NULL), f(NULL), v(NULL),
mass(NULL), rmass(NULL), type(NULL), scalingmask(NULL)
{
MPI_Comm_rank(world, &me);
@ -73,8 +75,7 @@ FixEHEX::FixEHEX(LAMMPS *lmp, int narg, char **arg) : Fix(lmp, narg, arg)
// optional args
iregion = -1;
idregion = NULL;
// NOTE: constraints are deactivated by default
constraints = 0;

View File

@ -53,18 +53,18 @@ class FixEHEX : public Fix {
char *idregion;
int me;
double ** x; // coordinates
double ** f; // forces
double ** v; // velocities
double * mass; // masses
double * rmass; // reduced masses
int * type; // atom types
double **x; // coordinates
double **f; // forces
double **v; // velocities
double *mass; // masses
double *rmass; // reduced masses
int *type; // atom types
int nlocal; // number of local atoms
FixShake * fshake; // pointer to fix_shake/fix_rattle
int constraints; // constraints (0/1)
int cluster; // rescaling entire clusters (0/1)
int hex; // HEX mode (0/1)
bool * scalingmask; // scalingmask[i] determines whether
bool *scalingmask; // scalingmask[i] determines whether
// the velocity of atom i is to be rescaled
};

View File

@ -56,7 +56,16 @@ enum{ISO,ANISO,TRICLINIC};
/* ---------------------------------------------------------------------- */
FixRigid::FixRigid(LAMMPS *lmp, int narg, char **arg) :
Fix(lmp, narg, arg)
Fix(lmp, narg, arg), step_respa(NULL),
infile(NULL), nrigid(NULL), mol2body(NULL), body2mol(NULL),
body(NULL), displace(NULL), masstotal(NULL), xcm(NULL),
vcm(NULL), fcm(NULL), inertia(NULL), ex_space(NULL),
ey_space(NULL), ez_space(NULL), angmom(NULL), omega(NULL),
torque(NULL), quat(NULL), imagebody(NULL), fflag(NULL),
tflag(NULL), langextra(NULL), sum(NULL), all(NULL),
remapflag(NULL), xcmimage(NULL), eflags(NULL), orient(NULL),
dorient(NULL), id_dilate(NULL), random(NULL), avec_ellipsoid(NULL),
avec_line(NULL), avec_tri(NULL)
{
int i,ibody;

View File

@ -47,7 +47,12 @@ enum{ISO,ANISO,TRICLINIC}; // same as in FixRigid
/* ---------------------------------------------------------------------- */
FixRigidNH::FixRigidNH(LAMMPS *lmp, int narg, char **arg) :
FixRigid(lmp, narg, arg)
FixRigid(lmp, narg, arg), conjqm(NULL), w(NULL),
wdti1(NULL), wdti2(NULL), wdti4(NULL), q_t(NULL), q_r(NULL),
eta_t(NULL), eta_r(NULL), eta_dot_t(NULL), eta_dot_r(NULL),
f_eta_t(NULL), f_eta_r(NULL), q_b(NULL), eta_b(NULL),
eta_dot_b(NULL), f_eta_b(NULL), rfix(NULL), id_temp(NULL),
id_press(NULL), temperature(NULL), pressure(NULL)
{
// error checks: could be moved up to FixRigid

View File

@ -50,7 +50,12 @@ enum{FULL_BODY,INITIAL,FINAL,FORCE_TORQUE,VCM_ANGMOM,XCM_MASS,ITENSOR,DOF};
/* ---------------------------------------------------------------------- */
FixRigidNHSmall::FixRigidNHSmall(LAMMPS *lmp, int narg, char **arg) :
FixRigidSmall(lmp, narg, arg)
FixRigidSmall(lmp, narg, arg), w(NULL), wdti1(NULL),
wdti2(NULL), wdti4(NULL), q_t(NULL), q_r(NULL), eta_t(NULL),
eta_r(NULL), eta_dot_t(NULL), eta_dot_r(NULL), f_eta_t(NULL),
f_eta_r(NULL), q_b(NULL), eta_b(NULL), eta_dot_b(NULL),
f_eta_b(NULL), rfix(NULL), id_temp(NULL), id_press(NULL),
temperature(NULL), pressure(NULL)
{
// error checks

View File

@ -67,7 +67,12 @@ enum{FULL_BODY,INITIAL,FINAL,FORCE_TORQUE,VCM_ANGMOM,XCM_MASS,ITENSOR,DOF};
/* ---------------------------------------------------------------------- */
FixRigidSmall::FixRigidSmall(LAMMPS *lmp, int narg, char **arg) :
Fix(lmp, narg, arg)
Fix(lmp, narg, arg), step_respa(NULL),
infile(NULL), body(NULL), bodyown(NULL), bodytag(NULL), atom2body(NULL),
xcmimage(NULL), displace(NULL), eflags(NULL), orient(NULL), dorient(NULL),
avec_ellipsoid(NULL), avec_line(NULL), avec_tri(NULL), counts(NULL),
itensor(NULL), mass_body(NULL), langextra(NULL), random(NULL), id_dilate(NULL),
onemols(NULL), hash(NULL), bbox(NULL), ctr(NULL), idclose(NULL), rsqclose(NULL)
{
int i;

View File

@ -49,7 +49,16 @@ FixShake *FixShake::fsptr;
/* ---------------------------------------------------------------------- */
FixShake::FixShake(LAMMPS *lmp, int narg, char **arg) :
Fix(lmp, narg, arg)
Fix(lmp, narg, arg), bond_flag(NULL), angle_flag(NULL),
type_flag(NULL), mass_list(NULL), bond_distance(NULL), angle_distance(NULL),
loop_respa(NULL), step_respa(NULL), x(NULL), v(NULL), f(NULL), ftmp(NULL),
vtmp(NULL), mass(NULL), rmass(NULL), type(NULL), shake_flag(NULL),
shake_atom(NULL), shake_type(NULL), xshake(NULL), nshake(NULL),
list(NULL), b_count(NULL), b_count_all(NULL), b_ave(NULL), b_max(NULL),
b_min(NULL), b_ave_all(NULL), b_max_all(NULL), b_min_all(NULL),
a_count(NULL), a_count_all(NULL), a_ave(NULL), a_max(NULL), a_min(NULL),
a_ave_all(NULL), a_max_all(NULL), a_min_all(NULL), atommols(NULL),
onemols(NULL)
{
MPI_Comm_rank(world,&me);
MPI_Comm_size(world,&nprocs);

View File

@ -37,7 +37,8 @@ enum{LAYOUT_UNIFORM,LAYOUT_NONUNIFORM,LAYOUT_TILED}; // several files
/* ---------------------------------------------------------------------- */
FixAppendAtoms::FixAppendAtoms(LAMMPS *lmp, int narg, char **arg) :
Fix(lmp, narg, arg)
Fix(lmp, narg, arg), randomx(NULL), randomt(NULL), basistype(NULL),
spatialid(NULL), gfactor1(NULL), gfactor2(NULL)
{
force_reneighbor = 1;
next_reneighbor = -1;

View File

@ -40,7 +40,9 @@ using namespace FixConst;
/* ---------------------------------------------------------------------- */
FixMSST::FixMSST(LAMMPS *lmp, int narg, char **arg) :
Fix(lmp, narg, arg)
Fix(lmp, narg, arg), old_velocity(NULL), rfix(NULL),
id_temp(NULL), id_press(NULL), id_pe(NULL), temperature(NULL),
pressure(NULL), pe(NULL), atoms_allocated(0)
{
if (narg < 4) error->all(FLERR,"Illegal fix msst command");

View File

@ -34,7 +34,7 @@ enum{ISO,ANISO,TRICLINIC}; // same as fix_nh.cpp
/* ---------------------------------------------------------------------- */
FixNPHug::FixNPHug(LAMMPS *lmp, int narg, char **arg) :
FixNH(lmp, narg, arg)
FixNH(lmp, narg, arg), pe(NULL), id_pe(NULL)
{
// Prevent masses from being updated every timestep

View File

@ -33,7 +33,7 @@ using namespace MathConst;
/* ---------------------------------------------------------------------- */
FixWallPiston::FixWallPiston(LAMMPS *lmp, int narg, char **arg) :
Fix(lmp, narg, arg)
Fix(lmp, narg, arg), randomt(NULL), gfactor1(NULL), gfactor2(NULL)
{
force_reneighbor = 1;
next_reneighbor = -1;