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_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