Reference documentation for deal.II version 9.4.1
\(\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_accessor.cc
Go to the documentation of this file.
1// ---------------------------------------------------------------------
2//
3// Copyright (C) 1998 - 2020 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
19
20#include <deal.II/fe/fe.h>
21
23#include <deal.II/grid/tria_iterator.templates.h>
24
26
27#include <vector>
28
30
31/* --------------------- Static variables: DoFAccessor --------------------- */
32
33template <int structdim, int dim, int spacedim, bool level_dof_access>
34const unsigned int
36
37template <int structdim, int dim, int spacedim, bool level_dof_access>
38const unsigned int
40
41
42
43/* ---------------------- Functions: DoFInvalidAccessor -------------------- */
44
45template <int structdim, int dim, int spacedim>
48 const int,
49 const int,
50 const AccessorData *)
51{
52 Assert(false,
53 ExcMessage("You are attempting an illegal conversion between "
54 "iterator/accessor types. The constructor you call "
55 "only exists to make certain template constructs "
56 "easier to write as dimension independent code but "
57 "the conversion is not valid in the current context."));
58}
59
60
61
62template <int structdim, int dim, int spacedim>
64 const DoFInvalidAccessor &i)
65 : InvalidAccessor<structdim, dim, spacedim>(
66 static_cast<const InvalidAccessor<structdim, dim, spacedim> &>(i))
67{
68 Assert(false,
69 ExcMessage("You are attempting an illegal conversion between "
70 "iterator/accessor types. The constructor you call "
71 "only exists to make certain template constructs "
72 "easier to write as dimension independent code but "
73 "the conversion is not valid in the current context."));
74}
75
76
77
78template <int structdim, int dim, int spacedim>
81 const unsigned int,
82 const unsigned int) const
83{
84 Assert(false, ExcInternalError());
85 return 0;
86}
87
88
89
90template <int structdim, int dim, int spacedim>
91void
93 const unsigned int,
95 const unsigned int) const
96{
97 Assert(false, ExcInternalError());
98}
99
100
101
102/*------------------------- Functions: DoFCellAccessor -----------------------*/
103
104
105
106template <int dim, int spacedim, bool lda>
107void
109{
110 Assert(static_cast<unsigned int>(this->present_level) <
111 this->dof_handler->object_dof_indices.size(),
112 ExcMessage("DoFHandler not initialized"));
113
114 Assert(this->dof_handler != nullptr, typename BaseClass::ExcInvalidObject());
115
116 internal::DoFCellAccessorImplementation::Implementation::
117 update_cell_dof_indices_cache(*this);
118}
119
120
121
122template <int dim, int spacedim, bool lda>
123void
125 const std::vector<types::global_dof_index> &local_dof_indices)
126{
127 Assert(static_cast<unsigned int>(this->present_level) <
128 this->dof_handler->object_dof_indices.size(),
129 ExcMessage("DoFHandler not initialized"));
130
131 Assert(this->dof_handler != nullptr, typename BaseClass::ExcInvalidObject());
132
133 internal::DoFAccessorImplementation::Implementation::
134 template set_dof_indices<dim, spacedim, lda, dim>(*this,
135 local_dof_indices,
136 this->active_fe_index());
137}
138
139
140
141template <int dim, int spacedim, bool lda>
144 const unsigned int face,
145 const unsigned int subface) const
146{
150 this->dof_handler);
151}
152
153
154
155template <int dim, int spacedim, bool lda>
158 const unsigned int face,
159 const unsigned int subface) const
160{
163 subface);
165 this->dof_handler);
166}
167
168
169
170template <int dim, int spacedim, bool lda>
173 const unsigned int face) const
174{
178 this->dof_handler);
179}
180
181
182
183template <int dim, int spacedim, bool lda>
186 const unsigned int face) const
187{
191 this->dof_handler);
192}
193
194
195
196// --------------------------------------------------------------------------
197// explicit instantiations
198#include "dof_accessor.inst"
199
TriaIterator< CellAccessor< dim, spacedim > > periodic_neighbor(const unsigned int i) const
TriaIterator< CellAccessor< dim, spacedim > > neighbor_child_on_subface(const unsigned int face_no, const unsigned int subface_no) const
TriaIterator< CellAccessor< dim, spacedim > > periodic_neighbor_child_on_subface(const unsigned int face_no, const unsigned int subface_no) const
TriaIterator< CellAccessor< dim, spacedim > > neighbor_or_periodic_neighbor(const unsigned int i) const
TriaIterator< DoFCellAccessor< dimension_, space_dimension_, level_dof_access > > periodic_neighbor_child_on_subface(const unsigned int face_no, const unsigned int subface_no) const
void update_cell_dof_indices_cache() const
TriaIterator< DoFCellAccessor< dimension_, space_dimension_, level_dof_access > > neighbor_or_periodic_neighbor(const unsigned int i) const
TriaIterator< DoFCellAccessor< dimension_, space_dimension_, level_dof_access > > periodic_neighbor(const unsigned int i) const
void set_dof_indices(const std::vector< types::global_dof_index > &dof_indices)
TriaIterator< DoFCellAccessor< dimension_, space_dimension_, level_dof_access > > neighbor_child_on_subface(const unsigned int face_no, const unsigned int subface_no) const
DoFInvalidAccessor(const Triangulation< dim, spacedim > *parent=0, const int level=-1, const int index=-1, const AccessorData *local_data=0)
Definition: dof_accessor.cc:46
types::global_dof_index dof_index(const unsigned int i, const unsigned int fe_index=DoFHandler< dim, spacedim >::default_fe_index) const
Definition: dof_accessor.cc:80
typename InvalidAccessor< structdim, dim, spacedim >::AccessorData AccessorData
void set_dof_index(const unsigned int i, const types::global_dof_index index, const unsigned int fe_index=DoFHandler< dim, spacedim >::invalid_fe_index) const
Definition: dof_accessor.cc:92
#define DEAL_II_NAMESPACE_OPEN
Definition: config.h:442
#define DEAL_II_NAMESPACE_CLOSE
Definition: config.h:443
#define Assert(cond, exc)
Definition: exceptions.h:1473
static ::ExceptionBase & ExcInternalError()
static ::ExceptionBase & ExcMessage(std::string arg1)