Rheolef  7.1
an efficient C++ finite element environment
level_set_sphere_check.cc
Go to the documentation of this file.
1 #include "rheolef.h"
22 using namespace rheolef;
23 using namespace std;
24 #include "sphere.icc"
25 int main (int argc, char**argv) {
26  environment rheolef (argc,argv);
27  Float tol = (argc > 1) ? atof(argv[1]) : 1e+38;
28  geo gamma_h;
29  din >> gamma_h;
30  space Wh (gamma_h, "P1");
31  trial u (Wh); test v (Wh);
32  form m = integrate (u*v);
33  field one (Wh, 1);
34  Float meas_gamma_h = m(one,one);
35  size_t d = gamma_h.dimension();
36  Float pi = acos(Float(-1));
37  Float meas_gamma = (d == 3) ? 4*pi : 2*pi;
38  Float err = fabs(meas_gamma - meas_gamma_h);
39  dout << "meas(gamma_h) = " << meas_gamma_h << endl
40  << "meas(gamma) = " << meas_gamma << endl
41  << "err = " << err << endl;
42  return (err < tol) ? 0 : 1;
43 }
main
int main(int argc, char **argv)
Definition: level_set_sphere_check.cc:25
form
see the form page for the full documentation
field
see the field page for the full documentation
rheolef::integrate
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:202
space
see the space page for the full documentation
rheolef.h
rheolef - reference manual
sphere.icc
The level set function for the sphere geometry.
rheolef::din
idiststream din
see the diststream page for the full documentation
Definition: diststream.h:427
rheolef::environment
see the environment page for the full documentation
Definition: environment.h:115
mkgeo_sector.m
m
Definition: mkgeo_sector.sh:118
rheolef
This file is part of Rheolef.
Definition: compiler_eigen.h:37
test
see the test page for the full documentation
u
Definition: leveque.h:25
Float
see the Float page for the full documentation
mkgeo_ball.d
d
Definition: mkgeo_ball.sh:154
u
Float u(const point &x)
Definition: transmission_error.cc:26
trial
see the test page for the full documentation
rheolef::Float
double Float
see the Float page for the full documentation
Definition: Float.h:143
rheolef::dout
odiststream dout(cout)
see the diststream page for the full documentation
Definition: diststream.h:430
rheolef::std
Definition: vec_expr_v2.h:391
geo
see the geo page for the full documentation