Commit ffc9d0d9 authored by Mark Olesen's avatar Mark Olesen
Browse files

find/replace pi/180.0 -> degToRad() and 180.0/pi -> radToDeg()

- note left utilities/mesh/advanced/collapseEdges/collapseEdges.C as-is.
  It looks suspicious, but the change was recent, so maybe it means something
parent 61a577c8
......@@ -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");
......
......@@ -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");
......
......@@ -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<face>::iterator iterf = pFaces[WEDGE][0].begin();
SLList<face>::iterator iterb = pFaces[WEDGE][1].begin();
......
......@@ -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
......
......@@ -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()]
......
......@@ -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")))
)
{}
......
......@@ -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
......
......@@ -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)
{
......
......@@ -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++;
......
......@@ -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 * * * * * * * * * * * //
......
......@@ -192,7 +192,7 @@ Foam::undoableMeshCutter::undoableMeshCutter
faceRemover_
(
mesh,
Foam::cos(30.0/180.0*constant::mathematical::pi)
Foam::cos(degToRad(30.0))
)
{}
......
......@@ -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"
......
......@@ -345,7 +345,8 @@ void surfaceInterpolation::makeCorrectionVectors() const
// Calculate the non-orthogonality for meshes with 1 face or more
if (returnReduce(magSf.size(), sumOp<label>()) > 0)
{
NonOrthogCoeff =
NonOrthogCoeff = radToDeg
(
asin
(
min
......@@ -353,7 +354,8 @@ void surfaceInterpolation::makeCorrectionVectors() const
(sum(magSf*mag(corrVecs))/sum(magSf)).value(),
1.0
)
)*180.0/constant::mathematical::pi;
)
);
}
if (debug)
......
......@@ -165,9 +165,8 @@ Foam::multiHoleInjector::~multiHoleInjector()
void Foam::multiHoleInjector::setTangentialVectors()
{
scalar pi180 = constant::mathematical::pi/180.0;
scalar alpha = xyAngle_*pi180;
scalar phi = zAngle_*pi180;
scalar alpha = degToRad(xyAngle_);
scalar phi = degToRad(zAngle_);
vector xp(cos(alpha), sin(alpha), 0.0);
vector zp(cos(alpha)*sin(phi), sin(alpha)*sin(phi), cos(phi));
......@@ -184,11 +183,11 @@ void Foam::multiHoleInjector::setTangentialVectors()
// Info << "zp = " << zp << endl;
scalar angle = 0.0;
scalar u = umbrellaAngle_*pi180/2.0;
scalar u = degToRad(umbrellaAngle_/2.0);
for (label i=0; i<nHoles_; i++)
{
angle += angleSpacing_[i];
scalar v = angle*pi180;
scalar v = degToRad(angle);
direction_[i] = cos(v)*sin(u)*xp + sin(v)*sin(u)*yp + cos(u)*zp;
vector dp = direction_[i] - (direction_[i] & zp)*direction_[i];
if (mag(dp) > SMALL)
......
......@@ -293,7 +293,7 @@ Foam::spray::spray
angleOfWedge_ = constant::mathematical::pi - acos(arcCos);
Info<< "Calculated angle of wedge is "
<< angleOfWedge_*180/constant::mathematical::pi << " deg."
<< radToDeg(angleOfWedge_) << " deg."
<< endl;
}
else
......
......@@ -110,9 +110,7 @@ scalar blobsSwirlInjector::d0
scalar c = rndGen_.scalar01();
angle_ = coneAngle_[n]/2.0 + c*coneInterval_[n];
angle_ *= constant::mathematical::pi/180.0;
angle_ = degToRad(coneAngle_[n]/2.0 + c*coneInterval_[n]);
scalar injectedMassFlow = it.massFlowRate(t);
......
......@@ -2480,10 +2480,10 @@ void Foam::autoLayerDriver::mergePatchFacesUndo
)
{
scalar minCos =
Foam::cos(layerParams.featureAngle()*constant::mathematical::pi/180.0);
Foam::cos(degToRad(layerParams.featureAngle()));
scalar concaveCos =
Foam::cos(layerParams.concaveAngle()*constant::mathematical::pi/180.0);
Foam::cos(degToRad(layerParams.concaveAngle()));
Info<< nl
<< "Merging all faces of a cell" << nl
......@@ -2602,7 +2602,7 @@ void Foam::autoLayerDriver::addLayers
(
pp,
meshEdges,
layerParams.featureAngle()*constant::mathematical::pi/180.0,
degToRad(layerParams.featureAngle()),
patchDisp,
patchNLayers,
......@@ -2688,7 +2688,7 @@ void Foam::autoLayerDriver::addLayers
maxPatchNameLen = max(maxPatchNameLen, label(patchName.size()));
}
Info<< nl
Info<< nl
<< setf(ios_base::left) << setw(maxPatchNameLen) << "patch"
<< setw(0) << " faces layers avg thickness[m]" << nl
<< setf(ios_base::left) << setw(maxPatchNameLen) << " "
......@@ -3289,7 +3289,7 @@ void Foam::autoLayerDriver::doLayers
<< "Doing initial balancing" << nl
<< "-----------------------" << nl
<< endl;
scalarField cellWeights(mesh.nCells(), 1);
forAll(numLayers, patchI)
{
......@@ -3302,7 +3302,7 @@ void Foam::autoLayerDriver::doLayers
}
}
}
// Balance mesh (and meshRefinement). No restriction on face zones
// and baffles.
autoPtr<mapDistributePolyMesh> map = meshRefiner_.balance
......@@ -3313,7 +3313,7 @@ void Foam::autoLayerDriver::doLayers
decomposer,
distributor
);
//{
// globalIndex globalCells(mesh.nCells());
//
......
......@@ -681,8 +681,8 @@ void Foam::autoRefineDriver::mergePatchFaces
meshRefiner_.mergePatchFaces
(
Foam::cos(45*constant::mathematical::pi/180.0),
Foam::cos(45*constant::mathematical::pi/180.0),
Foam::cos(degToRad(45.0)),
Foam::cos(degToRad(45.0)),
meshRefiner_.meshedPatches()
);
......@@ -691,7 +691,7 @@ void Foam::autoRefineDriver::mergePatchFaces
meshRefiner_.checkData();
}
meshRefiner_.mergeEdges(Foam::cos(45*constant::mathematical::pi/180.0));
meshRefiner_.mergeEdges(Foam::cos(degToRad(45.0)));
if (debug)
{
......
......@@ -192,7 +192,7 @@ Foam::layerParameters::layerParameters
),
layerTerminationCos_
(
Foam::cos(0.5*featureAngle_*constant::mathematical::pi/180.0)
Foam::cos(degToRad(0.5*featureAngle_))
),
maxThicknessToMedialRatio_
(
......@@ -200,8 +200,7 @@ Foam::layerParameters::layerParameters
),
minMedianAxisAngleCos_
(
Foam::cos(readScalar(dict.lookup("minMedianAxisAngle")))
*constant::mathematical::pi/180.0
Foam::cos(degToRad(readScalar(dict.lookup("minMedianAxisAngle"))))
),
nBufferCellsNoExtrude_
(
......@@ -269,7 +268,7 @@ Foam::layerParameters::layerParameters
),
layerTerminationCos_
(
Foam::cos(0.5*featureAngle_*constant::mathematical::pi/180.0)
Foam::cos(degToRad(0.5*featureAngle_))
),
maxThicknessToMedialRatio_
(
......@@ -277,8 +276,7 @@ Foam::layerParameters::layerParameters
),
minMedianAxisAngleCos_
(
Foam::cos(readScalar(dict.lookup("minMedianAxisAngle")))
*constant::mathematical::pi/180.0
Foam::cos(degToRad(readScalar(dict.lookup("minMedianAxisAngle"))))
),
nBufferCellsNoExtrude_
(
......
......@@ -65,7 +65,7 @@ Foam::refinementParameters::refinementParameters(const dictionary& dict)
}
else
{
curvature_ = Foam::cos(featAngle*constant::mathematical::pi/180.0);
curvature_ = Foam::cos(degToRad(featAngle));
}
}
......
Supports Markdown
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