diff --git a/src/thermophysicalModels/solidMixture/solidMixture/solidMixture.C b/src/thermophysicalModels/solidMixture/solidMixture/solidMixture.C index 1132a9e870a466dbb8b07a9aa93b8e2900867431..bacc517e0e1d1c949d486cf72861a2ed292f2a2d 100644 --- a/src/thermophysicalModels/solidMixture/solidMixture/solidMixture.C +++ b/src/thermophysicalModels/solidMixture/solidMixture/solidMixture.C @@ -54,6 +54,18 @@ Foam::solidMixture::solidMixture } +Foam::solidMixture::solidMixture(const solidMixture& s) +: + components_(s.components_), + properties_(s.properties_.size()) +{ + forAll(properties_, i) + { + properties_.set(i, s.properties_(i)->clone()); + } +} + + // * * * * * * * * * * * * * * * * Selectors * * * * * * * * * * * * * * * * // Foam::autoPtr<Foam::solidMixture> Foam::solidMixture::New diff --git a/src/thermophysicalModels/solidMixture/solidMixture/solidMixture.H b/src/thermophysicalModels/solidMixture/solidMixture/solidMixture.H index f7dc730920fab8350db8e10ef3f9b046106a0fee..17f491e0318af79deb1bfe18ed5fe28be0a693ec 100644 --- a/src/thermophysicalModels/solidMixture/solidMixture/solidMixture.H +++ b/src/thermophysicalModels/solidMixture/solidMixture/solidMixture.H @@ -59,7 +59,6 @@ namespace Foam class solidMixture { - // Private data //- The names of the solids @@ -76,6 +75,20 @@ public: //- Construct from dictionary solidMixture(const dictionary&); + //- Construct copy + solidMixture(const solidMixture& lm); + + //- Construct and return a clone + virtual autoPtr<solidMixture> clone() const + { + return autoPtr<solidMixture>(new solidMixture(*this)); + } + + + //- Destructor + virtual ~solidMixture() + {} + // Selectors diff --git a/src/thermophysicalModels/solids/C/C.C b/src/thermophysicalModels/solids/C/C.C index 85dab6090dd973f8259ac2bb1b9688d8aba90b0e..49d180550f3a01f939b8588fa5db5ef5d24ff7de 100644 --- a/src/thermophysicalModels/solids/C/C.C +++ b/src/thermophysicalModels/solids/C/C.C @@ -69,6 +69,12 @@ Foam::C::C(const dictionary& dict) {} +Foam::C::C(const C& s) +: + solid(s) +{} + + // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // void Foam::C::writeData(Ostream& os) const diff --git a/src/thermophysicalModels/solids/C/C.H b/src/thermophysicalModels/solids/C/C.H index 5dc2e2b350c8fcf110724a49358b235c159c0a38..5b23b2175668a5055bfbb553905d67b10efe4330 100644 --- a/src/thermophysicalModels/solids/C/C.H +++ b/src/thermophysicalModels/solids/C/C.H @@ -46,8 +46,8 @@ class C; Ostream& operator<< ( - Ostream&, - const C& + Ostream&, + const C& ); @@ -79,6 +79,15 @@ public: //- Construct from dictionary C(const dictionary& dict); + //- Construct copy + C(const C& s); + + //- Construct and return clone + virtual autoPtr<solid> clone() const + { + return autoPtr<solid>(new C(*this)); + } + // I-O diff --git a/src/thermophysicalModels/solids/CaCO3/CaCO3.C b/src/thermophysicalModels/solids/CaCO3/CaCO3.C index 3e2008955558c2ccda133ea48317dedd2b8228c9..24917758562044aee4f68943a9f7ee71cb88115c 100644 --- a/src/thermophysicalModels/solids/CaCO3/CaCO3.C +++ b/src/thermophysicalModels/solids/CaCO3/CaCO3.C @@ -69,6 +69,12 @@ Foam::CaCO3::CaCO3(const dictionary& dict) {} +Foam::CaCO3::CaCO3(const CaCO3& s) +: + solid(s) +{} + + // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // void Foam::CaCO3::writeData(Ostream& os) const diff --git a/src/thermophysicalModels/solids/CaCO3/CaCO3.H b/src/thermophysicalModels/solids/CaCO3/CaCO3.H index d5d725d938a9fa94043d5b3b5cd6154b831cb0c5..794ba828a4429b16a9492230b5bc37718ea0b2df 100644 --- a/src/thermophysicalModels/solids/CaCO3/CaCO3.H +++ b/src/thermophysicalModels/solids/CaCO3/CaCO3.H @@ -46,8 +46,8 @@ class CaCO3; Ostream& operator<< ( - Ostream&, - const CaCO3& + Ostream&, + const CaCO3& ); @@ -80,6 +80,15 @@ public: //- Construct from dictionary CaCO3(const dictionary& dict); + //- Construct copy + CaCO3(const CaCO3& s); + + //- Construct and return clone + virtual autoPtr<solid> clone() const + { + return autoPtr<solid>(new CaCO3(*this)); + } + // I-O diff --git a/src/thermophysicalModels/solids/ash/ash.C b/src/thermophysicalModels/solids/ash/ash.C index e75119b8a7ab42d429c13fe8a8e580fa0e8bdb3d..e7f337e60bd40b73628585e72fc71d548f5f368b 100644 --- a/src/thermophysicalModels/solids/ash/ash.C +++ b/src/thermophysicalModels/solids/ash/ash.C @@ -69,6 +69,12 @@ Foam::ash::ash(const dictionary& dict) {} +Foam::ash::ash(const ash& s) +: + solid(s) +{} + + // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // void Foam::ash::writeData(Ostream& os) const diff --git a/src/thermophysicalModels/solids/ash/ash.H b/src/thermophysicalModels/solids/ash/ash.H index 0769ffff830ccb200b3e722d54db06a3aabffbb1..bb39c14c6af21e4286533fe138cbdd1fd11689be 100644 --- a/src/thermophysicalModels/solids/ash/ash.H +++ b/src/thermophysicalModels/solids/ash/ash.H @@ -46,8 +46,8 @@ class ash; Ostream& operator<< ( - Ostream&, - const ash& + Ostream&, + const ash& ); @@ -80,6 +80,15 @@ public: //- Construct from dictionary ash(const dictionary& dict); + //- Construct copy + ash(const ash& s); + + //- Construct and return clone + virtual autoPtr<solid> clone() const + { + return autoPtr<solid>(new ash(*this)); + } + // I-O diff --git a/src/thermophysicalModels/solids/solid/solid.C b/src/thermophysicalModels/solids/solid/solid.C index cda244496221fbda8a1bdc298f81e14e204ebf6d..83b85eb687974e41a10ce7162a6f299096c5caa1 100644 --- a/src/thermophysicalModels/solids/solid/solid.C +++ b/src/thermophysicalModels/solids/solid/solid.C @@ -74,6 +74,16 @@ Foam::solid::solid(const dictionary& dict) {} +Foam::solid::solid(const solid& s) +: + rho_(s.rho_), + Cp_(s.Cp_), + K_(s.K_), + Hf_(s.Hf_), + emissivity_(s.emissivity_) +{} + + // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // void Foam::solid::writeData(Ostream& os) const diff --git a/src/thermophysicalModels/solids/solid/solid.H b/src/thermophysicalModels/solids/solid/solid.H index 1adb26e4d9005448f7895b7d708b25c5a94624fe..83ac6894ae3c8da54bb60e8ef22184ec253035e4 100644 --- a/src/thermophysicalModels/solids/solid/solid.H +++ b/src/thermophysicalModels/solids/solid/solid.H @@ -133,6 +133,18 @@ public: //- Construct from dictionary solid(const dictionary& dict); + //- Construct copy + solid(const solid& s); + + //- Construct and return clone + virtual autoPtr<solid> clone() const + { + return autoPtr<solid>(new solid(*this)); + } + + + // Selectors + //- Return a pointer to a new solid created from input static autoPtr<solid> New(Istream& is);