aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorswhite <swhite@c78560ca-4b45-4335-b268-5f3340f3cb52>2006-05-11 13:51:10 +0000
committerswhite <swhite@c78560ca-4b45-4335-b268-5f3340f3cb52>2006-05-11 13:51:10 +0000
commita6003a455caf4f1d08825a9a1b64ee6ecf225ba3 (patch)
tree08c7502075fd738d8bf37726d680cf28766d2a0a /src
parentc6c1363c2393f47eb04746c6929e8dfcc119cdc3 (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
Diffstat (limited to 'src')
-rw-r--r--src/CartGrid3D.c49
-rw-r--r--src/ParamCheck.c3
2 files changed, 51 insertions, 1 deletions
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"))
{