22#include <deal.II/grid/tria_iterator.templates.h>
30template <
int structdim,
int dim,
int spacedim,
bool level_dof_access>
34template <
int structdim,
int dim,
int spacedim,
bool level_dof_access>
42template <
int structdim,
int dim,
int spacedim>
50 ExcMessage(
"You are attempting an illegal conversion between "
51 "iterator/accessor types. The constructor you call "
52 "only exists to make certain template constructs "
53 "easier to write as dimension independent code but "
54 "the conversion is not valid in the current context."));
59template <
int structdim,
int dim,
int spacedim>
66 ExcMessage(
"You are attempting an illegal conversion between "
67 "iterator/accessor types. The constructor you call "
68 "only exists to make certain template constructs "
69 "easier to write as dimension independent code but "
70 "the conversion is not valid in the current context."));
75template <
int structdim,
int dim,
int spacedim>
87template <
int structdim,
int dim,
int spacedim>
103template <
int dim,
int spacedim,
bool lda>
106 const std::vector<types::global_dof_index> &local_dof_indices)
108 Assert(
static_cast<unsigned int>(this->present_level) <
109 this->dof_handler->object_dof_indices.size(),
112 Assert(this->dof_handler !=
nullptr,
typename BaseClass::ExcInvalidObject());
114 internal::DoFAccessorImplementation::Implementation::
115 template set_dof_indices<dim, spacedim, lda, dim>(*
this,
117 this->active_fe_index());
122template <
int dim,
int spacedim,
bool lda>
125 const unsigned int face,
126 const unsigned int subface)
const
136template <
int dim,
int spacedim,
bool lda>
139 const unsigned int face,
140 const unsigned int subface)
const
151template <
int dim,
int spacedim,
bool lda>
154 const unsigned int face)
const
164template <
int dim,
int spacedim,
bool lda>
167 const unsigned int face)
const
177template <
int structdim,
int dim,
int spacedim,
bool level_dof_access>
180 std::vector<types::global_dof_index> &dof_indices,
183 Assert(this->dof_handler !=
nullptr, ExcInvalidObject());
185 const auto fe_index =
186 internal::DoFAccessorImplementation::get_fe_index_or_default(*
this,
190 this->dof_handler->object_dof_indices.size(),
192 "The DoFHandler to which this accessor points has not "
193 "been initialized, i.e., it doesn't appear that DoF indices "
194 "have been distributed on it."));
201 Assert(this->fe_index_is_active(fe_index) ||
202 (this->dof_handler->get_fe(fe_index).n_dofs_per_cell() ==
204 this->dof_handler->get_fe(fe_index).n_dofs_per_vertex()),
208 ::internal::DoFAccessorImplementation::Implementation::get_dof_indices(
209 *
this, dof_indices, fe_index);
214template <
int structdim,
int dim,
int spacedim,
bool level_dof_access>
218 std::vector<types::global_dof_index> &dof_indices,
221 Assert(this->dof_handler !=
nullptr, ExcInvalidObject());
222 Assert(this->dof_handler->mg_vertex_dofs.size() > 0,
223 ExcMessage(
"Multigrid DoF indices can only be accessed after "
224 "DoFHandler::distribute_mg_dofs() has been called!"));
226 const auto fe_index =
227 internal::DoFAccessorImplementation::get_fe_index_or_default(*
this,
230 internal::DoFAccessorImplementation::Implementation::get_mg_dof_indices(
231 *
this,
level, dof_indices, fe_index);
236template <
int structdim,
int dim,
int spacedim,
bool level_dof_access>
240 const std::vector<types::global_dof_index> &dof_indices,
243 Assert(this->dof_handler !=
nullptr, ExcInvalidObject());
245 const auto fe_index =
246 internal::DoFAccessorImplementation::get_fe_index_or_default(*
this,
249 internal::DoFAccessorImplementation::Implementation::set_mg_dof_indices(
250 *
this,
level, dof_indices, fe_index);
257 namespace DoFAccessorImplementation
259 template <
int dim,
int spacedim,
bool level_dof_access>
262 const ::DoFCellAccessor<dim, spacedim, level_dof_access> &accessor,
263 boost::container::small_vector<types::global_dof_index, 27> &dof_indices,
264 const unsigned int fe_index)
266 Implementation::process_dof_indices(
270 Implementation::DoFIndexProcessor<dim, spacedim>(),
271 [](
auto stored_index,
auto dof_ptr) { *dof_ptr = stored_index; },
279template <
int dimension_,
int space_dimension_,
bool level_dof_access>
282 get_dof_indices(std::vector<types::global_dof_index> &dof_indices)
const
285 ExcMessage(
"get_dof_indices() only works on active cells."));
286 Assert(this->is_artificial() ==
false,
287 ExcMessage(
"Can't ask for DoF indices on artificial cells."));
290 ::internal::DoFAccessorImplementation::Implementation::get_dof_indices(
291 *
this, dof_indices, this->active_fe_index());
296template <
int dimension_,
int space_dimension_,
bool level_dof_access>
301 Assert(this->dof_handler->mg_vertex_dofs.size() > 0,
302 ExcMessage(
"Multigrid DoF indices can only be accessed after "
303 "DoFHandler::distribute_mg_dofs() has been called!"));
310template <
int dimension_,
int space_dimension_,
bool level_dof_access>
315 Assert(this->dof_handler->mg_vertex_dofs.size() > 0,
316 ExcMessage(
"Multigrid DoF indices can only be accessed after "
317 "DoFHandler::distribute_mg_dofs() has been called!"));
324#include "dof_accessor.inst"
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
void set_mg_dof_indices(const int level, const std::vector< types::global_dof_index > &dof_indices, const types::fe_index fe_index=numbers::invalid_fe_index)
void get_mg_dof_indices(const int level, std::vector< types::global_dof_index > &dof_indices, const types::fe_index fe_index=numbers::invalid_fe_index) const
void get_dof_indices(std::vector< types::global_dof_index > &dof_indices, const types::fe_index fe_index=numbers::invalid_fe_index) 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
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
void set_mg_dof_indices(const std::vector< types::global_dof_index > &dof_indices)
void get_mg_dof_indices(std::vector< types::global_dof_index > &dof_indices) const
void get_dof_indices(std::vector< types::global_dof_index > &dof_indices) const
typename InvalidAccessor< structdim, dim, spacedim >::AccessorData AccessorData
DoFInvalidAccessor(const void *parent=nullptr, const int level=-1, const int index=-1, const AccessorData *local_data=nullptr)
types::global_dof_index dof_index(const unsigned int i, const types::fe_index fe_index=DoFHandler< dim, spacedim >::default_fe_index) const
void set_dof_index(const unsigned int i, const types::global_dof_index index, const types::fe_index fe_index=numbers::invalid_fe_index) const
#define DEAL_II_NAMESPACE_OPEN
#define DEAL_II_NAMESPACE_CLOSE
#define Assert(cond, exc)
#define AssertDimension(dim1, dim2)
static ::ExceptionBase & ExcInternalError()
static ::ExceptionBase & ExcMessage(std::string arg1)
#define DEAL_II_ASSERT_UNREACHABLE()
void get_cell_dof_indices(const ::DoFCellAccessor< dim, spacedim, level_dof_access > &accessor, boost::container::small_vector< types::global_dof_index, 27 > &dof_indices, const unsigned int fe_index)
unsigned short int fe_index