*/
bool prolongation_is_implemented () const;
+ /**
+ * Return whether this element implements
+ * its restriction matrices. The return
+ * value also indicates whether a call to
+ * the @p get_restriction_matrix
+ * function will generate an error or
+ * not.
+ *
+ * This function is mostly here in order
+ * to allow us to write more efficient
+ * test programs which we run on all
+ * kinds of weird elements, and for which
+ * we simply need to exclude certain
+ * tests in case something is not
+ * implemented. It will in general
+ * probably not be a great help in
+ * applications, since there is not much
+ * one can do if one needs these features
+ * and they are not implemented. This
+ * function could be used to check
+ * whether a call to
+ * <tt>get_restriction_matrix()</tt> will
+ * succeed; however, one then still needs
+ * to cope with the lack of information
+ * this just expresses.
+ */
+ bool restriction_is_implemented () const;
+
/**
* Return a readonly reference to
* the matrix which describes the
+template <int dim>
+bool
+FiniteElementBase<dim>::restriction_is_implemented () const
+{
+ for (unsigned int c=0; c<GeometryInfo<dim>::children_per_cell; ++c)
+ {
+ Assert ((restriction[c].m() == this->dofs_per_cell) ||
+ (restriction[c].m() == 0),
+ ExcInternalError());
+ Assert ((restriction[c].n() == this->dofs_per_cell) ||
+ (restriction[c].n() == 0),
+ ExcInternalError());
+ if ((restriction[c].m() == 0) ||
+ (restriction[c].n() == 0))
+ return false;
+ }
+ return true;
+}
+
+
+
template <int dim>
bool
FiniteElementBase<dim>::constraints_are_implemented () const
// $Id$
// Version: $Name$
//
-// Copyright (C) 2003, 2004 by the deal.II authors
+// Copyright (C) 2003, 2004, 2005 by the deal.II authors
//
// This file is subject to QPL and may not be distributed
// without copyright and license information. Please refer
return;
// we need prolongation matrices in
// fe2
- if (!fe2.prolongation_is_implemented())
+ if (!fe2.restriction_is_implemented())
return;
std::auto_ptr<Triangulation<dim> > tria(make_tria<dim>());