17 #include <deal.II/base/quadrature.h> 18 #include <deal.II/base/qprojector.h> 19 #include <deal.II/base/template_constraints.h> 20 #include <deal.II/base/tensor_product_polynomials.h> 21 #include <deal.II/base/tensor_product_polynomials_const.h> 22 #include <deal.II/base/tensor_product_polynomials_bubbles.h> 23 #include <deal.II/base/polynomials_piecewise.h> 24 #include <deal.II/fe/fe_q_base.h> 25 #include <deal.II/fe/fe_dgq.h> 26 #include <deal.II/fe/fe_dgp.h> 27 #include <deal.II/fe/fe_nothing.h> 28 #include <deal.II/fe/fe_tools.h> 29 #include <deal.II/base/quadrature_lib.h> 33 #include <deal.II/base/std_cxx14/memory.h> 35 DEAL_II_NAMESPACE_OPEN
47 std::vector<unsigned int>
48 face_lexicographic_to_hierarchic_numbering (
const unsigned int degree)
50 std::vector<unsigned int> dpo(dim, 1U);
51 for (
unsigned int i=1; i<dpo.size(); ++i)
52 dpo[i]=dpo[i-1]*(degree-1);
53 const ::FiniteElementData<dim-1> face_data(dpo,1,degree);
54 std::vector<unsigned int> face_renumber (face_data.dofs_per_cell);
62 std::vector<unsigned int>
63 face_lexicographic_to_hierarchic_numbering<1> (
const unsigned int)
65 return std::vector<unsigned int>();
76 zero_indices (
unsigned int (&indices)[dim])
78 for (
unsigned int d=0;
d<dim; ++
d)
90 increment_indices (
unsigned int (&indices)[dim],
91 const unsigned int dofs1d)
94 for (
int d=0;
d<dim-1; ++
d)
95 if (indices[d]==dofs1d)
111 template <
class PolynomialType,
int xdim,
int xspacedim>
118 template <
int spacedim>
127 template <
int spacedim>
132 const unsigned int dim = 2;
134 unsigned int q_deg = fe.
degree;
182 std::vector<
Point<dim-1> > constraint_points;
184 constraint_points.emplace_back(0.5);
188 const unsigned int n=q_deg-1;
189 const double step=1./q_deg;
191 for (
unsigned int i=1; i<=n; ++i)
192 constraint_points.push_back (
195 for (
unsigned int i=1; i<=n; ++i)
196 constraint_points.push_back (
208 const std::vector<unsigned int> &index_map_inverse =
210 const std::vector<unsigned int> face_index_map =
211 internal::FE_Q_Base::face_lexicographic_to_hierarchic_numbering<dim>(q_deg);
216 for (
unsigned int i=0; i<constraint_points.size(); ++i)
217 for (
unsigned int j=0; j<q_deg+1; ++j)
220 p[0] = constraint_points[i](0);
222 fe.
poly_space.compute_value(index_map_inverse[j], p);
234 template <
int spacedim>
239 const unsigned int dim = 3;
241 unsigned int q_deg = fe.
degree;
260 std::vector<
Point<dim-1> > constraint_points;
263 constraint_points.emplace_back(0.5, 0.5);
266 constraint_points.emplace_back(0, 0.5);
267 constraint_points.emplace_back(1, 0.5);
268 constraint_points.emplace_back(0.5, 0);
269 constraint_points.emplace_back(0.5, 1);
273 const unsigned int n=q_deg-1;
274 const double step=1./q_deg;
275 std::vector<
Point<dim-2> > line_support_points(n);
276 for (
unsigned int i=0; i<n; ++i)
277 line_support_points[i](0)=(i+1)*step;
281 std::vector<
Point<dim-1> > p_line(n);
287 for (
unsigned int i=0; i<n; ++i)
288 constraint_points.push_back (p_line[i] +
Point<dim-1> (0.5, 0));
291 for (
unsigned int i=0; i<n; ++i)
292 constraint_points.push_back (p_line[i] +
Point<dim-1> (0.5, 0));
295 for (
unsigned int i=0; i<n; ++i)
296 constraint_points.push_back (p_line[i] +
Point<dim-1> (0, 0.5));
299 for (
unsigned int i=0; i<n; ++i)
300 constraint_points.push_back (p_line[i] +
Point<dim-1> (0, 0.5));
303 for (
unsigned int face=0; face<
GeometryInfo<dim-1>::faces_per_cell; ++face)
304 for (
unsigned int subface=0;
305 subface<
GeometryInfo<dim-1>::max_children_per_face; ++subface)
308 constraint_points.insert(constraint_points.end(),
309 p_line.begin(), p_line.end());
313 std::vector<
Point<dim-1> > inner_points(n*n);
314 for (
unsigned int i=0, iy=1; iy<=n; ++iy)
315 for (
unsigned int ix=1; ix<=n; ++ix)
319 for (
unsigned int child=0;
320 child<
GeometryInfo<dim-1>::max_children_per_cell; ++child)
321 for (
unsigned int i=0; i<inner_points.size(); ++i)
322 constraint_points.push_back (
328 const unsigned int pnts=(q_deg+1)*(q_deg+1);
332 const std::vector<unsigned int> &index_map_inverse =
334 const std::vector<unsigned int> face_index_map =
335 internal::FE_Q_Base::face_lexicographic_to_hierarchic_numbering<dim>(q_deg);
343 for (
unsigned int i=0; i<constraint_points.size(); ++i)
345 const double interval = (double) (q_deg * 2);
346 bool mirror[dim - 1];
358 for (
unsigned int k=0; k<dim-1; ++k)
360 const int coord_int =
361 static_cast<int> (constraint_points[i](k) * interval + 0.25);
362 constraint_point(k) = 1.*coord_int / interval;
384 mirror[k] = (constraint_point(k) > 0.5);
386 constraint_point(k) = 1.0 - constraint_point(k);
389 for (
unsigned int j=0; j<pnts; ++j)
391 unsigned int indices[2] = { j % (q_deg+1), j / (q_deg+1) };
393 for (
unsigned int k = 0; k<2; ++k)
395 indices[k] = q_deg - indices[k];
398 new_index = indices[1] * (q_deg + 1) + indices[0];
401 fe.
poly_space.compute_value (index_map_inverse[new_index],
417 template <
class PolynomialType,
int dim,
int spacedim>
419 (
const PolynomialType &poly_space,
421 const std::vector<bool> &restriction_is_additive_flags)
424 std::vector<ComponentMask>(1, std::vector<bool>(1,
true))),
432 template <
class PolynomialType,
int dim,
int spacedim>
436 Assert (points[0][0] == 0,
437 ExcMessage (
"The first support point has to be zero."));
438 Assert (points.back()[0] == 1,
439 ExcMessage (
"The last support point has to be one."));
444 const unsigned int q_dofs_per_cell = Utilities::fixed_power<dim>(q_degree+1);
445 Assert(q_dofs_per_cell == this->dofs_per_cell ||
446 q_dofs_per_cell+1 == this->dofs_per_cell ||
450 std::vector<unsigned int> renumber(q_dofs_per_cell);
454 for (
unsigned int i= q_dofs_per_cell; i<this->dofs_per_cell; ++i)
455 renumber.push_back(i);
456 this->poly_space.set_numbering(renumber);
463 tasks +=
Threads::new_task ([&]() { initialize_unit_face_support_points (points); });
465 tasks +=
Threads::new_task ([&]() { this->initialize_quad_dof_index_permutation(); });
475 template <
class PolynomialType,
int dim,
int spacedim>
486 Assert (interpolation_matrix.
m() == this->dofs_per_cell,
488 this->dofs_per_cell));
494 const unsigned int q_dofs_per_cell = Utilities::fixed_power<dim>(q_degree+1);
495 const unsigned int source_q_dofs_per_cell = Utilities::fixed_power<dim>(source_fe->degree+1);
501 for (
unsigned int j=0; j<q_dofs_per_cell; ++j)
504 const Point<dim> p = this->unit_support_points[j];
508 Assert(std::abs(this->poly_space.compute_value (j, p)-1.)<1e-13,
511 for (
unsigned int i=0; i<source_q_dofs_per_cell; ++i)
512 interpolation_matrix(j,i) = source_fe->poly_space.compute_value (i, p);
516 if (q_dofs_per_cell < this->dofs_per_cell)
519 for (
unsigned int i=0; i<source_q_dofs_per_cell; ++i)
520 interpolation_matrix(q_dofs_per_cell, i) = 0.;
521 for (
unsigned int j=0; j<q_dofs_per_cell; ++j)
522 interpolation_matrix(j, source_q_dofs_per_cell) = 0.;
523 interpolation_matrix(q_dofs_per_cell, source_q_dofs_per_cell) = 1.;
527 const double eps = 2e-13*q_degree*dim;
528 for (
unsigned int i=0; i<this->dofs_per_cell; ++i)
529 for (
unsigned int j=0; j<source_fe->dofs_per_cell; ++j)
530 if (std::fabs(interpolation_matrix(i,j)) < eps)
531 interpolation_matrix(i,j) = 0.;
535 for (
unsigned int i=0; i<this->dofs_per_cell; ++i)
538 for (
unsigned int j=0; j<source_fe->dofs_per_cell; ++j)
539 sum += interpolation_matrix(i,j);
569 template <
class PolynomialType,
int dim,
int spacedim>
577 interpolation_matrix);
582 template <
class PolynomialType,
int dim,
int spacedim>
586 const unsigned int subface,
599 Assert (interpolation_matrix.
n() == this->dofs_per_face,
601 this->dofs_per_face));
608 Assert (this->dofs_per_face <= source_fe->dofs_per_face,
610 ExcInterpolationNotImplemented ()));
614 quad_face_support (source_fe->get_unit_face_support_points ());
619 double eps = 2e-13*q_degree*(dim-1);
632 for (
unsigned int i=0; i<source_fe->dofs_per_face; ++i)
634 const Point<dim> &p = subface_quadrature.point (i);
636 for (
unsigned int j=0; j<this->dofs_per_face; ++j)
638 double matrix_entry = this->shape_value (this->face_to_cell_index(j, 0), p);
643 if (std::fabs (matrix_entry - 1.0) < eps)
645 if (std::fabs (matrix_entry) < eps)
648 interpolation_matrix(i,j) = matrix_entry;
654 for (
unsigned int j=0; j<source_fe->dofs_per_face; ++j)
658 for (
unsigned int i=0; i<this->dofs_per_face; ++i)
659 sum += interpolation_matrix(j,i);
664 else if (
dynamic_cast<const FE_Nothing<dim> *
>(&x_source_fe) !=
nullptr)
670 ExcInterpolationNotImplemented()));
675 template <
class PolynomialType,
int dim,
int spacedim>
685 template <
class PolynomialType,
int dim,
int spacedim>
686 std::vector<std::pair<unsigned int, unsigned int> >
697 std::vector<std::pair<unsigned int, unsigned int> >
698 (1, std::make_pair (0U, 0U));
704 return std::vector<std::pair<unsigned int, unsigned int> > ();
715 return std::vector<std::pair<unsigned int, unsigned int> > ();
720 return std::vector<std::pair<unsigned int, unsigned int> > ();
726 template <
class PolynomialType,
int dim,
int spacedim>
727 std::vector<std::pair<unsigned int, unsigned int> >
744 const unsigned int p = this->degree;
745 const unsigned int q = fe_q_other->degree;
747 std::vector<std::pair<unsigned int, unsigned int> > identities;
749 const std::vector<unsigned int> &index_map_inverse=
750 this->poly_space.get_numbering_inverse();
751 const std::vector<unsigned int> &index_map_inverse_other=
752 fe_q_other->poly_space.get_numbering_inverse();
754 for (
unsigned int i=0; i<p-1; ++i)
755 for (
unsigned int j=0; j<q-1; ++j)
756 if (std::fabs(this->unit_support_points[index_map_inverse[i+1]][0]-
757 fe_q_other->unit_support_points[index_map_inverse_other[j+1]][0])
759 identities.emplace_back (i, j);
767 return std::vector<std::pair<unsigned int, unsigned int> > ();
778 return std::vector<std::pair<unsigned int, unsigned int> > ();
783 return std::vector<std::pair<unsigned int, unsigned int> > ();
789 template <
class PolynomialType,
int dim,
int spacedim>
790 std::vector<std::pair<unsigned int, unsigned int> >
804 const unsigned int p = this->degree;
805 const unsigned int q = fe_q_other->degree;
807 std::vector<std::pair<unsigned int, unsigned int> > identities;
809 const std::vector<unsigned int> &index_map_inverse=
810 this->poly_space.get_numbering_inverse();
811 const std::vector<unsigned int> &index_map_inverse_other=
812 fe_q_other->poly_space.get_numbering_inverse();
814 for (
unsigned int i1=0; i1<p-1; ++i1)
815 for (
unsigned int i2=0; i2<p-1; ++i2)
816 for (
unsigned int j1=0; j1<q-1; ++j1)
817 for (
unsigned int j2=0; j2<q-1; ++j2)
818 if ((std::fabs(this->unit_support_points[index_map_inverse[i1+1]][0]-
819 fe_q_other->unit_support_points[index_map_inverse_other[j1+1]][0])
822 (std::fabs(this->unit_support_points[index_map_inverse[i2+1]][0]-
823 fe_q_other->unit_support_points[index_map_inverse_other[j2+1]][0])
825 identities.emplace_back (i1*(p-1)+i2, j1*(q-1)+j2);
833 return std::vector<std::pair<unsigned int, unsigned int> > ();
844 return std::vector<std::pair<unsigned int, unsigned int> > ();
849 return std::vector<std::pair<unsigned int, unsigned int> > ();
855 template <
class PolynomialType,
int dim,
int spacedim>
863 if (this->degree < fe_q_other->degree)
865 else if (this->degree == fe_q_other->degree)
873 if (fe_nothing->is_dominating())
904 template <
class PolynomialType,
int dim,
int spacedim>
909 const std::vector<unsigned int> &index_map_inverse=
910 this->poly_space.get_numbering_inverse();
921 this->unit_support_points.resize(support_quadrature.
size());
922 for (
unsigned int k=0; k<support_quadrature.
size(); ++k)
923 this->unit_support_points[index_map_inverse[k]] = support_quadrature.
point(k);
928 template <
class PolynomialType,
int dim,
int spacedim>
936 this->unit_face_support_points.resize(Utilities::fixed_power<dim-1>(q_degree+1));
939 const std::vector<unsigned int> face_index_map =
940 internal::FE_Q_Base::face_lexicographic_to_hierarchic_numbering<dim>(q_degree);
947 const Quadrature<dim-1> support_quadrature(support_1d);
951 this->unit_face_support_points.resize(support_quadrature.size());
952 for (
unsigned int k=0; k<support_quadrature.size(); ++k)
953 this->unit_face_support_points[face_index_map[k]] = support_quadrature.point(k);
958 template <
class PolynomialType,
int dim,
int spacedim>
966 Assert (this->adjust_quad_dof_index_for_face_orientation_table.n_elements()==8*this->dofs_per_quad,
969 const unsigned int n=q_degree-1;
990 for (
unsigned int local=0; local<this->dofs_per_quad; ++local)
994 unsigned int i=local%n,
998 this->adjust_quad_dof_index_for_face_orientation_table(local,0)=j + i *n - local;
1000 this->adjust_quad_dof_index_for_face_orientation_table(local,1)=i + (n-1-j)*n - local;
1002 this->adjust_quad_dof_index_for_face_orientation_table(local,2)=(n-1-j) + (n-1-i)*n - local;
1004 this->adjust_quad_dof_index_for_face_orientation_table(local,3)=(n-1-i) + j *n - local;
1006 this->adjust_quad_dof_index_for_face_orientation_table(local,4)=0;
1008 this->adjust_quad_dof_index_for_face_orientation_table(local,5)=j + (n-1-i)*n - local;
1010 this->adjust_quad_dof_index_for_face_orientation_table(local,6)=(n-1-i) + (n-1-j)*n - local;
1012 this->adjust_quad_dof_index_for_face_orientation_table(local,7)=(n-1-j) + i *n - local;
1016 for (
unsigned int i=0; i<this->dofs_per_line; ++i)
1017 this->adjust_line_dof_index_for_line_orientation_table[i] = this->dofs_per_line-1-i - i;
1022 template <
class PolynomialType,
int dim,
int spacedim>
1026 const unsigned int face,
1027 const bool face_orientation,
1028 const bool face_flip,
1029 const bool face_rotation)
const 1031 Assert (face_index < this->dofs_per_face,
1047 if (face_index < this->first_face_line_index)
1052 const unsigned int face_vertex = face_index / this->dofs_per_vertex;
1053 const unsigned int dof_index_on_vertex = face_index % this->dofs_per_vertex;
1061 * this->dofs_per_vertex
1063 dof_index_on_vertex);
1065 else if (face_index < this->first_face_quad_index)
1070 const unsigned int index = face_index - this->first_face_line_index;
1072 const unsigned int face_line = index / this->dofs_per_line;
1073 const unsigned int dof_index_on_line = index % this->dofs_per_line;
1077 unsigned int adjusted_dof_index_on_line = 0;
1087 if (face_flip ==
false)
1088 adjusted_dof_index_on_line = dof_index_on_line;
1090 adjusted_dof_index_on_line = this->dofs_per_line - dof_index_on_line - 1;
1101 Assert ((this->dofs_per_line <= 1) ||
1102 ((face_orientation ==
true) &&
1103 (face_flip ==
false) &&
1104 (face_rotation ==
false)),
1106 adjusted_dof_index_on_line = dof_index_on_line;
1113 return (this->first_line_index
1118 * this->dofs_per_line
1120 adjusted_dof_index_on_line);
1128 const unsigned int index = face_index - this->first_face_quad_index;
1133 Assert ((this->dofs_per_quad <= 1) ||
1134 ((face_orientation ==
true) &&
1135 (face_flip ==
false) &&
1136 (face_rotation ==
false)),
1138 return (this->first_quad_index
1139 + face * this->dofs_per_quad
1147 template <
class PolynomialType,
int dim,
int spacedim>
1148 std::vector<unsigned int>
1152 AssertThrow(degree>0,
typename FEQ::ExcFEQCannotHaveDegree0());
1153 std::vector<unsigned int> dpo(dim+1, 1U);
1154 for (
unsigned int i=1; i<dpo.size(); ++i)
1155 dpo[i]=dpo[i-1]*(degree-1);
1161 template <
class PolynomialType,
int dim,
int spacedim>
1166 Implementation::initialize_constraints (points, *
this);
1171 template <
class PolynomialType,
int dim,
int spacedim>
1180 ExcMessage(
"Prolongation matrices are only available for refined cells!"));
1185 if (this->prolongation[refinement_case-1][child].n() == 0)
1190 if (this->prolongation[refinement_case-1][child].n() ==
1191 this->dofs_per_cell)
1192 return this->prolongation[refinement_case-1][child];
1195 const unsigned int q_dofs_per_cell = Utilities::fixed_power<dim>(q_degree+1);
1203 const double eps = 1e-15*q_degree*dim;
1208 for (
unsigned int i=0; i<q_dofs_per_cell; ++i)
1210 Assert (std::fabs (1.-this->poly_space.compute_value
1211 (i, this->unit_support_points[i])) < eps,
1213 "to one or zero in a nodal point. " 1214 "This typically indicates that the " 1215 "polynomial interpolation is " 1216 "ill-conditioned such that round-off " 1217 "prevents the sum to be one."));
1218 for (
unsigned int j=0; j<q_dofs_per_cell; ++j)
1220 Assert (std::fabs (this->poly_space.compute_value
1221 (i, this->unit_support_points[j])) < eps,
1223 "to one or zero in a nodal point. " 1224 "This typically indicates that the " 1225 "polynomial interpolation is " 1226 "ill-conditioned such that round-off " 1227 "prevents the sum to be one."));
1235 const unsigned int dofs1d = q_degree+1;
1236 std::vector<Table<2,double> >
1238 const std::vector<unsigned int> &index_map_inverse =
1239 this->poly_space.get_numbering_inverse();
1243 unsigned int step_size_diag = 0;
1245 unsigned int factor = 1;
1246 for (
unsigned int d=0; d<dim; ++d)
1248 step_size_diag += factor;
1257 for (
unsigned int j=0; j<dofs1d; ++j)
1259 const unsigned int diag_comp = index_map_inverse[j*step_size_diag];
1260 const Point<dim> p_subcell = this->unit_support_points[diag_comp];
1264 for (
unsigned int i=0; i<dofs1d; ++i)
1265 for (
unsigned int d=0; d<dim; ++d)
1269 point[0] = p_cell[d];
1270 const double cell_value =
1271 this->poly_space.compute_value(index_map_inverse[i], point);
1290 if (std::fabs(cell_value) < eps)
1291 subcell_evaluations[d](j,i) = 0;
1293 subcell_evaluations[d](j,i) = cell_value;
1299 unsigned int j_indices[dim];
1300 internal::FE_Q_Base::zero_indices<dim> (j_indices);
1301 for (
unsigned int j=0; j<q_dofs_per_cell; j+=dofs1d)
1303 unsigned int i_indices[dim];
1304 internal::FE_Q_Base::zero_indices<dim> (i_indices);
1305 for (
unsigned int i=0; i<q_dofs_per_cell; i+=dofs1d)
1307 double val_extra_dim = 1.;
1308 for (
unsigned int d=1; d<dim; ++d)
1309 val_extra_dim *= subcell_evaluations[d](j_indices[d-1],
1314 for (
unsigned int jj=0; jj<dofs1d; ++jj)
1316 const unsigned int j_ind = index_map_inverse[j+jj];
1317 for (
unsigned int ii=0; ii<dofs1d; ++ii)
1318 prolongate(j_ind,index_map_inverse[i+ii])
1319 = val_extra_dim * subcell_evaluations[0](jj,ii);
1324 internal::FE_Q_Base::increment_indices<dim> (i_indices, dofs1d);
1327 internal::FE_Q_Base::increment_indices<dim> (j_indices, dofs1d);
1332 if (q_dofs_per_cell < this->dofs_per_cell)
1333 prolongate(q_dofs_per_cell,q_dofs_per_cell) = 1.;
1338 for (
unsigned int row=0; row<this->dofs_per_cell; ++row)
1341 for (
unsigned int col=0; col<this->dofs_per_cell; ++col)
1342 sum += prolongate(row,col);
1344 std::max(eps, 5e-16*std::sqrt(this->dofs_per_cell)),
1346 "prolongation matrix do not add to one. " 1347 "This typically indicates that the " 1348 "polynomial interpolation is " 1349 "ill-conditioned such that round-off " 1350 "prevents the sum to be one."));
1356 (this->prolongation[refinement_case-1][child]));
1360 return this->prolongation[refinement_case-1][child];
1365 template <
class PolynomialType,
int dim,
int spacedim>
1374 ExcMessage(
"Restriction matrices are only available for refined cells!"));
1379 if (this->restriction[refinement_case-1][child].n() == 0)
1384 if (this->restriction[refinement_case-1][child].n() ==
1385 this->dofs_per_cell)
1386 return this->restriction[refinement_case-1][child];
1390 const unsigned int q_dofs_per_cell = Utilities::fixed_power<dim>(q_degree+1);
1410 const double eps = 1e-15*q_degree*dim;
1411 const std::vector<unsigned int> &index_map_inverse =
1412 this->poly_space.get_numbering_inverse();
1414 const unsigned int dofs1d = q_degree+1;
1415 std::vector<Tensor<1,dim> > evaluations1d (dofs1d);
1417 my_restriction.
reinit(this->dofs_per_cell, this->dofs_per_cell);
1419 for (
unsigned int i=0; i<q_dofs_per_cell; ++i)
1421 unsigned int mother_dof = index_map_inverse[i];
1422 const Point<dim> p_cell = this->unit_support_points[mother_dof];
1435 for (
unsigned int j=0; j<dofs1d; ++j)
1436 for (
unsigned int d=0; d<dim; ++d)
1439 point[0] = p_subcell[d];
1440 evaluations1d[j][d] =
1441 this->poly_space.compute_value(index_map_inverse[j], point);
1443 unsigned int j_indices[dim];
1444 internal::FE_Q_Base::zero_indices<dim> (j_indices);
1445 double sum_check = 0;
1446 for (
unsigned int j = 0; j<q_dofs_per_cell; j += dofs1d)
1448 double val_extra_dim = 1.;
1449 for (
unsigned int d=1; d<dim; ++d)
1450 val_extra_dim *= evaluations1d[j_indices[d-1]][d];
1451 for (
unsigned int jj=0; jj<dofs1d; ++jj)
1461 = val_extra_dim * evaluations1d[jj][0];
1462 const unsigned int child_dof =
1463 index_map_inverse[j+jj];
1464 if (std::fabs (val-1.) < eps)
1465 my_restriction(mother_dof,child_dof)=1.;
1466 else if (std::fabs(val) > eps)
1467 my_restriction(mother_dof,child_dof)=val;
1470 internal::FE_Q_Base::increment_indices<dim> (j_indices, dofs1d);
1472 Assert (std::fabs(sum_check-1) <
1473 std::max(eps, 5e-16*std::sqrt(this->dofs_per_cell)),
1475 "restriction matrix do not add to one. " 1476 "This typically indicates that the " 1477 "polynomial interpolation is " 1478 "ill-conditioned such that round-off " 1479 "prevents the sum to be one."));
1483 if (q_dofs_per_cell < this->dofs_per_cell)
1484 my_restriction(this->dofs_per_cell-1,this->dofs_per_cell-1) =
1491 (this->restriction[refinement_case-1][child]));
1494 return this->restriction[refinement_case-1][child];
1504 template <
class PolynomialType,
int dim,
int spacedim>
1507 (
const unsigned int shape_index,
1508 const unsigned int face_index)
const 1510 Assert (shape_index < this->dofs_per_cell,
1519 return (((shape_index == 0) && (face_index == 0)) ||
1520 ((shape_index == 1) && (face_index == 1)));
1524 if (((dim==2) && (shape_index>=this->first_quad_index))
1526 ((dim==3) && (shape_index>=this->first_hex_index)))
1530 if (shape_index < this->first_line_index)
1535 const unsigned int vertex_no = shape_index;
1539 for (
unsigned int v=0; v<GeometryInfo<dim>::vertices_per_face; ++v)
1545 else if (shape_index < this->first_quad_index)
1548 const unsigned int line_index
1549 = (shape_index - this->first_line_index) / this->dofs_per_line;
1555 return (line_index == face_index);
1559 const unsigned int lines_per_face =
1562 for (
unsigned int l=0; l<lines_per_face; ++l)
1571 else if (shape_index < this->first_hex_index)
1574 const unsigned int quad_index
1575 = (shape_index - this->first_quad_index) / this->dofs_per_quad;
1576 Assert (static_cast<signed int>(quad_index) <
1586 return (quad_index == face_index);
1605 template <
typename PolynomialType,
int dim,
int spacedim>
1606 std::pair<Table<2,bool>, std::vector<unsigned int> >
1614 for (
unsigned int i=0; i<Utilities::fixed_power<dim>(q_degree+1); ++i)
1615 constant_modes(0, i) =
true;
1616 return std::pair<Table<2,bool>, std::vector<unsigned int> >
1617 (constant_modes, std::vector<unsigned int>(1, 0));
1623 #include "fe_q_base.inst" 1625 DEAL_II_NAMESPACE_CLOSE
static Point< dim > child_to_cell_coordinates(const Point< dim > &p, const unsigned int child_index, const RefinementCase< dim > refine_case=RefinementCase< dim >::isotropic_refinement)
FE_Q_Base(const PolynomialType &poly_space, const FiniteElementData< dim > &fe_data, const std::vector< bool > &restriction_is_additive_flags)
static const unsigned int invalid_unsigned_int
#define AssertDimension(dim1, dim2)
void swap(TableBase< N, T > &v)
static std::vector< unsigned int > get_dpo_vector(const unsigned int degree)
FullMatrix< double > interface_constraints
SymmetricTensor< 2, dim, Number > e(const Tensor< 2, dim, Number > &F)
Task< RT > new_task(const std::function< RT()> &function)
virtual std::vector< std::pair< unsigned int, unsigned int > > hp_vertex_dof_identities(const FiniteElement< dim, spacedim > &fe_other) const
virtual void get_face_interpolation_matrix(const FiniteElement< dim, spacedim > &source, FullMatrix< double > &matrix) const
const unsigned int degree
const Point< dim > & point(const unsigned int i) const
static Point< dim > cell_to_child_coordinates(const Point< dim > &p, const unsigned int child_index, const RefinementCase< dim > refine_case=RefinementCase< dim >::isotropic_refinement)
#define AssertThrow(cond, exc)
virtual std::vector< std::pair< unsigned int, unsigned int > > hp_quad_dof_identities(const FiniteElement< dim, spacedim > &fe_other) const
static ::ExceptionBase & ExcIndexRange(int arg1, int arg2, int arg3)
static ::ExceptionBase & ExcMessage(std::string arg1)
static ::ExceptionBase & ExcImpossibleInDim(int arg1)
virtual const FullMatrix< double > & get_prolongation_matrix(const unsigned int child, const RefinementCase< dim > &refinement_case=RefinementCase< dim >::isotropic_refinement) const
void reinit(const TableIndices< N > &new_size, const bool omit_default_initialization=false)
#define Assert(cond, exc)
virtual const FullMatrix< double > & get_restriction_matrix(const unsigned int child, const RefinementCase< dim > &refinement_case=RefinementCase< dim >::isotropic_refinement) const
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 ::ExceptionBase & ExcDimensionMismatch(std::size_t arg1, std::size_t arg2)
virtual bool hp_constraints_are_implemented() 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
virtual std::vector< std::pair< unsigned int, unsigned int > > hp_line_dof_identities(const FiniteElement< dim, spacedim > &fe_other) const
virtual bool has_support_on_face(const unsigned int shape_index, const unsigned int face_index) const
SymmetricTensor< 2, dim, Number > d(const Tensor< 2, dim, Number > &F, const Tensor< 2, dim, Number > &dF_dt)
virtual FiniteElementDomination::Domination compare_for_face_domination(const FiniteElement< dim, spacedim > &fe_other) const
virtual std::pair< Table< 2, bool >, std::vector< unsigned int > > get_constant_modes() const
SymmetricTensor< rank, dim, Number > sum(const SymmetricTensor< rank, dim, Number > &local, const MPI_Comm &mpi_communicator)
unsigned int size() const
const unsigned int dofs_per_cell
void initialize(const std::vector< Point< 1 > > &support_points_1d)
static unsigned int n_children(const RefinementCase< dim > &refinement_case)
void initialize_unit_face_support_points(const std::vector< Point< 1 > > &points)
void initialize_constraints(const std::vector< Point< 1 > > &points)
virtual void get_subface_interpolation_matrix(const FiniteElement< dim, spacedim > &source, const unsigned int subface, FullMatrix< double > &matrix) const
static void initialize_constraints(const std::vector< Point< 1 > > &, FE_Q_Base< PolynomialType, 1, spacedim > &)
void initialize_quad_dof_index_permutation()
static void project_to_face(const SubQuadrature &quadrature, const unsigned int face_no, std::vector< Point< dim > > &q_points)
void initialize_unit_support_points(const std::vector< Point< 1 > > &points)
const unsigned int dofs_per_face
virtual void get_interpolation_matrix(const FiniteElement< dim, spacedim > &source, FullMatrix< double > &matrix) const
static ::ExceptionBase & ExcNotImplemented()
PolynomialType poly_space
TableIndices< 2 > interface_constraints_size() const
static ::ExceptionBase & ExcInternalError()