RefinementRequest.hpp
Go to the documentation of this file.
1/*
2 Copyright 2026 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#ifndef OPM_GRID_REFINEMENT_REQUEST_HEADER_INCLUDED
20#define OPM_GRID_REFINEMENT_REQUEST_HEADER_INCLUDED
21
22#include <array>
23#include <cstddef>
24#include <string>
25#include <vector>
26
27namespace Opm
28{
29namespace Refinement
30{
31
40{
41 std::vector<int> parentOffset{};
42 std::vector<double> fracLo{};
43 std::vector<double> fracHi{};
44
45 bool empty() const { return parentOffset.empty(); }
46 std::size_t size() const { return parentOffset.size(); }
47};
48
56{
57 std::string name;
58 std::string parentGridName{"GLOBAL"};
59 std::array<int,3> cellsPerDim{};
60 std::array<int,3> startIJK{};
61 std::array<int,3> endIJK{};
63 std::array<AxisSubdivision,3> subdivision{};
69 std::vector<int> minpvRemoved{};
77};
78
82
85std::array<int,3> refinedDims(const BlockRefinement& request);
86
95{
97 std::vector<int> subIndex{};
99 std::vector<int> parentCount{};
101 std::vector<int> firstColumn{};
102};
103
105
108std::vector<BlockRefinement>
109blockRefinements(const std::vector<std::array<int,3>>& cellsPerDim,
110 const std::vector<std::array<int,3>>& startIJK,
111 const std::vector<std::array<int,3>>& endIJK,
112 const std::vector<std::string>& names,
113 const std::vector<std::string>& parentGridNames);
114
119void validateBlockRefinements(const std::vector<BlockRefinement>& requests);
120
121} // namespace Refinement
122} // namespace Opm
123
124#endif // OPM_GRID_REFINEMENT_REQUEST_HEADER_INCLUDED
void validateBlockRefinements(const std::vector< BlockRefinement > &requests)
std::array< int, 3 > refinedDims(const BlockRefinement &request)
std::vector< BlockRefinement > blockRefinements(const std::vector< std::array< int, 3 > > &cellsPerDim, const std::vector< std::array< int, 3 > > &startIJK, const std::vector< std::array< int, 3 > > &endIJK, const std::vector< std::string > &names, const std::vector< std::string > &parentGridNames)
AxisSubdivision axisSubdivision(const BlockRefinement &request, int dim)
AxisPositions axisPositions(const AxisSubdivision &sub)
Holds the implementation of the CpGrid as a pimple.
Definition: CellQuadrature.hpp:26
Definition: RefinementRequest.hpp:95
std::vector< int > firstColumn
Per parent cell of the box: its first refined column.
Definition: RefinementRequest.hpp:101
std::vector< int > subIndex
Per refined column: its position inside its parent cell, from 0.
Definition: RefinementRequest.hpp:97
std::vector< int > parentCount
Per refined column: how many refined columns its parent cell is split into.
Definition: RefinementRequest.hpp:99
Definition: RefinementRequest.hpp:40
std::size_t size() const
Definition: RefinementRequest.hpp:46
std::vector< int > parentOffset
Definition: RefinementRequest.hpp:41
std::vector< double > fracLo
Definition: RefinementRequest.hpp:42
bool empty() const
Definition: RefinementRequest.hpp:45
std::vector< double > fracHi
Definition: RefinementRequest.hpp:43
Definition: RefinementRequest.hpp:56
std::array< AxisSubdivision, 3 > subdivision
Graded subdivision, one entry per direction. Empty means uniform.
Definition: RefinementRequest.hpp:63
std::string name
Definition: RefinementRequest.hpp:57
std::array< int, 3 > startIJK
Definition: RefinementRequest.hpp:60
bool pillarsFromBoxLayer
Definition: RefinementRequest.hpp:76
std::array< int, 3 > cellsPerDim
Definition: RefinementRequest.hpp:59
std::vector< int > minpvRemoved
Definition: RefinementRequest.hpp:69
std::array< int, 3 > endIJK
Definition: RefinementRequest.hpp:61
std::string parentGridName
Definition: RefinementRequest.hpp:58