Hi I am using gridap for topology optimisation based on gridap tutorial 18. Based on the tutorial there are two domains for problem one for design variable and one another for entire domain. I did the same thing and i got SingularException(0) error. It is working when I just have one entire domain for calculations
function stepPhaseField(fem_params,pth, uh_in,ΨPlusPrev_in)
A_PF(s,φ,pth,uh_in,ΨPlusPrev_in) =((p->Gm(p))∘pth) * (ls*∇(φ)⋅∇(s)) + ((p->Gm(p))∘pth) * ((1/ls)*s*φ)
A_P(s,φ,ΨPlusPrev_in) =(2*ΨPlusPrev_in*s*φ)
a_PF(s,φ) = ∫(A_PF(s,φ,pth,uh_in,ΨPlusPrev_in))fem_params.dΓ_Domain + ∫(A_P(s,φ,ΨPlusPrev_in))fem_params.dΩ
B_PF(φ,pth) =((p->Gm(p))∘pth) * ((1/ls)*φ)
b_PF(φ) =∫(B_PF(φ,pth))fem_params.dΓ_Domain
op_PF = AffineFEOperator(a_PF,b_PF ,U_PF ,V0_PF)
sh_out = solve(op_PF)
return sh_out
end
the error is
SingularException(0)
Stacktrace:
[1] lu(S::SparseArrays.SparseMatrixCSC{Float64, Int64}; check::Bool)
@ SuiteSparse.UMFPACK E:\installed softwares\Julia-1.8.5\share\julia\stdlib\v1.8\SuiteSparse\src\umfpack.jl:203
[2] lu
@ E:\installed softwares\Julia-1.8.5\share\julia\stdlib\v1.8\SuiteSparse\src\umfpack.jl:195 [inlined]
[3] numerical_setup
@ C:\Users\marya\.julia\packages\Gridap\971dU\src\Algebra\LinearSolvers.jl:259 [inlined]
[4] solve!
@ C:\Users\marya\.julia\packages\Gridap\971dU\src\Algebra\LinearSolvers.jl:206 [inlined]
[5] solve!(x::Vector{Float64}, nls::LUSolver, op::Gridap.Algebra.AffineOperator{SparseArrays.SparseMatrixCSC{Float64, Int64}, Vector{Float64}})
@ Gridap.Algebra C:\Users\marya\.julia\packages\Gridap\971dU\src\Algebra\NonlinearSolvers.jl:22
[6] solve!(u::Gridap.FESpaces.SingleFieldFEFunction{GenericCellField{ReferenceDomain}}, solver::LinearFESolver, feop::AffineFEOperator, cache::Nothing)
@ Gridap.FESpaces C:\Users\marya\.julia\packages\Gridap\971dU\src\FESpaces\FESolvers.jl:121
[7] solve!(uh::Gridap.FESpaces.SingleFieldFEFunction{GenericCellField{ReferenceDomain}}, solver::LinearFESolver, op::AffineFEOperator)
@ Gridap.FESpaces C:\Users\marya\.julia\packages\Gridap\971dU\src\FESpaces\FESolvers.jl:14
[8] solve(nls::LinearFESolver, op::AffineFEOperator)
@ Gridap.FESpaces C:\Users\marya\.julia\packages\Gridap\971dU\src\FESpaces\FESolvers.jl:51
[9] solve
@ C:\Users\marya\.julia\packages\Gridap\971dU\src\FESpaces\FESolvers.jl:65 [inlined]
[10] stepPhaseField(fem_params::NamedTuple{(:V0_Disp, :U_PF, :V0_PF, :Q, :P, :Qf, :Pf, :np, :Ω, :dΩ, :n_Γ_Load, :dΓ_Load, :Γ_Domain, :dΓ_Domain), Tuple{Gridap.FESpaces.UnconstrainedFESpace{Vector{Float64}, Gridap.FESpaces.NodeToDofGlue{VectorValue{2, Int32}}}, TrialFESpace{Gridap.FESpaces.UnconstrainedFESpace{Vector{Float64}, Gridap.FESpaces.NodeToDofGlue{Int32}}}, Gridap.FESpaces.UnconstrainedFESpace{Vector{Float64}, Gridap.FESpaces.NodeToDofGlue{Int32}}, Gridap.FESpaces.UnconstrainedFESpace{Vector{Float64}, Nothing}, TrialFESpace{Gridap.FESpaces.UnconstrainedFESpace{Vector{Float64}, Nothing}}, Gridap.FESpaces.UnconstrainedFESpace{Vector{Float64}, Gridap.FESpaces.NodeToDofGlue{Int32}}, TrialFESpace{Gridap.FESpaces.UnconstrainedFESpace{Vector{Float64}, Gridap.FESpaces.NodeToDofGlue{Int32}}}, Int64, BodyFittedTriangulation{2, 2, UnstructuredDiscreteModel{2, 2, Float64, Oriented}, UnstructuredGrid{2, 2, Float64, Oriented, Nothing}, Gridap.Arrays.IdentityVector{Int64}}, Gridap.CellData.GenericMeasure, GenericCellField{ReferenceDomain}, Gridap.CellData.GenericMeasure, BodyFittedTriangulation{2, 2, UnstructuredDiscreteModel{2, 2, Float64, Oriented}, GridPortion{2, 2, UnstructuredGrid{2, 2, Float64, Oriented, Nothing}}, Vector{Int32}}, Gridap.CellData.GenericMeasure}}, pth::Gridap.CellData.OperationCellField{ReferenceDomain}, uh_in::Gridap.FESpaces.SingleFieldFEFunction{GenericCellField{ReferenceDomain}}, ΨPlusPrev_in::CellState{Float64, CellPoint{ReferenceDomain, Gridap.Arrays.CompressedArray{Vector{VectorValue{2, Float64}}, 1, Vector{Vector{VectorValue{2, Float64}}}, Vector{Int8}}, Gridap.Arrays.LazyArray{Gridap.Arrays.LazyArray{FillArrays.Fill{typeof(affine_map), 1, Tuple{Base.OneTo{Int64}}}, AffineMap{2, 2, Float64, 4}, 1, Tuple{Gridap.Arrays.LazyArray{FillArrays.Fill{Gridap.Fields.LinearCombinationMap{Colon}, 1, Tuple{Base.OneTo{Int64}}}, TensorValue{2, 2, Float64, 4}, 1, Tuple{Gridap.Arrays.LazyArray{FillArrays.Fill{Broadcasting{Reindex{Vector{VectorValue{2, Float64}}}}, 1, Tuple{Base.OneTo{Int64}}}, Vector{VectorValue{2, Float64}}, 1, Tuple{Gridap.Arrays.Table{Int64, Vector{Int64}, Vector{Int32}}}}, Gridap.Arrays.CompressedArray{Vector{VectorValue{2, Float64}}, 1, Vector{Vector{VectorValue{2, Float64}}}, Vector{Int8}}}}, Gridap.Arrays.LazyArray{FillArrays.Fill{Gridap.Fields.LinearCombinationMap{Colon}, 1, Tuple{Base.OneTo{Int64}}}, VectorValue{2, Float64}, 1, Tuple{Gridap.Arrays.LazyArray{FillArrays.Fill{Broadcasting{Reindex{Vector{VectorValue{2, Float64}}}}, 1, Tuple{Base.OneTo{Int64}}}, Vector{VectorValue{2, Float64}}, 1, Tuple{Gridap.Arrays.Table{Int64, Vector{Int64}, Vector{Int32}}}}, Gridap.Arrays.CompressedArray{Vector{Float64}, 1, Vector{Vector{Float64}}, Vector{Int8}}}}}}, Vector{VectorValue{2, Float64}}, 1, Tuple{Gridap.Arrays.CompressedArray{Vector{VectorValue{2, Float64}}, 1, Vector{Vector{VectorValue{2, Float64}}}, Vector{Int8}}}}, BodyFittedTriangulation{2, 2, UnstructuredDiscreteModel{2, 2, Float64, Oriented}, UnstructuredGrid{2, 2, Float64, Oriented, Nothing}, Gridap.Arrays.IdentityVector{Int64}}}})
@ Main .\In[24]:9
[11] top-level scope
@ In[26]:1
do you know how can I solve this issue?
thank you