Rheolef  7.2
an efficient C++ finite element environment
 
Loading...
Searching...
No Matches
level_set_sphere_check.cc
Go to the documentation of this file.
1
21#include "rheolef.h"
22using namespace rheolef;
23using namespace std;
24#include "sphere.icc"
25int 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}
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 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.
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
The level set function for the sphere geometry.
Definition leveque.h:25