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
WIP: Add FV method for T8codeMesh #1844
base: main
Are you sure you want to change the base?
Conversation
Review checklistThis checklist is meant to assist creators of PRs (to let them know what reviewers will typically look for) and reviewers (to guide them in a structured review process). Items do not need to be checked explicitly for a PR to be eligible for merging. Purpose and scope
Code quality
Documentation
Testing
Performance
Verification
Created with ❤️ by the Trixi.jl community. |
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #1844 +/- ##
===========================================
- Coverage 96.08% 79.43% -16.65%
===========================================
Files 450 455 +5
Lines 36169 37053 +884
===========================================
- Hits 34750 29430 -5320
- Misses 1419 7623 +6204
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
src/meshes/t8code_mesh.jl
Outdated
# Simple meshes | ||
# Temporary routines to create simple `cmesh`s by hand | ||
|
||
# Directly ported from: `src/t8_cmesh/t8_cmesh_examples.c: t8_cmesh_new_periodic_hybrid`. | ||
function cmesh_new_periodic_hybrid(comm)::t8_cmesh_t | ||
n_dims = 2 | ||
vertices = [ # Just all vertices of all trees. partly duplicated | ||
-1.0, -1.0, 0, # tree 0, triangle | ||
0, -1.0, 0, | ||
0, 0, 0, | ||
-1.0, -1.0, 0, # tree 1, triangle |
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.
The following 300 lines are just by-hand building routines for simple cmesh
s. This is only temporary and will be deleted in the future.
# TODO: Implement this function as soon as there is support for this in `t8code`. | ||
function save_mesh_file(mesh::T8codeMesh, output_directory, timestep, mpi_parallel) | ||
error("Mesh file output not supported yet for `T8codeMesh`.") | ||
# function save_mesh_file(mesh::T8codeMesh, output_directory, timestep, mpi_parallel) | ||
# error("Mesh file output not supported yet for `T8codeMesh`.") | ||
|
||
# return joinpath(output_directory, "dummy_mesh.h5") | ||
# end | ||
|
||
function save_mesh_file(mesh::T8codeMesh, output_directory, timestep, mpi_parallel) | ||
return joinpath(output_directory, "dummy_mesh.h5") | ||
end |
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.
All those plotting routines are very improvised and are not in the standard Trixi way.
I use the t8code internal routines to directly create vtu
files inside Trixi.jl.
They probably should be deleted or changed for this PR.
mesh.tree_node_coordinates = tree_node_coordinates | ||
mesh.max_number_faces = 4 # TODO: How to automatically adapt for other element types, e.g. triangles? |
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.
Is there a t8code routine that gives the maximum number of faces of all elements in a forest?
function integrate_via_indices(func::Func, u, | ||
mesh::T8codeMesh, equations, | ||
solver::FV, cache, args...; | ||
normalize = true) where {Func} |
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.
TODO: Relocate this routine, calc_error_norms
and analyze
to analysis.jl
since they are dimension independent.
…odic domains (adapt test)
This PR adds the implementation of a first-order (WIP second order) finite volume scheme.
The mesh is organized with t8code. Therefore, it supports MPI parallelization.
Visualization is implemented using a t8code routine directly and therefore without .h5 files and Trixi2Vtk.
Convergence test with
elixir_advection_basic.jl
(with a periodic hybrid mesh and time integration methodCarpenterKennedy2N54
andT=1.0
):non-periodic domain:
Second-order: (WIP)
TODOs:
Free stream preservation:
Simulation of linear advection equation and compressible Euler equation with a constant initial condition,
cfl<=0.8
results in machine precision errors for all defined meshes.TODOs:
convergence_test
works parallel. If I remember correctly, it doesn't.