chombo-discharge
Loading...
Searching...
No Matches
CD_LevelTiles.H
Go to the documentation of this file.
1/*
2 * SPDX-FileCopyrightText: 2021-2026 SINTEF Energy Research
3 *
4 * SPDX-License-Identifier: GPL-3.0-or-later
5 */
6
13#ifndef CD_LEVELTILES_H
14#define CD_LEVELTILES_H
15
16// Std includes
17#include <vector>
18#include <map>
19
20// Chombo includes
21#include <IntVect.H>
22#include <DisjointBoxLayout.H>
23#include <DataIndex.H>
24
25// Our includes
26#include <CD_NamespaceHeader.H>
27
34{
35public:
38
43 {
50 bool
51 operator()(const IntVect& a, const IntVect& b) const
52 {
53 D_TERM6(if (a[0] > b[0]) return true; else if (a[0] < b[0]) return false;, if (a[1] > b[1]) return true;
54 else if (a[1] < b[1]) return false;
55 , if (a[2] > b[2]) return true;
56 else if (a[2] < b[2]) return false;
57 , if (a[3] > b[3]) return true;
58 else if (a[3] < b[3]) return false;
59 , if (a[4] > b[4]) return true;
60 else if (a[4] < b[4]) return false;
61 , if (a[5] > b[5]) return true;
62 else if (a[5] < b[5]) return false;);
63 return false;
64 }
65 };
66
71
78
83
89 virtual void
91
96 virtual const std::map<IntVect, unsigned int, TileComparator>&
98
103 virtual const std::map<IntVect, BoxIDs, TileComparator>&
105
110 virtual const std::map<unsigned int, DataIndex>&
112
118
123
128
132 std::map<unsigned int, DataIndex> m_myGrids;
133};
134
135#include <CD_NamespaceFooter.H>
136
137#endif
Class for storing the AMR hierarchy as a collection of tiles.
Definition CD_LevelTiles.H:34
bool m_isDefined
Is defined or not.
Definition CD_LevelTiles.H:117
virtual const std::map< IntVect, unsigned int, TileComparator > & getMyTiles() const noexcept
Get the tiles own by this rank.
Definition CD_LevelTiles.cpp:78
LevelTiles() noexcept
Weak constructor. Must subsequently call the define function.
Definition CD_LevelTiles.cpp:22
virtual const std::map< IntVect, BoxIDs, TileComparator > & getOtherTiles() const noexcept
Get the tiles own by this rank.
Definition CD_LevelTiles.cpp:90
virtual const std::map< unsigned int, DataIndex > & getMyGrids() const noexcept
Get the tiles own by this rank.
Definition CD_LevelTiles.cpp:98
std::map< IntVect, BoxIDs, TileComparator > m_otherTiles
Grids owned by other ranks.
Definition CD_LevelTiles.H:127
std::map< IntVect, unsigned int, TileComparator > m_myTiles
"Tiles" owned by this rank
Definition CD_LevelTiles.H:122
std::pair< unsigned int, unsigned int > BoxIDs
alias type alias.
Definition CD_LevelTiles.H:37
virtual void define(const DisjointBoxLayout &a_dbl, const int a_blockingFactor) noexcept
Define function. Puts object in usable state.
Definition CD_LevelTiles.cpp:40
std::map< unsigned int, DataIndex > m_myGrids
Mapping of grid index to DataIndex.
Definition CD_LevelTiles.H:132
Base class for a tracer particle solver. This solver can advance particles in a pre-defined velocity ...
Definition CD_TracerParticleSolver.H:38
TracerParticleSolver()
Default constructor.
Definition CD_TracerParticleSolverImplem.H:26
For lexicographically comparing tiles.
Definition CD_LevelTiles.H:43
bool operator()(const IntVect &a, const IntVect &b) const
Comparator operator.
Definition CD_LevelTiles.H:51