Skip to content

Commit

Permalink
feature/il_partition_matset_support (#898)
Browse files Browse the repository at this point in the history
* Add initial element-dominant matset support

WIP, bug in uni-buffer support

* Debugging index issue

* Fix support for material based uni buffer

* Add a unit test for material based uni buffers

* Add support for each type of matset

* Add some setup code for matset::combine

* Add support for combining matsets

* Iterate volume fraction data properly

* Add baselines for matset partition/combine

Some small code cleanup too

* Add unit test for different topology types

* Fix iteration bug

The way the o2m iterator was being used caused to fail to iterate
domains with only 1 element.

* Add spiral with matset unit test

* Add a test case with matset on domain 4

* Use common is_multi_buffer function

* Find o2m data_paths instead of guessing
  • Loading branch information
cdl-ilight authored Jan 13, 2022
1 parent 0366233 commit 15d20c8
Show file tree
Hide file tree
Showing 16 changed files with 3,275 additions and 18 deletions.
28 changes: 20 additions & 8 deletions src/libs/blueprint/conduit_blueprint_mesh_matset_xforms.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -125,16 +125,28 @@ to_silo(const conduit::Node &field,
index_t matset_num_elems = 0;
if(mset_is_matdom)
{
NodeConstIterator eids_iter = matset["element_ids"].children();
while(eids_iter.has_next())
if(mset_is_unibuffer)
{
const DataAccessor<index_t> eids = matset["element_ids"].value();
const index_t N = eids.number_of_elements();
for(index_t i = 0; i < N; i++)
{
matset_num_elems = std::max(matset_num_elems, eids[i] + 1);
}
}
else
{
const Node &eids_node = eids_iter.next();
const DataType eids_dtype(eids_node.dtype().id(), 1);
for(index_t ei = 0; ei < eids_node.dtype().number_of_elements(); ei++)
NodeConstIterator eids_iter = matset["element_ids"].children();
while(eids_iter.has_next())
{
temp.set_external(eids_dtype, (void*)eids_node.element_ptr(ei));
const index_t elem_index = temp.to_int();
matset_num_elems = std::max(matset_num_elems, elem_index + 1);
const Node &eids_node = eids_iter.next();
const DataType eids_dtype(eids_node.dtype().id(), 1);
for(index_t ei = 0; ei < eids_node.dtype().number_of_elements(); ei++)
{
temp.set_external(eids_dtype, (void*)eids_node.element_ptr(ei));
const index_t elem_index = temp.to_int();
matset_num_elems = std::max(matset_num_elems, elem_index + 1);
}
}
}
}
Expand Down
Loading

0 comments on commit 15d20c8

Please sign in to comment.