an efficient C++ finite element environment
|
|
The Leveque benchmark by discontinuous Galerkin method
int main(
int argc,
char**argv) {
space Xh (omega, argv[2]);
size_t n_max = (argc > 3) ? atoi(argv[3]) : 1000;
size_t strip = (argc > 4) ? string(argv[4]) == "true" : false;
size_t p = (argc > 5) ? atoi(argv[5]) : min(Xh.degree()+1,
bdf::pmax);
size_t d = omega.dimension();
vector<field> phi_h (
p+1);
dout << event (0, phi_h[0]);
for (
size_t n = 1;
n <= n_max;
n++) {
if (
n % 10 == 0)
derr <<
"[" <<
n <<
"]";
for (size_t i = 1; i <= pn; i++)
check_macro (phi_h[0].
max_abs() < 100,
"BDF failed -- HINT: decrease delta_t");
if (!strip ||
n == n_max)
dout << event (t, phi_h[0]);
for (
size_t i = min(
p,pn+1); i >= 1; i--)
phi_h[i] = phi_h[i-1];
}
}
Float alpha[pmax+1][pmax+1]
rheolef::std enable_if ::type dot const Expr1 expr1, const Expr2 expr2 dot(const Expr1 &expr1, const Expr2 &expr2)
dot(x,y): see the expression page for the full documentation
see the field page for the full documentation
details::field_expr_v2_nonlinear_terminal_function< details::normal_pseudo_function< Float > > normal()
normal: see the expression page for the full documentation
std::enable_if< details::is_field_expr_v2_nonlinear_arg< Expr >::value &&! is_undeterminated< Result >::value, Result >::type integrate(const geo_basic< T, M > &omega, const Expr &expr, const integrate_option &iopt, Result dummy=Result())
see the integrate page for the full documentation
BDF(p) backward differentiation formula – coefficients.
Float phi(const point &nu, Float a, Float b)
see the space page for the full documentation
rheolef - reference manual
field_basic< T, M > interpolate(const space_basic< T, M > &V2h, const field_basic< T, M > &u1h)
see the interpolate page for the full documentation
int main(int argc, char **argv)
see the environment page for the full documentation
field lh(Float epsilon, Float t, const test &v)
This file is part of Rheolef.
see the test page for the full documentation
see the problem page for the full documentation
odiststream derr(cerr)
see the diststream page for the full documentation
see the Float page for the full documentation
see the branch page for the full documentation
The Leveque benchmark – function definition.
std::enable_if< details::is_field_convertible< Expr >::value,details::field_expr_v2_nonlinear_terminal_field< typename Expr::scalar_type,typename Expr::memory_type,details::differentiate_option::gradient >>::type grad_h(const Expr &expr)
grad_h(uh): see the expression page for the full documentation
see the test page for the full documentation
odiststream dout(cout)
see the diststream page for the full documentation
see the geo page for the full documentation