EinsteinToolkit / CarpetX

CarpetX is a Cactus driver for the Einstein Toolkit based on AMReX
GNU Lesser General Public License v3.0
17 stars 11 forks source link

HydroBaseX: add `A_x`, `A_y`, `A_z` to thorn #138

Closed SamuelCupp closed 1 year ago

SamuelCupp commented 1 year ago

Currently, all thorns will need to provide their own A vectors. However, this will make it difficult for many initial data thorns which set A. As an example, AsterSeeds depends on AsterX because it needs to set Avec in AsterX. Ideally, initial data thorns shouldn't depend on the evolution thorns, as that defeats the purpose of the modularity of Cactus.

One solution is to add the A variables to HydroBaseX. Both AsterX and GRHayLMHDX would expect the same staggering (see below, copied from AsterX):

CCTK_REAL Avec_x TYPE=gf CENTERING={cvv} TAGS='rhs="Avec_x_rhs"' "x-component of vector potential"
CCTK_REAL Avec_y TYPE=gf CENTERING={vcv} TAGS='rhs="Avec_y_rhs"' "y-component of vector potential"
CCTK_REAL Avec_z TYPE=gf CENTERING={vvc} TAGS='rhs="Avec_z_rhs"' "z-component of vector potential"

However, note that the A variables have a RHS tag, since they could be evolved. HydroBaseX would need to provide a way to set this to the correct RHS to work with different evolution thorns. If this isn't currently possible, it would have to be added for this approach to work.

The other solution is to use the method of VolumeIntegrals_vacuum which manually gets access to variables based on a runtime CCTK_STRING parameter. This would simply require thorns like AsterSeeds to have a parameter to tell them which Avec variables to set at runtime. However, I don't know if this would be complicated by how CarpetX handles parallelism, tiling, or other issues.

eschnett commented 1 year ago

Implemented via #144.