Data Manager - Functions
Index
PeriLab.Data_Manager._get_fieldPeriLab.Data_Manager.add_active_modelPeriLab.Data_Manager.bind_dependent_tables!PeriLab.Data_Manager.checkpoint_filePeriLab.Data_Manager.fem_activePeriLab.Data_Manager.get_accuracy_orderPeriLab.Data_Manager.get_active_modelsPeriLab.Data_Manager.get_all_blocksPeriLab.Data_Manager.get_all_field_keysPeriLab.Data_Manager.get_all_positionsPeriLab.Data_Manager.get_aniso_crit_valuesPeriLab.Data_Manager.get_bc_free_dofPeriLab.Data_Manager.get_block_id_listPeriLab.Data_Manager.get_block_modelsPeriLab.Data_Manager.get_block_name_listPeriLab.Data_Manager.get_bond_damagePeriLab.Data_Manager.get_bond_ptrPeriLab.Data_Manager.get_cancelPeriLab.Data_Manager.get_commPeriLab.Data_Manager.get_contact_overlap_mapPeriLab.Data_Manager.get_coupling_dictPeriLab.Data_Manager.get_coupling_fe_nodesPeriLab.Data_Manager.get_crit_values_matrixPeriLab.Data_Manager.get_current_timePeriLab.Data_Manager.get_damagePeriLab.Data_Manager.get_dofPeriLab.Data_Manager.get_element_rotationPeriLab.Data_Manager.get_fem_paramsPeriLab.Data_Manager.get_fieldPeriLab.Data_Manager.get_field_if_existsPeriLab.Data_Manager.get_field_typePeriLab.Data_Manager.get_filtered_nlistPeriLab.Data_Manager.get_inverse_nlistPeriLab.Data_Manager.get_iterationPeriLab.Data_Manager.get_local_nodesPeriLab.Data_Manager.get_local_synch_fieldsPeriLab.Data_Manager.get_max_rankPeriLab.Data_Manager.get_max_stepPeriLab.Data_Manager.get_mpi_activePeriLab.Data_Manager.get_nlistPeriLab.Data_Manager.get_nnodesPeriLab.Data_Manager.get_nnsetsPeriLab.Data_Manager.get_nsetsPeriLab.Data_Manager.get_num_elementsPeriLab.Data_Manager.get_num_responderPeriLab.Data_Manager.get_output_frequencyPeriLab.Data_Manager.get_overlap_mapPeriLab.Data_Manager.get_pre_calculation_orderPeriLab.Data_Manager.get_rankPeriLab.Data_Manager.get_rotationPeriLab.Data_Manager.get_silentPeriLab.Data_Manager.get_stepPeriLab.Data_Manager.get_surface_correctionPeriLab.Data_Manager.get_synch_fieldsPeriLab.Data_Manager.get_verbosePeriLab.Data_Manager.has_keyPeriLab.Data_Manager.initialize_dataPeriLab.Data_Manager.loc_to_globPeriLab.Data_Manager.read_checkpoint!PeriLab.Data_Manager.remove_active_modelPeriLab.Data_Manager.reset_NP1PeriLab.Data_Manager.set_NP1_to_NPeriLab.Data_Manager.set_accuracy_orderPeriLab.Data_Manager.set_aniso_crit_valuesPeriLab.Data_Manager.set_bc_free_dofPeriLab.Data_Manager.set_block_id_listPeriLab.Data_Manager.set_block_modelsPeriLab.Data_Manager.set_block_name_listPeriLab.Data_Manager.set_cancelPeriLab.Data_Manager.set_commPeriLab.Data_Manager.set_contact_overlap_mapPeriLab.Data_Manager.set_coupling_dictPeriLab.Data_Manager.set_coupling_fe_nodesPeriLab.Data_Manager.set_crit_values_matrixPeriLab.Data_Manager.set_current_timePeriLab.Data_Manager.set_distributionPeriLab.Data_Manager.set_dofPeriLab.Data_Manager.set_element_rotationPeriLab.Data_Manager.set_femPeriLab.Data_Manager.set_fem_paramsPeriLab.Data_Manager.set_glob_to_locPeriLab.Data_Manager.set_inverse_nlistPeriLab.Data_Manager.set_iterationPeriLab.Data_Manager.set_local_synchPeriLab.Data_Manager.set_max_rankPeriLab.Data_Manager.set_max_stepPeriLab.Data_Manager.set_nnodesPeriLab.Data_Manager.set_nnsetsPeriLab.Data_Manager.set_np1_startPeriLab.Data_Manager.set_nsetPeriLab.Data_Manager.set_num_controllerPeriLab.Data_Manager.set_num_responderPeriLab.Data_Manager.set_output_frequencyPeriLab.Data_Manager.set_overlap_mapPeriLab.Data_Manager.set_rankPeriLab.Data_Manager.set_rotationPeriLab.Data_Manager.set_silentPeriLab.Data_Manager.set_stepPeriLab.Data_Manager.set_surface_correctionPeriLab.Data_Manager.set_synchPeriLab.Data_Manager.set_verbosePeriLab.Data_Manager.switch_NP1_to_NPeriLab.Data_Manager.synch_managerPeriLab.Data_Manager.track_bond_damage_NPeriLab.Data_Manager.write_checkpoint
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.
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.
PeriLab.Data_Manager.bind_dependent_tables! — Method
bind_dependent_tables!(tables)Binds every table to its node field (call before each compute: the N/NP1 switch replaces the arrays). Aborts if a field is missing.
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.
PeriLab.Data_Manager.fem_active — Method
fem_active()
Returns if FEM is active (true) or not (false).
PeriLab.Data_Manager.get_accuracy_order — Method
get_accuracy_order()Returns the accuracy order for the "bond associated correspondence" implementation.
Arguments
value::Int64: The value of the accuracy_order.
PeriLab.Data_Manager.get_active_models — Function
get_active_models()Returns a list active model modules.
PeriLab.Data_Manager.get_all_blocks — Method
get_all_blocks()Gives back a global list of all block, initially. Is reduced to the outer (not free) surfaces of the contact blocks.
PeriLab.Data_Manager.get_all_field_keys — Method
get_all_field_keys()Returns a list of all field keys.
PeriLab.Data_Manager.get_all_positions — Method
get_all_positions()Gives back a global list of current positions, initially. Is reduced to the outer (not free) surfaces of the contact blocks.
PeriLab.Data_Manager.get_aniso_crit_values — Method
get_aniso_crit_values()Retrieves the critical values matrix.
PeriLab.Data_Manager.get_bc_free_dof — Method
get_bc_free_dof()Get all dof without displacment boundary conditions.
Returns
Vector{Tuple{Int64, Int64}}: The point and dof without boundary condition.
PeriLab.Data_Manager.get_block_id_list — Method
get_block_id_list()Returns a list of all block IDs.
PeriLab.Data_Manager.get_block_models — Method
get_block_models(block)The typed models of a block (NO_BLOCK_MODELS if it has none).
PeriLab.Data_Manager.get_block_name_list — Method
get_block_name_list()Returns a list of all block IDs.
PeriLab.Data_Manager.get_bond_damage — Method
get_bond_damage(time::String)Get the bond damage
Arguments
time::String: The time of the field.
Returns
damage::Field: The bond damage field.
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.
PeriLab.Data_Manager.get_cancel — Method
get_cancel()This function returns the cancel flag.
Returns
cancel::Bool: The value of thecancelvariable.
PeriLab.Data_Manager.get_comm — Method
get_comm()Get the MPI communicator
PeriLab.Data_Manager.get_contact_overlap_map — Method
get_contact_overlap_map()Get the contact overlap map
PeriLab.Data_Manager.get_coupling_dict — Method
get_coupling_dict()Get the PD - FE coupling dict
PeriLab.Data_Manager.get_coupling_fe_nodes — Method
get_coupling_fe_nodes()Get the FE nodes involved in the coupling
PeriLab.Data_Manager.get_crit_values_matrix — Method
get_crit_values_matrix()Retrieves the critical values matrix.
PeriLab.Data_Manager.get_current_time — Method
get_current_time()Get the current time of the simulation.
Returns
Float64: The current time of the simulation.
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, ...]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 freedomPeriLab.Data_Manager.get_element_rotation — Method
get_element_rotation()This function returns the element_rotation flag.
Returns
element_rotation::Bool: The value of theelement_rotationvariable.
PeriLab.Data_Manager.get_fem_params — Method
get_fem_params()The typed FEM section stored by set_fem_params.
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.
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.
PeriLab.Data_Manager.get_field_type — Function
get_field_type()Get the type of a field
Returns
get_field_type(string): returns the type of a field
PeriLab.Data_Manager.get_filtered_nlist — Method
get_filtered_nlist()Get the neighborhood list.
PeriLab.Data_Manager.get_inverse_nlist — Method
get_inverse_nlist()Get the inverse of the neighborhood list.
PeriLab.Data_Manager.get_iteration — Method
get_step()Get the iteration of the simulation.
Returns
Int64: The iteration of the simulation.
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 arrayPeriLab.Data_Manager.get_local_synch_fields — Method
get_local_synch_fields(model::String)
model - class of models; before computation of these models the synchronisation occurs
Get the fields to synchronizePeriLab.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 themax_rankvariable.
Example
rank = get_max_rank()PeriLab.Data_Manager.get_max_step — Method
get_max_step()Get the max_step of the simulation.
Returns
Int64: The max_step of the simulation.
PeriLab.Data_Manager.get_mpi_active — Method
get_mpi_active()This function returns if MPI is active.
Returns
mpi_active::Bool
Example
rank = get_mpi_active()PeriLab.Data_Manager.get_nlist — Method
get_nlist()Get the neighborhood list.
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 includedPeriLab.Data_Manager.get_nnsets — Method
get_nnsets()Get the number of node sets.
Returns
nnsets::Int: The number of node sets.
PeriLab.Data_Manager.get_nsets — Method
get_nsets()Get the node sets
Returns
nsets::Dict{String,Vector{Int64}}: The node sets dictionary.
PeriLab.Data_Manager.get_num_elements — Method
get_num_elements()Get the the number of finite elements
Returns
get_num_elements::Int64: The number of finite elements
PeriLab.Data_Manager.get_num_responder — Method
get_num_responder()Get the the number of responder nodes
Returns
num_responder::Int64: The number of responder nodes
PeriLab.Data_Manager.get_output_frequency — Method
get_output_frequency()This function returns the output_frequency variable.
Returns
output_frequency::Any: The value of theoutput_frequencyvariable.
PeriLab.Data_Manager.get_overlap_map — Method
get_overlap_map()Get the overlap map
PeriLab.Data_Manager.get_pre_calculation_order — Method
get_pre_calculation_order()return the order of the pre calculation.
PeriLab.Data_Manager.get_rank — Method
get_rank()This function returns the rank of the core.
Returns
rank::Any: The value of therankvariable.
Example
current_rank = get_rank()PeriLab.Data_Manager.get_rotation — Method
get_rotation()This function returns the rotation flag.
Returns
rotation::Bool: The value of therotationvariable.
PeriLab.Data_Manager.get_silent — Method
get_silent()This function returns the silent flag.
Returns
silent::Bool: The value of thesilentvariable.
PeriLab.Data_Manager.get_step — Method
get_step()Get the step of the simulation.
Returns
Int64: The step of the simulation.
PeriLab.Data_Manager.get_surface_correction — Method
get_surface_correction()The typed Surface Correction section stored by set_surface_correction.
PeriLab.Data_Manager.get_synch_fields — Method
get_synch_fields()Get the fields to synchronize
PeriLab.Data_Manager.get_verbose — Method
get_verbose()This function returns the verbose flag.
Returns
verbose::Bool: The value of theverbosevariable.
PeriLab.Data_Manager.has_key — Method
has_key(field_name::String)::BoolControl if a key exists.
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.
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 indexPeriLab.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.
PeriLab.Data_Manager.remove_active_model — Method
remove_active_model(module_name::Module)Removes main modules from OrderedDict.
Arguments
key::String: Key of the entry.
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).
PeriLab.Data_Manager.set_NP1_to_N — Method
set_NP1_to_N(name::String, type::Type)Sets the NP1toN dataset
Arguments
name::String: The name of the field.type::Type The field type
PeriLab.Data_Manager.set_accuracy_order — Method
set_accuracy_order(value::Int64)Sets the accuracy order for the "bond associated correspondence" implementation.
Arguments
value::Int64: The value of the accuracy_order.
PeriLab.Data_Manager.set_aniso_crit_values — Method
setanisocritvalues(critvalues::Dict{Int64,Any})
Sets the anisotropic critical values globally.
Arguments
crit_values::Dict{Int64,Any}: The critical values.
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.
PeriLab.Data_Manager.set_block_id_list — Method
set_block_id_list(blocks_id_list::Vector{Int64})Sets the block list globally.
Arguments
blocks_id_list::Vector{Int64}: The block list.
PeriLab.Data_Manager.set_block_models — Method
set_block_models(block, models)Stores the typed models (BlockModels) of a block.
PeriLab.Data_Manager.set_block_name_list — Method
set_block_name_list(blocks_name_list::Vector{String})Sets the block list globally.
Arguments
blocks_name_list::Vector{String}: The block list.
PeriLab.Data_Manager.set_cancel — Method
set_cancel(value::Int64)Sets the cancel flag.
Arguments
value::Bool: The cancel flag.
PeriLab.Data_Manager.set_comm — Method
set_comm(comm::MPI.Comm)Set the MPI communicator
Arguments
comm::MPI.Comm: MPI communicator
PeriLab.Data_Manager.set_contact_overlap_map — Method
set_contact_overlap_map(topo)Sets the contact overlap map globally.
Arguments
topo: The overlap map.
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.
PeriLab.Data_Manager.set_coupling_fe_nodes — Method
set_coupling_fe_nodes()Get the FE nodes involved in the coupling
PeriLab.Data_Manager.set_crit_values_matrix — Method
set_crit_values_matrix(crit_values::Array{Float64,3})Sets the critical values matrix globally.
Arguments
crit_values::Array{Float64,3}: The critical values matrix.
PeriLab.Data_Manager.set_current_time — Method
set_current_time(time::Float64)Set the current time of the simulation.
Arguments
time::Float64: The current time of the simulation.
PeriLab.Data_Manager.set_distribution — Method
set_distribution(values::Vector{Int64})Sets the distribution globally.
Arguments
values::Vector{Int64}: The distribution.
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 3PeriLab.Data_Manager.set_element_rotation — Method
set_element_rotation(value::Int64)Sets the element_rotation flag.
Arguments
value::Bool: The element_rotation flag.
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 truePeriLab.Data_Manager.set_fem_params — Method
set_fem_params(fem)Stores the typed FEM section (FEMParams, or nothing without FEM).
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 dictPeriLab.Data_Manager.set_inverse_nlist — Method
set_inverse_nlist(inv_nlist::Vector{Dict{Int64,Int64}})Sets the inverse nlist globally.
Arguments
inv_nlist::Vector{Dict{Int64,Int64}}: The inverse nlist.
PeriLab.Data_Manager.set_iteration — Method
set_iteration(iteration::Int64)Set the iteration of the simulation.
Arguments
iteration::Int64: The iteration of the simulation.
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.
PeriLab.Data_Manager.set_max_rank — Method
set_max_rank(value::Int64)Sets the maximum rank globally.
Arguments
value::Int64: The value to set as the maximum rank.
PeriLab.Data_Manager.set_max_step — Method
set_max_step(max_step::Int64)Set the max_step of the simulation.
Arguments
max_step::Int64: The max_step of the simulation.
PeriLab.Data_Manager.set_nnodes — Method
set_nnodes()Sets the number all nodes of one core globally.
Arguments
Example: ```
PeriLab.Data_Manager.set_nnsets — Method
set_nnsets(n::Int64)Set the number of node sets.
Arguments
n::Int64: The number of node sets to be set.
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).
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.
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 10PeriLab.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 10PeriLab.Data_Manager.set_output_frequency — Method
set_output_frequency(value)Sets the output frequency globally.
Arguments
value: The value to set as the output frequency.
PeriLab.Data_Manager.set_overlap_map — Method
set_overlap_map(topo)Sets the overlap map globally.
Arguments
topo: The overlap map.
PeriLab.Data_Manager.set_rank — Method
set_rank(value::Int64)Sets the rank globally.
Arguments
value::Int64: The value to set as the rank.
PeriLab.Data_Manager.set_rotation — Method
set_rotation(value::Int64)Sets the rotation flag.
Arguments
value::Bool: The rotation flag.
PeriLab.Data_Manager.set_silent — Method
set_silent(value::Bool)Sets the silent flag.
Arguments
value::Bool: The silent flag.
PeriLab.Data_Manager.set_step — Method
set_step(step::Int64)Set the step of the simulation.
Arguments
step::Int64: The step of the simulation.
PeriLab.Data_Manager.set_surface_correction — Method
set_surface_correction(sc)Stores the typed Surface Correction section (or nothing).
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.
PeriLab.Data_Manager.set_verbose — Method
set_verbose(value::Bool)Sets the verbose flag.
Arguments
value::Bool: The verbose flag.
PeriLab.Data_Manager.switch_NP1_to_N — Method
switch_NP1_to_N()Switches the fields from NP1 to N. This is more efficient than copying the data from one field the other.
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.
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.
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.