Fluid structure interaction suite
lac.h
Go to the documentation of this file.
1 // ---------------------------------------------------------------------
2 //
3 // Copyright (C) 2022 by Luca Heltai
4 //
5 // This file is part of the FSI-suite platform, based on the deal.II library.
6 //
7 // The FSI-suite platform is free software; you can use it, redistribute it,
8 // and/or modify it under the terms of the GNU Lesser General Public License as
9 // published by the Free Software Foundation; either version 3.0 of the License,
10 // or (at your option) any later version. The full text of the license can be
11 // found in the file LICENSE at the top level of the FSI-suite platform
12 // distribution.
13 //
14 // ---------------------------------------------------------------------
15 
16 #ifndef fsi_lac_h
17 #define fsi_lac_h
18 
19 #include <deal.II/base/config.h>
20 
27 #include <deal.II/lac/vector.h>
28 
29 
30 #ifdef DEAL_II_WITH_PETSC
36 
37 #endif
38 
39 #ifdef DEAL_II_WITH_TRILINOS
45 #endif
46 
47 #include "parsed_lac/amg.h"
48 #include "parsed_lac/amg_petsc.h"
49 #include "parsed_lac/ilu.h"
50 
61 namespace LAC
62 {
69  struct LAdealii
70  {
71  using Vector = dealii::Vector<double>;
72  using BlockVector = dealii::BlockVector<double>;
73  using SparseMatrix = dealii::SparseMatrix<double>;
74  using BlockSparseMatrix = dealii::BlockSparseMatrix<double>;
75  using SparsityPattern = dealii::SparsityPattern;
76  using BlockSparsityPattern = dealii::BlockSparsityPattern;
77 #ifdef DEAL_II_WITH_TRILINOS
79 #else
80  // Just use UMFPACK if Trilinos is not available
81  using AMG = dealii::SparseDirectUMFPACK;
82 #endif
83  using DirectSolver = dealii::SparseDirectUMFPACK;
84  };
85 
86 
87 #ifdef DEAL_II_WITH_PETSC
88 
95  struct LAPETSc
96  {
97  using Vector = dealii::PETScWrappers::MPI::Vector;
98  using SparseMatrix = dealii::PETScWrappers::MPI::SparseMatrix;
99  using SparsityPattern = dealii::SparsityPattern;
100  using BlockVector = dealii::PETScWrappers::MPI::BlockVector;
101  using BlockSparseMatrix = dealii::PETScWrappers::MPI::BlockSparseMatrix;
102  using BlockSparsityPattern = dealii::BlockSparsityPattern;
104  using DirectSolver = dealii::PETScWrappers::SparseDirectMUMPS;
105  };
106 
107 #endif // DEAL_II_WITH_PETSC
108 
109 #ifdef DEAL_II_WITH_TRILINOS
116  struct LATrilinos
117  {
118  using Vector = dealii::TrilinosWrappers::MPI::Vector;
119  using SparseMatrix = dealii::TrilinosWrappers::SparseMatrix;
120  using SparsityPattern = dealii::TrilinosWrappers::SparsityPattern;
121  using BlockVector = dealii::TrilinosWrappers::MPI::BlockVector;
122  using BlockSparseMatrix = dealii::TrilinosWrappers::BlockSparseMatrix;
123  using BlockSparsityPattern = dealii::TrilinosWrappers::BlockSparsityPattern;
125  using DirectSolver = dealii::TrilinosWrappers::SolverDirect;
126  };
127 
128 #endif // DEAL_II_WITH_TRILINOS
129 } // namespace LAC
130 #endif
A parsed AMG preconditioner which uses parameter files to choose between different options.
Definition: amg.h:37
A parsed AMG preconditioner which uses parameter files to choose between different options.
Definition: amg_petsc.h:38
Wrappers for linear algebra classes.
Definition: lac.h:62
Parallel linear algebra, using PETSc.
Definition: lac.h:96
Parallel linear algebra, using Trilinos.
Definition: lac.h:117
Serial linear algebra, natively defined in deal.II.
Definition: lac.h:70