]> https://gitweb.dealii.org/ - dealii.git/commitdiff
Another new test.
authorWolfgang Bangerth <bangerth@math.tamu.edu>
Wed, 3 Jul 2013 16:04:30 +0000 (16:04 +0000)
committerWolfgang Bangerth <bangerth@math.tamu.edu>
Wed, 3 Jul 2013 16:04:30 +0000 (16:04 +0000)
git-svn-id: https://svn.dealii.org/trunk@29928 0785d39b-7218-0410-832d-ea1e28bc413d

tests/deal.II/fe_values_view_invalid_03_nonsymmetric.cc [new file with mode: 0644]
tests/deal.II/fe_values_view_invalid_03_nonsymmetric/cmp/generic [new file with mode: 0644]

diff --git a/tests/deal.II/fe_values_view_invalid_03_nonsymmetric.cc b/tests/deal.II/fe_values_view_invalid_03_nonsymmetric.cc
new file mode 100644 (file)
index 0000000..988eb06
--- /dev/null
@@ -0,0 +1,87 @@
+//----------------------------------------------------------------------
+//    $Id$
+//    Version: $Name$
+//
+//    Copyright (C) 2007, 2008, 2013 by the deal.II authors
+//
+//    This file is subject to QPL and may not be  distributed
+//    without copyright and license information. Please refer
+//    to the file deal.II/doc/license.html for the  text  and
+//    further information on this license.
+//
+//----------------------------------------------------------------------
+
+
+// make sure FEValuesExtractors::Tensor can be default-constructed
+// but that it produces an invalid, unusable object
+
+#include "../tests.h"
+#include <deal.II/base/logstream.h>
+#include <deal.II/base/quadrature_lib.h>
+#include <deal.II/grid/grid_generator.h>
+#include <deal.II/dofs/dof_handler.h>
+#include <deal.II/fe/fe_q.h>
+#include <deal.II/fe/fe_system.h>
+#include <deal.II/fe/fe_values.h>
+
+#include <fstream>
+
+
+
+template<int dim>
+void test (const Triangulation<dim>& tr,
+          const FiniteElement<dim>& fe)
+{
+  DoFHandler<dim> dof(tr);
+  dof.distribute_dofs(fe);
+
+  const QGauss<dim> quadrature(2);
+  FEValues<dim> fe_values (fe, quadrature,
+                          update_values);
+  fe_values.reinit (dof.begin_active());
+
+  FEValuesExtractors::Tensor<2> extr; // invalid object
+  try
+    {
+      fe_values[extr];             // invalid access
+    }
+  catch (ExceptionBase &e)
+    {
+      deallog << e.get_exc_name() << std::endl;
+      goto ok;
+    }
+
+  Assert (false, ExcMessage ("No exception!?"));
+
+  ok:
+  ;
+}
+
+
+
+template<int dim>
+void test()
+{
+  Triangulation<dim> tr;
+  GridGenerator::hyper_cube(tr);
+
+  FESystem<dim> fe (FE_Q<dim>(1), dim*dim);
+  test(tr, fe);
+}
+
+
+int main()
+{
+  deal_II_exceptions::disable_abort_on_exception();
+
+  std::ofstream logfile ("fe_values_view_invalid_03_nonsymmetric/output");
+  deallog << std::setprecision (2);
+
+  deallog.attach(logfile);
+  deallog.depth_console (0);
+  deallog.threshold_double(1.e-7);
+
+  test<1>();
+  test<2>();
+  test<3>();
+}
diff --git a/tests/deal.II/fe_values_view_invalid_03_nonsymmetric/cmp/generic b/tests/deal.II/fe_values_view_invalid_03_nonsymmetric/cmp/generic
new file mode 100644 (file)
index 0000000..c6a52b9
--- /dev/null
@@ -0,0 +1,4 @@
+
+DEAL::ExcIndexRange (tensor.first_tensor_component, 0, fe_values_views_cache.second_order_tensors.size())
+DEAL::ExcIndexRange (tensor.first_tensor_component, 0, fe_values_views_cache.second_order_tensors.size())
+DEAL::ExcIndexRange (tensor.first_tensor_component, 0, fe_values_views_cache.second_order_tensors.size())

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.