About initialition errors about IBM and 3D Refinement

Dear community,
I am trying to combine 3D refinement with IBM( immersed boundary method). the code is as follow:
//////////////////////////////////////////////////code//////////////////////////////////////////////
void createFluidBlocks(SimulationParameters& param, MultiLevelCoupling3D<T,DESCRIPTOR,RESCALER>& lattices,
MultiScalarField3D
& rhoBar, MultiTensorField3D<T,3>& j, MultiContainerBlock3D& container,
std::vector<MultiBlock3D*>& lattice_rho_bar_j_arg, plint& order)
{
//Dynamics<T,DESCRIPTOR> *dynamics = new SmagorinskyBGKdynamics<T,DESCRIPTOR>(param.omega[0], param.cSmago);
//Dynamics<T,DESCRIPTOR> *dynamics = new ConsistentSmagorinskyCompleteRegularizedBGKdynamics<T,DESCRIPTOR>(param.omega[0], param.cSmago);
Dynamics<T,DESCRIPTOR> *dynamics = new ConsistentSmagorinskyBGKdynamics<T,DESCRIPTOR>(param.omega[0], param.cSmago);
param.incompressibleModel = false;
pcout << “Dynamics: Smagorinsky BGK.” << std::endl;
order=1;
lattices = new MultiLevelCoupling3D<T,DESCRIPTOR,RESCALER>( param.ogs, dynamics->clone(), order );
///
for (plint iLevel = 0; iLevel < lattices->getNumLevels(); iLevel++) {
defineDynamics(lattices->getLevel(iLevel), lattices->getLevel(iLevel).getBoundingBox(), dynamics->clone());
}

////
delete dynamics;
for (plint iLevel = 0; iLevel < lattices->getNumLevels(); iLevel++) {
pcout << "Info for lattice at level: " << iLevel << std::endl;
pcout << getMultiBlockInfo(lattices->getLevel(iLevel)) << std::endl;
lattices->getLevel(iLevel).toggleInternalStatistics(false);
}

/*lattice = generateMultiBlockLattice<T,DESCRIPTOR>(fullDomain, dynamics->clone(),
        param.smallEnvelopeWidth).release();
defineDynamics(*lattice, lattice->getBoundingBox(), dynamics->clone());
delete dynamics;
lattice->toggleInternalStatistics(false);*/

rhoBar = generateMultiScalarField<T>((MultiBlock3D&) lattices->getLevel(param.finestLevel), param.largeEnvelopeWidth).release();
rhoBar->toggleInternalStatistics(false);

j = generateMultiTensorField<T,3>((MultiBlock3D&) lattices->getLevel(param.finestLevel), param.largeEnvelopeWidth).release();
j->toggleInternalStatistics(false);

container = new MultiContainerBlock3D((MultiBlock3D&) *rhoBar);

lattice_rho_bar_j_arg.clear();
lattice_rho_bar_j_arg.push_back(&(lattices->getLevel(param.finestLevel)));
lattice_rho_bar_j_arg.push_back(rhoBar);
lattice_rho_bar_j_arg.push_back(j);

/*applyProcessingFunctional(
        new BoxRhoBarJfunctional3D<T,DESCRIPTOR>(),
        lattices->getLevel(param.finestLevel).getBoundingBox(), lattice_rho_bar_j_arg);*/

/*Box3D finestbox = lattices->getLevel(param.finestLevel).getBoundingBox();
pcout << finestbox.x0 << "," << finestbox.x1 << std::endl
      << finestbox.y0 << "," << finestbox.y1 << std::endl
      << finestbox.z0 << "," << finestbox.z1 << std::endl;*/

integrateProcessingFunctional(
        new BoxRhoBarJfunctional3D<T,DESCRIPTOR>(),
        lattices->getLevel(param.finestLevel).getBoundingBox(), lattice_rho_bar_j_arg, 0);
integrateProcessingFunctional(
        new ComputeWallVelocityFunctional<T,DESCRIPTOR>(&param),
        lattices->getLevel(param.finestLevel).getBoundingBox(), lattice_rho_bar_j_arg, 1);
integrateProcessingFunctional(
        new ExternalRhoJcollideAndStream3D<T,DESCRIPTOR>(),
        lattices->getLevel(param.finestLevel).getBoundingBox(), lattice_rho_bar_j_arg, 3);

// Integrate the immersed boundary processors in the lattice multi-block.

std::vector<MultiBlock3D*> args;

plint pl = 4;

args.resize(0);
args.push_back(container);
integrateProcessingFunctional(
        new InstantiateImmersedWallDataWithIndexedTagging3D<T>(param.vertices, param.areas, param.flags),
        container->getBoundingBox(), lattices->getLevel(param.finestLevel), args, pl);
pl++;

for (plint i = 0; i < param.ibIter; i++) {
    args.resize(0);
    args.push_back(rhoBar);
    args.push_back(j);
    args.push_back(container);
    integrateProcessingFunctional(
        new IndexedInamuroIteration3D<T,VelFunction>(
            VelFunction(param), 1.0 / param.omega[param.finestLevel], param.incompressibleModel),
        rhoBar->getBoundingBox(), lattices->getLevel(param.finestLevel), args, pl);
    pl++;
}

}
////////////////////////////////////////////////////////////////////////////////////////////////////
But when i run it , the code stop at “lattices.initialise”. “exit code:139”.
BAD TERMINATION OF ONE OF YOUR APPLICATION PROCESSES
= PID 32647 RUNNING AT lintianlong-Precision-7920-Tower
= EXIT CODE: 139
= CLEANING UP REMAINING PROCESSES
= YOU CAN IGNORE THE BELOW CLEANUP MESSAGES

if i close IBM ,everything is ok. So i want to know how to use IBM in 3D Refinement in Palabos
thanks a lot
Lin

1 Like

I have solved it. thanks a lot