From 991017ff8b04961892465aade85f3721cdfa7333 Mon Sep 17 00:00:00 2001 From: Jiaqi Zhang Date: Mon, 14 Sep 2020 20:09:01 -0400 Subject: [PATCH] print error estimate and update screen output --- examples/step-50/doc/results.dox | 429 ++++++++++++++++++++++++++++--- examples/step-50/step-50.cc | 6 + 2 files changed, 403 insertions(+), 32 deletions(-) diff --git a/examples/step-50/doc/results.dox b/examples/step-50/doc/results.dox index 9e9657ed5b..ba6d833e5f 100644 --- a/examples/step-50/doc/results.dox +++ b/examples/step-50/doc/results.dox @@ -1,60 +1,425 @@

Results

-When you run the program, the screen output should look like the following: +When you run the program using the following command +@code +mpirun -np 16 ./step-50 gmg_mf_2d.prm +@endcode +the screen output should look like the following: @code Cycle 0: - Number of active cells: 56 (2 global levels) - Workload imbalance: 1.14286 - Number of degrees of freedom: 665 (by level: 117, 665) + Number of active cells: 12 (2 global levels) + Partition efficiency: 0.1875 + Number of degrees of freedom: 65 (by level: 21, 65) Number of CG iterations: 10 + Global error estimate: 0.355373 Wrote solution_00.pvtu +---------------------------------------------+------------+------------+ -| Total wallclock time elapsed since start | 0.0457s | | +| Total wallclock time elapsed since start | 0.0163s | | | | | | | Section | no. calls | wall time | % of total | +---------------------------------+-----------+------------+------------+ -| Assemble right hand side | 1 | 0.000241s | 0.53% | -| Estimate | 1 | 0.0288s | 63% | -| Output results | 1 | 0.00219s | 4.8% | -| Setup | 1 | 0.00264s | 5.8% | -| Setup multigrid | 1 | 0.00261s | 5.7% | -| Solve | 1 | 0.00355s | 7.8% | -| Solve: 1 multigrid V-cycle | 1 | 0.000315s | 0.69% | -| Solve: CG | 1 | 0.00186s | 4.1% | -| Solve: Preconditioner setup | 1 | 0.000968s | 2.1% | +| Assemble right-hand side | 1 | 0.000374s | 2.3% | +| Estimate | 1 | 0.000724s | 4.4% | +| Output results | 1 | 0.00277s | 17% | +| Setup | 1 | 0.00225s | 14% | +| Setup multigrid | 1 | 0.00181s | 11% | +| Solve | 1 | 0.00364s | 22% | +| Solve: 1 multigrid V-cycle | 1 | 0.000354s | 2.2% | +| Solve: CG | 1 | 0.00151s | 9.3% | +| Solve: Preconditioner setup | 1 | 0.00125s | 7.7% | +---------------------------------+-----------+------------+------------+ Cycle 1: - Number of active cells: 126 (3 global levels) - Workload imbalance: 1.17483 - Number of degrees of freedom: 1672 (by level: 117, 665, 1100) - Number of CG iterations: 11 + Number of active cells: 24 (3 global levels) + Partition efficiency: 0.276786 + Number of degrees of freedom: 139 (by level: 21, 65, 99) + Number of CG iterations: 10 + Global error estimate: 0.216726 Wrote solution_01.pvtu +---------------------------------------------+------------+------------+ -| Total wallclock time elapsed since start | 0.0433s | | +| Total wallclock time elapsed since start | 0.0169s | | | | | | | Section | no. calls | wall time | % of total | +---------------------------------+-----------+------------+------------+ -| Assemble right hand side | 1 | 0.000286s | 0.66% | -| Estimate | 1 | 0.0272s | 63% | -| Output results | 1 | 0.00333s | 7.7% | -| Refine grid | 1 | 0.00196s | 4.5% | -| Setup | 1 | 0.0023s | 5.3% | -| Setup multigrid | 1 | 0.00262s | 6% | -| Solve | 1 | 0.00549s | 13% | -| Solve: 1 multigrid V-cycle | 1 | 0.000343s | 0.79% | -| Solve: CG | 1 | 0.00293s | 6.8% | -| Solve: Preconditioner setup | 1 | 0.00174s | 4% | +| Assemble right-hand side | 1 | 0.000309s | 1.8% | +| Estimate | 1 | 0.00156s | 9.2% | +| Output results | 1 | 0.00222s | 13% | +| Refine grid | 1 | 0.00278s | 16% | +| Setup | 1 | 0.00196s | 12% | +| Setup multigrid | 1 | 0.0023s | 14% | +| Solve | 1 | 0.00565s | 33% | +| Solve: 1 multigrid V-cycle | 1 | 0.000349s | 2.1% | +| Solve: CG | 1 | 0.00285s | 17% | +| Solve: Preconditioner setup | 1 | 0.00195s | 12% | +---------------------------------+-----------+------------+------------+ Cycle 2: -. -. -. + Number of active cells: 51 (4 global levels) + Partition efficiency: 0.41875 + Number of degrees of freedom: 245 (by level: 21, 65, 225, 25) + Number of CG iterations: 11 + Global error estimate: 0.112098 + Wrote solution_02.pvtu + + ++---------------------------------------------+------------+------------+ +| Total wallclock time elapsed since start | 0.0183s | | +| | | | +| Section | no. calls | wall time | % of total | ++---------------------------------+-----------+------------+------------+ +| Assemble right-hand side | 1 | 0.000274s | 1.5% | +| Estimate | 1 | 0.00127s | 6.9% | +| Output results | 1 | 0.00227s | 12% | +| Refine grid | 1 | 0.0024s | 13% | +| Setup | 1 | 0.00191s | 10% | +| Setup multigrid | 1 | 0.00295s | 16% | +| Solve | 1 | 0.00702s | 38% | +| Solve: 1 multigrid V-cycle | 1 | 0.000398s | 2.2% | +| Solve: CG | 1 | 0.00376s | 21% | +| Solve: Preconditioner setup | 1 | 0.00238s | 13% | ++---------------------------------+-----------+------------+------------+ + +Cycle 3: + Number of active cells: 105 (5 global levels) + Partition efficiency: 0.434375 + Number of degrees of freedom: 531 (by level: 21, 65, 225, 379, 25) + Number of CG iterations: 12 + Global error estimate: 0.0577719 + Wrote solution_03.pvtu + + ++---------------------------------------------+------------+------------+ +| Total wallclock time elapsed since start | 0.0188s | | +| | | | +| Section | no. calls | wall time | % of total | ++---------------------------------+-----------+------------+------------+ +| Assemble right-hand side | 1 | 0.000302s | 1.6% | +| Estimate | 1 | 0.000898s | 4.8% | +| Output results | 1 | 0.00228s | 12% | +| Refine grid | 1 | 0.00204s | 11% | +| Setup | 1 | 0.00143s | 7.6% | +| Setup multigrid | 1 | 0.00346s | 18% | +| Solve | 1 | 0.00823s | 44% | +| Solve: 1 multigrid V-cycle | 1 | 0.00043s | 2.3% | +| Solve: CG | 1 | 0.00462s | 25% | +| Solve: Preconditioner setup | 1 | 0.00268s | 14% | ++---------------------------------+-----------+------------+------------+ + +Cycle 4: + Number of active cells: 207 (6 global levels) + Partition efficiency: 0.520833 + Number of degrees of freedom: 1009 (by level: 21, 65, 225, 737, 289, 25) + Number of CG iterations: 12 + Global error estimate: 0.0332918 + Wrote solution_04.pvtu + + ++---------------------------------------------+------------+------------+ +| Total wallclock time elapsed since start | 0.0241s | | +| | | | +| Section | no. calls | wall time | % of total | ++---------------------------------+-----------+------------+------------+ +| Assemble right-hand side | 1 | 0.000313s | 1.3% | +| Estimate | 1 | 0.00116s | 4.8% | +| Output results | 1 | 0.00238s | 9.8% | +| Refine grid | 1 | 0.00422s | 18% | +| Setup | 1 | 0.00169s | 7% | +| Setup multigrid | 1 | 0.00444s | 18% | +| Solve | 1 | 0.00974s | 40% | +| Solve: 1 multigrid V-cycle | 1 | 0.000517s | 2.1% | +| Solve: CG | 1 | 0.00557s | 23% | +| Solve: Preconditioner setup | 1 | 0.00314s | 13% | ++---------------------------------+-----------+------------+------------+ + +Cycle 5: + Number of active cells: 414 (7 global levels) + Partition efficiency: 0.513993 + Number of degrees of freedom: 1953 (by level: 21, 65, 225, 815, 1108, 311, 65) + Number of CG iterations: 12 + Global error estimate: 0.0196112 + Wrote solution_05.pvtu + + ++---------------------------------------------+------------+------------+ +| Total wallclock time elapsed since start | 0.0293s | | +| | | | +| Section | no. calls | wall time | % of total | ++---------------------------------+-----------+------------+------------+ +| Assemble right-hand side | 1 | 0.000324s | 1.1% | +| Estimate | 1 | 0.00154s | 5.2% | +| Output results | 1 | 0.00281s | 9.6% | +| Refine grid | 1 | 0.00529s | 18% | +| Setup | 1 | 0.00192s | 6.5% | +| Setup multigrid | 1 | 0.00577s | 20% | +| Solve | 1 | 0.0115s | 39% | +| Solve: 1 multigrid V-cycle | 1 | 0.000583s | 2% | +| Solve: CG | 1 | 0.00665s | 23% | +| Solve: Preconditioner setup | 1 | 0.00366s | 12% | ++---------------------------------+-----------+------------+------------+ + +Cycle 6: + Number of active cells: 837 (8 global levels) + Partition efficiency: 0.536058 + Number of degrees of freedom: 3769 (by level: 21, 65, 225, 833, 2657, 913, 226, 105) + Number of CG iterations: 12 + Global error estimate: 0.0112446 + Wrote solution_06.pvtu + + ++---------------------------------------------+------------+------------+ +| Total wallclock time elapsed since start | 0.0313s | | +| | | | +| Section | no. calls | wall time | % of total | ++---------------------------------+-----------+------------+------------+ +| Assemble right-hand side | 1 | 0.000305s | 0.98% | +| Estimate | 1 | 0.00134s | 4.3% | +| Output results | 1 | 0.00278s | 8.9% | +| Refine grid | 1 | 0.0087s | 28% | +| Setup | 1 | 0.0021s | 6.7% | +| Setup multigrid | 1 | 0.00477s | 15% | +| Solve | 1 | 0.0111s | 35% | +| Solve: 1 multigrid V-cycle | 1 | 0.00053s | 1.7% | +| Solve: CG | 1 | 0.00632s | 20% | +| Solve: Preconditioner setup | 1 | 0.00372s | 12% | ++---------------------------------+-----------+------------+------------+ + +Cycle 7: + Number of active cells: 1683 (9 global levels) + Partition efficiency: 0.507926 + Number of degrees of freedom: 7415 (by level: 21, 65, 225, 833, 3111, 4372, 777, 354, 121) + Number of CG iterations: 13 + Global error estimate: 0.00671358 + Wrote solution_07.pvtu + + ++---------------------------------------------+------------+------------+ +| Total wallclock time elapsed since start | 0.0407s | | +| | | | +| Section | no. calls | wall time | % of total | ++---------------------------------+-----------+------------+------------+ +| Assemble right-hand side | 1 | 0.000322s | 0.79% | +| Estimate | 1 | 0.00259s | 6.4% | +| Output results | 1 | 0.00384s | 9.4% | +| Refine grid | 1 | 0.0129s | 32% | +| Setup | 1 | 0.00216s | 5.3% | +| Setup multigrid | 1 | 0.0064s | 16% | +| Solve | 1 | 0.0123s | 30% | +| Solve: 1 multigrid V-cycle | 1 | 0.000624s | 1.5% | +| Solve: CG | 1 | 0.00701s | 17% | +| Solve: Preconditioner setup | 1 | 0.00409s | 10% | ++---------------------------------+-----------+------------+------------+ + +Cycle 8: + Number of active cells: 3378 (10 global levels) + Partition efficiency: 0.614492 + Number of degrees of freedom: 14527 (by level: 21, 65, 225, 833, 3201, 10087, 3321, 969, 490, 161) + Number of CG iterations: 13 + Global error estimate: 0.00404791 + Wrote solution_08.pvtu + + ++---------------------------------------------+------------+------------+ +| Total wallclock time elapsed since start | 0.0608s | | +| | | | +| Section | no. calls | wall time | % of total | ++---------------------------------+-----------+------------+------------+ +| Assemble right-hand side | 1 | 0.000334s | 0.55% | +| Estimate | 1 | 0.0038s | 6.3% | +| Output results | 1 | 0.00675s | 11% | +| Refine grid | 1 | 0.0258s | 42% | +| Setup | 1 | 0.00259s | 4.3% | +| Setup multigrid | 1 | 0.00773s | 13% | +| Solve | 1 | 0.0135s | 22% | +| Solve: 1 multigrid V-cycle | 1 | 0.000676s | 1.1% | +| Solve: CG | 1 | 0.00787s | 13% | +| Solve: Preconditioner setup | 1 | 0.00439s | 7.2% | ++---------------------------------+-----------+------------+------------+ + +Cycle 9: + Number of active cells: 6765 (11 global levels) + Partition efficiency: 0.547269 + Number of degrees of freedom: 28555 (by level: 21, 65, 225, 833, 3201, 11967, 16614, 2897, 1353, 682, 193) + Number of CG iterations: 12 + Global error estimate: 0.00248866 + Wrote solution_09.pvtu + + ++---------------------------------------------+------------+------------+ +| Total wallclock time elapsed since start | 0.0916s | | +| | | | +| Section | no. calls | wall time | % of total | ++---------------------------------+-----------+------------+------------+ +| Assemble right-hand side | 1 | 0.000391s | 0.43% | +| Estimate | 1 | 0.00612s | 6.7% | +| Output results | 1 | 0.016s | 18% | +| Refine grid | 1 | 0.0356s | 39% | +| Setup | 1 | 0.00405s | 4.4% | +| Setup multigrid | 1 | 0.0114s | 12% | +| Solve | 1 | 0.0178s | 19% | +| Solve: 1 multigrid V-cycle | 1 | 0.000892s | 0.97% | +| Solve: CG | 1 | 0.0101s | 11% | +| Solve: Preconditioner setup | 1 | 0.00593s | 6.5% | ++---------------------------------+-----------+------------+------------+ + +Cycle 10: + Number of active cells: 13542 (12 global levels) + Partition efficiency: 0.612615 + Number of degrees of freedom: 56241 (by level: 21, 65, 225, 833, 3201, 12503, 39503, 12121, 3393, 1794, 1082, 241) + Number of CG iterations: 12 + Global error estimate: 0.00153864 + Wrote solution_10.pvtu + + ++---------------------------------------------+------------+------------+ +| Total wallclock time elapsed since start | 0.167s | | +| | | | +| Section | no. calls | wall time | % of total | ++---------------------------------+-----------+------------+------------+ +| Assemble right-hand side | 1 | 0.000498s | 0.3% | +| Estimate | 1 | 0.0115s | 6.9% | +| Output results | 1 | 0.0363s | 22% | +| Refine grid | 1 | 0.0724s | 43% | +| Setup | 1 | 0.00645s | 3.9% | +| Setup multigrid | 1 | 0.0165s | 9.8% | +| Solve | 1 | 0.0235s | 14% | +| Solve: 1 multigrid V-cycle | 1 | 0.00114s | 0.68% | +| Solve: CG | 1 | 0.0138s | 8.3% | +| Solve: Preconditioner setup | 1 | 0.00727s | 4.3% | ++---------------------------------+-----------+------------+------------+ + +Cycle 11: + Number of active cells: 27087 (13 global levels) + Partition efficiency: 0.545346 + Number of degrees of freedom: 111333 (by level: 21, 65, 225, 833, 3201, 12545, 47125, 65080, 10457, 4321, 2466, 1626, 401) + Number of CG iterations: 12 + Global error estimate: 0.000959538 + Wrote solution_11.pvtu + + ++---------------------------------------------+------------+------------+ +| Total wallclock time elapsed since start | 0.288s | | +| | | | +| Section | no. calls | wall time | % of total | ++---------------------------------+-----------+------------+------------+ +| Assemble right-hand side | 1 | 0.000819s | 0.28% | +| Estimate | 1 | 0.0214s | 7.4% | +| Output results | 1 | 0.08s | 28% | +| Refine grid | 1 | 0.115s | 40% | +| Setup | 1 | 0.0106s | 3.7% | +| Setup multigrid | 1 | 0.027s | 9.4% | +| Solve | 1 | 0.0328s | 11% | +| Solve: 1 multigrid V-cycle | 1 | 0.00158s | 0.55% | +| Solve: CG | 1 | 0.0195s | 6.8% | +| Solve: Preconditioner setup | 1 | 0.00974s | 3.4% | ++---------------------------------+-----------+------------+------------+ + +Cycle 12: + Number of active cells: 54207 (14 global levels) + Partition efficiency: 0.60149 + Number of degrees of freedom: 221207 (by level: 21, 65, 225, 833, 3201, 12545, 49167, 155671, 46497, 12763, 6745, 4018, 2522, 595) + Number of CG iterations: 13 + Global error estimate: 0.000599798 + Wrote solution_12.pvtu + + ++---------------------------------------------+------------+------------+ +| Total wallclock time elapsed since start | 0.599s | | +| | | | +| Section | no. calls | wall time | % of total | ++---------------------------------+-----------+------------+------------+ +| Assemble right-hand side | 1 | 0.00112s | 0.19% | +| Estimate | 1 | 0.0427s | 7.1% | +| Output results | 1 | 0.164s | 27% | +| Refine grid | 1 | 0.273s | 46% | +| Setup | 1 | 0.0169s | 2.8% | +| Setup multigrid | 1 | 0.042s | 7% | +| Solve | 1 | 0.0587s | 9.8% | +| Solve: 1 multigrid V-cycle | 1 | 0.00252s | 0.42% | +| Solve: CG | 1 | 0.039s | 6.5% | +| Solve: Preconditioner setup | 1 | 0.0137s | 2.3% | ++---------------------------------+-----------+------------+------------+ + +Cycle 13: + Number of active cells: 108438 (15 global levels) + Partition efficiency: 0.538813 + Number of degrees of freedom: 440091 (by level: 21, 65, 225, 833, 3201, 12545, 49647, 186589, 254906, 40305, 17041, 10049, 6234, 3994, 897) + Number of CG iterations: 13 + Global error estimate: 0.000376279 + Wrote solution_13.pvtu + + ++---------------------------------------------+------------+------------+ +| Total wallclock time elapsed since start | 1.1s | | +| | | | +| Section | no. calls | wall time | % of total | ++---------------------------------+-----------+------------+------------+ +| Assemble right-hand side | 1 | 0.00325s | 0.29% | +| Estimate | 1 | 0.0717s | 6.5% | +| Output results | 1 | 0.349s | 32% | +| Refine grid | 1 | 0.466s | 42% | +| Setup | 1 | 0.0314s | 2.8% | +| Setup multigrid | 1 | 0.0861s | 7.8% | +| Solve | 1 | 0.0957s | 8.7% | +| Solve: 1 multigrid V-cycle | 1 | 0.00447s | 0.4% | +| Solve: CG | 1 | 0.0623s | 5.6% | +| Solve: Preconditioner setup | 1 | 0.0232s | 2.1% | ++---------------------------------+-----------+------------+------------+ + +Cycle 14: + Number of active cells: 216939 (16 global levels) + Partition efficiency: 0.595755 + Number of degrees of freedom: 876733 (by level: 21, 65, 225, 833, 3201, 12545, 49665, 195269, 617543, 180617, 49227, 25657, 15658, 10130, 6602, 1491) + Number of CG iterations: 13 + Global error estimate: 0.00023629 + Wrote solution_14.pvtu + + ++---------------------------------------------+------------+------------+ +| Total wallclock time elapsed since start | 2.27s | | +| | | | +| Section | no. calls | wall time | % of total | ++---------------------------------+-----------+------------+------------+ +| Assemble right-hand side | 1 | 0.00391s | 0.17% | +| Estimate | 1 | 0.149s | 6.6% | +| Output results | 1 | 0.633s | 28% | +| Refine grid | 1 | 1.08s | 48% | +| Setup | 1 | 0.0624s | 2.7% | +| Setup multigrid | 1 | 0.154s | 6.8% | +| Solve | 1 | 0.188s | 8.3% | +| Solve: 1 multigrid V-cycle | 1 | 0.0081s | 0.36% | +| Solve: CG | 1 | 0.126s | 5.5% | +| Solve: Preconditioner setup | 1 | 0.0427s | 1.9% | ++---------------------------------+-----------+------------+------------+ + +Cycle 15: + Number of active cells: 433905 (17 global levels) + Partition efficiency: 0.535565 + Number of degrees of freedom: 1748479 (by level: 21, 65, 225, 833, 3201, 12545, 49665, 197397, 743221, 1008010, 158369, 66283, 38249, 24362, 15746, 10218, 2345) + Number of CG iterations: 13 + Global error estimate: 0.000148602 + Wrote solution_15.pvtu + + ++---------------------------------------------+------------+------------+ +| Total wallclock time elapsed since start | 4.25s | | +| | | | +| Section | no. calls | wall time | % of total | ++---------------------------------+-----------+------------+------------+ +| Assemble right-hand side | 1 | 0.00961s | 0.23% | +| Estimate | 1 | 0.279s | 6.6% | +| Output results | 1 | 1.2s | 28% | +| Refine grid | 1 | 1.86s | 44% | +| Setup | 1 | 0.151s | 3.5% | +| Setup multigrid | 1 | 0.352s | 8.3% | +| Solve | 1 | 0.391s | 9.2% | +| Solve: 1 multigrid V-cycle | 1 | 0.0176s | 0.42% | +| Solve: CG | 1 | 0.261s | 6.1% | +| Solve: Preconditioner setup | 1 | 0.0921s | 2.2% | ++---------------------------------+-----------+------------+------------+ @endcode Here, the timing of the `solve()` function is split up in 3 parts: setting up the multigrid preconditioner, execution of a single multigrid V-cycle, and diff --git a/examples/step-50/step-50.cc b/examples/step-50/step-50.cc index 576c9d8a73..dcc3d05de5 100644 --- a/examples/step-50/step-50.cc +++ b/examples/step-50/step-50.cc @@ -1396,6 +1396,12 @@ void LaplaceProblem::estimate() MeshWorker::assemble_own_interior_faces_once, /*boundary_worker=*/nullptr, face_worker); + + const double global_error_estimate = + std::sqrt(Utilities::MPI::sum(estimated_error_square_per_cell.l1_norm(), + MPI_COMM_WORLD)); + pcout << " Global error estimate: " << global_error_estimate + << std::endl; } -- 2.39.5