Alien  1.3.0
User documentation
Loading...
Searching...
No Matches
ISpace.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 ISpace.h
21 * \brief ISpace.h
22 */
23
24#pragma once
25
26#include <alien/utils/Precomp.h>
27
28#include <arccore/collections/Array.h>
29
30/*---------------------------------------------------------------------------*/
31/*---------------------------------------------------------------------------*/
32
33namespace Alien
34{
35
36/*---------------------------------------------------------------------------*/
37/*---------------------------------------------------------------------------*/
38
39/*!
40 * \ingroup data
41 * \brief Interface for algebraic space objects
42 */
43class ALIEN_EXPORT ISpace
44{
45 protected:
46 //! Constructor
47 ISpace() {}
48
49 private:
50 /* Forbid use of copy and move constructors for implementations. */
51 ISpace(const ISpace&) = delete;
52
53 ISpace(ISpace&&) = delete;
54
55 void operator=(const ISpace&) = delete;
56
57 void operator=(ISpace&&) = delete;
58
59 public:
60 //! Free resources
61 virtual ~ISpace() {}
62
63 /*!
64 * \brief Comparison operator
65 * \param[in] space The space to compare to
66 * \returns Wheteher the spaces are the same
67 */
68 virtual bool operator==(const ISpace& space) const = 0;
69
70 /*!
71 * \brief Comparison operator
72 * \param[in] space The space to compare to
73 * \returns Wheteher the spaces are different
74 */
75 virtual bool operator!=(const ISpace& space) const = 0;
76
77 /*!
78 * \brief Get space size
79 * \returns The size of the space
80 */
81 virtual Arccore::Integer size() const = 0;
82
83 /*!
84 * \brief Get space name
85 * \returns The name of the space
86 */
87 virtual const Arccore::String& name() const = 0;
88
89 /*!
90 * \brief Set label on matrix entries
91 * \param[in] label The name of the label
92 * \param[in] indices The indices to which label is set
93 */
94 virtual void setField(
95 Arccore::String label, const Arccore::UniqueArray<Arccore::Integer>& indices) = 0;
96
97 /*!
98 * \brief Get the number of fields
99 * \returns The number of fields (labels)
100 */
101 virtual Arccore::Integer nbField() const = 0;
102
103 /*!
104 * \brief Get the label of the i-th field
105 * \param[in] i The requested field
106 * \returns The associated label
107 */
108 virtual Arccore::String fieldLabel(Arccore::Integer i) const = 0;
109
110 /*!
111 * \brief Get indices associated to the i-th field
112 * \para[in] i The requested field
113 * \returns The indices associated to the field
114 */
115 virtual const Arccore::UniqueArray<Arccore::Integer>& field(
116 Arccore::Integer i) const = 0;
117
118 /*!
119 * \brief Get the indices associated to a label
120 * \param[in] label The requested label
121 * \returns The indices associated to the field
122 */
123 virtual const Arccore::UniqueArray<Arccore::Integer>& field(
124 Arccore::String label) const = 0;
125
126 /*!
127 * \brief Clone this object
128 * \returns A clone of this object
129 */
130 virtual std::shared_ptr<ISpace> clone() const = 0;
131};
132
133/*---------------------------------------------------------------------------*/
134/*---------------------------------------------------------------------------*/
135
136} // namespace Alien
137
138/*---------------------------------------------------------------------------*/
139/*---------------------------------------------------------------------------*/
Interface for algebraic space objects.
Definition ISpace.h:44
virtual std::shared_ptr< ISpace > clone() const =0
Clone this object.
virtual Arccore::Integer nbField() const =0
Get the number of fields.
virtual const Arccore::UniqueArray< Arccore::Integer > & field(Arccore::String label) const =0
Get the indices associated to a label.
virtual bool operator==(const ISpace &space) const =0
Comparison operator.
virtual ~ISpace()
Free resources.
Definition ISpace.h:61
virtual const Arccore::String & name() const =0
Get space name.
virtual Arccore::String fieldLabel(Arccore::Integer i) const =0
Get the label of the i-th field.
virtual bool operator!=(const ISpace &space) const =0
Comparison operator.
virtual Arccore::Integer size() const =0
Get space size.
virtual void setField(Arccore::String label, const Arccore::UniqueArray< Arccore::Integer > &indices)=0
Set label on matrix entries.
virtual const Arccore::UniqueArray< Arccore::Integer > & field(Arccore::Integer i) const =0
Get indices associated to the i-th field \para[in] i The requested field.
ISpace()
Constructor.
Definition ISpace.h:47
-- tab-width: 2; indent-tabs-mode: nil; coding: utf-8-with-signature --
Definition BackEnd.h:17