Skip to content

Reply To: Modifying field values for neighboring cells inside a postprocessor

OpenLB – Open Source Lattice Boltzmann Code Forums on OpenLB General Topics Modifying field values for neighboring cells inside a postprocessor Reply To: Modifying field values for neighboring cells inside a postprocessor

#9474
Danial.Khazaeipoul
Participant

Hello Adrian,

Is my understanding correct regarding the use of a block-specific parameter passed to an operator? Suppose I have an offset vector, synchronized across all processors, which records the number of cells in each preceding block, shown below.

struct CELL_COUNT : public descriptors::TYPED_FIELD_BASE<std::size_t,1> { };
std::vector<std::size_t> offset(_sLattice.getCuboidGeometry().getNc(), 0);

The size of the offset vector matches the number of global cuboids. For a domain with 4 blocks, the resulting offset vector might look like {0, 431433, 855297, 1279161}, as an example. Given this setup, will the following method yield the expected results for the CELL_COUNT, as shown in the image?

for (int iC = 0; iC < _sLattice.getLoadBalancer().size(); ++iC)
{
  auto& block = _sLattice.getBlock(iC);
  block.template setParameter<FreeSurface::CELL_COUNT>(offset[_sLattice.getLoadBalancer().glob(iC)]);
}

Please note that the image is only for demonstration purposes. When an operator processes a cell, will calling the parameter use the correct value of CELL_COUNT based on the block in which the cell resides?