16 #ifndef dealii_dof_accessor_h 17 #define dealii_dof_accessor_h 20 #include <deal.II/base/config.h> 22 #include <deal.II/dofs/dof_handler.h> 24 #include <deal.II/grid/tria_accessor.h> 26 #include <deal.II/hp/dof_handler.h> 30 DEAL_II_NAMESPACE_OPEN
32 template <
typename number>
34 template <
typename number>
36 template <
typename number>
39 template <
typename Accessor>
48 namespace DoFCellAccessorImplementation
50 struct Implementation;
53 namespace DoFHandlerImplementation
55 struct Implementation;
58 struct Implementation;
64 namespace DoFHandlerImplementation
66 struct Implementation;
79 namespace DoFAccessorImplementation
98 template <
int structdim,
int dim,
int spacedim>
114 template <
int dim,
int spacedim>
208 template <
int structdim,
typename DoFHandlerType,
bool level_dof_access>
212 DoFHandlerType::dimension,
220 static const unsigned int dimension = DoFHandlerType::dimension;
232 using BaseClass = typename ::internal::DoFAccessorImplementation::
233 Inheritance<structdim, dimension, space_dimension>::BaseClass;
269 DoFHandlerType::space_dimension> *
tria,
286 template <
int structdim2,
int dim2,
int spacedim2>
293 template <
int dim2,
class DoFHandlerType2,
bool level_dof_access2>
299 template <
bool level_dof_access2>
323 const DoFHandlerType &
329 template <
bool level_dof_access2>
339 DoFHandlerType::dimension,
340 DoFHandlerType::space_dimension> &da);
360 child(
const unsigned int c)
const;
367 typename ::internal::DoFHandlerImplementation::
368 Iterators<DoFHandlerType, level_dof_access>::line_iterator
369 line(
const unsigned int i)
const;
376 typename ::internal::DoFHandlerImplementation::
377 Iterators<DoFHandlerType, level_dof_access>::quad_iterator
378 quad(
const unsigned int i)
const;
427 std::vector<types::global_dof_index> &dof_indices,
428 const unsigned int fe_index = DoFHandlerType::default_fe_index)
const;
439 std::vector<types::global_dof_index> &dof_indices,
440 const unsigned int fe_index = DoFHandlerType::default_fe_index)
const;
448 const std::vector<types::global_dof_index> &dof_indices,
449 const unsigned int fe_index = DoFHandlerType::default_fe_index);
470 const unsigned int vertex,
471 const unsigned int i,
472 const unsigned int fe_index = DoFHandlerType::default_fe_index)
const;
482 const unsigned int vertex,
483 const unsigned int i,
484 const unsigned int fe_index = DoFHandlerType::default_fe_index)
const;
515 const unsigned int i,
516 const unsigned int fe_index = DoFHandlerType::default_fe_index)
const;
564 std::set<unsigned int>
584 DoFHandlerType::space_dimension> &
585 get_fe(
const unsigned int fe_index)
const;
597 "This accessor object has not been " 598 "associated with any DoFHandler object.");
652 template <
int dim2,
class DoFHandlerType2,
bool level_dof_access2>
660 template <
int dim2,
class DoFHandlerType2,
bool level_dof_access2>
691 const unsigned int i,
693 const unsigned int fe_index = DoFHandlerType::default_fe_index)
const;
696 set_mg_dof_index(
const int level,
697 const unsigned int i,
719 const unsigned int vertex,
720 const unsigned int i,
722 const unsigned int fe_index = DoFHandlerType::default_fe_index)
const;
725 set_mg_vertex_dof_index(
727 const unsigned int vertex,
728 const unsigned int i,
730 const unsigned int fe_index = DoFHandlerType::default_fe_index)
const;
738 template <
int,
class,
bool>
746 template <
int dim,
int spacedim>
748 template <
int dim,
int spacedim>
751 friend struct ::internal::DoFHandlerImplementation::Policy::
753 friend struct ::internal::DoFHandlerImplementation::Implementation;
754 friend struct ::internal::hp::DoFHandlerImplementation::Implementation;
755 friend struct ::internal::DoFCellAccessorImplementation::Implementation;
756 friend struct ::internal::DoFAccessorImplementation::Implementation;
770 template <
template <
int,
int>
class DoFHandlerType,
772 bool level_dof_access>
773 class DoFAccessor<0, DoFHandlerType<1, spacedim>, level_dof_access>
842 const DoFHandlerType<1, spacedim> *
dof_handler = 0);
856 template <
int structdim2,
int dim2,
int spacedim2>
863 template <
int dim2,
class DoFHandlerType2,
bool level_dof_access2>
886 const DoFHandlerType<1, spacedim> &
892 template <
bool level_dof_access2>
895 const DoFAccessor<0, DoFHandlerType<1, spacedim>, level_dof_access2> &a);
917 child(
const unsigned int c)
const;
925 typename ::internal::DoFHandlerImplementation::
926 Iterators<DoFHandlerType<1, spacedim>, level_dof_access>::line_iterator
927 line(
const unsigned int i)
const;
935 typename ::internal::DoFHandlerImplementation::
936 Iterators<DoFHandlerType<1, spacedim>, level_dof_access>::quad_iterator
937 quad(
const unsigned int i)
const;
983 std::vector<types::global_dof_index> &dof_indices,
984 const unsigned int fe_index = AccessorData::default_fe_index)
const;
995 std::vector<types::global_dof_index> &dof_indices,
996 const unsigned int fe_index = AccessorData::default_fe_index)
const;
1017 const unsigned int vertex,
1018 const unsigned int i,
1019 const unsigned int fe_index = AccessorData::default_fe_index)
const;
1037 const unsigned int fe_index = AccessorData::default_fe_index)
const;
1087 DoFHandlerType<1, spacedim>::space_dimension> &
1088 get_fe(
const unsigned int fe_index)
const;
1100 "This accessor object has not been " 1101 "associated with any DoFHandler object.");
1144 template <
int dim2,
class DoFHandlerType2,
bool level_dof_access2>
1152 template <
int dim2,
class DoFHandlerType2,
bool level_dof_access2>
1181 const unsigned int i,
1183 const unsigned int fe_index = AccessorData::default_fe_index)
const;
1204 const unsigned int vertex,
1205 const unsigned int i,
1207 const unsigned int fe_index = AccessorData::default_fe_index)
const;
1226 friend struct ::internal::DoFHandlerImplementation::Policy::
1228 friend struct ::internal::DoFHandlerImplementation::Implementation;
1229 friend struct ::internal::hp::DoFHandlerImplementation::Implementation;
1230 friend struct ::internal::DoFCellAccessorImplementation::Implementation;
1259 template <
int structdim,
int dim,
int spacedim = dim>
1277 const int level = -1,
1278 const int index = -1,
1294 template <
typename OtherAccessor>
1305 const unsigned int fe_index =
1326 template <
typename DoFHandlerType,
bool level_dof_access>
1335 static const unsigned int dim = DoFHandlerType::dimension;
1340 static const unsigned int spacedim = DoFHandlerType::space_dimension;
1379 DoFHandlerType::space_dimension> *
tria,
1396 template <
int structdim2,
int dim2,
int spacedim2>
1403 template <
int dim2,
class DoFHandlerType2,
bool level_dof_access2>
1449 neighbor(
const unsigned int i)
const;
1473 child(
const unsigned int i)
const;
1482 face(
const unsigned int i)
const;
1492 const unsigned int subface_no)
const;
1502 const unsigned int subface_no)
const;
1529 template <
class InputVector,
typename number>
1547 template <
class InputVector,
typename ForwardIterator>
1550 ForwardIterator local_values_begin,
1551 ForwardIterator local_values_end)
const;
1570 template <
class InputVector,
typename ForwardIterator>
1574 const InputVector & values,
1575 ForwardIterator local_values_begin,
1576 ForwardIterator local_values_end)
const;
1599 template <
class OutputVector,
typename number>
1602 OutputVector & values)
const;
1635 template <
class InputVector,
typename number>
1638 const InputVector &values,
1640 const unsigned int fe_index = DoFHandlerType::default_fe_index)
const;
1694 template <
class OutputVector,
typename number>
1698 OutputVector & values,
1699 const unsigned int fe_index = DoFHandlerType::default_fe_index)
const;
1709 template <
typename number,
typename OutputVector>
1712 OutputVector & global_destination)
const;
1722 template <
typename ForwardIterator,
typename OutputVector>
1725 ForwardIterator local_source_end,
1726 OutputVector & global_destination)
const;
1738 template <
typename ForwardIterator,
typename OutputVector>
1742 ForwardIterator local_source_begin,
1743 ForwardIterator local_source_end,
1744 OutputVector & global_destination)
const;
1752 template <
typename number,
typename OutputMatrix>
1755 OutputMatrix &global_destination)
const;
1761 template <
typename number,
typename OutputMatrix,
typename OutputVector>
1765 OutputMatrix & global_matrix,
1766 OutputVector & global_vector)
const;
1794 std::vector<types::global_dof_index> &dof_indices)
const;
1832 get_dof_indices(std::vector<types::global_dof_index> &dof_indices)
const;
1866 DoFHandlerType::space_dimension> &
1934 set_dof_indices(
const std::vector<types::global_dof_index> &dof_indices);
2015 template <
int dim,
int spacedim>
2017 friend struct ::internal::DoFCellAccessorImplementation::Implementation;
2021 template <
int sd,
typename DoFHandlerType,
bool level_dof_access>
2025 return level_dof_access;
2030 template <
int structdim,
int dim,
int spacedim>
2031 template <
typename OtherAccessor>
2033 const OtherAccessor &)
2036 ExcMessage(
"You are attempting an illegal conversion between " 2037 "iterator/accessor types. The constructor you call " 2038 "only exists to make certain template constructs " 2039 "easier to write as dimension independent code but " 2040 "the conversion is not valid in the current context."));
2045 DEAL_II_NAMESPACE_CLOSE
2048 #include "dof_accessor.templates.h" DoFHandlerType< 1, spacedim > AccessorData
DoFHandlerType * dof_handler
DoFCellAccessor< DoFHandlerType, level_dof_access > & operator=(const DoFCellAccessor< DoFHandlerType, level_dof_access > &da)=delete
void get_dof_indices(std::vector< types::global_dof_index > &dof_indices) const
void set_dof_index(const unsigned int i, const types::global_dof_index index, const unsigned int fe_index=DoFHandler< dim, spacedim >::default_fe_index) const
static bool is_level_cell()
typename ::internal::DoFHandlerImplementation::Iterators< DoFHandlerType, level_dof_access >::quad_iterator quad(const unsigned int i) const
face_iterator face(const unsigned int i) const
static const unsigned int spacedim
const FiniteElement< DoFHandlerType::dimension, DoFHandlerType::space_dimension > & get_fe(const unsigned int fe_index) const
TriaIterator< DoFCellAccessor< DoFHandlerType, level_dof_access > > parent() const
void copy_from(const DoFAccessor< structdim, DoFHandlerType, level_dof_access2 > &a)
TriaIterator< DoFCellAccessor< DoFHandlerType, level_dof_access > > neighbor(const unsigned int i) const
DoFHandlerType< 1, spacedim > * dof_handler
TriaIterator< DoFCellAccessor< DoFHandlerType, level_dof_access > > periodic_neighbor(const unsigned int i) const
void set_dof_values_by_interpolation(const Vector< number > &local_values, OutputVector &values, const unsigned int fe_index=DoFHandlerType::default_fe_index) const
typename ::internal::DoFAccessorImplementation::Inheritance< structdim, dimension, space_dimension >::BaseClass BaseClass
bool operator==(const DoFAccessor< dim2, DoFHandlerType2, level_dof_access2 > &) const
typename InvalidAccessor< structdim, dim, spacedim >::AccessorData AccessorData
void set_mg_dof_indices(const int level, const std::vector< types::global_dof_index > &dof_indices, const unsigned int fe_index=DoFHandlerType::default_fe_index)
void set_dof_handler(DoFHandlerType *dh)
TriaIterator< DoFAccessor< structdim, DoFHandlerType, level_dof_access > > child(const unsigned int c) const
void get_mg_dof_indices(std::vector< types::global_dof_index > &dof_indices) const
typename TriaAccessorBase< structdim, dim, spacedim >::AccessorData AccessorData
LinearAlgebra::distributed::Vector< Number > Vector
void get_interpolated_dof_values(const InputVector &values, Vector< number > &interpolated_values, const unsigned int fe_index=DoFHandlerType::default_fe_index) const
unsigned int vertex_index(const unsigned int i) const
types::global_dof_index dof_index(const unsigned int i, const unsigned int fe_index=DoFHandlerType::default_fe_index) const
const FiniteElement< DoFHandlerType::dimension, DoFHandlerType::space_dimension > & get_fe() const
void update_cell_dof_indices_cache() const
void get_dof_indices(std::vector< types::global_dof_index > &dof_indices, const unsigned int fe_index=DoFHandlerType::default_fe_index) const
unsigned int active_fe_index() const
static ::ExceptionBase & ExcMessage(std::string arg1)
void get_mg_dof_indices(const int level, std::vector< types::global_dof_index > &dof_indices, const unsigned int fe_index=DoFHandlerType::default_fe_index) const
static ::ExceptionBase & ExcCantCompareIterators()
TriaIterator< DoFCellAccessor< DoFHandlerType, level_dof_access > > child(const unsigned int i) const
const Triangulation< dim, spacedim > * tria
static ::ExceptionBase & ExcMatrixDoesNotMatch()
#define Assert(cond, exc)
Point< spacedim > & vertex(const unsigned int i) const
void set_mg_dof_indices(const std::vector< types::global_dof_index > &dof_indices)
static const unsigned int dimension
unsigned int future_fe_index() const
#define DeclExceptionMsg(Exception, defaulttext)
TriaIterator< DoFCellAccessor< DoFHandlerType, level_dof_access > > neighbor_child_on_subface(const unsigned int face_no, const unsigned int subface_no) const
#define DeclException0(Exception0)
void set_dof_indices(const std::vector< types::global_dof_index > &dof_indices)
void set_active_fe_index(const unsigned int i) const
TriaIterator< DoFCellAccessor< DoFHandlerType, level_dof_access > > neighbor_or_periodic_neighbor(const unsigned int i) const
static ::ExceptionBase & ExcVectorNotEmpty()
bool future_fe_index_set() const
void get_dof_values(const InputVector &values, Vector< number > &local_values) const
types::global_dof_index mg_vertex_dof_index(const int level, const unsigned int vertex, const unsigned int i, const unsigned int fe_index=DoFHandlerType::default_fe_index) const
bool operator!=(const DoFAccessor< dim2, DoFHandlerType2, level_dof_access2 > &) const
void set_dof_values(const Vector< number > &local_values, OutputVector &values) const
unsigned int n_active_fe_indices() const
unsigned int global_dof_index
static const unsigned int dim
void distribute_local_to_global(const Vector< number > &local_source, OutputVector &global_destination) const
std::set< unsigned int > get_active_fe_indices() const
void set_dof_index(const unsigned int i, const types::global_dof_index index, const unsigned int fe_index=DoFHandlerType::default_fe_index) const
DoFAccessor< structdim, DoFHandlerType, level_dof_access > & operator=(const DoFAccessor< structdim, DoFHandlerType, level_dof_access > &da)=delete
static ::ExceptionBase & ExcNotActive()
types::global_dof_index vertex_dof_index(const unsigned int vertex, const unsigned int i, const unsigned int fe_index=DoFHandlerType::default_fe_index) const
DoFInvalidAccessor(const Triangulation< dim, spacedim > *parent=0, const int level=-1, const int index=-1, const AccessorData *local_data=0)
static ::ExceptionBase & ExcInvalidObject()
DoFCellAccessor(const Triangulation< DoFHandlerType::dimension, DoFHandlerType::space_dimension > *tria, const int level, const int index, const AccessorData *local_data)
static const unsigned int space_dimension
unsigned int nth_active_fe_index(const unsigned int n) const
void get_active_or_mg_dof_indices(std::vector< types::global_dof_index > &dof_indices) const
DoFHandlerType AccessorData
typename ::internal::DoFHandlerImplementation::Iterators< DoFHandlerType, level_dof_access >::line_iterator line(const unsigned int i) const
void set_vertex_dof_index(const unsigned int vertex, const unsigned int i, const types::global_dof_index index, const unsigned int fe_index=DoFHandlerType::default_fe_index) const
TriaIterator< DoFCellAccessor< DoFHandlerType, level_dof_access > > periodic_neighbor_child_on_subface(const unsigned int face_no, const unsigned int subface_no) const
const DoFHandlerType & get_dof_handler() const
void clear_future_fe_index() const
types::global_dof_index mg_dof_index(const int level, const unsigned int i) const
bool fe_index_is_active(const unsigned int fe_index) const
static ::ExceptionBase & ExcVectorDoesNotMatch()
void set_future_fe_index(const unsigned int i) const