-
Notifications
You must be signed in to change notification settings - Fork 0
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
Showing
1 changed file
with
39 additions
and
0 deletions.
There are no files selected for viewing
39 changes: 39 additions & 0 deletions
39
extensions/GalerkinToolkitExamples/test/example002_defs.jl
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,39 @@ | ||
|
||
import GalerkinToolkit as gk | ||
using GalerkinToolkitExamples: Example002 | ||
using Test | ||
using PartitionedArrays | ||
using PetscCall | ||
|
||
function example002_tests_np_4(distribute) | ||
tol = 1.0e-8 | ||
params = Dict{Symbol,Any}() | ||
domain = (0,10,0,10) | ||
cells_per_dir = (20,20) | ||
parts_per_dir = (2,2) | ||
np = prod(parts_per_dir) | ||
parts = distribute(LinearIndices((np,))) | ||
ghost_layers = 0 | ||
mesh = gk.cartesian_mesh(domain,cells_per_dir,parts_per_dir;parts,ghost_layers) | ||
params[:mesh] = mesh | ||
results = Example002.main(params) | ||
results = Example002.main(params) | ||
@test results[:eh1] < tol | ||
@test results[:el2] < tol | ||
|
||
options = "-pc_type gamg -ksp_type cg -ksp_error_if_not_converged true -ksp_converged_reason -ksp_rtol 1.0e-6" | ||
PetscCall.init(args=split(options)) | ||
params = Dict{Symbol,Any}() | ||
domain = (0,10,0,10,0,10) | ||
cells_per_dir = (40,40,40) | ||
parts_per_dir = (2,2,1) | ||
np = prod(parts_per_dir) | ||
parts = distribute(LinearIndices((np,))) | ||
ghost_layers = 0 | ||
mesh = gk.cartesian_mesh(domain,cells_per_dir,parts_per_dir;parts,ghost_layers) | ||
params[:mesh] = mesh | ||
params[:export_vtu] = false | ||
params[:solver] = Example002.ksp_solver() | ||
results = Example002.main(params) | ||
results = Example002.main(params) | ||
end |