deal.II version GIT relicensing-6834-g5b78e6bcdf 2026-10-01 11:20:01+00:00
\(\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\}}\)
Loading...
Searching...
No Matches
block_info.cc
Go to the documentation of this file.
1// -----------------------------------------------------------------------------
2//
3// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception OR LGPL-2.1-or-later
4// Copyright (C) 2009 - 2025 by the deal.II authors
5//
6// This file is part of the deal.II library.
7//
8// Detailed license information governing the source code and contributions
9// can be found in LICENSE.md and CONTRIBUTING.md at the top level directory.
10//
11// -----------------------------------------------------------------------------
12
16
17#include <deal.II/fe/fe.h>
18#include <deal.II/fe/fe_tools.h>
19
21
23
24
25template <int dim, int spacedim>
26void
28 bool levels_only,
29 bool active_only)
30{
31 Assert(dof.has_hp_capabilities() == false,
33
34 if (!levels_only && dof.has_active_dofs())
35 {
36 const std::vector<types::global_dof_index> sizes =
38 bi_global.reinit(sizes);
39 }
40
41 if (!active_only && dof.has_level_dofs())
42 {
43 std::vector<std::vector<types::global_dof_index>> sizes(
45 std::vector<types::global_dof_index>(dof.get_fe().n_blocks()));
46
48 levels.resize(sizes.size());
49
50 for (unsigned int i = 0; i < sizes.size(); ++i)
51 levels[i].reinit(sizes[i]);
52 }
53}
54
55
56
57template <int dim, int spacedim>
58void
60{
61 Assert(dof.has_hp_capabilities() == false,
63
64 const FiniteElement<dim, spacedim> &fe = dof.get_fe();
65 std::vector<types::global_dof_index> sizes(fe.n_blocks());
66
67 base_elements.resize(fe.n_blocks());
68
69 for (unsigned int i = 0; i < base_elements.size(); ++i)
70 base_elements[i] = fe.block_to_base_index(i).first;
71
74 bi_local.reinit(sizes);
75}
76
77// explicit instantiations
78#include "dofs/block_info.inst"
79
void reinit(const unsigned int n_blocks, const size_type n_elements_per_block)
std::vector< types::global_dof_index > local_renumbering
Definition block_info.h:212
std::vector< BlockIndices > levels
The multilevel block structure.
Definition block_info.h:196
BlockIndices bi_global
The block structure of the global system.
Definition block_info.h:192
BlockIndices bi_local
The block structure of the cell systems.
Definition block_info.h:201
std::vector< unsigned int > base_elements
Definition block_info.h:206
void initialize_local(const DoFHandler< dim, spacedim > &)
Initialize block structure on cells and compute renumbering between cell dofs and block cell dofs.
Definition block_info.cc:59
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.
Definition block_info.cc:27
bool has_active_dofs() const
const FiniteElement< dim, spacedim > & get_fe(const types::fe_index index=0) const
const Triangulation< dim, spacedim > & get_triangulation() const
bool has_hp_capabilities() const
bool has_level_dofs() const
unsigned int n_dofs_per_cell() const
unsigned int n_blocks() const
std::pair< unsigned int, unsigned int > block_to_base_index(const unsigned int block) const
unsigned int n_levels() const
#define DEAL_II_NAMESPACE_OPEN
Definition config.h:38
#define DEAL_II_NAMESPACE_CLOSE
Definition config.h:39
#define Assert(cond, exc)
std::vector< types::global_dof_index > count_dofs_per_fe_block(const DoFHandler< dim, spacedim > &dof, const std::vector< unsigned int > &target_block=std::vector< unsigned int >())
void compute_block_renumbering(const FiniteElement< dim, spacedim > &fe, std::vector< types::global_dof_index > &renumbering, std::vector< types::global_dof_index > &block_data, bool return_start_indices=true)
void count_dofs_per_block(const DoFHandler< dim, spacedim > &dof_handler, std::vector< std::vector< types::global_dof_index > > &dofs_per_block, std::vector< unsigned int > target_block={})
Definition mg_tools.cc:1144