mirror of
https://develop.openfoam.com/Development/openfoam.git
synced 2025-11-28 03:28:01 +00:00
boundaryField() -> boundaryFieldRef()
This commit is contained in:
@ -2,7 +2,7 @@
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation
|
||||
\\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
@ -46,41 +46,41 @@ using namespace Foam;
|
||||
// Adds empty patch if not yet there. Returns patchID.
|
||||
label addPatch(polyMesh& mesh, const word& patchName)
|
||||
{
|
||||
label patchI = mesh.boundaryMesh().findPatchID(patchName);
|
||||
label patchi = mesh.boundaryMesh().findPatchID(patchName);
|
||||
|
||||
if (patchI == -1)
|
||||
if (patchi == -1)
|
||||
{
|
||||
const polyBoundaryMesh& patches = mesh.boundaryMesh();
|
||||
|
||||
List<polyPatch*> newPatches(patches.size() + 1);
|
||||
|
||||
patchI = 0;
|
||||
patchi = 0;
|
||||
|
||||
// Copy all old patches
|
||||
forAll(patches, i)
|
||||
{
|
||||
const polyPatch& pp = patches[i];
|
||||
|
||||
newPatches[patchI] =
|
||||
newPatches[patchi] =
|
||||
pp.clone
|
||||
(
|
||||
patches,
|
||||
patchI,
|
||||
patchi,
|
||||
pp.size(),
|
||||
pp.start()
|
||||
).ptr();
|
||||
|
||||
patchI++;
|
||||
patchi++;
|
||||
}
|
||||
|
||||
// Add zero-sized patch
|
||||
newPatches[patchI] =
|
||||
newPatches[patchi] =
|
||||
new polyPatch
|
||||
(
|
||||
patchName,
|
||||
0,
|
||||
mesh.nFaces(),
|
||||
patchI,
|
||||
patchi,
|
||||
patches,
|
||||
polyPatch::typeName
|
||||
);
|
||||
@ -88,14 +88,14 @@ label addPatch(polyMesh& mesh, const word& patchName)
|
||||
mesh.removeBoundary();
|
||||
mesh.addPatches(newPatches);
|
||||
|
||||
Pout<< "Created patch " << patchName << " at " << patchI << endl;
|
||||
Pout<< "Created patch " << patchName << " at " << patchi << endl;
|
||||
}
|
||||
else
|
||||
{
|
||||
Pout<< "Reusing patch " << patchName << " at " << patchI << endl;
|
||||
Pout<< "Reusing patch " << patchName << " at " << patchi << endl;
|
||||
}
|
||||
|
||||
return patchI;
|
||||
return patchi;
|
||||
}
|
||||
|
||||
|
||||
@ -222,10 +222,10 @@ int main(int argc, char *argv[])
|
||||
Info<< "Before patching:" << nl
|
||||
<< " patch\tsize" << endl;
|
||||
|
||||
forAll(mesh.boundaryMesh(), patchI)
|
||||
forAll(mesh.boundaryMesh(), patchi)
|
||||
{
|
||||
Info<< " " << mesh.boundaryMesh()[patchI].name() << '\t'
|
||||
<< mesh.boundaryMesh()[patchI].size() << nl;
|
||||
Info<< " " << mesh.boundaryMesh()[patchi].name() << '\t'
|
||||
<< mesh.boundaryMesh()[patchi].size() << nl;
|
||||
}
|
||||
Info<< endl;
|
||||
|
||||
@ -313,10 +313,10 @@ int main(int argc, char *argv[])
|
||||
Info<< "After patching:" << nl
|
||||
<< " patch\tsize" << endl;
|
||||
|
||||
forAll(mesh.boundaryMesh(), patchI)
|
||||
forAll(mesh.boundaryMesh(), patchi)
|
||||
{
|
||||
Info<< " " << mesh.boundaryMesh()[patchI].name() << '\t'
|
||||
<< mesh.boundaryMesh()[patchI].size() << endl;
|
||||
Info<< " " << mesh.boundaryMesh()[patchi].name() << '\t'
|
||||
<< mesh.boundaryMesh()[patchi].size() << endl;
|
||||
}
|
||||
Info<< endl;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user