@@ -248,7 +248,9 @@ TestHydro::TestHydro(std::vector<std::shared_ptr<ChBody>> user_bodies,
248248 num_bodies_(bodies_.size()),
249249 file_info_(H5FileInfo(h5_file_name, num_bodies_).ReadH5Data()),
250250 hydro_system_(nullptr ),
251- chrono_coupler_(nullptr ) {
251+ chrono_coupler_(nullptr ),
252+ convolution_mode_(hydrochrono::hydro::RadiationConvolutionMode::Baseline),
253+ tapered_opts_() {
252254 prev_time = -1 ;
253255
254256 // Set up time vector
@@ -417,15 +419,7 @@ void TestHydro::EnsureProcessedRIRF() {
417419
418420 const int steps = file_info_.GetRIRFDims (2 );
419421
420- // Convert TaperedDirectOptions to hydrochrono::hydro::TaperedDirectOptions
421- hydrochrono::hydro::TaperedDirectOptions opts;
422- opts.smoothing = tapered_opts_.smoothing ;
423- opts.window_length = tapered_opts_.window_length ;
424- opts.rirf_end_time = tapered_opts_.rirf_end_time ;
425- opts.taper_start_percent = tapered_opts_.taper_start_percent ;
426- opts.taper_end_percent = tapered_opts_.taper_end_percent ;
427- opts.taper_final_amplitude = tapered_opts_.taper_final_amplitude ;
428- opts.export_plot_csv = tapered_opts_.export_plot_csv ;
422+ // tapered_opts_ is now the canonical type (single source of truth) - no conversion needed
429423
430424 // Create lambda to get RIRF values from file_info_
431425 auto get_rirf_val = [this ](int body, int row_dof, int col, int step) -> double {
@@ -434,7 +428,7 @@ void TestHydro::EnsureProcessedRIRF() {
434428
435429 // Process RIRF kernels using the dedicated module
436430 rirf_processed_ = hydrochrono::hydro::ProcessRirfKernels (
437- num_bodies_, steps, rirf_time_vector, get_rirf_val, opts , diagnostics_output_dir_);
431+ num_bodies_, steps, rirf_time_vector, get_rirf_val, tapered_opts_ , diagnostics_output_dir_);
438432
439433 rirf_processed_ready_ = true ;
440434}
@@ -443,6 +437,20 @@ void TestHydro::InvalidateRadiationComponent() {
443437 radiation_component_.reset ();
444438}
445439
440+ // ─────────────────────────────────────────────────────────────────────────
441+ // Radiation configuration setters
442+ // ─────────────────────────────────────────────────────────────────────────
443+
444+ void TestHydro::SetRadiationConvolutionMode (hydrochrono::hydro::RadiationConvolutionMode mode) {
445+ convolution_mode_ = mode;
446+ InvalidateRadiationComponent (); // Invalidate component to recreate with new settings
447+ }
448+
449+ void TestHydro::SetTaperedDirectOptions (const hydrochrono::hydro::TaperedDirectOptions& opts) {
450+ tapered_opts_ = opts;
451+ InvalidateRadiationComponent (); // Invalidate component to recreate with new settings
452+ }
453+
446454void TestHydro::EnsureRadiationComponent () {
447455 if (radiation_component_) {
448456 return ; // Already created
@@ -493,27 +501,11 @@ std::unique_ptr<hydrochrono::hydro::RadiationComponent> TestHydro::CreateRadiati
493501
494502 const int rirf_steps = file_info_.GetRIRFDims (2 );
495503
496- // Convert TestHydro::RadiationConvolutionMode to hydrochrono::hydro::RadiationConvolutionMode
497- hydrochrono::hydro::RadiationConvolutionMode component_mode;
498- if (convolution_mode_ == RadiationConvolutionMode::TaperedDirect) {
499- component_mode = hydrochrono::hydro::RadiationConvolutionMode::TaperedDirect;
500- } else {
501- component_mode = hydrochrono::hydro::RadiationConvolutionMode::Baseline;
502- }
503-
504- // Convert TestHydro::TaperedDirectOptions to hydrochrono::hydro::TaperedDirectOptions
505- hydrochrono::hydro::TaperedDirectOptions component_opts;
506- component_opts.smoothing = tapered_opts_.smoothing ;
507- component_opts.window_length = tapered_opts_.window_length ;
508- component_opts.rirf_end_time = tapered_opts_.rirf_end_time ;
509- component_opts.taper_start_percent = tapered_opts_.taper_start_percent ;
510- component_opts.taper_end_percent = tapered_opts_.taper_end_percent ;
511- component_opts.taper_final_amplitude = tapered_opts_.taper_final_amplitude ;
512- component_opts.export_plot_csv = tapered_opts_.export_plot_csv ;
513-
504+ // convolution_mode_ and tapered_opts_ are now the canonical types from
505+ // hydrochrono::hydro namespace - no conversion needed (single source of truth)
514506 return std::make_unique<hydrochrono::hydro::RadiationComponent>(
515507 file_info_, num_bodies_, rirf_steps, rirf_time_vector, rirf_width_vector,
516- component_mode, component_opts , diagnostics_output_dir_);
508+ convolution_mode_, tapered_opts_ , diagnostics_output_dir_);
517509}
518510
519511// ------------------------------------------------------------
@@ -627,7 +619,7 @@ double TestHydro::GetRIRFval(int row, int col, int st) {
627619 int col_dof = col % kDofPerBody ;
628620 int row_dof = row % kDofPerBody ;
629621
630- if (convolution_mode_ == RadiationConvolutionMode::TaperedDirect) {
622+ if (convolution_mode_ == hydrochrono::hydro:: RadiationConvolutionMode::TaperedDirect) {
631623 EnsureProcessedRIRF ();
632624 // processed tensor is scaled by rho already
633625 const auto & tensor = rirf_processed_[body_index];
0 commit comments