diff --git a/ReleaseNotes-dev b/ReleaseNotes-dev index 227041536f..230a116826 100644 --- a/ReleaseNotes-dev +++ b/ReleaseNotes-dev @@ -104,6 +104,11 @@ taking film into account + Parallel aware *** *New* ptscotch decomposition method +*** *Updated* scotch decomposition method to run in parallel by doing + decomposition on the master. Unfortunately scotch and ptscotch cannot + be linked in to the same executable. +*** *Updated* simple decomposition method to run in parallel by doing + decomposition on the master. *** *Updated* decomposePar maps polyPatches instead of recreating them so polyPatches holding data can map the data. *** *Updated* particle tracking algorithm @@ -183,6 +188,9 @@ e.g. pitzDailyDirectMapped tutorial. + =setSet=: allows time range (e.g. 0:100) in combination with -batch argument to execute the commands for multiple times. + + =extrudeMesh=: + - option to add extrusion to existing mesh. + - works in parallel * Post-processing + =paraFoam=, =foamToVTK=: full support for polyhedral cell type in recent Paraview versions. diff --git a/applications/solvers/multiphase/twoPhaseEulerFoam/alphaEqn.H b/applications/solvers/multiphase/twoPhaseEulerFoam/alphaEqn.H index cac8e52a8e..8f1ad9df8e 100644 --- a/applications/solvers/multiphase/twoPhaseEulerFoam/alphaEqn.H +++ b/applications/solvers/multiphase/twoPhaseEulerFoam/alphaEqn.H @@ -2,8 +2,8 @@ word scheme("div(phi,alpha)"); word schemer("div(phir,alpha)"); - surfaceScalarField phic(phi); - surfaceScalarField phir(phia - phib); + surfaceScalarField phic("phic", phi); + surfaceScalarField phir("phir", phia - phib); if (g0.value() > 0.0) { @@ -41,7 +41,7 @@ alphaEqn.relax(); alphaEqn.solve(); -# include "packingLimiter.H" + #include "packingLimiter.H" beta = scalar(1) - alpha; diff --git a/applications/test/Polynomial/Test-Polynomial.C b/applications/test/Polynomial/Test-Polynomial.C index fbfbcc2000..c251bade74 100644 --- a/applications/test/Polynomial/Test-Polynomial.C +++ b/applications/test/Polynomial/Test-Polynomial.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2009-2010 OpenCFD Ltd. + \\ / A nd | Copyright (C) 2009-2011 OpenCFD Ltd. \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -31,6 +31,7 @@ Description #include "IStringStream.H" #include "Polynomial.H" +#include "polynomialFunction.H" #include "Random.H" #include "cpuTime.H" @@ -38,7 +39,7 @@ using namespace Foam; const int PolySize = 8; const scalar coeff[] = { 0.11, 0.45, -0.94, 1.58, -2.58, 0.08, 3.15, -4.78 }; -const char* polyDef = "testPoly (0.11 0.45 -0.94 1.58 -2.58 0.08 3.15 -4.78)"; +const char* polyDef = "(0.11 0.45 -0.94 1.58 -2.58 0.08 3.15 -4.78)"; scalar polyValue(const scalar x) @@ -58,7 +59,7 @@ scalar polyValue(const scalar x) scalar intPolyValue(const scalar x) { - // Hard-coded integrated form of above polynomial + // Hard-coded integral form of above polynomial return coeff[0]*x + coeff[1]/2.0*sqr(x) @@ -109,27 +110,44 @@ int main(int argc, char *argv[]) const label nIters = 1000; scalar sum = 0.0; - Info<< "null poly = " << (Polynomial<8>()) << nl << endl; + Info<< "null poly = " << (Polynomial<8>()) << nl + << "null poly = " << (polynomialFunction(8)) << nl + << endl; - // Polynomial<8> poly("testPoly", IStringStream(polyDef)()); Polynomial<8> poly(coeff); - Polynomial<9> intPoly(poly.integrate(0.0)); + Polynomial<9> intPoly(poly.integral(0.0)); - Info<< "poly = " << poly << endl; - Info<< "intPoly = " << intPoly << nl << endl; + IStringStream is(polyDef); + polynomialFunction polyfunc(is); - Info<< "2*poly = " << 2*poly << endl; - Info<< "poly+poly = " << poly + poly << nl << endl; + Info<< "poly = " << poly << nl + << "intPoly = " << intPoly << nl + << endl; - Info<< "3*poly = " << 3*poly << endl; - Info<< "poly+poly+poly = " << poly + poly + poly << nl << endl; + Info<< "2*poly = " << 2*poly << nl + << "poly+poly = " << poly + poly << nl + << "3*poly = " << 3*poly << nl + << "poly+poly+poly = " << poly + poly + poly << nl + << "3*poly - 2*poly = " << 3*poly - 2*poly << nl + << endl; + + Info<< nl << "--- as polynomialFunction" << nl << endl; + Info<< "polyf = " << polyfunc << nl + << "intPoly = " << poly.integral(0.0) << nl + << endl; + + Info<< "2*polyf = " << 2*polyfunc << nl + << "polyf+polyf = " << polyfunc + polyfunc << nl + << "3*polyf = " << 3*polyfunc << nl + << "polyf+polyf+polyf = " << polyfunc + polyfunc + polyfunc << nl + << "3*polyf - 2*polyf = " << 3*polyfunc - 2*polyfunc << nl + << endl; - Info<< "3*poly - 2*poly = " << 3*poly - 2*poly << nl << endl; Polynomial<8> polyCopy = poly; Info<< "poly, polyCopy = " << poly << ", " << polyCopy << nl << endl; polyCopy = 2.5*poly; - Info<< "2.5*polyCopy = " << polyCopy << nl << endl; + Info<< "2.5*poly = " << polyCopy << nl << endl; Random rnd(123456); for (int i=0; i<10; i++) @@ -139,8 +157,8 @@ int main(int argc, char *argv[]) scalar px = polyValue(x); scalar ipx = intPolyValue(x); - scalar pxTest = poly.evaluate(x); - scalar ipxTest = intPoly.evaluate(x); + scalar pxTest = poly.value(x); + scalar ipxTest = intPoly.value(x); Info<<"\nx = " << x << endl; Info<< " px, pxTest = " << px << ", " << pxTest << endl; @@ -173,10 +191,21 @@ int main(int argc, char *argv[]) sum = 0.0; for (label iter = 0; iter < nIters; ++iter) { - sum += poly.evaluate(loop+iter); + sum += poly.value(loop+iter); } } - Info<< "evaluate: " << sum + Info<< "value: " << sum + << " in " << timer.cpuTimeIncrement() << " s\n"; + + for (int loop = 0; loop < n; ++loop) + { + sum = 0.0; + for (label iter = 0; iter < nIters; ++iter) + { + sum += polyfunc.value(loop+iter); + } + } + Info<< "via function: " << sum << " in " << timer.cpuTimeIncrement() << " s\n"; diff --git a/applications/test/syncTools/Test-syncTools.C b/applications/test/syncTools/Test-syncTools.C index 6f9d5f408a..2638f0fb67 100644 --- a/applications/test/syncTools/Test-syncTools.C +++ b/applications/test/syncTools/Test-syncTools.C @@ -210,7 +210,7 @@ void testSparseData(const polyMesh& mesh, Random& rndGen) { // Create some data. Use slightly perturbed positions. Map sparseData; - pointField fullData(mesh.nPoints(), point::max); + pointField fullData(mesh.nPoints(), point(GREAT, GREAT, GREAT)); forAll(localPoints, i) { @@ -236,7 +236,7 @@ void testSparseData(const polyMesh& mesh, Random& rndGen) mesh, fullData, minMagSqrEqOp(), - point::max + point(GREAT, GREAT, GREAT) // true // apply separation ); @@ -246,7 +246,7 @@ void testSparseData(const polyMesh& mesh, Random& rndGen) { const point& fullPt = fullData[meshPointI]; - if (fullPt != point::max) + if (fullPt != point(GREAT, GREAT, GREAT)) { const point& sparsePt = sparseData[meshPointI]; @@ -286,7 +286,7 @@ void testSparseData(const polyMesh& mesh, Random& rndGen) { // Create some data. Use slightly perturbed positions. EdgeMap sparseData; - pointField fullData(mesh.nEdges(), point::max); + pointField fullData(mesh.nEdges(), point(GREAT, GREAT, GREAT)); const edgeList& edges = allBoundary.edges(); const labelList meshEdges = allBoundary.meshEdges @@ -320,7 +320,7 @@ void testSparseData(const polyMesh& mesh, Random& rndGen) mesh, fullData, minMagSqrEqOp(), - point::max + point(GREAT, GREAT, GREAT) ); // Compare. @@ -329,7 +329,7 @@ void testSparseData(const polyMesh& mesh, Random& rndGen) { const point& fullPt = fullData[meshEdgeI]; - if (fullPt != point::max) + if (fullPt != point(GREAT, GREAT, GREAT)) { const point& sparsePt = sparseData[mesh.edges()[meshEdgeI]]; @@ -385,7 +385,7 @@ void testPointSync(const polyMesh& mesh, Random& rndGen) mesh, syncedPoints, minMagSqrEqOp(), - point::max + point(GREAT, GREAT, GREAT) ); forAll(syncedPoints, pointI) @@ -461,7 +461,7 @@ void testEdgeSync(const polyMesh& mesh, Random& rndGen) mesh, syncedMids, minMagSqrEqOp(), - point::max + point(GREAT, GREAT, GREAT) ); forAll(syncedMids, edgeI) diff --git a/applications/utilities/mesh/conversion/foamToStarMesh/foamToStarMesh.C b/applications/utilities/mesh/conversion/foamToStarMesh/foamToStarMesh.C index b154a3816d..af4985dd43 100644 --- a/applications/utilities/mesh/conversion/foamToStarMesh/foamToStarMesh.C +++ b/applications/utilities/mesh/conversion/foamToStarMesh/foamToStarMesh.C @@ -40,7 +40,7 @@ Usage Note The cellTable information available in the files - \c constant/cellTable and @c constant/polyMesh/cellTableId + \c constant/cellTable and \c constant/polyMesh/cellTableId will be used if available. Otherwise the cellZones are used when creating the cellTable information. diff --git a/applications/utilities/mesh/generation/extrude/extrudeMesh/extrudeMesh.C b/applications/utilities/mesh/generation/extrude/extrudeMesh/extrudeMesh.C index 8a7296eca0..5804d962c8 100644 --- a/applications/utilities/mesh/generation/extrude/extrudeMesh/extrudeMesh.C +++ b/applications/utilities/mesh/generation/extrude/extrudeMesh/extrudeMesh.C @@ -43,6 +43,7 @@ Description #include "addPatchCellLayer.H" #include "fvMesh.H" #include "MeshedSurfaces.H" +#include "globalIndex.H" #include "extrudedMesh.H" #include "extrudeModel.H" @@ -261,6 +262,12 @@ int main(int argc, char *argv[]) sourceCasePath.expand(); fileName sourceRootDir = sourceCasePath.path(); fileName sourceCaseDir = sourceCasePath.name(); + if (Pstream::parRun()) + { + sourceCaseDir = + sourceCaseDir + /"processor" + Foam::name(Pstream::myProcNo()); + } wordList sourcePatches; dict.lookup("sourcePatches") >> sourcePatches; @@ -279,54 +286,173 @@ int main(int argc, char *argv[]) sourceRootDir, sourceCaseDir ); + #include "createMesh.H" const polyBoundaryMesh& patches = mesh.boundaryMesh(); - // Topo change container. Either copy an existing mesh or start - // with empty storage (number of patches only needed for checking) - autoPtr meshMod - ( - ( - mode == MESH - ? new polyTopoChange(mesh) - : new polyTopoChange(patches.size()) - ) - ); - // Extrusion engine. Either adding to existing mesh or // creating separate mesh. addPatchCellLayer layerExtrude(mesh, (mode == MESH)); + const labelList meshFaces(patchFaces(patches, sourcePatches)); indirectPrimitivePatch extrudePatch ( IndirectList ( mesh.faces(), - patchFaces(patches, sourcePatches) + meshFaces ), mesh.points() ); + // Determine extrudePatch normal + pointField extrudePatchPointNormals + ( + PatchTools::pointNormals //calcNormals + ( + mesh, + extrudePatch, + meshFaces + ) + ); + + + // Precalculate mesh edges for pp.edges. + const labelList meshEdges + ( + extrudePatch.meshEdges + ( + mesh.edges(), + mesh.pointEdges() + ) + ); + + // Global face indices engine + const globalIndex globalFaces(mesh.nFaces()); + + // Determine extrudePatch.edgeFaces in global numbering (so across + // coupled patches) + labelListList edgeGlobalFaces + ( + addPatchCellLayer::globalEdgeFaces + ( + mesh, + globalFaces, + extrudePatch + ) + ); + + + // Determine what patches boundary edges need to get extruded into. + // This might actually cause edge-connected processors to become + // face-connected so might need to introduce new processor boundaries. + // Calculates: + // - per pp.edge the patch to extrude into + // - any additional processor boundaries (patchToNbrProc = map from + // new patchID to neighbour processor) + // - number of new patches (nPatches) + + labelList sidePatchID; + label nPatches; + Map