Model Factory - Functions

Index

Models

PeriLab.Solver_Manager.Model_Factory.compute_crititical_time_stepMethod
compute_crititical_time_step(block_nodes::Dict{Int64,Vector{Int64}}, mechanical::Bool, thermo::Bool)

Calculate the critical time step for a simulation considering both mechanical and thermodynamic aspects.

This function computes the critical time step by considering mechanical and thermodynamic properties of different blocks. The resulting critical time step is based on the smallest critical time step found among the blocks.

Arguments

  • block_nodes::Dict{Int64, Vector{Int64}}: A dictionary mapping block IDs to collections of nodes.
  • mechanical::Bool: If true, mechanical properties are considered in the calculation.
  • thermo::Bool: If true, thermodynamic properties are considered in the calculation.

Returns

  • Float64: The calculated critical time step based on the smallest critical time step found among the blocks.

Dependencies

This function may depend on the following functions:

  • compute_thermodynamic_critical_time_step: Used if thermo is true to calculate thermodynamic critical time steps.
  • compute_mechanical_critical_time_step: Used if mechanical is true to calculate mechanical critical time steps.
  • The availability of specific properties from the data manager module.

Errors

  • If required properties are not available in the data manager, it may raise an error message.
source
PeriLab.Solver_Manager.Model_Factory.compute_mechanical_critical_time_stepMethod
compute_mechanical_critical_time_step(nodes::AbstractVector{Int64}, bulk_modulus::Float64)

Calculate the critical time step for a mechanical simulation using a bond-based approximation [38].

This function iterates over a collection of nodes and computes the critical time step for each node based on the given input data and parameters.

Arguments

  • nodes::AbstractVector{Int64}: The collection of nodes to calculate the critical time step for.
  • bulk_modulus::Float64: The bulk modulus used in the calculations.

Returns

  • Float64: The calculated critical time step for the mechanical simulation.

Dependencies

This function depends on the following data fields from the Data_Manager module:

  • get_nlist(): Returns the neighbor list.
  • get_field("Density"): Returns the density field.
  • get_field("Bond Length"): Returns the bond distance field.
  • get_field("Volume"): Returns the volume field.
  • get_field("Horizon"): Returns the horizon field.
source
PeriLab.Solver_Manager.Model_Factory.compute_modelsMethod
compute_models(block_nodes::Dict{Int64,Vector{Int64}}, dt::Float64, time::Float64, options::Vector{String}, synchronise_field)

Computes the material point models

Arguments

  • block_nodes::Dict{Int64,Vector{Int64}}: The block nodes
  • dt::Float64: The time step
  • time::Float64: The current time of the solver
  • options::Vector{String}: The options
  • synchronise_field: The synchronise field
source
PeriLab.Solver_Manager.Model_Factory.compute_stiff_matrix_compatible_modelsMethod
compute_stiff_matrix_compatible_models(block_nodes::Dict{Int64,Vector{Int64}}, dt::Float64, time::Float64, options::Vector{String}, synchronise_field)

Computes the models models that are compatible with the stiffness matrix calculation.

Arguments

  • block_nodes::Dict{Int64,Vector{Int64}}: The block nodes
  • dt::Float64: The time step
  • time::Float64: The current time of the solver
  • options::Vector{String}: The options
  • synchronise_field: The synchronise field
source
PeriLab.Solver_Manager.Model_Factory.compute_thermodynamic_critical_time_stepMethod
compute_thermodynamic_critical_time_step(nodes::AbstractVector{Int64}, lambda::Float64, Cv::Float64)

Calculate the critical time step for a thermodynamic simulation based on [24].

This function iterates over a collection of nodes and computes the critical time step for each node using provided input data and parameters.

Arguments

  • nodes::AbstractVector{Int64}: The collection of nodes to calculate the critical time step for.
  • lambda::Float64: The material parameter used in the calculations.
  • Cv::Float64: The heat capacity at constant volume used in the calculations.

Returns

  • Float64: The calculated critical time step for the thermodynamic simulation.

Dependencies

This function depends on the following data fields from the Data_Manager module:

  • get_nlist(): Returns the neighbor list.
  • get_field("Density"): Returns the density field.
  • get_field("Bond Length"): Returns the bond distance field.
  • get_field("Volume"): Returns the volume field.
  • get_field("Number of Neighbors"): Returns the number of neighbors field.
source
PeriLab.Solver_Manager.Model_Factory.get_block_model_definitionFunction
get_block_model_definition(params::Dict, block_id_list::Int64, prop_keys::Vector{String}, properties)

Get block model definition.

Special case for pre calculation. It is set to all blocks, if no block definition is defined, but pre calculation is.

Arguments

  • params::Dict: Parameters.
  • block_id_list::Vector{Int64}: List of block id's.
  • prop_keys::Vector{String}: Property keys.
  • properties: Properties function.

Returns

  • properties: Properties function.
source
PeriLab.Solver_Manager.Model_Factory.get_cs_denominatorMethod
get_cs_denominator(volume::AbstractVector{Float64}, undeformed_bond::AbstractVector{Float64})

Calculate the denominator for the critical time step calculation.

Arguments

  • volume::AbstractVector{Float64}: The volume field.
  • undeformed_bond::Union{SubArray,Vector{Float64},Vector{Int64}}: The undeformed bond field.

Returns

  • Float64: The denominator for the critical time step calculation.
source
PeriLab.Solver_Manager.Model_Factory.init_modelsMethod
init_models(params::Dict, block_nodes::Dict{Int64,Vector{Int64}}, solver_options::Dict)

