/usr/share/doc/rheolef-doc/examples/navier_stokes_cavity_newton_dg.cc is in rheolef-doc 6.7-6.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 | #include "rheolef.h"
using namespace rheolef;
using namespace std;
#include "cavity_dg.icc"
#include "stokes_dirichlet_dg.icc"
#include "inertia.icc"
#include "navier_stokes_dg.h"
int main(int argc, char**argv) {
environment rheolef (argc, argv);
Float eps = numeric_limits<Float>::epsilon();
geo omega (argv[1]);
string approx = (argc > 2) ? argv[2] : "P1d";
Float Re = (argc > 3) ? atof(argv[3]) : 100;
Float tol = (argc > 4) ? atof(argv[4]) : eps;
size_t max_iter = (argc > 5) ? atoi(argv[5]) : 100;
string restart = (argc > 6) ? argv[6] : "";
navier_stokes_dg F (Re, omega, approx);
navier_stokes_dg::value_type xh = F.initial (restart);
int status = damped_newton (F, xh, tol, max_iter, &derr);
dout << catchmark("Re") << Re << endl
<< catchmark("u") << xh[0]
<< catchmark("p") << xh[1];
return status;
}
|