Thyra Version of the Day
Loading...
Searching...
No Matches
Thyra_SpmdVectorSpaceDefaultBase_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_SPMD_VECTOR_SPACE_BASE_DECL_HPP
11#define THYRA_SPMD_VECTOR_SPACE_BASE_DECL_HPP
12
13#include "Thyra_SpmdVectorSpaceBase.hpp"
14#include "Thyra_ScalarProdVectorSpaceBase_decl.hpp"
15
16namespace Thyra {
17
60template<class Scalar>
62 : virtual public SpmdVectorSpaceBase<Scalar>
63 , virtual public ScalarProdVectorSpaceBase<Scalar>
64{
65public:
66
69
72
83 Ordinal localOffset() const;
84
109 Ordinal mapCode() const;
110
112 bool isLocallyReplicated() const;
113
115
119 std::string description() const;
121
124
127 Ordinal dim() const;
128
132
157 bool isCompatible(const VectorSpaceBase<Scalar>& vecSpc) const;
158
160
161protected:
162
190 virtual void updateState(const Ordinal globalDim,
191 const bool isLocallyReplicated = false);
192
193private:
194
195 // //////////////////////////////////////
196 // Private data members
197
198 Ordinal mapCode_; // < 0 is a flag that everything needs initialized
199 Ordinal defaultLocalOffset_;
200 Ordinal defaultGlobalDim_;
201 Ordinal localSubDim_;
202 bool isLocallyReplicated_;
203
205
206}; // end class SpmdVectorSpaceDefaultBase
207
208} // end namespace Thyra
209
210#endif // THYRA_SPMD_VECTOR_SPACE_BASE_DECL_HPP
Base abstract VectorSpaceBase class for all SPMD-based vector spaces.
Base VectorSpaceBase class for all SPMD vector spaces with contiguous local-to-global indexing.
virtual void updateState(const Ordinal globalDim, const bool isLocallyReplicated=false)
This function must be called whenever the state of this changes and some internal state must be updat...
Teuchos::RCP< const VectorSpaceFactoryBase< Scalar > > smallVecSpcFcty() const
Returns a DefaultSpmdVectorSpaceFactory object that has been given getComm().
bool isLocallyReplicated() const
Returns true if vector space is locally replicated space.
Ordinal dim() const
Returns the sum of the local number of elements on every process.
bool isCompatible(const VectorSpaceBase< Scalar > &vecSpc) const
Checks the general compatibility of parallel (or serial on one process) Spmd-based vector spaces.
Abstract interface for objects that represent a space for vectors.
Teuchos::Ordinal Ordinal
Type for the dimension of a vector space. `*.