18 #include <deal.II/base/quadrature.h> 19 #include <deal.II/base/quadrature_lib.h> 20 #include <deal.II/base/qprojector.h> 21 #include <deal.II/fe/fe_nothing.h> 22 #include <deal.II/fe/fe_q.h> 23 #include <deal.II/fe/fe_tools.h> 24 #include <deal.II/fe/fe_bernstein.h> 25 #include <deal.II/base/polynomials_bernstein.h> 30 DEAL_II_NAMESPACE_OPEN
34 template <
int dim,
int spacedim>
38 this->renumber_bases(degree),
42 std::vector<bool> (1, false))
47 template <
int dim,
int spacedim>
56 typename FEE::ExcInterpolationNotImplemented());
61 template <
int dim,
int spacedim>
68 typename FEE::ExcProjectionVoid());
71 return this->restriction[0][0];
76 template <
int dim,
int spacedim>
83 typename FEE::ExcEmbeddingVoid());
86 return this->prolongation[0][0];
91 template <
int dim,
int spacedim>
99 interpolation_matrix);
103 template <
int dim,
int spacedim>
107 const unsigned int subface,
120 Assert (interpolation_matrix.
n() == this->dofs_per_face,
122 this->dofs_per_face));
129 Assert (this->dofs_per_face <= source_fe->dofs_per_face,
131 ExcInterpolationNotImplemented ()));
139 double eps = 2e-13 * std::max(this->degree, source_fe->degree) * (dim-1);
153 for (
unsigned int i=0; i<source_fe->dofs_per_face; ++i)
155 const Point<dim> &p = subface_quadrature.point (i);
156 for (
unsigned int j=0; j<this->dofs_per_face; ++j)
158 double matrix_entry = this->shape_value (this->face_to_cell_index(j, 0), p);
163 if (std::fabs (matrix_entry - 1.0) < eps)
165 if (std::fabs (matrix_entry) < eps)
168 interpolation_matrix(i,j) = matrix_entry;
174 for (
unsigned int j=0; j<source_fe->dofs_per_face; ++j)
178 for (
unsigned int i=0; i<this->dofs_per_face; ++i)
179 sum += interpolation_matrix(j,i);
190 ExcInterpolationNotImplemented()));
195 template <
int dim,
int spacedim>
203 template <
int dim,
int spacedim>
204 std::vector<std::pair<unsigned int, unsigned int> >
214 std::vector<std::pair<unsigned int, unsigned int> >
215 (1, std::make_pair (0U, 0U));
221 return std::vector<std::pair<unsigned int, unsigned int> > ();
232 return std::vector<std::pair<unsigned int, unsigned int> > ();
237 return std::vector<std::pair<unsigned int, unsigned int> > ();
242 template <
int dim,
int spacedim>
243 std::vector<std::pair<unsigned int, unsigned int> >
252 return std::vector<std::pair<unsigned int, unsigned int> > ();
256 template <
int dim,
int spacedim>
257 std::vector<std::pair<unsigned int, unsigned int> >
266 return std::vector<std::pair<unsigned int, unsigned int> > ();
270 template <
int dim,
int spacedim>
277 if (this->degree < fe_b_other->degree)
279 else if (this->degree == fe_b_other->degree)
286 if (fe_nothing->is_dominating())
303 template <
int dim,
int spacedim>
311 std::ostringstream namebuf;
312 namebuf <<
"FE_Bernstein<" << dim <<
">(" << this->degree <<
")";
313 return namebuf.str();
317 template <
int dim,
int spacedim>
328 template <
int dim,
int spacedim>
329 std::vector<unsigned int>
333 std::vector<unsigned int> dpo(dim+1, 1U);
334 for (
unsigned int i=1; i<dpo.size(); ++i)
335 dpo[i]=dpo[i-1]*(deg-1);
340 template <
int dim,
int spacedim>
345 std::vector<unsigned int> renumber(Utilities::fixed_power<dim>(deg+1));
355 #include "fe_bernstein.inst" 357 DEAL_II_NAMESPACE_CLOSE
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)
virtual FiniteElement< dim, spacedim > * clone() const
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()