diff --git a/src/dynamicMesh/fvMeshDistribute/fvMeshDistribute.C b/src/dynamicMesh/fvMeshDistribute/fvMeshDistribute.C index dde37093dd..7edc833945 100644 --- a/src/dynamicMesh/fvMeshDistribute/fvMeshDistribute.C +++ b/src/dynamicMesh/fvMeshDistribute/fvMeshDistribute.C @@ -48,7 +48,8 @@ License namespace Foam { - defineTypeNameAndDebug(fvMeshDistribute, 0); + +defineTypeNameAndDebug(fvMeshDistribute, 0); //- Less function class that can be used for sorting processor patches class lessProcPatches @@ -3016,37 +3017,15 @@ Foam::autoPtr Foam::fvMeshDistribute::distribute // we also need to adapt our constructMaps. repatch(newPatchID, constructFaceMap); - // Bit of hack: processorFvPatchField does not get reset since created - // from nothing so explicitly reset. - initPatchFields> - ( - Zero - ); - initPatchFields> - ( - Zero - ); - initPatchFields - < - volSphericalTensorField, - processorFvPatchField - > - ( - Zero - ); - initPatchFields> - ( - Zero - ); - initPatchFields> - ( - Zero - ); - + // Correct processor patch fields + correctProcessorPatchFields(); + correctProcessorPatchFields(); + correctProcessorPatchFields(); + correctProcessorPatchFields(); + correctProcessorPatchFields(); mesh_.setInstance(mesh_.time().timeName()); - // Print a bit if (debug) { diff --git a/src/dynamicMesh/fvMeshDistribute/fvMeshDistribute.H b/src/dynamicMesh/fvMeshDistribute/fvMeshDistribute.H index e2003cceee..11f66b165d 100644 --- a/src/dynamicMesh/fvMeshDistribute/fvMeshDistribute.H +++ b/src/dynamicMesh/fvMeshDistribute/fvMeshDistribute.H @@ -133,16 +133,9 @@ class fvMeshDistribute const PtrList>& oldFlds ); - //- Init patch fields of certain type - template - void initPatchFields - ( - const typename GeoField::value_type& initVal - ); - - //- Call correctBoundaryConditions on fields + //- Correct processor patch fields template - void correctBoundaryConditions(); + void correctProcessorPatchFields(); //- Delete all processor patches. Move any processor faces into // patchi. diff --git a/src/dynamicMesh/fvMeshDistribute/fvMeshDistributeTemplates.C b/src/dynamicMesh/fvMeshDistribute/fvMeshDistributeTemplates.C index 300686a33d..6f5886878a 100644 --- a/src/dynamicMesh/fvMeshDistribute/fvMeshDistributeTemplates.C +++ b/src/dynamicMesh/fvMeshDistribute/fvMeshDistributeTemplates.C @@ -24,6 +24,7 @@ License \*---------------------------------------------------------------------------*/ #include "mapPolyMesh.H" +#include "processorFvPatchField.H" // * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * // @@ -235,13 +236,11 @@ void Foam::fvMeshDistribute::mapExposedFaces } -template -void Foam::fvMeshDistribute::initPatchFields -( - const typename GeoField::value_type& initVal -) +template +void Foam::fvMeshDistribute::correctProcessorPatchFields() { - // Init patch fields of certain type + typedef processorFvPatchField + processorPatchFieldType; HashTable flds ( @@ -254,14 +253,6 @@ void Foam::fvMeshDistribute::initPatchFields typename GeoField::Boundary& bfld = fld.boundaryFieldRef(); - // forAll(bfld, patchi) - // { - // if (isA(bfld[patchi])) - // { - // bfld[patchi] == initVal; - // } - // } - if ( Pstream::defaultCommsType == Pstream::commsTypes::blocking @@ -272,7 +263,7 @@ void Foam::fvMeshDistribute::initPatchFields forAll(bfld, patchi) { - if (isA(bfld[patchi])) + if (isA(bfld[patchi])) { bfld[patchi].initEvaluate(Pstream::defaultCommsType); } @@ -290,7 +281,7 @@ void Foam::fvMeshDistribute::initPatchFields forAll(bfld, patchi) { - if (isA(bfld[patchi])) + if (isA(bfld[patchi])) { bfld[patchi].evaluate(Pstream::defaultCommsType); } @@ -303,7 +294,7 @@ void Foam::fvMeshDistribute::initPatchFields forAll(patchSchedule, patchEvali) { - if (isA(bfld[patchEvali])) + if (isA(bfld[patchEvali])) { if (patchSchedule[patchEvali].init) { @@ -322,24 +313,6 @@ void Foam::fvMeshDistribute::initPatchFields } -template -void Foam::fvMeshDistribute::correctBoundaryConditions() -{ - // correctBoundaryConditions patch fields of certain type - - HashTable flds - ( - mesh_.objectRegistry::lookupClass() - ); - - forAllIter(typename HashTable, flds, iter) - { - const GeoField& fld = *iter(); - fld.correctBoundaryConditions(); - } -} - - template void Foam::fvMeshDistribute::sendFields (