00001 #ifdef CH_LANG_CC 00002 /* 00003 * _______ __ 00004 * / ___/ / ___ __ _ / / ___ 00005 * / /__/ _ \/ _ \/ V \/ _ \/ _ \ 00006 * \___/_//_/\___/_/_/_/_.__/\___/ 00007 * Please refer to Copyright.txt, in Chombo's root directory. 00008 */ 00009 #endif 00010 00011 #ifndef _CONSTANTSCALARFUNCTION_H_ 00012 #define _CONSTANTSCALARFUNCTION_H_ 00013 00014 #include "ScalarFunction.H" 00015 #include "NamespaceHeader.H" 00016 00017 //! \class ConstantScalarFunction 00018 //! This ScalarFunction subclass represents a function that returns a 00019 //! constant value everywhere in space and time. 00020 class ConstantScalarFunction: public ScalarFunction 00021 { 00022 public: 00023 00024 //! Creates a constant scalar function returning the given value. 00025 //! \param a_value The value returned by the function. 00026 explicit ConstantScalarFunction(Real a_value); 00027 00028 //! Destructor. 00029 ~ConstantScalarFunction(); 00030 00031 // Overridden methods. 00032 Real operator()(const RealVect& a_x, Real a_t) const; 00033 00034 Real derivative(const IntVect& a_order, 00035 const RealVect& a_x, 00036 Real a_t) const; 00037 00038 private: 00039 00040 Real m_value; 00041 }; 00042 00043 #include "NamespaceFooter.H" 00044 #endif