]> https://gitweb.dealii.org/ - dealii-svn.git/commitdiff
Make this test case 3d aware. Like the grid test, this program is linked against...
authorwolf <wolf@0785d39b-7218-0410-832d-ea1e28bc413d>
Wed, 17 Feb 1999 09:02:38 +0000 (09:02 +0000)
committerwolf <wolf@0785d39b-7218-0410-832d-ea1e28bc413d>
Wed, 17 Feb 1999 09:02:38 +0000 (09:02 +0000)
git-svn-id: https://svn.dealii.org/trunk@825 0785d39b-7218-0410-832d-ea1e28bc413d

deal.II/deal.II/Attic/examples/dof/Makefile
deal.II/deal.II/Attic/examples/dof/dof_test.cc
tests/big-tests/dof/Makefile
tests/big-tests/dof/dof_test.cc

index c8b7ad835f06e962d0a1aabb6523c6e5bbfb8f72..0de18e871a6a2f65393b7f35ed23fbba82bb832f 100644 (file)
@@ -19,7 +19,7 @@ user-libs =
 
 # To run the program, use "make run"; to give parameters to the program,
 # give the parameters to the following variable:
-run-parameters  = $(target).prm
+run-parameters  = 2 $(target).prm ; $(target) 3 $(target).prm
 
 # To execute additional action apart from running the program, fill
 # in this list:
@@ -49,8 +49,8 @@ h-files     = $(wildcard *.h)
 lib-h-files = $(wildcard ../../include/*/*.h)
 
 # list of libraries needed to link with
-libs     = ./Obj.a   ../../lib/libdeal_II_2d.a   ../../../lac/lib/liblac.a   ../../../base/lib/libbase.a
-libs.g   = ./Obj.g.a ../../lib/libdeal_II_2d.g.a ../../../lac/lib/liblac.g.a ../../../base/lib/libbase.g.a ../../../base/lib/libbase.g.a
+libs     = ./Obj.a   ../../lib/libdeal_II_2d.a   ../../lib/libdeal_II_3d.a   ../../../lac/lib/liblac.a   ../../../base/lib/libbase.a
+libs.g   = ./Obj.g.a ../../lib/libdeal_II_2d.g.a ../../lib/libdeal_II_3d.g.a ../../../lac/lib/liblac.g.a ../../../base/lib/libbase.g.a ../../../base/lib/libbase.g.a
 
 
 # check whether we use debug mode or not
index d111755c67986451d5c67bf1a23e30867d65460c..729dac3c90d34dfabc9e1808e2113bcdfadddf76 100644 (file)
@@ -136,11 +136,10 @@ void TestCases<dim>::declare_parameters (ParameterHandler &prm) {
 
 template <int dim>
 void TestCases<dim>::run (ParameterHandler &prm) {
-  cout << "Test case = " << prm.get ("Test run") << endl
+  cout << "Dimension = " << dim
+       << ", Test case = " << prm.get ("Test run") << endl
        << endl;
   
-  cout << "    Making grid..." << endl;
-
   string test = prm.get ("Test run");
   unsigned int test_case = 1;
   if (test=="zoom in") test_case = 1;
@@ -154,6 +153,7 @@ void TestCases<dim>::run (ParameterHandler &prm) {
          cerr << "This test seems not to be implemented!" << endl;
 
   
+  cout << "    Making grid..." << endl;  
   Boundary<dim> *boundary = 0;
   
   switch (test_case) 
@@ -180,8 +180,6 @@ void TestCases<dim>::run (ParameterHandler &prm) {
            tria->execute_refinement ();
          };
 
-//     tria->refine_global (5);
-       
        break;
       }
       
@@ -268,7 +266,7 @@ void TestCases<dim>::run (ParameterHandler &prm) {
   dof->make_sparsity_pattern (sparsity);
   int unconstrained_bandwidth = sparsity.bandwidth();
 
-  cout << "    Writing sparsity pattern... (This may take a while)" << endl;
+  cout << "    Writing sparsity pattern..." << endl;
   ofstream sparsity_out (prm.get("Sparsity file").c_str());
   sparsity.print_gnuplot (sparsity_out);
 
@@ -285,11 +283,6 @@ void TestCases<dim>::run (ParameterHandler &prm) {
   sparsity.print_gnuplot (c_sparsity_out);
 
 
-//  DataOut<dim> dataout;
-//  dataout.attach_dof_handler (*dof);
-//  ofstream o("o.inp");
-//  dataout.write_ucd (o);
-  
   cout << endl
        << "    Total number of cells         = " << tria->n_cells() << endl
        << "    Total number of active cells  = " << tria->n_active_cells() << endl
@@ -310,18 +303,44 @@ void TestCases<dim>::run (ParameterHandler &prm) {
 
 
 int main (int argc, char **argv) {
-  if (argc!=2
+  if (argc!=3
     {
-      cout << "Usage: grid_test parameterfile" << endl << endl;
+      cout << "Usage: grid_test dimension parameterfile" << endl << endl;
       return 1;
     };
 
-  TestCases<2> tests;
-  MultipleParameterLoop input_data;
+  unsigned int dim;
+  if (argv[1][0] == '2')
+    dim = 2;
+  else
+    dim = 3;
+
+  switch (dim)
+    {
+      case 2:
+      {
+           TestCases<2> tests;
+           MultipleParameterLoop input_data;
+
+           tests.declare_parameters(input_data);
+           input_data.read_input (argv[2]);
+           input_data.loop (tests);
+
+           break;
+      };
+       
+      case 3:
+      {
+           TestCases<3> tests;
+           MultipleParameterLoop input_data;
+
+           tests.declare_parameters(input_data);
+           input_data.read_input (argv[2]);
+           input_data.loop (tests);
 
-  tests.declare_parameters(input_data);
-  input_data.read_input (argv[1]);
-  input_data.loop (tests);
+           break;
+      };
+    };
   
   return 0;
 };
index c8b7ad835f06e962d0a1aabb6523c6e5bbfb8f72..0de18e871a6a2f65393b7f35ed23fbba82bb832f 100644 (file)
@@ -19,7 +19,7 @@ user-libs =
 
 # To run the program, use "make run"; to give parameters to the program,
 # give the parameters to the following variable:
-run-parameters  = $(target).prm
+run-parameters  = 2 $(target).prm ; $(target) 3 $(target).prm
 
 # To execute additional action apart from running the program, fill
 # in this list:
@@ -49,8 +49,8 @@ h-files     = $(wildcard *.h)
 lib-h-files = $(wildcard ../../include/*/*.h)
 
 # list of libraries needed to link with
-libs     = ./Obj.a   ../../lib/libdeal_II_2d.a   ../../../lac/lib/liblac.a   ../../../base/lib/libbase.a
-libs.g   = ./Obj.g.a ../../lib/libdeal_II_2d.g.a ../../../lac/lib/liblac.g.a ../../../base/lib/libbase.g.a ../../../base/lib/libbase.g.a
+libs     = ./Obj.a   ../../lib/libdeal_II_2d.a   ../../lib/libdeal_II_3d.a   ../../../lac/lib/liblac.a   ../../../base/lib/libbase.a
+libs.g   = ./Obj.g.a ../../lib/libdeal_II_2d.g.a ../../lib/libdeal_II_3d.g.a ../../../lac/lib/liblac.g.a ../../../base/lib/libbase.g.a ../../../base/lib/libbase.g.a
 
 
 # check whether we use debug mode or not
index d111755c67986451d5c67bf1a23e30867d65460c..729dac3c90d34dfabc9e1808e2113bcdfadddf76 100644 (file)
@@ -136,11 +136,10 @@ void TestCases<dim>::declare_parameters (ParameterHandler &prm) {
 
 template <int dim>
 void TestCases<dim>::run (ParameterHandler &prm) {
-  cout << "Test case = " << prm.get ("Test run") << endl
+  cout << "Dimension = " << dim
+       << ", Test case = " << prm.get ("Test run") << endl
        << endl;
   
-  cout << "    Making grid..." << endl;
-
   string test = prm.get ("Test run");
   unsigned int test_case = 1;
   if (test=="zoom in") test_case = 1;
@@ -154,6 +153,7 @@ void TestCases<dim>::run (ParameterHandler &prm) {
          cerr << "This test seems not to be implemented!" << endl;
 
   
+  cout << "    Making grid..." << endl;  
   Boundary<dim> *boundary = 0;
   
   switch (test_case) 
@@ -180,8 +180,6 @@ void TestCases<dim>::run (ParameterHandler &prm) {
            tria->execute_refinement ();
          };
 
-//     tria->refine_global (5);
-       
        break;
       }
       
@@ -268,7 +266,7 @@ void TestCases<dim>::run (ParameterHandler &prm) {
   dof->make_sparsity_pattern (sparsity);
   int unconstrained_bandwidth = sparsity.bandwidth();
 
-  cout << "    Writing sparsity pattern... (This may take a while)" << endl;
+  cout << "    Writing sparsity pattern..." << endl;
   ofstream sparsity_out (prm.get("Sparsity file").c_str());
   sparsity.print_gnuplot (sparsity_out);
 
@@ -285,11 +283,6 @@ void TestCases<dim>::run (ParameterHandler &prm) {
   sparsity.print_gnuplot (c_sparsity_out);
 
 
-//  DataOut<dim> dataout;
-//  dataout.attach_dof_handler (*dof);
-//  ofstream o("o.inp");
-//  dataout.write_ucd (o);
-  
   cout << endl
        << "    Total number of cells         = " << tria->n_cells() << endl
        << "    Total number of active cells  = " << tria->n_active_cells() << endl
@@ -310,18 +303,44 @@ void TestCases<dim>::run (ParameterHandler &prm) {
 
 
 int main (int argc, char **argv) {
-  if (argc!=2
+  if (argc!=3
     {
-      cout << "Usage: grid_test parameterfile" << endl << endl;
+      cout << "Usage: grid_test dimension parameterfile" << endl << endl;
       return 1;
     };
 
-  TestCases<2> tests;
-  MultipleParameterLoop input_data;
+  unsigned int dim;
+  if (argv[1][0] == '2')
+    dim = 2;
+  else
+    dim = 3;
+
+  switch (dim)
+    {
+      case 2:
+      {
+           TestCases<2> tests;
+           MultipleParameterLoop input_data;
+
+           tests.declare_parameters(input_data);
+           input_data.read_input (argv[2]);
+           input_data.loop (tests);
+
+           break;
+      };
+       
+      case 3:
+      {
+           TestCases<3> tests;
+           MultipleParameterLoop input_data;
+
+           tests.declare_parameters(input_data);
+           input_data.read_input (argv[2]);
+           input_data.loop (tests);
 
-  tests.declare_parameters(input_data);
-  input_data.read_input (argv[1]);
-  input_data.loop (tests);
+           break;
+      };
+    };
   
   return 0;
 };

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.