110#include "Draw/DrawDisk.hpp"
126int main(
int argc,
char* argv[])
128 typedef double phi_type;
130 openfpm_init(&argc, &argv);
134 const std::string path_output = cwd +
"/output_disk";
155 const unsigned int grid_dim = 2;
160 const size_t Phi_0_grid = 0;
161 const size_t Phi_SDF_grid = 1;
184 size_t sz[grid_dim] = {128, 128};
189 grid_in_type g_dist(sz, box, ghost);
190 g_dist.setPropNames({
"Phi_0",
"Phi_SDF"});
214 phi_type radius = 1.0;
215 init_grid_with_disk<Phi_0_grid>(g_dist, radius, 2.5, 2.5);
217 g_dist.write(path_output +
"/grid_disk_preRedistancing_radius" + std::to_string((
int)radius) , FORMAT_BINARY);
262 redist_options.min_iter = 1e3;
263 redist_options.max_iter = 1e4;
265 redist_options.convTolChange.value = 1e-7;
266 redist_options.convTolChange.check =
true;
267 redist_options.convTolResidual.value = 1e-6;
268 redist_options.convTolResidual.check =
false;
270 redist_options.interval_check_convergence = 1e3;
271 redist_options.width_NB_in_grid_points = 10;
272 redist_options.print_current_iterChangeResidual =
true;
273 redist_options.print_steadyState_iter =
true;
274 redist_options.save_temp_grid =
true;
303 redist_obj.run_redistancing<Phi_0_grid, Phi_SDF_grid>();
305 g_dist.write(path_output +
"/grid_disk_postRedistancing", FORMAT_BINARY);
306 g_dist.save(path_output +
"/grid_disk_postRedistancing" +
".bin");
326 size_t bc[grid_dim] = {PERIODIC, PERIODIC};
334 vd_type vd_narrow_band(0, box, bc, ghost_vd);
335 vd_narrow_band.setPropNames({
"Phi_SDF",
"Phi_grad",
"Phi_magnOfGrad"});
357 size_t thickness_of_narrowBand_in_grid_points = 6;
376 const size_t Phi_SDF_vd = 0;
377 const size_t Phi_grad_vd = 1;
378 const size_t Phi_magnOfGrad_vd = 2;
411 narrowBand.get_narrow_band<Phi_SDF_grid, Phi_SDF_vd, Phi_grad_vd, Phi_magnOfGrad_vd>(g_dist, vd_narrow_band);
413 vd_narrow_band.write(path_output +
"/vd_narrow_band_disk", FORMAT_BINARY);
414 vd_narrow_band.save(path_output +
"/vd_narrow_band_disk.bin");
Class for getting the narrow band around the interface.
Header file containing functions for creating files and folders.
static void create_directory_if_not_exist(std::string path, bool silent=0)
Creates a directory if not already existent.
static std::string get_cwd()
Gets the current working directory and returns path as string.
Class for reinitializing a level-set function into a signed distance function using Sussman redistanc...
This class represent an N-dimensional box.
Class for getting the narrow band around the interface.
Class for reinitializing a level-set function into a signed distance function using Sussman redistanc...
This is a distributed grid.
Structure to bundle options for redistancing.
aggregate of properties, from a list of object if create a struct that follow the OPENFPM native stru...