35 std::vector<unsigned int>
36 get_dpo_vector_fe_p(
const unsigned int dim,
const unsigned int degree)
83 std::vector<Point<dim>>
84 unit_support_points_fe_p(
const unsigned int degree)
86 std::vector<Point<dim>> unit_points;
90 unit_points.emplace_back();
101 1.0 /
double(dim + 1));
102 unit_points.emplace_back(centroid);
113 unit_points.emplace_back(0.0);
114 unit_points.emplace_back(1.0);
117 unit_points.emplace_back(0.5);
125 unit_points.emplace_back(0.0, 0.0);
126 unit_points.emplace_back(1.0, 0.0);
127 unit_points.emplace_back(0.0, 1.0);
131 unit_points.emplace_back(0.5, 0.0);
132 unit_points.emplace_back(0.5, 0.5);
133 unit_points.emplace_back(0.0, 0.5);
142 unit_points.emplace_back(0.0, 0.0, 0.0);
143 unit_points.emplace_back(1.0, 0.0, 0.0);
144 unit_points.emplace_back(0.0, 1.0, 0.0);
145 unit_points.emplace_back(0.0, 0.0, 1.0);
149 unit_points.emplace_back(0.5, 0.0, 0.0);
150 unit_points.emplace_back(0.5, 0.5, 0.0);
151 unit_points.emplace_back(0.0, 0.5, 0.0);
152 unit_points.emplace_back(0.0, 0.0, 0.5);
153 unit_points.emplace_back(0.5, 0.0, 0.5);
154 unit_points.emplace_back(0.0, 0.5, 0.5);
171 std::vector<std::vector<
Point<dim - 1>>>
172 unit_face_support_points_fe_p(
173 const unsigned int degree,
184 std::vector<std::vector<
Point<dim - 1>>> unit_face_points;
187 for (
auto face_n : ReferenceCells::get_simplex<dim>().face_indices())
190 unit_face_points.emplace_back(
191 unit_support_points_fe_p<dim - 1>(degree));
194 return unit_face_points;
204 constraints_fe_p(
const unsigned int )
213 constraints_fe_p<2>(
const unsigned int degree)
215 const unsigned int dim = 2;
225 std::vector<
Point<dim - 1>> constraint_points;
227 constraint_points.emplace_back(0.5);
231 constraint_points.emplace_back(0.25);
233 constraint_points.emplace_back(0.75);
239 const unsigned int n_dofs_constrained = constraint_points.size();
240 unsigned int n_dofs_per_face = degree + 1;
246 for (
unsigned int i = 0; i < n_dofs_constrained; ++i)
247 for (
unsigned int j = 0; j < n_dofs_per_face; ++j)
249 interface_constraints(i, j) =
250 poly.compute_value(j, constraint_points[i]);
256 if (std::fabs(interface_constraints(i, j)) < 1e-13)
257 interface_constraints(i, j) = 0;
259 return interface_constraints;
268 std::vector<unsigned int>
269 get_dpo_vector_fe_dgp(
const unsigned int dim,
const unsigned int degree)
274 std::vector<unsigned int> dpo(dim + 1, 0U);
285 const auto continuous_dpo = get_dpo_vector_fe_p(dim, degree);
292 continuous_dpo[dim]};
300 continuous_dpo[dim]};
310 continuous_dpo[dim]};
321template <
int dim,
int spacedim>
325 const std::vector<
Point<dim>> & unit_support_points,
326 const std::vector<std::vector<
Point<dim - 1>>> unit_face_support_points,
331 std::vector<
bool>(fe_data.dofs_per_cell),
342template <
int dim,
int spacedim>
343std::pair<Table<2, bool>, std::vector<unsigned int>>
347 constant_modes.fill(
true);
348 return std::pair<Table<2, bool>, std::vector<unsigned int>>(
349 constant_modes, std::vector<unsigned int>(1, 0));
354template <
int dim,
int spacedim>
357 const unsigned int child,
365 if (this->prolongation[refinement_case - 1][child].n() == 0)
367 std::lock_guard<std::mutex> lock(this->mutex);
370 if (this->prolongation[refinement_case - 1][child].n() ==
371 this->n_dofs_per_cell())
372 return this->prolongation[refinement_case - 1][child];
378 std::vector<std::vector<FullMatrix<double>>> isotropic_matrices(
380 isotropic_matrices.back().resize(
386 this_nonconst.prolongation[refinement_case - 1].swap(
387 isotropic_matrices.back());
391 return this->prolongation[refinement_case - 1][child];
396template <
int dim,
int spacedim>
399 const unsigned int child,
407 if (this->restriction[refinement_case - 1][child].n() == 0)
409 std::lock_guard<std::mutex> lock(this->mutex);
412 if (this->restriction[refinement_case - 1][child].n() ==
413 this->n_dofs_per_cell())
414 return this->restriction[refinement_case - 1][child];
420 std::vector<std::vector<FullMatrix<double>>> isotropic_matrices(
422 isotropic_matrices.back().resize(
428 this_nonconst.restriction[refinement_case - 1].swap(
429 isotropic_matrices.back());
433 return this->restriction[refinement_case - 1][child];
438template <
int dim,
int spacedim>
443 const unsigned int face_no)
const
457 const double eps = 2e-13 * this->degree * (dim - 1);
459 std::vector<Point<dim>> face_quadrature_points(quad_face_support.size());
463 face_quadrature_points);
466 for (
unsigned int j = 0; j < this->n_dofs_per_face(face_no); ++j)
468 double matrix_entry =
469 this->shape_value(this->face_to_cell_index(j, 0),
470 face_quadrature_points[i]);
475 if (std::fabs(matrix_entry - 1.0) < eps)
477 if (std::fabs(matrix_entry) < eps)
480 interpolation_matrix(i, j) = matrix_entry;
488 for (
unsigned int i = 0; i < this->n_dofs_per_face(face_no); ++i)
489 sum += interpolation_matrix(j, i);
503 spacedim>::ExcInterpolationNotImplemented()));
508template <
int dim,
int spacedim>
512 const unsigned int subface,
514 const unsigned int face_no)
const
528 const double eps = 2e-13 * this->degree * (dim - 1);
530 std::vector<Point<dim>> subface_quadrature_points(
531 quad_face_support.size());
536 subface_quadrature_points);
539 for (
unsigned int j = 0; j < this->n_dofs_per_face(face_no); ++j)
541 double matrix_entry =
542 this->shape_value(this->face_to_cell_index(j, 0),
543 subface_quadrature_points[i]);
548 if (std::fabs(matrix_entry - 1.0) < eps)
550 if (std::fabs(matrix_entry) < eps)
553 interpolation_matrix(i, j) = matrix_entry;
561 for (
unsigned int i = 0; i < this->n_dofs_per_face(face_no); ++i)
562 sum += interpolation_matrix(j, i);
576 spacedim>::ExcInterpolationNotImplemented()));
581template <
int dim,
int spacedim>
590template <
int dim,
int spacedim>
595 std::vector<double> & nodal_values)
const
598 this->get_unit_support_points().size());
602 for (
unsigned int i = 0; i < this->dofs_per_cell; ++i)
606 nodal_values[i] = support_point_values[i](0);
612template <
int dim,
int spacedim>
621 unit_support_points_fe_p<dim>(degree),
623 constraints_fe_p<dim>(degree))
628template <
int dim,
int spacedim>
629std::unique_ptr<FiniteElement<dim, spacedim>>
632 return std::make_unique<FE_SimplexP<dim, spacedim>>(*this);
637template <
int dim,
int spacedim>
641 std::ostringstream namebuf;
642 namebuf <<
"FE_SimplexP<" << dim <<
">(" << this->degree <<
")";
644 return namebuf.str();
649template <
int dim,
int spacedim>
653 const unsigned int codim)
const
674 if (this->degree < fe_p_other->degree)
676 else if (this->degree == fe_p_other->degree)
684 if (this->degree < fe_q_other->degree)
686 else if (this->degree == fe_q_other->degree)
694 if (fe_nothing->is_dominating())
709template <
int dim,
int spacedim>
710std::vector<std::pair<unsigned int, unsigned int>>
754template <
int dim,
int spacedim>
755std::vector<std::pair<unsigned int, unsigned int>>
774 std::vector<std::pair<unsigned int, unsigned int>> identities;
776 for (
unsigned int i = 0; i < this->degree - 1; ++i)
777 for (
unsigned int j = 0; j < fe_p_other->degree - 1; ++j)
778 if (std::fabs(this->unit_support_points[i + 3][0] -
779 fe_p_other->unit_support_points[i + 3][0]) < 1e-14)
780 identities.emplace_back(i, j);
799 const std::vector<unsigned int> &index_map_inverse_q_other =
800 fe_q_other->get_poly_space_numbering_inverse();
802 std::vector<std::pair<unsigned int, unsigned int>> identities;
804 for (
unsigned int i = 0; i < this->degree - 1; ++i)
805 for (
unsigned int j = 0; j < fe_q_other->degree - 1; ++j)
806 if (std::fabs(this->unit_support_points[i + 3][0] -
807 fe_q_other->get_unit_support_points()
808 [index_map_inverse_q_other[j + 1]][0]) < 1e-14)
809 identities.emplace_back(i, j);
839template <
int dim,
int spacedim>
848 unit_support_points_fe_p<dim>(degree),
850 constraints_fe_p<dim>(degree))
855template <
int dim,
int spacedim>
856std::unique_ptr<FiniteElement<dim, spacedim>>
859 return std::make_unique<FE_SimplexDGP<dim, spacedim>>(*this);
864template <
int dim,
int spacedim>
868 std::ostringstream namebuf;
869 namebuf <<
"FE_SimplexDGP<" << dim <<
">(" << this->degree <<
")";
871 return namebuf.str();
875template <
int dim,
int spacedim>
879 const unsigned int codim)
const
896 if (this->degree < fe_dgp_other->degree)
898 else if (this->degree == fe_dgp_other->degree)
906 if (this->degree < fe_dgq_other->degree)
908 else if (this->degree == fe_dgq_other->degree)
916 if (fe_nothing->is_dominating())
931template <
int dim,
int spacedim>
932std::vector<std::pair<unsigned int, unsigned int>>
943template <
int dim,
int spacedim>
944std::vector<std::pair<unsigned int, unsigned int>>
954#include "fe_simplex_p.inst"
static BarycentricPolynomials< dim > get_fe_p_basis(const unsigned int degree)
FiniteElementDomination::Domination compare_for_domination(const FiniteElement< dim, spacedim > &fe_other, const unsigned int codim) const override
std::string get_name() const override
std::vector< std::pair< unsigned int, unsigned int > > hp_line_dof_identities(const FiniteElement< dim, spacedim > &fe_other) const override
std::vector< std::pair< unsigned int, unsigned int > > hp_vertex_dof_identities(const FiniteElement< dim, spacedim > &fe_other) const override
FE_SimplexDGP(const unsigned int degree)
std::unique_ptr< FiniteElement< dim, spacedim > > clone() const override
FE_SimplexP(const unsigned int degree)
std::vector< std::pair< unsigned int, unsigned int > > hp_line_dof_identities(const FiniteElement< dim, spacedim > &fe_other) const override
FiniteElementDomination::Domination compare_for_domination(const FiniteElement< dim, spacedim > &fe_other, const unsigned int codim) const override
std::vector< std::pair< unsigned int, unsigned int > > hp_vertex_dof_identities(const FiniteElement< dim, spacedim > &fe_other) const override
std::string get_name() const override
std::unique_ptr< FiniteElement< dim, spacedim > > clone() const override
virtual std::pair< Table< 2, bool >, std::vector< unsigned int > > get_constant_modes() const override
void get_subface_interpolation_matrix(const FiniteElement< dim, spacedim > &x_source_fe, const unsigned int subface, FullMatrix< double > &interpolation_matrix, const unsigned int face_no) 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 void convert_generalized_support_point_values_to_dof_values(const std::vector< Vector< double > > &support_point_values, std::vector< double > &nodal_values) const override
bool hp_constraints_are_implemented() const override
FE_SimplexPoly(const BarycentricPolynomials< dim > polynomials, const FiniteElementData< dim > &fe_data, const std::vector< Point< dim > > &unit_support_points, const std::vector< std::vector< Point< dim - 1 > > > unit_face_support_points, const FullMatrix< double > &interface_constraints)
virtual const FullMatrix< double > & get_prolongation_matrix(const unsigned int child, const RefinementCase< dim > &refinement_case=RefinementCase< dim >::isotropic_refinement) const override
void get_face_interpolation_matrix(const FiniteElement< dim, spacedim > &source_fe, FullMatrix< double > &interpolation_matrix, const unsigned int face_no) const override
unsigned int n_dofs_per_face(unsigned int face_no=0, unsigned int child=0) const
unsigned int n_unique_faces() const
std::vector< std::vector< Point< dim - 1 > > > unit_face_support_points
const std::vector< Point< dim - 1 > > & get_unit_face_support_points(const unsigned int face_no=0) const
std::vector< Point< dim > > unit_support_points
FullMatrix< double > interface_constraints
static void project_to_subface(const SubQuadrature &quadrature, const unsigned int face_no, const unsigned int subface_no, std::vector< Point< dim > > &q_points, const RefinementCase< dim - 1 > &ref_case=RefinementCase< dim - 1 >::isotropic_refinement)
static void project_to_face(const SubQuadrature &quadrature, const unsigned int face_no, std::vector< Point< dim > > &q_points)
unsigned int n_vertices() const
unsigned int n_faces() const
unsigned int n_lines() const
#define DEAL_II_NAMESPACE_OPEN
#define DEAL_II_NAMESPACE_CLOSE
static ::ExceptionBase & ExcNotImplemented()
#define Assert(cond, exc)
static ::ExceptionBase & ExcImpossibleInDim(int arg1)
#define AssertDimension(dim1, dim2)
static ::ExceptionBase & ExcInternalError()
static ::ExceptionBase & ExcDimensionMismatch(std::size_t arg1, std::size_t arg2)
#define AssertThrow(cond, exc)
@ either_element_can_dominate
@ other_element_dominates
@ neither_element_dominates
constexpr const ReferenceCell Tetrahedron
constexpr const ReferenceCell Triangle
constexpr const ReferenceCell Line