Thyra
Version of the Day
Toggle main menu visibility
Loading...
Searching...
No Matches
core
src
support
operator_vector
adapter_support
Thyra_DefaultSpmdMultiVector_decl.hpp
1
// @HEADER
2
// ***********************************************************************
3
//
4
// Thyra: Interfaces and Support for Abstract Numerical Algorithms
5
// Copyright (2004) Sandia Corporation
6
//
7
// Under terms of Contract DE-AC04-94AL85000, there is a non-exclusive
8
// license for use of this work by or on behalf of the U.S. Government.
9
//
10
// Redistribution and use in source and binary forms, with or without
11
// modification, are permitted provided that the following conditions are
12
// met:
13
//
14
// 1. Redistributions of source code must retain the above copyright
15
// notice, this list of conditions and the following disclaimer.
16
//
17
// 2. Redistributions in binary form must reproduce the above copyright
18
// notice, this list of conditions and the following disclaimer in the
19
// documentation and/or other materials provided with the distribution.
20
//
21
// 3. Neither the name of the Corporation nor the names of the
22
// contributors may be used to endorse or promote products derived from
23
// this software without specific prior written permission.
24
//
25
// THIS SOFTWARE IS PROVIDED BY SANDIA CORPORATION "AS IS" AND ANY
26
// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
27
// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
28
// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL SANDIA CORPORATION OR THE
29
// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
30
// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
31
// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
32
// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
33
// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
34
// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
35
// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
36
//
37
// Questions? Contact Roscoe A. Bartlett (bartlettra@ornl.gov)
38
//
39
// ***********************************************************************
40
// @HEADER
41
42
#ifndef THYRA_Spmd_MULTI_VECTOR_STD_DECL_HPP
43
#define THYRA_Spmd_MULTI_VECTOR_STD_DECL_HPP
44
45
#include "Thyra_SpmdMultiVectorDefaultBase_decl.hpp"
46
47
48
namespace
Thyra {
49
50
67
template
<
class
Scalar>
68
class
DefaultSpmdMultiVector
:
virtual
public
SpmdMultiVectorDefaultBase
<Scalar> {
69
public
:
70
73
75
DefaultSpmdMultiVector
();
76
78
DefaultSpmdMultiVector
(
79
const
RCP
<
const
SpmdVectorSpaceBase<Scalar>
> &spmdRangeSpace,
80
const
RCP
<
const
ScalarProdVectorSpaceBase<Scalar>
> &domainSpace
81
);
82
84
DefaultSpmdMultiVector
(
85
const
RCP
<
const
SpmdVectorSpaceBase<Scalar>
> &spmdRangeSpace,
86
const
RCP
<
const
ScalarProdVectorSpaceBase<Scalar>
> &domainSpace,
87
const
ArrayRCP<Scalar>
&localValues,
88
const
Ordinal leadingDim = -1
89
);
90
106
void
initialize
(
107
const
RCP
<
const
SpmdVectorSpaceBase<Scalar>
> &spmdRangeSpace,
108
const
RCP
<
const
ScalarProdVectorSpaceBase<Scalar>
> &domainSpace
109
);
110
139
void
initialize
(
140
const
RCP
<
const
SpmdVectorSpaceBase<Scalar>
> &spmdRangeSpace,
141
const
RCP
<
const
ScalarProdVectorSpaceBase<Scalar>
> &domainSpace,
142
const
ArrayRCP<Scalar>
&localValues,
143
const
Ordinal leadingDim = -1
144
);
145
151
void
uninitialize
(
152
RCP
<
const
SpmdVectorSpaceBase<Scalar>
> *spmdRangeSpace = NULL,
153
RCP
<
const
ScalarProdVectorSpaceBase<Scalar>
> *domainSpace = NULL,
154
ArrayRCP<Scalar>
*localValues = NULL,
155
Ordinal *leadingDim = NULL
156
);
157
159
RCP< const ScalarProdVectorSpaceBase<Scalar>
>
160
domainScalarProdVecSpc
()
const
;
161
163
164
protected
:
165
168
169
RCP<VectorBase<Scalar>
>
nonconstColImpl
(Ordinal j);
171
RCP<const MultiVectorBase<Scalar>
>
172
contigSubViewImpl
(
const
Range1D
& colRng)
const
;
174
RCP<MultiVectorBase<Scalar>
>
175
nonconstContigSubViewImpl
(
const
Range1D
& colRng);
177
RCP<const MultiVectorBase<Scalar>
>
178
nonContigSubViewImpl
(
const
ArrayView<const int>
&cols)
const
;
180
RCP<MultiVectorBase<Scalar>
>
181
nonconstNonContigSubViewImpl
(
const
ArrayView<const int>
&cols);
183
186
187
RCP<const SpmdVectorSpaceBase<Scalar>
>
spmdSpaceImpl
()
const
;
189
void
getNonconstLocalMultiVectorDataImpl
(
190
const
Ptr
<
ArrayRCP<Scalar>
> &localValues,
const
Ptr<Ordinal>
&leadingDim
191
);
193
void
getLocalMultiVectorDataImpl
(
194
const
Ptr
<
ArrayRCP<const Scalar>
> &localValues,
const
Ptr<Ordinal>
&leadingDim
195
)
const
;
197
198
private
:
199
200
// ///////////////////////////////////////
201
// Private data members
202
203
RCP<const SpmdVectorSpaceBase<Scalar>
> spmdRangeSpace_;
204
RCP<const ScalarProdVectorSpaceBase<Scalar>
> domainSpace_;
205
ArrayRCP<Scalar>
localValues_;
206
Ordinal leadingDim_;
207
208
// ///////////////////////////////////////
209
// Private member functions
210
211
ArrayRCP<Scalar>
createContiguousCopy(
const
ArrayView<const int>
&cols)
const
;
212
213
public
:
214
215
#ifdef THYRA_DEBUG
216
// Unit testing sensing varaible
217
static
int
numSkipCopyBack;
218
#endif
219
220
};
// end class DefaultSpmdMultiVector
221
222
223
template
<
class
Scalar>
224
RCP<DefaultSpmdMultiVector<Scalar>
>
225
defaultSpmdMultiVector(
226
const
RCP
<
const
SpmdVectorSpaceBase<Scalar>
> &spmdRangeSpace,
227
const
RCP
<
const
ScalarProdVectorSpaceBase<Scalar>
> &domainSpace,
228
const
ArrayRCP<Scalar>
&localValues,
229
const
Ordinal leadingDim = -1
230
)
231
{
232
return
Teuchos::rcp
(
233
new
DefaultSpmdMultiVector<Scalar>
(
234
spmdRangeSpace, domainSpace, localValues, leadingDim
235
)
236
);
237
}
238
239
240
}
// end namespace Thyra
241
242
243
#endif
// THYRA_Spmd_MULTI_VECTOR_STD_DECL_HPP
Teuchos::ArrayRCP
Teuchos::ArrayView
Teuchos::Ptr
Teuchos::RCP
Thyra::DefaultSpmdMultiVector
Efficient concrete implementation subclass for SPMD multi-vectors.
Definition
Thyra_DefaultSpmdMultiVector_decl.hpp:68
Thyra::DefaultSpmdMultiVector::getLocalMultiVectorDataImpl
void getLocalMultiVectorDataImpl(const Ptr< ArrayRCP< const Scalar > > &localValues, const Ptr< Ordinal > &leadingDim) const
Definition
Thyra_DefaultSpmdMultiVector_def.hpp:369
Thyra::DefaultSpmdMultiVector::spmdSpaceImpl
RCP< const SpmdVectorSpaceBase< Scalar > > spmdSpaceImpl() const
Definition
Thyra_DefaultSpmdMultiVector_def.hpp:346
Thyra::DefaultSpmdMultiVector::DefaultSpmdMultiVector
DefaultSpmdMultiVector()
Construct to uninitialized.
Definition
Thyra_DefaultSpmdMultiVector_def.hpp:140
Thyra::DefaultSpmdMultiVector::uninitialize
void uninitialize(RCP< const SpmdVectorSpaceBase< Scalar > > *spmdRangeSpace=NULL, RCP< const ScalarProdVectorSpaceBase< Scalar > > *domainSpace=NULL, ArrayRCP< Scalar > *localValues=NULL, Ordinal *leadingDim=NULL)
Set to an uninitialized state.
Definition
Thyra_DefaultSpmdMultiVector_def.hpp:208
Thyra::DefaultSpmdMultiVector::nonconstNonContigSubViewImpl
RCP< MultiVectorBase< Scalar > > nonconstNonContigSubViewImpl(const ArrayView< const int > &cols)
Definition
Thyra_DefaultSpmdMultiVector_def.hpp:321
Thyra::DefaultSpmdMultiVector::nonconstColImpl
RCP< VectorBase< Scalar > > nonconstColImpl(Ordinal j)
Definition
Thyra_DefaultSpmdMultiVector_def.hpp:245
Thyra::DefaultSpmdMultiVector::contigSubViewImpl
RCP< const MultiVectorBase< Scalar > > contigSubViewImpl(const Range1D &colRng) const
Definition
Thyra_DefaultSpmdMultiVector_def.hpp:266
Thyra::DefaultSpmdMultiVector::getNonconstLocalMultiVectorDataImpl
void getNonconstLocalMultiVectorDataImpl(const Ptr< ArrayRCP< Scalar > > &localValues, const Ptr< Ordinal > &leadingDim)
Definition
Thyra_DefaultSpmdMultiVector_def.hpp:356
Thyra::DefaultSpmdMultiVector::nonconstContigSubViewImpl
RCP< MultiVectorBase< Scalar > > nonconstContigSubViewImpl(const Range1D &colRng)
Definition
Thyra_DefaultSpmdMultiVector_def.hpp:287
Thyra::DefaultSpmdMultiVector::initialize
void initialize(const RCP< const SpmdVectorSpaceBase< Scalar > > &spmdRangeSpace, const RCP< const ScalarProdVectorSpaceBase< Scalar > > &domainSpace)
Initialize only with vector spaces where storage is allocated internally..
Definition
Thyra_DefaultSpmdMultiVector_def.hpp:168
Thyra::DefaultSpmdMultiVector::nonContigSubViewImpl
RCP< const MultiVectorBase< Scalar > > nonContigSubViewImpl(const ArrayView< const int > &cols) const
Definition
Thyra_DefaultSpmdMultiVector_def.hpp:304
Thyra::DefaultSpmdMultiVector::domainScalarProdVecSpc
RCP< const ScalarProdVectorSpaceBase< Scalar > > domainScalarProdVecSpc() const
Definition
Thyra_DefaultSpmdMultiVector_def.hpp:231
Thyra::ScalarProdVectorSpaceBase
Forward decl.
Definition
Thyra_ScalarProdVectorSpaceBase_decl.hpp:85
Thyra::SpmdMultiVectorDefaultBase::SpmdMultiVectorDefaultBase
SpmdMultiVectorDefaultBase()
Definition
Thyra_SpmdMultiVectorDefaultBase_def.hpp:77
Thyra::SpmdVectorSpaceBase
Base abstract VectorSpaceBase class for all SPMD-based vector spaces.
Definition
Thyra_SpmdVectorSpaceBase_decl.hpp:132
Thyra::Range1D
Teuchos::Range1D Range1D
Definition
Thyra_OperatorVectorTypes.hpp:97
Teuchos::rcp
TEUCHOS_DEPRECATED RCP< T > rcp(T *p, Dealloc_T dealloc, bool owns_mem)
Generated by
1.17.0