Reference documentation for deal.II version 9.2.0
\(\newcommand{\dealvcentcolon}{\mathrel{\mathop{:}}}\) \(\newcommand{\dealcoloneq}{\dealvcentcolon\mathrel{\mkern-1.2mu}=}\) \(\newcommand{\jump}[1]{\left[\!\left[ #1 \right]\!\right]}\) \(\newcommand{\average}[1]{\left\{\!\left\{ #1 \right\}\!\right\}}\)
Public Member Functions | Private Attributes | List of all members
BlockInfo Class Reference

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

#include <deal.II/dofs/block_info.h>

Inheritance diagram for BlockInfo:
[legend]

Public Member Functions

template<int dim, int spacedim>
void initialize (const DoFHandler< dim, spacedim > &, bool levels_only=false, bool active_only=false)
 Fill the object with values describing block structure of the DoFHandler. More...
 
template<int dim, int spacedim>
void initialize (const hp::DoFHandler< dim, spacedim > &, bool levels_only=false, bool active_only=false)
 
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. More...
 
template<int dim, int spacedim>
void initialize_local (const hp::DoFHandler< dim, spacedim > &)
 
const BlockIndicesglobal () const
 
const BlockIndiceslocal () const
 
const BlockIndiceslevel (unsigned int level) const
 
types::global_dof_index 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)
 
- Public Member Functions inherited from Subscriptor
 Subscriptor ()
 
 Subscriptor (const Subscriptor &)
 
 Subscriptor (Subscriptor &&) noexcept
 
virtual ~Subscriptor ()
 
Subscriptoroperator= (const Subscriptor &)
 
Subscriptoroperator= (Subscriptor &&) noexcept
 
void subscribe (std::atomic< bool > *const validity, const std::string &identifier="") const
 
void unsubscribe (std::atomic< bool > *const validity, const std::string &identifier="") const
 
unsigned int n_subscriptions () const
 
template<typename StreamType >
void list_subscribers (StreamType &stream) const
 
void list_subscribers () const
 
template<class Archive >
void serialize (Archive &ar, const unsigned int version)
 

Private Attributes

BlockIndices bi_global
 The block structure of the global system. More...
 
std::vector< BlockIndiceslevels
 The multilevel block structure. More...
 
BlockIndices bi_local
 The block structure of the cell systems. More...
 
std::vector< unsigned intbase_elements
 
std::vector< types::global_dof_indexlocal_renumbering
 

Additional Inherited Members

- Static Public Member Functions inherited from Subscriptor
static ::ExceptionBaseExcInUse (int arg1, std::string arg2, std::string arg3)
 
static ::ExceptionBaseExcNoSubscriber (std::string arg1, std::string arg2)
 

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 a DoFHandler with levels 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:

dof_handler.distribute_dofs(fe_system);
dof_handler.distribute_mg_dofs(fe_system);
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 hp::DoFHandler.
Author
Guido Kanschat, 2009

Definition at line 99 of file block_info.h.

Member Function Documentation

◆ initialize() [1/2]

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

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

By default, this function will attempt to initialize whatever is possible. If active dofs have been assigned int the DoFHandler argument, they BlockIndices for those will be generated. The same for level dofs.

This default behavior can be overridden by the two parameters, which can switch off active dofs or level dofs.

This function will also clear the local() indices.

Definition at line 30 of file block_info.cc.

◆ initialize() [2/2]

template<int dim, int spacedim>
void BlockInfo::initialize ( const hp::DoFHandler< dim, spacedim > &  dof,
bool  levels_only = false,
bool  active_only = false 
)

The same as above but for hp::DoFHandler.

Note
Not implemented.

Definition at line 59 of file block_info.cc.

◆ initialize_local() [1/2]

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

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

Definition at line 73 of file block_info.cc.

◆ initialize_local() [2/2]

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

The same as above but for hp::DoFHandler.

Note
Not implemented.

Definition at line 92 of file block_info.cc.

◆ global()

const BlockIndices & BlockInfo::global ( ) const
inline

Access the BlockIndices structure of the global system.

Definition at line 245 of file block_info.h.

◆ local()

const BlockIndices & BlockInfo::local ( ) const
inline

Access BlockIndices for the local system on a cell.

Definition at line 252 of file block_info.h.

◆ level()

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

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

Definition at line 259 of file block_info.h.

◆ renumber()

types::global_dof_index 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 267 of file block_info.h.

◆ n_base_elements()

unsigned int BlockInfo::n_base_elements ( ) const
inline

The number of base elements.

Definition at line 284 of file block_info.h.

◆ base_element()

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

Return the base element of this index.

Definition at line 275 of file block_info.h.

◆ print()

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.

◆ memory_consumption()

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

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

Definition at line 325 of file block_info.h.

◆ serialize()

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

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

Definition at line 336 of file block_info.h.

Member Data Documentation

◆ bi_global

BlockIndices BlockInfo::bi_global
private

The block structure of the global system.

Definition at line 217 of file block_info.h.

◆ levels

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

The multilevel block structure.

Definition at line 221 of file block_info.h.

◆ bi_local

BlockIndices BlockInfo::bi_local
private

The block structure of the cell systems.

Definition at line 226 of file block_info.h.

◆ base_elements

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

The base element associated with each block.

Definition at line 231 of file block_info.h.

◆ local_renumbering

std::vector<types::global_dof_index> 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 237 of file block_info.h.


The documentation for this class was generated from the following files:
BlockVector< double >
DoFHandler< dim >
DoFRenumbering::block_wise
void block_wise(DoFHandler< dim, spacedim > &dof_handler)
Definition: dof_renumbering.cc:951
MGLevelObject
Definition: mg_level_object.h:50
triangulation
const typename ::parallel::distributed::Triangulation< dim, spacedim > * triangulation
Definition: p4est_wrappers.cc:69