Bounce back on multigrid?

Greetings, community!

I am dipping my toes at multigrid modeling, and I am currently doing some exploration on the technique to understand it enough to model my problem. My goal is, at the end, to model a channel with a porous wall with a multigrid approach, where the duct is modeled with a coarser lattice and the porous wall with a grid with a much higher resolution.

This is a complicated problem, so I am first trying an easier problem to understand the best approach for this. Hence, I am developing a duct flow with an obstacle, where the grid is refined on the region around and past the obstacle, so the resolution is higher where the turbulent regime forms.

However, it seems that the defineDynamics function, which is used to parse bounce back dynamics to a region, cannot handle multi grid lattices. The following snippet is inside a loop which iterates at the iLevels of the multi grid structure:

gridrefining.cpp:179:19: error: no matching function for call to ‘defineDynamics(plb::MultiGridLattice2D<double, plb::descriptors::D2Q9Descriptor>&, plb::Box2D, plb::Box2D&, plb::BounceBack<double, plb::descriptors::D2Q9Descriptor>*)’
defineDynamics(lattice, lattice.getBoundingBox(),
obstacle, new plb::BounceBack<T,DESCRIPTOR>);

By inspecting the Palabos devel guide, I see that defineDynamics is defined only for objects of the type BlockLatticeXD or MultiBlockLatticeXD. Thus, I understand why the direct application of defineDynamics to a lattice of the MultiGridLattice2D type fails.

However, the Palabos users guide, at the Grid Refinement section, states that:

alabos simply generates for you three separate multi-blocks, each of which holds the data at a certain level of grid refinement.


Palabos then gathers the three multi-blocks into a single data structure (but, for convenience, you can still access them individually), called “multi-grid” structure

So it seems that the MultiGridLattice2D is a shortcut to parse the entire structure to domain functionals, instead of having to parse each underlying multiblock individually. I believe this is precisely the obstacle I reached.

With all this in mind, how to I correctly parse each sub-multiblock of a multigrid structure, as a MultiBlockLatticeXD object, to parse it to a domain functional that expects this kind of input? With this answered, how's the best way to, then, define an obstacle through the defineDynamics function?

Thanks in advance!