[Core] Making Variable and VariableData constexpr#14260
Open
sunethwarna wants to merge 15 commits intomasterfrom
Open
[Core] Making Variable and VariableData constexpr#14260sunethwarna wants to merge 15 commits intomasterfrom
sunethwarna wants to merge 15 commits intomasterfrom
Conversation
Member
|
Took a first look and unless I missed something this looks fine. I focused on checking that moving from gj @sunethwarna !! |
avdg81
reviewed
Mar 6, 2026
Contributor
avdg81
left a comment
There was a problem hiding this comment.
On behalf of @KratosMultiphysics/geomechanics, we're okay with the changes proposed for the GeoMechanicsApplication 👍
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.
📝 Description
As in the title, this PR tries to make the
VariableandVariableDataconstexpr. One advantage is that we can now useswitchjump table optimizations with variables.This makes
Variable::mZerostatic, which, anyway, was always default-initialized. No customzerodefinitions were found anywhere in Kratos [ Check #14253 ].Closes #14253
Eg:
Kratos/kratos/tests/cpp_tests/containers/test_variables.cpp
Lines 95 to 101 in 4eff549
or
Kratos/kratos/tests/cpp_tests/containers/test_variables.cpp
Lines 107 to 113 in 4eff549
Lets see whether what problems the CI gives.
🆕 Changelog
VariableandVariableDatato be const correct.Variable::mZerostatic and default initialized to zero.VariableandVariableDataconstexprswitch