-
Notifications
You must be signed in to change notification settings - Fork 23
Modified handling pvd files when the triangulation is not present on all processes. #174
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
|
|
@@ -5,43 +5,13 @@ 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 | ||||||
| ## [Unreleased] | ||||||
|
|
||||||
| ### Added | ||||||
|
|
||||||
| - New overloads for the `TrialFESpace` constructor where the data to be imposed is passed as a `DistributedCellField`. Since PR[#183](https://github.com/gridap/GridapDistributed.jl/pull/183). | ||||||
| - Added missing `FESpace` constructors for distributed triangulations specialized for the RT FEs case. Since PR[#188](https://github.com/gridap/GridapDistributed.jl/pull/188) | ||||||
|
|
||||||
| ## [0.4.10] - 2025-09-29 | ||||||
|
|
||||||
| ### Added | ||||||
|
|
||||||
| - Added support for multiple ghost layers on cartesian models. Since PR[#182](https://github.com/gridap/GridapDistributed.jl/pull/182). | ||||||
| - Added new way of doing AD for MultiField, where partials are computed separately for each field then merged together. Since PR[#176](https://github.com/gridap/GridapDistributed.jl/pull/176). | ||||||
|
|
||||||
| ### Fixed | ||||||
|
|
||||||
| - Fixed issue [#177](https://github.com/gridap/GridapDistributed.jl/issues/177) and [#170](https://github.com/gridap/GridapDistributed.jl/issues/170). Since PR[#180](https://github.com/gridap/GridapDistributed.jl/pull/180). | ||||||
| - Fixed issue where calling `Boundary(with_ghost, dmodel)` would return the local processor boundaries (which include the faces at the interface between processors) instead of returning the local part of the global boundary. Since PR[#180](https://github.com/gridap/GridapDistributed.jl/pull/180). | ||||||
|
|
||||||
| ## [0.4.9] - 2025-08-08 | ||||||
|
|
||||||
| ### Added | ||||||
|
|
||||||
| - Added a new framework for redistributing dofs, which is more efficient and flexible than the previous one. Since PR[#179](https://github.com/gridap/GridapDistributed.jl/pull/179). | ||||||
|
|
||||||
| ### Fixed | ||||||
|
|
||||||
| - Fixed bug when redistributing periodic cartesian models. Since PR[#179](https://github.com/gridap/GridapDistributed.jl/pull/179). | ||||||
|
|
||||||
| ## [0.4.8] - 2025-06-11 | ||||||
|
|
||||||
| ### Added | ||||||
| ### Fixed | ||||||
|
|
||||||
| - Added support for Gridap v0.19, with distributed counterparts for the new feaures introduced. This includes support for polytopal meshes, polytopal methods and patch assembly. Since PR[#175](https://github.com/gridap/GridapDistributed.jl/pull/175). | ||||||
| - Added `MacroDiscreteModel`, which gives a global numbering and classification of the interfaces between processors. Since PR[#175](https://github.com/gridap/GridapDistributed.jl/pull/175). | ||||||
| - Added support to create pvd files when the triangulation is not there on all processes. To achive this, a new method for the createpvd function is added. | ||||||
|
||||||
| - Added support to create pvd files when the triangulation is not there on all processes. To achive this, a new method for the createpvd function is added. | |
| - Added support to create pvd files when the triangulation is not there on all processes. To achieve this, a new method for the createpvd function is added. |
Copilot
AI
Jan 13, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Inconsistent date format. All other entries use the format "## [version] - YYYY-MM-DD" with a hyphen before the date, but this entry is missing the hyphen.
| ## [0.4.7] 2025-03-04 | |
| ## [0.4.7] - 2025-03-04 |
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
|
|
@@ -222,13 +222,35 @@ end | |||||
|
|
||||||
| struct DistributedPvd{T<:AbstractArray} | ||||||
| pvds::T | ||||||
| parts::AbstractArray | ||||||
| end | ||||||
|
|
||||||
| function Visualization.createpvd(trian::DistributedTriangulation,parts::AbstractArray,args...;kwargs...) | ||||||
| nparts, new_parts = filter_empty_parts(parts,local_views(trian)) | ||||||
| pvds = map(new_parts) do part | ||||||
| if part == 1 | ||||||
| paraview_collection(args...;kwargs...) | ||||||
| end | ||||||
| end | ||||||
| DistributedPvd(pvds,new_parts) | ||||||
| end | ||||||
|
Comment on lines
+228
to
+236
|
||||||
|
|
||||||
| function Visualization.createpvd(f,trian::DistributedTriangulation,parts::AbstractArray,args...;kwargs...) | ||||||
| pvd = createpvd(trian,parts,args...;kwargs...) | ||||||
| try | ||||||
| f(pvd) | ||||||
| finally | ||||||
| savepvd(pvd) | ||||||
| end | ||||||
| end | ||||||
|
|
||||||
| function Visualization.createpvd(parts::AbstractArray,args...;kwargs...) | ||||||
| pvds = map_main(parts) do part | ||||||
| paraview_collection(args...;kwargs...) | ||||||
| pvds = map(parts) do part | ||||||
| if part == 1 | ||||||
| paraview_collection(args...;kwargs...) | ||||||
| end | ||||||
| end | ||||||
| DistributedPvd(pvds) | ||||||
| DistributedPvd(pvds,parts) | ||||||
| end | ||||||
|
|
||||||
| function Visualization.createpvd(f,parts::AbstractArray,args...;kwargs...) | ||||||
|
|
@@ -241,14 +263,22 @@ function Visualization.createpvd(f,parts::AbstractArray,args...;kwargs...) | |||||
| end | ||||||
|
|
||||||
| function Visualization.savepvd(pvd::DistributedPvd) | ||||||
| map_main(pvd.pvds) do pvd | ||||||
| vtk_save(pvd) | ||||||
| map(pvd.pvds, pvd.parts) do pvd, part | ||||||
| if part == 1 | ||||||
|
||||||
| if part == 1 | |
| if part == 1 |
Copilot
AI
Jan 13, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Trailing whitespace after the closing brace should be removed.
| end | |
| end |
Copilot
AI
Jan 13, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
When using the non-filtered createpvd method (lines 247-254) with potentially empty triangulations, part == 1 could correspond to a process with an empty triangulation, making pvtk equal to nothing. Assigning nothing to the paraview collection may cause an error. Consider adding an additional check: if part == 1 && !isnothing(pvtk) to ensure the pvtk is valid before adding it to the collection.
| if part == 1 | |
| if part == 1 && !isnothing(pvtk) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Trailing whitespace after "Fixed" should be removed.