Model Factory - Functions
Index
PeriLab.Solver_Manager.Model_Factory.Damage.DamageBaseParamsPeriLab.Solver_Manager.Model_Factory.Material.ElasticModuliPeriLab.Solver_Manager.Model_Factory.Material.MaterialBaseParamsPeriLab.Solver_Manager.Model_Factory.Thermal.ThermalBaseParamsPeriLab.Solver_Manager.Model_Factory.Additive.compute_modelPeriLab.Solver_Manager.Model_Factory.Additive.fields_for_local_synchronizationPeriLab.Solver_Manager.Model_Factory.Additive.init_fieldsPeriLab.Solver_Manager.Model_Factory.Additive.init_modelPeriLab.Solver_Manager.Model_Factory.Additive.load_licensed_modelsPeriLab.Solver_Manager.Model_Factory.Additive.load_licensed_modelsPeriLab.Solver_Manager.Model_Factory.Damage.compute_modelPeriLab.Solver_Manager.Model_Factory.Damage.critical_value_lookupPeriLab.Solver_Manager.Model_Factory.Damage.damage_indexPeriLab.Solver_Manager.Model_Factory.Damage.fields_for_local_synchronizationPeriLab.Solver_Manager.Model_Factory.Damage.init_fieldsPeriLab.Solver_Manager.Model_Factory.Damage.init_inverse_bond_idPeriLab.Solver_Manager.Model_Factory.Damage.init_modelPeriLab.Solver_Manager.Model_Factory.Degradation.compute_modelPeriLab.Solver_Manager.Model_Factory.Degradation.fields_for_local_synchronizationPeriLab.Solver_Manager.Model_Factory.Degradation.init_fieldsPeriLab.Solver_Manager.Model_Factory.Degradation.init_modelPeriLab.Solver_Manager.Model_Factory.Material.bind_material!PeriLab.Solver_Manager.Model_Factory.Material.block_materialPeriLab.Solver_Manager.Model_Factory.Material.check_material_symmetryPeriLab.Solver_Manager.Model_Factory.Material.compute_modelPeriLab.Solver_Manager.Model_Factory.Material.correspondence_modelPeriLab.Solver_Manager.Model_Factory.Material.critical_bulk_modulusPeriLab.Solver_Manager.Model_Factory.Material.distribute_force_densitiesPeriLab.Solver_Manager.Model_Factory.Material.elastic_moduliPeriLab.Solver_Manager.Model_Factory.Material.fields_for_local_synchronizationPeriLab.Solver_Manager.Model_Factory.Material.hooke_symmetryPeriLab.Solver_Manager.Model_Factory.Material.init_fieldsPeriLab.Solver_Manager.Model_Factory.Material.init_modelPeriLab.Solver_Manager.Model_Factory.Material.is_bond_basedPeriLab.Solver_Manager.Model_Factory.Material.is_correspondencePeriLab.Solver_Manager.Model_Factory.Material.material_symmetryPeriLab.Solver_Manager.Model_Factory.Material.symmetry_keysPeriLab.Solver_Manager.Model_Factory.Pre_Calculation.active_pre_calculationsPeriLab.Solver_Manager.Model_Factory.Pre_Calculation.check_dependenciesPeriLab.Solver_Manager.Model_Factory.Pre_Calculation.compute_modelPeriLab.Solver_Manager.Model_Factory.Pre_Calculation.fields_for_local_synchronizationPeriLab.Solver_Manager.Model_Factory.Pre_Calculation.init_fieldsPeriLab.Solver_Manager.Model_Factory.Pre_Calculation.init_modelPeriLab.Solver_Manager.Model_Factory.Pre_Calculation.order_pre_calculationsPeriLab.Solver_Manager.Model_Factory.Pre_Calculation.pre_calculationPeriLab.Solver_Manager.Model_Factory.Thermal.compute_modelPeriLab.Solver_Manager.Model_Factory.Thermal.fields_for_local_synchronizationPeriLab.Solver_Manager.Model_Factory.Thermal.init_fieldsPeriLab.Solver_Manager.Model_Factory.Thermal.init_modelPeriLab.Solver_Manager.Model_Factory.add_modelPeriLab.Solver_Manager.Model_Factory.block_typed_modelPeriLab.Solver_Manager.Model_Factory.compute_crititical_time_stepPeriLab.Solver_Manager.Model_Factory.compute_mechanical_critical_time_stepPeriLab.Solver_Manager.Model_Factory.compute_modelsPeriLab.Solver_Manager.Model_Factory.compute_stiff_matrix_compatible_modelsPeriLab.Solver_Manager.Model_Factory.compute_thermodynamic_critical_time_stepPeriLab.Solver_Manager.Model_Factory.get_cs_denominatorPeriLab.Solver_Manager.Model_Factory.init_modelsPeriLab.Solver_Manager.Model_Factory.read_propertiesPeriLab.Solver_Manager.Model_Factory.set_heat_capacityPeriLab.Solver_Manager.Model_Factory.test_timestep
Models
PeriLab.Solver_Manager.Model_Factory.add_model — Function
add_model(model_name::String)Includes the models in the Data_Manager and checks if the model definition is correct or not.
Arguments
model_name::String: The block nodes
PeriLab.Solver_Manager.Model_Factory.block_typed_model — Method
block_typed_model(input, block_name, field, category, models)The parsed model a block names in field (e.g. :damage_model), or nothing. Aborts if the name or the category's models section is missing.
PeriLab.Solver_Manager.Model_Factory.compute_crititical_time_step — Method
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: Iftrue, mechanical properties are considered in the calculation.thermo::Bool: Iftrue, 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 ifthermoistrueto calculate thermodynamic critical time steps.compute_mechanical_critical_time_step: Used ifmechanicalistrueto 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.
PeriLab.Solver_Manager.Model_Factory.compute_mechanical_critical_time_step — Method
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 [43].
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.
PeriLab.Solver_Manager.Model_Factory.compute_models — Method
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 nodesdt::Float64: The time steptime::Float64: The current time of the solveroptions::Vector{String}: The optionssynchronise_field: The synchronise field
PeriLab.Solver_Manager.Model_Factory.compute_stiff_matrix_compatible_models — Method
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 nodesdt::Float64: The time steptime::Float64: The current time of the solveroptions::Vector{String}: The optionssynchronise_field: The synchronise field
PeriLab.Solver_Manager.Model_Factory.compute_thermodynamic_critical_time_step — Method
compute_thermodynamic_critical_time_step(nodes::AbstractVector{Int64}, lambda::Float64, Cv::Float64)Calculate the critical time step for a thermodynamic simulation based on [28].
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.
PeriLab.Solver_Manager.Model_Factory.get_cs_denominator — Method
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.
PeriLab.Solver_Manager.Model_Factory.init_models — Method
init_models(input::PeriLabInput, block_nodes::Dict{Int64,Vector{Int64}}, models::Vector{String}, all_models::Vector{String}, calculation::CalculationOptions, synchronise_field)Initialize models
Arguments
input::PeriLabInput: The typed input deck.block_nodes::Dict{Int64,Vector{Int64}}: block nodes.models::Vector{String}: Model categories of the step.all_models::Vector{String}: Model categories of all steps.calculation::CalculationOptions: Which stress and strain fields to create.
PeriLab.Solver_Manager.Model_Factory.read_properties — Method
read_properties(input::PeriLabInput, material_model::Bool)Stores the typed models every block names (material, damage, additive, degradation, thermal, pre-calculation) in Data_Manager; aborts on undefined model names.
Arguments
input::PeriLabInput: The typed input deck.material_model::Bool: Material model.
PeriLab.Solver_Manager.Model_Factory.set_heat_capacity — Method
set_heat_capacity(input::PeriLabInput, block_nodes::Dict, heat_capacity::NodeScalarField{Float64})Sets the heat capacity of the nodes in the dictionary.
Arguments
input::PeriLabInput: The typed input deck (Specific Heat Capacityof the blocks)block_nodes::Dict: The block nodesheat_capacity::NodeScalarField{Float64}: The heat capacity array
Returns
heat_capacity::SubArray: The heat capacity array
PeriLab.Solver_Manager.Model_Factory.test_timestep — Method
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 withcritical_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 originalcritical_time_steport, whichever is smaller.
Additive
PeriLab.Solver_Manager.Model_Factory.Additive.compute_model — Method
compute_model(nodes::AbstractVector{Int64}, p, block::Int64, time::Float64, dt::Float64)Computes the additive model of a block.
Arguments
nodes::AbstractVector{Int64}: The nodesp: The typed additive model of the blockblock::Int64: The blocktime::Float64: The current timedt::Float64: The time step
PeriLab.Solver_Manager.Model_Factory.Additive.fields_for_local_synchronization — Method
fields_for_local_synchronization(model, block)Defines all synchronization fields for local synchronization
Arguments
model::String: Model class.block::Int64: block ID
PeriLab.Solver_Manager.Model_Factory.Additive.init_fields — Method
init_fields()Initialize additive model fields
PeriLab.Solver_Manager.Model_Factory.Additive.init_model — Method
init_model(nodes::AbstractVector{Int64}, block::Int64)Initialize the additive model of a block (Data_Manager.get_block_models(block).additive).
Arguments
nodes::AbstractVector{Int64}: Nodes for the additive model.block::Int64: Block identifier for the additive model.
PeriLab.Solver_Manager.Model_Factory.Additive.load_licensed_models — Method
load_licensed_models(raw_deck)Loads the licensed additive modules only if the raw input deck (the YAML dict) has Models: Additive Models, so that runs without additive models never contact the license server.
PeriLab.Solver_Manager.Model_Factory.Additive.load_licensed_models — Method
load_licensed_models()Includes the licensed additive modules (if a license is configured) so that they register their parameter structs before the input deck is read. Runs once.
Damage
PeriLab.Solver_Manager.Model_Factory.Damage.compute_model — Method
compute_model(nodes, damage, block, time, dt)Binds the damage's dependent values, computes the block's damage model and the damage index.
Arguments
nodes::AbstractVector{Int64}: The nodesdamage::BlockDamage: The typed damage model of the blockblock::Int64: The blocktime::Float64: The current timedt::Float64: The time step
PeriLab.Solver_Manager.Model_Factory.Damage.critical_value_lookup — Method
critical_value_lookup(critical_value, inter_block_damage::Bool, block::Int64)Returns (iID, neighborID) -> critical value of a bond: the Critical_Value node field if it exists, else the interblock matrix, else the Critical Value parameter. Each case is its own closure type, so a bond loop taking it as an argument is type stable.
PeriLab.Solver_Manager.Model_Factory.Damage.damage_index — Method
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
PeriLab.Solver_Manager.Model_Factory.Damage.fields_for_local_synchronization — Method
fields_for_local_synchronization(model, block)Defines all synchronization fields for local synchronization
Arguments
model::String: Model class.block::Int64: block ID
PeriLab.Solver_Manager.Model_Factory.Damage.init_fields — Method
init_fields()Creates the damage field and the inverse neighbor list.
PeriLab.Solver_Manager.Model_Factory.Damage.init_inverse_bond_id — Method
init_inverse_bond_id()Creates (once) the bond field "Inverse Bond ID", the bond-indexed inverse neighborhood list (see find_inverse_bond_index!), and returns it.
PeriLab.Solver_Manager.Model_Factory.Damage.init_model — Method
init_model(nodes::AbstractVector{Int64}, block::Int64)Initializes the damage model of a block (Data_Manager.get_block_models(block).damage), its interface and anisotropic critical values.
Arguments
nodes::AbstractVector{Int64}: Nodes of the block.block::Int64: Block identifier.
PeriLab.Solver_Manager.Model_Factory.Damage.DamageBaseParams — Type
DamageBaseParamsKeys every damage model may use (read from the same YAML block as the model's own keys).
Degradation
PeriLab.Solver_Manager.Model_Factory.Degradation.compute_model — Method
compute_model(nodes::AbstractVector{Int64}, p, block::Int64, time::Float64, dt::Float64)Computes the degradation model of a block.
Arguments
nodes::AbstractVector{Int64}: The nodesp: The typed degradation model of the blockblock::Int64: The blocktime::Float64: The current timedt::Float64: The time step
PeriLab.Solver_Manager.Model_Factory.Degradation.fields_for_local_synchronization — Method
fields_for_local_synchronization(model, block)Defines all synchronization fields for local synchronization
Arguments
model::String: Model class.block::Int64: block ID
PeriLab.Solver_Manager.Model_Factory.Degradation.init_fields — Method
init_fields()
Initialize model fields
PeriLab.Solver_Manager.Model_Factory.Degradation.init_model — Method
init_model(nodes::AbstractVector{Int64}, block::Int64)Initialize the degradation model of a block (Data_Manager.get_block_models(block).degradation).
Arguments
nodes::AbstractVector{Int64}: Nodes for the degradation model.block::Int64: Block identifier for the degradation model.
Material
PeriLab.Solver_Manager.Model_Factory.Material.bind_material! — Method
bind_material!(material)Binds the dependent tables of a block material to the current node fields. Call it before every evaluation, because the N/NP1 field arrays are swapped every step.
PeriLab.Solver_Manager.Model_Factory.Material.block_material — Method
block_material(wb, dof)The BlockMaterial of a parsed material block (bond-based models fix Poisson's ratio).
PeriLab.Solver_Manager.Model_Factory.Material.check_material_symmetry — Method
check_material_symmetry(material, dof)2D needs plane strain or plane stress in Symmetry; in 3D these are ignored (with a warning). A missing Symmetry is not checked here (isotropic).
PeriLab.Solver_Manager.Model_Factory.Material.compute_model — Method
compute_model(nodes::AbstractVector{Int64}, material, block::Int64, time::Float64, dt::Float64)Computes the material models
Arguments
nodes::AbstractVector{Int64}: The nodesmaterial::BlockMaterial: The typed block materialblock::Int64: The blocktime::Float64: The current timedt::Float64: The time step
PeriLab.Solver_Manager.Model_Factory.Material.correspondence_model — Method
correspondence_model(model, name)true if the parts of model are correspondence models. Correspondence and other material models cannot be combined with +.
PeriLab.Solver_Manager.Model_Factory.Material.critical_bulk_modulus — Method
critical_bulk_modulus(material)Bulk modulus used for the critical time step (legacy rules): the isotropic bulk modulus; for orthotropic constants the compliance-based estimate; else C44/C55/C66 or Shear Modulus XY as estimates; nothing if none is defined.
PeriLab.Solver_Manager.Model_Factory.Material.distribute_force_densities — Method
distribute_force_densities(nodes::AbstractVector{Int64})Distribute the force densities.
Arguments
nodes::AbstractVector{Int64}: The nodes.
PeriLab.Solver_Manager.Model_Factory.Material.elastic_moduli — Method
elastic_moduli(base, bond_based, dof)Completes the isotropic elastic constants from any two of bulk modulus, Young's modulus, shear modulus and Poisson's ratio (bond-based models: Poisson's ratio is fixed). Moduli given per node (fields Bulk_Modulus, …) or a State Factor ID make the result per node, and the node fields are updated. Returns nothing for anisotropic, orthotropic and transverse isotropic materials (stiffness matrix; completeness is checked when the input is read).
PeriLab.Solver_Manager.Model_Factory.Material.fields_for_local_synchronization — Method
fields_for_local_synchronization(model, block)Defines all synchronization fields for local synchronization
Arguments
model::String: Model class.block::Int64: block id
PeriLab.Solver_Manager.Model_Factory.Material.hooke_symmetry — Method
hooke_symmetry(symmetry, dof)The symmetry string the Hooke matrix uses: as given, with a trailing plane strain / plane stress removed in 3D, "isotropic" if missing.
PeriLab.Solver_Manager.Model_Factory.Material.init_fields — Method
init_fields()Initialize material model fields
PeriLab.Solver_Manager.Model_Factory.Material.init_model — Method
init_model(nodes::Union{SubArray,Vector{Int64}, block::Int64)Initializes the material model.
Arguments
nodes::AbstractVector{Int64}: The nodes.block::Int64: Block.
PeriLab.Solver_Manager.Model_Factory.Material.is_bond_based — Method
Bond-based models (not Unified Bond-based) fix Poisson's ratio.
PeriLab.Solver_Manager.Model_Factory.Material.is_correspondence — Method
A model struct defined in the Correspondence module (a correspondence formulation).
PeriLab.Solver_Manager.Model_Factory.Material.material_symmetry — Method
material_symmetry(symmetry, dof)The symmetry the force models use. Plane strain / plane stress are ignored in 3D; every other symmetry gives "3D".
PeriLab.Solver_Manager.Model_Factory.Material.symmetry_keys — Method
symmetry_keys(symmetry)YAML keys of the stiffness-matrix constants symmetry requires; empty for an isotropic material (two of the isotropic constants).
PeriLab.Solver_Manager.Model_Factory.Material.ElasticModuli — Type
ElasticModuliCompleted isotropic elastic constants of a block. Each entry is a Float64, or a node field (Vector{Float64}) when moduli are given per node (mesh columns Bulk_Modulus, …) or scaled by a state variable. Read one with modulus(x, iID).
PeriLab.Solver_Manager.Model_Factory.Material.MaterialBaseParams — Type
MaterialBaseParamsKeys every material model may use (read from the same YAML block as the model's own keys): symmetry, elastic constants, and options shared by the material framework. Which elastic constants are needed depends on the model and the symmetry; they are completed at initialisation.
Thermal
PeriLab.Solver_Manager.Model_Factory.Thermal.compute_model — Method
compute_model(nodes::AbstractVector{Int64}, thermal::WithBase, block::Int64, time::Float64, dt::Float64)Computes every part of the block's thermal model, in deck order.
Arguments
nodes::AbstractVector{Int64}: The nodesthermal::WithBase: The typed thermal model of the block (thermal.base: Thermal Conductivity)block::Int64: The blocktime::Float64: The current timedt::Float64: The time step
PeriLab.Solver_Manager.Model_Factory.Thermal.fields_for_local_synchronization — Method
fields_for_local_synchronization(model, block)Defines all synchronization fields for local synchronization
Arguments
model::String: Model class.block::Int64: block ID
PeriLab.Solver_Manager.Model_Factory.Thermal.init_fields — Method
init_fields()Initialize thermal model fields
PeriLab.Solver_Manager.Model_Factory.Thermal.init_model — Method
init_model(nodes::AbstractVector{Int64}, block::Int64)Initializes every part of the block's thermal model (Data_Manager.get_block_models(block).thermal).
Arguments
nodes::AbstractVector{Int64}: The nodes.block::Int64: Block.
PeriLab.Solver_Manager.Model_Factory.Thermal.ThermalBaseParams — Type
ThermalBaseParamsKeys every thermal model may use: Thermal Conductivity (read by the critical time step for any thermal model, and by Thermal Flow).
Pre_Calculation
PeriLab.Solver_Manager.Model_Factory.Pre_Calculation.active_pre_calculations — Method
Active names of switches (on/off per pre-calculation), in run order.
PeriLab.Solver_Manager.Model_Factory.Pre_Calculation.check_dependencies — Method
check_dependencies(block_nodes::Dict{Int64,Vector{Int64}})Adds the pre-calculations the block's material needs, and the ones the active pre-calculations depend on, and stores the block's list in run order.
Arguments
block_nodes::Dict{Int64,Vector{Int64}}: block nodes.
PeriLab.Solver_Manager.Model_Factory.Pre_Calculation.compute_model — Method
compute_model(nodes::AbstractVector{Int64}, names::Vector{String}, block::Int64, time::Float64, dt::Float64)Computes the block's active pre-calculations in run order.
Arguments
nodes::AbstractVector{Int64}: The nodesnames::Vector{String}: The active pre-calculations of the blockblock::Int64: The blocktime::Float64: The current timedt::Float64: The time step
PeriLab.Solver_Manager.Model_Factory.Pre_Calculation.fields_for_local_synchronization — Method
fields_for_local_synchronization(model, block)Defines all synchronization fields for local synchronization
Arguments
model::String: Model class.block::Int64: block ID
PeriLab.Solver_Manager.Model_Factory.Pre_Calculation.init_fields — Method
init_fields()Initializes the fields.
PeriLab.Solver_Manager.Model_Factory.Pre_Calculation.init_model — Method
init_model(nodes::AbstractVector{Int64}, block::Int64)Initializes the block's active pre-calculations (Data_Manager.get_block_models(block).pre_calculation).
Arguments
nodes::AbstractVector{Int64}: The nodes.block::Int64: Block.
PeriLab.Solver_Manager.Model_Factory.Pre_Calculation.order_pre_calculations — Method
names in run order: the fixed order first, then the others sorted.
PeriLab.Solver_Manager.Model_Factory.Pre_Calculation.pre_calculation — Method
The parameters of the registered pre-calculation name (a switch: they have no keys).