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
eb5b6fd7
Commit
eb5b6fd7
authored
5 years ago
by
Andrew Heather
Browse files
Options
Downloads
Patches
Plain Diff
ENH: mapPolyMesh - added construct from mesh
parent
36af9f61
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/OpenFOAM/meshes/polyMesh/mapPolyMesh/mapPolyMesh.C
+66
-1
66 additions, 1 deletion
src/OpenFOAM/meshes/polyMesh/mapPolyMesh/mapPolyMesh.C
src/OpenFOAM/meshes/polyMesh/mapPolyMesh/mapPolyMesh.H
+9
-6
9 additions, 6 deletions
src/OpenFOAM/meshes/polyMesh/mapPolyMesh/mapPolyMesh.H
with
75 additions
and
7 deletions
src/OpenFOAM/meshes/polyMesh/mapPolyMesh/mapPolyMesh.C
+
66
−
1
View file @
eb5b6fd7
...
...
@@ -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-2017 OpenFOAM Foundation
...
...
@@ -30,6 +30,71 @@ License
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
Foam
::
mapPolyMesh
::
mapPolyMesh
(
const
polyMesh
&
mesh
)
:
mesh_
(
mesh
),
nOldPoints_
(
mesh
.
nPoints
()),
nOldFaces_
(
mesh
.
nFaces
()),
nOldCells_
(
mesh
.
nCells
()),
pointMap_
(
identity
(
mesh
.
nPoints
())),
pointsFromPointsMap_
(),
faceMap_
(
identity
(
mesh
.
nFaces
())),
facesFromPointsMap_
(),
facesFromEdgesMap_
(),
facesFromFacesMap_
(),
cellMap_
(
identity
(
mesh
.
nCells
())),
cellsFromPointsMap_
(),
cellsFromEdgesMap_
(),
cellsFromFacesMap_
(),
cellsFromCellsMap_
(),
reversePointMap_
(
identity
(
mesh
.
nPoints
())),
reverseFaceMap_
(
identity
(
mesh
.
nFaces
())),
reverseCellMap_
(
identity
(
mesh
.
nCells
())),
flipFaceFlux_
(),
patchPointMap_
(
mesh
.
boundaryMesh
().
size
()),
pointZoneMap_
(
mesh
.
pointZones
().
size
()),
faceZonePointMap_
(
mesh
.
faceZones
().
size
()),
faceZoneFaceMap_
(
mesh
.
faceZones
().
size
()),
cellZoneMap_
(
mesh
.
cellZones
().
size
()),
preMotionPoints_
(
mesh
.
points
()),
oldPatchSizes_
(
mesh
.
boundaryMesh
().
patchSizes
()),
oldPatchStarts_
(
mesh
.
boundaryMesh
().
patchStarts
()),
oldPatchNMeshPoints_
(
mesh
.
boundaryMesh
().
size
()),
oldCellVolumesPtr_
()
{
// Identity map for patch points
forAll
(
patchPointMap_
,
patchi
)
{
const
label
nPoints
=
mesh
.
boundaryMesh
()[
patchi
].
meshPoints
().
size
();
oldPatchNMeshPoints_
[
patchi
]
=
nPoints
;
patchPointMap_
[
patchi
]
=
identity
(
nPoints
);
}
// Identity maps for zones
forAll
(
pointZoneMap_
,
zonei
)
{
pointZoneMap_
[
zonei
]
=
identity
(
mesh
.
pointZones
()[
zonei
].
size
());
}
forAll
(
faceZonePointMap_
,
zonei
)
{
faceZonePointMap_
[
zonei
]
=
identity
(
mesh
.
faceZones
()[
zonei
]().
meshPoints
().
size
());
}
forAll
(
faceZoneFaceMap_
,
zonei
)
{
pointZoneMap_
[
zonei
]
=
identity
(
mesh
.
faceZones
()[
zonei
].
size
());
}
forAll
(
cellZoneMap_
,
zonei
)
{
cellZoneMap_
[
zonei
]
=
identity
(
mesh
.
cellZones
()[
zonei
].
size
());
}
}
Foam
::
mapPolyMesh
::
mapPolyMesh
(
const
polyMesh
&
mesh
,
...
...
This diff is collapsed.
Click to expand it.
src/OpenFOAM/meshes/polyMesh/mapPolyMesh/mapPolyMesh.H
+
9
−
6
View file @
eb5b6fd7
...
...
@@ -233,27 +233,27 @@ class mapPolyMesh
const
labelHashSet
flipFaceFlux_
;
//- Patch mesh point renumbering
const
labelListList
patchPointMap_
;
labelListList
patchPointMap_
;
//- Point zone renumbering
// For every preserved point in zone give the old position.
// For added points, the index is set to -1
const
labelListList
pointZoneMap_
;
labelListList
pointZoneMap_
;
//- Face zone point renumbering
// For every preserved point in zone give the old position.
// For added points, the index is set to -1
const
labelListList
faceZonePointMap_
;
labelListList
faceZonePointMap_
;
//- Face zone face renumbering
// For every preserved face in zone give the old position.
// For added faces, the index is set to -1
const
labelListList
faceZoneFaceMap_
;
labelListList
faceZoneFaceMap_
;
//- Cell zone renumbering
// For every preserved cell in zone give the old position.
// For added cells, the index is set to -1
const
labelListList
cellZoneMap_
;
labelListList
cellZoneMap_
;
//- Pre-motion point positions.
// This specifies the correct way of blowing up zero-volume objects
...
...
@@ -266,7 +266,7 @@ class mapPolyMesh
const
labelList
oldPatchStarts_
;
//- List of numbers of mesh points per old patch
const
labelList
oldPatchNMeshPoints_
;
labelList
oldPatchNMeshPoints_
;
//- Optional old cell volumes (for mapping)
autoPtr
<
scalarField
>
oldCellVolumesPtr_
;
...
...
@@ -285,6 +285,9 @@ public:
// Constructors
//- Construct from mesh
mapPolyMesh
(
const
polyMesh
&
mesh
);
//- Construct from components. Copy (except for oldCellVolumes).
mapPolyMesh
(
...
...
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