next up previous contents
Next: Unconditional Output of Grid Up: I/O Methods Previous: Periodic Output of Grid   Contents

Triggered Output of Grid Variables

Besides the periodic output at every so many iterations using OutputGH(), analysis and output of grid variables can also be done via triggers. For this, a TimeToOutput() routine is registered with an I/O method. This routine will be called by the flesh scheduler at every iteration before CCTK_ANALYSIS with the triggering variable(s) as defined in the schedule block for all CCTK_ANALYSIS routines (see Section B6.4).

If the TimeToOutput() routine decides that it is now time to do output, the flesh scheduler will invoke the corresponding analysis routine and also request output of the triggering variable(s) using TriggerOutput().

  int SimpleIO_TimeToOutput (const cGH *GH, int varindex);
  int SimpleIO_TriggerOutput (const cGH *GH, int varindex);
Both routines get passed the index of a possible triggering grid variable.

TimeToOutput() should return a non-zero value if analysis and output for varindex should take place at the current iteration, and zero otherwise.

TriggerOutput() should return zero for successful output of variable varindex, and a negative value in case of an error.


next up previous contents
Next: Unconditional Output of Grid Up: I/O Methods Previous: Periodic Output of Grid   Contents