Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Performance/new data manager #203

Merged
merged 6 commits into from
Oct 1, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 12 additions & 12 deletions src/Compute/compute_global_values.jl
Original file line number Diff line number Diff line change
Expand Up @@ -97,19 +97,19 @@ function calculate_block(
end

"""
global_value_sum(field::SubArray, dof::Union{Int64,Vector{Int64}}, nodes::Union{SubArray,Vector{Int64}})
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::SubArray`: Field.
- `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.
"""
function global_value_sum(
field::SubArray,
field::Union{Vector{Float64},Matrix{Float64},Array{Float64,3}},
dof::Union{Int64,Vector{Int64}},
nodes::Union{SubArray,Vector{Int64}},
)
Expand All @@ -122,19 +122,19 @@ function global_value_sum(
end

"""
global_value_max(field::SubArray, dof::Union{Int64,Vector{Int64}}, nodes::Union{SubArray,Vector{Int64}})
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::SubArray`: Field.
- `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.
"""
function global_value_max(
field::SubArray,
field::Union{Vector{Float64},Matrix{Float64}},
dof::Union{Int64,Vector{Int64}},
nodes::Union{SubArray,Vector{Int64}},
)
Expand All @@ -143,19 +143,19 @@ function global_value_max(
end

"""
global_value_min(field::SubArray, dof::Union{Int64,Vector{Int64}}, nodes::Union{SubArray,Vector{Int64}})
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::SubArray`: Field.
- `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.
"""
function global_value_min(
field::SubArray,
field::Union{Vector{Float64},Matrix{Float64}},
dof::Union{Int64,Vector{Int64}},
nodes::Union{SubArray,Vector{Int64}},
)
Expand All @@ -164,19 +164,19 @@ function global_value_min(
end

"""
global_value_avg(field::SubArray, dof::Union{Int64,Vector{Int64}}, nodes::Union{SubArray,Vector{Int64}})
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::SubArray`: Field.
- `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.
"""
function global_value_avg(
field::SubArray,
field::Union{Vector{Float64},Matrix{Float64}},
dof::Union{Int64,Vector{Int64}},
nodes::Union{SubArray,Vector{Int64}},
)
Expand Down
24 changes: 12 additions & 12 deletions src/Core/Solver/Solver_control.jl
Original file line number Diff line number Diff line change
Expand Up @@ -134,56 +134,56 @@ function get_block_nodes(block_ids, nnodes)
end

"""
set_density(params::Dict, block_nodes::Dict, density::SubArray)
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::SubArray`: The density
- `density::Vector{Float64}`: The density
# Returns
- `density::SubArray`: The density
- `density::Vector{Float64}`: The density
"""
function set_density(params::Dict, block_nodes::Dict, density::SubArray)
function set_density(params::Dict, block_nodes::Dict, density::Vector{Float64})
for block in eachindex(block_nodes)
density[block_nodes[block]] .= get_density(params, block)
end
return density
end

"""
set_fem_block(params::Dict, block_nodes::Dict, fem_block::SubArray)
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::SubArray`: The fem_block
- `fem_block::Vector{Bool}`: The fem_block
# Returns
- `fem_block::SubArray`: The fem_block
- `fem_block::Vector{Bool}`: The fem_block
"""
function set_fem_block(params::Dict, block_nodes::Dict, fem_block::SubArray)
function set_fem_block(params::Dict, block_nodes::Dict, fem_block::Vector{Bool})
for block in eachindex(block_nodes)
fem_block[block_nodes[block]] .= get_fem_block(params, block)
end
return fem_block
end

"""
set_horizon(params::Dict, block_nodes::Dict, horizon::SubArray)
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::SubArray`: The horizon
- `horizon::Vector{Float64}`: The horizon
# Returns
- `horizon::SubArray`: The horizon
- `horizon::Vector{Float64}`: The horizon
"""
function set_horizon(params::Dict, block_nodes::Dict, horizon::SubArray)
function set_horizon(params::Dict, block_nodes::Dict, horizon::Vector{Float64})
for block in eachindex(block_nodes)
horizon[block_nodes[block]] .= get_horizon(params, block)
end
Expand Down
Loading