9 #ifndef _fei_Vector_core_hpp_ 
   10 #define _fei_Vector_core_hpp_ 
   12 #include <fei_iosfwd.hpp> 
   13 #include <fei_CSVec.hpp> 
   14 #include <fei_VectorSpace.hpp> 
   15 #include <fei_Reducer.hpp> 
   16 #include <fei_Logger.hpp> 
   17 #include <fei_SharedPtr.hpp> 
   18 #include <fei_EqnComm.hpp> 
   39         int vectorIndex=0) 
const;
 
   45             const int* nodeNumbers,
 
   46             const int* numIndicesPerNode,
 
   48             const double* values) = 0;
 
   51   virtual int copyOut_FE(
int nodeNumber, 
int dofOffset, 
double& value) = 0;
 
   66   void setOverlap(
int numRemoteEqns=0, 
const int* remoteEqns=NULL);
 
   78   int assembleFieldDataLocalIDs(
int fieldID,
 
  101              const double* values,
 
  103              int vectorIndex=0) = 0;
 
  109           int vectorIndex=0) 
const = 0;
 
  114         bool matrixMarketFormat=
true);
 
  118           bool matrixMarketFormat=
true);
 
  139   std::vector<int>& 
work_indices() { 
return( work_indices_ ); }
 
  141   std::vector<int>& 
work_indices2(){ 
return( work_indices2_); }
 
  146   void setFEVector(
bool flag) {haveFEVector_ = flag; }
 
  149   std::vector<CSVec*>& 
remotelyOwned() { 
return( remotelyOwned_ ); }
 
  150   const std::vector<CSVec*>& 
remotelyOwned()
 const { 
return( remotelyOwned_ ); }
 
  151   std::vector<int>& remotelyOwnedProcs() { 
return( remotelyOwnedProcs_ ); }
 
  152   const std::vector<int>& remotelyOwnedProcs()
 const { 
return( remotelyOwnedProcs_ ); }
 
  155     std::vector<int>::iterator iter = std::lower_bound(remotelyOwnedProcs_.begin(), remotelyOwnedProcs_.end(), proc);
 
  157     size_t offset = iter - remotelyOwnedProcs_.begin();
 
  158     if (iter == remotelyOwnedProcs_.end() || *iter != proc) {
 
  159       remotelyOwnedProcs_.insert(iter, proc);
 
  161       remotelyOwned_.insert(remotelyOwned_.begin()+offset, return_vec);
 
  164       return_vec = remotelyOwned_[offset];
 
  170   const fei::CSVec* getRemotelyOwned(
int proc)
 const {
 
  171     std::vector<int>::const_iterator iter = std::lower_bound(remotelyOwnedProcs_.begin(), remotelyOwnedProcs_.end(), proc);
 
  172     if (iter == remotelyOwnedProcs_.end() || *iter != proc) {
 
  173       throw std::runtime_error(
"failed to find remote-vec for specified processor.");
 
  176     size_t offset = iter - remotelyOwnedProcs_.begin();
 
  177     return remotelyOwned_[offset];
 
  184   void pack_send_buffers(
const std::vector<int>& sendProcs,
 
  186                        std::vector<std::vector<char> >& send_chars,
 
  188                        bool zeroRemotelyOwnedAfterPacking);
 
  194   int firstLocalOffset_, lastLocalOffset_, numLocal_;
 
  196   std::vector<int> work_indices_;
 
  197   std::vector<int> work_indices2_;
 
  201   std::vector<int> remotelyOwnedProcs_;
 
  202   std::vector<CSVec*> remotelyOwned_;
 
  203   std::vector<int> sendProcs_;
 
  204   std::vector<int> recvProcs_;
 
  205   std::vector<int> recv_sizes_;
 
  206   std::vector<std::vector<char> > recv_chars_;
 
  207   std::vector<std::vector<char> > send_chars_;
 
  208   bool sendRecvProcsNeedUpdated_;
 
  210   bool overlapAlreadySet_;
 
  211   std::string dbgprefix_;
 
std::vector< int > & work_indices()
 
void setOverlap(int numRemoteEqns=0, const int *remoteEqns=NULL)
 
virtual int giveToUnderlyingVector(int numValues, const int *indices, const double *values, bool sumInto=true, int vectorIndex=0)=0
 
int giveToVector(int numValues, const int *indices, const double *values, bool sumInto=true, int vectorIndex=0)
 
std::vector< int > & work_indices2()
 
virtual int copyOut_FE(int nodeNumber, int dofOffset, double &value)=0
 
virtual int writeToStream(FEI_OSTREAM &ostrm, bool matrixMarketFormat=true)
 
int copyOut(int numValues, const int *indices, double *values, int vectorIndex=0) const 
 
void set_vector_space(fei::SharedPtr< fei::VectorSpace > vspace)
 
std::vector< CSVec * > & remotelyOwned()
 
void setFEVector(bool flag)
 
virtual int copyOutFieldData(int fieldID, int idType, int numIDs, const int *IDs, double *data, int vectorIndex=0)
 
virtual int sumIntoFEVector(int blockID, int connOffset, int numNodes, const int *nodeNumbers, const int *numIndicesPerNode, const int *dof_ids, const double *values)=0
 
int lastLocalOffset() const 
 
fei::SharedPtr< fei::VectorSpace > get_vector_space() const 
 
Vector_core(fei::SharedPtr< fei::VectorSpace > vecSpace, int numLocalEqns)
 
virtual int writeToFile(const char *filename, bool matrixMarketFormat=true)
 
virtual int scatterToOverlap()
 
virtual int copyOutOfUnderlyingVector(int numValues, const int *indices, double *values, int vectorIndex=0) const =0
 
int firstLocalOffset() const 
 
virtual int gatherFromOverlap(bool accumulate=true)
 
int assembleFieldData(int fieldID, int idType, int numIDs, const int *IDs, const double *data, bool sumInto=true, int vectorIndex=0)