Alien  1.3.0
Developer documentation
Loading...
Searching...
No Matches
data/CompositeVector.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
23
24#pragma once
25
26#include <alien/data/IVector.h>
27#include <alien/kernels/composite/CompositeVectorElement.h>
28#include <alien/utils/ObjectWithTrace.h>
29#include <cstdlib>
30
31/*---------------------------------------------------------------------------*/
32/*---------------------------------------------------------------------------*/
33
34namespace Alien
35{
36
37/*---------------------------------------------------------------------------*/
38/*---------------------------------------------------------------------------*/
39
40namespace CompositeKernel
41{
42
43 /*---------------------------------------------------------------------------*/
44 /*---------------------------------------------------------------------------*/
45
46 class Vector;
47
48 /*---------------------------------------------------------------------------*/
49 /*---------------------------------------------------------------------------*/
50
51} // namespace CompositeKernel
52
53/*---------------------------------------------------------------------------*/
54/*---------------------------------------------------------------------------*/
55
62class ALIEN_EXPORT CompositeVector : public IVector
63, private ObjectWithTrace
64{
65 public:
68
69 public:
72
77 CompositeVector(Arccore::Integer nc);
78
80 virtual ~CompositeVector() {}
81
86 void visit(ICopyOnWriteVector&) const;
87
92 const ISpace& space() const;
93
98 void resize(Arccore::Integer nc);
99
104 Arccore::Integer size() const;
105
111 Element composite(Arccore::Integer i);
112
118 IVector& operator[](Arccore::Integer i);
119
125 const IVector& operator[](Arccore::Integer i) const;
126
131 void setUserFeature(Arccore::String feature);
132
137 bool hasUserFeature(Arccore::String feature) const;
138
139 public:
145
150 const MultiVectorImpl* impl() const;
151
153 void free();
154
156 void clear();
157
158 private:
160 std::shared_ptr<MultiVectorImpl> m_impl;
163};
164
165/*---------------------------------------------------------------------------*/
166/*---------------------------------------------------------------------------*/
167
168extern ALIEN_EXPORT CompositeVector::Element CompositeElement(
169CompositeVector& v, Arccore::Integer i);
170
171/*---------------------------------------------------------------------------*/
172/*---------------------------------------------------------------------------*/
173
174} // namespace Alien
175
176/*---------------------------------------------------------------------------*/
177/*---------------------------------------------------------------------------*/
IVector.h.
Composite vector for heterogenous vector.
IVector & operator[](Arccore::Integer i)
Get the i-th subvector.
MultiVectorImpl * impl()
Get the multivector implementation.
CompositeKernel::Vector & m_composite_vector
The composite vector.
CompositeVector(Arccore::Integer nc)
Constructor.
virtual ~CompositeVector()
Free resources.
CompositeKernel::VectorElement Element
Type of submatrix element.
void setUserFeature(Arccore::String feature)
Add a feature to the composite vector.
std::shared_ptr< MultiVectorImpl > m_impl
The multivector implementation.
bool hasUserFeature(Arccore::String feature) const
Check if the composite vector has a feature.
void free()
Free resources.
const IVector & operator[](Arccore::Integer i) const
Get the i-th subvector.
void clear()
Clear resources.
Interface for algebraic space objects.
Definition ISpace.h:44
IVector()
Constructor.
Definition IVector.h:54
-- tab-width: 2; indent-tabs-mode: nil; coding: utf-8-with-signature --
Definition BackEnd.h:17