diff --git a/include/crossplatform_shared_ptr.h b/include/crossplatform_shared_ptr.h index 28a8acaf..36d8ea00 100644 --- a/include/crossplatform_shared_ptr.h +++ b/include/crossplatform_shared_ptr.h @@ -6,8 +6,8 @@ // Based on the platform and compiler, include the necessary header to give access to std::tr1::shared_ptr directly as shared_ptr #if defined(__ISLINUX__) -#include -using namespace std::tr1; +#include +using std::shared_ptr; #elif defined(__ISAPPLE__) #include using namespace std::tr1; diff --git a/src/Backends/Helmholtz/FlashRoutines.cpp b/src/Backends/Helmholtz/FlashRoutines.cpp index 8908da52..8f1368b3 100644 --- a/src/Backends/Helmholtz/FlashRoutines.cpp +++ b/src/Backends/Helmholtz/FlashRoutines.cpp @@ -183,7 +183,7 @@ void FlashRoutines::PHSU_D_flash(HelmholtzEOSMixtureBackend &HEOS, int other) { CoolPropFluid * component = HEOS.components[0]; - std::tr1::shared_ptr Sat; + shared_ptr Sat; long double rhoLtriple = component->pEOS->rhoLtriple; long double rhoVtriple = component->pEOS->rhoVtriple; // Check if in the "normal" region diff --git a/src/Backends/Helmholtz/HelmholtzEOSMixtureBackend.cpp b/src/Backends/Helmholtz/HelmholtzEOSMixtureBackend.cpp index e28acdf4..fb25262c 100644 --- a/src/Backends/Helmholtz/HelmholtzEOSMixtureBackend.cpp +++ b/src/Backends/Helmholtz/HelmholtzEOSMixtureBackend.cpp @@ -203,7 +203,7 @@ long double HelmholtzEOSMixtureBackend::calc_viscosity(void) std::string fluid_name = component.transport.viscosity_ecs.reference_fluid; std::vector names(1, fluid_name); // Get a managed pointer to the reference fluid for ECS - std::tr1::shared_ptr ref_fluid(new HelmholtzEOSMixtureBackend(names)); + shared_ptr ref_fluid(new HelmholtzEOSMixtureBackend(names)); // Get the viscosity using ECS return TransportRoutines::viscosity_ECS(*this, *(ref_fluid.get())); } @@ -267,7 +267,7 @@ long double HelmholtzEOSMixtureBackend::calc_conductivity(void) std::string fluid_name = component.transport.conductivity_ecs.reference_fluid; std::vector name(1, fluid_name); // Get a managed pointer to the reference fluid for ECS - std::tr1::shared_ptr ref_fluid(new HelmholtzEOSMixtureBackend(name,false)); + shared_ptr ref_fluid(new HelmholtzEOSMixtureBackend(name,false)); // Get the viscosity using ECS return TransportRoutines::conductivity_ECS(*this, *(ref_fluid.get())); } diff --git a/src/Backends/Helmholtz/HelmholtzEOSMixtureBackend.h b/src/Backends/Helmholtz/HelmholtzEOSMixtureBackend.h index 5a47040e..19f43abb 100644 --- a/src/Backends/Helmholtz/HelmholtzEOSMixtureBackend.h +++ b/src/Backends/Helmholtz/HelmholtzEOSMixtureBackend.h @@ -46,7 +46,7 @@ public: std::vector &get_K(){return K;}; std::vector &get_lnK(){return lnK;}; - std::tr1::shared_ptr SatL, SatV; ///< + shared_ptr SatL, SatV; ///< void update(long input_pair, double value1, double value2); diff --git a/src/Backends/Helmholtz/VLERoutines.cpp b/src/Backends/Helmholtz/VLERoutines.cpp index 73884051..d11ac28a 100644 --- a/src/Backends/Helmholtz/VLERoutines.cpp +++ b/src/Backends/Helmholtz/VLERoutines.cpp @@ -21,8 +21,8 @@ void SaturationSolvers::saturation_PHSU_pure(HelmholtzEOSMixtureBackend *HEOS, l HEOS->calc_reducing_state(); const SimpleState & reduce = HEOS->get_reducing(); - std::tr1::shared_ptr SatL = HEOS->SatL, - SatV = HEOS->SatV; + shared_ptr SatL = HEOS->SatL, + SatV = HEOS->SatV; const std::vector & mole_fractions = HEOS->get_mole_fractions(); const long double R_u = HEOS->gas_constant(); @@ -213,8 +213,8 @@ void SaturationSolvers::saturation_D_pure(HelmholtzEOSMixtureBackend *HEOS, long HEOS->calc_reducing_state(); const SimpleState & reduce = HEOS->get_reducing(); - std::tr1::shared_ptr SatL = HEOS->SatL, - SatV = HEOS->SatV; + shared_ptr SatL = HEOS->SatL, + SatV = HEOS->SatV; const std::vector & mole_fractions = HEOS->get_mole_fractions(); long double T, rhoL,rhoV; @@ -379,8 +379,8 @@ void SaturationSolvers::saturation_T_pure_Akasaka(HelmholtzEOSMixtureBackend *HE HEOS->calc_reducing_state(); const SimpleState & reduce = HEOS->get_reducing(); long double R_u = HEOS->calc_gas_constant(); - std::tr1::shared_ptr SatL = HEOS->SatL, - SatV = HEOS->SatV; + shared_ptr SatL = HEOS->SatL, + SatV = HEOS->SatV; long double rhoL,rhoV,JL,JV,KL,KV,dJL,dJV,dKL,dKV; long double DELTA, deltaL=0, deltaV=0, tau=0, error, PL, PV, stepL, stepV; @@ -511,8 +511,8 @@ long double SaturationSolvers::successive_substitution(HelmholtzEOSMixtureBacken ln_phi_liq.resize(N); ln_phi_vap.resize(N); x.resize(N); y.resize(N); x_and_y_from_K(beta, K, z, x, y); - std::tr1::shared_ptr SatL(new HelmholtzEOSMixtureBackend(HEOS->get_components())), - SatV(new HelmholtzEOSMixtureBackend(HEOS->get_components())); + shared_ptr SatL(new HelmholtzEOSMixtureBackend(HEOS->get_components())), + SatV(new HelmholtzEOSMixtureBackend(HEOS->get_components())); SatL->specify_phase(iphase_liquid); SatV->specify_phase(iphase_gas); @@ -621,8 +621,8 @@ void SaturationSolvers::newton_raphson_VLE_GV::check_Jacobian(HelmholtzEOSMixtur std::size_t N = K.size(); resize(N); - std::tr1::shared_ptr SatL(new HelmholtzEOSMixtureBackend(HEOS->get_components())), - SatV(new HelmholtzEOSMixtureBackend(HEOS->get_components())); + shared_ptr SatL(new HelmholtzEOSMixtureBackend(HEOS->get_components())), + SatV(new HelmholtzEOSMixtureBackend(HEOS->get_components())); SatL->specify_phase(iphase_liquid); SatV->specify_phase(iphase_gas); @@ -689,8 +689,8 @@ void SaturationSolvers::newton_raphson_VLE_GV::call(HelmholtzEOSMixtureBackend * pre_call(); resize(K.size()); - std::tr1::shared_ptr SatL(new HelmholtzEOSMixtureBackend(HEOS->get_components())), - SatV(new HelmholtzEOSMixtureBackend(HEOS->get_components())); + shared_ptr SatL(new HelmholtzEOSMixtureBackend(HEOS->get_components())), + SatV(new HelmholtzEOSMixtureBackend(HEOS->get_components())); SatL->specify_phase(iphase_liquid); // So it will always just use single-phase solution SatV->specify_phase(iphase_gas); // So it will always just use single-phase solution diff --git a/src/CoolProp.cpp b/src/CoolProp.cpp index 98e830ce..85b9c48a 100644 --- a/src/CoolProp.cpp +++ b/src/CoolProp.cpp @@ -302,7 +302,7 @@ double _PropsSI(const std::string &Output, const std::string &Name1, double Prop long iName2 = get_parameter_index(Name2); // The state we are going to use - std::tr1::shared_ptr State; + shared_ptr State; try { // We are going to let the factory function determine which backend to use @@ -310,8 +310,6 @@ double _PropsSI(const std::string &Output, const std::string &Name1, double Prop // Generate the State class pointer using the factory function with unknown backend State.reset(AbstractState::factory(unknown_backend, Ref)); - if (State == NULL){ throw ValueError("unable to instantiate AbstractState*");} - if (State->using_mole_fractions()){ State->set_mole_fractions(z); } @@ -641,7 +639,7 @@ double Props1SI(std::string FluidName,std::string Output) // void set_reference_stateS(std::string Ref, std::string reference_state) { - std::tr1::shared_ptr HEOS; + shared_ptr HEOS; std::vector _comps(1, Ref); HEOS.reset(new CoolProp::HelmholtzEOSMixtureBackend(_comps)); @@ -758,7 +756,7 @@ std::string get_fluid_param_string(std::string FluidName, std::string ParamName) { try{ std::vector comps(1,FluidName); - std::tr1::shared_ptr HEOS(new CoolProp::HelmholtzEOSMixtureBackend(comps)); + shared_ptr HEOS(new CoolProp::HelmholtzEOSMixtureBackend(comps)); CoolProp::CoolPropFluid *fluid = HEOS->get_components()[0]; diff --git a/src/HumidAirProp.cpp b/src/HumidAirProp.cpp index 388bf5b5..b5ac3ac0 100644 --- a/src/HumidAirProp.cpp +++ b/src/HumidAirProp.cpp @@ -20,7 +20,7 @@ #include -std::tr1::shared_ptr Water, Air; +shared_ptr Water, Air; namespace HumidAir { diff --git a/src/SpeedTest.cpp b/src/SpeedTest.cpp index 92ff3408..06994f61 100644 --- a/src/SpeedTest.cpp +++ b/src/SpeedTest.cpp @@ -13,7 +13,7 @@ void compare_REFPROP_and_CoolProp(std::string fluid, int inputs, double val1, do time_t t1,t2; double dx = 1/((double)N); - std::tr1::shared_ptr State(AbstractState::factory("HEOS", fluid)); + shared_ptr State(AbstractState::factory("HEOS", fluid)); t1 = clock(); for (std::size_t ii = 0; ii < N; ++ii) { diff --git a/wrappers/Javascript/build.py b/wrappers/Javascript/build.py index 04250092..c9a54aa1 100644 --- a/wrappers/Javascript/build.py +++ b/wrappers/Javascript/build.py @@ -3,7 +3,7 @@ import subprocess, os, sys import glob2 as glob exports = ['-s','EXPORTED_FUNCTIONS=\"[\'_main\',\'_F2K\',\'_PropsSI\',\'_get_global_param_string\']\"'] -optimization = '-D__ISLINUX__ -O2 -s DISABLE_EXCEPTION_CATCHING=0' +optimization = '-O2 -s DISABLE_EXCEPTION_CATCHING=0' def compile_sources(): for f in glob.glob(os.path.join('..','..','src','**','*.cpp')):