GeochemistryContainer.hpp
Go to the documentation of this file.
1// -*- mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*-
2// vi: set et ts=4 sw=4 sts=4:
3/*
4 This file is part of the Open Porous Media project (OPM).
5
6 OPM is free software: you can redistribute it and/or modify
7 it under the terms of the GNU General Public License as published by
8 the Free Software Foundation, either version 2 of the License, or
9 (at your option) any later version.
10
11 OPM is distributed in the hope that it will be useful,
12 but WITHOUT ANY WARRANTY; without even the implied warranty of
13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 GNU General Public License for more details.
15
16 You should have received a copy of the GNU General Public License
17 along with OPM. If not, see <http://www.gnu.org/licenses/>.
18 Consult the COPYING file in the top-level source directory of this
19 module for the precise wording of the license and the list of
20 copyright holders.
21*/
22#ifndef GEOCHEMISTRY_CONTAINER_HPP
23#define GEOCHEMISTRY_CONTAINER_HPP
24
25#include <functional>
26#include <vector>
27
28namespace Opm {
29
30namespace data { class Solution; }
31class SpeciesConfig;
32class MineralConfig;
33
34template<class Scalar>
36{
37 using ScalarBuffer = std::vector<Scalar>;
38
39public:
40 void allocate(const unsigned bufferSize,
41 const SpeciesConfig& species,
42 const MineralConfig& minerals);
43
44 using AssignFunction = std::function<Scalar(const unsigned)>;
45
46 void assignSpeciesConcentrations(const unsigned globalDofIdx,
47 const AssignFunction& concentration);
48 void assignMineralConcentrations(const unsigned globalDofIdx,
49 const AssignFunction& concentration);
50 void assignPH(const unsigned globalDofIdx, const Scalar ph);
51
52 void outputRestart(data::Solution& sol,
53 const SpeciesConfig& species,
54 const MineralConfig& minerals);
55
56 bool allocated() const
57 { return allocated_; }
58
59private:
60 std::vector<ScalarBuffer> speciesConcentrations_{};
61 std::vector<ScalarBuffer> mineralConcentrations_{};
62 ScalarBuffer pH_;
63 bool allocated_{false};
64}; // class GeochemistryContainer
65
66} // namespace Opm
67
68#endif
Definition: GeochemistryContainer.hpp:36
std::function< Scalar(const unsigned)> AssignFunction
Definition: GeochemistryContainer.hpp:44
void allocate(const unsigned bufferSize, const SpeciesConfig &species, const MineralConfig &minerals)
void assignMineralConcentrations(const unsigned globalDofIdx, const AssignFunction &concentration)
bool allocated() const
Definition: GeochemistryContainer.hpp:56
void assignSpeciesConcentrations(const unsigned globalDofIdx, const AssignFunction &concentration)
void outputRestart(data::Solution &sol, const SpeciesConfig &species, const MineralConfig &minerals)
void assignPH(const unsigned globalDofIdx, const Scalar ph)
Definition: blackoilbioeffectsmodules.hh:45