Debian Codegraph @

include/deal.II/meshworker/dof_info.templates.h

raw
1 // ------------------------------------------------------------------------
2 //
3 // SPDX-License-Identifier: LGPL-2.1-or-later
4 // Copyright (C) 2009 - 2019 by the deal.II authors
5 //
6 // This file is part of the deal.II library.
7 //
8 // Part of the source code is dual licensed under Apache-2.0 WITH
9 // LLVM-exception OR LGPL-2.1-or-later. Detailed license information
10 // governing the source code and code contributions can be found in
11 // LICENSE.md and CONTRIBUTING.md at the top level directory of deal.II.
12 //
13 // ------------------------------------------------------------------------
14
15 #ifndef dealii_dof_info_templates_h
16 #define dealii_dof_info_templates_h
17
18
19 #include <deal.II/base/config.h>
20
21 #include <deal.II/base/quadrature_lib.h>
22
23 #include <deal.II/meshworker/dof_info.h>
24
25 DEAL_II_NAMESPACE_OPEN
26
27
28 namespace MeshWorker
29 {
30 template <int dim, int spacedim, typename number>
31 DoFInfo<dim, spacedim, number>::DoFInfo(const BlockInfo &info)
32 : face_number(numbers::invalid_unsigned_int)
33 , sub_number(numbers::invalid_unsigned_int)
34 , block_info(&info, typeid(*this).name())
35 , level_cell(false)
36 {
37 indices_by_block.resize(info.local().size());
38 for (unsigned int i = 0; i < indices_by_block.size(); ++i)
39 indices_by_block[i].resize(info.local().block_size(i));
40 }
41
42
43
44 template <int dim, int spacedim, typename number>
45 void
46 DoFInfo<dim, spacedim, number>::set_block_indices()
47 {
48 for (unsigned int i = 0; i < indices.size(); ++i)
49 {
50 const std::pair<unsigned int, unsigned int> bi =
51 block_info->local().global_to_local(this->block_info->renumber(i));
52 indices_by_block[bi.first][bi.second] = indices_org[i];
53 }
54 // Remove this after
55 // changing block codes
56 for (unsigned int i = 0; i < indices.size(); ++i)
57 indices[this->block_info->renumber(i)] = indices_org[i];
58 }
59 } // namespace MeshWorker
60
61
62 DEAL_II_NAMESPACE_CLOSE
63
64 #endif