diff --git a/src/OpenFOAM/fields/GeometricFields/SlicedGeometricField/SlicedGeometricField.C b/src/OpenFOAM/fields/GeometricFields/SlicedGeometricField/SlicedGeometricField.C index 43d14a5740..1ea9ae6e11 100644 --- a/src/OpenFOAM/fields/GeometricFields/SlicedGeometricField/SlicedGeometricField.C +++ b/src/OpenFOAM/fields/GeometricFields/SlicedGeometricField/SlicedGeometricField.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -24,6 +24,7 @@ License \*---------------------------------------------------------------------------*/ #include "SlicedGeometricField.H" +#include "processorFvPatch.H" // * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * * * // @@ -40,7 +41,8 @@ slicedBoundaryField ( const Mesh& mesh, const Field& completeField, - const bool preserveCouples + const bool preserveCouples, + const bool preserveProcessorOnly ) { tmp > tbf @@ -52,7 +54,15 @@ slicedBoundaryField forAll(mesh.boundary(), patchi) { - if (preserveCouples && mesh.boundary()[patchi].coupled()) + if + ( + preserveCouples + && mesh.boundary()[patchi].coupled() + && ( + !preserveProcessorOnly + || isA(mesh.boundary()[patchi]) + ) + ) { // For coupled patched construct the correct patch field type bf.set @@ -243,7 +253,8 @@ SlicedGeometricField const dimensionSet& ds, const Field& completeIField, const Field& completeBField, - const bool preserveCouples + const bool preserveCouples, + const bool preserveProcessorOnly ) : GeometricField @@ -252,7 +263,13 @@ SlicedGeometricField mesh, ds, Field(), - slicedBoundaryField(mesh, completeBField, preserveCouples) + slicedBoundaryField + ( + mesh, + completeBField, + preserveCouples, + preserveProcessorOnly + ) ) { // Set the internalField to the slice of the complete field diff --git a/src/OpenFOAM/fields/GeometricFields/SlicedGeometricField/SlicedGeometricField.H b/src/OpenFOAM/fields/GeometricFields/SlicedGeometricField/SlicedGeometricField.H index e04690e042..dd23712e67 100644 --- a/src/OpenFOAM/fields/GeometricFields/SlicedGeometricField/SlicedGeometricField.H +++ b/src/OpenFOAM/fields/GeometricFields/SlicedGeometricField/SlicedGeometricField.H @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -83,7 +83,8 @@ private: ( const Mesh& mesh, const Field& completeField, - const bool preserveCouples + const bool preserveCouples, + const bool preserveProcessorOnly = false ); //- Slice the given field and a create a PtrList of SlicedPatchField @@ -133,7 +134,8 @@ public: const dimensionSet&, const Field& completeIField, const Field& completeBField, - const bool preserveCouples=true + const bool preserveCouples=true, + const bool preserveProcessorOnly = false ); //- Construct from GeometricField. Reuses full internal and diff --git a/src/finiteVolume/fvMesh/fvMeshGeometry.C b/src/finiteVolume/fvMesh/fvMeshGeometry.C index 0a06ef7364..5abdb45d11 100644 --- a/src/finiteVolume/fvMesh/fvMeshGeometry.C +++ b/src/finiteVolume/fvMesh/fvMeshGeometry.C @@ -133,6 +133,8 @@ void fvMesh::makeC() const << abort(FatalError); } + // Construct as slices. Only preserve processor (not e.g. cyclic) + CPtr_ = new slicedVolVectorField ( IOobject @@ -148,33 +150,10 @@ void fvMesh::makeC() const *this, dimLength, cellCentres(), - faceCentres() + faceCentres(), + true, //preserveCouples + true //preserveProcOnly ); - - - // Need to correct for cyclics transformation since absolute quantity. - // Ok on processor patches since hold opposite cell centre (no - // transformation) - slicedVolVectorField& C = *CPtr_; - - forAll(C.boundaryField(), patchi) - { - if - ( - isA(C.boundaryField()[patchi]) - || isA(C.boundaryField()[patchi]) - ) - { - // Note: cyclic is not slice but proper field - C.boundaryField()[patchi] == static_cast - ( - static_cast&> - ( - boundary_[patchi].patchSlice(faceCentres()) - ) - ); - } - } }