Doxygen API reference documentation for ideal.II
spacetime_fe_values.hh
1 // ---------------------------------------------------------------------
2 //
3 // Copyright (C) 2022 - 2023 by the ideal.II authors
4 //
5 // This file is part of the ideal.II library.
6 //
7 // The ideal.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 3.0 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 ideal.II.
13 //
14 // ---------------------------------------------------------------------
15 
16 #ifndef INCLUDE_IDEAL_II_FE_SPACETIME_FE_VALUES_HH_
17 #define INCLUDE_IDEAL_II_FE_SPACETIME_FE_VALUES_HH_
18 
19 #include <ideal.II/base/quadrature_lib.hh>
20 
21 #include <ideal.II/fe/fe_dg.hh>
22 
23 #include <deal.II/fe/fe_values.h>
24 
25 namespace idealii::spacetime
26 {
27 
39  template <int dim>
40  class FEValues
41  {
42  public:
51  Quadrature<dim> &quad,
52  const dealii::UpdateFlags uflags);
53 
59  void
60  reinit_space(const typename dealii::TriaIterator<
61  dealii::DoFCellAccessor<dim, dim, false>> &cell_space);
67  void
69  const typename dealii::TriaIterator<dealii::DoFCellAccessor<1, 1, false>>
70  &cell_time);
71 
77  double
78  shape_value(unsigned int function_no, unsigned int point_no);
79 
85  double
86  shape_dt(unsigned int function_no, unsigned int point_no);
87 
93  dealii::Tensor<1, dim>
94  shape_space_grad(unsigned int function_no, unsigned int point_no);
95 
101  template <class InputVector>
102  void
104  const InputVector &fe_function,
105  std::vector<dealii::Vector<typename InputVector::value_type>> &values)
106  const;
107 
113  template <class InputVector>
114  void
116  const InputVector &fe_function,
117  std::vector<dealii::Vector<typename InputVector::value_type>> &values)
118  const;
119 
125  template <class InputVector>
126  void
128  const InputVector &fe_function,
129  std::vector<
130  std::vector<dealii::Tensor<1, dim, typename InputVector::value_type>>>
131  &gradients) const;
132 
133 
143  typename dealii::FEValuesViews::Scalar<dim>::value_type
144  scalar_value(const typename dealii::FEValuesExtractors::Scalar &extractor,
145  unsigned int function_no,
146  unsigned int point_no);
147 
157  typename dealii::FEValuesViews::Scalar<dim>::value_type
158  scalar_dt(const typename dealii::FEValuesExtractors::Scalar &extractor,
159  unsigned int function_no,
160  unsigned int point_no);
170  typename dealii::FEValuesViews::Scalar<dim>::gradient_type
172  const typename dealii::FEValuesExtractors::Scalar &extractor,
173  unsigned int function_no,
174  unsigned int point_no);
175 
185  typename dealii::FEValuesViews::Vector<dim>::value_type
186  vector_value(const typename dealii::FEValuesExtractors::Vector &extractor,
187  unsigned int function_no,
188  unsigned int point_no);
189 
199  typename dealii::FEValuesViews::Vector<dim>::value_type
200  vector_dt(const typename dealii::FEValuesExtractors::Vector &extractor,
201  unsigned int function_no,
202  unsigned int point_no);
203 
213  typename dealii::FEValuesViews::Vector<dim>::divergence_type
215  const typename dealii::FEValuesExtractors::Vector &extractor,
216  unsigned int function_no,
217  unsigned int point_no);
218 
228  typename dealii::FEValuesViews::Vector<dim>::gradient_type
230  const typename dealii::FEValuesExtractors::Vector &extractor,
231  unsigned int function_no,
232  unsigned int point_no);
233 
243  typename dealii::FEValuesViews::Vector<dim>::curl_type
245  const typename dealii::FEValuesExtractors::Vector &extractor,
246  unsigned int function_no,
247  unsigned int point_no);
248 
253  double
254  time_quadrature_point(unsigned int quadrature_point);
255 
260  dealii::Point<dim>
261  space_quadrature_point(unsigned int quadrature_point);
262 
267  double
268  JxW(const unsigned int quadrature_point);
273  void
275  std::vector<dealii::types::global_dof_index> &indices);
276 
281  std::shared_ptr<dealii::FEValues<dim>>
287  std::shared_ptr<dealii::FEValues<1>>
289 
290  private:
292  Quadrature<dim> &_quad;
293 
294  std::shared_ptr<dealii::FEValues<dim>> _fev_space;
295  std::shared_ptr<dealii::FEValues<1>> _fev_time;
296 
297  std::vector<dealii::types::global_dof_index> local_space_dof_index;
298  std::vector<dealii::types::global_dof_index> local_time_dof_index;
299 
300  unsigned int n_dofs_space;
301  unsigned int time_cell_index;
302  const unsigned int n_dofs_space_cell;
303  const unsigned int n_quads_space;
304 
305  public:
309  unsigned int n_quadrature_points;
310  };
311 
324  template <int dim>
326  {
327  public:
336  Quadrature<dim> &quad,
337  const dealii::UpdateFlags uflags);
338 
344  void
345  reinit_space(const typename dealii::TriaIterator<
346  dealii::DoFCellAccessor<dim, dim, false>> &cell_space);
347 
353  void
355  const typename dealii::TriaIterator<dealii::DoFCellAccessor<1, 1, false>>
356  &cell_time);
357 
366  double
367  shape_value_plus(unsigned int function_no, unsigned int point_no);
368 
377  double
378  shape_value_minus(unsigned int function_no, unsigned int point_no);
379 
385  template <class InputVector>
386  void
388  const InputVector &fe_function,
389  std::vector<dealii::Vector<typename InputVector::value_type>> &values)
390  const;
391 
397  template <class InputVector>
398  void
400  const InputVector &fe_function,
401  std::vector<dealii::Vector<typename InputVector::value_type>> &values)
402  const;
403 
412  typename dealii::FEValuesViews::Scalar<dim>::value_type
414  const typename dealii::FEValuesExtractors::Scalar &extractor,
415  unsigned int function_no,
416  unsigned int point_no);
417 
426  typename dealii::FEValuesViews::Scalar<dim>::value_type
428  const typename dealii::FEValuesExtractors::Scalar &extractor,
429  unsigned int function_no,
430  unsigned int point_no);
431 
440  typename dealii::FEValuesViews::Vector<dim>::value_type
442  const typename dealii::FEValuesExtractors::Vector &extractor,
443  unsigned int function_no,
444  unsigned int points_no);
445 
454  typename dealii::FEValuesViews::Vector<dim>::value_type
456  const typename dealii::FEValuesExtractors::Vector &extractor,
457  unsigned int function_no,
458  unsigned int point_no);
463  std::shared_ptr<dealii::FEValues<dim>>
465 
470  std::shared_ptr<dealii::FEValues<1>>
472 
477  double
478  JxW(const unsigned int quadrature_point);
479 
483  unsigned int n_quadrature_points;
484 
485  private:
486  unsigned int n_dofs_space;
488  Quadrature<dim> &_quad;
489 
490  std::shared_ptr<dealii::FEValues<dim>> _fev_space;
491  std::shared_ptr<dealii::FEValues<1>> _fev_time;
492 
493  std::vector<dealii::types::global_dof_index> local_space_dof_index;
494  std::vector<dealii::types::global_dof_index> local_time_dof_index;
495  };
496 
508  template <int dim>
510  {
511  public:
523  Quadrature<dim - 1> &quad,
524  const dealii::UpdateFlags uflags,
525  const dealii::UpdateFlags additional_flags);
526 
532  void
533  reinit_space(const typename dealii::TriaIterator<
534  dealii::DoFCellAccessor<dim, dim, false>> &cell_space,
535  const unsigned int face_no);
541  void
543  const typename dealii::TriaIterator<dealii::DoFCellAccessor<1, 1, false>>
544  &cell_time);
545 
551  double
552  shape_value(unsigned int function_no, unsigned int point_no);
553 
563  typename dealii::FEValuesViews::Scalar<dim>::value_type
564  scalar_value(const typename dealii::FEValuesExtractors::Scalar &extractor,
565  unsigned int function_no,
566  unsigned int point_no);
567 
577  typename dealii::FEValuesViews::Vector<dim>::value_type
578  vector_value(const typename dealii::FEValuesExtractors::Vector &extractor,
579  unsigned int function_no,
580  unsigned int point_no);
581 
586  double
587  time_quadrature_point(unsigned int quadrature_point);
588 
593  dealii::Point<dim>
594  space_quadrature_point(unsigned int quadrature_point);
595 
600  const dealii::Tensor<1, dim> &
601  space_normal_vector(unsigned int i);
602 
607  double
608  JxW(const unsigned int quadrature_point);
613  void
615  std::vector<dealii::types::global_dof_index> &indices);
616 
621  std::shared_ptr<dealii::FEFaceValues<dim>>
627  std::shared_ptr<dealii::FEValues<1>>
629 
630  private:
632  Quadrature<dim - 1> &_quad;
633 
634  std::shared_ptr<dealii::FEFaceValues<dim>> _fev_space;
635  std::shared_ptr<dealii::FEValues<1>> _fev_time;
636 
637  std::vector<dealii::types::global_dof_index> local_space_dof_index;
638  std::vector<dealii::types::global_dof_index> local_time_dof_index;
639 
640  unsigned int n_dofs_space;
641  unsigned int time_cell_index;
642  const unsigned int n_dofs_space_cell;
643  const unsigned int n_quads_space;
644 
645  public:
649  unsigned int n_quadrature_points;
650  };
651 } // namespace idealii::spacetime
652 
653 #endif /* INCLUDE_IDEAL_II_BASE_SPACETIME_QUADRATURE_HH_ */
A class for dG elements in time and arbitrary elements in space.
Definition: fe_dg.hh:36
Evaluation of the tensor-product space-time basis functions on spatial element faces.
Definition: spacetime_fe_values.hh:510
double JxW(const unsigned int quadrature_point)
Mapped space-time quadrature weight.
double shape_value(unsigned int function_no, unsigned int point_no)
Value of the space-time shape function at spacetime-quadrature point.
dealii::Point< dim > space_quadrature_point(unsigned int quadrature_point)
Get the spatial quadrature point of the given space-time quadrature index.
double time_quadrature_point(unsigned int quadrature_point)
Get the temporal quadrature point of the given space-time quadrature index.
FEFaceValues(DG_FiniteElement< dim > &fe, Quadrature< dim - 1 > &quad, const dealii::UpdateFlags uflags, const dealii::UpdateFlags additional_flags)
Constructor of the FEValues class.
void reinit_space(const typename dealii::TriaIterator< dealii::DoFCellAccessor< dim, dim, false >> &cell_space, const unsigned int face_no)
Reinitialize all objects of the underlying spatial FEValues object. This function calls reinit(cell_s...
dealii::FEValuesViews::Scalar< dim >::value_type scalar_value(const typename dealii::FEValuesExtractors::Scalar &extractor, unsigned int function_no, unsigned int point_no)
Value of the space-time shape function of a scalar finite element component.
std::shared_ptr< dealii::FEFaceValues< dim > > spatial()
The underlying spatial FEValues object.
std::shared_ptr< dealii::FEValues< 1 > > temporal()
The underlying temporal FEValues object.
void get_local_dof_indices(std::vector< dealii::types::global_dof_index > &indices)
Local space-time DoF indices of the current space-time element.
unsigned int n_quadrature_points
Number of space-time quadrature points per element.
Definition: spacetime_fe_values.hh:649
void reinit_time(const typename dealii::TriaIterator< dealii::DoFCellAccessor< 1, 1, false >> &cell_time)
Reinitialize all objects of the underlying temporal FEValues object. This function calls reinit(cell_...
dealii::FEValuesViews::Vector< dim >::value_type vector_value(const typename dealii::FEValuesExtractors::Vector &extractor, unsigned int function_no, unsigned int point_no)
Value of the space-time shape function of a vector-valued finite element component.
const dealii::Tensor< 1, dim > & space_normal_vector(unsigned int i)
Get the normal vector at the spatial face.
Evaluation of the tensor-product space-time basis functions at the temporal element edges.
Definition: spacetime_fe_values.hh:326
dealii::FEValuesViews::Scalar< dim >::value_type scalar_value_minus(const typename dealii::FEValuesExtractors::Scalar &extractor, unsigned int function_no, unsigned int point_no)
Value of the limit from bewlo of the space-time shape function of a scalar finite element component.
void get_function_values_minus(const InputVector &fe_function, std::vector< dealii::Vector< typename InputVector::value_type >> &values) const
Left temporal limit from below of function values of a given vector at all space quadrature points @i...
std::shared_ptr< dealii::FEValues< dim > > spatial()
The underlying spatial FEValues object.
dealii::FEValuesViews::Vector< dim >::value_type vector_value_minus(const typename dealii::FEValuesExtractors::Vector &extractor, unsigned int function_no, unsigned int point_no)
Value of the limit from below of the space-time shape function of a vector-valued finite element comp...
void reinit_time(const typename dealii::TriaIterator< dealii::DoFCellAccessor< 1, 1, false >> &cell_time)
Reinitialize all objects of the underlying temporal FEValues object. This function calls reinit(cell_...
dealii::FEValuesViews::Vector< dim >::value_type vector_value_plus(const typename dealii::FEValuesExtractors::Vector &extractor, unsigned int function_no, unsigned int points_no)
Value of the limit from above of the space-time shape function of a vector-valued finite element comp...
dealii::FEValuesViews::Scalar< dim >::value_type scalar_value_plus(const typename dealii::FEValuesExtractors::Scalar &extractor, unsigned int function_no, unsigned int point_no)
Value of the limit from above of the space-time shape function of a scalar finite element component.
double shape_value_plus(unsigned int function_no, unsigned int point_no)
Value of the limit from above of the space-time shape function at the spatial quadrature point.
void get_function_values_plus(const InputVector &fe_function, std::vector< dealii::Vector< typename InputVector::value_type >> &values) const
Left temporal limit from above of function values of a given vector at all space quadrature points @i...
double shape_value_minus(unsigned int function_no, unsigned int point_no)
Value of the limit from below of the space-time shape function at the spatial quadrature point.
unsigned int n_quadrature_points
Number of spatial quadrature points per element.
Definition: spacetime_fe_values.hh:483
FEJumpValues(DG_FiniteElement< dim > &fe, Quadrature< dim > &quad, const dealii::UpdateFlags uflags)
Constructor of the FEJumpValues class.
std::shared_ptr< dealii::FEValues< 1 > > temporal()
The underlying temporal FEValues object.
void reinit_space(const typename dealii::TriaIterator< dealii::DoFCellAccessor< dim, dim, false >> &cell_space)
Reinitialize all objects of the underlying spatial FEValues object. This function calls reinit(cell_s...
double JxW(const unsigned int quadrature_point)
Mapped space-time quadrature weight.
Evaluation of the tensor-product space-time basis functions.
Definition: spacetime_fe_values.hh:41
dealii::FEValuesViews::Scalar< dim >::value_type scalar_dt(const typename dealii::FEValuesExtractors::Scalar &extractor, unsigned int function_no, unsigned int point_no)
Temporal derivative of the space-time shape function of a scalar finite element component.
dealii::FEValuesViews::Vector< dim >::value_type vector_dt(const typename dealii::FEValuesExtractors::Vector &extractor, unsigned int function_no, unsigned int point_no)
Temporal derivative of the space-time shape function of a vector-valued finite element component.
dealii::FEValuesViews::Vector< dim >::gradient_type vector_space_grad(const typename dealii::FEValuesExtractors::Vector &extractor, unsigned int function_no, unsigned int point_no)
Spatial gradient of the space-time shape function of a vector-valued finite element component.
unsigned int n_quadrature_points
Number of space-time quadrature points per element.
Definition: spacetime_fe_values.hh:309
dealii::FEValuesViews::Vector< dim >::curl_type vector_space_curl(const typename dealii::FEValuesExtractors::Vector &extractor, unsigned int function_no, unsigned int point_no)
Spatial curl of the space-time shape function of a vector-valued finite element component.
dealii::FEValuesViews::Vector< dim >::divergence_type vector_divergence(const typename dealii::FEValuesExtractors::Vector &extractor, unsigned int function_no, unsigned int point_no)
Spatial divergence of the space-time shape function of a vector-valued finite element component.
void reinit_time(const typename dealii::TriaIterator< dealii::DoFCellAccessor< 1, 1, false >> &cell_time)
Reinitialize all objects of the underlying temporal FEValues object. This function calls reinit(cell_...
double shape_value(unsigned int function_no, unsigned int point_no)
Value of the space-time shape function at spacetime-quadrature point.
double JxW(const unsigned int quadrature_point)
Mapped space-time quadrature weight.
void get_local_dof_indices(std::vector< dealii::types::global_dof_index > &indices)
Local space-time DoF indices of the current space-time element.
std::shared_ptr< dealii::FEValues< dim > > spatial()
The underlying spatial FEValues object.
double time_quadrature_point(unsigned int quadrature_point)
Get the temporal quadrature point of the given space-time quadrature index.
std::shared_ptr< dealii::FEValues< 1 > > temporal()
The underlying temporal FEValues object.
dealii::Tensor< 1, dim > shape_space_grad(unsigned int function_no, unsigned int point_no)
Spatial derivative of the space-time shape function at spacetime-quadrature point.
double shape_dt(unsigned int function_no, unsigned int point_no)
Temporal derivative of the space-time shape function at spacetime-quadrature point.
dealii::FEValuesViews::Scalar< dim >::gradient_type scalar_space_grad(const typename dealii::FEValuesExtractors::Scalar &extractor, unsigned int function_no, unsigned int point_no)
Spatial derivative of the space-time shape function of a scalar finite element component.
void reinit_space(const typename dealii::TriaIterator< dealii::DoFCellAccessor< dim, dim, false >> &cell_space)
Reinitialize all objects of the underlying spatial FEValues object. This function calls reinit(cell_s...
dealii::Point< dim > space_quadrature_point(unsigned int quadrature_point)
Get the spatial quadrature point of the given space-time quadrature index.
void get_function_space_gradients(const InputVector &fe_function, std::vector< std::vector< dealii::Tensor< 1, dim, typename InputVector::value_type >>> &gradients) const
Spatial function gradients of a given vector at all quadrature points @in fe_function @out values.
void get_function_dt(const InputVector &fe_function, std::vector< dealii::Vector< typename InputVector::value_type >> &values) const
Function values of a given vector at all quadrature points @in fe_function @out values.
FEValues(DG_FiniteElement< dim > &fe, Quadrature< dim > &quad, const dealii::UpdateFlags uflags)
Constructor of the FEValues class.
dealii::FEValuesViews::Vector< dim >::value_type vector_value(const typename dealii::FEValuesExtractors::Vector &extractor, unsigned int function_no, unsigned int point_no)
Value of the space-time shape function of a vector-valued finite element component.
void get_function_values(const InputVector &fe_function, std::vector< dealii::Vector< typename InputVector::value_type >> &values) const
Function values of a given vector at all quadrature points @in fe_function @out values.
dealii::FEValuesViews::Scalar< dim >::value_type scalar_value(const typename dealii::FEValuesExtractors::Scalar &extractor, unsigned int function_no, unsigned int point_no)
Value of the space-time shape function of a scalar finite element component.
The base class for quadrature formulae in space and time.
Definition: spacetime_quadrature.hh:35
Namespace for general spacetime object and collections of slab objects.
Definition: idealii.hh:89