#6547
Mathis
Participant

Dear Stephan,

So I managed to extract components from the instance of SuperLatticeTimeAveragedF3D using the method SuperExtractComponentF3D, which extracts one component at a time. By doing this for each component of the velocity (three in 3D), I managed to generate three distinct outputs for each time-averaged velocity component with the following lines of code before the time loop in the main() function :

// definition of turbulent statistics objects
SuperLatticePhysVelocity3D<T, DESCRIPTOR> sVel( sLattice, converter );
SuperLatticeTimeAveragedF3D<T> sAveragedVel( sVel );
SuperExtractComponentF3D<T,T> uAvgVel( sAveragedVel, 0);
SuperExtractComponentF3D<T,T> vAvgVel( sAveragedVel, 1);
SuperExtractComponentF3D<T,T> wAvgVel( sAveragedVel, 2);
uAvgVel.getName() = “physVelU”;
vAvgVel.getName() = “physVelV”;
wAvgVel.getName() = “physVelW”;
// x vel component
BlockReduction3D2D<T> planeReduction_u(uAvgVel, Hyperplane3D<T>().originAt({0,0,3.5}).normalTo({0,0,1}), 0, BlockDataSyncMode::ReduceOnly);
// y vel component
BlockReduction3D2D<T> planeReduction_v(vAvgVel, Hyperplane3D<T>().originAt({0,0,3.5}).normalTo({0,0,1}), 0, BlockDataSyncMode::ReduceOnly);
// z vel component
BlockReduction3D2D<T> planeReduction_w(wAvgVel, Hyperplane3D<T>().originAt({0,0,3.5}).normalTo({0,0,1}), 0, BlockDataSyncMode::ReduceOnly);

along with the update lines on the function getResults :

// Writes the ppm files
if ( iT%vtkIter==0 ) {
planeReduction_u.update();
planeReduction_v.update();
planeReduction_w.update();
// write output as JPEG
heatmap::write(planeReduction_u, iT);
heatmap::write(planeReduction_v, iT);
heatmap::write(planeReduction_w, iT);
}

In the end I did not use the SuperEukildNorm3D because if I input uAvgVel for instance, it outputs a segmentation error (there is no need to apply a norm to each component separately anyway, but I mention this segFault for your information)

A more optimal way to proceed would be to find a way to directly create a SuperLatticeF3D functor (with dimension 3) from the SuperLatticeTimeAveragedF3D (which has dimension 6, with 3 time-avg vel components + 3 RMS values) with the components of interest, and to give it to SupeEuklidNorm3D, but I did not find any way to do so.

If you have any clue, feel free to let me know, I would be interested to use it, although the solution I described above appears to meet my original goal.

Thank you very much
Best regards

Mathis