State#
State is a simple data manager, allowing PKs to require, read, and write various fields. It:
Acts as a factory for data through the various require methods.
Provides some data protection by providing both const and non-const access to data.
Provides some initialization capability.
Can be visualized or checkpointed.
state-spec
“evaluators”
[evaluator-typedinline-spec-list]
A list of evaluators.“initial conditions”
[list]
A list of constant-in-time data and other constants (e.g. gravity and atmospheric pressure). Note that “initial conditions” is not a particularly descriptive name here – PK initial conditions are generally not here.“model parameters”
[list]
A list of shared model parameters that can be used across all evaluators.“debug”
[state-debug-spec]
optional
State also houses the dependency graph of all evaluators.
Evaluators are individual terms used to build up a PK or MPCs. Each term represents a variable in the equation, and can consist of primary variables (those that are solved for by a PK solver), independent variables (those that have no dependent variables but are provided by the user as data), and secondary variables (those that are functions of other variables). Note that all three may be variable in space and/or time.
evaluator-typedinline-spec
“evaluator type”
[string]
Type of the evaluator
State’s debug spec is intended for use by PK and Evaluator developers, or occasionally users debugging input files.
state-debug-spec
“data”
[Array(string)]
A list of data. If a variable is in this list, a message is printed every time that data is required. Setting a breakpoint in a debugger on a line of code in State::CheckIsDebugData_() will allow debugging all locations that require this data, enabling debugging of incorrect or inconsistent require statements.“evaluators”
[Array(string)]
A list of evaluators. If a variable is in this list, a message is printed every time an evaluator for this variable is reuqired. Setting a breakpoint in a debugger in State::CheckIsDebugEval_() will allow debugging of all locations that require a given evaluator.
List of Evaluators