diff --git a/applications/solvers/combustion/dieselEngineFoam/createSpray.H b/applications/solvers/combustion/dieselEngineFoam/createSpray.H index 6b78689f09..8c6706e0ba 100644 --- a/applications/solvers/combustion/dieselEngineFoam/createSpray.H +++ b/applications/solvers/combustion/dieselEngineFoam/createSpray.H @@ -30,7 +30,7 @@ scalar gasMass0 = fvc::domainIntegrate(rho).value(); if (dieselSpray.twoD()) { - gasMass0 *= constant::math::twoPi/dieselSpray.angleOfWedge(); + gasMass0 *= constant::mathematical::twoPi/dieselSpray.angleOfWedge(); } gasMass0 -= diff --git a/applications/solvers/combustion/dieselEngineFoam/dieselEngineFoam.C b/applications/solvers/combustion/dieselEngineFoam/dieselEngineFoam.C index 709b70f7a6..eaf3219445 100644 --- a/applications/solvers/combustion/dieselEngineFoam/dieselEngineFoam.C +++ b/applications/solvers/combustion/dieselEngineFoam/dieselEngineFoam.C @@ -43,7 +43,7 @@ Description #include "OFstream.H" #include "volPointInterpolation.H" #include "thermoPhysicsTypes.H" -#include "mathConstants.H" +#include "mathematicalConstants.H" // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // diff --git a/applications/solvers/combustion/dieselEngineFoam/spraySummary.H b/applications/solvers/combustion/dieselEngineFoam/spraySummary.H index 2bacaa91ee..5c1e43dc99 100644 --- a/applications/solvers/combustion/dieselEngineFoam/spraySummary.H +++ b/applications/solvers/combustion/dieselEngineFoam/spraySummary.H @@ -20,7 +20,7 @@ if (dieselSpray.twoD()) { - gasMass *= constant::math::twoPi/dieselSpray.angleOfWedge(); + gasMass *= constant::mathematical::twoPi/dieselSpray.angleOfWedge(); } scalar addedMass = gasMass - gasMass0; diff --git a/applications/solvers/combustion/dieselFoam/dieselFoam.C b/applications/solvers/combustion/dieselFoam/dieselFoam.C index 8d5dd0d9fa..63549b99a5 100644 --- a/applications/solvers/combustion/dieselFoam/dieselFoam.C +++ b/applications/solvers/combustion/dieselFoam/dieselFoam.C @@ -41,7 +41,7 @@ Description #include "IFstream.H" #include "OFstream.H" #include "Switch.H" -#include "mathConstants.H" +#include "mathematicalConstants.H" // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // diff --git a/applications/solvers/combustion/engineFoam/engineFoam.C b/applications/solvers/combustion/engineFoam/engineFoam.C index 8ff998217d..dd584d03e2 100644 --- a/applications/solvers/combustion/engineFoam/engineFoam.C +++ b/applications/solvers/combustion/engineFoam/engineFoam.C @@ -58,7 +58,7 @@ Description #include "ignition.H" #include "Switch.H" #include "OFstream.H" -#include "mathConstants.H" +#include "mathematicalConstants.H" // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // diff --git a/applications/solvers/compressible/rhoCentralFoam/BCs/T/smoluchowskiJumpTFvPatchScalarField.C b/applications/solvers/compressible/rhoCentralFoam/BCs/T/smoluchowskiJumpTFvPatchScalarField.C index 276cac6ae0..5423a70e3b 100644 --- a/applications/solvers/compressible/rhoCentralFoam/BCs/T/smoluchowskiJumpTFvPatchScalarField.C +++ b/applications/solvers/compressible/rhoCentralFoam/BCs/T/smoluchowskiJumpTFvPatchScalarField.C @@ -28,7 +28,7 @@ License #include "addToRunTimeSelectionTable.H" #include "fvPatchFieldMapper.H" #include "volFields.H" -#include "mathConstants.H" +#include "mathematicalConstants.H" // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // @@ -182,7 +182,7 @@ void smoluchowskiJumpTFvPatchScalarField::updateCoeffs() } Field C2 = pmu/prho - *sqrt(ppsi*constant::math::piByTwo) + *sqrt(ppsi*constant::mathematical::piByTwo) *2.0*gamma_/Pr.value()/(gamma_ + 1.0) *(2.0 - accommodationCoeff_)/accommodationCoeff_; diff --git a/applications/solvers/compressible/rhoCentralFoam/BCs/U/maxwellSlipUFvPatchVectorField.C b/applications/solvers/compressible/rhoCentralFoam/BCs/U/maxwellSlipUFvPatchVectorField.C index 7cf2ab1f25..ec8f777542 100644 --- a/applications/solvers/compressible/rhoCentralFoam/BCs/U/maxwellSlipUFvPatchVectorField.C +++ b/applications/solvers/compressible/rhoCentralFoam/BCs/U/maxwellSlipUFvPatchVectorField.C @@ -28,7 +28,7 @@ Description #include "maxwellSlipUFvPatchVectorField.H" #include "addToRunTimeSelectionTable.H" -#include "mathConstants.H" +#include "mathematicalConstants.H" #include "fvPatchFieldMapper.H" #include "volFields.H" #include "surfaceFields.H" @@ -147,7 +147,7 @@ void maxwellSlipUFvPatchVectorField::updateCoeffs() const fvPatchField& ppsi = patch().lookupPatchField("psi"); - Field C1 = sqrt(ppsi*constant::math::piByTwo) + Field C1 = sqrt(ppsi*constant::mathematical::piByTwo) *(2.0 - accommodationCoeff_)/accommodationCoeff_; Field pnu = pmu/prho; diff --git a/applications/solvers/heatTransfer/buoyantSimpleFoam/pEqn.H b/applications/solvers/heatTransfer/buoyantSimpleFoam/pEqn.H index 4bbb449df7..11768ea2f6 100644 --- a/applications/solvers/heatTransfer/buoyantSimpleFoam/pEqn.H +++ b/applications/solvers/heatTransfer/buoyantSimpleFoam/pEqn.H @@ -21,7 +21,7 @@ fvm::laplacian(rhorUAf, p) == fvc::div(phi) ); - pEqn.setReference(pRefCell, p[pRefCell]); + pEqn.setReference(pRefCell, pRefValue); // retain the residual from the first iteration if (nonOrth == 0) diff --git a/applications/solvers/multiphase/interPhaseChangeFoam/phaseChangeTwoPhaseMixtures/SchnerrSauer/SchnerrSauer.C b/applications/solvers/multiphase/interPhaseChangeFoam/phaseChangeTwoPhaseMixtures/SchnerrSauer/SchnerrSauer.C index 03e46a5c63..7762bcbfc9 100644 --- a/applications/solvers/multiphase/interPhaseChangeFoam/phaseChangeTwoPhaseMixtures/SchnerrSauer/SchnerrSauer.C +++ b/applications/solvers/multiphase/interPhaseChangeFoam/phaseChangeTwoPhaseMixtures/SchnerrSauer/SchnerrSauer.C @@ -25,7 +25,7 @@ License \*---------------------------------------------------------------------------*/ #include "SchnerrSauer.H" -#include "mathConstants.H" +#include "mathematicalConstants.H" #include "addToRunTimeSelectionTable.H" // * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // @@ -77,7 +77,7 @@ Foam::phaseChangeTwoPhaseMixtures::SchnerrSauer::rRb { return pow ( - ((4*constant::math::pi*n_)/3) + ((4*constant::mathematical::pi*n_)/3) *limitedAlpha1/(1.0 + alphaNuc() - limitedAlpha1), 1.0/3.0 ); @@ -87,7 +87,7 @@ Foam::phaseChangeTwoPhaseMixtures::SchnerrSauer::rRb Foam::dimensionedScalar Foam::phaseChangeTwoPhaseMixtures::SchnerrSauer::alphaNuc() const { - dimensionedScalar Vnuc = n_*constant::math::pi*pow3(dNuc_)/6; + dimensionedScalar Vnuc = n_*constant::mathematical::pi*pow3(dNuc_)/6; return Vnuc/(1 + Vnuc); } diff --git a/applications/solvers/multiphase/multiphaseInterFoam/multiphaseMixture/multiphaseMixture.C b/applications/solvers/multiphase/multiphaseInterFoam/multiphaseMixture/multiphaseMixture.C index 2ebb83c2fc..6d32abd9c7 100644 --- a/applications/solvers/multiphase/multiphaseInterFoam/multiphaseMixture/multiphaseMixture.C +++ b/applications/solvers/multiphase/multiphaseInterFoam/multiphaseMixture/multiphaseMixture.C @@ -29,12 +29,12 @@ License #include "Time.H" #include "subCycle.H" #include "fvCFD.H" -#include "mathConstants.H" +#include "mathematicalConstants.H" // * * * * * * * * * * * * * * * Static Member Data * * * * * * * * * * * * // const scalar Foam::multiphaseMixture::convertToRad = - Foam::constant::math::pi/180.0; + Foam::constant::mathematical::pi/180.0; // * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * // diff --git a/applications/solvers/multiphase/twoPhaseEulerFoam/kineticTheoryModels/conductivityModel/Gidaspow/GidaspowConductivity.C b/applications/solvers/multiphase/twoPhaseEulerFoam/kineticTheoryModels/conductivityModel/Gidaspow/GidaspowConductivity.C index fe24603713..ce1fff38d7 100644 --- a/applications/solvers/multiphase/twoPhaseEulerFoam/kineticTheoryModels/conductivityModel/Gidaspow/GidaspowConductivity.C +++ b/applications/solvers/multiphase/twoPhaseEulerFoam/kineticTheoryModels/conductivityModel/Gidaspow/GidaspowConductivity.C @@ -25,7 +25,7 @@ License \*---------------------------------------------------------------------------*/ #include "GidaspowConductivity.H" -#include "mathConstants.H" +#include "mathematicalConstants.H" #include "addToRunTimeSelectionTable.H" // * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // @@ -69,7 +69,7 @@ Foam::tmp Foam::GidaspowConductivity::kappa const dimensionedScalar& e ) const { - const scalar sqrtPi = sqrt(constant::math::pi); + const scalar sqrtPi = sqrt(constant::mathematical::pi); return rhoa*da*sqrt(Theta)* ( diff --git a/applications/solvers/multiphase/twoPhaseEulerFoam/kineticTheoryModels/conductivityModel/HrenyaSinclair/HrenyaSinclairConductivity.C b/applications/solvers/multiphase/twoPhaseEulerFoam/kineticTheoryModels/conductivityModel/HrenyaSinclair/HrenyaSinclairConductivity.C index 2d0acca9fa..a1a2894ae1 100644 --- a/applications/solvers/multiphase/twoPhaseEulerFoam/kineticTheoryModels/conductivityModel/HrenyaSinclair/HrenyaSinclairConductivity.C +++ b/applications/solvers/multiphase/twoPhaseEulerFoam/kineticTheoryModels/conductivityModel/HrenyaSinclair/HrenyaSinclairConductivity.C @@ -25,7 +25,7 @@ License \*---------------------------------------------------------------------------*/ #include "HrenyaSinclairConductivity.H" -#include "mathConstants.H" +#include "mathematicalConstants.H" #include "addToRunTimeSelectionTable.H" // * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // @@ -74,7 +74,7 @@ Foam::tmp Foam::HrenyaSinclairConductivity::kappa const dimensionedScalar& e ) const { - const scalar sqrtPi = sqrt(constant::math::pi); + const scalar sqrtPi = sqrt(constant::mathematical::pi); volScalarField lamda = scalar(1) + da/(6.0*sqrt(2.0)*(alpha + scalar(1.0e-5)))/L_; diff --git a/applications/solvers/multiphase/twoPhaseEulerFoam/kineticTheoryModels/conductivityModel/Syamlal/SyamlalConductivity.C b/applications/solvers/multiphase/twoPhaseEulerFoam/kineticTheoryModels/conductivityModel/Syamlal/SyamlalConductivity.C index 40c296f7e0..f2a4225d71 100644 --- a/applications/solvers/multiphase/twoPhaseEulerFoam/kineticTheoryModels/conductivityModel/Syamlal/SyamlalConductivity.C +++ b/applications/solvers/multiphase/twoPhaseEulerFoam/kineticTheoryModels/conductivityModel/Syamlal/SyamlalConductivity.C @@ -25,7 +25,7 @@ License \*---------------------------------------------------------------------------*/ #include "SyamlalConductivity.H" -#include "mathConstants.H" +#include "mathematicalConstants.H" #include "addToRunTimeSelectionTable.H" // * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // @@ -69,7 +69,7 @@ Foam::tmp Foam::SyamlalConductivity::kappa const dimensionedScalar& e ) const { - const scalar sqrtPi = sqrt(constant::math::pi); + const scalar sqrtPi = sqrt(constant::mathematical::pi); return rhoa*da*sqrt(Theta)* ( diff --git a/applications/solvers/multiphase/twoPhaseEulerFoam/kineticTheoryModels/kineticTheoryModel/kineticTheoryModel.C b/applications/solvers/multiphase/twoPhaseEulerFoam/kineticTheoryModels/kineticTheoryModel/kineticTheoryModel.C index dd3f345179..2869cbef77 100644 --- a/applications/solvers/multiphase/twoPhaseEulerFoam/kineticTheoryModels/kineticTheoryModel/kineticTheoryModel.C +++ b/applications/solvers/multiphase/twoPhaseEulerFoam/kineticTheoryModels/kineticTheoryModel/kineticTheoryModel.C @@ -26,7 +26,7 @@ License #include "kineticTheoryModel.H" #include "surfaceInterpolate.H" -#include "mathConstants.H" +#include "mathematicalConstants.H" #include "fvCFD.H" // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // @@ -204,7 +204,7 @@ void Foam::kineticTheoryModel::solve() volScalarField alpha = alpha_; alpha.max(1.0e-6); - const scalar sqrtPi = sqrt(constant::math::pi); + const scalar sqrtPi = sqrt(constant::mathematical::pi); surfaceScalarField phi = 1.5*rhoa_*phia_*fvc::interpolate(alpha_); diff --git a/applications/solvers/multiphase/twoPhaseEulerFoam/kineticTheoryModels/viscosityModel/Gidaspow/GidaspowViscosity.C b/applications/solvers/multiphase/twoPhaseEulerFoam/kineticTheoryModels/viscosityModel/Gidaspow/GidaspowViscosity.C index 2a1c00b188..a6026440be 100644 --- a/applications/solvers/multiphase/twoPhaseEulerFoam/kineticTheoryModels/viscosityModel/Gidaspow/GidaspowViscosity.C +++ b/applications/solvers/multiphase/twoPhaseEulerFoam/kineticTheoryModels/viscosityModel/Gidaspow/GidaspowViscosity.C @@ -25,7 +25,7 @@ License \*---------------------------------------------------------------------------*/ #include "GidaspowViscosity.H" -#include "mathConstants.H" +#include "mathematicalConstants.H" #include "addToRunTimeSelectionTable.H" // * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // @@ -70,7 +70,7 @@ Foam::kineticTheoryModels::GidaspowViscosity::mua const dimensionedScalar& e ) const { - const scalar sqrtPi = sqrt(constant::math::pi); + const scalar sqrtPi = sqrt(constant::mathematical::pi); return rhoa*da*sqrt(Theta)* ( diff --git a/applications/solvers/multiphase/twoPhaseEulerFoam/kineticTheoryModels/viscosityModel/HrenyaSinclair/HrenyaSinclairViscosity.C b/applications/solvers/multiphase/twoPhaseEulerFoam/kineticTheoryModels/viscosityModel/HrenyaSinclair/HrenyaSinclairViscosity.C index b5e60e94c2..fb7584d156 100644 --- a/applications/solvers/multiphase/twoPhaseEulerFoam/kineticTheoryModels/viscosityModel/HrenyaSinclair/HrenyaSinclairViscosity.C +++ b/applications/solvers/multiphase/twoPhaseEulerFoam/kineticTheoryModels/viscosityModel/HrenyaSinclair/HrenyaSinclairViscosity.C @@ -25,7 +25,7 @@ License \*---------------------------------------------------------------------------*/ #include "HrenyaSinclairViscosity.H" -#include "mathConstants.H" +#include "mathematicalConstants.H" #include "addToRunTimeSelectionTable.H" // * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // @@ -77,7 +77,7 @@ Foam::kineticTheoryModels::HrenyaSinclairViscosity::mua const dimensionedScalar& e ) const { - const scalar sqrtPi = sqrt(constant::math::pi); + const scalar sqrtPi = sqrt(constant::mathematical::pi); volScalarField lamda = scalar(1) + da/(6.0*sqrt(2.0)*(alpha + scalar(1.0e-5)))/L_; diff --git a/applications/solvers/multiphase/twoPhaseEulerFoam/kineticTheoryModels/viscosityModel/Syamlal/SyamlalViscosity.C b/applications/solvers/multiphase/twoPhaseEulerFoam/kineticTheoryModels/viscosityModel/Syamlal/SyamlalViscosity.C index 892319df6c..e913b35620 100644 --- a/applications/solvers/multiphase/twoPhaseEulerFoam/kineticTheoryModels/viscosityModel/Syamlal/SyamlalViscosity.C +++ b/applications/solvers/multiphase/twoPhaseEulerFoam/kineticTheoryModels/viscosityModel/Syamlal/SyamlalViscosity.C @@ -25,7 +25,7 @@ License \*---------------------------------------------------------------------------*/ #include "SyamlalViscosity.H" -#include "mathConstants.H" +#include "mathematicalConstants.H" #include "addToRunTimeSelectionTable.H" // * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // @@ -69,7 +69,7 @@ Foam::tmp Foam::kineticTheoryModels::SyamlalViscosity::mua const dimensionedScalar& e ) const { - const scalar sqrtPi = sqrt(constant::math::pi); + const scalar sqrtPi = sqrt(constant::mathematical::pi); return rhoa*da*sqrt(Theta)* ( diff --git a/applications/test/FixedList/FixedListTest.C b/applications/test/FixedList/FixedListTest.C index e46e910d3a..97292f1363 100644 --- a/applications/test/FixedList/FixedListTest.C +++ b/applications/test/FixedList/FixedListTest.C @@ -78,10 +78,7 @@ int main(int argc, char *argv[]) Serr<< "slave sending to master " << Pstream::masterNo() << endl; - OPstream toMaster - ( - Pstream::blocking, Pstream::masterNo(), IOstream::ASCII - ); + OPstream toMaster(Pstream::blocking, Pstream::masterNo()); FixedList list3; list3[0] = 0; @@ -98,10 +95,7 @@ int main(int argc, char *argv[]) ) { Serr << "master receiving from slave " << slave << endl; - IPstream fromSlave - ( - Pstream::blocking, slave, IOstream::ASCII - ); + IPstream fromSlave(Pstream::blocking, slave); FixedList list3(fromSlave); Serr<< list3 << endl; diff --git a/applications/test/graphXi/graphXi.C b/applications/test/graphXi/graphXi.C index c717f6cc1f..86f1eb18fd 100644 --- a/applications/test/graphXi/graphXi.C +++ b/applications/test/graphXi/graphXi.C @@ -32,7 +32,7 @@ Description #include "graph.H" #include "OFstream.H" -#include "mathConstants.H" +#include "mathematicalConstants.H" using namespace Foam; @@ -50,7 +50,7 @@ int main() scalarField b = 0.5*(1.0 + erf(x)); scalarField c = 1.0 - b; - scalarField gradb = (1/::sqrt(constant::math::pi))*exp(-sqr(x)); + scalarField gradb = (1/::sqrt(constant::mathematical::pi))*exp(-sqr(x)); scalarField lapb = -2*x*gradb; r = lapb*b*c/(gradb*gradb); diff --git a/applications/test/stringList/stringListTest.C b/applications/test/stringList/stringListTest.C index 98391ef5be..13718be6f0 100644 --- a/applications/test/stringList/stringListTest.C +++ b/applications/test/stringList/stringListTest.C @@ -27,6 +27,7 @@ Description \*---------------------------------------------------------------------------*/ #include "stringListOps.H" +#include "IStringStream.H" #include "IOstreams.H" using namespace Foam; @@ -36,21 +37,59 @@ using namespace Foam; int main(int argc, char *argv[]) { - stringList sl(3); - sl[0] = "hello"; - sl[1] = "heello"; - sl[2] = "heeello"; + stringList strLst + ( + IStringStream + ( + "(" + "\"hello\"" + "\"heello\"" + "\"heeello\"" + "\"bye\"" + "\"bbye\"" + "\"bbbye\"" + "\"okey\"" + "\"okkey\"" + "\"okkkey\"" + ")" + )() + ); - labelList matches = findStrings(".*ee.*", sl); + wordReList reLst(IStringStream("( okey \"[hy]e+.*\" )")()); - Info<< "matches found for regexp .*ee.* : "; + Info<< "stringList " << strLst << nl; + + labelList matches = findStrings(".*ee.*", strLst); + + Info<< "matches found for regexp .*ee.* :" << nl << matches << nl; forAll(matches, i) { - Info<< " " << sl[matches[i]]; + Info<< " -> " << strLst[matches[i]] << nl; } Info<< endl; - Info << "End\n" << endl; + matches = findStrings(reLst, strLst); + + Info<< "matches found for " << reLst << nl << matches << nl; + forAll(matches, i) + { + Info<< " -> " << strLst[matches[i]] << nl; + } + Info<< endl; + + stringList subLst = subsetStrings(".*ee.*", strLst); + Info<< "subset stringList: " << subLst << nl; + + subLst = subsetStrings(reLst, strLst); + Info<< "subset stringList: " << subLst << nl; + + inplaceSubsetStrings(reLst, strLst); + Info<< "subsetted stringList: " << strLst << nl; + + inplaceSubsetStrings(".*l.*", strLst); + Info<< "subsetted stringList: " << strLst << nl; + + Info<< "\nEnd\n" << endl; return 0; } diff --git a/applications/utilities/mesh/advanced/collapseEdges/collapseEdges.C b/applications/utilities/mesh/advanced/collapseEdges/collapseEdges.C index 0905771d19..2ce7f8ba80 100644 --- a/applications/utilities/mesh/advanced/collapseEdges/collapseEdges.C +++ b/applications/utilities/mesh/advanced/collapseEdges/collapseEdges.C @@ -47,7 +47,7 @@ Description #include "polyTopoChanger.H" #include "polyMesh.H" #include "mapPolyMesh.H" -#include "mathConstants.H" +#include "mathematicalConstants.H" #include "PackedBoolList.H" #include "SortableList.H" @@ -467,7 +467,7 @@ int main(int argc, char *argv[]) scalar angle(readScalar(IStringStream(args.additionalArgs()[1])())); bool overwrite = args.optionFound("overwrite"); - scalar maxCos = Foam::cos(angle*180/constant::math::pi); + scalar maxCos = Foam::cos(angle*180/constant::mathematical::pi); Info<< "Merging:" << nl << " edges with length less than " << minLen << " meters" << nl diff --git a/applications/utilities/mesh/advanced/combinePatchFaces/combinePatchFaces.C b/applications/utilities/mesh/advanced/combinePatchFaces/combinePatchFaces.C index de7af2b077..54fd1bdf4f 100644 --- a/applications/utilities/mesh/advanced/combinePatchFaces/combinePatchFaces.C +++ b/applications/utilities/mesh/advanced/combinePatchFaces/combinePatchFaces.C @@ -53,7 +53,7 @@ Description #include "removePoints.H" #include "polyMesh.H" #include "mapPolyMesh.H" -#include "mathConstants.H" +#include "mathematicalConstants.H" using namespace Foam; @@ -445,12 +445,12 @@ int main(int argc, char *argv[]) scalar featureAngle(readScalar(IStringStream(args.additionalArgs()[0])())); - scalar minCos = Foam::cos(featureAngle*constant::math::pi/180.0); + scalar minCos = Foam::cos(featureAngle*constant::mathematical::pi/180.0); scalar concaveAngle = defaultConcaveAngle; args.optionReadIfPresent("concaveAngle", concaveAngle); - scalar concaveSin = Foam::sin(concaveAngle*constant::math::pi/180.0); + scalar concaveSin = Foam::sin(concaveAngle*constant::mathematical::pi/180.0); 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 1d9c0e5b54..c83ab27583 100644 --- a/applications/utilities/mesh/advanced/splitCells/splitCells.C +++ b/applications/utilities/mesh/advanced/splitCells/splitCells.C @@ -49,7 +49,7 @@ Description #include "cellSet.H" #include "cellModeller.H" #include "meshCutter.H" -#include "mathConstants.H" +#include "mathematicalConstants.H" #include "geomCellLooper.H" #include "plane.H" #include "edgeVertex.H" @@ -539,7 +539,7 @@ int main(int argc, char *argv[]) scalar featureAngle(readScalar(IStringStream(args.additionalArgs()[0])())); - scalar radAngle = featureAngle*constant::math::pi/180.0; + scalar radAngle = featureAngle*constant::mathematical::pi/180.0; scalar minCos = Foam::cos(radAngle); scalar minSin = Foam::sin(radAngle); diff --git a/applications/utilities/mesh/conversion/kivaToFoam/kivaToFoam.C b/applications/utilities/mesh/conversion/kivaToFoam/kivaToFoam.C index 996cd67d4c..1da7ba049e 100644 --- a/applications/utilities/mesh/conversion/kivaToFoam/kivaToFoam.C +++ b/applications/utilities/mesh/conversion/kivaToFoam/kivaToFoam.C @@ -43,7 +43,7 @@ Description #include "symmetryPolyPatch.H" #include "wedgePolyPatch.H" #include "cyclicPolyPatch.H" -#include "mathConstants.H" +#include "mathematicalConstants.H" using namespace Foam; diff --git a/applications/utilities/mesh/conversion/kivaToFoam/readKivaGrid.H b/applications/utilities/mesh/conversion/kivaToFoam/readKivaGrid.H index f1ec25a59c..9ed5e27004 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::math::pi/180.0); + scalar tanTheta = Foam::tan(2.5*constant::mathematical::pi/180.0); 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 65dd5c952d..740b87a391 100644 --- a/applications/utilities/mesh/conversion/polyDualMesh/polyDualMeshApp.C +++ b/applications/utilities/mesh/conversion/polyDualMesh/polyDualMeshApp.C @@ -59,7 +59,7 @@ Usage #include "Time.H" #include "timeSelector.H" #include "fvMesh.H" -#include "mathConstants.H" +#include "mathematicalConstants.H" #include "polyTopoChange.H" #include "mapPolyMesh.H" #include "PackedBoolList.H" @@ -91,7 +91,7 @@ void simpleMarkFeatures labelList& multiCellFeaturePoints ) { - scalar minCos = Foam::cos(featureAngle*constant::math::pi/180.0); + scalar minCos = Foam::cos(featureAngle*constant::mathematical::pi/180.0); 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::math::pi/180.0); + scalar minCos = Foam::cos(featureAngle*constant::mathematical::pi/180.0); 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 0b135188e0..bfd1dae882 100644 --- a/applications/utilities/mesh/conversion/starToFoam/createCoupleMatches.C +++ b/applications/utilities/mesh/conversion/starToFoam/createCoupleMatches.C @@ -33,7 +33,7 @@ Description #include "IOmanip.H" #include "boundBox.H" #include "Map.H" -#include "mathConstants.H" +#include "mathematicalConstants.H" // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // @@ -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::math::pi*180 + << Foam::acos(faceAreaAngle)/constant::mathematical::pi*180 << " deg." << endl << "master cell: " << fp.masterCell() << " STAR number: " << starCellID_[fp.masterCell()] diff --git a/applications/utilities/mesh/generation/blockMesh/Make/files b/applications/utilities/mesh/generation/blockMesh/Make/files index 81f5f36749..74840e9732 100644 --- a/applications/utilities/mesh/generation/blockMesh/Make/files +++ b/applications/utilities/mesh/generation/blockMesh/Make/files @@ -1,31 +1,3 @@ -curvedEdges = curvedEdges - -$(curvedEdges)/curvedEdge.C -$(curvedEdges)/lineEdge.C -$(curvedEdges)/polyLine.C -$(curvedEdges)/polyLineEdge.C -$(curvedEdges)/arcEdge.C -$(curvedEdges)/spline.C -$(curvedEdges)/BSpline.C -$(curvedEdges)/simpleSplineEdge.C -$(curvedEdges)/polySplineEdge.C -$(curvedEdges)/lineDivide.C - -blockMesh.C -blockDescriptor.C -setEdge.C -block.C -createTopology.C -checkBlockMesh.C -createBlockOffsets.C -createMergeList.C -createPoints.C -createCells.C -createPatches.C -blockPoints.C -blockCells.C -blockBoundary.C - blockMeshApp.C EXE = $(FOAM_APPBIN)/blockMesh diff --git a/applications/utilities/mesh/generation/blockMesh/Make/options b/applications/utilities/mesh/generation/blockMesh/Make/options index a5b85e4298..2e07c477da 100644 --- a/applications/utilities/mesh/generation/blockMesh/Make/options +++ b/applications/utilities/mesh/generation/blockMesh/Make/options @@ -1,8 +1,9 @@ EXE_INC = \ - -I$(curvedEdges) \ + -I$(LIB_SRC)/mesh/blockMesh/lnInclude \ -I$(LIB_SRC)/meshTools/lnInclude \ -I$(LIB_SRC)/dynamicMesh/lnInclude EXE_LIBS = \ + -lblockMesh \ -lmeshTools \ -ldynamicMesh diff --git a/applications/utilities/mesh/generation/blockMesh/blockBoundary.C b/applications/utilities/mesh/generation/blockMesh/blockBoundary.C deleted file mode 100644 index 8086aeea54..0000000000 --- a/applications/utilities/mesh/generation/blockMesh/blockBoundary.C +++ /dev/null @@ -1,209 +0,0 @@ -/*---------------------------------------------------------------------------*\ - ========= | - \\ / F ield | OpenFOAM: The Open Source CFD Toolbox - \\ / O peration | - \\ / A nd | Copyright (C) 1991-2009 OpenCFD Ltd. - \\/ M anipulation | -------------------------------------------------------------------------------- -License - This file is part of OpenFOAM. - - OpenFOAM is free software; you can redistribute it and/or modify it - under the terms of the GNU General Public License as published by the - Free Software Foundation; either version 2 of the License, or (at your - option) any later version. - - OpenFOAM is distributed in the hope that it will be useful, but WITHOUT - ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - for more details. - - You should have received a copy of the GNU General Public License - along with OpenFOAM; if not, write to the Free Software Foundation, - Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - -Description - private member of block. Creates boundary patches for the block - -\*---------------------------------------------------------------------------*/ - -#include "error.H" -#include "block.H" - - -// * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * // - -void Foam::block::blockBoundary() -{ - label ni = blockDef_.n().x(); - label nj = blockDef_.n().y(); - label nk = blockDef_.n().z(); - - // x-direction - - label wallLabel = 0; - label wallCellLabel = 0; - - // x-min - boundaryPatches_[wallLabel].setSize(nj*nk); - for (label k = 0; k <= nk - 1; k++) - { - for (label j = 0; j <= nj - 1; j++) - { - boundaryPatches_[wallLabel][wallCellLabel].setSize(4); - - // set the points - boundaryPatches_[wallLabel][wallCellLabel][0] = - vtxLabel(0, j, k); - boundaryPatches_[wallLabel][wallCellLabel][1] = - vtxLabel(0, j, k + 1); - boundaryPatches_[wallLabel][wallCellLabel][2] = - vtxLabel(0, j + 1, k + 1); - boundaryPatches_[wallLabel][wallCellLabel][3] = - vtxLabel(0, j + 1, k); - - // update the counter - wallCellLabel++; - } - } - - // x-max - wallLabel++; - wallCellLabel = 0; - - boundaryPatches_[wallLabel].setSize(nj*nk); - - for (label k = 0; k <= nk - 1; k++) - { - for (label j = 0; j <= nj - 1; j++) - { - boundaryPatches_[wallLabel][wallCellLabel].setSize(4); - - // set the points - boundaryPatches_[wallLabel][wallCellLabel][0] = - vtxLabel(ni, j, k); - boundaryPatches_[wallLabel][wallCellLabel][1] = - vtxLabel(ni, j+1, k); - boundaryPatches_[wallLabel][wallCellLabel][2] = - vtxLabel(ni, j+1, k+1); - boundaryPatches_[wallLabel][wallCellLabel][3] = - vtxLabel(ni, j, k+1); - - // update the counter - wallCellLabel++; - } - } - - // y-direction - - // y-min - wallLabel++; - wallCellLabel = 0; - - boundaryPatches_[wallLabel].setSize(ni*nk); - for (label i = 0; i <= ni - 1; i++) - { - for (label k = 0; k <= nk - 1; k++) - { - boundaryPatches_[wallLabel][wallCellLabel].setSize(4); - - // set the points - boundaryPatches_[wallLabel][wallCellLabel][0] = - vtxLabel(i, 0, k); - boundaryPatches_[wallLabel][wallCellLabel][1] = - vtxLabel(i + 1, 0, k); - boundaryPatches_[wallLabel][wallCellLabel][2] = - vtxLabel(i + 1, 0, k + 1); - boundaryPatches_[wallLabel][wallCellLabel][3] = - vtxLabel(i, 0, k + 1); - - // update the counter - wallCellLabel++; - } - } - - // y-max - wallLabel++; - wallCellLabel = 0; - - boundaryPatches_[wallLabel].setSize(ni*nk); - - for (label i = 0; i <= ni - 1; i++) - { - for (label k = 0; k <= nk - 1; k++) - { - boundaryPatches_[wallLabel][wallCellLabel].setSize(4); - - // set the points - boundaryPatches_[wallLabel][wallCellLabel][0] = - vtxLabel(i, nj, k); - boundaryPatches_[wallLabel][wallCellLabel][1] = - vtxLabel(i, nj, k + 1); - boundaryPatches_[wallLabel][wallCellLabel][2] = - vtxLabel(i + 1, nj, k + 1); - boundaryPatches_[wallLabel][wallCellLabel][3] = - vtxLabel(i + 1, nj, k); - - // update the counter - wallCellLabel++; - } - } - - // z-direction - - // z-min - wallLabel++; - wallCellLabel = 0; - - boundaryPatches_[wallLabel].setSize(ni*nj); - - for (label i = 0; i <= ni - 1; i++) - { - for (label j = 0; j <= nj - 1; j++) - { - boundaryPatches_[wallLabel][wallCellLabel].setSize(4); - - // set the points - boundaryPatches_[wallLabel][wallCellLabel][0] = - vtxLabel(i, j, 0); - boundaryPatches_[wallLabel][wallCellLabel][1] = - vtxLabel(i, j + 1, 0); - boundaryPatches_[wallLabel][wallCellLabel][2] = - vtxLabel(i + 1, j + 1, 0); - boundaryPatches_[wallLabel][wallCellLabel][3] = - vtxLabel(i + 1, j, 0); - - // update the counter - wallCellLabel++; - } - } - - // z-max - wallLabel++; - wallCellLabel = 0; - - boundaryPatches_[wallLabel].setSize(ni*nj); - - for (label i = 0; i <= ni - 1; i++) - { - for (label j = 0; j <= nj - 1; j++) - { - boundaryPatches_[wallLabel][wallCellLabel].setSize(4); - - // set the points - boundaryPatches_[wallLabel][wallCellLabel][0] = - vtxLabel(i, j, nk); - boundaryPatches_[wallLabel][wallCellLabel][1] = - vtxLabel(i + 1, j, nk); - boundaryPatches_[wallLabel][wallCellLabel][2] = - vtxLabel(i + 1, j + 1, nk); - boundaryPatches_[wallLabel][wallCellLabel][3] = - vtxLabel(i, j + 1, nk); - - // update the counter - wallCellLabel++; - } - } -} - -// ************************************************************************* // diff --git a/applications/utilities/mesh/generation/blockMesh/blockCells.C b/applications/utilities/mesh/generation/blockMesh/blockCells.C deleted file mode 100644 index acecc71700..0000000000 --- a/applications/utilities/mesh/generation/blockMesh/blockCells.C +++ /dev/null @@ -1,65 +0,0 @@ -/*---------------------------------------------------------------------------*\ - ========= | - \\ / F ield | OpenFOAM: The Open Source CFD Toolbox - \\ / O peration | - \\ / A nd | Copyright (C) 1991-2009 OpenCFD Ltd. - \\/ M anipulation | -------------------------------------------------------------------------------- -License - This file is part of OpenFOAM. - - OpenFOAM is free software; you can redistribute it and/or modify it - under the terms of the GNU General Public License as published by the - Free Software Foundation; either version 2 of the License, or (at your - option) any later version. - - OpenFOAM is distributed in the hope that it will be useful, but WITHOUT - ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - for more details. - - You should have received a copy of the GNU General Public License - along with OpenFOAM; if not, write to the Free Software Foundation, - Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - -Description - private member of block. Creates cells for the block. - -\*---------------------------------------------------------------------------*/ - -#include "error.H" -#include "block.H" - -// * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * // - -void Foam::block::blockCells() -{ - label ni = blockDef_.n().x(); - label nj = blockDef_.n().y(); - label nk = blockDef_.n().z(); - - label cellNo = 0; - - for (label k = 0; k <= nk - 1; k++) - { - for (label j = 0; j <= nj - 1; j++) - { - for (label i = 0; i <= ni - 1; i++) - { - cells_[cellNo].setSize(8); - - cells_[cellNo][0] = vtxLabel(i, j, k); - cells_[cellNo][1] = vtxLabel(i+1, j, k); - cells_[cellNo][2] = vtxLabel(i+1, j+1, k); - cells_[cellNo][3] = vtxLabel(i, j+1, k); - cells_[cellNo][4] = vtxLabel(i, j, k+1); - cells_[cellNo][5] = vtxLabel(i+1, j, k+1); - cells_[cellNo][6] = vtxLabel(i+1, j+1, k+1); - cells_[cellNo][7] = vtxLabel(i, j+1, k+1); - cellNo++; - } - } - } -} - -// ************************************************************************* // diff --git a/applications/utilities/mesh/generation/blockMesh/blockDescriptor.C b/applications/utilities/mesh/generation/blockMesh/blockDescriptor.C deleted file mode 100644 index 7d40c4d7cb..0000000000 --- a/applications/utilities/mesh/generation/blockMesh/blockDescriptor.C +++ /dev/null @@ -1,248 +0,0 @@ -/*---------------------------------------------------------------------------*\ - ========= | - \\ / F ield | OpenFOAM: The Open Source CFD Toolbox - \\ / O peration | - \\ / A nd | Copyright (C) 1991-2009 OpenCFD Ltd. - \\/ M anipulation | -------------------------------------------------------------------------------- -License - This file is part of OpenFOAM. - - OpenFOAM is free software; you can redistribute it and/or modify it - under the terms of the GNU General Public License as published by the - Free Software Foundation; either version 2 of the License, or (at your - option) any later version. - - OpenFOAM is distributed in the hope that it will be useful, but WITHOUT - ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - for more details. - - You should have received a copy of the GNU General Public License - along with OpenFOAM; if not, write to the Free Software Foundation, - Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - -Description - -\*---------------------------------------------------------------------------*/ - -#include "error.H" - -#include "blockDescriptor.H" -#include "scalarList.H" - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -namespace Foam -{ - -// * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * // - -void blockDescriptor::makeBlockEdges() -{ - // for all edges check the list of curved edges. If the edge is curved, - // add it to the list. If the edge is not found, create is as a line - - setEdge(0, 0, 1, n_.x()); - setEdge(1, 3, 2, n_.x()); - setEdge(2, 7, 6, n_.x()); - setEdge(3, 4, 5, n_.x()); - - setEdge(4, 0, 3, n_.y()); - setEdge(5, 1, 2, n_.y()); - setEdge(6, 5, 6, n_.y()); - setEdge(7, 4, 7, n_.y()); - - setEdge(8, 0, 4, n_.z()); - setEdge(9, 1, 5, n_.z()); - setEdge(10, 2, 6, n_.z()); - setEdge(11, 3, 7, n_.z()); -} - - -// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // - -// from components -blockDescriptor::blockDescriptor -( - const cellShape& bshape, - const pointField& blockMeshPoints, - const curvedEdgeList& edges, - const Vector