2 #include "../../misc/utils.hpp" 3 #include "../../misc/lazy_list.hpp" 8 assert(cfl_<1 &&
"cfl number must be smaller than 1");
13 class TimeStepBoundCalculator:
public LazyList<double>
18 const vector<ComputationalCell>& cells,
20 tess_(tess), cells_(cells), eos_(eos) {}
22 size_t size(
void)
const 29 return tess_.GetWidth(i)/
30 (
abs(cells_[i].velocity)+
31 eos_.dp2c(cells_[i].density,cells_[i].pressure));
36 const vector<ComputationalCell>& cells_;
41 double CourantFriedrichsLewy::operator()
43 const vector<ComputationalCell>& cells,
46 return cfl_*
lazy_min(TimeStepBoundCalculator(tess,cells,eos));
T lazy_min(const LazyList< T > &i2m)
Finds the minimum of a lazy list.
Abstract class for tessellation in 3D.
Ordered list whose terms are evaluated lazily.
virtual double operator[](const size_t i) const=0
Returns a single member of the list.
Base class for equation of state.
CourantFriedrichsLewy(double cfl)
Class constructor.
Calculates the time step according to the CFL criterion.
double abs(Vector3D const &v)
Norm of a vector.
virtual size_t size(void) const=0
Returns the length of the list.