chombo-discharge
Loading...
Searching...
No Matches
CD_CellTagger.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_CELLTAGGER_H
14#define CD_CELLTAGGER_H
15
16// Our includes
18#include <CD_RealBox.H>
19#include <CD_AmrMesh.H>
20#include <CD_EBAMRTags.H>
21#include <CD_NamespaceHeader.H>
22
33{
34public:
38 CellTagger();
39
43 virtual ~CellTagger();
44
48 virtual void
49 preRegrid() noexcept;
50
56 virtual void
57 regrid() = 0;
58
63 virtual void
65
71 virtual void
73
83 virtual bool
84 tagCells(EBAMRTags& a_tags) = 0;
85
89 virtual void
90 prePlot() const noexcept;
91
96 virtual int
98
103 virtual Vector<std::string>
104 getPlotVariableNames() const;
105
113 virtual void
114 writePlotData(LevelData<EBCellFAB>& a_output,
115 int& a_icomp,
116 const std::string& a_outputRealm,
117 const int a_level) const;
118
126 virtual int
127 getBuffer() const;
128
129protected:
133 std::string m_name;
134
139
144
149
153 std::vector<std::pair<RealBox, int>> m_refBoxes;
154
160 bool
161 insideTagBox(const RealVect& a_pos) const;
162
168 int
169 getManualRefinementLevel(const RealVect& a_pos) const;
170
177 virtual void
179
183 virtual void
185
191 virtual void
192 parseBuffer();
193
200 virtual void
202};
203
204#include <CD_NamespaceFooter.H>
205
206#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:25
Declaration of an axis-aligned box in space.
Base class for tagging cells across an AMR hierarchy.
Definition CD_CellTagger.H:33
int m_verbosity
Class verbosity.
Definition CD_CellTagger.H:138
virtual Vector< std::string > getPlotVariableNames() const
Get plot variable names.
Definition CD_CellTagger.cpp:65
virtual void parseTagBoxes()
Parse boxes.
Definition CD_CellTagger.cpp:108
virtual void parseOptions()=0
Parse class options.
virtual bool tagCells(EBAMRTags &a_tags)=0
Tag cells.
std::vector< std::pair< RealBox, int > > m_refBoxes
Refinement boxes for adding manual refinement.
Definition CD_CellTagger.H:153
virtual int getBuffer() const
Get tag buffer.
Definition CD_CellTagger.cpp:88
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:236
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:76
std::string m_name
Cell tagger class name (default is CellTagger).
Definition CD_CellTagger.H:133
virtual void parseRefinementBoxes()
Parse refinement boxes.
Definition CD_CellTagger.cpp:159
virtual void parseBuffer()
Parse refinement buffer.
Definition CD_CellTagger.cpp:220
virtual int getNumberOfPlotVariables() const
Get number of plot variables that will be written to file (by Driver).
Definition CD_CellTagger.cpp:54
virtual void parseRuntimeOptions()
Parse runtime class options.
Definition CD_CellTagger.cpp:99
virtual void prePlot() const noexcept
Perform pre-plotting operations (if necessary)
Definition CD_CellTagger.cpp:45
virtual void preRegrid() noexcept
Pre-regrid function for cell-tagger.
Definition CD_CellTagger.cpp:36
virtual ~CellTagger()
Destructor (does nothing).
Definition CD_CellTagger.cpp:30
bool insideTagBox(const RealVect &a_pos) const
Check if a point is inside a tagging box.
Definition CD_CellTagger.cpp:250
int getManualRefinementLevel(const RealVect &a_pos) const
Get the specified level for this position when doing manual refinement.
Definition CD_CellTagger.cpp:273
int m_buffer
Tag buffer. Grow tags by this amount (finest level only)
Definition CD_CellTagger.H:143
Vector< RealBox > m_tagBoxes
Boxes that can be used to restrict tagging.
Definition CD_CellTagger.H:148
CellTagger()
Weak constructor (does nothing)
Definition CD_CellTagger.cpp:23
Rectangular box in real space.
Definition CD_RealBox.H:27