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

The tensorial transport benchmark by the discontinuous Galerkin method.

The tensorial 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], "tensor");
Float alpha = (argc > 3) ? atof(argv[3]) : 1;
Float nu = (argc > 4) ? atof(argv[4]) : 3;
Float t0 = (argc > 5) ? atof(argv[5]) : acos(-1.)/8;
Float a = 0;
trial sigma (Xh); test tau (Xh);
tensor ma = 0.5*((1-a)*grad_u - (1+a)*trans(grad_u));
auto beta_a = sigma*ma + trans(ma)*sigma;
form ah = integrate (ddot(grad_h(sigma)*u + beta_a + nu*sigma,tau))
+ integrate ("boundary",
max(0, -dot(u,normal()))*ddot(sigma,tau))
+ integrate ("internal_sides",
- dot(u,normal())*ddot(jump(sigma),average(tau))
+ 0.5*alpha*abs(dot(u,normal()))
*ddot(jump(sigma),jump(tau)));
field lh = integrate (ddot(chi(nu,t0),tau))
+ integrate ("boundary",
max(0, -dot(u,normal()))*ddot(sigma_g(nu,t0),tau));
field sigma_h(Xh);
problem p (ah);
p.solve (lh, sigma_h);
dout << catchmark("nu") << nu << endl
<< catchmark("t0") << t0 << endl
<< catchmark("sigma") << sigma_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 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 tensor page for the full documentation
see the test page for the full documentation
see the test page for the full documentation
sigma_exact sigma_g
int main()
Definition field2bb.cc:58
This file is part of Rheolef.
STL namespace.
rheolef - reference manual
Definition nu.h:26
Definition sphere.icc:25
Definition leveque.h:25
The tensorial transport benchmark – right-hand-side and exact solution.