Dune-Fufem 2.11-git
Loading...
Searching...
No Matches
Constraints

Description

Utilities for handling affine constraints.

Classes

class  Dune::Fufem::AffineConstraints< BV, V, MI, C >
 Class to handle affine constraints on a subset of DOFs. More...
 

Functions

template<class BitVector = std::monostate, class Vector = std::monostate, class Basis >
auto Dune::Fufem::makeAffineConstraints (const Basis &basis)
 Create and initialize an AffineConstraints object for a basis.
 
template<class BV , class V , class MI , class C , class Basis , class Function , class IntersectionSet >
requires (Dune::Fufem::Forms::IsBoundaryDomain<IntersectionSet>::value or Dune::Fufem::Forms::IsSkeletonDomain<IntersectionSet>::value)
void Dune::Fufem::computeBoundaryConstraints (AffineConstraints< BV, V, MI, C > &constraints, const Basis &basis, Function &&f, const IntersectionSet &intersectionSet)
 Compute constraints for essential boundary conditions.
 
template<class BV , class V , class MI , class C , class Basis , class Function >
void Dune::Fufem::computeBoundaryConstraints (AffineConstraints< BV, V, MI, C > &constraints, const Basis &basis, Function &&f)
 Compute constraints for essential boundary conditions.
 
template<class BitVector = std::monostate, class Vector = std::monostate, class Basis , class Function , class IntersectionSet >
requires (Dune::Fufem::Forms::IsBoundaryDomain<IntersectionSet>::value or Dune::Fufem::Forms::IsSkeletonDomain<IntersectionSet>::value)
auto Dune::Fufem::makeBoundaryConstraints (const Basis &basis, Function &&f, const IntersectionSet &intersectionSet)
 Compute constraints for essential boundary conditions.
 
template<class BitVector = std::monostate, class Vector = std::monostate, class Basis , class Function >
auto Dune::Fufem::makeBoundaryConstraints (const Basis &basis, Function &&f)
 Compute constraints for essential boundary conditions.
 
template<class BV , class V , class MI , class C , class Basis >
void Dune::Fufem::computeContinuityConstraints (AffineConstraints< BV, V, MI, C > &constraints, const Basis &basis)
 Compute constraints for a conforming basis on a grid with hanging nodes.
 
template<class BitVector = std::monostate, class Vector = std::monostate, class Basis >
auto Dune::Fufem::makeContinuityConstraints (const Basis &basis)
 Compute constraints for a conforming basis on a grid with hanging nodes.
 
template<class PrimaryLocalView , class SecondaryLocalView , class SecondaryToPrimary , class SecondaryDOFs , class Constraints >
void Dune::Fufem::computeLocalInterpolationConstraints (const PrimaryLocalView &primaryLocalView, const SecondaryLocalView &secondaryLocalView, const SecondaryToPrimary &localSecondaryToPrimary, const SecondaryDOFs &secondaryDOFs, Constraints &constraints)
 Compute local constraints from interpolating between local views.
 
template<class BV , class V , class MI , class C , class PrimaryBasis , class PrimaryPatch , class SecondaryBasis , class SecondaryPatch , class SecondaryToPrimary >
void Dune::Fufem::computePeriodicConstraints (AffineConstraints< BV, V, MI, C > &constraints, const PrimaryBasis &primaryBasis, const PrimaryPatch &primaryPatch, const SecondaryBasis &secondaryBasis, const SecondaryPatch &secondaryPatch, const SecondaryToPrimary &secondaryToPrimary)
 Compute constraints for periodic boundary conditions.
 
template<class BV , class V , class MI , class C , class Basis , class PrimaryPatch , class SecondaryPatch , class SecondaryToPrimary >
void Dune::Fufem::computePeriodicConstraints (AffineConstraints< BV, V, MI, C > &constraints, const Basis &basis, const PrimaryPatch &primaryPatch, const SecondaryPatch &secondaryPatch, const SecondaryToPrimary &secondaryToPrimary)
 Compute constraints for periodic boundary conditions.
 

Function Documentation

◆ computeBoundaryConstraints() [1/2]

template<class BV , class V , class MI , class C , class Basis , class Function >
void Dune::Fufem::computeBoundaryConstraints ( AffineConstraints< BV, V, MI, C > &  constraints,
const Basis &  basis,
Function &&  f 
)

Compute constraints for essential boundary conditions.

Template Parameters
BasisType of the global basis
FunctionType of the function to interpolate
Parameters
constraintsAn initialized AffineConstraints object
basisA global basis
fThe Dirichlet values given as a function

This will interpolate the function f on the whole boundary and add constraints for all corresponding DOFs to constraints.

Note
This method assumes that the constraints has already been initialized. If constraints already contains constraint DOFs, then interpolation and the newly added constraints are reduced to the previously unconstrained DOFs.
Warning
This function is still experimental and the interface may change.

◆ computeBoundaryConstraints() [2/2]

template<class BV , class V , class MI , class C , class Basis , class Function , class IntersectionSet >
requires (Dune::Fufem::Forms::IsBoundaryDomain<IntersectionSet>::value or Dune::Fufem::Forms::IsSkeletonDomain<IntersectionSet>::value)
void Dune::Fufem::computeBoundaryConstraints ( AffineConstraints< BV, V, MI, C > &  constraints,
const Basis &  basis,
Function &&  f,
const IntersectionSet &  intersectionSet 
)

Compute constraints for essential boundary conditions.

Template Parameters
BasisType of the global basis
FunctionType of the function to interpolate
IntersectionSetType of IntersectionSet. This should satisfy Forms::IsBoundaryDomain or Forms::IsSkeletonDomain. This is e.g. the case for BoundaryPatch and Forms::Boundary.
Parameters
constraintsAn initialized AffineConstraints object
basisA global basis
fThe Dirichlet values given as a function
intersectionSetThe IntersectionSet where the boundary condition should be applied

This will interpolate the function f on the intersectionSet and add constraints for all corresponding DOFs to constraints.

Note
This method assumes that the constraints has already been initialized. If constraints already contains constraint DOFs, then interpolation and the newly added constraints are reduced to the previously unconstrained DOFs.
Warning
This function is still experimental and the interface may change.

◆ computeContinuityConstraints()

template<class BV , class V , class MI , class C , class Basis >
void Dune::Fufem::computeContinuityConstraints ( AffineConstraints< BV, V, MI, C > &  constraints,
const Basis &  basis 
)

Compute constraints for a conforming basis on a grid with hanging nodes.

Template Parameters
BasisType of the global basis
Parameters
constraintsAn initialized AffineConstraints object
basisA global basis

This will compute the constraints required to get a basis for the subspace of continuous functions. This method is intended to be used for getting the \(H^1\)-conforming subspace of a finite element space on a grid with hanging nodes. It assumes that DOFs for noncontinuous basis functions on an element can be interpolated from basis functions of neighboring elements on coarser levels.

Note
This method assumes that the AffineConstraints object constraints has already been initialized. It may also already contain constraints.
Warning
This function is still experimental and the interface may change.

◆ computeLocalInterpolationConstraints()

template<class PrimaryLocalView , class SecondaryLocalView , class SecondaryToPrimary , class SecondaryDOFs , class Constraints >
void Dune::Fufem::computeLocalInterpolationConstraints ( const PrimaryLocalView &  primaryLocalView,
const SecondaryLocalView &  secondaryLocalView,
const SecondaryToPrimary &  localSecondaryToPrimary,
const SecondaryDOFs &  secondaryDOFs,
Constraints &  constraints 
)

Compute local constraints from interpolating between local views.

Template Parameters
BasisType of the global basis
Parameters
primaryLocalViewThe primary local view
secondaryLocalViewThe secondary local view
localSecondaryToPrimaryCallback mapping local coordinates
secondaryDOFsA set of local DOFs to be interpolated
constraintsAn initialized AffineConstraints object that will be modified

For the given pair of local views the DOFs from the secondaryLocalView contained in the secondaryDOFs container are interpolated from the DOFs of the primaryLocalView. The secondary boundary face DOFs are marked as constrained and the interpolation weights are used as constraint weights.

The secondaryDOFs container must support secondaryDOFs.contains(secondaryLocalIndex).

