21#include <boost/container/small_vector.hpp>
29template <
int structdim,
int dim,
int spacedim,
bool level_dof_access>
33template <
int structdim,
int dim,
int spacedim,
bool level_dof_access>
41template <
int structdim,
int dim,
int spacedim>
49 ExcMessage(
"You are attempting an illegal conversion between "
50 "iterator/accessor types. The constructor you call "
51 "only exists to make certain template constructs "
52 "easier to write as dimension independent code but "
53 "the conversion is not valid in the current context."));
58template <
int structdim,
int dim,
int spacedim>
65 ExcMessage(
"You are attempting an illegal conversion between "
66 "iterator/accessor types. The constructor you call "
67 "only exists to make certain template constructs "
68 "easier to write as dimension independent code but "
69 "the conversion is not valid in the current context."));
74template <
int structdim,
int dim,
int spacedim>
86template <
int structdim,
int dim,
int spacedim>
102template <
int dim,
int spacedim,
bool lda>
105 const std::vector<types::global_dof_index> &local_dof_indices)
108 this->dof_handler->object_dof_indices.size(),
111 Assert(this->dof_handler !=
nullptr,
typename BaseClass::ExcInvalidObject());
113 internal::DoFAccessorImplementation::Implementation::
114 template set_dof_indices<dim, spacedim, lda, dim>(*
this,
116 this->active_fe_index());
121template <
int dim,
int spacedim,
bool lda>
124 const unsigned int face,
125 const unsigned int subface)
const
135template <
int dim,
int spacedim,
bool lda>
138 const unsigned int face,
139 const unsigned int subface)
const
150template <
int dim,
int spacedim,
bool lda>
153 const unsigned int face)
const
163template <
int dim,
int spacedim,
bool lda>
166 const unsigned int face)
const
176template <
int structdim,
int dim,
int spacedim,
bool level_dof_access>
179 std::vector<types::global_dof_index> &dof_indices,
182 Assert(this->dof_handler !=
nullptr, ExcInvalidObject());
184 const auto fe_index =
189 this->dof_handler->object_dof_indices.size(),
191 "The DoFHandler to which this accessor points has not "
192 "been initialized, i.e., it doesn't appear that DoF indices "
193 "have been distributed on it."));
200 Assert(this->fe_index_is_active(fe_index) ||
201 (this->dof_handler->get_fe(fe_index).n_dofs_per_cell() ==
203 this->dof_handler->get_fe(fe_index).n_dofs_per_vertex()),
208 *
this, dof_indices, fe_index);
213template <
int structdim,
int dim,
int spacedim,
bool level_dof_access>
217 std::vector<types::global_dof_index> &dof_indices,
220 Assert(this->dof_handler !=
nullptr, ExcInvalidObject());
221 Assert(this->dof_handler->mg_vertex_dofs.size() > 0,
222 ExcMessage(
"Multigrid DoF indices can only be accessed after "
223 "DoFHandler::distribute_mg_dofs() has been called!"));
225 const auto fe_index =
230 *
this,
level, dof_indices, fe_index);
235template <
int structdim,
int dim,
int spacedim,
bool level_dof_access>
239 const std::vector<types::global_dof_index> &dof_indices,
242 Assert(this->dof_handler !=
nullptr, ExcInvalidObject());
244 const auto fe_index =
249 *
this,
level, dof_indices, fe_index);
256 namespace DoFAccessorImplementation
258 template <
int dim,
int spacedim,
bool level_dof_access>
261 const ::DoFCellAccessor<dim, spacedim, level_dof_access> &accessor,
263 const unsigned int fe_index)
270 [](
auto stored_index,
auto dof_ptr) { *dof_ptr = stored_index; },
278template <
int dimension_,
int space_dimension_,
bool level_dof_access>
281 get_dof_indices(std::vector<types::global_dof_index> &dof_indices)
const
284 ExcMessage(
"get_dof_indices() only works on active cells."));
285 Assert(this->is_artificial() ==
false,
286 ExcMessage(
"Can't ask for DoF indices on artificial cells."));
290 *
this, dof_indices, this->active_fe_index());
295template <
int dimension_,
int space_dimension_,
bool level_dof_access>
300 Assert(this->dof_handler->mg_vertex_dofs.size() > 0,
301 ExcMessage(
"Multigrid DoF indices can only be accessed after "
302 "DoFHandler::distribute_mg_dofs() has been called!"));
309template <
int dimension_,
int space_dimension_,
bool level_dof_access>
314 Assert(this->dof_handler->mg_vertex_dofs.size() > 0,
315 ExcMessage(
"Multigrid DoF indices can only be accessed after "
316 "DoFHandler::distribute_mg_dofs() has been called!"));
323#include "dofs/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
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
typename InvalidAccessor< structdim, dim, spacedim >::AccessorData AccessorData
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 DEAL_II_ASSERT_UNREACHABLE()
#define Assert(cond, exc)
#define AssertDimension(dim1, dim2)
static ::ExceptionBase & ExcInternalError()
static ::ExceptionBase & ExcMessage(std::string arg1)
types::fe_index get_fe_index_or_default(const DoFAccessor< structdim, dim, spacedim, level_dof_access > &cell, const types::fe_index fe_index)
void get_cell_dof_indices(const ::DoFCellAccessor< dim, spacedim, level_dof_access > &accessor, Implementation::dof_index_vector_type &dof_indices, const unsigned int fe_index)
unsigned short int fe_index
static void process_dof_indices(const ::DoFAccessor< structdim, dim, spacedim, level_dof_access > &accessor, const DoFIndicesType &const_dof_indices, const types::fe_index fe_index_, const DoFOperation &dof_operation, const DoFProcessor &dof_processor, const bool count_level_dofs)
static void get_dof_indices(const ::DoFAccessor< structdim, dim, spacedim, level_dof_access > &accessor, std::vector< types::global_dof_index > &dof_indices, const types::fe_index fe_index)
static void get_mg_dof_indices(const ::DoFAccessor< structdim, dim, spacedim, level_dof_access > &accessor, const int level, std::vector< types::global_dof_index > &dof_indices, const types::fe_index fe_index)
boost::container::small_vector<::types::global_dof_index, 100 > dof_index_vector_type
static void set_mg_dof_indices(const ::DoFAccessor< structdim, dim, spacedim, level_dof_access > &accessor, const int level, const std::vector< types::global_dof_index > &dof_indices, const types::fe_index fe_index)