GlobalSearch::Structure Class Reference

Generic molecule object. More...

#include <globalsearch/structure.h>

List of all members.

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 ()
Structureoperator= (const Structure &other)
Structureoperator= (const Avogadro::Molecule &other)
virtual StructurecopyStructure (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)

Detailed Description

Generic molecule object.

Author:
David C. Lonie

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.


Member Enumeration Documentation

Enum containing possible optimization statuses.

See also:
setStatus
getStatus
Enumerator:
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.


Constructor & Destructor Documentation

GlobalSearch::Structure::Structure ( QObject *  parent = 0  ) 

Constructor.

Parameters:
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.


Member Function Documentation

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).

Returns:
true if the atom was sucessfully added within the specified interatomic distances.
Parameters:
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.

See also:
resetFailCount
setFailCount
getFailCount

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".

Parameters:
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
Returns:
Whether or not the operation could be performed.

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".

Parameters:
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
Returns:
Whether or not the operation could be performed.

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".

Parameters:
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
Returns:
Whether or not the operation could be performed.

Definition at line 1017 of file structure.cpp.

Referenced by compareIADDistributions().

Structure & GlobalSearch::Structure::copyStructure ( const Structure other  )  [virtual]

Only update this structure's atoms, bonds, and residue information from other.

See also:
operator=

Definition at line 228 of file structure.cpp.

References operator=().

Referenced by operator=().

void GlobalSearch::Structure::deleteFromHistory ( unsigned int  index  )  [virtual, slot]
Parameters:
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)

See also:
isHistogramGenerationPending()
getDefaultHistogram()

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.

Warning:
This algorithm is not thoroughly tested and should not be relied upon. It is merely an estimation.
Returns:
true if the operation makes sense for this Structure, false otherwise (i.e. fewer than one atom present)
Parameters:
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.
See also:
getShortestInteratomicDistance
requestHistogramGeneration
getNearestNeighborDistance

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.

Warning:
This algorithm is not thoroughly tested and should not be relied upon. It is merely an estimation.
Returns:
true if the operation makes sense for this Structure, false otherwise (i.e. fewer than one atom present)
Parameters:
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.
See also:
getShortestInteratomicDistance
requestHistogramGeneration
getNearestNeighborDistance

Definition at line 874 of file structure.cpp.

Referenced by generateDefaultHistogram().

uint GlobalSearch::Structure::getCurrentOptStep (  )  [inline]
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]
Returns:
A string naming the Structure that this Structure is a duplicate of.
See also:
setDuplicateString

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.

Note:
The energies of the other conformers are still available using energy(int). Be aware that energy(int) returns kcal/mol. The multiplicative factor EV_TO_KCAL_PER_MOL has been defined to aid conversion.
Returns:
The energy of the first conformer in eV.
See also:
setEnthalpy
hasEnthalpy
setPV
getPV
setEnergy
getEnergy

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.

Note:
If the enthalpy is not set but the energy is set, this function assumes that the system is at zero-pressure and returns the energy.
Returns:
The enthalpy of the first conformer in eV.
See also:
setEnthalpy
hasEnthalpy
setPV
getPV
setEnergy
getEnergy

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]
Returns:
The number of times this Structure has failed the current optimization step.
See also:
setFailCount
addFailure
resetFailCount

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.

Returns:
A hash of key/value pairs containing data that is representative of the Structure.

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.

Returns:
Generation number
See also:
setGeneration
getIDNumber
getIndex
setIDNumber
setIndex
getIDString

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.

Note:
If a generation number is used as well, this may not be unique.
Returns:
Identification number
See also:
setGeneration
getGeneration
getIndex
setIDNumber
setIndex
getIDString

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.

Returns:
Unique identification string.
See also:
setGeneration
getGeneration
setIndex
getIndex
setIDNumber
getIDNumber

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.

Returns:
Unique identification number
See also:
setGeneration
getGeneration
getIndex
setIDNumber
getIDNumber
getIDString

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.

