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.writeOutput — FunctionwriteOutput(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 thisStringends 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.
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.getHeader — FunctiongetHeader(outputData::OutputData)Returns String value stating the title of the problem, and depth increments of each layer.
Main.OutputFormat.getHeaderValues — FunctiongetHeaderValues(outputData::OutputData)Returns a Tuple containing the ordered pair (problemName::Float64, soilLayers::Int, dx::Array{Float64}).
Main.OutputFormat.getFoundationDepth — FunctiongetFoundationDepth(outputData::OutputData)Returns String value stating depth of foundation and total depth of the soil profile.
Main.OutputFormat.getFoundationDepthValues — FunctiongetFoundationDepthValues(outputData::OutputData)Returns a Tuple containing the ordered pair (foundationDepth::Float64, totalDepth::Float64).
Main.OutputFormat.getSoilTable — FunctiongetSoilTable(outputData::OutputData)Returns String value containing a table which shows each soil sublayer, its material and material name.
Uses
PrettyTables.jlto convertArray{Union{String, Int}, 3}given bygetMaterialInfoTable()into aString
Main.OutputFormat.getSoilTableValues — FunctiongetSoilTableValues(outputData::OutputData)Returns Array{Union{String, Float64, Int}, 3} value. This array represents the following table, with an entry for each soil sublayer:
| Soil Layer | Material | Material Name |
|---|---|---|
| x | x | x |
Main.OutputFormat.getMaterialInfoTable — FunctiongetMaterialInfoTable(outputData::OutputData)Returns String value containing a table which shows each material, its name, and properties (specific gravity, void ratio, water content).
Uses
PrettyTables.jlto convertArray{Union{String, Float64, Int}, 5}given bygetMaterialInfoTable()into aString
Main.OutputFormat.getMaterialInfoTableValues — FunctiongetMaterialInfoTableValues(outputData::OutputData)Returns Array{Union{String, Float64, Int}, 5} value. This array represents the following table, with an entry for each material:
| Material | Material Name | Specific Gravity | Water Content | Void Ratio |
|---|---|---|---|---|
| x | x | x | x | x |
Main.OutputFormat.getDepthToGroundWaterTable — FunctiongetDepthToGroundWaterTable(outputData::OutputData)Returns String value stating the ground water table depth
Main.OutputFormat.getDepthToGroundWaterTableValue — FunctiongetDepthToGroundWaterTableValue(outputData::OutputData)Returns Float64 value of the depth to the ground water table
Main.OutputFormat.performGetModelOutput — FunctionperformGetModelOutput(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.
Main.OutputFormat.performGetModelValue — FunctionperformGetModelValue(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
Main.OutputFormat.performGetFoundationOutput — FunctionperformGetFoundationOutput(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.
Main.OutputFormat.performGetFoundationValue — FunctionperformGetFoundationValue(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.
RectangularSlabLongStripFooting
Main.OutputFormat.performGetDisplacementOutput — FunctionperformGetDisplacementOutput(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.
Main.OutputFormat.performGetDisplacementValue — FunctionperformGetDisplacementValue(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 incrementsfalse- Output total displacements only
Main.OutputFormat.performGetEquilibriumOutput — FunctionperformGetEquilibriumOutput(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.
Main.OutputFormat.performGetEquilibriumValue — FunctionperformGetEquilibriumValue(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 tablefalse- Hydrostatic profile above ground water table
Main.OutputFormat.performGetForcePointOutput — FunctionperformGetForcePointOutput(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.
Main.OutputFormat.performGetForcePointValue — FunctionperformGetForcePointValue(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 foundationfalse- Force applied at corner or edge
Main.OutputFormat.performGetCalculationOutput — FunctionperformGetCalculationOutput(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.
Main.OutputFormat.performGetCalculationValue — FunctionperformGetCalculationValue(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.
Specific Behaviour Functions
The following functions are used to get specific instances of the "changing behaviour" modules of VDisp.
Main.OutputFormat.getModelOutBehaviour — FunctiongetModelOutBehaviour(outputData::OutputData)Returns specific implementation of ModelOutBehaviour given an instance of the OutputData struct.
outputData.inputData.model == ConsolidationSwell: returnsConsolidationSwellBehaviouroutputData.inputData.model == Schmertmann: returnsSchmertmannBehaviouroutputData.inputData.model == SchmertmannElastic: returnsSchmertmannElasticBehaviour
Main.OutputFormat.getFoundationOutBehaviour — FunctiongetFoundationOutBehaviour(outputData::OutputData)Returns specific implementation of FoundationBehaviour given an instance of the OutputData struct.
outputData.inputData.foundation == RectangularSlab: returnsRectangularSlabBehaviouroutputData.inputData.foundation == LongStripFooting: returnsLongStripFootingBehaviour
Main.OutputFormat.getDisplacementInfoBehaviour — FunctiongetDisplacementInfoBehaviour(outputData::OutputData)Returns specific implementation of DisplacementBehaviour given an instance of the OutputData struct.
outputData.inputData.outputIncrements: returnsDisplacementEachDepthBehaviour!outputData.inputData.outputIncrements: returnsTotalDisplacementBehaviour
Main.OutputFormat.getEquilibriumInfoBehaviour — FunctiongetEquilibriumInfoBehaviour(outputData::OutputData)Returns specific implementation of EquilibriumBehaviour given an instance of the OutputData struct.
outputData.inputData.equilibriumMoistureProfile: returnsEquilibriumSaturatedBehaviour!outputData.inputData.equilibriumMoistureProfile: returnsEquilibriumHydrostaticBehaviour
Main.OutputFormat.getForcePointOutputBehaviour — FunctiongetForcePointOutputBehaviour(outputData::OutputData)Returns specific implementation of ForcePointBehaviour given an instance of the OutputData struct.
outputData.inputData.center: returnsCenterForceBehaviour!outputData.inputData.center: returnsEdgeForceBehaviour
Main.OutputFormat.getCalculationOutputBehaviour — FunctiongetCalculationOutputBehaviour(outputData::OutputData)Returns specific implementation of CalculationBehaviour given an instance of the OutputData struct.
outputData.inputData.model == ConsolidationSwell: returnsConsolidationSwellCalculationBehaviouroutputData.inputData.model == Schmertmann: returnsSchmertmannCalculationBehaviouroutputData.inputData.model == SchmertmannElastic: returnsSchmertmannElasticCalculationBehaviour