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