Note
This function is primarily intended to be used inside of other functions computing global constraints, like, e.g. periodic or hanging node constraints.
Warning
This function is still experimental and the interface may change.

◆ computePeriodicConstraints() [1/2]

template<class BV , class V , class MI , class C , class Basis , class PrimaryPatch , class SecondaryPatch , class SecondaryToPrimary >
void Dune::Fufem::computePeriodicConstraints ( AffineConstraints< BV, V, MI, C > &  constraints,
const Basis &  basis,
const PrimaryPatch &  primaryPatch,
const SecondaryPatch &  secondaryPatch,
const SecondaryToPrimary &  secondaryToPrimary 
)

Compute constraints for periodic boundary conditions.

Template Parameters
BasisType of the global basis
PrimaryPatchType of BoundaryPatch (or intersection range) for the primary periodic boundary
SecondaryPatchType of BoundaryPatch (or intersection range) for the secondary periodic boundary
SecondaryToPrimaryType of boundary-to-boundary map
Parameters
constraintsAn initialized AffineConstraints object
basisA global basis
primaryPatchThe patch containing the primary part of the periodic boundary
secondaryPatchThe patch containing the secondary part of the periodic boundary
secondaryToPrimaryA function mapping coordinates from the secondary to primary boundary

This will first search matching pairs of boundary faces from the primaryPatch and secondaryPatch. A pair of faces is considered of match if the center of the secondary boundary face mapped to the primary boundary coincides (up to a tolerance) with the center of the primary boundary face. The mapping is done by the callback secondaryToPrimary.

For any matching pair the DOFs associated to the secondary boundary face are then interpolated from the DOFs on the primary boundary face. The secondary boundary face DOFs are marked as constrained and the interpolation weights are used as constraint weights.

Note
This method assumes that the constraints has already been initialized. If constraints already contains constraint DOFs, then the newly added constraints are reduced to the previously unconstrained DOFs.
Warning
This function is still experimental and the interface may change.

◆ computePeriodicConstraints() [2/2]

template<class BV , class V , class MI , class C , class PrimaryBasis , class PrimaryPatch , class SecondaryBasis , class SecondaryPatch , class SecondaryToPrimary >
void Dune::Fufem::computePeriodicConstraints ( AffineConstraints< BV, V, MI, C > &  constraints,
const PrimaryBasis &  primaryBasis,
const PrimaryPatch &  primaryPatch,
const SecondaryBasis &  secondaryBasis,
const SecondaryPatch &  secondaryPatch,
const SecondaryToPrimary &  secondaryToPrimary 
)

Compute constraints for periodic boundary conditions.

Template Parameters
PrimaryBasisType of the primary global basis
PrimaryPatchType of BoundaryPatch (or intersection range) for the primary periodic boundary
SecondaryBasisType of the secondary global basis
SecondaryPatchType of BoundaryPatch (or intersection range) for the secondary periodic boundary
SecondaryToPrimaryType of boundary-to-boundary map
Parameters
constraintsAn initialized AffineConstraints object
primaryBasisA global basis to be considered on the primary boundary
primaryPatchThe patch containing the primary part of the periodic boundary
secondaryBasisA global basis to be considered on the secondary boundary
secondaryPatchThe patch containing the secondary part of the periodic boundary
secondaryToPrimaryA function mapping coordinates from the secondary to primary boundary

This will first search matching pairs of boundary faces from the primaryPatch and secondaryPatch. A pair of faces is considered of match if the center of the secondary boundary face mapped to the primary boundary coincides (up to a tolerance) with the center of the primary boundary face. The mapping is done by the callback secondaryToPrimary.

For any matching pair the secondary basis DOFs associated to the secondary boundary face are then interpolated from the primary basis DOFs on the primary boundary face. The secondary boundary face DOFs are marked as constrained and the interpolation weights are used as constraint weights.

Note
This method assumes that the constraints has already been initialized. If constraints already contains constraint DOFs, then the newly added constraints are reduced to the previously unconstrained DOFs.
Warning
This function is still experimental and the interface may change.

◆ makeAffineConstraints()

template<class BitVector = std::monostate, class Vector = std::monostate, class Basis >
auto Dune::Fufem::makeAffineConstraints ( const Basis &  basis)

