Data Manager - Functions

Index

Data_Manager

PeriLab.Data_Manager._get_field — Method
_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_model — Function
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.checkpoint_file — Method
checkpoint_file(directory::String, rank::Int64)

Path of the restart file for a given MPI rank. One file per rank, so any future mpiexecjl launch with the same rank count can restore its own partition independently.

source
PeriLab.Data_Manager.get_bond_ptr — Method
get_bond_ptr()

Returns the CSR offsets shared by all bond fields: the bonds of node i are the flat indices ptr[i]:(ptr[i + 1] - 1). Built from "Number of Neighbors" on first use. The bond structure is fixed afterwards, a changed "Number of Neighbors" aborts.

source
PeriLab.Data_Manager.get_damage — Method
get_damage(time::String) -> NodeScalarField{Float64}

Get the damage values for a specific time.

Arguments

  • time::String: The time identifier for the damage field.

Returns

  • NodeScalarField{Float64}: The damage values as a vector of floating-point numbers.

Examples

damage_values = get_damage("NP1")
println(damage_values)  # [1.5, 2.3, 0.8, ...]
source
PeriLab.Data_Manager.get_dof — Method
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_field — Function
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_field_if_exists — Function
get_field_if_exists(name::String, time::String)

Returns the field with the given name if it exists.

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_nodes — Method
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_rank — Method
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

rank = get_max_rank()
source
PeriLab.Data_Manager.get_nnodes — Method
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_rank — Method
get_rank()

This function returns the rank of the core.

Returns

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

Example

current_rank = get_rank()
source
PeriLab.Data_Manager.initialize_data — Method
initialize_data()

Initialize all parameter in the Data_Manager and sets them to the default values. Removes all fields, so that no field of an earlier run is left.

source
PeriLab.Data_Manager.loc_to_glob — Method
loc_to_glob(range::UnitRange{Int64})

Converts the local index to the global index.

Arguments

  • range::Union{UnitRange{Int64}, Vector{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.read_checkpoint! — Method
read_checkpoint!(directory::String, rank::Int64)

Restores this rank's data and fieldmanager.fields from a checkpoint written by write_checkpoint. Always runs initialize_data() first so excluded/derived keys (rank, comm, model wiring) start clean and get re-populated normally later in run().

Falls back to a plain initialize_data() (i.e. a fresh start) if no checkpoint file is found, so passing --reload on a first run is harmless.

source
PeriLab.Data_Manager.reset_NP1 — Method
reset_NP1()

Discards the NP1 state of a failed step: every NP1 field is as directly after switch_NP1_to_N (the fill value on active nodes, Bond Damage NP1 equal to N if tracked, see track_bond_damage_N).

source
PeriLab.Data_Manager.set_bc_free_dof — Method
set_bc_free_dof(values::Vector{Tuple{Int64, Int64}})

Set all dof without displacment boundary conditions.

Arguments

  • values::Vector{Int64}: The dof without boundary condition.
source
PeriLab.Data_Manager.set_coupling_dict — Method
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_dof — Method
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_fem — Method
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_loc — Method
set_glob_to_loc(dict::Dict{Int64,Int64})

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_synch — Function
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_np1_start — Method
set_np1_start(name::String, mode::Symbol)

How the NP1 state of name starts a step (after switch_NP1_to_N and reset_NP1): :fill with the fill value (default), :copy of N (a monotonic field whose model updates only some nodes, e.g. the node damage), :keep as it is (a field every step overwrites on every node it reads, e.g. the deformed bond geometry; skips the refill).

source
PeriLab.Data_Manager.set_nset — Method
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_controller — Method
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_responder — Method
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_synch — Function
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_manager — Method
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
PeriLab.Data_Manager.track_bond_damage_N — Method
track_bond_damage_N()

Keeps Bond Damage N equal to NP1 after every step, for the models that read N (damage models, the matrix based correspondence) and for a fallback solver, which restores NP1 from N. Without it the copy of all bonds is skipped; NP1 keeps the bond damage anyway.

source
PeriLab.Data_Manager.write_checkpoint — Method
write_checkpoint(directory::String, rank::Int64)

Serializes this rank's field arrays (fieldmanager.fields) and the persistable part of data (current time, step, field bookkeeping, etc.) to disk. Intended to be called between solver steps, so a fresh mpiexecjl invocation started with --reload can pick up where this one left off.

source