IgANet
IgANets - Isogeometric Analysis Networks
Loading...
Searching...
No Matches
iganet::BoundaryCommon< BoundaryCore > Class Template Reference

Boundary (common high-level functionality) More...

#include </home/runner/work/iganet/iganet/include/boundary.hpp>

Inheritance diagram for iganet::BoundaryCommon< BoundaryCore >:
iganet::detail::BoundaryType iganet::BoundaryCore< Spline, short_t >

Public Member Functions

torch::Tensor as_tensor () const
 Returns all coefficients of all spline objects as a single tensor.
 
int64_t as_tensor_size () const
 Returns the size of the single tensor representation of all spline objects.
 
BoundaryCommon clone () const
 Returns a clone of the boundary object.
 
auto device () const noexcept
 Auto-generated functions.
 
auto device_index () const noexcept
 Returns the device_index property of all splines.
 
auto dtype () const noexcept
 Returns the dtype property of all splines.
 
template<bool memory_optimized = false, typename... Indices>
auto find_coeff_indices (const std::tuple< Indices... > &indices) const
 Returns the indices of the spline objects' coefficients corresponding to the knot indices indices
 
template<typename... Xi>
auto find_knot_indices (const std::tuple< Xi... > &xi) const
 Returns the knot indicies of knot spans containing xi
 
autofrom_tensor (const torch::Tensor &tensor)
 Sets the coefficients of all spline objects from a single tensor.
 
BoundaryCommonfrom_xml (const pugi::xml_document &doc, int id=0, std::string label="", int index=-1)
 Updates the boundary object from XML object.
 
BoundaryCommonfrom_xml (const pugi::xml_node &root, int id=0, std::string label="", int index=-1)
 Updates the boundary object from XML node.
 
auto is_nonuniform () const noexcept
 Returns true if the B-spline is non-uniform if all splines.
 
auto is_sparse () const noexcept
 Returns if the layout is sparse of all splines.
 
auto is_uniform () const noexcept
 Returns true if the B-spline is uniform of all splines.
 
template<typename BoundaryCore_ >
bool isclose (const BoundaryCommon< BoundaryCore_ > &other, typename BoundaryCore::spline_type::value_type rtol=typename BoundaryCore::spline_type::value_type{1e-5}, typename BoundaryCore::spline_type::value_type atol=typename BoundaryCore::spline_type::value_type{1e-8}) const
 Returns true if both boundary objects are close up to the given tolerances.
 
auto layout () const noexcept
 Returns the layout property of all splines.
 
void load (const std::string &filename, const std::string &key="boundary")
 Loads the boundary spline object from file.
 
template<typename BoundaryCore_ >
bool operator!= (const BoundaryCommon< BoundaryCore_ > &other) const
 Returns true if both boundary objects are different.
 
template<typename BoundaryCore_ >
bool operator== (const BoundaryCommon< BoundaryCore_ > &other) const
 Returns true if both boundary objects are the same.
 
auto pinned_memory () const noexcept
 Returns the pinned_memory property of all splines.
 
torch::serialize::InputArchive & read (torch::serialize::InputArchive &archive, const std::string &key="boundary")
 Loads the boundary spline object from a torch::serialize::InputArchive object.
 
auto requires_grad () const noexcept
 Returns the requires_grad property of all splines.
 
void save (const std::string &filename, const std::string &key="boundary") const
 Saves the boundary spline to file.
 
BoundaryCommonset_requires_grad (bool requires_grad)
 Sets the boundary object's requires_grad property.
 
template<typename real_t >
auto to () const
 Returns a copy of the boundary object with real_t type.
 
template<typename real_t >
auto to (Options< real_t > options) const
 Returns a copy of the boundary object with settings from options.
 
auto to (torch::Device device) const
 Returns a copy of the boundary object with settings from device.
 
pugi::xml_document to_xml (int id=0, std::string label="", int index=-1) const
 Returns the boundary 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 boundary object as XML node.
 
autouniform_refine (int numRefine=1, int dim=-1)
 Returns the spline objects with uniformly refined knot and coefficient vectors.
 
