Reference documentation for deal.II version 8.1.0
dof_levels.h
1 // ---------------------------------------------------------------------
2 // @f$Id: dof_levels.h 31932 2013-12-08 02:15:54Z heister @f$
3 //
4 // Copyright (C) 1998 - 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 #ifndef __deal2__dof_levels_h
18 #define __deal2__dof_levels_h
19 
20 
21 #include <deal.II/base/config.h>
23 #include <deal.II/base/memory_consumption.h>
24 #include <deal.II/dofs/dof_objects.h>
25 #include <vector>
26 
27 
29 
30 template <int, int> class DoFHandler;
31 template <int, int> class MGDoFHandler;
32 
33 
34 namespace internal
35 {
36  namespace DoFHandler
37  {
38 
39 
73  template <int dim>
74  class DoFLevel
75  {
76  public:
85  std::vector<types::global_dof_index> cell_dof_indices_cache;
86 
92 
103  get_cell_cache_start (const unsigned int obj_index,
104  const unsigned int dofs_per_cell) const;
105 
111  std::size_t memory_consumption () const;
112 
117  template <class Archive>
118  void serialize(Archive &ar,
119  const unsigned int version);
120  };
121 
122 
123 
124  template <int dim>
125  inline
127  DoFLevel<dim>::get_cell_cache_start (const unsigned int obj_index,
128  const unsigned int dofs_per_cell) const
129  {
130  Assert (obj_index*dofs_per_cell+dofs_per_cell
131  <=
132  cell_dof_indices_cache.size(),
133  ExcInternalError());
134 
135  return &cell_dof_indices_cache[obj_index*dofs_per_cell];
136  }
137 
138 
139 
140  template <int dim>
141  inline
142  std::size_t
144  {
147  }
148 
149 
150  template <int dim>
151  template <class Archive>
152  inline
153  void
155  const unsigned int)
156  {
158  ar &dof_object;
159  }
160  }
161 }
162 
163 DEAL_II_NAMESPACE_CLOSE
164 
165 #endif
void serialize(Archive &ar, const unsigned int version)
Definition: dof_levels.h:154
const types::global_dof_index * get_cell_cache_start(const unsigned int obj_index, const unsigned int dofs_per_cell) const
Definition: dof_levels.h:127
unsigned int global_dof_index
Definition: types.h:100
#define Assert(cond, exc)
Definition: exceptions.h:299
std::size_t memory_consumption(const T &t)
std::size_t memory_consumption() const
Definition: dof_levels.h:143
DoFObjects< dim > dof_object
Definition: dof_levels.h:91
::ExceptionBase & ExcInternalError()
std::vector< types::global_dof_index > cell_dof_indices_cache
Definition: dof_levels.h:85