diff --git a/doc/changes/splitCyclic.txt b/doc/changes/splitCyclic.txt index 814dfe0850cd3c4afe0857cbf24c7d1a34f687cc..3d0ffb71cf5e414f24f51731ce7a96ca404ef425 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) diff --git a/src/finiteVolume/fields/fvPatchFields/derived/directMappedVelocityFluxFixedValue/directMappedVelocityFluxFixedValueFvPatchField.C b/src/finiteVolume/fields/fvPatchFields/derived/directMappedVelocityFluxFixedValue/directMappedVelocityFluxFixedValueFvPatchField.C index 716c5b12355da55d364cf67daaf22df42dc24c7d..17fa6f71fb093b1b6fcc72eaed4c93577cf95c2e 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<const directMappedPolyPatch> - ( - this->patch().patch() - ); - (void)mpp.map().schedule(); } diff --git a/src/finiteVolume/fvMesh/singleCellFvMesh/singleCellFvMesh.C b/src/finiteVolume/fvMesh/singleCellFvMesh/singleCellFvMesh.C index 4955f49007d6236fc0a8a7dfccd1f781c8dc3f39..8eaf3559f582002812642e58e3d0c789218ced0b 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; diff --git a/src/meshTools/indexedOctree/indexedOctree.C b/src/meshTools/indexedOctree/indexedOctree.C index 3f85828c09fd9d5a17803c9c699cbeaf86c0c5af..9971bd97b4020119e2c7323ec817abe174573ff4 100644 --- a/src/meshTools/indexedOctree/indexedOctree.C +++ b/src/meshTools/indexedOctree/indexedOctree.C @@ -2794,6 +2794,30 @@ Foam::indexedOctree<Type>::getVolumeType } +template <class Type> +template <class CompareOp> +void Foam::indexedOctree<Type>::findNear +( + const scalar nearDist, + const indexedOctree<Type>& tree2, + CompareOp& cop +) const +{ + findNear + ( + nearDist, + true, + *this, + nodePlusOctant(0, 0), + bb(), + tree2, + nodePlusOctant(0, 0), + tree2.bb(), + cop + ); +} + + // Print contents of nodeI template <class Type> void Foam::indexedOctree<Type>::print diff --git a/src/postProcessing/functionObjects/field/streamLine/streamLineParticle.C b/src/postProcessing/functionObjects/field/streamLine/streamLineParticle.C index ce90b7a55d86eab9c606ed8710a27ae9ee6a704b..56b05c88caf9b1f39c3ebf21f79258629363ce7f 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)