1 /*---------------------------------------------------------------------------*\
3 \\ / F ield | foam-extend: Open Source CFD
4 \\ / O peration | Version: 3.2
5 \\ / A nd | Web: http://www.foam-extend.org
6 \\/ M anipulation | For copyright notice see file Copyright
7 -------------------------------------------------------------------------------
9 This file is part of foam-extend.
11 foam-extend is free software: you can redistribute it and/or modify it
12 under the terms of the GNU General Public License as published by the
13 Free Software Foundation, either version 3 of the License, or (at your
14 option) any later version.
16 foam-extend is distributed in the hope that it will be useful, but
17 WITHOUT ANY WARRANTY; without even the implied warranty of
18 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
19 General Public License for more details.
21 You should have received a copy of the GNU General Public License
22 along with foam-extend. If not, see <http://www.gnu.org/licenses/>.
25 Update the polyMesh corresponding to the given map.
27 \*---------------------------------------------------------------------------*/
30 #include "mapPolyMesh.H"
32 #include "globalMeshData.H"
33 #include "meshObjectBase.H"
35 // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
37 void Foam::polyMesh::updateMesh(const mapPolyMesh& mpm)
39 // Update zones. Since boundary depends on zones, they need to be
40 // updated first. HJ, 20/May/2014
41 pointZones_.updateMesh();
42 faceZones_.updateMesh();
43 cellZones_.updateMesh();
45 // Update boundaryMesh (note that patches themselves are already ok)
46 boundary_.updateMesh();
48 // Clear out parallel data. HJ, 27/Nov/2009
49 deleteDemandDrivenData(globalMeshDataPtr_);
51 setInstance(time().timeName());
53 // Map the old motion points if present
56 // Make a copy of the original points
57 pointField oldMotionPoints = *oldAllPointsPtr_;
59 pointField& newMotionPoints = *oldAllPointsPtr_;
61 // Resize the list to new size
62 newMotionPoints.setSize(allPoints_.size());
65 newMotionPoints.map(oldMotionPoints, mpm.pointMap());
67 // Reset old points if present
70 oldPointsPtr_->reset(*oldAllPointsPtr_, nPoints());
74 // Reset valid directions (could change by faces put into empty patches)
75 geometricD_ = Vector<label>::zero;
76 solutionD_ = Vector<label>::zero;
78 // Update all function objects
79 // Moved from fvMesh.C in 1.6.x merge. HJ, 29/Aug/2010
80 meshObjectBase::allUpdateTopology<polyMesh>(*this, mpm);
84 // Sync mesh update with changes on other processors
85 void Foam::polyMesh::syncUpdateMesh()
87 // Update zones. Since boundary depends on zones, they need to be
88 // updated first. HJ, 20/May/2014
89 pointZones_.updateMesh();
90 faceZones_.updateMesh();
91 cellZones_.updateMesh();
93 // Update boundaryMesh (note that patches themselves already ok)
94 boundary_.updateMesh();
96 // Clear out parallel data. HJ, 27/Nov/2009
97 deleteDemandDrivenData(globalMeshDataPtr_);
99 setInstance(time().timeName());
101 // Reset valid directions (could change by faces put into empty patches)
102 geometricD_ = Vector<label>::zero;
103 solutionD_ = Vector<label>::zero;
105 // Update all function objects
106 // Moved from fvMesh.C in 1.6.x merge. HJ, 29/Aug/2010
108 // Instantiate a dummy mapPolyMesh
109 autoPtr<mapPolyMesh> mapPtr(new mapPolyMesh(*this));
111 meshObjectBase::allUpdateTopology<polyMesh>(*this, mapPtr());
115 // ************************************************************************* //