mirror of
https://develop.openfoam.com/Development/openfoam.git
synced 2025-11-28 03:28:01 +00:00
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:
@ -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");
|
||||||
|
|||||||
@ -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");
|
||||||
|
|||||||
@ -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();
|
||||||
|
|||||||
@ -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
|
||||||
|
|||||||
@ -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()]
|
||||||
|
|||||||
@ -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
|
|
||||||
)
|
)
|
||||||
{}
|
{}
|
||||||
|
|
||||||
|
|||||||
@ -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
|
||||||
|
|||||||
@ -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)
|
||||||
{
|
{
|
||||||
|
|||||||
@ -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++;
|
||||||
|
|||||||
@ -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 * * * * * * * * * * * //
|
||||||
|
|||||||
@ -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))
|
||||||
)
|
)
|
||||||
{}
|
{}
|
||||||
|
|
||||||
|
|||||||
@ -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"
|
||||||
|
|||||||
@ -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)
|
||||||
|
|||||||
@ -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)
|
||||||
|
|||||||
@ -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
|
||||||
|
|||||||
@ -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);
|
||||||
|
|
||||||
|
|||||||
@ -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,
|
||||||
@ -2688,7 +2688,7 @@ void Foam::autoLayerDriver::addLayers
|
|||||||
maxPatchNameLen = max(maxPatchNameLen, label(patchName.size()));
|
maxPatchNameLen = max(maxPatchNameLen, label(patchName.size()));
|
||||||
}
|
}
|
||||||
|
|
||||||
Info<< nl
|
Info<< nl
|
||||||
<< setf(ios_base::left) << setw(maxPatchNameLen) << "patch"
|
<< setf(ios_base::left) << setw(maxPatchNameLen) << "patch"
|
||||||
<< setw(0) << " faces layers avg thickness[m]" << nl
|
<< setw(0) << " faces layers avg thickness[m]" << nl
|
||||||
<< setf(ios_base::left) << setw(maxPatchNameLen) << " "
|
<< setf(ios_base::left) << setw(maxPatchNameLen) << " "
|
||||||
@ -3289,7 +3289,7 @@ void Foam::autoLayerDriver::doLayers
|
|||||||
<< "Doing initial balancing" << nl
|
<< "Doing initial balancing" << nl
|
||||||
<< "-----------------------" << nl
|
<< "-----------------------" << nl
|
||||||
<< endl;
|
<< endl;
|
||||||
|
|
||||||
scalarField cellWeights(mesh.nCells(), 1);
|
scalarField cellWeights(mesh.nCells(), 1);
|
||||||
forAll(numLayers, patchI)
|
forAll(numLayers, patchI)
|
||||||
{
|
{
|
||||||
@ -3302,7 +3302,7 @@ void Foam::autoLayerDriver::doLayers
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Balance mesh (and meshRefinement). No restriction on face zones
|
// Balance mesh (and meshRefinement). No restriction on face zones
|
||||||
// and baffles.
|
// and baffles.
|
||||||
autoPtr<mapDistributePolyMesh> map = meshRefiner_.balance
|
autoPtr<mapDistributePolyMesh> map = meshRefiner_.balance
|
||||||
@ -3313,7 +3313,7 @@ void Foam::autoLayerDriver::doLayers
|
|||||||
decomposer,
|
decomposer,
|
||||||
distributor
|
distributor
|
||||||
);
|
);
|
||||||
|
|
||||||
//{
|
//{
|
||||||
// globalIndex globalCells(mesh.nCells());
|
// globalIndex globalCells(mesh.nCells());
|
||||||
//
|
//
|
||||||
|
|||||||
@ -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)
|
||||||
{
|
{
|
||||||
|
|||||||
@ -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_
|
||||||
(
|
(
|
||||||
|
|||||||
@ -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));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -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)
|
||||||
{
|
{
|
||||||
|
|||||||
@ -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_);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -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;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -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);
|
||||||
|
|
||||||
|
|||||||
@ -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"
|
||||||
|
|||||||
@ -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 * * * * * * * * * * * //
|
||||||
|
|||||||
@ -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 * * * * * * * * * * * //
|
||||||
|
|||||||
@ -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();
|
||||||
|
|||||||
@ -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
|
||||||
(
|
(
|
||||||
|
|||||||
Reference in New Issue
Block a user