Alpine-DAV/ascent

dealing with multiple topologies

mlohry opened this issue · 4 comments

I have two topologies defined, "volume" consisting of tetrahedra and "surface" consisting of triangles, eg

  data["topologies/surface/type"]           = "unstructured";
  data["topologies/surface/elements/shape"] = "tri";
  data["topologies/surface/coordset"]       = "coords";
...
  data["topologies/volume/type"]           = "unstructured";
  data["topologies/volume/elements/shape"] = "tet";
  data["topologies/volume/coordset"]       = "coords";

Some questions relating to dealing with this:

  1. Scenes seem to always require a topology specified. Can I specify a default somewhere so as to not need to add this to ascent_actions.yaml?
  2. Blueprint relay extracts are dumping both topologies by default. Is there a way to specify only dumping the surface output?
  3. The multiple topologies examples in the docs Example of adding multiple ghosts with 2 topologies don't explicitly specify a topology, but when I try to create a scene I get the error s1/p1: data set has multiple topologies and no topology is specified. topology names: 'surface', 'volume's1/p1 mesh plot yielded no data, i.e., no cells remain[Error] Ascent::execute. If I explicitly state it like
-
  action: "add_scenes"
  scenes:
    s1:
      plots:
        p1:
          type: "mesh"
          topology: "volume"

I get the error s1/p1 mesh plot yielded no data, i.e., no cells remain. How do those examples work?

Examples of end goals we're after, and if this is possible an example input would be great:

  1. Render of isosurfaces of q-criterion from the volume topology, and show a solid/opaque surface of the surface topology. Or a pseudocolor of some other quantity on the surface.
  2. Render of slices through the volume topology showing some field, along with a surface pseudocolor of some other field.
  1. For a mesh plot: If there is only a single topology published -- we don't require the topology name. If there are more than one -- we need to know which one you intend to plot (we don't attempt to plot all of them), that's why it is asking.

That said, you can create multiple mesh plots in the same scene -- each with a different target topology and have them all rendered to single image.

  1. The relay extract allows you to select which fields you want to export.
    I believe f you know a field name that exists on your surface, you can use the "fields" option:

extracts["e1/params/fields"].append() = "iters";

It doesn't have an option to only export a specific topology -- that is something we can add.

  1. Pseudocolor plots always require a field name as an input, and fields are always linked to a unique topology.
    So the example in the docs ends up plotting multiple typologies, but the selection of which is implicit based on the field names.

Each plot can take the result of a pipeline (which allows you to apply specific filters, like isosurfaces)

So for your case 1:

You can create a pipeline that calculates the isosurfaces of the q-crit, and have that be a plot in a scene. Then you can add another plot to your scene that shows surface topology.

Right now we don't have the simple "solid" plot, so it would have to be faked with pseudocolor plot of constant field.
The input to the 2nd plot would be the default data, not the result of the pipeline.

For case 2, similarly:

You can use a pipeline and a plot to show your slides, and another pseudocolor plot to show your surface.
Again, the input to the 2nd plot would be the default data, not the result of the pipeline.

Thanks @cyrush , sounds good. I did hit what appears to be a bug or user error in #1297

It doesn't have an option to only export a specific topology -- that is something we can add.

This would be a nice to have. Our volume meshes are getting into the multiple TBs so right now I have a separate workflow for surface-only data.

@mlohry #1300 adds a topologies option to the relay extract that allow you to select which topology you want to save.

When used, it will say the selected topologies and all their associated fields.
When used with the fields option as well, the result is the union of the data found.

(so you can, for example save a whole topology, along with a single field from another)

Fantastic, thanks @cyrush ! I think this closes out my questions.