Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Segfault with certain options #98

Open
junverferth opened this issue Jul 27, 2023 · 3 comments
Open

Segfault with certain options #98

junverferth opened this issue Jul 27, 2023 · 3 comments

Comments

@junverferth
Copy link
Collaborator

Issue:
Picking both beam heating and power law radiation losses leads to a seg fault.

Cause:
The changes to Radiation_Model/source/radiation.cpp from commit:b39b7a7 as part of pull #90 that added in a set of if statements determining when to initialize the radiation object. Selecting electron beam heating and power law radiation sets the condition that the radiation object is needed for ionization states in the beam calculation but never initialized.

Proposed Fix:
Adding in Initialise( szFilename ); at the end of the else statement (line 40) fixes the issue, though in that case the set of if statements appears redundant.

@jwreep
Copy link
Member

jwreep commented Jul 27, 2023

Perhaps the logic could be rearranged a tad.

#if !defined (USE_POWER_LAW_RADIATIVE_LOSSES)

could be changed to

#if !defined (USE_POWER_LAW_RADIATIVE_LOSSES) || (defined (BEAM_HEATING) && defined(USE_POWER_LAW_RADIATIVE_LOSSES))

if I got the syntax correct . . .

@junverferth
Copy link
Collaborator Author

Alternatively,
#if defined(BEAM_HEATING)
Initialise( szFilename );
else (current set of if statements)

that would ensure that whenever the beam is used, you get the ionization fractions, and then only if you need them on without a beam.

@sjbradshaw
Copy link
Contributor

sjbradshaw commented Jul 29, 2023 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants