AvogadroLibs 1.98.1
Loading...
Searching...
No Matches
Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
EnergyCalculator Class Referenceabstract
Inheritance diagram for EnergyCalculator:
LennardJones

Public Member Functions

virtual EnergyCalculatornewInstance () const =0
 
virtual std::string identifier () const =0
 
virtual std::string name () const =0
 
virtual std::string description () const =0
 
virtual bool setConfiguration (Core::VariantMap &config)
 
virtual Core::Molecule::ElementMask elements () const =0
 Indicate if your method only treats a subset of elements.
 
virtual bool acceptsUnitCell () const
 Indicate if your method can handle unit cells.
 
virtual bool acceptsIons () const
 Indicate if your method can handle ions Many methods only treat neutral systems, either a neutral molecule or a neutral unit cell.
 
virtual bool acceptsRadicals () const
 Indicate if your method can handle radicals Most methods only treat closed-shell molecules.
 
virtual void gradient (const TVector &x, TVector &grad) override
 
void cleanGradients (TVector &grad)
 
void setMask (TVector mask)
 
TVector mask () const
 
virtual void setMolecule (Core::Molecule *mol)=0
 

Protected Member Functions

void appendError (const std::string &errorString, bool newLine=true) const
 Append an error to the error string for the model.
 

Protected Attributes

TVector m_mask
 

Member Function Documentation

◆ newInstance()

virtual EnergyCalculator * newInstance ( ) const
pure virtual

Create a new instance of the model. Ownership passes to the caller.

Implemented in LennardJones.

◆ identifier()

virtual std::string identifier ( ) const
pure virtual
Returns
a unique identifier for this calculator.

Implemented in LennardJones.

◆ name()

virtual std::string name ( ) const
pure virtual
Returns
A short translatable name for this method (e.g., MMFF94, UFF, etc.)

Implemented in LennardJones.

◆ description()

virtual std::string description ( ) const
pure virtual
Returns
a description of the method

Implemented in LennardJones.

◆ setConfiguration()

virtual bool setConfiguration ( Core::VariantMap config)
virtual

Called to set the configuration (e.g., for a GUI options dialog)

◆ elements()

virtual Core::Molecule::ElementMask elements ( ) const
pure virtual
Returns
an element mask corresponding to the defined subset

Implemented in LennardJones.

◆ acceptsUnitCell()

virtual bool acceptsUnitCell ( ) const
virtual
Returns
true if unit cells are supported

Reimplemented in LennardJones.

◆ acceptsIons()

virtual bool acceptsIons ( ) const
virtual
Returns
true if ions are supported

◆ acceptsRadicals()

virtual bool acceptsRadicals ( ) const
virtual
Returns
true if radicals are supported

◆ gradient()

virtual void gradient ( const TVector &  x,
TVector &  grad 
)
overridevirtual

Calculate the gradients for this method, defaulting to numerical finite-difference methods

◆ cleanGradients()

void cleanGradients ( TVector &  grad)

Called to 'clean' gradients

Parameters
grad(e.g., for constraints)

◆ setMask()

void setMask ( TVector  mask)

Called to update the "frozen" mask (e.g., during editing)

◆ mask()

TVector mask ( ) const
Returns
the frozen atoms mask

◆ setMolecule()

virtual void setMolecule ( Core::Molecule mol)
pure virtual

Called when the current molecule changes.

Implemented in LennardJones.

◆ appendError()

void appendError ( const std::string &  errorString,
bool  newLine = true 
) const
protected
Parameters
errorStringThe error to be added.
newLineAdd a new line after the error string?

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