FEI Package Browser (Single Doxygen Collection)  Version of the Day
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Public Member Functions | Protected Member Functions | Protected Attributes | Private Member Functions | Private Attributes | List of all members
fei::Vector_core Class Referenceabstract

#include <fei_Vector_core.hpp>

Inheritance diagram for fei::Vector_core:
Inheritance graph
[legend]

Public Member Functions

 Vector_core (fei::SharedPtr< fei::VectorSpace > vecSpace, int numLocalEqns)
 
virtual ~Vector_core ()
 
int copyOut (int numValues, const int *indices, double *values, int vectorIndex=0) const
 
virtual int sumIntoFEVector (int blockID, int connOffset, int numNodes, const int *nodeNumbers, const int *numIndicesPerNode, const int *dof_ids, const double *values)=0
 
virtual int copyOut_FE (int nodeNumber, int dofOffset, double &value)=0
 
int giveToVector (int numValues, const int *indices, const double *values, bool sumInto=true, int vectorIndex=0)
 
virtual int scatterToOverlap ()
 
void setOverlap (int numRemoteEqns=0, const int *remoteEqns=NULL)
 

Protected Member Functions

int assembleFieldData (int fieldID, int idType, int numIDs, const int *IDs, const double *data, bool sumInto=true, int vectorIndex=0)
 
int assembleFieldDataLocalIDs (int fieldID, int idType, int numIDs, const int *localIDs, const double *data, bool sumInto=true, int vectorIndex=0)
 
void setCommSizes ()
 
virtual int gatherFromOverlap (bool accumulate=true)
 
virtual int copyOutFieldData (int fieldID, int idType, int numIDs, const int *IDs, double *data, int vectorIndex=0)
 
virtual int giveToUnderlyingVector (int numValues, const int *indices, const double *values, bool sumInto=true, int vectorIndex=0)=0
 
virtual int copyOutOfUnderlyingVector (int numValues, const int *indices, double *values, int vectorIndex=0) const =0
 
virtual int writeToFile (const char *filename, bool matrixMarketFormat=true)
 
virtual int writeToStream (FEI_OSTREAM &ostrm, bool matrixMarketFormat=true)
 
fei::SharedPtr< fei::VectorSpaceget_vector_space () const
 
void set_vector_space (fei::SharedPtr< fei::VectorSpace > vspace)
 
int firstLocalOffset () const
 
int lastLocalOffset () const
 
std::vector< int > & work_indices ()
 
std::vector< int > & work_indices2 ()
 
bool haveFEVector ()
 
void setFEVector (bool flag)
 
std::vector< CSVec * > & remotelyOwned ()
 
const std::vector< CSVec * > & remotelyOwned () const
 
std::vector< int > & remotelyOwnedProcs ()
 
const std::vector< int > & remotelyOwnedProcs () const
 
fei::CSVecgetRemotelyOwned (int proc)
 
const fei::CSVecgetRemotelyOwned (int proc) const
 
- Protected Member Functions inherited from fei::Logger
 Logger ()
 
virtual ~Logger ()
 
void setOutputLevel (OutputLevel olevel)
 
void addLogID (int ID)
 
void addLogEqn (int eqn)
 
bool isLogID (int ID)
 
bool isLogEqn (int eqn)
 
std::set< int > & getLogIDs ()
 
std::set< int > & getLogEqns ()
 

Protected Attributes

fei::SharedPtr< fei::EqnCommeqnComm_
 
- Protected Attributes inherited from fei::Logger
OutputLevel output_level_
 
FEI_OSTREAMoutput_stream_
 
std::set< int > logIDs_
 
std::set< int > logEqns_
 

Private Member Functions

void pack_send_buffers (const std::vector< int > &sendProcs, const std::vector< fei::CSVec * > &remotelyOwned, std::vector< std::vector< char > > &send_chars, bool resize_buffer, bool zeroRemotelyOwnedAfterPacking)
 

Private Attributes

fei::SharedPtr< fei::VectorSpacevecSpace_
 
MPI_Comm comm_
 
int firstLocalOffset_
 
int lastLocalOffset_
 
int numLocal_
 
std::vector< int > work_indices_
 
std::vector< int > work_indices2_
 
bool haveFEVector_
 
std::vector< int > remotelyOwnedProcs_
 
std::vector< CSVec * > remotelyOwned_
 
std::vector< int > sendProcs_
 
std::vector< int > recvProcs_
 
std::vector< int > recv_sizes_
 
std::vector< std::vector< char > > recv_chars_
 
std::vector< std::vector< char > > send_chars_
 
bool sendRecvProcsNeedUpdated_
 
bool overlapAlreadySet_
 
std::string dbgprefix_
 

Detailed Description

Class to provide infrastructure for fei::Vector implementations.

Definition at line 23 of file fei_Vector_core.hpp.

Constructor & Destructor Documentation

fei::Vector_core::Vector_core ( fei::SharedPtr< fei::VectorSpace vecSpace,
int  numLocalEqns 
)
fei::Vector_core::~Vector_core ( )
virtual

destructor

Definition at line 61 of file fei_Vector_core.cpp.

Member Function Documentation

int fei::Vector_core::copyOut ( int  numValues,
const int *  indices,
double *  values,
int  vectorIndex = 0 
) const

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.

Definition at line 217 of file fei_Vector_core.cpp.

References fei::binarySearch(), CHK_ERR, fei::CSVec::coefs(), fei::console_out(), ERReturn, FEI_ENDL, fei::CSVec::indices(), and fei::localProc().

Referenced by fei::Vector_Impl< T >::copyOut().

virtual int fei::Vector_core::sumIntoFEVector ( int  blockID,
int  connOffset,
int  numNodes,
const int *  nodeNumbers,
const int *  numIndicesPerNode,
const int *  dof_ids,
const double *  values 
)
pure virtual

Sum in data for FiniteElementData-specific structure. Power users only.

Implemented in fei::Vector_Impl< T >.

virtual int fei::Vector_core::copyOut_FE ( int  nodeNumber,
int  dofOffset,
double &  value 
)
pure virtual

Another FiniteElementData-specific method. Power users only.

Implemented in fei::Vector_Impl< T >.

int fei::Vector_core::giveToVector ( int  numValues,
const int *  indices,
const double *  values,
bool  sumInto = true,
int  vectorIndex = 0 
)

Give specified data to underlying vector object.

Definition at line 254 of file fei_Vector_core.cpp.

References fei::add_entry(), fei::BRIEF_LOGS, fei::console_out(), ERReturn, FEI_ENDL, FEI_OSTREAM, and fei::put_entry().

int fei::Vector_core::scatterToOverlap ( )
virtual

Scatter locally-owned vector data to remote sharing procs.

Reimplemented in fei::Vector_Impl< T >.

Definition at line 107 of file fei_Vector_core.cpp.

References fei::CSVec::coefs(), FEI_COUT, FEI_ENDL, fei::CSVec::indices(), fei::localProc(), fei::mirrorProcs(), fei::numProcs(), and fei::CSVec::size().

Referenced by fei::Vector_Impl< T >::scatterToOverlap().

void fei::Vector_core::setOverlap ( int  numRemoteEqns = 0,
const int *  remoteEqns = NULL 
)

define the extent of the overlapping indices. If the optional arguments are not specified, remote eqns will be obtained from the internal fei::VectorSpace attribute.

Definition at line 68 of file fei_Vector_core.cpp.

References fei::add_entry(), fei::BRIEF_LOGS, FEI_ENDL, FEI_OSTREAM, and fei::localProc().

int fei::Vector_core::assembleFieldData ( int  fieldID,
int  idType,
int  numIDs,
const int *  IDs,
const double *  data,
bool  sumInto = true,
int  vectorIndex = 0 
)
protected

Assemble data specified by fieldID, idType, etc.

Definition at line 308 of file fei_Vector_core.cpp.

References CHK_ERR, and ERReturn.

int fei::Vector_core::assembleFieldDataLocalIDs ( int  fieldID,
int  idType,
int  numIDs,
const int *  localIDs,
const double *  data,
bool  sumInto = true,
int  vectorIndex = 0 
)
protected

Definition at line 331 of file fei_Vector_core.cpp.

References CHK_ERR, and ERReturn.

void fei::Vector_core::setCommSizes ( )
protected

Definition at line 372 of file fei_Vector_core.cpp.

References fei::localProc(), and fei::mirrorProcs().

Referenced by fei::Vector_Impl< T >::setCommSizes().

int fei::Vector_core::gatherFromOverlap ( bool  accumulate = true)
protectedvirtual

Gather shared data from remote procs for eqns that are locally-owned.

Reimplemented in fei::Vector_Impl< T >.

Definition at line 445 of file fei_Vector_core.cpp.

References fei::numProcs(), and fei::impl_utils::unpack_indices_coefs().

Referenced by fei::Vector_Impl< T >::gatherFromOverlap().

int fei::Vector_core::copyOutFieldData ( int  fieldID,
int  idType,
int  numIDs,
const int *  IDs,
double *  data,
int  vectorIndex = 0 
)
protectedvirtual
virtual int fei::Vector_core::giveToUnderlyingVector ( int  numValues,
const int *  indices,
const double *  values,
bool  sumInto = true,
int  vectorIndex = 0 
)
protectedpure virtual

Review this function. Is it redundant with other functions?

Implemented in fei::Vector_Impl< T >.

virtual int fei::Vector_core::copyOutOfUnderlyingVector ( int  numValues,
const int *  indices,
double *  values,
int  vectorIndex = 0 
) const
protectedpure virtual

Review this function. Is it redundant with other functions?

Implemented in fei::Vector_Impl< T >.

int fei::Vector_core::writeToFile ( const char *  filename,
bool  matrixMarketFormat = true 
)
protectedvirtual

Establish basic information like sizes etc. Write data to specified filename.

Reimplemented in fei::Vector_Impl< T >.

Definition at line 560 of file fei_Vector_core.cpp.

References fei::Barrier(), CHK_ERR, FEI_ENDL, FEI_OFSTREAM, IOS_APP, IOS_FLOATFIELD, IOS_OUT, IOS_SCIENTIFIC, fei::localProc(), and fei::numProcs().

Referenced by fei::Vector_Impl< T >::writeToFile().

int fei::Vector_core::writeToStream ( FEI_OSTREAM ostrm,
bool  matrixMarketFormat = true 
)
protectedvirtual

Write data to specified ostream.

Reimplemented in fei::Vector_Impl< T >.

Definition at line 607 of file fei_Vector_core.cpp.

References fei::Barrier(), CHK_ERR, FEI_ENDL, IOS_FLOATFIELD, IOS_FMTFLAGS, IOS_SCIENTIFIC, fei::localProc(), and fei::numProcs().

Referenced by fei::Vector_Impl< T >::writeToStream().

fei::SharedPtr<fei::VectorSpace> fei::Vector_core::get_vector_space ( ) const
inlineprotected

Return vector-space that describes that size/layout of this vector.

Definition at line 121 of file fei_Vector_core.hpp.

References vecSpace_.

Referenced by fei::Vector_Impl< T >::getVectorSpace().

void fei::Vector_core::set_vector_space ( fei::SharedPtr< fei::VectorSpace vspace)
inlineprotected

Set vector-space that describes the size/layout of this vector.

Definition at line 127 of file fei_Vector_core.hpp.

References vecSpace_.

Referenced by fei::Vector_Impl< T >::setVectorSpace().

int fei::Vector_core::firstLocalOffset ( ) const
inlineprotected

Query for first locally-owned vector position.

Definition at line 133 of file fei_Vector_core.hpp.

References firstLocalOffset_.

int fei::Vector_core::lastLocalOffset ( ) const
inlineprotected

Query for last locally-owned vector position.

Definition at line 136 of file fei_Vector_core.hpp.

References lastLocalOffset_.

std::vector<int>& fei::Vector_core::work_indices ( )
inlineprotected

work_indices

Definition at line 139 of file fei_Vector_core.hpp.

References work_indices_.

std::vector<int>& fei::Vector_core::work_indices2 ( )
inlineprotected

work_indices2

Definition at line 141 of file fei_Vector_core.hpp.

References work_indices2_.

bool fei::Vector_core::haveFEVector ( )
inlineprotected

haveFEVector

Definition at line 144 of file fei_Vector_core.hpp.

References haveFEVector_.

void fei::Vector_core::setFEVector ( bool  flag)
inlineprotected

setFEVector

Definition at line 146 of file fei_Vector_core.hpp.

References haveFEVector_.

Referenced by fei::Vector_Impl< T >::Vector_Impl().

std::vector<CSVec*>& fei::Vector_core::remotelyOwned ( )
inlineprotected

remotelyOwned

Definition at line 149 of file fei_Vector_core.hpp.

References remotelyOwned_.

Referenced by fei::Vector_Impl< T >::Vector_Impl().

