Model Factory - Functions
Index
PeriLab.Solver.Model_Factory.Additive.compute_model
PeriLab.Solver.Model_Factory.Additive.init_fields
PeriLab.Solver.Model_Factory.Additive.init_model
PeriLab.Solver.Model_Factory.Damage.compute_model
PeriLab.Solver.Model_Factory.Damage.damage_index
PeriLab.Solver.Model_Factory.Damage.init_aniso_crit_values
PeriLab.Solver.Model_Factory.Damage.init_fields
PeriLab.Solver.Model_Factory.Damage.init_interface_crit_values
PeriLab.Solver.Model_Factory.Damage.init_model
PeriLab.Solver.Model_Factory.Damage.synch_field
PeriLab.Solver.Model_Factory.Material.Set_modules.create_module_specifics
PeriLab.Solver.Model_Factory.Material.Set_modules.create_module_specifics
PeriLab.Solver.Model_Factory.Material.Set_modules.find_jl_files
PeriLab.Solver.Model_Factory.Material.Set_modules.find_module_files
PeriLab.Solver.Model_Factory.Material.Set_modules.include_files
PeriLab.Solver.Model_Factory.Material.check_material_symmetry
PeriLab.Solver.Model_Factory.Material.compute_model
PeriLab.Solver.Model_Factory.Material.determine_isotropic_parameter
PeriLab.Solver.Model_Factory.Material.distribute_force_densities
PeriLab.Solver.Model_Factory.Material.fields_for_local_synchronization
PeriLab.Solver.Model_Factory.Material.init_fields
PeriLab.Solver.Model_Factory.Material.init_model
PeriLab.Solver.Model_Factory.Pre_Calculation.check_dependencies
PeriLab.Solver.Model_Factory.Pre_Calculation.compute_model
PeriLab.Solver.Model_Factory.Pre_Calculation.fields_for_local_synchronization
PeriLab.Solver.Model_Factory.Pre_Calculation.init_fields
PeriLab.Solver.Model_Factory.Pre_Calculation.init_model
PeriLab.Solver.Model_Factory.Thermal.compute_model
PeriLab.Solver.Model_Factory.Thermal.init_fields
PeriLab.Solver.Model_Factory.Thermal.init_model
PeriLab.Solver.Model_Factory.add_model
PeriLab.Solver.Model_Factory.compute_models
PeriLab.Solver.Model_Factory.get_block_model_definition
PeriLab.Solver.Model_Factory.init_models
PeriLab.Solver.Model_Factory.read_properties
PeriLab.Solver.Model_Factory.set_heat_capacity
Models
PeriLab.Solver.Model_Factory.add_model
— Methodadd_model(datamanager::Module, model_name::String)
Includes the models in the datamanager and checks if the model definition is correct or not.
Arguments
datamanager::Module
: Datamanagermodel_name::String
: The block nodes
Returns
datamanager::Module
: Datamanager
PeriLab.Solver.Model_Factory.compute_models
— Methodcompute_models(datamanager::Module, block_nodes::Dict{Int64,Vector{Int64}}, dt::Float64, time::Float64, options::Vector{String}, synchronise_field, to::TimerOutput)
Computes the models models
Arguments
datamanager::Module
: The datamanagerblock_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 fieldto::TimerOutput
: The timer output
Returns
datamanager
: The datamanager
PeriLab.Solver.Model_Factory.get_block_model_definition
— Methodget_block_model_definition(params::Dict, block_id::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.blocks::Vector{Int64}
: List of block id's.prop_keys::Vector{String}
: Property keys.properties
: Properties function.
Returns
properties
: Properties function.
PeriLab.Solver.Model_Factory.init_models
— Methodinit_models(params::Dict, datamanager::Module, block_nodes::Dict{Int64,Vector{Int64}}, solver_options::Dict)
Initialize models
Arguments
params::Dict
: Parameters.datamanager::Module
: Datamanager.block_nodes::Dict{Int64,Vector{Int64}}
: block nodes.solver_options::Dict
: Solver options.
Returns
datamanager::Data_manager
: Datamanager.
PeriLab.Solver.Model_Factory.read_properties
— Methodread_properties(params::Dict, datamanager::Module, material_model::Bool)
Read properties of material.
Arguments
params::Dict
: Parameters.datamanager::Data_manager
: Datamanager.material_model::Bool
: Material model.
Returns
datamanager::Data_manager
: Datamanager.
PeriLab.Solver.Model_Factory.set_heat_capacity
— Methodset_heat_capacity(params::Dict, block_nodes::Dict, heat_capacity::Vector{Float64})
Sets the heat capacity of the nodes in the dictionary.
Arguments
params::Dict
: The parametersblock_nodes::Dict
: The block nodesheat_capacity::Vector{Float64}
: The heat capacity array
Returns
heat_capacity::SubArray
: The heat capacity array
Additive
PeriLab.Solver.Model_Factory.Additive.compute_model
— Methodcompute_model(datamanager::Module, nodes::Union{SubArray,Vector{Int64}}, model_param::Dict, block::Int64, time::Float64, dt::Float64,to::TimerOutput,)
Computes the addtive models
Arguments
datamanager::Module
: The datamanagernodes::Union{SubArray,Vector{Int64}}
: The nodesmodel_param::Dict
: The model parametersblock::Int64
: The blocktime::Float64
: The current timedt::Float64
: The time step
Returns
datamanager::Module
: The datamanager
PeriLab.Solver.Model_Factory.Additive.init_fields
— Methodinit_fields(datamanager::Module)
Initialize additive model fields
Arguments
datamanager::Data_manager
: Datamanager.
Returns
datamanager::Data_manager
: Datamanager.
PeriLab.Solver.Model_Factory.Additive.init_model
— Methodinit_model(datamanager::Module, nodes::Union{SubArray,Vector{Int64}}, block::Int64)
Initialize the additive models.
Arguments
datamanager::Module
: The data manager module where the additive model will be initialized.nodes::Union{SubArray,Vector{Int64}}
: Nodes for the additive model.block::Int64
: Block identifier for the additive model.
Returns
datamanager
: The modified data manager module with the initialized additive model.
Example
```julia datamanager = initmodel(mydata_manager, [1, 2, 3], 1)
Damage
PeriLab.Solver.Model_Factory.Damage.compute_model
— Methodcompute_model(datamanager::Module, nodes::Union{SubArray,Vector{Int64}}, model_param::Dict, block::Int64, time::Float64, dt::Float64,to::TimerOutput,)
Computes the damage model
Arguments
datamanager::Module
: The datamanagernodes::Union{SubArray,Vector{Int64}}
: The nodesmodel_param::Dict
: The model parametersblock::Int64
: The blocktime::Float64
: The current timedt::Float64
: The time step
Returns
datamanager::Module
: The datamanager
PeriLab.Solver.Model_Factory.Damage.damage_index
— Methoddamage_index(datamanager,::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
datamanager::Data_manager
: all model datanodes::Union{SubArray, Vector{Int64}}
: corresponding nodes to this model
PeriLab.Solver.Model_Factory.Damage.init_aniso_crit_values
— Methodinit_aniso_crit_values(datamanager::Module, params::Dict, block_id::Int64)
Initialize the anisotropic critical values
Arguments
datamanager::Module
: The datamanagerparams::Dict
: The parametersblock_id::Int64
: current block
Returns
datamanager::Module
: The datamanager
PeriLab.Solver.Model_Factory.Damage.init_fields
— Methodinit_fields(datamanager::Module)
Initialize damage model fields
Arguments
datamanager::Data_manager
: Datamanager.params::Dict
: Parameters.
Returns
datamanager::Data_manager
: Datamanager.
PeriLab.Solver.Model_Factory.Damage.init_interface_crit_values
— Methodinit_interface_crit_values(datamanager::Module, params::Dict, block_id::Int64)
Initialize the critical values
Arguments
datamanager::Module
: The datamanagerparams::Dict
: The parametersblock_id::Int64
: current block
Returns
datamanager::Module
: The datamanager
PeriLab.Solver.Model_Factory.Damage.init_model
— Methodinit_model(datamanager::Module, nodes::Union{SubArray,Vector{Int64}}, block::Int64)
Initialize the damage models.
Arguments
datamanager::Module
: The data manager module where the corrosion model will be initialized.nodes::Union{SubArray,Vector{Int64}}
: Nodes for the corrosion model.block::Int64
: Block identifier for the corrosion model.
Returns
datamanager
: The modified data manager module with the initialized corrosion model.
Example
```julia datamanager = initmodel(mydata_manager, [1, 2, 3], 1)
PeriLab.Solver.Model_Factory.Damage.synch_field
— Methodsynch_field(datamanager::Module, damage_model::String, synchronise_field)
Field for synchronisation.
Arguments
datamanager::Data_manager
: Datamanager.damage_model::String
: The damage modelsynchronise_field
: Synchronise function to distribute parameter through cores.
Material
PeriLab.Solver.Model_Factory.Material.check_material_symmetry
— Methodcheck_material_symmetry(dof::Int64, prop::Dict)
Check the symmetry of the material.
Arguments
dof::Int64
: The degree of freedom.prop::Dict
: The material property.
Returns
prop::Dict
: The material property.
PeriLab.Solver.Model_Factory.Material.compute_model
— Methodcompute_model(datamanager::Module, nodes::Union{SubArray,Vector{Int64}}, model_param::Dict, block::Int64, time::Float64, dt::Float64,to::TimerOutput,)
Computes the material models
Arguments
datamanager::Module
: The datamanagernodes::Union{SubArray,Vector{Int64}}
: The nodesmodel_param::Dict
: The model parametersblock::Int64
: The blocktime::Float64
: The current timedt::Float64
: The time step
Returns
datamanager::Module
: The datamanager
PeriLab.Solver.Model_Factory.Material.determine_isotropic_parameter
— Methoddetermine_isotropic_parameter(datamanager::Module, prop::Dict)
Determine the isotropic parameter.
Arguments
prop::Dict
: The material property.
Returns
prop::Dict
: The material property.
PeriLab.Solver.Model_Factory.Material.distribute_force_densities
— Methoddistribute_force_densities(datamanager::Module, nodes::Union{SubArray,Vector{Int64}})
Distribute the force densities.
Arguments
datamanager::Data_manager
: Datamanager.nodes::Union{SubArray,Vector{Int64}}
: The nodes.
Returns
datamanager::Data_manager
: Datamanager.
PeriLab.Solver.Model_Factory.Material.fields_for_local_synchronization
— Methodfields_for_local_synchronization(model_param::Dict)
Finds all synchronization fields from the model class
Arguments
model_param::Dict
: model parameter.
Returns
synch_dict::Dict
: Synchronization Dictionary.
PeriLab.Solver.Model_Factory.Material.init_fields
— Methodinit_fields(datamanager::Module)
Initialize material model fields
Arguments
datamanager::Data_manager
: Datamanager.
Returns
datamanager::Data_manager
: Datamanager.
PeriLab.Solver.Model_Factory.Material.init_model
— Methodinit_model(datamanager::Module, nodes::Union{SubArray,Vector{Int64}, block::Int64)
Initializes the material model.
Arguments
datamanager::Data_manager
: Datamanagernodes::Union{SubArray,Vector{Int64}}
: The nodes.block::Int64
: Block.
Returns
datamanager::Data_manager
: Datamanager.
Thermal
PeriLab.Solver.Model_Factory.Thermal.compute_model
— Methodcompute_model(datamanager::Module, nodes::Union{SubArray,Vector{Int64}}, model_param::Dict, block::Int64, time::Float64, dt::Float64,to::TimerOutput,)
Computes the thermal models
Arguments
datamanager::Module
: The datamanagernodes::Union{SubArray,Vector{Int64}}
: The nodesmodel_param::Dict
: The model parametersblock::Int64
: The blocktime::Float64
: The current timedt::Float64
: The time step
Returns
datamanager::Module
: The datamanager
PeriLab.Solver.Model_Factory.Thermal.init_fields
— Methodinit_fields(datamanager::Module)
Initialize thermal model fields
Arguments
datamanager::Data_manager
: Datamanager.
Returns
datamanager::Data_manager
: Datamanager.
PeriLab.Solver.Model_Factory.Thermal.init_model
— Methodinit_model(datamanager::Module, nodes::Union{SubArray,Vector{Int64}, block::Int64)
Initializes the thermal model.
Arguments
datamanager::Data_manager
: Datamanagernodes::Union{SubArray,Vector{Int64}}
: The nodes.block::Int64
: Block.
Returns
datamanager::Data_manager
: Datamanager.
Pre_Calculation
PeriLab.Solver.Model_Factory.Pre_Calculation.check_dependencies
— Methodcheck_dependencies(datamanager::Module, block_nodes::Dict{Int64,Vector{Int64}}
Check if materials are used which needs a form of pre calculation. If so, the option will be set.
Arguments
datamanager::Module
: Datamanager.block_nodes::Dict{Int64,Vector{Int64}}
: block nodes.
Returns
datamanager::Data_manager
: Datamanager.
PeriLab.Solver.Model_Factory.Pre_Calculation.compute_model
— Methodcompute_model(datamanager::Module, nodes::Union{SubArray,Vector{Int64}}, model_param::Dict, block::Int64, time::Float64, dt::Float64,to::TimerOutput,)
Computes the pre calculation models
Arguments
datamanager::Module
: The datamanagernodes::Union{SubArray,Vector{Int64}}
: The nodesmodel_param::Dict
: The model parametersblock::Int64
: The blocktime::Float64
: The current timedt::Float64
: The time step
Returns
datamanager::Module
: The datamanager
PeriLab.Solver.Model_Factory.Pre_Calculation.fields_for_local_synchronization
— Methodfields_for_local_synchronization(model_param::Dict)
Finds all synchronization fields from the model class
Arguments
model_param::Dict
: model parameter.
Returns
synch_dict::Dict
: Synchronization Dictionary.
PeriLab.Solver.Model_Factory.Pre_Calculation.init_fields
— Methodinit_fields(datamanager::Module)
Initializes the fields.
Arguments
datamanager::Data_manager
: Datamanager
Returns
datamanager::Data_manager
: Datamanager.
PeriLab.Solver.Model_Factory.Pre_Calculation.init_model
— Methodinit_model(datamanager::Module, nodes::Union{SubArray,Vector{Int64}, block::Int64)
Initializes the model.
Arguments
datamanager::Data_manager
: Datamanagernodes::Union{SubArray,Vector{Int64}}
: The nodes.block::Int64
: Block.
Returns
datamanager::Data_manager
: Datamanager.
Set_modules
PeriLab.Solver.Model_Factory.Material.Set_modules.create_module_specifics
— Methodcreate_module_specifics(name::String, module_list::Dict{String,AbstractString}(),specifics::Dict{String,String}(), values::Tuple)
Searches for a specific function within a list of modules and calls that function if found.
This function iterates over a list of modules specified in module_list
and looks for a module-specific function specified in the specifics
dictionary. If the module and function are found, it calls that function with the provided values
tuple.
Arguments
name::String
: The name to match against the module names.module_list::Dict{String, AbstractString}
: A dictionary of module names mapped to abstract strings.specifics::Dict{String, String}
: A dictionary specifying the module-specific function to call for each module.values::Tuple
: A tuple of values to be passed as arguments to the module-specific function.
Example
```julia modulelist = Dict("Module1" => "Module1Name", "Module2" => "Module2Name") specifics = Dict("Module1Name" => "module1function", "Module2Name" => "module2function") values = (arg1, arg2) createmodulespecifics("Module1Name", modulelist, specifics, values)
PeriLab.Solver.Model_Factory.Material.Set_modules.create_module_specifics
— Methodcreate_module_specifics(name::String, module_list::Dict{String,AbstractString}(),specifics::Dict{String,String}())
# Returns: the function itself
PeriLab.Solver.Model_Factory.Material.Set_modules.find_jl_files
— Methodfind_jl_files(directory::AbstractString)
Recursively find Julia files (.jl) in a directory.
This function recursively searches for Julia source files with the ".jl" extension in the specified directory and its subdirectories. It returns a vector of file paths for all the found .jl files.
Arguments
directory::AbstractString
: The directory in which to search for .jl files.
Returns
A vector of strings, where each string is a file path to a .jl file found in the specified directory and its subdirectories.
Example
```julia jlfiles = findjlfiles("/path/to/modules") for jlfile in jlfiles println("Found Julia file: ", jlfile) end
PeriLab.Solver.Model_Factory.Material.Set_modules.find_module_files
— Methodfind_module_files(directory::AbstractString, specific::String)
Search for Julia modules containing a specific function in a given directory.
This function searches for Julia modules (files with .jl
extension) in the specified directory and checks if they contain a specific function. It returns a list of dictionaries where each dictionary contains the file path and the name of the module where the specific function is found.
Arguments
directory::AbstractString
: The directory to search for Julia modules.specific::String
: The name of the specific function to search for.
Returns
An array of dictionaries, where each dictionary has the following keys:
"File"
: The file path to the module where the specific function is found."Module Name"
: The name of the module where the specific function is found.
Example
```julia result = findmodulefiles("/path/to/modules", "myfunction") for moduleinfo in result println("Function found in module: ", moduleinfo["Module Name"]) println("Module file path: ", moduleinfo["File"]) end
PeriLab.Solver.Model_Factory.Material.Set_modules.include_files
— Methodinclude_files(module_list::Vector{Any})
Include files specified in a list of modules.
This function iterates over a list of modules and includes the files specified in each module's "File" key.
Arguments
module_list::Vector{Any}
: A list of modules where each module is expected to be a dictionary-like object with a "File" key specifying the file path.
Examples
```julia include_files([Dict("File" => "module1.jl"), Dict("File" => "module2.jl")])