Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
openfoam
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Model registry
Analyze
Contributor analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Development
openfoam
Commits
dced6c58
Commit
dced6c58
authored
1 year ago
by
mattijs
Browse files
Options
Downloads
Patches
Plain Diff
BUG: regionSplit2D: revert to original code. Fixes
#3149
.
parent
3e64faf6
Loading
Loading
1 merge request
!695
OpenFOAM v2406
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/meshTools/regionSplit2D/regionSplit2D.C
+22
-34
22 additions, 34 deletions
src/meshTools/regionSplit2D/regionSplit2D.C
with
22 additions
and
34 deletions
src/meshTools/regionSplit2D/regionSplit2D.C
+
22
−
34
View file @
dced6c58
...
@@ -5,7 +5,7 @@
...
@@ -5,7 +5,7 @@
\\ / A nd | www.openfoam.com
\\ / A nd | www.openfoam.com
\\/ M anipulation |
\\/ M anipulation |
-------------------------------------------------------------------------------
-------------------------------------------------------------------------------
Copyright (C) 2015-2022 OpenCFD Ltd.
Copyright (C) 2015-2022
,2024
OpenCFD Ltd.
-------------------------------------------------------------------------------
-------------------------------------------------------------------------------
License
License
This file is part of OpenFOAM.
This file is part of OpenFOAM.
...
@@ -28,7 +28,7 @@ License
...
@@ -28,7 +28,7 @@ License
#include
"regionSplit2D.H"
#include
"regionSplit2D.H"
#include
"polyMesh.H"
#include
"polyMesh.H"
#include
"PatchEdgeFaceWave.H"
#include
"PatchEdgeFaceWave.H"
#include
"
edgeTopoDistanceData
.H"
#include
"
patchEdgeFaceRegion
.H"
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
...
@@ -51,12 +51,11 @@ Foam::regionSplit2D::regionSplit2D
...
@@ -51,12 +51,11 @@ Foam::regionSplit2D::regionSplit2D
nRegions_
(
0
)
nRegions_
(
0
)
{
{
globalIndex
globalFaces
(
blockedFaces
.
size
());
globalIndex
globalFaces
(
blockedFaces
.
size
());
label
region
I
=
globalFaces
.
toGlobal
(
0
);
label
region
i
=
globalFaces
.
toGlobal
(
0
);
List
<
edgeTopoDistanceData
<
label
>
>
allEdgeInfo
(
patch
.
nEdges
());
List
<
patchEdgeFaceRegion
>
allEdgeInfo
(
patch
.
nEdges
());
List
<
edgeTopoDistanceData
<
label
>
>
allFaceInfo
(
patch
.
size
());
List
<
patchEdgeFaceRegion
>
allFaceInfo
(
patch
.
size
());
DynamicList
<
label
>
changedEdges
;
DynamicList
<
label
>
changedEdges
;
DynamicList
<
edgeTopoDistanceData
<
label
>>
changedRegions
;
DynamicList
<
patchEdgeFaceRegion
>
changedRegions
;
label
nBlockedFaces
=
0
;
label
nBlockedFaces
=
0
;
forAll
(
blockedFaces
,
facei
)
forAll
(
blockedFaces
,
facei
)
{
{
...
@@ -67,26 +66,15 @@ Foam::regionSplit2D::regionSplit2D
...
@@ -67,26 +66,15 @@ Foam::regionSplit2D::regionSplit2D
changedEdges
.
append
(
edgei
);
changedEdges
.
append
(
edgei
);
// Append globally unique value
// Append globally unique value
changedRegions
.
append
changedRegions
.
append
(
regioni
);
(
edgeTopoDistanceData
<
label
>
(
0
,
// distance
regionI
// passive data
)
);
}
}
nBlockedFaces
++
;
nBlockedFaces
++
;
region
I
++
;
region
i
++
;
}
}
else
else
{
{
// Block all non-seeded faces from the walk
// Block all non-seeded faces from the walk
allFaceInfo
[
facei
]
=
edgeTopoDistanceData
<
label
>
allFaceInfo
[
facei
]
=
BLOCKED
;
(
0
,
// distance
BLOCKED
// passive data
);
}
}
}
}
...
@@ -99,7 +87,7 @@ Foam::regionSplit2D::regionSplit2D
...
@@ -99,7 +87,7 @@ Foam::regionSplit2D::regionSplit2D
PatchEdgeFaceWave
PatchEdgeFaceWave
<
<
indirectPrimitivePatch
,
indirectPrimitivePatch
,
edgeTopoDistanceData
<
label
>
patchEdgeFaceRegion
>
>
(
(
mesh
,
mesh
,
...
@@ -115,23 +103,23 @@ Foam::regionSplit2D::regionSplit2D
...
@@ -115,23 +103,23 @@ Foam::regionSplit2D::regionSplit2D
// Map from regions to local compact indexing
// Map from regions to local compact indexing
// - only for regions that originate from this processor
// - only for regions that originate from this processor
Map
<
label
>
regionToCompactAddr
(
changedRegions
.
size
());
Map
<
label
>
regionToCompactAddr
(
changedRegions
.
size
());
label
compactRegion
I
=
0
;
label
compactRegion
i
=
0
;
forAll
(
allFaceInfo
,
face
I
)
forAll
(
allFaceInfo
,
face
i
)
{
{
label
region
I
=
allFaceInfo
[
face
I
].
data
();
const
label
region
i
=
allFaceInfo
[
face
i
].
region
();
if
if
(
(
globalFaces
.
isLocal
(
region
I
)
globalFaces
.
isLocal
(
region
i
)
&&
regionToCompactAddr
.
insert
(
region
I
,
compactRegion
I
)
&&
regionToCompactAddr
.
insert
(
region
i
,
compactRegion
i
)
)
)
{
{
compactRegion
I
++
;
compactRegion
i
++
;
}
}
}
}
// In-place renumber the local regionI to global (compact) region
I
// In-place renumber the local regionI to global (compact) region
i
{
{
const
label
myProcOffset
=
globalIndex
::
calcOffset
(
compactRegion
I
);
const
label
myProcOffset
=
globalIndex
::
calcOffset
(
compactRegion
i
);
forAllIters
(
regionToCompactAddr
,
iter
)
forAllIters
(
regionToCompactAddr
,
iter
)
{
{
iter
.
val
()
+=
myProcOffset
;
iter
.
val
()
+=
myProcOffset
;
...
@@ -147,12 +135,12 @@ Foam::regionSplit2D::regionSplit2D
...
@@ -147,12 +135,12 @@ Foam::regionSplit2D::regionSplit2D
nRegions_
=
regionToCompactAddr
.
size
();
nRegions_
=
regionToCompactAddr
.
size
();
// Set the region index per face
// Set the region index per face
forAll
(
allFaceInfo
,
face
I
)
forAll
(
allFaceInfo
,
face
i
)
{
{
label
region
I
=
allFaceInfo
[
face
I
].
data
();
const
label
region
i
=
allFaceInfo
[
face
i
].
region
();
if
(
region
I
>=
0
)
if
(
region
i
>=
0
)
{
{
this
->
operator
[](
face
I
)
=
regionToCompactAddr
[
region
I
]
+
offset
;
this
->
operator
[](
face
i
)
=
regionToCompactAddr
[
region
i
]
+
offset
;
}
}
}
}
}
}
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
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!
Save comment
Cancel
Please
register
or
sign in
to comment