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();
94 const auto reference_cell = ReferenceCells::get_simplex<dim>();
99 unit_points.emplace_back(reference_cell.template barycenter<dim>());
105 unit_points.emplace_back(reference_cell.template vertex<dim>(vertex_no));
108 for (
const auto &line_no : reference_cell.line_indices())
110 const auto v0 = reference_cell.template vertex<dim>(
111 reference_cell.line_to_cell_vertices(line_no, 0));
112 const auto v1 = reference_cell.template vertex<dim>(
113 reference_cell.line_to_cell_vertices(line_no, 1));
114 unit_points.emplace_back((
v0 +
v1) / 2.0);
125 std::vector<std::vector<
Point<dim - 1>>>
126 unit_face_support_points_fe_p(
127 const unsigned int degree,
138 std::vector<std::vector<
Point<dim - 1>>> unit_face_points;
144 unit_face_points.emplace_back(
145 unit_support_points_fe_p<dim - 1>(degree));
148 return unit_face_points;
158 constraints_fe_p(
const unsigned int )
167 constraints_fe_p<2>(
const unsigned int degree)
169 const unsigned int dim = 2;
179 std::vector<
Point<dim - 1>> constraint_points;
181 constraint_points.emplace_back(0.5);
185 constraint_points.emplace_back(0.25);
187 constraint_points.emplace_back(0.75);
193 const unsigned int n_dofs_constrained = constraint_points.size();
194 unsigned int n_dofs_per_face = degree + 1;
200 for (
unsigned int i = 0; i < n_dofs_constrained; ++i)
201 for (
unsigned int j = 0; j < n_dofs_per_face; ++j)
203 interface_constraints(i, j) =
204 poly.compute_value(j, constraint_points[i]);
210 if (std::fabs(interface_constraints(i, j)) < 1e-13)
211 interface_constraints(i, j) = 0;
213 return interface_constraints;
222 std::vector<unsigned int>
223 get_dpo_vector_fe_dgp(
const unsigned int dim,
const unsigned int degree)
228 std::vector<unsigned int> dpo(dim + 1, 0U);
239 const auto continuous_dpo = get_dpo_vector_fe_p(dim, degree);
246 continuous_dpo[dim]};
254 continuous_dpo[dim]};
264 continuous_dpo[dim]};
275template <
int dim,
int spacedim>
279 const std::vector<
Point<dim>> & unit_support_points,
280 const std::vector<std::vector<
Point<dim - 1>>> unit_face_support_points,
285 std::vector<
bool>(fe_data.dofs_per_cell),
296template <
int dim,
int spacedim>
297std::pair<Table<2, bool>, std::vector<unsigned int>>
301 constant_modes.fill(
true);
302 return std::pair<Table<2, bool>, std::vector<unsigned int>>(
303 constant_modes, std::vector<unsigned int>(1, 0));
308template <
int dim,
int spacedim>
311 const unsigned int child,
319 if (this->prolongation[refinement_case - 1][child].n() == 0)
321 std::lock_guard<std::mutex> lock(this->mutex);
324 if (this->prolongation[refinement_case - 1][child].n() ==
325 this->n_dofs_per_cell())
326 return this->prolongation[refinement_case - 1][child];
332 std::vector<std::vector<FullMatrix<double>>> isotropic_matrices(
334 isotropic_matrices.back().resize(
340 this_nonconst.prolongation[refinement_case - 1].swap(
341 isotropic_matrices.back());
345 return this->prolongation[refinement_case - 1][child];
350template <
int dim,
int spacedim>
353 const unsigned int child,
361 if (this->restriction[refinement_case - 1][child].n() == 0)
363 std::lock_guard<std::mutex> lock(this->mutex);
366 if (this->restriction[refinement_case - 1][child].n() ==
367 this->n_dofs_per_cell())
368 return this->restriction[refinement_case - 1][child];
374 std::vector<std::vector<FullMatrix<double>>> isotropic_matrices(
376 isotropic_matrices.back().resize(
382 this_nonconst.restriction[refinement_case - 1].swap(
383 isotropic_matrices.back());
387 return this->restriction[refinement_case - 1][child];
392template <
int dim,
int spacedim>
397 const unsigned int face_no)
const
411 const double eps = 2e-13 * this->degree * (dim - 1);
413 std::vector<Point<dim>> face_quadrature_points(quad_face_support.size());
417 face_quadrature_points);
420 for (
unsigned int j = 0; j < this->n_dofs_per_face(face_no); ++j)
422 double matrix_entry =
423 this->shape_value(this->face_to_cell_index(j, 0),
424 face_quadrature_points[i]);
429 if (std::fabs(matrix_entry - 1.0) < eps)
431 if (std::fabs(matrix_entry) < eps)
434 interpolation_matrix(i, j) = matrix_entry;
442 for (
unsigned int i = 0; i < this->n_dofs_per_face(face_no); ++i)
443 sum += interpolation_matrix(j, i);
457 spacedim>::ExcInterpolationNotImplemented()));
462template <
int dim,
int spacedim>
466 const unsigned int subface,
468 const unsigned int face_no)
const
482 const double eps = 2e-13 * this->degree * (dim - 1);
484 std::vector<Point<dim>> subface_quadrature_points(
485 quad_face_support.size());
490 subface_quadrature_points);
493 for (
unsigned int j = 0; j < this->n_dofs_per_face(face_no); ++j)
495 double matrix_entry =
496 this->shape_value(this->face_to_cell_index(j, 0),
497 subface_quadrature_points[i]);
502 if (std::fabs(matrix_entry - 1.0) < eps)
504 if (std::fabs(matrix_entry) < eps)
507 interpolation_matrix(i, j) = matrix_entry;
515 for (
unsigned int i = 0; i < this->n_dofs_per_face(face_no); ++i)
516 sum += interpolation_matrix(j, i);
530 spacedim>::ExcInterpolationNotImplemented()));
535template <
int dim,
int spacedim>
544template <
int dim,
int spacedim>
549 std::vector<double> & nodal_values)
const
552 this->get_unit_support_points().size());
556 for (
unsigned int i = 0; i < this->dofs_per_cell; ++i)
560 nodal_values[i] = support_point_values[i](0);
566template <
int dim,
int spacedim>
575 unit_support_points_fe_p<dim>(degree),
577 constraints_fe_p<dim>(degree))
582template <
int dim,
int spacedim>
583std::unique_ptr<FiniteElement<dim, spacedim>>
586 return std::make_unique<FE_SimplexP<dim, spacedim>>(*this);
591template <
int dim,
int spacedim>
595 std::ostringstream namebuf;
596 namebuf <<
"FE_SimplexP<" << dim <<
">(" << this->degree <<
")";
598 return namebuf.str();
603template <
int dim,
int spacedim>
607 const unsigned int codim)
const
628 if (this->degree < fe_p_other->degree)
630 else if (this->degree == fe_p_other->degree)
638 if (this->degree < fe_q_other->degree)
640 else if (this->degree == fe_q_other->degree)
648 if (fe_nothing->is_dominating())
663template <
int dim,
int spacedim>
664std::vector<std::pair<unsigned int, unsigned int>>
708template <
int dim,
int spacedim>
709std::vector<std::pair<unsigned int, unsigned int>>
725 std::vector<std::pair<unsigned int, unsigned int>> identities;
727 for (
unsigned int i = 0; i < this->degree - 1; ++i)
728 for (
unsigned int j = 0; j < fe_p_other->degree - 1; ++j)
729 if (std::fabs(this->unit_support_points[i + 3][0] -
730 fe_p_other->unit_support_points[i + 3][0]) < 1e-14)
731 identities.emplace_back(i, j);
759 const std::vector<unsigned int> &index_map_inverse_q_other =
760 fe_q_other->get_poly_space_numbering_inverse();
762 std::vector<std::pair<unsigned int, unsigned int>> identities;
764 for (
unsigned int i = 0; i < this->degree - 1; ++i)
765 for (
unsigned int j = 0; j < fe_q_other->degree - 1; ++j)
766 if (std::fabs(this->unit_support_points[i + 3][0] -
767 fe_q_other->get_unit_support_points()
768 [index_map_inverse_q_other[j + 1]][0]) < 1e-14)
769 identities.emplace_back(i, j);
812template <
int dim,
int spacedim>
821 unit_support_points_fe_p<dim>(degree),
823 constraints_fe_p<dim>(degree))
828template <
int dim,
int spacedim>
829std::unique_ptr<FiniteElement<dim, spacedim>>
832 return std::make_unique<FE_SimplexDGP<dim, spacedim>>(*this);
837template <
int dim,
int spacedim>
841 std::ostringstream namebuf;
842 namebuf <<
"FE_SimplexDGP<" << dim <<
">(" << this->degree <<
")";
844 return namebuf.str();
848template <
int dim,
int spacedim>
852 const unsigned int codim)
const
869 if (this->degree < fe_dgp_other->degree)
871 else if (this->degree == fe_dgp_other->degree)
879 if (this->degree < fe_dgq_other->degree)
881 else if (this->degree == fe_dgq_other->degree)
889 if (fe_nothing->is_dominating())
904template <
int dim,
int spacedim>
905std::vector<std::pair<unsigned int, unsigned int>>
916template <
int dim,
int spacedim>
917std::vector<std::pair<unsigned int, unsigned int>>
927#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 ReferenceCell &reference_cell, 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 ReferenceCell &reference_cell, 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
constexpr const ReferenceCell & get_simplex()