Skip to content

Question: why is the coordinate system compiler time specific? #398

Answered by c-white
kurtsansom asked this question in Q&A
Discussion options

You must be logged in to vote

This was done for optimization. The code only knows about the chosen coordinates through comparisons to COORDINATE_SYSTEM, especially in meshblock.cpp, and these could be set at runtime. But if the comparisons are not compile-time evaluatable, there is little chance the compiler will inline calls to functions in the Coordinates class.

If it turns out that with present-day compilers we can get the same performance by specifying coordinates at runtime, then we could consider changing this.

Replies: 2 comments

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Answer selected by kurtsansom
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
question Source code inquiries (not for asking about code usage)
2 participants
Converted from issue

This discussion was converted from issue #397 on October 01, 2021 17:52.