deal.II version GIT relicensing-2289-g1e5549a87a 2024-12-21 21:30:00+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
Public Types | Public Member Functions | Private Member Functions | Private Attributes | List of all members
NonMatching::FEInterfaceValues< dim > Class Template Reference

#include <deal.II/non_matching/fe_values.h>

Public Types

using AdditionalData = typename FaceQuadratureGenerator< dim >::AdditionalData
 

Public Member Functions

template<typename Number >
 FEInterfaceValues (const hp::FECollection< dim > &fe_collection, const Quadrature< 1 > &quadrature, const RegionUpdateFlags region_update_flags, const MeshClassifier< dim > &mesh_classifier, const DoFHandler< dim > &dof_handler, const ReadVector< Number > &level_set, const AdditionalData &additional_data=AdditionalData())
 
template<typename Number >
 FEInterfaceValues (const hp::MappingCollection< dim > &mapping_collection, const hp::FECollection< dim > &fe_collection, const hp::QCollection< dim - 1 > &q_collection, const hp::QCollection< 1 > &q_collection_1d, const RegionUpdateFlags region_update_flags, const MeshClassifier< dim > &mesh_classifier, const DoFHandler< dim > &dof_handler, const ReadVector< Number > &level_set, const AdditionalData &additional_data=AdditionalData())
 
template<typename CellIteratorType , typename CellNeighborIteratorType >
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)
 
template<typename CellIteratorType >
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)
 
const std::optional<::FEInterfaceValues< dim > > & get_inside_fe_values () const
 
const std::optional<::FEInterfaceValues< dim > > & get_outside_fe_values () const
 

Private Member Functions

void initialize (const hp::QCollection< dim - 1 > &q_collection)
 
template<typename CellAccessorType >
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)
 

Private Attributes

const ObserverPointer< const hp::MappingCollection< dim > > mapping_collection
 
const ObserverPointer< const hp::FECollection< dim > > fe_collection
 
const hp::QCollection< 1 > q_collection_1D
 
LocationToLevelSet current_face_location
 
const RegionUpdateFlags region_update_flags
 
const ObserverPointer< const MeshClassifier< dim > > mesh_classifier
 
std::optional<::FEInterfaceValues< dim > > fe_values_inside_full_quadrature
 
std::optional<::FEInterfaceValues< dim > > fe_values_outside_full_quadrature
 
std::optional<::FEInterfaceValues< dim > > fe_values_inside
 
std::optional<::FEInterfaceValues< dim > > fe_values_outside
 
DiscreteFaceQuadratureGenerator< dim > face_quadrature_generator
 

Detailed Description

template<int dim>
class NonMatching::FEInterfaceValues< dim >

This class is intended to facilitate assembling interface terms on faces in immersed (in the sense of cut) finite element methods. These types of terms occur mainly in cut discontinuous Galerkin methods. This class works analogously to NonMatching::FEValues. The domain is assumed to be described by a level set function, \(\psi : \mathbb{R}^{dim} \to \mathbb{R}\), and this class assumes that we want to integrate over two different regions of each face, \(F\):

\[ N = \{x \in F : \psi(x) < 0 \}, \\ P = \{x \in F : \psi(x) > 0 \}, \]

which we as before refer to as the "inside" and "outside" regions of the face.

When calling one of the reinit functions of this class, this class will create quadrature rules over these regions in the background and set up FEInterfaceValues objects with these quadratures. These objects can then be accessed through one of the functions: get_inside_fe_values() or get_outside_fe_values(). For the same reason as described in NonMatching::FEValues, the returned the FEInterfaceValues objects that get_inside/outside_fe_values() returns is wrapped in a std::optional. Assembling using this class would then typically be done in the following way:

NonMatching::FEInterfaceValues<dim> fe_interface_values(...)
for (const auto &cell : dof_handler.active_cell_iterators())
{
for (const unsigned int face_index : cell->face_indices())
{
if (cell->at_boundary(face_index))
fe_interface_values.reinit(cell, face_index);
else
fe_interface_values.reinit(cell,
face_index,
subface_index,
cell->neighbor(face_index),
cell->neighbor_of_neighbor(face_index),
neighbor_subface_index);
const std::optional<::FEInterfaceValues<dim>>
&inside_fe_values = fe_interface_values.get_inside_fe_values();
// Check if the returned optional contains a value
if (inside_fe_values)
{
// Assemble locally
}
}
}
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)

To reduce the amount of work, the reinit() function of this class uses the MeshClassifier passed to the constructor to check how the incoming cell relates to the level set function. The immersed quadrature rules are only generated if the cell is intersected. If the cell is completely inside or outside, it returns a cached FEInterfaceValues object created with a quadrature over the reference cell: \([0, 1]^{dim-1}\).

