mirror of
https://develop.openfoam.com/Development/openfoam.git
synced 2025-11-28 03:28:01 +00:00
ENH: polyTopoChange: handle meshes without patches
This commit is contained in:
@ -2,7 +2,7 @@
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 2011 OpenFOAM Foundation
|
||||
\\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
@ -26,11 +26,8 @@ License
|
||||
#include "mapPolyMesh.H"
|
||||
#include "polyMesh.H"
|
||||
|
||||
// * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * //
|
||||
|
||||
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
|
||||
|
||||
// Construct from components
|
||||
Foam::mapPolyMesh::mapPolyMesh
|
||||
(
|
||||
const polyMesh& mesh,
|
||||
@ -115,7 +112,6 @@ Foam::mapPolyMesh::mapPolyMesh
|
||||
}
|
||||
|
||||
|
||||
// Construct from components and optionally reuse storage
|
||||
Foam::mapPolyMesh::mapPolyMesh
|
||||
(
|
||||
const polyMesh& mesh,
|
||||
@ -177,6 +173,8 @@ Foam::mapPolyMesh::mapPolyMesh
|
||||
oldPatchStarts_(oldPatchStarts, reUse),
|
||||
oldPatchNMeshPoints_(oldPatchNMeshPoints, reUse)
|
||||
{
|
||||
if (oldPatchStarts_.size() > 0)
|
||||
{
|
||||
// Calculate old patch sizes
|
||||
for (label patchI = 0; patchI < oldPatchStarts_.size() - 1; patchI++)
|
||||
{
|
||||
@ -194,14 +192,13 @@ Foam::mapPolyMesh::mapPolyMesh
|
||||
if (min(oldPatchSizes_) < 0)
|
||||
{
|
||||
FatalErrorIn("mapPolyMesh::mapPolyMesh(...)")
|
||||
<< "Calculated negative old patch size. Error in mapping data"
|
||||
<< "Calculated negative old patch size."
|
||||
<< " Error in mapping data"
|
||||
<< abort(FatalError);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
|
||||
|
||||
|
||||
// ************************************************************************* //
|
||||
|
||||
@ -818,6 +818,8 @@ void Foam::polyTopoChange::getFaceOrder
|
||||
patchSizes.setSize(nPatches_);
|
||||
patchSizes = 0;
|
||||
|
||||
if (nPatches_ > 0)
|
||||
{
|
||||
patchStarts[0] = newFaceI;
|
||||
|
||||
for (label faceI = 0; faceI < nActiveFaces; faceI++)
|
||||
@ -835,6 +837,7 @@ void Foam::polyTopoChange::getFaceOrder
|
||||
patchStarts[patchI] = faceI;
|
||||
faceI += patchSizes[patchI];
|
||||
}
|
||||
}
|
||||
|
||||
//if (debug)
|
||||
//{
|
||||
|
||||
Reference in New Issue
Block a user