Skip to content

Commit

Permalink
BUG: mirrorMesh: clone patches instead of construct from New
Browse files Browse the repository at this point in the history
  • Loading branch information
mattijs committed Mar 11, 2015
1 parent 511af4f commit 769abd3
Showing 1 changed file with 12 additions and 14 deletions.
26 changes: 12 additions & 14 deletions applications/utilities/mesh/manipulation/mirrorMesh/mirrorFvMesh.C
Expand Up @@ -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-2015 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
Expand Down Expand Up @@ -243,8 +243,9 @@ Foam::mirrorFvMesh::mirrorFvMesh(const IOobject& io)

// Mirror boundary faces patch by patch

wordList newPatchTypes(boundary().size());
wordList newPatchNames(boundary().size());

labelList newToOldPatch(boundary().size(), -1);

labelList newPatchSizes(boundary().size(), -1);
labelList newPatchStarts(boundary().size(), -1);
label nNewPatches = 0;
Expand Down Expand Up @@ -303,8 +304,8 @@ Foam::mirrorFvMesh::mirrorFvMesh(const IOobject& io)
// If patch exists, grab the name and type of the original patch
if (nNewFaces > newPatchStarts[nNewPatches])
{
newPatchTypes[nNewPatches] = boundaryMesh()[patchI].type();
newPatchNames[nNewPatches] = boundaryMesh()[patchI].name();
newToOldPatch[nNewPatches] = patchI;

newPatchSizes[nNewPatches] =
nNewFaces - newPatchStarts[nNewPatches];

Expand All @@ -316,8 +317,7 @@ Foam::mirrorFvMesh::mirrorFvMesh(const IOobject& io)
newFaces.setSize(nNewFaces);
Info<< " New faces: " << nNewFaces << endl;

newPatchTypes.setSize(nNewPatches);
newPatchNames.setSize(nNewPatches);
newToOldPatch.setSize(nNewPatches);
newPatchSizes.setSize(nNewPatches);
newPatchStarts.setSize(nNewPatches);

Expand Down Expand Up @@ -377,18 +377,16 @@ Foam::mirrorFvMesh::mirrorFvMesh(const IOobject& io)
fvMesh& pMesh = *mirrorMeshPtr_;

// Add the boundary patches
List<polyPatch*> p(newPatchTypes.size());
List<polyPatch*> p(newPatchSizes.size());

forAll(p, patchI)
{
p[patchI] = polyPatch::New
p[patchI] = boundaryMesh()[newToOldPatch[patchI]].clone
(
newPatchTypes[patchI],
newPatchNames[patchI],
newPatchSizes[patchI],
newPatchStarts[patchI],
pMesh.boundaryMesh(),
patchI,
pMesh.boundaryMesh()
newPatchSizes[patchI],
newPatchStarts[patchI]
).ptr();
}

Expand Down

0 comments on commit 769abd3

Please sign in to comment.