IFEM  90A354
Public Member Functions | Protected Attributes | List of all members
LRSplineField2D Class Reference

Class for LR spline-based finite element scalar fields in 2D. More...

#include <LRSplineField2D.h>

Inheritance diagram for LRSplineField2D:
Inheritance graph
[legend]
Collaboration diagram for LRSplineField2D:
Collaboration graph
[legend]

Public Member Functions

 LRSplineField2D (const ASMu2D *patch, const RealArray &v, char basis=1, char cmp=1, const char *name=nullptr)
 The constructor sets the number of space dimensions and fields. More...
 
 LRSplineField2D (const LR::LRSplineSurface *srf, const RealArray &v, bool is_rational, const char *name=nullptr)
 Construct directly from surface. More...
 
virtual ~LRSplineField2D ()
 Empty destructor.
 
virtual double valueNode (size_t node) const
 Computes the value in a given node/control point. More...
 
virtual double valueFE (const ItgPoint &x) const
 Computes the value at a given local coordinate. More...
 
virtual double valueCoor (const Vec4 &x) const
 Computes the value at a given global coordinate. More...
 
virtual bool gradFE (const ItgPoint &x, Vector &grad) const
 Computes the gradient for a given local coordinate. More...
 
virtual bool hessianFE (const ItgPoint &x, Matrix &H) const
 Computes the hessian for a given local coordinate. More...
 
- Public Member Functions inherited from FieldBase
virtual ~FieldBase ()
 Empty destructor.
 
size_t getNoElm () const
 Returns the number of elements.
 
size_t getNoNodes () const
 Returns the number of nodal/control points.
 
- Public Member Functions inherited from Field
virtual ~Field ()
 Empty destructor.
 
const char * getFieldName () const
 Returns the name of field.
 
virtual bool valueGrid (RealArray &val, const int *npe) const
 Computes the value at a grid of visualization points. More...
 
virtual bool gradCoor (const Vec4 &x, Vector &grad) const
 Computes the gradient for a given global/physical coordinate. More...
 

Protected Attributes

const LR::LRSplineSurface * basis
 Spline basis description.
 
const LR::LRSplineSurface * surf
 Spline geometry description.
 
bool is_rational
 Whether or not surfaces are rational.
 
- Protected Attributes inherited from FieldBase
size_t nelm
 Number of elements/knot-spans.
 
size_t nno
 Number of nodes/control points.
 
Vector values
 Nodal field values.
 
- Protected Attributes inherited from Field
std::string fname
 Name of the field.
 

Additional Inherited Members

- Static Public Member Functions inherited from Field
static Fieldcreate (const ASMbase *pch, const RealArray &v, char basis=1, char cmp=1, const char *name=nullptr)
 Creates a dynamically allocated field object. More...
 
- Protected Member Functions inherited from FieldBase
 FieldBase (const char *name=nullptr)
 The constructor sets the field name. More...
 
- Protected Member Functions inherited from Field
 Field (const char *name=nullptr)
 The constructor sets the field name. More...
 

Detailed Description

Class for LR spline-based finite element scalar fields in 2D.

This class implements the methods required to evaluate a 2D LR spline scalar field at a given point in parametrical or physical coordinates.

Constructor & Destructor Documentation

◆ LRSplineField2D() [1/2]

LRSplineField2D::LRSplineField2D ( const ASMu2D patch,
const RealArray v,
char  basis = 1,
char  cmp = 1,
const char *  name = nullptr 
)

The constructor sets the number of space dimensions and fields.

Parameters
[in]patchThe spline patch on which the field is to be defined
[in]vArray of control point field values
[in]basisBasis to use from patch
[in]cmpComponent to use from source field. Pass 0 to use vector as-is.
[in]nameName of spline field

References basis, utl::vector< T >::begin(), ASMbase::getNoFields(), ASMu2D::getNoNodes(), FieldBase::nelm, FieldBase::nno, utl::vector< T >::resize(), and FieldBase::values.

◆ LRSplineField2D() [2/2]

LRSplineField2D::LRSplineField2D ( const LR::LRSplineSurface *  srf,
const RealArray v,
bool  is_rational,
const char *  name = nullptr 
)

Construct directly from surface.

Parameters
[in]srfThe spline surface to use
[in]vArray of control point field values
is_rationalTrue if surface is rational
[in]nameName of spline field

References FieldBase::values.

Member Function Documentation

◆ gradFE()

bool LRSplineField2D::gradFE ( const ItgPoint x,
Vector grad 
) const
virtual

Computes the gradient for a given local coordinate.

Parameters
[in]xLocal coordinate of evaluation point
[out]gradGradient of solution in a given local coordinate

Implements Field.

References basis, LRSplineField::evalBasis(), LRSplineField::evalMapping(), is_rational, utl::matrix< T >::multiply(), utl::vector< T >::push_back(), utl::vector< T >::reserve(), surf, and FieldBase::values.

◆ hessianFE()

bool LRSplineField2D::hessianFE ( const ItgPoint x,
Matrix H 
) const
virtual

Computes the hessian for a given local coordinate.

Parameters
[in]xLocal coordinate of evaluation point
[out]HHessian of solution in a given local coordinate

Reimplemented from Field.

References basis, LRSplineField::evalBasis(), LRSplineField::evalMapping(), is_rational, utl::matrix3d< T >::multiply(), utl::matrix< T >::resize(), surf, and FieldBase::values.

◆ valueCoor()

double LRSplineField2D::valueCoor ( const Vec4 x) const
virtual

Computes the value at a given global coordinate.

Parameters
[in]xGlobal/physical coordinate for point

Reimplemented from Field.

References Vec4::u, and valueFE().

◆ valueFE()

double LRSplineField2D::valueFE ( const ItgPoint x) const
virtual

Computes the value at a given local coordinate.

Parameters
[in]xLocal coordinate of evaluation point

Implements Field.

References basis, ASMu2D::computeBasisNurbs(), utl::vector< T >::dot(), is_rational, utl::vector< T >::push_back(), utl::vector< T >::reserve(), ItgPoint::u, ItgPoint::v, and FieldBase::values.

Referenced by valueCoor().

◆ valueNode()

double LRSplineField2D::valueNode ( size_t  node) const
virtual

Computes the value in a given node/control point.

Parameters
[in]nodeNode number

Implements Field.

References FieldBase::nno, and FieldBase::values.


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