Loading...
Searching...
No Matches
Dune::Functions::BSplinePreBasis< GV > Class Template Reference
Function space bases » Function space basis implementations

Pre-basis for B-spline basis. More...

`#include <dune/functions/functionspacebases/bsplinebasis.hh>`

Inheritance diagram for Dune::Functions::BSplinePreBasis< GV >:

## Public Types

using | GridView = GV
| The grid view that the FE space is defined on.
using | size_type = std::size_t
using | Node = BSplineNode<GV>
using | R = double

## Public Member Functions

| BSplinePreBasis (const GridView &gridView, const std::vector< double > &knotVector, unsigned int order, bool makeOpen=true)
| Construct a B-spline basis for a given grid view and set of knot vectors.
| BSplinePreBasis (const GridView &gridView, const FieldVector< double, dim > &lowerLeft, const FieldVector< double, dim > &upperRight, const std::array< unsigned int, dim > &elements, unsigned int order, bool makeOpen=true)
| Construct a B-spline basis for a given grid view with uniform knot vectors.
void | initializeIndices ()
| Initialize the global indices.
const GridView & | gridView () const
| Obtain the grid view that the basis is defined on.
void | update (const GridView &gv)
| Update the stored grid view, to be called if the grid has changed.
Node | makeNode () const
| Create tree node.
size_type | maxNodeSize () const
| Get the maximal number of DOFs associated to node for any element.
template<typename It>
It | indices (const Node &node, It it) const
| Maps from subtree index set [0..size-1] to a globally unique multi index in global basis.
unsigned int | dimension () const
| Total number of B-spline basis functions.
unsigned int | size (size_t d) const
| Number of shape functions in one direction.
void | evaluateFunction (const FieldVector< typename GV::ctype, dim > &in, std::vector< FieldVector< R, 1 > > &out, const std::array< unsigned, dim > &currentKnotSpan) const
| Evaluate all B-spline basis functions at a given point.
void | evaluateJacobian (const FieldVector< typename GV::ctype, dim > &in, std::vector< FieldMatrix< R, 1, dim > > &out, const std::array< unsigned, dim > &currentKnotSpan) const
| Evaluate Jacobian of all B-spline basis functions.
template<size_type k>
void | evaluate (const typename std::array< int, k > &directions, const FieldVector< typename GV::ctype, dim > &in, std::vector< FieldVector< R, 1 > > &out, const std::array< unsigned, dim > &currentKnotSpan) const
| Evaluate Derivatives of all B-spline basis functions.
size_type | size (const SizePrefix &prefix) const
| Return number of possible values for next position in multi index.
size_type | size () const
| Get the total dimension of the space spanned by this basis.
auto | containerDescriptor () const
| Return a flat container-descriptor.

## Static Public Member Functions

static std::array< unsigned int, dim > | getIJK (typename GridView::IndexSet::IndexType idx, std::array< unsigned int, dim > elements)
| Compute integer element coordinates from the element index.
static void | evaluateFunction (const typename GV::ctype &in, std::vector< R > &out, const std::vector< R > &knotVector, unsigned int order, unsigned int currentKnotSpan)
| Evaluate all one-dimensional B-spline functions for a given coordinate direction.
static void | evaluateFunctionFull (const typename GV::ctype &in, DynamicMatrix< R > &out, const std::vector< R > &knotVector, unsigned int order, unsigned int currentKnotSpan)
| Evaluate all one-dimensional B-spline functions for a given coordinate direction.
static void | evaluateAll (const typename GV::ctype &in, std::vector< R > &out, bool evaluateJacobian, std::vector< R > &outJac, bool evaluateHessian, std::vector< R > &outHess, const std::vector< R > &knotVector, unsigned int order, unsigned int currentKnotSpan)
| Evaluate the second derivatives of all one-dimensional B-spline functions for a given coordinate direction.

## Public Attributes

std::array< unsigned int, dim > | order_
| Order of the B-spline for each space dimension.
std::array< std::vector< double >, dim > | knotVectors_
| The knot vectors, one for each space dimension.
std::array< unsigned, dim > | elements_
| Number of grid elements in the different coordinate directions.
GridView | gridView_

## Static Public Attributes

static constexpr size_type | maxMultiIndexSize
| Maximal length of global multi-indices.
static constexpr size_type | minMultiIndexSize
| Minimal length of global multi-indices.
static constexpr size_type | multiIndexBufferSize
| Size required temporarily when constructing global multi-indices.

## Detailed Description

template<typename GV>
class Dune::Functions::BSplinePreBasis< GV >

Pre-basis for B-spline basis.

Template Parameters

  GV | The GridView that the space is defined on

The BSplinePreBasis can be used to embed a BSplineBasis in a larger basis for the construction of product spaces.

## Member Typedef Documentation

## GridView

template<typename GV>

using Dune::Functions::BSplinePreBasis< GV >::GridView = GV

The grid view that the FE space is defined on.

## Node

template<typename GV>

using Dune::Functions::BSplinePreBasis< GV >::Node = BSplineNode<GV>

## R

template<typename GV>

using Dune::Functions::BSplinePreBasis< GV >::R = double

## size_type

template<typename GV>

using Dune::Functions::BSplinePreBasis< GV >::size_type = std::size_t

## Constructor & Destructor Documentation

## BSplinePreBasis() [1/2]

template<typename GV>

Dune::Functions::BSplinePreBasis< GV >::BSplinePreBasis | ( | const GridView & | gridView,
|  | const std::vector< double > & | knotVector,
|  | unsigned int | order,
|  | bool | makeOpen = true )

inline

Construct a B-spline basis for a given grid view and set of knot vectors.

The grid must match the knot vectors, i.e.:

- The grid must be structured and Cartesian, and have cube elements only
- The number of elements in each direction must match the number of knot spans in that direction
- In fact, the element spacing in any direction must match the knot spacing in that direction (disregarding knot multiplicities)
- When ordering the grid elements according to their indices, the resulting order must be lexicographical, with the x-index increasing fastest.

Unfortunately, not all of these conditions can be checked for automatically.

Parameters

  gridView | The grid we are defining the basis on.
  knotVector | A single knot vector, which will be used for all coordinate directions
  order | B-spline order, will be used for all coordinate directions
  makeOpen | If this is true, then knots are prepended and appended to the knot vector to make the knot vector 'open'. i.e., start and end with 'order+1' identical knots. Basis functions from such knot vectors are interpolatory at the end of the parameter interval.

## BSplinePreBasis() [2/2]

template<typename GV>

Dune::Functions::BSplinePreBasis< GV >::BSplinePreBasis | ( | const GridView & | gridView,
|  | const FieldVector< double, dim > & | lowerLeft,
|  | const FieldVector< double, dim > & | upperRight,
|  | const std::array< unsigned int, dim > & | elements,
|  | unsigned int | order,
|  | bool | makeOpen = true )

inline

Construct a B-spline basis for a given grid view with uniform knot vectors.

The grid must match the knot vectors, i.e.:

- The grid must be structured and Cartesian, and have cube elements only
- Bounding box and number of elements of the grid must match the corresponding arguments given to this constructor.
- The element spacing must be uniform
- When ordering the grid elements according to their indices, the resulting order must be lexicographical, with the x-index increasing fastest.

Unfortunately, not all of these conditions can be checked for automatically.

Parameters

  gridView | The grid we are defining the basis on
  lowerLeft | Lower left corner of the structured grid
  upperRight | Upper right corner of the structured grid
  elements | Number of elements in each coordinate direction
  order | B-spline order, will be used for all coordinate directions
  makeOpen | If this is true, then knots are prepended and appended to the knot vector to make the knot vector 'open'. i.e., start and end with 'order+1' identical knots. Basis functions from such knot vectors are interpolatory at the end of the parameter interval.

## Member Function Documentation

## containerDescriptor()

auto Dune::Functions::LeafPreBasisMixin< BSplinePreBasis< GV > >::containerDescriptor | ( |  | ) | const

inline inherited

Return a flat container-descriptor.

## dimension()

template<typename GV>

unsigned int Dune::Functions::BSplinePreBasis< GV >::dimension | ( |  | ) | const

inline

Total number of B-spline basis functions.

## evaluate()

template<typename GV>
template<size_type k>

void Dune::Functions::BSplinePreBasis< GV >::evaluate | ( | const typename std::array< int, k > & | directions,
|  | const FieldVector< typename GV::ctype, dim > & | in,
|  | std::vector< FieldVector< R, 1 > > & | out,
|  | const std::array< unsigned, dim > & | currentKnotSpan ) const

inline

Evaluate Derivatives of all B-spline basis functions.

## evaluateAll()

template<typename GV>

void Dune::Functions::BSplinePreBasis< GV >::evaluateAll | ( | const typename GV::ctype & | in,
|  | std::vector< R > & | out,
|  | bool | evaluateJacobian,
|  | std::vector< R > & | outJac,
|  | bool | evaluateHessian,
|  | std::vector< R > & | outHess,
|  | const std::vector< R > & | knotVector,
|  | unsigned int | order,
|  | unsigned int | currentKnotSpan )

inline static

Evaluate the second derivatives of all one-dimensional B-spline functions for a given coordinate direction.

Parameters

  | in | Scalar(!) coordinate where to evaluate the functions
  [out] | out | Vector containing the values of all B-spline derivatives at 'in'
  [out] | outJac | Vector containing the first derivatives of all B-spline derivatives at 'in' (only if calculation was switched on by enableEvaluations)
  [out] | outHess | Vector containing the second derivatives of all B-spline derivatives at 'in' (only if calculation was switched on by enableEvaluations)

## evaluateFunction() [1/2]

template<typename GV>

void Dune::Functions::BSplinePreBasis< GV >::evaluateFunction | ( | const FieldVector< typename GV::ctype, dim > & | in,
|  | std::vector< FieldVector< R, 1 > > & | out,
|  | const std::array< unsigned, dim > & | currentKnotSpan ) const

inline

Evaluate all B-spline basis functions at a given point.

## evaluateFunction() [2/2]

template<typename GV>

void Dune::Functions::BSplinePreBasis< GV >::evaluateFunction | ( | const typename GV::ctype & | in,
|  | std::vector< R > & | out,
|  | const std::vector< R > & | knotVector,
|  | unsigned int | order,
|  | unsigned int | currentKnotSpan )

inline static

Evaluate all one-dimensional B-spline functions for a given coordinate direction.

This implementations was based on the explanations in the book of Cottrell, Hughes, Bazilevs, "Isogeometric Analysis"

Parameters

  | in | Scalar(!) coordinate where to evaluate the functions
  [out] | out | Vector containing the values of all B-spline functions at 'in'

## evaluateFunctionFull()

template<typename GV>

void Dune::Functions::BSplinePreBasis< GV >::evaluateFunctionFull | ( | const typename GV::ctype & | in,
|  | DynamicMatrix< R > & | out,
|  | const std::vector< R > & | knotVector,
|  | unsigned int | order,
|  | unsigned int | currentKnotSpan )

inline static

Evaluate all one-dimensional B-spline functions for a given coordinate direction.

This implementations was based on the explanations in the book of Cottrell, Hughes, Bazilevs, "Isogeometric Analysis"

Parameters

  | in | Scalar(!) coordinate where to evaluate the functions
  [out] | out | Vector containing the values of all B-spline functions at 'in'

## evaluateJacobian()

template<typename GV>

void Dune::Functions::BSplinePreBasis< GV >::evaluateJacobian | ( | const FieldVector< typename GV::ctype, dim > & | in,
|  | std::vector< FieldMatrix< R, 1, dim > > & | out,
|  | const std::array< unsigned, dim > & | currentKnotSpan ) const

inline

Evaluate Jacobian of all B-spline basis functions.

In theory this is easy: just look up the formula in a B-spline text of your choice. The challenge is compute only the values needed for the current knot span.

## getIJK()

template<typename GV>

std::array< unsigned int, dim > Dune::Functions::BSplinePreBasis< GV >::getIJK | ( | typename GridView::IndexSet::IndexType | idx,
|  | std::array< unsigned int, dim > | elements )

inline static

Compute integer element coordinates from the element index.

Warning
  This method makes strong assumptions about the grid, namely that it is structured, and that indices are given in a x-fastest fashion.

## gridView()

template<typename GV>

const GridView & Dune::Functions::BSplinePreBasis< GV >::gridView | ( |  | ) | const

inline

Obtain the grid view that the basis is defined on.

## indices()

template<typename GV>
template<typename It>

It Dune::Functions::BSplinePreBasis< GV >::indices | ( | const Node & | node,
|  | It | it ) const

inline

Maps from subtree index set [0..size-1] to a globally unique multi index in global basis.

## initializeIndices()

template<typename GV>

void Dune::Functions::BSplinePreBasis< GV >::initializeIndices | ( |  | ) |

inline

Initialize the global indices.

## makeNode()

template<typename GV>

Node Dune::Functions::BSplinePreBasis< GV >::makeNode | ( |  | ) | const

inline

Create tree node.

## maxNodeSize()

template<typename GV>

size_type Dune::Functions::BSplinePreBasis< GV >::maxNodeSize | ( |  | ) | const

inline

Get the maximal number of DOFs associated to node for any element.

## size() [1/3]

template<typename GV>

size_type Dune::Functions::LeafPreBasisMixin< BSplinePreBasis< GV > >::size | ( |  | ) | const

inline

Get the total dimension of the space spanned by this basis.

## size() [2/3]

template<typename GV>

size_type Dune::Functions::LeafPreBasisMixin< BSplinePreBasis< GV > >::size | ( | const SizePrefix & | prefix | ) | const

inline

Return number of possible values for next position in multi index.

## size() [3/3]

template<typename GV>

unsigned int Dune::Functions::BSplinePreBasis< GV >::size | ( | size_t | d | ) | const

inline

Number of shape functions in one direction.

## update()

template<typename GV>

void Dune::Functions::BSplinePreBasis< GV >::update | ( | const GridView & | gv | ) |

inline

Update the stored grid view, to be called if the grid has changed.

## Member Data Documentation

## elements_

template<typename GV>

std::array<unsigned,dim> Dune::Functions::BSplinePreBasis< GV >::elements_

Number of grid elements in the different coordinate directions.

## gridView_

template<typename GV>

GridView Dune::Functions::BSplinePreBasis< GV >::gridView_

## knotVectors_

template<typename GV>

std::array<std::vector<double>, dim> Dune::Functions::BSplinePreBasis< GV >::knotVectors_

The knot vectors, one for each space dimension.

## maxMultiIndexSize

size_type Dune::Functions::LeafPreBasisMixin< BSplinePreBasis< GV > >::maxMultiIndexSize

static constexpr inherited

Maximal length of global multi-indices.

## minMultiIndexSize

size_type Dune::Functions::LeafPreBasisMixin< BSplinePreBasis< GV > >::minMultiIndexSize

static constexpr inherited

Minimal length of global multi-indices.

## multiIndexBufferSize

size_type Dune::Functions::LeafPreBasisMixin< BSplinePreBasis< GV > >::multiIndexBufferSize

static constexpr inherited

Size required temporarily when constructing global multi-indices.

## order_

template<typename GV>

std::array<unsigned int, dim> Dune::Functions::BSplinePreBasis< GV >::order_

Order of the B-spline for each space dimension.

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

- bsplinebasis.hh