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

A scalar-valued spatial function, chebyshev polynomials. More...

#include <Chebyshev.h>

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

Classes

struct  Func
 Struct defining function and weight in one direction. More...
 

Public Member Functions

 ChebyshevFunc (const std::string &input, bool file)
 The constructor initializes the function parameters from a file. More...
 
bool isZero () const override
 Returns whether the function is identically zero or not.
 
const std::vector< Real > & getCoefs () const
 Returns a const reference to the coefficients.
 
const std::array< int, 3 > & getSize () const
 Returns the number of polynomials in each parameter direction.
 
Real deriv (const Vec3 &X, int c) const override
 Returns a first-derivative of the function.
 
Real dderiv (const Vec3 &X, int c, int c2) const override
 Returns a second-derivative of the 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::Function< Arg, Result >
virtual ~Function ()
 Empty destructor.
 
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 bool initPatch (size_t)
 Sets the active patch.
 
virtual bool inDomain (const Vec3 &) const
 Checks if a specified point is within the function domain.
 
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

Real evaluate (const Vec3 &X) const override
 Evaluates the function at point X.
 
- 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 Member Functions

Real evaluateTP (const Vec3 &X, const std::array< Func, 3 > &funcs) const
 Performs the actual tensor-product evaluation.
 
void read (std::istream &in)
 Reads input from a stream. More...
 

Private Attributes

std::vector< Realcoefs
 Function coefficients.
 
std::array< int, 3 > n
 Number of coefficients.
 
std::array< std::array< double, 2 >, 3 > domain
 Physical 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

A scalar-valued spatial function, chebyshev polynomials.

Constructor & Destructor Documentation

◆ ChebyshevFunc()

ChebyshevFunc::ChebyshevFunc ( const std::string &  input,
bool  file 
)

The constructor initializes the function parameters from a file.

Parameters
[in]inputName of file or string to read coefs from
[in]fileTrue if input is a file name

References n, and read().

Member Function Documentation

◆ read()

void ChebyshevFunc::read ( std::istream &  in)
private

Reads input from a stream.

Parameters
inStream to read from

References coefs, domain, and n.

Referenced by ChebyshevFunc().


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