Skip to content

Commit

Permalink
Start incremental block phixs
Browse files Browse the repository at this point in the history
  • Loading branch information
lukeshingles committed Aug 30, 2024
1 parent 3fb6d60 commit 50cd8de
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 0 deletions.
1 change: 1 addition & 0 deletions globals.h
Original file line number Diff line number Diff line change
Expand Up @@ -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.

Expand Down
4 changes: 4 additions & 0 deletions input.cc
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,8 @@ constexpr std::array<std::string_view, 24> inputlinecomments = {

CellCachePhixsTargets *chphixstargetsblock{};

std::vector<float> 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) {
Expand Down Expand Up @@ -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<float *>(malloc(globals::NPHIXSPOINTS * sizeof(float)));
assert_always(globals::elements[element].ions[lowerion].levels[lowerlevel].photoion_xs != nullptr);
Expand Down

0 comments on commit 50cd8de

Please sign in to comment.