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

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

#include <LagrangeField2D.h>

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

Public Member Functions

 LagrangeField2D (const ASMs2DLag *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...
 
virtual ~LagrangeField2D ()
 Empty destructor.
 
double valueNode (size_t node) const override
 Computes the value in a given node/control point. More...
 
double valueFE (const ItgPoint &x) const override
 Computes the value at a given local coordinate. More...
 
bool gradFE (const ItgPoint &x, Vector &grad) const override
 Computes the gradient 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 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 gradCoor (const Vec4 &x, Vector &grad) const
 Computes the gradient for a given global/physical coordinate. More...
 
virtual bool hessianFE (const ItgPoint &x, Matrix &H) const
 Computes the hessian for a given local coordinate. More...
 

Protected Types

using IntMat = std::vector< std::vector< int > >
 Convenience type.
 

Protected Attributes

Matrix coord
 Matrix of nodal coordinates.
 
IntMat mnpc
 Matrix of element nodes.
 
int p1
 Element order in first parameter direction.
 
int p2
 Element order in second parameter direction.
 
- 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 Lagrange-based finite element scalar fields in 2D.

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

Constructor & Destructor Documentation

◆ LagrangeField2D()

LagrangeField2D::LagrangeField2D ( const ASMs2DLag 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
[in]nameName of field

References utl::vector< T >::begin(), coord, ASMs2DLag::getNodalCoordinates(), ASMbase::getNoElms(), ASMbase::getNoFields(), ASMs2D::getNoNodes(), ASMs2DLag::getOrder(), FieldBase::nelm, FieldBase::nno, p1, p2, utl::vector< T >::resize(), and FieldBase::values.

Member Function Documentation

◆ gradFE()

bool LagrangeField2D::gradFE ( const ItgPoint x,
Vector grad 
) const
overridevirtual

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 Lagrange::computeBasis(), coord, ItgPoint::eta, utl::matrix< T >::fillColumn(), utl::matrix< T >::getColumn(), ItgPoint::iel, utl::Jacobian(), mnpc, utl::matrix< T >::multiply(), FieldBase::nelm, p1, p2, utl::vector< T >::resize(), FieldBase::values, and ItgPoint::xi.

◆ valueFE()

double LagrangeField2D::valueFE ( const ItgPoint x) const
overridevirtual

Computes the value at a given local coordinate.

Parameters
[in]xLocal coordinate of evaluation point

Implements Field.

References Lagrange::computeBasis(), ItgPoint::eta, ItgPoint::iel, mnpc, FieldBase::nelm, p1, p2, FieldBase::values, and ItgPoint::xi.

◆ valueNode()

double LagrangeField2D::valueNode ( size_t  node) const
overridevirtual

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: