programming style updates

This commit is contained in:
Axel Kohlmeyer
2023-10-21 06:28:35 -04:00
parent a7fb81c68e
commit 08edd193e2
3 changed files with 15 additions and 22 deletions

View File

@ -89,7 +89,7 @@ are updated by the AtomVec class as needed.
* *
* \param _lmp pointer to the base LAMMPS class */ * \param _lmp pointer to the base LAMMPS class */
Atom::Atom(LAMMPS *_lmp) : Pointers(_lmp) Atom::Atom(LAMMPS *_lmp) : Pointers(_lmp), atom_style(nullptr), avec(nullptr), avec_map(nullptr)
{ {
natoms = 0; natoms = 0;
nlocal = nghost = nmax = 0; nlocal = nghost = nmax = 0;
@ -272,9 +272,6 @@ Atom::Atom(LAMMPS *_lmp) : Pointers(_lmp)
unique_tags = nullptr; unique_tags = nullptr;
reset_image_flag[0] = reset_image_flag[1] = reset_image_flag[2] = false; reset_image_flag[0] = reset_image_flag[1] = reset_image_flag[2] = false;
atom_style = nullptr;
avec = nullptr;
avec_map = new AtomVecCreatorMap(); avec_map = new AtomVecCreatorMap();
#define ATOM_CLASS #define ATOM_CLASS

View File

@ -46,7 +46,9 @@ template <typename T> static Min *minimize_creator(LAMMPS *lmp)
/* ---------------------------------------------------------------------- */ /* ---------------------------------------------------------------------- */
Update::Update(LAMMPS *lmp) : Pointers(lmp) Update::Update(LAMMPS *lmp) :
Pointers(lmp), unit_style(nullptr), integrate(nullptr), integrate_style(nullptr),
minimize(nullptr), minimize_style(nullptr), integrate_map(nullptr), minimize_map(nullptr)
{ {
char *str; char *str;
@ -67,14 +69,8 @@ Update::Update(LAMMPS *lmp) : Pointers(lmp)
dt_default = 1; dt_default = 1;
dt = 0.0; dt = 0.0;
unit_style = nullptr;
set_units("lj"); set_units("lj");
integrate_style = nullptr;
integrate = nullptr;
minimize_style = nullptr;
minimize = nullptr;
integrate_map = new IntegrateCreatorMap(); integrate_map = new IntegrateCreatorMap();
#define INTEGRATE_CLASS #define INTEGRATE_CLASS

View File

@ -22,6 +22,17 @@ namespace LAMMPS_NS {
class Update : protected Pointers { class Update : protected Pointers {
public: public:
Update(class LAMMPS *);
~Update() override;
void init();
void set_units(const char *);
void create_integrate(int, char **, int);
void create_minimize(int, char **, int);
void reset_timestep(int, char **);
void reset_timestep(bigint, bool);
void update_time();
double memory_usage();
double dt; // timestep double dt; // timestep
double etol, ftol; // minimizer tolerances on energy/force double etol, ftol; // minimizer tolerances on energy/force
bigint ntimestep; // current step (dynamics or min iterations) bigint ntimestep; // current step (dynamics or min iterations)
@ -58,17 +69,6 @@ class Update : protected Pointers {
IntegrateCreatorMap *integrate_map; IntegrateCreatorMap *integrate_map;
MinimizeCreatorMap *minimize_map; MinimizeCreatorMap *minimize_map;
Update(class LAMMPS *);
~Update() override;
void init();
void set_units(const char *);
void create_integrate(int, char **, int);
void create_minimize(int, char **, int);
void reset_timestep(int, char **);
void reset_timestep(bigint, bool);
void update_time();
double memory_usage();
private: private:
void new_integrate(char *, int, char **, int, int &); void new_integrate(char *, int, char **, int, int &);
void new_minimize(char *, int, char **, int, int &); void new_minimize(char *, int, char **, int, int &);