testData.hpp

00001 /*--------------------------------------------------------------------*/
00002 /*    Copyright 2005 Sandia Corporation.                              */
00003 /*    Under the terms of Contract DE-AC04-94AL85000, there is a       */
00004 /*    non-exclusive license for use of this work by or on behalf      */
00005 /*    of the U.S. Government.  Export of this program may require     */
00006 /*    a license from the United States Government.                    */
00007 /*--------------------------------------------------------------------*/
00008 
00009 #ifndef _testData_h_
00010 #define _testData_h_
00011 
00012 #include <fei_macros.hpp>
00013 
00014 #include <vector>
00015 
00018 class testData {
00019 public:
00020   testData(int localProc, int numProcs)
00021     : fieldIDs(2),
00022     fieldSizes(2),
00023     idTypes(2),
00024     ids(4),
00025     sharedIDs(0),
00026     numSharingProcsPerID(0),
00027     sharingProcs(0)
00028     {
00029       //this testData object contains the following:
00030       //
00031       //fieldIDs         3   9
00032       //fieldSizes       1   3
00033       //idTypes          0   5
00034       //ids  length 4, first 2 ids shared with localProc-1,
00035       //                last 2 ids shared with localProc+1
00036       //ids[i] = localProc*2 + i
00037       //sharedIDs, numSharingProcsPerID, sharingProcs
00038       //
00039       fieldIDs[0] = 3; fieldIDs[1] = 9;
00040       fieldSizes[0] = 1; fieldSizes[1] = 3;
00041       idTypes[0] = 0; idTypes[1] = 5;
00042       for(int i=0; i<4; ++i) {
00043   ids[i] = localProc*2 + i;
00044       }
00045 
00046       if (localProc > 0) {
00047   sharedIDs.push_back(ids[0]);
00048   sharedIDs.push_back(ids[1]);
00049   numSharingProcsPerID.push_back(1);
00050   sharingProcs.push_back(localProc-1);
00051   numSharingProcsPerID.push_back(1);
00052   sharingProcs.push_back(localProc-1);
00053       }
00054 
00055       if (localProc < numProcs-1) {
00056   sharedIDs.push_back(ids[2]);
00057   sharedIDs.push_back(ids[3]);
00058   numSharingProcsPerID.push_back(1);
00059   sharingProcs.push_back(localProc+1);
00060   numSharingProcsPerID.push_back(1);
00061   sharingProcs.push_back(localProc+1);
00062       }
00063     }
00064 
00065   virtual ~testData()
00066     {
00067     }
00068 
00069   std::vector<int> fieldIDs;
00070   std::vector<int> fieldSizes;
00071   std::vector<int> idTypes;
00072   std::vector<int> ids;
00073   std::vector<int> sharedIDs;
00074   std::vector<int> numSharingProcsPerID;
00075   std::vector<int> sharingProcs;
00076 };
00077 
00078 #endif // _testData_h_
00079 

Generated on Wed May 12 21:30:42 2010 for FEI by  doxygen 1.4.7