51 get_QGaussLobatto_points(
const unsigned int degree)
56 return std::vector<Point<1>>(1,
Point<1>(0.5));
64template <
int dim,
int spacedim>
98template <
int dim,
int spacedim>
105 polynomials.size() - 1,
108 polynomials.size() - 1),
110 polynomials.size() - 1)
116 polynomials.size() - 1)
130template <
int dim,
int spacedim>
138 std::ostringstream namebuf;
140 << this->degree <<
")";
141 return namebuf.str();
146template <
int dim,
int spacedim>
150 std::vector<double> &nodal_values)
const
153 this->get_unit_support_points().size());
157 for (
unsigned int i = 0; i < this->n_dofs_per_cell(); ++i)
161 nodal_values[i] = support_point_values[i](0);
167template <
int dim,
int spacedim>
168std::unique_ptr<FiniteElement<dim, spacedim>>
171 return std::make_unique<FE_DGQ<dim, spacedim>>(*this);
180template <
int dim,
int spacedim>
181std::vector<unsigned int>
184 std::vector<unsigned int> dpo(dim + 1, 0U);
186 for (
unsigned int i = 1; i < dim; ++i)
193template <
int dim,
int spacedim>
196 const char direction)
const
198 const unsigned int n = this->degree + 1;
200 for (
unsigned int i = 1; i < dim; ++i)
209 for (
unsigned int i = n; i > 0;)
219 for (
unsigned int iz = 0; iz < ((dim > 2) ? n : 1); ++iz)
220 for (
unsigned int j = 0; j < n; ++j)
221 for (
unsigned int i = 0; i < n; ++i)
223 unsigned int k = n * i - j + n - 1 + n * n * iz;
230 for (
unsigned int iz = 0; iz < ((dim > 2) ? n : 1); ++iz)
231 for (
unsigned int iy = 0; iy < n; ++iy)
232 for (
unsigned int ix = 0; ix < n; ++ix)
234 unsigned int k = n * ix - iy + n - 1 + n * n * iz;
242 for (
unsigned int iz = 0; iz < n; ++iz)
243 for (
unsigned int iy = 0; iy < n; ++iy)
244 for (
unsigned int ix = 0; ix < n; ++ix)
246 unsigned int k = n * (n * iy - iz + n - 1) + ix;
254 for (
unsigned int iz = 0; iz < n; ++iz)
255 for (
unsigned int iy = 0; iy < n; ++iy)
256 for (
unsigned int ix = 0; ix < n; ++ix)
258 unsigned int k = n * (n * iy - iz + n - 1) + ix;
270template <
int dim,
int spacedim>
280 Assert(interpolation_matrix.
m() == this->n_dofs_per_cell(),
282 this->n_dofs_per_cell()));
283 Assert(interpolation_matrix.
n() == source_fe->n_dofs_per_cell(),
285 source_fe->n_dofs_per_cell()));
293 this->n_dofs_per_cell());
295 source_fe->n_dofs_per_cell());
297 source_fe->n_dofs_per_cell());
298 for (
unsigned int j = 0; j < this->n_dofs_per_cell(); ++j)
304 for (
unsigned int i = 0; i < this->n_dofs_per_cell(); ++i)
305 cell_interpolation(j, i) = this->poly_space->compute_value(i, p);
307 for (
unsigned int i = 0; i < source_fe->n_dofs_per_cell(); ++i)
308 source_interpolation(j, i) =
309 source_fe->poly_space->compute_value(i, p);
316 cell_interpolation.gauss_jordan();
317 cell_interpolation.mmult(interpolation_matrix, source_interpolation);
320 for (
unsigned int i = 0; i < this->n_dofs_per_cell(); ++i)
321 for (
unsigned int j = 0; j < source_fe->n_dofs_per_cell(); ++j)
322 if (std::fabs(interpolation_matrix(i, j)) < 1e-15)
323 interpolation_matrix(i, j) = 0.;
331 for (
unsigned int i = 0; i < this->n_dofs_per_cell(); ++i)
334 for (
unsigned int j = 0; j < source_fe->n_dofs_per_cell(); ++j)
335 sum += interpolation_matrix(i, j);
362 spacedim>::ExcInterpolationNotImplemented()));
367template <
int dim,
int spacedim>
372 const unsigned int)
const
380 (void)interpolation_matrix;
384 typename FE::ExcInterpolationNotImplemented());
386 Assert(interpolation_matrix.
m() == 0,
388 Assert(interpolation_matrix.
n() == 0,
394template <
int dim,
int spacedim>
400 const unsigned int)
const
408 (void)interpolation_matrix;
412 typename FE::ExcInterpolationNotImplemented());
414 Assert(interpolation_matrix.
m() == 0,
416 Assert(interpolation_matrix.
n() == 0,
422template <
int dim,
int spacedim>
425 const unsigned int child,
432 "Prolongation matrices are only available for refined cells!"));
436 if (this->prolongation[refinement_case - 1][child].n() == 0)
438 std::lock_guard<std::mutex> lock(prolongation_matrix_mutex);
441 if (this->prolongation[refinement_case - 1][child].n() ==
442 this->n_dofs_per_cell())
443 return this->prolongation[refinement_case - 1][child];
451 std::vector<std::vector<FullMatrix<double>>> isotropic_matrices(
453 isotropic_matrices.back().resize(
456 this->n_dofs_per_cell()));
466 std::move(isotropic_matrices.back());
493 return this->prolongation[refinement_case - 1][child];
498template <
int dim,
int spacedim>
501 const unsigned int child,
508 "Restriction matrices are only available for refined cells!"));
512 if (this->restriction[refinement_case - 1][child].n() == 0)
514 std::lock_guard<std::mutex> lock(restriction_matrix_mutex);
517 if (this->restriction[refinement_case - 1][child].n() ==
518 this->n_dofs_per_cell())
519 return this->restriction[refinement_case - 1][child];
527 std::vector<std::vector<FullMatrix<double>>> isotropic_matrices(
529 isotropic_matrices.back().resize(
532 this->n_dofs_per_cell()));
542 std::move(isotropic_matrices.back());
569 return this->restriction[refinement_case - 1][child];
574template <
int dim,
int spacedim>
583template <
int dim,
int spacedim>
584std::vector<std::pair<unsigned int, unsigned int>>
592 return std::vector<std::pair<unsigned int, unsigned int>>();
597template <
int dim,
int spacedim>
598std::vector<std::pair<unsigned int, unsigned int>>
606 return std::vector<std::pair<unsigned int, unsigned int>>();
611template <
int dim,
int spacedim>
612std::vector<std::pair<unsigned int, unsigned int>>
615 const unsigned int)
const
621 return std::vector<std::pair<unsigned int, unsigned int>>();
626template <
int dim,
int spacedim>
630 const unsigned int codim)
const
650 if (this->degree < fe_dgq_other->degree)
652 else if (this->degree == fe_dgq_other->degree)
660 if (this->degree < fe_q_other->degree)
662 else if (this->degree == fe_q_other->degree)
670 if (this->degree < fe_bernstein_other->degree)
672 else if (this->degree == fe_bernstein_other->degree)
680 if (this->degree < fe_bubbles_other->degree)
682 else if (this->degree == fe_bubbles_other->degree)
690 if (this->degree < fe_dg0_other->degree)
692 else if (this->degree == fe_dg0_other->degree)
700 if (this->degree < fe_q_iso_q1_other->degree)
702 else if (this->degree == fe_q_iso_q1_other->degree)
710 if (this->degree < fe_hierarchical_other->degree)
712 else if (this->degree == fe_hierarchical_other->degree)
720 if (this->degree < fe_dgp_other->degree)
722 else if (this->degree == fe_dgp_other->degree)
730 if (fe_nothing->is_dominating())
745template <
int dim,
int spacedim>
748 const unsigned int face_index)
const
753 unsigned int n = this->degree + 1;
758 if (this->unit_support_points.empty())
764 bool support_points_on_boundary =
true;
765 for (
unsigned int d = 0; d < dim; ++d)
766 if (
std::abs(this->unit_support_points[0][d]) > 1e-13)
767 support_points_on_boundary =
false;
768 for (
unsigned int d = 0; d < dim; ++d)
769 if (
std::abs(this->unit_support_points.back()[d] - 1.) > 1e-13)
770 support_points_on_boundary =
false;
771 if (support_points_on_boundary ==
false)
774 unsigned int n2 = n * n;
786 return (((shape_index == 0) && (face_index == 0)) ||
787 ((shape_index == this->degree) && (face_index == 1)));
792 if (face_index == 0 && (shape_index % n) == 0)
794 if (face_index == 1 && (shape_index % n) == this->degree)
796 if (face_index == 2 && shape_index < n)
798 if (face_index == 3 && shape_index >= this->n_dofs_per_cell() - n)
805 const unsigned int in2 = shape_index % n2;
808 if (face_index == 0 && (shape_index % n) == 0)
811 if (face_index == 1 && (shape_index % n) == n - 1)
814 if (face_index == 2 && in2 < n)
817 if (face_index == 3 && in2 >= n2 - n)
820 if (face_index == 4 && shape_index < n2)
823 if (face_index == 5 && shape_index >= this->n_dofs_per_cell() - n2)
836template <
int dim,
int spacedim>
837std::pair<Table<2, bool>, std::vector<unsigned int>>
841 constant_modes.fill(
true);
842 return std::pair<Table<2, bool>, std::vector<unsigned int>>(
843 constant_modes, std::vector<unsigned int>(1, 0));
850template <
int dim,
int spacedim>
854 Polynomials::generate_complete_Lagrange_basis(points.get_points()))
863template <
int dim,
int spacedim>
869 std::ostringstream namebuf;
870 bool equidistant =
true;
871 std::vector<double> points(this->degree + 1);
873 const auto *
const polynomial_space =
876 std::vector<unsigned int> lexicographic =
877 polynomial_space->get_numbering_inverse();
878 for (
unsigned int j = 0; j <= this->degree; ++j)
879 points[j] = this->unit_support_points[lexicographic[j]][0];
882 for (
unsigned int j = 0; j <= this->degree; ++j)
883 if (
std::abs(points[j] -
static_cast<double>(j) / this->degree) > 1e-15)
888 if (this->degree == 0 &&
std::abs(points[0] - 0.5) < 1e-15)
891 if (equidistant ==
true)
893 if (this->degree > 2)
894 namebuf <<
"FE_DGQArbitraryNodes<"
896 <<
">(QIterated(QTrapezoid()," << this->degree <<
"))";
899 << this->degree <<
")";
900 return namebuf.str();
905 bool gauss_lobatto =
true;
906 for (
unsigned int j = 0; j <= this->degree; ++j)
907 if (points[j] != points_gl.point(j)[0])
909 gauss_lobatto =
false;
913 if (gauss_lobatto ==
true)
916 << this->degree <<
")";
917 return namebuf.str();
921 const QGauss<1> points_g(this->degree + 1);
923 for (
unsigned int j = 0; j <= this->degree; ++j)
924 if (points[j] != points_g.point(j)[0])
933 <<
">(QGauss(" << this->degree + 1 <<
"))";
934 return namebuf.str();
939 bool gauss_log =
true;
940 for (
unsigned int j = 0; j <= this->degree; ++j)
941 if (points[j] != points_glog.point(j)[0])
947 if (gauss_log ==
true)
950 <<
">(QGaussLog(" << this->degree + 1 <<
"))";
951 return namebuf.str();
956 <<
">(QUnknownNodes(" << this->degree + 1 <<
"))";
957 return namebuf.str();
962template <
int dim,
int spacedim>
967 std::vector<double> &nodal_values)
const
970 this->get_unit_support_points().size());
974 for (
unsigned int i = 0; i < this->n_dofs_per_cell(); ++i)
978 nodal_values[i] = support_point_values[i](0);
984template <
int dim,
int spacedim>
985std::unique_ptr<FiniteElement<dim, spacedim>>
989 std::vector<Point<1>> qpoints(this->degree + 1);
990 const auto *
const polynomial_space =
993 std::vector<unsigned int> lexicographic =
994 polynomial_space->get_numbering_inverse();
995 for (
unsigned int i = 0; i <= this->degree; ++i)
996 qpoints[i] =
Point<1>(this->unit_support_points[lexicographic[i]][0]);
999 return std::make_unique<FE_DGQArbitraryNodes<dim, spacedim>>(pquadrature);
1006template <
int dim,
int spacedim>
1009 Polynomials::Legendre::generate_complete_basis(degree))
1014template <
int dim,
int spacedim>
1015std::pair<Table<2, bool>, std::vector<unsigned int>>
1021 constant_modes(0, 0) =
true;
1022 return std::pair<Table<2, bool>, std::vector<unsigned int>>(
1023 constant_modes, std::vector<unsigned int>(1, 0));
1028template <
int dim,
int spacedim>
1038template <
int dim,
int spacedim>
1039std::unique_ptr<FiniteElement<dim, spacedim>>
1042 return std::make_unique<FE_DGQLegendre<dim, spacedim>>(this->degree);
1049template <
int dim,
int spacedim>
1052 Polynomials::HermiteLikeInterpolation::generate_complete_basis(degree))
1057template <
int dim,
int spacedim>
1067template <
int dim,
int spacedim>
1068std::unique_ptr<FiniteElement<dim, spacedim>>
1071 return std::make_unique<FE_DGQHermite<dim, spacedim>>(this->degree);
1077#include "fe_dgq.inst"
virtual std::string get_name() const override
FE_DGQArbitraryNodes(const Quadrature< 1 > &points)
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 std::unique_ptr< FiniteElement< dim, spacedim > > clone() const override
virtual std::string get_name() const override
FE_DGQHermite(const unsigned int degree)
virtual std::unique_ptr< FiniteElement< dim, spacedim > > clone() const override
virtual std::pair< Table< 2, bool >, std::vector< unsigned int > > get_constant_modes() const override
FE_DGQLegendre(const unsigned int degree)
virtual std::string get_name() const override
virtual std::unique_ptr< FiniteElement< dim, spacedim > > clone() const override
virtual bool has_support_on_face(const unsigned int shape_index, const unsigned int face_index) const override
virtual bool hp_constraints_are_implemented() const override
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
static std::vector< unsigned int > get_dpo_vector(const unsigned int degree)
virtual std::pair< Table< 2, bool >, std::vector< unsigned int > > get_constant_modes() 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 get_face_interpolation_matrix(const FiniteElement< dim, spacedim > &source, FullMatrix< double > &matrix, const unsigned int face_no=0) const override
virtual FiniteElementDomination::Domination compare_for_domination(const FiniteElement< dim, spacedim > &fe_other, const unsigned int codim=0) const override final
virtual std::vector< std::pair< unsigned int, unsigned int > > hp_vertex_dof_identities(const FiniteElement< dim, spacedim > &fe_other) const override
virtual std::string get_name() const override
void rotate_indices(std::vector< unsigned int > &indices, const char direction) const
virtual std::vector< std::pair< unsigned int, unsigned int > > hp_line_dof_identities(const FiniteElement< dim, spacedim > &fe_other) 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
virtual std::unique_ptr< FiniteElement< dim, spacedim > > clone() 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 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 void get_interpolation_matrix(const FiniteElement< dim, spacedim > &source, FullMatrix< double > &matrix) const override
const unsigned int degree
unsigned int n_dofs_per_cell() const
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< Point< dim > > unit_support_points
std::vector< std::vector< FullMatrix< double > > > prolongation
const std::vector< Point< dim > > & get_points() const
unsigned int size() const
#define DEAL_II_NAMESPACE_OPEN
#define DEAL_II_NAMESPACE_CLOSE
#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)
#define DEAL_II_NOT_IMPLEMENTED()
@ either_element_can_dominate
@ other_element_dominates
@ neither_element_dominates
Tensor< 2, dim, Number > l(const Tensor< 2, dim, Number > &F, const Tensor< 2, dim, Number > &dF_dt)
std::string dim_string(const int dim, const int spacedim)
std::string int_to_string(const unsigned int value, const unsigned int digits=numbers::invalid_unsigned_int)
::VectorizedArray< Number, width > max(const ::VectorizedArray< Number, width > &, const ::VectorizedArray< Number, width > &)
::VectorizedArray< Number, width > abs(const ::VectorizedArray< Number, width > &)