7 #ifndef CORE_CALCULATOR_H_
8 #define CORE_CALCULATOR_H_
32 static constexpr
const char*
interface = "calculator";
62 virtual const Utils::Results&
calculate(std::string description =
"") = 0;
67 virtual std::string
name()
const = 0;
74 std::unique_ptr<Core::Calculator>
clone()
const {
75 return std::unique_ptr<Core::Calculator>(this->cloneImpl());
81 virtual Utils::Settings&
settings() = 0;
86 virtual const Utils::Settings&
settings()
const = 0;
91 virtual Utils::Results&
results() = 0;
96 virtual const Utils::Results&
results()
const = 0;
114 static auto supports(
const std::string& methodFamily) {
115 return [methodFamily](
const std::shared_ptr<Calculator>& calculatorPtr) ->
bool {
116 return calculatorPtr->supportsMethodFamily(methodFamily);
virtual void setRequiredProperties(const Utils::PropertyList &requiredProperties)=0
Sets the properties to calculate.
An interface for all objects that should have a handable state.
Definition: StateHandableObject.h:39
Base class for objects with a Log member.
Definition: ObjectWithLog.h:25
virtual Utils::PropertyList getRequiredProperties() const =0
Gets the current properties to calculate.
virtual bool supportsMethodFamily(const std::string &methodFamily) const =0
Whether the calculator supports a method family.
static auto supports(const std::string &methodFamily)
Predicate-generator for ModuleManager's get<Interface, UnaryPredicate> function.
Definition: Calculator.h:114
Calculator()=default
Default constructor.
The interface for all classes running electronic structure calculations.
Definition: Calculator.h:30
Interface class defining an entity having a molecular structure. This solves the diamond inheritance ...
Definition: ObjectWithStructure.h:27
virtual Utils::Results & results()=0
Accessor for the saved instance of Utils::Results.
virtual Utils::Settings & settings()=0
Accessor for the settings.
virtual std::string name() const =0
Getter for the name of the Calculator.
virtual const Utils::Results & calculate(std::string description="")=0
The main function running calculations.
std::unique_ptr< Core::Calculator > clone() const
Method allowing to clone the derived class into a Core::Calculator The derived, leaf class needs to i...
Definition: Calculator.h:74
virtual ~Calculator()=default
Default destructor.
virtual Utils::PropertyList possibleProperties() const =0
Returns the list of the possible properties to calculate analytically. By some method analytical hess...