3.4
DUNE for Multi-{Phase, Component, Scale, Physics, ...} flow and transport in porous media
linearsolvertraits.hh
Go to the documentation of this file.
1// -*- mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*-
2// vi: set et ts=4 sw=4 sts=4:
3/*****************************************************************************
4 * See the file COPYING for full copying permissions. *
5 * *
6 * This program is free software: you can redistribute it and/or modify *
7 * it under the terms of the GNU General Public License as published by *
8 * the Free Software Foundation, either version 3 of the License, or *
9 * (at your option) any later version. *
10 * *
11 * This program is distributed in the hope that it will be useful, *
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of *
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
14 * GNU General Public License for more details. *
15 * *
16 * You should have received a copy of the GNU General Public License *
17 * along with this program. If not, see <http://www.gnu.org/licenses/>. *
18 *****************************************************************************/
24#ifndef DUMUX_LINEAR_SOLVER_TRAITS_HH
25#define DUMUX_LINEAR_SOLVER_TRAITS_HH
26
27#include <dune/istl/schwarz.hh>
28#include <dune/istl/novlpschwarz.hh>
29#include <dune/istl/owneroverlapcopy.hh>
30#include <dune/istl/paamg/pinfo.hh>
31#include <dune/istl/preconditioners.hh>
32#include <dune/grid/common/capabilities.hh>
33
36
37namespace Dumux {
38
40template<class GridGeometry, DiscretizationMethod discMethod>
42
44template<class GridGeometry>
46
48template<class MType, class VType>
50{
51 using Matrix = MType;
52 using Vector = VType;
53 using LinearOperator = Dune::MatrixAdapter<MType, VType, VType>;
54 using ScalarProduct = Dune::SeqScalarProduct<VType>;
55
56 template<class SeqPreconditioner>
57 using Preconditioner = SeqPreconditioner;
58};
59
60#if HAVE_MPI
61template <class MType, class VType>
63{
64public:
65 using Matrix = MType;
66 using Vector = VType;
67 using Comm = Dune::OwnerOverlapCopyCommunication<Dune::bigunsignedint<96>, int>;
68 using LinearOperator = Dune::NonoverlappingSchwarzOperator<MType, VType, VType, Comm>;
69 using ScalarProduct = Dune::NonoverlappingSchwarzScalarProduct<VType, Comm>;
70 static constexpr bool isNonOverlapping = true;
71
72 template<class SeqPreconditioner>
73 using Preconditioner = Dune::NonoverlappingBlockPreconditioner<Comm, SeqPreconditioner>;
74};
75
76template <class MType, class VType>
78{
79public:
80 using Matrix = MType;
81 using Vector = VType;
82 using Comm = Dune::OwnerOverlapCopyCommunication<Dune::bigunsignedint<96>, int>;
83 using LinearOperator = Dune::OverlappingSchwarzOperator<MType, VType, VType, Comm>;
84 using ScalarProduct = Dune::OverlappingSchwarzScalarProduct<VType, Comm>;
85 static constexpr bool isNonOverlapping = false;
86
87 template<class SeqPreconditioner>
88 using Preconditioner = Dune::BlockPreconditioner<VType, VType, Comm, SeqPreconditioner>;
89};
90#endif
91
92template<class GridGeometry>
94{
95 using GridView = typename GridGeometry::GridView;
96 using Grid = typename GridGeometry::GridView::Traits::Grid;
97
98 template<class Matrix, class Vector>
100
101#if HAVE_MPI
102 template<class Matrix, class Vector>
104
105 template<class Matrix, class Vector>
107#endif
108};
109
111template<class GridGeometry>
113: public LinearSolverTraitsBase<GridGeometry>
114{
115 using DofMapper = typename GridGeometry::VertexMapper;
116 using Grid = typename GridGeometry::GridView::Traits::Grid;
117 static constexpr int dofCodim = Grid::dimension;
118 static constexpr bool canCommunicate = Dumux::Detail::canCommunicate<Grid, dofCodim>;
119
120 template<class GridView>
121 static bool isNonOverlapping(const GridView& gridView)
122 { return gridView.overlapSize(0) == 0; }
123};
124
126template<class GridGeometry>
128: public LinearSolverTraitsBase<GridGeometry>
129{
130 using DofMapper = typename GridGeometry::ElementMapper;
131 using Grid = typename GridGeometry::GridView::Traits::Grid;
132 static constexpr int dofCodim = 0;
133 static constexpr bool canCommunicate = Dumux::Detail::canCommunicate<Grid, dofCodim>;
134
135 template<class GridView>
136 static bool isNonOverlapping(const GridView& gridView)
137 { return false; }
138};
139
141template<class GridGeometry>
143: public LinearSolverTraitsImpl<GridGeometry, DiscretizationMethod::cctpfa> {};
144
146template<class GridGeometry>
148: public LinearSolverTraitsImpl<GridGeometry, DiscretizationMethod::cctpfa> {};
149
150} // end namespace Dumux
151
152#endif
dune-grid capabilities compatibility layer
The available discretization methods in Dumux.
DiscretizationMethod
The available discretization methods in Dumux.
Definition: method.hh:37
Definition: adapt.hh:29
static constexpr bool canCommunicate
Definition: gridcapabilities.hh:63
The implementation is specialized for the different discretizations.
Definition: linearsolvertraits.hh:41
sequential solver traits
Definition: linearsolvertraits.hh:50
MType Matrix
Definition: linearsolvertraits.hh:51
VType Vector
Definition: linearsolvertraits.hh:52
Dune::MatrixAdapter< MType, VType, VType > LinearOperator
Definition: linearsolvertraits.hh:53
SeqPreconditioner Preconditioner
Definition: linearsolvertraits.hh:57
Dune::SeqScalarProduct< VType > ScalarProduct
Definition: linearsolvertraits.hh:54
Definition: linearsolvertraits.hh:63
Dune::NonoverlappingSchwarzOperator< MType, VType, VType, Comm > LinearOperator
Definition: linearsolvertraits.hh:68
MType Matrix
Definition: linearsolvertraits.hh:65
Dune::NonoverlappingBlockPreconditioner< Comm, SeqPreconditioner > Preconditioner
Definition: linearsolvertraits.hh:73
Dune::NonoverlappingSchwarzScalarProduct< VType, Comm > ScalarProduct
Definition: linearsolvertraits.hh:69
VType Vector
Definition: linearsolvertraits.hh:66
Dune::OwnerOverlapCopyCommunication< Dune::bigunsignedint< 96 >, int > Comm
Definition: linearsolvertraits.hh:67
static constexpr bool isNonOverlapping
Definition: linearsolvertraits.hh:70
Definition: linearsolvertraits.hh:78
static constexpr bool isNonOverlapping
Definition: linearsolvertraits.hh:85
Dune::OverlappingSchwarzOperator< MType, VType, VType, Comm > LinearOperator
Definition: linearsolvertraits.hh:83
MType Matrix
Definition: linearsolvertraits.hh:80
Dune::BlockPreconditioner< VType, VType, Comm, SeqPreconditioner > Preconditioner
Definition: linearsolvertraits.hh:88
VType Vector
Definition: linearsolvertraits.hh:81
Dune::OwnerOverlapCopyCommunication< Dune::bigunsignedint< 96 >, int > Comm
Definition: linearsolvertraits.hh:82
Dune::OverlappingSchwarzScalarProduct< VType, Comm > ScalarProduct
Definition: linearsolvertraits.hh:84
Definition: linearsolvertraits.hh:94
typename GridGeometry::GridView::Traits::Grid Grid
Definition: linearsolvertraits.hh:96
typename GridGeometry::GridView GridView
Definition: linearsolvertraits.hh:95
static bool isNonOverlapping(const GridView &gridView)
Definition: linearsolvertraits.hh:121
typename GridGeometry::VertexMapper DofMapper
Definition: linearsolvertraits.hh:115
static bool isNonOverlapping(const GridView &gridView)
Definition: linearsolvertraits.hh:136
typename GridGeometry::ElementMapper DofMapper
Definition: linearsolvertraits.hh:130