Thyra
Version of the Day
|
Concrete implementation of an SPMD vector space for Tpetra. More...
#include <Thyra_TpetraVectorSpace_decl.hpp>
Public Types | |
typedef TpetraVectorSpace < Scalar, LocalOrdinal, GlobalOrdinal, Node > | this_t |
Related Functions | |
(Note that these are not member functions.) | |
template<class Scalar , class LocalOrdinal , class GlobalOrdinal , class Node > | |
RCP< TpetraVectorSpace< Scalar, LocalOrdinal, GlobalOrdinal, Node > > | tpetraVectorSpace (const RCP< const Tpetra::Map< LocalOrdinal, GlobalOrdinal, Node > > &tpetraMap) |
Nonmember constructor that creats a serial vector space. More... | |
Related Functions inherited from Thyra::VectorSpaceBase< Scalar > | |
template<class Scalar > | |
RCP< const VectorSpaceBase < Scalar > > | makeHaveOwnership (const RCP< const VectorSpaceBase< Scalar > > &vs) |
Helper function that clones a VectorSpaceBase object if the RCP does not have ownership. More... | |
template<class Scalar > | |
RCP< VectorBase< Scalar > > | createMember (const RCP< const VectorSpaceBase< Scalar > > &vs, const std::string &label="") |
Create a vector member from the vector space. More... | |
template<class Scalar > | |
RCP< VectorBase< Scalar > > | createMember (const VectorSpaceBase< Scalar > &vs, const std::string &label="") |
Calls createMember(Teuchos::rcp(&vs,false)) . More... | |
template<class Scalar > | |
RCP< MultiVectorBase< Scalar > > | createMembers (const RCP< const VectorSpaceBase< Scalar > > &vs, int numMembers, const std::string &label="") |
Create a set of vector members (a MultiVectorBase ) from the vector space. More... | |
template<class Scalar > | |
RCP< MultiVectorBase< Scalar > > | createMembers (const RCP< const VectorSpaceBase< Scalar > > &vs, const RCP< const VectorSpaceBase< Scalar > > &domain, const std::string &label="") |
Create a set of vector members (a MultiVectorBase ) from the vector space. More... | |
template<class Scalar > | |
RCP< MultiVectorBase< Scalar > > | createMembers (const VectorSpaceBase< Scalar > &vs, int numMembers, const std::string &label="") |
Calls createMembers(Teuchos::rcp(&vs,false),numMembers) . More... | |
template<class Scalar > | |
RCP< VectorBase< Scalar > > | createMemberView (const RCP< const VectorSpaceBase< Scalar > > &vs, const RTOpPack::SubVectorView< Scalar > &raw_v, const std::string &label="") |
Create a vector member that is a non-const view of raw data. More... | |
template<class Scalar > | |
RCP< VectorBase< Scalar > > | createMemberView (const VectorSpaceBase< Scalar > &vs, const RTOpPack::SubVectorView< Scalar > &raw_v, const std::string &label="") |
Calls createMemberView(Teuchos::rcp(&vs,false),raw_v) . More... | |
template<class Scalar > | |
RCP< const VectorBase< Scalar > > | createMemberView (const RCP< const VectorSpaceBase< Scalar > > &vs, const RTOpPack::ConstSubVectorView< Scalar > &raw_v, const std::string &label="") |
Create a vector member that is a const view of raw data. More... | |
template<class Scalar > | |
RCP< const VectorBase< Scalar > > | createMemberView (const VectorSpaceBase< Scalar > &vs, const RTOpPack::ConstSubVectorView< Scalar > &raw_v, const std::string &label="") |
Calls createMemberView(Teuchos::rcp(&vs,false),raw_v) . More... | |
template<class Scalar > | |
RCP< MultiVectorBase< Scalar > > | createMembersView (const RCP< const VectorSpaceBase< Scalar > > &vs, const RTOpPack::SubMultiVectorView< Scalar > &raw_mv, const std::string &label="") |
Create a multi-vector member that is a non-const view of raw data. More... | |
template<class Scalar > | |
RCP< MultiVectorBase< Scalar > > | createMembersView (const VectorSpaceBase< Scalar > &vs, const RTOpPack::SubMultiVectorView< Scalar > &raw_mv, const std::string &label="") |
Calls createMembersView(Teuchos::rcp(&vs,false),raw_mv) . More... | |
template<class Scalar > | |
RCP< const MultiVectorBase < Scalar > > | createMembersView (const RCP< const VectorSpaceBase< Scalar > > &vs, const RTOpPack::ConstSubMultiVectorView< Scalar > &raw_mv, const std::string &label="") |
Create a multi-vector member that is a const view of raw data. More... | |
template<class Scalar > | |
RCP< const MultiVectorBase < Scalar > > | createMembersView (const VectorSpaceBase< Scalar > &vs, const RTOpPack::ConstSubMultiVectorView< Scalar > &raw_mv, const std::string &label="") |
Calls createMembersView(Teuchos::rcp(&vs,false),raw_mv) . More... | |
Related Functions inherited from Thyra::ScalarProdVectorSpaceBase< Scalar > | |
template<class Scalar > | |
RCP< const ScalarProdVectorSpaceBase < Scalar > > | createSmallScalarProdVectorSpaceBase (const RCP< const VectorSpaceBase< Scalar > > &vs, const Ordinal dim) |
Create a small vector space casted to ScalarProdVectorSpaceBase. More... | |
Constructors and initializers | |
static RCP< TpetraVectorSpace < Scalar, LocalOrdinal, GlobalOrdinal, Node > > | create () |
Create with weak ownership to self. More... | |
void | initialize (const RCP< const Tpetra::Map< LocalOrdinal, GlobalOrdinal, Node > > &tpetraMap) |
Initialize a serial space. More... | |
Utility functions | |
RCP< TpetraVectorSpace< Scalar, LocalOrdinal, GlobalOrdinal, Node > > | createLocallyReplicatedVectorSpace (int size) const |
Create Tpetra locally replicated vector space. More... | |
Public overridden from VectorSpaceBase | |
bool | hasInCoreView (const Range1D &rng, const EViewType viewType, const EStrideType strideType) const |
Returns true if all the elements in rng are in this process. More... | |
RCP< const VectorSpaceBase < Scalar > > | clone () const |
RCP< const Tpetra::Map < LocalOrdinal, GlobalOrdinal, Node > > | getTpetraMap () const |
Get the embedded Tpetra::Map. More... | |
Protected overridden from VectorSpaceBase | |
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. The caching mechanism must be implemented by child classes, by default this just calls the regular createMembersView . More... | |
RCP< const MultiVectorBase < Scalar > > | createCachedMembersView (const RTOpPack::ConstSubMultiVectorView< Scalar > &raw_mv) const |
Create a (possibly) cached multi-vector member that is a const view of raw multi-vector data. The caching mechanism must be implemented by child classes, by default this just calls the regular createMembersView . More... | |
RCP< VectorBase< Scalar > > | createMember () const |
RCP< MultiVectorBase< Scalar > > | createMembers (int numMembers) const |
Public overridden from SpmdVectorSpaceDefaultBase | |
RCP< const Teuchos::Comm < Ordinal > > | getComm () const |
Ordinal | localSubDim () const |
Additional Inherited Members | |
Public Member Functions inherited from Thyra::SpmdVectorSpaceDefaultBase< Scalar > | |
SpmdVectorSpaceDefaultBase () | |
Ordinal | localOffset () const |
Ordinal | mapCode () const |
bool | isLocallyReplicated () const |
Returns true if vector space is locally replicated space. More... | |
std::string | description () const |
Ordinal | dim () const |
Returns the sum of the local number of elements on every process. More... | |
Teuchos::RCP< const VectorSpaceFactoryBase< Scalar > > | smallVecSpcFcty () const |
Returns a DefaultSpmdVectorSpaceFactory object that has been given getComm() . More... | |
bool | isCompatible (const VectorSpaceBase< Scalar > &vecSpc) const |
Checks the general compatibility of parallel (or serial on one process) Spmd-based vector spaces. More... | |
Public Member Functions inherited from Thyra::SpmdVectorSpaceBase< Scalar > | |
Public Member Functions inherited from Thyra::VectorSpaceBase< Scalar > | |
void | scalarProds (const MultiVectorBase< Scalar > &X, const MultiVectorBase< Scalar > &Y, const ArrayView< Scalar > &scalarProds_out) const |
Return the scalar product of each column in two multi-vectors in the vector space. More... | |
Public Member Functions inherited from Thyra::ScalarProdVectorSpaceBase< Scalar > | |
ScalarProdVectorSpaceBase () | |
Construct to use dot product as the default. More... | |
ScalarProdVectorSpaceBase (const RCP< const ScalarProdBase< Scalar > > &scalarProd) | |
Construct with a different scalar product. More... | |
virtual void | setScalarProd (const RCP< const ScalarProdBase< Scalar > > &scalarProd) |
Set a different scalar product. More... | |
RCP< const ScalarProdBase < Scalar > > | getScalarProd () const |
Return the current scalar product. More... | |
bool | isEuclidean () const |
Returns getScalarProd()->isEuclidean() More... | |
Scalar | scalarProd (const VectorBase< Scalar > &x, const VectorBase< Scalar > &y) const |
Returns getScalarProd()->scalarProd(x,y) More... | |
void | scalarProdsImpl (const MultiVectorBase< Scalar > &X, const MultiVectorBase< Scalar > &Y, const ArrayView< Scalar > &scalarProds_out) const |
Calls getScalarProd()->scalarProds(X,Y,scalar_prods) More... | |
Protected Member Functions inherited from Thyra::SpmdVectorSpaceDefaultBase< Scalar > | |
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 updated. More... | |
Protected Member Functions inherited from Thyra::VectorSpaceBase< Scalar > | |
Protected Member Functions inherited from Thyra::VectorSpaceDefaultBase< Scalar > | |
RCP< VectorBase< Scalar > > | createMemberView (const RTOpPack::SubVectorView< Scalar > &raw_v) const |
RCP< const VectorBase< Scalar > > | createMemberView (const RTOpPack::ConstSubVectorView< Scalar > &raw_v) const |
RCP< MultiVectorBase< Scalar > > | createMembersView (const RTOpPack::SubMultiVectorView< Scalar > &raw_mv) const |
RCP< const MultiVectorBase < Scalar > > | createMembersView (const RTOpPack::ConstSubMultiVectorView< Scalar > &raw_mv) const |
Concrete implementation of an SPMD vector space for Tpetra.
Definition at line 27 of file Thyra_TpetraVectorSpace_decl.hpp.
typedef TpetraVectorSpace<Scalar,LocalOrdinal,GlobalOrdinal,Node> Thyra::TpetraVectorSpace< Scalar, LocalOrdinal, GlobalOrdinal, Node >::this_t |
Definition at line 32 of file Thyra_TpetraVectorSpace_decl.hpp.
|
static |
Create with weak ownership to self.
Definition at line 26 of file Thyra_TpetraVectorSpace_def.hpp.
void Thyra::TpetraVectorSpace< Scalar, LocalOrdinal, GlobalOrdinal, Node >::initialize | ( | const RCP< const Tpetra::Map< LocalOrdinal, GlobalOrdinal, Node > > & | tpetraMap | ) |
Initialize a serial space.
Definition at line 35 of file Thyra_TpetraVectorSpace_def.hpp.
RCP< TpetraVectorSpace< Scalar, LocalOrdinal, GlobalOrdinal, Node > > Thyra::TpetraVectorSpace< Scalar, LocalOrdinal, GlobalOrdinal, Node >::createLocallyReplicatedVectorSpace | ( | int | size | ) | const |
Create Tpetra locally replicated vector space.
This vector space forms the domain space of a Thyra::TpetraMultiVector.
Definition at line 53 of file Thyra_TpetraVectorSpace_def.hpp.
|
virtual |
Returns true if all the elements in rng
are in this process.
Reimplemented from Thyra::VectorSpaceBase< Scalar >.
Definition at line 229 of file Thyra_TpetraVectorSpace_def.hpp.
|
virtual |
Reimplemented from Thyra::VectorSpaceBase< Scalar >.
Definition at line 245 of file Thyra_TpetraVectorSpace_def.hpp.
RCP< const Tpetra::Map< LocalOrdinal, GlobalOrdinal, Node > > Thyra::TpetraVectorSpace< Scalar, LocalOrdinal, GlobalOrdinal, Node >::getTpetraMap | ( | ) | const |
Get the embedded Tpetra::Map.
Definition at line 252 of file Thyra_TpetraVectorSpace_def.hpp.
|
protectedvirtual |
Implements Thyra::VectorSpaceBase< Scalar >.
Definition at line 66 of file Thyra_TpetraVectorSpace_def.hpp.
|
protectedvirtual |
Implements Thyra::VectorSpaceBase< Scalar >.
Definition at line 79 of file Thyra_TpetraVectorSpace_def.hpp.
|
virtual |
Create a (possibly) cached multi-vector member that is a non-const
view of raw multi-vector data. The caching mechanism must be implemented by child classes, by default this just calls the regular createMembersView
.
raw_mv | [in] On input contains pointer (i.e. raw_mv.values() ) to array that the returned MultiVectorBase will be a view of. |
Preconditions:
raw_mv
has been initialized to memory (i.e. raw_mv.subDim()!=0 && raw_mv.values()!=NULL
).
raw_mv
is consistent with the local storage of this spaces vector data. This precondition is purposefully vague since this function can be used an variety of specialized use-cases.
Postconditions:
See this->createMembers()
where numMembers==raw_mv.numSubCols()
It is stated here that the client can not expect that the values pointed to by raw_mv.values()
to be changed until the smart pointer returnVal
goes out of scope. This is to allow for an implementation that temporarily copies data into and out of a MultiVectorBase
object using explicit vector access.
Reimplemented from Thyra::VectorSpaceBase< Scalar >.
Definition at line 124 of file Thyra_TpetraVectorSpace_def.hpp.
|
virtual |
Create a (possibly) cached multi-vector member that is a const
view of raw multi-vector data. The caching mechanism must be implemented by child classes, by default this just calls the regular createMembersView
.
raw_mv | [in] On input contains pointer (i.e. raw_mv.values() ) to array that the returned MultiVectorBase will be a view of. The data pointed to by raw_mv.values() must remain valid until the returned MultiVectorBase object is destroyed. |
This function works exactly the same as the previous version that takes a RTOpPack::SubMultiVectorView
object except that this version takes a RTOpPack::ConstSubMultiVectorView
object and returns a smart pointer to a const
MultiVectorBase
object.
Preconditions:
See the previous RTOpPack::SubMultiVectorView
version of this function.
Postconditions:
See this->createMember()
Reimplemented from Thyra::VectorSpaceBase< Scalar >.
Definition at line 184 of file Thyra_TpetraVectorSpace_def.hpp.
|
virtual |
Implements Thyra::SpmdVectorSpaceBase< Scalar >.
Definition at line 262 of file Thyra_TpetraVectorSpace_def.hpp.
|
virtual |
Implements Thyra::SpmdVectorSpaceBase< Scalar >.
Definition at line 269 of file Thyra_TpetraVectorSpace_def.hpp.
|
related |
Nonmember constructor that creats a serial vector space.
Definition at line 141 of file Thyra_TpetraVectorSpace_decl.hpp.