Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Development
openfoam
Commits
86fe2b7b
Commit
86fe2b7b
authored
Feb 21, 2020
by
Mark OLESEN
Browse files
STYLE: remove dead code, refactor constructors in extrudePatchMesh
parent
585ee0fe
Changes
3
Hide whitespace changes
Inline
Side-by-side
applications/utilities/mesh/generation/extrude2DMesh/extrude2DMesh/extrude2DMesh/extrude2DMesh.C
View file @
86fe2b7b
...
...
@@ -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
;
...
...
src/dynamicMesh/extrudePatchMesh/extrudePatchMesh.C
View file @
86fe2b7b
...
...
@@ -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_
(
p
atch
.
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
&
p
atch
,
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
());
...
...
@@ -125,7 +121,7 @@ extrudePatchMesh::extrudePatchMesh
forAll
(
regionPatches
,
patchi
)
{
dictionary
&
patchDict
=
dicts
[
patchi
];
dictionary
&
patchDict
=
dicts
[
patchi
];
patchDict
.
set
(
"nFaces"
,
0
);
patchDict
.
set
(
"startFace"
,
0
);
...
...
@@ -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
(
region
Patches
.
size
()
);
polyTopoChange
meshMod
(
nNew
Patches
);
extruder
.
setRefinement
(
...
...
@@ -343,8 +299,4 @@ void extrudePatchMesh::extrudeMesh(const List<polyPatch*>& regionPatches)
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
}
// End namespace Foam
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
src/dynamicMesh/extrudePatchMesh/extrudePatchMesh.H
View file @
86fe2b7b
...
...
@@ -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
m
ember
f
unctions
// Private
M
ember
F
unctions
//- 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
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment