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

Add new component Regular Space #437

Merged
merged 21 commits into from
Oct 26, 2023
Merged

Add new component Regular Space #437

merged 21 commits into from
Oct 26, 2023

Conversation

Zhouyuan-Chen
Copy link
Collaborator

@Zhouyuan-Chen Zhouyuan-Chen commented Oct 11, 2023

Just a dummy skeleton now.

@Zhouyuan-Chen Zhouyuan-Chen linked an issue Oct 11, 2023 that may be closed by this pull request
10 tasks
@codecov
Copy link

codecov bot commented Oct 11, 2023

Codecov Report

Merging #437 (89b8c9c) into main (d13e71b) will increase coverage by 0.74%.
Report is 65 commits behind head on main.
The diff coverage is 98.39%.

@@            Coverage Diff             @@
##             main     #437      +/-   ##
==========================================
+ Coverage   84.63%   85.37%   +0.74%     
==========================================
  Files         160      187      +27     
  Lines        4516     5299     +783     
==========================================
+ Hits         3822     4524     +702     
- Misses        694      775      +81     
Flag Coverage Δ
wildmeshing 85.37% <98.39%> (+0.74%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Files Coverage Δ
...components/regular_space/internal/RegularSpace.cpp 100.00% <100.00%> (ø)
...components/regular_space/internal/RegularSpace.hpp 100.00% <100.00%> (ø)
src/wmtk/invariants/TodoInvariant.cpp 100.00% <100.00%> (ø)
src/wmtk/operations/tri_mesh/EdgeSplitWithTag.hpp 100.00% <100.00%> (ø)
src/wmtk/operations/tri_mesh/FaceSplit.hpp 100.00% <100.00%> (ø)
...c/wmtk/operations/tri_mesh/FaceSplitAtMidPoint.hpp 100.00% <100.00%> (ø)
src/wmtk/operations/tri_mesh/FaceSplitWithTag.hpp 100.00% <100.00%> (ø)
src/wmtk/operations/tri_mesh/EdgeSplitWithTag.cpp 98.11% <98.11%> (ø)
...c/wmtk/operations/tri_mesh/FaceSplitAtMidPoint.cpp 96.42% <96.42%> (ø)
src/wmtk/operations/tri_mesh/FaceSplitWithTag.cpp 98.03% <98.03%> (ø)
... and 1 more

... and 61 files with indirect coverage changes

@Zhouyuan-Chen
Copy link
Collaborator Author

I wrote the basic operations, SplitFace, SplitFaceWithTag and SplitEdgeWithTag. I would rename the last two classes as SplitFaceWithTodoList and SplitEdgeWithTodoList.

@Zhouyuan-Chen
Copy link
Collaborator Author

I found an interesting "bug" in the DEBUG_TriMesh. That is when you collapse an edge, it seems the maximum of the indices will not be modified. As a result, when you only have 4 vertices, you still have a vertex with idx = 4.

@Zhouyuan-Chen
Copy link
Collaborator Author

I will first test the 1d case since the 2d case gets involved in the split result's direction. Something should be more clear about the result of the split operation in the document.

@Zhouyuan-Chen Zhouyuan-Chen self-assigned this Oct 16, 2023
@Zhouyuan-Chen
Copy link
Collaborator Author

Zhouyuan-Chen commented Oct 16, 2023

I added the RegularSpace component API.

Should be noted that this component DO NOT build the offset. Just make sure each different simplexity will not directly touch with the other.

After using the RegularSpace function, one can directly get the offset by splitting every edge incident the input simplexity (just invoke the EdgeSplitWithTag and pass it to the scheduler, then all set).

Because the design of the Option is a little messy, I will upload a small document under this component folder.

@daniel-zint
Copy link
Contributor

I found an interesting "bug" in the DEBUG_TriMesh. That is when you collapse an edge, it seems the maximum of the indices will not be modified. As a result, when you only have 4 vertices, you still have a vertex with idx = 4.

This is not a bug. The mesh class does not yet have a garbage collection.

Copy link
Contributor

@daniel-zint daniel-zint left a comment

Choose a reason for hiding this comment

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

The approach is definitely good. The code requires quite some clean-up though.

components/wmtk_components/regular_space/regular_space.cpp Outdated Show resolved Hide resolved
tests/components/test_component_regular_space.cpp Outdated Show resolved Hide resolved
tests/components/test_component_regular_space.cpp Outdated Show resolved Hide resolved
tests/components/test_component_regular_space.cpp Outdated Show resolved Hide resolved
tests/test_2d_operations.cpp Outdated Show resolved Hide resolved
tests/test_2d_operations.cpp Outdated Show resolved Hide resolved
@Zhouyuan-Chen
Copy link
Collaborator Author

I still need to add the last few tests. Will be done soon.

@Zhouyuan-Chen Zhouyuan-Chen marked this pull request as ready for review October 18, 2023 23:01
@Zhouyuan-Chen
Copy link
Collaborator Author

This component is done, wait to be reviewed

Copy link
Contributor

@daniel-zint daniel-zint left a comment

Choose a reason for hiding this comment

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

Looks good. Most of my comments are on the tests. There are a few untested scenarios that should be covered.
Additionally, try to increase code coverage as much as possible.

tests/components/test_component_regular_space.cpp Outdated Show resolved Hide resolved
tests/components/test_component_regular_space.cpp Outdated Show resolved Hide resolved
tests/components/test_component_regular_space.cpp Outdated Show resolved Hide resolved
tests/components/test_component_regular_space.cpp Outdated Show resolved Hide resolved
src/wmtk/operations/tri_mesh/FaceSplitWithTag.cpp Outdated Show resolved Hide resolved
tests/test_2d_operations.cpp Outdated Show resolved Hide resolved
tests/test_2d_operations.cpp Outdated Show resolved Hide resolved
tests/components/test_component_regular_space.cpp Outdated Show resolved Hide resolved
src/wmtk/operations/tri_mesh/FaceSplitAtMidPoint.hpp Outdated Show resolved Hide resolved
src/wmtk/operations/tri_mesh/FaceSplitAtMidPoint.hpp Outdated Show resolved Hide resolved
@Zhouyuan-Chen
Copy link
Collaborator Author

I modified the code, but some codes I can't cover by tests, seems those codes are impossible to execute😅. however, for the safety of the code, those code is needed.

Copy link
Contributor

@daniel-zint daniel-zint left a comment

Choose a reason for hiding this comment

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

Lgtm. Just resolve my comments from the previous review.

wmtk::operations::tri_mesh::FaceSplitAtMidPoint op1(m, f1, settings);
wmtk::operations::tri_mesh::FaceSplitAtMidPoint op2(m, f2, settings);
CHECK(op0());
auto handle = m.get_attribute_handle<double>(std::string("position"), PV);
Copy link
Contributor

Choose a reason for hiding this comment

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

you are still not using the handle and accessor

@Zhouyuan-Chen
Copy link
Collaborator Author

Just remove the variable never used in the test file

Copy link
Contributor

@daniel-zint daniel-zint left a comment

Choose a reason for hiding this comment

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

Good for now. It's ready to be merged.

@Zhouyuan-Chen Zhouyuan-Chen merged commit 803d3c5 into main Oct 26, 2023
@Zhouyuan-Chen Zhouyuan-Chen deleted the zhouyuan/regular_space branch October 26, 2023 00:16
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.

add a new component -- Regular Space
2 participants