Repository navigation
required<T>/optional<T> helpers for parameter declarations (#74) - #92
Merged
Merged
Conversation
core/parameter_helpers.h: required<T>(para, key) and optional<T>(para, key, default) replace para.template insert<T>(key).template add<...>(). linear_isotropic_hardening and exponential_isotropic_hardening use them; other materials can follow one at a time. Closes #74
Member
Author
|
Review findings (design, tmech expressions instead of component loops, modern C++, comments, tests, correctness). Severity: must = wrong result, hang, build break or unreachable feature; should = design, duplication, accuracy; nit = style. required/optional helpers — ready
|
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.
What
core/parameter_helpers.h:These replace
para.template insert<T>(key).template add<is_required>()/add<set_default>(v). They are additive (existing materials compile unchanged) and return the parameter, so checks or a description can be chained. They are also the place to attachcheck_data_type/range<>later (#65).linear_isotropic_hardeningandexponential_isotropic_hardeninguse them, as a demonstration. The other materials are not converted here: most of their files are touched by the open PRs #79–#86, so they can follow one at a time after those merge.The reading side (
base::template get_parameter<T>) is not changed; a helper for it needsmaterial_base.h, which #86 changes.Tests
ParameterHelpers.RequiredAndOptionalDeclareTheParameters(intest_set_parameter.cpp): a missing required parameter throws, defaults are applied, and a given value is kept. It failed to compile before. GCC 14 Debug with fetched dependencies: 622/622.Closes #74