From a2274d74e4c5030558739c4fd813a6ea2d6bed22 Mon Sep 17 00:00:00 2001 From: David Moxey Date: Mon, 19 Jun 2017 13:05:40 +0100 Subject: [PATCH] Fix rest of solvers, utilities and libraries, and add HashUtils to fix some issues with C++11 unordered data structures --- library/Collections/Collection.h | 10 +- .../ProcessModules/ProcessDisplacement.cpp | 3 +- library/LibUtilities/BasicUtils/HashUtils.hpp | 103 +++++++++++ library/LibUtilities/CMakeLists.txt | 1 + .../TimeIntegration/TimeIntegrationScheme.h | 25 +-- .../AssemblyMap/AssemblyMapCG.cpp | 6 +- .../AssemblyMap/AssemblyMapDG.cpp | 5 +- library/NekMeshUtils/MeshElements/Edge.h | 10 +- library/NekMeshUtils/MeshElements/Face.h | 3 +- .../NekMeshUtils/MeshElements/HOAlignment.h | 8 +- library/NekMeshUtils/MeshElements/Node.h | 7 +- .../NekMeshUtils/MeshElements/Tetrahedron.cpp | 3 +- library/SolverUtils/Advection/Advection.h | 11 +- .../Advection/Advection3DHomogeneous1D.cpp | 4 +- library/SolverUtils/Advection/AdvectionFR.cpp | 4 +- library/SolverUtils/AdvectionSystem.h | 2 +- library/SolverUtils/Diffusion/Diffusion.h | 22 ++- .../SolverUtils/Diffusion/DiffusionLDGNS.h | 2 +- .../SolverUtils/Diffusion/DiffusionLFR.cpp | 4 +- .../SolverUtils/Diffusion/DiffusionLFRNS.h | 2 +- library/SolverUtils/Driver.h | 2 +- library/SolverUtils/EquationSystem.cpp | 1 - library/SolverUtils/EquationSystem.h | 15 +- library/SolverUtils/Filters/Filter.h | 2 +- .../SolverUtils/Filters/FilterAeroForces.cpp | 6 +- .../SolverUtils/Filters/FilterAeroForces.h | 2 +- .../Filters/FilterFieldConvert.cpp | 2 +- .../Filters/FilterHistoryPoints.cpp | 2 +- library/SolverUtils/Forcing/Forcing.h | 2 +- .../SolverUtils/Forcing/ForcingProgrammatic.h | 2 +- .../RiemannSolvers/RiemannSolver.h | 21 +-- library/SpatialDomains/GeomFactors.h | 10 +- library/SpatialDomains/Geometry.h | 6 +- library/StdRegions/StdMatrixKey.cpp | 6 +- library/UnitTests/BlockMatrixUnitTests.cpp | 80 ++++----- .../TestBandedMatrixOperations.cpp | 12 +- .../LinearAlgebra/TestBlockMatrix.cpp | 160 +++++++++--------- .../LinearAlgebra/TestCanGetRawPtr.cpp | 10 +- .../LinearAlgebra/TestCombinationRunner.h | 49 +++--- .../LinearAlgebra/TestDgemmOptimizations.cpp | 18 +- .../TestDiagonalMatrixOperations.cpp | 2 +- .../TestDiagonalMatrixStoragePolicy.cpp | 10 +- .../TestFullMatrixOperations.cpp | 2 +- .../TestFullMatrixStoragePolicy.cpp | 26 +-- ...TestLowerTriangularMatrixStoragePolicy.cpp | 20 +-- .../TestScaledBlockMatrixOperations.cpp | 44 ++--- .../LinearAlgebra/TestScaledMatrix.cpp | 56 +++--- .../LinearAlgebra/TestStandardMatrix.cpp | 16 +- .../TestSymmetricMatrixStoragePolicy.cpp | 28 +-- .../TestTriangularMatrixOperations.cpp | 4 +- ...TestUpperTriangularMatrixStoragePolicy.cpp | 20 +-- .../TestConsistentObjectAccess.cpp | 44 ++--- .../TestNekMatrixMultiplication.cpp | 8 +- .../LibUtilities/TestNekMatrixOperations.cpp | 105 ++++++------ .../UnitTests/LibUtilities/TestRawType.cpp | 121 ++++++++----- .../UnitTests/LocalRegions/TestGetCoords.cpp | 4 +- .../UnitTests/Memory/TestNekMemoryManager.cpp | 12 +- library/UnitTests/ScaledMatrixUnitTests.cpp | 24 +-- library/UnitTests/testBoostUtil.cpp | 6 +- library/UnitTests/testLinearSystem.cpp | 42 ++--- library/UnitTests/testNekManager.cpp | 20 +-- library/UnitTests/testNekMatrix.cpp | 131 ++------------ library/UnitTests/testNekSharedArray.cpp | 6 +- library/UnitTests/testNekVector.cpp | 8 +- .../ADRSolver/EquationSystems/CFLtester.cpp | 4 +- .../CardiacEPSolver/CellModels/CellModel.h | 2 +- .../EquationSystems/Bidomain.cpp | 4 +- .../EquationSystems/BidomainRoth.cpp | 4 +- .../EquationSystems/Monodomain.cpp | 8 +- solvers/CardiacEPSolver/Stimuli/Protocol.h | 2 +- solvers/CardiacEPSolver/Stimuli/Stimulus.h | 2 +- .../CellMLToNektarTranslator.py | 24 +-- .../ArtificialDiffusion/ArtificialDiffusion.h | 2 +- .../BoundaryConditions/CFSBndCond.h | 2 +- .../Misc/VariableConverter.h | 2 +- .../AdvectionTerms/LinearisedAdvection.h | 2 +- .../EquationSystems/CoupledLinearNS.h | 1 - .../CoupledLocalToGlobalC0ContMap.h | 2 +- .../EquationSystems/Extrapolate.cpp | 6 +- .../EquationSystems/Extrapolate.h | 4 +- .../EquationSystems/IncNavierStokes.cpp | 2 +- .../EquationSystems/IncNavierStokes.h | 4 +- .../EquationSystems/MappingExtrapolate.h | 2 +- .../EquationSystems/StandardExtrapolate.h | 2 +- .../EquationSystems/SubSteppingExtrapolate.h | 2 +- .../SubSteppingExtrapolateWeakPressure.h | 2 +- .../EquationSystems/VCSMapping.h | 2 +- .../VelocityCorrectionScheme.h | 2 +- .../VelocityCorrectionSchemeWeakPressure.h | 2 +- .../EquationSystems/WeakPressureExtrapolate.h | 2 +- .../Filters/FilterMovingBody.h | 2 +- .../Utilities/Aliasing.cpp | 4 +- .../Utilities/NonLinearEnergy.cpp | 4 +- .../EquationSystems/CoupledAssemblyMap.cpp | 3 +- .../EquationSystems/CoupledAssemblyMap.h | 2 +- .../EquationSystems/LinearElasticSystem.cpp | 4 +- .../EquationSystems/ArterialPressureArea.h | 2 +- .../EquationSystems/LymphaticPressureArea.h | 2 +- .../EquationSystems/PulseWaveBoundary.h | 2 +- .../EquationSystems/PulseWavePressureArea.h | 2 +- .../EquationSystems/PulseWaveSystem.h | 4 +- .../PulseWaveSolver/EquationSystems/QInflow.h | 2 +- .../EquationSystems/RCROutflow.h | 2 +- .../EquationSystems/ROutflow.h | 2 +- .../EquationSystems/TerminalOutflow.h | 2 +- .../EquationSystems/TimeDependentInflow.h | 2 +- .../EquationSystems/UndefinedInOutflow.h | 2 +- .../PulseWaveSolver/Utilities/Fld2Tecplot.cpp | 2 +- .../Utilities/PulseWaveSystemOutput.h | 2 +- .../CalcL2ToLinfPressure.cpp | 1 - .../VortexWaveInteraction.cpp | 4 +- .../utilities/ExpandMeshByRotation.cpp | 4 +- .../utilities/MeshMove.cpp | 4 +- tests/Metric.h | 2 +- utilities/Extras/FldCalcBCs.cpp | 18 +- utilities/Extras/VtkToFld.cpp | 16 +- utilities/FieldConvert/FieldConvert.cpp | 8 +- utilities/FldAddMultiShear.cpp | 8 +- utilities/FldAddScalGrad.cpp | 2 +- utilities/FldAddScalGrad_elmt.cpp | 2 +- utilities/FldAddWSS.cpp | 2 +- utilities/NekMesh/InputModules/InputGmsh.cpp | 20 +-- utilities/NekMesh/InputModules/InputNek.cpp | 34 ++-- .../NekMesh/InputModules/InputNek5000.cpp | 5 +- utilities/NekMesh/InputModules/InputNekpp.cpp | 131 ++++++-------- utilities/NekMesh/InputModules/InputPly.cpp | 2 +- utilities/NekMesh/InputModules/InputPly.h | 2 +- utilities/NekMesh/InputModules/InputSem.cpp | 6 +- utilities/NekMesh/InputModules/InputStar.cpp | 2 +- .../NekMesh/InputModules/InputStarTec.cpp | 2 +- utilities/NekMesh/InputModules/InputSwan.cpp | 2 +- utilities/NekMesh/InputModules/InputSwan.h | 2 +- utilities/NekMesh/InputModules/InputVtk.cpp | 2 +- utilities/NekMesh/NekMesh.cpp | 4 +- .../NekMesh/OutputModules/OutputGmsh.cpp | 4 +- utilities/NekMesh/OutputModules/OutputGmsh.h | 13 +- .../NekMesh/OutputModules/OutputNekpp.cpp | 4 +- utilities/NekMesh/OutputModules/OutputNekpp.h | 2 +- utilities/NekMesh/OutputModules/OutputSTL.h | 2 +- utilities/NekMesh/OutputModules/OutputVtk.h | 2 +- .../NekMesh/ProcessModules/ProcessBL.cpp | 20 +-- utilities/NekMesh/ProcessModules/ProcessBL.h | 2 +- .../NekMesh/ProcessModules/ProcessCurve.h | 2 +- utilities/NekMesh/ProcessModules/ProcessCyl.h | 2 +- .../ProcessModules/ProcessDetectSurf.h | 2 +- .../ProcessModules/ProcessExtractSurf.cpp | 2 +- .../ProcessModules/ProcessExtractSurf.h | 2 +- .../ProcessExtractTetPrismInterface.h | 2 +- .../NekMesh/ProcessModules/ProcessExtrude.cpp | 4 +- .../NekMesh/ProcessModules/ProcessExtrude.h | 2 +- .../ProcessModules/ProcessInsertSurface.cpp | 4 +- .../ProcessModules/ProcessInsertSurface.h | 2 +- utilities/NekMesh/ProcessModules/ProcessJac.h | 2 +- .../NekMesh/ProcessModules/ProcessLinear.cpp | 6 +- .../NekMesh/ProcessModules/ProcessLinear.h | 2 +- .../NekMesh/ProcessModules/ProcessLinkCheck.h | 2 +- .../ProcessModules/ProcessOptiExtract.cpp | 6 +- .../ProcessModules/ProcessOptiExtract.h | 2 +- .../ProcessModules/ProcessPerAlign.cpp | 2 +- .../NekMesh/ProcessModules/ProcessPerAlign.h | 2 +- .../NekMesh/ProcessModules/ProcessScalar.h | 2 +- .../ProcessModules/ProcessSpherigon.cpp | 16 +- .../NekMesh/ProcessModules/ProcessSpherigon.h | 2 +- .../ProcessModules/ProcessTetSplit.cpp | 2 +- .../NekMesh/ProcessModules/ProcessTetSplit.h | 2 +- .../ProcessModules/ProcessVarOpti/ElUtil.cpp | 2 +- .../ProcessModules/ProcessVarOpti/ElUtil.h | 8 +- .../ProcessModules/ProcessVarOpti/NodeOpti.h | 7 +- .../ProcessVarOpti/NodeOptiCAD.cpp | 2 +- .../ProcessVarOpti/PreProcessing.cpp | 10 +- .../ProcessVarOpti/ProcessVarOpti.cpp | 4 +- .../ProcessVarOpti/ProcessVarOpti.h | 6 +- 172 files changed, 986 insertions(+), 1001 deletions(-) create mode 100644 library/LibUtilities/BasicUtils/HashUtils.hpp diff --git a/library/Collections/Collection.h b/library/Collections/Collection.h index 8c6b7a738..401c51346 100644 --- a/library/Collections/Collection.h +++ b/library/Collections/Collection.h @@ -38,6 +38,7 @@ #include +#include #include #include #include @@ -49,15 +50,6 @@ namespace Nektar { namespace Collections { -struct EnumHash -{ - template - std::size_t operator()(T t) const - { - return static_cast(t); - } -}; - /** * @brief Collection */ diff --git a/library/FieldUtils/ProcessModules/ProcessDisplacement.cpp b/library/FieldUtils/ProcessModules/ProcessDisplacement.cpp index ec12da2fa..f3f4fe4b0 100644 --- a/library/FieldUtils/ProcessModules/ProcessDisplacement.cpp +++ b/library/FieldUtils/ProcessModules/ProcessDisplacement.cpp @@ -39,6 +39,7 @@ using namespace std; #include "ProcessDisplacement.h" +#include #include #include #include @@ -72,7 +73,7 @@ struct TriFaceHash : std::unary_function ids[2] = p.c; std::sort(ids.begin(), ids.end()); - return boost::hash_range(ids.begin(), ids.end()); + return hash_combine(ids[0], ids[1], ids[2]); } }; diff --git a/library/LibUtilities/BasicUtils/HashUtils.hpp b/library/LibUtilities/BasicUtils/HashUtils.hpp new file mode 100644 index 000000000..8d3468a72 --- /dev/null +++ b/library/LibUtilities/BasicUtils/HashUtils.hpp @@ -0,0 +1,103 @@ +/////////////////////////////////////////////////////////////////////////////// +// +// File SessionReader.cpp +// +// For more information, please see: http://www.nektar.info +// +// The MIT License +// +// Copyright (c) 2006 Division of Applied Mathematics, Brown University (USA), +// Department of Aeronautics, Imperial College London (UK), and Scientific +// Computing and Imaging Institute, University of Utah (USA). +// +// License for the specific language governing rights and limitations under +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the "Software"), +// to deal in the Software without restriction, including without limitation +// the rights to use, copy, modify, merge, publish, distribute, sublicense, +// and/or sell copies of the Software, and to permit persons to whom the +// Software is furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS +// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +// DEALINGS IN THE SOFTWARE. +// +// Description: Session reader +// +/////////////////////////////////////////////////////////////////////////////// + +#ifndef LIBUTILITIES_BASICUTILS_HASHUTILS +#define LIBUTILITIES_BASICUTILS_HASHUTILS + +#include + +namespace Nektar +{ + +inline void hash_combine(std::size_t& seed) +{ +} + +template +inline void hash_combine(std::size_t& seed, const T& v, Args... args) +{ + std::hash hasher; + seed ^= hasher(v) + 0x9e3779b9 + (seed << 6) + (seed >> 2); + hash_combine(seed, args...); +} + +template +inline std::size_t hash_combine(const T& v, Args... args) +{ + std::size_t seed; + hash_combine(seed, args...); + return seed; +} + +template +std::size_t hash_range(Iter first, Iter last) +{ + std::size_t seed = 0; + for(; first != last; ++first) + { + hash_combine(seed, *first); + } + return seed; +} + +template +void hash_range(std::size_t &seed, Iter first, Iter last) +{ + hash_combine(seed, hash_range(first, last)); +} + +struct EnumHash +{ + template + std::size_t operator()(T t) const + { + return static_cast(t); + } +}; + +struct PairHash { + template + std::size_t operator()(const std::pair &p) const + { + std::size_t seed = 0; + auto h1 = std::hash{}(p.first); + auto h2 = std::hash{}(p.second); + hash_combine(seed, h1, h2); + return seed; + } +}; + +} +#endif diff --git a/library/LibUtilities/CMakeLists.txt b/library/LibUtilities/CMakeLists.txt index 58913762f..f1fc4f482 100644 --- a/library/LibUtilities/CMakeLists.txt +++ b/library/LibUtilities/CMakeLists.txt @@ -16,6 +16,7 @@ SET(BasicUtilsHeaders ./BasicUtils/FieldIOXml.h ./BasicUtils/FileSystem.h ./BasicUtils/ErrorUtil.hpp + ./BasicUtils/HashUtils.hpp ./BasicUtils/MeshEntities.hpp ./BasicUtils/MeshPartition.h ./BasicUtils/MeshPartitionMetis.h diff --git a/library/LibUtilities/TimeIntegration/TimeIntegrationScheme.h b/library/LibUtilities/TimeIntegration/TimeIntegrationScheme.h index 372c1f588..206a6b58d 100644 --- a/library/LibUtilities/TimeIntegration/TimeIntegrationScheme.h +++ b/library/LibUtilities/TimeIntegration/TimeIntegrationScheme.h @@ -183,36 +183,41 @@ namespace Nektar template void DefineOdeRhs(FuncPointerT func, ObjectPointerT obj) { - using namespace std::placeholders; - m_functors1[0] = std::bind(func, obj, _1, _2, _3); + m_functors1[0] = std::bind( + func, obj, std::placeholders::_1, std::placeholders::_2, + std::placeholders::_3); } template void DefineOdeExplicitRhs(FuncPointerT func, ObjectPointerT obj) { - using namespace std::placeholders; - m_functors1[1] = std::bind(func, obj, _1, _2, _3); + m_functors1[1] = std::bind( + func, obj, std::placeholders::_1, std::placeholders::_2, + std::placeholders::_3); } template void DefineOdeImplicitRhs(FuncPointerT func, ObjectPointerT obj) { - using namespace std::placeholders; - m_functors1[2] = std::bind(func, obj, _1, _2, _3); + m_functors1[2] = std::bind( + func, obj, std::placeholders::_1, std::placeholders::_2, + std::placeholders::_3); } template void DefineProjection(FuncPointerT func, ObjectPointerT obj) { - using namespace std::placeholders; - m_functors1[3] = std::bind(func, obj, _1, _2, _3); + m_functors1[3] = std::bind( + func, obj, std::placeholders::_1, std::placeholders::_2, + std::placeholders::_3); } template void DefineImplicitSolve(FuncPointerT func, ObjectPointerT obj) { - using namespace std::placeholders; - m_functors2[0] = std::bind(func, obj, _1, _2, _3, _4); + m_functors2[0] = std::bind( + func, obj, std::placeholders::_1, std::placeholders::_2, + std::placeholders::_3, std::placeholders::_4); } diff --git a/library/MultiRegions/AssemblyMap/AssemblyMapCG.cpp b/library/MultiRegions/AssemblyMap/AssemblyMapCG.cpp index 2dfe37cdf..517d89068 100644 --- a/library/MultiRegions/AssemblyMap/AssemblyMapCG.cpp +++ b/library/MultiRegions/AssemblyMap/AssemblyMapCG.cpp @@ -39,7 +39,7 @@ #include #include #include - +#include #include #include @@ -2033,8 +2033,8 @@ namespace Nektar } } - m_hash = boost::hash_range(m_localToGlobalMap.begin(), - m_localToGlobalMap.end()); + m_hash = hash_range(m_localToGlobalMap.begin(), + m_localToGlobalMap.end()); // Add up hash values if parallel int hash = m_hash; diff --git a/library/MultiRegions/AssemblyMap/AssemblyMapDG.cpp b/library/MultiRegions/AssemblyMap/AssemblyMapDG.cpp index 0cf34a17c..7ce88df74 100644 --- a/library/MultiRegions/AssemblyMap/AssemblyMapDG.cpp +++ b/library/MultiRegions/AssemblyMap/AssemblyMapDG.cpp @@ -33,6 +33,7 @@ // /////////////////////////////////////////////////////////////////////////////// +#include #include #include #include @@ -518,8 +519,8 @@ namespace Nektar SetUpUniversalDGMap (locExp); SetUpUniversalTraceMap(locExp, tr, periodicTrace); - m_hash = boost::hash_range(m_localToGlobalBndMap.begin(), - m_localToGlobalBndMap.end()); + m_hash = hash_range(m_localToGlobalBndMap.begin(), + m_localToGlobalBndMap.end()); } /** diff --git a/library/NekMeshUtils/MeshElements/Edge.h b/library/NekMeshUtils/MeshElements/Edge.h index 66e86d0ec..4071aa5aa 100644 --- a/library/NekMeshUtils/MeshElements/Edge.h +++ b/library/NekMeshUtils/MeshElements/Edge.h @@ -36,6 +36,7 @@ #ifndef NEKMESHUTILS_MESHELEMENTS_EDGE #define NEKMESHUTILS_MESHELEMENTS_EDGE +#include #include #include @@ -151,12 +152,9 @@ struct EdgeHash : std::unary_function { std::size_t operator()(EdgeSharedPtr const &p) const { - std::size_t seed = 0; - unsigned int id1 = p->m_n1->m_id; - unsigned int id2 = p->m_n2->m_id; - boost::hash_combine(seed, id1 < id2 ? id1 : id2); - boost::hash_combine(seed, id2 < id1 ? id1 : id2); - return seed; + const unsigned int id1 = p->m_n1->m_id; + const unsigned int id2 = p->m_n2->m_id; + return id1 < id2 ? hash_combine(id1, id2) : hash_combine(id2, id1); } }; typedef std::unordered_set EdgeSet; diff --git a/library/NekMeshUtils/MeshElements/Face.h b/library/NekMeshUtils/MeshElements/Face.h index 6a6c6e11e..ff8cec2a3 100644 --- a/library/NekMeshUtils/MeshElements/Face.h +++ b/library/NekMeshUtils/MeshElements/Face.h @@ -36,6 +36,7 @@ #ifndef NEKMESHUTILS_MESHELEMENTS_FACE #define NEKMESHUTILS_MESHELEMENTS_FACE +#include #include #include @@ -171,7 +172,7 @@ struct FaceHash : std::unary_function } std::sort(ids.begin(), ids.end()); - boost::hash_range(seed, ids.begin(), ids.end()); + hash_range(seed, ids.begin(), ids.end()); return seed; } diff --git a/library/NekMeshUtils/MeshElements/HOAlignment.h b/library/NekMeshUtils/MeshElements/HOAlignment.h index 5b097f3e7..f9702991b 100644 --- a/library/NekMeshUtils/MeshElements/HOAlignment.h +++ b/library/NekMeshUtils/MeshElements/HOAlignment.h @@ -191,15 +191,9 @@ struct HOSurfHash : std::unary_function */ std::size_t operator()(HOSurfSharedPtr const &p) const { - std::size_t seed = 0; std::vector ids = p->vertId; - std::sort(ids.begin(), ids.end()); - for (int i = 0; i < ids.size(); ++i) - { - boost::hash_combine(seed, ids[i]); - } - return seed; + return hash_range(ids.begin(), ids.end()); } }; diff --git a/library/NekMeshUtils/MeshElements/Node.h b/library/NekMeshUtils/MeshElements/Node.h index e4259d4d5..c3c6729ef 100644 --- a/library/NekMeshUtils/MeshElements/Node.h +++ b/library/NekMeshUtils/MeshElements/Node.h @@ -36,6 +36,7 @@ #ifndef NEKMESHUTILS_MESHELEMENTS_NODE #define NEKMESHUTILS_MESHELEMENTS_NODE +#include #include #include @@ -431,11 +432,7 @@ struct NodeHash : std::unary_function { std::size_t operator()(NodeSharedPtr const &p) const { - std::size_t seed = 0; - boost::hash_combine(seed, p->m_x); - boost::hash_combine(seed, p->m_y); - boost::hash_combine(seed, p->m_z); - return seed; + return hash_combine(p->m_x, p->m_y, p->m_z); } }; typedef std::unordered_set NodeSet; diff --git a/library/NekMeshUtils/MeshElements/Tetrahedron.cpp b/library/NekMeshUtils/MeshElements/Tetrahedron.cpp index da480da1c..e43173276 100644 --- a/library/NekMeshUtils/MeshElements/Tetrahedron.cpp +++ b/library/NekMeshUtils/MeshElements/Tetrahedron.cpp @@ -40,6 +40,7 @@ #include #include +#include #include using namespace std; @@ -365,7 +366,7 @@ struct TetOrientHash : std::unary_function { std::size_t operator()(struct TetOrient const &p) const { - return boost::hash_range(p.nid.begin(), p.nid.end()); + return hash_range(p.nid.begin(), p.nid.end()); } }; typedef std::unordered_set TetOrientSet; diff --git a/library/SolverUtils/Advection/Advection.h b/library/SolverUtils/Advection/Advection.h index 02b318156..256733257 100644 --- a/library/SolverUtils/Advection/Advection.h +++ b/library/SolverUtils/Advection/Advection.h @@ -37,7 +37,7 @@ #define NEKTAR_SOLVERUTILS_ADVECTION #include -#include +#include #include #include @@ -53,7 +53,7 @@ namespace SolverUtils /// Defines a callback function which evaluates the flux vector \f$ F(u) /// \f$ in a conservative advection of the form \f$ \nabla\cdot F(u) /// \f$. -typedef boost::function >&, Array > >&)> AdvectionFluxVecCB; @@ -89,13 +89,14 @@ public: * @brief Set the flux vector callback function. * * This routine is a utility function to avoid the explicit use of - * boost::bind. A function and object can be passed to this function + * std::bind. A function and object can be passed to this function * instead. */ template void SetFluxVector(FuncPointerT func, ObjectPointerT obj) { - m_fluxVector = boost::bind(func, obj, _1, _2); + m_fluxVector = std::bind( + func, obj, std::placeholders::_1, std::placeholders::_2); } /** @@ -162,7 +163,7 @@ protected: }; /// A shared pointer to an Advection object. -typedef boost::shared_ptr AdvectionSharedPtr; +typedef std::shared_ptr AdvectionSharedPtr; /// Datatype of the NekFactory used to instantiate classes derived /// from the Advection class. diff --git a/library/SolverUtils/Advection/Advection3DHomogeneous1D.cpp b/library/SolverUtils/Advection/Advection3DHomogeneous1D.cpp index 0d0e8e9e3..0ed244627 100644 --- a/library/SolverUtils/Advection/Advection3DHomogeneous1D.cpp +++ b/library/SolverUtils/Advection/Advection3DHomogeneous1D.cpp @@ -120,14 +120,14 @@ namespace Nektar for (it1 = scalars.begin(); it1 != scalars.end(); ++it1) { - boost::shared_ptr tmp = MemoryManager + std::shared_ptr tmp = MemoryManager ::AllocateSharedPtr(it1->second, m_numPlanes); m_riemann->SetScalar(it1->first, &HomoRSScalar::Exec, tmp); } for (it2 = vectors.begin(); it2 != vectors.end(); ++it2) { - boost::shared_ptr tmp = MemoryManager + std::shared_ptr tmp = MemoryManager ::AllocateSharedPtr(it2->second, m_numPlanes, it2->first); m_riemann->SetVector(it2->first, &HomoRSVector::Exec, tmp); } diff --git a/library/SolverUtils/Advection/AdvectionFR.cpp b/library/SolverUtils/Advection/AdvectionFR.cpp index d13142f74..37b9b292d 100644 --- a/library/SolverUtils/Advection/AdvectionFR.cpp +++ b/library/SolverUtils/Advection/AdvectionFR.cpp @@ -1027,7 +1027,9 @@ namespace Nektar int nSolutionPts = fields[0]->GetTotPoints(); - vector negatedFluxNormal = (boost::static_pointer_cast(fields[0]))->GetNegatedFluxNormal(); + vector negatedFluxNormal = + std::static_pointer_cast( + fields[0])->GetNegatedFluxNormal(); // Arrays to store the derivatives of the correction flux Array DCL(nSolutionPts/nElements, 0.0); diff --git a/library/SolverUtils/AdvectionSystem.h b/library/SolverUtils/AdvectionSystem.h index 1fdc21f48..83b01e29a 100644 --- a/library/SolverUtils/AdvectionSystem.h +++ b/library/SolverUtils/AdvectionSystem.h @@ -65,7 +65,7 @@ protected: }; /// Shared pointer to an AdvectionSystem class -typedef boost::shared_ptr AdvectionSystemSharedPtr; +typedef std::shared_ptr AdvectionSystemSharedPtr; } } diff --git a/library/SolverUtils/Diffusion/Diffusion.h b/library/SolverUtils/Diffusion/Diffusion.h index dd25f165e..a2c61b1d2 100644 --- a/library/SolverUtils/Diffusion/Diffusion.h +++ b/library/SolverUtils/Diffusion/Diffusion.h @@ -37,7 +37,7 @@ #define NEKTAR_SOLVERUTILS_DIFFUSION #include -#include +#include #include #include @@ -50,20 +50,20 @@ namespace Nektar { namespace SolverUtils { - typedef boost::function >&, Array >&, Array >&)> DiffusionFluxVecCB; - typedef boost::function >&, Array > >&, Array > >&)> DiffusionFluxVecCBNS; - typedef boost::function >&, Array&)> DiffusionArtificialDiffusion; @@ -90,7 +90,10 @@ namespace Nektar template void SetFluxVector(FuncPointerT func, ObjectPointerT obj) { - m_fluxVector = boost::bind(func, obj, _1, _2, _3, _4, _5); + m_fluxVector = std::bind( + func, obj, std::placeholders::_1, std::placeholders::_2, + std::placeholders::_3, std::placeholders::_4, + std::placeholders::_5); } void SetFluxVectorVec(DiffusionFluxVecCB fluxVector) @@ -101,13 +104,16 @@ namespace Nektar template void SetFluxVectorNS(FuncPointerT func, ObjectPointerT obj) { - m_fluxVectorNS = boost::bind(func, obj, _1, _2, _3); + m_fluxVectorNS = std::bind( + func, obj, std::placeholders::_1, std::placeholders::_2, + std::placeholders::_3); } template void SetArtificialDiffusionVector(FuncPointerT func, ObjectPointerT obj) { - m_ArtificialDiffusionVector = boost::bind(func, obj, _1, _2); + m_ArtificialDiffusionVector = std::bind( + func, obj, std::placeholders::_1, std::placeholders::_2); } void SetFluxVectorNS(DiffusionFluxVecCBNS fluxVector) @@ -159,7 +165,7 @@ namespace Nektar }; /// A shared pointer to an EquationSystem object - typedef boost::shared_ptr DiffusionSharedPtr; + typedef std::shared_ptr DiffusionSharedPtr; /// Datatype of the NekFactory used to instantiate classes derived /// from the Diffusion class. diff --git a/library/SolverUtils/Diffusion/DiffusionLDGNS.h b/library/SolverUtils/Diffusion/DiffusionLDGNS.h index 1a53692aa..9493246fc 100644 --- a/library/SolverUtils/Diffusion/DiffusionLDGNS.h +++ b/library/SolverUtils/Diffusion/DiffusionLDGNS.h @@ -126,7 +126,7 @@ namespace Nektar } }; - typedef boost::shared_ptr DiffusionLDGNSSharedPtr; + typedef std::shared_ptr DiffusionLDGNSSharedPtr; } } diff --git a/library/SolverUtils/Diffusion/DiffusionLFR.cpp b/library/SolverUtils/Diffusion/DiffusionLFR.cpp index 3f9ecb1a1..c9162a021 100644 --- a/library/SolverUtils/Diffusion/DiffusionLFR.cpp +++ b/library/SolverUtils/Diffusion/DiffusionLFR.cpp @@ -1482,7 +1482,9 @@ namespace Nektar int nElements = fields[0]->GetExpSize(); int nSolutionPts = fields[0]->GetTotPoints(); - vector negatedFluxNormal = (boost::static_pointer_cast(fields[0]))->GetNegatedFluxNormal(); + vector negatedFluxNormal = + std::static_pointer_cast( + fields[0])->GetNegatedFluxNormal(); // Arrays to store the derivatives of the correction flux Array DCL(nSolutionPts/nElements, 0.0); diff --git a/library/SolverUtils/Diffusion/DiffusionLFRNS.h b/library/SolverUtils/Diffusion/DiffusionLFRNS.h index 8225d138c..4a4aa08d8 100644 --- a/library/SolverUtils/Diffusion/DiffusionLFRNS.h +++ b/library/SolverUtils/Diffusion/DiffusionLFRNS.h @@ -200,7 +200,7 @@ namespace Nektar } }; - typedef boost::shared_ptr DiffusionLFRNSSharedPtr; + typedef std::shared_ptr DiffusionLFRNSSharedPtr; } } diff --git a/library/SolverUtils/Driver.h b/library/SolverUtils/Driver.h index 9d25b0e5b..5dcd23655 100644 --- a/library/SolverUtils/Driver.h +++ b/library/SolverUtils/Driver.h @@ -52,7 +52,7 @@ namespace SolverUtils class Driver; /// A shared pointer to a Driver object -typedef boost::shared_ptr DriverSharedPtr; +typedef std::shared_ptr DriverSharedPtr; /// Datatype of the NekFactory used to instantiate classes derived from /// the Driver class. diff --git a/library/SolverUtils/EquationSystem.cpp b/library/SolverUtils/EquationSystem.cpp index 866026f52..550eb9de7 100644 --- a/library/SolverUtils/EquationSystem.cpp +++ b/library/SolverUtils/EquationSystem.cpp @@ -55,7 +55,6 @@ #include #include -# include #include #include diff --git a/library/SolverUtils/EquationSystem.h b/library/SolverUtils/EquationSystem.h index 6e8777469..090273b10 100644 --- a/library/SolverUtils/EquationSystem.h +++ b/library/SolverUtils/EquationSystem.h @@ -59,7 +59,7 @@ class Interpolator; class EquationSystem; /// A shared pointer to an EquationSystem object - typedef boost::shared_ptr EquationSystemSharedPtr; + typedef std::shared_ptr EquationSystemSharedPtr; /// Datatype of the NekFactory used to instantiate classes derived from /// the EquationSystem class. typedef LibUtilities::NekFactory< @@ -74,7 +74,7 @@ class Interpolator; } ; /// A base class for describing how to solve specific equations. - class EquationSystem : public boost::enable_shared_from_this + class EquationSystem : public std::enable_shared_from_this { public: /// Destructor @@ -111,16 +111,9 @@ class Interpolator; } template - boost::shared_ptr as() + std::shared_ptr as() { -#if defined __INTEL_COMPILER && BOOST_VERSION > 105200 - typedef typename boost::shared_ptr::element_type E; - E * p = dynamic_cast< E* >( shared_from_this().get() ); - ASSERTL1(p, "Cannot perform cast"); - return boost::shared_ptr( shared_from_this(), p ); -#else - return boost::dynamic_pointer_cast( shared_from_this() ); -#endif + return std::dynamic_pointer_cast( shared_from_this() ); } /// Reset Session name diff --git a/library/SolverUtils/Filters/Filter.h b/library/SolverUtils/Filters/Filter.h index bf50b4acb..f44a159b9 100644 --- a/library/SolverUtils/Filters/Filter.h +++ b/library/SolverUtils/Filters/Filter.h @@ -50,7 +50,7 @@ namespace SolverUtils class Filter; /// A shared pointer to a Driver object -typedef boost::shared_ptr FilterSharedPtr; +typedef std::shared_ptr FilterSharedPtr; /// Datatype of the NekFactory used to instantiate classes derived from /// the Driver class. diff --git a/library/SolverUtils/Filters/FilterAeroForces.cpp b/library/SolverUtils/Filters/FilterAeroForces.cpp index ed4034ea6..8c0fc12c9 100644 --- a/library/SolverUtils/Filters/FilterAeroForces.cpp +++ b/library/SolverUtils/Filters/FilterAeroForces.cpp @@ -1001,7 +1001,7 @@ void FilterAeroForces::CalculateForcesMapping( if (m_isHomogeneous1D) { MultiRegions::ExpList3DHomogeneous1DSharedPtr Exp3DH1; - Exp3DH1 = boost::dynamic_pointer_cast + Exp3DH1 = std::dynamic_pointer_cast (pFields[0]); for(i = 0; i < nVel*nVel; i++) @@ -1021,7 +1021,7 @@ void FilterAeroForces::CalculateForcesMapping( else { MultiRegions::ExpList2DSharedPtr Exp2D; - Exp2D = boost::dynamic_pointer_cast + Exp2D = std::dynamic_pointer_cast (pFields[0]); for(i = 0; i < nVel*nVel; i++) @@ -1043,7 +1043,7 @@ void FilterAeroForces::CalculateForcesMapping( case 3: { MultiRegions::ExpList3DSharedPtr Exp3D; - Exp3D = boost::dynamic_pointer_cast + Exp3D = std::dynamic_pointer_cast (pFields[0]); for(i = 0; i < nVel*nVel; i++) diff --git a/library/SolverUtils/Filters/FilterAeroForces.h b/library/SolverUtils/Filters/FilterAeroForces.h index 085ee0981..fff6feb88 100644 --- a/library/SolverUtils/Filters/FilterAeroForces.h +++ b/library/SolverUtils/Filters/FilterAeroForces.h @@ -128,7 +128,7 @@ private: const NekDouble &time); }; -typedef boost::shared_ptr FilterAeroForcesSharedPtr; +typedef std::shared_ptr FilterAeroForcesSharedPtr; } } diff --git a/library/SolverUtils/Filters/FilterFieldConvert.cpp b/library/SolverUtils/Filters/FilterFieldConvert.cpp index 38b001668..775ed86ee 100644 --- a/library/SolverUtils/Filters/FilterFieldConvert.cpp +++ b/library/SolverUtils/Filters/FilterFieldConvert.cpp @@ -127,7 +127,7 @@ FilterFieldConvert::FilterFieldConvert( // // FieldConvert modules // - m_f = boost::shared_ptr(new Field()); + m_f = std::shared_ptr(new Field()); vector modcmds; // Process modules std::stringstream moduleStream; diff --git a/library/SolverUtils/Filters/FilterHistoryPoints.cpp b/library/SolverUtils/Filters/FilterHistoryPoints.cpp index c5cb22be5..1e8da8a9e 100644 --- a/library/SolverUtils/Filters/FilterHistoryPoints.cpp +++ b/library/SolverUtils/Filters/FilterHistoryPoints.cpp @@ -495,7 +495,7 @@ void FilterHistoryPoints::v_Update(const Array(pFields[j]); ASSERTL0(tmp,"Failed to type cast expansion"); diff --git a/library/SolverUtils/Forcing/Forcing.h b/library/SolverUtils/Forcing/Forcing.h index 905dee1ef..10d3095f5 100644 --- a/library/SolverUtils/Forcing/Forcing.h +++ b/library/SolverUtils/Forcing/Forcing.h @@ -51,7 +51,7 @@ namespace SolverUtils class Forcing; /// A shared pointer to an EquationSystem object - SOLVER_UTILS_EXPORT typedef boost::shared_ptr ForcingSharedPtr; + SOLVER_UTILS_EXPORT typedef std::shared_ptr ForcingSharedPtr; /// Declaration of the forcing factory typedef LibUtilities::NekFactory ForcingProgrammaticSharedPtr; + SOLVER_UTILS_EXPORT typedef std::shared_ptr ForcingProgrammaticSharedPtr; class ForcingProgrammatic : public Forcing { diff --git a/library/SolverUtils/RiemannSolvers/RiemannSolver.h b/library/SolverUtils/RiemannSolvers/RiemannSolver.h index 68c66eddf..ad1bb086c 100644 --- a/library/SolverUtils/RiemannSolvers/RiemannSolver.h +++ b/library/SolverUtils/RiemannSolvers/RiemannSolver.h @@ -42,9 +42,6 @@ #include -#include -#include - namespace Nektar { template @@ -52,11 +49,11 @@ namespace Nektar namespace SolverUtils { - typedef boost::function< + typedef std::function< const Array& ()> RSScalarFuncType; - typedef boost::function< + typedef std::function< const Array >& ()> RSVecFuncType; - typedef boost::function< + typedef std::function< NekDouble ()> RSParamFuncType; class RiemannSolver @@ -73,7 +70,7 @@ namespace Nektar FuncPointerT func, ObjectPointerT obj) { - m_scalars[name] = boost::bind(func, obj); + m_scalars[name] = std::bind(func, obj); } void SetScalar(std::string name, RSScalarFuncType fp) @@ -86,7 +83,7 @@ namespace Nektar FuncPointerT func, ObjectPointerT obj) { - m_vectors[name] = boost::bind(func, obj); + m_vectors[name] = std::bind(func, obj); } void SetVector(std::string name, RSVecFuncType fp) @@ -99,7 +96,7 @@ namespace Nektar FuncPointerT func, ObjectPointerT obj) { - m_params[name] = boost::bind(func, obj); + m_params[name] = std::bind(func, obj); } void SetParam(std::string name, RSParamFuncType fp) @@ -112,7 +109,7 @@ namespace Nektar FuncPointerT func, ObjectPointerT obj) { - m_auxScal[name] = boost::bind(func, obj); + m_auxScal[name] = std::bind(func, obj); } template @@ -120,7 +117,7 @@ namespace Nektar FuncPointerT func, ObjectPointerT obj) { - m_auxVec[name] = boost::bind(func, obj); + m_auxVec[name] = std::bind(func, obj); } std::map &GetScalars() @@ -191,7 +188,7 @@ namespace Nektar }; /// A shared pointer to an EquationSystem object - typedef boost::shared_ptr RiemannSolverSharedPtr; + typedef std::shared_ptr RiemannSolverSharedPtr; /// Datatype of the NekFactory used to instantiate classes derived /// from the RiemannSolver class. typedef LibUtilities::NekFactory diff --git a/library/SpatialDomains/GeomFactors.h b/library/SpatialDomains/GeomFactors.h index b20584c36..ffb412a86 100644 --- a/library/SpatialDomains/GeomFactors.h +++ b/library/SpatialDomains/GeomFactors.h @@ -37,9 +37,9 @@ #define NEKTAR_SPATIALDOMAINS_GEOMFACTORS_H #include -#include #include +#include #include #include #include @@ -321,16 +321,14 @@ namespace SpatialDomains const Array jac = GetJac(ptsKeys); size_t hash = 0; - boost::hash_combine(hash, (int)m_type); - boost::hash_combine(hash, m_expDim); - boost::hash_combine(hash, m_coordDim); + hash_combine(hash, (int)m_type, m_expDim, m_coordDim); if (m_type == eDeformed) { - boost::hash_range(hash, jac.begin(), jac.end()); + hash_range(hash, jac.begin(), jac.end()); } else { - boost::hash_combine(hash, jac[0]); + hash_combine(hash, jac[0]); } return hash; } diff --git a/library/SpatialDomains/Geometry.h b/library/SpatialDomains/Geometry.h index ff1041421..bfab154a0 100644 --- a/library/SpatialDomains/Geometry.h +++ b/library/SpatialDomains/Geometry.h @@ -43,8 +43,8 @@ #include #include #include -#include #include +#include namespace Nektar { @@ -256,13 +256,13 @@ namespace Nektar size_t seed = 0; int nVert = p->GetNumVerts(); std::vector ids(nVert); - + for (i = 0; i < nVert; ++i) { ids[i] = p->GetVid(i); } std::sort(ids.begin(), ids.end()); - boost::hash_range(seed, ids.begin(), ids.end()); + hash_range(seed, ids.begin(), ids.end()); return seed; } diff --git a/library/StdRegions/StdMatrixKey.cpp b/library/StdRegions/StdMatrixKey.cpp index c44207b46..86918c70c 100644 --- a/library/StdRegions/StdMatrixKey.cpp +++ b/library/StdRegions/StdMatrixKey.cpp @@ -34,8 +34,8 @@ /////////////////////////////////////////////////////////////////////////////// #include -#include #include +#include using namespace std; @@ -62,8 +62,8 @@ namespace Nektar int i = 0; for (VarCoeffMap::const_iterator x = varCoeffMap.begin(); x != varCoeffMap.end(); ++x) { - m_varcoeff_hashes[i] = boost::hash_range(x->second.begin(), x->second.begin() + stdExpansion.GetTotPoints()); - boost::hash_combine(m_varcoeff_hashes[i], (int)x->first); + m_varcoeff_hashes[i] = hash_range(x->second.begin(), x->second.begin() + stdExpansion.GetTotPoints()); + hash_combine(m_varcoeff_hashes[i], (int)x->first); i++; } } diff --git a/library/UnitTests/BlockMatrixUnitTests.cpp b/library/UnitTests/BlockMatrixUnitTests.cpp index 4ee7baafd..a76df4c91 100644 --- a/library/UnitTests/BlockMatrixUnitTests.cpp +++ b/library/UnitTests/BlockMatrixUnitTests.cpp @@ -53,7 +53,7 @@ namespace Nektar { typedef NekMatrix, BlockMatrixTag> BlockMatrixType; BlockMatrixType m1(3, 2, 2, 2); - boost::shared_ptr > m2(new BlockMatrixType(2, 3, 2, 2)); + std::shared_ptr > m2(new BlockMatrixType(2, 3, 2, 2)); BOOST_CHECK_EQUAL(m1.GetRows(), 6u); BOOST_CHECK_EQUAL(m1.GetColumns(), 4u); @@ -72,7 +72,7 @@ namespace Nektar { typedef NekMatrix, BlockMatrixTag> BlockMatrixType; BlockMatrixType m1(3, 2, 2, 2); - boost::shared_ptr > m2(new BlockMatrixType(3, 2, 2, 2)); + std::shared_ptr > m2(new BlockMatrixType(3, 2, 2, 2)); double vals1[] = {1.0, 3.0, 2.0, 4.0}; double vals2[] = {5.0, 7.0, 6.0, 8.0}; @@ -81,12 +81,12 @@ namespace Nektar double vals5[] = {17.0, 19.0, 18.0, 20.0}; double vals6[] = {21.0, 23.0, 22.0, 24.0}; - boost::shared_ptr > sub1(new NekMatrix(2, 2, vals1)); - boost::shared_ptr > sub2(new NekMatrix(2, 2, vals2)); - boost::shared_ptr > sub3(new NekMatrix(2, 2, vals3)); - boost::shared_ptr > sub4(new NekMatrix(2, 2, vals4)); - boost::shared_ptr > sub5(new NekMatrix(2, 2, vals5)); - boost::shared_ptr > sub6(new NekMatrix(2, 2, vals6)); + std::shared_ptr > sub1(new NekMatrix(2, 2, vals1)); + std::shared_ptr > sub2(new NekMatrix(2, 2, vals2)); + std::shared_ptr > sub3(new NekMatrix(2, 2, vals3)); + std::shared_ptr > sub4(new NekMatrix(2, 2, vals4)); + std::shared_ptr > sub5(new NekMatrix(2, 2, vals5)); + std::shared_ptr > sub6(new NekMatrix(2, 2, vals6)); m1.SetBlock(0,0, sub1); m1.SetBlock(0,1, sub2); @@ -95,7 +95,7 @@ namespace Nektar m1.SetBlock(2,0, sub5); m1.SetBlock(2,1, sub6); - boost::shared_ptr m2_cast = boost::dynamic_pointer_cast(m2); + std::shared_ptr m2_cast = std::dynamic_pointer_cast(m2); m2_cast->SetBlock(0,0, sub1); m2_cast->SetBlock(0,1, sub2); @@ -162,7 +162,7 @@ namespace Nektar unsigned int rowSizes[] = {2, 2, 2}; unsigned int columnSizes[] = {2, 2}; BlockMatrixType m1(3, 2, rowSizes, columnSizes); - boost::shared_ptr > m2(new BlockMatrixType(3, 2, rowSizes, columnSizes)); + std::shared_ptr > m2(new BlockMatrixType(3, 2, rowSizes, columnSizes)); double vals1[] = {1.0, 3.0, 2.0, 4.0}; double vals2[] = {5.0, 7.0, 6.0, 8.0}; @@ -171,12 +171,12 @@ namespace Nektar double vals5[] = {17.0, 19.0, 18.0, 20.0}; double vals6[] = {21.0, 23.0, 22.0, 24.0}; - boost::shared_ptr > sub1(new NekMatrix(2, 2, vals1)); - boost::shared_ptr > sub2(new NekMatrix(2, 2, vals2)); - boost::shared_ptr > sub3(new NekMatrix(2, 2, vals3)); - boost::shared_ptr > sub4(new NekMatrix(2, 2, vals4)); - boost::shared_ptr > sub5(new NekMatrix(2, 2, vals5)); - boost::shared_ptr > sub6(new NekMatrix(2, 2, vals6)); + std::shared_ptr > sub1(new NekMatrix(2, 2, vals1)); + std::shared_ptr > sub2(new NekMatrix(2, 2, vals2)); + std::shared_ptr > sub3(new NekMatrix(2, 2, vals3)); + std::shared_ptr > sub4(new NekMatrix(2, 2, vals4)); + std::shared_ptr > sub5(new NekMatrix(2, 2, vals5)); + std::shared_ptr > sub6(new NekMatrix(2, 2, vals6)); m1.SetBlock(0,0, sub1); m1.SetBlock(0,1, sub2); @@ -185,7 +185,7 @@ namespace Nektar m1.SetBlock(2,0, sub5); m1.SetBlock(2,1, sub6); - boost::shared_ptr m2_cast = boost::dynamic_pointer_cast(m2); + std::shared_ptr m2_cast = std::dynamic_pointer_cast(m2); m2_cast->SetBlock(0,0, sub1); m2_cast->SetBlock(0,1, sub2); @@ -255,7 +255,7 @@ namespace Nektar Array columnSizes(2, columnSizesBuf); BlockMatrixType m1(3, 2, rowSizes, columnSizes); - boost::shared_ptr > m2(new BlockMatrixType(3, 2, rowSizes, columnSizes)); + std::shared_ptr > m2(new BlockMatrixType(3, 2, rowSizes, columnSizes)); double vals1[] = {1.0, 3.0, 2.0, 4.0}; double vals2[] = {5.0, 7.0, 6.0, 8.0}; @@ -264,12 +264,12 @@ namespace Nektar double vals5[] = {17.0, 19.0, 18.0, 20.0}; double vals6[] = {21.0, 23.0, 22.0, 24.0}; - boost::shared_ptr > sub1(new NekMatrix(2, 2, vals1)); - boost::shared_ptr > sub2(new NekMatrix(2, 2, vals2)); - boost::shared_ptr > sub3(new NekMatrix(2, 2, vals3)); - boost::shared_ptr > sub4(new NekMatrix(2, 2, vals4)); - boost::shared_ptr > sub5(new NekMatrix(2, 2, vals5)); - boost::shared_ptr > sub6(new NekMatrix(2, 2, vals6)); + std::shared_ptr > sub1(new NekMatrix(2, 2, vals1)); + std::shared_ptr > sub2(new NekMatrix(2, 2, vals2)); + std::shared_ptr > sub3(new NekMatrix(2, 2, vals3)); + std::shared_ptr > sub4(new NekMatrix(2, 2, vals4)); + std::shared_ptr > sub5(new NekMatrix(2, 2, vals5)); + std::shared_ptr > sub6(new NekMatrix(2, 2, vals6)); m1.SetBlock(0,0, sub1); m1.SetBlock(0,1, sub2); @@ -278,7 +278,7 @@ namespace Nektar m1.SetBlock(2,0, sub5); m1.SetBlock(2,1, sub6); - boost::shared_ptr m2_cast = boost::dynamic_pointer_cast(m2); + std::shared_ptr m2_cast = std::dynamic_pointer_cast(m2); m2_cast->SetBlock(0,0, sub1); m2_cast->SetBlock(0,1, sub2); @@ -347,7 +347,7 @@ namespace Nektar unsigned int rowSizes[] = {2, 0, 2, 0, 0, 2}; unsigned int columnSizes[] = {2, 2}; BlockMatrixType m1(6, 2, rowSizes, columnSizes); - boost::shared_ptr > m2(new BlockMatrixType(6, 2, rowSizes, columnSizes)); + std::shared_ptr > m2(new BlockMatrixType(6, 2, rowSizes, columnSizes)); double vals1[] = {1.0, 3.0, 2.0, 4.0}; double vals2[] = {5.0, 7.0, 6.0, 8.0}; @@ -356,12 +356,12 @@ namespace Nektar double vals5[] = {17.0, 19.0, 18.0, 20.0}; double vals6[] = {21.0, 23.0, 22.0, 24.0}; - boost::shared_ptr > sub1(new NekMatrix(2, 2, vals1)); - boost::shared_ptr > sub2(new NekMatrix(2, 2, vals2)); - boost::shared_ptr > sub3(new NekMatrix(2, 2, vals3)); - boost::shared_ptr > sub4(new NekMatrix(2, 2, vals4)); - boost::shared_ptr > sub5(new NekMatrix(2, 2, vals5)); - boost::shared_ptr > sub6(new NekMatrix(2, 2, vals6)); + std::shared_ptr > sub1(new NekMatrix(2, 2, vals1)); + std::shared_ptr > sub2(new NekMatrix(2, 2, vals2)); + std::shared_ptr > sub3(new NekMatrix(2, 2, vals3)); + std::shared_ptr > sub4(new NekMatrix(2, 2, vals4)); + std::shared_ptr > sub5(new NekMatrix(2, 2, vals5)); + std::shared_ptr > sub6(new NekMatrix(2, 2, vals6)); m1.SetBlock(0,0, sub1); m1.SetBlock(0,1, sub2); @@ -370,7 +370,7 @@ namespace Nektar m1.SetBlock(5,0, sub5); m1.SetBlock(5,1, sub6); - boost::shared_ptr m2_cast = boost::dynamic_pointer_cast(m2); + std::shared_ptr m2_cast = std::dynamic_pointer_cast(m2); m2_cast->SetBlock(0,0, sub1); m2_cast->SetBlock(0,1, sub2); @@ -444,14 +444,14 @@ namespace Nektar double vals5[] = {17.0, 19.0, 18.0, 20.0}; double vals6[] = {21.0, 23.0, 22.0, 24.0}; - boost::shared_ptr > sub1(new NekMatrix(2, 2, vals1)); - boost::shared_ptr > sub2(new NekMatrix(2, 2, vals2)); - boost::shared_ptr > sub3(new NekMatrix(2, 2, vals3)); - boost::shared_ptr > sub4(new NekMatrix(2, 2, vals4)); - boost::shared_ptr > sub5(new NekMatrix(2, 2, vals5)); - boost::shared_ptr > sub6(new NekMatrix(2, 2, vals6)); + std::shared_ptr > sub1(new NekMatrix(2, 2, vals1)); + std::shared_ptr > sub2(new NekMatrix(2, 2, vals2)); + std::shared_ptr > sub3(new NekMatrix(2, 2, vals3)); + std::shared_ptr > sub4(new NekMatrix(2, 2, vals4)); + std::shared_ptr > sub5(new NekMatrix(2, 2, vals5)); + std::shared_ptr > sub6(new NekMatrix(2, 2, vals6)); - boost::shared_ptr > empty(new NekMatrix(0, 0)); + std::shared_ptr > empty(new NekMatrix(0, 0)); m1.SetBlock(0,0, empty); m1.SetBlock(0,1, empty); m1.SetBlock(0,2, empty); diff --git a/library/UnitTests/LibUtilities/LinearAlgebra/TestBandedMatrixOperations.cpp b/library/UnitTests/LibUtilities/LinearAlgebra/TestBandedMatrixOperations.cpp index d3ac80c61..ee61c5b4d 100644 --- a/library/UnitTests/LibUtilities/LinearAlgebra/TestBandedMatrixOperations.cpp +++ b/library/UnitTests/LibUtilities/LinearAlgebra/TestBandedMatrixOperations.cpp @@ -150,9 +150,9 @@ namespace Nektar 8, 10, 0}; - boost::shared_ptr m(new DenseMatrix(4, 4, buf, eBANDED, 1, 1)); + std::shared_ptr m(new DenseMatrix(4, 4, buf, eBANDED, 1, 1)); - boost::shared_ptr scaled(new ScaledMatrix(2.0, m)); + std::shared_ptr scaled(new ScaledMatrix(2.0, m)); NekDouble vector_buf[] = {1.0, 2.0, 3.0, 4.0}; NekVector v(4, vector_buf); @@ -507,12 +507,12 @@ namespace Nektar 42, 36 }; NekMatrix lhs1(4, 4, lhs_buf, eBANDED, 2, 1); - boost::shared_ptr, ScaledMatrixTag> > lhs2; - boost::shared_ptr, BlockMatrixTag> > lhs3; + std::shared_ptr, ScaledMatrixTag> > lhs2; + std::shared_ptr, BlockMatrixTag> > lhs3; NekMatrix rhs1(4, 4, rhs_buf, eBANDED, 0, 1); - boost::shared_ptr, ScaledMatrixTag> > rhs2; - boost::shared_ptr, BlockMatrixTag> > rhs3; + std::shared_ptr, ScaledMatrixTag> > rhs2; + std::shared_ptr, BlockMatrixTag> > rhs3; GenerateMatrices(lhs1, 2.0, 2, 2, lhs2, lhs3); GenerateMatrices(rhs1, 2.0, 2, 2, rhs2, rhs3); diff --git a/library/UnitTests/LibUtilities/LinearAlgebra/TestBlockMatrix.cpp b/library/UnitTests/LibUtilities/LinearAlgebra/TestBlockMatrix.cpp index 837a4bb66..3e95bd122 100644 --- a/library/UnitTests/LibUtilities/LinearAlgebra/TestBlockMatrix.cpp +++ b/library/UnitTests/LibUtilities/LinearAlgebra/TestBlockMatrix.cpp @@ -75,10 +75,10 @@ namespace Nektar double m4_buf[] = {14, 19, 15, 20}; - boost::shared_ptr m1(new InnerType(2, 3, m1_buf)); - boost::shared_ptr m2(new InnerType(2, 2, m2_buf)); - boost::shared_ptr m3(new InnerType(2, 3, m3_buf)); - boost::shared_ptr m4(new InnerType(2, 2, m4_buf)); + std::shared_ptr m1(new InnerType(2, 3, m1_buf)); + std::shared_ptr m2(new InnerType(2, 2, m2_buf)); + std::shared_ptr m3(new InnerType(2, 3, m3_buf)); + std::shared_ptr m4(new InnerType(2, 2, m4_buf)); unsigned int rowCounts[] = {2, 2}; unsigned int colCounts[] = {3, 2}; @@ -136,12 +136,12 @@ namespace Nektar 70, 71, 72, 73, 74, 75}; - boost::shared_ptr m00(new InnerType(2, 4, m00_buf)); - boost::shared_ptr m01(new InnerType(2, 5, m01_buf)); - boost::shared_ptr m02(new InnerType(2, 6, m02_buf)); - boost::shared_ptr m10(new InnerType(3, 4, m10_buf)); - boost::shared_ptr m11(new InnerType(3, 5, m11_buf)); - boost::shared_ptr m12(new InnerType(3, 6, m12_buf)); + std::shared_ptr m00(new InnerType(2, 4, m00_buf)); + std::shared_ptr m01(new InnerType(2, 5, m01_buf)); + std::shared_ptr m02(new InnerType(2, 6, m02_buf)); + std::shared_ptr m10(new InnerType(3, 4, m10_buf)); + std::shared_ptr m11(new InnerType(3, 5, m11_buf)); + std::shared_ptr m12(new InnerType(3, 6, m12_buf)); unsigned int rowCounts[] = {2, 3}; unsigned int colCounts[] = {4, 5, 6}; @@ -297,19 +297,19 @@ namespace Nektar 70, 71, 72, 73, 74, 75}; - boost::shared_ptr > m00(new NekMatrix(2, 4, m00_buf)); - boost::shared_ptr > m01(new NekMatrix(2, 5, m01_buf)); - boost::shared_ptr > m02(new NekMatrix(2, 6, m02_buf)); - boost::shared_ptr > m10(new NekMatrix(3, 4, m10_buf)); - boost::shared_ptr > m11(new NekMatrix(3, 5, m11_buf)); - boost::shared_ptr > m12(new NekMatrix(3, 6, m12_buf)); + std::shared_ptr > m00(new NekMatrix(2, 4, m00_buf)); + std::shared_ptr > m01(new NekMatrix(2, 5, m01_buf)); + std::shared_ptr > m02(new NekMatrix(2, 6, m02_buf)); + std::shared_ptr > m10(new NekMatrix(3, 4, m10_buf)); + std::shared_ptr > m11(new NekMatrix(3, 5, m11_buf)); + std::shared_ptr > m12(new NekMatrix(3, 6, m12_buf)); - boost::shared_ptr sm00(new InnerType(2.0, m00)); - boost::shared_ptr sm01(new InnerType(2.0, m01)); - boost::shared_ptr sm02(new InnerType(2.0, m02)); - boost::shared_ptr sm10(new InnerType(2.0, m10)); - boost::shared_ptr sm11(new InnerType(2.0, m11)); - boost::shared_ptr sm12(new InnerType(2.0, m12)); + std::shared_ptr sm00(new InnerType(2.0, m00)); + std::shared_ptr sm01(new InnerType(2.0, m01)); + std::shared_ptr sm02(new InnerType(2.0, m02)); + std::shared_ptr sm10(new InnerType(2.0, m10)); + std::shared_ptr sm11(new InnerType(2.0, m11)); + std::shared_ptr sm12(new InnerType(2.0, m12)); unsigned int rowCounts[] = {2, 3}; unsigned int colCounts[] = {4, 5, 6}; @@ -445,26 +445,26 @@ namespace Nektar 37, 38, 39, 40, 41, 42}; - boost::shared_ptr m00(new Matrix(2, 3, m_00_buf)); - boost::shared_ptr m01(new Matrix(2, 4, m_01_buf)); - boost::shared_ptr m10(new Matrix(2, 3, m_10_buf)); - boost::shared_ptr m11(new Matrix(2, 4, m_11_buf)); - boost::shared_ptr m20(new Matrix(2, 3, m_20_buf)); - boost::shared_ptr m21(new Matrix(2, 4, m_21_buf)); + std::shared_ptr m00(new Matrix(2, 3, m_00_buf)); + std::shared_ptr m01(new Matrix(2, 4, m_01_buf)); + std::shared_ptr m10(new Matrix(2, 3, m_10_buf)); + std::shared_ptr m11(new Matrix(2, 4, m_11_buf)); + std::shared_ptr m20(new Matrix(2, 3, m_20_buf)); + std::shared_ptr m21(new Matrix(2, 4, m_21_buf)); unsigned int rowCounts[] = {2, 2, 2}; unsigned int colCounts[] = {3, 4}; - std::vector > innerMatrices; + std::vector > innerMatrices; for(int i = 0; i < 6; ++i) { - boost::shared_ptr t00(new Matrix(*m00)); - boost::shared_ptr t01(new Matrix(*m01)); - boost::shared_ptr t10(new Matrix(*m10)); - boost::shared_ptr t11(new Matrix(*m11)); - boost::shared_ptr t20(new Matrix(*m20)); - boost::shared_ptr t21(new Matrix(*m21)); + std::shared_ptr t00(new Matrix(*m00)); + std::shared_ptr t01(new Matrix(*m01)); + std::shared_ptr t10(new Matrix(*m10)); + std::shared_ptr t11(new Matrix(*m11)); + std::shared_ptr t20(new Matrix(*m20)); + std::shared_ptr t21(new Matrix(*m21)); (*t00) *= (i+1); (*t01) *= (i+1); @@ -473,7 +473,7 @@ namespace Nektar (*t20) *= (i+1); (*t21) *= (i+1); - boost::shared_ptr matrix(new InnerMatrix(3, 2, rowCounts, colCounts)); + std::shared_ptr matrix(new InnerMatrix(3, 2, rowCounts, colCounts)); matrix->SetBlock(0, 0, t00); matrix->SetBlock(0, 1, t01); matrix->SetBlock(1, 0, t10); @@ -547,35 +547,35 @@ namespace Nektar 37, 38, 39, 40, 41, 42}; - boost::shared_ptr m00(new Matrix(2, 3, m_00_buf)); - boost::shared_ptr m01(new Matrix(2, 4, m_01_buf)); - boost::shared_ptr m10(new Matrix(2, 3, m_10_buf)); - boost::shared_ptr m11(new Matrix(2, 4, m_11_buf)); - boost::shared_ptr m20(new Matrix(2, 3, m_20_buf)); - boost::shared_ptr m21(new Matrix(2, 4, m_21_buf)); + std::shared_ptr m00(new Matrix(2, 3, m_00_buf)); + std::shared_ptr m01(new Matrix(2, 4, m_01_buf)); + std::shared_ptr m10(new Matrix(2, 3, m_10_buf)); + std::shared_ptr m11(new Matrix(2, 4, m_11_buf)); + std::shared_ptr m20(new Matrix(2, 3, m_20_buf)); + std::shared_ptr m21(new Matrix(2, 4, m_21_buf)); unsigned int rowCounts[] = {2, 2, 2}; unsigned int colCounts[] = {3, 4}; - std::vector > innerMatrices; + std::vector > innerMatrices; for(int i = 0; i < 6; ++i) { - boost::shared_ptr t00(new Matrix(*m00)); - boost::shared_ptr t01(new Matrix(*m01)); - boost::shared_ptr t10(new Matrix(*m10)); - boost::shared_ptr t11(new Matrix(*m11)); - boost::shared_ptr t20(new Matrix(*m20)); - boost::shared_ptr t21(new Matrix(*m21)); + std::shared_ptr t00(new Matrix(*m00)); + std::shared_ptr t01(new Matrix(*m01)); + std::shared_ptr t10(new Matrix(*m10)); + std::shared_ptr t11(new Matrix(*m11)); + std::shared_ptr t20(new Matrix(*m20)); + std::shared_ptr t21(new Matrix(*m21)); - boost::shared_ptr s00(new ScaledMatrix(i+1, t00)); - boost::shared_ptr s01(new ScaledMatrix(i+1, t01)); - boost::shared_ptr s10(new ScaledMatrix(i+1, t10)); - boost::shared_ptr s11(new ScaledMatrix(i+1, t11)); - boost::shared_ptr s20(new ScaledMatrix(i+1, t20)); - boost::shared_ptr s21(new ScaledMatrix(i+1, t21)); + std::shared_ptr s00(new ScaledMatrix(i+1, t00)); + std::shared_ptr s01(new ScaledMatrix(i+1, t01)); + std::shared_ptr s10(new ScaledMatrix(i+1, t10)); + std::shared_ptr s11(new ScaledMatrix(i+1, t11)); + std::shared_ptr s20(new ScaledMatrix(i+1, t20)); + std::shared_ptr s21(new ScaledMatrix(i+1, t21)); - boost::shared_ptr matrix(new InnerMatrix(3, 2, rowCounts, colCounts)); + std::shared_ptr matrix(new InnerMatrix(3, 2, rowCounts, colCounts)); matrix->SetBlock(0, 0, s00); matrix->SetBlock(0, 1, s01); matrix->SetBlock(1, 0, s10); @@ -666,21 +666,21 @@ namespace Nektar 5, 1, 1}; - boost::shared_ptr m00(new InnerType(2, 2, m_00_buf)); - boost::shared_ptr m01(new InnerType(2, 3, m_01_buf)); - boost::shared_ptr m02(new InnerType(2, 4, m_02_buf)); + std::shared_ptr m00(new InnerType(2, 2, m_00_buf)); + std::shared_ptr m01(new InnerType(2, 3, m_01_buf)); + std::shared_ptr m02(new InnerType(2, 4, m_02_buf)); - boost::shared_ptr m10(new InnerType(3, 2, m_10_buf)); - boost::shared_ptr m11(new InnerType(3, 3, m_11_buf)); - boost::shared_ptr m12(new InnerType(3, 4, m_12_buf)); + std::shared_ptr m10(new InnerType(3, 2, m_10_buf)); + std::shared_ptr m11(new InnerType(3, 3, m_11_buf)); + std::shared_ptr m12(new InnerType(3, 4, m_12_buf)); - boost::shared_ptr m20(new InnerType(4, 2, m_20_buf)); - boost::shared_ptr m21(new InnerType(4, 3, m_21_buf)); - boost::shared_ptr m22(new InnerType(4, 4, m_22_buf)); + std::shared_ptr m20(new InnerType(4, 2, m_20_buf)); + std::shared_ptr m21(new InnerType(4, 3, m_21_buf)); + std::shared_ptr m22(new InnerType(4, 4, m_22_buf)); - boost::shared_ptr m30(new InnerType(3, 2, m_30_buf)); - boost::shared_ptr m31(new InnerType(3, 3, m_31_buf)); - boost::shared_ptr m32(new InnerType(3, 4, m_32_buf)); + std::shared_ptr m30(new InnerType(3, 2, m_30_buf)); + std::shared_ptr m31(new InnerType(3, 3, m_31_buf)); + std::shared_ptr m32(new InnerType(3, 4, m_32_buf)); unsigned int rowCounts[] = {2, 3, 4, 3}; unsigned int colCounts[] = {2, 3, 4}; @@ -738,9 +738,9 @@ namespace Nektar double m_22_buf[] = {1, 3, 5, 2, 4, 6}; - boost::shared_ptr m00(new InnerType(2, 2, m_00_buf)); - boost::shared_ptr m11(new InnerType(2, 3, m_11_buf)); - boost::shared_ptr m22(new InnerType(3, 2, m_22_buf)); + std::shared_ptr m00(new InnerType(2, 2, m_00_buf)); + std::shared_ptr m11(new InnerType(2, 3, m_11_buf)); + std::shared_ptr m22(new InnerType(3, 2, m_22_buf)); unsigned int rowCounts[] = {2, 2, 3}; unsigned int colCounts[] = {2, 3, 2}; @@ -768,7 +768,7 @@ namespace Nektar double m_22_buf[] = {1, 2, 3, 4, 5, 6, 7, 8}; - boost::shared_ptr m22(new InnerType(1, 8, m_22_buf)); + std::shared_ptr m22(new InnerType(1, 8, m_22_buf)); unsigned int rowCounts[] = {0, 0, 1}; unsigned int colCounts[] = {6, 6, 8}; @@ -795,7 +795,7 @@ namespace Nektar double m_22_buf[] = {1, 2, 3, 4, 5, 6, 7, 8}; - boost::shared_ptr m22(new InnerType(1, 8, m_22_buf)); + std::shared_ptr m22(new InnerType(1, 8, m_22_buf)); unsigned int rowCounts[] = {0, 0, 1}; unsigned int colCounts[] = {6, 6, 8}; @@ -829,7 +829,7 @@ namespace Nektar //NekVector< NekDouble > F_p(f_p.num_elements(),f_p,eWrapper); //typedef NekMatrix BlkMatDNekScalBlkMat; - //typedef boost::shared_ptr BlkMatDNekScalBlkMatSharedPtr; + //typedef std::shared_ptr BlkMatDNekScalBlkMatSharedPtr; //BlkMatDNekScalBlkMatSharedPtr m_Btilde = MemoryManager // ::AllocateSharedPtr(nsize_int,nsize_bndry,blkmatStorage); @@ -841,19 +841,19 @@ namespace Nektar typedef NekMatrix M3; typedef NekMatrix M4; - std::vector< boost::shared_ptr > scaledMatrices; + std::vector< std::shared_ptr > scaledMatrices; for(unsigned int i = 0; i < 36; ++i) { double values[] = {i*4.0, i*4.0+1.0, i*4.0+2.0, i*4.0+3.0}; - boost::shared_ptr matrix(new M1(2,2, values)); - boost::shared_ptr scaled(new M2(1.0, matrix)); + std::shared_ptr matrix(new M1(2,2, values)); + std::shared_ptr scaled(new M2(1.0, matrix)); scaledMatrices.push_back(scaled); } - std::vector > blockMatrices; + std::vector > blockMatrices; for(unsigned int i = 0; i < 6; ++i) { - boost::shared_ptr blockMatrix(new M3(2,3,2,2)); + std::shared_ptr blockMatrix(new M3(2,3,2,2)); blockMatrix->SetBlock(0, 0, scaledMatrices[i*6]); blockMatrix->SetBlock(0, 1, scaledMatrices[i*6+1]); blockMatrix->SetBlock(0, 2, scaledMatrices[i*6+2]); @@ -863,7 +863,7 @@ namespace Nektar blockMatrices.push_back(blockMatrix); } - boost::shared_ptr matrix(new M4(3, 2, 4, 6)); + std::shared_ptr matrix(new M4(3, 2, 4, 6)); matrix->SetBlock(0,0, blockMatrices[0]); matrix->SetBlock(0,1, blockMatrices[1]); matrix->SetBlock(1,0, blockMatrices[2]); diff --git a/library/UnitTests/LibUtilities/LinearAlgebra/TestCanGetRawPtr.cpp b/library/UnitTests/LibUtilities/LinearAlgebra/TestCanGetRawPtr.cpp index 55d6dc411..72d086e30 100644 --- a/library/UnitTests/LibUtilities/LinearAlgebra/TestCanGetRawPtr.cpp +++ b/library/UnitTests/LibUtilities/LinearAlgebra/TestCanGetRawPtr.cpp @@ -44,14 +44,16 @@ #include #include -#include namespace Nektar { BOOST_AUTO_TEST_CASE(TestCanGetRawPtr) { - BOOST_MPL_ASSERT(( CanGetRawPtr > )); - BOOST_MPL_ASSERT(( CanGetRawPtr, ScaledMatrixTag> > )); - BOOST_MPL_ASSERT(( boost::mpl::not_, BlockMatrixTag> > > )); + static_assert(CanGetRawPtr >::value, + "Should be true"); + static_assert(CanGetRawPtr, ScaledMatrixTag> >::value, + "Should be true"); + static_assert(!CanGetRawPtr, BlockMatrixTag> >::value, + "Should be false"); } } diff --git a/library/UnitTests/LibUtilities/LinearAlgebra/TestCombinationRunner.h b/library/UnitTests/LibUtilities/LinearAlgebra/TestCombinationRunner.h index a0f5e7d26..113180690 100644 --- a/library/UnitTests/LibUtilities/LinearAlgebra/TestCombinationRunner.h +++ b/library/UnitTests/LibUtilities/LinearAlgebra/TestCombinationRunner.h @@ -36,7 +36,6 @@ #ifndef NEKTAR_UNIT_TESTS_LIB_UTILITIES_LINEAR_ALGEBRA_TEST_COMBINATION_RUNNER_H #define NEKTAR_UNIT_TESTS_LIB_UTILITIES_LINEAR_ALGEBRA_TEST_COMBINATION_RUNNER_H -#include #include #include @@ -121,13 +120,13 @@ namespace Nektar //template //void GenerateFullMatrices(const NekMatrix& m1, // NumberType scale, unsigned int blockRows, unsigned int blockColumns, - // boost::shared_ptr, FullMatrixTag, ScaledMatrixTag> >& m2, - // boost::shared_ptr, FullMatrixTag, BlockMatrixTag> >& m3) + // std::shared_ptr, FullMatrixTag, ScaledMatrixTag> >& m2, + // std::shared_ptr, FullMatrixTag, BlockMatrixTag> >& m3) //{ // NumberType* inner_values = new NumberType[m1.GetStorageSize()]; - // std::transform(m1.begin(), m1.end(), inner_values, boost::bind(std::divides(), _1, scale)); + // std::transform(m1.begin(), m1.end(), inner_values, std::bind(std::divides(), _1, scale)); - // boost::shared_ptr > inner( + // std::shared_ptr > inner( // new NekMatrix(m1.GetRows(), m1.GetColumns(), inner_values, m1.GetPolicySpecificDataHolderType())); // m2 = MakePtr(new NekMatrix, FullMatrixTag, ScaledMatrixTag>(scale, inner)); @@ -139,7 +138,7 @@ namespace Nektar // { // for(unsigned int blockColumn = 0; blockColumn < blockColumns; ++blockColumn) // { - // boost::shared_ptr > block(new NekMatrix(numberOfRows, numberOfColumns)); + // std::shared_ptr > block(new NekMatrix(numberOfRows, numberOfColumns)); // for(unsigned int i = 0; i < numberOfRows; ++i) // { // for(unsigned int j = 0; j < numberOfRows; ++j) @@ -158,9 +157,9 @@ namespace Nektar // m1 = MakePtr(new NekMatrix(4, 4, values)); // // double inner_values[16]; - // std::transform(values, values+16, inner_values, boost::bind(std::divides(), _1, scale)); + // std::transform(values, values+16, inner_values, std::bind(std::divides(), _1, scale)); - // boost::shared_ptr > inner( + // std::shared_ptr > inner( // new NekMatrix(4, 4, inner_values)); // m2 = MakePtr(new NekMatrix, FullMatrixTag, ScaledMatrixTag>(scale, inner)); // @@ -172,10 +171,10 @@ namespace Nektar // values[12], values[13]}; // double block_4_values[] = {values[10], values[11], // values[14], values[15]}; - // boost::shared_ptr > block1(new NekMatrix(2, 2, block_1_values)); - // boost::shared_ptr > block2(new NekMatrix(2, 2, block_2_values)); - // boost::shared_ptr > block3(new NekMatrix(2, 2, block_3_values)); - // boost::shared_ptr > block4(new NekMatrix(2, 2, block_4_values)); + // std::shared_ptr > block1(new NekMatrix(2, 2, block_1_values)); + // std::shared_ptr > block2(new NekMatrix(2, 2, block_2_values)); + // std::shared_ptr > block3(new NekMatrix(2, 2, block_3_values)); + // std::shared_ptr > block4(new NekMatrix(2, 2, block_4_values)); // // m3 = MakePtr(new NekMatrix, FullMatrixTag, BlockMatrixTag>(2, 2, 2, 2)); // m3->SetBlock(0,0, block1); @@ -185,16 +184,16 @@ namespace Nektar //} //void GenerateUpperTriangularMatrices(NekDouble values[], NekDouble scale, - // boost::shared_ptr >& m1, - // boost::shared_ptr, UpperTriangularMatrixTag, ScaledMatrixTag> >& m2, - // boost::shared_ptr, UpperTriangularMatrixTag, BlockMatrixTag> >& m3) + // std::shared_ptr >& m1, + // std::shared_ptr, UpperTriangularMatrixTag, ScaledMatrixTag> >& m2, + // std::shared_ptr, UpperTriangularMatrixTag, BlockMatrixTag> >& m3) //{ // m1 = MakePtr(new NekMatrix(4, 4, values)); // // double inner_values[10]; - // std::transform(values, values+10, inner_values, boost::bind(std::divides(), _1, scale)); + // std::transform(values, values+10, inner_values, std::bind(std::divides(), _1, scale)); - // boost::shared_ptr > inner( + // std::shared_ptr > inner( // new NekMatrix(4, 4, inner_values)); // m2 = MakePtr(new NekMatrix, UpperTriangularMatrixTag, ScaledMatrixTag>(scale, inner)); // @@ -204,9 +203,9 @@ namespace Nektar // values[6], values[7]}; // double block_4_values[] = {values[5], 0.0, // values[8], values[9]}; - // boost::shared_ptr > block1(new NekMatrix(2, 2, block_1_values)); - // boost::shared_ptr > block2(new NekMatrix(2, 2, block_2_values)); - // boost::shared_ptr > block4(new NekMatrix(2, 2, block_4_values)); + // std::shared_ptr > block1(new NekMatrix(2, 2, block_1_values)); + // std::shared_ptr > block2(new NekMatrix(2, 2, block_2_values)); + // std::shared_ptr > block4(new NekMatrix(2, 2, block_4_values)); // // m3 = MakePtr(new NekMatrix, UpperTriangularMatrixTag, BlockMatrixTag>(2, 2, 2, 2)); // m3->SetBlock(0,0, block1); @@ -217,14 +216,14 @@ namespace Nektar template void GenerateMatrices(const NekMatrix& m1, NumberType scale, unsigned int blockRows, unsigned int blockColumns, - boost::shared_ptr, ScaledMatrixTag> >& m2, - boost::shared_ptr, BlockMatrixTag> >& m3) + std::shared_ptr, ScaledMatrixTag> >& m2, + std::shared_ptr, BlockMatrixTag> >& m3) { NumberType* inner_values = new NumberType[m1.GetStorageSize()]; - std::transform(m1.begin(), m1.end(), inner_values, boost::bind(std::divides(), _1, scale)); + std::transform(m1.begin(), m1.end(), inner_values, std::bind(std::divides(), std::placeholders::_1, scale)); MatrixStorage s = m1.GetType(); - boost::shared_ptr > inner( + std::shared_ptr > inner( new NekMatrix(m1.GetRows(), m1.GetColumns(), inner_values, s, m1.GetNumberOfSubDiagonals(), m1.GetNumberOfSuperDiagonals())); m2 = MakePtr(new NekMatrix, ScaledMatrixTag>(scale, inner)); @@ -237,7 +236,7 @@ namespace Nektar { for(unsigned int blockColumn = 0; blockColumn < blockColumns; ++blockColumn) { - boost::shared_ptr > block(new NekMatrix(numberOfRows, numberOfColumns)); + std::shared_ptr > block(new NekMatrix(numberOfRows, numberOfColumns)); for(unsigned int i = 0; i < numberOfRows; ++i) { for(unsigned int j = 0; j < numberOfRows; ++j) diff --git a/library/UnitTests/LibUtilities/LinearAlgebra/TestDgemmOptimizations.cpp b/library/UnitTests/LibUtilities/LinearAlgebra/TestDgemmOptimizations.cpp index 965e3f580..2c3a33077 100644 --- a/library/UnitTests/LibUtilities/LinearAlgebra/TestDgemmOptimizations.cpp +++ b/library/UnitTests/LibUtilities/LinearAlgebra/TestDgemmOptimizations.cpp @@ -59,8 +59,8 @@ namespace Nektar //double a_buf[] = {1, 2, 3, 4}; //double b_buf[] = {4, 5, 6, 7}; // - //boost::shared_ptr > ia(new NekMatrix(2, 2, a_buf)); - //boost::shared_ptr > ib(new NekMatrix(2, 2, b_buf)); + //std::shared_ptr > ia(new NekMatrix(2, 2, a_buf)); + //std::shared_ptr > ib(new NekMatrix(2, 2, b_buf)); // //NekMatrix result = 3.0*(*ia)*(*ib); // @@ -132,9 +132,9 @@ namespace Nektar double beta = 7.0; double alpha = 2.0; - boost::shared_ptr > innerA(new NekMatrix(2, 2, abuf)); - boost::shared_ptr > innerB(new NekMatrix(2, 2, bbuf)); - boost::shared_ptr > innerC(new NekMatrix(2, 2, cbuf)); + std::shared_ptr > innerA(new NekMatrix(2, 2, abuf)); + std::shared_ptr > innerB(new NekMatrix(2, 2, bbuf)); + std::shared_ptr > innerC(new NekMatrix(2, 2, cbuf)); ScaledMatrix A(2.0, innerA); ScaledMatrix B(3.0, innerB); @@ -190,10 +190,10 @@ namespace Nektar double beta = 7.0; double alpha = 2.0; - boost::shared_ptr > innerA(new NekMatrix(2, 2, abuf)); - boost::shared_ptr > innerB(new NekMatrix(2, 2, bbuf)); - boost::shared_ptr > innerC(new NekMatrix(2, 2, cbuf)); - boost::shared_ptr > innerD(new NekMatrix(2, 2, dbuf)); + std::shared_ptr > innerA(new NekMatrix(2, 2, abuf)); + std::shared_ptr > innerB(new NekMatrix(2, 2, bbuf)); + std::shared_ptr > innerC(new NekMatrix(2, 2, cbuf)); + std::shared_ptr > innerD(new NekMatrix(2, 2, dbuf)); BlockMatrix A(2, 2, 2, 2); BlockMatrix B(2, 2, 2, 2); diff --git a/library/UnitTests/LibUtilities/LinearAlgebra/TestDiagonalMatrixOperations.cpp b/library/UnitTests/LibUtilities/LinearAlgebra/TestDiagonalMatrixOperations.cpp index 06fa5d0a0..bfe8f7a1c 100644 --- a/library/UnitTests/LibUtilities/LinearAlgebra/TestDiagonalMatrixOperations.cpp +++ b/library/UnitTests/LibUtilities/LinearAlgebra/TestDiagonalMatrixOperations.cpp @@ -70,7 +70,7 @@ namespace Nektar double m_buf[] = {1, 2, 3}; double v_buf[] = {4, 5, 6}; - boost::shared_ptr > inner( + std::shared_ptr > inner( new NekMatrix(3, 3, m_buf, eDIAGONAL)); NekMatrix, ScaledMatrixTag> m(5.0, inner); diff --git a/library/UnitTests/LibUtilities/LinearAlgebra/TestDiagonalMatrixStoragePolicy.cpp b/library/UnitTests/LibUtilities/LinearAlgebra/TestDiagonalMatrixStoragePolicy.cpp index 2b478c850..866be1e80 100644 --- a/library/UnitTests/LibUtilities/LinearAlgebra/TestDiagonalMatrixStoragePolicy.cpp +++ b/library/UnitTests/LibUtilities/LinearAlgebra/TestDiagonalMatrixStoragePolicy.cpp @@ -60,19 +60,19 @@ namespace Nektar { unsigned int curRow = 0; unsigned int curColumn = 0; - boost::tie(curRow, curColumn) = Policy::Advance(4, 4, curRow, curColumn); + std::tie(curRow, curColumn) = Policy::Advance(4, 4, curRow, curColumn); BOOST_CHECK_EQUAL(1u, curRow); BOOST_CHECK_EQUAL(1u, curColumn); - boost::tie(curRow, curColumn) = Policy::Advance(4, 4, curRow, curColumn); + std::tie(curRow, curColumn) = Policy::Advance(4, 4, curRow, curColumn); BOOST_CHECK_EQUAL(2u, curRow); BOOST_CHECK_EQUAL(2u, curColumn); - boost::tie(curRow, curColumn) = Policy::Advance(4, 4, curRow, curColumn); + std::tie(curRow, curColumn) = Policy::Advance(4, 4, curRow, curColumn); BOOST_CHECK_EQUAL(3u, curRow); BOOST_CHECK_EQUAL(3u, curColumn); - boost::tie(curRow, curColumn) = Policy::Advance(2, 2, curRow, curColumn); + std::tie(curRow, curColumn) = Policy::Advance(2, 2, curRow, curColumn); BOOST_CHECK_EQUAL(std::numeric_limits::max(), curRow); BOOST_CHECK_EQUAL(std::numeric_limits::max(), curColumn); } @@ -81,7 +81,7 @@ namespace Nektar unsigned int curRow = 0; unsigned int curColumn = 0; - boost::tie(curRow, curColumn) = Policy::Advance(1, 1, curRow, curColumn); + std::tie(curRow, curColumn) = Policy::Advance(1, 1, curRow, curColumn); BOOST_CHECK_EQUAL(std::numeric_limits::max(), curRow); BOOST_CHECK_EQUAL(std::numeric_limits::max(), curColumn); } diff --git a/library/UnitTests/LibUtilities/LinearAlgebra/TestFullMatrixOperations.cpp b/library/UnitTests/LibUtilities/LinearAlgebra/TestFullMatrixOperations.cpp index 0ffe5ddda..2fdd44a4d 100644 --- a/library/UnitTests/LibUtilities/LinearAlgebra/TestFullMatrixOperations.cpp +++ b/library/UnitTests/LibUtilities/LinearAlgebra/TestFullMatrixOperations.cpp @@ -183,7 +183,7 @@ namespace Nektar 7, 8, 9}; double v_buf[] = {4, 5, 6}; - boost::shared_ptr > inner(new NekMatrix(3, 3, m_buf)); + std::shared_ptr > inner(new NekMatrix(3, 3, m_buf)); NekMatrix, ScaledMatrixTag> m(7.0, inner); NekVector v(3, v_buf); diff --git a/library/UnitTests/LibUtilities/LinearAlgebra/TestFullMatrixStoragePolicy.cpp b/library/UnitTests/LibUtilities/LinearAlgebra/TestFullMatrixStoragePolicy.cpp index 0e6beef47..80b02e354 100644 --- a/library/UnitTests/LibUtilities/LinearAlgebra/TestFullMatrixStoragePolicy.cpp +++ b/library/UnitTests/LibUtilities/LinearAlgebra/TestFullMatrixStoragePolicy.cpp @@ -74,51 +74,51 @@ namespace Nektar { unsigned int curRow = 0; unsigned int curColumn = 0; - boost::tie(curRow, curColumn) = Policy::Advance(4, 3, curRow, curColumn); + std::tie(curRow, curColumn) = Policy::Advance(4, 3, curRow, curColumn); BOOST_CHECK_EQUAL(1u, curRow); BOOST_CHECK_EQUAL(0u, curColumn); - boost::tie(curRow, curColumn) = Policy::Advance(4, 3, curRow, curColumn); + std::tie(curRow, curColumn) = Policy::Advance(4, 3, curRow, curColumn); BOOST_CHECK_EQUAL(2u, curRow); BOOST_CHECK_EQUAL(0u, curColumn); - boost::tie(curRow, curColumn) = Policy::Advance(4, 3, curRow, curColumn); + std::tie(curRow, curColumn) = Policy::Advance(4, 3, curRow, curColumn); BOOST_CHECK_EQUAL(3u, curRow); BOOST_CHECK_EQUAL(0u, curColumn); - boost::tie(curRow, curColumn) = Policy::Advance(4, 3, curRow, curColumn); + std::tie(curRow, curColumn) = Policy::Advance(4, 3, curRow, curColumn); BOOST_CHECK_EQUAL(0u, curRow); BOOST_CHECK_EQUAL(1u, curColumn); - boost::tie(curRow, curColumn) = Policy::Advance(4, 3, curRow, curColumn); + std::tie(curRow, curColumn) = Policy::Advance(4, 3, curRow, curColumn); BOOST_CHECK_EQUAL(1u, curRow); BOOST_CHECK_EQUAL(1u, curColumn); - boost::tie(curRow, curColumn) = Policy::Advance(4, 3, curRow, curColumn); + std::tie(curRow, curColumn) = Policy::Advance(4, 3, curRow, curColumn); BOOST_CHECK_EQUAL(2u, curRow); BOOST_CHECK_EQUAL(1u, curColumn); - boost::tie(curRow, curColumn) = Policy::Advance(4, 3, curRow, curColumn); + std::tie(curRow, curColumn) = Policy::Advance(4, 3, curRow, curColumn); BOOST_CHECK_EQUAL(3u, curRow); BOOST_CHECK_EQUAL(1u, curColumn); - boost::tie(curRow, curColumn) = Policy::Advance(4, 3, curRow, curColumn); + std::tie(curRow, curColumn) = Policy::Advance(4, 3, curRow, curColumn); BOOST_CHECK_EQUAL(0u, curRow); BOOST_CHECK_EQUAL(2u, curColumn); - boost::tie(curRow, curColumn) = Policy::Advance(4, 3, curRow, curColumn); + std::tie(curRow, curColumn) = Policy::Advance(4, 3, curRow, curColumn); BOOST_CHECK_EQUAL(1u, curRow); BOOST_CHECK_EQUAL(2u, curColumn); - boost::tie(curRow, curColumn) = Policy::Advance(4, 3, curRow, curColumn); + std::tie(curRow, curColumn) = Policy::Advance(4, 3, curRow, curColumn); BOOST_CHECK_EQUAL(2u, curRow); BOOST_CHECK_EQUAL(2u, curColumn); - boost::tie(curRow, curColumn) = Policy::Advance(4, 3, curRow, curColumn); + std::tie(curRow, curColumn) = Policy::Advance(4, 3, curRow, curColumn); BOOST_CHECK_EQUAL(3u, curRow); BOOST_CHECK_EQUAL(2u, curColumn); - boost::tie(curRow, curColumn) = Policy::Advance(4, 3, curRow, curColumn); + std::tie(curRow, curColumn) = Policy::Advance(4, 3, curRow, curColumn); BOOST_CHECK_EQUAL(std::numeric_limits::max(), curRow); BOOST_CHECK_EQUAL(std::numeric_limits::max(), curColumn); } @@ -127,7 +127,7 @@ namespace Nektar unsigned int curRow = 0; unsigned int curColumn = 0; - boost::tie(curRow, curColumn) = Policy::Advance(1, 1, curRow, curColumn); + std::tie(curRow, curColumn) = Policy::Advance(1, 1, curRow, curColumn); BOOST_CHECK_EQUAL(std::numeric_limits::max(), curRow); BOOST_CHECK_EQUAL(std::numeric_limits::max(), curColumn); } diff --git a/library/UnitTests/LibUtilities/LinearAlgebra/TestLowerTriangularMatrixStoragePolicy.cpp b/library/UnitTests/LibUtilities/LinearAlgebra/TestLowerTriangularMatrixStoragePolicy.cpp index fac82d443..bc558d330 100644 --- a/library/UnitTests/LibUtilities/LinearAlgebra/TestLowerTriangularMatrixStoragePolicy.cpp +++ b/library/UnitTests/LibUtilities/LinearAlgebra/TestLowerTriangularMatrixStoragePolicy.cpp @@ -59,27 +59,27 @@ namespace Nektar unsigned int curRow = 0; unsigned int curColumn = 0; - boost::tie(curRow, curColumn) = Policy::Advance(3, 3, curRow, curColumn, 'N'); + std::tie(curRow, curColumn) = Policy::Advance(3, 3, curRow, curColumn, 'N'); BOOST_CHECK_EQUAL(1, curRow); BOOST_CHECK_EQUAL(0, curColumn); - boost::tie(curRow, curColumn) = Policy::Advance(3, 3, curRow, curColumn, 'N'); + std::tie(curRow, curColumn) = Policy::Advance(3, 3, curRow, curColumn, 'N'); BOOST_CHECK_EQUAL(2, curRow); BOOST_CHECK_EQUAL(0, curColumn); - boost::tie(curRow, curColumn) = Policy::Advance(3, 3, curRow, curColumn, 'N'); + std::tie(curRow, curColumn) = Policy::Advance(3, 3, curRow, curColumn, 'N'); BOOST_CHECK_EQUAL(1, curRow); BOOST_CHECK_EQUAL(1, curColumn); - boost::tie(curRow, curColumn) = Policy::Advance(3, 3, curRow, curColumn, 'N'); + std::tie(curRow, curColumn) = Policy::Advance(3, 3, curRow, curColumn, 'N'); BOOST_CHECK_EQUAL(2, curRow); BOOST_CHECK_EQUAL(1, curColumn); - boost::tie(curRow, curColumn) = Policy::Advance(3, 3, curRow, curColumn, 'N'); + std::tie(curRow, curColumn) = Policy::Advance(3, 3, curRow, curColumn, 'N'); BOOST_CHECK_EQUAL(2, curRow); BOOST_CHECK_EQUAL(2, curColumn); - boost::tie(curRow, curColumn) = Policy::Advance(3, 3, curRow, curColumn, 'N'); + std::tie(curRow, curColumn) = Policy::Advance(3, 3, curRow, curColumn, 'N'); BOOST_CHECK_EQUAL(std::numeric_limits::max(), curRow); BOOST_CHECK_EQUAL(std::numeric_limits::max(), curColumn); } @@ -88,7 +88,7 @@ namespace Nektar unsigned int curRow = 0; unsigned int curColumn = 0; - boost::tie(curRow, curColumn) = Policy::Advance(1, 1, curRow, curColumn, 'N'); + std::tie(curRow, curColumn) = Policy::Advance(1, 1, curRow, curColumn, 'N'); BOOST_CHECK_EQUAL(std::numeric_limits::max(), curRow); BOOST_CHECK_EQUAL(std::numeric_limits::max(), curColumn); } @@ -97,15 +97,15 @@ namespace Nektar unsigned int curRow = 0; unsigned int curColumn = 0; - boost::tie(curRow, curColumn) = Policy::Advance(2, 2, curRow, curColumn, 'N'); + std::tie(curRow, curColumn) = Policy::Advance(2, 2, curRow, curColumn, 'N'); BOOST_CHECK_EQUAL(1, curRow); BOOST_CHECK_EQUAL(0, curColumn); - boost::tie(curRow, curColumn) = Policy::Advance(2, 2, curRow, curColumn, 'N'); + std::tie(curRow, curColumn) = Policy::Advance(2, 2, curRow, curColumn, 'N'); BOOST_CHECK_EQUAL(1, curRow); BOOST_CHECK_EQUAL(1, curColumn); - boost::tie(curRow, curColumn) = Policy::Advance(2, 2, curRow, curColumn, 'N'); + std::tie(curRow, curColumn) = Policy::Advance(2, 2, curRow, curColumn, 'N'); BOOST_CHECK_EQUAL(std::numeric_limits::max(), curRow); BOOST_CHECK_EQUAL(std::numeric_limits::max(), curColumn); } diff --git a/library/UnitTests/LibUtilities/LinearAlgebra/TestScaledBlockMatrixOperations.cpp b/library/UnitTests/LibUtilities/LinearAlgebra/TestScaledBlockMatrixOperations.cpp index 5100d6f6d..2447c375e 100644 --- a/library/UnitTests/LibUtilities/LinearAlgebra/TestScaledBlockMatrixOperations.cpp +++ b/library/UnitTests/LibUtilities/LinearAlgebra/TestScaledBlockMatrixOperations.cpp @@ -65,22 +65,22 @@ namespace Nektar double m4_buf[] = {14.0/2.0, 19.0/2.0, 15.0/2.0, 20.0/2.0}; - boost::shared_ptr in_m1(new InnerType(2, 3, m1_buf)); - boost::shared_ptr in_m2(new InnerType(2, 2, m2_buf)); - boost::shared_ptr in_m3(new InnerType(2, 3, m3_buf)); - boost::shared_ptr in_m4(new InnerType(2, 2, m4_buf)); - - boost::shared_ptr m1(new ScaleType(2.0, in_m1)); - boost::shared_ptr m2(new ScaleType(2.0, in_m2)); - boost::shared_ptr m3(new ScaleType(2.0, in_m3)); - boost::shared_ptr m4(new ScaleType(2.0, in_m4)); + std::shared_ptr in_m1(new InnerType(2, 3, m1_buf)); + std::shared_ptr in_m2(new InnerType(2, 2, m2_buf)); + std::shared_ptr in_m3(new InnerType(2, 3, m3_buf)); + std::shared_ptr in_m4(new InnerType(2, 2, m4_buf)); + + std::shared_ptr m1(new ScaleType(2.0, in_m1)); + std::shared_ptr m2(new ScaleType(2.0, in_m2)); + std::shared_ptr m3(new ScaleType(2.0, in_m3)); + std::shared_ptr m4(new ScaleType(2.0, in_m4)); unsigned int rowCounts[] = {2, 2}; unsigned int colCounts[] = {3, 2}; typedef NekMatrix BlockType; - boost::shared_ptr b(new BlockType(2, 2, rowCounts, colCounts)); + std::shared_ptr b(new BlockType(2, 2, rowCounts, colCounts)); b->SetBlock(0, 0, m1); b->SetBlock(0, 1, m2); b->SetBlock(1, 0, m3); @@ -143,21 +143,21 @@ namespace Nektar 5, 1, 1}; - boost::shared_ptr m00(new InnerType(2, 2, m_00_buf)); - boost::shared_ptr m01(new InnerType(2, 3, m_01_buf)); - boost::shared_ptr m02(new InnerType(2, 4, m_02_buf)); + std::shared_ptr m00(new InnerType(2, 2, m_00_buf)); + std::shared_ptr m01(new InnerType(2, 3, m_01_buf)); + std::shared_ptr m02(new InnerType(2, 4, m_02_buf)); - boost::shared_ptr m10(new InnerType(3, 2, m_10_buf)); - boost::shared_ptr m11(new InnerType(3, 3, m_11_buf)); - boost::shared_ptr m12(new InnerType(3, 4, m_12_buf)); + std::shared_ptr m10(new InnerType(3, 2, m_10_buf)); + std::shared_ptr m11(new InnerType(3, 3, m_11_buf)); + std::shared_ptr m12(new InnerType(3, 4, m_12_buf)); - boost::shared_ptr m20(new InnerType(4, 2, m_20_buf)); - boost::shared_ptr m21(new InnerType(4, 3, m_21_buf)); - boost::shared_ptr m22(new InnerType(4, 4, m_22_buf)); + std::shared_ptr m20(new InnerType(4, 2, m_20_buf)); + std::shared_ptr m21(new InnerType(4, 3, m_21_buf)); + std::shared_ptr m22(new InnerType(4, 4, m_22_buf)); - boost::shared_ptr m30(new InnerType(3, 2, m_30_buf)); - boost::shared_ptr m31(new InnerType(3, 3, m_31_buf)); - boost::shared_ptr m32(new InnerType(3, 4, m_32_buf)); + std::shared_ptr m30(new InnerType(3, 2, m_30_buf)); + std::shared_ptr m31(new InnerType(3, 3, m_31_buf)); + std::shared_ptr m32(new InnerType(3, 4, m_32_buf)); unsigned int rowCounts[] = {2, 3, 4, 3}; unsigned int colCounts[] = {2, 3, 4}; diff --git a/library/UnitTests/LibUtilities/LinearAlgebra/TestScaledMatrix.cpp b/library/UnitTests/LibUtilities/LinearAlgebra/TestScaledMatrix.cpp index e6202338a..ad048b8d8 100644 --- a/library/UnitTests/LibUtilities/LinearAlgebra/TestScaledMatrix.cpp +++ b/library/UnitTests/LibUtilities/LinearAlgebra/TestScaledMatrix.cpp @@ -56,7 +56,7 @@ namespace Nektar SMat m; BOOST_CHECK_EQUAL(0u, m.GetRows()); BOOST_CHECK_EQUAL(0u, m.GetColumns()); - BOOST_CHECK(boost::shared_ptr() != m.GetOwnedMatrix()); + BOOST_CHECK(std::shared_ptr() != m.GetOwnedMatrix()); BOOST_CHECK_EQUAL('N', m.GetTransposeFlag()); BOOST_CHECK_EQUAL(0u, m.GetStorageSize()); BOOST_CHECK_EQUAL(eFULL, m.GetStorageType()); @@ -69,7 +69,7 @@ namespace Nektar double buf[] = {1.0, 2.0, 3.0, 4.0, 5.0, 6.0}; - boost::shared_ptr in(new InnerMatrix(3, 2, buf)); + std::shared_ptr in(new InnerMatrix(3, 2, buf)); SMat m(2.7, in); BOOST_CHECK_EQUAL(3u, m.GetRows()); BOOST_CHECK_EQUAL(2u, m.GetColumns()); @@ -86,10 +86,10 @@ namespace Nektar double buf[] = {1.0, 2.0, 3.0, 4.0, 5.0, 6.0}; - boost::shared_ptr in1(new InnerMatrix(3, 2, buf)); - boost::shared_ptr in2(new InnerMatrix(3, 2, buf)); - boost::shared_ptr in3(new InnerMatrix(3, 2, buf)); - boost::shared_ptr in4(new InnerMatrix(3, 2, buf)); + std::shared_ptr in1(new InnerMatrix(3, 2, buf)); + std::shared_ptr in2(new InnerMatrix(3, 2, buf)); + std::shared_ptr in3(new InnerMatrix(3, 2, buf)); + std::shared_ptr in4(new InnerMatrix(3, 2, buf)); in3->Transpose(); in4->Transpose(); @@ -141,10 +141,10 @@ namespace Nektar double buf[] = {1.0, 2.0, 3.0, 4.0, 5.0, 6.0}; - boost::shared_ptr in1(new InnerMatrix(3, 2, buf)); - boost::shared_ptr in2(new InnerMatrix(3, 2, buf)); - boost::shared_ptr in3(new InnerMatrix(3, 2, buf)); - boost::shared_ptr in4(new InnerMatrix(3, 2, buf)); + std::shared_ptr in1(new InnerMatrix(3, 2, buf)); + std::shared_ptr in2(new InnerMatrix(3, 2, buf)); + std::shared_ptr in3(new InnerMatrix(3, 2, buf)); + std::shared_ptr in4(new InnerMatrix(3, 2, buf)); in3->Transpose(); in4->Transpose(); @@ -207,8 +207,8 @@ namespace Nektar double rhs_buf[] = {7.0, 8.0, 9.0, 10.0, 11.0, 12.0}; - boost::shared_ptr in1(new InnerMatrix(3, 2, lhs_buf)); - boost::shared_ptr in2(new InnerMatrix(2, 3, rhs_buf)); + std::shared_ptr in1(new InnerMatrix(3, 2, lhs_buf)); + std::shared_ptr in2(new InnerMatrix(2, 3, rhs_buf)); SMat m1(1.0, in1); SMat m2(2.0, in2); @@ -248,8 +248,8 @@ namespace Nektar double rhs_buf[] = {7.0, 8.0, 9.0, 10.0, 11.0, 12.0}; - boost::shared_ptr in1(new InnerMatrix(2, 3, lhs_buf)); - boost::shared_ptr in2(new InnerMatrix(2, 3, rhs_buf)); + std::shared_ptr in1(new InnerMatrix(2, 3, lhs_buf)); + std::shared_ptr in2(new InnerMatrix(2, 3, rhs_buf)); SMat m1(1.0, in1); SMat m2(2.0, in2); @@ -293,8 +293,8 @@ namespace Nektar double rhs_buf[] = {7.0, 8.0, 9.0, 10.0, 11.0, 12.0}; - boost::shared_ptr in1(new InnerMatrix(2, 3, lhs_buf)); - boost::shared_ptr in2(new InnerMatrix(2, 3, rhs_buf)); + std::shared_ptr in1(new InnerMatrix(2, 3, lhs_buf)); + std::shared_ptr in2(new InnerMatrix(2, 3, rhs_buf)); SMat m1(1.0, in1); SMat m2(2.0, in2); @@ -336,8 +336,8 @@ namespace Nektar double rhs_buf[] = {7.0, 8.0, 9.0, 10.0, 11.0, 12.0}; - boost::shared_ptr in1(new InnerMatrix(3, 2, lhs_buf)); - boost::shared_ptr in2(new InnerMatrix(2, 3, rhs_buf)); + std::shared_ptr in1(new InnerMatrix(3, 2, lhs_buf)); + std::shared_ptr in2(new InnerMatrix(2, 3, rhs_buf)); SMat m1(1.0, in1); SMat m2(2.0, in2); @@ -376,7 +376,7 @@ namespace Nektar double lhs_buf[] = {1, 2, 3, 4, 5, 6}; - boost::shared_ptr in1(new InnerMatrix(3, 2, lhs_buf)); + std::shared_ptr in1(new InnerMatrix(3, 2, lhs_buf)); SMat m1(1, in1); SMat transpose = Transpose(m1); @@ -396,7 +396,7 @@ namespace Nektar 2.0, 4.0, 6.0, 8.0}; double rhs_buf[] = {1.0, 2.0}; - boost::shared_ptr in1(new InnerMatrix(4, 2, lhs_buf)); + std::shared_ptr in1(new InnerMatrix(4, 2, lhs_buf)); NekVector rhs(2, rhs_buf); SMat m1(2.0, in1); @@ -420,9 +420,9 @@ namespace Nektar double buf2[] = {5.0, 6.0, 7.0, 8.0}; double buf3[] = {-1.0, -2.0, -3.0, -4.0}; - boost::shared_ptr > DMatInner( + std::shared_ptr > DMatInner( new NekMatrix(2, 2, buf1)); - boost::shared_ptr > InvMassInner( + std::shared_ptr > InvMassInner( new NekMatrix(2, 2, buf2)); NekMatrix Mat(2, 2, buf3); DNekScalMat DMat(2.0, DMatInner); @@ -434,7 +434,7 @@ namespace Nektar typedef expt::Node RhsNode; typedef expt::Node Expression; - //BOOST_MPL_ASSERT(( boost::mpl::not_ > )); + //BOOST_MPL_ASSERT(( std::mpl::not_ > )); #endif Mat = Mat + DMat*InvMass*Transpose(DMat); @@ -451,10 +451,10 @@ namespace Nektar double dmat_buf[] = {1.0, 2.0, 3.0, 4.0, 5.0, 6.0}; - boost::shared_ptr > inner(new NekMatrix(2, 3, dmat_buf)); + std::shared_ptr > inner(new NekMatrix(2, 3, dmat_buf)); DNekScalMat Dmat(2.0, inner); - boost::shared_ptr > inner1(new NekMatrix(2, 3, dmat_buf)); + std::shared_ptr > inner1(new NekMatrix(2, 3, dmat_buf)); DNekScalMat invMass(3.0, inner1); NekMatrix LocMat; @@ -476,9 +476,9 @@ namespace Nektar double dmat_buf[] = {1.0, 2.0, 3.0, 4.0, 5.0, 6.0}; - boost::shared_ptr > inner(new NekMatrix(2, 3, dmat_buf)); + std::shared_ptr > inner(new NekMatrix(2, 3, dmat_buf)); DNekScalMat Dmat(2.0, inner); - boost::shared_ptr > inner1(new NekMatrix(2, 3, dmat_buf)); + std::shared_ptr > inner1(new NekMatrix(2, 3, dmat_buf)); DNekScalMat invMass(3.0, inner1); NekMatrix result2 = @@ -504,7 +504,7 @@ namespace Nektar 7.0, 8.0}; double rhs_buf[] = {1.0, 2.0}; - boost::shared_ptr in1(new InnerMatrix(2, 4, lhs_buf)); + std::shared_ptr in1(new InnerMatrix(2, 4, lhs_buf)); NekVector rhs(2, rhs_buf); SMat m1(2.0, in1); diff --git a/library/UnitTests/LibUtilities/LinearAlgebra/TestStandardMatrix.cpp b/library/UnitTests/LibUtilities/LinearAlgebra/TestStandardMatrix.cpp index f527e122e..1ae89e8f4 100644 --- a/library/UnitTests/LibUtilities/LinearAlgebra/TestStandardMatrix.cpp +++ b/library/UnitTests/LibUtilities/LinearAlgebra/TestStandardMatrix.cpp @@ -144,12 +144,12 @@ namespace Nektar 39.0, 42.0, 45.0, 48.0}; NekMatrix lhs1(4, 4, lhs_buf); - boost::shared_ptr, ScaledMatrixTag> > lhs2; - boost::shared_ptr, BlockMatrixTag> > lhs3; + std::shared_ptr, ScaledMatrixTag> > lhs2; + std::shared_ptr, BlockMatrixTag> > lhs3; NekMatrix rhs1(4, 4, rhs_buf); - boost::shared_ptr, ScaledMatrixTag> > rhs2; - boost::shared_ptr, BlockMatrixTag> > rhs3; + std::shared_ptr, ScaledMatrixTag> > rhs2; + std::shared_ptr, BlockMatrixTag> > rhs3; GenerateMatrices(lhs1, 2.0, 2, 2, lhs2, lhs3); GenerateMatrices(rhs1, 3.0, 2, 2, rhs2, rhs3); @@ -186,12 +186,12 @@ namespace Nektar 39.0, 42.0, 45.0, 48.0}; NekMatrix lhs1(4, 4, lhs_buf); - boost::shared_ptr, ScaledMatrixTag> > lhs2; - boost::shared_ptr, BlockMatrixTag> > lhs3; + std::shared_ptr, ScaledMatrixTag> > lhs2; + std::shared_ptr, BlockMatrixTag> > lhs3; NekMatrix rhs1(4, 4, rhs_buf); - boost::shared_ptr, ScaledMatrixTag> > rhs2; - boost::shared_ptr, BlockMatrixTag> > rhs3; + std::shared_ptr, ScaledMatrixTag> > rhs2; + std::shared_ptr, BlockMatrixTag> > rhs3; GenerateMatrices(lhs1, 2.0, 2, 2, lhs2, lhs3); GenerateMatrices(rhs1, 3.0, 2, 2, rhs2, rhs3); diff --git a/library/UnitTests/LibUtilities/LinearAlgebra/TestSymmetricMatrixStoragePolicy.cpp b/library/UnitTests/LibUtilities/LinearAlgebra/TestSymmetricMatrixStoragePolicy.cpp index a405c7982..403e4ae68 100644 --- a/library/UnitTests/LibUtilities/LinearAlgebra/TestSymmetricMatrixStoragePolicy.cpp +++ b/library/UnitTests/LibUtilities/LinearAlgebra/TestSymmetricMatrixStoragePolicy.cpp @@ -59,39 +59,39 @@ namespace Nektar unsigned int curRow = 0; unsigned int curColumn = 0; - boost::tie(curRow, curColumn) = Policy::Advance(3, 3, curRow, curColumn); + std::tie(curRow, curColumn) = Policy::Advance(3, 3, curRow, curColumn); BOOST_CHECK_EQUAL(1, curRow); BOOST_CHECK_EQUAL(0, curColumn); - boost::tie(curRow, curColumn) = Policy::Advance(3, 3, curRow, curColumn); + std::tie(curRow, curColumn) = Policy::Advance(3, 3, curRow, curColumn); BOOST_CHECK_EQUAL(2, curRow); BOOST_CHECK_EQUAL(0, curColumn); - boost::tie(curRow, curColumn) = Policy::Advance(3, 3, curRow, curColumn); + std::tie(curRow, curColumn) = Policy::Advance(3, 3, curRow, curColumn); BOOST_CHECK_EQUAL(0, curRow); BOOST_CHECK_EQUAL(1, curColumn); - boost::tie(curRow, curColumn) = Policy::Advance(3, 3, curRow, curColumn); + std::tie(curRow, curColumn) = Policy::Advance(3, 3, curRow, curColumn); BOOST_CHECK_EQUAL(1, curRow); BOOST_CHECK_EQUAL(1, curColumn); - boost::tie(curRow, curColumn) = Policy::Advance(3, 3, curRow, curColumn); + std::tie(curRow, curColumn) = Policy::Advance(3, 3, curRow, curColumn); BOOST_CHECK_EQUAL(2, curRow); BOOST_CHECK_EQUAL(1, curColumn); - boost::tie(curRow, curColumn) = Policy::Advance(3, 3, curRow, curColumn); + std::tie(curRow, curColumn) = Policy::Advance(3, 3, curRow, curColumn); BOOST_CHECK_EQUAL(0, curRow); BOOST_CHECK_EQUAL(2, curColumn); - boost::tie(curRow, curColumn) = Policy::Advance(3, 3, curRow, curColumn); + std::tie(curRow, curColumn) = Policy::Advance(3, 3, curRow, curColumn); BOOST_CHECK_EQUAL(1, curRow); BOOST_CHECK_EQUAL(2, curColumn); - boost::tie(curRow, curColumn) = Policy::Advance(3, 3, curRow, curColumn); + std::tie(curRow, curColumn) = Policy::Advance(3, 3, curRow, curColumn); BOOST_CHECK_EQUAL(2, curRow); BOOST_CHECK_EQUAL(2, curColumn); - boost::tie(curRow, curColumn) = Policy::Advance(3, 3, curRow, curColumn); + std::tie(curRow, curColumn) = Policy::Advance(3, 3, curRow, curColumn); BOOST_CHECK_EQUAL(std::numeric_limits::max(), curRow); BOOST_CHECK_EQUAL(std::numeric_limits::max(), curColumn); } @@ -100,7 +100,7 @@ namespace Nektar unsigned int curRow = 0; unsigned int curColumn = 0; - boost::tie(curRow, curColumn) = Policy::Advance(1, 1, curRow, curColumn); + std::tie(curRow, curColumn) = Policy::Advance(1, 1, curRow, curColumn); BOOST_CHECK_EQUAL(std::numeric_limits::max(), curRow); BOOST_CHECK_EQUAL(std::numeric_limits::max(), curColumn); } @@ -109,19 +109,19 @@ namespace Nektar unsigned int curRow = 0; unsigned int curColumn = 0; - boost::tie(curRow, curColumn) = Policy::Advance(2, 2, curRow, curColumn); + std::tie(curRow, curColumn) = Policy::Advance(2, 2, curRow, curColumn); BOOST_CHECK_EQUAL(1, curRow); BOOST_CHECK_EQUAL(0, curColumn); - boost::tie(curRow, curColumn) = Policy::Advance(2, 2, curRow, curColumn); + std::tie(curRow, curColumn) = Policy::Advance(2, 2, curRow, curColumn); BOOST_CHECK_EQUAL(0, curRow); BOOST_CHECK_EQUAL(1, curColumn); - boost::tie(curRow, curColumn) = Policy::Advance(2, 2, curRow, curColumn); + std::tie(curRow, curColumn) = Policy::Advance(2, 2, curRow, curColumn); BOOST_CHECK_EQUAL(1, curRow); BOOST_CHECK_EQUAL(1, curColumn); - boost::tie(curRow, curColumn) = Policy::Advance(2, 2, curRow, curColumn); + std::tie(curRow, curColumn) = Policy::Advance(2, 2, curRow, curColumn); BOOST_CHECK_EQUAL(std::numeric_limits::max(), curRow); BOOST_CHECK_EQUAL(std::numeric_limits::max(), curColumn); } diff --git a/library/UnitTests/LibUtilities/LinearAlgebra/TestTriangularMatrixOperations.cpp b/library/UnitTests/LibUtilities/LinearAlgebra/TestTriangularMatrixOperations.cpp index afe57828c..da8f933e3 100644 --- a/library/UnitTests/LibUtilities/LinearAlgebra/TestTriangularMatrixOperations.cpp +++ b/library/UnitTests/LibUtilities/LinearAlgebra/TestTriangularMatrixOperations.cpp @@ -78,7 +78,7 @@ namespace Nektar NekDouble a_buf[] = {1, 2, 5, 3, 6, 8, 4, 7, 9, 10}; NekDouble x_buf[] = {10, 20, 30, 40}; - boost::shared_ptr > m( + std::shared_ptr > m( new NekMatrix(4, 4, a_buf, eUPPER_TRIANGULAR)); NekMatrix, ScaledMatrixTag> scaled(2, m); NekVector x(4, x_buf); @@ -120,7 +120,7 @@ namespace Nektar NekDouble a_buf[] = {1, 2, 5, 3, 6, 8, 4, 7, 9, 10}; NekDouble x_buf[] = {10, 20, 30, 40}; - boost::shared_ptr > m( + std::shared_ptr > m( new NekMatrix(4, 4, a_buf, eLOWER_TRIANGULAR)); NekMatrix, ScaledMatrixTag > scaled(3.0, m); NekVector x(4, x_buf); diff --git a/library/UnitTests/LibUtilities/LinearAlgebra/TestUpperTriangularMatrixStoragePolicy.cpp b/library/UnitTests/LibUtilities/LinearAlgebra/TestUpperTriangularMatrixStoragePolicy.cpp index e74bdbe4f..c2f249f8e 100644 --- a/library/UnitTests/LibUtilities/LinearAlgebra/TestUpperTriangularMatrixStoragePolicy.cpp +++ b/library/UnitTests/LibUtilities/LinearAlgebra/TestUpperTriangularMatrixStoragePolicy.cpp @@ -60,27 +60,27 @@ namespace Nektar unsigned int curRow = 0; unsigned int curColumn = 0; - boost::tie(curRow, curColumn) = Policy::Advance(3, 3, curRow, curColumn); + std::tie(curRow, curColumn) = Policy::Advance(3, 3, curRow, curColumn); BOOST_CHECK_EQUAL(0u, curRow); BOOST_CHECK_EQUAL(1u, curColumn); - boost::tie(curRow, curColumn) = Policy::Advance(3, 3, curRow, curColumn); + std::tie(curRow, curColumn) = Policy::Advance(3, 3, curRow, curColumn); BOOST_CHECK_EQUAL(1u, curRow); BOOST_CHECK_EQUAL(1u, curColumn); - boost::tie(curRow, curColumn) = Policy::Advance(3, 3, curRow, curColumn); + std::tie(curRow, curColumn) = Policy::Advance(3, 3, curRow, curColumn); BOOST_CHECK_EQUAL(0u, curRow); BOOST_CHECK_EQUAL(2u, curColumn); - boost::tie(curRow, curColumn) = Policy::Advance(3, 3, curRow, curColumn); + std::tie(curRow, curColumn) = Policy::Advance(3, 3, curRow, curColumn); BOOST_CHECK_EQUAL(1u, curRow); BOOST_CHECK_EQUAL(2u, curColumn); - boost::tie(curRow, curColumn) = Policy::Advance(3, 3, curRow, curColumn); + std::tie(curRow, curColumn) = Policy::Advance(3, 3, curRow, curColumn); BOOST_CHECK_EQUAL(2u, curRow); BOOST_CHECK_EQUAL(2u, curColumn); - boost::tie(curRow, curColumn) = Policy::Advance(3, 3, curRow, curColumn); + std::tie(curRow, curColumn) = Policy::Advance(3, 3, curRow, curColumn); BOOST_CHECK_EQUAL(std::numeric_limits::max(), curRow); BOOST_CHECK_EQUAL(std::numeric_limits::max(), curColumn); } @@ -89,7 +89,7 @@ namespace Nektar unsigned int curRow = 0; unsigned int curColumn = 0; - boost::tie(curRow, curColumn) = Policy::Advance(1, 1, curRow, curColumn); + std::tie(curRow, curColumn) = Policy::Advance(1, 1, curRow, curColumn); BOOST_CHECK_EQUAL(std::numeric_limits::max(), curRow); BOOST_CHECK_EQUAL(std::numeric_limits::max(), curColumn); } @@ -98,15 +98,15 @@ namespace Nektar unsigned int curRow = 0; unsigned int curColumn = 0; - boost::tie(curRow, curColumn) = Policy::Advance(2, 2, curRow, curColumn); + std::tie(curRow, curColumn) = Policy::Advance(2, 2, curRow, curColumn); BOOST_CHECK_EQUAL(0u, curRow); BOOST_CHECK_EQUAL(1u, curColumn); - boost::tie(curRow, curColumn) = Policy::Advance(2, 2, curRow, curColumn); + std::tie(curRow, curColumn) = Policy::Advance(2, 2, curRow, curColumn); BOOST_CHECK_EQUAL(1u, curRow); BOOST_CHECK_EQUAL(1u, curColumn); - boost::tie(curRow, curColumn) = Policy::Advance(2, 2, curRow, curColumn); + std::tie(curRow, curColumn) = Policy::Advance(2, 2, curRow, curColumn); BOOST_CHECK_EQUAL(std::numeric_limits::max(), curRow); BOOST_CHECK_EQUAL(std::numeric_limits::max(), curColumn); } diff --git a/library/UnitTests/LibUtilities/TestConsistentObjectAccess.cpp b/library/UnitTests/LibUtilities/TestConsistentObjectAccess.cpp index 8e2febfc0..0c11bf50c 100644 --- a/library/UnitTests/LibUtilities/TestConsistentObjectAccess.cpp +++ b/library/UnitTests/LibUtilities/TestConsistentObjectAccess.cpp @@ -108,32 +108,32 @@ namespace Nektar double* d1 = new double(1.0); const double* d2 = new double(2.0); - boost::shared_ptr sd1(d1); - boost::shared_ptr sd2(d2); + std::shared_ptr sd1(d1); + std::shared_ptr sd2(d2); - BOOST_CHECK_EQUAL(*d1, ConsistentObjectAccess >::reference(sd1)); - BOOST_CHECK_EQUAL(d1, &ConsistentObjectAccess >::reference(sd1)); - BOOST_CHECK_EQUAL(*d1, ConsistentObjectAccess >::const_reference(sd1)); - BOOST_CHECK_EQUAL(d1, &ConsistentObjectAccess >::const_reference(sd1)); - BOOST_CHECK_EQUAL(d1, ConsistentObjectAccess >::pointer(sd1)); - BOOST_CHECK_EQUAL(d1, ConsistentObjectAccess >::const_pointer(sd1)); - BOOST_CHECK(ConsistentObjectAccess >::ReferencesObject(sd1)); - BOOST_CHECK(!ConsistentObjectAccess >::ReferencesObject(boost::shared_ptr())); + BOOST_CHECK_EQUAL(*d1, ConsistentObjectAccess >::reference(sd1)); + BOOST_CHECK_EQUAL(d1, &ConsistentObjectAccess >::reference(sd1)); + BOOST_CHECK_EQUAL(*d1, ConsistentObjectAccess >::const_reference(sd1)); + BOOST_CHECK_EQUAL(d1, &ConsistentObjectAccess >::const_reference(sd1)); + BOOST_CHECK_EQUAL(d1, ConsistentObjectAccess >::pointer(sd1)); + BOOST_CHECK_EQUAL(d1, ConsistentObjectAccess >::const_pointer(sd1)); + BOOST_CHECK(ConsistentObjectAccess >::ReferencesObject(sd1)); + BOOST_CHECK(!ConsistentObjectAccess >::ReferencesObject(std::shared_ptr())); - BOOST_CHECK_EQUAL(*d2, ConsistentObjectAccess >::reference(sd2)); - BOOST_CHECK_EQUAL(d2, &ConsistentObjectAccess >::reference(sd2)); - BOOST_CHECK_EQUAL(*d2, ConsistentObjectAccess >::const_reference(sd2)); - BOOST_CHECK_EQUAL(d2, &ConsistentObjectAccess >::const_reference(sd2)); - BOOST_CHECK_EQUAL(d2, ConsistentObjectAccess >::pointer(sd2)); - BOOST_CHECK_EQUAL(d2, ConsistentObjectAccess >::const_pointer(sd2)); - BOOST_CHECK(ConsistentObjectAccess >::ReferencesObject(sd2)); - BOOST_CHECK(!ConsistentObjectAccess >::ReferencesObject(boost::shared_ptr())); + BOOST_CHECK_EQUAL(*d2, ConsistentObjectAccess >::reference(sd2)); + BOOST_CHECK_EQUAL(d2, &ConsistentObjectAccess >::reference(sd2)); + BOOST_CHECK_EQUAL(*d2, ConsistentObjectAccess >::const_reference(sd2)); + BOOST_CHECK_EQUAL(d2, &ConsistentObjectAccess >::const_reference(sd2)); + BOOST_CHECK_EQUAL(d2, ConsistentObjectAccess >::pointer(sd2)); + BOOST_CHECK_EQUAL(d2, ConsistentObjectAccess >::const_pointer(sd2)); + BOOST_CHECK(ConsistentObjectAccess >::ReferencesObject(sd2)); + BOOST_CHECK(!ConsistentObjectAccess >::ReferencesObject(std::shared_ptr())); #if defined(NEKTAR_DEBUG) || defined(NEKTAR_FULLDEBUG) - BOOST_CHECK_THROW(ConsistentObjectAccess >::const_reference(boost::shared_ptr()), ErrorUtil::NekError); - BOOST_CHECK_THROW(ConsistentObjectAccess >::const_reference(boost::shared_ptr()), ErrorUtil::NekError); - BOOST_CHECK_THROW(ConsistentObjectAccess >::reference(boost::shared_ptr()), ErrorUtil::NekError); - BOOST_CHECK_THROW(ConsistentObjectAccess >::reference(boost::shared_ptr()), ErrorUtil::NekError); + BOOST_CHECK_THROW(ConsistentObjectAccess >::const_reference(std::shared_ptr()), ErrorUtil::NekError); + BOOST_CHECK_THROW(ConsistentObjectAccess >::const_reference(std::shared_ptr()), ErrorUtil::NekError); + BOOST_CHECK_THROW(ConsistentObjectAccess >::reference(std::shared_ptr()), ErrorUtil::NekError); + BOOST_CHECK_THROW(ConsistentObjectAccess >::reference(std::shared_ptr()), ErrorUtil::NekError); #endif } diff --git a/library/UnitTests/LibUtilities/TestNekMatrixMultiplication.cpp b/library/UnitTests/LibUtilities/TestNekMatrixMultiplication.cpp index b389660df..b92ddf8e1 100644 --- a/library/UnitTests/LibUtilities/TestNekMatrixMultiplication.cpp +++ b/library/UnitTests/LibUtilities/TestNekMatrixMultiplication.cpp @@ -164,9 +164,9 @@ namespace Nektar 11, 16, 20, 12, 17, 21}; - boost::shared_ptr > lhsInnerMatrix( + std::shared_ptr > lhsInnerMatrix( new NekMatrix(3, 3, buf1)); - boost::shared_ptr > rhsInnerMatrix( + std::shared_ptr > rhsInnerMatrix( new NekMatrix(3, 3, buf2)); NekMatrix, ScaledMatrixTag> lhs(2.0, lhsInnerMatrix); @@ -205,7 +205,7 @@ namespace Nektar double buf2[] = { 10, 11, 12}; - boost::shared_ptr > innerMatrix( + std::shared_ptr > innerMatrix( new NekMatrix(3, 3, buf1)); NekMatrix, ScaledMatrixTag> lhs(2.0, innerMatrix); NekVector rhs(3, buf2); @@ -229,7 +229,7 @@ namespace Nektar 3, 6, 9, 12}; double buf2[] = { 10, 11, 12}; - boost::shared_ptr > innerMatrix( + std::shared_ptr > innerMatrix( new NekMatrix(4, 3, buf1)); NekMatrix, ScaledMatrixTag> lhs(3.0, innerMatrix); NekVector rhs(3, buf2); diff --git a/library/UnitTests/LibUtilities/TestNekMatrixOperations.cpp b/library/UnitTests/LibUtilities/TestNekMatrixOperations.cpp index 1c3742157..1d30317ed 100644 --- a/library/UnitTests/LibUtilities/TestNekMatrixOperations.cpp +++ b/library/UnitTests/LibUtilities/TestNekMatrixOperations.cpp @@ -43,7 +43,6 @@ #include #include #include -#include #include namespace Nektar @@ -97,16 +96,16 @@ namespace Nektar void GenerateFullMatrices(double values[], double scale, - boost::shared_ptr >& m1, - boost::shared_ptr, ScaledMatrixTag> >& m2, - boost::shared_ptr, BlockMatrixTag> >& m3) + std::shared_ptr >& m1, + std::shared_ptr, ScaledMatrixTag> >& m2, + std::shared_ptr, BlockMatrixTag> >& m3) { m1 = MakePtr(new NekMatrix(4, 4, values)); double inner_values[16]; - std::transform(values, values+16, inner_values, boost::bind(std::divides(), _1, scale)); + std::transform(values, values+16, inner_values, std::bind(std::divides(), std::placeholders::_1, scale)); - boost::shared_ptr > inner( + std::shared_ptr > inner( new NekMatrix(4, 4, inner_values)); m2 = MakePtr(new NekMatrix, ScaledMatrixTag>(scale, inner)); @@ -118,10 +117,10 @@ namespace Nektar values[12], values[13]}; double block_4_values[] = {values[10], values[11], values[14], values[15]}; - boost::shared_ptr > block1(new NekMatrix(2, 2, block_1_values)); - boost::shared_ptr > block2(new NekMatrix(2, 2, block_2_values)); - boost::shared_ptr > block3(new NekMatrix(2, 2, block_3_values)); - boost::shared_ptr > block4(new NekMatrix(2, 2, block_4_values)); + std::shared_ptr > block1(new NekMatrix(2, 2, block_1_values)); + std::shared_ptr > block2(new NekMatrix(2, 2, block_2_values)); + std::shared_ptr > block3(new NekMatrix(2, 2, block_3_values)); + std::shared_ptr > block4(new NekMatrix(2, 2, block_4_values)); m3 = MakePtr(new NekMatrix, BlockMatrixTag>(2, 2, 2, 2)); m3->SetBlock(0,0, block1); @@ -131,16 +130,16 @@ namespace Nektar } void GenerateUpperTriangularMatrices(NekDouble values[], NekDouble scale, - boost::shared_ptr >& m1, - boost::shared_ptr, ScaledMatrixTag> >& m2, - boost::shared_ptr, BlockMatrixTag> >& m3) + std::shared_ptr >& m1, + std::shared_ptr, ScaledMatrixTag> >& m2, + std::shared_ptr, BlockMatrixTag> >& m3) { m1 = MakePtr(new NekMatrix(4, 4, values, eUPPER_TRIANGULAR)); double inner_values[10]; - std::transform(values, values+10, inner_values, boost::bind(std::divides(), _1, scale)); + std::transform(values, values+10, inner_values, std::bind(std::divides(), std::placeholders::_1, scale)); - boost::shared_ptr > inner( + std::shared_ptr > inner( new NekMatrix(4, 4, inner_values, eUPPER_TRIANGULAR)); m2 = MakePtr(new NekMatrix, ScaledMatrixTag>(scale, inner)); @@ -150,9 +149,9 @@ namespace Nektar values[6], values[7]}; double block_4_values[] = {values[5], 0.0, values[8], values[9]}; - boost::shared_ptr > block1(new NekMatrix(2, 2, block_1_values)); - boost::shared_ptr > block2(new NekMatrix(2, 2, block_2_values)); - boost::shared_ptr > block4(new NekMatrix(2, 2, block_4_values)); + std::shared_ptr > block1(new NekMatrix(2, 2, block_1_values)); + std::shared_ptr > block2(new NekMatrix(2, 2, block_2_values)); + std::shared_ptr > block4(new NekMatrix(2, 2, block_4_values)); m3 = MakePtr(new NekMatrix, BlockMatrixTag>(2, 2, 2, 2)); m3->SetBlock(0,0, block1); @@ -165,16 +164,16 @@ namespace Nektar { // void GenerateDiagonalMatrices(double values[], double scale, -// boost::shared_ptr >& m1, -// boost::shared_ptr, FullMatrixTag, ScaledMatrixTag> >& m2, -// boost::shared_ptr, FullMatrixTag, BlockMatrixTag> >& m3) +// std::shared_ptr >& m1, +// std::shared_ptr, FullMatrixTag, ScaledMatrixTag> >& m2, +// std::shared_ptr, FullMatrixTag, BlockMatrixTag> >& m3) // { // m1 = MakePtr(new NekMatrix(4, 4, values)); // // double inner_values[4]; -// std::transform(values, values+4, inner_values, boost::bind(std::divides(), _1, scale)); +// std::transform(values, values+4, inner_values, std::bind(std::divides(), std::placeholders::_1, scale)); // -// boost::shared_ptr > inner( +// std::shared_ptr > inner( // new NekMatrix(4, 4, inner_values)); // m2 = MakePtr(new NekMatrix, DiagonalMatrixTag, ScaledMatrixTag>(scale, inner)); // @@ -186,10 +185,10 @@ namespace Nektar // values[12], values[13]}; // double block_4_values[] = {values[10], values[11], // values[14], values[15]}; -// boost::shared_ptr > block1(new NekMatrix(2, 2, block_1_values)); -// boost::shared_ptr > block2(new NekMatrix(2, 2, block_2_values)); -// boost::shared_ptr > block3(new NekMatrix(2, 2, block_3_values)); -// boost::shared_ptr > block4(new NekMatrix(2, 2, block_4_values)); +// std::shared_ptr > block1(new NekMatrix(2, 2, block_1_values)); +// std::shared_ptr > block2(new NekMatrix(2, 2, block_2_values)); +// std::shared_ptr > block3(new NekMatrix(2, 2, block_3_values)); +// std::shared_ptr > block4(new NekMatrix(2, 2, block_4_values)); // // m3 = MakePtr(new NekMatrix, FullMatrixTag, BlockMatrixTag>(2, 2, 2, 2)); // m3->SetBlock(0,0, block1); @@ -209,9 +208,9 @@ namespace Nektar 6, 14, 22, 30, 8, 16, 24, 32}; - boost::shared_ptr > lhs1; - boost::shared_ptr, ScaledMatrixTag> > lhs2; - boost::shared_ptr, BlockMatrixTag> > lhs3; + std::shared_ptr > lhs1; + std::shared_ptr, ScaledMatrixTag> > lhs2; + std::shared_ptr, BlockMatrixTag> > lhs3; GenerateFullMatrices(lhs_values, 2.0, lhs1, lhs2, lhs3); //double rhs_values[] = {4, 8, 12, 16, @@ -222,9 +221,9 @@ namespace Nektar 8, 24, 40, 56, 12, 28, 44, 60, 16, 32, 48, 64}; - boost::shared_ptr > rhs1; - boost::shared_ptr, ScaledMatrixTag> > rhs2; - boost::shared_ptr, BlockMatrixTag> > rhs3; + std::shared_ptr > rhs1; + std::shared_ptr, ScaledMatrixTag> > rhs2; + std::shared_ptr, BlockMatrixTag> > rhs3; GenerateFullMatrices(rhs_values, 2.0, rhs1, rhs2, rhs3); double result_values[16]; @@ -241,15 +240,15 @@ namespace Nektar // 18, 20, 22, 24, // 26, 28, 30, 32}; // -// boost::shared_ptr > lhs1; -// boost::shared_ptr, FullMatrixTag, ScaledMatrixTag> > lhs2; -// boost::shared_ptr, FullMatrixTag, BlockMatrixTag> > lhs3; +// std::shared_ptr > lhs1; +// std::shared_ptr, FullMatrixTag, ScaledMatrixTag> > lhs2; +// std::shared_ptr, FullMatrixTag, BlockMatrixTag> > lhs3; // GenerateMatrices(lhs_values, 2.0, lhs1, lhs2, lhs3); // double rhs_values[] = {10, 20, 30, 40}; -// boost::shared_ptr > rhs1; -// boost::shared_ptr, DiagonalMatrixTag, ScaledMatrixTag> > rhs2; -// boost::shared_ptr, DiagonalMatrixTag, BlockMatrixTag> > rhs3; +// std::shared_ptr > rhs1; +// std::shared_ptr, DiagonalMatrixTag, ScaledMatrixTag> > rhs2; +// std::shared_ptr, DiagonalMatrixTag, BlockMatrixTag> > rhs3; // GenerateDiagonalMatrices(rhs_values, 2.0, rhs1, rhs2, rhs3); } @@ -282,8 +281,8 @@ namespace Nektar SharedNekMatrixPtr inner1(new NekMatrix(2,2,buf)); SharedNekMatrixPtr inner2(new NekMatrix(2,2,buf)); - boost::shared_ptr m1(new DNekScalMat(2.0, inner1)); - boost::shared_ptr m2(new DNekScalMat(3.0, inner2)); + std::shared_ptr m1(new DNekScalMat(2.0, inner1)); + std::shared_ptr m2(new DNekScalMat(3.0, inner2)); (*m1)*2.0; @@ -306,9 +305,9 @@ namespace Nektar 6, 14, 22, 8, 16, 24, 32}; - boost::shared_ptr > lhs1; - boost::shared_ptr, ScaledMatrixTag> > lhs2; - boost::shared_ptr, BlockMatrixTag> > lhs3; + std::shared_ptr > lhs1; + std::shared_ptr, ScaledMatrixTag> > lhs2; + std::shared_ptr, BlockMatrixTag> > lhs3; GenerateUpperTriangularMatrices(lhs_values, 2.0, lhs1, lhs2, lhs3); //double rhs_values[] = {4, 8, 12, 16, @@ -319,9 +318,9 @@ namespace Nektar 8, 24, 12, 28, 44, 16, 32, 48, 64}; - boost::shared_ptr > rhs1; - boost::shared_ptr, ScaledMatrixTag> > rhs2; - boost::shared_ptr, BlockMatrixTag> > rhs3; + std::shared_ptr > rhs1; + std::shared_ptr, ScaledMatrixTag> > rhs2; + std::shared_ptr, BlockMatrixTag> > rhs3; GenerateUpperTriangularMatrices(rhs_values, 2.0, rhs1, rhs2, rhs3); double result_values[10]; @@ -350,9 +349,9 @@ namespace Nektar 6, 14, 22, 30, 8, 16, 24, 32}; - boost::shared_ptr > lhs1; - boost::shared_ptr, ScaledMatrixTag> > lhs2; - boost::shared_ptr, BlockMatrixTag> > lhs3; + std::shared_ptr > lhs1; + std::shared_ptr, ScaledMatrixTag> > lhs2; + std::shared_ptr, BlockMatrixTag> > lhs3; GenerateFullMatrices(lhs_values, 2.0, lhs1, lhs2, lhs3); //double rhs_values[] = {4, 8, 12, 16, @@ -363,9 +362,9 @@ namespace Nektar 8, 24, 40, 56, 12, 28, 44, 60, 16, 32, 48, 64}; - boost::shared_ptr > rhs1; - boost::shared_ptr, ScaledMatrixTag> > rhs2; - boost::shared_ptr, BlockMatrixTag> > rhs3; + std::shared_ptr > rhs1; + std::shared_ptr, ScaledMatrixTag> > rhs2; + std::shared_ptr, BlockMatrixTag> > rhs3; GenerateFullMatrices(rhs_values, 2.0, rhs1, rhs2, rhs3); double result_values[16]; diff --git a/library/UnitTests/LibUtilities/TestRawType.cpp b/library/UnitTests/LibUtilities/TestRawType.cpp index e1ba5bd4e..5806a4f8a 100644 --- a/library/UnitTests/LibUtilities/TestRawType.cpp +++ b/library/UnitTests/LibUtilities/TestRawType.cpp @@ -34,55 +34,90 @@ // /////////////////////////////////////////////////////////////////////////////// -#include #include -#include +#include namespace Nektar { - BOOST_MPL_ASSERT(( boost::is_same::type> )); - BOOST_MPL_ASSERT(( boost::is_same::type> )); - BOOST_MPL_ASSERT(( boost::is_same::type> )); - BOOST_MPL_ASSERT(( boost::is_same::type> )); - - BOOST_MPL_ASSERT(( boost::is_same::type> )); - BOOST_MPL_ASSERT(( boost::is_same::type> )); - BOOST_MPL_ASSERT(( boost::is_same::type> )); - BOOST_MPL_ASSERT(( boost::is_same::type> )); +static_assert(std::is_same::type>::value, + "RawType error"); +static_assert(std::is_same::type>::value, + "RawType error"); +static_assert(std::is_same::type>::value, + "RawType error"); +static_assert(std::is_same::type>::value, + "RawType error"); - BOOST_MPL_ASSERT(( boost::is_same::type> )); - BOOST_MPL_ASSERT(( boost::is_same::type> )); - BOOST_MPL_ASSERT(( boost::is_same::type> )); - BOOST_MPL_ASSERT(( boost::is_same::type> )); +static_assert(std::is_same::type>::value, + "RawType error"); +static_assert(std::is_same::type>::value, + "RawType error"); +static_assert(std::is_same::type>::value, + "RawType error"); +static_assert(std::is_same::type>::value, + "RawType error"); - BOOST_MPL_ASSERT(( boost::is_same::type> )); - BOOST_MPL_ASSERT(( boost::is_same::type> )); - BOOST_MPL_ASSERT(( boost::is_same::type> )); - BOOST_MPL_ASSERT(( boost::is_same::type> )); +static_assert(std::is_same::type>::value, + "RawType error"); +static_assert(std::is_same::type>::value, + "RawType error"); +static_assert(std::is_same::type>::value, + "RawType error"); +static_assert(std::is_same::type>::value, + "RawType error"); - BOOST_MPL_ASSERT(( boost::is_same::type> )); - BOOST_MPL_ASSERT(( boost::is_same::type> )); - BOOST_MPL_ASSERT(( boost::is_same::type> )); - BOOST_MPL_ASSERT(( boost::is_same::type> )); - - BOOST_MPL_ASSERT(( boost::is_same >::type> )); - BOOST_MPL_ASSERT(( boost::is_same >::type> )); - BOOST_MPL_ASSERT(( boost::is_same >::type> )); - BOOST_MPL_ASSERT(( boost::is_same >::type> )); - - BOOST_MPL_ASSERT(( boost::is_same >::type> )); - BOOST_MPL_ASSERT(( boost::is_same >::type> )); - BOOST_MPL_ASSERT(( boost::is_same >::type> )); - BOOST_MPL_ASSERT(( boost::is_same >::type> )); - - BOOST_MPL_ASSERT(( boost::is_same >::type> )); - BOOST_MPL_ASSERT(( boost::is_same >::type> )); - BOOST_MPL_ASSERT(( boost::is_same >::type> )); - BOOST_MPL_ASSERT(( boost::is_same >::type> )); - - BOOST_MPL_ASSERT(( boost::is_same >::type> )); - BOOST_MPL_ASSERT(( boost::is_same >::type> )); - BOOST_MPL_ASSERT(( boost::is_same >::type> )); - BOOST_MPL_ASSERT(( boost::is_same >::type> )); +static_assert(std::is_same::type>::value, + "RawType error"); +static_assert(std::is_same::type>::value, + "RawType error"); +static_assert(std::is_same::type>::value, + "RawType error"); +static_assert(std::is_same::type>::value, + "RawType error"); + +static_assert(std::is_same::type>::value, + "RawType error"); +static_assert(std::is_same::type>::value, + "RawType error"); +static_assert(std::is_same::type>::value, + "RawType error"); +static_assert(std::is_same::type>::value, + "RawType error"); + +static_assert(std::is_same >::type>::value, + "RawType error"); +static_assert(std::is_same >::type>::value, + "RawType error"); +static_assert(std::is_same >::type>::value, + "RawType error"); +static_assert(std::is_same >::type>::value, + "RawType error"); + +static_assert(std::is_same >::type>::value, + "RawType error"); +static_assert(std::is_same >::type>::value, + "RawType error"); +static_assert(std::is_same >::type>::value, + "RawType error"); +static_assert(std::is_same >::type>::value, + "RawType error"); + +static_assert(std::is_same >::type>::value, + "RawType error"); +static_assert(std::is_same >::type>::value, + "RawType error"); +static_assert(std::is_same >::type>::value, + "RawType error"); +static_assert(std::is_same >::type>::value, + "RawType error"); + +static_assert(std::is_same >::type>::value, + "RawType error"); +static_assert(std::is_same >::type>::value, + "RawType error"); +static_assert(std::is_same >::type>::value, + "RawType error"); +static_assert(std::is_same >::type>::value, + "RawType error"); } diff --git a/library/UnitTests/LocalRegions/TestGetCoords.cpp b/library/UnitTests/LocalRegions/TestGetCoords.cpp index e8632f737..b9e008150 100644 --- a/library/UnitTests/LocalRegions/TestGetCoords.cpp +++ b/library/UnitTests/LocalRegions/TestGetCoords.cpp @@ -182,8 +182,8 @@ namespace Nektar Array c1 = Array(hexExp->GetTotPoints()); Array c2 = Array(hexExp->GetTotPoints()); hexExp->GetCoords(c0, c1, c2); - boost::shared_ptr stdHex = - boost::dynamic_pointer_cast(hexExp); + std::shared_ptr stdHex = + std::dynamic_pointer_cast(hexExp); stdHex->GetCoords(c0, c1, c2); double epsilon = 1.0e-8; BOOST_CHECK_CLOSE(c0[0], -1.0, epsilon); diff --git a/library/UnitTests/Memory/TestNekMemoryManager.cpp b/library/UnitTests/Memory/TestNekMemoryManager.cpp index 02097087e..53fcc7967 100644 --- a/library/UnitTests/Memory/TestNekMemoryManager.cpp +++ b/library/UnitTests/Memory/TestNekMemoryManager.cpp @@ -99,28 +99,28 @@ namespace Nektar CountedObject::ClearCounters(); { - boost::shared_ptr > ob1 = MemoryManager >::AllocateSharedPtr(); + std::shared_ptr > ob1 = MemoryManager >::AllocateSharedPtr(); BOOST_CHECK_EQUAL(CountedObject::numberDefaultConstructed, 1u); BOOST_CHECK_EQUAL(CountedObject::numberOf1ParameterConstructions, 0u); BOOST_CHECK_EQUAL(CountedObject::numberOf2ParameterConstructions, 0u); BOOST_CHECK_EQUAL(CountedObject::numberOf3ParameterConstructions, 0u); int one = 1; - boost::shared_ptr > ob2 = MemoryManager >::AllocateSharedPtr(one); + std::shared_ptr > ob2 = MemoryManager >::AllocateSharedPtr(one); BOOST_CHECK_EQUAL(CountedObject::numberDefaultConstructed, 1u); BOOST_CHECK_EQUAL(CountedObject::numberOf1ParameterConstructions, 1u); BOOST_CHECK_EQUAL(CountedObject::numberOf2ParameterConstructions, 0u); BOOST_CHECK_EQUAL(CountedObject::numberOf3ParameterConstructions, 0u); int two = 2; - boost::shared_ptr > ob3 = MemoryManager >::AllocateSharedPtr(one, two); + std::shared_ptr > ob3 = MemoryManager >::AllocateSharedPtr(one, two); BOOST_CHECK_EQUAL(CountedObject::numberDefaultConstructed, 1u); BOOST_CHECK_EQUAL(CountedObject::numberOf1ParameterConstructions, 1u); BOOST_CHECK_EQUAL(CountedObject::numberOf2ParameterConstructions, 1u); BOOST_CHECK_EQUAL(CountedObject::numberOf3ParameterConstructions, 0u); int three = 3; - boost::shared_ptr > ob4 = MemoryManager >::AllocateSharedPtr(one, two, three); + std::shared_ptr > ob4 = MemoryManager >::AllocateSharedPtr(one, two, three); BOOST_CHECK_EQUAL(CountedObject::numberDefaultConstructed, 1u); BOOST_CHECK_EQUAL(CountedObject::numberOf1ParameterConstructions, 1u); BOOST_CHECK_EQUAL(CountedObject::numberOf2ParameterConstructions, 1u); @@ -140,8 +140,8 @@ namespace Nektar BOOST_AUTO_TEST_CASE(ReproduceMemoryErrors) { - boost::shared_ptr m = MemoryManager::AllocateSharedPtr(); - boost::shared_ptr m1 = MemoryManager::AllocateSharedPtr(); + std::shared_ptr m = MemoryManager::AllocateSharedPtr(); + std::shared_ptr m1 = MemoryManager::AllocateSharedPtr(); m1 = MemoryManager::AllocateSharedPtr(); } } diff --git a/library/UnitTests/ScaledMatrixUnitTests.cpp b/library/UnitTests/ScaledMatrixUnitTests.cpp index d1fbeb44e..8f5c8e7ff 100644 --- a/library/UnitTests/ScaledMatrixUnitTests.cpp +++ b/library/UnitTests/ScaledMatrixUnitTests.cpp @@ -51,10 +51,10 @@ namespace Nektar double d[] = {1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0, 10.0, 11.0, 12.0}; - boost::shared_ptr o(new OwnedType(3, 4, d)); + std::shared_ptr o(new OwnedType(3, 4, d)); NekMatrix m1(2.0, o); - boost::shared_ptr > m2(new NekMatrix(3.0, o)); - boost::shared_ptr > m3(new NekMatrix(0.0, o)); + std::shared_ptr > m2(new NekMatrix(3.0, o)); + std::shared_ptr > m3(new NekMatrix(0.0, o)); BOOST_CHECK_EQUAL(m1.Scale(), 2.0); //BOOST_CHECK_EQUAL(m2->Scale(), 3.0); @@ -73,10 +73,10 @@ namespace Nektar 2.0, 6.0, 10.0, 3.0, 7.0, 11.0, 4.0, 8.0, 12.0}; - boost::shared_ptr o(new OwnedType(3, 4, d)); + std::shared_ptr o(new OwnedType(3, 4, d)); NekMatrix m1(2.0, o); - boost::shared_ptr > m2(new NekMatrix(3.0, o)); - boost::shared_ptr > m3(new NekMatrix(0.0, o)); + std::shared_ptr > m2(new NekMatrix(3.0, o)); + std::shared_ptr > m3(new NekMatrix(0.0, o)); BOOST_CHECK_EQUAL(m1(0,0), 2.0); BOOST_CHECK_EQUAL(m1(0,1), 4.0); @@ -127,10 +127,10 @@ namespace Nektar 2.0, 6.0, 10.0, 3.0, 7.0, 11.0, 4.0, 8.0, 12.0}; - boost::shared_ptr o(new OwnedType(3, 4, d)); + std::shared_ptr o(new OwnedType(3, 4, d)); NekMatrix m1(2.0, o); - boost::shared_ptr > m2(new NekMatrix(3.0, o)); - boost::shared_ptr > m3(new NekMatrix(0.0, o)); + std::shared_ptr > m2(new NekMatrix(3.0, o)); + std::shared_ptr > m3(new NekMatrix(0.0, o)); BOOST_CHECK_EQUAL(m1.GetStorageSize(), 12); BOOST_CHECK_EQUAL(m2->GetStorageSize(), 12); @@ -144,10 +144,10 @@ namespace Nektar 2.0, 6.0, 10.0, 3.0, 7.0, 11.0, 4.0, 8.0, 12.0}; - boost::shared_ptr o(new OwnedType(3, 4, d)); + std::shared_ptr o(new OwnedType(3, 4, d)); NekMatrix m1(2.0, o); - boost::shared_ptr > m2(new NekMatrix(3.0, o)); - boost::shared_ptr > m3(new NekMatrix(0.0, o)); + std::shared_ptr > m2(new NekMatrix(3.0, o)); + std::shared_ptr > m3(new NekMatrix(0.0, o)); BOOST_CHECK_EQUAL(m1.GetStorageType(), eFULL); BOOST_CHECK_EQUAL(m2->GetStorageType(), eFULL); diff --git a/library/UnitTests/testBoostUtil.cpp b/library/UnitTests/testBoostUtil.cpp index 6166645c9..4b3dfa4b6 100644 --- a/library/UnitTests/testBoostUtil.cpp +++ b/library/UnitTests/testBoostUtil.cpp @@ -72,11 +72,11 @@ namespace Nektar BOOST_AUTO_TEST_CASE(testMakePtr) { - boost::shared_ptr > a(new FakeClass()); - //FakeClass& b = ConsistentObjectAccess > >::reference(a); + std::shared_ptr > a(new FakeClass()); + //FakeClass& b = ConsistentObjectAccess > >::reference(a); { - boost::shared_ptr p = MakePtr(new TestClass()); + std::shared_ptr p = MakePtr(new TestClass()); BOOST_CHECK(TestClass::constructionCount == 1); BOOST_CHECK(TestClass::destructionCount == 0); } diff --git a/library/UnitTests/testLinearSystem.cpp b/library/UnitTests/testLinearSystem.cpp index 7e591033d..7a6987ec4 100644 --- a/library/UnitTests/testLinearSystem.cpp +++ b/library/UnitTests/testLinearSystem.cpp @@ -51,11 +51,11 @@ namespace Nektar double b_buf[] = { 20, 50, 10 }; - boost::shared_ptr > A(new NekMatrix(3,3,matrix_buf,eDIAGONAL)); + std::shared_ptr > A(new NekMatrix(3,3,matrix_buf,eDIAGONAL)); NekVector b1(3, b_buf); - boost::shared_ptr > b2(new NekVector(3, b_buf)); + std::shared_ptr > b2(new NekVector(3, b_buf)); NekVector b3(3, b_buf); - boost::shared_ptr > b4(new NekVector(3, b_buf)); + std::shared_ptr > b4(new NekVector(3, b_buf)); LinearSystem linsys(A); @@ -89,16 +89,16 @@ namespace Nektar double b_buf[] = { 20, 50, 10 }; - boost::shared_ptr > A(new NekMatrix(3,3,matrix_buf,eDIAGONAL)); + std::shared_ptr > A(new NekMatrix(3,3,matrix_buf,eDIAGONAL)); NekVector b1(3, b_buf); - boost::shared_ptr > b2(new NekVector(3, b_buf)); + std::shared_ptr > b2(new NekVector(3, b_buf)); NekVector b3(3, b_buf); - boost::shared_ptr > b4(new NekVector(3, b_buf)); + std::shared_ptr > b4(new NekVector(3, b_buf)); NekVector result1(3,0.0); - boost::shared_ptr > result2(new NekVector(3, 0.0)); + std::shared_ptr > result2(new NekVector(3, 0.0)); NekVector result3(3, 0.0); - boost::shared_ptr > result4(new NekVector(3, 0.0)); + std::shared_ptr > result4(new NekVector(3, 0.0)); LinearSystem linsys(A); double expected_result_buf[] = { 2, 10, 5 }; @@ -122,8 +122,8 @@ namespace Nektar double result_buf[] = { 20, 50, 10 }; - boost::shared_ptr > A(new NekMatrix(3,3,matrix_buf,eDIAGONAL)); - boost::shared_ptr > b(new NekVector(3, result_buf)); + std::shared_ptr > A(new NekMatrix(3,3,matrix_buf,eDIAGONAL)); + std::shared_ptr > b(new NekVector(3, result_buf)); LinearSystem linsys(A); @@ -133,7 +133,7 @@ namespace Nektar NekVector expectedResult(3, expected_result_buf); BOOST_CHECK_EQUAL(result, expectedResult); - boost::shared_ptr > b1 = b; + std::shared_ptr > b1 = b; NekVector result1 = linsys.Solve(b1); BOOST_CHECK_EQUAL(result1, expectedResult); @@ -149,8 +149,8 @@ namespace Nektar double result_buf[] = { 20, 50, 10 }; - boost::shared_ptr > A(new NekMatrix(3,3,matrix_buf,eFULL)); - boost::shared_ptr > b(new NekVector(3,result_buf)); + std::shared_ptr > A(new NekMatrix(3,3,matrix_buf,eFULL)); + std::shared_ptr > b(new NekVector(3,result_buf)); LinearSystem linsys(A); @@ -171,8 +171,8 @@ namespace Nektar double b_buf[] = {-941, 348}; - boost::shared_ptr > A(new NekMatrix(2, 2, matrix_buf,eFULL)); - boost::shared_ptr > b(new NekVector(2, b_buf)); + std::shared_ptr > A(new NekMatrix(2, 2, matrix_buf,eFULL)); + std::shared_ptr > b(new NekVector(2, b_buf)); LinearSystem linsys(A); NekVector result = linsys.Solve(b); @@ -203,8 +203,8 @@ namespace Nektar double b_buf[] = {12719, -3169, -16810, 7408, -14945, -6822, 10166, 7023, 8679, -11826}; - boost::shared_ptr > A(new NekMatrix(10, 10, matrix_buf,eFULL)); - boost::shared_ptr > b(new NekVector(10, b_buf)); + std::shared_ptr > A(new NekMatrix(10, 10, matrix_buf,eFULL)); + std::shared_ptr > b(new NekVector(10, b_buf)); LinearSystem linsys(A); NekVector result = linsys.SolveTranspose(b); @@ -227,7 +227,7 @@ namespace Nektar // //typedef NekMatrix BlockMatrix; // //typedef BlockMatrix::InnerMatrixType InnerMatrixType; // // -// //boost::shared_ptr m1(new BlockMatrix(4, 2, 2)); +// //std::shared_ptr m1(new BlockMatrix(4, 2, 2)); // //const double m1_buf0[] = {-91, -47, 94, 83}; // //const double m1_buf1[] = {49, 78, 80, 72}; // //const double m1_buf2[] = {87, 79, 31, -34}; @@ -239,7 +239,7 @@ namespace Nektar // //m1->GetBlock(3,3) = InnerMatrixType(2, 2, m1_buf3); // // // //double b_vals[] = {-7198, 7642, 1344, 3744, -9968, 115, -2469, 8424}; -// //boost::shared_ptr > b(new NekVector(8, b_vals)); +// //std::shared_ptr > b(new NekVector(8, b_vals)); // // // //LinearSystem > linsys(m1, b); // // @@ -272,8 +272,8 @@ namespace Nektar double b_buf[] = {12719, -3169, -16810, 7408, -14945, -6822, 10166, 7023, 8679, -11826}; double result_buf[10]; - boost::shared_ptr > A(new NekMatrix(10, 10, matrix_buf,eFULL)); - boost::shared_ptr > b(new NekVector(Array(10, b_buf), eWrapper)); + std::shared_ptr > A(new NekMatrix(10, 10, matrix_buf,eFULL)); + std::shared_ptr > b(new NekVector(Array(10, b_buf), eWrapper)); NekVector result(Array(10, result_buf), eWrapper); LinearSystem linsys(A); diff --git a/library/UnitTests/testNekManager.cpp b/library/UnitTests/testNekManager.cpp index eced52f49..fc780014c 100644 --- a/library/UnitTests/testNekManager.cpp +++ b/library/UnitTests/testNekManager.cpp @@ -62,9 +62,9 @@ // // // // Test stuff. -// boost::shared_ptr MyCreator(const int &key) +// std::shared_ptr MyCreator(const int &key) // { -// return boost::shared_ptr(new DoubleWrapper(key + 2.5));; +// return std::shared_ptr(new DoubleWrapper(key + 2.5));; // }; // // class Temp @@ -72,18 +72,18 @@ // public: // Temp() {}; // -// static boost::shared_ptr create(const int &key) +// static std::shared_ptr create(const int &key) // { -// return boost::shared_ptr(new DoubleWrapper(key*1.025)); +// return std::shared_ptr(new DoubleWrapper(key*1.025)); // } // }; // // class GlobalCreator // { // public: -// boost::shared_ptr operator()(const int& key) +// std::shared_ptr operator()(const int& key) // { -// return boost::shared_ptr(new DoubleWrapper(key)); +// return std::shared_ptr(new DoubleWrapper(key)); // } // }; // @@ -102,18 +102,18 @@ // // Registering a static class method // manager.RegisterCreator(20, Temp::create); // -// boost::shared_ptr value = manager[key]; +// std::shared_ptr value = manager[key]; // BOOST_CHECK(value->val == 12.5); // // value = manager[20]; // BOOST_CHECK(value->val == 20.5); // -// manager[17] = boost::shared_ptr(new DoubleWrapper(-2.0)); +// manager[17] = std::shared_ptr(new DoubleWrapper(-2.0)); // BOOST_CHECK_EQUAL(manager[17]->val, -2.0); // } // // -//// typedef boost::shared_ptr > MatrixType; +//// typedef std::shared_ptr > MatrixType; //// //// MatrixType create(int k) //// { @@ -124,7 +124,7 @@ //// { //// NekManager > manager(create); //// -//// manager[10] = boost::shared_ptr >(new NekMatrix(3, 3)); +//// manager[10] = std::shared_ptr >(new NekMatrix(3, 3)); //// //// if( manager[11] ) //// { diff --git a/library/UnitTests/testNekMatrix.cpp b/library/UnitTests/testNekMatrix.cpp index 0619f7f80..ace32f460 100644 --- a/library/UnitTests/testNekMatrix.cpp +++ b/library/UnitTests/testNekMatrix.cpp @@ -119,8 +119,8 @@ namespace Nektar BOOST_AUTO_TEST_CASE(TestNekMatrixConstruction) { { - boost::shared_ptr > a(new Nektar::NekMatrix(3,4)); - boost::shared_ptr > b(new Nektar::NekMatrix(5,6)); + std::shared_ptr > a(new Nektar::NekMatrix(3,4)); + std::shared_ptr > b(new Nektar::NekMatrix(5,6)); BOOST_CHECK_EQUAL(a->GetRows(), 3u); BOOST_CHECK_EQUAL(a->GetColumns(), 4u); @@ -140,8 +140,8 @@ namespace Nektar } { - boost::shared_ptr > a(new Nektar::NekMatrix(3,3, eDIAGONAL)); - boost::shared_ptr > b(new Nektar::NekMatrix(5,5,eDIAGONAL)); + std::shared_ptr > a(new Nektar::NekMatrix(3,3, eDIAGONAL)); + std::shared_ptr > b(new Nektar::NekMatrix(5,5,eDIAGONAL)); BOOST_CHECK_EQUAL(a->GetRows(), 3); BOOST_CHECK_EQUAL(a->GetColumns(), 3); @@ -192,8 +192,8 @@ namespace Nektar BOOST_CHECK_THROW( m(4,3), ErrorUtil::NekError); #endif //NEKTAR_FULLDEBUG - boost::shared_ptr > m1(new Nektar::NekMatrix(4, 3, data)); - boost::shared_ptr > m2(new Nektar::NekMatrix(4, 3, data)); + std::shared_ptr > m1(new Nektar::NekMatrix(4, 3, data)); + std::shared_ptr > m2(new Nektar::NekMatrix(4, 3, data)); BOOST_CHECK_EQUAL( (*m1)(0,0), 1.0 ); BOOST_CHECK_EQUAL( (*m1)(0,1), 2.0 ); @@ -246,8 +246,8 @@ namespace Nektar UnitTests::RedirectCerrIfNeeded(); double data[] = {8.9, 3.4, 5.7}; Nektar::NekMatrix m1(3, 3, data, eDIAGONAL); - boost::shared_ptr > m2(new Nektar::NekMatrix(3, 3, data, eDIAGONAL)); - boost::shared_ptr > m3(new Nektar::NekMatrix(3, 3, data, eDIAGONAL)); + std::shared_ptr > m2(new Nektar::NekMatrix(3, 3, data, eDIAGONAL)); + std::shared_ptr > m3(new Nektar::NekMatrix(3, 3, data, eDIAGONAL)); BOOST_CHECK_EQUAL(m1(0,0), 8.9); BOOST_CHECK_EQUAL((*m2)(0,0), 8.9); @@ -307,8 +307,8 @@ namespace Nektar double data[] = {1.0, 3.0, 5.0, 2.0, 4.0, 6.0}; Nektar::NekMatrix m1(3, 2, data); - boost::shared_ptr > m2(new Nektar::NekMatrix(3, 2, data)); - boost::shared_ptr > m3(new Nektar::NekMatrix(3, 2, data)); + std::shared_ptr > m2(new Nektar::NekMatrix(3, 2, data)); + std::shared_ptr > m3(new Nektar::NekMatrix(3, 2, data)); m1.SetValue(0,0,-1.0); m2->SetValue(1,1,-2.0); @@ -341,8 +341,8 @@ namespace Nektar UnitTests::RedirectCerrIfNeeded(); double data[] = {8.9, 3.4, 5.7}; Nektar::NekMatrix m1(3, 3, data, eDIAGONAL); - boost::shared_ptr > m2(new Nektar::NekMatrix(3, 3, data, eDIAGONAL)); - boost::shared_ptr > m3(new Nektar::NekMatrix(3, 3, data, eDIAGONAL)); + std::shared_ptr > m2(new Nektar::NekMatrix(3, 3, data, eDIAGONAL)); + std::shared_ptr > m3(new Nektar::NekMatrix(3, 3, data, eDIAGONAL)); m1.SetValue(0,0,1.0); m2->SetValue(1,1,2.0); @@ -553,110 +553,3 @@ namespace Nektar } } - - -/** - $Log: testNekMatrix.cpp,v $ - Revision 1.33 2008/05/30 23:43:42 bnelson - Redirected the ASSERT messages to a file when running unit tests. - - Revision 1.32 2008/04/22 05:22:47 bnelson - Speed enhancements. - - Revision 1.31 2008/04/06 06:04:54 bnelson - Changed ConstArray to Array - - Revision 1.30 2007/10/03 03:01:01 bnelson - *** empty log message *** - - Revision 1.29 2007/09/12 03:59:41 bnelson - *** empty log message *** - - Revision 1.28 2007/07/22 23:04:28 bnelson - Backed out Nektar::ptr. - - Revision 1.27 2007/07/20 02:24:41 bnelson - Replaced boost::shared_ptr with Nektar::ptr - - Revision 1.26 2007/07/11 04:00:33 bnelson - Added invert tests. - - Revision 1.25 2007/07/11 03:18:23 bnelson - *** empty log message *** - - Revision 1.24 2007/06/10 23:45:59 bnelson - Matrix updates. - - Revision 1.23 2007/05/15 05:19:55 bnelson - Updated to use the new Array object. - - Revision 1.22 2007/03/29 19:42:03 bnelson - *** empty log message *** - - Revision 1.21 2007/02/13 02:47:23 bnelson - *** empty log message *** - - Revision 1.20 2007/01/18 20:59:28 sherwin - Before new configuration - - Revision 1.19 2007/01/16 05:31:34 bnelson - Major improvements for expression templates. - - Revision 1.18 2006/10/30 05:08:13 bnelson - Added preliminary linear system and block matrix support. - - Revision 1.17 2006/10/02 01:20:48 bnelson - Started working on adding BLAS and LAPACK - - Revision 1.16 2006/09/30 15:38:29 bnelson - no message - - Revision 1.15 2006/09/11 03:28:41 bnelson - no message - - Revision 1.14 2006/08/25 01:38:59 bnelson - no message - - Revision 1.13 2006/08/25 01:36:25 bnelson - no message - - Revision 1.12 2006/08/14 02:35:45 bnelson - Added many LinearAlgebra tests - - Revision 1.11 2006/06/05 02:23:17 bnelson - Updates for the reorganization of LibUtilities. - - Revision 1.10 2006/05/31 23:24:47 bnelson - Updated NekMatrix method names for the coding standard. - - Revision 1.9 2006/05/31 04:19:36 bnelson - Removed a test for invalid access to a matrix. - - Revision 1.8 2006/05/29 03:40:48 bnelson - Updated the tests to reflect the changed parameter order in the NekMatrix constructor. - - Revision 1.7 2006/05/25 02:54:54 bnelson - Added Matrix/Vector multiplication test. - - Revision 1.6 2006/05/18 04:25:19 bnelson - Added a multiplication test. - - Revision 1.5 2006/05/16 20:35:30 jfrazier - Added the float literal specifier to make the unit test happy. - - Revision 1.4 2006/05/15 05:06:07 bnelson - Added addition tests. - - Revision 1.3 2006/05/15 04:10:35 bnelson - no message - - Revision 1.2 2006/05/14 21:33:58 bnelson - *** empty log message *** - - Revision 1.1 2006/05/07 21:10:09 bnelson - *** empty log message *** - - **/ - - - diff --git a/library/UnitTests/testNekSharedArray.cpp b/library/UnitTests/testNekSharedArray.cpp index 32268928b..b4e95d86c 100644 --- a/library/UnitTests/testNekSharedArray.cpp +++ b/library/UnitTests/testNekSharedArray.cpp @@ -763,9 +763,9 @@ namespace Nektar BOOST_AUTO_TEST_CASE(TestSharedPtr) { - boost::shared_ptr a(new double[10]); - boost::shared_ptr b(a); - boost::shared_ptr c; + std::shared_ptr a(new double[10]); + std::shared_ptr b(a); + std::shared_ptr c; c = a; } diff --git a/library/UnitTests/testNekVector.cpp b/library/UnitTests/testNekVector.cpp index 1216a4817..a73d2066e 100644 --- a/library/UnitTests/testNekVector.cpp +++ b/library/UnitTests/testNekVector.cpp @@ -214,7 +214,7 @@ namespace Nektar 3.0, 6.0, 9.0}; double vector_buf[] = {20.0, 30.0, 40.0}; - boost::shared_ptr > m(new NekMatrix(3, 3, matrix_buf)); + std::shared_ptr > m(new NekMatrix(3, 3, matrix_buf)); NekMatrix, ScaledMatrixTag> s(2.0, m); NekVector v(3, vector_buf); NekVector result = s*v; @@ -234,9 +234,9 @@ namespace Nektar double m3_buf[] = {9.0, 11.0, 10.0, 12.0}; double vector_buf[] = {20.0, 30.0}; - boost::shared_ptr > m1(new NekMatrix(2, 2, m1_buf)); - boost::shared_ptr > m2(new NekMatrix(2, 2, m2_buf)); - boost::shared_ptr > m3(new NekMatrix(2, 2, m3_buf)); + std::shared_ptr > m1(new NekMatrix(2, 2, m1_buf)); + std::shared_ptr > m2(new NekMatrix(2, 2, m2_buf)); + std::shared_ptr > m3(new NekMatrix(2, 2, m3_buf)); NekMatrix, BlockMatrixTag> b(3, 1, 2, 2); b.SetBlock(0,0,m1); diff --git a/solvers/ADRSolver/EquationSystems/CFLtester.cpp b/solvers/ADRSolver/EquationSystems/CFLtester.cpp index e66f4ca49..b5e6008a3 100644 --- a/solvers/ADRSolver/EquationSystems/CFLtester.cpp +++ b/solvers/ADRSolver/EquationSystems/CFLtester.cpp @@ -247,13 +247,13 @@ namespace Nektar int npoints = m_fields[0]->GetExp(el)->GetTotPoints(); Array one2D(npoints, 1.0); //NekDouble Area = m_fields[0]->GetExp(el)->Integral(one2D); - if(boost::dynamic_pointer_cast(m_fields[0]->GetExp(el))) + if(std::dynamic_pointer_cast(m_fields[0]->GetExp(el))) { //tstep[el] = timeCFL/(stdVelocity[el]*cLambda*(ExpOrder[el]-1)*(ExpOrder[el]-1)); //tstep[el] = timeCFL*minLengthStdTri/(stdVelocity[el]*cLambda*(ExpOrder[el]-1)*(ExpOrder[el]-1)); tstep[el] = CFL[el]/(stdVelocity[el]); } - else if(boost::dynamic_pointer_cast(m_fields[0]->GetExp(el))) + else if(std::dynamic_pointer_cast(m_fields[0]->GetExp(el))) { //tstep[el] = timeCFL/(stdVelocity[el]*cLambda*(ExpOrder[el]-1)*(ExpOrder[el]-1)); //tstep[el] = timeCFL*minLengthStdQuad/(stdVelocity[el]*cLambda*(ExpOrder[el]-1)*(ExpOrder[el]-1)); diff --git a/solvers/CardiacEPSolver/CellModels/CellModel.h b/solvers/CardiacEPSolver/CellModels/CellModel.h index a486e76a5..dd3b601d5 100644 --- a/solvers/CardiacEPSolver/CellModels/CellModel.h +++ b/solvers/CardiacEPSolver/CellModels/CellModel.h @@ -53,7 +53,7 @@ namespace Nektar typedef std::vector > SummaryList; /// A shared pointer to an EquationSystem object - typedef boost::shared_ptr CellModelSharedPtr; + typedef std::shared_ptr CellModelSharedPtr; /// Datatype of the NekFactory used to instantiate classes derived from /// the EquationSystem class. typedef LibUtilities::NekFactory< std::string, CellModel, diff --git a/solvers/CardiacEPSolver/EquationSystems/Bidomain.cpp b/solvers/CardiacEPSolver/EquationSystems/Bidomain.cpp index d09924eb0..940518f58 100644 --- a/solvers/CardiacEPSolver/EquationSystems/Bidomain.cpp +++ b/solvers/CardiacEPSolver/EquationSystems/Bidomain.cpp @@ -158,8 +158,8 @@ namespace Nektar { if (x->first == "CheckpointCellModel") { - boost::shared_ptr c - = boost::dynamic_pointer_cast( + std::shared_ptr c + = std::dynamic_pointer_cast( m_filters[k]); c->SetCellModel(m_cell); } diff --git a/solvers/CardiacEPSolver/EquationSystems/BidomainRoth.cpp b/solvers/CardiacEPSolver/EquationSystems/BidomainRoth.cpp index 1897d4e9c..d9e8ba3a7 100644 --- a/solvers/CardiacEPSolver/EquationSystems/BidomainRoth.cpp +++ b/solvers/CardiacEPSolver/EquationSystems/BidomainRoth.cpp @@ -303,8 +303,8 @@ void BidomainRoth::v_InitObject() { if (x->first == "CheckpointCellModel") { - boost::shared_ptr c - = boost::dynamic_pointer_cast( + std::shared_ptr c + = std::dynamic_pointer_cast( m_filters[k]); c->SetCellModel(m_cell); } diff --git a/solvers/CardiacEPSolver/EquationSystems/Monodomain.cpp b/solvers/CardiacEPSolver/EquationSystems/Monodomain.cpp index 58dd3ccb2..84293dd8d 100644 --- a/solvers/CardiacEPSolver/EquationSystems/Monodomain.cpp +++ b/solvers/CardiacEPSolver/EquationSystems/Monodomain.cpp @@ -286,15 +286,15 @@ namespace Nektar { if (x->first == "CheckpointCellModel") { - boost::shared_ptr c - = boost::dynamic_pointer_cast( + std::shared_ptr c + = std::dynamic_pointer_cast( m_filters[k]); c->SetCellModel(m_cell); } if (x->first == "CellHistoryPoints") { - boost::shared_ptr c - = boost::dynamic_pointer_cast( + std::shared_ptr c + = std::dynamic_pointer_cast( m_filters[k]); c->SetCellModel(m_cell); } diff --git a/solvers/CardiacEPSolver/Stimuli/Protocol.h b/solvers/CardiacEPSolver/Stimuli/Protocol.h index 9ae675d52..9c65c1aa6 100644 --- a/solvers/CardiacEPSolver/Stimuli/Protocol.h +++ b/solvers/CardiacEPSolver/Stimuli/Protocol.h @@ -45,7 +45,7 @@ namespace Nektar class Protocol; /// A shared pointer to an EquationSystem object - typedef boost::shared_ptr ProtocolSharedPtr; + typedef std::shared_ptr ProtocolSharedPtr; /// Datatype of the NekFactory used to instantiate classes derived from /// the EquationSystem class. diff --git a/solvers/CardiacEPSolver/Stimuli/Stimulus.h b/solvers/CardiacEPSolver/Stimuli/Stimulus.h index 56e08aaf7..4ee45c764 100644 --- a/solvers/CardiacEPSolver/Stimuli/Stimulus.h +++ b/solvers/CardiacEPSolver/Stimuli/Stimulus.h @@ -50,7 +50,7 @@ namespace Nektar class Stimulus; /// A shared pointer to an EquationSystem object - typedef boost::shared_ptr StimulusSharedPtr; + typedef std::shared_ptr StimulusSharedPtr; /// Datatype of the NekFactory used to instantiate classes derived from /// the EquationSystem class. diff --git a/solvers/CardiacEPSolver/Utilities/CellMLToNektar/CellMLToNektarTranslator.py b/solvers/CardiacEPSolver/Utilities/CellMLToNektar/CellMLToNektarTranslator.py index e8ef14daf..4de5e24b2 100644 --- a/solvers/CardiacEPSolver/Utilities/CellMLToNektar/CellMLToNektarTranslator.py +++ b/solvers/CardiacEPSolver/Utilities/CellMLToNektar/CellMLToNektarTranslator.py @@ -354,7 +354,7 @@ class CellMLToNektarTranslator(translators.CellMLTranslator): # Write out the modifier member variables. if self.use_modifiers: for var in self.modifier_vars: - self.writeln_hpp('boost::shared_ptr mp_' + var.oxmeta_name + '_modifier', self.STMT_END) + self.writeln_hpp('std::shared_ptr mp_' + var.oxmeta_name + '_modifier', self.STMT_END) # Methods associated with oxmeta annotated variables # Don't use LT & modifiers for the const methods @@ -409,11 +409,11 @@ class CellMLToNektarTranslator(translators.CellMLTranslator): self.has_default_stimulus = True nodeset = self.calculate_extended_dependencies(filter(None, vars.values())) - self.output_method_start('UseCellMLDefaultStimulus', [], 'boost::shared_ptr', 'public') + self.output_method_start('UseCellMLDefaultStimulus', [], 'std::shared_ptr', 'public') self.open_block() self.output_comment('Use the default stimulus specified by CellML metadata') self.output_equations(nodeset) - self.writeln('boost::shared_ptr p_cellml_stim(new RegularStimulus(') + self.writeln('std::shared_ptr p_cellml_stim(new RegularStimulus(') self.writeln(' -fabs(', self.code_name(vars['amplitude']), '),') self.writeln(' ', self.code_name(vars['duration']), ',') self.writeln(' ', self.code_name(vars['period']), ',') @@ -485,11 +485,11 @@ class CellMLToNektarTranslator(translators.CellMLTranslator): if self.use_backward_euler or self.options.rush_larsen or self.options.grl1 or self.options.grl2: # Keep the same signature as forward cell models, but note that the solver isn't used - solver1 = 'boost::shared_ptr /* unused; should be empty */' + solver1 = 'std::shared_ptr /* unused; should be empty */' solver2 = '' #solver1 = solver2 = '' else: #this currently outputs the boilerplate stuff - solver1 = 'boost::shared_ptrALPHA pSolverBRAVO' + solver1 = 'std::shared_ptrALPHA pSolverBRAVO' solver2 = '"' + self.class_name + '"' if self.use_lookup_tables and self.separate_lut_class: @@ -508,7 +508,7 @@ class CellMLToNektarTranslator(translators.CellMLTranslator): # Constructor self.set_access('public') - self.output_constructor([solver1, 'boost::shared_ptr pIntracellularStimulus'], + self.output_constructor([solver1, 'std::shared_ptr pIntracellularStimulus'], [solver2, self.class_name + '::create','"Description of the model?"']) # Destructor #self.output_method_start(''+self.class_name, [], '') @@ -2221,8 +2221,8 @@ class CellMLToNektarTranslator(translators.CellMLTranslator): # ' * t, const unsigned int fileVersion)', # indent_offset=1) # self.open_block(subsidiary=True) - # self.writeln_hpp('const boost::shared_ptr p_solver = t->GetSolver();') - # self.writeln_hpp('const boost::shared_ptr p_stimulus = t->GetStimulusFunction();') + # self.writeln_hpp('const std::shared_ptr p_solver = t->GetSolver();') + # self.writeln_hpp('const std::shared_ptr p_stimulus = t->GetStimulusFunction();') # self.writeln_hpp('ar << p_solver;') # self.writeln_hpp('ar << p_stimulus;') # self.close_block(subsidiary=True) @@ -2233,8 +2233,8 @@ class CellMLToNektarTranslator(translators.CellMLTranslator): # ' * t, const unsigned int fileVersion)', # indent_offset=1) # self.open_block(subsidiary=True) - # self.writeln_hpp('boost::shared_ptr p_solver;') - # self.writeln_hpp('boost::shared_ptr p_stimulus;') + # self.writeln_hpp('std::shared_ptr p_solver;') + # self.writeln_hpp('std::shared_ptr p_stimulus;') # self.writeln_hpp('ar >> p_solver;') # self.writeln_hpp('ar >> p_stimulus;') # self.writeln_hpp('::new(t)', self.class_name, '(p_solver, p_stimulus);') @@ -2246,8 +2246,8 @@ class CellMLToNektarTranslator(translators.CellMLTranslator): # self.writeln('extern "C"') # self.open_block() # self.writeln('AbstractCardiacCellInterface* MakeCardiacCell(') - # self.writeln('boost::shared_ptr pSolver,', indent_offset=2) - # self.writeln('boost::shared_ptr pStimulus)', indent_offset=2) + # self.writeln('std::shared_ptr pSolver,', indent_offset=2) + # self.writeln('std::shared_ptr pStimulus)', indent_offset=2) # self.open_block() # self.writeln('return new ', self.class_name, '(pSolver, pStimulus);') # self.close_block() diff --git a/solvers/CompressibleFlowSolver/ArtificialDiffusion/ArtificialDiffusion.h b/solvers/CompressibleFlowSolver/ArtificialDiffusion/ArtificialDiffusion.h index 902d11aa1..37b673d45 100644 --- a/solvers/CompressibleFlowSolver/ArtificialDiffusion/ArtificialDiffusion.h +++ b/solvers/CompressibleFlowSolver/ArtificialDiffusion/ArtificialDiffusion.h @@ -51,7 +51,7 @@ namespace Nektar class ArtificialDiffusion; /// A shared pointer to a artificial diffusion object -typedef boost::shared_ptr ArtificialDiffusionSharedPtr; +typedef std::shared_ptr ArtificialDiffusionSharedPtr; /// Declaration of the artificial diffusion factory typedef LibUtilities::NekFactory CFSBndCondSharedPtr; +typedef std::shared_ptr CFSBndCondSharedPtr; /// Declaration of the boundary condition factory typedef LibUtilities::NekFactory VariableConverterSharedPtr; + typedef std::shared_ptr VariableConverterSharedPtr; /** * */ diff --git a/solvers/IncNavierStokesSolver/AdvectionTerms/LinearisedAdvection.h b/solvers/IncNavierStokesSolver/AdvectionTerms/LinearisedAdvection.h index ccd559920..c47f07407 100644 --- a/solvers/IncNavierStokesSolver/AdvectionTerms/LinearisedAdvection.h +++ b/solvers/IncNavierStokesSolver/AdvectionTerms/LinearisedAdvection.h @@ -55,7 +55,7 @@ class LinearisedAdvection: public SolverUtils::Advection /// matrices. typedef std::map< FloquetMatType, DNekBlkMatSharedPtr> FloquetBlockMatrixMap; /// A shared pointer to a BlockMatrixMap. - typedef boost::shared_ptr FloquetBlockMatrixMapShPtr; + typedef std::shared_ptr FloquetBlockMatrixMapShPtr; public: friend class MemoryManager; diff --git a/solvers/IncNavierStokesSolver/EquationSystems/CoupledLinearNS.h b/solvers/IncNavierStokesSolver/EquationSystems/CoupledLinearNS.h index 0d4f0dece..806ba4a7b 100644 --- a/solvers/IncNavierStokesSolver/EquationSystems/CoupledLinearNS.h +++ b/solvers/IncNavierStokesSolver/EquationSystems/CoupledLinearNS.h @@ -41,7 +41,6 @@ #include #include #include -#include #include //#include diff --git a/solvers/IncNavierStokesSolver/EquationSystems/CoupledLocalToGlobalC0ContMap.h b/solvers/IncNavierStokesSolver/EquationSystems/CoupledLocalToGlobalC0ContMap.h index 724b376b6..6743b2654 100644 --- a/solvers/IncNavierStokesSolver/EquationSystems/CoupledLocalToGlobalC0ContMap.h +++ b/solvers/IncNavierStokesSolver/EquationSystems/CoupledLocalToGlobalC0ContMap.h @@ -62,7 +62,7 @@ namespace Nektar Array &AddMeanPressureToEdgeId); }; - typedef boost::shared_ptr CoupledLocalToGlobalC0ContMapSharedPtr; + typedef std::shared_ptr CoupledLocalToGlobalC0ContMapSharedPtr; } #endif diff --git a/solvers/IncNavierStokesSolver/EquationSystems/Extrapolate.cpp b/solvers/IncNavierStokesSolver/EquationSystems/Extrapolate.cpp index eaefb7c53..b4c7479c9 100644 --- a/solvers/IncNavierStokesSolver/EquationSystems/Extrapolate.cpp +++ b/solvers/IncNavierStokesSolver/EquationSystems/Extrapolate.cpp @@ -791,7 +791,7 @@ namespace Nektar } LibUtilities::Equation coeff = - boost::static_pointer_cast< + std::static_pointer_cast< SpatialDomains::RobinBoundaryCondition >(m_PBndConds[n])->m_robinPrimitiveCoeff; @@ -804,7 +804,7 @@ namespace Nektar UBndConds = m_fields[m_velocity[i]]->GetBndConditions(); LibUtilities::Equation coeff1 = - boost::static_pointer_cast< + std::static_pointer_cast< SpatialDomains::RobinBoundaryCondition >(UBndConds[n])->m_robinPrimitiveCoeff; @@ -849,7 +849,7 @@ namespace Nektar [m_pressureCalls-1]); SpatialDomains::RobinBCShPtr rcond = - boost::dynamic_pointer_cast< + std::dynamic_pointer_cast< SpatialDomains::RobinBoundaryCondition >(UBndConds[n]); SpatialDomains::BoundaryConditionShPtr bcond = diff --git a/solvers/IncNavierStokesSolver/EquationSystems/Extrapolate.h b/solvers/IncNavierStokesSolver/EquationSystems/Extrapolate.h index 8c59d257e..a000122ed 100644 --- a/solvers/IncNavierStokesSolver/EquationSystems/Extrapolate.h +++ b/solvers/IncNavierStokesSolver/EquationSystems/Extrapolate.h @@ -58,7 +58,7 @@ namespace Nektar // Forward declaration class Extrapolate; - typedef boost::shared_ptr ExtrapolateSharedPtr; + typedef std::shared_ptr ExtrapolateSharedPtr; typedef LibUtilities::NekFactory< std::string, Extrapolate, const LibUtilities::SessionReaderSharedPtr& , Array& , @@ -67,7 +67,7 @@ namespace Nektar const SolverUtils::AdvectionSharedPtr& > ExtrapolateFactory; struct HighOrderOutflow; - typedef boost::shared_ptr HighOrderOutflowSharedPtr; + typedef std::shared_ptr HighOrderOutflowSharedPtr; ExtrapolateFactory& GetExtrapolateFactory(); diff --git a/solvers/IncNavierStokesSolver/EquationSystems/IncNavierStokes.cpp b/solvers/IncNavierStokesSolver/EquationSystems/IncNavierStokes.cpp index 1dc64d790..eaf559526 100644 --- a/solvers/IncNavierStokesSolver/EquationSystems/IncNavierStokes.cpp +++ b/solvers/IncNavierStokesSolver/EquationSystems/IncNavierStokes.cpp @@ -234,7 +234,7 @@ namespace Nektar BndExp[n]->GetCoords(x0,x1,x2); LibUtilities::Equation coeff = - boost::static_pointer_cast< + std::static_pointer_cast< SpatialDomains::RobinBoundaryCondition >(BndConds[n])->m_robinPrimitiveCoeff; diff --git a/solvers/IncNavierStokesSolver/EquationSystems/IncNavierStokes.h b/solvers/IncNavierStokesSolver/EquationSystems/IncNavierStokes.h index 1e866cb03..8dfe6a6e7 100644 --- a/solvers/IncNavierStokesSolver/EquationSystems/IncNavierStokes.h +++ b/solvers/IncNavierStokesSolver/EquationSystems/IncNavierStokes.h @@ -121,7 +121,7 @@ namespace Nektar Array m_axispoint; }; - typedef boost::shared_ptr WomersleyParamsSharedPtr; + typedef std::shared_ptr WomersleyParamsSharedPtr; /** * \brief This class is the base class for Navier Stokes problems @@ -269,7 +269,7 @@ namespace Nektar }; - typedef boost::shared_ptr IncNavierStokesSharedPtr; + typedef std::shared_ptr IncNavierStokesSharedPtr; } //end of namespace diff --git a/solvers/IncNavierStokesSolver/EquationSystems/MappingExtrapolate.h b/solvers/IncNavierStokesSolver/EquationSystems/MappingExtrapolate.h index e8292bb5d..4d06e66d6 100644 --- a/solvers/IncNavierStokesSolver/EquationSystems/MappingExtrapolate.h +++ b/solvers/IncNavierStokesSolver/EquationSystems/MappingExtrapolate.h @@ -47,7 +47,7 @@ namespace Nektar class MappingExtrapolate; -typedef boost::shared_ptr MappingExtrapolateSharedPtr; +typedef std::shared_ptr MappingExtrapolateSharedPtr; class MappingExtrapolate : public StandardExtrapolate { diff --git a/solvers/IncNavierStokesSolver/EquationSystems/StandardExtrapolate.h b/solvers/IncNavierStokesSolver/EquationSystems/StandardExtrapolate.h index ab2467b49..e3b0f17c8 100644 --- a/solvers/IncNavierStokesSolver/EquationSystems/StandardExtrapolate.h +++ b/solvers/IncNavierStokesSolver/EquationSystems/StandardExtrapolate.h @@ -53,7 +53,7 @@ namespace Nektar class StandardExtrapolate; - typedef boost::shared_ptr StandardExtrapolateSharedPtr; + typedef std::shared_ptr StandardExtrapolateSharedPtr; class StandardExtrapolate : public Extrapolate { diff --git a/solvers/IncNavierStokesSolver/EquationSystems/SubSteppingExtrapolate.h b/solvers/IncNavierStokesSolver/EquationSystems/SubSteppingExtrapolate.h index a71520f6f..c34148c1b 100644 --- a/solvers/IncNavierStokesSolver/EquationSystems/SubSteppingExtrapolate.h +++ b/solvers/IncNavierStokesSolver/EquationSystems/SubSteppingExtrapolate.h @@ -53,7 +53,7 @@ namespace Nektar class SubSteppingExtrapolate; - typedef boost::shared_ptr SubSteppingExtrapolateSharedPtr; + typedef std::shared_ptr SubSteppingExtrapolateSharedPtr; class SubSteppingExtrapolate : public Extrapolate { diff --git a/solvers/IncNavierStokesSolver/EquationSystems/SubSteppingExtrapolateWeakPressure.h b/solvers/IncNavierStokesSolver/EquationSystems/SubSteppingExtrapolateWeakPressure.h index 24e888cbc..71a70c1eb 100644 --- a/solvers/IncNavierStokesSolver/EquationSystems/SubSteppingExtrapolateWeakPressure.h +++ b/solvers/IncNavierStokesSolver/EquationSystems/SubSteppingExtrapolateWeakPressure.h @@ -46,7 +46,7 @@ namespace Nektar class SubSteppingExtrapolateWeakPressure; - typedef boost::shared_ptr SubSteppingExtrapolateWeakPressureSharedPtr; + typedef std::shared_ptr SubSteppingExtrapolateWeakPressureSharedPtr; class SubSteppingExtrapolateWeakPressure : public SubSteppingExtrapolate { diff --git a/solvers/IncNavierStokesSolver/EquationSystems/VCSMapping.h b/solvers/IncNavierStokesSolver/EquationSystems/VCSMapping.h index 319e15f3d..e2347ce86 100644 --- a/solvers/IncNavierStokesSolver/EquationSystems/VCSMapping.h +++ b/solvers/IncNavierStokesSolver/EquationSystems/VCSMapping.h @@ -152,7 +152,7 @@ namespace Nektar }; - typedef boost::shared_ptr + typedef std::shared_ptr VCSMappingSharedPtr; } //end of namespace diff --git a/solvers/IncNavierStokesSolver/EquationSystems/VelocityCorrectionScheme.h b/solvers/IncNavierStokesSolver/EquationSystems/VelocityCorrectionScheme.h index 7438efb17..c299754e5 100644 --- a/solvers/IncNavierStokesSolver/EquationSystems/VelocityCorrectionScheme.h +++ b/solvers/IncNavierStokesSolver/EquationSystems/VelocityCorrectionScheme.h @@ -179,7 +179,7 @@ namespace Nektar }; - typedef boost::shared_ptr + typedef std::shared_ptr VelocityCorrectionSchemeSharedPtr; } //end of namespace diff --git a/solvers/IncNavierStokesSolver/EquationSystems/VelocityCorrectionSchemeWeakPressure.h b/solvers/IncNavierStokesSolver/EquationSystems/VelocityCorrectionSchemeWeakPressure.h index 03d5cbf8f..ac1975dbe 100644 --- a/solvers/IncNavierStokesSolver/EquationSystems/VelocityCorrectionSchemeWeakPressure.h +++ b/solvers/IncNavierStokesSolver/EquationSystems/VelocityCorrectionSchemeWeakPressure.h @@ -95,7 +95,7 @@ namespace Nektar }; - typedef boost::shared_ptr + typedef std::shared_ptr VCSWeakPressureSharedPtr; } //end of namespace diff --git a/solvers/IncNavierStokesSolver/EquationSystems/WeakPressureExtrapolate.h b/solvers/IncNavierStokesSolver/EquationSystems/WeakPressureExtrapolate.h index e2d737650..3acdd62a3 100644 --- a/solvers/IncNavierStokesSolver/EquationSystems/WeakPressureExtrapolate.h +++ b/solvers/IncNavierStokesSolver/EquationSystems/WeakPressureExtrapolate.h @@ -53,7 +53,7 @@ namespace Nektar class WeakPressureExtrapolate; - typedef boost::shared_ptr WeakPressureExtrapolateSharedPtr; + typedef std::shared_ptr WeakPressureExtrapolateSharedPtr; class WeakPressureExtrapolate : public StandardExtrapolate { diff --git a/solvers/IncNavierStokesSolver/Filters/FilterMovingBody.h b/solvers/IncNavierStokesSolver/Filters/FilterMovingBody.h index 2c6c26a37..0d0bde20b 100644 --- a/solvers/IncNavierStokesSolver/Filters/FilterMovingBody.h +++ b/solvers/IncNavierStokesSolver/Filters/FilterMovingBody.h @@ -44,7 +44,7 @@ namespace Nektar { class FilterMovingBody; -typedef boost::shared_ptr FilterMovingBodySharedPtr; +typedef std::shared_ptr FilterMovingBodySharedPtr; typedef std::map FilterParams; typedef std::pair FilterMap; diff --git a/solvers/IncNavierStokesSolver/Utilities/Aliasing.cpp b/solvers/IncNavierStokesSolver/Utilities/Aliasing.cpp index ead0d55a5..39ad93a74 100644 --- a/solvers/IncNavierStokesSolver/Utilities/Aliasing.cpp +++ b/solvers/IncNavierStokesSolver/Utilities/Aliasing.cpp @@ -53,8 +53,8 @@ int main(int argc, char *argv[]) NonLinearDealiased[i] = Array (nphys); } - boost::shared_ptr A - = boost::dynamic_pointer_cast(IncNav->GetAdvObject()); + std::shared_ptr A + = std::dynamic_pointer_cast(IncNav->GetAdvObject()); if (!A) { diff --git a/solvers/IncNavierStokesSolver/Utilities/NonLinearEnergy.cpp b/solvers/IncNavierStokesSolver/Utilities/NonLinearEnergy.cpp index e5e50147a..2817ab37f 100644 --- a/solvers/IncNavierStokesSolver/Utilities/NonLinearEnergy.cpp +++ b/solvers/IncNavierStokesSolver/Utilities/NonLinearEnergy.cpp @@ -51,8 +51,8 @@ int main(int argc, char *argv[]) NonLinear[i] = Array (nphys); } - boost::shared_ptr A - = boost::dynamic_pointer_cast(IncNav->GetAdvObject()); + std::shared_ptr A + = std::dynamic_pointer_cast(IncNav->GetAdvObject()); if (!A) { diff --git a/solvers/LinearElasticSolver/EquationSystems/CoupledAssemblyMap.cpp b/solvers/LinearElasticSolver/EquationSystems/CoupledAssemblyMap.cpp index 82f995b12..288cd720d 100644 --- a/solvers/LinearElasticSolver/EquationSystems/CoupledAssemblyMap.cpp +++ b/solvers/LinearElasticSolver/EquationSystems/CoupledAssemblyMap.cpp @@ -34,6 +34,7 @@ /////////////////////////////////////////////////////////////////////////////// #include +#include #include #include #include @@ -273,7 +274,7 @@ CoupledAssemblyMap::CoupledAssemblyMap( m_globalToUniversalBndMapUnique[i] = (tmp2[i] >= 0 ? 1 : 0); } - m_hash = boost::hash_range( + m_hash = hash_range( m_localToGlobalMap.begin(), m_localToGlobalMap.end()); } diff --git a/solvers/LinearElasticSolver/EquationSystems/CoupledAssemblyMap.h b/solvers/LinearElasticSolver/EquationSystems/CoupledAssemblyMap.h index 9368fccd1..e31be013f 100644 --- a/solvers/LinearElasticSolver/EquationSystems/CoupledAssemblyMap.h +++ b/solvers/LinearElasticSolver/EquationSystems/CoupledAssemblyMap.h @@ -60,7 +60,7 @@ public: const Array &fields); }; -typedef boost::shared_ptr CoupledAssemblyMapSharedPtr; +typedef std::shared_ptr CoupledAssemblyMapSharedPtr; } diff --git a/solvers/LinearElasticSolver/EquationSystems/LinearElasticSystem.cpp b/solvers/LinearElasticSolver/EquationSystems/LinearElasticSystem.cpp index 66001cbba..033c99d6b 100644 --- a/solvers/LinearElasticSolver/EquationSystems/LinearElasticSystem.cpp +++ b/solvers/LinearElasticSolver/EquationSystems/LinearElasticSystem.cpp @@ -158,7 +158,7 @@ void LinearElasticSystem::v_InitObject() // fields together. if (nVel == 2) { - MultiRegions::ContField2DSharedPtr u = boost::dynamic_pointer_cast< + MultiRegions::ContField2DSharedPtr u = std::dynamic_pointer_cast< MultiRegions::ContField2D>(m_fields[0]); m_assemblyMap = MemoryManager ::AllocateSharedPtr(m_session, @@ -170,7 +170,7 @@ void LinearElasticSystem::v_InitObject() if (nVel == 3) { - MultiRegions::ContField3DSharedPtr u = boost::dynamic_pointer_cast< + MultiRegions::ContField3DSharedPtr u = std::dynamic_pointer_cast< MultiRegions::ContField3D>(m_fields[0]); m_assemblyMap = MemoryManager ::AllocateSharedPtr(m_session, diff --git a/solvers/PulseWaveSolver/EquationSystems/ArterialPressureArea.h b/solvers/PulseWaveSolver/EquationSystems/ArterialPressureArea.h index b2a6e68e8..79cb3d08d 100644 --- a/solvers/PulseWaveSolver/EquationSystems/ArterialPressureArea.h +++ b/solvers/PulseWaveSolver/EquationSystems/ArterialPressureArea.h @@ -45,7 +45,7 @@ namespace Nektar class ArterialPressureArea; /// Pointer to a PulseWaveOutflow object. - typedef boost::shared_ptr ArterialPressureAreaSharedPtr; + typedef std::shared_ptr ArterialPressureAreaSharedPtr; /// A global linear system. class ArterialPressureArea : public PulseWavePressureArea diff --git a/solvers/PulseWaveSolver/EquationSystems/LymphaticPressureArea.h b/solvers/PulseWaveSolver/EquationSystems/LymphaticPressureArea.h index 78811034e..39a8c1b9b 100644 --- a/solvers/PulseWaveSolver/EquationSystems/LymphaticPressureArea.h +++ b/solvers/PulseWaveSolver/EquationSystems/LymphaticPressureArea.h @@ -45,7 +45,7 @@ namespace Nektar class LymphaticPressureArea; /// Pointer to a PulseWaveOutflow object. - typedef boost::shared_ptr LymphaticPressureAreaSharedPtr; + typedef std::shared_ptr LymphaticPressureAreaSharedPtr; /// A global linear system. class LymphaticPressureArea : public PulseWavePressureArea diff --git a/solvers/PulseWaveSolver/EquationSystems/PulseWaveBoundary.h b/solvers/PulseWaveSolver/EquationSystems/PulseWaveBoundary.h index d9ffc1680..b9aa40239 100644 --- a/solvers/PulseWaveSolver/EquationSystems/PulseWaveBoundary.h +++ b/solvers/PulseWaveSolver/EquationSystems/PulseWaveBoundary.h @@ -45,7 +45,7 @@ namespace Nektar { class PulseWaveBoundary; - typedef boost::shared_ptr PulseWaveBoundarySharedPtr; + typedef std::shared_ptr PulseWaveBoundarySharedPtr; static PulseWaveBoundarySharedPtr NullPulseWaveBoundarySharedPtr; diff --git a/solvers/PulseWaveSolver/EquationSystems/PulseWavePressureArea.h b/solvers/PulseWaveSolver/EquationSystems/PulseWavePressureArea.h index 68da3088d..2b9b53cc0 100644 --- a/solvers/PulseWaveSolver/EquationSystems/PulseWavePressureArea.h +++ b/solvers/PulseWaveSolver/EquationSystems/PulseWavePressureArea.h @@ -44,7 +44,7 @@ namespace Nektar { class PulseWavePressureArea; - typedef boost::shared_ptr PulseWavePressureAreaSharedPtr; + typedef std::shared_ptr PulseWavePressureAreaSharedPtr; static PulseWavePressureAreaSharedPtr NullPulseWavePressureAreaSharedPtr; diff --git a/solvers/PulseWaveSolver/EquationSystems/PulseWaveSystem.h b/solvers/PulseWaveSolver/EquationSystems/PulseWaveSystem.h index 728d98569..a9172dac2 100755 --- a/solvers/PulseWaveSolver/EquationSystems/PulseWaveSystem.h +++ b/solvers/PulseWaveSolver/EquationSystems/PulseWaveSystem.h @@ -80,7 +80,7 @@ namespace Nektar int m_bcPosition; // Position of boundary condition in region }; - typedef boost::shared_ptr InterfacePointShPtr; + typedef std::shared_ptr InterfacePointShPtr; /// Base class for unsteady solvers. class PulseWaveSystem : public UnsteadySystem @@ -183,7 +183,7 @@ namespace Nektar }; - typedef boost::shared_ptr PulseWaveSystemSharedPtr; + typedef std::shared_ptr PulseWaveSystemSharedPtr; } diff --git a/solvers/PulseWaveSolver/EquationSystems/QInflow.h b/solvers/PulseWaveSolver/EquationSystems/QInflow.h index 92f0d0e65..1182ac280 100644 --- a/solvers/PulseWaveSolver/EquationSystems/QInflow.h +++ b/solvers/PulseWaveSolver/EquationSystems/QInflow.h @@ -45,7 +45,7 @@ namespace Nektar class QInflow; /// Pointer to a PulseWaveOutflow object. - typedef boost::shared_ptr QInflowSharedPtr; + typedef std::shared_ptr QInflowSharedPtr; /// A global linear system. class QInflow : public PulseWaveBoundary diff --git a/solvers/PulseWaveSolver/EquationSystems/RCROutflow.h b/solvers/PulseWaveSolver/EquationSystems/RCROutflow.h index 2baf12293..bfc9ee1a5 100644 --- a/solvers/PulseWaveSolver/EquationSystems/RCROutflow.h +++ b/solvers/PulseWaveSolver/EquationSystems/RCROutflow.h @@ -45,7 +45,7 @@ namespace Nektar class RCROutflow; /// Pointer to a PulseWaveOutflow object. - typedef boost::shared_ptr RCROutflowSharedPtr; + typedef std::shared_ptr RCROutflowSharedPtr; /// A global linear system. class RCROutflow : public PulseWaveBoundary diff --git a/solvers/PulseWaveSolver/EquationSystems/ROutflow.h b/solvers/PulseWaveSolver/EquationSystems/ROutflow.h index 8df735e4d..04e9c236c 100644 --- a/solvers/PulseWaveSolver/EquationSystems/ROutflow.h +++ b/solvers/PulseWaveSolver/EquationSystems/ROutflow.h @@ -45,7 +45,7 @@ namespace Nektar class ROutflow; /// Pointer to a PulseWaveOutflow object. - typedef boost::shared_ptr ROutflowSharedPtr; + typedef std::shared_ptr ROutflowSharedPtr; /// A global linear system. class ROutflow : public PulseWaveBoundary diff --git a/solvers/PulseWaveSolver/EquationSystems/TerminalOutflow.h b/solvers/PulseWaveSolver/EquationSystems/TerminalOutflow.h index 134dc1858..0e1314b6c 100644 --- a/solvers/PulseWaveSolver/EquationSystems/TerminalOutflow.h +++ b/solvers/PulseWaveSolver/EquationSystems/TerminalOutflow.h @@ -45,7 +45,7 @@ namespace Nektar class TerminalOutflow; /// Pointer to a PulseWaveOutflow object. - typedef boost::shared_ptr TerminalOutflowSharedPtr; + typedef std::shared_ptr TerminalOutflowSharedPtr; /// A global linear system. class TerminalOutflow : public PulseWaveBoundary diff --git a/solvers/PulseWaveSolver/EquationSystems/TimeDependentInflow.h b/solvers/PulseWaveSolver/EquationSystems/TimeDependentInflow.h index d6c4a1a16..41a0d49e6 100644 --- a/solvers/PulseWaveSolver/EquationSystems/TimeDependentInflow.h +++ b/solvers/PulseWaveSolver/EquationSystems/TimeDependentInflow.h @@ -45,7 +45,7 @@ namespace Nektar class TimeDependentInflow; /// Pointer to a PulseWaveOutflow object. - typedef boost::shared_ptr TimeDependentInflowSharedPtr; + typedef std::shared_ptr TimeDependentInflowSharedPtr; /// A global linear system. class TimeDependentInflow : public PulseWaveBoundary diff --git a/solvers/PulseWaveSolver/EquationSystems/UndefinedInOutflow.h b/solvers/PulseWaveSolver/EquationSystems/UndefinedInOutflow.h index 4468f5f9f..bb20c5fa6 100644 --- a/solvers/PulseWaveSolver/EquationSystems/UndefinedInOutflow.h +++ b/solvers/PulseWaveSolver/EquationSystems/UndefinedInOutflow.h @@ -45,7 +45,7 @@ namespace Nektar class UndefinedInOutflow; /// Pointer to a PulseWaveOutflow object. - typedef boost::shared_ptr UndefinedInOutflowSharedPtr; + typedef std::shared_ptr UndefinedInOutflowSharedPtr; /// A global linear system. class UndefinedInOutflow : public PulseWaveBoundary diff --git a/solvers/PulseWaveSolver/Utilities/Fld2Tecplot.cpp b/solvers/PulseWaveSolver/Utilities/Fld2Tecplot.cpp index 40afd6824..0996439b5 100644 --- a/solvers/PulseWaveSolver/Utilities/Fld2Tecplot.cpp +++ b/solvers/PulseWaveSolver/Utilities/Fld2Tecplot.cpp @@ -64,7 +64,7 @@ int main(int argc, char *argv[]) EquationSystemSharedPtr EqSys = drv->GetEqu()[0]; PulseWaveSystemSharedPtr PulseWave; - if(!(PulseWave = boost::dynamic_pointer_cast + if(!(PulseWave = std::dynamic_pointer_cast (EqSys))) { ASSERTL0(false,"Failed to dynamically cast to PulseWaveSystemOutput"); diff --git a/solvers/PulseWaveSolver/Utilities/PulseWaveSystemOutput.h b/solvers/PulseWaveSolver/Utilities/PulseWaveSystemOutput.h index febaf14b0..8cc84e257 100644 --- a/solvers/PulseWaveSolver/Utilities/PulseWaveSystemOutput.h +++ b/solvers/PulseWaveSolver/Utilities/PulseWaveSystemOutput.h @@ -74,7 +74,7 @@ namespace Nektar }; - typedef boost::shared_ptr PulseWaveSystemOutputSharedPtr; + typedef std::shared_ptr PulseWaveSystemOutputSharedPtr; } #endif diff --git a/solvers/VortexWaveInteraction/CalcL2ToLinfPressure.cpp b/solvers/VortexWaveInteraction/CalcL2ToLinfPressure.cpp index f956e87b0..b5b559f34 100644 --- a/solvers/VortexWaveInteraction/CalcL2ToLinfPressure.cpp +++ b/solvers/VortexWaveInteraction/CalcL2ToLinfPressure.cpp @@ -36,7 +36,6 @@ #include #include -#include using namespace std; using namespace Nektar; diff --git a/solvers/VortexWaveInteraction/VortexWaveInteraction.cpp b/solvers/VortexWaveInteraction/VortexWaveInteraction.cpp index 010074f59..5dfda3524 100644 --- a/solvers/VortexWaveInteraction/VortexWaveInteraction.cpp +++ b/solvers/VortexWaveInteraction/VortexWaveInteraction.cpp @@ -388,7 +388,7 @@ namespace Nektar if(init) { m_solverRoll->DoInitialise(); - m_vwiForcingObj = boost::dynamic_pointer_cast(GetForcingFactory().CreateInstance("Programmatic", m_sessionRoll, m_solverRoll->UpdateFields(), m_solverRoll->UpdateFields().num_elements() - 1, 0)); + m_vwiForcingObj = std::dynamic_pointer_cast(GetForcingFactory().CreateInstance("Programmatic", m_sessionRoll, m_solverRoll->UpdateFields(), m_solverRoll->UpdateFields().num_elements() - 1, 0)); std::vector vFieldNames = m_sessionRoll->GetVariables(); vFieldNames.erase(vFieldNames.end()-1); @@ -2012,7 +2012,7 @@ cout<<"cr="<:: AllocateSharedPtr( - *boost::static_pointer_cast(Iexp[reg])); + *std::static_pointer_cast(Iexp[reg])); int nq = Ilayer->GetTotPoints(); if( cnt==0) { diff --git a/solvers/VortexWaveInteraction/utilities/ExpandMeshByRotation.cpp b/solvers/VortexWaveInteraction/utilities/ExpandMeshByRotation.cpp index 61badc2bc..0b98c4f20 100644 --- a/solvers/VortexWaveInteraction/utilities/ExpandMeshByRotation.cpp +++ b/solvers/VortexWaveInteraction/utilities/ExpandMeshByRotation.cpp @@ -83,8 +83,8 @@ int main(int argc, char *argv[]) int compsize = composite->size(); for(i = 0; i < compsize; ++i) { - SpatialDomains::Geometry1DSharedPtr tmp1 = boost::dynamic_pointer_cast((*composite)[i]); - SpatialDomains::Geometry1DSharedPtr tmp2 = boost::dynamic_pointer_cast((*composite)[compsize-1-i]); + SpatialDomains::Geometry1DSharedPtr tmp1 = std::dynamic_pointer_cast((*composite)[i]); + SpatialDomains::Geometry1DSharedPtr tmp2 = std::dynamic_pointer_cast((*composite)[compsize-1-i]); jointEdges[tmp1->GetEid() ] = tmp2->GetEid(); jointVerts[tmp1->GetVid(0)] = tmp2->GetVid(1); jointVerts[tmp1->GetVid(1)] = tmp2->GetVid(0); diff --git a/solvers/VortexWaveInteraction/utilities/MeshMove.cpp b/solvers/VortexWaveInteraction/utilities/MeshMove.cpp index 8ff8feea2..9791c1c1d 100644 --- a/solvers/VortexWaveInteraction/utilities/MeshMove.cpp +++ b/solvers/VortexWaveInteraction/utilities/MeshMove.cpp @@ -2220,7 +2220,7 @@ void GenerateMapEidsv1v2(MultiRegions::ExpListSharedPtr field, Array &V1, Array &V2) { - const boost::shared_ptr exp2D = field->GetExp(); + const std::shared_ptr exp2D = field->GetExp(); int nel = exp2D->size(); LocalRegions::QuadExpSharedPtr locQuadExp; LocalRegions::TriExpSharedPtr locTriExp; @@ -3633,7 +3633,7 @@ void CheckSingularQuads( MultiRegions::ExpListSharedPtr Exp, Array V1, Array V2, Array& xnew,Array& ynew) { - const boost::shared_ptr exp2D = Exp->GetExp(); + const std::shared_ptr exp2D = Exp->GetExp(); int nel = exp2D->size(); LocalRegions::QuadExpSharedPtr locQuadExp; LocalRegions::TriExpSharedPtr locTriExp; diff --git a/tests/Metric.h b/tests/Metric.h index ca55e5695..3af846999 100644 --- a/tests/Metric.h +++ b/tests/Metric.h @@ -75,7 +75,7 @@ namespace Nektar }; /// A shared pointer to an EquationSystem object - typedef boost::shared_ptr MetricSharedPtr; + typedef std::shared_ptr MetricSharedPtr; /// Datatype of the NekFactory used to instantiate classes derived from the /// Advection class. diff --git a/utilities/Extras/FldCalcBCs.cpp b/utilities/Extras/FldCalcBCs.cpp index 3bb1b5848..f92e2a13b 100644 --- a/utilities/Extras/FldCalcBCs.cpp +++ b/utilities/Extras/FldCalcBCs.cpp @@ -35,7 +35,7 @@ using namespace Nektar; int k; int nquad= to_key.GetNumPoints(); Geometry2DSharedPtr g; - ASSERTL0(g= boost::dynamic_pointer_cast(geom), + ASSERTL0(g= std::dynamic_pointer_cast(geom), "FAIL"); GeomFactorsSharedPtr gf = geom->GetMetricInfo(); @@ -872,7 +872,7 @@ cout<<"layer region="<((*Icompreg)[k])) ) { ASSERTL0(false, "dynamic cast to a SegGeom failed"); } @@ -880,13 +880,13 @@ cout<<"layer region="<GetEid(); offsetregIExp = Ilayer->GetPlane(0)->GetCoeff_Offset(k); //cout<<"edge="< ( + edgestdexp = std::dynamic_pointer_cast ( Ilayer->GetPlane(0)->GetExp(w) ); edgestdexp->StdPhysDeriv(phys_edge, der_edge); diff --git a/utilities/Extras/VtkToFld.cpp b/utilities/Extras/VtkToFld.cpp index 37dbd0d5f..06c1bd515 100644 --- a/utilities/Extras/VtkToFld.cpp +++ b/utilities/Extras/VtkToFld.cpp @@ -6,13 +6,13 @@ #include #include -#include #include namespace po = boost::program_options; #include #include #include +#include #include #include #include @@ -48,7 +48,7 @@ struct Vertex return (x == v.x && y == v.y && z == v.z); } }; -typedef boost::shared_ptr VertexSharedPtr; +typedef std::shared_ptr VertexSharedPtr; /// Define comparison operator for the vertex struct bool operator==(const VertexSharedPtr& v1, const VertexSharedPtr& v2) @@ -64,16 +64,12 @@ struct VertexHash : std::unary_function { std::size_t operator()(VertexSharedPtr const& p) const { - std::size_t seed = 0; - boost::hash_combine(seed, p -> x); - boost::hash_combine(seed, p -> y); - boost::hash_combine(seed, p -> z); - return seed; + return hash_combine(p->x, p->y, p->z); } }; /// Define a set of Vertices with associated hash function -typedef boost::unordered_set VertexSet; +typedef std::unordered_set VertexSet; /** @@ -236,7 +232,7 @@ int main(int argc, char* argv[]) { vtkPoints->GetPoint(i,p); val = vtkPData->GetScalars(name.c_str())->GetTuple1(i); - boost::shared_ptr v(new Vertex(p[0],p[1],p[2],val,factor)); + std::shared_ptr v(new Vertex(p[0],p[1],p[2],val,factor)); points.insert(v); } @@ -256,7 +252,7 @@ int main(int argc, char* argv[]) vert->GetCoords(x,y,z); // Look up the vertex in the VertexSet - boost::shared_ptr v(new Vertex(x,y,z,0.0,factor)); + std::shared_ptr v(new Vertex(x,y,z,0.0,factor)); vIter = points.find(v); // If not found, maybe the tolerance should be reduced? diff --git a/utilities/FieldConvert/FieldConvert.cpp b/utilities/FieldConvert/FieldConvert.cpp index 6bbfde628..691d75d04 100644 --- a/utilities/FieldConvert/FieldConvert.cpp +++ b/utilities/FieldConvert/FieldConvert.cpp @@ -159,7 +159,7 @@ int main(int argc, char* argv[]) t = eProcessModule; } - FieldSharedPtr f = boost::shared_ptr(new Field()); + FieldSharedPtr f = std::shared_ptr(new Field()); ModuleSharedPtr mod = GetModuleFactory().CreateInstance( ModuleKey(t, tmp1[1]), f); cerr << "Options for module " << tmp1[1] << ":" << endl; @@ -200,7 +200,7 @@ int main(int argc, char* argv[]) * name of the module to load. */ - FieldSharedPtr f = boost::shared_ptr(new Field()); + FieldSharedPtr f = std::shared_ptr(new Field()); if (LibUtilities::GetCommFactory().ModuleExists("ParallelMPI")) { if(vm.count("procid")) @@ -212,7 +212,7 @@ int main(int argc, char* argv[]) nprocs = vm["nprocs"].as(); rank = vm["procid"].as(); - f->m_comm = boost::shared_ptr( + f->m_comm = std::shared_ptr( new FieldConvertComm(argc, argv, nprocs,rank)); // Set forceoutput option. Otherwise only procid 0 will write file @@ -343,7 +343,7 @@ int main(int argc, char* argv[]) if (i < nInput) { - inputModule = boost::dynamic_pointer_cast(mod); + inputModule = std::dynamic_pointer_cast(mod); inputModule->AddFile(module.second, tmp1[0]); } diff --git a/utilities/FldAddMultiShear.cpp b/utilities/FldAddMultiShear.cpp index 989e80a8b..fd2ff3884 100644 --- a/utilities/FldAddMultiShear.cpp +++ b/utilities/FldAddMultiShear.cpp @@ -161,7 +161,7 @@ int main(int argc, char *argv[]) BndExp[0] = Exp[0]->GetBndCondExpansions(); // Get face 2D expansion from element expansion - bc = boost::dynamic_pointer_cast (BndExp[0][surfID]->GetExp(0)); + bc = std::dynamic_pointer_cast (BndExp[0][surfID]->GetExp(0)); int nfq= bc->GetTotPoints(); int nelem = BndExp[0][surfID]->GetExpSize(); @@ -233,7 +233,7 @@ int main(int argc, char *argv[]) else { // Get face 2D expansion from element expansion - bc = boost::dynamic_pointer_cast (BndExp[0][n]->GetExp(i)); + bc = std::dynamic_pointer_cast (BndExp[0][n]->GetExp(i)); //identify boundary of element looking at. boundary = BoundarytoTraceID[cnt]; @@ -341,7 +341,7 @@ int main(int argc, char *argv[]) else { // Get face 2D expansion from element expansion - bc = boost::dynamic_pointer_cast (BndExp[0][n]->GetExp(i)); + bc = std::dynamic_pointer_cast (BndExp[0][n]->GetExp(i)); //identify boundary of element looking at. boundary = BoundarytoTraceID[cnt]; @@ -460,7 +460,7 @@ int main(int argc, char *argv[]) else { // Get face 2D expansion from element expansion - bc = boost::dynamic_pointer_cast (BndExp[0][n]->GetExp(i)); + bc = std::dynamic_pointer_cast (BndExp[0][n]->GetExp(i)); //identify boundary of element looking at. boundary = BoundarytoTraceID[cnt]; diff --git a/utilities/FldAddScalGrad.cpp b/utilities/FldAddScalGrad.cpp index b13b30894..402a750c8 100644 --- a/utilities/FldAddScalGrad.cpp +++ b/utilities/FldAddScalGrad.cpp @@ -161,7 +161,7 @@ int main(int argc, char *argv[]) } // Get face 2D expansion from element expansion - bc = boost::dynamic_pointer_cast (BndExp[0][n]->GetExp(i)); + bc = std::dynamic_pointer_cast (BndExp[0][n]->GetExp(i)); // Number of face quadrature points nfq = bc->GetTotPoints(); diff --git a/utilities/FldAddScalGrad_elmt.cpp b/utilities/FldAddScalGrad_elmt.cpp index eb6bdde65..322406cf9 100644 --- a/utilities/FldAddScalGrad_elmt.cpp +++ b/utilities/FldAddScalGrad_elmt.cpp @@ -173,7 +173,7 @@ int main(int argc, char *argv[]) } // Get face 2D expansion from element expansion - bc = boost::dynamic_pointer_cast (BndExp[0][n]->GetExp(i)); + bc = std::dynamic_pointer_cast (BndExp[0][n]->GetExp(i)); // Number of face quadrature points nfq = bc->GetTotPoints(); diff --git a/utilities/FldAddWSS.cpp b/utilities/FldAddWSS.cpp index 9209f63c6..21bee7872 100644 --- a/utilities/FldAddWSS.cpp +++ b/utilities/FldAddWSS.cpp @@ -263,7 +263,7 @@ int main(int argc, char *argv[]) else { // Get face 2D expansion from element expansion - bc = boost::dynamic_pointer_cast (BndExp[0][n]->GetExp(i)); + bc = std::dynamic_pointer_cast (BndExp[0][n]->GetExp(i)); nfq= bc->GetTotPoints(); //identify boundary of element looking at. diff --git a/utilities/NekMesh/InputModules/InputGmsh.cpp b/utilities/NekMesh/InputModules/InputGmsh.cpp index a33b622bb..56bad4ec1 100644 --- a/utilities/NekMesh/InputModules/InputGmsh.cpp +++ b/utilities/NekMesh/InputModules/InputGmsh.cpp @@ -37,7 +37,7 @@ #include using namespace std; -#include +#include #include #include @@ -218,28 +218,28 @@ std::vector triTensorNodeOrdering(const std::vector &nodes, int n) return nodeList; } -typedef boost::tuple Mode; +typedef std::tuple Mode; struct cmpop { bool operator()(Mode const &a, Mode const &b) const { - if (a.get<0>() < b.get<0>()) + if (std::get<0>(a) < std::get<0>(b)) { return true; } - if (a.get<0>() > b.get<0>()) + if (std::get<0>(a) > std::get<0>(b)) { return false; } - if (a.get<1>() < b.get<1>()) + if (std::get<1>(a) < std::get<1>(b)) { return true; } - if (a.get<1>() > b.get<1>()) + if (std::get<1>(a) > std::get<1>(b)) { return false; } - if (a.get<2>() < b.get<2>()) + if (std::get<2>(a) < std::get<2>(b)) { return true; } @@ -734,8 +734,8 @@ void InputGmsh::Process() // This map takes each element ID and maps it to a permutation map // that is required to take Gmsh element node orderings and map them // to Nektar++ orderings. - boost::unordered_map > orderingMap; - boost::unordered_map >::iterator oIt; + std::unordered_map > orderingMap; + std::unordered_map >::iterator oIt; if (m_mesh->m_verbose) { @@ -785,7 +785,7 @@ void InputGmsh::Process() } prevId = id; m_mesh->m_node.push_back( - boost::shared_ptr(new Node(id, x, y, z))); + std::shared_ptr(new Node(id, x, y, z))); } } // Process elements diff --git a/utilities/NekMesh/InputModules/InputNek.cpp b/utilities/NekMesh/InputModules/InputNek.cpp index a89a09333..58f77f850 100644 --- a/utilities/NekMesh/InputModules/InputNek.cpp +++ b/utilities/NekMesh/InputModules/InputNek.cpp @@ -90,7 +90,7 @@ void InputNek::Process() map domainComposite; map > > elNodes; map > elIds; - boost::unordered_map elMap; + std::unordered_map elMap; vector elmOrder; bool scalar = m_config["scalar"].as(); @@ -272,7 +272,7 @@ void InputNek::Process() vector nodeList; for (k = 0; k < nNodes; ++k) { - NodeSharedPtr n = boost::shared_ptr(new Node( + NodeSharedPtr n = std::shared_ptr(new Node( nodeCounter++, vertex[0][k], vertex[1][k], vertex[2][k])); nodeList.push_back(n); } @@ -420,8 +420,8 @@ void InputNek::Process() if (el->GetConf().m_e == LibUtilities::ePrism && faceId % 2 == 0) { - boost::shared_ptr p = - boost::dynamic_pointer_cast(el); + std::shared_ptr p = + std::dynamic_pointer_cast(el); if (p->m_orientation == 1) { faceId = (faceId + 2) % 6; @@ -433,8 +433,8 @@ void InputNek::Process() } else if (el->GetConf().m_e == LibUtilities::eTetrahedron) { - boost::shared_ptr t = - boost::dynamic_pointer_cast(el); + std::shared_ptr t = + std::dynamic_pointer_cast(el); faceId = t->m_orientationMap[faceId]; } @@ -457,7 +457,7 @@ void InputNek::Process() faceId % 2 == 1) { offset = - boost::dynamic_pointer_cast(el)->m_orientation; + std::dynamic_pointer_cast(el)->m_orientation; } // Read x/y/z coordinates. @@ -488,7 +488,7 @@ void InputNek::Process() for (j = 0; j < tmp.size(); ++j) { int id = tmp[(j + offset) % tmp.size()]->m_id; - boost::unordered_map::iterator vIt = + std::unordered_map::iterator vIt = m_mesh->m_vertexNormals.find(id); if (vIt == m_mesh->m_vertexNormals.end()) @@ -515,8 +515,8 @@ void InputNek::Process() // vertex ids accordingly. if (el->GetConf().m_e == LibUtilities::eTetrahedron) { - boost::shared_ptr tet = - boost::static_pointer_cast(el); + std::shared_ptr tet = + std::static_pointer_cast(el); vector tmpVertId = vertId; for (j = 0; j < 3; ++j) @@ -539,8 +539,8 @@ void InputNek::Process() } else if (el->GetConf().m_e == LibUtilities::ePrism) { - boost::shared_ptr pr = - boost::static_pointer_cast(el); + std::shared_ptr pr = + std::static_pointer_cast(el); if (pr->m_orientation == 1) { swap(vertId[2], vertId[1]); @@ -554,7 +554,7 @@ void InputNek::Process() } HOSurfSharedPtr hs = - boost::shared_ptr(new HOSurf(vertId)); + std::shared_ptr(new HOSurf(vertId)); // Find vertex combination in hoData. hoIt = hoData[word].find(hs); @@ -806,8 +806,8 @@ void InputNek::Process() // change. if (elm->GetConf().m_e == LibUtilities::ePrism && faceId % 2 == 0) { - boost::shared_ptr p = - boost::dynamic_pointer_cast(elm); + std::shared_ptr p = + std::dynamic_pointer_cast(elm); if (p->m_orientation == 1) { faceId = (faceId + 2) % 6; @@ -819,8 +819,8 @@ void InputNek::Process() } else if (elm->GetConf().m_e == LibUtilities::eTetrahedron) { - boost::shared_ptr t = - boost::dynamic_pointer_cast(elm); + std::shared_ptr t = + std::dynamic_pointer_cast(elm); faceId = t->m_orientationMap[faceId]; } diff --git a/utilities/NekMesh/InputModules/InputNek5000.cpp b/utilities/NekMesh/InputModules/InputNek5000.cpp index 0d93453cf..f6bec2ade 100644 --- a/utilities/NekMesh/InputModules/InputNek5000.cpp +++ b/utilities/NekMesh/InputModules/InputNek5000.cpp @@ -39,6 +39,7 @@ #include #include +#include #include #include @@ -215,7 +216,7 @@ void InputNek5000::Process() vector nodeList(nNodes); for (k = 0; k < nNodes; ++k) { - nodeList[k] = boost::shared_ptr( + nodeList[k] = std::shared_ptr( new Node( 0, vertex[k][0], vertex[k][1], vertex[k][2])); pair testIns = @@ -436,7 +437,7 @@ void InputNek5000::Process() } int nSurfaces = 0; - boost::unordered_set > periodicIn; + std::unordered_set, PairHash> periodicIn; int periodicInId = -1, periodicOutId = -1; // Boundary conditions: should be precisely nElements * nFaces lines to diff --git a/utilities/NekMesh/InputModules/InputNekpp.cpp b/utilities/NekMesh/InputModules/InputNekpp.cpp index 57d66a301..c13e860a1 100644 --- a/utilities/NekMesh/InputModules/InputNekpp.cpp +++ b/utilities/NekMesh/InputModules/InputNekpp.cpp @@ -81,12 +81,9 @@ void InputNekpp::Process() // Copy vertices. map vIdMap; - const SpatialDomains::PointGeomMap vertset = graph->GetVertSet(); - SpatialDomains::PointGeomMap::const_iterator vit; - - for (vit = vertset.begin(); vit != vertset.end(); ++vit) + for (auto &vit : graph->GetVertSet()) { - SpatialDomains::PointGeomSharedPtr vert = vit->second; + SpatialDomains::PointGeomSharedPtr vert = vit.second; NodeSharedPtr n( new Node(vert->GetVid(), (*vert)(0), (*vert)(1), (*vert)(2))); m_mesh->m_vertexSet.insert(n); @@ -100,48 +97,36 @@ void InputNekpp::Process() // Load up all edges from graph { - int nel = 0; - SpatialDomains::SegGeomMap tmp = graph->GetAllSegGeoms(); - SpatialDomains::SegGeomMap::iterator it; - pair testIns; - nel += tmp.size(); - - for (it = tmp.begin(); it != tmp.end(); ++it) + for (auto &it : graph->GetAllSegGeoms()) { pair tmp2( - it->first, - boost::dynamic_pointer_cast( - it->second)); + it.first, + std::dynamic_pointer_cast( + it.second)); // load up edge set in order of SegGeomMap; vector curve; // curved nodes if deformed - int id0 = it->second->GetVid(0); - int id1 = it->second->GetVid(1); + int id0 = it.second->GetVid(0); + int id1 = it.second->GetVid(1); LibUtilities::PointsType ptype = - it->second->GetPointsKeys()[0].GetPointsType(); + it.second->GetPointsKeys()[0].GetPointsType(); EdgeSharedPtr ed = EdgeSharedPtr(new Edge(vIdMap[id0], vIdMap[id1], curve, ptype)); - testIns = m_mesh->m_edgeSet.insert(ed); - (*(testIns.first))->m_id = it->second->GetEid(); - eIdMap[it->second->GetEid()] = ed; + auto testIns = m_mesh->m_edgeSet.insert(ed); + (*(testIns.first))->m_id = it.second->GetEid(); + eIdMap[it.second->GetEid()] = ed; } } // load up all faces from graph { - int nel = 0; - SpatialDomains::TriGeomMap tmp = graph->GetAllTriGeoms(); - SpatialDomains::TriGeomMap::iterator it; - pair testIns; - nel += tmp.size(); - - for (it = tmp.begin(); it != tmp.end(); ++it) + for (auto &it : graph->GetAllTriGeoms()) { pair tmp2( - it->first, - boost::dynamic_pointer_cast( - it->second)); + it.first, + std::dynamic_pointer_cast( + it.second)); vector faceVertices; vector faceEdges; @@ -149,8 +134,8 @@ void InputNekpp::Process() for (int i = 0; i < 3; ++i) { - faceVertices.push_back(vIdMap[it->second->GetVid(i)]); - faceEdges.push_back(eIdMap[it->second->GetEid(i)]); + faceVertices.push_back(vIdMap[it.second->GetVid(i)]); + faceEdges.push_back(eIdMap[it.second->GetEid(i)]); } FaceSharedPtr fac = @@ -158,20 +143,17 @@ void InputNekpp::Process() faceNodes, faceEdges, LibUtilities::ePolyEvenlySpaced)); - testIns = m_mesh->m_faceSet.insert(fac); - (*(testIns.first))->m_id = it->second->GetFid(); - fIdMap[it->second->GetFid()] = fac; + auto testIns = m_mesh->m_faceSet.insert(fac); + (*(testIns.first))->m_id = it.second->GetFid(); + fIdMap[it.second->GetFid()] = fac; } - SpatialDomains::QuadGeomMap tmp3 = graph->GetAllQuadGeoms(); - SpatialDomains::QuadGeomMap::iterator it2; - - for (it2 = tmp3.begin(); it2 != tmp3.end(); ++it2) + for (auto &it : graph->GetAllQuadGeoms()) { pair tmp2( - it2->first, - boost::dynamic_pointer_cast( - it2->second)); + it.first, + std::dynamic_pointer_cast( + it.second)); vector faceVertices; vector faceEdges; @@ -179,8 +161,8 @@ void InputNekpp::Process() for (int i = 0; i < 4; ++i) { - faceVertices.push_back(vIdMap[it2->second->GetVid(i)]); - faceEdges.push_back(eIdMap[it2->second->GetEid(i)]); + faceVertices.push_back(vIdMap[it.second->GetVid(i)]); + faceEdges.push_back(eIdMap[it.second->GetEid(i)]); } FaceSharedPtr fac = @@ -188,21 +170,18 @@ void InputNekpp::Process() faceNodes, faceEdges, LibUtilities::ePolyEvenlySpaced)); - testIns = m_mesh->m_faceSet.insert(fac); - (*(testIns.first))->m_id = it2->second->GetFid(); - fIdMap[it2->second->GetFid()] = fac; + auto testIns = m_mesh->m_faceSet.insert(fac); + (*(testIns.first))->m_id = it.second->GetFid(); + fIdMap[it.second->GetFid()] = fac; } } // Set up curved information // Curved Edges - SpatialDomains::CurveMap &curvedEdges = graph->GetCurvedEdges(); - SpatialDomains::CurveMap::iterator it; - - for (it = curvedEdges.begin(); it != curvedEdges.end(); ++it) + for (auto &it : graph->GetCurvedEdges()) { - SpatialDomains::CurveSharedPtr curve = it->second; + SpatialDomains::CurveSharedPtr curve = it.second; int id = curve->m_curveID; ASSERTL1(eIdMap.find(id) != eIdMap.end(), "Failed to find curved edge"); EdgeSharedPtr edg = eIdMap[id]; @@ -218,10 +197,9 @@ void InputNekpp::Process() } // Curved Faces - SpatialDomains::CurveMap &curvedFaces = graph->GetCurvedFaces(); - for (it = curvedFaces.begin(); it != curvedFaces.end(); ++it) + for (auto &it : graph->GetCurvedFaces()) { - SpatialDomains::CurveSharedPtr curve = it->second; + SpatialDomains::CurveSharedPtr curve = it.second; int id = curve->m_curveID; ASSERTL1(fIdMap.find(id) != fIdMap.end(), "Failed to find curved edge"); FaceSharedPtr fac = fIdMap[id]; @@ -260,53 +238,46 @@ void InputNekpp::Process() } } - // Get hold of mesh composites and set up m_mesh->m_elements - SpatialDomains::CompositeMap GraphComps = graph->GetComposites(); - SpatialDomains::CompositeMapIter compIt; - SpatialDomains::GeometryVectorIter geomIt; - - // loop over all composites and set up elements with edges - // and faces from the maps above. - for (compIt = GraphComps.begin(); compIt != GraphComps.end(); ++compIt) + // Get hold of mesh composites and set up m_mesh->m_elements. Loop over all + // composites and set up elements with edges and faces from the maps above. + for (auto &compIt : graph->GetComposites()) { // Get hold of dimension - int dim = (*compIt->second)[0]->GetShapeDim(); + int dim = (*compIt.second)[0]->GetShapeDim(); // compIt->second is a GeometryVector - for (geomIt = (*compIt->second).begin(); - geomIt != (*compIt->second).end(); - ++geomIt) + for (auto &geomIt : *compIt.second) { - ElmtConfig conf((*geomIt)->GetShapeType(), 1, true, true, false); + ElmtConfig conf(geomIt->GetShapeType(), 1, true, true, false); // Get hold of geometry vector nodeList; - for (int i = 0; i < (*geomIt)->GetNumVerts(); ++i) + for (int i = 0; i < geomIt->GetNumVerts(); ++i) { - nodeList.push_back(vIdMap[(*geomIt)->GetVid(i)]); + nodeList.push_back(vIdMap[geomIt->GetVid(i)]); } vector tags; - tags.push_back(compIt->first); + tags.push_back(compIt.first); ElementSharedPtr E = GetElementFactory().CreateInstance( - (*geomIt)->GetShapeType(), conf, nodeList, tags); + geomIt->GetShapeType(), conf, nodeList, tags); - E->SetId((*geomIt)->GetGlobalID()); + E->SetId(geomIt->GetGlobalID()); m_mesh->m_element[dim].push_back(E); if (dim == 1) { - EdgeSharedPtr edg = eIdMap[(*geomIt)->GetGlobalID()]; + EdgeSharedPtr edg = eIdMap[geomIt->GetGlobalID()]; E->SetVolumeNodes(edg->m_edgeNodes); } if (dim > 1) { // reset edges - for (int i = 0; i < (*geomIt)->GetNumEdges(); ++i) + for (int i = 0; i < geomIt->GetNumEdges(); ++i) { - EdgeSharedPtr edg = eIdMap[(*geomIt)->GetEid(i)]; + EdgeSharedPtr edg = eIdMap[geomIt->GetEid(i)]; E->SetEdge(i, edg); // set up link back to this element edg->m_elLink.push_back(pair(E, i)); @@ -314,7 +285,7 @@ void InputNekpp::Process() if (dim == 2) { - FaceSharedPtr fac = fIdMap[(*geomIt)->GetGlobalID()]; + FaceSharedPtr fac = fIdMap[geomIt->GetGlobalID()]; E->SetVolumeNodes(fac->m_faceNodes); } } @@ -322,9 +293,9 @@ void InputNekpp::Process() if (dim == 3) { // reset faces - for (int i = 0; i < (*geomIt)->GetNumFaces(); ++i) + for (int i = 0; i < geomIt->GetNumFaces(); ++i) { - FaceSharedPtr fac = fIdMap[(*geomIt)->GetFid(i)]; + FaceSharedPtr fac = fIdMap[geomIt->GetFid(i)]; E->SetFace(i, fac); // set up link back to this slement fac->m_elLink.push_back(pair(E, i)); diff --git a/utilities/NekMesh/InputModules/InputPly.cpp b/utilities/NekMesh/InputModules/InputPly.cpp index 974d794a0..554a4586e 100644 --- a/utilities/NekMesh/InputModules/InputPly.cpp +++ b/utilities/NekMesh/InputModules/InputPly.cpp @@ -159,7 +159,7 @@ void InputPly::ReadPly(io::filtering_istream &mshFile, NekDouble scale) z *= scale; m_mesh->m_node.push_back( - boost::shared_ptr(new Node(i, x, y, z))); + std::shared_ptr(new Node(i, x, y, z))); // Read vertex normals. if (propMap.count("nx") > 0) diff --git a/utilities/NekMesh/InputModules/InputPly.h b/utilities/NekMesh/InputModules/InputPly.h index 805027136..d58abf0c2 100644 --- a/utilities/NekMesh/InputModules/InputPly.h +++ b/utilities/NekMesh/InputModules/InputPly.h @@ -65,7 +65,7 @@ public: private: }; -typedef boost::shared_ptr InputPlySharedPtr; +typedef std::shared_ptr InputPlySharedPtr; } } diff --git a/utilities/NekMesh/InputModules/InputSem.cpp b/utilities/NekMesh/InputModules/InputSem.cpp index 0b2c0a599..9a74acb8a 100644 --- a/utilities/NekMesh/InputModules/InputSem.cpp +++ b/utilities/NekMesh/InputModules/InputSem.cpp @@ -204,7 +204,7 @@ void InputSem::Process() } id -= 1; // counter starts at 0 m_mesh->m_node.push_back( - boost::shared_ptr(new Node(id, x, y, z))); + std::shared_ptr(new Node(id, x, y, z))); ++i; } @@ -387,7 +387,7 @@ void InputSem::Process() double x = hoXData[offset + j * stride]; double y = hoYData[offset + j * stride]; NodeSharedPtr n = - boost::shared_ptr(new Node(nodeId, x, y, 0.0)); + std::shared_ptr(new Node(nodeId, x, y, 0.0)); edgeNodes.push_back(n); } } @@ -401,7 +401,7 @@ void InputSem::Process() double x = hoXData[offset + k]; double y = hoYData[offset + k]; NodeSharedPtr n = - boost::shared_ptr(new Node(nodeId, x, y, 0.0)); + std::shared_ptr(new Node(nodeId, x, y, 0.0)); edgeNodes.push_back(n); } } diff --git a/utilities/NekMesh/InputModules/InputStar.cpp b/utilities/NekMesh/InputModules/InputStar.cpp index 02a5da68a..af9ada439 100644 --- a/utilities/NekMesh/InputModules/InputStar.cpp +++ b/utilities/NekMesh/InputModules/InputStar.cpp @@ -955,7 +955,7 @@ void InputStar::ReadNodes(std::vector &Nodes) for (int i = 0; i < nVertices; ++i) { - Nodes.push_back(boost::shared_ptr( + Nodes.push_back(std::shared_ptr( new Node(i, verts[3 * i], verts[3 * i + 1], verts[3 * i + 2]))); } } diff --git a/utilities/NekMesh/InputModules/InputStarTec.cpp b/utilities/NekMesh/InputModules/InputStarTec.cpp index d9ef3b229..212ed4f14 100644 --- a/utilities/NekMesh/InputModules/InputStarTec.cpp +++ b/utilities/NekMesh/InputModules/InputStarTec.cpp @@ -221,7 +221,7 @@ void InputTec::ReadZone(int &nComposite) for (i = 0; i < nnodes; ++i) { Nodes.push_back( - boost::shared_ptr( + std::shared_ptr( new Node(i, nodeLocs[i], nodeLocs[i+nnodes], nodeLocs[i+2*nnodes]))); } diff --git a/utilities/NekMesh/InputModules/InputSwan.cpp b/utilities/NekMesh/InputModules/InputSwan.cpp index 6f30f0104..91f41ae62 100644 --- a/utilities/NekMesh/InputModules/InputSwan.cpp +++ b/utilities/NekMesh/InputModules/InputSwan.cpp @@ -140,7 +140,7 @@ void InputSwan::Process() double y = pts[1 * NB_Points + i]; double z = pts[2 * NB_Points + i]; m_mesh->m_node.push_back( - boost::shared_ptr(new Node(vid, x, y, z))); + std::shared_ptr(new Node(vid, x, y, z))); vid++; } diff --git a/utilities/NekMesh/InputModules/InputSwan.h b/utilities/NekMesh/InputModules/InputSwan.h index 8d05fc288..5eb2ded9d 100644 --- a/utilities/NekMesh/InputModules/InputSwan.h +++ b/utilities/NekMesh/InputModules/InputSwan.h @@ -48,7 +48,7 @@ class InputSwan : public NekMeshUtils::InputModule { public: /// Creates an instance of this class - static boost::shared_ptr create(NekMeshUtils::MeshSharedPtr m) + static std::shared_ptr create(NekMeshUtils::MeshSharedPtr m) { return MemoryManager::AllocateSharedPtr(m); } diff --git a/utilities/NekMesh/InputModules/InputVtk.cpp b/utilities/NekMesh/InputModules/InputVtk.cpp index 18a9c5aaf..3ddd5d900 100644 --- a/utilities/NekMesh/InputModules/InputVtk.cpp +++ b/utilities/NekMesh/InputModules/InputVtk.cpp @@ -121,7 +121,7 @@ void InputVtk::Process() } m_mesh->m_node.push_back( - boost::shared_ptr(new Node(i, p[0], p[1], p[2]))); + std::shared_ptr(new Node(i, p[0], p[1], p[2]))); } for (int c = 0; c < numCellTypes; ++c) diff --git a/utilities/NekMesh/NekMesh.cpp b/utilities/NekMesh/NekMesh.cpp index 3a7719fe9..7639cc18b 100644 --- a/utilities/NekMesh/NekMesh.cpp +++ b/utilities/NekMesh/NekMesh.cpp @@ -124,7 +124,7 @@ int main(int argc, char* argv[]) t = eProcessModule; } - MeshSharedPtr m = boost::shared_ptr(new Mesh()); + MeshSharedPtr m = std::shared_ptr(new Mesh()); ModuleSharedPtr mod = GetModuleFactory().CreateInstance( ModuleKey(t, tmp1[1]), m); cerr << "Options for module " << tmp1[1] << ":" << endl; @@ -157,7 +157,7 @@ int main(int argc, char* argv[]) * module to load. */ - MeshSharedPtr mesh = boost::shared_ptr(new Mesh()); + MeshSharedPtr mesh = std::shared_ptr(new Mesh()); vector modules; vector modcmds; diff --git a/utilities/NekMesh/OutputModules/OutputGmsh.cpp b/utilities/NekMesh/OutputModules/OutputGmsh.cpp index 616c2e24a..92467e7ec 100644 --- a/utilities/NekMesh/OutputModules/OutputGmsh.cpp +++ b/utilities/NekMesh/OutputModules/OutputGmsh.cpp @@ -89,8 +89,8 @@ void OutputGmsh::Process() cout << "OutputGmsh: Writing file..." << endl; } - boost::unordered_map > orderingMap; - boost::unordered_map >::iterator oIt; + std::unordered_map > orderingMap; + std::unordered_map >::iterator oIt; // Open the file stream. OpenStream(); diff --git a/utilities/NekMesh/OutputModules/OutputGmsh.h b/utilities/NekMesh/OutputModules/OutputGmsh.h index 06fdba647..7a974281f 100644 --- a/utilities/NekMesh/OutputModules/OutputGmsh.h +++ b/utilities/NekMesh/OutputModules/OutputGmsh.h @@ -37,6 +37,7 @@ #define UTILITIES_NEKMESH_OUTPUTGMSH #include +#include namespace Nektar { @@ -49,12 +50,8 @@ struct ElmtConfigHash : std::unary_function create(NekMeshUtils::MeshSharedPtr m) { + static std::shared_ptr create(NekMeshUtils::MeshSharedPtr m) { return MemoryManager::AllocateSharedPtr(m); } static NekMeshUtils::ModuleKey className; @@ -83,7 +80,7 @@ public: virtual void Process(); private: - boost::unordered_map elmMap; + std::unordered_map elmMap; }; } diff --git a/utilities/NekMesh/OutputModules/OutputNekpp.cpp b/utilities/NekMesh/OutputModules/OutputNekpp.cpp index f99b9ba81..f953a9035 100644 --- a/utilities/NekMesh/OutputModules/OutputNekpp.cpp +++ b/utilities/NekMesh/OutputModules/OutputNekpp.cpp @@ -78,9 +78,9 @@ OutputNekpp::~OutputNekpp() template void TestElmts(SpatialDomains::MeshGraphSharedPtr &graph) { - const std::map > &tmp = + const std::map > &tmp = graph->GetAllElementsOfType(); - typename std::map >::const_iterator it1, it2; + typename std::map >::const_iterator it1, it2; SpatialDomains::CurveMap &curvedEdges = graph->GetCurvedEdges(); SpatialDomains::CurveMap &curvedFaces = graph->GetCurvedFaces(); diff --git a/utilities/NekMesh/OutputModules/OutputNekpp.h b/utilities/NekMesh/OutputModules/OutputNekpp.h index fda990f22..86ec284c5 100644 --- a/utilities/NekMesh/OutputModules/OutputNekpp.h +++ b/utilities/NekMesh/OutputModules/OutputNekpp.h @@ -50,7 +50,7 @@ class OutputNekpp : public NekMeshUtils::OutputModule { public: /// Creates an instance of this class - static boost::shared_ptr create(NekMeshUtils::MeshSharedPtr m) + static std::shared_ptr create(NekMeshUtils::MeshSharedPtr m) { return MemoryManager::AllocateSharedPtr(m); } diff --git a/utilities/NekMesh/OutputModules/OutputSTL.h b/utilities/NekMesh/OutputModules/OutputSTL.h index 83a4365f7..2f79748f9 100644 --- a/utilities/NekMesh/OutputModules/OutputSTL.h +++ b/utilities/NekMesh/OutputModules/OutputSTL.h @@ -47,7 +47,7 @@ class OutputSTL : public NekMeshUtils::OutputModule { public: /// Creates an instance of this class - static boost::shared_ptr create(NekMeshUtils::MeshSharedPtr m) + static std::shared_ptr create(NekMeshUtils::MeshSharedPtr m) { return MemoryManager::AllocateSharedPtr(m); } diff --git a/utilities/NekMesh/OutputModules/OutputVtk.h b/utilities/NekMesh/OutputModules/OutputVtk.h index 2d9f3ae57..8c0e96384 100644 --- a/utilities/NekMesh/OutputModules/OutputVtk.h +++ b/utilities/NekMesh/OutputModules/OutputVtk.h @@ -48,7 +48,7 @@ class OutputVtk : public NekMeshUtils::OutputModule { public: /// Creates an instance of this class - static boost::shared_ptr create(NekMeshUtils::MeshSharedPtr m) + static std::shared_ptr create(NekMeshUtils::MeshSharedPtr m) { return MemoryManager::AllocateSharedPtr(m); } diff --git a/utilities/NekMesh/ProcessModules/ProcessBL.cpp b/utilities/NekMesh/ProcessModules/ProcessBL.cpp index 42c955953..492cbae6d 100644 --- a/utilities/NekMesh/ProcessModules/ProcessBL.cpp +++ b/utilities/NekMesh/ProcessModules/ProcessBL.cpp @@ -191,8 +191,8 @@ void ProcessBL::BoundaryLayer2D() // are generated along that edge when a prism is split, and is used // to avoid generation of duplicate vertices. It is stored as an // unordered map for speed. - boost::unordered_map > edgeMap; - boost::unordered_map >::iterator eIt; + std::unordered_map > edgeMap; + std::unordered_map >::iterator eIt; string surf = m_config["surf"].as(); if (surf.size() > 0) @@ -289,7 +289,7 @@ void ProcessBL::BoundaryLayer2D() // Get elemental geometry object. SpatialDomains::QuadGeomSharedPtr geom = - boost::dynamic_pointer_cast( + std::dynamic_pointer_cast( el[i]->GetGeom(m_mesh->m_spaceDim)); // Determine whether to use reverse points. @@ -627,8 +627,8 @@ void ProcessBL::BoundaryLayer3D() // Map which takes element ID to face on surface. This enables // splitting to occur in either y-direction of the prism. - boost::unordered_map splitEls; - boost::unordered_map::iterator sIt; + std::unordered_map splitEls; + std::unordered_map::iterator sIt; // Set up maps which takes an edge (in nektar++ ordering) and return // their offset and stride in the 3d array of collapsed quadrature @@ -726,8 +726,8 @@ void ProcessBL::BoundaryLayer3D() // are generated along that edge when a prism is split, and is used // to avoid generation of duplicate vertices. It is stored as an // unordered map for speed. - boost::unordered_map > edgeMap; - boost::unordered_map >::iterator eIt; + std::unordered_map > edgeMap; + std::unordered_map >::iterator eIt; string surf = m_config["surf"].as(); if (surf.size() > 0) @@ -840,7 +840,7 @@ void ProcessBL::BoundaryLayer3D() } // Get elemental geometry object and put into map. - geomMap[elId] = boost::dynamic_pointer_cast( + geomMap[elId] = std::dynamic_pointer_cast( el[i]->GetGeom(m_mesh->m_spaceDim)); } @@ -917,7 +917,7 @@ void ProcessBL::BoundaryLayer3D() // Create local region. SpatialDomains::PrismGeomSharedPtr g = - boost::dynamic_pointer_cast(geom); + std::dynamic_pointer_cast(geom); q = MemoryManager::AllocateSharedPtr( B0, B1, B2, g); } @@ -932,7 +932,7 @@ void ProcessBL::BoundaryLayer3D() // Create local region. SpatialDomains::HexGeomSharedPtr g = - boost::dynamic_pointer_cast(geom); + std::dynamic_pointer_cast(geom); q = MemoryManager::AllocateSharedPtr( B0, B0, B1, g); } diff --git a/utilities/NekMesh/ProcessModules/ProcessBL.h b/utilities/NekMesh/ProcessModules/ProcessBL.h index 1faf67ee9..4368535d2 100644 --- a/utilities/NekMesh/ProcessModules/ProcessBL.h +++ b/utilities/NekMesh/ProcessModules/ProcessBL.h @@ -53,7 +53,7 @@ class ProcessBL : public NekMeshUtils::ProcessModule { public: /// Creates an instance of this class - static boost::shared_ptr create(NekMeshUtils::MeshSharedPtr m) + static std::shared_ptr create(NekMeshUtils::MeshSharedPtr m) { return MemoryManager::AllocateSharedPtr(m); } diff --git a/utilities/NekMesh/ProcessModules/ProcessCurve.h b/utilities/NekMesh/ProcessModules/ProcessCurve.h index 454c07c23..588daca0c 100644 --- a/utilities/NekMesh/ProcessModules/ProcessCurve.h +++ b/utilities/NekMesh/ProcessModules/ProcessCurve.h @@ -49,7 +49,7 @@ class ProcessCurve : public ProcessCurvedEdges { public: /// Creates an instance of this class - static boost::shared_ptr create(NekMeshUtils::MeshSharedPtr m) + static std::shared_ptr create(NekMeshUtils::MeshSharedPtr m) { return MemoryManager::AllocateSharedPtr(m); } diff --git a/utilities/NekMesh/ProcessModules/ProcessCyl.h b/utilities/NekMesh/ProcessModules/ProcessCyl.h index f7ec799a4..79986d6fb 100644 --- a/utilities/NekMesh/ProcessModules/ProcessCyl.h +++ b/utilities/NekMesh/ProcessModules/ProcessCyl.h @@ -47,7 +47,7 @@ class ProcessCyl : public ProcessCurvedEdges { public: /// Creates an instance of this class - static boost::shared_ptr create(NekMeshUtils::MeshSharedPtr m) + static std::shared_ptr create(NekMeshUtils::MeshSharedPtr m) { return MemoryManager::AllocateSharedPtr(m); } diff --git a/utilities/NekMesh/ProcessModules/ProcessDetectSurf.h b/utilities/NekMesh/ProcessModules/ProcessDetectSurf.h index 1b78ddaa3..91e7821d7 100644 --- a/utilities/NekMesh/ProcessModules/ProcessDetectSurf.h +++ b/utilities/NekMesh/ProcessModules/ProcessDetectSurf.h @@ -53,7 +53,7 @@ class ProcessDetectSurf : public NekMeshUtils::ProcessModule { public: /// Creates an instance of this class - static boost::shared_ptr create(NekMeshUtils::MeshSharedPtr m) + static std::shared_ptr create(NekMeshUtils::MeshSharedPtr m) { return MemoryManager::AllocateSharedPtr(m); } diff --git a/utilities/NekMesh/ProcessModules/ProcessExtractSurf.cpp b/utilities/NekMesh/ProcessModules/ProcessExtractSurf.cpp index acba1e90c..6f19bfafd 100644 --- a/utilities/NekMesh/ProcessModules/ProcessExtractSurf.cpp +++ b/utilities/NekMesh/ProcessModules/ProcessExtractSurf.cpp @@ -114,7 +114,7 @@ void ProcessExtractSurf::Process() } // keptIds stores IDs of elements we processed earlier. - boost::unordered_set keptIds; + std::unordered_set keptIds; EdgeSet bndEdgeSet; diff --git a/utilities/NekMesh/ProcessModules/ProcessExtractSurf.h b/utilities/NekMesh/ProcessModules/ProcessExtractSurf.h index 8223aaa53..404bff331 100644 --- a/utilities/NekMesh/ProcessModules/ProcessExtractSurf.h +++ b/utilities/NekMesh/ProcessModules/ProcessExtractSurf.h @@ -53,7 +53,7 @@ class ProcessExtractSurf : public NekMeshUtils::ProcessModule { public: /// Creates an instance of this class - static boost::shared_ptr create(NekMeshUtils::MeshSharedPtr m) + static std::shared_ptr create(NekMeshUtils::MeshSharedPtr m) { return MemoryManager::AllocateSharedPtr(m); } diff --git a/utilities/NekMesh/ProcessModules/ProcessExtractTetPrismInterface.h b/utilities/NekMesh/ProcessModules/ProcessExtractTetPrismInterface.h index 0058d8b94..df73c1cb5 100644 --- a/utilities/NekMesh/ProcessModules/ProcessExtractTetPrismInterface.h +++ b/utilities/NekMesh/ProcessModules/ProcessExtractTetPrismInterface.h @@ -52,7 +52,7 @@ class ProcessExtractTetPrismInterface : public NekMeshUtils::ProcessModule { public: /// Creates an instance of this class - static boost::shared_ptr create(NekMeshUtils::MeshSharedPtr m) + static std::shared_ptr create(NekMeshUtils::MeshSharedPtr m) { return MemoryManager< ProcessExtractTetPrismInterface>::AllocateSharedPtr(m); diff --git a/utilities/NekMesh/ProcessModules/ProcessExtrude.cpp b/utilities/NekMesh/ProcessModules/ProcessExtrude.cpp index a7cdc5037..1ce2a6836 100644 --- a/utilities/NekMesh/ProcessModules/ProcessExtrude.cpp +++ b/utilities/NekMesh/ProcessModules/ProcessExtrude.cpp @@ -170,11 +170,11 @@ void ProcessExtrude::Process() for (int i = 0; i < ns.size(); i++) { NodeSharedPtr n = (*eit)->m_edgeNodes[i]; - ns[i] = boost::shared_ptr( + ns[i] = std::shared_ptr( new Node(0, n->m_x, n->m_y, j * dz)); } - EdgeSharedPtr e = boost::shared_ptr( + EdgeSharedPtr e = std::shared_ptr( new Edge(id2node[(*eit)->m_n1->m_id + j * nodes.size()], id2node[(*eit)->m_n2->m_id + j * nodes.size()])); diff --git a/utilities/NekMesh/ProcessModules/ProcessExtrude.h b/utilities/NekMesh/ProcessModules/ProcessExtrude.h index d1798736d..000b608d7 100644 --- a/utilities/NekMesh/ProcessModules/ProcessExtrude.h +++ b/utilities/NekMesh/ProcessModules/ProcessExtrude.h @@ -49,7 +49,7 @@ class ProcessExtrude : public NekMeshUtils::ProcessModule { public: /// Creates an instance of this class - static boost::shared_ptr create(NekMeshUtils::MeshSharedPtr m) + static std::shared_ptr create(NekMeshUtils::MeshSharedPtr m) { return MemoryManager::AllocateSharedPtr(m); } diff --git a/utilities/NekMesh/ProcessModules/ProcessInsertSurface.cpp b/utilities/NekMesh/ProcessModules/ProcessInsertSurface.cpp index db3ba4d44..d4779ee0b 100644 --- a/utilities/NekMesh/ProcessModules/ProcessInsertSurface.cpp +++ b/utilities/NekMesh/ProcessModules/ProcessInsertSurface.cpp @@ -86,7 +86,7 @@ void ProcessInsertSurface::Process() { cout << "inserting surface from " << file << endl; } - MeshSharedPtr inMsh = boost::shared_ptr(new Mesh()); + MeshSharedPtr inMsh = std::shared_ptr(new Mesh()); inMsh->m_verbose = m_mesh->m_verbose; ModuleSharedPtr mod = GetModuleFactory().CreateInstance( ModuleKey(eInputModule, "xml"), inMsh); @@ -190,7 +190,7 @@ void ProcessInsertSurface::Process() } NodeSharedPtr inN2 = inMshnodeList[result[0].second]; - EdgeSharedPtr tst = boost::shared_ptr(new Edge(inN1,inN2)); + EdgeSharedPtr tst = std::shared_ptr(new Edge(inN1,inN2)); EdgeSet::iterator f = inMsh->m_edgeSet.find(tst); diff --git a/utilities/NekMesh/ProcessModules/ProcessInsertSurface.h b/utilities/NekMesh/ProcessModules/ProcessInsertSurface.h index eace71bc2..ab9ce54c6 100644 --- a/utilities/NekMesh/ProcessModules/ProcessInsertSurface.h +++ b/utilities/NekMesh/ProcessModules/ProcessInsertSurface.h @@ -53,7 +53,7 @@ class ProcessInsertSurface : public NekMeshUtils::ProcessModule { public: /// Creates an instance of this class - static boost::shared_ptr create(NekMeshUtils::MeshSharedPtr m) + static std::shared_ptr create(NekMeshUtils::MeshSharedPtr m) { return MemoryManager::AllocateSharedPtr(m); } diff --git a/utilities/NekMesh/ProcessModules/ProcessJac.h b/utilities/NekMesh/ProcessModules/ProcessJac.h index 3c2df6f1b..024a774a2 100644 --- a/utilities/NekMesh/ProcessModules/ProcessJac.h +++ b/utilities/NekMesh/ProcessModules/ProcessJac.h @@ -53,7 +53,7 @@ class ProcessJac : public NekMeshUtils::ProcessModule { public: /// Creates an instance of this class - static boost::shared_ptr create(NekMeshUtils::MeshSharedPtr m) + static std::shared_ptr create(NekMeshUtils::MeshSharedPtr m) { return MemoryManager::AllocateSharedPtr(m); } diff --git a/utilities/NekMesh/ProcessModules/ProcessLinear.cpp b/utilities/NekMesh/ProcessModules/ProcessLinear.cpp index 489dc3739..607b6d076 100644 --- a/utilities/NekMesh/ProcessModules/ProcessLinear.cpp +++ b/utilities/NekMesh/ProcessModules/ProcessLinear.cpp @@ -141,7 +141,7 @@ void ProcessLinear::Process() set neigh; vector zeroNodes; - boost::unordered_set clearedEdges, clearedFaces, clearedElmts; + std::unordered_set clearedEdges, clearedFaces, clearedElmts; vector dumpEls; @@ -205,7 +205,7 @@ void ProcessLinear::Process() el.clear(); set::iterator it1; - boost::unordered_set::iterator it2; + std::unordered_set::iterator it2; for(int i = 0; i < els.size(); i++) { it1 = neigh.find(els[i]->GetId()); @@ -227,7 +227,7 @@ void ProcessLinear::Process() if(m_config["extract"].beenSet) { - MeshSharedPtr dmp = boost::shared_ptr(new Mesh()); + MeshSharedPtr dmp = std::shared_ptr(new Mesh()); dmp->m_expDim = 3; dmp->m_spaceDim = 3; dmp->m_nummode = 2; diff --git a/utilities/NekMesh/ProcessModules/ProcessLinear.h b/utilities/NekMesh/ProcessModules/ProcessLinear.h index bba7fdd29..5d74ac830 100644 --- a/utilities/NekMesh/ProcessModules/ProcessLinear.h +++ b/utilities/NekMesh/ProcessModules/ProcessLinear.h @@ -50,7 +50,7 @@ class ProcessLinear : public NekMeshUtils::ProcessModule { public: /// Creates an instance of this class - static boost::shared_ptr create(NekMeshUtils::MeshSharedPtr m) + static std::shared_ptr create(NekMeshUtils::MeshSharedPtr m) { return MemoryManager::AllocateSharedPtr(m); } diff --git a/utilities/NekMesh/ProcessModules/ProcessLinkCheck.h b/utilities/NekMesh/ProcessModules/ProcessLinkCheck.h index a015c53a1..f943918f0 100644 --- a/utilities/NekMesh/ProcessModules/ProcessLinkCheck.h +++ b/utilities/NekMesh/ProcessModules/ProcessLinkCheck.h @@ -53,7 +53,7 @@ class ProcessLinkCheck : public NekMeshUtils::ProcessModule { public: /// Creates an instance of this class - static boost::shared_ptr create(NekMeshUtils::MeshSharedPtr m) + static std::shared_ptr create(NekMeshUtils::MeshSharedPtr m) { return MemoryManager::AllocateSharedPtr(m); } diff --git a/utilities/NekMesh/ProcessModules/ProcessOptiExtract.cpp b/utilities/NekMesh/ProcessModules/ProcessOptiExtract.cpp index 161b71a47..fcbacc83c 100644 --- a/utilities/NekMesh/ProcessModules/ProcessOptiExtract.cpp +++ b/utilities/NekMesh/ProcessModules/ProcessOptiExtract.cpp @@ -100,8 +100,8 @@ void ProcessOptiExtract::Process() } } - boost::unordered_set inmesh; - pair::iterator, bool> t; + std::unordered_set inmesh; + pair::iterator, bool> t; vector totest; for (int i = 0; i < invalid.size(); i++) @@ -297,7 +297,7 @@ void ProcessOptiExtract::Process() { // insert other mesh cout << ins << endl; - MeshSharedPtr inp_mesh = boost::shared_ptr(new Mesh()); + MeshSharedPtr inp_mesh = std::shared_ptr(new Mesh()); ModuleSharedPtr mod = GetModuleFactory().CreateInstance( ModuleKey(eInputModule, "xml"), inp_mesh); mod->RegisterConfig("infile", ins); diff --git a/utilities/NekMesh/ProcessModules/ProcessOptiExtract.h b/utilities/NekMesh/ProcessModules/ProcessOptiExtract.h index aafa66666..98cad1dc8 100644 --- a/utilities/NekMesh/ProcessModules/ProcessOptiExtract.h +++ b/utilities/NekMesh/ProcessModules/ProcessOptiExtract.h @@ -47,7 +47,7 @@ class ProcessOptiExtract : public NekMeshUtils::ProcessModule { public: /// Creates an instance of this class - static boost::shared_ptr create(NekMeshUtils::MeshSharedPtr m) + static std::shared_ptr create(NekMeshUtils::MeshSharedPtr m) { return MemoryManager::AllocateSharedPtr(m); } diff --git a/utilities/NekMesh/ProcessModules/ProcessPerAlign.cpp b/utilities/NekMesh/ProcessModules/ProcessPerAlign.cpp index 14053d350..df4f6d25c 100644 --- a/utilities/NekMesh/ProcessModules/ProcessPerAlign.cpp +++ b/utilities/NekMesh/ProcessModules/ProcessPerAlign.cpp @@ -197,7 +197,7 @@ void ProcessPerAlign::Process() centroidMap[i] = centroid; } - boost::unordered_set elmtDone; + std::unordered_set elmtDone; map elmtPairs; map vertCheck; diff --git a/utilities/NekMesh/ProcessModules/ProcessPerAlign.h b/utilities/NekMesh/ProcessModules/ProcessPerAlign.h index 88392d422..063784371 100644 --- a/utilities/NekMesh/ProcessModules/ProcessPerAlign.h +++ b/utilities/NekMesh/ProcessModules/ProcessPerAlign.h @@ -47,7 +47,7 @@ class ProcessPerAlign : public NekMeshUtils::ProcessModule { public: /// Creates an instance of this class - static boost::shared_ptr create(NekMeshUtils::MeshSharedPtr m) + static std::shared_ptr create(NekMeshUtils::MeshSharedPtr m) { return MemoryManager::AllocateSharedPtr(m); } diff --git a/utilities/NekMesh/ProcessModules/ProcessScalar.h b/utilities/NekMesh/ProcessModules/ProcessScalar.h index 71f3ef7fc..92cfb6510 100644 --- a/utilities/NekMesh/ProcessModules/ProcessScalar.h +++ b/utilities/NekMesh/ProcessModules/ProcessScalar.h @@ -53,7 +53,7 @@ class ProcessScalar : public NekMeshUtils::ProcessModule { public: /// Creates an instance of this class - static boost::shared_ptr create(NekMeshUtils::MeshSharedPtr m) + static std::shared_ptr create(NekMeshUtils::MeshSharedPtr m) { return MemoryManager::AllocateSharedPtr(m); } diff --git a/utilities/NekMesh/ProcessModules/ProcessSpherigon.cpp b/utilities/NekMesh/ProcessModules/ProcessSpherigon.cpp index 12e73eac7..0bd875198 100644 --- a/utilities/NekMesh/ProcessModules/ProcessSpherigon.cpp +++ b/utilities/NekMesh/ProcessModules/ProcessSpherigon.cpp @@ -301,7 +301,7 @@ void ProcessSpherigon::FindNormalFromPlyFile(MeshSharedPtr &plymesh, void ProcessSpherigon::GenerateNormals(std::vector &el, MeshSharedPtr &mesh) { - boost::unordered_map::iterator nIt; + std::unordered_map::iterator nIt; for (int i = 0; i < el.size(); ++i) { @@ -378,8 +378,8 @@ void ProcessSpherigon::Process() ASSERTL0(m_mesh->m_spaceDim == 3 || m_mesh->m_spaceDim == 2, "Spherigon implementation only valid in 2D/3D."); - boost::unordered_set::iterator eIt; - boost::unordered_set visitedEdges; + std::unordered_set::iterator eIt; + std::unordered_set visitedEdges; // First construct vector of elements to process. vector el; @@ -558,8 +558,8 @@ void ProcessSpherigon::Process() inply.push(inplyTmp); - MeshSharedPtr m = boost::shared_ptr(new Mesh()); - plyfile = boost::shared_ptr(new InputPly(m)); + MeshSharedPtr m = std::shared_ptr(new Mesh()); + plyfile = std::shared_ptr(new InputPly(m)); plyfile->ReadPly(inply, scale); plyfile->ProcessVertices(); @@ -762,7 +762,7 @@ void ProcessSpherigon::Process() if (e->GetConf().m_e == LibUtilities::eSegment) { SpatialDomains::SegGeomSharedPtr geom = - boost::dynamic_pointer_cast( + std::dynamic_pointer_cast( e->GetGeom(m_mesh->m_spaceDim)); LocalRegions::SegExpSharedPtr seg = MemoryManager::AllocateSharedPtr(B2, @@ -773,7 +773,7 @@ void ProcessSpherigon::Process() else if (e->GetConf().m_e == LibUtilities::eTriangle) { SpatialDomains::TriGeomSharedPtr geom = - boost::dynamic_pointer_cast( + std::dynamic_pointer_cast( e->GetGeom(3)); LocalRegions::NodalTriExpSharedPtr tri = MemoryManager::AllocateSharedPtr( @@ -807,7 +807,7 @@ void ProcessSpherigon::Process() else if (e->GetConf().m_e == LibUtilities::eQuadrilateral) { SpatialDomains::QuadGeomSharedPtr geom = - boost::dynamic_pointer_cast( + std::dynamic_pointer_cast( e->GetGeom(3)); LocalRegions::QuadExpSharedPtr quad = MemoryManager::AllocateSharedPtr( diff --git a/utilities/NekMesh/ProcessModules/ProcessSpherigon.h b/utilities/NekMesh/ProcessModules/ProcessSpherigon.h index 643af8a44..56a502c0f 100644 --- a/utilities/NekMesh/ProcessModules/ProcessSpherigon.h +++ b/utilities/NekMesh/ProcessModules/ProcessSpherigon.h @@ -49,7 +49,7 @@ class ProcessSpherigon : public NekMeshUtils::ProcessModule { public: /// Creates an instance of this class - static boost::shared_ptr create(NekMeshUtils::MeshSharedPtr m) + static std::shared_ptr create(NekMeshUtils::MeshSharedPtr m) { return MemoryManager::AllocateSharedPtr(m); } diff --git a/utilities/NekMesh/ProcessModules/ProcessTetSplit.cpp b/utilities/NekMesh/ProcessModules/ProcessTetSplit.cpp index a4272e9d0..e8cbcab1f 100644 --- a/utilities/NekMesh/ProcessModules/ProcessTetSplit.cpp +++ b/utilities/NekMesh/ProcessModules/ProcessTetSplit.cpp @@ -231,7 +231,7 @@ void ProcessTetSplit::Process() // Create local prismatic region so that co-ordinates of the // mapped element can be read from. SpatialDomains::PrismGeomSharedPtr geomLayer = - boost::dynamic_pointer_cast( + std::dynamic_pointer_cast( el[i]->GetGeom(m_mesh->m_spaceDim)); LibUtilities::BasisKey B0( LibUtilities::eOrtho_A, diff --git a/utilities/NekMesh/ProcessModules/ProcessTetSplit.h b/utilities/NekMesh/ProcessModules/ProcessTetSplit.h index 9b9838fde..475115dcf 100644 --- a/utilities/NekMesh/ProcessModules/ProcessTetSplit.h +++ b/utilities/NekMesh/ProcessModules/ProcessTetSplit.h @@ -53,7 +53,7 @@ class ProcessTetSplit : public NekMeshUtils::ProcessModule { public: /// Creates an instance of this class - static boost::shared_ptr create(NekMeshUtils::MeshSharedPtr m) + static std::shared_ptr create(NekMeshUtils::MeshSharedPtr m) { return MemoryManager::AllocateSharedPtr(m); } diff --git a/utilities/NekMesh/ProcessModules/ProcessVarOpti/ElUtil.cpp b/utilities/NekMesh/ProcessModules/ProcessVarOpti/ElUtil.cpp index 8e0800759..d0280d326 100644 --- a/utilities/NekMesh/ProcessModules/ProcessVarOpti/ElUtil.cpp +++ b/utilities/NekMesh/ProcessModules/ProcessVarOpti/ElUtil.cpp @@ -45,7 +45,7 @@ namespace Nektar namespace Utilities { -boost::mutex mtx2; +std::mutex mtx2; ElUtil::ElUtil(ElementSharedPtr e, DerivUtilSharedPtr d, ResidualSharedPtr r, int n, int o) diff --git a/utilities/NekMesh/ProcessModules/ProcessVarOpti/ElUtil.h b/utilities/NekMesh/ProcessModules/ProcessVarOpti/ElUtil.h index 610d4cac4..0cc7badc8 100644 --- a/utilities/NekMesh/ProcessModules/ProcessVarOpti/ElUtil.h +++ b/utilities/NekMesh/ProcessModules/ProcessVarOpti/ElUtil.h @@ -50,12 +50,12 @@ using namespace NekMeshUtils; struct DerivUtil; struct Residual; -typedef boost::shared_ptr DerivUtilSharedPtr; -typedef boost::shared_ptr ResidualSharedPtr; +typedef std::shared_ptr DerivUtilSharedPtr; +typedef std::shared_ptr ResidualSharedPtr; class ElUtilJob; -class ElUtil : public boost::enable_shared_from_this +class ElUtil : public std::enable_shared_from_this { public: ElUtil(ElementSharedPtr e, DerivUtilSharedPtr d, @@ -111,7 +111,7 @@ private: DerivUtilSharedPtr m_derivUtil; ResidualSharedPtr m_res; }; -typedef boost::shared_ptr ElUtilSharedPtr; +typedef std::shared_ptr ElUtilSharedPtr; class ElUtilJob : public Thread::ThreadJob { diff --git a/utilities/NekMesh/ProcessModules/ProcessVarOpti/NodeOpti.h b/utilities/NekMesh/ProcessModules/ProcessVarOpti/NodeOpti.h index a9348c891..ddd10c317 100644 --- a/utilities/NekMesh/ProcessModules/ProcessVarOpti/NodeOpti.h +++ b/utilities/NekMesh/ProcessModules/ProcessVarOpti/NodeOpti.h @@ -38,6 +38,7 @@ #include +#include #include #include "ProcessVarOpti.h" @@ -104,11 +105,11 @@ public: protected: NodeSharedPtr m_node; - boost::mutex mtx; + std::mutex mtx; std::map > m_data; Array m_grad; std::vector m_tmpStore; - boost::unordered_map m_derivs; + std::unordered_map m_derivs; template int IsIndefinite(); @@ -132,7 +133,7 @@ protected: } }; -typedef boost::shared_ptr NodeOptiSharedPtr; +typedef std::shared_ptr NodeOptiSharedPtr; typedef LibUtilities::NekFactory< int, NodeOpti, NodeSharedPtr, std::vector, ResidualSharedPtr, std::map, diff --git a/utilities/NekMesh/ProcessModules/ProcessVarOpti/NodeOptiCAD.cpp b/utilities/NekMesh/ProcessModules/ProcessVarOpti/NodeOptiCAD.cpp index 864b5f20a..0ed037f4d 100644 --- a/utilities/NekMesh/ProcessModules/ProcessVarOpti/NodeOptiCAD.cpp +++ b/utilities/NekMesh/ProcessModules/ProcessVarOpti/NodeOptiCAD.cpp @@ -44,7 +44,7 @@ namespace Nektar namespace Utilities { -boost::mutex mtx; +std::mutex mtx; int NodeOpti1D3D::m_type = GetNodeOptiFactory().RegisterCreatorFunction( 13, NodeOpti1D3D::create, "1D3D"); diff --git a/utilities/NekMesh/ProcessModules/ProcessVarOpti/PreProcessing.cpp b/utilities/NekMesh/ProcessModules/ProcessVarOpti/PreProcessing.cpp index f8834814d..f6b8bcbe3 100644 --- a/utilities/NekMesh/ProcessModules/ProcessVarOpti/PreProcessing.cpp +++ b/utilities/NekMesh/ProcessModules/ProcessVarOpti/PreProcessing.cpp @@ -79,7 +79,7 @@ map ProcessVarOpti::BuildDerivUtil( for (it = typeMap.begin(); it != typeMap.end(); it++) { PTypes pType = it->second; - DerivUtilSharedPtr der = boost::shared_ptr(new DerivUtil()); + DerivUtilSharedPtr der = std::shared_ptr(new DerivUtil()); LibUtilities::PointsKey pkey1(m_mesh->m_nummode, pType.second); LibUtilities::PointsKey pkey2(m_mesh->m_nummode + o, pType.first); @@ -525,7 +525,7 @@ void ProcessVarOpti::GetElementMap( ElementSharedPtr el = m_mesh->m_element[m_mesh->m_expDim][i]; vector ns; el->GetCurvedNodes(ns); - ElUtilSharedPtr d = boost::shared_ptr(new ElUtil( + ElUtilSharedPtr d = std::shared_ptr(new ElUtil( el, derMap[el->GetShapeType()], m_res, m_mesh->m_nummode, o)); m_dataSet.push_back(d); } @@ -557,8 +557,8 @@ vector ProcessVarOpti::GetLockedElements(NekDouble thres) } } - boost::unordered_set inmesh; - pair::iterator, bool> t; + std::unordered_set inmesh; + pair::iterator, bool> t; vector totest; for (int i = 0; i < elBelowThres.size(); i++) @@ -613,7 +613,7 @@ vector ProcessVarOpti::GetLockedElements(NekDouble thres) vector ret; for (int i = 0; i < m_dataSet.size(); ++i) { - boost::unordered_set::iterator s = + std::unordered_set::iterator s = inmesh.find(m_dataSet[i]->GetId()); if (s == inmesh.end()) { diff --git a/utilities/NekMesh/ProcessModules/ProcessVarOpti/ProcessVarOpti.cpp b/utilities/NekMesh/ProcessModules/ProcessVarOpti/ProcessVarOpti.cpp index 0d15ff811..19f0fd155 100644 --- a/utilities/NekMesh/ProcessModules/ProcessVarOpti/ProcessVarOpti.cpp +++ b/utilities/NekMesh/ProcessModules/ProcessVarOpti/ProcessVarOpti.cpp @@ -173,7 +173,7 @@ void ProcessVarOpti::Process() ASSERTL0(false, "cannot deal with manifolds"); } - m_res = boost::shared_ptr(new Residual); + m_res = std::shared_ptr(new Residual); m_res->val = 1.0; @@ -436,7 +436,7 @@ protected: return NekVector(); } - virtual boost::shared_ptr v_CreateUtil( + virtual std::shared_ptr v_CreateUtil( Array > &xi) { return MemoryManager::AllocateSharedPtr( diff --git a/utilities/NekMesh/ProcessModules/ProcessVarOpti/ProcessVarOpti.h b/utilities/NekMesh/ProcessModules/ProcessVarOpti/ProcessVarOpti.h index 2f1504c6f..571d91fb1 100644 --- a/utilities/NekMesh/ProcessModules/ProcessVarOpti/ProcessVarOpti.h +++ b/utilities/NekMesh/ProcessModules/ProcessVarOpti/ProcessVarOpti.h @@ -56,7 +56,7 @@ struct DerivUtil int pts; int ptsStd; }; -typedef boost::shared_ptr DerivUtilSharedPtr; +typedef std::shared_ptr DerivUtilSharedPtr; enum optiType { @@ -78,13 +78,13 @@ struct Residual int alphaI; }; -typedef boost::shared_ptr ResidualSharedPtr; +typedef std::shared_ptr ResidualSharedPtr; class ProcessVarOpti : public ProcessModule { public: /// Creates an instance of this class - static boost::shared_ptr create(MeshSharedPtr m) + static std::shared_ptr create(MeshSharedPtr m) { return MemoryManager::AllocateSharedPtr(m); } -- GitLab