Definition at line 488 of file fe_values.h.

Member Typedef Documentation

◆ AdditionalData

template<int dim>
using NonMatching::FEInterfaceValues< dim >::AdditionalData = typename FaceQuadratureGenerator<dim>::AdditionalData

Definition at line 491 of file fe_values.h.

Constructor & Destructor Documentation

◆ FEInterfaceValues() [1/2]

template<int dim>
template<typename Number >
FEInterfaceValues< dim >::FEInterfaceValues ( const hp::FECollection< dim > &  fe_collection,
const Quadrature< 1 > &  quadrature,
const RegionUpdateFlags  region_update_flags,
const MeshClassifier< dim > &  mesh_classifier,
const DoFHandler< dim > &  dof_handler,
const ReadVector< Number > &  level_set,
const AdditionalData additional_data = AdditionalData() 
)

Constructor.

Parameters
fe_collectionCollection of FiniteElements to be used.
quadrature1-dimensional quadrature rule used to generate the immersed quadrature rules. See the QuadratureGenerator class. On the non intersected faces a tensor product of this quadrature will be used.
mesh_classifierObject used to determine when the immersed quadrature rules need to be generated.
region_update_flagsStruct storing UpdateFlags for the inside/outside region of the cell.
dof_handlerThe DoFHandler associated with the discrete level set function.
level_setThe degrees of freedom of the discrete level set function.
additional_dataAdditional data passed to the QuadratureGenerator class.
Note
Pointers to fe_collection, mesh_classifier, dof_handler, and level_set are stored internally, so these need to have a longer life span than the instance of this class.

Definition at line 339 of file fe_values.cc.

◆ FEInterfaceValues() [2/2]

template<int dim>
template<typename Number >
FEInterfaceValues< dim >::FEInterfaceValues ( const hp::MappingCollection< dim > &  mapping_collection,
const hp::FECollection< dim > &  fe_collection,
const hp::QCollection< dim - 1 > &  q_collection,
const hp::QCollection< 1 > &  q_collection_1d,
const RegionUpdateFlags  region_update_flags,
const MeshClassifier< dim > &  mesh_classifier,
const DoFHandler< dim > &  dof_handler,
const ReadVector< Number > &  level_set,
const AdditionalData additional_data = AdditionalData() 
)

Constructor.

Parameters
mapping_collectionCollection of Mappings to be used.
fe_collectionCollection of FiniteElements to be used.
q_collectionCollection of Quadrature rules over \([0, 1]^{dim-1}\) that should be used when a face is not intersected and we do not need to generate immersed quadrature rules.
q_collection_1dCollection of 1-dimensional quadrature rules used to generate the immersed quadrature rules. See the QuadratureGenerator class.
mesh_classifierObject used to determine when the immersed quadrature rules need to be generated.
region_update_flagsStruct storing UpdateFlags for the inside/outside region of the cell.
dof_handlerThe DoFHandler associated with the discrete level set function.
level_setThe degrees of freedom of the discrete level set function.
additional_dataAdditional data passed to the QuadratureGenerator class.
Note
Pointers to mapping_collection, fe_collection, mesh_classifier, dof_handler, and level_set are stored internally, so these need to have a longer life span than the instance of this class.

Definition at line 370 of file fe_values.cc.

Member Function Documentation

◆ reinit() [1/2]

template<int dim>
template<typename CellIteratorType , typename CellNeighborIteratorType >
void NonMatching::FEInterfaceValues< dim >::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 
)

Reinitialize on the shared face between two neighboring cells. After calling this function, an FEInterfaceValues object can be retrieved for each region using the functions get_inside_fe_values() or get_outside_fe_values().

Note
Currently cell and cell_neighbor need to have the same finite element associated with them.
Specifying sub_face_no/sub_face_no_neighbor is currently not implemented, the passed values of these must equal numbers::invalid_unsigned_int.

◆ reinit() [2/2]

template<int dim>
template<typename CellIteratorType >
void NonMatching::FEInterfaceValues< dim >::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 
)

Reinitialize on a face on the boundary of the domain, when there is no neighbor and a single face face_no of the cell. After calling this function, an FEInterfaceValues object can be retrieved for each region using the functions get_inside_fe_values() or get_outside_fe_values().

◆ get_inside_fe_values()

template<int dim>
const std::optional<::FEInterfaceValues< dim > > & FEInterfaceValues< dim >::get_inside_fe_values ( ) const

Return an FEInterfaceValues object reinitialized with a quadrature for the inside region of the cell: \(\{x \in K : \psi(x) < 0 \}\).

Note
If the quadrature rule over the region is empty, e.g. because the cell is completely located in the outside domain, the returned optional will not contain a value.

Definition at line 537 of file fe_values.cc.

◆ get_outside_fe_values()

