MTK++ Latest version: 0.2.0

mmPotential.h
Go to the documentation of this file.
00001 
00035 #ifndef MMPOTENTIAL_H
00036 #define MMPOTENTIAL_H
00037 
00038 #include <iostream>
00039 #include <string>
00040 #include <vector>
00041 #include <algorithm>
00042 #include <fstream>
00043 
00044 #ifdef HAVE_ZLIB
00045 #include "zlib.h"
00046 #endif
00047 
00048 #include "Utils/constants.h"
00049 
00054 namespace MTKpp
00055 {
00056 // ============================================================
00057 // Class : mmPotential()
00058 // ------------------------------------------------------------
00096 // ============================================================
00097 class mmPotential
00098 {
00099 public:
00103     mmPotential();
00104 
00108     virtual ~mmPotential();
00109 
00113     void initialize();
00114 
00115 
00117 
00123     int setNumAtoms(int nAtoms);
00124 
00130     int setNumTypes(int n);
00131 
00137     int setNumResidues(int n);
00138 
00145     int setExcludedSize(int n, int n2);
00146 
00148 
00153     int getNumAtoms();
00154 
00159     char* getResidueNames();
00160 
00165     int* getResiduePointers();
00166 
00172     int setNumAtomsBigRes(int n);
00173 
00178     double* getCoords();
00179 
00184     double* getCharges();
00185 
00190     char* getSymbols();
00191 
00196     char* getAtomNames();
00197 
00202     int getNumTypes();
00203 
00208     int* getIntTypes();
00209 
00214     char* getCharTypes();
00215 
00220     int* getNumExcluded();
00221 
00226     int* getExcluded();
00227 
00232     int* getNumExcluded14();
00233 
00238     int* getExcluded14();
00239 
00244     int* getAtomFlags();
00245 
00250     double* getGradients();
00251 
00257     int setNumBonds(int nBonds);
00258 
00263     int getNumBonds();
00264 
00270     int setNumBondsWithH(int n);
00271 
00277     int setNumBondsWithOutH(int n);
00278 
00283     int* getBonds();
00284 
00289     double* getBondParams();
00290 
00296     int setNumUniqueBonds(int n);
00297 
00303     int setNumAngles(int nAngles);
00304 
00309     int getNumAngles();
00310 
00316     int setNumAnglesWithH(int n);
00317 
00323     int setNumAnglesWithOutH(int n);
00324 
00329     int* getAngles();
00330 
00335     double* getAngleParams();
00336 
00342     int setNumUniqueAngles(int n);
00343 
00349     int setNumTorsions(int nTorsions);
00350 
00355     int getNumTorsions();
00356 
00361     int* getTorsions();
00362 
00367     double* getTorsionParams();
00368 
00374     int setNumImpropers(int nImpropers);
00375 
00380     int getNumImpropers();
00381 
00386     int* getImpropers();
00387 
00392     double* getImproperParams();
00393 
00399     int setNumDihedralsWithH(int n);
00400 
00406     int setNumDihedralsWithOutH(int n);
00407 
00413     int setNumUniqueDihedrals(int n);
00414 
00420     int setNumNonBonded(int nNonBonded);
00421 
00426     int getNumNonBonded();
00427 
00432     int* getNonBonded();
00433 
00438     double* getNonBondedParams();
00439 
00444     int* getNonBondedPtrs();
00445 
00450     int* getNonBonded14Ptrs();
00451 
00456     double* getR6Params();
00457 
00462     double* getR12Params();
00463 
00468     int* getNonBondedParameterIndex();
00469 
00479     void setPotential(bool bBond, bool bAngle, bool bTorsion,
00480                       bool bImproper, bool bNonBonded, bool bHBond);
00481 
00491     void getPotential(bool& bBond, bool& bAngle, bool& bTorsion,
00492                       bool& bImproper, bool& bNonBonded, bool& bHBond);
00493 
00498     void calcForces(int i);
00499 
00503     void calcEnergy();
00504 
00515     void decomposeEnergy(bool bBond, bool bAngle, bool bTorsion,
00516                          bool bImproper, bool bNonBonded, bool bHBond,
00517                          std::string f);
00518 
00523     int* getOutputFlags();
00524 
00528     void printEnergy();
00529 
00534     void printEnergy(std::ostream& os);
00535 
00539     void printEnergy2();
00540 
00545     void printEnergy2(std::ostream& os);
00546 
00551     void printEnergy2(std::string s);
00552 
00558     void printEnergy2(std::string s, std::string s2);
00559 
00566     void printEnergy2(std::ostream& os, std::string s, std::string s2);
00567 
00571     void printCoords();
00572 
00577     virtual double calcBondEnergy();
00578 
00583     virtual double calcAngleEnergy();
00584 
00589     virtual double calcTorsionEnergy();
00590 
00595     virtual double calcImproperEnergy();
00596 
00601     virtual double calcNonBondedEnergy();
00602 
00607     virtual double calcHBondEnergy();
00608 
00613     double getTotalEnergy();
00614 
00619     double getBondEnergy();
00620 
00625     double getTotalVDWEnergy();
00626 
00631     double getTotalEleEnergy();
00632 
00636     void resetGMatrix();
00637 
00641     void setNonHGradsToZero();
00642 
00649     void getGradNorm(double& gMax, int& gMaxAtom, double& gNorm);
00650 
00651 protected: // DATA
00652 
00654     int nAtoms;
00655 
00657     int nDistinctTypes;
00658 
00660     int nBondsWithH;
00661 
00663     int nBondsWithOutH;
00664 
00666     int nAnglesWithH;
00667 
00669     int nAnglesWithOutH;
00670 
00672     int nDihedralsWithH;
00673 
00675     int nDihedralsWithOutH;
00676 
00681     int nExcluded;
00682 
00687     int nExcluded14;
00688 
00690     int nResidues;
00691 
00693     int nUniqueBonds;
00694 
00696     int nUniqueAngles;
00697 
00699     int nUniqueDihedrals;
00700 
00702     int nAtomsBigRes;
00703 
00705     double *xyz;
00706 
00708     char  *symbols;
00709 
00711     char  *names;
00712 
00714     int   *iTypes;
00715 
00717     char   *cTypes;
00718 
00720     double *charges;
00721 
00723     double *masses;
00724 
00726     double *gradients;
00727 
00729     int   *numExcluded;
00730 
00732     int   *numExcluded14;
00733 
00735     int   *atomFlags;
00736 
00738     int   *outFlags;
00739 
00741     int   *excluded;
00742 
00744     int   *excluded14;
00745 
00747     double *r12Params;
00748 
00750     double *r6Params;
00751 
00753     char *resNames;
00754 
00756     int *resPointers;
00757 
00759     int *nonBondedParameterIndex;
00760 
00762     int nBonds;
00763 
00765     int *bonds;
00766 
00768     double *bondParams;
00769 
00771     int nAngles;
00772 
00774     int *angles;
00775 
00777     double *angleParams;
00778 
00780     int nTorsions;
00781 
00783     int *torsions;
00784 
00786     double *torsionParams;
00787 
00789     int nImpropers;
00790 
00791     // Array of impropers
00792     int *impropers;
00793 
00795     double *improperParams;
00796 
00798     int nNonBonded;
00799 
00801     int *nonBonded;
00802 
00804     double *nonBondedParams;
00805 
00807     int *nonBondedPtrs;
00808 
00810     int nNonBonded14;
00811 
00813     int *nonBonded14;
00814 
00816     double *nonBonded14Params;
00817 
00819     int *nonBonded14Ptrs;
00820 
00821 protected: // DATA
00823     bool           bEnergy;
00824 
00826     bool           bGradient;
00827 
00829     bool           bBond;
00830 
00832     bool           bAngle;
00833 
00835     bool           bTorsion;
00836 
00838     bool           bImproper;
00839 
00841     bool           bNonBonded;
00842 
00844     bool           bHBond;
00845 
00847     bool           bBondDecompose;
00848 
00850     bool           bAngleDecompose;
00851 
00853     bool           bTorsionDecompose;
00854 
00856     bool           bImproperDecompose;
00857 
00859     bool           bNonBondedDecompose;
00860 
00862     bool           bHBondDecompose;
00863 
00865     std::string    pwdFile;
00866 
00868     std::ofstream  pwdFileStream;
00869 
00871     std::string    pwdGZFile;
00872 
00873 #ifdef HAVE_ZLIB
00874 
00875     gzFile         pwdGZFileStream;
00876 #endif
00877 
00878     double         totalEnergy;
00879 
00881     double         bondEnergy;
00882 
00884     double         angleEnergy;
00885 
00887     double         torsionEnergy;
00888 
00890     double         improperEnergy;
00891 
00893     double         vdWEnergy;
00894 
00896     double         vdW14Energy;
00897 
00899     double         R6;
00900 
00902     double         R12;
00903 
00905     double         eleEnergy;
00906 
00908     double         ele14Energy;
00909 
00911     double         nonBondedEnergy;
00912 
00914     double         hBondEnergy;
00915 };
00916 } // MTKpp namespace
00917 
00918 #endif // MMPOTENTIAL_H

Generated on Fri Dec 23 2011 09:28:50 for MTK++ by Doxygen 1.7.5.1