44#include "MR_rect_tree.hpp"
45#include "MR_cell_cplx.hpp"
46#include "MR_rt_to_cc.hpp"
49typedef mjr::tree15b2d1rT tt_t;
50typedef mjr::MRccT5 cc_t;
51typedef mjr::MR_rt_to_cc<tt_t, cc_t> tc_t;
55tt_t::rrpt_t hover_circle(tt_t::drpt_t xvec) {
56 return (xvec[0] * xvec[0] + xvec[1] * xvec[1] < 1);
60tt_t::src_t unit_circle_sdf(tt_t::drpt_t xvec) {
61 double m = xvec[0] * xvec[0] + xvec[1] * xvec[1];
67 tt_t tree({-1.5, -1.5},
72 tree.refine_grid(5, hover_circle);
75 tree.refine_leaves_recursive_cell_pred(7, hover_circle, [&tree](
int i) {
return (tree.cell_cross_sdf(i, unit_circle_sdf)); });
78 tree.balance_tree(1, hover_circle);
84 tc_t::construct_geometry_fans(ccplx,
87 {{tc_t::val_src_spc_t::FDOMAIN, 0},
88 {tc_t::val_src_spc_t::FDOMAIN, 1},
89 {tc_t::val_src_spc_t::FRANGE, 0}});
92 ccplx.create_named_datasets({
"x",
"y",
"f(x,y)"});
98 tc_t::cull_cc_cells_on_domain_sdf_boundry(ccplx, unit_circle_sdf);
110 ccplx.write_xml_vtk(
"surface_plot_step.vtu",
"surface_plot_step");