git-svn-id: svn://svn.icms.temple.edu/lammps-ro/trunk@3381 f3b2605a-c512-4ea7-a41b-209d697bcdaa

This commit is contained in:
sjplimp
2009-11-10 18:24:01 +00:00
parent a64de5f5d0
commit 3f3f82d909
19 changed files with 1110 additions and 1060 deletions

View File

@ -225,7 +225,7 @@ void PairEAM::compute(int eflag, int vflag)
// communicate derivative of embedding function // communicate derivative of embedding function
comm->comm_pair(this); comm->forward_comm_pair(this);
// compute forces on each atom // compute forces on each atom
// loop over neighbors of my atoms // loop over neighbors of my atoms

File diff suppressed because it is too large Load Diff

View File

@ -1,97 +1,97 @@
/* ---------------------------------------------------------------------- /* ----------------------------------------------------------------------
LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator
http://lammps.sandia.gov, Sandia National Laboratories http://lammps.sandia.gov, Sandia National Laboratories
Steve Plimpton, sjplimp@sandia.gov Steve Plimpton, sjplimp@sandia.gov
Copyright (2003) Sandia Corporation. Under the terms of Contract Copyright (2003) Sandia Corporation. Under the terms of Contract
DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
certain rights in this software. This software is distributed under certain rights in this software. This software is distributed under
the GNU General Public License. the GNU General Public License.
See the README file in the top-level LAMMPS directory. See the README file in the top-level LAMMPS directory.
------------------------------------------------------------------------- */ ------------------------------------------------------------------------- */
#ifndef PAIR_MEAM_H #ifndef PAIR_MEAM_H
#define PAIR_MEAM_H #define PAIR_MEAM_H
extern "C" { extern "C" {
void meam_setup_global_(int *, int *, double *, int *, double *, double *, void meam_setup_global_(int *, int *, double *, int *, double *, double *,
double *, double *, double *, double *, double *, double *, double *, double *, double *, double *,
double *, double *, double *, double *, double *, double *, double *, double *, double *, double *,
double *, double *, int *); double *, double *, int *);
void meam_setup_param_(int *, double *, int *, int *, int *); void meam_setup_param_(int *, double *, int *, int *, int *);
void meam_setup_done_(double *); void meam_setup_done_(double *);
void meam_dens_init_(int *, int *, int *, int *, int *, void meam_dens_init_(int *, int *, int *, int *, int *,
double *, int *, int *, int *, int *, double *, int *, int *, int *, int *,
double *, double *, double *, double *, double *, double *, double *, double *,
double *, double *, double *, double *,
double *, double *, double *, double *, double *, double *, double *, double *, double *, double *,
int *); int *);
void meam_dens_final_(int *, int *, int *, int *, int *, double *, double *, void meam_dens_final_(int *, int *, int *, int *, int *, double *, double *,
int *, int *, int *, int *, int *, int *,
double *, double *, double *, double *, double *, double *, double *, double *,
double *, double *, double *, double *, double *, double *,
double *, double *, double *, double *, double *, double *, double *, double *,
double *, double *, double *, double *,
double *, double *, double *, double *, int *); double *, double *, double *, double *, int *);
void meam_force_(int *, int *, int *, int *, int *, int *, void meam_force_(int *, int *, int *, int *, int *, int *,
double *, double *, int *, int *, int *, double *, double *, int *, int *, int *,
double *, int *, int *, int *, int *, double *, double *, double *, int *, int *, int *, int *, double *, double *,
double *, double *, double *, double *, double *, double *, double *, double *, double *, double *, double *, double *,
double *, double *, double *, double *, double *, double *, double *, double *, double *, double *, double *, double *,
double *, double *, double *, double *, double *, double *, int *); double *, double *, double *, double *, double *, double *, int *);
void meam_cleanup_(); void meam_cleanup_();
} }
#include "pair.h" #include "pair.h"
namespace LAMMPS_NS { namespace LAMMPS_NS {
class PairMEAM : public Pair { class PairMEAM : public Pair {
public: public:
PairMEAM(class LAMMPS *); PairMEAM(class LAMMPS *);
~PairMEAM(); ~PairMEAM();
void compute(int, int); void compute(int, int);
void settings(int, char **); void settings(int, char **);
void coeff(int, char **); void coeff(int, char **);
void init_style(); void init_style();
void init_list(int, class NeighList *); void init_list(int, class NeighList *);
double init_one(int, int); double init_one(int, int);
int pack_comm(int, int *, double *, int, int *); int pack_comm(int, int *, double *, int, int *);
void unpack_comm(int, int, double *); void unpack_comm(int, int, double *);
int pack_reverse_comm(int, int, double *); int pack_reverse_comm(int, int, double *);
void unpack_reverse_comm(int, int *, double *); void unpack_reverse_comm(int, int *, double *);
double memory_usage(); double memory_usage();
private: private:
double cutmax; // max cutoff for all elements double cutmax; // max cutoff for all elements
int nelements; // # of unique elements int nelements; // # of unique elements
char **elements; // names of unique elements char **elements; // names of unique elements
double *mass; // mass of each element double *mass; // mass of each element
int *map; // mapping from atom types to elements int *map; // mapping from atom types to elements
int *fmap; // Fortran version of map array for MEAM lib int *fmap; // Fortran version of map array for MEAM lib
int maxneigh; int maxneigh;
double *scrfcn,*dscrfcn,*fcpair; double *scrfcn,*dscrfcn,*fcpair;
int nmax; int nmax;
double *rho,*rho0,*rho1,*rho2,*rho3,*frhop; double *rho,*rho0,*rho1,*rho2,*rho3,*frhop;
double *gamma,*dgamma1,*dgamma2,*dgamma3,*arho2b; double *gamma,*dgamma1,*dgamma2,*dgamma3,*arho2b;
double **arho1,**arho2,**arho3,**arho3b,**t_ave,**tsq_ave; double **arho1,**arho2,**arho3,**arho3b,**t_ave,**tsq_ave;
void allocate(); void allocate();
void read_files(char *, char *); void read_files(char *, char *);
void neigh_f2c(int, int *, int *, int **); void neigh_f2c(int, int *, int *, int **);
void neigh_c2f(int, int *, int *, int **); void neigh_c2f(int, int *, int *, int **);
}; };
} }
#endif #endif

View File

@ -163,7 +163,7 @@ void FixBondBreak::post_integrate()
// need updated ghost atom positions // need updated ghost atom positions
comm->communicate(); comm->forward_comm();
// resize bond partner list and initialize it // resize bond partner list and initialize it
// probability array overlays distsq array // probability array overlays distsq array
@ -235,7 +235,7 @@ void FixBondBreak::post_integrate()
if (partner[i]) probability[i] = random->uniform(); if (partner[i]) probability[i] = random->uniform();
} }
comm->comm_fix(this); comm->forward_comm_fix(this);
// break bonds // break bonds
// if both atoms list each other as winning bond partner // if both atoms list each other as winning bond partner

View File

@ -273,12 +273,12 @@ void FixBondCreate::post_integrate()
// need updated ghost atom positions // need updated ghost atom positions
comm->communicate(); comm->forward_comm();
// forward comm of bondcount, so ghosts have it // forward comm of bondcount, so ghosts have it
commflag = 0; commflag = 0;
comm->comm_fix(this); comm->forward_comm_fix(this);
// resize bond partner list and initialize it // resize bond partner list and initialize it
// probability array overlays distsq array // probability array overlays distsq array
@ -376,7 +376,7 @@ void FixBondCreate::post_integrate()
} }
commflag = 1; commflag = 1;
comm->comm_fix(this); comm->forward_comm_fix(this);
// create bonds for atoms I own // create bonds for atoms I own
// if other atom is owned by another proc, it should create same bond // if other atom is owned by another proc, it should create same bond

View File

@ -1,9 +1,9 @@
# Settings for libraries used by specific LAMMPS packages # Settings for libraries used by specific LAMMPS packages
# this file is auto-edited when those packages are included/excluded # this file is auto-edited when those packages are included/excluded
PKG_INC = -I../../lib/reax -I../../lib/poems -I../../lib/meam PKG_INC = -I../../lib/atc -I../../lib/reax -I../../lib/poems -I../../lib/meam
PKG_PATH = -L../../lib/reax -L../../lib/poems -L../../lib/meam PKG_PATH = -L../../lib/atc -L../../lib/reax -L../../lib/poems -L../../lib/meam -L../../lib/gpu
PKG_LIB = -lreax -lpoems -lmeam PKG_LIB = -latc -lreax -lpoems -lmeam -lgpu
PKG_SYSPATH = $(reax_SYSPATH) $(meam_SYSPATH) PKG_SYSPATH = $(user-atc_SYSPATH) $(reax_SYSPATH) $(meam_SYSPATH) $(gpu_SYSPATH)
PKG_SYSLIB = $(reax_SYSLIB) $(meam_SYSLIB) PKG_SYSLIB = $(user-atc_SYSLIB) $(reax_SYSLIB) $(meam_SYSLIB) $(gpu_SYSLIB)

View File

@ -224,7 +224,7 @@ void PairEAMOpt::eval()
// communicate derivative of embedding function // communicate derivative of embedding function
comm->comm_pair(this); comm->forward_comm_pair(this);
// compute forces on each atom // compute forces on each atom
// loop over neighbors of my atoms // loop over neighbors of my atoms

View File

@ -168,7 +168,7 @@ void PairREAX::compute(int eflag, int vflag)
// communicate local atomic bond order to ghost atomic bond order // communicate local atomic bond order to ghost atomic bond order
packflag = 0; packflag = 0;
comm->comm_pair(this); comm->forward_comm_pair(this);
FORTRAN(molec, MOLEC)(); FORTRAN(molec, MOLEC)();
FORTRAN(encalc, ENCALC)(); FORTRAN(encalc, ENCALC)();
@ -941,7 +941,7 @@ void PairREAX::cg_solve(const int & nlocal, const int & nghost,
packflag = 1; packflag = 1;
comm->reverse_comm_pair(this); comm->reverse_comm_pair(this);
comm->comm_pair(this); comm->forward_comm_pair(this);
MPI_Allreduce(&w[n-1], &sumtmp, 1, MPI_DOUBLE, MPI_SUM, world); MPI_Allreduce(&w[n-1], &sumtmp, 1, MPI_DOUBLE, MPI_SUM, world);
w[n-1] = sumtmp; w[n-1] = sumtmp;
@ -978,7 +978,7 @@ void PairREAX::cg_solve(const int & nlocal, const int & nghost,
} }
comm->reverse_comm_pair(this); comm->reverse_comm_pair(this);
comm->comm_pair(this); comm->forward_comm_pair(this);
MPI_Allreduce(&w[n-1], &sumtmp, 1, MPI_DOUBLE, MPI_SUM, world); MPI_Allreduce(&w[n-1], &sumtmp, 1, MPI_DOUBLE, MPI_SUM, world);
w[n-1] = sumtmp; w[n-1] = sumtmp;

View File

@ -515,7 +515,7 @@ void FixATC::initial_integrate(int vflag)
void FixATC::final_integrate() void FixATC::final_integrate()
{ {
// need updated ghost atom positions // need updated ghost atom positions
comm->comm_fix(this); comm->forward_comm_fix(this);
try { try {
atcTransfer_->pre_final_integrate(); atcTransfer_->pre_final_integrate();

View File

@ -193,7 +193,7 @@ void PairCDEAM::compute(int eflag, int vflag)
// Communicate derivative of embedding function and densities // Communicate derivative of embedding function and densities
// and D_values (this for one-site formulation only). // and D_values (this for one-site formulation only).
communicationStage = 2; communicationStage = 2;
comm->comm_pair(this); comm->forward_comm_pair(this);
// The electron densities may not drop to zero because then the concentration would no longer be defined. // The electron densities may not drop to zero because then the concentration would no longer be defined.
// But the concentration is not needed anyway if there is no interaction with another atom, which is the case // But the concentration is not needed anyway if there is no interaction with another atom, which is the case
@ -262,7 +262,7 @@ void PairCDEAM::compute(int eflag, int vflag)
comm->reverse_comm_pair(this); comm->reverse_comm_pair(this);
} }
communicationStage = 4; communicationStage = 4;
comm->comm_pair(this); comm->forward_comm_pair(this);
} }
// Stage III // Stage III

View File

