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;
214 static const unsigned int dimension = dim;
219 static const unsigned int space_dimension = spacedim;
282 void set_active_fe_indices (
const std::vector<unsigned int> &active_fe_indices);
289 void get_active_fe_indices (std::vector<unsigned int> &active_fe_indices)
const;
296 virtual void clear ();
315 void renumber_dofs (
const std::vector<types::global_dof_index> &new_numbers);
334 unsigned int max_couplings_between_dofs ()
const;
348 unsigned int max_couplings_between_boundary_dofs ()
const;
357 cell_iterator begin (
const unsigned int level = 0)
const;
371 active_cell_iterator begin_active(
const unsigned int level = 0)
const;
377 cell_iterator end ()
const;
383 cell_iterator end (
const unsigned int level)
const;
390 active_cell_iterator end_active (
const unsigned int level)
const;
533 template <
typename number>
542 n_boundary_dofs (
const std::set<types::boundary_id> &boundary_ids)
const;
564 const IndexSet &locally_owned_dofs()
const;
575 const std::vector<IndexSet> &
576 locally_owned_dofs_per_processor ()
const;
590 const std::vector<types::global_dof_index> &
591 n_locally_owned_dofs_per_processor ()
const;
611 const
Triangulation<dim,spacedim> &get_triangulation () const;
621 virtual
std::
size_t memory_consumption () const;
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.");
736 DoFHandler &operator = (const DoFHandler &);
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;
765 void create_active_fe_table ();
774 void pre_refinement_action ();
775 void post_refinement_action ();
782 compute_vertex_dof_identities (std::vector<types::global_dof_index> &new_dof_indices)
const;
789 compute_line_dof_identities (std::vector<types::global_dof_index> &new_dof_indices)
const;
796 compute_quad_dof_identities (std::vector<types::global_dof_index> &new_dof_indices)
const;
809 void renumber_dofs_internal (
const std::vector<types::global_dof_index> &new_numbers,
812 void renumber_dofs_internal (
const std::vector<types::global_dof_index> &new_numbers,
815 void renumber_dofs_internal (
const std::vector<types::global_dof_index> &new_numbers,
818 void renumber_dofs_internal (
const std::vector<types::global_dof_index> &new_numbers,
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 1086 return invalid_dof_index;
1089 template<
int dim,
int spacedim>
1103 DEAL_II_NAMESPACE_CLOSE
static const unsigned int invalid_unsigned_int
#define DeclException2(Exception2, type1, type2, outsequence)
void set_index(const unsigned int level, const unsigned int dof_number, const types::global_dof_index index)
const Triangulation< dim, spacedim > & get_tria() const 1
::internal::hp::DoFIndicesOnFaces< dim > * faces
const Triangulation< dim, spacedim > & get_triangulation() const
::internal::DoFHandler::NumberCache number_cache
#define AssertThrow(cond, exc)
std::vector< boost::signals2::connection > tria_listeners
const std::vector< types::global_dof_index > & n_locally_owned_dofs_per_processor() const
static::ExceptionBase & ExcFacesHaveNoLevel()
std::vector<::internal::hp::DoFLevel * > levels
ActiveSelector::active_cell_iterator active_cell_iterator
static::ExceptionBase & ExcMessage(std::string arg1)
#define DeclException1(Exception1, type1, outsequence)
unsigned int global_dof_index
#define Assert(cond, exc)
types::global_dof_index n_dofs() const
unsigned int n_locally_owned_dofs() const
#define DeclException0(Exception0)
types::global_dof_index get_index(const unsigned int level, const unsigned int dof_number) const
static::ExceptionBase & ExcRenumberingIncomplete()
ActiveSelector::cell_iterator cell_iterator
void save(Archive &ar, const unsigned int version) const
types::global_dof_index n_boundary_dofs() const
void load(Archive &ar, const unsigned int version)
std::vector< std::vector< bool > * > has_children
static::ExceptionBase & ExcInvalidBoundaryIndicator()
static::ExceptionBase & ExcNotImplemented()
unsigned char boundary_id
std::vector< types::global_dof_index > vertex_dofs_offsets
const types::global_dof_index invalid_dof_index
const IndexSet & locally_owned_dofs() const
const std::vector< IndexSet > & locally_owned_dofs_per_processor() const
std::vector< types::global_dof_index > vertex_dofs
static::ExceptionBase & ExcNoFESelected()
const FiniteElement< dim, spacedim > & get_fe() const