ESPResSo
Extensible Simulation Package for Research on Soft Matter Systems
|
Namespaces | |
namespace | Accumulators |
namespace | Analysis |
namespace | BondBreakage |
namespace | CellSystem |
namespace | ClusterAnalysis |
namespace | CodeInfo |
namespace | CollisionDetection |
namespace | Constraints |
namespace | Coulomb |
namespace | Dipoles |
namespace | Galilei |
namespace | Integrators |
namespace | Interactions |
namespace | LeesEdwards |
namespace | Math |
namespace | MPIIO |
namespace | Observables |
namespace | PairCriteria |
namespace | Particles |
namespace | Profiler |
namespace | ReactionMethods |
namespace | Scafacos |
namespace | Shapes |
namespace | System |
namespace | Thermostat |
namespace | walberla |
namespace | Writer |
Classes | |
struct | AutoParameter |
Description and getter/setter for a parameter. More... | |
class | AutoParameters |
Bind parameters in the script interface. More... | |
class | Context |
Context of an object handle. More... | |
class | ContextManager |
Manage object contexts. More... | |
struct | Exception |
class | GlobalContext |
Global synchronizing context. More... | |
class | LatticeIndices |
Interface to carry out simple operations on lattice indices. More... | |
class | LocalContext |
Trivial context. More... | |
class | None |
Type to indicate no value in Variant. More... | |
class | ObjectHandle |
Base class for interface handles. More... | |
class | ObjectList |
Owning list of ObjectHandles. More... | |
class | ObjectMap |
Owning map of ObjectHandles. More... | |
struct | ObjectState |
State of an object ready for serialization. More... | |
struct | PackVisitor |
Visitor that converts a Variant to a PackedVariant. More... | |
class | ParallelExceptionHandler |
Handle exceptions thrown in MPI parallel code. More... | |
struct | UnpackVisitor |
Visitor that converts a PackedVariant to a Variant. More... | |
Typedefs | |
template<template< typename... > class Container, typename ManagedType , class BaseType , class = std::enable_if_t<std::is_base_of_v<ObjectHandle, ManagedType>>> | |
using | ObjectContainer = std::conditional_t< std::is_same_v< BaseType, ObjectHandle >, AutoParameters< Container< ManagedType, BaseType >, BaseType >, BaseType > |
Base class for containers whose BaseType might be a full specialization of AutoParameters. | |
using | ObjectId = std::size_t |
using | PackedVariant = boost::make_recursive_variant< None, bool, int, std::size_t, double, std::string, ObjectId, Utils::Vector3b, Utils::Vector3i, Utils::Vector2d, Utils::Vector3d, Utils::Vector4d, std::vector< int >, std::vector< double >, std::vector< boost::recursive_variant_ >, std::unordered_map< int, boost::recursive_variant_ >, std::unordered_map< std::string, boost::recursive_variant_ > >::type |
Packed version of Variant. | |
using | PackedMap = std::vector< std::pair< std::string, PackedVariant > > |
using | ObjectRef = std::shared_ptr< ObjectHandle > |
using | Variant = boost::make_recursive_variant< None, bool, int, std::size_t, double, std::string, ObjectRef, Utils::Vector3b, Utils::Vector3i, Utils::Vector2d, Utils::Vector3d, Utils::Vector4d, std::vector< int >, std::vector< double >, std::vector< boost::recursive_variant_ >, std::unordered_map< int, boost::recursive_variant_ >, std::unordered_map< std::string, boost::recursive_variant_ > >::type |
Possible types for parameters. | |
using | VariantMap = std::unordered_map< std::string, Variant > |
Functions | |
template<typename T > | |
T | mpi_reduce_sum (boost::mpi::communicator const &comm, T const &result) |
Reduce object by sum on the head node. | |
template<typename T > | |
T | get_value (Variant const &v) |
Extract value of specific type T from a Variant. | |
template<typename T > | |
T | get_value (VariantMap const &vals, std::string const &name) |
Get a value from a VariantMap by name, or throw if it does not exist or is not convertible to the target type. | |
template<typename T > | |
T | get_value_or (VariantMap const &vals, std::string const &name, T const &default_) |
Get a value from a VariantMap by name, or return a default value if it does not exist. | |
template<typename T , typename... Types, typename... ArgNames> | |
std::shared_ptr< T > | make_shared_from_args (VariantMap const &vals, ArgNames &&...args) |
Make a new std::shared_ptr<T> with arguments extracted from a VariantMap. | |
template<typename T > | |
void | set_from_args (T &dst, VariantMap const &vals, const char *name) |
void | initialize (Utils::Factory< ObjectHandle > *f) |
ObjectId | object_id (const ObjectHandle *p) |
Id for object. | |
PackedVariant | pack (const Variant &v) |
Transform a Variant to a PackedVariant. | |
Variant | unpack (const PackedVariant &v, std::unordered_map< ObjectId, ObjectRef > const &objects) |
Unpack a PackedVariant. | |
PackedMap | pack (const VariantMap &v) |
Pack a VariantMap. | |
VariantMap | unpack (const PackedMap &v, std::unordered_map< ObjectId, ObjectRef > const &objects) |
Unpack a PackedMap. | |
template<typename T > | |
Variant | make_variant (const T &x) |
Make a Variant from argument. | |
template<typename K , typename V > | |
auto | make_unordered_map_of_variants (std::unordered_map< K, V > const &v) |
template<typename T > | |
auto | make_vector_of_variants (std::vector< T > const &v) |
template<class T > | |
bool | is_type (Variant const &v) |
Check is a Variant holds a specific type. | |
bool | is_none (Variant const &v) |
Variables | |
constexpr const None | none {} |
None-"literal". | |
using ScriptInterface::ObjectContainer = typedef std::conditional_t< std::is_same_v<BaseType, ObjectHandle>, AutoParameters<Container<ManagedType, BaseType>, BaseType>, BaseType> |
Base class for containers whose BaseType
might be a full specialization of AutoParameters.
Definition at line 36 of file ObjectContainer.hpp.
using ScriptInterface::ObjectId = typedef std::size_t |
Definition at line 33 of file packed_variant.hpp.
using ScriptInterface::ObjectRef = typedef std::shared_ptr<ObjectHandle> |
Definition at line 46 of file Variant.hpp.
using ScriptInterface::PackedMap = typedef std::vector<std::pair<std::string, PackedVariant> > |
Definition at line 63 of file packed_variant.hpp.
using ScriptInterface::PackedVariant = typedef boost::make_recursive_variant< None, bool, int, std::size_t, double, std::string, ObjectId, Utils::Vector3b, Utils::Vector3i, Utils::Vector2d, Utils::Vector3d, Utils::Vector4d, std::vector<int>, std::vector<double>, std::vector<boost::recursive_variant_>, std::unordered_map<int, boost::recursive_variant_>, std::unordered_map<std::string, boost::recursive_variant_> >::type |
Packed version of Variant.
When packing variants by PackVisitor, objects of type ObjectRef are packed as ObjectId. Other than that, all other types allowed in Variant must appear here.
Definition at line 55 of file packed_variant.hpp.
using ScriptInterface::Variant = typedef boost::make_recursive_variant< None, bool, int, std::size_t, double, std::string, ObjectRef, Utils::Vector3b, Utils::Vector3i, Utils::Vector2d, Utils::Vector3d, Utils::Vector4d, std::vector<int>, std::vector<double>, std::vector<boost::recursive_variant_>, std::unordered_map<int, boost::recursive_variant_>, std::unordered_map<std::string, boost::recursive_variant_> >::type |
Possible types for parameters.
The visitors and packing functions need to be adapted accordingly when extending this variant with new types. For the exact details, see commit b48ab62. The number of types is limited by macro BOOST_MPL_LIMIT_LIST_SIZE
(defaults to 20).
Definition at line 61 of file Variant.hpp.
using ScriptInterface::VariantMap = typedef std::unordered_map<std::string, Variant> |
Definition at line 69 of file Variant.hpp.
T ScriptInterface::get_value | ( | Variant const & | v | ) |
Extract value of specific type T from a Variant.
This is a wrapper around boost::get that allows us to customize the behavior for different types. This is needed e.g. to deal with containers whose elements have mixed types that are implicitly convertible to a requested type.
Definition at line 400 of file get_value.hpp.
Referenced by ScriptInterface::walberla::EKReaction::calculate_bulk_conversion_factor(), ScriptInterface::walberla::EKSpecies::do_call_method(), ScriptInterface::Particles::Polymer::do_call_method(), ScriptInterface::walberla::LBFluid::do_call_method(), ScriptInterface::walberla::EKReactant::do_construct(), ScriptInterface::Coulomb::ICCStar::do_construct(), ScriptInterface::Integrators::StokesianDynamics::do_construct(), ScriptInterface::Observables::CylindricalPidProfileObservable< CoreObs >::do_construct(), ScriptInterface::ReactionMethods::SingleReaction::do_construct(), ScriptInterface::walberla::VTKHandleBase< Field >::do_construct(), ScriptInterface::ReactionMethods::ReactionAlgorithm::ReactionAlgorithm(), and ScriptInterface::System::System::System().
T ScriptInterface::get_value | ( | VariantMap const & | vals, |
std::string const & | name | ||
) |
Get a value from a VariantMap by name, or throw if it does not exist or is not convertible to the target type.
Definition at line 410 of file get_value.hpp.
T ScriptInterface::get_value_or | ( | VariantMap const & | vals, |
std::string const & | name, | ||
T const & | default_ | ||
) |
Get a value from a VariantMap by name, or return a default value if it does not exist.
Definition at line 422 of file get_value.hpp.
Referenced by ScriptInterface::ReactionMethods::ConstantpHEnsemble::do_construct(), and ScriptInterface::ReactionMethods::ReactionEnsemble::do_construct().
void ScriptInterface::initialize | ( | Utils::Factory< ObjectHandle > * | f | ) |
Definition at line 52 of file initialize.cpp.
References ScriptInterface::BondBreakage::initialize(), ScriptInterface::Shapes::initialize(), ScriptInterface::Accumulators::initialize(), ScriptInterface::Analysis::initialize(), ScriptInterface::CellSystem::initialize(), ScriptInterface::ClusterAnalysis::initialize(), ScriptInterface::CodeInfo::initialize(), ScriptInterface::CollisionDetection::initialize(), ScriptInterface::Constraints::initialize(), ScriptInterface::Coulomb::initialize(), ScriptInterface::Galilei::initialize(), ScriptInterface::Writer::initialize(), ScriptInterface::Integrators::initialize(), ScriptInterface::Interactions::initialize(), ScriptInterface::LeesEdwards::initialize(), ScriptInterface::Dipoles::initialize(), ScriptInterface::Math::initialize(), ScriptInterface::MPIIO::initialize(), ScriptInterface::Observables::initialize(), ScriptInterface::PairCriteria::initialize(), ScriptInterface::Particles::initialize(), ScriptInterface::Profiler::initialize(), ScriptInterface::ReactionMethods::initialize(), ScriptInterface::System::initialize(), ScriptInterface::Thermostat::initialize(), and ScriptInterface::walberla::initialize().
|
inline |
Definition at line 115 of file Variant.hpp.
Referenced by ScriptInterface::CollisionDetection::CollisionDetection::CollisionDetection(), ScriptInterface::Coulomb::Container::Container(), ScriptInterface::Dipoles::Container::Container(), ScriptInterface::walberla::EKFieldSerializer::deserialize(), ScriptInterface::walberla::LBFieldSerializer::deserialize(), ScriptInterface::LeesEdwards::LeesEdwards::do_call_method(), ScriptInterface::walberla::EKSpeciesNode::do_call_method(), ScriptInterface::walberla::LBFluidNode::do_call_method(), ScriptInterface::Coulomb::CoulombP3M< Architecture >::do_construct(), ScriptInterface::Dipoles::DipolarP3M< Architecture >::do_construct(), ScriptInterface::Thermostat::Interface< CoreClass >::Interface(), ScriptInterface::Thermostat::Interface< CoreClass >::invalid_rng_state(), ScriptInterface::Thermostat::LBThermostat::invalid_rng_state(), ScriptInterface::Thermostat::LBThermostat::LBThermostat(), ScriptInterface::LeesEdwards::LeesEdwards::LeesEdwards(), and ScriptInterface::Thermostat::Interface< CoreClass >::make_autogamma().
bool ScriptInterface::is_type | ( | Variant const & | v | ) |
Check is a Variant holds a specific type.
T | type to check for |
v | Variant to check in |
Definition at line 111 of file Variant.hpp.
Referenced by ScriptInterface::walberla::EKFieldSerializer::deserialize(), ScriptInterface::walberla::LBFieldSerializer::deserialize(), ScriptInterface::Coulomb::CoulombP3M< Architecture >::do_construct(), and ScriptInterface::Dipoles::DipolarP3M< Architecture >::do_construct().
std::shared_ptr< T > ScriptInterface::make_shared_from_args | ( | VariantMap const & | vals, |
ArgNames &&... | args | ||
) |
Make a new std::shared_ptr<T> with arguments extracted from a VariantMap.
Definition at line 435 of file get_value.hpp.
Referenced by ScriptInterface::Writer::H5md::do_construct(), ScriptInterface::Observables::LBProfileObservable< CoreLBObs >::do_construct(), ScriptInterface::Interactions::InteractionLJ::make_new_instance(), ScriptInterface::Interactions::InteractionLJGen::make_new_instance(), ScriptInterface::Interactions::InteractionBMHTF::make_new_instance(), ScriptInterface::Interactions::InteractionBuckingham::make_new_instance(), ScriptInterface::Interactions::InteractionGayBerne::make_new_instance(), ScriptInterface::Interactions::InteractionTabulated::make_new_instance(), ScriptInterface::Interactions::InteractionDPD::make_new_instance(), and ScriptInterface::Interactions::InteractionSmoothStep::make_new_instance().
auto ScriptInterface::make_unordered_map_of_variants | ( | std::unordered_map< K, V > const & | v | ) |
Definition at line 80 of file Variant.hpp.
Referenced by ScriptInterface::ObjectMap< ManagedType, BaseType, KeyType >::do_call_method(), ScriptInterface::Analysis::Analysis::do_call_method(), ScriptInterface::System::CudaInitHandle::do_call_method(), ScriptInterface::System::System::do_call_method(), ScriptInterface::ObjectMap< ManagedType, BaseType, KeyType >::ObjectMap(), ScriptInterface::ReactionMethods::ReactionAlgorithm::ReactionAlgorithm(), ScriptInterface::Integrators::StokesianDynamics::StokesianDynamics(), and ScriptInterface::walberla::VTKHandleBase< Field >::VTKHandleBase().
Variant ScriptInterface::make_variant | ( | const T & | x | ) |
Make a Variant from argument.
This is a convenience function, so that rather involved constructors from boost::variant are not needed in the script interfaces.
Definition at line 77 of file Variant.hpp.
Referenced by ScriptInterface::CollisionDetection::CollisionDetection::CollisionDetection(), and ScriptInterface::LeesEdwards::LeesEdwards::LeesEdwards().
auto ScriptInterface::make_vector_of_variants | ( | std::vector< T > const & | v | ) |
Definition at line 88 of file Variant.hpp.
Referenced by ScriptInterface::Writer::H5md::do_call_method(), ScriptInterface::ObjectList< ManagedType, BaseType >::do_call_method(), ScriptInterface::Analysis::Analysis::do_call_method(), ScriptInterface::CodeInfo::CodeInfo::do_call_method(), ScriptInterface::Particles::Polymer::do_call_method(), ScriptInterface::Coulomb::CoulombScafacos::do_call_method(), ScriptInterface::Dipoles::DipolarScafacos::do_call_method(), ScriptInterface::Particles::ParticleHandle::do_call_method(), ScriptInterface::walberla::VTKHandleBase< Field >::do_call_method(), ScriptInterface::Writer::H5md::H5md(), ScriptInterface::Coulomb::ICCStar::ICCStar(), ScriptInterface::ObjectList< ManagedType, BaseType >::ObjectList(), ScriptInterface::walberla::EKFieldSerializer::serialize(), ScriptInterface::walberla::LBFieldSerializer::serialize(), and ScriptInterface::walberla::LatticeModel< Method, VTKHandle >::serialize_vtk_writers().
T ScriptInterface::mpi_reduce_sum | ( | boost::mpi::communicator const & | comm, |
T const & | result | ||
) |
Reduce object by sum on the head node.
Worker nodes get a default-constructed object.
Definition at line 35 of file script_interface/communication.hpp.
Referenced by ScriptInterface::Analysis::Analysis::do_call_method().
|
inline |
Id for object.
This assigns every ObjectHandle a unique id.
Definition at line 40 of file packed_variant.hpp.
Referenced by ScriptInterface::GlobalContext::make_shared(), ScriptInterface::GlobalContext::notify_call_method(), ScriptInterface::GlobalContext::notify_set_parameter(), and ScriptInterface::PackVisitor::operator()().
|
inline |
Transform a Variant to a PackedVariant.
Applies PackVisitor to a Variant.
v | Input Variant |
Definition at line 169 of file packed_variant.hpp.
Referenced by ScriptInterface::Particles::Polymer::do_call_method(), ScriptInterface::System::System::get_internal_state(), ScriptInterface::GlobalContext::notify_call_method(), ScriptInterface::GlobalContext::notify_set_parameter(), and ScriptInterface::Scafacos::serialize_parameters().
|
inline |
Pack a VariantMap.
Applies pack to every value in the input map.
Definition at line 193 of file packed_variant.hpp.
void ScriptInterface::set_from_args | ( | T & | dst, |
VariantMap const & | vals, | ||
const char * | name | ||
) |
Definition at line 442 of file get_value.hpp.
Referenced by ScriptInterface::Accumulators::Correlator::do_construct(), ScriptInterface::Accumulators::MeanVarianceCalculator::do_construct(), ScriptInterface::Accumulators::TimeSeries::do_construct(), ScriptInterface::Observables::CylindricalLBProfileObservable< CoreCylLBObs >::do_construct(), ScriptInterface::Observables::CylindricalPidProfileObservable< CoreObs >::do_construct(), and ScriptInterface::Shapes::HollowConicalFrustum::do_construct().
|
inline |
Unpack a PackedMap.
Applies unpack to every value in the input map.
Definition at line 210 of file packed_variant.hpp.
References unpack().
|
inline |
Unpack a PackedVariant.
Applies UnpackVisitor to a Variant.
v | Packed Variant. |
objects | Map of ids to reference. |
Definition at line 182 of file packed_variant.hpp.
Referenced by ScriptInterface::System::System::set_internal_state(), and unpack().
|
constexpr |
None-"literal".
Definition at line 50 of file Variant.hpp.
Referenced by ScriptInterface::CellSystem::CellSystem::CellSystem(), ScriptInterface::CollisionDetection::CollisionDetection::CollisionDetection(), ScriptInterface::ObjectHandle::do_call_method(), ScriptInterface::Constraints::ExternalField< Coupling, Field >::do_call_method(), ScriptInterface::Constraints::ExternalPotential< Coupling, Field >::do_call_method(), ScriptInterface::ObjectList< ManagedType, BaseType >::do_call_method(), ScriptInterface::ObjectMap< ManagedType, BaseType, KeyType >::do_call_method(), ScriptInterface::walberla::EKIndexedReaction::do_call_method(), ScriptInterface::Constraints::ShapeBasedConstraint::do_call_method(), ScriptInterface::Integrators::Integrator::do_call_method(), ScriptInterface::walberla::EKContainer::do_construct(), ScriptInterface::LeesEdwards::LeesEdwards::LeesEdwards(), and ScriptInterface::ReactionMethods::WidomInsertion::WidomInsertion().