Medusa  1.1
Coordinate Free Mehless Method implementation
BoxShape_fwd.hpp
Go to the documentation of this file.
1 #ifndef MEDUSA_BITS_DOMAINS_BOXSHAPE_FWD_HPP_
2 #define MEDUSA_BITS_DOMAINS_BOXSHAPE_FWD_HPP_
3 
11 #include <medusa/Config.hpp>
12 #include "DomainShape_fwd.hpp"
15 
16 namespace mm {
17 
27 template <typename vec_t>
28 class BoxShape : public DomainShape<vec_t> {
29  vec_t beg_,
30  end_;
31  using typename DomainShape<vec_t>::scalar_t;
33 
34  public:
48  BoxShape(vec_t beg, vec_t end);
50  const vec_t& beg() const { return beg_; }
52  const vec_t& end() const { return end_; }
53 
54  bool contains(const vec_t& point) const override;
55 
56  std::pair<vec_t, vec_t> bbox() const override { return {beg_, end_}; }
57 
60  scalar_t step, int internal_type, int boundary_type) const override;
62  const std::function<scalar_t(vec_t)>& dr, int type) const override;
63 
79  DomainDiscretization<vec_t> discretizeBoundary(const Vec<int, dim>& counts, int type = 0) const;
89  DomainDiscretization<vec_t> discretize(const Vec<int, dim>& counts, int internal_type = 0,
90  int boundary_type = 0) const;
91 
92  BoxShape<vec_t>* clone() const override { return new BoxShape<vec_t>(*this); }
93 
94  std::ostream& print(std::ostream& os) const override;
95 };
96 
97 } // namespace mm
98 
99 #endif // MEDUSA_BITS_DOMAINS_BOXSHAPE_FWD_HPP_
mm
Root namespace for the whole library.
Definition: Gaussian.hpp:14
scalar_t
Scalar scalar_t
Type of the elements, alias of Scalar.
Definition: MatrixBaseAddons.hpp:16
mm::DomainDiscretization
Class representing domain discretization along with an associated shape.
Definition: DomainDiscretization_fwd.hpp:46
mm::Vec
Eigen::Matrix< scalar_t, dim, 1, Eigen::ColMajor|Eigen::AutoAlign, dim, 1 > Vec
Fixed size vector type, representing a mathematical 1d/2d/3d vector.
Definition: Vec_fwd.hpp:31
mm::BoxShape::end
const vec_t & end() const
Returns the second point defining the box.
Definition: BoxShape_fwd.hpp:52
mm::BoxShape::beg
const vec_t & beg() const
Returns the first point defining the box.
Definition: BoxShape_fwd.hpp:50
mm::BoxShape::discretizeBoundary
DomainDiscretization< vec_t > discretizeBoundary(const Vec< int, dim > &counts, int type=0) const
Uniformly discretizes underlying domain boundary.
Definition: BoxShape.hpp:49
mm::DomainShape
Base class for geometric shapes of domains.
Definition: DomainShape_fwd.hpp:52
mm::BoxShape::BoxShape
BoxShape(vec_t beg, vec_t end)
Constructs a n dimensional box shaped domain defined by two n dimensional points - vertices at ends o...
Definition: BoxShape.hpp:21
Config.hpp
mm::BoxShape::end_
vec_t end_
Larger of the edge points.
Definition: BoxShape_fwd.hpp:30
mm::BoxShape::contains
bool contains(const vec_t &point) const override
Return true if point is not more than margin() outside the domain.
Definition: BoxShape.hpp:31
Range_fwd.hpp
Vec_fwd.hpp
mm::BoxShape::discretizeBoundaryWithDensity
DomainDiscretization< vec_t > discretizeBoundaryWithDensity(const std::function< scalar_t(vec_t)> &dr, int type) const override
Discretizes boundary with given density and fill engine.
Definition: BoxShape.hpp:209
mm::BoxShape
Class for working with box shaped domains.
Definition: BoxShape_fwd.hpp:28
mm::BoxShape::discretizeWithStep
DomainDiscretization< vec_t > discretizeWithStep(scalar_t step, int internal_type, int boundary_type) const override
Returns a discretization of this shape with approximately uniform distance step between nodes.
Definition: BoxShape.hpp:312
mm::BoxShape::discretizeBoundaryWithStep
DomainDiscretization< vec_t > discretizeBoundaryWithStep(scalar_t step, int type) const override
Returns a discretization of the boundary of this shape with approximately uniform distance step betwe...
Definition: BoxShape.hpp:41
mm::BoxShape::clone
BoxShape< vec_t > * clone() const override
Polymorphic clone pattern.
Definition: BoxShape_fwd.hpp:92
mm::BoxShape::discretize
DomainDiscretization< vec_t > discretize(const Vec< int, dim > &counts, int internal_type=0, int boundary_type=0) const
Uniformly discretizes underlying domain.
Definition: BoxShape.hpp:320
mm::BoxShape::bbox
std::pair< vec_t, vec_t > bbox() const override
Return the bounding box of the domain.
Definition: BoxShape_fwd.hpp:56
mm::BoxShape::print
std::ostream & print(std::ostream &os) const override
Output information about this shape to given output stream os.
Definition: BoxShape.hpp:203
mm::DomainShape::scalar_t
vec_t::Scalar scalar_t
Scalar data type used in computation.
Definition: DomainShape_fwd.hpp:55
DomainShape_fwd.hpp
mm::BoxShape::beg_
vec_t beg_
Smaller of the edge points.
Definition: BoxShape_fwd.hpp:29