diff --git a/examples/FEM_Bar/FEM_p1_2d_coupled.yaml b/examples/FEM_Bar/FEM_p1_2d_coupled.yaml index 40878f86..94f3c7d1 100644 --- a/examples/FEM_Bar/FEM_p1_2d_coupled.yaml +++ b/examples/FEM_Bar/FEM_p1_2d_coupled.yaml @@ -16,6 +16,9 @@ PeriLab: Element Type: "Lagrange" Degree: 1 Material Model: "Mat_1" + Coupling: + Coupling Type: "Arlequin" + PD Weight: 0.5 # standard is 0.5 Models: Material Models: Mat_1: @@ -49,16 +52,16 @@ PeriLab: Type: Dirichlet Solver: Initial Time: 0.0 - Final Time: 1e-04 + Final Time: 2e-04 Verlet: Safety Factor: 1.00 Numerical Damping: 1e-05 - Fixed dt: 5e-9 + Fixed dt: 1e-9 Outputs: Output1: Output Filename: "FEM_p1_2d_coupled" Output File Type: Exodus - Output Frequency: 100 + Output Frequency: 500 Output Variables: Cauchy Stress: True Displacements: True diff --git a/src/FEM/Coupling/Arlequin_coupling.jl b/src/FEM/Coupling/Arlequin_coupling.jl index 7320400c..59e3c539 100644 --- a/src/FEM/Coupling/Arlequin_coupling.jl +++ b/src/FEM/Coupling/Arlequin_coupling.jl @@ -175,7 +175,7 @@ function compute_coupling_matrix( I = ones(1, 1) Np = [N1p N2p N3p N4p] - local_coupl_matrix = kappa * [I -Np; -Np' Np'*Np] + local_coupl_matrix = kappa * [I Np; Np' Np'*Np] return local_coupl_matrix end diff --git a/src/Models/Model_Factory.jl b/src/Models/Model_Factory.jl index 2ad97152..df1360e4 100644 --- a/src/Models/Model_Factory.jl +++ b/src/Models/Model_Factory.jl @@ -148,17 +148,7 @@ function compute_models( ) fem_option = datamanager.fem_active() if fem_option - # no damage occur here. Therefore, it runs one time fe_nodes = datamanager.get_field("FE Nodes") - nelements = datamanager.get_num_elements() - # in future the FE analysis can be put into the block loop. Right now it is outside the block. - @timeit to "FEM eval" datamanager = FEM.eval( - datamanager, - Vector{Int64}(1:nelements), - datamanager.get_properties(1, "FEM"), - time, - dt, - ) end active_list = datamanager.get_field("Active") @@ -284,14 +274,24 @@ function compute_models( end if fem_option + @timeit to "FEM" begin + nelements = datamanager.get_num_elements() + active_nodes = + find_active_nodes(fe_nodes, active_nodes, 1:datamanager.get_nnodes(), false) - active_nodes = - find_active_nodes(fe_nodes, active_nodes, 1:datamanager.get_nnodes(), false) - @timeit to "FEM_PD_coupling" datamanager = FEM.Coupling_PD_FEM.compute_coupling( - datamanager, - active_nodes, - datamanager.get_properties(1, "FEM"), - ) + @timeit to "eval" datamanager = FEM.eval( + datamanager, + Vector{Int64}(1:nelements), + datamanager.get_properties(1, "FEM"), + time, + dt, + ) + @timeit to "coupling" datamanager = FEM.Coupling_PD_FEM.compute_coupling( + datamanager, + active_nodes, + datamanager.get_properties(1, "FEM"), + ) + end end #= diff --git a/test/fullscale_tests/test_DCB/Reference/DCBmodel_unified_bb.e b/test/fullscale_tests/test_DCB/Reference/DCBmodel_unified_bb.e index 2e110cc9..dc9037d1 100644 Binary files a/test/fullscale_tests/test_DCB/Reference/DCBmodel_unified_bb.e and b/test/fullscale_tests/test_DCB/Reference/DCBmodel_unified_bb.e differ diff --git a/test/fullscale_tests/test_DCB/test_DCB.jl b/test/fullscale_tests/test_DCB/test_DCB.jl index 3c8453fe..87812f3f 100644 --- a/test/fullscale_tests/test_DCB/test_DCB.jl +++ b/test/fullscale_tests/test_DCB/test_DCB.jl @@ -6,6 +6,7 @@ folder_name = basename(@__FILE__)[1:end-3] cd("fullscale_tests/" * folder_name) do + run_perilab("DCBmodel_unified_bb", 1, true, folder_name) run_perilab("DCBmodel_correspondence", 1, true, folder_name) # run_perilab("DCBmodel_UMAT", 1, true, folder_name) run_perilab("DCBmodel_PD_solid", 1, true, folder_name) diff --git a/test/runtests.jl b/test/runtests.jl index 5a122cda..d6e5d99c 100644 --- a/test/runtests.jl +++ b/test/runtests.jl @@ -293,8 +293,11 @@ MPI.Init() @testset "test_point_wise_material" begin include("fullscale_tests/test_point_wise_material/test_point_wise_material.jl") end + @testset "test_FEM_coupling" begin + # include("fullscale_tests/test_FEM_coupling/test_FEM_coupling.jl") + end @testset "test_FEM" begin - include("fullscale_tests/test_FEM_coupling/test_FEM_coupling.jl") + include("fullscale_tests/test_FEM/test_FEM.jl") end end diff --git a/test/unit_tests/Compute/ut_compute_field_values.jl b/test/unit_tests/Compute/ut_compute_field_values.jl index c59a7c11..423c2a83 100644 --- a/test/unit_tests/Compute/ut_compute_field_values.jl +++ b/test/unit_tests/Compute/ut_compute_field_values.jl @@ -4,6 +4,7 @@ using Test # include("../../../src/Core/Data_manager.jl") +include("../../../src/Support/Helpers.jl") include("../../../src/Compute/compute_field_values.jl") @testset "ut_get_forces_from_force_density" begin test_data_manager = PeriLab.Data_manager diff --git a/test/unit_tests/FEM/ut_FEM_routines.jl b/test/unit_tests/FEM/ut_FEM_routines.jl index eb5ebffc..188073c8 100644 --- a/test/unit_tests/FEM/ut_FEM_routines.jl +++ b/test/unit_tests/FEM/ut_FEM_routines.jl @@ -2,9 +2,17 @@ # # SPDX-License-Identifier: BSD-3-Clause include("../../../src/FEM/FEM_routines.jl") -include("../../../src/FEM/Element_formulation/lagrange_element.jl") # include("../../../src/PeriLab.jl") - +using .FEM_routines: + create_element_matrices, + get_Jacobian, + get_polynomial_degree, + get_number_of_integration_points, + create_element_matrices, + get_lumped_mass, + get_weights_and_integration_points, + get_multi_dimensional_integration_point_data, + get_FE_material_model # using .PeriLab using Test