HermesCommon  2.0
Hermes::Hermes1DFunction< Scalar > Class Template Reference

#include <hermes_function.h>

+ Inheritance diagram for Hermes::Hermes1DFunction< Scalar >:

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
 
- Public Member Functions inherited from Hermes::Mixins::Loggable
void set_verbose_output (bool to_set)
 Sets the attribute verbose_output to the paramater option passed.
 
bool get_verbose_output () const
 Returns the current value of verbose_output;.
 
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

- Protected Member Functions inherited from Hermes::Mixins::Loggable
 Loggable (bool verbose_output=false, callbackFn verbose_callback=NULL)
 
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
 
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
 

Detailed Description

template<typename Scalar>
class Hermes::Hermes1DFunction< Scalar >

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 std::sin(x) * std::sin(x); }  Ord ord(Hermes::Ord x) const { return std::sin(x) * std::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 42 of file hermes_function.h.

Member Function Documentation

template<typename Scalar >
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.


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