FEI Version of the Day
Public Member Functions
fei::Vector_Impl< T > Class Template Reference

#include <fei_Vector_Impl.hpp>

Inheritance diagram for fei::Vector_Impl< T >:
Inheritance graph
[legend]

List of all members.

Public Member Functions

 Vector_Impl (fei::SharedPtr< fei::VectorSpace > vecSpace, T *vector, int numLocalEqns, bool isSolutionVector=false, bool deleteVector=false)
virtual ~Vector_Impl ()
const char * typeName () const
int update (double a, const fei::Vector *x, double b)
int scatterToOverlap ()
int gatherFromOverlap (bool accumulate=true)
int putScalar (double scalar)
int sumIn (int numValues, const int *indices, const double *values, int vectorIndex=0)
int copyIn (int numValues, const int *indices, const double *values, int vectorIndex=0)
fei::SharedPtr< fei::VectorSpacegetVectorSpace () const
void setVectorSpace (fei::SharedPtr< fei::VectorSpace > vecSpace)
int sumInFieldData (int fieldID, int idType, int numIDs, const int *IDs, const double *data, int vectorIndex=0)
int copyInFieldData (int fieldID, int idType, int numIDs, const int *IDs, const double *data, int vectorIndex=0)
int copyOutFieldData (int fieldID, int idType, int numIDs, const int *IDs, double *data, int vectorIndex=0)
int writeToFile (const char *filename, bool matrixMarketFormat=true)
int writeToStream (FEI_OSTREAM &ostrm, bool matrixMarketFormat=true)
void setUnderlyingVector (T *vec)
T * getUnderlyingVector ()
int copyOut (int numValues, const int *indices, double *values, int vectorIndex=0) const
int copyOut_FE (int nodeNumber, int dofOffset, double &value)

Detailed Description

template<typename T>
class fei::Vector_Impl< T >

To be used for vector data assembly, including local assembly of shared data. Provides operations for gathering the overlapped data (locally- stored shared data) to a non-overlapped data distribution (e.g., send shared data to owning processor) and vice-versa for scattering non- overlapped data to the overlapped distribution.

When shared data that is not locally-owned is assembled into this object, it will be held locally until the gatherFromOverlap() operation is performed. When data that is locally-owned is assembled into this object, it will be passed directly to the underlying algebraic (non-overlapping) vector.

When non-locally-owned shared data is requested from this vector object, the operation is only guaranteed to succeed if scatterToOverlap() has been called. If non-local data has recently been input to this vector, but the vector has not been 'synchronized' using gatherFromOverlap() and scatterToOverlap(), then that data may be used to answer the request but the values may be erroneous due to not including contributions from other processors.

Definition at line 56 of file fei_Vector_Impl.hpp.


Constructor & Destructor Documentation

template<typename T >
fei::Vector_Impl< T >::Vector_Impl ( fei::SharedPtr< fei::VectorSpace vecSpace,
T *  vector,
int  numLocalEqns,
bool  isSolutionVector = false,
bool  deleteVector = false 
)

Constructor that takes a VectorSpace

Definition at line 220 of file fei_Vector_Impl.hpp.

template<typename T >
fei::Vector_Impl< T >::~Vector_Impl ( ) [virtual]

Destructor

Definition at line 251 of file fei_Vector_Impl.hpp.


Member Function Documentation

template<typename T>
const char* fei::Vector_Impl< T >::typeName ( ) const [inline, virtual]

Return a name describing the run-time type of this object.

Implements fei::Vector.

Definition at line 71 of file fei_Vector_Impl.hpp.

template<typename T >
int fei::Vector_Impl< T >::update ( double  a,
const fei::Vector x,
double  b 
) [virtual]

Update 'this' = b*'this' + a*x

Implements fei::Vector.

Definition at line 280 of file fei_Vector_Impl.hpp.

template<typename T >
int fei::Vector_Impl< T >::scatterToOverlap ( ) [virtual]

Use data in the underlying non-overlapping decomposition to update any shared data in the overlapping decomposition.

If any data is already held for the shared positions, that data will be replaced by the data from the 'owning' processor.

Implements fei::Vector.

Definition at line 296 of file fei_Vector_Impl.hpp.

template<typename T >
int fei::Vector_Impl< T >::gatherFromOverlap ( bool  accumulate = true) [virtual]

Move any shared data from the overlapping decomposition to the underlying non-overlapping decomposition.

Implements fei::Vector.

Definition at line 308 of file fei_Vector_Impl.hpp.

template<typename T >
int fei::Vector_Impl< T >::putScalar ( double  scalar) [virtual]

Set a specified scalar throughout the vector.

Implements fei::Vector.

Definition at line 258 of file fei_Vector_Impl.hpp.

template<typename T >
int fei::Vector_Impl< T >::sumIn ( int  numValues,
const int *  indices,
const double *  values,
int  vectorIndex = 0 
) [virtual]

Sum values into the vector, adding to any that may already exist at the specified indices.

Implements fei::Vector.

Definition at line 320 of file fei_Vector_Impl.hpp.

