Public Member Functions | Private Attributes

BlockInfo Class Reference
[Degrees of Freedom]

A small class collecting the different BlockIndices involved in global, multilevel and local computations. More...

Inheritance diagram for BlockInfo:
Inheritance graph
[legend]

List of all members.

Public Member Functions

template<int dim, int spacedim>
void initialize (const DoFHandler< dim, spacedim > &)
 Fill the object with values describing block structure of the DoFHandler.
template<int dim, int spacedim>
void initialize (const MGDoFHandler< dim, spacedim > &, bool levels_only=false)
 Fill the object with values describing level block structure of the MGDoFHandler. If levels_only is false, the other initialize() is called as well.
template<int dim, int spacedim>
void initialize_local (const DoFHandler< dim, spacedim > &)
 Initialize block structure on cells and compute renumbering between cell dofs and block cell dofs.
const BlockIndicesglobal () const
const BlockIndiceslocal () const
const BlockIndiceslevel (unsigned int level) const
unsigned int renumber (const unsigned int i) const
unsigned int n_base_elements () const
unsigned int base_element (const unsigned int i) const
template<class OS >
void print (OS &stream) const
std::size_t memory_consumption () const
template<class Archive >
void serialize (Archive &ar, const unsigned int version)

Private Attributes

BlockIndices bi_global
 The block structure of the global system.
std::vector< BlockIndiceslevels
 The multilevel block structure.
BlockIndices bi_local
 The block structure of the cell systems.
std::vector< unsigned int > base_elements
std::vector< unsigned int > local_renumbering

Detailed Description

A small class collecting the different BlockIndices involved in global, multilevel and local computations.

Once a DoFHandler has been initialized with an FESystem, a data object of type BlockInfo (accessed by DoFHandler::block_info() ) is filled, which reflects the block structure of the degrees of freedom.

BlockInfo consists of several BlockIndices objects. The member global() reflects the block structure of the system on the active cell level, usually referred to as the global system. As soon as DoFHandler::distribute_dofs() has been called, the function BlockIndices::block_size() in global() will return the correct sizes of each block. After DoFRenumbering::block_wise(), BlockIndices::block_start() will return the start index for each of the blocks.

When an MGDoFHandler is used, the same structure is automatically generated for each level. The level blocks can be accessed through level().

Finally, there are local() BlockIndices, which describe the block structure on a single cell. This is used for instance by MeshWorker::Assembler::MatrixLocalBlocksToGlobalBlocks. The local indices are not filled automatically, since they change the behavior of the MeshWorker::Assembler classes relying on BlockInfo. They must be initialized by hand through initialize_local().

Usage

The most common usage for this object is initializing vectors as in the following code:

MGDofHandler<dim> dof_handler(triangulation); dof_handler.distribute_dofs(fesystem); DoFRenumbering::block_wise(dof_handler);

BlockVector<double> solution(dof_handler.block_info().global());

MGLevelObject<BlockVector<double> > mg_vector(0, triangulation.n_levels()-1); for (unsigned int i=0;i<triangulation.n_levels();++i) mg_vector[i].reinit(dof_handler.block_info().level(i)); In this example, solution obtains the block structure needed to represent a finite element function on the DoFHandler. Similarly, all levels of mg_vector will have the block structure needed on that level.

Todo:
Extend the functions local() and renumber() to the concept to hpDoFHandler.
Author:
Guido Kanschat, 2009

Definition at line 89 of file block_info.h.


Member Function Documentation

template<int dim, int spacedim>
void BlockInfo::initialize ( const DoFHandler< dim, spacedim > &   )

Fill the object with values describing block structure of the DoFHandler.

This function will also clear the local() indices.

template<int dim, int spacedim>
void BlockInfo::initialize ( const MGDoFHandler< dim, spacedim > &  ,
bool  levels_only = false 
)

Fill the object with values describing level block structure of the MGDoFHandler. If levels_only is false, the other initialize() is called as well.

This function will also clear the local() indices.

template<int dim, int spacedim>
void BlockInfo::initialize_local ( const DoFHandler< dim, spacedim > &   )

Initialize block structure on cells and compute renumbering between cell dofs and block cell dofs.

const BlockIndices & BlockInfo::global (  ) const [inline]

Access the BlockIndices structure of the global system.

Definition at line 240 of file block_info.h.

References bi_global.

Referenced by print().

const BlockIndices & BlockInfo::local (  ) const [inline]

Access BlockIndices for the local system on a cell.

Definition at line 248 of file block_info.h.

References bi_local.

Referenced by MeshWorker::IntegrationInfo< dim, spacedim >::initialize(), and print().

const BlockIndices & BlockInfo::level ( unsigned int  level ) const [inline]

Access the BlockIndices structure of a level in the multilevel hierarchy.

Definition at line 256 of file block_info.h.

References AssertIndexRange, and levels.

Referenced by print().

unsigned int BlockInfo::renumber ( const unsigned int  i ) const [inline]

Return the index after local renumbering.

The input of this function is an index between zero and the number of dofs per cell, numbered in local block ordering, that is first all indices of the first system block, then all of the second block and so forth. The function then outputs the index in the standard local numbering of DoFAccessor.

Definition at line 264 of file block_info.h.

References AssertIndexRange, and local_renumbering.

unsigned int BlockInfo::n_base_elements (  ) const [inline]

The number of base elements.

Definition at line 283 of file block_info.h.

References base_elements.

unsigned int BlockInfo::base_element ( const unsigned int  i ) const [inline]

Return the base element of this index.

Definition at line 273 of file block_info.h.

References AssertIndexRange, and base_elements.

template<class OS >
void BlockInfo::print ( OS &  stream ) const [inline]

Write a summary of the block structure to the stream.

Definition at line 293 of file block_info.h.

References BlockIndices::block_size(), global(), level(), levels, local(), BlockIndices::size(), and BlockIndices::total_size().

std::size_t BlockInfo::memory_consumption (  ) const [inline]

Determine an estimate for the memory consumption (in bytes) of this object.

Definition at line 324 of file block_info.h.

References base_elements, bi_global, bi_local, levels, and MemoryConsumption::memory_consumption().

template<class Archive >
void BlockInfo::serialize ( Archive &  ar,
const unsigned int  version 
)

Read or write the data of this object to or from a stream for the purpose of serialization

Reimplemented from Subscriptor.

Definition at line 334 of file block_info.h.

References base_elements, bi_global, bi_local, levels, and local_renumbering.


Member Data Documentation

The block structure of the global system.

Definition at line 204 of file block_info.h.

Referenced by global(), memory_consumption(), and serialize().

std::vector<BlockIndices> BlockInfo::levels [private]

The multilevel block structure.

Definition at line 208 of file block_info.h.

Referenced by level(), memory_consumption(), print(), and serialize().

The block structure of the cell systems.

Definition at line 214 of file block_info.h.

Referenced by local(), memory_consumption(), and serialize().

std::vector<unsigned int> BlockInfo::base_elements [private]

The base element associated with each block.

Definition at line 220 of file block_info.h.

Referenced by base_element(), memory_consumption(), n_base_elements(), and serialize().

std::vector<unsigned int> BlockInfo::local_renumbering [private]

A vector containing the renumbering from the standard order of degrees of freedom on a cell to a component wise ordering. Filled by initialize().

Definition at line 231 of file block_info.h.

Referenced by renumber(), and serialize().


The documentation for this class was generated from the following file:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines

deal.II documentation generated on Fri Feb 3 2012 06:04:05 by doxygen 1.7.2