1 #ifndef OG_PULSE_FUNCTION_H
2 #define OG_PULSE_FUNCTION_H
27 int numberOfComponents_ =1,
52 int numberOfComponents_ =1,
74 if( numberOfDimensions==2 )
76 else if( numberOfDimensions==3 )
82 return a0*exp( - a1*rp );
90 if( numberOfDimensions==2 )
92 else if( numberOfDimensions==3 )
98 if( numberOfDimensions==2 )
99 return a0*exp( - a1*rp )*( 2.*a1*p*rp/r*( (x-b0)*v0 + (y-b1)*v1 ));
100 else if( numberOfDimensions==3 )
101 return a0*exp( - a1*rp )*( 2.*a1*p*rp/r*( (x-b0)*v0 + (y-b1)*v1 +(z-b2)*v2 ));
103 return a0*exp( - a1*rp )*( 2.*a1*p*rp/r*( (x-b0)*v0 ) );
112 if( numberOfDimensions==2 )
114 else if( numberOfDimensions==3 )
120 return a0*exp(-a1*rp)*( -2.*a1*p*rp/r*( (x-b0)) );
124 if( numberOfDimensions==1 )
131 if( numberOfDimensions==2 )
133 else if( numberOfDimensions==3 )
139 return a0*exp(-a1*rp)*( -2.*a1*p*rp/r*( (y-b1)) );
148 if( numberOfDimensions==2 )
150 else if( numberOfDimensions==3 )
157 real g = -2.*a1*p*rp/r*(x-b0);
158 return a0*exp(-a1*rp)*(g*g-2.*a1*p*rp/r*(1.+2.*(p-1.)/r*
SQR(x-b0)));
163 if( numberOfDimensions==1 )
170 if( numberOfDimensions==2 )
172 else if( numberOfDimensions==3 )
179 real gx = -2.*a1*p*rp/r*(x-b0);
180 real gy = -2.*a1*p*rp/r*(y-b1);
182 return a0*exp(-a1*rp)*(gx*gy-4.*a1*p*(p-1.)*((rp/
r)/r)*(x-b0)*(y-b1));
186 if( numberOfDimensions==1 )
193 if( numberOfDimensions==2 )
195 else if( numberOfDimensions==3 )
202 real g = -2.*a1*p*rp/r*(y-b1);
203 return a0*exp(-a1*rp)*(g*g-2.*a1*p*rp/r*(1.+2.*(p-1.)/r*
SQR(y-b1)));
207 if( numberOfDimensions<=2 )
217 return a0*exp(-a1*rp)*( -2.*a1*p*rp/r*( (z-b2)) );
221 if( numberOfDimensions<=2 )
231 real gx = -2.*a1*p*rp/r*(x-b0);
232 real gz = -2.*a1*p*rp/r*(z-b2);
233 return a0*exp(-a1*rp)*(gx*gz-4.*a1*p*(p-1.)*rp/(r*
r)*(x-b0)*(z-b2));
237 if( numberOfDimensions<=2 )
247 real gy = -2.*a1*p*rp/r*(y-b1);
248 real gz = -2.*a1*p*rp/r*(z-b2);
249 return a0*exp(-a1*rp)*(gy*gz-4.*a1*p*(p-1.)*rp/(r*
r)*(y-b1)*(z-b2));
253 if( numberOfDimensions<=2 )
263 real g = -2.*a1*p*rp/r*(z-b2);
264 return a0*exp(-a1*rp)*(g*g-2.*a1*p*rp/r*(1.+2.*(p-1.)/r*
SQR(z-b2)));
287 virtual real gd(
const int & ntd,
const int & nxd,
const int & nyd,
const int & nzd,
291 const Index & I3,
const Index & N);
293 const Index & I3,
const Index & N,
const real t,
297 const Index & I3,
const Index & N,
const real t=0.,
300 const Index & I3,
const Index & N,
const real t=0.,
303 const Index & I3,
const Index & N,
const real t=0.,
306 const Index & I3,
const Index & N,
const real t=0.,
309 const Index & I3,
const Index & N,
const real t=0.,
312 const Index & I3,
const Index & N,
const real t=0.,
315 const Index & I3,
const Index & N,
const real t=0.,
318 const Index & I3,
const Index & N,
const real t=0.,
321 const Index & I3,
const Index & N,
const real t=0.,
324 const Index & I3,
const Index & N,
const real t=0.,
327 const Index & I3,
const Index & N,
const real t=0.,
330 const Index & I3,
const Index & N,
const real t=0.,
333 const Index & I3,
const Index & N,
const real t=0.,
336 const MappedGrid & c,
const Index & I1,
const Index & I2,
337 const Index & I3,
const Index & N,
const real t=0.,
344 const int numberOfDimensions,
345 const bool isRectangular,
346 const int & ntd,
const int & nxd,
const int & nyd,
const int & nzd,
347 const Index & I1,
const Index & I2,
348 const Index & I3,
const Index & N,
349 const real t=0.,
int option =0 );
388 int numberOfComponents, numberOfDimensions;
389 real a0,a1,c0,c1,c2,c3,v0,v1,v2,p;
391 void checkArguments(
const Index & N);