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

Adding support for quadrature in Float32 precision #840

Merged
merged 8 commits into from
Oct 22, 2022

Conversation

kishore-nori
Copy link
Collaborator

@kishore-nori kishore-nori commented Oct 19, 2022

Hi @amartinhuertas and @fverdugo, I have added support to include a keyword argument T into Measure, CellQuadrature and Quadrature, to perform numerical integration in the desired floating-point precision, in particular, Float32 usage. Tests have been added to for checks with Float32 option for all the effected modules.

This partially resolves the issue #789 for the quadrature part. The setup of FESpace at places seems hard-coded in Float64, and the floating-point type is not being taken from model and reffe constructed using Float32 precisions, which I leave for later.

This doesn't break the high-level API, as the optional kwarg T defaults to Float64. The usage is as follows:

= Measure(Ω,2,T=Float32)
quad_strang = Quadrature(TET,2,T=Float32)

Would be happy to know to comments and suggestions for changes and improvements.

@codecov-commenter
Copy link

codecov-commenter commented Oct 19, 2022

Codecov Report

Merging #840 (23c3aeb) into master (a8b490d) will increase coverage by 0.00%.
The diff coverage is 96.22%.

@@           Coverage Diff           @@
##           master     #840   +/-   ##
=======================================
  Coverage   88.32%   88.33%           
=======================================
  Files         164      164           
  Lines       19108    19113    +5     
=======================================
+ Hits        16878    16884    +6     
+ Misses       2230     2229    -1     
Impacted Files Coverage Δ
src/CellData/CellQuadratures.jl 79.78% <84.61%> (ø)
src/CellData/DomainContributions.jl 95.31% <100.00%> (ø)
src/ReferenceFEs/DuffyQuadratures.jl 98.71% <100.00%> (+0.05%) ⬆️
src/ReferenceFEs/Quadratures.jl 71.73% <100.00%> (ø)
src/ReferenceFEs/StrangQuadratures.jl 97.89% <100.00%> (ø)
src/ReferenceFEs/TensorProductQuadratures.jl 100.00% <100.00%> (ø)
src/ODEs/TransientFETools/TransientFESolutions.jl 94.11% <0.00%> (+0.24%) ⬆️
src/FESpaces/FESpacesWithConstantFixed.jl 81.60% <0.00%> (+1.14%) ⬆️

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

@amartinhuertas
Copy link
Member

@kishore-nori ! Thanks for your work. Can you please add an entry to the NEWS.md file?

@kishore-nori
Copy link
Collaborator Author

Thank you for checking Alberto. Done! (sorry forgot [skip ci]).

@amartinhuertas amartinhuertas self-requested a review October 20, 2022 09:26
@amartinhuertas
Copy link
Member

@fverdugo ... do you want to comment on this PR? Thanks!

@amartinhuertas amartinhuertas merged commit e6d3d5d into master Oct 22, 2022
@kishore-nori kishore-nori deleted the float32-prec branch October 24, 2022 05:38
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.

3 participants