atomicrex  0.1
An advanced atomistic model building tool
Public Member Functions | Protected Attributes | List of all members
atomicrex::AtomVectorProperty Class Reference

#include <AtomVectorProperty.h>

Inheritance diagram for atomicrex::AtomVectorProperty:
atomicrex::FitProperty atomicrex::FitObject

Public Member Functions

 AtomVectorProperty ()
 Default constructor.
 
 AtomVectorProperty (const FPString &id, const FPString &units, FitJob *job)
 Initialization constructor.
 
bool outputAllEnabled () const
 Returns whether this property is calculated and displayed at the end of the fitting process.
 
void setOutputAllEnabled (bool enable)
 Sets whether this property is calculated and displayed at the end of the fitting process.
 
void setAtomCount (int numAtoms)
 Allocates memory to store the property values for the given number of atoms (without ghost atoms).
 
int atomCount ()
 Retrieve number of atoms.
 
virtual double residual (ResidualNorm norm) const override
 Returns the residual of this property used for fitting.
 
void setTargetValue (int atomIndex, const Vector3 &value)
 Set the target values.
 
const std::vector< Vector3 > & values () const
 Returns the current computed values of the vector property.
 
std::vector< Vector3 > & values ()
 Returns the current computed values of the vector property.
 
std::vector< Vector3 > & targetValues ()
 Returns the target values of the vector property.
 
const std::vector< Vector3 > & targetValues () const
 
virtual void print (MsgLogger &stream) override
 Outputs the current value of the property.
 
virtual void parse (XML::Element propertyElement) override
 Parse the contents of the <property> element in the job file.
 
- Public Member Functions inherited from atomicrex::FitProperty
 FitProperty ()
 Default constructor.
 
 FitProperty (const FPString &id, const FPString &units, FitJob *job)
 Initialization constructor.
 
void initialize (const FPString &id, const FPString &units, FitJob *job)
 Initializes the property object. This method must be called if the default constructor was used to create this property.
 
bool shouldCompute (bool isFitting) const
 Returns whether this property should be computed because it is included in the fit and/or in the output.
 
virtual void compute ()
 Lets the property object compute the current value of the property.
 
void assignAbsoluteWeights (double absoluteWeight) override
 Recursively assigns absolute weights to the properties.
 
double absoluteWeight () const
 Returns the absolute fit weight assigned to this object.
 
double tolerance () const
 Returns the tolerance assigned to this fit property.
 
void setTolerance (double tolerance)
 Sets the tolerance assigned to this fit property.
 
ResidualNorm residualNorm () const
 Returns how residual contributions are calculated by this property.
 
const FPStringunits () const
 Returns the units of this property.
 
- Public Member Functions inherited from atomicrex::FitObject
virtual ~FitObject ()=default
 Virtual destructor.
 
double relativeWeight () const
 Returns the relative fit weight assigned to this object.
 
void setRelativeWeight (double weight)
 Assigns a relative fit weight to this object.
 
virtual bool computeProperties (bool isFitting)
 Computes all enabled properties of the object.
 
const std::vector< FitProperty * > & properties () const
 Returns a list of fitting properties of this object.
 
void listAllProperties (std::vector< FitProperty *> &list) const
 Builds a list of properties of this object and all its sub-objects.
 
FitPropertypropertyById (const FPString &id) const
 Returns the property with the given ID.
 
const std::vector< DegreeOfFreedom * > & DOF () const
 Returns a list of degrees of freedom of this object.
 
void listAllDOF (std::vector< DegreeOfFreedom *> &list) const
 Builds a list of degrees of freedom of this object and all its sub-objects.
 
DegreeOfFreedomDOFById (const FPString &id, const FPString &tag=FPString()) const
 Returns the degree of freedom with the given ID (and tag).
 
virtual void dofValueChanged (DegreeOfFreedom &dof)
 This callback function is called by the DOFs of this fit object each time when their values changes.
 
const std::vector< FitObject * > & fitObjects () const
 Returns the list of FitObjects which are part of this group.
 
void registerSubObject (FitObject *subobject, bool deleteOnShutdown=false)
 Registers a sub-object.
 
bool fitEnabled () const
 Returns whether this object and it's children are included in the fit.
 
void setFitEnabled (bool enable)
 Sets whether this object and it's children are included in the fit.
 
bool outputEnabled () const
 
void setOutputEnabled (bool enable)
 
const FPStringid () const
 Returns the identifier of this object instance.
 
void setId (const FPString &id)
 Sets the main identification tag.
 
const FPStringtag () const
 Returns the assigned tag string.
 
void setTag (const FPString &tag)
 Sets the complementary identification tag.
 
FitJobjob () const
 Returns a pointer to the job to which this object belongs.
 
FitObjectparent () const
 Returns the parent of this object in the hierarchy.
 

Protected Attributes

std::vector< Vector3 > _computedValues
 This holds the computed values for the property.
 
std::vector< Vector3 > _targetValues
 The target values.
 
bool _outputAllEnabled = false
 Controls whether all elements of the vector are to printed if output is enabled.
 
bool _hasTargetValues = false
 Indicates that the target values have been set for this fit property.
 
- Protected Attributes inherited from atomicrex::FitProperty
double _absoluteWeight = 1.0
 The weight factor which is applied to the residual.
 
ResidualNorm _residualNorm = Squared
 Specifies how residual contributions are calculated.
 
FPString _units
 The units of this property.
 
- Protected Attributes inherited from atomicrex::FitObject
bool _fitEnabled = true
 Controls whether this object and it's children are included in the fit.
 
bool _outputEnabled = true
 
FitJob_job = nullptr
 Pointer to the job this object belongs to.
 
FPString _id
 The identifier string of this object instance.
 
double _relativeWeight = 1.0
 The relative fit weight assigned to this object.
 

Additional Inherited Members

- Public Types inherited from atomicrex::FitProperty
enum  ResidualNorm { UserDefined, Squared, SquaredRelative, AbsoluteDiff }
 Specifies how residual contributions are calculated. More...
 
- Protected Member Functions inherited from atomicrex::FitObject
 FitObject ()
 Default Constructor.
 
 FitObject (const FPString &id, FitJob *job, const FPString &tag=FPString())
 Constructor.
 
void registerProperty (FitProperty *prop, bool deleteOnShutdown=false)
 Registers a property of this object.
 
void registerDOF (DegreeOfFreedom *dof)
 Registers a DOF of this object.
 

Detailed Description

This class implements a property that consists of an array of Vector3 values, which can be used for example to fit forces.


The documentation for this class was generated from the following files: