OOFEM  2.4
OOFEM.org - Object Oriented Finite Element Solver
oofem::TSplineInterpolation Class Reference

Interpolation for T-splines. More...

#include <feitspline.h>

+ Inheritance diagram for oofem::TSplineInterpolation:
+ Collaboration diagram for oofem::TSplineInterpolation:

Public Member Functions

 TSplineInterpolation (int nsd)
 
virtual ~TSplineInterpolation ()
 
IRResultType initializeFrom (InputRecord *ir)
 Initializes receiver according to object description stored in input record. More...
 
void setNumberOfControlPoints (int num)
 
virtual void evalN (FloatArray &answer, const FloatArray &lcoords, const FEICellGeometry &cellgeo)
 Evaluates the array of interpolation functions (shape functions) at given point. More...
 
virtual double evaldNdx (FloatMatrix &answer, const FloatArray &lcoords, const FEICellGeometry &cellgeo)
 Evaluates the matrix of derivatives of interpolation functions (shape functions) at given point. More...
 
virtual void local2global (FloatArray &answer, const FloatArray &lcoords, const FEICellGeometry &cellgeo)
 Evaluates global coordinates from given local ones. More...
 
virtual int global2local (FloatArray &answer, const FloatArray &lcoords, const FEICellGeometry &cellgeo)
 Evaluates local coordinates from given global ones. More...
 
virtual void giveJacobianMatrixAt (FloatMatrix &jacobianMatrix, const FloatArray &lcoords, const FEICellGeometry &cellgeo)
 Gives the jacobian matrix at the local coordinates. More...
 
virtual int giveKnotSpanBasisFuncMask (const IntArray &knotSpan, IntArray &mask)
 Returns indices (zero based) of nonzero basis functions for given knot span. More...
 
virtual int giveNumberOfKnotSpanBasisFunctions (const IntArray &knotSpan)
 Returns the number of nonzero basis functions at individual knot span,. More...
 
const char * giveClassName () const
 
- Public Member Functions inherited from oofem::BSplineInterpolation
 BSplineInterpolation (int nsd)
 
virtual ~BSplineInterpolation ()
 
virtual integrationDomain giveIntegrationDomain () const
 Returns the integration domain of the interpolator. More...
 
virtual Element_Geometry_Type giveGeometryType () const
 Returns the geometry type fo the interpolator. More...
 
virtual integrationDomain giveBoundaryIntegrationDomain (int ib) const
 Returns boundary integration domain. More...
 
virtual integrationDomain giveBoundarySurfaceIntegrationDomain (int isurf) const
 Returns boundary integration domain. More...
 
virtual integrationDomain giveBoundaryEdgeIntegrationDomain (int iedge) const
 Returns boundary integration domain. More...
 
virtual int giveNsd ()
 Returns number of spatial dimensions. More...
 
virtual void boundaryEdgeGiveNodes (IntArray &answer, int boundary)
 Gives the boundary nodes for requested boundary number. More...
 
virtual void boundaryEdgeEvalN (FloatArray &answer, int boundary, const FloatArray &lcoords, const FEICellGeometry &cellgeo)
 Evaluates the basis functions on the requested boundary. More...
 
virtual double boundaryEdgeGiveTransformationJacobian (int boundary, const FloatArray &lcoords, const FEICellGeometry &cellgeo)
 Evaluates the determinant of the transformation Jacobian on the requested boundary. More...
 
virtual void boundaryEdgeLocal2Global (FloatArray &answer, int boundary, const FloatArray &lcoords, const FEICellGeometry &cellgeo)
 Maps the local boundary coordinates to global. More...
 
virtual void boundaryGiveNodes (IntArray &answer, int boundary)
 Gives the boundary nodes for requested boundary number. More...
 
virtual void boundaryEvalN (FloatArray &answer, int boundary, const FloatArray &lcoords, const FEICellGeometry &cellgeo)
 Evaluates the basis functions on the requested boundary. More...
 
virtual double boundaryEvalNormal (FloatArray &answer, int boundary, const FloatArray &lcoords, const FEICellGeometry &cellgeo)
 Evaluates the normal on the requested boundary. More...
 
virtual double boundaryGiveTransformationJacobian (int boundary, const FloatArray &lcoords, const FEICellGeometry &cellgeo)
 Evaluates the determinant of the transformation Jacobian on the requested boundary. More...
 
virtual void boundaryLocal2Global (FloatArray &answer, int boundary, const FloatArray &lcoords, const FEICellGeometry &cellgeo)
 Maps the local boundary coordinates to global. More...
 
virtual int giveNumberOfKnotSpans (int dim)
 Returns the number of knot spans of the receiver. More...
 
virtual int giveNumberOfControlPoints (int dim)
 
virtual const double *const * giveKnotVector ()
 Returns the subdivision of patch parametric space. More...
 
virtual const IntArraygiveKnotMultiplicity (int dim)
 Returns the knot multiplicity of the receiver. More...
 
virtual const FloatArraygiveKnotValues (int dim)
 Returns the knot values of the receiver. More...
 
virtual bool hasSubPatchFormulation ()
 Returns true, if receiver is formulated on sub-patch basis. More...
 
virtual IntegrationRulegiveIntegrationRule (int order)
 Sets up a suitable integration rule for numerical integrating over volume. More...
 
virtual IntegrationRulegiveBoundaryIntegrationRule (int order, int boundary)
 Sets up a suitable integration rule for integrating over the requested boundary. More...
 
virtual IntegrationRulegiveBoundaryEdgeIntegrationRule (int order, int boundary)
 Sets up a suitable integration rule for integrating over the requested boundary. More...
 
virtual void boundarySurfaceEvalN (FloatArray &answer, int isurf, const FloatArray &lcoords, const FEICellGeometry &cellgeo)
 Evaluates the array of edge interpolation functions (shape functions) at given point. More...
 
virtual void boundarySurfaceEvaldNdx (FloatMatrix &answer, int isurf, const FloatArray &lcoords, const FEICellGeometry &cellgeo)
 Evaluates the matrix of derivatives of edge interpolation functions (shape functions) at given point. More...
 
virtual double boundarySurfaceEvalNormal (FloatArray &answer, int isurf, const FloatArray &lcoords, const FEICellGeometry &cellgeo)
 Evaluates the normal out of the surface at given point. More...
 
virtual void boundarySurfaceLocal2global (FloatArray &answer, int isurf, const FloatArray &lcoords, const FEICellGeometry &cellgeo)
 Evaluates edge global coordinates from given local ones. More...
 
virtual double boundarySurfaceGiveTransformationJacobian (int isurf, const FloatArray &lcoords, const FEICellGeometry &cellgeo)
 Evaluates the edge jacobian of transformation between local and global coordinates. More...
 
virtual void boundarySurfaceGiveNodes (IntArray &answer, int boundary)
 Gives the boundary nodes for requested boundary number. More...
 
- Public Member Functions inherited from oofem::FEInterpolation
 FEInterpolation (int o)
 
virtual ~FEInterpolation ()
 
virtual int giveNumberOfNodes () const
 Returns the number of geometric nodes of the receiver. More...
 
std::string errorInfo (const char *func) const
 
int giveInterpolationOrder ()
 Returns the interpolation order. More...
 
virtual void evald2Ndx2 (FloatMatrix &answer, const FloatArray &lcoords, const FEICellGeometry &cellgeo)
 Evaluates the matrix of second derivatives of interpolation functions (shape functions) at given point. More...
 
virtual void evaldNdxi (FloatMatrix &answer, const FloatArray &lcoords, const FEICellGeometry &cellgeo)
 Evaluates the matrix of derivatives of interpolation functions (shape functions) at given point. More...
 
virtual void giveLocalNodeCoords (FloatMatrix &answer)
 Returns a matrix containing the local coordinates for each node corresponding to the interpolation. More...
 
virtual double giveTransformationJacobian (const FloatArray &lcoords, const FEICellGeometry &cellgeo)
 Evaluates the determinant of the transformation. More...
 
virtual IntegrationRulegiveBoundarySurfaceIntegrationRule (int order, int boundary)
 Sets up a suitable integration rule for integrating over the requested boundary. More...
 
virtual double evalNXIntegral (int boundary, const FEICellGeometry &cellgeo)
 Computes the integral $ \int_S n \cdot x \mathrm{d}s $. More...
 
virtual int giveNumberOfEdges () const
 Returns number of edges. More...
 

Protected Member Functions

double basisFunction (double u, int p, const FloatArray &U, const int *I)
 Evaluates the middle basis function on local knot vector at u. More...
 
void dersBasisFunction (int n, double u, int p, const FloatArray &U, const int *I, FloatArray &ders)
 Computes the middle basis function and it derivatives on local knot vector at u. More...
 
void createLocalKnotVector (int p, const FloatArray &U, const int *I, int *prepend, int *append)
 Creates local open knot vector. More...
 
int giveKnotSpanBasisFuncMask (const IntArray &startKnotSpan, const IntArray &endKnotSpan, IntArray &mask)
 Returns indices (zero based) of nonzero basis functions for given knot span interval. More...
 
int giveNumberOfKnotSpanBasisFunctions (const IntArray &startKnotSpan, const IntArray &endKnotSpan)
 Returns the number of nonzero basis functions at given knot span interval. More...
 
- Protected Member Functions inherited from oofem::BSplineInterpolation
void basisFuns (FloatArray &N, int span, double u, int p, const double *U)
 Evaluates the nonvanishing basis functions of 1d BSpline (algorithm A2.2 from NURBS book) More...
 
void dersBasisFuns (int n, double u, int span, int p, double *const U, FloatMatrix &ders)
 Computes nonzero basis functions and their derivatives at u. More...
 
int findSpan (int n, int p, double u, const double *U) const
 Determines the knot span index (Algorithm A2.1 from the NURBS book) More...
 
void giveNonzeroBasisFuncInterval (int span, int deg, int &s, int &e)
 Returns the range of nonzero basis functions for given knot span and given degree. More...
 

Protected Attributes

int *** localIndexKnotVector
 Local index knot vector of the dimensions [totalNumberOfControlPoints][nsd][degree+2]. More...
 
int totalNumberOfControlPoints
 
double * openLocalKnotVector
 Temporary open local knot vector to enable use of BSpline algorithms (common for all directions) [3*max_degree+2]. More...
 
- Protected Attributes inherited from oofem::BSplineInterpolation
int nsd
 Number of spatial directions. More...
 
int * degree
 Degree in each direction. More...
 
FloatArrayknotValues
 Knot values [nsd]. More...
 
IntArrayknotMultiplicity
 Knot multiplicity [nsd]. More...
 
int * numberOfControlPoints
 numberOfControlPoints[nsd] More...
 
double ** knotVector
 Knot vectors [nsd][knot_vector_size]. More...
 
int * numberOfKnotSpans
 Nonzero spans in each directions [nsd]. More...
 
- Protected Attributes inherited from oofem::FEInterpolation
int order
 

Detailed Description

Interpolation for T-splines.

Definition at line 61 of file feitspline.h.

Constructor & Destructor Documentation

oofem::TSplineInterpolation::TSplineInterpolation ( int  nsd)
inline

Definition at line 72 of file feitspline.h.

oofem::TSplineInterpolation::~TSplineInterpolation ( )
virtual

Member Function Documentation

double oofem::TSplineInterpolation::basisFunction ( double  u,
int  p,
const FloatArray U,
const int *  I 
)
protected

Evaluates the middle basis function on local knot vector at u.

Parameters
uValue at which to evaluate.
pDegree.
UGlobal knot values.
ILocal index knot vector.
Returns
N Computed middle basis function.
Warning
Parameter u must be in a valid range.

Definition at line 640 of file feitspline.C.

References oofem::BSplineInterpolation::basisFuns(), createLocalKnotVector(), oofem::BSplineInterpolation::findSpan(), N, and openLocalKnotVector.

Referenced by evalN(), and local2global().

void oofem::TSplineInterpolation::createLocalKnotVector ( int  p,
const FloatArray U,
const int *  I,
int *  prepend,
int *  append 
)
protected

Creates local open knot vector.

This is generally done extracting knot values from global knot vector using the local index knot vector and by prepending p times the first knot and appending p times the last knot. However, existing knot multiplicity at the start and end must be accounted for.

Parameters
pDegree.
UGlobal knot values.
ILocal index knot vector
prependNumber of prepended entries
appendNumber of appended entries

Definition at line 675 of file feitspline.C.

References oofem::FloatArray::at(), and openLocalKnotVector.

Referenced by basisFunction(), and dersBasisFunction().

void oofem::TSplineInterpolation::dersBasisFunction ( int  n,
double  u,
int  p,
const FloatArray U,
const int *  I,
FloatArray ders 
)
protected

Computes the middle basis function and it derivatives on local knot vector at u.

The result is stored in the ders vector

\begin{align*} N(u) &= ders(0) N'(u) &= ders(1) N''(u)&= ders(2) \end{align*}

Parameters
nDegree of the derivation.
uParametric value.
pDegree.
UGlobal knot values.
ILocal index knot vector.
dersVector containing the derivatives of the middle basis function.
Warning
Parameters n and u must be in a valid range.

Definition at line 657 of file feitspline.C.

References createLocalKnotVector(), oofem::BSplineInterpolation::dersBasisFuns(), oofem::BSplineInterpolation::findSpan(), openLocalKnotVector, and oofem::FloatArray::resize().

Referenced by evaldNdx(), and giveJacobianMatrixAt().

double oofem::TSplineInterpolation::evaldNdx ( FloatMatrix answer,
const FloatArray lcoords,
const FEICellGeometry cellgeo 
)
virtual

Evaluates the matrix of derivatives of interpolation functions (shape functions) at given point.

These derivatives are in global coordinate system (where the nodal coordinates are defined)

Parameters
answerContains resulting matrix of derivatives, the member at i,j position contains value of dNi/dxj.
lcoordsArray containing (local) coordinates.
cellgeoUnderlying cell geometry.
Returns
Determinant of the Jacobian.

Reimplemented from oofem::BSplineInterpolation.

Definition at line 188 of file feitspline.C.

References oofem::FloatArray::at(), oofem::BSplineInterpolation::degree, dersBasisFunction(), oofem::BSplineInterpolation::findSpan(), oofem::FloatMatrix::giveDeterminant(), giveKnotSpanBasisFuncMask(), oofem::BSplineInterpolation::giveKnotValues(), oofem::IntArray::giveSize(), oofem::FEICellGeometry::giveVertexCoordinates(), oofem::FEIIGAElementGeometryWrapper::knotSpan, oofem::BSplineInterpolation::knotVector, localIndexKnotVector, oofem::BSplineInterpolation::nsd, oofem::BSplineInterpolation::numberOfControlPoints, OOFEM_ERROR, oofem::FloatMatrix::resize(), and oofem::FloatMatrix::zero().

void oofem::TSplineInterpolation::evalN ( FloatArray answer,
const FloatArray lcoords,
const FEICellGeometry cellgeo 
)
virtual
const char* oofem::TSplineInterpolation::giveClassName ( ) const
inlinevirtual

Reimplemented from oofem::BSplineInterpolation.

Definition at line 89 of file feitspline.h.

int oofem::TSplineInterpolation::giveKnotSpanBasisFuncMask ( const IntArray knotSpan,
IntArray mask 
)
virtual

Returns indices (zero based) of nonzero basis functions for given knot span.

The knot span identifies the sub-region of the finite element.

Returns
Nonzero if mask is provided, zero otherwise meaning that all basis functions are generally nonzero.

Reimplemented from oofem::BSplineInterpolation.

Definition at line 485 of file feitspline.C.

References oofem::BSplineInterpolation::degree, oofem::IntArray::followedBy(), oofem::BSplineInterpolation::knotValues, oofem::BSplineInterpolation::knotVector, localIndexKnotVector, oofem::BSplineInterpolation::nsd, OOFEM_ERROR, oofem::IntArray::preallocate(), and totalNumberOfControlPoints.

Referenced by evaldNdx(), evalN(), giveJacobianMatrixAt(), and local2global().

int oofem::TSplineInterpolation::giveKnotSpanBasisFuncMask ( const IntArray startKnotSpan,
const IntArray endKnotSpan,
IntArray mask 
)
protected
int oofem::TSplineInterpolation::giveNumberOfKnotSpanBasisFunctions ( const IntArray knotSpan)
virtual

Returns the number of nonzero basis functions at individual knot span,.

Returns
Zero in case of all basis functions generally nonzero, answer otherwise.
Todo:
This loop seems meaningless. It just returns degree[nsd-1]+1 in the end ?

Reimplemented from oofem::BSplineInterpolation.

Definition at line 530 of file feitspline.C.

References oofem::BSplineInterpolation::degree, oofem::BSplineInterpolation::knotValues, oofem::BSplineInterpolation::knotVector, localIndexKnotVector, oofem::BSplineInterpolation::nsd, and totalNumberOfControlPoints.

int oofem::TSplineInterpolation::giveNumberOfKnotSpanBasisFunctions ( const IntArray startKnotSpan,
const IntArray endKnotSpan 
)
protected
virtual int oofem::TSplineInterpolation::global2local ( FloatArray answer,
const FloatArray gcoords,
const FEICellGeometry cellgeo 
)
inlinevirtual

Evaluates local coordinates from given global ones.

If local coordinates cannot be found (generate elements, or point far outside geometry, then the center coordinate will be used as a last resort, and the return value will be zero.

Parameters
answerContains evaluated local coordinates.
gcoordsArray containing global coordinates.
cellgeoUnderlying cell geometry.
Returns
Nonzero is returned if point is within the element geometry, zero otherwise.

Reimplemented from oofem::BSplineInterpolation.

Definition at line 80 of file feitspline.h.

References OOFEM_ERROR.

void oofem::TSplineInterpolation::setNumberOfControlPoints ( int  num)
inline

Definition at line 76 of file feitspline.h.

Referenced by oofem::IGATSplineElement::initializeFrom().

Member Data Documentation

int*** oofem::TSplineInterpolation::localIndexKnotVector
protected

Local index knot vector of the dimensions [totalNumberOfControlPoints][nsd][degree+2].

Definition at line 65 of file feitspline.h.

Referenced by evaldNdx(), evalN(), giveJacobianMatrixAt(), giveKnotSpanBasisFuncMask(), giveNumberOfKnotSpanBasisFunctions(), initializeFrom(), local2global(), and ~TSplineInterpolation().

double* oofem::TSplineInterpolation::openLocalKnotVector
protected

Temporary open local knot vector to enable use of BSpline algorithms (common for all directions) [3*max_degree+2].

Definition at line 70 of file feitspline.h.

Referenced by basisFunction(), createLocalKnotVector(), dersBasisFunction(), initializeFrom(), and ~TSplineInterpolation().

int oofem::TSplineInterpolation::totalNumberOfControlPoints
protected

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

This page is part of the OOFEM documentation. Copyright (c) 2011 Borek Patzak
Project e-mail: info@oofem.org
Generated at Tue Jan 2 2018 20:07:43 for OOFEM by doxygen 1.8.11 written by Dimitri van Heesch, © 1997-2011