// friends:
#include <deal.II/base/quadrature_lib.h>
#include <deal.II/base/function.h>
+
+#include <deal.II/lac/parallel_linear_algebra.h>
+
+namespace LA
+{
+ using namespace dealii::LinearAlgebraPETSc;
+// using namespace dealii::LinearAlgebraTrilinos;
+}
+
+
#include <deal.II/lac/vector.h>
#include <deal.II/lac/full_matrix.h>
#include <deal.II/lac/solver_cg.h>
ConstraintMatrix constraints;
- PETScWrappers::MPI::SparseMatrix system_matrix;
- PETScWrappers::MPI::Vector locally_relevant_solution;
- PETScWrappers::MPI::Vector system_rhs;
+ LA::SparseMatrix system_matrix;
+ LA::Vector locally_relevant_solution;
+ LA::Vector system_rhs;
ConditionalOStream pcout;
};
template <int dim>
void LaplaceProblem<dim>::solve ()
{
- PETScWrappers::MPI::Vector
+ LA::Vector
completely_distributed_solution (mpi_communicator,
dof_handler.n_dofs(),
dof_handler.n_locally_owned_dofs());
// Ask for a symmetric preconditioner by
// setting the first parameter in
// AdditionalData to true.
- PETScWrappers::PreconditionBoomerAMG
+ LA::PreconditionAMG
preconditioner(system_matrix,
PETScWrappers::PreconditionBoomerAMG::AdditionalData(true));
--- /dev/null
+//---------------------------------------------------------------------------
+// $Id: linear_algebra.h 27260 2012-10-31 14:38:43Z heister $
+//
+// Copyright (C) 2008, 2009, 2010, 2012 by the deal.II authors
+//
+// This file is subject to QPL and may not be distributed
+// without copyright and license information. Please refer
+// to the file deal.II/doc/license.html for the text and
+// further information on this license.
+//
+//---------------------------------------------------------------------------
+#ifndef __deal2__parallel_linear_algebra_h
+#define __deal2__parallel_linear_algebra_h
+
+#include <deal.II/base/config.h>
+
+
+#ifdef DEAL_II_USE_PETSC
+
+#include <deal.II/lac/petsc_vector.h>
+#include <deal.II/lac/petsc_block_vector.h>
+#include <deal.II/lac/petsc_parallel_sparse_matrix.h>
+#include <deal.II/lac/petsc_parallel_block_sparse_matrix.h>
+#include <deal.II/lac/petsc_precondition.h>
+
+DEAL_II_NAMESPACE_OPEN
+
+ namespace LinearAlgebraPETSc
+ {
+ using namespace dealii;
+
+ /**
+ * Typedef for the vector type used.
+ */
+ typedef PETScWrappers::MPI::Vector Vector;
+
+ /**
+ * Typedef for the type used to describe vectors that
+ * consist of multiple blocks.
+ */
+ typedef PETScWrappers::MPI::BlockVector BlockVector;
+
+ /**
+ * Typedef for the sparse matrix type used.
+ */
+ typedef PETScWrappers::MPI::SparseMatrix SparseMatrix;
+
+ /**
+ * Typedef for the type used to describe sparse matrices that
+ * consist of multiple blocks.
+ */
+ typedef PETScWrappers::MPI::BlockSparseMatrix BlockSparseMatrix;
+
+ /**
+ * Typedef for the AMG preconditioner type used for the
+ * top left block of the Stokes matrix.
+ */
+ typedef PETScWrappers::PreconditionBoomerAMG PreconditionAMG;
+
+ /**
+ * Typedef for the Incomplete Cholesky preconditioner used
+ * for other blocks of the system matrix.
+ */
+ typedef PETScWrappers::PreconditionICC PreconditionIC;
+
+ /**
+ * Typedef for the Incomplete LU decomposition preconditioner used
+ * for other blocks of the system matrix.
+ */
+ typedef PETScWrappers::PreconditionILU PreconditionILU;
+ }
+DEAL_II_NAMESPACE_CLOSE
+
+
+#endif // DEAL_II_USE_PETSC
+
+#ifdef DEAL_II_USE_TRILINOS
+
+#include <deal.II/lac/trilinos_vector.h>
+#include <deal.II/lac/trilinos_block_vector.h>
+#include <deal.II/lac/trilinos_sparse_matrix.h>
+#include <deal.II/lac/trilinos_precondition.h>
+
+DEAL_II_NAMESPACE_OPEN
+
+ namespace LinearAlgebraTrilinos
+ {
+ using namespace dealii;
+
+ /**
+ * Typedef for the vector type used.
+ */
+ typedef TrilinosWrappers::MPI::Vector Vector;
+
+ /**
+ * Typedef for the type used to describe vectors that
+ * consist of multiple blocks.
+ */
+ typedef TrilinosWrappers::MPI::BlockVector BlockVector;
+
+ /**
+ * Typedef for the sparse matrix type used.
+ */
+ typedef TrilinosWrappers::SparseMatrix SparseMatrix;
+
+ /**
+ * Typedef for the type used to describe sparse matrices that
+ * consist of multiple blocks.
+ */
+ typedef TrilinosWrappers::BlockSparseMatrix BlockSparseMatrix;
+
+ /**
+ * Typedef for the AMG preconditioner type used for the
+ * top left block of the Stokes matrix.
+ */
+ typedef TrilinosWrappers::PreconditionAMG PreconditionAMG;
+
+ /**
+ * Typedef for the Incomplete Cholesky preconditioner used
+ * for other blocks of the system matrix.
+ */
+ typedef TrilinosWrappers::PreconditionIC PreconditionIC;
+
+ /**
+ * Typedef for the Incomplete LU decomposition preconditioner used
+ * for other blocks of the system matrix.
+ */
+ typedef TrilinosWrappers::PreconditionILU PreconditionILU;
+ }
+
+DEAL_II_NAMESPACE_CLOSE
+
+
+#endif // DEAL_II_USE_TRILINOS
+
+
+
+#endif