reformat pair style kim to LAMMPS style and add some existing simiulator model code (non-functional)
This commit is contained in:
1335
src/KIM/pair_kim.cpp
1335
src/KIM/pair_kim.cpp
File diff suppressed because it is too large
Load Diff
@ -12,7 +12,7 @@
|
||||
------------------------------------------------------------------------- */
|
||||
|
||||
/* ----------------------------------------------------------------------
|
||||
Contributing authors: Ryan S. Elliott (UMinn)
|
||||
Contributing authors: Ryan S. Elliott (UMinn), Axel Kohlmeyer (Temple U)
|
||||
------------------------------------------------------------------------- */
|
||||
|
||||
/* ----------------------------------------------------------------------
|
||||
@ -65,110 +65,115 @@ PairStyle(kim,PairKIM)
|
||||
// includes from KIM & LAMMPS
|
||||
class KIM_API_model;
|
||||
#include "pair.h"
|
||||
|
||||
extern "C" {
|
||||
#include "KIM_SimulatorHeaders.h"
|
||||
}
|
||||
#include "KIM_SimulatorModel.hpp"
|
||||
#include <sstream>
|
||||
|
||||
|
||||
namespace LAMMPS_NS {
|
||||
|
||||
class PairKIM : public Pair {
|
||||
public:
|
||||
PairKIM(class LAMMPS*);
|
||||
~PairKIM();
|
||||
class PairKIM : public Pair {
|
||||
public:
|
||||
PairKIM(class LAMMPS*);
|
||||
~PairKIM();
|
||||
|
||||
// LAMMPS Pair class virtual function prototypes
|
||||
virtual void compute(int, int);
|
||||
virtual void settings(int, char**);
|
||||
virtual void coeff(int, char**);
|
||||
virtual void init_style();
|
||||
virtual void init_list(int id, NeighList *ptr);
|
||||
virtual double init_one(int, int);
|
||||
virtual int pack_reverse_comm(int, int, double*);
|
||||
virtual void unpack_reverse_comm(int, int*, double*);
|
||||
virtual double memory_usage();
|
||||
// LAMMPS Pair class virtual function prototypes
|
||||
virtual void compute(int, int);
|
||||
virtual void settings(int, char**);
|
||||
virtual void coeff(int, char**);
|
||||
virtual void init_style();
|
||||
virtual void init_list(int id, NeighList *ptr);
|
||||
virtual double init_one(int, int);
|
||||
virtual int pack_reverse_comm(int, int, double*);
|
||||
virtual void unpack_reverse_comm(int, int*, double*);
|
||||
virtual double memory_usage();
|
||||
|
||||
protected:
|
||||
// (nearly) all bool flags are not initialized in constructor, but set
|
||||
// explicitly in the indicated function. All other data members are
|
||||
// initialized in constructor
|
||||
int settings_call_count;
|
||||
int init_style_call_count;
|
||||
protected:
|
||||
// (nearly) all bool flags are not initialized in constructor, but set
|
||||
// explicitly in the indicated function. All other data members are
|
||||
// initialized in constructor
|
||||
int settings_call_count;
|
||||
int init_style_call_count;
|
||||
|
||||
// values set in settings()
|
||||
char* kim_modelname;
|
||||
// values set in settings()
|
||||
char* kim_modelname;
|
||||
|
||||
// values set in coeff()
|
||||
// values set in coeff()
|
||||
|
||||
// values set in allocate(), called by coeff()
|
||||
virtual void allocate();
|
||||
int* lmps_map_species_to_unique;
|
||||
// values set in allocate(), called by coeff()
|
||||
virtual void allocate();
|
||||
int* lmps_map_species_to_unique;
|
||||
|
||||
// values set in coeff(), after calling allocate()
|
||||
char** lmps_unique_elements; // names of unique elements given
|
||||
// in pair_coeff command
|
||||
int lmps_num_unique_elements;
|
||||
// values set in coeff(), after calling allocate()
|
||||
char** lmps_unique_elements; // names of unique elements given
|
||||
// in pair_coeff command
|
||||
int lmps_num_unique_elements;
|
||||
|
||||
// values set in set_lmps_flags(), called from init_style()
|
||||
bool lmps_using_newton;
|
||||
bool lmps_using_molecular;
|
||||
enum unit_sys {REAL, METAL, SI, CGS, ELECTRON};
|
||||
unit_sys lmps_units;
|
||||
KIM_LengthUnit lengthUnit;
|
||||
KIM_EnergyUnit energyUnit;
|
||||
KIM_ChargeUnit chargeUnit;
|
||||
KIM_TemperatureUnit temperatureUnit;
|
||||
KIM_TimeUnit timeUnit;
|
||||
// values set in set_lmps_flags(), called from init_style()
|
||||
bool lmps_using_newton;
|
||||
bool lmps_using_molecular;
|
||||
enum unit_sys {REAL, METAL, SI, CGS, ELECTRON};
|
||||
unit_sys lmps_units;
|
||||
KIM_LengthUnit lengthUnit;
|
||||
KIM_EnergyUnit energyUnit;
|
||||
KIM_ChargeUnit chargeUnit;
|
||||
KIM_TemperatureUnit temperatureUnit;
|
||||
KIM_TimeUnit timeUnit;
|
||||
|
||||
KIM::SimulatorModel * simulatorModel;
|
||||
KIM_Model * pkim;
|
||||
KIM_ComputeArguments * pargs;
|
||||
KIM::SimulatorModel * simulatorModel;
|
||||
KIM_Model * pkim;
|
||||
KIM_ComputeArguments * pargs;
|
||||
|
||||
// values set in set_kim_model_has_flags(), called by kim_init()
|
||||
KIM_SupportStatus kim_model_support_for_energy;
|
||||
KIM_SupportStatus kim_model_support_for_forces;
|
||||
KIM_SupportStatus kim_model_support_for_particleEnergy;
|
||||
KIM_SupportStatus kim_model_support_for_particleVirial;
|
||||
// values set in set_kim_model_has_flags(), called by kim_init()
|
||||
KIM_SupportStatus kim_model_support_for_energy;
|
||||
KIM_SupportStatus kim_model_support_for_forces;
|
||||
KIM_SupportStatus kim_model_support_for_particleEnergy;
|
||||
KIM_SupportStatus kim_model_support_for_particleVirial;
|
||||
|
||||
// values set in kim_init()
|
||||
bool kim_init_ok;
|
||||
int lmps_local_tot_num_atoms;
|
||||
double kim_global_influence_distance; // KIM Model cutoff value
|
||||
int kim_number_of_neighbor_lists;
|
||||
double const * kim_cutoff_values;
|
||||
int const * modelWillNotRequestNeighborsOfNoncontributingParticles;
|
||||
class NeighList ** neighborLists;
|
||||
// values set in kim_init()
|
||||
bool kim_init_ok;
|
||||
int lmps_local_tot_num_atoms;
|
||||
double kim_global_influence_distance; // KIM Model cutoff value
|
||||
int kim_number_of_neighbor_lists;
|
||||
double const * kim_cutoff_values;
|
||||
int const * modelWillNotRequestNeighborsOfNoncontributingParticles;
|
||||
class NeighList ** neighborLists;
|
||||
|
||||
// values set in init_style()
|
||||
bool kim_particle_codes_ok;
|
||||
int *kim_particle_codes;
|
||||
// values set in init_style()
|
||||
bool kim_particle_codes_ok;
|
||||
int *kim_particle_codes;
|
||||
|
||||
// values set in compute()
|
||||
int lmps_maxalloc; // max allocated memory value
|
||||
int* kim_particleSpecies; // array of KIM particle species
|
||||
int* kim_particleContributing; // array of KIM particle contributing
|
||||
int* lmps_stripped_neigh_list; // neighbors of one atom, used when LAMMPS
|
||||
// is in molecular mode
|
||||
int** lmps_stripped_neigh_ptr; // pointer into lists
|
||||
// values set in compute()
|
||||
int lmps_maxalloc; // max allocated memory value
|
||||
int* kim_particleSpecies; // array of KIM particle species
|
||||
int* kim_particleContributing; // array of KIM particle contributing
|
||||
int* lmps_stripped_neigh_list; // neighbors of one atom, used when LAMMPS
|
||||
// is in molecular mode
|
||||
int** lmps_stripped_neigh_ptr; // pointer into lists
|
||||
|
||||
// KIM specific helper functions
|
||||
virtual void set_contributing();
|
||||
virtual void kim_init();
|
||||
virtual void kim_free();
|
||||
virtual void set_argument_pointers();
|
||||
virtual void set_lmps_flags();
|
||||
virtual void set_kim_model_has_flags();
|
||||
virtual int check_for_routine_compatibility();
|
||||
// static methods used as callbacks from KIM
|
||||
static int get_neigh(
|
||||
void const * const dataObject,
|
||||
int const numberOfCutoffs, double const * const cutoffs,
|
||||
int const neighborListIndex, int const particleNumber,
|
||||
int * const numberOfNeighbors,
|
||||
int const ** const neighborsOfParticle);
|
||||
};
|
||||
// LAMMPS Simulator model support
|
||||
Pair *simulator_class;
|
||||
char *simulator_style;
|
||||
virtual void simulator_init();
|
||||
virtual void simulator_free();
|
||||
|
||||
// KIM specific helper functions
|
||||
virtual void set_contributing();
|
||||
virtual void kim_init();
|
||||
virtual void kim_free();
|
||||
virtual void set_argument_pointers();
|
||||
virtual void set_lmps_flags();
|
||||
virtual void set_kim_model_has_flags();
|
||||
virtual int check_for_routine_compatibility();
|
||||
// static methods used as callbacks from KIM
|
||||
static int get_neigh(
|
||||
void const * const dataObject,
|
||||
int const numberOfCutoffs, double const * const cutoffs,
|
||||
int const neighborListIndex, int const particleNumber,
|
||||
int * const numberOfNeighbors,
|
||||
int const ** const neighborsOfParticle);
|
||||
};
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user