12 #ifndef CD_ScanShopImplem_H
13 #define CD_ScanShopImplem_H
17 #include <CD_NamespaceHeader.H>
22 CH_TIME(
"ScanShop::isRegular(Box, RealVect, Real)");
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)) {
41 CH_TIME(
"ScanShop::isCovered(Box, RealVect, Real)");
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)) {
57 inline std::vector<std::pair<Box, int>>
61 std::vector<std::pair<Box, int>> sortedBoxesAndTypes;
63 for (
int i = 0; i < a_boxes.size(); i++) {
64 sortedBoxesAndTypes.emplace_back(std::make_pair(a_boxes[i], a_types[i]));
67 auto comparator = [](
const std::pair<Box, int>& a,
const std::pair<Box, int>& b) ->
bool {
68 return a.first < b.first;
71 std::sort(sortedBoxesAndTypes.begin(), sortedBoxesAndTypes.end(), comparator);
73 return sortedBoxesAndTypes;
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