Reference documentation for deal.II version 9.2.0
\(\newcommand{\dealvcentcolon}{\mathrel{\mathop{:}}}\) \(\newcommand{\dealcoloneq}{\dealvcentcolon\mathrel{\mkern-1.2mu}=}\) \(\newcommand{\jump}[1]{\left[\!\left[ #1 \right]\!\right]}\) \(\newcommand{\average}[1]{\left\{\!\left\{ #1 \right\}\!\right\}}\)
fe_update_flags.h
Go to the documentation of this file.
1 // ---------------------------------------------------------------------
2 //
3 // Copyright (C) 1998 - 2019 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.md at
12 // the top level directory of deal.II.
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 
23 #include <deal.II/base/point.h>
24 #include <deal.II/base/table.h>
25 #include <deal.II/base/tensor.h>
26 
27 #include <vector>
28 
29 
31 
32 // Forward declaration
33 #ifndef DOXYGEN
34 template <int, int>
35 class FiniteElement;
36 #endif
37 
40 
67 {
71 
78  update_values = 0x0001,
80 
84  update_gradients = 0x0002,
86 
90  update_hessians = 0x0004,
92 
98 
105 
124 
131 
146 
152 
157 
163 
170 
177 
183 
189 
225 
233  // Direct data
241  // Transformation dependence
244  // Volume data
246 };
247 
248 
254 template <class StreamType>
255 inline StreamType &
256 operator<<(StreamType &s, const UpdateFlags u)
257 {
258  s << " UpdateFlags|";
259  if (u & update_values)
260  s << "values|";
261  if (u & update_gradients)
262  s << "gradients|";
263  if (u & update_hessians)
264  s << "hessians|";
265  if (u & update_3rd_derivatives)
266  s << "3rd_derivatives|";
267  if (u & update_quadrature_points)
268  s << "quadrature_points|";
269  if (u & update_JxW_values)
270  s << "JxW_values|";
271  if (u & update_normal_vectors)
272  s << "normal_vectors|";
273  if (u & update_jacobians)
274  s << "jacobians|";
275  if (u & update_inverse_jacobians)
276  s << "inverse_jacobians|";
277  if (u & update_jacobian_grads)
278  s << "jacobian_grads|";
280  s << "covariant_transformation|";
282  s << "contravariant_transformation|";
284  s << "transformation_values|";
286  s << "transformation_gradients|";
288  s << "jacobian_pushed_forward_grads|";
290  s << "jacobian_2nd_derivatives|";
292  s << "jacobian_pushed_forward_2nd_derivatives|";
294  s << "jacobian_3rd_derivatives|";
296  s << "jacobian_pushed_forward_3rd_derivatives|";
297 
298  // TODO: check that 'u' really only has the flags set that are handled above
299  return s;
300 }
301 
302 
312 inline UpdateFlags
313 operator|(const UpdateFlags f1, const UpdateFlags f2)
314 {
315  return static_cast<UpdateFlags>(static_cast<unsigned int>(f1) |
316  static_cast<unsigned int>(f2));
317 }
318 
319 
320 
327 inline UpdateFlags &
329 {
330  f1 = f1 | f2;
331  return f1;
332 }
333 
334 
344 inline UpdateFlags operator&(const UpdateFlags f1, const UpdateFlags f2)
345 {
346  return static_cast<UpdateFlags>(static_cast<unsigned int>(f1) &
347  static_cast<unsigned int>(f2));
348 }
349 
350 
357 inline UpdateFlags &
359 {
360  f1 = f1 & f2;
361  return f1;
362 }
363 
364 
365 
376 namespace CellSimilarity
377 {
379  {
397  };
398 }
399 
400 
401 namespace internal
402 {
403  namespace FEValuesImplementation
404  {
417  template <int dim, int spacedim = dim>
419  {
420  public:
424  void
425  initialize(const unsigned int n_quadrature_points,
426  const UpdateFlags flags);
427 
432  std::size_t
433  memory_consumption() const;
434 
448  std::vector<double> JxW_values;
449 
453  std::vector<DerivativeForm<1, dim, spacedim>> jacobians;
454 
459  std::vector<DerivativeForm<2, dim, spacedim>> jacobian_grads;
460 
464  std::vector<DerivativeForm<1, spacedim, dim>> inverse_jacobians;
465 
470  std::vector<Tensor<3, spacedim>> jacobian_pushed_forward_grads;
471 
476  std::vector<DerivativeForm<3, dim, spacedim>> jacobian_2nd_derivatives;
477 
482  std::vector<Tensor<4, spacedim>> jacobian_pushed_forward_2nd_derivatives;
483 
488  std::vector<DerivativeForm<4, dim, spacedim>> jacobian_3rd_derivatives;
489 
494  std::vector<Tensor<5, spacedim>> jacobian_pushed_forward_3rd_derivatives;
495 
501  std::vector<Point<spacedim>> quadrature_points;
502 
506  std::vector<Tensor<1, spacedim>> normal_vectors;
507 
511  std::vector<Tensor<1, spacedim>> boundary_forms;
512  };
513 
514 
523  template <int dim, int spacedim = dim>
525  {
526  public:
530  void
531  initialize(const unsigned int n_quadrature_points,
533  const UpdateFlags flags);
534 
539  std::size_t
540  memory_consumption() const;
541 
561 
567 
572 
577 
584 
591 
598 
605 
635  std::vector<unsigned int> shape_function_to_row_table;
636  };
637  } // namespace FEValuesImplementation
638 } // namespace internal
639 
640 
646 
647 #endif
internal::FEValuesImplementation::MappingRelatedData::normal_vectors
std::vector< Tensor< 1, spacedim > > normal_vectors
Definition: fe_update_flags.h:506
derivative_form.h
internal::FEValuesImplementation::MappingRelatedData::inverse_jacobians
std::vector< DerivativeForm< 1, spacedim, dim > > inverse_jacobians
Definition: fe_update_flags.h:464
internal::FEValuesImplementation::MappingRelatedData::memory_consumption
std::size_t memory_consumption() const
Definition: fe_values.cc:2978
internal::FEValuesImplementation::FiniteElementRelatedData::shape_gradients
GradientVector shape_gradients
Definition: fe_update_flags.h:590
update_quadrature_points
@ update_quadrature_points
Transformed quadrature points.
Definition: fe_update_flags.h:122
update_jacobian_pushed_forward_3rd_derivatives
@ update_jacobian_pushed_forward_3rd_derivatives
Definition: fe_update_flags.h:215
internal::FEValuesImplementation::FiniteElementRelatedData::shape_hessians
HessianVector shape_hessians
Definition: fe_update_flags.h:597
internal::FEValuesImplementation::FiniteElementRelatedData
Definition: fe_update_flags.h:524
update_q_points
@ update_q_points
Definition: fe_update_flags.h:219
internal::FEValuesImplementation::FiniteElementRelatedData::memory_consumption
std::size_t memory_consumption() const
Definition: fe_values.cc:3058
internal::FEValuesImplementation::MappingRelatedData::jacobian_3rd_derivatives
std::vector< DerivativeForm< 4, dim, spacedim > > jacobian_3rd_derivatives
Definition: fe_update_flags.h:488
internal::FEValuesImplementation::MappingRelatedData
Definition: fe_update_flags.h:418
update_3rd_derivatives
@ update_3rd_derivatives
Third derivatives of shape functions.
Definition: fe_update_flags.h:96
update_default
@ update_default
No update.
Definition: fe_update_flags.h:69
update_transformation_values
@ update_transformation_values
Shape function values of transformation.
Definition: fe_update_flags.h:181
CellSimilarity::translation
@ translation
Definition: fe_update_flags.h:388
internal::FEValuesImplementation::MappingRelatedData::jacobians
std::vector< DerivativeForm< 1, dim, spacedim > > jacobians
Definition: fe_update_flags.h:453
internal::FEValuesImplementation::MappingRelatedData::JxW_values
std::vector< double > JxW_values
Definition: fe_update_flags.h:448
operator|
UpdateFlags operator|(const UpdateFlags f1, const UpdateFlags f2)
Definition: fe_update_flags.h:313
CellSimilarity::Similarity
Similarity
Definition: fe_update_flags.h:378
operator|=
UpdateFlags & operator|=(UpdateFlags &f1, const UpdateFlags f2)
Definition: fe_update_flags.h:328
update_values
@ update_values
Shape function values.
Definition: fe_update_flags.h:78
internal::FEValuesImplementation::MappingRelatedData::jacobian_pushed_forward_3rd_derivatives
std::vector< Tensor< 5, spacedim > > jacobian_pushed_forward_3rd_derivatives
Definition: fe_update_flags.h:494
Table< 2, double >
update_jacobian_pushed_forward_grads
@ update_jacobian_pushed_forward_grads
Definition: fe_update_flags.h:197
internal::FEValuesImplementation::MappingRelatedData::jacobian_grads
std::vector< DerivativeForm< 2, dim, spacedim > > jacobian_grads
Definition: fe_update_flags.h:459
update_piola
@ update_piola
Values needed for Piola transform.
Definition: fe_update_flags.h:228
internal::FEValuesImplementation::FiniteElementRelatedData::initialize
void initialize(const unsigned int n_quadrature_points, const FiniteElement< dim, spacedim > &fe, const UpdateFlags flags)
Definition: fe_values.cc:3001
update_cell_normal_vectors
@ update_cell_normal_vectors
Definition: fe_update_flags.h:144
internal::FEValuesImplementation::MappingRelatedData::jacobian_pushed_forward_grads
std::vector< Tensor< 3, spacedim > > jacobian_pushed_forward_grads
Definition: fe_update_flags.h:470
internal::FEValuesImplementation::FiniteElementRelatedData::shape_3rd_derivatives
ThirdDerivativeVector shape_3rd_derivatives
Definition: fe_update_flags.h:604
tensor.h
update_face_normal_vectors
@ update_face_normal_vectors
Definition: fe_update_flags.h:140
internal::FEValuesImplementation::FiniteElementRelatedData::shape_function_to_row_table
std::vector< unsigned int > shape_function_to_row_table
Definition: fe_update_flags.h:635
update_covariant_transformation
@ update_covariant_transformation
Covariant transformation.
Definition: fe_update_flags.h:168
update_mapping
@ update_mapping
Definition: fe_update_flags.h:232
CellSimilarity
Definition: fe_update_flags.h:376
internal::FEValuesImplementation::FiniteElementRelatedData::shape_values
ShapeVector shape_values
Definition: fe_update_flags.h:583
DEAL_II_NAMESPACE_OPEN
#define DEAL_II_NAMESPACE_OPEN
Definition: config.h:358
update_jacobians
@ update_jacobians
Volume element.
Definition: fe_update_flags.h:150
update_gradients
@ update_gradients
Shape function gradients.
Definition: fe_update_flags.h:84
DEAL_II_DEPRECATED
#define DEAL_II_DEPRECATED
Definition: config.h:98
internal::FEValuesImplementation::MappingRelatedData::initialize
void initialize(const unsigned int n_quadrature_points, const UpdateFlags flags)
Definition: fe_values.cc:2917
update_jacobian_pushed_forward_2nd_derivatives
@ update_jacobian_pushed_forward_2nd_derivatives
Definition: fe_update_flags.h:206
update_second_derivatives
@ update_second_derivatives
Definition: fe_update_flags.h:223
internal::FEValuesImplementation::MappingRelatedData::boundary_forms
std::vector< Tensor< 1, spacedim > > boundary_forms
Definition: fe_update_flags.h:511
update_jacobian_3rd_derivatives
@ update_jacobian_3rd_derivatives
Definition: fe_update_flags.h:210
FiniteElement
Definition: fe.h:648
UpdateFlags
UpdateFlags
Definition: fe_update_flags.h:66
operator&=
UpdateFlags & operator&=(UpdateFlags &f1, const UpdateFlags f2)
Definition: fe_update_flags.h:358
operator&
UpdateFlags operator&(const UpdateFlags f1, const UpdateFlags f2)
Definition: fe_update_flags.h:344
update_jacobian_grads
@ update_jacobian_grads
Gradient of volume element.
Definition: fe_update_flags.h:155
update_JxW_values
@ update_JxW_values
Transformed quadrature weights.
Definition: fe_update_flags.h:129
update_normal_vectors
@ update_normal_vectors
Normal vectors.
Definition: fe_update_flags.h:136
CellSimilarity::invalid_next_cell
@ invalid_next_cell
Definition: fe_update_flags.h:396
update_hessians
@ update_hessians
Second derivatives of shape functions.
Definition: fe_update_flags.h:90
update_transformation_gradients
@ update_transformation_gradients
Shape function gradients of transformation.
Definition: fe_update_flags.h:187
Algorithms::OutputOperator::operator<<
OutputOperator< VectorType > & operator<<(OutputOperator< VectorType > &out, unsigned int step)
Definition: operator.h:173
CellSimilarity::inverted_translation
@ inverted_translation
Definition: fe_update_flags.h:392
internal::FEValuesImplementation::MappingRelatedData::jacobian_pushed_forward_2nd_derivatives
std::vector< Tensor< 4, spacedim > > jacobian_pushed_forward_2nd_derivatives
Definition: fe_update_flags.h:482
update_inverse_jacobians
@ update_inverse_jacobians
Volume element.
Definition: fe_update_flags.h:161
config.h
internal::FEValuesImplementation::MappingRelatedData::jacobian_2nd_derivatives
std::vector< DerivativeForm< 3, dim, spacedim > > jacobian_2nd_derivatives
Definition: fe_update_flags.h:476
internal::FEValuesImplementation::MappingRelatedData::quadrature_points
std::vector< Point< spacedim > > quadrature_points
Definition: fe_update_flags.h:501
internal
Definition: aligned_vector.h:369
DEAL_II_NAMESPACE_CLOSE
#define DEAL_II_NAMESPACE_CLOSE
Definition: config.h:359
update_volume_elements
@ update_volume_elements
Determinant of the Jacobian.
Definition: fe_update_flags.h:192
update_contravariant_transformation
@ update_contravariant_transformation
Contravariant transformation.
Definition: fe_update_flags.h:175
CellSimilarity::none
@ none
Definition: fe_update_flags.h:384
table.h
update_boundary_forms
@ update_boundary_forms
Outer normal vector, not normalized.
Definition: fe_update_flags.h:103
point.h
update_jacobian_2nd_derivatives
@ update_jacobian_2nd_derivatives
Definition: fe_update_flags.h:201