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

Class representing a dual field for goal-oriented error estimation. More...

#include <DualField.h>

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

Public Member Functions

 DualRealFunc (const Vec3 &o, const Vec3 &n, const Vec3 &XZp, double d, double w=0.0, ASMbase *p=nullptr, int c=0)
 Constructor for 3D problems. More...
 
 DualRealFunc (const Vec3 &o, const Vec3 &n, double d, double w=0.0, ASMbase *p=nullptr, int c=0)
 Constructor for 2D problems (in XY-plane). More...
 
 DualRealFunc (const utl::Point &o, const Vec3Pair &d, ASMbase *p=nullptr, double eps=0.0, int c=0)
 Constructor for point extraction. More...
 
virtual ~DualRealFunc ()
 Empty destructor.
 
virtual unsigned char getType () const
 Returns the function type flag.
 
const Vec3x () const
 Returns the local X (normal) direction of the cross section.
 
const Vec3y () const
 Returns the local Y (tangent) direction of the cross section.
 
Vec3 z () const
 Returns the local Z (2nd tangent) direction of the cross section.
 
double ecc (const Vec3 &X, int i) const
 Returns the offset from the cross section origin \ b X0.
 
double value (const Vec3 &X, bool ignoreDomain=false) const
 Returns the function value at the given point. More...
 
bool isPointExtraction () const
 Returns true, if the dual field is for extracting point values.
 
virtual bool inDomain (const Vec3 &X) const
 Checks if the point X is within the function domain.
 
virtual bool initPatch (size_t idx)
 Returns true if current patch is affected by this function.
 
- Public Member Functions inherited from RealFunc
unsigned char getType () const override
 Returns the function type flag.
 
std::vector< RealgetValue (const Vec3 &X) const override
 Returns the function value as an array.
 
virtual Vec3 gradient (const Vec3 &X) const
 Evaluates first derivatives of the function.
 
virtual SymmTensor hessian (const Vec3 &X) const
 Evaluates second derivatives of the function.
 
Real getScalarValue (const Vec3 &X) const override
 Returns a representative scalar equivalent of the function value.
 
Real timeDerivative (const Vec3 &X) const
 Returns the time derivative of the function.
 
- Public Member Functions inherited from utl::SpatialFunction< Real >
virtual Real deriv (const Vec3 &, int) const
 Returns a first-derivative of the function.
 
virtual Real dderiv (const Vec3 &, int, int) const
 Returns a second-derivative of the function.
 
- Public Member Functions inherited from utl::Function< Arg, Result >
virtual ~Function ()
 Empty destructor.
 
virtual bool isZero () const
 Returns whether the function is identically zero or not.
 
virtual bool isConstant () const
 Returns whether the function is time-independent or not.
 
Result operator() (const Arg &x) const
 Operator returning the function value for the given argument.
 
- Public Member Functions inherited from FunctionBase
virtual ~FunctionBase ()
 Empty destructor.
 
size_t dim () const
 Returns the number of components of the return value.
 
virtual void setParam (const std::string &, Real)
 Sets an additional parameter in the function.
 
void setParam (const std::string &name, const Vec3 &value)
 Sets additional parameter values in the function.
 

Protected Member Functions

virtual double evaluate (const Vec3 &X) const
 Evaluates the dual field function.
 
- Protected Member Functions inherited from RealFunc
 RealFunc ()
 The constructor is protected to allow sub-class instances only.
 
- Protected Member Functions inherited from utl::SpatialFunction< Real >
 SpatialFunction (const Real &val)
 The constructor is protected to allow sub-class instances only.
 
virtual std::vector< RealevalGradient (const Vec3 &) const
 Returns the gradient of the function as a 1D array.
 
virtual std::vector< RealevalHessian (const Vec3 &) const
 Returns the hessian of the function as a 1D array.
 
virtual std::vector< RealevalTimeDerivative (const Vec3 &) const
 Returns the time derivatives of the function as a 1D array.
 
- Protected Member Functions inherited from utl::Function< Arg, Result >
 Function ()
 The constructor is protected to allow sub-class instances only.
 
virtual Result evaluate (const Arg &x) const =0
 Evaluates the function for the argument x.
 
- Protected Member Functions inherited from FunctionBase
 FunctionBase ()
 The constructor is protected to allow sub-class instances only.
 

Private Attributes

short int comp
 Result component to extract for (0 if used as weight)
 
utl::Point X0
 Coordinates of cross section origin or reference point.
 
Vec3 normal
 Outward-directed normal vector of the cross section.
 
Vec3 tangent
 Vector defining the local y-direction of the cross section.
 
double depth
 Depth of the the dual function domain (0=point extraction)
 
double width
 Width of the the dual function domain (0=infinite)
 
Vec3 Xll
 Lower-left corner of box domain for point extraction.
 
Vec3 Xur
 Upper-right corner of box domain for point extraction.
 
ASMbasepatch
 The patch that this field is defined on.
 
std::set< int > Delem
 List of elements in domain.
 

Additional Inherited Members

- Public Types inherited from utl::Function< Arg, Result >
typedef Arg Input
 Input type.
 
typedef Result Output
 Output type.
 
- Protected Attributes inherited from utl::SpatialFunction< Real >
Real zero
 Return value for default implementations of derivatives.
 
- Protected Attributes inherited from FunctionBase
size_t ncmp
 Number of components in the return value.
 

Detailed Description

Class representing a dual field for goal-oriented error estimation.

Constructor & Destructor Documentation

◆ DualRealFunc() [1/3]

DualRealFunc::DualRealFunc ( const Vec3 o,
const Vec3 n,
const Vec3 XZp,
double  d,
double  w = 0.0,
ASMbase p = nullptr,
int  c = 0 
)

Constructor for 3D problems.

Parameters
[in]oOrigin of local cross section coordinate system
[in]nCross section normal
[in]XZpPoint in the local XZ-plane
[in]dDepth of dual function domain
[in]wWidth of dual function domain (0=infinite)
[in]pThe affected patch (null=all)
[in]cComponent index to do extraction for

References comp, Vec3::cross(), depth, normal, Vec3::normalize(), patch, tangent, width, and X0.

◆ DualRealFunc() [2/3]

DualRealFunc::DualRealFunc ( const Vec3 o,
const Vec3 n,
double  d,
double  w = 0.0,
ASMbase p = nullptr,
int  c = 0 
)

Constructor for 2D problems (in XY-plane).

Parameters
[in]oOrigin of local cross section coordinate system
[in]nCross section normal
[in]dDepth of dual function domain
[in]wWidth of dual function domain (0=infinite)
[in]pThe affected patch (null=all)
[in]cComponent index to do extraction for

References comp, depth, normal, Vec3::normalize(), patch, tangent, width, Vec3::x, and Vec3::y.

◆ DualRealFunc() [3/3]

DualRealFunc::DualRealFunc ( const utl::Point o,
const Vec3Pair d,
ASMbase p = nullptr,
double  eps = 0.0,
int  c = 0 
)

Constructor for point extraction.

Parameters
[in]cComponent index to do extraction for
[in]oPoint to extract the point quantity at
[in]dLower-left and upper-rigth corner of function domain
[in]pThe affected patch (null=all)
[in]epsParameter tolerance for searching elements around a point

References comp, depth, normal, patch, tangent, width, Vec3::x, and Vec3::y.

Member Function Documentation

◆ value()

double DualRealFunc::value ( const Vec3 X,
bool  ignoreDomain = false 
) const

Returns the function value at the given point.

Parameters
[in]XSpatial evaluation point
[in]ignoreDomainIf true, the function is evaluated without considering the boundaries of the function domain. Otherwise, it is assumed identically zero outside these boundaries.

References comp, depth, ecc(), inDomain(), normal, and X0.

Referenced by evaluate(), DualVecFunc::evaluate(), and DualVecFunc::getScalarValue().


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