]> https://gitweb.dealii.org/ - dealii.git/commitdiff
test for existence of restriction matrices added
authorGuido Kanschat <dr.guido.kanschat@gmail.com>
Sat, 16 Apr 2005 07:11:11 +0000 (07:11 +0000)
committerGuido Kanschat <dr.guido.kanschat@gmail.com>
Sat, 16 Apr 2005 07:11:11 +0000 (07:11 +0000)
git-svn-id: https://svn.dealii.org/trunk@10508 0785d39b-7218-0410-832d-ea1e28bc413d

deal.II/deal.II/include/fe/fe_base.h
deal.II/deal.II/source/fe/fe.cc
tests/bits/fe_tools_08.cc

index 2183916fac7af086a8f7a38fbc8c3bfbcdc0a9e4..2f266802d8c87e4decfb4388f2b1b18468edbcbe 100644 (file)
@@ -771,6 +771,34 @@ class FiniteElementBase : public Subscriptor,
                                       */
     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
index 008ecdbb2a51e0d41df5637b913a59b37d64dce2..6dd0c2d3eb42e7eba64adaadd5aa79b52a1355e7 100644 (file)
@@ -278,6 +278,27 @@ FiniteElementBase<dim>::prolongation_is_implemented () const
 
 
 
+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
index f52ed12b6c41fdb98bebfa8f02a67f0b2b58305d..302c142f88bfc40253fcea4f0c2a5534dd1d3fdf 100644 (file)
@@ -2,7 +2,7 @@
 //    $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
@@ -43,7 +43,7 @@ check_this (const FiniteElement<dim> &fe1,
     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>());

In the beginning the Universe was created. This has made a lot of people very angry and has been widely regarded as a bad move.

Douglas Adams


Typeset in Trocchi and Trocchi Bold Sans Serif.