Reference documentation for deal.II version 8.1.0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Modules Pages
Public Member Functions | Private Attributes | List of all members
MGTransferPrebuilt< VECTOR > Class Template Reference

#include <mg_transfer.h>

Inheritance diagram for MGTransferPrebuilt< VECTOR >:
[legend]

Public Member Functions

 MGTransferPrebuilt ()
 
 MGTransferPrebuilt (const ConstraintMatrix &constraints, const MGConstrainedDoFs &mg_constrained_dofs)
 
virtual ~MGTransferPrebuilt ()
 
template<int dim, int spacedim>
void build_matrices (const DoFHandler< dim, spacedim > &mg_dof)
 
virtual void prolongate (const unsigned int to_level, VECTOR &dst, const VECTOR &src) const
 
virtual void restrict_and_add (const unsigned int from_level, VECTOR &dst, const VECTOR &src) const
 
template<int dim, class InVector , int spacedim>
void copy_to_mg (const DoFHandler< dim, spacedim > &mg_dof, MGLevelObject< VECTOR > &dst, const InVector &src) const
 
template<int dim, class OutVector , int spacedim>
void copy_from_mg (const DoFHandler< dim, spacedim > &mg_dof, OutVector &dst, const MGLevelObject< VECTOR > &src) const
 
template<int dim, class OutVector , int spacedim>
void copy_from_mg_add (const DoFHandler< dim, spacedim > &mg_dof, OutVector &dst, const MGLevelObject< VECTOR > &src) const
 
void set_component_to_block_map (const std::vector< unsigned int > &map)
 
 DeclException0 (ExcNoProlongation)
 
 DeclException0 (ExcMatricesNotBuilt)
 
std::size_t memory_consumption () const
 
void print_matrices (std::ostream &os) const
 
void print_indices (std::ostream &os) const
 
- Public Member Functions inherited from MGTransferBase< VECTOR >
virtual ~MGTransferBase ()
 
- Public Member Functions inherited from Subscriptor
 Subscriptor ()
 
 Subscriptor (const Subscriptor &)
 
virtual ~Subscriptor ()
 
Subscriptoroperator= (const Subscriptor &)
 
void subscribe (const char *identifier=0) const
 
void unsubscribe (const char *identifier=0) const
 
unsigned int n_subscriptions () const
 
void list_subscribers () const
 
 DeclException3 (ExcInUse, int, char *, std::string &,<< "Object of class "<< arg2<< " is still used by "<< arg1<< " other objects.\n"<< "(Additional information: "<< arg3<< ")\n"<< "Note the entry in the Frequently Asked Questions of "<< "deal.II (linked to from http://www.dealii.org/) for "<< "more information on what this error means.")
 
 DeclException2 (ExcNoSubscriber, char *, char *,<< "No subscriber with identifier \""<< arg2<< "\" did subscribe to this object of class "<< arg1)
 
template<class Archive >
void serialize (Archive &ar, const unsigned int version)
 

Private Attributes

std::vector
< types::global_dof_index
sizes
 
std::vector
< std_cxx1x::shared_ptr
< typename
internal::MatrixSelector
< VECTOR >::Sparsity > > 
prolongation_sparsities
 
std::vector
< std_cxx1x::shared_ptr
< typename
internal::MatrixSelector
< VECTOR >::Matrix > > 
prolongation_matrices
 
std::vector< std::vector
< std::pair
< types::global_dof_index,
unsigned int > > > 
copy_indices
 
std::vector< std::vector
< std::pair
< types::global_dof_index,
unsigned int > > > 
copy_indices_to_me
 
std::vector< std::vector
< std::pair
< types::global_dof_index,
unsigned int > > > 
copy_indices_from_me
 
std::vector< unsigned intcomponent_to_block_map
 
std::vector< std::vector< bool > > interface_dofs
 
SmartPointer< const
ConstraintMatrix,
MGTransferPrebuilt< VECTOR > > 
constraints
 
SmartPointer< const
MGConstrainedDoFs,
MGTransferPrebuilt< VECTOR > > 
mg_constrained_dofs
 

Detailed Description

template<class VECTOR>
class MGTransferPrebuilt< VECTOR >

Implementation of the MGTransferBase interface for which the transfer operations are prebuilt upon construction of the object of this class as matrices. This is the fast way, since it only needs to build the operation once by looping over all cells and storing the result in a matrix for each level, but requires additional memory.