Initialize models

Arguments

  • params::Dict: Parameters.
  • block_nodes::Dict{Int64,Vector{Int64}}: block nodes.
  • solver_options::Dict: Solver options.
source
PeriLab.Solver_Manager.Model_Factory.set_heat_capacityMethod
set_heat_capacity(params::Dict, block_nodes::Dict, heat_capacity::NodeScalarField{Float64})

Sets the heat capacity of the nodes in the dictionary.

Arguments

  • params::Dict: The parameters
  • block_nodes::Dict: The block nodes
  • heat_capacity::NodeScalarField{Float64}: The heat capacity array

Returns

  • heat_capacity::SubArray: The heat capacity array
source
PeriLab.Solver_Manager.Model_Factory.test_timestepMethod
test_timestep(t::Float64, critical_time_step::Float64)

Compare a time step t with a critical time step critical_time_step and update critical_time_step if t is smaller.

Arguments

  • t::Float64: The time step to compare with critical_time_step.
  • critical_time_step::Float64: The current critical time step.

Returns

  • critical_time_step::Float64: The updated critical time step, which is either the original critical_time_step or t, whichever is smaller.
source

Additive

PeriLab.Solver_Manager.Model_Factory.Additive.compute_modelMethod
compute_model(nodes::AbstractVector{Int64}, model_param::Dict, block::Int64, time::Float64, dt::Float64)

Computes the addtive models

Arguments

  • nodes::AbstractVector{Int64}: The nodes
  • model_param::Dict: The model parameters
  • block::Int64: The block
  • time::Float64: The current time
  • dt::Float64: The time step
source
PeriLab.Solver_Manager.Model_Factory.Additive.init_modelMethod
init_model(nodes::AbstractVector{Int64}, block::Int64)

Initialize the additive models.

Arguments

  • nodes::AbstractVector{Int64}: Nodes for the additive model.
  • block::Int64: Block identifier for the additive model.

Example

init_model(my_data_manager, [1, 2, 3], 1)
source

Damage

PeriLab.Solver_Manager.Model_Factory.Damage.compute_modelMethod
compute_model(nodes::AbstractVector{Int64}, model_param::Dict, block::Int64, time::Float64, dt::Float64)

Computes the damage model

Arguments

  • nodes::AbstractVector{Int64}: The nodes
  • model_param::Dict: The model parameters
  • block::Int64: The block
  • time::Float64: The current time
  • dt::Float64: The time step
source
PeriLab.Solver_Manager.Model_Factory.Damage.damage_indexMethod
damage_index(::Union{SubArray, Vector{Int64})

Function calculates the damage index related to the neighborhood volume for a set of corresponding nodes. The damage index is defined as damaged volume in relation the neighborhood volume. damageIndex = sumi (brokenBondsi * volume_i) / volumeNeighborhood

Arguments

  • nodes::AbstractVector{Int64}: corresponding nodes to this model
source
PeriLab.Solver_Manager.Model_Factory.Damage.init_modelMethod
init_model(nodes::AbstractVector{Int64}, block::Int64)

Initialize the damage models.

Arguments

  • nodes::AbstractVector{Int64}: Nodes for the degradation model.
  • block::Int64: Block identifier for the degradation model.

Example

init_model(my_data_manager, [1, 2, 3], 1)
source

Degradation

PeriLab.Solver_Manager.Model_Factory.Degradation.compute_modelMethod
compute_model(nodes::AbstractVector{Int64}, model_param::Dict, block::Int64, time::Float64, dt::Float64)

Computes the degradation models

Arguments

  • nodes::AbstractVector{Int64}: The nodes
  • model_param::Dict: The model parameters
  • block::Int64: The block
  • time::Float64: The current time
  • dt::Float64: The time step
source
PeriLab.Solver_Manager.Model_Factory.Degradation.init_modelMethod
init_model(nodes::AbstractVector{Int64}, block::Int64)

Initialize a degradation models.

Arguments

  • nodes::AbstractVector{Int64}: Nodes for the degradation model.
  • block::Int64: Block identifier for the degradation model.

Example

init_model(my_data_manager, [1, 2, 3], 1)
source

Material

PeriLab.Solver_Manager.Model_Factory.Material.compute_modelMethod
compute_model(nodes::AbstractVector{Int64}, model_param::Dict{String,Any}, block::Int64, time::Float64, dt::Float64)

Computes the material models

Arguments

  • nodes::AbstractVector{Int64}: The nodes
  • model_param::Dict{String,Any}: The model parameters
  • block::Int64: The block
  • time::Float64: The current time
  • dt::Float64: The time step
source

Thermal

PeriLab.Solver_Manager.Model_Factory.Thermal.compute_modelMethod
compute_model(nodes::AbstractVector{Int64}, model_param::Dict, block::Int64, time::Float64, dt::Float64)

Computes the thermal models

Arguments

  • nodes::AbstractVector{Int64}: The nodes
  • model_param::Dict: The model parameters
  • block::Int64: The block
  • time::Float64: The current time
  • dt::Float64: The time step
source

Pre_Calculation

PeriLab.Solver_Manager.Model_Factory.Pre_Calculation.compute_modelMethod
compute_model(nodes::AbstractVector{Int64}, model_param::Dict, block::Int64, time::Float64, dt::Float64)

Computes the pre calculation models

Arguments

  • nodes::AbstractVector{Int64}: The nodes
  • model_param::Dict: The model parameters
  • block::Int64: The block
  • time::Float64: The current time
  • dt::Float64: The time step
source

Surface_Correction