Reference documentation for deal.II version 9.1.1
\(\newcommand{\dealcoloneq}{\mathrel{\vcenter{:}}=}\)
fe_update_flags.h
1 // ---------------------------------------------------------------------
2 //
3 // Copyright (C) 1998 - 2018 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 
22 #include <deal.II/base/derivative_form.h>
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 
30 DEAL_II_NAMESPACE_OPEN
31 
32 template <int, int>
33 class FiniteElement;
34 
35 
38 
64 enum UpdateFlags
65 {
67  update_default = 0,
69 
76  update_values = 0x0001,
78 
82  update_gradients = 0x0002,
84 
88  update_hessians = 0x0004,
90 
94  update_3rd_derivatives = 0x0008,
96 
101  update_boundary_forms = 0x0010,
103 
117  update_quadrature_points = 0x0020,
119 
124  update_JxW_values = 0x0040,
126 
131  update_normal_vectors = 0x0080,
135  update_face_normal_vectors DEAL_II_DEPRECATED = update_normal_vectors,
139  update_cell_normal_vectors DEAL_II_DEPRECATED = update_normal_vectors,
141 
145  update_jacobians = 0x0100,
147 
150  update_jacobian_grads = 0x0200,
152 
156  update_inverse_jacobians = 0x0400,
158 
163  update_covariant_transformation = 0x0800,
165 
170  update_contravariant_transformation = 0x1000,
172 
176  update_transformation_values = 0x2000,
178 
182  update_transformation_gradients = 0x4000,
184 
187  update_volume_elements = 0x10000,
192  update_jacobian_pushed_forward_grads = 0x100000,
196  update_jacobian_2nd_derivatives = 0x200000,
201  update_jacobian_pushed_forward_2nd_derivatives = 0x400000,
205  update_jacobian_3rd_derivatives = 0x800000,
210  update_jacobian_pushed_forward_3rd_derivatives = 0x1000000,
214  update_q_points DEAL_II_DEPRECATED = update_quadrature_points,
218  update_second_derivatives DEAL_II_DEPRECATED = update_hessians,
220 
223  update_piola = update_volume_elements | update_contravariant_transformation,
227  update_mapping =
228  // Direct data
229  update_quadrature_points | update_JxW_values | update_jacobians |
230  update_jacobian_grads | update_jacobian_pushed_forward_grads |
231  update_jacobian_2nd_derivatives |
232  update_jacobian_pushed_forward_2nd_derivatives |
233  update_jacobian_3rd_derivatives |
234  update_jacobian_pushed_forward_3rd_derivatives | update_inverse_jacobians |
235  update_boundary_forms | update_normal_vectors |
236  // Transformation dependence
237  update_covariant_transformation | update_contravariant_transformation |
238  update_transformation_values | update_transformation_gradients |
239  // Volume data
240  update_volume_elements
241 };
242 
243 
249 template <class StreamType>
250 inline StreamType &
251 operator<<(StreamType &s, const UpdateFlags u)
252 {
253  s << " UpdateFlags|";
254  if (u & update_values)
255  s << "values|";
256  if (u & update_gradients)
257  s << "gradients|";
258  if (u & update_hessians)
259  s << "hessians|";
260  if (u & update_3rd_derivatives)
261  s << "3rd_derivatives|";
262  if (u & update_quadrature_points)
263  s << "quadrature_points|";
264  if (u & update_JxW_values)
265  s << "JxW_values|";
266  if (u & update_normal_vectors)
267  s << "normal_vectors|";
268  if (u & update_jacobians)
269  s << "jacobians|";
270  if (u & update_inverse_jacobians)
271  s << "inverse_jacobians|";
272  if (u & update_jacobian_grads)
273  s << "jacobian_grads|";
274  if (u & update_covariant_transformation)
275  s << "covariant_transformation|";
276  if (u & update_contravariant_transformation)
277  s << "contravariant_transformation|";
278  if (u & update_transformation_values)
279  s << "transformation_values|";
280  if (u & update_transformation_gradients)
281  s << "transformation_gradients|";
282  if (u & update_jacobian_pushed_forward_grads)
283  s << "jacobian_pushed_forward_grads|";
284  if (u & update_jacobian_2nd_derivatives)
285  s << "jacobian_2nd_derivatives|";
286  if (u & update_jacobian_pushed_forward_2nd_derivatives)
287  s << "jacobian_pushed_forward_2nd_derivatives|";
288  if (u & update_jacobian_3rd_derivatives)
289  s << "jacobian_3rd_derivatives|";
290  if (u & update_jacobian_pushed_forward_3rd_derivatives)
291  s << "jacobian_pushed_forward_3rd_derivatives|";
292 
293  // TODO: check that 'u' really only has the flags set that are handled above
294  return s;
295 }
296 
297 
307 inline UpdateFlags
308 operator|(const UpdateFlags f1, const UpdateFlags f2)
309 {
310  return static_cast<UpdateFlags>(static_cast<unsigned int>(f1) |
311  static_cast<unsigned int>(f2));
312 }
313 
314 
315 
322 inline UpdateFlags &
323 operator|=(UpdateFlags &f1, const UpdateFlags f2)
324 {
325  f1 = f1 | f2;
326  return f1;
327 }
328 
329 
339 inline UpdateFlags operator&(const UpdateFlags f1, const UpdateFlags f2)
340 {
341  return static_cast<UpdateFlags>(static_cast<unsigned int>(f1) &
342  static_cast<unsigned int>(f2));
343 }
344 
345 
352 inline UpdateFlags &
353 operator&=(UpdateFlags &f1, const UpdateFlags f2)
354 {
355  f1 = f1 & f2;
356  return f1;
357 }
358 
359 
360 
371 namespace CellSimilarity
372 {
374  {
392  };
393 }
394 
395 
396 namespace internal
397 {
398  namespace FEValuesImplementation
399  {
412  template <int dim, int spacedim = dim>
414  {
415  public:
419  void
420  initialize(const unsigned int n_quadrature_points,
421  const UpdateFlags flags);
422 
427  std::size_t
428  memory_consumption() const;
429 
443  std::vector<double> JxW_values;
444 
448  std::vector<DerivativeForm<1, dim, spacedim>> jacobians;
449 
454  std::vector<DerivativeForm<2, dim, spacedim>> jacobian_grads;
455 
459  std::vector<DerivativeForm<1, spacedim, dim>> inverse_jacobians;
460 
465  std::vector<Tensor<3, spacedim>> jacobian_pushed_forward_grads;
466 
471  std::vector<DerivativeForm<3, dim, spacedim>> jacobian_2nd_derivatives;
472 
477  std::vector<Tensor<4, spacedim>> jacobian_pushed_forward_2nd_derivatives;
478 
483  std::vector<DerivativeForm<4, dim, spacedim>> jacobian_3rd_derivatives;
484 
489  std::vector<Tensor<5, spacedim>> jacobian_pushed_forward_3rd_derivatives;
490 
496  std::vector<Point<spacedim>> quadrature_points;
497 
501  std::vector<Tensor<1, spacedim>> normal_vectors;
502 
506  std::vector<Tensor<1, spacedim>> boundary_forms;
507  };
508 
509 
518  template <int dim, int spacedim = dim>
520  {
521  public:
525  void
526  initialize(const unsigned int n_quadrature_points,
528  const UpdateFlags flags);
529 
534  std::size_t
535  memory_consumption() const;
536 
556 
562 
567 
572 
579 
586 
593 
600 
630  std::vector<unsigned int> shape_function_to_row_table;
631  };
632  } // namespace FEValuesImplementation
633 } // namespace internal
634 
635 
640 DEAL_II_NAMESPACE_CLOSE
641 
642 #endif
internal::FEValuesImplementation::MappingRelatedData::normal_vectors
std::vector< Tensor< 1, spacedim > > normal_vectors
Definition: fe_update_flags.h:501
internal::FEValuesImplementation::MappingRelatedData::inverse_jacobians
std::vector< DerivativeForm< 1, spacedim, dim > > inverse_jacobians
Definition: fe_update_flags.h:459
internal::FEValuesImplementation::MappingRelatedData::memory_consumption
std::size_t memory_consumption() const
Definition: fe_values.cc:2984
internal::FEValuesImplementation::FiniteElementRelatedData::shape_gradients
GradientVector shape_gradients
Definition: fe_update_flags.h:585
internal::FEValuesImplementation::FiniteElementRelatedData::shape_hessians
HessianVector shape_hessians
Definition: fe_update_flags.h:592
internal::FEValuesImplementation::FiniteElementRelatedData
Definition: fe_update_flags.h:519
internal::FEValuesImplementation::FiniteElementRelatedData::memory_consumption
std::size_t memory_consumption() const
Definition: fe_values.cc:3064
internal::FEValuesImplementation::MappingRelatedData::jacobian_3rd_derivatives
std::vector< DerivativeForm< 4, dim, spacedim > > jacobian_3rd_derivatives
Definition: fe_update_flags.h:483
internal::FEValuesImplementation::MappingRelatedData
Definition: fe_update_flags.h:413
CellSimilarity::translation
Definition: fe_update_flags.h:383
Differentiation::SD::operator|
Expression operator|(const Expression &lhs, const Expression &rhs)
Definition: symengine_number_types.cc:457
internal::FEValuesImplementation::MappingRelatedData::jacobians
std::vector< DerivativeForm< 1, dim, spacedim > > jacobians
Definition: fe_update_flags.h:448
internal::FEValuesImplementation::MappingRelatedData::JxW_values
std::vector< double > JxW_values
Definition: fe_update_flags.h:443
CellSimilarity::Similarity
Similarity
Definition: fe_update_flags.h:373
internal::FEValuesImplementation::MappingRelatedData::jacobian_pushed_forward_3rd_derivatives
std::vector< Tensor< 5, spacedim > > jacobian_pushed_forward_3rd_derivatives
Definition: fe_update_flags.h:489
Table< 2, double >
internal::FEValuesImplementation::MappingRelatedData::jacobian_grads
std::vector< DerivativeForm< 2, dim, spacedim > > jacobian_grads
Definition: fe_update_flags.h:454
internal::FEValuesImplementation::FiniteElementRelatedData::initialize
void initialize(const unsigned int n_quadrature_points, const FiniteElement< dim, spacedim > &fe, const UpdateFlags flags)
Definition: fe_values.cc:3007
internal::FEValuesImplementation::MappingRelatedData::jacobian_pushed_forward_grads
std::vector< Tensor< 3, spacedim > > jacobian_pushed_forward_grads
Definition: fe_update_flags.h:465
internal::FEValuesImplementation::FiniteElementRelatedData::shape_3rd_derivatives
ThirdDerivativeVector shape_3rd_derivatives
Definition: fe_update_flags.h:599
internal::FEValuesImplementation::FiniteElementRelatedData::shape_function_to_row_table
std::vector< unsigned int > shape_function_to_row_table
Definition: fe_update_flags.h:630
CellSimilarity
Definition: fe_update_flags.h:371
internal::FEValuesImplementation::FiniteElementRelatedData::shape_values
ShapeVector shape_values
Definition: fe_update_flags.h:578
internal::FEValuesImplementation::MappingRelatedData::initialize
void initialize(const unsigned int n_quadrature_points, const UpdateFlags flags)
Definition: fe_values.cc:2923
internal::FEValuesImplementation::MappingRelatedData::boundary_forms
std::vector< Tensor< 1, spacedim > > boundary_forms
Definition: fe_update_flags.h:506
FiniteElement
Definition: dof_accessor.h:43
CellSimilarity::invalid_next_cell
Definition: fe_update_flags.h:391
Algorithms::OutputOperator::operator<<
OutputOperator< VectorType > & operator<<(OutputOperator< VectorType > &out, unsigned int step)
Definition: operator.h:170
CellSimilarity::inverted_translation
Definition: fe_update_flags.h:387
internal::FEValuesImplementation::MappingRelatedData::jacobian_pushed_forward_2nd_derivatives
std::vector< Tensor< 4, spacedim > > jacobian_pushed_forward_2nd_derivatives
Definition: fe_update_flags.h:477
Differentiation::SD::operator&
Expression operator&(const Expression &lhs, const Expression &rhs)
Definition: symengine_number_types.cc:440
internal::FEValuesImplementation::MappingRelatedData::jacobian_2nd_derivatives
std::vector< DerivativeForm< 3, dim, spacedim > > jacobian_2nd_derivatives
Definition: fe_update_flags.h:471
internal::FEValuesImplementation::MappingRelatedData::quadrature_points
std::vector< Point< spacedim > > quadrature_points
Definition: fe_update_flags.h:496
internal
Definition: aligned_vector.h:357
CellSimilarity::none
Definition: fe_update_flags.h:379