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