HermesCommon
3.0
|
#include <hermes_function.h>
Public Member Functions | |
Hermes1DFunction () | |
Constructor. | |
Hermes1DFunction (Scalar value) | |
Constructor for the constant case. | |
virtual Scalar | value (Scalar x) const |
One-dimensional function value. | |
virtual Hermes::Ord | value (Hermes::Ord x) const |
One-dimensional function integration order. | |
virtual Scalar | derivative (Scalar x) const |
One-dimensional function derivative value. | |
virtual Hermes::Ord | derivative (Hermes::Ord x) const |
One-dimensional function derivative integration order. | |
bool | is_constant () const |
template<> | |
double | value (double x) const |
template<> | |
std::complex< double > | value (std::complex< double > x) const |
template<> | |
double | derivative (double x) const |
template<> | |
std::complex< double > | derivative (std::complex< double > x) const |
![]() | |
Loggable (bool verbose_output=false, callbackFn verbose_callback=NULL, bool add_newline=true) | |
void | set_file_output_only (bool onOff) |
void | set_timestamps (bool onOff) |
Sets the addition of a time stamp on each line in the log file. By default it is on. | |
void | set_erase_on_beginning (bool onOff) |
Sets the logFile being always erased before logging. | |
void | set_logFile_name (const char *filename) |
void | set_logFile_name (std::string filename) |
void | info (const char *msg,...) const |
void | info_if (bool cond, const char *msg,...) const |
void | warn (const char *msg,...) const |
void | warn_if (bool cond, const char *msg,...) const |
void | error (const char *msg,...) const |
void | error_if (bool cond, const char *msg,...) const |
virtual void | set_verbose_output (bool to_set) |
bool | get_verbose_output () const |
Returns the current value of verbose_output;. | |
virtual void | set_verbose_callback (callbackFn callback) |
callbackFn | get_verbose_callback () const |
Returns the current value of verbose_callback;. | |
Protected Attributes | |
bool | is_const |
The function is constant. | |
Scalar | const_value |
If the function is constant, this is the value. | |
Additional Inherited Members | |
![]() | |
static void | set_static_logFile_name (const char *filename) |
static void | set_static_logFile_name (std::string filename) |
![]() | |
char * | logFileName |
Logfile name. | |
![]() | |
static char * | staticLogFileName = nullptr |
![]() | |
void | hermes_fwrite (const void *ptr, size_t size, size_t nitems, FILE *stream) const |
void | hermes_fread (void *ptr, size_t size, size_t nitems, FILE *stream) const |
Generic class for functions of one variable. Typical usage: user creates a descendant: class MyRealSinSquared : public Hermes1DFunction<double> { /// Constructor. MyRealSinSquared() : Hermes1DFunction<double>() {} double value(double x) const { return sin(x) * sin(x); } Ord ord(Hermes::Ord x) const { return sin(x) * sin(x); // Hermes::Ord arithmetics will take care of everything, the resulting order will be as high as possible, see other examples in this file for another possibility how to go about it. } .... }
Definition at line 43 of file hermes_function.h.
bool Hermes::Hermes1DFunction< Scalar >::is_constant | ( | ) | const |
The function is constant. Returns the value of is_const.
Definition at line 21 of file hermes_function.cpp.