41 template <
int dim,
int spacedim>
48 template <
int dim,
int spacedim>
57 template <
int dim,
int spacedim>
60 const std::vector<bool> &r_i_a_f,
61 const std::vector<ComponentMask> &nonzero_c)
63 , adjust_line_dof_index_for_line_orientation_table(this->n_dofs_per_line())
64 , system_to_base_table(this->n_dofs_per_cell())
65 , component_to_base_table(this->components,
66 std::make_pair(std::make_pair(0
U, 0
U), 0
U))
71 restriction_is_additive_flags(
73 std::vector<
bool>(fe_data.n_dofs_per_cell(), r_i_a_f[0]) :
76 nonzero_c.size() == 1 ?
77 std::vector<
ComponentMask>(fe_data.n_dofs_per_cell(), nonzero_c[0]) :
79 , n_nonzero_components_table(compute_n_nonzero_components(nonzero_components))
80 , cached_primitivity(std::find_if(n_nonzero_components_table.
begin(),
81 n_nonzero_components_table.
end(),
82 [](const unsigned int n_components) {
83 return n_components != 1U;
84 }) == n_nonzero_components_table.end())
86 Assert(restriction_is_additive_flags.size() == this->n_dofs_per_cell(),
88 this->n_dofs_per_cell()));
90 for (
unsigned int i = 0; i < nonzero_components.size(); ++i)
92 Assert(nonzero_components[i].size() == this->n_components(),
94 Assert(nonzero_components[i].n_selected_components() >= 1,
97 Assert(n_nonzero_components_table[i] <= this->n_components(),
104 if (this->is_primitive())
106 system_to_component_table.resize(this->n_dofs_per_cell());
107 for (
unsigned int j = 0; j < this->n_dofs_per_cell(); ++j)
108 system_to_component_table[j] = std::pair<unsigned, unsigned>(0, j);
110 face_system_to_component_table.resize(this->n_unique_faces());
111 for (
unsigned int f = 0; f < this->n_unique_faces(); ++f)
113 face_system_to_component_table[f].resize(this->n_dofs_per_face(f));
114 for (
unsigned int j = 0; j < this->n_dofs_per_face(f); ++j)
115 face_system_to_component_table[f][j] =
116 std::pair<unsigned, unsigned>(0, j);
120 for (
unsigned int j = 0; j < this->n_dofs_per_cell(); ++j)
121 system_to_base_table[j] = std::make_pair(std::make_pair(0
U, 0
U), j);
123 face_system_to_base_table.resize(this->n_unique_faces());
124 for (
unsigned int f = 0; f < this->n_unique_faces(); ++f)
126 face_system_to_base_table[f].resize(this->n_dofs_per_face(f));
127 for (
unsigned int j = 0; j < this->n_dofs_per_face(f); ++j)
128 face_system_to_base_table[f][j] =
129 std::make_pair(std::make_pair(0
U, 0
U), j);
133 base_to_block_indices.reinit(1, 1);
139 for (
const unsigned int ref_case :
154 adjust_quad_dof_index_for_face_orientation_table.resize(
155 this->n_unique_2d_subobjects());
157 for (
unsigned int f = 0; f < this->n_unique_2d_subobjects(); ++f)
159 adjust_quad_dof_index_for_face_orientation_table[f] =
162 adjust_quad_dof_index_for_face_orientation_table[f].fill(0);
166 unit_face_support_points.resize(this->n_unique_faces());
167 generalized_face_support_points.resize(this->n_unique_faces());
172 template <
int dim,
int spacedim>
173 std::pair<std::unique_ptr<FiniteElement<dim, spacedim>>,
unsigned int>
176 return {this->
clone(), multiplicity};
181 template <
int dim,
int spacedim>
192 template <
int dim,
int spacedim>
196 const unsigned int)
const
204 template <
int dim,
int spacedim>
215 template <
int dim,
int spacedim>
219 const unsigned int)
const
227 template <
int dim,
int spacedim>
238 template <
int dim,
int spacedim>
243 const unsigned int)
const
251 template <
int dim,
int spacedim>
262 template <
int dim,
int spacedim>
267 const unsigned int)
const
275 template <
int dim,
int spacedim>
286 template <
int dim,
int spacedim>
291 const unsigned int)
const
298 template <
int dim,
int spacedim>
301 const bool isotropic_restriction_only,
302 const bool isotropic_prolongation_only)
304 for (
const unsigned int ref_case :
308 const unsigned int nc =
311 for (
unsigned int i = 0; i < nc; ++i)
315 (!isotropic_restriction_only ||
321 (!isotropic_prolongation_only ||
330 template <
int dim,
int spacedim>
333 const unsigned int child,
340 "Restriction matrices are only available for refined cells!"));
353 template <
int dim,
int spacedim>
356 const unsigned int child,
363 "Prolongation matrices are only available for refined cells!"));
379 template <
int dim,
int spacedim>
382 const unsigned int index)
const
391 template <
int dim,
int spacedim>
409 template <
int dim,
int spacedim>
415 this->n_components());
431 template <
int dim,
int spacedim>
438 this->n_components());
456 template <
int dim,
int spacedim>
477 template <
int dim,
int spacedim>
488 template <
int dim,
int spacedim>
499 template <
int dim,
int spacedim>
511 template <
int dim,
int spacedim>
548 "The component mask argument given to this function "
549 "is not a mask where the individual components belonging "
550 "to one block of the finite element are either all "
551 "selected or not selected. You can't call this function "
552 "with a component mask that splits blocks."));
563 template <
int dim,
int spacedim>
566 const unsigned int face,
567 const bool face_orientation,
568 const bool face_flip,
569 const bool face_rotation)
const
587 if ((face_orientation !=
true) || (face_flip !=
false) ||
588 (face_rotation !=
false))
591 "The function in this base class can not handle this case. "
592 "Rather, the derived class you are using must provide "
593 "an overloaded version but apparently hasn't done so. See "
594 "the documentation of this function for more information."));
604 const unsigned int dof_index_on_vertex =
616 dof_index_on_vertex);
623 const unsigned int index =
645 const unsigned int index =
654 template <
int dim,
int spacedim>
657 const unsigned int index,
658 const unsigned int face,
659 const bool face_orientation,
660 const bool face_flip,
661 const bool face_rotation)
const
696 template <
int dim,
int spacedim>
699 const unsigned int index,
700 const bool line_orientation)
const
713 this->n_dofs_per_line(),
715 if (line_orientation)
723 template <
int dim,
int spacedim>
727 for (
const unsigned int ref_case :
730 for (
unsigned int c = 0;
753 template <
int dim,
int spacedim>
757 for (
const unsigned int ref_case :
760 for (
unsigned int c = 0;
783 template <
int dim,
int spacedim>
790 for (
unsigned int c = 0;
811 template <
int dim,
int spacedim>
818 for (
unsigned int c = 0;
839 template <
int dim,
int spacedim>
846 unsigned int n_dofs_on_faces = 0;
859 template <
int dim,
int spacedim>
868 template <
int dim,
int spacedim>
876 const unsigned int face_no = 0;
881 ExcMessage(
"Constraints for this element are only implemented "
882 "for the case that faces are refined isotropically "
883 "(which is always the case in 2d, and in 3d requires "
884 "that the neighboring cell of a coarse cell presents "
885 "exactly four children on the common face)."));
888 ExcMessage(
"The finite element for which you try to obtain "
889 "hanging node constraints does not appear to "
902 template <
int dim,
int spacedim>
909 const unsigned int face_no = 0;
930 template <
int dim,
int spacedim>
946 template <
int dim,
int spacedim>
951 const unsigned int)
const
963 template <
int dim,
int spacedim>
969 const unsigned int)
const
981 template <
int dim,
int spacedim>
982 std::vector<std::pair<unsigned int, unsigned int>>
987 return std::vector<std::pair<unsigned int, unsigned int>>();
992 template <
int dim,
int spacedim>
993 std::vector<std::pair<unsigned int, unsigned int>>
998 return std::vector<std::pair<unsigned int, unsigned int>>();
1003 template <
int dim,
int spacedim>
1004 std::vector<std::pair<unsigned int, unsigned int>>
1007 const unsigned int)
const
1010 return std::vector<std::pair<unsigned int, unsigned int>>();
1015 template <
int dim,
int spacedim>
1019 const unsigned int)
const
1027 template <
int dim,
int spacedim>
1034 return ((
typeid(*
this) ==
typeid(f)) && (this->
get_name() == f.
get_name()) &&
1042 template <
int dim,
int spacedim>
1047 return !(*
this == f);
1052 template <
int dim,
int spacedim>
1053 const std::vector<Point<dim>> &
1068 template <
int dim,
int spacedim>
1077 template <
int dim,
int spacedim>
1078 const std::vector<Point<dim>> &
1089 template <
int dim,
int spacedim>
1098 template <
int dim,
int spacedim>
1110 template <
int dim,
int spacedim>
1111 const std::vector<
Point<dim - 1>> &
1113 const unsigned int face_no)
const
1129 template <
int dim,
int spacedim>
1132 const unsigned int face_no)
const
1140 template <
int dim,
int spacedim>
1143 const unsigned int index,
1144 const unsigned int face_no)
const
1156 template <
int dim,
int spacedim>
1159 const unsigned int)
const
1166 template <
int dim,
int spacedim>
1172 const unsigned int n_total_components = this->
n_components();
1173 Assert((n_total_components ==
mask.size()) || (
mask.size() == 0),
1174 ExcMessage(
"The given ComponentMask has the wrong size."));
1176 const unsigned int n_selected =
1177 mask.n_selected_components(n_total_components);
1179 ExcMessage(
"You need at least one selected component."));
1181 const unsigned int first_selected =
1182 mask.first_selected_component(n_total_components);
1186 for (
unsigned int c = 0; c < n_total_components; ++c)
1187 Assert((c < first_selected && (!mask[c])) ||
1188 (c >= first_selected && c < first_selected + n_selected &&
1190 (c >= first_selected + n_selected && !mask[c]),
1191 ExcMessage(
"Error: the given ComponentMask is not contiguous!"));
1194 return get_sub_fe(first_selected, n_selected);
1199 template <
int dim,
int spacedim>
1202 const unsigned int first_component,
1203 const unsigned int n_selected_components)
const
1209 "You can only select a whole FiniteElement, not a part of one."));
1211 (void)first_component;
1212 (void)n_selected_components;
1218 template <
int dim,
int spacedim>
1219 std::pair<Table<2, bool>, std::vector<unsigned int>>
1223 return std::pair<Table<2, bool>, std::vector<unsigned int>>(
1230 template <
int dim,
int spacedim>
1235 std::vector<double> &)
const
1238 ExcMessage(
"The element for which you are calling the current "
1239 "function does not have generalized support points (see "
1240 "the glossary for a definition of generalized support "
1241 "points). Consequently, the current function can not "
1242 "be defined and is not implemented by the element."));
1248 template <
int dim,
int spacedim>
1269 template <
int dim,
int spacedim>
1270 std::vector<unsigned int>
1272 const std::vector<ComponentMask> &nonzero_components)
1285 template <
int dim,
int spacedim>
1286 std::unique_ptr<typename FiniteElement<dim, spacedim>::InternalDataBase>
1304 template <
int dim,
int spacedim>
1305 std::unique_ptr<typename FiniteElement<dim, spacedim>::InternalDataBase>
1323 template <
int dim,
int spacedim>
1327 const unsigned int face_no,
1352 template <
int dim,
int spacedim>
1356 const unsigned int face_no,
1368 ExcMessage(
"Use of a deprecated interface, please implement "
1369 "fill_fe_face_values taking a hp::QCollection argument"));
1374 (void)mapping_internal;
1383 template <
int dim,
int spacedim>
1384 std::unique_ptr<typename FiniteElement<dim, spacedim>::InternalDataBase>
1402 template <
int dim,
int spacedim>
unsigned int size() const
bool represents_the_all_selected_mask() const
unsigned int size() const
bool represents_the_all_selected_mask() const
unsigned int size() const
unsigned int get_first_line_index() const
unsigned int n_dofs_per_vertex() const
unsigned int n_dofs_per_cell() const
unsigned int n_dofs_per_line() const
unsigned int get_first_quad_index(const unsigned int quad_no=0) const
unsigned int n_dofs_per_face(unsigned int face_no=0, unsigned int child=0) const
unsigned int n_blocks() const
unsigned int n_components() const
ReferenceCell reference_cell() const
unsigned int n_unique_2d_subobjects() const
unsigned int get_first_face_line_index(const unsigned int face_no=0) const
unsigned int get_first_face_quad_index(const unsigned int face_no=0) const
unsigned int n_unique_faces() const
unsigned int n_dofs_per_quad(unsigned int face_no=0) const
virtual std::size_t memory_consumption() const
bool constraints_are_implemented(const ::internal::SubfaceCase< dim > &subface_case=::internal::SubfaceCase< dim >::case_isotropic) const
bool isotropic_prolongation_is_implemented() const
virtual std::string get_name() const =0
virtual FiniteElementDomination::Domination compare_for_domination(const FiniteElement< dim, spacedim > &fe_other, const unsigned int codim=0) const
const std::vector< unsigned int > n_nonzero_components_table
virtual std::unique_ptr< InternalDataBase > get_face_data(const UpdateFlags update_flags, const Mapping< dim, spacedim > &mapping, const hp::QCollection< dim - 1 > &quadrature, ::internal::FEValuesImplementation::FiniteElementRelatedData< dim, spacedim > &output_data) const
const std::vector< Point< dim > > & get_generalized_support_points() const
std::vector< std::vector< Point< dim - 1 > > > unit_face_support_points
virtual Tensor< 2, dim > shape_grad_grad(const unsigned int i, const Point< dim > &p) const
bool prolongation_is_implemented() const
virtual std::vector< std::pair< unsigned int, unsigned int > > hp_vertex_dof_identities(const FiniteElement< dim, spacedim > &fe_other) const
virtual Tensor< 2, dim > shape_grad_grad_component(const unsigned int i, const Point< dim > &p, const unsigned int component) const
const std::vector< Point< dim > > & get_unit_support_points() const
bool has_face_support_points(const unsigned int face_no=0) const
ComponentMask component_mask(const FEValuesExtractors::Scalar &scalar) const
bool operator!=(const FiniteElement< dim, spacedim > &) const
virtual std::unique_ptr< InternalDataBase > get_subface_data(const UpdateFlags update_flags, const Mapping< dim, spacedim > &mapping, const Quadrature< dim - 1 > &quadrature, ::internal::FEValuesImplementation::FiniteElementRelatedData< dim, spacedim > &output_data) const
bool has_support_points() const
std::vector< std::vector< FullMatrix< double > > > restriction
TableIndices< 2 > interface_constraints_size() const
bool has_generalized_support_points() const
std::vector< Table< 2, int > > adjust_quad_dof_index_for_face_orientation_table
virtual bool operator==(const FiniteElement< dim, spacedim > &fe) const
unsigned int adjust_line_dof_index_for_line_orientation(const unsigned int index, const bool line_orientation) const
virtual Tensor< 4, dim > shape_4th_derivative_component(const unsigned int i, const Point< dim > &p, const unsigned int component) const
virtual void convert_generalized_support_point_values_to_dof_values(const std::vector< Vector< double >> &support_point_values, std::vector< double > &nodal_values) const
virtual void fill_fe_face_values(const typename Triangulation< dim, spacedim >::cell_iterator &cell, const unsigned int face_no, const hp::QCollection< dim - 1 > &quadrature, const Mapping< dim, spacedim > &mapping, const typename Mapping< dim, spacedim >::InternalDataBase &mapping_internal, const internal::FEValuesImplementation::MappingRelatedData< dim, spacedim > &mapping_data, const InternalDataBase &fe_internal, ::internal::FEValuesImplementation::FiniteElementRelatedData< dim, spacedim > &output_data) const
BlockIndices base_to_block_indices
void reinit_restriction_and_prolongation_matrices(const bool isotropic_restriction_only=false, const bool isotropic_prolongation_only=false)
virtual std::unique_ptr< FiniteElement< dim, spacedim > > clone() const =0
bool isotropic_restriction_is_implemented() const
std::vector< int > adjust_line_dof_index_for_line_orientation_table
virtual Point< dim > unit_support_point(const unsigned int index) const
virtual bool has_support_on_face(const unsigned int shape_index, const unsigned int face_index) const
virtual unsigned int face_to_cell_index(const unsigned int face_dof_index, const unsigned int face, const bool face_orientation=true, const bool face_flip=false, const bool face_rotation=false) const
std::pair< std::unique_ptr< FiniteElement< dim, spacedim > >, unsigned int > operator^(const unsigned int multiplicity) const
virtual const FiniteElement< dim, spacedim > & base_element(const unsigned int index) const
virtual Tensor< 4, dim > shape_4th_derivative(const unsigned int i, const Point< dim > &p) const
virtual double shape_value_component(const unsigned int i, const Point< dim > &p, const unsigned int component) const
const FullMatrix< double > & constraints(const ::internal::SubfaceCase< dim > &subface_case=::internal::SubfaceCase< dim >::case_isotropic) const
virtual void get_subface_interpolation_matrix(const FiniteElement< dim, spacedim > &source, const unsigned int subface, FullMatrix< double > &matrix, const unsigned int face_no=0) const
unsigned int component_to_block_index(const unsigned int component) const
BlockMask block_mask(const FEValuesExtractors::Scalar &scalar) const
virtual void get_interpolation_matrix(const FiniteElement< dim, spacedim > &source, FullMatrix< double > &matrix) const
virtual std::unique_ptr< InternalDataBase > get_data(const UpdateFlags update_flags, const Mapping< dim, spacedim > &mapping, const Quadrature< dim > &quadrature, ::internal::FEValuesImplementation::FiniteElementRelatedData< dim, spacedim > &output_data) const =0
virtual std::pair< Table< 2, bool >, std::vector< unsigned int > > get_constant_modes() const
std::vector< std::pair< std::pair< unsigned int, unsigned int >, unsigned int > > system_to_base_table
virtual Tensor< 3, dim > shape_3rd_derivative(const unsigned int i, const Point< dim > &p) const
FiniteElement(const FiniteElementData< dim > &fe_data, const std::vector< bool > &restriction_is_additive_flags, const std::vector< ComponentMask > &nonzero_components)
std::vector< std::pair< unsigned int, unsigned int > > system_to_component_table
const FiniteElement< dim, spacedim > & get_sub_fe(const ComponentMask &mask) const
virtual Tensor< 3, dim > shape_3rd_derivative_component(const unsigned int i, const Point< dim > &p, const unsigned int component) const
const std::vector< bool > restriction_is_additive_flags
virtual Point< dim - 1 > unit_face_support_point(const unsigned int index, const unsigned int face_no=0) const
std::vector< std::pair< std::pair< unsigned int, unsigned int >, unsigned int > > component_to_base_table
std::vector< std::vector< std::pair< std::pair< unsigned int, unsigned int >, unsigned int > > > face_system_to_base_table
std::vector< Point< dim > > unit_support_points
bool restriction_is_implemented() const
std::vector< std::vector< std::pair< unsigned int, unsigned int > > > face_system_to_component_table
static std::vector< unsigned int > compute_n_nonzero_components(const std::vector< ComponentMask > &nonzero_components)
virtual std::vector< std::pair< unsigned int, unsigned int > > hp_quad_dof_identities(const FiniteElement< dim, spacedim > &fe_other, const unsigned int face_no=0) const
const std::vector< Point< dim - 1 > > & get_unit_face_support_points(const unsigned int face_no=0) const
FullMatrix< double > interface_constraints
virtual Tensor< 1, dim > shape_grad(const unsigned int i, const Point< dim > &p) const
virtual std::vector< std::pair< unsigned int, unsigned int > > hp_line_dof_identities(const FiniteElement< dim, spacedim > &fe_other) const
virtual double shape_value(const unsigned int i, const Point< dim > &p) const
virtual void get_face_interpolation_matrix(const FiniteElement< dim, spacedim > &source, FullMatrix< double > &matrix, const unsigned int face_no=0) const
virtual std::size_t memory_consumption() const
std::vector< Point< dim > > generalized_support_points
unsigned int adjust_quad_dof_index_for_face_orientation(const unsigned int index, const unsigned int face_no, const bool face_orientation, const bool face_flip, const bool face_rotation) const
const std::vector< ComponentMask > nonzero_components
virtual Tensor< 1, dim > shape_grad_component(const unsigned int i, const Point< dim > &p, const unsigned int component) const
virtual const FullMatrix< double > & get_prolongation_matrix(const unsigned int child, const RefinementCase< dim > &refinement_case=RefinementCase< dim >::isotropic_refinement) const
virtual bool hp_constraints_are_implemented() const
std::vector< std::vector< FullMatrix< double > > > prolongation
types::global_dof_index first_block_of_base(const unsigned int b) const
virtual const FullMatrix< double > & get_restriction_matrix(const unsigned int child, const RefinementCase< dim > &refinement_case=RefinementCase< dim >::isotropic_refinement) const
unsigned int size() const
#define DEAL_II_NAMESPACE_OPEN
#define DEAL_II_NAMESPACE_CLOSE
static ::ExceptionBase & ExcFEHasNoSupportPoints()
static ::ExceptionBase & ExcWrongInterfaceMatrixSize(int arg1, int arg2)
static ::ExceptionBase & ExcInternalError()
static ::ExceptionBase & ExcUnitShapeValuesDoNotExist()
static ::ExceptionBase & ExcEmbeddingVoid()
static ::ExceptionBase & ExcDimensionMismatch(std::size_t arg1, std::size_t arg2)
#define Assert(cond, exc)
static ::ExceptionBase & ExcNotImplemented()
#define AssertDimension(dim1, dim2)
#define AssertIndexRange(index, range)
static ::ExceptionBase & ExcProjectionVoid()
static ::ExceptionBase & ExcMessage(std::string arg1)
#define AssertThrow(cond, exc)
@ update_default
No update.
@ neither_element_dominates
void reference_cell(Triangulation< dim, spacedim > &tria, const ReferenceCell &reference_cell)
std::enable_if_t< std::is_fundamental_v< T >, std::size_t > memory_consumption(const T &t)
constexpr const ReferenceCell Quadrilateral
constexpr const ReferenceCell Line
VectorType::value_type * begin(VectorType &V)
VectorType::value_type * end(VectorType &V)
unsigned char combined_face_orientation(const bool face_orientation, const bool face_rotation, const bool face_flip)
static const unsigned int invalid_unsigned_int
static unsigned int n_children(const RefinementCase< dim > &refinement_case)