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

Enhance the fracture generation feature of mesh_doctor #2793

Merged
merged 32 commits into from
Dec 9, 2023

Conversation

TotoGaz
Copy link
Contributor

@TotoGaz TotoGaz commented Nov 2, 2023

  • Complete rewriting of the fracture generation algorithm. There should be not limitation anymore, and it supports VTK_POLYHEDRON thanks to @IsaacJu-debug 's investigations.
  • Efforts were paid to validate the code using mypy and type hints. Not perfect yet, but still a good improvement.

@TotoGaz TotoGaz marked this pull request as ready for review November 30, 2023 01:17
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Note that this is a complete rewriting of the algorithm; therefore it's not particularly relevant to compare the two files during the code review process.

@TotoGaz TotoGaz linked an issue Nov 30, 2023 that may be closed by this pull request
collocated_nodes: numpy.ndarray = vtk_to_numpy(fracture_mesh.GetPointData().GetArray("collocated_nodes"))
if len(collocated_nodes.shape) == 1:
collocated_nodes: numpy.ndarray = collocated_nodes.reshape((collocated_nodes.shape[0], 1))
return tuple(map(lambda bucket: tuple(sorted(filter(lambda i: i != -1, bucket))), collocated_nodes))
Copy link
Contributor

Choose a reason for hiding this comment

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

This is completely fine (and maybe a bit faster?), but I find list comprehension+slicing to be much more readable/pythonic than lambdas+maps+filters:

tuple([tuple(sorted(bucket[bucket != -1])) for bucket in collected_nodes])

Copy link
Contributor Author

Choose a reason for hiding this comment

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

You are right, it's far better!

Copy link
Contributor

@cssherman cssherman 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 to me

@TotoGaz TotoGaz added ci: run CUDA builds Allows to triggers (costly) CUDA jobs flag: no rebaseline Does not require rebaseline labels Dec 8, 2023
@TotoGaz TotoGaz merged commit fe16de2 into develop Dec 9, 2023
@TotoGaz TotoGaz deleted the TotoGaz/feature/meshDoctorFracture branch December 9, 2023 02:11
ouassimkh pushed a commit that referenced this pull request Feb 16, 2024
- Complete rewriting of the fracture generation algorithm. There should be not limitation anymore, and it supports `VTK_POLYHEDRON` thanks to @IsaacJu-debug 's investigations.
- Efforts were paid to validate the code using `mypy` and type hints. Not perfect yet, but still a good improvement.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ci: run CUDA builds Allows to triggers (costly) CUDA jobs flag: no rebaseline Does not require rebaseline
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Improve the fracture generation in mesh_doctor
3 participants