DUNE-ACFEM (unstable)

Dune::ACFem::BulkBlockConstraints< DiscreteFunctionSpace, MaskStorage > Class Template Referenceabstract

A default implementation for bulk block constraints. More...

#include <dune/acfem/operators/constraints/bulkblockconstraints.hh>

Public Member Functions

 BulkBlockConstraints (const DiscreteFunctionSpaceType &space)
 Construct an empty operator.
 
virtual void update () const =0
 Update the set of constrained DoFs and their prescirbed DoF-values. More...
 
virtual void updateValues () const
 Only update the prescribed values. More...
 
template<class DomainDiscreteFunction , class RangeDiscreteFunction >
void operator() (const DomainDiscreteFunction &u, RangeDiscreteFunction &w) const
 Apply the operator to the given argument. More...
 
template<class DomainDiscreteFunction , class JacobianOperator >
void jacobian (const DomainDiscreteFunction &u, JacobianOperator &jOp) const
 The Jacobian of the operator. More...
 
template<class DomainDiscreteFunction , class JacobianOperator >
void applyToOperator (const DomainDiscreteFunction &u, JacobianOperator &jOp) const
 Dune::Fem compat.
 
template<class DomainDiscreteFunction >
void constrain (DomainDiscreteFunction &w) const
 The solution operator; unconditionally install the given constraints into the argument. More...
 
template<class DomainDiscreteFunction >
void zeroConstrain (DomainDiscreteFunction &w) const
 Unconditionally set the values of all masked DoFs to zero.
 
size_t size () const
 Return the number of constrained scalar DoFs.
 
void reset () const
 Delete the cached "sequence" of the underlying discrete space. More...
 

Protected Member Functions

void checkUpdate () const
 Update mask and values if the underlying space has changed.
 
virtual void communicate () const
 Communicate the mask-values and the Dirichlet values as needed.
 

Detailed Description

template<class DiscreteFunctionSpace, template< class T, class Alloc=std::allocator< T > > class MaskStorage = std::vector>
class Dune::ACFem::BulkBlockConstraints< DiscreteFunctionSpace, MaskStorage >

A default implementation for bulk block constraints.

BulkBlockConstraints maintain a flag vector of masked-out DoFs and a DiscreteFunction which contains the values the masked-out DoFs are constrained to. Despite their name currently this class also serves as base for the DirichletBlockConstraints class. The implementation should be fairly efficient, but at the cost of the memory overhead caused by storing the constaint-values in an ordinary Dune::Fem::DiscreteFunction. We only implement the differentiable variant which needs a JacobianOperator (typically a matrix-class) as template argument.

Member Function Documentation

◆ constrain()

template<class DiscreteFunctionSpace , template< class T, class Alloc=std::allocator< T > > class MaskStorage = std::vector>
template<class DomainDiscreteFunction >
void Dune::ACFem::BulkBlockConstraints< DiscreteFunctionSpace, MaskStorage >::constrain ( DomainDiscreteFunction &  w) const
inline

The solution operator; unconditionally install the given constraints into the argument.

This "solves"

\[ w - g = 0 \]

for w.

References Dune::ACFem::BulkBlockConstraints< DiscreteFunctionSpace, MaskStorage >::checkUpdate(), and Dune::ACFem::BulkBlockConstraints< DiscreteFunctionSpace, MaskStorage >::size().

◆ jacobian()

template<class DiscreteFunctionSpace , template< class T, class Alloc=std::allocator< T > > class MaskStorage = std::vector>
template<class DomainDiscreteFunction , class JacobianOperator >
void Dune::ACFem::BulkBlockConstraints< DiscreteFunctionSpace, MaskStorage >::jacobian ( const DomainDiscreteFunction &  u,
JacobianOperator &  jOp 
) const
inline

The Jacobian of the operator.

As the operator acts as identity minus affine offset, the Jacobian acts as identity. The methods does not alter any lines of jOp except for the "active" DoFs. The method handles slave-DoFs correctly in parallel runs.

References Dune::ACFem::BulkBlockConstraints< DiscreteFunctionSpace, MaskStorage >::checkUpdate(), and Dune::ACFem::BulkBlockConstraints< DiscreteFunctionSpace, MaskStorage >::size().

Referenced by Dune::ACFem::BulkBlockConstraints< DiscreteFunctionSpace, MaskStorage >::applyToOperator().

◆ operator()()

template<class DiscreteFunctionSpace , template< class T, class Alloc=std::allocator< T > > class MaskStorage = std::vector>
template<class DomainDiscreteFunction , class RangeDiscreteFunction >
void Dune::ACFem::BulkBlockConstraints< DiscreteFunctionSpace, MaskStorage >::operator() ( const DomainDiscreteFunction &  u,
RangeDiscreteFunction &  w 
) const
inline

Apply the operator to the given argument.

This operates as an affine linear operator which computes

w = u - g

where g defines the target constraints values. The operator acts only on the given subset of "active" DoFs (e.g. the boundary DoFs) and leaves all other values of w alone.

References Dune::ACFem::BulkBlockConstraints< DiscreteFunctionSpace, MaskStorage >::checkUpdate(), and Dune::ACFem::BulkBlockConstraints< DiscreteFunctionSpace, MaskStorage >::size().

◆ reset()

template<class DiscreteFunctionSpace , template< class T, class Alloc=std::allocator< T > > class MaskStorage = std::vector>
void Dune::ACFem::BulkBlockConstraints< DiscreteFunctionSpace, MaskStorage >::reset ( ) const
inline

Delete the cached "sequence" of the underlying discrete space.

The next call to checkUpdate() will then trigger an update of mask and values.

Referenced by Dune::ACFem::BulkBlockConstraints< DiscreteFunctionSpace, MaskStorage >::updateValues().

◆ update()

◆ updateValues()

template<class DiscreteFunctionSpace , template< class T, class Alloc=std::allocator< T > > class MaskStorage = std::vector>
virtual void Dune::ACFem::BulkBlockConstraints< DiscreteFunctionSpace, MaskStorage >::updateValues ( ) const
inlinevirtual

Only update the prescribed values.

The default implementation is to reset the space-sequence and simply update values and mask. Individual implementation may want to handle this more efficiently.

References Dune::ACFem::BulkBlockConstraints< DiscreteFunctionSpace, MaskStorage >::reset(), and Dune::ACFem::BulkBlockConstraints< DiscreteFunctionSpace, MaskStorage >::update().


The documentation for this class was generated from the following file:
Creative Commons License   |  Legal Statements / Impressum  |  Hosted by TU Dresden  |  generated with Hugo v0.111.3 (Dec 27, 23:30, 2024)