Skip to content

Conversation

@amartinhuertas
Copy link
Member

Do not merge yet.
Requires Gridap's PR 1117 to be released.
Related to issue #184

Copy link

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 support for creating TrialFESpace with DistributedCellField objects as boundary/initial data. The key changes include:

  • Added two new TrialFESpace constructor overloads that accept DistributedCellField arguments
  • Added a new interpolate_dirichlet! method to handle DistributedCellField interpolation
  • Refactored test code to verify interpolation works with both Julia functions and DistributedCellField objects

Reviewed Changes

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

File Description
src/FESpaces.jl Added new overloads for TrialFESpace and interpolate_dirichlet! to support DistributedCellField arguments
test/FESpacesTests.jl Refactored interpolation tests into a helper function and added tests for DistributedCellField interpolation
NEWS.md Documented the new feature in the changelog

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

Comment on lines +424 to +431
function FESpaces.TrialFESpace(cf::DistributedCellField,f::DistributedSingleFieldFESpace)
spaces = map(local_views(f),local_views(cf)) do s, field
TrialFESpace(s,field)
end
DistributedSingleFieldFESpace(spaces,f.gids,f.trian,f.vector_type,f.metadata)
end


Copy link

Copilot AI Nov 2, 2025

Choose a reason for hiding this comment

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

[nitpick] The two TrialFESpace overloads at lines 417-422 and 424-429 have identical implementations. The second overload (where DistributedCellField is the first argument) simply calls the same underlying Gridap TrialFESpace(s,field) function. Consider consolidating these into a single implementation or adding a comment explaining why both argument orders are necessary.

Suggested change
function FESpaces.TrialFESpace(cf::DistributedCellField,f::DistributedSingleFieldFESpace)
spaces = map(local_views(f),local_views(cf)) do s, field
TrialFESpace(s,field)
end
DistributedSingleFieldFESpace(spaces,f.gids,f.trian,f.vector_type,f.metadata)
end

Copilot uses AI. Check for mistakes.
uh4 = FEFunction(U,free_values,dirichlet_values)
eh4 = u - uh4

= Measure(Ω,3)
Copy link

Copilot AI Nov 2, 2025

Choose a reason for hiding this comment

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

The variable is redefined inside _interpolation_tests at line 131, shadowing the outer defined at line 88. While this works, it's confusing and the outer at line 88 appears to be unused. Consider removing the outer definition or using a different variable name in the inner function.

Copilot uses AI. Check for mistakes.
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
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