Alien  1.3.0
Developer documentation
Loading...
Searching...
No Matches
VectorData.h
1/*
2 * Copyright 2020 IFPEN-CEA
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 * http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 *
16 * SPDX-License-Identifier: Apache-2.0
17 */
18
19#pragma once
20
21#include <memory>
22
23#include <alien/data/IVector.h>
24#include <alien/move/AlienMoveSemanticPrecomp.h>
25
26/*---------------------------------------------------------------------------*/
27/*---------------------------------------------------------------------------*/
28
29namespace Alien
30{
31
32/*---------------------------------------------------------------------------*/
33/*---------------------------------------------------------------------------*/
34
35class Block;
36class VBlock;
37class Space;
39
40/*---------------------------------------------------------------------------*/
41/*---------------------------------------------------------------------------*/
42
43namespace Move
44{
45
47 class ALIEN_MOVESEMANTIC_EXPORT VectorData : public IVector
48 {
49 public:
50 typedef Real ValueType;
51
59 VectorData();
60
70 [[deprecated]] VectorData(const ISpace& space, const VectorDistribution& dist);
71
82 [[deprecated]] VectorData(Integer size, const VectorDistribution& dist);
83
90 explicit VectorData(const VectorDistribution& dist);
91
96 VectorData(VectorData&& vector);
98
102 virtual ~VectorData() = default;
103
110
116 void init(const ISpace& space, const VectorDistribution& dist);
117
119 VectorData(const VectorData&) = delete;
121 VectorData& operator=(const VectorData&) = delete;
122
123 VectorData clone() const;
124
127 void setBlockInfos(const Integer block_size);
128
129 void setBlockInfos(const Block* block);
130
131 void setBlockInfos(const VBlock* block);
132
133 const Block* block() const;
134
135 const VBlock* vblock() const;
137
139 void free();
140
145 void clear();
146
148 void visit(ICopyOnWriteVector&) const;
149
158 const ISpace& space() const;
159
164 const VectorDistribution& distribution() const;
165
173 void setUserFeature(String feature);
174
176 bool hasUserFeature(String feature) const;
178
185
186 const MultiVectorImpl* impl() const;
188
189 friend VectorData createVectorData(std::shared_ptr<MultiVectorImpl> multi);
190
191 private:
192 std::shared_ptr<MultiVectorImpl> m_impl;
193 };
194
195 VectorData ALIEN_MOVESEMANTIC_EXPORT
196 readFromMatrixMarket(const VectorDistribution& distribution, const std::string& filename);
197
198 // Do not export this factory.
199 VectorData createVectorData(std::shared_ptr<MultiVectorImpl> multi);
200} // namespace Move
201
202/*---------------------------------------------------------------------------*/
203/*---------------------------------------------------------------------------*/
204
205} // namespace Alien
206
207/*---------------------------------------------------------------------------*/
208/*---------------------------------------------------------------------------*/
IVector.h.
Block elements for block matrices.
Definition Block.h:45
Interface for algebraic space objects.
Definition ISpace.h:44
IVector()
Constructor.
Definition IVector.h:54
Algebraic Vector with internal multi-representation object.
Definition VectorData.h:48
Implementation of an algebraic space.
Definition Space.h:47
Variable size block elements for block matrices.
Definition VBlock.h:46
Computes a vector distribution.
void visit(ICopyOnWriteVector &) const
VectorData(const VectorData &)=delete
virtual ~VectorData()=default
VectorData & operator=(const VectorData &)=delete
VectorData & operator=(VectorData &&vector)
Move from Vector.
Definition VectorData.cc:68
void init(const ISpace &space, const VectorDistribution &dist)
Definition VectorData.cc:76
friend VectorData createVectorData(std::shared_ptr< MultiVectorImpl > multi)
MultiVectorImpl * impl()
Get the multivector implementation.
void setUserFeature(String feature)
bool hasUserFeature(String feature) const
const VectorDistribution & distribution() const
const ISpace & space() const
-- tab-width: 2; indent-tabs-mode: nil; coding: utf-8-with-signature --
Definition BackEnd.h:17