chombo-discharge
CD_TiledMeshRefine.H
Go to the documentation of this file.
1 /* chombo-discharge
2  * Copyright © 2021 SINTEF Energy Research.
3  * Please refer to Copyright.txt and LICENSE in the chombo-discharge root directory.
4  */
5 
12 #ifndef CD_TiledMeshRefine_H
13 #define CD_TiledMeshRefine_H
14 
15 // Std includes
16 #include <vector>
17 #include <set>
18 
19 // Chombo includes
20 #include <IntVectSet.H>
21 #include <ProblemDomain.H>
22 #include <Box.H>
23 
24 // Our includes
25 #include <CD_Tile.H>
26 #include <CD_NamespaceHeader.H>
27 
34 {
35 public:
39  TiledMeshRefine() = delete;
40 
47  TiledMeshRefine(const ProblemDomain& a_coarsestDomain,
48  const Vector<int>& a_refRatios,
49  const IntVect& a_tileSize) noexcept;
50 
54  virtual ~TiledMeshRefine() noexcept;
55 
62  virtual int
63  regrid(Vector<Vector<Box>>& a_newBoxes, const Vector<IntVectSet>& a_tagsLevel) const noexcept;
64 
65 protected:
69  using Tile = TileI<int, SpaceDim>;
70 
74  using TileSet = std::set<Tile>;
75 
80  Vector<ProblemDomain> m_amrDomains;
81 
85  Vector<int> m_refRatios;
86 
90  IntVect m_tileSize;
91 
95  virtual void
96  makeLevelTiles(TileSet& a_tiles,
97  const TileSet& a_fineTiles,
98  const IntVectSet& a_coarTags,
99  const ProblemDomain& a_domain,
100  const int a_refToFine,
101  const int a_refToCoar) const noexcept;
102 
106  virtual void
107  makeBoxesFromTiles(Vector<Box>& a_boxes, const TileSet& a_tiles, const ProblemDomain& a_domain) const noexcept;
108 };
109 
110 #include <CD_NamespaceFooter.H>
111 
112 #endif
Class for representing a tile (used in, e.g., TiledMeshRefine)
Definition: CD_Tile.H:26
Class for generation AMR boxes using a tiling algorithm.
Definition: CD_TiledMeshRefine.H:34
virtual void makeLevelTiles(TileSet &a_tiles, const TileSet &a_fineTiles, const IntVectSet &a_coarTags, const ProblemDomain &a_domain, const int a_refToFine, const int a_refToCoar) const noexcept
Make tiles on the current level from tags and tile coarsening from finer levels.
Definition: CD_TiledMeshRefine.cpp:102
std::set< Tile > TileSet
Tile set representation.
Definition: CD_TiledMeshRefine.H:74
Vector< int > m_refRatios
Refinement ratios.
Definition: CD_TiledMeshRefine.H:85
virtual ~TiledMeshRefine() noexcept
Destructor (does nothing)
Definition: CD_TiledMeshRefine.cpp:47
virtual int regrid(Vector< Vector< Box >> &a_newBoxes, const Vector< IntVectSet > &a_tagsLevel) const noexcept
Regrid using the tile clustering algorithm.
Definition: CD_TiledMeshRefine.cpp:53
virtual void makeBoxesFromTiles(Vector< Box > &a_boxes, const TileSet &a_tiles, const ProblemDomain &a_domain) const noexcept
Turn tiles into boxes.
Definition: CD_TiledMeshRefine.cpp:207
IntVect m_tileSize
Tile size.
Definition: CD_TiledMeshRefine.H:90
Vector< ProblemDomain > m_amrDomains
Computational domains on each level.
Definition: CD_TiledMeshRefine.H:80
TiledMeshRefine()=delete
Default constructor – deleted because we never need it.