From bfc3a6961eed270d60d02b710a51b936a2148d27 Mon Sep 17 00:00:00 2001 From: mattijs Date: Tue, 28 Apr 2009 12:14:05 +0100 Subject: [PATCH 01/23] use relaxed mesh checks in shrinking as well as layering --- .../autoHexMeshDriver/autoLayerDriver.C | 30 +++++++++++-------- .../autoHexMeshDriver/autoLayerDriver.H | 1 + .../autoHexMeshDriver/autoLayerDriverShrink.C | 20 ++++++++++--- .../motionSmoother/motionSmoother.C | 6 ++++ .../motionSmoother/motionSmoother.H | 2 ++ 5 files changed, 42 insertions(+), 17 deletions(-) diff --git a/src/autoMesh/autoHexMesh/autoHexMeshDriver/autoLayerDriver.C b/src/autoMesh/autoHexMesh/autoHexMeshDriver/autoLayerDriver.C index ee6cea3e12..01ab952c16 100644 --- a/src/autoMesh/autoHexMesh/autoHexMeshDriver/autoLayerDriver.C +++ b/src/autoMesh/autoHexMesh/autoHexMeshDriver/autoLayerDriver.C @@ -2804,6 +2804,22 @@ void Foam::autoLayerDriver::addLayers << "Layer addition iteration " << iteration << nl << "--------------------------" << endl; + + // Unset the extrusion at the pp. + const dictionary& meshQualityDict = + ( + iteration < layerParams.nRelaxedIter() + ? motionDict + : motionDict.subDict("relaxed") + ); + + if (iteration >= layerParams.nRelaxedIter()) + { + Info<< "Switched to relaxed meshQuality constraints." << endl; + } + + + // Make sure displacement is equal on both sides of coupled patches. syncPatchDisplacement ( @@ -2845,6 +2861,7 @@ void Foam::autoLayerDriver::addLayers shrinkMeshMedialDistance ( meshMover, + meshQualityDict, layerParams.nSmoothThickness(), layerParams.maxThicknessToMedialRatio(), @@ -3044,19 +3061,6 @@ void Foam::autoLayerDriver::addLayers layerFacesSet.write(); } - // Unset the extrusion at the pp. - const dictionary& meshQualityDict = - ( - iteration < layerParams.nRelaxedIter() - ? motionDict - : motionDict.subDict("relaxed") - ); - - if (iteration >= layerParams.nRelaxedIter()) - { - Info<< "Switched to relaxed meshQuality constraints." << endl; - } - label nTotChanged = checkAndUnmark ( diff --git a/src/autoMesh/autoHexMesh/autoHexMeshDriver/autoLayerDriver.H b/src/autoMesh/autoHexMesh/autoHexMeshDriver/autoLayerDriver.H index 6cdec2004b..164fd88ce0 100644 --- a/src/autoMesh/autoHexMesh/autoHexMeshDriver/autoLayerDriver.H +++ b/src/autoMesh/autoHexMesh/autoHexMeshDriver/autoLayerDriver.H @@ -473,6 +473,7 @@ class autoLayerDriver void shrinkMeshMedialDistance ( motionSmoother& meshMover, + const dictionary& meshQualityDict, const label nSmoothThickness, const scalar maxThicknessToMedialRatio, const label nAllowableErrors, diff --git a/src/autoMesh/autoHexMesh/autoHexMeshDriver/autoLayerDriverShrink.C b/src/autoMesh/autoHexMesh/autoHexMeshDriver/autoLayerDriverShrink.C index 615978a308..cc88231b74 100644 --- a/src/autoMesh/autoHexMesh/autoHexMeshDriver/autoLayerDriverShrink.C +++ b/src/autoMesh/autoHexMesh/autoHexMeshDriver/autoLayerDriverShrink.C @@ -792,7 +792,7 @@ void Foam::autoLayerDriver::medialAxisSmoothingInfo wallInfo, pointWallDist, edgeWallDist, - mesh.nPoints() // max iterations + mesh.globalData().nTotalPoints() // max iterations ); } @@ -897,7 +897,7 @@ void Foam::autoLayerDriver::medialAxisSmoothingInfo pointMedialDist, edgeMedialDist, - mesh.nPoints() // max iterations + mesh.globalData().nTotalPoints() // max iterations ); // Extract medial axis distance as pointScalarField @@ -953,6 +953,7 @@ void Foam::autoLayerDriver::medialAxisSmoothingInfo void Foam::autoLayerDriver::shrinkMeshMedialDistance ( motionSmoother& meshMover, + const dictionary& meshQualityDict, const label nSmoothThickness, const scalar maxThicknessToMedialRatio, const label nAllowableErrors, @@ -1103,7 +1104,7 @@ void Foam::autoLayerDriver::shrinkMeshMedialDistance wallInfo, pointWallDist, edgeWallDist, - mesh.nPoints() // max iterations + mesh.globalData().nTotalPoints() // max iterations ); } @@ -1138,7 +1139,18 @@ void Foam::autoLayerDriver::shrinkMeshMedialDistance oldErrorReduction = meshMover.setErrorReduction(0.0); } - if (meshMover.scaleMesh(checkFaces, true, nAllowableErrors)) + if + ( + meshMover.scaleMesh + ( + checkFaces, + List(0), + meshMover.paramDict(), + meshQualityDict, + true, + nAllowableErrors + ) + ) { Info<< "shrinkMeshMedialDistance : Successfully moved mesh" << endl; break; diff --git a/src/dynamicMesh/motionSmoother/motionSmoother.C b/src/dynamicMesh/motionSmoother/motionSmoother.C index 4f40827f4b..d780ec79dd 100644 --- a/src/dynamicMesh/motionSmoother/motionSmoother.C +++ b/src/dynamicMesh/motionSmoother/motionSmoother.C @@ -502,6 +502,12 @@ const Foam::labelList& Foam::motionSmoother::adaptPatchIDs() const } +const Foam::dictionary& Foam::motionSmoother::paramDict() const +{ + return paramDict_; +} + + Foam::pointVectorField& Foam::motionSmoother::displacement() { return displacement_; diff --git a/src/dynamicMesh/motionSmoother/motionSmoother.H b/src/dynamicMesh/motionSmoother/motionSmoother.H index e4aeac6f50..3d853e476d 100644 --- a/src/dynamicMesh/motionSmoother/motionSmoother.H +++ b/src/dynamicMesh/motionSmoother/motionSmoother.H @@ -327,6 +327,8 @@ public: //- Patch labels that are being adapted const labelList& adaptPatchIDs() const; + const dictionary& paramDict() const; + //- Reference to displacement field pointVectorField& displacement(); From 5bc9d3f3f8b91616347fab110c5489af8179d227 Mon Sep 17 00:00:00 2001 From: mattijs Date: Tue, 28 Apr 2009 12:14:59 +0100 Subject: [PATCH 02/23] stabilise interpolation on zero area faces --- .../pointPatchInterpolation.C | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/src/finiteVolume/interpolation/volPointInterpolation/pointPatchInterpolation/pointPatchInterpolation.C b/src/finiteVolume/interpolation/volPointInterpolation/pointPatchInterpolation/pointPatchInterpolation.C index f9ebc6b8ce..16cd028f72 100644 --- a/src/finiteVolume/interpolation/volPointInterpolation/pointPatchInterpolation/pointPatchInterpolation.C +++ b/src/finiteVolume/interpolation/volPointInterpolation/pointPatchInterpolation/pointPatchInterpolation.C @@ -213,13 +213,12 @@ void pointPatchInterpolation::makePatchPatchWeights() if (!isA(bm[patchi]) && !bm[patchi].coupled()) { - pw[nFacesAroundPoint] = - 1.0/mag - ( - pointLoc - - centres.boundaryField()[patchi] - [bm[patchi].patch().whichFace(curFaces[facei])] - ); + vector d = + pointLoc + - centres.boundaryField()[patchi] + [bm[patchi].patch().whichFace(curFaces[facei])]; + + pw[nFacesAroundPoint] = 1.0/(mag(d)+VSMALL); nFacesAroundPoint++; } From b3b650fa9807b2b2c579eccf83f9ab8feb780ee3 Mon Sep 17 00:00:00 2001 From: graham Date: Tue, 28 Apr 2009 13:17:37 +0100 Subject: [PATCH 03/23] Added free stream velocity components to tangential velocities. --- .../dsmc/submodels/InflowBoundaryModel/FreeStream/FreeStream.C | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/lagrangian/dsmc/submodels/InflowBoundaryModel/FreeStream/FreeStream.C b/src/lagrangian/dsmc/submodels/InflowBoundaryModel/FreeStream/FreeStream.C index cd18d9064d..9d791a1ed3 100644 --- a/src/lagrangian/dsmc/submodels/InflowBoundaryModel/FreeStream/FreeStream.C +++ b/src/lagrangian/dsmc/submodels/InflowBoundaryModel/FreeStream/FreeStream.C @@ -367,6 +367,8 @@ void Foam::FreeStream::inflow() rndGen.GaussNormal()*t1 + rndGen.GaussNormal()*t2 ) + + (t1 & faceVelocity)*t1 + + (t2 & faceVelocity)*t2 + mostProbableSpeed*uNormal*n; scalar Ei = cloud.equipartitionInternalEnergy From 4def3721e63aba96cf4de5312e0e0c733938eabb Mon Sep 17 00:00:00 2001 From: mattijs Date: Tue, 28 Apr 2009 16:29:20 +0100 Subject: [PATCH 04/23] added dependency --- src/thermophysicalModels/radiation/Make/options | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/src/thermophysicalModels/radiation/Make/options b/src/thermophysicalModels/radiation/Make/options index 98956f2b6d..2e150f2bf9 100644 --- a/src/thermophysicalModels/radiation/Make/options +++ b/src/thermophysicalModels/radiation/Make/options @@ -1,9 +1,8 @@ EXE_INC = \ -I$(LIB_SRC)/finiteVolume/lnInclude \ - -I$(LIB_SRC)/thermophysicalModels/basic/lnInclude \ - -I$(LIB_SRC)/thermophysicalModels/combustion/lnInclude \ - -I$(LIB_SRC)/OpenFOAM/lnInclude \ - -I radiationModel/fvDOM/interpolationLookUpTable + -I$(LIB_SRC)/thermophysicalModels/basic/lnInclude LIB_LIBS = \ - -lfiniteVolume + -lfiniteVolume \ + -lbasicThermophysicalModels \ + -lspecie From 68e3014f93bc0025c6f0eaf4e8850a27a7800ef5 Mon Sep 17 00:00:00 2001 From: mattijs Date: Tue, 28 Apr 2009 20:52:18 +0100 Subject: [PATCH 05/23] scoping --- .../buoyantSimpleRadiationFoam/hotRadiationRoom/0/epsilon | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/tutorials/heatTransfer/buoyantSimpleRadiationFoam/hotRadiationRoom/0/epsilon b/tutorials/heatTransfer/buoyantSimpleRadiationFoam/hotRadiationRoom/0/epsilon index d9e8b1dc34..d5e7b9cd02 100644 --- a/tutorials/heatTransfer/buoyantSimpleRadiationFoam/hotRadiationRoom/0/epsilon +++ b/tutorials/heatTransfer/buoyantSimpleRadiationFoam/hotRadiationRoom/0/epsilon @@ -23,25 +23,25 @@ boundaryField { floor { - type epsilonWallFunction; + type compressible::epsilonWallFunction; value uniform 0; } ceiling { - type epsilonWallFunction; + type compressible::epsilonWallFunction; value uniform 0; } fixedWalls { - type epsilonWallFunction; + type compressible::epsilonWallFunction; value uniform 0; } box { - type epsilonWallFunction; + type compressible::epsilonWallFunction; value uniform 0; } } From c67b9e677ab3b4a68229aca4453e04eb4aefb6e4 Mon Sep 17 00:00:00 2001 From: mattijs Date: Tue, 28 Apr 2009 20:52:19 +0100 Subject: [PATCH 06/23] scoping --- .../buoyantSimpleRadiationFoam/hotRadiationRoom/0/k | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/tutorials/heatTransfer/buoyantSimpleRadiationFoam/hotRadiationRoom/0/k b/tutorials/heatTransfer/buoyantSimpleRadiationFoam/hotRadiationRoom/0/k index 0eb1a25c30..5b206f8e4e 100644 --- a/tutorials/heatTransfer/buoyantSimpleRadiationFoam/hotRadiationRoom/0/k +++ b/tutorials/heatTransfer/buoyantSimpleRadiationFoam/hotRadiationRoom/0/k @@ -23,25 +23,25 @@ boundaryField { floor { - type kQRWallFunction; + type compressible::kQRWallFunction; value uniform 0; } ceiling { - type kQRWallFunction; + type compressible::kQRWallFunction; value uniform 0; } fixedWalls { - type kQRWallFunction; + type compressible::kQRWallFunction; value uniform 0; } box { - type kQRWallFunction; + type compressible::kQRWallFunction; value uniform 0; } } From 4204b4121e30b4f7c61c13e0ff8226bef42aa227 Mon Sep 17 00:00:00 2001 From: mattijs Date: Tue, 28 Apr 2009 20:52:42 +0100 Subject: [PATCH 07/23] update boudaryfield only --- .../radiation/radiationModel/fvDOM/fvDOM/fvDOM.C | 3 ++- .../fvDOM/radiativeIntensityRay/radiativeIntensityRay.C | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/src/thermophysicalModels/radiation/radiationModel/fvDOM/fvDOM/fvDOM.C b/src/thermophysicalModels/radiation/radiationModel/fvDOM/fvDOM/fvDOM.C index f548d0046a..9183931ba1 100644 --- a/src/thermophysicalModels/radiation/radiationModel/fvDOM/fvDOM/fvDOM.C +++ b/src/thermophysicalModels/radiation/radiationModel/fvDOM/fvDOM/fvDOM.C @@ -359,7 +359,8 @@ void Foam::radiation::fvDOM::updateG() { IRay_[rayI].addIntensity(); G_ += IRay_[rayI].I()*IRay_[rayI].omega(); - Qr_ += IRay_[rayI].Qr(); + //Qr_ += IRay_[rayI].Qr(); + Qr_.boundaryField() += IRay_[rayI].Qr().boundaryField(); } } diff --git a/src/thermophysicalModels/radiation/radiationModel/fvDOM/radiativeIntensityRay/radiativeIntensityRay.C b/src/thermophysicalModels/radiation/radiationModel/fvDOM/radiativeIntensityRay/radiativeIntensityRay.C index 6af99c86a4..7441b900d6 100644 --- a/src/thermophysicalModels/radiation/radiationModel/fvDOM/radiativeIntensityRay/radiativeIntensityRay.C +++ b/src/thermophysicalModels/radiation/radiationModel/fvDOM/radiativeIntensityRay/radiativeIntensityRay.C @@ -187,7 +187,8 @@ Foam::radiation::radiativeIntensityRay::~radiativeIntensityRay() Foam::scalar Foam::radiation::radiativeIntensityRay::correct() { // reset boundary heat flux to zero - Qr_ = dimensionedScalar("zero", dimMass/pow3(dimTime), 0.0); + //Qr_ = dimensionedScalar("zero", dimMass/pow3(dimTime), 0.0); + Qr_.boundaryField() = 0.0; scalar maxResidual = -GREAT; From 23ef5f08bd1d4b262a0ce9e3ffab5fbbed70d7ab Mon Sep 17 00:00:00 2001 From: mattijs Date: Tue, 28 Apr 2009 20:52:56 +0100 Subject: [PATCH 08/23] pruned unused code --- .../meshRefinement/meshRefinementBaffles.C | 24 ------------------- 1 file changed, 24 deletions(-) diff --git a/src/autoMesh/autoHexMesh/meshRefinement/meshRefinementBaffles.C b/src/autoMesh/autoHexMesh/meshRefinement/meshRefinementBaffles.C index e154576ad9..3904f96073 100644 --- a/src/autoMesh/autoHexMesh/meshRefinement/meshRefinementBaffles.C +++ b/src/autoMesh/autoHexMesh/meshRefinement/meshRefinementBaffles.C @@ -1522,30 +1522,6 @@ void Foam::meshRefinement::baffleAndSplitMesh if (debug) { - //- Note: commented out since not properly parallel yet. - //// Dump all these faces to a faceSet. - //faceSet problemGeom(mesh_, "problemFacesGeom", 100); - // - //const labelList facePatchGeom - //( - // markFacesOnProblemCellsGeometric - // ( - // motionDict, - // globalToPatch - // ) - //); - //forAll(facePatchGeom, faceI) - //{ - // if (facePatchGeom[faceI] != -1) - // { - // problemGeom.insert(faceI); - // } - //} - //Pout<< "Dumping " << problemGeom.size() - // << " problem faces to " << problemGeom.objectPath() << endl; - //problemGeom.write(); - - faceSet problemTopo(mesh_, "problemFacesTopo", 100); const labelList facePatchTopo From b773710d06b7aa92268d34d8f269d80f398b155c Mon Sep 17 00:00:00 2001 From: mattijs Date: Tue, 28 Apr 2009 22:20:12 +0100 Subject: [PATCH 09/23] remove opteron and no-gcse switch modified: SiCortex64Gcc/cOpt modified: SunOS64Gcc/cOpt modified: linux64Gcc/c++Opt modified: linux64Gcc/cOpt modified: linux64Gcc/general modified: linux64Gcc42/c++Opt modified: linux64Gcc42/cOpt modified: linuxGcc/c++ modified: linuxGcc/cDebug modified: linuxGcc/general modified: linuxIA64Gcc/cOpt --- wmake/rules/SiCortex64Gcc/cOpt | 2 +- wmake/rules/SunOS64Gcc/cOpt | 2 +- wmake/rules/linux64Gcc/c++Opt | 2 +- wmake/rules/linux64Gcc/cOpt | 2 +- wmake/rules/linux64Gcc/general | 2 +- wmake/rules/linux64Gcc42/c++Opt | 2 +- wmake/rules/linux64Gcc42/cOpt | 2 +- wmake/rules/linuxGcc/c++ | 2 +- wmake/rules/linuxGcc/cDebug | 2 +- wmake/rules/linuxGcc/general | 3 ++- wmake/rules/linuxIA64Gcc/cOpt | 2 +- wmake/rules/linuxPPC64Gcc/cOpt | 2 +- 12 files changed, 13 insertions(+), 12 deletions(-) diff --git a/wmake/rules/SiCortex64Gcc/cOpt b/wmake/rules/SiCortex64Gcc/cOpt index aaaebef3d3..a8b0635478 100644 --- a/wmake/rules/SiCortex64Gcc/cOpt +++ b/wmake/rules/SiCortex64Gcc/cOpt @@ -1,2 +1,2 @@ cDBUG = -cOPT = -O3 -fno-gcse +cOPT = -O3 diff --git a/wmake/rules/SunOS64Gcc/cOpt b/wmake/rules/SunOS64Gcc/cOpt index aaaebef3d3..a8b0635478 100644 --- a/wmake/rules/SunOS64Gcc/cOpt +++ b/wmake/rules/SunOS64Gcc/cOpt @@ -1,2 +1,2 @@ cDBUG = -cOPT = -O3 -fno-gcse +cOPT = -O3 diff --git a/wmake/rules/linux64Gcc/c++Opt b/wmake/rules/linux64Gcc/c++Opt index f19996b72d..8ac07d2124 100644 --- a/wmake/rules/linux64Gcc/c++Opt +++ b/wmake/rules/linux64Gcc/c++Opt @@ -1,4 +1,4 @@ c++DBUG = -c++OPT = -march=opteron -O3 +c++OPT = -O3 #c++OPT = -march=nocona -O3 # -ftree-vectorize -ftree-vectorizer-verbose=3 diff --git a/wmake/rules/linux64Gcc/cOpt b/wmake/rules/linux64Gcc/cOpt index 7285a9de96..a8b0635478 100644 --- a/wmake/rules/linux64Gcc/cOpt +++ b/wmake/rules/linux64Gcc/cOpt @@ -1,2 +1,2 @@ cDBUG = -cOPT = -march=opteron -O3 -fno-gcse +cOPT = -O3 diff --git a/wmake/rules/linux64Gcc/general b/wmake/rules/linux64Gcc/general index 11b48acc3f..3c2e4db2ee 100644 --- a/wmake/rules/linux64Gcc/general +++ b/wmake/rules/linux64Gcc/general @@ -1,5 +1,5 @@ CPP = /lib/cpp $(GFLAGS) -LD = ld -A64 +LD = ld PROJECT_LIBS = -l$(WM_PROJECT) -liberty -ldl diff --git a/wmake/rules/linux64Gcc42/c++Opt b/wmake/rules/linux64Gcc42/c++Opt index f19996b72d..8ac07d2124 100644 --- a/wmake/rules/linux64Gcc42/c++Opt +++ b/wmake/rules/linux64Gcc42/c++Opt @@ -1,4 +1,4 @@ c++DBUG = -c++OPT = -march=opteron -O3 +c++OPT = -O3 #c++OPT = -march=nocona -O3 # -ftree-vectorize -ftree-vectorizer-verbose=3 diff --git a/wmake/rules/linux64Gcc42/cOpt b/wmake/rules/linux64Gcc42/cOpt index 7285a9de96..a8b0635478 100644 --- a/wmake/rules/linux64Gcc42/cOpt +++ b/wmake/rules/linux64Gcc42/cOpt @@ -1,2 +1,2 @@ cDBUG = -cOPT = -march=opteron -O3 -fno-gcse +cOPT = -O3 diff --git a/wmake/rules/linuxGcc/c++ b/wmake/rules/linuxGcc/c++ index ab2410d3d0..64d6797573 100644 --- a/wmake/rules/linuxGcc/c++ +++ b/wmake/rules/linuxGcc/c++ @@ -8,7 +8,7 @@ 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 -pthread +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) diff --git a/wmake/rules/linuxGcc/cDebug b/wmake/rules/linuxGcc/cDebug index 6c71ed93e8..72b638f458 100644 --- a/wmake/rules/linuxGcc/cDebug +++ b/wmake/rules/linuxGcc/cDebug @@ -1,2 +1,2 @@ cDBUG = -ggdb -DFULLDEBUG -cOPT = -O1 -finline-functions +cOPT = -O1 -fdefault-inline -finline-functions diff --git a/wmake/rules/linuxGcc/general b/wmake/rules/linuxGcc/general index c300368ee6..d009001a6e 100644 --- a/wmake/rules/linuxGcc/general +++ b/wmake/rules/linuxGcc/general @@ -1,10 +1,11 @@ CPP = /lib/cpp $(GFLAGS) LD = ld -melf_i386 -PROJECT_LIBS = -l$(WM_PROJECT) -ldl +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/linuxIA64Gcc/cOpt b/wmake/rules/linuxIA64Gcc/cOpt index aaaebef3d3..a8b0635478 100644 --- a/wmake/rules/linuxIA64Gcc/cOpt +++ b/wmake/rules/linuxIA64Gcc/cOpt @@ -1,2 +1,2 @@ cDBUG = -cOPT = -O3 -fno-gcse +cOPT = -O3 diff --git a/wmake/rules/linuxPPC64Gcc/cOpt b/wmake/rules/linuxPPC64Gcc/cOpt index e6512b7aab..17318709f1 100644 --- a/wmake/rules/linuxPPC64Gcc/cOpt +++ b/wmake/rules/linuxPPC64Gcc/cOpt @@ -1,2 +1,2 @@ cDBUG = -cOPT = -O3 -fno-gcse +cOPT = -O3 From 80d533325a06cf63ee194f1c3699eb001b70cf12 Mon Sep 17 00:00:00 2001 From: mattijs Date: Wed, 29 Apr 2009 11:56:08 +0100 Subject: [PATCH 10/23] added comment --- .../utilities/parallelProcessing/decomposePar/decomposePar.C | 3 +++ 1 file changed, 3 insertions(+) diff --git a/applications/utilities/parallelProcessing/decomposePar/decomposePar.C b/applications/utilities/parallelProcessing/decomposePar/decomposePar.C index 26ee3e062a..644511564e 100644 --- a/applications/utilities/parallelProcessing/decomposePar/decomposePar.C +++ b/applications/utilities/parallelProcessing/decomposePar/decomposePar.C @@ -37,6 +37,9 @@ Usage Write the cell distribution as a labelList for use with 'manual' decomposition method and as a volScalarField for post-processing. + @param -region regionName \n + Decompose named region. Does not check for existence of processor*. + @param -copyUniform \n Copy any @a uniform directories too. From d78cf44114abc8f9ee86db2ec236470192874577 Mon Sep 17 00:00:00 2001 From: mattijs Date: Thu, 30 Apr 2009 09:23:39 +0100 Subject: [PATCH 11/23] changed error messages --- .../surfaceInterpolation/schemes/FitData/FitData.C | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/finiteVolume/interpolation/surfaceInterpolation/schemes/FitData/FitData.C b/src/finiteVolume/interpolation/surfaceInterpolation/schemes/FitData/FitData.C index 28a3c41e64..c1ea44c1e8 100644 --- a/src/finiteVolume/interpolation/surfaceInterpolation/schemes/FitData/FitData.C +++ b/src/finiteVolume/interpolation/surfaceInterpolation/schemes/FitData/FitData.C @@ -56,7 +56,7 @@ Foam::FitData::FitData // Check input if (linearLimitFactor <= SMALL || linearLimitFactor > 3) { - FatalErrorIn("FitData::FitData") + FatalErrorIn("FitData::FitData(..)") << "linearLimitFactor requested = " << linearLimitFactor << " should be between zero and 3" << exit(FatalError); @@ -264,8 +264,7 @@ void Foam::FitData::calcFit // { WarningIn ( - "FitData::calcFit" - "(const List& C, const label facei" + "FitData::calcFit(..)" ) << "Could not fit face " << facei << " Weights = " << coeffsi << ", reverting to linear." << nl From 6b5f282937774e6a6d0ac68eabbbbdc8d62d76a3 Mon Sep 17 00:00:00 2001 From: mattijs Date: Thu, 30 Apr 2009 09:24:31 +0100 Subject: [PATCH 12/23] print ray directions --- .../radiation/radiationModel/fvDOM/fvDOM/fvDOM.C | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/thermophysicalModels/radiation/radiationModel/fvDOM/fvDOM/fvDOM.C b/src/thermophysicalModels/radiation/radiationModel/fvDOM/fvDOM/fvDOM.C index 9183931ba1..296b99ff9e 100644 --- a/src/thermophysicalModels/radiation/radiationModel/fvDOM/fvDOM/fvDOM.C +++ b/src/thermophysicalModels/radiation/radiationModel/fvDOM/fvDOM/fvDOM.C @@ -250,6 +250,15 @@ Foam::radiation::fvDOM::fvDOM(const volScalarField& T) ) ); } + + Info<< "fvDOM : Allocated " << IRay_.size() + << " rays with average orientation:" << nl; + forAll (IRay_, i) + { + Info<< '\t' << IRay_[i].I().name() + << '\t' << IRay_[i].dAve() << nl; + } + Info<< endl; } From fb1256521ac38cefb19d3c51bc283acf95e95872 Mon Sep 17 00:00:00 2001 From: mattijs Date: Thu, 30 Apr 2009 15:42:51 +0100 Subject: [PATCH 13/23] added options handling --- .../scotchDecomp/scotchDecomp.C | 128 +++++++++++++++--- 1 file changed, 109 insertions(+), 19 deletions(-) diff --git a/src/decompositionMethods/decompositionMethods/scotchDecomp/scotchDecomp.C b/src/decompositionMethods/decompositionMethods/scotchDecomp/scotchDecomp.C index 2746d8f4e9..854172d5e1 100644 --- a/src/decompositionMethods/decompositionMethods/scotchDecomp/scotchDecomp.C +++ b/src/decompositionMethods/decompositionMethods/scotchDecomp/scotchDecomp.C @@ -22,7 +22,40 @@ License along with OpenFOAM; if not, write to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA -S Strat=b{job=t,map=t,poli=S,sep=(m{asc=b{bnd=d{pass=40,dif=1,rem=1}f{move=80,pass=-1,bal=0.005},org=f{move=80,pass=-1,bal=0.005},width=3},low=h{pass=10}f{move=80,pass=-1,bal=0.0005},type=h,vert=80,rat=0.8}|m{asc=b{bnd=d{pass=40,dif=1,rem=1}f{move=80,pass=-1,bal=0.005},org=f{move=80,pass=-1,bal=0.005},width=3},low=h{pass=10}f{move=80,pass=-1,bal=0.0005},type=h,vert=80,rat=0.8})} + Default strategy: + Strat=b + { + job=t, + map=t, + poli=S, + sep= + ( + m + { + asc=b + { + bnd=d{pass=40,dif=1,rem=1}f{move=80,pass=-1,bal=0.005}, + org=f{move=80,pass=-1,bal=0.005},width=3 + }, + low=h{pass=10}f{move=80,pass=-1,bal=0.0005}, + type=h, + vert=80, + rat=0.8 + } + | m + { + asc=b + { + bnd=d{pass=40,dif=1,rem=1}f{move=80,pass=-1,bal=0.005}, + org=f{move=80,pass=-1,bal=0.005}, + width=3}, + low=h{pass=10}f{move=80,pass=-1,bal=0.0005}, + type=h, + vert=80, + rat=0.8 + } + ) + } \*---------------------------------------------------------------------------*/ #include "scotchDecomp.H" @@ -31,6 +64,7 @@ S Strat=b{job=t,map=t,poli=S,sep=(m{asc=b{bnd=d{pass=40,dif=1,rem=1}f{move #include "IFstream.H" #include "Time.H" #include "cyclicPolyPatch.H" +#include "OFstream.H" extern "C" { @@ -113,46 +147,102 @@ Foam::label Foam::scotchDecomp::decompose check(SCOTCH_graphCheck(&grafdat), "SCOTCH_graphCheck"); + // Dump graph + if (decompositionDict_.found("scotchCoeffs")) + { + const dictionary& scotchCoeffs = + decompositionDict_.subDict("scotchCoeffs"); - //// Architecture - //// ~~~~~~~~~~~~ - //// (fully connected network topology since using switch) - // - //SCOTCH_Arch archdat; - //check(SCOTCH_archInit(&archdat), "SCOTCH_archInit"); - //check - //( - // // SCOTCH_archCmpltw for weighted. - // SCOTCH_archCmplt(&archdat, nProcessors_), - // "SCOTCH_archCmplt" - //); + Switch writeGraph(scotchCoeffs.lookup("writeGraph")); + + if (writeGraph) + { + OFstream str(mesh_.time().path() / mesh_.name() + ".grf"); + + Info<< "Dumping Scotch graph file to " << str.name() << endl + << "Use this in combination with gpart." << endl; + + label version = 0; + str << version << nl; + // Numer of vertices + str << xadj.size()-1 << ' ' << adjncy.size() << nl; + // Numbering starts from 0 + label baseval = 0; + // Has weights? + label hasEdgeWeights = 0; + label hasVertexWeights = 0; + label numericflag = 10*hasEdgeWeights+hasVertexWeights; + str << baseval << ' ' << numericflag << nl; + for (label cellI = 0; cellI < xadj.size()-1; cellI++) + { + label start = xadj[cellI]; + label end = xadj[cellI+1]; + str << end-start; + + for (label i = start; i < end; i++) + { + str << ' ' << adjncy[i]; + } + str << nl; + } + } + } + // Architecture + // ~~~~~~~~~~~~ + // (fully connected network topology since using switch) + + SCOTCH_Arch archdat; + check(SCOTCH_archInit(&archdat), "SCOTCH_archInit"); + check + ( + // SCOTCH_archCmpltw for weighted. + SCOTCH_archCmplt(&archdat, nProcessors_), + "SCOTCH_archCmplt" + ); //SCOTCH_Mapping mapdat; //SCOTCH_graphMapInit(&grafdat, &mapdat, &archdat, NULL); //SCOTCH_graphMapCompute(&grafdat, &mapdat, &stradat); /* Perform mapping */ + //SCOTCH_graphMapExit(&grafdat, &mapdat); - + finalDecomp.setSize(xadj.size()-1); + finalDecomp = 0; check ( - SCOTCH_graphPart + SCOTCH_graphMap ( &grafdat, - nProcessors_, // partnbr + &archdat, &stradat, // const SCOTCH_Strat * finalDecomp.begin() // parttab ), - "SCOTCH_graphPart" + "SCOTCH_graphMap" ); + + //finalDecomp.setSize(xadj.size()-1); + //check + //( + // SCOTCH_graphPart + // ( + // &grafdat, + // nProcessors_, // partnbr + // &stradat, // const SCOTCH_Strat * + // finalDecomp.begin() // parttab + // ), + // "SCOTCH_graphPart" + //); + // Release storage for graph SCOTCH_graphExit(&grafdat); + // Release storage for strategy SCOTCH_stratExit(&stradat); - //// Release storage for network topology - //SCOTCH_archExit(&archdat); + // Release storage for network topology + SCOTCH_archExit(&archdat); return 0; } From cb97fa675ea65da151b33916fbcde1d11649782f Mon Sep 17 00:00:00 2001 From: mattijs Date: Thu, 30 Apr 2009 15:43:20 +0100 Subject: [PATCH 14/23] use total number of cells/points in parallel --- src/meshTools/cellClassification/cellClassification.C | 8 ++++---- src/meshTools/cellDist/patchWave/patchDataWave.C | 2 +- src/meshTools/cellDist/patchWave/patchWave.C | 4 ++-- .../LES/LESdeltas/smoothDelta/smoothDelta.C | 2 +- 4 files changed, 8 insertions(+), 8 deletions(-) diff --git a/src/meshTools/cellClassification/cellClassification.C b/src/meshTools/cellClassification/cellClassification.C index 9adf4c6526..f54876c9c5 100644 --- a/src/meshTools/cellClassification/cellClassification.C +++ b/src/meshTools/cellClassification/cellClassification.C @@ -323,10 +323,10 @@ void Foam::cellClassification::markCells MeshWave cellInfoCalc ( mesh_, - changedFaces, // Labels of changed faces - changedFacesInfo, // Information on changed faces - cellInfoList, // Information on all cells - mesh_.nCells() // max iterations + changedFaces, // Labels of changed faces + changedFacesInfo, // Information on changed faces + cellInfoList, // Information on all cells + mesh_.globalData().nTotalCells() // max iterations ); // Get information out of cellInfoList diff --git a/src/meshTools/cellDist/patchWave/patchDataWave.C b/src/meshTools/cellDist/patchWave/patchDataWave.C index 4bd42721ba..b22a110be6 100644 --- a/src/meshTools/cellDist/patchWave/patchDataWave.C +++ b/src/meshTools/cellDist/patchWave/patchDataWave.C @@ -226,7 +226,7 @@ void Foam::patchDataWave::correct() mesh(), changedFaces, faceDist, - mesh().nCells() // max iterations + mesh().globalData().nTotalCells() // max iterations ); diff --git a/src/meshTools/cellDist/patchWave/patchWave.C b/src/meshTools/cellDist/patchWave/patchWave.C index 7cb3705925..f48d383559 100644 --- a/src/meshTools/cellDist/patchWave/patchWave.C +++ b/src/meshTools/cellDist/patchWave/patchWave.C @@ -28,7 +28,7 @@ License #include "polyMesh.H" #include "wallPoint.H" #include "MeshWave.H" - +#include "globalMeshData.H" // * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * // @@ -187,7 +187,7 @@ void Foam::patchWave::correct() mesh(), changedFaces, faceDist, - mesh().nCells() // max iterations + mesh().globalData().nTotalCells() // max iterations ); diff --git a/src/turbulenceModels/LES/LESdeltas/smoothDelta/smoothDelta.C b/src/turbulenceModels/LES/LESdeltas/smoothDelta/smoothDelta.C index 7b836c60ee..bea05e9973 100644 --- a/src/turbulenceModels/LES/LESdeltas/smoothDelta/smoothDelta.C +++ b/src/turbulenceModels/LES/LESdeltas/smoothDelta/smoothDelta.C @@ -138,7 +138,7 @@ void smoothDelta::calcDelta() changedFacesInfo, faceDeltaData, cellDeltaData, - mesh_.nCells() // max iterations + mesh_.globalData().nTotalCells() // max iterations ); forAll(delta_, cellI) From 3d88003e77fa2b6df40eb62b44b7a6ae045fd7a2 Mon Sep 17 00:00:00 2001 From: mattijs Date: Thu, 30 Apr 2009 20:31:13 +0100 Subject: [PATCH 15/23] order of creation consistent with cyclics --- .../createBaffles/createBaffles.C | 357 +++++++++--------- 1 file changed, 170 insertions(+), 187 deletions(-) diff --git a/applications/utilities/mesh/manipulation/createBaffles/createBaffles.C b/applications/utilities/mesh/manipulation/createBaffles/createBaffles.C index 051f74968b..c802049f83 100644 --- a/applications/utilities/mesh/manipulation/createBaffles/createBaffles.C +++ b/applications/utilities/mesh/manipulation/createBaffles/createBaffles.C @@ -48,157 +48,6 @@ using namespace Foam; // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // -void createBaffles -( - const polyMesh& mesh, - const label faceI, - const label oldPatchI, - const labelList& newPatches, - PackedBoolList& doneFace, - polyTopoChange& meshMod -) -{ - const polyBoundaryMesh& patches = mesh.boundaryMesh(); - const faceZoneMesh& faceZones = mesh.faceZones(); - - const face& f = mesh.faces()[faceI]; - label zoneID = faceZones.whichZone(faceI); - bool zoneFlip = false; - if (zoneID >= 0) - { - const faceZone& fZone = faceZones[zoneID]; - zoneFlip = fZone.flipMap()[fZone.whichFace(faceI)]; - } - label nei = -1; - if (oldPatchI == -1) - { - nei = mesh.faceNeighbour()[faceI]; - } - - - face revFace(f.reverseFace()); - - forAll(newPatches, i) - { - if (oldPatchI == -1) - { - // Internal face - if (doneFace.set(faceI)) - { - // First usage of face. Modify. - meshMod.setAction - ( - polyModifyFace - ( - f, // modified face - faceI, // label of face - mesh.faceOwner()[faceI], // owner - -1, // neighbour - false, // face flip - newPatches[i], // patch for face - false, // remove from zone - zoneID, // zone for face - zoneFlip // face flip in zone - ) - ); - } - else - { - // Second or more usage of face. Add. - meshMod.setAction - ( - polyAddFace - ( - f, // modified face - mesh.faceOwner()[faceI], // owner - -1, // neighbour - -1, // master point - -1, // master edge - faceI, // master face - false, // face flip - newPatches[i], // patch for face - zoneID, // zone for face - zoneFlip // face flip in zone - ) - ); - } - - meshMod.setAction - ( - polyAddFace - ( - revFace, // modified face - nei, // owner - -1, // neighbour - -1, // masterPointID - -1, // masterEdgeID - faceI, // masterFaceID, - true, // face flip - newPatches[i], // patch for face - zoneID, // zone for face - zoneFlip // face flip in zone - ) - ); - } - else if - ( - patches[oldPatchI].coupled() - && patches[newPatches[i]].coupled() - ) - { - // Do not allow coupled patches to be moved to different coupled - // patches. - //WarningIn("createBaffles()") - // << "Not moving face from coupled patch " - // << patches[oldPatchI].name() - // << " to another coupled patch " << patches[newPatches[i]] - // << endl; - } - else - { - if (doneFace.set(faceI)) - { - meshMod.setAction - ( - polyModifyFace - ( - f, // modified face - faceI, // label of face - mesh.faceOwner()[faceI], // owner - -1, // neighbour - false, // face flip - newPatches[i], // patch for face - false, // remove from zone - zoneID, // zone for face - zoneFlip // face flip in zone - ) - ); - } - else - { - meshMod.setAction - ( - polyAddFace - ( - f, // modified face - mesh.faceOwner()[faceI], // owner - -1, // neighbour - -1, // master point - -1, // master edge - faceI, // master face - false, // face flip - newPatches[i], // patch for face - zoneID, // zone for face - zoneFlip // face flip in zone - ) - ); - } - } - } -} - - - // Main program: int main(int argc, char *argv[]) @@ -215,15 +64,16 @@ int main(int argc, char *argv[]) const word oldInstance = mesh.pointsInstance(); const polyBoundaryMesh& patches = mesh.boundaryMesh(); + const faceZoneMesh& faceZones = mesh.faceZones(); // Faces to baffle word setName(args.additionalArgs()[0]); - Pout<< "Reading faceSet from " << setName << nl << endl; + Info<< "Reading faceSet from " << setName << nl << endl; faceSet facesToSplit(mesh, setName); // Make sure set is synchronised across couples facesToSplit.sync(mesh); - Pout<< "Read " << facesToSplit.size() << " faces from " << setName - << nl << endl; + Info<< "Read " << returnReduce(facesToSplit.size(), sumOp