Alien  1.3.0
Developer documentation
Loading...
Searching...
No Matches
SimpleCSRBackEnd.h
1// -*- tab-width: 2; indent-tabs-mode: nil; coding: utf-8-with-signature -*-
2//-----------------------------------------------------------------------------
3// Copyright 2000-2025 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#pragma once
8
9#include <arccore/message_passing/MessagePassingGlobal.h>
10#include <alien/core/backend/BackEnd.h>
11#include <alien/utils/Precomp.h>
12
14#include <alien/core/backend/IInternalLinearAlgebraT.h>
15
16/*---------------------------------------------------------------------------*/
17/*---------------------------------------------------------------------------*/
18
19namespace Alien
20{
21
22/*---------------------------------------------------------------------------*/
23/*---------------------------------------------------------------------------*/
24
25class MultiVectorImpl;
26template <typename T>
27class SimpleCSRMatrix;
28template <typename T>
29class SimpleCSRVector;
30
31template <typename T>
33{
34 typedef SimpleCSRMatrix<T> MatrixType;
35 typedef SimpleCSRVector<T> VectorType;
38};
39
40extern ALIEN_EXPORT SimpleCSRTraits<Real>::AlgebraType* SimpleCSRInternalLinearAlgebraFactory();
41extern ALIEN_EXPORT SimpleCSRTraits<Real>::AlgebraExprType*
42SimpleCSRInternalLinearAlgebraExprFactory();
43
44/*---------------------------------------------------------------------------*/
45
46namespace BackEnd
47{
48 namespace tag
49 {
50 struct simplecsr
51 {};
52 } // namespace tag
53} // namespace BackEnd
54
55template <>
56struct AlgebraTraits<BackEnd::tag::simplecsr>
57{
58 // clang-format off
59 typedef Real value_type;
60 typedef SimpleCSRTraits<Real>::MatrixType matrix_type;
61 typedef SimpleCSRTraits<Real>::VectorType vector_type;
62 typedef SimpleCSRTraits<Real>::AlgebraType algebra_type;
63 typedef SimpleCSRTraits<Real>::AlgebraExprType algebra_expr_type;
64 // clang-format off
65
66 static algebra_type* algebra_factory([[maybe_unused]] IMessagePassingMng* p_mng = nullptr)
67 {
68 return SimpleCSRInternalLinearAlgebraFactory();
69 }
70 static algebra_expr_type* algebra_expr_factory([[maybe_unused]] IMessagePassingMng* p_mng = nullptr)
71 {
72 return SimpleCSRInternalLinearAlgebraExprFactory();
73 }
74
75 static BackEndId name() { return "simplecsr"; }
76};
77
78/*---------------------------------------------------------------------------*/
79
80} // namespace Alien
81
82/*---------------------------------------------------------------------------*/
IInternalLinearAlgebraExprT.h.
Internal linear algebra interface.
Internal linear algebra interface.
-- tab-width: 2; indent-tabs-mode: nil; coding: utf-8-with-signature --
Definition BackEnd.h:17