FreeEnergyParse.h

Go to the documentation of this file.
00001 
00007 // written by David Hurwitz, March to May 1998.
00008 
00009 #if !defined(PARSE_HPP)
00010   #define PARSE_HPP
00011 
00012 enum item_t  {kAtom, kResidue, kAtomName, kAtomNameList,
00013               kResidueRange, kStartGroup, kEndGroup, kUnknownItem};
00014 enum restr_t {kPosi,      kDist,      kAngle,      kDihe,
00015               kPosiBound, kDistBound, kAngleBound, kDiheBound,
00016               kPosiPMF,   kDistPMF,   kAnglePMF,   kDihePMF, kUnknownRestr};
00017 enum pmf_t   {kTask, kTime, kLambda, kLambdaT, kPrint, kNoPrint,
00018               kEquilTime, kAccumTime, kNumRepeats, kUnknownPmf};
00019 enum TimeUnits_t  {k_fs, k_ps, k_ns, kUnknownTime};
00020 
00021 // the "main" function for parsing
00022 void   ReadInput(char* Str, ARestraintManager& RMgr,
00023                             ALambdaManager& LMgr,
00024                             GlobalMasterFreeEnergy& CFE,
00025                             double dT);
00026 
00027 // get an initialized restraint that's read from the input String
00028 int    ReadRestraints(char* Str, ARestraintManager& RMgr,
00029                                  GlobalMasterFreeEnergy& CFE);
00030 ARestraint* GetRestraint(char* Str, int& NumChars, GlobalMasterFreeEnergy& CFE);
00031 
00032 // for reading pmf/mcti blocks
00033 int    ReadPmfBlock(char* Str, ALambdaControl& PmfBlock, double dT);
00034 int    ReadNextPmfSpec(char* Str, pmf_t& PmfSpec);
00035 int    ReadTaskType(char* Str, feptask_t& Task);
00036 int    ReadTimeUnits(char* Str, TimeUnits_t& Units, TimeUnits_t DefaultUnits);
00037 double GetTime(double Val, TimeUnits_t Units);
00038 
00039 // functions for parsing the config file
00040 void    CheckParentheses(const char* Str);
00041 void    ProblemParsing(const char* Message, const char* Str, Bool_t Terminate=kTrue);
00042 void    ToLower(char* Str);
00043 int     ReadWhite(const char* Str);
00044 int     ReadAlphaNum(const char* Str);
00045 int     ReadAlpha(const char* Str);
00046 int     ReadDigits(const char* Str);
00047 int     ReadParentheses(const char* Str);
00048 int     IsStartGroup(char* Str);
00049 int     IsEndGroup(char* Str);
00050 int     IsAtomName(char* Str);
00051 int     IsAtomNameList(char* Str);
00052 int     IsAtom(char* Str);
00053 int     IsAResidue(char* Str);
00054 int     IsResidue(char* Str);
00055 int     IsResidueRange(char* Str);
00056 int     ReadWord(const char* Str, const char* Word, Bool_t ErrMsg=kFalse);
00057 int     ReadChar(char* Str, char Char, Bool_t ErrMsg=kFalse);
00058 int     ReadAValue(char* Str, double& Value, Bool_t ErrMsg=kFalse);
00059 int     ReadBound(char* Str, Bound_t& Bound);
00060 item_t  ReadNextItem(char* Str, int& NumChars);
00061 restr_t ReadNextRestraintType(char* Str, int& NumChars);
00062 
00063 // functions for putting the specified atoms into Group's
00064 int  AddAtoms(AGroup& Group, char* Str, GlobalMasterFreeEnergy& CFE);
00065 void AddAtom(AGroup& Group, char* Atom, GlobalMasterFreeEnergy& CFE);
00066 void AddResidues(AGroup& Group, char* ResRange, GlobalMasterFreeEnergy& CFE);
00067 void AddAtomsInResidues(AGroup& Group, char* AtomNames, char* ResRange,
00068                         GlobalMasterFreeEnergy& CFE);
00069 
00070 // functions for helping with the above
00071 void AddAtom(AGroup& Group, char* ResRange, char* AtomName,
00072              GlobalMasterFreeEnergy& CFE);
00073 void GetResRange(char* ResRange, int& ResNum1, int& ResNum2);
00074 int  GetSegName(char* Str, char* SegName);
00075 int  GetResNum(char* Str, int& ResNum);
00076 int  GetAtomName(char* Str, char* AtomName);
00077 
00078 #endif

Generated on Tue Nov 21 01:17:13 2017 for NAMD by  doxygen 1.4.7