BraboBase Class Reference

#include <brabobase.h>

List of all members.


Detailed Description

Allows generating an input file for the program Brabo.

A dialog is presented with all options for Brabo classified in different categories. Options for the Stockholder program are also available. All data are stored in the class itself using the private struct WidgetData. This class is a subclass of BraboWidget, a class generated from brabowidget.ui.

Definition at line 43 of file brabobase.h.

Public Types

enum  Programs { BRABO, STOCK }

Public Slots

void reset ()
 Resets all widgets to their default values determined by calcForces = TRUE / FALSE.

Public Member Functions

 BraboBase (AtomSet *atoms, QWidget *parent=0, const char *name=0, bool modal=FALSE, WFlags fl=0)
 ~BraboBase ()
 The default destructor.
void setForces (const bool state)
 Sets whether forces should be calculated and updates the status of related widgets.
void setDescription (const QString description)
 Sets the description of the calculation.
void setName (const QString name)
 Sets the filename prefix of the calculation.
void setExtendedFormat (const bool state)
 Sets the format of the coordinates (normal/extended).
void setPVMHosts (const QStringList &hosts)
 Sets the available PVM hosts.
QString method () const
 Returns the method in the form Type(Method)//Basisset.
QStringList basissets (bool &ok)
 Checks whether every atom has a basisset assigned (status returned by ok) and returns a list of basisset files.
QString startVector (bool &prefer, unsigned int &size1, unsigned int &size2)
 Returns the starting vector file name.
unsigned int maxIterations () const
 Returns the maximum number of SCF-iterations.
QStringList generateInput (unsigned int program)
 Generates an input file in a stringlist from the contents of the widgets.
QString generateAtdens (bool &ok)
 Returns a custom built atdens file for running STOCK for the provided atoms.
void loadCML (const QDomElement *root)
 Reads the widgetdata from a QDomElement.
void saveCML (QDomElement *root)
 Saves the widgetdata to a QDomElement.

Static Public Member Functions

static void setPreferredBasisset (const unsigned int basisset)
 Sets the preferred basisset.

Protected Slots

void accept ()
 Overridden from BraboWidget::accept().
void reject ()
 Overridden from BraboWidget::reject().

Private Types

enum  Categories {
  BASIC = 0, ADVANCED, PROPERTIES, SCFCONVERGENCE,
  PVM, DEBUG1, EXTRA, ADVANCED_METHOD,
  ADVANCED_SYMMETRY, ADVANCED_OTHER, PROPERTIES_CHARGES, PROPERTIES_OTHER,
  EXTRA_MAIN, EXTRA_PVM, EXTRA_INTE, EXTRA_SCF,
  EXTRA_FORC
}

Private Slots

void showPreview ()
 Shows a preview from the widgets.
void readInputFile ()
 Reads a Brabo input file into the widgets.
void changed ()
 Indicates at least one widget was altered.
void selectWidget (QListViewItem *)
 Shows a widget from WidgetStackCategory depending on newItem.
void updateSCFMethodWidgets (int index)
 Updates widgets according to the currently selected SCF method.
void updateSCFTypeWidgets (int index)
 Updates widgets according to the currently selected SCF type.
void selectStartvector ()
 Selects a file containing a startvector to be used in the calculation.
void oneBasisset (bool on)
 Enables/disables certain widgets depending on the selection of 1 basisset (true) or multiple basissets (false).
void addBasisset ()
 Adds a basisset/atom combination to ListViewBAS, but only if the atom type isn't listed yet.
void removeBasisset ()
 Removes the currently selected line from ListViewBAS.
void toggleDIIS (bool on)
 Enables/disables the DIIS options.
void addPVMHost ()
 Adds the currently selected host from ListBoxNOTH2 to ListBoxNOTH1.
void removePVMHost ()
 Removes the currently selected host from ListBoxNOTH1.
void adjustPrintSCF ()
 Adjusts the Print SCF Level checkboxes.
void checkOverflowMain (int row, int col)
 Spans cell(row, col) over multiple columns if it contains more than 10 characters.
void checkOverflowPVM (int row, int col)
 Spans cell(row, col) over multiple columns if it contains more than 10 characters.
