Skip to content

Check that the components of a VectorFemSpace share the same DomainDecomposition - #625

Merged
yguclu merged 5 commits into
develfrom
yguclu-VectorFemSpace-ddm
Oct 20, 2026
Merged

yguclu merged 5 commits into
develfrom
yguclu-VectorFemSpace-ddm

Conversation

@yguclu

@yguclu yguclu commented Oct 11, 2026 •

Copy link
Copy Markdown
Member

Require all the components of a VectorFemSpace to share the same DomainDecomposition object (fixes #615).

A VectorFemSpace contains spaces defined on the same patch, hence all its components must be decomposed in the same way across the MPI processes. Until now the constructor did not check this, and it accepted components with different local subdomains, which would silently give wrong results in any operation coupling the components locally.

  • In VectorFemSpace.__init__, assert that the components share the same DomainDecomposition object
  • Add two serial unit tests to psydac.fem.tests.test_vector_spaces, with shared and with different (although identical) domain decompositions
  • Add an MPI unit test (at least 2 processes) where the components are decomposed along different axes, hence with different local subdomains, as in the example of VectorFemSpace does not check that its components share the same domain decomposition #615

The strict check (same object) is sufficient for PSYDAC: all the vector spaces created by the library already satisfy it. This was verified by temporarily recording every violation in the constructor while running the serial test suite (about 15400 tests), the serial multipatch and FEEC tests with SymPDE 0.20 (1873 tests), and the MPI tests of psydac.api, psydac.fem, and psydac.feec on 4 processes (1026 tests): no violation was found.

Note that this tightens the API: user code which builds the components of a vector space with separate (even if identical) DomainDecomposition objects now raises an AssertionError, also in serial. The fix is to create one DomainDecomposition and pass it to all the components.

@yguclu yguclu added the Next Release Must be in next release label Oct 11, 2026
@codacy-production

codacy-production Bot commented Oct 11, 2026 •

Copy link
Copy Markdown

Up to standards ✅

🟢 Issues 0 issues

Results:
0 new issues

View in Codacy

🟢 Metrics 11 complexity · 0 duplication

Metric Results
Complexity 11
Duplication 0

View in Codacy

🟢 Coverage 70.83% diff coverage · -0.01% coverage variation

Metric Results
Coverage variation ✅ -0.01% coverage variation
Diff coverage ✅ 70.83% diff coverage

View coverage diff in Codacy

Coverage variation details
Coverable lines Covered lines Coverage
Common ancestor commit (d3b2c8e) 52303 33576 64.20%
Head commit (3080612) 104654 (+52351) 67170 (+33594) 64.18% (-0.01%)

Coverage variation is the difference between the coverage for the head and common ancestor commits of the pull request branch: <coverage of head commit> - <coverage of common ancestor commit>

Diff coverage details
Coverable lines Covered lines Diff coverage
Pull request (#625) 24 17 70.83%

Diff coverage is the percentage of lines that are covered by tests out of the coverable lines that the pull request added or modified: <covered lines added or modified>/<coverable lines added or modified> * 100%

NEW Get contextual insights on your PRs based on Codacy's metrics, along with PR and Jira context, without leaving GitHub. Enable AI reviewer
TIP This summary will be updated as you push new changes.

@yguclu
yguclu marked this pull request as ready for review October 11, 2026 17:18
@yguclu
yguclu requested review from a team and campospinto October 11, 2026 19:30
@yguclu yguclu self-assigned this Oct 15, 2026

@FrederikSchnack FrederikSchnack left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Except for adding a MPI test, this looks good to me.

Comment thread psydac/fem/tests/test_vector_spaces.py
…ods from the decomposition in the test helper
@yguclu
yguclu marked this pull request as draft October 20, 2026 15:21
@yguclu
yguclu marked this pull request as ready for review October 20, 2026 15:21
@yguclu
yguclu enabled auto-merge (squash) October 20, 2026 15:30
@yguclu
yguclu merged commit e520f53 into devel Oct 20, 2026
10 checks passed
@yguclu
yguclu deleted the yguclu-VectorFemSpace-ddm branch October 20, 2026 17:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Next Release Must be in next release

Projects

None yet

Development

Successfully merging this pull request may close these issues.

VectorFemSpace does not check that its components share the same domain decomposition

2 participants