ESPResSo
Extensible Simulation Package for Research on Soft Matter Systems
Loading...
Searching...
No Matches
ScriptInterface::ReactionMethods::ReactionAlgorithm Class Referenceabstract

#include <ReactionAlgorithm.hpp>

+ Inheritance diagram for ScriptInterface::ReactionMethods::ReactionAlgorithm:
+ Collaboration diagram for ScriptInterface::ReactionMethods::ReactionAlgorithm:

Public Member Functions

virtual std::shared_ptr<::ReactionMethods::ReactionAlgorithmRE ()=0
 
virtual std::shared_ptr<::ReactionMethods::ReactionAlgorithm > const RE () const =0
 
 ReactionAlgorithm ()
 
Variant do_call_method (std::string const &name, VariantMap const &params) override
 
- Public Member Functions inherited from ScriptInterface::AutoParameters< ReactionAlgorithm >
std::span< const boost::string_ref > valid_parameters () const final
 
Variant get_parameter (const std::string &name) const final
 
void do_set_parameter (const std::string &name, const Variant &value) final
 
std::vector< std::pair< std::string, Variant > > serialize_parameters () const final
 
- Public Member Functions inherited from ScriptInterface::ObjectHandle
 ObjectHandle ()=default
 
 ObjectHandle (ObjectHandle const &)=delete
 
ObjectHandleoperator= (ObjectHandle const &)=delete
 
virtual ~ObjectHandle ()=default
 
boost::string_ref name () const
 
Contextcontext () const
 Responsible context.
 
void construct (VariantMap const &params)
 Construct the handled object.
 
virtual void do_construct (VariantMap const &params)
 
VariantMap get_parameters () const
 Get current parameters.
 
auto get_valid_parameters () const
 
void set_parameter (const std::string &name, const Variant &value)
 Set single parameter.
 
Variant call_method (const std::string &name, const VariantMap &params)
 Call a method on the object.
 
std::string serialize () const
 

Protected Member Functions

int get_reaction_index (int reaction_id) const
 Check reaction id is within the reaction container bounds.
 
virtual double calculate_factorial_expression (::ReactionMethods::SingleReaction const &reaction, std::unordered_map< int, int > const &particle_numbers) const
 
- Protected Member Functions inherited from ScriptInterface::AutoParameters< ReactionAlgorithm >
 AutoParameters ()=default
 
 AutoParameters (std::vector< AutoParameter > &&params)
 
void add_parameters (std::vector< AutoParameter > &&params)
 
auto const & get_parameter_insertion_order () const
 

Protected Attributes

std::vector< std::shared_ptr< SingleReaction > > m_reactions
 Keep track of the script interface pointer of each reaction.
 

Private Member Functions

std::string get_internal_state () const override
 

Additional Inherited Members

- Static Public Member Functions inherited from ScriptInterface::ObjectHandle
static ObjectRef deserialize (const std::string &state, Context &ctx)
 Make object from serialized state.
 

Detailed Description

Constructor & Destructor Documentation

◆ ReactionAlgorithm()

Member Function Documentation

◆ calculate_factorial_expression()

virtual double ScriptInterface::ReactionMethods::ReactionAlgorithm::calculate_factorial_expression ( ::ReactionMethods::SingleReaction const &  reaction,
std::unordered_map< int, int > const &  particle_numbers 
) const
inlineprotectedvirtual

◆ do_call_method()

◆ get_internal_state()

std::string ScriptInterface::ReactionMethods::ReactionAlgorithm::get_internal_state ( ) const
inlineoverrideprivatevirtual

Reimplemented from ScriptInterface::ObjectHandle.

Definition at line 85 of file script_interface/reaction_methods/ReactionAlgorithm.hpp.

References RE().

◆ get_reaction_index()

int ScriptInterface::ReactionMethods::ReactionAlgorithm::get_reaction_index ( int  reaction_id) const
inlineprotected

Check reaction id is within the reaction container bounds.

Since each reaction has a corresponding backward reaction, the total number of reactions is doubled. Return the corresponding index for ReactionAlgorithm::m_reactions.

Definition at line 50 of file script_interface/reaction_methods/ReactionAlgorithm.hpp.

References ScriptInterface::ObjectHandle::context(), m_reactions, and ScriptInterface::Context::parallel_try_catch().

Referenced by do_call_method(), and ScriptInterface::ReactionMethods::WidomInsertion::do_call_method().

◆ RE() [1/2]

virtual std::shared_ptr<::ReactionMethods::ReactionAlgorithm > const ScriptInterface::ReactionMethods::ReactionAlgorithm::RE ( ) const
pure virtual

◆ RE() [2/2]

Member Data Documentation

◆ m_reactions

std::vector<std::shared_ptr<SingleReaction> > ScriptInterface::ReactionMethods::ReactionAlgorithm::m_reactions
protected

Keep track of the script interface pointer of each reaction.

Definition at line 43 of file script_interface/reaction_methods/ReactionAlgorithm.hpp.

Referenced by do_call_method(), get_reaction_index(), and ReactionAlgorithm().


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