#include <sstream>
// As in all programs, the namespace dealii
- // in included:
+ // is included:
using namespace dealii;
// @sect3{Defining the inner preconditioner type}
// 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
#include <base/utilities.h>
#include <base/conditional_ostream.h>
#include <base/work_stream.h>
+#include <base/timer.h>
#include <lac/full_matrix.h>
#include <lac/solver_bicgstab.h>
#include <numerics/error_estimator.h>
#include <numerics/solution_transfer.h>
-#include <Epetra_Map.h>
-
- // Time measurements.
-#include <base/timer.h>
-
#include <fstream>
#include <iostream>
#include <sstream>
+ // 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 <Epetra_Map.h>
+
// Next, we import all deal.II
// names into global namespace
// @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 <int dim>
class TemperatureInitialValues : public Function<dim>
{
};
+
template <int dim>
double
TemperatureInitialValues<dim>::value (const Point<dim> &,
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.;
}
- // @sect4{Right hand side}
template <int dim>
class TemperatureRightHandSide : public Function<dim>
{
};
+
template <int dim>
double
TemperatureRightHandSide<dim>::value (const Point<dim> &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."));
1
:
0);
-
}
// @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 <class PreconditionerA, class PreconditionerMp>