Reference documentation for deal.II version 8.1.0
dof_info.templates.h
1 // ---------------------------------------------------------------------
2 // @f$Id: dof_info.templates.h 30036 2013-07-18 16:55:32Z maier @f$
3 //
4 // Copyright (C) 2009 - 2013 by the deal.II authors
5 //
6 // This file is part of the deal.II library.
7 //
8 // The deal.II library is free software; you can use it, redistribute
9 // it, and/or modify it under the terms of the GNU Lesser General
10 // Public License as published by the Free Software Foundation; either
11 // version 2.1 of the License, or (at your option) any later version.
12 // The full text of the license can be found in the file LICENSE at
13 // the top level of the deal.II distribution.
14 //
15 // ---------------------------------------------------------------------
16 
17 #include <deal.II/meshworker/dof_info.h>
18 #include <deal.II/base/quadrature_lib.h>
19 
21 
22 
23 namespace MeshWorker
24 {
25  template <int dim, int spacedim, typename number>
27  : block_info(&info, typeid(*this).name())
28  {
29  indices_by_block.resize(info.local().size());
30  for (unsigned int i=0; i<indices_by_block.size(); ++i)
31  indices_by_block[i].resize(info.local().block_size(i));
32  }
33 
34 
35  template <int dim, int spacedim, typename number>
37  {}
38 
39 
40  template <int dim, int spacedim, typename number>
41  void
43  {
44  for (unsigned int i=0; i<indices.size(); ++i)
45  {
46  const std::pair<unsigned int, unsigned int>
47  bi = block_info->local().global_to_local(this->block_info->renumber(i));
48  indices_by_block[bi.first][bi.second] = indices_org[i];
49  }
50  // Remove this after
51  // changing block codes
52  for (unsigned int i=0; i<indices.size(); ++i)
53  indices[this->block_info->renumber(i)] = indices_org[i];
54  }
55 }
56 
57 
58 DEAL_II_NAMESPACE_CLOSE
59 
std::vector< types::global_dof_index > indices_org
Auxiliary vector.
Definition: dof_info.h:191
void set_block_indices()
Set up local block indices.
SmartPointer< const BlockInfo, DoFInfo< dim, spacedim > > block_info
The block structure of the system.
Definition: dof_info.h:173
size_type block_size(const unsigned int i) const
std::vector< std::vector< types::global_dof_index > > indices_by_block
Definition: dof_info.h:111
const BlockIndices & local() const
Definition: block_info.h:251
A small class collecting the different BlockIndices involved in global, multilevel and local computat...
Definition: block_info.h:93
unsigned int size() const