Skip to content

Commit

Permalink
Add I/O support for Silo Materials
Browse files Browse the repository at this point in the history
  • Loading branch information
JustinPrivitera committed Oct 31, 2023
2 parents e17a944 + 46628bf commit d84e9f6
Show file tree
Hide file tree
Showing 7 changed files with 2,604 additions and 1,347 deletions.
14 changes: 4 additions & 10 deletions src/libs/blueprint/conduit_blueprint_mesh_matset_xforms.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -444,17 +444,11 @@ to_silo(const conduit::Node &field,
for(index_t elem_index = 0, slot_index = 0; elem_index < mset_num_elems; elem_index++)
{
const std::map<index_t, float64>& elem_mat_map = elem_mat_maps[elem_index];
if(elem_mat_map.size() == 0)
CONDUIT_ASSERT(elem_mat_map.size() != 0, "A zone has no materials.");
if (elem_mat_map.size() == 1)
{
temp.reset();
temp.set(0);
data.set_external(int_dtype, dest["matlist"].element_ptr(elem_index));
temp.to_data_type(int_dtype.id(), data);
}
else if(elem_mat_map.size() == 1)
{
temp.reset();
temp.set(elem_mat_map.begin()->first + 1);
temp.set(elem_mat_map.begin()->first);
data.set_external(int_dtype, dest["matlist"].element_ptr(elem_index));
temp.to_data_type(int_dtype.id(), data);
}
Expand Down Expand Up @@ -548,7 +542,7 @@ to_silo(const conduit::Node &matset,


//-----------------------------------------------------------------------------
// -- begin conduit::blueprint::mesh::matset --
// -- begin conduit::blueprint::mesh::field --
//-----------------------------------------------------------------------------
namespace field
{
Expand Down

0 comments on commit d84e9f6

Please sign in to comment.