Fix #1194: Unify signatures of mesh constructors#3000
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. |
|
Thanks a lot! We just had a developer meeting and brainstormed a bit about the desired interface. Something like TreeMesh(coordinates_min = (-1.0, -1.0),
coordinates_max = (1.0, 1.0),
initial_refinement_level = 4, n_cells_max = 30_000)
StructuredMesh(coordinates_min = (-1.0, -1.0),
coordinates_max = (1.0, 1.0),
initial_refinement_level = 4)
P4estMesh(coordinates_min = (-1.0, -1.0),
coordinates_max = (1.0, 1.0),
initial_refinement_level = 4)
T8codeMesh(coordinates_min = (-1.0, -1.0),
coordinates_max = (1.0, 1.0),
initial_refinement_level = 4)
DGMultiMesh(dg; coordinates_min = (-1.0, -1.0),
coordinates_max = (1.0, 1.0),
initial_refinement_level = 4)Under the hood, these keyword-only constructors should forward the keyword arguments to constructors taking positional arguments (to be able to use dispatch there). Could you please update the API accordingly? |
Thanks for the feedback, I'll update the API accordingly. |
|
Please ping me when this PR is ready for a review. |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #3000 +/- ##
=======================================
Coverage 97.09% 97.09%
=======================================
Files 630 630
Lines 48855 48881 +26
=======================================
+ Hits 47435 47461 +26
Misses 1420 1420
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
|
@ranocha, the PR is ready for review |
|
Thanks for the feedback! In the last view commits (ad76138, 60ec745,ebe65fc,1eda211) I made the following changes:
|
I added mesh constructors so that mesh types become interchangeable.
What's new
initial_refinement_level(likeTreeMesh):cells_per_dimensionpositional (now also for P4estMesh/T8codeMesh)I already added some explanation in the
docsand an example file (examples/special_elixirs/elixir_advection_mesh_swap.jl).