STYLE: adjust packing of members, header comments

This commit is contained in:
Mark Olesen
2020-12-18 09:13:34 +01:00
parent a92cd03a89
commit 6068148c22
4 changed files with 21 additions and 19 deletions

View File

@ -308,10 +308,10 @@ Foam::polyMesh::polyMesh(const IOobject& io, const bool doInit)
globalMeshDataPtr_(nullptr),
moving_(false),
topoChanging_(false),
storeOldCellCentres_(false),
curMotionTimeIndex_(time().timeIndex()),
oldPointsPtr_(nullptr),
oldCellCentresPtr_(nullptr),
storeOldCellCentres_(false)
oldCellCentresPtr_(nullptr)
{
if (!owner_.headerClassName().empty())
{
@ -514,10 +514,10 @@ Foam::polyMesh::polyMesh
globalMeshDataPtr_(nullptr),
moving_(false),
topoChanging_(false),
storeOldCellCentres_(false),
curMotionTimeIndex_(time().timeIndex()),
oldPointsPtr_(nullptr),
oldCellCentresPtr_(nullptr),
storeOldCellCentres_(false)
oldCellCentresPtr_(nullptr)
{
// Note: changed that the constructors where values can be supplied
// (points, faces, owner/neighbour) use the readOpt. All others
@ -672,10 +672,10 @@ Foam::polyMesh::polyMesh
globalMeshDataPtr_(nullptr),
moving_(false),
topoChanging_(false),
storeOldCellCentres_(false),
curMotionTimeIndex_(time().timeIndex()),
oldPointsPtr_(nullptr),
oldCellCentresPtr_(nullptr),
storeOldCellCentres_(false)
oldCellCentresPtr_(nullptr)
{
// Note: probably needs io.readOpt() for points/faces/cells etc so
// we can run with READ_IF_PRESENT. See constructor above.

View File

@ -182,6 +182,9 @@ private:
//- Is the mesh topology changing
bool topoChanging_;
//- Store old cell centres?
mutable bool storeOldCellCentres_;
//- Current time index for mesh motion
mutable label curMotionTimeIndex_;
@ -191,8 +194,6 @@ private:
//- Old cell centres (for the last mesh motion)
mutable autoPtr<pointField> oldCellCentresPtr_;
//- Whether or not to store the old cell centres
mutable bool storeOldCellCentres_;
// Private Member Functions
@ -434,10 +435,10 @@ public:
//- Return face neighbour
virtual const labelList& faceNeighbour() const;
//- Return old points for mesh motion
//- Return old points (mesh motion)
virtual const pointField& oldPoints() const;
//- Return old points for mesh motion
//- Return old cellCentres (mesh motion)
virtual const pointField& oldCellCentres() const;
//- Return boundary mesh

View File

@ -575,10 +575,10 @@ Foam::polyMesh::polyMesh
globalMeshDataPtr_(nullptr),
moving_(false),
topoChanging_(false),
storeOldCellCentres_(false),
curMotionTimeIndex_(time().timeIndex()),
oldPointsPtr_(nullptr),
oldCellCentresPtr_(nullptr),
storeOldCellCentres_(false)
oldCellCentresPtr_(nullptr)
{
DebugInfo
<< "Constructing polyMesh from cell and boundary shapes." << endl;
@ -857,10 +857,10 @@ Foam::polyMesh::polyMesh
globalMeshDataPtr_(nullptr),
moving_(false),
topoChanging_(false),
storeOldCellCentres_(false),
curMotionTimeIndex_(time().timeIndex()),
oldPointsPtr_(nullptr),
oldCellCentresPtr_(nullptr),
storeOldCellCentres_(false)
oldCellCentresPtr_(nullptr)
{
DebugInfo
<< "Constructing polyMesh from cell and boundary shapes." << endl;

View File

@ -70,12 +70,12 @@ void Foam::polyMesh::updateMesh(const mapPolyMesh& mpm)
if (oldPointsPtr_)
{
// Make a copy of the original points
pointField oldMotionPoints = *oldPointsPtr_;
pointField oldMotionPoints(*oldPointsPtr_);
pointField& newMotionPoints = *oldPointsPtr_;
// Resize the list to new size
newMotionPoints.setSize(points_.size());
newMotionPoints.resize(points_.size());
// Map the list
if (mpm.hasMotionPoints())
@ -119,15 +119,16 @@ void Foam::polyMesh::updateMesh(const mapPolyMesh& mpm)
}
}
// Map the old motion cell-centres if present
if (oldCellCentresPtr_)
{
// Make a copy of the original cell-centres
pointField oldMotionCellCentres = oldCellCentresPtr_();
pointField oldMotionCellCentres(*oldCellCentresPtr_);
pointField& newMotionCellCentres = oldCellCentresPtr_();
pointField& newMotionCellCentres = *oldCellCentresPtr_;
// Resize the list to new size
newMotionCellCentres.setSize(cellCentres().size());
newMotionCellCentres.resize(cellCentres().size());
// Map the list
newMotionCellCentres.map(oldMotionCellCentres, mpm.cellMap());