@ -403,11 +403,11 @@ void Comm::setup()
} }
/* ---------------------------------------------------------------------- /* ----------------------------------------------------------------------
communication of atom coords every timestep forward communication of atom coords every timestep
other per-atom attributes may also be sent via pack/unpack routines other per-atom attributes may also be sent via pack/unpack routines
------------------------------------------------------------------------- */ ------------------------------------------------------------------------- */
void Comm::communicate() void Comm::forward_comm()
{ {
int n; int n;
MPI_Request request; MPI_Request request;
@ -473,7 +473,7 @@ void Comm::communicate()
other per-atom attributes may also be sent via pack/unpack routines other per-atom attributes may also be sent via pack/unpack routines
------------------------------------------------------------------------- */ ------------------------------------------------------------------------- */
void Comm::reverse_communicate() void Comm::reverse_comm()
{ {
int n; int n;
MPI_Request request; MPI_Request request;
@ -808,7 +808,7 @@ void Comm::borders()
forward communication invoked by a Pair forward communication invoked by a Pair
------------------------------------------------------------------------- */ ------------------------------------------------------------------------- */
void Comm::comm_pair(Pair *pair) void Comm::forward_comm_pair(Pair *pair)
{ {
int iswap,n; int iswap,n;
double *buf; double *buf;
@ -877,7 +877,7 @@ void Comm::reverse_comm_pair(Pair *pair)
forward communication invoked by a Fix forward communication invoked by a Fix
------------------------------------------------------------------------- */ ------------------------------------------------------------------------- */
void Comm::comm_fix(Fix *fix) void Comm::forward_comm_fix(Fix *fix)
{ {
int iswap,n; int iswap,n;
double *buf; double *buf;
@ -946,7 +946,7 @@ void Comm::reverse_comm_fix(Fix *fix)
forward communication invoked by a Compute forward communication invoked by a Compute
------------------------------------------------------------------------- */ ------------------------------------------------------------------------- */
void Comm::comm_compute(Compute *compute) void Comm::forward_comm_compute(Compute *compute)
{ {
int iswap,n; int iswap,n;
double *buf; double *buf;

View File

@ -43,16 +43,16 @@ class Comm : protected Pointers {
void init(); void init();
void set_procs(); // setup 3d grid of procs void set_procs(); // setup 3d grid of procs
void setup(); // setup 3d communication pattern void setup(); // setup 3d communication pattern
void communicate(); // communication of atom coords void forward_comm(); // forward communication of atom coords
void reverse_communicate(); // reverse communication of forces void reverse_comm(); // reverse communication of forces
void exchange(); // move atoms to new procs void exchange(); // move atoms to new procs
void borders(); // setup list of atoms to communicate void borders(); // setup list of atoms to communicate
void comm_pair(class Pair *); // forward comm from a Pair void forward_comm_pair(class Pair *); // forward comm from a Pair
void reverse_comm_pair(class Pair *); // reverse comm from a Pair void reverse_comm_pair(class Pair *); // reverse comm from a Pair
void comm_fix(class Fix *); // forward comm from a Fix void forward_comm_fix(class Fix *); // forward comm from a Fix
void reverse_comm_fix(class Fix *); // reverse comm from a Fix void reverse_comm_fix(class Fix *); // reverse comm from a Fix
void comm_compute(class Compute *); // forward comm from a Compute void forward_comm_compute(class Compute *); // forward comm from a Compute
void reverse_comm_compute(class Compute *); // reverse comm from a Compute void reverse_comm_compute(class Compute *); // reverse comm from a Compute
void irregular(); // irregular communication across all procs void irregular(); // irregular communication across all procs

View File

@ -335,7 +335,7 @@ void FixOrientFCC::post_force(int vflag)
// communicate to acquire nbr data for ghost atoms // communicate to acquire nbr data for ghost atoms
comm->comm_fix(this); comm->forward_comm_fix(this);
// compute grain boundary force on each owned atom // compute grain boundary force on each owned atom
// skip atoms not in group // skip atoms not in group

View File

@ -503,7 +503,7 @@ void FixShake::post_force(int vflag)
// communicate results if necessary // communicate results if necessary
if (nprocs > 1) comm->comm_fix(this); if (nprocs > 1) comm->forward_comm_fix(this);
// virial setup // virial setup
@ -2331,7 +2331,7 @@ void FixShake::post_force_respa(int vflag, int ilevel, int iloop)
// communicate results if necessary // communicate results if necessary
if (nprocs > 1) comm->comm_fix(this); if (nprocs > 1) comm->forward_comm_fix(this);
// virial setup // virial setup

View File

@ -233,7 +233,7 @@ void Min::setup()
force->kspace->compute(eflag,vflag); force->kspace->compute(eflag,vflag);
} }
if (force->newton) comm->reverse_communicate(); if (force->newton) comm->reverse_comm();
modify->setup(vflag); modify->setup(vflag);
output->setup(1); output->setup(1);
@ -287,7 +287,7 @@ void Min::setup_minimal(int flag)
force->kspace->compute(eflag,vflag); force->kspace->compute(eflag,vflag);
} }
if (force->newton) comm->reverse_communicate(); if (force->newton) comm->reverse_comm();
modify->setup(vflag); modify->setup(vflag);
@ -394,7 +394,7 @@ double Min::energy_force(int resetflag)
if (nflag == 0) { if (nflag == 0) {
timer->stamp(); timer->stamp();
comm->communicate(); comm->forward_comm();
timer->stamp(TIME_COMM); timer->stamp(TIME_COMM);
} else { } else {
if (modify->n_min_pre_exchange) modify->min_pre_exchange(); if (modify->n_min_pre_exchange) modify->min_pre_exchange();
@ -438,7 +438,7 @@ double Min::energy_force(int resetflag)
} }
if (force->newton) { if (force->newton) {
comm->reverse_communicate(); comm->reverse_comm();
timer->stamp(TIME_COMM); timer->stamp(TIME_COMM);
} }

View File

@ -353,7 +353,7 @@ void Respa::setup()
force->kspace->setup(); force->kspace->setup();
force->kspace->compute(eflag,vflag); force->kspace->compute(eflag,vflag);
} }
if (newton[ilevel]) comm->reverse_communicate(); if (newton[ilevel]) comm->reverse_comm();
copy_f_flevel(ilevel); copy_f_flevel(ilevel);
} }
@ -413,7 +413,7 @@ void Respa::setup_minimal(int flag)
force->kspace->setup(); force->kspace->setup();
force->kspace->compute(eflag,vflag); force->kspace->compute(eflag,vflag);
} }
if (newton[ilevel]) comm->reverse_communicate(); if (newton[ilevel]) comm->reverse_comm();
copy_f_flevel(ilevel); copy_f_flevel(ilevel);
} }
@ -513,7 +513,7 @@ void Respa::recurse(int ilevel)
} else if (ilevel == 0) { } else if (ilevel == 0) {
timer->stamp(); timer->stamp();
comm->communicate(); comm->forward_comm();
timer->stamp(TIME_COMM); timer->stamp(TIME_COMM);
} }
@ -560,7 +560,7 @@ void Respa::recurse(int ilevel)
} }
if (newton[ilevel]) { if (newton[ilevel]) {
comm->reverse_communicate(); comm->reverse_comm();
timer->stamp(TIME_COMM); timer->stamp(TIME_COMM);
} }

