## Trigger

October 23, 2012

Abstract

Trigger can be used to steer (change) parameters depending on data from the simulation. Examples would be enabling reﬁnement levels when the density reaches a certain threshold or enabling output within a certain time window.

### 1 Parameters

• Trigger_Number speciﬁes the total number of triggers you want to specify.
• Trigger_Checked_Variable[index] holds the fully speciﬁed variable name that the trigger with that index should depend on. Leave it empty if it shouldn’t.
• Trigger_Checked_Parameter_Thorn and Trigger_Checked_Parameter_Name hold the information about which parameter this trigger should depend on.
• Trigger_Relation deﬁnes a mathematical relation between whatever is checked and a some value. Allowed values are $<$, $>$, $==$ and $!=$.
• Trigger_Checked_Value speciﬁes the actual value that is used for the comparison. This has to be a real number.
• Trigger_Reduction speciﬁes which reduction should be used in case you speciﬁed a grid function as variable to be checked. Leave empty for grid scalars and parameters.
• Trigger_Reaction speciﬁes what should happen in case the check above is true.
• ”output”: some output should be enabled. File names will be preﬁxed with ”trigger_”.
• Trigger_Output_Method speciﬁes which type of output should be enabled.
• Trigger_Output_Variables speciﬁes a space-separated list of fully qualiﬁed variable names to be output.
• ”steerparam”: Steer a parameter
• Trigger_Steered_Parameter_Thorn Name of the thorn of the parameter to be steered.
• Trigger_Steered_Parameter_Name Name of the parameter to be steered.
• Trigger_Steered_Parameter_Value Value the parameter should be steered to. Given as string, as it could be of any Cactus type.
• ”steerscalar”: Change the value of a scalar
• Trigger_Steered_Scalar: Name of the scalar to be changed
• Trigger_Steered_Scalar_Index: Index of the scalar (in case it happens to be an array of scalars, otherwise leave it at 0)
• Trigger_Steered_Scalar_Value: Value the scalar should be changed to - given as string
• Trigger_Debug: Turn on Debug output (not generally recommended, but useful if something doesn’t trigger as expected). This is an integer, allowed is 0 or 1.

### 2 Parameters

 trigger_checked_parameter_name Scope: private STRING Description: parameter name to be checked for Range Default: (none) .+ parameter name \$̂ An empty string to trigger nothing

 trigger_checked_parameter_thorn Scope: private STRING Description: thorn of parameter to be checked for Range Default: (none) .+ thorn name \$̂ An empty string to trigger nothing

 trigger_checked_value Scope: private REAL Description: triggered value for checked variable Range Default: 1.0 *:* value to be triggered for

 trigger_checked_variable Scope: private STRING Description: variable to be checked for Range Default: (none) .+ fully qualiﬁed variable name, ’param’ for a parameter \$̂ An empty string to trigger nothing

 trigger_debug Scope: private INT Description: turnes on debug messages Range Default: (none) 0:1 Only 0 (oﬀ, default) or 1 (on)

 trigger_number Scope: private INT Description: Number of triggers Range Default: (none) 0:10 The number of triggers that are deﬁned

 trigger_once Scope: private INT Description: Should this trigger only be triggered (and checked) once? Range Default: (none) 0:1 0 (no), 1 (yes)

 trigger_output_method Scope: private STRING Description: IO-output method for this trigger Range Default: 1D .+ an enabled IO-method \$̂ An empty string for no output

 trigger_output_variables Scope: private STRING Description: variable to be put out ’param’ for parameter Range Default: (none) .+ Space-separated list of fully qualiﬁed variable name \$̂ An empty string to trigger nothing

 trigger_reaction Scope: private KEYWORD Description: how to react on a positive trigger Range Default: output output enable output steerparam steer parameter steerscalar steer grid scalar

 trigger_reduction Scope: private STRING Description: valid reduction method Range Default: (none) .+ some relations e.g. ’norm2’ \$̂ An empty string for no reduction (for scalars)

 trigger_relation Scope: private STRING Description: relation operator for checked variable Range Default: > see [1] below some relations

[1]

\^{\textless}|{\textgreater}|==|!=\\$

 trigger_steered_parameter_name Scope: private STRING Description: parameter name to be changed Range Default: (none) .+ parameter name \$̂ An empty string to change nothing

 trigger_steered_parameter_thorn Scope: private STRING Description: thorn of parameter to be changed Range Default: (none) .+ thorn name \$̂ An empty string to change nothing

 trigger_steered_parameter_value Scope: private STRING Description: parameter value to be changed to Range Default: (none) .+ parameter value \$̂ can be empty

 trigger_steered_scalar Scope: private STRING Description: Scalar to be changed Range Default: (none) .+ scalar name \$̂ can be empty

 trigger_steered_scalar_index Scope: private INT Description: Scalar index to be changed Range Default: (none) 0:* >=0

 trigger_steered_scalar_value Scope: private STRING Description: Scalar value to be changed to Range Default: (none) .+ scalar value \$̂ can be empty

### 3 Interfaces

Implements:

trigger

Inherits:

io

#### Grid Variables

##### 3.0.1 PRIVATE GROUPS
 Group Names Variable Names Details trigger_vars compact 0 trigger_cctk_iteration description Scalars for the triggers trigger_cctk_time dimensions 0 distribution CONSTANT group type SCALAR tags checkpoint=”no” timelevels 1 variable type REAL

### 4 Schedule

This section lists all the variables which are assigned storage by thorn CactusUtils/Trigger. Storage can either last for the duration of the run (Always means that if this thorn is activated storage will be assigned, Conditional means that if this thorn is activated storage will be assigned for the duration of the run if some condition is met), or can be turned on for the duration of a schedule function.

NONE

#### Scheduled Functions

CCTK_STARTUP

trigger_startup

startup routine

 Language: c Type: function

CCTK_PARAMCHECK

trigger_paramcheck

parameter checking

 Language: c Type: function

CCTK_ANALYSIS

trigger_check

test

 Before: ahﬁnderdirect_setupupdate Language: c Options: global-early Storage: trigger_vars Type: function