FEI Package Browser (Single Doxygen Collection)  Version of the Day
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
snl_fei_RecordMsgHandler.hpp
Go to the documentation of this file.
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_RecordMsgHandler_hpp_
10 #define _snl_fei_RecordMsgHandler_hpp_
11 
12 #include <fei_macros.hpp>
13 #include <fei_CommUtils.hpp>
14 #include <fei_fwd.hpp>
15 
16 namespace fei {
17  class FieldMask;
18 }
19 
20 namespace snl_fei {
22  class RecordMsgHandler : public fei::MessageHandler<int> {
23  public:
26  RecordCollection* recordCollection,
27  snl_fei::PointBlockMap& ptBlkMap,
28  std::vector<fei::FieldMask*>& fieldMasks,
29  std::vector<int>& eqnNumbers);
30 
32  virtual ~RecordMsgHandler();
33 
35  enum {_FieldMasks_ = 0, _MaskIDs_ = 1,
37 
39  std::vector<int>& getSendProcs();
40 
42  std::vector<int>& getRecvProcs();
43 
45  int getSendMessageLength(int destProc, int& messageLength);
46 
48  int getSendMessage(int destProc, std::vector<int>& message);
49 
51  int processRecvMessage(int srcProc, std::vector<int>& message);
52 
54  void setTask(int task) { whichTask_ = task; }
55 
58  { sendPattern_ = pattern; }
59 
62  { recvPattern_ = pattern; }
63 
64  private:
65  int localFieldMaskMessageSize(std::vector<fei::FieldMask*>& fieldMasks);
66 
67  int packLocalFieldMasks(std::vector<fei::FieldMask*>& fieldMasks,
68  std::vector<int>& localFieldMasks);
69 
70  int addFieldMasks(std::vector<int>& msg, std::vector<fei::FieldMask*>& fieldMasks);
71 
72  int packMaskIDs(int destProc, std::vector<int>& msg);
73 
74  int mergeMaskIDs(int srcProc, std::vector<int>& msg);
75 
76  int eqnNumbersMsgLength(int destProc);
77 
78  int packEqnNumbersMsg(int destProc, std::vector<int>& msg);
79 
80  int storeEqnNumbers(int srcProc, std::vector<int>& msg);
81 
86  std::vector<fei::FieldMask*>& fieldMasks_;
87 
89 
90  std::vector<int> sendProcs_;
91  std::vector<int> recvProcs_;
92 
93  std::vector<int>& eqnNumbers_;
94 
96  };//class RecordMsgHandler
97 }//namespace snl_fei
98 
99 #endif // _snl_fei_RecordMsgHandler_hpp_
100 
std::vector< int > & getRecvProcs()
int processRecvMessage(int srcProc, std::vector< int > &message)
int packEqnNumbersMsg(int destProc, std::vector< int > &msg)
int packLocalFieldMasks(std::vector< fei::FieldMask * > &fieldMasks, std::vector< int > &localFieldMasks)
int localFieldMaskMessageSize(std::vector< fei::FieldMask * > &fieldMasks)
std::vector< int > & getSendProcs()
int mergeMaskIDs(int srcProc, std::vector< int > &msg)
int packMaskIDs(int destProc, std::vector< int > &msg)
void setSendPattern(fei::comm_map *pattern)
int addFieldMasks(std::vector< int > &msg, std::vector< fei::FieldMask * > &fieldMasks)
RecordMsgHandler(int localProc, RecordCollection *recordCollection, snl_fei::PointBlockMap &ptBlkMap, std::vector< fei::FieldMask * > &fieldMasks, std::vector< int > &eqnNumbers)
std::vector< fei::FieldMask * > & fieldMasks_
int getSendMessage(int destProc, std::vector< int > &message)
int getSendMessageLength(int destProc, int &messageLength)
int localProc(MPI_Comm comm)
snl_fei::PointBlockMap & ptBlkMap_
int storeEqnNumbers(int srcProc, std::vector< int > &msg)
void setRecvPattern(fei::comm_map *pattern)