00001 //--------------------------------------------------------------------------- 00002 // @f$Id: parsed_function.h 25345 2012-03-31 08:37:04Z bangerth @f$ 00003 // 00004 // Copyright (C) 2007, 2009, 2012 by the deal.II authors 00005 // 00006 // This file is subject to QPL and may not be distributed 00007 // without copyright and license information. Please refer 00008 // to the file deal.II/doc/license.html for the text and 00009 // further information on this license. 00010 // 00011 //--------------------------------------------------------------------------- 00012 00013 #ifndef __deal2__parsed_function_h 00014 #define __deal2__parsed_function_h 00015 00016 #include <deal.II/base/auto_derivative_function.h> 00017 #include <deal.II/base/function_parser.h> 00018 #include <deal.II/base/parameter_handler.h> 00019 00020 DEAL_II_NAMESPACE_OPEN 00021 00022 namespace Functions 00023 { 00075 template <int dim> 00076 class ParsedFunction : public AutoDerivativeFunction<dim> 00077 { 00078 public: 00091 ParsedFunction (const unsigned int n_components = 1, const double h=1e-8); 00092 00121 static void declare_parameters(ParameterHandler &prm, 00122 const unsigned int n_components = 1); 00123 00216 void parse_parameters(ParameterHandler &prm); 00217 00222 virtual void vector_value (const Point<dim> &p, 00223 Vector<double> &values) const; 00224 00236 virtual double value (const Point< dim > & p, 00237 const unsigned int component = 0) const; 00238 00249 virtual void set_time(const double newtime); 00250 00251 private: 00256 FunctionParser<dim> function_object; 00257 }; 00258 } 00259 00260 DEAL_II_NAMESPACE_CLOSE 00261 00262 #endif 00263
documentation generated on Wed May 23 2012 06:07:31 by
doxygen
1.7.3