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

Topology vroom 1 #753

Merged
merged 27 commits into from
Jul 6, 2023
Merged

Topology vroom 1 #753

merged 27 commits into from
Jul 6, 2023

Conversation

termi-official
Copy link
Member

@termi-official termi-official commented Jun 29, 2023

Modifies the topology construction algorithm and separates additional stuff like stencil and skeleton construction from the topology struct. I will add an interface for mixed-dimensional stuff in a subsequent PR, because I am not sure on the design. We can either add the mixed-dimensional stuff directly to the topology or to a different topology.

Resolves #617 mostly. We should be able to replace the sparse matrices for edges and faces with something more efficient, but I doubt that this will result in a significant runtime boost (however it will certainly be less memory-hungry).

@termi-official termi-official linked an issue Jun 29, 2023 that may be closed by this pull request
@termi-official
Copy link
Member Author

Still not super fast

c2104c0

julia> @btime ExclusiveTopology(generate_grid(Hexahedron, (80, 80, 80)));
  12.227 s (20234928 allocations: 2.90 GiB)

7207632

julia> @btime ExclusiveTopology(generate_grid(Hexahedron, (80, 80, 80)));
  11.129 s (46327260 allocations: 4.34 GiB)

@codecov-commenter
Copy link

codecov-commenter commented Jun 29, 2023

Codecov Report

Patch coverage: 88.33% and project coverage change: -1.05 ⚠️

Comparison is base (2b6f9b1) 92.31% compared to head (fdd21eb) 91.26%.

❗ Your organization is not using the GitHub App Integration. As a result you may experience degraded service beginning May 15th. Please install the Github App Integration for your organization. Read more.

Additional details and impacted files
@@            Coverage Diff             @@
##           master     #753      +/-   ##
==========================================
- Coverage   92.31%   91.26%   -1.05%     
==========================================
  Files          30       32       +2     
  Lines        4527     4650     +123     
==========================================
+ Hits         4179     4244      +65     
- Misses        348      406      +58     
Impacted Files Coverage Δ
src/Export/VTK.jl 91.66% <ø> (-3.17%) ⬇️
src/Ferrite.jl 100.00% <ø> (ø)
src/PointEval/point_values.jl 97.36% <ø> (ø)
src/deprecations.jl 51.31% <0.00%> (-0.69%) ⬇️
src/Grid/grid.jl 92.08% <70.00%> (-0.66%) ⬇️
src/iterators.jl 84.37% <75.00%> (-3.96%) ⬇️
src/FEValues/face_values.jl 98.13% <77.77%> (-1.87%) ⬇️
src/Grid/topology.jl 79.52% <79.52%> (ø)
src/Dofs/DofHandler.jl 93.00% <92.77%> (+0.55%) ⬆️
src/interpolations.jl 96.53% <93.18%> (-1.36%) ⬇️
... and 10 more

☔ View full report in Codecov by Sentry.
📢 Do you have feedback about the report comment? Let us know in this issue.

src/Grid/topology.jl Show resolved Hide resolved
src/Grid/topology.jl Show resolved Hide resolved
src/Grid/topology.jl Outdated Show resolved Hide resolved
src/Grid/topology.jl Outdated Show resolved Hide resolved
src/Grid/topology.jl Outdated Show resolved Hide resolved
src/Grid/topology.jl Outdated Show resolved Hide resolved
src/Grid/topology.jl Outdated Show resolved Hide resolved
src/exports.jl Outdated Show resolved Hide resolved
@termi-official
Copy link
Member Author

termi-official commented Jul 3, 2023

Still slow and unfortunately I introduced quite a bit of fluctuation in runtime.

julia> @btime ExclusiveTopology(generate_grid(Hexahedron, (80, 80, 80)));
  10.042 s (33015261 allocations: 3.75 GiB)

julia> @btime ExclusiveTopology(generate_grid(Hexahedron, (80, 80, 80)));
  8.195 s (33015261 allocations: 3.75 GiB)

@termi-official
Copy link
Member Author

Since this topology is specific to some AMR algorithms I will try to add a different topology struct which will hopefully be faster to construct in the future.

@koehlerson koehlerson merged commit 8457cd0 into master Jul 6, 2023
6 checks passed
@koehlerson koehlerson deleted the do/topology-redesign branch July 6, 2023 11:01
@fredrikekre
Copy link
Member

Clearer squashed commit message would be nice the next time :)

@koehlerson
Copy link
Member

Whoopsie, will do next time!

AbdAlazezAhmed pushed a commit to AbdAlazezAhmed/Ferrite.jl that referenced this pull request Jul 11, 2023
* Separate topology from grid.

* Split up topology.

* Remove todo.

* Enhanced type stability.

* Stop topology from overflowing my terminal buffer.

* Optimize algorithm for topology construction by eliminating allocations.

* Update variable names.

* Update variable names 2.

* Derp.

* Fix oopsie.

* Matrices :)

* Replace last dict in topology with vector, too.

* Fix bug.

* Update exports.

* Add note about broken mixed-dimensional queries.

* Update field docs.

* Update doc reference

* Lazy face skeleton.

* Update src/Grid/topology.jl

Co-authored-by: Maximilian Köhler <[email protected]>

* More tweaks.

* Rename as requested.

* Oopsie

* Rename in tests.

* Missing dispathc.

* asdf

* Remove algebraic stuff on EntityNeighborhood.

---------

Co-authored-by: Maximilian Köhler <[email protected]>
@KnutAM KnutAM mentioned this pull request May 18, 2024
6 tasks
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.

ExclusiveTopology topology.cell_neighbor is inclusive. Topology construction is slow
4 participants