ianhinder / Kranc

A Mathematica package for generating code for solving time dependent partial differential equations
http://kranccode.org
GNU General Public License v2.0
28 stars 10 forks source link

Cannot inherit from Coordinates #69

Open eschnett opened 12 years ago

eschnett commented 12 years ago

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.

ianhinder commented 12 years ago

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.

eschnett commented 12 years ago

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.