From f8d5276fd339af8fcd99482aebfbb0dbc3c3d683 Mon Sep 17 00:00:00 2001 From: kanschat Date: Fri, 16 May 2014 06:13:51 +0000 Subject: [PATCH] add time and timestep to anydata and fix documentation git-svn-id: https://svn.dealii.org/trunk@32917 0785d39b-7218-0410-832d-ea1e28bc413d --- .../deal.II/algorithms/theta_timestepping.h | 22 ++++++++++++++++--- .../algorithms/theta_timestepping.templates.h | 4 ++++ 2 files changed, 23 insertions(+), 3 deletions(-) diff --git a/deal.II/include/deal.II/algorithms/theta_timestepping.h b/deal.II/include/deal.II/algorithms/theta_timestepping.h index 0bfec47e27..e6bb52410a 100644 --- a/deal.II/include/deal.II/algorithms/theta_timestepping.h +++ b/deal.II/include/deal.II/algorithms/theta_timestepping.h @@ -80,15 +80,20 @@ namespace Algorithms * Operator objects, one for the explicit, one for the implicit * part. Each of these will use its own TimestepData to account for * the modified step sizes (and different times if the problem is not - * autonomous). + * autonomous). Note that once the explicit part has been computed, + * the left hand side actually constitutes a linear or nonlinear + * system which has to be solved. * - *

Usage of vectors in NamedData

+ *

Usage AnyData

* - * ThetaTimestepping uses NamedData for communicating vectors. With + * ThetaTimestepping uses AnyData for communicating vectors and time + * step information. With * outer or inner Operator objects. It does not use itself the input * vectors provided, but forwards them to the explicit and implicit * operators. * + *

Vector data

+ * * The explicit Operator #op_explicit receives in its input in first * place the vector "Previous iterate", which is the solution * value after the previous timestep. It is followed by all vectors @@ -103,6 +108,17 @@ namespace Algorithms * #op_implicit is directly written into the output argument given to * ThetaTimestepping. * + *

Scalar data

+ * + * Since the introduction of AnyData, ThetaTimestepping is able to + * communicate the current time step information through AnyData as + * well. Therefore, the AnyData objects handed as input to + * #op_explicit and #op_implicit contain two entries of type + * const double reference named "Time" and "Timestep". Note + * that "Time" refers to the time at the beginning of the current + * step for #op_explicit and at the end for #op_implicit, + * respectively. + * *

Usage of ThetaTimestepping

* * The use ThetaTimestepping is more complicated than for instance 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 6194088cfe..348ab379cb 100644 --- a/deal.II/include/deal.II/algorithms/theta_timestepping.templates.h +++ b/deal.II/include/deal.II/algorithms/theta_timestepping.templates.h @@ -91,6 +91,8 @@ namespace Algorithms // timestep AnyData src1; src1.add(&solution, "Previous iterate"); + src1.add(d_explicit.time, "Time"); + src1.add(d_explicit.step, "Timestep"); src1.merge(in); AnyData src2; @@ -100,6 +102,8 @@ namespace Algorithms out1.add(aux, "Solution"); // The data provided to the inner solver src2.add(aux, "Previous time"); + src2.add(d_implicit.time, "Time"); + src2.add(d_explicit.step, "Timestep"); src2.merge(in); if (output != 0) -- 2.39.5