Skip to content

On which loop can I update variables? #460

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

You must be logged in to vote

For analysis, MeshBlock::UserWorkInLoop and Mesh::UserWorkInLoop are suitable, as they are called only once in a timestep. However, if you modify physical quantities within these functions, the results will be inconsistent.
Instead, you should use user-defined source function to update physical quantities. Please read here.
https://github.com/PrincetonUniversity/athena/wiki/Problem-Generators#user-defined-physical-source-term

Replies: 1 comment 1 reply

Comment options

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

Answer selected by Rogerod23
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 #459 on October 11, 2022 16:47.