16 #ifndef dealii_dof_accessor_h 17 #define dealii_dof_accessor_h 20 #include <deal.II/base/config.h> 21 #include <deal.II/grid/tria_accessor.h> 22 #include <deal.II/dofs/dof_handler.h> 23 #include <deal.II/hp/dof_handler.h> 27 DEAL_II_NAMESPACE_OPEN
30 template <
typename number>
class Vector;
40 namespace DoFCellAccessorImplementation
42 struct Implementation;
45 namespace DoFHandlerImplementation
47 struct Implementation;
50 struct Implementation;
56 namespace DoFHandlerImplementation
58 struct Implementation;
71 namespace DoFAccessorImplementation
90 template <
int structdim,
int dim,
int spacedim>
97 typedef ::TriaAccessor<structdim,dim,spacedim>
BaseClass;
106 template <
int dim,
int spacedim>
200 template <
int structdim,
typename DoFHandlerType,
bool level_dof_access>
209 static const unsigned int dimension=DoFHandlerType::dimension;
222 typename ::internal::DoFAccessorImplementation::Inheritance<structdim, dimension, space_dimension>::BaseClass
275 template <
int structdim2,
int dim2,
int spacedim2>
282 template <
int dim2,
class DoFHandlerType2,
bool level_dof_access2>
288 template <
bool level_dof_access2>
309 const DoFHandlerType &
315 template <
bool level_dof_access2>
341 child (
const unsigned int c)
const;
348 typename ::internal::DoFHandlerImplementation::Iterators<DoFHandlerType, level_dof_access>::line_iterator
349 line (
const unsigned int i)
const;
356 typename ::internal::DoFHandlerImplementation::Iterators<DoFHandlerType, level_dof_access>::quad_iterator
357 quad (
const unsigned int i)
const;
404 void get_dof_indices (std::vector<types::global_dof_index> &dof_indices,
405 const unsigned int fe_index = DoFHandlerType::default_fe_index)
const;
414 std::vector<types::global_dof_index> &dof_indices,
415 const unsigned int fe_index = DoFHandlerType::default_fe_index)
const;
421 const std::vector<types::global_dof_index> &dof_indices,
422 const unsigned int fe_index = DoFHandlerType::default_fe_index);
442 (
const unsigned int vertex,
443 const unsigned int i,
444 const unsigned int fe_index = DoFHandlerType::default_fe_index)
const;
453 const unsigned int vertex,
454 const unsigned int i,
455 const unsigned int fe_index = DoFHandlerType::default_fe_index)
const;
485 (
const unsigned int i,
486 const unsigned int fe_index = DoFHandlerType::default_fe_index)
const;
544 get_fe (
const unsigned int fe_index)
const;
556 "associated with any DoFHandler object.");
610 template <
int dim2,
class DoFHandlerType2,
bool level_dof_access2>
616 template <
int dim2,
class DoFHandlerType2,
bool level_dof_access2>
643 const unsigned int fe_index = DoFHandlerType::default_fe_index)
const;
665 (
const unsigned int vertex,
666 const unsigned int i,
668 const unsigned int fe_index = DoFHandlerType::default_fe_index)
const;
670 void set_mg_vertex_dof_index
672 const unsigned int vertex,
673 const unsigned int i,
675 const unsigned int fe_index = DoFHandlerType::default_fe_index)
const;
682 template <
int,
class,
bool>
friend class DoFAccessor;
693 friend struct ::internal::DoFHandlerImplementation::Policy::Implementation;
694 friend struct ::internal::DoFHandlerImplementation::Implementation;
695 friend struct ::internal::hp::DoFHandlerImplementation::Implementation;
696 friend struct ::internal::DoFCellAccessorImplementation::Implementation;
697 friend struct ::internal::DoFAccessorImplementation::Implementation;
711 template <
template <
int,
int>
class DoFHandlerType,
int spacedim,
bool level_dof_access>
780 const DoFHandlerType<1,spacedim> *
dof_handler = 0);
794 template <
int structdim2,
int dim2,
int spacedim2>
801 template <
int dim2,
class DoFHandlerType2,
bool level_dof_access2>
822 const DoFHandlerType<1,spacedim> &
828 template <
bool level_dof_access2>
850 child (
const unsigned int c)
const;
858 typename ::internal::DoFHandlerImplementation::Iterators<DoFHandlerType<1,spacedim>, level_dof_access>::line_iterator
859 line (
const unsigned int i)
const;
867 typename ::internal::DoFHandlerImplementation::Iterators<DoFHandlerType<1,spacedim>, level_dof_access>::quad_iterator
868 quad (
const unsigned int i)
const;
912 void get_dof_indices (std::vector<types::global_dof_index> &dof_indices,
913 const unsigned int fe_index = AccessorData::default_fe_index)
const;
922 std::vector<types::global_dof_index> &dof_indices,
923 const unsigned int fe_index = AccessorData::default_fe_index)
const;
943 const unsigned int i,
944 const unsigned int fe_index = AccessorData::default_fe_index)
const;
961 const unsigned int fe_index = AccessorData::default_fe_index)
const;
1011 get_fe (
const unsigned int fe_index)
const;
1023 "associated with any DoFHandler object.");
1067 template <
int dim2,
class DoFHandlerType2,
bool level_dof_access2>
1073 template <
int dim2,
class DoFHandlerType2,
bool level_dof_access2>
1100 const unsigned int fe_index = AccessorData::default_fe_index)
const;
1120 const unsigned int i,
1122 const unsigned int fe_index = AccessorData::default_fe_index)
const;
1138 friend struct ::internal::DoFHandlerImplementation::Policy::Implementation;
1139 friend struct ::internal::DoFHandlerImplementation::Implementation;
1140 friend struct ::internal::hp::DoFHandlerImplementation::Implementation;
1141 friend struct ::internal::DoFCellAccessorImplementation::Implementation;
1170 template <
int structdim,
int dim,
int spacedim=dim>
1187 const int level = -1,
1188 const int index = -1,
1204 template <
typename OtherAccessor>
1235 template <
typename DoFHandlerType,
bool level_dof_access>
1242 static const unsigned int dim = DoFHandlerType::dimension;
1247 static const unsigned int spacedim = DoFHandlerType::space_dimension;
1301 template <
int structdim2,
int dim2,
int spacedim2>
1308 template <
int dim2,
class DoFHandlerType2,
bool level_dof_access2>
1352 neighbor (
const unsigned int i)
const;
1376 child (
const unsigned int i)
const;
1385 face (
const unsigned int i)
const;
1395 const unsigned int subface_no)
const;
1405 const unsigned int subface_no)
const;
1432 template <
class InputVector,
typename number>
1450 template <
class InputVector,
typename ForwardIterator>
1452 ForwardIterator local_values_begin,
1453 ForwardIterator local_values_end)
const;
1471 template <
class InputVector,
typename ForwardIterator>
1473 const InputVector &values,
1474 ForwardIterator local_values_begin,
1475 ForwardIterator local_values_end)
const;
1498 template <
class OutputVector,
typename number>
1500 OutputVector &values)
const;
1533 template <
class InputVector,
typename number>
1536 const unsigned int fe_index
1537 = DoFHandlerType::default_fe_index)
const;
1591 template <
class OutputVector,
typename number>
1593 OutputVector &values,
1594 const unsigned int fe_index
1595 = DoFHandlerType::default_fe_index)
const;
1605 template <
typename number,
typename OutputVector>
1608 OutputVector &global_destination)
const;
1618 template <
typename ForwardIterator,
typename OutputVector>
1621 ForwardIterator local_source_end,
1622 OutputVector &global_destination)
const;
1634 template <
typename ForwardIterator,
typename OutputVector>
1637 ForwardIterator local_source_begin,
1638 ForwardIterator local_source_end,
1639 OutputVector &global_destination)
const;
1647 template <
typename number,
typename OutputMatrix>
1650 OutputMatrix &global_destination)
const;
1656 template <
typename number,
typename OutputMatrix,
typename OutputVector>
1660 OutputMatrix &global_matrix,
1661 OutputVector &global_vector)
const;
1724 void get_dof_indices (std::vector<types::global_dof_index> &dof_indices)
const;
1821 void set_dof_indices (
const std::vector<types::global_dof_index> &dof_indices);
1840 friend struct ::internal::DoFCellAccessorImplementation::Implementation;
1844 template <
int sd,
typename DoFHandlerType,
bool level_dof_access>
1849 return level_dof_access;
1854 template <
int structdim,
int dim,
int spacedim>
1855 template <
typename OtherAccessor>
1860 ExcMessage (
"You are attempting an illegal conversion between " 1861 "iterator/accessor types. The constructor you call " 1862 "only exists to make certain template constructs " 1863 "easier to write as dimension independent code but " 1864 "the conversion is not valid in the current context."));
1869 DEAL_II_NAMESPACE_CLOSE
1872 #include "dof_accessor.templates.h" 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()
face_iterator face(const unsigned int i) const
static const unsigned int spacedim
TriaIterator< DoFCellAccessor< DoFHandlerType, level_dof_access > > parent() const
void copy_from(const DoFAccessor< structdim, DoFHandlerType, level_dof_access2 > &a)
DoFAccessor< structdim, DoFHandlerType, level_dof_access > & operator=(const DoFAccessor< structdim, DoFHandlerType, level_dof_access > &da)=delete
DoFHandlerType< 1, spacedim > * dof_handler
TriaIterator< DoFCellAccessor< DoFHandlerType, level_dof_access > > neighbor(const unsigned int i) const
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
bool operator==(const DoFAccessor< dim2, DoFHandlerType2, level_dof_access2 > &) const
TriaIterator< DoFAccessor< DoFHandlerType::dimension-1, DoFHandlerType, level_dof_access > > face_iterator
TriaAccessor< 0, 1, spacedim > BaseClass
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)
void get_mg_dof_indices(std::vector< types::global_dof_index > &dof_indices) const
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
DoFHandlerType AccessorData
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
TriaAccessorBase< structdim, dim, spacedim >::AccessorData AccessorData
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
unsigned int global_dof_index
static ::ExceptionBase & ExcMatrixDoesNotMatch()
#define Assert(cond, exc)
typename ::internal::DoFHandlerImplementation::Iterators< DoFHandlerType, level_dof_access >::line_iterator line(const unsigned int i) const
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
const Triangulation< dim, spacedim > * tria
#define DeclExceptionMsg(Exception, defaulttext)
::TriaAccessor< structdim, dim, spacedim > BaseClass
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()
DoFHandlerType< 1, spacedim > AccessorData
typename ::internal::DoFAccessorImplementation::Inheritance< structdim, dimension, space_dimension >::BaseClass BaseClass
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
InvalidAccessor< structdim, dim, spacedim >::AccessorData AccessorData
static const unsigned int dim
void distribute_local_to_global(const Vector< number > &local_source, OutputVector &global_destination) 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
DoFHandlerType AccessorData
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
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 FiniteElement< DoFHandlerType::dimension, DoFHandlerType::space_dimension > & get_fe() const
const DoFHandlerType & get_dof_handler() const
const FiniteElement< DoFHandlerType::dimension, DoFHandlerType::space_dimension > & get_fe(const unsigned int fe_index) const
typename ::internal::DoFHandlerImplementation::Iterators< DoFHandlerType, level_dof_access >::quad_iterator quad(const unsigned int i) 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()
::CellAccessor< dim, spacedim > BaseClass
TriaIterator< DoFAccessor< structdim, DoFHandlerType, level_dof_access > > child(const unsigned int c) const
DoFAccessor< DoFHandlerType::dimension, DoFHandlerType, level_dof_access > BaseClass