include/deal.II/integrators/patches.h

00001 //---------------------------------------------------------------------------
00002 //    @f$Id: laplace.h 23983 2011-07-29 22:45:15Z kanschat @f$
00003 //
00004 //    Copyright (C) 2010, 2011, 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__integrators_patches_h
00013 #define __deal2__integrators_patches_h
00014 
00015 
00016 #include <deal.II/base/config.h>
00017 #include <deal.II/base/exceptions.h>
00018 #include <deal.II/base/quadrature.h>
00019 #include <deal.II/fe/mapping.h>
00020 #include <deal.II/fe/fe_values.h>
00021 #include <deal.II/meshworker/dof_info.h>
00022 
00023 DEAL_II_NAMESPACE_OPEN
00024 
00025 namespace LocalIntegrators
00026 {
00034   namespace Patches
00035   {
00036     template <int dim>
00037     inline
00038     void
00039     points_and_values(
00040       Table<2, double>& result,
00041       const FEValuesBase<dim>& fe,
00042       const VectorSlice<const std::vector<std::vector<double> > >& input)
00043     {
00044       const unsigned int n_comp = fe.get_fe().n_components();
00045       AssertVectorVectorDimension(input, n_comp, fe.n_quadrature_points);
00046       AssertDimension(result.n_rows(), fe.n_quadrature_points);
00047       AssertDimension(result.n_cols(), n_comp+dim);
00048 
00049       for (unsigned int k=0;k<fe.n_quadrature_points;++k)
00050         {
00051           for (unsigned int d=0;d<dim;++d)
00052             result(k,d) = fe.quadrature_point(k)[d];
00053           for (unsigned int i=0;i<n_comp;++i)
00054             result(k,dim+i) = input[i][k];
00055         }
00056     }
00057   }
00058 }
00059 
00060 DEAL_II_NAMESPACE_CLOSE
00061 
00062 #endif
00063 
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines

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