diff --git a/applications/utilities/mesh/advanced/combinePatchFaces/combinePatchFaces.C b/applications/utilities/mesh/advanced/combinePatchFaces/combinePatchFaces.C index 54fd1bdf4f..d16f4f23cc 100644 --- a/applications/utilities/mesh/advanced/combinePatchFaces/combinePatchFaces.C +++ b/applications/utilities/mesh/advanced/combinePatchFaces/combinePatchFaces.C @@ -445,12 +445,12 @@ int main(int argc, char *argv[]) scalar featureAngle(readScalar(IStringStream(args.additionalArgs()[0])())); - scalar minCos = Foam::cos(featureAngle*constant::mathematical::pi/180.0); + scalar minCos = Foam::cos(degToRad(featureAngle)); scalar concaveAngle = defaultConcaveAngle; args.optionReadIfPresent("concaveAngle", concaveAngle); - scalar concaveSin = Foam::sin(concaveAngle*constant::mathematical::pi/180.0); + scalar concaveSin = Foam::sin(degToRad(concaveAngle)); bool snapMeshDict = args.optionFound("snapMesh"); bool overwrite = args.optionFound("overwrite"); diff --git a/applications/utilities/mesh/advanced/splitCells/splitCells.C b/applications/utilities/mesh/advanced/splitCells/splitCells.C index c83ab27583..f9f47c815a 100644 --- a/applications/utilities/mesh/advanced/splitCells/splitCells.C +++ b/applications/utilities/mesh/advanced/splitCells/splitCells.C @@ -539,9 +539,8 @@ int main(int argc, char *argv[]) scalar featureAngle(readScalar(IStringStream(args.additionalArgs()[0])())); - scalar radAngle = featureAngle*constant::mathematical::pi/180.0; - scalar minCos = Foam::cos(radAngle); - scalar minSin = Foam::sin(radAngle); + scalar minCos = Foam::cos(degToRad(featureAngle)); + scalar minSin = Foam::sin(degToRad(featureAngle)); bool readSet = args.optionFound("set"); bool geometry = args.optionFound("geometry"); diff --git a/applications/utilities/mesh/conversion/kivaToFoam/readKivaGrid.H b/applications/utilities/mesh/conversion/kivaToFoam/readKivaGrid.H index 9ed5e27004..ba2b615df1 100644 --- a/applications/utilities/mesh/conversion/kivaToFoam/readKivaGrid.H +++ b/applications/utilities/mesh/conversion/kivaToFoam/readKivaGrid.H @@ -434,7 +434,7 @@ if (pFaces[WEDGE].size() && pFaces[WEDGE][0].size()) { // Distribute the points to be +/- 2.5deg from the x-z plane - scalar tanTheta = Foam::tan(2.5*constant::mathematical::pi/180.0); + scalar tanTheta = Foam::tan(degToRad(2.5)); SLList::iterator iterf = pFaces[WEDGE][0].begin(); SLList::iterator iterb = pFaces[WEDGE][1].begin(); diff --git a/applications/utilities/mesh/conversion/polyDualMesh/polyDualMeshApp.C b/applications/utilities/mesh/conversion/polyDualMesh/polyDualMeshApp.C index 740b87a391..af2c429bdc 100644 --- a/applications/utilities/mesh/conversion/polyDualMesh/polyDualMeshApp.C +++ b/applications/utilities/mesh/conversion/polyDualMesh/polyDualMeshApp.C @@ -91,7 +91,7 @@ void simpleMarkFeatures labelList& multiCellFeaturePoints ) { - scalar minCos = Foam::cos(featureAngle*constant::mathematical::pi/180.0); + scalar minCos = Foam::cos(degToRad(featureAngle)); const polyBoundaryMesh& patches = mesh.boundaryMesh(); @@ -387,7 +387,7 @@ int main(int argc, char *argv[]) scalar featureAngle(readScalar(IStringStream(args.additionalArgs()[0])())); - scalar minCos = Foam::cos(featureAngle*constant::mathematical::pi/180.0); + scalar minCos = Foam::cos(degToRad(featureAngle)); Info<< "Feature:" << featureAngle << endl << "minCos :" << minCos << endl diff --git a/applications/utilities/mesh/conversion/starToFoam/createCoupleMatches.C b/applications/utilities/mesh/conversion/starToFoam/createCoupleMatches.C index bfd1dae882..da0f868388 100644 --- a/applications/utilities/mesh/conversion/starToFoam/createCoupleMatches.C +++ b/applications/utilities/mesh/conversion/starToFoam/createCoupleMatches.C @@ -99,7 +99,7 @@ void starMesh::createCoupleMatches() << coupleI << ". STAR couple ID: " << couples_[coupleI].coupleID() << endl << "The angle between face normals is " - << Foam::acos(faceAreaAngle)/constant::mathematical::pi*180 + << radToDeg(Foam::acos(faceAreaAngle)) << " deg." << endl << "master cell: " << fp.masterCell() << " STAR number: " << starCellID_[fp.masterCell()] diff --git a/applications/utilities/mesh/generation/extrudeMesh/extrudeModel/wedge/wedge.C b/applications/utilities/mesh/generation/extrudeMesh/extrudeModel/wedge/wedge.C index eac10738cf..67abf36564 100644 --- a/applications/utilities/mesh/generation/extrudeMesh/extrudeModel/wedge/wedge.C +++ b/applications/utilities/mesh/generation/extrudeMesh/extrudeModel/wedge/wedge.C @@ -51,8 +51,7 @@ wedge::wedge(const dictionary& dict) axis_(coeffDict_.lookup("axis")), angle_ ( - readScalar(coeffDict_.lookup("angle")) - *constant::mathematical::pi/180.0 + degToRad(readScalar(coeffDict_.lookup("angle"))) ) {} diff --git a/applications/utilities/mesh/manipulation/autoPatch/autoPatch.C b/applications/utilities/mesh/manipulation/autoPatch/autoPatch.C index 7161e6bb70..15affd66e0 100644 --- a/applications/utilities/mesh/manipulation/autoPatch/autoPatch.C +++ b/applications/utilities/mesh/manipulation/autoPatch/autoPatch.C @@ -93,7 +93,7 @@ int main(int argc, char *argv[]) scalar featureAngle(readScalar(IStringStream(args.additionalArgs()[0])())); bool overwrite = args.optionFound("overwrite"); - scalar minCos = Foam::cos(featureAngle*constant::mathematical::pi/180.0); + scalar minCos = Foam::cos(degToRad(featureAngle)); Info<< "Feature:" << featureAngle << endl << "minCos :" << minCos << endl diff --git a/src/OpenFOAM/meshes/primitiveMesh/primitiveMeshCheck/primitiveMeshCheck.C b/src/OpenFOAM/meshes/primitiveMesh/primitiveMeshCheck/primitiveMeshCheck.C index 258cb163a1..6350c93446 100644 --- a/src/OpenFOAM/meshes/primitiveMesh/primitiveMeshCheck/primitiveMeshCheck.C +++ b/src/OpenFOAM/meshes/primitiveMesh/primitiveMeshCheck/primitiveMeshCheck.C @@ -410,7 +410,7 @@ bool Foam::primitiveMesh::checkFaceOrthogonality // Severe nonorthogonality threshold const scalar severeNonorthogonalityThreshold = - ::cos(nonOrthThreshold_/180.0*constant::mathematical::pi); + ::cos(degToRad(nonOrthThreshold_)); scalar minDDotS = GREAT; @@ -472,9 +472,8 @@ bool Foam::primitiveMesh::checkFaceOrthogonality if (debug || report) { Info<< " Mesh non-orthogonality Max: " - << ::acos(minDDotS)/constant::mathematical::pi*180.0 - << " average: " << - ::acos(sumDDotS/neiSize)/constant::mathematical::pi*180.0 + << radToDeg(::acos(minDDotS)) + << " average: " << radToDeg(::acos(sumDDotS/neiSize)) << endl; } } @@ -839,7 +838,7 @@ bool Foam::primitiveMesh::checkFaceAngles << exit(FatalError); } - const scalar maxSin = Foam::sin(maxDeg/180.0*constant::mathematical::pi); + const scalar maxSin = Foam::sin(degToRad(maxDeg)); const pointField& p = points(); const faceList& fcs = faces(); @@ -915,8 +914,7 @@ bool Foam::primitiveMesh::checkFaceAngles if (nConcave > 0) { scalar maxConcaveDegr = - Foam::asin(Foam::min(1.0, maxEdgeSin)) - *180.0/constant::mathematical::pi; + radToDeg(Foam::asin(Foam::min(1.0, maxEdgeSin))); if (debug || report) { diff --git a/src/OpenFOAM/meshes/primitiveMesh/primitiveMeshCheck/primitiveMeshCheckMotion.C b/src/OpenFOAM/meshes/primitiveMesh/primitiveMeshCheck/primitiveMeshCheckMotion.C index 688bdd81a2..8fce92f3c8 100644 --- a/src/OpenFOAM/meshes/primitiveMesh/primitiveMeshCheck/primitiveMeshCheckMotion.C +++ b/src/OpenFOAM/meshes/primitiveMesh/primitiveMeshCheck/primitiveMeshCheckMotion.C @@ -200,7 +200,7 @@ bool Foam::primitiveMesh::checkMeshMotion ) << "Severe non-orthogonality in mesh motion for face " << faceI << " between cells " << own[faceI] << " and " << nei[faceI] - << ": Angle = " << ::acos(dDotS)/constant::mathematical::pi*180.0 + << ": Angle = " << radToDeg(::acos(dDotS)) << " deg." << endl; nDotProductErrors++; diff --git a/src/dynamicMesh/meshCut/cellLooper/topoCellLooper.C b/src/dynamicMesh/meshCut/cellLooper/topoCellLooper.C index 5e83fd9e78..f17e07c323 100644 --- a/src/dynamicMesh/meshCut/cellLooper/topoCellLooper.C +++ b/src/dynamicMesh/meshCut/cellLooper/topoCellLooper.C @@ -44,8 +44,7 @@ namespace Foam } // Angle for polys to be considered splitHexes. -const Foam::scalar Foam::topoCellLooper::featureCos = - Foam::cos(10.0*constant::mathematical::pi/180.0); +const Foam::scalar Foam::topoCellLooper::featureCos = Foam::cos(degToRad(10.0)); // * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * // diff --git a/src/dynamicMesh/meshCut/meshModifiers/undoableMeshCutter/undoableMeshCutter.C b/src/dynamicMesh/meshCut/meshModifiers/undoableMeshCutter/undoableMeshCutter.C index ea8ab52a7f..16606233d0 100644 --- a/src/dynamicMesh/meshCut/meshModifiers/undoableMeshCutter/undoableMeshCutter.C +++ b/src/dynamicMesh/meshCut/meshModifiers/undoableMeshCutter/undoableMeshCutter.C @@ -192,7 +192,7 @@ Foam::undoableMeshCutter::undoableMeshCutter faceRemover_ ( mesh, - Foam::cos(30.0/180.0*constant::mathematical::pi) + Foam::cos(degToRad(30.0)) ) {} diff --git a/src/dynamicMesh/motionSmoother/polyMeshGeometry/polyMeshGeometry.C b/src/dynamicMesh/motionSmoother/polyMeshGeometry/polyMeshGeometry.C index d95e1f34e9..83d0000ea3 100644 --- a/src/dynamicMesh/motionSmoother/polyMeshGeometry/polyMeshGeometry.C +++ b/src/dynamicMesh/motionSmoother/polyMeshGeometry/polyMeshGeometry.C @@ -248,7 +248,7 @@ Foam::scalar Foam::polyMeshGeometry::checkNonOrtho << " between cells " << mesh.faceOwner()[faceI] << " and " << nei << ": Angle = " - << ::acos(dDotS)/constant::mathematical::pi*180.0 + << radToDeg(::acos(dDotS)) << " deg." << endl; } @@ -269,7 +269,7 @@ Foam::scalar Foam::polyMeshGeometry::checkNonOrtho << " between cells " << mesh.faceOwner()[faceI] << " and " << nei << ": Angle = " - << ::acos(dDotS)/constant::mathematical::pi*180.0 + << radToDeg(::acos(dDotS)) << " deg." << endl; } @@ -368,8 +368,7 @@ bool Foam::polyMeshGeometry::checkFaceDotProduct const polyBoundaryMesh& patches = mesh.boundaryMesh(); // Severe nonorthogonality threshold - const scalar severeNonorthogonalityThreshold = - ::cos(orthWarn/180.0*constant::mathematical::pi); + const scalar severeNonorthogonalityThreshold = ::cos(degToRad(orthWarn)); // Calculate coupled cell centre @@ -504,9 +503,8 @@ bool Foam::polyMeshGeometry::checkFaceDotProduct if (nDDotS > 0) { Info<< "Mesh non-orthogonality Max: " - << ::acos(minDDotS)/constant::mathematical::pi*180.0 - << " average: " << - ::acos(sumDDotS/nDDotS)/constant::mathematical::pi*180.0 + << radToDeg(::acos(minDDotS)) + << " average: " << radToDeg(::acos(sumDDotS/nDDotS)) << endl; } } @@ -1258,7 +1256,7 @@ bool Foam::polyMeshGeometry::checkFaceAngles << abort(FatalError); } - const scalar maxSin = Foam::sin(maxDeg/180.0*constant::mathematical::pi); + const scalar maxSin = Foam::sin(degToRad(maxDeg)); const faceList& fcs = mesh.faces(); @@ -1338,8 +1336,7 @@ bool Foam::polyMeshGeometry::checkFaceAngles if (maxEdgeSin > SMALL) { scalar maxConcaveDegr = - Foam::asin(Foam::min(1.0, maxEdgeSin)) - *180.0/constant::mathematical::pi; + radToDeg(Foam::asin(Foam::min(1.0, maxEdgeSin))); Info<< "There are " << nConcave << " faces with concave angles between consecutive" diff --git a/src/finiteVolume/interpolation/surfaceInterpolation/surfaceInterpolation/surfaceInterpolation.C b/src/finiteVolume/interpolation/surfaceInterpolation/surfaceInterpolation/surfaceInterpolation.C index 87cc39bfdc..5bcb692065 100644 --- a/src/finiteVolume/interpolation/surfaceInterpolation/surfaceInterpolation/surfaceInterpolation.C +++ b/src/finiteVolume/interpolation/surfaceInterpolation/surfaceInterpolation/surfaceInterpolation.C @@ -345,7 +345,8 @@ void surfaceInterpolation::makeCorrectionVectors() const // Calculate the non-orthogonality for meshes with 1 face or more if (returnReduce(magSf.size(), sumOp