diff --git a/src/OpenFOAM/containers/HashTables/HashTable/HashTable.C b/src/OpenFOAM/containers/HashTables/HashTable/HashTable.C index 97cb2b321b..676d579bb8 100644 --- a/src/OpenFOAM/containers/HashTables/HashTable/HashTable.C +++ b/src/OpenFOAM/containers/HashTables/HashTable/HashTable.C @@ -83,6 +83,19 @@ HashTable::HashTable(const HashTable& ht) } } +template +HashTable::HashTable(const xfer >& ht) +: + HashTableName(), + tableSize_(0), + table_(NULL), + nElmts_(0), + endIter_(*this, NULL, 0), + endConstIter_(*this, NULL, 0) +{ + transfer(*ht); +} + // * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * // diff --git a/src/OpenFOAM/containers/HashTables/HashTable/HashTable.H b/src/OpenFOAM/containers/HashTables/HashTable/HashTable.H index 2f3913d2e2..701d845615 100644 --- a/src/OpenFOAM/containers/HashTables/HashTable/HashTable.H +++ b/src/OpenFOAM/containers/HashTables/HashTable/HashTable.H @@ -41,6 +41,7 @@ SourceFiles #include "label.H" #include "word.H" #include "className.H" +#include "xfer.H" // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // @@ -155,6 +156,9 @@ public: //- Construct as copy HashTable(const HashTable&); + //- Construct by transferring the parameter contents + HashTable(const xfer >&); + // Destructor diff --git a/src/OpenFOAM/containers/HashTables/StaticHashTable/StaticHashTable.C b/src/OpenFOAM/containers/HashTables/StaticHashTable/StaticHashTable.C index e5e4777814..688abd467d 100644 --- a/src/OpenFOAM/containers/HashTables/StaticHashTable/StaticHashTable.C +++ b/src/OpenFOAM/containers/HashTables/StaticHashTable/StaticHashTable.C @@ -76,6 +76,24 @@ StaticHashTable::StaticHashTable {} + +template +StaticHashTable::StaticHashTable +( + const xfer >& ht +) +: + StaticHashTableName(), + keys_(0), + objects_(0), + nElmts_(0), + endIter_(*this, 0, 0), + endConstIter_(*this, 0, 0) +{ + transfer(*ht); +} + + // * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * // template diff --git a/src/OpenFOAM/containers/HashTables/StaticHashTable/StaticHashTable.H b/src/OpenFOAM/containers/HashTables/StaticHashTable/StaticHashTable.H index 9eadf37b5e..558519d813 100644 --- a/src/OpenFOAM/containers/HashTables/StaticHashTable/StaticHashTable.H +++ b/src/OpenFOAM/containers/HashTables/StaticHashTable/StaticHashTable.H @@ -46,6 +46,7 @@ SourceFiles #include "label.H" #include "word.H" #include "className.H" +#include "xfer.H" // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // @@ -146,6 +147,8 @@ public: //- Construct as copy StaticHashTable(const StaticHashTable&); + //- Construct as copy + StaticHashTable(const xfer >&); // Destructor diff --git a/src/OpenFOAM/meshes/polyMesh/zones/cellZone/cellZone.C b/src/OpenFOAM/meshes/polyMesh/zones/cellZone/cellZone.C index d85cc93936..ab3639362b 100644 --- a/src/OpenFOAM/meshes/polyMesh/zones/cellZone/cellZone.C +++ b/src/OpenFOAM/meshes/polyMesh/zones/cellZone/cellZone.C @@ -114,6 +114,22 @@ Foam::cellZone::cellZone {} +Foam::cellZone::cellZone +( + const word& name, + const xfer& addr, + const label index, + const cellZoneMesh& zm +) +: + labelList(addr), + name_(name), + index_(index), + zoneMesh_(zm), + cellLookupMapPtr_(NULL) +{} + + // Construct from dictionary Foam::cellZone::cellZone ( @@ -148,6 +164,21 @@ Foam::cellZone::cellZone cellLookupMapPtr_(NULL) {} +Foam::cellZone::cellZone +( + const cellZone& cz, + const xfer& addr, + const label index, + const cellZoneMesh& zm +) +: + labelList(addr), + name_(cz.name()), + index_(index), + zoneMesh_(zm), + cellLookupMapPtr_(NULL) +{} + // * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * // diff --git a/src/OpenFOAM/meshes/polyMesh/zones/cellZone/cellZone.H b/src/OpenFOAM/meshes/polyMesh/zones/cellZone/cellZone.H index 799e810e2a..a239992cde 100644 --- a/src/OpenFOAM/meshes/polyMesh/zones/cellZone/cellZone.H +++ b/src/OpenFOAM/meshes/polyMesh/zones/cellZone/cellZone.H @@ -128,26 +128,45 @@ public: const word& name, const labelList& addr, const label index, - const cellZoneMesh& zm + const cellZoneMesh& + ); + + //- Construct from components, transferring contents + cellZone + ( + const word& name, + const xfer& addr, + const label index, + const cellZoneMesh& ); //- Construct from dictionary cellZone ( const word& name, - const dictionary& dict, + const dictionary&, const label index, - const cellZoneMesh& zm + const cellZoneMesh& ); //- Construct given the original zone and resetting the // cell list and zone mesh information cellZone ( - const cellZone& cz, + const cellZone&, const labelList& addr, const label index, - const cellZoneMesh& zm + const cellZoneMesh& + ); + + //- Construct given the original zone, resetting the + // cell list and zone mesh information + cellZone + ( + const cellZone&, + const xfer& addr, + const label index, + const cellZoneMesh& ); //- Construct and return a clone, resetting the zone mesh @@ -182,7 +201,7 @@ public: static autoPtr New ( const word& name, - const dictionary& dict, + const dictionary&, const label index, const cellZoneMesh& ); diff --git a/src/OpenFOAM/meshes/polyMesh/zones/faceZone/faceZone.C b/src/OpenFOAM/meshes/polyMesh/zones/faceZone/faceZone.C index acc3b0dcf9..0a478f8c88 100644 --- a/src/OpenFOAM/meshes/polyMesh/zones/faceZone/faceZone.C +++ b/src/OpenFOAM/meshes/polyMesh/zones/faceZone/faceZone.C @@ -242,6 +242,30 @@ Foam::faceZone::faceZone } +Foam::faceZone::faceZone +( + const word& name, + const xfer& addr, + const xfer& fm, + const label index, + const faceZoneMesh& zm +) +: + labelList(addr), + name_(name), + flipMap_(fm), + index_(index), + zoneMesh_(zm), + patchPtr_(NULL), + masterCellsPtr_(NULL), + slaveCellsPtr_(NULL), + mePtr_(NULL), + faceLookupMapPtr_(NULL) +{ + checkAddressing(); +} + + // Construct from dictionary Foam::faceZone::faceZone ( @@ -292,6 +316,30 @@ Foam::faceZone::faceZone } +Foam::faceZone::faceZone +( + const faceZone& fz, + const xfer& addr, + const xfer& fm, + const label index, + const faceZoneMesh& zm +) +: + labelList(addr), + name_(fz.name()), + flipMap_(fm), + index_(index), + zoneMesh_(zm), + patchPtr_(NULL), + masterCellsPtr_(NULL), + slaveCellsPtr_(NULL), + mePtr_(NULL), + faceLookupMapPtr_(NULL) +{ + checkAddressing(); +} + + // * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * // Foam::faceZone::~faceZone() diff --git a/src/OpenFOAM/meshes/polyMesh/zones/faceZone/faceZone.H b/src/OpenFOAM/meshes/polyMesh/zones/faceZone/faceZone.H index c299361cf6..7d489da273 100644 --- a/src/OpenFOAM/meshes/polyMesh/zones/faceZone/faceZone.H +++ b/src/OpenFOAM/meshes/polyMesh/zones/faceZone/faceZone.H @@ -163,24 +163,45 @@ public: const faceZoneMesh& zm ); + //- Construct from components, transferring contents + faceZone + ( + const word& name, + const xfer& addr, + const xfer& fm, + const label index, + const faceZoneMesh& + ); + //- Construct from dictionary faceZone ( const word& name, - const dictionary& dict, + const dictionary&, const label index, - const faceZoneMesh& zm + const faceZoneMesh& ); //- Construct given the original zone and resetting the // face list and zone mesh information faceZone ( - const faceZone& fz, + const faceZone&, const labelList& addr, const boolList& fm, const label index, - const faceZoneMesh& zm + const faceZoneMesh& + ); + + //- Construct given the original zone, resetting the + // face list and zone mesh information + faceZone + ( + const faceZone&, + const xfer& addr, + const xfer& fm, + const label index, + const faceZoneMesh& ); //- Construct and return a clone, resetting the zone mesh @@ -216,9 +237,9 @@ public: static autoPtr New ( const word& name, - const dictionary& dict, + const dictionary&, const label index, - const faceZoneMesh& zm + const faceZoneMesh& ); diff --git a/src/OpenFOAM/meshes/polyMesh/zones/pointZone/pointZone.C b/src/OpenFOAM/meshes/polyMesh/zones/pointZone/pointZone.C index 972588686d..e93bb69ae6 100644 --- a/src/OpenFOAM/meshes/polyMesh/zones/pointZone/pointZone.C +++ b/src/OpenFOAM/meshes/polyMesh/zones/pointZone/pointZone.C @@ -112,6 +112,22 @@ Foam::pointZone::pointZone {} +Foam::pointZone::pointZone +( + const word& name, + const xfer& addr, + const label index, + const pointZoneMesh& zm +) +: + labelList(addr), + name_(name), + index_(index), + zoneMesh_(zm), + pointLookupMapPtr_(NULL) +{} + + // Construct from dictionary Foam::pointZone::pointZone ( @@ -147,6 +163,22 @@ Foam::pointZone::pointZone {} +Foam::pointZone::pointZone +( + const pointZone& pz, + const xfer& addr, + const label index, + const pointZoneMesh& zm +) +: + labelList(addr), + name_(pz.name()), + index_(index), + zoneMesh_(zm), + pointLookupMapPtr_(NULL) +{} + + // * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * // Foam::pointZone::~pointZone() diff --git a/src/OpenFOAM/meshes/polyMesh/zones/pointZone/pointZone.H b/src/OpenFOAM/meshes/polyMesh/zones/pointZone/pointZone.H index 18370e2672..afc48da717 100644 --- a/src/OpenFOAM/meshes/polyMesh/zones/pointZone/pointZone.H +++ b/src/OpenFOAM/meshes/polyMesh/zones/pointZone/pointZone.H @@ -130,26 +130,45 @@ public: const word& name, const labelList& addr, const label index, - const pointZoneMesh& zm + const pointZoneMesh& + ); + + //- Construct from components, transferring contents + pointZone + ( + const word& name, + const xfer& addr, + const label index, + const pointZoneMesh& ); //- Construct from dictionary pointZone ( const word& name, - const dictionary& dict, + const dictionary&, const label index, - const pointZoneMesh& zm + const pointZoneMesh& ); //- Construct given the original zone and resetting the // point list and zone mesh information pointZone ( - const pointZone& pz, + const pointZone&, const labelList& addr, const label index, - const pointZoneMesh& zm + const pointZoneMesh& + ); + + //- Construct given the original zone, resetting the + // face list and zone mesh information + pointZone + ( + const pointZone&, + const xfer& addr, + const label index, + const pointZoneMesh& ); //- Construct and return a clone, resetting the zone mesh @@ -184,7 +203,7 @@ public: static autoPtr New ( const word& name, - const dictionary& dict, + const dictionary&, const label index, const pointZoneMesh& );