Closed bishtgautam closed 3 years ago
Could you be a little more specific about what you want labeled? The PETSc box mesh generator labels the "Face Sets"
(1 through 6 for a 3D box) and it should read/write those. I have a separate task to add support for named sets so we don't have so many magic numbers.
This is something that Gautam and I were discussing--a little program that creates a simple box mesh that labels faces with BC indices (probably in a simple way, using the 6 boundaries of the box domain). Also, it would have a driver-like component that runs simulations on them. Really, it's just a sandbox for us to explore how we assign and represent BCs.
Okay, you can currently do this with
DMCreate(comm, &dm);
DMSetType(dm, DMPLEX);
DMSetFromOptions(dm);
and then -dm_plex_shape box -dm_plex_box_faces 2,3,4
. (You can make lots of other shapes this way too.) That box will have a "Face Sets"
label with distinct value on each face.
faceMarkerBottom = 1;
faceMarkerTop = 2;
faceMarkerFront = 3;
faceMarkerBack = 4;
faceMarkerRight = 5;
faceMarkerLeft = 6;
https://petsc.org/main/docs/manualpages/DM/DMSetFromOptions.html
We're going another way with this particular task. I'll create a new issue.
We're getting interested in running some "realistic" simulations that include non-trivial boundary conditions. In that connection, it would be nice to have a demo program that illustrates a workflow for generating and/or reading in meshes and associating boundary conditions with faces on the boundary of the problem.
The simplest such demo would do the following:
Given some sort of specification that defines a flow, including boundary conditions:
We can add an option to skip the first 2 steps and instead load an existing HDF5 file. This allows us to prove that we have a mechanism for reading and writing mesh files with BC information (or at least boundary face information).
Questions
Do we want to encode actual boundary conditions into the HDF5 file, or leave it to a driver to associate its own boundary conditions with integer label values for boundary faces? Both options can make sense, depending on the setting, but leaving BC specification to the driver seems like the more general "PETSc" way of doing things.
What are the types of flows we're interested in supporting for this demo?
@bishtgautam