diff options
author | swhite <swhite@c78560ca-4b45-4335-b268-5f3340f3cb52> | 2006-05-11 13:51:10 +0000 |
---|---|---|
committer | swhite <swhite@c78560ca-4b45-4335-b268-5f3340f3cb52> | 2006-05-11 13:51:10 +0000 |
commit | a6003a455caf4f1d08825a9a1b64ee6ecf225ba3 (patch) | |
tree | 08c7502075fd738d8bf37726d680cf28766d2a0a | |
parent | c6c1363c2393f47eb04746c6929e8dfcc119cdc3 (diff) |
Applying Erik's patch from the Patchs list 2.12.05
CartGrid3D: Support patches with different grid spacing
git-svn-id: http://svn.cactuscode.org/arrangements/CactusBase/CartGrid3D/trunk@226 c78560ca-4b45-4335-b268-5f3340f3cb52
-rw-r--r-- | interface.ccl | 20 | ||||
-rw-r--r-- | param.ccl | 9 | ||||
-rw-r--r-- | src/CartGrid3D.c | 49 | ||||
-rw-r--r-- | src/ParamCheck.c | 3 |
4 files changed, 76 insertions, 5 deletions
diff --git a/interface.ccl b/interface.ccl index 514ca1b..e19dcab 100644 --- a/interface.ccl +++ b/interface.ccl @@ -32,6 +32,26 @@ USES FUNCTION ConvertFromPhysicalBoundary +CCTK_INT FUNCTION \ + MultiPatch_GetDomainSpecification \ + (CCTK_INT IN map, \ + CCTK_INT IN size, \ + CCTK_REAL OUT ARRAY physical_min, \ + CCTK_REAL OUT ARRAY physical_max, \ + CCTK_REAL OUT ARRAY interior_min, \ + CCTK_REAL OUT ARRAY interior_max, \ + CCTK_REAL OUT ARRAY exterior_min, \ + CCTK_REAL OUT ARRAY exterior_max, \ + CCTK_REAL OUT ARRAY spacing) +USES FUNCTION MultiPatch_GetDomainSpecification + +CCTK_INT FUNCTION \ + MultiPatch_GetMap \ + (CCTK_POINTER_TO_CONST IN cctkGH) +USES FUNCTION MultiPatch_GetMap + + + # Register the symmetry boundaries CCTK_INT FUNCTION SymmetryRegister (CCTK_STRING IN sym_name) USES FUNCTION SymmetryRegister @@ -113,10 +113,11 @@ REAL xyzmax "Coordinate maximum in xyz-directions" KEYWORD type "Grid type" { - "box" :: "Box grid from -0.5 to 0.5" - "byrange" :: "Specify min and max values" - "byspacing" :: "Specify grid spacings" - "coordbase" :: "Get specification from CoordBase" + "box" :: "Box grid from -0.5 to 0.5" + "byrange" :: "Specify min and max values" + "byspacing" :: "Specify grid spacings" + "coordbase" :: "Get specification from CoordBase" + "multipatch" :: "Get specification from MultiPatch" } "box" KEYWORD domain "Domain type" diff --git a/src/CartGrid3D.c b/src/CartGrid3D.c index 391ddc2..d2da70f 100644 --- a/src/CartGrid3D.c +++ b/src/CartGrid3D.c @@ -296,6 +296,55 @@ void CartGrid3D_SetRanges(CCTK_ARGUMENTS) *coarse_delta[d] = this_delta[d]; } } + /************************************************************** + * MULTIPATCH + * + * MultiPatch gives: grid spacing on the coarsest GH and + * minimum and maximum values of coordinates and + * the number of gridpoints on the coarsest GH + * + **************************************************************/ + else if (CCTK_Equals(type,"multipatch")) + { + CCTK_REAL physical_min[3]; + CCTK_REAL physical_max[3]; + CCTK_REAL interior_min[3]; + CCTK_REAL interior_max[3]; + CCTK_REAL exterior_min[3]; + CCTK_REAL exterior_max[3]; + CCTK_REAL spacing[3]; + CCTK_INT map; + int d; + + map = MultiPatch_GetMap (cctkGH); + if (map < 0) + CCTK_WARN (0, "error returned from function MultiPatch_GetMap"); + + ierr = MultiPatch_GetDomainSpecification + (map, 3, physical_min, physical_max, interior_min, interior_max, + exterior_min, exterior_max, spacing); + if (ierr) + CCTK_WARN (0, "error returned from function MultiPatch_GetDomainSpecification"); + + + /* Adapt to convergence level */ + for (d=0; d<3; ++d) { + spacing[d] *= pow(cctkGH->cctk_convfac, cctkGH->cctk_convlevel); + } + + ierr = ConvertFromPhysicalBoundary + (3, physical_min, physical_max, interior_min, interior_max, + exterior_min, exterior_max, spacing); + if (ierr) + CCTK_WARN (0, "error returned from function ConvertFromPhysicalBoundary"); + + for (d=0; d<3; ++d) { + origin[d] = exterior_min[d]; + this_delta[d] = spacing[d]; + *coarse_delta[d] = this_delta[d]; + } + } + else { if (0) diff --git a/src/ParamCheck.c b/src/ParamCheck.c index 888823b..2acd159 100644 --- a/src/ParamCheck.c +++ b/src/ParamCheck.c @@ -97,7 +97,8 @@ void ParamCheck_CartGrid3D(CCTK_ARGUMENTS) } } - else if (CCTK_Equals(type,"coordbase")) + else if (CCTK_Equals(type,"coordbase") + || CCTK_Equals(type,"multipatch")) { if (CCTK_IsFunctionAliased ("GetDomainSpecification")) { |