diff options
Diffstat (limited to 'src/dissipation.c')
-rw-r--r-- | src/dissipation.c | 72 |
1 files changed, 58 insertions, 14 deletions
diff --git a/src/dissipation.c b/src/dissipation.c index bf6fc29..71fcab9 100644 --- a/src/dissipation.c +++ b/src/dissipation.c @@ -19,6 +19,7 @@ void CCTK_FCALL CCTK_FNAME(dissipation_4_3_opt) (const CCTK_REAL *var, const CCTK_INT *lbnd, const CCTK_INT *bbox, const CCTK_INT *gsize, + const CCTK_INT *offset, const CCTK_REAL *dx, const CCTK_REAL *epsdis, const CCTK_REAL *diss_fraction, @@ -31,6 +32,7 @@ void CCTK_FCALL CCTK_FNAME(dissipation_4_3_alt) (const CCTK_REAL *var, const CCTK_INT *lbnd, const CCTK_INT *bbox, const CCTK_INT *gsize, + const CCTK_INT *offset, const CCTK_REAL *dx, const CCTK_REAL *epsdis, const CCTK_REAL *diss_fraction, @@ -43,6 +45,7 @@ void CCTK_FCALL CCTK_FNAME(dissipation_6_5_opt) (const CCTK_REAL *var, const CCTK_INT *nk, const CCTK_INT *bbox, const CCTK_INT *gsize, + const CCTK_INT *offset, const CCTK_REAL *dx, const CCTK_REAL *epsdis, const CCTK_REAL *diss_fraction, @@ -55,6 +58,7 @@ void CCTK_FCALL CCTK_FNAME(dissipation_6_5_alt) (const CCTK_REAL *var, const CCTK_INT *nk, const CCTK_INT *bbox, const CCTK_INT *gsize, + const CCTK_INT *offset, const CCTK_REAL *dx, const CCTK_REAL *epsdis, const CCTK_REAL *diss_fraction, @@ -67,6 +71,7 @@ void CCTK_FCALL CCTK_FNAME(dissipation_2_1) (const CCTK_REAL *var, const CCTK_INT *nk, const CCTK_INT *bbox, const CCTK_INT *gsize, + const CCTK_INT *offset, const CCTK_REAL *dx, const CCTK_REAL *epsdis, CCTK_REAL *rhs); @@ -76,6 +81,7 @@ void CCTK_FCALL CCTK_FNAME(dissipation_2_1_alt) (const CCTK_REAL *var, const CCTK_INT *nk, const CCTK_INT *bbox, const CCTK_INT *gsize, + const CCTK_INT *offset, const CCTK_REAL *dx, const CCTK_REAL *epsdis, CCTK_REAL *rhs); @@ -85,6 +91,7 @@ void CCTK_FCALL CCTK_FNAME(dissipation_4_2) (const CCTK_REAL *var, const CCTK_INT *nk, const CCTK_INT *bbox, const CCTK_INT *gsize, + const CCTK_INT *offset, const CCTK_REAL *dx, const CCTK_REAL *epsdis, CCTK_REAL *rhs); @@ -94,6 +101,7 @@ void CCTK_FCALL CCTK_FNAME(dissipation_4_2_alt) (const CCTK_REAL *var, const CCTK_INT *nk, const CCTK_INT *bbox, const CCTK_INT *gsize, + const CCTK_INT *offset, const CCTK_REAL *dx, const CCTK_REAL *epsdis, CCTK_REAL *rhs); @@ -103,6 +111,7 @@ void CCTK_FCALL CCTK_FNAME(dissipation_6_3) (const CCTK_REAL *var, const CCTK_INT *nk, const CCTK_INT *bbox, const CCTK_INT *gsize, + const CCTK_INT *offset, const CCTK_REAL *dx, const CCTK_REAL *epsdis, CCTK_REAL *rhs); @@ -112,6 +121,7 @@ void CCTK_FCALL CCTK_FNAME(dissipation_6_3_alt) (const CCTK_REAL *var, const CCTK_INT *nk, const CCTK_INT *bbox, const CCTK_INT *gsize, + const CCTK_INT *offset, const CCTK_REAL *dx, const CCTK_REAL *epsdis, CCTK_REAL *rhs); @@ -121,6 +131,7 @@ void CCTK_FCALL CCTK_FNAME(dissipation_8_4) (const CCTK_REAL *var, const CCTK_INT *nk, const CCTK_INT *bbox, const CCTK_INT *gsize, + const CCTK_INT *offset, const CCTK_REAL *dx, const CCTK_REAL *epsdis, CCTK_REAL *rhs); @@ -130,6 +141,7 @@ void CCTK_FCALL CCTK_FNAME(dissipation_8_4_alt) (const CCTK_REAL *var, const CCTK_INT *nk, const CCTK_INT *bbox, const CCTK_INT *gsize, + const CCTK_INT *offset, const CCTK_REAL *dx, const CCTK_REAL *epsdis, CCTK_REAL *rhs); @@ -164,6 +176,9 @@ apply (int const varindex, char const * const optstring, void * const arg) CCTK_INT bbox[6]; int onesided[6]; CCTK_INT npatches, patch; + CCTK_INT offset[6]; + int type; + int i; assert (varindex >= 0); @@ -171,12 +186,41 @@ apply (int const varindex, char const * const optstring, void * const arg) dx[d] = CCTK_DELTA_SPACE(d)*h_scaling[d]; gsize[d] = cctk_nghostzones[d]; } - + + for (i=0; i<6; i++) { + offset[i] = 0; + } + if ( use_shiftout ) { + const CCTK_INT* shiftout_x_lower = (const CCTK_INT*) CCTK_ParameterGet ( "boundary_shiftout_x_lower", "coordbase", &type ); + if (shiftout_x_lower != NULL ) { + offset[0] = *shiftout_x_lower; + } + const CCTK_INT* shiftout_x_upper = (const CCTK_INT*) CCTK_ParameterGet ( "boundary_shiftout_x_upper", "coordbase", &type ); + if (shiftout_x_upper != NULL ) { + offset[1] = *shiftout_x_upper; + } + const CCTK_INT* shiftout_y_lower = (const CCTK_INT*) CCTK_ParameterGet ( "boundary_shiftout_y_lower", "coordbase", &type ); + if (shiftout_y_lower != NULL ) { + offset[2] = *shiftout_y_lower; + } + const CCTK_INT* shiftout_y_upper = (const CCTK_INT*) CCTK_ParameterGet ( "boundary_shiftout_y_upper", "coordbase", &type ); + if (shiftout_y_upper != NULL ) { + offset[3] = *shiftout_y_upper; + } + const CCTK_INT* shiftout_z_lower = (const CCTK_INT*) CCTK_ParameterGet ( "boundary_shiftout_z_lower", "coordbase", &type ); + if (shiftout_z_lower != NULL ) { + offset[4] = *shiftout_z_lower; + } + const CCTK_INT* shiftout_z_upper = (const CCTK_INT*) CCTK_ParameterGet ( "boundary_shiftout_z_upper", "coordbase", &type ); + if (shiftout_z_upper != NULL ) { + offset[5] = *shiftout_z_upper; + } + } + SBP_determine_onesided_stencil (cctkGH, onesided); for (d=0; d<6; ++d) { bbox[d] = onesided[d]; } - rhsindex = MoLQueryEvolvedRHS (varindex); if (rhsindex < 0) { char * const fullvarname = CCTK_FullName (varindex); @@ -228,11 +272,11 @@ apply (int const varindex, char const * const optstring, void * const arg) if ( CCTK_Equals(dissipation_type,"Mattson-Svard-Nordstrom") ) { CCTK_FNAME(dissipation_2_1) (varptr, &cctk_lsh[0], &cctk_lsh[1], &cctk_lsh[2], - bbox, gsize, dx, &epsdis, rhsptr); + bbox, gsize, offset, dx, &epsdis, rhsptr); } else { CCTK_FNAME(dissipation_2_1_alt) (varptr, &cctk_lsh[0], &cctk_lsh[1], &cctk_lsh[2], - bbox, gsize, dx, &epsdis, rhsptr); + bbox, gsize, offset, dx, &epsdis, rhsptr); } break; } @@ -240,11 +284,11 @@ apply (int const varindex, char const * const optstring, void * const arg) if ( CCTK_Equals(dissipation_type,"Mattson-Svard-Nordstrom") ) { CCTK_FNAME(dissipation_4_2) (varptr, &cctk_lsh[0], &cctk_lsh[1], &cctk_lsh[2], - bbox, gsize, dx, &epsdis, rhsptr); + bbox, gsize, offset, dx, &epsdis, rhsptr); } else { CCTK_FNAME(dissipation_4_2_alt) (varptr, &cctk_lsh[0], &cctk_lsh[1], &cctk_lsh[2], - bbox, gsize, dx, &epsdis, rhsptr); + bbox, gsize, offset, dx, &epsdis, rhsptr); } break; } @@ -252,11 +296,11 @@ apply (int const varindex, char const * const optstring, void * const arg) if ( CCTK_Equals(dissipation_type,"Mattson-Svard-Nordstrom") ) { CCTK_FNAME(dissipation_6_3) (varptr, &cctk_lsh[0], &cctk_lsh[1], &cctk_lsh[2], - bbox, gsize, dx, &epsdis, rhsptr); + bbox, gsize, offset, dx, &epsdis, rhsptr); } else { CCTK_FNAME(dissipation_6_3_alt) (varptr, &cctk_lsh[0], &cctk_lsh[1], &cctk_lsh[2], - bbox, gsize, dx, &epsdis, rhsptr); + bbox, gsize, offset, dx, &epsdis, rhsptr); } break; } @@ -264,11 +308,11 @@ apply (int const varindex, char const * const optstring, void * const arg) if ( CCTK_Equals(dissipation_type,"Mattson-Svard-Nordstrom") ) { CCTK_FNAME(dissipation_8_4) (varptr, &cctk_lsh[0], &cctk_lsh[1], &cctk_lsh[2], - bbox, gsize, dx, &epsdis, rhsptr); + bbox, gsize, offset, dx, &epsdis, rhsptr); } else { CCTK_FNAME(dissipation_8_4_alt) (varptr, &cctk_lsh[0], &cctk_lsh[1], &cctk_lsh[2], - bbox, gsize, dx, &epsdis, rhsptr); + bbox, gsize, offset, dx, &epsdis, rhsptr); } break; } @@ -282,11 +326,11 @@ apply (int const varindex, char const * const optstring, void * const arg) case 4: { if ( CCTK_Equals(dissipation_type,"Mattson-Svard-Nordstrom") ) { CCTK_FNAME(dissipation_4_3_opt) - (varptr, cctk_lsh, cctk_gsh, cctk_lbnd, bbox, gsize, + (varptr, cctk_lsh, cctk_gsh, cctk_lbnd, bbox, gsize, offset, dx, &epsdis, diss_fraction, &npatches, &patch, rhsptr); } else { CCTK_FNAME(dissipation_4_3_alt) - (varptr, cctk_lsh, cctk_gsh, cctk_lbnd, bbox, gsize, + (varptr, cctk_lsh, cctk_gsh, cctk_lbnd, bbox, gsize, offset, dx, &epsdis, diss_fraction, &npatches, &patch, rhsptr); } break; @@ -294,11 +338,11 @@ apply (int const varindex, char const * const optstring, void * const arg) case 6: { if ( CCTK_Equals(dissipation_type,"Mattson-Svard-Nordstrom") ) { CCTK_FNAME(dissipation_6_5_opt) - (varptr, cctk_lsh, cctk_gsh, cctk_lbnd, bbox, gsize, + (varptr, cctk_lsh, cctk_gsh, cctk_lbnd, bbox, gsize, offset, dx, &epsdis, diss_fraction, &npatches, &patch, rhsptr); } else { CCTK_FNAME(dissipation_6_5_alt) - (varptr, cctk_lsh, cctk_gsh, cctk_lbnd, bbox, gsize, + (varptr, cctk_lsh, cctk_gsh, cctk_lbnd, bbox, gsize, offset, dx, &epsdis, diss_fraction, &npatches, &patch, rhsptr); } break; |