chombo-discharge
Loading...
Searching...
No Matches
CD_VofUtils.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_VOFUTILS_H
14#define CD_VOFUTILS_H
15
16// Chombo includes
17#include <Stencils.H>
18#include <EBISBox.H>
19#include <IntVectSet.H>
20#include <RealVect.H>
21#include <ProblemDomain.H>
22#include <VolIndex.H>
23#include <LoHiSide.H>
24#include <DenseIntVectSet.H>
25
26// Our includes
27#include <CD_Location.H>
28#include <CD_NamespaceHeader.H>
29
34{
35public:
42 enum class Connectivity
43 {
44 MonotonePath,
45 SimplyConnected,
46 All
47 };
48
55 enum class Neighborhood
56 {
57 Quadrant,
58 Radius,
59 SemiCircle
60 };
61
65 VofUtils() = delete;
66
76 static Vector<VolIndex>
78 const EBISBox& a_ebisbox,
79 const int a_radius,
81 const bool a_addStartVof);
82
93 static Vector<VolIndex>
95 const EBISBox& a_ebisbox,
96 const int a_radius,
99 const bool a_addStartVof);
100
112 static Vector<VolIndex>
114 const EBISBox& a_ebisbox,
115 const RealVect& a_normal,
116 const int a_radius,
118 const bool a_addStartVof);
119
129 static Vector<VolIndex>
131 const VolIndex& a_startVof,
132 const EBISBox& a_ebisbox,
133 const RealVect& a_normal,
134 const int a_radius);
135
151 static Vector<VolIndex>
153 const EBISBox& a_ebisbox,
154 const RealVect& a_normal,
155 const int a_radius,
156 const Real a_deltaThresh,
160 const bool a_addStartVof);
161
175 static Vector<VolIndex>
177 const VolIndex& a_startVof,
178 const EBISBox& a_ebisbox,
179 const RealVect& a_normal,
180 const Real a_deltaThresh,
183
189 static void
191
197 static void
199
205 static void
207
213 static void
215
221 static void
223
228 static void
230
231protected:
237 static bool
239
247
256 static Vector<VolIndex>
258 const EBISBox& a_ebisbox,
259 const int a_radius,
260 const bool a_addStartVof);
261
270 static Vector<VolIndex>
272 const EBISBox& a_ebisbox,
273 const int a_radius,
274 const bool a_addStartVof);
275
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
319 static Box
321 const VolIndex& a_vof,
322 const EBISBox& a_ebisbox,
323 const Real a_radius);
324
334 static void
336 const VolIndex& a_startVof,
337 const EBISBox& a_ebisbox,
338 const int a_radius,
339 const IntVect& a_timesMoved,
340 const IntVect& a_pathSign);
341
352 static void
354 const VolIndex& a_startVof,
355 const EBISBox& a_ebisbox,
356 const Box& a_validBox,
357 const int& a_radius,
358 const IntVect& a_timesMoved,
359 const IntVect& a_pathSign);
360};
361
362#include <CD_NamespaceFooter.H>
363
364#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:38
TracerParticleSolver()
Default constructor.
Definition CD_TracerParticleSolverImplem.H:26
Static class which contains some routines for fetching VoFs using various algorithms....
Definition CD_VofUtils.H:34
Neighborhood
Neighborhood type.
Definition CD_VofUtils.H:56
static void onlyUnique(Vector< VolIndex > &a_vofs)
Discard duplicates.
Definition CD_VofUtils.cpp:325
static bool isQuadrantWellDefined(const RealVect &a_normal)
Check if a quadrant is well-defined for a direction in space.
Definition CD_VofUtils.cpp:339
Connectivity
Class for specifying connectivity of Vofs.
Definition CD_VofUtils.H:43
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:47
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:282
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:200
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:151
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:18
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:373
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:124
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:422
static std::pair< int, Side::LoHiSide > getCardinalDirection(const RealVect &a_normal)
Returns the coordinate direction.
Definition CD_VofUtils.cpp:353
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:94
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:398
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:70
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:252
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:218
Cell
Enum for distinguishing between cell locations.
Definition CD_Location.H:31