Tensor-product non-uniform rational B-spline with uniform knot vector (core functionality)
More...
|
template<typename other_t , short_t GeoDim_, short_t... Degrees_> |
using | derived_self_type = UniformNurbsCore< other_t, GeoDim_, Degrees_... > |
| Deduces the derived self-type when exposed to different class template parameters real_t and GeoDim , and the Degrees parameter pack.
|
|
template<template< typename, short_t, short_t... > class BSpline, std::make_signed< short_t >::type degree_elevate = 0> |
using | derived_type = BSpline< real_t, GeoDim+1,(Degrees+degree_elevate)... > |
| Deduces the type of the template template parameter BSpline when exposed to the class template parameters real_t and GeoDim , and the Degrees parameter pack. The optional template parameter degree_elevate can be used to (de-)elevate the degrees by an additive constant.
|
|
template<typename other_t > |
using | real_derived_self_type = UniformNurbsCore< other_t, GeoDim, Degrees... > |
| Deduces the derived self-type when exposed to a different class template parameter real_t
|
|
template<std::make_signed< short_t >::type degree_elevate = 0> |
using | self_type = typename Base::template derived_type< UniformNurbsCore, degree_elevate > |
| Deduces the self-type possibly degrees (de-)elevated by the additive constant degree_elevate
|
|
using | value_type = real_t |
| Value type.
|
|
using | derived_self_type = UniformBSplineCore< other_t, GeoDim_, Degrees_... > |
| Deduces the derived self-type when exposed to different class template parameters real_t and GeoDim , and the Degrees parameter pack.
|
|
using | derived_type = BSpline< real_t, GeoDim,(Degrees+degree_elevate)... > |
| Deduces the type of the template template parameter BSpline when exposed to the class template parameters real_t and GeoDim , and the Degrees parameter pack. The optional template parameter degree_elevate can be used to (de-)elevate the degrees by an additive constant.
|
|
using | real_derived_self_type = UniformBSplineCore< other_t, GeoDim, Degrees... > |
| Deduces the derived self-type when exposed to a different class template parameter real_t
|
|
using | self_type = derived_type< UniformBSplineCore, degree_elevate > |
| Deduces the self-type possibly degrees (de-)elevated by the additive constant degree_elevate
|
|
using | value_type = real_t |
| Value type.
|
|
|
| UniformNurbsCore (const std::array< int64_t, Base::parDim_ > &ncoeffs, const utils::TensorArray< Base::geoDim_ > &coeffs, bool clone=false, Options< real_t > options=Options< real_t >{}) |
| Constructor for equidistant knot vectors.
|
|
| UniformNurbsCore (const std::array< int64_t, Base::parDim_ > &ncoeffs, enum init init=init::greville, Options< real_t > options=Options< real_t >{}) |
| Constructor for equidistant knot vectors.
|
|
| UniformNurbsCore (const std::array< int64_t, Base::parDim_ > &ncoeffs, utils::TensorArray< Base::geoDim_ > &&coeffs, Options< real_t > options=Options< real_t >{}) |
| Constructor for equidistant knot vectors.
|
|
template<typename other_t > |
| UniformNurbsCore (const UniformNurbsCore< other_t, GeoDim+1, Degrees... > &other, Options< real_t > options=Options< real_t >{}) |
| Copy constructor.
|
|
| UniformNurbsCore (Options< real_t > options=Options< real_t >{}) |
| Default constructor.
|
|
const torch::Tensor & | weights () const noexcept |
| Returns a constant reference to the weights.
|
|
torch::Tensor & | weights () noexcept |
| Returns a non-constant reference to the weights.
|
|
| UniformBSplineCore (const std::array< int64_t, parDim_ > &ncoeffs, const utils::TensorArray< geoDim_ > &coeffs, bool clone=false, Options< real_t > options=Options< real_t >{}) |
| Constructor for equidistant knot vectors.
|
|
| UniformBSplineCore (const std::array< int64_t, parDim_ > &ncoeffs, enum init init=init::greville, Options< real_t > options=Options< real_t >{}) |
| Constructor for equidistant knot vectors.
|
|
| UniformBSplineCore (const std::array< int64_t, parDim_ > &ncoeffs, utils::TensorArray< geoDim_ > &&coeffs, Options< real_t > options=Options< real_t >{}) |
| Constructor for equidistant knot vectors.
|
|
| UniformBSplineCore (const UniformBSplineCore< other_t, GeoDim, Degrees... > &other, Options< real_t > options=Options< real_t >{}) |
| Copy constructor.
|
|
| UniformBSplineCore (Options< real_t > options=Options< real_t >{}) |
| Default constructor.
|
|
torch::Tensor | as_tensor () const noexcept override |
| Returns all coefficients as a single tensor.
|
|
int64_t | as_tensor_size () const noexcept override |
| Returns the size of the single tensor representation of all coefficients.
|
|
const utils::TensorArray< geoDim_ > & | coeffs () const noexcept |
| Returns a constant reference to the array of coefficient vectors.
|
|
utils::TensorArray< geoDim_ > & | coeffs () noexcept |
| Returns a non-constant reference to the array of coefficient vectors.
|
|
const torch::Tensor & | coeffs (short_t i) const noexcept |
| Returns a constant reference to the coefficient vector in the \(i\)-th dimension.
|
|
torch::Tensor & | coeffs (short_t i) noexcept |
| Returns a non-constant reference to the coefficient vector in the \(i\)-th dimension.
|
|
nlohmann::json | coeffs_to_json () const |
| Returns the B-spline object's coefficients as JSON object.
|
|
utils::TensorArray< geoDim_ > | coeffs_view () const noexcept |
| Returns an array of views to the coefficient vectors.
|
|
const auto | coeffs_view (short_t i) const noexcept |
| Returns a view to the coefficient vector in the \(i\)-th dimension.
|
|
torch::Device | device () const noexcept override |
| Returns the device property.
|
|
int32_t | device_index () const noexcept override |
| Returns the device_index property.
|
|
torch::Dtype | dtype () const noexcept override |
| Returns the dtype property.
|
|
auto | eval (const utils::TensorArray< parDim_ > &xi, const utils::TensorArray< parDim_ > &knot_indices) const |
| Returns the value of the univariate B-spline object in the points xi
|
|
auto | eval (const utils::TensorArray< parDim_ > &xi, const utils::TensorArray< parDim_ > &knot_indices, const torch::Tensor &coeff_indices) const |
| Returns the value of the univariate B-spline object in the points xi
|
|
auto & | from_gismo (BSpline &bspline, bool, bool) |
|
UniformBSplineCore & | from_json (const nlohmann::json &json) |
| Updates the B-spline object from JSON object.
|
|
UniformBSplineCore & | from_tensor (const torch::Tensor &tensor) noexcept override |
| Sets all coefficients from a single tensor.
|
|
UniformBSplineCore & | from_xml (const pugi::xml_document &doc, int id=0, std::string label="", int index=-1) |
| Updates the B-spline object from XML object.
|
|
UniformBSplineCore & | from_xml (const pugi::xml_node &root, int id=0, std::string label="", int index=-1) |
| Updates the B-spline object from XML node.
|
|
auto | greville (bool interior=false) const |
| Returns the Greville abscissae.
|
|
void | init_coeffs (enum init init) |
| Initializes the B-spline coefficients.
|
|
void | init_knots () |
| Initializes the B-spline knots.
|
|
bool | is_sparse () const noexcept override |
| Returns true if the layout is sparse.
|
|
bool | isclose (const UniformBSplineCore< other_t, GeoDim_, Degrees_... > &other, real_t rtol=real_t{1e-5}, real_t atol=real_t{1e-8}) const |
| Returns true if both B-spline objects are close up to the given tolerances.
|
|
const utils::TensorArray< parDim_ > & | knots () const noexcept |
| Returns a constant reference to the array of knot vectors.
|
|
utils::TensorArray< parDim_ > & | knots () noexcept |
| Returns a non-constant reference to the array of knot vectors.
|
|
const torch::Tensor & | knots (short_t i) const noexcept |
| Returns a constant reference to the knot vector in the \(i\)-th dimension.
|
|
torch::Tensor & | knots (short_t i) noexcept |
| Returns a non-constant reference to the knot vector in the \(i\)-th dimension.
|
|
nlohmann::json | knots_to_json () const |
| Returns the B-spline object's knots as JSON object.
|
|
torch::Layout | layout () const noexcept override |
| Returns the layout property.
|
|
void | load (const std::string &filename, const std::string &key="bspline") |
| Loads the B-spline from file.
|
|
const std::array< int64_t, parDim_ > & | ncoeffs () const noexcept |
| Returns a constant reference to the array of coefficient vector dimensions.
|
|
int64_t | ncoeffs (short_t i) const noexcept |
| Returns the total number of coefficients in the \(i\)-th direction.
|
|
int64_t | ncumcoeffs () const noexcept |
| Returns the total number of coefficients.
|
|
const std::array< int64_t, parDim_ > & | nknots () const noexcept |
| Returns a constant reference to the array of knot vector dimensions.
|
|
int64_t | nknots (short_t i) const noexcept |
| Returns the dimension of the knot vector in the \(i\)-th dimension.
|
|
bool | operator!= (const UniformBSplineCore< other_t, GeoDim_, Degrees_... > &other) const |
| Returns true if both B-spline objects are different.
|
|
bool | operator== (const UniformBSplineCore< other_t, GeoDim_, Degrees_... > &other) const |
| Returns true if both B-spline objects are the same.
|
|
const Options< real_t > & | options () const noexcept |
| Returns a constant reference to the B-spline object's options.
|
|
bool | pinned_memory () const noexcept override |
| Returns the pinned_memory property.
|
|
torch::serialize::InputArchive & | read (torch::serialize::InputArchive &archive, const std::string &key="bspline") |
| Reads the B-spline from a torch::serialize::InputArchive object.
|
|
bool | requires_grad () const noexcept override |
| Returns the requires_grad property.
|
|
void | save (const std::string &filename, const std::string &key="bspline") const |
| Saves the B-spline to file.
|
|
UniformBSplineCore & | set_requires_grad (bool requires_grad) noexcept override |
| Sets the B-spline object's requires_grad property.
|
|
auto | to_gismo () const |
| Converts the B-spline object into a gsBSpline object of the parametric dimension is one and a gsTensorBSpline object otherwise.
|
|
BSpline & | to_gismo (BSpline &bspline, bool, bool) const |
|
nlohmann::json | to_json () const override |
| Returns the B-spline object as JSON object.
|
|
pugi::xml_document | to_xml (int id=0, std::string label="", int index=-1) const |
| Returns the B-spline object as XML object.
|
|
pugi::xml_node & | to_xml (pugi::xml_node &root, int id=0, std::string label="", int index=-1) const |
| Returns the B-spline object as XML node.
|
|
UniformBSplineCore & | transform (const std::function< std::array< real_t, geoDim_ >(const std::array< real_t, parDim_ > &)> transformation) |
| Transforms the coefficients based on the given mapping.
|
|
UniformBSplineCore & | transform (const std::function< std::array< real_t, N >(const std::array< real_t, parDim_ > &)> transformation, std::array< short_t, N > dims) |
| Transforms the coefficients based on the given mapping.
|
|
UniformBSplineCore & | uniform_refine (int numRefine=1, int dim=-1) |
| Returns the B-spline object with uniformly refined knot and coefficient vectors.
|
|
torch::serialize::OutputArchive & | write (torch::serialize::OutputArchive &archive, const std::string &key="bspline") const |
| Writes the B-spline into a torch::serialize::OutputArchive object.
|
|
virtual void | pretty_print (std::ostream &os=Log(log::info)) const =0 |
| Returns a string representation of the object.
|
|
virtual void | pretty_print (std::ostream &os=Log(log::info)) const noexcept=0 |
| Returns a string representation.
|
|
template<
typename real_t,
short_t GeoDim, short_t... Degrees>
class iganet::UniformNurbsCore< real_t, GeoDim, Degrees >
Tensor-product non-uniform rational B-spline with uniform knot vector (core functionality)
This class extends the base class UniformBSplineCore to non-uniform rational B-splines (NURBS) with uniform knot vectors. Like its base class it only implements the core functionality of non-uniform rational B-splines.
This implementation exploits the fact that NURBS in \(d\) space dimensions can be realized through perspective projection from B-splines in \(d+1\) space dimensions. That is, a NURBS object with control points
\[
\mathbf{c}_i = \left(x_i, y_i, z_i\right)
\]
is extended to a B-spline object with homogeneous coordinates
\[
\mathbf{c}_i = \left(w_i x_i, w_i y_i, w_i z_i, w_i\right)
\]
with non-negative weights \(w_i\). All operations are performed on the B-spline object which is afterwards converted to a NURBS object through perspective projection onto the coordinates \(\left(x/w, y/w, z/w\right)\).