lxmota / Norma.jl

A Julia testbed for solid mechanics, coupling and multiphysics
7 stars 3 forks source link

Issues running notched-cylinder problem with Schwarz #15

Open ikalash opened 4 days ago

ikalash commented 4 days ago

There are some issues running the notched-cylinder problem with Schwarz:

1.) When using a relatively coarse mesh of the two subdomains (see notched-cylinder.zip), NaNs are encountered shortly after the simulation starts, it looks like due to something going wrong with the search/interpolation step of Schwarz.

(base) [ikalash@camobap tet-hex]$ julia --project=@. /home/ikalash/Norma.jl/src/Norma.jl notched-cylinder.yaml 
Reading simulation file: notched-cylinder.yaml
Reading subsimulation file: notched-cylinder-1.yaml
Reading subsimulation file: notched-cylinder-2.yaml
ERROR: LoadError: ArgumentError: matrix contains Infs or NaNs
Stacktrace:
  [1] chkfinite
    @ ~/Install/julia-1.11.1/share/julia/stdlib/v1.11/LinearAlgebra/src/lapack.jl:105 [inlined]
  [2] getrf!(A::Matrix{Float64}, ipiv::Vector{Int64}; check::Bool)
    @ LinearAlgebra.LAPACK ~/Install/julia-1.11.1/share/julia/stdlib/v1.11/LinearAlgebra/src/lapack.jl:582
  [3] getrf!
    @ ~/Install/julia-1.11.1/share/julia/stdlib/v1.11/LinearAlgebra/src/lapack.jl:580 [inlined]
  [4] getrf!
    @ ~/Install/julia-1.11.1/share/julia/stdlib/v1.11/LinearAlgebra/src/lapack.jl:787 [inlined]
  [5] #lu!#182
    @ ~/Install/julia-1.11.1/share/julia/stdlib/v1.11/LinearAlgebra/src/lu.jl:91 [inlined]
  [6] lu!
    @ ~/Install/julia-1.11.1/share/julia/stdlib/v1.11/LinearAlgebra/src/lu.jl:90 [inlined]
  [7] lu!
    @ ~/Install/julia-1.11.1/share/julia/stdlib/v1.11/LinearAlgebra/src/lu.jl:89 [inlined]
  [8] _lu
    @ ~/Install/julia-1.11.1/share/julia/stdlib/v1.11/LinearAlgebra/src/lu.jl:347 [inlined]
  [9] lu(::Matrix{Float64}; kwargs::@Kwargs{})
    @ LinearAlgebra ~/Install/julia-1.11.1/share/julia/stdlib/v1.11/LinearAlgebra/src/lu.jl:341
 [10] lu
    @ ~/Install/julia-1.11.1/share/julia/stdlib/v1.11/LinearAlgebra/src/lu.jl:341 [inlined]
 [11] \(A::Matrix{Float64}, B::Vector{Float64})
    @ LinearAlgebra ~/Install/julia-1.11.1/share/julia/stdlib/v1.11/LinearAlgebra/src/generic.jl:1132
 [12] map_to_parametric(element_type::String, nodes::Matrix{Float64}, point::Vector{Float64})
    @ Main.Norma ~/Norma.jl/src/interpolation.jl:496
 [13] find_in_mesh(point::Vector{Float64}, model::Main.Norma.SolidMechanics, mesh::Exodus.ExodusDatabase{Int32, Int32, Int32, Float64, Exodus.Initialization{3, 161, 90, 1, 4, 0}}, blk_id::Int64)
    @ Main.Norma ~/Norma.jl/src/ics_bcs.jl:173
 [14] Main.Norma.SMSchwarzDBC(subsim::Main.Norma.SingleDomainSimulation, coupled_subsim::Main.Norma.SingleDomainSimulation, input_mesh::Exodus.ExodusDatabase{Int32, Int32, Int32, Float64, Exodus.Initialization{3, 1253, 5882, 1, 4, 0}}, bc_params::Dict{Any, Any})
    @ Main.Norma ~/Norma.jl/src/ics_bcs.jl:96
 [15] create_bcs(params::Dict{Any, Any})
    @ Main.Norma ~/Norma.jl/src/ics_bcs.jl:523
 [16] create_delayed_bcs(sim::Main.Norma.SingleDomainSimulation)
    @ Main.Norma ~/Norma.jl/src/simulation.jl:32
 [17] create_delayed_bcs
    @ ~/Norma.jl/src/simulation.jl:38 [inlined]
 [18] create_simulation(params::Dict{Any, Any}, name::String)
    @ Main.Norma ~/Norma.jl/src/simulation.jl:18
 [19] create_simulation(input_file::String)
    @ Main.Norma ~/Norma.jl/src/simulation.jl:28
 [20] run
    @ ~/Norma.jl/src/Norma.jl:8 [inlined]
 [21] top-level scope
    @ ~/Norma.jl/src/Norma.jl:20
in expression starting at /home/ikalash/Norma.jl/src/Norma.jl:1

2.) With larger meshes (https://github.com/lxmota/Norma.jl/blob/main/examples/ahead/overlap/notched-cylinder/notched-cylinder.jou), the problem appears to hang. The issue can be reproduced by running the following file: https://github.com/lxmota/Norma.jl/blob/main/examples/ahead/overlap/notched-cylinder/quasistatic/notched-cylinder.yaml . I do not believe that the problem is due just to the meshes being big, but I will confirm by generating coarser meshes.

ikalash commented 4 days ago

I looked into this a bit more. For 1.), if I use my .jou files to coarsen the mesh, the problem still hangs like laser weld. For 2.), when I print nodes, dN and hessian, a lot of good ones are printed before the NaNs are encountered. Here is how the output looks like right before the failure:

nodes=[0.007179586967170459 0.008040155796061875 0.01564866489021696 0.01371476139623305 0.007119471758386305 0.007916687604049254 0.01547042703608091 0.013617095142375532; 0.022596338520592143 0.03097347082222224 0.027912708345011795 0.020800913282645318 0.022632500722610294 0.031005258543993677 0.028011888321234198 0.020875344162756233; 0.023999999999999994 0.024 0.024000000000000004 0.023999999999999994 0.016 0.016 0.016 0.016]
dN=[2.9174957800675204e115 -2.9174957800675204e115 2.8891223745802193e115 -2.8891223745802193e115 -2.9174957800675204e115 2.9174957800675204e115 -2.8891223745802193e115 2.8891223745802193e115; -1.9173969186246235e298 1.9173969186246235e298 -1.9173969186246235e298 1.9173969186246235e298 1.9173969186246235e298 -1.9173969186246235e298 1.9173969186246235e298 -1.9173969186246235e298; 3.474316162543689e186 -3.474316162543689e186 3.440527533972424e186 -3.440527533972424e186 -3.474316162543689e186 3.474316162543689e186 -3.440527533972424e186 3.440527533972424e186]
hessian=[4.794915189670142e110 -3.301492327477302e293 5.710051563849056e181; -8.42656949861055e110 5.5841455568546345e293 -1.0034827403640639e182; 1.0750218047769578e98 -6.766757549592829e280 1.2799921833370818e169]
nodes=[0.007179586967170459 0.008040155796061875 0.01564866489021696 0.01371476139623305 0.007119471758386305 0.007916687604049254 0.01547042703608091 0.013617095142375532; 0.022596338520592143 0.03097347082222224 0.027912708345011795 0.020800913282645318 0.022632500722610294 0.031005258543993677 0.028011888321234198 0.020875344162756233; 0.023999999999999994 0.024 0.024000000000000004 0.023999999999999994 0.016 0.016 0.016 0.016]
dN=[2.8603368698068106e119 -2.8603368698068106e119 2.8325193511431805e119 -2.8325193511431805e119 -2.8603368698068106e119 2.8603368698068106e119 -2.8325193511431805e119 2.8325193511431805e119; 1.8428142947791833e306 -1.8428142947791833e306 1.8428142947791833e306 -1.8428142947791833e306 -1.8428142947791833e306 1.8428142947791833e306 -1.8428142947791833e306 1.8428142947791833e306; -3.4059007230468307e190 3.4059007230468307e190 -3.3727774542703716e190 3.3727774542703716e190 3.4059007230468307e190 -3.4059007230468307e190 3.3727774542703716e190 -3.3727774542703716e190]
hessian=[4.7009743200882416e114 3.1730713636187297e301 -5.597610548890246e185; -8.261478079501124e114 -5.366934282799127e301 9.8372238813645e185; 8.110601635369614e101 8.410031667171665e288 -1.8584886900001456e173]
nodes=[0.007179586967170459 0.008040155796061875 0.01564866489021696 0.01371476139623305 0.007119471758386305 0.007916687604049254 0.01547042703608091 0.013617095142375532; 0.022596338520592143 0.03097347082222224 0.027912708345011795 0.020800913282645318 0.022632500722610294 0.031005258543993677 0.028011888321234198 0.020875344162756233; 0.023999999999999994 0.024 0.024000000000000004 0.023999999999999994 0.016 0.016 0.016 0.016]
dN=[NaN NaN NaN NaN NaN NaN NaN NaN; NaN NaN NaN NaN NaN NaN NaN NaN; NaN NaN NaN NaN NaN NaN NaN NaN]
hessian=[NaN NaN NaN; NaN NaN NaN; NaN NaN NaN]

It seems like the dNs and hessians are becoming unbounded before turning into NaNas.