Skip to content

Commit

Permalink
Merge pull request #1156 from LLNL/bugfix/whitlock/partition_material…
Browse files Browse the repository at this point in the history
…_map

Make partitioner better about outputting material_map node.
  • Loading branch information
BradWhitlock committed Aug 11, 2023
2 parents 3ca27b8 + 1e1ce33 commit 913a169
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 0 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ and this project aspires to adhere to [Semantic Versioning](https://semver.org/s

#### Blueprint
- The `conduit::blueprint::mesh::partition()` function no longer issues an error when it receives a "maxshare" adjset.
- The partitioner is better about outputting a "material_map" node for matsets. The "material_map" node is optional for some varieties of matset but they can also help the `conduit::blueprint::mesh::matset::to_silo()` function generate the right material numbers when a domain does not contain all materials.

## [0.8.8] - Released 2023-05-18

Expand Down
10 changes: 10 additions & 0 deletions src/libs/blueprint/conduit_blueprint_mesh_partition.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -9337,6 +9337,16 @@ combine(const std::vector<Node> &inputs,
out_matset["volume_fractions"][name].set(volume_fractions);
out_matset["element_ids"][name].set(element_ids);
}

// If the material_map does not exist, add it since it supplies the entire
// list of materials, which can be important when a domain does not have
// all materials.
if(!out_matset.has_child("material_map") && !material_map.empty())
{
Node &mm = out_matset["material_map"];
for(auto it = material_map.begin(); it != material_map.end(); it++)
mm[it->second] = it->first;
}
}

}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,11 @@ matsets:
circle_a: [9, 13, 10, 14]
circle_b: [10, 11, 14, 15]
circle_c: [5, 9, 6, 7, 10, 11]
material_map:
background: 0
circle_a: 1
circle_b: 2
circle_c: 3
fields:
original_vertex_ids:
topology: "topo"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,11 @@ matsets:
circle_a: [9, 13, 10, 14]
circle_b: [10, 11, 14, 15]
circle_c: [5, 9, 6, 7, 10, 11]
material_map:
background: 0
circle_a: 1
circle_b: 2
circle_c: 3
fields:
original_vertex_ids:
topology: "topo"
Expand Down

0 comments on commit 913a169

Please sign in to comment.