Plugins
ug::Electromagnetism::NedelecTransfer< TDomain, TAlgebra > Class Template Reference

Class of the prolongation and the restriction of the Nedelec DoFs. More...

#include <nedelec_transfer.h>

+ Inheritance diagram for ug::Electromagnetism::NedelecTransfer< TDomain, TAlgebra >:

Classes

struct  AssembleProlongationMatrix
 a helper class to call all the type-dependent assembling functions More...
 

Public Types

typedef TAlgebra algebra_type
 Type of algebra. More...
 
typedef ITransferOperator< TDomain, TAlgebra > base_type
 Type of base class. More...
 
typedef TDomain domain_type
 Type of Domain. More...
 
typedef TAlgebra::matrix_type matrix_type
 Type of Vector. More...
 
typedef NedelecTransfer< TDomain, TAlgebra > this_type
 This type. More...
 
typedef TAlgebra::vector_type vector_type
 Type of Vector. More...
 
- Public Types inherited from ug::ITransferOperator< TDomain, TAlgebra >
typedef TDomain domain_type
 
typedef TAlgebra::matrix_type matrix_type
 
typedef TAlgebra::vector_type vector_type
 

Public Member Functions

SmartPtr< ITransferOperator< TDomain, TAlgebra > > clone ()
 returns new instance with same setting More...
 
void do_restrict (vector_type &uCoarse, const vector_type &uFine)
 apples the restriction = transposed prolongation More...
 
void init ()
 initializes the operator (computes the prolongation matrix etc) More...
 
 NedelecTransfer (SmartPtr< ApproximationSpace< TDomain > > approxSpace)
 Constructor setting approximation space. More...
 
void prolongate (vector_type &uFineOut, const vector_type &uCoarse)
 applies the prolongation More...
 
virtual void set_levels (GridLevel coarseLevel, GridLevel fineLevel)
 Set levels. More...
 
- Public Member Functions inherited from ug::ITransferOperator< TDomain, TAlgebra >
virtual void add_constraint (SmartPtr< IConstraint< TAlgebra > > pp)
 
virtual void clear_constraints ()
 
 ITransferOperator ()
 
virtual SmartPtr< matrix_typeprolongation (const GridLevel &fineGL, const GridLevel &coarseGL, ConstSmartPtr< ApproximationSpace< TDomain > > spApproxSpace)
 
virtual void remove_constraint (SmartPtr< IConstraint< TAlgebra > > pp)
 
virtual SmartPtr< matrix_typerestriction (const GridLevel &coarseGL, const GridLevel &fineGL, ConstSmartPtr< ApproximationSpace< TDomain > > spApproxSpace)
 
virtual ~ITransferOperator ()
 

Static Public Attributes

static const int WDim = TDomain::dim
 world dimention More...
 

Private Member Functions

template<typename TElem >
void assemble_prolongation_matrix (matrix_type &mat, std::vector< bool > &vIsRestricted, const DoFDistribution &coarseDD, const DoFDistribution &fineDD)
 assembles the prolongation matrix for one type of the grid elements More...
 
void check_approximation_space ()
 checks the approximation space More...
 

Private Attributes

bool m_bInit
 initialization flag More...
 
GridLevel m_coarseLevel
 coarse grid level More...
 
GridLevel m_fineLevel
 fine grid level More...
 
matrix_type m_prolongation_matrix
 matrix to store prolongation More...
 
SmartPtr< ApproximationSpace< TDomain > > m_spApproxSpace
 approximation space More...
 
std::vector< bool > m_vIsRestricted
 restriction flag More...
 

Additional Inherited Members

- Protected Attributes inherited from ug::ITransferOperator< TDomain, TAlgebra >
std::vector< SmartPtr< IConstraint< TAlgebra > > > m_vConstraint
 

Detailed Description

template<typename TDomain, typename TAlgebra>
class ug::Electromagnetism::NedelecTransfer< TDomain, TAlgebra >

Class of the prolongation and the restriction of the Nedelec DoFs.

The prolongation is based on the transformation of the Nelelec DoF values into the vector-valued functions using the basis Nedelec (Whitney-1) shape functions on the coarse grid elements and the computation of the Nedelec DoF values of these vector functions on the fine grid (son) elements. Note that the DoF values are merely the circulations of the vector functions over the edges.

The restriction is the transposed prolongation.

Note the special case of the "projected boundaries", i.e. when after the regular refinement, new vertices on the boundary sides of the coarse grid elements (or anywhere else) are moved to the actual geometric boundary. In this case, this implementation of the transfer operators works as if it would be applied before moving the new fine grid vertices, i.e. just after the regular refinement. So, the procedure can be considered as "refine regularily - transfer - project the boundary". Due to this approach, the restricted defect belongs to the image of the coarse grid matrix, so that all the systems in the multigrid hierarchy are solvable. Otherwise this may not be the case, cf. O. Sterz. Modellierung und Numerik zeitharmonischer Wirbelstromprobleme in 3D. PhD thesis, 2003.

To this end, the evaluations of the Nedelec (Whitney-1) shape functions are performed not according to the geometrical (global) coordinates of the new vertices, but according to their local coordinates in the full-dim. parent element, whereas these local coordinates are computed using averaging of the local coordinates of the corresponding corners. Thus this local coordinates correspond to the positions "before the moving" and not to the actual positions in the space.

For grid functions having several Nedelec DoFs on every edge, the prolongation and the restriction is performed separately for every subfunction.

Member Typedef Documentation

◆ algebra_type

template<typename TDomain , typename TAlgebra >
typedef TAlgebra ug::Electromagnetism::NedelecTransfer< TDomain, TAlgebra >::algebra_type

Type of algebra.

◆ base_type

template<typename TDomain , typename TAlgebra >
typedef ITransferOperator<TDomain, TAlgebra> ug::Electromagnetism::NedelecTransfer< TDomain, TAlgebra >::base_type

Type of base class.

◆ domain_type

template<typename TDomain , typename TAlgebra >
typedef TDomain ug::Electromagnetism::NedelecTransfer< TDomain, TAlgebra >::domain_type

Type of Domain.

◆ matrix_type

template<typename TDomain , typename TAlgebra >
typedef TAlgebra::matrix_type ug::Electromagnetism::NedelecTransfer< TDomain, TAlgebra >::matrix_type

Type of Vector.

◆ this_type

template<typename TDomain , typename TAlgebra >
typedef NedelecTransfer<TDomain, TAlgebra> ug::Electromagnetism::NedelecTransfer< TDomain, TAlgebra >::this_type

This type.

◆ vector_type

template<typename TDomain , typename TAlgebra >
typedef TAlgebra::vector_type ug::Electromagnetism::NedelecTransfer< TDomain, TAlgebra >::vector_type

Type of Vector.

Constructor & Destructor Documentation

◆ NedelecTransfer()

template<typename TDomain , typename TAlgebra >
ug::Electromagnetism::NedelecTransfer< TDomain, TAlgebra >::NedelecTransfer ( SmartPtr< ApproximationSpace< TDomain > >  approxSpace)
inline

Constructor setting approximation space.

Member Function Documentation

◆ assemble_prolongation_matrix()

template<typename TDomain , typename TAlgebra >
template<typename TElem >
void ug::Electromagnetism::NedelecTransfer< TDomain, TAlgebra >::assemble_prolongation_matrix ( matrix_type mat,
std::vector< bool > &  vIsRestricted,
const DoFDistribution coarseDD,
const DoFDistribution fineDD 
)
private

assembles the prolongation matrix for one type of the grid elements

Parameters
[out]matthe interpolation matrix
[out]vIsRestrictedwhether a coarse grid DoF has children
[in]coarseDDthe coarse grid DD
[in]fineDDthe fine grid DD

◆ check_approximation_space()

template<typename TDomain , typename TAlgebra >
void ug::Electromagnetism::NedelecTransfer< TDomain, TAlgebra >::check_approximation_space
private

checks the approximation space

Checks the approximation space

References ug::LFEID::NEDELEC, type(), and UG_THROW.

◆ clone()