Returns:
Job ID of the structure's optimization process.
See also:
setJobID

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.

Returns:
true if the operation makes sense for this Structure, false otherwise (i.e. fewer than one atom present)
Parameters:
atom Atom of interest
shortest An empty double to be overwritten with the nearest neighbor distance.
See also:
getShortestInteratomicDistance
getNearestNeighborHistogram
getNeighbors

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.

Returns:
true if the operation makes sense for this Structure, false otherwise (i.e. fewer than one atom present)
Parameters:
x Cartesian coordinate
y Cartesian coordinate
z Cartesian coordinate
shortest An empty double to be overwritten with the nearest neighbor distance.
See also:
getShortestInteratomicDistance
getNearestNeighborHistogram
getNeighbors

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.

Returns:
true if the operation makes sense for this Structure, false otherwise (i.e. fewer than two atoms present)
Parameters:
list list of distances in Angstrom
See also:
getNearestNeighborDistance
getNearestNeighborHistogram
getNeighbors

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.

Returns:
a list of all atoms within cutoff of atom and, optionally, their distances.

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
Returns:
a list of all atoms within cutoff of (x,y,z) and, optionally, their distances.

Definition at line 808 of file structure.cpp.

Referenced by getNeighbors().

QList< uint > GlobalSearch::Structure::getNumberOfAtomsAlpha (  )  const
Returns:
A list of the number of species present that corresponds to the symbols listed in getSymbols().
See also:
getSymbols

Definition at line 1146 of file structure.cpp.

References getSymbols().

QString GlobalSearch::Structure::getOptElapsed (  )  const
Returns:
A string formated "HH:MM:SS" indicating the amount of time spent in the current optimization step
See also:
setOptTimerStart
getOptTimerStart
setOptTimerEnd
getOptTimerEnd
startOptTimer
stopOptTimer

Definition at line 1166 of file structure.cpp.

QHash<int, int>* GlobalSearch::Structure::getOptimizerLookupTable (  )  [inline]
Returns:
a lookup table for mapping atoms indices between structure index (value) and the optimizer index (key).

Definition at line 362 of file structure.h.

Referenced by GlobalSearch::OptBase::interpretKeyword_base().

QDateTime GlobalSearch::Structure::getOptTimerEnd (  )  const [inline]
Returns:
The time that the current optimization step ended.
See also:
getOptTimerStart
startOptTimer
stopOptTimer
setOptTimerStart
setOptTimerEnd
getOptElapsed

Definition at line 326 of file structure.h.

Referenced by writeStructureSettings().

QDateTime GlobalSearch::Structure::getOptTimerStart (  )  const [inline]
Returns:
The time that the current optimization step started.
See also:
getOptTimerEnd
startOptTimer
stopOptTimer
setOptTimerStart
setOptTimerEnd
getOptElapsed

Definition at line 316 of file structure.h.

Referenced by writeStructureSettings().

QString GlobalSearch::Structure::getParents (  )  const [inline]
Returns:
a string describing the ancestory of the Structure.
See also:
setParents

Definition at line 270 of file structure.h.

Referenced by writeStructureSettings().

virtual int GlobalSearch::Structure::getPreOptProgress (  )  const [inline, virtual]
Returns:
The percentage completion of the preoptimization step. -1 if this is not Preoptimizing.

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.

Returns:
The PV term in eV.
See also:
getEnthalpy
setEnthalpy
hasEnthalpy
setPV
setEnergy
getEnergy

Definition at line 207 of file structure.h.

uint GlobalSearch::Structure::getRank (  )  const [inline]

Returns an energetic ranking set by setRank(uint).

Returns:
the energetic ranking.
See also:
setRank

Definition at line 213 of file structure.h.

Referenced by getResultsEntry(), and writeStructureSettings().

QString GlobalSearch::Structure::getRempath (  )  const [inline]
Returns:
The path on the remote server to write this Structure for optimization.
See also:
setRempath

Definition at line 276 of file structure.h.

