From b69cb533b1d8a752c4b33fef8fcff287fccfdee7 Mon Sep 17 00:00:00 2001 From: Marc Fehling Date: Mon, 24 Jun 2024 13:26:04 +0200 Subject: [PATCH] Fix warnings. --- .../include/nonlinear_heat.h | 2 +- .../source/boundary_values.cc | 10 +++++----- .../source/initial_conditions.cc | 2 +- parallel_in_time/src/Utilities.cc | 14 +------------- 4 files changed, 8 insertions(+), 20 deletions(-) diff --git a/nonlinear-heat_transfer_with_AD_NOX/include/nonlinear_heat.h b/nonlinear-heat_transfer_with_AD_NOX/include/nonlinear_heat.h index fb95a02..21502a9 100755 --- a/nonlinear-heat_transfer_with_AD_NOX/include/nonlinear_heat.h +++ b/nonlinear-heat_transfer_with_AD_NOX/include/nonlinear_heat.h @@ -120,7 +120,7 @@ public: {} // Returns the intitial values. virtual double value(const Point<2> &p, - const unsigned int component =0) const; + const unsigned int component =0) const override; }; /** A class to apply the boundary (Dirichlet) condition at the left edge. diff --git a/nonlinear-heat_transfer_with_AD_NOX/source/boundary_values.cc b/nonlinear-heat_transfer_with_AD_NOX/source/boundary_values.cc index 8d4f689..4facac4 100644 --- a/nonlinear-heat_transfer_with_AD_NOX/source/boundary_values.cc +++ b/nonlinear-heat_transfer_with_AD_NOX/source/boundary_values.cc @@ -9,16 +9,16 @@ * @param p A point (2D) * @return Value at the boundary */ -double Boundary_values_left::value(const Point<2> &p, const unsigned int) const +double Boundary_values_left::value(const Point<2> & /*p*/, const unsigned int /*comp*/) const { - - nonlinear_heat nlheat; - double total_time = nlheat.tot_time; return 100; + /** * To linearly ramp the temperature at the left end to 100 over the * entire time span, use the below line. See step-23 as to how the time * variable can be used. */ - // this->get_time() * 100.0/total_time; + // nonlinear_heat nlheat; + // double total_time = nlheat.tot_time; + // return this->get_time() * 100.0/total_time; } diff --git a/nonlinear-heat_transfer_with_AD_NOX/source/initial_conditions.cc b/nonlinear-heat_transfer_with_AD_NOX/source/initial_conditions.cc index 44d559c..5507942 100644 --- a/nonlinear-heat_transfer_with_AD_NOX/source/initial_conditions.cc +++ b/nonlinear-heat_transfer_with_AD_NOX/source/initial_conditions.cc @@ -5,7 +5,7 @@ * @param comp component * @return */ -double Initialcondition::value(const Point<2> &p, const unsigned int comp) const +double Initialcondition::value(const Point<2> & /*p*/, const unsigned int /*comp*/) const { /** * In the current case, we asume that the initial conditions are zero everywhere. diff --git a/parallel_in_time/src/Utilities.cc b/parallel_in_time/src/Utilities.cc index 785ecbb..99c8a40 100644 --- a/parallel_in_time/src/Utilities.cc +++ b/parallel_in_time/src/Utilities.cc @@ -17,6 +17,7 @@ int procID = 0; +#ifdef USE_MPI // The shared variables static std::string s_pout_filename ; @@ -26,7 +27,6 @@ static std::ofstream s_pout ; static bool s_pout_init = false ; static bool s_pout_open = false ; -#ifdef USE_MPI // in parallel, compute the filename give the basename //[NOTE: dont call this before MPI is initialized.] static void setFileName() @@ -49,18 +49,6 @@ static void openFile() // to try again later than to make believe it succeeded s_pout_open = (bool)s_pout ; } - -#else -// in serial, filename is always cout -static void setFileName() -{ - s_pout_filename = "cout" ; -} - -// in serial, this does absolutely nothing -static void openFile() -{ -} #endif std::ostream& pout() -- 2.39.5