Page Menu
Home
c4science
Search
Configure Global Search
Log In
Files
F70175716
kinetic_model.hpp
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Subscribers
None
File Metadata
Details
File Info
Storage
Attached
Created
Fri, Jul 5, 14:52
Size
1 KB
Mime Type
text/x-c++
Expires
Sun, Jul 7, 14:52 (2 d)
Engine
blob
Format
Raw Data
Handle
18801815
Attached To
rSPECMICP SpecMiCP / ReactMiCP
kinetic_model.hpp
View Options
#ifndef SPECMICP_SPECMICP_KINETICS_KINETICMODEL_HPP
#define SPECMICP_SPECMICP_KINETICS_KINETICMODEL_HPP
#include "common.hpp"
#include "kinetic_variables.hpp"
namespace specmicp {
namespace kinetics {
// \brief Base class for a kinetic model
class KineticModel
{
public:
KineticModel()
{}
KineticModel(const std::vector<index_t>& list_species):
m_list_species(list_species)
{}
virtual ~KineticModel() {}
//! \brief Return the number of kinetic minerals included in the problem
index_t get_neq() {return m_list_species.size();}
//! \brief Compute the kinetic rates and store them in dydt
virtual void compute_rate(
scalar_t t,
const Vector& y,
KineticVariables& variables,
Vector& dydt
) = 0;
void add_equation(index_t species) {m_list_species.push_back(species);}
//! \brief Index of species corresponding to equation 'id_equation'
index_t index_species(index_t id_equation) {return m_list_species[id_equation];}
//! \brief Iterator over the species vector
std::vector<index_t>::iterator species_begin() {return m_list_species.begin();}
std::vector<index_t>::iterator species_end() {return m_list_species.end();}
private:
std::vector<index_t> m_list_species;
};
} // end namespace kinetics
} // end namespace specmicp
#endif //SPECMICP_SPECMICP_KINETICS_KINETICMODEL_HPP
Event Timeline
Log In to Comment