Skip to content

Commit

Permalink
More fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
JordiManyer committed Oct 1, 2024
1 parent 2ee4316 commit 0c46fd3
Show file tree
Hide file tree
Showing 5 changed files with 29 additions and 31 deletions.
1 change: 0 additions & 1 deletion Project.toml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@ gmsh_jll = "630162c2-fc9b-58b3-9910-8442a8a132e6"
BSON = "0.3"
FileIO = "1"
Gridap = "0.18"
GridapDistributed = "0.4.0"
GridapGmsh = "0.7.2"
GridapP4est = "0.3.7"
GridapPETSc = "0.5.0"
Expand Down
2 changes: 1 addition & 1 deletion src/Solvers/badia2024.jl
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ function Badia2024Solver(op::FEOperator,params)
U_u, U_p, U_j, U_φ = get_trial(op)
V_u, V_p, V_j, V_φ = get_test(op)

diag_solvers = map(s -> get_block_solver(Val(s),params),params[:solver][:block_solvers])
diag_solvers = map(s -> get_block_solver(Val(s),params), params[:solver][:block_solvers])

uj_block = NonlinearSystemBlock(1)
p_block = BiformBlock(a_Ip,U_p,V_p)
Expand Down
6 changes: 3 additions & 3 deletions src/Solvers/petsc.jl
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,10 @@ function petsc_mumps_setup(ksp)
@check_error_code GridapPETSc.PETSC.PCFactorGetMatrix(pc[],mumpsmat)
# @check_error_code GridapPETSc.PETSC.MatMumpsSetIcntl(mumpsmat[], 4, 1)
@check_error_code GridapPETSc.PETSC.MatMumpsSetIcntl(mumpsmat[], 7, 0)
# @check_error_code GridapPETSc.PETSC.MatMumpsSetIcntl(mumpsmat[], 28, 2)
# @check_error_code GridapPETSc.PETSC.MatMumpsSetIcntl(mumpsmat[], 29, 2)
@check_error_code GridapPETSc.PETSC.MatMumpsSetIcntl(mumpsmat[], 28, 2)
@check_error_code GridapPETSc.PETSC.MatMumpsSetIcntl(mumpsmat[], 29, 1)
# @check_error_code GridapPETSc.PETSC.MatMumpsSetCntl(mumpsmat[], 3, 1.0e-6)
# @check_error_code GridapPETSc.PETSC.KSPView(ksp[],C_NULL)
@check_error_code GridapPETSc.PETSC.KSPView(ksp[],C_NULL)
end

# Standalone AMG solver, 5 iterations
Expand Down
2 changes: 1 addition & 1 deletion src/parameters.jl
Original file line number Diff line number Diff line change
Expand Up @@ -589,5 +589,5 @@ function params_bcs_stabilization(params::Dict{Symbol,Any})
=>true,
)
optional = Dict(:domain=>params[:fluid][:domain])
_check_mandatory_and_add_optional_weak(params[:bcs][:stabilization],mandatory,optional,params,"[:bcs][:thin_wall]")
_check_mandatory_and_add_optional_weak(params[:bcs][:stabilization],mandatory,optional,params,"[:bcs][:stabilization]")
end
49 changes: 24 additions & 25 deletions test/seq/expansion_badia2024_tests.jl
Original file line number Diff line number Diff line change
Expand Up @@ -2,38 +2,37 @@ module ExpansionBadia2024TestsSequential

using GridapMHD: expansion
using SparseArrays
using SparseMatricesCSR
using GridapPETSc

cw = 0.028
Re = 1.0
Ha = 100.0
Ha = 10.0
N = Ha^2/Re

mesh = Dict(
:mesher => :p4est_MG,
:base_mesh => "coarse",
:num_refs_coarse => 0,
:ranks_per_level => [1,1],
)
# solver = Dict(
# :solver => :badia2024,
# :matrix_type => SparseMatrixCSC{Float64,Int64},
# :vector_type => Vector{Float64},
# :block_solvers => [:julia,:cg_jacobi,:cg_jacobi],
# :petsc_options => "-ksp_error_if_not_converged true -ksp_converged_reason"
# )

# solver = Dict(
# :solver => :badia2024,
# :matrix_type => SparseMatrixCSR{0,PetscScalar,PetscInt},
# :vector_type => Vector{PetscScalar},
# :block_solvers => [:petsc_from_options,:cg_jacobi,:cg_jacobi],
# :petsc_options => "-ksp_error_if_not_converged true -ksp_converged_reason -ksp_type preonly -pc_type lu -pc_factor_mat_solver_type mumps",
# )

solver = Dict(
:solver => :badia2024,
:matrix_type => SparseMatrixCSC{Float64,Int64},
:vector_type => Vector{Float64},
:block_solvers => [:gmg,:cg_jacobi,:cg_jacobi],
:petsc_options => "-ksp_error_if_not_converged true -ksp_converged_reason"
:matrix_type => SparseMatrixCSR{0,PetscScalar,PetscInt},
:vector_type => Vector{PetscScalar},
:block_solvers => [:petsc_mumps,:cg_jacobi,:cg_jacobi],
:petsc_options => "-ksp_error_if_not_converged true -ksp_converged_reason",
)
expansion(np=1,backend=:mpi,mesh=mesh,solver=solver,order=2=100.0,N=N,Ha=Ha,cw=cw,title="ExpansionGMG",formulation=:mhd)

"""
# ReferenceSolution
expansion(np=1,backend=:mpi,solver=:julia,order=2,ζ=0.0,N=N,Ha=Ha,cw=cw,title="ExpansionRef")
expansion(np=4,backend=:mpi,mesh="710",solver=solver,order=2=10.0,N=N,Ha=Ha,title="Expansion")

expansion(np=1,backend=:mpi,solver=:julia,order=2,ζ=0.0,N=N,Ha=Ha,cw=cw,title="ExpansionRefBis",mesh=mesh)
meshbis = Dict(
:mesher => :p4est_SG,
:base_mesh => "coarse",
:num_refs => 1
)
expansion(np=1,backend=:mpi,solver=:julia,order=2,ζ=0.0,N=N,Ha=Ha,cw=cw,title="ExpansionRefBis",mesh=meshbis)
"""
end # module

0 comments on commit 0c46fd3

Please sign in to comment.