| 37 | // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // |
| 38 | |
| 39 | void Foam::polyMesh::updateMesh(const mapPolyMesh& mpm) |
| 40 | { |
| 41 | if (debug) |
| 42 | { |
| 43 | InfoInFunction |
| 44 | << "Updating addressing and (optional) pointMesh/pointFields" |
| 45 | << endl; |
| 46 | } |
| 47 | |
| 48 | // Update boundaryMesh (note that patches themselves already ok) |
| 49 | boundary_.updateMesh(); |
| 50 | |
| 51 | // Update zones |
| 52 | pointZones_.clearAddressing(); |
| 53 | faceZones_.clearAddressing(); |
| 54 | cellZones_.clearAddressing(); |
| 55 | |
| 56 | // Remove the stored tet base points |
| 57 | tetBasePtIsPtr_.clear(); |
| 58 | // Remove the cell tree |
| 59 | cellTreePtr_.clear(); |
| 60 | |
| 61 | // Update parallel data |
| 62 | if (globalMeshDataPtr_.valid()) |
| 63 | { |
| 64 | globalMeshDataPtr_->updateMesh(); |
| 65 | } |
| 66 | |
| 67 | setInstance(time().timeName()); |
| 68 | |
| 69 | // Map the old motion points if present |
| 70 | if (oldPointsPtr_.valid()) |
| 71 | { |
| 72 | // Make a copy of the original points |
| 73 | pointField oldMotionPoints = oldPointsPtr_(); |
| 74 | |
| 75 | pointField& newMotionPoints = oldPointsPtr_(); |
| 76 | |
| 77 | // Resize the list to new size |
| 78 | newMotionPoints.setSize(points_.size()); |
| 79 | |
| 80 | // Map the list |
| 81 | newMotionPoints.map(oldMotionPoints, mpm.pointMap()); |
| 82 | |
| 83 | // Any points created out-of-nothing get set to the current coordinate |
| 84 | // for lack of anything better. |
| 85 | forAll(mpm.pointMap(), newPointi) |
| 86 | { |
| 87 | if (mpm.pointMap()[newPointi] == -1) |
| 88 | { |
| 89 | newMotionPoints[newPointi] = points_[newPointi]; |
| 90 | } |
| 91 | } |
| 92 | } |
| 93 | |
| 94 | meshObject::updateMesh<polyMesh>(*this, mpm); |
| 95 | meshObject::updateMesh<pointMesh>(*this, mpm); |
| 96 |
nothing calls this directly
no test coverage detected