From 3dae4d458b8155b5fc861bcdc643d81214bd78b2 Mon Sep 17 00:00:00 2001 From: Ingmar Schoegl Date: Thu, 3 Aug 2023 17:08:21 -0500 Subject: [PATCH] Using std::unique_ptr --- include/cantera/base/AnyMap.h | 2 +- include/cantera/base/Storage.h | 2 +- include/cantera/equil/vcs_solve.h | 4 ++-- include/cantera/kinetics/ImplicitSurfChem.h | 4 ++-- include/cantera/numerics/BandMatrix.h | 2 +- include/cantera/oneD/Domain1D.h | 2 +- include/cantera/oneD/OneDim.h | 4 ++-- include/cantera/thermo/DebyeHuckel.h | 2 +- include/cantera/thermo/HMWSoln.h | 2 +- include/cantera/thermo/Nasa9PolyMultiTempRegion.h | 2 +- include/cantera/thermo/PDSS_HKFT.h | 2 +- include/cantera/thermo/PureFluidPhase.h | 2 +- include/cantera/thermo/VPStandardStateTP.h | 4 ++-- include/cantera/thermo/WaterSSTP.h | 2 +- include/cantera/transport/DustyGasTransport.h | 2 +- include/cantera/zeroD/ReactorNet.h | 2 +- samples/cxx/custom/custom.cpp | 2 +- samples/cxx/openmp_ignition/openmp_ignition.cpp | 4 ++-- src/base/application.h | 2 +- 19 files changed, 24 insertions(+), 24 deletions(-) diff --git a/include/cantera/base/AnyMap.h b/include/cantera/base/AnyMap.h index 7d4ead754e..8cdf69707e 100644 --- a/include/cantera/base/AnyMap.h +++ b/include/cantera/base/AnyMap.h @@ -585,7 +585,7 @@ class AnyMap : public AnyBase private: const AnyMap* m_data; OrderVector m_ordered; - std::unique_ptr> m_units; + unique_ptr> m_units; }; //! Defined to allow the OrderedProxy class to be used with range-based diff --git a/include/cantera/base/Storage.h b/include/cantera/base/Storage.h index 770fe33e20..29dd4e1cd7 100644 --- a/include/cantera/base/Storage.h +++ b/include/cantera/base/Storage.h @@ -117,7 +117,7 @@ class Storage //! ensure that HDF group is writeable bool checkGroupWrite(const string& id, bool permissive); - std::unique_ptr m_file; //!< HDF container file + unique_ptr m_file; //!< HDF container file bool m_write; //!< HDF access mode int m_compressionLevel=0; //!< HDF compression level #endif diff --git a/include/cantera/equil/vcs_solve.h b/include/cantera/equil/vcs_solve.h index 26534b7be1..fc6a24b5ac 100644 --- a/include/cantera/equil/vcs_solve.h +++ b/include/cantera/equil/vcs_solve.h @@ -1392,7 +1392,7 @@ class VCS_SOLVE vector m_elementActive; //! Array of Phase Structures. Length = number of phases. - vector> m_VolPhaseList; + vector> m_VolPhaseList; //! specifies the activity convention of the phase containing the species /*! @@ -1459,7 +1459,7 @@ class VCS_SOLVE /*! * SpeciesThermo[k] pointer to the thermo information for the kth species */ - vector> m_speciesThermoList; + vector> m_speciesThermoList; //! Choice of Hessians /*! diff --git a/include/cantera/kinetics/ImplicitSurfChem.h b/include/cantera/kinetics/ImplicitSurfChem.h index 8d8ab4c3cd..0ff1aa9acb 100644 --- a/include/cantera/kinetics/ImplicitSurfChem.h +++ b/include/cantera/kinetics/ImplicitSurfChem.h @@ -260,7 +260,7 @@ class ImplicitSurfChem : public FuncEval vector> pLocVec; //! Pointer to the CVODE integrator - std::unique_ptr m_integ; + unique_ptr m_integ; double m_atol, m_rtol; // tolerances double m_maxstep; //!< max step size size_t m_nmax; //!< maximum number of steps allowed @@ -293,7 +293,7 @@ class ImplicitSurfChem : public FuncEval /** * Pointer to the helper method, Placid, which solves the surface problem. */ - std::unique_ptr m_surfSolver; + unique_ptr m_surfSolver; //! If true, a common temperature and pressure for all surface and bulk //! phases associated with the surface problem is imposed diff --git a/include/cantera/numerics/BandMatrix.h b/include/cantera/numerics/BandMatrix.h index 100d3f2a45..8d89583b37 100644 --- a/include/cantera/numerics/BandMatrix.h +++ b/include/cantera/numerics/BandMatrix.h @@ -284,7 +284,7 @@ class BandMatrix : public GeneralMatrix struct PivData; // pImpl wrapper class //! Pivot vector - std::unique_ptr m_ipiv; + unique_ptr m_ipiv; //! Vector of column pointers vector m_colPtrs; diff --git a/include/cantera/oneD/Domain1D.h b/include/cantera/oneD/Domain1D.h index 528b9ad33a..02228818c8 100644 --- a/include/cantera/oneD/Domain1D.h +++ b/include/cantera/oneD/Domain1D.h @@ -601,7 +601,7 @@ class Domain1D //! Identity tag for the domain std::string m_id; - std::unique_ptr m_refiner; + unique_ptr m_refiner; vector m_name; int m_bw = -1; bool m_force_full_update = false; diff --git a/include/cantera/oneD/OneDim.h b/include/cantera/oneD/OneDim.h index 082d997f47..01543c247a 100644 --- a/include/cantera/oneD/OneDim.h +++ b/include/cantera/oneD/OneDim.h @@ -343,8 +343,8 @@ class OneDim shared_ptr> m_state; //!< Solution vector - std::unique_ptr m_jac; //!< Jacobian evaluator - std::unique_ptr m_newt; //!< Newton iterator + unique_ptr m_jac; //!< Jacobian evaluator + unique_ptr m_newt; //!< Newton iterator double m_rdt = 0.0; //!< reciprocal of time step bool m_jac_ok = false; //!< if true, Jacobian is current diff --git a/include/cantera/thermo/DebyeHuckel.h b/include/cantera/thermo/DebyeHuckel.h index 02141041c5..d15c5a05e9 100644 --- a/include/cantera/thermo/DebyeHuckel.h +++ b/include/cantera/thermo/DebyeHuckel.h @@ -911,7 +911,7 @@ class DebyeHuckel : public MolalityVPSSTP double m_densWaterSS = 1000.0; //! Pointer to the water property calculator - std::unique_ptr m_waterProps; + unique_ptr m_waterProps; //! vector of size m_kk, used as a temporary holding area. mutable vector m_tmpV; diff --git a/include/cantera/thermo/HMWSoln.h b/include/cantera/thermo/HMWSoln.h index 486325ebc2..2a8542e6ef 100644 --- a/include/cantera/thermo/HMWSoln.h +++ b/include/cantera/thermo/HMWSoln.h @@ -1457,7 +1457,7 @@ class HMWSoln : public MolalityVPSSTP PDSS* m_waterSS = nullptr; //! Pointer to the water property calculator - std::unique_ptr m_waterProps; + unique_ptr m_waterProps; //! vector of size m_kk, used as a temporary holding area. mutable vector m_tmpV; diff --git a/include/cantera/thermo/Nasa9PolyMultiTempRegion.h b/include/cantera/thermo/Nasa9PolyMultiTempRegion.h index 1c27434a69..a1d0f90ed3 100644 --- a/include/cantera/thermo/Nasa9PolyMultiTempRegion.h +++ b/include/cantera/thermo/Nasa9PolyMultiTempRegion.h @@ -123,7 +123,7 @@ class Nasa9PolyMultiTempRegion : public SpeciesThermoInterpType vector m_lowerTempBounds; //! Individual temperature region objects - vector> m_regionPts; + vector> m_regionPts; //! current region mutable int m_currRegion = 0; diff --git a/include/cantera/thermo/PDSS_HKFT.h b/include/cantera/thermo/PDSS_HKFT.h index 1053796ee7..2630d4fc2f 100644 --- a/include/cantera/thermo/PDSS_HKFT.h +++ b/include/cantera/thermo/PDSS_HKFT.h @@ -268,7 +268,7 @@ class PDSS_HKFT : public PDSS_Molar mutable double m_densWaterSS = -1.0; //! Pointer to the water property calculator - std::unique_ptr m_waterProps; + unique_ptr m_waterProps; //! Input value of deltaG of Formation at Tr and Pr (cal gmol-1) /*! diff --git a/include/cantera/thermo/PureFluidPhase.h b/include/cantera/thermo/PureFluidPhase.h index 49dd606978..e827c45a0a 100644 --- a/include/cantera/thermo/PureFluidPhase.h +++ b/include/cantera/thermo/PureFluidPhase.h @@ -204,7 +204,7 @@ class PureFluidPhase : public ThermoPhase private: //! Pointer to the underlying tpx object Substance that does the work - mutable std::unique_ptr m_sub; + mutable unique_ptr m_sub; //! Name for this substance used by the TPX package std::string m_tpx_name; diff --git a/include/cantera/thermo/VPStandardStateTP.h b/include/cantera/thermo/VPStandardStateTP.h index e113ad4f5b..6c135d3da6 100644 --- a/include/cantera/thermo/VPStandardStateTP.h +++ b/include/cantera/thermo/VPStandardStateTP.h @@ -245,7 +245,7 @@ class VPStandardStateTP : public ThermoPhase virtual bool addSpecies(shared_ptr spec); //! Install a PDSS object for species *k* - void installPDSS(size_t k, std::unique_ptr&& pdss); + void installPDSS(size_t k, unique_ptr&& pdss); //! @} PDSS* providePDSS(size_t k); @@ -282,7 +282,7 @@ class VPStandardStateTP : public ThermoPhase * Storage is in species index order. VPStandardStateTp owns each of the * objects. Copy operations are deep. */ - vector> m_PDSS_storage; + vector> m_PDSS_storage; //! Vector containing the species reference enthalpies at T = m_tlast //! and P = p_ref. diff --git a/include/cantera/thermo/WaterSSTP.h b/include/cantera/thermo/WaterSSTP.h index d5c0cb060f..79196bf233 100644 --- a/include/cantera/thermo/WaterSSTP.h +++ b/include/cantera/thermo/WaterSSTP.h @@ -198,7 +198,7 @@ class WaterSSTP : public SingleSpeciesTP * of water. This object owns m_waterProps, and the WaterPropsIAPWS object * used by WaterProps is m_sub, which is defined above. */ - std::unique_ptr m_waterProps; + unique_ptr m_waterProps; //! Molecular weight of Water -> %Cantera assumption double m_mw = 0.0; diff --git a/include/cantera/transport/DustyGasTransport.h b/include/cantera/transport/DustyGasTransport.h index 441dc0ff14..6bc06ec75f 100644 --- a/include/cantera/transport/DustyGasTransport.h +++ b/include/cantera/transport/DustyGasTransport.h @@ -284,7 +284,7 @@ class DustyGasTransport : public Transport double m_perm = -1.0; //! Pointer to the transport object for the gas phase - std::unique_ptr m_gastran; + unique_ptr m_gastran; }; } #endif diff --git a/include/cantera/zeroD/ReactorNet.h b/include/cantera/zeroD/ReactorNet.h index 473e2a7eb6..2b792cd061 100644 --- a/include/cantera/zeroD/ReactorNet.h +++ b/include/cantera/zeroD/ReactorNet.h @@ -318,7 +318,7 @@ class ReactorNet : public FuncEval virtual int lastOrder() const; vector m_reactors; - std::unique_ptr m_integ; + unique_ptr m_integ; //! The independent variable in the system. May be either time or space depending //! on the type of reactors in the network. diff --git a/samples/cxx/custom/custom.cpp b/samples/cxx/custom/custom.cpp index 14a87c1165..e9d5f5d521 100644 --- a/samples/cxx/custom/custom.cpp +++ b/samples/cxx/custom/custom.cpp @@ -180,7 +180,7 @@ int main() { // relative tolerance: 1.0e-9 // absolute tolerance: 1.0e-15 // max step size: +inf - std::unique_ptr integrator(newIntegrator("CVODE")); + unique_ptr integrator(newIntegrator("CVODE")); // initialize the integrator, specifying the start time and the RHS evaluator object. // internally, the integrator will apply settings, allocate needed memory, and populate diff --git a/samples/cxx/openmp_ignition/openmp_ignition.cpp b/samples/cxx/openmp_ignition/openmp_ignition.cpp index a293ffeffd..f4b44fe88d 100644 --- a/samples/cxx/openmp_ignition/openmp_ignition.cpp +++ b/samples/cxx/openmp_ignition/openmp_ignition.cpp @@ -29,8 +29,8 @@ void run() // to have its own set of linked Cantera objects. Multiple threads accessing // the same objects at the same time will cause errors. vector> sols; - vector> reactors; - vector> nets; + vector> reactors; + vector> nets; // Create and link the Cantera objects for each thread. This step should be // done in serial diff --git a/src/base/application.h b/src/base/application.h index f1606b0454..e92717ce3f 100644 --- a/src/base/application.h +++ b/src/base/application.h @@ -156,7 +156,7 @@ class Application vector errorMessage; //! Current pointer to the logwriter - std::unique_ptr logwriter; + unique_ptr logwriter; }; //! Typedef for thread specific messages