Skip to content

Conversation

@amartinhuertas
Copy link
Member

@amartinhuertas amartinhuertas commented Dec 19, 2025

This PR adds to GridapDistributed a missing specialized FESpace constructor for triangulations and RT spaces

for the case in which one wants to set up it from a distributed
triangulation

Modified existing specialized FESpace constructors for discrete models
such that they become compliant with the ones in GridapDistributed
default FESpace constructors. In particular, re their behaviour when
they are feed with DistributedModels versus DistributedTriangulation.
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR adds specialized FESpace constructors for Raviart-Thomas finite elements that accept a DistributedTriangulation directly, allowing more flexible initialization patterns. The test function is also refactored to accept triangulation and assembly strategy as parameters to support testing the new constructors.

  • Adds two new FESpace constructors for DistributedTriangulation with Raviart-Thomas reference elements (tuple and GenericRefFE forms)
  • Adds split_own_and_ghost and constraint parameters to existing Raviart-Thomas constructors for consistency with the general FESpace API
  • Introduces _setup_dmodel_and_dtrian helper function to extract model from triangulation

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 8 comments.

File Description
src/DivConformingFESpaces.jl Adds new FESpace constructors accepting DistributedTriangulation, updates existing constructors with new parameters, and adds helper functions
test/DivConformingTests.jl Refactors test function to accept triangulation and assembly strategy parameters, adds test cases for new constructors

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

cell_reffe = ReferenceFE(m,basis,reffe_args...;reffe_kwargs...)
end
_common_fe_space_constructor(model,cell_reffes;conformity,kwargs...)
_common_fe_space_constructor(model,cell_reffes;conformity,split_own_and_ghost,kwargs...)
Copy link

Copilot AI Dec 19, 2025

Choose a reason for hiding this comment

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

The constraint parameter is declared but not used. The function should call _add_distributed_constraint on the returned space before returning it, similar to how the general FESpace constructors handle constraints. This would enable constraint functionality like :zeromean for Raviart-Thomas spaces.

Copilot uses AI. Check for mistakes.
Fill(reffe,num_cells(m))
end
_common_fe_space_constructor(model,cell_reffes;conformity,kwargs...)
_common_fe_space_constructor(model,cell_reffes;conformity,split_own_and_ghost,kwargs...)
Copy link

Copilot AI Dec 19, 2025

Choose a reason for hiding this comment

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

The constraint parameter is declared but not used. The function should call _add_distributed_constraint on the returned space before returning it, similar to how the general FESpace constructors handle constraints. This would enable constraint functionality like :zeromean for Raviart-Thomas spaces.

Copilot uses AI. Check for mistakes.
get_active_model(t)
end
GenericDistributedDiscreteModel(models, generate_cell_gids(trian)), trian
end
Copy link

Copilot AI Dec 19, 2025

Choose a reason for hiding this comment

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

There is trailing whitespace at the end of this line. Remove the trailing whitespace for consistency with code style.

Suggested change
end
end

Copilot uses AI. Check for mistakes.
kwargs...)
dmodel, dtrian = _setup_dmodel_and_dtrian(_trian)
cell_reffes = map(local_views(dmodel)) do m
Fill(reffe,num_cells(m))
Copy link

Copilot AI Dec 19, 2025

Choose a reason for hiding this comment

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

There is inconsistent indentation here - an extra space is present at the beginning of this line. Remove it for consistency with the surrounding code.

Suggested change
Fill(reffe,num_cells(m))
Fill(reffe,num_cells(m))

Copilot uses AI. Check for mistakes.
f(model,reffe,trian,das)
f(trian,reffe,trian,das)
f(Triangulation(model),reffe,trian,das)

Copy link

Copilot AI Dec 19, 2025

Choose a reason for hiding this comment

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

This line contains only whitespace. Remove the trailing whitespace for consistency with code style.

Suggested change

Copilot uses AI. Check for mistakes.
dc2 = dc.contribs.items[2]
c1 = Gridap.CellData.get_contribution(dc1,t1)
c2 = Gridap.CellData.get_contribution(dc2,t2)

Copy link

Copilot AI Dec 19, 2025

Choose a reason for hiding this comment

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

This line contains only whitespace. Remove the trailing whitespace for consistency with code style.

Suggested change

Copilot uses AI. Check for mistakes.
basis,reffe_args,reffe_kwargs = reffe
cell_reffe = ReferenceFE(m,basis,reffe_args...;reffe_kwargs...)
end
_common_fe_space_constructor(dmodel,cell_reffes,dtrian;conformity,split_own_and_ghost,kwargs...)
Copy link

Copilot AI Dec 19, 2025

Choose a reason for hiding this comment

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

The constraint parameter is declared but not used. The function should call _add_distributed_constraint on the returned space before returning it, similar to how the general FESpace constructors handle constraints. This would enable constraint functionality like :zeromean for Raviart-Thomas spaces constructed from triangulations.

Copilot uses AI. Check for mistakes.
cell_reffes = map(local_views(dmodel)) do m
Fill(reffe,num_cells(m))
end
_common_fe_space_constructor(dmodel,cell_reffes,dtrian;conformity,split_own_and_ghost,kwargs...)
Copy link

Copilot AI Dec 19, 2025

Choose a reason for hiding this comment

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

The constraint parameter is declared but not used. The function should call _add_distributed_constraint on the returned space before returning it, similar to how the general FESpace constructors handle constraints. This would enable constraint functionality like :zeromean for Raviart-Thomas spaces constructed from triangulations.

Copilot uses AI. Check for mistakes.
@codecov
Copy link

codecov bot commented Dec 19, 2025

Codecov Report

❌ Patch coverage is 0% with 29 lines in your changes missing coverage. Please review.
✅ Project coverage is 0.00%. Comparing base (adb85be) to head (e12d74f).
⚠️ Report is 5 commits behind head on master.

Files with missing lines Patch % Lines
src/DivConformingFESpaces.jl 0.00% 29 Missing ⚠️
Additional details and impacted files
@@          Coverage Diff           @@
##           master    #188   +/-   ##
======================================
  Coverage    0.00%   0.00%           
======================================
  Files          15      15           
  Lines        3973    3998   +25     
======================================
- Misses       3973    3998   +25     
Flag Coverage Δ
mpi 0.00% <0.00%> (ø)
sequential 0.00% <0.00%> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 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.

@amartinhuertas amartinhuertas merged commit 5e913bc into master Dec 19, 2025
8 checks passed
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