Skip to content
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
2 changes: 1 addition & 1 deletion Project.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name = "PeriLab"
uuid = "2ecefcea-59f0-46dd-9cfd-1d2b8cc5f112"
authors = ["Christian Willberg <christian.willberg@dlr.de>", "Jan-Timo Hesse <jan-timo.hesse@dlr.de>"]
version = "1.4.11"
version = "1.5.0"

[deps]
AbaqusReader = "bc6b9049-e460-56d6-94b4-a597b2c0390d"
Expand Down
10 changes: 4 additions & 6 deletions src/Compute/compute_field_values.jl
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,11 @@
#
# SPDX-License-Identifier: BSD-3-Clause

using .Helpers: find_active_nodes, get_active_update_nodes, add_in_place!
using ...Helpers: find_active_nodes, get_active_update_nodes, add_in_place!, invert
using StaticArrays: MMatrix, SMatrix
using .Helpers: invert
include("../Models/Material/Material_Basis.jl")
using .Material_Basis:
get_strain, get_Hooke_matrix,
compute_deviatoric_and_spherical_stresses
using ..Material_Basis:
get_strain, get_Hooke_matrix,
compute_deviatoric_and_spherical_stresses
"""
get_forces_from_force_density(datamanager::Module)

Expand Down
3 changes: 1 addition & 2 deletions src/Core/BC_manager.jl
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,8 @@ export init_BCs
export apply_bc_dirichlet
export apply_bc_neumann
export find_bc_free_dof
include("../Support/Parameters/parameter_handling.jl")

using .Parameter_Handling: get_bc_definitions
using ...Parameter_Handling: get_bc_definitions

"""
find_bc_free_dof(datamanager::Module, bcs::Dict{String,Any})
Expand Down
3 changes: 1 addition & 2 deletions src/Core/Data_manager.jl
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,7 @@
module Data_manager
using MPI
using DataStructures: OrderedDict
include("../Support/Helpers.jl")
using .Helpers: fill_in_place!
using ..Helpers: fill_in_place!

##########################
# Variables
Expand Down
4 changes: 2 additions & 2 deletions src/Core/Module_inclusion/set_Modules.jl
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
#
# SPDX-License-Identifier: BSD-3-Clause

module Set_modules
# module Set_modules
export include_files
export find_module_files

