Commit 765fe3cd authored by Christian Negre's avatar Christian Negre Committed by Steve Plimpton
Browse files

changes for lattelib

parent 031d4acd
Loading
Loading
Loading
Loading
+20 −3
Original line number Diff line number Diff line
# Settings that the LAMMPS build will import when this package is installed
# Change all the flags and paths accordingly
# If using PROGRESS/BML set PROGRESS to ON 
# For more information about these libraries see: 
# BML: https://github.com/qmmd/bml
# PROGRESS: https://github.com/losalamos/qmd-progress
# METIS: 

latte_PATH = ${HOME}/exaalt/LATTE
progress_PATH = ${HOME}/qmd-progress
bml_PATH = ${HOME}/bml
metis_PATH = ${HOME}/Programs/metis-5.1.0

latte_SYSINC  = -I${latte_PATH}/src -I${bml_PATH}/install/include -I${progress_PATH}/install/include
latte_SYSLIB  = -fopenmp ${latte_PATH}/liblatte/latte_c_bind.o ${latte_PATH}/liblatte.a -lgfortran \
								-lm -Wl,--no-as-needed -L${MKLROOT}/lib/intel64 -lmkl_lapack95_lp64 -lmkl_gf_lp64 \
								-lmkl_gnu_thread -lmkl_core -lmkl_gnu_thread -lmkl_core -ldl -lpthread -lm 

# Uncomment the following line to use PROGRESS/BML
latte_SYSLIB  += -L${progress_PATH}/install/lib -lprogress -L${bml_PATH}/install/lib -lbml -L${metis_PATH}/install -lmetis 

latte_SYSINC  =
latte_SYSLIB  = -lgfortran
latte_SYSPATH =
+14 −3
Original line number Diff line number Diff line
@@ -28,6 +28,10 @@
using namespace LAMMPS_NS;
using namespace FixConst;

 extern "C" {
   void latte(int*, double*, int*, double*);
  }

#define INVOKED_PERATOM 8

/* ---------------------------------------------------------------------- */
@@ -35,7 +39,7 @@ using namespace FixConst;
FixLatte::FixLatte(LAMMPS *lmp, int narg, char **arg) :
  Fix(lmp, narg, arg)
{
  if (narg != 4) error->all(FLERR,"Illegal fix latte command");
  if (narg != 5) error->all(FLERR,"Illegal fix latte command");

  // store pe/atom ID used for input of Coulomb potential to LATTE
  // insure it is valid for these computations
@@ -49,6 +53,8 @@ FixLatte::FixLatte(LAMMPS *lmp, int narg, char **arg) :
  if (modify->compute[ipe]->peatomflag == 0)
    error->all(FLERR,"Fix latte compute ID does not compute pe/atom");

//   latte(arg[4]);

  // initialize LATTE with LAMMPS info about box, atoms, atom types, etc ?
  // may need to be done in init() ??

@@ -183,7 +189,7 @@ void FixLatte::post_force(int vflag)
  // what should cutoffs be for passing neighlist info to LATTE ??
  // do cutoffs include many self image atoms for tiny periodic system ??

  int i,j,ii,jj,inum,jnum;
/*  int i,j,ii,jj,inum,jnum;
  int *ilist,*jlist,*numneigh,**firstneigh;

  inum = list->inum;
@@ -218,6 +224,10 @@ void FixLatte::post_force(int vflag)
  double *pe = c_pe->vector_atom;

  modify->addstep_compute(update->ntimestep+1);
*/
  int natoms = (int) atom->natoms;
  latte(&natoms,&atom->x[0][0],atom->type,&atom->f[0][0]);  
//   latte(&natoms,&atom->x[0][0],atom->type);
  
  // construct H0,S,Z
  // setup full Hamiltonian H(R,n)
@@ -281,3 +291,4 @@ double FixLatte::compute_scalar()
  return 0.0;
}