next up previous contents
Next: Time evolution methods provided Up: MoL Previous: Evolution method writers   Contents


Example

As a fairly extended example of how to use MoL I'll outline how ADM_BSSN works in this context. The actual implementation of this is given in the thorn AEIThorns/BSSN_MoL.

As normal the required variables are defined in the interface.ccl file, together with the associated source terms. For example, the conformal factor and source are defined by

real ADM_BSSN_phi type=GF timelevels=2
{
  ADM_BS_phi
} "ADM_BSSN_phi"

real ADM_BSSN_sources type=GF
{
...,
  adm_bs_sphi,
...
}
Also in this file we write the function aliasing prototypes.

Once the sources are defined the registration with MoL is required, for which the essential file is MoLRegister.c. In the ADM_BSSN system the standard metric coefficients $g_{ij}$ are not evolved, and neither are the standard extrinsic curvature components $K_{ij}$. However these are used by ADM_BSSN in a number of places, and are calculated from evolved quantities at the appropriate points. In the MoL terminology these variables are constrained. As the appropriate storage is defined in thorn ADMBase, the actual calls have the form

 ierr += MoLRegisterConstrained(CCTK_VarIndex("ADMBase::kxx"));

The actual evolved variables include things such as the conformal factor. This, and the appropriate source term, is defined in thorn ADM_BSSN, and so the call has the form

 
 ierr += MoLRegisterEvolved(CCTK_VarIndex("adm_bssn::ADM_BS_phi"),
                            CCTK_VarIndex("adm_bssn::adm_bs_sphi"));

As well as the evolved variables, and those constrained variables such as the metric, there are the gauge variables. Precisely what status these have depends on how they are set. If harmonic or 1+log slicing is used then the lapse is evolved:

 ierr += MoLRegisterEvolved(CCTK_VarIndex("ADMBase::alp"),
                            CCTK_VarIndex("adm_bssn::adm_bs_salp"));

If maximal or static slicing is used then the lapse is a constrained variablepart102:

 ierr += MoLRegisterConstrained(CCTK_VarIndex("ADMBase::alp"));

Finally, if none of the above apply we assume that the lapse is evolved in some unknown fashion, and so it must be registered as a Save and Restore variable:

 ierr += MoLRegisterSaveAndRestore(CCTK_VarIndex("ADMBase::alp"));

However, it is perfectly possible that we may wish to change how we deal with the gauge during the evolution. This is dealt with in the file PreLoop.F. If the slicing changes then the appropriate routine is called. For example, if we want to use 1+log evolution then we call

 call CCTK_VarIndex(lapseindex,"ADMBase::alp")
 call CCTK_VarIndex(lapserhsindex,"adm_bssn::adm_bs_salp")
 ierr = ierr + MoLChangeToEvolved(lapseindex, lapserhsindex)

It is not required to tell MoL what the lapse is changing from, or indeed if it is changing at all; MoL will work this out for itself.

Finally there are the routines that we wish to apply after every intermediate step. These are ADM_BSSN_removetrA which enforces various constraints (such as the tracefree conformal extrinsic curvature remaining trace free), ADM_BSSN_Boundaries which applies symmetry boundary conditions as well as various others (such as some of the radiative boundary conditions). Note all the calls to SYNC at this point. We also convert from the updated BSSN variables back to the standard ADM variables in ADM_BSSN_StandardVariables, and also update the time derivative of the lapse in ADM_BSSN_LapseChange.


next up previous contents
Next: Time evolution methods provided Up: MoL Previous: Evolution method writers   Contents