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
virtual void get_interpolation_matrix(const FiniteElement< dim, spacedim > &source, FullMatrix< double > &matrix) const override
static const unsigned int invalid_unsigned_int
FE_Bernstein(const unsigned int p)
virtual std::vector< std::pair< unsigned int, unsigned int > > hp_line_dof_identities(const FiniteElement< dim, spacedim > &fe_other) const override
virtual std::vector< std::pair< unsigned int, unsigned int > > hp_vertex_dof_identities(const FiniteElement< dim, spacedim > &fe_other) const override
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)
const std::vector< Point< dim - 1 > > & get_unit_face_support_points() const
void set_numbering(const std::vector< unsigned int > &renumber)
virtual std::unique_ptr< FiniteElement< dim, spacedim > > clone() const override
#define AssertThrow(cond, exc)
static ::ExceptionBase & ExcMessage(std::string arg1)
static ::ExceptionBase & ExcImpossibleInDim(int arg1)
#define Assert(cond, exc)
static ::ExceptionBase & ExcDimensionMismatch(std::size_t arg1, std::size_t arg2)
SymmetricTensor< rank, dim, Number > sum(const SymmetricTensor< rank, dim, Number > &local, const MPI_Comm &mpi_communicator)
TensorProductPolynomials< dim > renumber_bases(const unsigned int degree)
virtual const FullMatrix< double > & get_prolongation_matrix(const unsigned int child, const RefinementCase< dim > &refinement_case=RefinementCase< dim >::isotropic_refinement) const override
static void project_to_face(const SubQuadrature &quadrature, const unsigned int face_no, std::vector< Point< dim >> &q_points)
virtual bool hp_constraints_are_implemented() const override
virtual FiniteElementDomination::Domination compare_for_domination(const FiniteElement< dim, spacedim > &fe_other, const unsigned int codim=0) const override final
virtual std::string get_name() const override
static std::vector< unsigned int > get_dpo_vector(const unsigned int degree)
const unsigned int dofs_per_face
static ::ExceptionBase & ExcNotImplemented()
virtual void get_face_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 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_subface_interpolation_matrix(const FiniteElement< dim, spacedim > &source, const unsigned int subface, FullMatrix< double > &matrix) const override
static ::ExceptionBase & ExcInternalError()