Rheolef  7.2
an efficient C++ finite element environment
 
Loading...
Searching...
No Matches
transport_dg.cc

The transport benchmark by the discontinuous Galerkin method.

The transport benchmark by the discontinuous Galerkin method

#include "rheolef.h"
using namespace rheolef;
using namespace std;
int main(int argc, char**argv) {
environment rheolef (argc, argv);
geo omega (argv[1]);
space Xh (omega, argv[2]);
Float alpha = (argc > 3) ? atof(argv[3]) : 1;
Float sigma = (argc > 4) ? atof(argv[4]) : 3;
point u (1,0,0);
trial phi (Xh); test psi (Xh);
form ah = integrate (dot(u,grad_h(phi))*psi + sigma*phi*psi)
+ integrate ("boundary", max(0., -dot(u,normal()))*phi*psi)
+ integrate ("internal_sides",
- dot(u,normal())*jump(phi)*average(psi)
+ 0.5*alpha*abs(dot(u,normal()))*jump(phi)*jump(psi));
field lh = integrate ("boundary", max(0, -dot(u,normal()))*psi);
field phi_h(Xh);
problem p (ah);
p.solve (lh, phi_h);
dout << catchmark("sigma") << sigma << endl
<< catchmark("phi") << phi_h;
}
field lh(Float epsilon, Float t, const test &v)
see the Float 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 point page for the full documentation
see the problem page for the full documentation
see the catchmark page for the full documentation
Definition catchmark.h:67
see the environment page for the full documentation
see the space page for the full documentation
see the test page for the full documentation
see the test page for the full documentation
int main()
Definition field2bb.cc:58
This file is part of Rheolef.
STL namespace.
rheolef - reference manual
Definition sphere.icc:25
Definition phi.h:25
Definition leveque.h:25