-
Notifications
You must be signed in to change notification settings - Fork 188
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 support for tetrahedral connectivity and use scipy to generate it #6303
Add support for tetrahedral connectivity and use scipy to generate it #6303
Conversation
9c6c9eb
to
7a21ee1
Compare
|
||
|
||
@click.command( | ||
name="generate-tetrahedral-connectivity", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
(optional) Maybe just name triangulate
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't feel too strongly, I used this so it matches up with GenerateXdmf use-tetrahedral-connectivity
but I agree it's very long
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Up to you
if not subfile_name.endswith(".vol"): | ||
subfile_name += ".vol" | ||
|
||
for h5file, filename in h5files: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You can relatively easily show a progress bar here so the script doesn't appear "frozen" without any indication that it is doing anything. Here's how:
import rich.progress
progress = rich.progress.Progress(
rich.progress.TextColumn("[progress.description]{task.description}"),
rich.progress.BarColumn(),
rich.progress.MofNCompleteColumn(),
rich.progress.TimeRemainingColumn(),
disable=(len(h5files) == 1),
)
task_id = progress.add_task("Processing files", total=len(h5files))
with progress:
for h5file, filename in progress.track(h5files, task_id=task_id):
# ...
progress.update(task_id, advance=1) # don't remember if this is needed
Docs are here: https://rich.readthedocs.io/en/stable/progress.html
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
(optional) showing a progress bar (over timesteps rather than files as suggested before) instead of the log messages would be nicer
coordinates: str = "InertialCoordinates", | ||
delete_tetrahedral_connectivity: bool = False, | ||
): | ||
"""Generate tetrahedral connectivity using scipy.spatial.Delaunay |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Question: how does this handle shared grid points on LGL element boundaries? The tetrahedra connecting these points would be degenerate.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I haven't read the paper that describes qhull, but as far as I can tell it works fine and doesn't produce any double connectivity.
7a21ee1
to
459d56e
Compare
LGTM please squash. |
459d56e
to
056ad3d
Compare
Proposed changes
This provides an easy way to fill gaps in for domains with Gauss points. There are several optimizations possible to make it run faster if needed.
Upgrade instructions
Code review checklist
make doc
to generate the documentation locally intoBUILD_DIR/docs/html
.Then open
index.html
.code review guide.
bugfix
ornew feature
if appropriate.Further comments