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
This commit is contained in:
Mark Olesen
2009-10-19 13:53:25 +02:00
parent 61a577c860
commit ffc9d0d97b
29 changed files with 71 additions and 94 deletions

View File

@ -445,12 +445,12 @@ int main(int argc, char *argv[])
scalar featureAngle(readScalar(IStringStream(args.additionalArgs()[0])())); 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; scalar concaveAngle = defaultConcaveAngle;
args.optionReadIfPresent("concaveAngle", concaveAngle); 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 snapMeshDict = args.optionFound("snapMesh");
bool overwrite = args.optionFound("overwrite"); bool overwrite = args.optionFound("overwrite");

View File

@ -539,9 +539,8 @@ int main(int argc, char *argv[])
scalar featureAngle(readScalar(IStringStream(args.additionalArgs()[0])())); scalar featureAngle(readScalar(IStringStream(args.additionalArgs()[0])()));
scalar radAngle = featureAngle*constant::mathematical::pi/180.0; scalar minCos = Foam::cos(degToRad(featureAngle));
scalar minCos = Foam::cos(radAngle); scalar minSin = Foam::sin(degToRad(featureAngle));
scalar minSin = Foam::sin(radAngle);
bool readSet = args.optionFound("set"); bool readSet = args.optionFound("set");
bool geometry = args.optionFound("geometry"); bool geometry = args.optionFound("geometry");

View File

