Thyra::SpmdVectorSpaceBase< Scalar > Class Template Reference

Base abstract VectorSpaceBase class for all SPMD-based vector spaces. More...

#include <Thyra_SpmdVectorSpaceBaseDecl.hpp>

Inheritance diagram for Thyra::SpmdVectorSpaceBase< Scalar >:

Inheritance graph
[legend]
List of all members.

Pure virtual methods to be overridden by subclasses

virtual Teuchos::RCP< const
Teuchos::Comm< Index > > 
getComm () const =0
 Returns the SPMD communicator.
virtual Index localSubDim () const =0
 Returns the number of local elements stored on this process.
virtual Index localOffset () const =0
 Returns the offset for the local sub-vector stored on this process.
virtual Index mapCode () const =0
 Returns the code for the mapping of elements to processes.

Detailed Description

template<class Scalar>
class Thyra::SpmdVectorSpaceBase< Scalar >

Base abstract VectorSpaceBase class for all SPMD-based vector spaces.

This interface defines a basic mechanism for the interoperability of SPMD VectorBase and MultiVectorBase objects. See the base classes SPMDVetorBase and SpmdMultiVectorBase to demonstrate how this interface is used to achieve universal interoperability of vector and multi-vector objects.

Specifically, these classes are designed to handle three different use case:

This interface provides all the information necessary to implement the SpmdVectorBase::applyOp() and SpmdMultiVectorBase::applyOp() functions in all of the above described use cases. This interface returns an SPMD communicator (of which all compatible vector spaces must have the same communicator obviously) through the method getComm().

VectorBase data layout:

For the case of a distributed parallel vector, this interface base class assumes that vector data is partitioned to processes in contiguous chunks of dense subvectors. To spell this out, let v be the local vector that is sorted on this process and let g be the global vector. Then these two vectors are related (using zero-based indexing) as:

    v(k) == g(this->localOffset() + k), for k = 0...this->localSubDim()-1
 

Any type of mapping of vector data to processes that can not be interpreted in this way can not rely on this base class for interoperability. Note that as long as the elements in a process are partitioned to unique processes and no ghost elements are present, the actual indexes used by the application with these vectors is immaterial. The indexes associated with this set of interfaces, however, are only meaningful to abstract numerical algorithms and provide an arbitrary label for certain types of coordinate-dependent operations (like required in an active-set method for optimization). Therefore, as long as the underlying vector represents a unique partitioning of elements, these classes can be used. There is a default implementation of localOffset() that automatically assumes this contiguous mapping of elements to processes and in general this should not be changed.

Notes to subclass developers:

The pure virtual methods getComm() and localSubDim() declared in this interface along with the pure virtual methods dim() and createMember() are the only methods that must be overridden.

If this this is in an uninitialized state then localSubDim() should return 0.

If optimized implementations of multi-vectors can be supported, then the createMembers() method should also be overridden.

Definition at line 117 of file Thyra_SpmdVectorSpaceBaseDecl.hpp.


Member Function Documentation

template<class Scalar>
virtual Teuchos::RCP<const Teuchos::Comm<Index> > Thyra::SpmdVectorSpaceBase< Scalar >::getComm (  )  const [pure virtual]

Returns the SPMD communicator.

template<class Scalar>
virtual Index Thyra::SpmdVectorSpaceBase< Scalar >::localSubDim (  )  const [pure virtual]

Returns the number of local elements stored on this process.

If this this is uninitialized then localSubDim() returns 0.

template<class Scalar>
virtual Index Thyra::SpmdVectorSpaceBase< Scalar >::localOffset (  )  const [pure virtual]

Returns the offset for the local sub-vector stored on this process.

template<class Scalar>
virtual Index Thyra::SpmdVectorSpaceBase< Scalar >::mapCode (  )  const [pure virtual]

Returns the code for the mapping of elements to processes.

Postconditions:


The documentation for this class was generated from the following file:
Generated on Wed May 12 21:42:13 2010 for Extended Thyra ANA Operator/Vector Interfaces by  doxygen 1.4.7