diff options
author | diener <diener@f69c4107-0314-4c4f-9ad4-17e986b73f4a> | 2007-10-16 14:45:23 +0000 |
---|---|---|
committer | diener <diener@f69c4107-0314-4c4f-9ad4-17e986b73f4a> | 2007-10-16 14:45:23 +0000 |
commit | f4cc81a52f102c61b07178b88d4a560b307d928f (patch) | |
tree | ae8d9b3dcbf84f6c2180622f0e7da3661d4fdcd4 /src/get_coeffs.c | |
parent | bb568eb19331f243f79abc3a5b3e9331959c8773 (diff) |
Moved definitions of coefficients to a single module in order to only have
them in one place. Added routines to return coefficients in all the
missing cases. Also added routines to return 2 derivatives (only 2-1 and
4-2 so far). The routines calculating derivatives for whole grid functions
have not been tested yet, so if you are using them, you will probably want
to hold off on updating until I give the clear signal.
git-svn-id: https://svn.cct.lsu.edu/repos/numrel/LSUThorns/SummationByParts/trunk@85 f69c4107-0314-4c4f-9ad4-17e986b73f4a
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"); + } } } } |