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

This commit is contained in:
sjplimp
2013-06-06 14:52:02 +00:00
parent 94d3ef2744
commit c3d6358742
5 changed files with 908 additions and 894 deletions

View File

@ -45,10 +45,10 @@ action pair_coul_dsf_gpu.cpp
action pair_coul_dsf_gpu.h action pair_coul_dsf_gpu.h
action pair_coul_long_gpu.cpp pair_coul_long.cpp action pair_coul_long_gpu.cpp pair_coul_long.cpp
action pair_coul_long_gpu.h pair_coul_long.cpp action pair_coul_long_gpu.h pair_coul_long.cpp
action pair_dipole_cut_gpu.cpp pair_dipole_cut.cpp action pair_lj_cut_dipole_cut_gpu.cpp pair_lj_cut_dipole_cut.cpp
action pair_dipole_cut_gpu.h pair_dipole_cut.cpp action pair_lj_cut_dipole_cut_gpu.h pair_lj_cut_dipole_cut.cpp
action pair_dipole_sf_gpu.cpp pair_dipole_sf.cpp action pair_lj_sf_dipole_sf_gpu.cpp pair_lj_sf_dipole_sf.cpp
action pair_dipole_sf_gpu.h pair_dipole_sf.cpp action pair_lj_sf_dipole_sf_gpu.h pair_lj_sf_dipole_sf.cpp
action pair_eam_alloy_gpu.cpp pair_eam.cpp action pair_eam_alloy_gpu.cpp pair_eam.cpp
action pair_eam_alloy_gpu.h pair_eam.cpp action pair_eam_alloy_gpu.h pair_eam.cpp
action pair_eam_fs_gpu.cpp pair_eam.cpp action pair_eam_fs_gpu.cpp pair_eam.cpp

View File

