deal.II version GIT relicensing-2287-g6548a49e0a 2024-12-20 18:30:00+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\}}\)
Loading...
Searching...
No Matches
dof_levels.h
Go to the documentation of this file.
1// ------------------------------------------------------------------------
2//
3// SPDX-License-Identifier: LGPL-2.1-or-later
4// Copyright (C) 1998 - 2023 by the deal.II authors
5//
6// This file is part of the deal.II library.
7//
8// Part of the source code is dual licensed under Apache-2.0 WITH
9// LLVM-exception OR LGPL-2.1-or-later. Detailed license information
10// governing the source code and code contributions can be found in
11// LICENSE.md and CONTRIBUTING.md at the top level directory of deal.II.
12//
13// ------------------------------------------------------------------------
14
15#ifndef dealii_dof_levels_h
16#define dealii_dof_levels_h
17
18
19#include <deal.II/base/config.h>
20
23
25
26#include <vector>
27
28
30
31
32namespace internal
33{
34 namespace DoFHandlerImplementation
35 {
61 template <int dim>
63 {
64 public:
69 std::vector<types::global_dof_index> cell_dof_indices_cache;
70
75
86 get_cell_cache_start(const unsigned int obj_index,
87 const unsigned int dofs_per_cell) const;
88
93 std::size_t
94 memory_consumption() const;
95
101 template <class Archive>
102 void
103 serialize(Archive &ar, const unsigned int version);
104 };
105
106
107
108 template <int dim>
109 inline const types::global_dof_index *
110 DoFLevel<dim>::get_cell_cache_start(const unsigned int obj_index,
111 const unsigned int dofs_per_cell) const
112 {
113 Assert(obj_index * dofs_per_cell + dofs_per_cell <=
114 cell_dof_indices_cache.size(),
116
117 return cell_dof_indices_cache.data() + (obj_index * dofs_per_cell);
118 }
119
120
121
122 template <int dim>
123 inline std::size_t
125 {
126 return (MemoryConsumption::memory_consumption(cell_dof_indices_cache) +
128 }
129
130
131 template <int dim>
132 template <class Archive>
133 inline void
134 DoFLevel<dim>::serialize(Archive &ar, const unsigned int)
135 {
136 ar &cell_dof_indices_cache;
137 ar &dof_object;
138 }
139 } // namespace DoFHandlerImplementation
140} // namespace internal
141
143
144#endif
std::vector< types::global_dof_index > cell_dof_indices_cache
Definition dof_levels.h:69
void serialize(Archive &ar, const unsigned int version)
Definition dof_levels.h:134
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:110
#define DEAL_II_NAMESPACE_OPEN
Definition config.h:498
#define DEAL_II_NAMESPACE_CLOSE
Definition config.h:499
#define Assert(cond, exc)
static ::ExceptionBase & ExcInternalError()
std::enable_if_t< std::is_fundamental_v< T >, std::size_t > memory_consumption(const T &t)