From 9c8b5b23b411f0de3159150dc0a02b5be3a049e1 Mon Sep 17 00:00:00 2001 From: Luke Shingles Date: Fri, 30 Aug 2024 17:01:19 +0100 Subject: [PATCH] Start incremental block phixs --- globals.h | 1 + input.cc | 4 ++++ 2 files changed, 5 insertions(+) diff --git a/globals.h b/globals.h index cff46cdfa..0b7176ff0 100644 --- a/globals.h +++ b/globals.h @@ -88,6 +88,7 @@ struct EnergyLevel { int ndowntrans{0}; PhotoionTarget *phixstargets{}; // pointer to table of target states and probabilities float *photoion_xs{}; // Pointer to a lookup-table providing photoionisation cross-sections for this level. + int phixsstart{-1}; // index to start of photoionisation cross-sections table in global::allphixs int nphixstargets{0}; // length of phixstargets array: float stat_weight{0.}; // Statistical weight of this level. diff --git a/input.cc b/input.cc index 9801ab75a..7358cb7f8 100644 --- a/input.cc +++ b/input.cc @@ -87,6 +87,8 @@ constexpr std::array inputlinecomments = { CellCachePhixsTargets *chphixstargetsblock{}; +std::vector tmpallphixs; + void read_phixs_data_table(std::fstream &phixsfile, const int nphixspoints_inputtable, const int element, const int lowerion, const int lowerlevel, const int upperion, int upperlevel_in, size_t *mem_usage_phixs, const int phixs_file_version) { @@ -175,6 +177,8 @@ void read_phixs_data_table(std::fstream &phixsfile, const int nphixspoints_input } *mem_usage_phixs += globals::NPHIXSPOINTS * sizeof(float); + globals::elements[element].ions[lowerion].levels[lowerlevel].phixsstart = tmpallphixs.size(); + tmpallphixs.resize(tmpallphixs.size() + globals::NPHIXSPOINTS); globals::elements[element].ions[lowerion].levels[lowerlevel].photoion_xs = static_cast(malloc(globals::NPHIXSPOINTS * sizeof(float))); assert_always(globals::elements[element].ions[lowerion].levels[lowerlevel].photoion_xs != nullptr);