Skip to content

Commit a4b737a

Browse files
committed
renaming a few variables
as suggested by @memmett
1 parent 58a1840 commit a4b737a

File tree

2 files changed

+47
-47
lines changed

2 files changed

+47
-47
lines changed

examples/advection_diffusion/advection_diffusion_sweeper.hpp

Lines changed: 28 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -155,68 +155,68 @@ class AdvectionDiffusionSweeper
155155
/**
156156
* @copybrief pfasst::encap::IMEXSweeper::f_expl_eval()
157157
*/
158-
void f_expl_eval(shared_ptr<Encapsulation<time>> f_expl,
159-
shared_ptr<Encapsulation<time>> u,
158+
void f_expl_eval(shared_ptr<Encapsulation<time>> f_expl_encap,
159+
shared_ptr<Encapsulation<time>> u_encap,
160160
time t) override
161161
{
162162
UNUSED(t);
163-
auto& u_cast = as_vector<double, time>(u);
164-
auto& f_expl_cast = as_vector<double, time>(f_expl);
163+
auto& u = as_vector<double, time>(u_encap);
164+
auto& f_expl = as_vector<double, time>(f_expl_encap);
165165

166-
double c = -v / double(u_cast.size());
166+
double c = -v / double(u.size());
167167

168-
auto* z = this->fft.forward(u_cast);
169-
for (size_t i = 0; i < u_cast.size(); i++) {
168+
auto* z = this->fft.forward(u);
169+
for (size_t i = 0; i < u.size(); i++) {
170170
z[i] *= c * this->ddx[i];
171171
}
172-
this->fft.backward(f_expl_cast);
172+
this->fft.backward(f_expl);
173173

174174
this->nf1evals++;
175175
}
176176

177177
/**
178178
* @copybrief pfasst::encap::IMEXSweeper::f_impl_eval()
179179
*/
180-
void f_impl_eval(shared_ptr<Encapsulation<time>> f_impl,
181-
shared_ptr<Encapsulation<time>> u,
180+
void f_impl_eval(shared_ptr<Encapsulation<time>> f_impl_encap,
181+
shared_ptr<Encapsulation<time>> u_encap,
182182
time t) override
183183
{
184184
UNUSED(t);
185-
auto& u_cast = as_vector<double, time>(u);
186-
auto& f_impl_cast = as_vector<double, time>(f_impl);
185+
auto& u = as_vector<double, time>(u_encap);
186+
auto& f_impl = as_vector<double, time>(f_impl_encap);
187187

188-
double c = nu / double(u_cast.size());
188+
double c = nu / double(u.size());
189189

190-
auto* z = this->fft.forward(u_cast);
191-
for (size_t i = 0; i < u_cast.size(); i++) {
190+
auto* z = this->fft.forward(u);
191+
for (size_t i = 0; i < u.size(); i++) {
192192
z[i] *= c * this->lap[i];
193193
}
194-
this->fft.backward(f_impl_cast);
194+
this->fft.backward(f_impl);
195195
}
196196

197197
/**
198198
* @copybrief pfasst::encap::IMEXSweeper::impl_solve()
199199
*/
200-
void impl_solve(shared_ptr<Encapsulation<time>> f_impl,
201-
shared_ptr<Encapsulation<time>> u,
200+
void impl_solve(shared_ptr<Encapsulation<time>> f_impl_encap,
201+
shared_ptr<Encapsulation<time>> u_encap,
202202
time t, time dt,
203-
shared_ptr<Encapsulation<time>> rhs) override
203+
shared_ptr<Encapsulation<time>> rhs_encap) override
204204
{
205205
UNUSED(t);
206-
auto& u_cast = as_vector<double, time>(u);
207-
auto& f_impl_cast = as_vector<double, time>(f_impl);
208-
auto& rhs_cast = as_vector<double, time>(rhs);
206+
auto& u = as_vector<double, time>(u_encap);
207+
auto& f_impl = as_vector<double, time>(f_impl_encap);
208+
auto& rhs = as_vector<double, time>(rhs_encap);
209209

210210
double c = nu * double(dt);
211211

212-
auto* z = this->fft.forward(rhs_cast);
213-
for (size_t i = 0; i < u_cast.size(); i++) {
214-
z[i] /= (1.0 - c * this->lap[i]) * double(u_cast.size());
212+
auto* z = this->fft.forward(rhs);
213+
for (size_t i = 0; i < u.size(); i++) {
214+
z[i] /= (1.0 - c * this->lap[i]) * double(u.size());
215215
}
216-
this->fft.backward(u_cast);
216+
this->fft.backward(u);
217217

218-
for (size_t i = 0; i < u_cast.size(); i++) {
219-
f_impl_cast[i] = (u_cast[i] - rhs_cast[i]) / double(dt);
218+
for (size_t i = 0; i < u.size(); i++) {
219+
f_impl[i] = (u[i] - rhs[i]) / double(dt);
220220
}
221221
}
222222
//! @}

include/pfasst/encap/imex_sweeper.hpp

Lines changed: 19 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -300,18 +300,18 @@ namespace pfasst
300300
/**
301301
* Evaluates the explicit part of the right hand side at the given time.
302302
*
303-
* @param[in,out] f_expl Encapsulation to store the evaluated right hand side
304-
* @param[in] u Encapsulation storing the solution values to use for computing the explicit
305-
* part of the right hand side
303+
* @param[in,out] f_expl_encap Encapsulation to store the evaluated right hand side
304+
* @param[in] u_encap Encapsulation storing the solution values to use for computing the
305+
* explicit part of the right hand side
306306
* @param[in] t time point of the evaluation
307307
*
308308
* @note This method must be implemented in derived sweepers.
309309
*/
310-
virtual void f_expl_eval(shared_ptr<Encapsulation<time>> f_expl,
311-
shared_ptr<Encapsulation<time>> u,
310+
virtual void f_expl_eval(shared_ptr<Encapsulation<time>> f_expl_encap,
311+
shared_ptr<Encapsulation<time>> u_encap,
312312
time t)
313313
{
314-
UNUSED(f_expl); UNUSED(u); UNUSED(t);
314+
UNUSED(f_expl_encap); UNUSED(u_encap); UNUSED(t);
315315
throw NotImplementedYet("imex (f_expl_eval)");
316316
}
317317

@@ -321,18 +321,18 @@ namespace pfasst
321321
* This is typically called to compute the implicit part of the right hand side at the first
322322
* collocation node, and on all nodes after restriction or interpolation.
323323
*
324-
* @param[in,out] f_impl Encapsulation to store the evaluated right hand side
325-
* @param[in] u Encapsulation storing the solution values to use for computing the implicit
326-
* part of the right hand side
324+
* @param[in,out] f_impl_encap Encapsulation to store the evaluated right hand side
325+
* @param[in] u_encap Encapsulation storing the solution values to use for computing the
326+
* implicit part of the right hand side
327327
* @param[in] t time point of the evaluation
328328
*
329329
* @note This method must be implemented in derived sweepers.
330330
*/
331-
virtual void f_impl_eval(shared_ptr<Encapsulation<time>> f_impl,
332-
shared_ptr<Encapsulation<time>> u,
331+
virtual void f_impl_eval(shared_ptr<Encapsulation<time>> f_impl_encap,
332+
shared_ptr<Encapsulation<time>> u_encap,
333333
time t)
334334
{
335-
UNUSED(f_impl); UNUSED(u); UNUSED(t);
335+
UNUSED(f_impl_encap); UNUSED(u_encap); UNUSED(t);
336336
throw NotImplementedYet("imex (f_impl_eval)");
337337
}
338338

@@ -344,20 +344,20 @@ namespace pfasst
344344
* This routine (implemented by the user) performs the solve required to perform one
345345
* backward-Euler sub-step, and also returns \\(f_{\\rm impl}(U)\\).
346346
*
347-
* @param[in,out] f_impl Encapsulation to store the evaluated right hand side
348-
* @param[in,out] u Encapsulation to store the solution of the backward-Euler sub-step
347+
* @param[in,out] f_encap Encapsulation to store the evaluated right hand side
348+
* @param[in,out] u_encap Encapsulation to store the solution of the backward-Euler sub-step
349349
* @param[in] t time point (of \\(RHS\\))
350350
* @param[in] dt sub-step size to the previous time point (\\(\\Delta t \\))
351-
* @param[in] rhs Encapsulation storing \\(RHS\\)
351+
* @param[in] rhs_encap Encapsulation storing \\(RHS\\)
352352
*
353353
* @note This method must be implemented in derived sweepers.
354354
*/
355-
virtual void impl_solve(shared_ptr<Encapsulation<time>> f,
356-
shared_ptr<Encapsulation<time>> q,
355+
virtual void impl_solve(shared_ptr<Encapsulation<time>> f_encap,
356+
shared_ptr<Encapsulation<time>> u_encap,
357357
time t, time dt,
358-
shared_ptr<Encapsulation<time>> rhs)
358+
shared_ptr<Encapsulation<time>> rhs_encap)
359359
{
360-
UNUSED(f); UNUSED(q); UNUSED(t); UNUSED(dt); UNUSED(rhs);
360+
UNUSED(f_encap); UNUSED(u_encap); UNUSED(t); UNUSED(dt); UNUSED(rhs_encap);
361361
throw NotImplementedYet("imex (f2comp)");
362362
}
363363
//! @}

0 commit comments

Comments
 (0)