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:
@ -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;
|
||||
|
||||
@ -1252,9 +1252,6 @@ int main(int argc, char *argv[])
|
||||
{
|
||||
meshMod.addCell
|
||||
(
|
||||
-1, // masterPointID
|
||||
-1, // masterEdgeID
|
||||
-1, // masterFaceID
|
||||
celli, // masterCellID
|
||||
-1 // zoneID
|
||||
);
|
||||
|
||||
@ -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
|
||||
);
|
||||
|
||||
@ -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
|
||||
);
|
||||
|
||||
@ -110,9 +110,6 @@ int main(int argc, char *argv[])
|
||||
List<objectMap>(0), // facesFromEdges,
|
||||
List<objectMap>(0), // facesFromFaces,
|
||||
mesh.cellMap(), // cellMap,
|
||||
List<objectMap>(0), // cellsFromPoints,
|
||||
List<objectMap>(0), // cellsFromEdges,
|
||||
List<objectMap>(0), // cellsFromFaces,
|
||||
List<objectMap>(0), // cellsFromCells,
|
||||
labelList(0), // reversePointMap,
|
||||
labelList(0), // reverseFaceMap,
|
||||
|
||||
@ -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
|
||||
);
|
||||
|
||||
@ -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<polyTopoChangeMap> map = meshMod.changeMesh(mesh, false);
|
||||
|
||||
// Update fields
|
||||
// Update mesh objects
|
||||
mesh.topoChange(map);
|
||||
|
||||
// Optionally inflate mesh
|
||||
|
||||
@ -517,9 +517,6 @@ autoPtr<polyTopoChangeMap> reorderMesh
|
||||
List<objectMap>(0), // facesFromEdges,
|
||||
List<objectMap>(0), // facesFromFaces,
|
||||
cellOrder, // cellMap,
|
||||
List<objectMap>(0), // cellsFromPoints,
|
||||
List<objectMap>(0), // cellsFromEdges,
|
||||
List<objectMap>(0), // cellsFromFaces,
|
||||
List<objectMap>(0), // cellsFromCells,
|
||||
identityMap(mesh.nPoints()), // reversePointMap,
|
||||
reverseFaceOrder, // reverseFaceMap,
|
||||
|
||||
@ -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<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
|
||||
|
||||
const List<objectMap>& 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<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();
|
||||
|
||||
forAll(cfc, cfcI)
|
||||
|
||||
@ -50,9 +50,6 @@ Foam::polyTopoChangeMap::polyTopoChangeMap
|
||||
const List<objectMap>& facesFromEdges,
|
||||
const List<objectMap>& facesFromFaces,
|
||||
const labelList& cellMap,
|
||||
const List<objectMap>& cellsFromPoints,
|
||||
const List<objectMap>& cellsFromEdges,
|
||||
const List<objectMap>& cellsFromFaces,
|
||||
const List<objectMap>& 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<objectMap>& facesFromEdges,
|
||||
List<objectMap>& facesFromFaces,
|
||||
labelList& cellMap,
|
||||
List<objectMap>& cellsFromPoints,
|
||||
List<objectMap>& cellsFromEdges,
|
||||
List<objectMap>& cellsFromFaces,
|
||||
List<objectMap>& 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),
|
||||
|
||||
@ -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<objectMap> cellsFromPointsMap_;
|
||||
|
||||
//- Cells inflated from edges
|
||||
const List<objectMap> cellsFromEdgesMap_;
|
||||
|
||||
//- Cells inflated from faces
|
||||
const List<objectMap> cellsFromFacesMap_;
|
||||
|
||||
//- Cells resulting from merging cells
|
||||
const List<objectMap> cellsFromCellsMap_;
|
||||
|
||||
@ -271,9 +247,6 @@ public:
|
||||
const List<objectMap>& facesFromEdges,
|
||||
const List<objectMap>& facesFromFaces,
|
||||
const labelList& cellMap,
|
||||
const List<objectMap>& cellsFromPoints,
|
||||
const List<objectMap>& cellsFromEdges,
|
||||
const List<objectMap>& cellsFromFaces,
|
||||
const List<objectMap>& cellsFromCells,
|
||||
const labelList& reversePointMap,
|
||||
const labelList& reverseFaceMap,
|
||||
@ -300,9 +273,6 @@ public:
|
||||
List<objectMap>& facesFromEdges,
|
||||
List<objectMap>& facesFromFaces,
|
||||
labelList& cellMap,
|
||||
List<objectMap>& cellsFromPoints,
|
||||
List<objectMap>& cellsFromEdges,
|
||||
List<objectMap>& cellsFromFaces,
|
||||
List<objectMap>& cellsFromCells,
|
||||
labelList& reversePointMap,
|
||||
labelList& reverseFaceMap,
|
||||
@ -402,24 +372,6 @@ public:
|
||||
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
|
||||
const List<objectMap>& cellsFromCellsMap() const
|
||||
{
|
||||
|
||||
@ -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
|
||||
);
|
||||
|
||||
@ -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
|
||||
);
|
||||
|
||||
@ -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
|
||||
|
||||
@ -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
|
||||
);
|
||||
|
||||
@ -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
|
||||
(
|
||||
const polyMesh& mesh,
|
||||
@ -1934,9 +1842,6 @@ void Foam::polyTopoChange::compactAndReorder
|
||||
List<objectMap>& facesFromPoints,
|
||||
List<objectMap>& facesFromEdges,
|
||||
List<objectMap>& facesFromFaces,
|
||||
List<objectMap>& cellsFromPoints,
|
||||
List<objectMap>& cellsFromEdges,
|
||||
List<objectMap>& cellsFromFaces,
|
||||
List<objectMap>& cellsFromCells,
|
||||
List<Map<label>>& oldPatchMeshPointMaps,
|
||||
labelList& oldPatchNMeshPoints,
|
||||
@ -2001,12 +1906,10 @@ void Foam::polyTopoChange::compactAndReorder
|
||||
facesFromFaces
|
||||
);
|
||||
|
||||
calcCellInflationMaps
|
||||
getMergeSets
|
||||
(
|
||||
mesh,
|
||||
cellsFromPoints,
|
||||
cellsFromEdges,
|
||||
cellsFromFaces,
|
||||
reverseCellMap_,
|
||||
cellMap_,
|
||||
cellsFromCells
|
||||
);
|
||||
|
||||
@ -2205,7 +2108,7 @@ Foam::polyTopoChange::polyTopoChange
|
||||
for (label celli = 0; celli < nAllCells; celli++)
|
||||
{
|
||||
// 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
|
||||
(
|
||||
const label masterPointID,
|
||||
const label masterEdgeID,
|
||||
const label masterFaceID,
|
||||
const label masterCellID,
|
||||
const label zoneID
|
||||
)
|
||||
{
|
||||
label celli = cellMap_.size();
|
||||
|
||||
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);
|
||||
}
|
||||
const label celli = cellMap_.size();
|
||||
cellMap_.append(masterCellID);
|
||||
reverseCellMap_.append(celli);
|
||||
cellZone_.append(zoneID);
|
||||
|
||||
@ -2864,9 +2745,6 @@ Foam::autoPtr<Foam::polyTopoChangeMap> Foam::polyTopoChange::changeMesh
|
||||
List<objectMap> facesFromPoints;
|
||||
List<objectMap> facesFromEdges;
|
||||
List<objectMap> facesFromFaces;
|
||||
List<objectMap> cellsFromPoints;
|
||||
List<objectMap> cellsFromEdges;
|
||||
List<objectMap> cellsFromFaces;
|
||||
List<objectMap> cellsFromCells;
|
||||
// old mesh info
|
||||
List<Map<label>> oldPatchMeshPointMaps;
|
||||
@ -2890,9 +2768,6 @@ Foam::autoPtr<Foam::polyTopoChangeMap> Foam::polyTopoChange::changeMesh
|
||||
facesFromPoints,
|
||||
facesFromEdges,
|
||||
facesFromFaces,
|
||||
cellsFromPoints,
|
||||
cellsFromEdges,
|
||||
cellsFromFaces,
|
||||
cellsFromCells,
|
||||
oldPatchMeshPointMaps,
|
||||
oldPatchNMeshPoints,
|
||||
@ -3059,9 +2934,6 @@ Foam::autoPtr<Foam::polyTopoChangeMap> Foam::polyTopoChange::changeMesh
|
||||
facesFromFaces,
|
||||
|
||||
cellMap_,
|
||||
cellsFromPoints,
|
||||
cellsFromEdges,
|
||||
cellsFromFaces,
|
||||
cellsFromCells,
|
||||
|
||||
reversePointMap_,
|
||||
@ -3123,9 +2995,6 @@ Foam::autoPtr<Foam::polyTopoChangeMap> Foam::polyTopoChange::makeMesh
|
||||
List<objectMap> facesFromPoints;
|
||||
List<objectMap> facesFromEdges;
|
||||
List<objectMap> facesFromFaces;
|
||||
List<objectMap> cellsFromPoints;
|
||||
List<objectMap> cellsFromEdges;
|
||||
List<objectMap> cellsFromFaces;
|
||||
List<objectMap> cellsFromCells;
|
||||
|
||||
// old mesh info
|
||||
@ -3150,9 +3019,6 @@ Foam::autoPtr<Foam::polyTopoChangeMap> Foam::polyTopoChange::makeMesh
|
||||
facesFromPoints,
|
||||
facesFromEdges,
|
||||
facesFromFaces,
|
||||
cellsFromPoints,
|
||||
cellsFromEdges,
|
||||
cellsFromFaces,
|
||||
cellsFromCells,
|
||||
oldPatchMeshPointMaps,
|
||||
oldPatchNMeshPoints,
|
||||
@ -3341,9 +3207,6 @@ Foam::autoPtr<Foam::polyTopoChangeMap> Foam::polyTopoChange::makeMesh
|
||||
facesFromFaces,
|
||||
|
||||
cellMap_,
|
||||
cellsFromPoints,
|
||||
cellsFromEdges,
|
||||
cellsFromFaces,
|
||||
cellsFromCells,
|
||||
|
||||
reversePointMap_,
|
||||
|
||||
@ -352,15 +352,6 @@ class polyTopoChange
|
||||
List<objectMap>&
|
||||
) const;
|
||||
|
||||
void calcCellInflationMaps
|
||||
(
|
||||
const polyMesh&,
|
||||
List<objectMap>&,
|
||||
List<objectMap>&,
|
||||
List<objectMap>&,
|
||||
List<objectMap>&
|
||||
) const;
|
||||
|
||||
void resetZones
|
||||
(
|
||||
const polyMesh&, // mesh to get existing info from
|
||||
@ -401,9 +392,6 @@ class polyTopoChange
|
||||
List<objectMap>& facesFromPoints,
|
||||
List<objectMap>& facesFromEdges,
|
||||
List<objectMap>& facesFromFaces,
|
||||
List<objectMap>& cellsFromPoints,
|
||||
List<objectMap>& cellsFromEdges,
|
||||
List<objectMap>& cellsFromFaces,
|
||||
List<objectMap>& cellsFromCells,
|
||||
List<Map<label>>& oldPatchMeshPointMaps,
|
||||
labelList& oldPatchNMeshPoints,
|
||||
@ -571,9 +559,6 @@ public:
|
||||
//- Add cell. Return new cell label.
|
||||
label addCell
|
||||
(
|
||||
const label masterPointID,
|
||||
const label masterEdgeID,
|
||||
const label masterFaceID,
|
||||
const label masterCellID,
|
||||
const label zoneID
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user