ENH: Added Pstream tags to mapped field types

This commit is contained in:
andy
2011-09-07 14:48:16 +01:00
parent 6b12073a6b
commit e6497d144a
3 changed files with 24 additions and 0 deletions

View File

@ -190,6 +190,11 @@ void mappedFieldFvPatchField<Type>::updateCoeffs()
typedef GeometricField<Type, fvPatchField, volMesh> fieldType;
// Since we're inside initEvaluate/evaluate there might be processor
// comms underway. Change the tag we use.
int oldTag = UPstream::msgType();
UPstream::msgType() = oldTag + 1;
const fvMesh& nbrMesh = refCast<const fvMesh>(sampleMesh());
// Result of obtaining remote values
@ -317,6 +322,9 @@ void mappedFieldFvPatchField<Type>::updateCoeffs()
<< endl;
}
// Restore tag
UPstream::msgType() = oldTag;
fixedValueFvPatchField<Type>::updateCoeffs();
}

View File

@ -102,6 +102,11 @@ void Foam::mappedFixedInternalValueFvPatchField<Type>::updateCoeffs()
return;
}
// Since we're inside initEvaluate/evaluate there might be processor
// comms underway. Change the tag we use.
int oldTag = UPstream::msgType();
UPstream::msgType() = oldTag + 1;
// Retrieve the neighbour values and assign to this patch boundary field
mappedFixedValueFvPatchField<Type>::updateCoeffs();
@ -148,6 +153,9 @@ void Foam::mappedFixedInternalValueFvPatchField<Type>::updateCoeffs()
}
}
// Restore tag
UPstream::msgType() = oldTag;
// Assign to (this) patch internal field its neighbour values
Field<Type>& intFld = const_cast<Field<Type>&>(this->internalField());
UIndirectList<Type>(intFld, this->patch().faceCells()) = nbrIntFld;

View File

@ -224,6 +224,11 @@ void mappedFixedValueFvPatchField<Type>::updateCoeffs()
typedef GeometricField<Type, fvPatchField, volMesh> fieldType;
// Since we're inside initEvaluate/evaluate there might be processor
// comms underway. Change the tag we use.
int oldTag = UPstream::msgType();
UPstream::msgType() = oldTag + 1;
// Get the scheduling information from the mappedPatchBase
const mappedPatchBase& mpp = refCast<const mappedPatchBase>
(
@ -389,6 +394,9 @@ void mappedFixedValueFvPatchField<Type>::updateCoeffs()
<< endl;
}
// Restore tag
UPstream::msgType() = oldTag;
fixedValueFvPatchField<Type>::updateCoeffs();
}