atomicrex
0.1
An advanced atomistic model building tool
|
Public Types | |
enum | TolerancePreset { Uniform, Balanced, AccurateEnergies } |
Specifies presets for tolerance parameters. More... | |
Public Member Functions | |
FitJob () | |
Constructor. | |
~FitJob () | |
Destructor. | |
const FPString & | name () const |
Returns the user-defined name of this job. | |
double | getDefaultPropertyTolerance (FitProperty *property) |
Returns the default tolerance for the given property based on the selected tolerance preset. | |
int | numAtomTypes () const |
Returns the number of atom types used in this job. | |
bool | addAtomType (const FPString &name, double mass=0.0, int atomicNumber=0) |
Adds a new atom type to the job. | |
const FPString & | atomTypeName (int i) const |
Returns the name of the i-th atom type. | |
double | atomTypeMass (int i) const |
int | atomTypeAtomicNumber (int i) const |
int | atomTypeIndex (const FPString &s) const |
Returns the index of the atom type. | |
double | maximumCutoff () const |
Returns the maximum cutoff radius of all potentials used by this job. | |
const std::vector< Potential * > & | potentials () const |
Returns the list of all potentials used in this job. | |
const std::vector< AtomicStructure * > & | structures () const |
Returns the list of all atomic structures used for fitting. | |
const std::vector< AtomicStructure * > & | referencedStructures () const |
void | addReferencedStructure (AtomicStructure *structure) |
Add a structure to the list of referenced structures. | |
const std::vector< AtomicStructure * > & | unreferencedStructures () const |
void | addUnreferencedStructure (AtomicStructure *structure) |
Add a structure to the list of unreferenced structures. | |
const std::vector< DerivedProperty * > & | derivedProperties () |
Returns the list of all derived properties. | |
const std::vector< FitProperty * > & | fitProperties () |
Returns the global list of active properties which are included in the fit and which need to be computed. | |
FitGroup & | rootGroup () |
Returns the root node of the property group tree. | |
ScalarFitProperty * | getScalarFitProperty (const FPString &id) |
AtomicStructure * | getAtomicStructure (const FPString &id) |
DerivedProperty * | getDerivedProperty (const FPString &id) |
const Matrix3 * | lookupDeformation (const FPString &deformationId) const |
Returns the deformation with the given id. Returns NULL if no such deformation has been defined. | |
bool | fittingEnabled () const |
Returns whether fitting will be performed. | |
std::shared_ptr< Minimizer > | fitMinimizer () |
Returns the minimizer. | |
void | performFitting () |
Performs the actual fitting by minimizing the residual. | |
void | printPotentialDOFList (bool printFullDOFList) |
Outputs the current values of all DOFs of the potentials. More... | |
void | printFittingProperties () |
Outputs the list of properties being fitted. | |
bool | potentialValidationEnabled () const |
Returns whether validation of the force/energy calculation routines has been requested by the user. | |
void | validatePotentials () |
Performs a check of the energy/force calculation routines using numerical differentiation. | |
int | numActiveDOF () const |
Returns the total number of active degrees of freedom. | |
void | packDOF (double *destination) |
Packs the values of all degrees of freedom into a linear vector, which can be passed to the minimizer routine. More... | |
void | packDOF (std::vector< double > &destination) |
Packs the values of all degrees of freedom into a linear vector, which can be passed to the minimizer routine. More... | |
void | unpackDOF (const double *source) |
Unpacks the values of all degrees of freedom from a linear vector. More... | |
void | unpackDOF (const std::vector< double > &source) |
Unpacks the values of all degrees of freedom from a linear vector. More... | |
void | parse (const FPString &file) |
Parses the job description from the XML file. More... | |
int | parseAtomTypeAttribute (XML::Element element, const char *attributeName) |
Returns the atom type index of the species specified in the given element attribute. More... | |
int | parseAtomTypeElement (XML::Element element, const char *elementName) |
Returns the atom type index of the species specified in the given element. More... | |
std::vector< int > | parseAtomTypesAttribute (XML::Element element, const char *attributeName) |
Returns the list of atom types corresponding to the species specified in the given element attribute. More... | |
ScalarFitProperty * | parseScalarFitPropertyAttribute (XML::Element element, const char *attributeName) |
Returns the ScalarFitProperty specified in the given element attribute. More... | |
double | calculateResidual (FitProperty::ResidualNorm norm=FitProperty::UserDefined) |
Calculates the total residual, i.e. the objective function to be minimized during fitting. More... | |
void | prepareFitting () |
Prepares a list of all degrees of freedom and properties that are to be fitted. | |
Friends | |
class | FitGroup |
class | AtomicStructure |
class | DerivedProperty |
|
inline |
Returns the atomic of the i-th atom type. May be zero if not set.
|
inline |
Returns the mass of the i-th atom type. May be zero if not set.
double atomicrex::FitJob::calculateResidual | ( | FitProperty::ResidualNorm | norm = FitProperty::UserDefined | ) |
Calculates the total residual, i.e. the objective function to be minimized during fitting.
norm | The style to be used for computing the residual, see #FitProperty::ResidualNorm. |
AtomicStructure * atomicrex::FitJob::getAtomicStructure | ( | const FPString & | id | ) |
Returns the atomic structure with the given ID. Return NULL if no such structure exists.
DerivedProperty * atomicrex::FitJob::getDerivedProperty | ( | const FPString & | id | ) |
Returns the derived property with the given ID. Return NULL if no such property exists.
ScalarFitProperty * atomicrex::FitJob::getScalarFitProperty | ( | const FPString & | id | ) |
Returns the atomic structure with the given ID. Return NULL if no such structure exists.
void atomicrex::FitJob::packDOF | ( | double * | destination | ) |
Packs the values of all degrees of freedom into a linear vector, which can be passed to the minimizer routine.
destination | A pointer to a contiguous array of doubles that will receive the values of all the degrees of freedom. |
|
inline |
Packs the values of all degrees of freedom into a linear vector, which can be passed to the minimizer routine.
destination | A vector of doubles that will receive the values of all the degrees of freedom. |
void atomicrex::FitJob::parse | ( | const FPString & | file | ) |
Parses the job description from the XML file.
file | Name of input file. |
int atomicrex::FitJob::parseAtomTypeAttribute | ( | XML::Element | element, |
const char * | attributeName | ||
) |
Returns the atom type index of the species specified in the given element attribute.
Throws exception if species has not been defined.
element | XML::Element object to be parsed |
attributeName | The name of the attribute |
int atomicrex::FitJob::parseAtomTypeElement | ( | XML::Element | element, |
const char * | elementName | ||
) |
Returns the atom type index of the species specified in the given element.
Throws exception if species has not been defined.
element | XML::Element object to be parsed |
elementName | The name of the element |
vector< int > atomicrex::FitJob::parseAtomTypesAttribute | ( | XML::Element | element, |
const char * | attributeName | ||
) |
Returns the list of atom types corresponding to the species specified in the given element attribute.
Throws exception if some species has not been defined.
element | XML::Element object to be parsed |
attributeName | The name of the attribute |
ScalarFitProperty * atomicrex::FitJob::parseScalarFitPropertyAttribute | ( | XML::Element | element, |
const char * | attributeName | ||
) |
Returns the ScalarFitProperty specified in the given element attribute.
Throws exception if property has not been defined.
element | XML::Element object to be parsed |
attributeName | The name of the attribute |
void atomicrex::FitJob::printPotentialDOFList | ( | bool | printFullDOFList | ) |
Outputs the current values of all DOFs of the potentials.
printFullDOFList | Controls whether inactive DOFs are also printed. This option is used once before fitting to report the full list of DOFs. |
|
inline |
Returns the list of all referenced atomic structures used for fitting. i.e. these structured need to be computed first as other structures depend on them.
void atomicrex::FitJob::unpackDOF | ( | const double * | source | ) |
Unpacks the values of all degrees of freedom from a linear vector.
source | A pointer to a contiguous array of doubles that contains the values of all the degrees of freedom. |
|
inline |
Unpacks the values of all degrees of freedom from a linear vector.
source | A vector of doubles that contains the values of all the degrees of freedom. |
|
inline |
Returns the list of all unreferenced atomic structures used for fitting. These structures can be computed without any particular order.