Skip to content

Add PUMLcube#49

Merged
davschneller merged 4 commits intomasterfrom
davschneller/pumlcube
Mar 5, 2026
Merged

Add PUMLcube#49
davschneller merged 4 commits intomasterfrom
davschneller/pumlcube

Conversation

@davschneller
Copy link
Copy Markdown
Contributor

@davschneller davschneller commented Jul 25, 2023

This PR adds PUMLcube, a replica of cube_c for the PUML format, as used by PUML2. With maybe a slightly different tetrahedron decomposition for the cubes.

And no, it does not make PUML2 support periodic boundary conditions automatically. :)
It only adds an identify dataset to the HDF5 file. That is, periodic boundary conditions are implemented by identifying vertices with each other, i.e. we group the connectivity of the vertices, but they still have different coordinates. The identify array then lets all grouped vertices point to one head vertex by ID (and the head vertex points to itself). Of course, each unique (non-grouped) vertex is its own head vertex.
Coincidentally, that's sort of the same idea like the gmsh format also supports (in the $Periodic section).

However, for all of this to work, we'll need to extend PUML2 still. Somehow. We'll see.
SeisSol/SeisSol#1395 adds support to PUML2 and SeisSol.

Copy link
Copy Markdown
Contributor

@sebwolf-de sebwolf-de left a comment

Choose a reason for hiding this comment

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

Hi,
good work! From a user perspective: I don't understand how the bmin/bmax and the bper interact: Why can't I just provide bmaxx = bminx = periodic? And throw an error if bmaxx=periodic bminx != periodic?
Also an xdmf file would be nice to visualize the mesh with paraview.

* add a slim Xdmf and XML writer
* add HDF5 error checking functions
* update boundary format info
@davschneller
Copy link
Copy Markdown
Contributor Author

Sorry for the very late update; I've finally gotten to addressing the review.

Copy link
Copy Markdown

@gabriellemhobson gabriellemhobson left a comment

Choose a reason for hiding this comment

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

Hi, I have tested these changes on supermucNG and they appear to me to be working as expected. I tested using Examples/convergence_elastic:

  • I modified static_files/generateCubes.sh to call Meshing/pumlcube/pumlcube to create the meshes, using a call like so:
    ~/Meshing/pumlcube/pumlcube --bminx 6 --bmaxx 6 --bminy 6 --bmaxy 6 --bminz 6 --bmaxz 6 -x 4 -y 4 -z 4 -o cube_4.puml.h5 --sx $S --sy $S --sz $S --tx -1 --ty -1 --tz -1
  • I modified the elastic_convergence_runner/template/parameters.tmpl so that it does not use the built-in CubeGenerator, but instead uses the created mesh files:
    &MeshNml meshgenerator = 'PUML' meshfile = 'static_files/cube_{{ size }}.puml.h5'
  • I ran like so:
PYTHONPATH=$PWD python3 \
./elastic_convergence_runner \
--executable ../../seissol_install_manual/SeisSol/build/SeisSol_Release_dhsw_6_elastic \
--tmp-dir tmp_new \
--sizes 4 8 16 \
--expected-errors 1e-2 1e-4 5e-5 \
--norm-type LInf \
--end-time 0.1

And obtained the following output:

num_nodes: 1 ntasks: 1
   sizes        errors
0      4  9.235550e-04
1      8  1.917230e-05
2     16  3.123120e-07

If that test seems reasonable and looks as expected, then I think this is all good on my end.

@davschneller davschneller merged commit 47bfd78 into master Mar 5, 2026
@davschneller davschneller deleted the davschneller/pumlcube branch March 5, 2026 23:55
@davschneller
Copy link
Copy Markdown
Contributor Author

Thanks for the review. IMO maybe it's worth upstreaming these changes to the SeisSol/Examples repo for now as well. Reason being (despite the "internal" cube generator maybe being more convenient in the long run): it currently doesn't work e.g. for multiple ranks and it's code is pretty convoluted to be honest (i.e. overly convoluted).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants