Modification to the Units module#673
Open
rjtanner wants to merge 9 commits intoPrincetonUniversity:mainfrom
Open
Modification to the Units module#673rjtanner wants to merge 9 commits intoPrincetonUniversity:mainfrom
rjtanner wants to merge 9 commits intoPrincetonUniversity:mainfrom
Conversation
Collaborator
|
Can one of the admins verify this patch? |
Contributor
Contributor
|
Sorry for taking too long to review this. Before going through the new additions, the renaming of variables is violating the style guid. I personally has no preference in variable style, but the current
|
Contributor
|
ok to test |
tomidakn
reviewed
Mar 3, 2026
Contributor
tomidakn
left a comment
There was a problem hiding this comment.
It looks fine to me. Some variables names do not follow the style but I think Gconst and H(hydrogen) are acceptable. But I would like to leave the final decision to @changgoo .
I appreciate if you could write up the Wiki documentation and send it to me so that I can update it.
| } | ||
| phydro->u(IDN,k,j,i) = den; | ||
| phydro->u(IM1,k,j,i) = vel; | ||
| phydro->u(IM2,k,j,i) = vel/2; |
Contributor
There was a problem hiding this comment.
In C, real numbers should be written like 2.0, 3.0.
| if (unit == "km/s") { | ||
| code_cgs_ = Constants::km_s_cgs*value; | ||
| } else if (unit == "m/s") { | ||
| code_cgs_ = 100*value; |
| } else if (unit == "g") { | ||
| code_cgs_ = value; | ||
| } else if (unit == "kg") { | ||
| code_cgs_ = 1000*value; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Prerequisite checklist
Please review the
CONTRIBUTING.mdfile for detailed guidelines.Description
Major changes:
Minor changes:
Testing and validation
This doesn't change anything "internal" to Athena, but only facilitates the interface between the input file and the problem file.
I included an example problem and input file that demonstrates how to use units.
To-do
The wiki page on units would need to be updated. I can write something up for that.