1 #ifndef MEDUSA_BITS_DOMAINS_SHAPEUNION_HPP_
2 #define MEDUSA_BITS_DOMAINS_SHAPEUNION_HPP_
16 template <
typename vec_t>
19 auto d1 = sh1->discretizeBoundaryWithStep(step, type);
20 auto d2 = sh2->discretizeBoundaryWithStep(step, type);
24 template <
typename vec_t>
26 scalar_t step,
int internal_type,
int boundary_type)
const {
27 auto d1 = sh1->discretizeWithStep(step, internal_type, boundary_type);
28 auto d2 = sh2->discretizeWithStep(step, internal_type, boundary_type);
32 template <
typename vec_t>
34 const std::function<
scalar_t(vec_t)>& dr,
int type)
const {
35 auto d1 = sh1->discretizeBoundaryWithDensity(dr, type);
36 auto d2 = sh2->discretizeBoundaryWithDensity(dr, type);
40 template <
typename vec_t>
42 const std::function<
scalar_t(vec_t)>& dr,
int internal_type,
43 int boundary_type)
const {
44 auto d1 = sh1->discretizeWithDensity(dr, internal_type, boundary_type);
45 auto d2 = sh2->discretizeWithDensity(dr, internal_type, boundary_type);
49 template <
typename vec_t>
51 vec_t lo, hi, lo1, hi1, lo2, hi2;
52 std::tie(lo1, hi1) = sh1->bbox();
53 std::tie(lo2, hi2) = sh2->bbox();
54 for (
int i = 0; i <
dim; ++i) {
55 lo[i] = std::min(lo1[i], lo2[i]);
56 hi[i] = std::max(hi1[i], hi2[i]);
61 template <
typename vec_t>
63 return os <<
"ShapeUnion(" << *sh1 <<
", " << *sh2 <<
")";
68 #endif // MEDUSA_BITS_DOMAINS_SHAPEUNION_HPP_