IgANet
IGAnets - Isogeometric Analysis Networks
Loading...
Searching...
No Matches
iganet::BSplinePatch< real_t, GeoDim, ParDim > Class Template Referenceabstract

Abstract patch function base class. More...

#include </home/runner/work/iganet/iganet/include/iganet/splines/patch.hpp>

Public Types

using value_type = real_t
 Scalar type.
 

Public Member Functions

virtual ~BSplinePatch ()=default
 Destructor.
 
virtual torch::Tensor as_tensor () const noexcept=0
 Provides the as_tensor operation.
 
virtual int64_t as_tensor_size () const noexcept=0
 Returns the size of the single tensor representation of all coefficients.
 
virtual torch::Device device () const noexcept=0
 Returns the device property.
 
virtual int32_t device_index () const noexcept=0
 Returns the device_index property.
 
virtual torch::Dtype dtype () const noexcept=0
 Returns the dtype property.
 
virtual BSplinePatchfrom_json (const nlohmann::json &json)=0
 Updates the B-spline patch from a JSON object.
 
virtual BSplinePatchfrom_tensor (const torch::Tensor &tensor) noexcept=0
 Sets all coefficients from a single tensor.
 
virtual BSplinePatchfrom_xml (const pugi::xml_document &doc, int id=0, const std::string &label="", int index=-1)=0
 Updates the B-spline patch from an XML document.
 
virtual BSplinePatchfrom_xml (const pugi::xml_node &root, int id=0, const std::string &label="", int index=-1)=0
 Updates the B-spline patch from an XML node.
 
virtual bool is_sparse () const noexcept=0
 Returns if the layout is sparse.
 
virtual torch::Layout layout () const noexcept=0
 Returns the layout property.
 
virtual bool pinned_memory () const noexcept=0
 Returns the pinned_memory property.
 
virtual void pretty_print (std::ostream &os=Log(log::info)) const noexcept=0
 Returns a string representation.
 
virtual bool requires_grad () const noexcept=0
 Returns the requires_grad property.
 
virtual BSplinePatchset_requires_grad (bool requires_grad) noexcept=0
 Sets the B-spline object's requires_grad property.
 
virtual nlohmann::json to_json () const =0
 Returns the B-spline patch as a JSON object.
 
virtual pugi::xml_document to_xml (int id=0, const std::string &label="", int index=-1) const =0
 Returns the B-spline patch as an XML document.
 
virtual pugi::xml_node & to_xml (pugi::xml_node &root, int id=0, const std::string &label="", int index=-1) const =0
 Appends the B-spline patch to an XML node.
 

Static Public Member Functions

static constexpr short_t geoDim () noexcept
 Dimension of the physical space.
 
static constexpr short_t parDim () noexcept
 Dimension of the parametric space.
 

Detailed Description

template<typename real_t, short_t GeoDim, short_t ParDim>
class iganet::BSplinePatch< real_t, GeoDim, ParDim >

Abstract patch function base class.

Member Typedef Documentation

◆ value_type

template<typename real_t , short_t GeoDim, short_t ParDim>
using iganet::BSplinePatch< real_t, GeoDim, ParDim >::value_type = real_t

Scalar type.

Constructor & Destructor Documentation

◆ ~BSplinePatch()

template<typename real_t , short_t GeoDim, short_t ParDim>
virtual iganet::BSplinePatch< real_t, GeoDim, ParDim >::~BSplinePatch ( )
virtualdefault

Destructor.

Member Function Documentation

◆ as_tensor()

template<typename real_t , short_t GeoDim, short_t ParDim>
virtual torch::Tensor iganet::BSplinePatch< real_t, GeoDim, ParDim >::as_tensor ( ) const
pure virtualnoexcept

◆ as_tensor_size()

template<typename real_t , short_t GeoDim, short_t ParDim>
virtual int64_t iganet::BSplinePatch< real_t, GeoDim, ParDim >::as_tensor_size ( ) const
pure virtualnoexcept

Returns the size of the single tensor representation of all coefficients.

Returns
Result of the operation.

Implemented in iganet::UniformBSplineCore< real_t, GeoDim, Degrees >, iganet::UniformBSplineCore< real_t, GeoDim+1, Degrees... >, and iganet::UniformBSplineCore< real_t, GeoDim, Degrees... >.

◆ device()

template<typename real_t , short_t GeoDim, short_t ParDim>
virtual torch::Device iganet::BSplinePatch< real_t, GeoDim, ParDim >::device ( ) const
pure virtualnoexcept

◆ device_index()

template<typename real_t , short_t GeoDim, short_t ParDim>
virtual int32_t iganet::BSplinePatch< real_t, GeoDim, ParDim >::device_index ( ) const
pure virtualnoexcept

◆ dtype()

template<typename real_t , short_t GeoDim, short_t ParDim>
virtual torch::Dtype iganet::BSplinePatch< real_t, GeoDim, ParDim >::dtype ( ) const
pure virtualnoexcept

◆ eval_from_precomputed() [1/2]

template<typename real_t , short_t GeoDim, short_t ParDim>
virtual utils::BlockTensor< torch::Tensor, 1, GeoDim > iganet::BSplinePatch< real_t, GeoDim, ParDim >::eval_from_precomputed ( const torch::Tensor &  basfunc,
const torch::Tensor &  coeff_indices,
int64_t  numeval,
torch::IntArrayRef  sizes 
) const
pure virtual

Returns the value of the spline function from precomputed basis function.

Parameters
basfuncValue of basfunc.
coeff_indicesValue of coeff_indices.
numevalValue of numeval.
sizesValue of sizes.
Returns
Result of the operation.

Implemented in iganet::UniformBSplineCore< real_t, GeoDim, Degrees >, iganet::UniformBSplineCore< real_t, GeoDim+1, Degrees... >, and iganet::UniformBSplineCore< real_t, GeoDim, Degrees... >.

◆ eval_from_precomputed() [2/2]

template<typename real_t , short_t GeoDim, short_t ParDim>
virtual utils::BlockTensor< torch::Tensor, 1, GeoDim > iganet::BSplinePatch< real_t, GeoDim, ParDim >::eval_from_precomputed ( const utils::TensorArray< ParDim > &  basfunc,
const torch::Tensor &  coeff_indices,
int64_t  numeval,
torch::IntArrayRef  sizes 
) const
pure virtual

Provides the eval_from_precomputed operation.

Parameters
basfuncValue of basfunc.
coeff_indicesValue of coeff_indices.
numevalValue of numeval.
sizesValue of sizes.
Returns
Result of the operation.

◆ from_json()

template<typename real_t , short_t GeoDim, short_t ParDim>
virtual BSplinePatch & iganet::BSplinePatch< real_t, GeoDim, ParDim >::from_json ( const nlohmann::json &  json)
pure virtual

Updates the B-spline patch from a JSON object.

Parameters
jsonJSON value to process.
Returns
Result of the operation.

Implemented in iganet::UniformBSplineCore< real_t, GeoDim, Degrees >, iganet::UniformBSplineCore< real_t, GeoDim+1, Degrees... >, and iganet::UniformBSplineCore< real_t, GeoDim, Degrees... >.

◆ from_tensor()

template<typename real_t , short_t GeoDim, short_t ParDim>
virtual BSplinePatch & iganet::BSplinePatch< real_t, GeoDim, ParDim >::from_tensor ( const torch::Tensor &  tensor)
pure virtualnoexcept

Sets all coefficients from a single tensor.

Parameters
tensorTensor to process.
Returns
Result of the operation.

Implemented in iganet::UniformBSplineCore< real_t, GeoDim, Degrees >, iganet::UniformBSplineCore< real_t, GeoDim+1, Degrees... >, and iganet::UniformBSplineCore< real_t, GeoDim, Degrees... >.

◆ from_xml() [1/2]

template<typename real_t , short_t GeoDim, short_t ParDim>
virtual BSplinePatch & iganet::BSplinePatch< real_t, GeoDim, ParDim >::from_xml ( const pugi::xml_document &  doc,
int  id = 0,
const std::string &  label = "",
int  index = -1 
)
pure virtual

Updates the B-spline patch from an XML document.

Parameters
docValue of doc.
idObject identifier.
labelObject label.
indexObject index.
Returns
Result of the operation.

Implemented in iganet::UniformBSplineCore< real_t, GeoDim, Degrees >, iganet::UniformBSplineCore< real_t, GeoDim+1, Degrees... >, and iganet::UniformBSplineCore< real_t, GeoDim, Degrees... >.

◆ from_xml() [2/2]

template<typename real_t , short_t GeoDim, short_t ParDim>
virtual BSplinePatch & iganet::BSplinePatch< real_t, GeoDim, ParDim >::from_xml ( const pugi::xml_node &  root,
int  id = 0,
const std::string &  label = "",
int  index = -1 
)
pure virtual

Updates the B-spline patch from an XML node.

Parameters
rootRoot XML node.
idObject identifier.
labelObject label.
indexObject index.
Returns
Result of the operation.

Implemented in iganet::UniformBSplineCore< real_t, GeoDim, Degrees >, iganet::UniformBSplineCore< real_t, GeoDim+1, Degrees... >, and iganet::UniformBSplineCore< real_t, GeoDim, Degrees... >.

◆ geoDim()

template<typename real_t , short_t GeoDim, short_t ParDim>
static constexpr short_t iganet::BSplinePatch< real_t, GeoDim, ParDim >::geoDim ( )
inlinestaticconstexprnoexcept

Dimension of the physical space.

Returns
Result of the operation.

◆ is_sparse()

template<typename real_t , short_t GeoDim, short_t ParDim>
virtual bool iganet::BSplinePatch< real_t, GeoDim, ParDim >::is_sparse ( ) const
pure virtualnoexcept

◆ layout()

template<typename real_t , short_t GeoDim, short_t ParDim>
virtual torch::Layout iganet::BSplinePatch< real_t, GeoDim, ParDim >::layout ( ) const
pure virtualnoexcept

◆ parDim()

template<typename real_t , short_t GeoDim, short_t ParDim>
static constexpr short_t iganet::BSplinePatch< real_t, GeoDim, ParDim >::parDim ( )
inlinestaticconstexprnoexcept

Dimension of the parametric space.

Returns
Result of the operation.

◆ pinned_memory()

template<typename real_t , short_t GeoDim, short_t ParDim>
virtual bool iganet::BSplinePatch< real_t, GeoDim, ParDim >::pinned_memory ( ) const
pure virtualnoexcept

◆ pretty_print()

template<typename real_t , short_t GeoDim, short_t ParDim>
virtual void iganet::BSplinePatch< real_t, GeoDim, ParDim >::pretty_print ( std::ostream &  os = Log(log::info)) const
pure virtualnoexcept

Returns a string representation.

Parameters
osOutput stream.

◆ requires_grad()

template<typename real_t , short_t GeoDim, short_t ParDim>
virtual bool iganet::BSplinePatch< real_t, GeoDim, ParDim >::requires_grad ( ) const
pure virtualnoexcept

◆ set_requires_grad()

template<typename real_t , short_t GeoDim, short_t ParDim>
virtual BSplinePatch & iganet::BSplinePatch< real_t, GeoDim, ParDim >::set_requires_grad ( bool  requires_grad)
pure virtualnoexcept

Sets the B-spline object's requires_grad property.

Parameters
requires_gradValue of requires_grad.
Returns
Result of the operation.

Implemented in iganet::UniformBSplineCore< real_t, GeoDim, Degrees >, iganet::UniformBSplineCore< real_t, GeoDim+1, Degrees... >, and iganet::UniformBSplineCore< real_t, GeoDim, Degrees... >.

◆ to_json()

template<typename real_t , short_t GeoDim, short_t ParDim>
virtual nlohmann::json iganet::BSplinePatch< real_t, GeoDim, ParDim >::to_json ( ) const
pure virtual

◆ to_xml() [1/2]

template<typename real_t , short_t GeoDim, short_t ParDim>
virtual pugi::xml_document iganet::BSplinePatch< real_t, GeoDim, ParDim >::to_xml ( int  id = 0,
const std::string &  label = "",
int  index = -1 
) const
pure virtual

Returns the B-spline patch as an XML document.

Parameters
idObject identifier.
labelObject label.
indexObject index.
Returns
Result of the operation.

Implemented in iganet::UniformBSplineCore< real_t, GeoDim, Degrees >, iganet::UniformBSplineCore< real_t, GeoDim+1, Degrees... >, and iganet::UniformBSplineCore< real_t, GeoDim, Degrees... >.

◆ to_xml() [2/2]

template<typename real_t , short_t GeoDim, short_t ParDim>
virtual pugi::xml_node & iganet::BSplinePatch< real_t, GeoDim, ParDim >::to_xml ( pugi::xml_node &  root,
int  id = 0,
const std::string &  label = "",
int  index = -1 
) const
pure virtual

Appends the B-spline patch to an XML node.

Parameters
rootRoot XML node.
idObject identifier.
labelObject label.
indexObject index.
Returns
Result of the operation.

Implemented in iganet::UniformBSplineCore< real_t, GeoDim, Degrees >, iganet::UniformBSplineCore< real_t, GeoDim+1, Degrees... >, and iganet::UniformBSplineCore< real_t, GeoDim, Degrees... >.


The documentation for this class was generated from the following file: