diff --git a/applications/solvers/combustion/coldEngineFoam/logSummary.H b/applications/solvers/combustion/coldEngineFoam/logSummary.H index d2a6bcee2d..5a33f48764 100644 --- a/applications/solvers/combustion/coldEngineFoam/logSummary.H +++ b/applications/solvers/combustion/coldEngineFoam/logSummary.H @@ -1,6 +1,8 @@ Info<< "Mean pressure:" << p.weightedAverage(mesh.V()).value() << endl; Info<< "Mean temperature:" << T.weightedAverage(mesh.V()).value() << endl; -Info<< "Mean u':" << (sqrt((2.0/3.0)*turbulence->k()))().weightedAverage(mesh.V()).value() << endl; +Info<< "Mean u':" + << (sqrt((2.0/3.0)*turbulence->k()))().weightedAverage(mesh.V()).value() + << endl; logSummaryFile << runTime.theta() << tab diff --git a/applications/solvers/combustion/dieselEngineFoam/logSummary.H b/applications/solvers/combustion/dieselEngineFoam/logSummary.H index d2a6bcee2d..5a33f48764 100644 --- a/applications/solvers/combustion/dieselEngineFoam/logSummary.H +++ b/applications/solvers/combustion/dieselEngineFoam/logSummary.H @@ -1,6 +1,8 @@ Info<< "Mean pressure:" << p.weightedAverage(mesh.V()).value() << endl; Info<< "Mean temperature:" << T.weightedAverage(mesh.V()).value() << endl; -Info<< "Mean u':" << (sqrt((2.0/3.0)*turbulence->k()))().weightedAverage(mesh.V()).value() << endl; +Info<< "Mean u':" + << (sqrt((2.0/3.0)*turbulence->k()))().weightedAverage(mesh.V()).value() + << endl; logSummaryFile << runTime.theta() << tab diff --git a/applications/solvers/combustion/engineFoam/logSummary.H b/applications/solvers/combustion/engineFoam/logSummary.H index 5abe9abe7b..24d8812008 100644 --- a/applications/solvers/combustion/engineFoam/logSummary.H +++ b/applications/solvers/combustion/engineFoam/logSummary.H @@ -1,6 +1,8 @@ Info<< "Mean pressure:" << p.weightedAverage(mesh.V()).value() << endl; Info<< "Mean temperature:" << T.weightedAverage(mesh.V()).value() << endl; -Info<< "Mean u':" << (sqrt((2.0/3.0)*turbulence->k()))().weightedAverage(mesh.V()).value() << endl; +Info<< "Mean u':" + << (sqrt((2.0/3.0)*turbulence->k()))().weightedAverage(mesh.V()).value() + << endl; logSummaryFile << runTime.theta() << tab diff --git a/applications/solvers/compressible/rhoPorousSimpleFoam/createFields.H b/applications/solvers/compressible/rhoPorousSimpleFoam/createFields.H index efad823a91..d7a6b97ac1 100644 --- a/applications/solvers/compressible/rhoPorousSimpleFoam/createFields.H +++ b/applications/solvers/compressible/rhoPorousSimpleFoam/createFields.H @@ -76,7 +76,10 @@ const bool pressureImplicitPorosity = ( pZones.size() - && mesh.solutionDict().subDict("SIMPLE").readIfPresent("nUCorrectors", nUCorr) + && mesh.solutionDict().subDict("SIMPLE").readIfPresent + ( + "nUCorrectors", + nUCorr + ) && (nUCorr > 0) ); - diff --git a/applications/solvers/compressible/rhopSonicFoam/resetPhiPatches.H b/applications/solvers/compressible/rhopSonicFoam/resetPhiPatches.H index c8541406f3..2a8496ef4c 100644 --- a/applications/solvers/compressible/rhopSonicFoam/resetPhiPatches.H +++ b/applications/solvers/compressible/rhopSonicFoam/resetPhiPatches.H @@ -1,6 +1,11 @@ -surfaceScalarField::GeometricBoundaryField& phiPatches = phi.boundaryField(); -const volVectorField::GeometricBoundaryField& rhoUpatches = rhoU.boundaryField(); -const surfaceVectorField::GeometricBoundaryField& SfPatches = mesh.Sf().boundaryField(); +surfaceScalarField::GeometricBoundaryField& phiPatches = + phi.boundaryField(); + +const volVectorField::GeometricBoundaryField& rhoUpatches = + rhoU.boundaryField(); + +const surfaceVectorField::GeometricBoundaryField& SfPatches = + mesh.Sf().boundaryField(); forAll(phiPatches, patchI) { diff --git a/applications/solvers/heatTransfer/chtMultiRegionFoam/include/setMultiRegionDeltaT.H b/applications/solvers/heatTransfer/chtMultiRegionFoam/include/setMultiRegionDeltaT.H index eab0dfe61e..71aa1d65d0 100644 --- a/applications/solvers/heatTransfer/chtMultiRegionFoam/include/setMultiRegionDeltaT.H +++ b/applications/solvers/heatTransfer/chtMultiRegionFoam/include/setMultiRegionDeltaT.H @@ -25,9 +25,9 @@ Global setMultiRegionDeltaT Description - Reset the timestep to maintain a constant maximum courant and diffusion - Numbers. Reduction of time-step is immediate, but increase is damped to avoid - unstable oscillations. + Reset the timestep to maintain a constant maximum courant and + diffusion Numbers. Reduction of time-step is immediate, but + increase is damped to avoid unstable oscillations. \*---------------------------------------------------------------------------*/ diff --git a/applications/solvers/incompressible/adjointShapeOptimizationFoam/createFields.H b/applications/solvers/incompressible/adjointShapeOptimizationFoam/createFields.H index 0c8c1bd115..af9e9de6be 100644 --- a/applications/solvers/incompressible/adjointShapeOptimizationFoam/createFields.H +++ b/applications/solvers/incompressible/adjointShapeOptimizationFoam/createFields.H @@ -67,7 +67,13 @@ label paRefCell = 0; scalar paRefValue = 0.0; - setRefCell(pa, mesh.solutionDict().subDict("SIMPLE"), paRefCell, paRefValue); + setRefCell + ( + pa, + mesh.solutionDict().subDict("SIMPLE"), + paRefCell, + paRefValue + ); singlePhaseTransportModel laminarTransport(U, phi); diff --git a/applications/solvers/incompressible/boundaryFoam/interrogateWallPatches.H b/applications/solvers/incompressible/boundaryFoam/interrogateWallPatches.H index 10855d9cc6..6fa3a0892c 100644 --- a/applications/solvers/incompressible/boundaryFoam/interrogateWallPatches.H +++ b/applications/solvers/incompressible/boundaryFoam/interrogateWallPatches.H @@ -59,7 +59,8 @@ if (nWallFaces == 0) } else { - Info<< "Generating wall data for patch: " << patches[patchId].name() << endl; + Info<< "Generating wall data for patch: " << patches[patchId].name() + << endl; } // store local id of near-walll cell to process @@ -71,4 +72,3 @@ scalarField y = & (mesh.C().internalField() - mesh.C().boundaryField()[patchId][faceId]); Info<< " Height to first cell centre y0 = " << y[cellId] << endl; - diff --git a/applications/solvers/incompressible/porousSimpleFoam/createFields.H b/applications/solvers/incompressible/porousSimpleFoam/createFields.H index 7ce03c1967..d9bd0b5bac 100644 --- a/applications/solvers/incompressible/porousSimpleFoam/createFields.H +++ b/applications/solvers/incompressible/porousSimpleFoam/createFields.H @@ -49,7 +49,10 @@ const bool pressureImplicitPorosity = ( pZones.size() - && mesh.solutionDict().subDict("SIMPLE").readIfPresent("nUCorrectors", nUCorr) + && mesh.solutionDict().subDict("SIMPLE").readIfPresent + ( + "nUCorrectors", + nUCorr + ) && (nUCorr > 0) ); - diff --git a/applications/solvers/multiphase/bubbleFoam/alphaEqn.H b/applications/solvers/multiphase/bubbleFoam/alphaEqn.H index a985c6eb95..db3b595625 100644 --- a/applications/solvers/multiphase/bubbleFoam/alphaEqn.H +++ b/applications/solvers/multiphase/bubbleFoam/alphaEqn.H @@ -34,7 +34,13 @@ betaEqn.relax(); betaEqn.solve(); - alpha = 0.5*(scalar(1) + sqr(scalar(1) - beta) - sqr(scalar(1) - alpha)); + alpha = + 0.5 + *( + scalar(1) + + sqr(scalar(1) - beta) + - sqr(scalar(1) - alpha) + ); */ beta = scalar(1) - alpha; diff --git a/applications/solvers/multiphase/bubbleFoam/pEqn.H b/applications/solvers/multiphase/bubbleFoam/pEqn.H index 3e550efc65..8e257c8fa9 100644 --- a/applications/solvers/multiphase/bubbleFoam/pEqn.H +++ b/applications/solvers/multiphase/bubbleFoam/pEqn.H @@ -32,7 +32,11 @@ phi = alphaf*phia + betaf*phib; - surfaceScalarField Dp("(rho*(1|A(U)))", alphaf*rUaAf/rhoa + betaf*rUbAf/rhob); + surfaceScalarField Dp + ( + "(rho*(1|A(U)))", + alphaf*rUaAf/rhoa + betaf*rUbAf/rhob + ); for (int nonOrth=0; nonOrth<=nNonOrthCorr; nonOrth++) { diff --git a/applications/solvers/multiphase/cavitatingFoam/resetPhivPatches.H b/applications/solvers/multiphase/cavitatingFoam/resetPhivPatches.H index 7e8b040bb6..2f62dcfc37 100644 --- a/applications/solvers/multiphase/cavitatingFoam/resetPhivPatches.H +++ b/applications/solvers/multiphase/cavitatingFoam/resetPhivPatches.H @@ -1,6 +1,11 @@ -surfaceScalarField::GeometricBoundaryField& phivPatches = phiv.boundaryField(); -const volVectorField::GeometricBoundaryField& Upatches = U.boundaryField(); -const surfaceVectorField::GeometricBoundaryField& SfPatches = mesh.Sf().boundaryField(); +surfaceScalarField::GeometricBoundaryField& phivPatches = + phiv.boundaryField(); + +const volVectorField::GeometricBoundaryField& Upatches = + U.boundaryField(); + +const surfaceVectorField::GeometricBoundaryField& SfPatches = + mesh.Sf().boundaryField(); forAll(phivPatches, patchI) { diff --git a/applications/solvers/multiphase/compressibleInterDyMFoam/pEqn.H b/applications/solvers/multiphase/compressibleInterDyMFoam/pEqn.H index e6004eb9de..df32583b49 100644 --- a/applications/solvers/multiphase/compressibleInterDyMFoam/pEqn.H +++ b/applications/solvers/multiphase/compressibleInterDyMFoam/pEqn.H @@ -26,7 +26,8 @@ phi = phiU + ( - fvc::interpolate(interface.sigmaK())*fvc::snGrad(alpha1)*mesh.magSf() + fvc::interpolate(interface.sigmaK()) + *fvc::snGrad(alpha1)*mesh.magSf() + fvc::interpolate(rho)*(g & mesh.Sf()) )*rUAf; diff --git a/applications/solvers/multiphase/compressibleInterFoam/alphaEqns.H b/applications/solvers/multiphase/compressibleInterFoam/alphaEqns.H index dd704c0693..f545262767 100644 --- a/applications/solvers/multiphase/compressibleInterFoam/alphaEqns.H +++ b/applications/solvers/multiphase/compressibleInterFoam/alphaEqns.H @@ -59,7 +59,17 @@ alpharScheme ); - MULES::explicitSolve(geometricOneField(), alpha1, phi, phiAlpha1, Sp, Su, 1, 0); + MULES::explicitSolve + ( + geometricOneField(), + alpha1, + phi, + phiAlpha1, + Sp, + Su, + 1, + 0 + ); surfaceScalarField rho1f = fvc::interpolate(rho1); surfaceScalarField rho2f = fvc::interpolate(rho2); diff --git a/applications/solvers/multiphase/compressibleInterFoam/pEqn.H b/applications/solvers/multiphase/compressibleInterFoam/pEqn.H index e6ff713429..335ba473f1 100644 --- a/applications/solvers/multiphase/compressibleInterFoam/pEqn.H +++ b/applications/solvers/multiphase/compressibleInterFoam/pEqn.H @@ -26,7 +26,8 @@ phi = phiU + ( - fvc::interpolate(interface.sigmaK())*fvc::snGrad(alpha1)*mesh.magSf() + fvc::interpolate(interface.sigmaK()) + *fvc::snGrad(alpha1)*mesh.magSf() + fvc::interpolate(rho)*(g & mesh.Sf()) )*rUAf; diff --git a/applications/solvers/multiphase/interFoam/pEqn.H b/applications/solvers/multiphase/interFoam/pEqn.H index 7473848c62..9025c6b7ba 100644 --- a/applications/solvers/multiphase/interFoam/pEqn.H +++ b/applications/solvers/multiphase/interFoam/pEqn.H @@ -15,7 +15,8 @@ phi = phiU + ( - fvc::interpolate(interface.sigmaK())*fvc::snGrad(alpha1)*mesh.magSf() + fvc::interpolate(interface.sigmaK()) + *fvc::snGrad(alpha1)*mesh.magSf() + fvc::interpolate(rho)*(g & mesh.Sf()) )*rUAf; diff --git a/applications/solvers/multiphase/interPhaseChangeFoam/alphaEqn.H b/applications/solvers/multiphase/interPhaseChangeFoam/alphaEqn.H index a232056b8d..8d769a3e38 100644 --- a/applications/solvers/multiphase/interPhaseChangeFoam/alphaEqn.H +++ b/applications/solvers/multiphase/interPhaseChangeFoam/alphaEqn.H @@ -50,9 +50,29 @@ + vDotcAlphal ); - //MULES::explicitSolve(alpha1, phi, phiAlpha, 1, 0); - //MULES::explicitSolve(geometricOneField(), alpha1, phi, phiAlpha, Sp, Su, 1, 0); - MULES::implicitSolve(geometricOneField(), alpha1, phi, phiAlpha, Sp, Su, 1, 0); + // MULES::explicitSolve(alpha1, phi, phiAlpha, 1, 0); + // MULES::explicitSolve + // ( + // geometricOneField(), + // alpha1, + // phi, + // phiAlpha, + // Sp, + // Su, + // 1, + // 0 + // ); + MULES::implicitSolve + ( + geometricOneField(), + alpha1, + phi, + phiAlpha, + Sp, + Su, + 1, + 0 + ); rhoPhi += (runTime.deltaT()/totalDeltaT) diff --git a/applications/solvers/multiphase/interPhaseChangeFoam/pEqn.H b/applications/solvers/multiphase/interPhaseChangeFoam/pEqn.H index 519a0b9f65..3c7d47880a 100644 --- a/applications/solvers/multiphase/interPhaseChangeFoam/pEqn.H +++ b/applications/solvers/multiphase/interPhaseChangeFoam/pEqn.H @@ -15,7 +15,8 @@ phi = phiU + ( - fvc::interpolate(interface.sigmaK())*fvc::snGrad(alpha1)*mesh.magSf() + fvc::interpolate(interface.sigmaK()) + *fvc::snGrad(alpha1)*mesh.magSf() + fvc::interpolate(rho)*(g & mesh.Sf()) )*rUAf; diff --git a/applications/solvers/multiphase/twoPhaseEulerFoam/pEqn.H b/applications/solvers/multiphase/twoPhaseEulerFoam/pEqn.H index 7645aeb204..b2bc0d817d 100644 --- a/applications/solvers/multiphase/twoPhaseEulerFoam/pEqn.H +++ b/applications/solvers/multiphase/twoPhaseEulerFoam/pEqn.H @@ -45,7 +45,11 @@ phi = alphaf*phia + betaf*phib; - surfaceScalarField Dp("(rho*(1|A(U)))", alphaf*rUaAf/rhoa + betaf*rUbAf/rhob); + surfaceScalarField Dp + ( + "(rho*(1|A(U)))", + alphaf*rUaAf/rhoa + betaf*rUbAf/rhob + ); for (int nonOrth=0; nonOrth<=nNonOrthCorr; nonOrth++) { diff --git a/applications/test/HashingSpeed/testHashingSpeed.C b/applications/test/HashingSpeed/testHashingSpeed.C index 3d43909d14..1b42b5d34d 100644 --- a/applications/test/HashingSpeed/testHashingSpeed.C +++ b/applications/test/HashingSpeed/testHashingSpeed.C @@ -705,17 +705,22 @@ static uint32_t crc_16_table[16] = { }; /* - * This code was found at: http://wannabe.guru.org/alg/node191.html + * This code was found at: http://wannabe.guru.org/alg/node191.html * and still exists here: http://www.fearme.com/misc/alg/node191.html * * this source code is based on Rex and Binstock which, in turn, * acknowledges William James Hunt. * - * According to the site this CRC uses the polynomial x^16+x^5+x^2+1. - * Unfortunately, DOCSIS uses x^16+x^12+x^5+1. D'oh! + * According to the site this CRC uses the polynomial x^16+x^5+x^2+1. + * Unfortunately, DOCSIS uses x^16+x^12+x^5+1. D'oh! */ -static uint32_t GetCRC16Update (uint32_t start_crc, const char * data_stream, int length) { +static uint32_t GetCRC16Update +( + uint32_t start_crc, + const char * data_stream, + int length +) { uint32_t crc = start_crc; uint32_t r; @@ -740,7 +745,7 @@ uint32_t r; } uint32_t GetCRC16 (const char * data_stream, int length) { - return GetCRC16Update (0, data_stream, length); + return GetCRC16Update (0, data_stream, length); } /* ======================================================================== */ @@ -794,35 +799,40 @@ static void GenerateCRC32Table (void) { register int i, j; register uint32_t crc_accum; - for ( i = 0; i < 256; i++ ) { - crc_accum = ( (unsigned long) i << 24 ); + for ( i = 0; i < 256; i++ ) { + crc_accum = ( (unsigned long) i << 24 ); for ( j = 0; j < 8; j++ ) { - if ( crc_accum & 0x80000000L ) { - crc_accum = ( crc_accum << 1 ) ^ CRC32POLYNOMIAL; - } else { - crc_accum = ( crc_accum << 1 ); - } - } - crc_table[i] = crc_accum; - } - return; + if ( crc_accum & 0x80000000L ) { + crc_accum = ( crc_accum << 1 ) ^ CRC32POLYNOMIAL; + } else { + crc_accum = ( crc_accum << 1 ); + } + } + crc_table[i] = crc_accum; + } + return; } /* update the CRC on the data block one byte at a time */ -static uint32_t UpdateCRC32 (uint32_t crc_accum, const char *data_blk_ptr, int data_blk_size) { +static uint32_t UpdateCRC32 +( + uint32_t crc_accum, + const char *data_blk_ptr, + int data_blk_size +) { register int j; register uint8_t i; - for (j = 0; j < data_blk_size; j++) { - i = (crc_accum >> 24) ^ *data_blk_ptr++; - crc_accum = (crc_accum << 8) ^ crc_table[i]; - } - return crc_accum; + for (j = 0; j < data_blk_size; j++) { + i = (crc_accum >> 24) ^ *data_blk_ptr++; + crc_accum = (crc_accum << 8) ^ crc_table[i]; + } + return crc_accum; } uint32_t GetCRC32 (const char * data_stream, int length) { - return UpdateCRC32 (0, data_stream, length); + return UpdateCRC32 (0, data_stream, length); } /* ======================================================================== */ @@ -835,14 +845,14 @@ int j; uint8_t i0, i1; uint32_t crc_accum0 = 0, crc_accum1 = 0x23456789u; - if (data_blk_size & 1) crc_accum0 ^= *data_blk_ptr++; - for (j = 1; j < data_blk_size; j+=2) { - i0 = ((crc_accum0 >> 24) ^ *data_blk_ptr++); - i1 = ((crc_accum1 >> 24) ^ *data_blk_ptr++); - crc_accum0 = (crc_accum0 << 8) ^ crc_table[i0]; - crc_accum1 = (crc_accum1 << 8) ^ crc_table[i1]; - } - return crc_accum0 + crc_accum1; + if (data_blk_size & 1) crc_accum0 ^= *data_blk_ptr++; + for (j = 1; j < data_blk_size; j+=2) { + i0 = ((crc_accum0 >> 24) ^ *data_blk_ptr++); + i1 = ((crc_accum1 >> 24) ^ *data_blk_ptr++); + crc_accum0 = (crc_accum0 << 8) ^ crc_table[i0]; + crc_accum1 = (crc_accum1 << 8) ^ crc_table[i1]; + } + return crc_accum0 + crc_accum1; } /* ======================================================================== */ @@ -855,11 +865,11 @@ uint32_t FNVHash (const char * data, int len) { int i; uint32_t hash; - hash = 2166136261u; - for (i=0; i < len; i++) { - hash = (16777619u * hash) ^ data[i]; - } - return hash; + hash = 2166136261u; + for (i=0; i < len; i++) { + hash = (16777619u * hash) ^ data[i]; + } + return hash; } /* ======================================================================== */ @@ -872,15 +882,15 @@ uint32_t oneAtATimeHash (const char * s, int len) { int32_t hash; int i; - for (hash = 0, i = 0; i < len; i++) { - hash += s[i]; - hash += (hash << 10); - hash ^= (hash >> 6); /* Non-portable due to ANSI C */ - } - hash += (hash << 3); - hash ^= (hash >> 11); /* Non-portable due to ANSI C */ - hash += (hash << 15); - return (uint32_t) hash; + for (hash = 0, i = 0; i < len; i++) { + hash += s[i]; + hash += (hash << 10); + hash ^= (hash >> 6); /* Non-portable due to ANSI C */ + } + hash += (hash << 3); + hash ^= (hash >> 11); /* Non-portable due to ANSI C */ + hash += (hash << 15); + return (uint32_t) hash; } /* ======================================================================== */ @@ -889,23 +899,23 @@ uint32_t oneAtATimeHashPH (const char * s, int len) { int32_t hash0 = 0, hash1 = 0x23456789; int i; - if (len & 1) hash1 ^= *s++; + if (len & 1) hash1 ^= *s++; - for (i = 1; i < len; i+=2) { - hash0 += *s++; - hash1 += *s++; - hash0 += (hash0 << 10); - hash1 += (hash1 << 10); - hash0 ^= (hash0 >> 6); /* Non-portable due to ANSI C */ - hash1 ^= (hash1 >> 6); /* Non-portable due to ANSI C */ - } + for (i = 1; i < len; i+=2) { + hash0 += *s++; + hash1 += *s++; + hash0 += (hash0 << 10); + hash1 += (hash1 << 10); + hash0 ^= (hash0 >> 6); /* Non-portable due to ANSI C */ + hash1 ^= (hash1 >> 6); /* Non-portable due to ANSI C */ + } - hash0 += hash1; + hash0 += hash1; - hash0 += (hash0 << 3); - hash0 ^= (hash0 >> 11); /* Non-portable due to ANSI C */ - hash0 += (hash0 << 15); - return (uint32_t) hash0; + hash0 += (hash0 << 3); + hash0 ^= (hash0 >> 11); /* Non-portable due to ANSI C */ + hash0 += (hash0 << 15); + return (uint32_t) hash0; } /* ======================================================================== */ @@ -1029,42 +1039,42 @@ static char buff[BUFF_SZ]; clock_t c0, c1; int32_t i; - for (buff[0]=0, i=1; i < BUFF_SZ; i++) buff[i] = (char) (i + buff[i-1]); + for (buff[0]=0, i=1; i < BUFF_SZ; i++) buff[i] = (char) (i + buff[i-1]); - c0 = clock (); - for (i=0; i < NTESTS; i++) hash (buff, BUFF_SZ); - c1 = clock (); - return (c1 - c0)*(1.0 / (double)CLOCKS_PER_SEC); + c0 = clock (); + for (i=0; i < NTESTS; i++) hash (buff, BUFF_SZ); + c1 = clock (); + return (c1 - c0)*(1.0 / (double)CLOCKS_PER_SEC); } struct tagtest { - double res; - char * name; - hashFn hash; + double res; + char * name; + hashFn hash; } tests[] = { -// { 0.0, "CRC32\t\t", GetCRC32 }, -// { 0.0, "oneAtATimeHash\t", oneAtATimeHash }, -// { 0.0, "alphaNumHash\t", alphaNumHash }, - { 0.0, "FNVHash\t\t", FNVHash }, - { 0.0, "bernstein\t", bernstein }, - { 0.0, "stroustrup\t", stroustrup }, - { 0.0, "hashLookup3\t", hashLookup3 }, - { 0.0, "hashLookup3Orig\t", hashLookup3Orig }, - { 0.0, "SuperFastHash\t", SuperFastHash }, - { 0.0, NULL, NULL } +// { 0.0, "CRC32\t\t", GetCRC32 }, +// { 0.0, "oneAtATimeHash\t", oneAtATimeHash }, +// { 0.0, "alphaNumHash\t", alphaNumHash }, + { 0.0, "FNVHash\t\t", FNVHash }, + { 0.0, "bernstein\t", bernstein }, + { 0.0, "stroustrup\t", stroustrup }, + { 0.0, "hashLookup3\t", hashLookup3 }, + { 0.0, "hashLookup3Orig\t", hashLookup3Orig }, + { 0.0, "SuperFastHash\t", SuperFastHash }, + { 0.0, NULL, NULL } }; int main () { int i, j; - GenerateCRC32Table (); + GenerateCRC32Table (); - for (j=0; tests[j].name != NULL; j++) { - for (i=0; i < 3; i++) { - double res = test (tests[j].hash); - if (tests[j].res == 0.0 || tests[j].res > res) tests[j].res = res; - } - printf ("%s:%8.4fs\n", tests[j].name, tests[j].res); - } + for (j=0; tests[j].name != NULL; j++) { + for (i=0; i < 3; i++) { + double res = test (tests[j].hash); + if (tests[j].res == 0.0 || tests[j].res > res) tests[j].res = res; + } + printf ("%s:%8.4fs\n", tests[j].name, tests[j].res); + } - return 0; + return 0; } diff --git a/applications/test/PackedList/PackedListTest.C b/applications/test/PackedList/PackedListTest.C index a1cfae3eba..ad5c7b3342 100644 --- a/applications/test/PackedList/PackedListTest.C +++ b/applications/test/PackedList/PackedListTest.C @@ -53,12 +53,15 @@ inline void reportInfo() << " utilization: " << (nBits * offset) << nl; Info<< " Masking:" << nl - << " shift << " << unsigned(nBits * offset) << nl - << " shift >> " << unsigned((sizeof(unsigned)*CHAR_BIT) - nBits * offset) + << " shift << " + << unsigned(nBits * offset) << nl + << " shift >> " + << unsigned((sizeof(unsigned)*CHAR_BIT) - nBits * offset) << nl; hex(Info); - Info<< " maskLower: " << PackedList::maskLower(PackedList::packing()) + Info<< " maskLower: " + << PackedList::maskLower(PackedList::packing()) << nl << " useSHL: " << useSHL << nl << " useSHR: " << useSHR << nl; diff --git a/applications/test/dictionary/dictionaryTest.C b/applications/test/dictionary/dictionaryTest.C index ea81737281..8f2ddb3f1f 100644 --- a/applications/test/dictionary/dictionaryTest.C +++ b/applications/test/dictionary/dictionaryTest.C @@ -62,11 +62,13 @@ int main(int argc, char *argv[]) dictionary dict2(dict1.xfer()); Info<< "dict1.toc(): " << dict1.name() << " " << dict1.toc() << nl - << "dict2.toc(): " << dict2.name() << " " << dict2.toc() << endl; + << "dict2.toc(): " << dict2.name() << " " << dict2.toc() + << endl; // copy back dict1 = dict2; - Info<< "dict1.toc(): " << dict1.name() << " " << dict1.toc() << endl; + Info<< "dict1.toc(): " << dict1.name() << " " << dict1.toc() + << endl; dictionary dict3(dict2.subDictPtr("boundaryField")); dictionary dict4(dict2.subDictPtr("NONEXISTENT")); diff --git a/applications/test/quaternion/quaternionTest.C b/applications/test/quaternion/quaternionTest.C index f06ac53a18..df616dfa33 100644 --- a/applications/test/quaternion/quaternionTest.C +++ b/applications/test/quaternion/quaternionTest.C @@ -29,8 +29,11 @@ int main() Info<< "tr.transform(v) " << tr.transform(v) << endl; - Info<< "(septernion(vector(0, -1, 0))*q*septernion(vector(0, 1, 0))).transform(v) " - << (septernion(vector(0, -1, 0))*q*septernion(vector(0, 1, 0))).transform(v) + Info<< "(septernion(vector(0, -1, 0))*q*septernion(vector(0, 1, 0)))" + << ".transform(v) " + << (septernion(vector(0, -1, 0)) + *q + *septernion(vector(0, 1, 0))).transform(v) << endl; return 0; diff --git a/applications/test/readCHEMKINIII/CHEMKINdata/chem.inp_france b/applications/test/readCHEMKINIII/CHEMKINdata/chem.inp_france index 4cf7ee2a3a..7f738b3673 100644 --- a/applications/test/readCHEMKINIII/CHEMKINdata/chem.inp_france +++ b/applications/test/readCHEMKINIII/CHEMKINdata/chem.inp_france @@ -326,7 +326,7 @@ CH3+CH3(+M)=C2H6(+M) 3.6E13 0. 0. !(14,-14) !-------------------------------------------------------------------------------------! !fittings (20/12/94, F. Battin-Leclerc) on CH4-02 system in PSR between 500 and 1300C! !CH3+CH3(+M)=C2H6(+M) 1.5E14 0. 0.! !(14,-14)! -! LOW /5.2E41 -7. 3.0E3/! +! LOW /5.2E41 -7. 3.0E3/! !-------------------------------------------------------------------------------------! TROE /0.62 73. 1180./ CH3+CH3=C2H5+H 3.0E13 0. 13.5E3 !(15,-15) diff --git a/applications/utilities/mesh/conversion/Optional/ccm26ToFoam/ccm26ToFoam.C b/applications/utilities/mesh/conversion/Optional/ccm26ToFoam/ccm26ToFoam.C index decabfeae0..1866e5e114 100644 --- a/applications/utilities/mesh/conversion/Optional/ccm26ToFoam/ccm26ToFoam.C +++ b/applications/utilities/mesh/conversion/Optional/ccm26ToFoam/ccm26ToFoam.C @@ -347,7 +347,8 @@ void ReadProblem char* name = new char[size + 1]; CCMIOReadOptstr(NULL, boundary, "BoundaryName", &size, name); name[size] = '\0'; - foamPatchNames[foamPatchI] = string::validate(string(name)); + foamPatchNames[foamPatchI] = + string::validate(string(name)); delete [] name; } else if @@ -359,7 +360,8 @@ void ReadProblem char* name = new char[size + 1]; CCMIOReadOptstr(NULL, boundary, "Label", &size, name); name[size] = '\0'; - foamPatchNames[foamPatchI] = string::validate(string(name)); + foamPatchNames[foamPatchI] = + string::validate(string(name)); delete [] name; } else @@ -641,7 +643,13 @@ int main(int argc, char *argv[]) // in NULL (which always means kCCMIONoErr) and then assign the return // value to 'err'.). CCMIOID root; - CCMIOError err = CCMIOOpenFile(NULL, ccmFile.c_str(), kCCMIORead, &root); + CCMIOError err = CCMIOOpenFile + ( + NULL, + ccmFile.c_str(), + kCCMIORead, + &root + ); // We are going to assume that we have a state with a known name. // We could instead use CCMIONextEntity() to walk through all the diff --git a/applications/utilities/mesh/conversion/gmshToFoam/gmshToFoam.C b/applications/utilities/mesh/conversion/gmshToFoam/gmshToFoam.C index fa1fe3b041..c36a41a546 100644 --- a/applications/utilities/mesh/conversion/gmshToFoam/gmshToFoam.C +++ b/applications/utilities/mesh/conversion/gmshToFoam/gmshToFoam.C @@ -236,7 +236,9 @@ void storeCellInZone // Reads mesh format scalar readMeshFormat(IFstream& inFile) { - Info<< "Starting to read mesh format at line " << inFile.lineNumber() << endl; + Info<< "Starting to read mesh format at line " + << inFile.lineNumber() + << endl; string line; inFile.getLine(line); @@ -1086,4 +1088,3 @@ int main(int argc, char *argv[]) // ************************************************************************* // - diff --git a/applications/utilities/mesh/generation/extrudeToRegionMesh/nonuniformTransformCyclic/fvPatchFields/constraint/nonuniformTransformCyclic/nonuniformTransformCyclicFvPatchField.C b/applications/utilities/mesh/generation/extrudeToRegionMesh/nonuniformTransformCyclic/fvPatchFields/constraint/nonuniformTransformCyclic/nonuniformTransformCyclicFvPatchField.C index 3de2331de3..53e32fc9e9 100644 --- a/applications/utilities/mesh/generation/extrudeToRegionMesh/nonuniformTransformCyclic/fvPatchFields/constraint/nonuniformTransformCyclic/nonuniformTransformCyclicFvPatchField.C +++ b/applications/utilities/mesh/generation/extrudeToRegionMesh/nonuniformTransformCyclic/fvPatchFields/constraint/nonuniformTransformCyclic/nonuniformTransformCyclicFvPatchField.C @@ -33,7 +33,8 @@ namespace Foam // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // template -nonuniformTransformCyclicFvPatchField::nonuniformTransformCyclicFvPatchField +nonuniformTransformCyclicFvPatchField:: +nonuniformTransformCyclicFvPatchField ( const fvPatch& p, const DimensionedField& iF @@ -44,7 +45,8 @@ nonuniformTransformCyclicFvPatchField::nonuniformTransformCyclicFvPatchFie template -nonuniformTransformCyclicFvPatchField::nonuniformTransformCyclicFvPatchField +nonuniformTransformCyclicFvPatchField:: +nonuniformTransformCyclicFvPatchField ( const nonuniformTransformCyclicFvPatchField& ptf, const fvPatch& p, @@ -57,7 +59,8 @@ nonuniformTransformCyclicFvPatchField::nonuniformTransformCyclicFvPatchFie template -nonuniformTransformCyclicFvPatchField::nonuniformTransformCyclicFvPatchField +nonuniformTransformCyclicFvPatchField:: +nonuniformTransformCyclicFvPatchField ( const fvPatch& p, const DimensionedField& iF, @@ -69,7 +72,8 @@ nonuniformTransformCyclicFvPatchField::nonuniformTransformCyclicFvPatchFie template -nonuniformTransformCyclicFvPatchField::nonuniformTransformCyclicFvPatchField +nonuniformTransformCyclicFvPatchField:: +nonuniformTransformCyclicFvPatchField ( const nonuniformTransformCyclicFvPatchField& ptf ) @@ -79,7 +83,8 @@ nonuniformTransformCyclicFvPatchField::nonuniformTransformCyclicFvPatchFie template -nonuniformTransformCyclicFvPatchField::nonuniformTransformCyclicFvPatchField +nonuniformTransformCyclicFvPatchField:: +nonuniformTransformCyclicFvPatchField ( const nonuniformTransformCyclicFvPatchField& ptf, const DimensionedField& iF diff --git a/applications/utilities/mesh/generation/extrudeToRegionMesh/nonuniformTransformCyclic/fvPatchFields/constraint/nonuniformTransformCyclic/nonuniformTransformCyclicFvPatchField.H b/applications/utilities/mesh/generation/extrudeToRegionMesh/nonuniformTransformCyclic/fvPatchFields/constraint/nonuniformTransformCyclic/nonuniformTransformCyclicFvPatchField.H index e609935b09..71dc50096b 100644 --- a/applications/utilities/mesh/generation/extrudeToRegionMesh/nonuniformTransformCyclic/fvPatchFields/constraint/nonuniformTransformCyclic/nonuniformTransformCyclicFvPatchField.H +++ b/applications/utilities/mesh/generation/extrudeToRegionMesh/nonuniformTransformCyclic/fvPatchFields/constraint/nonuniformTransformCyclic/nonuniformTransformCyclicFvPatchField.H @@ -44,7 +44,7 @@ namespace Foam { /*---------------------------------------------------------------------------*\ - Class nonuniformTransformCyclicFvPatch Declaration + Class nonuniformTransformCyclicFvPatch Declaration \*---------------------------------------------------------------------------*/ template @@ -77,7 +77,8 @@ public: const dictionary& ); - //- Construct by mapping given nonuniformTransformCyclicFvPatchField onto a new patch + //- Construct by mapping given + // nonuniformTransformCyclicFvPatchField onto a new patch nonuniformTransformCyclicFvPatchField ( const nonuniformTransformCyclicFvPatchField&, diff --git a/applications/utilities/mesh/generation/extrudeToRegionMesh/nonuniformTransformCyclic/fvPatches/constraint/nonuniformTransformCyclic/nonuniformTransformCyclicFvPatch.C b/applications/utilities/mesh/generation/extrudeToRegionMesh/nonuniformTransformCyclic/fvPatches/constraint/nonuniformTransformCyclic/nonuniformTransformCyclicFvPatch.C index d8f83fd610..b641981dfd 100644 --- a/applications/utilities/mesh/generation/extrudeToRegionMesh/nonuniformTransformCyclic/fvPatches/constraint/nonuniformTransformCyclic/nonuniformTransformCyclicFvPatch.C +++ b/applications/utilities/mesh/generation/extrudeToRegionMesh/nonuniformTransformCyclic/fvPatches/constraint/nonuniformTransformCyclic/nonuniformTransformCyclicFvPatch.C @@ -34,7 +34,12 @@ namespace Foam // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // defineTypeNameAndDebug(nonuniformTransformCyclicFvPatch, 0); -addToRunTimeSelectionTable(fvPatch, nonuniformTransformCyclicFvPatch, polyPatch); +addToRunTimeSelectionTable +( + fvPatch, + nonuniformTransformCyclicFvPatch, + polyPatch +); // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // diff --git a/applications/utilities/mesh/generation/extrudeToRegionMesh/nonuniformTransformCyclic/fvPatches/constraint/nonuniformTransformCyclic/nonuniformTransformCyclicFvPatch.H b/applications/utilities/mesh/generation/extrudeToRegionMesh/nonuniformTransformCyclic/fvPatches/constraint/nonuniformTransformCyclic/nonuniformTransformCyclicFvPatch.H index 52cf154f11..feb43fa416 100644 --- a/applications/utilities/mesh/generation/extrudeToRegionMesh/nonuniformTransformCyclic/fvPatches/constraint/nonuniformTransformCyclic/nonuniformTransformCyclicFvPatch.H +++ b/applications/utilities/mesh/generation/extrudeToRegionMesh/nonuniformTransformCyclic/fvPatches/constraint/nonuniformTransformCyclic/nonuniformTransformCyclicFvPatch.H @@ -44,7 +44,7 @@ namespace Foam { /*---------------------------------------------------------------------------*\ - Class nonuniformTransformCyclicFvPatch Declaration + Class nonuniformTransformCyclicFvPatch Declaration \*---------------------------------------------------------------------------*/ class nonuniformTransformCyclicFvPatch @@ -61,7 +61,11 @@ public: // Constructors //- Construct from polyPatch - nonuniformTransformCyclicFvPatch(const polyPatch& patch, const fvBoundaryMesh& bm) + nonuniformTransformCyclicFvPatch + ( + const polyPatch& patch, + const fvBoundaryMesh& bm + ) : cyclicFvPatch(patch, bm) {} diff --git a/applications/utilities/mesh/generation/extrudeToRegionMesh/nonuniformTransformCyclic/fvsPatchFields/constraint/nonuniformTransformCyclic/nonuniformTransformCyclicFvsPatchField.C b/applications/utilities/mesh/generation/extrudeToRegionMesh/nonuniformTransformCyclic/fvsPatchFields/constraint/nonuniformTransformCyclic/nonuniformTransformCyclicFvsPatchField.C index c5feba62a7..12bb361ac8 100644 --- a/applications/utilities/mesh/generation/extrudeToRegionMesh/nonuniformTransformCyclic/fvsPatchFields/constraint/nonuniformTransformCyclic/nonuniformTransformCyclicFvsPatchField.C +++ b/applications/utilities/mesh/generation/extrudeToRegionMesh/nonuniformTransformCyclic/fvsPatchFields/constraint/nonuniformTransformCyclic/nonuniformTransformCyclicFvsPatchField.C @@ -33,7 +33,8 @@ namespace Foam // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // template -nonuniformTransformCyclicFvsPatchField::nonuniformTransformCyclicFvsPatchField +nonuniformTransformCyclicFvsPatchField:: +nonuniformTransformCyclicFvsPatchField ( const fvPatch& p, const DimensionedField& iF @@ -44,7 +45,8 @@ nonuniformTransformCyclicFvsPatchField::nonuniformTransformCyclicFvsPatchF template -nonuniformTransformCyclicFvsPatchField::nonuniformTransformCyclicFvsPatchField +nonuniformTransformCyclicFvsPatchField:: +nonuniformTransformCyclicFvsPatchField ( const nonuniformTransformCyclicFvsPatchField& ptf, const fvPatch& p, @@ -57,7 +59,8 @@ nonuniformTransformCyclicFvsPatchField::nonuniformTransformCyclicFvsPatchF template -nonuniformTransformCyclicFvsPatchField::nonuniformTransformCyclicFvsPatchField +nonuniformTransformCyclicFvsPatchField:: +nonuniformTransformCyclicFvsPatchField ( const fvPatch& p, const DimensionedField& iF, @@ -69,7 +72,8 @@ nonuniformTransformCyclicFvsPatchField::nonuniformTransformCyclicFvsPatchF template -nonuniformTransformCyclicFvsPatchField::nonuniformTransformCyclicFvsPatchField +nonuniformTransformCyclicFvsPatchField:: +nonuniformTransformCyclicFvsPatchField ( const nonuniformTransformCyclicFvsPatchField& ptf ) @@ -79,7 +83,8 @@ nonuniformTransformCyclicFvsPatchField::nonuniformTransformCyclicFvsPatchF template -nonuniformTransformCyclicFvsPatchField::nonuniformTransformCyclicFvsPatchField +nonuniformTransformCyclicFvsPatchField:: +nonuniformTransformCyclicFvsPatchField ( const nonuniformTransformCyclicFvsPatchField& ptf, const DimensionedField& iF diff --git a/applications/utilities/mesh/generation/extrudeToRegionMesh/nonuniformTransformCyclic/fvsPatchFields/constraint/nonuniformTransformCyclic/nonuniformTransformCyclicFvsPatchField.H b/applications/utilities/mesh/generation/extrudeToRegionMesh/nonuniformTransformCyclic/fvsPatchFields/constraint/nonuniformTransformCyclic/nonuniformTransformCyclicFvsPatchField.H index 30ee254b09..bb78c7cc03 100644 --- a/applications/utilities/mesh/generation/extrudeToRegionMesh/nonuniformTransformCyclic/fvsPatchFields/constraint/nonuniformTransformCyclic/nonuniformTransformCyclicFvsPatchField.H +++ b/applications/utilities/mesh/generation/extrudeToRegionMesh/nonuniformTransformCyclic/fvsPatchFields/constraint/nonuniformTransformCyclic/nonuniformTransformCyclicFvsPatchField.H @@ -44,7 +44,7 @@ namespace Foam { /*---------------------------------------------------------------------------*\ - Class nonuniformTransformCyclicFvsPatch Declaration + Class nonuniformTransformCyclicFvsPatch Declaration \*---------------------------------------------------------------------------*/ template @@ -76,7 +76,8 @@ public: const dictionary& ); - //- Construct by mapping given nonuniformTransformCyclicFvsPatchField onto a new patch + //- Construct by mapping given + // nonuniformTransformCyclicFvsPatchField onto a new patch nonuniformTransformCyclicFvsPatchField ( const nonuniformTransformCyclicFvsPatchField&, diff --git a/applications/utilities/mesh/generation/extrudeToRegionMesh/nonuniformTransformCyclic/pointPatchFields/constraint/nonuniformTransformCyclic/nonuniformTransformCyclicPointPatchField.C b/applications/utilities/mesh/generation/extrudeToRegionMesh/nonuniformTransformCyclic/pointPatchFields/constraint/nonuniformTransformCyclic/nonuniformTransformCyclicPointPatchField.C index 088fffdd5c..129b9822cf 100644 --- a/applications/utilities/mesh/generation/extrudeToRegionMesh/nonuniformTransformCyclic/pointPatchFields/constraint/nonuniformTransformCyclic/nonuniformTransformCyclicPointPatchField.C +++ b/applications/utilities/mesh/generation/extrudeToRegionMesh/nonuniformTransformCyclic/pointPatchFields/constraint/nonuniformTransformCyclic/nonuniformTransformCyclicPointPatchField.C @@ -35,7 +35,8 @@ namespace Foam // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // template -nonuniformTransformCyclicPointPatchField::nonuniformTransformCyclicPointPatchField +nonuniformTransformCyclicPointPatchField:: +nonuniformTransformCyclicPointPatchField ( const pointPatch& p, const DimensionedField& iF @@ -46,7 +47,8 @@ nonuniformTransformCyclicPointPatchField::nonuniformTransformCyclicPointPa template -nonuniformTransformCyclicPointPatchField::nonuniformTransformCyclicPointPatchField +nonuniformTransformCyclicPointPatchField:: +nonuniformTransformCyclicPointPatchField ( const pointPatch& p, const DimensionedField& iF, @@ -58,7 +60,8 @@ nonuniformTransformCyclicPointPatchField::nonuniformTransformCyclicPointPa template -nonuniformTransformCyclicPointPatchField::nonuniformTransformCyclicPointPatchField +nonuniformTransformCyclicPointPatchField:: +nonuniformTransformCyclicPointPatchField ( const nonuniformTransformCyclicPointPatchField& ptf, const pointPatch& p, @@ -71,7 +74,8 @@ nonuniformTransformCyclicPointPatchField::nonuniformTransformCyclicPointPa template -nonuniformTransformCyclicPointPatchField::nonuniformTransformCyclicPointPatchField +nonuniformTransformCyclicPointPatchField:: +nonuniformTransformCyclicPointPatchField ( const nonuniformTransformCyclicPointPatchField& ptf, const DimensionedField& iF @@ -84,7 +88,10 @@ nonuniformTransformCyclicPointPatchField::nonuniformTransformCyclicPointPa // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // template -void nonuniformTransformCyclicPointPatchField::evaluate(const Pstream::commsTypes) +void nonuniformTransformCyclicPointPatchField::evaluate +( + const Pstream::commsTypes +) { const vectorField& nHat = this->patch().pointNormals(); diff --git a/applications/utilities/mesh/generation/extrudeToRegionMesh/nonuniformTransformCyclic/polyPatches/constraint/nonuniformTransformCyclic/nonuniformTransformCyclicPolyPatch.C b/applications/utilities/mesh/generation/extrudeToRegionMesh/nonuniformTransformCyclic/polyPatches/constraint/nonuniformTransformCyclic/nonuniformTransformCyclicPolyPatch.C index 80255faa93..ba8895a14f 100644 --- a/applications/utilities/mesh/generation/extrudeToRegionMesh/nonuniformTransformCyclic/polyPatches/constraint/nonuniformTransformCyclic/nonuniformTransformCyclicPolyPatch.C +++ b/applications/utilities/mesh/generation/extrudeToRegionMesh/nonuniformTransformCyclic/polyPatches/constraint/nonuniformTransformCyclic/nonuniformTransformCyclicPolyPatch.C @@ -32,8 +32,18 @@ namespace Foam { defineTypeNameAndDebug(nonuniformTransformCyclicPolyPatch, 0); - addToRunTimeSelectionTable(polyPatch, nonuniformTransformCyclicPolyPatch, word); - addToRunTimeSelectionTable(polyPatch, nonuniformTransformCyclicPolyPatch, dictionary); + addToRunTimeSelectionTable + ( + polyPatch, + nonuniformTransformCyclicPolyPatch, + word + ); + addToRunTimeSelectionTable + ( + polyPatch, + nonuniformTransformCyclicPolyPatch, + dictionary + ); } diff --git a/applications/utilities/mesh/manipulation/splitMeshRegions/splitMeshRegions.C b/applications/utilities/mesh/manipulation/splitMeshRegions/splitMeshRegions.C index 7e3cd14588..66a1f0357a 100644 --- a/applications/utilities/mesh/manipulation/splitMeshRegions/splitMeshRegions.C +++ b/applications/utilities/mesh/manipulation/splitMeshRegions/splitMeshRegions.C @@ -1245,15 +1245,19 @@ label findCorrespondingRegion // { // forAll(cellRegion, cellI) // { -// if (cellRegion[cellI] == regionI && existingZoneID[cellI] != zoneI) +// if +// ( +// cellRegion[cellI] == regionI +// && existingZoneID[cellI] != zoneI +// ) // { // // cellI in regionI but not in zoneI // regionI = -1; // break; // } // } -// // If one in error, all should be in error. Note that branch gets taken -// // on all procs. +// // If one in error, all should be in error. Note that branch +// // gets taken on all procs. // reduce(regionI, minOp