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
655f7d19
Commit
655f7d19
authored
Jan 07, 2019
by
Mark Olesen
Committed by
Andrew Heather
Jan 07, 2019
Browse files
ENH: for-range, forAllIters() ... in parallel/
- reduced clutter when iterating over containers
parent
45590671
Changes
2
Hide whitespace changes
Inline
Side-by-side
src/parallel/decompose/decompositionMethods/decompositionConstraints/singleProcessorFaceSets/singleProcessorFaceSetsConstraint.C
View file @
655f7d19
...
...
@@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2018 OpenCFD Ltd.
\\ / A nd | Copyright (C) 2018
-2019
OpenCFD Ltd.
\\/ M anipulation |
-------------------------------------------------------------------------------
| Copyright (C) 2015-2016 OpenFOAM Foundation
...
...
@@ -159,9 +159,9 @@ void Foam::decompositionConstraints::singleProcessorFaceSets::add
// Check that it does not overlap with existing specifiedProcessorFaces
labelList
nMatch
(
specifiedProcessorFaces
.
size
(),
Zero
);
for
AllConstIter
(
faceSet
,
fz
,
iter
)
for
(
const
label
facei
:
fz
)
{
label
seti
=
faceToSet
[
iter
.
key
()
];
const
label
seti
=
faceToSet
[
facei
];
if
(
seti
!=
-
1
)
{
++
nMatch
[
seti
];
...
...
@@ -191,7 +191,6 @@ void Foam::decompositionConstraints::singleProcessorFaceSets::add
reduce
(
store
,
andOp
<
bool
>
());
if
(
store
)
{
specifiedProcessorFaces
.
append
(
new
labelList
(
fz
.
sortedToc
()));
...
...
src/parallel/distributed/distributedTriSurfaceMesh/distributedTriSurfaceMeshTemplates.C
View file @
655f7d19
...
...
@@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd |
\\ / A nd |
Copyright (C) 2019 OpenCFD Ltd.
\\/ M anipulation |
-------------------------------------------------------------------------------
| Copyright (C) 2011-2013 OpenFOAM Foundation
...
...
@@ -39,8 +39,7 @@ License
// List<Type>& values
//) const
//{
// typedef DimensionedField<Type, triSurfaceGeoMesh> DimensionedSurfField;
//
// typedef DimensionedField<Type, triSurfaceGeoMesh> fieldType;
//
// // Get query data (= local index of triangle)
// // ~~~~~~~~~~~~~~
...
...
@@ -60,10 +59,8 @@ License
// // Do my tests
// // ~~~~~~~~~~~
//
// const DimensionedSurfField& fld = lookupObject<DimensionedSurfField>
// (
// fieldName
// );
// const auto& fld = lookupObject<fieldType>(fieldName);
//
// const triSurface& s = static_cast<const triSurface&>(*this);
//
// values.setSize(triangleIndex.size());
...
...
@@ -88,33 +85,24 @@ void Foam::distributedTriSurfaceMesh::distributeFields
const
mapDistribute
&
map
)
{
typedef
DimensionedField
<
Type
,
triSurfaceGeoMesh
>
DimensionedSurfField
;
typedef
DimensionedField
<
Type
,
triSurfaceGeoMesh
>
fieldType
;
HashTable
<
DimensionedSurfField
*>
fields
HashTable
<
fieldType
*>
fields
(
objectRegistry
::
lookupClass
<
DimensionedSurfField
>
()
objectRegistry
::
lookupClass
<
fieldType
>
()
);
for
(
typename
HashTable
<
DimensionedSurfField
*>::
iterator
fieldIter
=
fields
.
begin
();
fieldIter
!=
fields
.
end
();
++
fieldIter
)
forAllIters
(
fields
,
fieldIter
)
{
DimensionedSurfField
&
field
=
*
fieldIter
();
fieldType
&
field
=
*
fieldIter
();
label
oldSize
=
field
.
size
();
const
label
oldSize
=
field
.
size
();
map
.
distribute
(
field
);
if
(
debug
)
{
Info
<<
"Mapped "
<<
field
.
typeName
<<
' '
<<
field
.
name
()
<<
" from size "
<<
oldSize
<<
" to size "
<<
field
.
size
()
<<
endl
;
}
DebugInfo
<<
"Mapped "
<<
field
.
typeName
<<
' '
<<
field
.
name
()
<<
" from size "
<<
oldSize
<<
" to size "
<<
field
.
size
()
<<
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