FEI  Version of the Day
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
snl_fei_SubdMsgHandler.hpp
1 /*--------------------------------------------------------------------*/
2 /* Copyright 2005 Sandia Corporation. */
3 /* Under the terms of Contract DE-AC04-94AL85000, there is a */
4 /* non-exclusive license for use of this work by or on behalf */
5 /* of the U.S. Government. Export of this program may require */
6 /* a license from the United States Government. */
7 /*--------------------------------------------------------------------*/
8 
9 #ifndef _snl_fei_SubdMsgHandler_hpp_
10 #define _snl_fei_SubdMsgHandler_hpp_
11 
12 #include <fei_macros.hpp>
13 #include <fei_CommUtils.hpp>
14 #include <fei_fwd.hpp>
15 
16 #include <vector>
17 
18 namespace fei {
19  template<typename T> class SharedIDs;
20 }
21 
22 namespace snl_fei {
24  class SubdMsgHandler : public fei::MessageHandler<int> {
25  public:
27  SubdMsgHandler(RecordCollection* recordCollection,
28  fei::SharedIDs<int>* sharedIDTable,
29  fei::SharedIDs<int>* subdomainIDTable);
31  virtual ~SubdMsgHandler();
32 
34  std::vector<int>& getSendProcs();
35 
37  std::vector<int>& getRecvProcs();
38 
40  int getSendMessageLength(int destProc, int& messageLength);
41 
43  int getSendMessage(int destProc, std::vector<int>& message);
44 
46  int processRecvMessage(int srcProc, std::vector<int>& message);
47 
50  { sendPattern_ = pattern; }
51 
54  { recvPattern_ = pattern; }
55 
56  private:
57  fei::comm_map* sendPattern_;
58  fei::comm_map* recvPattern_;
59  RecordCollection* recordCollection_;
60  fei::SharedIDs<int>* sharedIDTable_;
61  fei::SharedIDs<int>* subdomainIDTable_;
62 
63  std::vector<int> sendProcs_;
64  std::vector<int> recvProcs_;
65  };//class SubdMsgHandler
66 }//namespace snl_fei
67 
68 #endif // _snl_fei_SubdMsgHandler_hpp_
69 
int getSendMessage(int destProc, std::vector< int > &message)
std::vector< int > & getSendProcs()
std::vector< int > & getRecvProcs()
void setRecvPattern(fei::comm_map *pattern)
SubdMsgHandler(RecordCollection *recordCollection, fei::SharedIDs< int > *sharedIDTable, fei::SharedIDs< int > *subdomainIDTable)
int processRecvMessage(int srcProc, std::vector< int > &message)
int getSendMessageLength(int destProc, int &messageLength)
void setSendPattern(fei::comm_map *pattern)