
Public Types | |
| typedef std::vector< unsigned int > | block_container |
| The container for each index set. | |
|
typedef block_container::const_iterator | const_iterator |
| The iterator for individual indices. | |
Public Member Functions | |
| void | create_sparsity_pattern (SparsityPattern &sparsity, unsigned int n) const |
| void | add (unsigned int block, const std::vector< unsigned int > &indices) |
| void | add (unsigned int block, const std::vector< unsigned int > &indices, const std::vector< bool > &selected_indices, unsigned int offset=0) |
| void | initialize (unsigned int n_blocks) |
| template<typename ITERATOR > | |
| void | initialize (unsigned int n_blocks, const ITERATOR begin, const typename identity< ITERATOR >::type end) |
| template<typename ITERATOR > | |
| void | initialize_mg (unsigned int n_blocks, const ITERATOR begin, const typename identity< ITERATOR >::type end) |
| template<typename ITERATOR > | |
| void | initialize (unsigned int n_blocks, const ITERATOR begin, const typename identity< ITERATOR >::type end, const std::vector< bool > &selected_dofs, unsigned int offset=0) |
| template<typename ITERATOR > | |
| void | initialize_mg (unsigned int n_blocks, const ITERATOR begin, const typename identity< ITERATOR >::type end, const std::vector< bool > &selected_dofs, unsigned int offset=0) |
| template<int dim, typename ITERATOR > | |
| void | initialize_vertex_patches_mg (unsigned int n_blocks, const ITERATOR begin, const typename identity< ITERATOR >::type end, const std::vector< bool > &selected_dofs=std::vector< bool >(), unsigned int offset=0) |
| template<int dim, typename ITERATOR > | |
| unsigned int | count_vertex_patches (const ITERATOR begin, const typename identity< ITERATOR >::type end, bool same_level_only) const |
| template<int dim, typename ITERATOR > | |
| bool | cell_generates_vertex_patch (const ITERATOR cell, bool same_level_only) const |
| unsigned int | size () const |
| unsigned int | block_size (unsigned int block) const |
| const_iterator | begin (unsigned int block) const |
| const_iterator | end (unsigned int block) const |
| unsigned int | local_index (unsigned int block, unsigned int index) const |
Private Attributes | |
| std::vector< block_container > | index_sets |
A vector of index sets listing the indices of small blocks of a linear system. For each block, the indices in that block are listed.
The focus of this class is on small blocks of degrees of freedom associated with a single mesh cell or a small patch. These indices may be contiguous or not and we do not optimize for the case they are. For larger sets, the use of a vector of IndexSet objects might be advisable.
BlockList objects can conveniently be initialized with iterator ranges from DoFHandler or MGDoFHandler, using either their cell or multigrid indices. Other initializations are possible to be implemented.
Definition at line 47 of file block_list.h.
| void BlockList::create_sparsity_pattern | ( | SparsityPattern & | sparsity, |
| unsigned int | n | ||
| ) | const [inline] |
Since SparsityPattern can handle the tasks of BlockList, this function allows us to create one from an already filled BlockList. A first step to make BlockList obsolete.
The additional integer argument is the dimension of the vector space.
Definition at line 292 of file block_list.h.
References SparsityPattern::add(), begin(), block_size(), SparsityPattern::compress(), end(), SparsityPattern::reinit(), and size().
| void BlockList::add | ( | unsigned int | block, |
| const std::vector< unsigned int > & | indices | ||
| ) | [inline] |
Add the indices in indices to block block, eliminating repeated indices.
Definition at line 310 of file block_list.h.
References AssertIndexRange, begin(), end(), index_sets, and numbers::invalid_unsigned_int.
Referenced by initialize(), initialize_mg(), and initialize_vertex_patches_mg().
| void BlockList::add | ( | unsigned int | block, |
| const std::vector< unsigned int > & | indices, | ||
| const std::vector< bool > & | selected_indices, | ||
| unsigned int | offset = 0 |
||
| ) | [inline] |
Add the indices in indices to block block, eliminating repeated indices. Only add those indices for which selected_indices is true.
Definition at line 328 of file block_list.h.
References AssertDimension, AssertIndexRange, begin(), end(), index_sets, and numbers::invalid_unsigned_int.
| void BlockList::initialize | ( | unsigned int | n_blocks | ) | [inline] |
Just set up the correct size and assign indices to blocks later.
Definition at line 351 of file block_list.h.
References index_sets.
| void BlockList::initialize | ( | unsigned int | n_blocks, |
| const ITERATOR | begin, | ||
| const typename identity< ITERATOR >::type | end | ||
| ) | [inline] |
Set up all index sets using an DoF iterator range. This function will call begin->get_dof_indices() with a signature like DoFCellAccessor::get_dof_indices(). Typically, the iterators will loop over active cells of a triangulation.
In addition, the function needs the total number of blocks as its first argument.
Definition at line 360 of file block_list.h.
References add(), end(), and index_sets.
| void BlockList::initialize_mg | ( | unsigned int | n_blocks, |
| const ITERATOR | begin, | ||
| const typename identity< ITERATOR >::type | end | ||
| ) | [inline] |
Set up all index sets using an DoF iterator range. This function will call begin->get_mg_dof_indices() with a signature like MGDoFCellAccessor::get_mg_dof_indices(). Typically, the iterators loop over the cells of a single level or a Triangulation.
In addition, the function needs the total number of blocks as its first argument.
Definition at line 377 of file block_list.h.
References add(), end(), and index_sets.
| void BlockList::initialize | ( | unsigned int | n_blocks, |
| const ITERATOR | begin, | ||
| const typename identity< ITERATOR >::type | end, | ||
| const std::vector< bool > & | selected_dofs, | ||
| unsigned int | offset = 0 |
||
| ) | [inline] |
Set up all index sets using an DoF iterator range. This function will call begin->get_dof_indices() with a signature like DoFCellAccessor::get_dof_indices(). Typically, the iterators will loop over active cells of a triangulation.
The argument vector selected_dofs should have the length of dofs per cell (thus, this function is not suitable for hp), and a true value for each degree of freedom which should be added to the index set of this cell. If you are working on a single block of a block system, the offset is the start index of this block.
In addition, the function needs the total number of blocks as its first argument.
Definition at line 394 of file block_list.h.
References add(), AssertDimension, end(), and index_sets.
| void BlockList::initialize_mg | ( | unsigned int | n_blocks, |
| const ITERATOR | begin, | ||
| const typename identity< ITERATOR >::type | end, | ||
| const std::vector< bool > & | selected_dofs, | ||
| unsigned int | offset = 0 |
||
| ) | [inline] |
Set up all index sets using an DoF iterator range. This function will call begin->get_mg_dof_indices() with a signature like MGDoFCellAccessor::get_mg_dof_indices(). Typically, the iterators will loop over cells on a single level of a triangulation.
The argument vector selected_dofs should have the length of dofs per cell (thus, this function is not suitable for hp), and a true value for each degree of freedom which should be added to the index set of this cell. If you are working on a single block of a block system, the offset is the start index of this block.
In addition, the function needs the total number of blocks as its first argument.
Definition at line 418 of file block_list.h.
References add(), AssertDimension, end(), and index_sets.
| void BlockList::initialize_vertex_patches_mg | ( | unsigned int | n_blocks, |
| const ITERATOR | begin, | ||
| const typename identity< ITERATOR >::type | end, | ||
| const std::vector< bool > & | selected_dofs = std::vector<bool>(), |
||
| unsigned int | offset = 0 |
||
| ) | [inline] |
Same as initialize_mg(), but instead of gathering the degrees of freedom of a single cell into a block, gather all degrees of freedom of a patch around a vertex.
Definition at line 496 of file block_list.h.
References add(), Assert, FiniteElementData< dim >::dofs_per_face, FiniteElementData< dim >::dofs_per_vertex, end(), StandardExceptions::ExcNotImplemented(), FiniteElementData< dim >::face_to_cell_index(), index_sets, and numbers::invalid_unsigned_int.
| unsigned int BlockList::count_vertex_patches | ( | const ITERATOR | begin, |
| const typename identity< ITERATOR >::type | end, | ||
| bool | same_level_only | ||
| ) | const [inline] |
Auxiliary function, counting the patches around vertices.
Definition at line 480 of file block_list.h.
References end().
| bool BlockList::cell_generates_vertex_patch | ( | const ITERATOR | cell, |
| bool | same_level_only | ||
| ) | const [inline] |
Definition at line 443 of file block_list.h.
References Assert, and StandardExceptions::ExcNotImplemented().
| unsigned int BlockList::size | ( | ) | const [inline] |
The number of blocks.
Definition at line 606 of file block_list.h.
References index_sets.
Referenced by create_sparsity_pattern().
| unsigned int BlockList::block_size | ( | unsigned int | block | ) | const [inline] |
The size of a single block.
Definition at line 614 of file block_list.h.
References index_sets.
Referenced by create_sparsity_pattern().
| BlockList::const_iterator BlockList::begin | ( | unsigned int | block | ) | const [inline] |
Iterator to the first index in block.
Definition at line 622 of file block_list.h.
References AssertIndexRange, and index_sets.
Referenced by add(), and create_sparsity_pattern().
| BlockList::const_iterator BlockList::end | ( | unsigned int | block | ) | const [inline] |
End iterator for a single block.
Definition at line 631 of file block_list.h.
References AssertIndexRange, and index_sets.
Referenced by add(), count_vertex_patches(), create_sparsity_pattern(), initialize(), initialize_mg(), and initialize_vertex_patches_mg().
| unsigned int BlockList::local_index | ( | unsigned int | block, |
| unsigned int | index | ||
| ) | const [inline] |
Return the position of index in block, or numbers::invalid_unsigned_int, if the index is not in the block.
Definition at line 640 of file block_list.h.
References AssertIndexRange, index_sets, and numbers::invalid_unsigned_int.
std::vector<block_container> BlockList::index_sets [private] |
The container for t he index sets.
Definition at line 286 of file block_list.h.
Referenced by add(), begin(), block_size(), end(), initialize(), initialize_mg(), initialize_vertex_patches_mg(), local_index(), and size().
documentation generated on Thu May 17 2012 20:05:29 by
doxygen
1.7.3