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
45590671
Commit
45590671
authored
Jan 07, 2019
by
Mark Olesen
Committed by
Andrew Heather
Jan 07, 2019
Browse files
ENH: for-range, forAllIters() ... in dynamicMesh/
- reduced clutter when iterating over containers
parent
f5163e50
Changes
31
Hide whitespace changes
Inline
Side-by-side
src/dynamicFvMesh/dynamicRefineFvMesh/dynamicRefineFvMeshTemplates.C
View file @
45590671
...
...
@@ -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 |
-------------------------------------------------------------------------------
License
...
...
@@ -105,16 +105,14 @@ void Foam::dynamicRefineFvMesh::mapNewInternalFaces
typedef
GeometricField
<
T
,
fvsPatchField
,
surfaceMesh
>
GeoField
;
HashTable
<
GeoField
*>
sFlds
(
this
->
objectRegistry
::
lookupClass
<
GeoField
>
());
forAllIter
(
typename
HashTable
<
GeoField
*>
,
sFlds
,
iter
)
forAllIter
s
(
sFlds
,
iter
)
{
//if (mapSurfaceFields_.found(iter.key()))
{
if
(
debug
)
{
Info
<<
"dynamicRefineFvMesh::mapNewInternalFaces():"
<<
" Mapping new internal faces by interpolation on "
<<
iter
.
key
()
<<
endl
;
}
DebugInfo
<<
"dynamicRefineFvMesh::mapNewInternalFaces():"
<<
" Mapping new internal faces by interpolation on "
<<
iter
.
key
()
<<
endl
;
GeoField
&
sFld
=
*
iter
();
...
...
@@ -143,27 +141,23 @@ void Foam::dynamicRefineFvMesh::mapNewInternalFaces
typedef
GeometricField
<
T
,
fvsPatchField
,
surfaceMesh
>
GeoField
;
HashTable
<
GeoField
*>
sFlds
(
this
->
objectRegistry
::
lookupClass
<
GeoField
>
());
forAllIter
(
typename
HashTable
<
GeoField
*>
,
sFlds
,
iter
)
forAllIter
s
(
sFlds
,
iter
)
{
//if (mapSurfaceFields_.found(iter.key()))
{
if
(
debug
)
{
Info
<<
"dynamicRefineFvMesh::mapNewInternalFaces():"
<<
" Mapping new internal faces by interpolation on "
<<
iter
.
key
()
<<
endl
;
}
DebugInfo
<<
"dynamicRefineFvMesh::mapNewInternalFaces():"
<<
" Mapping new internal faces by interpolation on "
<<
iter
.
key
()
<<
endl
;
GeoField
&
sFld
=
*
iter
();
if
(
sFld
.
oriented
()())
{
if
(
debug
)
{
Info
<<
"dynamicRefineFvMesh::mapNewInternalFaces(): "
<<
"Converting oriented field "
<<
iter
.
key
()
<<
" to intensive field and mapping"
<<
endl
;
}
DebugInfo
<<
"dynamicRefineFvMesh::mapNewInternalFaces(): "
<<
"Converting oriented field "
<<
iter
.
key
()
<<
" to intensive field and mapping"
<<
endl
;
// Assume any oriented field is face area weighted (i.e. a flux)
// Convert to intensive (& oriented) before mapping. Untested.
...
...
src/dynamicMesh/attachDetach/attachInterface.C
View file @
45590671
...
...
@@ -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-2016 OpenFOAM Foundation
...
...
@@ -196,10 +196,9 @@ void Foam::attachDetach::attachInterface
forAll
(
newFace
,
pointi
)
{
Map
<
label
>::
const_iterator
rpmIter
=
removedPointMap
.
find
(
newFace
[
pointi
]);
const
auto
rpmIter
=
removedPointMap
.
cfind
(
newFace
[
pointi
]);
if
(
rpmIter
!=
removedPointMap
.
e
nd
())
if
(
rpmIter
.
fou
nd
())
{
// Point mapped. Replace it
newFace
[
pointi
]
=
rpmIter
();
...
...
@@ -225,7 +224,7 @@ void Foam::attachDetach::attachInterface
}
label
patchID
=
mesh
.
boundaryMesh
().
whichPatch
(
curFaceID
);
const
label
patchID
=
mesh
.
boundaryMesh
().
whichPatch
(
curFaceID
);
label
neiCell
;
if
(
patchID
==
-
1
)
{
...
...
src/dynamicMesh/createShellMesh/createShellMesh.C
View file @
45590671
...
...
@@ -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-2016 OpenFOAM Foundation
...
...
@@ -398,9 +398,9 @@ void Foam::createShellMesh::calcPointRegions
{
label
globalRegionI
=
pointGlobalRegions
[
facei
][
fp
];
Map
<
label
>::
itera
to
r
fnd
=
globalToLocalRegion
.
find
(
globalRegionI
);
const
au
to
fnd
=
globalToLocalRegion
.
c
find
(
globalRegionI
);
if
(
fnd
!=
globalToLocalRegion
.
e
nd
())
if
(
fnd
.
fou
nd
())
{
// Already encountered this global region. Assign same local one
pRegions
[
fp
]
=
fnd
();
...
...
src/dynamicMesh/fvMeshAdder/fvMeshAdderTemplates.C
View file @
45590671
...
...
@@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2015-201
6
OpenCFD Ltd.
\\ / A nd | Copyright (C) 2015-201
9
OpenCFD Ltd.
\\/ M anipulation |
-------------------------------------------------------------------------------
| Copyright (C) 2011-2016 OpenFOAM Foundation
...
...
@@ -64,8 +64,7 @@ void Foam::fvMeshAdder::MapVolField
// Patch fields from old mesh
// ~~~~~~~~~~~~~~~~~~~~~~~~~~
typename
GeometricField
<
Type
,
fvPatchField
,
volMesh
>::
Boundary
&
bfld
=
fld
.
boundaryFieldRef
();
auto
&
bfld
=
fld
.
boundaryFieldRef
();
{
const
labelList
&
oldPatchMap
=
meshMap
.
oldPatchMap
();
...
...
@@ -93,7 +92,7 @@ void Foam::fvMeshAdder::MapVolField
forAll
(
oldPatchMap
,
patchi
)
{
label
newPatchi
=
oldPatchMap
[
patchi
];
const
label
newPatchi
=
oldPatchMap
[
patchi
];
if
(
newPatchi
!=
-
1
)
{
...
...
@@ -270,18 +269,16 @@ void Foam::fvMeshAdder::MapVolFields
const
bool
fullyMapped
)
{
HashTable
<
const
GeometricField
<
Type
,
fvPatchField
,
volMesh
>*>
fields
typedef
GeometricField
<
Type
,
fvPatchField
,
volMesh
>
fldType
;
HashTable
<
const
fldType
*>
fields
(
mesh
.
objectRegistry
::
lookupClass
<
GeometricField
<
Type
,
fvPatchField
,
volMesh
>>
()
mesh
.
objectRegistry
::
lookupClass
<
fldType
>
()
);
HashTable
<
const
GeometricFie
ld
<
Type
,
fvPatchField
,
volMesh
>
*>
fieldsToAdd
HashTable
<
const
f
ldType
*>
fieldsToAdd
(
meshToAdd
.
objectRegistry
::
lookupClass
<
GeometricField
<
Type
,
fvPatchField
,
volMesh
>>
()
meshToAdd
.
objectRegistry
::
lookupClass
<
fldType
>
()
);
// It is necessary to enforce that all old-time fields are stored
...
...
@@ -289,41 +286,25 @@ void Foam::fvMeshAdder::MapVolFields
// old-time-level field is mapped before the field itself, sizes
// will not match.
for
(
typename
HashTable
<
const
GeometricField
<
Type
,
fvPatchField
,
volMesh
>*>::
iterator
fieldIter
=
fields
.
begin
();
fieldIter
!=
fields
.
end
();
++
fieldIter
)
forAllIters
(
fields
,
fieldIter
)
{
fldType
&
fld
=
const_cast
<
fldType
&>
(
*
fieldIter
());
DebugPout
<<
"MapVolFields : Storing old time for "
<<
f
ieldIter
()
->
name
()
<<
"MapVolFields : Storing old time for "
<<
f
ld
.
name
()
<<
endl
;
const_cast
<
GeometricField
<
Type
,
fvPatchField
,
volMesh
>*>
(
fieldIter
())
->
storeOldTimes
();
fld
.
storeOldTimes
();
}
for
(
typename
HashTable
<
const
GeometricField
<
Type
,
fvPatchField
,
volMesh
>*>::
iterator
fieldIter
=
fields
.
begin
();
fieldIter
!=
fields
.
end
();
++
fieldIter
)
forAllIters
(
fields
,
fieldIter
)
{
GeometricField
<
Type
,
fvPatchField
,
volMesh
>&
fld
=
const_cast
<
GeometricField
<
Type
,
fvPatchField
,
volMesh
>&>
(
*
fieldIter
()
);
fldType
&
fld
=
const_cast
<
fldType
&>
(
*
fieldIter
());
if
(
fieldsToAdd
.
found
(
fld
.
name
()))
{
const
GeometricField
<
Type
,
fvPatchField
,
volMesh
>&
fldToAdd
=
*
fieldsToAdd
[
fld
.
name
()];
const
fldType
&
fldToAdd
=
*
fieldsToAdd
[
fld
.
name
()];
DebugPout
<<
"MapVolFields : mapping "
<<
fld
.
name
()
...
...
@@ -355,8 +336,7 @@ void Foam::fvMeshAdder::MapSurfaceField
const
fvMesh
&
mesh
=
fld
.
mesh
();
const
labelList
&
oldPatchStarts
=
meshMap
.
oldPatchStarts
();
typename
GeometricField
<
Type
,
fvsPatchField
,
surfaceMesh
>::
Boundary
&
bfld
=
fld
.
boundaryFieldRef
();
auto
&
bfld
=
fld
.
boundaryFieldRef
();
// Internal field
// ~~~~~~~~~~~~~~
...
...
@@ -424,7 +404,7 @@ void Foam::fvMeshAdder::MapSurfaceField
forAll
(
oldPatchMap
,
patchi
)
{
label
newPatchi
=
oldPatchMap
[
patchi
];
const
label
newPatchi
=
oldPatchMap
[
patchi
];
if
(
newPatchi
!=
-
1
)
{
...
...
@@ -618,29 +598,19 @@ void Foam::fvMeshAdder::MapSurfaceFields
// old-time-level field is mapped before the field itself, sizes
// will not match.
for
(
typename
HashTable
<
const
fldType
*>::
iterator
fieldIter
=
fields
.
begin
();
fieldIter
!=
fields
.
end
();
++
fieldIter
)
forAllIters
(
fields
,
fieldIter
)
{
fldType
&
fld
=
const_cast
<
fldType
&>
(
*
fieldIter
());
DebugPout
<<
"MapSurfaceFields : Storing old time for "
<<
f
ieldIter
()
->
name
()
<<
endl
;
<<
f
ld
.
name
()
<<
endl
;
const_cast
<
fldType
*>
(
fieldIter
())
->
storeOldTimes
();
fld
.
storeOldTimes
();
}
for
(
typename
HashTable
<
const
fldType
*>::
iterator
fieldIter
=
fields
.
begin
();
fieldIter
!=
fields
.
end
();
++
fieldIter
)
forAllIters
(
fields
,
fieldIter
)
{
fldType
&
fld
=
const_cast
<
fldType
&>
(
*
fieldIter
());
...
...
@@ -708,13 +678,7 @@ void Foam::fvMeshAdder::MapDimFields
meshToAdd
.
objectRegistry
::
lookupClass
<
fldType
>
(
true
)
);
for
(
typename
HashTable
<
const
fldType
*>::
iterator
fieldIter
=
fields
.
begin
();
fieldIter
!=
fields
.
end
();
++
fieldIter
)
forAllIters
(
fields
,
fieldIter
)
{
fldType
&
fld
=
const_cast
<
fldType
&>
(
*
fieldIter
());
...
...
src/dynamicMesh/fvMeshDistribute/fvMeshDistribute.C
View file @
45590671
...
...
@@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2015-201
8
OpenCFD Ltd.
\\ / A nd | Copyright (C) 2015-201
9
OpenCFD Ltd.
\\/ M anipulation |
-------------------------------------------------------------------------------
| Copyright (C) 2011-2018 OpenFOAM Foundation
...
...
@@ -713,20 +713,17 @@ Foam::autoPtr<Foam::mapPolyMesh> Foam::fvMeshDistribute::mergeSharedPoints
label
globali
=
pointToGlobalMaster
[
pointi
];
if
(
globali
!=
-
1
)
{
Map
<
label
>::
const_iterator
iter
=
globalMasterToLocalMaster
.
find
(
globali
);
const
auto
iter
=
globalMasterToLocalMaster
.
cfind
(
globali
);
if
(
iter
==
globalMasterToLocalMaster
.
e
nd
())
if
(
iter
.
fou
nd
())
{
// Found first point. Designate as master
globalMasterToLocalMaster
.
insert
(
globali
,
pointi
);
pointToMaster
.
insert
(
pointi
,
pointi
);
pointToMaster
.
insert
(
pointi
,
*
iter
);
}
else
{
pointToMaster
.
insert
(
pointi
,
iter
());
// Found first point. Designate as master
globalMasterToLocalMaster
.
insert
(
globali
,
pointi
);
pointToMaster
.
insert
(
pointi
,
pointi
);
}
}
}
...
...
@@ -1097,11 +1094,11 @@ void Foam::fvMeshDistribute::findCouples
{
labelPair
myData
(
sourceFace
[
bFacei
],
sourceProc
[
bFacei
]);
labelPairLookup
::
const_itera
to
r
iter
=
map
.
find
(
myData
);
const
au
to
iter
=
map
.
c
find
(
myData
);
if
(
iter
!=
map
.
e
nd
())
if
(
iter
.
fou
nd
())
{
label
nbrBFacei
=
iter
()
;
label
nbrBFacei
=
*
iter
;
masterCoupledFaces
[
coupledI
]
=
mesh
.
nInternalFaces
()
+
bFacei
;
slaveCoupledFaces
[
coupledI
]
=
...
...
src/dynamicMesh/fvMeshDistribute/fvMeshDistributeTemplates.C
View file @
45590671
...
...
@@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2015-201
7
OpenCFD Ltd.
\\ / A nd | Copyright (C) 2015-201
9
OpenCFD Ltd.
\\/ M anipulation |
-------------------------------------------------------------------------------
| Copyright (C) 2011-2016 OpenFOAM Foundation
...
...
@@ -37,7 +37,7 @@ void Foam::fvMeshDistribute::printFieldInfo(const fvMesh& mesh)
mesh
.
objectRegistry
::
lookupClass
<
GeoField
>
()
);
forAllConstIter
(
typename
HashTable
<
const
GeoField
*>
,
flds
,
iter
)
forAllConstIter
s
(
flds
,
iter
)
{
const
GeoField
&
fld
=
*
iter
();
...
...
@@ -69,20 +69,19 @@ void Foam::fvMeshDistribute::saveBoundaryFields
HashTable
<
const
fldType
*>
flds
(
static_cast
<
const
fvMesh
&>
(
mesh_
)
.
objectRegistry
::
lookupClass
<
fldType
>
()
mesh_
.
objectRegistry
::
lookupClass
<
const
fldType
>
()
);
bflds
.
setSize
(
flds
.
size
());
label
i
=
0
;
forAllConstIter
(
typename
HashTable
<
const
fldType
*>
,
flds
,
iter
)
forAllConstIters
(
flds
,
iter
)
{
const
fldType
&
fld
=
*
iter
();
bflds
.
set
(
i
,
fld
.
boundaryField
().
clone
().
ptr
());
i
++
;
++
i
;
}
}
...
...
@@ -114,10 +113,10 @@ void Foam::fvMeshDistribute::mapBoundaryFields
label
fieldi
=
0
;
forAllIter
(
typename
HashTable
<
fldType
*>
,
flds
,
iter
)
forAllIter
s
(
flds
,
iter
)
{
fldType
&
fld
=
*
iter
();
typename
fldType
::
Boundary
&
bfld
=
fld
.
boundaryFieldRef
();
auto
&
bfld
=
fld
.
boundaryFieldRef
();
const
FieldField
<
fvsPatchField
,
T
>&
oldBfld
=
oldBflds
[
fieldi
++
];
...
...
@@ -158,20 +157,20 @@ void Foam::fvMeshDistribute::saveInternalFields
HashTable
<
const
fldType
*>
flds
(
static_cast
<
const
fvMesh
&>
(
mesh_
)
.
objectRegistry
::
lookupClass
<
fldType
>
()
mesh_
.
objectRegistry
::
lookupClass
<
const
fldType
>
()
);
iflds
.
setSize
(
flds
.
size
());
label
i
=
0
;
forAllConstIter
(
typename
HashTable
<
const
fldType
*>
,
flds
,
iter
)
forAllConstIter
s
(
flds
,
iter
)
{
const
fldType
&
fld
=
*
iter
();
iflds
.
set
(
i
,
fld
.
primitiveField
().
clone
());
i
++
;
++
i
;
}
}
...
...
@@ -204,7 +203,7 @@ void Foam::fvMeshDistribute::mapExposedFaces
label
fieldI
=
0
;
forAllIter
(
typename
HashTable
<
fldType
*>
,
flds
,
iter
)
forAllIter
s
(
flds
,
iter
)
{
fldType
&
fld
=
*
iter
();
const
bool
oriented
=
fld
.
oriented
()();
...
...
@@ -253,11 +252,11 @@ void Foam::fvMeshDistribute::initPatchFields
mesh_
.
objectRegistry
::
lookupClass
<
GeoField
>
()
);
forAllIter
(
typename
HashTable
<
GeoField
*>
,
flds
,
iter
)
forAllIter
s
(
flds
,
iter
)
{
GeoField
&
fld
=
*
iter
();
typename
GeoField
::
Boundary
&
bfld
=
fld
.
boundaryFieldRef
();
auto
&
bfld
=
fld
.
boundaryFieldRef
();
forAll
(
bfld
,
patchi
)
{
...
...
@@ -280,9 +279,9 @@ void Foam::fvMeshDistribute::correctBoundaryConditions()
mesh_
.
objectRegistry
::
lookupClass
<
GeoField
>
()
);
forAllIter
(
typename
HashTable
<
GeoField
*>
,
flds
,
iter
)
forAllIter
s
(
flds
,
iter
)
{
const
GeoField
&
fld
=
*
iter
();
GeoField
&
fld
=
*
iter
();
fld
.
correctBoundaryConditions
();
}
}
...
...
src/dynamicMesh/fvMeshSubset/fvMeshSubsetInterpolate.C
View file @
45590671
...
...
@@ -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-2016 OpenFOAM Foundation
...
...
@@ -465,11 +465,11 @@ Foam::fvMeshSubset::interpolate
// Get mesh point on original mesh.
label
meshPointi
=
pointMap
[
subMeshPoints
[
localI
]];
Map
<
label
>::
const_itera
to
r
iter
=
meshPointMap
.
find
(
meshPointi
);
const
au
to
iter
=
meshPointMap
.
c
find
(
meshPointi
);
if
(
iter
!=
meshPointMap
.
e
nd
())
if
(
iter
.
fou
nd
())
{
directAddressing
[
localI
]
=
iter
()
;
directAddressing
[
localI
]
=
*
iter
;
}
}
...
...
src/dynamicMesh/fvMeshTools/fvMeshToolsTemplates.C
View file @
45590671
...
...
@@ -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) 2012-2016 OpenFOAM Foundation
...
...
@@ -45,12 +45,11 @@ void Foam::fvMeshTools::addPatchFields
mesh
.
objectRegistry
::
lookupClass
<
GeoField
>
()
);
forAllIter
(
typename
HashTable
<
GeoField
*>
,
flds
,
iter
)
forAllIter
s
(
flds
,
iter
)
{
GeoField
&
fld
=
*
iter
();
typename
GeoField
::
Boundary
&
bfld
=
fld
.
boundaryFieldRef
();
auto
&
bfld
=
fld
.
boundaryFieldRef
();
label
sz
=
bfld
.
size
();
bfld
.
setSize
(
sz
+
1
);
...
...
@@ -99,12 +98,11 @@ void Foam::fvMeshTools::setPatchFields
mesh
.
objectRegistry
::
lookupClass
<
GeoField
>
()
);
forAllIter
(
typename
HashTable
<
GeoField
*>
,
flds
,
iter
)
forAllIter
s
(
flds
,
iter
)
{
GeoField
&
fld
=
*
iter
();
typename
GeoField
::
Boundary
&
bfld
=
fld
.
boundaryFieldRef
();
auto
&
bfld
=
fld
.
boundaryFieldRef
();
if
(
patchFieldDict
.
found
(
fld
.
name
()))
{
...
...
@@ -138,12 +136,11 @@ void Foam::fvMeshTools::setPatchFields
mesh
.
objectRegistry
::
lookupClass
<
GeoField
>
()
);
forAllIter
(
typename
HashTable
<
GeoField
*>
,
flds
,
iter
)
forAllIter
s
(
flds
,
iter
)
{
GeoField
&
fld
=
*
iter
();
typename
GeoField
::
Boundary
&
bfld
=
fld
.
boundaryFieldRef
();
auto
&
bfld
=
fld
.
boundaryFieldRef
();
bfld
[
patchi
]
==
value
;
}
...
...
@@ -159,7 +156,7 @@ void Foam::fvMeshTools::trimPatchFields(fvMesh& mesh, const label nPatches)
mesh
.
objectRegistry
::
lookupClass
<
GeoField
>
()
);
forAllIter
(
typename
HashTable
<
GeoField
*>
,
flds
,
iter
)
forAllIter
s
(
flds
,
iter
)
{
GeoField
&
fld
=
*
iter
();
fld
.
boundaryFieldRef
().
setSize
(
nPatches
);
...
...
@@ -180,12 +177,11 @@ void Foam::fvMeshTools::reorderPatchFields
mesh
.
objectRegistry
::
lookupClass
<
GeoField
>
()
);
forAllIter
(
typename
HashTable
<
GeoField
*>
,
flds
,
iter
)
forAllIter
s
(
flds
,
iter
)
{
GeoField
&
fld
=
*
iter
();
typename
GeoField
::
Boundary
&
bfld
=
fld
.
boundaryFieldRef
();
auto
&
bfld
=
fld
.
boundaryFieldRef
();
bfld
.
reorder
(
oldToNew
);
}
...
...
src/dynamicMesh/layerAdditionRemoval/removeCellLayer.C
View file @
45590671
...
...
@@ -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) 2011-2016 OpenFOAM Foundation
...
...
@@ -221,10 +221,9 @@ void Foam::layerAdditionRemoval::removeCellLayer
forAll
(
newFace
,
pointi
)
{
Map
<
label
>::
iterator
rpmIter
=
removedPointMap
.
find
(
newFace
[
pointi
]);
const
auto
rpmIter
=
removedPointMap
.
cfind
(
newFace
[
pointi
]);
if
(
rpmIter
!=
removedPointMap
.
e
nd
())
if
(
rpmIter
.
fou
nd
())
{
// Point mapped. Replace it
newFace
[
pointi
]
=
rpmIter
();
...
...
src/dynamicMesh/meshCut/cellCuts/cellCuts.C
View file @
45590671
...
...
@@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2017 OpenCFD Ltd.
\\ / A nd | Copyright (C) 2017
-2019
OpenCFD Ltd.
\\/ M anipulation |
-------------------------------------------------------------------------------
| Copyright (C) 2011-2017 OpenFOAM Foundation
...
...
@@ -178,13 +178,13 @@ void Foam::cellCuts::syncProc()
label
facei
=
pp
.
start
()
+
i
;
label
bFacei
=
facei
-
mesh
().
nInternalFaces
();
const
Map
<
edge
>::
const_iterator
iter
=
faceSplitCut_
.
find
(
facei
);
if
(
iter
!=
faceSplitCut_
.
e
nd
())
const
auto
iter
=
faceSplitCut_
.
cfind
(
facei
);
if
(
iter
.
fou
nd
())
{
const
face
&
f
=
mesh
().
faces
()[
facei
];
const
labelList
&
fEdges
=
mesh
().
faceEdges
()[
facei
];
const
edge
&
cuts
=
iter
();
const
edge
&
cuts
=
iter
.
val
();
forAll
(
cuts
,
i
)