1 /* 2 * (c) 2004 Iowa State University 3 * see the LICENSE file in the top level directory 4 */ 5 6 /*������������������������������������������������ 7 InputData.h 8 9 Class definitions for the various input 10 group classes. 11 12 Brett Bode - 6-96 13 Converted all InputFileData calls to BufferFile calls 14 and removed definitions of InputFileData - 8-97 15 ������������������������������������������������*/ 16 17 #ifndef __INPUTDATA__ 18 #define __INPUTDATA__ 19 20 #ifndef __BFILE__ 21 #include "BFiles.h" 22 #endif 23 #ifndef __MyTypes__ 24 #include "MyTypes.h" 25 #endif 26 27 #define kConRunMenu 1 28 #define kConSCFMenu 2 29 #define kConMP2Check 4 30 #define kConSCFIterEdit 5 31 #define kConExeTypeMenu 7 32 #define kConLocalMenu 8 33 #define kConChargeEdit 10 34 #define kConMultEdit 12 35 #define kConCIPopup 13 36 #define kConGray1 14 37 #define kConGray2 15 38 #define kConGray3 16 39 #define kConDFTRadio 17 40 #define kConCCPopup 18 41 #define kConGray4 19 42 43 #define kGuessGuessMenu 2 44 #define kGuessPrintGuess 3 45 #define kGuessNOrbText 4 46 #define kGuessNumOrbs 5 47 #define kGuessRotateOrbs 6 48 #define kGuessOrbSetPopup 7 49 //#define kGuessEigenVecsRadio 7 50 //#define kGuessNatOrbRadio 8 51 //#define kGuessLMORadio 9 52 //#define kGuessHandRadio 10 53 //#define kGuessGray 11 54 //#define kGuessVecText 12 55 56 #define kHessAnalyticRadio 2 57 #define kHessNumericRadio 3 58 #define kHessMethodGray 4 59 #define kHess2DiffCheck 6 60 #define kHessPurifyCheck 7 61 #define kHessPrintIntFCCheck 8 62 #define kHessVibAnalCheck 9 63 #define kHessDisplacementSize 10 64 #define kHessScaleEdit 11 65 66 #define kStPtnStepEdit 2 67 #define kStPtOptTolEdit 3 68 #define kStPtMethodCntrl 4 69 #define kStPtInitStepEdit 5 70 #define kStPtMinStepEdit 6 71 #define kStPtMaxStepEdit 7 72 #define kStPtJumpEdit 8 73 #define kStPtHessUpEdit 9 74 #define kStPtModeEdit 10 75 #define kStPtStatPtCheck 11 76 #define kStPtUpStepCheck 12 77 #define kStPtHessGuess 13 78 #define kStPtHessRead 14 79 #define kStPtHessCalc 15 80 #define kStPtPrintOrbs 16 81 #define kStPtGray 25 82 83 #define kDFTMethodPopup 1 84 #define kDFTGridFuncPopup 2 85 #define kDFTGridFreeFuncPopup 4 86 87 /** enum for the set of GAMESS run types. */ 88 enum TypeOfRun { 89 InvalidRunType=0, 90 Energy=1, 91 GradientRun=2, 92 HessianRun, 93 OptimizeRun=4, 94 TrudgeRun, 95 SadPointRun, 96 MinEnergyCrossing, 97 IRCRun, 98 MolDynamics, 99 GradExtrRun, 100 DRCRun, 101 SurfaceRun, 102 G3MP2, 103 PropRun, 104 MorokumaRun, 105 TransitnRun, 106 SpinOrbitRun, 107 FFieldRun, 108 TDHFRun, 109 TDHFXRun, 110 GLOBOPRun, 111 VSCFRun, 112 OptFMORun, 113 RamanRun, 114 NMRRun, 115 MakeEFPRun, 116 FreeStateFMORun, 117 118 NumGAMESSRunTypes 119 }; 120 121 enum GAMESS_SCFType { 122 GAMESS_Invalid_SCFType=-1, 123 GAMESSDefaultSCFType=0, 124 GAMESS_RHF, 125 GAMESS_UHF, 126 GAMESS_ROHF, 127 GAMESS_GVB, 128 GAMESS_MCSCF, 129 GAMESS_NO_SCF, 130 131 NumGAMESSSCFTypes 132 }; 133 134 enum CCRunType { 135 CC_None=0, 136 CC_LCCD, 137 CC_CCD, 138 CC_CCSD, 139 CC_CCSDT, 140 CC_RCC, 141 CC_CRCC, 142 CC_CRCCL, 143 CC_CCSDTQ, 144 CC_CRCCQ, 145 CC_EOMCCSD, 146 CC_CREOM, 147 CC_CREOML, 148 CC_IP_EOM2, 149 CC_IP_EOM3A, 150 CC_EA_EOM2, 151 CC_EA_EOM3A, 152 153 NumCCTypes 154 }; 155 156 enum CIRunType { 157 CI_None=0, 158 CI_GUGA, 159 CI_ALDET, 160 CI_ORMAS, 161 CI_CIS, 162 CI_FSOCI, 163 CI_GENCI, 164 165 NumCITypes 166 }; 167 168 typedef class InputData InputData; 169 170 enum FriendType { 171 Friend_invalid=-1, 172 Friend_None=0, 173 Friend_HONDO, 174 Friend_MELDF, 175 Friend_GAMESSUK, 176 Friend_GAUSSIAN, 177 Friend_ALL, 178 179 NumFriendTypes 180 }; 181 182 enum GAMESS_Localization { 183 Invalid_Localization=-1, 184 GAMESS_No_Localization=0, 185 GAMESS_BOYS_Localization, 186 GAMESS_RUEDNBRG_Localization, 187 GAMESS_POP_Localization, 188 GAMESS_SVD_Localization, 189 190 NumGAMESSLocalizations 191 }; 192 193 class ControlGroup { 194 private: 195 char *ExeType; 196 GAMESS_SCFType SCFType; 197 short MPLevelCIType; //first 4 bits = MP level, 2nd 4 bits CI Type 198 TypeOfRun RunType; 199 short MaxIt; 200 short Charge; 201 short Multiplicity; 202 GAMESS_Localization Local; 203 FriendType Friend; 204 short NPrint; 205 short ITol; 206 short ICut; 207 CCRunType CCType; 208 char Options; //1 bit for several options 209 //bit 1 MolPlot; 210 //bit 2 PlotOrb; 211 //bit 3 AIMPAC; 212 //bit 4 RPAC; 213 //bit 5 DFT active; 214 //bit 6 Spherical Harmonic flag; 215 //bit 7 NormF; 216 //bit 8 NormP; 217 public: //Public data access functions 218 GAMESS_SCFType SetSCFType(GAMESS_SCFType NewSCFType); 219 GAMESS_SCFType SetSCFType(const char *SCFText); GetSCFTypeText(void)220 const char * GetSCFTypeText(void) const {return GAMESSSCFTypeToText(SCFType);}; 221 static const char * GAMESSSCFTypeToText(GAMESS_SCFType t); GetSCFType(void)222 inline GAMESS_SCFType GetSCFType(void) const {return SCFType;}; 223 long SetMPLevel(short NewMPLevel); 224 short GetMPLevel(void) const; 225 CIRunType GetCIType(void) const; 226 CIRunType GetCIType(char * outText) const; 227 const char * GetCIType(const CIRunType &) const; 228 CIRunType SetCIType(CIRunType NewVal); 229 CIRunType SetCIType(const char * CIText); 230 TypeOfRun SetRunType(const TypeOfRun & NewRunType); 231 TypeOfRun SetRunType(const char *RunText); 232 /** Routine to convert the TypeOfRun enum into a char string containing 233 the standard GAMESS Run type. 234 @param r The TypeOfRun identifier 235 */ 236 static const char * GetGAMESSRunText(const TypeOfRun & r); GetRunType(void)237 inline TypeOfRun GetRunType(void) const {return RunType;}; 238 short GetExeType(void); 239 short GetExeType(Str255 ExeText); 240 short SetExeType(const char *ExeText); 241 short SetExeType(short NewType); 242 short SetMaxIt(short NumIt); GetMaxIt(void)243 inline short GetMaxIt(void) {return MaxIt;}; 244 short SetCharge(short charge); GetCharge(void)245 inline short GetCharge(void) {return Charge;}; 246 short SetMultiplicity(short NewMult); GetMultiplicity(void)247 inline short GetMultiplicity(void) {return Multiplicity;}; 248 GAMESS_Localization SetLocal(const char *LocalText); 249 GAMESS_Localization SetLocal(GAMESS_Localization NewLocal); GetLocal(void)250 inline GAMESS_Localization GetLocal(void) const {return Local;}; 251 static const char * GAMESSLocalizationToText(GAMESS_Localization t); GetLocalText(void)252 const char * GetLocalText(void) const {return GAMESSLocalizationToText(Local);}; 253 FriendType SetFriend(const char *FriendText); 254 FriendType SetFriend(FriendType NewFriend); 255 static const char * GetFriendText(FriendType f); 256 static FriendType TextToFriend(const char * c); GetFriend(void)257 inline FriendType GetFriend(void) const {return Friend;}; GetFriendText(void)258 inline const char * GetFriendText(void) const {return GetFriendText(Friend);}; 259 bool SetMolPlot(bool State); GetMolPlot(void)260 inline bool GetMolPlot(void) const {return ((Options & 1)?true:false);}; 261 bool SetPlotOrb(bool State); GetPlotOrb(void)262 inline bool GetPlotOrb(void) const {return ((Options & (1<<1))?true:false);}; 263 bool SetAIMPAC(bool State); GetAIMPAC(void)264 inline bool GetAIMPAC(void) const {return ((Options & (1<<2))?true:false);}; 265 bool SetRPAC(bool State); GetRPAC(void)266 inline bool GetRPAC(void) const {return ((Options & (1<<3))?true:false);}; 267 bool UseDFT(bool state); 268 bool UseDFT(void) const; 269 bool UseSphericalHarmonics(bool State); UseSphericalHarmonics(void)270 inline bool UseSphericalHarmonics(void) const {return ((Options & (1<<5))?true:false);}; 271 bool SetNormF(bool State); GetNormF(void)272 inline bool GetNormF(void) const {return ((Options & (1<<6))?true:false);}; 273 bool SetNormP(bool State); GetNormP(void)274 inline bool GetNormP(void) const {return ((Options & (1<<7))?true:false);}; 275 CCRunType GetCCType(void) const; 276 static const char * GetGAMESSCCType(const CCRunType & ); 277 CCRunType SetCCType(CCRunType n); 278 CCRunType SetCCType(const char * n); 279 //other member functions 280 ControlGroup(void); 281 ControlGroup(ControlGroup *Copy); 282 ~ControlGroup(void); 283 void InitControlPaneData(void); 284 void InitProgPaneData(void); 285 void WriteToFile(BufferFile *File, InputData *IData, long NumElectrons); 286 void RevertControlPane(ControlGroup *OrgData); 287 void RevertProgPane(ControlGroup *OrgData); 288 void WriteXML(XMLElement * parent) const; 289 void ReadXML(XMLElement * parent); 290 }; 291 292 enum MemoryUnit { 293 wordsUnit=1, 294 bytesUnit, 295 megaWordsUnit, 296 megaBytesUnit, 297 gigaWordsUnit, 298 gigaBytesUnit, 299 300 NumberMemoryUnits 301 }; 302 const char * MemoryUnitToText(const MemoryUnit & mu); 303 bool TextToMemoryUnit(const char * t, MemoryUnit & mu); 304 305 enum TimeUnit { 306 secondUnit=1, 307 minuteUnit, 308 hourUnit, 309 dayUnit, 310 weekUnit, 311 yearUnit, 312 milleniaUnit, 313 314 NumberTimeUnits 315 }; 316 const char * TimeUnitToText(const TimeUnit & tu); 317 bool TextToTimeUnit(const char * t, TimeUnit & tu); 318 319 class SystemGroup { 320 private: 321 long TimeLimit; //This is always stored as minutes 322 double Memory; //Always stored as words 323 double MemDDI; //stored as megawords 324 char KDiag; 325 TimeUnit TimeUnits; 326 MemoryUnit MemUnits; 327 MemoryUnit MemDDIUnits; 328 char Flags; //One bit flags 329 //bit 1 CoreFlag; 330 //bit 2 BalanceType; set to true for LOOP 331 //bit 3 XDR; 332 //bit 4 PARALL; 333 public: GetTimeLimit(void)334 inline long GetTimeLimit(void) const {return TimeLimit;}; 335 long SetTimeLimit(long NewTime); GetTimeUnits(void)336 inline TimeUnit GetTimeUnits(void) const {return TimeUnits;}; 337 TimeUnit SetTimeUnits(TimeUnit NewUnits); 338 float GetConvertedTime(void) const; 339 long SetConvertedTime(float NewTime); GetMemory(void)340 inline double GetMemory(void) const {return Memory;}; 341 double SetMemory(double NewMemory); GetMemUnits(void)342 inline MemoryUnit GetMemUnits(void) const {return MemUnits;}; 343 MemoryUnit SetMemUnits(MemoryUnit NewUnits); 344 double GetConvertedMem(void) const; 345 double SetConvertedMem(double NewMem); GetMemDDIUnits(void)346 inline MemoryUnit GetMemDDIUnits(void) const {return MemDDIUnits;}; GetMemDDI(void)347 inline double GetMemDDI(void) const {return MemDDI;}; 348 double SetMemDDI(double NewMemDDI); 349 double GetConvertedMemDDI(void) const; 350 double SetConvertedMemDDI(double NewMem); 351 MemoryUnit SetMemDDIUnits(MemoryUnit NewUnits); GetDiag(void)352 inline char GetDiag(void) const {return KDiag;}; 353 char SetDiag(char NewMethod); GetCoreFlag(void)354 bool GetCoreFlag(void) const {return ((Flags & 1)?true:false);}; 355 bool SetCoreFlag(bool State); GetBalanceType(void)356 bool GetBalanceType(void) const {return ((Flags & 2)?true:false);}; 357 bool SetBalanceType(bool Type); GetXDR(void)358 bool GetXDR(void) const {return ((Flags & 4)?true:false);}; 359 bool SetXDR(bool State); GetParallel(void)360 inline bool GetParallel(void) const {return ((Flags & 8)?true:false);}; 361 bool SetParallel(bool State); 362 //other member functions 363 SystemGroup(void); 364 SystemGroup(SystemGroup *Copy); 365 void InitData(void); 366 void WriteToFile(BufferFile *File); 367 void WriteXML(XMLElement * parent) const; 368 void ReadXML(XMLElement * parent); 369 void ReadSystemOptions(BufferFile * Buffer); 370 }; 371 enum GAMESS_BasisSet { 372 GAMESS_BS_None=0, 373 GAMESS_BS_MINI, 374 GAMESS_BS_MIDI, 375 GAMESS_BS_STO, 376 GAMESS_BS_N21, 377 GAMESS_BS_N31, 378 GAMESS_BS_N311, 379 GAMESS_BS_DZV, 380 GAMESS_BS_DH, 381 GAMESS_BS_TZV, 382 GAMESS_BS_MC, 383 384 GAMESS_BS_CC_PVDZ, GAMESS_BS_CC_PVTZ, GAMESS_BS_CC_PVQZ, GAMESS_BS_CC_PV5Z, GAMESS_BS_CC_PV6Z, 385 GAMESS_BS_AUG_CC_PVDZ, GAMESS_BS_AUG_CC_PVTZ, GAMESS_BS_AUG_CC_PVQZ, GAMESS_BS_AUG_CC_PV5Z, GAMESS_BS_AUG_CC_PV6Z, 386 GAMESS_BS_CC_PCVDZ, GAMESS_BS_CC_PCVTZ, GAMESS_BS_CC_PCVQZ, GAMESS_BS_CC_PCV5Z, GAMESS_BS_CC_PCV6Z, 387 GAMESS_BS_AUG_CC_PCVDZ, GAMESS_BS_AUG_CC_PCVTZ, GAMESS_BS_AUG_CC_PCVQZ, GAMESS_BS_AUG_CC_PCV5Z, GAMESS_BS_AUG_CC_PCV6Z, 388 GAMESS_BS_PC0, GAMESS_BS_PC1, GAMESS_BS_PC2, GAMESS_BS_PC3, GAMESS_BS_PC4, 389 GAMESS_BS_APC0, GAMESS_BS_APC1, GAMESS_BS_APC2, GAMESS_BS_APC3, GAMESS_BS_APC4, 390 GAMESS_BW_SPK_DZP, GAMESS_BW_SPK_TZP, GAMESS_BW_SPK_QZP, GAMESS_BW_SPK_ADZP, GAMESS_BW_SPK_ATZP, GAMESS_BW_SPK_AQZP, 391 GAMESS_BW_SPKRDZP, GAMESS_BW_SPKRTZP, GAMESS_BW_SPKRQZP, GAMESS_BW_SPKRADZP, GAMESS_BW_SPKRATZP, GAMESS_BW_SPKRAQZP, 392 GAMESS_BW_KTZV, 393 GAMESS_BW_KTZVP, 394 GAMESS_BW_KTZVPP, 395 396 GAMESS_BS_SBKJC, 397 GAMESS_BS_HW, 398 399 GAMESS_BS_MCP_DZP, GAMESS_BS_MCP_TZP, GAMESS_BS_MCP_QZP, 400 GAMESS_BS_MCP_ATZP, GAMESS_BS_MCP_AQZP, 401 GAMESS_BS_MCPCDZP, GAMESS_BS_MCPCTZP, GAMESS_BS_MCPCQZP, 402 GAMESS_BS_MCPACDZP, GAMESS_BS_MCPACTZP, GAMESS_BS_MCPACQZP, 403 GAMESS_BS_IMCP_SR1, GAMESS_BS_IMCP_SR2, 404 GAMESS_BS_IMCP_NR1, GAMESS_BS_IMCP_NR2, 405 GAMESS_BS_ZFK3_DK3, GAMESS_BS_ZFK4_DK3, GAMESS_BS_ZFK5_DK3, 406 GAMESS_BS_ZFK3LDK3, GAMESS_BS_ZFK4LDK3, GAMESS_BS_ZFK5LDK3, 407 408 GAMESS_BS_MNDO, 409 GAMESS_BS_AM1, 410 GAMESS_BS_PM3, 411 GAMESS_BS_RM1, 412 413 GAMESS_BS_BC, //Old basis name - appears to be rolled into DZ basis today 414 NumGAMESSBasisSetsItem 415 }; 416 enum GAMESS_BS_Polarization { 417 GAMESS_BS_Pople_Polar=-2, //old one, should not be output 418 GAMESS_BS_Invalid_Polar=-1, 419 GAMESS_BS_No_Polarization=0, 420 GAMESS_BS_Common_Polar, 421 GAMESS_BS_PopN31_Polar, 422 GAMESS_BS_PopN311_Polar, 423 GAMESS_BS_Dunning_Polar, 424 GAMESS_BS_Huzinaga_Polar, 425 GAMESS_BS_Hondo7_Polar, 426 427 NumGAMESSBSPolarItems 428 }; 429 enum GAMESS_BS_ECPotential { 430 GAMESS_BS_Invalid_ECP=-1, 431 GAMESS_BS_ECP_None=0, 432 GAMESS_BS_ECP_Read, 433 GAMESS_BS_ECP_SBKJC, 434 GAMESS_BS_ECP_HW, 435 GAMESS_BS_ECP_MCP, 436 437 NumGAMESSBSECPItems 438 }; 439 class BasisGroup { 440 private: 441 float Split2[2]; 442 float Split3[3]; 443 short Basis; 444 short NumGauss; 445 short NumHeavyFuncs; //8 bits for #D funcs, 8 bits for # f funcs 446 short NumPFuncs; 447 GAMESS_BS_Polarization Polar; 448 short ECPPotential; //Potential type for ECP calculations (in $CONTRL) 449 char Flags; //boolean type options 450 //bit 1 DiffuseSP; 451 //bit 2 DiffuseS; 452 //bit 3 disables builtin basis types based on current atom set 453 public: //Member functions 454 short SetBasis(const char *text); 455 short SetBasis(short NewBasis); 456 const char * GetBasisText(void) const; 457 short GetBasis(void) const; 458 static const char * GAMESSBasisSetToText(GAMESS_BasisSet bs); 459 short SetNumGauss(short NewNumGauss); 460 short GetNumGauss(void) const; 461 short SetNumDFuncs(short NewNum); 462 short GetNumDFuncs(void) const; 463 short SetNumFFuncs(short NewNum); 464 short GetNumFFuncs(void) const; 465 short SetNumPFuncs(short NewNum); 466 short GetNumPFuncs(void) const; 467 short SetDiffuseSP(bool state); GetDiffuseSP(void)468 bool GetDiffuseSP(void) const {return ((Flags&1)?true:false);}; 469 short SetDiffuseS(bool state); GetDiffuseS(void)470 bool GetDiffuseS(void) const {return ((Flags&2)?true:false);}; 471 GAMESS_BS_Polarization SetPolar(GAMESS_BS_Polarization NewPolar); 472 GAMESS_BS_Polarization SetPolar(const char *text); 473 static const char * PolarToText(GAMESS_BS_Polarization p); GetPolarText(void)474 inline const char * GetPolarText(void) const {return PolarToText(Polar);}; GetPolar(void)475 inline GAMESS_BS_Polarization GetPolar(void) const {return Polar;}; 476 static const char * GAMESSECPToText(GAMESS_BS_ECPotential p); 477 short GetECPPotential(void) const; 478 const char * GetECPPotentialText(void) const; 479 GAMESS_BS_ECPotential SetECPPotential(const char * ECPText); 480 short SetECPPotential(short NewType); CheckBasis(void)481 inline bool CheckBasis(void) const {return ((Flags & 4)?true:false);}; CheckBasis(bool state)482 inline void CheckBasis(bool state) {Flags = (Flags& 0xFB) + (state?4:0);}; 483 //other member functions 484 BasisGroup(void); 485 BasisGroup(BasisGroup *Copy); 486 void InitData(void); 487 long WriteToFile(BufferFile *File, MoleculeData * lData); 488 void WriteXML(XMLElement * parent) const; 489 void ReadXML(XMLElement * parent); 490 }; 491 492 enum CoordinateType { 493 invalidCoordinateType=0, 494 UniqueCoordType, 495 HINTCoordType, 496 CartesianCoordType, 497 ZMTCoordType, 498 ZMTMPCCoordType, 499 500 NumberCoordinateTypes 501 }; 502 class DataGroup { 503 private: 504 char *Title; 505 short Coord; 506 short NumZVar; 507 char PointGroup; 508 char PGroupOrder; 509 char Options; 510 //bit 1 units 511 //bit 2 NoSym 512 public: //data access functions 513 short SetPointGroup(GAMESSPointGroup NewPGroup); 514 short SetPointGroup(char *GroupText); 515 static const char * GetGAMESSPointGroupText(GAMESSPointGroup p); GetPointGroupText(void)516 const char * GetPointGroupText(void) const {return GetGAMESSPointGroupText((GAMESSPointGroup) PointGroup);}; GetPointGroup(void)517 inline GAMESSPointGroup GetPointGroup(void) const {return (GAMESSPointGroup)PointGroup;}; 518 short SetPointGroupOrder(short NewOrder); GetPointGroupOrder(void)519 inline short GetPointGroupOrder(void) const {return PGroupOrder;}; 520 short SetTitle(const char *NewTitle, long length=-1); 521 const char * GetTitle(void) const; 522 CoordinateType GetCoordType(void) const; 523 static const char * GetCoordTypeText(CoordinateType t); GetCoordText(void)524 const char * GetCoordText(void) const {return GetCoordTypeText((CoordinateType) Coord);}; 525 CoordinateType SetCoordType(const char *CoordText); 526 CoordinateType SetCoordType(CoordinateType NewType); GetUnits(void)527 bool GetUnits(void) const {return ((Options&1)?true:false);}; 528 /** Set the units for the coordinates (true for bohr, false for angstrom). 529 * @param unitFlag Flag to indicate units 530 */ 531 bool SetUnits(bool unitFlag); 532 /** Set the units for the coordinates (bohr or angs (angstroms)). 533 * The return value is 0 for angstroms, 1 for bohr, -1 indicates invalid text. 534 * @param unitText A null-terminated string to parse. 535 */ 536 int SetUnits(const char * unitText); 537 bool SetUseSym(bool State); GetUseSym(void)538 bool GetUseSym(void) const {return ((Options&2)?true:false);}; GetNumZVar(void)539 short GetNumZVar(void) const {return NumZVar;}; 540 short SetNumZVar(short NewNum); 541 //other member functions 542 DataGroup(void); 543 DataGroup(DataGroup *Copy); 544 ~DataGroup(void); 545 void InitData(void); 546 void WriteToFile(BufferFile *File, MoleculeData * MainData, WinPrefs * Prefs, long BasisTest); 547 void WriteXML(XMLElement * parent) const; 548 void ReadXML(XMLElement * parent); 549 }; 550 typedef enum EFRAG_PolMethods { 551 invalidPolMethod=0, 552 FRGSCF_PolMethod, 553 SCF_PolMethod, 554 555 NumEFragPolMethods 556 } EFRAG_PolMethods; 557 typedef enum EFRAG_PositionTypes { 558 invalidEFragPositionType=0, 559 Optimize_Position, 560 Fixed_Position, 561 EFOPT_Position, 562 563 NumEFragPositionTypes 564 } EFRAG_PositionTypes; 565 566 /// EffectiveFragmentsGroup stores the options for the EFRAG group, but not the actual fragments 567 class EffectiveFragmentsGroup { 568 private: 569 long MaxBasisFuncs; ///< MXBF - max number of basis functions in any of the EFP2 potentials 570 long MaxMOs; ///< MXMO - Max number of MOs in any EFP2's PROJECTION section 571 long NumBufferMOs; ///< NBUFFMO - First n orbs in the MO matrix belong to the QM/MM buffer - see $MOFRZ 572 char flags; ///< Set of bits to handle the 3 text fields 573 // bit 1 is 0 for Cartesian coordinates, 1 for internal coordinates 574 public: 575 /** Constructor. Sets normal default values. 576 */ EffectiveFragmentsGroup(void)577 EffectiveFragmentsGroup(void) {flags=0; MaxBasisFuncs = MaxMOs = NumBufferMOs = -1;}; 578 /** = operator to copy one instance to another. 579 */ 580 const EffectiveFragmentsGroup & operator=(const EffectiveFragmentsGroup & other) {flags=other.flags; MaxBasisFuncs=other.MaxBasisFuncs; MaxMOs=other.MaxMOs; NumBufferMOs=other.NumBufferMOs; return *this;}; UseCartesianCoordinates(void)581 bool UseCartesianCoordinates(void) const {return !(flags & 1);}; UseCartesianCoordinates(bool v)582 void UseCartesianCoordinates(bool v) {flags = (flags & 0xFE) + (v ? 1 : 0);}; UseInternalCoordinates(void)583 bool UseInternalCoordinates(void) const {return (flags & 1);}; UseInternalCoordinates(bool v)584 void UseInternalCoordinates(bool v) {flags = (flags & 0xFE) + (v ? 0 : 1);}; 585 /** Set the coordinates type from the text string. 586 * @param v The string containing a valid COORD= value (CART or INT). 587 */ 588 bool SetCoordinatesType(const char * v); GetGAMESSCoordText(void)589 const char * GetGAMESSCoordText(void) const {return ConvertCoordToText(UseInternalCoordinates()?1:0);}; 590 static const char * ConvertCoordToText(int v); 591 static const char * ConvertPolMethodToText(EFRAG_PolMethods v); 592 static const char * ConvertPositionMethodToText(EFRAG_PositionTypes v); 593 bool SetPolMethod(const char * v); PolMethodIsDefault(void)594 bool PolMethodIsDefault(void) const {return ((flags & 2)?false:true);}; PolMethodIsDefault(bool v)595 void PolMethodIsDefault(bool v) {flags = (flags & 0xFD) + (v ? 2 : 0);}; PolMethod(void)596 EFRAG_PolMethods PolMethod(void) const {return ((flags & 4)?SCF_PolMethod:FRGSCF_PolMethod);}; PolMethod(EFRAG_PolMethods v)597 void PolMethod(EFRAG_PolMethods v) {flags = (flags & 0xFB) + ((v==SCF_PolMethod) ? 4 : 0); PolMethodIsDefault(false);}; PositionIsDefault(void)598 bool PositionIsDefault(void) const {return ((flags & 8)?false:true);}; PositionIsDefault(bool v)599 void PositionIsDefault(bool v) {flags = (flags & 0xF7) + (v ? 8 : 0);}; 600 bool SetPositionType(const char * v); PositionMethod(void)601 EFRAG_PositionTypes PositionMethod(void) const {return (EFRAG_PositionTypes)(((flags & 48)>>4)+1);}; PositionMethod(EFRAG_PositionTypes v)602 void PositionMethod(EFRAG_PositionTypes v) {flags = (flags & 0xCF) + (((char)v-1)<<4);PositionIsDefault(false);}; GetMaxMOs(void)603 long GetMaxMOs(void) const {return MaxMOs;}; SetMaxMOs(long v)604 void SetMaxMOs(long v) {MaxMOs = v;}; GetNumBufferMOs(void)605 long GetNumBufferMOs(void) const {return NumBufferMOs;}; SetNumBufferMOs(long v)606 void SetNumBufferMOs(long v) {NumBufferMOs = v;}; GetMaxBasisFunctions(void)607 long GetMaxBasisFunctions(void) const {return MaxBasisFuncs;}; SetMaxBasisFunctions(long v)608 void SetMaxBasisFunctions(long v) {MaxBasisFuncs = v;}; 609 void WriteXML(XMLElement * parent) const; 610 void ReadXML(XMLElement * parent); 611 }; 612 613 typedef enum TypeOfGuess { 614 invalidGuessType=0, 615 HUCKELGuessType=1, 616 HCOREGuessType, 617 MOREADGuessType, 618 MOSAVEDGuessType, 619 SkipGuessType, 620 621 NumberGuessTypes 622 } TypeOfGuess; 623 class GuessGroup { 624 private: 625 float MOTolZ; 626 float MOTolEquil; 627 long *IOrder; 628 long *JOrder; 629 long NumOrbs; 630 short VecSource; 631 short GuessType; 632 char Options; 633 //bit 1 Print initial guess PRTMO 634 //bit 2 reordering switch 635 //bit 3 orbital mixing switch 636 public: //data access functions GetGuess(void)637 inline short GetGuess(void) const {return GuessType;}; 638 const char * GetGuessText(void) const; 639 short SetGuess(const char *GuessText); SetGuess(short NewGuess)640 inline short SetGuess(short NewGuess) {if ((NewGuess<0)||(NewGuess>=NumberGuessTypes)) return -1; GuessType = NewGuess; return GetGuess();}; GetVecSource(void)641 inline short GetVecSource(void) const {return VecSource;}; SetVecSource(short NewVal)642 inline void SetVecSource(short NewVal) {if (NewVal>0) VecSource = NewVal;}; GetNumOrbs(void)643 inline long GetNumOrbs(void) const {return NumOrbs;}; SetNumOrbs(long NewNum)644 inline long SetNumOrbs(long NewNum) {if (NewNum >= 0) NumOrbs = NewNum; return NumOrbs;}; GetPrintMO(void)645 inline bool GetPrintMO(void) const {return (Options & 1);}; SetPrintMO(bool State)646 inline void SetPrintMO(bool State) {Options = (Options & 0xFE) + (State ? 1 : 0);}; GetNOrder(void)647 inline bool GetNOrder(void) const {return ((Options & 2)?true:false);}; SetNOrder(bool State)648 inline void SetNOrder(bool State) {Options = (Options & 0xFD) + (State ? 2 : 0);}; GetMix(void)649 inline bool GetMix(void) const {return ((Options & 4)?true:false);}; SetMix(bool State)650 inline void SetMix(bool State) {Options = (Options & 0xFB) + (State ? 4 : 0);}; 651 static const char * ConvertGuessType(const int & type); 652 //other member functions 653 GuessGroup(void); 654 GuessGroup(GuessGroup *Copy); 655 // ~GuessGroup(void); //not needed until iorder and jorder are used 656 void InitData(void); 657 void WriteToFile(BufferFile *File, InputData *IData, MoleculeData * orbdata); 658 void WriteVecGroup(BufferFile *File, MoleculeData * lData); 659 void WriteXML(XMLElement * parent) const; 660 void ReadXML(XMLElement * parent); 661 }; 662 class SCFGroup { 663 private: 664 float SOGTolerance; //SOSCF threshold 665 float EnErrThresh; //DIIS error threshold 666 float DEMCutoff; //DEM limit 667 float DampCutoff; //Damping limit 668 long GVBNumCoreOrbs; ///< GVB NCO - Number Core Orbitals 669 long GVBNumOpenShells; ///< GVB NSETO - Number of open shells 670 long GVBNumPairs; ///< GVP NPAIR - Number of overlapping orbital pairs 671 std::vector<long> GVBOpenShellDeg; ///< GVB NO - Array of shell degeneracies (NSETO shells) 672 std::vector<long> NPREOVector; ///< NPREO orbital/energy printout options 673 short ConvCriteria; //Convergance cutoff 10^(-n) 674 short MaxDIISEq; //Max size of the DIIS linear equations 675 short MVOCharge; //Modified Virtual Orbital Charge 676 char Punch; //Orbital printout flags 677 char Options1; //Main option flags 678 //bit 1 Direct SCF 679 //bit 2 Fock matrix diff 680 //bit 3 UHF natural orbitals 681 char ConverganceFlags; //flags for each converger 682 // 1 extrapolation 683 // 2 damping 684 // 3 level shifting 685 // 4 restriction 686 // 5 DIIS 687 // 6 Second order SCF 688 // 7 direct energy min. 689 public: //member functions GetDirectSCF(void)690 bool GetDirectSCF(void) const {return ((Options1 & 1)?true:false);}; 691 bool SetDirectSCF(bool State); GetFockDiff(void)692 bool GetFockDiff(void) const {return ((Options1 & 2)?true:false);}; 693 bool SetFockDiff(bool State); GetUHFNO(void)694 bool GetUHFNO(void) const {return ((Options1 & 4)?true:false);}; 695 bool SetUHFNO(bool State); GetExtrapolation(void)696 bool GetExtrapolation(void) const {return ((ConverganceFlags & 1)?true:false);}; SetExtrapolation(bool State)697 void SetExtrapolation(bool State) {ConverganceFlags = (ConverganceFlags & 0xFE) + (State ? 1 : 0);}; GetDamp(void)698 bool GetDamp(void) const {return ((ConverganceFlags & 2)?true:false);}; SetDamp(bool State)699 void SetDamp(bool State) {ConverganceFlags = (ConverganceFlags & 0xFD) + (State ? 2 : 0);}; GetShift(void)700 bool GetShift(void) const {return ((ConverganceFlags & 4)?true:false);}; SetShift(bool State)701 void SetShift(bool State) {ConverganceFlags = (ConverganceFlags & 0xFB) + (State ? 4 : 0);}; GetRestriction(void)702 bool GetRestriction(void) const {return ((ConverganceFlags & 8)?true:false);}; SetRestriction(bool State)703 void SetRestriction(bool State) {ConverganceFlags = (ConverganceFlags & 0xF7) + (State ? 8 : 0);}; GetDIIS(void)704 bool GetDIIS(void) const {return ((ConverganceFlags & 16)?true:false);}; SetDIIS(bool State)705 void SetDIIS(bool State) {ConverganceFlags = (ConverganceFlags & 0xEF) + (State ? 16 : 0);}; GetSOSCF(void)706 bool GetSOSCF(void) const {return ((ConverganceFlags & 32)?true:false);}; SetSOSCF(bool State)707 void SetSOSCF(bool State) {ConverganceFlags = (ConverganceFlags & 0xDF) + (State ? 32 : 0);}; GetDEM(void)708 bool GetDEM(void) const {return ((ConverganceFlags & 64)?true:false);}; SetDEM(bool State)709 void SetDEM(bool State) {ConverganceFlags = (ConverganceFlags & 0xBF) + (State ? 64 : 0);}; GetConvergance(void)710 short GetConvergance(void) const {return ConvCriteria;}; 711 short SetConvergance(short NewConv); GetGVBNumCoreOrbs(void)712 long GetGVBNumCoreOrbs(void) const {return GVBNumCoreOrbs;}; SetGVBNumCoreOrbs(const long & nco)713 void SetGVBNumCoreOrbs(const long & nco) {GVBNumCoreOrbs = nco;}; GetGVBNumOpenShells(void)714 long GetGVBNumOpenShells(void) const {return GVBNumOpenShells;}; 715 void SetGVBNumOpenShells(const long & no); GetGVBNumPairs(void)716 long GetGVBNumPairs(void) const {return GVBNumPairs;}; SetGVBNumPairs(const long & npairs)717 void SetGVBNumPairs(const long & npairs) {GVBNumPairs = npairs;}; GetGVBOpenShellDeg(void)718 std::vector<long> & GetGVBOpenShellDeg(void) {return GVBOpenShellDeg;}; ClearGVBOpenShellDeg(void)719 void ClearGVBOpenShellDeg(void) {GVBOpenShellDeg.clear();}; 720 void SetGVBNODegValue(int index, long value); AddGVBOpenShellDeg(const long & d)721 void AddGVBOpenShellDeg(const long & d) {GVBOpenShellDeg.push_back(d);}; GetGVBOpenShellDeg(const long & d)722 long GetGVBOpenShellDeg(const long & d) {return ((d<GVBOpenShellDeg.size())?GVBOpenShellDeg[d]:0);}; 723 /// ClearNPREOArry zeros out the array ClearNPREOArray(void)724 void ClearNPREOArray(void) {NPREOVector.clear();}; 725 /// Add a value to the end of the NPREO array AddNPREOValue(const long & d)726 void AddNPREOValue(const long & d) {NPREOVector.push_back(d);}; 727 SCFGroup(void); 728 SCFGroup(SCFGroup *Copy); 729 void InitData(void); 730 //no destructor for now 731 void WriteToFile(BufferFile *File, InputData *IData); 732 void WriteXML(XMLElement * parent) const; 733 void ReadXML(XMLElement * parent); 734 }; 735 class MP2Group { 736 private: 737 double CutOff; //double needed to hold very small cutoffs 738 long NumCoreElectrons; 739 long Memory; 740 char Method; 741 char AOInts; 742 char LMOMP2; 743 bool MP2Prop; 744 public: 745 MP2Group(void); 746 MP2Group(MP2Group *Copy); 747 void InitData(void); 748 GetIntCutoff(void)749 inline double GetIntCutoff(void) const {return CutOff;}; 750 double SetIntCutoff(double NewCutOff); GetNumCoreElectrons(void)751 inline long GetNumCoreElectrons(void) const {return NumCoreElectrons;}; 752 long SetNumCoreElectrons(long NewNum); GetMemory(void)753 inline long GetMemory(void) const {return Memory;}; 754 long SetMemory(long NewMem); GetMethod(void)755 inline char GetMethod(void) const {return Method;}; 756 char SetMethod(char NewMethod); GetAOIntMethod(void)757 inline char GetAOIntMethod(void) const {return AOInts;}; 758 const char * GetAOIntMethodText(void) const; 759 char SetAOIntMethod(char NewMethod); 760 void SetAOIntMethod(const char * t); 761 bool GetLMOMP2(void) const; 762 bool SetLMOMP2(bool State); GetMP2Prop(void)763 bool GetMP2Prop(void) const {return MP2Prop;}; SetMP2Prop(bool state)764 void SetMP2Prop(bool state) {MP2Prop = state;}; 765 766 void WriteToFile(BufferFile *File, InputData *IData); 767 void WriteXML(XMLElement * parent) const; 768 void ReadXML(XMLElement * parent); 769 }; 770 class HessianGroup { 771 private: 772 float DisplacementSize; 773 float FrequencyScaleFactor; 774 long BitOptions; //Bit 1: method 775 //Bit 2: double difference 776 //Bit 3: purify 777 //Bit 4: print internal FC's 778 //Bit 5: vibrational analysis 779 public: HessianGroup(void)780 HessianGroup(void) {InitData();}; HessianGroup(HessianGroup * Copy)781 HessianGroup(HessianGroup *Copy) {*this = *Copy;}; 782 void InitData(void); 783 GetDisplacementSize(void)784 inline float GetDisplacementSize(void) const {return DisplacementSize;}; SetDisplacementSize(float NewVal)785 inline float SetDisplacementSize(float NewVal) {if (NewVal > 0.0) DisplacementSize = NewVal; return DisplacementSize;}; GetFreqScale(void)786 inline float GetFreqScale(void) const {return FrequencyScaleFactor;}; SetFreqScale(float NewVal)787 inline float SetFreqScale(float NewVal) {if (NewVal > 0.0) FrequencyScaleFactor = NewVal; return FrequencyScaleFactor;}; GetAnalyticMethod(void)788 inline bool GetAnalyticMethod(void) const {return (BitOptions & 1);}; SetAnalyticMethod(bool NewVal)789 inline void SetAnalyticMethod(bool NewVal) {if (BitOptions & 1) BitOptions--; if (NewVal) {BitOptions++; if (BitOptions & 32) BitOptions -= 32;}}; GetDoubleDiff(void)790 inline bool GetDoubleDiff(void) const {return ((BitOptions & 2)?true:false);}; SetDoubleDiff(bool NewVal)791 inline void SetDoubleDiff(bool NewVal) {if (BitOptions & 2) BitOptions-=2; if (NewVal) BitOptions += 2;}; GetPurify(void)792 inline bool GetPurify(void) const {return ((BitOptions & 4)?true:false);}; SetPurify(bool NewVal)793 inline void SetPurify(bool NewVal) {if (BitOptions & 4) BitOptions -= 4; if (NewVal) BitOptions += 4;}; GetPrintFC(void)794 inline bool GetPrintFC(void) const {return ((BitOptions & 8)?true:false);}; SetPrintFC(bool NewVal)795 inline void SetPrintFC(bool NewVal) {if (BitOptions & 8) BitOptions -= 8; if (NewVal) BitOptions += 8;}; GetVibAnalysis(void)796 inline bool GetVibAnalysis(void) const {return ((BitOptions & 16)?true:false);}; SetVibAnalysis(bool NewVal)797 inline void SetVibAnalysis(bool NewVal) {if (BitOptions & 16) BitOptions -= 16; if (NewVal) BitOptions += 16;}; 798 799 /** 800 * Analyze the provided set of input parameters to determine if the run will involve the 801 * computation of a hessian, thus making this group needed. 802 * @param IData Pointer to the set of input data to analyze. 803 */ 804 static bool IsHessianGroupNeeded(const InputData * IData); 805 /** 806 * Analyze the provided set of input parameters to determine if GAMESS can compute 807 * the 2nd derivative of the energy analytically. 808 * @param IData Pointer to the set of input data to analyze. 809 */ 810 static bool IsAnalyticHessianPossible(const InputData * IData); 811 812 void WriteToFile(BufferFile *File, InputData *IData); 813 void WriteXML(XMLElement * parent) const; 814 void ReadXML(XMLElement * parent); 815 }; 816 enum DFTFunctionalsGrid { 817 invalidDFTGrid=0, 818 DFT_Grid_Slater, 819 DFT_Grid_Becke, 820 DFT_Grid_GILL, 821 DFT_Grid_OPTX, 822 DFT_Grid_PW91X, 823 DFT_Grid_PBEX, 824 DFT_Grid_VWN, 825 DFT_Grid_VWN1, 826 DFT_Grid_PZ81, 827 DFT_Grid_P86, 828 DFT_Grid_LYP, 829 DFT_Grid_PW91C, 830 DFT_Grid_PBEC, 831 DFT_Grid_OP, 832 DFT_Grid_SVWN, 833 DFT_Grid_BLYP, 834 DFT_Grid_BOP, 835 DFT_Grid_BP86, 836 DFT_Grid_GVWN, 837 DFT_Grid_GPW91, 838 DFT_Grid_PBEVWN, 839 DFT_Grid_PBEOP, 840 DFT_Grid_OLYP, 841 DFT_Grid_PW91, 842 DFT_Grid_PBE, 843 DFT_Grid_revPBE, 844 DFT_Grid_RPBE, 845 DFT_Grid_PBEsol, 846 DFT_Grid_EDF1, 847 DFT_Grid_HCTH93, 848 DFT_Grid_HCTH120, 849 DFT_Grid_HCTH147, 850 DFT_Grid_HCTH407, 851 DFT_Grid_SOGGA, 852 DFT_Grid_MOHLYP, 853 DFT_Grid_B97_D, 854 DFT_Grid_BHHLYP, 855 DFT_Grid_B3PW91, 856 DFT_Grid_B3LYP, 857 DFT_Grid_B3LYP1, 858 DFT_Grid_B97, 859 DFT_Grid_B97_1, 860 DFT_Grid_B97_2, 861 DFT_Grid_B97_3, 862 DFT_Grid_B97_K, 863 DFT_Grid_B98, 864 DFT_Grid_PBE0, 865 DFT_Grid_X3LYP, 866 DFT_Grid_CAMB3LYP, 867 DFT_Grid_wB97, 868 DFT_Grid_wB97X, 869 DFT_Grid_wB97X_D, 870 DFT_Grid_B2PLYP, 871 DFT_Grid_xB97X_2, 872 DFT_Grid_xB97X_2L, 873 DFT_Grid_VS98, 874 DFT_Grid_PKZB, 875 DFT_Grid_tHCTH, 876 DFT_Grid_tHCTHhyb, 877 DFT_Grid_BMK, 878 DFT_Grid_TPSS, 879 DFT_Grid_TPSSh, 880 DFT_Grid_TPSSm, 881 DFT_Grid_revTPSS, 882 DFT_Grid_M05, 883 DFT_Grid_M05_2X, 884 DFT_Grid_M06, 885 DFT_Grid_M06_L, 886 DFT_Grid_M06_2X, 887 DFT_Grid_M06_HF, 888 DFT_Grid_M08_HX, 889 DFT_Grid_M08_SO, 890 891 NumberGRIDDFTFuncs 892 }; 893 enum DFTFunctionalsGridFree { 894 invalidDFTGridFreeType=0, 895 DFT_GridFree_XALPHA, 896 DFT_GridFree_Slater, 897 DFT_GridFree_Becke, 898 DFT_GridFree_Depristo, 899 DFT_GridFree_CAMA, 900 DFT_GridFree_HALF, 901 DFT_GridFree_VWN, 902 DFT_GridFree_PWLOC, 903 DFT_GridFree_LYP, 904 DFT_GridFree_BVWN, 905 DFT_GridFree_BLYP, 906 DFT_GridFree_BPWLOC, 907 DFT_GridFree_B3LYP, 908 DFT_GridFree_CAMB, 909 DFT_GridFree_XVWN, 910 DFT_GridFree_XPWLOC, 911 DFT_GridFree_SVWN, 912 DFT_GridFree_SPWLOC, 913 DFT_GridFree_WIGNER, 914 DFT_GridFree_WS, 915 DFT_GridFree_WIGEXP, 916 917 NumberDFTGridFreeFuncs 918 }; 919 class DFTGroup { 920 private: 921 float GridSwitch; 922 float Threshold; 923 short Functional; 924 // short NumRadialGrids; 925 // short NumThetaGrids; 926 // short NumPhiGrids; 927 // short NumRadialGridsInit; 928 // short NumThetaGridsInit; 929 // short NumPhiGridsInit; 930 char BitFlags; 931 public: DFTGroup(void)932 DFTGroup(void) {InitData();}; DFTGroup(DFTGroup * Copy)933 DFTGroup(DFTGroup *Copy) {*this = *Copy;}; 934 const DFTGroup & operator=(const DFTGroup & other) { 935 BitFlags=other.BitFlags; 936 GridSwitch=other.GridSwitch; Threshold=other.Threshold; Functional=other.Functional; 937 // NumRadialGrids=other.NumRadialGrids; NumThetaGrids=other.NumThetaGrids; 938 // NumPhiGrids=other.NumPhiGrids; NumRadialGridsInit=other.NumRadialGridsInit; 939 // NumThetaGridsInit=other.NumThetaGridsInit; NumPhiGridsInit=other.NumPhiGridsInit; 940 return *this;}; 941 void InitData(void); 942 MethodGrid(void)943 bool MethodGrid(void) const {return ((BitFlags & 1) != 0);}; SetMethodGrid(bool state)944 void SetMethodGrid(bool state) {BitFlags = (BitFlags & 0xE) + (state ? 1 : 0);}; GetAuxFunctions(void)945 bool GetAuxFunctions(void) const {return ((BitFlags & 2) != 0);}; SetAuxFunctions(bool state)946 void SetAuxFunctions(bool state) {BitFlags = (BitFlags & 0xD) + (state ? 2 : 0);}; GetThree(void)947 bool GetThree(void) const {return ((BitFlags & 4) != 0);}; SetThree(bool state)948 void SetThree(bool state) {BitFlags = (BitFlags & 0xB) + (state ? 4 : 0);}; GetFunctional(void)949 inline short GetFunctional(void) const {return Functional;}; 950 const char * GetFunctionalText(void) const; 951 short SetFunctional(short newvalue); 952 /** 953 * Set the functional based on a text string containing a valid GAMESS DFTTYP. 954 * @param GAMESS_DFT_Type char * with a valid GAMESS DFTTYP string. 955 */ 956 short SetFunctional(const char * GAMESS_DFT_Type); 957 static const char * GetDFTGridFuncText(DFTFunctionalsGrid d); 958 static const char * GetDFTGridFreeFuncText(DFTFunctionalsGridFree d); 959 960 void WriteToFile(BufferFile *File, InputData *IData); 961 void WriteXML(XMLElement * parent) const; 962 void ReadXML(XMLElement * parent); 963 }; 964 enum OptMethod { 965 invalidOptMethodType=0, 966 StatPt_OptMethod_NR, 967 StatPt_OptMethod_RFO, 968 StatPt_OptMethod_QA, 969 StatPt_OptMethod_Schlegel, 970 StatPt_OptMethod_ConOpt, 971 972 NumberStatPtOptMethods 973 }; 974 enum HessUpdateMethod { 975 invalidHessUpdateMethodType=0, 976 StatPt_HessUpdateMethod_Guess, 977 StatPt_HessUpdateMethod_Read, 978 StatPt_HessUpdateMethod_Calc, 979 980 NumberStatPtHessUpdateMethods 981 }; 982 /** 983 * Stationary Point related options. Container for options related to searching for a 984 * minima or transition state (OPTIMIZE or SADPOINT). 985 */ 986 class StatPtGroup { 987 private: 988 float OptConvergance; 989 float InitTrustRadius; 990 float MaxTrustRadius; 991 float MinTrustRadius; 992 float StatJumpSize; 993 long ModeFollow; 994 /** 995 * bitfield for a group of true/false flags. The bits include: 996 * 1: radius update; 2: Stat. Pt.; 3-5 Hess method; 6: print orbs every iter. 997 * 7: Hessian at stationary point 998 */ 999 long BitOptions; 1000 short method; 1001 short MaxSteps; 1002 short nRecalcHess; 1003 public: StatPtGroup(void)1004 StatPtGroup(void) {InitData();}; StatPtGroup(StatPtGroup * Copy)1005 StatPtGroup(StatPtGroup *Copy) {*this = *Copy;}; 1006 void InitData(void); 1007 GetOptConvergance(void)1008 inline float GetOptConvergance(void) const {return OptConvergance;}; SetOptConvergance(float NewVal)1009 inline void SetOptConvergance(float NewVal) {if (NewVal>0.0) OptConvergance = NewVal;}; GetInitRadius(void)1010 inline float GetInitRadius(void) const {return InitTrustRadius;}; SetInitRadius(float NewVal)1011 inline void SetInitRadius(float NewVal) {if (NewVal>0.0) InitTrustRadius = NewVal;}; GetMaxRadius(void)1012 inline float GetMaxRadius(void) const {return MaxTrustRadius;}; SetMaxRadius(float NewVal)1013 inline void SetMaxRadius(float NewVal) {if (NewVal>0.0) MaxTrustRadius = NewVal;}; GetMinRadius(void)1014 inline float GetMinRadius(void) const {return MinTrustRadius;}; SetMinRadius(float NewVal)1015 inline void SetMinRadius(float NewVal) {if (NewVal>0.0) MinTrustRadius = NewVal;}; GetStatJump(void)1016 inline float GetStatJump(void) const {return StatJumpSize;}; SetStatJump(float NewVal)1017 inline void SetStatJump(float NewVal) {if (NewVal>0.0) StatJumpSize = NewVal;}; GetModeFollow(void)1018 inline long GetModeFollow(void) const {return ModeFollow;}; SetModeFollow(long NewVal)1019 inline void SetModeFollow(long NewVal) {if (NewVal>0) ModeFollow = 1;}; 1020 static const char * GetMethodText(OptMethod d); GetMethod(void)1021 inline short GetMethod(void) const {return method;}; SetMethod(short NewVal)1022 inline void SetMethod(short NewVal) {if ((NewVal>0)&&(NewVal<=NumberStatPtOptMethods)) method = NewVal;}; 1023 bool SetMethod(const char * text); GetMaxSteps(void)1024 inline short GetMaxSteps(void) const {return MaxSteps;}; SetMaxSteps(short NewVal)1025 inline void SetMaxSteps(short NewVal) {if (NewVal>0) MaxSteps = NewVal;}; GetHessRecalcInterval(void)1026 inline short GetHessRecalcInterval(void) const {return nRecalcHess;}; SetHessRecalcInterval(short NewVal)1027 inline void SetHessRecalcInterval(short NewVal) {if (NewVal>=0) nRecalcHess = NewVal;}; GetRadiusUpdate(void)1028 inline bool GetRadiusUpdate(void) const {return (BitOptions & 1);}; SetRadiusUpdate(bool NewVal)1029 inline void SetRadiusUpdate(bool NewVal) {BitOptions = (BitOptions & 0xFE) + (NewVal ? 1 : 0);}; GetStatPoint(void)1030 inline bool GetStatPoint(void) const {return ((BitOptions & 2) != 0);}; SetStatPoint(bool NewVal)1031 inline void SetStatPoint(bool NewVal) {BitOptions = (BitOptions & 0xFD) + (NewVal ? 2 : 0);}; GetHessMethod(void)1032 inline short GetHessMethod(void) const {return ((BitOptions & 28) >> 2);}; SetHessMethod(short NewVal)1033 inline void SetHessMethod(short NewVal) {if ((NewVal>=1)&&(NewVal<=3)) BitOptions = (BitOptions & 0xE3) + (NewVal << 2);}; 1034 bool SetHessMethod(const char * text); 1035 static const char * GetHessUpdateMethodText(HessUpdateMethod d); AlwaysPrintOrbs(void)1036 inline bool AlwaysPrintOrbs(void) const {return ((BitOptions & 32) != 0);}; SetAlwaysPrintOrbs(bool NewVal)1037 inline void SetAlwaysPrintOrbs(bool NewVal) {BitOptions = (BitOptions & 0xDF) + (NewVal ? 32 : 0);}; 1038 /** 1039 * Indicates whether a hessian will be computed on the final optimized structure. 1040 */ GetHessEndFlag(void)1041 inline bool GetHessEndFlag(void) const {return ((BitOptions & 64) != 0);}; 1042 /** 1043 * Set the value of the flag to compute a hessian on the optimized structure. 1044 * @param newValue bool value indicating whether to compute or not. 1045 */ SetHessFlag(bool newValue)1046 inline void SetHessFlag(bool newValue) {BitOptions = (BitOptions & 0xBF) + (newValue ? 64 : 0);}; 1047 1048 /** 1049 * Output the group options in GAMESS input format. 1050 * @param File The output buffer. 1051 * @param IData Pointer to the main input data class. 1052 */ 1053 void WriteToFile(BufferFile *File, InputData *IData); 1054 /** 1055 Output the group to CML suitable for reading by the ReadXML routine. 1056 @param parent the parent XML tag to append this group to 1057 */ 1058 void WriteXML(XMLElement * parent) const; 1059 /** 1060 Load this groups non-default settings from CML. 1061 @param parent the parent XML tag to append this group from 1062 */ 1063 void ReadXML(XMLElement * parent); 1064 }; 1065 1066 /** 1067 * Fragment Molecular Orbital primary option group. 1068 * There are a few basic options, but many of the options are arrays based either on the 1069 * number of fragments or the number of atoms. 1070 */ 1071 class FMOGroup { 1072 private: 1073 long NumberFragments; ///< the number of fragments in which to divide up the system 1074 bool Active; ///< Flag to turn FMO off or on 1075 bool OutputStyle; ///< Flag indicating how the INDAT array will be written 1076 public: FMOGroup(void)1077 FMOGroup(void) {InitData();}; 1078 const FMOGroup & operator=(const FMOGroup & other) {Active=other.Active; NumberFragments=other.NumberFragments; return *this;}; InitData(void)1079 void InitData(void) {Active=false; NumberFragments=1; OutputStyle=false;}; 1080 IsFMOActive(void)1081 inline bool IsFMOActive(void) const {return Active;}; FMOActive(bool newState)1082 void FMOActive(bool newState) {Active = newState;}; GetNumberFragments(void)1083 inline long GetNumberFragments(void) const {return NumberFragments;}; SetNumberFragments(const long & num)1084 void SetNumberFragments(const long & num) {NumberFragments = num;}; 1085 /** If true output INDAT as the atom list for each fragment, else atom ordered list */ UseFragmentINDAT(void)1086 inline bool UseFragmentINDAT(void) const {return OutputStyle;}; UseFragmentINDAT(bool choice)1087 void UseFragmentINDAT(bool choice) {OutputStyle = choice;}; ///< Pass true for INDAT ordered by fragment 1088 1089 /** 1090 * Output the group options in GAMESS input format. 1091 * @param File The output buffer. 1092 * @param MainData Pointer to the main data class. 1093 */ 1094 void WriteToFile(BufferFile *File, MoleculeData * MainData); 1095 /** 1096 * Output the group to CML suitable for reading by the ReadXML routine. 1097 * @param parent the parent XML tag to append this group to 1098 * @param MainData Pointer to the main data class. 1099 */ 1100 void WriteXML(XMLElement * parent, MoleculeData * MainData) const; 1101 /** 1102 * Load this groups non-default settings from CML. 1103 * @param parent the parent XML tag to append this group from 1104 * @param MainData Pointer to the main data class. 1105 */ 1106 void ReadXML(XMLElement * parent, MoleculeData * MainData); 1107 1108 }; 1109 1110 class MolDisplayWin; 1111 1112 class InputData { 1113 public: 1114 ControlGroup *Control; 1115 SystemGroup *System; 1116 BasisGroup *Basis; 1117 DataGroup *Data; 1118 GuessGroup *Guess; 1119 SCFGroup *SCF; 1120 MP2Group *MP2; 1121 HessianGroup *Hessian; 1122 StatPtGroup *StatPt; 1123 DFTGroup DFT; 1124 EffectiveFragmentsGroup EFP; 1125 FMOGroup FMO; 1126 //member functions 1127 InputData(void); 1128 InputData(InputData *Copy); 1129 ~InputData(void); 1130 /** Output a GAMESS input file after prompting the user for the name of the output file. 1131 * The return value is negative for a user cancel, 0 for failure, positive for success. 1132 * @param lData The main molecule data record 1133 * @param owner The main document window 1134 */ 1135 long WriteInputFile(MoleculeData * lData, MolDisplayWin * owner); 1136 /** Output a GAMESS input file to a temporary file and open a window to allowing editing of that file. 1137 * The user can then save to a file name of their choice or discard. 1138 * The data in this window is independent of the originating document when this call returns. 1139 * The return value is negative for a user cancel, 0 for failure, positive for success. 1140 * @param lData The main molecule data record 1141 * @param owner The main document window 1142 */ 1143 long WriteEditInputFile(MoleculeData * lData, MolDisplayWin * owner); 1144 1145 //! Write out an input file for another program (GAMESS etc) 1146 long WriteInputFile(const wxString &filePath, MoleculeData * lData, MolDisplayWin * owner); 1147 void WriteXML(XMLElement * parent, MoleculeData * p) const; 1148 void ReadXML(XMLElement * parent, MoleculeData * p); 1149 }; 1150 1151 #endif 1152