From d51b0c32f2acd36c0efc1b9d44878f1c396aaf08 Mon Sep 17 00:00:00 2001 From: Jordi Manyer Date: Wed, 11 Mar 2026 23:49:10 +1100 Subject: [PATCH] Minor change in visualization, makes it more understandable and less prone to error --- NEWS.md | 9 +++++++++ src/Visualization.jl | 6 +----- test/sequential/VisualizationTests.jl | 7 +++++++ 3 files changed, 17 insertions(+), 5 deletions(-) create mode 100644 test/sequential/VisualizationTests.jl diff --git a/NEWS.md b/NEWS.md index d791a38a..6e6756fe 100644 --- a/NEWS.md +++ b/NEWS.md @@ -5,6 +5,15 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). +## [Unreleased] + +### Fixed + +- Fixed `BlockPMatrix{V}(::UndefInitializer, rows, cols)` constructor dropping the `cols` argument, causing a `MethodError` at runtime. +- Fixed `local_views(::BlockPMatrix, rows, cols)` indexing 1D block-range vectors with a 2D `CartesianIndex`, causing `BoundsError` for any multi-field problem with ≥2 fields. +- Fixed `mul!(y::BlockPVector, A::BlockPMatrix, x::BlockPVector, α, β)` computing `α*β*(A*x)` instead of `α*(A*x) + β*y`; the 3-arg `mul!` was also updated to correctly zero `y` before accumulating. +- Replaced fragile closure side-effect in `DistributedVisualizationData.filebase` with `getany(map(...))` for correct and idiomatic behaviour in both debug and MPI modes. + ## [0.4.11] - 2026-02-20 ### Added diff --git a/src/Visualization.jl b/src/Visualization.jl index 0535e224..cfaafb34 100644 --- a/src/Visualization.jl +++ b/src/Visualization.jl @@ -10,11 +10,7 @@ function Base.getproperty(x::DistributedVisualizationData, sym::Symbol) if sym == :grid map(i->i.grid,x.visdata) elseif sym == :filebase - r=nothing - map(x.visdata) do visdata - r = visdata.filebase - end - r + getany(map(i->i.filebase,x.visdata)) elseif sym == :celldata map(i->i.celldata,x.visdata) elseif sym == :nodaldata diff --git a/test/sequential/VisualizationTests.jl b/test/sequential/VisualizationTests.jl new file mode 100644 index 00000000..121825dc --- /dev/null +++ b/test/sequential/VisualizationTests.jl @@ -0,0 +1,7 @@ +module VisualizationTestsSeq + include("../VisualizationTests.jl") + using PartitionedArrays + with_debug() do distribute + VisualizationTests.main(distribute,(2,2)) + end +end