Output

As mentioned in the VDisp Users > Output page, VDisp has a default output format. However, some users may want a different output format. This can easily be achieved through the writeOutput function of the OutputFormat.jl module.

Main.OutputFormat.writeOutputFunction
writeOutput(order::Array{Function}, outputData::OutputData, path::String, sep::String="\n")

This function can be used to write data from an OutputData instance to file at path in a custom defined order by passing in an Array of functions called order. The return value of these functions is written to the file, and each function is written in order. The output of each function is separated by sep, which is set to the newline character by default.

Note: It is recommended that each function returns a String, and that this String ends in a newline character

This function is currently called in VDisp by the writeDefaultOutput() function, which passes in the default order of functions who's values are written to the output file. These functions are (in order):

  • getHeader
  • performGetModelOutput
  • performGetFoundationOutput
  • getFoundationDepth
  • getSoilTable
  • getMaterialInfoTable
  • getDepthToGroundWaterTable
  • performGetDisplacementOutput
  • performGetEquilibriumOutput
  • performGetForcePointOutput
  • performGetCalculationOutput

More info on these functions can be found below.

Functions named "perform<function>" are "changing behaviour" functions. These functions return different things based on the outputData instance passed in. All modules named "<Info>Behaviour.jl" deal with this behaviour. See the Design.pdf for more information on this design pattern.

Example Use Case

If a user wants to include timestamps at the top of each file, and wants to get rid of the sections that are repeats of the input data, they can first define a function called getDate() which returns the timestamp in whatever format they please. They can then call writeOutput([getData, performGetCalculationOutput], outputData, path). This will output a file with only the timestamp, and output information which is given by performGetCalculationOutput.

source

Output Functions

The following functions can be used by the writeOutput function to write to an output file. They are used in VDisp in a predefined order, but can be manipulated to fit other needs.

Main.OutputFormat.getHeaderFunction
getHeader(outputData::OutputData)

Returns String value stating the title of the problem, and depth increments of each layer.

source
Main.OutputFormat.getHeaderValuesFunction
getHeaderValues(outputData::OutputData)

Returns a Tuple containing the ordered pair (problemName::Float64, soilLayers::Int, dx::Array{Float64}).

source
Main.OutputFormat.getSoilTableFunction
getSoilTable(outputData::OutputData)

Returns String value containing a table which shows each soil sublayer, its material and material name.

Uses PrettyTables.jl to convert Array{Union{String, Int}, 3} given by getMaterialInfoTable() into a String

source
Main.OutputFormat.getSoilTableValuesFunction
getSoilTableValues(outputData::OutputData)

Returns Array{Union{String, Float64, Int}, 3} value. This array represents the following table, with an entry for each soil sublayer:

Soil LayerMaterialMaterial Name
xxx
source
Main.OutputFormat.getMaterialInfoTableFunction
getMaterialInfoTable(outputData::OutputData)

Returns String value containing a table which shows each material, its name, and properties (specific gravity, void ratio, water content).

Uses PrettyTables.jl to convert Array{Union{String, Float64, Int}, 5} given by getMaterialInfoTable() into a String

source
Main.OutputFormat.getMaterialInfoTableValuesFunction
getMaterialInfoTableValues(outputData::OutputData)

Returns Array{Union{String, Float64, Int}, 5} value. This array represents the following table, with an entry for each material:

MaterialMaterial NameSpecific GravityWater ContentVoid Ratio
xxxxx
source
Main.OutputFormat.performGetModelOutputFunction
performGetModelOutput(outputData::OutputData)

Returns the String returned by the getOutput() function of the ModelBehaviour implementation corresponding to the model used in the outputData struct. Uses getModelOutBehaviour() function to get the specific instance of ModelBehaviour.jl related to the outputData.

source
Main.OutputFormat.performGetModelValueFunction
performGetModelValue(outputData::OutputData)

Returns the Model value returned by the getValue() function of the ModelBehaviour implementation corresponding to the model used in the outputData struct. Uses getModelOutBehaviour() function to get the specific instance of ModelBehaviour.jl related to the outputData.

  • ConsolidationSwell
  • Schmertmann
  • SchmertmannElastic
source
Main.OutputFormat.performGetFoundationOutputFunction
performGetFoundationOutput(outputData::OutputData)

Returns the String returned by the getOutput() function of the FoundationBehaviour implementation corresponding to the model used in the outputData struct. Uses getFoundationOutBehaviour() function to get the specific instance of FoundationBehaviour.jl related to the outputData.

source
Main.OutputFormat.performGetFoundationValueFunction
performGetFoundationValue(outputData::OutputData)

Returns the Foundation value returned by the getValue() function of the FoundationBehaviour implementation corresponding to the model used in the outputData struct. Uses getFoundationOutBehaviour() function to get the specific instance of FoundationBehaviour.jl related to the outputData.

  • RectangularSlab
  • LongStripFooting
source
Main.OutputFormat.performGetDisplacementOutputFunction
performGetDisplacementOutput(outputData::OutputData)

Returns the String returned by the getOutput() function of the DisplacementBehaviour implementation corresponding to the model used in the outputData struct. Uses getDisplacementInfoBehaviour() function to get the specific instance of DisplacementBehaviour.jl related to the outputData.

source
Main.OutputFormat.performGetDisplacementValueFunction
performGetDisplacementValue(outputData::OutputData)

Returns the boolean value returned by the getValue() function of the DisplacementBehaviour implementation corresponding to the model used in the outputData struct. Uses getDisplacementInfoBehaviour() function to get the specific instance of DisplacementBehaviour.jl related to the outputData.

  • true - Output increments
  • false - Output total displacements only
source
Main.OutputFormat.performGetEquilibriumOutputFunction
performGetEquilibriumOutput(outputData::OutputData)

Returns the String returned by the getOutput() function of the EquilibriumBehaviour implementation corresponding to the model used in the outputData struct. Uses getEquilibriumInfoBehaviour() function to get the specific instance of EquilibriumBehaviour.jl related to the outputData.

source
Main.OutputFormat.performGetEquilibriumValueFunction
performGetEquilibriumValue(outputData::OutputData)

Returns the boolean value returned by the getValue() function of the EquilibriumBehaviour implementation corresponding to the model used in the outputData struct. Uses getEquilibriumInfoBehaviour() function to get the specific instance of EquilibriumBehaviour.jl related to the outputData.

  • true - Saturation above ground water table
  • false - Hydrostatic profile above ground water table
source
Main.OutputFormat.performGetForcePointOutputFunction
performGetForcePointOutput(outputData::OutputData)

Returns the String returned by the getOutput() function of the ForcePointBehaviour implementation corresponding to the model used in the outputData struct. Uses getForcePointOutputBehaviour() function to get the specific instance of ForcePointBehaviour.jl related to the outputData.

source
Main.OutputFormat.performGetForcePointValueFunction
performGetForcePointValue(outputData::OutputData)

Returns the boolean value returned by the getValue() function of the ForcePointBehaviour implementation corresponding to the model used in the outputData struct. Uses getForcePointOutputBehaviour() function to get the specific instance of ForcePointBehaviour.jl related to the outputData.

  • true - Force applied at center of foundation
  • false - Force applied at corner or edge
source
Main.OutputFormat.performGetCalculationOutputFunction
performGetCalculationOutput(outputData::OutputData)

Returns the String returned by the getOutput() function of the CalculationBehaviour implementation corresponding to the model used in the outputData struct. Uses getCalculationOutputBehaviour() function to get the specific instance of CalculationBehaviour.jl related to the outputData.

source
Main.OutputFormat.performGetCalculationValueFunction
performGetCalculationValue(outputData)

Returns the Tuple returned by the getValue() function of the CalculationBehaviour implementation corresponding to the model user in the outputData struct. Uses getCalculationOutputBehaviour() function to get the specific instance of CalculationBehaviour.jl related to the outputData.

Tuple Contents

