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 return type of evaluate_at_grid_nodes #1044

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

termi-official
Copy link
Member

No description provided.

@termi-official termi-official added the awaiting review PR is finished from the authors POV, waiting for feedback label Aug 7, 2024
Copy link

codecov bot commented Aug 7, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 93.69%. Comparing base (fbff852) to head (49ee105).

Additional details and impacted files
@@           Coverage Diff           @@
##           master    #1044   +/-   ##
=======================================
  Coverage   93.69%   93.69%           
=======================================
  Files          39       39           
  Lines        6013     6013           
=======================================
  Hits         5634     5634           
  Misses        379      379           

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

Copy link
Member

@KnutAM KnutAM left a comment

Choose a reason for hiding this comment

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

LGTM

@@ -938,10 +938,10 @@ function _evaluate_at_grid_nodes(dh::DofHandler, u::AbstractVector{T}, fieldname
# VTK output of solution field (or L2 projected scalar data)
n_c = n_components(ip)
vtk_dim = n_c == 2 ? 3 : n_c # VTK wants vectors padded to 3D
data = fill(NaN * zero(T), vtk_dim, getnnodes(get_grid(dh)))
data = fill(T(NaN) * zero(T), vtk_dim, getnnodes(get_grid(dh)))
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
data = fill(T(NaN) * zero(T), vtk_dim, getnnodes(get_grid(dh)))
data = fill(T(NaN), vtk_dim, getnnodes(get_grid(dh)))

Copy link
Member Author

Choose a reason for hiding this comment

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

Should I fix this consistently in this PR? Because other places use this.

Copy link
Member

Choose a reason for hiding this comment

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

Could do if you want to :)
Just noticed that this was not required after the changes here.
But it could depend on the resolution of the Int discussion below...

@@ -649,7 +649,7 @@ function test_vtk_export()
sdh_tri = SubDofHandler(dh, Set(2))
add!(sdh_tri, :u, ip_tri)
close!(dh)
u = collect(1:ndofs(dh))
u = collect(1.:ndofs(dh))
Copy link
Member

Choose a reason for hiding this comment

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

So Int types won't work after this? Perhaps you can use float(T) when computing the type.

Copy link
Member Author

Choose a reason for hiding this comment

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

I would argue that integer types should not work here, because we assume that the solutions are in some continuous space.

Copy link
Member Author

Choose a reason for hiding this comment

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

How to proceed?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
awaiting review PR is finished from the authors POV, waiting for feedback
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants