Solver - Functions

Index

Solver

PeriLab.Solver_Manager.init — Method
init(params::Dict)

Initialize the solver

Arguments

  • params::Dict: The parameters

Returns

  • block_nodes::Dict{Int64,Vector{Int64}}: A dictionary mapping block IDs to collections of nodes.
  • bcs::Dict{Any,Any}: A dictionary containing boundary conditions.
  • solver_options::Dict{String,Any}: A dictionary containing solver options.
source
PeriLab.Solver_Manager.remove_models — Method
remove_models(solver_options::Vector{String})

Sets the active models to false if they are deactivated in the solver. They can be active, because they are defined as model and in the blocks.

Arguments

  • solver_options::Vector{String}: A dictionary of fields
source
PeriLab.Solver_Manager.set_angles — Method
set_angles(params::Dict, block_nodes::Dict)

Sets the density of the nodes in the dictionary.

Arguments

  • params::Dict: The parameters
  • block_nodes::Dict: A dictionary mapping block IDs to collections of nodes
source
PeriLab.Solver_Manager.set_density — Method
set_density(params::Dict, block_nodes::Dict, density::NodeScalarField{Float64})

Sets the density of the nodes in the dictionary.

Arguments

  • params::Dict: The parameters
  • block_nodes::Dict: A dictionary mapping block IDs to collections of nodes
  • density::NodeScalarField{Float64}: The density

Returns

  • density::NodeScalarField{Float64}: The density
source
PeriLab.Solver_Manager.set_fem_block — Method
set_fem_block(params::Dict, block_nodes::Dict, fem_block::Vector{Bool})

Sets the fem_block of the nodes in the dictionary.

Arguments

  • params::Dict: The parameters
  • block_nodes::Dict: A dictionary mapping block IDs to collections of nodes
  • fem_block::Vector{Bool}: The fem_block

Returns

  • fem_block::Vector{Bool}: The fem_block
source
PeriLab.Solver_Manager.set_horizon — Method
set_horizon(params::Dict, block_nodes::Dict, horizon::NodeScalarField{Float64})

Sets the horizon of the nodes in the dictionary.

Arguments

  • params::Dict: The parameters
  • block_nodes::Dict: A dictionary mapping block IDs to collections of nodes
  • horizon::NodeScalarField{Float64}: The horizon

Returns

  • horizon::NodeScalarField{Float64}: The horizon
source
PeriLab.Solver_Manager.solver — Method
solver(solver_options::Dict{String,Any}, block_nodes::Dict{Int64,Vector{Int64}}, bcs::Dict{Any,Any}, outputs::Dict{Int64,Dict{}}, result_files::Vector{Any}, write_results, silent::Bool)

Runs the solver.

Arguments

  • solver_options::Dict{String,Any}: The solver options
  • block_nodes::Dict{Int64,Vector{Int64}}: A dictionary mapping block IDs to collections of nodes
  • bcs::Dict{Any,Any}: The boundary conditions
  • outputs::Dict{Int64,Dict{}}: A dictionary for output settings
  • result_files::Vector{Any}: A vector of result files
  • write_results: A function to write simulation results
  • silent::Bool: A boolean flag to suppress progress bars

Returns

  • result_files: A vector of updated result files
source
PeriLab.Solver_Manager.synchronise_field — Method
synchronise_field(comm, synch_fields::Dict, overlap_map, get_field, synch_field::String, direction::String)

Synchronises field.

Arguments

  • comm: The MPI communicator
  • synch_fields::Dict: A dictionary of fields
  • overlap_map: The overlap map
  • get_field: The function to get the field
  • synch_field::String: The field
  • direction::String: The direction

Returns

  • nothing
source

Verlet_Solver

PeriLab.Solver_Manager.Verlet_Solver.get_integration_steps — Method
get_integration_steps(initial_time::Float64, end_time::Float64, dt::Float64)

Calculate the number of integration steps and the adjusted time step for a numerical integration process.

Arguments

  • initial_time::Float64: The initial time for the integration.
  • end_time::Float64: The final time for the integration.
  • dt::Float64: The time step size.

Returns

A tuple (nsteps, dt) where:

  • nsteps::Int64: The number of integration steps required to cover the specified time range.
  • dt::Float64: The adjusted time step size to evenly divide the time range.

Errors

  • Throws an error if the dt is less than or equal to zero.
source
PeriLab.Solver_Manager.Verlet_Solver.init_solver — Method
init_solver(params::Dict, bcs::Dict{Any,Any}, block_nodes::Dict{Int64,Vector{Int64}}, mechanical::Bool, thermo::Bool)

Initialize the Verlet solver for a simulation.

This function sets up the Verlet solver for a simulation by initializing various parameters and calculating the time step based on provided parameters or critical time step calculations.

