Alien  1.3.0
Developer documentation
Loading...
Searching...
No Matches
BlockVector.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
22#include <alien/data/IVector.h>
23#include <alien/data/Space.h>
25#include <alien/ref/AlienRefSemanticPrecomp.h>
26#include <cstdlib>
27
28/*---------------------------------------------------------------------------*/
29/*---------------------------------------------------------------------------*/
30
31namespace Alien
32{
33
34/*---------------------------------------------------------------------------*/
35/*---------------------------------------------------------------------------*/
36
37class ALIEN_REFSEMANTIC_EXPORT BlockVector final : public IVector
38{
39 public:
40 BlockVector();
41
42 BlockVector(const Block& block, const VectorDistribution& dist);
43
44 BlockVector(Integer nrows, Integer nrows_local, const Block& block,
45 IMessagePassingMng* parallel_mng);
46
47 BlockVector(Integer nrows, const Block& block, IMessagePassingMng* parallel_mng);
48
49 BlockVector(BlockVector&& vector);
50
51 ~BlockVector() override = default;
52
53 BlockVector& operator=(BlockVector&& vector);
54
55 BlockVector(const BlockVector&) = delete;
56 BlockVector& operator=(const BlockVector&) = delete;
57
58 public:
59 void init(const Block& block, const VectorDistribution& dist);
60
61 void free();
62
63 void clear();
64
65 // Pour les expressions
66 void visit(ICopyOnWriteVector&) const override;
67
68 [[nodiscard]] const VectorDistribution& distribution() const;
69
70 [[nodiscard]] const ISpace& space() const override;
71
72 void setUserFeature(String feature);
73
74 [[nodiscard]] bool hasUserFeature(Arccore::String feature) const;
75
76 [[nodiscard]] const Block& block() const;
77
78 public:
79 MultiVectorImpl* impl() override;
80
81 [[nodiscard]] const MultiVectorImpl* impl() const override;
82
83 private:
84 std::shared_ptr<MultiVectorImpl> m_impl;
85};
86
87/*---------------------------------------------------------------------------*/
88/*---------------------------------------------------------------------------*/
89
90} // namespace Alien
91
92/*---------------------------------------------------------------------------*/
93/*---------------------------------------------------------------------------*/
Block.h.
IVector.h.
Space.h.
VectorDistribution.h.
const ISpace & space() const override
Get the space associated to the vector.
MultiVectorImpl * impl() override
Get the multivector implementation.
void visit(ICopyOnWriteVector &) const override
Visit method.
Block elements for block matrices.
Definition Block.h:45
Interface for algebraic space objects.
Definition ISpace.h:44
IVector()
Constructor.
Definition IVector.h:54
Computes a vector distribution.
-- tab-width: 2; indent-tabs-mode: nil; coding: utf-8-with-signature --
Definition BackEnd.h:17