Skip to content

Commit f17d818

Browse files
committed
let the linear solver backend determine the type of the sparse matrix adapter
so far, this property was specified by the level of the base discretization. because explicitly set properties overwrite the stuff inherited from splices, so far it was not possible to use a linear solver backends which requires a custom sparse matrix adapter unless the sparse matrix adapter adapter class was explicitly set again at the problem level -- thus making the splice much less generic than it ought to be. (also, the whole point of the sparse matrix adapter abstraction is that the discretization does not need to know what it does internally.)
1 parent fa70da2 commit f17d818

File tree

2 files changed

+15
-13
lines changed

2 files changed

+15
-13
lines changed

ewoms/disc/common/fvbasediscretization.hh

-13
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,6 @@
5050
#include <ewoms/parallel/gridcommhandles.hh>
5151
#include <ewoms/parallel/threadmanager.hh>
5252
#include <ewoms/linear/nullborderlistmanager.hh>
53-
#include <ewoms/linear/istlsparsematrixadapter.hh>
5453
#include <ewoms/common/simulator.hh>
5554
#include <ewoms/common/alignedallocator.hh>
5655
#include <ewoms/common/timer.hh>
@@ -130,18 +129,6 @@ SET_TYPE_PROP(FvBaseDiscretization, DiscExtensiveQuantities, Ewoms::FvBaseExtens
130129
//! Calculates the gradient of any quantity given the index of a flux approximation point
131130
SET_TYPE_PROP(FvBaseDiscretization, GradientCalculator, Ewoms::FvBaseGradientCalculator<TypeTag>);
132131

133-
//! Set the type of a global jacobian matrix from the solution types
134-
SET_PROP(FvBaseDiscretization, SparseMatrixAdapter)
135-
{
136-
private:
137-
typedef typename GET_PROP_TYPE(TypeTag, Scalar) Scalar;
138-
enum { numEq = GET_PROP_VALUE(TypeTag, NumEq) };
139-
typedef Ewoms::MatrixBlock<Scalar, numEq, numEq> Block;
140-
141-
public:
142-
typedef typename Ewoms::Linear::IstlSparseMatrixAdapter<Block> type;
143-
};
144-
145132
//! The maximum allowed number of timestep divisions for the
146133
//! Newton solver
147134
SET_INT_PROP(FvBaseDiscretization, MaxTimeStepDivisions, 10);

ewoms/linear/parallelbasebackend.hh

+15
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@
2727
#ifndef EWOMS_PARALLEL_BASE_BACKEND_HH
2828
#define EWOMS_PARALLEL_BASE_BACKEND_HH
2929

30+
#include <ewoms/linear/istlsparsematrixadapter.hh>
3031
#include <ewoms/linear/overlappingbcrsmatrix.hh>
3132
#include <ewoms/linear/overlappingblockvector.hh>
3233
#include <ewoms/linear/overlappingpreconditioner.hh>
@@ -114,6 +115,20 @@ NEW_PROP_TAG(PreconditionerOrder);
114115

115116
//! The relaxation factor of the preconditioner
116117
NEW_PROP_TAG(PreconditionerRelaxation);
118+
119+
//! Set the type of a global jacobian matrix for linear solvers that are based on
120+
//! dune-istl.
121+
SET_PROP(ParallelBaseLinearSolver, SparseMatrixAdapter)
122+
{
123+
private:
124+
typedef typename GET_PROP_TYPE(TypeTag, Scalar) Scalar;
125+
enum { numEq = GET_PROP_VALUE(TypeTag, NumEq) };
126+
typedef Ewoms::MatrixBlock<Scalar, numEq, numEq> Block;
127+
128+
public:
129+
typedef typename Ewoms::Linear::IstlSparseMatrixAdapter<Block> type;
130+
};
131+
117132
END_PROPERTIES
118133

119134
namespace Ewoms {

0 commit comments

Comments
 (0)