diff options
Diffstat (limited to 'src/get_coeffs.c')
-rw-r--r-- | src/get_coeffs.c | 219 |
1 files changed, 142 insertions, 77 deletions
diff --git a/src/get_coeffs.c b/src/get_coeffs.c index c2aa224..836ff52 100644 --- a/src/get_coeffs.c +++ b/src/get_coeffs.c @@ -12,51 +12,6 @@ -void CCTK_FCALL CCTK_FNAME(set_coeff_2_1)(const CCTK_INT *nsize, - const CCTK_INT *loc_order, - const CCTK_INT *bb, - const CCTK_INT *gsize, - CCTK_INT *imin, - CCTK_INT *imax, - CCTK_REAL *q); -void CCTK_FCALL CCTK_FNAME(set_coeff_4_2)(const CCTK_INT *nsize, - const CCTK_INT *loc_order, - const CCTK_INT *bb, - const CCTK_INT *gsize, - CCTK_INT *imin, - CCTK_INT *imax, - CCTK_REAL *q); -void CCTK_FCALL CCTK_FNAME(set_coeff_6_3)(const CCTK_INT *nsize, - const CCTK_INT *loc_order, - const CCTK_INT *bb, - const CCTK_INT *gsize, - CCTK_INT *imin, - CCTK_INT *imax, - CCTK_REAL *q); -void CCTK_FCALL CCTK_FNAME(set_coeff_8_4)(const CCTK_INT *nsize, - const CCTK_INT *loc_order, - const CCTK_INT *bb, - const CCTK_INT *gsize, - CCTK_INT *imin, - CCTK_INT *imax, - CCTK_REAL *q); -void CCTK_FCALL CCTK_FNAME(set_coeff_4_3)(const CCTK_INT *nsize, - const CCTK_INT *loc_order, - const CCTK_INT *bb, - const CCTK_INT *gsize, - CCTK_INT *imin, - CCTK_INT *imax, - CCTK_REAL *q); -void CCTK_FCALL CCTK_FNAME(set_coeff_6_5)(const CCTK_INT *nsize, - const CCTK_INT *loc_order, - const CCTK_INT *bb, - const CCTK_INT *gsize, - CCTK_INT *imin, - CCTK_INT *imax, - CCTK_REAL *q); - - - void DiffCoeff ( const CCTK_POINTER_TO_CONST cctkGH_, const CCTK_INT dir, const CCTK_INT nsize, CCTK_INT *imin, CCTK_INT *imax, CCTK_REAL *q, const CCTK_INT table_handle ) @@ -66,9 +21,81 @@ void DiffCoeff ( const CCTK_POINTER_TO_CONST cctkGH_, const CCTK_INT dir, DECLARE_CCTK_ARGUMENTS CCTK_INT ni, nj, nk, gsize, loc_order; - int nelements; CCTK_INT bb[2]; int onesided[6]; + int nelements; + + void CCTK_FCALL CCTK_FNAME(set_coeff_2_1)(const CCTK_INT *nsize, + const CCTK_INT *loc_order, + const CCTK_INT *bb, + const CCTK_INT *gsize, + CCTK_INT *imin, + CCTK_INT *imax, + CCTK_REAL *q); + void CCTK_FCALL CCTK_FNAME(set_coeff_4_2)(const CCTK_INT *nsize, + const CCTK_INT *loc_order, + const CCTK_INT *bb, + const CCTK_INT *gsize, + CCTK_INT *imin, + CCTK_INT *imax, + CCTK_REAL *q); + void CCTK_FCALL CCTK_FNAME(set_coeff_4_3)(const CCTK_INT *nsize, + const CCTK_INT *loc_order, + const CCTK_INT *bb, + const CCTK_INT *gsize, + CCTK_INT *imin, + CCTK_INT *imax, + CCTK_REAL *q); + void CCTK_FCALL CCTK_FNAME(set_coeff_4_3_opt)(const CCTK_INT *nsize, + const CCTK_INT *loc_order, + const CCTK_INT *bb, + const CCTK_INT *gsize, + CCTK_INT *imin, + CCTK_INT *imax, + CCTK_REAL *q); + void CCTK_FCALL CCTK_FNAME(set_coeff_6_3)(const CCTK_INT *nsize, + const CCTK_INT *loc_order, + const CCTK_INT *bb, + const CCTK_INT *gsize, + CCTK_INT *imin, + CCTK_INT *imax, + CCTK_REAL *q); + void CCTK_FCALL CCTK_FNAME(set_coeff_6_3_opt)(const CCTK_INT *nsize, + const CCTK_INT *loc_order, + const CCTK_INT *bb, + const CCTK_INT *gsize, + CCTK_INT *imin, + CCTK_INT *imax, + CCTK_REAL *q); + void CCTK_FCALL CCTK_FNAME(set_coeff_6_5)(const CCTK_INT *nsize, + const CCTK_INT *loc_order, + const CCTK_INT *bb, + const CCTK_INT *gsize, + CCTK_INT *imin, + CCTK_INT *imax, + CCTK_REAL *q); + void CCTK_FCALL CCTK_FNAME(set_coeff_6_5_opt)(const CCTK_INT *nsize, + const CCTK_INT *loc_order, + const CCTK_INT *bb, + const CCTK_INT *gsize, + CCTK_INT *imin, + CCTK_INT *imax, + CCTK_REAL *q); + void CCTK_FCALL CCTK_FNAME(set_coeff_8_4)(const CCTK_INT *nsize, + const CCTK_INT *loc_order, + const CCTK_INT *bb, + const CCTK_INT *gsize, + CCTK_INT *imin, + CCTK_INT *imax, + CCTK_REAL *q); + void CCTK_FCALL CCTK_FNAME(set_coeff_8_4_opt)(const CCTK_INT *nsize, + const CCTK_INT *loc_order, + const CCTK_INT *bb, + const CCTK_INT *gsize, + CCTK_INT *imin, + CCTK_INT *imax, + CCTK_REAL *q); + ni = cctk_lsh[0]; nj = cctk_lsh[1]; nk = cctk_lsh[2]; if ( table_handle >=0 ) { @@ -104,42 +131,80 @@ void DiffCoeff ( const CCTK_POINTER_TO_CONST cctkGH_, const CCTK_INT dir, break; } default: - assert(0); + CCTK_WARN (0, "Wrong direction specified"); } if ( CCTK_Equals(norm_type,"Diagonal") ) { - switch(loc_order) { - case 2: { - CCTK_FNAME(set_coeff_2_1)(&nsize,&loc_order,bb,&gsize,imin,imax,q); - break; - } - case 4: { - CCTK_FNAME(set_coeff_4_2)(&nsize,&loc_order,bb,&gsize,imin,imax,q); - break; - } - case 6: { - CCTK_FNAME(set_coeff_6_3)(&nsize,&loc_order,bb,&gsize,imin,imax,q); - break; - } - case 8: { - CCTK_FNAME(set_coeff_8_4)(&nsize,&loc_order,bb,&gsize,imin,imax,q); - break; - } - default: - assert(0); + if ( CCTK_Equals(operator_type,"Minimal Bandwidth") ) { + switch(loc_order) { + case 2: { + CCTK_FNAME(set_coeff_2_1)(&nsize,&loc_order,bb,&gsize,imin,imax,q); + break; + } + case 4: { + CCTK_FNAME(set_coeff_4_2)(&nsize,&loc_order,bb,&gsize,imin,imax,q); + break; + } + case 6: { + CCTK_FNAME(set_coeff_6_3)(&nsize,&loc_order,bb,&gsize,imin,imax,q); + break; + } + case 8: { + CCTK_FNAME(set_coeff_8_4)(&nsize,&loc_order,bb,&gsize,imin,imax,q); + break; + } + default: + CCTK_WARN (0, "Unknown stencil specified"); + } + } else { + switch(loc_order) { + case 2: { + CCTK_FNAME(set_coeff_2_1)(&nsize,&loc_order,bb,&gsize,imin,imax,q); + break; + } + case 4: { + CCTK_FNAME(set_coeff_4_2)(&nsize,&loc_order,bb,&gsize,imin,imax,q); + break; + } + case 6: { + CCTK_FNAME(set_coeff_6_3_opt)(&nsize,&loc_order,bb,&gsize,imin,imax,q); + break; + } + case 8: { + CCTK_FNAME(set_coeff_8_4_opt)(&nsize,&loc_order,bb,&gsize,imin,imax,q); + break; + } + default: + CCTK_WARN (0, "Unknown stencil specified"); + } } } else { - switch(loc_order) { - case 4: { - CCTK_FNAME(set_coeff_4_3)(&nsize,&loc_order,bb,&gsize,imin,imax,q); - break; - } - case 6: { - CCTK_FNAME(set_coeff_6_5)(&nsize,&loc_order,bb,&gsize,imin,imax,q); - break; - } - default: - assert(0); + if ( CCTK_Equals(operator_type,"Minimal Bandwidth") ) { + switch(loc_order) { + case 4: { + CCTK_FNAME(set_coeff_4_3)(&nsize,&loc_order,bb,&gsize,imin,imax,q); + break; + } + case 6: { + CCTK_FNAME(set_coeff_6_5)(&nsize,&loc_order,bb,&gsize,imin,imax,q); + break; + } + default: + CCTK_WARN (0, "Unknown stencil specified"); + } + } else { + switch(loc_order) { + case 4: { + CCTK_FNAME(set_coeff_4_3_opt)(&nsize,&loc_order,bb,&gsize,imin,imax,q); + break; + } + case 6: { + CCTK_FNAME(set_coeff_6_5_opt)(&nsize,&loc_order,bb,&gsize,imin,imax,q); + break; + } + default: + CCTK_WARN (0, "Unknown stencil specified"); + } } } } |