00001 #ifndef SimTK_MOLMODEL_DUMM_FORCE_FIELD_SUBSYSTEM_H_
00002 #define SimTK_MOLMODEL_DUMM_FORCE_FIELD_SUBSYSTEM_H_
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034
00041 #include "SimTKcommon.h"
00042 #include "simbody/internal/ForceSubsystem.h"
00043
00044 #include "molmodel/internal/common.h"
00045 #include "molmodel/internal/Biotype.h"
00046
00047 #include <cassert>
00048
00049
00058 namespace SimTK {
00059
00060 class MolecularMechanicsSystem;
00061
00067 namespace DuMM {
00068 SimTK_DEFINE_UNIQUE_INDEX_TYPE(AtomIndex);
00069 SimTK_DEFINE_UNIQUE_INDEX_TYPE(AtomClassIndex);
00070 SimTK_DEFINE_UNIQUE_INDEX_TYPE(ChargedAtomTypeIndex);
00071 SimTK_DEFINE_UNIQUE_INDEX_TYPE(BondIndex);
00072 SimTK_DEFINE_UNIQUE_INDEX_TYPE(ClusterIndex);
00073
00074
00142
00150 class CustomBondStretch {
00151 public:
00152 virtual ~CustomBondStretch() {}
00153 virtual Real calcEnergy(Real distance) const = 0;
00154 virtual Real calcForce(Real distance) const = 0;
00155 };
00156
00164 class CustomBondBend {
00165 public:
00166 virtual ~CustomBondBend() {}
00167 virtual Real calcEnergy(Real bendAngle) const = 0;
00168 virtual Real calcTorque(Real bendAngle) const = 0;
00169 };
00170
00219 class CustomBondTorsion {
00220 public:
00221 virtual ~CustomBondTorsion() {}
00222 virtual Real calcEnergy(Real dihedralAngle) const = 0;
00223 virtual Real calcTorque(Real dihedralAngle) const = 0;
00224 };
00226
00250 static const Real Ang2Nm = (Real)0.1L;
00251 static const Real Nm2Ang = (Real)10.L;
00252 static const Real Deg2Rad = (Real)SimTK_DEGREE_TO_RADIAN;
00253 static const Real Rad2Deg = (Real)SimTK_RADIAN_TO_DEGREE;
00254 static const Real KJ2Kcal = (Real)SimTK_KJOULE_TO_KCAL;
00255 static const Real Kcal2KJ = (Real)SimTK_KCAL_TO_KJOULE;
00256
00257 static const Real Sigma2Radius = (Real)std::pow(2.L, 1.L/6.L);
00259 static const Real Radius2Sigma = (Real)std::pow(2.L, -1.L/6.L);
00261
00262 }
00263
00266
00281 class SimTK_MOLMODEL_EXPORT DuMMForceFieldSubsystem : public ForceSubsystem {
00282 public:
00284 enum VdwMixingRule {
00285 WaldmanHagler = 1,
00286 HalgrenHHG = 2,
00287 Jorgensen = 3,
00288 LorentzBerthelot = 4,
00289 Kong = 5
00290 };
00291
00292 DuMMForceFieldSubsystem();
00293 explicit DuMMForceFieldSubsystem(MolecularMechanicsSystem&);
00294
00301
00304 const Vec3& getAtomLocationInGround(const State& state, DuMM::AtomIndex atomIx);
00307 const Vec3& getAtomVelocityInGround(const State& state, DuMM::AtomIndex atomIx);
00308
00314 const Vec3& getAtomBodyStationInGround(const State& state, DuMM::AtomIndex atomIx);
00315
00317
00324
00327 DuMM::AtomIndex addAtom(DuMM::ChargedAtomTypeIndex chargedAtomTypeIx);
00328
00331 DuMM::BondIndex addBond(DuMM::AtomIndex atom1Ix, DuMM::AtomIndex atom2Ix);
00332
00337 DuMM::AtomIndex getBondAtom(DuMM::BondIndex bond, int which) const;
00338
00340 int getNumAtoms() const;
00342 int getNumBonds() const;
00343
00345 Real getAtomMass(DuMM::AtomIndex atomIx) const;
00347 int getAtomElement(DuMM::AtomIndex atomIx) const;
00349 Real getAtomRadius(DuMM::AtomIndex atomIx) const;
00352 MobilizedBodyIndex getAtomBody(DuMM::AtomIndex atomIx) const;
00355 Vec3 getAtomStationOnBody(DuMM::AtomIndex atomIx) const;
00356
00360 Vec3 getAtomStationInCluster(DuMM::AtomIndex atomIx, DuMM::ClusterIndex clusterIx) const;
00361
00365 Vec3 getElementDefaultColor(int atomicNumber) const;
00368 Vec3 getAtomDefaultColor(DuMM::AtomIndex atomIx) const;
00369
00370
00372
00385
00389 DuMM::ClusterIndex createCluster(const char* clusterName);
00390
00394 void placeAtomInCluster(DuMM::AtomIndex atomIx, DuMM::ClusterIndex clusterIx, const Vec3& station);
00395
00399 void placeClusterInCluster(DuMM::ClusterIndex childClusterIndex, DuMM::ClusterIndex parentClusterIndex,
00400 const Transform& X_PC);
00401
00405 MassProperties calcClusterMassProperties(DuMM::ClusterIndex clusterIx, const Transform& X_BC = Transform()) const;
00406
00410 void attachClusterToBody(DuMM::ClusterIndex clusterIx, MobilizedBodyIndex body, const Transform& X_BC = Transform());
00411
00413 void attachAtomToBody(DuMM::AtomIndex atomIx, MobilizedBodyIndex body, const Vec3& station = Vec3(0));
00414
00416 MobilizedBodyIndex getClusterBody(DuMM::ClusterIndex clusterIx) const;
00417
00420 Transform getClusterPlacementOnBody(DuMM::ClusterIndex clusterIx) const;
00421
00424 Transform getClusterPlacementInCluster(DuMM::ClusterIndex childClusterIndex, DuMM::ClusterIndex parentClusterIndex) const;
00425
00427
00428
00429
00430
00453 void defineAtomClass(DuMM::AtomClassIndex atomClassIx, const char* atomClassName,
00454 int elementNumber, int expectedValence,
00455 Real vdwRadiusInNm, Real vdwWellDepthInKJ) {
00456 defineIncompleteAtomClass(atomClassIx, atomClassName, elementNumber, expectedValence);
00457 setAtomClassVdwParameters(atomClassIx, vdwRadiusInNm, vdwWellDepthInKJ);
00458 }
00459
00462 void defineAtomClass_KA(DuMM::AtomClassIndex atomClassIx, const char* atomClassName,
00463 int element, int valence,
00464 Real vdwRadiusInAng, Real vdwWellDepthInKcal)
00465 {
00466 defineAtomClass(atomClassIx, atomClassName, element, valence,
00467 vdwRadiusInAng*DuMM::Ang2Nm, vdwWellDepthInKcal*DuMM::Kcal2KJ);
00468 }
00469
00470 void defineAtomClass_KA(int atomClassIx, const char* atomClassName,
00471 int element, int valence,
00472 Real vdwRadiusInAng, Real vdwWellDepthInKcal)
00473 {
00474 defineAtomClass_KA((DuMM::AtomClassIndex)atomClassIx, atomClassName, element, valence, vdwRadiusInAng, vdwWellDepthInKcal);
00475 }
00476
00477 bool hasAtomClass(DuMM::AtomClassIndex) const;
00478 bool hasAtomClass(const String& atomClassName) const;
00479 DuMM::AtomClassIndex getAtomClassIndex(const String& atomClassName) const;
00480 DuMM::AtomClassIndex getNextUnusedAtomClassIndex() const;
00481
00482 DuMM::AtomClassIndex getAtomClassIndex(DuMM::AtomIndex atomIx) const;
00483 Real getVdwRadius(DuMM::AtomClassIndex atomClassIx) const;
00484 Real getVdwWellDepth(DuMM::AtomClassIndex atomClassIx) const;
00485
00487 void defineChargedAtomType(DuMM::ChargedAtomTypeIndex atomTypeIx, const char* atomTypeName,
00488 DuMM::AtomClassIndex atomClassIx, Real partialChargeInE) {
00489 defineIncompleteChargedAtomType(atomTypeIx, atomTypeName, atomClassIx);
00490 setChargedAtomTypeCharge(atomTypeIx, partialChargeInE);
00491 }
00492
00493 void defineChargedAtomType_KA(DuMM::ChargedAtomTypeIndex atomTypeIx, const char* atomTypeName,
00494 DuMM::AtomClassIndex atomClassIx, Real partialChargeInE)
00495 {
00496 defineChargedAtomType(atomTypeIx, atomTypeName, atomClassIx, partialChargeInE);
00497 }
00498
00499 void defineChargedAtomType_KA(int atomTypeIx, const char* atomTypeName,
00500 int atomClassIx, Real partialChargeInE)
00501 {
00502 defineChargedAtomType_KA((DuMM::ChargedAtomTypeIndex) atomTypeIx, atomTypeName, (DuMM::AtomClassIndex)atomClassIx, partialChargeInE);
00503 }
00504
00505 bool hasChargedAtomType(DuMM::ChargedAtomTypeIndex) const;
00506 bool hasChargedAtomType(const String& chargedTypeName) const;
00507 DuMM::ChargedAtomTypeIndex getChargedAtomTypeIndex(const String& chargedTypeName) const;
00508 DuMM::ChargedAtomTypeIndex getNextUnusedChargedAtomTypeIndex() const;
00509
00511
00519
00521 const char* getVdwMixingRuleName(VdwMixingRule) const;
00522
00524 void setVdwMixingRule(VdwMixingRule);
00527 VdwMixingRule getVdwMixingRule() const;
00528
00529 void setVdw12ScaleFactor(Real);
00530 void setVdw13ScaleFactor(Real);
00531 void setVdw14ScaleFactor(Real);
00532 void setVdw15ScaleFactor(Real);
00533
00534 void setCoulomb12ScaleFactor(Real);
00535 void setCoulomb13ScaleFactor(Real);
00536 void setCoulomb14ScaleFactor(Real);
00537 void setCoulomb15ScaleFactor(Real);
00538
00539
00547
00552 void loadAmber99Parameters();
00553
00554
00555
00556
00561 void populateFromTinkerParameterFile(
00562 std::istream&
00563 );
00564
00569 void setBiotypeChargedAtomType(
00570 DuMM::ChargedAtomTypeIndex chargedAtomTypeIndex,
00571 BiotypeIndex biotypeIx
00572 );
00573
00577 DuMM::ChargedAtomTypeIndex getBiotypeChargedAtomType(BiotypeIndex biotypeIx) const;
00578
00582 std::ostream& generateBiotypeChargedAtomTypeSelfCode(std::ostream& os) const;
00583
00585
00592
00612 void defineBondStretch(DuMM::AtomClassIndex class1, DuMM::AtomClassIndex class2,
00613 Real stiffnessInKJperNmSq, Real nominalLengthInNm);
00614
00626 void defineBondStretch_KA(DuMM::AtomClassIndex class1, DuMM::AtomClassIndex class2,
00627 Real stiffnessInKcalPerAngSq, Real nominalLengthInAng)
00628 {
00629 defineBondStretch(class1, class2,
00630 stiffnessInKcalPerAngSq * DuMM::Kcal2KJ/square(DuMM::Ang2Nm),
00631 nominalLengthInAng * DuMM::Ang2Nm);
00632 }
00634 void defineBondStretch_KA(int class1, int class2,
00635 Real stiffnessInKcalPerAngSq, Real nominalLengthInAng)
00636 { defineBondStretch_KA((DuMM::AtomClassIndex)class1, (DuMM::AtomClassIndex)class2,
00637 stiffnessInKcalPerAngSq, nominalLengthInAng); }
00638
00652 void defineCustomBondStretch(DuMM::AtomClassIndex class1,
00653 DuMM::AtomClassIndex class2,
00654 DuMM::CustomBondStretch* bondStretchTerm);
00655
00657
00664
00686 void defineBondBend(DuMM::AtomClassIndex class1, DuMM::AtomClassIndex class2, DuMM::AtomClassIndex class3,
00687 Real stiffnessInKJPerRadSq, Real nominalAngleInDeg);
00688
00701 void defineBondBend_KA(DuMM::AtomClassIndex class1, DuMM::AtomClassIndex class2, DuMM::AtomClassIndex class3,
00702 Real stiffnessInKcalPerRadSq, Real nominalAngleInDeg)
00703 {
00704 defineBondBend(class1,class2,class3,
00705 stiffnessInKcalPerRadSq * DuMM::Kcal2KJ,
00706 nominalAngleInDeg);
00707 }
00709 void defineBondBend_KA(int class1, int class2, int class3,
00710 Real stiffnessInKcalPerRadSq, Real nominalAngleInDeg)
00711 { defineBondBend_KA((DuMM::AtomClassIndex)class1,(DuMM::AtomClassIndex)class2,(DuMM::AtomClassIndex)class3,
00712 stiffnessInKcalPerRadSq,nominalAngleInDeg); }
00713
00728 void defineCustomBondBend(DuMM::AtomClassIndex class1,
00729 DuMM::AtomClassIndex class2,
00730 DuMM::AtomClassIndex class3,
00731 DuMM::CustomBondBend* bondBendTerm);
00732
00734
00792
00820 void defineBondTorsion
00821 (DuMM::AtomClassIndex class1, DuMM::AtomClassIndex class2, DuMM::AtomClassIndex class3, DuMM::AtomClassIndex class4,
00822 int periodicity, Real ampInKJ, Real phaseInDegrees);
00825 void defineBondTorsion
00826 (DuMM::AtomClassIndex class1, DuMM::AtomClassIndex class2, DuMM::AtomClassIndex class3, DuMM::AtomClassIndex class4,
00827 int periodicity1, Real amp1InKJ, Real phase1InDegrees,
00828 int periodicity2, Real amp2InKJ, Real phase2InDegrees);
00831 void defineBondTorsion
00832 (DuMM::AtomClassIndex class1, DuMM::AtomClassIndex class2, DuMM::AtomClassIndex class3, DuMM::AtomClassIndex class4,
00833 int periodicity1, Real amp1InKJ, Real phase1InDegrees,
00834 int periodicity2, Real amp2InKJ, Real phase2InDegrees,
00835 int periodicity3, Real amp3InKJ, Real phase3InDegrees);
00836
00839 void defineBondTorsion_KA
00840 (DuMM::AtomClassIndex class1, DuMM::AtomClassIndex class2, DuMM::AtomClassIndex class3, DuMM::AtomClassIndex class4,
00841 int periodicity1, Real amp1InKcal, Real phase1InDegrees)
00842 {
00843 defineBondTorsion(class1,class2,class3,class4,
00844 periodicity1, amp1InKcal * DuMM::Kcal2KJ, phase1InDegrees);
00845 }
00848 void defineBondTorsion_KA
00849 (DuMM::AtomClassIndex class1, DuMM::AtomClassIndex class2, DuMM::AtomClassIndex class3, DuMM::AtomClassIndex class4,
00850 int periodicity1, Real amp1InKcal, Real phase1InDegrees,
00851 int periodicity2, Real amp2InKcal, Real phase2InDegrees)
00852 {
00853 defineBondTorsion(class1,class2,class3,class4,
00854 periodicity1, amp1InKcal * DuMM::Kcal2KJ, phase1InDegrees,
00855 periodicity2, amp2InKcal * DuMM::Kcal2KJ, phase2InDegrees);
00856 }
00859 void defineBondTorsion_KA
00860 (DuMM::AtomClassIndex class1, DuMM::AtomClassIndex class2, DuMM::AtomClassIndex class3, DuMM::AtomClassIndex class4,
00861 int periodicity1, Real amp1InKcal, Real phase1InDegrees,
00862 int periodicity2, Real amp2InKcal, Real phase2InDegrees,
00863 int periodicity3, Real amp3InKcal, Real phase3InDegrees)
00864 {
00865 defineBondTorsion(class1,class2,class3,class4,
00866 periodicity1, amp1InKcal * DuMM::Kcal2KJ, phase1InDegrees,
00867 periodicity2, amp2InKcal * DuMM::Kcal2KJ, phase2InDegrees,
00868 periodicity3, amp3InKcal * DuMM::Kcal2KJ, phase3InDegrees);
00869 }
00871 void defineBondTorsion_KA
00872 (int class1, int class2, int class3, int class4,
00873 int periodicity1, Real amp1InKcal, Real phase1InDegrees)
00874 {
00875 defineBondTorsion_KA
00876 ((DuMM::AtomClassIndex)class1, (DuMM::AtomClassIndex)class2, (DuMM::AtomClassIndex)class3, (DuMM::AtomClassIndex)class4,
00877 periodicity1, amp1InKcal, phase1InDegrees);
00878 }
00880 void defineBondTorsion_KA
00881 (int class1, int class2, int class3, int class4,
00882 int periodicity1, Real amp1InKcal, Real phase1InDegrees,
00883 int periodicity2, Real amp2InKcal, Real phase2InDegrees)
00884 {
00885 defineBondTorsion_KA
00886 ((DuMM::AtomClassIndex)class1, (DuMM::AtomClassIndex)class2, (DuMM::AtomClassIndex)class3, (DuMM::AtomClassIndex)class4,
00887 periodicity1, amp1InKcal, phase1InDegrees,
00888 periodicity2, amp2InKcal, phase2InDegrees);
00889 }
00891 void defineBondTorsion_KA
00892 (int class1, int class2, int class3, int class4,
00893 int periodicity1, Real amp1InKcal, Real phase1InDegrees,
00894 int periodicity2, Real amp2InKcal, Real phase2InDegrees,
00895 int periodicity3, Real amp3InKcal, Real phase3InDegrees)
00896 {
00897 defineBondTorsion_KA
00898 ((DuMM::AtomClassIndex)class1, (DuMM::AtomClassIndex)class2, (DuMM::AtomClassIndex)class3, (DuMM::AtomClassIndex)class4,
00899 periodicity1, amp1InKcal, phase1InDegrees,
00900 periodicity2, amp2InKcal, phase2InDegrees,
00901 periodicity3, amp3InKcal, phase3InDegrees);
00902 }
00903
00904
00920 void defineCustomBondTorsion(DuMM::AtomClassIndex class1,
00921 DuMM::AtomClassIndex class2,
00922 DuMM::AtomClassIndex class3,
00923 DuMM::AtomClassIndex class4,
00924 DuMM::CustomBondTorsion* bondTorsionTerm);
00925
00927
00935
00936 void defineAmberImproperTorsion
00937 (DuMM::AtomClassIndex class1, DuMM::AtomClassIndex class2, DuMM::AtomClassIndex class3, DuMM::AtomClassIndex class4,
00938 int periodicity, Real ampInKJ, Real phaseInDegrees);
00940 void defineAmberImproperTorsion
00941 (DuMM::AtomClassIndex class1, DuMM::AtomClassIndex class2, DuMM::AtomClassIndex class3, DuMM::AtomClassIndex class4,
00942 int periodicity1, Real amp1InKJ, Real phase1InDegrees,
00943 int periodicity2, Real amp2InKJ, Real phase2InDegrees);
00945 void defineAmberImproperTorsion
00946 (DuMM::AtomClassIndex class1, DuMM::AtomClassIndex class2, DuMM::AtomClassIndex class3, DuMM::AtomClassIndex class4,
00947 int periodicity1, Real amp1InKJ, Real phase1InDegrees,
00948 int periodicity2, Real amp2InKJ, Real phase2InDegrees,
00949 int periodicity3, Real amp3InKJ, Real phase3InDegrees);
00950
00952 void defineAmberImproperTorsion_KA
00953 (DuMM::AtomClassIndex class1, DuMM::AtomClassIndex class2, DuMM::AtomClassIndex class3, DuMM::AtomClassIndex class4,
00954 int periodicity1, Real amp1InKcal, Real phase1InDegrees)
00955 {
00956 defineAmberImproperTorsion(class1,class2,class3,class4,
00957 periodicity1, amp1InKcal * DuMM::Kcal2KJ, phase1InDegrees);
00958 }
00960 void defineAmberImproperTorsion_KA
00961 (DuMM::AtomClassIndex class1, DuMM::AtomClassIndex class2, DuMM::AtomClassIndex class3, DuMM::AtomClassIndex class4,
00962 int periodicity1, Real amp1InKcal, Real phase1InDegrees,
00963 int periodicity2, Real amp2InKcal, Real phase2InDegrees)
00964 {
00965 defineAmberImproperTorsion(class1,class2,class3,class4,
00966 periodicity1, amp1InKcal * DuMM::Kcal2KJ, phase1InDegrees,
00967 periodicity2, amp2InKcal * DuMM::Kcal2KJ, phase2InDegrees);
00968 }
00970 void defineAmberImproperTorsion_KA
00971 (DuMM::AtomClassIndex class1, DuMM::AtomClassIndex class2, DuMM::AtomClassIndex class3, DuMM::AtomClassIndex class4,
00972 int periodicity1, Real amp1InKcal, Real phase1InDegrees,
00973 int periodicity2, Real amp2InKcal, Real phase2InDegrees,
00974 int periodicity3, Real amp3InKcal, Real phase3InDegrees)
00975 {
00976 defineAmberImproperTorsion(class1,class2,class3,class4,
00977 periodicity1, amp1InKcal * DuMM::Kcal2KJ, phase1InDegrees,
00978 periodicity2, amp2InKcal * DuMM::Kcal2KJ, phase2InDegrees,
00979 periodicity3, amp3InKcal * DuMM::Kcal2KJ, phase3InDegrees);
00980 }
00982
00983
00989 void setSolventDielectric(Real);
00990 void setSoluteDielectric(Real);
00991 Real getSolventDielectric() const;
00992 Real getSoluteDielectric() const;
00993
00994 void setGbsaIncludeAceApproximation(bool);
00995 void setGbsaIncludeAceApproximationOn() {setGbsaIncludeAceApproximation(true );}
00996 void setGbsaIncludeAceApproximationOff() {setGbsaIncludeAceApproximation(false);}
00998
01008 void setVdwGlobalScaleFactor(Real);
01009 void setCoulombGlobalScaleFactor(Real);
01010 void setGbsaGlobalScaleFactor(Real);
01011 void setBondStretchGlobalScaleFactor(Real);
01012 void setBondBendGlobalScaleFactor(Real);
01013 void setBondTorsionGlobalScaleFactor(Real);
01014 void setAmberImproperTorsionGlobalScaleFactor(Real);
01015 void setCustomBondStretchGlobalScaleFactor(Real);
01016 void setCustomBondBendGlobalScaleFactor(Real);
01017 void setCustomBondTorsionGlobalScaleFactor(Real);
01018
01019 Real getVdwGlobalScaleFactor() const;
01020 Real getCoulombGlobalScaleFactor() const;
01021 Real getGbsaGlobalScaleFactor() const;
01022 Real getBondStretchGlobalScaleFactor() const;
01023 Real getBondBendGlobalScaleFactor() const;
01024 Real getBondTorsionGlobalScaleFactor() const;
01025 Real getAmberImproperTorsionGlobalScaleFactor() const;
01026 Real getCustomBondStretchGlobalScaleFactor() const;
01027 Real getCustomBondBendGlobalScaleFactor() const;
01028 Real getCustomBondTorsionGlobalScaleFactor() const;
01029
01033 void setAllGlobalScaleFactors(Real s) {
01034 setVdwGlobalScaleFactor(s);
01035 setCoulombGlobalScaleFactor(s);
01036 setGbsaGlobalScaleFactor(s);
01037 setBondStretchGlobalScaleFactor(s);
01038 setBondBendGlobalScaleFactor(s);
01039 setBondTorsionGlobalScaleFactor(s);
01040 setAmberImproperTorsionGlobalScaleFactor(s);
01041 setCustomBondStretchGlobalScaleFactor(s);
01042 setCustomBondBendGlobalScaleFactor(s);
01043 setCustomBondTorsionGlobalScaleFactor(s);
01044 }
01046
01052
01054 void setUseMultithreadedComputation(bool);
01056 bool getUseMultithreadedComputation() const;
01057
01065 void setUseOpenMMAcceleration(bool);
01067 bool getUseOpenMMAcceleration() const;
01068
01071 void setTraceOpenMM(bool);
01072
01077 void setAllowOpenMMReference(bool);
01079 bool getAllowOpenMMReference() const;
01080
01082 bool isUsingOpenMM() const;
01085 std::string getOpenMMPlatformInUse() const;
01086
01088
01094
01096 long long getForceEvaluationCount() const;
01097
01100 void dump() const;
01101
01103 void dumpCForceFieldParameters(std::ostream& os, const String& methodName = "loadParameters") const;
01104
01106 void loadTestMoleculeParameters();
01107
01109 int getNAtoms() const {return getNumAtoms();}
01111 int getNBonds() const {return getNumBonds();}
01112
01114
01115 protected:
01116 SimTK_PIMPL_DOWNCAST(DuMMForceFieldSubsystem, ForceSubsystem);
01117 SimTK_PIMPL_DOWNCAST(DuMMForceFieldSubsystem, Subsystem);
01118
01119 void defineIncompleteAtomClass(
01120 DuMM::AtomClassIndex classIx,
01121 const char* name,
01122 int elementNumber,
01123 int valence);
01124
01125 void defineIncompleteAtomClass_KA(
01126 DuMM::AtomClassIndex classIx,
01127 const char* name,
01128 int elementNumber,
01129 int valence)
01130 {
01131 defineIncompleteAtomClass(
01132 classIx,
01133 name,
01134 elementNumber,
01135 valence
01136 );
01137 }
01138
01139 void setAtomClassVdwParameters(DuMM::AtomClassIndex atomClassIx, Real vdwRadiusInNm, Real vdwWellDepthInKJPerMol);
01140 void setAtomClassVdwParameters_KA(DuMM::AtomClassIndex atomClassIx, Real radiusInAng, Real wellDepthInKcal) {
01141 setAtomClassVdwParameters(atomClassIx, radiusInAng*DuMM::Ang2Nm, wellDepthInKcal*DuMM::Kcal2KJ);
01142 }
01143
01144 bool isValidAtomClass(DuMM::AtomClassIndex) const;
01145
01146 void defineIncompleteChargedAtomType(
01147 DuMM::ChargedAtomTypeIndex typeIx,
01148 const char* name,
01149 DuMM::AtomClassIndex classIx);
01150
01151 void defineIncompleteChargedAtomType_KA(
01152 DuMM::ChargedAtomTypeIndex typeIx,
01153 const char* name,
01154 DuMM::AtomClassIndex classIx)
01155 {
01156 defineIncompleteChargedAtomType(typeIx, name, classIx);
01157 }
01158
01159 void setChargedAtomTypeCharge(DuMM::ChargedAtomTypeIndex, Real charge);
01160 void setChargedAtomTypeCharge_KA(DuMM::ChargedAtomTypeIndex chargedAtomTypeIx, Real charge) {
01161 setChargedAtomTypeCharge(chargedAtomTypeIx, charge);
01162 }
01163
01164 private:
01165 class DuMMForceFieldSubsystemRep& updRep();
01166 const DuMMForceFieldSubsystemRep& getRep() const;
01167
01168 friend class MolecularMechanicsSystem;
01169 };
01170
01175 class Amber99ForceSubsystem : public DuMMForceFieldSubsystem {
01176 public:
01177 explicit Amber99ForceSubsystem(MolecularMechanicsSystem& system)
01178 : DuMMForceFieldSubsystem(system)
01179 {
01180 loadAmber99Parameters();
01181 }
01182 };
01183
01184
01185 }
01186
01187
01189
01190 #endif // SimTK_MOLMODEL_DUMM_FORCE_FIELD_SUBSYSTEM_H_