Arcane  4.1.12.0
Developer documentation
Loading...
Searching...
No Matches
AlephVector.h
1// -*- tab-width: 2; indent-tabs-mode: nil; coding: utf-8-with-signature -*-
2//-----------------------------------------------------------------------------
3// Copyright 2000-2026 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/* AlephVector.h (C) 2000-2024 */
9/* */
10/*---------------------------------------------------------------------------*/
11#ifndef ARCANE_ALEPH_ALEPHVECTOR_H
12#define ARCANE_ALEPH_ALEPHVECTOR_H
13/*---------------------------------------------------------------------------*/
14/*---------------------------------------------------------------------------*/
15
16#include "arcane/aleph/AlephGlobal.h"
17
18#include "arcane/utils/TraceAccessor.h"
19
20/*---------------------------------------------------------------------------*/
21/*---------------------------------------------------------------------------*/
22
23namespace Arcane
24{
25
26/*---------------------------------------------------------------------------*/
27/*---------------------------------------------------------------------------*/
31class ARCANE_ALEPH_EXPORT AlephVector
32: public TraceAccessor
33{
34 public:
35
36 explicit AlephVector(AlephKernel*);
37 ~AlephVector();
38
39 public:
40
41 void create();
42 void create_really();
43 void update() { throw NotImplementedException(A_FUNCINFO); }
44 void reSetLocalComponents(AlephVector*);
45 void setLocalComponents(Integer num_values,
46 ConstArrayView<AlephInt> glob_indices,
48 void setLocalComponents(ConstArrayView<double> values);
49 void getLocalComponents(Integer vector_size,
50 ConstArrayView<AlephInt> global_indice,
51 ArrayView<double> vector_values);
52 void getLocalComponents(Array<double>& values);
53 void startFilling();
54 void assemble();
55 void assemble_waitAndFill();
56 void reassemble();
57 void reassemble_waitAndFill();
58 void copy(AlephVector*) { throw NotImplementedException(A_FUNCINFO); }
59 void writeToFile(const String);
60 IAlephVector* implementation(void) { return m_implementation; }
61
62 private:
63
64 AlephKernel* m_kernel = nullptr;
65 Integer m_index = -1;
66 ArrayView<Integer> m_ranks;
67 bool m_participating_in_solver = false;
68 IAlephVector* m_implementation = nullptr;
69
70 private:
71
72 // Buffers used when we are the solver
73 UniqueArray<AlephInt> m_aleph_vector_buffer_idxs;
74 UniqueArray<Real> m_aleph_vector_buffer_vals;
75 UniqueArray<AlephInt> m_aleph_vector_buffer_idx;
76 UniqueArray<Real> m_aleph_vector_buffer_val;
77 UniqueArray<Parallel::Request> m_parallel_requests;
78 UniqueArray<Parallel::Request> m_parallel_reassemble_requests;
79
80 public:
81
82 Integer m_bkp_num_values;
83 UniqueArray<AlephInt> m_bkp_indexs;
84 UniqueArray<double> m_bkp_values;
85};
86
87/*---------------------------------------------------------------------------*/
88/*---------------------------------------------------------------------------*/
89
90} // namespace Arcane
91
92/*---------------------------------------------------------------------------*/
93/*---------------------------------------------------------------------------*/
94
95#endif
Modifiable view of an array of type T.
Base class for 1D data vectors.
Constant view of an array of type T.
TraceAccessor(ITraceMng *m)
Constructs an accessor via the trace manager m.
1D data vector with value semantics (STL style).
-- tab-width: 2; indent-tabs-mode: nil; coding: utf-8-with-signature --
Int32 Integer
Type representing an integer.