Skip to content

Commit dc3dd5e

Browse files
committed
bugfixes and documentation
1 parent d1a55c9 commit dc3dd5e

File tree

6 files changed

+47
-6
lines changed

6 files changed

+47
-6
lines changed
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
Full code: `pySDC/projects/matrixPFASST/compare_to_matrixbased.py <https://github.com/Parallel-in-Time/pySDC/blob/master/pySDC/projects/matrixPFASST/compare_to_matrixbased.py>`_
2+
3+
.. literalinclude:: ../../../pySDC/projects/matrixPFASST/compare_to_matrixbased.py
4+
5+
Results:
6+
7+
.. literalinclude:: ../../../comparison_matrix_vs_nomat_detail.txt
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
Full code: `pySDC/projects/matrixPFASST/compare_to_propagator.py <https://github.com/Parallel-in-Time/pySDC/blob/master/pySDC/projects/matrixPFASST/compare_to_propagator.py>`_
2+
3+
.. literalinclude:: ../../../pySDC/projects/matrixPFASST/compare_to_propagator.py
4+
5+
Results:
6+
7+
.. literalinclude:: ../../../comparison_matrix_vs_propagator_detail.txt
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
.. include:: /../../pySDC/projects/matrixPFASST/README.rst

pySDC/implementations/controller_classes/allinclusive_multigrid_MPI.py

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -291,7 +291,6 @@ def pfasst(self, comm, num_procs):
291291
else: # SDC
292292
self.S.status.stage = 'IT_FINE'
293293

294-
295294
else:
296295
self.S.levels[0].sweep.compute_end_point()
297296
self.hooks.post_step(step=self.S, level_number=0)
@@ -334,8 +333,6 @@ def pfasst(self, comm, num_procs):
334333

335334
# go up the hierarchy from finest to coarsest level (parallel)
336335

337-
338-
339336
self.S.transfer(source=self.S.levels[0], target=self.S.levels[1])
340337

341338
# sweep and send on middle levels (not on finest, not on coarsest, though)
@@ -451,7 +448,8 @@ def pfasst(self, comm, num_procs):
451448
self.logger.debug('recv data: process %s, stage %s, time %s, source %s, tag %s, iter %s' %
452449
(self.S.status.slot, self.S.status.stage, self.S.time, self.S.prev,
453450
l - 1, self.S.status.iter))
454-
self.recv(target=self.S.levels[l - 1], source=self.S.prev, tag=self.S.status.iter, comm=comm)
451+
self.recv(target=self.S.levels[l - 1], source=self.S.prev, tag=self.S.status.iter,
452+
comm=comm)
455453

456454
if not self.S.status.last and self.params.fine_comm:
457455
req_send.wait()

pySDC/implementations/problem_classes/Van_der_Pol_implicit.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,9 +27,9 @@ def __init__(self, problem_params, dtype_u, dtype_f):
2727
if key not in problem_params:
2828
msg = 'need %s to instantiate problem, only got %s' % (key, str(problem_params.keys()))
2929
raise ParameterError(msg)
30-
30+
problem_params['nvars'] = 2
3131
# invoke super init, passing dtype_u and dtype_f, plus setting number of elements to 2
32-
super(vanderpol, self).__init__(2, dtype_u, dtype_f, problem_params)
32+
super(vanderpol, self).__init__(problem_params['nvars'], dtype_u, dtype_f, problem_params)
3333

3434
def u_exact(self, t):
3535
"""
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
Matrix-based versions of PFASST
2+
===============================
3+
4+
In this project, we use and test two matrix-based version of PFASST for linear problems:
5+
we write PFASST as a standard twogrid method and we derive the propagaton matrix of PFASST.
6+
Both approaches are compared to the standard multigrid controller of PFASST and with each other.
7+
This includes tests with the heat, the advection as well as the test equation.
8+
9+
Matrix-based PFASST
10+
-------------------
11+
12+
When written as a multigrid method for a linear composite collocation problem, PFASST can be compactly defined via a
13+
smoothing and a coarse-grid correction step, just as a standard two-grid method. In the new (and very specialized)
14+
controller ``allinclusive_matrix_nonMPI.py``, this concept is exploited to obtain a PFASST (and MLSDC and SDC)
15+
controller closely resembling this idea and notation. In ``compare_to_matrixbased.py``, this controller is tested
16+
against the standard PFASST implementation.
17+
18+
.. include:: doc_matrixPFASST_matrix.rst
19+
20+
Propagator-based PFASST
21+
-----------------------
22+
23+
The second approach follows directly from the matrix formulation: instead of writing PFASST as an iterative scheme,
24+
we now derive the full propagation matrix, which takes the initial value u0 and produces the final value uend,
25+
over all steps, iterations and sweeps. This matrix can be used to analyze PFASST in yet another exciting way.
26+
27+
.. include:: doc_matrixPFASST_propagator.rst
28+

0 commit comments

Comments
 (0)