MCPcopy Create free account
hub / github.com/OpenFOAM/OpenFOAM-dev / updateMesh

Function updateMesh

src/OpenFOAM/meshes/polyMesh/polyMeshUpdate.C:39–102  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

37// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
38
39void 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

Callers

nothing calls this directly

Calls 7

setInstanceFunction · 0.70
forAllFunction · 0.50
updateMeshMethod · 0.45
clearMethod · 0.45
validMethod · 0.45
setSizeMethod · 0.45
sizeMethod · 0.45

Tested by

no test coverage detected