From c78b94cef68052d88f6eb2af39c2683ca99aed0a Mon Sep 17 00:00:00 2001 From: kanschat Date: Tue, 20 May 2014 06:57:14 +0000 Subject: [PATCH] blank out compatibility warnings in ThetaTimestepping git-svn-id: https://svn.dealii.org/trunk@32940 0785d39b-7218-0410-832d-ea1e28bc413d --- deal.II/include/deal.II/algorithms/operator.h | 5 +++++ .../include/deal.II/algorithms/operator.templates.h | 12 +++++++----- .../algorithms/theta_timestepping.templates.h | 8 ++++++++ 3 files changed, 20 insertions(+), 5 deletions(-) diff --git a/deal.II/include/deal.II/algorithms/operator.h b/deal.II/include/deal.II/algorithms/operator.h index 6254d35019..5dbe64a4b7 100644 --- a/deal.II/include/deal.II/algorithms/operator.h +++ b/deal.II/include/deal.II/algorithms/operator.h @@ -157,6 +157,11 @@ namespace Algorithms */ virtual void operator() (NamedData &out, const NamedData &in); + /** + * Set this true to avoid compatibility warnings. + */ + bool silent_compatibility; + private: /** * While we are providing compatibility functions to the old diff --git a/deal.II/include/deal.II/algorithms/operator.templates.h b/deal.II/include/deal.II/algorithms/operator.templates.h index e90d771c54..eed6e1a984 100644 --- a/deal.II/include/deal.II/algorithms/operator.templates.h +++ b/deal.II/include/deal.II/algorithms/operator.templates.h @@ -24,7 +24,7 @@ namespace Algorithms { template Operator::Operator() - : compatibility_flag(false) + : silent_compatibility(false), compatibility_flag(false) {} @@ -45,8 +45,9 @@ namespace Algorithms if (out.is_type(i)) new_out.add(out.entry(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 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; diff --git a/deal.II/include/deal.II/algorithms/theta_timestepping.templates.h b/deal.II/include/deal.II/algorithms/theta_timestepping.templates.h index 348ab379cb..4072b37b4e 100644 --- a/deal.II/include/deal.II/algorithms/theta_timestepping.templates.h +++ b/deal.II/include/deal.II/algorithms/theta_timestepping.templates.h @@ -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(); } } -- 2.39.5