const std::vector<CSVec*>& fei::Vector_core::remotelyOwned ( ) const
inlineprotected

Definition at line 150 of file fei_Vector_core.hpp.

References remotelyOwned_.

std::vector<int>& fei::Vector_core::remotelyOwnedProcs ( )
inlineprotected

Definition at line 151 of file fei_Vector_core.hpp.

References remotelyOwnedProcs_.

const std::vector<int>& fei::Vector_core::remotelyOwnedProcs ( ) const
inlineprotected

Definition at line 152 of file fei_Vector_core.hpp.

References remotelyOwnedProcs_.

fei::CSVec* fei::Vector_core::getRemotelyOwned ( int  proc)
inlineprotected

Definition at line 154 of file fei_Vector_core.hpp.

References remotelyOwned_, and remotelyOwnedProcs_.

const fei::CSVec* fei::Vector_core::getRemotelyOwned ( int  proc) const
inlineprotected

Definition at line 170 of file fei_Vector_core.hpp.

References remotelyOwned_, and remotelyOwnedProcs_.

void fei::Vector_core::pack_send_buffers ( const std::vector< int > &  sendProcs,
const std::vector< fei::CSVec * > &  remotelyOwned,
std::vector< std::vector< char > > &  send_chars,
bool  resize_buffer,
bool  zeroRemotelyOwnedAfterPacking 
)
private

Member Data Documentation

fei::SharedPtr<fei::EqnComm> fei::Vector_core::eqnComm_
protected

Definition at line 181 of file fei_Vector_core.hpp.

Referenced by Vector_core().

fei::SharedPtr<fei::VectorSpace> fei::Vector_core::vecSpace_
private

Definition at line 190 of file fei_Vector_core.hpp.

Referenced by get_vector_space(), and set_vector_space().

MPI_Comm fei::Vector_core::comm_
private

Definition at line 192 of file fei_Vector_core.hpp.

Referenced by Vector_core().

int fei::Vector_core::firstLocalOffset_
private

Definition at line 194 of file fei_Vector_core.hpp.

Referenced by firstLocalOffset(), and Vector_core().

int fei::Vector_core::lastLocalOffset_
private

Definition at line 194 of file fei_Vector_core.hpp.

Referenced by lastLocalOffset(), and Vector_core().

int fei::Vector_core::numLocal_
private

Definition at line 194 of file fei_Vector_core.hpp.

Referenced by Vector_core().

std::vector<int> fei::Vector_core::work_indices_
private

Definition at line 196 of file fei_Vector_core.hpp.

Referenced by work_indices().

std::vector<int> fei::Vector_core::work_indices2_
private

Definition at line 197 of file fei_Vector_core.hpp.

Referenced by work_indices2().

bool fei::Vector_core::haveFEVector_
private

Definition at line 199 of file fei_Vector_core.hpp.

Referenced by haveFEVector(), and setFEVector().

std::vector<int> fei::Vector_core::remotelyOwnedProcs_
private

Definition at line 201 of file fei_Vector_core.hpp.

Referenced by getRemotelyOwned(), and remotelyOwnedProcs().

std::vector<CSVec*> fei::Vector_core::remotelyOwned_
private

Definition at line 202 of file fei_Vector_core.hpp.

Referenced by getRemotelyOwned(), and remotelyOwned().

std::vector<int> fei::Vector_core::sendProcs_
private

Definition at line 203 of file fei_Vector_core.hpp.

std::vector<int> fei::Vector_core::recvProcs_
private

Definition at line 204 of file fei_Vector_core.hpp.

std::vector<int> fei::Vector_core::recv_sizes_
private

Definition at line 205 of file fei_Vector_core.hpp.

std::vector<std::vector<char> > fei::Vector_core::recv_chars_
private

Definition at line 206 of file fei_Vector_core.hpp.

std::vector<std::vector<char> > fei::Vector_core::send_chars_
private

Definition at line 207 of file fei_Vector_core.hpp.

bool fei::Vector_core::sendRecvProcsNeedUpdated_
private

Definition at line 208 of file fei_Vector_core.hpp.

bool fei::Vector_core::overlapAlreadySet_
private

Definition at line 210 of file fei_Vector_core.hpp.

std::string fei::Vector_core::dbgprefix_
private

Definition at line 211 of file fei_Vector_core.hpp.

Referenced by Vector_core().


The documentation for this class was generated from the following files: