Reference documentation for deal.II version 9.3.3
\(\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 - 2021 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
33namespace internal
34{
35 namespace DoFHandlerImplementation
36 {
68 template <int dim>
70 {
71 public:
76 std::vector<types::global_dof_index> cell_dof_indices_cache;
77
82
93 get_cell_cache_start(const unsigned int obj_index,
94 const unsigned int dofs_per_cell) const;
95
100 std::size_t
101 memory_consumption() const;
102
108 template <class Archive>
109 void
110 serialize(Archive &ar, const unsigned int version);
111 };
112
113
114
115 template <int dim>
116 inline const types::global_dof_index *
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 cell_dof_indices_cache.size(),
123
124 return cell_dof_indices_cache.data() + (obj_index * dofs_per_cell);
125 }
126
127
128
129 template <int dim>
130 inline std::size_t
132 {
133 return (MemoryConsumption::memory_consumption(cell_dof_indices_cache) +
135 }
136
137
138 template <int dim>
139 template <class Archive>
140 inline void
141 DoFLevel<dim>::serialize(Archive &ar, const unsigned int)
142 {
143 ar &cell_dof_indices_cache;
144 ar &dof_object;
145 }
146 } // namespace DoFHandlerImplementation
147} // namespace internal
148
150
151#endif
std::vector< types::global_dof_index > cell_dof_indices_cache
Definition: dof_levels.h:76
void serialize(Archive &ar, const unsigned int version)
Definition: dof_levels.h:141
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
#define DEAL_II_NAMESPACE_OPEN
Definition: config.h:402
#define DEAL_II_NAMESPACE_CLOSE
Definition: config.h:403
#define Assert(cond, exc)
Definition: exceptions.h:1465
static ::ExceptionBase & ExcInternalError()
std::enable_if< std::is_fundamental< T >::value, std::size_t >::type memory_consumption(const T &t)