Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Development
openfoam
Commits
b4a2876c
Commit
b4a2876c
authored
Mar 07, 2018
by
Mark Olesen
Browse files
ENH: use move construct for cellZone/faceZone
parent
4fe8ed82
Changes
9
Hide whitespace changes
Inline
Side-by-side
applications/utilities/mesh/conversion/fluent3DMeshToFoam/fluent3DMeshToFoam.L
View file @
b4a2876c
...
...
@@ -1168,7 +1168,7 @@ int main(int argc, char *argv[])
forAll(faceZoneIDs, faceZonei)
{
label zoneID = faceGroupZoneID[faceZoneIDs[faceZonei]
];
label zoneID = faceGroupZoneID[faceZoneIDs[faceZonei]];
word name = groupName[zoneID];
const word& type = groupType[zoneID];
...
...
applications/utilities/mesh/generation/blockMesh/mergePatchPairs.H
View file @
b4a2876c
...
...
@@ -29,17 +29,10 @@
const
polyPatch
&
masterPatch
=
mesh
.
boundaryMesh
()[
masterPatchName
];
labelList
isf
(
masterPatch
.
size
());
forAll
(
isf
,
i
)
{
isf
[
i
]
=
masterPatch
.
start
()
+
i
;
}
fz
[
3
*
pairI
]
=
new
faceZone
(
mergeName
+
"MasterZone"
,
i
sf
,
i
dentity
(
masterPatch
.
size
(),
masterPatch
.
start
())
,
false
,
// none are flipped
0
,
mesh
.
faceZones
()
...
...
@@ -50,17 +43,10 @@
const
polyPatch
&
slavePatch
=
mesh
.
boundaryMesh
()[
slavePatchName
];
labelList
osf
(
slavePatch
.
size
());
forAll
(
osf
,
i
)
{
osf
[
i
]
=
slavePatch
.
start
()
+
i
;
}
fz
[
3
*
pairI
+
1
]
=
new
faceZone
(
mergeName
+
"SlaveZone"
,
osf
,
identity
(
slavePatch
.
size
(),
slavePatch
.
start
())
,
false
,
// none are flipped
1
,
mesh
.
faceZones
()
...
...
applications/utilities/mesh/manipulation/createBaffles/createBaffles.C
View file @
b4a2876c
...
...
@@ -591,7 +591,7 @@ int main(int argc, char *argv[])
{
addr
[
n
]
=
facei
;
flip
[
n
]
=
faceToFlip
[
facei
];
n
++
;
++
n
;
}
}
...
...
applications/utilities/mesh/manipulation/splitMesh/splitMesh.C
View file @
b4a2876c
...
...
@@ -233,8 +233,8 @@ int main(int argc, char *argv[])
new
faceZone
(
"membraneFaces"
,
faces
,
zoneFlip
,
std
::
move
(
faces
)
,
std
::
move
(
zoneFlip
)
,
0
,
mesh
.
faceZones
()
);
...
...
applications/utilities/mesh/manipulation/splitMeshRegions/splitMeshRegions.C
View file @
b4a2876c
...
...
@@ -1925,7 +1925,7 @@ int main(int argc, char *argv[])
new
cellZone
(
zoneName
,
//name
regionCells
,
//addressing
std
::
move
(
regionCells
)
,
//addressing
zoneI
,
//index
cellZones
//cellZoneMesh
)
...
...
src/topoChangerFvMesh/linearValveFvMesh/linearValveFvMesh.C
View file @
b4a2876c
...
...
@@ -3,7 +3,7 @@
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011-2017 OpenFOAM Foundation
\\/ M anipulation |
\\/ M anipulation |
Copyright (C) 2018 OpenCFD Ltd.
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
...
...
@@ -79,17 +79,10 @@ void Foam::linearValveFvMesh::addZonesAndModifiers()
const
word
innerSliderName
(
motionDict_
.
subDict
(
"slider"
).
lookup
(
"inside"
));
const
polyPatch
&
innerSlider
=
boundaryMesh
()[
innerSliderName
];
labelList
isf
(
innerSlider
.
size
());
forAll
(
isf
,
i
)
{
isf
[
i
]
=
innerSlider
.
start
()
+
i
;
}
fz
[
0
]
=
new
faceZone
(
"insideSliderZone"
,
i
sf
,
i
dentity
(
innerSlider
.
size
(),
innerSlider
.
start
())
,
false
,
// none are flipped
0
,
faceZones
()
...
...
@@ -99,17 +92,10 @@ void Foam::linearValveFvMesh::addZonesAndModifiers()
const
word
outerSliderName
(
motionDict_
.
subDict
(
"slider"
).
lookup
(
"outside"
));
const
polyPatch
&
outerSlider
=
boundaryMesh
()[
outerSliderName
];
labelList
osf
(
outerSlider
.
size
());
forAll
(
osf
,
i
)
{
osf
[
i
]
=
outerSlider
.
start
()
+
i
;
}
fz
[
1
]
=
new
faceZone
(
"outsideSliderZone"
,
osf
,
identity
(
outerSlider
.
size
(),
outerSlider
.
start
())
,
false
,
// none are flipped
1
,
faceZones
()
...
...
src/topoChangerFvMesh/linearValveLayersFvMesh/linearValveLayersFvMesh.C
View file @
b4a2876c
...
...
@@ -3,7 +3,7 @@
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011-2017 OpenFOAM Foundation
\\/ M anipulation |
\\/ M anipulation |
Copyright (C) 2018 OpenCFD Ltd.
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
...
...
@@ -86,17 +86,10 @@ void Foam::linearValveLayersFvMesh::addZonesAndModifiers()
const
word
innerSliderName
(
motionDict_
.
subDict
(
"slider"
).
lookup
(
"inside"
));
const
polyPatch
&
innerSlider
=
boundaryMesh
()[
innerSliderName
];
labelList
isf
(
innerSlider
.
size
());
forAll
(
isf
,
i
)
{
isf
[
i
]
=
innerSlider
.
start
()
+
i
;
}
fz
[
0
]
=
new
faceZone
(
"insideSliderZone"
,
i
sf
,
i
dentity
(
innerSlider
.
size
(),
innerSlider
.
start
())
,
false
,
// none are flipped
0
,
faceZones
()
...
...
@@ -106,17 +99,10 @@ void Foam::linearValveLayersFvMesh::addZonesAndModifiers()
const
word
outerSliderName
(
motionDict_
.
subDict
(
"slider"
).
lookup
(
"outside"
));
const
polyPatch
&
outerSlider
=
boundaryMesh
()[
outerSliderName
];
labelList
osf
(
outerSlider
.
size
());
forAll
(
osf
,
i
)
{
osf
[
i
]
=
outerSlider
.
start
()
+
i
;
}
fz
[
1
]
=
new
faceZone
(
"outsideSliderZone"
,
osf
,
identity
(
outsideSlider
.
size
(),
outsideSlider
.
start
())
,
false
,
// none are flipped
1
,
faceZones
()
...
...
@@ -133,16 +119,10 @@ void Foam::linearValveLayersFvMesh::addZonesAndModifiers()
const
polyPatch
&
layerPatch
=
boundaryMesh
()[
layerPatchName
];
labelList
lpf
(
layerPatch
.
size
());
forAll
(
lpf
,
i
)
{
lpf
[
i
]
=
layerPatch
.
start
()
+
i
;
}
fz
[
3
]
=
new
faceZone
(
"valveLayerZone"
,
identity
(
layerPatch
.
size
(),
layerPatch
.
start
()),
lpf
,
true
,
// all are flipped
0
,
...
...
src/topoChangerFvMesh/mixerFvMesh/mixerFvMesh.C
View file @
b4a2876c
...
...
@@ -3,7 +3,7 @@
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011-2017 OpenFOAM Foundation
\\/ M anipulation |
\\/ M anipulation |
Copyright (C) 2018 OpenCFD Ltd.
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
...
...
@@ -79,17 +79,10 @@ void Foam::mixerFvMesh::addZonesAndModifiers()
const
word
innerSliderName
(
motionDict_
.
subDict
(
"slider"
).
lookup
(
"inside"
));
const
polyPatch
&
innerSlider
=
boundaryMesh
()[
innerSliderName
];
labelList
isf
(
innerSlider
.
size
());
forAll
(
isf
,
i
)
{
isf
[
i
]
=
innerSlider
.
start
()
+
i
;
}
fz
[
0
]
=
new
faceZone
(
"insideSliderZone"
,
i
sf
,
i
dentity
(
innerSlider
.
size
(),
innerSlider
.
start
())
,
false
,
// none are flipped
0
,
faceZones
()
...
...
@@ -99,17 +92,10 @@ void Foam::mixerFvMesh::addZonesAndModifiers()
const
word
outerSliderName
(
motionDict_
.
subDict
(
"slider"
).
lookup
(
"outside"
));
const
polyPatch
&
outerSlider
=
boundaryMesh
()[
outerSliderName
];
labelList
osf
(
outerSlider
.
size
());
forAll
(
osf
,
i
)
{
osf
[
i
]
=
outerSlider
.
start
()
+
i
;
}
fz
[
1
]
=
new
faceZone
(
"outsideSliderZone"
,
osf
,
identity
(
outerSlider
.
size
(),
outerSlider
.
start
())
,
false
,
// none are flipped
1
,
faceZones
()
...
...
@@ -124,7 +110,7 @@ void Foam::mixerFvMesh::addZonesAndModifiers()
regionSplit
rs
(
*
this
);
// Get the region of the cell containing the origin.
label
originRegion
=
rs
[
findNearestCell
(
cs
().
origin
())];
const
label
originRegion
=
rs
[
findNearestCell
(
cs
().
origin
())];
labelList
movingCells
(
nCells
());
label
nMovingCells
=
0
;
...
...
@@ -134,17 +120,17 @@ void Foam::mixerFvMesh::addZonesAndModifiers()
if
(
rs
[
celli
]
==
originRegion
)
{
movingCells
[
nMovingCells
]
=
celli
;
nMovingCells
++
;
++
nMovingCells
;
}
}
movingCells
.
setS
ize
(
nMovingCells
);
movingCells
.
res
ize
(
nMovingCells
);
Info
<<
"Number of cells in the moving region: "
<<
nMovingCells
<<
endl
;
cz
[
0
]
=
new
cellZone
(
"movingCells"
,
movingCells
,
std
::
move
(
movingCells
)
,
0
,
cellZones
()
);
...
...
@@ -203,14 +189,14 @@ void Foam::mixerFvMesh::calcMovingMasks() const
const
labelList
&
cellAddr
=
cellZones
()[
"movingCells"
];
for
All
(
cellAddr
,
cell
i
)
for
(
const
label
celli
:
cell
Addr
)
{
const
cell
&
curCell
=
c
[
cell
Addr
[
celli
]
];
const
cell
&
curCell
=
c
[
cell
i
];
for
All
(
curCell
,
facei
)
for
(
const
label
facei
:
curCell
)
{
// Mark all the points as moving
const
face
&
curFace
=
f
[
curCell
[
facei
]
]
;
const
face
&
curFace
=
f
[
facei
];
forAll
(
curFace
,
pointi
)
{
...
...
@@ -227,9 +213,9 @@ void Foam::mixerFvMesh::calcMovingMasks() const
const
labelList
&
innerSliderAddr
=
faceZones
()[
innerSliderZoneName
];
for
All
(
innerSliderAddr
,
facei
)
for
(
const
label
facei
:
innerSliderAddr
)
{
const
face
&
curFace
=
f
[
innerSliderAddr
[
facei
]
]
;
const
face
&
curFace
=
f
[
facei
];
forAll
(
curFace
,
pointi
)
{
...
...
@@ -245,9 +231,9 @@ void Foam::mixerFvMesh::calcMovingMasks() const
const
labelList
&
outerSliderAddr
=
faceZones
()[
outerSliderZoneName
];
for
All
(
outerSliderAddr
,
facei
)
for
(
const
label
facei
:
outerSliderAddr
)
{
const
face
&
curFace
=
f
[
outerSliderAddr
[
facei
]
]
;
const
face
&
curFace
=
f
[
facei
];
forAll
(
curFace
,
pointi
)
{
...
...
src/topoChangerFvMesh/movingConeTopoFvMesh/movingConeTopoFvMesh.C
View file @
b4a2876c
...
...
@@ -3,7 +3,7 @@
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011-2017 OpenFOAM Foundation
\\/ M anipulation |
\\/ M anipulation |
Copyright (C) 2018 OpenCFD Ltd.
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
...
...
@@ -133,7 +133,7 @@ void Foam::movingConeTopoFvMesh::addZonesAndModifiers()
zone1
[
nZoneFaces1
]
=
facei
;
Info
<<
"face "
<<
facei
<<
" for zone 1. Flip: "
<<
flipZone1
[
nZoneFaces1
]
<<
endl
;
nZoneFaces1
++
;
++
nZoneFaces1
;
}
else
if
(
...
...
@@ -150,7 +150,7 @@ void Foam::movingConeTopoFvMesh::addZonesAndModifiers()
Info
<<
"face "
<<
facei
<<
" for zone 2. Flip: "
<<
flipZone2
[
nZoneFaces2
]
<<
endl
;
nZoneFaces2
++
;
++
nZoneFaces2
;
}
}
...
...
@@ -173,23 +173,23 @@ void Foam::movingConeTopoFvMesh::addZonesAndModifiers()
new
faceZone
(
"rightExtrusionFaces"
,
zone1
,
flipZone1
,
std
::
move
(
zone1
)
,
std
::
move
(
flipZone1
)
,
nFz
,
faceZones
()
);
nFz
++
;
++
nFz
;
fz
[
nFz
]
=
new
faceZone
(
"leftExtrusionFaces"
,
zone2
,
flipZone2
,
std
::
move
(
zone2
)
,
std
::
move
(
flipZone2
)
,
nFz
,
faceZones
()
);
nFz
++
;
++
nFz
;
fz
.
setSize
(
nFz
);
...
...
@@ -218,7 +218,7 @@ void Foam::movingConeTopoFvMesh::addZonesAndModifiers()
motionDict_
.
subDict
(
"right"
).
lookup
(
"maxThickness"
)
)
);
nMods
++
;
++
nMods
;
tm
[
nMods
]
=
new
layerAdditionRemoval
(
...
...
@@ -235,7 +235,7 @@ void Foam::movingConeTopoFvMesh::addZonesAndModifiers()
motionDict_
.
subDict
(
"left"
).
lookup
(
"maxThickness"
)
)
);
nMods
++
;
++
nMods
;
tm
.
setSize
(
nMods
);
Info
<<
"Adding "
<<
nMods
<<
" mesh modifiers"
<<
endl
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a 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