OGS
SelfContainedSolver.h
Go to the documentation of this file.
1// SPDX-FileCopyrightText: Copyright (c) OpenGeoSys Community (opengeosys.org)
2// SPDX-License-Identifier: BSD-3-Clause
3
4#pragma once
5
6#include <Eigen/Sparse>
7#include <memory>
8
9#include "ChemicalReaction.h"
11
12namespace ChemistryLib
13{
15{
17{
18public:
21 Eigen::SparseMatrix<double>
22 stoichiometric_matrix,
23 std::vector<std::unique_ptr<ChemicalReaction>>
24 chemical_reactions)
26 _stoichiometric_matrix(stoichiometric_matrix),
27 _chemical_reactions(std::move(chemical_reactions))
28 {
29 }
30
31 Eigen::SparseMatrix<double> const* getStoichiometricMatrix() const override
32 {
34 }
35
36 double getKineticPrefactor(std::size_t reaction_id) const override
37 {
38 return _chemical_reactions[reaction_id]->getKineticPrefactor();
39 }
40
41private:
42 Eigen::SparseMatrix<double> _stoichiometric_matrix;
43 std::vector<std::unique_ptr<ChemicalReaction>> _chemical_reactions;
44};
45} // namespace SelfContainedSolverData
46} // namespace ChemistryLib
Interface for coupling OpenGeoSys with an external geochemical solver.
MathLib::EigenLisLinearSolver GlobalLinearSolver
ChemicalSolverInterface(MeshLib::Mesh const &mesh, GlobalLinearSolver &linear_solver_)
std::vector< std::unique_ptr< ChemicalReaction > > _chemical_reactions
Eigen::SparseMatrix< double > const * getStoichiometricMatrix() const override
SelfContainedSolver(MeshLib::Mesh const &mesh, GlobalLinearSolver &linear_solver, Eigen::SparseMatrix< double > stoichiometric_matrix, std::vector< std::unique_ptr< ChemicalReaction > > chemical_reactions)
double getKineticPrefactor(std::size_t reaction_id) const override