See MGTransferBase to find out which of the transfer classes is best for your needs.

Author
Wolfgang Bangerth, Guido Kanschat
Date
1999, 2000, 2001, 2002, 2003, 2004, 2012

Definition at line 112 of file mg_transfer.h.

Constructor & Destructor Documentation

template<class VECTOR >
MGTransferPrebuilt< VECTOR >::MGTransferPrebuilt ( )

Constructor without constraint matrices. Use this constructor only with discontinuous finite elements or with no local refinement.

template<class VECTOR >
MGTransferPrebuilt< VECTOR >::MGTransferPrebuilt ( const ConstraintMatrix constraints,
const MGConstrainedDoFs mg_constrained_dofs 
)

Constructor with constraint matrices as well as mg_constrained_dofs.

template<class VECTOR >
virtual MGTransferPrebuilt< VECTOR >::~MGTransferPrebuilt ( )
virtual

Destructor.

Member Function Documentation

template<class VECTOR >
template<int dim, int spacedim>
void MGTransferPrebuilt< VECTOR >::build_matrices ( const DoFHandler< dim, spacedim > &  mg_dof)

Actually build the prolongation matrices for each level.

template<class VECTOR >
virtual void MGTransferPrebuilt< VECTOR >::prolongate ( const unsigned int  to_level,
VECTOR &  dst,
const VECTOR &  src 
) const
virtual

Prolongate a vector from level to_level-1 to level to_level. The previous content of dst is overwritten.

  • src is a vector with as many elements as there are degrees of freedom on the coarser level involved.
  • dst has as many elements as there are degrees of freedom on the finer level.

Implements MGTransferBase< VECTOR >.

template<class VECTOR >
virtual void MGTransferPrebuilt< VECTOR >::restrict_and_add ( const unsigned int  from_level,
VECTOR &  dst,
const VECTOR &  src 
) const
virtual

Restrict a vector from level from_level to level from_level-1 and add this restriction to dst. If the region covered by cells on level from_level is smaller than that of level from_level-1 (local refinement), then some degrees of freedom in dst are active and will not be altered. For the other degress of freedom, the result of the restriction is added.

  • src is a vector with as many elements as there are degrees of freedom on the finer level
  • dst has as many elements as there are degrees of freedom on the coarser level.

Implements MGTransferBase< VECTOR >.

template<class VECTOR >
template<int dim, class InVector , int spacedim>
void MGTransferPrebuilt< VECTOR >::copy_to_mg ( const DoFHandler< dim, spacedim > &  mg_dof,
MGLevelObject< VECTOR > &  dst,
const InVector &  src 
) const

Transfer from a vector on the global grid to vectors defined on each of the levels separately, i.a. an MGVector.

Definition at line 152 of file mg_transfer.templates.h.

template<class VECTOR >
template<int dim, class OutVector , int spacedim>
void MGTransferPrebuilt< VECTOR >::copy_from_mg ( const DoFHandler< dim, spacedim > &  mg_dof,
OutVector &  dst,
const MGLevelObject< VECTOR > &  src 
) const

Transfer from multi-level vector to normal vector.

Copies data from active portions of an MGVector into the respective positions of a Vector<number>. In order to keep the result consistent, constrained degrees of freedom are set to zero.

Definition at line 187 of file mg_transfer.templates.h.

template<class VECTOR >
template<int dim, class OutVector , int spacedim>
void MGTransferPrebuilt< VECTOR >::copy_from_mg_add ( const DoFHandler< dim, spacedim > &  mg_dof,
OutVector &  dst,
const MGLevelObject< VECTOR > &  src 
) const

Add a multi-level vector to a normal vector.

Works as the previous function, but probably not for continuous elements.

Definition at line 232 of file mg_transfer.templates.h.

template<class VECTOR >
void MGTransferPrebuilt< VECTOR >::set_component_to_block_map ( const std::vector< unsigned int > &  map)

If this object operates on BlockVector objects, we need to describe how the individual vector components are mapped to the blocks of a vector. For example, for a Stokes system, we have dim+1 vector components for velocity and pressure, but we may want to use block vectors with only two blocks for all velocities in one block, and the pressure variables in the other.

