33template <
int dim,
int spacedim>
45 ExcMessage(
"This element can only be used for polynomial degrees "
46 "greater than zero"));
52 for (
unsigned int d = 0; d < dim; ++d)
60template <
int dim,
int spacedim>
64 Polynomials::generate_complete_Lagrange_basis(points.get_points())),
73 ExcMessage(
"This element can only be used for polynomial degrees "
80 for (
unsigned int d = 0; d < dim; ++d)
88template <
int dim,
int spacedim>
96 std::ostringstream namebuf;
98 const unsigned int n_points = this->
degree + 1;
99 std::vector<double> points(n_points);
102 this->unit_support_points;
103 unsigned int index = 0;
123 Assert(index == n_points || (dim == 1 && index == n_points + 1),
125 "Could not decode support points in one coordinate direction."));
128 for (
unsigned int j = 0; j < n_points; ++j)
129 if (std::fabs(points[j] -
static_cast<double>(j) / this->
degree) > 1e-15)
139 <<
">(QIterated(QTrapezoid()," << this->
degree <<
"))";
142 << this->degree <<
")";
149 for (
unsigned int j = 0; j < n_points; ++j)
150 if (points[j] != points_gl.point(j)[0])
160 <<
">(QUnknownNodes(" << this->degree <<
"))";
162 return namebuf.str();
167template <
int dim,
int spacedim>
168std::unique_ptr<FiniteElement<dim, spacedim>>
171 return std::make_unique<FE_Q_DG0<dim, spacedim>>(*this);
176template <
int dim,
int spacedim>
180 std::vector<double> &nodal_dofs)
const
182 Assert(support_point_values.size() == this->unit_support_points.size(),
184 this->unit_support_points.size()));
185 Assert(nodal_dofs.size() == this->n_dofs_per_cell(),
193 const std::pair<unsigned int, unsigned int> index =
195 nodal_dofs[i] = support_point_values[i](index.first);
199 nodal_dofs.back() = 0.;
204template <
int dim,
int spacedim>
214 (x_source_fe.
get_name().find(
"FE_Q_DG0<") == 0) ||
215 (
dynamic_cast<const FEQDG0 *
>(&x_source_fe) !=
nullptr),
218 Assert(interpolation_matrix.
m() == this->n_dofs_per_cell(),
220 this->n_dofs_per_cell()));
226 x_source_fe, interpolation_matrix);
231template <
int dim,
int spacedim>
242template <
int dim,
int spacedim>
243std::vector<unsigned int>
246 std::vector<unsigned int> dpo(dim + 1, 1U);
247 for (
unsigned int i = 1; i < dpo.size(); ++i)
248 dpo[i] = dpo[i - 1] * (deg - 1);
256template <
int dim,
int spacedim>
259 const unsigned int shape_index,
260 const unsigned int face_index)
const
272template <
int dim,
int spacedim>
273std::pair<Table<2, bool>, std::vector<unsigned int>>
280 constant_modes(0, i) =
true;
285 return std::pair<Table<2, bool>, std::vector<unsigned int>>(
286 constant_modes, std::vector<unsigned int>(2, 0));
291template <
int dim,
int spacedim>
295 const unsigned int codim)
const
314 if (this->degree < fe_dg0_other->
degree)
316 else if (this->degree == fe_dg0_other->degree)
324 if (fe_nothing->is_dominating())
339#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)