polyTopoChange: Removed unused cell-from-face/point inflation support

The concept of cell inflation from faces or points proved unworkable in general
and has been replaced by the more flexible and robust cell-splitting combined
with conservative interpolative mapping and mesh morphing as appropriate.
This commit is contained in:
Henry Weller
2024-03-06 20:30:53 +00:00
parent dbff8d0f1c
commit 92da31039e
17 changed files with 20 additions and 390 deletions

View File

@ -40,10 +40,7 @@ Description
#include "IFstream.H" #include "IFstream.H"
#include "polyTopoChange.H" #include "polyTopoChange.H"
#include "polyTopoChangeMap.H" #include "polyTopoChangeMap.H"
#include "volMesh.H"
#include "surfaceMesh.H"
#include "volFields.H" #include "volFields.H"
#include "surfaceFields.H"
#include "pointFields.H" #include "pointFields.H"
#include "ReadFields.H" #include "ReadFields.H"
@ -96,7 +93,8 @@ int main(int argc, char *argv[])
if (fields) Info<< "Reading geometric fields" << nl << endl; if (fields) Info<< "Reading geometric fields" << nl << endl;
#include "readVolFields.H" #include "readVolFields.H"
#include "readSurfaceFields.H" // Cannot reliable map surfaceFields to new internal faces
// #include "readSurfaceFields.H"
#include "readPointFields.H" #include "readPointFields.H"
Info<< endl; Info<< endl;

View File

@ -1252,9 +1252,6 @@ int main(int argc, char *argv[])
{ {
meshMod.addCell meshMod.addCell
( (
-1, // masterPointID
-1, // masterEdgeID
-1, // masterFaceID
celli, // masterCellID celli, // masterCellID
-1 // zoneID -1 // zoneID
); );

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org \\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) 2011-2023 OpenFOAM Foundation \\ / A nd | Copyright (C) 2011-2024 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -209,9 +209,6 @@ void Foam::extrude2DMesh::setRefinement
{ {
meshMod.addCell meshMod.addCell
( (
-1, // masterPointID,
-1, // masterEdgeID,
-1, // masterFaceID,
celli + offset, // masterCellID, celli + offset, // masterCellID,
mesh_.cellZones().whichZone(celli) // zoneID mesh_.cellZones().whichZone(celli) // zoneID
); );

View File

@ -249,9 +249,6 @@ void Foam::mergePolyMesh::addMesh(const polyMesh& m)
renumberCells[celli] = meshMod_.addCell renumberCells[celli] = meshMod_.addCell
( (
-1, // Master point
-1, // Master edge
-1, // Master face
-1, // Master cell -1, // Master cell
zoneID // Zone for cell zoneID // Zone for cell
); );

View File

@ -110,9 +110,6 @@ int main(int argc, char *argv[])
List<objectMap>(0), // facesFromEdges, List<objectMap>(0), // facesFromEdges,
List<objectMap>(0), // facesFromFaces, List<objectMap>(0), // facesFromFaces,
mesh.cellMap(), // cellMap, mesh.cellMap(), // cellMap,
List<objectMap>(0), // cellsFromPoints,
List<objectMap>(0), // cellsFromEdges,
List<objectMap>(0), // cellsFromFaces,
List<objectMap>(0), // cellsFromCells, List<objectMap>(0), // cellsFromCells,
labelList(0), // reversePointMap, labelList(0), // reversePointMap,
labelList(0), // reverseFaceMap, labelList(0), // reverseFaceMap,

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org \\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) 2011-2022 OpenFOAM Foundation \\ / A nd | Copyright (C) 2011-2024 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -969,9 +969,6 @@ void Foam::meshDualiser::setRefinement
pointToDualCells_[pointi].setSize(1); pointToDualCells_[pointi].setSize(1);
pointToDualCells_[pointi][0] = meshMod.addCell pointToDualCells_[pointi][0] = meshMod.addCell
( (
pointi, // masterPointID,
-1, // masterEdgeID,
-1, // masterFaceID,
-1, // masterCellID, -1, // masterCellID,
-1 // zoneID -1 // zoneID
); );
@ -1013,9 +1010,6 @@ void Foam::meshDualiser::setRefinement
{ {
pointToDualCells_[pointi][pCelli] = meshMod.addCell pointToDualCells_[pointi][pCelli] = meshMod.addCell
( (
pointi, // masterPointID
-1, // masterEdgeID
-1, // masterFaceID
-1, // masterCellID -1, // masterCellID
mesh_.cellZones().whichZone(pCells[pCelli]) // zoneID mesh_.cellZones().whichZone(pCells[pCelli]) // zoneID
); );
@ -1037,9 +1031,6 @@ void Foam::meshDualiser::setRefinement
pointToDualCells_[pointi].setSize(1); pointToDualCells_[pointi].setSize(1);
pointToDualCells_[pointi][0] = meshMod.addCell pointToDualCells_[pointi][0] = meshMod.addCell
( (
pointi, // masterPointID,
-1, // masterEdgeID,
-1, // masterFaceID,
-1, // masterCellID, -1, // masterCellID,
-1 // zoneID -1 // zoneID
); );

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org \\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) 2011-2023 OpenFOAM Foundation \\ / A nd | Copyright (C) 2011-2024 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -68,10 +68,6 @@ Usage
#include "meshTools.H" #include "meshTools.H"
#include "OFstream.H" #include "OFstream.H"
#include "meshDualiser.H" #include "meshDualiser.H"
#include "ReadFields.H"
#include "volFields.H"
#include "surfaceFields.H"
#include "pointFields.H"
using namespace Foam; using namespace Foam;
@ -376,11 +372,6 @@ int main(int argc, char *argv[])
"disable the default behaviour of preserving faceZones by having" "disable the default behaviour of preserving faceZones by having"
" multiple faces in between cells" " multiple faces in between cells"
); );
argList::addBoolOption
(
"noFields",
"do not update fields"
);
#include "setRootCase.H" #include "setRootCase.H"
#include "createTime.H" #include "createTime.H"
@ -429,7 +420,6 @@ int main(int argc, char *argv[])
Info<< "Generating multiple cells for points on concave feature edges." Info<< "Generating multiple cells for points on concave feature edges."
<< nl << endl; << nl << endl;
} }
const bool fields = !args.optionFound("noFields");
// Face(centre)s that need inclusion in the dual mesh // 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 // Topo change container
polyTopoChange meshMod(mesh.boundaryMesh().size()); polyTopoChange meshMod(mesh.boundaryMesh().size());
@ -511,7 +488,7 @@ int main(int argc, char *argv[])
// Create mesh, return map from old to new mesh. // Create mesh, return map from old to new mesh.
autoPtr<polyTopoChangeMap> map = meshMod.changeMesh(mesh, false); autoPtr<polyTopoChangeMap> map = meshMod.changeMesh(mesh, false);
// Update fields // Update mesh objects
mesh.topoChange(map); mesh.topoChange(map);
// Optionally inflate mesh // Optionally inflate mesh

View File

