From 792ee881afb9958468d357d732394f6096972bf1 Mon Sep 17 00:00:00 2001 From: andy Date: Tue, 8 Apr 2014 11:57:27 +0100 Subject: [PATCH] ENH: polyMesh - add functions to set regIOobject up-to-date with mesh points for topology change --- src/OpenFOAM/meshes/polyMesh/polyMesh.C | 14 +++++++++++++- src/OpenFOAM/meshes/polyMesh/polyMesh.H | 8 +++++++- 2 files changed, 20 insertions(+), 2 deletions(-) diff --git a/src/OpenFOAM/meshes/polyMesh/polyMesh.C b/src/OpenFOAM/meshes/polyMesh/polyMesh.C index ce71727d69..cd70eb3999 100644 --- a/src/OpenFOAM/meshes/polyMesh/polyMesh.C +++ b/src/OpenFOAM/meshes/polyMesh/polyMesh.C @@ -1047,6 +1047,18 @@ const Foam::pointField& Foam::polyMesh::points() const } +bool Foam::polyMesh::upToDatePoints(const regIOobject& io) const +{ + return io.upToDate(points_); +} + + +void Foam::polyMesh::setUpToDatePoints(regIOobject& io) const +{ + io.eventNo() = points_.eventNo(); +} + + const Foam::faceList& Foam::polyMesh::faces() const { if (clearedPrimitives_) @@ -1132,7 +1144,7 @@ Foam::tmp Foam::polyMesh::movePoints points_.writeOpt() = IOobject::AUTO_WRITE; points_.instance() = time().timeName(); - + points_.eventNo() = getEvent(); tmp sweptVols = primitiveMesh::movePoints ( diff --git a/src/OpenFOAM/meshes/polyMesh/polyMesh.H b/src/OpenFOAM/meshes/polyMesh/polyMesh.H index 5d95d9cfb8..ffabc4c729 100644 --- a/src/OpenFOAM/meshes/polyMesh/polyMesh.H +++ b/src/OpenFOAM/meshes/polyMesh/polyMesh.H @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2014 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -394,6 +394,12 @@ public: //- Return raw points virtual const pointField& points() const; + //- Return true if io is up-to-date with points + virtual bool upToDatePoints(const regIOobject& io) const; + + //- Set io to be up-to-date with points + virtual void setUpToDatePoints(regIOobject& io) const; + //- Return raw faces virtual const faceList& faces() const;