|
Medusa
1.1
Coordinate Free Mehless Method implementation
|
|
Go to the documentation of this file. 1 #ifndef MEDUSA_BITS_DOMAINS_DOMAINSHAPE_FWD_HPP_
2 #define MEDUSA_BITS_DOMAINS_DOMAINSHAPE_FWD_HPP_
21 template <
class vec_t>
24 template <
class vec_t>
30 template <
typename vec_t>
33 template <
typename vec_t>
36 template <
typename vec_t>
39 template <
typename vec_t>
51 template <
typename vec_t>
90 const vec_t& unit_normal)
const;
93 virtual bool contains(
const vec_t& point)
const = 0;
103 virtual std::pair<vec_t, vec_t>
bbox()
const = 0;
107 virtual std::ostream&
print(std::ostream& os)
const = 0;
138 scalar_t step,
int internal_type,
int boundary_type)
const {
158 const std::function<
scalar_t(vec_t)>& dr,
int internal_type,
int boundary_type)
const;
161 template <
typename func_t,
typename fill_t>
163 int internal_type,
int boundary_type)
const {
165 fill(domain, dr, internal_type);
171 const std::function<
scalar_t(vec_t)>& dr)
const {
176 template <
typename func_t,
typename fill_t>
186 const std::function<
scalar_t(vec_t)>& dr,
int type)
const = 0;
190 const std::function<
scalar_t(vec_t)>& dr)
const {
211 template <
typename V>
219 template <
typename V>
221 return shape.
print(os);
226 #endif // MEDUSA_BITS_DOMAINS_DOMAINSHAPE_FWD_HPP_
scalar_t margin_
Tolerance for the geometric operation of the domain.
ShapeUnion< vec_t > add(const DomainShape &other) const
Returns a shape representing a union of *this and other.
DomainShape()
Construct domain with default margin.
Root namespace for the whole library.
DomainDiscretization< vec_t > discretizeWithDensity(const func_t &dr, const fill_t &fill) const
Overload for fill engine with default types.
virtual bool contains(const vec_t &point) const =0
Return true if point is not more than margin() outside the domain.
Scalar scalar_t
Type of the elements, alias of Scalar.
DomainDiscretization< vec_t > discretizeBoundaryWithStep(scalar_t step) const
Returns a discretization of the boundary of this shape with approximately uniform distance step betwe...
Class representing domain discretization along with an associated shape.
Class representing a union of two shapes.
RotatedShape< vec_t > rotate(const Eigen::Matrix< scalar_t, dim, dim > &Q)
Transform the shape by given orthogonal matrix Q.
ShapeDifference< vec_t > operator-(const DomainShape &other) const
Operator form of DomainShape::subtract.
Class for working with translated domain shapes.
@ dim
Number of elements of this matrix.
Class for working with rotated (or mirrored) domain shapes.
DomainDiscretization< vec_t > discretizeWithDensity(const std::function< scalar_t(vec_t)> &dr) const
Overload with default types.
@ dim
Dimensionality of the domain.
std::ostream & operator<<(std::ostream &os, const Gaussian< S > &b)
Output basic information about given Gaussian RBF.
DomainDiscretization< vec_t > discretizeWithDensity(const func_t &dr, const fill_t &fill, int internal_type, int boundary_type) const
Overload for fill engine.
void toggleMargin()
Toggles the margin from positive to negative.
virtual void setMargin(scalar_t margin)
Sets domain margin to margin.
virtual DomainShape * clone() const =0
Polymorphic clone pattern.
virtual DomainDiscretization< vec_t > discretizeWithStep(scalar_t step, int internal_type, int boundary_type) const
Returns a discretization of this shape with approximately uniform distance step between nodes.
Base class for geometric shapes of domains.
TranslatedShape< vec_t > translate(const vec_t &a)
Translate the shape by given vector a.
vec_t vector_t
Vector data type used in computations.
virtual std::ostream & print(std::ostream &os) const =0
Output information about this shape to given output stream os.
virtual DomainDiscretization< vec_t > discretizeBoundaryWithDensity(const std::function< scalar_t(vec_t)> &dr, int type) const =0
Discretizes boundary with given density and fill engine.
virtual DomainDiscretization< vec_t > discretizeWithDensity(const std::function< scalar_t(vec_t)> &dr, int internal_type, int boundary_type) const
Returns a discretization of the domain with spatially variable step.
ShapeDifference< vec_t > subtract(const DomainShape &other) const
Returns a shape representing a difference of *this and other.
virtual std::pair< vec_t, vec_t > bbox() const =0
Return the bounding box of the domain.
virtual ~DomainShape()=default
Virtual destructor to properly destruct base class when invoked polymorphically.
virtual DomainDiscretization< vec_t > discretizeBoundaryWithStep(scalar_t step, int type) const
Returns a discretization of the boundary of this shape with approximately uniform distance step betwe...
virtual std::pair< bool, vec_t > projectPointToBoundary(const vec_t &point, const vec_t &unit_normal) const
Project point to boundary using bisection along the line define by unit_normal.
scalar_t margin() const
Returns current margin.
ShapeUnion< vec_t > operator+(const DomainShape &other) const
Operator form of DomainShape::add.
A class representing a set-difference of two shapes.
DomainDiscretization< vec_t > discretizeWithStep(scalar_t step) const
discretizeWithStep but with default types as assigned by the shape.
DomainDiscretization< vec_t > discretizeBoundaryWithDensity(const std::function< scalar_t(vec_t)> &dr) const
Overload with default type.
Unique pointer with polymorphic deep copy semantics.
vec_t::Scalar scalar_t
Scalar data type used in computation.
friend std::ostream & operator<<(std::ostream &os, const DomainShape< V > &shape)
Output info about given shape to ostream.
virtual bool hasContains() const
Return true if shape has contains() method implemented.