diff --git a/dune/iga/io/ibra/ibrareader.hh b/dune/iga/io/ibra/ibrareader.hh index 4046e956..d3c6add5 100644 --- a/dune/iga/io/ibra/ibrareader.hh +++ b/dune/iga/io/ibra/ibrareader.hh @@ -28,7 +28,7 @@ namespace Dune::IGA { using PatchData = Dune::IGA::NURBSPatchData; using ControlPointNetType = Dune::IGA::MultiDimensionNet; - static std::shared_ptr read(const std::string& fileName, const bool trim = true, + static std::unique_ptr read(const std::string& fileName, const bool trim = true, std::array elevateDegree = {0, 0}, std::array preKnotRefine = {0, 0}, std::array postKnotRefine = {0, 0}) { @@ -40,7 +40,7 @@ namespace Dune::IGA { template requires(not std::convertible_to< std::string, InputStringType> and not std::convertible_to) static std:: - shared_ptr read(InputStringType& ibraInputFile, const bool trim = true, + unique_ptr read(InputStringType& ibraInputFile, const bool trim = true, std::array elevateDegree = {0, 0}, std::array preKnotRefine = {0, 0}, std::array postKnotRefine = {0, 0}) { using json = nlohmann::json; @@ -129,9 +129,9 @@ namespace Dune::IGA { auto trimData = constructGlobalBoundaries(brep); if (trim) - return std::make_shared(_patchData, trimData); + return std::make_unique(_patchData, trimData); else - return std::make_shared(_patchData); + return std::make_unique(_patchData); } private: diff --git a/dune/iga/test/trimmedGridTests.cc b/dune/iga/test/trimmedGridTests.cc index ffd75b04..9b59ca21 100644 --- a/dune/iga/test/trimmedGridTests.cc +++ b/dune/iga/test/trimmedGridTests.cc @@ -178,7 +178,7 @@ auto testPatchGeometrySurface() { auto testIbraReader() { TestSuite t; - std::shared_ptr> grid = IbraReader<2, 2>::read("auxiliaryFiles/element.ibra"); + auto grid = IbraReader<2, 2>::read("auxiliaryFiles/element.ibra"); // Check n_ele = 1, n_vert = 4 t.check(grid->size(0) == 1); @@ -202,7 +202,7 @@ auto testIbraReader() { t.check(ele.geometry().center() == expectedElementCenters[indexSet.index(ele)]); // Test Instantiation - std::shared_ptr> grid3D = IbraReader<2, 3>::read("auxiliaryFiles/shell.ibra"); + auto grid3D = IbraReader<2, 3>::read("auxiliaryFiles/shell.ibra"); grid3D->globalRefine(2); return t; @@ -217,7 +217,7 @@ auto testDataCollectorAndVtkWriter() { std::vector geometries{"element_trim_xb", "surface-hole"}; for (auto& fileName : geometries) { - std::shared_ptr> grid = IbraReader<2, 2>::read("auxiliaryFiles/" + fileName + ".ibra"); + auto grid = IbraReader<2, 2>::read("auxiliaryFiles/" + fileName + ".ibra"); for (auto r : std::views::iota(0, 4)) { if (r > 0) grid->globalRefine(1); @@ -334,7 +334,7 @@ auto testMapsInTrimmedPatch() { } // Load next example Grid - std::shared_ptr> grid2 = IbraReader<2, 2>::read("auxiliaryFiles/element_trim_xb.ibra"); + auto grid2 = IbraReader<2, 2>::read("auxiliaryFiles/element_trim_xb.ibra"); grid2->globalRefine(1); auto& patch_2_1 = grid2->getPatch(); @@ -396,7 +396,7 @@ auto testIntegrationPoints() { /// 1. test case A = 10 * 10, r = 3 auto targetArea = 10 * 10 - (std::numbers::pi * std::pow(3, 2)); - std::shared_ptr> grid = IbraReader<2, 2>::read("auxiliaryFiles/surface-hole.ibra"); + auto grid = IbraReader<2, 2>::read("auxiliaryFiles/surface-hole.ibra"); grid->globalRefine(1); double area = calculateArea(grid->leafGridView(), std::nullopt); @@ -422,7 +422,7 @@ auto testIntegrationPoints() { targetArea = 20 * 2 - (std::numbers::pi * std::pow(0.3, 2)); std::cout << "Grid 2 \n"; - std::shared_ptr> grid2 = IbraReader<2, 2>::read("auxiliaryFiles/infty_pwh.ibra"); + auto grid2 = IbraReader<2, 2>::read("auxiliaryFiles/infty_pwh.ibra"); grid2->globalRefine(1); area = calculateArea(grid2->leafGridView()); @@ -454,7 +454,7 @@ auto testNurbsBasis() { } }; - std::shared_ptr> grid = IbraReader<2, 2>::read("auxiliaryFiles/element_trim_xb.ibra"); + auto grid = IbraReader<2, 2>::read("auxiliaryFiles/element_trim_xb.ibra"); runBasisChecks(grid, 4); grid = IbraReader<2, 2>::read("auxiliaryFiles/element_trim_xb.ibra", true, {1, 1});