diff --git a/src/thermophysicalModels/reactionThermo/chemistryReaders/chemistryReader/chemistryReader.H b/src/thermophysicalModels/reactionThermo/chemistryReaders/chemistryReader/chemistryReader.H index 2701cc5d37..ffb11288e9 100644 --- a/src/thermophysicalModels/reactionThermo/chemistryReaders/chemistryReader/chemistryReader.H +++ b/src/thermophysicalModels/reactionThermo/chemistryReaders/chemistryReader/chemistryReader.H @@ -108,7 +108,7 @@ public: virtual const HashPtrTable& speciesThermo() const = 0; - virtual const PtrList >& reactions() const = 0; + virtual const ReactionList& reactions() const = 0; }; diff --git a/src/thermophysicalModels/reactionThermo/chemistryReaders/chemkinReader/chemkinReader.C b/src/thermophysicalModels/reactionThermo/chemistryReaders/chemkinReader/chemkinReader.C index 5b5a516e39..f1676d5bd3 100644 --- a/src/thermophysicalModels/reactionThermo/chemistryReaders/chemkinReader/chemkinReader.C +++ b/src/thermophysicalModels/reactionThermo/chemistryReaders/chemkinReader/chemkinReader.C @@ -858,7 +858,8 @@ Foam::chemkinReader::chemkinReader : lineNo_(1), specieNames_(10), - speciesTable_() + speciesTable_(), + reactions_(speciesTable_, speciesThermo_) { read(CHEMKINFileName, thermoFileName); } @@ -868,7 +869,8 @@ Foam::chemkinReader::chemkinReader(const dictionary& thermoDict) : lineNo_(1), specieNames_(10), - speciesTable_() + speciesTable_(), + reactions_(speciesTable_, speciesThermo_) { fileName chemkinFile ( diff --git a/src/thermophysicalModels/reactionThermo/chemistryReaders/chemkinReader/chemkinReader.H b/src/thermophysicalModels/reactionThermo/chemistryReaders/chemkinReader/chemkinReader.H index bbdf0ac53a..a4a89e6a8e 100644 --- a/src/thermophysicalModels/reactionThermo/chemistryReaders/chemkinReader/chemkinReader.H +++ b/src/thermophysicalModels/reactionThermo/chemistryReaders/chemkinReader/chemkinReader.H @@ -205,7 +205,7 @@ private: HashTable > specieComposition_; //- List of the reactions - SLPtrList > reactions_; + ReactionList reactions_; // Private Member Functions @@ -375,10 +375,9 @@ public: } //- List of the reactions - const PtrList >& reactions() const + const ReactionList& reactions() const { - return PtrList >(reactions_); -// return reactions_; + return reactions_; } }; diff --git a/src/thermophysicalModels/reactionThermo/chemistryReaders/foamChemistryReader/foamChemistryReader.H b/src/thermophysicalModels/reactionThermo/chemistryReaders/foamChemistryReader/foamChemistryReader.H index d03434ee74..8e9913844a 100644 --- a/src/thermophysicalModels/reactionThermo/chemistryReaders/foamChemistryReader/foamChemistryReader.H +++ b/src/thermophysicalModels/reactionThermo/chemistryReaders/foamChemistryReader/foamChemistryReader.H @@ -117,9 +117,9 @@ public: } //- List of the reactions - const PtrList >& reactions() const + const ReactionList& reactions() const { - return reactions_.reactions(); + return reactions_; } }; diff --git a/src/thermophysicalModels/specie/reaction/Reactions/ReactionList/ReactionList.C b/src/thermophysicalModels/specie/reaction/Reactions/ReactionList/ReactionList.C index b579d321d9..7741403747 100644 --- a/src/thermophysicalModels/specie/reaction/Reactions/ReactionList/ReactionList.C +++ b/src/thermophysicalModels/specie/reaction/Reactions/ReactionList/ReactionList.C @@ -36,7 +36,7 @@ Foam::ReactionList::ReactionList const HashPtrTable& thermoDb ) : - PtrList >(), + SLPtrList >(), species_(species), thermoDb_(thermoDb), dict_(dictionary::null) @@ -51,7 +51,7 @@ Foam::ReactionList::ReactionList const dictionary& dict ) : - PtrList >(), + SLPtrList >(), species_(species), thermoDb_(thermoDb), dict_(dict) @@ -68,7 +68,7 @@ Foam::ReactionList::ReactionList const fileName& fName ) : - PtrList > + SLPtrList > ( dictionary(IFstream(fName)()).lookup("reactions"), Reaction::iNew(species, thermoDb) @@ -82,7 +82,7 @@ Foam::ReactionList::ReactionList template Foam::ReactionList::ReactionList(const ReactionList& reactions) : - PtrList >(reactions), + SLPtrList >(reactions), species_(reactions.species_), thermoDb_(reactions.thermoDb_), dict_(reactions.dict_) @@ -102,35 +102,22 @@ template bool Foam::ReactionList::readReactionDict() { const dictionary& reactions(dict_.subDict("reactions")); - PtrList > newPtrs(reactions.size()); - label i = 0; forAllConstIter(dictionary, reactions, iter) { - newPtrs.set + this->append ( - i++, Reaction::New ( species_, thermoDb_, reactions.subDict(iter().keyword()) - ) + ).ptr() ); } - PtrList >::transfer(newPtrs); - return true; } -template -const Foam::PtrList >& -Foam::ReactionList::reactions() const -{ - return *this; -} - - // ************************************************************************* // diff --git a/src/thermophysicalModels/specie/reaction/Reactions/ReactionList/ReactionList.H b/src/thermophysicalModels/specie/reaction/Reactions/ReactionList/ReactionList.H index 233855d5f5..1ea93846ea 100644 --- a/src/thermophysicalModels/specie/reaction/Reactions/ReactionList/ReactionList.H +++ b/src/thermophysicalModels/specie/reaction/Reactions/ReactionList/ReactionList.H @@ -54,7 +54,7 @@ namespace Foam template class ReactionList : - private PtrList > + public SLPtrList > { // Private data @@ -113,9 +113,6 @@ public: //- Read reactions from dictionary bool readReactionDict(); - - //- Return the list of reactions - const PtrList >& reactions() const; }; // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //