15#ifndef CD_SCANSHOPIMPLEM_H
16#define CD_SCANSHOPIMPLEM_H
20#include <CD_NamespaceHeader.H>
25 CH_TIME(
"ScanShop::isRegular(Box, RealVect, Real)");
30 for (
int k = a_box.smallEnd(2); k <= a_box.bigEnd(2); k++) {
32 for (
int j = a_box.smallEnd(1); j <= a_box.bigEnd(1); j++) {
33 for (
int i = a_box.smallEnd(0); i <= a_box.bigEnd(0); i++) {
34 const RealVect point = a_probLo + a_dx * (0.5 * RealVect::Unit + RealVect(IntVect(D_DECL(i, j, k))));
35 if (
m_baseIF->value(point) >= -0.5 * a_dx * sqrt(SpaceDim)) {
50 CH_TIME(
"ScanShop::isCovered(Box, RealVect, Real)");
55 for (
int k = a_box.smallEnd(2); k <= a_box.bigEnd(2); k++) {
57 for (
int j = a_box.smallEnd(1); j <= a_box.bigEnd(1); j++) {
58 for (
int i = a_box.smallEnd(0); i <= a_box.bigEnd(0); i++) {
59 const RealVect point = a_probLo + a_dx * (0.5 * RealVect::Unit + RealVect(IntVect(D_DECL(i, j, k))));
60 if (
m_baseIF->value(point) <= 0.5 * a_dx * sqrt(SpaceDim)) {
72inline std::vector<std::pair<Box, int>>
76 std::vector<std::pair<Box, int>> sortedBoxesAndTypes;
78 for (
int i = 0; i < a_boxes.size(); i++) {
79 sortedBoxesAndTypes.emplace_back(std::make_pair(a_boxes[i], a_types[i]));
82 auto comparator = [](
const std::pair<Box, int>& a,
const std::pair<Box, int>& b) ->
bool {
83 return a.first < b.first;
86 std::sort(sortedBoxesAndTypes.begin(), sortedBoxesAndTypes.end(), comparator);
88 return sortedBoxesAndTypes;
93#include <CD_NamespaceFooter.H>
Declare a class geometry generation (ScanShop) that uses the signed distance function for optimizatio...
bool isRegular(Box a_box, const RealVect &a_probLo, Real a_dx) const
Check if every point in input box is regular.
Definition CD_ScanShopImplem.H:23
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:73
const BaseIF * m_baseIF
Implicit function used to generate geometries.
Definition CD_ScanShop.H:192
bool isCovered(Box a_box, const RealVect &a_probLo, Real a_dx) const
Check if every point in box is covered.
Definition CD_ScanShopImplem.H:48