(I write this second question in different message so it can be answered separately)
Hello,
when asking for a vector variable index with CCTK_VarIndex, it correctly returns an increasing index for every variable component, for example:
CCTK_VarIndex (example_gf[0]) --> 180 CCTK_VarIndex (example_gf[1]) --> 181
However when the index is fed to CCTK_VarDataPtrI to get a pointer to the grid function, it always points to the 0th component. To get the pointer to the component I wanted, I had to increment the pointer by the correct amount.
This not a major inconvenience, but it is quite counterintuitive. Is there a reason for such behaviour?
Thanks again, Federico Guercilena
Hello Frederico,
CCTK_VarIndex (example_gf[0]) --> 180 CCTK_VarIndex (example_gf[1]) --> 181
However when the index is fed to CCTK_VarDataPtrI to get a pointer to the grid function, it always points to the 0th component. To get the pointer to the component I wanted, I had to increment the pointer by the correct amount.
This not a major inconvenience, but it is quite counterintuitive. Is there a reason for such behaviour?
Sounds like a bug to me, namely I wonder what would happen if you were to pass "example_gf[1]" to say CarpetIOHDF5::out_vars.
Can you check what the results of CCTK_VarDataPtrI(cctkGH, 0, CCTK_VarIndex("example_gf[1]")) and CCTK_VarDataPtr(cctkGH, 0, "example_gf[1]") is and if they agree? At the very least I would have expected that they agree.
Yours, Roland
Hi Roland,
thanks for the reply, it was actually a false alarm: I performed some thorough checks and everything behaves as it should. The odd behavour in my code was the result of a "static" keyword that I overlooked.
Thanks again, Federico
2015-10-26 17:18 GMT+01:00 Roland Haas rhaas@aei.mpg.de:
Hello Frederico,
CCTK_VarIndex (example_gf[0]) --> 180 CCTK_VarIndex (example_gf[1]) --> 181
However when the index is fed to CCTK_VarDataPtrI to get a pointer to the grid function, it always points to the 0th component. To get the pointer
to
the component I wanted, I had to increment the pointer by the correct amount.
This not a major inconvenience, but it is quite counterintuitive. Is
there
a reason for such behaviour?
Sounds like a bug to me, namely I wonder what would happen if you were to pass "example_gf[1]" to say CarpetIOHDF5::out_vars.
Can you check what the results of CCTK_VarDataPtrI(cctkGH, 0, CCTK_VarIndex("example_gf[1]")) and CCTK_VarDataPtr(cctkGH, 0, "example_gf[1]") is and if they agree? At the very least I would have expected that they agree.
Yours, Roland
Users mailing list Users@einsteintoolkit.org http://lists.einsteintoolkit.org/mailman/listinfo/users
users@lists.einsteintoolkit.org