FEI Package Browser (Single Doxygen Collection)  Version of the Day
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
testData.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 _testData_h_
10 #define _testData_h_
11 
12 #include <fei_macros.hpp>
13 
14 #include <vector>
15 
18 class testData {
19 public:
21  : fieldIDs(2),
22  fieldSizes(2),
23  idTypes(2),
24  ids(4),
25  sharedIDs(0),
27  sharingProcs(0)
28  {
29  //this testData object contains the following:
30  //
31  //fieldIDs 3 9
32  //fieldSizes 1 3
33  //idTypes 0 5
34  //ids length 4, first 2 ids shared with localProc-1,
35  // last 2 ids shared with localProc+1
36  //ids[i] = localProc*2 + i
37  //sharedIDs, numSharingProcsPerID, sharingProcs
38  //
39  fieldIDs[0] = 3; fieldIDs[1] = 9;
40  fieldSizes[0] = 1; fieldSizes[1] = 3;
41  idTypes[0] = 0; idTypes[1] = 5;
42  for(int i=0; i<4; ++i) {
43  ids[i] = localProc*2 + i;
44  }
45 
46  if (localProc > 0) {
47  sharedIDs.push_back(ids[0]);
48  sharedIDs.push_back(ids[1]);
49  numSharingProcsPerID.push_back(1);
50  sharingProcs.push_back(localProc-1);
51  numSharingProcsPerID.push_back(1);
52  sharingProcs.push_back(localProc-1);
53  }
54 
55  if (localProc < numProcs-1) {
56  sharedIDs.push_back(ids[2]);
57  sharedIDs.push_back(ids[3]);
58  numSharingProcsPerID.push_back(1);
59  sharingProcs.push_back(localProc+1);
60  numSharingProcsPerID.push_back(1);
61  sharingProcs.push_back(localProc+1);
62  }
63  }
64 
65  virtual ~testData()
66  {
67  }
68 
69  std::vector<int> fieldIDs;
70  std::vector<int> fieldSizes;
71  std::vector<int> idTypes;
72  std::vector<int> ids;
73  std::vector<int> sharedIDs;
74  std::vector<int> numSharingProcsPerID;
75  std::vector<int> sharingProcs;
76 };
77 
78 #endif // _testData_h_
79 
std::vector< int > fieldSizes
Definition: testData.hpp:70
std::vector< int > ids
Definition: testData.hpp:72
std::vector< int > fieldIDs
Definition: testData.hpp:69
std::vector< int > sharedIDs
Definition: testData.hpp:73
std::vector< int > idTypes
Definition: testData.hpp:71
virtual ~testData()
Definition: testData.hpp:65
std::vector< int > sharingProcs
Definition: testData.hpp:75
int localProc(MPI_Comm comm)
std::vector< int > numSharingProcsPerID
Definition: testData.hpp:74
testData(int localProc, int numProcs)
Definition: testData.hpp:20
int numProcs(MPI_Comm comm)