include/deal.II/base/polynomials_bdm.h

00001 //---------------------------------------------------------------------------
00002 //    @f$Id: polynomials_bdm.h 25345 2012-03-31 08:37:04Z bangerth @f$
00003 //
00004 //    Copyright (C) 2004, 2005, 2006, 2009, 2010, 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__polynomials_BDM_h
00013 #define __deal2__polynomials_BDM_h
00014 
00015 
00016 #include <deal.II/base/config.h>
00017 #include <deal.II/base/exceptions.h>
00018 #include <deal.II/base/tensor.h>
00019 #include <deal.II/base/point.h>
00020 #include <deal.II/base/polynomial.h>
00021 #include <deal.II/base/polynomial_space.h>
00022 #include <deal.II/base/table.h>
00023 #include <deal.II/base/thread_management.h>
00024 
00025 #include <vector>
00026 
00027 DEAL_II_NAMESPACE_OPEN
00028 
00057 template <int dim>
00058 class PolynomialsBDM
00059 {
00060   public:
00073     PolynomialsBDM (const unsigned int k);
00074 
00099     void compute (const Point<dim>            &unit_point,
00100                   std::vector<Tensor<1,dim> > &values,
00101                   std::vector<Tensor<2,dim> > &grads,
00102                   std::vector<Tensor<3,dim> > &grad_grads) const;
00103 
00107     unsigned int n () const;
00108 
00114     unsigned int degree () const;
00115 
00120     std::string name () const;
00121 
00131     static unsigned int compute_n_pols(unsigned int degree);
00132 
00133   private:
00140     const PolynomialSpace<dim> polynomial_space;
00141 
00149     std::vector<Polynomials::Polynomial<double> > monomials;
00150 
00155     unsigned int n_pols;
00156 
00161     mutable Threads::Mutex mutex;
00162 
00166     mutable std::vector<double> p_values;
00167 
00171     mutable std::vector<Tensor<1,dim> > p_grads;
00172 
00176     mutable std::vector<Tensor<2,dim> > p_grad_grads;
00177 };
00178 
00179 
00180 template <int dim>
00181 inline unsigned int
00182 PolynomialsBDM<dim>::n() const
00183 {
00184   return n_pols;
00185 }
00186 
00187 
00188 template <int dim>
00189 inline unsigned int
00190 PolynomialsBDM<dim>::degree() const
00191 {
00192   return polynomial_space.degree();
00193 }
00194 
00195 
00196 template <int dim>
00197 inline std::string
00198 PolynomialsBDM<dim>::name() const
00199 {
00200   return "BDM";
00201 }
00202 
00203 
00204 DEAL_II_NAMESPACE_CLOSE
00205 
00206 #endif
00207 
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines

deal.II documentation generated on Wed May 23 2012 06:07:31 by doxygen 1.7.3