Skip to content

User-defined source functions cannot read parameters from athinput files #622

Closed Answered by tomidakn
smandal97 asked this question in Q&A
Discussion options

You must be logged in to vote

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.

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@smandal97
Comment options

Answer selected by smandal97
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants
Converted from issue

This discussion was converted from issue #621 on September 18, 2024 03:45.