Skip to content

StateVariableFieldView - #334

Merged
cmhamel merged 3 commits into
mainfrom
fields/StateVariableFieldView
Aug 7, 2026
Merged

StateVariableFieldView#334
cmhamel merged 3 commits into
mainfrom
fields/StateVariableFieldView

Conversation

@cmhamel

@cmhamel cmhamel commented Aug 7, 2026

Copy link
Copy Markdown
Contributor

Similar to the previous few PRs on properties.

Note this will require a small PR to Carina.jl which I have in progress.

@cmhamel
cmhamel requested a review from lxmota August 7, 2026 21:37
@codecov

codecov Bot commented Aug 7, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 98.66667% with 1 line in your changes missing coverage. Please review.
✅ Project coverage is 71.14%. Comparing base (277f2f7) to head (2ce07f9).

Files with missing lines Patch % Lines
src/Utils.jl 85.71% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #334      +/-   ##
==========================================
+ Coverage   70.95%   71.14%   +0.18%     
==========================================
  Files          54       54              
  Lines        6294     6324      +30     
==========================================
+ Hits         4466     4499      +33     
+ Misses       1828     1825       -3     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Three things the signature sweep in this branch left behind.

`assemble_diagonal!`'s `use_inplace_methods` branch still passed
`conns.data, conns.offsets[b]` to `_assemble_block!`, which now takes
`conns_all` -- 15 arguments into a 14-argument method, so that path
raises a `MethodError` on any assembler built with
`use_inplace_methods = true`.  `Matrix.jl` and `Vector.jl` were both
updated; this one was missed.  Restoring the call keeps the branch
behaving exactly as it did before the sweep.

Worth a separate look, though: `stiffness!` scatters a full element
matrix through `scatter_with_gradients_and_gradients!`, while the
out-of-place branch extracts the diagonal via `AssembledDiagonal()`.
The in-place branch passes no return type at all, so it cannot know to
take a diagonal.  That predates this branch and is left alone here.

`adapt_structure` for `StateVariableField` computed
`nfields = adapt(to, field.nfields)`, used `typeof(nfields)` for the
type parameter, then passed the *unadapted* `field.nfields` as the
value.  It only worked because the inner constructor converts
implicitly; pass the adapted vector.

`properties` had an `if/elseif` with no `else`, so any third value of
`isblockconstant` left `start` undefined and surfaced as an
`UndefVarError` naming a local instead of the actual problem.  Only two
layouts exist, so the second branch is now total and asserts which one
it is.

Tests cover `state_variables` against `block_view` for every
(block, element, quadrature point), the concrete `eltype`, bounds on
both `getindex` and `setindex!`, and that a write lands where the
matching read looks.

Signed-off-by: Alejandro Mota <amota@sandia.gov>
@cmhamel
cmhamel merged commit 0134255 into main Aug 7, 2026
11 of 13 checks passed
@cmhamel
cmhamel deleted the fields/StateVariableFieldView branch August 7, 2026 22:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants