deal.II version GIT relicensing-6842-g793a97d2aa 2026-10-02 14:00:01+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\}}\)
Loading...
Searching...
No Matches
fe_values.h
Go to the documentation of this file.
1// -----------------------------------------------------------------------------
2//
3// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception OR LGPL-2.1-or-later
4// Copyright (C) 2021 - 2026 by the deal.II authors
5//
6// This file is part of the deal.II library.
7//
8// Detailed license information governing the source code and contributions
9// can be found in LICENSE.md and CONTRIBUTING.md at the top level directory.
10//
11// -----------------------------------------------------------------------------
12
13#ifndef dealii_non_matching_fe_values_h
14#define dealii_non_matching_fe_values_h
15
18
20
24
26
30
34
35#include <deque>
36#include <optional>
37
39
40namespace NonMatching
41{
77
78
140 template <int dim>
142 {
143 public:
145
167 template <typename Number>
169 const Quadrature<1> &quadrature,
172 const DoFHandler<dim> &dof_handler,
173 const ReadVector<Number> &level_set,
174 const AdditionalData &additional_data = AdditionalData());
175
202 template <typename Number>
205 const hp::QCollection<dim> &q_collection,
206 const hp::QCollection<1> &q_collection_1d,
209 const DoFHandler<dim> &dof_handler,
210 const ReadVector<Number> &level_set,
211 const AdditionalData &additional_data = AdditionalData());
212
244 template <bool level_dof_access>
245 void
246 reinit(
248 const unsigned int q_index = numbers::invalid_unsigned_int,
249 const unsigned int mapping_index = numbers::invalid_unsigned_int);
250
263 void
265 const unsigned int q_index = numbers::invalid_unsigned_int,
266 const unsigned int mapping_index = numbers::invalid_unsigned_int,
267 const unsigned int fe_index = numbers::invalid_unsigned_int);
268
277 const std::optional<::FEValues<dim>> &
278 get_inside_fe_values() const;
279
288 const std::optional<::FEValues<dim>> &
289 get_outside_fe_values() const;
290
298 const std::optional<FEImmersedSurfaceValues<dim>> &
299 get_surface_fe_values() const;
300
301 private:
305 template <typename CellIteratorType>
306 void
307 reinit_internal(const CellIteratorType &cell,
308 const unsigned int q_index,
309 const unsigned int mapping_index,
310 const unsigned int fe_index);
311
317 void
318 initialize(const hp::QCollection<dim> &q_collection);
319
324
329
335
340
344 unsigned int active_fe_index;
345
350
355
369 std::deque<std::optional<::FEValues<dim>>>
371
385 std::deque<std::optional<::FEValues<dim>>>
387
395 std::optional<::FEValues<dim>> fe_values_inside;
396
404 std::optional<::FEValues<dim>> fe_values_outside;
405
413 std::optional<NonMatching::FEImmersedSurfaceValues<dim>> fe_values_surface;
414
419 };
420
421
422
485 template <int dim>
487 {
488 public:
491
513 template <typename Number>
515 const Quadrature<1> &quadrature,
518 const DoFHandler<dim> &dof_handler,
519 const ReadVector<Number> &level_set,
520 const AdditionalData &additional_data = AdditionalData());
521
548 template <typename Number>
551 const hp::QCollection<dim - 1> &q_collection,
552 const hp::QCollection<1> &q_collection_1d,
555 const DoFHandler<dim> &dof_handler,
556 const ReadVector<Number> &level_set,
557 const AdditionalData &additional_data = AdditionalData());
558
572 template <typename CellIteratorType, typename CellNeighborIteratorType>
573 void
574 reinit(const CellIteratorType &cell,
575 const unsigned int face_no,
576 const unsigned int sub_face_no,
577 const CellNeighborIteratorType &cell_neighbor,
578 const unsigned int face_no_neighbor,
579 const unsigned int sub_face_no_neighbor,
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
592 template <typename CellIteratorType>
593 void
594 reinit(const CellIteratorType &cell,
595 const unsigned int face_no,
596 const unsigned int q_index = numbers::invalid_unsigned_int,
597 const unsigned int mapping_index = numbers::invalid_unsigned_int,
598 const unsigned int fe_index = numbers::invalid_unsigned_int);
599
609 const std::optional<::FEInterfaceValues<dim>> &
610 get_inside_fe_values() const;
611
621 const std::optional<::FEInterfaceValues<dim>> &
622 get_outside_fe_values() const;
623
624 private:
630 void
631 initialize(const hp::QCollection<dim - 1> &q_collection);
632
639 template <typename CellAccessorType>
640 void
642 const unsigned int face_no,
643 const unsigned int q_index,
644 const unsigned int active_fe_index,
645 const std::function<void(::FEInterfaceValues<dim> &,
646 const unsigned int)> &call_reinit);
647
652
657
663
668
673
678
683 std::optional<::FEInterfaceValues<dim>>
685
690 std::optional<::FEInterfaceValues<dim>>
692
700 std::optional<::FEInterfaceValues<dim>> fe_values_inside;
701
709 std::optional<::FEInterfaceValues<dim>> fe_values_outside;
710
715 };
716
717
718#ifndef DOXYGEN
719
720 /*---------------------- Inline functions ---------------------*/
721
722 template <int dim>
723 template <typename CellIteratorType>
724 inline void
725 FEInterfaceValues<dim>::reinit(const CellIteratorType &cell,
726 const unsigned int face_no,
727 const unsigned int q_index,
728 const unsigned int mapping_index,
729 const unsigned int active_fe_index)
730 {
731 // Lambda describing how we should call reinit on a single
732 // ::FEInterfaceValues object.
733 const auto reinit_operation =
734 [&](::FEInterfaceValues<dim> &fe_interface_values,
735 const unsigned int q_index) {
736 fe_interface_values.reinit(
737 cell, face_no, q_index, mapping_index, active_fe_index);
738 };
739
740 do_reinit(cell, face_no, q_index, active_fe_index, reinit_operation);
741 }
742
743
744
745 template <int dim>
746 template <typename CellIteratorType, typename CellNeighborIteratorType>
747 inline void
748 FEInterfaceValues<dim>::reinit(const CellIteratorType &cell,
749 const unsigned int face_no,
750 const unsigned int sub_face_no,
751 const CellNeighborIteratorType &cell_neighbor,
752 const unsigned int face_no_neighbor,
753 const unsigned int sub_face_no_neighbor,
754 const unsigned int q_index,
755 const unsigned int mapping_index,
756 const unsigned int active_fe_index)
757 {
759 Assert(sub_face_no_neighbor == numbers::invalid_unsigned_int,
761
762 // Lambda describing how we should call reinit on a single
763 // ::FEInterfaceValues object.
764 const auto reinit_operation =
765 [&](::FEInterfaceValues<dim> &fe_interface_values,
766 const unsigned int q_index) {
767 fe_interface_values.reinit(cell,
768 face_no,
769 sub_face_no,
770 cell_neighbor,
771 face_no_neighbor,
772 sub_face_no_neighbor,
773 q_index,
774 mapping_index,
775 active_fe_index);
776 };
777
778 do_reinit(cell, face_no, q_index, active_fe_index, reinit_operation);
779 }
780
781#endif
782
783} // namespace NonMatching
785
786#endif
void reinit(const CellIteratorType &cell, const unsigned int face_no, const unsigned int sub_face_no, const CellNeighborIteratorType &cell_neighbor, const unsigned int face_no_neighbor, const unsigned int sub_face_no_neighbor, 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, const unsigned int fe_index_neighbor=numbers::invalid_unsigned_int)
const std::optional<::FEInterfaceValues< dim > > & get_outside_fe_values() const
Definition fe_values.cc:548
void initialize(const hp::QCollection< dim - 1 > &q_collection)
Definition fe_values.cc:396
const ObserverPointer< const hp::MappingCollection< dim > > mapping_collection
Definition fe_values.h:651
const hp::QCollection< 1 > q_collection_1D
Definition fe_values.h:662
void reinit(const CellIteratorType &cell, const unsigned int face_no, const unsigned int sub_face_no, const CellNeighborIteratorType &cell_neighbor, const unsigned int face_no_neighbor, const unsigned int sub_face_no_neighbor, 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)
typename FaceQuadratureGenerator< dim >::AdditionalData AdditionalData
Definition fe_values.h:490
const RegionUpdateFlags region_update_flags
Definition fe_values.h:672
void reinit(const CellIteratorType &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)
void do_reinit(const TriaIterator< CellAccessorType > &cell, const unsigned int face_no, const unsigned int q_index, const unsigned int active_fe_index, const std::function< void(::FEInterfaceValues< dim > &, const unsigned int)> &call_reinit)
Definition fe_values.cc:433
LocationToLevelSet current_face_location
Definition fe_values.h:667
const ObserverPointer< const MeshClassifier< dim > > mesh_classifier
Definition fe_values.h:677
std::optional<::FEInterfaceValues< dim > > fe_values_inside_full_quadrature
Definition fe_values.h:684
const std::optional<::FEInterfaceValues< dim > > & get_inside_fe_values() const
Definition fe_values.cc:536
const ObserverPointer< const hp::FECollection< dim > > fe_collection
Definition fe_values.h:656
std::optional<::FEInterfaceValues< dim > > fe_values_outside_full_quadrature
Definition fe_values.h:691
std::optional<::FEInterfaceValues< dim > > fe_values_inside
Definition fe_values.h:700
DiscreteFaceQuadratureGenerator< dim > face_quadrature_generator
Definition fe_values.h:714
std::optional<::FEInterfaceValues< dim > > fe_values_outside
Definition fe_values.h:709
std::optional< NonMatching::FEImmersedSurfaceValues< dim > > fe_values_surface
Definition fe_values.h:413
std::deque< std::optional<::FEValues< dim > > > fe_values_inside_full_quadrature
Definition fe_values.h:370
std::optional<::FEValues< dim > > fe_values_outside
Definition fe_values.h:404
LocationToLevelSet current_cell_location
Definition fe_values.h:339
const ObserverPointer< const hp::FECollection< dim > > fe_collection
Definition fe_values.h:328
const std::optional<::FEValues< dim > > & get_outside_fe_values() const
Definition fe_values.cc:317
const ObserverPointer< const MeshClassifier< dim > > mesh_classifier
Definition fe_values.h:354
void initialize(const hp::QCollection< dim > &q_collection)
Definition fe_values.cc:100
const std::optional< FEImmersedSurfaceValues< dim > > & get_surface_fe_values() const
Definition fe_values.cc:329
void reinit_internal(const CellIteratorType &cell, const unsigned int q_index, const unsigned int mapping_index, const unsigned int fe_index)
Definition fe_values.cc:177
const hp::QCollection< 1 > q_collection_1D
Definition fe_values.h:334
const ObserverPointer< const hp::MappingCollection< dim > > mapping_collection
Definition fe_values.h:323
const RegionUpdateFlags region_update_flags
Definition fe_values.h:349
void reinit(const TriaIterator< DoFCellAccessor< dim, dim, level_dof_access > > &cell, const unsigned int q_index=numbers::invalid_unsigned_int, const unsigned int mapping_index=numbers::invalid_unsigned_int)
Definition fe_values.cc:149
std::optional<::FEValues< dim > > fe_values_inside
Definition fe_values.h:395
typename QuadratureGenerator< dim >::AdditionalData AdditionalData
Definition fe_values.h:144
DiscreteQuadratureGenerator< dim > quadrature_generator
Definition fe_values.h:418
std::deque< std::optional<::FEValues< dim > > > fe_values_outside_full_quadrature
Definition fe_values.h:386
unsigned int active_fe_index
Definition fe_values.h:344
const std::optional<::FEValues< dim > > & get_inside_fe_values() const
Definition fe_values.cc:305
#define DEAL_II_NAMESPACE_OPEN
Definition config.h:38
#define DEAL_II_NAMESPACE_CLOSE
Definition config.h:39
static ::ExceptionBase & ExcNotImplemented()
#define Assert(cond, exc)
UpdateFlags
constexpr unsigned int invalid_unsigned_int
Definition types.h:228