57 for (
unsigned int d = 0; d < dim; ++d)
71 for (
unsigned int d = 0; d < dim - 1; ++d)
88template <
int xdim,
int xspacedim>
95 template <
int spacedim>
104 template <
int spacedim>
109 const unsigned int dim = 2;
111 unsigned int q_deg = fe.degree;
113 &fe.get_poly_space()) !=
nullptr)
114 q_deg = fe.degree - 1;
166 const unsigned int n =
q_deg - 1;
167 const double step = 1. /
q_deg;
169 for (
unsigned int i = 1; i <= n; ++i)
174 for (
unsigned int i = 1; i <= n; ++i)
183 fe.interface_constraints.TableBase<2, double>::reinit(
184 fe.interface_constraints_size());
188 const std::vector<unsigned int> &index_map_inverse =
189 fe.get_poly_space_numbering_inverse();
193 fe.poly_space->compute_value(index_map_inverse[0],
Point<dim>()) -
198 for (
unsigned int j = 0;
j <
q_deg + 1; ++
j)
203 fe.poly_space->compute_value(index_map_inverse[
j], p);
215 template <
int spacedim>
220 const unsigned int dim = 3;
222 unsigned int q_deg = fe.degree;
224 &fe.get_poly_space()) !=
nullptr)
225 q_deg = fe.degree - 1;
255 const unsigned int n =
q_deg - 1;
256 const double step = 1. /
q_deg;
257 std::vector<
Point<dim - 2>> line_support_points(n);
258 for (
unsigned int i = 0; i < n; ++i)
259 line_support_points[i](0) = (i + 1) * step;
269 ReferenceCells::get_hypercube<dim - 1>(),
qline, 0, 0,
p_line);
270 for (
unsigned int i = 0; i < n; ++i)
274 ReferenceCells::get_hypercube<dim - 1>(),
qline, 0, 1,
p_line);
275 for (
unsigned int i = 0; i < n; ++i)
279 ReferenceCells::get_hypercube<dim - 1>(),
qline, 2, 0,
p_line);
280 for (
unsigned int i = 0; i < n; ++i)
284 ReferenceCells::get_hypercube<dim - 1>(),
qline, 2, 1,
p_line);
285 for (
unsigned int i = 0; i < n; ++i)
289 for (
unsigned int face = 0;
292 for (
unsigned int subface = 0;
297 ReferenceCells::get_hypercube<dim - 1>(),
309 for (
unsigned int i = 0,
iy = 1;
iy <= n; ++
iy)
310 for (
unsigned int ix = 1;
ix <= n; ++
ix)
314 for (
unsigned int child = 0;
329 const std::vector<unsigned int> &index_map_inverse =
330 fe.get_poly_space_numbering_inverse();
334 fe.poly_space->compute_value(index_map_inverse[0],
Point<dim>()) -
338 fe.interface_constraints.TableBase<2, double>::reinit(
339 fe.interface_constraints_size());
343 const double interval =
static_cast<double>(
q_deg * 2);
356 for (
unsigned int k = 0;
k < dim - 1; ++
k)
387 for (
unsigned int j = 0;
j <
pnts; ++
j)
389 unsigned int indices[2] = {
j % (
q_deg + 1),
j / (
q_deg + 1)};
391 for (
unsigned int k = 0;
k < 2; ++
k)
393 indices[
k] =
q_deg - indices[
k];
396 indices[1] * (
q_deg + 1) + indices[0];
399 fe.poly_space->compute_value(index_map_inverse[
new_index],
416template <
int dim,
int spacedim>
420 const std::vector<bool> & restriction_is_additive_flags)
424 restriction_is_additive_flags,
434template <
int dim,
int spacedim>
439 ExcMessage(
"The first support point has to be zero."));
440 Assert(points.back()[0] == 1,
441 ExcMessage(
"The last support point has to be one."));
447 Utilities::fixed_power<dim>(
q_degree + 1);
453 [
this, q_dofs_per_cell]() {
454 std::vector<unsigned int> renumber =
455 FETools::hierarchic_to_lexicographic_numbering<dim>(
q_degree);
457 renumber.push_back(i);
510template <
int dim,
int spacedim>
523 this->n_dofs_per_cell()));
530 Utilities::fixed_power<dim>(
q_degree + 1);
532 Utilities::fixed_power<dim>(
source_fe->degree + 1);
550 source_fe->poly_space->compute_value(i, p);
568 for (
unsigned int j = 0;
j <
source_fe->n_dofs_per_cell(); ++
j)
578 for (
unsigned int j = 0;
j <
source_fe->n_dofs_per_cell(); ++
j)
610template <
int dim,
int spacedim>
615 const unsigned int face_no)
const
625template <
int dim,
int spacedim>
629 const unsigned int subface,
631 const unsigned int face_no)
const
729template <
int dim,
int spacedim>
738template <
int dim,
int spacedim>
739std::vector<std::pair<unsigned int, unsigned int>>
762 else if (
fe_other.n_unique_faces() == 1 &&
fe_other.n_dofs_per_face(0) == 0)
782template <
int dim,
int spacedim>
783std::vector<std::pair<unsigned int, unsigned int>>
800 const unsigned int p = this->
degree;
803 std::vector<std::pair<unsigned int, unsigned int>>
identities;
805 const std::vector<unsigned int> &index_map_inverse =
808 fe_q_other->get_poly_space_numbering_inverse();
810 for (
unsigned int i = 0; i < p - 1; ++i)
811 for (
unsigned int j = 0;
j <
q - 1; ++
j)
840 std::vector<std::pair<unsigned int, unsigned int>>
identities;
842 for (
unsigned int i = 0; i < this->
degree - 1; ++i)
846 fe_p_other->get_unit_support_points()[
j + 3][0]) < 1e-14)
857 else if (
fe_other.n_unique_faces() == 1 &&
fe_other.n_dofs_per_face(0) == 0)
877template <
int dim,
int spacedim>
878std::vector<std::pair<unsigned int, unsigned int>>
881 const unsigned int)
const
893 const unsigned int p = this->
degree;
896 std::vector<std::pair<unsigned int, unsigned int>>
identities;
898 const std::vector<unsigned int> &index_map_inverse =
901 fe_q_other->get_poly_space_numbering_inverse();
903 for (
unsigned int i1 = 0;
i1 < p - 1; ++
i1)
904 for (
unsigned int i2 = 0;
i2 < p - 1; ++
i2)
905 for (
unsigned int j1 = 0;
j1 <
q - 1; ++
j1)
906 for (
unsigned int j2 = 0;
j2 <
q - 1; ++
j2)
925 return std::vector<std::pair<unsigned int, unsigned int>>();
927 else if (
fe_other.n_unique_faces() == 1 &&
fe_other.n_dofs_per_face(0) == 0)
936 return std::vector<std::pair<unsigned int, unsigned int>>();
941 return std::vector<std::pair<unsigned int, unsigned int>>();
953template <
int dim,
int spacedim>
956 const std::vector<
Point<1>> &points)
958 const std::vector<unsigned int> &index_map_inverse =
971 for (
unsigned int k = 0;
k < support_quadrature.
size(); ++
k)
973 support_quadrature.point(
k);
978template <
int dim,
int spacedim>
981 const std::vector<
Point<1>> &points)
986 const unsigned int face_no = 0;
989 Utilities::fixed_power<dim - 1>(
q_degree + 1));
1010 for (
unsigned int k = 0;
k < support_quadrature.
size(); ++
k)
1012 support_quadrature.point(
k);
1017template <
int dim,
int spacedim>
1028 const unsigned int face_no = 0;
1036 const unsigned int n =
q_degree - 1;
1057 for (
unsigned int local = 0; local < this->
n_dofs_per_quad(face_no); ++local)
1061 unsigned int i = local % n,
j = local / n;
1070 i + (n - 1 -
j) * n - local;
1074 (n - 1 -
j) + (n - 1 - i) * n - local;
1078 (n - 1 - i) +
j * n - local;
1085 j + (n - 1 - i) * n - local;
1089 (n - 1 - i) + (n - 1 -
j) * n - local;
1093 (n - 1 -
j) + i * n - local;
1104template <
int dim,
int spacedim>
1107 const unsigned int face,
1108 const bool face_orientation,
1109 const bool face_flip,
1110 const bool face_rotation)
const
1138 face,
face_vertex, face_orientation, face_flip, face_rotation) *
1140 dof_index_on_vertex);
1147 const unsigned int index =
1165 if (face_flip ==
false)
1181 ((face_orientation ==
true) && (face_flip ==
false) &&
1182 (face_rotation ==
false)),
1193 face,
face_line, face_orientation, face_flip, face_rotation) *
1195 adjusted_dof_index_on_line);
1203 const unsigned int index =
1210 ((face_orientation ==
true) && (face_flip ==
false) &&
1211 (face_rotation ==
false)),
1219template <
int dim,
int spacedim>
1220std::vector<unsigned int>
1225 std::vector<unsigned int>
dpo(dim + 1, 1U);
1226 for (
unsigned int i = 1; i <
dpo.
size(); ++i)
1233template <
int dim,
int spacedim>
1236 const std::vector<
Point<1>> &points)
1243template <
int dim,
int spacedim>
1246 const unsigned int child,
1253 "Prolongation matrices are only available for refined cells!"));
1257 if (this->
prolongation[refinement_case - 1][child].n() == 0)
1259 std::lock_guard<std::mutex> lock(this->
mutex);
1262 if (this->
prolongation[refinement_case - 1][child].n() ==
1268 Utilities::fixed_power<dim>(
q_degree + 1);
1284 i,
this->unit_support_points[i])) < eps,
1286 "to one or zero in a nodal point. "
1287 "This typically indicates that the "
1288 "polynomial interpolation is "
1289 "ill-conditioned such that round-off "
1290 "prevents the sum to be one."));
1294 i,
this->unit_support_points[
j])) < eps,
1296 "The Lagrange polynomial does not evaluate "
1297 "to one or zero in a nodal point. "
1298 "This typically indicates that the "
1299 "polynomial interpolation is "
1300 "ill-conditioned such that round-off "
1301 "prevents the sum to be one."));
1313 const std::vector<unsigned int> &index_map_inverse =
1320 unsigned int factor = 1;
1321 for (
unsigned int d = 0;
d < dim; ++
d)
1333 for (
unsigned int j = 0;
j <
dofs1d; ++
j)
1341 for (
unsigned int i = 0; i <
dofs1d; ++i)
1342 for (
unsigned int d = 0;
d < dim; ++
d)
1348 this->
poly_space->compute_value(index_map_inverse[i], point);
1377 internal::FE_Q_Base::zero_indices<dim>(
j_indices);
1381 internal::FE_Q_Base::zero_indices<dim>(
i_indices);
1385 for (
unsigned int d = 1;
d < dim; ++
d)
1393 const unsigned int j_ind = index_map_inverse[
j +
jj];
1395 prolongate(
j_ind, index_map_inverse[i +
ii]) =
1419 sum += prolongate(row, col);
1420 Assert(std::fabs(sum - 1.) <
1423 "prolongation matrix do not add to one. "
1424 "This typically indicates that the "
1425 "polynomial interpolation is "
1426 "ill-conditioned such that round-off "
1427 "prevents the sum to be one."));
1442template <
int dim,
int spacedim>
1445 const unsigned int child,
1452 "Restriction matrices are only available for refined cells!"));
1456 if (this->
restriction[refinement_case - 1][child].n() == 0)
1458 std::lock_guard<std::mutex> lock(this->
mutex);
1461 if (this->
restriction[refinement_case - 1][child].n() ==
1463 return this->
restriction[refinement_case - 1][child];
1468 const unsigned int q_dofs_per_cell =
1469 Utilities::fixed_power<dim>(
q_degree + 1);
1490 const std::vector<unsigned int> &index_map_inverse =
1493 const unsigned int dofs1d =
q_degree + 1;
1500 unsigned int mother_dof = index_map_inverse[i];
1515 for (
unsigned int j = 0;
j <
dofs1d; ++
j)
1516 for (
unsigned int d = 0;
d < dim; ++
d)
1521 this->
poly_space->compute_value(index_map_inverse[
j],
1525 internal::FE_Q_Base::zero_indices<dim>(
j_indices);
1532 for (
unsigned int d = 1;
d < dim; ++
d)
1543 const unsigned int child_dof = index_map_inverse[
j +
jj];
1544 if (std::fabs(val - 1.) < eps)
1546 else if (std::fabs(val) > eps)
1552 internal::FE_Q_Base::increment_indices<dim>(
j_indices,
1559 "restriction matrix do not add to one. "
1560 "This typically indicates that the "
1561 "polynomial interpolation is "
1562 "ill-conditioned such that round-off "
1563 "prevents the sum to be one."));
1580 return this->
restriction[refinement_case - 1][child];
1590template <
int dim,
int spacedim>
1594 const unsigned int face_index)
const
1603 return (((
shape_index == 0) && (face_index == 0)) ||
1633 const unsigned int line_index =
1640 return (line_index == face_index);
1644 const unsigned int lines_per_face =
1647 for (
unsigned int l = 0;
l < lines_per_face; ++
l)
1660 const unsigned int quad_index =
1663 Assert(
static_cast<signed int>(quad_index) <
1673 return (quad_index == face_index);
1692template <
int dim,
int spacedim>
1693std::pair<Table<2, bool>, std::vector<unsigned int>>
1702 constant_modes(0, i) =
true;
1703 return std::pair<Table<2, bool>, std::vector<unsigned int>>(
1704 constant_modes, std::vector<unsigned int>(1, 0));
1710#include "fe_q_base.inst"
void reinit(value_type *starting_element, const std::size_t n_elements)
std::vector< unsigned int > get_poly_space_numbering_inverse() const
virtual double shape_value(const unsigned int i, const Point< dim > &p) const override
const std::unique_ptr< ScalarPolynomialsBase< dim > > poly_space
void initialize_unit_face_support_points(const std::vector< Point< 1 > > &points)
virtual bool hp_constraints_are_implemented() 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_interpolation_matrix(const FiniteElement< dim, spacedim > &source, FullMatrix< double > &matrix) 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
const unsigned int q_degree
virtual std::pair< Table< 2, bool >, std::vector< unsigned int > > get_constant_modes() const override
void initialize_quad_dof_index_permutation()
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 override
void initialize(const std::vector< Point< 1 > > &support_points_1d)
void initialize_unit_support_points(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 unsigned int face_no=0) const override
virtual void get_face_interpolation_matrix(const FiniteElement< dim, spacedim > &source, FullMatrix< double > &matrix, const unsigned int face_no=0) const override
static std::vector< unsigned int > get_dpo_vector(const unsigned int degree)
void initialize_constraints(const std::vector< Point< 1 > > &points)
virtual const FullMatrix< double > & get_restriction_matrix(const unsigned int child, const RefinementCase< dim > &refinement_case=RefinementCase< dim >::isotropic_refinement) 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 bool has_support_on_face(const unsigned int shape_index, const unsigned int face_index) const override
virtual std::vector< std::pair< unsigned int, unsigned int > > hp_vertex_dof_identities(const FiniteElement< dim, spacedim > &fe_other) const override
FE_Q_Base(const ScalarPolynomialsBase< dim > &poly_space, const FiniteElementData< dim > &fe_data, const std::vector< bool > &restriction_is_additive_flags)
unsigned int get_first_line_index() const
unsigned int n_dofs_per_vertex() const
const unsigned int degree
unsigned int n_dofs_per_cell() const
unsigned int n_dofs_per_line() const
unsigned int get_first_quad_index(const unsigned int quad_no=0) const
unsigned int n_dofs_per_face(unsigned int face_no=0, unsigned int child=0) const
ReferenceCell reference_cell() const
unsigned int get_first_face_line_index(const unsigned int face_no=0) const
unsigned int get_first_face_quad_index(const unsigned int face_no=0) const
unsigned int n_unique_faces() const
unsigned int n_dofs_per_quad(unsigned int face_no=0) const
unsigned int get_first_hex_index() const
std::vector< std::vector< Point< dim - 1 > > > unit_face_support_points
std::vector< std::vector< FullMatrix< double > > > restriction
std::vector< Table< 2, int > > adjust_quad_dof_index_for_face_orientation_table
std::vector< int > adjust_line_dof_index_for_line_orientation_table
std::vector< Point< dim > > unit_support_points
std::vector< std::vector< FullMatrix< double > > > prolongation
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)
#define DEAL_II_NAMESPACE_OPEN
#define DEAL_II_NAMESPACE_CLOSE
static ::ExceptionBase & ExcNotImplemented()
#define Assert(cond, exc)
#define AssertDimension(dim1, dim2)
#define AssertIndexRange(index, range)
static ::ExceptionBase & ExcInternalError()
static ::ExceptionBase & ExcDimensionMismatch(std::size_t arg1, std::size_t arg2)
static ::ExceptionBase & ExcInterpolationNotImplemented()
static ::ExceptionBase & ExcMessage(std::string arg1)
#define AssertThrow(cond, exc)
Task< RT > new_task(const std::function< RT()> &function)
Point< spacedim > point(const gp_Pnt &p, const double tolerance=1e-10)
SymmetricTensor< 2, dim, Number > e(const Tensor< 2, dim, Number > &F)
Tensor< 2, dim, Number > l(const Tensor< 2, dim, Number > &F, const Tensor< 2, dim, Number > &dF_dt)
SymmetricTensor< 2, dim, Number > d(const Tensor< 2, dim, Number > &F, const Tensor< 2, dim, Number > &dF_dt)
T sum(const T &t, const MPI_Comm mpi_communicator)
static const unsigned int invalid_unsigned_int
::VectorizedArray< Number, width > max(const ::VectorizedArray< Number, width > &, const ::VectorizedArray< Number, width > &)
::VectorizedArray< Number, width > sqrt(const ::VectorizedArray< Number, width > &)
::VectorizedArray< Number, width > abs(const ::VectorizedArray< Number, width > &)
static void initialize_constraints(const std::vector< Point< 1 > > &, FE_Q_Base< 3, spacedim > &fe)
static void initialize_constraints(const std::vector< Point< 1 > > &, FE_Q_Base< 1, spacedim > &)
static void initialize_constraints(const std::vector< Point< 1 > > &, FE_Q_Base< 2, spacedim > &fe)
static unsigned int n_children(const RefinementCase< dim > &refinement_case)
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)
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)