From e91c2d7d627fe4798371dd8273b65fe80b251098 Mon Sep 17 00:00:00 2001 From: mattijs Date: Wed, 6 Oct 2010 12:06:15 +0100 Subject: [PATCH 1/5] BUG: streamLine : store paths for stagnant particles. --- .../functionObjects/field/streamLine/streamLineParticle.C | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/postProcessing/functionObjects/field/streamLine/streamLineParticle.C b/src/postProcessing/functionObjects/field/streamLine/streamLineParticle.C index ce90b7a55d..56b05c88ca 100644 --- a/src/postProcessing/functionObjects/field/streamLine/streamLineParticle.C +++ b/src/postProcessing/functionObjects/field/streamLine/streamLineParticle.C @@ -168,7 +168,6 @@ bool Foam::streamLineParticle::move(streamLineParticle::trackData& td) td.keepParticle && !td.switchProcessor && lifeTime_ > 0 - && tEnd > ROOTVSMALL ) { // TBD: implement subcycling so step through cells in more than @@ -191,6 +190,12 @@ bool Foam::streamLineParticle::move(streamLineParticle::trackData& td) tEnd -= dt; stepFraction() = 1.0 - tEnd/deltaT; + + if (tEnd <= ROOTVSMALL) + { + // Force removal + lifeTime_ = 0; + } } if (!td.keepParticle || lifeTime_ == 0) From 2b7f905fbd1389ae15331cc42c89550550915a34 Mon Sep 17 00:00:00 2001 From: mattijs Date: Wed, 6 Oct 2010 12:06:52 +0100 Subject: [PATCH 2/5] ENH: splitCyclics.txt : updated --- doc/changes/splitCyclic.txt | 18 +++++++----------- 1 file changed, 7 insertions(+), 11 deletions(-) diff --git a/doc/changes/splitCyclic.txt b/doc/changes/splitCyclic.txt index 814dfe0850..3d0ffb71cf 100644 --- a/doc/changes/splitCyclic.txt +++ b/doc/changes/splitCyclic.txt @@ -20,7 +20,8 @@ The disadvantages: - a patch-wise loop now might need to store data to go to the neighbour half since it is no longer handled in a single patch. - decomposed cyclics now require overlapping communications so will -only work in non-blocking mode. Hence the underlying message passing library +only work in 'nonBlocking' mode or 'blocking' (=buffered) mode but not +in 'scheduled' mode. The underlying message passing library will require overlapping communications with message tags. - it is quite a code-change and there might be some oversights. - once converted (see foamUpgradeCyclics below) cases are not backwards @@ -103,19 +104,14 @@ type 'processorCyclic'. - processor patches use overlapping communication using a different message -tag. This maps straight through into the MPI message tag. -See processorCyclicPolyPatch::tag(). This needs to be calculated the -same on both sides so is calculated as - Pstream::nProcs()*max(myProcNo, neighbProcNo) - + min(myProcNo, neighbProcNo) -which is -- unique -- commutative -- does not interfere with the default tag (= 1) +tag. This maps straight through into the MPI message tag. Each processor +'interface' (processorPolyPatch, processorFvPatch, etc.) has a 'tag()' +to use for communication. - when constructing a GeometricField from a dictionary it will explicitly check for non-existing entries for cyclic patches and exit with an error message -warning to run foamUpgradeCyclics. +warning to run foamUpgradeCyclics. (1.7.x will check if you are trying +to run a case which has split cyclics) From 08a20c5bd19bdebb4c3c37f2e90cd5ebd12b2bbe Mon Sep 17 00:00:00 2001 From: mattijs Date: Wed, 6 Oct 2010 12:45:42 +0100 Subject: [PATCH 3/5] BUG: indexedOctree : missing access function --- src/meshTools/indexedOctree/indexedOctree.C | 24 +++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/src/meshTools/indexedOctree/indexedOctree.C b/src/meshTools/indexedOctree/indexedOctree.C index 3f85828c09..9971bd97b4 100644 --- a/src/meshTools/indexedOctree/indexedOctree.C +++ b/src/meshTools/indexedOctree/indexedOctree.C @@ -2794,6 +2794,30 @@ Foam::indexedOctree::getVolumeType } +template +template +void Foam::indexedOctree::findNear +( + const scalar nearDist, + const indexedOctree& tree2, + CompareOp& cop +) const +{ + findNear + ( + nearDist, + true, + *this, + nodePlusOctant(0, 0), + bb(), + tree2, + nodePlusOctant(0, 0), + tree2.bb(), + cop + ); +} + + // Print contents of nodeI template void Foam::indexedOctree::print From 04c5454b211e333b835d544eb49316d100ed1617 Mon Sep 17 00:00:00 2001 From: mattijs Date: Wed, 6 Oct 2010 14:34:22 +0100 Subject: [PATCH 4/5] ENH: directMappedVelocityFlux : do not evaluate upon read --- .../directMappedVelocityFluxFixedValueFvPatchField.C | 7 ------- 1 file changed, 7 deletions(-) diff --git a/src/finiteVolume/fields/fvPatchFields/derived/directMappedVelocityFluxFixedValue/directMappedVelocityFluxFixedValueFvPatchField.C b/src/finiteVolume/fields/fvPatchFields/derived/directMappedVelocityFluxFixedValue/directMappedVelocityFluxFixedValueFvPatchField.C index 716c5b1235..17fa6f71fb 100644 --- a/src/finiteVolume/fields/fvPatchFields/derived/directMappedVelocityFluxFixedValue/directMappedVelocityFluxFixedValueFvPatchField.C +++ b/src/finiteVolume/fields/fvPatchFields/derived/directMappedVelocityFluxFixedValue/directMappedVelocityFluxFixedValueFvPatchField.C @@ -112,13 +112,6 @@ directMappedVelocityFluxFixedValueFvPatchField << " in file " << dimensionedInternalField().objectPath() << exit(FatalError); } - - // Force calculation of schedule (uses parallel comms) - const directMappedPolyPatch& mpp = refCast - ( - this->patch().patch() - ); - (void)mpp.map().schedule(); } From dfbcf6eb463e3f99b4534069b046a137679be7e0 Mon Sep 17 00:00:00 2001 From: mattijs Date: Wed, 6 Oct 2010 16:20:55 +0100 Subject: [PATCH 5/5] BUG: singleCellFvMesh : locally (but not globally) zero sized patches --- .../singleCellFvMesh/singleCellFvMesh.C | 34 ++++++++++--------- 1 file changed, 18 insertions(+), 16 deletions(-) diff --git a/src/finiteVolume/fvMesh/singleCellFvMesh/singleCellFvMesh.C b/src/finiteVolume/fvMesh/singleCellFvMesh/singleCellFvMesh.C index 4955f49007..8eaf3559f5 100644 --- a/src/finiteVolume/fvMesh/singleCellFvMesh/singleCellFvMesh.C +++ b/src/finiteVolume/fvMesh/singleCellFvMesh/singleCellFvMesh.C @@ -42,24 +42,26 @@ void Foam::singleCellFvMesh::agglomerateMesh const polyBoundaryMesh& oldPatches = mesh.boundaryMesh(); // Check agglomeration within patch face range and continuous - labelList nAgglom(oldPatches.size()); + labelList nAgglom(oldPatches.size(), 0); forAll(oldPatches, patchI) { const polyPatch& pp = oldPatches[patchI]; - - nAgglom[patchI] = max(agglom[patchI])+1; - - forAll(pp, i) + if (pp.size() > 0) { - if (agglom[patchI][i] < 0 || agglom[patchI][i] >= pp.size()) + nAgglom[patchI] = max(agglom[patchI])+1; + + forAll(pp, i) { - FatalErrorIn - ( - "singleCellFvMesh::agglomerateMesh(..)" - ) << "agglomeration on patch " << patchI - << " is out of range 0.." << pp.size()-1 - << exit(FatalError); + if (agglom[patchI][i] < 0 || agglom[patchI][i] >= pp.size()) + { + FatalErrorIn + ( + "singleCellFvMesh::agglomerateMesh(..)" + ) << "agglomeration on patch " << patchI + << " is out of range 0.." << pp.size()-1 + << exit(FatalError); + } } } } @@ -155,6 +157,8 @@ void Foam::singleCellFvMesh::agglomerateMesh forAll(oldPatches, patchI) { + patchStarts[patchI] = coarseI; + const polyPatch& pp = oldPatches[patchI]; if (pp.size() > 0) @@ -170,8 +174,6 @@ void Foam::singleCellFvMesh::agglomerateMesh // From agglomeration to compact patch face labelList agglomToFace(nAgglom[patchI], -1); - patchStarts[patchI] = coarseI; - forAll(pp, i) { label myAgglom = agglom[patchI][i]; @@ -223,9 +225,9 @@ void Foam::singleCellFvMesh::agglomerateMesh ); } } - - patchSizes[patchI] = coarseI-patchStarts[patchI]; } + + patchSizes[patchI] = coarseI-patchStarts[patchI]; } //Pout<< "patchStarts:" << patchStarts << endl;