chombo-discharge
Loading...
Searching...
No Matches
CD_VofUtils.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_VofUtils_H
13#define CD_VofUtils_H
14
15// Chombo includes
16#include <Stencils.H>
17#include <EBISBox.H>
18#include <IntVectSet.H>
19#include <RealVect.H>
20#include <ProblemDomain.H>
21#include <VolIndex.H>
22#include <LoHiSide.H>
23#include <DenseIntVectSet.H>
24
25// Our includes
26#include <CD_Location.H>
27#include <CD_NamespaceHeader.H>
28
33{
34public:
41 enum class Connectivity
42 {
43 MonotonePath,
44 SimplyConnected,
45 All
46 };
47
54 enum class Neighborhood
55 {
56 Quadrant,
57 Radius,
58 SemiCircle
59 };
60
64 VofUtils() = delete;
65
74 static Vector<VolIndex>
76 const EBISBox& a_ebisbox,
77 const int a_radius,
79 const bool a_addStartVof);
80
90 static Vector<VolIndex>
92 const EBISBox& a_ebisbox,
93 const int a_radius,
96 const bool a_addStartVof);
97
108 static Vector<VolIndex>
110 const EBISBox& a_ebisbox,
111 const RealVect& a_normal,
112 const int a_radius,
114 const bool a_addStartVof);
115
130 static Vector<VolIndex>
132 const EBISBox& a_ebisbox,
133 const RealVect& a_normal,
134 const int a_radius,
135 const Real a_deltaThresh,
139 const bool a_addStartVof);
140
147 static void
149
156 static void
158
165 static void
167
174 static void
176
183 static void
185
191 static void
193
194protected:
200 static bool
202
210
219 static Vector<VolIndex>
221 const EBISBox& a_ebisbox,
222 const int a_radius,
223 const bool a_addStartVof);
224
233 static Vector<VolIndex>
235 const EBISBox& a_ebisbox,
236 const int a_radius,
237 const bool a_addStartVof);
238
246 static Vector<VolIndex>
248 const EBISBox& a_ebisbox,
249 const int a_radius,
250 const bool a_addStartVof);
251
259 static Vector<VolIndex>
261
270 static Box
272
280 static Box
282 const VolIndex& a_vof,
283 const EBISBox& a_ebisbox,
284 const Real a_radius);
285
295 static void
297 const VolIndex& a_startVof,
298 const EBISBox& a_ebisbox,
299 const int a_radius,
300 const IntVect& a_timesMoved,
301 const IntVect& a_pathSign);
302
312 static void
314 const VolIndex& a_startVof,
315 const EBISBox& a_ebisbox,
316 const Box& a_validBox,
317 const int& a_radius,
318 const IntVect& a_timesMoved,
319 const IntVect& a_pathSign);
320};
321
322#include <CD_NamespaceFooter.H>
323
324#endif
Declaration of cell positions.
Base class for a tracer particle solver. This solver can advance particles in a pre-defined velocity ...
Definition CD_TracerParticleSolver.H:37
TracerParticleSolver()
Default constructor.
Definition CD_TracerParticleSolverImplem.H:25
Static class which contains some routines for fetching VoFs using various algorithms....
Definition CD_VofUtils.H:33
Neighborhood
Neighborhood type.
Definition CD_VofUtils.H:55
static void onlyUnique(Vector< VolIndex > &a_vofs)
Discard duplicates.
Definition CD_VofUtils.cpp:292
static std::pair< int, Side::LoHiSide > getCardinalDirection(const RealVect a_normal)
Returns the coordinate direction.
Definition CD_VofUtils.cpp:322
Connectivity
Class for specifying connectivity of Vofs.
Definition CD_VofUtils.H:42
static Vector< VolIndex > getVofsInRadius(const VolIndex &a_startVof, const EBISBox &a_ebisbox, const int a_radius, const DenseIntVectSet &a_validCells, const Connectivity a_connectivity, const bool a_addStartVof)
Fetch vofs in a specified radius and with a specified connectivitiy between them.
static Vector< VolIndex > getVofsInQuadrant(const VolIndex &a_startVof, const EBISBox &a_ebisbox, const RealVect &a_normal, const int a_radius, const Connectivity a_connectivity, const bool a_addStartVof)
Fetch vofs in a quadrant, using a specified radius and with a specified connectivitiy between them.
Definition CD_VofUtils.cpp:46
static void includeCells(Vector< VolIndex > &a_vofs, const Box &a_includeBox)
Modifies a_vofs so it only includes cells in a box.
Definition CD_VofUtils.cpp:249
static Vector< VolIndex > getConnectedVofsInRadius(const VolIndex &a_startVof, const EBISBox &a_ebisbox, const int a_radius, const bool a_addStartVof)
Get all connected Vofs in radius which can be reached without crossing a covered face or reaching int...
Definition CD_VofUtils.cpp:170
static Vector< VolIndex > getVofsInMonotonePath(const VolIndex &a_startVof, const EBISBox &a_ebisbox, const int a_radius, const bool a_addStartVof)
Get all VoFs that can be found with a monotone path with specified radius.
Definition CD_VofUtils.cpp:121
static Vector< VolIndex > getVofsInRadius(const VolIndex &a_startVof, const EBISBox &a_ebisbox, const int a_radius, const Connectivity a_connectivity, const bool a_addStartVof)
Fetch vofs in a specified radius and with a specified connectivitiy between them.
Definition CD_VofUtils.cpp:17
static Box getQuadrant(const RealVect &a_normal, const VolIndex &a_vof, const EBISBox &a_ebisbox, const Real a_radius)
Get quadrant defined by direction in space.
Definition CD_VofUtils.cpp:342
static Vector< VolIndex > connectedVofsOnly(const VolIndex &a_startVof, const Vector< VolIndex > &a_allVofs, const EBISBox &a_ebisbox)
Get all Vofs that are connected to a specific starting Vof. The connection does not have to be direct...
Definition CD_VofUtils.cpp:391
static Vector< VolIndex > getVofsInSemiCircle(const VolIndex &a_startVof, const EBISBox &a_ebisbox, const RealVect &a_normal, const int a_radius, const Real a_deltaThresh, const Connectivity a_connectivity, const Location::Cell a_vofLocation, const Location::Cell a_cellLocation, const bool a_addStartVof)
Get all vofs lying in a semi-circle (sphere in 3D) from the indicated position in the starting vof.
Definition CD_VofUtils.cpp:81
static bool isQuadrantWellDefined(const RealVect a_normal)
Check if a quadrant is well-defined for a direction in space.
Definition CD_VofUtils.cpp:306
VofUtils()=delete
Disallowed.
static Box getSymmetricQuadrant(const std::pair< int, Side::LoHiSide > &a_cardinal, const VolIndex &a_vof, const EBISBox &a_ebisbox, const Real a_radius)
Get "symmetric" quadrant defined by direction in space.
Definition CD_VofUtils.cpp:367
static void excludeCells(Vector< VolIndex > &a_vofs, const Box &a_excludeBox)
Modifies a_vofs so it doesn't include cells in a_excludeIVS.
Definition CD_VofUtils.cpp:219
static Vector< VolIndex > getAllVofsInRadius(const VolIndex &a_startVof, const EBISBox &a_ebisbox, const int a_radius, const bool a_addStartVof)
Get all Vofs in a radius from a starting Vof.
Definition CD_VofUtils.cpp:188
Cell
Enum for distinguishing between cell locations.
Definition CD_Location.H:30