Depending on the model of the calculations, getValue() returns a Tuple containing different info. This info is specified below:

  • Consolidation / Swell: (P::Array{Float64}, PP::Array{Float64}, heaveAboveFoundationTable::Array{Union{Int, Float64}, 4}, heaveBelowFoundationTable::Array{Union{Int, Float64}, 4}, Δh1::Float64, Δh2::Float64, Δh::Float64)

    • P: Array of effective stresses of each soil sublayer after applying foundational forces.
    • PP: Array of effective stresses of each soil sublayer before applying foundational forces.
    • heaveAboveFoundationTable: Table containing heave contribution, depth and excess pore pressure values of each soil sublayer above the foundation.
    • heaveBelowFoundationTable: Table containing heave contribution, depth and excess pore pressure values of each soil sublayer below the foundation.
    • Δh1: total heave contribution above foundation.
    • Δh2: total heave contribution below foundation.
    • Δh: total heave contribution of soil profile.
  • Schmertmann: (P::Array{Float64}, PP::Array{Float64}, settlementTable::Array{Union{Int, Float64}, 3}, Δh::Float64)

    • P: Array of effective stresses of each soil sublayer after applying foundational forces.
    • PP: Array of effective stresses of each soil sublayer before applying foundational forces.
    • settlementTable: Table containing settlement vs depth info for each soil sublayer.
    • Δh: total settlement of soil profile.
  • Schmertmann Elastic: (P::Array{Float64}, PP::Array{Float64}, settlementTable::Array{Union{Int, Float64}, 3}, Δh::Float64)

    • P: Array of effective stresses of each soil sublayer after applying foundational forces.
    • PP: Array of effective stresses of each soil sublayer before applying foundational forces.
    • settlementTable: Table containing settlement vs depth info for each soil sublayer.
    • Δh: total settlement of soil profile.
source

Specific Behaviour Functions

The following functions are used to get specific instances of the "changing behaviour" modules of VDisp.

Main.OutputFormat.getModelOutBehaviourFunction
getModelOutBehaviour(outputData::OutputData)

Returns specific implementation of ModelOutBehaviour given an instance of the OutputData struct.

  • outputData.inputData.model == ConsolidationSwell: returns ConsolidationSwellBehaviour
  • outputData.inputData.model == Schmertmann: returns SchmertmannBehaviour
  • outputData.inputData.model == SchmertmannElastic: returns SchmertmannElasticBehaviour
source
Main.OutputFormat.getFoundationOutBehaviourFunction
getFoundationOutBehaviour(outputData::OutputData)

Returns specific implementation of FoundationBehaviour given an instance of the OutputData struct.

  • outputData.inputData.foundation == RectangularSlab: returns RectangularSlabBehaviour
  • outputData.inputData.foundation == LongStripFooting: returns LongStripFootingBehaviour
source
Main.OutputFormat.getDisplacementInfoBehaviourFunction
getDisplacementInfoBehaviour(outputData::OutputData)

Returns specific implementation of DisplacementBehaviour given an instance of the OutputData struct.

  • outputData.inputData.outputIncrements: returns DisplacementEachDepthBehaviour
  • !outputData.inputData.outputIncrements: returns TotalDisplacementBehaviour
source
Main.OutputFormat.getEquilibriumInfoBehaviourFunction
getEquilibriumInfoBehaviour(outputData::OutputData)

Returns specific implementation of EquilibriumBehaviour given an instance of the OutputData struct.

  • outputData.inputData.equilibriumMoistureProfile: returns EquilibriumSaturatedBehaviour
  • !outputData.inputData.equilibriumMoistureProfile: returns EquilibriumHydrostaticBehaviour
source
Main.OutputFormat.getForcePointOutputBehaviourFunction
getForcePointOutputBehaviour(outputData::OutputData)

Returns specific implementation of ForcePointBehaviour given an instance of the OutputData struct.

  • outputData.inputData.center: returns CenterForceBehaviour
  • !outputData.inputData.center: returns EdgeForceBehaviour
source
Main.OutputFormat.getCalculationOutputBehaviourFunction
getCalculationOutputBehaviour(outputData::OutputData)

Returns specific implementation of CalculationBehaviour given an instance of the OutputData struct.

  • outputData.inputData.model == ConsolidationSwell: returns ConsolidationSwellCalculationBehaviour
  • outputData.inputData.model == Schmertmann: returns SchmertmannCalculationBehaviour
  • outputData.inputData.model == SchmertmannElastic: returns SchmertmannElasticCalculationBehaviour
source