Reference documentation for deal.II version Git f15f581df6 2020-07-10 15:30:09 -0400
\(\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_accessor.cc
Go to the documentation of this file.
1 // ---------------------------------------------------------------------
2 //
3 // Copyright (C) 1998 - 2018 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 
25 #include <deal.II/hp/dof_handler.h>
26 
27 #include <vector>
28 
30 
31 /* --------------------- Static variables: DoFAccessor --------------------- */
32 
33 template <int structdim, int dim, int spacedim, bool level_dof_access>
34 const unsigned int
36 
37 template <int structdim, int dim, int spacedim, bool level_dof_access>
38 const unsigned int
40 
41 
42 
43 /* ---------------------- Functions: DoFInvalidAccessor -------------------- */
44 
45 template <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 
62 template <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 
78 template <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 
90 template <int structdim, int dim, int spacedim>
91 void
93  const unsigned int,
95  const unsigned int) const
96 {
97  Assert(false, ExcInternalError());
98 }
99 
100 
101 
102 /*------------------------- Functions: DoFCellAccessor -----------------------*/
103 
104 
105 
106 template <int dim, int spacedim, bool lda>
107 void
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 
122 template <int dim, int spacedim, bool lda>
123 void
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  AssertDimension(local_dof_indices.size(), this->get_fe().dofs_per_cell);
134 
135  internal::DoFAccessorImplementation::Implementation::
136  template set_dof_indices<dim, spacedim, lda, dim>(*this,
137  local_dof_indices,
138  this->active_fe_index());
139 }
140 
141 
142 
143 template <int dim, int spacedim, bool lda>
146  const unsigned int face,
147  const unsigned int subface) const
148 {
152  this->dof_handler);
153 }
154 
155 
156 
157 template <int dim, int spacedim, bool lda>
160  const unsigned int face,
161  const unsigned int subface) const
162 {
165  subface);
167  this->dof_handler);
168 }
169 
170 
171 
172 template <int dim, int spacedim, bool lda>
175  const unsigned int face) const
176 {
180  this->dof_handler);
181 }
182 
183 
184 
185 template <int dim, int spacedim, bool lda>
188  const unsigned int face) const
189 {
193  this->dof_handler);
194 }
195 
196 
197 
198 // --------------------------------------------------------------------------
199 // explicit instantiations
200 #include "dof_accessor.inst"
201 
#define AssertDimension(dim1, dim2)
Definition: exceptions.h:1560
TriaIterator< CellAccessor< dim, spacedim > > neighbor_or_periodic_neighbor(const unsigned int i) const
TriaIterator< DoFCellAccessor< dimension_, space_dimension_, level_dof_access > > periodic_neighbor(const unsigned int i) const
TriaIterator< DoFCellAccessor< dimension_, space_dimension_, level_dof_access > > neighbor_or_periodic_neighbor(const unsigned int i) const
typename InvalidAccessor< structdim, dim, spacedim >::AccessorData AccessorData
TriaIterator< CellAccessor< dim, spacedim > > neighbor_child_on_subface(const unsigned int face_no, const unsigned int subface_no) const
static ::ExceptionBase & ExcMessage(std::string arg1)
#define Assert(cond, exc)
Definition: exceptions.h:1403
void set_dof_indices(const std::vector< types::global_dof_index > &dof_indices)
#define DEAL_II_NAMESPACE_CLOSE
Definition: config.h:363
TriaIterator< CellAccessor< dim, spacedim > > periodic_neighbor_child_on_subface(const unsigned int face_no, const unsigned int subface_no) 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 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
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
#define DEAL_II_NAMESPACE_OPEN
Definition: config.h:362
TriaIterator< CellAccessor< dim, spacedim > > periodic_neighbor(const unsigned int i) const
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 ::internal::TriaAccessorImplementation::PresentLevelType< structdim, dim >::type present_level
TriaIterator< DoFCellAccessor< dimension_, space_dimension_, level_dof_access > > neighbor_child_on_subface(const unsigned int face_no, const unsigned int subface_no) const
void update_cell_dof_indices_cache() const
static ::ExceptionBase & ExcInternalError()