Exemplo n.º 1
0
int
main(int argc, char* argv[])
{
#ifdef CH_MPI
  MPI_Init(&argc, &argv);
#endif
  int eekflag=0;
  {//begin forever present scoping trick

    const char* in_file = "fluxreg.inputs";
    //parse input file
    ParmParse pp(0,NULL,NULL,in_file);

    //    AttachDebugger();
    eekflag = fluxRegTest();
    //    pout() << "made it out" << endl;
    if (eekflag == 0)
      pout() << "ebfluxregister test passed." << endl;
    else
      pout() << "ebfluxregister test FAILED with error code "
           << eekflag << endl;

  }//end omnipresent scoping trick
  EBIndexSpace* ebisPtr = Chombo_EBIS::instance();
  ebisPtr->clear();
#ifdef CH_MPI
  MPI_Finalize();
#endif
  return eekflag;
}
Exemplo n.º 2
0
int
main(int argc, char** argv)
{

#ifdef CH_MPI
  MPI_Init(&argc, &argv);
#endif
  //begin forever present scoping trick
  {
    const char* in_file;
    if (argc < 2 || argv[1][0] == '-')
      {
        in_file = "ramp.inputs";
      }
    else
      {
        in_file = argv[1];
      }
    //parse input file
    ParmParse pp(0,NULL,NULL,in_file);
    int eekflag = 0;
    //define the geometry object.
    Box domain;
    eekflag =  makeGeometry(domain);
    if (eekflag != 0)
      {
        pout() << "non zero eek detected = " << eekflag << endl;
        MayDay::Error("problem in makeGeometry");
      }

    //check that total coarse vol = total fine vol
    //check that total coarse vol centroid = total fine vol centroid
    eekflag = checkCoarseAssortment(domain);

    if (eekflag != 0)
      {
        pout() << "checkCoarse: eek = " << eekflag << endl;
        MayDay::Error("problem in checkEBISL");
      }

    pout() << "pointCoarsening test passed" << endl;
  }//end scoping trick
  EBIndexSpace* ebisPtr = Chombo_EBIS::instance();
  ebisPtr->clear();
#ifdef CH_MPI
  MPI_Finalize();
#endif
  return 0;
}
Exemplo n.º 3
0
int
main(int argc, char** argv)
{

#ifdef CH_MPI
  MPI_Init(&argc, &argv);
#endif
  //begin scoping trick
  {

    int eekflag = 0;
    //define the geometry object.
    //need the new and delete because of
    //strong construction
    Box domain, coveredDomain;
    Real dx;
    //make the gometry.  this makes the first Chombo_EBIS
    //and defines it using a geometryservice
    eekflag =  makeGeometry(domain, dx, coveredDomain);
    if (eekflag != 0)
      {
        pout() << "non zero eek detected = " << eekflag << endl;
        MayDay::Error("problem in makeGeometry");
      }

    eekflag = checkIrregFabCopy(domain);
    if (eekflag != 0)
      {
        pout() << "non zero eek detected = " << eekflag << endl;
        MayDay::Error("problem in checkIrregFabCopy");
      }

    eekflag = checkRegularFabCopy(domain);
    if (eekflag != 0)
      {
        pout() << "non zero eek detected = " << eekflag << endl;
        MayDay::Error("problem in checkRegularFabCopy");
      }

    pout() << "fab copy test passed" << endl;
  }//end scoping trick
  EBIndexSpace* ebisPtr = Chombo_EBIS::instance();
  ebisPtr->clear();
#ifdef CH_MPI
  MPI_Finalize();
#endif
  return 0;
}
Exemplo n.º 4
0
int
main(int argc,char **argv)
{
#ifdef CH_MPI
  MPI_Init(&argc, &argv);
#endif

  // begin forever present scoping trick
  {
    const char* in_file;
    if (argc < 2 || argv[1][0] == '-')
      {
        in_file = "correct12.inputs";
      }
    else
      {
        in_file = argv[1];
      }
    //parse input file
    ParmParse pp(0,NULL,NULL,in_file);
    Box domain;
    int eekflag = 0;
    eekflag =  makeGeometry(domain);
    if (eekflag != 0)
      {
        pout() << "non zero eek detected = " << eekflag << endl;
        MayDay::Error("problem in makeGeometry");
      }

    eekflag = checkCorrection(domain);
    if (eekflag != 0)
      {
        pout() << "checkCorrection: eek = " << eekflag << endl;
        MayDay::Error("problem in checkCorrection");
      }
    pout() << "correct1d2d test passed" << endl;
  } // end scoping trick

  EBIndexSpace* ebisPtr = Chombo_EBIS::instance();
  ebisPtr->clear();

#ifdef CH_MPI
  MPI_Finalize();
#endif

  return 0;
}
Exemplo n.º 5
0
int
main(int a_argc, char* a_argv[])
{
#ifdef CH_MPI
  MPI_Init(&a_argc,&a_argv);
  // registerDebugger();
  // setChomboMPIErrorHandler();
#endif
  {
    // Check for an input file
    char* inFile = NULL;

    EBDebugPoint::s_ivd = IntVect(D_DECL(16,45,0));
    if (a_argc > 1)
      {
        inFile = a_argv[1];
      }
    else
      {
        pout() << "Usage: <executable name> <inputfile>" << endl;
        pout() << "No input file specified" << endl;
        return -1;
      }
    // Parse the command line and the input file (if any)
    ParmParse pp(a_argc-2,a_argv+2,NULL,inFile);

    Box coarsestDomain;
    RealVect dx;
    // run amrGodunov
    godunovGeometry(coarsestDomain, dx);

    amrGodunov(coarsestDomain, dx);

    EBIndexSpace* ebisPtr = Chombo_EBIS::instance();
    ebisPtr->clear();

  } //scoping trick

#ifdef CH_MPI
  pout() << "dumping timers" << endl;
  CH_TIMER_REPORT();
  dumpmemoryatexit();
  MPI_Finalize();
#endif
  pout() << "Done." << endl;
}
Exemplo n.º 6
0
int main(int argc, char* argv[])
{
#ifdef CH_MPI
  MPI_Init(&argc, &argv);
#endif
  // Scoping trick
  {
#ifdef CH_MPI
    MPI_Barrier(Chombo_MPI::comm);
#endif

    if (argc < 2)
      {
        cerr << " usage " << argv[0] << " <input_file_name> " << endl;
        exit(0);
      }

    char* inFile = argv[1];
    ParmParse pp(argc-2,argv+2,NULL,inFile);

    PoissonParameters params;

    //read params from file
    getPoissonParameters(params);

    //define geometry from given params
    definePoissonGeometry(params);



    //solve the stinking problem and output everything
    solve(params);

    EBIndexSpace* ebisPtr = Chombo_EBIS::instance();
    ebisPtr->clear();

  }
  // End scoping trick

#ifdef CH_MPI
  CH_TIMER_REPORT();
  dumpmemoryatexit();
  MPI_Finalize();
#endif
}
Exemplo n.º 7
0
int
main(int argc, char** argv)
{
  //This test is an attempt to test linearization
  //of eb data holders directly

  int eekflag;
#ifdef CH_MPI
  MPI_Init(&argc, &argv);
#endif
  //begin forever present scoping trick
  {
    // registerDebugger();

    // Set up some geometry.
    Box domain;
    Real dx;
    EBISLayout ebisl;
    DisjointBoxLayout dbl;

    do_geo( dbl, ebisl, domain, dx );


    eekflag = testIFFAB( dbl, ebisl, domain, dx );
    if (eekflag != 0)
      {
        pout() << "IFFAB exhange linearization test failed " << endl;
        return eekflag;
      }
    EBIndexSpace* ebisPtr = Chombo_EBIS::instance();
    ebisPtr->clear();

  }//end scoping trick
#ifdef CH_MPI
  MPI_Finalize();
#endif
  pout() << "IFFAB exchange linearization tests passed "<< endl;
  return eekflag;
}
Exemplo n.º 8
0
int
main(int a_argc, char* a_argv[])
{
#ifdef CH_MPI
    MPI_Init(&a_argc,&a_argv);
    {
        // setChomboMPIErrorHandler();
#endif
        // Check for an input file
        const char* inFile = "sphere.inputs";

        ParmParse pp(0,NULL,NULL,inFile);

        divergenceTest();

        EBIndexSpace* ebisPtr = Chombo_EBIS::instance();
        ebisPtr->clear();
#ifdef CH_MPI
    }
    MPI_Finalize();
#endif
}
Exemplo n.º 9
0
int main (int argc, char** argv)
{
#ifdef CH_MPI
  MPI_Init(&argc,&argv);
#endif

  // Begin forever present scoping trick
  {
    const char* in_file = "plane.inputs";

    if (argc > 1)
    {
      in_file = argv[1];
    }

    // Parse input file
    ParmParse pp(0,NULL,NULL,in_file);

    Box domain;
    RealVect origin;
    Real dx;

    BaseIF* implicit;

    // Make geometry
    implicit = makeGeometry(domain,origin,dx);

    // Make grids
    DisjointBoxLayout grids;
    makeLayout(grids,domain);

    // Create ebislayout
    int nghost = 0;
    EBISLayout ebisl;
    makeEBISL(ebisl,grids,domain,nghost);

    // Make a LevelData
    int nComps = 1;

    IntVect ghost = IntVect::Unit;
    ghost *= nghost;

    RefCountedPtr<DataFactory<EBCellFAB> > rcpFactory(new EBCellFactory(ebisl));
    LevelData<EBCellFAB> level(grids,nComps,ghost,*rcpFactory);

    // Put some data in the data holders
    fillData(level,origin,dx,*implicit);

    // Done with this object
    delete implicit;

    // Write the data and the EB out
    const char* basename = "plane";

    char name[1000];
    sprintf(name,"%s%dd.hdf5",basename,SpaceDim);
#ifdef CH_USE_HDF5
    writeEBLevelname(&level,name);
#endif
  } // End scoping trick

  // Clean up
  EBIndexSpace* ebisPtr = Chombo_EBIS::instance();
  ebisPtr->clear();

  CH_TIMER_REPORT();

#ifdef CH_MPI
  MPI_Finalize();
#endif

  return 0;
}
int
main(int a_argc, char* a_argv[])
{
#ifdef CH_MPI
  MPI_Init(&a_argc,&a_argv);
#endif
  //Scoping trick
  {
    CH_TIMERS("uber_timers");
    CH_TIMER("define_geometry", t1);
    CH_TIMER("run", t2);

#ifdef CH_MPI
    MPI_Barrier(Chombo_MPI::comm);
#endif

    //Check for an input file
    char* inFile = NULL;
    if (a_argc > 1)
      {
        inFile = a_argv[1];
      }
    else
      {
        pout() << "Usage: <executable name> <inputfile>" << endl;
        pout() << "No input file specified" << endl;
        return -1;
      }

    //Parse the command line and the input file (if any)
    ParmParse pp(a_argc-2,a_argv+2,NULL,inFile);

    ProblemDomain coarsestDomain;
    RealVect coarsestDx;
    AMRParameters params;
    getAMRINSParameters(params, coarsestDomain);
    int numFilt;
    pp.get("num_filter_iterations", numFilt);
    params.m_numFilterIterations = numFilt;

    int gphiIterations;
    pp.get("num_gphi_iterations", gphiIterations);
    params.m_gphiIterations = gphiIterations;

    int initIterations;
    pp.get("num_init_iterations", initIterations);
    params.m_initIterations = initIterations;

    bool doRegridSmoothing;
    pp.get("do_regrid_smoothing", doRegridSmoothing);
    params.m_doRegridSmoothing = doRegridSmoothing;

    CH_START(t1);

    //define geometry
    AMRINSGeometry(params, coarsestDomain);

    CH_STOP(t1);

    CH_START(t2);
    ebamriTransport(params, coarsestDomain);
    CH_STOP(t2);

    EBIndexSpace* ebisPtr = Chombo_EBIS::instance();
    ebisPtr->clear();

  }//end scoping trick
#ifdef CH_MPI
  CH_TIMER_REPORT();
  dumpmemoryatexit();
  MPI_Finalize();
#endif
}
Exemplo n.º 11
0
int
main(int argc, char** argv)
{

#ifdef CH_MPI
    MPI_Init(&argc, &argv);
#endif
    //begin forever present scoping trick
    {
        const char* in_file = "ramp.inputs";
        //parse input file
        ParmParse pp(0,NULL,NULL,in_file);
        int eekflag = 0;
        //define the geometry object.
        //need the new and delete because of
        //strong construction
        //make the gometry.  this makes the first Chombo_EBIS
        Box domain;
        Real dx;
        RealVect origin;
        int upDir;
        int indepVar;
        Real startPt;
        Real slope;
        //and defines it using a geometryservice
        eekflag =  makeGeometry(domain,  dx, origin,
                                upDir, indepVar, startPt, slope);
        if (eekflag != 0)
        {
            pout() << "non zero eek detected = " << eekflag << endl;
            MayDay::Error("problem in makeGeometry");
        }

        //make grids
        DisjointBoxLayout grids;
        eekflag = makeLayout(grids, domain);
        if (eekflag != 0)
        {
            pout() << "non zero eek detected = " << eekflag << endl;
            MayDay::Error("problem in makeLayouts");
        }

        ///create ebislayout
        int nghost = 2;
        EBISLayout ebisl;
        eekflag = makeEBISL(ebisl, grids, domain, nghost);
        if (eekflag != 0)
        {
            pout() << "non zero eek detected = " << eekflag << endl;
            MayDay::Error("problem in makeEBISL");
        }

        //check everything i can think of on finest level
        eekflag = checkEBISL(ebisl, grids, domain, dx, origin,
                             upDir, indepVar, startPt, slope);
        if (eekflag != 0)
        {
            pout() << "non zero eek detected = " << eekflag << endl;
            MayDay::Error("problem in checkEBISL");
        }

        pout() << "ramp test passed" << endl;
    }//end scoping trick
    EBIndexSpace* ebisPtr = Chombo_EBIS::instance();
    ebisPtr->clear();
#ifdef CH_MPI
    MPI_Finalize();
#endif
    return 0;
}
Exemplo n.º 12
0
int
main(int argc, char** argv)

