compare_for_face_domination (const FiniteElement<dim,spacedim> &fe_other) const;
//@}
+ /**
+ * Attempt to construct an FE_Q object of degree 0
+ *
+ * @ingroup Exceptions
+ */
+ DeclExceptionMsg (ExcFEQCannotHaveDegree0,
+ "FE_Q can only be used for polynomial degrees "
+ "greater than zero. If you want an element of polynomial "
+ "degree zero, then it cannot be continuous and you "
+ "will want to use FE_DGQ<dim>(0).");
+
protected:
/**
* Only for internal use. Its full name is @p get_dofs_per_object_vector
namespace
{
+ template <int dim, int spacedim>
std::vector<Point<1> >
get_QGaussLobatto_points (const unsigned int degree)
{
if (degree > 0)
return QGaussLobatto<1>(degree+1).get_points();
else
- AssertThrow(false,
- ExcMessage ("FE_Q can only be used for polynomial degrees "
- "greater than zero. If you want an element of polynomial "
- "degree zero, then it cannot be continuous and you "
- "will want to use FE_DGQ<dim>(0)."));
+ {
+ typedef FE_Q_Base<TensorProductPolynomials<dim>, dim, spacedim> FEQ;
+ AssertThrow(false, typename FEQ::ExcFEQCannotHaveDegree0());
+ }
return std::vector<Point<1> >();
}
}
FE_Q<dim,spacedim>::FE_Q (const unsigned int degree)
:
FE_Q_Base<TensorProductPolynomials<dim>, dim, spacedim>
- (TensorProductPolynomials<dim>(Polynomials::generate_complete_Lagrange_basis(get_QGaussLobatto_points(degree))),
+ (TensorProductPolynomials<dim>(Polynomials::generate_complete_Lagrange_basis(get_QGaussLobatto_points<dim,spacedim>(degree))),
FiniteElementData<dim>(this->get_dpo_vector(degree),
1, degree,
FiniteElementData<dim>::H1),
std::vector<bool> (1, false))
{
- this->initialize(get_QGaussLobatto_points(degree));
+ this->initialize(get_QGaussLobatto_points<dim,spacedim>(degree));
}
FiniteElementData<dim>::H1),
std::vector<bool> (1, false))
{
- const unsigned int degree = points.size()-1;
- (void)degree;
- Assert (degree > 0,
- ExcMessage ("This element can only be used for polynomial degrees "
- "at least zero"));
-
this->initialize(points.get_points());
}
template <class PolynomialType, int dim, int spacedim>
std::vector<unsigned int>
-FE_Q_Base<PolynomialType,dim,spacedim>::get_dpo_vector(const unsigned int deg)
+FE_Q_Base<PolynomialType,dim,spacedim>::get_dpo_vector(const unsigned int degree)
{
- AssertThrow(deg>0,ExcMessage("FE_Q needs to be of degree > 0."));
+ AssertThrow(degree>0, ExcFEQCannotHaveDegree0());
std::vector<unsigned int> dpo(dim+1, 1U);
for (unsigned int i=1; i<dpo.size(); ++i)
- dpo[i]=dpo[i-1]*(deg-1);
+ dpo[i]=dpo[i-1]*(degree-1);
return dpo;
}