本文整理汇总了C++中polyMesh::addPatches方法的典型用法代码示例。如果您正苦于以下问题:C++ polyMesh::addPatches方法的具体用法?C++ polyMesh::addPatches怎么用?C++ polyMesh::addPatches使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类polyMesh
的用法示例。
在下文中一共展示了polyMesh::addPatches方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: addPatch
// Adds empty patch if not yet there. Returns patchID.
label addPatch(polyMesh& mesh, const word& patchName)
{
label patchi = mesh.boundaryMesh().findPatchID(patchName);
if (patchi == -1)
{
const polyBoundaryMesh& patches = mesh.boundaryMesh();
List<polyPatch*> newPatches(patches.size() + 1);
patchi = 0;
// Copy all old patches
forAll(patches, i)
{
const polyPatch& pp = patches[i];
newPatches[patchi] =
pp.clone
(
patches,
patchi,
pp.size(),
pp.start()
).ptr();
patchi++;
}
// Add zero-sized patch
newPatches[patchi] =
new polyPatch
(
patchName,
0,
mesh.nFaces(),
patchi,
patches,
polyPatch::typeName
);
mesh.removeBoundary();
mesh.addPatches(newPatches);
Pout<< "Created patch " << patchName << " at " << patchi << endl;
}
else
{
示例2: addPatch
// Adds empty patch if not yet there. Returns patchID.
label addPatch(polyMesh& mesh, const word& patchName)
{
label patchi = mesh.boundaryMesh().findPatchID(patchName);
if (patchi == -1)
{
const polyBoundaryMesh& patches = mesh.boundaryMesh();
List<polyPatch*> newPatches(patches.size() + 1);
// Add empty patch as 0th entry (Note: only since subsetMesh wants this)
patchi = 0;
newPatches[patchi] =
new emptyPolyPatch
(
Foam::word(patchName),
0,
mesh.nInternalFaces(),
patchi,
patches,
emptyPolyPatch::typeName
);
forAll(patches, i)
{
const polyPatch& pp = patches[i];
newPatches[i+1] =
pp.clone
(
patches,
i+1,
pp.size(),
pp.start()
).ptr();
}
mesh.removeBoundary();
mesh.addPatches(newPatches);
Info<< "Created patch oldInternalFaces at " << patchi << endl;
}
else
{