diff --git a/applications/utilities/mesh/advanced/refineHexMesh/refineHexMesh.C b/applications/utilities/mesh/advanced/refineHexMesh/refineHexMesh.C index 259151a42b..52929c7af0 100644 --- a/applications/utilities/mesh/advanced/refineHexMesh/refineHexMesh.C +++ b/applications/utilities/mesh/advanced/refineHexMesh/refineHexMesh.C @@ -40,10 +40,7 @@ Description #include "IFstream.H" #include "polyTopoChange.H" #include "polyTopoChangeMap.H" -#include "volMesh.H" -#include "surfaceMesh.H" #include "volFields.H" -#include "surfaceFields.H" #include "pointFields.H" #include "ReadFields.H" @@ -96,7 +93,8 @@ int main(int argc, char *argv[]) if (fields) Info<< "Reading geometric fields" << nl << endl; #include "readVolFields.H" - #include "readSurfaceFields.H" + // Cannot reliable map surfaceFields to new internal faces + // #include "readSurfaceFields.H" #include "readPointFields.H" Info<< endl; diff --git a/applications/utilities/mesh/conversion/fluent3DMeshToFoam/fluent3DMeshToFoam.L b/applications/utilities/mesh/conversion/fluent3DMeshToFoam/fluent3DMeshToFoam.L index effe28bdd6..8fc5f30364 100644 --- a/applications/utilities/mesh/conversion/fluent3DMeshToFoam/fluent3DMeshToFoam.L +++ b/applications/utilities/mesh/conversion/fluent3DMeshToFoam/fluent3DMeshToFoam.L @@ -1252,9 +1252,6 @@ int main(int argc, char *argv[]) { meshMod.addCell ( - -1, // masterPointID - -1, // masterEdgeID - -1, // masterFaceID celli, // masterCellID -1 // zoneID ); diff --git a/applications/utilities/mesh/generation/extrude2DMesh/extrude2DMesh/extrude2DMesh/extrude2DMesh.C b/applications/utilities/mesh/generation/extrude2DMesh/extrude2DMesh/extrude2DMesh/extrude2DMesh.C index 50e2eabfbb..3e385a1959 100644 --- a/applications/utilities/mesh/generation/extrude2DMesh/extrude2DMesh/extrude2DMesh/extrude2DMesh.C +++ b/applications/utilities/mesh/generation/extrude2DMesh/extrude2DMesh/extrude2DMesh/extrude2DMesh.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | Website: https://openfoam.org - \\ / A nd | Copyright (C) 2011-2023 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2024 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -209,9 +209,6 @@ void Foam::extrude2DMesh::setRefinement { meshMod.addCell ( - -1, // masterPointID, - -1, // masterEdgeID, - -1, // masterFaceID, celli + offset, // masterCellID, mesh_.cellZones().whichZone(celli) // zoneID ); diff --git a/applications/utilities/mesh/manipulation/mergeMeshes/mergePolyMesh.C b/applications/utilities/mesh/manipulation/mergeMeshes/mergePolyMesh.C index 45cfd25c14..b8a0ab7f43 100644 --- a/applications/utilities/mesh/manipulation/mergeMeshes/mergePolyMesh.C +++ b/applications/utilities/mesh/manipulation/mergeMeshes/mergePolyMesh.C @@ -249,9 +249,6 @@ void Foam::mergePolyMesh::addMesh(const polyMesh& m) renumberCells[celli] = meshMod_.addCell ( - -1, // Master point - -1, // Master edge - -1, // Master face -1, // Master cell zoneID // Zone for cell ); diff --git a/applications/utilities/mesh/manipulation/mirrorMesh/mirrorMesh.C b/applications/utilities/mesh/manipulation/mirrorMesh/mirrorMesh.C index 7d9883f650..45b0a3dfed 100644 --- a/applications/utilities/mesh/manipulation/mirrorMesh/mirrorMesh.C +++ b/applications/utilities/mesh/manipulation/mirrorMesh/mirrorMesh.C @@ -110,9 +110,6 @@ int main(int argc, char *argv[]) List(0), // facesFromEdges, List(0), // facesFromFaces, mesh.cellMap(), // cellMap, - List(0), // cellsFromPoints, - List(0), // cellsFromEdges, - List(0), // cellsFromFaces, List(0), // cellsFromCells, labelList(0), // reversePointMap, labelList(0), // reverseFaceMap, diff --git a/applications/utilities/mesh/manipulation/polyDualMesh/meshDualiser.C b/applications/utilities/mesh/manipulation/polyDualMesh/meshDualiser.C index 71fb47db43..a1069749cb 100644 --- a/applications/utilities/mesh/manipulation/polyDualMesh/meshDualiser.C +++ b/applications/utilities/mesh/manipulation/polyDualMesh/meshDualiser.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | Website: https://openfoam.org - \\ / A nd | Copyright (C) 2011-2022 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2024 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -969,9 +969,6 @@ void Foam::meshDualiser::setRefinement pointToDualCells_[pointi].setSize(1); pointToDualCells_[pointi][0] = meshMod.addCell ( - pointi, // masterPointID, - -1, // masterEdgeID, - -1, // masterFaceID, -1, // masterCellID, -1 // zoneID ); @@ -1013,9 +1010,6 @@ void Foam::meshDualiser::setRefinement { pointToDualCells_[pointi][pCelli] = meshMod.addCell ( - pointi, // masterPointID - -1, // masterEdgeID - -1, // masterFaceID -1, // masterCellID mesh_.cellZones().whichZone(pCells[pCelli]) // zoneID ); @@ -1037,9 +1031,6 @@ void Foam::meshDualiser::setRefinement pointToDualCells_[pointi].setSize(1); pointToDualCells_[pointi][0] = meshMod.addCell ( - pointi, // masterPointID, - -1, // masterEdgeID, - -1, // masterFaceID, -1, // masterCellID, -1 // zoneID ); diff --git a/applications/utilities/mesh/manipulation/polyDualMesh/polyDualMesh.C b/applications/utilities/mesh/manipulation/polyDualMesh/polyDualMesh.C index bbeca92f17..935fa75383 100644 --- a/applications/utilities/mesh/manipulation/polyDualMesh/polyDualMesh.C +++ b/applications/utilities/mesh/manipulation/polyDualMesh/polyDualMesh.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | Website: https://openfoam.org - \\ / A nd | Copyright (C) 2011-2023 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2024 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -68,10 +68,6 @@ Usage #include "meshTools.H" #include "OFstream.H" #include "meshDualiser.H" -#include "ReadFields.H" -#include "volFields.H" -#include "surfaceFields.H" -#include "pointFields.H" using namespace Foam; @@ -376,11 +372,6 @@ int main(int argc, char *argv[]) "disable the default behaviour of preserving faceZones by having" " multiple faces in between cells" ); - argList::addBoolOption - ( - "noFields", - "do not update fields" - ); #include "setRootCase.H" #include "createTime.H" @@ -429,7 +420,6 @@ int main(int argc, char *argv[]) Info<< "Generating multiple cells for points on concave feature edges." << nl << endl; } - const bool fields = !args.optionFound("noFields"); // Face(centre)s that need inclusion in the dual mesh @@ -477,19 +467,6 @@ int main(int argc, char *argv[]) ); - - // Read objects in time directory - IOobjectList objects(mesh, runTime.name()); - - if (fields) Info<< "Reading geometric fields" << nl << endl; - - #include "readVolFields.H" - #include "readSurfaceFields.H" - #include "readPointFields.H" - - Info<< endl; - - // Topo change container polyTopoChange meshMod(mesh.boundaryMesh().size()); @@ -511,7 +488,7 @@ int main(int argc, char *argv[]) // Create mesh, return map from old to new mesh. autoPtr map = meshMod.changeMesh(mesh, false); - // Update fields + // Update mesh objects mesh.topoChange(map); // Optionally inflate mesh diff --git a/applications/utilities/mesh/manipulation/renumberMesh/renumberMesh.C b/applications/utilities/mesh/manipulation/renumberMesh/renumberMesh.C index e93040318f..1ae930d734 100644 --- a/applications/utilities/mesh/manipulation/renumberMesh/renumberMesh.C +++ b/applications/utilities/mesh/manipulation/renumberMesh/renumberMesh.C @@ -517,9 +517,6 @@ autoPtr reorderMesh List(0), // facesFromEdges, List(0), // facesFromFaces, cellOrder, // cellMap, - List(0), // cellsFromPoints, - List(0), // cellsFromEdges, - List(0), // cellsFromFaces, List(0), // cellsFromCells, identityMap(mesh.nPoints()), // reversePointMap, reverseFaceOrder, // reverseFaceMap, diff --git a/src/OpenFOAM/meshes/polyMesh/polyTopoChangeMap/cellMapper/cellMapper.C b/src/OpenFOAM/meshes/polyMesh/polyTopoChangeMap/cellMapper/cellMapper.C index 7451d2626e..b4f5e38dc1 100644 --- a/src/OpenFOAM/meshes/polyMesh/polyTopoChangeMap/cellMapper/cellMapper.C +++ b/src/OpenFOAM/meshes/polyMesh/polyTopoChangeMap/cellMapper/cellMapper.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | Website: https://openfoam.org - \\ / A nd | Copyright (C) 2011-2023 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2024 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -24,7 +24,6 @@ License \*---------------------------------------------------------------------------*/ #include "cellMapper.H" -#include "demandDrivenData.H" #include "polyMesh.H" #include "polyTopoChangeMap.H" @@ -83,72 +82,6 @@ void Foam::cellMapper::calcAddressing() const weightsPtr_ = new scalarListList(mesh_.nCells()); scalarListList& w = *weightsPtr_; - const List& cfp = mpm_.cellsFromPointsMap(); - - forAll(cfp, cfpI) - { - // Get addressing - const labelList& mo = cfp[cfpI].masterObjects(); - - label celli = cfp[cfpI].index(); - - if (addr[celli].size()) - { - FatalErrorInFunction - << "Master cell " << celli - << " mapped from point cells " << mo - << " already destination of mapping." << abort(FatalError); - } - - // Map from masters, uniform weights - addr[celli] = mo; - w[celli] = scalarList(mo.size(), 1.0/mo.size()); - } - - const List& cfe = mpm_.cellsFromEdgesMap(); - - forAll(cfe, cfeI) - { - // Get addressing - const labelList& mo = cfe[cfeI].masterObjects(); - - label celli = cfe[cfeI].index(); - - if (addr[celli].size()) - { - FatalErrorInFunction - << "Master cell " << celli - << " mapped from edge cells " << mo - << " already destination of mapping." << abort(FatalError); - } - - // Map from masters, uniform weights - addr[celli] = mo; - w[celli] = scalarList(mo.size(), 1.0/mo.size()); - } - - const List& cff = mpm_.cellsFromFacesMap(); - - forAll(cff, cffI) - { - // Get addressing - const labelList& mo = cff[cffI].masterObjects(); - - label celli = cff[cffI].index(); - - if (addr[celli].size()) - { - FatalErrorInFunction - << "Master cell " << celli - << " mapped from face cells " << mo - << " already destination of mapping." << abort(FatalError); - } - - // Map from masters, uniform weights - addr[celli] = mo; - w[celli] = scalarList(mo.size(), 1.0/mo.size()); - } - // Volume conservative mapping if possible const List& cfc = mpm_.cellsFromCellsMap(); @@ -261,12 +194,9 @@ void Foam::cellMapper::calcAddressing() const { if (addr[celli].empty()) { - // Mapped from a dummy cell - addr[celli] = labelList(1, label(0)); - w[celli] = scalarList(1, 1.0); - - insertedCells[nInsertedCells] = celli; - nInsertedCells++; + FatalErrorInFunction + << "No interpolative addressing provided for cell " << celli + << abort(FatalError); } } @@ -298,13 +228,7 @@ Foam::cellMapper::cellMapper(const polyTopoChangeMap& mpm) insertedCellLabelsPtr_(nullptr) { // Check for possibility of direct mapping - if - ( - mpm_.cellsFromPointsMap().empty() - && mpm_.cellsFromEdgesMap().empty() - && mpm_.cellsFromFacesMap().empty() - && mpm_.cellsFromCellsMap().empty() - ) + if (mpm_.cellsFromCellsMap().empty()) { direct_ = true; } @@ -327,27 +251,6 @@ Foam::cellMapper::cellMapper(const polyTopoChangeMap& mpm) // cells from edges and cells from faces and check for left-overs labelList cm(mesh_.nCells(), -1); - const List& cfp = mpm_.cellsFromPointsMap(); - - forAll(cfp, cfpI) - { - cm[cfp[cfpI].index()] = 0; - } - - const List& cfe = mpm_.cellsFromEdgesMap(); - - forAll(cfe, cfeI) - { - cm[cfe[cfeI].index()] = 0; - } - - const List& cff = mpm_.cellsFromFacesMap(); - - forAll(cff, cffI) - { - cm[cff[cffI].index()] = 0; - } - const List& cfc = mpm_.cellsFromCellsMap(); forAll(cfc, cfcI) diff --git a/src/OpenFOAM/meshes/polyMesh/polyTopoChangeMap/polyTopoChangeMap.C b/src/OpenFOAM/meshes/polyMesh/polyTopoChangeMap/polyTopoChangeMap.C index 059e831573..396a09f8b9 100644 --- a/src/OpenFOAM/meshes/polyMesh/polyTopoChangeMap/polyTopoChangeMap.C +++ b/src/OpenFOAM/meshes/polyMesh/polyTopoChangeMap/polyTopoChangeMap.C @@ -50,9 +50,6 @@ Foam::polyTopoChangeMap::polyTopoChangeMap const List& facesFromEdges, const List& facesFromFaces, const labelList& cellMap, - const List& cellsFromPoints, - const List& cellsFromEdges, - const List& cellsFromFaces, const List& cellsFromCells, const labelList& reversePointMap, const labelList& reverseFaceMap, @@ -76,9 +73,6 @@ Foam::polyTopoChangeMap::polyTopoChangeMap facesFromEdgesMap_(facesFromEdges), facesFromFacesMap_(facesFromFaces), cellMap_(cellMap), - cellsFromPointsMap_(cellsFromPoints), - cellsFromEdgesMap_(cellsFromEdges), - cellsFromFacesMap_(cellsFromFaces), cellsFromCellsMap_(cellsFromCells), reversePointMap_(reversePointMap), reverseFaceMap_(reverseFaceMap), @@ -130,9 +124,6 @@ Foam::polyTopoChangeMap::polyTopoChangeMap List& facesFromEdges, List& facesFromFaces, labelList& cellMap, - List& cellsFromPoints, - List& cellsFromEdges, - List& cellsFromFaces, List& cellsFromCells, labelList& reversePointMap, labelList& reverseFaceMap, @@ -157,9 +148,6 @@ Foam::polyTopoChangeMap::polyTopoChangeMap facesFromEdgesMap_(facesFromEdges, reuse), facesFromFacesMap_(facesFromFaces, reuse), cellMap_(cellMap, reuse), - cellsFromPointsMap_(cellsFromPoints, reuse), - cellsFromEdgesMap_(cellsFromEdges, reuse), - cellsFromFacesMap_(cellsFromFaces, reuse), cellsFromCellsMap_(cellsFromCells, reuse), reversePointMap_(reversePointMap, reuse), reverseFaceMap_(reverseFaceMap, reuse), diff --git a/src/OpenFOAM/meshes/polyMesh/polyTopoChangeMap/polyTopoChangeMap.H b/src/OpenFOAM/meshes/polyMesh/polyTopoChangeMap/polyTopoChangeMap.H index 835ea4b3fa..161556bc6f 100644 --- a/src/OpenFOAM/meshes/polyMesh/polyTopoChangeMap/polyTopoChangeMap.H +++ b/src/OpenFOAM/meshes/polyMesh/polyTopoChangeMap/polyTopoChangeMap.H @@ -112,21 +112,6 @@ Description (including the old master cell!) - added-from-same: - cellMap[celli] contains the old master cell label - - inflated-from-face: - - cellMap[celli] contains -1 - - cellsFromFaces contains an entry with - - celli - - list of cells on old mesh that connected to the old face - - inflated-from-edge: - - cellMap[celli] contains -1 - - cellsFromEdges contains an entry with - - celli - - list of cells on old mesh that connected to the old edge - - inflated-from-point: - - cellMap[celli] contains -1 - - cellsFromPoints contains an entry with - - celli - - list of cells on old mesh that connected to the old point - appended: - cellMap[celli] contains -1 @@ -206,15 +191,6 @@ class polyTopoChangeMap // Size of the list equals the number or preserved cells const labelList cellMap_; - //- Cells inflated from points - const List cellsFromPointsMap_; - - //- Cells inflated from edges - const List cellsFromEdgesMap_; - - //- Cells inflated from faces - const List cellsFromFacesMap_; - //- Cells resulting from merging cells const List cellsFromCellsMap_; @@ -271,9 +247,6 @@ public: const List& facesFromEdges, const List& facesFromFaces, const labelList& cellMap, - const List& cellsFromPoints, - const List& cellsFromEdges, - const List& cellsFromFaces, const List& cellsFromCells, const labelList& reversePointMap, const labelList& reverseFaceMap, @@ -300,9 +273,6 @@ public: List& facesFromEdges, List& facesFromFaces, labelList& cellMap, - List& cellsFromPoints, - List& cellsFromEdges, - List& cellsFromFaces, List& cellsFromCells, labelList& reversePointMap, labelList& reverseFaceMap, @@ -402,24 +372,6 @@ public: return cellMap_; } - //- Cells inflated from points - const List& cellsFromPointsMap() const - { - return cellsFromPointsMap_; - } - - //- Cells inflated from edges - const List& cellsFromEdgesMap() const - { - return cellsFromEdgesMap_; - } - - //- Cells inflated from faces - const List& cellsFromFacesMap() const - { - return cellsFromFacesMap_; - } - //- Cells originating from cells const List& cellsFromCellsMap() const { diff --git a/src/polyTopoChange/createShellMesh/createShellMesh.C b/src/polyTopoChange/createShellMesh/createShellMesh.C index e7cc454d00..e594c7ae48 100644 --- a/src/polyTopoChange/createShellMesh/createShellMesh.C +++ b/src/polyTopoChange/createShellMesh/createShellMesh.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | Website: https://openfoam.org - \\ / A nd | Copyright (C) 2011-2023 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2024 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -503,9 +503,6 @@ void Foam::createShellMesh::setRefinement { addedCells[nLayers*facei+layerI] = meshMod.addCell ( - -1, // masterPointID - -1, // masterEdgeID - -1, // masterFaceID cellToFaceMap.size(), // masterCellID -1 // zoneID ); diff --git a/src/polyTopoChange/meshCut/meshModifiers/meshCutter/meshCutter.C b/src/polyTopoChange/meshCut/meshModifiers/meshCutter/meshCutter.C index 96939e0a83..76c7fa64e4 100644 --- a/src/polyTopoChange/meshCut/meshModifiers/meshCutter/meshCutter.C +++ b/src/polyTopoChange/meshCut/meshModifiers/meshCutter/meshCutter.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | Website: https://openfoam.org - \\ / A nd | Copyright (C) 2011-2023 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2024 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -613,9 +613,6 @@ void Foam::meshCutter::setRefinement // Add a cell to the existing cell label addedCelli = meshMod.addCell ( - -1, // master point - -1, // master edge - -1, // master face celli, // master cell mesh().cellZones().whichZone(celli) // zone for cell ); diff --git a/src/polyTopoChange/polyTopoChange/addPatchCellLayer.C b/src/polyTopoChange/polyTopoChange/addPatchCellLayer.C index ec2aada1c0..dcdaf5080e 100644 --- a/src/polyTopoChange/polyTopoChange/addPatchCellLayer.C +++ b/src/polyTopoChange/polyTopoChange/addPatchCellLayer.C @@ -1106,9 +1106,6 @@ void Foam::addPatchCellLayer::setRefinement // for now add from cell so we can map easily. addedCells[patchFacei][i] = meshMod.addCell ( - -1, // master point - -1, // master edge - -1, // master face (addToMesh_ ? mesh_.faceOwner()[meshFacei] : -1), // master ownZoneI // zone for cell diff --git a/src/polyTopoChange/polyTopoChange/hexRef8/hexRef8.C b/src/polyTopoChange/polyTopoChange/hexRef8/hexRef8.C index 64abcffe90..211e94ed1d 100644 --- a/src/polyTopoChange/polyTopoChange/hexRef8/hexRef8.C +++ b/src/polyTopoChange/polyTopoChange/hexRef8/hexRef8.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | Website: https://openfoam.org - \\ / A nd | Copyright (C) 2011-2023 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2024 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -3687,9 +3687,6 @@ Foam::labelListList Foam::hexRef8::setRefinement { cAdded[i] = meshMod.addCell ( - -1, // master point - -1, // master edge - -1, // master face celli, // master cell mesh_.cellZones().whichZone(celli) // zone for cell ); diff --git a/src/polyTopoChange/polyTopoChange/polyTopoChange.C b/src/polyTopoChange/polyTopoChange/polyTopoChange.C index cc002f3ed6..a8b8cb4c14 100644 --- a/src/polyTopoChange/polyTopoChange/polyTopoChange.C +++ b/src/polyTopoChange/polyTopoChange/polyTopoChange.C @@ -1442,98 +1442,6 @@ void Foam::polyTopoChange::calcFaceInflationMaps } -void Foam::polyTopoChange::calcCellInflationMaps -( - const polyMesh& mesh, - List& cellsFromPoints, - List& cellsFromEdges, - List& cellsFromFaces, - List& cellsFromCells -) const -{ - cellsFromPoints.setSize(cellFromPoint_.size()); - - if (cellFromPoint_.size()) - { - label nCellsFromPoints = 0; - - // Collect all still existing faces connected to this point. - forAllConstIter(Map