Skip to content
Snippets Groups Projects
Commit 5dce1d37 authored by mattijs's avatar mattijs
Browse files

ENH: polyMeshIO: clear storage before reading points; added check on sizes

parent 16ee9174
Branches
Tags
No related merge requests found
......@@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
......@@ -407,9 +407,12 @@ Foam::polyMesh::readUpdateState Foam::polyMesh::readUpdate()
clearGeom();
points_.instance() = pointsInst;
points_ = pointIOField
label nOldPoints = points_.size();
points_.clear();
pointIOField newPoints
(
IOobject
(
......@@ -423,6 +426,19 @@ Foam::polyMesh::readUpdateState Foam::polyMesh::readUpdate()
)
);
if (nOldPoints != 0 && nOldPoints != newPoints.size())
{
FatalErrorIn("polyMesh::readUpdate()")
<< "Point motion detected but number of points "
<< newPoints.size() << " in "
<< newPoints.objectPath() << " does not correspond to "
<< " current " << nOldPoints
<< exit(FatalError);
}
points_.transfer(newPoints);
points_.instance() = pointsInst;
// Derived info
bounds_ = boundBox(points_);
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment