11#ifndef QUGAR_IMPL_BEZIER_TP_HPP
12#define QUGAR_IMPL_BEZIER_TP_HPP
28#include <algoim/xarray.hpp>
35template<
int dim,
int range>
class MonomialsTP;
41template<
int dim,
int range = 1>
class BezierTP :
public PolynomialTP<dim, range>
60 template<
int N>
using Interval = ::algoim::Interval<N>;
183 typename std::vector<CoefsType>::const_iterator &coefs,
202 typename std::vector<CoefsType>::const_iterator &coefs,
207 [[nodiscard]] const ::algoim::xarray<CoefsType, dim> &
get_xarray()
const;
209 template<
int dim_aux = dim>
210 requires(dim == dim_aux && dim > 1)
239 [[nodiscard]] std::shared_ptr<BezierTP<dim, range>>
negate()
const;
245 template<
int range_aux = range>
246 requires(range_aux == range && range == 1)
253 template<
int range_aux = range>
254 requires(range_aux == range && range == 1)
283 template<
int sub_dim>
301 return bzr !=
nullptr;
Definition of Cartesian bounding box class.
Class representing a dim-dimensional Cartesian product bounding box.
Definition bbox.hpp:38
Class representing a dim-dimensional tensor-product sizes container.
Definition tensor_index_tp.hpp:38
dim-dimensional tensor-product Bezier polynomial function.
Definition monomials_tp.hpp:34
std::shared_ptr< BezierTP< dim - 1, range > > extract_facet(const int local_facet_id) const
BezierTP(const MonomialsTP< dim, range > &monomials)
Constructor.
FuncSign sign() const
Returns the sign of the function represented by the Bézier tensor-product using the properties of the...
virtual Value< Interval< dim > > operator()(const Point< dim, Interval< dim > > &point) const final
Evaluator operator.
virtual Hessian< real > hessian(const Point< dim > &point) const final
Hessian evaluator operator.
static Value< T > casteljau(const Point< dim, T > &point, typename std::vector< CoefsType >::const_iterator &coefs, const Vector< int, dim > &order)
Evaluates a Bezier polynomial using the Casteljau's algorithm.
BezierTP(const TensorSizeTP< dim > &order)
Constructor.
::algoim::xarray< CoefsType, dim > coefs_xarray_
dim-dimensional array view of the coefficients.
Definition bezier_tp.hpp:112
Gradient< T > grad_(const Point< dim, T > &point) const
Gradient evaluator operator.
std::shared_ptr< BezierTP< dim, range > > raise_order(const TensorSizeTP< dim > &new_order) const
Raises the order of the Bezier tensor product.
std::shared_ptr< BezierTP< dim, range > > operator*(const BezierTP< dim, range > &rhs) const
Product of two Beziers.
::algoim::Interval< N > Interval
Algoim's interval alias.
Definition bezier_tp.hpp:60
typename Parent::template Hessian< T > Hessian
Hessian type.
Definition bezier_tp.hpp:57
BezierTP(const TensorSizeTP< dim > &order, const CoefsType &value)
Constructs a constant value Bezier tensor product.
BezierTP(const TensorSizeTP< dim > &order, const std::vector< CoefsType > &coefs)
Constructor.
virtual Gradient< real > grad(const Point< dim > &point) const final
Gradient evaluator operator.
BezierTP(const BezierTP< dim, range > &bezier)
Copy constructor.
void rescale_domain(const BoundBox< dim > &new_domain)
Recomputes (in-place) the Bezier coefficients for a new domain (that may not be [0,...
virtual Gradient< Interval< dim > > grad(const Point< dim, Interval< dim > > &point) const final
Gradient evaluator operator.
static Vector< Value< T >, dim+1 > casteljau_der(const Point< dim, T > &point, typename std::vector< CoefsType >::const_iterator &coefs, const Vector< int, dim > &order)
Evaluates the gradient Bezier polynomial using the Casteljau's algorithm.
typename Parent::CoefsType CoefsType
Coefs type.
Definition bezier_tp.hpp:48
virtual Value< real > operator()(const Point< dim > &point) const final
Evaluator operator.
typename Parent::template Value< T > Value
Value type.
Definition bezier_tp.hpp:51
Value< T > eval_(const Point< dim, T > &point) const
Evaluator operator.
std::shared_ptr< BezierTP< dim, range > > operator+(const BezierTP< dim, range > &rhs) const
Addition of two Beziers.
std::shared_ptr< BezierTP< dim, range > > negate() const
Creates a new Bezier tensor product (TP) object that is the negation of the current object.
std::shared_ptr< BezierTP< sub_dim, range > > compose(const BezierTP< sub_dim, dim > &rhs) const
Composes the current Bezier with the given Bezier rhs.
const ::algoim::xarray< CoefsType, dim > & get_xarray() const
Gets a constant reference to the stored xarray view of the polynomial coefficients.
typename Parent::template Gradient< T > Gradient
Gradient type.
Definition bezier_tp.hpp:54
Hessian< T > hessian_(const Point< dim, T > &point) const
Hessian evaluator operator.
std::shared_ptr< BezierTP< dim, range > > operator-(const BezierTP< dim, range > &rhs) const
Subtraction of two Beziers.
Domain functions.
Definition domain_function.hpp:41
dim-dimensional tensor-product monomials function.
Definition monomials_tp.hpp:41
Base class for tensor-product polynomial functions.
Definition polynomial_tp.hpp:37
std::conditional_t< range==1, real, Point< range > > CoefsType
Coefs type.
Definition polynomial_tp.hpp:40
Declaration of a few implicit functions template class ready to be consumed by Algoim.
Declaration of tensor-product monomials class.
Definition affine_transf.hpp:28
FuncSign
Definition domain_function.hpp:33
static bool is_bezier(const DomainFunc< dim, range > &func)
Checks if a given DomainFunc object is of type BezierTP.
Definition bezier_tp.hpp:298
::algoim::uvector< T, dim > Vector
Class representing a vector.
Definition vector.hpp:31
Vector< T, dim > Point
Class representing a dim-dimensional Point.
Definition point.hpp:34
Declaration of tensor-product polynomial class.
Declaration of tensor-product index and size related classes.