26#include <alien/expression/solver/SolverStat.h>
69 if (A.
impl() ==
nullptr || dist.parallelMng() ==
nullptr)
72 if (not
m_solver->hasParallelSupport() && dist.isParallel()) {
73 throw FatalErrorException(
"solver is not parallel");
80 const auto& matrix = A.
impl()->
get<Tag>();
81 const auto& rhs = b.
impl()->
get<Tag>();
82 auto& sol = x.
impl()->
get<Tag>(
true);
86 return m_solver->solve(matrix, rhs, sol);
129 return m_solver->hasParallelSupport();
156std::shared_ptr<ILinearAlgebra>
Interface for all matrices.
virtual MultiMatrixImpl * impl()=0
Get the multimatrix implementation.
Interface for all vectors.
virtual MultiVectorImpl * impl()=0
Get the multivector implementation.
void init()
Initialize the linear solver.
const SolverStatus & getStatus() const
Get solver resolution status.
std::unique_ptr< KernelSolver > m_solver
The linear solver kernel.
virtual ~LinearSolver()
Free resources.
void updateParallelMng(Arccore::MessagePassing::IMessagePassingMng *pm)
update parallel_mng, required for redistribution For some solver libraries, Solver is kind of a globa...
Arccore::String getBackEndName() const
Get package back end name.
KernelSolver * implem()
Get kernel solver implementation.
bool hasParallelSupport() const
Indicates if the kernel is parallel.
void end()
Finalize the linear solver.
std::shared_ptr< ILinearAlgebra > algebra() const
Get compatible linear algebra.
const SolverStat & getSolverStat() const
Get statistics on the solve phase.
AlgebraTraits< Tag >::solver_type KernelSolver
The type of the solver.
bool solve(const IMatrix &A, const IVector &b, IVector &x)
Solve the linear system A * x = b.
Arccore::MessagePassing::IMessagePassingMng * parallelMng() const
Get the parallel manager.
const MatrixDistribution & distribution() const
Get the matrix distribution.
const AlgebraTraits< tag >::matrix_type & get() const
Get a specific matrix implementation.
const AlgebraTraits< tag >::vector_type & get() const
Get a specific vector implementation.
-- tab-width: 2; indent-tabs-mode: nil; coding: utf-8-with-signature --
Structure to store a solver status.