diff --git a/dev/.documenter-siteinfo.json b/dev/.documenter-siteinfo.json index be8d98d2..2b1c1c68 100644 --- a/dev/.documenter-siteinfo.json +++ b/dev/.documenter-siteinfo.json @@ -1 +1 @@ -{"documenter":{"julia_version":"1.10.7","generation_timestamp":"2024-12-16T10:38:29","documenter_version":"1.8.0"}} \ No newline at end of file +{"documenter":{"julia_version":"1.10.7","generation_timestamp":"2025-01-06T10:19:08","documenter_version":"1.8.0"}} \ No newline at end of file diff --git a/dev/devLog/index.html b/dev/devLog/index.html index c4522971..06336102 100644 --- a/dev/devLog/index.html +++ b/dev/devLog/index.html @@ -21,4 +21,4 @@ startOnLoad: true, theme: "neutral" }); - + diff --git a/dev/index.html b/dev/index.html index 8926e415..dc414746 100644 --- a/dev/index.html +++ b/dev/index.html @@ -24,4 +24,4 @@ startOnLoad: true, theme: "neutral" }); - + diff --git a/dev/lib/data_manager_functions/index.html b/dev/lib/data_manager_functions/index.html index ae0de0a7..615fa8b8 100644 --- a/dev/lib/data_manager_functions/index.html +++ b/dev/lib/data_manager_functions/index.html @@ -1,10 +1,10 @@ -Data Manager · PeriLab

Data Manager - Functions

Index

Data_manager

PeriLab.Data_manager._get_fieldMethod
_get_field(name::String)

Returns the field with the given name.

Arguments

  • name::String: The name of the field.

Returns

  • field::Field: The field with the given name.
source
PeriLab.Data_manager.add_active_modelMethod
add_active_model(key::String, module_name::Module)

Add the main modules to an OrderedDict which are active.

Arguments

  • key::String: Name of the model.
  • active_module::Module: Module of the active models.
source
PeriLab.Data_manager.check_propertyMethod
check_property(block_id::Int64, property::String)

Checks if the specified property exists for the given block_id.

Arguments

  • block_id::Int64: The ID of the block.
  • property::String: The name of the property to check.

Returns

  • Bool: true if the property exists, false otherwise.
source
PeriLab.Data_manager.create_bond_fieldFunction
create_bond_field(name::String, type::Type, dof::Int64)

Creates a bond field with the given name, data type, and degree of freedom.

Arguments

  • name::String: The name of the bond field.
  • vartype::Type: The data type of the bond field.
  • dof::Int64: The degrees of freedom per bond.
  • VectorOrArray::String (optional) - Vector or Materix; Default is vector

Returns

  • bond_field::Field: The created bond field for the current time step.
  • bond_field_np1::Field: The created bond field for the next time step.

Example:

create_bond_field("stress", Float64, 6)  # creates a stress bond field with 6 degrees of freedom
source
PeriLab.Data_manager.create_constant_bond_fieldFunction
create_constant_bond_field(name::String, type::Type, dof::Int64, default_value::Union{Int64,Float64,Bool}=0))

Creates a constant bond field with the given name, data type, and degree of freedom.

Arguments

  • name::String: The name of the bond field.
  • vartype::Type: The data type of the bond field.
  • dof::Int64: The degrees of freedom per bond.
  • default_value::Union{Int64,Float64,Bool}=0) (optional) - filled with zero or false

Returns

  • constant_bond_field::Field: The created constant bond field.

Example:

create_constant_bond_field("density", Float64, 1)  # creates a density constant bond field
source
PeriLab.Data_manager.create_constant_element_fieldFunction
create_constant_element_field(name::String, type::Type, dof::Int64)

Creates a constant element field with the given name, data type, and degree of freedom.

Arguments

  • name::String: The name of the element field.
  • vartype::Type: The data type of the element field.
  • dof::Int64: The degrees of freedom per element.
  • VectorOrArray::String (optional) - Vector or Materix; Default is vector

Returns

  • constant_element_field::Field: The created constant element field.

Example:

create_constant_element_field("temperature", Float64, 1)  # creates a temperature constant element field
source
PeriLab.Data_manager.create_constant_node_fieldFunction
create_constant_node_field(name::String, type::Type, dof::Int64)

Creates a constant node field with the given name, data type, and degree of freedom.

Arguments

  • name::String: The name of the node field.
  • vartype::Type: The data type of the node field.
  • dof::Int64: The degrees of freedom per node.
  • VectorOrArray::String (optional) - Vector or Materix; Default is vector

Returns

  • constant_node_field::Field: The created constant node field.

Example:

create_constant_node_field("temperature", Float64, 1)  # creates a temperature constant node field
source
PeriLab.Data_manager.create_fieldFunction
create_field(name::String, vartype::Type, bondNode::String, dof::Int64, default_value::Any=0)

Create a field with the given name for the specified vartype. If the field already exists, return the existing field. If the field does not exist, create a new field with the specified characteristics.

Arguments

  • name::String: The name of the field.
  • vartype::Type: The data type of the field.
  • dof::Int64: The degrees of freedom per node.
  • default_value::Any: The default value of the field.

Returns

The field with the given name and specified characteristics.

source
PeriLab.Data_manager.create_node_fieldFunction
create_node_field(name::String, type::Type, dof::Int64)

Creates a node field with the given name, data type, and degree of freedom.

Arguments

  • name::String: The name of the node field.
  • type::Type: The data type of the node field.
  • dof::Int64: The degree of freedom of each node.
  • VectorOrArray::String (optional) - Vector or Materix; Default is vector

Returns

  • node_field::Field: The created node field for the current time step.
  • node_field_np1::Field: The created node field for the next time step.

Example:

create_node_field("displacement", Float64, 3)  # creates a displacement node field with 3 degrees of freedom
source
PeriLab.Data_manager.get_dofMethod
get_dof()

Retrieves the degree of freedom (dof) value.

Returns

  • dof (integer): The current degree of freedom value.

Example:

get_dof()  # returns the current degree of freedom
source
PeriLab.Data_manager.get_fieldFunction
get_field(name::String, time::String)

Returns the field with the given name and time.

Arguments

  • name::String: The name of the field.
  • time::String: The time of the field.

Returns

  • field::Field: The field with the given name and time.
source
PeriLab.Data_manager.get_local_nodesMethod
get_local_nodes()

Determines the local node numbering.

Returns

  • get_local_nodes (array): returns local nodes.

Example:

get_local_nodes()  # returns local nodes or if they do not exist at the core an empty array
source
PeriLab.Data_manager.get_local_synch_fieldsMethod
get_local_synch_fields(model::String)
+Data Manager · PeriLab

Data Manager - Functions

Index

Data_manager

PeriLab.Data_manager._get_fieldMethod
_get_field(name::String)

Returns the field with the given name.

Arguments

  • name::String: The name of the field.

Returns

  • field::Field: The field with the given name.
source
PeriLab.Data_manager.add_active_modelMethod
add_active_model(key::String, module_name::Module)

Add the main modules to an OrderedDict which are active.

Arguments

  • key::String: Name of the model.
  • active_module::Module: Module of the active models.
source
PeriLab.Data_manager.check_propertyMethod
check_property(block_id::Int64, property::String)

Checks if the specified property exists for the given block_id.

Arguments

  • block_id::Int64: The ID of the block.
  • property::String: The name of the property to check.

Returns

  • Bool: true if the property exists, false otherwise.
source
PeriLab.Data_manager.create_bond_fieldFunction
create_bond_field(name::String, type::Type, dof::Int64)

Creates a bond field with the given name, data type, and degree of freedom.

Arguments

  • name::String: The name of the bond field.
  • vartype::Type: The data type of the bond field.
  • dof::Int64: The degrees of freedom per bond.
  • VectorOrArray::String (optional) - Vector or Materix; Default is vector

Returns

  • bond_field::Field: The created bond field for the current time step.
  • bond_field_np1::Field: The created bond field for the next time step.

Example:

create_bond_field("stress", Float64, 6)  # creates a stress bond field with 6 degrees of freedom
source
PeriLab.Data_manager.create_constant_bond_fieldFunction
create_constant_bond_field(name::String, type::Type, dof::Int64, default_value::Union{Int64,Float64,Bool}=0))

Creates a constant bond field with the given name, data type, and degree of freedom.

Arguments

  • name::String: The name of the bond field.
  • vartype::Type: The data type of the bond field.
  • dof::Int64: The degrees of freedom per bond.
  • default_value::Union{Int64,Float64,Bool}=0) (optional) - filled with zero or false

Returns

  • constant_bond_field::Field: The created constant bond field.

Example:

create_constant_bond_field("density", Float64, 1)  # creates a density constant bond field
source
PeriLab.Data_manager.create_constant_element_fieldFunction
create_constant_element_field(name::String, type::Type, dof::Int64)

Creates a constant element field with the given name, data type, and degree of freedom.

Arguments

  • name::String: The name of the element field.
  • vartype::Type: The data type of the element field.
  • dof::Int64: The degrees of freedom per element.
  • VectorOrArray::String (optional) - Vector or Materix; Default is vector

Returns

  • constant_element_field::Field: The created constant element field.

Example:

create_constant_element_field("temperature", Float64, 1)  # creates a temperature constant element field
source
PeriLab.Data_manager.create_constant_node_fieldFunction
create_constant_node_field(name::String, type::Type, dof::Int64)

Creates a constant node field with the given name, data type, and degree of freedom.

Arguments

  • name::String: The name of the node field.
  • vartype::Type: The data type of the node field.
  • dof::Int64: The degrees of freedom per node.
  • VectorOrArray::String (optional) - Vector or Materix; Default is vector

Returns

  • constant_node_field::Field: The created constant node field.

Example:

create_constant_node_field("temperature", Float64, 1)  # creates a temperature constant node field
source
PeriLab.Data_manager.create_fieldFunction
create_field(name::String, vartype::Type, bondNode::String, dof::Int64, default_value::Any=0)

Create a field with the given name for the specified vartype. If the field already exists, return the existing field. If the field does not exist, create a new field with the specified characteristics.

Arguments

  • name::String: The name of the field.
  • vartype::Type: The data type of the field.
  • dof::Int64: The degrees of freedom per node.
  • default_value::Any: The default value of the field.

Returns

The field with the given name and specified characteristics.

source
PeriLab.Data_manager.create_node_fieldFunction
create_node_field(name::String, type::Type, dof::Int64)

Creates a node field with the given name, data type, and degree of freedom.

Arguments

  • name::String: The name of the node field.
  • type::Type: The data type of the node field.
  • dof::Int64: The degree of freedom of each node.
  • VectorOrArray::String (optional) - Vector or Materix; Default is vector

Returns

  • node_field::Field: The created node field for the current time step.
  • node_field_np1::Field: The created node field for the next time step.

Example:

create_node_field("displacement", Float64, 3)  # creates a displacement node field with 3 degrees of freedom
source
PeriLab.Data_manager.get_dofMethod
get_dof()

Retrieves the degree of freedom (dof) value.

Returns

  • dof (integer): The current degree of freedom value.

Example:

get_dof()  # returns the current degree of freedom
source
PeriLab.Data_manager.get_fieldFunction
get_field(name::String, time::String)

Returns the field with the given name and time.

Arguments

  • name::String: The name of the field.
  • time::String: The time of the field.

Returns

  • field::Field: The field with the given name and time.
source
PeriLab.Data_manager.get_local_nodesMethod
get_local_nodes()

Determines the local node numbering.

Returns

  • get_local_nodes (array): returns local nodes.

Example:

get_local_nodes()  # returns local nodes or if they do not exist at the core an empty array
source
PeriLab.Data_manager.get_max_rankMethod
get_max_rank()

This function returns the maximal rank of MPI the max_rank.

Returns

  • max_rank::Number: The value of the max_rank variable.

Example

```julia rank = getmaxrank()

source
PeriLab.Data_manager.get_nnodesMethod
get_nnodes()

Retrieves the number of nodes.

Returns

  • num_controller::Int64 : The current number of nodes.

Example:

get_nnodes()  # returns the current number of controler nodes. The neighbors are not included
source
PeriLab.Data_manager.get_propertiesMethod
get_properties(block_id::Int64, property::String)

This function retrieves the value of a specified property for a given block_id if it exists in the properties dictionary.

Arguments

  • block_id::Int64: The identifier of the block for which to retrieve the property.
  • property::String: The dictionary entrycontaining the properties for the blocks.

Returns

  • property_value::Any: The value associated with the specified property for the given block_id.
  • Dict(): An empty dictionary if the specified property does not exist for the given block_id.

Example

```julia block_properties = Dict( 1 => Dict("color" => "red", "size" => 10), 2 => Dict("color" => "blue", "height" => 20) )

Retrieve the 'color' property for block 1

colorvalue = getproperties(1, "color") # Returns "red"

Try to retrieve a non-existent property for block 2

nonexistentvalue = get_properties(2, "width") # Returns an empty dictionary

source
PeriLab.Data_manager.get_propertyMethod
get_property(block_id::Int64, property::String, value_name::String)

This function retrieves a specific value_name associated with a specified property for a given block_id if it exists in the properties dictionary.

Arguments

  • block_id::Int64: The identifier of the block for which to retrieve the property.
  • property::String: The String property type (e.g. Material model) for the blocks.
  • value_name::String: The name of the value within the specified property.

Returns

  • value::Any: The value associated with the specified value_name within the property for the given block_id.
  • nothing: If the specified block_id, property, or value_name does not exist in the dictionary.

Example

```julia

source
PeriLab.Data_manager.get_rankMethod
get_rank()

This function returns the rank of the core.

Returns

  • rank::Any: The value of the rank variable.

Example

```julia currentrank = getrank()

source
PeriLab.Data_manager.init_propertiesMethod
init_properties()

This function initializes the properties dictionary. Order of dictionary defines, in which order the models are called later on.

Returns

  • keys(properties[1]): The keys of the properties dictionary in defined order for the Model_Factory.jl.
source
PeriLab.Data_manager.loc_to_globMethod
loc_to_glob(range::UnitRange{Int64})

Converts the local index to the global index.

Arguments

  • range::UnitRange{Int64}: The range of the local index.

Example:

loc_to_glob(1:10)  # converts the local index to the global index
source
PeriLab.Data_manager.set_coupling_dictMethod
set_coupling_dict(coupling_dict::Dict{Int64,Int64})

Sets the FE - PD couplings. PD nodes -> FE Elements.

Arguments

  • coupling_dict::Dict{Int64,Int64}: The coupling dictionary.
source
PeriLab.Data_manager.set_dofMethod
set_dof(n::Int64)

Sets the degree of freedom (dof) value globally.

Arguments

  • n::Int64: The value to set as the degree of freedom.

Example:

set_dof(3)  # sets the degree of freedom to 3
source
PeriLab.Data_manager.set_femMethod
set_fem(value::Bool)

Activates and deactivates the FEM option in PeriLab

Arguments

  • value::Bool: The value to set FEM active (true) or not (false).

Example:

set_fem(true)  # sets the fem_option to true
source
PeriLab.Data_manager.set_glob_to_locMethod
set_glob_to_loc(dict)

Sets the global-to-local mapping dict globally.

Arguments

  • dict (array): The dict representing the global-to-local mapping.

Example:

set_glob_to_loc([1, 3, 5])  # sets the global-to-local mapping dict
source
PeriLab.Data_manager.set_local_synchFunction
set_local_synch(model, name, download_from_cores, upload_to_cores, dof=0)

Sets the synchronization dictionary locally during the model update process. Should be used carefully, to avoid unessary communication.

Arguments

  • name::String: The name of the field.
  • download_from_cores::Bool: Whether to download the field from the cores.
  • upload_to_cores::Bool: Whether to upload the field to the cores.
source
PeriLab.Data_manager.set_nsetMethod
set_nset(name, nodes)

Set the nodes associated with a named node set.

Arguments

  • name::String: The name of the node set.
  • nodes::Vector{Int}: The node indices associated with the node set.
source
PeriLab.Data_manager.set_num_controllerMethod
set_num_controller(n::Int64)

Sets the number of controller nodes globally. For one core the number of nodes is equal to the number of controller nodes.

Arguments

  • n::Int64: The value to set as the number of nodes.

Example:

set_num_controller(10)  # sets the number of nodes to 10
source
PeriLab.Data_manager.set_num_responderMethod
set_num_responder(n::Int64)

Sets the number of responder nodes globally. For one core the number of responder is zero. responder hold the information of the neighbors, of one node, but are not evaluated.

Arguments

  • n::Int64: The value to set as the number of nodes.

Example:

set_num_responder(10)  # sets the number of responder nodes to 10
source
PeriLab.Data_manager.set_propertiesMethod
set_properties(block_id, property, values)

Sets the values of a specified property for a given block_id.

Arguments

  • block_id::Int64: The identifier of the block for which to set the property.
  • property::String: The name of the property.
  • values::Any: The values to set for the specified property.
source
PeriLab.Data_manager.set_propertiesMethod
set_properties(property, values)

Sets the values of a specified property for a all blocks. E.g. for FEM, because it corresponds not to a block yet,

Arguments

  • property::String: The name of the property.
  • values::Any: The values to set for the specified property.
source
PeriLab.Data_manager.set_propertyMethod
set_property(block_id, property, value_name, value)

Sets the value of a specified property for a given block_id.

Arguments

  • block_id::Int64: The identifier of the block for which to set the property.
  • property::String: The name of the property.
  • value_name::String: The name of the value within the specified property.
  • value::Any: The value to set for the specified value_name.
source
PeriLab.Data_manager.set_synchFunction
set_synch(name, download_from_cores, upload_to_cores)

Sets the synchronization dictionary globally.

Arguments

  • name::String: The name of the field.
  • download_from_cores::Bool: Whether to download the field from the cores.
  • upload_to_cores::Bool: Whether to upload the field to the cores.
source
PeriLab.Data_manager.synch_managerMethod
synch_manager(synchronise_field, direction::String)

Synchronises the fields.

Arguments

  • synchronise_field: The function to synchronise the field.
  • direction::String: The direction of the synchronisation.
source
+
diff --git a/dev/lib/faq/index.html b/dev/lib/faq/index.html index 90f073f3..6714dce0 100644 --- a/dev/lib/faq/index.html +++ b/dev/lib/faq/index.html @@ -4,4 +4,4 @@ startOnLoad: true, theme: "neutral" }); - + diff --git a/dev/lib/glossar/index.html b/dev/lib/glossar/index.html index d8d91e22..02cb3c94 100644 --- a/dev/lib/glossar/index.html +++ b/dev/lib/glossar/index.html @@ -4,4 +4,4 @@ startOnLoad: true, theme: "neutral" }); - + diff --git a/dev/lib/helper_functions/index.html b/dev/lib/helper_functions/index.html index ac87bddc..e71b6b52 100644 --- a/dev/lib/helper_functions/index.html +++ b/dev/lib/helper_functions/index.html @@ -1,7 +1,7 @@ -Helper · PeriLab

Helper - Functions

Index

Helpers

PeriLab.Solver_control.Helpers.check_inf_or_nanMethod
check_inf_or_nan(array, msg)

Checks if the sum of the array is finite. If not, an error is raised.

Arguments

  • array: The array to check.
  • msg: The error message to raise.

Returns

  • Bool: true if the sum of the array is finite, false otherwise.
source
PeriLab.Solver_control.Helpers.find_files_with_endingMethod
find_files_with_ending(folder_path::AbstractString, file_ending::AbstractString)

Returns a list of files in folder_path that end with file_ending.

Arguments

  • folder_path::AbstractString: The path to the folder.
  • file_ending::AbstractString: The ending of the files.

Returns

  • file_list::Vector{String}: The list of files that end with file_ending.
source
PeriLab.Solver_control.Helpers.find_indicesMethod
find_indices(vector, what)

Returns the indices of vector that are equal to what.

Arguments

  • vector::Vector: The vector to search in.
  • what: The value to search for.

Returns

  • indices::Vector: The indices of vector that are equal to what.
source
PeriLab.Solver_control.Helpers.find_inverse_bond_idMethod
find_inverse_bond_id(nlist::Vector{Vector{Int64}})

Finds the inverse of the bond id in the nlist.

Arguments

  • nlist::Vector{Vector{Int64}}: The nlist to find the inverse of.

Returns

  • inverse_nlist::Vector{Dict{Int64,Int64}}: The inverse nlist.
source
PeriLab.Solver_control.Helpers.get_active_update_nodesMethod
get_active_update_nodes(active::Vector{Bool}, update_list::Vector{Bool}, nodes::Vector{Int64}, index::Vector{Int64})

Returns the active nodes and the update nodes.

Arguments

  • active::Vector{Bool}: The active vector.
  • update_list::Vector{Bool}: The update vector.
  • nodes::Vector{Int64}: The vector of nodes.
  • index::Vector{Int64}: Pre allocated Vector.

Returns

  • update_nodes::Vector{Int64}: The nodes of update that are true.
source
PeriLab.Solver_control.Helpers.get_fourth_orderMethod
get_fourth_order(CVoigt, dof)

Constructs a symmetric fourth-order tensor from a Voigt notation vector. It uses Tensors.jl package.

This function takes a Voigt notation vector CVoigt and the degree of freedom dof to create a symmetric fourth-order tensor. The CVoigt vector contains components that represent the tensor in Voigt notation, and dof specifies the dimension of the tensor.

Arguments

  • CVoigt::Matrix{Float64}: A vector containing components of the tensor in Voigt notation.
  • dof::Int64: The dimension of the resulting symmetric fourth-order tensor.

Returns

  • SymmetricFourthOrderTensor{dof}: A symmetric fourth-order tensor of dimension dof.

Example

```julia CVoigt = [1.0, 2.0, 3.0, 4.0, 5.0, 6.0] dof = 3 result = getfourthorder(CVoigt, dof)

source
PeriLab.Solver_control.Helpers.invertFunction
invert(A::Union{Matrix{Float64},Matrix{Int64}}, error_message::String="Matrix is singular")

Invert a n x n matrix. Throws an error if A is singular.

Arguments

  • A::Union{Matrix{Float64},Matrix{Int64}}: A n x n matrix.
  • error_message::String="Matrix is singular": The error message returned if A is singular.

Returns

  • inverted matrix or nothing if not inverable.
source
PeriLab.Solver_control.Helpers.progress_barMethod
progress_bar(rank::Int64, nsteps::Int64, silent::Bool)

Create a progress bar if the rank is 0. The progress bar ranges from 1 to nsteps + 1.

Arguments

  • rank::Int64: An integer to determine if the progress bar should be created.
  • nsteps::Int64: The total number of steps in the progress bar.
  • silent::Bool: de/activates the progress bar

Returns

  • ProgressBar or UnitRange: If rank is 0, a ProgressBar object is returned. Otherwise, a range from 1 to nsteps + 1 is returned.
source
PeriLab.Solver_control.Helpers.qdimMethod
qdim(order::Int64, dof::Int64)

Calculate the number of terms in a polynomial expansion up to a specified accuracy order. Simplied first complex loop in Peridigm correspondence::computeLagrangianGradientWeights. In the unit test this values where tested.

Arguments

  • order::Int64: The accuracy order of the polynomial expansion.

Returns

  • Int64: The total number of terms in the polynomial expansion.

Description

This function calculates the number of terms in a polynomial expansion up to the specified accuracy order using an analytical formula derived from combinatorial considerations. The function iterates over each order from 1 to the specified order and calculates the sum of binomial coefficients according to the formula: qdim(order) = Σ(i=1 to order) [(i+2)! / (2! * i!)]

source
PeriLab.Solver_control.Helpers.rotateMethod
rotate(nodes::Union{SubArray,Vector{Int64}}, dof::Int64, matrix::Union{SubArray,Array{Float64,3}}, angles::SubArray, back::Bool)

Rotates the matrix.

Arguments

  • nodes::Union{SubArray,Vector{Int64}}: List of block nodes.
  • matrix::Union{SubArray,Array{Float64,3}}: Matrix.
  • rot::SubArray: Rotation tensor.
  • back::Bool: Back.

Returns

  • matrix::SubArray: Matrix.
source
PeriLab.Solver_control.Helpers.rotate_second_order_tensorMethod
rotate_second_order_tensor(angles::Union{Vector{Float64},Vector{Int64}}, tensor::Matrix{Float64}, dof::Int64, back::Bool)

Rotates the second order tensor.

Arguments

  • angles::Union{Vector{Float64},Vector{Int64}}: Angles.
  • tensor::Matrix{Float64}: Second order tensor.
  • dof::Int64: Degree of freedom.
  • back::Bool: Back.

Returns

  • tensor::Matrix{Float64}: Second order tensor.
source

Helper - Functions

Index

Helpers

PeriLab.Solver_control.Helpers.check_inf_or_nanMethod
check_inf_or_nan(array, msg)

Checks if the sum of the array is finite. If not, an error is raised.

Arguments

  • array: The array to check.
  • msg: The error message to raise.

Returns

  • Bool: true if the sum of the array is finite, false otherwise.
source
PeriLab.Solver_control.Helpers.find_files_with_endingMethod
find_files_with_ending(folder_path::AbstractString, file_ending::AbstractString)

Returns a list of files in folder_path that end with file_ending.

Arguments

  • folder_path::AbstractString: The path to the folder.
  • file_ending::AbstractString: The ending of the files.

Returns

  • file_list::Vector{String}: The list of files that end with file_ending.
source
PeriLab.Solver_control.Helpers.find_indicesMethod
find_indices(vector, what)

Returns the indices of vector that are equal to what.

Arguments

  • vector::Vector: The vector to search in.
  • what: The value to search for.

Returns

  • indices::Vector: The indices of vector that are equal to what.
source
PeriLab.Solver_control.Helpers.find_inverse_bond_idMethod
find_inverse_bond_id(nlist::Vector{Vector{Int64}})

Finds the inverse of the bond id in the nlist.

Arguments

  • nlist::Vector{Vector{Int64}}: The nlist to find the inverse of.

Returns

  • inverse_nlist::Vector{Dict{Int64,Int64}}: The inverse nlist.
source
PeriLab.Solver_control.Helpers.get_active_update_nodesMethod
get_active_update_nodes(active::Vector{Bool}, update_list::Vector{Bool}, nodes::Vector{Int64}, index::Vector{Int64})

Returns the active nodes and the update nodes.

Arguments

  • active::Vector{Bool}: The active vector.
  • update_list::Vector{Bool}: The update vector.
  • nodes::Vector{Int64}: The vector of nodes.
  • index::Vector{Int64}: Pre allocated Vector.

Returns

  • update_nodes::Vector{Int64}: The nodes of update that are true.
source
PeriLab.Solver_control.Helpers.get_fourth_orderMethod
get_fourth_order(CVoigt, dof)

Constructs a symmetric fourth-order tensor from a Voigt notation vector. It uses Tensors.jl package.

This function takes a Voigt notation vector CVoigt and the degree of freedom dof to create a symmetric fourth-order tensor. The CVoigt vector contains components that represent the tensor in Voigt notation, and dof specifies the dimension of the tensor.

Arguments

  • CVoigt::Matrix{Float64}: A vector containing components of the tensor in Voigt notation.
  • dof::Int64: The dimension of the resulting symmetric fourth-order tensor.

Returns

  • SymmetricFourthOrderTensor{dof}: A symmetric fourth-order tensor of dimension dof.

Example

```julia CVoigt = [1.0, 2.0, 3.0, 4.0, 5.0, 6.0] dof = 3 result = getfourthorder(CVoigt, dof)

source
PeriLab.Solver_control.Helpers.invertFunction
invert(A::Union{Matrix{Float64},Matrix{Int64}}, error_message::String="Matrix is singular")

Invert a n x n matrix. Throws an error if A is singular.

Arguments

  • A::Union{Matrix{Float64},Matrix{Int64}}: A n x n matrix.
  • error_message::String="Matrix is singular": The error message returned if A is singular.

Returns

  • inverted matrix or nothing if not inverable.
source
PeriLab.Solver_control.Helpers.progress_barMethod
progress_bar(rank::Int64, nsteps::Int64, silent::Bool)

Create a progress bar if the rank is 0. The progress bar ranges from 1 to nsteps + 1.

Arguments

  • rank::Int64: An integer to determine if the progress bar should be created.
  • nsteps::Int64: The total number of steps in the progress bar.
  • silent::Bool: de/activates the progress bar

Returns

  • ProgressBar or UnitRange: If rank is 0, a ProgressBar object is returned. Otherwise, a range from 1 to nsteps + 1 is returned.
source
PeriLab.Solver_control.Helpers.qdimMethod
qdim(order::Int64, dof::Int64)

Calculate the number of terms in a polynomial expansion up to a specified accuracy order. Simplied first complex loop in Peridigm correspondence::computeLagrangianGradientWeights. In the unit test this values where tested.

Arguments

  • order::Int64: The accuracy order of the polynomial expansion.

Returns

  • Int64: The total number of terms in the polynomial expansion.

Description

This function calculates the number of terms in a polynomial expansion up to the specified accuracy order using an analytical formula derived from combinatorial considerations. The function iterates over each order from 1 to the specified order and calculates the sum of binomial coefficients according to the formula: qdim(order) = Σ(i=1 to order) [(i+2)! / (2! * i!)]

source
PeriLab.Solver_control.Helpers.rotateMethod
rotate(nodes::Union{SubArray,Vector{Int64}}, dof::Int64, matrix::Union{SubArray,Array{Float64,3}}, angles::SubArray, back::Bool)

Rotates the matrix.

Arguments

  • nodes::Union{SubArray,Vector{Int64}}: List of block nodes.
  • matrix::Union{SubArray,Array{Float64,3}}: Matrix.
  • rot::SubArray: Rotation tensor.
  • back::Bool: Back.

Returns

  • matrix::SubArray: Matrix.
source
PeriLab.Solver_control.Helpers.rotate_second_order_tensorMethod
rotate_second_order_tensor(angles::Union{Vector{Float64},Vector{Int64}}, tensor::Matrix{Float64}, dof::Int64, back::Bool)

Rotates the second order tensor.

Arguments

  • angles::Union{Vector{Float64},Vector{Int64}}: Angles.
  • tensor::Matrix{Float64}: Second order tensor.
  • dof::Int64: Degree of freedom.
  • back::Bool: Back.

Returns

  • tensor::Matrix{Float64}: Second order tensor.
source
+
diff --git a/dev/lib/io_functions/index.html b/dev/lib/io_functions/index.html index 59249ad5..193a5062 100644 --- a/dev/lib/io_functions/index.html +++ b/dev/lib/io_functions/index.html @@ -1,7 +1,7 @@ -IO · PeriLab

IO - Functions

Index

IO

PeriLab.IO._init_overlap_map_Method
_init_overlap_map_(size)

Initialize the overlap map.

Arguments

  • size::Int64: The number of ranks.

Returns

  • overlap_map::Dict{Int64,Dict{Int64,Dict{String,Vector{Int64}}}}: The overlap map.
source
PeriLab.IO.apply_bond_filtersMethod
apply_bond_filters(nlist::Vector{Vector{Int64}}, mesh::DataFrame, params::Dict, dof::Int64)

Apply the bond filters to the neighborhood list.

Arguments

  • nlist::Vector{Vector{Int64}}: The neighborhood list.
  • mesh::DataFrame: The mesh.
  • params::Dict: The parameters.
  • dof::Int64: The degrees of freedom.

Returns

  • nlist::Vector{Vector{Int64}}: The filtered neighborhood list.
  • nlist_filtered_ids::Vector{Vector{Int64}}: The filtered neighborhood list.
source
PeriLab.IO.area_of_polygonMethod
area_of_polygon(vertices)

Calculate the area of a polygon.

Arguments

  • vertices: The vertices of the polygon.

Returns

  • area: The area of the polygon.
source
PeriLab.IO.bond_intersect_infinite_planeMethod
bond_intersect_infinite_plane(p0::Vector{Float64}, p1::Vector{Float64}, lower_left_corner::Vector{Float64}, normal::Vector{Float64})

Check if a line segment intersects an infinite plane.

Arguments

  • p0::Vector{Float64}: The start point of the line segment.
  • p1::Vector{Float64}: The end point of the line segment.
  • lower_left_corner::Vector{Float64}: The lower left corner of the plane.
  • normal::Vector{Float64}: The normal of the plane.

Returns

  • Bool: True if the line segment intersects the plane, False otherwise.
source
PeriLab.IO.bond_intersect_rectangle_planeMethod
bond_intersect_rectangle_plane(x::Vector{Float64}, lower_left_corner::Vector{Float64}, bottom_unit_vector::Vector{Float64}, normal::Vector{Float64}, side_length::Float64, bottom_length::Float64)

Check if a bond intersects a rectangle plane.

Arguments

  • x::Vector{Float64}: The point.
  • lower_left_corner::Vector{Float64}: The lower left corner of the rectangle.
  • bottom_unit_vector::Vector{Float64}: The unit vector along the bottom of the rectangle.
  • normal::Vector{Float64}: The normal of the plane.
  • side_length::Float64: The side length of the rectangle.
  • bottom_length::Float64: The bottom length of the rectangle.

Returns

  • Bool: True if the point is inside the rectangle, False otherwise.
source
PeriLab.IO.bond_intersects_discMethod
bond_intersects_disc(p0::Vector{Float64}, p1::Vector{Float64}, center::Vector{Float64}, normal::Vector{Float64}, radius::Float64)

Check if a line segment intersects a disk.

Arguments

  • p0::Vector{Float64}: The start point of the line segment.
  • p1::Vector{Float64}: The end point of the line segment.
  • center::Vector{Float64}: The center of the disk.
  • normal::Vector{Float64}: The normal of the plane.
  • radius::Float64: The radius of the disk.

Returns

  • Bool: True if the line segment intersects the disk, False otherwise.
source
PeriLab.IO.calculate_blockMethod
calculate_block(datamanager::Module, field_key::String, dof::Int64, calculation_type::String, block::Int64)

Calculate the global value of a field for a given block.

Arguments

  • datamanager::Data_manager: Datamanager.
  • field_key::String: Field key.
  • dof::Union{Int64,Vector{Int64}}: Degree of freedom
  • calculation_type::String: Calculation type.
  • block::Int64: Block number.

Returns

  • value::Float64: Global value.
  • nnodes::Int64: Number of nodes.
source
PeriLab.IO.calculate_nodelistMethod
calculate_nodelist(datamanager::Module, field_key::String, dof::Union{Int64,Vector{Int64}}, calculation_type::String, local_nodes::Vector{Int64})

Calculate the global value of a field for a given set of nodes.

Arguments

  • datamanager::Data_manager: Datamanager.
  • field_key::String: Field key.
  • dof::Union{Int64,Vector{Int64}}: Degree of freedom
  • calculation_type::String: Calculation type.
  • local_nodes::Vector{Int64}: Node set.

Returns

  • value::Vector: Global value.
  • nnodes::Int64: Number of nodes.
source
PeriLab.IO.calculate_volumeMethod
calculate_volume(element_type::String, vertices::Vector{Vector{Float64}})

Calculate the volume of a element.

Arguments

  • element_type: The element type of the element.
  • vertices: The vertices of the element.

Returns

  • volume: The volume of the element.
source
PeriLab.IO.check_for_duplicate_in_dataframeMethod
check_for_duplicate_in_dataframe(mesh::DataFrame)

check duplicated entries and throws an error if one is there. If not everything is ok.

Arguments

  • mesh::DataFrame: The input mesh data represented as a DataFrame.
source
PeriLab.IO.check_mesh_elementsMethod
check_mesh_elements(mesh, dof)

Process and analyze mesh data to create an dictionary containing information about mesh elements for further processing.

Arguments

  • mesh::DataFrame: The input mesh data represented as a DataFrame.
  • dof::Int64: The degrees of freedom (DOF) for the mesh elements.

Returns

A dictionary containing information about mesh elements, which can be used for further processing or uploading.

Example

```julia meshdata = DataFrame(x1 = [1.0, 2.0, 3.0], x2 = [4.0, 5.0, 6.0], volume = [10.0, 20.0, 30.0]) dof = 3 result = checkmeshelements(meshdata, dof)

source
PeriLab.IO.check_types_in_dataframeMethod
check_types_in_dataframe(mesh::DataFrame)

check if block_id in mesh contains only int.

Arguments

  • mesh::DataFrame: The input mesh data represented as a DataFrame.
source
PeriLab.IO.clearNP1Method
clearNP1(name::String)

Clears the NP1 from the name

Arguments

  • name::String: The name

Returns

  • name::String: The cleared name
source
PeriLab.IO.close_result_filesMethod
close_result_files(result_files::Vector{Dict}, outputs::Dict{Int64,Dict{}})

Closes the result files if the flush_file flag is not set

Arguments

  • result_files::Vector{Dict}: The result files
  • outputs::Dict{Int64,Dict{}}: The output settings
source
PeriLab.IO.close_result_filesMethod
close_result_files(result_files::Vector{Dict})

Closes the result files

Arguments

  • result_files::Vector{Dict}: The result files

Returns

  • true: File is closed
  • false: File was already closed
source
PeriLab.IO.create_and_distribute_bond_normMethod
create_and_distribute_bond_norm(comm::MPI.Comm, datamanager::Module, nlist_filtered_ids::Vector{Vector{Int64}}, distribution::Vector{Int64}, bond_norm::Vector{Float64}, dof::Int64)

Create and distribute the bond norm

Arguments

  • comm::MPI.Comm: MPI communicator
  • datamanager::Module: Data manager
  • nlist_filtered_ids::Vector{Vector{Int64}}: The filtered neighborhood list
  • distribution::Vector{Int64}: The distribution
  • bond_norm::Vector{Float64}: The bond norm
  • dof::Int64: The degree of freedom
source
PeriLab.IO.create_distributionMethod
create_distribution(nnodes::Int64, size::Int64)

Calculate the initial size of each chunk for a nearly equal number of nodes vs. cores this algorithm might lead to the problem, that the last core is not equally loaded

Arguments

  • nnodes::Int64: The number of nodes.
  • size::Int64: The number of cores.

Returns

  • distribution::Array{Int64,1}: The distribution of the nodes.
  • point_to_core::Array{Int64,1}: The number of nodes in each rank.
source
PeriLab.IO.create_distribution_neighbor_basedMethod
create_distribution_neighbor_based(nnodes::Int64,nlist::Vector{Vector{Int64}}, size::Int64)

Calculate the initial size of each chunk for a nearly equal number of nodes vs. cores this algorithm might lead to the problem, that the last core is not equally loaded

Arguments

  • nnodes::Int64: The number of nodes.
  • nlist::Vector{Vector{Int64}}: The neighborhood list.
  • size::Int64: The number of cores.

Returns

  • distribution::Array{Int64,1}: The distribution of the nodes.
  • point_to_core::Array{Int64,1}: The number of nodes in each rank.
source
PeriLab.IO.create_distribution_node_basedMethod
create_distribution_node_based(nnodes::Int64,nlist::Vector{Vector{Int64}}, size::Int64)

Calculate the initial size of each chunk for a nearly equal number of nodes vs. cores this algorithm might lead to the problem, that the last core is not equally loaded

Arguments

  • nnodes::Int64: The number of nodes.
  • nlist::Vector{Vector{Int64}}: The neighborhood list.
  • size::Int64: The number of cores.

Returns

  • distribution::Array{Int64,1}: The distribution of the nodes.
  • point_to_core::Array{Int64,1}: The number of nodes in each rank.
source
PeriLab.IO.create_neighborhoodlistMethod
create_neighborhoodlist(mesh::DataFrame, params::Dict, dof::Int64)

Create the neighborhood list of the mesh elements.

Arguments

  • mesh::DataFrame: The input mesh data represented as a DataFrame.
  • params::Dict: The input parameters.
  • dof::Int64: The degrees of freedom (DOF) for the mesh elements.

Returns

  • nlist::Array{Array{Int64,1},1}: The neighborhood list of the mesh elements.
source
PeriLab.IO.create_overlap_mapMethod
create_overlap_map(distribution, ptc, size)

Create the overlap map.

Arguments

  • distribution::Array{Int64,1}: The distribution of the nodes.
  • ptc::Array{Int64,1}: The number of nodes in each rank.
  • size::Int64: The number of ranks.

Returns

  • overlap_map::Dict{Int64,Dict{Int64,Dict{String,Vector{Int64}}}}: The overlap map.
source
PeriLab.IO.create_result_fileFunction
create_result_file(filename::Union{AbstractString,String}, num_nodes::Int64, num_dim::Int64, num_elem_blks::Int64, num_node_sets::Int64)

Creates a exodus file for the results

Arguments

  • filename::Union{AbstractString,String}: The name of the file to create
  • num_nodes::Int64: The number of nodes
  • num_dim::Int64: The number of dimensions
  • num_elem_blks::Int64: The number of element blocks
  • num_node_sets::Int64: The number of node sets

Returns

  • result_file::Dict{String,Any}: A dictionary containing the filename and the exodus file
source
PeriLab.IO.create_result_fileMethod
create_result_file(filename::String, outputs::Dict)

Creates a csv file for the results

Arguments

  • filename::String: The name of the file to create
  • outputs::Dict: The outputs dictionary

Returns

  • Dict: The result file
source
PeriLab.IO.csv_readerMethod
csv_reader(filename::String)

Read csv and return it as a DataFrame.

Arguments

  • filename::String: The path to the mesh file.

Returns

  • csvData::DataFrame: The csv data a DataFrame.
source
PeriLab.IO.define_nsetsMethod
define_nsets(nsets::Dict{String,Vector{Int64}}, datamanager::Module)

Defines the node sets

Arguments

  • nsets::Dict{String,Vector{Int64}}: Node sets read from files
  • datamanager::Module: Data manager
source
PeriLab.IO.disk_filterMethod
disk_filter(nnodes::Int64, data::Matrix{Float64}, filter::Dict, nlist::Vector{Vector{Int64}}, dof::Int64)

Apply the disk filter to the neighborhood list.

Arguments

  • nnodes::Int64: The number of nodes.
  • data::Matrix{Float64}: The data.
  • filter::Dict: The filter.
  • nlist::Vector{Vector{Int64}}: The neighborhood list.
  • dof::Int64: The degrees of freedom.

Returns

  • filter_flag::Vector{Bool}: The filter flag.
  • normal::Vector{Float64}: The normal vector of the disk.
source
PeriLab.IO.distribute_neighborhoodlist_to_coresMethod
distribute_neighborhoodlist_to_cores(comm::MPI.Comm, datamanager::Module, nlist, distribution)

Distributes the neighborhood list to the cores.

Arguments

  • comm::MPI.Comm: MPI communicator
  • datamanager::Module: Data manager
  • nlist: neighborhood list
  • distribution Array{Int64}: global nodes distribution at cores

Returns

  • datamanager::Module: data manager
source
PeriLab.IO.distribution_to_coresMethod
distribution_to_cores(comm::MPI.Comm, datamanager::Module, mesh, distribution, dof::Int64)

Distributes the mesh data to the cores

Arguments

  • comm::MPI.Comm: MPI communicator
  • datamanager::Module: Data manager
  • mesh: Mesh
  • distribution Array{Int64}: global nodes distribution at cores
  • dof::Int64: Degree of freedom

Returns

  • datamanager::Module: data manager
source
PeriLab.IO.element_distributionMethod
element_distribution(topology::Vector{Vector{Int64}}, ptc::Vector{Int64}, size::Int64)

Create the distribution of the finite elements. Is needed to avoid multiple element calls. Each element should run only one time at the cores.

Arguments

  • topology::Vector{Vector{Int64}}: The topology list of the mesh elements.
  • nlist::Vector{Vector{Int64}}: The neighborhood list of the mesh elements.
  • size::Int64: The number of ranks.

Returns

  • distribution::Vector{Vector{Int64}}: The distribution of the nodes.
  • etc::Vector{Int64}: The number of nodes in each rank.
source
PeriLab.IO.extrude_surface_meshMethod
extrude_surface_mesh(mesh::DataFrame)

extrude the mesh at the surface of the block

Arguments

  • mesh::DataFrame: The input mesh data represented as a DataFrame.
  • params::Dict: The input parameters.
source
PeriLab.IO.find_and_set_core_value_avgMethod
find_and_set_core_value_avg(comm::MPI.Comm, value::Union{Float64,Int64})

Find and set core value avg

Arguments

  • comm::MPI.Comm: The MPI communicator
  • value::Union{Float64,Int64}: The value

Returns

  • recv_msg::Union{Int64,Vector{Float64},Vector{Int64},Vector{Bool}}: The received message
source
PeriLab.IO.find_and_set_core_value_maxMethod
find_and_set_core_value_max(comm::MPI.Comm, value::Union{Float64,Int64})

Find and set core value max

Arguments

  • comm::MPI.Comm: The MPI communicator
  • value::Union{Float64,Int64}: The value

Returns

  • recv_msg::Union{Int64,Vector{Float64},Vector{Int64},Vector{Bool}}: The received message
source
PeriLab.IO.find_and_set_core_value_minMethod
find_and_set_core_value_min(comm::MPI.Comm, value::Union{Float64,Int64})

Find and set core value min

Arguments

  • comm::MPI.Comm: The MPI communicator
  • value::Union{Float64,Int64}: The value

Returns

  • recv_msg::Union{Int64,Vector{Float64},Vector{Int64},Vector{Bool}}: The received message
source
PeriLab.IO.find_and_set_core_value_sumMethod
find_and_set_core_value_sum(comm::MPI.Comm, value::Union{Float64,Int64})

Find and set core value sum

Arguments

  • comm::MPI.Comm: The MPI communicator
  • value::Union{Float64,Int64}: The value

Returns

  • recv_msg::Union{Int64,Vector{Float64},Vector{Int64},Vector{Bool}}: The received message
source
PeriLab.IO.find_global_core_value!Method
find_global_core_value!(global_value::Union{Int64,Float64}, calculation_type::String, nnodes::Int64, datamanager::Module)

Find global core value.

Arguments

  • global_value::Union{Int64,Float64}: The global value
  • calculation_type::String: The calculation type
  • nnodes::Int64: The number of nodes
  • datamanager::Module: The datamanager

Returns

  • global_value::Union{Int64,Float64}: The global value
source
PeriLab.IO.gather_valuesMethod
gather_values(comm::MPI.Comm, value::Any)

Gather values

Arguments

  • comm::MPI.Comm: The MPI communicator
  • value::Any: The value

Returns

  • recv_msg::Any: The received message
source
PeriLab.IO.get_block_nodesMethod
get_block_nodes(block_Id::Union{SubArray,Vector{Int64}}, block::Int64)

Returns the nodes of a block

Arguments

  • block_Id::Union{SubArray,Vector{Int64}}: The block Id
  • block::Int64: The block

Returns

  • nodes::Vector{Int64}: The nodes of the block
source
PeriLab.IO.get_bond_geometryMethod
get_bond_geometry(datamanager::Module)

Gets the bond geometry

Arguments

  • datamanager::Module: Data manager

Returns

  • datamanager::Module: data manager
source
PeriLab.IO.get_file_sizeMethod
get_file_size(result_files::Vector{Dict})

Gets the file size of the result files

Arguments

  • result_files: The result files

Returns

  • total_file_size: The total file size
source
PeriLab.IO.get_global_valuesMethod
get_global_values(output::Dict, datamanager::Module)

Get global values.

Arguments

  • output::Dict: The output
  • datamanager::Module: The datamanager

Returns

  • global_values::Vector: The global values
source
PeriLab.IO.get_local_element_topologyMethod
get_local_element_topology(datamanager::Module, topology::Vector{Vector{Int64}}, distribution::Vector{Int64})

Get the local element topology

Arguments

  • datamanager::Module: The datamanager
  • topology::Vector{Vector{Int64}}: The topology
  • distribution::Vector{Int64}: The distribution

Returns

  • datamanager::Module: The datamanager
source
PeriLab.IO.get_local_neighborsMethod
get_local_neighbors(mapping, nlist_core)

Gets the local neighborhood list from the global neighborhood list

Arguments

  • mapping: mapping function
  • nlist_core: global neighborhood list

Returns

  • nlist_core: local neighborhood list
source
PeriLab.IO.get_local_overlap_mapMethod
get_local_overlap_map()

Changes entries in the overlap map from the global numbering to the local computer core one.

Arguments

  • overlap_map::Dict{Int64, Dict{Int64, String}}: overlap map with global nodes.
  • distribution::Vector{Vector{Int64}}: global nodes distribution at cores, needed for the gobal to local mapping
  • ranks Array{Int64} : number of used computer cores

Returns

  • overlap_map::Dict{Int64, Dict{Int64, String}}: returns overlap map with local nodes.

Example:

get_local_overlap_map(overlap_map, distribution, ranks)  # returns local nodes
source
PeriLab.IO.get_mpi_rank_stringMethod
get_mpi_rank_string(rank::Int64, max_rank::Int64)

Get MPI rank string.

Arguments

  • value::Int64: The rank
  • max_rank::Int64: The max rank

Returns

  • result::String: The result
source
PeriLab.IO.get_number_of_neighbornodesMethod
get_number_of_neighbornodes(nlist::Vector{Vector{Int64}})

Get the number of neighbors for each node.

Arguments

  • nlist::Vector{Vector{Int64}}: The neighborhood list of the mesh elements.

Returns

  • length_nlist::Vector{Int64}: The number of neighbors for each node.
source
PeriLab.IO.get_paraview_coordinatesMethod
get_paraview_coordinates(dof::Int64, refDof::Int64)

Returns the paraview specific dof

Arguments

  • dof::Int64: The degrees of freedom
  • refDof::Int64: The reference degrees of freedom

Returns

  • paraview_specifics::String: The paraview specific dof
source
PeriLab.IO.get_results_mappingMethod
get_results_mapping(params::Dict, path::String, datamanager::Module)

Gets the results mapping

Arguments

  • params::Dict: The parameters
  • path::String: The path
  • datamanager::Module: The datamanager

Returns

  • output_mapping::Dict{Int64,Dict{}}: The results mapping
source
PeriLab.IO.glob_to_locMethod
glob_to_loc(distribution)

Get the global to local mapping

Arguments

  • distribution: The distribution

Returns

  • glob_to_loc: The global to local mapping
source
PeriLab.IO.global_value_avgMethod
global_value_avg(field::Union{Vector{Float64},Matrix{Float64}}, dof::Union{Int64,Vector{Int64}}, nodes::Union{SubArray,Vector{Int64}})

Calculate the global average of a field for given nodes.

Arguments

  • field::Union{Vector{Float64},Matrix{Float64}}: Field.
  • dof::Union{Int64,Vector{Int64}}: Degree of freedom
  • nodes::Union{SubArray,Vector{Int64}}: Nodes.

Returns

  • returnValue::Vector: Global value.
source
PeriLab.IO.global_value_maxMethod
global_value_max(field::Union{Vector{Float64},Matrix{Float64}}, dof::Union{Int64,Vector{Int64}}, nodes::Union{SubArray,Vector{Int64}})

Calculate the global maximum of a field for given nodes.

Arguments

  • field::Union{Vector{Float64},Matrix{Float64}}: Field.
  • dof::Union{Int64,Vector{Int64}}: Degree of freedom
  • nodes::Union{SubArray,Vector{Int64}}: Nodes.

Returns

  • returnValue::Vector: Global value.
source
PeriLab.IO.global_value_minMethod
global_value_min(field::Union{Vector{Float64},Matrix{Float64}}, dof::Union{Int64,Vector{Int64}}, nodes::Union{SubArray,Vector{Int64}})

Calculate the global minimum of a field for given nodes.

Arguments

  • field::Union{Vector{Float64},Matrix{Float64}}: Field.
  • dof::Union{Int64,Vector{Int64}}: Degree of freedom
  • nodes::Union{SubArray,Vector{Int64}}: Nodes.

Returns

  • returnValue::Vector: Global value.
source
PeriLab.IO.global_value_sumMethod
global_value_sum(field::Union{Vector{Float64},Matrix{Float64}}, dof::Union{Int64,Vector{Int64}}, nodes::Union{SubArray,Vector{Int64}})

Calculate the global sum of a field for given nodes.

Arguments

  • field::Union{Vector{Float64},Matrix{Float64}}: Field.
  • dof::Union{Int64,Vector{Int64}: Degree of freedom
  • nodes::Union{SubArray,Vector{Int64}}: Nodes.

Returns

  • returnValue::Vector: Global value.
source
PeriLab.IO.hex8_volumeMethod

hex8volume(hexvertices)

Calculate the volume of a hex.

Arguments

  • hex_vertices: The vertices of the wedge.

Returns

  • volume: The volume of the wedge.
source
PeriLab.IO.init_dataMethod
init_data(params::Dict, path::String, datamanager::Module, comm::MPI.Comm, to::TimerOutput)

Initializes the data for the mesh.

Arguments

  • params::Dict: The parameters for the simulation.
  • path::String: The path to the mesh file.
  • datamanager::Data_manager: The data manager.
  • comm::MPI.Comm: The MPI communicator.
  • to::TimerOutput: The timer output.

Returns

  • datamanager::Data_manager: The data manager.
  • params::Dict: The parameters for the simulation.
source
PeriLab.IO.init_results_in_exodusFunction
init_results_in_exodus(exo::ExodusDatabase, output::Dict{}, coords::Union{Matrix{Int64},Matrix{Float64}}, block_Id::Vector{Int64}, uniqueBlocks::Vector{Int64}, nsets::Dict{String,Vector{Int64}}, global_ids::Vector{Int64}, PERILAB_VERSION::String)

Initializes the results in exodus

Arguments

  • exo::ExodusDatabase: The exodus database
  • output::Dict{String,Any}: The output
  • coords::Union{Matrix{Int64},Matrix{Float64}}: The coordinates
  • block_Id::Vector{Int64}: The block Id
  • uniqueBlocks::Vector{Int64}: The unique blocks
  • nsets::Dict{String,Vector{Int64}}: The node sets
  • global_ids::Vector{Int64}: The global ids

Returns

  • result_file::Dict{String,Any}: The result file
source
PeriLab.IO.init_write_resultsMethod
init_write_results(params::Dict, output_dir::String, path::String, datamanager::Module, nsteps::Int64, PERILAB_VERSION::String)

Initialize write results.

Arguments

  • params::Dict: The parameters
  • output_dir::String: The output directory.
  • path::String: The path
  • datamanager::Module: The datamanager
  • nsteps::Int64: The number of steps

Returns

  • result_files::Array: The result files
  • outputs::Dict: The outputs
source
PeriLab.IO.initialize_dataMethod
initialize_data(filename::String, filedirectory::String, datamanager::Module, comm::MPI.Comm, to::TimerOutputs.TimerOutput)

Initialize data.

Arguments

  • filename::String: The name of the input file.
  • filedirectory::String: The directory of the input file.
  • datamanager::Module: The datamanager
  • comm::MPI.Comm: The MPI communicator
  • to::TimerOutputs.TimerOutput: The TimerOutput

Returns

  • data::Dict: The data
source
PeriLab.IO.load_and_evaluate_meshMethod
load_and_evaluate_mesh(params::Dict, path::String, ranksize::Int64, to::TimerOutput)

Load and evaluate the mesh data.

Arguments

  • params::Dict: The input parameters.
  • path::String: The path to the mesh file.
  • ranksize::Int64: The number of ranks.
  • to::TimerOutput: The timer output

Returns

  • distribution::Array{Int64,1}: The distribution of the mesh elements.
  • mesh::DataFrame: The mesh data as a DataFrame.
  • ntype::Dict: The type of the mesh elements.
  • overlap_map::Array{Array{Int64,1},1}: The overlap map of the mesh elements.
  • nlist::Array{Array{Int64,1},1}: The neighborhood list of the mesh elements.
  • dof::Int64: The degrees of freedom (DOF) for the mesh elements.
  • nsets::Dict: The node sets
  • topology::Int64::Array{Int64,nelement:nodes}`: The topology of elements.
  • el_distribution::Array{Int64,1}: The distribution of the finite elements.
source
PeriLab.IO.local_nodes_from_dictMethod
local_nodes_from_dict(glob_to_loc::Dict{Int,Int}, global_nodes::Vector{Int64})

Changes entries in the overlap map from the global numbering to the local computer core one.

Arguments

  • glob_to_loc::Dict{Int,Int}: global to local mapping
  • global_nodes::Vector{Int64}: global nodes

Returns

  • overlap_map::Dict{Int64, Dict{Int64, String}}: returns overlap map with local nodes.
source
PeriLab.IO.merge_exodus_fileMethod
merge_exodus_file(file_name::Union{AbstractString,String})

Merges the exodus file

Arguments

  • file_name::Union{AbstractString,String}: The name of the file to merge

Returns

  • exo::ExodusDatabase: The exodus file
source
PeriLab.IO.merge_exodus_filesMethod
merge_exodus_files(result_files::Vector{Any}, output_dir::String)

Merges exodus output files

Arguments

  • result_files::Vector{Any}: The result files
  • output_dir::String: The file directory
source
PeriLab.IO.neighborsMethod
neighbors(mesh, params::Dict, coor)

Compute the neighbor list for each node in a mesh based on their proximity using a BallTree data structure.

Arguments

  • mesh: A mesh data structure containing the coordinates and other information.
  • params: paramss needed for computing the neighbor list.
  • coor: A vector of coordinate names along which to compute the neighbor list.

Returns

An array of neighbor lists, where each element represents the neighbors of a node in the mesh.

source
PeriLab.IO.node_distributionFunction
node_distribution(nlist::Vector{Vector{Int64}}, size::Int64)

Create the distribution of the nodes.

Arguments

  • nlist::Vector{Vector{Int64}}: The neighborhood list of the mesh elements.
  • size::Int64: The number of ranks.
  • distribution_type::String: The distribution type.

Returns

  • distribution::Vector{Vector{Int64}}: The distribution of the nodes.
  • ptc::Vector{Int64}: Defines at which core / rank each node lies.
  • ntype::Dict: The type of the nodes.
source
PeriLab.IO.paraview_specificsMethod
paraview_specifics(dof::Int64)

Returns the paraview specific dof

Arguments

  • dof::Int64: The degrees of freedom

Returns

  • paraview_specifics::String: The paraview specific dof
source
PeriLab.IO.read_external_topologyMethod
read_external_topology(filename::String)

Read external topoloy data from a file and return it as a DataFrame.

Arguments

  • filename::String: The path to the mesh file.

Returns

  • external_topology::DataFrame: The external topology data as a DataFrame.
source
PeriLab.IO.read_inputMethod
read_input(filename::String)

Reads the input deck from a yaml file

Arguments

  • filename::String: The name of the yaml file

Returns

  • params::Dict{String,Any}: The parameters read from the yaml file
source
PeriLab.IO.read_input_fileMethod
read_input_file(filename::String)

Reads the input deck from a yaml file

Arguments

  • filename::String: The name of the yaml file

Returns

  • Dict{String,Any}: The validated parameters read from the yaml file.
source
PeriLab.IO.read_meshMethod
read_mesh(filename::String, params::Dict)

Read mesh data from a file and return it as a DataFrame.

Arguments

  • filename::String: The path to the mesh file.
  • params::Dict: The input parameters.

Returns

  • mesh::DataFrame: The mesh data as a DataFrame.
source
PeriLab.IO.rectangular_plane_filterMethod
rectangular_plane_filter(nnodes::Int64, data::Matrix{Float64}, filter::Dict, nlist::Vector{Vector{Int64}}, dof::Int64)

Apply the rectangular plane filter to the neighborhood list.

Arguments

  • nnodes::Int64: The number of nodes.
  • data::Matrix{Float64}: The data.
  • filter::Dict: The filter.
  • nlist::Vector{Vector{Int64}}: The neighborhood list.
  • dof::Int64: The degrees of freedom.

Returns

  • filter_flag::Vector{Bool}: The filter flag.
  • normal::Vector{Float64}: The normal vector of the disk.
source
PeriLab.IO.send_single_value_from_vectorMethod
send_single_value_from_vector(comm::MPI.Comm, controller::Int64, values::Union{Int64,Vector{Float64},Vector{Int64},Vector{Bool}}, type::Type)

Sends a single value from a vector to a controller

Arguments

  • comm::MPI.Comm: The MPI communicator
  • controller::Int64: The controller
  • values::Union{Int64,Vector{Float64},Vector{Int64},Vector{Bool}}: The values
  • type::Type: The type

Returns

  • recv_msg::Union{Int64,Vector{Float64},Vector{Int64},Vector{Bool}}: The received message
source
PeriLab.IO.send_valueMethod
send_value(comm::MPI.Comm, controller, send_msg)

Sends a value to a controller

Arguments

  • comm::MPI.Comm: The MPI communicator
  • controller::Int64: The controller
  • send_msg::Union{Int64,Vector{Float64},Vector{Int64},Vector{Bool}}: The send message

Returns

  • recv_msg::Union{Int64,Vector{Float64},Vector{Int64},Vector{Bool}}: The received message
source
PeriLab.IO.send_vector_from_root_to_core_iMethod
send_vector_from_root_to_core_i(comm::MPI.Comm, send_msg, recv_msg, distribution)

Sends a vector from the root to the core i

Arguments

  • comm::MPI.Comm: The MPI communicator
  • send_msg::Union{Int64,Vector{Float64},Vector{Int64},Vector{Bool}}: The send message
  • recv_msg::Union{Int64,Vector{Float64},Vector{Int64},Vector{Bool}}: The receive message
  • distribution::Vector{Int64}: The distribution

Returns

  • recv_msg::Union{Int64,Vector{Float64},Vector{Int64},Vector{Bool}}: The received message
source
PeriLab.IO.set_dofMethod
set_dof(mesh::DataFrame)

Set the degrees of freedom (DOF) for the mesh elements.

Arguments

  • mesh::DataFrame: The input mesh data represented as a DataFrame.

Returns

  • dof::Int64: The degrees of freedom (DOF) for the mesh elements.
source
PeriLab.IO.show_block_summaryMethod
show_block_summary(solver_options::Dict, params::Dict, log_file::String, silent::Bool, comm::MPI.Comm, datamanager::Module)

Show block summary.

Arguments

  • solver_options::Dict: The solver options
  • params::Dict: The params
  • log_file::String: The log file
  • silent::Bool: The silent flag
  • comm::MPI.Comm: The comm
  • datamanager::Module: The datamanager
source
PeriLab.IO.show_mpi_summaryMethod
show_mpi_summary(log_file::String, silent::Bool, comm::MPI.Comm, datamanager::Module)

Show MPI summary.

Arguments

  • log_file::String: The log file
  • silent::Bool: The silent flag
  • comm::MPI.Comm: The comm
  • datamanager::Module: The datamanager
source
PeriLab.IO.split_vectorMethod
split_vector(input, row_nums, dof)

Split a vector into a vector of matrices

Arguments

  • input::Vector: The input vector
  • row_nums::Vector: The row numbers
  • dof::Int: The degree of freedom

Returns

  • result::Vector: The result vector
source
PeriLab.IO.synch_controller_bonds_to_responderMethod
synch_controller_bonds_to_responder(comm::MPI.Comm, overlapnodes, array, dof)

Synch the controller bonds to the responder

Arguments

  • comm::MPI.Comm: The MPI communicator
  • overlapnodes::Dict: The overlap nodes
  • array::Array: The array
  • dof::Int: The degree of freedom

Returns

  • array::Array: The array
source
PeriLab.IO.synch_controller_bonds_to_responder_flattenedMethod
synch_controller_bonds_to_responder_flattened(comm::MPI.Comm, overlapnodes, array, dof)

Synch the controller bonds to the responder

Arguments

  • comm::MPI.Comm: The MPI communicator
  • overlapnodes::Dict: The overlap nodes
  • array::Array: The array
  • dof::Int: The degree of freedom

Returns

  • array::Array: The array
source
PeriLab.IO.synch_controller_to_responderMethod
synch_controller_to_responder(comm::MPI.Comm, overlapnodes, vector, dof)

Synch the controller to the responder

Arguments

  • comm::MPI.Comm: The MPI communicator
  • overlapnodes::Dict: The overlap nodes
  • vector::Vector: The vector
  • dof::Int: The degree of freedom

Returns

  • vector::Vector: The vector
source
PeriLab.IO.synch_responder_to_controllerMethod
synch_responder_to_controller(comm::MPI.Comm, overlapnodes, vector, dof)

Synch the responder to the controller

Arguments

  • comm::MPI.Comm: The MPI communicator
  • overlapnodes::Dict: The overlap nodes
  • vector::Vector: The vector
  • dof::Int: The degree of freedom

Returns

  • vector::Vector: The vector
source
PeriLab.IO.tetrahedron_volumeMethod
tetrahedron_volume(tet_vertices)

Calculate the volume of a tetrahedron.

Arguments

  • tet_vertices: The vertices of the tetrahedron.

Returns

  • volume: The volume of the tetrahedron.
source
PeriLab.IO.wedge6_volumeMethod
wedge6_volume(wedge_vertices)

Calculate the volume of a wedge.

Arguments

  • wedge_vertices: The vertices of the wedge.

Returns

  • volume: The volume of the wedge.
source
PeriLab.IO.write_global_results_in_csvMethod
write_global_results_in_csv(csv_file::IOStream, time::Float64, global_values)

Writes the global results to the csv file

Arguments

  • csv_file::IOStream: The csv file
  • global_values: The global values
source
PeriLab.IO.write_global_results_in_exodusMethod
write_global_results_in_exodus(exo::ExodusDatabase, step::Int64, global_values)

Writes the global results in the exodus file

Arguments

  • exo::ExodusDatabase: The exodus file
  • step::Int64: The step
  • global_values: The global values

Returns

  • exo::ExodusDatabase: The exodus file
source
PeriLab.IO.write_nodal_results_in_exodusMethod
write_nodal_results_in_exodus(exo::ExodusDatabase, step::Int64, output::Dict, datamanager::Module)

Writes the nodal results in the exodus file

Arguments

  • exo::ExodusDatabase: The exodus file
  • step::Int64: The step
  • output::Dict: The output
  • datamanager::Module: The datamanager

Returns

  • exo::ExodusDatabase: The exodus file
source
PeriLab.IO.write_resultsMethod
write_results(result_files::Vector{Any}, time::Float64, max_damage::Float64, outputs::Dict, datamanager::Module)

Write results.

Arguments

  • result_files::Vector{Any}: The result files
  • time::Float64: The time
  • max_damage::Float64: The maximum damage
  • outputs::Dict: The outputs
  • datamanager::Module: The datamanager

Returns

  • result_files::Vector{Any}: The result files
source
PeriLab.IO.write_step_and_timeMethod
write_step_and_time(exo::ExodusDatabase, step::Int64, time::Float64)

Writes the step and time in the exodus file

Arguments

  • exo::ExodusDatabase: The exodus file
  • step::Int64: The step
  • time::Float64: The time

Returns

  • exo::ExodusDatabase: The exodus file
source

Geometry

PeriLab.IO.Geometry.compute_deformation_gradients!Method
compute_deformation_gradients!(nodes::Union{SubArray, Vector{Int64}}, nlist, volume, omega, bond_damage, undeformed_bond, deformed_bond, inverse_shape_tensor, deformation_gradient)

Calculate the deformation gradient tensor for a set of nodes in a computational mechanics context.

Arguments

  • nodes::Union{SubArray, Vector{Int64}}: A vector of integers representing node IDs.
  • dof::Int64: An integer representing the degrees of freedom.
  • nlist: A data structure (e.g., a list or array) representing neighboring node IDs for each node.
  • volume: A vector or array containing volume information for each node.
  • omega: A vector or array containing omega information for each node.
  • bond_damage: A data structure representing bond damage for each node.
  • undeformed_bond: A data structure representing bond geometries for each node.
  • deformed_bond: A data structure representing deformed bond properties for each node.
  • inverse_shape_tensor: A data structure representing the inverse shape tensors for each node.
  • deformation_gradient: A preallocated 3D array to store the deformation gradient tensors for each node.

Output

  • deformation_gradient: An updated deformation_gradient array with calculated deformation gradient tensors.

Description

This function calculates the deformation gradient tensor for a set of nodes in a computational mechanics context. The deformation gradient tensor characterizes the deformation of a material.

For each node in nodes, the function iterates through degrees of freedom (dof) and computes elements of the deformation gradient tensor based on bond damage, deformed bond properties, bond geometries, volume, and omega information. The calculated deformation gradient tensor is stored in deformation_gradient.

Example

```julia nodes = [1, 2, 3] dof = 3 nlist = [[2, 3], [1, 3], [1, 2]] volume = [0.1, 0.2, 0.3] omega = [0.5, 0.4, 0.6] bonddamage = zeros(Float64, length(nodes), length(nlist[1])) undeformedbond = rand(Float64, length(nodes), length(nlist[1]), dof) deformedbond = rand(Float64, length(nodes), length(nlist[1]), dof) inverseshapetensor = rand(Float64, length(nodes), dof, dof) deformationgradient = zeros(Float64, length(nodes), dof, dof)

source
PeriLab.IO.Geometry.compute_shape_tensors!Method
compute_shape_tensors!(nodes::Union{SubArray, Vector{Int64}}, nlist, volume, omega, bond_damage, undeformed_bond, shape_tensor, inverse_shape_tensor)

Calculate the shape tensor and its inverse for a set of nodes in a computational mechanics context.

Arguments

  • nodes::Union{SubArray, Vector{Int64}}: A vector of integers representing node IDs.
  • dof::Int64: An integer representing the degrees of freedom.
  • nlist: A data structure (e.g., a list or array) representing neighboring node IDs for each node.
  • volume: A vector or array containing volume information for each node.
  • omega: A vector or array containing omega information for each node.
  • bond_damage: A data structure representing bond damage for each node.
  • undeformed_bond: A data structure representing bond geometries for each node.
  • shape_tensor: A preallocated 3D array to store the shape tensors for each node.
  • inverse_shape_tensor: A preallocated 3D array to store the inverse shape tensors for each node.

Output

  • shape_tensor: An updated shape_tensor array with calculated shape tensors.
  • inverse_shape_tensor: An updated inverse_shape_tensor array with calculated inverse shape tensors.

Description

This function calculates the shape tensor and its inverse for a set of nodes in a computational mechanics context. The shape tensor is a key quantity used in continuum mechanics to describe material deformation. It is calculated based on bond damage, bond geometries, volume, and omega information for each node.

For each node in nodes, the function iterates through degrees of freedom (dof) and computes elements of the shape tensor. The inverse of the shape tensor is also calculated and stored in inverse_shape_tensor.

Example

```julia nodes = [1, 2, 3] dof = 3 nlist = [[2, 3], [1, 3], [1, 2]] volume = [0.1, 0.2, 0.3] omega = [0.5, 0.4, 0.6] bonddamage = zeros(Float64, length(nodes), length(nlist[1])) undeformedbond = rand(Float64, length(nodes), length(nlist[1]), dof) shapetensor = zeros(Float64, length(nodes), dof, dof) inverseshape_tensor = zeros(Float64, length(nodes), dof, dof)

source
PeriLab.IO.Geometry.compute_strainMethod
function compute_strain(nodes::Union{Base.OneTo{Int64},Vector{Int64}, SubArray}, deformation_gradient, strain)

Calculate strains for specified nodes based on deformation gradients.

Arguments

  • nodes::Union{SubArray, Vector{Int64}}: List of nodes
  • deformation_gradient: Deformation gradient at current time step (2D or 3D array).

Returns

  • Updated strain array containing strains.

This function iterates over the specified nodes and computes strain at each node using the given deformation gradients.

source
PeriLab.IO.Geometry.rotation_tensorMethod
function rotation_tensor(angles::Vector{Float64})

Creates the rotation tensor for 2D or 3D applications. Uses Rotations.jl package.

Arguments

  • angles::Vector{Float64}: Vector of angles definede in degrees of length one or three

Returns

  • Rotation tensor
source

parameter_handling

PeriLab.IO.Parameter_Handling.get_block_modelsMethod
get_block_models(params::Dict, block_id::Int64)

Get the models of a block.

Arguments

  • params::Dict: The parameters
  • block_id::Int64: The ID of the block

Returns

  • modelDict::Dict{String,String}: The models of the block
source
PeriLab.IO.Parameter_Handling.get_bond_filtersMethod
get_bond_filters(params::Dict)

Returns the bond filters from the parameters

Arguments

  • params::Dict: The parameters

Returns

  • check::Bool: Whether the bond filters are defined
  • bfList::Dict{String,Dict{String,Any}}: The bond filters
source
PeriLab.IO.Parameter_Handling.get_computesMethod
get_computes(params::Dict, variables::Vector{String})

Get the computes.

Arguments

  • params::Dict: The parameters dictionary.
  • variables::Vector{String}: The variables.

Returns

  • computes::Dict{String,Dict{Any,Any}}: The computes.
source
PeriLab.IO.Parameter_Handling.get_densityMethod
get_density(params::Dict, block_id::Int64)

Get the density of a block.

Arguments

  • params::Dict: The parameters
  • block_id::Int64: The ID of the block

Returns

  • density::Float64: The density of the block
source
PeriLab.IO.Parameter_Handling.get_fem_blockMethod
get_fem_block(params::Dict, block_id::Int64)

Get the fem_block of a block.

Arguments

  • params::Dict: The parameters
  • block_id::Int64: The ID of the block

Returns

  • fem_block::Float64: The fem_block of the block
source
PeriLab.IO.Parameter_Handling.get_headerMethod
get_header(filename::Union{String,AbstractString})

Returns the header line and the header.

Arguments

  • filename::Union{String,AbstractString}: The filename of the file.

Returns

  • header_line::Int: The header line.
  • header::Vector{String}: The header.
source
PeriLab.IO.Parameter_Handling.get_heat_capacityMethod
get_heat_capacity(params::Dict, block_id::Int64)

Get the heat capacity of a block.

Arguments

  • params::Dict: The parameters
  • block_id::Int64: The ID of the block

Returns

  • heat_capacity::Float64: The heat capacity of the block
source
PeriLab.IO.Parameter_Handling.get_horizonMethod
get_horizon(params::Dict, block_id::Int64)

Get the horizon of a block.

Arguments

  • params::Dict: The parameters
  • block_id::Int64: The ID of the block

Returns

  • horizon::Float64: The horizon of the block
source
PeriLab.IO.Parameter_Handling.get_model_parameterMethod
get_model_parameter(params, model, id)

Retrieve a model parameter from a dictionary of parameters.

This function retrieves a specific model parameter from a dictionary of parameters based on the provided model and identifier (id).

Arguments

  • params::Dict: A dictionary containing various parameters.

  • model::String: The model type for which the parameter is sought.

  • id::String: The identifier (name) of the specific model parameter.

Returns

  • parameter::Any: The retrieved model parameter, or nothing if the parameter is not found.

Errors

  • If the specified model is defined in blocks but no model definition block exists, an error message is logged, and the function returns nothing.

  • If the model with the given identifier is defined in blocks but missing in the model's definition, an error message is logged, and the function returns nothing.

Example

```julia params = Dict( "Models" => Dict( "Models" => Dict( "ModelA" => 42, "ModelB" => 24 ) ) )

model = "Models" id = "ModelA"

result = getmodelparameter(params, model, id) if result !== nothing println("Parameter id: result") else println("Parameter not found.") end

source
PeriLab.IO.Parameter_Handling.get_node_setsMethod
get_node_sets(params::Dict, path::String)

Returns the node sets from the parameters

Arguments

  • params::Dict: The parameters
  • path::String: The path to the mesh file

Returns

  • nsets::Dict{String,Any}: The node sets
source
PeriLab.IO.Parameter_Handling.get_output_fieldnamesMethod
get_output_fieldnames(outputs::Dict, variables::Vector{String}, computes::Vector{String}, output_type::String)

Gets the output fieldnames.

Arguments

  • outputs::Dict: The outputs
  • variables::Vector{String}: The variables
  • computes::Vector{String}: The computes
  • output_type::String: The output type

Returns

  • output_fieldnames::Vector{String}: The output fieldnames
source
PeriLab.IO.Parameter_Handling.get_output_variablesMethod
get_output_variables(output::String, variables::Vector{String})

Get the output variable.

Arguments

  • output::String: The output variable.
  • variables::Vector{String}: The variables.

Returns

  • output::String: The output variable.
source
PeriLab.IO.Parameter_Handling.get_outputsMethod
get_outputs(params::Dict, variables::Vector{String}, compute_names::Vector{String})

Gets the outputs.

Arguments

  • params::Dict: The parameters
  • variables::Vector{String}: The variables
  • compute_names::Vector{String}: The compute names

Returns

  • outputs::Dict: The outputs
source
PeriLab.IO.Parameter_Handling.get_valuesFunction
get_values(params::Dict, block_id::Int64, valueName::String, defaultValue::Union{Float64,Bool,Nothing})

Get the value of a block.

Arguments

  • params::Dict: The parameters
  • block_id::Int64: The ID of the block
  • valueName::String: The name of the value
  • defaultValue::Union{Float64,Bool,Nothing: The default value

Returns

  • value::Float64: The value of the block
source
PeriLab.IO.Parameter_Handling.validate_structure_recursiveFunction
validate_structure_recursive(expected::Dict, actual::Dict, validate::Bool, checked_keys::Array, path::String="")

Validates the parameters against the expected structure

Arguments

  • expected::Dict: The expected structure
  • actual::Dict: The actual structure
  • validate::Bool: The validation results
  • checked_keys::Array: The keys that have been checked
  • path::String: The current path

Returns

  • validate::Bool: The validation result
  • checked_keys::Array: The keys that have been checked
source

IO - Functions

Index

IO

PeriLab.IO._init_overlap_map_Method
_init_overlap_map_(size)

Initialize the overlap map.

Arguments

  • size::Int64: The number of ranks.

Returns

  • overlap_map::Dict{Int64,Dict{Int64,Dict{String,Vector{Int64}}}}: The overlap map.
source
PeriLab.IO.apply_bond_filtersMethod
apply_bond_filters(nlist::Vector{Vector{Int64}}, mesh::DataFrame, params::Dict, dof::Int64)

Apply the bond filters to the neighborhood list.

Arguments

  • nlist::Vector{Vector{Int64}}: The neighborhood list.
  • mesh::DataFrame: The mesh.
  • params::Dict: The parameters.
  • dof::Int64: The degrees of freedom.

Returns

  • nlist::Vector{Vector{Int64}}: The filtered neighborhood list.
  • nlist_filtered_ids::Vector{Vector{Int64}}: The filtered neighborhood list.
source
PeriLab.IO.area_of_polygonMethod
area_of_polygon(vertices)

Calculate the area of a polygon.

Arguments

  • vertices: The vertices of the polygon.

Returns

  • area: The area of the polygon.
source
PeriLab.IO.bond_intersect_infinite_planeMethod
bond_intersect_infinite_plane(p0::Vector{Float64}, p1::Vector{Float64}, lower_left_corner::Vector{Float64}, normal::Vector{Float64})

Check if a line segment intersects an infinite plane.

Arguments

  • p0::Vector{Float64}: The start point of the line segment.
  • p1::Vector{Float64}: The end point of the line segment.
  • lower_left_corner::Vector{Float64}: The lower left corner of the plane.
  • normal::Vector{Float64}: The normal of the plane.

Returns

  • Bool: True if the line segment intersects the plane, False otherwise.
source
PeriLab.IO.bond_intersect_rectangle_planeMethod
bond_intersect_rectangle_plane(x::Vector{Float64}, lower_left_corner::Vector{Float64}, bottom_unit_vector::Vector{Float64}, normal::Vector{Float64}, side_length::Float64, bottom_length::Float64)

Check if a bond intersects a rectangle plane.

Arguments

  • x::Vector{Float64}: The point.
  • lower_left_corner::Vector{Float64}: The lower left corner of the rectangle.
  • bottom_unit_vector::Vector{Float64}: The unit vector along the bottom of the rectangle.
  • normal::Vector{Float64}: The normal of the plane.
  • side_length::Float64: The side length of the rectangle.
  • bottom_length::Float64: The bottom length of the rectangle.

Returns

  • Bool: True if the point is inside the rectangle, False otherwise.
source
PeriLab.IO.bond_intersects_discMethod
bond_intersects_disc(p0::Vector{Float64}, p1::Vector{Float64}, center::Vector{Float64}, normal::Vector{Float64}, radius::Float64)

Check if a line segment intersects a disk.

Arguments

  • p0::Vector{Float64}: The start point of the line segment.
  • p1::Vector{Float64}: The end point of the line segment.
  • center::Vector{Float64}: The center of the disk.
  • normal::Vector{Float64}: The normal of the plane.
  • radius::Float64: The radius of the disk.

Returns

  • Bool: True if the line segment intersects the disk, False otherwise.
source
PeriLab.IO.calculate_blockMethod
calculate_block(datamanager::Module, field_key::String, dof::Int64, calculation_type::String, block::Int64)

Calculate the global value of a field for a given block.

Arguments

  • datamanager::Data_manager: Datamanager.
  • field_key::String: Field key.
  • dof::Union{Int64,Vector{Int64}}: Degree of freedom
  • calculation_type::String: Calculation type.
  • block::Int64: Block number.

Returns

  • value::Float64: Global value.
  • nnodes::Int64: Number of nodes.
source
PeriLab.IO.calculate_nodelistMethod
calculate_nodelist(datamanager::Module, field_key::String, dof::Union{Int64,Vector{Int64}}, calculation_type::String, local_nodes::Vector{Int64})

Calculate the global value of a field for a given set of nodes.

Arguments

  • datamanager::Data_manager: Datamanager.
  • field_key::String: Field key.
  • dof::Union{Int64,Vector{Int64}}: Degree of freedom
  • calculation_type::String: Calculation type.
  • local_nodes::Vector{Int64}: Node set.

Returns

  • value::Vector: Global value.
  • nnodes::Int64: Number of nodes.
source
PeriLab.IO.calculate_volumeMethod
calculate_volume(element_type::String, vertices::Vector{Vector{Float64}})

Calculate the volume of a element.

Arguments

  • element_type: The element type of the element.
  • vertices: The vertices of the element.

Returns

  • volume: The volume of the element.
source
PeriLab.IO.check_for_duplicate_in_dataframeMethod
check_for_duplicate_in_dataframe(mesh::DataFrame)

check duplicated entries and throws an error if one is there. If not everything is ok.

Arguments

  • mesh::DataFrame: The input mesh data represented as a DataFrame.
source
PeriLab.IO.check_mesh_elementsMethod
check_mesh_elements(mesh, dof)

Process and analyze mesh data to create an dictionary containing information about mesh elements for further processing.

Arguments

  • mesh::DataFrame: The input mesh data represented as a DataFrame.
  • dof::Int64: The degrees of freedom (DOF) for the mesh elements.

Returns

A dictionary containing information about mesh elements, which can be used for further processing or uploading.

Example

```julia meshdata = DataFrame(x1 = [1.0, 2.0, 3.0], x2 = [4.0, 5.0, 6.0], volume = [10.0, 20.0, 30.0]) dof = 3 result = checkmeshelements(meshdata, dof)

source
PeriLab.IO.check_types_in_dataframeMethod
check_types_in_dataframe(mesh::DataFrame)

check if block_id in mesh contains only int.

Arguments

  • mesh::DataFrame: The input mesh data represented as a DataFrame.
source
PeriLab.IO.clearNP1Method
clearNP1(name::String)

Clears the NP1 from the name

Arguments

  • name::String: The name

Returns

  • name::String: The cleared name
source
PeriLab.IO.close_result_filesMethod
close_result_files(result_files::Vector{Dict}, outputs::Dict{Int64,Dict{}})

Closes the result files if the flush_file flag is not set

Arguments

  • result_files::Vector{Dict}: The result files
  • outputs::Dict{Int64,Dict{}}: The output settings
source
PeriLab.IO.close_result_filesMethod
close_result_files(result_files::Vector{Dict})

Closes the result files

Arguments

  • result_files::Vector{Dict}: The result files

Returns

  • true: File is closed
  • false: File was already closed
source
PeriLab.IO.create_and_distribute_bond_normMethod
create_and_distribute_bond_norm(comm::MPI.Comm, datamanager::Module, nlist_filtered_ids::Vector{Vector{Int64}}, distribution::Vector{Int64}, bond_norm::Vector{Float64}, dof::Int64)

Create and distribute the bond norm

Arguments

  • comm::MPI.Comm: MPI communicator
  • datamanager::Module: Data manager
  • nlist_filtered_ids::Vector{Vector{Int64}}: The filtered neighborhood list
  • distribution::Vector{Int64}: The distribution
  • bond_norm::Vector{Float64}: The bond norm
  • dof::Int64: The degree of freedom
source
PeriLab.IO.create_distributionMethod
create_distribution(nnodes::Int64, size::Int64)

Calculate the initial size of each chunk for a nearly equal number of nodes vs. cores this algorithm might lead to the problem, that the last core is not equally loaded

Arguments

  • nnodes::Int64: The number of nodes.
  • size::Int64: The number of cores.

Returns

  • distribution::Array{Int64,1}: The distribution of the nodes.
  • point_to_core::Array{Int64,1}: The number of nodes in each rank.
source
PeriLab.IO.create_distribution_neighbor_basedMethod
create_distribution_neighbor_based(nnodes::Int64,nlist::Vector{Vector{Int64}}, size::Int64)

Calculate the initial size of each chunk for a nearly equal number of nodes vs. cores this algorithm might lead to the problem, that the last core is not equally loaded

Arguments

  • nnodes::Int64: The number of nodes.
  • nlist::Vector{Vector{Int64}}: The neighborhood list.
  • size::Int64: The number of cores.

Returns

  • distribution::Array{Int64,1}: The distribution of the nodes.
  • point_to_core::Array{Int64,1}: The number of nodes in each rank.
source
PeriLab.IO.create_distribution_node_basedMethod
create_distribution_node_based(nnodes::Int64,nlist::Vector{Vector{Int64}}, size::Int64)

Calculate the initial size of each chunk for a nearly equal number of nodes vs. cores this algorithm might lead to the problem, that the last core is not equally loaded

Arguments

  • nnodes::Int64: The number of nodes.
  • nlist::Vector{Vector{Int64}}: The neighborhood list.
  • size::Int64: The number of cores.

Returns

  • distribution::Array{Int64,1}: The distribution of the nodes.
  • point_to_core::Array{Int64,1}: The number of nodes in each rank.
source
PeriLab.IO.create_neighborhoodlistMethod
create_neighborhoodlist(mesh::DataFrame, params::Dict, dof::Int64)

Create the neighborhood list of the mesh elements.

Arguments

  • mesh::DataFrame: The input mesh data represented as a DataFrame.
  • params::Dict: The input parameters.
  • dof::Int64: The degrees of freedom (DOF) for the mesh elements.

Returns

  • nlist::Array{Array{Int64,1},1}: The neighborhood list of the mesh elements.
source
PeriLab.IO.create_overlap_mapMethod
create_overlap_map(distribution, ptc, size)

Create the overlap map.

Arguments

  • distribution::Array{Int64,1}: The distribution of the nodes.
  • ptc::Array{Int64,1}: The number of nodes in each rank.
  • size::Int64: The number of ranks.

Returns

  • overlap_map::Dict{Int64,Dict{Int64,Dict{String,Vector{Int64}}}}: The overlap map.
source
PeriLab.IO.create_result_fileFunction
create_result_file(filename::Union{AbstractString,String}, num_nodes::Int64, num_dim::Int64, num_elem_blks::Int64, num_node_sets::Int64)

Creates a exodus file for the results

Arguments

  • filename::Union{AbstractString,String}: The name of the file to create
  • num_nodes::Int64: The number of nodes
  • num_dim::Int64: The number of dimensions
  • num_elem_blks::Int64: The number of element blocks
  • num_node_sets::Int64: The number of node sets

Returns

  • result_file::Dict{String,Any}: A dictionary containing the filename and the exodus file
source
PeriLab.IO.create_result_fileMethod
create_result_file(filename::String, outputs::Dict)

Creates a csv file for the results

Arguments

  • filename::String: The name of the file to create
  • outputs::Dict: The outputs dictionary

Returns

  • Dict: The result file
source
PeriLab.IO.csv_readerMethod
csv_reader(filename::String)

Read csv and return it as a DataFrame.

Arguments

  • filename::String: The path to the mesh file.

Returns

  • csvData::DataFrame: The csv data a DataFrame.
source
PeriLab.IO.define_nsetsMethod
define_nsets(nsets::Dict{String,Vector{Int64}}, datamanager::Module)

Defines the node sets

Arguments

  • nsets::Dict{String,Vector{Int64}}: Node sets read from files
  • datamanager::Module: Data manager
source
PeriLab.IO.disk_filterMethod
disk_filter(nnodes::Int64, data::Matrix{Float64}, filter::Dict, nlist::Vector{Vector{Int64}}, dof::Int64)

Apply the disk filter to the neighborhood list.

Arguments

  • nnodes::Int64: The number of nodes.
  • data::Matrix{Float64}: The data.
  • filter::Dict: The filter.
  • nlist::Vector{Vector{Int64}}: The neighborhood list.
  • dof::Int64: The degrees of freedom.

Returns

  • filter_flag::Vector{Bool}: The filter flag.
  • normal::Vector{Float64}: The normal vector of the disk.
source
PeriLab.IO.distribute_neighborhoodlist_to_coresMethod
distribute_neighborhoodlist_to_cores(comm::MPI.Comm, datamanager::Module, nlist, distribution)

Distributes the neighborhood list to the cores.

Arguments

  • comm::MPI.Comm: MPI communicator
  • datamanager::Module: Data manager
  • nlist: neighborhood list
  • distribution Array{Int64}: global nodes distribution at cores

Returns

  • datamanager::Module: data manager
source
PeriLab.IO.distribution_to_coresMethod
distribution_to_cores(comm::MPI.Comm, datamanager::Module, mesh, distribution, dof::Int64)

Distributes the mesh data to the cores

Arguments

  • comm::MPI.Comm: MPI communicator
  • datamanager::Module: Data manager
  • mesh: Mesh
  • distribution Array{Int64}: global nodes distribution at cores
  • dof::Int64: Degree of freedom

Returns

  • datamanager::Module: data manager
source
PeriLab.IO.element_distributionMethod
element_distribution(topology::Vector{Vector{Int64}}, ptc::Vector{Int64}, size::Int64)

Create the distribution of the finite elements. Is needed to avoid multiple element calls. Each element should run only one time at the cores.

Arguments

  • topology::Vector{Vector{Int64}}: The topology list of the mesh elements.
  • nlist::Vector{Vector{Int64}}: The neighborhood list of the mesh elements.
  • size::Int64: The number of ranks.

Returns

  • distribution::Vector{Vector{Int64}}: The distribution of the nodes.
  • etc::Vector{Int64}: The number of nodes in each rank.
source
PeriLab.IO.extrude_surface_meshMethod
extrude_surface_mesh(mesh::DataFrame)

extrude the mesh at the surface of the block

Arguments

  • mesh::DataFrame: The input mesh data represented as a DataFrame.
  • params::Dict: The input parameters.
source
PeriLab.IO.find_and_set_core_value_avgMethod
find_and_set_core_value_avg(comm::MPI.Comm, value::Union{Float64,Int64})

Find and set core value avg

Arguments

  • comm::MPI.Comm: The MPI communicator
  • value::Union{Float64,Int64}: The value

Returns

  • recv_msg::Union{Int64,Vector{Float64},Vector{Int64},Vector{Bool}}: The received message
source
PeriLab.IO.find_and_set_core_value_maxMethod
find_and_set_core_value_max(comm::MPI.Comm, value::Union{Float64,Int64})

Find and set core value max

Arguments

  • comm::MPI.Comm: The MPI communicator
  • value::Union{Float64,Int64}: The value

Returns

  • recv_msg::Union{Int64,Vector{Float64},Vector{Int64},Vector{Bool}}: The received message
source
PeriLab.IO.find_and_set_core_value_minMethod
find_and_set_core_value_min(comm::MPI.Comm, value::Union{Float64,Int64})

Find and set core value min

Arguments

  • comm::MPI.Comm: The MPI communicator
  • value::Union{Float64,Int64}: The value

Returns

  • recv_msg::Union{Int64,Vector{Float64},Vector{Int64},Vector{Bool}}: The received message
source
PeriLab.IO.find_and_set_core_value_sumMethod
find_and_set_core_value_sum(comm::MPI.Comm, value::Union{Float64,Int64})

Find and set core value sum

Arguments

  • comm::MPI.Comm: The MPI communicator
  • value::Union{Float64,Int64}: The value

Returns

  • recv_msg::Union{Int64,Vector{Float64},Vector{Int64},Vector{Bool}}: The received message
source
PeriLab.IO.find_global_core_value!Method
find_global_core_value!(global_value::Union{Int64,Float64}, calculation_type::String, nnodes::Int64, datamanager::Module)

Find global core value.

Arguments

  • global_value::Union{Int64,Float64}: The global value
  • calculation_type::String: The calculation type
  • nnodes::Int64: The number of nodes
  • datamanager::Module: The datamanager

Returns

  • global_value::Union{Int64,Float64}: The global value
source
PeriLab.IO.gather_valuesMethod
gather_values(comm::MPI.Comm, value::Any)

Gather values

Arguments

  • comm::MPI.Comm: The MPI communicator
  • value::Any: The value

Returns

  • recv_msg::Any: The received message
source
PeriLab.IO.get_block_nodesMethod
get_block_nodes(block_Id::Union{SubArray,Vector{Int64}}, block::Int64)

Returns the nodes of a block

Arguments

  • block_Id::Union{SubArray,Vector{Int64}}: The block Id
  • block::Int64: The block

