Skip to content

Commit a14ae85

Browse files
committed
some code cleanup (line length)
1 parent a6a14fc commit a14ae85

File tree

11 files changed

+61
-28
lines changed

11 files changed

+61
-28
lines changed

examples/advection_diffusion/advection_diffusion_sweeper.hpp

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,8 @@
2020
using namespace std;
2121

2222
template<typename time = pfasst::time_precision>
23-
class AdvectionDiffusionSweeper : public pfasst::encap::IMEXSweeper<time>
23+
class AdvectionDiffusionSweeper
24+
: public pfasst::encap::IMEXSweeper<time>
2425
{
2526
typedef pfasst::encap::Encapsulation<time> Encapsulation;
2627
typedef pfasst::encap::VectorEncapsulation<double> DVectorT;
@@ -88,7 +89,9 @@ class AdvectionDiffusionSweeper : public pfasst::encap::IMEXSweeper<time>
8889
double d = abs(qend->at(i) - qex->at(i));
8990
if (d > max) { max = d; }
9091
}
91-
cout << "err: " << scientific << max << " (" << qend->size() << ", " << predict << ")" << endl;
92+
cout << "err: " << scientific << max
93+
<< " (" << qend->size() << ", " << predict << ")"
94+
<< endl;
9295
}
9396

9497
void predict(time t, time dt, bool initial)
@@ -147,7 +150,8 @@ class AdvectionDiffusionSweeper : public pfasst::encap::IMEXSweeper<time>
147150
fft.backward(f);
148151
}
149152

150-
void f2comp(shared_ptr<Encapsulation> f, shared_ptr<Encapsulation> q, time t, time dt, shared_ptr<Encapsulation> rhs)
153+
void f2comp(shared_ptr<Encapsulation> f, shared_ptr<Encapsulation> q, time t, time dt,
154+
shared_ptr<Encapsulation> rhs)
151155
{
152156
shared_ptr<DVectorT> f_cast = dynamic_pointer_cast<DVectorT>(f);
153157
assert(f_cast);
@@ -159,7 +163,8 @@ class AdvectionDiffusionSweeper : public pfasst::encap::IMEXSweeper<time>
159163
this->f2comp(f_cast, q_cast, t, dt, rhs_cast);
160164
}
161165

162-
void f2comp(shared_ptr<DVectorT> f, shared_ptr<DVectorT> q, time t, time dt, shared_ptr<DVectorT> rhs)
166+
void f2comp(shared_ptr<DVectorT> f, shared_ptr<DVectorT> q, time t, time dt,
167+
shared_ptr<DVectorT> rhs)
163168
{
164169
auto* z = fft.forward(rhs);
165170
for (size_t i = 0; i < q->size(); i++) {

examples/advection_diffusion/spectral_transfer_1d.hpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,8 @@
1414
#include "fft.hpp"
1515

1616
template<typename time = pfasst::time_precision>
17-
class SpectralTransfer1D : public pfasst::encap::PolyInterpMixin<time>
17+
class SpectralTransfer1D
18+
: public pfasst::encap::PolyInterpMixin<time>
1819
{
1920
typedef pfasst::encap::Encapsulation<double> Encapsulation;
2021
typedef pfasst::encap::VectorEncapsulation<double> DVectorT;

include/pfasst/controller.hpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,9 @@ namespace pfasst
4343
this->niters = niters;
4444
}
4545

46-
void add_level(shared_ptr<ISweeper<time>> swpr, shared_ptr<ITransfer<time>> trnsfr = shared_ptr<ITransfer<time>>(nullptr), bool coarse = true)
46+
void add_level(shared_ptr<ISweeper<time>> swpr,
47+
shared_ptr<ITransfer<time>> trnsfr = shared_ptr<ITransfer<time>>(nullptr),
48+
bool coarse = true)
4749
{
4850
if (coarse) {
4951
levels.push_front(swpr);

include/pfasst/encap/encap_sweeper.hpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,8 @@ namespace pfasst
1717
{
1818

1919
template<typename time = time_precision>
20-
class EncapSweeper : public ISweeper<time>
20+
class EncapSweeper
21+
: public ISweeper<time>
2122
{
2223
vector<time> nodes;
2324
shared_ptr<EncapFactory<time>> factory;

include/pfasst/encap/imex_sweeper.hpp

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,8 @@ namespace pfasst
1919
using pfasst::encap::Encapsulation;
2020

2121
template<typename time = time_precision>
22-
class IMEXSweeper : public pfasst::encap::EncapSweeper<time>
22+
class IMEXSweeper
23+
: public pfasst::encap::EncapSweeper<time>
2324
{
2425
vector<shared_ptr<Encapsulation<time>>> Q, pQ, S, T, Fe, Fi;
2526
matrix<time> Smat, SEmat, SImat;
@@ -164,17 +165,20 @@ namespace pfasst
164165
f2eval(Fi[m], Q[m], t);
165166
}
166167

167-
virtual void f1eval(shared_ptr<Encapsulation<time>> F, shared_ptr<Encapsulation<time>> Q, time t)
168+
virtual void f1eval(shared_ptr<Encapsulation<time>> F, shared_ptr<Encapsulation<time>> Q,
169+
time t)
168170
{
169171
throw NotImplementedYet("imex (f1eval)");
170172
}
171173

172-
virtual void f2eval(shared_ptr<Encapsulation<time>> F, shared_ptr<Encapsulation<time>> Q, time t)
174+
virtual void f2eval(shared_ptr<Encapsulation<time>> F, shared_ptr<Encapsulation<time>> Q,
175+
time t)
173176
{
174177
throw NotImplementedYet("imex (f2eval)");
175178
}
176179

177-
virtual void f2comp(shared_ptr<Encapsulation<time>> F, shared_ptr<Encapsulation<time>> Q, time t, time dt,
180+
virtual void f2comp(shared_ptr<Encapsulation<time>> F, shared_ptr<Encapsulation<time>> Q,
181+
time t, time dt,
178182
shared_ptr<Encapsulation<time>> rhs)
179183
{
180184
throw NotImplementedYet("imex (f2comp)");

include/pfasst/encap/poly_interp.hpp

Lines changed: 23 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -18,14 +18,16 @@ namespace pfasst
1818
{
1919

2020
template<typename time = time_precision>
21-
class PolyInterpMixin : public pfasst::ITransfer<time>
21+
class PolyInterpMixin
22+
: public pfasst::ITransfer<time>
2223
{
2324
matrix<time> tmat, fmat;
2425

2526
public:
2627
virtual ~PolyInterpMixin() { }
2728

28-
virtual void interpolate(shared_ptr<ISweeper<time>> dst, shared_ptr<const ISweeper<time>> src,
29+
virtual void interpolate(shared_ptr<ISweeper<time>> dst,
30+
shared_ptr<const ISweeper<time>> src,
2931
bool interp_delta_from_initial,
3032
bool interp_initial)
3133
{
@@ -37,7 +39,8 @@ namespace pfasst
3739
this->interpolate(fine, crse, interp_delta_from_initial, interp_initial);
3840
}
3941

40-
virtual void interpolate(shared_ptr<EncapSweeper<time>> fine, shared_ptr<const EncapSweeper<time>> crse,
42+
virtual void interpolate(shared_ptr<EncapSweeper<time>> fine,
43+
shared_ptr<const EncapSweeper<time>> crse,
4144
bool interp_delta_from_initial,
4245
bool interp_initial)
4346
{
@@ -83,7 +86,9 @@ namespace pfasst
8386
for (size_t m = m0; m < nfine; m++) { fine->evaluate(m); }
8487
}
8588

86-
virtual void restrict(shared_ptr<ISweeper<time>> dst, shared_ptr<const ISweeper<time>> src, bool restrict_initial)
89+
virtual void restrict(shared_ptr<ISweeper<time>> dst,
90+
shared_ptr<const ISweeper<time>> src,
91+
bool restrict_initial)
8792
{
8893
shared_ptr<EncapSweeper<time>> crse = dynamic_pointer_cast<EncapSweeper<time>>(dst);
8994
assert(crse);
@@ -93,7 +98,9 @@ namespace pfasst
9398
this->restrict(crse, fine, restrict_initial);
9499
}
95100

96-
virtual void restrict(shared_ptr<EncapSweeper<time>> crse, shared_ptr<const EncapSweeper<time>> fine, bool restrict_initial)
101+
virtual void restrict(shared_ptr<EncapSweeper<time>> crse,
102+
shared_ptr<const EncapSweeper<time>> fine,
103+
bool restrict_initial)
97104
{
98105
auto dnodes = crse->get_nodes();
99106
auto snodes = fine->get_nodes();
@@ -115,7 +122,8 @@ namespace pfasst
115122
for (size_t m = m0; m < ncrse; m++) { crse->evaluate(m); }
116123
}
117124

118-
virtual void fas(time dt, shared_ptr<ISweeper<time>> dst, shared_ptr<const ISweeper<time>> src)
125+
virtual void fas(time dt, shared_ptr<ISweeper<time>> dst,
126+
shared_ptr<const ISweeper<time>> src)
119127
{
120128
shared_ptr<EncapSweeper<time>> crse = dynamic_pointer_cast<EncapSweeper<time>>(dst);
121129
assert(crse);
@@ -125,7 +133,8 @@ namespace pfasst
125133
this->fas(dt, crse, fine);
126134
}
127135

128-
virtual void fas(time dt, shared_ptr<EncapSweeper<time>> crse, shared_ptr<const EncapSweeper<time>> fine)
136+
virtual void fas(time dt, shared_ptr<EncapSweeper<time>> crse,
137+
shared_ptr<const EncapSweeper<time>> fine)
129138
{
130139
size_t ncrse = crse->get_nodes().size();
131140
assert(ncrse > 1);
@@ -135,7 +144,9 @@ namespace pfasst
135144
auto crse_factory = crse->get_factory();
136145
auto fine_factory = fine->get_factory();
137146

138-
vector<shared_ptr<Encapsulation<time>>> crse_z2n(ncrse - 1), fine_z2n(nfine - 1), rstr_z2n(ncrse - 1);
147+
vector<shared_ptr<Encapsulation<time>>> crse_z2n(ncrse - 1)
148+
, fine_z2n(nfine - 1)
149+
, rstr_z2n(ncrse - 1);
139150
for (size_t m = 0; m < ncrse - 1; m++) { crse_z2n[m] = crse_factory->create(solution); }
140151
for (size_t m = 0; m < ncrse - 1; m++) { rstr_z2n[m] = crse_factory->create(solution); }
141152
for (size_t m = 0; m < nfine - 1; m++) { fine_z2n[m] = fine_factory->create(solution); }
@@ -177,12 +188,14 @@ namespace pfasst
177188
}
178189

179190
// required for interp/restrict helpers
180-
virtual void interpolate(shared_ptr<Encapsulation<time>> dst, shared_ptr<const Encapsulation<time>> src)
191+
virtual void interpolate(shared_ptr<Encapsulation<time>> dst,
192+
shared_ptr<const Encapsulation<time>> src)
181193
{
182194
throw NotImplementedYet("mlsdc/pfasst");
183195
}
184196

185-
virtual void restrict(shared_ptr<Encapsulation<time>> dst, shared_ptr<const Encapsulation<time>> src)
197+
virtual void restrict(shared_ptr<Encapsulation<time>> dst,
198+
shared_ptr<const Encapsulation<time>> src)
186199
{
187200
throw NotImplementedYet("mlsdc/pfasst");
188201
}

include/pfasst/encap/vector.hpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,8 @@ namespace pfasst
2727
* precision of the time points; defaults to pfasst::time_precision
2828
*/
2929
template<typename scalar, typename time = time_precision>
30-
class VectorEncapsulation : public vector<scalar>, public Encapsulation<time>
30+
class VectorEncapsulation
31+
: public vector<scalar>, public Encapsulation<time>
3132
{
3233
public:
3334
//! @{

include/pfasst/interfaces.hpp

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,8 @@ namespace pfasst
128128
* @param[in] interp_initial
129129
* `true` if a delta for the initial condtion should also be computed (PFASST).
130130
*/
131-
virtual void interpolate(shared_ptr<ISweeper<time>> dst, shared_ptr<const ISweeper<time>> src,
131+
virtual void interpolate(shared_ptr<ISweeper<time>> dst,
132+
shared_ptr<const ISweeper<time>> src,
132133
bool interp_delta_from_initial = false,
133134
bool interp_initial = false) = 0;
134135

@@ -137,13 +138,15 @@ namespace pfasst
137138
* @param[in] restrict_initial
138139
* `true` if the initial condition should also be restricted.
139140
*/
140-
virtual void restrict(shared_ptr<ISweeper<time>> dst, shared_ptr<const ISweeper<time>> src,
141+
virtual void restrict(shared_ptr<ISweeper<time>> dst,
142+
shared_ptr<const ISweeper<time>> src,
141143
bool restrict_initial = false) = 0;
142144

143145
/**
144146
* compute FAS correction between the coarse and fine sweepers.
145147
*/
146-
virtual void fas(time dt, shared_ptr<ISweeper<time>> dst, shared_ptr<const ISweeper<time>> src) = 0;
148+
virtual void fas(time dt, shared_ptr<ISweeper<time>> dst,
149+
shared_ptr<const ISweeper<time>> src) = 0;
147150

148151
};
149152

include/pfasst/mlsdc.hpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,8 @@ namespace pfasst
1818
{
1919

2020
template<typename time = double>
21-
class MLSDC : public Controller<time>
21+
class MLSDC
22+
: public Controller<time>
2223
{
2324
vector<size_t> nsweeps;
2425
bool predict, initial;

include/pfasst/pfasst.hpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,8 @@ namespace pfasst
1313
{
1414

1515
template<typename timeT>
16-
class PFASST : public Controller<timeT>
16+
class PFASST
17+
: public Controller<timeT>
1718
{
1819

1920
void run(timeT dt, size_t nsteps)

0 commit comments

Comments
 (0)