Skip to content
Open
Show file tree
Hide file tree
Changes from 31 commits
Commits
Show all changes
42 commits
Select commit Hold shift + click to select a range
67a0044
Material view iterator for unibuffer matset.
BradWhitlock Nov 4, 2025
951df9b
Added MultiBufferMaterialView::iterator.
BradWhitlock Nov 4, 2025
77d5a00
Added ElementDominantMaterialView::iterator
BradWhitlock Nov 4, 2025
53e40cf
Delete default constructors for matset iterator types.
BradWhitlock Nov 4, 2025
b302ed4
Material view iterator improvements.
BradWhitlock Nov 5, 2025
0047a14
Extend mir_concentric_circles with a traversal method that times mats…
BradWhitlock Nov 5, 2025
4aac6c9
Far faster UnibufferMaterialView::iterator
BradWhitlock Nov 5, 2025
b81fbde
Updated command line option doc.
BradWhitlock Nov 5, 2025
47fae97
Added comment
BradWhitlock Nov 5, 2025
6aa2897
make style
BradWhitlock Nov 5, 2025
1da959f
Added missing AXOM_HOST_DEVICE macro.
BradWhitlock Nov 6, 2025
fe1a41f
Fix an iterator.
BradWhitlock Nov 6, 2025
5006395
Use iterator in MatsetSlicer.
BradWhitlock Nov 6, 2025
674b300
Use matset iterator in MergeMeshes.
BradWhitlock Nov 6, 2025
be4f7c9
Use matset iterator in TopologyMapper.
BradWhitlock Nov 6, 2025
c057972
Use iterators in test.
BradWhitlock Nov 6, 2025
de79be5
Add a new ArrayView-based zoneMaterials method in matset views. Use i…
BradWhitlock Nov 6, 2025
8a86edd
Merge branch 'bugfix/whitlock/increase_mir_max_polygon_size' into fea…
BradWhitlock Nov 6, 2025
6d70943
RELEASE-NOTES.md
BradWhitlock Nov 6, 2025
032fd01
Added another zoneMaterials test
BradWhitlock Nov 6, 2025
833ea28
Added heavily_mixed MIR example.
BradWhitlock Nov 7, 2025
f4e87d1
CMake testing fixes.
BradWhitlock Nov 7, 2025
8608815
Update release notes
BradWhitlock Nov 8, 2025
5ef3e68
Debugging code for bad clip shapes.
BradWhitlock Nov 8, 2025
b91d136
Logging changes in example applications
BradWhitlock Nov 8, 2025
68d0ab5
Fix view type
BradWhitlock Nov 8, 2025
ea443fd
Adjust clip precision based on type.
BradWhitlock Nov 8, 2025
9905b8a
make style
BradWhitlock Nov 8, 2025
d5eff88
Merge branch 'develop' into feature/whitlock/material_view_iterators
BradWhitlock Nov 8, 2025
4703bf1
Added a check for the last fragment's bounding box
BradWhitlock Nov 8, 2025
c93e16d
Merge branch 'feature/whitlock/material_view_iterators' of github.com…
BradWhitlock Nov 8, 2025
0654350
Renamed iterator to const_iterator and improved its docs. Also change…
BradWhitlock Nov 12, 2025
b49ffc1
Tweak to the RELEASE-NOTES.
BradWhitlock Nov 12, 2025
69daa62
Revert a change I did not mean to commit.
BradWhitlock Nov 13, 2025
41ca3ae
Merge branch 'develop' into feature/whitlock/material_view_iterators
BradWhitlock Nov 13, 2025
22ae3c1
Merge branch 'develop' into feature/whitlock/material_view_iterators
BradWhitlock Nov 14, 2025
d149b90
Added default MAXMATERIALS value in matset views.
BradWhitlock Nov 17, 2025
bcaf4c8
Merge branch 'feature/whitlock/material_view_iterators' of github.com…
BradWhitlock Nov 17, 2025
972c88b
Merge branch 'develop' into feature/whitlock/material_view_iterators
BradWhitlock Nov 18, 2025
43d28b5
Fix OMP race condition with Umpire.
BradWhitlock Nov 18, 2025
bfcf63e
Merge branch 'feature/whitlock/material_view_iterators' of github.com…
BradWhitlock Nov 18, 2025
c41908a
Merged develop into branch.
BradWhitlock Dec 1, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions RELEASE-NOTES.md
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,14 @@ The Axom project release numbers follow [Semantic Versioning](http://semver.org/
- The maximum number of vertices allowed in polygon primitives can now be passed as a template
argument to `axom::bump::TopologyMapper`, `axom::bump::PrimalAdaptor`, and
`axom::mir::ElviraAlgorithm`.
- Material views in `axom::bump::views` were enhanced with `iterator` classes that
enable traversal of material data for zones so kernels do not need to use large fixed size
buffers inside kernels.
- Material views in `axom::bump::views` were enhanced with an overloaded `zoneMaterials()`
method that allows data to be gathered into `axom::ArrayView` objects.
- A new `heavily_mixed` example program was added in `axom::mir` to demonstrate running MIR on
meshes with heavily mixed zones.

### Fixed

### Deprecated
Expand Down
11 changes: 4 additions & 7 deletions src/axom/bump/MatsetSlicer.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -112,15 +112,12 @@ class MatsetSlicer
const auto size = static_cast<int>(sizesView[index]);
const auto offset = offsetsView[index];

typename MatsetView::IDList ids;
typename MatsetView::VFList vfs;
deviceMatsetView.zoneMaterials(deviceSelectedZonesView[index], ids, vfs);

for(int i = 0; i < size; i++)
auto zoneMat = deviceMatsetView.beginZone(deviceSelectedZonesView[index]);
for(int i = 0; i < size; i++, zoneMat++)
{
const auto destIndex = offset + i;
materialIdsView[destIndex] = ids[i];
volumeFractionsView[destIndex] = vfs[i];
materialIdsView[destIndex] = zoneMat.material_id();
volumeFractionsView[destIndex] = zoneMat.volume_fraction();
indicesView[destIndex] = destIndex;
}
});
Expand Down
13 changes: 5 additions & 8 deletions src/axom/bump/MergeMeshes.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -1811,8 +1811,6 @@ class MergeMeshesAndMatsets : public MergeMeshes<ExecSpace>
axom::IndexType nzones,
axom::IndexType zOffset) const
{
using IDList = typename decltype(matsetView)::IDList;
using VFList = typename decltype(matsetView)::VFList;
using MatID = typename decltype(matsetView)::IndexType;

// Make some maps for renumbering material numbers.
Expand Down Expand Up @@ -1844,19 +1842,18 @@ class MergeMeshesAndMatsets : public MergeMeshes<ExecSpace>
nzones,
AXOM_LAMBDA(axom::IndexType zoneIndex) {
// Get this zone's materials.
IDList ids;
VFList vfs;
matsetView.zoneMaterials(zoneIndex, ids, vfs);
auto zoneMat = matsetView.beginZone(zoneIndex);
const auto nmats = zoneMat.size();

// Store the materials in the new material.
const auto zoneStart = offsetsView[zOffset + zoneIndex];
for(axom::IndexType mi = 0; mi < ids.size(); mi++)
for(axom::IndexType mi = 0; mi < nmats; mi++, zoneMat++)
{
const auto destIndex = zoneStart + mi;
volumeFractionsView[destIndex] = vfs[mi];
volumeFractionsView[destIndex] = zoneMat.volume_fraction();

// Get the index of the material number in the local map.
const auto mapIndex = axom::utilities::binary_search(localView, ids[mi]);
const auto mapIndex = axom::utilities::binary_search(localView, zoneMat.material_id());
SLIC_ASSERT(mapIndex != -1);
// We'll store the all materials number.
const auto allMatno = allView[mapIndex];
Expand Down
8 changes: 3 additions & 5 deletions src/axom/bump/TopologyMapper.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -656,11 +656,9 @@ class TopologyMapper

// Get the src material - there should just be one because we assume
// that a clean matset is being mapped.
typename SrcMatsetView::IDList zoneMatIds;
typename SrcMatsetView::VFList zoneMatVFs;
srcMatsetView.zoneMaterials(srcZone, zoneMatIds, zoneMatVFs);
SLIC_ASSERT(zoneMatIds.size() == 1);
const auto mat = zoneMatIds[0];
auto zoneMat = srcMatsetView.beginZone(srcZone);
SLIC_ASSERT(zoneMat.size() == 1);
const auto mat = zoneMat.material_id();

#if defined(AXOM_DEBUG_TOPOLOGY_MAPPER) && !defined(AXOM_DEVICE_CODE)
std::cout << "\tintersection:" << std::endl
Expand Down
72 changes: 72 additions & 0 deletions src/axom/bump/tests/bump_views.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -658,6 +658,78 @@ struct test_braid2d_mat
{
EXPECT_EQ(results[i], resultsHost[i]);
}

// Test iterators.
test_matsetview_iterators(matsetView, allocatorID);
}

template <typename MatsetView>
static void test_matsetview_iterators(MatsetView matsetView, int allocatorID)
{
using ZoneIndex = typename MatsetView::ZoneIndex;
// Allocate results array on device.
const int nResults = matsetView.numberOfZones();
axom::Array<int> resultsArrayDevice(nResults, nResults, allocatorID);
auto resultsView = resultsArrayDevice.view();

axom::for_all<ExecSpace>(
matsetView.numberOfZones(),
AXOM_LAMBDA(axom::IndexType index) {
typename MatsetView::IDList ids {};
typename MatsetView::VFList vfs {};
matsetView.zoneMaterials(index, ids, vfs);

// Get the end iterator for the zone.
const auto end = matsetView.endZone(index);

int eq_count = 0;
int count = 0;

// Make sure the iterator is for the right zone.
eq_count += (end.zoneIndex() == static_cast<ZoneIndex>(index)) ? 1 : 0;
count++;

// Make sure incrementing the last iterator has no effect.
auto end2 = end;
end2++;
eq_count += (end == end2) ? 1 : 0;
count++;

// Make sure the iterator order is the same as for the values we got from zoneMaterials().
int i = 0;
for(auto it = matsetView.beginZone(index); it != end; it++, i++)
{
eq_count += (vfs[i] == it.volume_fraction() && ids[i] == it.material_id()) ? 1 : 0;
count++;
}

// Test ArrayView version of zoneMaterials().
using IndexType = typename MatsetView::IndexType;
using FloatType = typename MatsetView::FloatType;
constexpr int ARRAY_SIZE = 10;
IndexType idStorage[ARRAY_SIZE];
FloatType vfStorage[ARRAY_SIZE];
axom::ArrayView<IndexType> idView(idStorage, ARRAY_SIZE);
axom::ArrayView<FloatType> vfView(vfStorage, ARRAY_SIZE);
const auto nmats = matsetView.zoneMaterials(index, idView, vfView);
eq_count += (nmats == ids.size()) ? 1 : 0;
count++;
for(axom::IndexType j = 0; j < nmats; j++)
{
eq_count += (vfs[j] == vfView[j] && ids[j] == idView[j]) ? 1 : 0;
count++;
}

resultsView[index] = (eq_count == count) ? 1 : 0;
});

// Get containsView data to the host and compare results
std::vector<int> resultsHost(nResults);
axom::copy(resultsHost.data(), resultsView.data(), sizeof(int) * nResults);
for(int i = 0; i < nResults; i++)
{
EXPECT_EQ(resultsHost[i], 1);
}
}
};

Expand Down
Loading