| 36 |
|
* [1] Meineke, et al., J. Comp. Chem. 26, 252-271 (2005). |
| 37 |
|
* [2] Fennell & Gezelter, J. Chem. Phys. 124, 234104 (2006). |
| 38 |
|
* [3] Sun, Lin & Gezelter, J. Chem. Phys. 128, 24107 (2008). |
| 39 |
< |
* [4] Vardeman & Gezelter, in progress (2009). |
| 39 |
> |
* [4] Kuang & Gezelter, J. Chem. Phys. 133, 164101 (2010). |
| 40 |
> |
* [5] Vardeman, Stocker & Gezelter, J. Chem. Theory Comput. 7, 834 (2011). |
| 41 |
|
*/ |
| 42 |
|
|
| 43 |
|
#ifndef NONBONDED_LJ_HPP |
| 44 |
|
#define NONBONDED_LJ_HPP |
| 45 |
|
|
| 46 |
< |
#include "types/AtomType.hpp" |
| 46 |
> |
#include "nonbonded/NonBondedInteraction.hpp" |
| 47 |
|
#include "UseTheForce/ForceField.hpp" |
| 48 |
|
#include "math/Vector3.hpp" |
| 49 |
|
|
| 50 |
+ |
using namespace std; |
| 51 |
|
namespace OpenMD { |
| 52 |
|
|
| 53 |
|
struct LJInteractionData { |
| 57 |
|
bool explicitlySet; |
| 58 |
|
}; |
| 59 |
|
|
| 60 |
< |
class LJ { |
| 60 |
> |
class LJ : public VanDerWaalsInteraction { |
| 61 |
|
|
| 62 |
|
public: |
| 63 |
< |
static LJ* Instance(); |
| 64 |
< |
static void setForceField(ForceField *ff) {forceField_ = ff;}; |
| 65 |
< |
static void initialize(); |
| 66 |
< |
static void addType(AtomType* atomType); |
| 67 |
< |
static void addExplicitInteraction(AtomType* atype1, AtomType* atype2, RealType sigma, RealType epsilon); |
| 68 |
< |
static void calcForce(AtomType* at1, AtomType* at2, Vector3d d, RealType rij, RealType r2, RealType rcut, RealType sw, RealType vdwMult, RealType vpair, RealType pot, Vector3d f1); |
| 69 |
< |
|
| 70 |
< |
// Fortran support routines; |
| 69 |
< |
static RealType getSigma(int atid); |
| 70 |
< |
static RealType getEpsilon(int atid); |
| 71 |
< |
static void do_lj_pair(int *atid1, int *atid2, RealType *d, RealType *rij, RealType *r2, RealType *rcut, RealType *sw, RealType *vdwMult, RealType *vpair, RealType *pot, RealType *f1); |
| 72 |
< |
static void setLJDefaultCutoff(RealType *thisRcut, int *sP, int *sF); |
| 73 |
< |
|
| 63 |
> |
LJ(); |
| 64 |
> |
void setForceField(ForceField *ff) {forceField_ = ff;}; |
| 65 |
> |
void addType(AtomType* atomType); |
| 66 |
> |
void addExplicitInteraction(AtomType* atype1, AtomType* atype2, RealType sigma, RealType epsilon); |
| 67 |
> |
virtual void calcForce(InteractionData &idat); |
| 68 |
> |
virtual string getName() {return name_;} |
| 69 |
> |
virtual RealType getSuggestedCutoffRadius(pair<AtomType*, AtomType*> atypes); |
| 70 |
> |
|
| 71 |
|
private: |
| 72 |
< |
// singleton pattern, prevent reconstruction |
| 73 |
< |
LJ() {}; |
| 74 |
< |
LJ(LJ const &) {}; |
| 78 |
< |
LJ& operator=(LJ const&) {}; |
| 79 |
< |
static LJ* _instance; |
| 80 |
< |
|
| 81 |
< |
static LJParam getLJParam(AtomType* atomType); |
| 82 |
< |
static RealType getSigma(AtomType* atomType); |
| 83 |
< |
static RealType getEpsilon(AtomType* atomType); |
| 72 |
> |
void initialize(); |
| 73 |
> |
RealType getSigma(AtomType* atomType1, AtomType* atomType2); |
| 74 |
> |
RealType getEpsilon(AtomType* atomType1, AtomType* atomType2); |
| 75 |
|
|
| 76 |
< |
static RealType getSigma(AtomType* atomType1, AtomType* atomType2); |
| 86 |
< |
static RealType getEpsilon(AtomType* atomType1, AtomType* atomType2); |
| 76 |
> |
void getLJfunc(const RealType r, RealType &pot, RealType &deriv); |
| 77 |
|
|
| 78 |
< |
static void getLJfunc(const RealType r, RealType pot, RealType deriv); |
| 78 |
> |
bool initialized_; |
| 79 |
|
|
| 80 |
< |
static bool initialized_; |
| 81 |
< |
// LJMap will be used for providing access from Fortran. |
| 82 |
< |
// All of the C++ native classes should use AtomType*, but the |
| 83 |
< |
// fortran calls use int, so we need to look these up first before |
| 94 |
< |
// we can do anything else; |
| 95 |
< |
static std::map<int, AtomType*> LJMap; |
| 96 |
< |
static std::map<std::pair<AtomType*, AtomType*>, LJInteractionData> MixingMap; |
| 97 |
< |
static bool shiftedPot_; |
| 98 |
< |
static bool shiftedFrc_; |
| 99 |
< |
static ForceField* forceField_; |
| 100 |
< |
|
| 80 |
> |
map<int, AtomType*> LJMap; |
| 81 |
> |
map<pair<AtomType*, AtomType*>, LJInteractionData> MixingMap; |
| 82 |
> |
ForceField* forceField_; |
| 83 |
> |
string name_; |
| 84 |
|
}; |
| 85 |
|
} |
| 86 |
|
|