Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR introduces a new mechanism for setting and testing the access policy for fields in stages.
Setting access
The
AddStage
has now three arguments:load.densities=
specifies theDensities
that are loaded at the beginning of the stage.read.fields=
specifies theFields
that can be accessed in the Dynamics withfield(dx,dy,dz)
macros.save.fields=
specifies theFields
that are saved at the end of the stage.Defaults
By default the actions/stages setup is:
Moreover, the default
read.fields
is as allowing as possible. If not specified otherwise it is assumed that stage has read access to all fields that are available to it.Checks
The access policies are checked in each
Action
(series ofStages
) assuming:Init
action should not read anything from previous iteration.Exceptions
There are three mechanisms to circumvent checks:
non.mandatory=TRUE
inAddField
signals that this field doesn't have to be written by the end of an actioncan.overwrite=TRUE
inAddStage
signals that a stage can overwrite fieldsSetOptions(permissive.access=TRUE)
switches the test entirely and sets all fields to be readable in all stages. This should be avoidedModifications
Some adjustments were made to models to agree with these policies. All models were tested and
permissive.access=TRUE
was added to the ones failing from this change. These models should be fixed to accommodate these checks. Especiallyd3q27_pf_velocity
, as per #437.