Unverified Commit faa0da99 authored by Axel Kohlmeyer's avatar Axel Kohlmeyer Committed by GitHub
Browse files

Merge pull request #1434 from ellio167/reaxc-multi-instance-fix

Reaxc multi instance fix
parents e08080ca d9fc4a15
Loading
Loading
Loading
Loading
+4 −1
Original line number Diff line number Diff line
@@ -143,7 +143,7 @@ template<class DeviceType>
void PairReaxCKokkos<DeviceType>::init_style()
{
  PairReaxC::init_style();
  if (fix_reax) modify->delete_fix("REAXC"); // not needed in the Kokkos version
  if (fix_reax) modify->delete_fix(fix_id); // not needed in the Kokkos version
  fix_reax = NULL;

  // irequest = neigh request made by parent class
@@ -340,6 +340,7 @@ void PairReaxCKokkos<DeviceType>::init_md()
{
  // init_taper()
  F_FLOAT d1, d7, swa, swa2, swa3, swb, swb2, swb3;
  LR_lookup_table ** & LR = system->LR;

  swa = control->nonb_low;
  swb = control->nonb_cut;
@@ -437,6 +438,7 @@ int PairReaxCKokkos<DeviceType>::Init_Lookup_Tables()
  double dr;
  double *h, *fh, *fvdw, *fele, *fCEvd, *fCEclmb;
  double v0_vdw, v0_ele, vlast_vdw, vlast_ele;
  LR_lookup_table ** & LR = system->LR;

  /* initializations */
  v0_vdw = 0;
@@ -541,6 +543,7 @@ void PairReaxCKokkos<DeviceType>::Deallocate_Lookup_Tables()
{
  int i, j;
  int ntypes;
  LR_lookup_table ** & LR = system->LR;

  ntypes = atom->ntypes;

+1 −2
Original line number Diff line number Diff line
@@ -373,7 +373,7 @@ void PairReaxCOMP::init_style( )

  if (fix_reax == NULL) {
    char **fixarg = new char*[3];
    fixarg[0] = (char *) "REAXC";
    fixarg[0] = (char *) fix_id;
    fixarg[1] = (char *) "all";
    fixarg[2] = (char *) "REAXC";
    modify->add_fix(3,fixarg);
@@ -643,4 +643,3 @@ void PairReaxCOMP::FindBond()
    }
  }
}
+1 −0
Original line number Diff line number Diff line
@@ -281,6 +281,7 @@ void Tabulated_vdW_Coulomb_Energy_OMP(reax_system *system,control_params *contro
  int tid = 0;
#endif
  long froffset = (system->N * tid);
  LR_lookup_table ** & LR = system->LR;

  class PairReaxCOMP *pair_reax_ptr;
  pair_reax_ptr = static_cast<class PairReaxCOMP*>(system->pair_ptr);
+6 −2
Original line number Diff line number Diff line
@@ -74,6 +74,9 @@ PairReaxC::PairReaxC(LAMMPS *lmp) : Pair(lmp)
  manybody_flag = 1;
  ghostneigh = 1;

  fix_id = new char[24];
  snprintf(fix_id,24,"REAXC_%d",instance_me);

  system = (reax_system *)
    memory->smalloc(sizeof(reax_system),"reax:system");
  memset(system,0,sizeof(reax_system));
@@ -135,7 +138,8 @@ PairReaxC::~PairReaxC()
{
  if (copymode) return;

  if (fix_reax) modify->delete_fix("REAXC");
  if (fix_reax) modify->delete_fix(fix_id);
  delete[] fix_id;

  if (setup_flag) {
    Close_Output_Files( system, control, out_control, mpi_data );
@@ -412,7 +416,7 @@ void PairReaxC::init_style( )

  if (fix_reax == NULL) {
    char **fixarg = new char*[3];
    fixarg[0] = (char *) "REAXC";
    fixarg[0] = (char *) fix_id;
    fixarg[1] = (char *) "all";
    fixarg[2] = (char *) "REAXC";
    modify->add_fix(3,fixarg);
+1 −0
Original line number Diff line number Diff line
@@ -60,6 +60,7 @@ class PairReaxC : public Pair {
  bigint ngroup;

 protected:
  char *fix_id;
  double cutmax;
  int nelements;                // # of unique elements
  char **elements;              // names of unique elements
Loading