diff --git a/include/openmc/mesh.h b/include/openmc/mesh.h index 57a8f8063d..c4a107e0bb 100644 --- a/include/openmc/mesh.h +++ b/include/openmc/mesh.h @@ -387,8 +387,8 @@ public: //! Set data for a score void set_score_data(const std::string& score, - xt::xarray values, - xt::xarray sum_sq) const; + std::vector values, + std::vector sum_sq) const; //! Write the mesh with any current tally data void write(std::string base_filename) const; diff --git a/src/mesh.cpp b/src/mesh.cpp index cf9df61791..89c0726de4 100644 --- a/src/mesh.cpp +++ b/src/mesh.cpp @@ -2081,13 +2081,13 @@ UnstructuredMesh::add_score(std::string score) const { void UnstructuredMesh::set_score_data(const std::string& score, - xt::xarray values, - xt::xarray sum_sq) const { + std::vector values, + std::vector sum_sq) const { auto score_tags = get_score_tags(score); moab::ErrorCode rval; // set the score value - rval = mbi_->tag_set_data(score_tags.first, ehs_, &values); + rval = mbi_->tag_set_data(score_tags.first, ehs_, &values.front()); if (rval != moab::MB_SUCCESS) { std::stringstream msg; msg << "Failed to set the tally value for score '" << score << "' " @@ -2096,7 +2096,7 @@ UnstructuredMesh::set_score_data(const std::string& score, } // set the error value - rval = mbi_->tag_set_data(score_tags.second, ehs_, &sum_sq); + rval = mbi_->tag_set_data(score_tags.second, ehs_, &sum_sq.front()); if (rval != moab::MB_SUCCESS) { std::stringstream msg; msg << "Failed to set the tally value for score '" << score << "' " diff --git a/src/tallies/tally.cpp b/src/tallies/tally.cpp index f173b5a098..193769f13b 100644 --- a/src/tallies/tally.cpp +++ b/src/tallies/tally.cpp @@ -842,10 +842,14 @@ void Tally::accumulate() if (umesh) { for (auto score : scores_) { umesh->add_score(std::to_string(score)); + auto values = xt::view(results_, xt::all(), 0, TallyResult::VALUE); + auto sum_sq = xt::view(results_, xt::all(), 0, TallyResult::SUM_SQ); + std::vector vals_vec(values.begin(), values.end()); + std::vector sum_sq_vec(sum_sq.begin(), sum_sq.end()); for (int i = 0; i < results_.shape()[0]; i++) { umesh->set_score_data(std::to_string(score), - xt::view(results_, xt::all(), 0, TallyResult::VALUE), - xt::view(results_, xt::all(), 0, TallyResult::SUM_SQ)); + vals_vec, + sum_sq_vec); } } std::stringstream output_filename;