aboutsummaryrefslogtreecommitdiff
path: root/src/CartGrid3D.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/CartGrid3D.c')
-rw-r--r--src/CartGrid3D.c49
1 files changed, 49 insertions, 0 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)