diff options
author | Erik Schnetter <schnetter@gmail.com> | 2012-02-25 11:01:40 -0500 |
---|---|---|
committer | Barry Wardell <barry.wardell@gmail.com> | 2012-09-11 18:23:06 +0100 |
commit | 487280c1b638d05f4bbc2bc41c81d1fdb424cd4d (patch) | |
tree | d4ea7557f7cd42f74ce6f7a92b906e6401c69c97 /Carpet/CarpetInterp2 | |
parent | ae44c5e6d86a65cce382e313e2a10b214e9645da (diff) |
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
Diffstat (limited to 'Carpet/CarpetInterp2')
-rw-r--r-- | Carpet/CarpetInterp2/src/fasterp.cc | 10 |
1 files changed, 5 insertions, 5 deletions
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)); } |