12#ifndef ACCURACY_TESTS_CIRCLE_HPP
13#define ACCURACY_TESTS_CIRCLE_HPP
27template <
typename po
int_type,
typename radius_type>
28bool inside_disk(point_type coords, radius_type radius,
double center_x=0,
double center_y=0)
30 const double EPSILON = std::numeric_limits<double>::epsilon();
31 const double X = coords.get(0), Y = coords.get(1);
32 return (X - center_x) * (X - center_x)
33 + (Y - center_y) * (Y - center_y)
34 <= radius * radius + EPSILON;
53template <
size_t Phi_0,
typename gr
id_type,
typename radius_type>
54void init_grid_with_disk(
grid_type &
grid, radius_type radius,
double center_x=0,
double center_y=0)
57 auto dom =
grid.getDomainIterator();
64 if (inside_disk(coords, radius, center_x, center_y))
66 grid.template get<Phi_0> (key) = 1;
70 grid.template get<Phi_0> (key) = -1;
This class implement the point shape in an N-dimensional space.
This is a distributed grid.