diff --git a/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/InterpolatePointCloudToRegularGridFilter.cpp b/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/InterpolatePointCloudToRegularGridFilter.cpp index 595f26c115..5353057240 100644 --- a/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/InterpolatePointCloudToRegularGridFilter.cpp +++ b/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/InterpolatePointCloudToRegularGridFilter.cpp @@ -58,7 +58,7 @@ struct MapPointCloudDataByKernelFunctor continue; } index = (z * dims[1] * dims[0]) + (y * dims[0]) + x; - interpolatedDataPtr->addEntry(index, kernelVals[counter] * inputData[vertIdx]); + interpolatedDataPtr->addEntry(index, kernelVals[counter] * inputData.at(vertIdx)); counter++; } } diff --git a/src/Plugins/SimplnxCore/test/ApplyTransformationToGeometryTest.cpp b/src/Plugins/SimplnxCore/test/ApplyTransformationToGeometryTest.cpp index 378636964c..4100bc2569 100644 --- a/src/Plugins/SimplnxCore/test/ApplyTransformationToGeometryTest.cpp +++ b/src/Plugins/SimplnxCore/test/ApplyTransformationToGeometryTest.cpp @@ -11,8 +11,6 @@ #include -#include - #include #include #include @@ -723,13 +721,6 @@ TEST_CASE("SimplnxCore::ApplyTransformationToGeometryFilter:Precomputed_Image_NN const auto& exemplarData = dataStructure.getDataRefAs(exemplarPath); const auto& calculatedData = dataStructure.getDataRefAs(calculatedPath); - { - const auto& exemplarArr = dataStructure.getDataRefAs>(exemplarPath); - std::cout << "ApplyTransformationToGeometryFilter: Exemplar: " << exemplarArr.getDataStoreRef().xarray() << std::endl; - - const auto& calculatedDataArr = dataStructure.getDataRefAs>(calculatedPath); - std::cout << "ApplyTransformationToGeometryFilter: Data: " << calculatedDataArr.getDataStoreRef().xarray() << std::endl; - } UnitTest::CompareDataArrays(exemplarData, calculatedData); } } diff --git a/src/Plugins/SimplnxCore/test/CMakeLists.txt b/src/Plugins/SimplnxCore/test/CMakeLists.txt index c0f9ec8328..71cda8568e 100644 --- a/src/Plugins/SimplnxCore/test/CMakeLists.txt +++ b/src/Plugins/SimplnxCore/test/CMakeLists.txt @@ -9,11 +9,11 @@ set(${PLUGIN_NAME}UnitTest_SRCS CreateAMScanPathsTest.cpp SliceTriangleGeometryTest.cpp # ReadDeformKeyFileV12Test.cpp - # AddBadDataTest.cpp - # AlignGeometriesTest.cpp - # AlignSectionsFeatureCentroidTest.cpp - # AlignSectionsListTest.cpp - # AppendImageGeometryZSliceTest.cpp + AddBadDataTest.cpp + AlignGeometriesTest.cpp + AlignSectionsFeatureCentroidTest.cpp + AlignSectionsListTest.cpp + AppendImageGeometryZSliceTest.cpp ApplyTransformationToGeometryTest.cpp ApproximatePointCloudHullTest.cpp ArrayCalculatorTest.cpp @@ -83,59 +83,57 @@ set(${PLUGIN_NAME}UnitTest_SRCS InitializeDataTest.cpp InitializeImageGeomCellDataTest.cpp InterpolatePointCloudToRegularGridTest.cpp - - # IterativeClosestPointTest.cpp - # LabelTriangleGeometryTest.cpp - # LaplacianSmoothingFilterTest.cpp - # MapPointCloudToRegularGridTest.cpp - # RequireMinNumNeighborsTest.cpp - # MoveDataTest.cpp - # MultiThresholdObjectsTest.cpp - # NearestPointFuseRegularGridsTest.cpp - # PartitionGeometryTest.cpp - # PipelineTest.cpp - # PointSampleTriangleGeometryFilterTest.cpp - # QuickSurfaceMeshFilterTest.cpp - # ReadBinaryCTNorthstarTest.cpp - # ReadCSVFileTest.cpp - # ReadHDF5DatasetTest.cpp - # ReadRawBinaryTest.cpp - # ReadStlFileTest.cpp - # ReadTextDataArrayTest.cpp - # ReadVolumeGraphicsFileTest.cpp - # ReadVtkStructuredPointsTest.cpp - # RegularGridSampleSurfaceMeshTest.cpp - # RemoveFlaggedFeaturesTest.cpp - # RemoveFlaggedTrianglesTest.cpp - # RemoveFlaggedVerticesTest.cpp - # RequireMinimumSizeFeaturesTest.cpp - # RenameDataObjectTest.cpp - # ReplaceElementAttributesWithNeighborValuesTest.cpp + IterativeClosestPointTest.cpp + LabelTriangleGeometryTest.cpp + LaplacianSmoothingFilterTest.cpp + MapPointCloudToRegularGridTest.cpp + RequireMinNumNeighborsTest.cpp + MoveDataTest.cpp + MultiThresholdObjectsTest.cpp + NearestPointFuseRegularGridsTest.cpp + PartitionGeometryTest.cpp + PipelineTest.cpp + PointSampleTriangleGeometryFilterTest.cpp + QuickSurfaceMeshFilterTest.cpp + ReadBinaryCTNorthstarTest.cpp + ReadCSVFileTest.cpp + ReadHDF5DatasetTest.cpp + ReadRawBinaryTest.cpp + ReadStlFileTest.cpp + ReadTextDataArrayTest.cpp + ReadVolumeGraphicsFileTest.cpp + ReadVtkStructuredPointsTest.cpp + RegularGridSampleSurfaceMeshTest.cpp + RemoveFlaggedFeaturesTest.cpp + RemoveFlaggedTrianglesTest.cpp + RemoveFlaggedVerticesTest.cpp + RequireMinimumSizeFeaturesTest.cpp + RenameDataObjectTest.cpp + ReplaceElementAttributesWithNeighborValuesTest.cpp ResampleImageGeomTest.cpp - - # ResampleRectGridToImageGeomTest.cpp - # ReverseTriangleWindingTest.cpp - # RobustAutomaticThresholdTest.cpp - # RotateSampleRefFrameTest.cpp - # ScalarSegmentFeaturesFilterTest.cpp - # SetImageGeomOriginScalingFilterTest.cpp - # SharedFeatureFaceTest.cpp - # SilhouetteTest.cpp - # SplitAttributeArrayTest.cpp - # SurfaceNetsTest.cpp - # TriangleCentroidTest.cpp - # TriangleDihedralAngleFilterTest.cpp - # TriangleNormalFilterTest.cpp - # UncertainRegularGridSampleSurfaceMeshTest.cpp - # WriteAbaqusHexahedronTest.cpp - # WriteASCIIDataTest.cpp - # WriteAvizoRectilinearCoordinateTest.cpp - # WriteAvizoUniformCoordinateTest.cpp - # WriteBinaryDataTest.cpp - # WriteFeatureDataCSVTest.cpp - # WriteLosAlamosFFTTest.cpp - # WriteStlFileTest.cpp - # WriteVtkRectilinearGridTest.cpp + ResampleRectGridToImageGeomTest.cpp + ReverseTriangleWindingTest.cpp + RobustAutomaticThresholdTest.cpp + RotateSampleRefFrameTest.cpp + ScalarSegmentFeaturesFilterTest.cpp + SetImageGeomOriginScalingFilterTest.cpp + SharedFeatureFaceTest.cpp + SilhouetteTest.cpp + SplitAttributeArrayTest.cpp + SurfaceNetsTest.cpp + TriangleCentroidTest.cpp + TriangleDihedralAngleFilterTest.cpp + TriangleNormalFilterTest.cpp + UncertainRegularGridSampleSurfaceMeshTest.cpp + WriteAbaqusHexahedronTest.cpp + WriteASCIIDataTest.cpp + WriteAvizoRectilinearCoordinateTest.cpp + WriteAvizoUniformCoordinateTest.cpp + WriteBinaryDataTest.cpp + WriteFeatureDataCSVTest.cpp + WriteLosAlamosFFTTest.cpp + WriteStlFileTest.cpp + WriteVtkRectilinearGridTest.cpp ) create_simplnx_plugin_unit_test(PLUGIN_NAME ${PLUGIN_NAME} diff --git a/src/Plugins/SimplnxCore/test/InterpolatePointCloudToRegularGridTest.cpp b/src/Plugins/SimplnxCore/test/InterpolatePointCloudToRegularGridTest.cpp index 3fe17783e0..54b789624f 100644 --- a/src/Plugins/SimplnxCore/test/InterpolatePointCloudToRegularGridTest.cpp +++ b/src/Plugins/SimplnxCore/test/InterpolatePointCloudToRegularGridTest.cpp @@ -5,8 +5,6 @@ #include -#include - #include namespace fs = std::filesystem; @@ -118,9 +116,6 @@ TEST_CASE("SimplnxCore::InterpolatePointCloudToRegularGridFilter: Valid Filter E auto executeResult = filter.execute(dataStructure, args); SIMPLNX_RESULT_REQUIRE_VALID(executeResult.result) - const auto& neighborList = dataStructure.getDataRefAs>(k_GaussianFaceAreasComputed); - std::cout << "InterpolatePointCloudToRegularGridFilter: " << neighborList.getStore()->xarray() << std::endl; - UnitTest::CompareNeighborLists(dataStructure, k_GaussianFaceAreasExemplar, k_GaussianFaceAreasComputed); UnitTest::CompareNeighborLists(dataStructure, k_GaussianVoxelIndicesExemplar, k_GaussianVoxelIndicesComputed); UnitTest::CompareNeighborLists(dataStructure, k_GaussianKernalDistancesExemplar, k_GaussianKernalDistancesComputed); diff --git a/src/Plugins/SimplnxCore/test/ResampleImageGeomTest.cpp b/src/Plugins/SimplnxCore/test/ResampleImageGeomTest.cpp index 876320def8..45804b2e3d 100644 --- a/src/Plugins/SimplnxCore/test/ResampleImageGeomTest.cpp +++ b/src/Plugins/SimplnxCore/test/ResampleImageGeomTest.cpp @@ -9,8 +9,6 @@ #include -#include - #include namespace fs = std::filesystem; diff --git a/src/simplnx/DataStructure/AbstractDataStore.hpp b/src/simplnx/DataStructure/AbstractDataStore.hpp index 32efb9715e..749e8869f8 100644 --- a/src/simplnx/DataStructure/AbstractDataStore.hpp +++ b/src/simplnx/DataStructure/AbstractDataStore.hpp @@ -9,6 +9,7 @@ #define NOMINMAX #include +#include #include #include @@ -38,7 +39,7 @@ class AbstractDataStore : public IDataStore using const_reference = const T&; using ShapeType = typename IDataStore::ShapeType; using index_type = uint64; - using XArrayType = typename xt::xarray; + using XArrayType = typename xt::xarray; using Iterator = typename XArrayType::iterator; using ConstIterator = typename XArrayType::const_iterator; @@ -240,7 +241,6 @@ class AbstractDataStore : public IDataStore totalSrcTuples * sourceNumComponents, destTupleOffset * numComponents, getSize())); } - return {}; auto srcBegin = source.begin() + (srcTupleOffset * sourceNumComponents); auto srcEnd = srcBegin + (totalSrcTuples * sourceNumComponents); auto dstBegin = begin() + (destTupleOffset * numComponents); @@ -401,6 +401,15 @@ class AbstractDataStore : public IDataStore * @brief Default constructor */ AbstractDataStore() = default; + AbstractDataStore(const AbstractDataStore& other) + : IDataStore(other) + { + } + + AbstractDataStore(AbstractDataStore&& other) + : IDataStore(std::move(other)) + { + } mutable std::mutex m_Mutex; }; diff --git a/src/simplnx/DataStructure/AbstractListStore.hpp b/src/simplnx/DataStructure/AbstractListStore.hpp index 53b11765cd..77e327e7dc 100644 --- a/src/simplnx/DataStructure/AbstractListStore.hpp +++ b/src/simplnx/DataStructure/AbstractListStore.hpp @@ -74,16 +74,16 @@ class AbstractListStore { usize listSize = getListSize(grainId); usize interalListSize = xtensorListSize(); - if(listSize >= interalListSize + 1) + if(listSize + 1 >= interalListSize) { - interalListSize *= 2; + interalListSize = listSize + 2; setXtensorListSize(interalListSize); } + std::lock_guard guard(m_Mutex); uint64 offset = (grainId * interalListSize); // First element is list size listSize++; - std::lock_guard guard(m_Mutex); auto& xarr = xarray(); xarr.flat(offset) = listSize; xarr.flat(offset + listSize) = value; @@ -150,7 +150,6 @@ class AbstractListStore */ virtual vector_type getList(int32 grainId) const { - return copyOfList(grainId); } @@ -414,7 +413,7 @@ class AbstractListStore uint64 internalCount = xtensorListSize(); uint64 offset = grainId * (internalCount); // First element is list size - xarray().flat(offset) = size; + xarray().flat(offset) = static_cast(size); } private: diff --git a/src/simplnx/DataStructure/DataStore.hpp b/src/simplnx/DataStructure/DataStore.hpp index 3ef2c8fef6..a773ba7395 100644 --- a/src/simplnx/DataStructure/DataStore.hpp +++ b/src/simplnx/DataStructure/DataStore.hpp @@ -143,7 +143,16 @@ class DataStore : public AbstractDataStore * @param rhs * @return */ - DataStore& operator=(DataStore&& rhs) = default; + DataStore& operator=(DataStore&& rhs) + { + m_ComponentShape = std::move(rhs.m_ComponentShape); + m_TupleShape = std::move(rhs.m_TupleShape); + m_Array = std::move(rhs.m_Array); + m_NumComponents = std::move(rhs.m_NumComponents); + m_NumTuples = std::move(rhs.m_NumTuples); + + return *this; + } ~DataStore() override = default; diff --git a/src/simplnx/DataStructure/ListStore.hpp b/src/simplnx/DataStructure/ListStore.hpp index e4695f760a..7a8cf2c72e 100644 --- a/src/simplnx/DataStructure/ListStore.hpp +++ b/src/simplnx/DataStructure/ListStore.hpp @@ -24,25 +24,41 @@ class ListStore : public AbstractListStore using const_iterator = typename parent_type::const_iterator; using shape_type = typename std::vector; + /** + * @brief Constructs a ListStore using the specified tuple shape and list size. + * @param tupleShape + * @param listSize + */ ListStore(shape_type tupleShape, usize listSize = 10) : parent_type() , m_XtensorListSize(listSize) { - tupleShape.push_back(listSize); - m_Array = std::make_shared(xarray_type::from_shape(tupleShape)); - m_Array->fill(0); + setSize(tupleShape, listSize); } + + /** + * @brief Creates a ListStore from a vector of vectors. + * @param vectors + */ ListStore(const typename std::vector& vectors) : parent_type() { this->setData(vectors); } - ListStore(const ListStore& copy) - : parent_type(copy) - , m_Array(copy.m_Array) - , m_XtensorListSize(copy.m_XtensorListSize) + + /** + * @brief Copy constructor + */ + ListStore(const ListStore& other) + : parent_type(other) + , m_XtensorListSize(other.m_XtensorListSize) { + parent_type::copy(other); } + + /** + * @brief Move constructor + */ ListStore(ListStore&& copy) noexcept : parent_type(std::move(copy)) , m_Array(std::move(copy.m_Array)) @@ -51,81 +67,124 @@ class ListStore : public AbstractListStore } ~ListStore() = default; + /** + * @brief Returns a reference to the underlying xtensor array. + * @return xarray_type& + */ xarray_type& xarray() override { return *m_Array.get(); } + + /** + * @brief Returns a const reference to the underlying xtensor array. + * @return const xarray_type& + */ const xarray_type& xarray() const override { return *m_Array.get(); } + /** + * @brief Returns a copy of the current list store. + * @return std::unique> + */ std::unique_ptr deepCopy() const override { return std::make_unique(*this); } - //void resizeTuples(std::vector tupleShape) override - //{ - // resize(tupleShape, m_XtensorListSize); - //} - protected: + /** + * @brief Resizes the xtensor array for the specified tuple dimensions and internal list size. + * Copies values from the current array. + * @param tupleShape + * @param internalSize + */ void resize(std::vector tupleShape, usize internalSize) override { std::lock_guard guard(this->m_Mutex); usize numTuples = this->getNumberOfLists(); usize newTupleCount = std::accumulate(tupleShape.begin(), tupleShape.end(), static_cast(1), std::multiplies()); + + // Avoid size 0 + if(newTupleCount == 0) + { + tupleShape = {1}; + newTupleCount = 1; + } + if(internalSize == 0) + { + internalSize = 1; + } std::vector newShape = tupleShape; newShape.push_back(internalSize); - auto xarr = std::make_shared(xarray_type::from_shape(newShape)); - - for(usize tuple = 0; tuple < numTuples && tuple < newTupleCount; tuple++) + xarray_type xarr = xt::zeros(newShape); + if(m_Array != nullptr) { - usize offset = tuple * (internalSize); - usize offset2 = tuple * (m_XtensorListSize); - for(usize i = 0; i < m_XtensorListSize && i < internalSize; i++) + for(usize tuple = 0; tuple < numTuples && tuple < newTupleCount; tuple++) { - auto value = m_Array->flat(offset2 + i); - xarr->flat(offset + i) = value; - } - } - if(numTuples < newTupleCount) - { - // Initialize with zero length Vectors - for(usize i = numTuples; i < newTupleCount; i++) - { - xarr->flat(i * internalSize) = 0; + usize offset = tuple * (internalSize); // New xarray + usize offset2 = tuple * (m_XtensorListSize); // Current xarray + // Copy individual list at tuple + for(usize i = 0; i < m_XtensorListSize && i < internalSize; i++) + { + auto value = m_Array->flat(offset2 + i); + xarr.flat(offset + i) = value; + } } } this->m_TupleShape = tupleShape; m_XtensorListSize = internalSize; - m_Array = xarr; + m_Array = std::make_shared(std::move(xarr)); } + /** + * @brief Creates a new internal xtensor array using the specified tuple shpae and internal list size. + * All array values are set to 0. + * @param tupleShape + * @param internalSize + */ void setSize(std::vector tupleShape, usize internalSize) override { usize numTuples = this->getNumberOfLists(); usize newTupleCount = std::accumulate(tupleShape.begin(), tupleShape.end(), static_cast(1), std::multiplies()); + // Avoid size 0 + if (newTupleCount == 0) + { + tupleShape = {1}; + newTupleCount = 1; + } + if (internalSize == 0) + { + internalSize = 1; + } + std::vector newShape = tupleShape; newShape.push_back(internalSize); + std::lock_guard guard(this->m_Mutex); this->m_TupleShape = tupleShape; m_XtensorListSize = internalSize; - m_Array = std::make_shared(xarray_type::from_shape(newShape)); + xarray_type xarr = xt::zeros(newShape); + m_Array = std::make_shared(std::move(xarr)); } + /** + * @brief Returns the list size used for the xtensor list dimension. + * @return usize + */ usize xtensorListSize() const override { return m_XtensorListSize; } private: - std::shared_ptr m_Array; + std::shared_ptr m_Array = nullptr; usize m_XtensorListSize = 10; }; } // namespace nx::core diff --git a/src/simplnx/DataStructure/NeighborList.cpp b/src/simplnx/DataStructure/NeighborList.cpp index 17e68adfcd..ab85414be8 100644 --- a/src/simplnx/DataStructure/NeighborList.cpp +++ b/src/simplnx/DataStructure/NeighborList.cpp @@ -47,6 +47,35 @@ NeighborList* NeighborList::Import(DataStructure& dataStructure, const std return data.get(); } +template +NeighborList::NeighborList(const NeighborList& other) +: INeighborList(other) +, m_Store(other.m_Store) +, m_IsAllocated(other.m_IsAllocated) +, m_InitValue(other.m_InitValue) +{ +} + +template +NeighborList& NeighborList::operator=(const NeighborList& rhs) +{ + m_Store->copy(*rhs.m_Store.get()); + m_IsAllocated = rhs.m_IsAllocated; + m_InitValue = rhs.m_InitValue; + + return *this; +} + +template +NeighborList& NeighborList::operator=(NeighborList&& rhs) +{ + m_Store = std::move(rhs.m_Store); + m_IsAllocated = std::move(rhs.m_IsAllocated); + m_InitValue = std::move(rhs.m_InitValue); + + return *this; +} + template DataObject* NeighborList::shallowCopy() { @@ -127,8 +156,8 @@ int32 NeighborList::eraseTuples(const std::vector& idxs) } } } - setNumberOfTuples(m_Store->size()); m_Store = std::move(copy); + setNumberOfTuples(m_Store->size()); return err; } @@ -212,6 +241,8 @@ void NeighborList::resizeTuples(usize numTuples) template void NeighborList::addEntry(int32 grainId, value_type value) { + std::lock_guard guard(this->m_Mutex); + if(grainId >= static_cast(m_Store->size())) { usize old = m_Store->size(); @@ -222,9 +253,9 @@ void NeighborList::addEntry(int32 grainId, value_type value) { m_Store->setList(i, SharedVectorType(new VectorType)); } - setNumberOfTuples(m_Store->size()); } m_Store->addEntry(grainId, value); + setNumberOfTuples(m_Store->size()); } template @@ -237,16 +268,13 @@ void NeighborList::clearAllLists() template void NeighborList::setList(int32 grainId, const SharedVectorType& neighborList) { + std::lock_guard guard(this->m_Mutex); + if(grainId >= static_cast(m_Store->size())) { usize old = m_Store->size(); m_Store->resizeTuples(grainId + 1); m_IsAllocated = true; - // Initialize with zero length Vectors - for(usize i = old; i < m_Store->size(); ++i) - { - m_Store->setList(i, SharedVectorType(new VectorType)); - } } m_Store->setList(grainId, neighborList); } diff --git a/src/simplnx/DataStructure/NeighborList.hpp b/src/simplnx/DataStructure/NeighborList.hpp index 095fd189cb..c1ed21c3b4 100644 --- a/src/simplnx/DataStructure/NeighborList.hpp +++ b/src/simplnx/DataStructure/NeighborList.hpp @@ -5,6 +5,8 @@ #include "simplnx/DataStructure/AbstractListStore.hpp" #include "simplnx/DataStructure/INeighborList.hpp" +#include + namespace nx::core { namespace NeighborListConstants @@ -199,10 +201,10 @@ class NeighborList : public INeighborList T getValue(int32 grainId, int32 index, bool& ok) const; /** - * @brief Sets the value at the given index using mutex locks. - * @param index - * @param value - */ + * @brief Sets the value at the given index using mutex locks. + * @param index + * @param value + */ void setValue(usize index, const VectorType& value); /** @@ -347,8 +349,15 @@ class NeighborList : public INeighborList */ void resizeTuples(const std::vector& tupleShape) override; + /** + * @brief Returns a shared_ptr to the underlying list store. + * @return std::shared_ptr + */ std::shared_ptr getStore() const; + /** + * @brief Returns a vector of vectors containing the current values. + */ std::vector getVectors() const; iterator begin(); @@ -358,6 +367,9 @@ class NeighborList : public INeighborList const_iterator cbegin() const; const_iterator cend() const; + NeighborList& operator=(const NeighborList& rhs); + NeighborList& operator=(NeighborList&& rhs); + protected: /** * @brief NeighborList @@ -369,9 +381,11 @@ class NeighborList : public INeighborList */ NeighborList(DataStructure& dataStructure, const std::string& name, const std::vector& dataVector, IdType importId); + NeighborList(const NeighborList& other); + private: std::shared_ptr m_Store; - // std::vector m_Array; + mutable std::mutex m_Mutex; bool m_IsAllocated; value_type m_InitValue; }; diff --git a/src/simplnx/DataStructure/StringStore.cpp b/src/simplnx/DataStructure/StringStore.cpp index 12b3e3dd30..291b2791b0 100644 --- a/src/simplnx/DataStructure/StringStore.cpp +++ b/src/simplnx/DataStructure/StringStore.cpp @@ -39,6 +39,7 @@ void StringStore::resize(usize count) { data.flat(i) = m_xarray.flat(i); } + m_xarray.resize({count}); m_xarray = std::move(data); } diff --git a/src/simplnx/DataStructure/StringStore.hpp b/src/simplnx/DataStructure/StringStore.hpp index 8ac7fe8410..10aa46edcc 100644 --- a/src/simplnx/DataStructure/StringStore.hpp +++ b/src/simplnx/DataStructure/StringStore.hpp @@ -21,6 +21,6 @@ class StringStore : public AbstractStringStore AbstractStringStore& operator=(const std::vector& values) override; private: - xt::xarray m_xarray; + xarray_type m_xarray; }; } // namespace nx::core diff --git a/src/simplnx/Utilities/GeometryHelpers.hpp b/src/simplnx/Utilities/GeometryHelpers.hpp index f5270b8a9a..0785087f4b 100644 --- a/src/simplnx/Utilities/GeometryHelpers.hpp +++ b/src/simplnx/Utilities/GeometryHelpers.hpp @@ -9,8 +9,6 @@ #include -#include - namespace nx::core { namespace GeometryHelpers @@ -150,8 +148,6 @@ ErrorCode FindElementNeighbors(const DataArray* elemList, const DynamicListAr // Reuse this vector for each loop. Avoids re-allocating the memory each time through the loop std::vector loop_neighbors(32, 0); - std::cout << elems.getDataStoreRef().xarray() << std::endl; - // Build up the element adjacency list now that we have the element links for(usize t = 0; t < numElems; ++t) { @@ -174,7 +170,6 @@ ErrorCode FindElementNeighbors(const DataArray* elemList, const DynamicListAr continue; } // We already added this element so loop again // qDebug() << " Comparing Element " << vertIdxs[vt] << "\n"; - const auto vertId = vertIdxs[vt]; auto vertCell = elemList->cbegin() + (vertIdxs[vt] * elemList->getNumberOfComponents()); usize vCount = 0; // Loop over all the vertex indices of this element and try to match numSharedVerts of them to the current loop element diff --git a/test/DataArrayTest.cpp b/test/DataArrayTest.cpp index f5d60832ca..ebc5068690 100644 --- a/test/DataArrayTest.cpp +++ b/test/DataArrayTest.cpp @@ -7,8 +7,6 @@ #include -#include - #include #include #include @@ -78,14 +76,12 @@ TEST_CASE("nx::core::DataArray Copy TupleTest", "[simplnx][DataArray]") { dataArray.initializeTuple(i, static_cast(i)); } - std::cout << dataArray.getDataStoreRef().xarray() << std::endl; for(usize tupleIndex = 0; tupleIndex < k_NumTuples; tupleIndex++) { for(usize componentIndex = 0; componentIndex < k_NumComponents; componentIndex++) { uint64 index = tupleIndex * 3 + componentIndex; - // std::cout << "Array index: " << index << " : " << dataArray[index] << std::endl; REQUIRE(dataArray[index] == static_cast(tupleIndex)); } } diff --git a/test/UnitTestCommon/include/simplnx/UnitTest/UnitTestCommon.hpp b/test/UnitTestCommon/include/simplnx/UnitTest/UnitTestCommon.hpp index 555c7ee061..da23262007 100644 --- a/test/UnitTestCommon/include/simplnx/UnitTest/UnitTestCommon.hpp +++ b/test/UnitTestCommon/include/simplnx/UnitTest/UnitTestCommon.hpp @@ -680,7 +680,7 @@ void CompareNeighborLists(const DataStructure& dataStructure, const DataPath& ex float diff = std::fabs(static_cast(exemplaryVal - computedVal)); INFO(fmt::format("Bad Neighborlist Comparison\n Exemplary NeighborList:'{}' size:{}\n Computed NeighborList: '{}' size:{} ", exemplaryDataPath.toString(), exemplary.size(), computedPath.toString(), computed.size())); - INFO(fmt::format(" NeighborList {}, Index {} Exemplary Value: {} Computed Value: {}", i, j, exemplaryVal, computedVal)) + INFO(fmt::format(" NeighborList {}, Index {} Exemplary Value: {} Computed Value: {}", i, j, exemplaryVal, computedVal)); REQUIRE(diff < EPSILON); break;