41#include "MR_rect_tree.hpp"
42#include "MR_cell_cplx.hpp"
43#include "MR_rt_to_cc.hpp"
47typedef mjr::tree15b2d4rT tt_t;
48typedef mjr::MRccT5 cc_t;
49typedef mjr::MR_rt_to_cc<tt_t, cc_t> tc_t;
50typedef mjr::color3c64F ct_t;
53tt_t::rrpt_t damp_cos_wave(tt_t::drpt_t xvec) {
57 double z = std::exp(-d/4)*std::cos(4*std::sqrt(d));
58 ct_t c = ct_t::csPLYviridis::c((z+0.87)/1.87);
59 return {z, c.getRed(), c.getGreen(), c.getBlue()};
65 tt_t tree({-2.1, -2.1},
69 tree.refine_grid(7, damp_cos_wave);
71 tc_t::construct_geometry_fans(ccplx,
74 {{tc_t::val_src_spc_t::FDOMAIN, 0},
75 {tc_t::val_src_spc_t::FDOMAIN, 1},
76 {tc_t::val_src_spc_t::FRANGE, 0}});
77 ccplx.create_named_datasets({
"x",
"y",
"f(x,y)",
"c_r(x,y)",
"c_g(x,y)",
"c_b(x,y)"},
78 {{
"COLORS", {3, 4, 5}}});
80 ccplx.write_xml_vtk(
"hello_MRaster.vtu",
"hello_MRaster");