Public Member Functions | Static Public Member Functions | Protected Member Functions | Private Attributes
TSFExtended::EpetraVector Class Reference

TSF extension of Thyra::EpetraVector, implementing the LoadableVector interface allowing an application to access elements. More...

Inheritance diagram for TSFExtended::EpetraVector:
TSFExtended::IndexableVector< double > TSFExtended::RawDataAccessibleVector< double > Sundance::Printable TSFExtended::LoadableVector< double > TSFExtended::AccessibleVector< double >

List of all members.

Public Member Functions

 EpetraVector (const RCP< const VectorSpaceBase< double > > &vs)
 Construct with a smart pointer to an Epetra vector space.
 EpetraVector (const RCP< const VectorSpaceBase< double > > &vs, const RCP< Epetra_Vector > &vec)
 Construct with smart pointers to an Epetra vector space and an existing Epetra vector.
const RCP< Epetra_Vector > & epetraVec () const
RCP< Epetra_Vector > & epetraVec ()
VectorBase interface
RCP< const VectorSpaceBase
< double > > 
space () const
void applyOpImpl (const RTOpPack::RTOpT< double > &op, const ArrayView< const Ptr< const VectorBase< double > > > &vecs, const ArrayView< const Ptr< VectorBase< double > > > &targ_vecs, const Ptr< RTOpPack::ReductTarget > &reduct_obj, const OrdType global_offset) const
void acquireDetachedVectorViewImpl (const Range1D &rng, RTOpPack::ConstSubVectorView< double > *sub_vec) const
void releaseDetachedVectorViewImpl (RTOpPack::ConstSubVectorView< double > *sub_vec) const
void acquireNonconstDetachedVectorViewImpl (const Range1D &rng, RTOpPack::SubVectorView< double > *sub_vec)
void commitNonconstDetachedVectorViewImpl (RTOpPack::SubVectorView< double > *sub_vec)
IndexableVector interface
virtual const double & operator[] (OrdType globalIndex) const
 read the element at the given global index
virtual double & operator[] (OrdType globalIndex)
 writable access to the element at the given global index
Raw data access interface
virtual const double * dataPtr () const
virtual double * dataPtr ()
LoadableVector interface
void setElement (OrdType globalIndex, const double &value)
 set a single element
void addToElement (OrdType globalIndex, const double &value)
 add to a single element
void setElements (int numElems, const int *globalIndices, const double *values)
 set a group of elements
void addToElements (int numElems, const int *globalIndices, const double *values)
 add to a group of elements
void finalizeAssembly ()
 Do whatever finalization steps are needed by the implementation, for instance, synchronizing border elements.
AccessibleVector interface
const double & getElement (OrdType globalIndex) const
 get the element at the given global index
void getElements (const OrdType *globalIndices, int numElems, Teuchos::Array< double > &elems) const
Printable interface
void print (std::ostream &os) const
 Print to a stream.

Static Public Member Functions

static const Epetra_Vector & getConcrete (const TSFExtended::Vector< double > &tsfVec)
 Get a read-only Epetra_Vector.
static Epetra_Vector & getConcrete (TSFExtended::Vector< double > &tsfVec)
 Get a read-write Epetra_Vector.
static Epetra_Vector * getConcretePtr (TSFExtended::Vector< double > &tsfVec)
 Get a read-write Epetra_Vector pointer.

Protected Member Functions

const RCP< const Epetra_Map > & epetraMap () const
Range1D validateRange (const Range1D &rng) const

Private Attributes

RCP< Epetra_Vector > epetraVec_
RCP< const
Thyra::VectorSpaceBase< double > > 
vecSpace_
RCP< const EpetraVectorSpaceepetraVecSpace_
RCP< const Epetra_Map > epetraMap_
int localOffset_
int localSubDim_
int globalDim_
bool in_applyOpImpl_

Detailed Description

TSF extension of Thyra::EpetraVector, implementing the LoadableVector interface allowing an application to access elements.

This class derives from Thyra::VectorDefaultBase, so it can be used seamlessly in any Thyra-based code.

Definition at line 52 of file TSFEpetraVector.hpp.


Constructor & Destructor Documentation

EpetraVector::EpetraVector ( const RCP< const VectorSpaceBase< double > > &  vs)

Construct with a smart pointer to an Epetra vector space.

Definition at line 55 of file TSFEpetraVector.cpp.

References TSFExtended::EpetraVectorSpace::epetraMap(), epetraMap_, epetraVec_, epetraVecSpace_, localOffset_, and localSubDim_.

EpetraVector::EpetraVector ( const RCP< const VectorSpaceBase< double > > &  vs,
const RCP< Epetra_Vector > &  vec 
)

Construct with smart pointers to an Epetra vector space and an existing Epetra vector.

Definition at line 84 of file TSFEpetraVector.cpp.

References TSFExtended::EpetraVectorSpace::epetraMap().


Member Function Documentation

void EpetraVector::acquireDetachedVectorViewImpl ( const Range1D &  rng,
RTOpPack::ConstSubVectorView< double > *  sub_vec 
) const

Definition at line 409 of file TSFEpetraVector.cpp.

References epetraVec_, localOffset_, localSubDim_, and validateRange().

void EpetraVector::acquireNonconstDetachedVectorViewImpl ( const Range1D &  rng,
RTOpPack::SubVectorView< double > *  sub_vec 
)

Definition at line 468 of file TSFEpetraVector.cpp.

References epetraVec_, localOffset_, localSubDim_, and validateRange().

void EpetraVector::addToElement ( OrdType  globalIndex,
const double &  value 
) [virtual]

add to a single element

Reimplemented from TSFExtended::IndexableVector< double >.

Definition at line 555 of file TSFEpetraVector.cpp.

References epetraVec().

void EpetraVector::addToElements ( int  numElems,
const int *  globalIndices,
const double *  values 
)

add to a group of elements

Definition at line 591 of file TSFEpetraVector.cpp.

References epetraVec().

void EpetraVector::applyOpImpl ( const RTOpPack::RTOpT< double > &  op,
const ArrayView< const Ptr< const VectorBase< double > > > &  vecs,
const ArrayView< const Ptr< VectorBase< double > > > &  targ_vecs,
const Ptr< RTOpPack::ReductTarget > &  reduct_obj,
const OrdType  global_offset 
) const
void EpetraVector::commitNonconstDetachedVectorViewImpl ( RTOpPack::SubVectorView< double > *  sub_vec)

Definition at line 506 of file TSFEpetraVector.cpp.

References localOffset_, and localSubDim_.

virtual const double* TSFExtended::EpetraVector::dataPtr ( ) const [inline, virtual]
virtual double* TSFExtended::EpetraVector::dataPtr ( ) [inline, virtual]
const RCP<const Epetra_Map>& TSFExtended::EpetraVector::epetraMap ( ) const [inline, protected]

Definition at line 191 of file TSFEpetraVector.hpp.

const RCP<Epetra_Vector>& TSFExtended::EpetraVector::epetraVec ( ) const [inline]
RCP<Epetra_Vector>& TSFExtended::EpetraVector::epetraVec ( ) [inline]

Definition at line 176 of file TSFEpetraVector.hpp.

void EpetraVector::finalizeAssembly ( ) [virtual]

Do whatever finalization steps are needed by the implementation, for instance, synchronizing border elements.

The default implementation is a no-op.

Reimplemented from TSFExtended::LoadableVector< double >.

Definition at line 600 of file TSFEpetraVector.cpp.

References epetraVec().

Epetra_Vector & EpetraVector::getConcrete ( TSFExtended::Vector< double > &  tsfVec) [static]

Get a read-write Epetra_Vector.

Definition at line 623 of file TSFEpetraVector.cpp.

References epetraVec(), and Sundance::Handle< PointerType >::ptr().

const Epetra_Vector & EpetraVector::getConcrete ( const TSFExtended::Vector< double > &  tsfVec) [static]
Epetra_Vector * EpetraVector::getConcretePtr ( TSFExtended::Vector< double > &  tsfVec) [static]

Get a read-write Epetra_Vector pointer.

Definition at line 634 of file TSFEpetraVector.cpp.

References epetraVec(), and Sundance::Handle< PointerType >::ptr().

Referenced by TSFExtended::getEpetraDiagonal(), TSFExtended::AztecSolver::solve(), and TSFExtended::AmesosSolver::solve().

const double & EpetraVector::getElement ( OrdType  globalIndex) const [virtual]

get the element at the given global index

Reimplemented from TSFExtended::IndexableVector< double >.

Definition at line 563 of file TSFEpetraVector.cpp.

References epetraVec().

void EpetraVector::getElements ( const OrdType globalIndices,
int  numElems,
Teuchos::Array< double > &  elems 
) const

Definition at line 569 of file TSFEpetraVector.cpp.

References epetraVec().

double & EpetraVector::operator[] ( OrdType  globalIndex) [virtual]

writable access to the element at the given global index

Implements TSFExtended::IndexableVector< double >.

Definition at line 542 of file TSFEpetraVector.cpp.

References epetraVec().

virtual const double& TSFExtended::EpetraVector::operator[] ( OrdType  globalIndex) const [inline, virtual]

read the element at the given global index

Implements TSFExtended::IndexableVector< double >.

Definition at line 118 of file TSFEpetraVector.hpp.

void EpetraVector::print ( std::ostream &  os) const [virtual]

Print to a stream.

Implements Sundance::Printable.

Definition at line 607 of file TSFEpetraVector.cpp.

References epetraVec().

void EpetraVector::releaseDetachedVectorViewImpl ( RTOpPack::ConstSubVectorView< double > *  sub_vec) const

Definition at line 449 of file TSFEpetraVector.cpp.

References localOffset_, and localSubDim_.

void EpetraVector::setElement ( OrdType  globalIndex,
const double &  value 
) [virtual]

set a single element

Reimplemented from TSFExtended::IndexableVector< double >.

Definition at line 548 of file TSFEpetraVector.cpp.

References epetraVec().

void EpetraVector::setElements ( int  numElems,
const int *  globalIndices,
const double *  values 
)

set a group of elements

Definition at line 582 of file TSFEpetraVector.cpp.

References epetraVec().

RCP< const VectorSpaceBase<double> > TSFExtended::EpetraVector::space ( ) const [inline]

Definition at line 72 of file TSFEpetraVector.hpp.

Referenced by applyOpImpl().

Teuchos::Range1D EpetraVector::validateRange ( const Range1D &  rng) const [protected]

Member Data Documentation

RCP<const Epetra_Map> TSFExtended::EpetraVector::epetraMap_ [private]

Definition at line 204 of file TSFEpetraVector.hpp.

Referenced by EpetraVector().

RCP<Epetra_Vector> TSFExtended::EpetraVector::epetraVec_ [private]

Definition at line 202 of file TSFEpetraVector.hpp.

Referenced by applyOpImpl(), and EpetraVector().

Definition at line 210 of file TSFEpetraVector.hpp.

Referenced by applyOpImpl(), and validateRange().

Definition at line 212 of file TSFEpetraVector.hpp.

Referenced by applyOpImpl().

RCP<const Thyra::VectorSpaceBase<double> > TSFExtended::EpetraVector::vecSpace_ [private]

Definition at line 200 of file TSFEpetraVector.hpp.

Site Contact