44 std::vector<unsigned int>
45 get_rt_dpo_vector(
const unsigned int dim,
const unsigned int degree)
47 std::vector<unsigned int> dpo(dim + 1);
50 unsigned int dofs_per_face = 1;
51 for (
unsigned int d = 1;
d < dim; ++
d)
52 dofs_per_face *= (degree + 1);
54 dpo[dim - 1] = dofs_per_face;
55 dpo[dim] = dim * degree * dofs_per_face;
65template <
int dim,
int spacedim>
67 const unsigned int degree)
71 get_lexicographic_numbering(degree)),
85 const std::vector<unsigned int> numbering =
94 this->n_dofs_per_cell());
96 const unsigned int face_no = 0;
107 if constexpr (dim == spacedim)
111 for (
unsigned int i = 0; i < GeometryInfo<dim>::max_children_per_face;
115 FETools::compute_face_embedding_matrices<dim, double>(*
this,
123 unsigned int target_row = 0;
124 for (
unsigned int d = 0; d < GeometryInfo<dim>::max_children_per_face;
126 for (
unsigned int i = 0; i < face_embeddings[d].
m(); ++i)
128 for (
unsigned int j = 0; j < face_embeddings[d].
n(); ++j)
130 face_embeddings[d](i, j);
142template <
int dim,
int spacedim>
153 ">(" + std::to_string(this->degree - 1) +
")";
157template <
int dim,
int spacedim>
158std::unique_ptr<FiniteElement<dim, spacedim>>
161 return std::make_unique<FE_RaviartThomasNodal<dim, spacedim>>(*this);
166template <
int dim,
int spacedim>
167std::vector<unsigned int>
169 const unsigned int degree)
171 std::vector<unsigned int> numbering =
179 const unsigned int n = degree + 1;
180 for (
unsigned int &index : numbering)
181 if (index >= 2 * n * n && index < 4 * n * n)
183 const unsigned int face = index / (n * n);
184 const unsigned int local = index % (n * n);
185 index = face * n * n + (local / n) + (local % n) * n;
198template <
int dim,
int spacedim>
207 const unsigned int n = this->degree;
208 const unsigned int face_no = 0;
210 for (
unsigned int local = 0; local < this->n_dofs_per_quad(face_no); ++local)
214 unsigned int i = local % n, j = local / n;
217 this->adjust_quad_dof_index_for_face_orientation_table[face_no](
221 this->adjust_quad_dof_index_for_face_orientation_table[face_no](
223 i + (n - 1 - j) * n - local;
225 this->adjust_quad_dof_index_for_face_orientation_table[face_no](
227 (n - 1 - j) + (n - 1 - i) * n - local;
229 this->adjust_quad_dof_index_for_face_orientation_table[face_no](
231 (n - 1 - i) + j * n - local;
233 this->adjust_quad_dof_index_for_face_orientation_table[face_no](
236 this->adjust_quad_dof_index_for_face_orientation_table[face_no](
238 j + (n - 1 - i) * n - local;
240 this->adjust_quad_dof_index_for_face_orientation_table[face_no](
242 (n - 1 - i) + (n - 1 - j) * n - local;
244 this->adjust_quad_dof_index_for_face_orientation_table[face_no](
246 (n - 1 - j) + i * n - local;
249 for (
const bool rotation : {
false,
true})
250 for (
const bool flip : {
false,
true})
251 this->adjust_quad_dof_sign_for_face_orientation_table[face_no](
259template <
int dim,
int spacedim>
262 const unsigned int shape_index,
263 const unsigned int face_index)
const
270 const unsigned int support_face = shape_index / this->n_dofs_per_face();
283template <
int dim,
int spacedim>
288 std::vector<double> &nodal_values)
const
290 if constexpr (dim != spacedim)
296 (void)support_point_values;
301 Assert(support_point_values.size() == this->generalized_support_points.size(),
303 this->generalized_support_points.size()));
304 Assert(nodal_values.size() == this->n_dofs_per_cell(),
306 Assert(support_point_values[0].
size() == this->n_components(),
308 this->n_components()));
312 unsigned int fbase = 0;
314 for (; f < GeometryInfo<dim>::faces_per_cell;
315 ++f, fbase += this->n_dofs_per_face(f))
317 for (
unsigned int i = 0; i < this->n_dofs_per_face(f); ++i)
319 nodal_values[fbase + i] = support_point_values[fbase + i](
325 const unsigned int istep = (this->n_dofs_per_cell() - fbase) / dim;
329 while (fbase < this->n_dofs_per_cell())
331 for (
unsigned int i = 0; i < istep; ++i)
333 nodal_values[fbase + i] = support_point_values[fbase + i](f);
349template <
int dim,
int spacedim>
357template <
int dim,
int spacedim>
358std::vector<std::pair<unsigned int, unsigned int>>
367 return std::vector<std::pair<unsigned int, unsigned int>>();
370 return std::vector<std::pair<unsigned int, unsigned int>>();
374 return std::vector<std::pair<unsigned int, unsigned int>>();
380template <
int dim,
int spacedim>
381std::vector<std::pair<unsigned int, unsigned int>>
392 return std::vector<std::pair<unsigned int, unsigned int>>();
407 const unsigned int p = this->degree - 1;
408 const unsigned int q = fe_q_other->degree - 1;
410 std::vector<std::pair<unsigned int, unsigned int>> identities;
413 for (
unsigned int i = 0; i < p + 1; ++i)
414 identities.emplace_back(i, i);
416 else if (p % 2 == 0 && q % 2 == 0)
417 identities.emplace_back(p / 2, q / 2);
426 return std::vector<std::pair<unsigned int, unsigned int>>();
431 return std::vector<std::pair<unsigned int, unsigned int>>();
436template <
int dim,
int spacedim>
437std::vector<std::pair<unsigned int, unsigned int>>
440 const unsigned int face_no)
const
449 return std::vector<std::pair<unsigned int, unsigned int>>();
452 const unsigned int p = this->n_dofs_per_quad(face_no);
455 const unsigned int q = fe_q_other->n_dofs_per_quad(0);
457 std::vector<std::pair<unsigned int, unsigned int>> identities;
460 for (
unsigned int i = 0; i < p; ++i)
461 identities.emplace_back(i, i);
463 else if (p % 2 != 0 && q % 2 != 0)
464 identities.emplace_back(p / 2, q / 2);
473 return std::vector<std::pair<unsigned int, unsigned int>>();
478 return std::vector<std::pair<unsigned int, unsigned int>>();
483template <
int dim,
int spacedim>
487 const unsigned int codim)
const
497 if (this->degree < fe_rt_nodal_other->degree)
499 else if (this->degree == fe_rt_nodal_other->degree)
507 if (fe_nothing->is_dominating())
527 const unsigned int)
const
539 const unsigned int)
const
546template <
int dim,
int spacedim>
551 const unsigned int face_no)
const
557 (x_source_fe.
get_name().find(
"FE_RaviartThomasNodal<") == 0) ||
559 &x_source_fe) !=
nullptr),
562 Assert(interpolation_matrix.
n() == this->n_dofs_per_face(face_no),
564 this->n_dofs_per_face(face_no)));
591 double eps = 2e-13 * this->degree * (dim - 1);
603 const Point<dim> &p = face_projection.point(i);
605 for (
unsigned int j = 0; j < this->n_dofs_per_face(face_no); ++j)
607 double matrix_entry =
608 this->shape_value_component(this->face_to_cell_index(j, 0), p, 0);
613 if (std::fabs(matrix_entry - 1.0) < eps)
615 if (std::fabs(matrix_entry) < eps)
618 interpolation_matrix(i, j) = matrix_entry;
630 for (
unsigned int i = 0; i < this->n_dofs_per_face(face_no); ++i)
631 sum += interpolation_matrix(j, i);
633 Assert(std::fabs(sum - 1) < 2e-13 * this->degree * (dim - 1),
640template <
int dim,
int spacedim>
644 const unsigned int subface,
646 const unsigned int face_no)
const
651 (x_source_fe.
get_name().find(
"FE_RaviartThomasNodal<") == 0) ||
653 &x_source_fe) !=
nullptr),
656 Assert(interpolation_matrix.
n() == this->n_dofs_per_face(face_no),
658 this->n_dofs_per_face(face_no)));
685 double eps = 2e-13 * this->degree * (dim - 1);
691 this->reference_cell(),
700 const Point<dim> &p = subface_projection.point(i);
702 for (
unsigned int j = 0; j < this->n_dofs_per_face(face_no); ++j)
704 double matrix_entry =
705 this->shape_value_component(this->face_to_cell_index(j, 0), p, 0);
710 if (std::fabs(matrix_entry - 1.0) < eps)
712 if (std::fabs(matrix_entry) < eps)
715 interpolation_matrix(i, j) = matrix_entry;
727 for (
unsigned int i = 0; i < this->n_dofs_per_face(face_no); ++i)
728 sum += interpolation_matrix(j, i);
730 Assert(std::fabs(sum - 1) < 2e-13 * this->degree * (dim - 1),
738template <
int dim,
int spacedim>
741 const unsigned int child,
748 "Prolongation matrices are only available for refined cells!"));
749 AssertIndexRange(child, this->reference_cell().n_children(refinement_case));
752 if (this->prolongation[refinement_case - 1][child].n() == 0)
754 std::scoped_lock lock(prolongation_matrix_mutex);
757 if (this->prolongation[refinement_case - 1][child].n() ==
758 this->n_dofs_per_cell())
759 return this->prolongation[refinement_case - 1][child];
767 std::vector<std::vector<FullMatrix<double>>> isotropic_matrices(
769 isotropic_matrices.back().resize(
770 this->reference_cell().n_children(
773 this->n_dofs_per_cell()));
776 std::move(isotropic_matrices.back());
792 return this->prolongation[refinement_case - 1][child];
797template <
int dim,
int spacedim>
800 const unsigned int child,
807 "Restriction matrices are only available for refined cells!"));
808 AssertIndexRange(child, this->reference_cell().n_children(refinement_case));
811 if (this->restriction[refinement_case - 1][child].n() == 0)
813 std::scoped_lock lock(restriction_matrix_mutex);
816 if (this->restriction[refinement_case - 1][child].n() ==
817 this->n_dofs_per_cell())
818 return this->restriction[refinement_case - 1][child];
826 std::vector<std::vector<FullMatrix<double>>> isotropic_matrices(
828 isotropic_matrices.back().resize(
829 this->reference_cell().n_children(
832 this->n_dofs_per_cell()));
835 std::move(isotropic_matrices.back());
851 return this->restriction[refinement_case - 1][child];
857#include "fe/fe_raviart_thomas_nodal.inst"
std::vector< MappingKind > mapping_kind
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 override
virtual bool has_support_on_face(const unsigned int shape_index, const unsigned int face_index) const override
virtual std::unique_ptr< FiniteElement< dim, spacedim > > clone() const override
virtual bool hp_constraints_are_implemented() const override
void initialize_quad_dof_index_permutation_and_sign_change()
static std::vector< unsigned int > get_lexicographic_numbering(const unsigned int degree)
virtual std::vector< std::pair< unsigned int, unsigned int > > hp_vertex_dof_identities(const FiniteElement< dim, spacedim > &fe_other) const override
virtual std::vector< std::pair< unsigned int, unsigned int > > hp_line_dof_identities(const FiniteElement< dim, spacedim > &fe_other) const override
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 override
virtual const FullMatrix< double > & get_prolongation_matrix(const unsigned int child, const RefinementCase< dim > &refinement_case=RefinementCase< dim >::isotropic_refinement) const override
virtual std::string get_name() const override
FE_RaviartThomasNodal(const unsigned int p)
virtual void convert_generalized_support_point_values_to_dof_values(const std::vector< Vector< double > > &support_point_values, std::vector< double > &nodal_values) const override
virtual void get_face_interpolation_matrix(const FiniteElement< dim, spacedim > &source, FullMatrix< double > &matrix, const unsigned int face_no=0) const override
virtual const FullMatrix< double > & get_restriction_matrix(const unsigned int child, const RefinementCase< dim > &refinement_case=RefinementCase< dim >::isotropic_refinement) const override
virtual FiniteElementDomination::Domination compare_for_domination(const FiniteElement< dim, spacedim > &fe_other, const unsigned int codim=0) const override final
static std::vector< unsigned int > get_lexicographic_numbering(const unsigned int degree)
const unsigned int degree
unsigned int n_dofs_per_face(unsigned int face_no=0, unsigned int child=0) const
virtual std::string get_name() const =0
std::vector< std::vector< FullMatrix< double > > > restriction
void reinit_restriction_and_prolongation_matrices(const bool isotropic_restriction_only=false, const bool isotropic_prolongation_only=false)
std::vector< std::vector< Point< dim - 1 > > > generalized_face_support_points
FullMatrix< double > interface_constraints
std::vector< Point< dim > > generalized_support_points
std::vector< std::vector< FullMatrix< double > > > prolongation
std::vector< Point< dim > > get_polynomial_support_points() const
static Quadrature< dim > project_to_face(const ReferenceCell< dim > &reference_cell, const SubQuadrature &quadrature, const unsigned int face_no, const types::geometric_orientation combined_orientation)
static Quadrature< dim > project_to_subface(const ReferenceCell< dim > &reference_cell, const SubQuadrature &quadrature, const unsigned int face_no, const unsigned int subface_no, const types::geometric_orientation combined_orientation, const RefinementCase< dim - 1 > &ref_case)
#define DEAL_II_NAMESPACE_OPEN
constexpr bool running_in_debug_mode()
#define DEAL_II_NAMESPACE_CLOSE
#define DEAL_II_NOT_IMPLEMENTED()
#define Assert(cond, exc)
static ::ExceptionBase & ExcImpossibleInDim(int arg1)
#define AssertDimension(dim1, dim2)
#define AssertIndexRange(index, range)
static ::ExceptionBase & ExcInternalError()
static ::ExceptionBase & ExcDimensionMismatch(std::size_t arg1, std::size_t arg2)
static ::ExceptionBase & ExcMessage(std::string arg1)
#define AssertThrow(cond, exc)
@ either_element_can_dominate
@ other_element_dominates
@ neither_element_dominates
SymmetricTensor< 2, dim, Number > d(const Tensor< 2, dim, Number > &F, const Tensor< 2, dim, Number > &dF_dt)
std::string dim_string(const int dim, const int spacedim)
types::geometric_orientation combined_face_orientation(const bool face_orientation, const bool face_rotation, const bool face_flip)
constexpr types::geometric_orientation default_geometric_orientation