diff --git a/applications/solvers/multiphase/twoPhaseEulerFoam/twoPhaseSystem/BlendedInterfacialModel/BlendedInterfacialModel.C b/applications/solvers/multiphase/twoPhaseEulerFoam/twoPhaseSystem/BlendedInterfacialModel/BlendedInterfacialModel.C index cd7570bf26d7f6ff2537d2050f205c1c4bffb433..89033668c53740abf809a2640bd2de70a311a7f1 100644 --- a/applications/solvers/multiphase/twoPhaseEulerFoam/twoPhaseSystem/BlendedInterfacialModel/BlendedInterfacialModel.C +++ b/applications/solvers/multiphase/twoPhaseEulerFoam/twoPhaseSystem/BlendedInterfacialModel/BlendedInterfacialModel.C @@ -6,6 +6,7 @@ \\/ M anipulation | ------------------------------------------------------------------------------- Copyright (C) 2014-2016 OpenFOAM Foundation + Copyright (C) 2020 OpenCFD Ltd. ------------------------------------------------------------------------------- License This file is part of OpenFOAM. @@ -129,12 +130,12 @@ Foam::BlendedInterfacialModel::K() const { tmp f1, f2; - if (model_.valid() || model1In2_.valid()) + if (model_ || model1In2_) { f1 = blending_.f1(pair1In2_.dispersed(), pair2In1_.dispersed()); } - if (model_.valid() || model2In1_.valid()) + if (model_ || model2In1_) { f2 = blending_.f2(pair1In2_.dispersed(), pair2In1_.dispersed()); } @@ -157,17 +158,17 @@ Foam::BlendedInterfacialModel::K() const ) ); - if (model_.valid()) + if (model_) { x.ref() += model_->K()*(f1() - f2()); } - if (model1In2_.valid()) + if (model1In2_) { x.ref() += model1In2_->K()*(1 - f1); } - if (model2In1_.valid()) + if (model2In1_) { x.ref() += model2In1_->K()*f2; } @@ -175,7 +176,7 @@ Foam::BlendedInterfacialModel::K() const if ( correctFixedFluxBCs_ - && (model_.valid() || model1In2_.valid() || model2In1_.valid()) + && (model_ || model1In2_ || model2In1_) ) { correctFixedFluxBCs(x.ref()); @@ -191,7 +192,7 @@ Foam::BlendedInterfacialModel::Kf() const { tmp f1, f2; - if (model_.valid() || model1In2_.valid()) + if (model_ || model1In2_) { f1 = fvc::interpolate ( @@ -199,7 +200,7 @@ Foam::BlendedInterfacialModel::Kf() const ); } - if (model_.valid() || model2In1_.valid()) + if (model_ || model2In1_) { f2 = fvc::interpolate ( @@ -225,17 +226,17 @@ Foam::BlendedInterfacialModel::Kf() const ) ); - if (model_.valid()) + if (model_) { x.ref() += model_->Kf()*(f1() - f2()); } - if (model1In2_.valid()) + if (model1In2_) { x.ref() += model1In2_->Kf()*(1 - f1); } - if (model2In1_.valid()) + if (model2In1_) { x.ref() += model2In1_->Kf()*f2; } @@ -243,7 +244,7 @@ Foam::BlendedInterfacialModel::Kf() const if ( correctFixedFluxBCs_ - && (model_.valid() || model1In2_.valid() || model2In1_.valid()) + && (model_ || model1In2_ || model2In1_) ) { correctFixedFluxBCs(x.ref()); @@ -260,12 +261,12 @@ Foam::BlendedInterfacialModel::F() const { tmp f1, f2; - if (model_.valid() || model1In2_.valid()) + if (model_ || model1In2_) { f1 = blending_.f1(pair1In2_.dispersed(), pair2In1_.dispersed()); } - if (model_.valid() || model2In1_.valid()) + if (model_ || model2In1_) { f2 = blending_.f2(pair1In2_.dispersed(), pair2In1_.dispersed()); } @@ -285,17 +286,17 @@ Foam::BlendedInterfacialModel::F() const dimensioned(modelType::dimF, Zero) ); - if (model_.valid()) + if (model_) { x.ref() += model_->F()*(f1() - f2()); } - if (model1In2_.valid()) + if (model1In2_) { x.ref() += model1In2_->F()*(1 - f1); } - if (model2In1_.valid()) + if (model2In1_) { x.ref() -= model2In1_->F()*f2; // note : subtraction } @@ -303,7 +304,7 @@ Foam::BlendedInterfacialModel::F() const if ( correctFixedFluxBCs_ - && (model_.valid() || model1In2_.valid() || model2In1_.valid()) + && (model_ || model1In2_ || model2In1_) ) { correctFixedFluxBCs(x.ref()); @@ -319,7 +320,7 @@ Foam::BlendedInterfacialModel::Ff() const { tmp f1, f2; - if (model_.valid() || model1In2_.valid()) + if (model_ || model1In2_) { f1 = fvc::interpolate ( @@ -327,7 +328,7 @@ Foam::BlendedInterfacialModel::Ff() const ); } - if (model_.valid() || model2In1_.valid()) + if (model_ || model2In1_) { f2 = fvc::interpolate ( @@ -352,17 +353,17 @@ Foam::BlendedInterfacialModel::Ff() const x.ref().setOriented(); - if (model_.valid()) + if (model_) { x.ref() += model_->Ff()*(f1() - f2()); } - if (model1In2_.valid()) + if (model1In2_) { x.ref() += model1In2_->Ff()*(1 - f1); } - if (model2In1_.valid()) + if (model2In1_) { x.ref() -= model2In1_->Ff()*f2; // note : subtraction } @@ -370,7 +371,7 @@ Foam::BlendedInterfacialModel::Ff() const if ( correctFixedFluxBCs_ - && (model_.valid() || model1In2_.valid() || model2In1_.valid()) + && (model_ || model1In2_ || model2In1_) ) { correctFixedFluxBCs(x.ref()); @@ -386,12 +387,12 @@ Foam::BlendedInterfacialModel::D() const { tmp f1, f2; - if (model_.valid() || model1In2_.valid()) + if (model_ || model1In2_) { f1 = blending_.f1(pair1In2_.dispersed(), pair2In1_.dispersed()); } - if (model_.valid() || model2In1_.valid()) + if (model_ || model2In1_) { f2 = blending_.f2(pair1In2_.dispersed(), pair2In1_.dispersed()); } @@ -414,17 +415,17 @@ Foam::BlendedInterfacialModel::D() const ) ); - if (model_.valid()) + if (model_) { x.ref() += model_->D()*(f1() - f2()); } - if (model1In2_.valid()) + if (model1In2_) { x.ref() += model1In2_->D()*(1 - f1); } - if (model2In1_.valid()) + if (model2In1_) { x.ref() += model2In1_->D()*f2; } @@ -432,7 +433,7 @@ Foam::BlendedInterfacialModel::D() const if ( correctFixedFluxBCs_ - && (model_.valid() || model1In2_.valid() || model2In1_.valid()) + && (model_ || model1In2_ || model2In1_) ) { correctFixedFluxBCs(x.ref()); @@ -451,8 +452,8 @@ bool Foam::BlendedInterfacialModel::hasModel return ( &phase == &(pair_.phase1()) - ? model1In2_.valid() - : model2In1_.valid() + ? bool(model1In2_) + : bool(model2In1_) ); } diff --git a/applications/solvers/multiphase/twoPhaseEulerFoam/twoPhaseSystem/phasePair/orderedPhasePair/orderedPhasePair.C b/applications/solvers/multiphase/twoPhaseEulerFoam/twoPhaseSystem/phasePair/orderedPhasePair/orderedPhasePair.C index 65a87f642bba3e0145b264d43113a7d55e3cd190..21b6214b4ca2f6177cf6e462c625ace0abf47b92 100644 --- a/applications/solvers/multiphase/twoPhaseEulerFoam/twoPhaseSystem/phasePair/orderedPhasePair/orderedPhasePair.C +++ b/applications/solvers/multiphase/twoPhaseEulerFoam/twoPhaseSystem/phasePair/orderedPhasePair/orderedPhasePair.C @@ -6,6 +6,7 @@ \\/ M anipulation | ------------------------------------------------------------------------------- Copyright (C) 2014-2015 OpenFOAM Foundation + Copyright (C) 2020 OpenCFD Ltd. ------------------------------------------------------------------------------- License This file is part of OpenFOAM. @@ -85,7 +86,7 @@ Foam::word Foam::orderedPhasePair::name() const Foam::tmp Foam::orderedPhasePair::E() const { - if (!aspectRatio_.valid()) + if (!aspectRatio_) { FatalErrorInFunction << "Aspect ratio model not specified for " << *this << "." diff --git a/applications/test/autoPtr/Test-autoPtr.C b/applications/test/autoPtr/Test-autoPtr.C index d0b18a0dad6d921148a2dc313e7dab7c20c90fb1..ed621ea0f261e6143ef703d9b89c5fb133add8bc 100644 --- a/applications/test/autoPtr/Test-autoPtr.C +++ b/applications/test/autoPtr/Test-autoPtr.C @@ -5,7 +5,7 @@ \\ / A nd | www.openfoam.com \\/ M anipulation | ------------------------------------------------------------------------------- - Copyright (C) 2018-2019 OpenCFD Ltd. + Copyright (C) 2018-2020 OpenCFD Ltd. ------------------------------------------------------------------------------- License This file is part of OpenFOAM. @@ -44,7 +44,7 @@ void testTransfer1(autoPtr ap) // Passed in copy, so automatically removes content // Transfer would be nice, but not actually needed - Info<< "recv " << Switch::name(ap.valid()) << nl; + Info<< "recv " << Switch::name(bool(ap)) << nl; } @@ -53,7 +53,7 @@ void testTransfer1(autoPtr ap) void testTransfer2(autoPtr&& ap) { // As rvalue, so this time we actually get to manage content - Info<< "recv " << Switch::name(ap.valid()) << nl; + Info<< "recv " << Switch::name(bool(ap)) << nl; } @@ -161,7 +161,7 @@ int main(int argc, char *argv[]) testTransfer2(std::move(list)); - Info<<"now have valid=" << Switch::name(list.valid()); + Info<<"now have valid=" << Switch::name(bool(list)); if (list) { @@ -209,9 +209,9 @@ int main(int argc, char *argv[]) testTransfer2(std::move(list)); - Info<<"now have valid=" << Switch::name(list.valid()); + Info<<"now have valid=" << Switch::name(bool(list)); - if (list.valid()) + if (list) { Info<< nl << flatOutput(*list) << " @ " << name(list->cdata()) @@ -229,7 +229,7 @@ int main(int argc, char *argv[]) auto ptr1 = autoPtr::New(); auto ptr2 = autoPtr::New(); - Info<<"ptr valid: " << ptr1.valid() << nl; + Info<<"ptr valid: " << bool(ptr1) << nl; // Refuses to compile (good!): ptr1 = new labelList(10); diff --git a/applications/test/dictionaryTokens/dictionaryTokens.C b/applications/test/dictionaryTokens/dictionaryTokens.C index d958b5d9452f409658a4b2e7933b00f63b8f6ca1..f61f6ea34c29845b269f3c9bcfe5f510a78fe126 100644 --- a/applications/test/dictionaryTokens/dictionaryTokens.C +++ b/applications/test/dictionaryTokens/dictionaryTokens.C @@ -5,7 +5,7 @@ \\ / A nd | www.openfoam.com \\/ M anipulation | ------------------------------------------------------------------------------- - Copyright (C) 2017 OpenCFD Ltd. + Copyright (C) 2017-2020 OpenCFD Ltd. ------------------------------------------------------------------------------- License This file is part of OpenFOAM. @@ -53,8 +53,8 @@ Foam::token Foam::dictionaryTokens::keywordToken(const entry& e) bool Foam::dictionaryTokens::setIterator() const { - primIter_.clear(); - dictIter_.clear(); + primIter_.reset(nullptr); + dictIter_.reset(nullptr); if (entryIter_ != dict_.cend()) { @@ -166,8 +166,8 @@ bool Foam::dictionaryTokens::good() const entryIter_ != dict_.cend() && ( - (primIter_.valid() && primIter_().good()) - || (dictIter_.valid() && dictIter_().good()) + (primIter_ && primIter_->good()) + || (dictIter_ && dictIter_->good()) ) ); } @@ -189,8 +189,8 @@ const Foam::token& Foam::dictionaryTokens::operator*() const { if (good()) { - if (primIter_.valid()) return *(primIter_()); - if (dictIter_.valid()) return *(dictIter_()); + if (primIter_) return *(*primIter_); + if (dictIter_) return *(*dictIter_); } return token::undefinedToken; @@ -251,8 +251,8 @@ bool Foam::dictionaryTokens::operator++() if (ok) { - if (primIter_.valid()) ok = ++(primIter_()); - if (dictIter_.valid()) ok = ++(dictIter_()); + if (primIter_) ok = ++(*primIter_); + if (dictIter_) ok = ++(*dictIter_); if (!ok) { diff --git a/applications/utilities/mesh/advanced/combinePatchFaces/combinePatchFaces.C b/applications/utilities/mesh/advanced/combinePatchFaces/combinePatchFaces.C index a37ac14a39644d44eb6ad285c3286ffaa9215315..b4591c772197f4a107843fc0bae90e91fd3cd648 100644 --- a/applications/utilities/mesh/advanced/combinePatchFaces/combinePatchFaces.C +++ b/applications/utilities/mesh/advanced/combinePatchFaces/combinePatchFaces.C @@ -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; diff --git a/applications/utilities/mesh/generation/extrude/extrudeMesh/extrudeMesh.C b/applications/utilities/mesh/generation/extrude/extrudeMesh/extrudeMesh.C index 971c546c29f3d60c51b1b157de11a2d78fa6decc..7d0909ba5b52ab8c6630462f0673682b484a2f7d 100644 --- a/applications/utilities/mesh/generation/extrude/extrudeMesh/extrudeMesh.C +++ b/applications/utilities/mesh/generation/extrude/extrudeMesh/extrudeMesh.C @@ -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 @@ -815,9 +815,9 @@ int main(int argc, char *argv[]) polyMesh& mesh = ( - meshFromMesh.valid() - ? meshFromMesh() - : meshFromSurface() + meshFromMesh + ? *meshFromMesh + : *meshFromSurface ); @@ -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(); } diff --git a/applications/utilities/mesh/generation/foamyMesh/conformalVoronoiMesh/DelaunayMesh/DistributedDelaunayMesh.C b/applications/utilities/mesh/generation/foamyMesh/conformalVoronoiMesh/DelaunayMesh/DistributedDelaunayMesh.C index bbd54cf475457e12bb5e1aef2119a580bdab770d..e02810916d18065d759981d84edad64179135c68 100644 --- a/applications/utilities/mesh/generation/foamyMesh/conformalVoronoiMesh/DelaunayMesh/DistributedDelaunayMesh.C +++ b/applications/utilities/mesh/generation/foamyMesh/conformalVoronoiMesh/DelaunayMesh/DistributedDelaunayMesh.C @@ -6,6 +6,7 @@ \\/ M anipulation | ------------------------------------------------------------------------------- Copyright (C) 2012-2016 OpenFOAM Foundation + Copyright (C) 2020 OpenCFD Ltd. ------------------------------------------------------------------------------- License This file is part of OpenFOAM. @@ -625,7 +626,7 @@ void Foam::DistributedDelaunayMesh::sync return; } - if (allBackgroundMeshBounds_.empty()) + if (!allBackgroundMeshBounds_) { distributeBoundBoxes(bb); } @@ -810,7 +811,7 @@ void Foam::DistributedDelaunayMesh::sync(const boundBox& bb) return; } - if (allBackgroundMeshBounds_.empty()) + if (!allBackgroundMeshBounds_) { distributeBoundBoxes(bb); } diff --git a/applications/utilities/mesh/manipulation/checkMesh/checkGeometry.C b/applications/utilities/mesh/manipulation/checkMesh/checkGeometry.C index 4f1f821681022aaafc0cee51a41dde3840976b90..90268fdf4b67624d1c870515933cb66dc641672c 100644 --- a/applications/utilities/mesh/manipulation/checkMesh/checkGeometry.C +++ b/applications/utilities/mesh/manipulation/checkMesh/checkGeometry.C @@ -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,12 +949,12 @@ Foam::label Foam::checkGeometry const word procAndTime(Foam::name(Pstream::myProcNo()) + "_" + tmName); autoPtr patchWriter; - if (!surfWriter.valid()) + if (!surfWriter) { patchWriter.reset(new surfaceWriters::vtkWriter()); } - surfaceWriter& wr = (surfWriter.valid() ? *surfWriter : *patchWriter); + surfaceWriter& wr = (surfWriter ? *surfWriter : *patchWriter); // Currently only do AMI checks diff --git a/applications/utilities/mesh/manipulation/checkMesh/checkMeshQuality.C b/applications/utilities/mesh/manipulation/checkMesh/checkMeshQuality.C index 26dfbb6d20fd2725788052f3749e1e0cbb72dcb6..d97308d6ec2b335f468bf734c655b6757f9d3fea 100644 --- a/applications/utilities/mesh/manipulation/checkMesh/checkMeshQuality.C +++ b/applications/utilities/mesh/manipulation/checkMesh/checkMeshQuality.C @@ -30,7 +30,7 @@ Foam::label Foam::checkMeshQuality faces.instance() = mesh.pointsInstance(); faces.write(); - if (writer.valid()) + if (writer) { mergeAndWrite(*writer, faces); } diff --git a/applications/utilities/mesh/manipulation/checkMesh/checkTopology.C b/applications/utilities/mesh/manipulation/checkMesh/checkTopology.C index ebb2a62255eff01b3c4bb5ccc5d7c534487254e1..cfd0a579fa0c8c81ac442357f42ca365c81b939f 100644 --- a/applications/utilities/mesh/manipulation/checkMesh/checkTopology.C +++ b/applications/utilities/mesh/manipulation/checkMesh/checkTopology.C @@ -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); } diff --git a/applications/utilities/mesh/manipulation/polyDualMesh/meshDualiser.C b/applications/utilities/mesh/manipulation/polyDualMesh/meshDualiser.C index 18d47f32ffd8e1428c56064661347e5e4eb57775..0abc91fb2842e2795c35cd730592d8f981e81f93 100644 --- a/applications/utilities/mesh/manipulation/polyDualMesh/meshDualiser.C +++ b/applications/utilities/mesh/manipulation/polyDualMesh/meshDualiser.C @@ -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]); } } } diff --git a/applications/utilities/mesh/manipulation/setSet/setSet.C b/applications/utilities/mesh/manipulation/setSet/setSet.C index e0e60be11c3c445f7639cdcd4ff656098f08bd8b..1473bf293fa84e1f855f24b6d8adcbbb31b3fffd 100644 --- a/applications/utilities/mesh/manipulation/setSet/setSet.C +++ b/applications/utilities/mesh/manipulation/setSet/setSet.C @@ -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