torch::serialize::OutputArchive & write (torch::serialize::OutputArchive &archive, const std::string &key="boundary") const
 Writes the boundary spline object into a torch::serialize::OutputArchive object.
 

Private Member Functions

template<std::size_t... Is>
torch::Tensor as_tensor_ (std::index_sequence< Is... >) const
 Returns all coefficients of all spline objects as a single tensor.
 
template<std::size_t... Is>
int64_t as_tensor_size_ (std::index_sequence< Is... >) const
 Returns the size of the single tensor representation of all spline objects.
 
template<bool memory_optimized = false, size_t... Is, typename... Indices>
auto find_coeff_indices_ (std::index_sequence< Is... >, const std::tuple< Indices... > &indices) const
 Returns the indices of the boundary spline object's coefficients corresponding to the knot indices indices
 
template<size_t... Is, typename... Xi>
auto find_knot_indices_ (std::index_sequence< Is... >, const std::tuple< Xi... > &xi) const
 Returns the knot indicies of boundary spline object's knot spans containing xi
 
template<std::size_t... Is>
autofrom_tensor_ (std::index_sequence< Is... >, const torch::Tensor &tensor)
 Sets the coefficients of all spline objects from a single tensor.
 
template<typename BoundaryCore_ , size_t... Is>
bool isclose_ (std::index_sequence< Is... >, const BoundaryCommon< BoundaryCore_ > &other, typename BoundaryCore::spline_type::value_type rtol, typename BoundaryCore::spline_type::value_type atol) const
 Returns true if both boundary spline objects are close up to the given tolerances.
 
template<typename BoundaryCore_ , size_t... Is>
bool isequal_ (std::index_sequence< Is... >, const BoundaryCommon< BoundaryCore_ > &other) const
 Returns true if both boundary spline objects are the same.
 
template<size_t... Is>
torch::serialize::InputArchive & read_ (std::index_sequence< Is... >, torch::serialize::InputArchive &archive, const std::string &key="boundary")
 Loads the function space object from a torch::serialize::InputArchive object.
 
template<size_t... Is>
autouniform_refine_ (std::index_sequence< Is... >, int numRefine=1, int dim=-1)
 Returns the boundary spline object with uniformly refined knot and coefficient vectors.
 
template<size_t... Is>
torch::serialize::OutputArchive & write_ (std::index_sequence< Is... >, torch::serialize::OutputArchive &archive, const std::string &key="boundary") const
 Writes the boundary spline object into a torch::serialize::OutputArchive object.
 

Detailed Description

template<typename BoundaryCore>
class iganet::BoundaryCommon< BoundaryCore >

Boundary (common high-level functionality)

Member Function Documentation

◆ as_tensor()

template<typename BoundaryCore >
torch::Tensor iganet::BoundaryCommon< BoundaryCore >::as_tensor ( ) const
inline

Returns all coefficients of all spline objects as a single tensor.

Returns
Tensor of coefficients

◆ as_tensor_()

template<typename BoundaryCore >
template<std::size_t... Is>
torch::Tensor iganet::BoundaryCommon< BoundaryCore >::as_tensor_ ( std::index_sequence< Is... >  ) const
inlineprivate

Returns all coefficients of all spline objects as a single tensor.

Returns
Tensor of coefficients

◆ as_tensor_size()

template<typename BoundaryCore >
int64_t iganet::BoundaryCommon< BoundaryCore >::as_tensor_size ( ) const
inline

Returns the size of the single tensor representation of all spline objects.

Returns
Size of the tensor

◆ as_tensor_size_()

template<typename BoundaryCore >
template<std::size_t... Is>
int64_t iganet::BoundaryCommon< BoundaryCore >::as_tensor_size_ ( std::index_sequence< Is... >  ) const
inlineprivate

Returns the size of the single tensor representation of all spline objects.

Returns
Size of the tensor

◆ clone()

Returns a clone of the boundary object.

◆ device()

template<typename BoundaryCore >
auto iganet::BoundaryCommon< BoundaryCore >::device ( ) const
inlinenoexcept

Auto-generated functions.

Returns the device property of all splines

