From b5246b635fd29c06c6f1d71aa76662b8c20a52bb Mon Sep 17 00:00:00 2001 From: korobkin Date: Tue, 29 Apr 2008 11:35:27 +0000 Subject: (*) The grid offsets of the dissipation and derivative operators are made correlated. If use_shiftout = yes, both offsets are read from the CoordBase::boundary_shiftout_* parameters. Otherwise, both offsets are set to zero. git-svn-id: https://svn.cct.lsu.edu/repos/numrel/LSUThorns/SummationByParts/trunk@106 f69c4107-0314-4c4f-9ad4-17e986b73f4a --- src/call_derivs.c | 17 ++++++----------- src/dissipation.c | 27 +++------------------------ src/make.code.defn | 1 + 3 files changed, 10 insertions(+), 35 deletions(-) diff --git a/src/call_derivs.c b/src/call_derivs.c index aeab3d7..c92dd34 100644 --- a/src/call_derivs.c +++ b/src/call_derivs.c @@ -125,8 +125,9 @@ void DiffGv ( const CCTK_POINTER_TO_CONST cctkGH_, const CCTK_INT dir, const CCTK_INT *offset, const CCTK_REAL *delta, CCTK_REAL *dvar); - + void CCTK_FCALL CCTK_FNAME(get_grid_offsets) (CCTK_INT *offset); + ni = cctk_lsh[0]; nj = cctk_lsh[1]; nk = cctk_lsh[2]; if ( table_handle >=0 ) { @@ -159,18 +160,12 @@ void DiffGv ( const CCTK_POINTER_TO_CONST cctkGH_, const CCTK_INT dir, for (i=0; i<6; i++) { offset[i] = 0; } - if ( table_handle >=0 ) { - nelements = Util_TableGetIntArray ( table_handle, 6, dummy, "offset" ); - if ( nelements == UTIL_ERROR_TABLE_NO_SUCH_KEY ) { - } else if ( nelements != 6) { - CCTK_WARN (0, "The options table has an entry \"offset\", but it does not have 6 elements"); - } else { - for (i=0; i<6; i++) { - offset[i] = dummy[i]; - } - } + if ( use_shiftout ) { + /* get values of boundary_shiftout_* from CoordBase */ + CCTK_FNAME(get_grid_offsets) (offset); } + SBP_determine_onesided_stencil (cctkGH, onesided); switch(dir) { diff --git a/src/dissipation.c b/src/dissipation.c index 71fcab9..87f303d 100644 --- a/src/dissipation.c +++ b/src/dissipation.c @@ -145,6 +145,7 @@ void CCTK_FCALL CCTK_FNAME(dissipation_8_4_alt) (const CCTK_REAL *var, const CCTK_REAL *dx, const CCTK_REAL *epsdis, CCTK_REAL *rhs); +void CCTK_FCALL CCTK_FNAME(get_grid_offsets) (CCTK_INT *offset); static void apply (int const varindex, char const * const optstring, void * const arg); @@ -191,30 +192,8 @@ apply (int const varindex, char const * const optstring, void * const arg) 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; - } + /* get values of boundary_shiftout_* from CoordBase */ + CCTK_FNAME(get_grid_offsets) (offset); } SBP_determine_onesided_stencil (cctkGH, onesided); diff --git a/src/make.code.defn b/src/make.code.defn index 1a7867e..4cecbe8 100644 --- a/src/make.code.defn +++ b/src/make.code.defn @@ -63,6 +63,7 @@ SRCS = call_derivs.c \ Coefficients_4_3_min_err_coeff.F90 \ Coefficients_6_5.F90 \ Coefficients_6_5_min_err_coeff.F90 \ + get_offset.c \ stencil.c # Subdirectories containing source files -- cgit v1.2.3