Skip to content

Commit 43811c9

Browse files
Merge pull request #333 from arcaneframework/mab/petsc-improvements
BSR for PETSc
2 parents 73e4140 + d23f511 commit 43811c9

File tree

4 files changed

+79
-1
lines changed

4 files changed

+79
-1
lines changed

modules/testlab/CMakeLists.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,8 @@ if(FEMUTILS_HAS_SOLVER_BACKEND_PETSC)
8585
arcanefem_add_gpu_test(NAME [testlab]petsc_direct.bjacobi.gmres COMMAND Testlab ARGS inputs/Test.petsc_direct.bjacobi.gmres.arc)
8686
arcanefem_add_gpu_test(NAME [testlab]petsc_direct.gamg COMMAND Testlab ARGS inputs/Test.petsc_direct.gamg.arc)
8787
arcanefem_add_gpu_test(NAME [testlab]petsc_direct_3D COMMAND Testlab ARGS inputs/Test.petsc_direct-3D.arc)
88+
arcanefem_add_gpu_test(NAME [testlab]sphere_3D_petsc_direct_bsr COMMAND Testlab ARGS inputs/Test.sphere.3D.bsr.petsc_direct.arc)
89+
arcanefem_add_gpu_test(NAME [testlab]sphere_3D_petsc_direct_af-bsr COMMAND Testlab ARGS inputs/Test.sphere.3D.bsr.atomic-free.petsc_direct.arc)
8890

8991
arcanefem_add_gpu_test(NAME [testlab]L-shape_2D_petsc COMMAND ./Testlab ARGS inputs/Test.petsc.arc)
9092
arcanefem_add_gpu_test(NAME [testlab]L-shape_2D_petsc_coo-gpu COMMAND ./Testlab ARGS inputs/Test.L-shape.2D.coo-gpu.arc)

modules/testlab/FemModule.cc

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -138,7 +138,9 @@ startInit()
138138
}
139139

140140
if (options()->bsr || options()->bsrAtomicFree()) {
141-
bool use_csr_in_linear_system = options()->linearSystem.serviceName() == "HypreLinearSystem";
141+
bool use_csr_in_linear_system = false;
142+
if (options()->linearSystem.serviceName() == "HypreLinearSystem" || options()->linearSystem.serviceName() == "PETScLinearSystem")
143+
use_csr_in_linear_system = true;
142144
m_bsr_format.initialize(mesh, 1, use_csr_in_linear_system, options()->bsrAtomicFree);
143145
}
144146
}
Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
<?xml version="1.0"?>
2+
<case codename="Testlab" xml:lang="en" codeversion="1.0">
3+
<arcane>
4+
<title>Testlab: 3D Sphere with Horizontal Dirichlet Boundary (Atomic Free BSR-GPU Format, PETSc Linear System Solver, Penalty Method)</title>
5+
<timeloop>TestlabLoop</timeloop>
6+
</arcane>
7+
8+
<arcane-post-processing>
9+
<output-period>1</output-period>
10+
<format name="VtkHdfV2PostProcessor" />
11+
<output>
12+
<variable>U</variable>
13+
</output>
14+
</arcane-post-processing>
15+
16+
<meshes>
17+
<mesh>
18+
<filename>sphere_cut.msh</filename>
19+
</mesh>
20+
</meshes>
21+
22+
<fem>
23+
<solution-comparison-file>poisson_test_ref_sphere_3D.txt</solution-comparison-file>
24+
<f>5.5</f>
25+
<enforce-Dirichlet-method>Penalty</enforce-Dirichlet-method>
26+
<penalty>1.e31</penalty>
27+
<dirichlet-boundary-condition>
28+
<surface>horizontal</surface>
29+
<value>0.5</value>
30+
</dirichlet-boundary-condition>
31+
<bsr-atomic-free>true</bsr-atomic-free>
32+
<linear-system name="PETScLinearSystem">
33+
<rtol>0.</rtol>
34+
<atol>1e-5</atol>
35+
</linear-system>
36+
</fem>
37+
</case>
Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
<?xml version="1.0"?>
2+
<case codename="Testlab" xml:lang="en" codeversion="1.0">
3+
<arcane>
4+
<title>Testlab: 3D Sphere with Horizontal Dirichlet Boundary (BSR Format, PETSc Linear System Solver, Penalty Method)</title>
5+
<timeloop>TestlabLoop</timeloop>
6+
</arcane>
7+
8+
<arcane-post-processing>
9+
<output-period>1</output-period>
10+
<format name="VtkHdfV2PostProcessor" />
11+
<output>
12+
<variable>U</variable>
13+
</output>
14+
</arcane-post-processing>
15+
16+
<meshes>
17+
<mesh>
18+
<filename>sphere_cut.msh</filename>
19+
</mesh>
20+
</meshes>
21+
22+
<fem>
23+
<solution-comparison-file>poisson_test_ref_sphere_3D.txt</solution-comparison-file>
24+
<f>5.5</f>
25+
<enforce-Dirichlet-method>Penalty</enforce-Dirichlet-method>
26+
<penalty>1.e31</penalty>
27+
<dirichlet-boundary-condition>
28+
<surface>horizontal</surface>
29+
<value>0.5</value>
30+
</dirichlet-boundary-condition>
31+
<bsr>true</bsr>
32+
<linear-system name="PETScLinearSystem">
33+
<rtol>0.</rtol>
34+
<atol>1e-5</atol>
35+
</linear-system>
36+
</fem>
37+
</case>

0 commit comments

Comments
 (0)