Merge coordset points that are within a tolerance into the same point and provide information on how it was done.
More...
template<typename ExecSpace, typename CoordsetView>
class axom::bump::MergeCoordsetPoints< ExecSpace, CoordsetView >
Merge coordset points that are within a tolerance into the same point and provide information on how it was done.
- Template Parameters
-
| ExecSpace | The execution space where the algorithm runs. |
| CoordsetView | The coordset view type. |
template<typename ExecSpace , typename CoordsetView >
Merge the coordset points using a tolerance and pass out an array of the points that were selected from the original coordset since they can be used to slice nodal fields.
- Parameters
-
| [in,out] | n_coordset | The Conduit node that contains the coordset. The coordset data will be replaced. |
| n_options | A Conduit node that contains the supported options. At present, there is just a "tolerance" option that specifies how close points need to be in order to be matched. |
| [out] | selectedIds | An array containing the ids of the nodes that are selected from the old nodes. |
| [out] | old2new | An array with nnodes elements that contains the new node id for each node in the old coordset. This can be useful in rewriting connectivity or fields. |
- Note
- The algorithm eliminates a little precision on the input coordinates to make a hashed name for the point. Points that are close enough should have the same hashed name. The names are passed through a Unique filter to select a set of unique names. Multiple points could result in the same hash name so one of the points is selected as the new definition for the unique point (the selection arises from sorting the hash names). This means that among a bunch of points that are close enough to be grouped, one of them will be picked and it might not be the best one "esthetically". The points are output in sorted hash name order too, which is a bit random.
- Returns
- True if point merging happened; False if no point merging was needed.
References axom::utilities::abs(), AXOM_ANNOTATE_BEGIN, AXOM_ANNOTATE_END, AXOM_ANNOTATE_SCOPE, AXOM_LAMBDA, axom::utilities::binary_search(), axom::bump::Unique< ExecSpace, KeyType >::execute(), axom::bump::CoordsetSlicer< ExecSpace, CoordsetView >::execute(), axom::bump::MergeCoordsetPoints< ExecSpace, CoordsetView >::getAllocatorID(), axom::bump::MergeCoordsetPoints< ExecSpace, CoordsetView >::m_coordsetView, axom::bump::CoordsetSlicer< ExecSpace, CoordsetView >::setAllocatorID(), axom::Array< T, DIM, SPACE, StoragePolicy >::size(), SLIC_ASSERT, SLIC_ERROR, SLIC_INFO, axom::primal::slice(), and axom::Array< T, DIM, SPACE, StoragePolicy >::view().