Class xlifepp::Function#
-
class Function#
-
Collaboration diagram for xlifepp::Function:
The class Function encapsulates in object function a user’s functions.
It is used by internal computing functions
this class is able to deal with any user function of type
r function(const Point&, Parameters&) (function tpe) r function(const Point&, const Point&, Parameters&) (kernel type)
Vector<r> function(const Vector<Point>&, Parameters&) Vector<r> function(const Vector<Point>&, const Vector<Point>&, Parameters&)
This class mainly proposes:
two constructors (unamed and named)
a fast call to compute function values when function is well identified (see member functions fun_xxx)
a general safe call to compute function values (see operator ()); require only output argument compatibility if output argument is not compatible, an error occurs with a message
some utilities to return type of function and type of arguments (use rtti functions)
Note: A Parameters is attached to a Function using a pointer. This Parameters is passed to the function by reference therefore, it may be shared by few functions and when it is modified it is for any function sharing it. In a way, this parameters is global
Public Functions
-
Function()#
-
default constructor
-
Function(funSR_t &f, const char *na, Parameters &pa = defaultParameters)#
-
constructor with function name (const char*) along the function prototypes
-
Function(funSR_t &f, const string_t &na, Parameters &pa = defaultParameters)#
-
constructor with function name (string) along the function prototypes
-
Function(funSR_t &f, dimen_t d, const char *na, Parameters &pa = defaultParameters)#
-
constructor with function name (const char*) along the function prototypes
-
Function(funSR_t &f, dimen_t d, const string_t &na, Parameters &pa = defaultParameters)#
-
constructor with function name (string) along the function prototypes
-
Function(funSR_t &f, dimen_t d, Parameters &pa = defaultParameters)#
-
constructor along the function prototypes
-
Function(funSR_t &f, Parameters &pa = defaultParameters)#
-
constructor along the function prototypes
-
template<typename T>
Function(Tabular<T> &tab, dimen_t dp, const string_t &na = "", FunctType ft = _function)#
-
tabular stuff
constructor from a Tabular
-
template<typename T>
Function(Tabular<T> &tab, dimen_t dp, Function &fpx, const string_t &na = "", FunctType ft = _function)#
-
constructor from a Tabular
-
~Function()#
-
destructor
-
void associateVector(UnitaryVector uv, number_t d = 3)#
-
associate to the function a unitary vector
-
template<class T>
inline void checkFunctionType(T&, FunctType) const#
-
to check the type of output and input arguments
to check the type of the function when computing its value using the operator ().
This function uses Run Time Information (RTTI), so it must be used sparingly for this reason, when it is invoked, the checkType_ value is reset to false
-
inline void checkTypeOff() const#
-
deactivate the checking of integrity
-
inline void checkTypeOn() const#
-
activate the checking of integrity
-
inline bool &conjugate()#
-
<return the conjugate state (true/false) flag
-
inline bool conjugate() const#
-
return the conjugate state (true/false) flag
-
inline void conjugate(bool v) const#
-
set the conjugate stateflag
-
void createTabular(real_t x0, real_t dx, number_t nx, real_t y0, real_t dy, number_t ny, const string_t &nax = "x", const string_t &nay = "y")#
-
tabulating f(x,y)
-
void createTabular(real_t x0, real_t dx, number_t nx, real_t y0, real_t dy, number_t ny, real_t z0, real_t dz, number_t nz, const string_t &nax = "x", const string_t &nay = "y", const string_t &naz = "z")#
-
tabulating f(x,y,z)
-
template<typename T>
void createTabularT(const T &t, real_t x0, real_t dx, number_t nx, const string_t &nax = "x")#
-
tabulating f(x) - template
-
template<typename T>
void createTabularT(const T &t, real_t x0, real_t dx, number_t nx, real_t y0, real_t dy, number_t ny, const string_t &nax = "x", const string_t &nay = "y")#
-
tabulating f(x,y)) - template
-
template<typename T>
void createTabularT(const T &t, real_t x0, real_t dx, number_t nx, real_t y0, real_t dy, number_t ny, real_t z0, real_t dz, number_t nz, const string_t &nax = "x", const string_t &nay = "y", const string_t &naz = "z")#
-
tabulating f(x,y,z) - template
-
inline const void *fun_p() const#
-
return fun void pointer
-
inline real_t funSR(const Point &x) const#
-
compute the value(s) of the function using correct type function (no check performed)
-
void init(void*, const string_t&, const string_t&, FunctType, ArgType, Parameters&, dimen_t d = 3)#
-
to initialize members, used by the constructors
-
void isNotAFunction() const#
-
true if not a function
-
void isNotAKernel() const#
-
true if not a kernel
-
inline bool isVoidFunction() const#
-
true if fun pointer is 0
-
template<typename T>
inline T &kerTable(const Point &x, const Point &y, T &res) const#
-
compute kernel using table_
-
inline string_t name() const#
-
return the function name
-
inline bool normalRequired() const#
-
true if normal required
-
Value operator()(const Point &x, const Point &y) const#
-
evaluate kernel function at a couple of points, returning a Value
-
template<typename T>
inline T &operator()(const Point &x, const Point &y, T &res) const#
-
compute the value of the function at a given couple of points
compute in a safe way the value of the kernel function at a given couple of points.
the function is either a function of a couple of points or a function of a couple of vectors of points
-
template<typename T>
inline T &operator()(const Point &x, T &res) const#
-
compute the value of the function at a given point
compute in a safe way the value of the function at a given point.
the function is either a function of a single point or a function of a vector of points n, nx or ny are additional normal vectors
-
template<typename T>
inline Vector<T> &operator()(const Vector<Point> &x, const Vector<Point> &y, Vector<T> &res) const#
-
compute the values of the function at a given couple of vector of points
compute in a safe way the value of the kernel function at a couple of vectors of points.
the function is either a function of a couple of points or a function of a couple of vectors of points
-
template<typename T>
inline Vector<T> &operator()(const Vector<Point> &x, Vector<T> &res) const#
-
compute the values of the function at a given vector of points
compute in a safe way the values of the function at a vector of points.
the function is either a function of a point or a function of a vector of points
-
Parameter ¶meter(const size_t) const#
-
accses parameter by rank >=1
associate a unitary vector to the function - DEPRECATED -
-
inline Parameters ¶ms()#
-
return the parameters list
-
inline Parameters ¶ms() const#
-
return the parameters list
-
inline Parameters *¶ms_p()#
-
return the parameters list pointer
-
inline const Parameters *params_p() const#
-
return the parameters list pointer
-
void printInfo(std::ostream &out) const#
-
print utility
-
inline void set_np(const Vector<real_t> *np = nullptr) const#
-
set pointer to normal in theThreadData
-
inline StrucType structReturned() const#
-
return the structure of return argument (saclar_t, vector_t or matrix_t)
-
inline StrucType strucType() const#
-
return the structure of return argument (saclar_t, vector_t or matrix_t)
-
inline bool tangentRequired() const#
-
true if tangent required
-
const TermVector *termVector() const#
-
return TermVector pointer when interpolated function (0 if not)
-
Point termVectorPoint() const#
-
return a dof coordinate from TermVector if interpolated function
-
inline bool &transpose()#
-
return the transpose state (true/false) flag
-
inline bool transpose() const#
-
return the transpose state (true/false) flag
-
inline void transpose(bool v) const#
-
set the transpose stateflag
Public Members
-
mutable bool checkType_ = false#
-
to activate the checking of arguments (see operator ())
-
mutable bool conjugate_ = false#
-
temporary flag for conjugate operation in OperatorOnUnknown construction (see operator lib)
-
string_t name_#
-
name of function and comments
-
bool requireDof = false#
-
true if user declares that its function requires dof
-
bool requireDom = false#
-
true if user declares that its function requires domain
-
bool requireElt = false#
-
true if user declares that its function requires element
-
bool requireNx = false#
-
true if user declares that its function requires normal or x-normal vector
-
bool requireNy = false#
-
true if user declares that its function (kernel) requires y-normal vector
-
bool requireTx = false#
-
true if user declares that its function requires normal or x-tangent vector
-
bool requireTy = false#
-
true if user declares that its function (kernel) requires y-tangent vector
-
mutable bool transpose_ = false#
-
temporary flag for transpose operation in OperatorOnUnknown construction (see operator lib)
-
mutable bool xpar = false#
-
true means that point x is consider as a parameter (unused for ordinary function)
Public Static Functions
-
static void initReturnTypes()#
-
initialisation of the map