Reference documentation for deal.II version 9.6.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\}}\)
Loading...
Searching...
No Matches
dof_objects.h
Go to the documentation of this file.
1// ------------------------------------------------------------------------
2//
3// SPDX-License-Identifier: LGPL-2.1-or-later
4// Copyright (C) 2006 - 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_objects_h
16#define dealii_dof_objects_h
17
18
19#include <deal.II/base/config.h>
20
23
24#include <vector>
25
27
28// Forward declarations
29#ifndef DOXYGEN
30template <int dim, int spacedim>
32class DoFHandler;
33#endif
34
35namespace internal
36{
37 namespace DoFHandlerImplementation
38 {
39#ifndef DOXYGEN
40 template <int>
41 class DoFLevel;
42 template <int>
43 class DoFFaces;
44#endif
45
69 template <int dim>
71 {
72 public:
76 std::vector<types::global_dof_index> dofs;
77
90 template <int dh_dim, int spacedim>
93 const unsigned int obj_index,
94 const types::fe_index fe_index,
95 const unsigned int local_index);
96
102 template <int dh_dim, int spacedim>
103 unsigned int
105 const types::global_dof_index index) const;
106
111 template <int dh_dim, int spacedim>
112 bool
115 const types::fe_index fe_index) const;
116
121 std::size_t
122 memory_consumption() const;
123
129 template <class Archive>
130 void
131 serialize(Archive &ar, const unsigned int version);
132
133 // Declare the classes that store levels and faces of DoFs friends so
134 // that they can resize arrays.
135 template <int>
136 friend class DoFLevel;
137 template <int>
138 friend class DoFFaces;
139 };
140
141
142 // --------------------- template and inline functions ------------------
143
144 template <int dim>
145 template <int dh_dim, int spacedim>
146 inline unsigned int
152
153
154
155 template <int dim>
156 template <int dh_dim, int spacedim>
157 inline bool
160 const types::fe_index fe_index) const
161 {
162 (void)fe_index;
164 ExcMessage("Only zero fe_index values are allowed for "
165 "non-hp-DoFHandlers."));
166 return true;
167 }
168
169
170
171 template <int dim>
172 template <int dh_dim, int spacedim>
175 const DoFHandler<dh_dim, spacedim> &dof_handler,
176 const unsigned int obj_index,
177 const types::fe_index fe_index,
178 const unsigned int local_index)
179 {
180 (void)fe_index;
182 ExcMessage("Only the default FE index is allowed for DoFHandler "
183 "objects without hp capability"));
184 AssertIndexRange(local_index,
185 dof_handler.get_fe().template n_dofs_per_object<dim>());
187 obj_index * dof_handler.get_fe().template n_dofs_per_object<dim>() +
188 local_index,
189 dofs.size());
190
191 return dofs[obj_index *
192 dof_handler.get_fe().template n_dofs_per_object<dim>() +
193 local_index];
194 }
195
196
197 template <int dim>
198 template <class Archive>
199 void
200 DoFObjects<dim>::serialize(Archive &ar, const unsigned int)
201 {
202 ar &dofs;
203 }
204
205 } // namespace DoFHandlerImplementation
206} // namespace internal
207
209
210#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:76
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:503
#define DEAL_II_CXX20_REQUIRES(condition)
Definition config.h:177
#define DEAL_II_NAMESPACE_CLOSE
Definition config.h:504
#define Assert(cond, exc)
#define AssertIndexRange(index, range)
static ::ExceptionBase & ExcMessage(std::string arg1)
unsigned short int fe_index
Definition types.h:59