17 #ifndef __deal2__block_list_h 18 #define __deal2__block_list_h 21 #include <deal.II/base/subscriptor.h> 22 #include <deal.II/base/template_constraints.h> 23 #include <deal.II/lac/sparsity_pattern.h> 24 #include <deal.II/fe/fe.h> 86 void add(size_type block,
const std::vector<size_type> &indices);
96 void add(size_type block,
97 const std::vector<size_type> &indices,
98 const std::vector<bool> &selected_indices,
99 size_type offset = 0);
122 template <
typename ITERATOR>
124 const ITERATOR
begin,
125 const typename identity<ITERATOR>::type
end);
145 template <
typename ITERATOR>
147 const ITERATOR
begin,
181 template <
typename ITERATOR>
183 const ITERATOR
begin,
184 const typename identity<ITERATOR>::type
end,
185 const std::vector<bool> &selected_dofs,
186 size_type offset = 0) DEAL_II_DEPRECATED;
218 template <typename ITERATOR>
220 const ITERATOR begin,
221 const typename
identity<ITERATOR>::type end,
222 const
std::vector<
bool> &selected_dofs,
223 size_type offset = 0) DEAL_II_DEPRECATED;
236 template <
int dim, typename ITERATOR>
238 const ITERATOR begin,
239 const typename
identity<ITERATOR>::type end,
240 const
std::vector<
bool> &selected_dofs =
std::vector<
bool>(),
241 size_type offset = 0) DEAL_II_DEPRECATED;
250 template <
int dim, typename ITERATOR>
252 const ITERATOR begin,
253 const typename
identity<ITERATOR>::type end,
254 bool same_level_only) const DEAL_II_DEPRECATED;
261 template <
int dim, typename ITERATOR>
263 bool same_level_only) const DEAL_II_DEPRECATED;
268 size_type
size() const;
278 const_iterator begin(size_type block) const;
282 const_iterator end(size_type block) const;
290 size_type
local_index(size_type block, size_type index) const;
297 } DEAL_II_DEPRECATED;
304 std::vector<unsigned int> sizes(
size());
305 for (size_type b=0; b<
size(); ++b)
308 sparsity.reinit(
size(), n, sizes);
309 for (size_type b=0; b<
size(); ++b)
311 for (const_iterator i =
begin(b); i !=
end(b); ++i)
324 for (size_type i=0; i<indices.size(); ++i)
326 const size_type k = indices[i];
339 const size_type block,
340 const std::vector<size_type> &indices,
341 const std::vector<bool> &selected,
347 for (size_type i=0; i<indices.size(); ++i)
349 const size_type k = indices[i];
367 template <
typename ITERATOR>
373 std::vector<size_type> indices;
375 for (ITERATOR cell = begin; cell !=
end; ++cell, ++k)
377 indices.resize(cell->get_fe().dofs_per_cell);
378 cell->get_dof_indices(indices);
384 template <
typename ITERATOR>
390 std::vector<size_type> indices;
392 for (ITERATOR cell = begin; cell !=
end; ++cell, ++k)
394 indices.resize(cell->get_fe().dofs_per_cell);
395 cell->get_mg_dof_indices(indices);
401 template <
typename ITERATOR>
406 const ITERATOR
begin,
407 const typename identity<ITERATOR>::type
end,
408 const std::vector<bool> &selected_dofs,
412 std::vector<size_type> indices;
414 for (ITERATOR cell = begin; cell !=
end; ++cell, ++k)
416 indices.resize(cell->get_fe().dofs_per_cell);
419 cell->get_dof_indices(indices);
420 add(k, indices, selected_dofs);
425 template <
typename ITERATOR>
430 const ITERATOR
begin,
431 const typename identity<ITERATOR>::type
end,
432 const std::vector<bool> &selected_dofs,
436 std::vector<size_type> indices;
438 for (ITERATOR cell = begin; cell !=
end; ++cell, ++k)
440 indices.resize(cell->get_fe().dofs_per_cell);
443 cell->get_mg_dof_indices(indices);
444 add(k, indices, selected_dofs, offset);
450 template <
int dim,
typename ITERATOR>
455 bool same_level_only)
const 460 if (cell->at_boundary(4))
break;
461 if (same_level_only && cell->neighbor(4)->level() != cell->level())
break;
462 if (cell->neighbor(4)->at_boundary(0))
break;
463 if (same_level_only && cell->neighbor(4)->neighbor(0)->level() != cell->level())
break;
464 if (cell->neighbor(4)->at_boundary(2))
break;
465 if (same_level_only && cell->neighbor(4)->neighbor(2)->level() != cell->level())
break;
466 if (cell->neighbor(4)->neighbor(0)->at_boundary(2))
break;
467 if (same_level_only && cell->neighbor(4)->neighbor(0)->neighbor(2)->level() != cell->level())
break;
470 if (cell->at_boundary(2))
break;
471 if (same_level_only && cell->neighbor(2)->level() != cell->level())
break;
472 if (cell->neighbor(2)->at_boundary(0))
break;
473 if (same_level_only && cell->neighbor(2)->neighbor(0)->level() != cell->level())
break;
475 if (cell->at_boundary(0))
break;
476 if (same_level_only && cell->neighbor(0)->level() != cell->level())
break;
487 template <
int dim,
typename ITERATOR>
491 const ITERATOR
begin,
492 const typename identity<ITERATOR>::type
end,
493 bool same_level_only)
const 495 unsigned int count = 0;
496 for (ITERATOR cell = begin; cell !=
end; ++cell)
497 if (cell_generates_vertex_patch<dim>(cell, same_level_only))
503 template <
int dim,
typename ITERATOR>
508 const ITERATOR
begin,
509 const typename identity<ITERATOR>::type
end,
510 const std::vector<bool> &selected_dofs,
519 std::vector<size_type> indices;
521 for (ITERATOR cell = begin; cell !=
end; ++cell)
523 if (cell_generates_vertex_patch<dim>(cell,
true))
525 indices.resize(cell->get_fe().dofs_per_cell);
530 cell->neighbor(4)->get_mg_dof_indices(indices);
538 cell->neighbor(4)->neighbor(0)->get_mg_dof_indices(indices);
546 cell->neighbor(4)->neighbor(2)->get_mg_dof_indices(indices);
554 cell->neighbor(4)->neighbor(2)->neighbor(0)->get_mg_dof_indices(indices);
563 cell->neighbor(2)->get_mg_dof_indices(indices);
572 cell->neighbor(2)->neighbor(0)->get_mg_dof_indices(indices);
583 cell->get_mg_dof_indices(indices);
593 cell->neighbor(0)->get_mg_dof_indices(indices);
654 for (size_type i=0; i<b.size(); ++i)
661 DEAL_II_NAMESPACE_CLOSE
const types::global_dof_index invalid_size_type
const_iterator begin(size_type block) const
#define AssertDimension(dim1, dim2)
size_type local_index(size_type block, size_type index) const
const_iterator end(size_type block) const
bool cell_generates_vertex_patch(const ITERATOR cell, bool same_level_only) const DEAL_II_DEPRECATED
#define AssertIndexRange(index, range)
unsigned int count_vertex_patches(const ITERATOR begin, const typename identity< ITERATOR >::type end, bool same_level_only) const DEAL_II_DEPRECATED
void add(size_type block, const std::vector< size_type > &indices)
void initialize(size_type n_blocks)
virtual unsigned int face_to_cell_index(const unsigned int face_dof_index, const unsigned int face, const bool face_orientation=true, const bool face_flip=false, const bool face_rotation=false) const
unsigned int global_dof_index
#define Assert(cond, exc)
std::vector< size_type > block_container
The container for each index set.
BlockCompressedSparsityPattern CompressedBlockSparsityPattern DEAL_II_DEPRECATED
void create_sparsity_pattern(SparsityPattern &sparsity, size_type n) const
std::vector< block_container > index_sets
size_type block_size(size_type block) const
const unsigned int dofs_per_face
block_container::const_iterator const_iterator
The iterator for individual indices.
::ExceptionBase & ExcNotImplemented()
const unsigned int dofs_per_vertex
types::global_dof_index size_type
void initialize_mg(size_type n_blocks, const ITERATOR begin, const typename identity< ITERATOR >::type end) DEAL_II_DEPRECATED
const types::global_dof_index invalid_dof_index
void initialize_vertex_patches_mg(size_type n_blocks, const ITERATOR begin, const typename identity< ITERATOR >::type end, const std::vector< bool > &selected_dofs=std::vector< bool >(), size_type offset=0) DEAL_II_DEPRECATED