Alien  1.3.0
Developer documentation
Loading...
Searching...
No Matches
SystemReader.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 <string>
10#include <vector>
11
12#include <arccore/base/ArccoreGlobal.h>
13#include <arccore/message_passing/MessagePassingGlobal.h>
14
15#include <alien/ref/AlienRefExport.h>
16#include <alien/ref/AlienRefSemanticPrecomp.h>
17
18namespace Alien
19{
20
21class Matrix;
22class Vector;
23
24class BlockMatrix;
25class BlockVector;
26
27struct Importer;
28
29class ALIEN_REFSEMANTIC_EXPORT SystemReader
30{
31 public:
32 SystemReader(std::string const& filename, std::string format = "ascii",
33 Arccore::MessagePassing::IMessagePassingMng* parallel_mng = nullptr);
34 virtual ~SystemReader();
35
36 void read(Matrix& A);
37 /*
38 void read(Vector & x) ;
39 */
40 void read(BlockMatrix& A);
41 /*
42 void read(BlockVector & x) ;
43 */
44 private:
45 template <typename FileNodeT>
46 void _readMatrixInfo(Importer& importer, FileNodeT& info_node, int& nrows, int& ncols,
47 int& nnz, int& blk_size, int& blk_size2);
48
49 template <typename FileNodeT>
50 void _readCSRProfile(Importer& importer, FileNodeT& parent_node, int& nrows, int& nnz,
51 std::vector<int>& kcol, std::vector<int>& cols);
52
53 template <typename FileNodeT>
54 void _readMatrixValues(Importer& importer, FileNodeT& parent_node, int& size,
55 int& blk_size, int& blk_size2, std::vector<double>& values);
56
57 std::string m_filename;
58 std::string m_format;
59 int m_prec;
60 Arccore::Integer m_rank, m_nproc;
61 Arccore::MessagePassing::IMessagePassingMng* m_parallel_mng;
62};
63
64} // namespace Alien
-- tab-width: 2; indent-tabs-mode: nil; coding: utf-8-with-signature --
Definition BackEnd.h:17