-
Notifications
You must be signed in to change notification settings - Fork 24
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
Changes from all commits
2d41f86
fb85315
e02ed51
e12d74f
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 | ||||
|---|---|---|---|---|---|---|
| @@ -1,25 +1,78 @@ | ||||||
|
|
||||||
| function FESpaces.FESpace(model::DistributedDiscreteModel, | ||||||
| reffe::Tuple{RaviartThomas,Any,Any}; | ||||||
| conformity=nothing,kwargs...) | ||||||
| conformity=nothing, | ||||||
| split_own_and_ghost=false, | ||||||
| constraint=nothing, | ||||||
| kwargs...) | ||||||
|
|
||||||
| cell_reffes = map(local_views(model)) do m | ||||||
| basis,reffe_args,reffe_kwargs = reffe | ||||||
| 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...) | ||||||
| end | ||||||
|
|
||||||
| function FESpace(model::DistributedDiscreteModel, | ||||||
| reffe::GenericRefFE{RaviartThomas}; | ||||||
| conformity=nothing, kwargs...) | ||||||
| conformity=nothing, | ||||||
| split_own_and_ghost=false, | ||||||
| constraint=nothing, | ||||||
| kwargs...) | ||||||
| cell_reffes = map(local_views(model)) do m | ||||||
| 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...) | ||||||
|
||||||
| end | ||||||
|
|
||||||
| function _setup_dmodel_and_dtrian(_trian::DistributedTriangulation) | ||||||
| trian = add_ghost_cells(_trian) | ||||||
| models = map(local_views(trian)) do t | ||||||
| get_active_model(t) | ||||||
| end | ||||||
| GenericDistributedDiscreteModel(models, generate_cell_gids(trian)), trian | ||||||
| end | ||||||
|
||||||
| end | |
| 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.
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
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)) |
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.
| Original file line number | Diff line number | Diff line change | ||
|---|---|---|---|---|
|
|
@@ -59,12 +59,10 @@ function setup_p2_model() | |||
| Gridap.Geometry.UnstructuredDiscreteModel(grid) | ||||
| end | ||||
|
|
||||
| function f(model,reffe) | ||||
| function f(model,reffe,trian,das) | ||||
| V = FESpace(model,reffe,conformity=:Hdiv) | ||||
| U = TrialFESpace(V) | ||||
|
|
||||
| das = FullyAssembledRows() | ||||
| trian = Triangulation(das,model) | ||||
| degree = 2 | ||||
| dΩ = Measure(trian,degree) | ||||
| a(u,v) = ∫( u⋅v )*dΩ | ||||
|
|
@@ -82,6 +80,7 @@ function f(model,reffe) | |||
| 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.
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.