Returns

  • nodes::Vector{Int64}: The nodes of the block
source
PeriLab.IO.get_bond_geometryMethod
get_bond_geometry(datamanager::Module)

Gets the bond geometry

Arguments

  • datamanager::Module: Data manager

Returns

  • datamanager::Module: data manager
source
PeriLab.IO.get_file_sizeMethod
get_file_size(result_files::Vector{Dict})

Gets the file size of the result files

Arguments

  • result_files: The result files

Returns

  • total_file_size: The total file size
source
PeriLab.IO.get_global_valuesMethod
get_global_values(output::Dict, datamanager::Module)

Get global values.

Arguments

  • output::Dict: The output
  • datamanager::Module: The datamanager

Returns

  • global_values::Vector: The global values
source
PeriLab.IO.get_local_element_topologyMethod
get_local_element_topology(datamanager::Module, topology::Vector{Vector{Int64}}, distribution::Vector{Int64})

Get the local element topology

Arguments

  • datamanager::Module: The datamanager
  • topology::Vector{Vector{Int64}}: The topology
  • distribution::Vector{Int64}: The distribution

Returns

  • datamanager::Module: The datamanager
source
PeriLab.IO.get_local_neighborsMethod
get_local_neighbors(mapping, nlist_core)

Gets the local neighborhood list from the global neighborhood list

Arguments

  • mapping: mapping function
  • nlist_core: global neighborhood list

Returns

  • nlist_core: local neighborhood list
source
PeriLab.IO.get_local_overlap_mapMethod
get_local_overlap_map()

Changes entries in the overlap map from the global numbering to the local computer core one.

Arguments

  • overlap_map::Dict{Int64, Dict{Int64, String}}: overlap map with global nodes.
  • distribution::Vector{Vector{Int64}}: global nodes distribution at cores, needed for the gobal to local mapping
  • ranks Array{Int64} : number of used computer cores

Returns

  • overlap_map::Dict{Int64, Dict{Int64, String}}: returns overlap map with local nodes.

Example:

get_local_overlap_map(overlap_map, distribution, ranks)  # returns local nodes
source
PeriLab.IO.get_mpi_rank_stringMethod
get_mpi_rank_string(rank::Int64, max_rank::Int64)

Get MPI rank string.

Arguments

  • value::Int64: The rank
  • max_rank::Int64: The max rank

Returns

  • result::String: The result
source
PeriLab.IO.get_number_of_neighbornodesMethod
get_number_of_neighbornodes(nlist::Vector{Vector{Int64}})

Get the number of neighbors for each node.

Arguments

  • nlist::Vector{Vector{Int64}}: The neighborhood list of the mesh elements.

Returns

  • length_nlist::Vector{Int64}: The number of neighbors for each node.
source
PeriLab.IO.get_paraview_coordinatesMethod
get_paraview_coordinates(dof::Int64, refDof::Int64)

Returns the paraview specific dof

Arguments

  • dof::Int64: The degrees of freedom
  • refDof::Int64: The reference degrees of freedom

Returns

  • paraview_specifics::String: The paraview specific dof
source
PeriLab.IO.get_results_mappingMethod
get_results_mapping(params::Dict, path::String, datamanager::Module)

Gets the results mapping

Arguments

  • params::Dict: The parameters
  • path::String: The path
  • datamanager::Module: The datamanager

Returns

  • output_mapping::Dict{Int64,Dict{}}: The results mapping
source
PeriLab.IO.glob_to_locMethod
glob_to_loc(distribution)

Get the global to local mapping

Arguments

  • distribution: The distribution

Returns

  • glob_to_loc: The global to local mapping
source
PeriLab.IO.global_value_avgMethod
global_value_avg(field::Union{Vector{Float64},Matrix{Float64}}, dof::Union{Int64,Vector{Int64}}, nodes::Union{SubArray,Vector{Int64}})

Calculate the global average of a field for given nodes.

Arguments

  • field::Union{Vector{Float64},Matrix{Float64}}: Field.
  • dof::Union{Int64,Vector{Int64}}: Degree of freedom
  • nodes::Union{SubArray,Vector{Int64}}: Nodes.

Returns

  • returnValue::Vector: Global value.
source
PeriLab.IO.global_value_maxMethod
global_value_max(field::Union{Vector{Float64},Matrix{Float64}}, dof::Union{Int64,Vector{Int64}}, nodes::Union{SubArray,Vector{Int64}})

Calculate the global maximum of a field for given nodes.

Arguments

  • field::Union{Vector{Float64},Matrix{Float64}}: Field.
  • dof::Union{Int64,Vector{Int64}}: Degree of freedom
  • nodes::Union{SubArray,Vector{Int64}}: Nodes.

Returns

  • returnValue::Vector: Global value.
source
PeriLab.IO.global_value_minMethod
global_value_min(field::Union{Vector{Float64},Matrix{Float64}}, dof::Union{Int64,Vector{Int64}}, nodes::Union{SubArray,Vector{Int64}})

Calculate the global minimum of a field for given nodes.

Arguments

  • field::Union{Vector{Float64},Matrix{Float64}}: Field.
  • dof::Union{Int64,Vector{Int64}}: Degree of freedom
  • nodes::Union{SubArray,Vector{Int64}}: Nodes.

Returns

  • returnValue::Vector: Global value.
source
PeriLab.IO.global_value_sumMethod
global_value_sum(field::Union{Vector{Float64},Matrix{Float64}}, dof::Union{Int64,Vector{Int64}}, nodes::Union{SubArray,Vector{Int64}})

Calculate the global sum of a field for given nodes.

Arguments

  • field::Union{Vector{Float64},Matrix{Float64}}: Field.
  • dof::Union{Int64,Vector{Int64}: Degree of freedom
  • nodes::Union{SubArray,Vector{Int64}}: Nodes.

Returns

  • returnValue::Vector: Global value.
source
PeriLab.IO.hex8_volumeMethod

hex8volume(hexvertices)

Calculate the volume of a hex.

Arguments

  • hex_vertices: The vertices of the wedge.

Returns

  • volume: The volume of the wedge.
source
PeriLab.IO.init_dataMethod
init_data(params::Dict, path::String, datamanager::Module, comm::MPI.Comm, to::TimerOutput)

Initializes the data for the mesh.

Arguments

  • params::Dict: The parameters for the simulation.
  • path::String: The path to the mesh file.
  • datamanager::Data_manager: The data manager.
  • comm::MPI.Comm: The MPI communicator.
  • to::TimerOutput: The timer output.

Returns

  • datamanager::Data_manager: The data manager.
  • params::Dict: The parameters for the simulation.
source
PeriLab.IO.init_results_in_exodusFunction
init_results_in_exodus(exo::ExodusDatabase, output::Dict{}, coords::Union{Matrix{Int64},Matrix{Float64}}, block_Id::Vector{Int64}, uniqueBlocks::Vector{Int64}, nsets::Dict{String,Vector{Int64}}, global_ids::Vector{Int64}, PERILAB_VERSION::String)

Initializes the results in exodus

Arguments

  • exo::ExodusDatabase: The exodus database
  • output::Dict{String,Any}: The output
  • coords::Union{Matrix{Int64},Matrix{Float64}}: The coordinates
  • block_Id::Vector{Int64}: The block Id
  • uniqueBlocks::Vector{Int64}: The unique blocks
  • nsets::Dict{String,Vector{Int64}}: The node sets
  • global_ids::Vector{Int64}: The global ids

Returns

  • result_file::Dict{String,Any}: The result file
source
PeriLab.IO.init_write_resultsMethod
init_write_results(params::Dict, output_dir::String, path::String, datamanager::Module, nsteps::Int64, PERILAB_VERSION::String)

Initialize write results.

Arguments

  • params::Dict: The parameters
  • output_dir::String: The output directory.
  • path::String: The path
  • datamanager::Module: The datamanager
  • nsteps::Int64: The number of steps

Returns

  • result_files::Array: The result files
  • outputs::Dict: The outputs
source
PeriLab.IO.initialize_dataMethod
initialize_data(filename::String, filedirectory::String, datamanager::Module, comm::MPI.Comm, to::TimerOutputs.TimerOutput)

Initialize data.

Arguments

  • filename::String: The name of the input file.
  • filedirectory::String: The directory of the input file.
  • datamanager::Module: The datamanager
  • comm::MPI.Comm: The MPI communicator
  • to::TimerOutputs.TimerOutput: The TimerOutput

Returns

  • data::Dict: The data
source
PeriLab.IO.load_and_evaluate_meshMethod
load_and_evaluate_mesh(params::Dict, path::String, ranksize::Int64, to::TimerOutput)

Load and evaluate the mesh data.

Arguments

  • params::Dict: The input parameters.
  • path::String: The path to the mesh file.
  • ranksize::Int64: The number of ranks.
  • to::TimerOutput: The timer output

Returns

  • distribution::Array{Int64,1}: The distribution of the mesh elements.
  • mesh::DataFrame: The mesh data as a DataFrame.
  • ntype::Dict: The type of the mesh elements.
  • overlap_map::Array{Array{Int64,1},1}: The overlap map of the mesh elements.
  • nlist::Array{Array{Int64,1},1}: The neighborhood list of the mesh elements.
  • dof::Int64: The degrees of freedom (DOF) for the mesh elements.
  • nsets::Dict: The node sets
  • topology::Int64::Array{Int64,nelement:nodes}`: The topology of elements.
  • el_distribution::Array{Int64,1}: The distribution of the finite elements.
source
PeriLab.IO.local_nodes_from_dictMethod
local_nodes_from_dict(glob_to_loc::Dict{Int,Int}, global_nodes::Vector{Int64})

Changes entries in the overlap map from the global numbering to the local computer core one.

Arguments

  • glob_to_loc::Dict{Int,Int}: global to local mapping
  • global_nodes::Vector{Int64}: global nodes

Returns

  • overlap_map::Dict{Int64, Dict{Int64, String}}: returns overlap map with local nodes.
source
PeriLab.IO.merge_exodus_fileMethod
merge_exodus_file(file_name::Union{AbstractString,String})

Merges the exodus file

Arguments

  • file_name::Union{AbstractString,String}: The name of the file to merge

Returns

  • exo::ExodusDatabase: The exodus file
source
PeriLab.IO.merge_exodus_filesMethod
merge_exodus_files(result_files::Vector{Any}, output_dir::String)

Merges exodus output files

Arguments

  • result_files::Vector{Any}: The result files
  • output_dir::String: The file directory
source
PeriLab.IO.neighborsMethod
neighbors(mesh, params::Dict, coor)

Compute the neighbor list for each node in a mesh based on their proximity using a BallTree data structure.

Arguments

  • mesh: A mesh data structure containing the coordinates and other information.
  • params: paramss needed for computing the neighbor list.
  • coor: A vector of coordinate names along which to compute the neighbor list.

Returns

An array of neighbor lists, where each element represents the neighbors of a node in the mesh.

source
PeriLab.IO.node_distributionFunction
node_distribution(nlist::Vector{Vector{Int64}}, size::Int64)

Create the distribution of the nodes.

Arguments

  • nlist::Vector{Vector{Int64}}: The neighborhood list of the mesh elements.
  • size::Int64: The number of ranks.
  • distribution_type::String: The distribution type.

Returns

  • distribution::Vector{Vector{Int64}}: The distribution of the nodes.
  • ptc::Vector{Int64}: Defines at which core / rank each node lies.
  • ntype::Dict: The type of the nodes.
source
PeriLab.IO.paraview_specificsMethod
paraview_specifics(dof::Int64)

Returns the paraview specific dof

Arguments

  • dof::Int64: The degrees of freedom

Returns

  • paraview_specifics::String: The paraview specific dof
source
PeriLab.IO.read_external_topologyMethod
read_external_topology(filename::String)

Read external topoloy data from a file and return it as a DataFrame.

Arguments

  • filename::String: The path to the mesh file.

Returns

  • external_topology::DataFrame: The external topology data as a DataFrame.
source
PeriLab.IO.read_inputMethod
read_input(filename::String)

Reads the input deck from a yaml file

Arguments

  • filename::String: The name of the yaml file

Returns

  • params::Dict{String,Any}: The parameters read from the yaml file
source
PeriLab.IO.read_input_fileMethod
read_input_file(filename::String)

Reads the input deck from a yaml file

Arguments

  • filename::String: The name of the yaml file

Returns

  • Dict{String,Any}: The validated parameters read from the yaml file.
source
PeriLab.IO.read_meshMethod
read_mesh(filename::String, params::Dict)

Read mesh data from a file and return it as a DataFrame.

Arguments

  • filename::String: The path to the mesh file.
  • params::Dict: The input parameters.

Returns

  • mesh::DataFrame: The mesh data as a DataFrame.
source
PeriLab.IO.rectangular_plane_filterMethod
rectangular_plane_filter(nnodes::Int64, data::Matrix{Float64}, filter::Dict, nlist::Vector{Vector{Int64}}, dof::Int64)

Apply the rectangular plane filter to the neighborhood list.

Arguments

  • nnodes::Int64: The number of nodes.
  • data::Matrix{Float64}: The data.
  • filter::Dict: The filter.
  • nlist::Vector{Vector{Int64}}: The neighborhood list.
  • dof::Int64: The degrees of freedom.

Returns

  • filter_flag::Vector{Bool}: The filter flag.
  • normal::Vector{Float64}: The normal vector of the disk.
source
PeriLab.IO.send_single_value_from_vectorMethod
send_single_value_from_vector(comm::MPI.Comm, controller::Int64, values::Union{Int64,Vector{Float64},Vector{Int64},Vector{Bool}}, type::Type)

Sends a single value from a vector to a controller

Arguments

  • comm::MPI.Comm: The MPI communicator
  • controller::Int64: The controller
  • values::Union{Int64,Vector{Float64},Vector{Int64},Vector{Bool}}: The values
  • type::Type: The type

Returns

  • recv_msg::Union{Int64,Vector{Float64},Vector{Int64},Vector{Bool}}: The received message
source
PeriLab.IO.send_valueMethod
send_value(comm::MPI.Comm, controller, send_msg)

Sends a value to a controller

Arguments

  • comm::MPI.Comm: The MPI communicator
  • controller::Int64: The controller
  • send_msg::Union{Int64,Vector{Float64},Vector{Int64},Vector{Bool}}: The send message

Returns

  • recv_msg::Union{Int64,Vector{Float64},Vector{Int64},Vector{Bool}}: The received message
source
PeriLab.IO.send_vector_from_root_to_core_iMethod
send_vector_from_root_to_core_i(comm::MPI.Comm, send_msg, recv_msg, distribution)

Sends a vector from the root to the core i

Arguments

  • comm::MPI.Comm: The MPI communicator
  • send_msg::Union{Int64,Vector{Float64},Vector{Int64},Vector{Bool}}: The send message
  • recv_msg::Union{Int64,Vector{Float64},Vector{Int64},Vector{Bool}}: The receive message
  • distribution::Vector{Int64}: The distribution

Returns

  • recv_msg::Union{Int64,Vector{Float64},Vector{Int64},Vector{Bool}}: The received message
source
PeriLab.IO.set_dofMethod
set_dof(mesh::DataFrame)

Set the degrees of freedom (DOF) for the mesh elements.

Arguments

  • mesh::DataFrame: The input mesh data represented as a DataFrame.

Returns

  • dof::Int64: The degrees of freedom (DOF) for the mesh elements.
source
PeriLab.IO.show_block_summaryMethod
show_block_summary(solver_options::Dict, params::Dict, log_file::String, silent::Bool, comm::MPI.Comm, datamanager::Module)

Show block summary.

Arguments

  • solver_options::Dict: The solver options
  • params::Dict: The params
  • log_file::String: The log file
  • silent::Bool: The silent flag
  • comm::MPI.Comm: The comm
  • datamanager::Module: The datamanager
source
PeriLab.IO.show_mpi_summaryMethod
show_mpi_summary(log_file::String, silent::Bool, comm::MPI.Comm, datamanager::Module)

Show MPI summary.

Arguments

  • log_file::String: The log file
  • silent::Bool: The silent flag
  • comm::MPI.Comm: The comm
  • datamanager::Module: The datamanager
source
PeriLab.IO.split_vectorMethod
split_vector(input, row_nums, dof)

Split a vector into a vector of matrices

Arguments

  • input::Vector: The input vector
  • row_nums::Vector: The row numbers
  • dof::Int: The degree of freedom

Returns

  • result::Vector: The result vector
source
PeriLab.IO.synch_controller_bonds_to_responderMethod
synch_controller_bonds_to_responder(comm::MPI.Comm, overlapnodes, array, dof)

Synch the controller bonds to the responder

Arguments

  • comm::MPI.Comm: The MPI communicator
  • overlapnodes::Dict: The overlap nodes
  • array::Array: The array
  • dof::Int: The degree of freedom

Returns

  • array::Array: The array
source
PeriLab.IO.synch_controller_bonds_to_responder_flattenedMethod
synch_controller_bonds_to_responder_flattened(comm::MPI.Comm, overlapnodes, array, dof)

Synch the controller bonds to the responder

Arguments

  • comm::MPI.Comm: The MPI communicator
  • overlapnodes::Dict: The overlap nodes
  • array::Array: The array
  • dof::Int: The degree of freedom

Returns

  • array::Array: The array
source
PeriLab.IO.synch_controller_to_responderMethod
synch_controller_to_responder(comm::MPI.Comm, overlapnodes, vector, dof)

Synch the controller to the responder

Arguments

  • comm::MPI.Comm: The MPI communicator
  • overlapnodes::Dict: The overlap nodes
  • vector::Vector: The vector
  • dof::Int: The degree of freedom

Returns

  • vector::Vector: The vector
source
PeriLab.IO.synch_responder_to_controllerMethod
synch_responder_to_controller(comm::MPI.Comm, overlapnodes, vector, dof)

Synch the responder to the controller

Arguments

  • comm::MPI.Comm: The MPI communicator
  • overlapnodes::Dict: The overlap nodes
  • vector::Vector: The vector
  • dof::Int: The degree of freedom

Returns

  • vector::Vector: The vector
source
PeriLab.IO.tetrahedron_volumeMethod
tetrahedron_volume(tet_vertices)

Calculate the volume of a tetrahedron.

Arguments

  • tet_vertices: The vertices of the tetrahedron.

Returns

  • volume: The volume of the tetrahedron.
source
PeriLab.IO.wedge6_volumeMethod
wedge6_volume(wedge_vertices)

Calculate the volume of a wedge.

Arguments

  • wedge_vertices: The vertices of the wedge.

Returns

  • volume: The volume of the wedge.
source
PeriLab.IO.write_global_results_in_csvMethod
write_global_results_in_csv(csv_file::IOStream, time::Float64, global_values)

Writes the global results to the csv file

Arguments

  • csv_file::IOStream: The csv file
  • global_values: The global values
source
PeriLab.IO.write_global_results_in_exodusMethod
write_global_results_in_exodus(exo::ExodusDatabase, step::Int64, global_values)

Writes the global results in the exodus file

Arguments

  • exo::ExodusDatabase: The exodus file
  • step::Int64: The step
  • global_values: The global values

Returns

  • exo::ExodusDatabase: The exodus file
source
PeriLab.IO.write_nodal_results_in_exodusMethod
write_nodal_results_in_exodus(exo::ExodusDatabase, step::Int64, output::Dict, datamanager::Module)

Writes the nodal results in the exodus file

Arguments

  • exo::ExodusDatabase: The exodus file
  • step::Int64: The step
  • output::Dict: The output
  • datamanager::Module: The datamanager

Returns

  • exo::ExodusDatabase: The exodus file
source
PeriLab.IO.write_resultsMethod
write_results(result_files::Vector{Any}, time::Float64, max_damage::Float64, outputs::Dict, datamanager::Module)

Write results.

Arguments

  • result_files::Vector{Any}: The result files
  • time::Float64: The time
  • max_damage::Float64: The maximum damage
  • outputs::Dict: The outputs
  • datamanager::Module: The datamanager

Returns

  • result_files::Vector{Any}: The result files
source
PeriLab.IO.write_step_and_timeMethod
write_step_and_time(exo::ExodusDatabase, step::Int64, time::Float64)

Writes the step and time in the exodus file

Arguments

  • exo::ExodusDatabase: The exodus file
  • step::Int64: The step
  • time::Float64: The time

Returns

  • exo::ExodusDatabase: The exodus file
source

Geometry

PeriLab.IO.Geometry.compute_deformation_gradients!Method
compute_deformation_gradients!(nodes::Union{SubArray, Vector{Int64}}, nlist, volume, omega, bond_damage, undeformed_bond, deformed_bond, inverse_shape_tensor, deformation_gradient)

Calculate the deformation gradient tensor for a set of nodes in a computational mechanics context.

Arguments

  • nodes::Union{SubArray, Vector{Int64}}: A vector of integers representing node IDs.
  • dof::Int64: An integer representing the degrees of freedom.
  • nlist: A data structure (e.g., a list or array) representing neighboring node IDs for each node.
  • volume: A vector or array containing volume information for each node.
  • omega: A vector or array containing omega information for each node.
  • bond_damage: A data structure representing bond damage for each node.
  • undeformed_bond: A data structure representing bond geometries for each node.
  • deformed_bond: A data structure representing deformed bond properties for each node.
  • inverse_shape_tensor: A data structure representing the inverse shape tensors for each node.
  • deformation_gradient: A preallocated 3D array to store the deformation gradient tensors for each node.

Output

  • deformation_gradient: An updated deformation_gradient array with calculated deformation gradient tensors.

Description

This function calculates the deformation gradient tensor for a set of nodes in a computational mechanics context. The deformation gradient tensor characterizes the deformation of a material.

For each node in nodes, the function iterates through degrees of freedom (dof) and computes elements of the deformation gradient tensor based on bond damage, deformed bond properties, bond geometries, volume, and omega information. The calculated deformation gradient tensor is stored in deformation_gradient.

Example

```julia nodes = [1, 2, 3] dof = 3 nlist = [[2, 3], [1, 3], [1, 2]] volume = [0.1, 0.2, 0.3] omega = [0.5, 0.4, 0.6] bonddamage = zeros(Float64, length(nodes), length(nlist[1])) undeformedbond = rand(Float64, length(nodes), length(nlist[1]), dof) deformedbond = rand(Float64, length(nodes), length(nlist[1]), dof) inverseshapetensor = rand(Float64, length(nodes), dof, dof) deformationgradient = zeros(Float64, length(nodes), dof, dof)

source
PeriLab.IO.Geometry.compute_shape_tensors!Method
compute_shape_tensors!(nodes::Union{SubArray, Vector{Int64}}, nlist, volume, omega, bond_damage, undeformed_bond, shape_tensor, inverse_shape_tensor)

Calculate the shape tensor and its inverse for a set of nodes in a computational mechanics context.

Arguments

  • nodes::Union{SubArray, Vector{Int64}}: A vector of integers representing node IDs.
  • dof::Int64: An integer representing the degrees of freedom.
  • nlist: A data structure (e.g., a list or array) representing neighboring node IDs for each node.
  • volume: A vector or array containing volume information for each node.
  • omega: A vector or array containing omega information for each node.
  • bond_damage: A data structure representing bond damage for each node.
  • undeformed_bond: A data structure representing bond geometries for each node.
  • shape_tensor: A preallocated 3D array to store the shape tensors for each node.
  • inverse_shape_tensor: A preallocated 3D array to store the inverse shape tensors for each node.

Output

  • shape_tensor: An updated shape_tensor array with calculated shape tensors.
  • inverse_shape_tensor: An updated inverse_shape_tensor array with calculated inverse shape tensors.

Description

This function calculates the shape tensor and its inverse for a set of nodes in a computational mechanics context. The shape tensor is a key quantity used in continuum mechanics to describe material deformation. It is calculated based on bond damage, bond geometries, volume, and omega information for each node.

For each node in nodes, the function iterates through degrees of freedom (dof) and computes elements of the shape tensor. The inverse of the shape tensor is also calculated and stored in inverse_shape_tensor.

Example

```julia nodes = [1, 2, 3] dof = 3 nlist = [[2, 3], [1, 3], [1, 2]] volume = [0.1, 0.2, 0.3] omega = [0.5, 0.4, 0.6] bonddamage = zeros(Float64, length(nodes), length(nlist[1])) undeformedbond = rand(Float64, length(nodes), length(nlist[1]), dof) shapetensor = zeros(Float64, length(nodes), dof, dof) inverseshape_tensor = zeros(Float64, length(nodes), dof, dof)

source
PeriLab.IO.Geometry.compute_strainMethod
function compute_strain(nodes::Union{Base.OneTo{Int64},Vector{Int64}, SubArray}, deformation_gradient, strain)

Calculate strains for specified nodes based on deformation gradients.

Arguments

  • nodes::Union{SubArray, Vector{Int64}}: List of nodes
  • deformation_gradient: Deformation gradient at current time step (2D or 3D array).

Returns

  • Updated strain array containing strains.

This function iterates over the specified nodes and computes strain at each node using the given deformation gradients.

source
PeriLab.IO.Geometry.rotation_tensorMethod
function rotation_tensor(angles::Vector{Float64})

Creates the rotation tensor for 2D or 3D applications. Uses Rotations.jl package.

Arguments

  • angles::Vector{Float64}: Vector of angles definede in degrees of length one or three

Returns

  • Rotation tensor
source

parameter_handling

PeriLab.IO.Parameter_Handling.get_block_modelsMethod
get_block_models(params::Dict, block_id::Int64)

Get the models of a block.

Arguments

  • params::Dict: The parameters
  • block_id::Int64: The ID of the block

Returns

  • modelDict::Dict{String,String}: The models of the block
source
PeriLab.IO.Parameter_Handling.get_bond_filtersMethod
get_bond_filters(params::Dict)

Returns the bond filters from the parameters

Arguments

  • params::Dict: The parameters

Returns

  • check::Bool: Whether the bond filters are defined
  • bfList::Dict{String,Dict{String,Any}}: The bond filters
source
PeriLab.IO.Parameter_Handling.get_computesMethod
get_computes(params::Dict, variables::Vector{String})

Get the computes.

Arguments

  • params::Dict: The parameters dictionary.
  • variables::Vector{String}: The variables.

Returns

  • computes::Dict{String,Dict{Any,Any}}: The computes.
source
PeriLab.IO.Parameter_Handling.get_densityMethod
get_density(params::Dict, block_id::Int64)

Get the density of a block.

Arguments

  • params::Dict: The parameters
  • block_id::Int64: The ID of the block

Returns

  • density::Float64: The density of the block
source
PeriLab.IO.Parameter_Handling.get_fem_blockMethod
get_fem_block(params::Dict, block_id::Int64)

Get the fem_block of a block.

Arguments

  • params::Dict: The parameters
  • block_id::Int64: The ID of the block

Returns

  • fem_block::Float64: The fem_block of the block
source
PeriLab.IO.Parameter_Handling.get_headerMethod
get_header(filename::Union{String,AbstractString})

Returns the header line and the header.

Arguments

  • filename::Union{String,AbstractString}: The filename of the file.

Returns

  • header_line::Int: The header line.
  • header::Vector{String}: The header.
source
PeriLab.IO.Parameter_Handling.get_heat_capacityMethod
get_heat_capacity(params::Dict, block_id::Int64)

Get the heat capacity of a block.

Arguments

  • params::Dict: The parameters
  • block_id::Int64: The ID of the block

Returns

  • heat_capacity::Float64: The heat capacity of the block
source
PeriLab.IO.Parameter_Handling.get_horizonMethod
get_horizon(params::Dict, block_id::Int64)

Get the horizon of a block.

Arguments

  • params::Dict: The parameters
  • block_id::Int64: The ID of the block

Returns

  • horizon::Float64: The horizon of the block
source
PeriLab.IO.Parameter_Handling.get_model_parameterMethod
get_model_parameter(params, model, id)

Retrieve a model parameter from a dictionary of parameters.

This function retrieves a specific model parameter from a dictionary of parameters based on the provided model and identifier (id).

Arguments

  • params::Dict: A dictionary containing various parameters.

  • model::String: The model type for which the parameter is sought.

  • id::String: The identifier (name) of the specific model parameter.

Returns

  • parameter::Any: The retrieved model parameter, or nothing if the parameter is not found.

Errors

  • If the specified model is defined in blocks but no model definition block exists, an error message is logged, and the function returns nothing.

  • If the model with the given identifier is defined in blocks but missing in the model's definition, an error message is logged, and the function returns nothing.

Example

```julia params = Dict( "Models" => Dict( "Models" => Dict( "ModelA" => 42, "ModelB" => 24 ) ) )

model = "Models" id = "ModelA"

result = getmodelparameter(params, model, id) if result !== nothing println("Parameter id: result") else println("Parameter not found.") end

source
PeriLab.IO.Parameter_Handling.get_node_setsMethod
get_node_sets(params::Dict, path::String)

Returns the node sets from the parameters

Arguments

  • params::Dict: The parameters
  • path::String: The path to the mesh file

Returns

  • nsets::Dict{String,Any}: The node sets
source
PeriLab.IO.Parameter_Handling.get_output_fieldnamesMethod
get_output_fieldnames(outputs::Dict, variables::Vector{String}, computes::Vector{String}, output_type::String)

Gets the output fieldnames.

Arguments

  • outputs::Dict: The outputs
  • variables::Vector{String}: The variables
  • computes::Vector{String}: The computes
  • output_type::String: The output type

Returns

  • output_fieldnames::Vector{String}: The output fieldnames
source
PeriLab.IO.Parameter_Handling.get_output_variablesMethod
get_output_variables(output::String, variables::Vector{String})

Get the output variable.

Arguments

  • output::String: The output variable.
  • variables::Vector{String}: The variables.

Returns

  • output::String: The output variable.
source
PeriLab.IO.Parameter_Handling.get_outputsMethod
get_outputs(params::Dict, variables::Vector{String}, compute_names::Vector{String})

Gets the outputs.

Arguments

  • params::Dict: The parameters
  • variables::Vector{String}: The variables
  • compute_names::Vector{String}: The compute names

Returns

  • outputs::Dict: The outputs
source
PeriLab.IO.Parameter_Handling.get_valuesFunction
get_values(params::Dict, block_id::Int64, valueName::String, defaultValue::Union{Float64,Bool,Nothing})

Get the value of a block.

Arguments

  • params::Dict: The parameters
  • block_id::Int64: The ID of the block
  • valueName::String: The name of the value
  • defaultValue::Union{Float64,Bool,Nothing: The default value

Returns

  • value::Float64: The value of the block
source
PeriLab.IO.Parameter_Handling.validate_structure_recursiveFunction
validate_structure_recursive(expected::Dict, actual::Dict, validate::Bool, checked_keys::Array, path::String="")

Validates the parameters against the expected structure

Arguments

  • expected::Dict: The expected structure
  • actual::Dict: The actual structure
  • validate::Bool: The validation results
  • checked_keys::Array: The keys that have been checked
  • path::String: The current path

Returns

  • validate::Bool: The validation result
  • checked_keys::Array: The keys that have been checked
source
+
diff --git a/dev/lib/links/index.html b/dev/lib/links/index.html index 27ff83bf..bb86cefc 100644 --- a/dev/lib/links/index.html +++ b/dev/lib/links/index.html @@ -4,4 +4,4 @@ startOnLoad: true, theme: "neutral" }); - + diff --git a/dev/lib/logging_functions/index.html b/dev/lib/logging_functions/index.html index e0ea8565..328b39cb 100644 --- a/dev/lib/logging_functions/index.html +++ b/dev/lib/logging_functions/index.html @@ -1,7 +1,7 @@ -Logging · PeriLab