void checkOverflowINTE (int row, int col)
 Spans cell(row, col) over multiple columns if it contains more than 10 characters.
void checkOverflowSCF (int row, int col)
 Spans cell(row, col) over multiple columns if it contains more than 10 characters.
void checkOverflowFORC (int row, int col)
 Spans cell(row, col) over multiple columns if it contains more than 10 characters.
void addRowMain ()
 If a row is selected, inserts a row before the selection.
void addRowPVM ()
 If a row is selected, inserts a row before the selection.
void addRowINTE ()
 If a row is selected, inserts a row before the selection.
void addRowSCF ()
 If a row is selected, inserts a row before the selection.
void addRowFORC ()
 If a row is selected, inserts a row before the selection.
void removeRowMain ()
 Removes the selected rows from TableMain.
void removeRowPVM ()
 Removes the selected rows from TablePVM.
void removeRowINTE ()
 Removes the selected rows from TableINTE.
void removeRowSCF ()
 Removes the selected rows from TableSCF.
void removeRowFORC ()
 Removes the selected rows from TableFORC.
void clearSelectionMain ()
 Clears the selected cells in TableMain.
void clearSelectionPVM ()
 Clears the selected cells in TablePVM.
void clearSelectionINTE ()
 Clears the selected cells in TableINTE.
void clearSelectionSCF ()
 Clears the selected cells in TableSCF.
void clearSelectionFORC ()
 Clears the selected cells in TableFORC.

Private Member Functions

void makeConnections ()
 Sets up the permanent connections. Called once from the constructor.
void init ()
 Initializes the dialog.
void fillComboBoxes ()
 Fills the comboboxes with available basissets and atom types. Called once from init.
void saveWidgets ()
 Saves the status of the widgets to a WidgetData struct.
void restoreWidgets ()
 Restores the status of the widgets from a WidgetData struct.
QStringList parsedNUCLlines ()
 Returns a stringlist containing input lines for Brabo constructed from the NUCL options.
void buildAtdens ()
 Generates atomic density basis set files for each atom of each basis set using atomic SCF.

Private Attributes

bool calcForces
 = true if forces should be calculated
QString calcDescription
 contains the description
QString calcName
 contains the filename prefix
bool calcXF
 = true if extended format is to be used
WidgetData data
 contains the status of all widgets
bool widgetChanged
 is set when any of the widgets change
vector< QString > category
 Contains translatable names for the items in ListViewCategories.
AtomSetatoms
 A pointer to the AtomSet.

Static Private Attributes

static QStringList pvmHosts = QStringList()
 The list of available PVM hosts.
static unsigned int preferredBasisset = 0
 The preferred basisset.
static const XMLData xml
 Contains the XML dictRef values for all WidgetData.

Classes

struct  WidgetData
 A struct for saving the contents of all BraboWidget widgets. More...
struct  XMLData
 A struct representing the XML dictRef values for all the data from WidgetData. More...


Member Enumeration Documentation

enum BraboBase::Programs
 

Enumerator:
BRABO 
STOCK 

Definition at line 53 of file brabobase.h.

enum BraboBase::Categories [private]
 

Enumerator:
BASIC 
ADVANCED 
PROPERTIES 
SCFCONVERGENCE 
PVM 
DEBUG1 
EXTRA 
ADVANCED_METHOD 
ADVANCED_SYMMETRY 
ADVANCED_OTHER 
PROPERTIES_CHARGES 
PROPERTIES_OTHER 
EXTRA_MAIN 
EXTRA_PVM 
EXTRA_INTE 
EXTRA_SCF 
EXTRA_FORC 

Definition at line 132 of file brabobase.h.


Constructor & Destructor Documentation

BraboBase::BraboBase AtomSet atoms,
QWidget *  parent = 0,
const char *  name = 0,
bool  modal = FALSE,
WFlags  fl = 0
 

Definition at line 79 of file brabobase.cpp.

BraboBase::~BraboBase  ) 
 

The default destructor.

Definition at line 89 of file brabobase.cpp.


Member Function Documentation

void BraboBase::setForces const bool  state  ) 
 

Sets whether forces should be calculated and updates the status of related widgets.

Definition at line 96 of file brabobase.cpp.

void BraboBase::setDescription const QString  description  ) 
 

