chombo-discharge
Loading...
Searching...
No Matches
CD_ScanShopImplem.H
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_ScanShopImplem_H
13#define CD_ScanShopImplem_H
14
15// Our includes
16#include <CD_ScanShop.H>
17#include <CD_NamespaceHeader.H>
18
19inline bool
21{
22 CH_TIME("ScanShop::isRegular(Box, RealVect, Real)");
23
24 bool ret = true;
25
26 for (BoxIterator bit(a_box); bit.ok(); ++bit) {
27 const RealVect a_point = a_probLo + a_dx * (0.5 * RealVect::Unit + RealVect(bit()));
28 if (m_baseIF->value(a_point) >= -0.5 * a_dx * sqrt(SpaceDim)) {
29 ret = false;
30
31 break;
32 }
33 }
34
35 return ret;
36}
37
38inline bool
40{
41 CH_TIME("ScanShop::isCovered(Box, RealVect, Real)");
42
43 bool ret = true;
44
45 for (BoxIterator bit(a_box); bit.ok(); ++bit) {
46 const RealVect a_point = a_probLo + a_dx * (0.5 * RealVect::Unit + RealVect(bit()));
47 if (m_baseIF->value(a_point) <= 0.5 * a_dx * sqrt(SpaceDim)) {
48 ret = false;
49
50 break;
51 }
52 }
53
54 return ret;
55}
56
59{
60
62
63 for (int i = 0; i < a_boxes.size(); i++) {
65 }
66
67 auto comparator = [](const std::pair<Box, int>& a, const std::pair<Box, int>& b) -> bool {
68 return a.first < b.first;
69 };
70
71 std::sort(sortedBoxesAndTypes.begin(), sortedBoxesAndTypes.end(), comparator);
72
74}
75
76#endif
77
78#include <CD_NamespaceFooter.H>
Declare a class geometry generation (ScanShop) that uses the signed distance function for optimizatio...
bool isCovered(const Box a_box, const RealVect a_probLo, const Real a_dx) const
Check if every point in box is covered.
Definition CD_ScanShopImplem.H:39
std::vector< std::pair< Box, int > > getSortedBoxesAndTypes(const Vector< Box > &a_boxes, const Vector< int > &a_types) const
Sort boxes lexicographically.
Definition CD_ScanShopImplem.H:58
const BaseIF * m_baseIF
Implicit function used to generate geometrys.
Definition CD_ScanShop.H:160
bool isRegular(const Box a_box, const RealVect a_probLo, const Real a_dx) const
Check if every point in input box is regular.
Definition CD_ScanShopImplem.H:20
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