template<typename T >
int fei::Vector_Impl< T >::copyIn ( int  numValues,
const int *  indices,
const double *  values,
int  vectorIndex = 0 
) [virtual]

Copy values into the vector, overwriting any that may already exist at the specified indices.

Implements fei::Vector.

Definition at line 334 of file fei_Vector_Impl.hpp.

template<typename T>
fei::SharedPtr<fei::VectorSpace> fei::Vector_Impl< T >::getVectorSpace ( ) const [inline, virtual]

Obtain the VectorSpace associated with this vector.

Implements fei::Vector.

Definition at line 109 of file fei_Vector_Impl.hpp.

template<typename T>
void fei::Vector_Impl< T >::setVectorSpace ( fei::SharedPtr< fei::VectorSpace vecSpace) [inline, virtual]

Set the VectorSpace associated with this vector.

Implements fei::Vector.

Definition at line 114 of file fei_Vector_Impl.hpp.

template<typename T >
int fei::Vector_Impl< T >::sumInFieldData ( int  fieldID,
int  idType,
int  numIDs,
const int *  IDs,
const double *  data,
int  vectorIndex = 0 
) [virtual]

Sum field data into the vector, adding to any coefficients that may already exist at the specified locations. If the specified fieldID doesn't exist at one or more of the specified IDs, then the corresponding positions in the data array will simply not be used.

Implements fei::Vector.

Definition at line 391 of file fei_Vector_Impl.hpp.

template<typename T >
int fei::Vector_Impl< T >::copyInFieldData ( int  fieldID,
int  idType,
int  numIDs,
const int *  IDs,
const double *  data,
int  vectorIndex = 0 
) [virtual]

Copy field data into the vector, overwriting any coefficients that may already exist at the specified locations. If the specified fieldID doesn't exist at one or more of the specified IDs, then the corresponding positions in the data array will simply not be used.

Implements fei::Vector.

Definition at line 408 of file fei_Vector_Impl.hpp.

template<typename T >
int fei::Vector_Impl< T >::copyOutFieldData ( int  fieldID,
int  idType,
int  numIDs,
const int *  IDs,
double *  data,
int  vectorIndex = 0 
) [virtual]

Copy field data out of the vector, into the caller-allocated data array. If the specified fieldID doesn't exist at one or more of the specified IDs, then the corresponding positions in the data array will simply not be referenced.

Implements fei::Vector.

Definition at line 432 of file fei_Vector_Impl.hpp.

template<typename T >
int fei::Vector_Impl< T >::writeToFile ( const char *  filename,
bool  matrixMarketFormat = true 
) [virtual]

Write the vector's contents into the specified file.

Parameters:
filenameText name of the file to be created or overwritten. If in a parallel environment, each processor will take turns writing into the file.
matrixMarketFormatOptional argument, defaults to true. If true the contents of the file will be MatrixMarket real array format. If not true, the contents of the file will contain the vector's global dimension on the first line, and all following lines will contain a space-separated pair with global index first and coefficient value second.
Returns:
error-code 0 if successful, -1 if some error occurs such as failure to open file.

Implements fei::Vector.

Definition at line 445 of file fei_Vector_Impl.hpp.

template<typename T >
int fei::Vector_Impl< T >::writeToStream ( FEI_OSTREAM &  ostrm,
bool  matrixMarketFormat = true 
) [virtual]

Write the vector's contents to the specified ostream.

Parameters:
ostrmostream to be written to.
matrixMarketFormatOptional argument, defaults to true. If true the contents of the vector will be written in MatrixMarket real array format. If not true, the stream will be given the vector's global dimension on the first line, and all following lines will contain a space-separated pair with global index first and coefficient value second.
Returns:
error-code 0 if successful, -1 if some error occurs such as failure to open file.

Implements fei::Vector.

Definition at line 453 of file fei_Vector_Impl.hpp.

template<typename T>
void fei::Vector_Impl< T >::setUnderlyingVector ( T *  vec) [inline]

Set the library-specific underlying vector object that this snl_fei::Vector is filtering data in and out of.

Definition at line 167 of file fei_Vector_Impl.hpp.

template<typename T>
T* fei::Vector_Impl< T >::getUnderlyingVector ( ) [inline]

Get the library-specific underlying vector object that this snl_fei::Vector is filtering data in and out of.

Definition at line 175 of file fei_Vector_Impl.hpp.

template<typename T >
int fei::Vector_Impl< T >::copyOut ( int  numValues,
const int *  indices,
double *  values,
int  vectorIndex = 0 
) const [virtual]

Retrieve a copy of values from the vector for the specified indices. Note that if the specified indices are not local in the underlying non-overlapping data decomposition, these values are not guaranteed to be correct until after the scatterToOverlap() method has been called.

Implements fei::Vector.

Definition at line 461 of file fei_Vector_Impl.hpp.

template<typename T >
int fei::Vector_Impl< T >::copyOut_FE ( int  nodeNumber,
int  dofOffset,
double &  value 
) [virtual]

please ignore

Implements fei::Vector_core.

Definition at line 425 of file fei_Vector_Impl.hpp.


The documentation for this class was generated from the following file:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Friends