]> https://gitweb.dealii.org/ - dealii-svn.git/commitdiff
Simplify test code
authorkronbichler <kronbichler@0785d39b-7218-0410-832d-ea1e28bc413d>
Thu, 27 Feb 2014 10:02:26 +0000 (10:02 +0000)
committerkronbichler <kronbichler@0785d39b-7218-0410-832d-ea1e28bc413d>
Thu, 27 Feb 2014 10:02:26 +0000 (10:02 +0000)
git-svn-id: https://svn.dealii.org/trunk@32565 0785d39b-7218-0410-832d-ea1e28bc413d

tests/matrix_free/thread_correctness_hp.cc

index 0d9015d9bbd76fe29d69f10eefdd408261811c73..88d85f98e3d2817990e23561a94299873a5694da 100644 (file)
@@ -49,35 +49,21 @@ public:
   {
     // Ask MatrixFree for cell_range for different
     // orders
-    std::pair<unsigned int,unsigned int> subrange_deg =
-      data.create_cell_subrange_hp (cell_range, 1);
-    if (subrange_deg.second > subrange_deg.first)
-      helmholtz_operator<dim,1,Vector<Number> > (data, dst, src,
-                                        subrange_deg);
-    subrange_deg = data.create_cell_subrange_hp (cell_range, 2);
-    if (subrange_deg.second > subrange_deg.first)
-      helmholtz_operator<dim,2,Vector<Number> > (data, dst, src,
-                                        subrange_deg);
-    subrange_deg = data.create_cell_subrange_hp (cell_range, 3);
-    if (subrange_deg.second > subrange_deg.first)
-      helmholtz_operator<dim,3,Vector<Number> > (data, dst, src,
-                                        subrange_deg);
-    subrange_deg = data.create_cell_subrange_hp (cell_range, 4);
-    if (subrange_deg.second > subrange_deg.first)
-      helmholtz_operator<dim,4,Vector<Number> > (data, dst, src,
-                                        subrange_deg);
-    subrange_deg = data.create_cell_subrange_hp (cell_range, 5);
-    if (subrange_deg.second > subrange_deg.first)
-      helmholtz_operator<dim,5,Vector<Number> > (data, dst, src,
-                                        subrange_deg);
-    subrange_deg = data.create_cell_subrange_hp (cell_range, 6);
-    if (subrange_deg.second > subrange_deg.first)
-      helmholtz_operator<dim,6,Vector<Number> > (data, dst, src,
-                                        subrange_deg);
-    subrange_deg = data.create_cell_subrange_hp (cell_range, 7);
-    if (subrange_deg.second > subrange_deg.first)
-      helmholtz_operator<dim,7,Vector<Number> > (data, dst, src,
-                                        subrange_deg);
+    std::pair<unsigned int,unsigned int> subrange_deg;
+#define CALL_METHOD(degree)                                             \
+    subrange_deg = data.create_cell_subrange_hp(cell_range, degree);    \ 
+    if (subrange_deg.second > subrange_deg.first)                       \
+      helmholtz_operator<dim,degree,Vector<Number> > (data, dst, src, subrange_deg)
+
+    CALL_METHOD(1);
+    CALL_METHOD(2);
+    CALL_METHOD(3);
+    CALL_METHOD(4);
+    CALL_METHOD(5);
+    CALL_METHOD(6);
+    CALL_METHOD(7);
+
+#undef CALL_METHOD
   }
 
   void vmult (Vector<Number>       &dst,

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.