include/deal.II/base/tensor_function.h

00001 //---------------------------------------------------------------------------
00002 //    @f$Id: tensor_function.h 25345 2012-03-31 08:37:04Z bangerth @f$
00003 //
00004 //    Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 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 #ifndef __deal2__tensor_function_h
00013 #define __deal2__tensor_function_h
00014 
00015 
00016 #include <deal.II/base/config.h>
00017 #include <deal.II/base/exceptions.h>
00018 #include <deal.II/base/subscriptor.h>
00019 #include <deal.II/base/smartpointer.h>
00020 #include <deal.II/base/function.h>
00021 #include <deal.II/base/point.h>
00022 #include <deal.II/base/function_time.h>
00023 
00024 #include <vector>
00025 
00026 DEAL_II_NAMESPACE_OPEN
00027 
00054 template <int rank, int dim>
00055 class TensorFunction : public FunctionTime,
00056                        public Subscriptor
00057 {
00058   public:
00064     typedef Tensor<rank,dim> value_type;
00065 
00066 #ifdef DEAL_II_LOCAL_TYPEDEF_COMP_WORKAROUND
00067 
00086     template <int dim2>
00087     struct GradientTypeHelper
00088     {
00089         typedef Tensor<rank+1,dim> type;
00090     };
00091 
00104     typedef typename GradientTypeHelper<dim>::type gradient_type;
00105 #else
00106     typedef Tensor<rank+1,dim> gradient_type;
00107 #endif
00108 
00115     TensorFunction (const double initial_time = 0.0);
00116 
00125     virtual ~TensorFunction ();
00126 
00131     virtual value_type value (const Point<dim> &p) const;
00132 
00141     virtual void value_list (const std::vector<Point<dim> > &points,
00142                              std::vector<value_type> &values) const;
00143 
00148     virtual gradient_type gradient (const Point<dim> &p) const;
00149 
00158     virtual void gradient_list (const std::vector<Point<dim> >   &points,
00159                                 std::vector<gradient_type> &gradients) const;
00160 
00164     DeclException0 (ExcPureFunctionCalled);
00168     DeclException2 (ExcVectorHasWrongSize,
00169                     int, int,
00170                     << "The vector has size " << arg1 << " but should have "
00171                     << arg2 << " elements.");
00172 
00173 };
00174 
00175 DEAL_II_NAMESPACE_CLOSE
00176 
00177 #endif
00178 
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines

deal.II documentation generated on Wed May 23 2012 12:03:21 by doxygen 1.7.3