By default, if this function is not called, block vectors have as many blocks as the finite element has vector components. However, this can be changed by calling this function with an array that describes how vector components are to be grouped into blocks. The meaning of the argument is the same as the one given to the DoFTools::count_dofs_per_component function.

Definition at line 274 of file mg_transfer.templates.h.

template<class VECTOR >
MGTransferPrebuilt< VECTOR >::DeclException0 ( ExcNoProlongation  )

Finite element does not provide prolongation matrices.

template<class VECTOR >
MGTransferPrebuilt< VECTOR >::DeclException0 ( ExcMatricesNotBuilt  )

You have to call build_matrices() before using this object.

template<class VECTOR >
std::size_t MGTransferPrebuilt< VECTOR >::memory_consumption ( ) const

Memory used by this object.

Definition at line 281 of file mg_transfer.templates.h.

template<class VECTOR >
void MGTransferPrebuilt< VECTOR >::print_matrices ( std::ostream &  os) const

Print all the matrices for debugging purposes.

template<class VECTOR >
void MGTransferPrebuilt< VECTOR >::print_indices ( std::ostream &  os) const

Print the copy index fields for debugging purposes.

Member Data Documentation

template<class VECTOR >
std::vector<types::global_dof_index> MGTransferPrebuilt< VECTOR >::sizes
private

Sizes of the multi-level vectors.

Definition at line 254 of file mg_transfer.h.

template<class VECTOR >
std::vector<std_cxx1x::shared_ptr<typename internal::MatrixSelector<VECTOR>::Sparsity> > MGTransferPrebuilt< VECTOR >::prolongation_sparsities
private

Sparsity patterns for transfer matrices.

Definition at line 259 of file mg_transfer.h.

template<class VECTOR >
std::vector<std_cxx1x::shared_ptr<typename internal::MatrixSelector<VECTOR>::Matrix> > MGTransferPrebuilt< VECTOR >::prolongation_matrices
private

The actual prolongation matrix. column indices belong to the dof indices of the mother cell, i.e. the coarse level. while row indices belong to the child cell, i.e. the fine level.

Definition at line 266 of file mg_transfer.h.

template<class VECTOR >
std::vector<std::vector<std::pair<types::global_dof_index, unsigned int> > > MGTransferPrebuilt< VECTOR >::copy_indices
private

Mapping for the copy_to_mg() and copy_from_mg() functions. Here only index pairs locally owned

The data is organized as follows: one vector per level. Each element of these vectors contains first the global index, then the level index.

Definition at line 277 of file mg_transfer.h.

template<class VECTOR >
std::vector<std::vector<std::pair<types::global_dof_index, unsigned int> > > MGTransferPrebuilt< VECTOR >::copy_indices_to_me
private

Additional degrees of freedom for the copy_to_mg() function. These are the ones where the global degree of freedom is locally owned and the level degree of freedom is not.

Organization of the data is like for #copy_indices_mine.

Definition at line 287 of file mg_transfer.h.

template<class VECTOR >
std::vector<std::vector<std::pair<types::global_dof_index, unsigned int> > > MGTransferPrebuilt< VECTOR >::copy_indices_from_me
private

Additional degrees of freedom for the copy_from_mg() function. These are the ones where the level degree of freedom is locally owned and the global degree of freedom is not.

Organization of the data is like for #copy_indices_mine.

Definition at line 297 of file mg_transfer.h.

template<class VECTOR >
std::vector<unsigned int> MGTransferPrebuilt< VECTOR >::component_to_block_map
private

The vector that stores what has been given to the set_component_to_block_map() function.

Definition at line 306 of file mg_transfer.h.

template<class VECTOR >
std::vector<std::vector<bool> > MGTransferPrebuilt< VECTOR >::interface_dofs
private

Degrees of freedom on the refinement edge excluding those on the boundary.

Definition at line 313 of file mg_transfer.h.

template<class VECTOR >
SmartPointer<const ConstraintMatrix, MGTransferPrebuilt<VECTOR> > MGTransferPrebuilt< VECTOR >::constraints
private

The constraints of the global system.

Definition at line 318 of file mg_transfer.h.

template<class VECTOR >
SmartPointer<const MGConstrainedDoFs, MGTransferPrebuilt<VECTOR> > MGTransferPrebuilt< VECTOR >::mg_constrained_dofs
private

The mg_constrained_dofs of the level systems.

Definition at line 324 of file mg_transfer.h.


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