Add tensor_to_scalar add_output overload (#142) - #157
Open
petlenz wants to merge 1 commit into
Open
Conversation
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.
Closes #142.
Scalar-from-tensor outputs (von Mises, dissipation, trace) were inexpressible:
OutputDecl::exprheld only scalar/tensor alternatives while the t2s emitter sat fully wired but unreachable from outputs. This addsadd_output(name, expression_holder<tensor_to_scalar_expression>, role)producing a Kind::Scalar OutputDecl (renders asdouble &<name>_outthrough the existing ScalarOutput path — no canonical_arguments/render changes needed).OutputDecl::exprvariant-visit site audited: SymbolValidationPass leaf sweep and the CodeEmitPass render arm gained t2s branches (LeafCollector/CodeEmitPipeline already hadcollect_t2s/.t2s()); NumSimMaterialTarget's twostd::getsites now guard withholds_alternativeand reject loudly ("does not support yet… add_output overload for tensor_to_scalar expressions (von Mises, dissipation) — scalar-from-tensor outputs are inexpressible #142") instead ofbad_variant_access; AlgorithmicTangentPass is pre-guarded by its Kind::Tensor check.expected_rank != 0(a t2s output is scalar-valued;roles::Dissipationpasses,roles::Stressthrows).MaterialProperty<Real>); NumSimMaterialTarget rejects loudly pending its dual leaf-scoping/JSON work.Tests (+7): signature/emission assertions, duplicate/role/leaf-validation negatives, NumSimMaterial rejection, and a compile-and-run gate (recipe
T2sOutputCheck:tr_eps = trace(eps),vm_like = sqrt(w·(ε:ε))) numerically checked against hand-computed values.Rebased onto current main. gcc-14 Debug (-Werror): ctest 328/328.