Reference documentation for deal.II version 8.5.1
fe_data.cc
1 // ---------------------------------------------------------------------
2 //
3 // Copyright (C) 2001 - 2016 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 #include <deal.II/base/geometry_info.h>
17 #include <deal.II/fe/fe.h>
18 
19 DEAL_II_NAMESPACE_OPEN
20 
21 template <int dim>
23 FiniteElementData (const std::vector<unsigned int> &dofs_per_object,
24  const unsigned int n_components,
25  const unsigned int degree,
26  const Conformity conformity,
27  const BlockIndices &block_indices)
28  :
29  dofs_per_vertex(dofs_per_object[0]),
30  dofs_per_line(dofs_per_object[1]),
31  dofs_per_quad(dim>1? dofs_per_object[2]:0),
32  dofs_per_hex(dim>2? dofs_per_object[3]:0),
33  first_line_index(GeometryInfo<dim>::vertices_per_cell
34  * dofs_per_vertex),
35  first_quad_index(first_line_index+
36  GeometryInfo<dim>::lines_per_cell
37  * dofs_per_line),
38  first_hex_index(first_quad_index+
39  GeometryInfo<dim>::quads_per_cell
40  * dofs_per_quad),
41  first_face_line_index(GeometryInfo<dim-1>::vertices_per_cell
42  * dofs_per_vertex),
43  first_face_quad_index((dim==3 ?
44  GeometryInfo<dim-1>::vertices_per_cell
45  * dofs_per_vertex :
46  GeometryInfo<dim>::vertices_per_cell
47  * dofs_per_vertex) +
48  GeometryInfo<dim-1>::lines_per_cell
49  * dofs_per_line),
50  dofs_per_face(GeometryInfo<dim>::vertices_per_face * dofs_per_vertex +
51  GeometryInfo<dim>::lines_per_face * dofs_per_line +
52  GeometryInfo<dim>::quads_per_face *dofs_per_quad),
53  dofs_per_cell (GeometryInfo<dim>::vertices_per_cell * dofs_per_vertex +
54  GeometryInfo<dim>::lines_per_cell * dofs_per_line +
55  GeometryInfo<dim>::quads_per_cell * dofs_per_quad +
56  GeometryInfo<dim>::hexes_per_cell *dofs_per_hex),
57  components(n_components),
58  degree(degree),
59  conforming_space(conformity),
60  block_indices_data(block_indices.size() == 0
61  ?
62  BlockIndices(1, dofs_per_cell)
63  :
64  block_indices)
65 {
66  Assert(dofs_per_object.size()==dim+1, ExcDimensionMismatch(dofs_per_object.size()-1,dim));
67 }
68 
69 
70 
71 template<int dim>
73 {
74  return ((dofs_per_vertex == f.dofs_per_vertex) &&
75  (dofs_per_line == f.dofs_per_line) &&
76  (dofs_per_quad == f.dofs_per_quad) &&
77  (dofs_per_hex == f.dofs_per_hex) &&
78  (components == f.components) &&
79  (degree == f.degree) &&
80  (conforming_space == f.conforming_space));
81 }
82 
83 
84 template class FiniteElementData<1>;
85 template class FiniteElementData<2>;
86 template class FiniteElementData<3>;
87 
88 DEAL_II_NAMESPACE_CLOSE
const unsigned int components
Definition: fe_base.h:305
const unsigned int dofs_per_quad
Definition: fe_base.h:250
const unsigned int degree
Definition: fe_base.h:311
const unsigned int dofs_per_line
Definition: fe_base.h:244
bool operator==(const FiniteElementData &) const
Definition: fe_data.cc:72
const unsigned int dofs_per_hex
Definition: fe_base.h:256
#define Assert(cond, exc)
Definition: exceptions.h:313
static ::ExceptionBase & ExcDimensionMismatch(std::size_t arg1, std::size_t arg2)
FiniteElementData(const std::vector< unsigned int > &dofs_per_object, const unsigned int n_components, const unsigned int degree, const Conformity conformity=unknown, const BlockIndices &block_indices=BlockIndices())
Definition: fe_data.cc:23
const Conformity conforming_space
Definition: fe_base.h:316
const unsigned int dofs_per_vertex
Definition: fe_base.h:238
unsigned int n_components(const DoFHandler< dim, spacedim > &dh)