RSTConv.hpp
Go to the documentation of this file.
1/*
2 Copyright 2023 SINTEF Digital
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 3 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*/
19
20#ifndef OPM_RST_CONV_HEADER_INCLUDED
21#define OPM_RST_CONV_HEADER_INCLUDED
22
23#include <array>
24#include <vector>
25
27
28namespace Opm {
29
30class RSTConfig;
31
34{
35public:
39 RSTConv(const std::vector<int>& globalCell,
41 : globalCell_(globalCell)
42 , comm_(comm)
43 {}
44
49 void init(const std::size_t numCells,
50 const RSTConfig& rst_config,
51 const std::array<int,6>& compIdx);
52
54 template<class ResidualVector>
55 void update(const ResidualVector& resid);
56
58 const std::vector<std::vector<int>>& getData() const
59 { return cnv_X_; }
60
61private:
67 template<class ResidualVector>
68 void gatherAndAccumulate(const std::vector<int>& lIdx,
69 const ResidualVector& resid, int comp);
70
71 const std::vector<int>& globalCell_;
73 std::vector<std::vector<int>> cnv_X_;
74 std::array<int,6> compIdx_;
75 int N_ = 0;
76};
77
78} // namespace Opm
79
80#endif // OPM_RST_CONV_HEADER_INCLUDED
Class computing RPTRST CONV output.
Definition: RSTConv.hpp:34
RSTConv(const std::vector< int > &globalCell, Parallel::Communication comm)
Constructor.
Definition: RSTConv.hpp:39
const std::vector< std::vector< int > > & getData() const
Obtain a const-ref to the accumulated data.
Definition: RSTConv.hpp:58
void update(const ResidualVector &resid)
Adds the CONV output for given residual vector.
void init(const std::size_t numCells, const RSTConfig &rst_config, const std::array< int, 6 > &compIdx)
Init state at beginning of step.
Dune::Communication< MPIComm > Communication
Definition: ParallelCommunication.hpp:30
Definition: BlackoilPhases.hpp:27