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
125 static Vector<VolIndex>
127 const VolIndex& a_startVof,
128 const EBISBox& a_ebisbox,
129 const RealVect& a_normal,
130 const int a_radius);
131
146 static Vector<VolIndex>
148 const EBISBox& a_ebisbox,
149 const RealVect& a_normal,
150 const int a_radius,
151 const Real a_deltaThresh,
155 const bool a_addStartVof);
156
170 static Vector<VolIndex>
172 const VolIndex& a_startVof,
173 const EBISBox& a_ebisbox,
174 const RealVect& a_normal,
175 const Real a_deltaThresh,
178
185 static void
187
194 static void
196
203 static void
205
212 static void
214
221 static void
223
229 static void
231
232protected:
238 static bool
240
248
257 static Vector<VolIndex>
259 const EBISBox& a_ebisbox,
260 const int a_radius,
261 const bool a_addStartVof);
262
271 static Vector<VolIndex>
273 const EBISBox& a_ebisbox,
274 const int a_radius,
275 const bool a_addStartVof);
276
284 static Vector<VolIndex>
286 const EBISBox& a_ebisbox,
287 const int a_radius,
288 const bool a_addStartVof);
289
297 static Vector<VolIndex>
299
308 static Box
310
318 static Box
320 const VolIndex& a_vof,
321 const EBISBox& a_ebisbox,
322 const Real a_radius);
323
333 static void
335 const VolIndex& a_startVof,
336 const EBISBox& a_ebisbox,
337 const int a_radius,
338 const IntVect& a_timesMoved,
339 const IntVect& a_pathSign);
340
350 static void
352 const VolIndex& a_startVof,
353 const EBISBox& a_ebisbox,
354 const Box& a_validBox,
355 const int& a_radius,
356 const IntVect& a_timesMoved,
357 const IntVect& a_pathSign);
358};
359
360#include <CD_NamespaceFooter.H>
361
362#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:321
static std::pair< int, Side::LoHiSide > getCardinalDirection(const RealVect a_normal)
Returns the coordinate direction.
Definition CD_VofUtils.cpp:351
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:278
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:199
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:150
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:371
static Vector< VolIndex > restrictVofsToSemiCircle(const Vector< VolIndex > &a_vofs, const VolIndex &a_startVof, const EBISBox &a_ebisbox, const RealVect &a_normal, const Real a_deltaThresh, const Location::Cell a_vofLocation, const Location::Cell a_cellLocation)
Extract the subset of VoFs that lie in a semi-circle ahead of the input vof (a_startVof)
Definition CD_VofUtils.cpp:123
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:420
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:93
static bool isQuadrantWellDefined(const RealVect a_normal)
Check if a quadrant is well-defined for a direction in space.
Definition CD_VofUtils.cpp:335
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:396
static Vector< VolIndex > restrictVofsToQuadrant(const Vector< VolIndex > &a_vofs, const VolIndex &a_startVof, const EBISBox &a_ebisbox, const RealVect &a_normal, const int a_radius)
Extract the subset of vofs that lie within the quadrant/octant defined by the normal vector.
Definition CD_VofUtils.cpp:69
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:248
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:217
Cell
Enum for distinguishing between cell locations.
Definition CD_Location.H:30