mirror of
https://github.com/OPM/opm-simulators.git
synced 2025-02-25 18:55:30 -06:00
IncompTpfa now takes a linear solver as a constructor argument.
This commit is contained in:
parent
e52cae02ac
commit
87723a08a0
@ -21,7 +21,7 @@
|
|||||||
#include <opm/core/pressure/tpfa/ifs_tpfa.h>
|
#include <opm/core/pressure/tpfa/ifs_tpfa.h>
|
||||||
#include <opm/core/pressure/tpfa/trans_tpfa.h>
|
#include <opm/core/pressure/tpfa/trans_tpfa.h>
|
||||||
#include <opm/core/pressure/mimetic/mimetic.h>
|
#include <opm/core/pressure/mimetic/mimetic.h>
|
||||||
#include <opm/core/linalg/LinearSolverUmfpack.hpp>
|
#include <opm/core/linalg/LinearSolverInterface.hpp>
|
||||||
#include <opm/core/utility/ErrorMacros.hpp>
|
#include <opm/core/utility/ErrorMacros.hpp>
|
||||||
|
|
||||||
namespace Opm
|
namespace Opm
|
||||||
@ -38,8 +38,10 @@ namespace Opm
|
|||||||
/// have D elements.
|
/// have D elements.
|
||||||
IncompTpfa::IncompTpfa(const UnstructuredGrid& g,
|
IncompTpfa::IncompTpfa(const UnstructuredGrid& g,
|
||||||
const double* permeability,
|
const double* permeability,
|
||||||
const double* gravity)
|
const double* gravity,
|
||||||
|
const LinearSolverInterface& linsolver)
|
||||||
: grid_(g),
|
: grid_(g),
|
||||||
|
linsolver_(linsolver),
|
||||||
htrans_(g.cell_facepos[ g.number_of_cells ]),
|
htrans_(g.cell_facepos[ g.number_of_cells ]),
|
||||||
trans_ (g.number_of_faces)
|
trans_ (g.number_of_faces)
|
||||||
{
|
{
|
||||||
@ -105,8 +107,7 @@ namespace Opm
|
|||||||
|
|
||||||
ifs_tpfa_assemble(gg, &trans_[0], &src[0], &gpress_omegaweighted_[0], h_);
|
ifs_tpfa_assemble(gg, &trans_[0], &src[0], &gpress_omegaweighted_[0], h_);
|
||||||
|
|
||||||
LinearSolverUmfpack linsolve;
|
linsolver_.solve(h_->A, h_->b, h_->x);
|
||||||
linsolve.solve(h_->A, h_->b, h_->x);
|
|
||||||
|
|
||||||
pressure.resize(grid_.number_of_cells);
|
pressure.resize(grid_.number_of_cells);
|
||||||
faceflux.resize(grid_.number_of_faces);
|
faceflux.resize(grid_.number_of_faces);
|
||||||
|
@ -30,6 +30,8 @@ struct ifs_tpfa_data;
|
|||||||
namespace Opm
|
namespace Opm
|
||||||
{
|
{
|
||||||
|
|
||||||
|
class LinearSolverInterface;
|
||||||
|
|
||||||
/// Encapsulating a tpfa pressure solver for the incompressible case.
|
/// Encapsulating a tpfa pressure solver for the incompressible case.
|
||||||
/// Supports gravity and simple sources as driving forces.
|
/// Supports gravity and simple sources as driving forces.
|
||||||
/// Below we use the shortcuts D for the number of dimensions, N
|
/// Below we use the shortcuts D for the number of dimensions, N
|
||||||
@ -47,7 +49,8 @@ namespace Opm
|
|||||||
/// have D elements.
|
/// have D elements.
|
||||||
IncompTpfa(const UnstructuredGrid& g,
|
IncompTpfa(const UnstructuredGrid& g,
|
||||||
const double* permeability,
|
const double* permeability,
|
||||||
const double* gravity);
|
const double* gravity,
|
||||||
|
const LinearSolverInterface& linsolver);
|
||||||
|
|
||||||
/// Destructor.
|
/// Destructor.
|
||||||
~IncompTpfa();
|
~IncompTpfa();
|
||||||
@ -71,6 +74,7 @@ namespace Opm
|
|||||||
|
|
||||||
private:
|
private:
|
||||||
const UnstructuredGrid& grid_;
|
const UnstructuredGrid& grid_;
|
||||||
|
const LinearSolverInterface& linsolver_;
|
||||||
::std::vector<double> htrans_;
|
::std::vector<double> htrans_;
|
||||||
::std::vector<double> trans_ ;
|
::std::vector<double> trans_ ;
|
||||||
::std::vector<double> gpress_;
|
::std::vector<double> gpress_;
|
||||||
|
Loading…
Reference in New Issue
Block a user