Skip to content

Commit bd13e5d

Browse files
author
Matthew Emmett
committed
interfaces: Split out restrict_initial from restrict.
1 parent 0f956e0 commit bd13e5d

File tree

2 files changed

+24
-14
lines changed

2 files changed

+24
-14
lines changed

include/pfasst/interfaces.hpp

Lines changed: 17 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -158,10 +158,10 @@ namespace pfasst
158158

159159

160160
/**
161-
* Interpolate initial condition (in space) from the coarse sweeper to the fine sweeper.
161+
* Interpolate initial condition from the coarse sweeper to the fine sweeper.
162162
*/
163-
virtual void interpolate_initial(shared_ptr<ISweeper<time>> dst,
164-
shared_ptr<const ISweeper<time>> src)
163+
virtual void interpolate_initial(shared_ptr<ISweeper<time>> /*dst*/,
164+
shared_ptr<const ISweeper<time>> /*src*/)
165165
{
166166
NotImplementedYet("pfasst");
167167
}
@@ -177,15 +177,27 @@ namespace pfasst
177177
bool interp_initial = false) = 0;
178178

179179

180+
/**
181+
* Restrict initial condition from the fine sweeper to the coarse sweeper.
182+
* @param[in] restrict_initial
183+
* `true` if the initial condition should also be restricted.
184+
*/
185+
virtual void restrict_initial(shared_ptr<ISweeper<time>> /*dst*/,
186+
shared_ptr<const ISweeper<time>> /*src*/)
187+
{
188+
NotImplementedYet("pfasst");
189+
}
190+
191+
180192
/**
181193
* Restrict, in time and space, from the fine sweeper to the coarse sweeper.
182194
* @param[in] restrict_initial
183195
* `true` if the initial condition should also be restricted.
184196
*/
185197
virtual void restrict(shared_ptr<ISweeper<time>> dst,
186198
shared_ptr<const ISweeper<time>> src,
187-
bool restrict_initial = false,
188-
bool restrict_initial_only = false) = 0;
199+
bool restrict_initial = false) = 0;
200+
189201

190202
/**
191203
* Compute FAS correction between the coarse and fine sweepers.

include/pfasst/pfasst.hpp

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ namespace pfasst
5454
auto crse = l.current();
5555
auto fine = l.fine();
5656
auto trns = l.transfer();
57-
trns->restrict(crse, fine, true, true);
57+
trns->restrict_initial(crse, fine);
5858
crse->spread();
5959
crse->save();
6060
}
@@ -63,9 +63,7 @@ namespace pfasst
6363
predict = true;
6464
auto crse = this->coarsest().current();
6565
for (int nstep = 0; nstep < comm->rank() + 1; nstep++) {
66-
// this->set_step(comm->rank());
67-
// XXX: set iteration?
68-
66+
// XXX: set iteration and step?
6967
perform_sweeps(0);
7068
if (nstep < comm->rank()) {
7169
crse->advance();
@@ -121,14 +119,16 @@ namespace pfasst
121119
}
122120

123121
perform_sweeps(this->nlevels() - 1);
124-
// XXX check convergence
122+
123+
// note: convergence checks belong here...
124+
125125
auto fine = this->get_level(this->nlevels() - 1);
126126
auto crse = this->get_level(this->nlevels() - 2);
127127
auto trns = this->get_transfer(this->nlevels() - 1);
128128

129129
int tag = (this->nlevels() - 1) * 10000 + this->get_iteration() + 10;
130130
fine->send(comm, tag, false);
131-
trns->restrict(crse, fine, true, false);
131+
trns->restrict(crse, fine, true);
132132
trns->fas(this->get_time_step(), crse, fine);
133133
crse->save();
134134

@@ -137,7 +137,6 @@ namespace pfasst
137137
trns->interpolate(fine, crse, true);
138138
fine->recv(comm, tag, false);
139139
trns->interpolate_initial(fine, crse);
140-
// XXX: call interpolate_q0(pf,F, G)
141140
}
142141

143142
if (nblock < nblocks - 1) {
@@ -161,7 +160,7 @@ namespace pfasst
161160
fine->send(comm, tag, false);
162161

163162
auto dt = this->get_time_step();
164-
trns->restrict(crse, fine, true, false);
163+
trns->restrict(crse, fine, true);
165164
trns->fas(dt, crse, fine);
166165
crse->save();
167166

@@ -186,7 +185,6 @@ namespace pfasst
186185

187186
int tag = l.level * 10000 + this->get_iteration() + 10;
188187
fine->recv(comm, tag, false);
189-
// XXX call interpolate_q0(pf,F, G)
190188
trns->interpolate_initial(fine, crse);
191189

192190
if (l < this->finest()) {

0 commit comments

Comments
 (0)