[Developers] ifndef in DXYDG_guts.h

jtao at cct.lsu.edu jtao at cct.lsu.edu
Tue Mar 13 17:05:01 CST 2007


I don't know if this was considered as a bug and has been fixed
in the development version of CactusEinstein. I saw the following
statments in DXYDG_guts.h,

#ifndef DXYDG_GUTS
#define DXYDG_DECLARE

Where DXYDG_GUTS is never defined anywere.

I am also concerned about the usage of the spatial order
parameter in the loops. Shouldn't it be better to define the
order of spatial derivatives with a macro and keep the same
interface for all the derivatives ? Conditional statments
will not appear in the loops and it is still easy to
go to other orders.

e.g.

#define FD_ORDER 8
#if FD_ORDER == 2
#define DX(var,i,j,k)   i2dx*(var(i+1,j,k) - var(i-1,j,k))
...
#elif FD_ORDER == 4
#define DX(var,i,j,k)   i4dx*(-var(i+2,j,k) + var(i-2,j,k) \
                         + 8.d0*(var(i+1,j,k) - var(i-1,j,k)))
...
#elif FD_ORDER == 8
#define DX(var,i,j,k) i8dx* \
         (  3.d0*(var(-4 + i,j,k) - var(4 + i,j,k)) \
         - 32.d0*(var(-3 + i,j,k) - var(3 + i,j,k)) \
         +168.d0*(var(-2 + i,j,k) - var(2 + i,j,k)) \
         -672.d0*(var(-1 + i,j,k) - var(1 + i,j,k)))
...
#endif

Regards,
Jian




More information about the Developers mailing list