initialize pointers to null in constructor

This commit is contained in:
Axel Kohlmeyer
2024-05-15 13:49:54 -04:00
parent 69b8a8c7b3
commit 16b2ed5cc9

View File

@ -26,29 +26,34 @@
#include "comm.h"
#include "domain.h"
#include "error.h"
#include "label_map.h"
#include "memory.h"
#include "special.h"
#include "label_map.h"
#include <cstring>
using namespace LAMMPS_NS;
static constexpr double LB_FACTOR = 1.1;
static constexpr double EPSILON = 1.0e-6;
static constexpr double EPSILON = 1.0e-6;
/* ---------------------------------------------------------------------- */
Replicate::Replicate(LAMMPS *lmp) : Command(lmp) {}
Replicate::Replicate(LAMMPS *lmp) : Command(lmp), old(nullptr), old_x(nullptr), old_tag(nullptr)
{
bbox_flag = 0;
bond_flag = 0;
}
/* ---------------------------------------------------------------------- */
void Replicate::command(int narg, char **arg)
{
int i,j,m,n;
int i,n;
if (domain->box_exist == 0)
error->all(FLERR,"Replicate command before simulation box is defined");
if (narg < 3 || narg > 4) error->all(FLERR,"Illegal replicate command");
int me = comm->me;
@ -78,9 +83,6 @@ void Replicate::command(int narg, char **arg)
// optional keywords
bbox_flag = 0;
bond_flag = 0;
int iarg = 3;
while (iarg < narg) {
if (strcmp(arg[iarg],"bbox") == 0) {