31 template <
int dim,
int spacedim>
34 set_default_hierarchy();
39 template <
int dim,
int spacedim>
49 template <
int dim,
int spacedim>
55 ExcMessage(
"Need to pass at least one finite element."));
57 for (
unsigned int i = 0; i <
fes.
size(); ++i)
63 template <
int dim,
int spacedim>
71 Assert(this->size() == 0 ||
72 new_fe.n_components() ==
this->operator[](0).n_components(),
73 ExcMessage(
"All elements inside a collection need to have the "
74 "same number of vector components!"));
81 template <
int dim,
int spacedim>
85 Assert(this->size() > 0, ExcNoFiniteElements());
96 if (!reference_cell_default_linear_mapping ||
97 reference_cell_default_linear_mapping->size() !=
this->
size())
101 this_nc.reference_cell_default_linear_mapping =
102 std::make_shared<MappingCollection<dim, spacedim>>();
104 for (
const auto &fe : *
this)
105 this_nc.reference_cell_default_linear_mapping->push_back(
110 return *reference_cell_default_linear_mapping;
115 template <
int dim,
int spacedim>
116 std::set<unsigned int>
118 const std::set<unsigned int> &
fes,
119 const unsigned int codim)
const
125 for (
const auto &fe :
fes)
155 template <
int dim,
int spacedim>
156 std::set<unsigned int>
158 const std::set<unsigned int> &
fes,
159 const unsigned int codim)
const
165 for (
const auto &fe :
fes)
195 template <
int dim,
int spacedim>
198 const std::set<unsigned int> &
fes,
199 const unsigned int codim)
const
210 for (
const auto &fe :
fes)
242 template <
int dim,
int spacedim>
245 const std::set<unsigned int> &
fes,
246 const unsigned int codim)
const
257 for (
const auto &fe :
fes)
289 template <
int dim,
int spacedim>
292 const std::set<unsigned int> &
fes,
293 const unsigned int codim)
const
295 unsigned int fe_index = find_dominating_fe(
fes,
codim);
309 template <
int dim,
int spacedim>
312 const std::set<unsigned int> &
fes,
313 const unsigned int codim)
const
315 unsigned int fe_index = find_dominated_fe(
fes,
codim);
335 std::vector<std::map<unsigned int, unsigned int>>
337 const std::set<unsigned int> &
fes,
338 const std::function<std::vector<std::pair<unsigned int, unsigned int>>(
381 using Node = std::pair<unsigned int, unsigned int>;
382 using Edge = std::pair<Node, Node>;
383 using Graph = std::set<Edge>;
454 std::vector<std::map<unsigned int, unsigned int>>
identities;
526 template <
int dim,
int spacedim>
527 std::vector<std::map<unsigned int, unsigned int>>
529 const std::set<unsigned int> &
fes)
const
540 template <
int dim,
int spacedim>
541 std::vector<std::map<unsigned int, unsigned int>>
543 const std::set<unsigned int> &
fes)
const
554 template <
int dim,
int spacedim>
555 std::vector<std::map<unsigned int, unsigned int>>
557 const std::set<unsigned int> &
fes,
558 const unsigned int face_no)
const
571 template <
int dim,
int spacedim>
576 const unsigned int)> &next,
579 const unsigned int)> &prev)
582 hierarchy_next = next;
583 hierarchy_prev = prev;
588 template <
int dim,
int spacedim>
593 set_hierarchy(&DefaultHierarchy::next_index,
594 &DefaultHierarchy::previous_index);
599 template <
int dim,
int spacedim>
600 std::vector<unsigned int>
602 const unsigned int fe_index)
const
606 std::deque<unsigned int> sequence = {fe_index};
610 unsigned int front = sequence.front();
612 while ((
previous = previous_in_hierarchy(front)) != front)
619 "The registered hierarchy is not terminated: "
620 "previous_in_hierarchy() does not stop at a final index."));
626 unsigned int back = sequence.back();
628 while ((next = next_in_hierarchy(back)) != back)
630 sequence.push_back(next);
635 "The registered hierarchy is not terminated: "
636 "next_in_hierarchy() does not stop at a final index."));
640 return {sequence.begin(), sequence.end()};
645 template <
int dim,
int spacedim>
648 const unsigned int fe_index)
const
652 const unsigned int new_fe_index = hierarchy_next(*
this, fe_index);
660 template <
int dim,
int spacedim>
663 const unsigned int fe_index)
const
667 const unsigned int new_fe_index = hierarchy_prev(*
this, fe_index);
675 template <
int dim,
int spacedim>
681 ExcMessage(
"This collection contains no finite element."));
684 const ComponentMask mask = (*this)[0].component_mask(scalar);
688 for (
unsigned int c = 1; c < this->size(); ++c)
695 template <
int dim,
int spacedim>
701 ExcMessage(
"This collection contains no finite element."));
704 const ComponentMask mask = (*this)[0].component_mask(vector);
708 for (
unsigned int c = 1; c < this->size(); ++c)
715 template <
int dim,
int spacedim>
721 ExcMessage(
"This collection contains no finite element."));
728 for (
unsigned int c = 1; c < this->size(); ++c)
735 template <
int dim,
int spacedim>
740 ExcMessage(
"This collection contains no finite element."));
743 const ComponentMask mask = (*this)[0].component_mask(block_mask);
747 for (
unsigned int c = 1; c < this->size(); ++c)
748 Assert(mask == (*
this)[c].component_mask(block_mask),
749 ExcMessage(
"Not all elements of this collection agree on what "
750 "the appropriate mask should be."));
756 template <
int dim,
int spacedim>
762 ExcMessage(
"This collection contains no finite element."));
765 const BlockMask mask = (*this)[0].block_mask(scalar);
769 for (
unsigned int c = 1; c < this->size(); ++c)
770 Assert(mask == (*
this)[c].block_mask(scalar),
771 ExcMessage(
"Not all elements of this collection agree on what "
772 "the appropriate mask should be."));
778 template <
int dim,
int spacedim>
784 ExcMessage(
"This collection contains no finite element."));
787 const BlockMask mask = (*this)[0].block_mask(vector);
791 for (
unsigned int c = 1; c < this->size(); ++c)
792 Assert(mask == (*
this)[c].block_mask(vector),
793 ExcMessage(
"Not all elements of this collection agree on what "
794 "the appropriate mask should be."));
800 template <
int dim,
int spacedim>
806 ExcMessage(
"This collection contains no finite element."));
813 for (
unsigned int c = 1; c < this->size(); ++c)
815 ExcMessage(
"Not all elements of this collection agree on what "
816 "the appropriate mask should be."));
823 template <
int dim,
int spacedim>
829 ExcMessage(
"This collection contains no finite element."));
832 const BlockMask mask = (*this)[0].block_mask(component_mask);
836 for (
unsigned int c = 1; c < this->size(); ++c)
837 Assert(mask == (*
this)[c].block_mask(component_mask),
838 ExcMessage(
"Not all elements of this collection agree on what "
839 "the appropriate mask should be."));
846 template <
int dim,
int spacedim>
850 Assert(this->size() > 0, ExcNoFiniteElements());
852 const unsigned int nb = this->operator[](0).n_blocks();
853 for (
unsigned int i = 1; i < this->size(); ++i)
854 Assert(this->
operator[](i).n_blocks() ==
nb,
855 ExcMessage(
"Not all finite elements in this collection have "
856 "the same number of components."));
865#include "fe_collection.inst"
std::vector< std::map< unsigned int, unsigned int > > hp_vertex_dof_identities(const std::set< unsigned int > &fes) const
unsigned int previous_in_hierarchy(const unsigned int fe_index) const
std::vector< unsigned int > get_hierarchy_sequence(const unsigned int fe_index=0) const
unsigned int find_dominating_fe_extended(const std::set< unsigned int > &fes, const unsigned int codim=0) const
const MappingCollection< dim, spacedim > & get_reference_cell_default_linear_mapping() const
std::set< unsigned int > find_common_fes(const std::set< unsigned int > &fes, const unsigned int codim=0) const
void push_back(const FiniteElement< dim, spacedim > &new_fe)
unsigned int next_in_hierarchy(const unsigned int fe_index) const
void set_default_hierarchy()
unsigned int find_dominating_fe(const std::set< unsigned int > &fes, const unsigned int codim=0) const
std::set< unsigned int > find_enclosing_fes(const std::set< unsigned int > &fes, const unsigned int codim=0) const
unsigned int find_dominated_fe(const std::set< unsigned int > &fes, const unsigned int codim=0) const
ComponentMask component_mask(const FEValuesExtractors::Scalar &scalar) const
std::vector< std::map< unsigned int, unsigned int > > hp_line_dof_identities(const std::set< unsigned int > &fes) const
void set_hierarchy(const std::function< unsigned int(const typename hp::FECollection< dim, spacedim > &, const unsigned int)> &next, const std::function< unsigned int(const typename hp::FECollection< dim, spacedim > &, const unsigned int)> &prev)
unsigned int find_dominated_fe_extended(const std::set< unsigned int > &fes, const unsigned int codim=0) const
unsigned int n_blocks() const
std::vector< std::map< unsigned int, unsigned int > > hp_quad_dof_identities(const std::set< unsigned int > &fes, const unsigned int face_no=0) const
BlockMask block_mask(const FEValuesExtractors::Scalar &scalar) const
#define DEAL_II_NAMESPACE_OPEN
#define DEAL_II_NAMESPACE_CLOSE
static ::ExceptionBase & ExcEmptyObject()
#define Assert(cond, exc)
static ::ExceptionBase & ExcImpossibleInDim(int arg1)
#define AssertIndexRange(index, range)
static ::ExceptionBase & ExcInternalError()
static ::ExceptionBase & ExcMessage(std::string arg1)
@ either_element_can_dominate
@ other_element_dominates
const types::fe_index invalid_fe_index