Rheolef  7.2
an efficient C++ finite element environment
heat.cc
Go to the documentation of this file.
1
25#include "rheolef.h"
26using namespace rheolef;
27using namespace std;
28int main (int argc, char **argv) {
29 environment rheolef (argc, argv);
30 geo omega (argv[1]);
31 size_t n_max = (argc > 2) ? atoi(argv[2]) : 100;
32 Float delta_t = 0.5/n_max;
33 space Xh (omega, "P1");
34 Xh.block ("boundary");
35 trial u (Xh); test v (Xh);
36 form a = integrate (u*v + delta_t*dot(grad(u),grad(v)));
37 problem p (a);
38 field uh (Xh, 0);
39 branch event ("t","u");
40 dout << event (0, uh);
41 for (size_t n = 1; n <= n_max; n++) {
42 field rhs = uh + delta_t;
43 field lh = integrate (rhs*v);
44 p.solve (lh, uh);
45 dout << event (n*delta_t, uh);
46 }
47}
field lh(Float epsilon, Float t, const test &v)
see the Float page for the full documentation
see the branch page for the full documentation
see the field page for the full documentation
see the form page for the full documentation
see the geo page for the full documentation
see the problem page for the full documentation
see the environment page for the full documentation
Definition: environment.h:121
see the space page for the full documentation
see the test page for the full documentation
see the test page for the full documentation
point u(const point &x)
int main(int argc, char **argv)
Definition: heat.cc:28
rheolef::details::is_vec dot
This file is part of Rheolef.
std::enable_if< details::has_field_rdof_interface< Expr >::value, details::field_expr_v2_nonlinear_terminal_field< typenameExpr::scalar_type, typenameExpr::memory_type, details::differentiate_option::gradient > >::type grad(const Expr &expr)
grad(uh): 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
Definition: integrate.h:211
STL namespace.
rheolef - reference manual
Definition: sphere.icc:25
Definition: leveque.h:25