Data Manager - Functions
Index
PeriLab.Data_manager._get_field
PeriLab.Data_manager.add_active_model
PeriLab.Data_manager.check_property
PeriLab.Data_manager.create_bond_field
PeriLab.Data_manager.create_constant_bond_field
PeriLab.Data_manager.create_constant_element_field
PeriLab.Data_manager.create_constant_node_field
PeriLab.Data_manager.create_field
PeriLab.Data_manager.create_node_field
PeriLab.Data_manager.fem_active
PeriLab.Data_manager.get_accuracy_order
PeriLab.Data_manager.get_active_models
PeriLab.Data_manager.get_all_field_keys
PeriLab.Data_manager.get_aniso_crit_values
PeriLab.Data_manager.get_block_list
PeriLab.Data_manager.get_bond_damage
PeriLab.Data_manager.get_cancel
PeriLab.Data_manager.get_comm
PeriLab.Data_manager.get_coupling_dict
PeriLab.Data_manager.get_crit_values_matrix
PeriLab.Data_manager.get_damage
PeriLab.Data_manager.get_damage_models
PeriLab.Data_manager.get_dof
PeriLab.Data_manager.get_element_rotation
PeriLab.Data_manager.get_field
PeriLab.Data_manager.get_field_type
PeriLab.Data_manager.get_filtered_nlist
PeriLab.Data_manager.get_inverse_nlist
PeriLab.Data_manager.get_local_nodes
PeriLab.Data_manager.get_local_synch_fields
PeriLab.Data_manager.get_max_rank
PeriLab.Data_manager.get_nlist
PeriLab.Data_manager.get_nnodes
PeriLab.Data_manager.get_nnsets
PeriLab.Data_manager.get_nsets
PeriLab.Data_manager.get_num_elements
PeriLab.Data_manager.get_num_responder
PeriLab.Data_manager.get_output_frequency
PeriLab.Data_manager.get_overlap_map
PeriLab.Data_manager.get_pre_calculation_order
PeriLab.Data_manager.get_properties
PeriLab.Data_manager.get_property
PeriLab.Data_manager.get_rank
PeriLab.Data_manager.get_rotation
PeriLab.Data_manager.get_silent
PeriLab.Data_manager.get_synch_fields
PeriLab.Data_manager.has_key
PeriLab.Data_manager.init_properties
PeriLab.Data_manager.initialize_data
PeriLab.Data_manager.loc_to_glob
PeriLab.Data_manager.remove_active_model
PeriLab.Data_manager.set_accuracy_order
PeriLab.Data_manager.set_aniso_crit_values
PeriLab.Data_manager.set_block_list
PeriLab.Data_manager.set_cancel
PeriLab.Data_manager.set_comm
PeriLab.Data_manager.set_coupling_dict
PeriLab.Data_manager.set_crit_values_matrix
PeriLab.Data_manager.set_damage_models
PeriLab.Data_manager.set_distribution
PeriLab.Data_manager.set_dof
PeriLab.Data_manager.set_element_rotation
PeriLab.Data_manager.set_fem
PeriLab.Data_manager.set_glob_to_loc
PeriLab.Data_manager.set_inverse_nlist
PeriLab.Data_manager.set_local_synch
PeriLab.Data_manager.set_material_models
PeriLab.Data_manager.set_max_rank
PeriLab.Data_manager.set_nnodes
PeriLab.Data_manager.set_nnsets
PeriLab.Data_manager.set_nset
PeriLab.Data_manager.set_num_controller
PeriLab.Data_manager.set_num_responder
PeriLab.Data_manager.set_output_frequency
PeriLab.Data_manager.set_overlap_map
PeriLab.Data_manager.set_pre_calculation_order
PeriLab.Data_manager.set_properties
PeriLab.Data_manager.set_properties
PeriLab.Data_manager.set_property
PeriLab.Data_manager.set_rank
PeriLab.Data_manager.set_rotation
PeriLab.Data_manager.set_silent
PeriLab.Data_manager.set_synch
PeriLab.Data_manager.switch_NP1_to_N
PeriLab.Data_manager.synch_manager
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
— Methodadd_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.check_property
— Methodcheck_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.
PeriLab.Data_manager.create_bond_field
— Functioncreate_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
PeriLab.Data_manager.create_constant_bond_field
— Functioncreate_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
PeriLab.Data_manager.create_constant_element_field
— Functioncreate_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
PeriLab.Data_manager.create_constant_node_field
— Functioncreate_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
PeriLab.Data_manager.create_field
— Functioncreate_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.
PeriLab.Data_manager.create_node_field
— Functioncreate_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
PeriLab.Data_manager.fem_active
— Methodfem_active()
Returns if FEM is active (true) or not (false).
PeriLab.Data_manager.get_accuracy_order
— Methodget_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
— Methodget_active_models()
Returns a list active model modules.
PeriLab.Data_manager.get_all_field_keys
— Methodget_all_field_keys()
Returns a list of all field keys.
PeriLab.Data_manager.get_aniso_crit_values
— Methodget_aniso_crit_values()
Retrieves the critical values matrix.
PeriLab.Data_manager.get_block_list
— Methodget_block_list()
Returns a list of all block IDs.
PeriLab.Data_manager.get_bond_damage
— Methodget_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_cancel
— Methodget_cancel()
This function returns the cancel
flag.
Returns
cancel
::Bool: The value of thecancel
variable.
PeriLab.Data_manager.get_comm
— Methodget_comm()
Get the MPI communicator
PeriLab.Data_manager.get_coupling_dict
— Methodget_coupling_dict()
Get the PD - FE coupling dict
PeriLab.Data_manager.get_crit_values_matrix
— Methodget_crit_values_matrix()
Retrieves the critical values matrix.
PeriLab.Data_manager.get_damage
— Methodget_damage(time::String)
Get the damage
Arguments
time::String
: The time of the field.
Returns
damage::Field
: The damage field.
PeriLab.Data_manager.get_damage_models
— Methodget_damage_models()
This function returns the damage_models
variable.
Returns
damage_models
::Any: The value of thedamage_models
variable.
PeriLab.Data_manager.get_dof
— Methodget_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
PeriLab.Data_manager.get_element_rotation
— Methodget_element_rotation()
This function returns the element_rotation
flag.
Returns
element_rotation
::Bool: The value of theelement_rotation
variable.
PeriLab.Data_manager.get_field
— Functionget_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_type
— Methodget_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
— Methodget_filtered_nlist()
Get the neighborhood list.
PeriLab.Data_manager.get_inverse_nlist
— Methodget_inverse_nlist()
Get the inverse of the neighborhood list.
PeriLab.Data_manager.get_local_nodes
— Methodget_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
PeriLab.Data_manager.get_local_synch_fields
— Methodget_local_synch_fields(model::String)
model - class of models; before computation of these models the synchronisation occurs
Get the fields to synchronize
PeriLab.Data_manager.get_max_rank
— Methodget_max_rank()
This function returns the maximal rank of MPI the max_rank
.
Returns
max_rank
::Number: The value of themax_rank
variable.
Example
```julia rank = getmaxrank()
PeriLab.Data_manager.get_nlist
— Methodget_nlist()
Get the neighborhood list.
PeriLab.Data_manager.get_nnodes
— Methodget_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
PeriLab.Data_manager.get_nnsets
— Methodget_nnsets()
Get the number of node sets.
Returns
nnsets::Int
: The number of node sets.
PeriLab.Data_manager.get_nsets
— Methodget_nsets()
Get the node sets
Returns
nsets::Dict{String,Vector{Int64}}
: The node sets dictionary.
PeriLab.Data_manager.get_num_elements
— Methodget_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
— Methodget_num_responder()
Get the the number of responder nodes
Returns
num_responder::Int64
: The number of responder nodes
PeriLab.Data_manager.get_output_frequency
— Methodget_output_frequency()
This function returns the output_frequency
variable.
Returns
output_frequency
::Any: The value of theoutput_frequency
variable.
PeriLab.Data_manager.get_overlap_map
— Methodget_overlap_map()
Get the overlap map
PeriLab.Data_manager.get_pre_calculation_order
— Methodget_pre_calculation_order()
return the order of the pre calculation.
PeriLab.Data_manager.get_properties
— Methodget_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 specifiedproperty
for the givenblock_id
.Dict()
: An empty dictionary if the specifiedproperty
does not exist for the givenblock_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
PeriLab.Data_manager.get_property
— Methodget_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 specifiedproperty
.
Returns
value
::Any: The value associated with the specifiedvalue_name
within theproperty
for the givenblock_id
.nothing
: If the specifiedblock_id
,property
, orvalue_name
does not exist in the dictionary.
Example
```julia
PeriLab.Data_manager.get_rank
— Methodget_rank()
This function returns the rank of the core.
Returns
rank
::Any: The value of therank
variable.
Example
```julia currentrank = getrank()
PeriLab.Data_manager.get_rotation
— Methodget_rotation()
This function returns the rotation
flag.
Returns
rotation
::Bool: The value of therotation
variable.
PeriLab.Data_manager.get_silent
— Methodget_silent()
This function returns the silent
flag.
Returns
silent
::Bool: The value of thesilent
variable.
PeriLab.Data_manager.get_synch_fields
— Methodget_synch_fields()
Get the fields to synchronize
PeriLab.Data_manager.has_key
— Methodhas_key(field_name::String)
Control if a key exists.
PeriLab.Data_manager.init_properties
— Methodinit_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.
PeriLab.Data_manager.initialize_data
— Methodinitialize_data()
Initialize all parameter in the datamanager and sets them to the default values.
PeriLab.Data_manager.loc_to_glob
— Methodloc_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
PeriLab.Data_manager.remove_active_model
— Methodremove_active_model(module_name::Module)
Removes main modules from OrderedDict.
Arguments
key::String
: Key of the entry.
PeriLab.Data_manager.set_accuracy_order
— Methodset_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
— Methodsetanisocritvalues(critvalues::Dict{Int64,Any})
Sets the anisotropic critical values globally.
Arguments
crit_values::Dict{Int64,Any}
: The critical values.
PeriLab.Data_manager.set_block_list
— Methodset_block_list(blocks::Union{SubArray,Vector{Int64}})
Sets the block list globally.
Arguments
blocks::Union{SubArray,Vector{Int64}}
: The block list.
PeriLab.Data_manager.set_cancel
— Methodset_cancel(value::Int64)
Sets the cancel flag.
Arguments
value::Bool
: The cancel flag.
PeriLab.Data_manager.set_comm
— Methodset_comm(comm::MPI.Comm)
Set the MPI communicator
Arguments
comm::MPI.Comm
: MPI communicator
PeriLab.Data_manager.set_coupling_dict
— Methodset_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_crit_values_matrix
— Methodset_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_damage_models
— Methodset_damage_models(value)
Sets the damage models globally.
Arguments
value
: The value to set as the damage models.
PeriLab.Data_manager.set_distribution
— Methodset_distribution(values::Vector{Int64})
Sets the distribution globally.
Arguments
values::Vector{Int64}
: The distribution.
PeriLab.Data_manager.set_dof
— Methodset_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
PeriLab.Data_manager.set_element_rotation
— Methodset_element_rotation(value::Int64)
Sets the element_rotation flag.
Arguments
value::Bool
: The element_rotation flag.
PeriLab.Data_manager.set_fem
— Methodset_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
PeriLab.Data_manager.set_glob_to_loc
— Methodset_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
PeriLab.Data_manager.set_inverse_nlist
— Methodset_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_local_synch
— Functionset_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_material_models
— Methodset_material_models(value)
Sets the material models globally.
Arguments
value
: The value to set as the material models.
PeriLab.Data_manager.set_max_rank
— Methodset_max_rank(value::Int64)
Sets the maximum rank globally.
Arguments
value::Int64
: The value to set as the maximum rank.
PeriLab.Data_manager.set_nnodes
— Methodset_nnodes()
Sets the number all nodes of one core globally.
Arguments
Example: ```
PeriLab.Data_manager.set_nnsets
— Methodset_nnsets(n::Int64)
Set the number of node sets.
Arguments
n::Int64
: The number of node sets to be set.
PeriLab.Data_manager.set_nset
— Methodset_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
— Methodset_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
PeriLab.Data_manager.set_num_responder
— Methodset_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
PeriLab.Data_manager.set_output_frequency
— Methodset_output_frequency(value)
Sets the output frequency globally.
Arguments
value
: The value to set as the output frequency.
PeriLab.Data_manager.set_overlap_map
— Methodset_overlap_map(topo)
Sets the overlap map globally.
Arguments
topo
: The overlap map.
PeriLab.Data_manager.set_pre_calculation_order
— Methodset_pre_calculation_order(values::Vector{String})
Sets the order of the pre calculation options globally.
Arguments
values::Vector{String}
: The order of models.
PeriLab.Data_manager.set_properties
— Methodset_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 specifiedproperty
.
PeriLab.Data_manager.set_properties
— Methodset_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 specifiedproperty
.
PeriLab.Data_manager.set_property
— Methodset_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 specifiedproperty
.value
::Any: The value to set for the specifiedvalue_name
.
PeriLab.Data_manager.set_rank
— Methodset_rank(value::Int64)
Sets the rank globally.
Arguments
value::Int64
: The value to set as the rank.
PeriLab.Data_manager.set_rotation
— Methodset_rotation(value::Int64)
Sets the rotation flag.
Arguments
value::Bool
: The rotation flag.
PeriLab.Data_manager.set_silent
— Methodset_silent(value::Int64)
Sets the silent flag.
Arguments
value::Bool
: The silent flag.
PeriLab.Data_manager.set_synch
— Functionset_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.switch_NP1_to_N
— Methodswitch_NP1_to_N()
Switches the fields from NP1 to N.active
PeriLab.Data_manager.synch_manager
— Methodsynch_manager(synchronise_field, direction::String)
Synchronises the fields.
Arguments
synchronise_field
: The function to synchronise the field.direction::String
: The direction of the synchronisation.