From 1e01317e26a4ee3623f4ebe3e16596514a0a5722 Mon Sep 17 00:00:00 2001 From: Martin Kronbichler Date: Fri, 31 Jul 2009 15:25:17 +0000 Subject: [PATCH] Started to write the first few comments. git-svn-id: https://svn.dealii.org/trunk@19146 0785d39b-7218-0410-832d-ea1e28bc413d --- deal.II/examples/step-22/step-22.cc | 6 +-- deal.II/examples/step-32/step-32.cc | 57 ++++++++++++++++++++++------- 2 files changed, 47 insertions(+), 16 deletions(-) diff --git a/deal.II/examples/step-22/step-22.cc b/deal.II/examples/step-22/step-22.cc index dcc21a0fbf..bc2d964377 100644 --- a/deal.II/examples/step-22/step-22.cc +++ b/deal.II/examples/step-22/step-22.cc @@ -64,7 +64,7 @@ #include // As in all programs, the namespace dealii - // in included: + // is included: using namespace dealii; // @sect3{Defining the inner preconditioner type} @@ -72,10 +72,10 @@ using namespace dealii; // As explained in the introduction, we are // going to use different preconditioners for // two and three space dimensions, - // respectively. We differentiate between + // respectively. We distinguish between // them by the use of the spatial dimension // as a template parameter. See step-4 for - // details on templates. We are not going to + // details on templates. We are not going to // create any preconditioner object here, all // we do is to create class that holds a // local typedef determining the diff --git a/deal.II/examples/step-32/step-32.cc b/deal.II/examples/step-32/step-32.cc index 1d233ad94b..3f2672822c 100644 --- a/deal.II/examples/step-32/step-32.cc +++ b/deal.II/examples/step-32/step-32.cc @@ -21,6 +21,7 @@ #include #include #include +#include #include #include @@ -57,15 +58,19 @@ #include #include -#include - - // Time measurements. -#include - #include #include #include + // This is the only include file that is + // new: We use Trilinos for defining the + // parallel partitioning of the matrices + // and vectors, and an Epetra_Map is the + // Trilinos data structure for the + // definition of which part of a + // distributed vector is stored locally. +#include + // Next, we import all deal.II // names into global namespace @@ -73,17 +78,17 @@ using namespace dealii; // @sect3{Equation data} - - // @sect4{Boundary values} + // This program is mainly an extension of + // step-31 to operate in parallel, so the + // equation data remains the same. namespace EquationData { - // define viscosity const double eta = 1; const double kappa = 1e-6; const double Rayleigh_number = 10; - // @sect4{Initial values} + template class TemperatureInitialValues : public Function { @@ -98,12 +103,16 @@ namespace EquationData }; + template double TemperatureInitialValues::value (const Point &, const unsigned int) const { - //return (p.norm() < 0.55+0.02*std::sin(p[0]*20) ? 1 : 0); + // Data for shell problem + /*return (p.norm() < 0.55+0.02*std::sin(p[0]*20) ? 1 : 0);*/ + + // Data for cube problem return 0.; } @@ -119,7 +128,6 @@ namespace EquationData - // @sect4{Right hand side} template class TemperatureRightHandSide : public Function { @@ -134,12 +142,16 @@ namespace EquationData }; + template double TemperatureRightHandSide::value (const Point &p, const unsigned int component) const { - // return 0; + // Data for shell problem. + /* return 0; */ + + // Data for cube problem. Assert (component == 0, ExcMessage ("Invalid operation for a scalar function.")); @@ -161,7 +173,6 @@ namespace EquationData 1 : 0); - } @@ -179,6 +190,26 @@ namespace EquationData // @sect3{Linear solvers and preconditioners} + // In comparison to step-31, we did one + // change in the linear algebra of the + // problem: We exchange the InverseMatrix + // that previously held the approximation + // of the Schur complement by a + // preconditioner only (we will choose + // ILU in the application code + // below). This is the same trick we + // already did for the velocity block - + // the idea of this is that the outer + // iterations will eventually also make + // the inner approximation for the Schur + // complement good. If the preconditioner + // we're using is good enough, there will + // be no increase in the iteration + // count. All we need to do for + // implementing this change here is to + // give the respective variable in the + // BlockSchurPreconditioner class another + // name. namespace LinearSolvers { template -- 2.39.5