mirror of
https://develop.openfoam.com/Development/openfoam.git
synced 2025-11-28 03:28:01 +00:00
STYLE: check autoPtr as plain bool instead of valid()
- cleaner code, more similarity with unique_ptr
Now
if (ptr)
if (!ptr)
instead
if (ptr.valid())
if (!ptr.valid())
This commit is contained in:
@ -137,9 +137,9 @@ label mergePatchFaces
|
||||
// Faces in error.
|
||||
labelHashSet errorFaces;
|
||||
|
||||
if (qualDictPtr.valid())
|
||||
if (qualDictPtr)
|
||||
{
|
||||
motionSmoother::checkMesh(false, mesh, qualDictPtr(), errorFaces);
|
||||
motionSmoother::checkMesh(false, mesh, *qualDictPtr, errorFaces);
|
||||
}
|
||||
else
|
||||
{
|
||||
@ -440,7 +440,7 @@ int main(int argc, char *argv[])
|
||||
);
|
||||
|
||||
// Merge points on straight edges and remove unused points
|
||||
if (qualDict.valid())
|
||||
if (qualDict)
|
||||
{
|
||||
Info<< "Merging all 'loose' points on surface edges, "
|
||||
<< "regardless of the angle they make." << endl;
|
||||
|
||||
@ -731,9 +731,9 @@ int main(int argc, char *argv[])
|
||||
);
|
||||
|
||||
// Update
|
||||
if (refDataPtr.valid())
|
||||
if (refDataPtr)
|
||||
{
|
||||
refDataPtr().updateMesh(map());
|
||||
refDataPtr->updateMesh(map());
|
||||
}
|
||||
|
||||
// Store added cells
|
||||
@ -896,9 +896,9 @@ int main(int argc, char *argv[])
|
||||
updateFaceLabels(map(), backPatchFaces);
|
||||
updateCellSet(map(), addedCellsSet);
|
||||
|
||||
if (refDataPtr.valid())
|
||||
if (refDataPtr)
|
||||
{
|
||||
refDataPtr().updateMesh(map());
|
||||
refDataPtr->updateMesh(map());
|
||||
}
|
||||
|
||||
// Move mesh (if inflation used)
|
||||
@ -1029,9 +1029,9 @@ int main(int argc, char *argv[])
|
||||
// Update local data
|
||||
updateCellSet(map(), addedCellsSet);
|
||||
|
||||
if (refDataPtr.valid())
|
||||
if (refDataPtr)
|
||||
{
|
||||
refDataPtr().updateMesh(map());
|
||||
refDataPtr->updateMesh(map());
|
||||
}
|
||||
|
||||
// Move mesh (if inflation used)
|
||||
@ -1067,9 +1067,9 @@ int main(int argc, char *argv[])
|
||||
}
|
||||
}
|
||||
|
||||
if (refDataPtr.valid())
|
||||
if (refDataPtr)
|
||||
{
|
||||
refDataPtr().write();
|
||||
refDataPtr->write();
|
||||
}
|
||||
|
||||
|
||||
|
||||
@ -539,7 +539,7 @@ Foam::label Foam::checkGeometry
|
||||
<< nonAlignedPoints.name() << endl;
|
||||
nonAlignedPoints.instance() = mesh.pointsInstance();
|
||||
nonAlignedPoints.write();
|
||||
if (setWriter.valid())
|
||||
if (setWriter)
|
||||
{
|
||||
mergeAndWrite(*setWriter, nonAlignedPoints);
|
||||
}
|
||||
@ -573,7 +573,7 @@ Foam::label Foam::checkGeometry
|
||||
<< " non closed cells to set " << cells.name() << endl;
|
||||
cells.instance() = mesh.pointsInstance();
|
||||
cells.write();
|
||||
if (surfWriter.valid())
|
||||
if (surfWriter)
|
||||
{
|
||||
mergeAndWrite(*surfWriter, cells);
|
||||
}
|
||||
@ -589,7 +589,7 @@ Foam::label Foam::checkGeometry
|
||||
<< aspectCells.name() << endl;
|
||||
aspectCells.instance() = mesh.pointsInstance();
|
||||
aspectCells.write();
|
||||
if (surfWriter.valid())
|
||||
if (surfWriter)
|
||||
{
|
||||
mergeAndWrite(*surfWriter, aspectCells);
|
||||
}
|
||||
@ -610,7 +610,7 @@ Foam::label Foam::checkGeometry
|
||||
<< " zero area faces to set " << faces.name() << endl;
|
||||
faces.instance() = mesh.pointsInstance();
|
||||
faces.write();
|
||||
if (surfWriter.valid())
|
||||
if (surfWriter)
|
||||
{
|
||||
mergeAndWrite(*surfWriter, faces);
|
||||
}
|
||||
@ -632,7 +632,7 @@ Foam::label Foam::checkGeometry
|
||||
<< " zero volume cells to set " << cells.name() << endl;
|
||||
cells.instance() = mesh.pointsInstance();
|
||||
cells.write();
|
||||
if (surfWriter.valid())
|
||||
if (surfWriter)
|
||||
{
|
||||
mergeAndWrite(*surfWriter, cells);
|
||||
}
|
||||
@ -655,7 +655,7 @@ Foam::label Foam::checkGeometry
|
||||
<< " non-orthogonal faces to set " << faces.name() << endl;
|
||||
faces.instance() = mesh.pointsInstance();
|
||||
faces.write();
|
||||
if (surfWriter.valid())
|
||||
if (surfWriter)
|
||||
{
|
||||
mergeAndWrite(*surfWriter, faces);
|
||||
}
|
||||
@ -677,7 +677,7 @@ Foam::label Foam::checkGeometry
|
||||
<< faces.name() << endl;
|
||||
faces.instance() = mesh.pointsInstance();
|
||||
faces.write();
|
||||
if (surfWriter.valid())
|
||||
if (surfWriter)
|
||||
{
|
||||
mergeAndWrite(*surfWriter, faces);
|
||||
}
|
||||
@ -699,7 +699,7 @@ Foam::label Foam::checkGeometry
|
||||
<< " skew faces to set " << faces.name() << endl;
|
||||
faces.instance() = mesh.pointsInstance();
|
||||
faces.write();
|
||||
if (surfWriter.valid())
|
||||
if (surfWriter)
|
||||
{
|
||||
mergeAndWrite(*surfWriter, faces);
|
||||
}
|
||||
@ -723,7 +723,7 @@ Foam::label Foam::checkGeometry
|
||||
<< faces.name() << endl;
|
||||
faces.instance() = mesh.pointsInstance();
|
||||
faces.write();
|
||||
if (surfWriter.valid())
|
||||
if (surfWriter)
|
||||
{
|
||||
mergeAndWrite(*surfWriter, faces);
|
||||
}
|
||||
@ -756,7 +756,7 @@ Foam::label Foam::checkGeometry
|
||||
<< "decomposition tets to set " << faces.name() << endl;
|
||||
faces.instance() = mesh.pointsInstance();
|
||||
faces.write();
|
||||
if (surfWriter.valid())
|
||||
if (surfWriter)
|
||||
{
|
||||
mergeAndWrite(*surfWriter, faces);
|
||||
}
|
||||
@ -781,7 +781,7 @@ Foam::label Foam::checkGeometry
|
||||
<< endl;
|
||||
points.instance() = mesh.pointsInstance();
|
||||
points.write();
|
||||
if (setWriter.valid())
|
||||
if (setWriter)
|
||||
{
|
||||
mergeAndWrite(*setWriter, points);
|
||||
}
|
||||
@ -804,7 +804,7 @@ Foam::label Foam::checkGeometry
|
||||
<< " apart) points to set " << nearPoints.name() << endl;
|
||||
nearPoints.instance() = mesh.pointsInstance();
|
||||
nearPoints.write();
|
||||
if (setWriter.valid())
|
||||
if (setWriter)
|
||||
{
|
||||
mergeAndWrite(*setWriter, nearPoints);
|
||||
}
|
||||
@ -828,7 +828,7 @@ Foam::label Foam::checkGeometry
|
||||
<< endl;
|
||||
faces.instance() = mesh.pointsInstance();
|
||||
faces.write();
|
||||
if (surfWriter.valid())
|
||||
if (surfWriter)
|
||||
{
|
||||
mergeAndWrite(*surfWriter, faces);
|
||||
}
|
||||
@ -851,7 +851,7 @@ Foam::label Foam::checkGeometry
|
||||
<< " warped faces to set " << faces.name() << endl;
|
||||
faces.instance() = mesh.pointsInstance();
|
||||
faces.write();
|
||||
if (surfWriter.valid())
|
||||
if (surfWriter)
|
||||
{
|
||||
mergeAndWrite(*surfWriter, faces);
|
||||
}
|
||||
@ -872,7 +872,7 @@ Foam::label Foam::checkGeometry
|
||||
<< " under-determined cells to set " << cells.name() << endl;
|
||||
cells.instance() = mesh.pointsInstance();
|
||||
cells.write();
|
||||
if (surfWriter.valid())
|
||||
if (surfWriter)
|
||||
{
|
||||
mergeAndWrite(*surfWriter, cells);
|
||||
}
|
||||
@ -892,7 +892,7 @@ Foam::label Foam::checkGeometry
|
||||
<< " concave cells to set " << cells.name() << endl;
|
||||
cells.instance() = mesh.pointsInstance();
|
||||
cells.write();
|
||||
if (surfWriter.valid())
|
||||
if (surfWriter)
|
||||
{
|
||||
mergeAndWrite(*surfWriter, cells);
|
||||
}
|
||||
@ -913,7 +913,7 @@ Foam::label Foam::checkGeometry
|
||||
<< faces.name() << endl;
|
||||
faces.instance() = mesh.pointsInstance();
|
||||
faces.write();
|
||||
if (surfWriter.valid())
|
||||
if (surfWriter)
|
||||
{
|
||||
mergeAndWrite(*surfWriter, faces);
|
||||
}
|
||||
@ -934,7 +934,7 @@ Foam::label Foam::checkGeometry
|
||||
<< faces.name() << endl;
|
||||
faces.instance() = mesh.pointsInstance();
|
||||
faces.write();
|
||||
if (surfWriter.valid())
|
||||
if (surfWriter)
|
||||
{
|
||||
mergeAndWrite(*surfWriter, faces);
|
||||
}
|
||||
@ -949,7 +949,7 @@ Foam::label Foam::checkGeometry
|
||||
const word procAndTime(Foam::name(Pstream::myProcNo()) + "_" + tmName);
|
||||
|
||||
autoPtr<surfaceWriter> patchWriter;
|
||||
if (!surfWriter.valid())
|
||||
if (!surfWriter)
|
||||
{
|
||||
patchWriter.reset(new surfaceWriters::vtkWriter());
|
||||
}
|
||||
|
||||
@ -30,7 +30,7 @@ Foam::label Foam::checkMeshQuality
|
||||
faces.instance() = mesh.pointsInstance();
|
||||
faces.write();
|
||||
|
||||
if (writer.valid())
|
||||
if (writer)
|
||||
{
|
||||
mergeAndWrite(*writer, faces);
|
||||
}
|
||||
|
||||
@ -6,7 +6,7 @@
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
Copyright (C) 2011-2016 OpenFOAM Foundation
|
||||
Copyright (C) 2017-2019 OpenCFD Ltd.
|
||||
Copyright (C) 2017-2020 OpenCFD Ltd.
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
This file is part of OpenFOAM.
|
||||
@ -202,7 +202,7 @@ Foam::label Foam::checkTopology
|
||||
<< " illegal cells to set " << cells.name() << endl;
|
||||
cells.instance() = mesh.pointsInstance();
|
||||
cells.write();
|
||||
if (surfWriter.valid())
|
||||
if (surfWriter)
|
||||
{
|
||||
mergeAndWrite(*surfWriter, cells);
|
||||
}
|
||||
@ -226,7 +226,7 @@ Foam::label Foam::checkTopology
|
||||
<< " unused points to set " << points.name() << endl;
|
||||
points.instance() = mesh.pointsInstance();
|
||||
points.write();
|
||||
if (setWriter.valid())
|
||||
if (setWriter)
|
||||
{
|
||||
mergeAndWrite(*setWriter, points);
|
||||
}
|
||||
@ -248,7 +248,7 @@ Foam::label Foam::checkTopology
|
||||
<< " unordered faces to set " << faces.name() << endl;
|
||||
faces.instance() = mesh.pointsInstance();
|
||||
faces.write();
|
||||
if (surfWriter.valid())
|
||||
if (surfWriter)
|
||||
{
|
||||
mergeAndWrite(*surfWriter, faces);
|
||||
}
|
||||
@ -268,7 +268,7 @@ Foam::label Foam::checkTopology
|
||||
<< faces.name() << endl;
|
||||
faces.instance() = mesh.pointsInstance();
|
||||
faces.write();
|
||||
if (surfWriter.valid())
|
||||
if (surfWriter)
|
||||
{
|
||||
mergeAndWrite(*surfWriter, faces);
|
||||
}
|
||||
@ -289,7 +289,7 @@ Foam::label Foam::checkTopology
|
||||
<< endl;
|
||||
cells.instance() = mesh.pointsInstance();
|
||||
cells.write();
|
||||
if (surfWriter.valid())
|
||||
if (surfWriter)
|
||||
{
|
||||
mergeAndWrite(*surfWriter, cells);
|
||||
}
|
||||
@ -313,7 +313,7 @@ Foam::label Foam::checkTopology
|
||||
<< faces.name() << endl;
|
||||
faces.instance() = mesh.pointsInstance();
|
||||
faces.write();
|
||||
if (surfWriter.valid())
|
||||
if (surfWriter)
|
||||
{
|
||||
mergeAndWrite(*surfWriter, faces);
|
||||
}
|
||||
@ -368,7 +368,7 @@ Foam::label Foam::checkTopology
|
||||
<< endl;
|
||||
oneCells.instance() = mesh.pointsInstance();
|
||||
oneCells.write();
|
||||
if (surfWriter.valid())
|
||||
if (surfWriter)
|
||||
{
|
||||
mergeAndWrite(*surfWriter, oneCells);
|
||||
}
|
||||
@ -384,7 +384,7 @@ Foam::label Foam::checkTopology
|
||||
<< endl;
|
||||
twoCells.instance() = mesh.pointsInstance();
|
||||
twoCells.write();
|
||||
if (surfWriter.valid())
|
||||
if (surfWriter)
|
||||
{
|
||||
mergeAndWrite(*surfWriter, twoCells);
|
||||
}
|
||||
@ -529,7 +529,7 @@ Foam::label Foam::checkTopology
|
||||
<< " points that are in multiple regions to set "
|
||||
<< points.name() << endl;
|
||||
points.write();
|
||||
if (setWriter.valid())
|
||||
if (setWriter)
|
||||
{
|
||||
mergeAndWrite(*setWriter, points);
|
||||
}
|
||||
@ -640,7 +640,7 @@ Foam::label Foam::checkTopology
|
||||
<< " conflicting points to set " << points.name() << endl;
|
||||
points.instance() = mesh.pointsInstance();
|
||||
points.write();
|
||||
if (setWriter.valid())
|
||||
if (setWriter)
|
||||
{
|
||||
mergeAndWrite(*setWriter, points);
|
||||
}
|
||||
|
||||
@ -6,6 +6,7 @@
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
Copyright (C) 2011-2016 OpenFOAM Foundation
|
||||
Copyright (C) 2020 OpenCFD Ltd.
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
This file is part of OpenFOAM.
|
||||
@ -1035,9 +1036,9 @@ void Foam::meshDualiser::setRefinement
|
||||
-1, //masterCellID,
|
||||
-1 //zoneID
|
||||
);
|
||||
if (dualCcStr.valid())
|
||||
if (dualCcStr)
|
||||
{
|
||||
meshTools::writeOBJ(dualCcStr(), mesh_.points()[pointi]);
|
||||
meshTools::writeOBJ(*dualCcStr, mesh_.points()[pointi]);
|
||||
}
|
||||
}
|
||||
|
||||
@ -1079,11 +1080,11 @@ void Foam::meshDualiser::setRefinement
|
||||
-1, //masterCellID
|
||||
mesh_.cellZones().whichZone(pCells[pCelli]) //zoneID
|
||||
);
|
||||
if (dualCcStr.valid())
|
||||
if (dualCcStr)
|
||||
{
|
||||
meshTools::writeOBJ
|
||||
(
|
||||
dualCcStr(),
|
||||
*dualCcStr,
|
||||
0.5*(mesh_.points()[pointi]+cellCentres[pCells[pCelli]])
|
||||
);
|
||||
}
|
||||
@ -1104,9 +1105,9 @@ void Foam::meshDualiser::setRefinement
|
||||
-1 //zoneID
|
||||
);
|
||||
|
||||
if (dualCcStr.valid())
|
||||
if (dualCcStr)
|
||||
{
|
||||
meshTools::writeOBJ(dualCcStr(), mesh_.points()[pointi]);
|
||||
meshTools::writeOBJ(*dualCcStr, mesh_.points()[pointi]);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -6,7 +6,7 @@
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
Copyright (C) 2011-2018 OpenFOAM Foundation
|
||||
Copyright (C) 2017-2018 OpenCFD Ltd.
|
||||
Copyright (C) 2017-2020 OpenCFD Ltd.
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
This file is part of OpenFOAM.
|
||||
@ -393,9 +393,9 @@ bool doCommand
|
||||
currentSet.resize(max(currentSet.size(), typSize));
|
||||
}
|
||||
|
||||
if (currentSetPtr.valid())
|
||||
if (currentSetPtr)
|
||||
{
|
||||
topoSet& currentSet = currentSetPtr();
|
||||
topoSet& currentSet = *currentSetPtr;
|
||||
|
||||
Info<< " Set:" << currentSet.name()
|
||||
<< " Size:" << returnReduce(currentSet.size(), sumOp<label>())
|
||||
@ -829,9 +829,9 @@ int main(int argc, char *argv[])
|
||||
|
||||
commandStatus stat = INVALID;
|
||||
|
||||
if (fileStreamPtr.valid())
|
||||
if (fileStreamPtr)
|
||||
{
|
||||
if (!fileStreamPtr().good())
|
||||
if (!fileStreamPtr->good())
|
||||
{
|
||||
Info<< "End of batch file" << endl;
|
||||
// No error.
|
||||
|
||||
@ -6,7 +6,7 @@
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
Copyright (C) 2011-2017 OpenFOAM Foundation
|
||||
Copyright (C) 2018 OpenCFD Ltd.
|
||||
Copyright (C) 2018-2020 OpenCFD Ltd.
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
This file is part of OpenFOAM.
|
||||
@ -394,7 +394,7 @@ int main(int argc, char *argv[])
|
||||
break;
|
||||
}
|
||||
|
||||
if (currentSet.valid())
|
||||
if (currentSet)
|
||||
{
|
||||
Info<< " "
|
||||
<< currentSet().type() << ' '
|
||||
|
||||
@ -426,9 +426,9 @@ int main(int argc, char *argv[])
|
||||
|
||||
if (!lagrangianDirs.empty())
|
||||
{
|
||||
if (meshPtr.valid())
|
||||
if (meshPtr)
|
||||
{
|
||||
meshPtr().readUpdate();
|
||||
meshPtr->readUpdate();
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
@ -6,7 +6,7 @@
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
Copyright (C) 2011-2016 OpenFOAM Foundation
|
||||
Copyright (C) 2019 OpenCFD Ltd.
|
||||
Copyright (C) 2019-2020 OpenCFD Ltd.
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
This file is part of OpenFOAM.
|
||||
@ -334,7 +334,7 @@ bool Foam::domainDecomposition::writeDecomposition(const bool decomposeSets)
|
||||
|
||||
autoPtr<polyMesh> procMeshPtr;
|
||||
|
||||
if (facesInstancePointsPtr_.valid())
|
||||
if (facesInstancePointsPtr_)
|
||||
{
|
||||
// Construct mesh from facesInstance.
|
||||
pointField facesInstancePoints
|
||||
@ -738,7 +738,7 @@ bool Foam::domainDecomposition::writeDecomposition(const bool decomposeSets)
|
||||
procMesh.write();
|
||||
|
||||
// Write points if pointsInstance differing from facesInstance
|
||||
if (facesInstancePointsPtr_.valid())
|
||||
if (facesInstancePointsPtr_)
|
||||
{
|
||||
pointIOField pointsInstancePoints
|
||||
(
|
||||
|
||||
@ -672,9 +672,9 @@ void readFields
|
||||
// Load field (but not oldTime)
|
||||
readField(io, mesh, i, fields);
|
||||
// Create zero sized field and send
|
||||
if (subsetterPtr.valid())
|
||||
if (subsetterPtr)
|
||||
{
|
||||
tmp<GeoField> tsubfld = subsetterPtr().interpolate(fields[i]);
|
||||
tmp<GeoField> tsubfld = subsetterPtr->interpolate(fields[i]);
|
||||
|
||||
// Send to all processors that don't have a mesh
|
||||
for (label procI = 1; procI < Pstream::nProcs(); ++procI)
|
||||
@ -1803,7 +1803,7 @@ void reconstructLagrangian
|
||||
|
||||
if (cloudNames.size())
|
||||
{
|
||||
if (!lagrangianReconstructorPtr.valid())
|
||||
if (!lagrangianReconstructorPtr)
|
||||
{
|
||||
lagrangianReconstructorPtr.reset
|
||||
(
|
||||
@ -2116,7 +2116,7 @@ void redistributeLagrangian
|
||||
{
|
||||
if (clouds.size())
|
||||
{
|
||||
if (!lagrangianReconstructorPtr.valid())
|
||||
if (!lagrangianReconstructorPtr)
|
||||
{
|
||||
lagrangianReconstructorPtr.reset
|
||||
(
|
||||
@ -2804,7 +2804,7 @@ int main(int argc, char *argv[])
|
||||
Info<< " Detected topology change;"
|
||||
<< " reconstructing addressing" << nl << endl;
|
||||
|
||||
if (baseMeshPtr.valid())
|
||||
if (baseMeshPtr)
|
||||
{
|
||||
// Cannot do a baseMesh::readUpdate() since not all
|
||||
// processors will have mesh files. So instead just
|
||||
|
||||
@ -5,7 +5,7 @@
|
||||
\\ / A nd | www.openfoam.com
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
Copyright (C) 2019 OpenCFD Ltd.
|
||||
Copyright (C) 2019-2020 OpenCFD Ltd.
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
This file is part of OpenFOAM.
|
||||
@ -153,7 +153,7 @@ Description
|
||||
|
||||
|
||||
// Finish writers
|
||||
if (internalWriter.valid())
|
||||
if (internalWriter)
|
||||
{
|
||||
internalWriter->close();
|
||||
}
|
||||
|
||||
@ -262,7 +262,7 @@ Description
|
||||
// CellData
|
||||
{
|
||||
// Begin CellData
|
||||
if (internalWriter.valid())
|
||||
if (internalWriter)
|
||||
{
|
||||
// Optionally with cellID and procID fields
|
||||
internalWriter->beginCellData
|
||||
@ -323,7 +323,7 @@ Description
|
||||
if (doPointValues)
|
||||
{
|
||||
// Begin PointData
|
||||
if (internalWriter.valid())
|
||||
if (internalWriter)
|
||||
{
|
||||
internalWriter->beginPointData
|
||||
(
|
||||
@ -386,7 +386,7 @@ Description
|
||||
|
||||
|
||||
// Finish writers
|
||||
if (internalWriter.valid())
|
||||
if (internalWriter)
|
||||
{
|
||||
internalWriter->close();
|
||||
}
|
||||
|
||||
@ -60,7 +60,7 @@ bool writeDimField
|
||||
|
||||
const auto& field = tfield();
|
||||
|
||||
if (internalWriter.valid())
|
||||
if (internalWriter)
|
||||
{
|
||||
internalWriter->write(field);
|
||||
}
|
||||
|
||||
@ -5,7 +5,7 @@
|
||||
\\ / A nd | www.openfoam.com
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
Copyright (C) 2018 OpenCFD Ltd.
|
||||
Copyright (C) 2018-2020 OpenCFD Ltd.
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
This file is part of OpenFOAM.
|
||||
@ -83,7 +83,7 @@ bool writePointField
|
||||
const auto& field = tproxied();
|
||||
|
||||
// Internal
|
||||
if (internalWriter.valid())
|
||||
if (internalWriter)
|
||||
{
|
||||
internalWriter->write(field);
|
||||
}
|
||||
|
||||
@ -63,7 +63,7 @@ bool writeVolField
|
||||
const auto& field = tfield();
|
||||
|
||||
// Internal
|
||||
if (internalWriter.valid())
|
||||
if (internalWriter)
|
||||
{
|
||||
internalWriter->write(field);
|
||||
}
|
||||
|
||||
@ -99,7 +99,7 @@ int main(int argc, char *argv[])
|
||||
autoPtr<lumpedPointIOMovement> movement =
|
||||
lumpedPointIOMovement::New(runTime);
|
||||
|
||||
if (!movement.valid())
|
||||
if (!movement)
|
||||
{
|
||||
Info<< "No valid movement found" << endl;
|
||||
return 1;
|
||||
@ -123,7 +123,7 @@ int main(int argc, char *argv[])
|
||||
|
||||
autoPtr<lumpedPointIOMovement> movement = lumpedPointIOMovement::New(mesh);
|
||||
|
||||
if (!movement.valid())
|
||||
if (!movement)
|
||||
{
|
||||
Info<< "No valid movement found" << endl;
|
||||
return 1;
|
||||
|
||||
@ -802,9 +802,9 @@ int main(int argc, char *argv[])
|
||||
ctrl
|
||||
);
|
||||
}
|
||||
else if (exprDictPtr.valid())
|
||||
else if (exprDictPtr)
|
||||
{
|
||||
const dictionary& exprDict = exprDictPtr();
|
||||
const dictionary& exprDict = *exprDictPtr;
|
||||
|
||||
// Read set construct info from dictionary
|
||||
PtrList<entry> actions(exprDict.lookup("expressions"));
|
||||
@ -898,7 +898,7 @@ int main(int argc, char *argv[])
|
||||
);
|
||||
}
|
||||
}
|
||||
else if (exprDictPtr.valid())
|
||||
else
|
||||
{
|
||||
FatalErrorInFunction
|
||||
<< "No command-line or dictionary??" << nl << endl
|
||||
|
||||
@ -469,7 +469,7 @@ int main(int argc, char *argv[])
|
||||
Info<< "Surface has " << illegalFaces.size()
|
||||
<< " illegal triangles." << endl;
|
||||
|
||||
if (surfWriter.valid())
|
||||
if (surfWriter)
|
||||
{
|
||||
boolList isIllegalFace(surf.size(), false);
|
||||
UIndirectList<bool>(isIllegalFace, illegalFaces) = true;
|
||||
@ -598,7 +598,7 @@ int main(int argc, char *argv[])
|
||||
}
|
||||
|
||||
// Dump for subsetting
|
||||
if (surfWriter.valid())
|
||||
if (surfWriter)
|
||||
{
|
||||
// Transcribe faces
|
||||
faceList faces(surf.size());
|
||||
@ -867,7 +867,7 @@ int main(int argc, char *argv[])
|
||||
{
|
||||
Info<< "Splitting surface into parts ..." << endl << endl;
|
||||
|
||||
if (!surfWriter.valid())
|
||||
if (!surfWriter)
|
||||
{
|
||||
surfWriter.reset(new surfaceWriters::vtkWriter());
|
||||
}
|
||||
@ -933,7 +933,7 @@ int main(int argc, char *argv[])
|
||||
|
||||
if (outputThreshold > 0)
|
||||
{
|
||||
if (!surfWriter.valid())
|
||||
if (!surfWriter)
|
||||
{
|
||||
surfWriter.reset(new surfaceWriters::vtkWriter());
|
||||
}
|
||||
@ -1001,7 +1001,7 @@ int main(int argc, char *argv[])
|
||||
{
|
||||
nInt++;
|
||||
|
||||
if (intStreamPtr.valid())
|
||||
if (intStreamPtr)
|
||||
{
|
||||
intStreamPtr().write(hitInfo.hitPoint());
|
||||
}
|
||||
@ -1013,7 +1013,7 @@ int main(int argc, char *argv[])
|
||||
{
|
||||
nInt++;
|
||||
|
||||
if (intStreamPtr.valid())
|
||||
if (intStreamPtr)
|
||||
{
|
||||
intStreamPtr().write(hitInfo2.hitPoint());
|
||||
}
|
||||
@ -1070,7 +1070,7 @@ int main(int argc, char *argv[])
|
||||
Info<< "Surface is self-intersecting at " << nInt
|
||||
<< " locations." << endl;
|
||||
|
||||
if (intStreamPtr.valid())
|
||||
if (intStreamPtr)
|
||||
{
|
||||
Info<< "Writing intersection points to "
|
||||
<< intStreamPtr().name() << endl;
|
||||
|
||||
@ -711,7 +711,7 @@ int main(int argc, char *argv[])
|
||||
10 // externalAngleTolerance
|
||||
);
|
||||
|
||||
if (vtkWriter.valid())
|
||||
if (vtkWriter)
|
||||
{
|
||||
vtkWriter->beginCellData();
|
||||
vtkWriter->write("internalCloseness", tcloseness[0]());
|
||||
@ -735,7 +735,7 @@ int main(int argc, char *argv[])
|
||||
maxProximity
|
||||
);
|
||||
|
||||
if (vtkWriter.valid())
|
||||
if (vtkWriter)
|
||||
{
|
||||
vtkWriter->beginCellData();
|
||||
vtkWriter->write("featureProximity", tproximity());
|
||||
@ -753,7 +753,7 @@ int main(int argc, char *argv[])
|
||||
surf
|
||||
);
|
||||
|
||||
if (vtkWriter.valid())
|
||||
if (vtkWriter)
|
||||
{
|
||||
vtkWriter->beginPointData();
|
||||
vtkWriter->write("curvature", tcurvature());
|
||||
|
||||
@ -277,7 +277,7 @@ int main(int argc, char *argv[])
|
||||
surf.cleanup(true);
|
||||
}
|
||||
|
||||
if (fromCsys.valid())
|
||||
if (fromCsys)
|
||||
{
|
||||
Info<< "move points from coordinate system: "
|
||||
<< fromCsys->name() << endl;
|
||||
@ -285,7 +285,7 @@ int main(int argc, char *argv[])
|
||||
surf.movePoints(tpf());
|
||||
}
|
||||
|
||||
if (toCsys.valid())
|
||||
if (toCsys)
|
||||
{
|
||||
Info<< "move points to coordinate system: "
|
||||
<< toCsys->name() << endl;
|
||||
|
||||
Reference in New Issue
Block a user