trixi-framework / HOHQMesh

High Order Hex-Quad Mesh (HOHQMesh) package to automatically generate all-quadrilateral meshes with high order boundary information.
https://trixi-framework.github.io/HOHQMesh
Other
45 stars 8 forks source link

Topography resolution #33

Closed DavidAKopriva closed 2 years ago

DavidAKopriva commented 2 years ago

This pull request has the option of automatic curvature based refinement due to bottom topography. Include "sizing = ON" to the topography block to turn on. There is a simple test included, but more general testing is needed. It is also really expensive due to finite difference approximations to the topography computed from the elevation function. Speedup is needed.

codecov[bot] commented 2 years ago

Codecov Report

Merging #33 (e06a876) into main (6c43412) will increase coverage by 0.66%. The diff coverage is 95.32%.

@@            Coverage Diff             @@
##             main      #33      +/-   ##
==========================================
+ Coverage   66.85%   67.52%   +0.66%     
==========================================
  Files          66       68       +2     
  Lines        9948    10195     +247     
==========================================
+ Hits         6651     6884     +233     
- Misses       3297     3311      +14     
Flag Coverage Δ
unittests 67.52% <95.32%> (+0.66%) :arrow_up:

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

Impacted Files Coverage Δ
Source/IO/ControlFileReader.f90 83.12% <ø> (ø)
Source/Project/Model/SMModel.f90 75.45% <77.77%> (-0.01%) :arrow_down:
Source/Surfaces/DataFileTopographyClass.f90 77.55% <84.61%> (-10.92%) :arrow_down:
Source/Project/MeshProject.f90 72.82% <85.71%> (+0.46%) :arrow_up:
Source/Surfaces/BiCubicClass.f90 98.57% <98.57%> (ø)
Source/Project/Sizer/Sizer.f90 77.05% <100.00%> (+1.08%) :arrow_up:
Source/Surfaces/GaussianCurvature.f90 100.00% <100.00%> (ø)
Source/Surfaces/SMTopographyClass.f90 60.97% <100.00%> (+33.70%) :arrow_up:
Source/Testing/CurveTests.f90 100.00% <100.00%> (ø)
Source/Testing/MeshingTests.f90 88.42% <100.00%> (+0.19%) :arrow_up:
... and 1 more

Continue to review full report at Codecov.

Legend - Click here to learn more Δ = absolute <relative> (impact), ø = not affected, ? = missing data Powered by Codecov. Last update 6c43412...e06a876. Read the comment docs.

fluidnumerics-joe commented 2 years ago

It took a little bit to catch up with the conversation here. The code looks good, and from what I can tell this feature is enabled in the topography block using sizing = ON. I'd say the only bit missing here is to update relevant sections of documentation that have reference to the TOPOGRAPHY block:

I'll add what I think is relevant to these docs today.

DavidAKopriva commented 2 years ago

We also have a branch off of this one that is almost done that factors out the biCubic interpolation and uses it to compute the gaussian curvature. That branch is almost done. I'm getting the test example files prepared, and I have to edit the makefile. The branch is "WithBiCubics".

DavidAKopriva commented 2 years ago

My thought is to merge "WithBiCubics" into the topography branch, then make sure everything is OK before merging into main.

DavidAKopriva commented 2 years ago

SeaMountWSizing

This will be added to the documentation.

andrewwinters5000 commented 2 years ago

I think this is ready to merge into main. But first, I cannot build the docs locally. Can someone check that the LaTeX displays properly? Also, I cannot workout where the new ApproximationOfGaussianCurvature.md is included in the docs

DavidAKopriva commented 2 years ago

I think the thing to do with the new doc is to add it to the list in the assumptions-and-algorithms.md with a link there to the document. I can add that today. As for rendering, all I can say is it does not render in two markdown editors that I have, but does render fine in visual studio with the plugin. I don't know how to test that on GitHub.

DavidAKopriva commented 2 years ago

I guess the thing I don't know is what the url is for the documents folder on GitHub. Can'tfind any examples so far in what we have...

sloede commented 2 years ago

As for rendering, all I can say is it does not render in two markdown editors that I have, but does render fine in visual studio with the plugin. I don't know how to test that on GitHub.

I often use grip, which opens a local web server and tries to mimic what a README would look like when rendered on GH. You can install it on macOS using brew install grip and then run it with grip myfile.md.

DavidAKopriva commented 2 years ago

Thanks. I'll give it a try. Also, I guess the URL is just (https://trixi-framework.github.io/HOHQMesh/NameOfFile/), which is what the other pages seem to have in the URL bar.

DavidAKopriva commented 2 years ago

Oh Well, grip didn't work for me. Just sat there doing nothing after printing a bunch of notices, the last of which was Running on... Press CTRL+C to quit, then nothing. That did quit something.

andrewwinters5000 commented 2 years ago

Oh Well, grip didn't work for me. Just sat there doing nothing after printing a bunch of notices, the last of which was Running on... Press CTRL+C to quit, then nothing. That did quit something.

For me it opens the preview if I run, e.g., grip -b index.md (this will automatically open a browser tab)

andrewwinters5000 commented 2 years ago

@DavidAKopriva @fluidnumerics-joe Now that I verified that the docs are okay and all built correctly, should this merge to main?

DavidAKopriva commented 2 years ago

Sure. This morning I added code to look at the radius of curvature along the gradient direction to give some refinement if the gaussian curvature is zero. It still passes the tests (the old ones, no new test for this explicitly, yet), but i want to play with it a little bit more. Does that sound OK? Or we can wait to include it in the next round.

DavidAKopriva commented 2 years ago

ShelfWithRefinementr.pdf

Here's what it does now. Without the "fix" there is no refinement due to topography.

andrewwinters5000 commented 2 years ago

This morning I added code to look at the radius of curvature along the gradient direction to give some refinement if the gaussian curvature is zero. It still passes the tests (the old ones, no new test for this explicitly, yet), but i want to play with it a little bit more. Does that sound OK? Or we can wait to include it in the next round.

That sounds good, but I think we can open a new PR for this topography improvement. This PR already adds quite a bit, so I think we can declare it mergable and then make it better.

DavidAKopriva commented 2 years ago

OK, I just opened the new PR. I am OK with whichever way you want to go.

andrewwinters5000 commented 2 years ago

Okay, I will merge this now