diff options
Diffstat (limited to 'src/get_coeffs2.c')
-rw-r--r-- | src/get_coeffs2.c | 103 |
1 files changed, 77 insertions, 26 deletions
diff --git a/src/get_coeffs2.c b/src/get_coeffs2.c index fff110d..6779ecf 100644 --- a/src/get_coeffs2.c +++ b/src/get_coeffs2.c @@ -32,6 +32,13 @@ void DiffCoeff2 ( const CCTK_POINTER_TO_CONST cctkGH_, const CCTK_INT dir, CCTK_INT *imin, CCTK_INT *imax, CCTK_REAL *q); + void CCTK_FCALL CCTK_FNAME(set_coeff2_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_coeff2_4_2)(const CCTK_INT *nsize, const CCTK_INT *loc_order, const CCTK_INT *bb, @@ -46,6 +53,13 @@ void DiffCoeff2 ( const CCTK_POINTER_TO_CONST cctkGH_, const CCTK_INT dir, CCTK_INT *imin, CCTK_INT *imax, CCTK_REAL *q); + void CCTK_FCALL CCTK_FNAME(set_coeff2_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_coeff2_6_3)(const CCTK_INT *nsize, const CCTK_INT *loc_order, const CCTK_INT *bb, @@ -53,6 +67,13 @@ void DiffCoeff2 ( const CCTK_POINTER_TO_CONST cctkGH_, const CCTK_INT dir, CCTK_INT *imin, CCTK_INT *imax, CCTK_REAL *q); + void CCTK_FCALL CCTK_FNAME(set_coeff2_6)(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_coeff2_8_4)(const CCTK_INT *nsize, const CCTK_INT *loc_order, const CCTK_INT *bb, @@ -60,6 +81,13 @@ void DiffCoeff2 ( const CCTK_POINTER_TO_CONST cctkGH_, const CCTK_INT dir, CCTK_INT *imin, CCTK_INT *imax, CCTK_REAL *q); + void CCTK_FCALL CCTK_FNAME(set_coeff2_8)(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]; @@ -100,50 +128,73 @@ void DiffCoeff2 ( const CCTK_POINTER_TO_CONST cctkGH_, const CCTK_INT dir, } if ( CCTK_Equals(norm_type,"Diagonal") ) { - if ( CCTK_Equals(operator_type,"Minimal Bandwidth") ) { - switch(loc_order) { - case 2: { - CCTK_FNAME(set_coeff2_2_1)(&nsize,&loc_order,bb,&gsize,imin,imax,q); - break; - } - case 4: { - CCTK_FNAME(set_coeff2_4_2)(&nsize,&loc_order,bb,&gsize,imin,imax,q); - break; - } - case 6: { - CCTK_FNAME(set_coeff2_6_3)(&nsize,&loc_order,bb,&gsize,imin,imax,q); - break; - } - case 8: { - CCTK_FNAME(set_coeff2_8_4)(&nsize,&loc_order,bb,&gsize,imin,imax,q); - break; - } - default: - CCTK_WARN (0, "Unknown stencil specified"); + if ( sbp_2nd_deriv ) { + if ( CCTK_Equals(operator_type,"Minimal Bandwidth") ) { + switch(loc_order) { + case 2: { + CCTK_FNAME(set_coeff2_2_1)(&nsize,&loc_order,bb,&gsize,imin,imax,q); + break; + } + case 4: { + CCTK_FNAME(set_coeff2_4_2)(&nsize,&loc_order,bb,&gsize,imin,imax,q); + break; + } + case 6: { + CCTK_FNAME(set_coeff2_6_3)(&nsize,&loc_order,bb,&gsize,imin,imax,q); + break; + } + case 8: { + CCTK_FNAME(set_coeff2_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_coeff2_2_1)(&nsize,&loc_order,bb,&gsize,imin,imax,q); + break; + } + case 4: { + CCTK_FNAME(set_coeff2_4_2_opt)(&nsize,&loc_order,bb,&gsize,imin,imax,q); + break; + } + case 6: { + CCTK_FNAME(set_coeff2_6_3)(&nsize,&loc_order,bb,&gsize,imin,imax,q); + break; + } + case 8: { + CCTK_FNAME(set_coeff2_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_coeff2_2_1)(&nsize,&loc_order,bb,&gsize,imin,imax,q); + CCTK_FNAME(set_coeff2_2)(&nsize,&loc_order,bb,&gsize,imin,imax,q); break; } case 4: { - CCTK_FNAME(set_coeff2_4_2_opt)(&nsize,&loc_order,bb,&gsize,imin,imax,q); + CCTK_FNAME(set_coeff2_4)(&nsize,&loc_order,bb,&gsize,imin,imax,q); break; } case 6: { - CCTK_FNAME(set_coeff2_6_3)(&nsize,&loc_order,bb,&gsize,imin,imax,q); + CCTK_FNAME(set_coeff2_6)(&nsize,&loc_order,bb,&gsize,imin,imax,q); break; } case 8: { - CCTK_FNAME(set_coeff2_8_4)(&nsize,&loc_order,bb,&gsize,imin,imax,q); + CCTK_FNAME(set_coeff2_8)(&nsize,&loc_order,bb,&gsize,imin,imax,q); break; } default: - CCTK_WARN (0, "Unknown stencil specified"); + CCTK_WARN (0, "Unknown 2nd derivative stencil specified"); } } } else { CCTK_WARN (0, "Second derivatives not implemented for restricted full norm"); } -} +} |