-
Notifications
You must be signed in to change notification settings - Fork 23
Specialized rt constructor for dist trian #188
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
Specialized rt constructor for dist trian #188
Conversation
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.
…specialized_rt_constructor_for_dist_trian
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.
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...) |
Copilot
AI
Dec 19, 2025
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.
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.
| 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...) |
Copilot
AI
Dec 19, 2025
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.
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.
| get_active_model(t) | ||
| end | ||
| GenericDistributedDiscreteModel(models, generate_cell_gids(trian)), trian | ||
| end |
Copilot
AI
Dec 19, 2025
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.
There is trailing whitespace at the end of this line. Remove the trailing whitespace for consistency with code style.
| end | |
| end |
| kwargs...) | ||
| dmodel, dtrian = _setup_dmodel_and_dtrian(_trian) | ||
| cell_reffes = map(local_views(dmodel)) do m | ||
| Fill(reffe,num_cells(m)) |
Copilot
AI
Dec 19, 2025
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.
There is inconsistent indentation here - an extra space is present at the beginning of this line. Remove it for consistency with the surrounding code.
| Fill(reffe,num_cells(m)) | |
| Fill(reffe,num_cells(m)) |
| f(model,reffe,trian,das) | ||
| f(trian,reffe,trian,das) | ||
| f(Triangulation(model),reffe,trian,das) | ||
|
|
Copilot
AI
Dec 19, 2025
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.
This line contains only whitespace. Remove the trailing whitespace for consistency with code style.
| dc2 = dc.contribs.items[2] | ||
| c1 = Gridap.CellData.get_contribution(dc1,t1) | ||
| c2 = Gridap.CellData.get_contribution(dc2,t2) | ||
|
|
Copilot
AI
Dec 19, 2025
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.
This line contains only whitespace. Remove the trailing whitespace for consistency with code style.
| 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...) |
Copilot
AI
Dec 19, 2025
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.
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.
| 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...) |
Copilot
AI
Dec 19, 2025
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.
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.
Codecov Report❌ Patch coverage is
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
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
This PR adds to GridapDistributed a missing specialized FESpace constructor for triangulations and RT spaces