Damask.ResultType
Result

Contains informations and a view of a DADF5 (DAMASK HDF5) file.

Damask.ResultMethod
Damask.Result(filename::String)

Starting point for post-processing. Read a DADF5 (DAMASK HDF5) file containing DAMASK results and get a Result returned needed for further post-processing.

Examples

julia> using Damask
julia> res = Damask.Result("my_file.hdf5")

If the path/filename contains backslashes use "raw" in front of it or use double backslashes

julia> res = damask.Result(raw"my_file.hdf5")
Base.showMethod

Presentation of Result showing obj.filename and obj.visible

Damask._dict_flattenMethod
_dict_flatten(d::Dict)

Recursively remove keys of single-entry dictionaries. Return a new flattened Dict or a single Array in d.

Damask._dict_pruneMethod
_dict_prune(d::Dict)

Recursively remove empty dictionaries. Return a new pruned Dict which may be empty.

Damask._empty_likeMethod
_empty_like(obj::Result, dataset, fill_val)

Creates Array filled with fill_val of the dimensions of dataset in the first dimensions and the amount of obj.N_materialpoints in the last dimension. Attach Metadata of the dataset.

Damask._manage_choiceMethod
_manage_choice(obj::Result, input::Bool, type::String, action::String)

Processes input for type where type is a keyword argument of view. Should call _set_viewchoice or another [_manage_choice]-Method.

Damask._manage_viewFunction
_manage_view(obj::Result; <keyword arguments>)

Create a copy of obj and set its view by calling _manage_choice on each keyword argument

Damask._mappingsMethod
_mappings(obj::Result)

Extracts mapping data for phases and homogenizations to place data spatially

Damask._readMethod
_read(dataset::HDF5.Dataset)

Read a HDF5.Dataset including metadata.

Damask._set_viewchoiceMethod
_set_viewchoice(obj::Result, choice::Vector{String}, type::String, action::String)

Set view choices of type to obj.visible[type]. action must be in ["set", "del", "add"] and specifies if choice should be set, added to or deleted from the current view of obj.

Damask.export_VTKFunction
export_VTK(obj::Result, output::Union{String,Vector{String}}="*"; mode::String="cell", constituents::Union{Vector{Int64},Nothing}=nothing, fill_float::Float64=NaN, fill_int::Int64=0)

Export to VTK cell data. Only datasets in the current view and optionally specified by output are exported. Create one VTK file (.vti) per visible increment.

Arguments

  • obj : Result to be exported
  • output : Names of the datasets to export to the VTK file. Defaults to '*', in which case all datasets of the current view are exported.
  • mode : {'cell', 'point'} Export in cell format or point format. Only cell format possible now. Defaults to 'cell'.
  • constituents : optional constituents to consider. Defaults to nothing, in which case all constituents are considered.
  • fill_float : Fill value for non-existent entries of floating point type. Defaults to NaN.
  • fill_int : Fill value for non-existent entries of integer type. Defaults to 0.
Damask.getFunction
get(obj::Result, output::Union{String,Vector{String}}="*"; flatten::Bool=true, prune::Bool=true)

Collect data reflecting the group/folder structure in the DADF5 file. Only datasets in the current view and optionally specified by output are collected.

Arguments

  • obj: Result to get data from
  • output : Names of the datasets to read. Defaults to '*', in which case all datasets are read.
  • flatten : Remove singular levels of the folder hierarchy. This might be beneficial in case of single increment, phase/homogenization, or field. Defaults to True.
  • prune : Remove branches with no data. Defaults to True.
Damask.placeFunction
place(obj::Result, output::Union{String,Vector{String}}="*"; constituents::Union{Vector{Int64},Nothing}=nothing, flatten::Bool=true, prune::Bool=true, fill_float::Float64=NaN, fill_int::Int64=0)

Merge data into spatial order that is compatible with the VTK representation.

The returned data structure reflects the group/folder structure in the DADF5 file. Multi-phase data is fused into a single output. place is equivalent to get if only one phase/homogenization and one constituent is present.

Arguments

  • obj : Result to be worked on
  • output : Names of the datasets to read. Defaults to '*', in which case all datasets of the current view are exported.
  • constituents : Constituents to consider. Defaults to nothing, in which case all constituents are considered.
  • fill_float : Fill value for non-existent entries of floating point type. Defaults to NaN.
  • fill_int : Fill value for non-existent entries of integer type. Defaults to 0.
Damask.viewMethod
view(obj::Result; <keyword arguments>)

Return a copy of obj with the selected view. True or "*" as keyword value selects all. False or String[] as keyword value deselects all.

Arguments

  • obj::HDF_Obj : HDF5_obj to create a view of
  • increments::Union{Int,Vector{Int},String,Vector{String},Bool,Nothing}=nothing : Number(s) of increments to select. Negative Integers allowed eg. -1 for last increment, -2 for second last. Defaults to all.
  • times::Union{<:AbstractFloat,Vector{<:AbstractFloat},String,Vector{String},Bool,Nothing}=nothing, : Simulation time(s) of increments to select. Defaults to all. Mutually exclusive to increments.
  • phases::Union{String,Vector{String},Bool,Nothing}=nothing, : Name(s) of phases to select. Defaults to all.
  • homogenizations::Union{String,Vector{String},Bool,Nothing}=nothing,: Name(s) of homogenizations to select. Defaults to all.
  • fields::Union{String,Vector{String},Bool,Nothing}=nothing, : Name(s) of fields to select. Defaults to all.
  • protected::Union{Bool,Nothing}=nothing : Protection status of existing data.

Examples

Create a view on the last increment

julia> using Damask
julia> res = Damask.Result("my_file.hdf5")
julia> v = view(res,increments = -1)
Damask.view_lessMethod
view_less(obj::Result; <keyword arguments>)

Return a copy of obj with the selected reduced view. True or "*" as value as keyword value deselect all. False or String[] for keyword value does nothing.

Arguments

  • obj::HDF_Obj : HDF5_obj to create a view of
  • increments::Union{Int,Vector{Int},String,Vector{String},Bool,Nothing}=nothing : Number(s) of increments to select. Negative Integers allowed eg. -1 for last increment. Defaults to all.
  • times::Union{<:AbstractFloat,Vector{<:AbstractFloat},String,Vector{String},Bool,Nothing}=nothing, : Simulation time(s) of increments to select. Defaults to all. Mutually exclusive to increments.
  • phases::Union{String,Vector{String},Bool,Nothing}=nothing, : Name(s) of phases to select. Defaults to all.
  • homogenizations::Union{String,Vector{String},Bool,Nothing}=nothing,: Name(s) of homogenizations to select. Defaults to all.
  • fields::Union{String,Vector{String},Bool,Nothing}=nothing, : Name(s) of fields to select. Defaults to all.

Examples

Increasing a view from first increment to increment 0,2,4 :

julia> using Damask
julia> r = view(Damask.Result("my_file.hdf5"), increments=0)
julia> r2 = view_more(r, increments=[2,4])
Damask.view_moreMethod
view_more(obj::Result; <keyword arguments>)

Return a copy of obj with the selected increased view. True or "*" as value as keyword value selects all. False or String[] as keyword value deselects all.

Arguments

  • obj::HDF_Obj : HDF5_obj to create a view of
  • increments::Union{Int,Vector{Int},String,Vector{String},Bool,Nothing}=nothing : Number(s) of increments to select. Negative Integers allowed eg. -1 for last increment. Defaults to all.
  • times::Union{<:AbstractFloat,Vector{<:AbstractFloat},String,Vector{String},Bool,Nothing}=nothing, : Simulation time(s) of increments to select. Defaults to all. Mutually exclusive to increments.
  • phases::Union{String,Vector{String},Bool,Nothing}=nothing, : Name(s) of phases to select. Defaults to all.
  • homogenizations::Union{String,Vector{String},Bool,Nothing}=nothing,: Name(s) of homogenizations to select. Defaults to all.
  • fields::Union{String,Vector{String},Bool,Nothing}=nothing, : Name(s) of fields to select. Defaults to all.

Examples

Increasing a view from first increment to increment 0,2,4 :

julia> using Damask
julia> r = view(Damask.Result("my_file.hdf5"), increments=0)
julia> r2 = view_more(r, increments=[2,4])