template<int dim>
const std::optional<::FEInterfaceValues< dim > > & FEInterfaceValues< dim >::get_outside_fe_values ( ) const

Return an FEInterfaceValues object reinitialized with a quadrature for the outside region of the cell: \(\{x \in K : \psi(x) > 0 \}\).

Note
If the quadrature rule over the region is empty, e.g. because the cell is completely located in the inside domain, the returned optional will not contain a value.

Definition at line 549 of file fe_values.cc.

◆ initialize()

template<int dim>
void FEInterfaceValues< dim >::initialize ( const hp::QCollection< dim - 1 > &  q_collection)
private

Do work common to the constructors. The incoming QCollection should be quadratures integrating over \([0, 1]^{dim-1}\). These will be used on the non-intersected cells.

Definition at line 397 of file fe_values.cc.

◆ do_reinit()

template<int dim>
template<typename CellAccessorType >
void FEInterfaceValues< dim >::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 
)
private

Do work that is common two the two reinit functions of the class. call_reinit is a std::function that describes how we should call reinit on a single FEInterfaceValues object, which is what differs between the two reinit functions.

Definition at line 434 of file fe_values.cc.

Member Data Documentation

◆ mapping_collection

template<int dim>
const ObserverPointer<const hp::MappingCollection<dim> > NonMatching::FEInterfaceValues< dim >::mapping_collection
private

A pointer to the collection of mappings to be used.

Definition at line 653 of file fe_values.h.

◆ fe_collection

template<int dim>
const ObserverPointer<const hp::FECollection<dim> > NonMatching::FEInterfaceValues< dim >::fe_collection
private

A pointer to the collection of finite elements to be used.

Definition at line 658 of file fe_values.h.

◆ q_collection_1D

template<int dim>
const hp::QCollection<1> NonMatching::FEInterfaceValues< dim >::q_collection_1D
private

Collection of 1-dimensional quadrature rules that are used by QuadratureGenerator as base for generating the immersed quadrature rules.

Definition at line 664 of file fe_values.h.

◆ current_face_location

template<int dim>
LocationToLevelSet NonMatching::FEInterfaceValues< dim >::current_face_location
private

Location of the last face that reinit was called with.

Definition at line 669 of file fe_values.h.

◆ region_update_flags

template<int dim>
const RegionUpdateFlags NonMatching::FEInterfaceValues< dim >::region_update_flags
private

The update flags passed to the constructor.

Definition at line 674 of file fe_values.h.

◆ mesh_classifier

template<int dim>
const ObserverPointer<const MeshClassifier<dim> > NonMatching::FEInterfaceValues< dim >::mesh_classifier
private

Pointer to the MeshClassifier passed to the constructor.

Definition at line 679 of file fe_values.h.

◆ fe_values_inside_full_quadrature

template<int dim>
std::optional<::FEInterfaceValues<dim> > NonMatching::FEInterfaceValues< dim >::fe_values_inside_full_quadrature
private

FEInterfaceValues corresponding to cells with LocationToLevelSet INSIDE (not needed to generate an immersed quadrature).

Definition at line 686 of file fe_values.h.

◆ fe_values_outside_full_quadrature

template<int dim>
std::optional<::FEInterfaceValues<dim> > NonMatching::FEInterfaceValues< dim >::fe_values_outside_full_quadrature
private

FEInterfaceValues corresponding to cells with LocationToLevelSet OUTSIDE (not needed to generate an immersed quadrature).

Definition at line 693 of file fe_values.h.

◆ fe_values_inside

template<int dim>
std::optional<::FEInterfaceValues<dim> > NonMatching::FEInterfaceValues< dim >::fe_values_inside
private

FEInterfaceValues object created with a quadrature rule integrating over the inside region, \(\{x \in B : \psi(x) < 0 \}\), that was generated in the last call to reinit(..). If the cell in the last call was not intersected or if 0 quadrature points were generated, this optional will not contain a value.

Definition at line 702 of file fe_values.h.

◆ fe_values_outside

template<int dim>
std::optional<::FEInterfaceValues<dim> > NonMatching::FEInterfaceValues< dim >::fe_values_outside
private

FEInterfaceValues object created with a quadrature rule integrating over the outside region, \(\{x \in B : \psi(x) > 0 \}\), that was generated in the last call to reinit(..). If the cell in the last call was not intersected or if 0 quadrature points were generated, this optional will not contain a value.

Definition at line 711 of file fe_values.h.

◆ face_quadrature_generator

template<int dim>
DiscreteFaceQuadratureGenerator<dim> NonMatching::FEInterfaceValues< dim >::face_quadrature_generator
private

Object that generates the immersed quadrature rules.

Definition at line 716 of file fe_values.h.


The documentation for this class was generated from the following files: