Commit 2f52eee6 authored by Axel Kohlmeyer's avatar Axel Kohlmeyer
Browse files

kspace refactor compiles for KSPACE and USER-OMP

parent 9090fd02
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -273,7 +273,8 @@ void FixTuneKspace::update_kspace_style(char *new_kspace_style,

  // delete old kspace style and create new one

  force->create_kspace(narg,arg,1);
  force->create_kspace(arg[0],1);
  force->kspace->settings(narg-1,&arg[1]);
  force->kspace->differentiation_flag = old_differentiation_flag;
  force->kspace->slabflag = old_slabflag;
  force->kspace->slab_volfactor = old_slab_volfactor;
+1 −1
Original line number Diff line number Diff line
@@ -111,6 +111,7 @@ MSM::MSM(LAMMPS *lmp) : KSpace(lmp),
  order = 10;
}

/* ---------------------------------------------------------------------- */

void MSM::settings(int narg, char **arg)
{
@@ -118,7 +119,6 @@ void MSM::settings(int narg, char **arg)
  accuracy_relative = fabs(force->numeric(FLERR,arg[0]));
}


/* ----------------------------------------------------------------------
   free all memory
------------------------------------------------------------------------- */
+13 −4
Original line number Diff line number Diff line
@@ -42,18 +42,27 @@ enum{FORWARD_RHO,FORWARD_AD,FORWARD_AD_PERATOM};

/* ---------------------------------------------------------------------- */

MSMCG::MSMCG(LAMMPS *lmp, int narg, char **arg) : MSM(lmp, narg, arg),
MSMCG::MSMCG(LAMMPS *lmp) : MSM(lmp),
  is_charged(NULL)
{
  triclinic_support = 0;

  num_charged = -1;
}

/* ---------------------------------------------------------------------- */

void MSMCG::settings(int narg, char **arg)
{
  if ((narg < 1) || (narg > 2))
    error->all(FLERR,"Illegal kspace_style msm/cg command");

  triclinic_support = 0;
  // first argument is processed in parent class

  MSM::settings(narg,arg);

  if (narg == 2) smallq = fabs(force->numeric(FLERR,arg[1]));
  else smallq = SMALLQ;

  num_charged = -1;
}

/* ----------------------------------------------------------------------
+2 −1
Original line number Diff line number Diff line
@@ -26,8 +26,9 @@ namespace LAMMPS_NS {

class MSMCG : public MSM {
 public:
  MSMCG(class LAMMPS *, int, char **);
  MSMCG(class LAMMPS *);
  virtual ~MSMCG();
  virtual void settings(int, char **);
  virtual void compute(int, int);
  virtual double memory_usage();

+9 −5
Original line number Diff line number Diff line
@@ -64,7 +64,7 @@ enum{FORWARD_IK,FORWARD_AD,FORWARD_IK_PERATOM,FORWARD_AD_PERATOM};

/* ---------------------------------------------------------------------- */

PPPM::PPPM(LAMMPS *lmp, int narg, char **arg) : KSpace(lmp, narg, arg),
PPPM::PPPM(LAMMPS *lmp) : KSpace(lmp),
  factors(NULL), density_brick(NULL), vdx_brick(NULL), vdy_brick(NULL), vdz_brick(NULL),
  u_brick(NULL), v0_brick(NULL), v1_brick(NULL), v2_brick(NULL), v3_brick(NULL),
  v4_brick(NULL), v5_brick(NULL), greensfn(NULL), vg(NULL), fkx(NULL), fky(NULL),
@@ -78,14 +78,10 @@ PPPM::PPPM(LAMMPS *lmp, int narg, char **arg) : KSpace(lmp, narg, arg),
  peratom_allocate_flag = 0;
  group_allocate_flag = 0;

  if (narg < 1) error->all(FLERR,"Illegal kspace_style pppm command");

  pppmflag = 1;
  group_group_enable = 1;
  triclinic = domain->triclinic;

  accuracy_relative = fabs(force->numeric(FLERR,arg[0]));

  nfactors = 3;
  factors = new int[nfactors];
  factors[0] = 2;
@@ -161,6 +157,14 @@ PPPM::PPPM(LAMMPS *lmp, int narg, char **arg) : KSpace(lmp, narg, arg),
  acons[7][6] = 4887769399.0 / 37838389248.0;
}

/* ---------------------------------------------------------------------- */

void PPPM::settings(int narg, char **arg)
{
  if (narg < 1) error->all(FLERR,"Illegal kspace_style pppm command");
  accuracy_relative = fabs(force->numeric(FLERR,arg[0]));
}

/* ----------------------------------------------------------------------
   free all memory
------------------------------------------------------------------------- */
Loading