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

Unary spatial function as a sum of other spatial functions. More...

#include <FunctionSum.h>

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

Public Member Functions

 FunctionSum (FunctionBase *f, double w=1.0)
 The constructor specifies the first function to sum. More...
 
virtual ~FunctionSum ()
 Empty destructor.
 
bool add (FunctionBase *f, double w=1.0)
 Adds a function to the list of functions to sum. More...
 
virtual unsigned char getType () const
 Returns the function type flag.
 
virtual bool inDomain (const Vec3 &X) const
 Checks if a specified point is within the function domain.
 
virtual bool initPatch (size_t idx)
 Returns true if current patch is affected by this function.
 
virtual std::vector< double > getValue (const Vec3 &X) const
 Returns the function value as an array.
 
virtual double getScalarValue (const Vec3 &X) const
 Returns a representative scalar equivalent of the function value.
 
- 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

 FunctionSum ()
 Constructor to allow empty initialization in subclasses.
 
- Protected Member Functions inherited from FunctionBase
 FunctionBase ()
 The constructor is protected to allow sub-class instances only.
 

Private Types

typedef std::pair< FunctionBase *, double > WeightedFunc
 Convenience type.
 

Private Attributes

std::vector< WeightedFunccomps
 List of weighted functions to sum.
 

Additional Inherited Members

- Protected Attributes inherited from FunctionBase
size_t ncmp
 Number of components in the return value.
 

Detailed Description

Unary spatial function as a sum of other spatial functions.

Constructor & Destructor Documentation

◆ FunctionSum()

FunctionSum::FunctionSum ( FunctionBase f,
double  w = 1.0 
)
inlineexplicit

The constructor specifies the first function to sum.

Parameters
[in]fPointer to a function to sum
[in]wWeighting factor. If negative, take max value instead.

References add().

Member Function Documentation

◆ add()

bool FunctionSum::add ( FunctionBase f,
double  w = 1.0 
)

Adds a function to the list of functions to sum.

Parameters
[in]fPointer to a function to sum
[in]wWeighting factor. If negative, take max value instead.

References comps, FunctionBase::dim(), and FunctionBase::ncmp.

Referenced by FunctionSum().


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