-
Hi, I'm trying to write a source function for a stellar wind. Ideally, I'd like to store parameters for the wind (Mdot, v_wind etc.) in the athinput file. But I can't get the source function to access ParameterInput. Is there a way to have the source function access ParameterInput and therefore read parameters directly? Thanks! |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
You can define global variables in your problem generator file (protect it with a namespace if you wish), and set them in Mesh::InitUserMeshData or MeshBlock::InitUserMeshBlockData. If you do not like global variables, you can use user-defined data fields instead. Please take a look at the documentation. In any case, accessing ParameterInput is not very fast, so we recommend to store the variable somewhere at the beginning of your simulation. |
Beta Was this translation helpful? Give feedback.
You can define global variables in your problem generator file (protect it with a namespace if you wish), and set them in Mesh::InitUserMeshData or MeshBlock::InitUserMeshBlockData. If you do not like global variables, you can use user-defined data fields instead. Please take a look at the documentation.
https://github.com/PrincetonUniversity/athena/wiki/Problem-Generators
In any case, accessing ParameterInput is not very fast, so we recommend to store the variable somewhere at the beginning of your simulation.