|
dune-functions 2.8.0
|
Loading...
Searching...
No Matches
bsplinebasis.hh
Go to the documentation of this file.
404 while (preBasis_.knotVectors_[i][currentKnotSpan_[i]+1] < preBasis_.knotVectors_[i][currentKnotSpan_[i]]+1e-8)
412 while (preBasis_.knotVectors_[i][currentKnotSpan_[i]+1] < preBasis_.knotVectors_[i][currentKnotSpan_[i]]+1e-8)
418 localBasis_.scaling_[i][i] = preBasis_.knotVectors_[i][currentKnotSpan_[i]+1] - preBasis_.knotVectors_[i][currentKnotSpan_[i]];
608 assert( std::accumulate(elements_.begin(), elements_.end(), 1, std::multiplies<unsigned>()) == gridView_.size(0) );
660 assert( std::accumulate(elements_.begin(), elements_.end(), 1, std::multiplies<unsigned>()) == gridView_.size(0) );
760 globalIJK[i] = std::max((int)currentKnotSpan[i] - (int)order[i], 0) + localIJK[i]; // needs to be a signed type!
871 if (order_[i]==0) // order-zero functions are piecewise constant, hence all derivatives are zero
877 R derivativeAddend1 = lowOrderOneDValues[i][j] / (knotVectors_[i][j+order_[i]]-knotVectors_[i][j]);
878 R derivativeAddend2 = lowOrderOneDValues[i][j+1] / (knotVectors_[i][j+order_[i]+1]-knotVectors_[i][j+1]);
938 evaluateAll(in[i], oneDValues[i], true, oneDDerivatives[i], false, oneDSecondDerivatives[i], knotVectors_[i], order_[i], currentKnotSpan[i]);
941 evaluateAll(in[i], oneDValues[i], true, oneDDerivatives[i], true, oneDSecondDerivatives[i], knotVectors_[i], order_[i], currentKnotSpan[i]);
1018 static std::array<unsigned int,dim> getIJK(typename GridView::IndexSet::IndexType idx, std::array<unsigned int,dim> elements)
1042 std::size_t outSize = order+1; // The 'standard' value away from the boundaries of the knot vector
1221 R derivativeAddend1 = lowOrderTwoDValues[j] / (knotVector[j+order]-knotVector[j]) / (knotVector[j+order-1]-knotVector[j]);
1222 R derivativeAddend2 = lowOrderTwoDValues[j+1] / (knotVector[j+order]-knotVector[j]) / (knotVector[j+order]-knotVector[j+1]);
1223 R derivativeAddend3 = lowOrderTwoDValues[j+1] / (knotVector[j+order+1]-knotVector[j+1]) / (knotVector[j+order]-knotVector[j+1]);
1224 R derivativeAddend4 = lowOrderTwoDValues[j+2] / (knotVector[j+order+1]-knotVector[j+1]) / (knotVector[j+1+order]-knotVector[j+2]);
auto bSpline(const std::vector< double > &knotVector, unsigned int order, bool makeOpen=true)
Create a pre-basis factory that can create a B-spline pre-basis.
Definition bsplinebasis.hh:1344
double alpha() const
reference operator[](size_type i)
void push_back(const MemberType &item)
iterator end()
Indent & operator++()
iterator begin()
size_type dim() const
static constexpr size_type N()
void umv(const X &x, Y &y) const
std::ptrdiff_t index() const
#define DUNE_THROW(E, m)
size_type size() const
D DomainType
LocalFiniteElement in the sense of dune-localfunctions, for the B-spline basis on tensor-product grid...
Definition bsplinebasis.hh:364
const BSplineLocalBasis< GV, R, MI > & localBasis() const
Hand out a LocalBasis object.
Definition bsplinebasis.hh:429
const BSplinePreBasis< GV, MI > & preBasis_
Definition bsplinebasis.hh:476
unsigned size() const
Number of shape functions in this finite element.
Definition bsplinebasis.hh:447
std::array< unsigned, dim > currentKnotSpan_
Definition bsplinebasis.hh:483
GeometryType type() const
Return the reference element that the local finite element is defined on (here, a hypercube)
Definition bsplinebasis.hh:457
BSplineLocalInterpolation< dim, BSplineLocalBasis< GV, R, MI > > localInterpolation_
Definition bsplinebasis.hh:480
void bind(const std::array< unsigned, dim > &elementIdx)
Bind LocalFiniteElement to a specific knot span of the spline patch.
Definition bsplinebasis.hh:396
LocalFiniteElementTraits< BSplineLocalBasis< GV, R, MI >, BSplineLocalCoefficients< dim >, BSplineLocalInterpolation< dim, BSplineLocalBasis< GV, R, MI > > > Traits
Export various types related to this LocalFiniteElement.
Definition bsplinebasis.hh:374
const BSplineLocalCoefficients< dim > & localCoefficients() const
Hand out a LocalCoefficients object.
Definition bsplinebasis.hh:435
BSplineLocalBasis< GV, R, MI > localBasis_
Definition bsplinebasis.hh:478
const BSplineLocalInterpolation< dim, BSplineLocalBasis< GV, R, MI > > & localInterpolation() const
Hand out a LocalInterpolation object.
Definition bsplinebasis.hh:441
BSplineLocalFiniteElement(const BSplineLocalFiniteElement &other)
Copy constructor.
Definition bsplinebasis.hh:385
BSplineLocalFiniteElement(const BSplinePreBasis< GV, MI > &preBasis)
Constructor with a given B-spline basis.
Definition bsplinebasis.hh:378
unsigned int size(int i) const
Number of degrees of freedom for one coordinate direction.
Definition bsplinebasis.hh:465
BSplineLocalCoefficients< dim > localCoefficients_
Definition bsplinebasis.hh:479
GV GridView
The grid view that the FE space is defined on.
Definition bsplinebasis.hh:563
unsigned int size(size_t d) const
Number of shape functions in one direction.
Definition bsplinebasis.hh:783
size_type dimension() const
Get the total dimension of the space spanned by this basis.
Definition bsplinebasis.hh:728
void update(const GridView &gv)
Update the stored grid view, to be called if the grid has changed.
Definition bsplinebasis.hh:693
void evaluateJacobian(const FieldVector< typename GV::ctype, dim > &in, std::vector< FieldMatrix< R, 1, dim > > &out, const std::array< unsigned, dim > ¤tKnotSpan) const
Evaluate Jacobian of all B-spline basis functions.
Definition bsplinebasis.hh:821
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.
Definition bsplinebasis.hh:1037
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.
Definition bsplinebasis.hh:597
unsigned int size() const
Total number of B-spline basis functions.
Definition bsplinebasis.hh:774
size_type size(const SizePrefix prefix) const
Return number of possible values for next position in multi index.
Definition bsplinebasis.hh:721
MI MultiIndex
Type used for global numbering of the basis vectors.
Definition bsplinebasis.hh:572
size_type maxNodeSize() const
Get the maximal number of DOFs associated to node for any element.
Definition bsplinebasis.hh:734
void initializeIndices()
Initialize the global indices.
Definition bsplinebasis.hh:683
std::array< unsigned, dim > elements_
Number of grid elements in the different coordinate directions.
Definition bsplinebasis.hh:1249
const GridView & gridView() const
Obtain the grid view that the basis is defined on.
Definition bsplinebasis.hh:687
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.
Definition bsplinebasis.hh:744
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 dire...
Definition bsplinebasis.hh:1137
void evaluateFunction(const FieldVector< typename GV::ctype, dim > &in, std::vector< FieldVector< R, 1 > > &out, const std::array< unsigned, dim > ¤tKnotSpan) const
Evaluate all B-spline basis functions at a given point.
Definition bsplinebasis.hh:790
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.
Definition bsplinebasis.hh:649
Impl::DefaultNodeIndexSet< BSplinePreBasis > IndexSet
Type of created tree node index set.
Definition bsplinebasis.hh:569
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.
Definition bsplinebasis.hh:1094
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.
Definition bsplinebasis.hh:1018
IndexSet makeIndexSet() const
Create tree node index set.
Definition bsplinebasis.hh:715
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 > ¤tKnotSpan) const
Evaluate Derivatives of all B-spline basis functions.
Definition bsplinebasis.hh:922
Node makeNode() const
Create tree node.
Definition bsplinebasis.hh:701
std::array< std::vector< double >, dim > knotVectors_
The knot vectors, one for each space dimension.
Definition bsplinebasis.hh:1246
std::array< unsigned int, dim > order_
Order of the B-spline for each space dimension.
Definition bsplinebasis.hh:1243
LocalBasis class in the sense of dune-localfunctions, presenting the restriction of a B-spline patch ...
Definition bsplinebasis.hh:47
LocalBasisTraits< D, dim, FieldVector< D, dim >, R, 1, FieldVector< R, 1 >, FieldMatrix< R, 1, dim > > Traits
export type traits for function signature
Definition bsplinebasis.hh:56
BSplineLocalBasis(const BSplinePreBasis< GV, MI > &preBasis, const BSplineLocalFiniteElement< GV, R, MI > &lFE)
Constructor with a given B-spline patch.
Definition bsplinebasis.hh:62
void evaluateFunction(const FieldVector< D, dim > &in, std::vector< FieldVector< R, 1 > > &out) const
Evaluate all shape functions.
Definition bsplinebasis.hh:71
void evaluate(const typename std::array< int, k > &directions, const typename Traits::DomainType &in, std::vector< typename Traits::RangeType > &out) const
Evaluate all shape functions and derivatives of any order.
Definition bsplinebasis.hh:98
unsigned int order() const
Polynomial order of the shape functions.
Definition bsplinebasis.hh:141
void evaluateJacobian(const FieldVector< D, dim > &in, std::vector< FieldMatrix< D, 1, dim > > &out) const
Evaluate Jacobian of all shape functions.
Definition bsplinebasis.hh:83
std::size_t size() const
Return the number of basis functions on the current knot span.
Definition bsplinebasis.hh:148
Attaches a shape function to an entity.
Definition bsplinebasis.hh:179
const LocalKey & localKey(std::size_t i) const
get i'th index
Definition bsplinebasis.hh:322
void init(const std::array< unsigned, dim > &sizes)
Definition bsplinebasis.hh:257
std::size_t size() const
number of coefficients
Definition bsplinebasis.hh:316
Local interpolation in the sense of dune-localfunctions, for the B-spline basis on tensor-product gri...
Definition bsplinebasis.hh:341
void interpolate(const F &f, std::vector< C > &out) const
Local interpolation of a function.
Definition bsplinebasis.hh:345
Definition bsplinebasis.hh:1259
BSplineNode(const BSplinePreBasis< GV, MI > *preBasis)
Definition bsplinebasis.hh:1268
void bind(const Element &e)
Bind to element.
Definition bsplinebasis.hh:1289
const FiniteElement & finiteElement() const
Return the LocalFiniteElement for the element we are bound to.
Definition bsplinebasis.hh:1283
const BSplinePreBasis< GV, MI > * preBasis_
Definition bsplinebasis.hh:1299
FiniteElement finiteElement_
Definition bsplinebasis.hh:1301
typename GV::template Codim< 0 >::Entity Element
Definition bsplinebasis.hh:1265
const Element & element() const
Return current element, throw if unbound.
Definition bsplinebasis.hh:1274
Global basis for given pre-basis.
Definition defaultglobalbasis.hh:47
Definition nodes.hh:184
T accumulate(T... args)
T begin(T... args)
T end(T... args)
T fill(T... args)
T isnan(T... args)
T max_element(T... args)
T max(T... args)
T size(T... args)
Legal Statements / Impressum | Hosted by TU Dresden & Uni Heidelberg | Generated by
1.9.8