Sets the description of the calculation.

Definition at line 127 of file brabobase.cpp.

void BraboBase::setName const QString  name  ) 
 

Sets the filename prefix of the calculation.

Definition at line 134 of file brabobase.cpp.

void BraboBase::setExtendedFormat const bool  state  ) 
 

Sets the format of the coordinates (normal/extended).

Definition at line 141 of file brabobase.cpp.

void BraboBase::setPVMHosts const QStringList &  hosts  ) 
 

Sets the available PVM hosts.

Definition at line 148 of file brabobase.cpp.

QString BraboBase::method  )  const
 

Returns the method in the form Type(Method)//Basisset.

Definition at line 156 of file brabobase.cpp.

QStringList BraboBase::basissets bool &  ok  ) 
 

Checks whether every atom has a basisset assigned (status returned by ok) and returns a list of basisset files.

This list can then be checked by Calculation as the check might have to be done remotely.

Definition at line 174 of file brabobase.cpp.

QString BraboBase::startVector bool &  prefer,
unsigned int &  size1,
unsigned int &  size2
 

Returns the starting vector file name.

prefer is set to true if an existing starting vector with the right size is preferred over the given startvector. Possible correct sizes for the starting vector are returned in size1 and size2. That is because filesizes are different under *nix and Windows (LF vs. CRLF). The sizes are determined using the following formula: size = NEL x (10 x NCF + ceil(NCF/8)) with NEL = the number of electrons and NCF the number of contracted gaussian functions. Maybe merge this function with basissets() into a calculationInput() function...

Definition at line 227 of file brabobase.cpp.

unsigned int BraboBase::maxIterations  )  const
 

Returns the maximum number of SCF-iterations.

Definition at line 304 of file brabobase.cpp.

QStringList BraboBase::generateInput unsigned int  program  ) 
 

Generates an input file in a stringlist from the contents of the widgets.

Values for the argument program :

Definition at line 314 of file brabobase.cpp.

QString BraboBase::generateAtdens bool &  ok  ) 
 

Returns a custom built atdens file for running STOCK for the provided atoms.

It works similarly to basissets(). It does not check for missing basis set assignment, which should be handled by basissets(). It still quietly returns false in that case. If the result is an empty string, Stock should not be run (similarly to generateInput with BraboBase::STOCK as argument).

Definition at line 706 of file brabobase.cpp.

void BraboBase::loadCML const QDomElement *  root  ) 
 

Reads the widgetdata from a QDomElement.

Definition at line 768 of file brabobase.cpp.

void BraboBase::saveCML QDomElement *  root  ) 
 

Saves the widgetdata to a QDomElement.

Definition at line 1035 of file brabobase.cpp.

void BraboBase::setPreferredBasisset const unsigned int  basisset  )  [static]
 

Sets the preferred basisset.

Definition at line 1178 of file brabobase.cpp.

void BraboBase::reset  )  [slot]
 

Resets all widgets to their default values determined by calcForces = TRUE / FALSE.

Definition at line 1190 of file brabobase.cpp.

void BraboBase::accept  )  [protected, slot]
 

Overridden from BraboWidget::accept().

Saves the current status of the widgets to the WidgetData struct.

Definition at line 1322 of file brabobase.cpp.

void BraboBase::reject  )  [protected, slot]
 

Overridden from BraboWidget::reject().

Restores the widgets from the WidgetData struct.

Definition at line 1345 of file brabobase.cpp.

void BraboBase::showPreview  )  [private, slot]
 

Shows a preview from the widgets.

Definition at line 1363 of file brabobase.cpp.

void BraboBase::readInputFile  )  [private, slot]
 

Reads a Brabo input file into the widgets.

Definition at line 1393 of file brabobase.cpp.

void BraboBase::changed  )  [private, slot]
 

Indicates at least one widget was altered.

Definition at line 1744 of file brabobase.cpp.

void BraboBase::selectWidget QListViewItem *   )  [private, slot]
 

Shows a widget from WidgetStackCategory depending on newItem.

Definition at line 1751 of file brabobase.cpp.

void BraboBase::updateSCFMethodWidgets int  index  )  [private, slot]
 

Updates widgets according to the currently selected SCF method.

Definition at line 1818 of file brabobase.cpp.

void BraboBase::updateSCFTypeWidgets int  index  )  [private, slot]
 

Updates widgets according to the currently selected SCF type.

Definition at line 1856 of file brabobase.cpp.

void BraboBase::selectStartvector  )  [private, slot]
 

Selects a file containing a startvector to be used in the calculation.

Definition at line 1909 of file brabobase.cpp.

void BraboBase::oneBasisset bool  on  )  [private, slot]
 

Enables/disables certain widgets depending on the selection of 1 basisset (true) or multiple basissets (false).

Definition at line 1918 of file brabobase.cpp.

void BraboBase::addBasisset  )  [private, slot]
 

Adds a basisset/atom combination to ListViewBAS, but only if the atom type isn't listed yet.

Definition at line 1933 of file brabobase.cpp.

void BraboBase::removeBasisset  )  [private, slot]
 

Removes the currently selected line from ListViewBAS.

Definition at line 1957 of file brabobase.cpp.

void BraboBase::toggleDIIS bool  on  )  [private, slot]
 

Enables/disables the DIIS options.

Definition at line 1968 of file brabobase.cpp.

void BraboBase::addPVMHost  )  [private, slot]
 

Adds the currently selected host from ListBoxNOTH2 to ListBoxNOTH1.

Checks for duplicates. ListBoxNOTH2 is never changed.

Definition at line 1978 of file brabobase.cpp.

void BraboBase::removePVMHost  )  [private, slot]
 

Removes the currently selected host from ListBoxNOTH1.

Definition at line 1996 of file brabobase.cpp.

void BraboBase::adjustPrintSCF  )  [private, slot]
 

Adjusts the Print SCF Level checkboxes.

Checking a level should check all lower levels too.

Definition at line 2003 of file brabobase.cpp.

void BraboBase::checkOverflowMain int  row,
int  col
[private, slot]
 

Spans cell(row, col) over multiple columns if it contains more than 10 characters.

=> For TableMain

Definition at line 2024 of file brabobase.cpp.

void BraboBase::checkOverflowPVM int  row,
int  col
[private, slot]
 

Spans cell(row, col) over multiple columns if it contains more than 10 characters.

=> For TablePVM

Definition at line 2033 of file brabobase.cpp.

void BraboBase::checkOverflowINTE int  row,
int  col
[private, slot]
 

Spans cell(row, col) over multiple columns if it contains more than 10 characters.

=> For TableINTE

Definition at line 2042 of file brabobase.cpp.

void BraboBase::checkOverflowSCF int  row,
int  col
[private, slot]
 

Spans cell(row, col) over multiple columns if it contains more than 10 characters.

=> For TableINTE

Definition at line 2051 of file brabobase.cpp.

void BraboBase::checkOverflowFORC int  row,
int  col
[private, slot]
 

Spans cell(row, col) over multiple columns if it contains more than 10 characters.

=> For TableFORC

Definition at line 2060 of file brabobase.cpp.

void BraboBase::addRowMain  )  [private, slot]
 

If a row is selected, inserts a row before the selection.

If no row is selected, adds a row at the end. => For TableMain

Definition at line 2069 of file brabobase.cpp.

void BraboBase::addRowPVM  )  [private, slot]
 

If a row is selected, inserts a row before the selection.

If no row is selected, adds a row at the end. => For TablePVM

Definition at line 2078 of file brabobase.cpp.

void BraboBase::addRowINTE  )  [private, slot]
 

If a row is selected, inserts a row before the selection.

If no row is selected, adds a row at the end. => For TableINTE

Definition at line 2087 of file brabobase.cpp.

void BraboBase::addRowSCF  )  [private, slot]
 

If a row is selected, inserts a row before the selection.

If no row is selected, adds a row at the end. => For TableSCF

Definition at line 2096 of file brabobase.cpp.

void BraboBase::addRowFORC  )  [private, slot]
 

If a row is selected, inserts a row before the selection.

If no row is selected, adds a row at the end. => For TableFORC

Definition at line 2105 of file brabobase.cpp.

void BraboBase::removeRowMain  )  [private, slot]
 

Removes the selected rows from TableMain.

Definition at line 2114 of file brabobase.cpp.