Expand Down Expand Up @@ -191,4 +191,4 @@ function create_module_specifics(name::Union{String,SubString},
return nothing
end

end
# end
39 changes: 18 additions & 21 deletions src/Core/Solver/Solver_control.jl
Original file line number Diff line number Diff line change
Expand Up @@ -3,31 +3,28 @@
# SPDX-License-Identifier: BSD-3-Clause

module Solver_control

include("../../Support/Parameters/parameter_handling.jl")
include("../../Support/Helpers.jl")
using .Parameter_Handling:
get_density,
get_horizon,
get_solver_name,
get_model_options,
get_fem_block,
get_calculation_options,
get_angles,
get_block_names_and_ids,
get_solver_params
using .Helpers: fastdot, check_inf_or_nan, get_block_nodes
using ..Parameter_Handling:
get_density,
get_horizon,
get_solver_name,
get_model_options,
get_fem_block,
get_calculation_options,
get_angles,
get_block_names_and_ids,
get_solver_params
using ..Helpers
include("../../Models/Material/Material_Basis.jl")
include("../../FEM/FEM_Factory.jl")
include("../../Models/Model_Factory.jl")
include("../BC_manager.jl")
include("Verlet.jl")
include("Static_solver.jl")
include("../BC_manager.jl")
include("../../MPI_communication/MPI_communication.jl")
using .MPI_communication: synch_responder_to_controller,
synch_controller_to_responder,
synch_controller_bonds_to_responder,
synch_controller_bonds_to_responder_flattened
using ..MPI_communication: synch_responder_to_controller,
synch_controller_to_responder,
synch_controller_bonds_to_responder,
synch_controller_bonds_to_responder_flattened

include("../../FEM/FEM_Factory.jl")
include("../Influence_function.jl")

using .Model_Factory: init_models, read_properties
Expand Down
37 changes: 14 additions & 23 deletions src/Core/Solver/Static_solver.jl
Original file line number Diff line number Diff line change
Expand Up @@ -12,27 +12,18 @@ using LoopVectorization
using PrettyTables
using Logging

include("../../Support/Helpers.jl")
using .Helpers: check_inf_or_nan, find_active_nodes, progress_bar
include("../../Support/Parameters/parameter_handling.jl")
using .Parameter_Handling:
get_initial_time,
get_fixed_dt,
get_final_time,
get_numerical_damping,
get_safety_factor,
get_max_damage

include("../../MPI_communication/MPI_communication.jl")
using .MPI_communication: barrier
include("../BC_manager.jl")
include("../../Models/Model_Factory.jl")
include("../../IO/logging.jl")
include("../../Compute/compute_field_values.jl")
using .Model_Factory
using .Boundary_conditions: apply_bc_dirichlet, apply_bc_neumann, find_bc_free_dof
using .Helpers: matrix_style
using .Logging_module: print_table
using ...Helpers: check_inf_or_nan, find_active_nodes, progress_bar, matrix_style
using ...Parameter_Handling:
get_initial_time,
get_fixed_dt,
get_final_time,
get_numerical_damping,
get_safety_factor,
get_max_damage
using ...MPI_communication: barrier
using ..Model_Factory
using ..Boundary_conditions: apply_bc_dirichlet, apply_bc_neumann, find_bc_free_dof
using ...Logging_module: print_table
export init_solver
export run_solver

Expand Down Expand Up @@ -157,7 +148,7 @@ function init_solver(solver_options::Dict{Any,Any},
start_u = datamanager.get_field("Start_Values")
end
check_inf_or_nan(start_u, "Start_Values")
Boundary_conditions.find_bc_free_dof(datamanager, bcs)
find_bc_free_dof(datamanager, bcs)

if datamanager.get_rank() == 0
data = ["Static Solver" "" "" ""
Expand Down Expand Up @@ -384,7 +375,7 @@ function residual!(residual,
datamanager.synch_manager(synchronise_field, "download_from_cores")
# synch

# @timeit to "apply_bc_neumann" datamanager = Boundary_conditions.apply_bc_neumann(bcs, datamanager, time) #-> von neumann
# @timeit to "apply_bc_neumann" datamanager = apply_bc_neumann(bcs, datamanager, time) #-> von neumann
#active_nodes = datamanager.get_field("Active Nodes")
#active_nodes = find_active_nodes(active_list, active_nodes, 1:datamanager.get_nnodes())

Expand Down
47 changes: 20 additions & 27 deletions src/Core/Solver/Verlet.jl
Original file line number Diff line number Diff line change
Expand Up @@ -11,27 +11,20 @@ using LoopVectorization
using PrettyTables
using Logging

include("../../Support/Helpers.jl")
using .Helpers: check_inf_or_nan, find_active_nodes, progress_bar
include("../../Support/Parameters/parameter_handling.jl")
using .Parameter_Handling:
get_initial_time,
get_fixed_dt,
get_final_time,
get_numerical_damping,
get_safety_factor,
get_max_damage

include("../../MPI_communication/MPI_communication.jl")
using .MPI_communication: find_and_set_core_value_min, find_and_set_core_value_max, barrier
include("../BC_manager.jl")
include("../../Models/Model_Factory.jl")
include("../../IO/logging.jl")
using ...Helpers#: check_inf_or_nan, find_active_nodes, progress_bar, matrix_style
using ...Parameter_Handling:
get_initial_time,
get_fixed_dt,
get_final_time,
get_numerical_damping,
get_safety_factor,
get_max_damage
using ...MPI_communication: find_and_set_core_value_min, find_and_set_core_value_max,
barrier
using ..Model_Factory: compute_models
using ..Boundary_conditions: apply_bc_dirichlet, apply_bc_neumann
using ...Logging_module: print_table
include("../../Compute/compute_field_values.jl")
using .Model_Factory
using .Boundary_conditions: apply_bc_dirichlet, apply_bc_neumann
using .Helpers: matrix_style
using .Logging_module: print_table
export init_solver
export run_solver

Expand Down Expand Up @@ -507,13 +500,13 @@ function run_solver(solver_options::Dict{Any,Any},
"upload_to_cores")
# synch

@timeit to "compute_models" datamanager=Model_Factory.compute_models(datamanager,
block_nodes,
dt,
time,
solver_options["Models"],
synchronise_field,
to)
@timeit to "compute_models" datamanager=compute_models(datamanager,
block_nodes,
dt,
time,
solver_options["Models"],
synchronise_field,
to)
# update the current active nodes; might have been changed by the additive models

if "Material" in solver_options["Models"]
Expand Down
22 changes: 10 additions & 12 deletions src/FEM/Coupling/Arlequin_coupling.jl
Original file line number Diff line number Diff line change
Expand Up @@ -4,21 +4,19 @@

module Arlequin_coupling
include("../Element_formulation/Lagrange_element.jl")
include("../FEM_routines.jl")
using .Lagrange_element:
define_lagrangian_grid_space,
get_recursive_lagrange_shape_functions
using .FEM_routines: get_polynomial_degree
include("../../Support/Helpers.jl")
using .Helpers:
find_active_nodes,
find_point_in_polygon,
find_point_in_hexagon,
get_ring,
get_hexagon,
create_centroid_and_search_radius,
get_nearest_neighbors,
find_point_in_element
using ...FEM_routines: get_polynomial_degree
using ......Helpers:
find_active_nodes,
find_point_in_polygon,
find_point_in_hexagon,
get_ring,
get_hexagon,
create_centroid_and_search_radius,
get_nearest_neighbors,
find_point_in_element
using LinearAlgebra

export coupling_name
Expand Down
8 changes: 4 additions & 4 deletions src/FEM/Coupling/Coupling_Factory.jl
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@

module Coupling_PD_FEM
include("../../Core/Module_inclusion/set_Modules.jl")
using .Set_modules
global module_list = Set_modules.find_module_files(@__DIR__, "coupling_name")
Set_modules.include_files(module_list)
# using .Set_modules
global module_list = find_module_files(@__DIR__, "coupling_name")
include_files(module_list)

export init_coupling
export compute_coupling
Expand All @@ -22,7 +22,7 @@ function init_coupling(datamanager::Module, nodes, complete_params::Dict)
end
coupling_model = complete_params["FEM"]["Coupling"]["Coupling Type"]

mod = Set_modules.create_module_specifics(coupling_model, module_list, "coupling_name")
mod = create_module_specifics(coupling_model, module_list, "coupling_name")
if isnothing(mod)
@error "No material of name " * material_model * " exists."
end
Expand Down
55 changes: 36 additions & 19 deletions src/FEM/FEM_Factory.jl
Original file line number Diff line number Diff line change
Expand Up @@ -17,15 +17,16 @@ include("./Coupling/Coupling_Factory.jl")

# in future using set modules for material
# test case is correspondence material
include("./../Models/Material/Material_Models/Correspondence/Correspondence_Elastic.jl")
using .Correspondence_Elastic
using ...Helpers: fast_mul!, get_mapping
using ..Material_Basis: get_Hooke_matrix
# using .Correspondence_Elastic
using .Coupling_PD_FEM
using .Set_modules
# using .Set_modules
export init_FEM
export eval_FEM

global module_list = Set_modules.find_module_files(@__DIR__, "element_name")
Set_modules.include_files(module_list)
global module_list = find_module_files(@__DIR__, "element_name")
include_files(module_list)

function init_FEM(complete_params::Dict, datamanager::Module)
if !haskey(complete_params, "FEM")
Expand Down Expand Up @@ -93,18 +94,18 @@ function init_FEM(complete_params::Dict, datamanager::Module)
N[:],
B_elem = create_element_matrices(dof,
p,
Set_modules.create_module_specifics(params["Element Type"],
module_list,
specifics))
create_module_specifics(params["Element Type"],
module_list,
specifics))
if isnothing(N) || isnothing(B_matrix)
return nothing
end
specifics = Dict{String,String}("Call Function" => "init_element",
"Name" => "element_name")
datamanager = Set_modules.create_module_specifics(params["Element Type"],
module_list,
specifics,
(datamanager, elements, params, p))
datamanager = create_module_specifics(params["Element Type"],
module_list,
specifics,
(datamanager, elements, params, p))

elements = Vector{Int64}(1:nelements)
topology = datamanager.get_field("FE Topology")
Expand Down Expand Up @@ -153,16 +154,32 @@ function valid_models(params::Dict)
if !haskey(params, "Material Model")
@error "No material model has been defined for FEM in the block."
return nothing
else
# in future -> FE support -> check with set modules
if !Correspondence_Elastic.fe_support()
@error "No FEM support for " * params["Material Model"]
return nothing
end
# else
# # in future -> FE support -> check with set modules
# if !Correspondence_Elastic.fe_support()
# @error "No FEM support for " * params["Material Model"]
# return nothing
# end
end
return true
end

function compute_stresses(datamanager::Module,
dof::Int64,
material_parameter::Dict,
time::Float64,
dt::Float64,
strain_increment::Vector{Float64},
stress_N::Vector{Float64},
stress_NP1::Vector{Float64})
hookeMatrix = get_Hooke_matrix(datamanager,
material_parameter,
material_parameter["Symmetry"],
dof)

return hookeMatrix * strain_increment + stress_N, datamanager
end

function eval_FEM(datamanager::Module,
elements::AbstractVector{Int64},
params::Dict{String,Any},
Expand All @@ -171,7 +188,7 @@ function eval_FEM(datamanager::Module,
return compute_FEM(datamanager,
elements,
params,
Correspondence_Elastic.compute_stresses,
compute_stresses,
time,
dt)
end
Expand Down
5 changes: 1 addition & 4 deletions src/FEM/FEM_routines.jl
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,7 @@ using LinearAlgebra
using StaticArrays
using FastGaussQuadrature
using Statistics
include("../Models/Material/Material_Basis.jl")
using .Material_Basis: voigt_to_matrix
include("../Support/Helpers.jl")
using .Helpers: invert, determinant
using ....Helpers: invert, determinant, voigt_to_matrix
function get_FE_material_model(params::Dict{String,Any}, name::String)
if !haskey(params["Material Models"], params["FEM"][name]["Material Model"])
@error "Material model " *
Expand Down
Loading