From 487280c1b638d05f4bbc2bc41c81d1fdb424cd4d Mon Sep 17 00:00:00 2001 From: Erik Schnetter Date: Sat, 25 Feb 2012 11:01:40 -0500 Subject: CarpetLib: Change API to obtain pointer to grid function data Change the API to obtain a pointer to grid function data: - Use a function "typed_data_pointer" instead of overloading the () operator (because this looks nicer) - Don't use a virtual function (because this isn't needed) - Update all uses --- Carpet/CarpetInterp2/src/fasterp.cc | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'Carpet/CarpetInterp2') diff --git a/Carpet/CarpetInterp2/src/fasterp.cc b/Carpet/CarpetInterp2/src/fasterp.cc index 9b8fd956b..ba46eec69 100644 --- a/Carpet/CarpetInterp2/src/fasterp.cc +++ b/Carpet/CarpetInterp2/src/fasterp.cc @@ -508,7 +508,7 @@ namespace CarpetInterp2 { fasterp_llocs_t local_locations (npoints); if (CCTK_IsFunctionAliased ("MultiPatch_GlobalToLocal")) { - // This is a muulti-patch simulation: convert global to local + // This is a multi-patch simulation: convert global to local // coordinates CCTK_REAL const * coords[dim]; @@ -1176,10 +1176,10 @@ namespace CarpetInterp2 { assert (gi >= 0); int const vi = varinds.AT(v) - CCTK_FirstVarIndexI (gi); assert (vi >= 0); - varptrs.AT(v) = - (CCTK_REAL const *) - (* Carpet::arrdata.AT(gi).AT(m).data.AT(vi)) - (tl, rl, lc, Carpet::mglevel)->storage(); + ggf const *const ff = Carpet::arrdata.AT(gi).AT(m).data.AT(vi); + void const *const ptr = + ff->data_pointer(tl, rl, lc, Carpet::mglevel)->storage(); + varptrs.AT(v) = (CCTK_REAL const *)ptr; assert (varptrs.AT(v)); } -- cgit v1.2.3