AvogadroLibs 1.97.0
|
Class to manage registration, searching and creation of partial charge models. More...
#include <chargemanager.h>
Public Member Functions | |
bool | addModel (ChargeModel *model) |
bool | removeModel (const std::string &identifier) |
ChargeModel * | newModelFromIdentifier (const std::string &identifier) const |
std::set< std::string > | identifiers () const |
std::set< std::string > | identifiersForMolecule (const Core::Molecule &molecule) const |
Get a list of models that work for this molecule. More... | |
std::string | nameForModel (const std::string &identifier) const |
MatrixX | partialCharges (const std::string &identifier, Core::Molecule &mol) const |
double | potential (const std::string &identifier, Core::Molecule &mol, const Vector3 &point) const |
Core::Array< double > | potentials (const std::string &identifier, Core::Molecule &mol, const Core::Array< Vector3 > &points) const |
std::string | error () const |
Static Public Member Functions | |
static ChargeManager & | instance () |
static bool | registerModel (ChargeModel *model) |
Register a new charge model with the manager. More... | |
static bool | unregisterModel (const std::string &identifier) |
Unregister a charge model from the manager. More... | |
<avogadro/calc/chargemanager.h>
The charge manager is a singleton class that handles the runtime registration, search, creation and eventual destruction of electrostatics models. It can be used to gain a listing of available models, register new models, etc.
All electrostatics can take place independent of this code, but for automated registration and look up, this is the preferred API. It is possible to use the convenience API without ever dealing directly with a model class.
|
static |
Get the singleton instance of the charge manager. This instance should not be deleted.
|
static |
format | An instance of the format to manage, the manager assumes ownership of the object passed in. |
|
static |
identifier | The identifier for the model to remove. |
bool addModel | ( | ChargeModel * | model | ) |
Add the supplied model
to the manager, registering its ID and other relevant data for later lookup. The manager assumes ownership of the supplied object.
bool removeModel | ( | const std::string & | identifier | ) |
Remove the model with the identifier identifier from the manager.
ChargeModel * newModelFromIdentifier | ( | const std::string & | identifier | ) | const |
New instance of the model for the specified identifier
. Ownership is passed to the caller.
identifier | The unique identifier of the format. |
std::set< std::string > identifiers | ( | ) | const |
Get a list of all loaded identifiers
std::set< std::string > identifiersForMolecule | ( | const Core::Molecule & | molecule | ) | const |
Includes partial charge types in the molecule itself (e.g., from a file) This is probably the method you want to get a list for a user
MatrixX partialCharges | ( | const std::string & | identifier, |
Core::Molecule & | mol | ||
) | const |
Note that some models do not have well-defined atomic partial charges
double potential | ( | const std::string & | identifier, |
Core::Molecule & | mol, | ||
const Vector3 & | point | ||
) | const |
Core::Array< double > potentials | ( | const std::string & | identifier, |
Core::Molecule & | mol, | ||
const Core::Array< Vector3 > & | points | ||
) | const |
std::string error | ( | ) | const |
Get any errors that have been logged when loading models.