Alien  1.3.0
User documentation
Loading...
Searching...
No Matches
VBlockOffsets.h
Go to the documentation of this file.
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/*!
20 * \file VBlockOffsets.h
21 * \brief VBlockOffsets.h
22 */
23
24#pragma once
25
27
30#include <alien/utils/Precomp.h>
31
32/*---------------------------------------------------------------------------*/
33/*---------------------------------------------------------------------------*/
34
35namespace Alien
36{
37
38/*---------------------------------------------------------------------------*/
39/*---------------------------------------------------------------------------*/
40
41/*!
42 * \ingroup block
43 * \brief Compute block offsets for variable block elements
44 */
45class ALIEN_EXPORT VBlockImpl final
46{
47 public:
48 /*!
49 * \brief Constructor for vectors variable blocks
50 * \param[in] block The variable blocks
51 * \param[in] dist The vector distribution
52 */
53 VBlockImpl(const VBlock& block, const VectorDistribution& dist);
54
55 /*!
56 * \brief Constructor for matrices variable blocks
57 * \param[in] block The variable blocks
58 * \param[in] dist The matrix distribution
59 */
60 VBlockImpl(const VBlock& block, const MatrixDistribution& dist);
61
62 //! Free resources
64
65 /*!
66 * \brief Copy constructor
67 * \param[in] block The variable block offset computation tool
68 */
69 VBlockImpl(const VBlockImpl& block);
70
71 private:
72 VBlockImpl(VBlockImpl&& block) = delete;
73 VBlockImpl& operator=(const VBlockImpl& block) = delete;
74
75 public:
76 /*!
77 * \brief Get the block size from a local index
78 * \param[in] index The local index
79 * \returns The block size for the index
80 */
81 Arccore::Integer sizeFromLocalIndex(Arccore::Integer index) const;
82
83 /*!
84 * \brief Get the offset from a local index
85 * \param[in] index The local index
86 * \returns The offset for the index
87 */
88 Arccore::Integer offsetFromLocalIndex(Arccore::Integer index) const;
89
90 /*!
91 * \brief Get the offset from a global or local index
92 * \param[in] index The global or local index
93 * \returns The offset for the index
94 */
95 Arccore::Integer offset(Arccore::Integer index) const;
96
97 /*!
98 * \brief Get the block sizes for all local blocks
99 * \returns The array with all local block sizes
100 */
101 Arccore::ConstArrayView<Arccore::Integer> sizeOfLocalIndex() const;
102
103 /*!
104 * \brief Get the offsets for all local blocks
105 * \returns The array with all offsets for all local blocks
106 */
107 Arccore::ConstArrayView<Arccore::Integer> offsetOfLocalIndex() const;
108
109 /*!
110 * \brief Copy this object
111 * \returns A copy of this object
112 */
113 std::shared_ptr<VBlockImpl> clone() const;
114
115 private:
116 /*!
117 * \brief Compute offsets for variable block size elements
118 * \param[in] local_size Local size of the algebraic element
119 * \param[in] local_offset Local offset
120 */
121 void compute(Arccore::Integer local_size, Arccore::Integer local_offset);
122
123 struct Internal;
124 //! Actual implementation of the variable block offsets computation tool
125 std::shared_ptr<Internal> m_internal;
126};
127
128/*---------------------------------------------------------------------------*/
129/*---------------------------------------------------------------------------*/
130
131} // namespace Alien
132
133/*---------------------------------------------------------------------------*/
134/*---------------------------------------------------------------------------*/
MatrixDistribution.h.
VBlock.h.
VectorDistribution.h.
Computes a matrix distribution.
Compute block offsets for variable block elements.
~VBlockImpl()
Free resources.
VBlockImpl(const VBlock &block, const VectorDistribution &dist)
Constructor for vectors variable blocks.
Variable size block elements for block matrices.
Definition VBlock.h:46
Computes a vector distribution.
-- tab-width: 2; indent-tabs-mode: nil; coding: utf-8-with-signature --
Definition BackEnd.h:17