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

A simple scalar degree of freedom that consists of a single value. More...

#include <DegreeOfFreedom.h>

Inheritance diagram for atomicrex::ScalarDOF:
atomicrex::DegreeOfFreedom

Public Member Functions

 ScalarDOF (const FPString &id=FPString(), double defaultValue=0, double minValue=-std::numeric_limits< double >::infinity(), double maxValue=std::numeric_limits< double >::infinity())
 Constructor.
 
 operator double () const
 Returns the current value of the DOF.
 
double getValue ()
 Returns the current value of the DoF.
 
ScalarDOFoperator= (double value)
 Assigns a new value to the DOF.
 
void setValue (double value)
 Assigns a new value to the DOF.
 
double * getValuePointer ()
 Returns a pointer to the internal storage field of this DoF.
 
void setInitialValue (double value)
 Sets the initial value of this DOF. This also changes the current value to the same value.
 
double initialValue () const
 Returns the initial value of this DOF.
 
virtual void reset () override
 Resets the value of the DOF to what was given in the job file.
 
virtual int numScalars () override
 Returns the number of scalar degrees of freedom this DOF is composed of.
 
virtual void exportValue (double *&dst) override
 Lets the DOF export its current value(s) into the given value array.
 
virtual void importValue (const double *&src) override
 Lets the DOF import its value(s) from the given value array.
 
virtual void print (MsgLogger &stream) override
 Outputs the current value of the DOF.
 
double lowerBound () const
 Returns the lower bound if this DOF has a constraint applied to it.
 
bool hasLowerBound () const
 Returns whether this DOF has a lower bound constraint applied to it.
 
void setLowerBound (double lowerBound)
 Sets a lower bound constraint on this DOF.
 
double upperBound () const
 Returns the upper bound if this DOF has a constraint applied to it.
 
bool hasUpperBound () const
 Returns whether this DOF has an upper bound constraint applied to it.
 
void setUpperBound (double upperBound)
 Sets an upper bound constraint on this DOF.
 
virtual bool hasBoundConstraints () const override
 Returns whether this DOF has any bound constraints applied to it.
 
virtual bool satisfiesBoundConstraints () const override
 Returns whether this DOF satisfies the bound constraints applied to it.
 
virtual void getBoundConstraints (std::vector< Minimizer::BoundConstraints >::iterator &types, std::vector< double >::iterator &lowerBounds, std::vector< double >::iterator &upperBounds) override
 Lets the DOF write its constraints information to the given linear arrays.
 
bool setEqualTo (ScalarDOF *masterDOF)
 Sets this DOF to be equal to another DOF. More...
 
virtual void parseFit (XML::Element fitElement) override
 Parse the contents of the <fit> element in the job file.
 
virtual void parseRelax (XML::Element relaxElement) override
 Parse the contents of the <relax> element in the job file.
 
void parseSetEqualToAttribute (XML::Element element)
 Parses the 'equalto' attribute and links the DOF to another master DOF.
 
virtual XML::OElement generateXMLValueDefinition () const override
 Produces an XML representation of the DOF's current value.
 
virtual XML::OElement generateXMLFitDefinition () const override
 Produces an XML representation of the DOF's fit settings.
 
- Public Member Functions inherited from atomicrex::DegreeOfFreedom
 DegreeOfFreedom (const FPString &id=FPString(), const FPString &tag=FPString())
 Constructor. More...
 
virtual ~DegreeOfFreedom ()
 Virtual destructor.
 
const FPStringid () const
 Return the identifier of this degree of freedom.
 
void setId (const FPString &id)
 Sets the identifier of this degree of freedom.
 
const FPStringtag () const
 Returns the tag on this DOF.
 
void setTag (const FPString &tag)
 Sets the tag on this DOF.
 
bool fitEnabled () const
 Returns whether this DOF should be varied during the fitting process.
 
void setFitEnabled (bool enable)
 Sets whether this DOF should be varied during the fitting process.
 
bool relax () const
 Returns whether this DOF should be relaxed during each iteration when fitting.
 
void setRelax (bool enable)
 Sets whether this DOF is being relaxed during each iteration when fitting.
 
FitObjectobject () const
 Returns a pointer to the potential or structure to which this DOF belongs.
 
bool resetBeforeRelax () const
 
void setResetBeforeRelax (bool enableReset)
 

Detailed Description

A simple scalar degree of freedom that consists of a single value.

Member Function Documentation

◆ setEqualTo()

bool atomicrex::ScalarDOF::setEqualTo ( ScalarDOF masterDOF)

Sets this DOF to be equal to another DOF.

After calling this function the DOF will no longer be a real DOF. Every time the master DOF changes, the value of this DOF will be updated accordingly.


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