*/
FE_DGQ (const unsigned int p);
- /**
- * Constructor for tensor product
- * polynomials based on
- * Polynomials::Lagrange
- * interpolation of the support
- * points in the quadrature rule
- * <tt>points</tt>. The degree of
- * these polynomials is
- * <tt>points.size()-1</tt>.
- */
- FE_DGQ (const Quadrature<1>& points);
-
/**
* Return a string that uniquely
* identifies a finite
protected:
+ /**
+ * Constructor for tensor product
+ * polynomials based on
+ * Polynomials::Lagrange
+ * interpolation of the support
+ * points in the quadrature rule
+ * <tt>points</tt>. The degree of
+ * these polynomials is
+ * <tt>points.size()-1</tt>.
+ *
+ * Note: The FE_DGQ::clone function
+ * does not work properly for FE with
+ * arbitrary nodes!
+ */
+ FE_DGQ (const Quadrature<1>& points);
/**
* @p clone function instead of
template <int dim1> friend class MappingQ;
};
+
+
+/**
+ * Implementation of scalar, discontinuous tensor product elements
+ * based on Lagrange polynomials with arbitrary nodes.
+ *
+ * See base class documentation for details.
+ *
+ * @author F. Prill 2006
+ */
+template <int dim>
+class FE_DGQArbitraryNodes : public FE_DGQ<dim>
+{
+ public:
+ /**
+ * Constructor for tensor product
+ * polynomials based on
+ * Polynomials::Lagrange
+ * interpolation of the support
+ * points in the quadrature rule
+ * <tt>points</tt>. The degree of
+ * these polynomials is
+ * <tt>points.size()-1</tt>.
+ */
+ FE_DGQArbitraryNodes (const Quadrature<1>& points);
+
+ /**
+ * Return a string that uniquely
+ * identifies a finite
+ * element. This class returns
+ * <tt>FE_DGQArbitraryNodes<dim>(degree)</tt> ,
+ * with <tt>dim</tt> and <tt>degree</tt>
+ * replaced by appropriate
+ * values.
+ */
+ virtual std::string get_name () const;
+
+ protected:
+ /**
+ * @p clone function instead of
+ * a copy constructor.
+ *
+ * This function is needed by the
+ * constructors of @p FESystem.
+ */
+ virtual FiniteElement<dim> *clone() const;
+};
+
+
/*@}*/
DEAL_II_NAMESPACE_CLOSE
FiniteElement<dim> *
FE_DGQ<dim>::clone() const
{
- // TODO[Prill] : There must be a better way
- // to extract 1D quadrature points from the
- // tensor product FE.
-
- // Construct a dummy quadrature formula
- // containing the FE's nodes:
- std::vector<Point<1> > qpoints(this->degree+1);
- for (unsigned int i=0; i<=this->degree; ++i)
- qpoints[i] = Point<1>(this->unit_support_points[i][0]);
- Quadrature<1> pquadrature(qpoints);
-
- return new FE_DGQ<dim>(pquadrature);
+ return new FE_DGQ<dim>(this->degree);
}
+template <int dim>
+FE_DGQArbitraryNodes<dim>::FE_DGQArbitraryNodes (const Quadrature<1>& points)
+ : FE_DGQ<dim>(points)
+{}
+
+
+
+template <int dim>
+std::string
+FE_DGQArbitraryNodes<dim>::get_name () const
+{
+ // note that the
+ // FETools::get_fe_from_name
+ // function does not work for
+ // FE_DGQArbitraryNodes since
+ // there is no initialization by
+ // a degree value.
+ std::ostringstream namebuf;
+ namebuf << "FE_DGQArbitraryNodes<" << dim << ">(" << this->degree << ")";
+
+ return namebuf.str();
+}
+
+
+
+template <int dim>
+FiniteElement<dim> *
+FE_DGQArbitraryNodes<dim>::clone() const
+{
+ // TODO[Prill] : There must be a better way
+ // to extract 1D quadrature points from the
+ // tensor product FE.
+
+ // Construct a dummy quadrature formula
+ // containing the FE's nodes:
+ std::vector<Point<1> > qpoints(this->degree+1);
+ for (unsigned int i=0; i<=this->degree; ++i)
+ qpoints[i] = Point<1>(this->unit_support_points[i][0]);
+ Quadrature<1> pquadrature(qpoints);
+
+ return new FE_DGQArbitraryNodes<dim>(pquadrature);
+}
+
+
+
template class FE_DGQ<deal_II_dimension>;
+template class FE_DGQArbitraryNodes<deal_II_dimension>;
DEAL_II_NAMESPACE_CLOSE