programming style updates
This commit is contained in:
@ -89,7 +89,7 @@ are updated by the AtomVec class as needed.
|
||||
*
|
||||
* \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;
|
||||
nlocal = nghost = nmax = 0;
|
||||
@ -272,9 +272,6 @@ Atom::Atom(LAMMPS *_lmp) : Pointers(_lmp)
|
||||
unique_tags = nullptr;
|
||||
reset_image_flag[0] = reset_image_flag[1] = reset_image_flag[2] = false;
|
||||
|
||||
atom_style = nullptr;
|
||||
avec = nullptr;
|
||||
|
||||
avec_map = new AtomVecCreatorMap();
|
||||
|
||||
#define ATOM_CLASS
|
||||
|
||||
@ -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;
|
||||
|
||||
@ -67,14 +69,8 @@ Update::Update(LAMMPS *lmp) : Pointers(lmp)
|
||||
|
||||
dt_default = 1;
|
||||
dt = 0.0;
|
||||
unit_style = nullptr;
|
||||
set_units("lj");
|
||||
|
||||
integrate_style = nullptr;
|
||||
integrate = nullptr;
|
||||
minimize_style = nullptr;
|
||||
minimize = nullptr;
|
||||
|
||||
integrate_map = new IntegrateCreatorMap();
|
||||
|
||||
#define INTEGRATE_CLASS
|
||||
|
||||
22
src/update.h
22
src/update.h
@ -22,6 +22,17 @@ namespace LAMMPS_NS {
|
||||
|
||||
class Update : protected Pointers {
|
||||
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 etol, ftol; // minimizer tolerances on energy/force
|
||||
bigint ntimestep; // current step (dynamics or min iterations)
|
||||
@ -58,17 +69,6 @@ class Update : protected Pointers {
|
||||
IntegrateCreatorMap *integrate_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:
|
||||
void new_integrate(char *, int, char **, int, int &);
|
||||
void new_minimize(char *, int, char **, int, int &);
|
||||
|
||||
Reference in New Issue
Block a user