deal.II version GIT relicensing-2291-g668cd86249 2024-12-24 11: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 Attributes | List of all members
NonMatching::QuadratureGenerator< dim > Class Template Reference

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

Inheritance diagram for NonMatching::QuadratureGenerator< dim >:
Inheritance graph
[legend]

Public Types

using AdditionalData = AdditionalQGeneratorData
 

Public Member Functions

 QuadratureGenerator (const hp::QCollection< 1 > &quadratures1D, const AdditionalData &additional_data=AdditionalData())
 
void clear_quadratures ()
 
void generate (const Function< dim > &level_set, const BoundingBox< dim > &box)
 
void generate_append (const Function< dim > &level_set, const BoundingBox< dim > &box)
 
const Quadrature< dim > & get_inside_quadrature () const
 
const Quadrature< dim > & get_outside_quadrature () const
 
const ImmersedSurfaceQuadrature< dim > & get_surface_quadrature () const
 
void set_1D_quadrature (const unsigned int q_index)
 

Private Attributes

internal::QuadratureGeneratorImplementation::QGenerator< dim, dim > q_generator
 

Detailed Description

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

This class creates immersed quadrature rules over a BoundingBox, \(B \subset \mathbb{R}^{dim}\), when the domain is described by a level set function, \(\psi\).

This class creates quadrature rules for the intersections between the box and the three different regions defined by the level set function. That is, it creates quadrature rules to integrate over the following regions

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

When working with level set functions, the most common is to describe a domain, \(\Omega\), as

\[ \Omega = \{ x \in \mathbb{R}^{dim} : \psi(x) < 0 \}. \]

Given this, we shall use the name convention that \(N\) is the "inside" region (i.e. inside \(\Omega\)), \(P\) is the "outside" region and \(S\) is the "surface" region. The "inside" and "outside" quadratures will also be referred to as the "bulk"-quadratures.

The underlying algorithm use a 1-dimensional quadrature rule as base for creating the immersed quadrature rules. Gauss-Legendre quadrature (QGauss) is recommended. The constructor takes an hp::QCollection<1>. One can select which 1d-quadrature in the collection should be used through the set_1d_quadrature() function. The number of quadrature points in the constructed quadratures will vary depending on the level set function. More quadrature points will be created if the intersection is "bad", for example, if the zero-contour has a high curvature compared to the size of the box. However, if the number of points in the 1d quadrature is \(n\) the number of points will be proportional to \(n^{dim}\) in the bulk quadratures and to \(n^{dim-1}\) in the surface quadrature. For example, in the 2d-example in the above figure, there are 2 points in the 1d-quadrature. If the 1d-quadrature is a Gauss-Legendre quadrature and the grid has size \(h\), the immersed quadratures typically give global errors proportional to \(h^{2n}\), both for the bulk and surface integrals. If the 1d-quadrature has positive weights, the weights of the immersed quadratures will also be positive.

A detailed description of the underlying algorithm can be found in [192]. This implementation has some modifications compared to the algorithm description in the paper. In particular, it builds the three different types of quadratures (inside, outside and surface) simultaneously. Further, the so-called "pruning" step is not yet implemented.

Definition at line 184 of file quadrature_generator.h.

Member Typedef Documentation

◆ AdditionalData

template<int dim>
using NonMatching::QuadratureGenerator< dim >::AdditionalData = AdditionalQGeneratorData

Definition at line 187 of file quadrature_generator.h.

Constructor & Destructor Documentation

◆ QuadratureGenerator()

template<int dim>
NonMatching::QuadratureGenerator< dim >::QuadratureGenerator ( const hp::QCollection< 1 > &  quadratures1D,
const AdditionalData additional_data = AdditionalData() 
)

Constructor. Each Quadrature<1> in quadratures1d can be chosen as base for generating the immersed quadrature rules.

Note
It is important that each 1d-quadrature rule in the hp::QCollection does not contain the points 0 and 1.

Definition at line 1806 of file quadrature_generator.cc.

Member Function Documentation

◆ clear_quadratures()

template<int dim>
void NonMatching::QuadratureGenerator< dim >::clear_quadratures ( )

Clears the inside, outside and surface quadratures.

Definition at line 1819 of file quadrature_generator.cc.

◆ generate()

template<int dim>
void NonMatching::QuadratureGenerator< dim >::generate ( const Function< dim > &  level_set,
const BoundingBox< dim > &  box 
)

Construct immersed quadratures rules for the incoming level set function over the BoundingBox.

To get the constructed quadratures, use the functions get_inside_quadrature(), get_outside_quadrature(), get_surface_quadrature().

Note
Both value, gradient and hessian need to be implemented on the incoming function.

Definition at line 1828 of file quadrature_generator.cc.

◆ generate_append()

template<int dim>
void NonMatching::QuadratureGenerator< dim >::generate_append ( const Function< dim > &  level_set,
const BoundingBox< dim > &  box 
)

Same as above but does not clear quadratures and appends it to the existing quadrature instead.

Definition at line 1839 of file quadrature_generator.cc.

◆ get_inside_quadrature()

template<int dim>
const Quadrature< dim > & NonMatching::QuadratureGenerator< dim >::get_inside_quadrature ( ) const

Return the quadrature rule for the region \(\{x \in B : \psi(x) < 0 \}\) created in the previous call to generate(). Here, \(B\) is BoundingBox passed to generate().

Definition at line 1869 of file quadrature_generator.cc.

◆ get_outside_quadrature()

template<int dim>
const Quadrature< dim > & NonMatching::QuadratureGenerator< dim >::get_outside_quadrature ( ) const

Return the quadrature rule for the region \(\{x \in B : \psi(x) > 0 \}\) created in the previous call to generate(). Here, \(B\) is BoundingBox passed to generate().

Definition at line 1878 of file quadrature_generator.cc.

◆ get_surface_quadrature()

template<int dim>
const ImmersedSurfaceQuadrature< dim > & NonMatching::QuadratureGenerator< dim >::get_surface_quadrature ( ) const

Return the quadrature rule for the region \(\{x \in B : \psi(x) = 0 \}\) created in the previous call to generate(). Here, \(B\) is BoundingBox passed to generate().

Note
The normal at the quadrature points will be parallel to \(\nabla \psi\).

Definition at line 1887 of file quadrature_generator.cc.

◆ set_1D_quadrature()

template<int dim>
void NonMatching::QuadratureGenerator< dim >::set_1D_quadrature ( const unsigned int  q_index)

Set which 1d-quadrature in the collection passed to the constructor should be used to create the immersed quadratures.

Definition at line 1895 of file quadrature_generator.cc.

Member Data Documentation

◆ q_generator

QuadratureGenerator is mainly used to start up the recursive algorithm. This is the object that actually generates the quadratures.

Definition at line 271 of file quadrature_generator.h.


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