Open ranocha opened 3 years ago
Good idea. Note that we also use n_cells
in parts of Trixi, mostly for mesh I/O. This should IMHO be unified as well then. Since it means that I/O files change if applied consistently, this might become a breaking change then.
I agree. This would also condense the new Trixi2Vtk
slightly. As far as I could tell, the StructuredMesh
and UnstructuredMesh2D
always use the eachelement(solver, cache)
for the loops and would only need such an n_cells
function for mesh I/O (as already noted by @sloede ).
Yes, that's exactly the use case - and the reason why I didn't bother implementing something like this so far. I have mostly been working on the solver side where we have eachelement
and nelements
. However, ncells
would be used for mesh-only stuff where we have neither a solver
nor a cache
.
I recognized this while reviewing https://github.com/trixi-framework/Trixi2Vtk.jl/pull/47. Right now, we don't have a unified interface to access the number of cells of a given
mesh
. Based on our naming conventions and the existing example ofncells(mesh::P4estMesh)
, I propose to implement a methodncells
for each mesh type and document it as official API.When we do that, we should update Trixi2Vtk accordingly.
CC @andrewwinters5000