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
49d9589d
Commit
49d9589d
authored
Aug 01, 2018
by
Mark OLESEN
Browse files
STYLE: update iterator access and looping in syncTools
parent
640aac95
Changes
2
Expand all
Hide whitespace changes
Inline
Side-by-side
src/OpenFOAM/meshes/polyMesh/syncTools/syncTools.C
View file @
49d9589d
...
...
@@ -3,7 +3,7 @@
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
\\/ M anipulation |
\\/ M anipulation |
Copyright (C) 2018 OpenCFD Ltd.
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
...
...
@@ -44,18 +44,18 @@ void Foam::syncTools::swapBoundaryCellPositions
const
polyBoundaryMesh
&
patches
=
mesh
.
boundaryMesh
();
label
nBnd
=
mesh
.
nFaces
()
-
mesh
.
nInternalFaces
();
neighbourCellData
.
resize
(
mesh
.
nFaces
()
-
mesh
.
nInternalFaces
()
)
;
neighbourCellData
.
setSize
(
nBnd
);
forAll
(
patches
,
patchi
)
for
(
const
polyPatch
&
pp
:
patches
)
{
const
polyPatch
&
pp
=
patches
[
patchi
];
label
bFacei
=
pp
.
start
()
-
mesh
.
nInternalFaces
();
const
labelUList
&
faceCells
=
pp
.
faceCells
();
forAll
(
faceCells
,
i
)
for
(
const
label
celli
:
faceCells
)
{
label
bFacei
=
pp
.
start
()
+
i
-
mesh
.
nInternalFaces
()
;
neighbourCellData
[
bFacei
]
=
cellData
[
faceCells
[
i
]]
;
neighbourCellData
[
bFacei
]
=
cellData
[
celli
]
;
++
bFacei
;
}
}
syncTools
::
swapBoundaryFacePositions
(
mesh
,
neighbourCellData
);
...
...
@@ -64,7 +64,7 @@ void Foam::syncTools::swapBoundaryCellPositions
Foam
::
bitSet
Foam
::
syncTools
::
getMasterPoints
(
const
polyMesh
&
mesh
)
{
bitSet
isMaster
Point
(
mesh
.
nPoints
());
bitSet
isMaster
(
mesh
.
nPoints
());
bitSet
donePoint
(
mesh
.
nPoints
());
const
globalMeshData
&
globalData
=
mesh
.
globalData
();
...
...
@@ -75,7 +75,7 @@ Foam::bitSet Foam::syncTools::getMasterPoints(const polyMesh& mesh)
forAll
(
meshPoints
,
coupledPointi
)
{
label
meshPointi
=
meshPoints
[
coupledPointi
];
const
label
meshPointi
=
meshPoints
[
coupledPointi
];
if
(
(
...
...
@@ -85,7 +85,7 @@ Foam::bitSet Foam::syncTools::getMasterPoints(const polyMesh& mesh)
>
0
)
{
isMaster
Point
.
set
(
meshPointi
);
isMaster
.
set
(
meshPointi
);
}
donePoint
.
set
(
meshPointi
);
}
...
...
@@ -98,17 +98,17 @@ Foam::bitSet Foam::syncTools::getMasterPoints(const polyMesh& mesh)
{
if
(
!
donePoint
.
test
(
pointi
))
{
isMaster
Point
.
set
(
pointi
);
isMaster
.
set
(
pointi
);
}
}
return
isMaster
Point
;
return
isMaster
;
}
Foam
::
bitSet
Foam
::
syncTools
::
getMasterEdges
(
const
polyMesh
&
mesh
)
{
bitSet
isMaster
Edge
(
mesh
.
nEdges
());
bitSet
isMaster
(
mesh
.
nEdges
());
bitSet
doneEdge
(
mesh
.
nEdges
());
const
globalMeshData
&
globalData
=
mesh
.
globalData
();
...
...
@@ -119,7 +119,7 @@ Foam::bitSet Foam::syncTools::getMasterEdges(const polyMesh& mesh)
forAll
(
meshEdges
,
coupledEdgeI
)
{
label
meshEdgeI
=
meshEdges
[
coupledEdgeI
];
const
label
meshEdgeI
=
meshEdges
[
coupledEdgeI
];
if
(
(
...
...
@@ -129,7 +129,7 @@ Foam::bitSet Foam::syncTools::getMasterEdges(const polyMesh& mesh)
>
0
)
{
isMaster
Edge
.
set
(
meshEdgeI
);
isMaster
.
set
(
meshEdgeI
);
}
doneEdge
.
set
(
meshEdgeI
);
}
...
...
@@ -142,38 +142,38 @@ Foam::bitSet Foam::syncTools::getMasterEdges(const polyMesh& mesh)
{
if
(
!
doneEdge
.
test
(
edgeI
))
{
isMaster
Edge
.
set
(
edgeI
);
isMaster
.
set
(
edgeI
);
}
}
return
isMaster
Edge
;
return
isMaster
;
}
Foam
::
bitSet
Foam
::
syncTools
::
getMasterFaces
(
const
polyMesh
&
mesh
)
{
bitSet
isMaster
Face
(
mesh
.
nFaces
(),
true
);
bitSet
isMaster
(
mesh
.
nFaces
(),
true
);
const
polyBoundaryMesh
&
patches
=
mesh
.
boundaryMesh
();
for
All
(
patches
,
patch
i
)
for
(
const
polyPatch
&
pp
:
patch
es
)
{
if
(
p
atches
[
patchi
]
.
coupled
())
if
(
p
p
.
coupled
())
{
const
coupledPolyPatch
&
pp
=
refCast
<
const
coupledPolyPatch
>
(
p
atches
[
patchi
]
);
const
coupledPolyPatch
&
c
pp
=
refCast
<
const
coupledPolyPatch
>
(
p
p
);
if
(
!
pp
.
owner
())
if
(
!
c
pp
.
owner
())
{
forAll
(
pp
,
i
)
{
isMaster
Face
.
unset
(
pp
.
start
()
+
i
);
isMaster
.
unset
(
c
pp
.
start
()
+
i
);
}
}
}
}
return
isMaster
Face
;
return
isMaster
;
}
...
...
@@ -182,21 +182,19 @@ Foam::bitSet Foam::syncTools::getInternalOrMasterFaces
const
polyMesh
&
mesh
)
{
bitSet
isMaster
Face
(
mesh
.
nFaces
(),
true
);
bitSet
isMaster
(
mesh
.
nFaces
(),
true
);
const
polyBoundaryMesh
&
patches
=
mesh
.
boundaryMesh
();
for
All
(
patches
,
patch
i
)
for
(
const
polyPatch
&
pp
:
patch
es
)
{
const
polyPatch
&
pp
=
patches
[
patchi
];
if
(
pp
.
coupled
())
{
if
(
!
refCast
<
const
coupledPolyPatch
>
(
pp
).
owner
())
{
forAll
(
pp
,
i
)
{
isMaster
Face
.
unset
(
pp
.
start
()
+
i
);
isMaster
.
unset
(
pp
.
start
()
+
i
);
}
}
}
...
...
@@ -204,12 +202,12 @@ Foam::bitSet Foam::syncTools::getInternalOrMasterFaces
{
forAll
(
pp
,
i
)
{
isMaster
Face
.
unset
(
pp
.
start
()
+
i
);
isMaster
.
unset
(
pp
.
start
()
+
i
);
}
}
}
return
isMaster
Face
;
return
isMaster
;
}
...
...
@@ -218,24 +216,22 @@ Foam::bitSet Foam::syncTools::getInternalOrCoupledFaces
const
polyMesh
&
mesh
)
{
bitSet
isMaster
Face
(
mesh
.
nFaces
(),
true
);
bitSet
isMaster
(
mesh
.
nFaces
(),
true
);
const
polyBoundaryMesh
&
patches
=
mesh
.
boundaryMesh
();
for
All
(
patches
,
patch
i
)
for
(
const
polyPatch
&
pp
:
patch
es
)
{
const
polyPatch
&
pp
=
patches
[
patchi
];
if
(
!
pp
.
coupled
())
{
forAll
(
pp
,
i
)
{
isMaster
Face
.
unset
(
pp
.
start
()
+
i
);
isMaster
.
unset
(
pp
.
start
()
+
i
);
}
}
}
return
isMaster
Face
;
return
isMaster
;
}
...
...
src/OpenFOAM/meshes/polyMesh/syncTools/syncToolsTemplates.C
View file @
49d9589d
This diff is collapsed.
Click to expand it.
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