an efficient C++ finite element environment
|
|
The Navier-Stokes equations on the driven cavity benchmark with the method of characteristics
int main (
int argc,
char**argv) {
if (argc < 2) {
cerr << "usage: " << argv[0] << " <geo> <Re> <err> <n_adapt>" << endl;
exit (1);
}
Float Re = (argc > 2) ? atof(argv[2]) : 100;
options.
err = (argc > 3) ? atof(argv[3]) : 1e-2;
size_t n_adapt = (argc > 4) ? atoi(argv[4]) : 5;
for (size_t i = 0; true; i++) {
size_t max_iter = 1000;
if (i >= n_adapt) break;
omega =
adapt (ch, options);
o.
open (omega.name(),
"geo");
o << omega;
Qh =
space (omega,
"P1");
}
}
void open(std::string filename, std::string suffix="", io::mode_type mode=io::out, const communicator &comm=communicator())
This routine opens a physical output file.
int main(int argc, char **argv)
geo_basic< T, M > adapt(const field_basic< T, M > &uh, const adapt_option &opts)
adapt(uh,opts): see the adapt page for the full documentation
see the catchmark page for the full documentation
see the field page for the full documentation
field_basic< Float > field
see the field page for the full documentation
adapt_option: see the adapt page for the full documentation
see the space page for the full documentation
rheolef - reference manual
int navier_stokes_solve(Float Re, Float delta_t, field l0h, field &uh, field &ph, size_t &max_iter, Float &tol, odiststream *p_derr=0)
space_basic< Float > space
see the environment page for the full documentation
The Navier-Stokes equations – adaptive mesh criterion.
This file is part of Rheolef.
The Navier-Stokes equations with the method of characteristics – solver function.
odiststream derr(cerr)
see the diststream page for the full documentation
odiststream: see the diststream page for the full documentation
see the Float page for the full documentation
The driven cavity benchmark: 2D boundary conditions.
static space velocity_space(const geo &omega, string approx)
static field velocity_field(const space &Xh, Float alpha=1)
field navier_stokes_criterion(Float Re, const field &uh)
see the geo page for the full documentation