]> https://gitweb.dealii.org/ - dealii-svn.git/commitdiff
blank out compatibility warnings in ThetaTimestepping
authorkanschat <kanschat@0785d39b-7218-0410-832d-ea1e28bc413d>
Tue, 20 May 2014 06:57:14 +0000 (06:57 +0000)
committerkanschat <kanschat@0785d39b-7218-0410-832d-ea1e28bc413d>
Tue, 20 May 2014 06:57:14 +0000 (06:57 +0000)
git-svn-id: https://svn.dealii.org/trunk@32940 0785d39b-7218-0410-832d-ea1e28bc413d

deal.II/include/deal.II/algorithms/operator.h
deal.II/include/deal.II/algorithms/operator.templates.h
deal.II/include/deal.II/algorithms/theta_timestepping.templates.h

index 6254d35019dd67b5ee084a3b6ef690bc0554e1f6..5dbe64a4b7b80a1be9755f50e60c4a74c7c7bd5f 100644 (file)
@@ -157,6 +157,11 @@ namespace Algorithms
      */
     virtual void operator() (NamedData<VECTOR *> &out, const NamedData<VECTOR *> &in);
 
+    /**
+     * Set this true to avoid compatibility warnings.
+     */
+    bool silent_compatibility;
+      
   private:
     /**
      * While we are providing compatibility functions to the old
index e90d771c541b188b864e48ec020da31ba8a570ca..eed6e1a984cf6c91a3701919fcb11c48b4e9ec70 100644 (file)
@@ -24,7 +24,7 @@ namespace Algorithms
 {
   template <class VECTOR>
   Operator<VECTOR>::Operator()
-    : compatibility_flag(false)
+                 : silent_compatibility(false), compatibility_flag(false)
   {}
 
 
@@ -45,8 +45,9 @@ namespace Algorithms
        if (out.is_type<VECTOR*>(i))
          new_out.add(out.entry<VECTOR*>(i), out.name(i));
        else
-         deallog << "Cannot convert AnyData argument " << out.name(i) << " to NamedData"
-                 << std::endl;
+         if (!silent_compatibility)
+           deallog << "Cannot convert AnyData argument " << out.name(i) << " to NamedData"
+                   << std::endl;
       }
     
     NamedData<VECTOR*> new_in;
@@ -72,8 +73,9 @@ namespace Algorithms
            new_in.add(p, in.name(i));
          }
        else
-         deallog << "Cannot convert AnyData argument " << in.name(i)
-                 << " to NamedData" << std::endl;
+         if (!silent_compatibility)
+           deallog << "Cannot convert AnyData argument " << in.name(i)
+                   << " to NamedData" << std::endl;
       }
     this->operator() (new_out, new_in);
     compatibility_flag = false;
index 348ab379cb6cb2afb54f16945bdafc832a74b225..4072b37b4e67fc7977e83ccd67bfaf9b7d1148ad 100644 (file)
@@ -109,6 +109,12 @@ namespace Algorithms
     if (output != 0)
       (*output) << 0U << out;
 
+    // Avoid warnings because time and timestep cannot be converted to VECTOR*
+    const bool explicit_silent = op_explicit->silent_compatibility;
+    const bool implicit_silent = op_implicit->silent_compatibility;
+    op_explicit->silent_compatibility = true;
+    op_implicit->silent_compatibility = true;
+    
     for (unsigned int count = 1; d_explicit.time < control.final(); ++count)
       {
         const bool step_change = control.advance();
@@ -135,6 +141,8 @@ namespace Algorithms
 
         d_explicit.time = control.now();
       }
+    op_explicit->silent_compatibility = explicit_silent;
+    op_implicit->silent_compatibility = implicit_silent;
     deallog.pop();
   }
 }

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.