diff options
author | Roland Haas <rhaas@caltech.edu> | 2012-03-26 19:51:51 -0700 |
---|---|---|
committer | Roland Haas <rhaas@caltech.edu> | 2012-03-26 19:51:51 -0700 |
commit | fb30481262f5b8417055692f1dfa56738ce6cbd6 (patch) | |
tree | 243d182c4f029ad02f41bbc12f89819979da4a70 /Carpet/Carpet/src/Recompose.cc | |
parent | 90ee72853e24dbb4afe47edd1730b2c0e00d31a8 (diff) |
Carpet: make OutputGridCoordinates fully multipatch aware
This is achieved by using domain information in domainspecs the way
OutputGrids does. The key functional change was to use
Multipatch_ConvertFromPhysicalBoundary (used to fill domainspecs) rather than
CoordBase::ConvertFromPhysicalBoundary.
Diffstat (limited to 'Carpet/Carpet/src/Recompose.cc')
-rw-r--r-- | Carpet/Carpet/src/Recompose.cc | 68 |
1 files changed, 4 insertions, 64 deletions
diff --git a/Carpet/Carpet/src/Recompose.cc b/Carpet/Carpet/src/Recompose.cc index a5c9c090d..acfb94b1d 100644 --- a/Carpet/Carpet/src/Recompose.cc +++ b/Carpet/Carpet/src/Recompose.cc @@ -796,71 +796,11 @@ namespace Carpet { assert (file.good()); } - // - // Find extent of domain - // - - // This requires that CoordBase is used - // TODO: check this (for Carpet, and maybe also for CartGrid3D) - // TODO: (the check that these two are consistent should be in Carpet) - - jjvect nboundaryzones; - jjvect is_internal; - jjvect is_staggered; - jjvect shiftout; - if (domain_from_multipatch and - CCTK_IsFunctionAliased ("MultiPatch_GetBoundarySpecification")) - { - check (not MultiPatch_GetBoundarySpecification - (m, 2*dim, - & nboundaryzones[0][0], - & is_internal[0][0], - & is_staggered[0][0], - & shiftout[0][0])); - } else { - check (not GetBoundarySpecification - (2*dim, - & nboundaryzones[0][0], - & is_internal[0][0], - & is_staggered[0][0], - & shiftout[0][0])); - } - - rvect physical_lower, physical_upper; - rvect interior_lower, interior_upper; - rvect exterior_lower, exterior_upper; - rvect spacing; - if (domain_from_multipatch and - CCTK_IsFunctionAliased ("MultiPatch_GetDomainSpecification")) - { - check (not MultiPatch_GetDomainSpecification - (m, dim, - & physical_lower[0], & physical_upper[0], - & interior_lower[0], & interior_upper[0], - & exterior_lower[0], & exterior_upper[0], - & spacing[0])); - } else { - check (not GetDomainSpecification - (dim, - & physical_lower[0], & physical_upper[0], - & interior_lower[0], & interior_upper[0], - & exterior_lower[0], & exterior_upper[0], - & spacing[0])); - } - - // Adapt spacing for convergence level - // TODO: take ml into account - spacing *= ipow ((CCTK_REAL) mgfact, basemglevel); - - check (not ConvertFromPhysicalBoundary - (dim, - & physical_lower[0], & physical_upper[0], - & interior_lower[0], & interior_upper[0], - & exterior_lower[0], & exterior_upper[0], - & spacing[0])); - // Affine transformation between index space and coordinate space - rvect const origin = exterior_lower; + rvect const origin = domainspecs.AT(m).exterior_min; + rvect const spacing = + (domainspecs.AT(m).exterior_max - domainspecs.AT(m).exterior_min) / + rvect (domainspecs.AT(m).npoints - 1); rvect const scale = rvect (vhh.AT(m)->baseextents.AT(0).AT(0).stride()) / spacing; |