chombo-discharge
CD_CellTagger.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_CellTagger_H
13 #define CD_CellTagger_H
14 
15 // Our includes
17 #include <CD_RealBox.H>
18 #include <CD_AmrMesh.H>
19 #include <CD_EBAMRTags.H>
20 #include <CD_NamespaceHeader.H>
21 
31 {
32 public:
36  CellTagger();
37 
41  virtual ~CellTagger();
42 
46  virtual void
47  preRegrid() noexcept;
48 
54  virtual void
55  regrid() = 0;
56 
61  virtual void
62  parseOptions() = 0;
63 
68  virtual void
70 
78  virtual bool
79  tagCells(EBAMRTags& a_tags) = 0;
80 
84  virtual void
85  prePlot() const noexcept;
86 
91  virtual int
93 
97  virtual Vector<std::string>
98  getPlotVariableNames() const;
99 
107  virtual void
108  writePlotData(LevelData<EBCellFAB>& a_output, int& a_icomp, const std::string a_outputRealm, const int a_level) const;
109 
116  virtual int
117  getBuffer() const;
118 
119 protected:
123  std::string m_name;
124 
129 
133  int m_buffer;
134 
139 
143  std::vector<std::pair<RealBox, int>> m_refBoxes;
144 
150  bool
151  insideTagBox(const RealVect a_pos) const;
152 
156  int
157  getManualRefinementLevel(const RealVect a_pos) const;
158 
164  virtual void
165  parseTagBoxes();
166 
170  virtual void
172 
178  virtual void
179  parseBuffer();
180 
186  virtual void
187  parseVerbosity();
188 };
189 
190 #include <CD_NamespaceFooter.H>
191 
192 #endif
Declaration of core class for handling AMR-related operations (with embedded boundaries)
Declaration of base class for defining geometries.
Contains an alias declaration of EBAMRTags.
Vector< RefCountedPtr< LayoutData< DenseIntVectSet > >> EBAMRTags
Declaration of cell tags.
Definition: CD_EBAMRTags.H:22
Declaration of an axis-aligned box in space.
Base class for tagging cells across an AMR hierarchy.
Definition: CD_CellTagger.H:31
virtual void writePlotData(LevelData< EBCellFAB > &a_output, int &a_icomp, const std::string a_outputRealm, const int a_level) const
Write plot data.
Definition: CD_CellTagger.cpp:78
int m_verbosity
Class verbosity.
Definition: CD_CellTagger.H:128
virtual Vector< std::string > getPlotVariableNames() const
Get plot variable names.
Definition: CD_CellTagger.cpp:67
virtual void parseTagBoxes()
Parse boxes.
Definition: CD_CellTagger.cpp:110
virtual void parseOptions()=0
Parse class options.
virtual bool tagCells(EBAMRTags &a_tags)=0
Tag cells.
bool insideTagBox(const RealVect a_pos) const
Check if a point is inside a tagging box.
Definition: CD_CellTagger.cpp:252
std::vector< std::pair< RealBox, int > > m_refBoxes
Refinement boxes for adding manual refinement.
Definition: CD_CellTagger.H:143
virtual int getBuffer() const
Get tag buffer.
Definition: CD_CellTagger.cpp:90
virtual void regrid()=0
Regrid function for cell tagger (in case it uses transient storage to do things)
virtual void parseVerbosity()
Parse the verbosity from the input file or command line.
Definition: CD_CellTagger.cpp:238
std::string m_name
Cell tagger class name (default is CellTagger).
Definition: CD_CellTagger.H:123
virtual void parseRefinementBoxes()
Parse refinement boxes.
Definition: CD_CellTagger.cpp:161
int getManualRefinementLevel(const RealVect a_pos) const
Get the specified level for this position when doing manual refinement.
Definition: CD_CellTagger.cpp:275
virtual void parseBuffer()
Parse refinement buffer.
Definition: CD_CellTagger.cpp:222
virtual int getNumberOfPlotVariables() const
Get number of plot variables that will be written to file (by Driver).
Definition: CD_CellTagger.cpp:56
virtual void parseRuntimeOptions()
Parse runtime class options.
Definition: CD_CellTagger.cpp:101
virtual void prePlot() const noexcept
Perform pre-plotting operations (if necessary)
Definition: CD_CellTagger.cpp:47
virtual void preRegrid() noexcept
Pre-regrid function for cell-tagger.
Definition: CD_CellTagger.cpp:38
virtual ~CellTagger()
Destructor (does nothing).
Definition: CD_CellTagger.cpp:32
int m_buffer
Tag buffer. Grow tags by this amount (finest level only)
Definition: CD_CellTagger.H:133
Vector< RealBox > m_tagBoxes
Boxes that can be used to restrict tagging.
Definition: CD_CellTagger.H:138
CellTagger()
Weak constructor (does nothing)
Definition: CD_CellTagger.cpp:22
Rectangular box in real space.
Definition: CD_RealBox.H:26