You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: src/docs/sphinx/blueprint_mesh.rst
+113-5Lines changed: 113 additions & 5 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -746,13 +746,121 @@ For element 10, we can see that the three material ids are ``1``, ``2``, and ``3
746
746
Looking at the material map, we can see that ``circle_a`` is the material corresponding to material id ``1``, ``circle_b`` is the material corresponding to material id ``2``, and ``circle_c`` is the material corresponding to material id ``3``.
747
747
Therefore, element 10 is split evenly between the circle materials.
748
748
749
-
//////
749
+
Here is another example showing the basic structure:
indices: [indirection array into the volume_fractions and material_ids]
764
+
765
+
Even though volume fractions and material ids are flattened into a single buffer, they are still grouped by element, and the **o2mrelation** data tells us how to interpret the uni-buffer data.
**Uni-buffer material-dominant** are currently unsupported in Conduit Blueprint, but it is still possible to create and reason about data in this layout. We may add support in the future as needed.
772
+
773
+
A **uni-buffer** material set is one that presents all of its volume fraction data in a single data buffer.
774
+
A **material-dominant** material set is a material set variant wherein the volume fractions and element ids are grouped by material.
775
+
It is easy to fetch information grouped by material and much harder to fetch information grouped by element in a **material-dominant** material set.
776
+
In this case, the material set schema must include a volume fraction data buffer, a parallel buffer associating each volume with an element id, and an *Object* (the ``material_map``) that maps human-readable material names to unique integer material identifiers.
777
+
Additionally, the top-level of this schema is an **o2mrelation** that sources from the volume fraction/element identifier buffers and targets the material topology.
778
+
**Uni-buffer material-dominant** material sets are a *sparse* representation, as they only include volume fraction data for elements that have greater than 0% volume.
779
+
780
+
To conform to protocol, each ``matsets`` child of this type must be an *Object* that contains the following information:
781
+
782
+
* matsets/matset/topology: "topo"
783
+
* matsets/matset/material_map: (object with integer leaves)
As an **o2mrelation**, the following values may also be present:
788
+
789
+
* matsets/matset/sizes: (integer array)
790
+
* matsets/matset/offsets: (integer array)
791
+
* matsets/matset/indices: (integer array)
792
+
793
+
.. note::
794
+
It can help to think of how the data are traversed when understanding this structure. A
795
+
material's size and offset can be obtained by indexing the ``sizes`` and ``offsets`` with the
796
+
material index. These are used to look up a tuple of data from ``indices``. The resulting
797
+
indices for the element are array indices into the ``element_ids`` and ``volume_fractions``
798
+
arrays for the current material.
750
799
800
+
The following plot and representative ``YAML`` illustrate a simple **uni-buffer material-dominant** material set example:
751
801
752
-
uni-buffer material-dominant
753
-
- spec
754
-
- example
755
-
- unsupported
802
+
.. figure:: venn_matsets.png
803
+
:width:600px
804
+
:align:center
805
+
806
+
A plot of a 3x3 ``venn``'s material boundaries with meshlines and element ids shown. Cyan represents the ``background``, red represents ``circle_a``, green represents ``circle_b``, and blue represents ``circle_c``.
Again, **uni-buffer material-dominant** material sets are sparsely organized by material.
824
+
We can use information from the **o2mrelation** to understand the ``volume_fractions`` and ``element_ids`` arrays.
825
+
Let's say we want to know the element ids and volume fractions for the first material.
826
+
The first material is the first material to appear in the material map, so our first (0th) material is ``circle_a``.
827
+
First, we examine the **o2mrelation** arrays. We see that our size is ``4``, meaning there are four elements containing this material.
828
+
Our offset is ``0``, meaning our starting index into the ``indices`` array is zero.
829
+
The 0th entry in ``indices`` is also ``0``, meaning that the 0th values in both the ``volume_fractions`` and ``element_ids`` arrays correspond to data for the first material (``circle_a``).
830
+
If indices are not present, then we use the ``sizes`` and ``offsets`` information to get the starting index directly into the ``volume_fractions`` and ``element_ids`` arrays.
831
+
If ``sizes`` and ``offsets`` are not present, then it is assumed that all sizes are ``1`` and ``offsets`` is a trivial prefix sum.
832
+
For ``circle_a``, we see that the element ids are ``9``, ``10``, ``13``, and ``14``, and the volume fractions are ``1.0``, ``0.333333333333333``, ``1.0``, and ``0.5``.
833
+
That means that ``circle_a`` is present in element ``9`` with a volume fraction of ``1.0``, present in element ``10`` with a volume fraction of ``0.333333333333333``, present in element ``13`` with a volume fraction of ``1.0``, and present in element ``14`` with a volume fraction of ``0.5``.
834
+
835
+
If we want to know the element ids and volume fractions for the third material, we first go to the third index in the ``sizes`` and ``offsets`` arrays.
836
+
The third material is the third material to appear in the material map, so our third (0th) material is ``circle_c``.
837
+
We can see that the size is ``2``, meaning there are two elements containing this material.
838
+
Our offset is ``8``, meaning our starting index into the ``indices`` array is eight.
839
+
The 8th entry in ``indices`` is ``8``, meaning that the 8th values in both the ``volume_fractions`` and ``element_ids`` arrays correspond to data for the third material (``circle_c``).
840
+
If indices are not present, then we use the ``sizes`` and ``offsets`` information to get the starting index directly into the ``volume_fractions`` and ``element_ids`` arrays.
841
+
If ``sizes`` and ``offsets`` are not present, then it is assumed that all sizes are ``1`` and ``offsets`` is a trivial prefix sum.
842
+
For ``circle_c``, we see that the element ids are ``6`` and ``10``, and the volume fractions are ``1.0`` and ``0.333333333333333``.
843
+
That means that ``circle_c`` is present in element ``6`` with a volume fraction of ``1.0``, present in element ``10`` with a volume fraction of ``0.333333333333333``.
844
+
845
+
Here is another example showing the basic structure:
indices: [indirection array into the volume_fractions and element_ids]
860
+
861
+
Even though volume fractions and element ids are flattened into a single buffer, they are still grouped by material, and the **o2mrelation** data tells us how to interpret the uni-buffer data.
0 commit comments