Reference documentation for deal.II version GIT 5dd0dfed0b 2022-12-08 21:45:02+00:00
\(\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_values.h
Go to the documentation of this file.
1 // ---------------------------------------------------------------------
2 //
3 // Copyright (C) 2003 - 2022 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_hp_fe_values_h
17 #define dealii_hp_fe_values_h
18 
19 #include <deal.II/base/config.h>
20 
22 
23 #include <deal.II/fe/fe.h>
24 #include <deal.II/fe/fe_values.h>
25 
26 #include <deal.II/grid/tria.h>
28 
32 
33 #include <memory>
34 
36 
37 // Forward declaration
38 #ifndef DOXYGEN
39 template <int dim, int spacedim>
40 class FiniteElement;
41 #endif
42 
43 
44 namespace hp
45 {
67  template <int dim, int q_dim, class FEValuesType>
68  class FEValuesBase : public Subscriptor
69  {
70  public:
81 
91  const std::vector<QCollection<q_dim>> & q_collection,
93 
102  const UpdateFlags update_flags);
103 
109  FEValuesBase(
111  const std::vector<QCollection<q_dim>> & q_collection,
112  const UpdateFlags update_flags);
113 
118 
123  FEValuesBase &
124  operator=(const FEValuesBase &) = delete;
125 
135  void
136  precalculate_fe_values(const std::vector<unsigned int> &fe_indices,
137  const std::vector<unsigned int> &mapping_indices,
138  const std::vector<unsigned int> &q_indices);
139 
152  void
154 
161 
167 
171  const QCollection<q_dim> &
173 
179 
186  const FEValuesType &
188 
189  protected:
197  FEValuesType &
198  select_fe_values(const unsigned int fe_index,
199  const unsigned int mapping_index,
200  const unsigned int q_index);
201 
202  protected:
209 
213  const SmartPointer<
217 
222 
231  const std::vector<QCollection<q_dim>> q_collections;
232 
233  private:
246 
252 
257  };
258 
259 } // namespace hp
260 
261 
262 namespace hp
263 {
313  template <int dim, int spacedim = dim>
314  class FEValues
315  : public hp::FEValuesBase<dim, dim, ::FEValues<dim, spacedim>>
316  {
317  public:
318  static constexpr unsigned int dimension = dim;
319 
320  static constexpr unsigned int space_dimension = spacedim;
321 
328  const UpdateFlags update_flags);
329 
330 
338  const UpdateFlags update_flags);
339 
340 
386  template <bool lda>
387  void
389  const unsigned int q_index = numbers::invalid_unsigned_int,
390  const unsigned int mapping_index = numbers::invalid_unsigned_int,
391  const unsigned int fe_index = numbers::invalid_unsigned_int);
392 
405  void
407  const unsigned int q_index = numbers::invalid_unsigned_int,
408  const unsigned int mapping_index = numbers::invalid_unsigned_int,
409  const unsigned int fe_index = numbers::invalid_unsigned_int);
410  };
411 
412 
413 
437  template <int dim, int spacedim = dim>
439  : public hp::FEValuesBase<dim, dim - 1, ::FEFaceValues<dim, spacedim>>
440  {
441  public:
448  const UpdateFlags update_flags);
449 
461  const std::vector<hp::QCollection<dim - 1>> &q_collections,
462  const UpdateFlags update_flags);
463 
464 
472  const UpdateFlags update_flags);
473 
484  const std::vector<hp::QCollection<dim - 1>> &q_collections,
485  const UpdateFlags update_flags);
486 
532  template <bool lda>
533  void
535  const unsigned int face_no,
536  const unsigned int q_index = numbers::invalid_unsigned_int,
537  const unsigned int mapping_index = numbers::invalid_unsigned_int,
538  const unsigned int fe_index = numbers::invalid_unsigned_int);
539 
545  template <bool lda>
546  void
548  const typename Triangulation<dim, spacedim>::face_iterator &face,
549  const unsigned int q_index = numbers::invalid_unsigned_int,
550  const unsigned int mapping_index = numbers::invalid_unsigned_int,
551  const unsigned int fe_index = numbers::invalid_unsigned_int);
552 
565  void
567  const unsigned int face_no,
568  const unsigned int q_index = numbers::invalid_unsigned_int,
569  const unsigned int mapping_index = numbers::invalid_unsigned_int,
570  const unsigned int fe_index = numbers::invalid_unsigned_int);
571 
577  void
579  const typename Triangulation<dim, spacedim>::face_iterator &face,
580  const unsigned int q_index = numbers::invalid_unsigned_int,
581  const unsigned int mapping_index = numbers::invalid_unsigned_int,
582  const unsigned int fe_index = numbers::invalid_unsigned_int);
583  };
584 
585 
586 
593  template <int dim, int spacedim = dim>
595  : public hp::
596  FEValuesBase<dim, dim - 1, ::FESubfaceValues<dim, spacedim>>
597  {
598  public:
603  const hp::MappingCollection<dim, spacedim> &mapping_collection,
604  const hp::FECollection<dim, spacedim> & fe_collection,
605  const hp::QCollection<dim - 1> & q_collection,
606  const UpdateFlags update_flags);
607 
608 
615  const hp::QCollection<dim - 1> & q_collection,
616  const UpdateFlags update_flags);
617 
653  template <bool lda>
654  void
656  const unsigned int face_no,
657  const unsigned int subface_no,
658  const unsigned int q_index = numbers::invalid_unsigned_int,
659  const unsigned int mapping_index = numbers::invalid_unsigned_int,
660  const unsigned int fe_index = numbers::invalid_unsigned_int);
661 
674  void
676  const unsigned int face_no,
677  const unsigned int subface_no,
678  const unsigned int q_index = numbers::invalid_unsigned_int,
679  const unsigned int mapping_index = numbers::invalid_unsigned_int,
680  const unsigned int fe_index = numbers::invalid_unsigned_int);
681  };
682 
683 } // namespace hp
684 
685 
686 // -------------- inline and template functions --------------
687 
688 namespace hp
689 {
690  template <int dim, int q_dim, class FEValuesType>
691  inline const FEValuesType &
693  {
694  return *fe_values_table(present_fe_values_index);
695  }
696 
697 
698 
699  template <int dim, int q_dim, class FEValuesType>
702  {
703  return *fe_collection;
704  }
705 
706 
707 
708  template <int dim, int q_dim, class FEValuesType>
711  {
712  return *mapping_collection;
713  }
714 
715 
716 
717  template <int dim, int q_dim, class FEValuesType>
718  inline const QCollection<q_dim> &
720  {
721  return q_collection;
722  }
723 
724 
725 
726  template <int dim, int q_dim, class FEValuesType>
727  inline UpdateFlags
729  {
730  return update_flags;
731  }
732 } // namespace hp
733 
735 
736 #endif
FEFaceValues(const hp::MappingCollection< dim, spacedim > &mapping_collection, const hp::FECollection< dim, spacedim > &fe_collection, const hp::QCollection< dim - 1 > &q_collection, const UpdateFlags update_flags)
Definition: fe_values.cc:371
void reinit(const TriaIterator< DoFCellAccessor< dim, spacedim, lda >> &cell, const unsigned int face_no, const unsigned int q_index=numbers::invalid_unsigned_int, const unsigned int mapping_index=numbers::invalid_unsigned_int, const unsigned int fe_index=numbers::invalid_unsigned_int)
Definition: fe_values.cc:424
void reinit(const TriaIterator< DoFCellAccessor< dim, spacedim, lda >> &cell, const unsigned int face_no, const unsigned int subface_no, const unsigned int q_index=numbers::invalid_unsigned_int, const unsigned int mapping_index=numbers::invalid_unsigned_int, const unsigned int fe_index=numbers::invalid_unsigned_int)
Definition: fe_values.cc:564
FESubfaceValues(const hp::MappingCollection< dim, spacedim > &mapping_collection, const hp::FECollection< dim, spacedim > &fe_collection, const hp::QCollection< dim - 1 > &q_collection, const UpdateFlags update_flags)
Definition: fe_values.cc:536
const QCollection< q_dim > & get_quadrature_collection() const
Definition: fe_values.h:719
FEValuesBase(const MappingCollection< dim, FEValuesType::space_dimension > &mapping_collection, const FECollection< dim, FEValuesType::space_dimension > &fe_collection, const QCollection< q_dim > &q_collection, const UpdateFlags update_flags)
Definition: fe_values.cc:66
FEValuesBase & operator=(const FEValuesBase &)=delete
const FEValuesType & get_present_fe_values() const
Definition: fe_values.h:692
const std::vector< QCollection< q_dim > > q_collections
Definition: fe_values.h:231
FEValuesType & select_fe_values(const unsigned int fe_index, const unsigned int mapping_index, const unsigned int q_index)
Definition: fe_values.cc:176
const QCollection< q_dim > q_collection
Definition: fe_values.h:221
const SmartPointer< const FECollection< dim, FEValuesType::space_dimension >, FEValuesBase< dim, q_dim, FEValuesType > > fe_collection
Definition: fe_values.h:208
UpdateFlags get_update_flags() const
Definition: fe_values.h:728
const MappingCollection< dim, FEValuesType::space_dimension > & get_mapping_collection() const
Definition: fe_values.h:710
Table< 3, std::unique_ptr< FEValuesType > > fe_values_table
Definition: fe_values.h:245
const FECollection< dim, FEValuesType::space_dimension > & get_fe_collection() const
Definition: fe_values.h:701
TableIndices< 3 > present_fe_values_index
Definition: fe_values.h:251
void precalculate_fe_values()
Definition: fe_values.cc:243
const SmartPointer< const MappingCollection< dim, FEValuesType::space_dimension >, FEValuesBase< dim, q_dim, FEValuesType > > mapping_collection
Definition: fe_values.h:216
const UpdateFlags update_flags
Definition: fe_values.h:256
static constexpr unsigned int dimension
Definition: fe_values.h:318
static constexpr unsigned int space_dimension
Definition: fe_values.h:320
void reinit(const TriaIterator< DoFCellAccessor< dim, spacedim, lda >> &cell, const unsigned int q_index=numbers::invalid_unsigned_int, const unsigned int mapping_index=numbers::invalid_unsigned_int, const unsigned int fe_index=numbers::invalid_unsigned_int)
Definition: fe_values.cc:294
FEValues(const MappingCollection< dim, spacedim > &mapping_collection, const FECollection< dim, spacedim > &fe_collection, const QCollection< dim > &q_collection, const UpdateFlags update_flags)
Definition: fe_values.cc:268
#define DEAL_II_NAMESPACE_OPEN
Definition: config.h:458
#define DEAL_II_NAMESPACE_CLOSE
Definition: config.h:459
UpdateFlags
Definition: hp.h:118
static const unsigned int invalid_unsigned_int
Definition: types.h:206
unsigned short int fe_index
Definition: types.h:59