Referenced by GlobalSearch::OptBase::interpretKeyword_base(), and writeStructureSettings().

QString GlobalSearch::Structure::getResultsEntry (  )  const [virtual]
virtual QString GlobalSearch::Structure::getResultsHeader (  )  const [inline, virtual]
Returns:
A header line for a results printout
See also:
getResultsEntry
OptBase::save

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

Returns:
true if the operation makes sense for this Structure, false otherwise (i.e. fewer than two atoms present)
Parameters:
shortest An empty double to be overwritten with the shortest interatomic distance.
See also:
getNearestNeighborDistance
getNearestNeighborHistogram
getNeighbors

Definition at line 747 of file structure.cpp.

State GlobalSearch::Structure::getStatus (  )  const [inline]
QList< QString > GlobalSearch::Structure::getSymbols (  )  const
Returns:
An alphabetized list of the atomic symbols for the atomic species present in the Structure.
See also:
getNumberOfAtomsAlpha

Definition at line 1130 of file structure.cpp.

Referenced by getNumberOfAtomsAlpha(), and GlobalSearch::OptBase::interpretKeyword_base().

bool GlobalSearch::Structure::hasBestOffspring (  )  const [inline]
Returns:
Whether or not the "best" offspring (an optimized mutation) has been generated for this structure.

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.

See also:
setChangedSinceDupChecked()

Definition at line 623 of file structure.h.

bool GlobalSearch::Structure::hasEnthalpy (  )  const [inline]

Whether the Structure has an enthalpy value set.

Returns:
true if enthalpy has been set, false otherwise
See also:
setEnthalpy
getEnthalpy
setPV
getPV
setEnergy
getEnergy

Definition at line 160 of file structure.h.

virtual bool GlobalSearch::Structure::isHistogramGenerationPending (  )  const [inline, virtual]
Returns:
True is histogram generation is pending.

Definition at line 473 of file structure.h.

virtual bool GlobalSearch::Structure::isPreoptimizing (  )  const [inline, virtual]
Returns:
true if running, false otherwise.

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.

Attention:
Do not use this function in new code, as it has been replaced by readSettings. Old code should be rewritten to use readSettings as well.
Deprecated:
Use readSettings instead, and call this only as a backup for outdates .state files
Parameters:
in QTextStream containing load data.
See also:
readSettings

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]
Structure & GlobalSearch::Structure::operator= ( const Avogadro::Molecule &  other  ) 

Assignment operator. Makes a new structure with all Molecule specific information copied from other.

See also:
copyStructure

Definition at line 222 of file structure.cpp.

References copyStructure().

Structure & GlobalSearch::Structure::operator= ( const Structure other  ) 

Assignment operator. Makes a new structure with all Structure specific information copied from other.

See also:
copyStructure

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

Parameters:
structures List of structures to assign ranks
See also:
sortEnthalpies
sortAndRankByEnthalpy
setRank
getRank

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.

Parameters:
filename Filename to read data from.
See also:
readStructureSettings
writeSettings

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.

Parameters:
filename Filename to read data from.
See also:
writeSettings
readSettings

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

See also:
setEnergy
getEnergy

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()

See also:
setEnthalpy
getEnthalpy
hasEnthalpy
setPV
getPV

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.

See also:
addFailure
setFailCount
getFailCount

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.

Parameters:
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.
Note:
If the system is not periodic, the cell matrix will be a zero matrix. Use Eigen::Matrix3d::isZero() to test for a valid cell.

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.

See also:
hasChangedSinceDupChecked()

Definition at line 1035 of file structure.h.

void GlobalSearch::Structure::setCurrentOptStep ( uint  i  )  [inline, slot]
Parameters:
i The current optimization step of the Structure.
See also:
getCurrentOptStep

Definition at line 993 of file structure.h.

Referenced by load(), and readStructureSettings().

void GlobalSearch::Structure::setDuplicateString ( const QString &  s  )  [inline, slot]
Parameters:
s A string naming the Structure that this Structure is a duplicate of.
See also:
getDuplicateString

