00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020 #ifndef QC_COMMON_H_
00021 #define QC_COMMON_H_
00022
00023
00024 #include <map>
00025 #include <iostream>
00026 #include <sstream>
00027 #include <string>
00028 #include <assert.h>
00029 #include <stdio.h>
00030 #include <math.h>
00031
00032 #include "QCMacro.hpp"
00033
00034 #ifdef __QC_CC_IRIX64__
00035 # define IOSTREAMH
00036 #endif
00037
00038
00039 #define PRECISION 20
00040
00041
00042
00043 #ifdef HAVE_CONFIG_H
00044 # include "config.h"
00045 #endif // HAVE_CONFIG_H
00046
00047
00048 using namespace std;
00049
00050
00056 typedef unsigned char uchar;
00057 typedef unsigned char QCUChar;
00058
00059
00065 typedef signed char schar;
00066 typedef signed char QCSChar;
00067
00068
00074 typedef signed short int ssint;
00075 typedef signed short int QCSSInt;
00076
00077
00083 typedef unsigned short int usint;
00084 typedef unsigned short int QCUSInt;
00085
00086
00090 typedef unsigned int QCUInt;
00091
00095 typedef double QCFloat;
00096
00097
00098
00102 static const QCFloat QCMTwentyFive = -25e0;
00103 static const QCFloat QC1024 = 1024e0;
00104 static const QCFloat QC_ZERO = 0e0;
00105 static const QCFloat QC_ONE = 1e0;
00106 static const QCFloat QC_TWO = 2e0;
00107 static const QCFloat QC_THREE = 3e0;
00108 static const QCFloat QC_FOUR = 4e0;
00109 static const QCFloat QC_HALF = QC_ONE/QC_TWO;
00110
00111
00112 static const QCFloat QC_Em6 = 1e-6;
00113 static const QCFloat QC_Em5 = 1e-5;
00114 static const QCFloat QC_EPS_ZERO= 1e-12;
00115
00116
00117
00118
00122 static const int QCCStrLen_16 = 16;
00123 static const int QCCStrLen_32 = 32;
00124 static const int QCCStrLen_64 = 64;
00125 static const int QCCStrLen_128 = 128;
00126 static const int QCCStrLen_256 = 256;
00127
00128 static const int QCPP_SUCCES = 0 ;
00129 static const int QCPP_FAILURE = 0 ;
00130
00131
00132
00136 static const string INPUT_SUFFIX (".qci");
00137 static const string OUTPUT_SUFFIX (".qco");
00138 static const string PATH_SEPARATOR ("/");
00139 static const string DOUBLE_DOT (":");
00140
00144 enum QCMainAlgorithm {
00145 QC_SCF = 0,
00146 QC_LEVEL_SHIFTING,
00147 QC_OPTIMAL_DAMPING,
00148 QC_DC_SCF,
00149 QC_DC_LEVEL_SHIFTING,
00150 QC_DC_OPTIMAL_DAMPING
00151 };
00152
00156 enum QCInitDensityMatrix {
00157 QC_DENSITY_DIAG = 0,
00158 QC_DENSITY_FROM_FILE
00159 };
00163 enum QCGeometryAlgorithm {
00164 QC_LBFGS = 0,
00165 QC_BFGS
00166 };
00167
00168
00169
00173 enum QCDerivShiftBhvr {
00174 QC_CONSTANT = 0,
00175 QC_COMPUTED
00176 };
00177
00178
00179
00183 enum QCIntgAcquisitionMethod {
00184 QC_DIRECT_COMPUTATION = 0,
00185 QC_INDIRECT_STORAGE
00186 };
00187
00188
00189
00193 enum QCDerivationType {
00194 QC_NUMERICAL_DERIVATION = 0,
00195 QC_ANALYTICAL_DERIVATION
00196 };
00197
00198
00199
00203 enum QCDiagoAlgorithm {
00204 QC_CLASSIC_DIAGO = 0,
00205 QC_DC_DIAGO
00206 };
00207
00208
00209
00213 enum QCModelType {
00214 QC_MNDO_MODEL = 0,
00215 QC_AM1_MODEL,
00216 QC_PM3_MODEL
00217 };
00218
00219
00220
00224 enum QCParameterType {
00225 QC_MNDO_PARAM = 0,
00226 QC_AM1_PARAM,
00227 QC_PM3_PARAM
00228 };
00229
00230
00231
00235 enum QCComputation {
00236 QC_ENERGY = 0,
00237 QC_ENERGY_DERIV,
00238 QC_TOOLS
00239 };
00240
00241
00242
00246 const int NB_ZONES = 3;
00250 enum QCSubDomainZone {
00251 QC_CORE = 0,
00252 QC_SHELL1,
00253 QC_SHELL2
00254 };
00255
00256
00260 enum QCPartitionType {
00261 QC_STANDARD_PART = 0,
00262 QC_DIXON_PART
00263 };
00264
00265
00266
00267
00271 enum QCPartitionerType {
00272 QC_LINEAR = 0,
00273 QC_KIMIKA
00274 };
00275
00278
00282
00283 struct QCAtomIn {
00284 int numDomain ;
00285 int localNum ;
00286 QCSubDomainZone typeZone ;
00287 } ;
00288
00289 struct QCFloatFloat {
00290
00291 QCFloat frstval;
00292
00293 QCFloat scndval;
00294
00298 bool operator < (const QCFloatFloat& other) const {
00299 return (frstval < other.frstval);
00300 }
00301 friend ostream& operator << (ostream& out, const QCFloatFloat & p) {
00302 out << p.frstval << " " << p.scndval ; return out ;
00303 }
00304 };
00305
00310 #define QCAbs FQCAbs
00311 #define QCMin FQCMin
00312 #define QCMax FQCMax
00313 #define QCPow FQCPow
00314 #define QCExp FQCExp
00315 #define QCSign FQCSign
00316
00317
00321 inline QCFloat
00322 FQCAbs (QCFloat value) {
00323 return fabs(value);
00324 }
00325
00326 inline int
00327 FQCAbs (int value) {
00328 return abs(value);
00329 }
00330
00331
00332
00336 template <class TPNumerical>
00337 inline TPNumerical
00338 FQCMin (TPNumerical valueA, TPNumerical valueB) {
00339 return (valueA < valueB)? valueA: valueB;
00340 }
00341
00342
00343
00347 template <class TPNumerical>
00348 inline TPNumerical
00349 FQCMax (TPNumerical valueA, TPNumerical valueB) {
00350 return (valueA > valueB)? valueA: valueB;
00351 }
00352
00353
00354
00355
00359 template <int N>
00360 inline int FQCPow (const int& val) {
00361 return FQCPow<N-1>(val) * val;
00362 }
00363
00364 template <>
00365 inline int FQCPow<1> (const int& val) {
00366 return val;
00367 }
00368
00369
00370
00371
00375 template <int N>
00376 inline QCFloat FQCPow (const QCFloat& val) {
00377 return FQCPow<N-1>(val) * val;
00378 }
00379
00380 template <>
00381 inline QCFloat FQCPow<1> (const QCFloat& val) {
00382 return val;
00383 }
00384
00385
00386
00390 inline QCFloat FQCExp (const QCFloat& val) {
00391 QCFloat expVal = QC_ZERO;
00392 if (val > QCMTwentyFive) {
00393 expVal = exp(val);
00394 }
00395 return expVal;
00396 }
00397
00398
00399
00400
00404 inline QCFloat FQCSign (const QCFloat& val) {
00405 if (val > QC_ZERO) {
00406 return QC_ONE;
00407 }
00408 else {
00409 return -QC_ONE;
00410 }
00411 }
00412
00413
00414
00415
00419 template <class TPClass>
00420 inline TPClass* FQCReNew (TPClass* oldAddress, const int& newSize, const int& oldSize) {
00421 TPClass* newAddress = new TPClass [newSize];
00422
00423
00424 const int copySize = (newSize < oldSize)? newSize : oldSize;
00425
00426 if (oldAddress) {
00427 memcpy(newAddress, oldAddress, copySize*sizeof(TPClass) );
00428 delete [] oldAddress;
00429 }
00430
00431 return newAddress;
00432 }
00433
00434
00435
00439 inline char* FQCToUpper(char* theCStr) {
00440 unsigned int i;
00441 unsigned int theCStrLen;
00442
00443 if (theCStr) {
00444 theCStrLen = static_cast<unsigned int>(strlen(theCStr) );
00445 for (i = 0; i < theCStrLen; ++i) {
00446 theCStr[i] = toupper(theCStr[i]);
00447 }
00448 }
00449
00450 return theCStr;
00451 }
00452
00456 inline void stringToUpper(std::string s) {
00457
00458 for (unsigned int j=0; j<s.length(); ++j)
00459 { s[j]=toupper(s[j]); }
00460 }
00461
00462
00463
00464
00465
00466
00470 inline int FQCBitCount(QCUInt theBitString) {
00471 int bitCpt = 0;
00472
00473 while (theBitString) {
00474 ++bitCpt;
00475 theBitString &= theBitString-1;
00476 }
00477
00478 return bitCpt;
00479 }
00480
00484 template <class Enum>
00485 inline void updateEnum (pair<string, Enum>& member,
00486 const map<string, Enum>& strmap) {
00490 member.second =
00491 strmap.find(member.first)->second;
00492 }
00496 #define ONE_PARAM(a) \
00497 a
00498 #define TWO_PARAMS(a, b) \
00499 a, b
00500 #define THREE_PARAMS(a, b, c) \
00501 a, b, c
00502 #define FOUR_PARAMS(a, b, c, d) \
00503 a, b, c, d
00504 #define FIVE_PARAMS(a, b, c, d, e) \
00505 a, b, c, d, e
00506 #define SIX_PARAMS(a, b, c, d, e, f) \
00507 a, b, c, d, e, f
00508 #define SEVEN_PARAMS(a, b, c, d, e, f, g) \
00509 a, b, c, d, e, f, g
00510 #define EIGHT_PARAMS(a, b, c, d, e, f, g, h) \
00511 a, b, c, d, e, f, g, h
00512 #define NINE_PARAMS(a, b, c, d, e, f, g, h, i) \
00513 a, b, c, d, e, f, g, h, i
00514 #define TEN_PARAMS(a, b, c, d, e, f, g, h, i, j) \
00515 a, b, c, d, e, f, g, h, i, j
00516 #define ELEVEN_PARAMS(a, b, c, d, e, f, g, h, i, j, k) \
00517 a, b, c, d, e, f, g, h, i, j, k
00518 #define TWELVE_PARAMS(a, b, c, d, e, f, g, h, i, j, k, l) \
00519 a, b, c, d, e, f, g, h, i, j, k, l
00520 #define FOURTEEN_PARAMS(a, b, c, d, e, f, g, h, i, j, k, l, m, n) \
00521 a, b, c, d, e, f, g, h, i, j, k, l, m, n
00522
00523
00524 class QCMndoParam;
00525 class QCAm1Param;
00526 class QCPm3Param;
00527
00528 class QCSCFAlgo;
00529 class QCDCAlgo;
00530
00531 template <class TPParam> class QCMndoT;
00532 template <class TPParam> class QCAm1T;
00533 template <class TPParam> class QCPm3T;
00534
00535 template <class TPSolver> class QCGlobalSystem;
00536 template <class TPSolver> class QCMDSystem;
00537
00538 #if defined(HAVE_MPI) && defined(WITH_MPI_SUPPORT)
00539 template <class TPSolver> class QCDistMDSystem;
00540 #endif
00541
00542 template <class TPModel, class TPSystem> class QCManager;
00543
00544
00545
00546
00550 typedef QCMndoT<QCMndoParam> TQCMndo;
00551 typedef QCAm1T <QCAm1Param> TQCAm1;
00552 typedef QCPm3T <QCPm3Param> TQCPm3;
00553
00554 typedef QCGlobalSystem<QCSCFAlgo> TQCGSystem;
00555 typedef QCMDSystem<QCDCAlgo> TQCMDSystem;
00556
00557 #if defined(HAVE_MPI) && defined(WITH_MPI_SUPPORT)
00558 typedef QCDistMDSystem<QCDCAlgo> TQCDistMDSystem;
00559 #endif
00560
00561
00562 typedef QCManager<TQCMndo, TQCGSystem> TQCMndoGSystManager;
00563 typedef QCManager<TQCAm1, TQCGSystem> TQCAm1GSystManager;
00564 typedef QCManager<TQCPm3, TQCGSystem> TQCPm3GSystManager;
00565
00566 typedef QCManager<TQCMndo, TQCMDSystem> TQCMndoMDSystManager;
00567 typedef QCManager<TQCAm1, TQCMDSystem> TQCAm1MDSystManager;
00568 typedef QCManager<TQCPm3, TQCMDSystem> TQCPm3MDSystManager;
00569
00570
00571 #if defined(HAVE_MPI) && defined(WITH_MPI_SUPPORT)
00572 typedef QCManager<TQCMndo, TQCDistMDSystem> TQCMndoDistMDSystManager;
00573 typedef QCManager<TQCAm1, TQCDistMDSystem> TQCAm1DistMDSystManager;
00574 typedef QCManager<TQCPm3, TQCDistMDSystem> TQCPm3DistMDSystManager;
00575 #endif
00576
00577
00578
00579
00580 #define QCMODEL_EXPL_INST(aClass) \
00581 template class aClass<TQCMndo>; \
00582 template class aClass<TQCAm1>; \
00583 template class aClass<TQCPm3>;
00584
00585
00586
00587 #if defined(HAVE_MPI) && defined(WITH_MPI_SUPPORT)
00588
00589 # define QCMODEL_SYSTEM_EXPL_INST(aClass) \
00590 template class aClass<TQCMndo, TQCGSystem>; \
00591 template class aClass<TQCAm1, TQCGSystem>; \
00592 template class aClass<TQCPm3, TQCGSystem>; \
00593 template class aClass<TQCMndo, TQCMDSystem>; \
00594 template class aClass<TQCAm1, TQCMDSystem>; \
00595 template class aClass<TQCPm3, TQCMDSystem>; \
00596 template class aClass<TQCMndo, TQCDistMDSystem>; \
00597 template class aClass<TQCAm1, TQCDistMDSystem>; \
00598 template class aClass<TQCPm3, TQCDistMDSystem>;
00599
00600 #else
00601
00602 # define QCMODEL_SYSTEM_EXPL_INST(aClass) \
00603 template class aClass<TQCMndo, TQCGSystem>; \
00604 template class aClass<TQCAm1, TQCGSystem>; \
00605 template class aClass<TQCPm3, TQCGSystem>; \
00606 template class aClass<TQCMndo, TQCMDSystem>; \
00607 template class aClass<TQCAm1, TQCMDSystem>; \
00608 template class aClass<TQCPm3, TQCMDSystem>;
00609
00610 #endif
00611
00612
00613
00614
00615 #define QCMANAGER_EXPL_INST_GLOBAL(aClass) \
00616 template class aClass<TQCMndoGSystManager>; \
00617 template class aClass<TQCAm1GSystManager>; \
00618 template class aClass<TQCPm3GSystManager>;
00619
00620
00621
00622 #define QCMANAGER_EXPL_INST_MD(aClass) \
00623 template class aClass<TQCMndoMDSystManager>; \
00624 template class aClass<TQCAm1MDSystManager>; \
00625 template class aClass<TQCPm3MDSystManager>;
00626
00627
00628
00629 #define QCMANAGER_EXPL_INST_DIST_MD(aClass) \
00630 template class aClass<TQCMndoDistMDSystManager>; \
00631 template class aClass<TQCAm1DistMDSystManager>; \
00632 template class aClass<TQCPm3DistMDSystManager>;
00633
00634
00635
00636 #if defined(HAVE_MPI) && defined(WITH_MPI_SUPPORT)
00637
00638 # define QCMANAGER_EXPL_INST(aClass) \
00639 QCMANAGER_EXPL_INST_GLOBAL(aClass); \
00640 QCMANAGER_EXPL_INST_MD(aClass); \
00641 QCMANAGER_EXPL_INST_DIST_MD(aClass);
00642
00643 #else
00644
00645 # define QCMANAGER_EXPL_INST(aClass) \
00646 QCMANAGER_EXPL_INST_GLOBAL(aClass); \
00647 QCMANAGER_EXPL_INST_MD(aClass);
00648
00649 #endif
00650
00651
00652
00653 #define QCMANAGER_METH_EXPL_INST_GLOBAL(aMeth) \
00654 template aMeth<TQCMndoGSystManager> (TQCMndoGSystManager&); \
00655 template aMeth<TQCAm1GSystManager> (TQCAm1GSystManager&); \
00656 template aMeth<TQCPm3GSystManager> (TQCPm3GSystManager&);
00657
00658
00659
00660 #define QCMANAGER_METH_EXPL_INST_MD(aMeth) \
00661 template aMeth<TQCMndoMDSystManager>(TQCMndoMDSystManager&); \
00662 template aMeth<TQCAm1MDSystManager> (TQCAm1MDSystManager&); \
00663 template aMeth<TQCPm3MDSystManager> (TQCPm3MDSystManager&);
00664
00665
00666
00667 #define QCMANAGER_METH_EXPL_INST_DIST_MD(aMeth) \
00668 template aMeth<TQCMndoDistMDSystManager>(TQCMndoDistMDSystManager&); \
00669 template aMeth<TQCAm1DistMDSystManager> (TQCAm1DistMDSystManager&); \
00670 template aMeth<TQCPm3DistMDSystManager> (TQCPm3DistMDSystManager&);
00671
00672
00673
00674 #if defined(HAVE_MPI) && defined(WITH_MPI_SUPPORT)
00675
00676 # define QCMANAGER_METH_EXPL_INST(aMeth) \
00677 QCMANAGER_METH_EXPL_INST_GLOBAL(aMeth); \
00678 QCMANAGER_METH_EXPL_INST_MD(aMeth); \
00679 QCMANAGER_METH_EXPL_INST_DIST_MD(aMeth);
00680
00681 #else
00682
00683 # define QCMANAGER_METH_EXPL_INST(aMeth) \
00684 QCMANAGER_METH_EXPL_INST_GLOBAL(aMeth); \
00685 QCMANAGER_METH_EXPL_INST_MD(aMeth);
00686
00687 #endif
00688
00689
00690
00691
00692 #define QCMANAGER_METH_EXPL_INST_GLOBAL_PARAM(aMeth, param) \
00693 template aMeth<TQCMndoGSystManager> (TQCMndoGSystManager&, param); \
00694 template aMeth<TQCAm1GSystManager> (TQCAm1GSystManager&, param); \
00695 template aMeth<TQCPm3GSystManager> (TQCPm3GSystManager&, param);
00696
00697
00698
00699 #define QCMANAGER_METH_EXPL_INST_MD_PARAM(aMeth, param) \
00700 template aMeth<TQCMndoMDSystManager>(TQCMndoMDSystManager&, param); \
00701 template aMeth<TQCAm1MDSystManager> (TQCAm1MDSystManager&, param); \
00702 template aMeth<TQCPm3MDSystManager> (TQCPm3MDSystManager&, param);
00703
00704
00705
00706 #define QCMANAGER_METH_EXPL_INST_DIST_MD_PARAM(aMeth, param) \
00707 template aMeth<TQCMndoDistMDSystManager>(TQCMndoDistMDSystManager&, param); \
00708 template aMeth<TQCAm1DistMDSystManager> (TQCAm1DistMDSystManager&, param); \
00709 template aMeth<TQCPm3DistMDSystManager> (TQCPm3DistMDSystManager&, param);
00710
00711
00712
00713 #if defined(HAVE_MPI) && defined(WITH_MPI_SUPPORT)
00714
00715 # define QCMANAGER_METH_EXPL_INST_PARAM(aMeth, param) \
00716 template aMeth<TQCMndoGSystManager> (TQCMndoGSystManager&, param); \
00717 template aMeth<TQCAm1GSystManager> (TQCAm1GSystManager&, param); \
00718 template aMeth<TQCPm3GSystManager> (TQCPm3GSystManager&, param); \
00719 template aMeth<TQCMndoMDSystManager> (TQCMndoMDSystManager&, param); \
00720 template aMeth<TQCAm1MDSystManager> (TQCAm1MDSystManager&, param); \
00721 template aMeth<TQCPm3MDSystManager> (TQCPm3MDSystManager&, param); \
00722 template aMeth<TQCMndoDistMDSystManager>(TQCMndoDistMDSystManager&, param); \
00723 template aMeth<TQCAm1DistMDSystManager> (TQCAm1DistMDSystManager&, param); \
00724 template aMeth<TQCPm3DistMDSystManager> (TQCPm3DistMDSystManager&, param);
00725
00726 #else
00727
00728 # define QCMANAGER_METH_EXPL_INST_PARAM(aMeth, param) \
00729 template aMeth<TQCMndoGSystManager> (TQCMndoGSystManager&, param); \
00730 template aMeth<TQCAm1GSystManager> (TQCAm1GSystManager&, param); \
00731 template aMeth<TQCPm3GSystManager> (TQCPm3GSystManager&, param); \
00732 template aMeth<TQCMndoMDSystManager> (TQCMndoMDSystManager&, param); \
00733 template aMeth<TQCAm1MDSystManager> (TQCAm1MDSystManager&, param); \
00734 template aMeth<TQCPm3MDSystManager> (TQCPm3MDSystManager&, param);
00735
00736 #endif
00737
00738
00739
00740
00741 #define QCMANAGER_ITER_METH_EXPL_INST_GLOBAL(aMeth) \
00742 template aMeth<TQCMndoGSystManager> (TQCMndoGSystManager&, \
00743 TQCMndoGSystManager::TSystem::QCIterator&); \
00744 template aMeth<TQCAm1GSystManager> (TQCAm1GSystManager&, \
00745 TQCAm1GSystManager::TSystem::QCIterator&); \
00746 template aMeth<TQCPm3GSystManager> (TQCPm3GSystManager&, \
00747 TQCPm3GSystManager::TSystem::QCIterator&);
00748
00749
00750
00751
00752 #define QCMANAGER_ITER_METH_EXPL_INST_MD(aMeth) \
00753 template aMeth<TQCMndoMDSystManager>(TQCMndoMDSystManager&, \
00754 TQCMndoMDSystManager::TSystem::QCIterator&); \
00755 template aMeth<TQCAm1MDSystManager> (TQCAm1MDSystManager&, \
00756 TQCAm1MDSystManager::TSystem::QCIterator&); \
00757 template aMeth<TQCPm3MDSystManager> (TQCPm3MDSystManager&, \
00758 TQCPm3MDSystManager::TSystem::QCIterator&);
00759
00760
00761
00762
00763 #define QCMANAGER_ITER_METH_EXPL_INST_DIST_MD(aMeth) \
00764 template aMeth<TQCMndoDistMDSystManager>(TQCMndoDistMDSystManager&, \
00765 TQCMndoDistMDSystManager::TSystem::QCIterator&); \
00766 template aMeth<TQCAm1DistMDSystManager> (TQCAm1DistMDSystManager&, \
00767 TQCAm1DistMDSystManager::TSystem::QCIterator&); \
00768 template aMeth<TQCPm3DistMDSystManager> (TQCPm3DistMDSystManager&, \
00769 TQCPm3DistMDSystManager::TSystem::QCIterator&);
00770
00771
00772
00773
00774 #if defined(HAVE_MPI) && defined(WITH_MPI_SUPPORT)
00775
00776 # define QCMANAGER_ITER_METH_EXPL_INST(aMeth) \
00777 QCMANAGER_ITER_METH_EXPL_INST_GLOBAL(aMeth); \
00778 QCMANAGER_ITER_METH_EXPL_INST_MD(aMeth); \
00779 QCMANAGER_ITER_METH_EXPL_INST_DIST_MD(aMeth);
00780
00781 #else
00782
00783 # define QCMANAGER_ITER_METH_EXPL_INST(aMeth) \
00784 QCMANAGER_ITER_METH_EXPL_INST_GLOBAL(aMeth); \
00785 QCMANAGER_ITER_METH_EXPL_INST_MD(aMeth);
00786
00787 #endif
00788
00789
00790
00791
00792
00793 #define QCMANAGER_ITER_METH_EXPL_INST_GLOBAL_PARAM(aMeth, param) \
00794 template aMeth<TQCMndoGSystManager> (TQCMndoGSystManager&, \
00795 TQCMndoGSystManager::TSystem::QCIterator&, param); \
00796 template aMeth<TQCAm1GSystManager> (TQCAm1GSystManager&, \
00797 TQCAm1GSystManager::TSystem::QCIterator&, param); \
00798 template aMeth<TQCPm3GSystManager> (TQCPm3GSystManager&, \
00799 TQCPm3GSystManager::TSystem::QCIterator&, param);
00800
00801
00802
00803
00804 #define QCMANAGER_ITER_METH_EXPL_INST_MD_PARAM(aMeth, param) \
00805 template aMeth<TQCMndoMDSystManager>(TQCMndoMDSystManager&, \
00806 TQCMndoMDSystManager::TSystem::QCIterator&, param); \
00807 template aMeth<TQCAm1MDSystManager> (TQCAm1MDSystManager&, \
00808 TQCAm1MDSystManager::TSystem::QCIterator&, param); \
00809 template aMeth<TQCPm3MDSystManager> (TQCPm3MDSystManager&, \
00810 TQCPm3MDSystManager::TSystem::QCIterator&, param);
00811
00812
00813
00814
00815 #define QCMANAGER_ITER_METH_EXPL_INST_DIST_MD_PARAM(aMeth, param) \
00816 template aMeth<TQCMndoDistMDSystManager>(TQCMndoDistMDSystManager&, \
00817 TQCMndoDistMDSystManager::TSystem::QCIterator&, param); \
00818 template aMeth<TQCAm1DistMDSystManager> (TQCAm1DistMDSystManager&, \
00819 TQCAm1DistMDSystManager::TSystem::QCIterator&, param); \
00820 template aMeth<TQCPm3DistMDSystManager> (TQCPm3DistMDSystManager&, \
00821 TQCPm3DistMDSystManager::TSystem::QCIterator&, param);
00822
00823
00824
00825
00826 #if defined(HAVE_MPI) && defined(WITH_MPI_SUPPORT)
00827
00828 # define QCMANAGER_ITER_METH_EXPL_INST_PARAM(aMeth, param) \
00829 template aMeth<TQCMndoGSystManager> (TQCMndoGSystManager&, \
00830 TQCMndoGSystManager::TSystem::QCIterator&, param); \
00831 template aMeth<TQCAm1GSystManager> (TQCAm1GSystManager&, \
00832 TQCAm1GSystManager::TSystem::QCIterator&, param); \
00833 template aMeth<TQCPm3GSystManager> (TQCPm3GSystManager&, \
00834 TQCPm3GSystManager::TSystem::QCIterator&, param); \
00835 template aMeth<TQCMndoMDSystManager>(TQCMndoMDSystManager&, \
00836 TQCMndoMDSystManager::TSystem::QCIterator&, param); \
00837 template aMeth<TQCAm1MDSystManager> (TQCAm1MDSystManager&, \
00838 TQCAm1MDSystManager::TSystem::QCIterator&, param); \
00839 template aMeth<TQCPm3MDSystManager> (TQCPm3MDSystManager&, \
00840 TQCPm3MDSystManager::TSystem::QCIterator&, param); \
00841 template aMeth<TQCMndoDistMDSystManager>(TQCMndoDistMDSystManager&, \
00842 TQCMndoDistMDSystManager::TSystem::QCIterator&, param); \
00843 template aMeth<TQCAm1DistMDSystManager> (TQCAm1DistMDSystManager&, \
00844 TQCAm1DistMDSystManager::TSystem::QCIterator&, param); \
00845 template aMeth<TQCPm3DistMDSystManager> (TQCPm3DistMDSystManager&, \
00846 TQCPm3DistMDSystManager::TSystem::QCIterator&, param);
00847
00848 #else
00849
00850 # define QCMANAGER_ITER_METH_EXPL_INST_PARAM(aMeth, param) \
00851 template aMeth<TQCMndoGSystManager> (TQCMndoGSystManager&, \
00852 TQCMndoGSystManager::TSystem::QCIterator&, param); \
00853 template aMeth<TQCAm1GSystManager> (TQCAm1GSystManager&, \
00854 TQCAm1GSystManager::TSystem::QCIterator&, param); \
00855 template aMeth<TQCPm3GSystManager> (TQCPm3GSystManager&, \
00856 TQCPm3GSystManager::TSystem::QCIterator&, param); \
00857 template aMeth<TQCMndoMDSystManager>(TQCMndoMDSystManager&, \
00858 TQCMndoMDSystManager::TSystem::QCIterator&, param); \
00859 template aMeth<TQCAm1MDSystManager> (TQCAm1MDSystManager&, \
00860 TQCAm1MDSystManager::TSystem::QCIterator&, param); \
00861 template aMeth<TQCPm3MDSystManager> (TQCPm3MDSystManager&, \
00862 TQCPm3MDSystManager::TSystem::QCIterator&, param);
00863
00864 #endif
00865
00866
00867
00868
00869
00870 #define QCITERATOR_METH_EXPL_INST(aMeth) \
00871 template aMeth<TQCGSystem::QCIterator> (TQCGSystem::QCIterator&); \
00872 template aMeth<TQCMDSystem::QCIterator>(TQCMDSystem::QCIterator&);
00873
00874
00875
00876 #define QCITERATOR_METH_EXPL_INST_PARAM(aMeth, param) \
00877 template aMeth<TQCGSystem::QCIterator> (TQCGSystem::QCIterator&, param); \
00878 template aMeth<TQCMDSystem::QCIterator>(TQCMDSystem::QCIterator&, param);
00879
00880
00881
00882 #define QCPARAMETER_METH_EXPL_INST(aMeth) \
00883 template aMeth<QCMndoParam>(const QCMndoParam* QCRestrict); \
00884 template aMeth<QCAm1Param> (const QCAm1Param* QCRestrict); \
00885 template aMeth<QCPm3Param> (const QCPm3Param* QCRestrict)
00886
00887
00888
00889 #define QCPARAMETER_METH_EXPL_INST_PARAM(aMeth, param) \
00890 template aMeth<QCMndoParam>(const QCMndoParam* QCRestrict, param); \
00891 template aMeth<QCAm1Param> (const QCAm1Param* QCRestrict, param); \
00892 template aMeth<QCPm3Param> (const QCPm3Param* QCRestrict, param)
00893
00894
00895
00896 #define TWO_QCPARAMETERS_METH_EXPL_INST_PARAM(aMeth, param) \
00897 template aMeth<QCMndoParam>(const QCMndoParam* QCRestrict, \
00898 const QCMndoParam* QCRestrict, param); \
00899 template aMeth<QCAm1Param> (const QCAm1Param* QCRestrict, \
00900 const QCAm1Param* QCRestrict, param); \
00901 template aMeth<QCPm3Param> (const QCPm3Param* QCRestrict, \
00902 const QCPm3Param* QCRestrict, param);
00903
00904
00905
00906
00912 class QCCommon
00913 {
00914
00916 public:
00917
00922 static string getTimeStr (void);
00926 static string getPidStr (void);
00927
00928
00929
00930
00931
00933 protected:
00934
00935
00937 private:
00938
00939
00940
00942 public:
00946 static const string MndoStr;
00947 static const string Am1Str;
00948 static const string Pm3Str;
00949 static const map<string, QCModelType> modelTypes;
00953 static const string MndoParamStr;
00954 static const string Am1ParamStr;
00955 static const string Pm3ParamStr;
00956 static const map<string, QCParameterType> paramTypes;
00960 static const string EnergyStr;
00961 static const string EnergyDerivStr;
00962 static const string ToolsStr;
00963 static const map<string, QCComputation> computations;
00967 static const string SCFStr;
00968 static const string LevelShiftingStr;
00969 static const string OptimalDampingStr;
00970 static const string DCSCFStr;
00971 static const string DCLevelShiftingStr;
00972 static const string DCOptimalDampingStr;
00973 static const map<string, QCMainAlgorithm> mainAlgorithms;
00977 static const string ClassicDiagoStr;
00978 static const string DCDiagoStr;
00979 static const map<string, QCDiagoAlgorithm> diagoAlgorithms;
00983 static const string DirectComputationStr;
00984 static const string IndirectStorageStr;
00985 static const map<string, QCIntgAcquisitionMethod> intgAcqMethods;
00989 static const string initDiagStr;
00990 static const string initFileStr;
00991 static const map<string, QCInitDensityMatrix> initDensityMatrix;
00995 static const string NumericalDerivationStr;
00996 static const string AnalyticalDerivationStr;
00997 static const map<string, QCDerivationType> derivationTypes;
01001 static const string ConstantStr;
01002 static const string ComputedStr;
01003 static const map<string, QCDerivShiftBhvr> derivShiftBhvrs;
01007 static const string CoreZoneStr;
01008 static const string Shell1ZoneStr;
01009 static const string Shell2ZoneStr;
01010 static const map<QCSubDomainZone, string> domainZones;
01014 static const string StandardPartStr;
01015 static const string DixonPartStr;
01016 static const map<string, QCPartitionType> partitionTypes;
01020 static const string LinearStr;
01021 static const string KimikaStr;
01022 static const map<string, QCPartitionerType> partitionerTypes;
01026 static const string YesStr;
01027 static const string NoStr;
01028
01032 static const string ErrorFile;
01033
01037 static const int Pid;
01038
01042 static const string MemoryTmpFile;
01043
01047 static const string IntegralsTmpFile;
01048
01049
01053 static string userdir;
01054 static string datadir;
01055 static string outdir;
01056 static const string UserDirName;
01057 static const string DataDirName;
01058 static const string DataBaseDirName;
01059 static const string OutDirName;
01060
01061
01062 protected:
01063 private:
01064
01065
01066
01067 };
01068
01069
01070
01074 #ifdef __cplusplus
01075 # define BEGIN_C_DECLARATION extern "C" {
01076 # define END_C_DECLARATION }
01077 #else
01078 # define BEGIN_C_DECLARATION
01079 # define END_C_DECLARATION
01080 #endif // __cplusplus
01081
01082
01083
01084
01085 #endif // QC_COMMON_H_