mirror of
https://develop.openfoam.com/Development/openfoam.git
synced 2025-11-28 03:28:01 +00:00
ENH: overset: overlap communications
This commit is contained in:
@ -211,6 +211,59 @@ void Foam::oversetFvPatchField<Type>::initEvaluate
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
template<class Type>
|
||||||
|
void Foam::oversetFvPatchField<Type>::initInterfaceMatrixUpdate
|
||||||
|
(
|
||||||
|
scalarField&,
|
||||||
|
const bool add,
|
||||||
|
const scalarField& psiInternal,
|
||||||
|
const scalarField&,
|
||||||
|
const direction,
|
||||||
|
const Pstream::commsTypes commsType
|
||||||
|
) const
|
||||||
|
{
|
||||||
|
// Add remote values
|
||||||
|
|
||||||
|
const oversetFvPatch& ovp = this->oversetPatch_;
|
||||||
|
|
||||||
|
if (ovp.master())
|
||||||
|
{
|
||||||
|
const fvMesh& mesh = this->patch().boundaryMesh().mesh();
|
||||||
|
|
||||||
|
// Try to find out if the solve routine comes from the mesh
|
||||||
|
// TBD. This should be cleaner.
|
||||||
|
if (&mesh.lduAddr() == &mesh.fvMesh::lduAddr())
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
const mapDistribute& map = ovp.cellInterpolationMap();
|
||||||
|
|
||||||
|
// Transfer the current state (similar to processorFvPatchField). Note
|
||||||
|
// use of separate tag to avoid clashes with any outstanding processor
|
||||||
|
// exchanges
|
||||||
|
if (this->pBufs_.valid())
|
||||||
|
{
|
||||||
|
this->pBufs_().clear();
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
this->pBufs_.set
|
||||||
|
(
|
||||||
|
new PstreamBuffers
|
||||||
|
(
|
||||||
|
Pstream::commsTypes::nonBlocking,
|
||||||
|
UPstream::msgType()+1
|
||||||
|
)
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
// Start sending
|
||||||
|
map.mapDistributeBase::send(this->pBufs_(), psiInternal);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
template<class Type>
|
template<class Type>
|
||||||
void Foam::oversetFvPatchField<Type>::updateInterfaceMatrix
|
void Foam::oversetFvPatchField<Type>::updateInterfaceMatrix
|
||||||
(
|
(
|
||||||
@ -251,11 +304,14 @@ void Foam::oversetFvPatchField<Type>::updateInterfaceMatrix
|
|||||||
const scalarList& factor = ovp.cellInterpolationWeight();
|
const scalarList& factor = ovp.cellInterpolationWeight();
|
||||||
const scalarField& normalisation = ovp.normalisation();
|
const scalarField& normalisation = ovp.normalisation();
|
||||||
|
|
||||||
|
|
||||||
// Since we're inside initEvaluate/evaluate there might be processor
|
// Since we're inside initEvaluate/evaluate there might be processor
|
||||||
// comms underway. Change the tag we use.
|
// comms underway. Change the tag we use.
|
||||||
scalarField work(psiInternal);
|
//scalarField work(psiInternal);
|
||||||
map.mapDistributeBase::distribute(work, UPstream::msgType()+1);
|
//map.mapDistributeBase::distribute(work, UPstream::msgType()+1);
|
||||||
|
|
||||||
|
// Receive the outstanding data
|
||||||
|
scalarField work;
|
||||||
|
map.receive(this->pBufs_(), work);
|
||||||
|
|
||||||
forAll(cellIDs, i)
|
forAll(cellIDs, i)
|
||||||
{
|
{
|
||||||
@ -263,6 +319,7 @@ void Foam::oversetFvPatchField<Type>::updateInterfaceMatrix
|
|||||||
|
|
||||||
const scalarList& w = wghts[celli];
|
const scalarList& w = wghts[celli];
|
||||||
const labelList& nbrs = stencil[celli];
|
const labelList& nbrs = stencil[celli];
|
||||||
|
|
||||||
scalar f = factor[celli];
|
scalar f = factor[celli];
|
||||||
const scalar norm = normalisation[celli];
|
const scalar norm = normalisation[celli];
|
||||||
|
|
||||||
|
|||||||
@ -56,6 +56,14 @@ class oversetFvPatchField
|
|||||||
:
|
:
|
||||||
public semiImplicitOversetFvPatchField<Type>
|
public semiImplicitOversetFvPatchField<Type>
|
||||||
{
|
{
|
||||||
|
protected:
|
||||||
|
|
||||||
|
// Protected data
|
||||||
|
|
||||||
|
//- Send/receive buffer
|
||||||
|
mutable autoPtr<PstreamBuffers> pBufs_;
|
||||||
|
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
//- Runtime type information
|
//- Runtime type information
|
||||||
@ -127,6 +135,18 @@ public:
|
|||||||
//- Initialise the evaluation of the patch field
|
//- Initialise the evaluation of the patch field
|
||||||
virtual void initEvaluate(const Pstream::commsTypes commsType);
|
virtual void initEvaluate(const Pstream::commsTypes commsType);
|
||||||
|
|
||||||
|
//- Initialise neighbour matrix update. Add
|
||||||
|
// or subtract coupled contributions to matrix
|
||||||
|
virtual void initInterfaceMatrixUpdate
|
||||||
|
(
|
||||||
|
scalarField&,
|
||||||
|
const bool add,
|
||||||
|
const scalarField&,
|
||||||
|
const scalarField&,
|
||||||
|
const direction,
|
||||||
|
const Pstream::commsTypes commsType
|
||||||
|
) const;
|
||||||
|
|
||||||
//- Update result field based on interface functionality
|
//- Update result field based on interface functionality
|
||||||
virtual void updateInterfaceMatrix
|
virtual void updateInterfaceMatrix
|
||||||
(
|
(
|
||||||
|
|||||||
Reference in New Issue
Block a user