In OpenFOAM, I can access the list of times of my simulation, as follows:
const auto& tlist = mesh.time().times(); //or runTime.times();
Just think of this in the context of a custom function object, where you want to access the list of times.
When I print that list:
Foam::Info << tlist << Foam::endl;
and then run the function object via postProcess
command, I get:
9
(
0 constant
0 0
0.001 0.001
0.002 0.002
0.003 0.003
0.004 0.004
0.005 0.005
0.006 0.006
0.007 0.007
)
End
I want to get rid of the first two elements from that list, i.e (0 constant)
and (0 0)
. But I can't find any method to do that, all what I found is that if the object is a HashTable, then there is an erase
method that removes the element by its key.
Any ideas how can I remove the first two elements from my list of times tlist
? or at least how can I convert that list to another data structure that will allow me to do that?
Thank you
Edit:
Here is a link to the definition of List in the context of OpenFOAM: https://cpp.openfoam.org/v9/classFoam_1_1List.html