My Project
Loading...
Searching...
No Matches
SubDomain.hpp
1/*
2 Copyright 2021 Total SE
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_SUBDOMAIN_HEADER_INCLUDED
21#define OPM_SUBDOMAIN_HEADER_INCLUDED
22
23#include <opm/grid/common/SubGridPart.hpp>
24
25#include <utility>
26#include <vector>
27
28namespace Opm
29{
32 Jacobi,
33 GaussSeidel
34 };
35
38 AveragePressure,
39 Residual
40 };
41
44 template <class Grid>
45 struct SubDomain
46 {
47 // The index of a subdomain is arbitrary, but can be used by the
48 // solvers to keep track of well locations etc.
49 int index;
50 // The set of cells that make up a SubDomain, stored as cell indices
51 // in the local numbering of the current MPI rank.
52 std::vector<int> cells;
53 // Flag for each cell of the current MPI rank, true if the cell is part
54 // of the subdomain. If empty, assumed to be all true. Not required for
55 // all nonlinear solver algorithms.
56 std::vector<bool> interior;
57 // Enables subdomain solves and linearization using the generic linearization
58 // approach (i.e. FvBaseLinearizer as opposed to TpfaLinearizer).
59 Dune::SubGridPart<Grid> view;
60 // Constructor that moves from its argument.
61 SubDomain(const int i, std::vector<int>&& c, std::vector<bool>&& in, Dune::SubGridPart<Grid>&& v)
62 : index(i), cells(std::move(c)), interior(std::move(in)), view(std::move(v))
63 {}
64 };
65
66} // namespace Opm
67
68
69#endif // OPM_SUBDOMAIN_HEADER_INCLUDED
Definition AquiferInterface.hpp:35
This file contains a set of helper functions used by VFPProd / VFPInj.
Definition BlackoilPhases.hpp:27
DomainOrderingMeasure
Measure to use for domain ordering.
Definition SubDomain.hpp:37
DomainSolveApproach
Solver approach for NLDD.
Definition SubDomain.hpp:31
Representing a part of a grid, in a way suitable for performing local solves.
Definition SubDomain.hpp:46