23#include <deal.II/grid/tria_iterator.templates.h>
31template <
int structdim,
int dim,
int spacedim,
bool level_dof_access>
35template <
int structdim,
int dim,
int spacedim,
bool level_dof_access>
43template <
int structdim,
int dim,
int spacedim>
51 ExcMessage(
"You are attempting an illegal conversion between "
52 "iterator/accessor types. The constructor you call "
53 "only exists to make certain template constructs "
54 "easier to write as dimension independent code but "
55 "the conversion is not valid in the current context."));
60template <
int structdim,
int dim,
int spacedim>
67 ExcMessage(
"You are attempting an illegal conversion between "
68 "iterator/accessor types. The constructor you call "
69 "only exists to make certain template constructs "
70 "easier to write as dimension independent code but "
71 "the conversion is not valid in the current context."));
76template <
int structdim,
int dim,
int spacedim>
88template <
int structdim,
int dim,
int spacedim>
104template <
int dim,
int spacedim,
bool lda>
107 const std::vector<types::global_dof_index> &local_dof_indices)
109 Assert(
static_cast<unsigned int>(this->present_level) <
110 this->dof_handler->object_dof_indices.size(),
113 Assert(this->dof_handler !=
nullptr,
typename BaseClass::ExcInvalidObject());
115 internal::DoFAccessorImplementation::Implementation::
116 template set_dof_indices<dim, spacedim, lda, dim>(*
this,
118 this->active_fe_index());
123template <
int dim,
int spacedim,
bool lda>
126 const unsigned int face,
127 const unsigned int subface)
const
137template <
int dim,
int spacedim,
bool lda>
140 const unsigned int face,
141 const unsigned int subface)
const
152template <
int dim,
int spacedim,
bool lda>
155 const unsigned int face)
const
165template <
int dim,
int spacedim,
bool lda>
168 const unsigned int face)
const
178template <
int structdim,
int dim,
int spacedim,
bool level_dof_access>
181 std::vector<types::global_dof_index> &dof_indices,
184 Assert(this->dof_handler !=
nullptr, ExcInvalidObject());
186 const auto fe_index =
187 internal::DoFAccessorImplementation::get_fe_index_or_default(*
this,
191 this->dof_handler->object_dof_indices.size(),
193 "The DoFHandler to which this accessor points has not "
194 "been initialized, i.e., it doesn't appear that DoF indices "
195 "have been distributed on it."));
202 Assert(this->fe_index_is_active(fe_index) ||
203 (this->dof_handler->get_fe(fe_index).n_dofs_per_cell() ==
205 this->dof_handler->get_fe(fe_index).n_dofs_per_vertex()),
209 ::internal::DoFAccessorImplementation::Implementation::get_dof_indices(
210 *
this, dof_indices, fe_index);
215template <
int structdim,
int dim,
int spacedim,
bool level_dof_access>
219 std::vector<types::global_dof_index> &dof_indices,
222 Assert(this->dof_handler !=
nullptr, ExcInvalidObject());
223 Assert(this->dof_handler->mg_vertex_dofs.size() > 0,
224 ExcMessage(
"Multigrid DoF indices can only be accessed after "
225 "DoFHandler::distribute_mg_dofs() has been called!"));
227 const auto fe_index =
228 internal::DoFAccessorImplementation::get_fe_index_or_default(*
this,
231 internal::DoFAccessorImplementation::Implementation::get_mg_dof_indices(
232 *
this,
level, dof_indices, fe_index);
237template <
int structdim,
int dim,
int spacedim,
bool level_dof_access>
241 const std::vector<types::global_dof_index> &dof_indices,
244 Assert(this->dof_handler !=
nullptr, ExcInvalidObject());
246 const auto fe_index =
247 internal::DoFAccessorImplementation::get_fe_index_or_default(*
this,
250 internal::DoFAccessorImplementation::Implementation::set_mg_dof_indices(
251 *
this,
level, dof_indices, fe_index);
258 namespace DoFAccessorImplementation
260 template <
int dim,
int spacedim,
bool level_dof_access>
263 const ::DoFCellAccessor<dim, spacedim, level_dof_access> &accessor,
264 boost::container::small_vector<types::global_dof_index, 27> &dof_indices,
265 const unsigned int fe_index)
267 Implementation::process_dof_indices(
271 Implementation::DoFIndexProcessor<dim, spacedim>(),
272 [](
auto stored_index,
auto dof_ptr) { *dof_ptr = stored_index; },
280template <
int dimension_,
int space_dimension_,
bool level_dof_access>
283 get_dof_indices(std::vector<types::global_dof_index> &dof_indices)
const
286 ExcMessage(
"get_dof_indices() only works on active cells."));
287 Assert(this->is_artificial() ==
false,
288 ExcMessage(
"Can't ask for DoF indices on artificial cells."));
291 ::internal::DoFAccessorImplementation::Implementation::get_dof_indices(
292 *
this, dof_indices, this->active_fe_index());
297template <
int dimension_,
int space_dimension_,
bool level_dof_access>
302 Assert(this->dof_handler->mg_vertex_dofs.size() > 0,
303 ExcMessage(
"Multigrid DoF indices can only be accessed after "
304 "DoFHandler::distribute_mg_dofs() has been called!"));
311template <
int dimension_,
int space_dimension_,
bool level_dof_access>
316 Assert(this->dof_handler->mg_vertex_dofs.size() > 0,
317 ExcMessage(
"Multigrid DoF indices can only be accessed after "
318 "DoFHandler::distribute_mg_dofs() has been called!"));
325#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
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 Assert(cond, exc)
#define AssertDimension(dim1, dim2)
static ::ExceptionBase & ExcInternalError()
static ::ExceptionBase & ExcMessage(std::string arg1)
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