Removed unnecessary casts from object duplication functions

This commit is contained in:
Ray Speth 2012-10-24 15:45:33 +00:00
parent 3cd3bbef8f
commit 94d08f1d5e
71 changed files with 76 additions and 148 deletions

View file

@ -59,7 +59,7 @@ public:
virtual Kinetics* duplMyselfAsKinetics(const std::vector<thermo_t*> & tpVector) const {
EdgeKinetics* iK = new EdgeKinetics(*this);
iK->assignShallowPointers(tpVector);
return dynamic_cast<Kinetics*>(iK);
return iK;
}
/**

View file

@ -271,8 +271,7 @@ template<class T1, class T2>
SpeciesThermo*
SpeciesThermoDuo<T1, T2>::duplMyselfAsSpeciesThermo() const
{
SpeciesThermoDuo<T1,T2> *nt = new SpeciesThermoDuo<T1,T2>(*this);
return (SpeciesThermo*) nt;
return new SpeciesThermoDuo<T1,T2>(*this);
}
template<class T1, class T2>

View file

@ -147,8 +147,7 @@ VCS_SPECIES_THERMO::operator=(const VCS_SPECIES_THERMO& b)
VCS_SPECIES_THERMO* VCS_SPECIES_THERMO::duplMyselfAsVCS_SPECIES_THERMO()
{
VCS_SPECIES_THERMO* ptr = new VCS_SPECIES_THERMO(*this);
return ptr;
return new VCS_SPECIES_THERMO(*this);
}

View file

@ -105,7 +105,7 @@ Kinetics* AqueousKinetics::duplMyselfAsKinetics(const std::vector<thermo_t*> & t
{
AqueousKinetics* gK = new AqueousKinetics(*this);
gK->assignShallowPointers(tpVector);
return dynamic_cast<Kinetics*>(gK);
return gK;
}
//====================================================================================================================

View file

@ -141,7 +141,7 @@ Kinetics* GasKinetics::duplMyselfAsKinetics(const std::vector<thermo_t*> & tpVec
{
GasKinetics* gK = new GasKinetics(*this);
gK->assignShallowPointers(tpVector);
return dynamic_cast<Kinetics*>(gK);
return gK;
}
//====================================================================================================================
/**

View file

@ -202,7 +202,7 @@ Kinetics* InterfaceKinetics::duplMyselfAsKinetics(const std::vector<thermo_t*> &
{
InterfaceKinetics* iK = new InterfaceKinetics(*this);
iK->assignShallowPointers(tpVector);
return dynamic_cast<Kinetics*>(iK);
return iK;
}
//====================================================================================================================
// Set the electric potential in the nth phase

View file

@ -498,8 +498,7 @@ size_t BandMatrix::checkColumns(doublereal& valueSmall) const
//====================================================================================================================
GeneralMatrix* BandMatrix::duplMyselfAsGeneralMatrix() const
{
BandMatrix* dd = new BandMatrix(*this);
return static_cast<GeneralMatrix*>(dd);
return new BandMatrix(*this);
}
//====================================================================================================================
bool BandMatrix::factored() const

View file

@ -66,8 +66,7 @@ ResidJacEval& ResidJacEval::operator=(const ResidJacEval& right)
*/
ResidJacEval* ResidJacEval::duplMyselfAsResidJacEval() const
{
ResidJacEval* ff = new ResidJacEval(*this);
return ff;
return new ResidJacEval(*this);
}
//====================================================================================================================
int ResidJacEval::nEquations() const

View file

@ -402,8 +402,7 @@ size_t SquareMatrix::nRowsAndStruct(size_t* const iStruct) const
//=====================================================================================================================
GeneralMatrix* SquareMatrix::duplMyselfAsGeneralMatrix() const
{
SquareMatrix* dd = new SquareMatrix(*this);
return static_cast<GeneralMatrix*>(dd);
return new SquareMatrix(*this);
}
//=====================================================================================================================
// Return an iterator pointing to the first element

View file

@ -77,8 +77,7 @@ ConstCpPoly::~ConstCpPoly() {}
SpeciesThermoInterpType*
ConstCpPoly::duplMyselfAsSpeciesThermoInterpType() const
{
ConstCpPoly* newCCP = new ConstCpPoly(*this);
return (SpeciesThermoInterpType*) newCCP;
return new ConstCpPoly(*this);
}
doublereal ConstCpPoly::minTemp() const

View file

@ -211,8 +211,7 @@ DebyeHuckel::~DebyeHuckel()
*/
ThermoPhase* DebyeHuckel::duplMyselfAsThermoPhase() const
{
DebyeHuckel* mtp = new DebyeHuckel(*this);
return (ThermoPhase*) mtp;
return new DebyeHuckel(*this);
}
/*

View file

@ -190,8 +190,7 @@ FixedChemPotSSTP::~FixedChemPotSSTP()
*/
ThermoPhase* FixedChemPotSSTP::duplMyselfAsThermoPhase() const
{
FixedChemPotSSTP* stp = new FixedChemPotSSTP(*this);
return (ThermoPhase*) stp;
return new FixedChemPotSSTP(*this);
}
//====================================================================================================================

View file

@ -92,8 +92,7 @@ GeneralSpeciesThermo::~GeneralSpeciesThermo()
SpeciesThermo*
GeneralSpeciesThermo::duplMyselfAsSpeciesThermo() const
{
GeneralSpeciesThermo* gsth = new GeneralSpeciesThermo(*this);
return (SpeciesThermo*) gsth;
return new GeneralSpeciesThermo(*this);
}

View file

@ -108,8 +108,7 @@ GibbsExcessVPSSTP::~GibbsExcessVPSSTP()
ThermoPhase*
GibbsExcessVPSSTP::duplMyselfAsThermoPhase() const
{
GibbsExcessVPSSTP* mtp = new GibbsExcessVPSSTP(*this);
return (ThermoPhase*) mtp;
return new GibbsExcessVPSSTP(*this);
}
/*

View file

@ -595,8 +595,7 @@ HMWSoln::~HMWSoln()
*/
ThermoPhase* HMWSoln::duplMyselfAsThermoPhase() const
{
HMWSoln* mtp = new HMWSoln(*this);
return (ThermoPhase*) mtp;
return new HMWSoln(*this);
}
/*

View file

@ -80,8 +80,7 @@ operator=(const IdealGasPhase& right)
*/
ThermoPhase* IdealGasPhase::duplMyselfAsThermoPhase() const
{
ThermoPhase* igp = new IdealGasPhase(*this);
return (ThermoPhase*) igp;
return new IdealGasPhase(*this);
}
// Molar Thermodynamic Properties of the Solution ------------------

View file

@ -167,8 +167,7 @@ IdealMolalSoln::~IdealMolalSoln()
*/
ThermoPhase* IdealMolalSoln::duplMyselfAsThermoPhase() const
{
IdealMolalSoln* mtp = new IdealMolalSoln(*this);
return (ThermoPhase*) mtp;
return new IdealMolalSoln(*this);
}
//

View file

@ -119,8 +119,7 @@ operator=(const IdealSolidSolnPhase& b)
*/
ThermoPhase* IdealSolidSolnPhase::duplMyselfAsThermoPhase() const
{
IdealSolidSolnPhase* ii = new IdealSolidSolnPhase(*this);
return (ThermoPhase*) ii;
return new IdealSolidSolnPhase(*this);
}
//====================================================================================================================
/**

View file

@ -107,8 +107,7 @@ IdealSolnGasVPSS::~IdealSolnGasVPSS()
*/
ThermoPhase* IdealSolnGasVPSS::duplMyselfAsThermoPhase() const
{
IdealSolnGasVPSS* vptp = new IdealSolnGasVPSS(*this);
return (ThermoPhase*) vptp;
return new IdealSolnGasVPSS(*this);
}
int IdealSolnGasVPSS::eosType() const

View file

@ -237,8 +237,7 @@ IonsFromNeutralVPSSTP::~IonsFromNeutralVPSSTP()
ThermoPhase*
IonsFromNeutralVPSSTP::duplMyselfAsThermoPhase() const
{
IonsFromNeutralVPSSTP* mtp = new IonsFromNeutralVPSSTP(*this);
return (ThermoPhase*) mtp;
return new IonsFromNeutralVPSSTP(*this);
}
/*

View file

@ -113,8 +113,7 @@ LatticePhase::LatticePhase(XML_Node& phaseRef, const std::string& id)
*/
ThermoPhase* LatticePhase::duplMyselfAsThermoPhase() const
{
LatticePhase* igp = new LatticePhase(*this);
return (ThermoPhase*) igp;
return new LatticePhase(*this);
}
doublereal LatticePhase::enthalpy_mole() const

View file

@ -97,8 +97,7 @@ LatticeSolidPhase::~LatticeSolidPhase()
*/
ThermoPhase* LatticeSolidPhase::duplMyselfAsThermoPhase() const
{
LatticeSolidPhase* igp = new LatticeSolidPhase(*this);
return (ThermoPhase*) igp;
return new LatticeSolidPhase(*this);
}
//====================================================================================================================

View file

@ -130,8 +130,7 @@ MargulesVPSSTP::~MargulesVPSSTP()
ThermoPhase*
MargulesVPSSTP::duplMyselfAsThermoPhase() const
{
MargulesVPSSTP* mtp = new MargulesVPSSTP(*this);
return (ThermoPhase*) mtp;
return new MargulesVPSSTP(*this);
}
// Special constructor for a hard-coded problem

View file

@ -147,8 +147,7 @@ MetalSHEelectrons::operator=(const MetalSHEelectrons& right)
*/
ThermoPhase* MetalSHEelectrons::duplMyselfAsThermoPhase() const
{
MetalSHEelectrons* stp = new MetalSHEelectrons(*this);
return (ThermoPhase*) stp;
return new MetalSHEelectrons(*this);
}
//====================================================================================================================

View file

@ -143,8 +143,7 @@ MineralEQ3::~MineralEQ3()
*/
ThermoPhase* MineralEQ3::duplMyselfAsThermoPhase() const
{
MineralEQ3* stp = new MineralEQ3(*this);
return (ThermoPhase*) stp;
return new MineralEQ3(*this);
}

View file

@ -133,8 +133,7 @@ MixedSolventElectrolyte::~MixedSolventElectrolyte()
ThermoPhase*
MixedSolventElectrolyte::duplMyselfAsThermoPhase() const
{
MixedSolventElectrolyte* mtp = new MixedSolventElectrolyte(*this);
return (ThermoPhase*) mtp;
return new MixedSolventElectrolyte(*this);
}
// Special constructor for a hard-coded problem

View file

@ -130,8 +130,7 @@ MixtureFugacityTP::~MixtureFugacityTP()
*/
ThermoPhase* MixtureFugacityTP::duplMyselfAsThermoPhase() const
{
MixtureFugacityTP* vptp = new MixtureFugacityTP(*this);
return (ThermoPhase*) vptp;
return new MixtureFugacityTP(*this);
}
//====================================================================================================================
// This method returns the convention used in specification

View file

@ -113,8 +113,7 @@ MolalityVPSSTP::~MolalityVPSSTP()
ThermoPhase*
MolalityVPSSTP::duplMyselfAsThermoPhase() const
{
MolalityVPSSTP* mtp = new MolalityVPSSTP(*this);
return (ThermoPhase*) mtp;
return new MolalityVPSSTP(*this);
}
/*

View file

@ -147,8 +147,7 @@ MolarityIonicVPSSTP::~MolarityIonicVPSSTP()
ThermoPhase*
MolarityIonicVPSSTP::duplMyselfAsThermoPhase() const
{
MolarityIonicVPSSTP* mtp = new MolarityIonicVPSSTP(*this);
return (ThermoPhase*) mtp;
return new MolarityIonicVPSSTP(*this);
}
/*

View file

@ -104,8 +104,7 @@ Mu0Poly::~Mu0Poly()
SpeciesThermoInterpType*
Mu0Poly::duplMyselfAsSpeciesThermoInterpType() const
{
Mu0Poly* mp = new Mu0Poly(*this);
return (SpeciesThermoInterpType*) mp;
return new Mu0Poly(*this);
}
doublereal Mu0Poly::minTemp() const

View file

@ -131,8 +131,7 @@ Nasa9Poly1::~Nasa9Poly1()
SpeciesThermoInterpType*
Nasa9Poly1::duplMyselfAsSpeciesThermoInterpType() const
{
Nasa9Poly1* np = new Nasa9Poly1(*this);
return (SpeciesThermoInterpType*) np;
return new Nasa9Poly1(*this);
}
// Returns the minimum temperature that the thermo

View file

@ -192,8 +192,7 @@ Nasa9PolyMultiTempRegion::~Nasa9PolyMultiTempRegion()
SpeciesThermoInterpType*
Nasa9PolyMultiTempRegion::duplMyselfAsSpeciesThermoInterpType() const
{
Nasa9PolyMultiTempRegion* np = new Nasa9PolyMultiTempRegion(*this);
return (SpeciesThermoInterpType*) np;
return new Nasa9PolyMultiTempRegion(*this);
}
// Returns the minimum temperature that the thermo

View file

@ -183,8 +183,7 @@ PDSS::~PDSS()
*/
PDSS* PDSS::duplMyselfAsPDSS() const
{
PDSS* ip = new PDSS(*this);
return ip;
return new PDSS(*this);
}
// Returns the type of the standard state parameterization

View file

@ -82,8 +82,7 @@ PDSS_ConstVol::~PDSS_ConstVol()
// Duplicator
PDSS* PDSS_ConstVol::duplMyselfAsPDSS() const
{
PDSS_ConstVol* idg = new PDSS_ConstVol(*this);
return (PDSS*) idg;
return new PDSS_ConstVol(*this);
}
/*

View file

@ -213,8 +213,7 @@ PDSS_HKFT::~PDSS_HKFT()
// Duplicator
PDSS* PDSS_HKFT::duplMyselfAsPDSS() const
{
PDSS_HKFT* idg = new PDSS_HKFT(*this);
return (PDSS*) idg;
return new PDSS_HKFT(*this);
}
/*

View file

@ -90,8 +90,7 @@ PDSS_IdealGas::~PDSS_IdealGas()
// Duplicator
PDSS* PDSS_IdealGas::duplMyselfAsPDSS() const
{
PDSS_IdealGas* idg = new PDSS_IdealGas(*this);
return (PDSS*) idg;
return new PDSS_IdealGas(*this);
}

View file

@ -114,8 +114,7 @@ PDSS_IonsFromNeutral::~PDSS_IonsFromNeutral()
//! Duplicator
PDSS* PDSS_IonsFromNeutral::duplMyselfAsPDSS() const
{
PDSS_IonsFromNeutral* idg = new PDSS_IonsFromNeutral(*this);
return (PDSS*) idg;
return new PDSS_IonsFromNeutral(*this);
}
//====================================================================================================================
void PDSS_IonsFromNeutral::initAllPtrs(VPStandardStateTP* tp, VPSSMgr* vpssmgr_ptr,

View file

@ -96,8 +96,7 @@ PDSS_SSVol::~PDSS_SSVol()
//! Duplicator
PDSS* PDSS_SSVol::duplMyselfAsPDSS() const
{
PDSS_SSVol* idg = new PDSS_SSVol(*this);
return (PDSS*) idg;
return new PDSS_SSVol(*this);
}
/*

View file

@ -175,8 +175,7 @@ PDSS_Water::~PDSS_Water()
PDSS* PDSS_Water::duplMyselfAsPDSS() const
{
PDSS_Water* kPDSS = new PDSS_Water(*this);
return (PDSS*) kPDSS;
return new PDSS_Water(*this);
}
/*

View file

@ -143,8 +143,7 @@ PhaseCombo_Interaction::~PhaseCombo_Interaction()
ThermoPhase*
PhaseCombo_Interaction::duplMyselfAsThermoPhase() const
{
PhaseCombo_Interaction* mtp = new PhaseCombo_Interaction(*this);
return (ThermoPhase*) mtp;
return new PhaseCombo_Interaction(*this);
}
//====================================================================================================================
// Special constructor for a hard-coded problem

View file

@ -115,8 +115,7 @@ PseudoBinaryVPSSTP::~PseudoBinaryVPSSTP()
ThermoPhase*
PseudoBinaryVPSSTP::duplMyselfAsThermoPhase() const
{
PseudoBinaryVPSSTP* mtp = new PseudoBinaryVPSSTP(*this);
return (ThermoPhase*) mtp;
return new PseudoBinaryVPSSTP(*this);
}
/*

View file

@ -72,8 +72,7 @@ PureFluidPhase& PureFluidPhase::operator=(const PureFluidPhase& right)
*/
ThermoPhase* PureFluidPhase::duplMyselfAsThermoPhase() const
{
PureFluidPhase* igp = new PureFluidPhase(*this);
return (ThermoPhase*) igp;
return new PureFluidPhase(*this);
}

View file

@ -208,8 +208,7 @@ RedlichKisterVPSSTP::~RedlichKisterVPSSTP()
ThermoPhase*
RedlichKisterVPSSTP::duplMyselfAsThermoPhase() const
{
RedlichKisterVPSSTP* mtp = new RedlichKisterVPSSTP(*this);
return (ThermoPhase*) mtp;
return new RedlichKisterVPSSTP(*this);
}
//====================================================================================================================

View file

@ -252,8 +252,7 @@ RedlichKwongMFTP::~RedlichKwongMFTP()
*/
ThermoPhase* RedlichKwongMFTP::duplMyselfAsThermoPhase() const
{
RedlichKwongMFTP* vptp = new RedlichKwongMFTP(*this);
return (ThermoPhase*) vptp;
return new RedlichKwongMFTP(*this);
}
//====================================================================================================================
int RedlichKwongMFTP::eosType() const

View file

@ -92,8 +92,7 @@ SingleSpeciesTP::~SingleSpeciesTP()
*/
ThermoPhase* SingleSpeciesTP::duplMyselfAsThermoPhase() const
{
SingleSpeciesTP* stp = new SingleSpeciesTP(*this);
return (ThermoPhase*) stp;
return new SingleSpeciesTP(*this);
}
/**

View file

@ -75,8 +75,7 @@ STITbyPDSS::~STITbyPDSS()
SpeciesThermoInterpType*
STITbyPDSS::duplMyselfAsSpeciesThermoInterpType() const
{
STITbyPDSS* np = new STITbyPDSS(*this);
return (SpeciesThermoInterpType*) np;
return new STITbyPDSS(*this);
}

View file

@ -87,8 +87,7 @@ StatMech::~StatMech()
SpeciesThermoInterpType*
StatMech::duplMyselfAsSpeciesThermoInterpType() const
{
StatMech* np = new StatMech(*this);
return (SpeciesThermoInterpType*) np;
return new StatMech(*this);
}
// Returns the minimum temperature that the thermo

View file

@ -81,8 +81,7 @@ operator=(const StoichSubstance& right)
*/
ThermoPhase* StoichSubstance::duplMyselfAsThermoPhase() const
{
ThermoPhase* igp = new StoichSubstance(*this);
return (ThermoPhase*) igp;
return new StoichSubstance(*this);
}
// Destructor

View file

@ -129,8 +129,7 @@ StoichSubstanceSSTP::~StoichSubstanceSSTP()
*/
ThermoPhase* StoichSubstanceSSTP::duplMyselfAsThermoPhase() const
{
StoichSubstanceSSTP* stp = new StoichSubstanceSSTP(*this);
return (ThermoPhase*) stp;
return new StoichSubstanceSSTP(*this);
}

View file

@ -145,8 +145,7 @@ operator=(const SurfPhase& right)
*/
ThermoPhase* SurfPhase::duplMyselfAsThermoPhase() const
{
SurfPhase* igp = new SurfPhase(*this);
return (ThermoPhase*) igp;
return new SurfPhase(*this);
}
doublereal SurfPhase::
@ -516,8 +515,7 @@ EdgePhase& EdgePhase::operator=(const EdgePhase& right)
*/
ThermoPhase* EdgePhase::duplMyselfAsThermoPhase() const
{
EdgePhase* igp = new EdgePhase(*this);
return (ThermoPhase*) igp;
return new EdgePhase(*this);
}
void EdgePhase::

View file

@ -137,8 +137,7 @@ operator=(const ThermoPhase& right)
*/
ThermoPhase* ThermoPhase::duplMyselfAsThermoPhase() const
{
ThermoPhase* tp = new ThermoPhase(*this);
return tp;
return new ThermoPhase(*this);
}
//====================================================================================================================
int ThermoPhase::activityConvention() const

View file

