diff --git a/common/function.hh b/common/function.hh index 5aea3c559f65d327373e97c0e3dccbe0ac6147b2..616697265f6f42698e054993f180e2c937bd8e63 100644 --- a/common/function.hh +++ b/common/function.hh @@ -8,6 +8,8 @@ namespace Dune { + typedef int deriType; + template< class FunctionSpaceType, class FunctionImp> class Function : public Mapping <typename FunctionSpaceType::RangeField , typename FunctionSpaceType::Domain, typename FunctionSpaceType::Range > { @@ -21,7 +23,13 @@ namespace Dune { Function ( FunctionSpaceType & f ) : functionSpace_ (f) {} ; - void evaluate ( const Domain & , Range &) const ; + //! evaluate Function + void eval ( const Domain & , Range &) const ; + + //! evaluate function and derivatives + template <int derivation> + void evaluate ( const Vec<derivation,deriType> &diffVariable, + const Domain & , Range &) const {}; FunctionSpaceType &getFunctionSpace() const { return functionSpace_; } diff --git a/common/functionspace.hh b/common/functionspace.hh index f70d18a6f59823255cf2b47014884e5074d7f0d2..1772f405acb915ea46491034c649e2443e2a8f1f 100644 --- a/common/functionspace.hh +++ b/common/functionspace.hh @@ -12,8 +12,8 @@ namespace Dune { class FunctionSpace : public DynamicType { public: - typedef DomainFieldType DomainField ; - typedef RangeFieldType RangeField ; + typedef DomainFieldType DomainField; + typedef RangeFieldType RangeField; typedef Mat < n, m, RangeField> JacobianRange; typedef Vec < m, Mat< n, n, RangeField> > HessianRange ; diff --git a/common/misc.hh b/common/misc.hh index b924c80dd7a2bda5737755476e777be08f1dc15e..231fe55d03359d0e84acfb5959943fb4cc559624 100644 --- a/common/misc.hh +++ b/common/misc.hh @@ -6,8 +6,6 @@ #include <iostream> #include <math.h> - - //! Check condition at compilation time template <bool flag> class CompileTimeChecker; @@ -29,6 +27,19 @@ namespace Dune { return t; } + template<class T> + T MAX (T t1, T t2) + { + if (t1<t2) return t2; + return t1; + } + + template<class T> + T MIN (T t1, T t2) + { + if (t1<t2) return t1; + return t2; + } template <class T> T* realloc(T* & pointer, int size) {