14 #ifndef _FUNCTION_SUM_H
15 #define _FUNCTION_SUM_H
47 virtual unsigned char getType()
const;
55 virtual std::vector<double>
getValue(
const Vec3& X)
const;
60 std::vector<WeightedFunc>
comps;
General functions with arbitrary argument and value type.
Base class for unary spatial functions of arbitrary result type.
Definition: Function.h:147
Unary spatial function as a sum of other spatial functions.
Definition: FunctionSum.h:25
FunctionSum()
Constructor to allow empty initialization in subclasses.
Definition: FunctionSum.h:30
std::pair< FunctionBase *, double > WeightedFunc
Convenience type.
Definition: FunctionSum.h:26
FunctionSum(FunctionBase *f, double w=1.0)
The constructor specifies the first function to sum.
Definition: FunctionSum.h:36
virtual bool inDomain(const Vec3 &X) const
Checks if a specified point is within the function domain.
Definition: FunctionSum.C:51
bool add(FunctionBase *f, double w=1.0)
Adds a function to the list of functions to sum.
Definition: FunctionSum.C:18
virtual double getScalarValue(const Vec3 &X) const
Returns a representative scalar equivalent of the function value.
Definition: FunctionSum.C:91
virtual bool initPatch(size_t idx)
Returns true if current patch is affected by this function.
Definition: FunctionSum.C:61
std::vector< WeightedFunc > comps
List of weighted functions to sum.
Definition: FunctionSum.h:60
virtual ~FunctionSum()
Empty destructor.
Definition: FunctionSum.h:39
virtual unsigned char getType() const
Returns the function type flag.
Definition: FunctionSum.C:38
virtual std::vector< double > getValue(const Vec3 &X) const
Returns the function value as an array.
Definition: FunctionSum.C:71
Simple class for representing a point in 3D space.
Definition: Vec3.h:27