◆ device_index()

template<typename BoundaryCore >
auto iganet::BoundaryCommon< BoundaryCore >::device_index ( ) const
inlinenoexcept

Returns the device_index property of all splines.

◆ dtype()

template<typename BoundaryCore >
auto iganet::BoundaryCommon< BoundaryCore >::dtype ( ) const
inlinenoexcept

Returns the dtype property of all splines.

◆ eval() [1/3]

template<typename BoundaryCore >
template<deriv deriv = deriv::func, bool memory_optimized = false, typename... Xi>
auto iganet::BoundaryCommon< BoundaryCore >::eval ( const std::tuple< Xi... > &  xi) const
inline

Returns the values of the spline objects in the points xi

◆ eval() [2/3]

template<typename BoundaryCore >
template<deriv deriv = deriv::func, bool memory_optimized = false, typename... Xi, typename... Indices>
auto iganet::BoundaryCommon< BoundaryCore >::eval ( const std::tuple< Xi... > &  xi,
const std::tuple< Indices... > &  indices 
) const
inline

Returns the values of the spline objects in the points xi

◆ eval() [3/3]

template<typename BoundaryCore >
template<deriv deriv = deriv::func, bool memory_optimized = false, typename... Xi, typename... Indices, typename... Coeff_Indices>
auto iganet::BoundaryCommon< BoundaryCore >::eval ( const std::tuple< Xi... > &  xi,
const std::tuple< Indices... > &  indices,
const std::tuple< Coeff_Indices... > &  coeff_indices 
) const
inline

Returns the values of the spline objects in the points xi

◆ eval_() [1/3]

template<typename BoundaryCore >
template<deriv deriv = deriv::func, bool memory_optimized = false, size_t... Is, typename... Xi>
auto iganet::BoundaryCommon< BoundaryCore >::eval_ ( std::index_sequence< Is... >  ,
const std::tuple< Xi... > &  xi 
) const
inlineprivate

Returns the values of the boundary spline objects in the points xi

◆ eval_() [2/3]

template<typename BoundaryCore >
template<deriv deriv = deriv::func, bool memory_optimized = false, size_t... Is, typename... Xi, typename... Indices>
auto iganet::BoundaryCommon< BoundaryCore >::eval_ ( std::index_sequence< Is... >  ,
const std::tuple< Xi... > &  xi,
const std::tuple< Indices... > &  indices 
) const
inlineprivate

Returns the values of the boundary spline objects in the points xi

◆ eval_() [3/3]

template<typename BoundaryCore >
template<deriv deriv = deriv::func, bool memory_optimized = false, size_t... Is, typename... Xi, typename... Indices, typename... Coeff_Indices>
auto iganet::BoundaryCommon< BoundaryCore >::eval_ ( std::index_sequence< Is... >  ,
const std::tuple< Xi... > &  xi,
const std::tuple< Indices... > &  indices,
const std::tuple< Coeff_Indices... > &  coeff_indices 
) const
inlineprivate

Returns the values of the boundary spline objects in the points xi

◆ eval_basfunc() [1/2]

template<typename BoundaryCore >
template<deriv deriv = deriv::func, bool memory_optimized = false, typename... Xi>
auto iganet::BoundaryCommon< BoundaryCore >::eval_basfunc ( const std::tuple< Xi... > &  xi) const
inline

Returns the values of the spline objects' basis functions in the points xi

◆ eval_basfunc() [2/2]

template<typename BoundaryCore >
template<deriv deriv = deriv::func, bool memory_optimized = false, typename... Xi, typename... Indices>
auto iganet::BoundaryCommon< BoundaryCore >::eval_basfunc ( const std::tuple< Xi... > &  xi,
const std::tuple< Indices... > &  indices 
) const
inline

Returns the values of the spline objects' basis functions in the points xi

◆ eval_basfunc_() [1/2]

template<typename BoundaryCore >
template<deriv deriv = deriv::func, bool memory_optimized = false, size_t... Is, typename... Xi>
auto iganet::BoundaryCommon< BoundaryCore >::eval_basfunc_ ( std::index_sequence< Is... >  ,
const std::tuple< Xi... > &  xi 
) const
inlineprivate

Returns the values of the boundary spline spline object's basis functions in the points xi

◆ eval_basfunc_() [2/2]

template<typename BoundaryCore >
template<deriv deriv = deriv::func, bool memory_optimized = false, size_t... Is, typename... Xi, typename... Indices>
auto iganet::BoundaryCommon< BoundaryCore >::eval_basfunc_ ( std::index_sequence< Is... >  ,
const std::tuple< Xi... > &  xi,
const std::tuple< Indices... > &  indices 
) const
inlineprivate

Returns the values of the boundary spline spline object's basis functions in the points xi

◆ eval_from_precomputed() [1/2]

template<typename BoundaryCore >
template<typename... Basfunc, typename... Coeff_Indices, typename... Numeval, typename... Sizes>
auto iganet::BoundaryCommon< BoundaryCore >::eval_from_precomputed ( const std::tuple< Basfunc... > &  basfunc,
const std::tuple< Coeff_Indices... > &  coeff_indices,
const std::tuple< Numeval... > &  numeval,
const std::tuple< Sizes... > &  sizes 
) const
inline

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

◆ eval_from_precomputed() [2/2]

template<typename BoundaryCore >
template<typename... Basfunc, typename... Coeff_Indices, typename... Xi>
auto iganet::BoundaryCommon< BoundaryCore >::eval_from_precomputed ( const std::tuple< Basfunc... > &  basfunc,
const std::tuple< Coeff_Indices... > &  coeff_indices,
const std::tuple< Xi... > &  xi 
) const
inline

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

◆ eval_from_precomputed_() [1/2]

template<typename BoundaryCore >
template<size_t... Is, typename... Basfunc, typename... Coeff_Indices, typename... Numeval, typename... Sizes>
auto iganet::BoundaryCommon< BoundaryCore >::eval_from_precomputed_ ( std::index_sequence< Is... >  ,
const std::tuple< Basfunc... > &  basfunc,
const std::tuple< Coeff_Indices... > &  coeff_indices,
const std::tuple< Numeval... > &  numeval,
const std::tuple< Sizes... > &  sizes 
) const
inlineprivate

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

◆ eval_from_precomputed_() [2/2]

template<typename BoundaryCore >
template<size_t... Is, typename... Basfunc, typename... Coeff_Indices, typename... Xi>
auto iganet::BoundaryCommon< BoundaryCore >::eval_from_precomputed_ ( std::index_sequence< Is... >  ,
const std::tuple< Basfunc... > &  basfunc,
const std::tuple< Coeff_Indices... > &  coeff_indices,
const std::tuple< Xi... > &  xi 
) const
inlineprivate

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

◆ find_coeff_indices()

template<typename BoundaryCore >
template<bool memory_optimized = false, typename... Indices>
auto iganet::BoundaryCommon< BoundaryCore >::find_coeff_indices ( const std::tuple< Indices... > &  indices) const
inline

Returns the indices of the spline objects' coefficients corresponding to the knot indices indices

◆ find_coeff_indices_()

template<typename BoundaryCore >
template<bool memory_optimized = false, size_t... Is, typename... Indices>
auto iganet::BoundaryCommon< BoundaryCore >::find_coeff_indices_ ( std::index_sequence< Is... >  ,
const std::tuple< Indices... > &  indices 
) const
inlineprivate

Returns the indices of the boundary spline object's coefficients corresponding to the knot indices indices

◆ find_knot_indices()

template<typename BoundaryCore >
template<typename... Xi>
auto iganet::BoundaryCommon< BoundaryCore >::find_knot_indices ( const std::tuple< Xi... > &  xi) const
inline

Returns the knot indicies of knot spans containing xi

◆ find_knot_indices_()

template<typename BoundaryCore >
template<size_t... Is, typename... Xi>
auto iganet::BoundaryCommon< BoundaryCore >::find_knot_indices_ ( std::index_sequence< Is... >  ,
const std::tuple< Xi... > &  xi 
) const
inlineprivate

Returns the knot indicies of boundary spline object's knot spans containing xi

◆ from_tensor()

template<typename BoundaryCore >
auto & iganet::BoundaryCommon< BoundaryCore >::from_tensor ( const torch::Tensor &  tensor)
inline

Sets the coefficients of all spline objects from a single tensor.

Parameters
[in]tensorTensor from which to extract the coefficients
Returns
Updated spline objects

◆ from_tensor_()

template<typename BoundaryCore >
template<std::size_t... Is>
auto & iganet::BoundaryCommon< BoundaryCore >::from_tensor_ ( std::index_sequence< Is... >  ,
const torch::Tensor &  tensor 
)
inlineprivate

Sets the coefficients of all spline objects from a single tensor.

Parameters
[in]tensorTensor from which to extract the coefficients
Returns
Updates spline object

◆ from_xml() [1/2]

template<typename BoundaryCore >
BoundaryCommon & iganet::BoundaryCommon< BoundaryCore >::from_xml ( const pugi::xml_document &  doc,
int  id = 0,
std::string  label = "",
int  index = -1 
)
inline

Updates the boundary object from XML object.

◆ from_xml() [2/2]

template<typename BoundaryCore >
BoundaryCommon & iganet::BoundaryCommon< BoundaryCore >::from_xml ( const pugi::xml_node &  root,
int  id = 0,
std::string  label = "",
int  index = -1 
)
inline

Updates the boundary object from XML node.

◆ is_nonuniform()

template<typename BoundaryCore >
auto iganet::BoundaryCommon< BoundaryCore >::is_nonuniform ( ) const
inlinenoexcept

Returns true if the B-spline is non-uniform if all splines.

◆ is_sparse()

template<typename BoundaryCore >
auto iganet::BoundaryCommon< BoundaryCore >::is_sparse ( ) const
inlinenoexcept

Returns if the layout is sparse of all splines.

◆ is_uniform()

template<typename BoundaryCore >
auto iganet::BoundaryCommon< BoundaryCore >::is_uniform ( ) const
inlinenoexcept

Returns true if the B-spline is uniform of all splines.

◆ isclose()

template<typename BoundaryCore >
template<typename BoundaryCore_ >
bool iganet::BoundaryCommon< BoundaryCore >::isclose ( const BoundaryCommon< BoundaryCore_ > &  other,
typename BoundaryCore::spline_type::value_type  rtol = typename BoundaryCore::spline_type::value_type{1e-5},
typename BoundaryCore::spline_type::value_type  atol = typename BoundaryCore::spline_type::value_type{1e-8} 
) const
inline

Returns true if both boundary objects are close up to the given tolerances.

◆ isclose_()

template<typename BoundaryCore >
template<typename BoundaryCore_ , size_t... Is>
bool iganet::BoundaryCommon< BoundaryCore >::isclose_ ( std::index_sequence< Is... >  ,
const BoundaryCommon< BoundaryCore_ > &  other,
typename BoundaryCore::spline_type::value_type  rtol,
typename BoundaryCore::spline_type::value_type  atol 
) const
inlineprivate

Returns true if both boundary spline objects are close up to the given tolerances.

◆ isequal_()

template<typename BoundaryCore >
template<typename BoundaryCore_ , size_t... Is>
bool iganet::BoundaryCommon< BoundaryCore >::isequal_ ( std::index_sequence< Is... >  ,
const BoundaryCommon< BoundaryCore_ > &  other 
) const
inlineprivate

Returns true if both boundary spline objects are the same.

◆ layout()

template<typename BoundaryCore >
auto iganet::BoundaryCommon< BoundaryCore >::layout ( ) const
inlinenoexcept

Returns the layout property of all splines.

◆ load()

template<typename BoundaryCore >
void iganet::BoundaryCommon< BoundaryCore >::load ( const std::string &  filename,
const std::string &  key = "boundary" 
)
inline

Loads the boundary spline object from file.

◆ operator!=()

Returns true if both boundary objects are different.

◆ operator==()

Returns true if both boundary objects are the same.

◆ pinned_memory()

template<typename BoundaryCore >
auto iganet::BoundaryCommon< BoundaryCore >::pinned_memory ( ) const
inlinenoexcept

Returns the pinned_memory property of all splines.

◆ read()

template<typename BoundaryCore >
torch::serialize::InputArchive & iganet::BoundaryCommon< BoundaryCore >::read ( torch::serialize::InputArchive &  archive,
const std::string &  key = "boundary" 
)
inline

Loads the boundary spline object from a torch::serialize::InputArchive object.

◆ read_()

template<typename BoundaryCore >
template<size_t... Is>
torch::serialize::InputArchive & iganet::BoundaryCommon< BoundaryCore >::read_ ( std::index_sequence< Is... >  ,
torch::serialize::InputArchive &  archive,
const std::string &  key = "boundary" 
)
inlineprivate

Loads the function space object from a torch::serialize::InputArchive object.

◆ requires_grad()

template<typename BoundaryCore >
auto iganet::BoundaryCommon< BoundaryCore >::requires_grad ( ) const
inlinenoexcept

Returns the requires_grad property of all splines.

◆ save()

template<typename BoundaryCore >
void iganet::BoundaryCommon< BoundaryCore >::save ( const std::string &  filename,
const std::string &  key = "boundary" 
) const
inline

Saves the boundary spline to file.

◆ set_requires_grad()

template<typename BoundaryCore >
BoundaryCommon & iganet::BoundaryCommon< BoundaryCore >::set_requires_grad ( bool  requires_grad)
inline

Sets the boundary object's requires_grad property.

◆ to() [1/3]

template<typename BoundaryCore >
template<typename real_t >
auto iganet::BoundaryCommon< BoundaryCore >::to ( ) const
inline

Returns a copy of the boundary object with real_t type.

◆ to() [2/3]

template<typename BoundaryCore >
template<typename real_t >
auto iganet::BoundaryCommon< BoundaryCore >::to ( Options< real_t >  options) const
inline

Returns a copy of the boundary object with settings from options.

◆ to() [3/3]

template<typename BoundaryCore >
auto iganet::BoundaryCommon< BoundaryCore >::to ( torch::Device  device) const
inline

Returns a copy of the boundary object with settings from device.

◆ to_xml() [1/2]

template<typename BoundaryCore >
pugi::xml_document iganet::BoundaryCommon< BoundaryCore >::to_xml ( int  id = 0,
std::string  label = "",
int  index = -1 
) const
inline

Returns the boundary object as XML object.

◆ to_xml() [2/2]

template<typename BoundaryCore >
pugi::xml_node & iganet::BoundaryCommon< BoundaryCore >::to_xml ( pugi::xml_node &  root,
int  id = 0,
std::string  label = "",
int  index = -1 
) const
inline

Returns the boundary object as XML node.

◆ uniform_refine()

template<typename BoundaryCore >
auto & iganet::BoundaryCommon< BoundaryCore >::uniform_refine ( int  numRefine = 1,
int  dim = -1 
)
inline

Returns the spline objects with uniformly refined knot and coefficient vectors.

◆ uniform_refine_()

template<typename BoundaryCore >
template<size_t... Is>
auto & iganet::BoundaryCommon< BoundaryCore >::uniform_refine_ ( std::index_sequence< Is... >  ,
int  numRefine = 1,
int  dim = -1 
)
inlineprivate

Returns the boundary spline object with uniformly refined knot and coefficient vectors.

◆ write()

template<typename BoundaryCore >
torch::serialize::OutputArchive & iganet::BoundaryCommon< BoundaryCore >::write ( torch::serialize::OutputArchive &  archive,
const std::string &  key = "boundary" 
) const
inline

Writes the boundary spline object into a torch::serialize::OutputArchive object.

◆ write_()

template<typename BoundaryCore >
template<size_t... Is>
torch::serialize::OutputArchive & iganet::BoundaryCommon< BoundaryCore >::write_ ( std::index_sequence< Is... >  ,
torch::serialize::OutputArchive &  archive,
const std::string &  key = "boundary" 
) const
inlineprivate

Writes the boundary spline object into a torch::serialize::OutputArchive object.


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