Go to the documentation of this file.
21#ifndef OPM_TPSA_PRECONDITIONER_IMPL_HPP
22#define OPM_TPSA_PRECONDITIONER_IMPL_HPP
24#ifndef OPM_TPSA_PRECONDITIONER_HPP
32template < class Scalar, class DispOp, class RotOp, class SPresOp, class Comm>
35 requires (!isParallel)
41template < class Scalar, class DispOp, class RotOp, class SPresOp, class Comm>
53template < class Scalar, class DispOp, class RotOp, class SPresOp, class Comm>
56pre(MultiVector&, MultiVector&)
60template < class Scalar, class DispOp, class RotOp, class SPresOp, class Comm>
67template < class Scalar, class DispOp, class RotOp, class SPresOp, class Comm>
68Dune::SolverCategory::Category
72 if constexpr (isParallel) {
73 return Dune::SolverCategory::overlapping;
75 return Dune::SolverCategory::sequential;
79template < class Scalar, class DispOp, class RotOp, class SPresOp, class Comm>
84 dispSolver0_->preconditioner().update();
85 dispSolver1_->preconditioner().update();
86 dispSolver2_->preconditioner().update();
87 rotSolver_->preconditioner().update();
88 sPresSolver_->preconditioner().update();
91template < class Scalar, class DispOp, class RotOp, class SPresOp, class Comm>
99template < class Scalar, class DispOp, class RotOp, class SPresOp, class Comm>
102apply(MultiVector& v, const MultiVector& d)
117 dispSolver0_->apply(v[_0], d0, result);
118 dispSolver1_->apply(v[_1], d1, result);
119 dispSolver2_->apply(v[_2], d2, result);
121 S_[_3][_0].mmv(v[_0], d3);
122 S_[_3][_1].mmv(v[_1], d3);
123 S_[_3][_2].mmv(v[_2], d3);
124 rotSolver_->apply(v[_3], d3, result);
126 S_[_4][_0].mmv(v[_0], d4);
127 S_[_4][_1].mmv(v[_1], d4);
128 S_[_4][_2].mmv(v[_2], d4);
129 sPresSolver_->apply(v[_4], d4, result);
132template < class Scalar, class DispOp, class RotOp, class SPresOp, class Comm>
137 const auto dispPrm = prm. get_child( "disp_disp_solver");
138 const auto rotPrm = prm. get_child( "rot_rot_solver");
139 const auto sPresPrm = prm. get_child( "spres_spres_solver");
141 std::function<Linear::DispVector0T<Scalar>()> dispWeightCalc;
142 std::function<Linear::RotVectorT<Scalar>()> rotWeightCalc;
143 std::function<Linear::SPresVectorT<Scalar>()> sPresWeightCalc;
145 if constexpr (isParallel) {
146 dispOp0_ = std::make_unique<DispOp>(S_[_0][_0], *comm_);
147 dispSolver0_ = std::make_unique<DispSolver>(*dispOp0_,
153 dispOp1_ = std::make_unique<DispOp>(S_[_1][_1], *comm_);
154 dispSolver1_ = std::make_unique<DispSolver>(*dispOp1_,
160 dispOp2_ = std::make_unique<DispOp>(S_[_2][_2], *comm_);
161 dispSolver2_ = std::make_unique<DispSolver>(*dispOp2_,
167 rotOp_ = std::make_unique<RotOp>(S_[_3][_3], *comm_);
168 rotSolver_ = std::make_unique<RotSolver>(*rotOp_,
174 sPresOp_ = std::make_unique<SPresOp>(S_[_4][_4], *comm_);
175 sPresSolver_ = std::make_unique<SPresSolver>(*sPresOp_,
181 dispOp0_ = std::make_unique<DispOp>(S_[_0][_0]);
182 dispSolver0_ = std::make_unique<DispSolver>(*dispOp0_,
187 dispOp1_ = std::make_unique<DispOp>(S_[_1][_1]);
188 dispSolver1_ = std::make_unique<DispSolver>(*dispOp1_,
193 dispOp2_ = std::make_unique<DispOp>(S_[_2][_2]);
194 dispSolver2_ = std::make_unique<DispSolver>(*dispOp2_,
199 rotOp_ = std::make_unique<RotOp>(S_[_3][_3]);
200 rotSolver_ = std::make_unique<RotSolver>(*rotOp_,
205 sPresOp_ = std::make_unique<SPresOp>(S_[_4][_4]);
206 sPresSolver_ = std::make_unique<SPresSolver>(*sPresOp_,
Dune::OwnerOverlapCopyCommunication< int, int > Comm Definition: FlexibleSolver_impl.hpp:394
Lightweight, non-owning 5x5 view over the sub-matrices owned by TpsaMatrix. Provides the operator int... Definition: TpsaTypes.hpp:132
Hierarchical collection of key/value pairs. Definition: PropertyTree.hpp:39
PropertyTree get_child(const std::string &key) const
Block lower-triangular preconditioner for the field-split TPSA system. Definition: TpsaPreconditioner.hpp:106
void pre(MultiVector &, MultiVector &) override Nothing to prepare, the sub-solvers set themselves up. Definition: TpsaPreconditioner_impl.hpp:56
void apply(MultiVector &v, const MultiVector &d) override Apply the preconditioner, i.e. approximately solve S v = d. Definition: TpsaPreconditioner_impl.hpp:102
Dune::SolverCategory::Category category() const override Solver category, overlapping in parallel and sequential otherwise. Definition: TpsaPreconditioner_impl.hpp:70
bool hasPerfectUpdate() const override The block solvers are rebuilt from the current matrix on update(). Definition: TpsaPreconditioner_impl.hpp:94
void post(MultiVector &) override Nothing to clean up after the last apply(). Definition: TpsaPreconditioner_impl.hpp:63
TpsaPreconditioner(const Linear::TpsaMatrixView< Scalar > &S, const PropertyTree &prm) Sequential constructor. Definition: TpsaPreconditioner_impl.hpp:34
void update() override Recompute the preconditioners of all five diagonal block solvers. Definition: TpsaPreconditioner_impl.hpp:82
Definition: blackoilbioeffectsmodules.hh:45
Dune::InverseOperatorResult InverseOperatorResult Definition: GpuBridge.hpp:32
|