00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028 #include "mapPolyMesh.H"
00029 #include <OpenFOAM/polyMesh.H>
00030
00031
00032
00033
00034
00035
00036 Foam::mapPolyMesh::mapPolyMesh
00037 (
00038 const polyMesh& mesh,
00039 const label nOldPoints,
00040 const label nOldFaces,
00041 const label nOldCells,
00042 const labelList& pointMap,
00043 const List<objectMap>& pointsFromPoints,
00044 const labelList& faceMap,
00045 const List<objectMap>& facesFromPoints,
00046 const List<objectMap>& facesFromEdges,
00047 const List<objectMap>& facesFromFaces,
00048 const labelList& cellMap,
00049 const List<objectMap>& cellsFromPoints,
00050 const List<objectMap>& cellsFromEdges,
00051 const List<objectMap>& cellsFromFaces,
00052 const List<objectMap>& cellsFromCells,
00053 const labelList& reversePointMap,
00054 const labelList& reverseFaceMap,
00055 const labelList& reverseCellMap,
00056 const labelHashSet& flipFaceFlux,
00057 const labelListList& patchPointMap,
00058 const labelListList& pointZoneMap,
00059 const labelListList& faceZonePointMap,
00060 const labelListList& faceZoneFaceMap,
00061 const labelListList& cellZoneMap,
00062 const pointField& preMotionPoints,
00063 const labelList& oldPatchStarts,
00064 const labelList& oldPatchNMeshPoints
00065 )
00066 :
00067 mesh_(mesh),
00068 nOldPoints_(nOldPoints),
00069 nOldFaces_(nOldFaces),
00070 nOldCells_(nOldCells),
00071 pointMap_(pointMap),
00072 pointsFromPointsMap_(pointsFromPoints),
00073 faceMap_(faceMap),
00074 facesFromPointsMap_(facesFromPoints),
00075 facesFromEdgesMap_(facesFromEdges),
00076 facesFromFacesMap_(facesFromFaces),
00077 cellMap_(cellMap),
00078 cellsFromPointsMap_(cellsFromPoints),
00079 cellsFromEdgesMap_(cellsFromEdges),
00080 cellsFromFacesMap_(cellsFromFaces),
00081 cellsFromCellsMap_(cellsFromCells),
00082 reversePointMap_(reversePointMap),
00083 reverseFaceMap_(reverseFaceMap),
00084 reverseCellMap_(reverseCellMap),
00085 flipFaceFlux_(flipFaceFlux),
00086 patchPointMap_(patchPointMap),
00087 pointZoneMap_(pointZoneMap),
00088 faceZonePointMap_(faceZonePointMap),
00089 faceZoneFaceMap_(faceZoneFaceMap),
00090 cellZoneMap_(cellZoneMap),
00091 preMotionPoints_(preMotionPoints),
00092 oldPatchSizes_(oldPatchStarts.size()),
00093 oldPatchStarts_(oldPatchStarts),
00094 oldPatchNMeshPoints_(oldPatchNMeshPoints)
00095 {
00096
00097 for (label patchI = 0; patchI < oldPatchStarts_.size() - 1; patchI++)
00098 {
00099 oldPatchSizes_[patchI] =
00100 oldPatchStarts_[patchI + 1] - oldPatchStarts_[patchI];
00101 }
00102
00103
00104 const label lastPatchID = oldPatchStarts_.size() - 1;
00105
00106 oldPatchSizes_[lastPatchID] = nOldFaces_ - oldPatchStarts_[lastPatchID];
00107
00108 if (polyMesh::debug)
00109 {
00110 if (min(oldPatchSizes_) < 0)
00111 {
00112 FatalErrorIn("mapPolyMesh::mapPolyMesh(...)")
00113 << "Calculated negative old patch size. Error in mapping data"
00114 << abort(FatalError);
00115 }
00116 }
00117 }
00118
00119
00120
00121 Foam::mapPolyMesh::mapPolyMesh
00122 (
00123 const polyMesh& mesh,
00124 const label nOldPoints,
00125 const label nOldFaces,
00126 const label nOldCells,
00127 labelList& pointMap,
00128 List<objectMap>& pointsFromPoints,
00129 labelList& faceMap,
00130 List<objectMap>& facesFromPoints,
00131 List<objectMap>& facesFromEdges,
00132 List<objectMap>& facesFromFaces,
00133 labelList& cellMap,
00134 List<objectMap>& cellsFromPoints,
00135 List<objectMap>& cellsFromEdges,
00136 List<objectMap>& cellsFromFaces,
00137 List<objectMap>& cellsFromCells,
00138 labelList& reversePointMap,
00139 labelList& reverseFaceMap,
00140 labelList& reverseCellMap,
00141 labelHashSet& flipFaceFlux,
00142 labelListList& patchPointMap,
00143 labelListList& pointZoneMap,
00144 labelListList& faceZonePointMap,
00145 labelListList& faceZoneFaceMap,
00146 labelListList& cellZoneMap,
00147 pointField& preMotionPoints,
00148 labelList& oldPatchStarts,
00149 labelList& oldPatchNMeshPoints,
00150 const bool reUse
00151 )
00152 :
00153 mesh_(mesh),
00154 nOldPoints_(nOldPoints),
00155 nOldFaces_(nOldFaces),
00156 nOldCells_(nOldCells),
00157 pointMap_(pointMap, reUse),
00158 pointsFromPointsMap_(pointsFromPoints, reUse),
00159 faceMap_(faceMap, reUse),
00160 facesFromPointsMap_(facesFromPoints, reUse),
00161 facesFromEdgesMap_(facesFromEdges, reUse),
00162 facesFromFacesMap_(facesFromFaces, reUse),
00163 cellMap_(cellMap, reUse),
00164 cellsFromPointsMap_(cellsFromPoints, reUse),
00165 cellsFromEdgesMap_(cellsFromEdges, reUse),
00166 cellsFromFacesMap_(cellsFromFaces, reUse),
00167 cellsFromCellsMap_(cellsFromCells, reUse),
00168 reversePointMap_(reversePointMap, reUse),
00169 reverseFaceMap_(reverseFaceMap, reUse),
00170 reverseCellMap_(reverseCellMap, reUse),
00171 flipFaceFlux_(flipFaceFlux),
00172 patchPointMap_(patchPointMap, reUse),
00173 pointZoneMap_(pointZoneMap, reUse),
00174 faceZonePointMap_(faceZonePointMap, reUse),
00175 faceZoneFaceMap_(faceZoneFaceMap, reUse),
00176 cellZoneMap_(cellZoneMap, reUse),
00177 preMotionPoints_(preMotionPoints, reUse),
00178 oldPatchSizes_(oldPatchStarts.size()),
00179 oldPatchStarts_(oldPatchStarts, reUse),
00180 oldPatchNMeshPoints_(oldPatchNMeshPoints, reUse)
00181 {
00182
00183 for (label patchI = 0; patchI < oldPatchStarts_.size() - 1; patchI++)
00184 {
00185 oldPatchSizes_[patchI] =
00186 oldPatchStarts_[patchI + 1] - oldPatchStarts_[patchI];
00187 }
00188
00189
00190 const label lastPatchID = oldPatchStarts_.size() - 1;
00191
00192 oldPatchSizes_[lastPatchID] = nOldFaces_ - oldPatchStarts_[lastPatchID];
00193
00194 if (polyMesh::debug)
00195 {
00196 if (min(oldPatchSizes_) < 0)
00197 {
00198 FatalErrorIn("mapPolyMesh::mapPolyMesh(...)")
00199 << "Calculated negative old patch size. Error in mapping data"
00200 << abort(FatalError);
00201 }
00202 }
00203 }
00204
00205
00206
00207
00208
00209