Fix parallel mesh motion bug

This commit is contained in:
Hrvoje Jasak 2010-11-18 19:30:41 +00:00
parent cc22953ac4
commit 0706c07b6d
19 changed files with 51 additions and 39 deletions

View file

@ -208,7 +208,7 @@ FixedValuePointPatchField<PatchField, Mesh, PointPatch, MatrixType, Type>
{ {
Field<Type>::operator=(ptf); Field<Type>::operator=(ptf);
// insert the result into the internal field // Insert the result into the internal field
initEvaluate(); initEvaluate();
} }
@ -243,7 +243,8 @@ template
template<class> class MatrixType, template<class> class MatrixType,
class Type class Type
> >
void FixedValuePointPatchField<PatchField, Mesh, PointPatch, MatrixType, Type>:: void
FixedValuePointPatchField<PatchField, Mesh, PointPatch, MatrixType, Type>::
operator== operator==
( (
const Type& t const Type& t

View file

@ -28,7 +28,7 @@ Class
fixedValue/zeroGradient mix may be different for each direction. fixedValue/zeroGradient mix may be different for each direction.
I am still not sure how to do the fixedValue-fixedGradient I am still not sure how to do the fixedValue-fixedGradient
combination. combination. HJ, date deleted
Description Description

View file

@ -508,29 +508,33 @@ void GlobalPointPatchField
// Create the global list and insert local values // Create the global list and insert local values
if (globalPointPatch_.globalPointSize() > 0) if (globalPointPatch_.globalPointSize() > 0)
{ {
Field<Type> gpf // Bug fix: use map-based communication. HJ, 18/Nov/2010
(
globalPointPatch_.globalPointSize(),
pTraits<Type>::zero
);
// Get addressing
const labelList& sharedPointAddr = const labelList& sharedPointAddr =
globalPointPatch_.sharedPointAddr(); globalPointPatch_.sharedPointAddr();
// Get internal field data
Field<Type> pField = this->patchInternalField(); Field<Type> pField = this->patchInternalField();
// Pack data into a map
Map<Type> dataMap;
forAll (sharedPointAddr, i) forAll (sharedPointAddr, i)
{ {
gpf[sharedPointAddr[i]] = pField[i]; dataMap.insert(sharedPointAddr[i], pField[i]);
} }
combineReduce(gpf, eqOp<Field<Type> >()); // Communicate map
Pstream::mapCombineGather(dataMap, eqOp<Type>());
Pstream::mapCombineScatter(dataMap);
// Extract local data // Extract local data
Field<Type> lpf(sharedPointAddr.size()); Field<Type> lpf(sharedPointAddr.size());
forAll (sharedPointAddr, i) forAll (sharedPointAddr, i)
{ {
lpf[i] = gpf[sharedPointAddr[i]]; lpf[i] = dataMap[sharedPointAddr[i]];
} }
// Get addressing and enforce values on all processors // Get addressing and enforce values on all processors

View file

@ -22,7 +22,7 @@ License
along with OpenFOAM; if not, write to the Free Software Foundation, along with OpenFOAM; if not, write to the Free Software Foundation,
Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
\*----------------------------------------------------------------------------*/ \*---------------------------------------------------------------------------*/
#include "syncTools.H" #include "syncTools.H"
#include "polyMesh.H" #include "polyMesh.H"
@ -306,7 +306,7 @@ void Foam::syncTools::syncPointMap
} }
} }
//- Note: hasTransformation is only used for warning messages so // Note: hasTransformation is only used for warning messages so
// reduction not strictly nessecary. // reduction not strictly nessecary.
// reduce(hasTransformation, orOp<bool>()); // reduce(hasTransformation, orOp<bool>());

View file

@ -97,7 +97,7 @@ void Foam::tetPolyMeshFaceDecomp::addParallelPointPatch()
// The processor point patch will be added if processor boundaries // The processor point patch will be added if processor boundaries
// exist in the case. If the mesh with processor boundaries is // exist in the case. If the mesh with processor boundaries is
// not created during a parallel run (e.g. decomposePar), the // 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()) if (mesh_.globalData().parallel())
{ {
@ -360,7 +360,12 @@ void Foam::tetPolyMeshFaceDecomp::addParallelPointPatch()
} }
// Send the list to the first slave // Send the list to the first slave
OPstream toFirstSlave(Pstream::blocking, Pstream::firstSlave()); OPstream toFirstSlave
(
Pstream::blocking,
Pstream::firstSlave()
);
toFirstSlave << globalCutEdges; toFirstSlave << globalCutEdges;
} }
else else
@ -440,7 +445,6 @@ void Foam::tetPolyMeshFaceDecomp::addParallelPointPatch()
} }
} }
// Add the processor point patch // Add the processor point patch
boundary_.setSize(boundary_.size() + 1); boundary_.setSize(boundary_.size() + 1);

View file

@ -91,7 +91,10 @@ tetPolyBoundaryMeshFaceDecomp::globalPatch() const
{ {
if (isA<globalTetPolyPatchFaceDecomp>(patches[patchI])) if (isA<globalTetPolyPatchFaceDecomp>(patches[patchI]))
{ {
return refCast<const globalTetPolyPatchFaceDecomp>(patches[patchI]); return refCast<const globalTetPolyPatchFaceDecomp>
(
patches[patchI]
);
} }
} }

View file

@ -208,7 +208,7 @@ public:
virtual const word& name() const virtual const word& name() const
{ {
// There can only be a single patch of this type - therefore // 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(); return type();
} }