/usr/include/deal.II/matrix_free/shape_info.h is in libdeal.ii-dev 8.4.2-2+b1.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 | // ---------------------------------------------------------------------
//
// Copyright (C) 2011 - 2015 by the deal.II authors
//
// This file is part of the deal.II library.
//
// The deal.II library is free software; you can use it, redistribute
// it, and/or modify it under the terms of the GNU Lesser General
// Public License as published by the Free Software Foundation; either
// version 2.1 of the License, or (at your option) any later version.
// The full text of the license can be found in the file LICENSE at
// the top level of the deal.II distribution.
//
// ---------------------------------------------------------------------
#ifndef dealii__matrix_free_shape_info_h
#define dealii__matrix_free_shape_info_h
#include <deal.II/base/exceptions.h>
#include <deal.II/base/quadrature_lib.h>
#include <deal.II/base/vectorization.h>
#include <deal.II/base/aligned_vector.h>
#include <deal.II/fe/fe.h>
#include <deal.II/matrix_free/helper_functions.h>
DEAL_II_NAMESPACE_OPEN
namespace internal
{
namespace MatrixFreeFunctions
{
/**
* An enum that encodes the type of element detected during
* initialization. FEEvaluation will select the most efficient algorithm
* based on the given element type.
*/
enum ElementType
{
tensor_general,
tensor_symmetric,
truncated_tensor,
tensor_symmetric_plus_dg0,
tensor_gausslobatto
};
/**
* The class that stores the shape functions, gradients and Hessians
* evaluated for a tensor product finite element and tensor product
* quadrature formula on the unit cell. Because of this structure, only
* one-dimensional data is stored.
*
* @author Katharina Kormann and Martin Kronbichler, 2010, 2011
*/
template <typename Number>
struct ShapeInfo
{
/**
* Empty constructor. Does nothing.
*/
ShapeInfo ();
/**
* Constructor that initializes the data fields using the reinit method.
*/
template <int dim>
ShapeInfo (const Quadrature<1> &quad,
const FiniteElement<dim> &fe,
const unsigned int base_element = 0);
/**
* Initializes the data fields. Takes a one-dimensional quadrature
* formula and a finite element as arguments and evaluates the shape
* functions, gradients and Hessians on the one-dimensional unit cell.
* This function assumes that the finite element is derived from a one-
* dimensional element by a tensor product and that the zeroth shape
* function in zero evaluates to one.
*/
template <int dim>
void reinit (const Quadrature<1> &quad,
const FiniteElement<dim> &fe_dim,
const unsigned int base_element = 0);
/**
* Returns the memory consumption of this class in bytes.
*/
std::size_t memory_consumption () const;
/**
* Encodes the type of element detected at construction. FEEvaluation
* will select the most efficient algorithm based on the given element
* type.
*/
ElementType element_type;
/**
* Stores the shape values of the 1D finite element evaluated on all 1D
* quadrature points in vectorized format, i.e., as an array of
* VectorizedArray<dim>::n_array_elements equal elements. The length of
* this array is <tt>n_dofs_1d * n_q_points_1d</tt> and quadrature
* points are the index running fastest.
*/
AlignedVector<VectorizedArray<Number> > shape_values;
/**
* Stores the shape gradients of the 1D finite element evaluated on all
* 1D quadrature points in vectorized format, i.e., as an array of
* VectorizedArray<dim>::n_array_elements equal elements. The length of
* this array is <tt>n_dofs_1d * n_q_points_1d</tt> and quadrature
* points are the index running fastest.
*/
AlignedVector<VectorizedArray<Number> > shape_gradients;
/**
* Stores the shape Hessians of the 1D finite element evaluated on all
* 1D quadrature points in vectorized format, i.e., as an array of
* VectorizedArray<dim>::n_array_elements equal elements. The length of
* this array is <tt>n_dofs_1d * n_q_points_1d</tt> and quadrature
* points are the index running fastest.
*/
AlignedVector<VectorizedArray<Number> > shape_hessians;
/**
* Stores the shape values in a different format, namely the so-called
* even-odd scheme where the symmetries in shape_values are used for
* faster evaluation.
*/
AlignedVector<VectorizedArray<Number> > shape_val_evenodd;
/**
* Stores the shape gradients in a different format, namely the so-
* called even-odd scheme where the symmetries in shape_gradients are
* used for faster evaluation.
*/
AlignedVector<VectorizedArray<Number> > shape_gra_evenodd;
/**
* Stores the shape second derivatives in a different format, namely the
* so-called even-odd scheme where the symmetries in shape_hessians are
* used for faster evaluation.
*/
AlignedVector<VectorizedArray<Number> > shape_hes_evenodd;
/**
* Stores the indices from cell DoFs to face DoFs. The rows go through
* the <tt>2*dim</tt> faces, and the columns the DoFs on the faces.
*/
dealii::Table<2,unsigned int> face_indices;
/**
* Stores one-dimensional values of shape functions evaluated in zero
* and one, i.e., on the one-dimensional faces. Not vectorized.
*/
std::vector<Number> face_value[2];
/**
* Stores one-dimensional gradients of shape functions evaluated in zero
* and one, i.e., on the one-dimensional faces. Not vectorized.
*/
std::vector<Number> face_gradient[2];
/**
* Stores one-dimensional values of shape functions on subface. Since
* there are two subfaces, store two variants. Not vectorized.
*/
std::vector<Number> subface_value[2];
/**
* Non-vectorized version of shape values. Needed when evaluating face
* info.
*/
std::vector<Number> shape_values_number;
/**
* Non-vectorized version of shape gradients. Needed when evaluating
* face info.
*/
std::vector<Number> shape_gradient_number;
/**
* Renumbering from deal.II's numbering of cell degrees of freedom to
* lexicographic numbering used inside the FEEvaluation schemes of the
* underlying element in the DoFHandler. For vector-valued elements, the
* renumbering starts with a lexicographic numbering of the first
* component, then everything of the second component, and so on.
*/
std::vector<unsigned int> lexicographic_numbering;
/**
* Stores the degree of the element.
*/
unsigned int fe_degree;
/**
* Stores the number of quadrature points in @p dim dimensions for a
* cell.
*/
unsigned int n_q_points;
/**
* Stores the number of DoFs per cell in @p dim dimensions.
*/
unsigned int dofs_per_cell;
/**
* Stores the number of quadrature points per face in @p dim dimensions.
*/
unsigned int n_q_points_face;
/**
* Stores the number of DoFs per face in @p dim dimensions.
*/
unsigned int dofs_per_face;
/**
* Checks whether we have symmetries in the shape values. In that case,
* also fill the shape_???_evenodd fields.
*/
bool check_1d_shapes_symmetric(const unsigned int n_q_points_1d);
/**
* Checks whether symmetric 1D basis functions are such that the shape
* values form a diagonal matrix, which allows to use specialized
* algorithms that save some operations.
*/
bool check_1d_shapes_gausslobatto();
};
// ------------------------------------------ inline functions
template <typename Number>
template <int dim>
inline
ShapeInfo<Number>::ShapeInfo (const Quadrature<1> &quad,
const FiniteElement<dim> &fe_in,
const unsigned int base_element_number)
:
fe_degree (0),
n_q_points (0),
dofs_per_cell (0)
{
reinit (quad, fe_in, base_element_number);
}
} // end of namespace MatrixFreeFunctions
} // end of namespace internal
DEAL_II_NAMESPACE_CLOSE
#endif
|