Alien  1.3.0
User documentation
Loading...
Searching...
No Matches
Block.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 Block.h
21 * \brief Block.h
22 */
23
24#pragma once
25
26#include <alien/utils/Precomp.h>
27
28/*---------------------------------------------------------------------------*/
29/*---------------------------------------------------------------------------*/
30
31namespace Alien
32{
33
34/*---------------------------------------------------------------------------*/
35/*---------------------------------------------------------------------------*/
36
37/*!
38 * \ingroup block
39 * \brief Block elements for block matrices
40 *
41 * Defines block parameters, for square or rectangulars block entries in a block matrix.
42 * All blocks in the matrix are identical in term of size.
43 */
44class ALIEN_EXPORT Block final
45{
46 public:
47 /*!
48 * \brief Square block constructor
49 * \param[in] block_size Size of the block
50 */
51 explicit Block(Arccore::Integer block_size);
52
53 /*!
54 * \brief Rectangular block constructor
55 * \param[in] block_sizeX Size of the block in "X" direction
56 * \param[in] block_sizeY Size of the block in "Y" direction
57 */
58 Block(Arccore::Integer block_sizeX, Arccore::Integer block_sizeY);
59
60 /*!
61 * \brief Copy constructor
62 * \param[in] block The block to copy
63 */
64 Block(const Block& block);
65
66 //! Free resources
67 ~Block() = default;
68
69 Block(Block&& block) = delete;
70 Block& operator=(const Block& block) = delete;
71
72 public:
73 /*!
74 * \brief Get square block size
75 * \returns The size of the block
76 */
77 Arccore::Integer size() const;
78
79 /*!
80 * \brief Get rectangular block size in the "X" direction
81 * \returns Block size in the "X" direction
82 */
83 Arccore::Integer sizeX() const;
84
85 /*!
86 * \brief Get rectangular block size in the "Y" direction
87 * \returns Block size in the "Y" direction
88 */
89 Arccore::Integer sizeY() const;
90
91 /*!
92 * \brief Clone this object
93 * \returns A copy of this object
94 */
95 std::shared_ptr<Block> clone() const;
96
97 private:
98 struct Internal;
99 //! Actual implementation
100 std::shared_ptr<Internal> m_internal;
101};
102
103/*---------------------------------------------------------------------------*/
104/*---------------------------------------------------------------------------*/
105
106} // namespace Alien
107
108/*---------------------------------------------------------------------------*/
109/*---------------------------------------------------------------------------*/
Block(Arccore::Integer block_sizeX, Arccore::Integer block_sizeY)
Rectangular block constructor.
Arccore::Integer size() const
Get square block size.
Definition Block.cc:90
Arccore::Integer sizeX() const
Get rectangular block size in the "X" direction.
Definition Block.cc:99
Arccore::Integer sizeY() const
Get rectangular block size in the "Y" direction.
Definition Block.cc:108
Block(Arccore::Integer block_size)
Square block constructor.
std::shared_ptr< Block > clone() const
Clone this object.
Definition Block.cc:117
~Block()=default
Free resources.
-- tab-width: 2; indent-tabs-mode: nil; coding: utf-8-with-signature --
Definition BackEnd.h:17
Internal structure for square or rectangular blocks.
Definition Block.cc:41