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
110private:
111
112 // //////////////////////////////////////
113 // Private data members
114
118 // The only reason Thyra needs this comm_ object is because Thyra
119 // uses Ordinal as the Comm template parameter, while Tpetra uses
120 // int. Ordinal is some 64-bit type, which doesn't make any sense,
121 // given that MPI implementations currently only allow 32-bit
122 // process ranks. This is why Thyra does not just use the Map's
123 // stored communicator.
125 RCP<this_t> weakSelfPtr_;
126
127 // /////////////////////////////////////
128 // Private member functions
129
131
132}; // end class TpetraVectorSpace
133
134
139template <class Scalar, class LocalOrdinal, class GlobalOrdinal, class Node>
142 const RCP<const Tpetra::Map<LocalOrdinal,GlobalOrdinal,Node> > &tpetraMap
143 )
144{
147 vs->initialize(tpetraMap);
148 return vs;
149}
150
151
152} // end namespace Thyra
153
154
155#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.
RCP< TpetraVectorSpace< Scalar, LocalOrdinal, GlobalOrdinal, Node > > tpetraVectorSpace(const RCP< const Tpetra::Map< LocalOrdinal, GlobalOrdinal, Node > > &tpetraMap)
Nonmember constructor that creats a serial vector space.
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. `*.