mirror of
https://develop.openfoam.com/Development/openfoam.git
synced 2025-11-28 03:28:01 +00:00
STYLE: use polyPatchList instead of List<polyPatch*> in more places
This commit is contained in:
@ -5,7 +5,7 @@
|
||||
\\ / A nd | www.openfoam.com
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
Copyright (C) 2016-2021 OpenCFD Ltd.
|
||||
Copyright (C) 2016-2022 OpenCFD Ltd.
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
This file is part of OpenFOAM.
|
||||
@ -2420,7 +2420,7 @@ void Foam::ccm::reader::addPatches
|
||||
{
|
||||
// Create patches
|
||||
// use patch types to determine what Foam types to generate
|
||||
List<polyPatch*> newPatches(origBndId_.size());
|
||||
polyPatchList newPatches(origBndId_.size());
|
||||
|
||||
label meshFaceI = nInternalFaces_;
|
||||
wordHashSet hashedNames(origBndId_.size());
|
||||
@ -2463,7 +2463,9 @@ void Foam::ccm::reader::addPatches
|
||||
|
||||
if (patchType == "wall")
|
||||
{
|
||||
newPatches[patchI] =
|
||||
newPatches.set
|
||||
(
|
||||
patchI,
|
||||
new wallPolyPatch
|
||||
(
|
||||
patchName,
|
||||
@ -2472,11 +2474,14 @@ void Foam::ccm::reader::addPatches
|
||||
patchI,
|
||||
mesh.boundaryMesh(),
|
||||
patchType
|
||||
);
|
||||
)
|
||||
);
|
||||
}
|
||||
else if (patchType == "symmetry")
|
||||
{
|
||||
newPatches[patchI] =
|
||||
newPatches.set
|
||||
(
|
||||
patchI,
|
||||
new symmetryPolyPatch
|
||||
(
|
||||
patchName,
|
||||
@ -2485,12 +2490,15 @@ void Foam::ccm::reader::addPatches
|
||||
patchI,
|
||||
mesh.boundaryMesh(),
|
||||
patchType
|
||||
);
|
||||
)
|
||||
);
|
||||
}
|
||||
else if (patchType == "empty")
|
||||
{
|
||||
// Note: not ccm name, may have been introduced by us
|
||||
newPatches[patchI] =
|
||||
newPatches.set
|
||||
(
|
||||
patchI,
|
||||
new emptyPolyPatch
|
||||
(
|
||||
patchName,
|
||||
@ -2499,13 +2507,16 @@ void Foam::ccm::reader::addPatches
|
||||
patchI,
|
||||
mesh.boundaryMesh(),
|
||||
patchType
|
||||
);
|
||||
)
|
||||
);
|
||||
}
|
||||
else
|
||||
{
|
||||
// All other ccm types become straight polyPatch:
|
||||
// 'inlet', 'outlet', 'pressure'.
|
||||
newPatches[patchI] =
|
||||
newPatches.set
|
||||
(
|
||||
patchI,
|
||||
new polyPatch
|
||||
(
|
||||
patchName,
|
||||
@ -2514,7 +2525,8 @@ void Foam::ccm::reader::addPatches
|
||||
patchI,
|
||||
mesh.boundaryMesh(),
|
||||
patchType
|
||||
);
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
meshFaceI += patchSizes_[patchI];
|
||||
|
||||
@ -6,7 +6,7 @@
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
Copyright (C) 2011-2016 OpenFOAM Foundation
|
||||
Copyright (C) 2016 OpenCFD Ltd.
|
||||
Copyright (C) 2016-2022 OpenCFD Ltd.
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
This file is part of OpenFOAM.
|
||||
@ -377,7 +377,7 @@ void Foam::meshReader::createPolyBoundary()
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
Foam::List<Foam::polyPatch*>
|
||||
Foam::polyPatchList
|
||||
Foam::meshReader::polyBoundaryPatches(const polyMesh& mesh)
|
||||
{
|
||||
label nUsed = 0, nEmpty = 0;
|
||||
@ -416,7 +416,7 @@ Foam::meshReader::polyBoundaryPatches(const polyMesh& mesh)
|
||||
patchSizes_.setSize(nPatches);
|
||||
|
||||
|
||||
List<polyPatch*> p(nPatches);
|
||||
polyPatchList newPatches(nPatches);
|
||||
|
||||
// All patch dictionaries
|
||||
PtrList<dictionary> patchDicts(patchNames_.size());
|
||||
@ -469,16 +469,20 @@ Foam::meshReader::polyBoundaryPatches(const polyMesh& mesh)
|
||||
|
||||
forAll(patchStarts_, patchi)
|
||||
{
|
||||
p[patchi] = polyPatch::New
|
||||
newPatches.set
|
||||
(
|
||||
patchNames_[patchi],
|
||||
patchDicts[patchi],
|
||||
patchi,
|
||||
mesh.boundaryMesh()
|
||||
).ptr();
|
||||
polyPatch::New
|
||||
(
|
||||
patchNames_[patchi],
|
||||
patchDicts[patchi],
|
||||
patchi,
|
||||
mesh.boundaryMesh()
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
return p;
|
||||
return newPatches;
|
||||
}
|
||||
|
||||
|
||||
|
||||
@ -109,8 +109,10 @@ Foam::autoPtr<Foam::polyMesh> Foam::meshReader::mesh
|
||||
);
|
||||
polyMesh& mesh = *meshPtr;
|
||||
|
||||
polyPatchList newPatches(polyBoundaryPatches(mesh));
|
||||
|
||||
// Adding patches also checks the mesh
|
||||
mesh.addPatches(polyBoundaryPatches(mesh));
|
||||
mesh.addPatches(newPatches);
|
||||
|
||||
warnDuplicates("boundaries", mesh.boundaryMesh().names());
|
||||
|
||||
|
||||
@ -49,8 +49,8 @@ SourceFiles
|
||||
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
#ifndef meshReader_H
|
||||
#define meshReader_H
|
||||
#ifndef Foam_meshReader_H
|
||||
#define Foam_meshReader_H
|
||||
|
||||
#include "polyMesh.H"
|
||||
#include "HashTable.H"
|
||||
@ -179,7 +179,7 @@ private:
|
||||
void createPolyBoundary();
|
||||
|
||||
//- Add polyhedral boundary
|
||||
List<polyPatch*> polyBoundaryPatches(const polyMesh&);
|
||||
polyPatchList polyBoundaryPatches(const polyMesh&);
|
||||
|
||||
//- Clear extra storage before creation of the mesh to remove
|
||||
// a memory peak
|
||||
|
||||
@ -342,8 +342,8 @@ void Foam::fileFormats::FIREMeshReader::reorganize()
|
||||
|
||||
void Foam::fileFormats::FIREMeshReader::addPatches(polyMesh& mesh) const
|
||||
{
|
||||
// create patches
|
||||
List<polyPatch*> newPatches(patchSizes_.size());
|
||||
// Create patches
|
||||
polyPatchList newPatches(patchSizes_.size());
|
||||
|
||||
label meshFaceI = nInternalFaces_;
|
||||
|
||||
@ -355,14 +355,18 @@ void Foam::fileFormats::FIREMeshReader::addPatches(polyMesh& mesh) const
|
||||
<< endl;
|
||||
|
||||
// don't know anything better - just make it a wall
|
||||
newPatches[patchI] = new polyPatch
|
||||
newPatches.set
|
||||
(
|
||||
patchNames_[patchI],
|
||||
patchSizes_[patchI],
|
||||
meshFaceI,
|
||||
patchI,
|
||||
mesh.boundaryMesh(),
|
||||
word::null
|
||||
new polyPatch
|
||||
(
|
||||
patchNames_[patchI],
|
||||
patchSizes_[patchI],
|
||||
meshFaceI,
|
||||
patchI,
|
||||
mesh.boundaryMesh(),
|
||||
word::null
|
||||
)
|
||||
);
|
||||
|
||||
meshFaceI += patchSizes_[patchI];
|
||||
|
||||
@ -1315,19 +1315,23 @@ void Foam::polyDualMesh::calcDual
|
||||
|
||||
|
||||
// Add patches. First add zero sized (since mesh still 0 size)
|
||||
List<polyPatch*> dualPatches(patches.size());
|
||||
polyPatchList dualPatches(patches.size());
|
||||
|
||||
forAll(patches, patchi)
|
||||
{
|
||||
const polyPatch& pp = patches[patchi];
|
||||
|
||||
dualPatches[patchi] = pp.clone
|
||||
dualPatches.set
|
||||
(
|
||||
boundaryMesh(),
|
||||
patchi,
|
||||
0, //patchSizes[patchi],
|
||||
0 //patchStarts[patchi]
|
||||
).ptr();
|
||||
pp.clone
|
||||
(
|
||||
boundaryMesh(),
|
||||
patchi,
|
||||
0, //patchSizes[patchi],
|
||||
0 //patchStarts[patchi]
|
||||
)
|
||||
);
|
||||
}
|
||||
addPatches(dualPatches);
|
||||
|
||||
|
||||
@ -1149,7 +1149,7 @@ void Foam::boundaryMesh::patchify
|
||||
// zero faces (repatched later on). Exception is coupled patches which
|
||||
// keep their size.
|
||||
|
||||
List<polyPatch*> newPatchPtrList(nNewPatches);
|
||||
polyPatchList newPatches(nNewPatches);
|
||||
|
||||
label meshFacei = newMesh.nInternalFaces();
|
||||
|
||||
@ -1174,15 +1174,19 @@ void Foam::boundaryMesh::patchify
|
||||
<< " type:" << bp.physicalType() << endl;
|
||||
}
|
||||
|
||||
newPatchPtrList[newPatchi] = polyPatch::New
|
||||
newPatches.set
|
||||
(
|
||||
bp.physicalType(),
|
||||
bp.name(),
|
||||
facesToBeDone,
|
||||
meshFacei,
|
||||
newPatchi,
|
||||
newMesh.boundaryMesh()
|
||||
).ptr();
|
||||
polyPatch::New
|
||||
(
|
||||
bp.physicalType(),
|
||||
bp.name(),
|
||||
facesToBeDone,
|
||||
meshFacei,
|
||||
newPatchi,
|
||||
newMesh.boundaryMesh()
|
||||
)
|
||||
);
|
||||
|
||||
meshFacei += facesToBeDone;
|
||||
|
||||
@ -1200,13 +1204,17 @@ void Foam::boundaryMesh::patchify
|
||||
<< oldPatch.name() << endl;
|
||||
}
|
||||
|
||||
newPatchPtrList[newPatchi] = oldPatch.clone
|
||||
newPatches.set
|
||||
(
|
||||
newMesh.boundaryMesh(),
|
||||
newPatchi,
|
||||
facesToBeDone,
|
||||
meshFacei
|
||||
).ptr();
|
||||
oldPatch.clone
|
||||
(
|
||||
newMesh.boundaryMesh(),
|
||||
newPatchi,
|
||||
facesToBeDone,
|
||||
meshFacei
|
||||
)
|
||||
);
|
||||
|
||||
meshFacei += facesToBeDone;
|
||||
|
||||
@ -1220,9 +1228,9 @@ void Foam::boundaryMesh::patchify
|
||||
{
|
||||
Pout<< "Patchify : new polyPatch list:" << endl;
|
||||
|
||||
forAll(newPatchPtrList, patchi)
|
||||
forAll(newPatches, patchi)
|
||||
{
|
||||
const polyPatch& newPatch = *newPatchPtrList[patchi];
|
||||
const polyPatch& newPatch = newPatches[patchi];
|
||||
|
||||
if (debug)
|
||||
{
|
||||
@ -1237,13 +1245,13 @@ void Foam::boundaryMesh::patchify
|
||||
|
||||
// Actually add new list of patches
|
||||
repatchPolyTopoChanger polyMeshRepatcher(newMesh);
|
||||
polyMeshRepatcher.changePatches(newPatchPtrList);
|
||||
polyMeshRepatcher.changePatches(newPatches);
|
||||
|
||||
|
||||
// Pass2:
|
||||
// Change patch type for face
|
||||
|
||||
if (newPatchPtrList.size())
|
||||
if (newPatches.size())
|
||||
{
|
||||
List<DynamicList<label>> patchFaces(nNewPatches);
|
||||
|
||||
|
||||
@ -6,7 +6,7 @@
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
Copyright (C) 2011-2016 OpenFOAM Foundation
|
||||
Copyright (C) 2020 OpenCFD Ltd.
|
||||
Copyright (C) 2020-2022 OpenCFD Ltd.
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
This file is part of OpenFOAM.
|
||||
@ -77,7 +77,7 @@ Foam::extrudePatchMesh::extrudePatchMesh
|
||||
const fvPatch& p,
|
||||
const dictionary& dict,
|
||||
const word& regionName,
|
||||
const List<polyPatch*>& regionPatches
|
||||
polyPatchList& regionPatches
|
||||
)
|
||||
:
|
||||
extrudePatchMesh(regionName, mesh, p, dict)
|
||||
@ -86,6 +86,24 @@ Foam::extrudePatchMesh::extrudePatchMesh
|
||||
}
|
||||
|
||||
|
||||
Foam::extrudePatchMesh::extrudePatchMesh
|
||||
(
|
||||
const fvMesh& mesh,
|
||||
const fvPatch& p,
|
||||
const dictionary& dict,
|
||||
const word& regionName,
|
||||
const List<polyPatch*>& regionPatches
|
||||
)
|
||||
:
|
||||
extrudePatchMesh(regionName, mesh, p, dict)
|
||||
{
|
||||
// Acquire ownership of the pointers
|
||||
polyPatchList plist(const_cast<List<polyPatch*>&>(regionPatches));
|
||||
|
||||
extrudeMesh(plist);
|
||||
}
|
||||
|
||||
|
||||
Foam::extrudePatchMesh::extrudePatchMesh
|
||||
(
|
||||
const fvMesh& mesh,
|
||||
@ -96,18 +114,10 @@ Foam::extrudePatchMesh::extrudePatchMesh
|
||||
:
|
||||
extrudePatchMesh(regionName, mesh, p, dict)
|
||||
{
|
||||
List<polyPatch*> regionPatches(3);
|
||||
polyPatchList regionPatches(3);
|
||||
List<dictionary> dicts(regionPatches.size());
|
||||
List<word> patchNames(regionPatches.size());
|
||||
List<word> patchTypes(regionPatches.size());
|
||||
PtrList<dictionary> dicts(regionPatches.size());
|
||||
|
||||
forAll(dicts, patchi)
|
||||
{
|
||||
if (!dicts.set(patchi))
|
||||
{
|
||||
dicts.set(patchi, new dictionary());
|
||||
}
|
||||
}
|
||||
|
||||
dicts[bottomPatchID] = dict_.subDict("bottomCoeffs");
|
||||
dicts[sidePatchID] = dict_.subDict("sideCoeffs");
|
||||
@ -125,22 +135,26 @@ Foam::extrudePatchMesh::extrudePatchMesh
|
||||
patchDict.set("nFaces", 0);
|
||||
patchDict.set("startFace", 0);
|
||||
|
||||
regionPatches[patchi] = polyPatch::New
|
||||
regionPatches.set
|
||||
(
|
||||
patchi,
|
||||
polyPatch::New
|
||||
(
|
||||
patchNames[patchi],
|
||||
patchDict,
|
||||
patchi,
|
||||
mesh.boundaryMesh()
|
||||
).ptr();
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
extrudeMesh(regionPatches);
|
||||
}
|
||||
|
||||
|
||||
void Foam::extrudePatchMesh::extrudeMesh(const List<polyPatch*>& regionPatches)
|
||||
void Foam::extrudePatchMesh::extrudeMesh(polyPatchList& regionPatches)
|
||||
{
|
||||
if (this->boundaryMesh().size() == 0)
|
||||
if (this->boundaryMesh().empty())
|
||||
{
|
||||
const bool columnCells = dict_.get<bool>("columnCells");
|
||||
|
||||
|
||||
@ -70,12 +70,11 @@ Description
|
||||
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
#ifndef extrudePatchMesh_H
|
||||
#define extrudePatchMesh_H
|
||||
#ifndef Foam_extrudePatchMesh_H
|
||||
#define Foam_extrudePatchMesh_H
|
||||
|
||||
#include "extrudeModel.H"
|
||||
#include "autoPtr.H"
|
||||
|
||||
#include "fvMesh.H"
|
||||
#include "Time.H"
|
||||
|
||||
@ -97,12 +96,12 @@ class extrudePatchMesh
|
||||
{
|
||||
// Private Data
|
||||
|
||||
//- Enumeration of patch IDs
|
||||
//- Enumeration of patch IDs. Must be 0,1,2,...
|
||||
enum patchID
|
||||
{
|
||||
bottomPatchID,
|
||||
topPatchID,
|
||||
sidePatchID
|
||||
bottomPatchID = 0,
|
||||
topPatchID = 1,
|
||||
sidePatchID = 2
|
||||
};
|
||||
|
||||
//- Const reference to the patch from which this mesh is extruded
|
||||
@ -115,7 +114,7 @@ class extrudePatchMesh
|
||||
// Private Member Functions
|
||||
|
||||
//- Extrude mesh using polyPatches
|
||||
void extrudeMesh(const List<polyPatch*>& regionPatches);
|
||||
void extrudeMesh(polyPatchList& regionPatches);
|
||||
|
||||
//- Construct from mesh, patch and dictionary without patches.
|
||||
// Only used internally
|
||||
@ -145,14 +144,25 @@ public:
|
||||
);
|
||||
|
||||
//- Construct from mesh, patch, dictionary and new mesh
|
||||
// polyPatch information
|
||||
//- polyPatch information
|
||||
extrudePatchMesh
|
||||
(
|
||||
const fvMesh& mesh,
|
||||
const fvPatch& p,
|
||||
const dictionary& dict,
|
||||
const word& regionName,
|
||||
const List<polyPatch*>& polyPatches
|
||||
polyPatchList& regionPatches
|
||||
);
|
||||
|
||||
//- Construct from mesh, patch, dictionary and new mesh
|
||||
//- polyPatch information
|
||||
extrudePatchMesh
|
||||
(
|
||||
const fvMesh& mesh,
|
||||
const fvPatch& p,
|
||||
const dictionary& dict,
|
||||
const word& regionName,
|
||||
const List<polyPatch*>& regionPatches
|
||||
);
|
||||
|
||||
|
||||
|
||||
@ -1796,17 +1796,21 @@ Foam::autoPtr<Foam::fvMesh> Foam::fvMeshDistribute::receiveMesh
|
||||
);
|
||||
fvMesh& domainMesh = *domainMeshPtr;
|
||||
|
||||
List<polyPatch*> patches(patchEntries.size());
|
||||
polyPatchList patches(patchEntries.size());
|
||||
|
||||
forAll(patchEntries, patchi)
|
||||
{
|
||||
patches[patchi] = polyPatch::New
|
||||
patches.set
|
||||
(
|
||||
patchEntries[patchi].keyword(),
|
||||
patchEntries[patchi].dict(),
|
||||
patchi,
|
||||
domainMesh.boundaryMesh()
|
||||
).ptr();
|
||||
polyPatch::New
|
||||
(
|
||||
patchEntries[patchi].keyword(),
|
||||
patchEntries[patchi].dict(),
|
||||
patchi,
|
||||
domainMesh.boundaryMesh()
|
||||
)
|
||||
);
|
||||
}
|
||||
// Add patches; no parallel comms
|
||||
domainMesh.addFvPatches(patches, false);
|
||||
|
||||
@ -6,6 +6,7 @@
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
Copyright (C) 2011-2016 OpenFOAM Foundation
|
||||
Copyright (C) 2022 OpenCFD Ltd.
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
This file is part of OpenFOAM.
|
||||
@ -80,34 +81,40 @@ void Foam::attachPolyTopoChanger::attach(const bool removeEmptyPatches)
|
||||
// Re-do the boundary patches, removing the ones with zero size
|
||||
const polyBoundaryMesh& oldPatches = mesh_.boundaryMesh();
|
||||
|
||||
List<polyPatch*> newPatches(oldPatches.size());
|
||||
polyPatchList newPatches(oldPatches.size());
|
||||
label nNewPatches = 0;
|
||||
|
||||
forAll(oldPatches, patchi)
|
||||
{
|
||||
if (oldPatches[patchi].size())
|
||||
{
|
||||
newPatches[nNewPatches] = oldPatches[patchi].clone
|
||||
(
|
||||
mesh_.boundaryMesh(),
|
||||
nNewPatches,
|
||||
oldPatches[patchi].size(),
|
||||
oldPatches[patchi].start()
|
||||
).ptr();
|
||||
const word& patchName = oldPatches[patchi].name();
|
||||
|
||||
nNewPatches++;
|
||||
if (returnReduceOr(oldPatches[patchi].size()))
|
||||
{
|
||||
newPatches.set
|
||||
(
|
||||
nNewPatches,
|
||||
oldPatches[patchi].clone
|
||||
(
|
||||
mesh_.boundaryMesh(),
|
||||
nNewPatches,
|
||||
oldPatches[patchi].size(),
|
||||
oldPatches[patchi].start()
|
||||
)
|
||||
);
|
||||
|
||||
++nNewPatches;
|
||||
}
|
||||
else
|
||||
{
|
||||
if (debug)
|
||||
{
|
||||
Pout<< "Removing zero-sized patch " << patchi
|
||||
<< " named " << oldPatches[patchi].name() << endl;
|
||||
<< " named " << patchName << endl;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
newPatches.setSize(nNewPatches);
|
||||
newPatches.resize(nNewPatches);
|
||||
|
||||
mesh_.removeBoundary();
|
||||
mesh_.addPatches(newPatches);
|
||||
|
||||
@ -46,8 +46,8 @@ Description
|
||||
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
#ifndef attachPolyTopoChanger_H
|
||||
#define attachPolyTopoChanger_H
|
||||
#ifndef Foam_attachPolyTopoChanger_H
|
||||
#define Foam_attachPolyTopoChanger_H
|
||||
|
||||
#include "polyTopoChanger.H"
|
||||
|
||||
@ -57,16 +57,16 @@ namespace Foam
|
||||
{
|
||||
|
||||
/*---------------------------------------------------------------------------*\
|
||||
Class attachPolyTopoChanger Declaration
|
||||
Class attachPolyTopoChanger Declaration
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
class attachPolyTopoChanger
|
||||
:
|
||||
public polyTopoChanger
|
||||
{
|
||||
// Private data
|
||||
public:
|
||||
|
||||
// Private Member Functions
|
||||
// Generated Methods
|
||||
|
||||
//- No copy construct
|
||||
attachPolyTopoChanger(const attachPolyTopoChanger&) = delete;
|
||||
@ -75,8 +75,6 @@ class attachPolyTopoChanger
|
||||
void operator=(const attachPolyTopoChanger&) = delete;
|
||||
|
||||
|
||||
public:
|
||||
|
||||
// Constructors
|
||||
|
||||
//- Read constructor from IOobject and a polyMesh
|
||||
|
||||
@ -60,7 +60,7 @@ Foam::repatchPolyTopoChanger::repatchPolyTopoChanger(polyMesh& mesh)
|
||||
|
||||
void Foam::repatchPolyTopoChanger::changePatches
|
||||
(
|
||||
const List<polyPatch*>& patches
|
||||
polyPatchList& patches
|
||||
)
|
||||
{
|
||||
if (meshModPtr_)
|
||||
@ -76,6 +76,18 @@ void Foam::repatchPolyTopoChanger::changePatches
|
||||
}
|
||||
|
||||
|
||||
void Foam::repatchPolyTopoChanger::changePatches
|
||||
(
|
||||
const List<polyPatch*>& patches
|
||||
)
|
||||
{
|
||||
// Acquire ownership of the pointers
|
||||
polyPatchList plist(const_cast<List<polyPatch*>&>(patches));
|
||||
|
||||
changePatches(plist);
|
||||
}
|
||||
|
||||
|
||||
void Foam::repatchPolyTopoChanger::changePatchID
|
||||
(
|
||||
const label faceID,
|
||||
|
||||
@ -6,7 +6,7 @@
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
Copyright (C) 2011 OpenFOAM Foundation
|
||||
Copyright (C) 2019-2020 OpenCFD Ltd.
|
||||
Copyright (C) 2019-2022 OpenCFD Ltd.
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
This file is part of OpenFOAM.
|
||||
@ -37,8 +37,8 @@ SourceFiles
|
||||
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
#ifndef repatchPolyTopoChanger_H
|
||||
#define repatchPolyTopoChanger_H
|
||||
#ifndef Foam_repatchPolyTopoChanger_H
|
||||
#define Foam_repatchPolyTopoChanger_H
|
||||
|
||||
#include "polyMesh.H"
|
||||
#include "polyTopoChange.H"
|
||||
@ -60,7 +60,7 @@ class repatchPolyTopoChanger
|
||||
polyMesh& mesh_;
|
||||
|
||||
//- Topological change to accumulated all mesh changes
|
||||
unique_ptr<polyTopoChange> meshModPtr_;
|
||||
std::unique_ptr<polyTopoChange> meshModPtr_;
|
||||
|
||||
|
||||
// Private Member Functions
|
||||
@ -89,11 +89,14 @@ public:
|
||||
|
||||
// Member Functions
|
||||
|
||||
//- Change patches.
|
||||
void changePatches(polyPatchList& patches);
|
||||
|
||||
//- Change patches.
|
||||
void changePatches(const List<polyPatch*>& patches);
|
||||
|
||||
//- Change patch ID for a boundary face. Note: patchID should be in new
|
||||
// numbering.
|
||||
//- Change patch ID for a boundary face.
|
||||
//- Note: patchID should be in new numbering.
|
||||
void changePatchID
|
||||
(
|
||||
const label faceID,
|
||||
|
||||
@ -83,16 +83,20 @@ Foam::simplifiedMeshes::hexCellFvMesh::hexCellFvMesh
|
||||
labelList()
|
||||
)
|
||||
{
|
||||
List<polyPatch*> patches(1);
|
||||
polyPatchList patches(1);
|
||||
|
||||
patches[0] = new emptyPolyPatch
|
||||
patches.set
|
||||
(
|
||||
"boundary",
|
||||
6,
|
||||
0,
|
||||
0,
|
||||
boundaryMesh(),
|
||||
emptyPolyPatch::typeName
|
||||
new emptyPolyPatch
|
||||
(
|
||||
"boundary",
|
||||
6,
|
||||
0,
|
||||
0,
|
||||
boundaryMesh(),
|
||||
emptyPolyPatch::typeName
|
||||
)
|
||||
);
|
||||
|
||||
addFvPatches(patches);
|
||||
|
||||
@ -6,7 +6,7 @@
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
Copyright (C) 2011-2016 OpenFOAM Foundation
|
||||
Copyright (C) 2019 OpenCFD Ltd.
|
||||
Copyright (C) 2019-2022 OpenCFD Ltd.
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
This file is part of OpenFOAM.
|
||||
@ -258,16 +258,20 @@ void Foam::singleCellFvMesh::agglomerateMesh
|
||||
pointField boundaryPoints(mesh.points(), pointMap_);
|
||||
|
||||
// Add patches (on still zero sized mesh)
|
||||
List<polyPatch*> newPatches(oldPatches.size());
|
||||
polyPatchList newPatches(oldPatches.size());
|
||||
forAll(oldPatches, patchi)
|
||||
{
|
||||
newPatches[patchi] = oldPatches[patchi].clone
|
||||
newPatches.set
|
||||
(
|
||||
boundaryMesh(),
|
||||
patchi,
|
||||
0,
|
||||
0
|
||||
).ptr();
|
||||
oldPatches[patchi].clone
|
||||
(
|
||||
boundaryMesh(),
|
||||
patchi,
|
||||
0,
|
||||
0
|
||||
)
|
||||
);
|
||||
}
|
||||
addFvPatches(newPatches);
|
||||
|
||||
|
||||
@ -143,10 +143,10 @@ void thermalBaffleFvPatchScalarField::createPatchMesh()
|
||||
|
||||
const word regionName(dict_.get<word>("region"));
|
||||
|
||||
List<polyPatch*> regionPatches(3);
|
||||
polyPatchList regionPatches(3);
|
||||
List<dictionary> dicts(regionPatches.size());
|
||||
List<word> patchNames(regionPatches.size());
|
||||
List<word> patchTypes(regionPatches.size());
|
||||
List<dictionary> dicts(regionPatches.size());
|
||||
|
||||
patchNames[bottomPatchID] = word("bottom");
|
||||
patchNames[sidePatchID] = word("side");
|
||||
@ -172,8 +172,7 @@ void thermalBaffleFvPatchScalarField::createPatchMesh()
|
||||
patchTypes[sidePatchID] = polyPatch::typeName;
|
||||
}
|
||||
|
||||
const mappedPatchBase& mpp =
|
||||
refCast<const mappedPatchBase>(patch().patch(), dict_);
|
||||
const auto& mpp = refCast<const mappedPatchBase>(patch().patch(), dict_);
|
||||
|
||||
const word coupleGroup(mpp.coupleGroup());
|
||||
|
||||
@ -202,18 +201,22 @@ void thermalBaffleFvPatchScalarField::createPatchMesh()
|
||||
|
||||
forAll(regionPatches, patchi)
|
||||
{
|
||||
dictionary& patchDict = dicts[patchi];
|
||||
dictionary& patchDict = dicts[patchi];
|
||||
patchDict.set("nFaces", 0);
|
||||
patchDict.set("startFace", 0);
|
||||
|
||||
regionPatches[patchi] = polyPatch::New
|
||||
regionPatches.set
|
||||
(
|
||||
patchTypes[patchi],
|
||||
patchNames[patchi],
|
||||
dicts[patchi],
|
||||
patchi,
|
||||
thisMesh.boundaryMesh()
|
||||
).ptr();
|
||||
polyPatch::New
|
||||
(
|
||||
patchTypes[patchi],
|
||||
patchNames[patchi],
|
||||
dicts[patchi],
|
||||
patchi,
|
||||
thisMesh.boundaryMesh()
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
extrudeMeshPtr_.reset
|
||||
|
||||
@ -495,15 +495,19 @@ void Foam::meshToMesh::calculate(const word& methodName, const bool normalise)
|
||||
);
|
||||
|
||||
// create some dummy patch info
|
||||
List<polyPatch*> patches(1);
|
||||
patches[0] = new polyPatch
|
||||
polyPatchList patches(1);
|
||||
patches.set
|
||||
(
|
||||
"defaultFaces",
|
||||
newTgt.nBoundaryFaces(),
|
||||
newTgt.nInternalFaces(),
|
||||
0,
|
||||
newTgt.boundaryMesh(),
|
||||
word::null
|
||||
new polyPatch
|
||||
(
|
||||
"defaultFaces",
|
||||
newTgt.nBoundaryFaces(),
|
||||
newTgt.nInternalFaces(),
|
||||
0,
|
||||
newTgt.boundaryMesh(),
|
||||
word::null
|
||||
)
|
||||
);
|
||||
|
||||
newTgt.addPatches(patches);
|
||||
|
||||
Reference in New Issue
Block a user