/** \return pointer on the Grid containing the Vorticity */ const Grid* Compute::GetVorticity() { // TODO: test Grid* res = new Grid(_geom); InteriorIterator it(_geom); it.First(); while (it.Valid()){ // here, we use central difference quotients res->Cell(it) = _v->dx_c(it) - _u->dy_c(it); it.Next(); } return res; }
/** The absolute velocity in the euklidean norm is calculted at the middle point of the physical grid cells \return pointer on the Grid containing absolute velocity */ const Grid* Compute::GetVelocity() { // TODO: test Grid* res = new Grid(_geom,multi_real_t(-0.5,-0.5)); Iterator it(_geom); it.First(); while (it.Valid()){ res->Cell(it) = sqrt(pow(0.5*(_u->Cell(it)+_u->Cell(it.Left())),2.0)+pow(0.5*(_v->Cell(it)+_v->Cell(it.Down())),2.0)); it.Next(); } res->CheckNaN(); return res; }