7 template<
typename Real>
34 template<
typename Real>
74 if (q > 1.0f)
return 0.0f;
77 const Real hh = h * h;
78 return 15.0f / ((
Real)
M_PI * hh * h) * d * d * d * scale;
85 if (q > 1.0f)
return 0.0;
89 const Real hh = h * h;
90 return -45.0f / ((
Real)
M_PI * hh*hh) *d*d * scale;
97 if (q > 1.0f)
return 0.0f;
99 const Real qq = q * q;
100 const Real hh = h * h;
101 return -15.0f / ((
Real)
M_PI * hh) * (q -
Real(1.5) * qq + q * qq -
Real(0.25) * qq * qq -
Real(0.25)) * scale;
106 template<
typename Real>
125 template<
typename Real>
157 const Real q = r / h;
158 if (q > 1.0f)
return 0.0f;
160 return scale * (1.0f - q * q);
166 const Real q = r / h;
169 const Real hh = h * h;
171 const Real alpha = 1.0f;
172 return -alpha * dd* scale;
178 const Real q = r / h;
181 const Real hh = h * h;
182 return 1.0 / (hh * h) * (
Real(2) / 3 - q + q * q /
Real(3));
189 template<
typename Real>
198 const Real q = r / h;
200 return q*q*q*kernSmooth.
Weight(r, h);
205 const Real q = r / h;
207 return q*q*kernSmooth.
Weight(r, h)/h;
212 const Real q = r / h;
214 return q*kernSmooth.
Weight(r, h) / (h*h);
219 template<
typename Real>
229 const Real q = 2.0f*r / h;
233 if (q > 2.0f)
return 0.0f;
237 const Real d = 2.0f - q;
238 return alpha / 6.0f*d*d*d;
244 const Real qqq = qq*q;
245 return alpha*(2.0f / 3.0f - qq + 0.5f*qqq);
252 const Real q = 2.0f*r / h;
256 if (q > 2.0f)
return Real(0);
260 const Real d = 2.0f - q;
261 return -0.5f*alpha*d*d;
267 return alpha*(-2.0f*q + 1.5f*qq);
273 template<
typename Real>
283 const Real q = 2.5f*r / h;
284 if (q > 2.5)
return 0.0f;
287 const Real d = 2.5f - q;
289 return 0.0255f*dd*dd / hh;
293 const Real d = 2.5f - q;
294 const Real t = 1.5f - q;
297 return 0.0255f*(dd*dd - 5.0f*
tt*
tt) / hh;
301 const Real d = 2.5f - q;
302 const Real t = 1.5f - q;
303 const Real w = 0.5f - q;
307 return 0.0255f*(dd*dd - 5.0f*
tt*
tt + 10.0f*ww*ww) / hh;
314 const Real q = 2.5f*r / h;
315 if (q > 2.5)
return 0.0f;
319 const Real d = 2.5f - q;
320 return -0.102f*d*d*d / hh;
324 const Real d = 2.5f - q;
325 const Real t = 1.5f - q;
326 return -0.102f*(d*d*d - 5.0f*t*t*t) / hh;
330 const Real d = 2.5f - q;
331 const Real t = 1.5f - q;
332 const Real w = 0.5f - q;
333 return -0.102f*(d*d*d - 5.0f*t*t*t + 10.0f*w*w*w) / hh;
DYN_FUNC ~ConstantKernel()
DYN_FUNC ConstantKernel()
DYN_FUNC Real Weight(const Real r, const Real h) override
DYN_FUNC Real Gradient(const Real r, const Real h) override
DYN_FUNC Real Weight(const Real r, const Real h) override
DYN_FUNC ~CorrectedKernel()
DYN_FUNC CorrectedKernel()
DYN_FUNC Real WeightRR(const Real r, const Real h)
DYN_FUNC Real WeightR(const Real r, const Real h)
DYN_FUNC Real Gradient(const Real r, const Real h) override
DYN_FUNC Real Weight(const Real r, const Real h) override
virtual DYN_FUNC Real integral(const Real r, const Real h)
virtual DYN_FUNC Real Gradient(const Real r, const Real h)
virtual DYN_FUNC Real Weight(const Real r, const Real h)
DYN_FUNC Real Gradient(const Real r, const Real h) override
DYN_FUNC ~QuarticKernel()
DYN_FUNC Real Weight(const Real r, const Real h) override
static DYN_FUNC Real gradient(const Real r, const Real h, const Real scale)
static DYN_FUNC Real weight(const Real r, const Real h, const Real scale)
DYN_FUNC Real Weight(const Real r, const Real h) override
static DYN_FUNC Real integral(const Real r, const Real h, Real scale)
DYN_FUNC Real Gradient(const Real r, const Real h) override
static DYN_FUNC Real weight(const Real r, const Real h, Real scale)
static DYN_FUNC Real integral(const Real r, const Real h, Real scale)
DYN_FUNC Real integral(const Real r, const Real h) override
DYN_FUNC Real Gradient(const Real r, const Real h) override
static DYN_FUNC Real gradient(const Real r, const Real h, Real scale)
DYN_FUNC Real Weight(const Real r, const Real h) override
This is an implementation of AdditiveCCD based on peridyno.