Hello community,

I am trying to understand the octree grid structure from the new release of Palabos, found in examples/showCases/gridRefinement3d. This is the call to the constructor and to the function generateGridStructure() in the example:

[code=“cpp”]

void createOctreeGridStructure(SimulationParameters ¶m)

{

bool useSamples = false;

plint numSamples = -1;

plint maxIter = 100;

bool removeBlocks = true;

bool fineToCoarse = true;

int numLevelsToGroupBlocks = 0;

int numLevelsToGroupOverlaps = -1;

bool strongGrouping = false;

bool verbose = true;

bool stlOutput = true;

std::string stlBaseName = “octree”;

T gridDensityScaleFactor = (T)1;

```
OctreeGridGenerator<T> octreeGridGenerator(
param.fullDomain,
param.gridDensityFunctionFile,
param.minLeafLevel,
param.maxLeafLevel,
param.nBlock,
global::mpi().getSize(),
gridDensityScaleFactor,
useSamples,
numSamples,
maxIter,
removeBlocks,
fineToCoarse,
numLevelsToGroupBlocks,
numLevelsToGroupOverlaps,
strongGrouping,
param.outDir,
verbose,
stlOutput,
stlBaseName);
param.ogs = octreeGridGenerator.generateOctreeGridStructure();
param.fullDomain = octreeGridGenerator.getFullDomain();
param.dxFinest = octreeGridGenerator.getDxFinestLevel();
```

}

```
In the grid density function file, gridDensityFunction.dat, the first line is the domain in physical units(?), the second line is dx in physical units(?), third line is the Nx, Ny and Nz of the outer cuboid. The fourth line contains Nx*Ny*Nz points between 0 and 1 (or negative values in regions where the user does not want blocks to be allocated) that gives the octree grid generator the criteria to refine the domain or not.
I still do not understand how to generate the values for the file gridDensityFunction.dat, and how to manipulate it to generate my own octree grid structure. Can I just give values of 1 where I want the refinement and 0 where I don't want it?
For the output, I also do not understand some other things. What does maxOutputLevel mean? How can we output 100 levels while when we generated the octree we specified 3 levels with the parameter numLevels?
Can octrees be implemented for moving geometries with immersed boundary method? For the moment I would like to implement the case where the finest grid envelops the whole region of rotation.
Thank you very much for your help!
Patricia
```