View File

@ -0,0 +1,20 @@
/* ----------------------------------------------------------------------
LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator
http://lammps.sandia.gov, Sandia National Laboratories
Steve Plimpton, sjplimp@sandia.gov
Copyright (2003) Sandia Corporation. Under the terms of Contract
DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
certain rights in this software. This software is distributed under
the GNU General Public License.
See the README file in the top-level LAMMPS directory.
------------------------------------------------------------------------- */
#ifdef ComputeInclude
#include "compute_ackland_atom.h"
#endif
#ifdef ComputeClass
ComputeStyle(ackland/atom,ComputeAcklandAtom)
#endif

View File

@ -0,0 +1,30 @@
/* ----------------------------------------------------------------------
LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator
http://lammps.sandia.gov, Sandia National Laboratories
Steve Plimpton, sjplimp@sandia.gov
Copyright (2003) Sandia Corporation. Under the terms of Contract
DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
certain rights in this software. This software is distributed under
the GNU General Public License.
See the README file in the top-level LAMMPS directory.
------------------------------------------------------------------------- */
#ifdef KSpaceInclude
#include "ewald_n.h"
#endif
#ifdef KSpaceClass
KSpaceStyle(ewald/n,EwaldN)
#endif
#ifdef PairInclude
#include "pair_buck_coul.h"
#include "pair_lj_coul.h"
#endif
#ifdef PairClass
PairStyle(buck/coul,PairBuckCoul)
PairStyle(lj/coul,PairLJCoul)
#endif

View File

@ -115,7 +115,7 @@ void Verlet::setup()
force->kspace->compute(eflag,vflag); force->kspace->compute(eflag,vflag);
} }
if (force->newton) comm->reverse_communicate(); if (force->newton) comm->reverse_comm();
modify->setup(vflag); modify->setup(vflag);
output->setup(1); output->setup(1);
@ -165,7 +165,7 @@ void Verlet::setup_minimal(int flag)
force->kspace->compute(eflag,vflag); force->kspace->compute(eflag,vflag);
} }
if (force->newton) comm->reverse_communicate(); if (force->newton) comm->reverse_comm();
modify->setup(vflag); modify->setup(vflag);
} }
@ -201,7 +201,7 @@ void Verlet::run(int n)
if (nflag == 0) { if (nflag == 0) {
timer->stamp(); timer->stamp();
comm->communicate(); comm->forward_comm();
timer->stamp(TIME_COMM); timer->stamp(TIME_COMM);
} else { } else {
if (n_pre_exchange) modify->pre_exchange(); if (n_pre_exchange) modify->pre_exchange();
@ -250,7 +250,7 @@ void Verlet::run(int n)
// reverse communication of forces // reverse communication of forces
if (force->newton) { if (force->newton) {
comm->reverse_communicate(); comm->reverse_comm();
timer->stamp(TIME_COMM); timer->stamp(TIME_COMM);
} }