16 #ifndef dealii__hp_dof_handler_h 17 #define dealii__hp_dof_handler_h 21 #include <deal.II/base/config.h> 22 #include <deal.II/base/exceptions.h> 23 #include <deal.II/base/template_constraints.h> 24 #include <deal.II/base/smartpointer.h> 25 #include <deal.II/base/iterator_range.h> 26 #include <deal.II/dofs/function_map.h> 27 #include <deal.II/dofs/dof_accessor.h> 28 #include <deal.II/dofs/dof_iterator_selector.h> 29 #include <deal.II/dofs/number_cache.h> 30 #include <deal.II/hp/fe_collection.h> 31 #include <deal.II/hp/dof_faces.h> 32 #include <deal.II/hp/dof_level.h> 38 DEAL_II_NAMESPACE_OPEN
50 struct Implementation;
59 struct Implementation;
64 struct Implementation;
124 template <
int dim,
int spacedim=dim>
127 typedef ::internal::DoFHandler::Iterators<DoFHandler<dim,spacedim>,
false> ActiveSelector;
128 typedef ::internal::DoFHandler::Iterators<DoFHandler<dim,spacedim>,
true> LevelSelector;
130 typedef typename ActiveSelector::CellAccessor cell_accessor;
131 typedef typename ActiveSelector::FaceAccessor face_accessor;
133 typedef typename ActiveSelector::line_iterator line_iterator;
134 typedef typename ActiveSelector::active_line_iterator active_line_iterator;
136 typedef typename ActiveSelector::quad_iterator quad_iterator;
137 typedef typename ActiveSelector::active_quad_iterator active_quad_iterator;
139 typedef typename ActiveSelector::hex_iterator hex_iterator;
140 typedef typename ActiveSelector::active_hex_iterator active_hex_iterator;
168 typedef typename LevelSelector::cell_iterator level_cell_iterator;
203 typedef typename ActiveSelector::face_iterator face_iterator;
204 typedef typename ActiveSelector::active_face_iterator active_face_iterator;
206 typedef typename LevelSelector::CellAccessor level_cell_accessor;
207 typedef typename LevelSelector::FaceAccessor level_face_accessor;
209 typedef typename LevelSelector::face_iterator level_face_iterator;
296 virtual void clear ();
315 void renumber_dofs (
const std::vector<types::global_dof_index> &new_numbers);
533 template <
typename number>
542 n_boundary_dofs (
const std::set<types::boundary_id> &boundary_ids)
const;
575 const std::vector<IndexSet> &
590 const std::vector<types::global_dof_index> &
627 template <class Archive>
628 void save(Archive &ar, const
unsigned int version) const;
634 template <class Archive>
635 void load(Archive &ar, const
unsigned int version);
637 BOOST_SERIALIZATION_SPLIT_MEMBER()
664 << "The matrix has the wrong
dimension " << arg1);
673 types::global_dof_index,
674 << "The given list of new dof indices is not consecutive: "
675 << "the index " << arg1 << " does not exist.");
681 << "The mesh contains a cell with an active_fe_index of "
682 << arg1 << ", but the finite element collection only has "
683 << arg2 << " elements");
689 << "The given level " << arg1
690 << " is not in the valid range!");
700 << "You tried to do something on level " << arg1
701 << ", but this level is empty.");
752 template<
int structdim>
753 types::global_dof_index get_dof_index (
const unsigned int obj_level,
const unsigned int obj_index,
const unsigned int fe_index,
const unsigned int local_index)
const;
755 template<
int structdim>
756 void set_dof_index (
const unsigned int obj_level,
const unsigned int obj_index,
const unsigned int fe_index,
const unsigned int local_index,
const types::global_dof_index global_index)
const;
775 void post_refinement_action ();
825 std::vector<::internal::hp::DoFLevel *>
levels;
870 std::vector<MGVertexDoFs> mg_vertex_dofs;
889 template <
int,
class,
bool>
friend class ::DoFAccessor;
890 template <
class,
bool>
friend class ::DoFCellAccessor;
891 friend struct ::internal::DoFAccessor::Implementation;
892 friend struct ::internal::DoFCellAccessor::Implementation;
898 template <
int>
friend class ::internal::hp::DoFIndicesOnFacesOrEdges;
899 friend struct ::internal::hp::DoFHandler::Implementation;
910 template <
int dim,
int spacedim>
911 template <
typename number>
916 std::set<types::boundary_id> boundary_ids_only;
918 p = boundary_ids.begin();
919 p != boundary_ids.end(); ++p)
920 boundary_ids_only.insert (p->first);
923 return n_boundary_dofs(boundary_ids_only);
928 template <
int dim,
int spacedim>
929 template <
class Archive>
933 ar &vertex_dofs_offsets;
941 unsigned int n_cells = tria->n_cells();
946 template <
int dim,
int spacedim>
947 template <
class Archive>
951 ar &vertex_dofs_offsets;
958 for (
unsigned int i = 0; i<levels.size(); ++i)
960 for (
unsigned int i = 0; i<has_children.size(); ++i)
961 delete has_children[i];
963 has_children.resize(0);
973 unsigned int n_cells;
978 ExcMessage(
"The object being loaded into does not match the triangulation " 979 "that has been stored previously."));
982 template <
int dim,
int spacedim>
987 return number_cache.n_global_dofs;
991 template <
int dim,
int spacedim>
1000 template <
int dim,
int spacedim>
1004 return number_cache.n_locally_owned_dofs;
1008 template <
int dim,
int spacedim>
1012 return number_cache.locally_owned_dofs;
1016 template <
int dim,
int spacedim>
1017 const std::vector<types::global_dof_index> &
1020 return number_cache.n_locally_owned_dofs_per_processor;
1024 template <
int dim,
int spacedim>
1025 const std::vector<IndexSet> &
1028 return number_cache.locally_owned_dofs_per_processor;
1033 template<
int dim,
int spacedim>
1038 Assert (finite_elements != 0,
1039 ExcMessage (
"No finite element collection is associated with " 1040 "this DoFHandler"));
1041 return *finite_elements;
1046 template<
int dim,
int spacedim>
1056 template<
int dim,
int spacedim>
1066 template<
int dim,
int spacedim>
1073 template<
int dim,
int spacedim>
1080 template<
int dim,
int spacedim>
1083 const unsigned int)
const 1089 template<
int dim,
int spacedim>
1103 DEAL_II_NAMESPACE_CLOSE
cell_iterator begin(const unsigned int level=0) const
IteratorRange< active_cell_iterator > active_cell_iterators_on_level(const unsigned int level) const
void get_active_fe_indices(std::vector< unsigned int > &active_fe_indices) const
types::global_dof_index n_locally_owned_dofs() const
virtual void distribute_dofs(const hp::FECollection< dim, spacedim > &fe)
static const unsigned int invalid_unsigned_int
#define DeclException2(Exception2, type1, type2, outsequence)
static ::ExceptionBase & ExcInvalidFEIndex(int arg1, int arg2)
DoFHandler(const Triangulation< dim, spacedim > &tria)
SmartPointer< const hp::FECollection< dim, spacedim >, hp::DoFHandler< dim, spacedim > > finite_elements
void renumber_dofs(const std::vector< types::global_dof_index > &new_numbers)
virtual std::size_t memory_consumption() const
void set_active_fe_indices(const std::vector< unsigned int > &active_fe_indices)
static ::ExceptionBase & ExcRenumberingIncomplete()
void set_index(const unsigned int level, const unsigned int dof_number, const types::global_dof_index index)
static ::ExceptionBase & ExcGridsDoNotMatch()
void compute_line_dof_identities(std::vector< types::global_dof_index > &new_dof_indices) const
::internal::hp::DoFIndicesOnFaces< dim > * faces
const std::vector< types::global_dof_index > & n_locally_owned_dofs_per_processor() const
void pre_refinement_action()
active_cell_iterator begin_active(const unsigned int level=0) const
static ::ExceptionBase & ExcFunctionNotUseful()
::internal::DoFHandler::NumberCache number_cache
static ::ExceptionBase & ExcNewNumbersNotConsecutive(types::global_dof_index arg1)
#define AssertThrow(cond, exc)
std::vector< boost::signals2::connection > tria_listeners
static const unsigned int dimension
std::vector<::internal::hp::DoFLevel * > levels
ActiveSelector::active_cell_iterator active_cell_iterator
static const unsigned int default_fe_index
const hp::FECollection< dim, spacedim > & get_fe() const
static ::ExceptionBase & ExcNoFESelected()
static ::ExceptionBase & ExcMessage(std::string arg1)
static const unsigned int space_dimension
#define DeclException1(Exception1, type1, outsequence)
unsigned int global_dof_index
#define Assert(cond, exc)
static ::ExceptionBase & ExcFacesHaveNoLevel()
IteratorRange< active_cell_iterator > active_cell_iterators() const
const Triangulation< dim, spacedim > & get_tria() const 1
types::global_dof_index get_index(const unsigned int level, const unsigned int dof_number) const
const IndexSet & locally_owned_dofs() const
void save(Archive &ar, const unsigned int version) const
const std::vector< IndexSet > & locally_owned_dofs_per_processor() const
#define DeclException0(Exception0)
unsigned int max_couplings_between_boundary_dofs() const
ActiveSelector::cell_iterator cell_iterator
static ::ExceptionBase & ExcInvalidLevel(int arg1)
void renumber_dofs_internal(const std::vector< types::global_dof_index > &new_numbers, ::internal::int2type< 0 >)
static ::ExceptionBase & ExcInvalidBoundaryIndicator()
types::global_dof_index n_boundary_dofs() const
void compute_quad_dof_identities(std::vector< types::global_dof_index > &new_dof_indices) const
active_cell_iterator end_active(const unsigned int level) const
SmartPointer< const Triangulation< dim, spacedim >, DoFHandler< dim, spacedim > > tria
void compute_vertex_dof_identities(std::vector< types::global_dof_index > &new_dof_indices) const
const Triangulation< dim, spacedim > & get_triangulation() const
unsigned int max_couplings_between_dofs() const
void load(Archive &ar, const unsigned int version)
static ::ExceptionBase & ExcMatrixHasWrongSize(int arg1)
std::vector< std::vector< bool > * > has_children
types::global_dof_index n_dofs() const
IteratorRange< cell_iterator > cell_iterators_on_level(const unsigned int level) const
static ::ExceptionBase & ExcNotImplemented()
unsigned char boundary_id
std::vector< types::global_dof_index > vertex_dofs_offsets
const types::global_dof_index invalid_dof_index
void create_active_fe_table()
std::vector< types::global_dof_index > vertex_dofs
cell_iterator end() const
IteratorRange< cell_iterator > cell_iterators() const
static ::ExceptionBase & ExcEmptyLevel(int arg1)
static ::ExceptionBase & ExcInvalidTriangulation()
static const types::global_dof_index invalid_dof_index