Namespace Scine

namespace Scine
namespace Core
class SettingsKeyError : public exception
#include <Exceptions.h>

An Exception for an error when handling keys in settings.

class SettingsValueError : public exception
#include <Exceptions.h>

An Exception for an error when handling values in settings.

class ClassNotImplementedError : public exception
#include <Exceptions.h>

An Exception for an error when generating classes through a module-interface.

class FunctionNotImplementedError : public exception
#include <Exceptions.h>

An Exception for an error when a function in a module-interface is not implemented.

class InvalidPropertiesException : public runtime_error
#include <Exceptions.h>

Exception thrown when one requires properties from a calculation which cannot be calculated.

class CalculationException : public runtime_error
#include <Exceptions.h>

Base class for exceptions thrown during calculations.

Subclassed by Scine::Core::EmptyMolecularStructureException, Scine::Core::InitializationException, Scine::Core::StateSavingException, Scine::Core::UnsuccessfulCalculationException

class InitializationException : public Scine::Core::CalculationException
#include <Exceptions.h>

Exception thrown when a problem arises in the calculator initialization.

class EmptyMolecularStructureException : public Scine::Core::CalculationException
#include <Exceptions.h>

Exception thrown when launching a calculation with an empty structure.

class UnsuccessfulCalculationException : public Scine::Core::CalculationException
#include <Exceptions.h>

Exception thrown when a calculation is unsuccessful.

class StateSavingException : public Scine::Core::CalculationException
#include <Exceptions.h>

Exception thrown for errors in state saving / resetting.

class Calculator
#include <Calculator.h>

The interface for all classes running electronic structure calculations.

class Module
#include <Module.h>

Abstract base class for a module, which flexibly provides consumers with common interface derived classes.

Modules supply consumers with instances of types satisfying a particular common interface concept. Any library that wishes to provide classes satisfying interfaces defined in Core must implement a single derived class of this interface.

Implementation notes:

  • The has / get interface of a module is double-blind so that it can be used polymorphically within the ModuleManager. Its interface does not require knowledge of the Interface class nor the type of the model that satisfies it. This is for ease of implementation for derived classes.

  • Get returns a type-erased wrapper around a shared_ptr to the base class of the interface that the desired model satisfies.

A class deriving from Module that will be part of a compilation unit intended to become a runtime dynamically-loaded library must offer an entry point for ModuleManager at global scope. A Module-derived class header file should look roughly like this:

* #include <Core/Module.h>
* #include <boost/hana/define_struct.hpp>
* #include <boost/dll/alias.hpp>
* #include <memory>
*
* namespace XYZ {
*
* class FooModule : public Core::Module {
* public:
*   // Use hana to define member variables that contain the model string
*   // name for interfaces for which you have at least one model
*   BOOST_HANA_DEFINE_STRUCT(FooModule, (std::vector<std::string>, sampleInterfaceName), ...);
*
*   // In your module constructor, populate your previously defined vec<str>
*   // members with the interfaces' model identifiers that you provide
*   FooModule(...) {
*     sampleInterfaceName = {"sampleModelName"};
*   }
*
*   // Implement name() and get(...)
*   // Use DerivedModule.h to implement has(...), announceInterfaces(),
*   //   announceModels(...)
*
*   // Add a factory
*   static std::shared_ptr<Core::Module> make() {
*     return std::make_shared<FooModule>(...);
*   }
* };
* } // namespace XYZ
*
* // At global scope, declare an entry point called "moduleFactory"
* BOOST_DLL_ALIAS(XYZ::FooModule::make, moduleFactory)
* 

Mandatory virtual interface

Announces the module’s name

class ModuleManager
#include <ModuleManager.h>

The manager for all dynamically loaded modules.

This class is a singleton, in order to ensure that there is only ever one instance of this class controlling all modules loaded.

Use this class by requesting a reference to the single existing instance:

* const auto& manager = ModuleManager::getInstance()
* if(manager.has<Calculator>("DFT")) {
*   auto calculator = manager.get<Calculator>("DFT");
* }
* 

namespace DerivedModule

Functions

template<typename Derived>
bool has(const std::string &interface, const std::string &model, const Derived &derived)
template<typename Derived>
std::vector<std::string> announceInterfaces(const Derived &derived)
template<typename Derived>
std::vector<std::string> announceModels(const std::string &interface, const Derived &derived)
template<typename Derived>
void checkInvariants(const Derived &derived)
namespace Utils

Typedefs

using PositionCollection = Eigen::Matrix<double, Eigen::Dynamic, 3, Eigen::RowMajor>