OGS
SelfContainedSolver.h
Go to the documentation of this file.
1
11
#pragma once
12
13
#include <Eigen/Sparse>
14
#include <memory>
15
16
#include "
ChemicalReaction.h
"
17
#include "
ChemistryLib/ChemicalSolverInterface.h
"
18
19
namespace
ChemistryLib
20
{
21
namespace
SelfContainedSolverData
22
{
23
class
SelfContainedSolver
final :
public
ChemicalSolverInterface
24
{
25
public
:
26
SelfContainedSolver
(
MeshLib::Mesh
const
& mesh,
27
GlobalLinearSolver
&
linear_solver
,
28
Eigen::SparseMatrix<double>
29
stoichiometric_matrix,
30
std::vector<std::unique_ptr<ChemicalReaction>>
31
chemical_reactions)
32
:
ChemicalSolverInterface
(mesh,
linear_solver
),
33
_stoichiometric_matrix
(stoichiometric_matrix),
34
_chemical_reactions
(std::move(chemical_reactions))
35
{
36
}
37
38
Eigen::SparseMatrix<double>
const
*
getStoichiometricMatrix
()
const override
39
{
40
return
&
_stoichiometric_matrix
;
41
}
42
43
double
getKineticPrefactor
(std::size_t reaction_id)
const override
44
{
45
return
_chemical_reactions
[reaction_id]->getKineticPrefactor();
46
}
47
48
private
:
49
Eigen::SparseMatrix<double>
_stoichiometric_matrix
;
50
std::vector<std::unique_ptr<ChemicalReaction>>
_chemical_reactions
;
51
};
52
}
// namespace SelfContainedSolverData
53
}
// namespace ChemistryLib
ChemicalReaction.h
ChemicalSolverInterface.h
ChemistryLib::ChemicalSolverInterface
Definition
ChemicalSolverInterface.h:33
ChemistryLib::ChemicalSolverInterface::linear_solver
GlobalLinearSolver & linear_solver
Definition
ChemicalSolverInterface.h:124
ChemistryLib::SelfContainedSolverData::SelfContainedSolver
Definition
SelfContainedSolver.h:24
ChemistryLib::SelfContainedSolverData::SelfContainedSolver::_chemical_reactions
std::vector< std::unique_ptr< ChemicalReaction > > _chemical_reactions
Definition
SelfContainedSolver.h:50
ChemistryLib::SelfContainedSolverData::SelfContainedSolver::getStoichiometricMatrix
Eigen::SparseMatrix< double > const * getStoichiometricMatrix() const override
Definition
SelfContainedSolver.h:38
ChemistryLib::SelfContainedSolverData::SelfContainedSolver::SelfContainedSolver
SelfContainedSolver(MeshLib::Mesh const &mesh, GlobalLinearSolver &linear_solver, Eigen::SparseMatrix< double > stoichiometric_matrix, std::vector< std::unique_ptr< ChemicalReaction > > chemical_reactions)
Definition
SelfContainedSolver.h:26
ChemistryLib::SelfContainedSolverData::SelfContainedSolver::_stoichiometric_matrix
Eigen::SparseMatrix< double > _stoichiometric_matrix
Definition
SelfContainedSolver.h:49
ChemistryLib::SelfContainedSolverData::SelfContainedSolver::getKineticPrefactor
double getKineticPrefactor(std::size_t reaction_id) const override
Definition
SelfContainedSolver.h:43
MathLib::EigenLisLinearSolver
Definition
EigenLisLinearSolver.h:31
MeshLib::Mesh
Definition
Mesh.h:43
ChemistryLib
Definition
ChemicalSolverInterface.h:31
ChemistryLib
SelfContainedSolverData
SelfContainedSolver.h
Generated by
1.12.0