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

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

#include <SplineField3D.h>

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

Public Member Functions

 SplineField3D (const ASMs3D *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...
 
 SplineField3D (const Go::SplineVolume *svol, const RealArray &v, const char *name=nullptr)
 Construct directly from volume. More...
 
virtual ~SplineField3D ()
 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::SplineVolume * basis
 Spline basis description.
 
const Go::SplineVolume * vol
 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 3D.

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

Constructor & Destructor Documentation

◆ SplineField3D() [1/2]

SplineField3D::SplineField3D ( const ASMs3D 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 the vector as-is.
[in]nameName of spline field

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

◆ SplineField3D() [2/2]

SplineField3D::SplineField3D ( const Go::SplineVolume *  svol,
const RealArray v,
const char *  name = nullptr 
)

Construct directly from volume.

Parameters
[in]svolThe spline volume to use
[in]vArray of control point field values
[in]nameName of spline field

References FieldBase::values.

Member Function Documentation

◆ gradFE()

bool SplineField3D::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(), FieldBase::values, and vol.

◆ hessianFE()

bool SplineField3D::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(), utl::matrix< T >::resize(), FieldBase::values, and vol.

◆ valueCoor()

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

Computes the value at a given global coordinate.

Parameters
[in]xGlobal/physical coordinate of evaluation point

Reimplemented from Field.

References Vec4::u, valueFE(), vol, Vec3::x, Vec3::y, and Vec3::z.

◆ valueFE()

double SplineField3D::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(), ASMs3D::scatterInd(), ItgPoint::u, ItgPoint::v, FieldBase::values, and ItgPoint::w.

Referenced by valueCoor().

◆ valueGrid()

bool SplineField3D::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(), ASMs3D::scatterInd(), and FieldBase::values.

◆ valueNode()

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