diff --git a/src/OpenFOAM/db/IOstreams/Pstreams/PstreamReduceOps.H b/src/OpenFOAM/db/IOstreams/Pstreams/PstreamReduceOps.H index 1099f53c2..94d3f746d 100644 --- a/src/OpenFOAM/db/IOstreams/Pstreams/PstreamReduceOps.H +++ b/src/OpenFOAM/db/IOstreams/Pstreams/PstreamReduceOps.H @@ -48,7 +48,7 @@ void reduce { Pstream::gather(comms, Value, bop); Pstream::scatter(comms, Value); -} +} // Reduce using either linear or tree communication schedule @@ -67,7 +67,7 @@ void reduce { reduce(Pstream::treeCommunication(), Value, bop); } -} +} // Reduce using either linear or tree communication schedule @@ -90,7 +90,7 @@ T returnReduce } return WorkValue; -} +} // Insist there is a specialisation for the reduction of a scalar diff --git a/src/OpenFOAM/fields/PointPatchFields/PointPatchField/PointPatchField.H b/src/OpenFOAM/fields/PointPatchFields/PointPatchField/PointPatchField.H index 7d5e64cfc..a228a70e7 100644 --- a/src/OpenFOAM/fields/PointPatchFields/PointPatchField/PointPatchField.H +++ b/src/OpenFOAM/fields/PointPatchFields/PointPatchField/PointPatchField.H @@ -384,14 +384,14 @@ public: //- Initialise evaluation of the patch field (do nothing) virtual void initEvaluate ( - const Pstream::commsTypes commsType=Pstream::blocking + const Pstream::commsTypes commsType = Pstream::blocking ) {} //- Evaluate the patch field virtual void evaluate ( - const Pstream::commsTypes commsType=Pstream::blocking + const Pstream::commsTypes commsType = Pstream::blocking ); //- Update boundary value diff --git a/src/OpenFOAM/fields/PointPatchFields/basic/coupled/CoupledPointPatchField.H b/src/OpenFOAM/fields/PointPatchFields/basic/coupled/CoupledPointPatchField.H index 948731723..92dc78878 100644 --- a/src/OpenFOAM/fields/PointPatchFields/basic/coupled/CoupledPointPatchField.H +++ b/src/OpenFOAM/fields/PointPatchFields/basic/coupled/CoupledPointPatchField.H @@ -147,7 +147,7 @@ public: //- Evaluate the patch field virtual void evaluate ( - const Pstream::commsTypes commsType=Pstream::blocking + const Pstream::commsTypes commsType = Pstream::blocking ) = 0; //- Add field to internal field diff --git a/src/OpenFOAM/fields/PointPatchFields/basic/fixedValue/FixedValuePointPatchField.C b/src/OpenFOAM/fields/PointPatchFields/basic/fixedValue/FixedValuePointPatchField.C index 396c8b5f4..1f9f8a36f 100644 --- a/src/OpenFOAM/fields/PointPatchFields/basic/fixedValue/FixedValuePointPatchField.C +++ b/src/OpenFOAM/fields/PointPatchFields/basic/fixedValue/FixedValuePointPatchField.C @@ -208,7 +208,7 @@ FixedValuePointPatchField { Field::operator=(ptf); - // insert the result into the internal field + // Insert the result into the internal field initEvaluate(); } @@ -243,7 +243,8 @@ template template class MatrixType, class Type > -void FixedValuePointPatchField:: +void +FixedValuePointPatchField:: operator== ( const Type& t diff --git a/src/OpenFOAM/fields/PointPatchFields/basic/fixedValue/FixedValuePointPatchField.H b/src/OpenFOAM/fields/PointPatchFields/basic/fixedValue/FixedValuePointPatchField.H index 37f805f28..a32d29b76 100644 --- a/src/OpenFOAM/fields/PointPatchFields/basic/fixedValue/FixedValuePointPatchField.H +++ b/src/OpenFOAM/fields/PointPatchFields/basic/fixedValue/FixedValuePointPatchField.H @@ -138,7 +138,7 @@ public: // there's nothing to do virtual void initEvaluate ( - const Pstream::commsTypes commsType=Pstream::blocking + const Pstream::commsTypes commsType = Pstream::blocking ) { ValuePointPatchField @@ -148,7 +148,7 @@ public: virtual void evaluate ( - const Pstream::commsTypes commsType=Pstream::blocking + const Pstream::commsTypes commsType = Pstream::blocking ) {} diff --git a/src/OpenFOAM/fields/PointPatchFields/basic/value/ValuePointPatchField.H b/src/OpenFOAM/fields/PointPatchFields/basic/value/ValuePointPatchField.H index e6c2f502f..c89763f13 100644 --- a/src/OpenFOAM/fields/PointPatchFields/basic/value/ValuePointPatchField.H +++ b/src/OpenFOAM/fields/PointPatchFields/basic/value/ValuePointPatchField.H @@ -178,7 +178,7 @@ public: //- Evaluate the patch field virtual void evaluate ( - const Pstream::commsTypes commsType=Pstream::blocking + const Pstream::commsTypes commsType = Pstream::blocking ); //- Update boundary value diff --git a/src/OpenFOAM/fields/PointPatchFields/constraint/cyclic/CyclicPointPatchField.H b/src/OpenFOAM/fields/PointPatchFields/constraint/cyclic/CyclicPointPatchField.H index 5d46418ff..8b3207717 100644 --- a/src/OpenFOAM/fields/PointPatchFields/constraint/cyclic/CyclicPointPatchField.H +++ b/src/OpenFOAM/fields/PointPatchFields/constraint/cyclic/CyclicPointPatchField.H @@ -186,7 +186,7 @@ public: //- Evaluate the patch field virtual void evaluate ( - const Pstream::commsTypes commsType=Pstream::blocking + const Pstream::commsTypes commsType = Pstream::blocking ) {} diff --git a/src/OpenFOAM/fields/PointPatchFields/constraint/processor/ProcessorPointPatchField.H b/src/OpenFOAM/fields/PointPatchFields/constraint/processor/ProcessorPointPatchField.H index 910a6569b..4afe96f86 100644 --- a/src/OpenFOAM/fields/PointPatchFields/constraint/processor/ProcessorPointPatchField.H +++ b/src/OpenFOAM/fields/PointPatchFields/constraint/processor/ProcessorPointPatchField.H @@ -259,7 +259,7 @@ public: //- Does the patch field perform the transfromation virtual bool doTransform() const { - return + return !( procPatch_.procPolyPatch().parallel() || pTraits::rank == 0 @@ -269,13 +269,13 @@ public: //- Initialise evaluation of the patch field virtual void initEvaluate ( - const Pstream::commsTypes commsType=Pstream::blocking + const Pstream::commsTypes commsType = Pstream::blocking ); //- Evaluate the patch field virtual void evaluate ( - const Pstream::commsTypes commsType=Pstream::blocking + const Pstream::commsTypes commsType = Pstream::blocking ); //- Init add field to internal field diff --git a/src/OpenFOAM/fields/PointPatchFields/constraint/wedge/WedgePointPatchField.H b/src/OpenFOAM/fields/PointPatchFields/constraint/wedge/WedgePointPatchField.H index ce35c6349..4d2239e9c 100644 --- a/src/OpenFOAM/fields/PointPatchFields/constraint/wedge/WedgePointPatchField.H +++ b/src/OpenFOAM/fields/PointPatchFields/constraint/wedge/WedgePointPatchField.H @@ -152,7 +152,7 @@ public: //- Update the patch field virtual void evaluate ( - const Pstream::commsTypes commsType=Pstream::blocking + const Pstream::commsTypes commsType = Pstream::blocking ); }; diff --git a/src/OpenFOAM/fields/PointPatchFields/derived/componentMixed/ComponentMixedPointPatchVectorField.H b/src/OpenFOAM/fields/PointPatchFields/derived/componentMixed/ComponentMixedPointPatchVectorField.H index 0532d133e..353c6350f 100644 --- a/src/OpenFOAM/fields/PointPatchFields/derived/componentMixed/ComponentMixedPointPatchVectorField.H +++ b/src/OpenFOAM/fields/PointPatchFields/derived/componentMixed/ComponentMixedPointPatchVectorField.H @@ -28,7 +28,7 @@ Class fixedValue/zeroGradient mix may be different for each direction. I am still not sure how to do the fixedValue-fixedGradient - combination. + combination. HJ, date deleted Description diff --git a/src/OpenFOAM/fields/PointPatchFields/derived/global/GlobalPointPatchField.C b/src/OpenFOAM/fields/PointPatchFields/derived/global/GlobalPointPatchField.C index bd8cbe645..541f91d71 100644 --- a/src/OpenFOAM/fields/PointPatchFields/derived/global/GlobalPointPatchField.C +++ b/src/OpenFOAM/fields/PointPatchFields/derived/global/GlobalPointPatchField.C @@ -508,29 +508,33 @@ void GlobalPointPatchField // Create the global list and insert local values if (globalPointPatch_.globalPointSize() > 0) { - Field gpf - ( - globalPointPatch_.globalPointSize(), - pTraits::zero - ); + // Bug fix: use map-based communication. HJ, 18/Nov/2010 + // Get addressing const labelList& sharedPointAddr = globalPointPatch_.sharedPointAddr(); + + // Get internal field data Field pField = this->patchInternalField(); + // Pack data into a map + Map dataMap; + forAll (sharedPointAddr, i) { - gpf[sharedPointAddr[i]] = pField[i]; + dataMap.insert(sharedPointAddr[i], pField[i]); } - combineReduce(gpf, eqOp >()); + // Communicate map + Pstream::mapCombineGather(dataMap, eqOp()); + Pstream::mapCombineScatter(dataMap); // Extract local data Field lpf(sharedPointAddr.size()); forAll (sharedPointAddr, i) { - lpf[i] = gpf[sharedPointAddr[i]]; + lpf[i] = dataMap[sharedPointAddr[i]]; } // Get addressing and enforce values on all processors diff --git a/src/OpenFOAM/fields/PointPatchFields/derived/global/GlobalPointPatchField.H b/src/OpenFOAM/fields/PointPatchFields/derived/global/GlobalPointPatchField.H index c9946467e..d7af021b1 100644 --- a/src/OpenFOAM/fields/PointPatchFields/derived/global/GlobalPointPatchField.H +++ b/src/OpenFOAM/fields/PointPatchFields/derived/global/GlobalPointPatchField.H @@ -185,7 +185,7 @@ public: //- Evaluate the patch field virtual void evaluate ( - const Pstream::commsTypes commsType=Pstream::blocking + const Pstream::commsTypes commsType = Pstream::blocking ); //- Add field to internal field diff --git a/src/OpenFOAM/fields/PointPatchFields/derived/oscillatingFixedValue/OscillatingFixedValuePointPatchField.H b/src/OpenFOAM/fields/PointPatchFields/derived/oscillatingFixedValue/OscillatingFixedValuePointPatchField.H index fa70d9f3b..9a53dfc59 100644 --- a/src/OpenFOAM/fields/PointPatchFields/derived/oscillatingFixedValue/OscillatingFixedValuePointPatchField.H +++ b/src/OpenFOAM/fields/PointPatchFields/derived/oscillatingFixedValue/OscillatingFixedValuePointPatchField.H @@ -216,7 +216,7 @@ public: // there's nothing to do virtual void initEvaluate ( - const Pstream::commsTypes commsType=Pstream::blocking + const Pstream::commsTypes commsType = Pstream::blocking ); //- Write diff --git a/src/OpenFOAM/meshes/polyMesh/globalMeshData/globalMeshData.C b/src/OpenFOAM/meshes/polyMesh/globalMeshData/globalMeshData.C index fa1062410..9da720900 100644 --- a/src/OpenFOAM/meshes/polyMesh/globalMeshData/globalMeshData.C +++ b/src/OpenFOAM/meshes/polyMesh/globalMeshData/globalMeshData.C @@ -660,7 +660,7 @@ Foam::pointField Foam::globalMeshData::geometricSharedPoints() const combineReduce(sharedPoints, plusEqOp()); // Merge tolerance - scalar tolDim = matchTol_ * bb_.mag(); + scalar tolDim = matchTol_*bb_.mag(); // And see how many are unique labelList pMap; diff --git a/src/OpenFOAM/meshes/polyMesh/syncTools/syncToolsTemplates.C b/src/OpenFOAM/meshes/polyMesh/syncTools/syncToolsTemplates.C index b55e5c890..37a7bfdaf 100644 --- a/src/OpenFOAM/meshes/polyMesh/syncTools/syncToolsTemplates.C +++ b/src/OpenFOAM/meshes/polyMesh/syncTools/syncToolsTemplates.C @@ -22,7 +22,7 @@ License along with OpenFOAM; if not, write to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA -\*----------------------------------------------------------------------------*/ +\*---------------------------------------------------------------------------*/ #include "syncTools.H" #include "polyMesh.H" @@ -306,9 +306,9 @@ void Foam::syncTools::syncPointMap } } - //- Note: hasTransformation is only used for warning messages so - // reduction not strictly nessecary. - //reduce(hasTransformation, orOp()); + // Note: hasTransformation is only used for warning messages so + // reduction not strictly nessecary. + // reduce(hasTransformation, orOp()); // Synchronize multiple shared points. const globalMeshData& pd = mesh.globalData(); diff --git a/src/dynamicMesh/meshMotion/tetDecompositionMotionSolver/tetDecompositionMotionSolver/laplace/laplaceTetDecompositionMotionSolver.C b/src/dynamicMesh/meshMotion/tetDecompositionMotionSolver/tetDecompositionMotionSolver/laplace/laplaceTetDecompositionMotionSolver.C index eb3c0d6a0..6cd3ed15b 100644 --- a/src/dynamicMesh/meshMotion/tetDecompositionMotionSolver/tetDecompositionMotionSolver/laplace/laplaceTetDecompositionMotionSolver.C +++ b/src/dynamicMesh/meshMotion/tetDecompositionMotionSolver/tetDecompositionMotionSolver/laplace/laplaceTetDecompositionMotionSolver.C @@ -120,7 +120,7 @@ void Foam::laplaceTetDecompositionMotionSolver::solve() } - if(needTotDisplacement()) + if (needTotDisplacement()) { totDisplacement() += motionU()*tetMesh().time().deltaT(); } diff --git a/src/tetDecompositionFiniteElement/tetPolyMeshFaceDecomp/addParallelPointPatchFaceDecomp.C b/src/tetDecompositionFiniteElement/tetPolyMeshFaceDecomp/addParallelPointPatchFaceDecomp.C index c95cdbcb3..e6407d100 100644 --- a/src/tetDecompositionFiniteElement/tetPolyMeshFaceDecomp/addParallelPointPatchFaceDecomp.C +++ b/src/tetDecompositionFiniteElement/tetPolyMeshFaceDecomp/addParallelPointPatchFaceDecomp.C @@ -57,7 +57,7 @@ public: for ( - typename SLList::const_iterator myObjectsIter = + typename SLList::const_iterator myObjectsIter = myObjects.begin(); myObjectsIter != myObjects.end(); ++myObjectsIter @@ -97,7 +97,7 @@ void Foam::tetPolyMeshFaceDecomp::addParallelPointPatch() // The processor point patch will be added if processor boundaries // exist in the case. If the mesh with processor boundaries is // not created during a parallel run (e.g. decomposePar), the - // addressing will be dummy. + // addressing will be dummy. HJ, date deleted if (mesh_.globalData().parallel()) { @@ -360,7 +360,12 @@ void Foam::tetPolyMeshFaceDecomp::addParallelPointPatch() } // Send the list to the first slave - OPstream toFirstSlave(Pstream::blocking, Pstream::firstSlave()); + OPstream toFirstSlave + ( + Pstream::blocking, + Pstream::firstSlave() + ); + toFirstSlave << globalCutEdges; } else @@ -440,7 +445,6 @@ void Foam::tetPolyMeshFaceDecomp::addParallelPointPatch() } } - // Add the processor point patch boundary_.setSize(boundary_.size() + 1); diff --git a/src/tetDecompositionFiniteElement/tetPolyMeshFaceDecomp/tetPolyBoundaryMesh/tetPolyBoundaryMeshFaceDecomp.C b/src/tetDecompositionFiniteElement/tetPolyMeshFaceDecomp/tetPolyBoundaryMesh/tetPolyBoundaryMeshFaceDecomp.C index 0594cb520..eff3a84ae 100644 --- a/src/tetDecompositionFiniteElement/tetPolyMeshFaceDecomp/tetPolyBoundaryMesh/tetPolyBoundaryMeshFaceDecomp.C +++ b/src/tetDecompositionFiniteElement/tetPolyMeshFaceDecomp/tetPolyBoundaryMesh/tetPolyBoundaryMeshFaceDecomp.C @@ -91,7 +91,10 @@ tetPolyBoundaryMeshFaceDecomp::globalPatch() const { if (isA(patches[patchI])) { - return refCast(patches[patchI]); + return refCast + ( + patches[patchI] + ); } } diff --git a/src/tetDecompositionFiniteElement/tetPolyMeshFaceDecomp/tetPolyPatches/constraint/global/globalTetPolyPatchFaceDecomp.H b/src/tetDecompositionFiniteElement/tetPolyMeshFaceDecomp/tetPolyPatches/constraint/global/globalTetPolyPatchFaceDecomp.H index befbf2c3d..98732371d 100644 --- a/src/tetDecompositionFiniteElement/tetPolyMeshFaceDecomp/tetPolyPatches/constraint/global/globalTetPolyPatchFaceDecomp.H +++ b/src/tetDecompositionFiniteElement/tetPolyMeshFaceDecomp/tetPolyPatches/constraint/global/globalTetPolyPatchFaceDecomp.H @@ -208,7 +208,7 @@ public: virtual const word& name() const { // There can only be a single patch of this type - therefore - // its name is hard-coded. + // its name is hard-coded. HJ, date deleted return type(); }