|
| 1 | +// -*- tab-width: 2; indent-tabs-mode: nil; coding: utf-8-with-signature -*- |
| 2 | +//----------------------------------------------------------------------------- |
| 3 | +// Copyright 2000-2024 CEA (www.cea.fr) IFPEN (www.ifpenergiesnouvelles.com) |
| 4 | +// See the top-level COPYRIGHT file for details. |
| 5 | +// SPDX-License-Identifier: Apache-2.0 |
| 6 | +//----------------------------------------------------------------------------- |
| 7 | + |
| 8 | +#pragma once |
| 9 | +#include <alien/utils/Precomp.h> |
| 10 | +#include <alien/core/backend/BackEnd.h> |
| 11 | +#include <arccore/message_passing/IMessagePassingMng.h> |
| 12 | + |
| 13 | +/*---------------------------------------------------------------------------*/ |
| 14 | + |
| 15 | +class IOptionsComposyxSolver; |
| 16 | + |
| 17 | +namespace Alien { |
| 18 | + |
| 19 | +/*---------------------------------------------------------------------------*/ |
| 20 | + |
| 21 | +class MultiVectorImpl; |
| 22 | +class MatrixData; |
| 23 | +class MatrixExp; |
| 24 | +class VectorData; |
| 25 | +class VectorData; |
| 26 | +class VectorExp; |
| 27 | +class ILinearSolver; |
| 28 | +class ILinearAlgebra; |
| 29 | + |
| 30 | +template<typename T> class ComposyxMatrix ; |
| 31 | +template<typename T> class ComposyxVector ; |
| 32 | + |
| 33 | +template<typename T> class SimpleCSRMatrix ; |
| 34 | +template<typename T> class SimpleCSRMatrix ; |
| 35 | + |
| 36 | +class Space; |
| 37 | + |
| 38 | +template <class Matrix, class Vector> class IInternalLinearAlgebra; |
| 39 | +template <class Matrix, class Vector> class IInternalLinearSolver; |
| 40 | + |
| 41 | +//extern IInternalLinearAlgebra<SimpleCSRMatrix<Real>, SimpleCSRMatrix<Real>>* |
| 42 | +//ComposyxSolverInternalLinearAlgebraFactory(); |
| 43 | + |
| 44 | +// extern IInternalLinearSolver<ComposyxMatrix<Real>, ComposyxVector<Real>>* |
| 45 | +extern ILinearSolver* ComposyxInternalLinearSolverFactory( |
| 46 | + IMessagePassingMng* p_mng, IOptionsComposyxSolver* options); |
| 47 | + |
| 48 | +extern IInternalLinearAlgebra<SimpleCSRMatrix<Real>, SimpleCSRMatrix<Real>>* |
| 49 | +ComposyxInternalLinearAlgebraFactory(); |
| 50 | + |
| 51 | +/*---------------------------------------------------------------------------*/ |
| 52 | + |
| 53 | +namespace BackEnd { |
| 54 | + namespace tag { |
| 55 | + struct composyx |
| 56 | + { |
| 57 | + }; |
| 58 | + } |
| 59 | +} |
| 60 | + |
| 61 | +template <> struct AlgebraTraits<BackEnd::tag::composyx> |
| 62 | +{ |
| 63 | + typedef ComposyxMatrix<Real> matrix_type; |
| 64 | + typedef ComposyxVector<Real> vector_type; |
| 65 | + |
| 66 | + typedef SimpleCSRMatrix<Real> csr_matrix_type; |
| 67 | + typedef SimpleCSRMatrix<Real> csr_vector_type; |
| 68 | + typedef IInternalLinearAlgebra<csr_matrix_type, csr_vector_type> algebra_type; |
| 69 | + |
| 70 | + // typedef IInternalLinearSolver<matrix_type, vector_type> solver_type; |
| 71 | + typedef ILinearSolver solver_type; |
| 72 | + typedef IOptionsComposyxSolver options_type; |
| 73 | + |
| 74 | + static algebra_type* algebra_factory(IMessagePassingMng* p_mng = nullptr) |
| 75 | + { |
| 76 | + return ComposyxInternalLinearAlgebraFactory(); |
| 77 | + } |
| 78 | + |
| 79 | + static solver_type* solver_factory(IMessagePassingMng* p_mng, options_type* options) |
| 80 | + { |
| 81 | + return ComposyxInternalLinearSolverFactory(p_mng, options); |
| 82 | + } |
| 83 | + |
| 84 | + static BackEndId name() { return "composyx"; } |
| 85 | +}; |
| 86 | + |
| 87 | +/*---------------------------------------------------------------------------*/ |
| 88 | + |
| 89 | +} // namespace Alien |
| 90 | + |
| 91 | +/*---------------------------------------------------------------------------*/ |
0 commit comments