Definition at line 1025 of file structure.h.

void GlobalSearch::Structure::setEnthalpy ( double  enthalpy  )  [inline, slot]

Set the enthalpy of the Structure.

Parameters:
enthalpy The Structure's enthalpy
See also:
getEnthalpy

Definition at line 890 of file structure.h.

void GlobalSearch::Structure::setFailCount ( uint  count  )  [inline, slot]
Parameters:
count The number of times this Structure has failed the current optimization step.
See also:
addFailure
getFailCount
resetFailCount

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.

Parameters:
gen The generation number.
See also:
setGeneration
getGeneration
setIndex
getIndex
setIDNumber
getIDNumber
getIDString

Definition at line 942 of file structure.h.

Referenced by load(), and readStructureSettings().

void GlobalSearch::Structure::setHasBestOffspring ( bool  b = true  )  [inline, slot]
Parameters:
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.

Note:
If a generation number is used as well, this may not be unique.
Returns:
Identification number
See also:
setGeneration
getGeneration
setIndex
getIndex
getIDNumber
getIDString

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.

Note:
If a generation number is used as well, this may not be unique.
Parameters:
index Identification number
See also:
setGeneration
getGeneration
getIndex
setIDNumber
getIDNumber
getIDString

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.

Parameters:
id The current optimization process's Job ID.
See also:
getJobID

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]
Parameters:
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.

Parameters:
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]
Parameters:
d The time that the current optimization process stopped.
See also:
setOptTimerStart
getOptTimerStart
getOptTimerEnd
startOptTimer
stopOptTimer
getOptElapsed

Definition at line 1085 of file structure.h.

Referenced by load(), and readStructureSettings().

void GlobalSearch::Structure::setOptTimerStart ( const QDateTime &  d  )  [inline, slot]
Parameters:
d The time that the current optimization process started.
See also:
getOptTimerStart
setOptTimerEnd
getOptTimerEnd
startOptTimer
stopOptTimer
getOptElapsed

Definition at line 1073 of file structure.h.

Referenced by load(), and readStructureSettings().

void GlobalSearch::Structure::setParents ( const QString &  p  )  [inline, slot]
Parameters:
p A string describing the ancestory of the Structure.
See also:
getParents

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()).

Parameters:
pv The PV term
See also:
getPV

Definition at line 896 of file structure.h.

void GlobalSearch::Structure::setRank ( uint  rank  )  [inline, slot]

Set the Structure's energetic ranking.

Parameters:
rank The Structure's energetic ranking.
See also:
getRank

Definition at line 924 of file structure.h.

Referenced by load(), and readStructureSettings().

void GlobalSearch::Structure::setRempath ( const QString &  p  )  [inline, slot]
Parameters:
p The path on the remote server to write this Structure for optimization.
See also:
getRempath

Definition at line 982 of file structure.h.

Referenced by load(), and readStructureSettings().

void GlobalSearch::Structure::setStatus ( State  status  )  [inline, slot]
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]
Returns:
Number of history entries available

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

Parameters:
structures List of structures to sort and assign rank
See also:
sortByEnthalpy
rankEnthalpies
setRank
getRank

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

Parameters:
structures List of structures to sort
See also:
rankEnthalpies
sortAndRankByEnthalpy

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.

See also:
setOptTimerStart
getOptTimerStart
setOptTimerEnd
getOptTimerEnd
stopOptTimer
getOptElapsed

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.

See also:
setOptTimerStart
getOptTimerStart
setOptTimerEnd
getOptTimerEnd
startOptTimer
getOptElapsed

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.

Parameters:
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.

Parameters:
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.

Parameters:
filename Filename to write data to.
See also:
writeStructureSettings
readSettings

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.

Parameters:
filename Filename to write data to.
See also:
writeSettings
readSettings

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().


The documentation for this class was generated from the following files:
 All Classes Functions Variables Enumerations Enumerator
Generated on Mon Jul 16 14:40:04 2012 for GlobalSearch by  doxygen 1.6.3