Reference documentation for deal.II version 8.5.1
dof_levels.h
1 // ---------------------------------------------------------------------
2 //
3 // Copyright (C) 1998 - 2015 by the deal.II authors
4 //
5 // This file is part of the deal.II library.
6 //
7 // The deal.II library is free software; you can use it, redistribute
8 // it, and/or modify it under the terms of the GNU Lesser General
9 // Public License as published by the Free Software Foundation; either
10 // version 2.1 of the License, or (at your option) any later version.
11 // The full text of the license can be found in the file LICENSE at
12 // the top level of the deal.II distribution.
13 //
14 // ---------------------------------------------------------------------
15 
16 #ifndef dealii__dof_levels_h
17 #define dealii__dof_levels_h
18 
19 
20 #include <deal.II/base/config.h>
21 #include <deal.II/base/exceptions.h>
22 #include <deal.II/base/memory_consumption.h>
23 #include <deal.II/dofs/dof_objects.h>
24 #include <vector>
25 
26 
27 DEAL_II_NAMESPACE_OPEN
28 
29 
30 namespace internal
31 {
32  namespace DoFHandler
33  {
34 
35 
69  template <int dim>
70  class DoFLevel
71  {
72  public:
77  std::vector<types::global_dof_index> cell_dof_indices_cache;
78 
83 
94  get_cell_cache_start (const unsigned int obj_index,
95  const unsigned int dofs_per_cell) const;
96 
101  std::size_t memory_consumption () const;
102 
107  template <class Archive>
108  void serialize(Archive &ar,
109  const unsigned int version);
110  };
111 
112 
113 
114  template <int dim>
115  inline
117  DoFLevel<dim>::get_cell_cache_start (const unsigned int obj_index,
118  const unsigned int dofs_per_cell) const
119  {
120  Assert (obj_index*dofs_per_cell+dofs_per_cell
121  <=
122  cell_dof_indices_cache.size(),
123  ExcInternalError());
124 
125  return &cell_dof_indices_cache[obj_index*dofs_per_cell];
126  }
127 
128 
129 
130  template <int dim>
131  inline
132  std::size_t
134  {
135  return (MemoryConsumption::memory_consumption (cell_dof_indices_cache) +
137  }
138 
139 
140  template <int dim>
141  template <class Archive>
142  inline
143  void
145  const unsigned int)
146  {
147  ar &cell_dof_indices_cache;
148  ar &dof_object;
149  }
150  }
151 }
152 
153 DEAL_II_NAMESPACE_CLOSE
154 
155 #endif
void serialize(Archive &ar, const unsigned int version)
Definition: dof_levels.h:144
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:117
std::size_t memory_consumption() const
Definition: dof_levels.h:133
unsigned int global_dof_index
Definition: types.h:88
#define Assert(cond, exc)
Definition: exceptions.h:313
DoFObjects< dim > dof_object
Definition: dof_levels.h:82
std_cxx11::enable_if< std_cxx11::is_fundamental< T >::value, std::size_t >::type memory_consumption(const T &t)
std::vector< types::global_dof_index > cell_dof_indices_cache
Definition: dof_levels.h:77
static ::ExceptionBase & ExcInternalError()