45#include "MR_rect_tree.hpp"
46#include "MR_cell_cplx.hpp"
47#include "MR_rt_to_cc.hpp"
50typedef mjr::tree15b2d1rT tt_t;
51typedef mjr::MRccT5 cc_t;
52typedef mjr::MR_rt_to_cc<tt_t, cc_t> tc_t;
55tt_t::rrpt_t half_sphere(tt_t::drpt_t xvec) {
56 double m = xvec[0] * xvec[0] + xvec[1] * xvec[1];
58 return std::numeric_limits<double>::quiet_NaN();
60 return std::sqrt(1-m);
66 tt_t tree({-1.2, -1.2},
71 tree.refine_grid(5, half_sphere);
74 tree.refine_recursive_if_cell_vertex_is_nan(6, half_sphere);
79 tc_t::construct_geometry_fans(ccplx,
82 {{tc_t::val_src_spc_t::FDOMAIN, 0},
83 {tc_t::val_src_spc_t::FDOMAIN, 1},
84 {tc_t::val_src_spc_t::FRANGE, 0}},
88 ccplx.create_named_datasets({
"x",
"y",
"f(x,y)"},
89 {{
"NORMALS", {0, 1, 2}}});
92 ccplx.mirror({0, 0, 1});
96 ccplx.write_xml_vtk(
"surface_branch_glue.vtu",
"surface_branch_glue");
97 ccplx.write_legacy_vtk(
"surface_branch_glue.vtk",
"surface_branch_glue");
98 ccplx.write_ply(
"surface_branch_glue.ply",
"surface_branch_glue");