#include <calculation.h>
It assembles and writes the needed input files and calls the right programs at the right times or sets up a script file to do the work. Results are read and signalled to the host class XbraboView.
Single Point Energy / Energy & Forces -------------------------------------
Geometry Optimization ---------------------
Definition at line 43 of file calculation.h.
Public Types | |
enum | Errors { NoError, UndefinedError, NoConvergence, CloseNuclei, MaxCyclesExceeded, ManualStop } |
Signals | |
void | newIteration (unsigned int, double) |
Is emitted when a new SCF iteration is completed. | |
void | newCycle (unsigned int) |
Is emitted when a new optimization cycle is started. | |
void | updated () |
Is emitted when the AtomSet is updatd with new coordinates and properties. | |
void | finished (unsigned int error) |
Is emitted when the calculation is finished. | |
void | modified () |
Is emitted when the calculation is modified and needs to be saved. | |
Public Member Functions | |
Calculation (AtomSet *atomset, QWidget *parent=0, const char *name=0) | |
~Calculation () | |
The default destructor. | |
bool | start () |
Starts the calculation. | |
bool | pause () |
Pauses the calculation. | |
bool | stop () |
Stops the calculation. | |
void | setModified (const bool status=true) |
Sets the 'modified' status of the calculation. | |
void | setBraboInput (const QStringList stdInput, const QStringList basissets, const QString startVector, const bool preferStartVector, const unsigned int startVectorSize1, const unsigned int startVectorSize2) |
Updates the contents of the standard input for BRABO. | |
void | setStockInput (const QStringList stin, const QString atdens=QString::null) |
Updates the contents of the input file for STOCK. | |
void | setRelaxInput (const QStringList aff, const QStringList maff, const unsigned int updateFreq, const unsigned int maxSteps, const std::vector< unsigned int > &steps, const std::vector< double > &factors) |
Updates the contents of the input file for RELAX. | |
void | setCalculationType (const unsigned int type, const unsigned int buur) |
Sets the type of calculation to be performed. | |
void | setParameters (const QString name, const QString dir, const bool format) |
Sets the global calculation parameters. | |
void | setBackup (const unsigned int freq, const bool brabo=false, const bool stock=false, const bool relax=false, const bool aff=false, const bool crd=false) |
Sets the backup frequency and which outputs should be backed up at one step. | |
void | setContinuable (const bool status) |
Updates whether an optimization can be continued after it has been stopped. | |
bool | isRunning () const |
Returns whether or not the calculation is running. | |
bool | isPaused () const |
Returns whether or not the calculation is paused. | |
void | getRefinementParameters (bool &largestCart, bool &magnCart, bool &largestInt, bool &magnInt, bool &largestShift) |
Returns the 5 refinement criteria for the latest optimization cycle. | |
void | getAvailableOutputs (std::vector< unsigned int > &cycles, std::vector< bool > &brabo, std::vector< bool > &stock, std::vector< bool > &relax, std::vector< bool > &aff) |
Returns the cycles for which outputs are available. | |
QStringList | braboOutput (const unsigned int step=0) |
Returns the output from Brabo for a certain step. | |
QStringList | stockOutput (const unsigned int step=0) |
Returns the output from Stock for a certain step. | |
QStringList | relaxOutput (const unsigned int step=0) |
Returns the output from Relax for a certain step. | |
QStringList | affOutput (const unsigned int step=0) |
Returns the AFF file for a certain step. | |
void | loadCML (const QDomElement *root) |
Loads the settings from file. | |
void | saveCML (QDomElement *root) |
Saves the settings to file. | |
void | writeInput () |
Writes all input files. | |
void | clean () |
Cleans up the calculation directory. | |
Private Types | |
enum | CalculationStep { NEW_CYCLE, ACHAR, BRABO, BUUR, CNVRTAFF, DISTOR, FORKON, MAFF, RELAX, STOCK, UPDATE } |
Private Slots | |
void | finishBrabo () |
Does the cleanup of a BRABO run. | |
void | readStdOutBrabo () |
Reads the output from Brabo. | |
void | finishStock () |
Does the cleanup of a STOCK run. | |
void | finishMAFF () |
Does the cleanup of a MAFF run. | |
void | finishCnvrtAFF () |
Does the cleanup of a CNVRTAFF run. | |
void | finishRelax () |
Does the cleanup of a RELAX run. | |
void | readStdOutAll () |
Reads the output from the running process without checking or parsing. | |
Private Member Functions | |
bool | checkBasissets () |
Checks whether all basissets given in basissetList exist. | |
bool | checkExecutables () |
Checks whether all needed executables are present. | |
bool | makeDirCurrent (const QString dir, const QString title) |
Makes dir the current directory. | |
bool | copyStartVector () |
Copies the starting vector to the calculation directory. | |
void | doNextStep () |
Starts the next step of a calculation. | |
void | runBrabo () |
Starts a BRABO run. | |
void | runStock () |
Starts a STOCK run. | |
void | runMAFF () |
Starts a MAFF run. | |
void | runCnvrtAFF () |
Starts a CNVRTAFF run. | |
void | runRelax () |
Starts a RELAX run. | |
void | runCleanup () |
Wraps up a calculation. | |
void | runUpdate () |
Commits changes to the AtomSet. | |
double | scaleFactor (const unsigned int step) |
Returns the scale factor corresponding to the optimization step. | |
void | backupOutputs () |
Makes a backup of output files depending on the backup frequency. | |
bool | copyFile (const QString source, const QString destination) |
Does a blocking copy of source to destination . | |
QStringList | output (const QString extension, const unsigned int step=0) |
Returns the output from a file with the given extension for a certain step. | |
std::vector< double > | loadFromPunch (const QString code, const unsigned int numValues, const unsigned int fieldSize, const unsigned int fieldsPerLine) |
Reads data from the punch file in fixed format. | |
Private Attributes | |
AtomSet * | atoms |
The atomset that is to be modified. | |
QWidget * | parentWidget |
needed for showing properly positioned messageboxes | |
QStringList | braboInput |
The standard input fed to BRABO. | |
QStringList | stockInput |
The contents of the stdin file for STOCK. | |
QStringList | relaxInput |
The aff (header) file. | |
QStringList | maffInput |
The standard input fed to MAFF. | |
QStringList | basissetList |
The list of basissets used for the calculation. | |
QString | startVectorFile |
The file containing a starting vector that should be copied to the calculation directory. | |
QString | atdensFile |
The contents of the atomic density file needed for STOCK. | |
unsigned int | affUpdateFreq |
The update frequency for the AFF file (0 = no update). | |
unsigned int | calculationType |
The type of calculation (SP, GeomOpt, Freq). | |
unsigned int | crystalType |
The type of crystal to be generated (none, PC, SM). | |
bool | updateBraboInput |
= true if braboInput contains an updated input file | |
bool | updateStockInput |
= true if stockInput contains an updated input file | |
bool | updateRelaxInput |
= true if relaxInput contains an updated input file | |
bool | doBasissetCheck |
= true if a check should be made whether the basissets listed in basissetList exist. | |
bool | copyAtdens |
= true if atdensFile contains updated atomic densities | |
bool | calcRunning |
= true if the calculation is running | |
bool | calcPaused |
= true if the calculation is in paused mode | |
QString | calcName |
The basename from which all input filenames are constructed. | |
QString | calcDir |
The calculation directory. | |
QProcess * | calcProcess |
The process used for running all BRABO applications. | |
unsigned int | calcMaxCycle |
The maximum number of optimization cycles. | |
bool | calcXF |
Normal (false) or Extended format (true) for the CRD file. | |
unsigned int | currentCycle |
The current optimization cycle. | |
bool | calcSuccess |
Indicates whether the calculation ended successfully. | |
std::list< CalculationStep > | calculationSteps |
The list of steps that are to be carried out in a calculation. | |
std::vector< unsigned int > | scaleSteps |
Info needed to determine the RELAX scale factor. | |
std::vector< double > | scaleFactors |
Info needed to determine the RELAX scale factor. | |
bool | stopRequested |
A flag indicating a request for stopping the calculation after the current step was made. | |
unsigned int | backupFrequency |
The frequency with which outputs should be backed up. Zero is no backup. | |
bool | backupBrabo |
If true, the Brabo outputs will be backed up. | |
bool | backupStock |
If true, the Stock outputs will be backed up. | |
bool | backupRelax |
If true, the Relax outputs will be backed up. | |
bool | backupAFF |
If true, the AFF files will be backed up. | |
bool | backupCRD |
If true, the CRD files will be backed up. | |
bool | calcModified |
Contains the 'modified' status of the calculation. | |
unsigned int | calcError |
Contains any error that occurred during the calculation. | |
bool | calcContinuable |
Determines whether an optimization can be continued when it is restarted. |
|
Definition at line 53 of file calculation.h. |
|
Definition at line 104 of file calculation.h. |
|
Definition at line 78 of file calculation.cpp. |
|
The default destructor.
Definition at line 111 of file calculation.cpp. |
|
Starts the calculation. If certain prerequisites are not fulfilled, this function returns false and the calculation will not be started. Definition at line 118 of file calculation.cpp. |
|
Pauses the calculation. If the calculation is running, it will be paused before the start of the next program or step. This function will return false if the calculation consists of only one step or when the calculation is not running. Definition at line 226 of file calculation.cpp. |
|
Stops the calculation. A dialog is popped up asking whether the calculation should be stopped immediately or at the start of the next program or step. It returns false of the calculation is not running or the dialog is cancelled.
Definition at line 250 of file calculation.cpp. |
|
Sets the 'modified' status of the calculation.
Definition at line 292 of file calculation.cpp. |
|
Updates the contents of the standard input for BRABO.
The new input is used for the next invocation of the program, also when the calculation is already running. If Definition at line 301 of file calculation.cpp. |
|
Updates the contents of the input file for STOCK.
The new input is used for the next invocation of the program, also when the calculation is already running. If Definition at line 386 of file calculation.cpp. |
|
Updates the contents of the input file for RELAX. The new input is used for the next invocation of the program, also when the calculation is already running.
Definition at line 406 of file calculation.cpp. |
|
Sets the type of calculation to be performed.
Definition at line 441 of file calculation.cpp. |
|
Sets the global calculation parameters.
Definition at line 456 of file calculation.cpp. |
|
Sets the backup frequency and which outputs should be backed up at one step.
Definition at line 465 of file calculation.cpp. |
|
Updates whether an optimization can be continued after it has been stopped.
Definition at line 481 of file calculation.cpp. |
|
Returns whether or not the calculation is running.
Definition at line 488 of file calculation.cpp. |
|
Returns whether or not the calculation is paused.
Definition at line 495 of file calculation.cpp. |
|
Returns the 5 refinement criteria for the latest optimization cycle. The parameters are read from the calcName.aou file. If it is incomplete false is returned for each criterium. Definition at line 502 of file calculation.cpp. |
|
Returns the cycles for which outputs are available.
Definition at line 537 of file calculation.cpp. |
|
Returns the output from Brabo for a certain step. If the step is zero, the latest output is returned (possibly not saved). Definition at line 573 of file calculation.cpp. |
|
Returns the output from Stock for a certain step. If the step is zero, the latest output is returned (possibly not saved). Definition at line 581 of file calculation.cpp. |
|
Returns the output from Relax for a certain step. If the step is zero, the latest output is returned (possibly not saved). Definition at line 589 of file calculation.cpp. |
|
Returns the AFF file for a certain step. If the step is zero, the latest version is returned (possibly not saved). Definition at line 597 of file calculation.cpp. |
|
Loads the settings from file.
Definition at line 605 of file calculation.cpp. |
|
Saves the settings to file.
Definition at line 674 of file calculation.cpp. |
|
Writes all input files. This is only needed in case the calculation is to be run outside of this program. When this function is called, all input should already be present in the proper QStringLists. Definition at line 695 of file calculation.cpp. |
|
Cleans up the calculation directory.
Definition at line 779 of file calculation.cpp. |
|
Is emitted when a new SCF iteration is completed.
|
|
Is emitted when a new optimization cycle is started.
|
|
Is emitted when the AtomSet is updatd with new coordinates and properties.
|
|
Is emitted when the calculation is finished.
|
|
Is emitted when the calculation is modified and needs to be saved.
|
|
Does the cleanup of a BRABO run.
Definition at line 825 of file calculation.cpp. |
|
Reads the output from Brabo.
Definition at line 862 of file calculation.cpp. |
|
Does the cleanup of a STOCK run.
Definition at line 898 of file calculation.cpp. |
|
Does the cleanup of a MAFF run.
Definition at line 949 of file calculation.cpp. |
|
Does the cleanup of a CNVRTAFF run.
Definition at line 983 of file calculation.cpp. |
|
Does the cleanup of a RELAX run.
It fills the AtomSet Definition at line 1043 of file calculation.cpp. |
|
Reads the output from the running process without checking or parsing.
Definition at line 1137 of file calculation.cpp. |
|
Checks whether all basissets given in
Definition at line 1154 of file calculation.cpp. |
|
Checks whether all needed executables are present.
Definition at line 1179 of file calculation.cpp. |
|
Makes
If it doesn't exist, it will be created. Shows a messagebox with the error and Definition at line 1219 of file calculation.cpp. |
|
Copies the starting vector to the calculation directory.
Definition at line 1241 of file calculation.cpp. |
|
Starts the next step of a calculation.
It reads it from the first element of Definition at line 1264 of file calculation.cpp. |
|
Starts a BRABO run. The latest input is always used in case of Xbrabo-control but it might have to be updated for other runtypes. Definition at line 1382 of file calculation.cpp. |
|
Starts a STOCK run.
Definition at line 1430 of file calculation.cpp. |
|
Starts a MAFF run.
Definition at line 1484 of file calculation.cpp. |
|
Starts a CNVRTAFF run.
Definition at line 1499 of file calculation.cpp. |
|
Starts a RELAX run.
Definition at line 1517 of file calculation.cpp. |
|
Wraps up a calculation.
Definition at line 1550 of file calculation.cpp. |
|
Commits changes to the AtomSet. It updates the coordinates in case of the !first step of a geometry optimization and possibly updates the forces, Mulliken and/or Stockholder charges. Definition at line 1562 of file calculation.cpp. |
|
Returns the scale factor corresponding to the optimization step.
Definition at line 1602 of file calculation.cpp. |
|
Makes a backup of output files depending on the backup frequency. If an error is encountered, this function will not interrupt the calculation in any way. Definition at line 1624 of file calculation.cpp. |
|
Does a blocking copy of It returns whether it succeeded. As it reads the complete file in memory, this is not useful for large files. Definition at line 1649 of file calculation.cpp. |
|
Returns the output from a file with the given extension for a certain step. If the step is zero, the latest output is returned (possibly not saved). Definition at line 1666 of file calculation.cpp. |
|
Reads data from the punch file in fixed format.
Definition at line 1689 of file calculation.cpp. |
|
The atomset that is to be modified.
Definition at line 126 of file calculation.h. |
|
needed for showing properly positioned messageboxes
Definition at line 127 of file calculation.h. |
|
The standard input fed to BRABO.
Definition at line 128 of file calculation.h. |
|
The contents of the stdin file for STOCK.
Definition at line 129 of file calculation.h. |
|
The aff (header) file.
Definition at line 130 of file calculation.h. |
|
The standard input fed to MAFF.
Definition at line 131 of file calculation.h. |
|
The list of basissets used for the calculation.
Definition at line 132 of file calculation.h. |
|
The file containing a starting vector that should be copied to the calculation directory.
Definition at line 133 of file calculation.h. |
|
The contents of the atomic density file needed for STOCK.
Definition at line 134 of file calculation.h. |
|
The update frequency for the AFF file (0 = no update).
Definition at line 135 of file calculation.h. |
|
The type of calculation (SP, GeomOpt, Freq).
Definition at line 136 of file calculation.h. |
|
The type of crystal to be generated (none, PC, SM).
Definition at line 137 of file calculation.h. |
|
= true if
Definition at line 138 of file calculation.h. |
|
= true if
Definition at line 139 of file calculation.h. |
|
= true if
Definition at line 140 of file calculation.h. |
|
= true if a check should be made whether the basissets listed in
Definition at line 141 of file calculation.h. |
|
= true if
Definition at line 142 of file calculation.h. |
|
= true if the calculation is running
Definition at line 143 of file calculation.h. |
|
= true if the calculation is in paused mode
Definition at line 144 of file calculation.h. |
|
The basename from which all input filenames are constructed.
Definition at line 145 of file calculation.h. |
|
The calculation directory.
Definition at line 146 of file calculation.h. |
|
The process used for running all BRABO applications.
Definition at line 147 of file calculation.h. |
|
The maximum number of optimization cycles.
Definition at line 148 of file calculation.h. |
|
Normal (false) or Extended format (true) for the CRD file.
Definition at line 149 of file calculation.h. |
|
The current optimization cycle.
Definition at line 150 of file calculation.h. |
|
Indicates whether the calculation ended successfully.
Definition at line 151 of file calculation.h. |
|
The list of steps that are to be carried out in a calculation.
Definition at line 152 of file calculation.h. |
|
Info needed to determine the RELAX scale factor.
Definition at line 153 of file calculation.h. |
|
Info needed to determine the RELAX scale factor.
Definition at line 154 of file calculation.h. |
|
A flag indicating a request for stopping the calculation after the current step was made.
Definition at line 155 of file calculation.h. |
|
The frequency with which outputs should be backed up. Zero is no backup.
Definition at line 156 of file calculation.h. |
|
If true, the Brabo outputs will be backed up.
Definition at line 157 of file calculation.h. |
|
If true, the Stock outputs will be backed up.
Definition at line 158 of file calculation.h. |
|
If true, the Relax outputs will be backed up.
Definition at line 159 of file calculation.h. |
|
If true, the AFF files will be backed up.
Definition at line 160 of file calculation.h. |
|
If true, the CRD files will be backed up.
Definition at line 161 of file calculation.h. |
|
Contains the 'modified' status of the calculation.
Definition at line 162 of file calculation.h. |
|
Contains any error that occurred during the calculation.
Definition at line 163 of file calculation.h. |
|
Determines whether an optimization can be continued when it is restarted.
Definition at line 164 of file calculation.h. |