Skip to content

Commit

Permalink
Adding missing file
Browse files Browse the repository at this point in the history
  • Loading branch information
fverdugo committed Feb 7, 2024
1 parent 7c32c7e commit 9063a32
Showing 1 changed file with 39 additions and 0 deletions.
39 changes: 39 additions & 0 deletions extensions/GalerkinToolkitExamples/test/example002_defs.jl
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

0 comments on commit 9063a32

Please sign in to comment.