42#include "MR_rect_tree.hpp"
43#include "MR_cell_cplx.hpp"
44#include "MR_rt_to_cc.hpp"
47typedef mjr::tree15b3d1rT tt_t;
48typedef mjr::MRccT5 cc_t;
49typedef mjr::MR_rt_to_cc<tt_t, cc_t> tc_t;
52tt_t::rrpt_t isf(tt_t::drpt_t xvec) {
56 return x*x*y+y*y*x-z*z*z-1;
61 tt_t tree({-2.3, -2.3, -2.3},
66 tree.refine_grid(4, isf);
69 tree.refine_leaves_recursive_cell_pred(6, isf, [&tree](tt_t::diti_t i) {
return (tree.cell_cross_sdf(i, isf)); });
74 tc_t::construct_geometry_rects(ccplx,
76 tree.get_leaf_cells_pred(tree.ccc_get_top_cell(), [&tree](tt_t::diti_t i) { return (tree.cell_cross_sdf(i, isf)); }),
78 {{tc_t::val_src_spc_t::FDOMAIN, 0},
79 {tc_t::val_src_spc_t::FDOMAIN, 1},
80 {tc_t::val_src_spc_t::FDOMAIN, 2}});
83 ccplx.create_named_datasets({
"x",
"y",
"z",
"f(x,y,z)"});
89 ccplx.write_xml_vtk(
"implicit_surface.vtu",
"implicit_surface");