8#ifndef OPENFPM_NUMERICS_SRC_PSE_KERNELS_HPP_
9#define OPENFPM_NUMERICS_SRC_PSE_KERNELS_HPP_
11#include <boost/math/constants/constants.hpp>
24template<
unsigned int dim,
typename T,
unsigned int ord=2,
unsigned int impl=KER_GAUSSIAN>
39 inline T
value(T (&x)[dim], T (&y)[dim])
41 std::cerr <<
"Error " << __FILE__ <<
":" << __LINE__ <<
" The laplacian for order:" << ord <<
" in dimension " << dim <<
" has not been implemented";
53 std::cerr <<
"Error " << __FILE__ <<
":" << __LINE__ <<
" The laplacian for order:" << ord <<
" in dimension " << dim <<
" has not been implemented";
65 std::cerr <<
"Error " << __FILE__ <<
":" << __LINE__ <<
" The laplacian for order:" << ord <<
" in dimension " << dim <<
" has not been implemented";
77 std::cerr <<
"Error " << __FILE__ <<
":" << __LINE__ <<
" The laplacian for order:" << ord <<
" in dimension " << dim <<
" has not been implemented";
97 inline T
value(T (&x)[1], T (&y)[1])
100 for (
size_t i = 0 ; i < 1 ; i++)
101 d += (x[i] - y[i]) * (x[i] - y[i]);
102 d = sqrt(d) / epsilon;
104 return T(4.0) / epsilon / boost::math::constants::root_pi<T>() * exp(-d*d);
116 for (
size_t i = 0 ; i < 1 ; i++)
117 d += (x[i] - y.get(i)) * (x[i] - y.get(i));
118 d = sqrt(d) / epsilon;
120 return T(4.0) / epsilon / boost::math::constants::root_pi<T>() * exp(-d*d);
132 for (
size_t i = 0 ; i < 1 ; i++)
133 d += (x.get(i) - y[i]) * (x.get(i) - y[i]);
134 d = sqrt(d) / epsilon;
136 return T(4.0) / epsilon / boost::math::constants::root_pi<T>() * exp(-d*d);
148 for (
size_t i = 0 ; i < 1 ; i++)
149 d += (x.get(i) - y.get(i)) * (x.get(i) - y.get(i));
150 d = sqrt(d) / epsilon;
152 return T(4.0) / epsilon / boost::math::constants::root_pi<T>() * exp(-d*d);
171 inline T
value(T (&x)[1], T (&y)[1])
174 for (
size_t i = 0 ; i < 1 ; i++)
175 d += (x[i] - y[i]) * (x[i] - y[i]);
176 d = sqrt(d) / epsilon;
178 return T(1.0) / epsilon / boost::math::constants::root_pi<T>() * exp(-d*d) * (-4.0*d*d+10.0);
190 for (
size_t i = 0 ; i < 1 ; i++)
191 d += (x[i] - y.get(i)) * (x[i] - y.get(i));
192 d = sqrt(d) / epsilon;
194 return T(1.0) / epsilon / boost::math::constants::root_pi<T>() * exp(-d*d) * (-4.0*d*d+10.0);
206 for (
size_t i = 0 ; i < 1 ; i++)
207 d += (x.get(i) - y[i]) * (x.get(i) - y[i]);
208 d = sqrt(d) / epsilon;
210 return T(1.0) / epsilon / boost::math::constants::root_pi<T>() * exp(-d*d) * (-4.0*d*d+10.0);
222 for (
size_t i = 0 ; i < 1 ; i++)
223 d += (x.get(i) - y.get(i)) * (x.get(i) - y.get(i));
224 d = sqrt(d) / epsilon;
226 return T(1.0) / epsilon / boost::math::constants::root_pi<T>() * exp(-d*d) * (-4.0*d*d+10.0);
245 inline T
value(T (&x)[1], T (&y)[1])
248 for (
size_t i = 0 ; i < 1 ; i++)
249 d += (x[i] - y[i]) * (x[i] - y[i]);
250 d = sqrt(d) / epsilon;
252 return T(1.0) / epsilon / boost::math::constants::root_pi<T>() * exp(-d*d) * (2.0*d*d*d*d-14.0*d*d+35.0/2.0);
264 for (
size_t i = 0 ; i < 1 ; i++)
265 d += (x[i] - y.get(i)) * (x[i] - y.get(i));
266 d = sqrt(d) / epsilon;
268 return T(1.0) / epsilon / boost::math::constants::root_pi<T>() * exp(-d*d) * (2.0*d*d*d*d-14.0*d*d+35.0/2.0);
280 for (
size_t i = 0 ; i < 1 ; i++)
281 d += (x.get(i) - y[i]) * (x.get(i) - y[i]);
282 d = sqrt(d) / epsilon;
284 return T(1.0) / epsilon / boost::math::constants::root_pi<T>() * exp(-d*d) * (2.0*d*d*d*d-14.0*d*d+35.0/2.0);
296 for (
size_t i = 0 ; i < 1 ; i++)
297 d += (x.get(i) - y.get(i)) * (x.get(i) - y.get(i));
298 d = sqrt(d) / epsilon;
300 return T(1.0) / epsilon / boost::math::constants::root_pi<T>() * exp(-d*d) * (2.0*d*d*d*d-14.0*d*d+35.0/2.0);
319 inline T
value(T (&x)[1], T (&y)[1])
322 for (
size_t i = 0 ; i < 1 ; i++)
323 d += (x[i] - y[i]) * (x[i] - y[i]);
324 d = sqrt(d) / epsilon;
326 return T(1.0) / epsilon / boost::math::constants::root_pi<T>() * exp(-d*d) * (-T(2.0)/T(3.0)*d*d*d*d*d*d+9.0*d*d*d*d-63.0/2.0*d*d+105.0/4.0);
338 for (
size_t i = 0 ; i < 1 ; i++)
339 d += (x[i] - y.get(i)) * (x[i] - y.get(i));
340 d = sqrt(d) / epsilon;
342 return T(1.0) / epsilon / boost::math::constants::root_pi<T>() * exp(-d*d) * (-T(2.0)/T(3.0)*d*d*d*d*d*d+9.0*d*d*d*d-63.0/2.0*d*d+105.0/4.0);
354 for (
size_t i = 0 ; i < 1 ; i++)
355 d += (x.get(i) - y[i]) * (x.get(i) - y[i]);
356 d = sqrt(d) / epsilon;
358 return T(1.0) / epsilon / boost::math::constants::root_pi<T>() * exp(-d*d) * (-T(2.0)/T(3.0)*d*d*d*d*d*d+9.0*d*d*d*d-63.0/2.0*d*d+105.0/4.0);
370 for (
size_t i = 0 ; i < 1 ; i++)
371 d += (x.get(i) - y.get(i)) * (x.get(i) - y.get(i));
372 d = sqrt(d) / epsilon;
374 return T(1.0) / epsilon / boost::math::constants::root_pi<T>() * exp(-d*d) * (-T(2.0)/T(3.0)*d*d*d*d*d*d+9.0*d*d*d*d-63.0/2.0*d*d+105.0/4.0);
This class implement the point shape in an N-dimensional space.
T value(const Point< 1, T > &x, const Point< 1, T > &y)
From a kernel centered in x, it give the value of the kernel in y.
T value(T(&x)[1], T(&y)[1])
From a kernel centered in x, it give the value of the kernel in y.
T value(const Point< 1, T > &x, T(&y)[1])
From a kernel centered in x, it give the value of the kernel in y.
T value(T(&x)[1], const Point< 1, T > &y)
From a kernel centered in x, it give the value of the kernel in y.
T value(T(&x)[1], const Point< 1, T > &y)
From a kernel centered in x, it give the value of the kernel in y.
T value(const Point< 1, T > &x, const Point< 1, T > &y)
From a kernel centered in x, it give the value of the kernel in y.
T value(T(&x)[1], T(&y)[1])
From a kernel centered in x, it give the value of the kernel in y.
T value(const Point< 1, T > &x, T(&y)[1])
From a kernel centered in x, it give the value of the kernel in y.
T value(T(&x)[1], const Point< 1, T > &y)
From a kernel centered in x, it give the value of the kernel in y.
T value(T(&x)[1], T(&y)[1])
From a kernel centered in x, it give the value of the kernel in y.
T value(const Point< 1, T > &x, T(&y)[1])
From a kernel centered in x, it give the value of the kernel in y.
T value(const Point< 1, T > &x, const Point< 1, T > &y)
From a kernel centered in x, it give the value of the kernel in y.
T value(const Point< 1, T > &x, const Point< 1, T > &y)
From a kernel centered in x, it give the value of the kernel in y.
T value(T(&x)[1], T(&y)[1])
From a kernel centered in x, it give the value of the kernel in y.
T value(T(&x)[1], const Point< 1, T > &y)
From a kernel centered in x, it give the value of the kernel in y.
T value(const Point< 1, T > &x, T(&y)[1])
From a kernel centered in x, it give the value of the kernel in y.
Implementation of the Laplacian kernels for PSE.
T value(const Point< dim, T > &x, const Point< dim, T > &y)
From a kernel centered in x, it give the value of the kernel in y.
T value(T(&x)[dim], const Point< dim, T > &y)
From a kernel centered in x, it give the value of the kernel in y.
T value(const Point< dim, T > &x, T(&y)[dim])
From a kernel centered in x, it give the value of the kernel in y.
T value(T(&x)[dim], T(&y)[dim])
From a kernel centered in x, it give the value of the kernel in y.