Reference documentation for deal.II version 8.1.0
patches.h
1 // ---------------------------------------------------------------------
2 // @f$Id: patches.h 30036 2013-07-18 16:55:32Z maier @f$
3 //
4 // Copyright (C) 2010 - 2013 by the deal.II authors
5 //
6 // This file is part of the deal.II library.
7 //
8 // The deal.II library is free software; you can use it, redistribute
9 // it, and/or modify it under the terms of the GNU Lesser General
10 // Public License as published by the Free Software Foundation; either
11 // version 2.1 of the License, or (at your option) any later version.
12 // The full text of the license can be found in the file LICENSE at
13 // the top level of the deal.II distribution.
14 //
15 // ---------------------------------------------------------------------
16 
17 #ifndef __deal2__integrators_patches_h
18 #define __deal2__integrators_patches_h
19 
20 
21 #include <deal.II/base/config.h>
23 #include <deal.II/base/quadrature.h>
24 #include <deal.II/fe/mapping.h>
25 #include <deal.II/fe/fe_values.h>
26 #include <deal.II/meshworker/dof_info.h>
27 
29 
30 namespace LocalIntegrators
31 {
38  namespace Patches
39  {
40  template <int dim>
41  inline
42  void
43  points_and_values(
44  Table<2, double> &result,
45  const FEValuesBase<dim> &fe,
46  const VectorSlice<const std::vector<std::vector<double> > > &input)
47  {
48  const unsigned int n_comp = fe.get_fe().n_components();
50  AssertDimension(result.n_rows(), fe.n_quadrature_points);
51  AssertDimension(result.n_cols(), n_comp+dim);
52 
53  for (unsigned int k=0; k<fe.n_quadrature_points; ++k)
54  {
55  for (unsigned int d=0; d<dim; ++d)
56  result(k,d) = fe.quadrature_point(k)[d];
57  for (unsigned int i=0; i<n_comp; ++i)
58  result(k,dim+i) = input[i][k];
59  }
60  }
61  }
62 }
63 
64 DEAL_II_NAMESPACE_CLOSE
65 
66 #endif
#define AssertDimension(dim1, dim2)
Definition: exceptions.h:858
#define AssertVectorVectorDimension(vec, dim1, dim2)
Definition: exceptions.h:870
const Point< spacedim > & quadrature_point(const unsigned int i) const
Library of integrals over cells and faces.
Definition: laplace.h:31
const unsigned int n_quadrature_points
Definition: fe_values.h:1411
const FiniteElement< dim, spacedim > & get_fe() const