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_iterator_selector.h> 28 #include <deal.II/dofs/number_cache.h> 29 #include <deal.II/hp/fe_collection.h> 30 #include <deal.II/hp/dof_faces.h> 31 #include <deal.II/hp/dof_level.h> 37 DEAL_II_NAMESPACE_OPEN
47 struct Implementation;
56 struct Implementation;
61 struct Implementation;
118 template <
int dim,
int spacedim=dim>
121 typedef ::internal::DoFHandler::Iterators<DoFHandler<dim,spacedim>,
false> ActiveSelector;
122 typedef ::internal::DoFHandler::Iterators<DoFHandler<dim,spacedim>,
true> LevelSelector;
124 typedef typename ActiveSelector::CellAccessor cell_accessor;
125 typedef typename ActiveSelector::FaceAccessor face_accessor;
127 typedef typename ActiveSelector::line_iterator line_iterator;
128 typedef typename ActiveSelector::active_line_iterator active_line_iterator;
130 typedef typename ActiveSelector::quad_iterator quad_iterator;
131 typedef typename ActiveSelector::active_quad_iterator active_quad_iterator;
133 typedef typename ActiveSelector::hex_iterator hex_iterator;
134 typedef typename ActiveSelector::active_hex_iterator active_hex_iterator;
162 typedef typename LevelSelector::cell_iterator level_cell_iterator;
197 typedef typename ActiveSelector::face_iterator face_iterator;
198 typedef typename ActiveSelector::active_face_iterator active_face_iterator;
200 typedef typename LevelSelector::CellAccessor level_cell_accessor;
201 typedef typename LevelSelector::FaceAccessor level_face_accessor;
203 typedef typename LevelSelector::face_iterator level_face_iterator;
213 static const unsigned int dimension = dim;
218 static const unsigned int space_dimension = spacedim;
281 void set_active_fe_indices (
const std::vector<unsigned int> &active_fe_indices);
288 void get_active_fe_indices (std::vector<unsigned int> &active_fe_indices)
const;
295 virtual void clear ();
314 void renumber_dofs (
const std::vector<types::global_dof_index> &new_numbers);
333 unsigned int max_couplings_between_dofs ()
const;
347 unsigned int max_couplings_between_boundary_dofs ()
const;
356 cell_iterator begin (
const unsigned int level = 0)
const;
370 active_cell_iterator begin_active(
const unsigned int level = 0)
const;
376 cell_iterator end ()
const;
382 cell_iterator end (
const unsigned int level)
const;
389 active_cell_iterator end_active (
const unsigned int level)
const;
531 n_boundary_dofs (
const FunctionMap &boundary_ids)
const;
538 n_boundary_dofs (
const std::set<types::boundary_id> &boundary_ids)
const;
560 const IndexSet &locally_owned_dofs()
const;
571 const std::vector<IndexSet> &
572 locally_owned_dofs_per_processor ()
const;
586 const std::vector<types::global_dof_index> &
587 n_locally_owned_dofs_per_processor ()
const;
607 const
Triangulation<dim,spacedim> &get_triangulation () const;
617 virtual
std::
size_t memory_consumption () const;
623 template <class Archive>
624 void save(Archive &ar, const
unsigned int version) const;
630 template <class Archive>
631 void load(Archive &ar, const
unsigned int version);
633 BOOST_SERIALIZATION_SPLIT_MEMBER()
638 DeclException0 (ExcInvalidTriangulation);
642 DeclException0 (ExcNoFESelected);
646 DeclException0 (ExcRenumberingIncomplete);
650 DeclException0 (ExcGridsDoNotMatch);
654 DeclException0 (ExcInvalidBoundaryIndicator);
660 << "The matrix has the wrong dimension " << arg1);
664 DeclException0 (ExcFunctionNotUseful);
669 types::global_dof_index,
670 << "The given list of new dof indices is not consecutive: "
671 << "the index " << arg1 << " does not exist.");
677 << "The mesh contains a cell with an active_fe_index of "
678 << arg1 << ", but the finite element collection only has "
679 << arg2 << " elements");
685 << "The given level " << arg1
686 << " is not in the valid range!");
690 DeclException0 (ExcFacesHaveNoLevel);
696 << "You tried to do something on level " << arg1
697 << ", but this level is empty.");
732 DoFHandler &operator = (const DoFHandler &);
748 template<
int structdim>
749 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;
751 template<
int structdim>
752 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;
761 void create_active_fe_table ();
770 void pre_refinement_action ();
771 void post_refinement_action ();
778 compute_vertex_dof_identities (std::vector<types::global_dof_index> &new_dof_indices)
const;
785 compute_line_dof_identities (std::vector<types::global_dof_index> &new_dof_indices)
const;
792 compute_quad_dof_identities (std::vector<types::global_dof_index> &new_dof_indices)
const;
805 void renumber_dofs_internal (
const std::vector<types::global_dof_index> &new_numbers,
808 void renumber_dofs_internal (
const std::vector<types::global_dof_index> &new_numbers,
811 void renumber_dofs_internal (
const std::vector<types::global_dof_index> &new_numbers,
814 void renumber_dofs_internal (
const std::vector<types::global_dof_index> &new_numbers,
821 std::vector<::internal::hp::DoFLevel *>
levels;
866 std::vector<MGVertexDoFs> mg_vertex_dofs;
885 template <
int,
class,
bool>
friend class ::DoFAccessor;
886 template <
class,
bool>
friend class ::DoFCellAccessor;
887 friend struct ::internal::DoFAccessor::Implementation;
888 friend struct ::internal::DoFCellAccessor::Implementation;
894 template <
int>
friend class ::internal::hp::DoFIndicesOnFacesOrEdges;
895 friend struct ::internal::hp::DoFHandler::Implementation;
905 template <
int dim,
int spacedim>
906 template <
class Archive>
910 ar &vertex_dofs_offsets;
918 unsigned int n_cells = tria->n_cells();
923 template <
int dim,
int spacedim>
924 template <
class Archive>
928 ar &vertex_dofs_offsets;
935 for (
unsigned int i = 0; i<levels.size(); ++i)
937 for (
unsigned int i = 0; i<has_children.size(); ++i)
938 delete has_children[i];
940 has_children.resize(0);
950 unsigned int n_cells;
955 ExcMessage(
"The object being loaded into does not match the triangulation " 956 "that has been stored previously."));
959 template <
int dim,
int spacedim>
964 return number_cache.n_global_dofs;
968 template <
int dim,
int spacedim>
977 template <
int dim,
int spacedim>
981 return number_cache.n_locally_owned_dofs;
985 template <
int dim,
int spacedim>
989 return number_cache.locally_owned_dofs;
993 template <
int dim,
int spacedim>
994 const std::vector<types::global_dof_index> &
997 return number_cache.n_locally_owned_dofs_per_processor;
1001 template <
int dim,
int spacedim>
1002 const std::vector<IndexSet> &
1005 return number_cache.locally_owned_dofs_per_processor;
1010 template<
int dim,
int spacedim>
1015 Assert (finite_elements != 0,
1016 ExcMessage (
"No finite element collection is associated with " 1017 "this DoFHandler"));
1018 return *finite_elements;
1023 template<
int dim,
int spacedim>
1033 template<
int dim,
int spacedim>
1043 template<
int dim,
int spacedim>
1047 Assert (
false, ExcNotImplemented ());
1050 template<
int dim,
int spacedim>
1054 Assert (
false, ExcNotImplemented ());
1057 template<
int dim,
int spacedim>
1060 const unsigned int)
const 1062 Assert (
false, ExcNotImplemented ());
1063 return invalid_dof_index;
1066 template<
int dim,
int spacedim>
1072 Assert (
false, ExcNotImplemented ());
1080 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)
::ExceptionBase & ExcMessage(std::string arg1)
::internal::hp::DoFIndicesOnFaces< dim > * faces
::internal::DoFHandler::NumberCache number_cache
#define AssertThrow(cond, exc)
std::vector< boost::signals2::connection > tria_listeners
const FiniteElement< dim, spacedim > & get_fe() const
std::vector<::internal::hp::DoFLevel * > levels
ActiveSelector::active_cell_iterator active_cell_iterator
BlockDynamicSparsityPattern BlockCompressedSparsityPattern DEAL_II_DEPRECATED
unsigned int n_locally_owned_dofs() const
const std::vector< types::global_dof_index > & n_locally_owned_dofs_per_processor() const
#define DeclException1(Exception1, type1, outsequence)
unsigned int global_dof_index
#define Assert(cond, exc)
types::global_dof_index get_index(const unsigned int level, const unsigned int dof_number) const
types::global_dof_index n_dofs() const
std::map< types::boundary_id, const Function< dim, Number > * > type
ActiveSelector::cell_iterator cell_iterator
const Triangulation< dim, spacedim > & get_tria() const DEAL_II_DEPRECATED
const std::vector< IndexSet > & locally_owned_dofs_per_processor() const
void load(Archive &ar, const unsigned int version)
FunctionMap< spacedim >::type FunctionMap
std::vector< std::vector< bool > * > has_children
const Triangulation< dim, spacedim > & get_triangulation() const
std::vector< types::global_dof_index > vertex_dofs_offsets
const types::global_dof_index invalid_dof_index
std::vector< types::global_dof_index > vertex_dofs
const IndexSet & locally_owned_dofs() const
void save(Archive &ar, const unsigned int version) const