Fix parallel mesh motion bug
This commit is contained in:
parent
cc22953ac4
commit
0706c07b6d
19 changed files with 51 additions and 39 deletions
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -208,7 +208,7 @@ FixedValuePointPatchField<PatchField, Mesh, PointPatch, MatrixType, Type>
|
|||
{
|
||||
Field<Type>::operator=(ptf);
|
||||
|
||||
// insert the result into the internal field
|
||||
// Insert the result into the internal field
|
||||
initEvaluate();
|
||||
}
|
||||
|
||||
|
@ -243,7 +243,8 @@ template
|
|||
template<class> class MatrixType,
|
||||
class Type
|
||||
>
|
||||
void FixedValuePointPatchField<PatchField, Mesh, PointPatch, MatrixType, Type>::
|
||||
void
|
||||
FixedValuePointPatchField<PatchField, Mesh, PointPatch, MatrixType, Type>::
|
||||
operator==
|
||||
(
|
||||
const Type& t
|
||||
|
|
|
@ -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
|
||||
)
|
||||
{}
|
||||
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -186,7 +186,7 @@ public:
|
|||
//- Evaluate the patch field
|
||||
virtual void evaluate
|
||||
(
|
||||
const Pstream::commsTypes commsType=Pstream::blocking
|
||||
const Pstream::commsTypes commsType = Pstream::blocking
|
||||
)
|
||||
{}
|
||||
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -152,7 +152,7 @@ public:
|
|||
//- Update the patch field
|
||||
virtual void evaluate
|
||||
(
|
||||
const Pstream::commsTypes commsType=Pstream::blocking
|
||||
const Pstream::commsTypes commsType = Pstream::blocking
|
||||
);
|
||||
};
|
||||
|
||||
|
|
|
@ -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
|
||||
|
||||
|
|
|
@ -508,29 +508,33 @@ void GlobalPointPatchField
|
|||
// Create the global list and insert local values
|
||||
if (globalPointPatch_.globalPointSize() > 0)
|
||||
{
|
||||
Field<Type> gpf
|
||||
(
|
||||
globalPointPatch_.globalPointSize(),
|
||||
pTraits<Type>::zero
|
||||
);
|
||||
// Bug fix: use map-based communication. HJ, 18/Nov/2010
|
||||
|
||||
// Get addressing
|
||||
const labelList& sharedPointAddr =
|
||||
globalPointPatch_.sharedPointAddr();
|
||||
|
||||
// Get internal field data
|
||||
Field<Type> pField = this->patchInternalField();
|
||||
|
||||
// Pack data into a map
|
||||
Map<Type> dataMap;
|
||||
|
||||
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
|
||||
Field<Type> lpf(sharedPointAddr.size());
|
||||
|
||||
forAll (sharedPointAddr, i)
|
||||
{
|
||||
lpf[i] = gpf[sharedPointAddr[i]];
|
||||
lpf[i] = dataMap[sharedPointAddr[i]];
|
||||
}
|
||||
|
||||
// Get addressing and enforce values on all processors
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -660,7 +660,7 @@ Foam::pointField Foam::globalMeshData::geometricSharedPoints() const
|
|||
combineReduce(sharedPoints, plusEqOp<pointField>());
|
||||
|
||||
// Merge tolerance
|
||||
scalar tolDim = matchTol_ * bb_.mag();
|
||||
scalar tolDim = matchTol_*bb_.mag();
|
||||
|
||||
// And see how many are unique
|
||||
labelList pMap;
|
||||
|
|
|
@ -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
|
||||
// Note: hasTransformation is only used for warning messages so
|
||||
// reduction not strictly nessecary.
|
||||
//reduce(hasTransformation, orOp<bool>());
|
||||
// reduce(hasTransformation, orOp<bool>());
|
||||
|
||||
// Synchronize multiple shared points.
|
||||
const globalMeshData& pd = mesh.globalData();
|
||||
|
|
|
@ -120,7 +120,7 @@ void Foam::laplaceTetDecompositionMotionSolver::solve()
|
|||
}
|
||||
|
||||
|
||||
if(needTotDisplacement())
|
||||
if (needTotDisplacement())
|
||||
{
|
||||
totDisplacement() += motionU()*tetMesh().time().deltaT();
|
||||
}
|
||||
|
|
|
@ -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);
|
||||
|
||||
|
|
|
@ -91,7 +91,10 @@ tetPolyBoundaryMeshFaceDecomp::globalPatch() const
|
|||
{
|
||||
if (isA<globalTetPolyPatchFaceDecomp>(patches[patchI]))
|
||||
{
|
||||
return refCast<const globalTetPolyPatchFaceDecomp>(patches[patchI]);
|
||||
return refCast<const globalTetPolyPatchFaceDecomp>
|
||||
(
|
||||
patches[patchI]
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -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();
|
||||
}
|
||||
|
||||
|
|
Reference in a new issue