mirror of
https://develop.openfoam.com/Development/openfoam.git
synced 2025-11-28 03:28:01 +00:00
STYLE: remove dead code, refactor constructors in extrudePatchMesh
This commit is contained in:
@ -142,14 +142,6 @@ void Foam::extrude2DMesh::addFrontBackPatches()
|
||||
patches
|
||||
).ptr();
|
||||
|
||||
// newPatches[frontPatchi_] = polyPatch::New
|
||||
// (
|
||||
// "front",
|
||||
// patchDict_,
|
||||
// frontPatchi_,
|
||||
// patches
|
||||
// ).ptr();
|
||||
|
||||
Info<< "Adding patch " << newPatches[frontPatchi_]->name()
|
||||
<< " at index " << frontPatchi_
|
||||
<< " for front faces." << nl << endl;
|
||||
@ -170,14 +162,6 @@ void Foam::extrude2DMesh::addFrontBackPatches()
|
||||
patches
|
||||
).ptr();
|
||||
|
||||
// newPatches[frontPatchi_] = polyPatch::New
|
||||
// (
|
||||
// "back",
|
||||
// patchDict_,
|
||||
// backPatchi_,
|
||||
// patches
|
||||
// ).ptr();
|
||||
|
||||
Info<< "Adding patch " << newPatches[backPatchi_]->name()
|
||||
<< " at index " << backPatchi_
|
||||
<< " for back faces." << nl << endl;
|
||||
|
||||
@ -6,6 +6,7 @@
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
Copyright (C) 2011-2016 OpenFOAM Foundation
|
||||
Copyright (C) 2020 OpenCFD Ltd.
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
This file is part of OpenFOAM.
|
||||
@ -33,25 +34,22 @@ License
|
||||
#include "emptyPolyPatch.H"
|
||||
#include "wedgePolyPatch.H"
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
|
||||
|
||||
namespace Foam
|
||||
{
|
||||
defineTypeNameAndDebug(extrudePatchMesh, 0);
|
||||
}
|
||||
|
||||
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
|
||||
|
||||
defineTypeNameAndDebug(extrudePatchMesh, 0);
|
||||
|
||||
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
|
||||
|
||||
extrudePatchMesh::extrudePatchMesh
|
||||
Foam::extrudePatchMesh::extrudePatchMesh
|
||||
(
|
||||
const word& regionName,
|
||||
const fvMesh& mesh,
|
||||
const fvPatch& patch,
|
||||
const dictionary& dict,
|
||||
const word regionName,
|
||||
const List<polyPatch*>& regionPatches
|
||||
const fvPatch& p,
|
||||
const dictionary& dict
|
||||
)
|
||||
:
|
||||
fvMesh
|
||||
@ -68,37 +66,35 @@ extrudePatchMesh::extrudePatchMesh
|
||||
Zero,
|
||||
false
|
||||
),
|
||||
extrudedPatch_(patch.patch()),
|
||||
extrudedPatch_(p.patch()),
|
||||
dict_(dict)
|
||||
{}
|
||||
|
||||
|
||||
Foam::extrudePatchMesh::extrudePatchMesh
|
||||
(
|
||||
const fvMesh& mesh,
|
||||
const fvPatch& p,
|
||||
const dictionary& dict,
|
||||
const word& regionName,
|
||||
const List<polyPatch*>& regionPatches
|
||||
)
|
||||
:
|
||||
extrudePatchMesh(regionName, mesh, p, dict)
|
||||
{
|
||||
extrudeMesh(regionPatches);
|
||||
}
|
||||
|
||||
|
||||
extrudePatchMesh::extrudePatchMesh
|
||||
Foam::extrudePatchMesh::extrudePatchMesh
|
||||
(
|
||||
const fvMesh& mesh,
|
||||
const fvPatch& patch,
|
||||
const fvPatch& p,
|
||||
const dictionary& dict,
|
||||
const word regionName
|
||||
const word& regionName
|
||||
)
|
||||
:
|
||||
fvMesh
|
||||
(
|
||||
IOobject
|
||||
(
|
||||
regionName,
|
||||
mesh.facesInstance(),
|
||||
mesh,
|
||||
IOobject::READ_IF_PRESENT,
|
||||
IOobject::NO_WRITE,
|
||||
true
|
||||
),
|
||||
Zero,
|
||||
false
|
||||
),
|
||||
extrudedPatch_(patch.patch()),
|
||||
dict_(dict)
|
||||
extrudePatchMesh(regionName, mesh, p, dict)
|
||||
{
|
||||
List<polyPatch*> regionPatches(3);
|
||||
List<word> patchNames(regionPatches.size());
|
||||
@ -136,14 +132,13 @@ extrudePatchMesh::extrudePatchMesh
|
||||
patchi,
|
||||
mesh.boundaryMesh()
|
||||
).ptr();
|
||||
|
||||
}
|
||||
|
||||
extrudeMesh(regionPatches);
|
||||
}
|
||||
|
||||
|
||||
void extrudePatchMesh::extrudeMesh(const List<polyPatch*>& regionPatches)
|
||||
void Foam::extrudePatchMesh::extrudeMesh(const List<polyPatch*>& regionPatches)
|
||||
{
|
||||
if (this->boundaryMesh().size() == 0)
|
||||
{
|
||||
@ -247,6 +242,7 @@ void extrudePatchMesh::extrudeMesh(const List<polyPatch*>& regionPatches)
|
||||
firstDisp[regionI] = model_()(regionPt, n, 1) - regionPt;
|
||||
}
|
||||
|
||||
const label nNewPatches = regionPatches.size();
|
||||
|
||||
// Extrude engine
|
||||
createShellMesh extruder
|
||||
@ -255,46 +251,6 @@ void extrudePatchMesh::extrudeMesh(const List<polyPatch*>& regionPatches)
|
||||
pointLocalRegions,
|
||||
localRegionPoints
|
||||
);
|
||||
/*
|
||||
List<polyPatch*> regionPatches(3);
|
||||
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");
|
||||
dicts[topPatchID] = dict_.subDict("topCoeffs");
|
||||
|
||||
forAll(dicts, patchi)
|
||||
{
|
||||
dicts[patchi].readEntry("name", patchNames[patchi]);
|
||||
dicts[patchi].readEntry("type", patchTypes[patchi]);
|
||||
}
|
||||
|
||||
forAll(regionPatches, patchi)
|
||||
{
|
||||
dictionary& patchDict = dicts[patchi];
|
||||
patchDict.set("nFaces", 0);
|
||||
patchDict.set("startFace", 0);
|
||||
|
||||
regionPatches[patchi] = polyPatch::New
|
||||
(
|
||||
patchNames[patchi],
|
||||
patchDict,
|
||||
patchi,
|
||||
mesh.boundaryMesh()
|
||||
).ptr();
|
||||
|
||||
}
|
||||
*/
|
||||
this->clearOut();
|
||||
this->removeFvBoundary();
|
||||
this->addFvPatches(regionPatches, true);
|
||||
@ -315,7 +271,7 @@ void extrudePatchMesh::extrudeMesh(const List<polyPatch*>& regionPatches)
|
||||
}
|
||||
}
|
||||
|
||||
polyTopoChange meshMod(regionPatches.size());
|
||||
polyTopoChange meshMod(nNewPatches);
|
||||
|
||||
extruder.setRefinement
|
||||
(
|
||||
@ -343,8 +299,4 @@ void extrudePatchMesh::extrudeMesh(const List<polyPatch*>& regionPatches)
|
||||
}
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
} // End namespace Foam
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
@ -6,6 +6,7 @@
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
Copyright (C) 2011-2016 OpenFOAM Foundation
|
||||
Copyright (C) 2020 OpenCFD Ltd.
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
This file is part of OpenFOAM.
|
||||
@ -94,10 +95,7 @@ class extrudePatchMesh
|
||||
:
|
||||
public fvMesh
|
||||
{
|
||||
|
||||
private:
|
||||
|
||||
// Private data
|
||||
// Private Data
|
||||
|
||||
//- Enumeration of patch IDs
|
||||
enum patchID
|
||||
@ -114,11 +112,20 @@ private:
|
||||
dictionary dict_;
|
||||
|
||||
|
||||
// Private member functions
|
||||
// Private Member Functions
|
||||
|
||||
//- Extrude mesh using polyPatches
|
||||
void extrudeMesh(const List<polyPatch*>& regionPatches);
|
||||
|
||||
//- Construct from mesh, patch and dictionary without patches.
|
||||
// Only used internally
|
||||
extrudePatchMesh
|
||||
(
|
||||
const word& regionName,
|
||||
const fvMesh& mesh,
|
||||
const fvPatch& p,
|
||||
const dictionary& dict
|
||||
);
|
||||
|
||||
public:
|
||||
|
||||
@ -131,20 +138,20 @@ public:
|
||||
//- Construct from mesh, patch and dictionary
|
||||
extrudePatchMesh
|
||||
(
|
||||
const fvMesh&,
|
||||
const fvPatch&,
|
||||
const dictionary&,
|
||||
const word
|
||||
const fvMesh& mesh,
|
||||
const fvPatch& p,
|
||||
const dictionary& dict,
|
||||
const word& regionName
|
||||
);
|
||||
|
||||
//- Construct from mesh, patch, dictionary and new mesh
|
||||
// polyPatch information
|
||||
extrudePatchMesh
|
||||
(
|
||||
const fvMesh&,
|
||||
const fvPatch&,
|
||||
const dictionary&,
|
||||
const word,
|
||||
const fvMesh& mesh,
|
||||
const fvPatch& p,
|
||||
const dictionary& dict,
|
||||
const word& regionName,
|
||||
const List<polyPatch*>& polyPatches
|
||||
);
|
||||
|
||||
@ -153,8 +160,7 @@ public:
|
||||
virtual ~extrudePatchMesh() = default;
|
||||
|
||||
|
||||
// Member functions
|
||||
|
||||
// Member Functions
|
||||
|
||||
// Access functions
|
||||
|
||||
@ -187,9 +193,9 @@ public:
|
||||
{
|
||||
return extrudedPatch_;
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
} // End namespace Foam
|
||||
|
||||
Reference in New Issue
Block a user