コード例 #1
0
void DataImporterImportPage::startWorkerThread()
{
    Q_ASSERT(workerThread == 0);

    QTimer::singleShot(0, this, SLOT(enableBackButton()));
    QTimer::singleShot(0, this, SLOT(enableNextButton()));
    QTimer::singleShot(0, this, SLOT(enableCancelButton()));

    importedCount = 0;

    DataImporter *importerWizard = static_cast<DataImporter*>(wizard());

    workerThread = new DataImporterThread(field("schemaName").toString().trimmed().toUpper(),
                                          this->queryScheduler->getDb(),
                                          field("tableName").toString().trimmed().toUpper(),
                                          importerWizard->getColumnMappings(),
                                          field("beforeImportGroupBox").toBool() ? field("beforeImportQuery").toString().trimmed() : "",
                                          field("importQuery").toString(),
                                          field("afterImportGroupBox").toBool() ? field("afterImportQuery").toString().trimmed() : "",
                                          importerWizard->getImporter(),
                                          this);
    connect(workerThread, SIGNAL(statusChanged(QString)), this, SLOT(setStatus(QString)));
    connect(workerThread, SIGNAL(chunkImported(int)), this, SLOT(chunkImported(int)));
    connect(workerThread, SIGNAL(comparisonCompleted()), this, SLOT(importCompleted()));
    connect(workerThread, SIGNAL(compareError(QString,OciException)), this, SLOT(importError(QString,OciException)));

    timer.start();
    workerThread->start();

    stopButton->setEnabled(true);
    stopButton->setText(tr("Stop"));
    stopButton->setVisible(true);
}
コード例 #2
0
ファイル: levelDivTest.cpp プロジェクト: rsnemmen/Chombo
void
divergenceTest()
{
    int maxsize;
    ParmParse pp;
    pp.get("max_grid_size", maxsize);

    //make layouts == domain
    Box domainBoxFine, domainBoxCoar;
    Real dxFine, dxCoar;
    sphereGeometry(domainBoxFine, dxFine);
    domainBoxCoar = coarsen(domainBoxFine, 2);

    //debug
    dxFine = 1.0;
    dxCoar = 2.*dxFine;
    Vector<Box> boxFine;
    domainSplit(domainBoxFine, boxFine, maxsize);

    Vector<int> proc(boxFine.size(), 0);
    DisjointBoxLayout dblFine(boxFine, proc);
    DisjointBoxLayout dblCoar;
    coarsen(dblCoar, dblFine, 2);
    LevelData<EBCellFAB> errorFine, errorCoar;

    EBISLayout ebislFine, ebislCoar;
    const EBIndexSpace* const ebisPtr = Chombo_EBIS::instance();
    ebisPtr->fillEBISLayout(ebislFine, dblFine, domainBoxFine, 2);
    ebisPtr->fillEBISLayout(ebislCoar, dblCoar, domainBoxCoar, 2);

    getError(errorFine, ebislFine, dblFine, dxFine);
    getError(errorCoar, ebislCoar, dblCoar, dxCoar);

    for (DataIterator dit= dblFine.dataIterator(); dit.ok(); ++dit)
    {
        const EBCellFAB& errorFineFAB = errorFine[dit()];
        const EBCellFAB& errorCoarFAB = errorCoar[dit()];
        int i1 = errorFineFAB.getMultiCells().numPts();
        int i2 = errorCoarFAB.getMultiCells().numPts();
        pout() << i1 << i2 << endl;
    }

    compareError(errorFine, ebislFine, dblFine, domainBoxFine,
                 errorCoar, ebislCoar, dblCoar, domainBoxCoar);

}
コード例 #3
0
void DataImporterThread::run()
{
    try{
        stmt = sourceDb->createStatement();

        importData();

        emitCompletedSignal();
    }catch(OciException ex){
        if(stmt->hasLockOnConnection()){
            stmt->unlockConnection();
        }

        rollback();

        emit compareError("import_data", ex);
    }
}
コード例 #4
0
ファイル: aggpwlfpTest.cpp プロジェクト: rsnemmen/Chombo
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;
}
コード例 #5
0
ファイル: pwlinterpTest.cpp プロジェクト: rsnemmen/Chombo
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 = "pwlinterp.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 domainFineFull, domainCoarFull;
    Box domainFinePart, domainCoarPart;
    Real dxFineFull, dxCoarFull;
    Real dxFinePart, dxCoarPart;
    //and defines it using a geometryservice
    eekflag =  makeGeometry(domainFinePart,  dxFinePart);
    CH_assert(eekflag == 0);
    int nlevels = 2;
    Vector<int> refRatio(nlevels);
    pp.getarr("ref_ratio", refRatio,0,nlevels);

    domainCoarPart = coarsen(domainFinePart, 2);
    domainFineFull = coarsen(domainFinePart, refRatio[0]);
    domainCoarFull = coarsen(domainFineFull, 2);

    dxCoarPart =         2.0*dxFinePart;
    dxFineFull = refRatio[0]*dxFinePart;
    dxCoarFull =         2.0*dxFineFull;

    //make grids
    DisjointBoxLayout gridsFinePart, gridsCoarPart;
    DisjointBoxLayout gridsFineFull, gridsCoarFull;

    eekflag = makeLayoutPart(gridsCoarPart, domainCoarFull);
    eekflag = makeLayoutFull(gridsCoarFull, domainCoarFull);
    CH_assert(eekflag == 0);
    refine(gridsFinePart, gridsCoarPart, 2);
    refine(gridsFineFull, gridsCoarFull, 2);

    ///create ebislayout
    int nghost = 0;
    EBISLayout ebislFinePart, ebislCoarPart;
    EBISLayout ebislFineFull, ebislCoarFull;

    eekflag = makeEBISL(ebislFinePart, gridsFinePart, domainFinePart, nghost);
    if (eekflag != 0) return eekflag;
    eekflag = makeEBISL(ebislCoarPart, gridsCoarPart, domainCoarPart, nghost);
    if (eekflag != 0) return eekflag;
    eekflag = makeEBISL(ebislFineFull, gridsFineFull, domainFineFull, nghost);
    if (eekflag != 0) return eekflag;
    eekflag = makeEBISL(ebislCoarFull, gridsCoarFull, domainCoarFull, nghost);
    if (eekflag != 0) return eekflag;

    int nvar = 1;
    EBCellFactory ebcellfactFinePart(ebislFinePart);
    EBCellFactory ebcellfactCoarPart(ebislCoarPart);
    LevelData<EBCellFAB> errorFinePart(gridsFinePart, nvar,
                                   IntVect::Zero,ebcellfactFinePart);
    LevelData<EBCellFAB> errorCoarPart(gridsCoarPart, nvar,
                                   IntVect::Zero,ebcellfactCoarPart);

    eekflag = getError(errorFinePart,
                       ebislFinePart, gridsFinePart, domainFinePart, dxFinePart,
                       ebislFineFull, gridsFineFull, domainFineFull, dxFineFull,
                       refRatio[0]);
    if (eekflag != 0) return eekflag;

    eekflag = getError(errorCoarPart,
                       ebislCoarPart, gridsCoarPart, domainCoarPart, dxCoarPart,
                       ebislCoarFull, gridsCoarFull, domainCoarFull, dxCoarFull,
                       refRatio[0]);
    if (eekflag != 0) return eekflag;

    eekflag =  compareError(errorFinePart, ebislFinePart, gridsFinePart, domainFinePart,
                            errorCoarPart, ebislCoarPart, gridsCoarPart, domainCoarPart);
    if (eekflag != 0) return eekflag;


#if CH_SPACEDIM==2
    string fileFine("pltFineError.2d.hdf5");
    string fileCoar("pltCoarError.2d.hdf5");
#else
    string fileFine("pltFineError.3d.hdf5");
    string fileCoar("pltCoarError.3d.hdf5");
#endif

    outputError(errorFinePart,
                errorCoarPart,
                gridsFinePart,
                gridsCoarPart,
                domainFinePart,
                domainCoarPart,
                fileFine,
                fileCoar);

  }//end omnipresent scoping trick
  CH_XD::EBIndexSpace* ebisPtr = Chombo_EBIS::instance();
  ebisPtr->clear();
#ifdef CH_MPI
  MPI_Finalize();
#endif
  return eekflag;
}