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

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

#include <SplineField2D.h>

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

Public Member Functions

 SplineField2D (const ASMs2D *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...
 
 SplineField2D (const Go::SplineSurface *srf, const RealArray &v, const char *name=nullptr)
 Construct directly from surface. More...
 
virtual ~SplineField2D ()
 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 valueGrid (RealArray &val, const int *npe) const
 Computes the value at a grid of visualization points. 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 gradCoor (const Vec4 &x, Vector &grad) const
 Computes the gradient for a given global/physical coordinate. More...
 

Protected Attributes

const Go::SplineSurface * basis
 Spline basis description.
 
const Go::SplineSurface * surf
 Spline geometry description.
 
- 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.
 

Private Attributes

unsigned char nsd
 Number of space dimensions.
 

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 spline-based finite element scalar fields in 2D.

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

Constructor & Destructor Documentation

◆ SplineField2D() [1/2]

SplineField2D::SplineField2D ( const ASMs2D 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(), ASMs2D::getNoNodes(), ASMbase::getNoSpaceDim(), FieldBase::nelm, FieldBase::nno, nsd, utl::vector< T >::resize(), and FieldBase::values.

◆ SplineField2D() [2/2]

SplineField2D::SplineField2D ( const Go::SplineSurface *  srf,
const RealArray v,
const char *  name = nullptr 
)

Construct directly from surface.

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

References FieldBase::values.

Member Function Documentation

◆ gradFE()

bool SplineField2D::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, SplineField::evalBasis(), SplineField::evalMapping(), utl::gather(), utl::matrix< T >::multiply(), nsd, surf, and FieldBase::values.

◆ hessianFE()

bool SplineField2D::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, SplineField::evalBasis(), SplineField::evalMapping(), utl::gather(), utl::matrix3d< T >::multiply(), nsd, utl::matrix< T >::resize(), surf, and FieldBase::values.

◆ valueCoor()

double SplineField2D::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 surf, Vec4::u, valueFE(), Vec3::x, Vec3::y, and Vec3::z.

◆ valueFE()

double SplineField2D::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, utl::vector< T >::dot(), utl::gather(), ASMs2D::scatterInd(), ItgPoint::u, ItgPoint::v, and FieldBase::values.

Referenced by valueCoor().

◆ valueGrid()

bool SplineField2D::valueGrid ( RealArray val,
const int *  npe 
) const
virtual

Computes the value at a grid of visualization points.

Parameters
[out]valField values at the visualization points
[in]npeNumber of visualization nodes over each knot span

Reimplemented from Field.

References basis, utl::vector< T >::dot(), utl::gather(), ASMs2D::scatterInd(), and FieldBase::values.

◆ valueNode()

double SplineField2D::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: