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
a2b73a1c
Commit
a2b73a1c
authored
Dec 07, 2010
by
Mark Olesen
Browse files
STYLE: use X.last() method instead of X[X.size()-1]
parent
f367ee2e
Changes
12
Hide whitespace changes
Inline
Side-by-side
applications/utilities/mesh/conversion/fluentMeshToFoam/create3DCellShape.C
View file @
a2b73a1c
...
...
@@ -260,7 +260,7 @@ cellShape create3DCellShape
meshFaceLabels
[
i
-
1
]
=
meshFaceLabels
[
i
];
}
meshFaceLabels
[
meshFaceLabels
.
size
()
-
1
]
=
firstLabel
;
meshFaceLabels
.
last
()
=
firstLabel
;
}
}
...
...
applications/utilities/mesh/manipulation/mergeMeshes/mergePolyMesh.C
View file @
a2b73a1c
...
...
@@ -80,7 +80,7 @@ Foam::label Foam::mergePolyMesh::patchIndex(const polyPatch& p)
<<
pName
<<
" in mesh "
<<
caseName
<<
" already exists, but patch types "
<<
" do not match.
\n
Creating a composite name as "
<<
patchNames_
[
patchNames_
.
size
()
-
1
]
<<
endl
;
<<
patchNames_
.
last
()
<<
endl
;
}
else
{
...
...
src/OpenFOAM/matrices/lduMatrix/lduAddressing/lduInterface/processorLduInterfaceTemplates.C
View file @
a2b73a1c
...
...
@@ -150,7 +150,7 @@ void Foam::processorLduInterface::compressedSend
fArray
[
i
]
=
sArray
[
i
]
-
slast
[
i
%
nCmpts
];
}
reinterpret_cast
<
Type
&>
(
fArray
[
nm1
])
=
f
[
f
.
size
()
-
1
]
;
reinterpret_cast
<
Type
&>
(
fArray
[
nm1
])
=
f
.
last
()
;
if
(
commsType
==
Pstream
::
blocking
||
commsType
==
Pstream
::
scheduled
)
{
...
...
@@ -235,7 +235,7 @@ void Foam::processorLduInterface::compressedReceive
const
float
*
fArray
=
reinterpret_cast
<
const
float
*>
(
receiveBuf_
.
begin
());
f
[
f
.
size
()
-
1
]
=
reinterpret_cast
<
const
Type
&>
(
fArray
[
nm1
]);
f
.
last
()
=
reinterpret_cast
<
const
Type
&>
(
fArray
[
nm1
]);
scalar
*
sArray
=
reinterpret_cast
<
scalar
*>
(
f
.
begin
());
const
scalar
*
slast
=
&
sArray
[
nm1
];
...
...
src/OpenFOAM/meshes/meshShapes/face/face.C
View file @
a2b73a1c
...
...
@@ -750,7 +750,7 @@ Foam::edgeList Foam::face::edges() const
}
// add last edge
e
[
points
.
size
()
-
1
]
=
edge
(
points
[
points
.
size
()
-
1
]
,
points
[
0
]);
e
.
last
()
=
edge
(
points
.
last
()
,
points
[
0
]);
return
e
;
}
...
...
src/conversion/meshReader/createPolyBoundary.C
View file @
a2b73a1c
...
...
@@ -305,7 +305,7 @@ void Foam::meshReader::createPolyBoundary()
if
(
nMissingFaces
>
0
)
{
patchSizes_
[
patchSizes_
.
size
()
-
1
]
=
nMissingFaces
;
patchSizes_
.
last
()
=
nMissingFaces
;
}
else
{
...
...
src/dynamicMesh/polyMeshAdder/polyMeshAdder.C
View file @
a2b73a1c
...
...
@@ -127,7 +127,7 @@ Foam::label Foam::polyMeshAdder::patchIndex
<<
pName
<<
" in mesh "
<<
caseName
<<
" already exists, but patch types"
<<
" do not match.
\n
Creating a composite name as "
<<
allPatchNames
[
allPatchNames
.
size
()
-
1
]
<<
endl
;
<<
allPatchNames
.
last
()
<<
endl
;
return
allPatchNames
.
size
()
-
1
;
}
...
...
src/dynamicMesh/slidingInterface/enrichedPatch/enrichedPatchCutFaces.C
View file @
a2b73a1c
...
...
@@ -519,7 +519,7 @@ void Foam::enrichedPatch::calcCutFaces() const
// Reverse the face such that it
// points out of the master patch
cf
[
cf
.
size
()
-
1
]
.
flip
();
cf
.
last
()
.
flip
();
if
(
debug
)
{
...
...
src/lagrangian/dieselSpray/injector/swirlInjector/swirlInjector.C
View file @
a2b73a1c
...
...
@@ -101,8 +101,8 @@ Foam::swirlInjector::swirlInjector
(
mag
(
massFlowRateProfile_
[
massFlowRateProfile_
.
size
()
-
1
]
[
0
]
-
injectionPressureProfile_
[
injectionPressureProfile_
.
size
()
-
1
]
[
0
]
massFlowRateProfile_
.
last
()
[
0
]
-
injectionPressureProfile_
.
last
()
[
0
]
)
>
SMALL
)
{
...
...
src/meshTools/polyMeshZipUpCells/polyMeshZipUpCells.C
View file @
a2b73a1c
...
...
@@ -447,9 +447,7 @@ bool Foam::polyMeshZipUpCells(polyMesh& mesh)
point
startPoint
=
Points
[
unorderedEdge
[
0
]];
dist
[
0
]
=
0
;
vector
dir
=
Points
[
unorderedEdge
[
unorderedEdge
.
size
()
-
1
]]
-
startPoint
;
vector
dir
=
Points
[
unorderedEdge
.
last
()]
-
startPoint
;
for
(
label
i
=
1
;
i
<
dist
.
size
();
i
++
)
{
...
...
@@ -509,7 +507,7 @@ bool Foam::polyMeshZipUpCells(polyMesh& mesh)
edge
testEdge
(
orderedEdge
[
0
],
orderedEdge
[
orderedEdge
.
size
()
-
1
]
orderedEdge
.
last
()
);
// In order to avoid edge-to-edge comparison, get faces using
...
...
src/meshTools/searchableSurface/searchableSurfaceCollection.C
View file @
a2b73a1c
...
...
@@ -292,7 +292,7 @@ const Foam::wordList& Foam::searchableSurfaceCollection::regions() const
Foam
::
label
Foam
::
searchableSurfaceCollection
::
size
()
const
{
return
indexOffset_
[
indexOffset_
.
size
()
-
1
]
;
return
indexOffset_
.
last
()
;
}
...
...
src/meshTools/searchableSurface/triSurfaceMesh.C
View file @
a2b73a1c
...
...
@@ -238,7 +238,7 @@ void Foam::triSurfaceMesh::getNextIntersections
while
(
true
)
{
// Start tracking from last hit.
point
pt
=
hits
[
hits
.
size
()
-
1
]
.
hitPoint
()
+
perturbVec
;
point
pt
=
hits
.
last
()
.
hitPoint
()
+
perturbVec
;
if
(((
pt
-
start
)
&
dirVec
)
>
magSqrDirVec
)
{
...
...
src/triSurface/triSurface/triSurface.C
View file @
a2b73a1c
...
...
@@ -514,7 +514,7 @@ Foam::surfacePatchList Foam::triSurface::calcPatches(labelList& faceMap) const
maxRegion
=
max
(
maxRegion
,
operator
[](
faceMap
[
faceMap
.
size
()
-
1
]
).
region
()
operator
[](
faceMap
.
last
()
).
region
()
);
}
...
...
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