polyTopoChange: Removed remnants of unused and deprecated cell and face inflation
The concept of cell and face inflation 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:
@ -2,7 +2,7 @@
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration | Website: https://openfoam.org
|
||||
\\ / A nd | Copyright (C) 2013-2023 OpenFOAM Foundation
|
||||
\\ / A nd | Copyright (C) 2013-2024 OpenFOAM Foundation
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
@ -58,29 +58,13 @@ bool notEqual(const scalar s1, const scalar s2, const scalar tol)
|
||||
int main(int argc, char *argv[])
|
||||
{
|
||||
timeSelector::addOptions();
|
||||
argList::validArgs.append("inflate (true|false)");
|
||||
#include "setRootCase.H"
|
||||
#include "createTime.H"
|
||||
timeSelector::select0(runTime, args);
|
||||
#include "createMesh.H"
|
||||
|
||||
const Switch inflate(args.args()[1]);
|
||||
|
||||
if (inflate)
|
||||
{
|
||||
Info<< "Deleting cells using inflation/deflation" << nl << endl;
|
||||
}
|
||||
else
|
||||
{
|
||||
Info<< "Deleting cells, introducing points at new position" << nl
|
||||
<< endl;
|
||||
}
|
||||
|
||||
|
||||
Random rndGen(0);
|
||||
|
||||
|
||||
|
||||
// Test mapping
|
||||
// ------------
|
||||
// Mapping is volume averaged
|
||||
@ -197,28 +181,19 @@ int main(int argc, char *argv[])
|
||||
meshMod
|
||||
);
|
||||
|
||||
// Change mesh and inflate
|
||||
// Change mesh
|
||||
Info<< "Actually changing mesh" << nl << endl;
|
||||
autoPtr<polyTopoChangeMap> map = meshMod.changeMesh(mesh, inflate);
|
||||
autoPtr<polyTopoChangeMap> map = meshMod.changeMesh(mesh);
|
||||
|
||||
Info<< "Mapping fields" << nl << endl;
|
||||
mesh.topoChange(map);
|
||||
|
||||
// Move mesh (since morphing does not do this)
|
||||
if (map().hasMotionPoints())
|
||||
{
|
||||
Info<< "Moving mesh" << nl << endl;
|
||||
mesh.movePoints(map().preMotionPoints());
|
||||
}
|
||||
|
||||
// Update numbering of cells/vertices.
|
||||
faceRemover.topoChange(map);
|
||||
|
||||
|
||||
Info<< "Writing fields" << nl << endl;
|
||||
runTime.write();
|
||||
|
||||
|
||||
// Check mesh volume conservation
|
||||
if (mesh.moving())
|
||||
{
|
||||
|
||||
@ -12,12 +12,6 @@ wmake ..
|
||||
|
||||
runApplication blockMesh
|
||||
|
||||
# Run with inflation
|
||||
runApplication $application true
|
||||
mv "log.$application" "log.$application-inflate"
|
||||
|
||||
# Run without inflation
|
||||
runApplication $application false
|
||||
|
||||
runApplication $application
|
||||
|
||||
#------------------------------------------------------------------------------
|
||||
|
||||
@ -1,40 +0,0 @@
|
||||
/*--------------------------------*- C++ -*----------------------------------*\
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration | Website: https://openfoam.org
|
||||
\\ / A nd | Version: dev
|
||||
\\/ M anipulation |
|
||||
\*---------------------------------------------------------------------------*/
|
||||
FoamFile
|
||||
{
|
||||
format ascii;
|
||||
class polyBoundaryMesh;
|
||||
location "constant/polyMesh";
|
||||
object boundary;
|
||||
}
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
3
|
||||
(
|
||||
inlet
|
||||
{
|
||||
type patch;
|
||||
nFaces 1;
|
||||
startFace 19;
|
||||
}
|
||||
outlet
|
||||
{
|
||||
type patch;
|
||||
nFaces 1;
|
||||
startFace 20;
|
||||
}
|
||||
defaultFaces
|
||||
{
|
||||
type empty;
|
||||
inGroups 1(empty);
|
||||
nFaces 80;
|
||||
startFace 21;
|
||||
}
|
||||
)
|
||||
|
||||
// ************************************************************************* //
|
||||
@ -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
|
||||
@ -100,8 +100,6 @@ void modifyOrAddFace
|
||||
f, // modified face
|
||||
own, // owner
|
||||
-1, // neighbour
|
||||
-1, // master point
|
||||
-1, // master edge
|
||||
facei, // master face
|
||||
flipFaceFlux, // face flip
|
||||
newPatchi, // patch for face
|
||||
@ -496,8 +494,6 @@ void createBaffles
|
||||
f.reverseFace(), // modified face
|
||||
mesh.faceNeighbour()[facei],// owner
|
||||
-1, // neighbour
|
||||
-1, // masterPointID
|
||||
-1, // masterEdgeID
|
||||
facei, // masterFaceID,
|
||||
false, // face flip
|
||||
wantedPatch[facei], // patch for face
|
||||
@ -1053,9 +1049,8 @@ int main(int argc, char *argv[])
|
||||
runTime++;
|
||||
}
|
||||
|
||||
// Change the mesh. Change points directly (no inflation).
|
||||
autoPtr<polyTopoChangeMap> map =
|
||||
meshMod.changeMesh(subsetter.subMesh(), false);
|
||||
// Change the mesh. Change points directly
|
||||
autoPtr<polyTopoChangeMap> map = meshMod.changeMesh(subsetter.subMesh());
|
||||
|
||||
// Update fields
|
||||
subsetter.subMesh().topoChange(map);
|
||||
@ -1124,13 +1119,6 @@ int main(int argc, char *argv[])
|
||||
Zero
|
||||
);
|
||||
|
||||
|
||||
// Move mesh (since morphing might not do this)
|
||||
if (map().hasMotionPoints())
|
||||
{
|
||||
subsetter.subMesh().setPoints(map().preMotionPoints());
|
||||
}
|
||||
|
||||
Info<< "Writing mesh with split blockedFaces to time "
|
||||
<< runTime.userTimeName() << endl;
|
||||
|
||||
|
||||
@ -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
|
||||
@ -512,12 +512,7 @@ void subsetMesh
|
||||
|
||||
const Time& runTime = mesh.time();
|
||||
|
||||
autoPtr<polyTopoChangeMap> map = meshMod.changeMesh(mesh, false);
|
||||
|
||||
if (map().hasMotionPoints())
|
||||
{
|
||||
mesh.setPoints(map().preMotionPoints());
|
||||
}
|
||||
autoPtr<polyTopoChangeMap> map = meshMod.changeMesh(mesh);
|
||||
|
||||
// Update topology on cellRemover
|
||||
cellRemover.topoChange(map());
|
||||
|
||||
@ -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
|
||||
@ -172,7 +172,7 @@ int main(int argc, char *argv[])
|
||||
{
|
||||
polyTopoChange meshMod(newMesh());
|
||||
|
||||
meshMod.changeMesh(mesh, false);
|
||||
meshMod.changeMesh(mesh);
|
||||
|
||||
polyMeshFilter::copySets(newMesh(), mesh);
|
||||
}
|
||||
@ -196,7 +196,7 @@ int main(int argc, char *argv[])
|
||||
{
|
||||
polyTopoChange meshMod(newMesh);
|
||||
|
||||
meshMod.changeMesh(mesh, false);
|
||||
meshMod.changeMesh(mesh);
|
||||
|
||||
polyMeshFilter::copySets(newMesh(), mesh);
|
||||
}
|
||||
@ -220,7 +220,7 @@ int main(int argc, char *argv[])
|
||||
{
|
||||
polyTopoChange meshMod(newMesh);
|
||||
|
||||
meshMod.changeMesh(mesh, false);
|
||||
meshMod.changeMesh(mesh);
|
||||
|
||||
polyMeshFilter::copySets(newMesh(), mesh);
|
||||
}
|
||||
|
||||
@ -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
|
||||
@ -101,22 +101,14 @@ label mergePatchFaces
|
||||
// Merge all faces of a set into the first face of the set.
|
||||
faceCombiner.setRefinement(allFaceSets, meshMod);
|
||||
|
||||
// Change the mesh (no inflation)
|
||||
map = meshMod.changeMesh(mesh, false, true);
|
||||
// Change the mesh
|
||||
map = meshMod.changeMesh(mesh, true);
|
||||
|
||||
// Update fields
|
||||
mesh.topoChange(map);
|
||||
|
||||
// Move mesh (since morphing does not do this)
|
||||
if (map().hasMotionPoints())
|
||||
{
|
||||
mesh.setPoints(map().preMotionPoints());
|
||||
}
|
||||
else
|
||||
{
|
||||
// Delete mesh volumes. No other way to do this?
|
||||
mesh.clearOut();
|
||||
}
|
||||
// Delete mesh volumes. No other way to do this?
|
||||
mesh.clearOut();
|
||||
}
|
||||
|
||||
|
||||
@ -239,8 +231,6 @@ label mergePatchFaces
|
||||
setFaceVerts[i], // vertices
|
||||
own, // owner,
|
||||
-1, // neighbour,
|
||||
-1, // masterPointID,
|
||||
-1, // masterEdgeID,
|
||||
newMasterI, // masterFaceID,
|
||||
false, // flipFaceFlux,
|
||||
patchID, // patchID,
|
||||
@ -250,22 +240,14 @@ label mergePatchFaces
|
||||
}
|
||||
}
|
||||
|
||||
// Change the mesh (no inflation)
|
||||
map = meshMod.changeMesh(mesh, false, true);
|
||||
// Change the mesh
|
||||
map = meshMod.changeMesh(mesh, true);
|
||||
|
||||
// Update fields
|
||||
mesh.topoChange(map);
|
||||
|
||||
// Move mesh (since morphing does not do this)
|
||||
if (map().hasMotionPoints())
|
||||
{
|
||||
mesh.setPoints(map().preMotionPoints());
|
||||
}
|
||||
else
|
||||
{
|
||||
// Delete mesh volumes. No other way to do this?
|
||||
mesh.clearOut();
|
||||
}
|
||||
// Delete mesh volumes. No other way to do this?
|
||||
mesh.clearOut();
|
||||
}
|
||||
}
|
||||
else
|
||||
@ -303,22 +285,14 @@ label mergeEdges(const scalar minCos, polyMesh& mesh)
|
||||
|
||||
pointRemover.setRefinement(pointCanBeDeleted, meshMod);
|
||||
|
||||
// Change the mesh (no inflation)
|
||||
autoPtr<polyTopoChangeMap> map = meshMod.changeMesh(mesh, false, true);
|
||||
// Change the mesh
|
||||
autoPtr<polyTopoChangeMap> map = meshMod.changeMesh(mesh);
|
||||
|
||||
// Update fields
|
||||
mesh.topoChange(map);
|
||||
|
||||
// Move mesh (since morphing does not do this)
|
||||
if (map().hasMotionPoints())
|
||||
{
|
||||
mesh.setPoints(map().preMotionPoints());
|
||||
}
|
||||
else
|
||||
{
|
||||
// Delete mesh volumes. No other way to do this?
|
||||
mesh.clearOut();
|
||||
}
|
||||
// Delete mesh volumes. No other way to do this?
|
||||
mesh.clearOut();
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
@ -139,7 +139,7 @@ int main(int argc, char *argv[])
|
||||
}
|
||||
|
||||
// Create mesh, return map from old to new mesh.
|
||||
autoPtr<polyTopoChangeMap> map = meshMod.changeMesh(mesh, false);
|
||||
autoPtr<polyTopoChangeMap> map = meshMod.changeMesh(mesh);
|
||||
|
||||
// Update fields
|
||||
mesh.topoChange(map);
|
||||
@ -147,12 +147,6 @@ int main(int argc, char *argv[])
|
||||
// Update numbering of cells/vertices.
|
||||
meshCutter.topoChange(map);
|
||||
|
||||
// Optionally inflate mesh
|
||||
if (map().hasMotionPoints())
|
||||
{
|
||||
mesh.setPoints(map().preMotionPoints());
|
||||
}
|
||||
|
||||
Info<< "Refined from " << returnReduce(map().nOldCells(), sumOp<label>())
|
||||
<< " to " << mesh.globalData().nTotalCells() << " cells." << nl << endl;
|
||||
|
||||
|
||||
@ -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
|
||||
@ -239,12 +239,7 @@ int main(int argc, char *argv[])
|
||||
runTime++;
|
||||
}
|
||||
|
||||
autoPtr<polyTopoChangeMap> map = meshMod.changeMesh(mesh, false);
|
||||
|
||||
if (map().hasMotionPoints())
|
||||
{
|
||||
mesh.setPoints(map().preMotionPoints());
|
||||
}
|
||||
autoPtr<polyTopoChangeMap> map = meshMod.changeMesh(mesh);
|
||||
|
||||
// Update stored labels on meshCutter.
|
||||
cutter.topoChange(map());
|
||||
|
||||
@ -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
|
||||
@ -135,16 +135,10 @@ int main(int argc, char *argv[])
|
||||
meshMod
|
||||
);
|
||||
|
||||
autoPtr<polyTopoChangeMap> map = meshMod.changeMesh(mesh, false);
|
||||
autoPtr<polyTopoChangeMap> map = meshMod.changeMesh(mesh);
|
||||
|
||||
mesh.topoChange(map);
|
||||
|
||||
// Move mesh (since morphing does not do this)
|
||||
if (map().hasMotionPoints())
|
||||
{
|
||||
mesh.setPoints(map().preMotionPoints());
|
||||
}
|
||||
|
||||
// Update numbering of cells/vertices.
|
||||
faceRemover.topoChange(map);
|
||||
|
||||
|
||||
@ -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
|
||||
@ -683,12 +683,7 @@ int main(int argc, char *argv[])
|
||||
runTime++;
|
||||
}
|
||||
|
||||
autoPtr<polyTopoChangeMap> map = meshMod.changeMesh(mesh, false);
|
||||
|
||||
if (map().hasMotionPoints())
|
||||
{
|
||||
mesh.setPoints(map().preMotionPoints());
|
||||
}
|
||||
autoPtr<polyTopoChangeMap> map = meshMod.changeMesh(mesh);
|
||||
|
||||
// Update stored labels on meshCutter
|
||||
cutter.topoChange(map());
|
||||
|
||||
@ -1312,8 +1312,6 @@ int main(int argc, char *argv[])
|
||||
faces[facei],
|
||||
owner[facei],
|
||||
neighbour[facei],
|
||||
-1, // masterPointID
|
||||
-1, // masterEdgeID
|
||||
facei, // masterFace
|
||||
false, // flipFaceFlux
|
||||
-1, // patchID
|
||||
@ -1363,8 +1361,6 @@ int main(int argc, char *argv[])
|
||||
faces[facei],
|
||||
owner[facei],
|
||||
-1,
|
||||
-1, // masterPointID
|
||||
-1, // masterEdgeID
|
||||
facei, // masterFace
|
||||
false, // flipFaceFlux
|
||||
patchi, // patchID
|
||||
@ -1380,8 +1376,6 @@ int main(int argc, char *argv[])
|
||||
faces[facei].reverseFace(),
|
||||
neighbour[facei],
|
||||
-1,
|
||||
-1, // masterPointID
|
||||
-1, // masterEdgeID
|
||||
facei, // masterFace
|
||||
false, // flipFaceFlux
|
||||
patchi, // patchID
|
||||
@ -1430,8 +1424,6 @@ int main(int argc, char *argv[])
|
||||
faces[facei],
|
||||
owner[facei],
|
||||
neighbour[facei],
|
||||
-1, // masterPointID
|
||||
-1, // masterEdgeID
|
||||
facei, // masterFace
|
||||
false, // flipFaceFlux
|
||||
-1, // patchID
|
||||
@ -1451,7 +1443,7 @@ int main(int argc, char *argv[])
|
||||
// Modify mesh
|
||||
// ~~~~~~~~~~~
|
||||
|
||||
autoPtr<polyTopoChangeMap> map = meshMod.changeMesh(mesh, false);
|
||||
autoPtr<polyTopoChangeMap> map = meshMod.changeMesh(mesh);
|
||||
|
||||
// Zip-up the mesh if it contained hanging nodes
|
||||
if (hangingNodes)
|
||||
|
||||
@ -341,7 +341,7 @@ int main(int argc, char *argv[])
|
||||
<< endl;
|
||||
const word oldInstance = mesh.instance();
|
||||
polyTopoChange meshMod(mesh);
|
||||
meshMod.changeMesh(mesh, false);
|
||||
meshMod.changeMesh(mesh);
|
||||
mesh.setInstance(oldInstance);
|
||||
}
|
||||
}
|
||||
|
||||
@ -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
|
||||
@ -251,7 +251,7 @@ int main(int argc, char *argv[])
|
||||
extruder.setRefinement(meshMod());
|
||||
|
||||
// Create a mesh from topo changes.
|
||||
autoPtr<polyTopoChangeMap> map = meshMod().changeMesh(mesh(), false);
|
||||
autoPtr<polyTopoChangeMap> map = meshMod().changeMesh(mesh());
|
||||
|
||||
mesh().topoChange(map);
|
||||
|
||||
@ -301,8 +301,7 @@ int main(int argc, char *argv[])
|
||||
collapser.setRefinement(allPointInfo, meshModCollapse);
|
||||
|
||||
// Create a mesh from topo changes.
|
||||
autoPtr<polyTopoChangeMap> map
|
||||
= meshModCollapse.changeMesh(mesh(), false);
|
||||
autoPtr<polyTopoChangeMap> map = meshModCollapse.changeMesh(mesh());
|
||||
|
||||
mesh().topoChange(map);
|
||||
}
|
||||
|
||||
@ -300,8 +300,6 @@ void Foam::extrude2DMesh::setRefinement
|
||||
newFace,
|
||||
mesh_.faceOwner()[facei] + offset, // own
|
||||
mesh_.faceNeighbour()[facei] + offset, // nei
|
||||
-1, // masterPointID
|
||||
-1, // masterEdgeID
|
||||
nFaces++, // masterFaceID
|
||||
false, // flipFaceFlux
|
||||
-1, // patchID
|
||||
@ -354,8 +352,6 @@ void Foam::extrude2DMesh::setRefinement
|
||||
newFace,
|
||||
mesh_.faceOwner()[facei] + offset, // own
|
||||
-1, // nei
|
||||
-1, // masterPointID
|
||||
-1, // masterEdgeID
|
||||
nFaces++, // masterFaceID
|
||||
false, // flipFaceFlux
|
||||
patchi, // patchID
|
||||
@ -449,8 +445,6 @@ void Foam::extrude2DMesh::setRefinement
|
||||
frontFace,
|
||||
celli + offset, // own
|
||||
nei, // nei
|
||||
-1, // masterPointID
|
||||
-1, // masterEdgeID
|
||||
nFaces++, // masterFaceID
|
||||
false, // flipFaceFlux
|
||||
-1, // patchID
|
||||
@ -530,8 +524,6 @@ void Foam::extrude2DMesh::setRefinement
|
||||
frontFace.reverseFace(),
|
||||
celli, // own
|
||||
-1, // nei
|
||||
-1, // masterPointID
|
||||
-1, // masterEdgeID
|
||||
nFaces++, // masterFaceID
|
||||
false, // flipFaceFlux
|
||||
backPatchi_, // patchID
|
||||
@ -560,8 +552,6 @@ void Foam::extrude2DMesh::setRefinement
|
||||
frontFace,
|
||||
celli + offset, // own
|
||||
-1, // nei
|
||||
-1, // masterPointID
|
||||
-1, // masterEdgeID
|
||||
nFaces++, // masterFaceID
|
||||
false, // flipFaceFlux
|
||||
frontPatchi_, // patchID
|
||||
|
||||
@ -350,21 +350,14 @@ int main(int argc, char *argv[])
|
||||
);
|
||||
}
|
||||
|
||||
// Change the mesh. No inflation.
|
||||
// Change the mesh. without keeping old points.
|
||||
autoPtr<polyTopoChangeMap> map = meshMod.changeMesh(mesh, false);
|
||||
|
||||
// Update fields
|
||||
mesh.topoChange(map);
|
||||
|
||||
// Move mesh (since morphing does not do this)
|
||||
if (map().hasMotionPoints())
|
||||
{
|
||||
mesh.setPoints(map().preMotionPoints());
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
indirectPrimitivePatch extrudePatch
|
||||
(
|
||||
IndirectList<face>
|
||||
@ -817,12 +810,6 @@ int main(int argc, char *argv[])
|
||||
updateFaceLabels(map(), frontPatchFaces);
|
||||
updateFaceLabels(map(), backPatchFaces);
|
||||
updateCellSet(map(), addedCellsSet);
|
||||
|
||||
// Move mesh (if inflation used)
|
||||
if (map().hasMotionPoints())
|
||||
{
|
||||
mesh.setPoints(map().preMotionPoints());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -942,12 +929,6 @@ int main(int argc, char *argv[])
|
||||
|
||||
// Update local data
|
||||
updateCellSet(map(), addedCellsSet);
|
||||
|
||||
// Move mesh (if inflation used)
|
||||
if (map().hasMotionPoints())
|
||||
{
|
||||
mesh.setPoints(map().preMotionPoints());
|
||||
}
|
||||
}
|
||||
|
||||
mesh.setInstance(runTimeExtruded.constant());
|
||||
|
||||
@ -1971,8 +1971,6 @@ int main(int argc, char *argv[])
|
||||
f.reverseFace(), // modified face
|
||||
mesh.faceNeighbour()[meshFacei],// owner
|
||||
-1, // neighbour
|
||||
-1, // master point
|
||||
-1, // master edge
|
||||
meshFacei, // master face
|
||||
true, // flip flux
|
||||
interMeshTopPatch[zonei], // patch for face
|
||||
@ -1988,8 +1986,6 @@ int main(int argc, char *argv[])
|
||||
f, // face
|
||||
mesh.faceOwner()[meshFacei], // owner
|
||||
-1, // neighbour
|
||||
-1, // master point
|
||||
-1, // master edge
|
||||
meshFacei, // master face
|
||||
false, // flip flux
|
||||
interMeshTopPatch[zonei], // patch for face
|
||||
@ -2000,18 +1996,12 @@ int main(int argc, char *argv[])
|
||||
}
|
||||
}
|
||||
|
||||
// Change the mesh. Change points directly (no inflation).
|
||||
// Change the mesh. Change points directly (without keeping old points).
|
||||
addBafflesMap = meshMod.changeMesh(mesh, false);
|
||||
|
||||
// Update fields
|
||||
mesh.topoChange(addBafflesMap);
|
||||
|
||||
// Move mesh (since morphing might not do this)
|
||||
if (addBafflesMap().hasMotionPoints())
|
||||
{
|
||||
mesh.setPoints(addBafflesMap().preMotionPoints());
|
||||
}
|
||||
|
||||
mesh.setInstance(meshInstance);
|
||||
|
||||
// Remove any unused patches
|
||||
|
||||
@ -168,8 +168,6 @@ void modifyOrAddFace
|
||||
f, // modified face
|
||||
own, // owner
|
||||
-1, // neighbour
|
||||
-1, // master point
|
||||
-1, // master edge
|
||||
facei, // master face
|
||||
flipFaceFlux, // face flip
|
||||
newPatchi, // patch for face
|
||||
@ -663,8 +661,8 @@ int main(int argc, char *argv[])
|
||||
runTime++;
|
||||
}
|
||||
|
||||
// Change the mesh. Change points directly (no inflation).
|
||||
autoPtr<polyTopoChangeMap> map = meshMod.changeMesh(mesh, false);
|
||||
// Change the mesh. Change points directly
|
||||
autoPtr<polyTopoChangeMap> map = meshMod.changeMesh(mesh);
|
||||
|
||||
// Update fields
|
||||
mesh.topoChange(map);
|
||||
@ -716,12 +714,6 @@ int main(int argc, char *argv[])
|
||||
}
|
||||
}
|
||||
|
||||
// Move mesh (since morphing might not do this)
|
||||
if (map().hasMotionPoints())
|
||||
{
|
||||
mesh.setPoints(map().preMotionPoints());
|
||||
}
|
||||
|
||||
// Remove any now zero-sized patches
|
||||
filterPatches(mesh, bafflePatches);
|
||||
|
||||
|
||||
@ -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
|
||||
@ -476,16 +476,12 @@ int main(int argc, char *argv[])
|
||||
|
||||
const dictionary dict(systemDict("createPatchDict", args, mesh));
|
||||
|
||||
// Whether to synchronise points
|
||||
const Switch pointSync(dict.lookupOrDefault("pointSync", false));
|
||||
|
||||
// Whether to write cyclic matches to .OBJ files
|
||||
const Switch writeCyclicMatch
|
||||
(
|
||||
dict.lookupOrDefault("writeCyclicMatch", false)
|
||||
);
|
||||
|
||||
|
||||
const polyBoundaryMesh& patches = mesh.boundaryMesh();
|
||||
|
||||
// If running parallel check same patches everywhere
|
||||
@ -708,42 +704,10 @@ int main(int argc, char *argv[])
|
||||
Info<< endl;
|
||||
|
||||
|
||||
// Change mesh, use inflation to reforce calculation of transformation
|
||||
// Change mesh, use motion to reforce calculation of transformation
|
||||
// tensors.
|
||||
Info<< "Doing topology modification to order faces." << nl << endl;
|
||||
autoPtr<polyTopoChangeMap> map = meshMod.changeMesh(mesh, true);
|
||||
mesh.setPoints(map().preMotionPoints());
|
||||
|
||||
if (writeCyclicMatch)
|
||||
{
|
||||
writeCyclicMatchObjs("coupled_", mesh);
|
||||
}
|
||||
|
||||
// Synchronise points.
|
||||
if (!pointSync)
|
||||
{
|
||||
Info<< "Not synchronising points." << nl << endl;
|
||||
}
|
||||
else
|
||||
{
|
||||
Info<< "Synchronising points." << nl << endl;
|
||||
|
||||
pointField newPoints(mesh.points());
|
||||
|
||||
syncPoints
|
||||
(
|
||||
mesh,
|
||||
newPoints,
|
||||
minMagSqrEqOp<vector>(),
|
||||
point(great, great, great)
|
||||
);
|
||||
|
||||
scalarField diff(mag(newPoints-mesh.points()));
|
||||
Info<< "Points changed by average:" << gAverage(diff)
|
||||
<< " max:" << gMax(diff) << nl << endl;
|
||||
|
||||
mesh.setPoints(newPoints);
|
||||
}
|
||||
autoPtr<polyTopoChangeMap> map = meshMod.changeMesh(mesh);
|
||||
|
||||
// 3. Remove zeros-sized patches
|
||||
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
@ -204,18 +204,12 @@ int main(int argc, char *argv[])
|
||||
runTime++;
|
||||
}
|
||||
|
||||
// Change the mesh. No inflation.
|
||||
autoPtr<polyTopoChangeMap> map = meshMod.changeMesh(mesh, false);
|
||||
// Change the mesh
|
||||
autoPtr<polyTopoChangeMap> map = meshMod.changeMesh(mesh);
|
||||
|
||||
// Update fields
|
||||
mesh.topoChange(map);
|
||||
|
||||
// Move mesh (since morphing does not do this)
|
||||
if (map().hasMotionPoints())
|
||||
{
|
||||
mesh.setPoints(map().preMotionPoints());
|
||||
}
|
||||
|
||||
if (overwrite)
|
||||
{
|
||||
mesh.setInstance(oldInstance);
|
||||
|
||||
@ -351,8 +351,6 @@ void Foam::mergePolyMesh::addMesh(const polyMesh& m)
|
||||
newOwn,
|
||||
newNei,
|
||||
-1,
|
||||
-1,
|
||||
-1,
|
||||
false,
|
||||
newPatch,
|
||||
newZone,
|
||||
@ -506,8 +504,8 @@ void Foam::mergePolyMesh::merge()
|
||||
}
|
||||
}
|
||||
|
||||
// Change mesh. No inflation
|
||||
meshMod_.changeMesh(mesh_, false);
|
||||
// Change mesh
|
||||
meshMod_.changeMesh(mesh_);
|
||||
|
||||
// Clear topo change for the next operation
|
||||
meshMod_.clear();
|
||||
|
||||
@ -106,8 +106,6 @@ int main(int argc, char *argv[])
|
||||
mesh.pointMap(), // pointMap,
|
||||
List<objectMap>(0), // pointsFromPoints,
|
||||
labelList(0), // faceMap,
|
||||
List<objectMap>(0), // facesFromPoints,
|
||||
List<objectMap>(0), // facesFromEdges,
|
||||
List<objectMap>(0), // facesFromFaces,
|
||||
mesh.cellMap(), // cellMap,
|
||||
List<objectMap>(0), // cellsFromCells,
|
||||
@ -116,7 +114,6 @@ int main(int argc, char *argv[])
|
||||
labelList(0), // reverseCellMap,
|
||||
labelHashSet(0), // flipFaceFlux,
|
||||
labelListList(0), // patchPointMap,
|
||||
pointField(0), // preMotionPoints,
|
||||
labelList(0), // oldPatchStarts,
|
||||
labelList(0), // oldPatchNMeshPoints,
|
||||
autoPtr<scalarField>() // oldCellVolumesPtr
|
||||
|
||||
@ -200,8 +200,6 @@ Foam::label Foam::meshDualiser::addInternalFace
|
||||
newFace,
|
||||
dualCell0, // own
|
||||
dualCell1, // nei
|
||||
masterPointi, // masterPointID
|
||||
masterEdgeI, // masterEdgeID
|
||||
masterFacei, // masterFaceID
|
||||
false, // flipFaceFlux
|
||||
-1, // patchID
|
||||
@ -227,8 +225,6 @@ Foam::label Foam::meshDualiser::addInternalFace
|
||||
newFace,
|
||||
dualCell1, // own
|
||||
dualCell0, // nei
|
||||
masterPointi, // masterPointID
|
||||
masterEdgeI, // masterEdgeID
|
||||
masterFacei, // masterFaceID
|
||||
false, // flipFaceFlux
|
||||
-1, // patchID
|
||||
@ -284,8 +280,6 @@ Foam::label Foam::meshDualiser::addBoundaryFace
|
||||
newFace,
|
||||
dualCelli, // own
|
||||
-1, // nei
|
||||
masterPointi, // masterPointID
|
||||
masterEdgeI, // masterEdgeID
|
||||
masterFacei, // masterFaceID
|
||||
false, // flipFaceFlux
|
||||
patchi, // patchID
|
||||
|
||||
@ -486,17 +486,11 @@ int main(int argc, char *argv[])
|
||||
);
|
||||
|
||||
// Create mesh, return map from old to new mesh.
|
||||
autoPtr<polyTopoChangeMap> map = meshMod.changeMesh(mesh, false);
|
||||
autoPtr<polyTopoChangeMap> map = meshMod.changeMesh(mesh);
|
||||
|
||||
// Update mesh objects
|
||||
mesh.topoChange(map);
|
||||
|
||||
// Optionally inflate mesh
|
||||
if (map().hasMotionPoints())
|
||||
{
|
||||
mesh.setPoints(map().preMotionPoints());
|
||||
}
|
||||
|
||||
if (!overwrite)
|
||||
{
|
||||
runTime++;
|
||||
|
||||
@ -513,8 +513,6 @@ autoPtr<polyTopoChangeMap> reorderMesh
|
||||
identityMap(mesh.nPoints()), // pointMap,
|
||||
List<objectMap>(0), // pointsFromPoints,
|
||||
faceOrder, // faceMap,
|
||||
List<objectMap>(0), // facesFromPoints,
|
||||
List<objectMap>(0), // facesFromEdges,
|
||||
List<objectMap>(0), // facesFromFaces,
|
||||
cellOrder, // cellMap,
|
||||
List<objectMap>(0), // cellsFromCells,
|
||||
@ -523,7 +521,6 @@ autoPtr<polyTopoChangeMap> reorderMesh
|
||||
reverseCellOrder, // reverseCellMap,
|
||||
flipFaceFlux, // flipFaceFlux,
|
||||
patchPointMap, // patchPointMap,
|
||||
pointField(0), // preMotionPoints,
|
||||
patchStarts, // oldPatchStarts,
|
||||
oldPatchNMeshPoints, // oldPatchNMeshPoints
|
||||
autoPtr<scalarField>() // oldCellVolumes
|
||||
@ -962,7 +959,6 @@ int main(int argc, char *argv[])
|
||||
autoPtr<polyTopoChangeMap> pointOrderMap = meshMod.changeMesh
|
||||
(
|
||||
mesh,
|
||||
false, // inflate
|
||||
true, // syncParallel
|
||||
false, // orderCells
|
||||
orderPoints // orderPoints
|
||||
@ -1047,13 +1043,6 @@ int main(int argc, char *argv[])
|
||||
}
|
||||
|
||||
|
||||
// Move mesh (since morphing might not do this)
|
||||
if (map().hasMotionPoints())
|
||||
{
|
||||
mesh.setPoints(map().preMotionPoints());
|
||||
}
|
||||
|
||||
|
||||
{
|
||||
label band;
|
||||
scalar profile;
|
||||
|
||||
@ -110,18 +110,12 @@ int main(int argc, char *argv[])
|
||||
runTime++;
|
||||
}
|
||||
|
||||
// Change the mesh. No inflation.
|
||||
autoPtr<polyTopoChangeMap> map = meshMod.changeMesh(mesh, false);
|
||||
// Change the mesh
|
||||
autoPtr<polyTopoChangeMap> map = meshMod.changeMesh(mesh);
|
||||
|
||||
// Update fields
|
||||
mesh.topoChange(map);
|
||||
|
||||
// Move mesh (since morphing does not do this)
|
||||
if (map().hasMotionPoints())
|
||||
{
|
||||
mesh.setPoints(map().preMotionPoints());
|
||||
}
|
||||
|
||||
if (overwrite)
|
||||
{
|
||||
mesh.setInstance(oldInstance);
|
||||
|
||||
@ -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
|
||||
@ -303,7 +303,7 @@ int main(int argc, char *argv[])
|
||||
|
||||
if (nChanged > 0)
|
||||
{
|
||||
meshMod.changeMesh(mesh, false);
|
||||
meshMod.changeMesh(mesh);
|
||||
|
||||
Info<< "After patching:" << nl
|
||||
<< " patch\tsize" << endl;
|
||||
|
||||
@ -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
|
||||
@ -133,6 +133,11 @@ void Foam::pointMapper::calcAddressing() const
|
||||
{
|
||||
if (addr[pointi].empty())
|
||||
{
|
||||
FatalErrorInFunction
|
||||
<< "No interpolative addressing provided for point "
|
||||
<< pointi
|
||||
<< abort(FatalError);
|
||||
|
||||
// Mapped from a dummy point. Take point 0 with weight 1.
|
||||
addr[pointi] = labelList(1, label(0));
|
||||
w[pointi] = scalarList(1, 1.0);
|
||||
|
||||
@ -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
|
||||
@ -84,50 +84,6 @@ void Foam::faceMapper::calcAddressing() const
|
||||
weightsPtr_ = new scalarListList(mesh_.nFaces());
|
||||
scalarListList& w = *weightsPtr_;
|
||||
|
||||
const List<objectMap>& ffp = mpm_.facesFromPointsMap();
|
||||
|
||||
forAll(ffp, ffpI)
|
||||
{
|
||||
// Get addressing
|
||||
const labelList& mo = ffp[ffpI].masterObjects();
|
||||
|
||||
label facei = ffp[ffpI].index();
|
||||
|
||||
if (addr[facei].size())
|
||||
{
|
||||
FatalErrorInFunction
|
||||
<< "Master face " << facei
|
||||
<< " mapped from point faces " << mo
|
||||
<< " already destination of mapping." << abort(FatalError);
|
||||
}
|
||||
|
||||
// Map from masters, uniform weights
|
||||
addr[facei] = mo;
|
||||
w[facei] = scalarList(mo.size(), 1.0/mo.size());
|
||||
}
|
||||
|
||||
const List<objectMap>& ffe = mpm_.facesFromEdgesMap();
|
||||
|
||||
forAll(ffe, ffeI)
|
||||
{
|
||||
// Get addressing
|
||||
const labelList& mo = ffe[ffeI].masterObjects();
|
||||
|
||||
label facei = ffe[ffeI].index();
|
||||
|
||||
if (addr[facei].size())
|
||||
{
|
||||
FatalErrorInFunction
|
||||
<< "Master face " << facei
|
||||
<< " mapped from edge faces " << mo
|
||||
<< " already destination of mapping." << abort(FatalError);
|
||||
}
|
||||
|
||||
// Map from masters, uniform weights
|
||||
addr[facei] = mo;
|
||||
w[facei] = scalarList(mo.size(), 1.0/mo.size());
|
||||
}
|
||||
|
||||
const List<objectMap>& fff = mpm_.facesFromFacesMap();
|
||||
|
||||
forAll(fff, fffI)
|
||||
@ -177,12 +133,9 @@ void Foam::faceMapper::calcAddressing() const
|
||||
{
|
||||
if (addr[facei].empty())
|
||||
{
|
||||
// Mapped from a dummy face
|
||||
addr[facei] = labelList(1, label(0));
|
||||
w[facei] = scalarList(1, 1.0);
|
||||
|
||||
insertedFaces[nInsertedFaces] = facei;
|
||||
nInsertedFaces++;
|
||||
FatalErrorInFunction
|
||||
<< "No interpolative addressing provided for face " << facei
|
||||
<< abort(FatalError);
|
||||
}
|
||||
}
|
||||
|
||||
@ -214,12 +167,7 @@ Foam::faceMapper::faceMapper(const polyTopoChangeMap& mpm)
|
||||
insertedFaceLabelsPtr_(nullptr)
|
||||
{
|
||||
// Check for possibility of direct mapping
|
||||
if
|
||||
(
|
||||
mpm_.facesFromPointsMap().empty()
|
||||
&& mpm_.facesFromEdgesMap().empty()
|
||||
&& mpm_.facesFromFacesMap().empty()
|
||||
)
|
||||
if (mpm_.facesFromFacesMap().empty())
|
||||
{
|
||||
direct_ = true;
|
||||
}
|
||||
@ -242,20 +190,6 @@ Foam::faceMapper::faceMapper(const polyTopoChangeMap& mpm)
|
||||
// and faces from edges and check for left-overs
|
||||
labelList fm(mesh_.nFaces(), -1);
|
||||
|
||||
const List<objectMap>& ffp = mpm_.facesFromPointsMap();
|
||||
|
||||
forAll(ffp, ffpI)
|
||||
{
|
||||
fm[ffp[ffpI].index()] = 0;
|
||||
}
|
||||
|
||||
const List<objectMap>& ffe = mpm_.facesFromEdgesMap();
|
||||
|
||||
forAll(ffe, ffeI)
|
||||
{
|
||||
fm[ffe[ffeI].index()] = 0;
|
||||
}
|
||||
|
||||
const List<objectMap>& fff = mpm_.facesFromFacesMap();
|
||||
|
||||
forAll(fff, fffI)
|
||||
|
||||
@ -46,8 +46,6 @@ Foam::polyTopoChangeMap::polyTopoChangeMap
|
||||
const labelList& pointMap,
|
||||
const List<objectMap>& pointsFromPoints,
|
||||
const labelList& faceMap,
|
||||
const List<objectMap>& facesFromPoints,
|
||||
const List<objectMap>& facesFromEdges,
|
||||
const List<objectMap>& facesFromFaces,
|
||||
const labelList& cellMap,
|
||||
const List<objectMap>& cellsFromCells,
|
||||
@ -56,7 +54,6 @@ Foam::polyTopoChangeMap::polyTopoChangeMap
|
||||
const labelList& reverseCellMap,
|
||||
const labelHashSet& flipFaceFlux,
|
||||
const labelListList& patchPointMap,
|
||||
const pointField& preMotionPoints,
|
||||
const labelList& oldPatchStarts,
|
||||
const labelList& oldPatchNMeshPoints,
|
||||
const autoPtr<scalarField>& oldCellVolumesPtr
|
||||
@ -69,8 +66,6 @@ Foam::polyTopoChangeMap::polyTopoChangeMap
|
||||
pointMap_(pointMap),
|
||||
pointsFromPointsMap_(pointsFromPoints),
|
||||
faceMap_(faceMap),
|
||||
facesFromPointsMap_(facesFromPoints),
|
||||
facesFromEdgesMap_(facesFromEdges),
|
||||
facesFromFacesMap_(facesFromFaces),
|
||||
cellMap_(cellMap),
|
||||
cellsFromCellsMap_(cellsFromCells),
|
||||
@ -79,7 +74,6 @@ Foam::polyTopoChangeMap::polyTopoChangeMap
|
||||
reverseCellMap_(reverseCellMap),
|
||||
flipFaceFlux_(flipFaceFlux),
|
||||
patchPointMap_(patchPointMap),
|
||||
preMotionPoints_(preMotionPoints),
|
||||
oldPatchSizes_(oldPatchStarts.size()),
|
||||
oldPatchStarts_(oldPatchStarts),
|
||||
oldPatchNMeshPoints_(oldPatchNMeshPoints),
|
||||
@ -120,8 +114,6 @@ Foam::polyTopoChangeMap::polyTopoChangeMap
|
||||
labelList& pointMap,
|
||||
List<objectMap>& pointsFromPoints,
|
||||
labelList& faceMap,
|
||||
List<objectMap>& facesFromPoints,
|
||||
List<objectMap>& facesFromEdges,
|
||||
List<objectMap>& facesFromFaces,
|
||||
labelList& cellMap,
|
||||
List<objectMap>& cellsFromCells,
|
||||
@ -130,7 +122,6 @@ Foam::polyTopoChangeMap::polyTopoChangeMap
|
||||
labelList& reverseCellMap,
|
||||
labelHashSet& flipFaceFlux,
|
||||
labelListList& patchPointMap,
|
||||
pointField& preMotionPoints,
|
||||
labelList& oldPatchStarts,
|
||||
labelList& oldPatchNMeshPoints,
|
||||
autoPtr<scalarField>& oldCellVolumesPtr,
|
||||
@ -144,8 +135,6 @@ Foam::polyTopoChangeMap::polyTopoChangeMap
|
||||
pointMap_(pointMap, reuse),
|
||||
pointsFromPointsMap_(pointsFromPoints, reuse),
|
||||
faceMap_(faceMap, reuse),
|
||||
facesFromPointsMap_(facesFromPoints, reuse),
|
||||
facesFromEdgesMap_(facesFromEdges, reuse),
|
||||
facesFromFacesMap_(facesFromFaces, reuse),
|
||||
cellMap_(cellMap, reuse),
|
||||
cellsFromCellsMap_(cellsFromCells, reuse),
|
||||
@ -154,7 +143,6 @@ Foam::polyTopoChangeMap::polyTopoChangeMap
|
||||
reverseCellMap_(reverseCellMap, reuse),
|
||||
flipFaceFlux_(flipFaceFlux),
|
||||
patchPointMap_(patchPointMap, reuse),
|
||||
preMotionPoints_(preMotionPoints, reuse),
|
||||
oldPatchSizes_(oldPatchStarts.size()),
|
||||
oldPatchStarts_(oldPatchStarts, reuse),
|
||||
oldPatchNMeshPoints_(oldPatchNMeshPoints, reuse),
|
||||
|
||||
@ -43,8 +43,6 @@ Description
|
||||
other cell. Note that probably only cell with cell is relevant)
|
||||
- can be added from existing same 'master' entity
|
||||
(so point from point, face from face and cell from cell)
|
||||
- can be inflated: face out of edge or point,
|
||||
cell out of face, edge or point.
|
||||
- can be appended: added 'out of nothing'.
|
||||
|
||||
All this information is necessary to correctly map fields.
|
||||
@ -80,24 +78,9 @@ Description
|
||||
(including the old master face!)
|
||||
- added-from-same:
|
||||
- faceMap[facei] contains the old master face label
|
||||
- inflated-from-edge:
|
||||
- faceMap[facei] contains -1
|
||||
- facesFromEdges contains an entry with
|
||||
- facei
|
||||
- list of faces(*) on old mesh that connected to the old edge
|
||||
- inflated-from-point:
|
||||
- faceMap[facei] contains -1
|
||||
- facesFromPoints contains an entry with
|
||||
- facei
|
||||
- list of faces(*) on old mesh that connected to the old point
|
||||
- appended:
|
||||
- faceMap[facei] contains -1
|
||||
|
||||
Note (*) \n
|
||||
if the newly inflated face is a boundary face the list of faces will
|
||||
only be boundary faces; if the new face is an internal face they
|
||||
will only be internal faces.
|
||||
|
||||
\par cells
|
||||
|
||||
- unchanged:
|
||||
@ -177,12 +160,6 @@ class polyTopoChangeMap
|
||||
// - for faces added from points or edges, this is -1
|
||||
const labelList faceMap_;
|
||||
|
||||
//- Faces inflated from points
|
||||
const List<objectMap> facesFromPointsMap_;
|
||||
|
||||
//- Faces inflated from edges
|
||||
const List<objectMap> facesFromEdgesMap_;
|
||||
|
||||
//- Faces resulting from merging faces
|
||||
const List<objectMap> facesFromFacesMap_;
|
||||
|
||||
@ -209,10 +186,6 @@ class polyTopoChangeMap
|
||||
//- Patch mesh point renumbering
|
||||
const labelListList patchPointMap_;
|
||||
|
||||
//- Pre-motion point positions.
|
||||
// This specifies the correct way of blowing up zero-volume objects
|
||||
const pointField preMotionPoints_;
|
||||
|
||||
//- List of the old patch sizes
|
||||
labelList oldPatchSizes_;
|
||||
|
||||
@ -243,8 +216,6 @@ public:
|
||||
const labelList& pointMap,
|
||||
const List<objectMap>& pointsFromPoints,
|
||||
const labelList& faceMap,
|
||||
const List<objectMap>& facesFromPoints,
|
||||
const List<objectMap>& facesFromEdges,
|
||||
const List<objectMap>& facesFromFaces,
|
||||
const labelList& cellMap,
|
||||
const List<objectMap>& cellsFromCells,
|
||||
@ -253,7 +224,6 @@ public:
|
||||
const labelList& reverseCellMap,
|
||||
const labelHashSet& flipFaceFlux,
|
||||
const labelListList& patchPointMap,
|
||||
const pointField& preMotionPoints,
|
||||
const labelList& oldPatchStarts,
|
||||
const labelList& oldPatchNMeshPoints,
|
||||
const autoPtr<scalarField>& oldCellVolumesPtr
|
||||
@ -269,8 +239,6 @@ public:
|
||||
labelList& pointMap,
|
||||
List<objectMap>& pointsFromPoints,
|
||||
labelList& faceMap,
|
||||
List<objectMap>& facesFromPoints,
|
||||
List<objectMap>& facesFromEdges,
|
||||
List<objectMap>& facesFromFaces,
|
||||
labelList& cellMap,
|
||||
List<objectMap>& cellsFromCells,
|
||||
@ -279,7 +247,6 @@ public:
|
||||
labelList& reverseCellMap,
|
||||
labelHashSet& flipFaceFlux,
|
||||
labelListList& patchPointMap,
|
||||
pointField& preMotionPoints,
|
||||
labelList& oldPatchStarts,
|
||||
labelList& oldPatchNMeshPoints,
|
||||
autoPtr<scalarField>& oldCellVolumesPtr,
|
||||
@ -347,18 +314,6 @@ public:
|
||||
return faceMap_;
|
||||
}
|
||||
|
||||
//- Faces inflated from points
|
||||
const List<objectMap>& facesFromPointsMap() const
|
||||
{
|
||||
return facesFromPointsMap_;
|
||||
}
|
||||
|
||||
//- Faces inflated from edges
|
||||
const List<objectMap>& facesFromEdgesMap() const
|
||||
{
|
||||
return facesFromEdgesMap_;
|
||||
}
|
||||
|
||||
//- Faces originating from faces
|
||||
const List<objectMap>& facesFromFacesMap() const
|
||||
{
|
||||
@ -490,21 +445,6 @@ public:
|
||||
}
|
||||
|
||||
|
||||
//- Pre-motion point positions.
|
||||
// This specifies the correct way of blowing up
|
||||
// zero-volume objects
|
||||
const pointField& preMotionPoints() const
|
||||
{
|
||||
return preMotionPoints_;
|
||||
}
|
||||
|
||||
//- Has valid preMotionPoints?
|
||||
bool hasMotionPoints() const
|
||||
{
|
||||
return preMotionPoints_.size() > 0;
|
||||
}
|
||||
|
||||
|
||||
//- Return list of the old patch sizes
|
||||
const labelList& oldPatchSizes() const
|
||||
{
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration | Website: https://openfoam.org
|
||||
\\ / A nd | Copyright (C) 2020-2022 OpenFOAM Foundation
|
||||
\\ / A nd | Copyright (C) 2020-2024 OpenFOAM Foundation
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
@ -279,7 +279,7 @@ void Foam::polyMeshUnMergeCyclics(polyMesh& mesh, const scalar includedAngle)
|
||||
}
|
||||
}
|
||||
}
|
||||
autoPtr<polyTopoChangeMap> map = meshMod.changeMesh(mesh, false);
|
||||
autoPtr<polyTopoChangeMap> map = meshMod.changeMesh(mesh);
|
||||
|
||||
// Remove the (now) empty merged cyclic patches. Copy everything except the
|
||||
// merged cyclics into a patch list and use this then re-patch the mesh.
|
||||
|
||||
@ -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
|
||||
@ -255,9 +255,9 @@ Foam::fvMeshTopoChangers::refiner::refine
|
||||
// Play refinement commands into mesh changer.
|
||||
meshCutter_.setRefinement(cellsToRefine, meshMod);
|
||||
|
||||
// Create mesh (with inflation), return map from old to new mesh.
|
||||
// autoPtr<polyTopoChangeMap> map = meshMod.changeMesh(*this, true);
|
||||
autoPtr<polyTopoChangeMap> map = meshMod.changeMesh(mesh(), false);
|
||||
// Create mesh
|
||||
// return map from old to new mesh.
|
||||
autoPtr<polyTopoChangeMap> map = meshMod.changeMesh(mesh());
|
||||
|
||||
Info<< "Refined from "
|
||||
<< returnReduce(map().nOldCells(), sumOp<label>())
|
||||
@ -388,8 +388,7 @@ Foam::fvMeshTopoChangers::refiner::unrefine
|
||||
|
||||
|
||||
// Change mesh and generate map.
|
||||
// autoPtr<polyTopoChangeMap> map = meshMod.changeMesh(mesh(), true);
|
||||
autoPtr<polyTopoChangeMap> map = meshMod.changeMesh(mesh(), false);
|
||||
autoPtr<polyTopoChangeMap> map = meshMod.changeMesh(mesh());
|
||||
|
||||
Info<< "Unrefined from "
|
||||
<< returnReduce(map().nOldCells(), sumOp<label>())
|
||||
@ -585,7 +584,7 @@ void Foam::fvMeshTopoChangers::refiner::refineUfs
|
||||
|
||||
if (oldFacei == -1)
|
||||
{
|
||||
// Inflated/appended
|
||||
// Inserted
|
||||
Uf[facei] = UfU[facei];
|
||||
}
|
||||
else if (reverseFaceMap[oldFacei] != facei)
|
||||
@ -611,12 +610,12 @@ void Foam::fvMeshTopoChangers::refiner::refineUfs
|
||||
|
||||
if (oldFacei == -1)
|
||||
{
|
||||
// Inflated/appended
|
||||
// Inserted/appended
|
||||
patchUf[i] = patchUfU[i];
|
||||
}
|
||||
else if (reverseFaceMap[oldFacei] != facei)
|
||||
{
|
||||
// face-from-masterface
|
||||
// face-from-master-face
|
||||
patchUf[i] = patchUfU[i];
|
||||
}
|
||||
|
||||
|
||||
@ -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
|
||||
@ -625,22 +625,14 @@ Foam::autoPtr<Foam::polyTopoChangeMap> Foam::meshRefinement::doRemoveCells
|
||||
meshMod
|
||||
);
|
||||
|
||||
// Change the mesh (no inflation)
|
||||
autoPtr<polyTopoChangeMap> map = meshMod.changeMesh(mesh_, false, true);
|
||||
// Change the mesh
|
||||
autoPtr<polyTopoChangeMap> map = meshMod.changeMesh(mesh_, true);
|
||||
|
||||
// Update fields
|
||||
mesh_.topoChange(map);
|
||||
|
||||
// Move mesh (since morphing might not do this)
|
||||
if (map().hasMotionPoints())
|
||||
{
|
||||
mesh_.movePoints(map().preMotionPoints());
|
||||
}
|
||||
else
|
||||
{
|
||||
// Delete mesh volumes. No other way to do this?
|
||||
mesh_.clearOut();
|
||||
}
|
||||
// Delete mesh volumes. No other way to do this?
|
||||
mesh_.clearOut();
|
||||
|
||||
// Reset the instance for if in overwrite mode
|
||||
mesh_.setInstance(name());
|
||||
@ -755,8 +747,6 @@ Foam::autoPtr<Foam::polyTopoChangeMap> Foam::meshRefinement::splitFaces
|
||||
f1, // modified face
|
||||
own, // owner
|
||||
nei, // neighbour
|
||||
-1, // master point
|
||||
-1, // master edge
|
||||
facei, // master face
|
||||
false, // face flip
|
||||
patchi, // patch for face
|
||||
@ -766,23 +756,14 @@ Foam::autoPtr<Foam::polyTopoChangeMap> Foam::meshRefinement::splitFaces
|
||||
}
|
||||
|
||||
|
||||
|
||||
// Change the mesh (no inflation)
|
||||
autoPtr<polyTopoChangeMap> map = meshMod.changeMesh(mesh_, false, true);
|
||||
// Change the mesh (without keeping old points)
|
||||
autoPtr<polyTopoChangeMap> map = meshMod.changeMesh(mesh_, true);
|
||||
|
||||
// Update fields
|
||||
mesh_.topoChange(map);
|
||||
|
||||
// Move mesh (since morphing might not do this)
|
||||
if (map().hasMotionPoints())
|
||||
{
|
||||
mesh_.movePoints(map().preMotionPoints());
|
||||
}
|
||||
else
|
||||
{
|
||||
// Delete mesh volumes. No other way to do this?
|
||||
mesh_.clearOut();
|
||||
}
|
||||
// Delete mesh volumes. No other way to do this?
|
||||
mesh_.clearOut();
|
||||
|
||||
// Reset the instance for if in overwrite mode
|
||||
mesh_.setInstance(name());
|
||||
|
||||
@ -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
|
||||
@ -95,8 +95,6 @@ Foam::label Foam::meshRefinement::createBaffle
|
||||
f.reverseFace(), // modified face
|
||||
mesh_.faceNeighbour()[facei],// owner
|
||||
-1, // neighbour
|
||||
-1, // masterPointID
|
||||
-1, // masterEdgeID
|
||||
facei, // masterFaceID,
|
||||
true, // face flip
|
||||
nbrPatch, // patch for face
|
||||
@ -364,23 +362,14 @@ Foam::autoPtr<Foam::polyTopoChangeMap> Foam::meshRefinement::createBaffles
|
||||
|
||||
mesh_.clearOut();
|
||||
|
||||
// Change the mesh (no inflation, parallel sync)
|
||||
autoPtr<polyTopoChangeMap> map = meshMod.changeMesh(mesh_, false, true);
|
||||
// Change the mesh, parallel sync
|
||||
autoPtr<polyTopoChangeMap> map = meshMod.changeMesh(mesh_, true);
|
||||
|
||||
// Update fields
|
||||
mesh_.topoChange(map);
|
||||
|
||||
// Move mesh if in inflation mode
|
||||
if (map().hasMotionPoints())
|
||||
{
|
||||
mesh_.movePoints(map().preMotionPoints());
|
||||
}
|
||||
else
|
||||
{
|
||||
// Delete mesh volumes.
|
||||
mesh_.clearOut();
|
||||
}
|
||||
|
||||
// Delete mesh volumes.
|
||||
mesh_.clearOut();
|
||||
|
||||
// Reset the instance for if in overwrite mode
|
||||
mesh_.setInstance(name());
|
||||
@ -891,22 +880,14 @@ Foam::autoPtr<Foam::polyTopoChangeMap> Foam::meshRefinement::mergeBaffles
|
||||
|
||||
mesh_.clearOut();
|
||||
|
||||
// Change the mesh (no inflation)
|
||||
autoPtr<polyTopoChangeMap> map = meshMod.changeMesh(mesh_, false, true);
|
||||
// Change the mesh, parallel sync
|
||||
autoPtr<polyTopoChangeMap> map = meshMod.changeMesh(mesh_, true);
|
||||
|
||||
// Update fields
|
||||
mesh_.topoChange(map);
|
||||
|
||||
// Move mesh (since morphing does not do this)
|
||||
if (map().hasMotionPoints())
|
||||
{
|
||||
mesh_.movePoints(map().preMotionPoints());
|
||||
}
|
||||
else
|
||||
{
|
||||
// Delete mesh volumes.
|
||||
mesh_.clearOut();
|
||||
}
|
||||
// Delete mesh volumes.
|
||||
mesh_.clearOut();
|
||||
|
||||
// Reset the instance for if in overwrite mode
|
||||
mesh_.setInstance(name());
|
||||
@ -2680,22 +2661,14 @@ Foam::meshRefinement::dupNonManifoldPoints
|
||||
|
||||
mesh_.clearOut();
|
||||
|
||||
// Change the mesh (no inflation, parallel sync)
|
||||
autoPtr<polyTopoChangeMap> map = meshMod.changeMesh(mesh_, false, true);
|
||||
// Change the mesh, parallel sync
|
||||
autoPtr<polyTopoChangeMap> map = meshMod.changeMesh(mesh_, true);
|
||||
|
||||
// Update fields
|
||||
mesh_.topoChange(map);
|
||||
|
||||
// Move mesh if in inflation mode
|
||||
if (map().hasMotionPoints())
|
||||
{
|
||||
mesh_.movePoints(map().preMotionPoints());
|
||||
}
|
||||
else
|
||||
{
|
||||
// Delete mesh volumes.
|
||||
mesh_.clearOut();
|
||||
}
|
||||
// Delete mesh volumes.
|
||||
mesh_.clearOut();
|
||||
|
||||
// Reset the instance for if in overwrite mode
|
||||
mesh_.setInstance(name());
|
||||
@ -3302,22 +3275,14 @@ Foam::autoPtr<Foam::polyTopoChangeMap> Foam::meshRefinement::zonify
|
||||
|
||||
mesh_.clearOut();
|
||||
|
||||
// Change the mesh (no inflation, parallel sync)
|
||||
autoPtr<polyTopoChangeMap> map = meshMod.changeMesh(mesh_, false, true);
|
||||
// Change the mesh without keeping old points, parallel sync
|
||||
autoPtr<polyTopoChangeMap> map = meshMod.changeMesh(mesh_, true);
|
||||
|
||||
// Update fields
|
||||
mesh_.topoChange(map);
|
||||
|
||||
// Move mesh if in inflation mode
|
||||
if (map().hasMotionPoints())
|
||||
{
|
||||
mesh_.movePoints(map().preMotionPoints());
|
||||
}
|
||||
else
|
||||
{
|
||||
// Delete mesh volumes.
|
||||
mesh_.clearOut();
|
||||
}
|
||||
// Delete mesh volumes.
|
||||
mesh_.clearOut();
|
||||
|
||||
// Reset the instance for if in overwrite mode
|
||||
mesh_.setInstance(name());
|
||||
|
||||
@ -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
|
||||
@ -90,24 +90,15 @@ License
|
||||
// // unused points.
|
||||
// faceCombiner.setRefinement(mergeSets, meshMod);
|
||||
//
|
||||
// // Change the mesh (no inflation)
|
||||
// // Change the mesh (without keeping old points)
|
||||
// autoPtr<polyTopoChangeMap> map =
|
||||
// meshMod.changeMesh(mesh_, false, true);
|
||||
// meshMod.changeMesh(mesh_, true);
|
||||
//
|
||||
// // Update fields
|
||||
// mesh_.topoChange(map);
|
||||
//
|
||||
// // Move mesh (since morphing does not do this)
|
||||
// if (map().hasMotionPoints())
|
||||
// {
|
||||
// mesh_.movePoints(map().preMotionPoints());
|
||||
// }
|
||||
// else
|
||||
// {
|
||||
// // Delete mesh volumes. No other way to do this?
|
||||
// mesh_.clearOut();
|
||||
// }
|
||||
//
|
||||
// // Delete mesh volumes. No other way to do this?
|
||||
// mesh_.clearOut();
|
||||
//
|
||||
// // Reset the instance for if in overwrite mode
|
||||
// mesh_.setInstance(name());
|
||||
@ -190,22 +181,14 @@ License
|
||||
//
|
||||
// pointRemover.setRefinement(pointCanBeDeleted, meshMod);
|
||||
//
|
||||
// // Change the mesh (no inflation)
|
||||
// map = meshMod.changeMesh(mesh_, false, true);
|
||||
// // Change the mesh (without keeping old points)
|
||||
// map = meshMod.changeMesh(mesh_, true);
|
||||
//
|
||||
// // Update fields
|
||||
// mesh_.topoChange(map);
|
||||
//
|
||||
// // Move mesh (since morphing does not do this)
|
||||
// if (map().hasMotionPoints())
|
||||
// {
|
||||
// mesh_.movePoints(map().preMotionPoints());
|
||||
// }
|
||||
// else
|
||||
// {
|
||||
// // Delete mesh volumes. No other way to do this?
|
||||
// mesh_.clearOut();
|
||||
// }
|
||||
// // Delete mesh volumes. No other way to do this?
|
||||
// mesh_.clearOut();
|
||||
//
|
||||
// // Reset the instance for if in overwrite mode
|
||||
// mesh_.setInstance(name());
|
||||
@ -334,22 +317,14 @@ Foam::label Foam::meshRefinement::mergePatchFacesUndo
|
||||
labelList(0) // cells to store
|
||||
);
|
||||
|
||||
// Change the mesh (no inflation)
|
||||
autoPtr<polyTopoChangeMap> map = meshMod.changeMesh(mesh_, false, true);
|
||||
// Change the mesh
|
||||
autoPtr<polyTopoChangeMap> map = meshMod.changeMesh(mesh_, true);
|
||||
|
||||
// Update fields
|
||||
mesh_.topoChange(map);
|
||||
|
||||
// Move mesh (since morphing does not do this)
|
||||
if (map().hasMotionPoints())
|
||||
{
|
||||
mesh_.movePoints(map().preMotionPoints());
|
||||
}
|
||||
else
|
||||
{
|
||||
// Delete mesh volumes.
|
||||
mesh_.clearOut();
|
||||
}
|
||||
// Delete mesh volumes.
|
||||
mesh_.clearOut();
|
||||
|
||||
// Reset the instance for if in overwrite mode
|
||||
mesh_.setInstance(name());
|
||||
@ -523,24 +498,14 @@ Foam::label Foam::meshRefinement::mergePatchFacesUndo
|
||||
restoredCells
|
||||
);
|
||||
|
||||
// Change the mesh (no inflation)
|
||||
autoPtr<polyTopoChangeMap> map =
|
||||
meshMod.changeMesh(mesh_, false, true);
|
||||
// Change the mesh (without keeping old points)
|
||||
autoPtr<polyTopoChangeMap> map = meshMod.changeMesh(mesh_, true);
|
||||
|
||||
// Update fields
|
||||
mesh_.topoChange(map);
|
||||
|
||||
// Move mesh (since morphing does not do this)
|
||||
if (map().hasMotionPoints())
|
||||
{
|
||||
mesh_.movePoints(map().preMotionPoints());
|
||||
}
|
||||
else
|
||||
{
|
||||
// Delete mesh volumes.
|
||||
mesh_.clearOut();
|
||||
}
|
||||
|
||||
// Delete mesh volumes.
|
||||
mesh_.clearOut();
|
||||
|
||||
// Reset the instance for if in overwrite mode
|
||||
mesh_.setInstance(name());
|
||||
@ -609,22 +574,14 @@ Foam::autoPtr<Foam::polyTopoChangeMap> Foam::meshRefinement::doRemovePoints
|
||||
|
||||
pointRemover.setRefinement(pointCanBeDeleted, meshMod);
|
||||
|
||||
// Change the mesh (no inflation)
|
||||
autoPtr<polyTopoChangeMap> map = meshMod.changeMesh(mesh_, false, true);
|
||||
// Change the mesh
|
||||
autoPtr<polyTopoChangeMap> map = meshMod.changeMesh(mesh_, true);
|
||||
|
||||
// Update fields
|
||||
mesh_.topoChange(map);
|
||||
|
||||
// Move mesh (since morphing does not do this)
|
||||
if (map().hasMotionPoints())
|
||||
{
|
||||
mesh_.movePoints(map().preMotionPoints());
|
||||
}
|
||||
else
|
||||
{
|
||||
// Delete mesh volumes.
|
||||
mesh_.clearOut();
|
||||
}
|
||||
// Delete mesh volumes.
|
||||
mesh_.clearOut();
|
||||
|
||||
// Reset the instance for if in overwrite mode
|
||||
mesh_.setInstance(name());
|
||||
@ -681,22 +638,14 @@ Foam::autoPtr<Foam::polyTopoChangeMap> Foam::meshRefinement::doRestorePoints
|
||||
meshMod
|
||||
);
|
||||
|
||||
// Change the mesh (no inflation)
|
||||
autoPtr<polyTopoChangeMap> map = meshMod.changeMesh(mesh_, false, true);
|
||||
// Change the mesh
|
||||
autoPtr<polyTopoChangeMap> map = meshMod.changeMesh(mesh_, true);
|
||||
|
||||
// Update fields
|
||||
mesh_.topoChange(map);
|
||||
|
||||
// Move mesh (since morphing does not do this)
|
||||
if (map().hasMotionPoints())
|
||||
{
|
||||
mesh_.movePoints(map().preMotionPoints());
|
||||
}
|
||||
else
|
||||
{
|
||||
// Delete mesh volumes.
|
||||
mesh_.clearOut();
|
||||
}
|
||||
// Delete mesh volumes.
|
||||
mesh_.clearOut();
|
||||
|
||||
// Reset the instance for if in overwrite mode
|
||||
mesh_.setInstance(name());
|
||||
|
||||
@ -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
|
||||
@ -2240,22 +2240,15 @@ Foam::autoPtr<Foam::polyTopoChangeMap> Foam::meshRefinement::refine
|
||||
// Play refinement commands into mesh changer.
|
||||
meshCutter_.setRefinement(cellsToRefine, meshMod);
|
||||
|
||||
// Create mesh (no inflation), return map from old to new mesh.
|
||||
autoPtr<polyTopoChangeMap> map = meshMod.changeMesh(mesh_, false);
|
||||
// Create mesh
|
||||
// return map from old to new mesh.
|
||||
autoPtr<polyTopoChangeMap> map = meshMod.changeMesh(mesh_);
|
||||
|
||||
// Update fields
|
||||
mesh_.topoChange(map);
|
||||
|
||||
// Optionally inflate mesh
|
||||
if (map().hasMotionPoints())
|
||||
{
|
||||
mesh_.movePoints(map().preMotionPoints());
|
||||
}
|
||||
else
|
||||
{
|
||||
// Delete mesh volumes.
|
||||
mesh_.clearOut();
|
||||
}
|
||||
// Delete mesh volumes.
|
||||
mesh_.clearOut();
|
||||
|
||||
// Reset the instance for if in overwrite mode
|
||||
mesh_.setInstance(name());
|
||||
|
||||
@ -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
|
||||
@ -3506,7 +3506,7 @@ void Foam::snappyLayerDriver::addLayers
|
||||
// current mesh.
|
||||
|
||||
// Apply the stored topo changes to the current mesh.
|
||||
autoPtr<polyTopoChangeMap> map = savedMeshMod.changeMesh(mesh, false);
|
||||
autoPtr<polyTopoChangeMap> map = savedMeshMod.changeMesh(mesh);
|
||||
|
||||
// Hack to remove meshPhi/V0 - mapped incorrectly. TBD.
|
||||
mesh.clearOut();
|
||||
@ -3514,16 +3514,8 @@ void Foam::snappyLayerDriver::addLayers
|
||||
// Update fields
|
||||
mesh.topoChange(map);
|
||||
|
||||
// Move mesh (since morphing does not do this)
|
||||
if (map().hasMotionPoints())
|
||||
{
|
||||
mesh.movePoints(map().preMotionPoints());
|
||||
}
|
||||
else
|
||||
{
|
||||
// Delete mesh volumes.
|
||||
mesh.clearOut();
|
||||
}
|
||||
// Delete mesh volumes.
|
||||
mesh.clearOut();
|
||||
|
||||
// Reset the instance for if in overwrite mode
|
||||
mesh.setInstance(meshRefiner_.name());
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration | Website: https://openfoam.org
|
||||
\\ / A nd | Copyright (C) 2012-2023 OpenFOAM Foundation
|
||||
\\ / A nd | Copyright (C) 2012-2024 OpenFOAM Foundation
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
@ -153,12 +153,7 @@ void Foam::componentDisplacementMotionSolver::topoChange
|
||||
// Find out scaling between points0 and current points
|
||||
|
||||
// Get the new points either from the map or the mesh
|
||||
const scalarField points
|
||||
(
|
||||
map.hasMotionPoints()
|
||||
? map.preMotionPoints().component(cmpt_)
|
||||
: mesh().points().component(cmpt_)
|
||||
);
|
||||
const scalarField points(mesh().points().component(cmpt_));
|
||||
|
||||
// Get extents of points0 and points and determine scale
|
||||
const scalar scale =
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration | Website: https://openfoam.org
|
||||
\\ / A nd | Copyright (C) 2016-2023 OpenFOAM Foundation
|
||||
\\ / A nd | Copyright (C) 2016-2024 OpenFOAM Foundation
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
@ -155,12 +155,7 @@ void Foam::solidBodyMotionSolver::topoChange(const polyTopoChangeMap& map)
|
||||
// pointMesh already updates pointFields
|
||||
|
||||
// Get the new points either from the map or the mesh
|
||||
const pointField& points =
|
||||
(
|
||||
map.hasMotionPoints()
|
||||
? map.preMotionPoints()
|
||||
: mesh().points()
|
||||
);
|
||||
const pointField& points = mesh().points();
|
||||
|
||||
pointField newPoints0(map.pointMap().size());
|
||||
|
||||
|
||||
@ -570,8 +570,6 @@ void Foam::createShellMesh::setRefinement
|
||||
patch_.localFaces()[facei].reverseFace(),// vertices
|
||||
addedCells[nLayers*facei], // own
|
||||
-1, // nei
|
||||
-1, // masterPointID
|
||||
-1, // masterEdgeID
|
||||
faceToFaceMap.size(), // masterFaceID : current facei
|
||||
true, // flipFaceFlux
|
||||
bottomPatchID[facei], // patchID
|
||||
@ -627,8 +625,6 @@ void Foam::createShellMesh::setRefinement
|
||||
newF, // vertices
|
||||
own, // own
|
||||
nei, // nei
|
||||
-1, // masterPointID
|
||||
-1, // masterEdgeID
|
||||
faceToFaceMap.size(), // masterFaceID : current facei
|
||||
false, // flipFaceFlux
|
||||
patchi, // patchID
|
||||
@ -778,8 +774,6 @@ void Foam::createShellMesh::setRefinement
|
||||
newF, // vertices
|
||||
minCelli, // own
|
||||
maxCelli, // nei
|
||||
-1, // masterPointID
|
||||
-1, // masterEdgeID
|
||||
faceToFaceMap.size(), // masterFaceID
|
||||
false, // flipFaceFlux
|
||||
patchi, // patchID
|
||||
@ -873,8 +867,6 @@ void Foam::createShellMesh::setRefinement
|
||||
newF, // vertices
|
||||
addedCells[nLayers*minFacei+layerI], // own
|
||||
-1, // nei
|
||||
-1, // masterPointID
|
||||
-1, // masterEdgeID
|
||||
faceToFaceMap.size(), // masterFaceID
|
||||
false, // flipFaceFlux
|
||||
ePatches[i], // patchID
|
||||
|
||||
@ -580,14 +580,15 @@ Foam::autoPtr<Foam::polyTopoChangeMap> Foam::fvMeshDistribute::repatch
|
||||
PtrList<FieldField<fvsPatchField, tensor>> tFields;
|
||||
saveBoundaryFields<tensor, surfaceMesh>(tFields);
|
||||
|
||||
// Change the mesh (no inflation). Note: parallel comms allowed.
|
||||
// Change the mesh (without keeping old points).
|
||||
// Note: parallel comms allowed.
|
||||
//
|
||||
// NOTE: there is one very particular problem with this ordering.
|
||||
// We first create the processor patches and use these to merge out
|
||||
// shared points (see mergeSharedPoints below). So temporarily points
|
||||
// and edges do not match!
|
||||
|
||||
autoPtr<polyTopoChangeMap> map = meshMod.changeMesh(mesh_, false, true);
|
||||
autoPtr<polyTopoChangeMap> map = meshMod.changeMesh(mesh_, true);
|
||||
|
||||
// Update fields
|
||||
mesh_.mapFields(map);
|
||||
@ -767,8 +768,9 @@ Foam::autoPtr<Foam::polyTopoChangeMap> Foam::fvMeshDistribute::mergeSharedPoints
|
||||
}
|
||||
}
|
||||
|
||||
// Change the mesh (no inflation). Note: parallel comms allowed.
|
||||
autoPtr<polyTopoChangeMap> map = meshMod.changeMesh(mesh_, false, true);
|
||||
// Change the mesh
|
||||
// Note: parallel comms allowed.
|
||||
autoPtr<polyTopoChangeMap> map = meshMod.changeMesh(mesh_, true);
|
||||
|
||||
// Update fields
|
||||
mesh_.mapFields(map);
|
||||
@ -1272,8 +1274,9 @@ Foam::autoPtr<Foam::polyTopoChangeMap> Foam::fvMeshDistribute::doRemoveCells
|
||||
initMapExposedFaces(sytFields);
|
||||
initMapExposedFaces(tFields);
|
||||
|
||||
// Change the mesh. No inflation. Note: no parallel comms allowed.
|
||||
autoPtr<polyTopoChangeMap> map = meshMod.changeMesh(mesh_, false, false);
|
||||
// Change the mesh.
|
||||
// Note: no parallel comms allowed.
|
||||
autoPtr<polyTopoChangeMap> map = meshMod.changeMesh(mesh_, false);
|
||||
|
||||
// Update fields
|
||||
mesh_.mapFields(map);
|
||||
|
||||
@ -217,8 +217,6 @@ void Foam::mergePatchPairs::addFaces
|
||||
f, // Face to add
|
||||
srcOwn, // Owner cell
|
||||
tgtOwn, // Neighbour cell
|
||||
-1, // Master point index
|
||||
-1, // Master edge index
|
||||
srcFacei, // Master face index
|
||||
false, // Flip
|
||||
-1, // Patch index
|
||||
@ -240,8 +238,6 @@ void Foam::mergePatchPairs::addFaces
|
||||
f.reverseFace(), // Face to add
|
||||
tgtOwn, // Owner cell
|
||||
srcOwn, // Neighbour cell
|
||||
-1, // Master point index
|
||||
-1, // Master edge index
|
||||
tgtFacei, // Master face index
|
||||
false, // Flip
|
||||
-1, // Patch index
|
||||
@ -276,8 +272,6 @@ void Foam::mergePatchPairs::addFaces
|
||||
f, // Face to add
|
||||
srcOwn, // Owner cell
|
||||
-1, // Neighbour cell
|
||||
-1, // Master point index
|
||||
-1, // Master edge index
|
||||
srcFacei, // Master face index
|
||||
false, // Flip
|
||||
srcPatchi, // Patch index
|
||||
@ -311,8 +305,6 @@ void Foam::mergePatchPairs::addFaces
|
||||
f.reverseFace(), // Face to add
|
||||
tgtOwn, // Owner cell
|
||||
-1, // Neighbour cell
|
||||
-1, // Master point index
|
||||
-1, // Master edge index
|
||||
tgtFacei, // Master face index
|
||||
false, // Flip
|
||||
tgtPatchi, // Patch index
|
||||
@ -621,11 +613,7 @@ Foam::autoPtr<Foam::polyTopoChangeMap> Foam::mergePatchPairs::merge
|
||||
}
|
||||
|
||||
// Change mesh and return map
|
||||
return meshMod.changeMesh
|
||||
(
|
||||
mesh_,
|
||||
false // Update mesh without moving points and calculating meshPhi
|
||||
);
|
||||
return meshMod.changeMesh(mesh_);
|
||||
}
|
||||
|
||||
|
||||
|
||||
@ -222,8 +222,6 @@ void Foam::meshCutter::addFace
|
||||
newFace, // face
|
||||
own, // owner
|
||||
nei, // neighbour
|
||||
-1, // master point
|
||||
-1, // master edge
|
||||
facei, // master face for addition
|
||||
false, // flux flip
|
||||
patchID, // patch for face
|
||||
@ -250,8 +248,6 @@ void Foam::meshCutter::addFace
|
||||
newFace.reverseFace(), // face
|
||||
nei, // owner
|
||||
own, // neighbour
|
||||
-1, // master point
|
||||
-1, // master edge
|
||||
facei, // master face for addition
|
||||
false, // flux flip
|
||||
patchID, // patch for face
|
||||
@ -643,17 +639,12 @@ void Foam::meshCutter::setRefinement
|
||||
//
|
||||
face newFace(loopToFace(celli, loop));
|
||||
|
||||
// Pick any anchor point on cell
|
||||
label masterPointi = findInternalFacePoint(anchorPts[celli]);
|
||||
|
||||
label addedFacei =
|
||||
meshMod.addFace
|
||||
(
|
||||
newFace, // face
|
||||
celli, // owner
|
||||
addedCells_[celli], // neighbour
|
||||
masterPointi, // master point
|
||||
-1, // master edge
|
||||
-1, // master face for addition
|
||||
false, // flux flip
|
||||
-1, // patch for face
|
||||
|
||||
@ -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
|
||||
@ -39,7 +39,7 @@ Description
|
||||
master (anchor) point.
|
||||
Think of it as the cell with the anchor points at the bottom. Add a face
|
||||
at the bottom to split the cell and then sweep this face up to be through
|
||||
the middle of the cell (inflation).
|
||||
the middle of the cell.
|
||||
|
||||
|
||||
-# Start:
|
||||
@ -75,7 +75,7 @@ Description
|
||||
\endverbatim
|
||||
|
||||
|
||||
-# Inflation:
|
||||
-# Move face:
|
||||
splitface shifted up to middle of cell (or wherever cut was)
|
||||
\verbatim
|
||||
+-------+
|
||||
@ -90,13 +90,7 @@ Description
|
||||
anchor anchor
|
||||
\endverbatim
|
||||
|
||||
Anyway this was the original idea. Inflation was meant to handle
|
||||
conservative properties distribution without interpolation.
|
||||
(just face sweeping through space). But problem was that
|
||||
only if the introduced splitface was exactly the same shape as bottom face
|
||||
(so same 2D topo or perfectly flat) the volume between them was 0.
|
||||
|
||||
This meshCutting still uses anchorPoints though:
|
||||
This meshCutting uses anchorPoints:
|
||||
- the master cell is the one without the anchor points. The added cell
|
||||
(on top of the splitFace) is the with.
|
||||
- the splitFace is owned by the master cell (since it has the lower number)
|
||||
@ -165,9 +159,7 @@ class meshCutter
|
||||
//- Returns -1 or the cell in cellLabels that is cut.
|
||||
label findCutCell(const cellCuts&, const labelList&) const;
|
||||
|
||||
//- Returns first pointi in pointLabels that uses an internal
|
||||
// face. Used to find point to inflate cell/face from (has to be
|
||||
// connected to internal face)
|
||||
//- Returns first pointi in pointLabels that uses an internal face
|
||||
label findInternalFacePoint(const labelList& pointLabels) const;
|
||||
|
||||
//- Get new owner and neighbour of face. Checks anchor points to see if
|
||||
|
||||
@ -316,16 +316,10 @@ void Foam::multiDirRefinement::refineHex8
|
||||
|
||||
hexRefiner.setRefinement(consistentCells, meshMod);
|
||||
|
||||
// Change mesh, no inflation
|
||||
autoPtr<polyTopoChangeMap> mapPtr =
|
||||
meshMod.changeMesh(mesh, false, true);
|
||||
// Change mesh
|
||||
autoPtr<polyTopoChangeMap> mapPtr = meshMod.changeMesh(mesh, true);
|
||||
const polyTopoChangeMap& map = mapPtr();
|
||||
|
||||
if (map.hasMotionPoints())
|
||||
{
|
||||
mesh.movePoints(map.preMotionPoints());
|
||||
}
|
||||
|
||||
if (writeMesh)
|
||||
{
|
||||
mesh.write();
|
||||
|
||||
@ -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
|
||||
@ -164,17 +164,7 @@ Foam::Map<Foam::label> Foam::refinementIterator::setRefinement
|
||||
// Do all changes
|
||||
//
|
||||
|
||||
autoPtr<polyTopoChangeMap> map = meshMod.changeMesh
|
||||
(
|
||||
mesh_,
|
||||
false
|
||||
);
|
||||
|
||||
// Move mesh (since morphing does not do this)
|
||||
if (map().hasMotionPoints())
|
||||
{
|
||||
mesh_.movePoints(map().preMotionPoints());
|
||||
}
|
||||
autoPtr<polyTopoChangeMap> map = meshMod.changeMesh(mesh_);
|
||||
|
||||
// Update stored refinement pattern
|
||||
meshRefiner_.topoChange(map());
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration | Website: https://openfoam.org
|
||||
\\ / A nd | Copyright (C) 2012-2023 OpenFOAM Foundation
|
||||
\\ / A nd | Copyright (C) 2012-2024 OpenFOAM Foundation
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
@ -89,10 +89,6 @@ Foam::autoPtr<Foam::fvMesh> Foam::polyMeshFilter::copyMesh(const fvMesh& mesh)
|
||||
|
||||
// Update fields
|
||||
meshCopy().topoChange(map);
|
||||
if (map.hasMotionPoints())
|
||||
{
|
||||
meshCopy().movePoints(map.preMotionPoints());
|
||||
}
|
||||
|
||||
copySets(mesh, meshCopy());
|
||||
|
||||
@ -374,19 +370,11 @@ Foam::label Foam::polyMeshFilter::filterFaces
|
||||
Info<< indent << "Apply changes to the current mesh" << endl;
|
||||
|
||||
// Apply changes to current mesh
|
||||
autoPtr<polyTopoChangeMap> newMapPtr = newMeshMod.changeMesh
|
||||
(
|
||||
newMesh,
|
||||
false
|
||||
);
|
||||
autoPtr<polyTopoChangeMap> newMapPtr = newMeshMod.changeMesh(newMesh);
|
||||
const polyTopoChangeMap& newMap = newMapPtr();
|
||||
|
||||
// Update fields
|
||||
newMesh.topoChange(newMap);
|
||||
if (newMap.hasMotionPoints())
|
||||
{
|
||||
newMesh.movePoints(newMap.preMotionPoints());
|
||||
}
|
||||
updateSets(newMap);
|
||||
|
||||
updatePointPriorities(newMesh, newMap.pointMap());
|
||||
@ -491,19 +479,11 @@ Foam::label Foam::polyMeshFilter::filterEdges
|
||||
Info<< indent << "Apply changes to the current mesh" << endl;
|
||||
|
||||
// Apply changes to current mesh
|
||||
autoPtr<polyTopoChangeMap> newMapPtr = newMeshMod.changeMesh
|
||||
(
|
||||
newMesh,
|
||||
false
|
||||
);
|
||||
autoPtr<polyTopoChangeMap> newMapPtr = newMeshMod.changeMesh(newMesh);
|
||||
const polyTopoChangeMap& newMap = newMapPtr();
|
||||
|
||||
// Update fields
|
||||
newMesh.topoChange(newMap);
|
||||
if (newMap.hasMotionPoints())
|
||||
{
|
||||
newMesh.movePoints(newMap.preMotionPoints());
|
||||
}
|
||||
updateSets(newMap);
|
||||
|
||||
// Synchronise the factors
|
||||
|
||||
@ -221,30 +221,13 @@ Foam::label Foam::addPatchCellLayer::addSideFace
|
||||
|
||||
const label ownFacei, // pp face that provides owner
|
||||
const label nbrFacei,
|
||||
const label meshEdgeI, // corresponding mesh edge
|
||||
const label layerI, // layer
|
||||
const label numEdgeFaces, // number of layers for edge
|
||||
const labelList& meshFaces, // precalculated edgeFaces
|
||||
polyTopoChange& meshMod
|
||||
) const
|
||||
{
|
||||
// Face or edge to 'inflate' from
|
||||
label inflateEdgeI = -1;
|
||||
label inflateFacei = -1;
|
||||
|
||||
// Check mesh faces using edge
|
||||
if (addToMesh_)
|
||||
{
|
||||
forAll(meshFaces, i)
|
||||
{
|
||||
if (mesh_.isInternalFace(meshFaces[i]))
|
||||
{
|
||||
// meshEdge uses internal faces so ok to inflate from it
|
||||
inflateEdgeI = meshEdgeI;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
label masterFacei = -1;
|
||||
|
||||
// Zone info comes from any side patch face. Otherwise -1 since we
|
||||
// don't know what to put it in - inherit from the extruded faces?
|
||||
@ -260,8 +243,8 @@ Foam::label Foam::addPatchCellLayer::addSideFace
|
||||
|
||||
const polyBoundaryMesh& patches = mesh_.boundaryMesh();
|
||||
|
||||
// Loop over all faces connected to edge to inflate and
|
||||
// see if we can find a face that is otherPatchID
|
||||
// Loop over all faces connected to edge and see if we can find a face
|
||||
// that is otherPatchID
|
||||
|
||||
// Get my mesh face and its zone.
|
||||
label meshFacei = pp.addressing()[ownFacei];
|
||||
@ -276,9 +259,8 @@ Foam::label Foam::addPatchCellLayer::addSideFace
|
||||
&& (patches.whichPatch(facei) == newPatchID)
|
||||
)
|
||||
{
|
||||
// Found the patch face. Use it to inflate from
|
||||
inflateEdgeI = -1;
|
||||
inflateFacei = facei;
|
||||
// Found the patch face. Use it to map from
|
||||
masterFacei = facei;
|
||||
|
||||
zoneI = mesh_.faceZones().whichZone(facei);
|
||||
if (zoneI != -1)
|
||||
@ -324,9 +306,7 @@ Foam::label Foam::addPatchCellLayer::addSideFace
|
||||
newFace, // face
|
||||
addedCells[ownFacei][layerOwn], // owner
|
||||
-1, // neighbour
|
||||
-1, // master point
|
||||
inflateEdgeI, // master edge
|
||||
inflateFacei, // master face
|
||||
masterFacei, // master face
|
||||
false, // flux flip
|
||||
newPatchID, // patch for face
|
||||
zoneI, // zone for face
|
||||
@ -387,8 +367,6 @@ Foam::label Foam::addPatchCellLayer::addSideFace
|
||||
newFace, // face
|
||||
addedCells[ownFacei][layerOwn], // owner
|
||||
addedCells[nbrFacei][layerNbr], // neighbour
|
||||
-1, // master point
|
||||
inflateEdgeI, // master edge
|
||||
-1, // master face
|
||||
false, // flux flip
|
||||
-1, // patch for face
|
||||
@ -551,8 +529,7 @@ void Foam::addPatchCellLayer::calcSidePatch
|
||||
// - whether face is created from other face or edge
|
||||
// - what zone&orientation face should have
|
||||
|
||||
labelList inflateEdgeI(pp.nEdges(), -1);
|
||||
labelList inflateFacei(pp.nEdges(), -1);
|
||||
labelList masterFacei(pp.nEdges(), -1);
|
||||
|
||||
nPatches = patches.size();
|
||||
|
||||
@ -638,8 +615,7 @@ void Foam::addPatchCellLayer::calcSidePatch
|
||||
if (facei != myFacei && !mesh.isInternalFace(facei))
|
||||
{
|
||||
sidePatchID[edgeI] = mesh.boundaryMesh().whichPatch(facei);
|
||||
inflateFacei[edgeI] = facei;
|
||||
inflateEdgeI[edgeI] = -1;
|
||||
masterFacei[edgeI] = facei;
|
||||
|
||||
break;
|
||||
}
|
||||
@ -648,7 +624,6 @@ void Foam::addPatchCellLayer::calcSidePatch
|
||||
}
|
||||
|
||||
|
||||
|
||||
// Now hopefully every boundary edge has a side patch. Check
|
||||
if (debug)
|
||||
{
|
||||
@ -667,19 +642,17 @@ void Foam::addPatchCellLayer::calcSidePatch
|
||||
}
|
||||
|
||||
|
||||
|
||||
// Now we have sidepatch see if we have patchface or edge to inflate
|
||||
// from.
|
||||
// Now we have sidepatch see if we have patchface or edge to map from
|
||||
forAll(edgeFaces, edgeI)
|
||||
{
|
||||
if
|
||||
(
|
||||
edgeFaces[edgeI].size() == 1
|
||||
&& sidePatchID[edgeI] != -1
|
||||
&& inflateFacei[edgeI] == -1
|
||||
&& masterFacei[edgeI] == -1
|
||||
)
|
||||
{
|
||||
// 1. Do we have a boundary face to inflate from
|
||||
// 1. Do we have a boundary face to map from
|
||||
|
||||
label myFacei = pp.addressing()[edgeFaces[edgeI][0]];
|
||||
|
||||
@ -693,26 +666,18 @@ void Foam::addPatchCellLayer::calcSidePatch
|
||||
|
||||
forAll(meshFaces, k)
|
||||
{
|
||||
label facei = meshFaces[k];
|
||||
const label facei = meshFaces[k];
|
||||
|
||||
if (facei != myFacei)
|
||||
if
|
||||
(
|
||||
facei != myFacei
|
||||
&& !mesh.isInternalFace(facei)
|
||||
&& patches.whichPatch(facei) == sidePatchID[edgeI]
|
||||
)
|
||||
{
|
||||
if (mesh.isInternalFace(facei))
|
||||
{
|
||||
inflateEdgeI[edgeI] = meshEdgeI;
|
||||
}
|
||||
else
|
||||
{
|
||||
if (patches.whichPatch(facei) == sidePatchID[edgeI])
|
||||
{
|
||||
sidePatchID[edgeI] =
|
||||
mesh.boundaryMesh().whichPatch(facei);
|
||||
inflateFacei[edgeI] = facei;
|
||||
inflateEdgeI[edgeI] = -1;
|
||||
|
||||
break;
|
||||
}
|
||||
}
|
||||
sidePatchID[edgeI] = mesh.boundaryMesh().whichPatch(facei);
|
||||
masterFacei[edgeI] = facei;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -1193,8 +1158,6 @@ void Foam::addPatchCellLayer::setRefinement
|
||||
newFace, // face
|
||||
addedCells[patchFacei][i], // owner
|
||||
nei, // neighbour
|
||||
-1, // master point
|
||||
-1, // master edge
|
||||
(addToMesh_ ? meshFacei : -1), // master face
|
||||
false, // flux flip
|
||||
patchi, // patch for face
|
||||
@ -1262,8 +1225,6 @@ void Foam::addPatchCellLayer::setRefinement
|
||||
f, // modified face
|
||||
addedCells[patchFacei][0], // owner
|
||||
-1, // neighbour
|
||||
-1, // masterPoint
|
||||
-1, // masterEdge
|
||||
-1, // masterFace
|
||||
true, // face flip
|
||||
exposedPatchID[patchFacei], // patch for face
|
||||
@ -1628,7 +1589,6 @@ void Foam::addPatchCellLayer::setRefinement
|
||||
|
||||
patchFacei,
|
||||
nbrFacei,
|
||||
meshEdgeI, // (mesh) edge to inflate
|
||||
i, // layer
|
||||
numEdgeSideFaces, // num layers
|
||||
meshFaces, // edgeFaces
|
||||
|
||||
@ -229,7 +229,6 @@ class addPatchCellLayer
|
||||
|
||||
const label ownFacei,
|
||||
const label nbrFacei,
|
||||
const label meshEdgeI,
|
||||
const label layerI,
|
||||
const label numEdgeFaces,
|
||||
const labelList& meshFaces,
|
||||
|
||||
@ -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
|
||||
@ -969,8 +969,6 @@ void Foam::combineFaces::setUnrefinement
|
||||
faces[i], // vertices
|
||||
own, // owner,
|
||||
-1, // neighbour,
|
||||
-1, // masterPointID,
|
||||
-1, // masterEdgeID,
|
||||
masterFacei, // masterFaceID,
|
||||
false, // flipFaceFlux,
|
||||
patchi, // patchID,
|
||||
|
||||
@ -141,8 +141,6 @@ Foam::label Foam::hexRef8::addFace
|
||||
newFace, // face
|
||||
own, // owner
|
||||
nei, // neighbour
|
||||
-1, // master point
|
||||
-1, // master edge
|
||||
facei, // master face for addition
|
||||
false, // flux flip
|
||||
patchID, // patch for face
|
||||
@ -158,8 +156,6 @@ Foam::label Foam::hexRef8::addFace
|
||||
newFace.reverseFace(), // face
|
||||
nei, // owner
|
||||
own, // neighbour
|
||||
-1, // master point
|
||||
-1, // master edge
|
||||
facei, // master face for addition
|
||||
false, // flux flip
|
||||
patchID, // patch for face
|
||||
@ -188,8 +184,6 @@ Foam::label Foam::hexRef8::addInternalFace
|
||||
newFace, // face
|
||||
own, // owner
|
||||
nei, // neighbour
|
||||
-1, // master point
|
||||
-1, // master edge
|
||||
meshFacei, // master face for addition
|
||||
false, // flux flip
|
||||
-1, // patch for face
|
||||
@ -199,60 +193,19 @@ Foam::label Foam::hexRef8::addInternalFace
|
||||
}
|
||||
else
|
||||
{
|
||||
// Two choices:
|
||||
// - append (i.e. create out of nothing - will not be mapped)
|
||||
// problem: field does not get mapped.
|
||||
// - inflate from point.
|
||||
// problem: does interpolative mapping which constructs full
|
||||
// volPointInterpolation!
|
||||
|
||||
// For now create out of nothing
|
||||
|
||||
// problem: field does not get mapped.
|
||||
return meshMod.addFace
|
||||
(
|
||||
newFace, // face
|
||||
own, // owner
|
||||
nei, // neighbour
|
||||
-1, // master point
|
||||
-1, // master edge
|
||||
-1, // master face for addition
|
||||
false, // flux flip
|
||||
-1, // patch for face
|
||||
-1, // zone for face
|
||||
false // face zone flip
|
||||
);
|
||||
|
||||
|
||||
////- Inflate-from-point:
|
||||
//// Check if point has any internal faces we can use.
|
||||
// label masterPointi = -1;
|
||||
//
|
||||
// const labelList& pFaces = mesh_.pointFaces()[meshPointi];
|
||||
//
|
||||
// forAll(pFaces, i)
|
||||
//{
|
||||
// if (mesh_.isInternalFace(pFaces[i]))
|
||||
// {
|
||||
// // meshPoint uses internal faces so ok to inflate from it
|
||||
// masterPointi = meshPointi;
|
||||
//
|
||||
// break;
|
||||
// }
|
||||
//}
|
||||
//
|
||||
// return meshMod.addFace
|
||||
// (
|
||||
// newFace, // face
|
||||
// own, // owner
|
||||
// nei, // neighbour
|
||||
// masterPointi, // master point
|
||||
// -1, // master edge
|
||||
// -1, // master face for addition
|
||||
// false, // flux flip
|
||||
// -1, // patch for face
|
||||
// -1, // zone for face
|
||||
// false // face zone flip
|
||||
// );
|
||||
}
|
||||
}
|
||||
|
||||
@ -4284,18 +4237,6 @@ void Foam::hexRef8::topoChange
|
||||
}
|
||||
cellLevel_[newCelli] = fnd();
|
||||
}
|
||||
|
||||
// if (findIndex(cellLevel_, -1) != -1)
|
||||
//{
|
||||
// WarningInFunction
|
||||
// << "Problem : "
|
||||
// << "cellLevel_ contains illegal value -1 after mapping
|
||||
// << " at cell " << findIndex(cellLevel_, -1) << endl
|
||||
// << "This means that another program has inflated cells"
|
||||
// << " (created cells out-of-nothing) and hence we don't know"
|
||||
// << " their cell level. Continuing with illegal value."
|
||||
// << abort(FatalError);
|
||||
//}
|
||||
}
|
||||
|
||||
|
||||
@ -4321,13 +4262,6 @@ void Foam::hexRef8::topoChange
|
||||
|
||||
if (oldPointi == -1)
|
||||
{
|
||||
// FatalErrorInFunction
|
||||
// << "Problem : point " << newPointi
|
||||
// << " at " << mesh_.points()[newPointi]
|
||||
// << " does not originate from another point"
|
||||
// << " (i.e. is inflated)." << nl
|
||||
// << "Hence we cannot determine the new pointLevel"
|
||||
// << " for it." << abort(FatalError);
|
||||
newPointLevel[newPointi] = -1;
|
||||
}
|
||||
else
|
||||
@ -4358,18 +4292,6 @@ void Foam::hexRef8::topoChange
|
||||
}
|
||||
pointLevel_[newPointi] = fnd();
|
||||
}
|
||||
|
||||
// if (findIndex(pointLevel_, -1) != -1)
|
||||
//{
|
||||
// WarningInFunction
|
||||
// << "Problem : "
|
||||
// << "pointLevel_ contains illegal value -1 after mapping"
|
||||
// << " at point" << findIndex(pointLevel_, -1) << endl
|
||||
// << "This means that another program has inflated points"
|
||||
// << " (created points out-of-nothing) and hence we don't know"
|
||||
// << " their point level. Continuing with illegal value."
|
||||
// //<< abort(FatalError);
|
||||
//}
|
||||
}
|
||||
|
||||
// Update refinement tree
|
||||
|
||||
@ -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
|
||||
@ -480,8 +480,7 @@ public:
|
||||
// from original
|
||||
// -added internal faces: added from original cell face(if
|
||||
// that was internal) or created out-of-nothing (so will not
|
||||
// get mapped!). Note: could make this inflate from point but
|
||||
// that will allocate interpolation.
|
||||
// get mapped!).
|
||||
// -points added to split edge: added from edge start()
|
||||
// -midpoints added: added from cellPoints[0].
|
||||
labelListList setRefinement
|
||||
|
||||
@ -112,14 +112,14 @@ void Foam::polyTopoChange::countMap
|
||||
(
|
||||
const labelList& map,
|
||||
const labelList& reverseMap,
|
||||
label& nAdd,
|
||||
label& nInflate,
|
||||
label& nSplit,
|
||||
label& nInserted,
|
||||
label& nMerge,
|
||||
label& nRemove
|
||||
)
|
||||
{
|
||||
nAdd = 0;
|
||||
nInflate = 0;
|
||||
nSplit = 0;
|
||||
nInserted = 0;
|
||||
nMerge = 0;
|
||||
nRemove = 0;
|
||||
|
||||
@ -135,14 +135,14 @@ void Foam::polyTopoChange::countMap
|
||||
}
|
||||
else
|
||||
{
|
||||
// Added (from another cell v.s. inflated from face/point)
|
||||
nAdd++;
|
||||
// Added from another cell
|
||||
nSplit++;
|
||||
}
|
||||
}
|
||||
else if (oldCelli == -1)
|
||||
{
|
||||
// Created from nothing
|
||||
nInflate++;
|
||||
nInserted++;
|
||||
}
|
||||
else
|
||||
{
|
||||
@ -869,8 +869,6 @@ void Foam::polyTopoChange::reorderCompactFaces
|
||||
|
||||
renumberReverseMap(oldToNew, reverseFaceMap_);
|
||||
|
||||
renumberKey(oldToNew, faceFromPoint_);
|
||||
renumberKey(oldToNew, faceFromEdge_);
|
||||
inplaceReorder(oldToNew, flipFaceFlux_);
|
||||
flipFaceFlux_.setCapacity(newSize);
|
||||
renumberKey(oldToNew, faceZone_);
|
||||
@ -1155,10 +1153,6 @@ void Foam::polyTopoChange::compact
|
||||
reorder(localCellMap, cellZone_);
|
||||
cellZone_.setCapacity(newCelli);
|
||||
|
||||
renumberKey(localCellMap, cellFromPoint_);
|
||||
renumberKey(localCellMap, cellFromEdge_);
|
||||
renumberKey(localCellMap, cellFromFace_);
|
||||
|
||||
// Renumber owner/neighbour. Take into account if neighbour suddenly
|
||||
// gets lower cell than owner.
|
||||
forAll(faceOwner_, facei)
|
||||
@ -1330,118 +1324,6 @@ void Foam::polyTopoChange::calcPatchPointMap
|
||||
}
|
||||
|
||||
|
||||
void Foam::polyTopoChange::calcFaceInflationMaps
|
||||
(
|
||||
const polyMesh& mesh,
|
||||
List<objectMap>& facesFromPoints,
|
||||
List<objectMap>& facesFromEdges,
|
||||
List<objectMap>& facesFromFaces
|
||||
) const
|
||||
{
|
||||
// Faces inflated from points
|
||||
// ~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
facesFromPoints.setSize(faceFromPoint_.size());
|
||||
|
||||
if (faceFromPoint_.size())
|
||||
{
|
||||
label nFacesFromPoints = 0;
|
||||
|
||||
// Collect all still existing faces connected to this point.
|
||||
forAllConstIter(Map<label>, faceFromPoint_, iter)
|
||||
{
|
||||
label newFacei = iter.key();
|
||||
|
||||
if (region_[newFacei] == -1)
|
||||
{
|
||||
// Get internal faces using point on old mesh
|
||||
facesFromPoints[nFacesFromPoints++] = objectMap
|
||||
(
|
||||
newFacei,
|
||||
selectFaces
|
||||
(
|
||||
mesh,
|
||||
mesh.pointFaces()[iter()],
|
||||
true
|
||||
)
|
||||
);
|
||||
}
|
||||
else
|
||||
{
|
||||
// Get patch faces using point on old mesh
|
||||
facesFromPoints[nFacesFromPoints++] = objectMap
|
||||
(
|
||||
newFacei,
|
||||
selectFaces
|
||||
(
|
||||
mesh,
|
||||
mesh.pointFaces()[iter()],
|
||||
false
|
||||
)
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// Faces inflated from edges
|
||||
// ~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
facesFromEdges.setSize(faceFromEdge_.size());
|
||||
|
||||
if (faceFromEdge_.size())
|
||||
{
|
||||
label nFacesFromEdges = 0;
|
||||
|
||||
// Collect all still existing faces connected to this edge.
|
||||
forAllConstIter(Map<label>, faceFromEdge_, iter)
|
||||
{
|
||||
label newFacei = iter.key();
|
||||
|
||||
if (region_[newFacei] == -1)
|
||||
{
|
||||
// Get internal faces using edge on old mesh
|
||||
facesFromEdges[nFacesFromEdges++] = objectMap
|
||||
(
|
||||
newFacei,
|
||||
selectFaces
|
||||
(
|
||||
mesh,
|
||||
mesh.edgeFaces(iter()),
|
||||
true
|
||||
)
|
||||
);
|
||||
}
|
||||
else
|
||||
{
|
||||
// Get patch faces using edge on old mesh
|
||||
facesFromEdges[nFacesFromEdges++] = objectMap
|
||||
(
|
||||
newFacei,
|
||||
selectFaces
|
||||
(
|
||||
mesh,
|
||||
mesh.edgeFaces(iter()),
|
||||
false
|
||||
)
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// Faces from face merging
|
||||
// ~~~~~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
getMergeSets
|
||||
(
|
||||
reverseFaceMap_,
|
||||
faceMap_,
|
||||
facesFromFaces
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
void Foam::polyTopoChange::resetZones
|
||||
(
|
||||
const polyMesh& mesh,
|
||||
@ -1839,8 +1721,6 @@ void Foam::polyTopoChange::compactAndReorder
|
||||
labelList& patchSizes,
|
||||
labelList& patchStarts,
|
||||
List<objectMap>& pointsFromPoints,
|
||||
List<objectMap>& facesFromPoints,
|
||||
List<objectMap>& facesFromEdges,
|
||||
List<objectMap>& facesFromFaces,
|
||||
List<objectMap>& cellsFromCells,
|
||||
List<Map<label>>& oldPatchMeshPointMaps,
|
||||
@ -1879,14 +1759,13 @@ void Foam::polyTopoChange::compactAndReorder
|
||||
);
|
||||
|
||||
|
||||
// Calculate inflation/merging maps
|
||||
// Calculate merging maps
|
||||
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
// These are for the new face(/point/cell) the old faces whose value
|
||||
// needs to be
|
||||
// averaged/summed to get the new value. These old faces come either from
|
||||
// merged old faces (face remove into other face),
|
||||
// the old edgeFaces (inflate from edge) or the old pointFaces (inflate
|
||||
// from point). As an additional complexity will use only internal faces
|
||||
// merged old faces (face remove into other face).
|
||||
// As an additional complexity will use only internal faces
|
||||
// to create new value for internal face and vice versa only patch
|
||||
// faces to to create patch face value.
|
||||
|
||||
@ -1898,11 +1777,10 @@ void Foam::polyTopoChange::compactAndReorder
|
||||
pointsFromPoints
|
||||
);
|
||||
|
||||
calcFaceInflationMaps
|
||||
getMergeSets
|
||||
(
|
||||
mesh,
|
||||
facesFromPoints,
|
||||
facesFromEdges,
|
||||
reverseFaceMap_,
|
||||
faceMap_,
|
||||
facesFromFaces
|
||||
);
|
||||
|
||||
@ -1913,17 +1791,6 @@ void Foam::polyTopoChange::compactAndReorder
|
||||
cellsFromCells
|
||||
);
|
||||
|
||||
// Clear inflation info
|
||||
{
|
||||
faceFromPoint_.clearStorage();
|
||||
faceFromEdge_.clearStorage();
|
||||
|
||||
cellFromPoint_.clearStorage();
|
||||
cellFromEdge_.clearStorage();
|
||||
cellFromFace_.clearStorage();
|
||||
}
|
||||
|
||||
|
||||
const polyBoundaryMesh& boundary = mesh.boundaryMesh();
|
||||
|
||||
// Grab patch mesh point maps
|
||||
@ -1971,17 +1838,12 @@ Foam::polyTopoChange::polyTopoChange(const label nPatches, const bool strict)
|
||||
faceNeighbour_(0),
|
||||
faceMap_(0),
|
||||
reverseFaceMap_(0),
|
||||
faceFromPoint_(0),
|
||||
faceFromEdge_(0),
|
||||
flipFaceFlux_(0),
|
||||
faceZone_(0),
|
||||
faceZoneFlip_(0),
|
||||
nActiveFaces_(0),
|
||||
cellMap_(0),
|
||||
reverseCellMap_(0),
|
||||
cellFromPoint_(0),
|
||||
cellFromEdge_(0),
|
||||
cellFromFace_(0),
|
||||
cellZone_(0)
|
||||
{}
|
||||
|
||||
@ -2006,17 +1868,12 @@ Foam::polyTopoChange::polyTopoChange
|
||||
faceNeighbour_(0),
|
||||
faceMap_(0),
|
||||
reverseFaceMap_(0),
|
||||
faceFromPoint_(0),
|
||||
faceFromEdge_(0),
|
||||
flipFaceFlux_(0),
|
||||
faceZone_(0),
|
||||
faceZoneFlip_(0),
|
||||
nActiveFaces_(0),
|
||||
cellMap_(0),
|
||||
reverseCellMap_(0),
|
||||
cellFromPoint_(0),
|
||||
cellFromEdge_(0),
|
||||
cellFromFace_(0),
|
||||
cellZone_(0)
|
||||
{
|
||||
// Add points
|
||||
@ -2069,9 +1926,6 @@ Foam::polyTopoChange::polyTopoChange
|
||||
|
||||
cellMap_.setCapacity(cellMap_.size() + nAllCells);
|
||||
reverseCellMap_.setCapacity(reverseCellMap_.size() + nAllCells);
|
||||
cellFromPoint_.resize(cellFromPoint_.size() + nAllCells/100);
|
||||
cellFromEdge_.resize(cellFromEdge_.size() + nAllCells/100);
|
||||
cellFromFace_.resize(cellFromFace_.size() + nAllCells/100);
|
||||
cellZone_.setCapacity(cellZone_.size() + nAllCells);
|
||||
|
||||
|
||||
@ -2129,8 +1983,6 @@ Foam::polyTopoChange::polyTopoChange
|
||||
faceNeighbour_.setCapacity(faceNeighbour_.size() + nAllFaces);
|
||||
faceMap_.setCapacity(faceMap_.size() + nAllFaces);
|
||||
reverseFaceMap_.setCapacity(reverseFaceMap_.size() + nAllFaces);
|
||||
faceFromPoint_.resize(faceFromPoint_.size() + nAllFaces/100);
|
||||
faceFromEdge_.resize(faceFromEdge_.size() + nAllFaces/100);
|
||||
flipFaceFlux_.setCapacity(faces_.size() + nAllFaces);
|
||||
faceZone_.resize(faceZone_.size() + nAllFaces/100);
|
||||
faceZoneFlip_.setCapacity(faces_.size() + nAllFaces);
|
||||
@ -2162,8 +2014,6 @@ Foam::polyTopoChange::polyTopoChange
|
||||
faces[facei],
|
||||
faceOwner[facei],
|
||||
faceNeighbour[facei],
|
||||
-1, // masterPointID
|
||||
-1, // masterEdgeID
|
||||
facei, // masterFaceID
|
||||
false, // flipFaceFlux
|
||||
-1, // patchID
|
||||
@ -2196,8 +2046,6 @@ Foam::polyTopoChange::polyTopoChange
|
||||
faces[facei],
|
||||
faceOwner[facei],
|
||||
-1, // neighbour
|
||||
-1, // masterPointID
|
||||
-1, // masterEdgeID
|
||||
facei, // masterFaceID
|
||||
false, // flipFaceFlux
|
||||
patchi, // patchID
|
||||
@ -2227,8 +2075,6 @@ void Foam::polyTopoChange::clear()
|
||||
faceNeighbour_.clearStorage();
|
||||
faceMap_.clearStorage();
|
||||
reverseFaceMap_.clearStorage();
|
||||
faceFromPoint_.clearStorage();
|
||||
faceFromEdge_.clearStorage();
|
||||
flipFaceFlux_.clearStorage();
|
||||
faceZone_.clearStorage();
|
||||
faceZoneFlip_.clearStorage();
|
||||
@ -2237,9 +2083,6 @@ void Foam::polyTopoChange::clear()
|
||||
cellMap_.clearStorage();
|
||||
reverseCellMap_.clearStorage();
|
||||
cellZone_.clearStorage();
|
||||
cellFromPoint_.clearStorage();
|
||||
cellFromEdge_.clearStorage();
|
||||
cellFromFace_.clearStorage();
|
||||
}
|
||||
|
||||
|
||||
@ -2261,17 +2104,12 @@ void Foam::polyTopoChange::setCapacity
|
||||
faceNeighbour_.setCapacity(nFaces);
|
||||
faceMap_.setCapacity(nFaces);
|
||||
reverseFaceMap_.setCapacity(nFaces);
|
||||
faceFromPoint_.resize(faceFromPoint_.size() + nFaces/100);
|
||||
faceFromEdge_.resize(faceFromEdge_.size() + nFaces/100);
|
||||
flipFaceFlux_.setCapacity(nFaces);
|
||||
faceZone_.resize(faceZone_.size() + nFaces/100);
|
||||
faceZoneFlip_.setCapacity(nFaces);
|
||||
|
||||
cellMap_.setCapacity(nCells);
|
||||
reverseCellMap_.setCapacity(nCells);
|
||||
cellFromPoint_.resize(cellFromPoint_.size() + nCells/100);
|
||||
cellFromEdge_.resize(cellFromEdge_.size() + nCells/100);
|
||||
cellFromFace_.resize(cellFromFace_.size() + nCells/100);
|
||||
cellZone_.setCapacity(nCells);
|
||||
}
|
||||
|
||||
@ -2504,8 +2342,6 @@ Foam::label Foam::polyTopoChange::addFace
|
||||
const face& f,
|
||||
const label own,
|
||||
const label nei,
|
||||
const label masterPointID,
|
||||
const label masterEdgeID,
|
||||
const label masterFaceID,
|
||||
const bool flipFaceFlux,
|
||||
const label patchID,
|
||||
@ -2526,23 +2362,13 @@ Foam::label Foam::polyTopoChange::addFace
|
||||
faceOwner_.append(own);
|
||||
faceNeighbour_.append(nei);
|
||||
|
||||
if (masterPointID >= 0)
|
||||
{
|
||||
faceMap_.append(-1);
|
||||
faceFromPoint_.insert(facei, masterPointID);
|
||||
}
|
||||
else if (masterEdgeID >= 0)
|
||||
{
|
||||
faceMap_.append(-1);
|
||||
faceFromEdge_.insert(facei, masterEdgeID);
|
||||
}
|
||||
else if (masterFaceID >= 0)
|
||||
if (masterFaceID >= 0)
|
||||
{
|
||||
faceMap_.append(masterFaceID);
|
||||
}
|
||||
else
|
||||
{
|
||||
// Allow inflate-from-nothing?
|
||||
// Allow insert-from-nothing?
|
||||
// FatalErrorInFunction
|
||||
// << "Need to specify a master point, edge or face"
|
||||
// << "face:" << f << " own:" << own << " nei:" << nei
|
||||
@ -2644,8 +2470,6 @@ void Foam::polyTopoChange::removeFace(const label facei, const label mergeFacei)
|
||||
{
|
||||
reverseFaceMap_[facei] = -1;
|
||||
}
|
||||
faceFromEdge_.erase(facei);
|
||||
faceFromPoint_.erase(facei);
|
||||
flipFaceFlux_[facei] = 0;
|
||||
faceZone_.erase(facei);
|
||||
faceZoneFlip_[facei] = 0;
|
||||
@ -2704,9 +2528,6 @@ void Foam::polyTopoChange::removeCell(const label celli, const label mergeCelli)
|
||||
{
|
||||
reverseCellMap_[celli] = -1;
|
||||
}
|
||||
cellFromPoint_.erase(celli);
|
||||
cellFromEdge_.erase(celli);
|
||||
cellFromFace_.erase(celli);
|
||||
cellZone_[celli] = -1;
|
||||
}
|
||||
|
||||
@ -2714,7 +2535,6 @@ void Foam::polyTopoChange::removeCell(const label celli, const label mergeCelli)
|
||||
Foam::autoPtr<Foam::polyTopoChangeMap> Foam::polyTopoChange::changeMesh
|
||||
(
|
||||
polyMesh& mesh,
|
||||
const bool inflate,
|
||||
const bool syncParallel,
|
||||
const bool orderCells,
|
||||
const bool orderPoints
|
||||
@ -2740,10 +2560,8 @@ Foam::autoPtr<Foam::polyTopoChangeMap> Foam::polyTopoChange::changeMesh
|
||||
// patch slicing
|
||||
labelList patchSizes;
|
||||
labelList patchStarts;
|
||||
// inflate maps
|
||||
// maps
|
||||
List<objectMap> pointsFromPoints;
|
||||
List<objectMap> facesFromPoints;
|
||||
List<objectMap> facesFromEdges;
|
||||
List<objectMap> facesFromFaces;
|
||||
List<objectMap> cellsFromCells;
|
||||
// old mesh info
|
||||
@ -2765,8 +2583,6 @@ Foam::autoPtr<Foam::polyTopoChangeMap> Foam::polyTopoChange::changeMesh
|
||||
patchSizes,
|
||||
patchStarts,
|
||||
pointsFromPoints,
|
||||
facesFromPoints,
|
||||
facesFromEdges,
|
||||
facesFromFaces,
|
||||
cellsFromCells,
|
||||
oldPatchMeshPointMaps,
|
||||
@ -2786,60 +2602,17 @@ Foam::autoPtr<Foam::polyTopoChangeMap> Foam::polyTopoChange::changeMesh
|
||||
// This will invalidate any addressing so better make sure you have
|
||||
// all the information you need!!!
|
||||
|
||||
if (inflate)
|
||||
{
|
||||
// Keep (renumbered) mesh points, store new points in map for inflation
|
||||
// (appended points (i.e. from nowhere) get value as provided in
|
||||
// addPoints)
|
||||
pointField renumberedMeshPoints(newPoints.size());
|
||||
|
||||
forAll(pointMap_, newPointi)
|
||||
{
|
||||
Map<point>::const_iterator iter = oldPoints_.find(newPointi);
|
||||
if (iter != oldPoints_.end())
|
||||
{
|
||||
renumberedMeshPoints[newPointi] = iter();
|
||||
}
|
||||
else
|
||||
{
|
||||
label oldPointi = pointMap_[newPointi];
|
||||
|
||||
if (oldPointi >= 0)
|
||||
{
|
||||
renumberedMeshPoints[newPointi] = mesh.points()[oldPointi];
|
||||
}
|
||||
else
|
||||
{
|
||||
renumberedMeshPoints[newPointi] = vector::zero;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
mesh.resetPrimitives
|
||||
(
|
||||
move(renumberedMeshPoints),
|
||||
move(faces_),
|
||||
move(faceOwner_),
|
||||
move(faceNeighbour_),
|
||||
patchSizes,
|
||||
patchStarts,
|
||||
syncParallel
|
||||
);
|
||||
}
|
||||
else
|
||||
{
|
||||
// Set new points.
|
||||
mesh.resetPrimitives
|
||||
(
|
||||
move(newPoints),
|
||||
move(faces_),
|
||||
move(faceOwner_),
|
||||
move(faceNeighbour_),
|
||||
patchSizes,
|
||||
patchStarts,
|
||||
syncParallel
|
||||
);
|
||||
}
|
||||
// Set new points.
|
||||
mesh.resetPrimitives
|
||||
(
|
||||
move(newPoints),
|
||||
move(faces_),
|
||||
move(faceOwner_),
|
||||
move(faceNeighbour_),
|
||||
patchSizes,
|
||||
patchStarts,
|
||||
syncParallel
|
||||
);
|
||||
|
||||
// Clear out primitives
|
||||
{
|
||||
@ -2852,27 +2625,35 @@ Foam::autoPtr<Foam::polyTopoChangeMap> Foam::polyTopoChange::changeMesh
|
||||
if (debug)
|
||||
{
|
||||
// Some stats on changes
|
||||
label nAdd, nInflate, nMerge, nRemove;
|
||||
countMap(pointMap_, reversePointMap_, nAdd, nInflate, nMerge, nRemove);
|
||||
label nSplit, nInserted, nMerge, nRemove;
|
||||
countMap
|
||||
(
|
||||
pointMap_,
|
||||
reversePointMap_,
|
||||
nSplit,
|
||||
nInserted,
|
||||
nMerge,
|
||||
nRemove
|
||||
);
|
||||
Pout<< "Points:"
|
||||
<< " added(from point):" << nAdd
|
||||
<< " added(from nothing):" << nInflate
|
||||
<< " added(from point):" << nSplit
|
||||
<< " added(from nothing):" << nInserted
|
||||
<< " merged(into other point):" << nMerge
|
||||
<< " removed:" << nRemove
|
||||
<< nl;
|
||||
|
||||
countMap(faceMap_, reverseFaceMap_, nAdd, nInflate, nMerge, nRemove);
|
||||
countMap(faceMap_, reverseFaceMap_, nSplit, nInserted, nMerge, nRemove);
|
||||
Pout<< "Faces:"
|
||||
<< " added(from face):" << nAdd
|
||||
<< " added(inflated):" << nInflate
|
||||
<< " added(from face):" << nSplit
|
||||
<< " added(from nothing):" << nInserted
|
||||
<< " merged(into other face):" << nMerge
|
||||
<< " removed:" << nRemove
|
||||
<< nl;
|
||||
|
||||
countMap(cellMap_, reverseCellMap_, nAdd, nInflate, nMerge, nRemove);
|
||||
countMap(cellMap_, reverseCellMap_, nSplit, nInserted, nMerge, nRemove);
|
||||
Pout<< "Cells:"
|
||||
<< " added(from cell):" << nAdd
|
||||
<< " added(inflated):" << nInflate
|
||||
<< " added(from cell):" << nSplit
|
||||
<< " added(from nothing):" << nInserted
|
||||
<< " merged(into other cell):" << nMerge
|
||||
<< " removed:" << nRemove
|
||||
<< nl
|
||||
@ -2929,8 +2710,6 @@ Foam::autoPtr<Foam::polyTopoChangeMap> Foam::polyTopoChange::changeMesh
|
||||
pointsFromPoints,
|
||||
|
||||
faceMap_,
|
||||
facesFromPoints,
|
||||
facesFromEdges,
|
||||
facesFromFaces,
|
||||
|
||||
cellMap_,
|
||||
@ -2944,7 +2723,6 @@ Foam::autoPtr<Foam::polyTopoChangeMap> Foam::polyTopoChange::changeMesh
|
||||
|
||||
patchPointMap,
|
||||
|
||||
newPoints, // if empty signals no inflation.
|
||||
oldPatchStarts,
|
||||
oldPatchNMeshPoints,
|
||||
|
||||
@ -2971,7 +2749,7 @@ Foam::autoPtr<Foam::polyTopoChangeMap> Foam::polyTopoChange::makeMesh
|
||||
{
|
||||
if (debug)
|
||||
{
|
||||
Pout<< "polyTopoChange::changeMesh"
|
||||
Pout<< "polyTopoChange::makeMesh"
|
||||
<< "(autoPtr<fvMesh>&, const IOobject&, const fvMesh&"
|
||||
<< ", const bool, const bool, const bool)"
|
||||
<< endl;
|
||||
@ -2990,10 +2768,8 @@ Foam::autoPtr<Foam::polyTopoChangeMap> Foam::polyTopoChange::makeMesh
|
||||
// patch slicing
|
||||
labelList patchSizes;
|
||||
labelList patchStarts;
|
||||
// inflate maps
|
||||
// maps
|
||||
List<objectMap> pointsFromPoints;
|
||||
List<objectMap> facesFromPoints;
|
||||
List<objectMap> facesFromEdges;
|
||||
List<objectMap> facesFromFaces;
|
||||
List<objectMap> cellsFromCells;
|
||||
|
||||
@ -3016,8 +2792,6 @@ Foam::autoPtr<Foam::polyTopoChangeMap> Foam::polyTopoChange::makeMesh
|
||||
patchSizes,
|
||||
patchStarts,
|
||||
pointsFromPoints,
|
||||
facesFromPoints,
|
||||
facesFromEdges,
|
||||
facesFromFaces,
|
||||
cellsFromCells,
|
||||
oldPatchMeshPointMaps,
|
||||
@ -3061,27 +2835,36 @@ Foam::autoPtr<Foam::polyTopoChangeMap> Foam::polyTopoChange::makeMesh
|
||||
if (debug)
|
||||
{
|
||||
// Some stats on changes
|
||||
label nAdd, nInflate, nMerge, nRemove;
|
||||
countMap(pointMap_, reversePointMap_, nAdd, nInflate, nMerge, nRemove);
|
||||
label nSplit, nInserted, nMerge, nRemove;
|
||||
countMap
|
||||
(
|
||||
pointMap_,
|
||||
reversePointMap_,
|
||||
nSplit,
|
||||
nInserted,
|
||||
nMerge,
|
||||
nRemove
|
||||
);
|
||||
|
||||
Pout<< "Points:"
|
||||
<< " added(from point):" << nAdd
|
||||
<< " added(from nothing):" << nInflate
|
||||
<< " added(from point):" << nSplit
|
||||
<< " added(from nothing):" << nInserted
|
||||
<< " merged(into other point):" << nMerge
|
||||
<< " removed:" << nRemove
|
||||
<< nl;
|
||||
|
||||
countMap(faceMap_, reverseFaceMap_, nAdd, nInflate, nMerge, nRemove);
|
||||
countMap(faceMap_, reverseFaceMap_, nSplit, nInserted, nMerge, nRemove);
|
||||
Pout<< "Faces:"
|
||||
<< " added(from face):" << nAdd
|
||||
<< " added(inflated):" << nInflate
|
||||
<< " added(from face):" << nSplit
|
||||
<< " added(from nothing):" << nInserted
|
||||
<< " merged(into other face):" << nMerge
|
||||
<< " removed:" << nRemove
|
||||
<< nl;
|
||||
|
||||
countMap(cellMap_, reverseCellMap_, nAdd, nInflate, nMerge, nRemove);
|
||||
countMap(cellMap_, reverseCellMap_, nSplit, nInserted, nMerge, nRemove);
|
||||
Pout<< "Cells:"
|
||||
<< " added(from cell):" << nAdd
|
||||
<< " added(inflated):" << nInflate
|
||||
<< " added(from cell):" << nSplit
|
||||
<< " added(from nothing):" << nInserted
|
||||
<< " merged(into other cell):" << nMerge
|
||||
<< " removed:" << nRemove
|
||||
<< nl
|
||||
@ -3202,8 +2985,6 @@ Foam::autoPtr<Foam::polyTopoChangeMap> Foam::polyTopoChange::makeMesh
|
||||
pointsFromPoints,
|
||||
|
||||
faceMap_,
|
||||
facesFromPoints,
|
||||
facesFromEdges,
|
||||
facesFromFaces,
|
||||
|
||||
cellMap_,
|
||||
@ -3217,7 +2998,6 @@ Foam::autoPtr<Foam::polyTopoChangeMap> Foam::polyTopoChange::makeMesh
|
||||
|
||||
patchPointMap,
|
||||
|
||||
newPoints, // if empty signals no inflation.
|
||||
oldPatchStarts,
|
||||
oldPatchNMeshPoints,
|
||||
oldCellVolumes,
|
||||
|
||||
@ -155,14 +155,6 @@ class polyTopoChange
|
||||
// (used to map return value of addFace to new mesh face)
|
||||
DynamicList<label> reverseFaceMap_;
|
||||
|
||||
//- Faces added from point (corresponding faceMap_ will
|
||||
// be -1)
|
||||
Map<label> faceFromPoint_;
|
||||
|
||||
//- Faces added from edge (corresponding faceMap_ will
|
||||
// be -1)
|
||||
Map<label> faceFromEdge_;
|
||||
|
||||
//- In mapping whether to reverse the flux.
|
||||
PackedBoolList flipFaceFlux_;
|
||||
|
||||
@ -186,15 +178,6 @@ class polyTopoChange
|
||||
// (used to map return value of addCell to new mesh cell)
|
||||
DynamicList<label> reverseCellMap_;
|
||||
|
||||
//- Cells added from point
|
||||
Map<label> cellFromPoint_;
|
||||
|
||||
//- Cells added from edge
|
||||
Map<label> cellFromEdge_;
|
||||
|
||||
//- Cells added from face
|
||||
Map<label> cellFromFace_;
|
||||
|
||||
//- Zone of cell
|
||||
DynamicList<label> cellZone_;
|
||||
|
||||
@ -225,8 +208,8 @@ class polyTopoChange
|
||||
(
|
||||
const labelList& map,
|
||||
const labelList& reverseMap,
|
||||
label& nAdd,
|
||||
label& nInflate,
|
||||
label& nSplit,
|
||||
label& nInserted,
|
||||
label& nMerge,
|
||||
label& nRemove
|
||||
);
|
||||
@ -322,13 +305,12 @@ class polyTopoChange
|
||||
|
||||
//- Select either internal or external faces out of faceLabels
|
||||
//
|
||||
// Find faces to interpolate to create value for new face. Only used if
|
||||
// face was inflated from edge or point. Internal faces should only be
|
||||
// created from internal faces, external faces only from external faces
|
||||
// (and ideally the same patch)
|
||||
// Is bit problematic if there are no faces to select, i.e. in
|
||||
// polyDualMesh an internal face can be created from a boundary edge
|
||||
// with no internal faces connected to it.
|
||||
// Find faces to interpolate to create value for new face. Internal
|
||||
// faces should only be created from internal faces, external faces only
|
||||
// from external faces (and ideally the same patch) Is bit problematic
|
||||
// if there are no faces to select, i.e. in polyDualMesh an internal
|
||||
// face can be created from a boundary edge with no internal faces
|
||||
// connected to it.
|
||||
static labelList selectFaces
|
||||
(
|
||||
const primitiveMesh&,
|
||||
@ -344,14 +326,6 @@ class polyTopoChange
|
||||
labelListList&
|
||||
) const;
|
||||
|
||||
void calcFaceInflationMaps
|
||||
(
|
||||
const polyMesh&,
|
||||
List<objectMap>&,
|
||||
List<objectMap>&,
|
||||
List<objectMap>&
|
||||
) const;
|
||||
|
||||
void resetZones
|
||||
(
|
||||
const polyMesh&, // mesh to get existing info from
|
||||
@ -389,8 +363,6 @@ class polyTopoChange
|
||||
labelList& patchSizes,
|
||||
labelList& patchStarts,
|
||||
List<objectMap>& pointsFromPoints,
|
||||
List<objectMap>& facesFromPoints,
|
||||
List<objectMap>& facesFromEdges,
|
||||
List<objectMap>& facesFromFaces,
|
||||
List<objectMap>& cellsFromCells,
|
||||
List<Map<label>>& oldPatchMeshPointMaps,
|
||||
@ -531,8 +503,6 @@ public:
|
||||
const face& f,
|
||||
const label own,
|
||||
const label nei,
|
||||
const label masterPointID,
|
||||
const label masterEdgeID,
|
||||
const label masterFaceID,
|
||||
const bool flipFaceFlux,
|
||||
const label patchID,
|
||||
@ -578,11 +548,6 @@ public:
|
||||
//- Inplace changes mesh without change of patches.
|
||||
// Adapts patch start/end and by default does parallel matching.
|
||||
// Clears all data. Returns map.
|
||||
// inflate = true : keep old mesh points. Put new points into the
|
||||
// returned map (preMotionPoints) so we can use inflation. Any
|
||||
// points out of nothing (appended points) are vector::zero.
|
||||
// inflate = false: set mesh points directly. Empty preMotionPoints
|
||||
// in the map.
|
||||
// orderCells : whether to order the cells (see bandCompression.H)
|
||||
// orderPoints : whether to order the points into internal first
|
||||
// followed by boundary points. This is not fully consistent
|
||||
@ -591,7 +556,6 @@ public:
|
||||
autoPtr<polyTopoChangeMap> changeMesh
|
||||
(
|
||||
polyMesh& mesh,
|
||||
const bool inflate,
|
||||
const bool syncParallel = true,
|
||||
const bool orderCells = false,
|
||||
const bool orderPoints = false
|
||||
|
||||
@ -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
|
||||
@ -250,7 +250,7 @@ void Foam::repatcher::changeAnchorPoint
|
||||
void Foam::repatcher::repatch()
|
||||
{
|
||||
// Apply patch changes to mesh
|
||||
meshMod().changeMesh(mesh_, false);
|
||||
meshMod().changeMesh(mesh_);
|
||||
|
||||
// Clear topo change for the next operation
|
||||
meshModPtr_.clear();
|
||||
|
||||
@ -429,12 +429,7 @@ void Foam::rigidBodyMeshMotion::topoChange(const polyTopoChangeMap& map)
|
||||
// pointMesh already updates pointFields
|
||||
|
||||
// Get the new points either from the map or the mesh
|
||||
const pointField& points =
|
||||
(
|
||||
map.hasMotionPoints()
|
||||
? map.preMotionPoints()
|
||||
: mesh().points()
|
||||
);
|
||||
const pointField& points = mesh().points();
|
||||
|
||||
const pointMesh& pMesh = pointMesh::New(mesh());
|
||||
|
||||
|
||||
Reference in New Issue
Block a user