From bdcfff0f0c905d044d3ac6d3aa5d7023d70fd1e5 Mon Sep 17 00:00:00 2001 From: YoungHui Park Date: Wed, 29 Jul 2020 12:37:22 -0500 Subject: [PATCH] Remove temporary functions specific to surface source --- include/openmc/state_point.h | 2 -- src/state_point.cpp | 58 ------------------------------------ 2 files changed, 60 deletions(-) diff --git a/include/openmc/state_point.h b/include/openmc/state_point.h index beb67daa7..1d7254af8 100644 --- a/include/openmc/state_point.h +++ b/include/openmc/state_point.h @@ -14,8 +14,6 @@ namespace openmc { void load_state_point(); void write_source_point(const char* filename, bool surf_src_bank); void write_source_bank(hid_t group_id, bool surf_src_bank); -void write_surf_src_point(const char* filename); -void write_surf_src_bank(hid_t group_id); void read_source_bank(hid_t group_id, std::vector& sites, bool distribute); void write_tally_results_nr(hid_t file_id); void restart_set_keff(); diff --git a/src/state_point.cpp b/src/state_point.cpp index 62058423e..9740220a8 100644 --- a/src/state_point.cpp +++ b/src/state_point.cpp @@ -665,64 +665,6 @@ write_source_bank(hid_t group_id, bool surf_src_bank) } -void -write_surf_src_point(const char* filename) -{ - std::string filename_; - filename_ = filename; - - hid_t file_id; - file_id = file_open(filename_, 'w', true); - write_attribute(file_id, "filetype", "source"); - - write_surf_src_bank(file_id); - - file_close(file_id); -} - - -void -write_surf_src_bank(hid_t group_id) -{ - hid_t banktype = h5banktype(); - - if (mpi::master) { - // Create dataset big enough to hold all source sites - hsize_t dims[] {static_cast(settings::n_particles)*2}; // 2 being hard-coded number of surfaces. - hid_t dspace = H5Screate_simple(1, dims, nullptr); - hid_t dset = H5Dcreate(group_id, "source_bank", banktype, dspace, - H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); - - for (int i = 0; i < mpi::n_procs; ++i) { - - // Create memory space - hsize_t count[] {static_cast(simulation::work_index[i+1] - - simulation::work_index[i])*2}; // 2 being hard-coded number of surfaces. - hid_t memspace = H5Screate_simple(1, count, nullptr); - - // Select hyperslab for this dataspace - dspace = H5Dget_space(dset); - hsize_t start[] {static_cast(simulation::work_index[i])}; - H5Sselect_hyperslab(dspace, H5S_SELECT_SET, start, nullptr, count, nullptr); - - // Write data to hyperslab - H5Dwrite(dset, banktype, memspace, dspace, H5P_DEFAULT, - simulation::surf_src_bank.data()); - - H5Sclose(memspace); - H5Sclose(dspace); - } - - // Close all ids - H5Dclose(dset); - - } else { - } - - H5Tclose(banktype); -} - - void read_source_bank(hid_t group_id, std::vector& sites, bool distribute) { hid_t banktype = h5banktype();