cuIBM
A GPU-based Immersed Boundary Method code
helpers.cu
Go to the documentation of this file.
1 
7 #include "helpers.h"
8 
9 
23 {
24  real r = fabs(x)/h;
25 
26  if(r>1.5)
27  return 0.0;
28  else if(r>0.5 && r<=1.5)
29  return 1.0/(6*h)*( 5.0 - 3.0*r - sqrt(-3.0*(1-r)*(1-r) + 1.0) );
30  else
31  return 1.0/(3*h)*( 1.0 + sqrt(-3.0*r*r + 1.0) );
32 } // dhRoma
33 
34 
45 {
46  return dhRoma(x, h) * dhRoma(y, h);
47 } // delta
double real
Is a float or a double depending on the machine precision.
Definition: types.h:116
real delta(real x, real y, real h)
Two-dimensional discrete delta function.
Definition: helpers.cu:44
real dhRoma(real x, real h)
Discrete delta function from Roma et al. (1999).
Definition: helpers.cu:22
Declaration of the discrete delta function.