brabobase.h

Go to the documentation of this file.
00001 /***************************************************************************
00002                           brabobase.h  -  description
00003                              -------------------
00004     begin                : Sun Jul 28 2002
00005     copyright            : (C) 2002-2006 by Ben Swerts
00006     email                : bswerts@users.sourceforge.net
00007  ***************************************************************************/
00008 
00009 /***************************************************************************
00010  *                                                                         *
00011  *   This program is free software; you can redistribute it and/or modify  *
00012  *   it under the terms of the GNU General Public License as published by  *
00013  *   the Free Software Foundation; either version 2 of the License, or     *
00014  *   (at your option) any later version.                                   *
00015  *                                                                         *
00016  ***************************************************************************/
00017 
00020 
00021 #ifndef BRABOBASE_H
00022 #define BRABOBASE_H
00023 
00025 
00026 // STL header files
00027 #include <vector>
00028 using std::vector;
00029 
00030 // Qt forward class declarations
00031 class QDomElement;
00032 class QPixmap;
00033 class QString;
00034 
00035 // Xbrabo forward class declarations
00036 class AtomSet;
00037 
00038 // Base class header file
00039 #include "brabowidget.h"
00040 
00041 
00043 class BraboBase : public BraboWidget
00044 {
00045   Q_OBJECT
00046 
00047   public:
00049     BraboBase(AtomSet* atoms, QWidget* parent = 0, const char* name = 0, bool modal = FALSE, WFlags fl = 0);  // constructor
00050     ~BraboBase();                       // destructor
00051 
00053     enum Programs{BRABO, STOCK};
00054 
00056     void setForces(const bool state);   // sets whether forces are to be calculated
00057     void setDescription(const QString description);         // sets the description
00058     void setName(const QString name);   // sets the name (filename prefix)
00059     void setExtendedFormat(const bool state);     // sets extended format for coordinates & forces
00060     void setPVMHosts(const QStringList& hosts);   // sets the available PVM hosts
00061 
00063     QString method() const;              // returns the method
00064     
00066     QStringList basissets(bool& ok);    // checks whether all atoms have a basisset assigned and returns the list of basisset files
00067     QString startVector(bool& prefer, unsigned int& size1, unsigned int& size2);// returns the startvector
00068     unsigned int maxIterations() const; // returns the maximum number of iterations
00069             
00071     QStringList generateInput(unsigned int program);        // fills a QStringList with the input file
00072     QString generateAtdens(bool& ok);   // generate a QString with the appropriate .atdens file
00073     void loadCML(const QDomElement* root);        // loads widget appearances from file
00074     void saveCML(QDomElement* root);    // saves widget appearances to file 
00075 
00077     static void setPreferredBasisset(const unsigned int basisset);    // sets the preferred basisset
00078       
00079   public slots:
00080     void reset();                       // resets all widgets
00081 
00082   protected slots:
00083     void accept();                      // is called when the changes are accepted (OK clicked)
00084     void reject();                      // is called when the changes are rejected (Cancel or X clicked)
00085 
00086   private slots:
00088     void showPreview();                 // shows a preview of the input file
00089     void readInputFile();               // reads an existing input file into the widgets
00091     void changed();                     // sets the 'changed' status of the widget
00092     void selectWidget(QListViewItem*);  // shows a widget from the widgetstack depending on the listview item
00094     void updateSCFMethodWidgets(int index);       // updates widgets according to the SCF method index
00095     void updateSCFTypeWidgets(int index);         // updates widgets according to the SCF type index
00096     void selectStartvector();           // selects an existing startvector
00098     void oneBasisset(bool on);          // toggles between 1/multiple basissets
00099     void addBasisset();                 // adds a basisset to the list
00100     void removeBasisset();              // removes a basisset from the list
00102     void toggleDIIS(bool on);           // toggles DIIS options on/off
00104     void addPVMHost();                  // adds a PVM host to the NOTH list
00105     void removePVMHost();               // removes a PVM host from the NOTH list
00107     void adjustPrintSCF();              // adjusts the PrintSCF checkboxes
00109     void checkOverflowMain(int row, int col);     // spans a cel over multiple columns if the field is longer than 10 chars (TableMain)
00110     void checkOverflowPVM(int row, int col);      // spans a cel over multiple columns if the field is longer than 10 chars (TablePVM)
00111     void checkOverflowINTE(int row, int col);     // spans a cel over multiple columns if the field is longer than 10 chars (TableINTE)
00112     void checkOverflowSCF(int row, int col);      // spans a cel over multiple columns if the field is longer than 10 chars (TableSCF)
00113     void checkOverflowFORC(int row, int col);     // spans a cel over multiple columns if the field is longer than 10 chars (TableFORC)
00114     void addRowMain();                  // adds a row to TableMain
00115     void addRowPVM();                   // adds a row to TablePVM
00116     void addRowINTE();                  // adds a row to TableINTE
00117     void addRowSCF();                   // adds a row to TableSCF
00118     void addRowFORC();                  // adds a row to TableFORC    
00119     void removeRowMain();               // removes a row from TableMain
00120     void removeRowPVM();                // removes a row from TablePVM
00121     void removeRowINTE();               // removes a row from TableINTE
00122     void removeRowSCF();                // removes a row from TableSCF
00123     void removeRowFORC();               // removes a row from TableFORC
00124     void clearSelectionMain();          // clears the selected cells in TableMain
00125     void clearSelectionPVM();           // clears the selected cells in TablePVM
00126     void clearSelectionINTE();          // clears the selected cells in TableINTE
00127     void clearSelectionSCF();           // clears the selected cells in TableSCF
00128     void clearSelectionFORC();          // clears the selected cells in TableFORC    
00129 
00130   private:
00132     enum Categories{BASIC = 0, ADVANCED, PROPERTIES, SCFCONVERGENCE, PVM, DEBUG1, EXTRA,
00133                     ADVANCED_METHOD, ADVANCED_SYMMETRY, ADVANCED_OTHER,
00134                     PROPERTIES_CHARGES, PROPERTIES_OTHER, 
00135                     EXTRA_MAIN, EXTRA_PVM, EXTRA_INTE, EXTRA_SCF, EXTRA_FORC};
00136 
00138     void makeConnections();             // sets up all permanent connections
00139     void init();                        // initializes the dialog
00140     void fillComboBoxes();              // fills the comboboxes 
00141     void saveWidgets();                 // saves widget appearances
00142     void restoreWidgets();              // restores widget appearances
00143     QStringList parsedNUCLlines();      // returns a stringlist containing 'NUCL     x' lines
00144     void buildAtdens();                 // generates .atdens files from the basis set files
00145 
00147     struct WidgetData
00150     {                                                 
00151 
00153       unsigned int          SCFMethod;            
00154       unsigned int          SCFType;              
00155       bool                  useStartvector;       
00156       QString               startvector;          
00157       bool                  preferStartvector;    
00158       int                   charge;               
00159 
00161       bool                  useOneBasisset;       
00162       unsigned int          basisset1;            
00163       unsigned int          basissetAtom;         
00164       unsigned int          basisset2;            
00165       vector<unsigned int>  listAtoms;            
00166       vector<unsigned int>  listBasissets;        
00167 
00169       unsigned int          MP2Type;              
00170       unsigned int          MP2ExcludeOcc;        
00171       unsigned int          MP2ExcludeVirt;       
00172       bool                  MP2Density;           
00173       bool                  useField;             
00174       QString               fieldX;               
00175       QString               fieldY;               
00176       QString               fieldZ;               
00177       bool                  useSCRF;              
00178       QString               SCRFEpsilon;          
00179       QString               SCRFRadius;           
00180 
00182       bool                  useSymmetry;          
00183       bool                  useSymmAuto;          
00184       bool                  useSymmX;             
00185       bool                  useSymmY;             
00186       bool                  useSymmZ;             
00187       bool                  useSymmXY;            
00188       bool                  useSymmYZ;            
00189       bool                  useSymmXZ;            
00190       bool                  useSymmXYZ;           
00191 
00193       QString               valueIpol;            
00194       bool                  useSkpc;              
00195       bool                  printGeop;            
00196       bool                  printWF;              
00197       bool                  printDM;              
00198       bool                  useDST;               
00199       bool                  useACD;               
00200       bool                  saveF11;              
00201       bool                  useFato;              
00202       unsigned int          numFato;              
00203       bool                  useMIAForce;          
00204 
00206       bool                  useMulliken;          
00207       bool                  MullikenNoOverlap;    
00208       bool                  MullikenEachIter;     
00209       bool                  useStock;             
00210       unsigned int          stockType;            
00211       bool                  stockTotalDensity;    
00212       unsigned int          stockTransition1;     
00213       unsigned int          stockTransition2;     
00214       bool                  useStockElmo;         
00215       bool                  useStockEpar;         
00216 
00218       bool                  useBoys;              
00219       unsigned int          numBoysIter;          
00220       QString               BoysThreshold;        
00221       QString               listNucl;             
00222       bool                  useElmo;              
00223       bool                  useExit;              
00224       bool                  useJab;               
00225 
00227       int                   numIter;              
00228       bool                  useJacobi;            
00229       bool                  useDIIS;              
00230       QString               DIISThre;             
00231       int                   numDIISCoeff;         
00232       QString               valueLvsh;            
00233       bool                  useDlvs;              
00234       QString               thresholdINTEa;       
00235       QString               thresholdINTEb;       
00236       QString               thresholdMIAa;        
00237       QString               thresholdMIAb;        
00238       QString               thresholdSCFa;        
00239       QString               thresholdSCFb;        
00240       QString               thresholdOverlapa;    
00241       QString               thresholdOverlapb;    
00242       bool                  useVarThreMIA;        
00243 
00245       bool                  usePVM;               
00246       QStringList           PVMExcludeHosts;      
00247       unsigned int          PVMNumShells;         
00248       unsigned int          PVMNumTasks;          
00249       bool                  notOnMaster;          
00250       int                   valueNice;            
00251       bool                  usePacked;            
00252 
00254       bool                  printDebugPVM;        
00255       bool                  printDebugFORC;       
00256       bool                  goonINTE;             
00257       bool                  goonSCF;              
00258       bool                  printIntegrals;       
00259       bool                  printShells;          
00260       unsigned int          levelPrintSCF;        
00261       unsigned int          numVirtual;           
00262 
00264       unsigned int          numLinesExtraMain;    
00265       unsigned int          numLinesExtraPVM;     
00266       unsigned int          numLinesExtraINTE;    
00267       unsigned int          numLinesExtraSCF;     
00268       unsigned int          numLinesExtraFORC;    
00269       vector<unsigned int>  hPosExtraMain;        
00270       vector<unsigned int>  hPosExtraPVM;         
00271       vector<unsigned int>  hPosExtraINTE;        
00272       vector<unsigned int>  hPosExtraSCF;         
00273       vector<unsigned int>  hPosExtraFORC;        
00274       vector<unsigned int>  vPosExtraMain;        
00275       vector<unsigned int>  vPosExtraPVM;         
00276       vector<unsigned int>  vPosExtraINTE;        
00277       vector<unsigned int>  vPosExtraSCF;         
00278       vector<unsigned int>  vPosExtraFORC;        
00279       QStringList           contentsExtraMain;    
00280       QStringList           contentsExtraPVM;     
00281       QStringList           contentsExtraINTE;    
00282       QStringList           contentsExtraSCF;     
00283       QStringList           contentsExtraFORC;    
00284     };
00285     struct XMLData
00288     {
00290       QString SCFMethod;
00291       QString SCFType;
00292       QString useStartvector;
00293       QString startvector; 
00294       QString preferStartvector;
00295       QString charge;
00297       QString useOneBasisset;
00298       QString basisset1;
00299       QString basissetAtom;
00300       QString basisset2;
00301       QString listAtoms;
00302       QString listBasissets;
00304       QString MP2Type;
00305       QString MP2ExcludeOcc;
00306       QString MP2ExcludeVirt;
00307       QString MP2Density; 
00308       QString useField;
00309       QString fieldX;
00310       QString fieldY;
00311       QString fieldZ; 
00312       QString useSCRF;
00313       QString SCRFEpsilon;
00314       QString SCRFRadius;
00316       QString useSymmetry;
00317       QString useSymmAuto;
00318       QString useSymmX;
00319       QString useSymmY; 
00320       QString useSymmZ;
00321       QString useSymmXY;
00322       QString useSymmYZ;
00323       QString useSymmXZ;
00324       QString useSymmXYZ;
00326       QString valueIpol;
00327       QString useSkpc;
00328       QString printGeop; 
00329       QString printWF;
00330       QString printDM;
00331       QString useDST;
00332       QString useACD;
00333       QString saveF11;
00334       QString useFato;
00335       QString numFato;
00336       QString useMIAForce;
00338       QString useMulliken;
00339       QString MullikenNoOverlap;
00340       QString MullikenEachIter;
00341       QString useStock;
00342       QString stockType;
00343       QString stockTotalDensity;
00344       QString stockTransition1;
00345       QString stockTransition2;
00346       QString useStockElmo;
00347       QString useStockEpar;
00349       QString useBoys;
00350       QString numBoysIter;
00351       QString BoysThreshold;
00352       QString listNucl;
00353       QString useElmo;
00354       QString useExit;
00355       QString useJab;
00357       QString numIter;
00358       QString useJacobi;
00359       QString useDIIS;
00360       QString DIISThre;
00361       QString numDIISCoeff;
00362       QString valueLvsh; 
00363       QString useDlvs; 
00364       QString thresholdINTEa;
00365       QString thresholdINTEb;
00366       QString thresholdMIAa;
00367       QString thresholdMIAb;
00368       QString thresholdSCFa; 
00369       QString thresholdSCFb;
00370       QString thresholdOverlapa;
00371       QString thresholdOverlapb;
00372       QString useVarThreMIA;
00374       QString usePVM;
00375       QString PVMExcludeHosts;
00376       QString PVMNumShells;
00377       QString PVMNumTasks;
00378       QString notOnMaster;
00379       QString valueNice;
00380       QString usePacked;
00382       QString printDebugPVM;
00383       QString printDebugFORC;
00384       QString goonINTE;
00385       QString goonSCF;
00386       QString printIntegrals;
00387       QString printShells;
00388       QString levelPrintSCF;
00389       QString numVirtual;
00391       QString numLinesExtraMain;
00392       QString numLinesExtraPVM;
00393       QString numLinesExtraINTE; 
00394       QString numLinesExtraSCF;
00395       QString numLinesExtraFORC;
00396       QString hPosExtraMain;
00397       QString hPosExtraPVM;
00398       QString hPosExtraINTE;
00399       QString hPosExtraSCF;
00400       QString hPosExtraFORC;
00401       QString vPosExtraMain;
00402       QString vPosExtraPVM;
00403       QString vPosExtraINTE;
00404       QString vPosExtraSCF;
00405       QString vPosExtraFORC;
00406       QString contentsExtraMain;
00407       QString contentsExtraPVM;
00408       QString contentsExtraINTE;
00409       QString contentsExtraSCF;
00410       QString contentsExtraFORC;
00411     };
00412 
00414     // externally set
00415     bool calcForces;                    
00416     QString calcDescription;            
00417     QString calcName;                   
00418     //QString calcDir;                    ///< contains the directory
00419     bool calcXF;                        
00420     // internally set
00421     WidgetData data;                    
00422     bool widgetChanged;                 
00423     vector<QString> category;           
00424     AtomSet* atoms;                     
00425 
00427     static QStringList pvmHosts;        // contains the PVM host list
00428     static unsigned int preferredBasisset;        // contains the preferred basisset 
00429     static const XMLData xml;           
00430 };
00431 
00432 #endif
00433 

Generated on Fri May 19 14:31:54 2006 for Brabosphere by  doxygen 1.4.6-NO