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

#9046
Danial.Khazaeipoul
Participant

Thank you very much for the details, I managed to successfully modify the neighboring cells data using the method you mentioned.

Further in the code, I need to store the neighboring cells of a cell in a container for further processing, if a certain condition is met. I have tried the following approach with no luck. While the it compiles and runs, the value of “FreeSurface::TEST_FIELD” remains unchanged for that specific cell, although “setField” is called. Here is the simplified code to demonstrate the idea:

template <typename CELL, typename T>
void runTest(CELL& cell, const std::uint16_t& seed)
{
std::queue<CELL*> queued_;
queued_.push(&cell);
CELL* iCellPtr = queued_.front();
iCellPtr->template setField<FreeSurface::TEST_FIELD>(seed);
queued_.pop();
}

FYI, the following version works. However, I need a way to store the cells in a container for the algorithm that I am trying to implement.

template <typename CELL, typename T>
void runTest(CELL& cell, const std::uint16_t& seed)
{
cell.template setField<FreeSurface::TEST_FIELD>(seed);
}