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

transfer solution optimization #68

Merged
merged 4 commits into from Mar 13, 2023
Merged

Conversation

koehlerson
Copy link
Member

  • introduce function barrier to remove type instability in transfer_solution associated with ip_field::Interpolation
  • make FerriteViz.postprocess type stable
  • remove unnecessary type annotations
Commit transfer_solution solutionplot
master 4.277s 0.663 GiB 53.078s 30.38GB
pr 2.913s 0.439 GiB 51.152s 29.94 GB

The internal "kernel" for the transfer _transfer_solution is close to type grounded

Copy link
Member

@termi-official termi-official left a comment

Choose a reason for hiding this comment

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

LGTM otherwise.

src/utils.jl Outdated
@@ -300,7 +300,7 @@ midpoint(cell::Ferrite.AbstractCell{3,N,6}, points) where N = Point3f(0.5 * (poi
function postprocess(node_values)
dim = length(node_values)
if dim == 1
return node_values
return node_values[1]
Copy link
Member

Choose a reason for hiding this comment

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

Can you quickly leave a comment why this is here (for future generations to not delete it :))

Copy link
Member Author

Choose a reason for hiding this comment

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

here or in the source code?
The function was inherently type unstable because if the dimension of the input is 1 it returned a vector of length 1 and in all other cases it reduced the vector entries to a scalar value

Copy link
Member

Choose a reason for hiding this comment

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

In the source code (e.g. for contributors seeing this).

@koehlerson koehlerson merged commit ff23bc6 into master Mar 13, 2023
5 checks passed
@koehlerson koehlerson deleted the mk/transfer_solution_optimization branch March 13, 2023 19:13
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.

None yet

2 participants