Reference documentation for deal.II version GIT d77e5ebb0a 2023-01-27 22:35:02+00:00
\(\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 
33 namespace internal
34 {
35  namespace DoFHandlerImplementation
36  {
62  template <int dim>
63  class DoFLevel
64  {
65  public:
70  std::vector<types::global_dof_index> cell_dof_indices_cache;
71 
76 
87  get_cell_cache_start(const unsigned int obj_index,
88  const unsigned int dofs_per_cell) const;
89 
94  std::size_t
95  memory_consumption() const;
96 
102  template <class Archive>
103  void
104  serialize(Archive &ar, const unsigned int version);
105  };
106 
107 
108 
109  template <int dim>
110  inline const types::global_dof_index *
111  DoFLevel<dim>::get_cell_cache_start(const unsigned int obj_index,
112  const unsigned int dofs_per_cell) const
113  {
114  Assert(obj_index * dofs_per_cell + dofs_per_cell <=
115  cell_dof_indices_cache.size(),
116  ExcInternalError());
117 
118  return cell_dof_indices_cache.data() + (obj_index * dofs_per_cell);
119  }
120 
121 
122 
123  template <int dim>
124  inline std::size_t
126  {
127  return (MemoryConsumption::memory_consumption(cell_dof_indices_cache) +
129  }
130 
131 
132  template <int dim>
133  template <class Archive>
134  inline void
135  DoFLevel<dim>::serialize(Archive &ar, const unsigned int)
136  {
137  ar &cell_dof_indices_cache;
138  ar &dof_object;
139  }
140  } // namespace DoFHandlerImplementation
141 } // namespace internal
142 
144 
145 #endif
std::vector< types::global_dof_index > cell_dof_indices_cache
Definition: dof_levels.h:70
void serialize(Archive &ar, const unsigned int version)
Definition: dof_levels.h:135
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:111
#define DEAL_II_NAMESPACE_OPEN
Definition: config.h:461
#define DEAL_II_NAMESPACE_CLOSE
Definition: config.h:462
static ::ExceptionBase & ExcInternalError()
#define Assert(cond, exc)
Definition: exceptions.h:1509
std::enable_if_t< std::is_fundamental< T >::value, std::size_t > memory_consumption(const T &t)
unsigned int global_dof_index
Definition: types.h:81