1 #ifndef _fei_EqnCommMgr_hpp_
2 #define _fei_EqnCommMgr_hpp_
12 #include "fei_fwd.hpp"
15 #include "snl_fei_PointBlockMap.hpp"
17 #include <fei_CSRMat.hpp>
18 #include <fei_CSVec.hpp>
19 #include <fei_CommUtils.hpp>
20 #include "fei_ProcEqns.hpp"
21 #include "fei_EqnBuffer.hpp"
109 EqnCommMgr(MPI_Comm comm,
bool accumulate =
true);
127 std::vector<int>& sharingProcsPtr() {
return(recvProcEqns_->
procsPtr());};
133 std::vector<int>& ownerProcsPtr() {
return(sendProcEqns_->
procsPtr());};
138 void addSolnValues(
int* eqnNumbers,
double* values,
int num);
140 #ifdef FEI_HAVE_IOSFWD
141 int exchangeIndices(std::ostream* dbgOut=NULL);
142 int exchangeEqns(std::ostream* dbgOut=NULL);
144 int exchangeIndices(ostream* dbgOut=NULL);
145 int exchangeEqns(ostream* dbgOut=NULL);
191 static int exchangeEqnBuffers(MPI_Comm comm,
ProcEqns* sendProcEqns,
195 int getNumLocalEqns() {
return(recvEqns_->
getNumEqns());};
197 std::vector<int>& localEqnNumbers() {
return(recvEqns_->
eqnNumbers());};
198 std::vector<fei::CSVec*>& localEqns(){
return(recvEqns_->
eqns());};
199 std::vector<std::vector<double>*>* localRHSsPtr()
202 int addRemoteEqn(
int eqnNumber,
int destProc,
const double* coefs,
203 const int* indices,
int num);
205 int addRemoteEqn(
int eqnNumber,
const double* coefs,
206 const int* indices,
int num);
208 int addRemoteEqns(
fei::CSRMat& mat,
bool onlyIndices);
209 int addRemoteRHS(
fei::CSVec& vec,
int rhsIndex);
211 void setNumRHSs(
int numRHSs);
213 int addRemoteRHS(
int eqnNumber,
int destProc,
int rhsIndex,
double value);
215 int addRemoteRHS(
int eqnNumber,
int rhsIndex,
double value);
217 void addRemoteIndices(
int eqnNumber,
int destProc,
int* indices,
int num);
219 int getNumRemoteEqns() {
return(sendEqns_->
getNumEqns());};
221 std::vector<int>& sendEqnNumbersPtr() {
return(sendEqns_->
eqnNumbers());};
223 double* sendEqnSolnPtr() {
return(sendEqnSoln_.size()>0? &sendEqnSoln_[0] : NULL);};
229 int exchangeRemEssBCs(
int* essEqns,
int numEssEqns,
double* essAlpha,
230 double* essGamma, MPI_Comm comm,
231 std::ostream* dbgOut = NULL);
233 int getNumRemEssBCEqns() {
return(essBCEqns_->
getNumEqns());};
234 std::vector<int>& remEssBCEqnNumbersPtr() {
return(essBCEqns_->
eqnNumbers());};
235 std::vector<fei::CSVec*>& remEssBCEqns() {
return(essBCEqns_->
eqns());};
239 bool newCoefData() {
if (recvEqns_->newCoefData_>0)
return(
true);
241 bool newRHSData() {
if (recvEqns_->newRHSData_>0)
return(
true);
246 EqnBuffer* getRecvEqns() {
return( recvEqns_ ); }
247 EqnBuffer* getSendEqns() {
return( sendEqns_ ); }
248 ProcEqns* getRecvProcEqns() {
return( recvProcEqns_ ); }
249 ProcEqns* getSendProcEqns() {
return( sendProcEqns_ ); }
253 int getSendProcNumber(
int eqn);
255 int consistencyCheck(
const char* caller,
256 std::vector<int>& recvProcs,
257 std::vector<int>& recvProcTotalLengths,
258 std::vector<int>& sendProcs,
259 std::vector<int>& sendProcTotalLengths);
265 bool exchangeIndicesCalled_;
270 std::vector<double> solnValues_;
277 std::vector<double> sendEqnSoln_;
std::vector< fei::CSVec * > & eqns()
EqnCommMgr(MPI_Comm comm, bool accumulate=true)
int mirrorProcEqns(ProcEqns &inProcEqns, ProcEqns &outProcEqns)
std::vector< int > & eqnNumbers()
EqnCommMgr & operator=(const EqnCommMgr &src)
size_t getNumSharingProcs()
std::vector< std::vector< double > * > * rhsCoefsPtr()
void addLocalEqn(int eqnNumber, int srcProc)
std::vector< int > & procsPtr()
size_t getNumOwnerProcs()
int mirrorProcEqnLengths(ProcEqns &inProcEqns, ProcEqns &outProcEqns)