5#ifndef OPENFPM_NUMERICS_HELPFUNCTIONSFORTESTINGNBCS_HPP
6#define OPENFPM_NUMERICS_HELPFUNCTIONSFORTESTINGNBCS_HPP
11template <
size_t Phi_SDF_grid,
size_t Phi_SDF,
size_t dPhi,
size_t dPhi_magn,
typename grid_in_type,
typename
13void get_diffusion_domain(grid_in_type & g_dist, vd_in_type & vd,
const double b_low,
const double b_up)
15 const double EPSILON = std::numeric_limits<double>::epsilon();
16 const double _b_low = b_low + EPSILON;
17 const double _b_up = b_up - EPSILON;
19 narrowBand.template get_narrow_band<Phi_SDF_grid, Phi_SDF, dPhi, dPhi_magn>(g_dist, vd);
28template <
size_t Phi_SDF,
typename vd_type>
33 const double EPSILON = std::numeric_limits<double>::epsilon();
34 auto dom = vd.getDomainIterator();
38 if (vd.template getProp<Phi_SDF>(key) >= b_low + EPSILON && vd.template getProp<Phi_SDF>(key) <= b_up + EPSILON)
47template <
size_t R,
size_t U,
typename vd_type>
48void get_IC_Eq28(vd_type &vd,
const double a)
50 auto dom = vd.getDomainIterator();
54 double r = vd.template getProp<R>(key);
55 if (abs(r) < a) vd.template getProp<U>(key) = cos(M_PI * r / (2*a)) * cos(M_PI * r / (2*a));
56 else vd.template getProp<U>(key) = 0;
61template <
size_t R,
size_t U,
typename vd_type>
64 for (
int i = 0; i < pids.size(); i++)
66 auto key = pids.get<0>(i);
67 double r = vd.template getProp<R>(key);
68 if (abs(r) < a) vd.template getProp<U>(key) = cos(M_PI * r / (2*a)) * cos(M_PI * r / (2*a));
69 else vd.template getProp<U>(key) = 0;
73template <
size_t U,
typename vd_type>
74void get_FS_Eq29(vd_type &vd,
const double a,
const double R_disk)
76 const double R = R_disk;
78 if (a < R) A = M_PI * a*a/2 - 2*R*R/M_PI;
79 if (a >= R) A = M_PI * R*R/2 + a*a*( cos(M_PI * R / a) -1 ) / M_PI + a * R * sin(M_PI * R / a);
84 std::cout <<
"Analytical steady state concentration = " << A / (M_PI * R*R) << std::endl;
Class for getting the narrow band around the interface.
Class for getting the narrow band around the interface.
Implementation of 1-D std::vector like structure.
aggregate of properties, from a list of object if create a struct that follow the OPENFPM native stru...