Reference documentation for deal.II version 9.2.0
\(\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\}}\)
dof_levels.h
Go to the documentation of this file.
1 // ---------------------------------------------------------------------
2 //
3 // Copyright (C) 1998 - 2018 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.md at
12 // the top level directory of deal.II.
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 
24 
26 
27 #include <vector>
28 
29 
31 
32 
33 namespace internal
34 {
35  namespace DoFHandlerImplementation
36  {
70  template <int dim>
71  class DoFLevel
72  {
73  public:
78  std::vector<types::global_dof_index> cell_dof_indices_cache;
79 
84 
95  get_cell_cache_start(const unsigned int obj_index,
96  const unsigned int dofs_per_cell) const;
97 
102  std::size_t
103  memory_consumption() const;
104 
109  template <class Archive>
110  void
111  serialize(Archive &ar, const unsigned int version);
112  };
113 
114 
115 
116  template <int dim>
117  inline const types::global_dof_index *
118  DoFLevel<dim>::get_cell_cache_start(const unsigned int obj_index,
119  const unsigned int dofs_per_cell) const
120  {
121  Assert(obj_index * dofs_per_cell + dofs_per_cell <=
122  cell_dof_indices_cache.size(),
123  ExcInternalError());
124 
125  return cell_dof_indices_cache.data() + (obj_index * dofs_per_cell);
126  }
127 
128 
129 
130  template <int dim>
131  inline std::size_t
133  {
134  return (MemoryConsumption::memory_consumption(cell_dof_indices_cache) +
136  }
137 
138 
139  template <int dim>
140  template <class Archive>
141  inline void
142  DoFLevel<dim>::serialize(Archive &ar, const unsigned int)
143  {
144  ar &cell_dof_indices_cache;
145  ar &dof_object;
146  }
147  } // namespace DoFHandlerImplementation
148 } // namespace internal
149 
151 
152 #endif
internal::DoFHandlerImplementation::DoFLevel
Definition: dof_levels.h:71
memory_consumption.h
dof_objects.h
internal::DoFHandlerImplementation::DoFLevel::dof_object
DoFObjects< dim > dof_object
Definition: dof_levels.h:83
internal::DoFHandlerImplementation::DoFLevel::memory_consumption
std::size_t memory_consumption() const
Definition: dof_levels.h:132
DEAL_II_NAMESPACE_OPEN
#define DEAL_II_NAMESPACE_OPEN
Definition: config.h:358
MemoryConsumption::memory_consumption
std::enable_if< std::is_fundamental< T >::value, std::size_t >::type memory_consumption(const T &t)
Definition: memory_consumption.h:268
exceptions.h
internal::DoFHandlerImplementation::DoFLevel::get_cell_cache_start
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:118
unsigned int
StandardExceptions::ExcInternalError
static ::ExceptionBase & ExcInternalError()
Assert
#define Assert(cond, exc)
Definition: exceptions.h:1419
internal::DoFHandlerImplementation::DoFObjects
Definition: dof_objects.h:70
internal::DoFHandlerImplementation::DoFLevel::serialize
void serialize(Archive &ar, const unsigned int version)
Definition: dof_levels.h:142
config.h
internal
Definition: aligned_vector.h:369
DEAL_II_NAMESPACE_CLOSE
#define DEAL_II_NAMESPACE_CLOSE
Definition: config.h:359
internal::DoFHandlerImplementation::DoFLevel::cell_dof_indices_cache
std::vector< types::global_dof_index > cell_dof_indices_cache
Definition: dof_levels.h:78