queso-0.53.0
Protected Attributes | List of all members
QUESO::Constant1D1DFunction Class Reference

Class for constant one-dimensional functions. More...

#include <1D1DFunction.h>

Inheritance diagram for QUESO::Constant1D1DFunction:
Inheritance graph
[legend]
Collaboration diagram for QUESO::Constant1D1DFunction:
Collaboration graph
[legend]

Public Member Functions

Constructor/Destructor methods
 Constant1D1DFunction (double minDomainValue, double maxDomainValue, double constantValue)
 Default constructor. More...
 
 ~Constant1D1DFunction ()
 Destructor. More...
 
Mathematical methods
double value (double domainValue) const
 Returns the value of the constant function at point domainValue. More...
 
double deriv (double domainValue) const
 Returns the value of the derivative of the constant function at point domainValue. More...
 
- Public Member Functions inherited from QUESO::Base1D1DFunction
 Base1D1DFunction (double minDomainValue, double maxDomainValue)
 Default constructor. More...
 
virtual ~Base1D1DFunction ()
 Destructor. More...
 
double minDomainValue () const
 Returns the minimum value of the domain of the (one-dimensional) function. More...
 
double maxDomainValue () const
 Returns the maximum value of the domain of the (one-dimensional) function. More...
 
virtual double multiplyAndIntegrate (const Base1D1DFunction &func, unsigned int quadratureOrder, double *resultWithMultiplicationByTAsWell) const
 TODO: Multiplies this function with function, and integrates it numerically. See template specialization. More...
 

Protected Attributes

double m_constantValue
 
- Protected Attributes inherited from QUESO::Base1D1DFunction
double m_minDomainValue
 
double m_maxDomainValue
 

Detailed Description

Class for constant one-dimensional functions.

This class implements constant one-dimensional functions.

Definition at line 140 of file 1D1DFunction.h.

Constructor & Destructor Documentation

QUESO::Constant1D1DFunction::Constant1D1DFunction ( double  minDomainValue,
double  maxDomainValue,
double  constantValue 
)

Default constructor.

Definition at line 131 of file 1D1DFunction.C.

135  :
137  m_constantValue (constantValue)
138 {
139 }
double minDomainValue() const
Returns the minimum value of the domain of the (one-dimensional) function.
Definition: 1D1DFunction.C:48
double maxDomainValue() const
Returns the maximum value of the domain of the (one-dimensional) function.
Definition: 1D1DFunction.C:54
Base1D1DFunction(double minDomainValue, double maxDomainValue)
Default constructor.
Definition: 1D1DFunction.C:33
QUESO::Constant1D1DFunction::~Constant1D1DFunction ( )

Destructor.

Definition at line 141 of file 1D1DFunction.C.

142 {
143 }

Member Function Documentation

double QUESO::Constant1D1DFunction::deriv ( double  domainValue) const
virtual

Returns the value of the derivative of the constant function at point domainValue.

This function checks if point domainValue belongs to the domain of this function, and in affirmative case, it returns 0 (derivative of a constant function.

Implements QUESO::Base1D1DFunction.

Definition at line 163 of file 1D1DFunction.C.

References QUESO::Base1D1DFunction::m_maxDomainValue, QUESO::Base1D1DFunction::m_minDomainValue, and queso_require_msg.

164 {
165  if ((domainValue < m_minDomainValue) || (domainValue > m_maxDomainValue)) {
166  std::cerr << "In Constant1D1DFunction::deriv()"
167  << ": requested x (" << domainValue
168  << ") is out of the interval (" << m_minDomainValue
169  << ", " << m_maxDomainValue
170  << ")"
171  << std::endl;
172  }
173 
174  queso_require_msg(!((domainValue < m_minDomainValue) || (domainValue > m_maxDomainValue)), "x out of range");
175 
176  return 0.;
177 }
#define queso_require_msg(asserted, msg)
Definition: asserts.h:69
double QUESO::Constant1D1DFunction::value ( double  domainValue) const
virtual

Returns the value of the constant function at point domainValue.

This function checks if point domainValue belongs to the domain of this function, and in affirmative case, it evaluates the function at such point, which is the constant value constantValue passed to the constructor of this class.

Implements QUESO::Base1D1DFunction.

Definition at line 146 of file 1D1DFunction.C.

References m_constantValue, QUESO::Base1D1DFunction::m_maxDomainValue, QUESO::Base1D1DFunction::m_minDomainValue, and queso_require_msg.

147 {
148  if ((domainValue < m_minDomainValue) || (domainValue > m_maxDomainValue)) {
149  std::cerr << "In Constant1D1DFunction::value()"
150  << ": requested x (" << domainValue
151  << ") is out of the interval (" << m_minDomainValue
152  << ", " << m_maxDomainValue
153  << ")"
154  << std::endl;
155  }
156 
157  queso_require_msg(!((domainValue < m_minDomainValue) || (domainValue > m_maxDomainValue)), "x out of range");
158 
159  return m_constantValue;
160 }
#define queso_require_msg(asserted, msg)
Definition: asserts.h:69

Member Data Documentation

double QUESO::Constant1D1DFunction::m_constantValue
protected

Definition at line 169 of file 1D1DFunction.h.

Referenced by value().


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

Generated on Thu Jun 11 2015 13:52:35 for queso-0.53.0 by  doxygen 1.8.5