12#ifndef ARCCORE_ALINA_ALINALIB_H
13#define ARCCORE_ALINA_ALINALIB_H
26#include "arccore/alina/AlinaGlobal.h"
40 double residual = 0.0;
43typedef double (*AlinaDefVecFunction)(
int vec, ptrdiff_t coo,
void* data);
61class ARCCORE_ALINA_EXPORT AlinaParameters
64 friend AlinaPreconditioner;
65 friend AlinaSequentialSolver;
66 friend AlinaDistributedSolver;
84 void setString(
const char* name,
const char* value);
91 std::shared_ptr<AlinaParametersImpl> m_p;
99class ARCCORE_ALINA_EXPORT AlinaCSRMatrixView
107 AlinaCSRMatrixView(Int32 nb_row,
const Int32* row_indexes,
const Int32* columns,
const double* values)
109 , m_row_indexes(row_indexes, nb_row + 1)
110 , m_columns(columns, row_indexes[nb_row])
111 , m_values(values, row_indexes[nb_row])
115 : m_nb_row(row_indexes.size() - 1)
116 , m_row_indexes(row_indexes)
123 constexpr Int32 nbRow()
const {
return m_nb_row; }
153class ARCCORE_ALINA_EXPORT AlinaPreconditioner
159 AlinaPreconditioner(
int n,
168 void apply(
const double* rhs,
double* x);
175 std::shared_ptr<AlinaPreconditionerImpl> m_p;
213 std::shared_ptr<AlinaSequentialSolverImpl> m_p;
241 std::shared_ptr<AlinaDistributedSolverImpl> m_p;
General declarations for the 'message_passing' component.
Types and functions associated with the classes SpanImpl, SmallSpan and Span.
CSR Matrix view used in AlinaLib.
void checkSizes() const
Check that sizes are valid:
AlinaDistributedSolver(Arcane::MessagePassing::IMessagePassingMng *comm, const AlinaCSRMatrixView &matrix_view, const AlinaParameters ¶ms)
Create distributed solver.
AlinaConvergenceInfo solve(Arcane::SmallSpan< const double > rhs, Arcane::SmallSpan< double > x)
Find solution for the given RHS.
Handle parameters for Alina.
void setInt64(const char *name, Arcane::Int64 value)
Set Int64 parameter in the parameter list.
void setInt32(const char *name, Arcane::Int32 value)
Set Int32 parameter in the parameter list.
void setReal(const char *name, Arcane::Real value)
Set floating point parameter in the parameter list.
void readFromJSON(const char *fname)
Read parameters from a JSON file.
void setString(const char *name, const char *value)
Set floating point parameter in the parameter list.
Handle preconditioner for a solver.
void report()
Printout preconditioner structure.
void apply(const double *rhs, double *x)
Apply AMG preconditioner (x = M^(-1) * rhs).
void report()
Printout solver structure.
AlinaConvergenceInfo solve(Arcane::SmallSpan< const double > rhs, Arcane::SmallSpan< double > x)
Solve the problem for the given right-hand side.
AlinaSequentialSolver(const AlinaCSRMatrixView &matrix_view, const AlinaParameters *parameters)
Build a solver for matrix matrix.
AlinaConvergenceInfo solveMatrix(const AlinaCSRMatrixView &matrix_view, Arcane::SmallSpan< const double > rhs, Arcane::SmallSpan< double > x)
Solve the problem for the given matrix and the right-hand side.
Interface of the message passing manager.
View of an array of elements of type T.
std::int64_t Int64
Signed integer type of 64 bits.
double Real
Type representing a real number.
std::int32_t Int32
Signed integer type of 32 bits.