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

P4estMesh constructor for HOHQMesh Abaqus-type file #945

Merged
merged 46 commits into from
Nov 5, 2021

Conversation

andrewwinters5000
Copy link
Member

@andrewwinters5000 andrewwinters5000 commented Oct 26, 2021

This adds the capability to parse a HOHQMesh file, its high-order boundary information and names to set boundary conditions into the P4estMesh. Related to the new HOHQMesh file type developed in this PR on the HOHQMesh generator.

  • 2D implementation and test
  • update mesh docs
  • 3D implementation and test (possibly for a different PR because this will require some new 3D transfinite interpolation routines)
  • Wait until HOHQMesh PR is merged and released
  • Wait until new HOHQMesh.jl version with Abaqus output is released

@codecov
Copy link

codecov bot commented Oct 26, 2021

Codecov Report

Merging #945 (8d9c7ba) into main (e7fb633) will increase coverage by 0.08%.
The diff coverage is 99.64%.

Impacted file tree graph

@@            Coverage Diff             @@
##             main     #945      +/-   ##
==========================================
+ Coverage   93.71%   93.79%   +0.08%     
==========================================
  Files         281      284       +3     
  Lines       20376    20615     +239     
==========================================
+ Hits        19094    19335     +241     
+ Misses       1282     1280       -2     
Flag Coverage Δ
unittests 93.79% <99.64%> (+0.08%) ⬆️

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

Impacted Files Coverage Δ
src/auxiliary/p4est.jl 75.86% <ø> (ø)
src/meshes/mesh_io.jl 95.83% <ø> (ø)
src/solvers/dgsem_p4est/containers.jl 93.38% <ø> (ø)
src/solvers/dgsem_p4est/containers_2d.jl 94.03% <ø> (ø)
src/solvers/dgsem_p4est/dg.jl 93.75% <ø> (ø)
...xamples/p4est_2d_dgsem/elixir_euler_wall_bc_amr.jl 90.00% <90.00%> (ø)
src/meshes/face_interpolant.jl 100.00% <100.00%> (ø)
src/meshes/p4est_mesh.jl 98.76% <100.00%> (+0.37%) ⬆️
src/meshes/transfinite_mappings_3d.jl 100.00% <100.00%> (ø)
src/meshes/unstructured_mesh.jl 98.23% <100.00%> (ø)
... and 5 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 e7fb633...8d9c7ba. Read the comment docs.

Copy link
Member

@efaulhaber efaulhaber left a comment

Choose a reason for hiding this comment

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

Well done! I'm looking forward to seeing some crazy 3D meshes.
I left some comments, but I'm not really understanding most of the parsing properly. If this is clear to other reviewers, please just ignore my comment there. Maybe I just have to look into this a bit more, then.

src/meshes/p4est_mesh.jl Outdated Show resolved Hide resolved
src/meshes/p4est_mesh.jl Outdated Show resolved Hide resolved
src/meshes/p4est_mesh.jl Outdated Show resolved Hide resolved
src/meshes/p4est_mesh.jl Outdated Show resolved Hide resolved
src/meshes/p4est_mesh.jl Outdated Show resolved Hide resolved
src/meshes/p4est_mesh.jl Outdated Show resolved Hide resolved
src/meshes/p4est_mesh.jl Show resolved Hide resolved
@ranocha
Copy link
Member

ranocha commented Oct 27, 2021

  • 2D implementation and test
  • update mesh docs
  • 3D implementation and test (possibly for a different PR because this will require some new 3D transfinite interpolation routines).

Is anything of this done yet?

Copy link
Member

@ranocha ranocha left a comment

Choose a reason for hiding this comment

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

Great work, @andrewwinters5000 👍 Please find below some comments.

examples/p4est_2d_dgsem/elixir_euler_wall_bc_amr.jl Outdated Show resolved Hide resolved
examples/p4est_2d_dgsem/elixir_euler_wall_bc_amr.jl Outdated Show resolved Hide resolved
src/meshes/p4est_mesh.jl Outdated Show resolved Hide resolved
examples/p4est_2d_dgsem/elixir_euler_wall_bc_amr.jl Outdated Show resolved Hide resolved
src/meshes/p4est_mesh.jl Outdated Show resolved Hide resolved
src/meshes/p4est_mesh.jl Outdated Show resolved Hide resolved
src/meshes/p4est_mesh.jl Outdated Show resolved Hide resolved
src/meshes/p4est_mesh.jl Outdated Show resolved Hide resolved
src/meshes/p4est_mesh.jl Show resolved Hide resolved
@andrewwinters5000
Copy link
Member Author

  • 2D implementation and test
  • update mesh docs
  • 3D implementation and test (possibly for a different PR because this will require some new 3D transfinite interpolation routines).

Is anything of this done yet?

Yes, I forgot to check the box for the 2D implementation

src/meshes/p4est_mesh.jl Outdated Show resolved Hide resolved
src/meshes/p4est_mesh.jl Outdated Show resolved Hide resolved
src/meshes/p4est_mesh.jl Show resolved Hide resolved
src/meshes/p4est_mesh.jl Outdated Show resolved Hide resolved
src/meshes/p4est_mesh.jl Outdated Show resolved Hide resolved
src/meshes/p4est_mesh.jl Outdated Show resolved Hide resolved
src/meshes/p4est_mesh.jl Outdated Show resolved Hide resolved
src/meshes/p4est_mesh.jl Outdated Show resolved Hide resolved
Increasing the `initial_refinement_level` allows one to uniformly refine the base mesh given
in the `meshfile` to create a forest with more trees before the simulation begins.
For example, if a two-dimensional base mesh contains 25 elements then setting
`initial_refinement_level=1` creates an initial forest of 4*25 = 100 trees.

# Arguments
- `meshfile::String`: an uncurved Abaqus mesh file that can be imported by p4est.
Copy link
Member

Choose a reason for hiding this comment

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

Right now, the mapping is only used if the file doesn't have a HOHQMesh header. This should be documented.
OTOH, would it make sense to allow mapping a curved HOHQMesh mesh? Then we could just apply the mapping after reading in the mesh, no matter if it's a curved or uncurved mesh file.

Copy link
Member Author

Choose a reason for hiding this comment

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

This might be possible but I am not sure if it is necessary. I cannot think of an application where we would need this functionality. For instance, it seems strange to me that you would read in a mesh with curved physical boundaries (say an airfoil) and then have it be mapped to something else.

Copy link
Member

Choose a reason for hiding this comment

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

@andrewwinters5000 Just FYI: I now came across an example where this is actually useful. You may want to stretch a grid smoothly towards an area where you want a higher resolution. With a spherical mesh, for example.

src/meshes/p4est_mesh.jl Outdated Show resolved Hide resolved
@andrewwinters5000
Copy link
Member Author

figure for the new mesh docs

Screenshot 2021-10-28 at 12 53 08

@ranocha ranocha added enhancement New feature or request upstream labels Oct 28, 2021
Copy link
Member

@ranocha ranocha left a comment

Choose a reason for hiding this comment

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

Cool!

docs/src/meshes/p4est_mesh.md Outdated Show resolved Hide resolved
src/meshes/p4est_mesh.jl Outdated Show resolved Hide resolved
src/meshes/p4est_mesh.jl Outdated Show resolved Hide resolved
src/meshes/p4est_mesh.jl Outdated Show resolved Hide resolved
src/meshes/transfinite_mappings_3d.jl Show resolved Hide resolved
src/meshes/transfinite_mappings_3d.jl Outdated Show resolved Hide resolved
src/meshes/transfinite_mappings_3d.jl Outdated Show resolved Hide resolved
src/meshes/transfinite_mappings_3d.jl Outdated Show resolved Hide resolved
@@ -10,7 +10,7 @@ function init_elements!(elements, mesh::P4estMesh{3}, basis::LobattoLegendreBasi
@unpack node_coordinates, jacobian_matrix,
contravariant_vectors, inverse_jacobian = elements

calc_node_coordinates!(node_coordinates, mesh, basis.nodes)
calc_node_coordinates!(node_coordinates, mesh, basis)
Copy link
Member

Choose a reason for hiding this comment

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

I think we call some calc_node_coordinates! from Trixi.jl in Trixi2Vtk.jl, e.g., https://github.com/trixi-framework/Trixi2Vtk.jl/blob/16057193f5ea4b3b1b9e5cbe8d4962e2e16e1c31/src/vtktools.jl#L186. Does this interfere with this change?
CC @efaulhaber

Copy link
Member Author

Choose a reason for hiding this comment

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

Aha, gotcha. I noticed that the routine below the constructor with the @ assert about the two polydegs was never entered. That is, it was possible to run with mesh_polydeg > solver_polydeg.

src/meshes/face_interpolant.jl Outdated Show resolved Hide resolved
src/meshes/transfinite_mappings_3d.jl Show resolved Hide resolved
src/meshes/p4est_mesh.jl Outdated Show resolved Hide resolved
src/meshes/p4est_mesh.jl Outdated Show resolved Hide resolved
docs/src/meshes/p4est_mesh.md Outdated Show resolved Hide resolved
test/test_unstructured_2d.jl Show resolved Hide resolved
ranocha
ranocha previously approved these changes Nov 5, 2021
sloede
sloede previously approved these changes Nov 5, 2021
docs/src/meshes/p4est_mesh.md Outdated Show resolved Hide resolved
docs/src/meshes/p4est_mesh.md Outdated Show resolved Hide resolved
docs/src/meshes/p4est_mesh.md Outdated Show resolved Hide resolved
docs/src/meshes/p4est_mesh.md Outdated Show resolved Hide resolved
docs/src/meshes/p4est_mesh.md Outdated Show resolved Hide resolved
@andrewwinters5000 andrewwinters5000 dismissed stale reviews from sloede and ranocha via 8d9c7ba November 5, 2021 09:42
@ranocha ranocha merged commit 5fed818 into trixi-framework:main Nov 5, 2021
@andrewwinters5000 andrewwinters5000 deleted the p4est-hohqmesh branch November 5, 2021 13:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request upstream
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants