-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
bcd6821
commit 9213a39
Showing
5 changed files
with
159 additions
and
108 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
|
||
using GridapMHD: expansion | ||
using GridapPETSc, SparseMatricesCSR | ||
cw = 0.028 | ||
Re = 1.0 | ||
Ha = 100.0 | ||
N = Ha^2/Re | ||
|
||
mesh = Dict( | ||
:mesher => :MG, | ||
:base_mesh => "coarse", | ||
:num_refs_coarse => 0, | ||
:ranks_per_level => [1,1], | ||
) | ||
solver = Dict( | ||
:solver => :badia2024, | ||
:matrix_type => SparseMatrixCSR{0,PetscScalar,PetscInt}, | ||
:vector_type => Vector{PetscScalar}, | ||
:block_solvers => [:julia,: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,ζ=10000.0,N=N,Ha=Ha,cw=cw,title="ExpansionGMG") | ||
|
||
# ReferenceSolution | ||
expansion(np=1,backend=:mpi,solver=:julia,order=2,ζ=0.0,N=N,Ha=Ha,cw=cw,title="ExpansionRef") | ||
|
||
expansion(np=1,backend=:mpi,solver=:julia,order=2,ζ=0.0,N=N,Ha=Ha,cw=cw,title="ExpansionRefBis",mesh=mesh) | ||
|
||
meshbis = Dict( | ||
:mesher => :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) |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
module HuntBadia2024SequentialTests | ||
|
||
using GridapMHD: hunt | ||
using GridapPETSc, SparseMatricesCSR | ||
|
||
# Badia2024, with LU factorisation for u-j sub-block | ||
solver = Dict( | ||
:solver => :badia2024, | ||
:matrix_type => SparseMatrixCSR{0,PetscScalar,PetscInt}, | ||
:vector_type => Vector{PetscScalar}, | ||
:petsc_options => "-ksp_error_if_not_converged true -ksp_converged_reason", | ||
:block_solvers => [:julia,:cg_jacobi,:cg_jacobi], | ||
) | ||
hunt( | ||
nc=(6,6), | ||
np=(1,1), | ||
backend=:mpi, | ||
L=1.0, | ||
B=(0.,50.,0.), | ||
debug=false, | ||
vtk=true, | ||
title="hunt", | ||
solver=solver, | ||
ζ=10.0, | ||
) | ||
|
||
# Badia2024, with GMG solver for u-j sub-block | ||
solver = Dict( | ||
:solver => :badia2024, | ||
:matrix_type => SparseMatrixCSR{0,PetscScalar,PetscInt}, | ||
:vector_type => Vector{PetscScalar}, | ||
:petsc_options => "-ksp_error_if_not_converged true -ksp_converged_reason", | ||
:block_solvers => [:gmg,:cg_jacobi,:cg_jacobi], | ||
) | ||
hunt( | ||
nc=(4,4), | ||
np=(1,1), | ||
backend=:mpi, | ||
L=1.0, | ||
B=(0.,50.,0.), | ||
debug=false, | ||
vtk=true, | ||
title="hunt", | ||
solver=solver, | ||
ζ=10.0, | ||
ranks_per_level=[1,1] | ||
) | ||
|
||
end # module |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,70 @@ | ||
module HuntLi2019SequentialTests | ||
|
||
using GridapMHD: hunt | ||
using GridapPETSc, SparseMatricesCSR | ||
|
||
hunt( | ||
nc=(4,4), | ||
np=(2,2), | ||
backend=:sequential, | ||
L=1.0, | ||
B=(0.,50.,0.), | ||
debug=false, | ||
vtk=true, | ||
title="hunt", | ||
solver=:li2019, | ||
) | ||
|
||
# Li2019, MUMPS for Dj | ||
solver = Dict( | ||
:solver => :li2019, | ||
:matrix_type => SparseMatrixCSR{0,PetscScalar,PetscInt}, | ||
:vector_type => Vector{PetscScalar}, | ||
:block_solvers => [:petsc_gmres_schwarz,:petsc_gmres_schwarz,:petsc_cg_jacobi,:petsc_cg_jacobi], | ||
:petsc_options => "-ksp_error_if_not_converged true -ksp_converged_reason" | ||
) | ||
hunt( | ||
nc=(4,4), | ||
np=(2,2), | ||
backend=:sequential, | ||
L=1.0, | ||
B=(0.,50.,0.), | ||
debug=false, | ||
vtk=true, | ||
title="hunt", | ||
solver=solver, | ||
) | ||
|
||
# Li2019, GMRES + Overlapping Additive Schwarz preconditioner for Dj | ||
petsc_options = """ | ||
-ksp_type gmres | ||
-ksp_rtol 1.0e-5 | ||
-ksp_atol 1.0e-14 | ||
-ksp_converged_reason | ||
-pc_type asm | ||
-pc_asm_overlap 10 | ||
-pc_asm_type restrict | ||
-pc_asm_blocks 32 | ||
-sub_ksp_type preonly | ||
-sub_pc_type lu | ||
""" | ||
solver = Dict( | ||
:solver => :li2019, | ||
:matrix_type => SparseMatrixCSR{0,PetscScalar,PetscInt}, | ||
:vector_type => Vector{PetscScalar}, | ||
:block_solvers => [:petsc_from_options,:petsc_gmres_schwarz,:petsc_cg_jacobi,:petsc_cg_jacobi], | ||
:petsc_options => petsc_options | ||
) | ||
hunt( | ||
nc=(4,4), | ||
np=(2,2), | ||
backend=:sequential, | ||
L=1.0, | ||
B=(0.,50.,0.), | ||
debug=false, | ||
vtk=true, | ||
title="hunt", | ||
solver=solver, | ||
) | ||
|
||
end # module |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters