diff --git a/src/solvers/snsolver_hpc.cpp b/src/solvers/snsolver_hpc.cpp index a2756c6e..162c0b4e 100644 --- a/src/solvers/snsolver_hpc.cpp +++ b/src/solvers/snsolver_hpc.cpp @@ -9,6 +9,7 @@ #include "quadratures/quadraturebase.hpp" #include "solvers/snsolver_hpc.hpp" #include "toolboxes/textprocessingtoolbox.hpp" +#include SNSolverHPC::SNSolverHPC( Config* settings ) { #ifdef IMPORT_MPI @@ -286,7 +287,8 @@ void SNSolverHPC::Solve() { PrepareVolumeOutput(); DrawPreSolverOutput(); } - _curSimTime = 0.0; + // On restart, continue simulation time from the loaded iteration index. + _curSimTime = static_cast( _idx_start_iter ) * _dT; auto start = std::chrono::high_resolution_clock::now(); // Start timing std::chrono::duration duration; @@ -311,6 +313,25 @@ void SNSolverHPC::Solve() { _sol[Idx2D( idx_cell, idx_sys, _localNSys )] ); // Solution averaging with HEUN } } + + // Keep scalar flux consistent with the final RK2-averaged solution used in postprocessing. + std::vector temp_scalarFluxRK( _nCells, 0.0 ); +#pragma omp parallel for + for( unsigned long idx_cell = 0; idx_cell < _nCells; ++idx_cell ) { + double localScalarFlux = 0.0; +#pragma omp simd reduction( + : localScalarFlux ) + for( unsigned long idx_sys = 0; idx_sys < _localNSys; idx_sys++ ) { + localScalarFlux += _sol[Idx2D( idx_cell, idx_sys, _localNSys )] * _quadWeights[idx_sys]; + } + temp_scalarFluxRK[idx_cell] = localScalarFlux; + } +#ifdef IMPORT_MPI + MPI_Barrier( MPI_COMM_WORLD ); + MPI_Allreduce( temp_scalarFluxRK.data(), _scalarFlux.data(), _nCells, MPI_DOUBLE, MPI_SUM, MPI_COMM_WORLD ); + MPI_Barrier( MPI_COMM_WORLD ); +#else + _scalarFlux = temp_scalarFluxRK; +#endif } else { @@ -334,12 +355,12 @@ void SNSolverHPC::Solve() { PrintScreenOutput( iter ); PrintHistoryOutput( iter ); } -#ifdef BUILD_MPI +#ifdef IMPORT_MPI MPI_Barrier( MPI_COMM_WORLD ); #endif PrintVolumeOutput( iter ); -#ifdef BUILD_MPI +#ifdef IMPORT_MPI MPI_Barrier( MPI_COMM_WORLD ); #endif } @@ -536,8 +557,9 @@ void SNSolverHPC::FVMUpdate() { _mass = 0.0; _rmsFlux = 0.0; std::vector temp_scalarFlux( _nCells ); // for MPI allreduce + std::vector prev_scalarFlux( _scalarFlux ); -#pragma omp parallel for reduction( + : _mass, _rmsFlux ) +#pragma omp parallel for reduction( + : _mass ) for( unsigned long idx_cell = 0; idx_cell < _nCells; ++idx_cell ) { #pragma omp simd @@ -556,7 +578,6 @@ void SNSolverHPC::FVMUpdate() { localScalarFlux += _sol[Idx2D( idx_cell, idx_sys, _localNSys )] * _quadWeights[idx_sys]; } _mass += localScalarFlux * _areas[idx_cell]; - _rmsFlux += ( localScalarFlux - _scalarFlux[idx_cell] ) * ( localScalarFlux - _scalarFlux[idx_cell] ); temp_scalarFlux[idx_cell] = localScalarFlux; // set flux } // MPI Allreduce: _scalarFlux @@ -564,9 +585,20 @@ void SNSolverHPC::FVMUpdate() { MPI_Barrier( MPI_COMM_WORLD ); MPI_Allreduce( temp_scalarFlux.data(), _scalarFlux.data(), _nCells, MPI_DOUBLE, MPI_SUM, MPI_COMM_WORLD ); MPI_Barrier( MPI_COMM_WORLD ); + if( _rank == 0 ) { + for( unsigned long idx_cell = 0; idx_cell < _nCells; ++idx_cell ) { + double diff = _scalarFlux[idx_cell] - prev_scalarFlux[idx_cell]; + _rmsFlux += diff * diff; + } + } #endif #ifndef IMPORT_MPI _scalarFlux = temp_scalarFlux; +#pragma omp parallel for reduction( + : _rmsFlux ) + for( unsigned long idx_cell = 0; idx_cell < _nCells; ++idx_cell ) { + double diff = _scalarFlux[idx_cell] - prev_scalarFlux[idx_cell]; + _rmsFlux += diff * diff; + } #endif } @@ -714,6 +746,7 @@ void SNSolverHPC::IterPostprocessing() { double tmp_curScalarOutflow = 0.0; double tmp_curScalarOutflowPeri1 = 0.0; double tmp_curScalarOutflowPeri2 = 0.0; + double tmp_curMaxOrdinateOutflow = 0.0; double tmp_mass = 0.0; double tmp_rmsFlux = 0.0; MPI_Barrier( MPI_COMM_WORLD ); @@ -726,6 +759,9 @@ void SNSolverHPC::IterPostprocessing() { MPI_Allreduce( &_curScalarOutflowPeri2, &tmp_curScalarOutflowPeri2, 1, MPI_DOUBLE, MPI_SUM, MPI_COMM_WORLD ); _curScalarOutflowPeri2 = tmp_curScalarOutflowPeri2; MPI_Barrier( MPI_COMM_WORLD ); + MPI_Allreduce( &_curMaxOrdinateOutflow, &tmp_curMaxOrdinateOutflow, 1, MPI_DOUBLE, MPI_MAX, MPI_COMM_WORLD ); + _curMaxOrdinateOutflow = tmp_curMaxOrdinateOutflow; + MPI_Barrier( MPI_COMM_WORLD ); MPI_Allreduce( &_mass, &tmp_mass, 1, MPI_DOUBLE, MPI_SUM, MPI_COMM_WORLD ); _mass = tmp_mass; MPI_Barrier( MPI_COMM_WORLD ); @@ -973,7 +1009,7 @@ void SNSolverHPC::WriteScalarOutput( unsigned idx_iter ) { } idx_field--; break; - case VAR_ABSORPTION_GREEN: _screenOutputFields[idx_field] = _absorptionValsBlocksGreen[0]; break; + case VAR_ABSORPTION_GREEN: _screenOutputFields[idx_field] = _varAbsorptionHohlraumGreen; break; default: ErrorMessages::Error( "Screen output group not defined!", CURRENT_FUNCTION ); break; } } @@ -1318,7 +1354,7 @@ void SNSolverHPC::WriteVolumeOutput( unsigned idx_iter ) { _quadPts[Idx2D( idx_sys, 1, _nDim )] * _sol[Idx2D( idx_cell, idx_sys, _localNSys )] * _quadWeights[idx_sys]; } } -#ifdef BUILD_MPI +#ifdef IMPORT_MPI MPI_Barrier( MPI_COMM_WORLD ); MPI_Allreduce( _outputFields[idx_group][0].data(), _outputFields[idx_group][0].data(), _nCells, MPI_DOUBLE, MPI_SUM, MPI_COMM_WORLD ); @@ -1455,28 +1491,8 @@ void SNSolverHPC::SetGhostCells() { void SNSolverHPC::SetProbingCellsLineGreen() { - // if( _settings->GetProblemName() == PROBLEM_QuarterHohlraum ) { - // double verticalLineWidth = std::abs( _cornerUpperLeftGreen[1] - _cornerLowerLeftGreen[1] ); - // double horizontalLineWidth = std::abs( _cornerUpperLeftGreen[0] - _cornerUpperRightGreen[0] ); - // - // // double dx = 2 * ( horizontalLineWidth + verticalLineWidth ) / ( (double)_nProbingCellsLineGreen ); - // - // unsigned nHorizontalProbingCells = - // (unsigned)std::ceil( _nProbingCellsLineGreen * ( horizontalLineWidth / ( horizontalLineWidth + verticalLineWidth ) ) ); - // unsigned nVerticalProbingCells = _nProbingCellsLineGreen - nHorizontalProbingCells; - // - // _probingCellsLineGreen = std::vector( _nProbingCellsLineGreen ); - // - // // Sample points on each side of the rectangle - // std::vector side3 = linspace2D( _cornerLowerRightGreen, _cornerUpperRightGreen, nVerticalProbingCells ); - // std::vector side4 = linspace2D( _cornerUpperRightGreen, _cornerUpperLeftGreen, nHorizontalProbingCells ); - // - // // Combine the points from each side - // _probingCellsLineGreen.insert( _probingCellsLineGreen.end(), side3.begin(), side3.end() ); - // _probingCellsLineGreen.insert( _probingCellsLineGreen.end(), side4.begin(), side4.end() ); - // } - // else if( _settings->GetProblemName() == PROBLEM_SymmetricHohlraum ) { + assert( _nProbingCellsLineGreen % 2 == 0 ); std::vector p1 = { _cornerUpperLeftGreen[0] + _thicknessGreen / 2.0, _cornerUpperLeftGreen[1] - _thicknessGreen / 2.0 }; std::vector p2 = { _cornerUpperRightGreen[0] - _thicknessGreen / 2.0, _cornerUpperRightGreen[1] - _thicknessGreen / 2.0 }; @@ -1490,6 +1506,8 @@ void SNSolverHPC::SetProbingCellsLineGreen() { unsigned nHorizontalProbingCells = (unsigned)std::ceil( _nProbingCellsLineGreen / 2 * pt_ratio_h ); unsigned nVerticalProbingCells = _nProbingCellsLineGreen / 2 - nHorizontalProbingCells; + assert( nHorizontalProbingCells > 1 ); + assert( nVerticalProbingCells > 1 ); _probingCellsLineGreen = std::vector( 2 * ( nVerticalProbingCells + nHorizontalProbingCells ) ); @@ -1517,13 +1535,15 @@ void SNSolverHPC::SetProbingCellsLineGreen() { std::vector>> block_corners; double block_size = 0.05; + const double cx = _centerGreen[0]; + const double cy = _centerGreen[1]; // Loop to fill the blocks for( int i = 0; i < 8; ++i ) { // 8 blocks in the x-direction (horizontal) (upper) (left to right) // Top row - double x1 = -0.2 + i * block_size; - double y1 = 0.4; + double x1 = -0.2 + cx + i * block_size; + double y1 = 0.4 + cy; double x2 = x1 + block_size; double y2 = y1 - block_size; @@ -1538,8 +1558,8 @@ void SNSolverHPC::SetProbingCellsLineGreen() { for( int j = 0; j < 14; ++j ) { // 14 blocks in the y-direction (vertical) // right column double x1 = 0.15; - double x1 = 0.15; - double y1 = 0.35 - j * block_size; + double x1 = 0.15 + cx; + double y1 = 0.35 + cy - j * block_size; double x2 = x1 + block_size; double y2 = y1 - block_size; @@ -1556,8 +1576,8 @@ void SNSolverHPC::SetProbingCellsLineGreen() { for( int i = 0; i < 8; ++i ) { // 8 blocks in the x-direction (horizontal) (lower) (right to left) // bottom row - double x1 = 0.15 - i * block_size; - double y1 = -0.35; + double x1 = 0.15 + cx - i * block_size; + double y1 = -0.35 + cy; double x2 = x1 + block_size; double y2 = y1 - block_size; @@ -1573,8 +1593,8 @@ void SNSolverHPC::SetProbingCellsLineGreen() { for( int j = 0; j < 14; ++j ) { // 14 blocks in the y-direction (vertical) (down to up) // left column - double x1 = -0.2; - double y1 = -0.3 + j * block_size; + double x1 = -0.2 + cx; + double y1 = -0.3 + cy + j * block_size; double x2 = x1 + block_size; double y2 = y1 - block_size; @@ -1628,6 +1648,7 @@ std::vector SNSolverHPC::linspace2D( const std::vector& start, */ std::vector result; + assert( num_points > 1 ); result.resize( num_points ); double stepX = ( end[0] - start[0] ) / ( num_points - 1 ); double stepY = ( end[1] - start[1] ) / ( num_points - 1 ); @@ -1662,23 +1683,22 @@ void SNSolverHPC::ComputeCellsPerimeterLattice() { continue; // Skip boundary - ghost cells } - if( abs( ( cellMids[neigbors[idx_cell][idx_nbr]][0] ) > l_1 && abs( cellMids[idx_cell][0] ) < l_1 ) || - abs( ( cellMids[neigbors[idx_cell][idx_nbr]][1] ) > l_1 && abs( cellMids[idx_cell][1] ) < l_1 ) ) { + if( ( abs( cellMids[neigbors[idx_cell][idx_nbr]][0] ) > l_1 && abs( cellMids[idx_cell][0] ) < l_1 ) || + ( abs( cellMids[neigbors[idx_cell][idx_nbr]][1] ) > l_1 && abs( cellMids[idx_cell][1] ) < l_1 ) ) { // neighbor is outside perimeter _cellsLatticePerimeter1[idx_cell].push_back( idx_nbr ); _isPerimeterLatticeCell1[idx_cell] = true; } } } - if( abs( cellMids[idx_cell][0] ) < l_2 && abs( cellMids[idx_cell][1] ) < l_2 && abs( cellMids[idx_cell][0] ) > l_1 && - abs( cellMids[idx_cell][1] ) > l_1 ) { + else if( abs( cellMids[idx_cell][0] ) < l_2 && abs( cellMids[idx_cell][1] ) < l_2 ) { // Cell is within perimeter for( unsigned idx_nbr = 0; idx_nbr < _mesh->GetNumNodesPerCell(); ++idx_nbr ) { if( neigbors[idx_cell][idx_nbr] == _mesh->GetNumCells() ) { continue; // Skip boundary - ghost cells } - if( abs( ( cellMids[neigbors[idx_cell][idx_nbr]][0] ) > l_2 && abs( cellMids[idx_cell][0] ) < l_2 ) || - abs( ( cellMids[neigbors[idx_cell][idx_nbr]][1] ) > l_2 && abs( cellMids[idx_cell][1] ) < l_2 ) ) { + if( ( abs( cellMids[neigbors[idx_cell][idx_nbr]][0] ) > l_2 && abs( cellMids[idx_cell][0] ) < l_2 ) || + ( abs( cellMids[neigbors[idx_cell][idx_nbr]][1] ) > l_2 && abs( cellMids[idx_cell][1] ) < l_2 ) ) { // neighbor is outside perimeter _cellsLatticePerimeter2[idx_cell].push_back( idx_nbr ); _isPerimeterLatticeCell2[idx_cell] = true; diff --git a/tests/input/validation_tests/SN_solver_hpc/lattice_hpc_200_csv_reference b/tests/input/validation_tests/SN_solver_hpc/lattice_hpc_200_csv_reference index ef356ba0..140a7be3 100644 --- a/tests/input/validation_tests/SN_solver_hpc/lattice_hpc_200_csv_reference +++ b/tests/input/validation_tests/SN_solver_hpc/lattice_hpc_200_csv_reference @@ -1,4 +1,4 @@ 2026-02-10 15:35:39.595600 ,Iter,Sim_time,Wall_time_[s],Mass,RMS_flux,VTK_out,CSV_out,Cur_outflow,Total_outflow,Cur_outflow_P1,Total_outflow_P1,Cur_outflow_P2,Total_outflow_P2,Max_outflow,Cur_absorption,Total_absorption,Max_absorption -2026-02-10 15:35:39.658632 ,0.000000,2.474874E-01,6.294604E-02,6.382169E+00,4.127129E+00,0.000000E+00,1.000000E+00,0.000000E+00,0.000000E+00,0.000000E+00,0.000000E+00,0.000000E+00,0.000000E+00,0.000000E+00,0.000000E+00,0.000000E+00,0.000000E+00 -2026-02-10 15:35:39.721179 ,1.000000,4.949747E-01,1.255209E-01,1.039716E+01,3.385174E+00,0.000000E+00,1.000000E+00,0.000000E+00,0.000000E+00,1.786912E-01,4.422380E-02,0.000000E+00,0.000000E+00,0.000000E+00,3.432122E-01,8.494068E-02,5.680457E-02 -2026-02-10 15:35:39.781177 ,2.000000,5.000000E-01,1.855212E-01,6.939972E+00,6.744329E-02,1.000000E+00,1.000000E+00,0.000000E+00,0.000000E+00,1.850545E-01,4.515375E-02,0.000000E+00,0.000000E+00,0.000000E+00,1.885307E-01,8.588809E-02,5.680457E-02 +2026-02-11 22:02:50.261192 ,0.000000,2.474874E-01,1.064435E-01,6.382169E+00,4.127129E+00,0.000000E+00,1.000000E+00,0.000000E+00,0.000000E+00,0.000000E+00,0.000000E+00,0.000000E+00,0.000000E+00,0.000000E+00,0.000000E+00,0.000000E+00,0.000000E+00 +2026-02-11 22:02:50.375590 ,1.000000,4.949747E-01,2.208639E-01,9.623368E+00,3.464680E+00,0.000000E+00,1.000000E+00,0.000000E+00,0.000000E+00,3.459946E-01,8.562928E-02,0.000000E+00,0.000000E+00,0.000000E+00,1.638836E-01,4.055913E-02,2.562927E-02 +2026-02-11 22:02:50.483330 ,2.000000,5.000000E-01,3.285845E-01,6.535954E+00,6.883754E-02,1.000000E+00,1.000000E+00,0.000000E+00,0.000000E+00,3.570196E-01,8.742340E-02,0.000000E+00,0.000000E+00,0.000000E+00,1.715809E-01,4.142137E-02,2.679525E-02 diff --git a/tests/input/validation_tests/SN_solver_hpc/symmetric_hohlraum_hpc_200_csv_reference b/tests/input/validation_tests/SN_solver_hpc/symmetric_hohlraum_hpc_200_csv_reference index 6846f20b..2db1b11c 100644 --- a/tests/input/validation_tests/SN_solver_hpc/symmetric_hohlraum_hpc_200_csv_reference +++ b/tests/input/validation_tests/SN_solver_hpc/symmetric_hohlraum_hpc_200_csv_reference @@ -1,6 +1,6 @@ 2026-02-10 15:35:51.136388 ,Iter,Sim_time,Wall_time_[s],Mass,RMS_flux,VTK_out,CSV_out,Cur_outflow,Total_outflow,Max_outflow,Total_absorption,Cumulated_absorption_center,Cumulated_absorption_vertical_wall,Cumulated_absorption_horizontal_wall,Var. absorption green,Probe 0 u_0,Probe 0 u_1,Probe 0 u_2,Probe 1 u_0,Probe 1 u_1,Probe 1 u_2,Probe 2 u_0,Probe 2 u_1,Probe 2 u_2,Probe 3 u_0,Probe 3 u_1,Probe 3 u_2,Probe Green Line 0,Probe Green Line 1,Probe Green Line 2,Probe Green Line 3,Probe Green Line 4,Probe Green Line 5,Probe Green Line 6,Probe Green Line 7,Probe Green Line 8,Probe Green Line 9,Probe Green Line 10,Probe Green Line 11,Probe Green Line 12,Probe Green Line 13,Probe Green Line 14,Probe Green Line 15,Probe Green Line 16,Probe Green Line 17,Probe Green Line 18,Probe Green Line 19,Probe Green Block 0,Probe Green Block 1,Probe Green Block 2,Probe Green Block 3,Probe Green Block 4,Probe Green Block 5,Probe Green Block 6,Probe Green Block 7,Probe Green Block 8,Probe Green Block 9,Probe Green Block 10,Probe Green Block 11,Probe Green Block 12,Probe Green Block 13,Probe Green Block 14,Probe Green Block 15,Probe Green Block 16,Probe Green Block 17,Probe Green Block 18,Probe Green Block 19,Probe Green Block 20,Probe Green Block 21,Probe Green Block 22,Probe Green Block 23,Probe Green Block 24,Probe Green Block 25,Probe Green Block 26,Probe Green Block 27,Probe Green Block 28,Probe Green Block 29,Probe Green Block 30,Probe Green Block 31,Probe Green Block 32,Probe Green Block 33,Probe Green Block 34,Probe Green Block 35,Probe Green Block 36,Probe Green Block 37,Probe Green Block 38,Probe Green Block 39,Probe Green Block 40,Probe Green Block 41,Probe Green Block 42,Probe Green Block 43 -2026-02-10 15:35:51.140259 ,0.000000,4.596194E-02,3.629437E-03,3.912731E-01,3.889031E+00,0.000000E+00,1.000000E+00,1.699372E-01,7.810644E-03,2.896596E-01,9.441258E-02,0.000000E+00,0.000000E+00,9.441258E-02,0.000000E+00,0.000000E+00,0.000000E+00,0.000000E+00,0.000000E+00,0.000000E+00,0.000000E+00,0.000000E+00,0.000000E+00,0.000000E+00,0.000000E+00,0.000000E+00,0.000000E+00,0.000000E+00,0.000000E+00,0.000000E+00,0.000000E+00,0.000000E+00,0.000000E+00,0.000000E+00,0.000000E+00,0.000000E+00,0.000000E+00,0.000000E+00,0.000000E+00,0.000000E+00,0.000000E+00,0.000000E+00,0.000000E+00,0.000000E+00,0.000000E+00,0.000000E+00,0.000000E+00,0.000000E+00,0.000000E+00,0.000000E+00,0.000000E+00,0.000000E+00,0.000000E+00,0.000000E+00,0.000000E+00,0.000000E+00,0.000000E+00,0.000000E+00,0.000000E+00,0.000000E+00,0.000000E+00,0.000000E+00,0.000000E+00,0.000000E+00,0.000000E+00,0.000000E+00,0.000000E+00,0.000000E+00,0.000000E+00,0.000000E+00,0.000000E+00,0.000000E+00,0.000000E+00,0.000000E+00,0.000000E+00,0.000000E+00,0.000000E+00,0.000000E+00,0.000000E+00,0.000000E+00,0.000000E+00,0.000000E+00,0.000000E+00,0.000000E+00,0.000000E+00,0.000000E+00,0.000000E+00,0.000000E+00,0.000000E+00,0.000000E+00,0.000000E+00 -2026-02-10 15:35:51.141164 ,1.000000,9.192388E-02,4.564381E-03,6.199409E-01,3.864600E+00,0.000000E+00,1.000000E+00,4.601696E-01,2.896093E-02,8.046266E-01,2.878594E-01,0.000000E+00,0.000000E+00,2.878594E-01,0.000000E+00,3.055669E+00,2.371090E+00,-1.322582E-01,1.120635E+00,-9.104930E-01,2.929389E-01,0.000000E+00,0.000000E+00,0.000000E+00,0.000000E+00,0.000000E+00,0.000000E+00,0.000000E+00,0.000000E+00,0.000000E+00,0.000000E+00,0.000000E+00,0.000000E+00,0.000000E+00,0.000000E+00,0.000000E+00,0.000000E+00,0.000000E+00,0.000000E+00,0.000000E+00,0.000000E+00,0.000000E+00,0.000000E+00,0.000000E+00,0.000000E+00,0.000000E+00,0.000000E+00,0.000000E+00,0.000000E+00,0.000000E+00,0.000000E+00,0.000000E+00,0.000000E+00,0.000000E+00,0.000000E+00,0.000000E+00,0.000000E+00,0.000000E+00,0.000000E+00,0.000000E+00,0.000000E+00,0.000000E+00,0.000000E+00,0.000000E+00,0.000000E+00,0.000000E+00,0.000000E+00,0.000000E+00,0.000000E+00,0.000000E+00,0.000000E+00,0.000000E+00,0.000000E+00,0.000000E+00,0.000000E+00,0.000000E+00,0.000000E+00,0.000000E+00,0.000000E+00,0.000000E+00,0.000000E+00,0.000000E+00,0.000000E+00,0.000000E+00,0.000000E+00,0.000000E+00,0.000000E+00,0.000000E+00,0.000000E+00,0.000000E+00,0.000000E+00 -2026-02-10 15:35:51.142161 ,2.000000,1.378858E-01,5.536966E-03,8.721190E-01,4.519524E+00,0.000000E+00,1.000000E+00,8.639430E-01,6.866942E-02,1.565070E+00,6.283514E-01,0.000000E+00,0.000000E+00,6.283514E-01,0.000000E+00,9.563148E+00,7.246645E+00,-5.433469E-02,4.386915E+00,-3.513465E+00,5.851197E-01,0.000000E+00,0.000000E+00,0.000000E+00,0.000000E+00,0.000000E+00,0.000000E+00,0.000000E+00,0.000000E+00,0.000000E+00,0.000000E+00,0.000000E+00,0.000000E+00,0.000000E+00,0.000000E+00,0.000000E+00,0.000000E+00,0.000000E+00,0.000000E+00,0.000000E+00,0.000000E+00,0.000000E+00,0.000000E+00,0.000000E+00,0.000000E+00,0.000000E+00,0.000000E+00,0.000000E+00,0.000000E+00,0.000000E+00,0.000000E+00,0.000000E+00,0.000000E+00,0.000000E+00,0.000000E+00,0.000000E+00,0.000000E+00,0.000000E+00,0.000000E+00,0.000000E+00,0.000000E+00,0.000000E+00,0.000000E+00,0.000000E+00,0.000000E+00,0.000000E+00,0.000000E+00,0.000000E+00,0.000000E+00,0.000000E+00,0.000000E+00,0.000000E+00,0.000000E+00,0.000000E+00,0.000000E+00,0.000000E+00,1.612150E-02,0.000000E+00,0.000000E+00,0.000000E+00,0.000000E+00,0.000000E+00,0.000000E+00,0.000000E+00,0.000000E+00,0.000000E+00,0.000000E+00,0.000000E+00,0.000000E+00,0.000000E+00,0.000000E+00 -2026-02-10 15:35:51.143099 ,3.000000,1.838478E-01,6.507687E-03,1.182900E+00,6.059086E+00,0.000000E+00,1.000000E+00,1.475481E+00,1.364854E-01,2.641718E+00,1.204017E+00,8.438287E-05,0.000000E+00,1.203932E+00,4.895838E-07,1.719370E+01,1.271281E+01,1.233221E-01,9.616643E+00,-7.516527E+00,7.126574E-01,0.000000E+00,0.000000E+00,0.000000E+00,0.000000E+00,0.000000E+00,0.000000E+00,0.000000E+00,0.000000E+00,0.000000E+00,1.454970E-02,1.454970E-02,2.052099E-02,1.723574E-02,1.723630E-02,0.000000E+00,0.000000E+00,0.000000E+00,0.000000E+00,0.000000E+00,1.454970E-02,1.454970E-02,2.052099E-02,1.723574E-02,1.723630E-02,0.000000E+00,0.000000E+00,0.000000E+00,0.000000E+00,0.000000E+00,0.000000E+00,0.000000E+00,0.000000E+00,0.000000E+00,0.000000E+00,1.229449E-04,0.000000E+00,1.734024E-04,0.000000E+00,0.000000E+00,1.456420E-04,0.000000E+00,1.456468E-04,0.000000E+00,0.000000E+00,1.456467E-04,0.000000E+00,0.000000E+00,1.454678E-04,3.315284E-06,0.000000E+00,0.000000E+00,0.000000E+00,0.000000E+00,0.000000E+00,0.000000E+00,6.069284E-02,1.229449E-04,0.000000E+00,1.734024E-04,0.000000E+00,0.000000E+00,1.456420E-04,0.000000E+00,1.456468E-04,0.000000E+00,0.000000E+00,1.456467E-04,0.000000E+00,0.000000E+00,1.456341E-04 -2026-02-10 15:35:51.146269 ,4.000000,2.000000E-01,9.664172E-03,9.150041E-01,3.761988E+00,1.000000E+00,1.000000E+00,9.972836E-01,1.525938E-01,2.641718E+00,1.247551E+00,1.397201E-04,0.000000E+00,1.247411E+00,4.707055E-07,2.004454E+01,1.470103E+01,9.776727E-02,1.146703E+01,-8.877042E+00,6.309063E-01,6.206449E-04,5.566883E-04,-1.933037E-04,1.092471E-03,8.122029E-04,-5.300880E-04,0.000000E+00,1.207213E-02,5.702114E-03,1.204194E-02,1.204194E-02,1.827069E-02,1.504029E-02,1.506527E-02,0.000000E+00,0.000000E+00,0.000000E+00,1.207369E-02,5.702114E-03,1.204194E-02,1.204194E-02,1.827069E-02,1.504029E-02,1.506528E-02,0.000000E+00,0.000000E+00,0.000000E+00,0.000000E+00,2.300753E-04,0.000000E+00,1.746656E-04,0.000000E+00,0.000000E+00,0.000000E+00,1.017544E-04,0.000000E+00,1.543873E-04,0.000000E+00,0.000000E+00,1.270905E-04,0.000000E+00,1.273016E-04,0.000000E+00,0.000000E+00,1.273329E-04,0.000000E+00,0.000000E+00,1.268685E-04,9.557303E-05,0.000000E+00,1.770442E-06,0.000000E+00,1.753167E-04,0.000000E+00,0.000000E+00,2.014592E-02,1.017544E-04,0.000000E+00,1.543873E-04,0.000000E+00,0.000000E+00,1.270905E-04,0.000000E+00,1.273016E-04,0.000000E+00,0.000000E+00,1.273303E-04,0.000000E+00,0.000000E+00,1.304508E-04 +2026-02-11 21:52:38.908896 ,0.000000,4.596194E-02,1.315444E-01,3.912731E-01,3.889031E+00,0.000000E+00,1.000000E+00,1.699372E-01,7.810644E-03,2.896596E-01,4.720629E-02,0.000000E+00,0.000000E+00,4.720629E-02,0.000000E+00,0.000000E+00,0.000000E+00,0.000000E+00,0.000000E+00,0.000000E+00,0.000000E+00,0.000000E+00,0.000000E+00,0.000000E+00,0.000000E+00,0.000000E+00,0.000000E+00,0.000000E+00,0.000000E+00,0.000000E+00,0.000000E+00,0.000000E+00,0.000000E+00,0.000000E+00,0.000000E+00,0.000000E+00,0.000000E+00,0.000000E+00,0.000000E+00,0.000000E+00,0.000000E+00,0.000000E+00,0.000000E+00,0.000000E+00,0.000000E+00,0.000000E+00,0.000000E+00,0.000000E+00,0.000000E+00,0.000000E+00,0.000000E+00,0.000000E+00,0.000000E+00,0.000000E+00,0.000000E+00,0.000000E+00,0.000000E+00,0.000000E+00,0.000000E+00,0.000000E+00,0.000000E+00,0.000000E+00,0.000000E+00,0.000000E+00,0.000000E+00,0.000000E+00,0.000000E+00,0.000000E+00,0.000000E+00,0.000000E+00,0.000000E+00,0.000000E+00,0.000000E+00,0.000000E+00,0.000000E+00,0.000000E+00,0.000000E+00,0.000000E+00,0.000000E+00,0.000000E+00,0.000000E+00,0.000000E+00,0.000000E+00,0.000000E+00,0.000000E+00,0.000000E+00,0.000000E+00,0.000000E+00,0.000000E+00,0.000000E+00,0.000000E+00 +2026-02-11 21:52:39.043950 ,1.000000,9.192388E-02,2.665456E-01,5.997554E-01,3.915592E+00,0.000000E+00,1.000000E+00,3.818578E-01,2.536157E-02,6.095445E-01,1.556642E-01,0.000000E+00,0.000000E+00,1.556642E-01,0.000000E+00,3.054249E+00,2.369008E+00,-1.323735E-01,1.120689E+00,-9.105252E-01,2.929687E-01,0.000000E+00,0.000000E+00,0.000000E+00,0.000000E+00,0.000000E+00,0.000000E+00,0.000000E+00,0.000000E+00,0.000000E+00,0.000000E+00,0.000000E+00,0.000000E+00,0.000000E+00,0.000000E+00,0.000000E+00,0.000000E+00,0.000000E+00,0.000000E+00,0.000000E+00,0.000000E+00,0.000000E+00,0.000000E+00,0.000000E+00,0.000000E+00,0.000000E+00,0.000000E+00,0.000000E+00,0.000000E+00,0.000000E+00,0.000000E+00,0.000000E+00,0.000000E+00,0.000000E+00,0.000000E+00,0.000000E+00,0.000000E+00,0.000000E+00,0.000000E+00,0.000000E+00,0.000000E+00,0.000000E+00,0.000000E+00,0.000000E+00,0.000000E+00,0.000000E+00,0.000000E+00,0.000000E+00,0.000000E+00,0.000000E+00,0.000000E+00,0.000000E+00,0.000000E+00,0.000000E+00,0.000000E+00,0.000000E+00,0.000000E+00,0.000000E+00,0.000000E+00,0.000000E+00,0.000000E+00,0.000000E+00,0.000000E+00,0.000000E+00,0.000000E+00,0.000000E+00,0.000000E+00,0.000000E+00,0.000000E+00,0.000000E+00,0.000000E+00 +2026-02-11 21:52:39.162921 ,2.000000,1.378858E-01,3.855422E-01,8.178787E-01,4.235208E+00,0.000000E+00,1.000000E+00,6.493960E-01,5.520907E-02,9.871098E-01,3.418355E-01,0.000000E+00,0.000000E+00,3.418355E-01,0.000000E+00,9.550106E+00,7.238872E+00,-5.483415E-02,4.380960E+00,-3.509899E+00,5.845488E-01,0.000000E+00,0.000000E+00,0.000000E+00,0.000000E+00,0.000000E+00,0.000000E+00,0.000000E+00,0.000000E+00,0.000000E+00,0.000000E+00,0.000000E+00,0.000000E+00,0.000000E+00,0.000000E+00,0.000000E+00,0.000000E+00,0.000000E+00,0.000000E+00,0.000000E+00,0.000000E+00,0.000000E+00,0.000000E+00,0.000000E+00,0.000000E+00,0.000000E+00,0.000000E+00,0.000000E+00,0.000000E+00,0.000000E+00,0.000000E+00,0.000000E+00,0.000000E+00,0.000000E+00,0.000000E+00,0.000000E+00,0.000000E+00,0.000000E+00,0.000000E+00,0.000000E+00,0.000000E+00,0.000000E+00,0.000000E+00,0.000000E+00,0.000000E+00,0.000000E+00,0.000000E+00,0.000000E+00,0.000000E+00,0.000000E+00,0.000000E+00,0.000000E+00,0.000000E+00,0.000000E+00,0.000000E+00,0.000000E+00,8.166518E-03,0.000000E+00,0.000000E+00,0.000000E+00,0.000000E+00,0.000000E+00,0.000000E+00,0.000000E+00,0.000000E+00,0.000000E+00,0.000000E+00,0.000000E+00,0.000000E+00,0.000000E+00,0.000000E+00 +2026-02-11 21:52:39.278844 ,3.000000,1.838478E-01,5.015391E-01,1.052166E+00,4.954813E+00,0.000000E+00,1.000000E+00,9.808722E-01,1.002919E-01,1.453090E+00,6.248197E-01,4.318221E-05,0.000000E+00,6.247765E-01,1.079086E-07,1.716434E+01,1.270100E+01,1.225169E-01,9.597497E+00,-7.507195E+00,7.118933E-01,0.000000E+00,0.000000E+00,0.000000E+00,0.000000E+00,0.000000E+00,0.000000E+00,0.000000E+00,0.000000E+00,0.000000E+00,7.868604E-03,7.868604E-03,1.040100E-02,8.631371E-03,8.631648E-03,0.000000E+00,0.000000E+00,0.000000E+00,0.000000E+00,0.000000E+00,7.868604E-03,7.868604E-03,1.040100E-02,8.631371E-03,8.631648E-03,0.000000E+00,0.000000E+00,0.000000E+00,0.000000E+00,0.000000E+00,0.000000E+00,0.000000E+00,0.000000E+00,0.000000E+00,0.000000E+00,6.648971E-05,0.000000E+00,8.788844E-05,0.000000E+00,0.000000E+00,7.293509E-05,0.000000E+00,7.293743E-05,0.000000E+00,0.000000E+00,7.293742E-05,0.000000E+00,0.000000E+00,7.284801E-05,1.670795E-06,0.000000E+00,0.000000E+00,0.000000E+00,0.000000E+00,0.000000E+00,0.000000E+00,2.715306E-02,6.648971E-05,0.000000E+00,8.788844E-05,0.000000E+00,0.000000E+00,7.293509E-05,0.000000E+00,7.293743E-05,0.000000E+00,0.000000E+00,7.293740E-05,0.000000E+00,0.000000E+00,7.293113E-05 +2026-02-11 21:52:39.406889 ,4.000000,2.000000E-01,6.295428E-01,8.550401E-01,1.614070E+00,1.000000E+00,1.000000E+00,6.421574E-01,1.106641E-01,1.453090E+00,6.872688E-01,6.816741E-05,0.000000E+00,6.872006E-01,1.253516E-07,2.000858E+01,1.468820E+01,9.692551E-02,1.144289E+01,-8.866540E+00,6.303190E-01,9.269634E-04,8.323807E-04,-2.734572E-04,1.104766E-03,8.038164E-04,-5.334637E-04,0.000000E+00,2.793765E-03,3.405374E-03,7.363370E-03,7.363370E-03,1.036321E-02,8.481050E-03,8.486865E-03,0.000000E+00,0.000000E+00,0.000000E+00,2.798283E-03,3.405374E-03,7.363370E-03,7.363370E-03,1.036321E-02,8.481050E-03,8.486869E-03,0.000000E+00,0.000000E+00,0.000000E+00,0.000000E+00,1.196639E-04,0.000000E+00,8.730187E-05,0.000000E+00,0.000000E+00,0.000000E+00,6.222047E-05,0.000000E+00,8.756911E-05,0.000000E+00,0.000000E+00,7.166487E-05,0.000000E+00,7.171401E-05,0.000000E+00,0.000000E+00,7.172550E-05,0.000000E+00,0.000000E+00,7.105263E-05,4.817435E-05,0.000000E+00,8.862358E-07,0.000000E+00,8.762648E-05,0.000000E+00,0.000000E+00,2.028076E-02,6.222047E-05,0.000000E+00,8.756911E-05,0.000000E+00,0.000000E+00,7.166487E-05,0.000000E+00,7.171404E-05,0.000000E+00,0.000000E+00,7.172476E-05,0.000000E+00,0.000000E+00,7.284716E-05 diff --git a/tests/test_cases.cpp b/tests/test_cases.cpp index dfd82ddb..0a336d8e 100644 --- a/tests/test_cases.cpp +++ b/tests/test_cases.cpp @@ -403,8 +403,7 @@ bool parseTokenAsDouble( const std::string& token, double& value ) { parsedChars++; } return parsedChars == token.size(); - } - catch( ... ) { + } catch( ... ) { return false; } } @@ -434,9 +433,9 @@ std::string findNewestCSVFile( const std::string& directory, const std::string& continue; } if( !localFound || entry.last_write_time() > localNewestWrite ) { - localFound = true; + localFound = true; localNewestWrite = entry.last_write_time(); - localNewestPath = entry.path(); + localNewestPath = entry.path(); } } if( localFound ) { @@ -461,7 +460,7 @@ void compareHistoryCSV( const std::string& referenceFile, const std::string& tes REQUIRE( testStream.is_open() ); std::string lineRef, lineTest; - const char delim = ','; + const char delim = ','; // Header row (skip token 0 because it contains runtime timestamp) REQUIRE( std::getline( referenceStream, lineRef ) ); @@ -546,6 +545,7 @@ TEST_CASE( "SN_SOLVER_HPC_CSV_QOI_VALIDATION", "[validation_tests][hpc]" ) { requireAndFlushTestLoggers(); std::string outputCSV = findNewestCSVFile( logDir, "lattice_hpc_200_output" ); + REQUIRE( !outputCSV.empty() ); compareHistoryCSV( referenceCSV, outputCSV );