@@ -21,27 +21,27 @@ class ScalarSweeper
2121 typedef pfasst::encap::Encapsulation<time> encap_type;
2222 typedef pfasst::encap::VectorEncapsulation<complex <double >> complex_vector_type;
2323
24- complex <double > _lambda, _u0 ;
25- int _n_f_expl_eval, _n_f_impl_eval, _n_impl_solve ;
24+ complex <double > lambda, u0 ;
25+ size_t n_f_expl_eval, n_f_impl_eval, n_impl_solve ;
2626 const complex <double > i_complex = complex <double >(0 , 1 );
27- double _error ;
27+ double error ;
2828
2929 public:
3030 ScalarSweeper (complex <double > lambda, complex <double > u0)
31- : _lambda (lambda)
32- , _u0 (u0)
33- , _n_f_expl_eval (0 )
34- , _n_f_impl_eval (0 )
35- , _n_impl_solve (0 )
36- , _error (0.0 )
31+ : lambda (lambda)
32+ , u0 (u0)
33+ , n_f_expl_eval (0 )
34+ , n_f_impl_eval (0 )
35+ , n_impl_solve (0 )
36+ , error (0.0 )
3737 {}
3838
3939 virtual ~ScalarSweeper ()
4040 {
41- cout << " Final error: " << scientific << this ->_error << endl;
42- cout << " Number of explicit evaluations: " << this ->_n_f_expl_eval << endl;
43- cout << " Number of implicit evaluations: " << this ->_n_f_impl_eval << endl;
44- cout << " Number of implicit solves: " << this ->_n_impl_solve << endl;
41+ cout << " Final error: " << scientific << this ->error << endl;
42+ cout << " Number of explicit evaluations: " << this ->n_f_expl_eval << endl;
43+ cout << " Number of implicit evaluations: " << this ->n_f_impl_eval << endl;
44+ cout << " Number of implicit solves: " << this ->n_impl_solve << endl;
4545 }
4646
4747 void echo_error (time t)
@@ -53,12 +53,12 @@ class ScalarSweeper
5353 this ->exact (qex, t);
5454 double max_err = abs (qend[0 ] - qex[0 ]) / abs (qex[0 ]);
5555 cout << " err: " << scientific << max_err << endl;
56- this ->_error = max_err;
56+ this ->error = max_err;
5757 }
58-
58+
5959 double get_errors ()
6060 {
61- return this ->_error ;
61+ return this ->error ;
6262 }
6363
6464 void predict (bool initial) override
@@ -79,7 +79,7 @@ class ScalarSweeper
7979
8080 void exact (complex_vector_type& q, time t)
8181 {
82- q[0 ] = this ->_u0 * exp (this ->_lambda * t);
82+ q[0 ] = this ->u0 * exp (this ->lambda * t);
8383 }
8484
8585 void exact (shared_ptr<encap_type> q_encap, time t)
@@ -96,9 +96,9 @@ class ScalarSweeper
9696 auto & q = pfasst::encap::as_vector<complex <double >, time>(q_encap);
9797
9898 // f_expl = multiply with imaginary part of lambda
99- f[0 ] = this ->i_complex * imag (this ->_lambda ) * q[0 ];
99+ f[0 ] = this ->i_complex * imag (this ->lambda ) * q[0 ];
100100
101- this ->_n_f_expl_eval ++;
101+ this ->n_f_expl_eval ++;
102102 }
103103
104104 void f_impl_eval (shared_ptr<encap_type> f_encap,
@@ -109,9 +109,9 @@ class ScalarSweeper
109109 auto & q = pfasst::encap::as_vector<complex <double >, time>(q_encap);
110110
111111 // f_impl = multiply with real part of lambda
112- f[0 ] = real (this ->_lambda ) * q[0 ];
112+ f[0 ] = real (this ->lambda ) * q[0 ];
113113
114- this ->_n_f_impl_eval ++;
114+ this ->n_f_impl_eval ++;
115115 }
116116
117117 void impl_solve (shared_ptr<encap_type> f_encap,
@@ -124,11 +124,11 @@ class ScalarSweeper
124124 auto & rhs = pfasst::encap::as_vector<complex <double >, time>(rhs_encap);
125125
126126 // invert f_impl = multiply with inverse of real part of lambda
127- double inv = 1.0 / (1.0 - double (dt) * real (this ->_lambda ));
127+ double inv = 1.0 / (1.0 - double (dt) * real (this ->lambda ));
128128 q[0 ] = inv * rhs[0 ];
129- f[0 ] = real (this ->_lambda ) * q[0 ];
129+ f[0 ] = real (this ->lambda ) * q[0 ];
130130
131- this ->_n_impl_solve ++;
131+ this ->n_impl_solve ++;
132132 }
133133};
134134
0 commit comments