From 0fd12dbb7274898877fbc0dc6ba9f7e8ff3c3a1f Mon Sep 17 00:00:00 2001 From: Luke Shingles Date: Fri, 30 Aug 2024 17:10:27 +0100 Subject: [PATCH] Update input.cc --- input.cc | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/input.cc b/input.cc index 7358cb7f8..edc7562c4 100644 --- a/input.cc +++ b/input.cc @@ -183,7 +183,7 @@ void read_phixs_data_table(std::fstream &phixsfile, const int nphixspoints_input static_cast(malloc(globals::NPHIXSPOINTS * sizeof(float))); assert_always(globals::elements[element].ions[lowerion].levels[lowerlevel].photoion_xs != nullptr); - auto *levelphixstable = globals::elements[element].ions[lowerion].levels[lowerlevel].photoion_xs; + auto *levelphixstable = tmpallphixs.data() + globals::elements[element].ions[lowerion].levels[lowerlevel].phixsstart; if (phixs_file_version == 1) { assert_always(get_nphixstargets(element, lowerion, lowerlevel) == 1); assert_always(get_phixsupperlevel(element, lowerion, lowerlevel, 0) == 0); @@ -1448,12 +1448,13 @@ void setup_phixs_list() { globals::NPHIXSPOINTS * sizeof(float)); } - free(globals::elements[element].ions[ion].levels[level].photoion_xs); globals::elements[element].ions[ion].levels[level].photoion_xs = blocktablestart; nbftableschanged++; } } + tmpallphixs.clear(); + tmpallphixs.shrink_to_fit(); assert_always(nbftableschanged == nbftables); #ifdef MPI_ON MPI_Barrier(MPI_COMM_WORLD);