Generic molecule object. More...
#include <globalsearch/structure.h>
Public Types | |
enum | State { Optimized = 0, StepOptimized, WaitingForOptimization, InProcess, Empty, Updating, Error, Submitted, Killed, Removed, Duplicate, Restart, Preoptimizing } |
Public Slots | |
virtual void | setupConnections () |
virtual void | enableAutoHistogramGeneration (bool) |
virtual void | requestHistogramGeneration () |
virtual void | generateDefaultHistogram () |
virtual void | structureChanged () |
static bool | compareIADDistributions (const std::vector< double > &d, const std::vector< double > &f1, const std::vector< double > &f2, double decay, double smear, double *error) |
static bool | compareIADDistributions (const QList< double > &d, const QList< double > &f1, const QList< double > &f2, double decay, double smear, double *error) |
static bool | compareIADDistributions (const QList< QVariant > &d, const QList< QVariant > &f1, const QList< QVariant > &f2, double decay, double smear, double *error) |
virtual void | writeSettings (const QString &filename) |
virtual void | readSettings (const QString &filename) |
virtual void | updateAndSkipHistory (const QList< unsigned int > &atomicNums, const QList< Eigen::Vector3d > &coords, const double energy=0, const double enthalpy=0, const Eigen::Matrix3d &cell=Eigen::Matrix3d::Zero()) |
virtual void | updateAndAddToHistory (const QList< unsigned int > &atomicNums, const QList< Eigen::Vector3d > &coords, const double energy=0, const double enthalpy=0, const Eigen::Matrix3d &cell=Eigen::Matrix3d::Zero()) |
virtual void | deleteFromHistory (unsigned int index) |
virtual void | retrieveHistoryEntry (unsigned int index, QList< unsigned int > *atomicNums, QList< Eigen::Vector3d > *coords, double *energy, double *enthalpy, Eigen::Matrix3d *cell) |
virtual unsigned int | sizeOfHistory () |
void | setHasBestOffspring (bool b=true) |
void | setEnthalpy (double enthalpy) |
void | setPV (double pv) |
void | resetEnthalpy () |
void | resetEnergy () |
void | setOBEnergy (const QString &ff=QString("UFF")) |
void | setRank (uint rank) |
void | setJobID (uint id) |
void | setGeneration (uint gen) |
void | setIDNumber (uint id) |
void | setIndex (int index) |
void | setParents (const QString &p) |
void | setRempath (const QString &p) |
void | setStatus (State status) |
void | setCurrentOptStep (uint i) |
void | setFailCount (uint count) |
void | resetFailCount () |
void | addFailure () |
void | setDuplicateString (const QString &s) |
void | setChangedSinceDupChecked (bool b) |
void | startOptTimer () |
void | stopOptTimer () |
void | setOptTimerStart (const QDateTime &d) |
void | setOptTimerEnd (const QDateTime &d) |
virtual void | setNeedsPreoptimization (bool b) |
virtual void | abortPreoptimization () const |
void | emitPreoptimizationStarted () |
void | emitPreoptimizationFinished () |
virtual void | load (QTextStream &in) |
Signals | |
void | preoptimizationStarted () |
void | preoptimizationFinished () |
Public Member Functions | |
Structure (QObject *parent=0) | |
Structure (const Structure &other) | |
Structure (const Avogadro::Molecule &other) | |
virtual | ~Structure () |
Structure & | operator= (const Structure &other) |
Structure & | operator= (const Avogadro::Molecule &other) |
virtual Structure & | copyStructure (const Structure &other) |
bool | hasBestOffspring () const |
bool | hasEnthalpy () const |
double | getEnergy () const |
double | getEnthalpy () const |
double | getPV () const |
uint | getRank () const |
uint | getJobID () const |
uint | getGeneration () const |
uint | getIDNumber () const |
int | getIndex () const |
QString | getDuplicateString () const |
QString | getParents () const |
QString | getRempath () const |
State | getStatus () const |
uint | getCurrentOptStep () |
virtual bool | isPreoptimizing () const |
virtual int | getPreOptProgress () const |
virtual bool | needsPreoptimization () const |
uint | getFailCount () |
QDateTime | getOptTimerStart () const |
QDateTime | getOptTimerEnd () const |
QString | getIDString () const |
virtual QString | getResultsHeader () const |
virtual QString | getResultsEntry () const |
QHash< int, int > * | getOptimizerLookupTable () |
void | resetOptimizerLookupTable () |
virtual bool | getNearestNeighborDistances (QList< double > *list) const |
virtual bool | getShortestInteratomicDistance (double &shortest) const |
virtual bool | getNearestNeighborDistance (const double x, const double y, const double z, double &shortest) const |
virtual bool | getNearestNeighborDistance (const Avogadro::Atom *atom, double &shortest) const |
QList< Avogadro::Atom * > | getNeighbors (const double x, const double y, const double z, const double cutoff, QList< double > *distances=0) const |
QList< Avogadro::Atom * > | getNeighbors (const Avogadro::Atom *atom, const double cutoff, QList< double > *distances=0) const |
virtual void | getDefaultHistogram (QList< double > *dist, QList< double > *freq) const |
virtual void | getDefaultHistogram (QList< QVariant > *dist, QList< QVariant > *freq) const |
virtual bool | isHistogramGenerationPending () const |
virtual bool | generateIADHistogram (QList< double > *distance, QList< double > *frequency, double min=0.0, double max=10.0, double step=0.01, Avogadro::Atom *atom=0) const |
virtual bool | generateIADHistogram (QList< QVariant > *distance, QList< QVariant > *frequency, double min=0.0, double max=10.0, double step=0.01, Avogadro::Atom *atom=0) const |
virtual bool | addAtomRandomly (uint atomicNumber, double minIAD=0.0, double maxIAD=0.0, int maxAttempts=1000, Avogadro::Atom **atom=0) |
QList< QString > | getSymbols () const |
QList< uint > | getNumberOfAtomsAlpha () const |
QString | getOptElapsed () const |
virtual QHash< QString, QVariant > | getFingerprint () const |
bool | hasChangedSinceDupChecked () |
Static Public Member Functions | |
static void | sortByEnthalpy (QList< Structure * > *structures) |
static void | rankByEnthalpy (const QList< Structure * > &structures) |
static void | sortAndRankByEnthalpy (QList< Structure * > *structures) |
Protected Slots | |
void | writeStructureSettings (const QString &filename) |
void | readStructureSettings (const QString &filename) |
Generic molecule object.
The Structure class provides a generic data object for storing information about a molecule. It derives from Avogadro::Molecule, adding new functionality to help with common tasks during a global structure search.
Definition at line 49 of file structure.h.
Enum containing possible optimization statuses.
Optimized |
Structure has completed all optimization steps |
StepOptimized |
Structure has completed an optimization step but may still have some to complete. getCurrentOptStep() shows the step that has just completed. |
WaitingForOptimization |
Structure is waiting to start an optimization step. getCurrentOptStep() shows the step it will start next. |
InProcess |
Structure is currently queued or running an optimization step on the PBS server (if applicable). |
Empty |
Structure has just been generated, and has not yet been initialized |
Updating |
The Structure has completed it's current optimization step, and the results of the calculation are being transferred and applied. |
Error |
The optimization is failing. |
Submitted |
The Structure has been submitted to the PBS server, but has not appeared in the queue yet. |
Killed |
The Structure has been killed before finishing all optimization steps. |
Removed |
The Structure has been killed after finishing all optimization steps. |
Duplicate |
The Structure has been found to be a duplicate of another. The other structure's information can be found in getDuplicateString(). |
Restart |
The Structure is about to restart it's current optimization step. |
Preoptimizing |
The Structure is undergoing a preoptimization step. |
Definition at line 103 of file structure.h.
GlobalSearch::Structure::Structure | ( | QObject * | parent = 0 |
) |
Constructor.
parent | The object parent. |
Definition at line 42 of file structure.cpp.
References Empty, resetFailCount(), and setStatus().
GlobalSearch::Structure::Structure | ( | const Structure & | other | ) |
Copy constructor.
Definition at line 62 of file structure.cpp.
GlobalSearch::Structure::Structure | ( | const Avogadro::Molecule & | other | ) |
Explicit copy constructor for Molecules.
Definition at line 79 of file structure.cpp.
GlobalSearch::Structure::~Structure | ( | ) | [virtual] |
Destructor.
Definition at line 192 of file structure.cpp.
virtual void GlobalSearch::Structure::abortPreoptimization | ( | ) | const [inline, virtual, slot] |
Abort the preoptimization running on this structure.
Definition at line 1098 of file structure.h.
Referenced by GlobalSearch::QueueManager::stopJob(), and GlobalSearch::QueueManager::~QueueManager().
virtual bool GlobalSearch::Structure::addAtomRandomly | ( | uint | atomicNumber, | |
double | minIAD = 0.0 , |
|||
double | maxIAD = 0.0 , |
|||
int | maxAttempts = 1000 , |
|||
Avogadro::Atom ** | atom = 0 | |||
) | [virtual] |
Add an atom to a random position in the Structure. If no other atoms exist in the Structure, the new atom is placed at (0,0,0).
atomicNumber | Atomic number of atom to add. | |
minIAD | Smallest interatomic distance allowed (NULL or omit for no limit) | |
maxIAD | Largest interatomic distance allowed (NULL or omit for no limit) | |
maxAttempts | Maximum number of tries before giving up. | |
atom | Returns a pointer to the new atom. |
void GlobalSearch::Structure::addFailure | ( | ) | [inline, slot] |
Increase the number of times this Structure has failed the current optimization step by one.
Definition at line 1019 of file structure.h.
References getFailCount(), and setFailCount().
bool GlobalSearch::Structure::compareIADDistributions | ( | const QList< QVariant > & | d, | |
const QList< QVariant > & | f1, | |||
const QList< QVariant > & | f2, | |||
double | decay, | |||
double | smear, | |||
double * | error | |||
) | [static, slot] |
Compare two IAD histograms.
Given two histograms over the same range with the same step, this function calculates an error value to measure the differences between the two. A boxcar smoothing is performed using a width of "smear", and an optional weight can be applied. The weight is a standard exponential decay with a halflife of "decay".
d | List of distances | |
f1 | First list of frequencies | |
f2 | Second list of frequencies | |
decay | Exponential decay parameter for lowering weight of large IADs | |
smear | Boxcar smoothing width in Angstroms | |
error | Return error value |
Definition at line 1109 of file structure.cpp.
References compareIADDistributions().
bool GlobalSearch::Structure::compareIADDistributions | ( | const QList< double > & | d, | |
const QList< double > & | f1, | |||
const QList< double > & | f2, | |||
double | decay, | |||
double | smear, | |||
double * | error | |||
) | [static, slot] |
Compare two IAD histograms.
Given two histograms over the same range with the same step, this function calculates an error value to measure the differences between the two. A boxcar smoothing is performed using a width of "smear", and an optional weight can be applied. The weight is a standard exponential decay with a halflife of "decay".
d | List of distances | |
f1 | First list of frequencies | |
f2 | Second list of frequencies | |
decay | Exponential decay parameter for lowering weight of large IADs | |
smear | Boxcar smoothing width in Angstroms | |
error | Return error value |
Definition at line 1088 of file structure.cpp.
References compareIADDistributions().
bool GlobalSearch::Structure::compareIADDistributions | ( | const std::vector< double > & | d, | |
const std::vector< double > & | f1, | |||
const std::vector< double > & | f2, | |||
double | decay, | |||
double | smear, | |||
double * | error | |||
) | [static, slot] |
Compare two IAD histograms.
Given two histograms over the same range with the same step, this function calculates an error value to measure the differences between the two. A boxcar smoothing is performed using a width of "smear", and an optional weight can be applied. The weight is a standard exponential decay with a halflife of "decay".
d | List of distances | |
f1 | First list of frequencies | |
f2 | Second list of frequencies | |
decay | Exponential decay parameter for lowering weight of large IADs | |
smear | Boxcar smoothing width in Angstroms | |
error | Return error value |
Definition at line 1017 of file structure.cpp.
Referenced by compareIADDistributions().
Only update this structure's atoms, bonds, and residue information from other.
Definition at line 228 of file structure.cpp.
References operator=().
Referenced by operator=().
void GlobalSearch::Structure::deleteFromHistory | ( | unsigned int | index | ) | [virtual, slot] |
index | Index of entry to remove from structure's history. |
Definition at line 597 of file structure.cpp.
References sizeOfHistory().
void GlobalSearch::Structure::emitPreoptimizationFinished | ( | ) | [inline, slot] |
Emits the preoptimizationFinished signal
Definition at line 1107 of file structure.h.
void GlobalSearch::Structure::emitPreoptimizationStarted | ( | ) | [inline, slot] |
Emits the preoptimizationStarted signal
Definition at line 1101 of file structure.h.
void GlobalSearch::Structure::enableAutoHistogramGeneration | ( | bool | b | ) | [virtual, slot] |
Set whether the default histogram generation should be performed (default is off)
Definition at line 135 of file structure.cpp.
References requestHistogramGeneration().
void GlobalSearch::Structure::generateDefaultHistogram | ( | ) | [virtual, slot] |
Generate default histogram data (0:10 A, 0.01 A step)
Definition at line 852 of file structure.cpp.
References generateIADHistogram().
Referenced by requestHistogramGeneration().
bool GlobalSearch::Structure::generateIADHistogram | ( | QList< QVariant > * | distance, | |
QList< QVariant > * | frequency, | |||
double | min = 0.0 , |
|||
double | max = 10.0 , |
|||
double | step = 0.01 , |
|||
Avogadro::Atom * | atom = 0 | |||
) | const [virtual] |
Generate data for a histogram of the distances between all atoms, or between one atom and all others.
If the parameter atom is specified, the resulting data will represent the distance distribution between that atom and all others. If omitted (or NULL), a histogram of all interatomic distances is calculated.
Useful for estimating the coordination number of an atom from a plot.
distance | List of distance values for the histogram bins. | |
frequency | Number of Atoms within the corresponding distance bin. | |
min | Value of starting histogram distance. | |
max | Value of ending histogram distance. | |
step | Increment between bins. | |
atom | Optional: Atom to calculate distances from. |
Definition at line 948 of file structure.cpp.
bool GlobalSearch::Structure::generateIADHistogram | ( | QList< double > * | distance, | |
QList< double > * | frequency, | |||
double | min = 0.0 , |
|||
double | max = 10.0 , |
|||
double | step = 0.01 , |
|||
Avogadro::Atom * | atom = 0 | |||
) | const [virtual] |
Generate data for a histogram of the distances between all atoms, or between one atom and all others.
If the parameter atom is specified, the resulting data will represent the distance distribution between that atom and all others. If omitted (or NULL), a histogram of all interatomic distances is calculated.
Useful for estimating the coordination number of an atom from a plot.
distance | List of distance values for the histogram bins. | |
frequency | Number of Atoms within the corresponding distance bin. | |
min | Value of starting histogram distance. | |
max | Value of ending histogram distance. | |
step | Increment between bins. | |
atom | Optional: Atom to calculate distances from. |
Definition at line 874 of file structure.cpp.
Referenced by generateDefaultHistogram().
uint GlobalSearch::Structure::getCurrentOptStep | ( | ) | [inline] |
Definition at line 287 of file structure.h.
Referenced by GlobalSearch::Optimizer::getInterpretedTemplates(), GlobalSearch::OptBase::interpretKeyword_base(), GlobalSearch::QueueManager::startJob(), and writeStructureSettings().
void GlobalSearch::Structure::getDefaultHistogram | ( | QList< QVariant > * | dist, | |
QList< QVariant > * | freq | |||
) | const [virtual] |
Get the default histogram data.
Definition at line 868 of file structure.cpp.
void GlobalSearch::Structure::getDefaultHistogram | ( | QList< double > * | dist, | |
QList< double > * | freq | |||
) | const [virtual] |
Get the default histogram data.
Definition at line 858 of file structure.cpp.
QString GlobalSearch::Structure::getDuplicateString | ( | ) | const [inline] |
Definition at line 265 of file structure.h.
double GlobalSearch::Structure::getEnergy | ( | ) | const [inline] |
Return the energy value of the first conformer in eV. This is a convenience function.
Definition at line 178 of file structure.h.
Referenced by getEnthalpy().
double GlobalSearch::Structure::getEnthalpy | ( | ) | const [inline] |
Return the enthalpy value of the first conformer in eV.
Definition at line 194 of file structure.h.
References getEnergy().
Referenced by getFingerprint(), GlobalSearch::OptBase::getProbabilityList(), getResultsEntry(), rankByEnthalpy(), and sortByEnthalpy().
uint GlobalSearch::Structure::getFailCount | ( | ) | [inline] |
Definition at line 306 of file structure.h.
Referenced by addFailure(), GlobalSearch::QueueManager::checkPopulation(), and writeStructureSettings().
QHash< QString, QVariant > GlobalSearch::Structure::getFingerprint | ( | ) | const [virtual] |
A "fingerprint" hash of the structure. Returns "enthalpy" key with the enthalpy value as a double wrapped in a QVariant. May be extended in derived classes.
Used for checking if two Structures are similar enough to be marked as duplicates.
Definition at line 1232 of file structure.cpp.
References getEnthalpy().
uint GlobalSearch::Structure::getGeneration | ( | ) | const [inline] |
Returns the generation number of the structure. Only useful for genetic/evolutionary algorithms.
Definition at line 232 of file structure.h.
Referenced by getIDString(), getResultsEntry(), GlobalSearch::OptBase::interpretKeyword_base(), and writeStructureSettings().
uint GlobalSearch::Structure::getIDNumber | ( | ) | const [inline] |
Returns an ID number associated with the Structure.
Definition at line 246 of file structure.h.
Referenced by getIDString(), getResultsEntry(), GlobalSearch::OptBase::interpretKeyword_base(), and writeStructureSettings().
QString GlobalSearch::Structure::getIDString | ( | ) | const [inline] |
Returns a unique identification string. Defaults to [generation]x[IDNumber]. Handy for debugging/error output.
Definition at line 338 of file structure.h.
References getGeneration(), and getIDNumber().
Referenced by GlobalSearch::Optimizer::getInterpretedTemplates(), GlobalSearch::Optimizer::read(), readStructureSettings(), GlobalSearch::QueueManager::startJob(), GlobalSearch::QueueManager::unlockForNaming(), and GlobalSearch::Optimizer::update().
int GlobalSearch::Structure::getIndex | ( | ) | const [inline] |
Returns a unique ID number associated with the Structure. This is typically assigned in order of introduction to a tracker.
Definition at line 259 of file structure.h.
Referenced by writeStructureSettings().
uint GlobalSearch::Structure::getJobID | ( | ) | const [inline] |
Returns the Job ID of the Structure's current running optimization. Returns zero is not running.
Definition at line 220 of file structure.h.
Referenced by writeStructureSettings().
bool GlobalSearch::Structure::getNearestNeighborDistance | ( | const Avogadro::Atom * | atom, | |
double & | shortest | |||
) | const [virtual] |
Find the nearest neighbor distance of a specified atom.
atom | Atom of interest | |
shortest | An empty double to be overwritten with the nearest neighbor distance. |
Definition at line 799 of file structure.cpp.
References getNearestNeighborDistance().
bool GlobalSearch::Structure::getNearestNeighborDistance | ( | const double | x, | |
const double | y, | |||
const double | z, | |||
double & | shortest | |||
) | const [virtual] |
Find the distance to the nearest atom from a specified point.
Useful for checking if an atom will be too close to another atom before adding it.
x | Cartesian coordinate | |
y | Cartesian coordinate | |
z | Cartesian coordinate | |
shortest | An empty double to be overwritten with the nearest neighbor distance. |
Definition at line 773 of file structure.cpp.
Referenced by getNearestNeighborDistance(), and getNearestNeighborDistances().
bool GlobalSearch::Structure::getNearestNeighborDistances | ( | QList< double > * | list | ) | const [virtual] |
Find the smallest separation between all atoms in the Structure.
list | list of distances in Angstrom |
Definition at line 728 of file structure.cpp.
References getNearestNeighborDistance().
QList< Atom * > GlobalSearch::Structure::getNeighbors | ( | const Avogadro::Atom * | atom, | |
const double | cutoff, | |||
QList< double > * | distances = 0 | |||
) | const |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
Definition at line 833 of file structure.cpp.
References getNeighbors().
QList< Atom * > GlobalSearch::Structure::getNeighbors | ( | const double | x, | |
const double | y, | |||
const double | z, | |||
const double | cutoff, | |||
QList< double > * | distances = 0 | |||
) | const |
Definition at line 808 of file structure.cpp.
Referenced by getNeighbors().
QList< uint > GlobalSearch::Structure::getNumberOfAtomsAlpha | ( | ) | const |
Definition at line 1146 of file structure.cpp.
References getSymbols().
QString GlobalSearch::Structure::getOptElapsed | ( | ) | const |
Definition at line 1166 of file structure.cpp.
QHash<int, int>* GlobalSearch::Structure::getOptimizerLookupTable | ( | ) | [inline] |
Definition at line 362 of file structure.h.
Referenced by GlobalSearch::OptBase::interpretKeyword_base().
QDateTime GlobalSearch::Structure::getOptTimerEnd | ( | ) | const [inline] |
Definition at line 326 of file structure.h.
Referenced by writeStructureSettings().
QDateTime GlobalSearch::Structure::getOptTimerStart | ( | ) | const [inline] |
Definition at line 316 of file structure.h.
Referenced by writeStructureSettings().
QString GlobalSearch::Structure::getParents | ( | ) | const [inline] |
Definition at line 270 of file structure.h.
Referenced by writeStructureSettings().
virtual int GlobalSearch::Structure::getPreOptProgress | ( | ) | const [inline, virtual] |
Definition at line 295 of file structure.h.
double GlobalSearch::Structure::getPV | ( | ) | const [inline] |
Returns the value PV term from an enthalpy calculation (H = U + PV) in eV.
Definition at line 207 of file structure.h.
uint GlobalSearch::Structure::getRank | ( | ) | const [inline] |
Returns an energetic ranking set by setRank(uint).
Definition at line 213 of file structure.h.
Referenced by getResultsEntry(), and writeStructureSettings().
QString GlobalSearch::Structure::getRempath | ( | ) | const [inline] |
Definition at line 276 of file structure.h.
Referenced by GlobalSearch::OptBase::interpretKeyword_base(), and writeStructureSettings().
QString GlobalSearch::Structure::getResultsEntry | ( | ) | const [virtual] |
Definition at line 687 of file structure.cpp.
References Duplicate, Empty, Error, getEnthalpy(), getGeneration(), getIDNumber(), getRank(), getStatus(), InProcess, Killed, Optimized, Preoptimizing, Removed, Restart, StepOptimized, Submitted, Updating, and WaitingForOptimization.
Referenced by GlobalSearch::OptBase::save().
virtual QString GlobalSearch::Structure::getResultsHeader | ( | ) | const [inline, virtual] |
Definition at line 345 of file structure.h.
bool GlobalSearch::Structure::getShortestInteratomicDistance | ( | double & | shortest | ) | const [virtual] |
Return a list of nearest neighbor distances for each atom in the Structure
shortest | An empty double to be overwritten with the shortest interatomic distance. |
Definition at line 747 of file structure.cpp.
State GlobalSearch::Structure::getStatus | ( | ) | const [inline] |
Definition at line 282 of file structure.h.
Referenced by GlobalSearch::QueueManager::checkPopulation(), GlobalSearch::QueueManager::checkRunning(), GlobalSearch::QueueManager::getAllDuplicateStructures(), GlobalSearch::QueueManager::getAllOptimizedStructures(), getResultsEntry(), GlobalSearch::QueueManager::killStructure(), and writeStructureSettings().
QList< QString > GlobalSearch::Structure::getSymbols | ( | ) | const |
Definition at line 1130 of file structure.cpp.
Referenced by getNumberOfAtomsAlpha(), and GlobalSearch::OptBase::interpretKeyword_base().
bool GlobalSearch::Structure::hasBestOffspring | ( | ) | const [inline] |
Definition at line 149 of file structure.h.
Referenced by writeStructureSettings().
bool GlobalSearch::Structure::hasChangedSinceDupChecked | ( | ) | [inline] |
Structure can track if it has changed since it was last checked in a duplicate finding routine. This is useful for cutting down on the number of comparisons needed.
Must call setupConnections() before using this function.
Definition at line 623 of file structure.h.
bool GlobalSearch::Structure::hasEnthalpy | ( | ) | const [inline] |
Whether the Structure has an enthalpy value set.
Definition at line 160 of file structure.h.
virtual bool GlobalSearch::Structure::isHistogramGenerationPending | ( | ) | const [inline, virtual] |
Definition at line 473 of file structure.h.
virtual bool GlobalSearch::Structure::isPreoptimizing | ( | ) | const [inline, virtual] |
Definition at line 290 of file structure.h.
Referenced by GlobalSearch::QueueManager::stopJob().
void GlobalSearch::Structure::load | ( | QTextStream & | in | ) | [virtual, slot] |
Load data into Structure.
in | QTextStream containing load data. |
Definition at line 1181 of file structure.cpp.
References InProcess, setCurrentOptStep(), setFailCount(), setGeneration(), setIDNumber(), setIndex(), setJobID(), setOptTimerEnd(), setOptTimerStart(), setParents(), setRank(), setRempath(), and setStatus().
Referenced by readStructureSettings().
virtual bool GlobalSearch::Structure::needsPreoptimization | ( | ) | const [inline, virtual] |
Definition at line 298 of file structure.h.
Referenced by GlobalSearch::QueueManager::checkPopulation(), GlobalSearch::QueueManager::startJob(), GlobalSearch::QueueManager::startPreoptimization(), and writeStructureSettings().
Structure & GlobalSearch::Structure::operator= | ( | const Avogadro::Molecule & | other | ) |
Assignment operator. Makes a new structure with all Molecule specific information copied from other.
Definition at line 222 of file structure.cpp.
References copyStructure().
Assignment operator. Makes a new structure with all Structure specific information copied from other.
Definition at line 196 of file structure.cpp.
References copyStructure().
Referenced by copyStructure().
void GlobalSearch::Structure::rankByEnthalpy | ( | const QList< Structure * > & | structures | ) | [static] |
Rank the listed structures by their enthalpies
structures | List of structures to assign ranks |
Definition at line 1277 of file structure.cpp.
References getEnthalpy().
virtual void GlobalSearch::Structure::readSettings | ( | const QString & | filename | ) | [inline, virtual, slot] |
Read supplementary data about this Structure from a file. All data that is not stored in the OpenBabel-readable optimizer output file should be read here.
If reimplementing this in a derived class, call readStructureSettings(filename) to read inherited data.
filename | Filename to read data from. |
Definition at line 797 of file structure.h.
References readStructureSettings().
void GlobalSearch::Structure::readStructureSettings | ( | const QString & | filename | ) | [protected, slot] |
Read data concerning the Structure class from a file.
filename | Filename to read data from. |
Definition at line 342 of file structure.cpp.
References getIDString(), load(), setCurrentOptStep(), setFailCount(), setGeneration(), setHasBestOffspring(), setIDNumber(), setIndex(), setJobID(), setNeedsPreoptimization(), setOptTimerEnd(), setOptTimerStart(), setParents(), setRank(), setRempath(), and setStatus().
Referenced by readSettings().
void GlobalSearch::Structure::requestHistogramGeneration | ( | ) | [virtual, slot] |
Request that histogram data be regenerated. This is connected to Molecule::update() and calls generateDefaultHistogram(). This function is throttled to only run every 250 ms.
Definition at line 843 of file structure.cpp.
References generateDefaultHistogram().
Referenced by enableAutoHistogramGeneration().
void GlobalSearch::Structure::resetEnergy | ( | ) | [inline, slot] |
Reset the Structure's energy to zero
Definition at line 912 of file structure.h.
void GlobalSearch::Structure::resetEnthalpy | ( | ) | [inline, slot] |
Reset the Structure's enthalpy and PV term to zero and clear hasEnthalpy()
Definition at line 906 of file structure.h.
void GlobalSearch::Structure::resetFailCount | ( | ) | [inline, slot] |
Reset the number of times this Structure has failed the current optimization step.
Definition at line 1010 of file structure.h.
References setFailCount().
Referenced by Structure().
void GlobalSearch::Structure::resetOptimizerLookupTable | ( | ) | [inline] |
Reset the optimizer lookup table to set the optimizer indicies to the structure indices.
Definition at line 370 of file structure.h.
void GlobalSearch::Structure::retrieveHistoryEntry | ( | unsigned int | index, | |
QList< unsigned int > * | atomicNums, | |||
QList< Eigen::Vector3d > * | coords, | |||
double * | energy, | |||
double * | enthalpy, | |||
Eigen::Matrix3d * | cell | |||
) | [virtual, slot] |
This function is used to retrieve data from the structure's history. All non-zero pointers will be modified to contain the information at the specified index of the history.
index | Entry in history to return | |
atomicNums | Pointer to a list that will be filled with atomic numbers. Can be zero if this is not needed. | |
coords | Pointer to a list that will be filled with cartesian atomic coordinates. Can be zero if this is not needed. | |
energy | Pointer to a double that will contain the entry's energy in eV. Can be zero if this is not needed. | |
enthalpy | Pointer to a double that will contain the entry's enthalpy in eV. Can be zero if this is not needed. | |
cell | Pointer to an Eigen::Matrix3f filled with the unit cell vectors (row vectors). Can be zero if this is not needed. |
Definition at line 608 of file structure.cpp.
References sizeOfHistory().
void GlobalSearch::Structure::setChangedSinceDupChecked | ( | bool | b | ) | [inline, slot] |
Structure can track if it has changed since it was last checked in a duplicate finding routine. This is useful for cutting down on the number of comparisons needed.
Must call setupConnections() before using this function.
Definition at line 1035 of file structure.h.
void GlobalSearch::Structure::setCurrentOptStep | ( | uint | i | ) | [inline, slot] |
i | The current optimization step of the Structure. |
Definition at line 993 of file structure.h.
Referenced by load(), and readStructureSettings().
void GlobalSearch::Structure::setDuplicateString | ( | const QString & | s | ) | [inline, slot] |
Definition at line 1025 of file structure.h.
void GlobalSearch::Structure::setEnthalpy | ( | double | enthalpy | ) | [inline, slot] |
Set the enthalpy of the Structure.
enthalpy | The Structure's enthalpy |
Definition at line 890 of file structure.h.
void GlobalSearch::Structure::setFailCount | ( | uint | count | ) | [inline, slot] |
count | The number of times this Structure has failed the current optimization step. |
Definition at line 1001 of file structure.h.
Referenced by addFailure(), load(), readStructureSettings(), and resetFailCount().
void GlobalSearch::Structure::setGeneration | ( | uint | gen | ) | [inline, slot] |
Set the generation number of the Structure.
gen | The generation number. |
Definition at line 942 of file structure.h.
Referenced by load(), and readStructureSettings().
void GlobalSearch::Structure::setHasBestOffspring | ( | bool | b = true |
) | [inline, slot] |
b | Whether or not the "best" offspring (an optimized mutation) has been generated for this structure. |
Definition at line 881 of file structure.h.
Referenced by readStructureSettings().
void GlobalSearch::Structure::setIDNumber | ( | uint | id | ) | [inline, slot] |
Set the ID number associated with the Structure.
Definition at line 956 of file structure.h.
Referenced by load(), and readStructureSettings().
void GlobalSearch::Structure::setIndex | ( | int | index | ) | [inline, slot] |
Set a unique ID number associated with the Structure. This is typically assigned in order of introduction to a tracker.
index | Identification number |
Definition at line 971 of file structure.h.
Referenced by load(), readStructureSettings(), and GlobalSearch::OptBase::save().
void GlobalSearch::Structure::setJobID | ( | uint | id | ) | [inline, slot] |
Set the Job ID of the current optimization process.
id | The current optimization process's Job ID. |
Definition at line 930 of file structure.h.
Referenced by load(), readStructureSettings(), and GlobalSearch::Optimizer::update().
virtual void GlobalSearch::Structure::setNeedsPreoptimization | ( | bool | b | ) | [inline, virtual, slot] |
b | Whether or not this needs to be preoptimized. |
Definition at line 1089 of file structure.h.
Referenced by readStructureSettings().
void GlobalSearch::Structure::setOBEnergy | ( | const QString & | ff = QString("UFF") |
) | [slot] |
Determine and set the energy using a forcefield method from OpenBabel.
ff | A string identifying the forcefield to use (default: UFF). |
Definition at line 674 of file structure.cpp.
void GlobalSearch::Structure::setOptTimerEnd | ( | const QDateTime & | d | ) | [inline, slot] |
d | The time that the current optimization process stopped. |
Definition at line 1085 of file structure.h.
Referenced by load(), and readStructureSettings().
void GlobalSearch::Structure::setOptTimerStart | ( | const QDateTime & | d | ) | [inline, slot] |
d | The time that the current optimization process started. |
Definition at line 1073 of file structure.h.
Referenced by load(), and readStructureSettings().
void GlobalSearch::Structure::setParents | ( | const QString & | p | ) | [inline, slot] |
p | A string describing the ancestory of the Structure. |
Definition at line 976 of file structure.h.
Referenced by load(), and readStructureSettings().
void GlobalSearch::Structure::setPV | ( | double | pv | ) | [inline, slot] |
Set the PV term of the Structure's enthalpy (see getPV()).
pv | The PV term |
Definition at line 896 of file structure.h.
void GlobalSearch::Structure::setRank | ( | uint | rank | ) | [inline, slot] |
Set the Structure's energetic ranking.
rank | The Structure's energetic ranking. |
Definition at line 924 of file structure.h.
Referenced by load(), and readStructureSettings().
void GlobalSearch::Structure::setRempath | ( | const QString & | p | ) | [inline, slot] |
p | The path on the remote server to write this Structure for optimization. |
Definition at line 982 of file structure.h.
Referenced by load(), and readStructureSettings().
void GlobalSearch::Structure::setStatus | ( | State | status | ) | [inline, slot] |
status | The current status of the Structure. |
Definition at line 988 of file structure.h.
Referenced by GlobalSearch::QueueManager::killStructure(), load(), readStructureSettings(), GlobalSearch::QueueManager::startJob(), GlobalSearch::QueueManager::startPreoptimization(), and Structure().
void GlobalSearch::Structure::setupConnections | ( | ) | [virtual, slot] |
Connect slots/signals within the molecule. This must be called AFTER moving the Structure to it's final thread.
Definition at line 96 of file structure.cpp.
References structureChanged().
virtual unsigned int GlobalSearch::Structure::sizeOfHistory | ( | ) | [inline, virtual, slot] |
Definition at line 876 of file structure.h.
Referenced by deleteFromHistory(), and retrieveHistoryEntry().
void GlobalSearch::Structure::sortAndRankByEnthalpy | ( | QList< Structure * > * | structures | ) | [static] |
Sort and rank the listed structures by their enthalpies
structures | List of structures to sort and assign rank |
Definition at line 1311 of file structure.cpp.
References sortByEnthalpy().
Referenced by GlobalSearch::OptBase::save().
void GlobalSearch::Structure::sortByEnthalpy | ( | QList< Structure * > * | structures | ) | [static] |
Sort the listed structures by their enthalpies
structures | List of structures to sort |
Definition at line 1239 of file structure.cpp.
References getEnthalpy().
Referenced by sortAndRankByEnthalpy().
void GlobalSearch::Structure::startOptTimer | ( | ) | [inline, slot] |
Record the current time as when the current optimization process started.
Definition at line 1047 of file structure.h.
void GlobalSearch::Structure::stopOptTimer | ( | ) | [inline, slot] |
Record the current time as when the current optimization process stopped.
Definition at line 1060 of file structure.h.
Referenced by GlobalSearch::QueueManager::killStructure(), and GlobalSearch::Optimizer::update().
void GlobalSearch::Structure::structureChanged | ( | ) | [virtual, slot] |
After calling setupConnections(), this will be called when the structure is update, atoms moved, added, etc...
Definition at line 481 of file structure.cpp.
Referenced by setupConnections().
void GlobalSearch::Structure::updateAndAddToHistory | ( | const QList< unsigned int > & | atomicNums, | |
const QList< Eigen::Vector3d > & | coords, | |||
const double | energy = 0 , |
|||
const double | enthalpy = 0 , |
|||
const Eigen::Matrix3d & | cell = Eigen::Matrix3d::Zero() | |||
) | [virtual, slot] |
Update the coordinates, enthalpy and/or energy, and optionally unit cell of the structure, appending the data to the structure's history.
atomicNums | List of atomic numbers | |
coords | List of cartesian coordinates | |
energy | in eV | |
enthalpy | in eV | |
cell | Matrix of cell vectors (row vectors) |
Definition at line 538 of file structure.cpp.
Referenced by GlobalSearch::Optimizer::read().
void GlobalSearch::Structure::updateAndSkipHistory | ( | const QList< unsigned int > & | atomicNums, | |
const QList< Eigen::Vector3d > & | coords, | |||
const double | energy = 0 , |
|||
const double | enthalpy = 0 , |
|||
const Eigen::Matrix3d & | cell = Eigen::Matrix3d::Zero() | |||
) | [virtual, slot] |
Update the coordinates, enthalpy and/or energy, and optionally unit cell of the structure, without adding the data to the structure's history.
atomicNums | List of atomic numbers | |
coords | List of cartesian coordinates | |
energy | in eV | |
enthalpy | in eV | |
cell | Matrix of cell vectors (row vectors) |
Definition at line 486 of file structure.cpp.
Referenced by GlobalSearch::Optimizer::read().
virtual void GlobalSearch::Structure::writeSettings | ( | const QString & | filename | ) | [inline, virtual, slot] |
Write supplementary data about this Structure to a file. All data that is not stored in the OpenBabel-readable optimizer output file should be written here.
If reimplementing this in a derived class, call writeStructureSettings(filename) to write inherited data.
filename | Filename to write data to. |
Definition at line 783 of file structure.h.
References writeStructureSettings().
Referenced by GlobalSearch::OptBase::save().
void GlobalSearch::Structure::writeStructureSettings | ( | const QString & | filename | ) | [protected, slot] |
Write data from the Structure class to a file.
filename | Filename to write data to. |
Definition at line 240 of file structure.cpp.
References getCurrentOptStep(), getFailCount(), getGeneration(), getIDNumber(), getIndex(), getJobID(), getOptTimerEnd(), getOptTimerStart(), getParents(), getRank(), getRempath(), getStatus(), hasBestOffspring(), and needsPreoptimization().
Referenced by writeSettings().