Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Namespace Members | Class Members | File Members | Related Pages

buildRgDA.C

Go to the documentation of this file.
00001 
00007 #include "mpi.h"
00008 #include "petsc.h"
00009 #include "sys.h"
00010 #include "parUtils.h"
00011 #include "TreeNode.h"
00012 #include "colors.h"
00013 #include "oda.h"
00014 #include <cstdlib>
00015 #include "externVars.h"
00016 #include "dendro.h"
00017 
00018 int main(int argc, char ** argv ) {     
00019   int size, rank;
00020   bool compressLut=false;
00021   unsigned int regLev = 2;
00022   std::vector<ot::TreeNode> balOct;
00023 
00024   PetscInitialize(&argc,&argv,"options",NULL);
00025   ot::RegisterEvents();
00026   ot::DA_Initialize(MPI_COMM_WORLD);
00027 
00028   MPI_Comm_size(MPI_COMM_WORLD,&size);
00029   MPI_Comm_rank(MPI_COMM_WORLD,&rank);
00030   if(argc < 2) {
00031     std::cerr << "Usage: " << argv[0] << "regLev compressLut[0] " << std::endl;
00032     return -1;
00033   }
00034 
00035   regLev = atoi(argv[1]);
00036   if(argc > 2) { compressLut = (bool)(atoi(argv[2]));}
00037 
00038   if(!rank) {
00039     std::cout<<"sizeof(DendroIntL) = "<<sizeof(DendroIntL)<<" sizeof(PetscInt) = "<<sizeof(PetscInt)<<std::endl;
00040   }
00041 
00042   ot::createRegularOctree(balOct, regLev, 3, 30, MPI_COMM_WORLD);
00043 
00044   //ODA ...
00045   MPI_Barrier(MPI_COMM_WORLD);  
00046   assert(!(balOct.empty()));
00047   ot::DA da(balOct, MPI_COMM_WORLD, MPI_COMM_WORLD, compressLut);
00048   balOct.clear();
00049 
00050   ot::DA_Finalize();
00051   PetscFinalize();
00052 }//end function
00053 

Generated on Tue Mar 24 16:13:58 2009 for DENDRO by  doxygen 1.3.9.1