Arguments

  • params::Dict: A dictionary containing simulation parameters.
  • bcs::Dict{Any,Any}: Boundary conditions
  • 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

A tuple (initial_time, dt, nsteps, numerical_damping) where:

  • initial_time::Float64: The initial time for the simulation.
  • dt::Float64: The time step for the simulation.
  • nsteps::Int64: The number of time integration steps.
  • numerical_damping::Float64: The numerical damping factor.
  • max_damage::Float64: The maximum damage in the simulation.

Dependencies

This function may depend on the following functions:

  • get_initial_time, get_final_time, get_safety_factor, get_fixed_dt: Used to retrieve simulation parameters.
  • compute_crititical_time_step: Used to calculate the critical time step if dt is not fixed.
  • get_integration_steps: Used to determine the number of integration steps and adjust the time step.
  • find_and_set_core_value_min and find_and_set_core_value_max: Used to set core values in a distributed computing environment.
source
PeriLab.Solver_Manager.Verlet_Solver.run_solver — Method
run_solver(
	solver_options::Dict{Any,Any},
	block_nodes::Dict{Int64,Vector{Int64}},
	bcs::Dict{Any,Any},
	outputs::Dict{Int64,Dict{}},
	result_files::Vector{Any},
	synchronise_field,
	write_results,
	silent::Bool
)

Run the Verlet solver for a simulation based on the strategy provided in [1] and [3].

This function performs the Verlet solver simulation, updating various data fields and properties over a specified number of time steps.

Arguments

  • solver_options::Dict{String,Any}: A dictionary containing solver options and parameters.
  • block_nodes::Dict{Int64,Vector{Int64}}: A dictionary mapping block IDs to collections of nodes.
  • bcs::Dict{Any,Any}: A dictionary containing boundary conditions.
  • outputs::Dict{Int64,Dict{}}: A dictionary for output settings.
  • result_files::Vector{Any}: A vector of result files.
  • synchronise_field: A function for synchronization.
  • write_results: A function to write simulation results.
  • silent::Bool: A boolean flag to suppress progress bars.

Returns

  • result_files: A vector of updated result files.

Dependencies

This function depends on various data fields and properties from the Data_Manager module, as well as several helper functions. It also relies on solver options and boundary conditions provided in the input parameters.

Function Workflow

  1. Initialize simulation parameters and data fields.
  2. Perform Verlet integration over a specified number of time steps.
  3. Update data fields and properties based on the solver options.
  4. Write simulation results using the write_results function.
source

Static_Solver

PeriLab.Solver_Manager.Static_Solver.init_solver — Method
init_solver(params::Dict, bcs::Dict{Any,Any}, block_nodes::Dict{Int64,Vector{Int64}}, mechanical::Bool, thermo::Bool)

Initialize the Static solver for a simulation.

This function sets up the Static solver for a simulation by initializing various parameters.

Arguments

  • params::Dict: A dictionary containing simulation parameters.
  • bcs::Dict{Any,Any}: Boundary conditions
  • 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

A tuple (initial_time, dt, nsteps, numerical_damping) where:

  • initial_time::Float64: The initial time for the simulation.
  • dt::Float64: The time step for the simulation.
  • nsteps::Int64: The number of time integration steps.
  • numerical_damping::Float64: The numerical damping factor.
  • max_damage::Float64: The maximum damage in the simulation.
  • xtol::Float64: solution tolerance; mininum step size value between two iterations
  • ftol::Float64: residual tolerance; mininum residual value of the function
  • iterations::Int64: maximum number of iterations per time step
  • show_trace::Bool: show the iteration steps of the solver

Dependencies

This function may depend on the following functions:

  • get_initial_time, get_final_time, get_safety_factor, get_fixed_dt: Used to retrieve simulation parameters.
  • get_integration_steps: Used to determine the number of integration steps and adjust the time step.
source

Boundary_Conditions

PeriLab.Solver_Manager.Boundary_Conditions.eval_bc! — Function
eval_bc!(field_values::Union{NodeScalarField{Float64},NodeScalarField{Int64}}, bc::Union{Float64,Float64,Int64,String}, coordinates::Matrix{Float64}, time::Float64, dof::Int64)

Working with if-statements "if t>2 0 else 20 end" works for scalars. If you want to evaluate a vector, please use the Julia notation as input "ifelse.(x .> y, 10, 20)"

source

Influence_Function

PeriLab.Solver_Manager.Influence_Function.init_influence_function — Method
init_influence_function(nodes::AbstractVector{Int64}, params::Dict)

Initializes the influence function field based on the user-specified parameter "Influence Function". Supports:

  • predefined names (fast path), e.g. "1/xi^2"
  • arbitrary string expressions using the variables xi, xiX, xiY, xiZ, e.g. "1/xi^2", "exp(-xi/3)", "xiX^2 + xiY^2"
source