#ifndef MEDUSA_BITS_DOMAINS_SHAPEDIFFERENCE_HPP_ #define MEDUSA_BITS_DOMAINS_SHAPEDIFFERENCE_HPP_ #include "ShapeDifference_fwd.hpp" #include "DomainDiscretization.hpp" #include #include /** * @file * Implementation of ShapeDifference class. */ namespace mm { template DomainDiscretization ShapeDifference::discretizeBoundaryWithStep(scalar_t step, int type) const { auto d1 = sh1->discretizeBoundaryWithStep(step, type); sh2->toggleMargin(); auto d2 = sh2->discretizeBoundaryWithStep(step, type); sh2->toggleMargin(); return d1.subtract(d2); } template DomainDiscretization ShapeDifference::discretizeWithStep( scalar_t step, int internal_type, int boundary_type) const { auto d1 = sh1->discretizeWithStep(step, internal_type, boundary_type); sh2->toggleMargin(); auto d2 = sh2->discretizeBoundaryWithStep(step, boundary_type); sh2->toggleMargin(); return d1.subtract(d2); } template DomainDiscretization ShapeDifference::discretizeBoundaryWithDensity( const std::function& dr, int type) const { auto d1 = sh1->discretizeBoundaryWithDensity(dr, type); sh2->toggleMargin(); auto d2 = sh2->discretizeBoundaryWithDensity(dr, type); sh2->toggleMargin(); return d1.subtract(d2); } template DomainDiscretization ShapeDifference::discretizeWithDensity( const std::function& dr, int internal_type, int boundary_type) const { auto d1 = sh1->discretizeWithDensity(dr, internal_type, boundary_type); sh2->toggleMargin(); auto d2 = sh2->discretizeBoundaryWithDensity(dr, boundary_type); sh2->toggleMargin(); return d1.subtract(d2); } template std::ostream& ShapeDifference::print(std::ostream& os) const { return os << "ShapeDifference(" << *sh1 << ", " << *sh2 << ")"; } } // namespace mm #endif // MEDUSA_BITS_DOMAINS_SHAPEDIFFERENCE_HPP_