Skip to content
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

Fix AttachDirichletMap type stability #1050

Merged
merged 4 commits into from
Nov 14, 2024
Merged

Conversation

Antoinemarteau
Copy link
Contributor

Forcing copying c values into the cache container d when doing d <- 0Ab +1*c for type stability (in case b is complex but c is real).

Fixes #974

Added the MWE in test/GridapTests/issue_974.jl.

if `mat` and `vec` are real valued and `vals` is complex valued, we still want
to force the `copyto!(vec_with_bcs,vec)` to have a complex valued
return type

fixes gridap#974
The (0,1) AttachDirichletMap is just (A,b,c) -> c .

So we can avoid `mul!` in this case (but keep the `copyto!` for type
stability when c is real but b and d=cache[2] are complex).

I believe this is safe regarding type stability since
`return_cache(::AttachDirichletMap)` uses an eager `Base.*` to create
the `cache`, it does not rely on this evaluate.
Copy link

codecov bot commented Nov 11, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 88.87%. Comparing base (21c4751) to head (6462fd0).
Report is 5 commits behind head on master.

Additional details and impacted files
@@           Coverage Diff           @@
##           master    #1050   +/-   ##
=======================================
  Coverage   88.87%   88.87%           
=======================================
  Files         195      195           
  Lines       23572    23575    +3     
=======================================
+ Hits        20949    20952    +3     
  Misses       2623     2623           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@Antoinemarteau Antoinemarteau marked this pull request as ready for review November 11, 2024 01:09
@JordiManyer JordiManyer added the bug Something isn't working label Nov 14, 2024
@JordiManyer JordiManyer self-requested a review November 14, 2024 22:10
Copy link
Member

@JordiManyer JordiManyer left a comment

Choose a reason for hiding this comment

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

All looks good! Thank you for the amazing work!

@JordiManyer JordiManyer merged commit fd2a682 into gridap:master Nov 14, 2024
11 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

MultiFieldFESpace with complex numbers
2 participants