@ -517,9 +517,6 @@ autoPtr<polyTopoChangeMap> reorderMesh
List<objectMap>(0), // facesFromEdges, List<objectMap>(0), // facesFromEdges,
List<objectMap>(0), // facesFromFaces, List<objectMap>(0), // facesFromFaces,
cellOrder, // cellMap, cellOrder, // cellMap,
List<objectMap>(0), // cellsFromPoints,
List<objectMap>(0), // cellsFromEdges,
List<objectMap>(0), // cellsFromFaces,
List<objectMap>(0), // cellsFromCells, List<objectMap>(0), // cellsFromCells,
identityMap(mesh.nPoints()), // reversePointMap, identityMap(mesh.nPoints()), // reversePointMap,
reverseFaceOrder, // reverseFaceMap, reverseFaceOrder, // reverseFaceMap,

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org \\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) 2011-2023 OpenFOAM Foundation \\ / A nd | Copyright (C) 2011-2024 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -24,7 +24,6 @@ License
\*---------------------------------------------------------------------------*/ \*---------------------------------------------------------------------------*/
#include "cellMapper.H" #include "cellMapper.H"
#include "demandDrivenData.H"
#include "polyMesh.H" #include "polyMesh.H"
#include "polyTopoChangeMap.H" #include "polyTopoChangeMap.H"
@ -83,72 +82,6 @@ void Foam::cellMapper::calcAddressing() const
weightsPtr_ = new scalarListList(mesh_.nCells()); weightsPtr_ = new scalarListList(mesh_.nCells());
scalarListList& w = *weightsPtr_; scalarListList& w = *weightsPtr_;
const List<objectMap>& 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<objectMap>& 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<objectMap>& 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 // Volume conservative mapping if possible
const List<objectMap>& cfc = mpm_.cellsFromCellsMap(); const List<objectMap>& cfc = mpm_.cellsFromCellsMap();
@ -261,12 +194,9 @@ void Foam::cellMapper::calcAddressing() const
{ {
if (addr[celli].empty()) if (addr[celli].empty())
{ {
// Mapped from a dummy cell FatalErrorInFunction
addr[celli] = labelList(1, label(0)); << "No interpolative addressing provided for cell " << celli
w[celli] = scalarList(1, 1.0); << abort(FatalError);
insertedCells[nInsertedCells] = celli;
nInsertedCells++;
} }
} }
@ -298,13 +228,7 @@ Foam::cellMapper::cellMapper(const polyTopoChangeMap& mpm)
insertedCellLabelsPtr_(nullptr) insertedCellLabelsPtr_(nullptr)
{ {
// Check for possibility of direct mapping // Check for possibility of direct mapping
if if (mpm_.cellsFromCellsMap().empty())
(
mpm_.cellsFromPointsMap().empty()
&& mpm_.cellsFromEdgesMap().empty()
&& mpm_.cellsFromFacesMap().empty()
&& mpm_.cellsFromCellsMap().empty()
)
{ {
direct_ = true; direct_ = true;
} }
@ -327,27 +251,6 @@ Foam::cellMapper::cellMapper(const polyTopoChangeMap& mpm)
// cells from edges and cells from faces and check for left-overs // cells from edges and cells from faces and check for left-overs
labelList cm(mesh_.nCells(), -1); labelList cm(mesh_.nCells(), -1);
const List<objectMap>& cfp = mpm_.cellsFromPointsMap();
forAll(cfp, cfpI)
{
cm[cfp[cfpI].index()] = 0;
}
const List<objectMap>& cfe = mpm_.cellsFromEdgesMap();
forAll(cfe, cfeI)
{
cm[cfe[cfeI].index()] = 0;
}
const List<objectMap>& cff = mpm_.cellsFromFacesMap();
forAll(cff, cffI)
{
cm[cff[cffI].index()] = 0;
}
const List<objectMap>& cfc = mpm_.cellsFromCellsMap(); const List<objectMap>& cfc = mpm_.cellsFromCellsMap();
forAll(cfc, cfcI) forAll(cfc, cfcI)

View File

@ -50,9 +50,6 @@ Foam::polyTopoChangeMap::polyTopoChangeMap
const List<objectMap>& facesFromEdges, const List<objectMap>& facesFromEdges,
const List<objectMap>& facesFromFaces, const List<objectMap>& facesFromFaces,
const labelList& cellMap, const labelList& cellMap,
const List<objectMap>& cellsFromPoints,
const List<objectMap>& cellsFromEdges,
const List<objectMap>& cellsFromFaces,
const List<objectMap>& cellsFromCells, const List<objectMap>& cellsFromCells,
const labelList& reversePointMap, const labelList& reversePointMap,
const labelList& reverseFaceMap, const labelList& reverseFaceMap,
@ -76,9 +73,6 @@ Foam::polyTopoChangeMap::polyTopoChangeMap
facesFromEdgesMap_(facesFromEdges), facesFromEdgesMap_(facesFromEdges),
facesFromFacesMap_(facesFromFaces), facesFromFacesMap_(facesFromFaces),
cellMap_(cellMap), cellMap_(cellMap),
cellsFromPointsMap_(cellsFromPoints),
cellsFromEdgesMap_(cellsFromEdges),
cellsFromFacesMap_(cellsFromFaces),
cellsFromCellsMap_(cellsFromCells), cellsFromCellsMap_(cellsFromCells),
reversePointMap_(reversePointMap), reversePointMap_(reversePointMap),
reverseFaceMap_(reverseFaceMap), reverseFaceMap_(reverseFaceMap),
@ -130,9 +124,6 @@ Foam::polyTopoChangeMap::polyTopoChangeMap
List<objectMap>& facesFromEdges, List<objectMap>& facesFromEdges,
List<objectMap>& facesFromFaces, List<objectMap>& facesFromFaces,
labelList& cellMap, labelList& cellMap,
List<objectMap>& cellsFromPoints,
List<objectMap>& cellsFromEdges,
List<objectMap>& cellsFromFaces,
List<objectMap>& cellsFromCells, List<objectMap>& cellsFromCells,
labelList& reversePointMap, labelList& reversePointMap,
labelList& reverseFaceMap, labelList& reverseFaceMap,
@ -157,9 +148,6 @@ Foam::polyTopoChangeMap::polyTopoChangeMap
facesFromEdgesMap_(facesFromEdges, reuse), facesFromEdgesMap_(facesFromEdges, reuse),
facesFromFacesMap_(facesFromFaces, reuse), facesFromFacesMap_(facesFromFaces, reuse),
cellMap_(cellMap, reuse), cellMap_(cellMap, reuse),
cellsFromPointsMap_(cellsFromPoints, reuse),
cellsFromEdgesMap_(cellsFromEdges, reuse),
cellsFromFacesMap_(cellsFromFaces, reuse),
cellsFromCellsMap_(cellsFromCells, reuse), cellsFromCellsMap_(cellsFromCells, reuse),
reversePointMap_(reversePointMap, reuse), reversePointMap_(reversePointMap, reuse),
reverseFaceMap_(reverseFaceMap, reuse), reverseFaceMap_(reverseFaceMap, reuse),

View File

@ -112,21 +112,6 @@ Description
(including the old master cell!) (including the old master cell!)
- added-from-same: - added-from-same:
- cellMap[celli] contains the old master cell label - 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: - appended:
- cellMap[celli] contains -1 - cellMap[celli] contains -1
@ -206,15 +191,6 @@ class polyTopoChangeMap
// Size of the list equals the number or preserved cells // Size of the list equals the number or preserved cells
const labelList cellMap_; const labelList cellMap_;
//- Cells inflated from points
const List<objectMap> cellsFromPointsMap_;
//- Cells inflated from edges
const List<objectMap> cellsFromEdgesMap_;
//- Cells inflated from faces
const List<objectMap> cellsFromFacesMap_;
//- Cells resulting from merging cells //- Cells resulting from merging cells
const List<objectMap> cellsFromCellsMap_; const List<objectMap> cellsFromCellsMap_;
@ -271,9 +247,6 @@ public:
const List<objectMap>& facesFromEdges, const List<objectMap>& facesFromEdges,
const List<objectMap>& facesFromFaces, const List<objectMap>& facesFromFaces,
const labelList& cellMap, const labelList& cellMap,
const List<objectMap>& cellsFromPoints,
const List<objectMap>& cellsFromEdges,
const List<objectMap>& cellsFromFaces,
const List<objectMap>& cellsFromCells, const List<objectMap>& cellsFromCells,
const labelList& reversePointMap, const labelList& reversePointMap,
const labelList& reverseFaceMap, const labelList& reverseFaceMap,
@ -300,9 +273,6 @@ public:
List<objectMap>& facesFromEdges, List<objectMap>& facesFromEdges,
List<objectMap>& facesFromFaces, List<objectMap>& facesFromFaces,
labelList& cellMap, labelList& cellMap,
List<objectMap>& cellsFromPoints,
List<objectMap>& cellsFromEdges,
List<objectMap>& cellsFromFaces,
List<objectMap>& cellsFromCells, List<objectMap>& cellsFromCells,
labelList& reversePointMap, labelList& reversePointMap,
labelList& reverseFaceMap, labelList& reverseFaceMap,
@ -402,24 +372,6 @@ public:
return cellMap_; return cellMap_;
} }
//- Cells inflated from points
const List<objectMap>& cellsFromPointsMap() const
{
return cellsFromPointsMap_;
}
//- Cells inflated from edges
const List<objectMap>& cellsFromEdgesMap() const
{
return cellsFromEdgesMap_;
}
//- Cells inflated from faces
const List<objectMap>& cellsFromFacesMap() const
{
return cellsFromFacesMap_;
}
//- Cells originating from cells //- Cells originating from cells
const List<objectMap>& cellsFromCellsMap() const const List<objectMap>& cellsFromCellsMap() const
{ {

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org \\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) 2011-2023 OpenFOAM Foundation \\ / A nd | Copyright (C) 2011-2024 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -503,9 +503,6 @@ void Foam::createShellMesh::setRefinement
{ {
addedCells[nLayers*facei+layerI] = meshMod.addCell addedCells[nLayers*facei+layerI] = meshMod.addCell
( (
-1, // masterPointID
-1, // masterEdgeID
-1, // masterFaceID
cellToFaceMap.size(), // masterCellID cellToFaceMap.size(), // masterCellID
-1 // zoneID -1 // zoneID
); );

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org \\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) 2011-2023 OpenFOAM Foundation \\ / A nd | Copyright (C) 2011-2024 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -613,9 +613,6 @@ void Foam::meshCutter::setRefinement
// Add a cell to the existing cell // Add a cell to the existing cell
label addedCelli = meshMod.addCell label addedCelli = meshMod.addCell
( (
-1, // master point
-1, // master edge
-1, // master face
celli, // master cell celli, // master cell
mesh().cellZones().whichZone(celli) // zone for cell mesh().cellZones().whichZone(celli) // zone for cell
); );

View File

@ -1106,9 +1106,6 @@ void Foam::addPatchCellLayer::setRefinement
// for now add from cell so we can map easily. // for now add from cell so we can map easily.
addedCells[patchFacei][i] = meshMod.addCell addedCells[patchFacei][i] = meshMod.addCell
( (
-1, // master point
-1, // master edge
-1, // master face
(addToMesh_ ? mesh_.faceOwner()[meshFacei] : -1), (addToMesh_ ? mesh_.faceOwner()[meshFacei] : -1),
// master // master
ownZoneI // zone for cell ownZoneI // zone for cell

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org \\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) 2011-2023 OpenFOAM Foundation \\ / A nd | Copyright (C) 2011-2024 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -3687,9 +3687,6 @@ Foam::labelListList Foam::hexRef8::setRefinement
{ {
cAdded[i] = meshMod.addCell cAdded[i] = meshMod.addCell
( (
-1, // master point
-1, // master edge
-1, // master face
celli, // master cell celli, // master cell
mesh_.cellZones().whichZone(celli) // zone for cell mesh_.cellZones().whichZone(celli) // zone for cell
); );

View File

@ -1442,98 +1442,6 @@ void Foam::polyTopoChange::calcFaceInflationMaps
} }
void Foam::polyTopoChange::calcCellInflationMaps
(
const polyMesh& mesh,
List<objectMap>& cellsFromPoints,
List<objectMap>& cellsFromEdges,
List<objectMap>& cellsFromFaces,
List<objectMap>& cellsFromCells
) const
{
cellsFromPoints.setSize(cellFromPoint_.size());
if (cellFromPoint_.size())
{
label nCellsFromPoints = 0;
// Collect all still existing faces connected to this point.
forAllConstIter(Map<label>, cellFromPoint_, iter)
{
cellsFromPoints[nCellsFromPoints++] = objectMap
(
iter.key(),
mesh.pointCells()[iter()]
);
}
}
cellsFromEdges.setSize(cellFromEdge_.size());
if (cellFromEdge_.size())
{
label nCellsFromEdges = 0;
// Collect all still existing faces connected to this point.
forAllConstIter(Map<label>, cellFromEdge_, iter)
{
cellsFromEdges[nCellsFromEdges++] = objectMap
(
iter.key(),
mesh.edgeCells()[iter()]
);
}
}
cellsFromFaces.setSize(cellFromFace_.size());
if (cellFromFace_.size())
{
label nCellsFromFaces = 0;
labelList twoCells(2);
// Collect all still existing faces connected to this point.
forAllConstIter(Map<label>, cellFromFace_, iter)
{
label oldFacei = iter();
if (mesh.isInternalFace(oldFacei))
{
twoCells[0] = mesh.faceOwner()[oldFacei];
twoCells[1] = mesh.faceNeighbour()[oldFacei];
cellsFromFaces[nCellsFromFaces++] = objectMap
(
iter.key(),
twoCells
);
}
else
{
cellsFromFaces[nCellsFromFaces++] = objectMap
(
iter.key(),
labelList(1, mesh.faceOwner()[oldFacei])
);
}
}
}
// Cells from cell merging
// ~~~~~~~~~~~~~~~~~~~~~~~
getMergeSets
(
reverseCellMap_,
cellMap_,
cellsFromCells
);
}
void Foam::polyTopoChange::resetZones void Foam::polyTopoChange::resetZones
( (
const polyMesh& mesh, const polyMesh& mesh,
@ -1934,9 +1842,6 @@ void Foam::polyTopoChange::compactAndReorder
List<objectMap>& facesFromPoints, List<objectMap>& facesFromPoints,
List<objectMap>& facesFromEdges, List<objectMap>& facesFromEdges,
List<objectMap>& facesFromFaces, List<objectMap>& facesFromFaces,
List<objectMap>& cellsFromPoints,
List<objectMap>& cellsFromEdges,
List<objectMap>& cellsFromFaces,
List<objectMap>& cellsFromCells, List<objectMap>& cellsFromCells,
List<Map<label>>& oldPatchMeshPointMaps, List<Map<label>>& oldPatchMeshPointMaps,
labelList& oldPatchNMeshPoints, labelList& oldPatchNMeshPoints,
@ -2001,12 +1906,10 @@ void Foam::polyTopoChange::compactAndReorder
facesFromFaces facesFromFaces
); );
calcCellInflationMaps getMergeSets
( (
mesh, reverseCellMap_,
cellsFromPoints, cellMap_,
cellsFromEdges,
cellsFromFaces,
cellsFromCells cellsFromCells
); );
@ -2205,7 +2108,7 @@ Foam::polyTopoChange::polyTopoChange
for (label celli = 0; celli < nAllCells; celli++) for (label celli = 0; celli < nAllCells; celli++)
{ {
// Add cell from cell // Add cell from cell
addCell(-1, -1, -1, celli, newZoneID[celli]); addCell(celli, newZoneID[celli]);
} }
} }
@ -2751,34 +2654,12 @@ void Foam::polyTopoChange::removeFace(const label facei, const label mergeFacei)
Foam::label Foam::polyTopoChange::addCell Foam::label Foam::polyTopoChange::addCell
( (
const label masterPointID,
const label masterEdgeID,
const label masterFaceID,
const label masterCellID, const label masterCellID,
const label zoneID const label zoneID
) )
{ {
label celli = cellMap_.size(); const label celli = cellMap_.size();
cellMap_.append(masterCellID);
if (masterPointID >= 0)
{
cellMap_.append(-1);
cellFromPoint_.insert(celli, masterPointID);
}
else if (masterEdgeID >= 0)
{
cellMap_.append(-1);
cellFromEdge_.insert(celli, masterEdgeID);
}
else if (masterFaceID >= 0)
{
cellMap_.append(-1);
cellFromFace_.insert(celli, masterFaceID);
}
else
{
cellMap_.append(masterCellID);
}
reverseCellMap_.append(celli); reverseCellMap_.append(celli);
cellZone_.append(zoneID); cellZone_.append(zoneID);
@ -2864,9 +2745,6 @@ Foam::autoPtr<Foam::polyTopoChangeMap> Foam::polyTopoChange::changeMesh
List<objectMap> facesFromPoints; List<objectMap> facesFromPoints;
List<objectMap> facesFromEdges; List<objectMap> facesFromEdges;
List<objectMap> facesFromFaces; List<objectMap> facesFromFaces;
List<objectMap> cellsFromPoints;
List<objectMap> cellsFromEdges;
List<objectMap> cellsFromFaces;
List<objectMap> cellsFromCells; List<objectMap> cellsFromCells;
// old mesh info // old mesh info
List<Map<label>> oldPatchMeshPointMaps; List<Map<label>> oldPatchMeshPointMaps;
@ -2890,9 +2768,6 @@ Foam::autoPtr<Foam::polyTopoChangeMap> Foam::polyTopoChange::changeMesh
facesFromPoints, facesFromPoints,
facesFromEdges, facesFromEdges,
facesFromFaces, facesFromFaces,
cellsFromPoints,
cellsFromEdges,
cellsFromFaces,
cellsFromCells, cellsFromCells,
oldPatchMeshPointMaps, oldPatchMeshPointMaps,
oldPatchNMeshPoints, oldPatchNMeshPoints,
@ -3059,9 +2934,6 @@ Foam::autoPtr<Foam::polyTopoChangeMap> Foam::polyTopoChange::changeMesh
facesFromFaces, facesFromFaces,
cellMap_, cellMap_,
cellsFromPoints,
cellsFromEdges,
cellsFromFaces,
cellsFromCells, cellsFromCells,
reversePointMap_, reversePointMap_,
@ -3123,9 +2995,6 @@ Foam::autoPtr<Foam::polyTopoChangeMap> Foam::polyTopoChange::makeMesh
List<objectMap> facesFromPoints; List<objectMap> facesFromPoints;
List<objectMap> facesFromEdges; List<objectMap> facesFromEdges;
List<objectMap> facesFromFaces; List<objectMap> facesFromFaces;
List<objectMap> cellsFromPoints;
List<objectMap> cellsFromEdges;
List<objectMap> cellsFromFaces;
List<objectMap> cellsFromCells; List<objectMap> cellsFromCells;
// old mesh info // old mesh info
@ -3150,9 +3019,6 @@ Foam::autoPtr<Foam::polyTopoChangeMap> Foam::polyTopoChange::makeMesh
facesFromPoints, facesFromPoints,
facesFromEdges, facesFromEdges,
facesFromFaces, facesFromFaces,
cellsFromPoints,
cellsFromEdges,
cellsFromFaces,
cellsFromCells, cellsFromCells,
oldPatchMeshPointMaps, oldPatchMeshPointMaps,
oldPatchNMeshPoints, oldPatchNMeshPoints,
@ -3341,9 +3207,6 @@ Foam::autoPtr<Foam::polyTopoChangeMap> Foam::polyTopoChange::makeMesh
facesFromFaces, facesFromFaces,
cellMap_, cellMap_,
cellsFromPoints,
cellsFromEdges,
cellsFromFaces,
cellsFromCells, cellsFromCells,
reversePointMap_, reversePointMap_,

View File

@ -352,15 +352,6 @@ class polyTopoChange
List<objectMap>& List<objectMap>&
) const; ) const;
void calcCellInflationMaps
(
const polyMesh&,
List<objectMap>&,
List<objectMap>&,
List<objectMap>&,
List<objectMap>&
) const;
void resetZones void resetZones
( (
const polyMesh&, // mesh to get existing info from const polyMesh&, // mesh to get existing info from
@ -401,9 +392,6 @@ class polyTopoChange
List<objectMap>& facesFromPoints, List<objectMap>& facesFromPoints,
List<objectMap>& facesFromEdges, List<objectMap>& facesFromEdges,
List<objectMap>& facesFromFaces, List<objectMap>& facesFromFaces,
List<objectMap>& cellsFromPoints,
List<objectMap>& cellsFromEdges,
List<objectMap>& cellsFromFaces,
List<objectMap>& cellsFromCells, List<objectMap>& cellsFromCells,
List<Map<label>>& oldPatchMeshPointMaps, List<Map<label>>& oldPatchMeshPointMaps,
labelList& oldPatchNMeshPoints, labelList& oldPatchNMeshPoints,
@ -571,9 +559,6 @@ public:
//- Add cell. Return new cell label. //- Add cell. Return new cell label.
label addCell label addCell
( (
const label masterPointID,
const label masterEdgeID,
const label masterFaceID,
const label masterCellID, const label masterCellID,
const label zoneID const label zoneID
); );