From: Bruno Turcksin Date: Fri, 16 Sep 2016 15:26:09 +0000 (-0400) Subject: Add a test that checks that the time step can be increased when using an embedded... X-Git-Tag: v8.5.0-rc1~664^2 X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=3f394428c4097b7b1dabdf2f747eddef3c4d298a;p=dealii.git Add a test that checks that the time step can be increased when using an embedded Runge-Kutta method. --- diff --git a/tests/base/time_stepping_02.cc b/tests/base/time_stepping_02.cc new file mode 100644 index 0000000000..500fe0d6ef --- /dev/null +++ b/tests/base/time_stepping_02.cc @@ -0,0 +1,74 @@ +// --------------------------------------------------------------------- +// +// Copyright (C) 2016 by the deal.II authors +// +// This file is part of the deal.II library. +// +// The deal.II library is free software; you can use it, redistribute +// it, and/or modify it under the terms of the GNU Lesser General +// Public License as published by the Free Software Foundation; either +// version 2.1 of the License, or (at your option) any later version. +// The full text of the license can be found in the file LICENSE at +// the top level of the deal.II distribution. +// +// --------------------------------------------------------------------- + + +// Check that the time step can be increased when using an embedded method. +// Bug reported by Vaibhav Palkar on the mailing list. + +#include "../tests.h" +#include +#include + +Vector f(double const t, Vector const &y) +{ + Vector values(y); + for (unsigned int i=0; i > &solver, + std_cxx11::function (double const, Vector const &)> f, + std_cxx11::function my) +{ + double initial_time = 0.0, final_time = 1.0; + double time_step = 0.1; + unsigned int size = 1; + unsigned int n_time_steps = 0; + double time = initial_time; + Vector solution(size); + for (unsigned int i=0; ifinal_time) + time_step = final_time - time; + time = solver.evolve_one_time_step(f,time,time_step,solution); + time_step = solver.get_status().delta_t_guess; + ++n_time_steps; + } + + deallog< > he(TimeStepping::HEUN_EULER); + test(he,f,my); + + return 0; +} diff --git a/tests/base/time_stepping_02.output b/tests/base/time_stepping_02.output new file mode 100644 index 0000000000..c05ebbb74c --- /dev/null +++ b/tests/base/time_stepping_02.output @@ -0,0 +1,2 @@ + +DEAL::7