diff --git a/applications/solvers/incompressible/icoDyMFoam/icoDyMFoam.C b/applications/solvers/incompressible/icoDyMFoam/icoDyMFoam.C index 39774a3373..d76d8c9ce4 100644 --- a/applications/solvers/incompressible/icoDyMFoam/icoDyMFoam.C +++ b/applications/solvers/incompressible/icoDyMFoam/icoDyMFoam.C @@ -56,32 +56,35 @@ int main(int argc, char *argv[]) { # include "readControls.H" # include "CourantNo.H" - - p.storePrevIter(); - - // Make the fluxes absolute - fvc::makeAbsolute(phi, U); - # include "setDeltaT.H" runTime++; Info<< "Time = " << runTime.timeName() << nl << endl; - bool meshChanged = mesh.update(); + // Make the fluxes absolute + if (mesh.changing()) + { + phi = fvc::interpolate(U) & mesh.Sf(); + } - if (correctPhi && meshChanged) + mesh.update(); + + if (mesh.changing() && correctPhi) { # include "correctPhi.H" } // Keep the absolute fluxes for use in ddtPhiCorr - surfaceScalarField phiAbs("phiAbs", phi); + surfaceScalarField phiAbs0("phiAbs0", phi); // Make the fluxes relative to the mesh motion - fvc::makeRelative(phi, U); + if (mesh.changing()) + { + fvc::makeRelative(phi, U); + } - if (meshChanged && checkMeshCourantNo) + if (mesh.changing() && checkMeshCourantNo) { # include "meshCourantNo.H" } @@ -89,6 +92,8 @@ int main(int argc, char *argv[]) // --- PIMPLE loop for (int ocorr=0; ocorr::erase(const iterator& cit) delete it.elmtPtr_; // Search back for previous non-zero table entry - while (--it.hashIndex_ >= 0 && !table_[it.hashIndex_]); + while (--it.hashIndex_ >= 0 && !table_[it.hashIndex_]) + {} if (it.hashIndex_ >= 0) { diff --git a/src/OpenFOAM/containers/HashTables/HashTable/HashTableI.H b/src/OpenFOAM/containers/HashTables/HashTable/HashTableI.H index 61c5115fa3..8dd4d701fd 100644 --- a/src/OpenFOAM/containers/HashTables/HashTable/HashTableI.H +++ b/src/OpenFOAM/containers/HashTables/HashTable/HashTableI.H @@ -220,7 +220,8 @@ HashTable::iterator::operator++() ( ++hashIndex_ < curHashTable_.tableSize_ && !(elmtPtr_ = curHashTable_.table_[hashIndex_]) - ); + ) + {} if (hashIndex_ == curHashTable_.tableSize_) { @@ -259,7 +260,8 @@ HashTable::begin() { label i = 0; - while (table_ && !table_[i] && ++i < tableSize_); + while (table_ && !table_[i] && ++i < tableSize_) + {} if (i == tableSize_) { @@ -396,7 +398,8 @@ HashTable::const_iterator::operator++() ( ++hashIndex_ < curHashTable_.tableSize_ && !(elmtPtr_ = curHashTable_.table_[hashIndex_]) - ); + ) + {} } return *this; @@ -430,7 +433,8 @@ HashTable::begin() const { label i = 0; - while (table_ && !table_[i] && ++i < tableSize_); + while (table_ && !table_[i] && ++i < tableSize_) + {} if (i == tableSize_) { diff --git a/src/OpenFOAM/global/argList/argList.C b/src/OpenFOAM/global/argList/argList.C index 5cfea717fb..93a49c5daf 100644 --- a/src/OpenFOAM/global/argList/argList.C +++ b/src/OpenFOAM/global/argList/argList.C @@ -34,6 +34,7 @@ License #include "JobInfo.H" #include "labelList.H" + // * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // namespace Foam @@ -389,7 +390,8 @@ Foam::argList::argList rootPath_/globalCase_/"processor" + name(++nProcDirs) ) - ); + ) + {} if (nProcDirs != Pstream::nProcs()) { diff --git a/src/OpenFOAM/global/new.C b/src/OpenFOAM/global/new.C index 092ce8350d..10d503dc52 100644 --- a/src/OpenFOAM/global/new.C +++ b/src/OpenFOAM/global/new.C @@ -29,6 +29,7 @@ Description #include #include +#include namespace Foam { diff --git a/src/OpenFOAM/interpolations/interpolateXY/interpolateXY.C b/src/OpenFOAM/interpolations/interpolateXY/interpolateXY.C index a14ed8908c..a297f044d7 100644 --- a/src/OpenFOAM/interpolations/interpolateXY/interpolateXY.C +++ b/src/OpenFOAM/interpolations/interpolateXY/interpolateXY.C @@ -64,7 +64,8 @@ Type interpolateXY label n = xOld.size(); label lo = 0; - for (lo=0; lox; ++lo); + for (lo=0; lox; ++lo) + {} label low = lo; if (low < n) @@ -79,7 +80,8 @@ Type interpolateXY } label hi = 0; - for (hi=0; hi class ZoneMesh; @@ -94,7 +92,7 @@ public: // Constructors - //- Read constructor given IOobject and a mesh reference + //- Read constructor given IOobject and a MeshType reference ZoneMesh ( const IOobject&, diff --git a/src/OpenFOAM/meshes/primitiveShapes/triangle/triangleI.H b/src/OpenFOAM/meshes/primitiveShapes/triangle/triangleI.H index 9e5fc5d675..406fd98e8e 100644 --- a/src/OpenFOAM/meshes/primitiveShapes/triangle/triangleI.H +++ b/src/OpenFOAM/meshes/primitiveShapes/triangle/triangleI.H @@ -272,7 +272,7 @@ inline vector triangle::circumCentre() const scalar c = c1 + c2 + c3; - return + return ( ((c2 + c3)*a_ + (c3 + c1)*b_ + (c1 + c2)*c_)/(2*c) ); @@ -397,7 +397,7 @@ inline pointHit triangle::ray bool eligible = alg == intersection::FULL_RAY - || alg == intersection::HALF_RAY && dist > -planarPointTol + || (alg == intersection::HALF_RAY && dist > -planarPointTol) || ( alg == intersection::VISIBLE && ((q1 & normal()) < -VSMALL) @@ -434,7 +434,7 @@ template inline pointHit triangle::intersection ( const point& orig, - const vector& dir, + const vector& dir, const intersection::algorithm alg ) const { @@ -617,7 +617,7 @@ inline bool triangle::classify scalar beta = 0; bool hit = false; - + if (Foam::mag(u1) < SMALL) { beta = u0/u2; diff --git a/src/OpenFOAM/primitives/longLong/longLongIO.C b/src/OpenFOAM/primitives/longLong/longLongIO.C index 91dbae80ca..38486f4149 100644 --- a/src/OpenFOAM/primitives/longLong/longLongIO.C +++ b/src/OpenFOAM/primitives/longLong/longLongIO.C @@ -73,7 +73,8 @@ long long readLongLong(Istream& is) static const label zeroOffset = int('0'); // Get next non-whitespace character - while (is.read(c) && isspace(c)); + while (is.read(c) && isspace(c)) + {} do { diff --git a/src/OpenFOAM/primitives/strings/string/string.H b/src/OpenFOAM/primitives/strings/string/string.H index 976ffdbd78..b83eb1a846 100644 --- a/src/OpenFOAM/primitives/strings/string/string.H +++ b/src/OpenFOAM/primitives/strings/string/string.H @@ -49,6 +49,8 @@ SourceFiles #include "char.H" #include +#include +#include // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // diff --git a/src/OpenFOAM/primitives/strings/string/stringI.H b/src/OpenFOAM/primitives/strings/string/stringI.H index 1e18afd020..af0725fb60 100644 --- a/src/OpenFOAM/primitives/strings/string/stringI.H +++ b/src/OpenFOAM/primitives/strings/string/stringI.H @@ -103,7 +103,7 @@ inline bool Foam::string::stripInvalid(string& s) ++nValid; } } - + s.resize(nValid); return true; diff --git a/src/finiteVolume/finiteVolume/ddtSchemes/EulerDdtScheme/EulerDdtScheme.C b/src/finiteVolume/finiteVolume/ddtSchemes/EulerDdtScheme/EulerDdtScheme.C index ee3381932e..3e0d85a3f6 100644 --- a/src/finiteVolume/finiteVolume/ddtSchemes/EulerDdtScheme/EulerDdtScheme.C +++ b/src/finiteVolume/finiteVolume/ddtSchemes/EulerDdtScheme/EulerDdtScheme.C @@ -471,8 +471,8 @@ EulerDdtScheme::fvcDdtPhiCorr ( rA*rho.oldTime()*U.oldTime() ) & mesh().Sf() - ) - ) + ) + ) ) ); } diff --git a/src/lagrangian/basic/Cloud/Cloud.H b/src/lagrangian/basic/Cloud/Cloud.H index c26c592fe0..a0d8b8d9cb 100644 --- a/src/lagrangian/basic/Cloud/Cloud.H +++ b/src/lagrangian/basic/Cloud/Cloud.H @@ -180,7 +180,7 @@ public: return meshInfo_; } - const label size() const + label size() const { return IDLList::size(); }; diff --git a/src/meshTools/indexedOctree/indexedOctree.C b/src/meshTools/indexedOctree/indexedOctree.C index 69b77e91d1..811cff5cd7 100644 --- a/src/meshTools/indexedOctree/indexedOctree.C +++ b/src/meshTools/indexedOctree/indexedOctree.C @@ -1055,7 +1055,7 @@ pointIndexHit indexedOctree::findLine direction startBit = treeBb.posBits(start); direction endBit = treeBb.posBits(end); - if (startBit&endBit != 0) + if ((startBit & endBit) != 0) { // Both start and end outside domain and in same block. return pointIndexHit(false, vector::zero, -1); diff --git a/src/meshTools/triSurface/triSurfaceTools/geompack/geompack.C b/src/meshTools/triSurface/triSurfaceTools/geompack/geompack.C index 30d5ebb6cd..790433d418 100644 --- a/src/meshTools/triSurface/triSurfaceTools/geompack/geompack.C +++ b/src/meshTools/triSurface/triSurfaceTools/geompack/geompack.C @@ -4,6 +4,7 @@ # include # include # include +# include using namespace std; @@ -24,7 +25,7 @@ double d_epsilon ( void ) // D_EPSILON is a number R which is a power of 2 with the property that, // to the precision of the computer's arithmetic, // 1 < 1 + R -// but +// but // 1 = ( 1 + R / 2 ) // // Modified: @@ -79,7 +80,7 @@ double d_max ( double x, double y ) if ( y < x ) { return x; - } + } else { return y; @@ -113,7 +114,7 @@ double d_min ( double x, double y ) if ( y < x ) { return y; - } + } else { return x; @@ -623,7 +624,7 @@ void d2vec_sort_quick_a ( int n, double a[] ) } //****************************************************************************** -int diaedg ( double x0, double y0, double x1, double y1, double x2, double y2, +int diaedg ( double x0, double y0, double x1, double y1, double x2, double y2, double x3, double y3 ) //****************************************************************************** @@ -660,7 +661,7 @@ int diaedg ( double x0, double y0, double x1, double y1, double x2, double y2, // // Parameters: // -// Input, double X0, Y0, X1, Y1, X2, Y2, X3, Y3, the coordinates of the +// Input, double X0, Y0, X1, Y1, X2, Y2, X3, Y3, the coordinates of the // vertices of a quadrilateral, given in counter clockwise order. // // Output, int DIAEDG, chooses a diagonal: @@ -696,12 +697,12 @@ int diaedg ( double x0, double y0, double x1, double y1, double x2, double y2, dx32 = x3 - x2; dy32 = y3 - y2; - tola = tol * d_max ( fabs ( dx10 ), - d_max ( fabs ( dy10 ), + tola = tol * d_max ( fabs ( dx10 ), + d_max ( fabs ( dy10 ), d_max ( fabs ( dx30 ), fabs ( dy30 ) ) ) ); - tolb = tol * d_max ( fabs ( dx12 ), - d_max ( fabs ( dy12 ), + tolb = tol * d_max ( fabs ( dx12 ), + d_max ( fabs ( dy12 ), d_max ( fabs ( dx32 ), fabs ( dy32 ) ) ) ); ca = dx10 * dx30 + dy10 * dy30; @@ -718,7 +719,7 @@ int diaedg ( double x0, double y0, double x1, double y1, double x2, double y2, else { tola = d_max ( tola, tolb ); - s = ( dx10 * dy30 - dx30 * dy10 ) * cb + s = ( dx10 * dy30 - dx30 * dy10 ) * cb + ( dx32 * dy12 - dx12 * dy32 ) * ca; if ( tola < s ) @@ -771,7 +772,7 @@ void dmat_transpose_print ( int m, int n, double a[], const char *title ) } //****************************************************************************** -void dmat_transpose_print_some ( int m, int n, double a[], int ilo, int jlo, +void dmat_transpose_print_some ( int m, int n, double a[], int ilo, int jlo, int ihi, int jhi, const char *title ) //****************************************************************************** @@ -909,7 +910,7 @@ void dmat_uniform ( int m, int n, double b, double c, int *seed, double r[] ) // // Input/output, int *SEED, the "seed" value. Normally, this // value should not be 0, otherwise the output value of SEED -// will still be 0, and D_UNIFORM will be 0. On output, SEED has +// will still be 0, and D_UNIFORM will be 0. On output, SEED has // been updated. // // Output, double DMAT_UNIFORM[M*N], a matrix of pseudorandom values. @@ -943,7 +944,7 @@ void dmat_uniform ( int m, int n, double b, double c, int *seed, double r[] ) } //****************************************************************************** -int dtris2 ( int point_num, double point_xy[], int *tri_num, +int dtris2 ( int point_num, double point_xy[], int *tri_num, int tri_vert[], int tri_nabe[] ) //****************************************************************************** @@ -1046,11 +1047,11 @@ int dtris2 ( int point_num, double point_xy[], int *tri_num, for ( j = 0; j <= 1; j++ ) { - cmax = d_max ( fabs ( point_xy[2*(m-1)+j] ), + cmax = d_max ( fabs ( point_xy[2*(m-1)+j] ), fabs ( point_xy[2*(m1-1)+j] ) ); - if ( tol * ( cmax + 1.0 ) - < fabs ( point_xy[2*(m-1)+j] - point_xy[2*(m1-1)+j] ) ) + if ( tol * ( cmax + 1.0 ) + < fabs ( point_xy[2*(m-1)+j] - point_xy[2*(m1-1)+j] ) ) { k = j; break; @@ -1095,7 +1096,7 @@ int dtris2 ( int point_num, double point_xy[], int *tri_num, m = j; lr = lrline ( point_xy[2*(m-1)+0], point_xy[2*(m-1)+1], - point_xy[2*(m1-1)+0], point_xy[2*(m1-1)+1], + point_xy[2*(m1-1)+0], point_xy[2*(m1-1)+1], point_xy[2*(m2-1)+0], point_xy[2*(m2-1)+1], 0.0 ); if ( lr != 0 ) @@ -1182,8 +1183,8 @@ int dtris2 ( int point_num, double point_xy[], int *tri_num, m2 = tri_vert[3*(ltri-1)+0]; } - lr = lrline ( point_xy[2*(m-1)+0], point_xy[2*(m-1)+1], - point_xy[2*(m1-1)+0], point_xy[2*(m1-1)+1], + lr = lrline ( point_xy[2*(m-1)+0], point_xy[2*(m-1)+1], + point_xy[2*(m1-1)+0], point_xy[2*(m1-1)+1], point_xy[2*(m2-1)+0], point_xy[2*(m2-1)+1], 0.0 ); if ( 0 < lr ) @@ -1199,7 +1200,7 @@ int dtris2 ( int point_num, double point_xy[], int *tri_num, redg = (l % 3) + 1; } - vbedg ( point_xy[2*(m-1)+0], point_xy[2*(m-1)+1], point_num, + vbedg ( point_xy[2*(m-1)+0], point_xy[2*(m-1)+1], point_num, point_xy, *tri_num, tri_vert, tri_nabe, <ri, &ledg, &rtri, &redg ); n = *tri_num + 1; @@ -1255,7 +1256,7 @@ int dtris2 ( int point_num, double point_xy[], int *tri_num, ltri = n; ledg = 2; - error = swapec ( m, &top, <ri, &ledg, point_num, point_xy, *tri_num, + error = swapec ( m, &top, <ri, &ledg, point_num, point_xy, *tri_num, tri_vert, tri_nabe, stack ); if ( error != 0 ) @@ -1473,9 +1474,9 @@ void dvec_print ( int n, double a[], const char *title ) } cout << "\n"; - for ( i = 0; i <= n-1; i++ ) + for ( i = 0; i <= n-1; i++ ) { - cout << setw(6) << i + 1 << " " + cout << setw(6) << i + 1 << " " << setw(14) << a[i] << "\n"; } @@ -1600,8 +1601,8 @@ int i_modp ( int i, int j ) // // Formula: // -// If -// NREM = I_MODP ( I, J ) +// If +// NREM = I_MODP ( I, J ) // NMULT = ( I - NREM ) / J // then // I = J * NMULT + NREM @@ -1620,7 +1621,7 @@ int i_modp ( int i, int j ) // Examples: // // I J MOD I_MODP I_MODP Factorization -// +// // 107 50 7 7 107 = 2 * 50 + 7 // 107 -50 7 7 107 = -2 * -50 + 7 // -107 50 -7 43 -107 = -3 * 50 + 43 @@ -1640,7 +1641,7 @@ int i_modp ( int i, int j ) // // Input, int J, the number that divides I. // -// Output, int I_MODP, the nonnegative remainder when I is +// Output, int I_MODP, the nonnegative remainder when I is // divided by J. // { @@ -1692,7 +1693,7 @@ int i_sign ( int i ) // // Output, int I_SIGN, the sign of I. { - if ( i < 0 ) + if ( i < 0 ) { return (-1); } @@ -1809,7 +1810,7 @@ void imat_transpose_print ( int m, int n, int a[], const char *title ) } //****************************************************************************** -void imat_transpose_print_some ( int m, int n, int a[], int ilo, int jlo, +void imat_transpose_print_some ( int m, int n, int a[], int ilo, int jlo, int ihi, int jhi, const char *title ) //****************************************************************************** @@ -1962,7 +1963,7 @@ void ivec_heap_d ( int n, int a[] ) // Only nodes (N/2)-1 down to 0 can be "parent" nodes. // for ( i = (n/2)-1; 0 <= i; i-- ) - { + { // // Copy the value out of the parent node. // Position IFREE is now "open". @@ -2180,7 +2181,7 @@ void ivec_sorted_unique ( int n, int a[], int *nuniq ) for ( i = 1; i < n; i++ ) { - if ( a[i] != a[*nuniq] ) + if ( a[i] != a[*nuniq] ) { *nuniq = *nuniq + 1; a[*nuniq] = a[i]; @@ -2192,7 +2193,7 @@ void ivec_sorted_unique ( int n, int a[], int *nuniq ) } //****************************************************************************** -int lrline ( double xu, double yu, double xv1, double yv1, double xv2, +int lrline ( double xu, double yu, double xv1, double yv1, double xv2, double yv2, double dv ) //****************************************************************************** @@ -2253,9 +2254,9 @@ int lrline ( double xu, double yu, double xv1, double yv1, double xv2, dxu = xu - xv1; dyu = yu - yv1; - tolabs = tol * d_max ( fabs ( dx ), - d_max ( fabs ( dy ), - d_max ( fabs ( dxu ), + tolabs = tol * d_max ( fabs ( dx ), + d_max ( fabs ( dy ), + d_max ( fabs ( dxu ), d_max ( fabs ( dyu ), fabs ( dv ) ) ) ) ); t = dy * dxu - dx * dyu + dv * sqrt ( dx * dx + dy * dy ); @@ -2426,7 +2427,7 @@ int *points_delaunay_naive_2d ( int n, double p[], int *ntri ) //******************************************************************** // -// Purpose: +// Purpose: // // POINTS_DELAUNAY_NAIVE_2D computes the Delaunay triangulation in 2D. // @@ -2456,7 +2457,7 @@ int *points_delaunay_naive_2d ( int n, double p[], int *ntri ) // // Joseph O'Rourke, // Computational Geometry, -// Cambridge University Press, +// Cambridge University Press, // Second Edition, 1998, page 187. // // Parameters: @@ -2467,7 +2468,7 @@ int *points_delaunay_naive_2d ( int n, double p[], int *ntri ) // // Output, int *NTRI, the number of triangles. // -// Output, int POINTS_DELAUNAY_NAIVE_2D[3*NTRI], the indices of the +// Output, int POINTS_DELAUNAY_NAIVE_2D[3*NTRI], the indices of the // nodes making each triangle. // { @@ -2506,34 +2507,34 @@ int *points_delaunay_naive_2d ( int n, double p[], int *ntri ) // // For each triple (I,J,K): // - for ( i = 0; i < n - 2; i++ ) + for ( i = 0; i < n - 2; i++ ) { - for ( j = i+1; j < n; j++ ) + for ( j = i+1; j < n; j++ ) { - for ( k = i+1; k < n; k++ ) + for ( k = i+1; k < n; k++ ) { - if ( j != k ) + if ( j != k ) { - xn = ( p[1+j*2] - p[1+i*2] ) * ( z[k] - z[i] ) + xn = ( p[1+j*2] - p[1+i*2] ) * ( z[k] - z[i] ) - ( p[1+k*2] - p[1+i*2] ) * ( z[j] - z[i] ); - yn = ( p[0+k*2] - p[0+i*2] ) * ( z[j] - z[i] ) + yn = ( p[0+k*2] - p[0+i*2] ) * ( z[j] - z[i] ) - ( p[0+j*2] - p[0+i*2] ) * ( z[k] - z[i] ); - zn = ( p[0+j*2] - p[0+i*2] ) * ( p[1+k*2] - p[1+i*2] ) + zn = ( p[0+j*2] - p[0+i*2] ) * ( p[1+k*2] - p[1+i*2] ) - ( p[0+k*2] - p[0+i*2] ) * ( p[1+j*2] - p[1+i*2] ); flag = ( zn < 0 ); - if ( flag ) + if ( flag ) { - for ( m = 0; m < n; m++ ) + for ( m = 0; m < n; m++ ) { - flag = flag && ( ( p[0+m*2] - p[0+i*2] ) * xn - + ( p[1+m*2] - p[1+i*2] ) * yn + flag = flag && ( ( p[0+m*2] - p[0+i*2] ) * xn + + ( p[1+m*2] - p[1+i*2] ) * yn + ( z[m] - z[i] ) * zn <= 0 ); } } - if ( flag ) + if ( flag ) { if ( pass == 2 ) { @@ -2545,8 +2546,8 @@ int *points_delaunay_naive_2d ( int n, double p[], int *ntri ) } } - } - } + } + } } } @@ -2587,7 +2588,7 @@ int s_len_trim ( const char *s ) n = strlen ( s ); t = const_cast(s) + n - 1; - while ( 0 < n ) + while ( 0 < n ) { if ( *t != ' ' ) { @@ -2601,8 +2602,8 @@ int s_len_trim ( const char *s ) } //****************************************************************************** -int swapec ( int i, int *top, int *btri, int *bedg, int point_num, - double point_xy[], int tri_num, int tri_vert[], int tri_nabe[], +int swapec ( int i, int *top, int *btri, int *bedg, int point_num, + double point_xy[], int tri_num, int tri_vert[], int tri_nabe[], int stack[] ) //****************************************************************************** @@ -2698,7 +2699,7 @@ int swapec ( int i, int *top, int *btri, int *bedg, int point_num, for ( ; ; ) { - if ( *top <= 0 ) + if ( *top <= 0 ) { break; } @@ -2741,7 +2742,7 @@ int swapec ( int i, int *top, int *btri, int *bedg, int point_num, c = tri_vert[3*(u-1)+1]; } - swap = diaedg ( x, y, + swap = diaedg ( x, y, point_xy[2*(a-1)+0], point_xy[2*(a-1)+1], point_xy[2*(c-1)+0], point_xy[2*(c-1)+1], point_xy[2*(b-1)+0], point_xy[2*(b-1)+1] ); @@ -3021,16 +3022,16 @@ double *triangle_circumcenter_2d ( double t[] ) center = new double[DIM_NUM]; - asq = ( t[0+1*2] - t[0+0*2] ) * ( t[0+1*2] - t[0+0*2] ) + asq = ( t[0+1*2] - t[0+0*2] ) * ( t[0+1*2] - t[0+0*2] ) + ( t[1+1*2] - t[1+0*2] ) * ( t[1+1*2] - t[1+0*2] ); - csq = ( t[0+2*2] - t[0+0*2] ) * ( t[0+2*2] - t[0+0*2] ) + csq = ( t[0+2*2] - t[0+0*2] ) * ( t[0+2*2] - t[0+0*2] ) + ( t[1+2*2] - t[1+0*2] ) * ( t[1+2*2] - t[1+0*2] ); - + top1 = ( t[1+1*2] - t[1+0*2] ) * csq - ( t[1+2*2] - t[1+0*2] ) * asq; top2 = ( t[0+1*2] - t[0+0*2] ) * csq - ( t[0+2*2] - t[0+0*2] ) * asq; - bot = ( t[1+1*2] - t[1+0*2] ) * ( t[0+2*2] - t[0+0*2] ) + bot = ( t[1+1*2] - t[1+0*2] ) * ( t[0+2*2] - t[0+0*2] ) - ( t[1+2*2] - t[1+0*2] ) * ( t[0+1*2] - t[0+0*2] ); center[0] = t[0+0*2] + 0.5 * top1 / bot; @@ -3042,7 +3043,7 @@ double *triangle_circumcenter_2d ( double t[] ) } //****************************************************************************** -bool triangulation_plot_eps ( const char *file_out_name, int g_num, double g_xy[], +bool triangulation_plot_eps ( const char *file_out_name, int g_num, double g_xy[], int tri_num, int nod_tri[] ) //****************************************************************************** @@ -3140,7 +3141,7 @@ bool triangulation_plot_eps ( const char *file_out_name, int g_num, double g_xy[ file_out << "%%Title: " << file_out_name << "\n"; file_out << "%%CreationDate: " << date_time << "\n"; file_out << "%%Pages: 1\n"; - file_out << "%%Bounding Box: " << x_ps_min << " " << y_ps_min << " " + file_out << "%%Bounding Box: " << x_ps_min << " " << y_ps_min << " " << x_ps_max << " " << y_ps_max << "\n"; file_out << "%%Document-Fonts: Times-Roman\n"; file_out << "%%LanguageLevel: 1\n"; @@ -3199,17 +3200,17 @@ bool triangulation_plot_eps ( const char *file_out_name, int g_num, double g_xy[ for ( g = 0; g < g_num; g++ ) { - x_ps = int( - ( ( x_max - g_xy[0+g*2] ) * double( x_ps_min ) - + ( g_xy[0+g*2] - x_min ) * double( x_ps_max ) ) + x_ps = int( + ( ( x_max - g_xy[0+g*2] ) * double( x_ps_min ) + + ( g_xy[0+g*2] - x_min ) * double( x_ps_max ) ) / ( x_max - x_min ) ); - y_ps = int( - ( ( y_max - g_xy[1+g*2] ) * double( y_ps_min ) - + ( g_xy[1+g*2] - y_min ) * double( y_ps_max ) ) + y_ps = int( + ( ( y_max - g_xy[1+g*2] ) * double( y_ps_min ) + + ( g_xy[1+g*2] - y_min ) * double( y_ps_max ) ) / ( y_max - y_min ) ); - file_out << "newpath " << x_ps << " " + file_out << "newpath " << x_ps << " " << y_ps << " 5 0 360 arc closepath fill\n"; } @@ -3231,14 +3232,14 @@ bool triangulation_plot_eps ( const char *file_out_name, int g_num, double g_xy[ k = nod_tri[3*(t-1)+e-1]; - x_ps = int( - ( ( x_max - g_xy[0+(k-1)*2] ) * double( x_ps_min ) - + ( g_xy[0+(k-1)*2] - x_min ) * double( x_ps_max ) ) + x_ps = int( + ( ( x_max - g_xy[0+(k-1)*2] ) * double( x_ps_min ) + + ( g_xy[0+(k-1)*2] - x_min ) * double( x_ps_max ) ) / ( x_max - x_min ) ); - y_ps = int( - ( ( y_max - g_xy[1+(k-1)*2] ) * double( y_ps_min ) - + ( g_xy[1+(k-1)*2] - y_min ) * double( y_ps_max ) ) + y_ps = int( + ( ( y_max - g_xy[1+(k-1)*2] ) * double( y_ps_min ) + + ( g_xy[1+(k-1)*2] - y_min ) * double( y_ps_max ) ) / ( y_max - y_min ) ); if ( j == 1 ) @@ -3269,7 +3270,7 @@ bool triangulation_plot_eps ( const char *file_out_name, int g_num, double g_xy[ } //****************************************************************************** -void triangulation_print ( int point_num, double xc[], int tri_num, +void triangulation_print ( int point_num, double xc[], int tri_num, int tri_vert[], int tri_nabe[] ) //****************************************************************************** @@ -3356,7 +3357,7 @@ void triangulation_print ( int point_num, double xc[], int tri_num, imat_transpose_print ( 3, tri_num, tri_nabe, " Triangle neighbors" ); // -// Determine VERTEX_NUM, the number of vertices. This is not +// Determine VERTEX_NUM, the number of vertices. This is not // the same as the number of points! // vertex_list = new int[3*tri_num]; @@ -3439,7 +3440,7 @@ void triangulation_print ( int point_num, double xc[], int tri_num, } //****************************************************************************** -void vbedg ( double x, double y, int point_num, double point_xy[], int tri_num, +void vbedg ( double x, double y, int point_num, double point_xy[], int tri_num, int tri_vert[], int tri_nabe[], int *ltri, int *ledg, int *rtri, int *redg ) //****************************************************************************** diff --git a/src/thermophysicalModels/combustion/chemistryReaders/chemistryReader/chemistryReader.H b/src/thermophysicalModels/combustion/chemistryReaders/chemistryReader/chemistryReader.H index b6918dcc9b..4c8b26ddb6 100644 --- a/src/thermophysicalModels/combustion/chemistryReaders/chemistryReader/chemistryReader.H +++ b/src/thermophysicalModels/combustion/chemistryReaders/chemistryReader/chemistryReader.H @@ -118,7 +118,7 @@ public: // Member Functions virtual const speciesTable& species() const = 0; - virtual const HashPtrTable& specieThermo() const = 0; + virtual const HashPtrTable& speciesThermo() const = 0; virtual const SLPtrList& reactions() const = 0; }; diff --git a/src/thermophysicalModels/combustion/chemistryReaders/chemkinReader/chemkinLexer.L b/src/thermophysicalModels/combustion/chemistryReaders/chemkinReader/chemkinLexer.L index 552a6ca2d3..1b92fbef70 100644 --- a/src/thermophysicalModels/combustion/chemistryReaders/chemkinReader/chemkinLexer.L +++ b/src/thermophysicalModels/combustion/chemistryReaders/chemkinReader/chemkinLexer.L @@ -607,15 +607,15 @@ bool finishReaction = false; HashPtrTable::iterator specieThermoIter ( - specieThermo_.find(currentSpecieName) + speciesThermo_.find(currentSpecieName) ); - if (specieThermoIter != specieThermo_.end()) + if (specieThermoIter != speciesThermo_.end()) { - specieThermo_.erase(specieThermoIter); + speciesThermo_.erase(specieThermoIter); } - specieThermo_.insert + speciesThermo_.insert ( currentSpecieName, new reactionThermo @@ -742,7 +742,7 @@ bool finishReaction = false; << "Plasma momentum-transfer in reaction on line " << lineNo_ << "not yet supported" << exit(FatalError); - + BEGIN(readReactionKeyword); break; } @@ -894,7 +894,7 @@ bool finishReaction = false; FatalErrorIn("chemkinReader::lex()") << "HIGH keyword given for a chemically" " activated bimolecular reaction which does not" - " contain a pressure dependent specie" + " contain a pressure dependent specie" << " on line " << lineNo_ << exit(FatalError); } @@ -935,7 +935,7 @@ bool finishReaction = false; << exit(FatalError); } - if + if ( fofType == unknownFallOffFunctionType || fofType == Lindemann @@ -969,7 +969,7 @@ bool finishReaction = false; << exit(FatalError); } - if + if ( fofType == unknownFallOffFunctionType || fofType == Lindemann @@ -1046,7 +1046,7 @@ bool finishReaction = false; } rrType = LandauTeller; - reactionCoeffsName = + reactionCoeffsName = word(reactionTypeNames[rType]) + reactionRateTypeNames[rrType]; BEGIN(readReactionCoeffs); @@ -1316,7 +1316,7 @@ bool finishReaction = false; {pDependentSpecie} { word rhsPDependentSpecieName = pDependentSpecieName; - pDependentSpecieName = + pDependentSpecieName = foamName(foamSpecieString(YYText())); pDependentSpecieName = pDependentSpecieName(0, pDependentSpecieName.size() - 1); @@ -1412,7 +1412,7 @@ bool finishReaction = false; else { FatalErrorIn("chemkinReader::lex()") - << "unknown specie " << currentSpecieName + << "unknown specie " << currentSpecieName << " given in reaction-order specification" << " on line " << lineNo_ << nl << "Valid species are : " << nl @@ -1449,7 +1449,7 @@ bool finishReaction = false; } FatalErrorIn("chemkinReader::lex()") - << "Specie " << currentSpecieName + << "Specie " << currentSpecieName << " on line " << lineNo_ << " not present in " << side << " of reaction " << nl << lrhs << exit(FatalError); diff --git a/src/thermophysicalModels/combustion/chemistryReaders/chemkinReader/chemkinReader.C b/src/thermophysicalModels/combustion/chemistryReaders/chemkinReader/chemkinReader.C index 944df6e3d5..1f32e14e8a 100644 --- a/src/thermophysicalModels/combustion/chemistryReaders/chemkinReader/chemkinReader.C +++ b/src/thermophysicalModels/combustion/chemistryReaders/chemkinReader/chemkinReader.C @@ -182,7 +182,7 @@ void Foam::chemkinReader::addReactionType speciesTable_, lhs.shrink(), rhs.shrink(), - specieThermo_ + speciesThermo_ ), rr ) @@ -201,7 +201,7 @@ void Foam::chemkinReader::addReactionType speciesTable_, lhs.shrink(), rhs.shrink(), - specieThermo_ + speciesThermo_ ), rr ) @@ -500,7 +500,7 @@ void Foam::chemkinReader::addReaction speciesTable_, lhs.shrink(), rhs.shrink(), - specieThermo_ + speciesThermo_ ), ArrheniusReactionRate ( @@ -553,7 +553,7 @@ void Foam::chemkinReader::addReaction speciesTable_, lhs.shrink(), rhs.shrink(), - specieThermo_ + speciesThermo_ ), thirdBodyArrheniusReactionRate ( @@ -658,7 +658,7 @@ void Foam::chemkinReader::addReaction speciesTable_, lhs.shrink(), rhs.shrink(), - specieThermo_ + speciesThermo_ ), LandauTellerReactionRate ( @@ -814,7 +814,8 @@ void Foam::chemkinReader::read yy_buffer_state* bufferPtr(yy_create_buffer(&thermoStream, yyBufSize)); yy_switch_to_buffer(bufferPtr); - while(lex() != 0); + while(lex() != 0) + {} yy_delete_buffer(bufferPtr); @@ -838,7 +839,8 @@ void Foam::chemkinReader::read initReactionKeywordTable(); - while(lex() != 0); + while(lex() != 0) + {} yy_delete_buffer(bufferPtr); } diff --git a/src/thermophysicalModels/combustion/chemistryReaders/chemkinReader/chemkinReader.H b/src/thermophysicalModels/combustion/chemistryReaders/chemkinReader/chemkinReader.H index 9281aa3f3b..497644dcaa 100644 --- a/src/thermophysicalModels/combustion/chemistryReaders/chemkinReader/chemkinReader.H +++ b/src/thermophysicalModels/combustion/chemistryReaders/chemkinReader/chemkinReader.H @@ -198,7 +198,7 @@ private: HashTable speciePhase_; //- Table of the thermodynamic data given in the CHEMKIN file - HashPtrTable specieThermo_; + HashPtrTable speciesThermo_; //- Table of species composition HashTable > specieComposition_; @@ -363,9 +363,9 @@ public: } //- Table of the thermodynamic data given in the CHEMKIN file - const HashPtrTable& specieThermo() const + const HashPtrTable& speciesThermo() const { - return specieThermo_; + return speciesThermo_; } //- Table of species composition diff --git a/src/thermophysicalModels/combustion/chemistryReaders/foamChemistryReader/foamChemistryReader.C b/src/thermophysicalModels/combustion/chemistryReaders/foamChemistryReader/foamChemistryReader.C index 1b14bf1b08..a6c7b5ac00 100644 --- a/src/thermophysicalModels/combustion/chemistryReaders/foamChemistryReader/foamChemistryReader.C +++ b/src/thermophysicalModels/combustion/chemistryReaders/foamChemistryReader/foamChemistryReader.C @@ -45,12 +45,12 @@ Foam::foamChemistryReader::foamChemistryReader const fileName& thermoFileName ) : - specieThermo_(IFstream(thermoFileName)()), + speciesThermo_(IFstream(thermoFileName)()), speciesTable_(dictionary(IFstream(reactionsFileName)()).lookup("species")), reactions_ ( dictionary(IFstream(reactionsFileName)()).lookup("reactions"), - reaction::iNew(speciesTable_, specieThermo_) + reaction::iNew(speciesTable_, speciesThermo_) ) {} @@ -58,7 +58,7 @@ Foam::foamChemistryReader::foamChemistryReader // Construct from components Foam::foamChemistryReader::foamChemistryReader(const dictionary& thermoDict) : - specieThermo_ + speciesThermo_ ( IFstream ( @@ -84,7 +84,7 @@ Foam::foamChemistryReader::foamChemistryReader(const dictionary& thermoDict) fileName(thermoDict.lookup("foamChemistryFile")).expand() )() ).lookup("reactions"), - reaction::iNew(speciesTable_, specieThermo_) + reaction::iNew(speciesTable_, speciesThermo_) ) {} diff --git a/src/thermophysicalModels/combustion/chemistryReaders/foamChemistryReader/foamChemistryReader.H b/src/thermophysicalModels/combustion/chemistryReaders/foamChemistryReader/foamChemistryReader.H index f55fc5d9de..a5373e5321 100644 --- a/src/thermophysicalModels/combustion/chemistryReaders/foamChemistryReader/foamChemistryReader.H +++ b/src/thermophysicalModels/combustion/chemistryReaders/foamChemistryReader/foamChemistryReader.H @@ -60,7 +60,7 @@ class foamChemistryReader public chemistryReader { //- Table of the thermodynamic data given in the foamChemistry file - HashPtrTable specieThermo_; + HashPtrTable speciesThermo_; //- Table of species speciesTable speciesTable_; @@ -113,9 +113,9 @@ public: } //- Table of the thermodynamic data given in the foamChemistry file - const HashPtrTable& specieThermo() const + const HashPtrTable& speciesThermo() const { - return specieThermo_; + return speciesThermo_; } //- List of the reactions diff --git a/src/thermophysicalModels/combustion/mixtureThermos/mixtures/reactingMixture/reactingMixture.C b/src/thermophysicalModels/combustion/mixtureThermos/mixtures/reactingMixture/reactingMixture.C index 2b1d7ad83c..e39ce6044e 100644 --- a/src/thermophysicalModels/combustion/mixtureThermos/mixtures/reactingMixture/reactingMixture.C +++ b/src/thermophysicalModels/combustion/mixtureThermos/mixtures/reactingMixture/reactingMixture.C @@ -45,7 +45,7 @@ reactingMixture::reactingMixture ( thermoDict, autoPtr::operator()().species(), - autoPtr::operator()().specieThermo(), + autoPtr::operator()().speciesThermo(), mesh ), PtrList diff --git a/wmake/rules/linux64Gcc43/X b/wmake/rules/linux64Gcc43/X new file mode 100644 index 0000000000..5d1f9c5cc5 --- /dev/null +++ b/wmake/rules/linux64Gcc43/X @@ -0,0 +1,3 @@ +XFLAGS = +XINC = $(XFLAGS) -I/usr/X11R6/include +XLIBS = -L/usr/X11R6/lib64 -lXext -lX11 diff --git a/wmake/rules/linux64Gcc43/c b/wmake/rules/linux64Gcc43/c new file mode 100644 index 0000000000..80bb80f32f --- /dev/null +++ b/wmake/rules/linux64Gcc43/c @@ -0,0 +1,16 @@ +.SUFFIXES: .c .h + +cWARN = -Wall + +cc = gcc -m64 + +include $(RULES)/c$(WM_COMPILE_OPTION) + +cFLAGS = $(GFLAGS) $(cWARN) $(cOPT) $(cDBUG) $(LIB_HEADER_DIRS) -fPIC + +ctoo = $(WM_SCHEDULER) $(cc) $(cFLAGS) -c $$SOURCE -o $@ + +LINK_LIBS = $(cDBUG) + +LINKLIBSO = $(cc) -shared +LINKEXE = $(cc) -Xlinker -z -Xlinker nodefs diff --git a/wmake/rules/linux64Gcc43/c++ b/wmake/rules/linux64Gcc43/c++ new file mode 100644 index 0000000000..36b5c29b20 --- /dev/null +++ b/wmake/rules/linux64Gcc43/c++ @@ -0,0 +1,21 @@ +.SUFFIXES: .C .cxx .cc .cpp + +c++WARN = -Wall -Wno-strict-aliasing -Wextra -Wno-unused-parameter -Wold-style-cast + +CC = g++ -m64 + +include $(RULES)/c++$(WM_COMPILE_OPTION) + +ptFLAGS = -DNoRepository -ftemplate-depth-40 + +c++FLAGS = $(GFLAGS) $(c++WARN) $(c++OPT) $(c++DBUG) $(ptFLAGS) $(LIB_HEADER_DIRS) -fPIC + +Ctoo = $(WM_SCHEDULER) $(CC) $(c++FLAGS) -c $$SOURCE -o $@ +cxxtoo = $(Ctoo) +cctoo = $(Ctoo) +cpptoo = $(Ctoo) + +LINK_LIBS = $(c++DBUG) + +LINKLIBSO = $(CC) $(c++FLAGS) -shared +LINKEXE = $(CC) $(c++FLAGS) diff --git a/wmake/rules/linux64Gcc43/c++Debug b/wmake/rules/linux64Gcc43/c++Debug new file mode 100644 index 0000000000..19bdb9c334 --- /dev/null +++ b/wmake/rules/linux64Gcc43/c++Debug @@ -0,0 +1,2 @@ +c++DBUG = -ggdb3 -DFULLDEBUG +c++OPT = -O0 -fdefault-inline diff --git a/wmake/rules/linux64Gcc43/c++Opt b/wmake/rules/linux64Gcc43/c++Opt new file mode 100644 index 0000000000..f19996b72d --- /dev/null +++ b/wmake/rules/linux64Gcc43/c++Opt @@ -0,0 +1,4 @@ +c++DBUG = +c++OPT = -march=opteron -O3 +#c++OPT = -march=nocona -O3 +# -ftree-vectorize -ftree-vectorizer-verbose=3 diff --git a/wmake/rules/linux64Gcc43/c++Prof b/wmake/rules/linux64Gcc43/c++Prof new file mode 100644 index 0000000000..3bda4dad55 --- /dev/null +++ b/wmake/rules/linux64Gcc43/c++Prof @@ -0,0 +1,2 @@ +c++DBUG = -pg +c++OPT = -O2 diff --git a/wmake/rules/linux64Gcc43/cDebug b/wmake/rules/linux64Gcc43/cDebug new file mode 100644 index 0000000000..72b638f458 --- /dev/null +++ b/wmake/rules/linux64Gcc43/cDebug @@ -0,0 +1,2 @@ +cDBUG = -ggdb -DFULLDEBUG +cOPT = -O1 -fdefault-inline -finline-functions diff --git a/wmake/rules/linux64Gcc43/cOpt b/wmake/rules/linux64Gcc43/cOpt new file mode 100644 index 0000000000..7285a9de96 --- /dev/null +++ b/wmake/rules/linux64Gcc43/cOpt @@ -0,0 +1,2 @@ +cDBUG = +cOPT = -march=opteron -O3 -fno-gcse diff --git a/wmake/rules/linux64Gcc43/cProf b/wmake/rules/linux64Gcc43/cProf new file mode 100644 index 0000000000..ca3ac9bf5f --- /dev/null +++ b/wmake/rules/linux64Gcc43/cProf @@ -0,0 +1,2 @@ +cDBUG = -pg +cOPT = -O2 diff --git a/wmake/rules/linux64Gcc43/dirToString b/wmake/rules/linux64Gcc43/dirToString new file mode 100755 index 0000000000..1f9e9266a6 Binary files /dev/null and b/wmake/rules/linux64Gcc43/dirToString differ diff --git a/wmake/rules/linux64Gcc43/general b/wmake/rules/linux64Gcc43/general new file mode 100644 index 0000000000..11b48acc3f --- /dev/null +++ b/wmake/rules/linux64Gcc43/general @@ -0,0 +1,11 @@ +CPP = /lib/cpp $(GFLAGS) +LD = ld -A64 + +PROJECT_LIBS = -l$(WM_PROJECT) -liberty -ldl + +include $(GENERAL_RULES)/standard + +include $(RULES)/X +include $(RULES)/c +include $(RULES)/c++ +include $(GENERAL_RULES)/cint diff --git a/wmake/rules/linux64Gcc43/mplib b/wmake/rules/linux64Gcc43/mplib new file mode 100644 index 0000000000..8a84b40146 --- /dev/null +++ b/wmake/rules/linux64Gcc43/mplib @@ -0,0 +1,3 @@ +PFLAGS = +PINC = +PLIBS = diff --git a/wmake/rules/linux64Gcc43/mplibGAMMA b/wmake/rules/linux64Gcc43/mplibGAMMA new file mode 100644 index 0000000000..dc67a60a0b --- /dev/null +++ b/wmake/rules/linux64Gcc43/mplibGAMMA @@ -0,0 +1,3 @@ +PFLAGS = +PINC = -I$(GAMMA_ARCH_PATH)/include +PLIBS = -L$(GAMMA_ARCH_PATH)/lib -lgamma diff --git a/wmake/rules/linux64Gcc43/mplibLAM b/wmake/rules/linux64Gcc43/mplibLAM new file mode 100644 index 0000000000..ce18f75860 --- /dev/null +++ b/wmake/rules/linux64Gcc43/mplibLAM @@ -0,0 +1,3 @@ +PFLAGS = +PINC = -I$(LAM_ARCH_PATH)/include +PLIBS = -L$(LAM_ARCH_PATH)/lib -lmpi -llam -lpthread -lutil diff --git a/wmake/rules/linux64Gcc43/mplibMPICH b/wmake/rules/linux64Gcc43/mplibMPICH new file mode 100644 index 0000000000..d586ba3e03 --- /dev/null +++ b/wmake/rules/linux64Gcc43/mplibMPICH @@ -0,0 +1,3 @@ +PFLAGS = +PINC = -I$(MPICH_ARCH_PATH)/include +PLIBS = -L$(MPICH_ARCH_PATH)/lib -lmpich -lrt diff --git a/wmake/rules/linux64Gcc43/mplibMPICH-GM b/wmake/rules/linux64Gcc43/mplibMPICH-GM new file mode 100644 index 0000000000..74fd965808 --- /dev/null +++ b/wmake/rules/linux64Gcc43/mplibMPICH-GM @@ -0,0 +1,3 @@ +PFLAGS = +PINC = -I$(MPICH_ARCH_PATH)/include +PLIBS = -L$(MPICH_ARCH_PATH)/lib -lmpich -L$(GM_LIB_PATH) -lgm diff --git a/wmake/rules/linux64Gcc43/mplibOPENMPI b/wmake/rules/linux64Gcc43/mplibOPENMPI new file mode 100644 index 0000000000..ea9b4d2299 --- /dev/null +++ b/wmake/rules/linux64Gcc43/mplibOPENMPI @@ -0,0 +1,3 @@ +PFLAGS = -DOMPI_SKIP_MPICXX +PINC = -I$(OPENMPI_ARCH_PATH)/include +PLIBS = -L$(OPENMPI_ARCH_PATH)/lib -lmpi diff --git a/wmake/rules/linux64Gcc43/wmkdep b/wmake/rules/linux64Gcc43/wmkdep new file mode 100755 index 0000000000..002e73dea8 Binary files /dev/null and b/wmake/rules/linux64Gcc43/wmkdep differ