1
field navier_stokes_criterion (Float Re, const field& uh) {
2
space Xh (uh.get_geo(), "P1d", "vector");
3
form mpt (uh.get_space(), Xh, "mass");
4
form inv_m (Xh, Xh, "inv_mass");
5
field c1 = norm2(inv_m*(mpt*uh));
6
space Th (uh.get_geo(), "P1d", "tensor");
7
form two_D (uh.get_space(), Th, "2D");
8
form inv_mt (Th, Th, "inv_mass");
9
field two_Duh = inv_mt*(two_D*uh);
10
field c2 = norm2(two_Duh);
11
return sqrt(Re*c1 + c2);