31template <
int dim,
int spacedim>
43 ExcMessage(
"This element can only be used for polynomial degrees "
44 "greater than zero"));
50 for (
unsigned int d = 0; d < dim; ++d)
58template <
int dim,
int spacedim>
62 Polynomials::generate_complete_Lagrange_basis(points.get_points())),
71 ExcMessage(
"This element can only be used for polynomial degrees "
78 for (
unsigned int d = 0; d < dim; ++d)
86template <
int dim,
int spacedim>
94 std::ostringstream namebuf;
96 const unsigned int n_points = this->
degree + 1;
97 std::vector<double> points(n_points);
100 this->unit_support_points;
101 unsigned int index = 0;
121 Assert(index == n_points || (dim == 1 && index == n_points + 1),
123 "Could not decode support points in one coordinate direction."));
126 for (
unsigned int j = 0; j < n_points; ++j)
127 if (std::fabs(points[j] -
static_cast<double>(j) / this->
degree) > 1e-15)
137 <<
">(QIterated(QTrapezoid()," << this->
degree <<
"))";
140 << this->degree <<
")";
147 for (
unsigned int j = 0; j < n_points; ++j)
148 if (points[j] != points_gl.point(j)[0])
158 <<
">(QUnknownNodes(" << this->degree <<
"))";
160 return namebuf.str();
165template <
int dim,
int spacedim>
166std::unique_ptr<FiniteElement<dim, spacedim>>
169 return std::make_unique<FE_Q_DG0<dim, spacedim>>(*this);
174template <
int dim,
int spacedim>
178 std::vector<double> &nodal_dofs)
const
180 Assert(support_point_values.size() == this->unit_support_points.size(),
182 this->unit_support_points.size()));
183 Assert(nodal_dofs.size() == this->n_dofs_per_cell(),
191 const std::pair<unsigned int, unsigned int> index =
193 nodal_dofs[i] = support_point_values[i](index.first);
197 nodal_dofs.back() = 0.;
202template <
int dim,
int spacedim>
212 (x_source_fe.
get_name().find(
"FE_Q_DG0<") == 0) ||
213 (
dynamic_cast<const FEQDG0 *
>(&x_source_fe) !=
nullptr),
216 Assert(interpolation_matrix.
m() == this->n_dofs_per_cell(),
218 this->n_dofs_per_cell()));
224 x_source_fe, interpolation_matrix);
229template <
int dim,
int spacedim>
240template <
int dim,
int spacedim>
241std::vector<unsigned int>
244 std::vector<unsigned int> dpo(dim + 1, 1U);
245 for (
unsigned int i = 1; i < dpo.size(); ++i)
246 dpo[i] = dpo[i - 1] * (deg - 1);
254template <
int dim,
int spacedim>
257 const unsigned int shape_index,
258 const unsigned int face_index)
const
270template <
int dim,
int spacedim>
271std::pair<Table<2, bool>, std::vector<unsigned int>>
278 constant_modes(0, i) =
true;
283 return std::pair<Table<2, bool>, std::vector<unsigned int>>(
284 constant_modes, std::vector<unsigned int>(2, 0));
289template <
int dim,
int spacedim>
293 const unsigned int codim)
const
312 if (this->degree < fe_dg0_other->
degree)
314 else if (this->degree == fe_dg0_other->degree)
322 if (fe_nothing->is_dominating())
337#include "fe/fe_q_dg0.inst"
virtual void get_interpolation_matrix(const FiniteElement< dim, spacedim > &source, FullMatrix< double > &matrix) const override
void initialize(const std::vector< Point< 1 > > &support_points_1d)
virtual bool has_support_on_face(const unsigned int shape_index, const unsigned int face_index) const override
FE_Q_Base(const ScalarPolynomialsBase< dim > &poly_space, const FiniteElementData< dim > &fe_data, const std::vector< bool > &restriction_is_additive_flags)
virtual void get_interpolation_matrix(const FiniteElement< dim, spacedim > &source, FullMatrix< double > &matrix) const override
virtual std::unique_ptr< FiniteElement< dim, spacedim > > clone() const override
virtual std::pair< Table< 2, bool >, std::vector< unsigned int > > get_constant_modes() const override
FE_Q_DG0(const unsigned int p)
virtual std::string get_name() const override
static std::vector< bool > get_riaf_vector(const unsigned int degree)
virtual bool has_support_on_face(const unsigned int shape_index, const unsigned int face_index) const override
virtual void convert_generalized_support_point_values_to_dof_values(const std::vector< Vector< double > > &support_point_values, std::vector< double > &nodal_values) const override
virtual FiniteElementDomination::Domination compare_for_domination(const FiniteElement< dim, spacedim > &fe_other, const unsigned int codim=0) const override final
static std::vector< unsigned int > get_dpo_vector(const unsigned int degree)
const unsigned int degree
unsigned int n_dofs_per_cell() const
unsigned int n_components() const
const unsigned int dofs_per_cell
virtual std::string get_name() const =0
std::pair< unsigned int, unsigned int > system_to_component_index(const unsigned int index) const
FiniteElement(const FiniteElementData< dim > &fe_data, const std::vector< bool > &restriction_is_additive_flags, const std::vector< ComponentMask > &nonzero_components)
std::vector< Point< dim > > unit_support_points
const std::vector< Point< dim > > & get_points() const
unsigned int size() const
#define DEAL_II_NAMESPACE_OPEN
#define DEAL_II_NAMESPACE_CLOSE
#define DEAL_II_NOT_IMPLEMENTED()
#define Assert(cond, exc)
static ::ExceptionBase & ExcImpossibleInDim(int arg1)
#define AssertDimension(dim1, dim2)
static ::ExceptionBase & ExcDimensionMismatch(std::size_t arg1, std::size_t arg2)
static ::ExceptionBase & ExcInterpolationNotImplemented()
static ::ExceptionBase & ExcMessage(std::string arg1)
#define AssertThrow(cond, exc)
@ either_element_can_dominate
@ other_element_dominates
@ neither_element_dominates
std::string dim_string(const int dim, const int spacedim)
constexpr T fixed_power(const T t)