LevelHierarchy.hpp
Go to the documentation of this file.
1//===========================================================================
2//
3// File: LevelHierarchy.hpp
4//
5// Created: Sep 17 21:11:41 2013
6//
7// Author(s): Atgeirr F Rasmussen <atgeirr@sintef.no>
8// Bård Skaflestad <bard.skaflestad@sintef.no>
9// Markus Blatt <markus@dr-blatt.de>
10// Antonella Ritorto <antonella.ritorto@opm-op.com>
11//
12// Comment: Major parts of this file originated in dune/grid/CpGrid.hpp
13// and got transfered here during refactoring for the parallelization.
14//
15// $Date$
16//
17// $Revision$
18//
19//===========================================================================
20
21/*
22 Copyright 2009, 2010 SINTEF ICT, Applied Mathematics.
23 Copyright 2009, 2010, 2013, 2022-2023 Equinor ASA.
24 Copyright 2013 Dr. Blatt - HPC-Simulation-Software & Services
25
26 This file is part of The Open Porous Media project (OPM).
27
28 OPM is free software: you can redistribute it and/or modify
29 it under the terms of the GNU General Public License as published by
30 the Free Software Foundation, either version 3 of the License, or
31 (at your option) any later version.
32
33 OPM is distributed in the hope that it will be useful,
34 but WITHOUT ANY WARRANTY; without even the implied warranty of
35 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
36 GNU General Public License for more details.
37
38 You should have received a copy of the GNU General Public License
39 along with OPM. If not, see <http://www.gnu.org/licenses/>.
40*/
41
42#ifndef OPM_LEVELHIERARCHY_HEADER
43#define OPM_LEVELHIERARCHY_HEADER
44
45#include <array>
46#include <memory>
47#include <tuple>
48#include <vector>
49
50namespace Dune
51{
52namespace cpgrid
53{
54
55class CpGridData;
56
59{
61 std::vector<int> mark;
63 int level{0};
65 std::vector<std::shared_ptr<CpGridData>>* level_data_ptr{};
66 // SUITABLE FOR ALL LEVELS EXCEPT FOR LEAFVIEW
68 std::vector<int> level_to_leaf_cells; // In entry 'level cell index', we store 'leafview cell index' // {level LGR, {child0, child1, ...}}
70 std::vector<std::tuple<int,std::vector<int>>> parent_to_children_cells; // {# children in x-direction, ... y-, ... z-}
72 std::array<int,3> cells_per_dim;
73 // SUITABLE ONLY FOR LEAFVIEW // {level, cell index in that level}
75 std::vector<std::array<int,2>> leaf_to_level_cells;
77 std::vector<std::array<int,2>> corner_history;
78 // SUITABLE FOR ALL LEVELS INCLUDING LEAFVIEW // {level parent cell, parent cell index}
80 std::vector<std::array<int,2>> child_to_parent_cells;
83 std::vector<int> cell_to_idxInParentCell;
86};
87
88} // namespace cpgrid
89} // namespace Dune
90
91#endif // OPM_LEVELHIERARCHY_HEADER
The namespace Dune is the main namespace for all Dune code.
Definition: common/CartesianIndexMapper.hpp:10
How one CpGridData relates to the other levels of a refined CpGrid.
Definition: LevelHierarchy.hpp:59
std::array< int, 3 > cells_per_dim
Definition: LevelHierarchy.hpp:72
std::vector< std::array< int, 2 > > leaf_to_level_cells
Definition: LevelHierarchy.hpp:75
std::vector< std::shared_ptr< CpGridData > > * level_data_ptr
Definition: LevelHierarchy.hpp:65
std::vector< std::array< int, 2 > > child_to_parent_cells
Definition: LevelHierarchy.hpp:80
std::vector< int > level_to_leaf_cells
Definition: LevelHierarchy.hpp:68
std::vector< int > mark
Definition: LevelHierarchy.hpp:61
std::vector< int > cell_to_idxInParentCell
Definition: LevelHierarchy.hpp:83
std::vector< std::tuple< int, std::vector< int > > > parent_to_children_cells
Definition: LevelHierarchy.hpp:70
int level
Definition: LevelHierarchy.hpp:63
int refinement_max_level
Definition: LevelHierarchy.hpp:85
std::vector< std::array< int, 2 > > corner_history
Definition: LevelHierarchy.hpp:77