From eee90889e8e9d2e5cdac8e1010086241d96181f4 Mon Sep 17 00:00:00 2001
From: wolf
Date: Mon, 24 Feb 2003 15:52:26 +0000
Subject: [PATCH] FE::prolongation_is_implemented
git-svn-id: https://svn.dealii.org/trunk@7230 0785d39b-7218-0410-832d-ea1e28bc413d
---
deal.II/deal.II/include/fe/fe_base.h | 43 +++++++++++++++++++++++++---
deal.II/deal.II/source/fe/fe.cc | 20 +++++++++++++
deal.II/doc/news/2002/c-3-4.html | 9 +++---
3 files changed, 64 insertions(+), 8 deletions(-)
diff --git a/deal.II/deal.II/include/fe/fe_base.h b/deal.II/deal.II/include/fe/fe_base.h
index 56b46abde0..9a00eee928 100644
--- a/deal.II/deal.II/include/fe/fe_base.h
+++ b/deal.II/deal.II/include/fe/fe_base.h
@@ -674,11 +674,46 @@ class FiniteElementBase : public Subscriptor,
* implemented in the derived
* finite element class, this
* function aborts with
- * @p{ExcEmbeddingVoid}.
+ * @p{ExcEmbeddingVoid}. You can
+ * check whether this is the case
+ * by calling the
+ * @ref{prolongation_is_implemented()}.
*/
const FullMatrix & prolongate (const unsigned int child) const;
- /**
+ /**
+ * Return whether this element
+ * implements its prolongation
+ * matrices. The return value
+ * also indicates whether a call
+ * to the @p{prolongate} 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 @p{prolongate()}
+ * will succeed; however, one
+ * then still needs to cope with
+ * the lack of information this
+ * just expresses.
+ */
+ bool prolongation_is_implemented () const;
+
+ /**
* Return a readonly reference to
* the matrix which describes the
* constraints at the interface
@@ -717,7 +752,7 @@ class FiniteElementBase : public Subscriptor,
* will generate an error or not.
*
* This function is mostly here
- * in order to allow us write
+ * in order to allow us to write
* more efficient test programs
* which we run on all kinds of
* weird elements, and for which
@@ -725,7 +760,7 @@ class FiniteElementBase : public Subscriptor,
* certain tests in case hanging
* node constraints are not
* implemented. It will in
- * general probablz not be a
+ * general probably not be a
* great help in applications,
* since there is not much one
* can do if one needs hanging
diff --git a/deal.II/deal.II/source/fe/fe.cc b/deal.II/deal.II/source/fe/fe.cc
index d830740156..5e892ad6c9 100644
--- a/deal.II/deal.II/source/fe/fe.cc
+++ b/deal.II/deal.II/source/fe/fe.cc
@@ -259,6 +259,26 @@ FiniteElementBase::prolongate (const unsigned int child) const
}
+template
+bool
+FiniteElementBase::prolongation_is_implemented () const
+{
+ for (unsigned int c=0; c::children_per_cell; ++c)
+ {
+ Assert ((prolongation[c].m() == dofs_per_cell) ||
+ (prolongation[c].m() == 0),
+ ExcInternalError());
+ Assert ((prolongation[c].n() == dofs_per_cell) ||
+ (prolongation[c].n() == 0),
+ ExcInternalError());
+ if ((prolongation[c].m() == 0) ||
+ (prolongation[c].n() == 0))
+ return false;
+ }
+ return true;
+}
+
+
template
bool
diff --git a/deal.II/doc/news/2002/c-3-4.html b/deal.II/doc/news/2002/c-3-4.html
index 6aff88d819..3eab5044c1 100644
--- a/deal.II/doc/news/2002/c-3-4.html
+++ b/deal.II/doc/news/2002/c-3-4.html
@@ -764,10 +764,11 @@ contributor's names are abbreviated by WB (Wolfgang Bangerth), GK
- New: There is now a function FiniteElement::constraints_are_implemented
that
- informs the caller about whether the finite element in question in fact
- implements its hanging node constraints.
+ New: There are now functions FiniteElement::prolongation_is_implemented
and
+ FiniteElement::constraints_are_implemented
+ that inform the caller about whether the finite element in question in
+ fact implements its prolongation matrices and hanging node constraints.
(WB 2003/02/15)
--
2.39.5