Skip to content

Reply To: Printing velocity data

#4856
Adrian
Keymaster

Indeed, I mistook BlockData2D for the functor BlockDataF2D when looking up the available methods for BlockReduction2D2D.

You can use the operator:


SuperLatticePhysVelocity2D<T,DESCRIPTOR> velocityF(sLattice, converter);
BlockReduction2D2D<T> velocityPlane(velocityF, 600, BlockDataSyncMode::ReduceOnly);
int latticeR[2] { };
for (latticeR[0]=0; latticeR[0] < velocityPlane.getBlockStructure().getNx(); ++latticeR[0]) {
  for (latticeR[1]=0; latticeR[1] < velocityPlane.getBlockStructure().getNy(); ++latticeR[1]) {
    T vel[2] { };
    velocityPlane(vel, latticeR);
    myfile << latticeR[0] << " " << latticeR[1] << " "
           << std::setprecision(9)
           << vel[0] << " "
           << vel[1] << std::endl;  
  }
}