void BraboBase::removeRowPVM  )  [private, slot]
 

Removes the selected rows from TablePVM.

Definition at line 2122 of file brabobase.cpp.

void BraboBase::removeRowINTE  )  [private, slot]
 

Removes the selected rows from TableINTE.

Definition at line 2130 of file brabobase.cpp.

void BraboBase::removeRowSCF  )  [private, slot]
 

Removes the selected rows from TableSCF.

Definition at line 2138 of file brabobase.cpp.

void BraboBase::removeRowFORC  )  [private, slot]
 

Removes the selected rows from TableFORC.

Definition at line 2146 of file brabobase.cpp.

void BraboBase::clearSelectionMain  )  [private, slot]
 

Clears the selected cells in TableMain.

Definition at line 2154 of file brabobase.cpp.

void BraboBase::clearSelectionPVM  )  [private, slot]
 

Clears the selected cells in TablePVM.

Definition at line 2162 of file brabobase.cpp.

void BraboBase::clearSelectionINTE  )  [private, slot]
 

Clears the selected cells in TableINTE.

Definition at line 2170 of file brabobase.cpp.

void BraboBase::clearSelectionSCF  )  [private, slot]
 

Clears the selected cells in TableSCF.

Definition at line 2178 of file brabobase.cpp.

void BraboBase::clearSelectionFORC  )  [private, slot]
 

Clears the selected cells in TableFORC.

Definition at line 2186 of file brabobase.cpp.

void BraboBase::makeConnections  )  [private]
 

Sets up the permanent connections. Called once from the constructor.

Definition at line 2199 of file brabobase.cpp.

void BraboBase::init  )  [private]
 

Initializes the dialog.

Called once from the constructor. Connections should be up.

Definition at line 2418 of file brabobase.cpp.

void BraboBase::fillComboBoxes  )  [private]
 

Fills the comboboxes with available basissets and atom types. Called once from init.

Definition at line 2573 of file brabobase.cpp.

void BraboBase::saveWidgets  )  [private]
 

Saves the status of the widgets to a WidgetData struct.

Definition at line 2591 of file brabobase.cpp.

void BraboBase::restoreWidgets  )  [private]
 

Restores the status of the widgets from a WidgetData struct.

Definition at line 2744 of file brabobase.cpp.

QStringList BraboBase::parsedNUCLlines  )  [private]
 

Returns a stringlist containing input lines for Brabo constructed from the NUCL options.

Definition at line 2894 of file brabobase.cpp.

void BraboBase::buildAtdens  )  [private]
 

Generates atomic density basis set files for each atom of each basis set using atomic SCF.

Warning:
This routine is only to be used during development and never during normal operation. Maybe move it into a separate application...

Definition at line 2928 of file brabobase.cpp.


Member Data Documentation

bool BraboBase::calcForces [private]
 

= true if forces should be calculated

Definition at line 415 of file brabobase.h.

QString BraboBase::calcDescription [private]
 

contains the description

Definition at line 416 of file brabobase.h.

QString BraboBase::calcName [private]
 

contains the filename prefix

Definition at line 417 of file brabobase.h.

bool BraboBase::calcXF [private]
 

= true if extended format is to be used

Definition at line 419 of file brabobase.h.

WidgetData BraboBase::data [private]
 

contains the status of all widgets

Definition at line 421 of file brabobase.h.

bool BraboBase::widgetChanged [private]
 

is set when any of the widgets change

Definition at line 422 of file brabobase.h.

vector<QString> BraboBase::category [private]
 

Contains translatable names for the items in ListViewCategories.

Definition at line 423 of file brabobase.h.

AtomSet* BraboBase::atoms [private]
 

A pointer to the AtomSet.

Definition at line 424 of file brabobase.h.

QStringList BraboBase::pvmHosts = QStringList() [static, private]
 

The list of available PVM hosts.

Definition at line 427 of file brabobase.h.

unsigned int BraboBase::preferredBasisset = 0 [static, private]
 

The preferred basisset.

Definition at line 428 of file brabobase.h.

const BraboBase::XMLData BraboBase::xml [static, private]
 

Contains the XML dictRef values for all WidgetData.

Definition at line 429 of file brabobase.h.


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