17 #include <deal.II/base/quadrature.h> 18 #include <deal.II/base/quadrature_lib.h> 19 #include <deal.II/base/qprojector.h> 20 #include <deal.II/fe/fe_nothing.h> 21 #include <deal.II/fe/fe_q.h> 22 #include <deal.II/fe/fe_tools.h> 23 #include <deal.II/fe/fe_bernstein.h> 24 #include <deal.II/base/polynomials_bernstein.h> 28 #include <deal.II/base/std_cxx14/memory.h> 31 DEAL_II_NAMESPACE_OPEN
35 template <
int dim,
int spacedim>
39 this->renumber_bases(degree),
43 std::vector<bool> (1, false))
48 template <
int dim,
int spacedim>
57 ExcInterpolationNotImplemented()));
62 template <
int dim,
int spacedim>
71 return this->restriction[0][0];
76 template <
int dim,
int spacedim>
85 return this->prolongation[0][0];
90 template <
int dim,
int spacedim>
98 interpolation_matrix);
102 template <
int dim,
int spacedim>
106 const unsigned int subface,
119 Assert (interpolation_matrix.
n() == this->dofs_per_face,
121 this->dofs_per_face));
128 Assert (this->dofs_per_face <= source_fe->dofs_per_face,
130 ExcInterpolationNotImplemented ()));
138 double eps = 2e-13 * std::max(this->degree, source_fe->degree) * (dim-1);
152 for (
unsigned int i=0; i<source_fe->dofs_per_face; ++i)
154 const Point<dim> &p = subface_quadrature.point (i);
155 for (
unsigned int j=0; j<this->dofs_per_face; ++j)
157 double matrix_entry = this->shape_value (this->face_to_cell_index(j, 0), p);
162 if (std::fabs (matrix_entry - 1.0) < eps)
164 if (std::fabs (matrix_entry) < eps)
167 interpolation_matrix(i,j) = matrix_entry;
173 for (
unsigned int j=0; j<source_fe->dofs_per_face; ++j)
177 for (
unsigned int i=0; i<this->dofs_per_face; ++i)
178 sum += interpolation_matrix(j,i);
183 else if (
dynamic_cast<const FE_Nothing<dim> *
>(&x_source_fe) !=
nullptr)
189 ExcInterpolationNotImplemented()));
194 template <
int dim,
int spacedim>
202 template <
int dim,
int spacedim>
203 std::vector<std::pair<unsigned int, unsigned int> >
213 std::vector<std::pair<unsigned int, unsigned int> >
214 (1, std::make_pair (0U, 0U));
220 return std::vector<std::pair<unsigned int, unsigned int> > ();
231 return std::vector<std::pair<unsigned int, unsigned int> > ();
236 return std::vector<std::pair<unsigned int, unsigned int> > ();
241 template <
int dim,
int spacedim>
242 std::vector<std::pair<unsigned int, unsigned int> >
251 return std::vector<std::pair<unsigned int, unsigned int> > ();
255 template <
int dim,
int spacedim>
256 std::vector<std::pair<unsigned int, unsigned int> >
265 return std::vector<std::pair<unsigned int, unsigned int> > ();
269 template <
int dim,
int spacedim>
276 if (this->degree < fe_b_other->degree)
278 else if (this->degree == fe_b_other->degree)
285 if (fe_nothing->is_dominating())
302 template <
int dim,
int spacedim>
310 std::ostringstream namebuf;
311 namebuf <<
"FE_Bernstein<" << dim <<
">(" << this->degree <<
")";
312 return namebuf.str();
316 template <
int dim,
int spacedim>
317 std::unique_ptr<FiniteElement<dim,spacedim> >
320 return std_cxx14::make_unique<FE_Bernstein<dim,spacedim>>(*this);
327 template <
int dim,
int spacedim>
328 std::vector<unsigned int>
332 std::vector<unsigned int> dpo(dim+1, 1U);
333 for (
unsigned int i=1; i<dpo.size(); ++i)
334 dpo[i]=dpo[i-1]*(deg-1);
339 template <
int dim,
int spacedim>
344 std::vector<unsigned int> renumber(Utilities::fixed_power<dim>(deg+1));
354 #include "fe_bernstein.inst" 356 DEAL_II_NAMESPACE_CLOSE
virtual std::unique_ptr< FiniteElement< dim, spacedim > > clone() const
virtual const FullMatrix< double > & get_prolongation_matrix(const unsigned int child, const RefinementCase< dim > &refinement_case=RefinementCase< dim >::isotropic_refinement) const
static const unsigned int invalid_unsigned_int
FE_Bernstein(const unsigned int p)
const std::vector< Point< dim-1 > > & get_unit_face_support_points() const
virtual void get_interpolation_matrix(const FiniteElement< dim, spacedim > &source, FullMatrix< double > &matrix) const
virtual const FullMatrix< double > & get_restriction_matrix(const unsigned int child, const RefinementCase< dim > &refinement_case=RefinementCase< dim >::isotropic_refinement) const
virtual std::string get_name() const
virtual std::vector< std::pair< unsigned int, unsigned int > > hp_vertex_dof_identities(const FiniteElement< dim, spacedim > &fe_other) const
void set_numbering(const std::vector< unsigned int > &renumber)
#define AssertThrow(cond, exc)
virtual bool hp_constraints_are_implemented() const
static ::ExceptionBase & ExcMessage(std::string arg1)
static ::ExceptionBase & ExcImpossibleInDim(int arg1)
virtual std::vector< std::pair< unsigned int, unsigned int > > hp_line_dof_identities(const FiniteElement< dim, spacedim > &fe_other) const
virtual std::vector< std::pair< unsigned int, unsigned int > > hp_quad_dof_identities(const FiniteElement< dim, spacedim > &fe_other) const
virtual void get_subface_interpolation_matrix(const FiniteElement< dim, spacedim > &source, const unsigned int subface, FullMatrix< double > &matrix) const
#define Assert(cond, exc)
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 void get_face_interpolation_matrix(const FiniteElement< dim, spacedim > &source, FullMatrix< double > &matrix) const
virtual FiniteElementDomination::Domination compare_for_face_domination(const FiniteElement< dim, spacedim > &fe_other) const
SymmetricTensor< rank, dim, Number > sum(const SymmetricTensor< rank, dim, Number > &local, const MPI_Comm &mpi_communicator)
TensorProductPolynomials< dim > renumber_bases(const unsigned int degree)
static void project_to_face(const SubQuadrature &quadrature, const unsigned int face_no, std::vector< Point< dim > > &q_points)
static std::vector< unsigned int > get_dpo_vector(const unsigned int degree)
const unsigned int dofs_per_face
static ::ExceptionBase & ExcNotImplemented()
static ::ExceptionBase & ExcInternalError()