Create and initialize an AffineConstraints object for a basis.

Template Parameters
BitVectorA bit vector type suitable for the global indices of the basis
VectorA coefficient vector type suitable for the global indices of the basis
BasisType of the global basis
Parameters
basisA global basis

If the template default value std::monostate is used for the template parameters BitVector or Vector then the actual container types are deduced using Dune::Functions::makeContainer(...) and Dune::Functions::makeISTLVector(...) from the container descriptor provided by basis (only with dune-function>=2.11).

◆ makeBoundaryConstraints() [1/2]

template<class BitVector = std::monostate, class Vector = std::monostate, class Basis , class Function >
auto Dune::Fufem::makeBoundaryConstraints ( const Basis &  basis,
Function &&  f 
)

Compute constraints for essential boundary conditions.

Template Parameters
BitVectorA bit vector type suitable for the global indices of the basis
VectorA coefficient vector type suitable for the global indices of the basis
BasisType of the global basis
FunctionType of the function to interpolate
Parameters
basisA global basis
fThe Dirichlet values given as a function

This will interpolate the function f on the boundary and return an AffineConstraints object constraining all corresponding DOFs.

If the template default value std::monostate is used for the template parameters BitVector or Vector then the actual container types are deduced using Dune::Functions::makeContainer(...) and Dune::Functions::makeISTLVector(...) from the container descriptor provided by basis (only with dune-function>=2.11).

Warning
This function is still experimental and the interface may change.

◆ makeBoundaryConstraints() [2/2]

template<class BitVector = std::monostate, class Vector = std::monostate, class Basis , class Function , class IntersectionSet >
requires (Dune::Fufem::Forms::IsBoundaryDomain<IntersectionSet>::value or Dune::Fufem::Forms::IsSkeletonDomain<IntersectionSet>::value)
auto Dune::Fufem::makeBoundaryConstraints ( const Basis &  basis,
Function &&  f,
const IntersectionSet &  intersectionSet 
)

Compute constraints for essential boundary conditions.

Template Parameters
BitVectorA bit vector type suitable for the global indices of the basis
VectorA coefficient vector type suitable for the global indices of the basis
BasisType of the global basis
FunctionType of the function to interpolate
IntersectionSetType of IntersectionSet. This should satisfy Forms::IsBoundaryDomain or Forms::IsSkeletonDomain. This is e.g. the case for BoundaryPatch and Forms::Boundary.
Parameters
basisA global basis
fThe Dirichlet values given as a function
intersectionSetThe IntersectionSet where the boundary condition should be applied

This will interpolate the function f on the intersectionSet and return an AffineConstraints object constraining all corresponding DOFs.

If the template default value std::monostate is used for the template parameters BitVector or Vector then the actual container types are deduced using Dune::Functions::makeContainer(...) and Dune::Functions::makeISTLVector(...) from the container descriptor provided by basis (only with dune-function>=2.11).

Warning
This function is still experimental and the interface may change.

◆ makeContinuityConstraints()

template<class BitVector = std::monostate, class Vector = std::monostate, class Basis >
auto Dune::Fufem::makeContinuityConstraints ( const Basis &  basis)

Compute constraints for a conforming basis on a grid with hanging nodes.

Template Parameters
BitVectorA bit vector type suitable for the global indices of the basis
VectorA coefficient vector type suitable for the global indices of the basis
BasisType of the global basis
Parameters
basisA global basis

This will compute the constraints required to get a basis for the subspace of continuous functions. This method is intended to be used for getting the \(H^1\)-conforming subspace of a finite element space on a grid with hanging nodes. It assumes that DOFs for noncontinuous basis functions on an element can be interpolated from basis functions of neighboring elements on coarser levels.

The constraints are returned as AffineConstraints object. The result can be used to constrain a linear system to the conforming subspace.

If the template default value std::monostate is used for the template parameters BitVector or Vector then the actual container types are deduced using Dune::Functions::makeContainer(...) and Dune::Functions::makeISTLVector(...) from the container descriptor provided by basis (only with dune-function>=2.11).

Warning
This function is still experimental and the interface may change.