Simulation Results

HSSSimulations.ResultsModule

Contains a concrete time step and final results type and the functions needed to process the results for these types.

source

Time/Load Step Results

HSSSimulations.Types.AbstractResultType
abstract type AbstractResult <: HSSSimulations.Types.AbstractSimProperty

This as the abstract type for the results from a single simulation time step. These are save at the end of every load step for each of the time steps in that load step (ignoring time steps that are skipped over based on the load steps skip value).

See Tutorial 4: Saving More Results and Result Type Recipes for how to make your own subtype.

Warning

As this struct is what stores the data during the simulation, all subtypes MUST have the T, t and tₚ fields, and if used with the default material model it will also need the M and C fields.

source
HSSSimulations.Results.loadStepSaverFunction
loadStepSaver(loadResultsFolder, loadResults::StructVector{T}) where {T<:AbstractResult}

Saves the results of a load step into the folder for the current load step in the output file of the problem, given by the loadResultsFolder argument.

Any new methods for this function should dispatch on the type parameter of the loadResults, and save any desired results to the file like so:

function loadStepSaver(loadResultsFolder, loadResults::StructVector{T}) where {T<:AbstractResult}
    loadResultsFolder["time"] = loadResults.t
    loadResultsFolder["T"] = stack(loadResults.T)
    return
end
Note

stack is used as a very efficient way of converting the vector of 3D arrays from the StructVector in to a 4D array.

source
HSSSimulations.Results.loadStepSaverMethod
loadStepSaver(
    loadResultsFolder,
    loadResults::StructArray{T<:Result, 1}
)

Saves the results for the temperature, melt state and consolidation state as 4D arrays of X,Y,Z and t. And the time is saved as a 1D Array.

source

End of Simulation Results

HSSSimulations.Types.AbstractOtherResultsType
abstract type AbstractOtherResults <: HSSSimulations.Types.AbstractSimProperty

This as the abstract type for the results that are saved only at the end of the simulation. This is useful to store things that do not change every time step, without requiring any changes to the material property or params structs. However those structs can also be used to store such things, such as is done for Mₘ in the MatProp struct.

As the default implementation does nothing, and nothing normally dispatches on it, it can be replaced by another empty type to use a new method for any function that dispatches on Problem (I think that's all of the user facing API).

See Tutorial 4: Saving More Results and Result Type Recipes for how to make your own subtype.

source