template<typename TDomain , typename TAlgebra >
SmartPtr< ITransferOperator< TDomain, TAlgebra > > ug::Electromagnetism::NedelecTransfer< TDomain, TAlgebra >::clone
virtual

returns new instance with same setting

Copies parameters from another object

Implements ug::ITransferOperator< TDomain, TAlgebra >.

◆ do_restrict()

template<typename TDomain , typename TAlgebra >
void ug::Electromagnetism::NedelecTransfer< TDomain, TAlgebra >::do_restrict ( vector_type uCoarse,
const vector_type uFine 
)
virtual

apples the restriction = transposed prolongation

Performs prolongation by applying the prolongation matrix to the given vector.

Parameters
[out]uCoarsethe restricted vector
[in]uFinethe vector to restrict

Implements ug::ITransferOperator< TDomain, TAlgebra >.

References ug::CT_ALL, ug::CT_DIRICHLET, type(), UG_ASSERT, UG_CATCH_THROW, and UG_THROW.

◆ init()

template<typename TDomain , typename TAlgebra >
void ug::Electromagnetism::NedelecTransfer< TDomain, TAlgebra >::init
virtual

initializes the operator (computes the prolongation matrix etc)

Initializes the object: Verifies the data and computes the prolongation matrix.

Implements ug::ITransferOperator< TDomain, TAlgebra >.

References ug::DoFDistribution::num_indices(), ug::PST_CONSISTENT, and UG_CATCH_THROW.

◆ prolongate()

template<typename TDomain , typename TAlgebra >
void ug::Electromagnetism::NedelecTransfer< TDomain, TAlgebra >::prolongate ( vector_type uFine,
const vector_type uCoarse 
)
virtual

applies the prolongation

Performs prolongation by applying the prolongation matrix to the given vector.

Parameters
[out]uFinethe prolongated vector
[in]uCoarsethe vector to prolongate

Implements ug::ITransferOperator< TDomain, TAlgebra >.

References ug::CT_ALL, ug::CT_DIRICHLET, type(), UG_ASSERT, UG_CATCH_THROW, and UG_THROW.

◆ set_levels()

template<typename TDomain , typename TAlgebra >
void ug::Electromagnetism::NedelecTransfer< TDomain, TAlgebra >::set_levels ( GridLevel  coarseLevel,
GridLevel  fineLevel 
)
virtual

Set levels.

Sets and checks the grid levels to work on:

Parameters
[in]coarseLevelthe coarse grid level
[in]fineLevelthe fine grid level

Implements ug::ITransferOperator< TDomain, TAlgebra >.

References ug::GridLevel::LEVEL, and UG_THROW.

Member Data Documentation

◆ m_bInit

template<typename TDomain , typename TAlgebra >
bool ug::Electromagnetism::NedelecTransfer< TDomain, TAlgebra >::m_bInit
private

initialization flag

◆ m_coarseLevel

template<typename TDomain , typename TAlgebra >
GridLevel ug::Electromagnetism::NedelecTransfer< TDomain, TAlgebra >::m_coarseLevel
private

coarse grid level

◆ m_fineLevel

template<typename TDomain , typename TAlgebra >
GridLevel ug::Electromagnetism::NedelecTransfer< TDomain, TAlgebra >::m_fineLevel
private

fine grid level

◆ m_prolongation_matrix

template<typename TDomain , typename TAlgebra >
matrix_type ug::Electromagnetism::NedelecTransfer< TDomain, TAlgebra >::m_prolongation_matrix
private

◆ m_spApproxSpace

template<typename TDomain , typename TAlgebra >
SmartPtr<ApproximationSpace<TDomain> > ug::Electromagnetism::NedelecTransfer< TDomain, TAlgebra >::m_spApproxSpace
private

approximation space

◆ m_vIsRestricted

template<typename TDomain , typename TAlgebra >
std::vector<bool> ug::Electromagnetism::NedelecTransfer< TDomain, TAlgebra >::m_vIsRestricted
private

◆ WDim

template<typename TDomain , typename TAlgebra >
const int ug::Electromagnetism::NedelecTransfer< TDomain, TAlgebra >::WDim = TDomain::dim
static

world dimention


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