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