aboutsummaryrefslogtreecommitdiff
path: root/src/get_coeffs2.c
diff options
context:
space:
mode:
authordiener <diener@f69c4107-0314-4c4f-9ad4-17e986b73f4a>2008-04-18 21:40:46 +0000
committerdiener <diener@f69c4107-0314-4c4f-9ad4-17e986b73f4a>2008-04-18 21:40:46 +0000
commit6fdbf297784da5711d8801877103cd7b4f43f383 (patch)
tree368fb8943e537bb957a6f9a7af5ea3bb2f7fd4f6 /src/get_coeffs2.c
parent0616ca3051e71b2a90c641755ea0e20e20e0f51e (diff)
Add stencils for non-SBP operators.
git-svn-id: https://svn.cct.lsu.edu/repos/numrel/LSUThorns/SummationByParts/trunk@104 f69c4107-0314-4c4f-9ad4-17e986b73f4a
Diffstat (limited to 'src/get_coeffs2.c')
-rw-r--r--src/get_coeffs2.c103
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");
}
-}
+}