Commit 18ee938e authored by Hamilton, Steven P.'s avatar Hamilton, Steven P.
Browse files

Fixing ordering issue with tally results.

parent e3224dcb
Loading
Loading
Loading
Loading
+11 −3
Original line number Diff line number Diff line
@@ -226,14 +226,22 @@ void Manager<Geometry>::get_flux(std::vector<double>& flux_val,
            flux_tally = std::dynamic_pointer_cast<Cell_Tally_t>(tally);
    }
    CHECK(flux_tally);
    auto results = flux_tally->results();
    int num_cells = results.size();
    const auto& results = flux_tally->results();

    // Apply ordering w.r.t. cell index by first copying into map
    using value_type = std::pair<double, double>;
    std::map<int, value_type> results_map;
    for (auto& val : results)
    {
        results_map[val.first] = val.second;
    }

    // Copy results into vectors
    int num_cells = results.size();
    flux_val.resize(num_cells);
    flux_std.resize(num_cells);
    int cell = 0;
    for (auto& val : results)
    for (auto& val : results_map)
    {
        flux_val[cell] = val.second.first;
        flux_std[cell] = val.second.second;
+0 −6
Original line number Diff line number Diff line
@@ -77,12 +77,6 @@ void Manager_Base::check_solution(double k_ref,
    CHECK(computed_std.size()  == ref_flux.size());
    int num_cells = ref_flux.size();

    std::cout << "Flux comparison" << std::endl;
    for (int cell = 0; cell < num_cells; ++cell)
    {
        std::cout << computed_flux[cell] << " " << ref_flux[cell] << " " << computed_std[cell] << " " << ref_flux_std[cell] << std::endl;
    }

    // Compare computed and reference solutions
    // We print the number that are within 1, 2, and 3 combined standard
    // deviations of the reference, but we only consider the test to have