Skip to content

Commit

Permalink
Merge pull request #1105 from LLNL/bugfix/gunney/unstructured-mesh-ca…
Browse files Browse the repository at this point in the history
…pacity

Fix `ConnectivityArray` setting bad capacity in constructor.
  • Loading branch information
gunney1 committed Jun 2, 2023
2 parents 40bb16e + dc7c14d commit 5ed9b02
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 5 deletions.
3 changes: 3 additions & 0 deletions RELEASE-NOTES.md
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,9 @@ The Axom project release numbers follow [Semantic Versioning](http://semver.org/
- Quest: Adds ability to import volume fractions into `SamplingShaper` before processing `Klee` input

### Changed
- Fixed bug in `mint::mesh::UnstructuredMesh` constructors, affecting capacity.
A missing factor was added. If you worked around this by adding the factor yourself,
you may want to undo that work-around.
- Updates blt submodule to HEAD of develop on 24Jan2023
- Updates uberenv submodule to HEAD of main on 12May2023
- Updates to [conduit version 0.8.6](https://github.com/LLNL/conduit/compare/v0.8.3...v0.8.6)
Expand Down
11 changes: 8 additions & 3 deletions src/axom/mint/mesh/ConnectivityArray.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -340,10 +340,12 @@ class ConnectivityArray
SLIC_ASSERT(elems_group != nullptr);

sidre::View* connec_view = elems_group->getView("connectivity");
axom::IndexType element_capacity =
ID_capacity == USE_DEFAULT ? USE_DEFAULT : ID_capacity * m_stride;
m_values = std::make_unique<sidre::MCArray<IndexType>>(connec_view,
0,
m_stride,
ID_capacity);
element_capacity);
SLIC_ASSERT(m_values != nullptr);
}

Expand Down Expand Up @@ -381,10 +383,12 @@ class ConnectivityArray
SLIC_ASSERT(elems_group != nullptr);

sidre::View* connec_view = elems_group->getView("connectivity");
axom::IndexType element_capacity =
ID_capacity == USE_DEFAULT ? USE_DEFAULT : ID_capacity * m_stride;
m_values = std::make_unique<sidre::MCArray<IndexType>>(connec_view,
0,
m_stride,
ID_capacity);
element_capacity);
}

#endif
Expand Down Expand Up @@ -420,7 +424,8 @@ class ConnectivityArray
* \param [in] ID_capacity the number of IDs to reserve space for.
* \param [in] value_capacity not used, does not need to be specified.
*
* \post getIDCapacity() >= n_IDs
* If current getIDCapacity() >= ID_capacity, do nothing.
* \post getIDCapacity() >= ID_capacity
*/
void reserve(IndexType ID_capacity,
IndexType AXOM_UNUSED_PARAM(value_capacity) = 0)
Expand Down
3 changes: 1 addition & 2 deletions src/axom/sidre/core/Array.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -335,8 +335,7 @@ class Array : public axom::Array<T, DIM>
/*!
* \brief Allocates space within the Array's View.
*
* \param [in] new_num_tuples the number of tuples which exceeds the current
* capacity.
* \param [in] new_capacity the number of elements to allocate.
*/
void reallocViewData(IndexType new_capacity);

Expand Down

0 comments on commit 5ed9b02

Please sign in to comment.