@ -125,8 +125,7 @@ VPSSMgr::operator=(const VPSSMgr& right)
//====================================================================================================================
VPSSMgr* VPSSMgr::duplMyselfAsVPSSMgr() const
{
VPSSMgr* vp = new VPSSMgr(*this);
return vp;
return new VPSSMgr(*this);
}
//====================================================================================================================
void VPSSMgr::initAllPtrs(VPStandardStateTP* vp_ptr,

View file

@ -55,8 +55,7 @@ VPSSMgr_ConstVol& VPSSMgr_ConstVol::operator=(const VPSSMgr_ConstVol& b)
VPSSMgr* VPSSMgr_ConstVol::duplMyselfAsVPSSMgr() const
{
VPSSMgr_ConstVol* vpm = new VPSSMgr_ConstVol(*this);
return (VPSSMgr*) vpm;
return new VPSSMgr_ConstVol(*this);
}
/*

View file

@ -73,8 +73,7 @@ VPSSMgr_General& VPSSMgr_General::operator=(const VPSSMgr_General& b)
VPSSMgr* VPSSMgr_General::duplMyselfAsVPSSMgr() const
{
VPSSMgr_General* vpm = new VPSSMgr_General(*this);
return (VPSSMgr*) vpm;
return new VPSSMgr_General(*this);
}
//====================================================================================================================
// Initialize the internal shallow pointers in this object

View file

@ -56,8 +56,7 @@ VPSSMgr_IdealGas& VPSSMgr_IdealGas::operator=(const VPSSMgr_IdealGas& b)
VPSSMgr* VPSSMgr_IdealGas::duplMyselfAsVPSSMgr() const
{
VPSSMgr_IdealGas* vpm = new VPSSMgr_IdealGas(*this);
return (VPSSMgr*) vpm;
return new VPSSMgr_IdealGas(*this);
}

View file

@ -60,8 +60,7 @@ VPSSMgr_Water_ConstVol::operator=(const VPSSMgr_Water_ConstVol& b)
VPSSMgr*
VPSSMgr_Water_ConstVol::duplMyselfAsVPSSMgr() const
{
VPSSMgr_Water_ConstVol* vpm = new VPSSMgr_Water_ConstVol(*this);
return (VPSSMgr*) vpm;
return new VPSSMgr_Water_ConstVol(*this);
}
void

View file

@ -66,8 +66,7 @@ VPSSMgr_Water_HKFT::operator=(const VPSSMgr_Water_HKFT& b)
VPSSMgr*
VPSSMgr_Water_HKFT::duplMyselfAsVPSSMgr() const
{
VPSSMgr_Water_HKFT* vpm = new VPSSMgr_Water_HKFT(*this);
return (VPSSMgr*) vpm;
return new VPSSMgr_Water_HKFT(*this);
}
void

View file

@ -144,8 +144,7 @@ VPStandardStateTP::~VPStandardStateTP()
*/
ThermoPhase* VPStandardStateTP::duplMyselfAsThermoPhase() const
{
VPStandardStateTP* vptp = new VPStandardStateTP(*this);
return (ThermoPhase*) vptp;
return new VPStandardStateTP(*this);
}
// This method returns the convention used in specification

View file

@ -113,8 +113,7 @@ WaterSSTP& WaterSSTP::operator=(const WaterSSTP& b)
ThermoPhase* WaterSSTP::duplMyselfAsThermoPhase() const
{
WaterSSTP* wtp = new WaterSSTP(*this);
return (ThermoPhase*) wtp;
return new WaterSSTP(*this);
}
WaterSSTP::~WaterSSTP()

View file

@ -125,8 +125,7 @@ DustyGasTransport::~DustyGasTransport()
*/
Transport* DustyGasTransport::duplMyselfAsTransport() const
{
DustyGasTransport* tr = new DustyGasTransport(*this);
return (dynamic_cast<Transport*>(tr));
return new DustyGasTransport(*this);
}
//====================================================================================================================
// Set the Parameters in the model

View file

@ -103,8 +103,7 @@ LTPspecies& LTPspecies::operator=(const LTPspecies& right)
*/
LTPspecies* LTPspecies::duplMyselfAsLTPspecies() const
{
LTPspecies* prp = new LTPspecies(*this);
return prp;
return new LTPspecies(*this);
}
//====================================================================================================================
LTPspecies::~LTPspecies()
@ -190,8 +189,7 @@ LTPspecies_Const::~LTPspecies_Const()
*/
LTPspecies* LTPspecies_Const::duplMyselfAsLTPspecies() const
{
LTPspecies_Const* prp = new LTPspecies_Const(*this);
return (dynamic_cast<LTPspecies*>(prp));
return new LTPspecies_Const(*this);
}
//====================================================================================================================
// Return the (constant) value for this transport property
@ -266,8 +264,7 @@ LTPspecies_Arrhenius::~LTPspecies_Arrhenius()
*/
LTPspecies* LTPspecies_Arrhenius::duplMyselfAsLTPspecies() const
{
LTPspecies_Arrhenius* prp = new LTPspecies_Arrhenius(*this);
return (dynamic_cast<LTPspecies*>(prp));
return new LTPspecies_Arrhenius(*this);
}
//===================================================================================================================
// Return the pure species value for this transport property evaluated
@ -367,8 +364,7 @@ LTPspecies_Poly::~LTPspecies_Poly()
*/
LTPspecies* LTPspecies_Poly::duplMyselfAsLTPspecies() const
{
LTPspecies_Poly* prp = new LTPspecies_Poly(*this);
return (dynamic_cast<LTPspecies*>(prp));
return new LTPspecies_Poly(*this);
}
//====================================================================================================================
// Return the value for this transport property evaluated from the polynomial expression
@ -440,8 +436,7 @@ LTPspecies_ExpT::~LTPspecies_ExpT()
*/
LTPspecies* LTPspecies_ExpT::duplMyselfAsLTPspecies() const
{
LTPspecies_ExpT* prp = new LTPspecies_ExpT(*this);
return (dynamic_cast<LTPspecies*>(prp));
return new LTPspecies_ExpT(*this);
}
//====================================================================================================================
// Return the value for this transport property evaluated

View file

@ -212,8 +212,7 @@ LiquidTransport& LiquidTransport::operator=(const LiquidTransport& right)
Transport* LiquidTransport::duplMyselfAsTransport() const
{
LiquidTransport* tr = new LiquidTransport(*this);
return (dynamic_cast<Transport*>(tr));
return new LiquidTransport(*this);
}
LiquidTransport::~LiquidTransport()

View file

@ -84,8 +84,7 @@ MixTransport& MixTransport::operator=(const MixTransport& right)
*/
Transport* MixTransport::duplMyselfAsTransport() const
{
MixTransport* tr = new MixTransport(*this);
return (dynamic_cast<Transport*>(tr));
return new MixTransport(*this);
}
//====================================================================================================================

View file

@ -159,8 +159,7 @@ SimpleTransport& SimpleTransport::operator=(const SimpleTransport& right)
//================================================================================================
Transport* SimpleTransport::duplMyselfAsTransport() const
{
SimpleTransport* tr = new SimpleTransport(*this);
return (dynamic_cast<Transport*>(tr));
return new SimpleTransport(*this);
}
//================================================================================================
SimpleTransport::~SimpleTransport()

View file

@ -74,8 +74,7 @@ SolidTransport& SolidTransport::operator=(const SolidTransport& b)
//====================================================================================================================
Transport* SolidTransport::duplMyselfAsTransport() const
{
SolidTransport* tr = new SolidTransport(*this);
return (dynamic_cast<Transport*>(tr));
return new SolidTransport(*this);
}
//====================================================================================================================
void SolidTransport::setParameters(const int n, const int k, const doublereal* const p)

View file

@ -62,8 +62,7 @@ TortuosityBase& TortuosityBase::operator=(const TortuosityBase& right)
*/
TortuosityBase* TortuosityBase::duplMyselfAsTortuosityBase() const
{
TortuosityBase* tb = new TortuosityBase(*this);
return tb;
return new TortuosityBase(*this);
}
//====================================================================================================================
// The tortuosity factor models the effective increase in the diffusive transport length.

View file

@ -66,8 +66,7 @@ TortuosityBruggeman& TortuosityBruggeman::operator=(const TortuosityBruggeman&
*/
TortuosityBase* TortuosityBruggeman::duplMyselfAsTortuosityBase() const
{
TortuosityBruggeman* tb = new TortuosityBruggeman(*this);
return dynamic_cast<TortuosityBase*>(tb);
return new TortuosityBruggeman(*this);
}
//====================================================================================================================
// The tortuosity factor models the effective increase in the diffusive transport length.

View file

@ -66,8 +66,7 @@ TortuosityMaxwell& TortuosityMaxwell::operator=(const TortuosityMaxwell& right
*/
TortuosityBase* TortuosityMaxwell::duplMyselfAsTortuosityBase() const
{
TortuosityMaxwell* tb = new TortuosityMaxwell(*this);
return dynamic_cast<TortuosityBase*>(tb);
return new TortuosityMaxwell(*this);
}
//====================================================================================================================
// The tortuosity factor models the effective increase in the diffusive transport length.

View file

@ -70,8 +70,7 @@ TortuosityPercolation& TortuosityPercolation::operator=(const TortuosityPercolat
*/
TortuosityBase* TortuosityPercolation::duplMyselfAsTortuosityBase() const
{
TortuosityPercolation* tb = new TortuosityPercolation(*this);
return dynamic_cast<TortuosityBase*>(tb);
return new TortuosityPercolation(*this);
}
//====================================================================================================================
// The tortuosity factor models the effective increase in the diffusive transport length.

View file

@ -63,8 +63,7 @@ Transport& Transport::operator=(const Transport& right)
Transport* Transport::duplMyselfAsTransport() const
{
Transport* tr = new Transport(*this);
return tr;
return new Transport(*this);
}

View file

@ -65,8 +65,7 @@ WaterTransport& WaterTransport::operator=(const WaterTransport& right)
*/
Transport* WaterTransport::duplMyselfAsTransport() const
{
WaterTransport* tr = new WaterTransport(*this);
return dynamic_cast<Transport*>(tr);
return new WaterTransport(*this);
}