rice-solar-physics / HYDRAD

HYDrodynamics and RADiation Code for computing solutions to field-aligned hydrodynamic equations in coronal loops
MIT License
9 stars 4 forks source link

Don't require atomic data when using the power-law option for the radiative losses #11

Open wtbarnes opened 6 years ago

wtbarnes commented 6 years ago

When using the power-law radiative loss option, no atomic data is required for the calculation (I think??). However, when the Radiation object is initialized, atomic data is read from Radiation_Model/atomic_data even when using the power-law option.

It would be convenient if this data was not required when using the power-law option. This is particularly useful when doing many (hundreds or thousands) HYDRAD and/or Initial Conditions as it means that the atomic data (which is by far the largest percentage of the repo) can be left out of the folder when copying the code repeatedly. This would make the setup of many runs much quicker as the atomic data is rather

Unless this data is used elsewhere (even when selecting the power-law option), I think it would just be a matter of adding something like this to the Radiation constructor,

CRadiation::CRadiation( char *szFilename)
{
#ifndef USE_POWER_LAW_RADIATIVE_LOSSES
Initialise( szFilename );
#endif
}
sjbradshaw commented 6 years ago

The atomic data will be needed if solving for the non-equilibrium ionization state, but de-coupled from the radiation calculation and using the power-law radiative losses.

From: Will Barnes notifications@github.com Sent: Wednesday, April 11, 2018 11:57 AM To: rice-solar-physics/HYDRAD HYDRAD@noreply.github.com Cc: Subscribed subscribed@noreply.github.com Subject: [rice-solar-physics/HYDRAD] Don't require atomic data when using the power-law option for the radiative losses (#11)

When using the power-law radiative loss option, no atomic data is required for the calculation (I think??). However, when the Radiation object is initialized, atomic data is read from Radiation_Model/atomic_data even when using the power-law option.

It would be convenient if this data was not required when using the power-law option. This is particularly useful when doing many (hundreds or thousands) HYDRAD and/or Initial Conditions as it means that the atomic data (which is by far the largest percentage of the repo) can be left out of the folder when copying the code repeatedly. This would make the setup of many runs much quicker as the atomic data is rather

Unless this data is used elsewhere (even when selecting the power-law option), I think it would just be a matter of adding something like this to the Radiation constructor,

CRadiation::CRadiation( char *szFilename) {

ifndef USE_POWER_LAW_RADIATIVE_LOSSES

Initialise( szFilename );

endif

}

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/rice-solar-physics/HYDRAD/issues/11 , or mute the thread https://github.com/notifications/unsubscribe-auth/AIXhfgwcIF84RCwheBUgakn0C7BG9l2kks5tnjX1gaJpZM4TQZYe . https://github.com/notifications/beacon/AIXhfmYGr7ymV9wMQtHtRyNNxVtYmPVOks5tnjX1gaJpZM4TQZYe.gif

wtbarnes commented 6 years ago

I forgot about that option. Presumably then you could just use the flag for the decoupled NEI calculation,

CRadiation::CRadiation( char *szFilename)
{
#ifdef USE_POWER_LAW_RADIATIVE_LOSSES
#ifdef DECOUPLE_IONIZATION_STATE_SOLVER
Initialise( szFilename );
#endif
#else
Initialise( szFilename );
#endif
}

A bit ugly since I don't think C preprocessor statements have logical AND/OR operators, but I think that would work.

sjbradshaw commented 6 years ago

The preprocessor can handle logic. E.g:

if defined SOMETHING && defined SOMETHING_ELSE

else

endif

Or,

if defined SOMETHING || defined SOMETHING_ELSE

endif

Etc.

Cheers,

Steve

From: Will Barnes notifications@github.com Sent: Thursday, April 12, 2018 2:47 PM To: rice-solar-physics/HYDRAD HYDRAD@noreply.github.com Cc: sjbradshaw stephen.bradshaw@rice.edu; Comment comment@noreply.github.com Subject: Re: [rice-solar-physics/HYDRAD] Don't require atomic data when using the power-law option for the radiative losses (#11)

I forgot about that option. Presumably then you could just use the flag for the decoupled NEI calculation,

CRadiation::CRadiation( char *szFilename) {

ifdef USE_POWER_LAW_RADIATIVE_LOSSES

ifdef DECOUPLE_IONIZATION_STATE_SOLVER

Initialise( szFilename );

endif

else

Initialise( szFilename );

endif

}

A bit ugly since I don't think C preprocessor statements have logical AND/OR operators, but I think that would work.

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/rice-solar-physics/HYDRAD/issues/11#issuecomment-380923293 , or mute the thread https://github.com/notifications/unsubscribe-auth/AIXhfk_SMIY4HmeXvXHExfETdeeU3fQPks5tn69LgaJpZM4TQZYe . https://github.com/notifications/beacon/AIXhfn9PYqP0yAfWQ5Sz5wRV8IuBXqrKks5tn69LgaJpZM4TQZYe.gif

wtbarnes commented 6 years ago

Closed by #18

wtbarnes commented 5 years ago

Reverted by #19