@ -434,7 +434,7 @@ if (pFaces[WEDGE].size() && pFaces[WEDGE][0].size())
{ {
// Distribute the points to be +/- 2.5deg from the x-z plane // 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 iterf = pFaces[WEDGE][0].begin();
SLList<face>::iterator iterb = pFaces[WEDGE][1].begin(); SLList<face>::iterator iterb = pFaces[WEDGE][1].begin();

View File

@ -91,7 +91,7 @@ void simpleMarkFeatures
labelList& multiCellFeaturePoints labelList& multiCellFeaturePoints
) )
{ {
scalar minCos = Foam::cos(featureAngle*constant::mathematical::pi/180.0); scalar minCos = Foam::cos(degToRad(featureAngle));
const polyBoundaryMesh& patches = mesh.boundaryMesh(); const polyBoundaryMesh& patches = mesh.boundaryMesh();
@ -387,7 +387,7 @@ int main(int argc, char *argv[])
scalar featureAngle(readScalar(IStringStream(args.additionalArgs()[0])())); 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 Info<< "Feature:" << featureAngle << endl
<< "minCos :" << minCos << endl << "minCos :" << minCos << endl

View File

@ -99,7 +99,7 @@ void starMesh::createCoupleMatches()
<< coupleI << ". STAR couple ID: " << coupleI << ". STAR couple ID: "
<< couples_[coupleI].coupleID() << endl << couples_[coupleI].coupleID() << endl
<< "The angle between face normals is " << "The angle between face normals is "
<< Foam::acos(faceAreaAngle)/constant::mathematical::pi*180 << radToDeg(Foam::acos(faceAreaAngle))
<< " deg." << endl << " deg." << endl
<< "master cell: " << fp.masterCell() << "master cell: " << fp.masterCell()
<< " STAR number: " << starCellID_[fp.masterCell()] << " STAR number: " << starCellID_[fp.masterCell()]

View File

@ -51,8 +51,7 @@ wedge::wedge(const dictionary& dict)
axis_(coeffDict_.lookup("axis")), axis_(coeffDict_.lookup("axis")),
angle_ angle_
( (
readScalar(coeffDict_.lookup("angle")) degToRad(readScalar(coeffDict_.lookup("angle")))
*constant::mathematical::pi/180.0
) )
{} {}

View File

@ -93,7 +93,7 @@ int main(int argc, char *argv[])
scalar featureAngle(readScalar(IStringStream(args.additionalArgs()[0])())); scalar featureAngle(readScalar(IStringStream(args.additionalArgs()[0])()));
bool overwrite = args.optionFound("overwrite"); 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 Info<< "Feature:" << featureAngle << endl
<< "minCos :" << minCos << endl << "minCos :" << minCos << endl

View File

@ -410,7 +410,7 @@ bool Foam::primitiveMesh::checkFaceOrthogonality
// Severe nonorthogonality threshold // Severe nonorthogonality threshold
const scalar severeNonorthogonalityThreshold = const scalar severeNonorthogonalityThreshold =
::cos(nonOrthThreshold_/180.0*constant::mathematical::pi); ::cos(degToRad(nonOrthThreshold_));
scalar minDDotS = GREAT; scalar minDDotS = GREAT;
@ -472,9 +472,8 @@ bool Foam::primitiveMesh::checkFaceOrthogonality
if (debug || report) if (debug || report)
{ {
Info<< " Mesh non-orthogonality Max: " Info<< " Mesh non-orthogonality Max: "
<< ::acos(minDDotS)/constant::mathematical::pi*180.0 << radToDeg(::acos(minDDotS))
<< " average: " << << " average: " << radToDeg(::acos(sumDDotS/neiSize))
::acos(sumDDotS/neiSize)/constant::mathematical::pi*180.0
<< endl; << endl;
} }
} }
@ -839,7 +838,7 @@ bool Foam::primitiveMesh::checkFaceAngles
<< exit(FatalError); << 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 pointField& p = points();
const faceList& fcs = faces(); const faceList& fcs = faces();
@ -915,8 +914,7 @@ bool Foam::primitiveMesh::checkFaceAngles
if (nConcave > 0) if (nConcave > 0)
{ {
scalar maxConcaveDegr = scalar maxConcaveDegr =
Foam::asin(Foam::min(1.0, maxEdgeSin)) radToDeg(Foam::asin(Foam::min(1.0, maxEdgeSin)));
*180.0/constant::mathematical::pi;
if (debug || report) if (debug || report)
{ {

View File

@ -200,7 +200,7 @@ bool Foam::primitiveMesh::checkMeshMotion
) << "Severe non-orthogonality in mesh motion for face " ) << "Severe non-orthogonality in mesh motion for face "
<< faceI << faceI
<< " between cells " << own[faceI] << " and " << nei[faceI] << " between cells " << own[faceI] << " and " << nei[faceI]
<< ": Angle = " << ::acos(dDotS)/constant::mathematical::pi*180.0 << ": Angle = " << radToDeg(::acos(dDotS))
<< " deg." << endl; << " deg." << endl;
nDotProductErrors++; nDotProductErrors++;

View File

@ -44,8 +44,7 @@ namespace Foam
} }
// Angle for polys to be considered splitHexes. // Angle for polys to be considered splitHexes.
const Foam::scalar Foam::topoCellLooper::featureCos = const Foam::scalar Foam::topoCellLooper::featureCos = Foam::cos(degToRad(10.0));
Foam::cos(10.0*constant::mathematical::pi/180.0);
// * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * // // * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * //

View File

@ -192,7 +192,7 @@ Foam::undoableMeshCutter::undoableMeshCutter
faceRemover_ faceRemover_
( (
mesh, mesh,
Foam::cos(30.0/180.0*constant::mathematical::pi) Foam::cos(degToRad(30.0))
) )
{} {}

View File

@ -248,7 +248,7 @@ Foam::scalar Foam::polyMeshGeometry::checkNonOrtho
<< " between cells " << mesh.faceOwner()[faceI] << " between cells " << mesh.faceOwner()[faceI]
<< " and " << nei << " and " << nei
<< ": Angle = " << ": Angle = "
<< ::acos(dDotS)/constant::mathematical::pi*180.0 << radToDeg(::acos(dDotS))
<< " deg." << endl; << " deg." << endl;
} }
@ -269,7 +269,7 @@ Foam::scalar Foam::polyMeshGeometry::checkNonOrtho
<< " between cells " << mesh.faceOwner()[faceI] << " between cells " << mesh.faceOwner()[faceI]
<< " and " << nei << " and " << nei
<< ": Angle = " << ": Angle = "
<< ::acos(dDotS)/constant::mathematical::pi*180.0 << radToDeg(::acos(dDotS))
<< " deg." << endl; << " deg." << endl;
} }
@ -368,8 +368,7 @@ bool Foam::polyMeshGeometry::checkFaceDotProduct
const polyBoundaryMesh& patches = mesh.boundaryMesh(); const polyBoundaryMesh& patches = mesh.boundaryMesh();
// Severe nonorthogonality threshold // Severe nonorthogonality threshold
const scalar severeNonorthogonalityThreshold = const scalar severeNonorthogonalityThreshold = ::cos(degToRad(orthWarn));
::cos(orthWarn/180.0*constant::mathematical::pi);
// Calculate coupled cell centre // Calculate coupled cell centre
@ -504,9 +503,8 @@ bool Foam::polyMeshGeometry::checkFaceDotProduct
if (nDDotS > 0) if (nDDotS > 0)
{ {
Info<< "Mesh non-orthogonality Max: " Info<< "Mesh non-orthogonality Max: "
<< ::acos(minDDotS)/constant::mathematical::pi*180.0 << radToDeg(::acos(minDDotS))
<< " average: " << << " average: " << radToDeg(::acos(sumDDotS/nDDotS))
::acos(sumDDotS/nDDotS)/constant::mathematical::pi*180.0
<< endl; << endl;
} }
} }
@ -1258,7 +1256,7 @@ bool Foam::polyMeshGeometry::checkFaceAngles
<< abort(FatalError); << 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(); const faceList& fcs = mesh.faces();
@ -1338,8 +1336,7 @@ bool Foam::polyMeshGeometry::checkFaceAngles
if (maxEdgeSin > SMALL) if (maxEdgeSin > SMALL)
{ {
scalar maxConcaveDegr = scalar maxConcaveDegr =
Foam::asin(Foam::min(1.0, maxEdgeSin)) radToDeg(Foam::asin(Foam::min(1.0, maxEdgeSin)));
*180.0/constant::mathematical::pi;
Info<< "There are " << nConcave Info<< "There are " << nConcave
<< " faces with concave angles between consecutive" << " faces with concave angles between consecutive"

View File

@ -345,7 +345,8 @@ void surfaceInterpolation::makeCorrectionVectors() const
// Calculate the non-orthogonality for meshes with 1 face or more // Calculate the non-orthogonality for meshes with 1 face or more
if (returnReduce(magSf.size(), sumOp<label>()) > 0) if (returnReduce(magSf.size(), sumOp<label>()) > 0)
{ {
NonOrthogCoeff = NonOrthogCoeff = radToDeg
(
asin asin
( (
min min
@ -353,7 +354,8 @@ void surfaceInterpolation::makeCorrectionVectors() const
(sum(magSf*mag(corrVecs))/sum(magSf)).value(), (sum(magSf*mag(corrVecs))/sum(magSf)).value(),
1.0 1.0
) )
)*180.0/constant::mathematical::pi; )
);
} }
if (debug) if (debug)

View File

@ -165,9 +165,8 @@ Foam::multiHoleInjector::~multiHoleInjector()
void Foam::multiHoleInjector::setTangentialVectors() void Foam::multiHoleInjector::setTangentialVectors()
{ {
scalar pi180 = constant::mathematical::pi/180.0; scalar alpha = degToRad(xyAngle_);
scalar alpha = xyAngle_*pi180; scalar phi = degToRad(zAngle_);
scalar phi = zAngle_*pi180;
vector xp(cos(alpha), sin(alpha), 0.0); vector xp(cos(alpha), sin(alpha), 0.0);
vector zp(cos(alpha)*sin(phi), sin(alpha)*sin(phi), cos(phi)); vector zp(cos(alpha)*sin(phi), sin(alpha)*sin(phi), cos(phi));
@ -184,11 +183,11 @@ void Foam::multiHoleInjector::setTangentialVectors()
// Info << "zp = " << zp << endl; // Info << "zp = " << zp << endl;
scalar angle = 0.0; scalar angle = 0.0;
scalar u = umbrellaAngle_*pi180/2.0; scalar u = degToRad(umbrellaAngle_/2.0);
for (label i=0; i<nHoles_; i++) for (label i=0; i<nHoles_; i++)
{ {
angle += angleSpacing_[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; direction_[i] = cos(v)*sin(u)*xp + sin(v)*sin(u)*yp + cos(u)*zp;
vector dp = direction_[i] - (direction_[i] & zp)*direction_[i]; vector dp = direction_[i] - (direction_[i] & zp)*direction_[i];
if (mag(dp) > SMALL) if (mag(dp) > SMALL)

View File

@ -293,7 +293,7 @@ Foam::spray::spray
angleOfWedge_ = constant::mathematical::pi - acos(arcCos); angleOfWedge_ = constant::mathematical::pi - acos(arcCos);
Info<< "Calculated angle of wedge is " Info<< "Calculated angle of wedge is "
<< angleOfWedge_*180/constant::mathematical::pi << " deg." << radToDeg(angleOfWedge_) << " deg."
<< endl; << endl;
} }
else else

View File

@ -110,9 +110,7 @@ scalar blobsSwirlInjector::d0
scalar c = rndGen_.scalar01(); scalar c = rndGen_.scalar01();
angle_ = coneAngle_[n]/2.0 + c*coneInterval_[n]; angle_ = degToRad(coneAngle_[n]/2.0 + c*coneInterval_[n]);
angle_ *= constant::mathematical::pi/180.0;
scalar injectedMassFlow = it.massFlowRate(t); scalar injectedMassFlow = it.massFlowRate(t);

View File

@ -2480,10 +2480,10 @@ void Foam::autoLayerDriver::mergePatchFacesUndo
) )
{ {
scalar minCos = scalar minCos =
Foam::cos(layerParams.featureAngle()*constant::mathematical::pi/180.0); Foam::cos(degToRad(layerParams.featureAngle()));
scalar concaveCos = scalar concaveCos =
Foam::cos(layerParams.concaveAngle()*constant::mathematical::pi/180.0); Foam::cos(degToRad(layerParams.concaveAngle()));
Info<< nl Info<< nl
<< "Merging all faces of a cell" << nl << "Merging all faces of a cell" << nl
@ -2602,7 +2602,7 @@ void Foam::autoLayerDriver::addLayers
( (
pp, pp,
meshEdges, meshEdges,
layerParams.featureAngle()*constant::mathematical::pi/180.0, degToRad(layerParams.featureAngle()),
patchDisp, patchDisp,
patchNLayers, patchNLayers,

View File

@ -681,8 +681,8 @@ void Foam::autoRefineDriver::mergePatchFaces
meshRefiner_.mergePatchFaces meshRefiner_.mergePatchFaces
( (
Foam::cos(45*constant::mathematical::pi/180.0), Foam::cos(degToRad(45.0)),
Foam::cos(45*constant::mathematical::pi/180.0), Foam::cos(degToRad(45.0)),
meshRefiner_.meshedPatches() meshRefiner_.meshedPatches()
); );
@ -691,7 +691,7 @@ void Foam::autoRefineDriver::mergePatchFaces
meshRefiner_.checkData(); meshRefiner_.checkData();
} }
meshRefiner_.mergeEdges(Foam::cos(45*constant::mathematical::pi/180.0)); meshRefiner_.mergeEdges(Foam::cos(degToRad(45.0)));
if (debug) if (debug)
{ {

View File

@ -192,7 +192,7 @@ Foam::layerParameters::layerParameters
), ),
layerTerminationCos_ layerTerminationCos_
( (
Foam::cos(0.5*featureAngle_*constant::mathematical::pi/180.0) Foam::cos(degToRad(0.5*featureAngle_))
), ),
maxThicknessToMedialRatio_ maxThicknessToMedialRatio_
( (
@ -200,8 +200,7 @@ Foam::layerParameters::layerParameters
), ),
minMedianAxisAngleCos_ minMedianAxisAngleCos_
( (
Foam::cos(readScalar(dict.lookup("minMedianAxisAngle"))) Foam::cos(degToRad(readScalar(dict.lookup("minMedianAxisAngle"))))
*constant::mathematical::pi/180.0
), ),
nBufferCellsNoExtrude_ nBufferCellsNoExtrude_
( (
@ -269,7 +268,7 @@ Foam::layerParameters::layerParameters
), ),
layerTerminationCos_ layerTerminationCos_
( (
Foam::cos(0.5*featureAngle_*constant::mathematical::pi/180.0) Foam::cos(degToRad(0.5*featureAngle_))
), ),
maxThicknessToMedialRatio_ maxThicknessToMedialRatio_
( (
@ -277,8 +276,7 @@ Foam::layerParameters::layerParameters
), ),
minMedianAxisAngleCos_ minMedianAxisAngleCos_
( (
Foam::cos(readScalar(dict.lookup("minMedianAxisAngle"))) Foam::cos(degToRad(readScalar(dict.lookup("minMedianAxisAngle"))))
*constant::mathematical::pi/180.0
), ),
nBufferCellsNoExtrude_ nBufferCellsNoExtrude_
( (

View File

@ -65,7 +65,7 @@ Foam::refinementParameters::refinementParameters(const dictionary& dict)
} }
else else
{ {
curvature_ = Foam::cos(featAngle*constant::mathematical::pi/180.0); curvature_ = Foam::cos(degToRad(featAngle));
} }
} }

View File

@ -247,7 +247,7 @@ Foam::Map<Foam::label> Foam::meshRefinement::findEdgeConnectedProblemCells
nearestRegion[i] nearestRegion[i]
); );
scalar angle = perpendicularAngle[region]/180.0*constant::mathematical::pi; scalar angle = degToRad(perpendicularAngle[region]);
if (angle >= 0) if (angle >= 0)
{ {

View File

@ -72,12 +72,12 @@ Foam::cylindricalCS Foam::arcEdge::calcAngle()
// find angles // find angles
scalar tmp = (r3&r1)/(mag(r3)*mag(r1)); scalar tmp = (r3&r1)/(mag(r3)*mag(r1));
angle_ = acos(tmp)*180.0/constant::mathematical::pi; angle_ = radToDeg(acos(tmp));
// check if the vectors define an exterior or an interior arcEdge // check if the vectors define an exterior or an interior arcEdge
if (((r1 ^ r2)&(r1 ^ r3)) < 0.0) if (((r1 ^ r2)&(r1 ^ r3)) < 0.0)
{ {
angle_ = 360 - angle_; angle_ = 360.0 - angle_;
} }
vector tempAxis; vector tempAxis;
@ -159,7 +159,7 @@ Foam::vector Foam::arcEdge::position(const scalar lambda) const
Foam::scalar Foam::arcEdge::length() const Foam::scalar Foam::arcEdge::length() const
{ {
return angle_*radius_*constant::mathematical::pi/180.0; return degToRad(angle_*radius_);
} }

View File

@ -66,8 +66,7 @@ Foam::tmp<Foam::scalarField> Foam::cellQuality::nonOrthogonality() const
scalar magS = mag(s); scalar magS = mag(s);
scalar cosDDotS = scalar cosDDotS =
Foam::acos(min(1.0, (d & s)/(mag(d)*magS + VSMALL))) radToDeg(Foam::acos(min(1.0, (d & s)/(mag(d)*magS + VSMALL))));
*180.0/constant::mathematical::pi;
result[own[faceI]] = max(cosDDotS, result[own[faceI]]); result[own[faceI]] = max(cosDDotS, result[own[faceI]]);
@ -92,8 +91,7 @@ Foam::tmp<Foam::scalarField> Foam::cellQuality::nonOrthogonality() const
scalar magS = mag(s); scalar magS = mag(s);
scalar cosDDotS = scalar cosDDotS =
Foam::acos(min(1.0, (d & s)/(mag(d)*magS + VSMALL))) radToDeg(Foam::acos(min(1.0, (d & s)/(mag(d)*magS + VSMALL))));
*180.0/constant::mathematical::pi;
result[faceCells[faceI]] = max(cosDDotS, result[faceCells[faceI]]); result[faceCells[faceI]] = max(cosDDotS, result[faceCells[faceI]]);
} }
@ -207,8 +205,7 @@ Foam::tmp<Foam::scalarField> Foam::cellQuality::faceNonOrthogonality() const
scalar magS = mag(s); scalar magS = mag(s);
scalar cosDDotS = scalar cosDDotS =
Foam::acos(min(1.0, (d & s)/(mag(d)*magS + VSMALL))) radToDeg(Foam::acos(min(1.0, (d & s)/(mag(d)*magS + VSMALL))));
*180.0/constant::mathematical::pi;
result[faceI] = cosDDotS; result[faceI] = cosDDotS;
} }
@ -233,8 +230,7 @@ Foam::tmp<Foam::scalarField> Foam::cellQuality::faceNonOrthogonality() const
scalar magS = mag(s); scalar magS = mag(s);
scalar cosDDotS = scalar cosDDotS =
Foam::acos(min(1.0, (d & s)/(mag(d)*magS + VSMALL))) radToDeg(Foam::acos(min(1.0, (d & s)/(mag(d)*magS + VSMALL))));
*180.0/constant::mathematical::pi;
result[globalFaceI++] = cosDDotS; result[globalFaceI++] = cosDDotS;
} }

View File

@ -72,8 +72,8 @@ Foam::vector Foam::toroidalCS::localToGlobal
) const ) const
{ {
// Notation: r = local.x() // Notation: r = local.x()
scalar theta = local.y()*constant::mathematical::pi/180.0; scalar theta = degToRad(local.y());
scalar phi = local.z()*constant::mathematical::pi/180.0; scalar phi = degToRad(local.z());
scalar rprime = radius_ + local.x()*sin(phi); scalar rprime = radius_ + local.x()*sin(phi);

View File

@ -271,8 +271,7 @@ bool Foam::primitiveMeshGeometry::checkFaceDotProduct
const labelList& nei = mesh.faceNeighbour(); const labelList& nei = mesh.faceNeighbour();
// Severe nonorthogonality threshold // Severe nonorthogonality threshold
const scalar severeNonorthogonalityThreshold = const scalar severeNonorthogonalityThreshold = ::cos(degToRad(orthWarn));
::cos(orthWarn/180.0*constant::mathematical::pi);
scalar minDDotS = GREAT; scalar minDDotS = GREAT;
@ -303,8 +302,7 @@ bool Foam::primitiveMeshGeometry::checkFaceDotProduct
Pout<< "Severe non-orthogonality for face " << faceI Pout<< "Severe non-orthogonality for face " << faceI
<< " between cells " << own[faceI] << " between cells " << own[faceI]
<< " and " << nei[faceI] << " and " << nei[faceI]
<< ": Angle = " << ": Angle = " << radToDeg(::acos(dDotS))
<< ::acos(dDotS)/constant::mathematical::pi*180.0
<< " deg." << endl; << " deg." << endl;
} }
@ -329,8 +327,7 @@ bool Foam::primitiveMeshGeometry::checkFaceDotProduct
<< faceI << faceI
<< " between cells " << own[faceI] << " and " << " between cells " << own[faceI] << " and "
<< nei[faceI] << nei[faceI]
<< ": Angle = " << ": Angle = " << radToDeg(::acos(dDotS))
<< ::acos(dDotS)/constant::mathematical::pi*180.0
<< " deg." << endl; << " deg." << endl;
} }
@ -376,9 +373,8 @@ bool Foam::primitiveMeshGeometry::checkFaceDotProduct
if (neiSize > 0) if (neiSize > 0)
{ {
Info<< "Mesh non-orthogonality Max: " Info<< "Mesh non-orthogonality Max: "
<< ::acos(minDDotS)/constant::mathematical::pi*180.0 << radToDeg(::acos(minDDotS))
<< " average: " << << " average: " << radToDeg(::acos(sumDDotS/neiSize))
::acos(sumDDotS/neiSize)/constant::mathematical::pi*180.0
<< endl; << endl;
} }
} }
@ -780,7 +776,7 @@ bool Foam::primitiveMeshGeometry::checkFaceAngles
<< abort(FatalError); << 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(); const faceList& fcs = mesh.faces();
@ -860,8 +856,7 @@ bool Foam::primitiveMeshGeometry::checkFaceAngles
if (maxEdgeSin > SMALL) if (maxEdgeSin > SMALL)
{ {
scalar maxConcaveDegr = scalar maxConcaveDegr =
Foam::asin(Foam::min(1.0, maxEdgeSin)) radToDeg(Foam::asin(Foam::min(1.0, maxEdgeSin)));
*180.0/constant::mathematical::pi;
Info<< "There are " << nConcave Info<< "There are " << nConcave
<< " faces with concave angles between consecutive" << " faces with concave angles between consecutive"

View File

@ -56,8 +56,7 @@ Foam::topoSetSource::addToUsageTable Foam::shapeToCell::usage_
// Angle for polys to be considered splitHexes. // Angle for polys to be considered splitHexes.
Foam::scalar Foam::shapeToCell::featureCos = Foam::scalar Foam::shapeToCell::featureCos = Foam::cos(degToRad(10.0));
Foam::cos(10.0*Foam::constant::mathematical::pi/180.0);
// * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * // // * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * //

View File

@ -43,8 +43,7 @@ License
defineTypeNameAndDebug(Foam::edgeIntersections, 0); defineTypeNameAndDebug(Foam::edgeIntersections, 0);
Foam::scalar Foam::edgeIntersections::alignedCos_ = Foam::scalar Foam::edgeIntersections::alignedCos_ = Foam::cos(degToRad(89.0));
Foam::cos(89.0*Foam::constant::mathematical::pi/180.0);
// * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * // // * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * //

View File

@ -490,8 +490,7 @@ Foam::labelList Foam::surfaceFeatures::selectFeatureEdges
void Foam::surfaceFeatures::findFeatures(const scalar includedAngle) void Foam::surfaceFeatures::findFeatures(const scalar includedAngle)
{ {
scalar minCos = scalar minCos = Foam::cos(degToRad(180.0 - includedAngle));
Foam::cos((180.0 - includedAngle)*constant::mathematical::pi/180.0);
const labelListList& edgeFaces = surf_.edgeFaces(); const labelListList& edgeFaces = surf_.edgeFaces();
const vectorField& faceNormals = surf_.faceNormals(); const vectorField& faceNormals = surf_.faceNormals();

View File

@ -128,7 +128,7 @@ int main(int argc, char *argv[])
fileName pointsFile(runTime.constantPath()/"points.tmp"); fileName pointsFile(runTime.constantPath()/"points.tmp");
OFstream pFile(pointsFile); OFstream pFile(pointsFile);
scalar a(0.1*constant::mathematical::pi/180.0); scalar a(degToRad(0.1));
tensor rotateZ = tensor rotateZ =
tensor tensor
( (