{

#ifdef CH_MPI
  MPI_Init(&argc, &argv);
#endif
  int eekflag = 0;
  {//begin forever present scoping trick

    const char* in_file = "ramp.inputs";
    //parse input file
    ParmParse pp(0,NULL,NULL,in_file);
    //define the geometry object.
    //need the new and delete because of
    //strong construction
    //make the gometry.  this makes the first Chombo_EBIS
    Box domainFine, domainCoar;
    Real dxFine, dxCoar;

    //and defines it using a geometryservice
    eekflag =  makeGeometry(domainFine,  dxFine);
    CH_assert(eekflag == 0);

    domainCoar = coarsen(domainFine, 2);
    dxCoar = 2.0*dxFine;
    //make grids
    DisjointBoxLayout gridsFine, gridsCoar;
    eekflag = makeLayout(gridsFine, domainFine);
    CH_assert(eekflag == 0);
    coarsen(gridsCoar, gridsFine, 2);

    ///create ebislayout
    int nghost = 2;
    EBISLayout ebislFine, ebislCoar;
    eekflag = makeEBISL(ebislFine, gridsFine, domainFine, nghost);
    if (eekflag != 0) return eekflag;
    eekflag = makeEBISL(ebislCoar, gridsCoar, domainCoar, nghost);
    if (eekflag != 0) return eekflag;

    int nvar = 1;
    EBCellFactory ebcellfactFine(ebislFine);
    EBCellFactory ebcellfactCoar(ebislCoar);
    IntVect ivghost = nghost*IntVect::Unit;
    LevelData<EBCellFAB> errorFine(gridsFine, nvar,
                                   ivghost,ebcellfactFine);
    LevelData<EBCellFAB> errorCoar(gridsCoar, nvar,
                                   ivghost,ebcellfactCoar);

    eekflag = getError(errorFine,ebislFine, gridsFine, domainFine, dxFine);
    if (eekflag != 0) return eekflag;

    eekflag = getError(errorCoar,ebislCoar, gridsCoar, domainCoar, dxCoar);
    if (eekflag != 0) return eekflag;

    eekflag =  compareError(errorFine, ebislFine, gridsFine, domainFine,
                            errorCoar, ebislCoar, gridsCoar, domainCoar);
    if (eekflag != 0) return eekflag;

  }//end omnipresent scoping trick
  EBIndexSpace* ebisPtr = Chombo_EBIS::instance();
  ebisPtr->clear();
  if (eekflag == 0)
    {
      pout() << "aggpwlfpTest passed" << endl;
    }

#ifdef CH_MPI
  MPI_Finalize();
#endif
  return eekflag;
}
Exemplo n.º 13
0
int
main(int argc, char** argv)
{
  //This test is an attempt to test linearization
  //of eb data holders directly

  int eekflag=0;
#ifdef CH_MPI
  MPI_Init(&argc, &argv);
#endif
  //begin forever present scoping trick
  {
    //registerDebugger();

    // Set up some geometry.
    Box domain;
    Real dx;

    do_geo( domain, dx );

    Vector<Box> boxes(1, domain);
    Vector<int> procs(1, 0);
    // Make a layout for the space.
    DisjointBoxLayout dbl(boxes, procs);

    // Fill in the layout with the geometrical info.
    EBISLayout ebisl;
    EBIndexSpace *ebisPtr = Chombo_EBIS::instance();
    ebisPtr->fillEBISLayout(ebisl, dbl, domain, 1 );

    // Define the leveldata for my one and only level.
    DataIterator dit = dbl.dataIterator();
    for ( dit.begin(); dit.ok(); ++dit )
      {
        eekflag = testIVFAB(ebisl[dit()], dbl.get(dit()));
        if (eekflag != 0)
          {
            pout() << "IVFAB linearization test failed " << endl;
            return eekflag;
          }
        eekflag = testIFFAB(ebisl[dit()], dbl.get(dit()));
        if (eekflag != 0)
          {
            pout() << "IFFAB  linearization test failed " << endl;
            return eekflag;
          }
        eekflag = testEBCellFAB(ebisl[dit()], dbl.get(dit()));
        if (eekflag != 0)
          {
            pout() << "EBCellFAB  linearization test failed " << endl;
            return eekflag;
          }
        eekflag = testEBFaceFAB(ebisl[dit()], dbl.get(dit()));
        if (eekflag != 0)
          {
            pout() << "EBFaceFAB  linearization test failed " << endl;
            return eekflag;
          }

        eekflag = testEBFluxFAB(ebisl[dit()], dbl.get(dit()));
        if (eekflag != 0)
          {
            pout() << "EBFluxFAB  linearization test failed " << endl;
            return eekflag;
          }
      }

    ebisPtr->clear();

  }//end scoping trick
  pout() << "linearization tests passed "<< endl;
#ifdef CH_MPI
  MPI_Finalize();
#endif
  return eekflag;
}