IgANet
IgANets - Isogeometric Analysis Networks
Loading...
Searching...
No Matches
iganet::detail::FunctionSpace< Spline, Boundary > Class Template Reference

Function space. More...

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

Inheritance diagram for iganet::detail::FunctionSpace< Spline, Boundary >:
iganet::utils::Serializable iganet::utils::FullQualifiedName

Public Types

using boundary_eval_type = typename Boundary::eval_type
 Boundary evaluation type.
 
using boundary_type = Boundary
 Boundary type.
 
using eval_type = utils::TensorArray< Spline::parDim()>
 Spline evaluation type.
 
using spline_type = Spline
 Spline type.
 
using value_type = typename Spline::value_type
 Value type.
 

Public Member Functions

 FunctionSpace ()=default
 Default constructor.
 
 FunctionSpace (const FunctionSpace &)=default
 Copy constructor.
 
 FunctionSpace (FunctionSpace &&)=default
 Move constructor.
 
virtual torch::Tensor as_tensor () const noexcept
 Returns a single-tensor representation of the function space object.
 
virtual int64_t as_tensor_size () const noexcept
 Returns the size of the single-tensor representation of the function space object.
 
template<short_t s = 0>
constexpr const boundary_typeboundary () const noexcept
 Returns a constant reference to the \(s\)-th boundary object.
 
template<short_t s = 0>
constexpr boundary_typeboundary () noexcept
 Returns a non-constant reference to the \(s\)-th boundary object object.
 
virtual torch::Tensor boundary_as_tensor () const noexcept
 Returns a single-tensor representation of the boundary.
 
virtual int64_t boundary_as_tensor_size () const noexcept
 Returns the size of the single-tensor representation of the boundary.
 
virtual FunctionSpaceboundary_from_full_tensor (const torch::Tensor &coeffs) noexcept
 Sets the boundary from a single-tensor representation.
 
virtual FunctionSpaceboundary_from_tensor (const torch::Tensor &coeffs) noexcept
 Sets the boundary from a single-tensor representation of the boundary only.
 
constexpr FunctionSpace clone () const noexcept
 Returns a clone of the function space.
 
template<short_t... s>
constexpr auto clone () const noexcept
 Returns a subset of the tuple of function spaces.
 
template<functionspace comp = functionspace::interior, deriv deriv = deriv::func, bool memory_optimized = false, typename Arg , typename... Args>
auto eval (const Arg &arg, const Args &...args) const
 Returns the values of the spline object in the points xi
 
template<functionspace comp = functionspace::interior, deriv deriv = deriv::func, bool memory_optimized = false, typename... Args>
auto eval_basfunc (const Args &...args) const
 Returns the values of the spline objects' basis functions in the points xi
 
template<functionspace comp = functionspace::interior, typename... Args>
auto eval_from_precomputed (const Args &...args) const
 Returns the value of the spline object from precomputed basis function.
 
template<functionspace comp = functionspace::interior, bool memory_optimized = false, typename Knot_Indices >
auto find_coeff_indices (const Knot_Indices &knot_indices) const
 Returns the indices of the spline objects' coefficients corresponding to the knot indices indices
 
template<functionspace comp = functionspace::interior, typename Xi >
auto find_knot_indices (const Xi &xi) const
 Returns the knot indicies of knot spans containing xi
 
FunctionSpacefrom_tensor (const torch::Tensor &coeffs) noexcept
 Sets the function space object from a single-tensor representation.
 
FunctionSpacefrom_xml (const pugi::xml_document &doc, int id=0, std::string label="")
 Updates the function space object from XML object.
 
FunctionSpacefrom_xml (const pugi::xml_node &root, int id=0, std::string label="")
 Updates the function space object from XML node.
 
virtual void pretty_print (std::ostream &os=Log(log::info)) const noexcept override
 Returns a string representation of the function space object.
 
torch::serialize::InputArchive & read (torch::serialize::InputArchive &archive, const std::string &key="functionspace")
 Loads the function space object from a torch::serialize::InputArchive object.
 
auto rotate (std::array< value_type, 3 > angle)
 Rotates the function space object by three angles in 3d.
 
auto rotate (value_type angle)
 Rotates the function space object by an angle in 2d.
 
template<size_t N>
auto scale (std::array< value_type, N > v)
 Scales the function space object by a vector.
 
auto scale (value_type s, int dim=-1)
 Scales the function space object by a scalar.
 
template<short_t s = 0>
constexpr const spline_typespace () const noexcept
 Returns a constant reference to the \(s\)-th function space.
 
template<short_t s = 0>
constexpr spline_typespace () noexcept
 Returns a non-constant reference to the \(s\)-th function space.
 
virtual torch::Tensor spaces_as_tensor () const noexcept
 Returns a single-tensor representation of the space.
 
virtual int64_t spaces_as_tensor_size () const noexcept
 Returns the size of the single-tensor representation of the space.
 
virtual FunctionSpacespaces_from_tensor (const torch::Tensor &coeffs) noexcept
 Sets the space from a single-tensor representation.
 
template<typename real_t >
auto to () const
 Returns a copy of the function space object with real_t type.
 
template<typename real_t >
auto to (Options< real_t > options) const
 Returns a copy of the function space object with settings from options.
 
auto to (torch::Device device) const
 Returns a copy of the function space object with settings from device.
 
nlohmann::json to_json () const override
 Serialization to JSON.
 
pugi::xml_document to_xml (int id=0, std::string label="") const
 Returns the function space object as XML object.
 
pugi::xml_node & to_xml (pugi::xml_node &root, int id=0, std::string label="") const
 Returns the function space object as XML node.
 
FunctionSpacetransform (const std::function< std::array< typename Spline::value_type, Spline::geoDim()>(const std::array< typename Spline::value_type, Spline::parDim()> &)> transformation)
 Transforms the coefficients based on the given mapping.
 
template<size_t N>
auto translate (std::array< value_type, N > v)
 Translates the function space object by a vector.
 
autouniform_refine (int numRefine=1, int dimRefine=-1)
 Returns the spline objects with uniformly refined knot and coefficient vectors.
 
torch::serialize::OutputArchive & write (torch::serialize::OutputArchive &archive, const std::string &key="functionspace") const
 Writes the function space object into a torch::serialize::OutputArchive object.
 

Static Public Member Functions

static constexpr short_t nboundaries () noexcept
 Returns the number of boundaries.
 
static constexpr short_t nspaces () noexcept
 Returns the number of function spaces.
 

Protected Attributes

boundary_type boundary_
 Boundary.
 
spline_type spline_
 Spline.
 

Private Member Functions

template<functionspace comp = functionspace::interior, bool memory_optimized = false, std::size_t... Is, typename Knot_Indices >
auto find_coeff_indices_ (std::index_sequence< Is... >, const Knot_Indices &knot_indices) const
 Returns the indices of the spline objects' coefficients corresponding to the knot indices indices
 
template<functionspace comp = functionspace::interior, std::size_t... Is, typename Xi >
auto find_knot_indices_ (std::index_sequence< Is... >, const Xi &xi) const
 Returns the knot indicies of knot spans containing xi
 
- Private Member Functions inherited from iganet::utils::FullQualifiedName
virtual const std::string & name () const noexcept
 Returns the full qualified name of the object.
 

Additional Inherited Members

- Private Attributes inherited from iganet::utils::FullQualifiedName
at::optional< std::string > name_
 String storing the full qualified name of the object.
 

Detailed Description

template<typename Spline, typename Boundary>
class iganet::detail::FunctionSpace< Spline, Boundary >

Function space.

Note
This class is not meant for direct use in applications. Instead use S, TH, NE, or RT.

Member Typedef Documentation

◆ boundary_eval_type

template<typename Spline , typename Boundary >
using iganet::detail::FunctionSpace< Spline, Boundary >::boundary_eval_type = typename Boundary::eval_type

Boundary evaluation type.

◆ boundary_type

template<typename Spline , typename Boundary >
using iganet::detail::FunctionSpace< Spline, Boundary >::boundary_type = Boundary

Boundary type.

◆ eval_type

template<typename Spline , typename Boundary >
using iganet::detail::FunctionSpace< Spline, Boundary >::eval_type = utils::TensorArray<Spline::parDim()>

Spline evaluation type.

◆ spline_type

template<typename Spline , typename Boundary >
using iganet::detail::FunctionSpace< Spline, Boundary >::spline_type = Spline

Spline type.

◆ value_type

template<typename Spline , typename Boundary >
using iganet::detail::FunctionSpace< Spline, Boundary >::value_type = typename Spline::value_type

Value type.

Constructor & Destructor Documentation

◆ FunctionSpace() [1/7]

template<typename Spline , typename Boundary >
iganet::detail::FunctionSpace< Spline, Boundary >::FunctionSpace ( )
default

Default constructor.

◆ FunctionSpace() [2/7]

template<typename Spline , typename Boundary >
iganet::detail::FunctionSpace< Spline, Boundary >::FunctionSpace ( const FunctionSpace< Spline, Boundary > &  )
default

Copy constructor.

◆ FunctionSpace() [3/7]

template<typename Spline , typename Boundary >
iganet::detail::FunctionSpace< Spline, Boundary >::FunctionSpace ( FunctionSpace< Spline, Boundary > &&  )
default

Move constructor.

◆ FunctionSpace() [4/7]

template<typename Spline , typename Boundary >
iganet::detail::FunctionSpace< Spline, Boundary >::FunctionSpace ( const std::array< int64_t, Spline::parDim()> &  ncoeffs,
enum init  init = init::greville,
Options< value_type options = iganet::Options<value_type>{} 
)
inline

Constructor.

◆ FunctionSpace() [5/7]

template<typename Spline , typename Boundary >
iganet::detail::FunctionSpace< Spline, Boundary >::FunctionSpace ( std::array< std::vector< value_type >, Spline::parDim()>  kv,
enum init  init = init::greville,
Options< value_type options = iganet::Options<value_type>{} 
)
inline

Constructor.

◆ FunctionSpace() [6/7]

template<typename Spline , typename Boundary >
iganet::detail::FunctionSpace< Spline, Boundary >::FunctionSpace ( const Spline &  spline)
inlineexplicit

Constructor.

◆ FunctionSpace() [7/7]

template<typename Spline , typename Boundary >
iganet::detail::FunctionSpace< Spline, Boundary >::FunctionSpace ( Spline &&  spline)
inlineexplicit

Constructor.

Member Function Documentation

◆ as_tensor()

template<typename Spline , typename Boundary >
virtual torch::Tensor iganet::detail::FunctionSpace< Spline, Boundary >::as_tensor ( ) const
inlinevirtualnoexcept

Returns a single-tensor representation of the function space object.

Note
The default implementation behaves identical to spaces_as_tensor() but can be overridden in a derived class

◆ as_tensor_size()

template<typename Spline , typename Boundary >
virtual int64_t iganet::detail::FunctionSpace< Spline, Boundary >::as_tensor_size ( ) const
inlinevirtualnoexcept

Returns the size of the single-tensor representation of the function space object.

Note
The default implementation behaves identical to spaces_as_tensor_size() but can be overridden in a derived class

◆ boundary() [1/2]

template<typename Spline , typename Boundary >
template<short_t s = 0>
constexpr const boundary_type & iganet::detail::FunctionSpace< Spline, Boundary >::boundary ( ) const
inlineconstexprnoexcept

Returns a constant reference to the \(s\)-th boundary object.

◆ boundary() [2/2]

template<typename Spline , typename Boundary >
template<short_t s = 0>
constexpr boundary_type & iganet::detail::FunctionSpace< Spline, Boundary >::boundary ( )
inlineconstexprnoexcept

Returns a non-constant reference to the \(s\)-th boundary object object.

◆ boundary_as_tensor()

template<typename Spline , typename Boundary >
virtual torch::Tensor iganet::detail::FunctionSpace< Spline, Boundary >::boundary_as_tensor ( ) const
inlinevirtualnoexcept

Returns a single-tensor representation of the boundary.

◆ boundary_as_tensor_size()

template<typename Spline , typename Boundary >
virtual int64_t iganet::detail::FunctionSpace< Spline, Boundary >::boundary_as_tensor_size ( ) const
inlinevirtualnoexcept

Returns the size of the single-tensor representation of the boundary.

◆ boundary_from_full_tensor()

template<typename Spline , typename Boundary >
virtual FunctionSpace & iganet::detail::FunctionSpace< Spline, Boundary >::boundary_from_full_tensor ( const torch::Tensor &  coeffs)
inlinevirtualnoexcept

Sets the boundary from a single-tensor representation.

◆ boundary_from_tensor()

template<typename Spline , typename Boundary >
virtual FunctionSpace & iganet::detail::FunctionSpace< Spline, Boundary >::boundary_from_tensor ( const torch::Tensor &  coeffs)
inlinevirtualnoexcept

Sets the boundary from a single-tensor representation of the boundary only.

◆ clone() [1/2]

template<typename Spline , typename Boundary >
constexpr FunctionSpace iganet::detail::FunctionSpace< Spline, Boundary >::clone ( ) const
inlineconstexprnoexcept

Returns a clone of the function space.

◆ clone() [2/2]

template<typename Spline , typename Boundary >
template<short_t... s>
constexpr auto iganet::detail::FunctionSpace< Spline, Boundary >::clone ( ) const
inlineconstexprnoexcept

Returns a subset of the tuple of function spaces.

◆ eval()

template<typename Spline , typename Boundary >
template<functionspace comp = functionspace::interior, deriv deriv = deriv::func, bool memory_optimized = false, typename Arg , typename... Args>
auto iganet::detail::FunctionSpace< Spline, Boundary >::eval ( const Arg arg,
const Args &...  args 
) const
inline

Returns the values of the spline object in the points xi

◆ eval_() [1/3]

template<typename Spline , typename Boundary >
template<functionspace comp = functionspace::interior, deriv deriv = deriv::func, bool memory_optimized = false, std::size_t... Is, typename... Xi>
auto iganet::detail::FunctionSpace< Spline, Boundary >::eval_ ( std::index_sequence< Is... >  ,
const std::tuple< Xi... > &  xi 
) const
inlineprivate

Returns the values of the spline object in the points xi

◆ eval_() [2/3]

template<typename Spline , typename Boundary >
template<functionspace comp = functionspace::interior, deriv deriv = deriv::func, bool memory_optimized = false, std::size_t... Is, typename... Xi, typename... Knot_Indices>
auto iganet::detail::FunctionSpace< Spline, Boundary >::eval_ ( std::index_sequence< Is... >  ,
const std::tuple< Xi... > &  xi,
const std::tuple< Knot_Indices... > &  knot_indices 
) const
inlineprivate

Returns the values of the spline object in the points xi

◆ eval_() [3/3]

template<typename Spline , typename Boundary >
template<functionspace comp = functionspace::interior, deriv deriv = deriv::func, bool memory_optimized = false, std::size_t... Is, typename... Xi, typename... Knot_Indices, typename... Coeff_Indices>
auto iganet::detail::FunctionSpace< Spline, Boundary >::eval_ ( std::index_sequence< Is... >  ,
const std::tuple< Xi... > &  xi,
const std::tuple< Knot_Indices... > &  knot_indices,
const std::tuple< Coeff_Indices... > &  coeff_indices 
) const
inlineprivate

Returns the values of the spline object in the points xi

◆ eval_basfunc()

template<typename Spline , typename Boundary >
template<functionspace comp = functionspace::interior, deriv deriv = deriv::func, bool memory_optimized = false, typename... Args>
auto iganet::detail::FunctionSpace< Spline, Boundary >::eval_basfunc ( const Args &...  args) const
inline

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

◆ eval_from_precomputed()

template<typename Spline , typename Boundary >
template<functionspace comp = functionspace::interior, typename... Args>
auto iganet::detail::FunctionSpace< Spline, Boundary >::eval_from_precomputed ( const Args &...  args) const
inline

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

◆ find_coeff_indices()

template<typename Spline , typename Boundary >
template<functionspace comp = functionspace::interior, bool memory_optimized = false, typename Knot_Indices >
auto iganet::detail::FunctionSpace< Spline, Boundary >::find_coeff_indices ( const Knot_Indices knot_indices) const
inline

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

◆ find_coeff_indices_()

template<typename Spline , typename Boundary >
template<functionspace comp = functionspace::interior, bool memory_optimized = false, std::size_t... Is, typename Knot_Indices >
auto iganet::detail::FunctionSpace< Spline, Boundary >::find_coeff_indices_ ( std::index_sequence< Is... >  ,
const Knot_Indices knot_indices 
) const
inlineprivate

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

◆ find_knot_indices()

template<typename Spline , typename Boundary >
template<functionspace comp = functionspace::interior, typename Xi >
auto iganet::detail::FunctionSpace< Spline, Boundary >::find_knot_indices ( const Xi xi) const
inline

Returns the knot indicies of knot spans containing xi

◆ find_knot_indices_()

template<typename Spline , typename Boundary >
template<functionspace comp = functionspace::interior, std::size_t... Is, typename Xi >
auto iganet::detail::FunctionSpace< Spline, Boundary >::find_knot_indices_ ( std::index_sequence< Is... >  ,
const Xi xi 
) const
inlineprivate

Returns the knot indicies of knot spans containing xi

◆ from_tensor()

template<typename Spline , typename Boundary >
FunctionSpace & iganet::detail::FunctionSpace< Spline, Boundary >::from_tensor ( const torch::Tensor &  coeffs)
inlinenoexcept

Sets the function space object from a single-tensor representation.

◆ from_xml() [1/2]

template<typename Spline , typename Boundary >
FunctionSpace & iganet::detail::FunctionSpace< Spline, Boundary >::from_xml ( const pugi::xml_document &  doc,
int  id = 0,
std::string  label = "" 
)
inline

Updates the function space object from XML object.

◆ from_xml() [2/2]

template<typename Spline , typename Boundary >
FunctionSpace & iganet::detail::FunctionSpace< Spline, Boundary >::from_xml ( const pugi::xml_node &  root,
int  id = 0,
std::string  label = "" 
)
inline

Updates the function space object from XML node.

◆ nboundaries()

template<typename Spline , typename Boundary >
static constexpr short_t iganet::detail::FunctionSpace< Spline, Boundary >::nboundaries ( )
inlinestaticconstexprnoexcept

Returns the number of boundaries.

◆ nspaces()

template<typename Spline , typename Boundary >
static constexpr short_t iganet::detail::FunctionSpace< Spline, Boundary >::nspaces ( )
inlinestaticconstexprnoexcept

Returns the number of function spaces.

◆ pretty_print()

template<typename Spline , typename Boundary >
virtual void iganet::detail::FunctionSpace< Spline, Boundary >::pretty_print ( std::ostream &  os = Log(log::info)) const
inlineoverridevirtualnoexcept

Returns a string representation of the function space object.

Implements iganet::utils::Serializable.

◆ read()

template<typename Spline , typename Boundary >
torch::serialize::InputArchive & iganet::detail::FunctionSpace< Spline, Boundary >::read ( torch::serialize::InputArchive &  archive,
const std::string &  key = "functionspace" 
)
inline

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

◆ rotate() [1/2]

template<typename Spline , typename Boundary >
auto iganet::detail::FunctionSpace< Spline, Boundary >::rotate ( std::array< value_type, 3 >  angle)
inline

Rotates the function space object by three angles in 3d.

◆ rotate() [2/2]

template<typename Spline , typename Boundary >
auto iganet::detail::FunctionSpace< Spline, Boundary >::rotate ( value_type  angle)
inline

Rotates the function space object by an angle in 2d.

◆ scale() [1/2]

template<typename Spline , typename Boundary >
template<size_t N>
auto iganet::detail::FunctionSpace< Spline, Boundary >::scale ( std::array< value_type, N v)
inline

Scales the function space object by a vector.

◆ scale() [2/2]

template<typename Spline , typename Boundary >
auto iganet::detail::FunctionSpace< Spline, Boundary >::scale ( value_type  s,
int  dim = -1 
)
inline

Scales the function space object by a scalar.

◆ space() [1/2]

template<typename Spline , typename Boundary >
template<short_t s = 0>
constexpr const spline_type & iganet::detail::FunctionSpace< Spline, Boundary >::space ( ) const
inlineconstexprnoexcept

Returns a constant reference to the \(s\)-th function space.

◆ space() [2/2]

template<typename Spline , typename Boundary >
template<short_t s = 0>
constexpr spline_type & iganet::detail::FunctionSpace< Spline, Boundary >::space ( )
inlineconstexprnoexcept

Returns a non-constant reference to the \(s\)-th function space.

◆ spaces_as_tensor()

template<typename Spline , typename Boundary >
virtual torch::Tensor iganet::detail::FunctionSpace< Spline, Boundary >::spaces_as_tensor ( ) const
inlinevirtualnoexcept

Returns a single-tensor representation of the space.

◆ spaces_as_tensor_size()

template<typename Spline , typename Boundary >
virtual int64_t iganet::detail::FunctionSpace< Spline, Boundary >::spaces_as_tensor_size ( ) const
inlinevirtualnoexcept

Returns the size of the single-tensor representation of the space.

◆ spaces_from_tensor()

template<typename Spline , typename Boundary >
virtual FunctionSpace & iganet::detail::FunctionSpace< Spline, Boundary >::spaces_from_tensor ( const torch::Tensor &  coeffs)
inlinevirtualnoexcept

Sets the space from a single-tensor representation.

◆ to() [1/3]

template<typename Spline , typename Boundary >
template<typename real_t >
auto iganet::detail::FunctionSpace< Spline, Boundary >::to ( ) const
inline

Returns a copy of the function space object with real_t type.

◆ to() [2/3]

template<typename Spline , typename Boundary >
template<typename real_t >
auto iganet::detail::FunctionSpace< Spline, Boundary >::to ( Options< real_t >  options) const
inline

Returns a copy of the function space object with settings from options.

◆ to() [3/3]

template<typename Spline , typename Boundary >
auto iganet::detail::FunctionSpace< Spline, Boundary >::to ( torch::Device  device) const
inline

Returns a copy of the function space object with settings from device.

◆ to_json()

template<typename Spline , typename Boundary >
nlohmann::json iganet::detail::FunctionSpace< Spline, Boundary >::to_json ( ) const
inlineoverridevirtual

Serialization to JSON.

Implements iganet::utils::Serializable.

◆ to_xml() [1/2]

template<typename Spline , typename Boundary >
pugi::xml_document iganet::detail::FunctionSpace< Spline, Boundary >::to_xml ( int  id = 0,
std::string  label = "" 
) const
inline

Returns the function space object as XML object.

◆ to_xml() [2/2]

template<typename Spline , typename Boundary >
pugi::xml_node & iganet::detail::FunctionSpace< Spline, Boundary >::to_xml ( pugi::xml_node &  root,
int  id = 0,
std::string  label = "" 
) const
inline

Returns the function space object as XML node.

◆ transform()

template<typename Spline , typename Boundary >
FunctionSpace & iganet::detail::FunctionSpace< Spline, Boundary >::transform ( const std::function< std::array< typename Spline::value_type, Spline::geoDim()>(const std::array< typename Spline::value_type, Spline::parDim()> &)>  transformation)
inline

Transforms the coefficients based on the given mapping.

◆ translate()

template<typename Spline , typename Boundary >
template<size_t N>
auto iganet::detail::FunctionSpace< Spline, Boundary >::translate ( std::array< value_type, N v)
inline

Translates the function space object by a vector.

◆ uniform_refine()

template<typename Spline , typename Boundary >
auto & iganet::detail::FunctionSpace< Spline, Boundary >::uniform_refine ( int  numRefine = 1,
int  dimRefine = -1 
)
inline

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

◆ write()

template<typename Spline , typename Boundary >
torch::serialize::OutputArchive & iganet::detail::FunctionSpace< Spline, Boundary >::write ( torch::serialize::OutputArchive &  archive,
const std::string &  key = "functionspace" 
) const
inline

Writes the function space object into a torch::serialize::OutputArchive object.

Member Data Documentation

◆ boundary_

template<typename Spline , typename Boundary >
boundary_type iganet::detail::FunctionSpace< Spline, Boundary >::boundary_
protected

Boundary.

◆ spline_

template<typename Spline , typename Boundary >
spline_type iganet::detail::FunctionSpace< Spline, Boundary >::spline_
protected

Spline.


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