17 #include <deal.II/base/polynomials_bernstein.h>
18 #include <deal.II/base/qprojector.h>
19 #include <deal.II/base/quadrature.h>
20 #include <deal.II/base/quadrature_lib.h>
21 #include <deal.II/base/std_cxx14/memory.h>
23 #include <deal.II/fe/fe_bernstein.h>
24 #include <deal.II/fe/fe_dgq.h>
25 #include <deal.II/fe/fe_nothing.h>
26 #include <deal.II/fe/fe_q.h>
27 #include <deal.II/fe/fe_tools.h>
33 DEAL_II_NAMESPACE_OPEN
37 template <
int dim,
int spacedim>
40 this->renumber_bases(degree),
45 std::vector<bool>(1, false))
50 template <
int dim,
int spacedim>
64 template <
int dim,
int spacedim>
74 return this->restriction[0][0];
79 template <
int dim,
int spacedim>
89 return this->prolongation[0][0];
94 template <
int dim,
int spacedim>
101 get_subface_interpolation_matrix(source_fe,
103 interpolation_matrix);
107 template <
int dim,
int spacedim>
111 const unsigned int subface,
124 Assert(interpolation_matrix.
n() == this->dofs_per_face,
126 this->dofs_per_face));
134 this->dofs_per_face <= source_fe->dofs_per_face,
136 spacedim>::ExcInterpolationNotImplemented()));
146 2e-13 * std::max(this->degree, source_fe->degree) * (dim - 1);
158 for (
unsigned int i = 0; i < source_fe->dofs_per_face; ++i)
160 const Point<dim> &p = subface_quadrature.point(i);
161 for (
unsigned int j = 0; j < this->dofs_per_face; ++j)
163 double matrix_entry =
164 this->shape_value(this->face_to_cell_index(j, 0), p);
169 if (std::fabs(matrix_entry - 1.0) <
eps)
171 if (std::fabs(matrix_entry) <
eps)
174 interpolation_matrix(i, j) = matrix_entry;
180 for (
unsigned int j = 0; j < source_fe->dofs_per_face; ++j)
184 for (
unsigned int i = 0; i < this->dofs_per_face; ++i)
185 sum += interpolation_matrix(j, i);
190 else if (
dynamic_cast<const FE_Nothing<dim> *
>(&x_source_fe) !=
nullptr)
198 spacedim>::ExcInterpolationNotImplemented()));
203 template <
int dim,
int spacedim>
211 template <
int dim,
int spacedim>
212 std::vector<std::pair<unsigned int, unsigned int>>
222 return std::vector<std::pair<unsigned int, unsigned int>>(
223 1, std::make_pair(0U, 0U));
229 return std::vector<std::pair<unsigned int, unsigned int>>();
240 return std::vector<std::pair<unsigned int, unsigned int>>();
245 return std::vector<std::pair<unsigned int, unsigned int>>();
250 template <
int dim,
int spacedim>
251 std::vector<std::pair<unsigned int, unsigned int>>
261 return std::vector<std::pair<unsigned int, unsigned int>>();
265 template <
int dim,
int spacedim>
266 std::vector<std::pair<unsigned int, unsigned int>>
276 return std::vector<std::pair<unsigned int, unsigned int>>();
280 template <
int dim,
int spacedim>
284 const unsigned int codim)
const
303 if (this->degree < fe_b_other->degree)
305 else if (this->degree == fe_b_other->degree)
313 if (fe_nothing->is_dominating())
327 template <
int dim,
int spacedim>
335 std::ostringstream namebuf;
336 namebuf <<
"FE_Bernstein<" << dim <<
">(" << this->degree <<
")";
337 return namebuf.str();
341 template <
int dim,
int spacedim>
342 std::unique_ptr<FiniteElement<dim, spacedim>>
345 return std_cxx14::make_unique<FE_Bernstein<dim, spacedim>>(*this);
352 template <
int dim,
int spacedim>
353 std::vector<unsigned int>
357 std::vector<unsigned int> dpo(dim + 1, 1U);
358 for (
unsigned int i = 1; i < dpo.size(); ++i)
359 dpo[i] = dpo[i - 1] * (deg - 1);
364 template <
int dim,
int spacedim>
369 ::generate_complete_bernstein_basis<double>(deg));
370 std::vector<unsigned int> renumber(Utilities::fixed_power<dim>(deg + 1));
379 #include "fe_bernstein.inst"
381 DEAL_II_NAMESPACE_CLOSE