Data extraction

dear all!

I add this commands for data extraction in ComputeDrag.cpp

but in Drag.dat only last drag coeff. has been printed.

    if (iT%parameters.nStep(logT)==0) {
              << "; drag=" << lattice.getInternalStatistics().getSum(forceIds[0])
              << "; lift=" << lattice.getInternalStatistics().getSum(forceIds[1])
              << endl;
    if (iT%parameters.nStep(logT)==0) {
xfl_ofstream ofile("Drag.dat");
ofile << setprecision(10) << lattice.getInternalStatistics().getSum(forceIds[0]) 
          << endl;

can any one help me?


you recreate each time your Drag.dat file. You should put the xfl_ofstream ofile(“Drag.dat”); line out of the time loop.


thanks a lot Orestis!

I do it, But i can not save drag in each iteration.

when i put it before " delete boundaryCondition; ", There have not been any results in folder (Drag. dat has not created)!

time loop is " // Main loop over time iterations. " ?

could you explain to me a bit more?