diff --git a/applications/utilities/mesh/manipulation/stitchMesh/stitchMesh.C b/applications/utilities/mesh/manipulation/stitchMesh/stitchMesh.C index 1fa978d125..9723c1cdb7 100644 --- a/applications/utilities/mesh/manipulation/stitchMesh/stitchMesh.C +++ b/applications/utilities/mesh/manipulation/stitchMesh/stitchMesh.C @@ -76,100 +76,102 @@ Description // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // -label addPointZone(const polyMesh& mesh, const word& name) +label addPointZone(polyMesh& mesh, const word& name) { - label zoneID = mesh.pointZones().findZoneID(name); + pointZoneMesh& zones = mesh.pointZones(); + label zoneID = zones.findZoneID(name); if (zoneID != -1) { - Info<< "Reusing existing pointZone " - << mesh.pointZones()[zoneID].name() + Info<< "Reusing existing pointZone " << zones[zoneID].name() << " at index " << zoneID << endl; - } - else - { - pointZoneMesh& pointZones = const_cast(mesh).pointZones(); - zoneID = pointZones.size(); - Info<< "Adding pointZone " << name << " at index " << zoneID << endl; - pointZones.setSize(zoneID+1); - pointZones.set - ( - zoneID, - new pointZone - ( - name, - labelList(0), - zoneID, - pointZones - ) - ); + return zoneID; } + + zoneID = zones.size(); + Info<< "Adding pointZone " << name << " at index " << zoneID << endl; + + zones.setSize(zoneID+1); + zones.set + ( + zoneID, + new pointZone + ( + name, + labelList(0), + zoneID, + zones + ) + ); + return zoneID; } -label addFaceZone(const polyMesh& mesh, const word& name) +label addFaceZone(polyMesh& mesh, const word& name) { - label zoneID = mesh.faceZones().findZoneID(name); + faceZoneMesh& zones = mesh.faceZones(); + label zoneID = zones.findZoneID(name); if (zoneID != -1) { - Info<< "Reusing existing faceZone " << mesh.faceZones()[zoneID].name() + Info<< "Reusing existing faceZone " << zones[zoneID].name() << " at index " << zoneID << endl; - } - else - { - faceZoneMesh& faceZones = const_cast(mesh).faceZones(); - zoneID = faceZones.size(); - Info<< "Adding faceZone " << name << " at index " << zoneID << endl; - faceZones.setSize(zoneID+1); - faceZones.set - ( - zoneID, - new faceZone - ( - name, - labelList(0), - boolList(), - zoneID, - faceZones - ) - ); + return zoneID; } + + zoneID = zones.size(); + Info<< "Adding faceZone " << name << " at index " << zoneID << endl; + + zones.setSize(zoneID+1); + zones.set + ( + zoneID, + new faceZone + ( + name, + labelList(0), + boolList(), + zoneID, + zones + ) + ); + return zoneID; } -label addCellZone(const polyMesh& mesh, const word& name) +label addCellZone(polyMesh& mesh, const word& name) { - label zoneID = mesh.cellZones().findZoneID(name); + cellZoneMesh& zones = mesh.cellZones(); + label zoneID = zones.findZoneID(name); if (zoneID != -1) { - Info<< "Reusing existing cellZone " << mesh.cellZones()[zoneID].name() + Info<< "Reusing existing cellZone " << zones[zoneID].name() << " at index " << zoneID << endl; - } - else - { - cellZoneMesh& cellZones = const_cast(mesh).cellZones(); - zoneID = cellZones.size(); - Info<< "Adding cellZone " << name << " at index " << zoneID << endl; - cellZones.setSize(zoneID+1); - cellZones.set - ( - zoneID, - new cellZone - ( - name, - labelList(0), - zoneID, - cellZones - ) - ); + return zoneID; } + + zoneID = zones.size(); + Info<< "Adding cellZone " << name << " at index " << zoneID << endl; + + zones.setSize(zoneID+1); + zones.set + ( + zoneID, + new cellZone + ( + name, + labelList(0), + zoneID, + zones + ) + ); + return zoneID; } @@ -340,13 +342,9 @@ int main(int argc, char *argv[]) if (perfectCover) { // Add empty zone for resulting internal faces - label cutZoneID = addFaceZone(mesh, cutZoneName); + const label cutZoneID = addFaceZone(mesh, cutZoneName); - mesh.faceZones()[cutZoneID].resetAddressing - ( - isf, - boolList(masterPatch.size(), false) - ); + mesh.faceZones()[cutZoneID].resetAddressing(isf.xfer(), false); // Add the perfect interface mesh modifier stitcher.set @@ -370,11 +368,7 @@ int main(int argc, char *argv[]) label masterZoneID = addFaceZone(mesh, mergePatchName + "MasterZone"); - mesh.faceZones()[masterZoneID].resetAddressing - ( - isf, - boolList(masterPatch.size(), false) - ); + mesh.faceZones()[masterZoneID].resetAddressing(isf.xfer(), false); // Slave patch const polyPatch& slavePatch = mesh.boundaryMesh()[slavePatchName]; @@ -387,19 +381,11 @@ int main(int argc, char *argv[]) } label slaveZoneID = addFaceZone(mesh, mergePatchName + "SlaveZone"); - mesh.faceZones()[slaveZoneID].resetAddressing - ( - osf, - boolList(slavePatch.size(), false) - ); + mesh.faceZones()[slaveZoneID].resetAddressing(osf.xfer(), false); // Add empty zone for cut faces - label cutZoneID = addFaceZone(mesh, cutZoneName); - mesh.faceZones()[cutZoneID].resetAddressing - ( - labelList(0), - boolList(0, false) - ); + const label cutZoneID = addFaceZone(mesh, cutZoneName); + mesh.faceZones()[cutZoneID].resetAddressing(labelList(0), false); // Add the sliding interface mesh modifier diff --git a/src/OpenFOAM/meshes/polyMesh/zones/faceZone/indirectFaceList.H b/src/OpenFOAM/meshes/meshShapes/cell/cellIndList.H similarity index 77% rename from src/OpenFOAM/meshes/polyMesh/zones/faceZone/indirectFaceList.H rename to src/OpenFOAM/meshes/meshShapes/cell/cellIndList.H index 81a125cfe6..26a5b634ca 100644 --- a/src/OpenFOAM/meshes/polyMesh/zones/faceZone/indirectFaceList.H +++ b/src/OpenFOAM/meshes/meshShapes/cell/cellIndList.H @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2017 OpenCFD Ltd. \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -22,23 +22,33 @@ License along with OpenFOAM. If not, see . Typedef - Foam::indirectFaceList + Foam::cellIndList Description + An IndirectList of cells. + +Typedef + Foam::cellUIndList + +Description + A UIndirectList of cells. \*---------------------------------------------------------------------------*/ -#ifndef indirectFaceList_H -#define indirectFaceList_H +#ifndef cellIndList_H +#define cellIndList_H -#include "face.H" +// Include all normal list typedefs as well +#include "cellList.H" #include "IndirectList.H" +#include "UIndirectList.H" // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // namespace Foam { - typedef IndirectList indirectFaceList; + typedef IndirectList cellIndList; + typedef UIndirectList cellUIndList; } // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // diff --git a/src/OpenFOAM/meshes/meshShapes/cell/cellList.H b/src/OpenFOAM/meshes/meshShapes/cell/cellList.H index 5f776bb7ae..e878ce0595 100644 --- a/src/OpenFOAM/meshes/meshShapes/cell/cellList.H +++ b/src/OpenFOAM/meshes/meshShapes/cell/cellList.H @@ -25,7 +25,25 @@ Typedef Foam::cellList Description - list of cells + A List of cells. + +Typedef + Foam::cellUList + +Description + A UList of cells. + +Typedef + Foam::cellSubList + +Description + A SubList of cells. + +Typedef + Foam::cellListList + +Description + A List of cellList. \*---------------------------------------------------------------------------*/ @@ -34,15 +52,8 @@ Description #include "cell.H" #include "List.H" - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -namespace Foam -{ - typedef List cellList; -} - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // +#include "SubList.H" +#include "cellListFwd.H" #endif diff --git a/src/OpenFOAM/meshes/polyMesh/zones/cellZone/indirectCellList.H b/src/OpenFOAM/meshes/meshShapes/cell/cellListFwd.H similarity index 78% rename from src/OpenFOAM/meshes/polyMesh/zones/cellZone/indirectCellList.H rename to src/OpenFOAM/meshes/meshShapes/cell/cellListFwd.H index 0ac8c1c38e..c616384a7a 100644 --- a/src/OpenFOAM/meshes/polyMesh/zones/cellZone/indirectCellList.H +++ b/src/OpenFOAM/meshes/meshShapes/cell/cellListFwd.H @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2017 OpenCFD Ltd. \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -21,24 +21,30 @@ License You should have received a copy of the GNU General Public License along with OpenFOAM. If not, see . -Typedef - Foam::indirectCellList +Header + cellListFwd.H Description + Forwards for various types of cell lists \*---------------------------------------------------------------------------*/ -#ifndef indirectCellList_H -#define indirectCellList_H +#ifndef cellListFwd_H +#define cellListFwd_H -#include "cell.H" -#include "IndirectList.H" +#include "List.H" +#include "SubList.H" // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // namespace Foam { - typedef IndirectList indirectCellList; + class cell; + + typedef UList cellUList; + typedef List cellList; + typedef SubList cellSubList; + typedef List cellListList; } // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // diff --git a/src/OpenFOAM/meshes/polyMesh/zones/pointZone/indirectPointList.H b/src/OpenFOAM/meshes/meshShapes/edge/edgeIndList.H similarity index 77% rename from src/OpenFOAM/meshes/polyMesh/zones/pointZone/indirectPointList.H rename to src/OpenFOAM/meshes/meshShapes/edge/edgeIndList.H index 87f963d740..2cd77b797e 100644 --- a/src/OpenFOAM/meshes/polyMesh/zones/pointZone/indirectPointList.H +++ b/src/OpenFOAM/meshes/meshShapes/edge/edgeIndList.H @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2017 OpenCFD Ltd. \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -22,23 +22,33 @@ License along with OpenFOAM. If not, see . Typedef - Foam::indirectPointList + Foam::edgeIndList Description + An IndirectList of edges. + +Typedef + Foam::edgeUIndList + +Description + A UIndirectList of edges. \*---------------------------------------------------------------------------*/ -#ifndef indirectPointList_H -#define indirectPointList_H +#ifndef edgeIndList_H +#define edgeIndList_H -#include "point.H" +// Include all normal list typedefs as well +#include "edgeList.H" #include "IndirectList.H" +#include "UIndirectList.H" // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // namespace Foam { - typedef IndirectList indirectPointList; + typedef IndirectList edgeIndList; + typedef UIndirectList edgeUIndList; } // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // diff --git a/src/OpenFOAM/meshes/meshShapes/edge/edgeList.H b/src/OpenFOAM/meshes/meshShapes/edge/edgeList.H index 177a36aeb4..17f0ab96e2 100644 --- a/src/OpenFOAM/meshes/meshShapes/edge/edgeList.H +++ b/src/OpenFOAM/meshes/meshShapes/edge/edgeList.H @@ -24,18 +24,42 @@ License Typedef Foam::edgeList +Description + A List of edges. + +Typedef + Foam::edgeUList + +Description + A UList of edges. + +Typedef + Foam::edgeSubList + +Description + A SubList of edges. + +Typedef + Foam::edgeListList + +Description + A List of edgeList. + \*---------------------------------------------------------------------------*/ #ifndef edgeList_H #define edgeList_H #include "edge.H" +#include "SubList.H" // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // namespace Foam { + typedef UList edgeUList; typedef List edgeList; + typedef SubList edgeSubList; typedef List edgeListList; } diff --git a/src/OpenFOAM/meshes/meshShapes/face/faceIndList.H b/src/OpenFOAM/meshes/meshShapes/face/faceIndList.H new file mode 100644 index 0000000000..b7a89ee737 --- /dev/null +++ b/src/OpenFOAM/meshes/meshShapes/face/faceIndList.H @@ -0,0 +1,58 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 2017 OpenCFD Ltd. + \\/ M anipulation | +------------------------------------------------------------------------------- +License + This file is part of OpenFOAM. + + OpenFOAM is free software: you can redistribute it and/or modify it + under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + OpenFOAM is distributed in the hope that it will be useful, but WITHOUT + ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + for more details. + + You should have received a copy of the GNU General Public License + along with OpenFOAM. If not, see . + +Typedef + Foam::faceIndList + +Description + An IndirectList of faces. + +Typedef + Foam::faceUIndList + +Description + A UIndirectList of faces. + +\*---------------------------------------------------------------------------*/ + +#ifndef faceIndList_H +#define faceIndList_H + +// Include all normal list typedefs as well +#include "faceList.H" +#include "IndirectList.H" +#include "UIndirectList.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +namespace Foam +{ + typedef IndirectList faceIndList; + typedef UIndirectList faceUIndList; +} + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#endif + +// ************************************************************************* // diff --git a/src/OpenFOAM/meshes/meshShapes/face/faceList.H b/src/OpenFOAM/meshes/meshShapes/face/faceList.H index 19684fff19..337b3f2402 100644 --- a/src/OpenFOAM/meshes/meshShapes/face/faceList.H +++ b/src/OpenFOAM/meshes/meshShapes/face/faceList.H @@ -25,6 +25,25 @@ Typedef Foam::faceList Description + A List of faces. + +Typedef + Foam::faceUList + +Description + A UList of faces. + +Typedef + Foam::faceSubList + +Description + A SubList of faces. + +Typedef + Foam::faceListList + +Description + A List of faceList. \*---------------------------------------------------------------------------*/ @@ -36,8 +55,6 @@ Description #include "SubList.H" #include "faceListFwd.H" -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - #endif // ************************************************************************* // diff --git a/src/OpenFOAM/meshes/meshShapes/face/faceListFwd.H b/src/OpenFOAM/meshes/meshShapes/face/faceListFwd.H index 0caf8a454a..fadad20beb 100644 --- a/src/OpenFOAM/meshes/meshShapes/face/faceListFwd.H +++ b/src/OpenFOAM/meshes/meshShapes/face/faceListFwd.H @@ -21,10 +21,11 @@ License You should have received a copy of the GNU General Public License along with OpenFOAM. If not, see . -Typedef - Foam::faceListFwd +Header + faceListFwd.H Description + Forwards for various types of face lists \*---------------------------------------------------------------------------*/ @@ -39,6 +40,7 @@ Description namespace Foam { class face; + typedef UList faceUList; typedef List faceList; typedef SubList faceSubList; diff --git a/src/OpenFOAM/meshes/polyMesh/zones/ZoneMesh/ZoneMesh.C b/src/OpenFOAM/meshes/polyMesh/zones/ZoneMesh/ZoneMesh.C index 066c9c268f..9c67afde9b 100644 --- a/src/OpenFOAM/meshes/polyMesh/zones/ZoneMesh/ZoneMesh.C +++ b/src/OpenFOAM/meshes/polyMesh/zones/ZoneMesh/ZoneMesh.C @@ -247,17 +247,7 @@ Foam::label Foam::ZoneMesh::whichZone const label objectIndex ) const { - const Map