diff options
Diffstat (limited to 'src/get_up_coeffs.c')
-rw-r--r-- | src/get_up_coeffs.c | 90 |
1 files changed, 73 insertions, 17 deletions
diff --git a/src/get_up_coeffs.c b/src/get_up_coeffs.c index 3a78f6a..e75ab9a 100644 --- a/src/get_up_coeffs.c +++ b/src/get_up_coeffs.c @@ -60,6 +60,39 @@ void DiffUpCoeff ( const CCTK_POINTER_TO_CONST cctkGH_, const CCTK_INT dir, CCTK_INT *imax, CCTK_REAL *q); + void CCTK_FCALL CCTK_FNAME(set_coeff_up_2)(const CCTK_INT *nsize, + const CCTK_INT *up_dir, + 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_up_4)(const CCTK_INT *nsize, + const CCTK_INT *up_dir, + 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_up_6)(const CCTK_INT *nsize, + const CCTK_INT *up_dir, + 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_up_8)(const CCTK_INT *nsize, + const CCTK_INT *up_dir, + 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 ) { @@ -99,35 +132,58 @@ void DiffUpCoeff ( 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_coeff_up_2_1)(&nsize,&up,&loc_order,bb,&gsize,imin,imax,q); - break; - } - case 4: { - CCTK_FNAME(set_coeff_up_4_2)(&nsize,&up,&loc_order,bb,&gsize,imin,imax,q); - break; - } - default: - CCTK_WARN (0, "Unknown upwinding stencil specified"); + if ( sbp_upwind_deriv ) { + if ( CCTK_Equals(operator_type,"Minimal Bandwidth") ) { + switch(loc_order) { + case 2: { + CCTK_FNAME(set_coeff_up_2_1)(&nsize,&up,&loc_order,bb,&gsize,imin,imax,q); + break; + } + case 4: { + CCTK_FNAME(set_coeff_up_4_2)(&nsize,&up,&loc_order,bb,&gsize,imin,imax,q); + break; + } + default: + CCTK_WARN (0, "Unknown upwinding stencil specified"); + } + } else { + switch(loc_order) { + case 2: { + CCTK_FNAME(set_coeff_up_2_1)(&nsize,&up,&loc_order,bb,&gsize,imin,imax,q); + break; + } + case 4: { + CCTK_FNAME(set_coeff_up_4_2)(&nsize,&up,&loc_order,bb,&gsize,imin,imax,q); + break; + } + case 6: { + CCTK_FNAME(set_coeff_up_6_3_opt)(&nsize,&up,&loc_order,bb,&gsize,imin,imax,q); + break; + } + case 8: { + CCTK_FNAME(set_coeff_up_8_4_opt)(&nsize,&up,&loc_order,bb,&gsize,imin,imax,q); + break; + } + default: + CCTK_WARN (0, "Unknown upwinding stencil specified"); + } } - } else { + } else { switch(loc_order) { case 2: { - CCTK_FNAME(set_coeff_up_2_1)(&nsize,&up,&loc_order,bb,&gsize,imin,imax,q); + CCTK_FNAME(set_coeff_up_2)(&nsize,&up,&loc_order,bb,&gsize,imin,imax,q); break; } case 4: { - CCTK_FNAME(set_coeff_up_4_2)(&nsize,&up,&loc_order,bb,&gsize,imin,imax,q); + CCTK_FNAME(set_coeff_up_4)(&nsize,&up,&loc_order,bb,&gsize,imin,imax,q); break; } case 6: { - CCTK_FNAME(set_coeff_up_6_3_opt)(&nsize,&up,&loc_order,bb,&gsize,imin,imax,q); + CCTK_FNAME(set_coeff_up_6)(&nsize,&up,&loc_order,bb,&gsize,imin,imax,q); break; } case 8: { - CCTK_FNAME(set_coeff_up_8_4_opt)(&nsize,&up,&loc_order,bb,&gsize,imin,imax,q); + CCTK_FNAME(set_coeff_up_8)(&nsize,&up,&loc_order,bb,&gsize,imin,imax,q); break; } default: |