Logging - Functions

Index

Logging_module

PeriLab.Logging_module.init_loggingMethod
init_logging(filename::String, debug::Bool, silent::Bool, rank::Int64, size::Int64)

Initialize the logging.

Arguments

  • filename::String: The filename.
  • debug::Bool: If debug is true.
  • silent::Bool: If silent is true.
  • rank::Int64: The rank.
  • size::Int64: The size.
source
PeriLab.Logging_module.progress_filterMethod
progress_filter(log_args)

Filter progress messages.

Arguments

  • log_args: The log arguments.

Returns

  • true: If the message is not a progress message.
  • false: If the message is a progress message.
source

Logging - Functions

Index

Logging_module

PeriLab.Logging_module.init_loggingMethod
init_logging(filename::String, debug::Bool, silent::Bool, rank::Int64, size::Int64)

Initialize the logging.

Arguments

  • filename::String: The filename.
  • debug::Bool: If debug is true.
  • silent::Bool: If silent is true.
  • rank::Int64: The rank.
  • size::Int64: The size.
source
PeriLab.Logging_module.progress_filterMethod
progress_filter(log_args)

Filter progress messages.

Arguments

  • log_args: The log arguments.

Returns

  • true: If the message is not a progress message.
  • false: If the message is a progress message.
source
+
diff --git a/dev/lib/model_factory_functions/index.html b/dev/lib/model_factory_functions/index.html index 87549415..9d3cb424 100644 --- a/dev/lib/model_factory_functions/index.html +++ b/dev/lib/model_factory_functions/index.html @@ -1,8 +1,8 @@ -Model Factory · PeriLab

Model Factory - Functions

Index

Models

PeriLab.Solver_control.Model_Factory.add_modelMethod
add_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: Datamanager
  • model_name::String: The block nodes

Returns

  • datamanager::Module: Datamanager
source
PeriLab.Solver_control.Model_Factory.compute_modelsMethod
compute_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 datamanager
  • 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
  • to::TimerOutput: The timer output

Returns

  • datamanager: The datamanager
source
PeriLab.Solver_control.Model_Factory.get_block_model_definitionMethod
get_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.
source
PeriLab.Solver_control.Model_Factory.init_modelsMethod
init_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.
source
PeriLab.Solver_control.Model_Factory.read_propertiesMethod
read_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.
source
PeriLab.Solver_control.Model_Factory.set_heat_capacityMethod
set_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 parameters
  • block_nodes::Dict: The block nodes
  • heat_capacity::Vector{Float64}: The heat capacity array

Returns

  • heat_capacity::SubArray: The heat capacity array
source

Additive

PeriLab.Solver_control.Model_Factory.Additive.compute_modelMethod
compute_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 datamanager
  • nodes::Union{SubArray,Vector{Int64}}: The nodes
  • model_param::Dict: The model parameters
  • block::Int64: The block
  • time::Float64: The current time
  • dt::Float64: The time step

Returns

  • datamanager::Module: The datamanager
source
PeriLab.Solver_control.Model_Factory.Additive.init_modelMethod
init_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)

source

Damage

PeriLab.Solver_control.Model_Factory.Damage.compute_modelMethod
compute_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 datamanager
  • nodes::Union{SubArray,Vector{Int64}}: The nodes
  • model_param::Dict: The model parameters
  • block::Int64: The block
  • time::Float64: The current time
  • dt::Float64: The time step

Returns

  • datamanager::Module: The datamanager
source
PeriLab.Solver_control.Model_Factory.Damage.damage_indexMethod
damage_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 data
  • nodes::Union{SubArray, Vector{Int64}}: corresponding nodes to this model
source
PeriLab.Solver_control.Model_Factory.Damage.init_modelMethod
init_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)

source

Material

PeriLab.Solver_control.Model_Factory.Material.compute_modelMethod
compute_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 datamanager
  • nodes::Union{SubArray,Vector{Int64}}: The nodes
  • model_param::Dict: The model parameters
  • block::Int64: The block
  • time::Float64: The current time
  • dt::Float64: The time step

Returns

  • datamanager::Module: The datamanager
source
PeriLab.Solver_control.Model_Factory.Material.init_modelMethod
init_model(datamanager::Module, nodes::Union{SubArray,Vector{Int64}, block::Int64)

Initializes the material model.

Arguments

  • datamanager::Data_manager: Datamanager
  • nodes::Union{SubArray,Vector{Int64}}: The nodes.
  • block::Int64: Block.

Returns

  • datamanager::Data_manager: Datamanager.
source

Thermal

PeriLab.Solver_control.Model_Factory.Thermal.compute_modelMethod
compute_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 datamanager
  • nodes::Union{SubArray,Vector{Int64}}: The nodes
  • model_param::Dict: The model parameters
  • block::Int64: The block
  • time::Float64: The current time
  • dt::Float64: The time step

Returns

  • datamanager::Module: The datamanager
source
PeriLab.Solver_control.Model_Factory.Thermal.init_modelMethod
init_model(datamanager::Module, nodes::Union{SubArray,Vector{Int64}, block::Int64)

Initializes the thermal model.

Arguments

  • datamanager::Data_manager: Datamanager
  • nodes::Union{SubArray,Vector{Int64}}: The nodes.
  • block::Int64: Block.

Returns

  • datamanager::Data_manager: Datamanager.
source

Pre_Calculation

PeriLab.Solver_control.Model_Factory.Pre_Calculation.check_dependenciesMethod
check_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.
source
PeriLab.Solver_control.Model_Factory.Pre_Calculation.compute_modelMethod
compute_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 datamanager
  • nodes::Union{SubArray,Vector{Int64}}: The nodes
  • model_param::Dict: The model parameters
  • block::Int64: The block
  • time::Float64: The current time
  • dt::Float64: The time step

Returns

  • datamanager::Module: The datamanager
source
PeriLab.Solver_control.Model_Factory.Pre_Calculation.init_modelMethod
init_model(datamanager::Module, nodes::Union{SubArray,Vector{Int64}, block::Int64)

Initializes the model.

Arguments

  • datamanager::Data_manager: Datamanager
  • nodes::Union{SubArray,Vector{Int64}}: The nodes.
  • block::Int64: Block.

Returns

  • datamanager::Data_manager: Datamanager.
source

Set_modules

PeriLab.Solver_control.Model_Factory.Material.Set_modules.create_module_specificsMethod
create_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)

source
PeriLab.Solver_control.Model_Factory.Material.Set_modules.find_jl_filesMethod
find_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

source
PeriLab.Solver_control.Model_Factory.Material.Set_modules.find_module_filesMethod
find_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

source
PeriLab.Solver_control.Model_Factory.Material.Set_modules.include_filesMethod
include_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")])

source

Model Factory - Functions

Index

Models

PeriLab.Solver_control.Model_Factory.add_modelMethod
add_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: Datamanager
  • model_name::String: The block nodes

Returns

  • datamanager::Module: Datamanager
source
PeriLab.Solver_control.Model_Factory.compute_modelsMethod
compute_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 datamanager
  • 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
  • to::TimerOutput: The timer output

Returns

  • datamanager: The datamanager
source
PeriLab.Solver_control.Model_Factory.get_block_model_definitionMethod
get_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.
source
PeriLab.Solver_control.Model_Factory.init_modelsMethod
init_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.
source
PeriLab.Solver_control.Model_Factory.read_propertiesMethod
read_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.
source
PeriLab.Solver_control.Model_Factory.set_heat_capacityMethod
set_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 parameters
  • block_nodes::Dict: The block nodes
  • heat_capacity::Vector{Float64}: The heat capacity array

Returns

  • heat_capacity::SubArray: The heat capacity array
source

Additive

PeriLab.Solver_control.Model_Factory.Additive.compute_modelMethod
compute_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 datamanager
  • nodes::Union{SubArray,Vector{Int64}}: The nodes
  • model_param::Dict: The model parameters
  • block::Int64: The block
  • time::Float64: The current time
  • dt::Float64: The time step

Returns

  • datamanager::Module: The datamanager
source
PeriLab.Solver_control.Model_Factory.Additive.init_modelMethod
init_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)

source

Damage

PeriLab.Solver_control.Model_Factory.Damage.compute_modelMethod
compute_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 datamanager
  • nodes::Union{SubArray,Vector{Int64}}: The nodes
  • model_param::Dict: The model parameters
  • block::Int64: The block
  • time::Float64: The current time
  • dt::Float64: The time step

Returns

  • datamanager::Module: The datamanager
source
PeriLab.Solver_control.Model_Factory.Damage.damage_indexMethod
damage_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 data
  • nodes::Union{SubArray, Vector{Int64}}: corresponding nodes to this model
source
PeriLab.Solver_control.Model_Factory.Damage.init_modelMethod
init_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)

source

Material

PeriLab.Solver_control.Model_Factory.Material.compute_modelMethod
compute_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 datamanager
  • nodes::Union{SubArray,Vector{Int64}}: The nodes
  • model_param::Dict: The model parameters
  • block::Int64: The block
  • time::Float64: The current time
  • dt::Float64: The time step

Returns

  • datamanager::Module: The datamanager
source
PeriLab.Solver_control.Model_Factory.Material.init_modelMethod
init_model(datamanager::Module, nodes::Union{SubArray,Vector{Int64}, block::Int64)

Initializes the material model.

Arguments

  • datamanager::Data_manager: Datamanager
  • nodes::Union{SubArray,Vector{Int64}}: The nodes.
  • block::Int64: Block.

Returns

  • datamanager::Data_manager: Datamanager.
source

Thermal

PeriLab.Solver_control.Model_Factory.Thermal.compute_modelMethod
compute_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 datamanager
  • nodes::Union{SubArray,Vector{Int64}}: The nodes
  • model_param::Dict: The model parameters
  • block::Int64: The block
  • time::Float64: The current time
  • dt::Float64: The time step

Returns

  • datamanager::Module: The datamanager
source
PeriLab.Solver_control.Model_Factory.Thermal.init_modelMethod
init_model(datamanager::Module, nodes::Union{SubArray,Vector{Int64}, block::Int64)

Initializes the thermal model.

Arguments

  • datamanager::Data_manager: Datamanager
  • nodes::Union{SubArray,Vector{Int64}}: The nodes.
  • block::Int64: Block.

Returns

  • datamanager::Data_manager: Datamanager.
source

Pre_Calculation

PeriLab.Solver_control.Model_Factory.Pre_Calculation.check_dependenciesMethod
check_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.
source
PeriLab.Solver_control.Model_Factory.Pre_Calculation.compute_modelMethod
compute_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 datamanager
  • nodes::Union{SubArray,Vector{Int64}}: The nodes
  • model_param::Dict: The model parameters
  • block::Int64: The block
  • time::Float64: The current time
  • dt::Float64: The time step

Returns

  • datamanager::Module: The datamanager
source
PeriLab.Solver_control.Model_Factory.Pre_Calculation.init_modelMethod
init_model(datamanager::Module, nodes::Union{SubArray,Vector{Int64}, block::Int64)

Initializes the model.

Arguments

  • datamanager::Data_manager: Datamanager
  • nodes::Union{SubArray,Vector{Int64}}: The nodes.
  • block::Int64: Block.

Returns

  • datamanager::Data_manager: Datamanager.
source

Set_modules

PeriLab.Solver_control.Model_Factory.Material.Set_modules.create_module_specificsMethod
create_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)

source
PeriLab.Solver_control.Model_Factory.Material.Set_modules.find_jl_filesMethod
find_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

source
PeriLab.Solver_control.Model_Factory.Material.Set_modules.find_module_filesMethod
find_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

source
PeriLab.Solver_control.Model_Factory.Material.Set_modules.include_filesMethod
include_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")])

source
+
diff --git a/dev/lib/mpi_functions/index.html b/dev/lib/mpi_functions/index.html index 7e202bdf..8befcc5a 100644 --- a/dev/lib/mpi_functions/index.html +++ b/dev/lib/mpi_functions/index.html @@ -1,7 +1,7 @@ -MPI · PeriLab

MPI - Functions

Index

MPI

PeriLab.IO.send_single_value_from_vectorFunction
send_single_value_from_vector(comm::MPI.Comm, controller::Int64, values::Union{Int64,Vector{Float64},Vector{Int64},Vector{Bool}}, type::Type)

Sends a single value from a vector to a controller

Arguments

  • comm::MPI.Comm: The MPI communicator
  • controller::Int64: The controller
  • values::Union{Int64,Vector{Float64},Vector{Int64},Vector{Bool}}: The values
  • type::Type: The type

Returns

  • recv_msg::Union{Int64,Vector{Float64},Vector{Int64},Vector{Bool}}: The received message
source
PeriLab.IO.synch_responder_to_controllerFunction
synch_responder_to_controller(comm::MPI.Comm, overlapnodes, vector, dof)

Synch the responder to the controller

Arguments

  • comm::MPI.Comm: The MPI communicator
  • overlapnodes::Dict: The overlap nodes
  • vector::Vector: The vector
  • dof::Int: The degree of freedom

Returns

  • vector::Vector: The vector
source
PeriLab.IO.synch_controller_to_responderFunction
synch_controller_to_responder(comm::MPI.Comm, overlapnodes, vector, dof)

Synch the controller to the responder

Arguments

  • comm::MPI.Comm: The MPI communicator
  • overlapnodes::Dict: The overlap nodes
  • vector::Vector: The vector
  • dof::Int: The degree of freedom

Returns

  • vector::Vector: The vector
source
PeriLab.IO.synch_controller_bonds_to_responderFunction
synch_controller_bonds_to_responder(comm::MPI.Comm, overlapnodes, array, dof)

Synch the controller bonds to the responder

Arguments

  • comm::MPI.Comm: The MPI communicator
  • overlapnodes::Dict: The overlap nodes
  • array::Array: The array
  • dof::Int: The degree of freedom

Returns

  • array::Array: The array
source
PeriLab.IO.split_vectorFunction
split_vector(input, row_nums, dof)

Split a vector into a vector of matrices

Arguments

  • input::Vector: The input vector
  • row_nums::Vector: The row numbers
  • dof::Int: The degree of freedom

Returns

  • result::Vector: The result vector
source
PeriLab.IO.synch_controller_bonds_to_responder_flattenedFunction
synch_controller_bonds_to_responder_flattened(comm::MPI.Comm, overlapnodes, array, dof)

Synch the controller bonds to the responder

Arguments

  • comm::MPI.Comm: The MPI communicator
  • overlapnodes::Dict: The overlap nodes
  • array::Array: The array
  • dof::Int: The degree of freedom

Returns

  • array::Array: The array
source
PeriLab.IO.send_vector_from_root_to_core_iFunction
send_vector_from_root_to_core_i(comm::MPI.Comm, send_msg, recv_msg, distribution)

Sends a vector from the root to the core i

Arguments

  • comm::MPI.Comm: The MPI communicator
  • send_msg::Union{Int64,Vector{Float64},Vector{Int64},Vector{Bool}}: The send message
  • recv_msg::Union{Int64,Vector{Float64},Vector{Int64},Vector{Bool}}: The receive message
  • distribution::Vector{Int64}: The distribution

Returns

  • recv_msg::Union{Int64,Vector{Float64},Vector{Int64},Vector{Bool}}: The received message
source
PeriLab.IO.send_valueFunction
send_value(comm::MPI.Comm, controller, send_msg)

Sends a value to a controller

Arguments

  • comm::MPI.Comm: The MPI communicator
  • controller::Int64: The controller
  • send_msg::Union{Int64,Vector{Float64},Vector{Int64},Vector{Bool}}: The send message

Returns

  • recv_msg::Union{Int64,Vector{Float64},Vector{Int64},Vector{Bool}}: The received message
source
PeriLab.IO.find_and_set_core_value_minFunction
find_and_set_core_value_min(comm::MPI.Comm, value::Union{Float64,Int64})

Find and set core value min

Arguments

  • comm::MPI.Comm: The MPI communicator
  • value::Union{Float64,Int64}: The value

Returns

  • recv_msg::Union{Int64,Vector{Float64},Vector{Int64},Vector{Bool}}: The received message
source
PeriLab.IO.find_and_set_core_value_maxFunction
find_and_set_core_value_max(comm::MPI.Comm, value::Union{Float64,Int64})

Find and set core value max

Arguments

  • comm::MPI.Comm: The MPI communicator
  • value::Union{Float64,Int64}: The value

Returns

  • recv_msg::Union{Int64,Vector{Float64},Vector{Int64},Vector{Bool}}: The received message
source
PeriLab.IO.find_and_set_core_value_sumFunction
find_and_set_core_value_sum(comm::MPI.Comm, value::Union{Float64,Int64})

Find and set core value sum

Arguments

  • comm::MPI.Comm: The MPI communicator
  • value::Union{Float64,Int64}: The value

Returns

  • recv_msg::Union{Int64,Vector{Float64},Vector{Int64},Vector{Bool}}: The received message
source
PeriLab.IO.find_and_set_core_value_avgFunction
find_and_set_core_value_avg(comm::MPI.Comm, value::Union{Float64,Int64})

Find and set core value avg

Arguments

  • comm::MPI.Comm: The MPI communicator
  • value::Union{Float64,Int64}: The value

Returns

  • recv_msg::Union{Int64,Vector{Float64},Vector{Int64},Vector{Bool}}: The received message
source
PeriLab.IO.gather_valuesFunction
gather_values(comm::MPI.Comm, value::Any)

Gather values

Arguments

  • comm::MPI.Comm: The MPI communicator
  • value::Any: The value

Returns

  • recv_msg::Any: The received message
source

MPI - Functions

Index

MPI

PeriLab.IO.send_single_value_from_vectorFunction
send_single_value_from_vector(comm::MPI.Comm, controller::Int64, values::Union{Int64,Vector{Float64},Vector{Int64},Vector{Bool}}, type::Type)

Sends a single value from a vector to a controller

Arguments

  • comm::MPI.Comm: The MPI communicator
  • controller::Int64: The controller
  • values::Union{Int64,Vector{Float64},Vector{Int64},Vector{Bool}}: The values
  • type::Type: The type

Returns

  • recv_msg::Union{Int64,Vector{Float64},Vector{Int64},Vector{Bool}}: The received message
source
PeriLab.IO.synch_responder_to_controllerFunction
synch_responder_to_controller(comm::MPI.Comm, overlapnodes, vector, dof)

Synch the responder to the controller

Arguments

  • comm::MPI.Comm: The MPI communicator
  • overlapnodes::Dict: The overlap nodes
  • vector::Vector: The vector
  • dof::Int: The degree of freedom

Returns

  • vector::Vector: The vector
source
PeriLab.IO.synch_controller_to_responderFunction
synch_controller_to_responder(comm::MPI.Comm, overlapnodes, vector, dof)

Synch the controller to the responder

Arguments

  • comm::MPI.Comm: The MPI communicator
  • overlapnodes::Dict: The overlap nodes
  • vector::Vector: The vector
  • dof::Int: The degree of freedom

Returns

  • vector::Vector: The vector
source
PeriLab.IO.synch_controller_bonds_to_responderFunction
synch_controller_bonds_to_responder(comm::MPI.Comm, overlapnodes, array, dof)

Synch the controller bonds to the responder

Arguments

  • comm::MPI.Comm: The MPI communicator
  • overlapnodes::Dict: The overlap nodes
  • array::Array: The array
  • dof::Int: The degree of freedom

Returns

  • array::Array: The array
source
PeriLab.IO.split_vectorFunction
split_vector(input, row_nums, dof)

Split a vector into a vector of matrices

Arguments

  • input::Vector: The input vector
  • row_nums::Vector: The row numbers
  • dof::Int: The degree of freedom

Returns

  • result::Vector: The result vector
source
PeriLab.IO.synch_controller_bonds_to_responder_flattenedFunction
synch_controller_bonds_to_responder_flattened(comm::MPI.Comm, overlapnodes, array, dof)

Synch the controller bonds to the responder

Arguments

  • comm::MPI.Comm: The MPI communicator
  • overlapnodes::Dict: The overlap nodes
  • array::Array: The array
  • dof::Int: The degree of freedom

Returns

  • array::Array: The array
source
PeriLab.IO.send_vector_from_root_to_core_iFunction
send_vector_from_root_to_core_i(comm::MPI.Comm, send_msg, recv_msg, distribution)

Sends a vector from the root to the core i

Arguments

  • comm::MPI.Comm: The MPI communicator
  • send_msg::Union{Int64,Vector{Float64},Vector{Int64},Vector{Bool}}: The send message
  • recv_msg::Union{Int64,Vector{Float64},Vector{Int64},Vector{Bool}}: The receive message
  • distribution::Vector{Int64}: The distribution

Returns

  • recv_msg::Union{Int64,Vector{Float64},Vector{Int64},Vector{Bool}}: The received message
source
PeriLab.IO.send_valueFunction
send_value(comm::MPI.Comm, controller, send_msg)

Sends a value to a controller

Arguments

  • comm::MPI.Comm: The MPI communicator
  • controller::Int64: The controller
  • send_msg::Union{Int64,Vector{Float64},Vector{Int64},Vector{Bool}}: The send message

Returns

  • recv_msg::Union{Int64,Vector{Float64},Vector{Int64},Vector{Bool}}: The received message
source
PeriLab.IO.find_and_set_core_value_minFunction
find_and_set_core_value_min(comm::MPI.Comm, value::Union{Float64,Int64})

Find and set core value min

Arguments

  • comm::MPI.Comm: The MPI communicator
  • value::Union{Float64,Int64}: The value

Returns

  • recv_msg::Union{Int64,Vector{Float64},Vector{Int64},Vector{Bool}}: The received message
source
PeriLab.IO.find_and_set_core_value_maxFunction
find_and_set_core_value_max(comm::MPI.Comm, value::Union{Float64,Int64})

Find and set core value max

Arguments

  • comm::MPI.Comm: The MPI communicator
  • value::Union{Float64,Int64}: The value

Returns

  • recv_msg::Union{Int64,Vector{Float64},Vector{Int64},Vector{Bool}}: The received message
source
PeriLab.IO.find_and_set_core_value_sumFunction
find_and_set_core_value_sum(comm::MPI.Comm, value::Union{Float64,Int64})

Find and set core value sum

Arguments

  • comm::MPI.Comm: The MPI communicator
  • value::Union{Float64,Int64}: The value

Returns

  • recv_msg::Union{Int64,Vector{Float64},Vector{Int64},Vector{Bool}}: The received message
source
PeriLab.IO.find_and_set_core_value_avgFunction
find_and_set_core_value_avg(comm::MPI.Comm, value::Union{Float64,Int64})

Find and set core value avg

Arguments

  • comm::MPI.Comm: The MPI communicator
  • value::Union{Float64,Int64}: The value

Returns

  • recv_msg::Union{Int64,Vector{Float64},Vector{Int64},Vector{Bool}}: The received message
source
PeriLab.IO.gather_valuesFunction
gather_values(comm::MPI.Comm, value::Any)

Gather values

Arguments

  • comm::MPI.Comm: The MPI communicator
  • value::Any: The value

Returns

  • recv_msg::Any: The received message
source
+
diff --git a/dev/lib/references/index.html b/dev/lib/references/index.html index 91ded673..9224fbab 100644 --- a/dev/lib/references/index.html +++ b/dev/lib/references/index.html @@ -4,4 +4,4 @@ startOnLoad: true, theme: "neutral" }); - + diff --git a/dev/lib/solver_functions/index.html b/dev/lib/solver_functions/index.html index 96a81b3f..d99d087d 100644 --- a/dev/lib/solver_functions/index.html +++ b/dev/lib/solver_functions/index.html @@ -1,5 +1,5 @@ -Solver · PeriLab

Solver - Functions

Index

Solver

PeriLab.Solver_control.find_and_set_core_value_avgMethod
find_and_set_core_value_avg(comm::MPI.Comm, value::Union{Float64,Int64})

Find and set core value avg

Arguments

  • comm::MPI.Comm: The MPI communicator
  • value::Union{Float64,Int64}: The value

Returns

  • recv_msg::Union{Int64,Vector{Float64},Vector{Int64},Vector{Bool}}: The received message
source
PeriLab.Solver_control.find_and_set_core_value_maxMethod
find_and_set_core_value_max(comm::MPI.Comm, value::Union{Float64,Int64})

Find and set core value max

Arguments

  • comm::MPI.Comm: The MPI communicator
  • value::Union{Float64,Int64}: The value

Returns

  • recv_msg::Union{Int64,Vector{Float64},Vector{Int64},Vector{Bool}}: The received message
source
PeriLab.Solver_control.find_and_set_core_value_minMethod
find_and_set_core_value_min(comm::MPI.Comm, value::Union{Float64,Int64})

Find and set core value min

Arguments

  • comm::MPI.Comm: The MPI communicator
  • value::Union{Float64,Int64}: The value

Returns

  • recv_msg::Union{Int64,Vector{Float64},Vector{Int64},Vector{Bool}}: The received message
source
PeriLab.Solver_control.find_and_set_core_value_sumMethod
find_and_set_core_value_sum(comm::MPI.Comm, value::Union{Float64,Int64})

Find and set core value sum

Arguments

  • comm::MPI.Comm: The MPI communicator
  • value::Union{Float64,Int64}: The value

Returns

  • recv_msg::Union{Int64,Vector{Float64},Vector{Int64},Vector{Bool}}: The received message
source
PeriLab.Solver_control.gather_valuesMethod
gather_values(comm::MPI.Comm, value::Any)

Gather values

Arguments

  • comm::MPI.Comm: The MPI communicator
  • value::Any: The value

Returns

  • recv_msg::Any: The received message
source
PeriLab.Solver_control.get_block_nodesMethod
get_block_nodes(block_ids, nnodes)

Returns a dictionary mapping block IDs to collections of nodes.

Arguments

  • block_ids::Vector{Int64}: A vector of block IDs
  • nnodes::Int64: The number of nodes

Returns

  • block_nodes::Dict{Int64,Vector{Int64}}: A dictionary mapping block IDs to collections of nodes
source
PeriLab.Solver_control.initMethod
init(params::Dict, datamanager::Module)

Initialize the solver

Arguments

  • params::Dict: The parameters
  • datamanager::Module: Datamanager
  • to::TimerOutputs.TimerOutput: A timer output

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.
  • datamanager::Module: The data manager module that provides access to data fields and properties.
  • solver_options::Dict{String,Any}: A dictionary containing solver options.
source
PeriLab.Solver_control.remove_modelsMethod
remove_models(datamanager::Module, 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

  • datamanager::Module: The MPI communicator
  • solver_options::Vector{String}: A dictionary of fields

Returns

  • datamanager
source
PeriLab.Solver_control.send_single_value_from_vectorMethod
send_single_value_from_vector(comm::MPI.Comm, controller::Int64, values::Union{Int64,Vector{Float64},Vector{Int64},Vector{Bool}}, type::Type)

Sends a single value from a vector to a controller

Arguments

  • comm::MPI.Comm: The MPI communicator
  • controller::Int64: The controller
  • values::Union{Int64,Vector{Float64},Vector{Int64},Vector{Bool}}: The values
  • type::Type: The type

Returns

  • recv_msg::Union{Int64,Vector{Float64},Vector{Int64},Vector{Bool}}: The received message
source
PeriLab.Solver_control.send_valueMethod
send_value(comm::MPI.Comm, controller, send_msg)

Sends a value to a controller

Arguments

  • comm::MPI.Comm: The MPI communicator
  • controller::Int64: The controller
  • send_msg::Union{Int64,Vector{Float64},Vector{Int64},Vector{Bool}}: The send message

Returns

  • recv_msg::Union{Int64,Vector{Float64},Vector{Int64},Vector{Bool}}: The received message
source
PeriLab.Solver_control.send_vector_from_root_to_core_iMethod
send_vector_from_root_to_core_i(comm::MPI.Comm, send_msg, recv_msg, distribution)

Sends a vector from the root to the core i

Arguments

  • comm::MPI.Comm: The MPI communicator
  • send_msg::Union{Int64,Vector{Float64},Vector{Int64},Vector{Bool}}: The send message
  • recv_msg::Union{Int64,Vector{Float64},Vector{Int64},Vector{Bool}}: The receive message
  • distribution::Vector{Int64}: The distribution

Returns

  • recv_msg::Union{Int64,Vector{Float64},Vector{Int64},Vector{Bool}}: The received message
source
PeriLab.Solver_control.set_densityMethod
set_density(params::Dict, block_nodes::Dict, density::Vector{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::Vector{Float64}: The density

Returns

  • density::Vector{Float64}: The density
source
PeriLab.Solver_control.set_fem_blockMethod
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_control.set_horizonMethod
set_horizon(params::Dict, block_nodes::Dict, horizon::Vector{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::Vector{Float64}: The horizon

Returns

  • horizon::Vector{Float64}: The horizon
source
PeriLab.Solver_control.solverMethod
solver(solver_options::Dict{String,Any}, block_nodes::Dict{Int64,Vector{Int64}}, bcs::Dict{Any,Any}, datamanager::Module, outputs::Dict{Int64,Dict{}}, result_files::Vector{Any}, write_results, to, 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
  • datamanager::Module: The data manager module
  • 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
  • to::TimerOutputs.TimerOutput: A timer output
  • silent::Bool: A boolean flag to suppress progress bars

Returns

  • result_files: A vector of updated result files
source
PeriLab.Solver_control.split_vectorMethod
split_vector(input, row_nums, dof)

Split a vector into a vector of matrices

Arguments

  • input::Vector: The input vector
  • row_nums::Vector: The row numbers
  • dof::Int: The degree of freedom

Returns

  • result::Vector: The result vector
source
PeriLab.Solver_control.synch_controller_bonds_to_responderMethod
synch_controller_bonds_to_responder(comm::MPI.Comm, overlapnodes, array, dof)

Synch the controller bonds to the responder

Arguments

  • comm::MPI.Comm: The MPI communicator
  • overlapnodes::Dict: The overlap nodes
  • array::Array: The array
  • dof::Int: The degree of freedom

Returns

  • array::Array: The array
source
PeriLab.Solver_control.synch_controller_bonds_to_responder_flattenedMethod
synch_controller_bonds_to_responder_flattened(comm::MPI.Comm, overlapnodes, array, dof)

Synch the controller bonds to the responder

Arguments

  • comm::MPI.Comm: The MPI communicator
  • overlapnodes::Dict: The overlap nodes
  • array::Array: The array
  • dof::Int: The degree of freedom

Returns

  • array::Array: The array
source
PeriLab.Solver_control.synch_controller_to_responderMethod
synch_controller_to_responder(comm::MPI.Comm, overlapnodes, vector, dof)

Synch the controller to the responder

Arguments

  • comm::MPI.Comm: The MPI communicator
  • overlapnodes::Dict: The overlap nodes
  • vector::Vector: The vector
  • dof::Int: The degree of freedom

Returns

  • vector::Vector: The vector
source
PeriLab.Solver_control.synch_responder_to_controllerMethod
synch_responder_to_controller(comm::MPI.Comm, overlapnodes, vector, dof)

Synch the responder to the controller

Arguments

  • comm::MPI.Comm: The MPI communicator
  • overlapnodes::Dict: The overlap nodes
  • vector::Vector: The vector
  • dof::Int: The degree of freedom

Returns

  • vector::Vector: The vector
source
PeriLab.Solver_control.synchronise_fieldMethod
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

PeriLab.Solver_control.Verlet.calculate_strainMethod
calculate_strain(datamanager::Module, nodes::Union{SubArray,Vector{Int64}}, hooke_matrix::Matrix{Float64})

Calculate the von Mises stress.

Arguments

  • datamanager::Data_manager: Datamanager.
  • nodes::Union{SubArray,Vector{Int64}}: The nodes.
  • hooke_matrix::Matrix{Float64}: The hooke matrix.

Returns

  • datamanager::Data_manager: Datamanager.
source
PeriLab.Solver_control.Verlet.calculate_stressesMethod
calculate_stresses(datamanager::Module, block_nodes::Dict{Int64,Vector{Int64}}, options::Dict{String, Any})

Computes the stresses.

Arguments

  • datamanager::Data_manager: Datamanager.
  • block_nodes::Dict{Int64,Vector{Int64}}: List of block nodes.
  • options::Dict{String, Any}: List of options.

Returns

  • datamanager::Data_manager: Datamanager.
source
PeriLab.Solver_control.Verlet.calculate_von_mises_stressMethod
calculate_von_mises_stress(datamanager::Module, nodes::Union{SubArray,Vector{Int64}})

Calculate the von Mises stress.

Arguments

  • datamanager::Data_manager: Datamanager.
  • nodes::Union{SubArray,Vector{Int64}}: The nodes.

Returns

  • datamanager::Data_manager: Datamanager.
source
PeriLab.Solver_control.Verlet.compute_crititical_time_stepMethod
compute_crititical_time_step(datamanager::Module, 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

  • datamanager::Module: The data manager module that provides access to required data fields and properties.
  • 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_control.Verlet.compute_mechanical_critical_time_stepMethod
compute_mechanical_critical_time_step(nodes::Union{SubArray,Vector{Int64}}, datamanager::Module, bulk_modulus::Float64)

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

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::Union{SubArray, Vector{Int64}}: The collection of nodes to calculate the critical time step for.
  • datamanager::Module: The data manager module that provides access to required data fields.
  • 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 datamanager 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_control.Verlet.compute_thermodynamic_critical_time_stepMethod
compute_thermodynamic_critical_time_step(nodes::Union{SubArray,Vector{Int64}}, datamanager::Module, lambda::Float64, Cv::Float64)

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

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::Union{SubArray, Vector{Int64}}: The collection of nodes to calculate the critical time step for.
  • datamanager::Module: The data manager module that provides access to required data fields.
  • 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 datamanager 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_control.Verlet.find_and_set_core_value_avgMethod
find_and_set_core_value_avg(comm::MPI.Comm, value::Union{Float64,Int64})

Find and set core value avg

Arguments

  • comm::MPI.Comm: The MPI communicator
  • value::Union{Float64,Int64}: The value

Returns

  • recv_msg::Union{Int64,Vector{Float64},Vector{Int64},Vector{Bool}}: The received message
source
PeriLab.Solver_control.Verlet.find_and_set_core_value_maxMethod
find_and_set_core_value_max(comm::MPI.Comm, value::Union{Float64,Int64})

Find and set core value max

Arguments

  • comm::MPI.Comm: The MPI communicator
  • value::Union{Float64,Int64}: The value

Returns

  • recv_msg::Union{Int64,Vector{Float64},Vector{Int64},Vector{Bool}}: The received message
source
PeriLab.Solver_control.Verlet.find_and_set_core_value_minMethod
find_and_set_core_value_min(comm::MPI.Comm, value::Union{Float64,Int64})

Find and set core value min

Arguments

  • comm::MPI.Comm: The MPI communicator
  • value::Union{Float64,Int64}: The value

Returns

  • recv_msg::Union{Int64,Vector{Float64},Vector{Int64},Vector{Bool}}: The received message
source
PeriLab.Solver_control.Verlet.find_and_set_core_value_sumMethod
find_and_set_core_value_sum(comm::MPI.Comm, value::Union{Float64,Int64})

Find and set core value sum

Arguments

  • comm::MPI.Comm: The MPI communicator
  • value::Union{Float64,Int64}: The value

Returns

  • recv_msg::Union{Int64,Vector{Float64},Vector{Int64},Vector{Bool}}: The received message
source
PeriLab.Solver_control.Verlet.get_cs_denominatorMethod
get_cs_denominator(volume::Union{SubArray,Vector{Float64},Vector{Int64}}, undeformed_bond::Union{SubArray,Vector{Float64},Vector{Int64}})

Calculate the denominator for the critical time step calculation.

Arguments

  • volume::Union{SubArray,Vector{Float64},Vector{Int64}}: 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_control.Verlet.get_integration_stepsMethod
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_control.Verlet.get_partial_stressesMethod
get_partial_stresses(datamanager::Module, nodes::Vector{Int64})

Computes the partial stresses.

Arguments

  • datamanager::Data_manager: Datamanager.
  • nodes::Vector{Int64}: List of block nodes.

Returns

  • datamanager::Data_manager: Datamanager.
source
PeriLab.Solver_control.Verlet.init_solverMethod
init_solver(params::Dict, datamanager::Module, 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.
  • datamanager::Module: The data manager module that provides access to required data fields and properties.
  • 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_control.Verlet.run_solverMethod
run_solver(
+Solver · PeriLab

Solver - Functions

Index

Solver

PeriLab.Solver_control.find_and_set_core_value_avgMethod
find_and_set_core_value_avg(comm::MPI.Comm, value::Union{Float64,Int64})

Find and set core value avg

Arguments

  • comm::MPI.Comm: The MPI communicator
  • value::Union{Float64,Int64}: The value

Returns

  • recv_msg::Union{Int64,Vector{Float64},Vector{Int64},Vector{Bool}}: The received message
source
PeriLab.Solver_control.find_and_set_core_value_maxMethod
find_and_set_core_value_max(comm::MPI.Comm, value::Union{Float64,Int64})

Find and set core value max

Arguments

  • comm::MPI.Comm: The MPI communicator
  • value::Union{Float64,Int64}: The value

Returns

  • recv_msg::Union{Int64,Vector{Float64},Vector{Int64},Vector{Bool}}: The received message
source
PeriLab.Solver_control.find_and_set_core_value_minMethod
find_and_set_core_value_min(comm::MPI.Comm, value::Union{Float64,Int64})

Find and set core value min

Arguments

  • comm::MPI.Comm: The MPI communicator
  • value::Union{Float64,Int64}: The value

Returns

  • recv_msg::Union{Int64,Vector{Float64},Vector{Int64},Vector{Bool}}: The received message
source
PeriLab.Solver_control.find_and_set_core_value_sumMethod
find_and_set_core_value_sum(comm::MPI.Comm, value::Union{Float64,Int64})

Find and set core value sum

Arguments

  • comm::MPI.Comm: The MPI communicator
  • value::Union{Float64,Int64}: The value

Returns

  • recv_msg::Union{Int64,Vector{Float64},Vector{Int64},Vector{Bool}}: The received message
source
PeriLab.Solver_control.gather_valuesMethod
gather_values(comm::MPI.Comm, value::Any)

Gather values

Arguments

  • comm::MPI.Comm: The MPI communicator
  • value::Any: The value

Returns

  • recv_msg::Any: The received message
source
PeriLab.Solver_control.get_block_nodesMethod
get_block_nodes(block_ids, nnodes)

Returns a dictionary mapping block IDs to collections of nodes.

Arguments

  • block_ids::Vector{Int64}: A vector of block IDs
  • nnodes::Int64: The number of nodes

Returns

  • block_nodes::Dict{Int64,Vector{Int64}}: A dictionary mapping block IDs to collections of nodes
source
PeriLab.Solver_control.initMethod
init(params::Dict, datamanager::Module)

Initialize the solver

Arguments

  • params::Dict: The parameters
  • datamanager::Module: Datamanager
  • to::TimerOutputs.TimerOutput: A timer output

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.
  • datamanager::Module: The data manager module that provides access to data fields and properties.
  • solver_options::Dict{String,Any}: A dictionary containing solver options.
source
PeriLab.Solver_control.remove_modelsMethod
remove_models(datamanager::Module, 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

  • datamanager::Module: The MPI communicator
  • solver_options::Vector{String}: A dictionary of fields

Returns

  • datamanager
source
PeriLab.Solver_control.send_single_value_from_vectorMethod
send_single_value_from_vector(comm::MPI.Comm, controller::Int64, values::Union{Int64,Vector{Float64},Vector{Int64},Vector{Bool}}, type::Type)

Sends a single value from a vector to a controller

Arguments

  • comm::MPI.Comm: The MPI communicator
  • controller::Int64: The controller
  • values::Union{Int64,Vector{Float64},Vector{Int64},Vector{Bool}}: The values
  • type::Type: The type

Returns

  • recv_msg::Union{Int64,Vector{Float64},Vector{Int64},Vector{Bool}}: The received message
source
PeriLab.Solver_control.send_valueMethod
send_value(comm::MPI.Comm, controller, send_msg)

Sends a value to a controller

Arguments

  • comm::MPI.Comm: The MPI communicator
  • controller::Int64: The controller
  • send_msg::Union{Int64,Vector{Float64},Vector{Int64},Vector{Bool}}: The send message

Returns

  • recv_msg::Union{Int64,Vector{Float64},Vector{Int64},Vector{Bool}}: The received message
source
PeriLab.Solver_control.send_vector_from_root_to_core_iMethod
send_vector_from_root_to_core_i(comm::MPI.Comm, send_msg, recv_msg, distribution)

Sends a vector from the root to the core i

Arguments

  • comm::MPI.Comm: The MPI communicator
  • send_msg::Union{Int64,Vector{Float64},Vector{Int64},Vector{Bool}}: The send message
  • recv_msg::Union{Int64,Vector{Float64},Vector{Int64},Vector{Bool}}: The receive message
  • distribution::Vector{Int64}: The distribution

Returns

  • recv_msg::Union{Int64,Vector{Float64},Vector{Int64},Vector{Bool}}: The received message
source
PeriLab.Solver_control.set_densityMethod
set_density(params::Dict, block_nodes::Dict, density::Vector{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::Vector{Float64}: The density

Returns

  • density::Vector{Float64}: The density
source
PeriLab.Solver_control.set_fem_blockMethod
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_control.set_horizonMethod
set_horizon(params::Dict, block_nodes::Dict, horizon::Vector{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::Vector{Float64}: The horizon

Returns

  • horizon::Vector{Float64}: The horizon
source
PeriLab.Solver_control.solverMethod
solver(solver_options::Dict{String,Any}, block_nodes::Dict{Int64,Vector{Int64}}, bcs::Dict{Any,Any}, datamanager::Module, outputs::Dict{Int64,Dict{}}, result_files::Vector{Any}, write_results, to, 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
  • datamanager::Module: The data manager module
  • 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
  • to::TimerOutputs.TimerOutput: A timer output
  • silent::Bool: A boolean flag to suppress progress bars

Returns

  • result_files: A vector of updated result files
source
PeriLab.Solver_control.split_vectorMethod
split_vector(input, row_nums, dof)

Split a vector into a vector of matrices

Arguments

  • input::Vector: The input vector
  • row_nums::Vector: The row numbers
  • dof::Int: The degree of freedom

Returns

  • result::Vector: The result vector
source
PeriLab.Solver_control.synch_controller_bonds_to_responderMethod
synch_controller_bonds_to_responder(comm::MPI.Comm, overlapnodes, array, dof)

Synch the controller bonds to the responder

Arguments

  • comm::MPI.Comm: The MPI communicator
  • overlapnodes::Dict: The overlap nodes
  • array::Array: The array
  • dof::Int: The degree of freedom

Returns

  • array::Array: The array
source
PeriLab.Solver_control.synch_controller_bonds_to_responder_flattenedMethod
synch_controller_bonds_to_responder_flattened(comm::MPI.Comm, overlapnodes, array, dof)

Synch the controller bonds to the responder

Arguments

  • comm::MPI.Comm: The MPI communicator
  • overlapnodes::Dict: The overlap nodes
  • array::Array: The array
  • dof::Int: The degree of freedom

Returns

  • array::Array: The array
source
PeriLab.Solver_control.synch_controller_to_responderMethod
synch_controller_to_responder(comm::MPI.Comm, overlapnodes, vector, dof)

Synch the controller to the responder

Arguments

  • comm::MPI.Comm: The MPI communicator
  • overlapnodes::Dict: The overlap nodes
  • vector::Vector: The vector
  • dof::Int: The degree of freedom

Returns

  • vector::Vector: The vector
source
PeriLab.Solver_control.synch_responder_to_controllerMethod
synch_responder_to_controller(comm::MPI.Comm, overlapnodes, vector, dof)

Synch the responder to the controller

Arguments

  • comm::MPI.Comm: The MPI communicator
  • overlapnodes::Dict: The overlap nodes
  • vector::Vector: The vector
  • dof::Int: The degree of freedom

Returns

  • vector::Vector: The vector
source
PeriLab.Solver_control.synchronise_fieldMethod
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

PeriLab.Solver_control.Verlet.calculate_strainMethod
calculate_strain(datamanager::Module, nodes::Union{SubArray,Vector{Int64}}, hooke_matrix::Matrix{Float64})

Calculate the von Mises stress.

Arguments

  • datamanager::Data_manager: Datamanager.
  • nodes::Union{SubArray,Vector{Int64}}: The nodes.
  • hooke_matrix::Matrix{Float64}: The hooke matrix.

Returns

  • datamanager::Data_manager: Datamanager.
source
PeriLab.Solver_control.Verlet.calculate_stressesMethod
calculate_stresses(datamanager::Module, block_nodes::Dict{Int64,Vector{Int64}}, options::Dict{String, Any})

Computes the stresses.

Arguments

  • datamanager::Data_manager: Datamanager.
  • block_nodes::Dict{Int64,Vector{Int64}}: List of block nodes.
  • options::Dict{String, Any}: List of options.

Returns

  • datamanager::Data_manager: Datamanager.
source
PeriLab.Solver_control.Verlet.calculate_von_mises_stressMethod
calculate_von_mises_stress(datamanager::Module, nodes::Union{SubArray,Vector{Int64}})

Calculate the von Mises stress.

Arguments

  • datamanager::Data_manager: Datamanager.
  • nodes::Union{SubArray,Vector{Int64}}: The nodes.

Returns

  • datamanager::Data_manager: Datamanager.
source
PeriLab.Solver_control.Verlet.compute_crititical_time_stepMethod
compute_crititical_time_step(datamanager::Module, 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

  • datamanager::Module: The data manager module that provides access to required data fields and properties.
  • 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_control.Verlet.compute_mechanical_critical_time_stepMethod
compute_mechanical_critical_time_step(nodes::Union{SubArray,Vector{Int64}}, datamanager::Module, bulk_modulus::Float64)

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

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::Union{SubArray, Vector{Int64}}: The collection of nodes to calculate the critical time step for.
  • datamanager::Module: The data manager module that provides access to required data fields.
  • 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 datamanager 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_control.Verlet.compute_thermodynamic_critical_time_stepMethod
compute_thermodynamic_critical_time_step(nodes::Union{SubArray,Vector{Int64}}, datamanager::Module, lambda::Float64, Cv::Float64)

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

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::Union{SubArray, Vector{Int64}}: The collection of nodes to calculate the critical time step for.
  • datamanager::Module: The data manager module that provides access to required data fields.
  • 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 datamanager 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_control.Verlet.find_and_set_core_value_avgMethod
find_and_set_core_value_avg(comm::MPI.Comm, value::Union{Float64,Int64})

Find and set core value avg

Arguments

  • comm::MPI.Comm: The MPI communicator
  • value::Union{Float64,Int64}: The value

Returns

  • recv_msg::Union{Int64,Vector{Float64},Vector{Int64},Vector{Bool}}: The received message
source
PeriLab.Solver_control.Verlet.find_and_set_core_value_maxMethod
find_and_set_core_value_max(comm::MPI.Comm, value::Union{Float64,Int64})

Find and set core value max

Arguments

  • comm::MPI.Comm: The MPI communicator
  • value::Union{Float64,Int64}: The value

Returns

  • recv_msg::Union{Int64,Vector{Float64},Vector{Int64},Vector{Bool}}: The received message
source
PeriLab.Solver_control.Verlet.find_and_set_core_value_minMethod
find_and_set_core_value_min(comm::MPI.Comm, value::Union{Float64,Int64})

Find and set core value min

Arguments

  • comm::MPI.Comm: The MPI communicator
  • value::Union{Float64,Int64}: The value

Returns

  • recv_msg::Union{Int64,Vector{Float64},Vector{Int64},Vector{Bool}}: The received message
source
PeriLab.Solver_control.Verlet.find_and_set_core_value_sumMethod
find_and_set_core_value_sum(comm::MPI.Comm, value::Union{Float64,Int64})

Find and set core value sum

Arguments

  • comm::MPI.Comm: The MPI communicator
  • value::Union{Float64,Int64}: The value

Returns

  • recv_msg::Union{Int64,Vector{Float64},Vector{Int64},Vector{Bool}}: The received message
source
PeriLab.Solver_control.Verlet.get_cs_denominatorMethod
get_cs_denominator(volume::Union{SubArray,Vector{Float64},Vector{Int64}}, undeformed_bond::Union{SubArray,Vector{Float64},Vector{Int64}})

Calculate the denominator for the critical time step calculation.

Arguments

  • volume::Union{SubArray,Vector{Float64},Vector{Int64}}: 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_control.Verlet.get_integration_stepsMethod
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_control.Verlet.get_partial_stressesMethod
get_partial_stresses(datamanager::Module, nodes::Vector{Int64})

Computes the partial stresses.

Arguments

  • datamanager::Data_manager: Datamanager.
  • nodes::Vector{Int64}: List of block nodes.

Returns

  • datamanager::Data_manager: Datamanager.
source
PeriLab.Solver_control.Verlet.init_solverMethod
init_solver(params::Dict, datamanager::Module, 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.
  • datamanager::Module: The data manager module that provides access to required data fields and properties.
  • 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_control.Verlet.run_solverMethod
run_solver(
     solver_options::Dict{Any,Any},
     block_nodes::Dict{Int64,Vector{Int64}},
     bcs::Dict{Any,Any},
@@ -10,9 +10,9 @@
     write_results,
     to::TimerOutputs.TimerOutput,
     silent::Bool
-)

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

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.
  • datamanager::Module: The data manager module that provides access to data fields and properties.
  • 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.
  • to::TimerOutputs.TimerOutput: A timer output.
  • 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 datamanager 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
PeriLab.Solver_control.Verlet.send_single_value_from_vectorMethod
send_single_value_from_vector(comm::MPI.Comm, controller::Int64, values::Union{Int64,Vector{Float64},Vector{Int64},Vector{Bool}}, type::Type)

Sends a single value from a vector to a controller

Arguments

  • comm::MPI.Comm: The MPI communicator
  • controller::Int64: The controller
  • values::Union{Int64,Vector{Float64},Vector{Int64},Vector{Bool}}: The values
  • type::Type: The type

Returns

  • recv_msg::Union{Int64,Vector{Float64},Vector{Int64},Vector{Bool}}: The received message
source
PeriLab.Solver_control.Verlet.send_valueMethod
send_value(comm::MPI.Comm, controller, send_msg)

Sends a value to a controller

Arguments

  • comm::MPI.Comm: The MPI communicator
  • controller::Int64: The controller
  • send_msg::Union{Int64,Vector{Float64},Vector{Int64},Vector{Bool}}: The send message

Returns

  • recv_msg::Union{Int64,Vector{Float64},Vector{Int64},Vector{Bool}}: The received message
source
PeriLab.Solver_control.Verlet.send_vector_from_root_to_core_iMethod
send_vector_from_root_to_core_i(comm::MPI.Comm, send_msg, recv_msg, distribution)

Sends a vector from the root to the core i

Arguments

  • comm::MPI.Comm: The MPI communicator
  • send_msg::Union{Int64,Vector{Float64},Vector{Int64},Vector{Bool}}: The send message
  • recv_msg::Union{Int64,Vector{Float64},Vector{Int64},Vector{Bool}}: The receive message
  • distribution::Vector{Int64}: The distribution

Returns

  • recv_msg::Union{Int64,Vector{Float64},Vector{Int64},Vector{Bool}}: The received message
source
PeriLab.Solver_control.Verlet.split_vectorMethod
split_vector(input, row_nums, dof)

Split a vector into a vector of matrices

Arguments

  • input::Vector: The input vector
  • row_nums::Vector: The row numbers
  • dof::Int: The degree of freedom

Returns

  • result::Vector: The result vector
source
PeriLab.Solver_control.Verlet.synch_controller_bonds_to_responderMethod
synch_controller_bonds_to_responder(comm::MPI.Comm, overlapnodes, array, dof)

Synch the controller bonds to the responder

Arguments

  • comm::MPI.Comm: The MPI communicator
  • overlapnodes::Dict: The overlap nodes
  • array::Array: The array
  • dof::Int: The degree of freedom

Returns

  • array::Array: The array
source
PeriLab.Solver_control.Verlet.synch_controller_to_responderMethod
synch_controller_to_responder(comm::MPI.Comm, overlapnodes, vector, dof)

Synch the controller to the responder

Arguments

  • comm::MPI.Comm: The MPI communicator
  • overlapnodes::Dict: The overlap nodes
  • vector::Vector: The vector
  • dof::Int: The degree of freedom

Returns

  • vector::Vector: The vector
source
PeriLab.Solver_control.Verlet.synch_responder_to_controllerMethod
synch_responder_to_controller(comm::MPI.Comm, overlapnodes, vector, dof)

Synch the responder to the controller

Arguments

  • comm::MPI.Comm: The MPI communicator
  • overlapnodes::Dict: The overlap nodes
  • vector::Vector: The vector
  • dof::Int: The degree of freedom

Returns

  • vector::Vector: The vector
source
PeriLab.Solver_control.Verlet.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

Boundary_conditions

PeriLab.Solver_control.Boundary_conditions.check_valid_bcsMethod
check_valid_bcs(bcs::Dict{String,Any}, datamanager::Module

Check if the boundary conditions are valid

Arguments

  • bcs::Dict{String,Any}: The boundary conditions
  • datamanager::Module: The data manager module

Returns

  • working_bcs::Dict{String,Any}: The valid boundary conditions
source
PeriLab.Solver_control.Boundary_conditions.eval_bc!Function
eval_bc!(field_values::Union{Vector{Float64},Vector{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
+
diff --git a/dev/man/basics/index.html b/dev/man/basics/index.html index 635c5c4d..68c4475f 100644 --- a/dev/man/basics/index.html +++ b/dev/man/basics/index.html @@ -14,4 +14,4 @@ startOnLoad: true, theme: "neutral" }); - + diff --git a/dev/man/bond_filter/index.html b/dev/man/bond_filter/index.html index ae5eacd4..bd9b2d0f 100644 --- a/dev/man/bond_filter/index.html +++ b/dev/man/bond_filter/index.html @@ -4,4 +4,4 @@ startOnLoad: true, theme: "neutral" }); - + diff --git a/dev/man/dev/datamanager/index.html b/dev/man/dev/datamanager/index.html index 90ff7d63..34d92d39 100644 --- a/dev/man/dev/datamanager/index.html +++ b/dev/man/dev/datamanager/index.html @@ -11,4 +11,4 @@ startOnLoad: true, theme: "neutral" }); - + diff --git a/dev/man/dev/developement_guide/index.html b/dev/man/dev/developement_guide/index.html index 982ac6d6..fa116882 100644 --- a/dev/man/dev/developement_guide/index.html +++ b/dev/man/dev/developement_guide/index.html @@ -4,4 +4,4 @@ startOnLoad: true, theme: "neutral" }); - + diff --git a/dev/man/dev/module_integration/index.html b/dev/man/dev/module_integration/index.html index 2c9a98a3..16a671b5 100644 --- a/dev/man/dev/module_integration/index.html +++ b/dev/man/dev/module_integration/index.html @@ -7,4 +7,4 @@ startOnLoad: true, theme: "neutral" }); - + diff --git a/dev/man/dev/parameters/index.html b/dev/man/dev/parameters/index.html index 5fe6f83f..0c7d0f6f 100644 --- a/dev/man/dev/parameters/index.html +++ b/dev/man/dev/parameters/index.html @@ -4,4 +4,4 @@ startOnLoad: true, theme: "neutral" }); - + diff --git a/dev/man/dev/testing/index.html b/dev/man/dev/testing/index.html index e266d363..338a5997 100644 --- a/dev/man/dev/testing/index.html +++ b/dev/man/dev/testing/index.html @@ -30,4 +30,4 @@ startOnLoad: true, theme: "neutral" }); - + diff --git a/dev/man/getting_started/index.html b/dev/man/getting_started/index.html index 6dafbedf..c96fff6f 100644 --- a/dev/man/getting_started/index.html +++ b/dev/man/getting_started/index.html @@ -5,9 +5,9 @@ PeriLab.get_examples() PeriLab.main("examples/DCB/DCBmodel.yaml")

The output should look like this:

The main functionalities for the yaml input deck is given in

"examples/functionalities.yaml"

Using PeriLab with multiple processors (MPI)

In order to run PeriLab for large scale problems MPI needs to be installed:

$ julia
 julia> using MPI
-julia> MPI.install_mpiexecjl()

Run PeriLab with two processors:

$ mpiexecjl -n 2 julia -e "using PeriLab; PeriLab.main()" Dogbone.yaml -v

Training

The training input is given under the examples folder. The documentation and a video will follow.

Index

Functions

PeriLab.mainFunction
main()

Entry point for the PeriLab application.

This function serves as the entry point for the PeriLab application. It calls the core main function with the provided arguments.

source
main(filename::String, output_dir::String="", dry_run::Bool=false, verbose::Bool=false, debug::Bool=false, silent::Bool=false, reload::Bool=false)

Entry point for the PeriLab application.

This function serves as the entry point for the PeriLab application. It calls the core main function with the provided arguments.

Arguments

  • filename::String: The filename of the input file.
  • output_dir::String: The output directory.
  • dry_run::Bool=false: Whether to run in dry-run mode.
  • verbose::Bool=false: Whether to run in verbose mode.
  • debug::Bool=false: Whether to run in debug mode.
  • silent::Bool=false: Whether to run in silent mode.
  • reload::Bool=false: Whether to reload the input file.
source
PeriLab.get_examplesFunction
get_examples()

Copy the examples folder to the current directory.

source
+ diff --git a/dev/man/input_yaml/index.html b/dev/man/input_yaml/index.html index 7c20608e..92efcf82 100644 --- a/dev/man/input_yaml/index.html +++ b/dev/man/input_yaml/index.html @@ -4,4 +4,4 @@ startOnLoad: true, theme: "neutral" }); - + diff --git a/dev/man/mesh_input/index.html b/dev/man/mesh_input/index.html index 7c3cc64e..69327ac6 100644 --- a/dev/man/mesh_input/index.html +++ b/dev/man/mesh_input/index.html @@ -16,4 +16,4 @@ startOnLoad: true, theme: "neutral" }); - + diff --git a/dev/man/models/additive/index.html b/dev/man/models/additive/index.html index f89457c7..3143c5d0 100644 --- a/dev/man/models/additive/index.html +++ b/dev/man/models/additive/index.html @@ -7,4 +7,4 @@ startOnLoad: true, theme: "neutral" }); - + diff --git a/dev/man/models/damage/index.html b/dev/man/models/damage/index.html index 4623b178..8d73a199 100644 --- a/dev/man/models/damage/index.html +++ b/dev/man/models/damage/index.html @@ -4,4 +4,4 @@ startOnLoad: true, theme: "neutral" }); - + diff --git a/dev/man/models/materials/index.html b/dev/man/models/materials/index.html index 424a9276..06216509 100644 --- a/dev/man/models/materials/index.html +++ b/dev/man/models/materials/index.html @@ -4,4 +4,4 @@ startOnLoad: true, theme: "neutral" }); - + diff --git a/dev/man/models/overview/index.html b/dev/man/models/overview/index.html index 80325994..6e5b96dd 100644 --- a/dev/man/models/overview/index.html +++ b/dev/man/models/overview/index.html @@ -23,4 +23,4 @@ startOnLoad: true, theme: "neutral" }); - + diff --git a/dev/man/models/thermal/index.html b/dev/man/models/thermal/index.html index 7afc05f2..7cf7b373 100644 --- a/dev/man/models/thermal/index.html +++ b/dev/man/models/thermal/index.html @@ -4,4 +4,4 @@ startOnLoad: true, theme: "neutral" }); - + diff --git a/dev/man/output/index.html b/dev/man/output/index.html index e4fba604..141982dc 100644 --- a/dev/man/output/index.html +++ b/dev/man/output/index.html @@ -4,4 +4,4 @@ startOnLoad: true, theme: "neutral" }); - + diff --git a/dev/man/solver/solver/index.html b/dev/man/solver/solver/index.html index bc6e8fc2..2015415b 100644 --- a/dev/man/solver/solver/index.html +++ b/dev/man/solver/solver/index.html @@ -4,4 +4,4 @@ startOnLoad: true, theme: "neutral" }); - + diff --git a/dev/theory/theory/index.html b/dev/theory/theory/index.html index 494e5d4b..6be9e44b 100644 --- a/dev/theory/theory/index.html +++ b/dev/theory/theory/index.html @@ -4,4 +4,4 @@ startOnLoad: true, theme: "neutral" }); - + diff --git a/dev/theory/theory_bondbased/index.html b/dev/theory/theory_bondbased/index.html index 8535374c..ffb5b5d5 100644 --- a/dev/theory/theory_bondbased/index.html +++ b/dev/theory/theory_bondbased/index.html @@ -4,4 +4,4 @@ startOnLoad: true, theme: "neutral" }); - + diff --git a/dev/theory/theory_correspondence/index.html b/dev/theory/theory_correspondence/index.html index c07a6cc6..8ff9176a 100644 --- a/dev/theory/theory_correspondence/index.html +++ b/dev/theory/theory_correspondence/index.html @@ -4,4 +4,4 @@ startOnLoad: true, theme: "neutral" }); - + diff --git a/dev/theory/theory_damage/index.html b/dev/theory/theory_damage/index.html index cf966e5b..9e21e6d7 100644 --- a/dev/theory/theory_damage/index.html +++ b/dev/theory/theory_damage/index.html @@ -4,4 +4,4 @@ startOnLoad: true, theme: "neutral" }); - + diff --git a/dev/theory/theory_ordinary/index.html b/dev/theory/theory_ordinary/index.html index 231827ad..715a1cee 100644 --- a/dev/theory/theory_ordinary/index.html +++ b/dev/theory/theory_ordinary/index.html @@ -4,4 +4,4 @@ startOnLoad: true, theme: "neutral" }); - + diff --git a/dev/theory/theory_thermal/index.html b/dev/theory/theory_thermal/index.html index b401d1a5..a0b6fa03 100644 --- a/dev/theory/theory_thermal/index.html +++ b/dev/theory/theory_thermal/index.html @@ -4,4 +4,4 @@ startOnLoad: true, theme: "neutral" }); - +