@@ -206,16 +206,15 @@ ErrorIndicator DrivenSolver::SweepAdaptive(SpaceOperator &space_op,
206
206
207
207
// Configure PROM parameters if not specified.
208
208
double offline_tol = iodata.solver .driven .adaptive_tol ;
209
- int max_size = iodata.solver .driven .adaptive_max_size ;
210
- MFEM_VERIFY (max_size <= 0 || max_size > 2 ,
209
+ int max_size_per_excitation = iodata.solver .driven .adaptive_max_size ;
210
+ MFEM_VERIFY (max_size_per_excitation <= 0 || max_size_per_excitation > 2 ,
211
211
" Adaptive frequency sweep must sample at least two frequency points!" );
212
- if (max_size <= 0 )
212
+ if (max_size_per_excitation <= 0 )
213
213
{
214
- max_size = 20 * excitation_helper. Size () ; // Default value
214
+ max_size_per_excitation = 20 ; // Default value
215
215
}
216
- max_size = std::min (max_size,
217
- (n_step - step0) *
218
- int (excitation_helper.Size ())); // Maximum size dictated by sweep
216
+ // Maximum size — no more than nr steps needed
217
+ max_size_per_excitation = std::min (max_size_per_excitation, (n_step - step0));
219
218
int convergence_memory = iodata.solver .driven .adaptive_memory ;
220
219
221
220
// Allocate negative curl matrix for postprocessing the B-field and vectors for the
@@ -247,7 +246,7 @@ ErrorIndicator DrivenSolver::SweepAdaptive(SpaceOperator &space_op,
247
246
" {:d} points for frequency sweep over [{:.3e}, {:.3e}] GHz\n " ,
248
247
n_step - step0, omega0 * unit_GHz,
249
248
(omega0 + (n_step - step0 - 1 ) * delta_omega) * unit_GHz);
250
- RomOperator prom_op (iodata, space_op, max_size );
249
+ RomOperator prom_op (iodata, space_op, max_size_per_excitation );
251
250
space_op.GetWavePortOp ().SetSuppressOutput (
252
251
true ); // Suppress wave port output for offline
253
252
@@ -317,7 +316,7 @@ ErrorIndicator DrivenSolver::SweepAdaptive(SpaceOperator &space_op,
317
316
{
318
317
memory = 0 ;
319
318
}
320
- if (it == max_size )
319
+ if (it == max_size_per_excitation )
321
320
{
322
321
break ;
323
322
}
@@ -335,7 +334,7 @@ ErrorIndicator DrivenSolver::SweepAdaptive(SpaceOperator &space_op,
335
334
}
336
335
Mpi::Print (" \n Adaptive sampling{} {:d} frequency samples:\n "
337
336
" n = {:d}, error = {:.3e}, tol = {:.3e}, memory = {:d}/{:d}\n " ,
338
- (it == max_size ) ? " reached maximum" : " converged with" , it,
337
+ (it == max_size_per_excitation ) ? " reached maximum" : " converged with" , it,
339
338
prom_op.GetReducedDimension (), max_errors.back (), offline_tol, memory,
340
339
convergence_memory);
341
340
utils::PrettyPrint (prom_op.GetSamplePoints (excitation_idx), unit_GHz,
0 commit comments