]> https://gitweb.dealii.org/ - dealii.git/commitdiff
update tests for FESystem
authorTimo Heister <timo.heister@gmail.com>
Fri, 28 Sep 2012 19:32:59 +0000 (19:32 +0000)
committerTimo Heister <timo.heister@gmail.com>
Fri, 28 Sep 2012 19:32:59 +0000 (19:32 +0000)
git-svn-id: https://svn.dealii.org/trunk@26863 0785d39b-7218-0410-832d-ea1e28bc413d

tests/fe/system_01.cc [moved from tests/fe/system_1.cc with 98% similarity]
tests/fe/system_01/cmp/generic [moved from tests/fe/system_1/cmp/generic with 100% similarity]
tests/fe/system_02.cc [new file with mode: 0644]
tests/fe/system_02/cmp/generic [new file with mode: 0644]

similarity index 98%
rename from tests/fe/system_1.cc
rename to tests/fe/system_01.cc
index b67f13d938b1a029138022fd7e8c365db00e7900..eb4c89fff029b8847c5ca9e89ec2c1430085324d 100644 (file)
@@ -74,7 +74,7 @@ check(const FiniteElement<dim> &fe1,
 int
 main()
 {
-  std::ofstream logfile ("system_1/output");
+  std::ofstream logfile ("system_01/output");
   deallog << std::setprecision(PRECISION);
   deallog << std::fixed;  
   deallog.attach(logfile);
diff --git a/tests/fe/system_02.cc b/tests/fe/system_02.cc
new file mode 100644 (file)
index 0000000..4c835c2
--- /dev/null
@@ -0,0 +1,74 @@
+//----------------------------  system_1.cc  ---------------------------
+//    system_1.cc,v 1.3 2003/06/09 21:55:00 wolf Exp
+//    Version: 
+//
+//    Copyright (C) 2003, 2005 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
+//    fuqher information on this license.
+//
+//----------------------------  system_1.cc  ---------------------------
+
+
+// check what happens with an FE_System if we hand it 0 components
+
+#include "../tests.h"
+#include <deal.II/base/logstream.h>
+#include <deal.II/fe/fe_q.h>
+#include <deal.II/fe/fe_dgq.h>
+#include <deal.II/fe/fe_dgp.h>
+#include <deal.II/fe/fe_system.h>
+#include <deal.II/fe/fe_tools.h>
+
+#include <fstream>
+#include <string>
+
+#define PRECISION 5
+
+
+
+template<int dim>
+void
+check(FESystem<dim> &fe)
+{
+  deallog << fe.get_name() << std::endl;
+  deallog << "components: " << fe.n_components() << std::endl;
+  deallog << "blocks: " << fe.n_blocks() << std::endl;
+  deallog << "conforms H1: " << fe.conforms(FiniteElementData<dim>::H1) << std::endl;
+  deallog << "n_base_elements: " << fe.n_base_elements() << std::endl;
+}
+
+int
+main()
+{
+  std::ofstream logfile ("system_02/output");
+  deallog << std::setprecision(PRECISION);
+  deallog << std::fixed;  
+  deallog.attach(logfile);
+  deallog.depth_console(0);
+  deallog.threshold_double(1.e-10);
+
+  {
+    FESystem<2> fe(FE_Q<2>(1), 2, FE_Q<2>(1), 1);
+    check<2>(fe);
+  }
+  {
+    FESystem<2> fe(FE_Q<2>(1), 2, FE_DGQ<2>(2),0, FE_Q<2>(1), 1);
+    check<2>(fe);
+  }
+  {
+    FESystem<2> fe(FESystem<2>(FE_Q<2>(1), 2), 1, FE_Q<2>(1), 1);
+    check<2>(fe);
+  }
+  {
+    FESystem<2> fe(FESystem<2>(FE_Q<2>(1), 2), 1, FE_DGQ<2>(2),0, FE_Q<2>(1), 1);
+    check<2>(fe);
+  }
+  
+  return 0;
+}
+
+
+
diff --git a/tests/fe/system_02/cmp/generic b/tests/fe/system_02/cmp/generic
new file mode 100644 (file)
index 0000000..bad0cea
--- /dev/null
@@ -0,0 +1,21 @@
+
+DEAL::FESystem<2>[FE_Q<2>(1)^2-FE_Q<2>(1)]
+DEAL::components: 3
+DEAL::blocks: 3
+DEAL::conforms H1: 1
+DEAL::n_base_elements: 2
+DEAL::FESystem<2>[FE_Q<2>(1)^2-FE_Q<2>(1)]
+DEAL::components: 3
+DEAL::blocks: 3
+DEAL::conforms H1: 1
+DEAL::n_base_elements: 2
+DEAL::FESystem<2>[FESystem<2>[FE_Q<2>(1)^2]-FE_Q<2>(1)]
+DEAL::components: 3
+DEAL::blocks: 2
+DEAL::conforms H1: 1
+DEAL::n_base_elements: 2
+DEAL::FESystem<2>[FESystem<2>[FE_Q<2>(1)^2]-FE_Q<2>(1)]
+DEAL::components: 3
+DEAL::blocks: 2
+DEAL::conforms H1: 1
+DEAL::n_base_elements: 2

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.