16 #define fei_file "fei_VectorReducer.cpp"
25 bool isSolutionVector)
28 isSolution_(isSolutionVector)
34 if (target_core == NULL) {
35 throw std::runtime_error(
"fei::VectorReducer ERROR, target vector not dynamic_cast-able to fei::Vector_core.");
40 std::vector<int> eqns;
43 std::vector<int> overlap;
44 for(
int i=0; i<numEqns; ++i) {
49 std::vector<int> masters;
51 for(
unsigned j=0; j<masters.size(); ++j) {
57 int* overlap_ptr = overlap.empty() ? NULL : &overlap[0];
58 target_core->setOverlap(overlap.size(), overlap_ptr);
94 const int* indices,
const double* values,
103 const int* indices,
const double* values,
113 const double* values,
132 int numIndices = numIDs*fieldSize;
133 std::vector<int> indices(numIndices);
134 int err = vspace->
getGlobalIndices(numIDs, IDs, idType, fieldID, &indices[0]);
136 throw std::runtime_error(
"fei::VectorReducer::sumInFieldData ERROR in vspace->getGlobalIndices.");
139 return(
sumIn(numIndices, &indices[0], data, vectorIndex));
152 int numIndices = numIDs*fieldSize;
153 std::vector<int> indices(numIndices);
154 int err = vspace->
getGlobalIndices(numIDs, IDs, idType, fieldID, &indices[0]);
156 throw std::runtime_error(
"fei::VectorReducer::copyInFieldData ERROR in vspace->getGlobalIndices.");
159 return(
copyIn(numIndices, &indices[0], data, vectorIndex));
172 int numIndices = numIDs*fieldSize;
173 std::vector<int> indices(numIndices);
176 throw std::runtime_error(
"fei::VectorReducer::copyInFieldData ERROR in vspace->getGlobalIndices.");
179 return(
copyIn(numIndices, &indices[0], data, vectorIndex));
199 int numIndices = numIDs*fieldSize;
200 std::vector<int> indices(numIndices);
201 int err = vspace->
getGlobalIndices(numIDs, IDs, idType, fieldID, &indices[0]);
203 throw std::runtime_error(
"fei::VectorReducer::copyOutFieldData ERROR in vspace->getGlobalIndices.");
206 return(
copyOut(numIndices, &indices[0], data, vectorIndex));
211 bool matrixMarketFormat)
218 bool matrixMarketFormat)
227 int vectorIndex)
const
239 const int* nodeNumbers,
240 const int* numIndicesPerNode,
241 const double* values)
MPI_Comm getCommunicator() const
int getGlobalIndicesLocalIDs(int numIDs, const int *localIDs, int idType, int fieldID, int *globalIndices)
int copyOut(int numValues, const int *indices, double *values, int vectorIndex=0) const
virtual int writeToFile(const char *filename, bool matrixMarketFormat=true)=0
int getIndices_SharedAndOwned(std::vector< int > &globalIndices) const
virtual fei::SharedPtr< fei::VectorSpace > getVectorSpace() const =0
int copyInFieldData(int fieldID, int idType, int numIDs, const int *IDs, const double *data, int vectorIndex=0)
int update(double a, const fei::Vector *x, double b)
fei::SharedPtr< fei::Reducer > reducer_
void assembleReducedVector(bool soln_vector, fei::Vector &feivec)
virtual int gatherFromOverlap(bool accumulate=true)=0
int copyOutFieldData(int fieldID, int idType, int numIDs, const int *IDs, double *data, int vectorIndex=0)
VectorReducer(fei::SharedPtr< fei::Reducer > reducer, fei::SharedPtr< fei::Vector > target, bool isSolutionVector=false)
int translateToReducedEqn(int unreducedEqn) const
int sumIn(int numValues, const int *indices, const double *values, int vectorIndex=0)
void getSlaveMasterEqns(int slaveEqn, std::vector< int > &masterEqns)
int writeToFile(const char *filename, bool matrixMarketFormat=true)
virtual int scatterToOverlap()=0
virtual int putScalar(double scalar)=0
int copyOutVectorValues(int numValues, const int *globalIndices, double *values, bool soln_vector, int vectorIndex, fei::Vector &feivec)
virtual int update(double a, const fei::Vector *x, double b)=0
int putScalar(double scalar)
int getGlobalIndices(int numIDs, const int *IDs, int idType, int fieldID, int *globalIndices)
fei::SharedPtr< fei::Vector > target_
int copyInFieldDataLocalIDs(int fieldID, int idType, int numIDs, const int *localIDs, const double *data, int vectorIndex=0)
int gatherFromOverlap(bool accumulate=true)
int writeToStream(FEI_OSTREAM &ostrm, bool matrixMarketFormat=true)
int copyIn(int numValues, const int *indices, const double *values, int vectorIndex=0)
int addVectorValues(int numValues, const int *globalIndices, const double *values, bool sum_into, bool soln_vector, int vectorIndex, fei::Vector &feivec)
int localProc(MPI_Comm comm)
int giveToUnderlyingVector(int numValues, const int *indices, const double *values, bool sumInto=true, int vectorIndex=0)
int getNumIndices_SharedAndOwned() const
unsigned getFieldSize(int fieldID)
bool isSlaveEqn(int unreducedEqn) const
virtual void setCommSizes()=0
int sumIntoFEVector(int blockID, int connOffset, int numNodes, const int *nodeNumbers, const int *numIndicesPerNode, const double *values)
virtual int writeToStream(FEI_OSTREAM &ostrm, bool matrixMarketFormat=true)=0
int sumInFieldData(int fieldID, int idType, int numIDs, const int *IDs, const double *data, int vectorIndex=0)
int numProcs(MPI_Comm comm)
int copyOut_FE(int nodeNumber, int dofOffset, double &value)