Kranc icon indicating copy to clipboard operation
Kranc copied to clipboard

Cannot inherit from Coordinates

Open eschnett opened this issue 13 years ago • 2 comments

I cannot inherit from Coordinates in a Kranc script, because this leads to duplicate definitions of symbols such as dJ111.

I want to inherit from Coordinates to receive access to the inverse Jacobian.

eschnett avatar Jun 14 '12 18:06 eschnett

This situation arises because I didn't want to use the inheritance mechanism for accessing the Coordinates variables, since this would make thorns unconditionally dependent on having Coordinates, which is a non-public thorn. There was a proposal that the Coordinates interface would be implemented in a public thorn. This was going to be CartesianCoordinates, but I don't really see why it can't just be CartGrid3D. If this change happens, I think we can remove a lot of the special-case code from Kranc, and this problem should go away.

ianhinder avatar Jun 19 '12 06:06 ianhinder

I believe the issue here are names of local variables that Kranc uses, and which conflict with the name space that Cactus uses when inheriting from Coordinates. That is, using names different from J111 for the local copies of the Jacobian may suffice.

eschnett avatar Jun 20 '12 18:06 eschnett