Apply override to more classes

This commit is contained in:
Richard Berger
2022-01-21 16:58:32 -05:00
parent 06beb28d7d
commit 44bc766060
13 changed files with 100 additions and 102 deletions

View File

@ -30,12 +30,12 @@ class DumpAtomADIOS : public DumpAtom {
public: public:
DumpAtomADIOS(class LAMMPS *, int, char **); DumpAtomADIOS(class LAMMPS *, int, char **);
virtual ~DumpAtomADIOS(); ~DumpAtomADIOS() override;
protected: protected:
virtual void openfile(); void openfile() override;
virtual void write(); void write() override;
virtual void init_style(); void init_style() override;
private: private:
DumpAtomADIOSInternal *internal; DumpAtomADIOSInternal *internal;

View File

@ -29,12 +29,12 @@ class DumpCustomADIOSInternal;
class DumpCustomADIOS : public DumpCustom { class DumpCustomADIOS : public DumpCustom {
public: public:
DumpCustomADIOS(class LAMMPS *, int, char **); DumpCustomADIOS(class LAMMPS *, int, char **);
virtual ~DumpCustomADIOS(); ~DumpCustomADIOS() override;
protected: protected:
virtual void openfile(); void openfile() override;
virtual void write(); void write() override;
virtual void init_style(); void init_style() override;
private: private:
DumpCustomADIOSInternal *internal; DumpCustomADIOSInternal *internal;

View File

@ -34,18 +34,18 @@ class ReadADIOSInternal;
class ReaderADIOS : public Reader { class ReaderADIOS : public Reader {
public: public:
ReaderADIOS(class LAMMPS *); ReaderADIOS(class LAMMPS *);
virtual ~ReaderADIOS(); ~ReaderADIOS() override;
virtual void settings(int, char **); void settings(int, char **) override;
virtual int read_time(bigint &); int read_time(bigint &) override;
virtual void skip(); void skip() override;
virtual bigint read_header(double[3][3], int &, int &, int, int, int *, char **, int, int, int &, bigint read_header(double[3][3], int &, int &, int, int, int *, char **, int, int, int &,
int &, int &, int &); int &, int &, int &) override;
virtual void read_atoms(int, int, double **); void read_atoms(int, int, double **) override;
virtual void open_file(const char *); void open_file(const char *) override;
virtual void close_file(); void close_file() override;
private: private:
int *fieldindex; // mapping of input fields to dump int *fieldindex; // mapping of input fields to dump

View File

@ -37,91 +37,91 @@ class FixATC : public Fix {
public: public:
/** constructor & destructor */ /** constructor & destructor */
FixATC(class LAMMPS *, int, char **); FixATC(class LAMMPS *, int, char **);
~FixATC(); ~FixATC() override;
/** initialization functions */ /** initialization functions */
void init(); void init() override;
void init_list(int id, NeighList *ptr); void init_list(int id, NeighList *ptr) override;
void setup(int vflag); void setup(int vflag) override;
void min_setup(int vflag); void min_setup(int vflag) override;
/** setmask: tell LAMMPS which fix methods to call */ /** setmask: tell LAMMPS which fix methods to call */
int setmask(); int setmask() override;
/** initial_integrate */ /** initial_integrate */
void initial_integrate(int vflag); void initial_integrate(int vflag) override;
/** after first integrate phase */ /** after first integrate phase */
void post_integrate(); void post_integrate() override;
/** final_integrate */ /** final_integrate */
void final_integrate(); void final_integrate() override;
/** end of step for run or minimize */ /** end of step for run or minimize */
void end_of_step(); void end_of_step() override;
/** pre_exchange is used to modify fix-specific data /** pre_exchange is used to modify fix-specific data
and is called before domain->pbc() and comm->exchange(). */ and is called before domain->pbc() and comm->exchange(). */
void setup_pre_exchange(); void setup_pre_exchange() override;
void pre_exchange(); void pre_exchange() override;
void min_pre_exchange(); void min_pre_exchange() override;
double memory_usage(); double memory_usage() override;
void grow_arrays(int); void grow_arrays(int) override;
void copy_arrays(int, int, int); void copy_arrays(int, int, int) override;
/** pack_exchange called from atom_vec->pack_exchange() /** pack_exchange called from atom_vec->pack_exchange()
and packs fix-specific data for a given real (local) and packs fix-specific data for a given real (local)
atom being sent to another processor. */ atom being sent to another processor. */
int pack_exchange(int, double *); int pack_exchange(int, double *) override;
/** unpack_exchange called from atom_vec->unpack_exchange() /** unpack_exchange called from atom_vec->unpack_exchange()
and unpacks fix-specific data for a given real (local) and unpacks fix-specific data for a given real (local)
atom received from another processor. */ atom received from another processor. */
int unpack_exchange(int, double *); int unpack_exchange(int, double *) override;
/** pack_comm called from comm->forward_comm_fix and /** pack_comm called from comm->forward_comm_fix and
packs fix-specific data for a given ghost atom packs fix-specific data for a given ghost atom
from exchange with another proc */ from exchange with another proc */
int pack_forward_comm(int, int *, double *, int, int *); int pack_forward_comm(int, int *, double *, int, int *) override;
/** unpack_comm called from comm->forward_comm_fix and /** unpack_comm called from comm->forward_comm_fix and
unpacks fix-specific data for a given ghost atom unpacks fix-specific data for a given ghost atom
from exchange with another proc */ from exchange with another proc */
void unpack_forward_comm(int, int, double *); void unpack_forward_comm(int, int, double *) override;
/** pre_neighbor is used to modify fix-specific data /** pre_neighbor is used to modify fix-specific data
and is called before neighbor list is built in and is called before neighbor list is built in
neighbor->build(). */ neighbor->build(). */
void pre_neighbor(); void pre_neighbor() override;
void setup_pre_neighbor(); void setup_pre_neighbor() override;
/** pre/post_force is used to modify fix-specific data /** pre/post_force is used to modify fix-specific data
and is before/after the various force computations. */ and is before/after the various force computations. */
void pre_force(int vflag); void pre_force(int vflag) override;
void post_force(int vflag); void post_force(int vflag) override;
/** post_run is called after a run completes */ /** post_run is called after a run completes */
void post_run(); void post_run() override;
/** min_pre_force is called before forces are calculated in minimize */ /** min_pre_force is called before forces are calculated in minimize */
void min_pre_force(int vflag); void min_pre_force(int vflag) override;
/** min_post_force is called after forces are calculated in minimize */ /** min_post_force is called after forces are calculated in minimize */
void min_post_force(int vflag); void min_post_force(int vflag) override;
/** modify atc parameters (parser) */ /** modify atc parameters (parser) */
int modify_param(int narg, char **arg); int modify_param(int narg, char **arg) override;
/** calls ATC_Method to handle restarting/checkpointing */ /** calls ATC_Method to handle restarting/checkpointing */
/** these four methods are for writing per-atom quantities */ /** these four methods are for writing per-atom quantities */
int pack_restart(int, double *); int pack_restart(int, double *) override;
void unpack_restart(int, int); void unpack_restart(int, int) override;
int size_restart(int); int size_restart(int) override;
int maxsize_restart(); int maxsize_restart() override;
/** these two methods are for writing all other quantities */ /** these two methods are for writing all other quantities */
void write_restart(FILE *); void write_restart(FILE *) override;
void restart(char *); void restart(char *) override;
/** accessor function for ATC_Method class pointer */ /** accessor function for ATC_Method class pointer */
const ATC::ATC_Method *atc() { return atc_; } const ATC::ATC_Method *atc() { return atc_; }
@ -130,9 +130,9 @@ class FixATC : public Fix {
LAMMPS *lammps_; LAMMPS *lammps_;
/** functions for "thermo" output */ /** functions for "thermo" output */
virtual double compute_scalar(); double compute_scalar() override;
virtual double compute_vector(int n); double compute_vector(int n) override;
virtual double compute_array(int irow, int icol); double compute_array(int irow, int icol) override;
double dtv, dtf; double dtv, dtf;
ATC::ATC_Method *atc_; ATC::ATC_Method *atc_;
}; };

View File

@ -29,7 +29,7 @@ namespace LAMMPS_NS {
class DumpH5MD : public Dump { class DumpH5MD : public Dump {
public: public:
DumpH5MD(class LAMMPS *, int, char **); DumpH5MD(class LAMMPS *, int, char **);
virtual ~DumpH5MD(); ~DumpH5MD() override;
private: private:
int natoms, ntotal; int natoms, ntotal;
@ -57,12 +57,12 @@ class DumpH5MD : public Dump {
int *dump_charge; int *dump_charge;
int every_charge; int every_charge;
void init_style(); void init_style() override;
int modify_param(int, char **); int modify_param(int, char **) override;
void openfile(); void openfile() override;
void write_header(bigint); void write_header(bigint) override;
void pack(tagint *); void pack(tagint *) override;
void write_data(int, double *); void write_data(int, double *) override;
void write_frame(); void write_frame();
void write_fixed_frame(); void write_fixed_frame();

View File

@ -72,17 +72,17 @@ namespace LAMMPS_NS {
class FixLangevinKokkos : public FixLangevin { class FixLangevinKokkos : public FixLangevin {
public: public:
FixLangevinKokkos(class LAMMPS *, int, char **); FixLangevinKokkos(class LAMMPS *, int, char **);
~FixLangevinKokkos(); ~FixLangevinKokkos() override;
void cleanup_copy(); void cleanup_copy();
void init(); void init() override;
void initial_integrate(int); void initial_integrate(int) override;
void post_force(int); void post_force(int) override;
void reset_dt(); void reset_dt() override;
void grow_arrays(int); void grow_arrays(int) override;
void copy_arrays(int i, int j, int delflag); void copy_arrays(int i, int j, int delflag) override;
double compute_scalar(); double compute_scalar() override;
void end_of_step(); void end_of_step() override;
KOKKOS_INLINE_FUNCTION KOKKOS_INLINE_FUNCTION
void initial_integrate_item(int) const; void initial_integrate_item(int) const;

View File

@ -28,10 +28,10 @@ namespace LAMMPS_NS {
class FixPythonInvoke : public Fix { class FixPythonInvoke : public Fix {
public: public:
FixPythonInvoke(class LAMMPS *, int, char **); FixPythonInvoke(class LAMMPS *, int, char **);
virtual ~FixPythonInvoke(); ~FixPythonInvoke() override;
int setmask(); int setmask() override;
virtual void end_of_step(); void end_of_step() override;
virtual void post_force(int); void post_force(int) override;
private: private:
void *lmpPtr; void *lmpPtr;

View File

@ -37,15 +37,15 @@ namespace LAMMPS_NS {
class FixPythonMove : public Fix { class FixPythonMove : public Fix {
public: public:
FixPythonMove(LAMMPS *lmp, int narg, char **arg); FixPythonMove(LAMMPS *lmp, int narg, char **arg);
virtual ~FixPythonMove(); ~FixPythonMove() override;
int setmask(); int setmask() override;
virtual void init(); void init() override;
virtual void initial_integrate(int); void initial_integrate(int) override;
virtual void final_integrate(); void final_integrate() override;
virtual void initial_integrate_respa(int, int, int); void initial_integrate_respa(int, int, int) override;
virtual void final_integrate_respa(int, int); void final_integrate_respa(int, int) override;
virtual void reset_dt(); void reset_dt() override;
protected: protected:
void *py_move; void *py_move;

View File

@ -37,12 +37,12 @@ namespace LAMMPS_NS {
class PairPython : public Pair { class PairPython : public Pair {
public: public:
PairPython(class LAMMPS *); PairPython(class LAMMPS *);
virtual ~PairPython(); ~PairPython() override;
virtual void compute(int, int); void compute(int, int) override;
void settings(int, char **); void settings(int, char **) override;
void coeff(int, char **); void coeff(int, char **) override;
double init_one(int, int); double init_one(int, int) override;
double single(int, int, int, int, double, double, double, double &); double single(int, int, int, int, double, double, double, double &) override;
protected: protected:
double cut_global; double cut_global;

View File

@ -23,15 +23,15 @@ class PythonImpl : protected Pointers, public PythonInterface {
public: public:
PythonImpl(class LAMMPS *); PythonImpl(class LAMMPS *);
~PythonImpl(); ~PythonImpl() override;
void command(int, char **); void command(int, char **) override;
void invoke_function(int, char *); void invoke_function(int, char *) override;
int find(const char *); int find(const char *) override;
int variable_match(const char *, const char *, int); int variable_match(const char *, const char *, int) override;
char *long_string(int); char *long_string(int) override;
int execute_string(char *); int execute_string(char *) override;
int execute_file(char *); int execute_file(char *) override;
bool has_minimum_version(int major, int minor); bool has_minimum_version(int major, int minor) override;
static void finalize(); static void finalize();
private: private:

View File

@ -26,9 +26,7 @@ class LAMMPSException : public std::exception {
LAMMPSException(const std::string &msg) : message(msg) {} LAMMPSException(const std::string &msg) : message(msg) {}
~LAMMPSException() noexcept {} const char *what() const noexcept override { return message.c_str(); }
virtual const char *what() const noexcept { return message.c_str(); }
}; };
class LAMMPSAbortException : public LAMMPSException { class LAMMPSAbortException : public LAMMPSException {

View File

@ -34,7 +34,7 @@ class PythonInterface {
class Python : protected Pointers { class Python : protected Pointers {
public: public:
Python(class LAMMPS *); Python(class LAMMPS *);
~Python(); ~Python() override;
void command(int, char **); void command(int, char **);
void invoke_function(int, char *); void invoke_function(int, char *);

View File

@ -21,7 +21,7 @@ namespace LAMMPS_NS {
class ProcMap : protected Pointers { class ProcMap : protected Pointers {
public: public:
ProcMap(class LAMMPS *); ProcMap(class LAMMPS *);
~ProcMap() {}
void onelevel_grid(int, int *, int *, int, int, int *, int *); void onelevel_grid(int, int *, int *, int, int, int *, int *);
void twolevel_grid(int, int *, int *, int, int *, int *, int, int, int *, int *); void twolevel_grid(int, int *, int *, int, int *, int *, int, int, int *, int *);
void numa_grid(int, int *, int *, int *); void numa_grid(int, int *, int *, int *);