Reference documentation for deal.II version 8.4.2
fe_update_flags.h
1 // ---------------------------------------------------------------------
2 //
3 // Copyright (C) 1998 - 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 #ifndef dealii__fe_update_flags_h
17 #define dealii__fe_update_flags_h
18 
19 
20 #include <deal.II/base/config.h>
21 #include <deal.II/base/table.h>
22 #include <deal.II/base/derivative_form.h>
23 #include <deal.II/base/point.h>
24 #include <deal.II/base/tensor.h>
25 
26 #include <vector>
27 
28 
29 DEAL_II_NAMESPACE_OPEN
30 
31 template <int,int> class FiniteElement;
32 
33 
36 
63 {
67 
74  update_values = 0x0001,
76 
80  update_gradients = 0x0002,
82 
86  update_hessians = 0x0004,
88 
94 
101 
106 
113 
128 
134 
139 
145 
152 
159 
165 
171 
207 
211 };
212 
213 
219 template <class StreamType>
220 inline
221 StreamType &operator << (StreamType &s, UpdateFlags u)
222 {
223  s << " UpdateFlags|";
224  if (u & update_values) s << "values|";
225  if (u & update_gradients) s << "gradients|";
226  if (u & update_hessians) s << "hessians|";
227  if (u & update_3rd_derivatives) s << "3rd_derivatives|";
228  if (u & update_quadrature_points) s << "quadrature_points|";
229  if (u & update_JxW_values) s << "JxW_values|";
230  if (u & update_normal_vectors) s << "normal_vectors|";
231  if (u & update_jacobians) s << "jacobians|";
232  if (u & update_inverse_jacobians) s << "inverse_jacobians|";
233  if (u & update_jacobian_grads) s << "jacobian_grads|";
234  if (u & update_covariant_transformation) s << "covariant_transformation|";
235  if (u & update_contravariant_transformation) s << "contravariant_transformation|";
236  if (u & update_transformation_values) s << "transformation_values|";
237  if (u & update_transformation_gradients) s << "transformation_gradients|";
238  if (u & update_jacobian_pushed_forward_grads) s << "jacobian_pushed_forward_grads|";
239  if (u & update_jacobian_2nd_derivatives) s << "jacobian_2nd_derivatives|";
240  if (u & update_jacobian_pushed_forward_2nd_derivatives) s << "jacobian_pushed_forward_2nd_derivatives|";
241  if (u &update_jacobian_3rd_derivatives) s << "jacobian_3rd_derivatives|";
242  if (u & update_jacobian_pushed_forward_3rd_derivatives) s << "jacobian_pushed_forward_3rd_derivatives|";
243 
244 //TODO: check that 'u' really only has the flags set that are handled above
245  return s;
246 }
247 
248 
258 inline
261 {
262  return static_cast<UpdateFlags> (
263  static_cast<unsigned int> (f1) |
264  static_cast<unsigned int> (f2));
265 }
266 
267 
268 
269 
276 inline
277 UpdateFlags &
279 {
280  f1 = f1 | f2;
281  return f1;
282 }
283 
284 
294 inline
297 {
298  return static_cast<UpdateFlags> (
299  static_cast<unsigned int> (f1) &
300  static_cast<unsigned int> (f2));
301 }
302 
303 
310 inline
311 UpdateFlags &
313 {
314  f1 = f1 & f2;
315  return f1;
316 }
317 
318 
319 
330 namespace CellSimilarity
331 {
332  enum Similarity
333  {
334  none,
335  translation,
336  inverted_translation,
337  invalid_next_cell
338  };
339 }
340 
341 
342 namespace internal
343 {
344  namespace FEValues
345  {
358  template <int dim, int spacedim=dim>
360  {
361  public:
365  void initialize (const unsigned int n_quadrature_points,
366  const UpdateFlags flags);
367 
372  std::size_t memory_consumption () const;
373 
387  std::vector<double> JxW_values;
388 
392  std::vector< DerivativeForm<1,dim,spacedim> > jacobians;
393 
398  std::vector<DerivativeForm<2,dim,spacedim> > jacobian_grads;
399 
403  std::vector<DerivativeForm<1,spacedim,dim> > inverse_jacobians;
404 
409  std::vector<Tensor<3,spacedim> > jacobian_pushed_forward_grads;
410 
415  std::vector<DerivativeForm<3,dim,spacedim> > jacobian_2nd_derivatives;
416 
421  std::vector<Tensor<4,spacedim> > jacobian_pushed_forward_2nd_derivatives;
422 
427  std::vector<DerivativeForm<4,dim,spacedim> > jacobian_3rd_derivatives;
428 
433  std::vector<Tensor<5,spacedim> > jacobian_pushed_forward_3rd_derivatives;
434 
440  std::vector<Point<spacedim> > quadrature_points;
441 
445  std::vector<Tensor<1,spacedim> > normal_vectors;
446 
450  std::vector<Tensor<1,spacedim> > boundary_forms;
451  };
452 
453 
462  template <int dim, int spacedim=dim>
464  {
465  public:
469  void initialize (const unsigned int n_quadrature_points,
470  const FiniteElement<dim,spacedim> &fe,
471  const UpdateFlags flags);
472 
477  std::size_t memory_consumption () const;
478 
497  typedef ::Table<2,double> ShapeVector;
498 
503  typedef ::Table<2,Tensor<1,spacedim> > GradientVector;
504 
508  typedef ::Table<2,Tensor<2,spacedim> > HessianVector;
509 
513  typedef ::Table<2,Tensor<3,spacedim> > ThirdDerivativeVector;
514 
520  ShapeVector shape_values;
521 
527  GradientVector shape_gradients;
528 
534  HessianVector shape_hessians;
535 
541  ThirdDerivativeVector shape_3rd_derivatives;
542 
572  std::vector<unsigned int> shape_function_to_row_table;
573  };
574  }
575 }
576 
577 
582 DEAL_II_NAMESPACE_CLOSE
583 
584 #endif
Transformed quadrature weights.
Shape function values.
UpdateFlags & operator&=(UpdateFlags &f1, UpdateFlags f2)
Contravariant transformation.
Volume element.
Outer normal vector, not normalized.
Determinant of the Jacobian.
Transformed quadrature points.
std::vector< unsigned int > shape_function_to_row_table
std::vector< Tensor< 1, spacedim > > boundary_forms
std::vector< Tensor< 4, spacedim > > jacobian_pushed_forward_2nd_derivatives
::Table< 2, Tensor< 2, spacedim > > HessianVector
std::vector< DerivativeForm< 2, dim, spacedim > > jacobian_grads
Shape function gradients of transformation.
std::vector< Tensor< 3, spacedim > > jacobian_pushed_forward_grads
No update.
::Table< 2, Tensor< 3, spacedim > > ThirdDerivativeVector
Third derivatives of shape functions.
UpdateFlags
::Table< 2, Tensor< 1, spacedim > > GradientVector
std::vector< DerivativeForm< 1, dim, spacedim > > jacobians
std::vector< Tensor< 1, spacedim > > normal_vectors
Shape function values of transformation.
UpdateFlags operator|(UpdateFlags f1, UpdateFlags f2)
Second derivatives of shape functions.
Gradient of volume element.
UpdateFlags operator&(UpdateFlags f1, UpdateFlags f2)
std::vector< Tensor< 5, spacedim > > jacobian_pushed_forward_3rd_derivatives
OutputOperator< VectorType > & operator<<(OutputOperator< VectorType > &out, unsigned int step)
Definition: operator.h:154
std::vector< DerivativeForm< 4, dim, spacedim > > jacobian_3rd_derivatives
Shape function gradients.
std::vector< Point< spacedim > > quadrature_points
Normal vectors.
Definition: fe.h:31
UpdateFlags & operator|=(UpdateFlags &f1, UpdateFlags f2)
std::vector< DerivativeForm< 1, spacedim, dim > > inverse_jacobians
std::vector< DerivativeForm< 3, dim, spacedim > > jacobian_2nd_derivatives
Values needed for Piola transform.
Covariant transformation.