@@ -14,11 +14,10 @@ template<typename time = pfasst::time_precision>
1414/* *
1515 * Sweeper for scalar test equation
1616 *
17- * u' = lambda*u, u(0) = u0
17+ * \\( u' = \\ lambda*u \\quad\\text{ , } u(0) = u_0 \\)
1818 *
19- * with complex lambda using an IMEX scheme. Derived from the generic imex_sweeper
19+ * with complex lambda using an IMEX scheme. Derived from the generic imex_sweeper.
2020 *
21- * ScalarSweeper is derived from the generic IMEXSweeper
2221 */
2322class ScalarSweeper
2423 : public pfasst::encap::IMEXSweeper<time>
@@ -31,7 +30,7 @@ class ScalarSweeper
3130 typedef pfasst::encap::VectorEncapsulation<complex <double >> complex_vector_type;
3231
3332 // ! Parameter lambda and initial value u0
34- complex <double > lambda, u0;
33+ const complex <double > lambda, u0;
3534
3635 // ! The complex unit i = sqrt(-1)
3736 const complex <double > i_complex = complex <double >(0 , 1 );
@@ -46,10 +45,10 @@ class ScalarSweeper
4645
4746 /* *
4847 * Generic constructor; initialize all function call counters with zero.
49- * lambda = coefficient in test equation
50- * u0 = initial value at t=0
48+ * @param[in] lambda coefficient in test equation
49+ * @param[in] u0initial value at \\( t=0 \\)
5150 */
52- ScalarSweeper (complex <double > lambda, complex <double > u0)
51+ ScalarSweeper (const complex <double > lambda, const complex <double > u0)
5352 : lambda(lambda)
5453 , u0(u0)
5554 , n_f_expl_eval(0 )
@@ -70,7 +69,8 @@ class ScalarSweeper
7069 }
7170
7271 /* *
73- * Compute error and print it to cout
72+ * Compute error between last state and exact solution at time tand print it to cout
73+ * @param[in] Time t
7474 */
7575 void echo_error (time t)
7676 {
@@ -115,7 +115,10 @@ class ScalarSweeper
115115 }
116116
117117 /* *
118- * Computes the exact solution u0*exp(lambda*t) at a given time t.
118+ * Computes the exact solution \\( u_0 \\exp \\left( \\lambda*t \\right) \\)
119+ * at a given time t.
120+ * @param[in] ???
121+ * @param[in] Time t
119122 */
120123 void exact (complex_vector_type& q, time t)
121124 {
@@ -129,7 +132,8 @@ class ScalarSweeper
129132 }
130133
131134 /* *
132- * Evaluate the explicit part of the right hand side: Multiply with imag(lambda)
135+ * Evaluate the explicit part of the right hand side: Multiply with
136+ * \\( \\text{imag}(\\lambda) \\)
133137 */
134138 void f_expl_eval (shared_ptr<encap_type> f_encap,
135139 shared_ptr<encap_type> q_encap, time t) override
@@ -145,7 +149,8 @@ class ScalarSweeper
145149 }
146150
147151 /* *
148- * Evaluate the implicit part of the right hand side: Multiply with real(lambda)
152+ * Evaluate the implicit part of the right hand side: Multiply with
153+ * \\( \\text{real}(\\lambda) \\)
149154 */
150155 void f_impl_eval (shared_ptr<encap_type> f_encap,
151156 shared_ptr<encap_type> q_encap, time t) override
@@ -161,7 +166,9 @@ class ScalarSweeper
161166 }
162167
163168 /* *
164- * For given b, solve (Id - dt*real(lambda))*u = b for u
169+ * For given \\( b \\), solve
170+ * \\( \\left( \\mathbb{I}_d - \\Delta t \\text{real}(\\lambda) \\right) u = b \\)
171+ * for \\( u \\) and set f_encap to \\( \\text{real}(\\lambda) u \\)
165172 */
166173 void impl_solve (shared_ptr<encap_type> f_encap,
167174 shared_ptr<encap_type> q_encap, time t, time dt,
0 commit comments