deal.II version GIT relicensing-6834-g5b78e6bcdf 2026-10-01 11:20:01+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_objects.h
Go to the documentation of this file.
1// -----------------------------------------------------------------------------
2//
3// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception OR LGPL-2.1-or-later
4// Copyright (C) 2006 - 2025 by the deal.II authors
5//
6// This file is part of the deal.II library.
7//
8// Detailed license information governing the source code and contributions
9// can be found in LICENSE.md and CONTRIBUTING.md at the top level directory.
10//
11// -----------------------------------------------------------------------------
12
13#ifndef dealii_dof_objects_h
14#define dealii_dof_objects_h
15
16
17#include <deal.II/base/config.h>
18
21#include <deal.II/base/types.h>
22
23#include <vector>
24
26
27// Forward declarations
28#ifndef DOXYGEN
29template <int dim, int spacedim>
31class DoFHandler;
32#endif
33
34namespace internal
35{
36 namespace DoFHandlerImplementation
37 {
38#ifndef DOXYGEN
39 template <int>
40 class DoFLevel;
41 template <int>
42 class DoFFaces;
43#endif
44
68 template <int dim>
70 {
71 public:
75 std::vector<types::global_dof_index> dofs;
76
89 template <int dh_dim, int spacedim>
92 const unsigned int obj_index,
93 const types::fe_index fe_index,
94 const unsigned int local_index);
95
101 template <int dh_dim, int spacedim>
102 unsigned int
104 const types::global_dof_index index) const;
105
110 template <int dh_dim, int spacedim>
111 bool
114 const types::fe_index fe_index) const;
115
120 std::size_t
121 memory_consumption() const;
122
128 template <class Archive>
129 void
130 serialize(Archive &ar, const unsigned int version);
131
132 // Declare the classes that store levels and faces of DoFs friends so
133 // that they can resize arrays.
134 template <int>
135 friend class DoFLevel;
136 template <int>
137 friend class DoFFaces;
138 };
139
140
141 // --------------------- template and inline functions ------------------
142
143 template <int dim>
144 template <int dh_dim, int spacedim>
145 inline unsigned int
151
152
153
154 template <int dim>
155 template <int dh_dim, int spacedim>
156 inline bool
159 const types::fe_index fe_index) const
160 {
161 (void)fe_index;
163 ExcMessage("Only zero fe_index values are allowed for "
164 "non-hp-DoFHandlers."));
165 return true;
166 }
167
168
169
170 template <int dim>
171 template <int dh_dim, int spacedim>
174 const DoFHandler<dh_dim, spacedim> &dof_handler,
175 const unsigned int obj_index,
176 const types::fe_index fe_index,
177 const unsigned int local_index)
178 {
179 (void)fe_index;
181 ExcMessage("Only the default FE index is allowed for DoFHandler "
182 "objects without hp capability"));
183 AssertIndexRange(local_index,
184 dof_handler.get_fe().template n_dofs_per_object<dim>());
186 obj_index * dof_handler.get_fe().template n_dofs_per_object<dim>() +
187 local_index,
188 dofs.size());
189
190 return dofs[obj_index *
191 dof_handler.get_fe().template n_dofs_per_object<dim>() +
192 local_index];
193 }
194
195
196 template <int dim>
197 template <class Archive>
198 void
199 DoFObjects<dim>::serialize(Archive &ar, const unsigned int)
200 {
201 ar &dofs;
202 }
203
204 } // namespace DoFHandlerImplementation
205} // namespace internal
206
208
209#endif
const FiniteElement< dim, spacedim > & get_fe(const types::fe_index index=0) const
types::global_dof_index & access_dof_index(const DoFHandler< dh_dim, spacedim > &dof_handler, const unsigned int obj_index, const types::fe_index fe_index, const unsigned int local_index)
unsigned int n_active_fe_indices(const DoFHandler< dh_dim, spacedim > &dof_handler, const types::global_dof_index index) const
std::vector< types::global_dof_index > dofs
Definition dof_objects.h:75
bool fe_index_is_active(const DoFHandler< dh_dim, spacedim > &dof_handler, const types::global_dof_index index, const types::fe_index fe_index) const
void serialize(Archive &ar, const unsigned int version)
#define DEAL_II_NAMESPACE_OPEN
Definition config.h:38
#define DEAL_II_CXX20_REQUIRES(condition)
Definition config.h:249
#define DEAL_II_NAMESPACE_CLOSE
Definition config.h:39
#define Assert(cond, exc)
#define AssertIndexRange(index, range)
static ::ExceptionBase & ExcMessage(std::string arg1)
unsigned short int fe_index
Definition types.h:70