@ -19,7 +19,7 @@
#include "math.h" #include "math.h"
#include "stdio.h" #include "stdio.h"
#include "stdlib.h" #include "stdlib.h"
#include "pair_dipole_cut_gpu.h" #include "pair_lj_cut_dipole_cut_gpu.h"
#include "atom.h" #include "atom.h"
#include "atom_vec.h" #include "atom_vec.h"
#include "comm.h" #include "comm.h"
@ -68,7 +68,7 @@ using namespace LAMMPS_NS;
/* ---------------------------------------------------------------------- */ /* ---------------------------------------------------------------------- */
PairDipoleCutGPU::PairDipoleCutGPU(LAMMPS *lmp) : PairDipoleCut(lmp), PairLJCutDipoleCutGPU::PairLJCutDipoleCutGPU(LAMMPS *lmp) : PairLJCutDipoleCut(lmp),
gpu_mode(GPU_FORCE) gpu_mode(GPU_FORCE)
{ {
respa_enable = 0; respa_enable = 0;
@ -80,14 +80,14 @@ PairDipoleCutGPU::PairDipoleCutGPU(LAMMPS *lmp) : PairDipoleCut(lmp),
free all arrays free all arrays
------------------------------------------------------------------------- */ ------------------------------------------------------------------------- */
PairDipoleCutGPU::~PairDipoleCutGPU() PairLJCutDipoleCutGPU::~PairLJCutDipoleCutGPU()
{ {
dpl_gpu_clear(); dpl_gpu_clear();
} }
/* ---------------------------------------------------------------------- */ /* ---------------------------------------------------------------------- */
void PairDipoleCutGPU::compute(int eflag, int vflag) void PairLJCutDipoleCutGPU::compute(int eflag, int vflag)
{ {
if (eflag || vflag) ev_setup(eflag,vflag); if (eflag || vflag) ev_setup(eflag,vflag);
else evflag = vflag_fdotr = 0; else evflag = vflag_fdotr = 0;
@ -130,7 +130,7 @@ void PairDipoleCutGPU::compute(int eflag, int vflag)
init specific to this pair style init specific to this pair style
------------------------------------------------------------------------- */ ------------------------------------------------------------------------- */
void PairDipoleCutGPU::init_style() void PairLJCutDipoleCutGPU::init_style()
{ {
if (!atom->q_flag || !atom->mu_flag || !atom->torque_flag) if (!atom->q_flag || !atom->mu_flag || !atom->torque_flag)
error->all(FLERR,"Pair dipole/cut/gpu requires atom attributes q, mu, torque"); error->all(FLERR,"Pair dipole/cut/gpu requires atom attributes q, mu, torque");
@ -138,6 +138,9 @@ void PairDipoleCutGPU::init_style()
if (force->newton_pair) if (force->newton_pair)
error->all(FLERR,"Cannot use newton pair with dipole/cut/gpu pair style"); error->all(FLERR,"Cannot use newton pair with dipole/cut/gpu pair style");
if (strcmp(update->unit_style,"electron") == 0)
error->all(FLERR,"Cannot (yet) use 'electron' units with dipoles");
// Repeat cutsq calculation because done after call to init_style // Repeat cutsq calculation because done after call to init_style
double maxcut = -1.0; double maxcut = -1.0;
double cut; double cut;
@ -174,7 +177,7 @@ void PairDipoleCutGPU::init_style()
/* ---------------------------------------------------------------------- */ /* ---------------------------------------------------------------------- */
double PairDipoleCutGPU::memory_usage() double PairLJCutDipoleCutGPU::memory_usage()
{ {
double bytes = Pair::memory_usage(); double bytes = Pair::memory_usage();
return bytes + dpl_gpu_bytes(); return bytes + dpl_gpu_bytes();
@ -182,7 +185,7 @@ double PairDipoleCutGPU::memory_usage()
/* ---------------------------------------------------------------------- */ /* ---------------------------------------------------------------------- */
void PairDipoleCutGPU::cpu_compute(int start, int inum, int eflag, int vflag, void PairLJCutDipoleCutGPU::cpu_compute(int start, int inum, int eflag, int vflag,
int *ilist, int *numneigh, int *ilist, int *numneigh,
int **firstneigh) int **firstneigh)
{ {

View File

@ -13,21 +13,21 @@
#ifdef PAIR_CLASS #ifdef PAIR_CLASS
PairStyle(dipole/cut/gpu,PairDipoleCutGPU) PairStyle(lj/cut/dipole/cut/gpu,PairLJCutDipoleCutGPU)
#else #else
#ifndef LMP_PAIR_DIPOLE_CUT_GPU_H #ifndef LMP_PAIR_LJ_CUT_DIPOLE_CUT_GPU_H
#define LMP_PAIR_DIPOLE_CUT_GPU_H #define LMP_PAIR_LJ_CUT_DIPOLE_CUT_GPU_H
#include "pair_dipole_cut.h" #include "pair_lj_cut_dipole_cut.h"
namespace LAMMPS_NS { namespace LAMMPS_NS {
class PairDipoleCutGPU : public PairDipoleCut { class PairLJCutDipoleCutGPU : public PairLJCutDipoleCut {
public: public:
PairDipoleCutGPU(LAMMPS *lmp); PairLJCutDipoleCutGPU(LAMMPS *lmp);
~PairDipoleCutGPU(); ~PairLJCutDipoleCutGPU();
void cpu_compute(int, int, int, int, int *, int *, int **); void cpu_compute(int, int, int, int, int *, int *, int **);
void compute(int, int); void compute(int, int);
void init_style(); void init_style();
@ -60,4 +60,8 @@ E: Cannot use newton pair with dipole/cut/gpu pair style
Self-explanatory. Self-explanatory.
E: Cannot (yet) use 'electron' units with dipoles
This feature is not yet supported.
*/ */

View File

@ -19,7 +19,7 @@
#include "math.h" #include "math.h"
#include "stdio.h" #include "stdio.h"
#include "stdlib.h" #include "stdlib.h"
#include "pair_dipole_sf_gpu.h" #include "pair_lj_sf_dipole_sf_gpu.h"
#include "atom.h" #include "atom.h"
#include "atom_vec.h" #include "atom_vec.h"
#include "comm.h" #include "comm.h"
@ -67,7 +67,7 @@ using namespace LAMMPS_NS;
/* ---------------------------------------------------------------------- */ /* ---------------------------------------------------------------------- */
PairDipoleSFGPU::PairDipoleSFGPU(LAMMPS *lmp) : PairDipoleSF(lmp), PairLJSFDipoleSFGPU::PairLJSFDipoleSFGPU(LAMMPS *lmp) : PairLJSFDipoleSF(lmp),
gpu_mode(GPU_FORCE) gpu_mode(GPU_FORCE)
{ {
respa_enable = 0; respa_enable = 0;
@ -79,14 +79,14 @@ PairDipoleSFGPU::PairDipoleSFGPU(LAMMPS *lmp) : PairDipoleSF(lmp),
free all arrays free all arrays
------------------------------------------------------------------------- */ ------------------------------------------------------------------------- */
PairDipoleSFGPU::~PairDipoleSFGPU() PairLJSFDipoleSFGPU::~PairLJSFDipoleSFGPU()
{ {
dplsf_gpu_clear(); dplsf_gpu_clear();
} }
/* ---------------------------------------------------------------------- */ /* ---------------------------------------------------------------------- */
void PairDipoleSFGPU::compute(int eflag, int vflag) void PairLJSFDipoleSFGPU::compute(int eflag, int vflag)
{ {
if (eflag || vflag) ev_setup(eflag,vflag); if (eflag || vflag) ev_setup(eflag,vflag);
else evflag = vflag_fdotr = 0; else evflag = vflag_fdotr = 0;
@ -129,7 +129,7 @@ void PairDipoleSFGPU::compute(int eflag, int vflag)
init specific to this pair style init specific to this pair style
------------------------------------------------------------------------- */ ------------------------------------------------------------------------- */
void PairDipoleSFGPU::init_style() void PairLJSFDipoleSFGPU::init_style()
{ {
if (!atom->q_flag || !atom->mu_flag || !atom->torque_flag) if (!atom->q_flag || !atom->mu_flag || !atom->torque_flag)
error->all(FLERR,"Pair dipole/sf/gpu requires atom attributes q, mu, torque"); error->all(FLERR,"Pair dipole/sf/gpu requires atom attributes q, mu, torque");
@ -137,6 +137,9 @@ void PairDipoleSFGPU::init_style()
if (force->newton_pair) if (force->newton_pair)
error->all(FLERR,"Cannot use newton pair with dipole/sf/gpu pair style"); error->all(FLERR,"Cannot use newton pair with dipole/sf/gpu pair style");
if (strcmp(update->unit_style,"electron") == 0)
error->all(FLERR,"Cannot (yet) use 'electron' units with dipoles");
// Repeat cutsq calculation because done after call to init_style // Repeat cutsq calculation because done after call to init_style
double maxcut = -1.0; double maxcut = -1.0;
double cut; double cut;
@ -173,7 +176,7 @@ void PairDipoleSFGPU::init_style()
/* ---------------------------------------------------------------------- */ /* ---------------------------------------------------------------------- */
double PairDipoleSFGPU::memory_usage() double PairLJSFDipoleSFGPU::memory_usage()
{ {
double bytes = Pair::memory_usage(); double bytes = Pair::memory_usage();
return bytes + dplsf_gpu_bytes(); return bytes + dplsf_gpu_bytes();
@ -181,7 +184,7 @@ double PairDipoleSFGPU::memory_usage()
/* ---------------------------------------------------------------------- */ /* ---------------------------------------------------------------------- */
void PairDipoleSFGPU::cpu_compute(int start, int inum, int eflag, int vflag, void PairLJSFDipoleSFGPU::cpu_compute(int start, int inum, int eflag, int vflag,
int *ilist, int *numneigh, int *ilist, int *numneigh,
int **firstneigh) int **firstneigh)
{ {

View File

@ -13,21 +13,21 @@
#ifdef PAIR_CLASS #ifdef PAIR_CLASS
PairStyle(dipole/sf/gpu,PairDipoleSFGPU) PairStyle(lj/sf/dipole/sf/gpu,PairLJSFDipoleSFGPU)
#else #else
#ifndef LMP_PAIR_DIPOLE_SF_GPU_H #ifndef LMP_PAIR_LJ_SF_DIPOLE_SF_GPU_H
#define LMP_PAIR_DIPOLE_SF_GPU_H #define LMP_PAIR_LJ_SF_DIPOLE_SF_GPU_H
#include "pair_dipole_sf.h" #include "pair_lj_sf_dipole_sf.h"
namespace LAMMPS_NS { namespace LAMMPS_NS {
class PairDipoleSFGPU : public PairDipoleSF { class PairLJSFDipoleSFGPU : public PairLJSFDipoleSF {
public: public:
PairDipoleSFGPU(LAMMPS *lmp); PairLJSFDipoleSFGPU(LAMMPS *lmp);
~PairDipoleSFGPU(); ~PairLJSFDipoleSFGPU();
void cpu_compute(int, int, int, int, int *, int *, int **); void cpu_compute(int, int, int, int, int *, int *, int **);
void compute(int, int); void compute(int, int);
void init_style(); void init_style();
@ -60,4 +60,8 @@ E: Cannot use newton pair with dipole/cut/gpu pair style
Self-explanatory. Self-explanatory.
E: Cannot (yet) use 'electron' units with dipoles
This feature is not yet supported.
*/ */