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 cell_nodes property to TensorMesh #333

Merged
merged 4 commits into from
Sep 18, 2023
Merged

Add cell_nodes property to TensorMesh #333

merged 4 commits into from
Sep 18, 2023

Conversation

santisoler
Copy link
Member

Add a new cell_nodes property to TensorMesh that mimics the one of TreeMesh returning the indices of the nodes that correspond to each cell in the mesh. Add tests for the new feature.

Add a new `cell_nodes` property to `TensorMesh` that mimics the one of
`TreeMesh` returning the indices of the nodes that correspond to each
cell in the mesh. Add tests for the new feature.
@codecov
Copy link

codecov bot commented Sep 18, 2023

Codecov Report

Merging #333 (1cf90d1) into main (58043b9) will increase coverage by 0.01%.
The diff coverage is 100.00%.

@@            Coverage Diff             @@
##             main     #333      +/-   ##
==========================================
+ Coverage   85.46%   85.47%   +0.01%     
==========================================
  Files          39       39              
  Lines       11990    12001      +11     
==========================================
+ Hits        10247    10258      +11     
  Misses       1743     1743              
Files Changed Coverage Δ
discretize/tensor_mesh.py 85.25% <100.00%> (+0.53%) ⬆️

@santisoler santisoler requested a review from jcapriot September 18, 2023 16:47
Copy link
Member

@jcapriot jcapriot left a comment

Choose a reason for hiding this comment

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

The implementation looks good!
The only thing would be that we should likely add a detail to the docstring (both here and in the TreeMesh while were at it) about the ordering of the nodes returned by the list, i.e.

2 -- 3
|    |
0 -- 1

For a 2D mesh.

Add a note illustrating the order in which the indices of the nodes for
each cell are returned.
@santisoler
Copy link
Member Author

@jcapriot I just added some notes about the order of the nodes for each cell. Let me know if you like it.

The implementation looks good!

I just copied and pasted your implementation from the BasePFSimulation, so congrats to you haha.

Copy link
Member

@jcapriot jcapriot left a comment

Choose a reason for hiding this comment

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

Thanks, looks good to me know!

@santisoler santisoler merged commit 8b52e27 into main Sep 18, 2023
14 checks passed
@santisoler santisoler deleted the tensor-cell-nodes branch September 18, 2023 19:06
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.

2 participants