Thyra Version of the Day
Loading...
Searching...
No Matches
Thyra_TpetraVectorSpace_decl.hpp
1// @HEADER
2// *****************************************************************************
3// Thyra: Interfaces and Support for Abstract Numerical Algorithms
4//
5// Copyright 2004 NTESS and the Thyra contributors.
6// SPDX-License-Identifier: BSD-3-Clause
7// *****************************************************************************
8// @HEADER
9
10#ifndef THYRA_TPETRA_VECTOR_SPACE_DECL_HPP
11#define THYRA_TPETRA_VECTOR_SPACE_DECL_HPP
12
13
14#include "Thyra_SpmdVectorSpaceDefaultBase.hpp"
15#include "Tpetra_Map.hpp"
16#include "Tpetra_MultiVector.hpp"
17
18
19namespace Thyra {
20
21
26template <class Scalar, class LocalOrdinal, class GlobalOrdinal, class Node>
28{
29public:
30
33
36
39
41 void initialize(
42 const RCP<const Tpetra::Map<LocalOrdinal,GlobalOrdinal,Node> > &tpetraMap
43 );
44
46
48
49
56
58
64 bool hasInCoreView(
65 const Range1D& rng, const EViewType viewType, const EStrideType strideType
66 ) const;
69
72 getTpetraMap() const;
73
75
76protected:
77
80
83 createMember() const;
86 createMembers(int numMembers) const;
87
88public:
89
92
95
97
98public:
99
102
106 Ordinal localSubDim() const;
107
109
111
112private:
113
114 // //////////////////////////////////////
115 // Private data members
116
120 // The only reason Thyra needs this comm_ object is because Thyra
121 // uses Ordinal as the Comm template parameter, while Tpetra uses
122 // int. Ordinal is some 64-bit type, which doesn't make any sense,
123 // given that MPI implementations currently only allow 32-bit
124 // process ranks. This is why Thyra does not just use the Map's
125 // stored communicator.
127 RCP<this_t> weakSelfPtr_;
128
129 // /////////////////////////////////////
130 // Private member functions
131
133
134}; // end class TpetraVectorSpace
135
136
141template <class Scalar, class LocalOrdinal, class GlobalOrdinal, class Node>
143tpetraVectorSpace(
144 const RCP<const Tpetra::Map<LocalOrdinal,GlobalOrdinal,Node> > &tpetraMap);
145
146
147} // end namespace Thyra
148
149
150#endif // THYRA_TPETRA_VECTOR_SPACE_DECL_HPP
Base VectorSpaceBase class for all SPMD vector spaces with contiguous local-to-global indexing.
Concrete implementation of an SPMD vector space for Tpetra.
TpetraVectorSpace< Scalar, LocalOrdinal, GlobalOrdinal, Node > this_t
RCP< TpetraVectorSpace< Scalar, LocalOrdinal, GlobalOrdinal, Node > > createLocallyReplicatedVectorSpace(int size) const
Create Tpetra locally replicated vector space.
RCP< const Tpetra::Map< LocalOrdinal, GlobalOrdinal, Node > > getTpetraMap() const
Get the embedded Tpetra::Map.
bool hasInCoreView(const Range1D &rng, const EViewType viewType, const EStrideType strideType) const
Returns true if all the elements in rng are in this process.
void initialize(const RCP< const Tpetra::Map< LocalOrdinal, GlobalOrdinal, Node > > &tpetraMap)
Initialize a serial space.
RCP< const VectorSpaceBase< Scalar > > clone() const
RCP< VectorBase< Scalar > > createMember() const
RCP< MultiVectorBase< Scalar > > createCachedMembersView(const RTOpPack::SubMultiVectorView< Scalar > &raw_mv, bool initialize=true) const
Create a (possibly) cached multi-vector member that is a non-const view of raw multi-vector data....
RCP< MultiVectorBase< Scalar > > createMembers(int numMembers) const
RCP< const Teuchos::Comm< Ordinal > > getComm() const
static RCP< TpetraVectorSpace< Scalar, LocalOrdinal, GlobalOrdinal, Node > > create()
Create with weak ownership to self.
EStrideType
Determine if data is unit stride or non-unit stride.
EViewType
Determines if a view is a direct view of data or a detached copy of data.
Teuchos::Ordinal Ordinal
Type for the dimension of a vector space. `*.