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
a0a05c1b
Commit
a0a05c1b
authored
15 years ago
by
mattijs
Browse files
Options
Downloads
Patches
Plain Diff
allow region interfaces on processor patches
parent
47eb0c5c
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
applications/utilities/mesh/manipulation/splitMeshRegions/splitMeshRegions.C
+71
-21
71 additions, 21 deletions
...ies/mesh/manipulation/splitMeshRegions/splitMeshRegions.C
with
71 additions
and
21 deletions
applications/utilities/mesh/manipulation/splitMeshRegions/splitMeshRegions.C
+
71
−
21
View file @
a0a05c1b
...
@@ -36,9 +36,10 @@ Description
...
@@ -36,9 +36,10 @@ Description
- mesh with cells put into cellZones (-makeCellZones)
- mesh with cells put into cellZones (-makeCellZones)
Note:
Note:
- Should work in parallel but cellZone interfaces cannot align with
- Should work in parallel.
processor boundaries so use the correct option in decomposition to
cellZones can differ on either side of processor boundaries in which case
preserve those interfaces.
the faces get moved from processor patch to directMapped patch. Not
ery well tested.
- If a cell zone gets split into more than one region it can detect
- If a cell zone gets split into more than one region it can detect
the largest matching region (-sloppyCellZones). This will accept any
the largest matching region (-sloppyCellZones). This will accept any
region that covers more than 50% of the zone. It has to be a subset
region that covers more than 50% of the zone. It has to be a subset
...
@@ -514,6 +515,10 @@ void getInterfaceSizes
...
@@ -514,6 +515,10 @@ void getInterfaceSizes
EdgeMap
<
label
>&
interfaceSizes
EdgeMap
<
label
>&
interfaceSizes
)
)
{
{
// Internal faces
// ~~~~~~~~~~~~~~
forAll
(
mesh
.
faceNeighbour
(),
faceI
)
forAll
(
mesh
.
faceNeighbour
(),
faceI
)
{
{
label
ownRegion
=
cellRegion
[
mesh
.
faceOwner
()[
faceI
]];
label
ownRegion
=
cellRegion
[
mesh
.
faceOwner
()[
faceI
]];
...
@@ -540,6 +545,47 @@ void getInterfaceSizes
...
@@ -540,6 +545,47 @@ void getInterfaceSizes
}
}
}
}
// Boundary faces
// ~~~~~~~~~~~~~~
// Neighbour cellRegion.
labelList
coupledRegion
(
mesh
.
nFaces
()
-
mesh
.
nInternalFaces
());
forAll
(
coupledRegion
,
i
)
{
label
cellI
=
mesh
.
faceOwner
()[
i
+
mesh
.
nInternalFaces
()];
coupledRegion
[
i
]
=
cellRegion
[
cellI
];
}
syncTools
::
swapBoundaryFaceList
(
mesh
,
coupledRegion
,
false
);
forAll
(
coupledRegion
,
i
)
{
label
faceI
=
i
+
mesh
.
nInternalFaces
();
label
ownRegion
=
cellRegion
[
mesh
.
faceOwner
()[
faceI
]];
label
neiRegion
=
coupledRegion
[
i
];
if
(
ownRegion
!=
neiRegion
)
{
edge
interface
(
min
(
ownRegion
,
neiRegion
),
max
(
ownRegion
,
neiRegion
)
);
EdgeMap
<
label
>::
iterator
iter
=
interfaceSizes
.
find
(
interface
);
if
(
iter
!=
interfaceSizes
.
end
())
{
iter
()
++
;
}
else
{
interfaceSizes
.
insert
(
interface
,
1
);
}
}
}
if
(
sumParallel
&&
Pstream
::
parRun
())
if
(
sumParallel
&&
Pstream
::
parRun
())
{
{
if
(
Pstream
::
master
())
if
(
Pstream
::
master
())
...
@@ -672,6 +718,17 @@ autoPtr<mapPolyMesh> createRegionMesh
...
@@ -672,6 +718,17 @@ autoPtr<mapPolyMesh> createRegionMesh
}
}
// Neighbour cellRegion.
labelList
coupledRegion
(
mesh
.
nFaces
()
-
mesh
.
nInternalFaces
());
forAll
(
coupledRegion
,
i
)
{
label
cellI
=
mesh
.
faceOwner
()[
i
+
mesh
.
nInternalFaces
()];
coupledRegion
[
i
]
=
cellRegion
[
cellI
];
}
syncTools
::
swapBoundaryFaceList
(
mesh
,
coupledRegion
,
false
);
// Topology change container. Start off from existing mesh.
// Topology change container. Start off from existing mesh.
polyTopoChange
meshMod
(
mesh
);
polyTopoChange
meshMod
(
mesh
);
...
@@ -691,16 +748,17 @@ autoPtr<mapPolyMesh> createRegionMesh
...
@@ -691,16 +748,17 @@ autoPtr<mapPolyMesh> createRegionMesh
{
{
label
faceI
=
exposedFaces
[
i
];
label
faceI
=
exposedFaces
[
i
];
if
(
!
mesh
.
isInternalFace
(
faceI
))
label
ownRegion
=
cellRegion
[
mesh
.
faceOwner
()[
faceI
]];
label
neiRegion
=
-
1
;
if
(
mesh
.
isInternalFace
(
faceI
))
{
{
FatalErrorIn
(
"createRegionMesh(..)"
)
neiRegion
=
cellRegion
[
mesh
.
faceNeighbour
()[
faceI
]];
<<
"Exposed face:"
<<
faceI
<<
" is not an internal face."
}
<<
" fc:"
<<
mesh
.
faceCentres
()[
faceI
]
else
<<
exit
(
FatalError
);
{
neiRegion
=
coupledRegion
[
faceI
-
mesh
.
nInternalFaces
()];
}
}
label
ownRegion
=
cellRegion
[
mesh
.
faceOwner
()[
faceI
]];
label
neiRegion
=
cellRegion
[
mesh
.
faceNeighbour
()[
faceI
]];
label
otherRegion
=
-
1
;
label
otherRegion
=
-
1
;
...
@@ -1357,22 +1415,14 @@ int main(int argc, char *argv[])
...
@@ -1357,22 +1415,14 @@ int main(int argc, char *argv[])
}
}
}
}
// Different cellZones on either side of processor patch are not
// Different cellZones on either side of processor patch.
// allowed for now. Convert to processorPatches or what?
forAll
(
neiZoneID
,
i
)
forAll
(
neiZoneID
,
i
)
{
{
label
faceI
=
i
+
mesh
.
nInternalFaces
();
label
faceI
=
i
+
mesh
.
nInternalFaces
();
if
(
zoneID
[
mesh
.
faceOwner
()[
faceI
]]
!=
neiZoneID
[
i
])
if
(
zoneID
[
mesh
.
faceOwner
()[
faceI
]]
!=
neiZoneID
[
i
])
{
{
//blockedFace[faceI] = true;
blockedFace
[
faceI
]
=
true
;
FatalErrorIn
(
args
.
executable
())
<<
"Coupled face "
<<
faceI
<<
" fc:"
<<
mesh
.
faceCentres
()[
faceI
]
<<
" has cellZone "
<<
zoneID
[
mesh
.
faceOwner
()[
faceI
]]
<<
" on owner side but cellZone "
<<
neiZoneID
[
i
]
<<
" on other side. This is not allowed."
<<
exit
(
FatalError
);
}
}
}
}
}
}
...
...
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