diff --git a/examples/ahead/nonoverlap/clamped/dynamic/clamped-1.yaml b/examples/ahead/nonoverlap/clamped/dynamic/clamped-1.yaml index 1ffb31c..0b32045 100644 --- a/examples/ahead/nonoverlap/clamped/dynamic/clamped-1.yaml +++ b/examples/ahead/nonoverlap/clamped/dynamic/clamped-1.yaml @@ -37,12 +37,11 @@ boundary conditions: - node set: nsz- component: z function: "0.0" - Schwarz coupling: + Schwarz nonoverlap: - side set: ssz+ source: clamped-2.yaml source block: fine source side set: ssz- - coupling type: nonoverlap solver: type: Hessian minimizer step: full Newton diff --git a/examples/ahead/nonoverlap/clamped/dynamic/clamped-2.yaml b/examples/ahead/nonoverlap/clamped/dynamic/clamped-2.yaml index 2268aea..60404bb 100644 --- a/examples/ahead/nonoverlap/clamped/dynamic/clamped-2.yaml +++ b/examples/ahead/nonoverlap/clamped/dynamic/clamped-2.yaml @@ -37,12 +37,11 @@ boundary conditions: - node set: nsz+ component: z function: "0.0" - Schwarz coupling: + Schwarz nonoverlap: - side set: ssz- source: clamped-1.yaml source block: coarse source side set: ssz+ - coupling type: nonoverlap solver: type: Hessian minimizer step: full Newton diff --git a/examples/ahead/nonoverlap/cuboid/quasistatic/cuboid-1.yaml b/examples/ahead/nonoverlap/cuboid/quasistatic/cuboid-1.yaml index 22e242e..30309e7 100644 --- a/examples/ahead/nonoverlap/cuboid/quasistatic/cuboid-1.yaml +++ b/examples/ahead/nonoverlap/cuboid/quasistatic/cuboid-1.yaml @@ -24,12 +24,11 @@ boundary conditions: - node set: nsz- component: z function: "0.0" - Schwarz coupling: + Schwarz nonoverlap: - side set: ssz+ source: cuboid-2.yaml source block: coarse source side set: ssz- - coupling type: nonoverlap solver: type: Hessian minimizer step: full Newton diff --git a/examples/ahead/nonoverlap/cuboid/quasistatic/cuboid-2.yaml b/examples/ahead/nonoverlap/cuboid/quasistatic/cuboid-2.yaml index 7790780..1e6aee0 100644 --- a/examples/ahead/nonoverlap/cuboid/quasistatic/cuboid-2.yaml +++ b/examples/ahead/nonoverlap/cuboid/quasistatic/cuboid-2.yaml @@ -24,12 +24,11 @@ boundary conditions: - node set: nsz+ component: z function: "1.0 * t" - Schwarz coupling: + Schwarz nonoverlap: - side set: ssz- source: cuboid-1.yaml source block: fine source side set: ssz+ - coupling type: nonoverlap solver: solver: type: Hessian minimizer diff --git a/examples/ahead/nonoverlap/laser-weld/quasistatic/gauge.yaml b/examples/ahead/nonoverlap/laser-weld/quasistatic/gauge.yaml index 1fd7877..f69e4b9 100644 --- a/examples/ahead/nonoverlap/laser-weld/quasistatic/gauge.yaml +++ b/examples/ahead/nonoverlap/laser-weld/quasistatic/gauge.yaml @@ -16,19 +16,17 @@ model: time integrator: type: quasi static boundary conditions: - Schwarz coupling: + Schwarz nonoverlap: - side set: sideset_negative_y source: holder-0.yaml source block: holder_0 source side set: sideset_positive_y search tolerance: 5.0e-02 - coupling type: nonoverlap - side set: sideset_positive_y source: holder-1.yaml source block: holder_1 source side set: sideset_negative_y search tolerance: 5.0e-02 - coupling type: nonoverlap solver: type: Hessian minimizer step: full Newton diff --git a/examples/ahead/nonoverlap/laser-weld/quasistatic/holder-0.yaml b/examples/ahead/nonoverlap/laser-weld/quasistatic/holder-0.yaml index 7a817c5..b759a8c 100644 --- a/examples/ahead/nonoverlap/laser-weld/quasistatic/holder-0.yaml +++ b/examples/ahead/nonoverlap/laser-weld/quasistatic/holder-0.yaml @@ -24,13 +24,12 @@ boundary conditions: - node set: nodeset_negative_y component: z function: "0.0" - Schwarz coupling: + Schwarz nonoverlap: - side set: sideset_positive_y source: gauge.yaml source block: region_weld_0 source side set: sideset_negative_y search tolerance: 5.0e-02 - coupling type: nonoverlap solver: type: Hessian minimizer step: full Newton diff --git a/examples/ahead/nonoverlap/laser-weld/quasistatic/holder-1.yaml b/examples/ahead/nonoverlap/laser-weld/quasistatic/holder-1.yaml index b0c61d4..8cdeda2 100644 --- a/examples/ahead/nonoverlap/laser-weld/quasistatic/holder-1.yaml +++ b/examples/ahead/nonoverlap/laser-weld/quasistatic/holder-1.yaml @@ -24,13 +24,12 @@ boundary conditions: - node set: nodeset_positive_y component: z function: "0.0" - Schwarz coupling: + Schwarz nonoverlap: - side set: sideset_negative_y source: gauge.yaml source block: region_weld_1 source side set: sideset_positive_y search tolerance: 5.0e-02 - coupling type: nonoverlap solver: type: Hessian minimizer step: full Newton diff --git a/examples/ahead/nonoverlap/notched-cylinder/dynamic/notched-cylinder-1.yaml b/examples/ahead/nonoverlap/notched-cylinder/dynamic/notched-cylinder-1.yaml index 1293dc2..f7f7c21 100644 --- a/examples/ahead/nonoverlap/notched-cylinder/dynamic/notched-cylinder-1.yaml +++ b/examples/ahead/nonoverlap/notched-cylinder/dynamic/notched-cylinder-1.yaml @@ -26,13 +26,12 @@ boundary conditions: - node set: -Z_bottom component: z function: "0.0" - Schwarz coupling: + Schwarz nonoverlap: - side set: +Z_bottomSS source: notched-cylinder-2.yaml source block: coarse source side set: -Z_topSS search tolerance: 5.0e-02 - coupling type: overlap solver: type: Hessian minimizer step: full Newton diff --git a/examples/ahead/nonoverlap/notched-cylinder/dynamic/notched-cylinder-2.yaml b/examples/ahead/nonoverlap/notched-cylinder/dynamic/notched-cylinder-2.yaml index 6360850..e7040bf 100644 --- a/examples/ahead/nonoverlap/notched-cylinder/dynamic/notched-cylinder-2.yaml +++ b/examples/ahead/nonoverlap/notched-cylinder/dynamic/notched-cylinder-2.yaml @@ -26,12 +26,11 @@ boundary conditions: - node set: +Z_top component: z function: "0.0064 * t" - Schwarz coupling: + Schwarz nonoverlap: - side set: -Z_topSS source: notched-cylinder-1.yaml source side set: +Z_bottomSS source block: fine - coupling type: overlap solver: type: Hessian minimizer step: full Newton diff --git a/examples/ahead/nonoverlap/notched-cylinder/quasistatic/notched-cylinder-1.yaml b/examples/ahead/nonoverlap/notched-cylinder/quasistatic/notched-cylinder-1.yaml index 9d36b30..25b99cd 100644 --- a/examples/ahead/nonoverlap/notched-cylinder/quasistatic/notched-cylinder-1.yaml +++ b/examples/ahead/nonoverlap/notched-cylinder/quasistatic/notched-cylinder-1.yaml @@ -24,13 +24,12 @@ boundary conditions: - node set: -Z_bottom component: z function: "0.0" - Schwarz coupling: + Schwarz nonoverlap: - side set: +Z_bottomSS source: notched-cylinder-2.yaml source block: coarse source side set: -Z_topSS search tolerance: 5.0e-02 - coupling type: nonoverlap solver: type: Hessian minimizer step: full Newton diff --git a/examples/ahead/nonoverlap/notched-cylinder/quasistatic/notched-cylinder-2.yaml b/examples/ahead/nonoverlap/notched-cylinder/quasistatic/notched-cylinder-2.yaml index 0eb3018..73444ea 100644 --- a/examples/ahead/nonoverlap/notched-cylinder/quasistatic/notched-cylinder-2.yaml +++ b/examples/ahead/nonoverlap/notched-cylinder/quasistatic/notched-cylinder-2.yaml @@ -24,12 +24,11 @@ boundary conditions: - node set: +Z_top component: z function: "0.0064 * t" - Schwarz coupling: + Schwarz nonoverlap: - side set: -Z_topSS source: notched-cylinder-1.yaml source side set: +Z_bottomSS source block: fine - coupling type: nonoverlap solver: type: Hessian minimizer step: full Newton diff --git a/examples/ahead/overlap/clamped/dynamic/clamped-1.yaml b/examples/ahead/overlap/clamped/dynamic/clamped-1.yaml index 8e51824..a2288f1 100644 --- a/examples/ahead/overlap/clamped/dynamic/clamped-1.yaml +++ b/examples/ahead/overlap/clamped/dynamic/clamped-1.yaml @@ -37,12 +37,11 @@ boundary conditions: - node set: nsz- component: z function: "0.0" - Schwarz coupling: + Schwarz overlap: - side set: ssz+ source: clamped-2.yaml source block: fine source side set: ssz- - coupling type: overlap solver: type: Hessian minimizer step: full Newton diff --git a/examples/ahead/overlap/clamped/dynamic/clamped-2.yaml b/examples/ahead/overlap/clamped/dynamic/clamped-2.yaml index 6eefe16..5e4955a 100644 --- a/examples/ahead/overlap/clamped/dynamic/clamped-2.yaml +++ b/examples/ahead/overlap/clamped/dynamic/clamped-2.yaml @@ -37,12 +37,11 @@ boundary conditions: - node set: nsz+ component: z function: "0.0" - Schwarz coupling: + Schwarz overlap: - side set: ssz- source: clamped-1.yaml source block: coarse source side set: ssz+ - coupling type: overlap solver: type: Hessian minimizer step: full Newton diff --git a/examples/ahead/overlap/cuboid/dynamic/cuboid-1.yaml b/examples/ahead/overlap/cuboid/dynamic/cuboid-1.yaml index b3e035d..d765502 100644 --- a/examples/ahead/overlap/cuboid/dynamic/cuboid-1.yaml +++ b/examples/ahead/overlap/cuboid/dynamic/cuboid-1.yaml @@ -26,12 +26,11 @@ boundary conditions: - node set: nsz- component: z function: "0.0" - Schwarz coupling: + Schwarz overlap: - side set: ssz+ source: cuboid-2.yaml source block: coarse source side set: ssz- - coupling type: overlap solver: type: Hessian minimizer step: full Newton diff --git a/examples/ahead/overlap/cuboid/dynamic/cuboid-2.yaml b/examples/ahead/overlap/cuboid/dynamic/cuboid-2.yaml index 30adb66..65ad1a3 100644 --- a/examples/ahead/overlap/cuboid/dynamic/cuboid-2.yaml +++ b/examples/ahead/overlap/cuboid/dynamic/cuboid-2.yaml @@ -26,12 +26,11 @@ boundary conditions: - node set: nsz+ component: z function: "1.0 * t" - Schwarz coupling: + Schwarz overlap: - side set: ssz- source: cuboid-1.yaml source block: fine source side set: ssz+ - coupling type: overlap solver: type: Hessian minimizer step: full Newton diff --git a/examples/ahead/overlap/cuboid/quasistatic/cuboid-1.yaml b/examples/ahead/overlap/cuboid/quasistatic/cuboid-1.yaml index b26efe2..45a2dc9 100644 --- a/examples/ahead/overlap/cuboid/quasistatic/cuboid-1.yaml +++ b/examples/ahead/overlap/cuboid/quasistatic/cuboid-1.yaml @@ -24,12 +24,11 @@ boundary conditions: - node set: nsz- component: z function: "0.0" - Schwarz coupling: + Schwarz overlap: - side set: ssz+ source: cuboid-2.yaml source block: coarse source side set: ssz- - coupling type: overlap solver: type: Hessian minimizer step: full Newton diff --git a/examples/ahead/overlap/cuboid/quasistatic/cuboid-2.yaml b/examples/ahead/overlap/cuboid/quasistatic/cuboid-2.yaml index 309a3d4..51932a0 100644 --- a/examples/ahead/overlap/cuboid/quasistatic/cuboid-2.yaml +++ b/examples/ahead/overlap/cuboid/quasistatic/cuboid-2.yaml @@ -24,12 +24,11 @@ boundary conditions: - node set: nsz+ component: z function: "1.0 * t" - Schwarz coupling: + Schwarz overlap: - side set: ssz- source: cuboid-1.yaml source block: fine source side set: ssz+ - coupling type: overlap solver: solver: type: Hessian minimizer diff --git a/examples/ahead/overlap/laser-weld/dynamic/gauge.yaml b/examples/ahead/overlap/laser-weld/dynamic/gauge.yaml index d3e8037..dc2cd53 100644 --- a/examples/ahead/overlap/laser-weld/dynamic/gauge.yaml +++ b/examples/ahead/overlap/laser-weld/dynamic/gauge.yaml @@ -22,17 +22,15 @@ boundary conditions: - node set: nodeset_symmetry component: x function: "0.0" - Schwarz coupling: + Schwarz overlap: - side set: sideset_negative_y source: holder-0.yaml source block: holder_0 source side set: sideset_positive_y - coupling type: overlap - side set: sideset_positive_y source: holder-1.yaml source block: holder_1 source side set: sideset_negative_y - coupling type: overlap solver: type: Hessian minimizer step: full Newton diff --git a/examples/ahead/overlap/laser-weld/dynamic/holder-0.yaml b/examples/ahead/overlap/laser-weld/dynamic/holder-0.yaml index 791d8de..83c1d05 100644 --- a/examples/ahead/overlap/laser-weld/dynamic/holder-0.yaml +++ b/examples/ahead/overlap/laser-weld/dynamic/holder-0.yaml @@ -26,12 +26,11 @@ boundary conditions: - node set: nodeset_negative_y component: z function: "0.0" - Schwarz coupling: + Schwarz overlap: - side set: sideset_positive_y source: gauge.yaml source block: region_weld_0 source side set: sideset_negative_y - coupling type: overlap solver: type: Hessian minimizer step: full Newton diff --git a/examples/ahead/overlap/laser-weld/dynamic/holder-1.yaml b/examples/ahead/overlap/laser-weld/dynamic/holder-1.yaml index 9a3ee78..6b034b9 100644 --- a/examples/ahead/overlap/laser-weld/dynamic/holder-1.yaml +++ b/examples/ahead/overlap/laser-weld/dynamic/holder-1.yaml @@ -23,12 +23,11 @@ boundary conditions: - node set: nodeset_positive_y component: y function: "0.1 * t" - Schwarz coupling: + Schwarz overlap: - side set: sideset_negative_y source: gauge.yaml source block: region_weld_1 source side set: sideset_positive_y - coupling type: overlap solver: type: Hessian minimizer step: full Newton diff --git a/examples/ahead/overlap/laser-weld/quasistatic/gauge.yaml b/examples/ahead/overlap/laser-weld/quasistatic/gauge.yaml index dff62f8..52dd72d 100644 --- a/examples/ahead/overlap/laser-weld/quasistatic/gauge.yaml +++ b/examples/ahead/overlap/laser-weld/quasistatic/gauge.yaml @@ -16,17 +16,15 @@ model: time integrator: type: quasi static boundary conditions: - Schwarz coupling: + Schwarz overlap: - side set: sideset_negative_y source: holder-0.yaml source block: holder_0 source side set: sideset_positive_y - coupling type: overlap - side set: sideset_positive_y source: holder-1.yaml source block: holder_1 source side set: sideset_negative_y - coupling type: overlap solver: type: Hessian minimizer step: full Newton diff --git a/examples/ahead/overlap/laser-weld/quasistatic/holder-0.yaml b/examples/ahead/overlap/laser-weld/quasistatic/holder-0.yaml index 26fd1f7..22f7db6 100644 --- a/examples/ahead/overlap/laser-weld/quasistatic/holder-0.yaml +++ b/examples/ahead/overlap/laser-weld/quasistatic/holder-0.yaml @@ -24,12 +24,11 @@ boundary conditions: - node set: nodeset_negative_y component: z function: "0.0" - Schwarz coupling: + Schwarz overlap: - side set: sideset_positive_y source: gauge.yaml source block: region_weld_0 source side set: sideset_negative_y - coupling type: overlap solver: type: Hessian minimizer step: full Newton diff --git a/examples/ahead/overlap/laser-weld/quasistatic/holder-1.yaml b/examples/ahead/overlap/laser-weld/quasistatic/holder-1.yaml index 98679b7..69b0f8f 100644 --- a/examples/ahead/overlap/laser-weld/quasistatic/holder-1.yaml +++ b/examples/ahead/overlap/laser-weld/quasistatic/holder-1.yaml @@ -24,12 +24,11 @@ boundary conditions: - node set: nodeset_positive_y component: z function: "0.0" - Schwarz coupling: + Schwarz overlap: - side set: sideset_negative_y source: gauge.yaml source block: region_weld_1 source side set: sideset_positive_y - coupling type: overlap solver: type: Hessian minimizer step: full Newton diff --git a/examples/ahead/overlap/notched-cylinder/dynamic/notched-cylinder-1.yaml b/examples/ahead/overlap/notched-cylinder/dynamic/notched-cylinder-1.yaml index 0235354..ab6028b 100644 --- a/examples/ahead/overlap/notched-cylinder/dynamic/notched-cylinder-1.yaml +++ b/examples/ahead/overlap/notched-cylinder/dynamic/notched-cylinder-1.yaml @@ -26,13 +26,12 @@ boundary conditions: - node set: -Z_bottom component: z function: "0.0" - Schwarz coupling: + Schwarz overlap: - side set: +Z_bottomSS source: notched-cylinder-2.yaml source block: coarse source side set: -Z_topSS search tolerance: 5.0e-02 - coupling type: overlap solver: type: Hessian minimizer step: full Newton diff --git a/examples/ahead/overlap/notched-cylinder/dynamic/notched-cylinder-2.yaml b/examples/ahead/overlap/notched-cylinder/dynamic/notched-cylinder-2.yaml index 0e3098b..37b76b8 100644 --- a/examples/ahead/overlap/notched-cylinder/dynamic/notched-cylinder-2.yaml +++ b/examples/ahead/overlap/notched-cylinder/dynamic/notched-cylinder-2.yaml @@ -26,12 +26,11 @@ boundary conditions: - node set: +Z_top component: z function: "0.0064 * t" - Schwarz coupling: + Schwarz overlap: - side set: -Z_topSS source: notched-cylinder-1.yaml source side set: +Z_bottomSS source block: fine - coupling type: overlap solver: type: Hessian minimizer step: full Newton diff --git a/examples/ahead/overlap/notched-cylinder/quasistatic/notched-cylinder-1.yaml b/examples/ahead/overlap/notched-cylinder/quasistatic/notched-cylinder-1.yaml index 4e9ea8c..7d48796 100644 --- a/examples/ahead/overlap/notched-cylinder/quasistatic/notched-cylinder-1.yaml +++ b/examples/ahead/overlap/notched-cylinder/quasistatic/notched-cylinder-1.yaml @@ -24,13 +24,12 @@ boundary conditions: - node set: -Z_bottom component: z function: "0.0" - Schwarz coupling: + Schwarz overlap: - side set: +Z_bottomSS source: notched-cylinder-2.yaml source block: coarse source side set: -Z_topSS search tolerance: 5.0e-02 - coupling type: overlap solver: type: Hessian minimizer step: full Newton diff --git a/examples/ahead/overlap/notched-cylinder/quasistatic/notched-cylinder-2.yaml b/examples/ahead/overlap/notched-cylinder/quasistatic/notched-cylinder-2.yaml index b6b7a89..5e7e8d5 100644 --- a/examples/ahead/overlap/notched-cylinder/quasistatic/notched-cylinder-2.yaml +++ b/examples/ahead/overlap/notched-cylinder/quasistatic/notched-cylinder-2.yaml @@ -24,12 +24,11 @@ boundary conditions: - node set: +Z_top component: z function: "0.0064 * t" - Schwarz coupling: + Schwarz overlap: - side set: -Z_topSS source: notched-cylinder-1.yaml source side set: +Z_bottomSS source block: fine - coupling type: overlap solver: type: Hessian minimizer step: full Newton diff --git a/examples/nonoverlap/static-same-time-step/cuboid-1.yaml b/examples/nonoverlap/static-same-time-step/cuboid-1.yaml index 3f042b6..3939d3a 100644 --- a/examples/nonoverlap/static-same-time-step/cuboid-1.yaml +++ b/examples/nonoverlap/static-same-time-step/cuboid-1.yaml @@ -25,12 +25,11 @@ boundary conditions: - node set: nsz- component: z function: "-0.0 * t" - Schwarz coupling: + Schwarz nonoverlap: - side set: ssz+ source: cuboid-2.yaml source block: coarse source side set: ssz- - coupling type: nonoverlap solver: type: Hessian minimizer step: full Newton diff --git a/examples/nonoverlap/static-same-time-step/cuboid-2.yaml b/examples/nonoverlap/static-same-time-step/cuboid-2.yaml index d46f039..1f62b3d 100644 --- a/examples/nonoverlap/static-same-time-step/cuboid-2.yaml +++ b/examples/nonoverlap/static-same-time-step/cuboid-2.yaml @@ -25,12 +25,11 @@ boundary conditions: - node set: nsz+ component: z function: "1.0 * t" - Schwarz coupling: + Schwarz nonoverlap: - side set: ssz- source: cuboid-1.yaml source block: fine source side set: ssz+ - coupling type: nonoverlap solver: type: Hessian minimizer step: full Newton diff --git a/examples/overlap/static-different-steps/cuboid-1.yaml b/examples/overlap/static-different-steps/cuboid-1.yaml index 077c3e6..0fe6e1d 100644 --- a/examples/overlap/static-different-steps/cuboid-1.yaml +++ b/examples/overlap/static-different-steps/cuboid-1.yaml @@ -25,12 +25,11 @@ boundary conditions: - node set: nsz- component: z function: "0.0" - Schwarz coupling: + Schwarz overlap: - side set: ssz+ source: cuboid-2.yaml source block: coarse source side set: ssz- - coupling type: overlap solver: type: Hessian minimizer step: full Newton diff --git a/examples/overlap/static-different-steps/cuboid-2.yaml b/examples/overlap/static-different-steps/cuboid-2.yaml index 2853630..d4dce4b 100644 --- a/examples/overlap/static-different-steps/cuboid-2.yaml +++ b/examples/overlap/static-different-steps/cuboid-2.yaml @@ -25,12 +25,11 @@ boundary conditions: - node set: nsz+ component: z function: "1.0 * t" - Schwarz coupling: + Schwarz overlap: - side set: ssz- source: cuboid-1.yaml source block: fine source side set: ssz+ - coupling type: overlap solver: type: Hessian minimizer step: full Newton diff --git a/examples/overlap/static-same-time-step/cuboid-1.yaml b/examples/overlap/static-same-time-step/cuboid-1.yaml index 240b6e3..50e9a39 100644 --- a/examples/overlap/static-same-time-step/cuboid-1.yaml +++ b/examples/overlap/static-same-time-step/cuboid-1.yaml @@ -24,12 +24,11 @@ boundary conditions: - node set: nsz- component: z function: "0.0" - Schwarz coupling: + Schwarz overlap: - side set: ssz+ source: cuboid-2.yaml source block: coarse source side set: ssz- - coupling type: overlap solver: type: Hessian minimizer step: full Newton diff --git a/examples/overlap/static-same-time-step/cuboid-2.yaml b/examples/overlap/static-same-time-step/cuboid-2.yaml index ce88a6b..6a2e3b7 100644 --- a/examples/overlap/static-same-time-step/cuboid-2.yaml +++ b/examples/overlap/static-same-time-step/cuboid-2.yaml @@ -24,12 +24,11 @@ boundary conditions: - node set: nsz+ component: z function: "1.0 * t" - Schwarz coupling: + Schwarz overlap: - side set: ssz- source: cuboid-1.yaml source block: fine source side set: ssz+ - coupling type: overlap solver: type: Hessian minimizer step: full Newton diff --git a/src/ics_bcs.jl b/src/ics_bcs.jl index 58fefd6..f16a3fb 100644 --- a/src/ics_bcs.jl +++ b/src/ics_bcs.jl @@ -80,12 +80,9 @@ function SMCouplingSchwarzBC( subsim::SingleDomainSimulation, coupled_subsim::SingleDomainSimulation, input_mesh::ExodusDatabase, + bc_type::String, bc_params::Dict{Any,Any}, ) - coupling_type = bc_params["coupling type"] - if ((coupling_type != "overlap") && (coupling_type != "nonoverlap")) - error("Undefined coupling type: ", coupling_type) - end side_set_name = bc_params["side set"] side_set_id = side_set_id_from_name(side_set_name, input_mesh) local_from_global_map, _, side_set_node_indices = @@ -117,17 +114,16 @@ function SMCouplingSchwarzBC( push!(interpolation_function_values, N) end is_dirichlet = true - if (coupling_type == "overlap") + if bc_type == "Schwarz overlap" SMOverlapSchwarzBC( side_set_node_indices, coupled_nodes_indices, interpolation_function_values, coupled_subsim, subsim, - is_dirichlet, - coupling_type + is_dirichlet ) - else #non-overlap + elseif bc_type == "Schwarz nonoverlap" transfer_operator = zeros(length(local_from_global_map), length(coupled_local_from_global_map)) SMNonOverlapSchwarzBC( @@ -139,9 +135,10 @@ function SMCouplingSchwarzBC( subsim, coupled_side_set_id, transfer_operator, - is_dirichlet, - coupling_type + is_dirichlet ) + else + error("Unknown boundary condition type : ", bc_type) end end @@ -262,8 +259,7 @@ end function apply_bc(model::SolidMechanics, bc::SchwarzBoundaryCondition) global_sim = bc.coupled_subsim.params["global_simulation"] schwarz_controller = global_sim.schwarz_controller - if schwarz_controller.schwarz_contact == true && - schwarz_controller.active_contact == false + if typeof(bc) == SMContactSchwarzBC && schwarz_controller.active_contact == false return end empty_history = length(global_sim.schwarz_controller.time_hist) == 0 @@ -294,10 +290,10 @@ function apply_bc(model::SolidMechanics, bc::SchwarzBoundaryCondition) interp_∂Ω_f = same_step == true ? ∂Ω_f_hist[end] : interpolate(time_hist, ∂Ω_f_hist, time) bc.coupled_subsim.model.internal_force = interp_∂Ω_f - if ((global_sim.schwarz_controller.schwarz_contact == true) || (bc.coupling_type == "nonoverlap")) + if typeof(bc) == SMContactSchwarzBC || typeof(bc) == SMNonOverlapSchwarzBC relaxation_parameter = global_sim.schwarz_controller.relaxation_parameter - Schwarz_iteration = global_sim.schwarz_controller.iteration_number - if Schwarz_iteration == 1 + schwarz_iteration = global_sim.schwarz_controller.iteration_number + if schwarz_iteration == 1 lambda_dispᵖʳᵉᵛ = zeros(length(interp_disp)) lambda_veloᵖʳᵉᵛ = zeros(length(interp_velo)) lambda_acceᵖʳᵉᵛ = zeros(length(interp_acce)) @@ -479,12 +475,12 @@ function node_set_id_from_name(node_set_name::String, mesh::ExodusDatabase) num_names = length(node_set_names) node_set_index = 0 for index ∈ 1:num_names - if (node_set_name == node_set_names[index]) + if node_set_name == node_set_names[index] node_set_index = index break end end - if (node_set_index == 0) + if node_set_index == 0 error("node set ", node_set_name, " cannot be found in mesh") end node_set_ids = Exodus.read_ids(mesh, NodeSet) @@ -497,12 +493,12 @@ function side_set_id_from_name(side_set_name::String, mesh::ExodusDatabase) num_names = length(side_set_names) side_set_index = 0 for index ∈ 1:num_names - if (side_set_name == side_set_names[index]) + if side_set_name == side_set_names[index] side_set_index = index break end end - if (side_set_index == 0) + if side_set_index == 0 error("side set ", side_set_name, " cannot be found in mesh") end side_set_ids = Exodus.read_ids(mesh, SideSet) @@ -515,12 +511,12 @@ function block_id_from_name(block_name::String, mesh::ExodusDatabase) num_names = length(block_names) block_index = 0 for index ∈ 1:num_names - if (block_name == block_names[index]) + if block_name == block_names[index] block_index = index break end end - if (block_index == 0) + if block_index == 0 error("block ", block_name, " cannot be found in mesh") end block_ids = Exodus.read_ids(mesh, Block) @@ -574,7 +570,7 @@ function create_bcs(params::Dict{Any,Any}) boundary_condition = SMContactSchwarzBC(coupled_subsim, input_mesh, bc_setting_params) push!(boundary_conditions, boundary_condition) - elseif bc_type == "Schwarz coupling" + elseif bc_type == "Schwarz overlap" || bc_type == "Schwarz nonoverlap" sim = params["global_simulation"] subsim_name = params["name"] subdomain_index = sim.subsim_name_index_map[subsim_name] @@ -583,7 +579,7 @@ function create_bcs(params::Dict{Any,Any}) coupled_subdomain_index = sim.subsim_name_index_map[coupled_subsim_name] coupled_subsim = sim.subsims[coupled_subdomain_index] boundary_condition = - SMCouplingSchwarzBC(subsim, coupled_subsim, input_mesh, bc_setting_params) + SMCouplingSchwarzBC(subsim, coupled_subsim, input_mesh, bc_type, bc_setting_params) push!(boundary_conditions, boundary_condition) else error("Unknown boundary condition type : ", bc_type) @@ -663,7 +659,7 @@ function pair_bc(name::String, bc::ContactSchwarzBoundaryCondition) end function pair_bc(name::String, bc::CouplingSchwarzBoundaryCondition) - if (bc.coupling_type == "nonoverlap") + if typeof(bc) == SMNonOverlapSchwarzBC coupled_model = bc.coupled_subsim.model coupled_bcs = coupled_model.boundary_conditions for coupled_bc ∈ coupled_bcs diff --git a/src/ics_bcs_def.jl b/src/ics_bcs_def.jl index 5bdf824..4f960de 100644 --- a/src/ics_bcs_def.jl +++ b/src/ics_bcs_def.jl @@ -50,7 +50,6 @@ mutable struct SMOverlapSchwarzBC <: OverlapSchwarzBoundaryCondition coupled_subsim::Simulation subsim::Simulation is_dirichlet::Bool - coupling_type::String end mutable struct SMNonOverlapSchwarzBC <: NonOverlapSchwarzBoundaryCondition @@ -63,6 +62,5 @@ mutable struct SMNonOverlapSchwarzBC <: NonOverlapSchwarzBoundaryCondition coupled_side_set_id::Int64 transfer_operator::Matrix{Float64} is_dirichlet::Bool - coupling_type::String end diff --git a/src/minitensor.jl b/src/minitensor.jl index 8fbc2fe..32a68b2 100644 --- a/src/minitensor.jl +++ b/src/minitensor.jl @@ -456,9 +456,9 @@ function psi(x::Float64) y = abs(x) e2 = sqrt(eps()) e4 = sqrt(e2) - if (y > e4) + if y > e4 return sin(y) / y - elseif (y > e2) + elseif y > e2 return 1.0 - y * y / 6.0 else return 1.0 diff --git a/src/model.jl b/src/model.jl index c8ec252..ffb73a2 100644 --- a/src/model.jl +++ b/src/model.jl @@ -22,7 +22,7 @@ function SolidMechanics(params::Dict{Any,Any}) num_blks_params = length(material_blocks) blocks = Exodus.read_sets(input_mesh, Block) num_blks = length(blocks) - if (num_blks_params ≠ num_blks) + if num_blks_params ≠ num_blks error( "number of blocks in mesh ", model_params["mesh"], @@ -114,7 +114,7 @@ function HeatConduction(params::Dict{Any,Any}) num_blks_params = length(material_blocks) blocks = Exodus.read_sets(input_mesh, Block) num_blks = length(elem_blk_ids) - if (num_blks_params ≠ num_blks) + if num_blks_params ≠ num_blks error( "number of blocks in mesh ", model_params["mesh"], diff --git a/src/time_integrator.jl b/src/time_integrator.jl index e5bd35e..dd86d53 100644 --- a/src/time_integrator.jl +++ b/src/time_integrator.jl @@ -8,9 +8,9 @@ function adaptive_stepping_parameters(integrator_params::Dict{Any,Any}) has_increase = haskey(integrator_params, "increase factor") has_any = has_minimum || has_decrease || has_maximum || has_increase has_all = has_minimum && has_decrease && has_maximum && has_increase - if (has_any == true && has_all == false) + if has_any == true && has_all == false error("Adaptive time stepping requires 4 parameters: minimum and maximum time steps and decrease and increase factors") - elseif (has_any == true && has_all == true) + elseif has_any == true && has_all == true minimum_time_step = integrator_params["minimum time step"] decrease_factor = integrator_params["decrease factor"] maximum_time_step = integrator_params["maximum time step"]