diff --git a/src/AMIInterpolation/AMIInterpolation.C b/src/AMIInterpolation/AMIInterpolation.C index 9bc928d69a71e26d3e45ce3d0918367ad264dab6..dbbf026657e5ff01cbbed516537d47370c32e27f 100644 --- a/src/AMIInterpolation/AMIInterpolation.C +++ b/src/AMIInterpolation/AMIInterpolation.C @@ -275,8 +275,6 @@ distributeAndMergePatches tgtFaces.setSize(nFaces); tgtPoints.setSize(nPoints); - -//reduce(nFaces, sumOp<label>()); tgtFaceIDs.setSize(nFaces); nFaces = 0; @@ -754,7 +752,7 @@ void Foam::AMIInterpolation<SourcePatch, TargetPatch>::setNextFaces "const primitivePatch&, " "const primitivePatch&, " "const boolList&, " - "const labelList&, " + "labelList&, " "const DynamicList<label>&" ") const" ) << "Unable to set source and target faces" << abort(FatalError); @@ -1052,9 +1050,8 @@ void Foam::AMIInterpolation<SourcePatch, TargetPatch>::normaliseWeights { scalar s = sum(wght[faceI]); wghtSum[faceI] = s; - - scalar t = 1; // s/patch[faceI].mag(patch.localPoints()); + scalar t = s/patch[faceI].mag(patch.points()); if (t < minBound) { minBound = t; @@ -1096,7 +1093,6 @@ Foam::AMIInterpolation<SourcePatch, TargetPatch>::AMIInterpolation srcWeights_(), tgtAddress_(), tgtWeights_(), - tgtPatchSize_(tgtPatch.size()), startSeedI_(0), triMode_(triMode), projectPoints_(projectPoints), @@ -1146,8 +1142,8 @@ void Foam::AMIInterpolation<SourcePatch, TargetPatch>::update globalIndex globalTgtFaces(tgtPatch.size()); // Create processor map of overlapping faces. This map gets - // (possibly remote) faces from the tgtPatch such that they together - // cover all of the srcPatch. + // (possibly remote) faces from the tgtPatch such that they (together) + // cover all of the srcPatch autoPtr<mapDistribute> mapPtr = calcProcMap(srcPatch, tgtPatch); const mapDistribute& map = mapPtr(); @@ -1161,7 +1157,12 @@ void Foam::AMIInterpolation<SourcePatch, TargetPatch>::update labelList tgtFaceIDs; distributeAndMergePatches ( - map, tgtPatch, globalTgtFaces, newTgtFaces, newTgtPoints, tgtFaceIDs + map, + tgtPatch, + globalTgtFaces, + newTgtFaces, + newTgtPoints, + tgtFaceIDs ); primitivePatch @@ -1178,7 +1179,7 @@ void Foam::AMIInterpolation<SourcePatch, TargetPatch>::update checkPatches(srcPatch, newTgtPatch); - // calculate AMI interpolation. + // calculate AMI interpolation calcAddressing(srcPatch, newTgtPatch, surf); // Now @@ -1212,7 +1213,7 @@ void Foam::AMIInterpolation<SourcePatch, TargetPatch>::update } // send data back to originating procs. Note that contributions - // from different processors get added (ListPlusEqOp). + // from different processors get added (ListPlusEqOp) mapDistribute::distribute ( @@ -1239,8 +1240,8 @@ void Foam::AMIInterpolation<SourcePatch, TargetPatch>::update ); // weights normalisation - normaliseWeights(srcPatch, "source", srcAddress_, srcWeights_, true); - normaliseWeights(tgtPatch, "target", tgtAddress_, tgtWeights_, true); + normaliseWeights(tgtPatch, "source", srcAddress_, srcWeights_, true); + normaliseWeights(srcPatch, "target", tgtAddress_, tgtWeights_, true); // cache maps and reset addresses List<Map<label> > cMap; @@ -1267,8 +1268,8 @@ void Foam::AMIInterpolation<SourcePatch, TargetPatch>::update writeWeights(tgtWeights_, tgtPatch, "VTK", "target"); } - normaliseWeights(srcPatch, "source", srcAddress_, srcWeights_, true); - normaliseWeights(tgtPatch, "target", tgtAddress_, tgtWeights_, true); + normaliseWeights(tgtPatch, "source", srcAddress_, srcWeights_, true); + normaliseWeights(srcPatch, "target", tgtAddress_, tgtWeights_, true); } patchI++; @@ -1283,13 +1284,13 @@ Foam::AMIInterpolation<SourcePatch, TargetPatch>::interpolateToSource const Field<Type>& fld ) const { - if (fld.size() != tgtPatchSize_) + if (fld.size() != tgtAddress_.size()) { FatalErrorIn ( "AMIInterpolation::interpolateToSource(const Field<Type>) const" ) << "Supplied field size is not equal to target patch size. " - << "Target patch = " << tgtPatchSize_ << ", supplied field = " + << "Target patch = " << tgtAddress_.size() << ", supplied field = " << fld.size() << abort(FatalError); } @@ -1375,7 +1376,7 @@ Foam::AMIInterpolation<SourcePatch, TargetPatch>::interpolateToTarget ( new Field<Type> ( - tgtPatchSize_, + tgtAddress_.size(), pTraits<Type>::zero ) ); diff --git a/src/AMIInterpolation/AMIInterpolation.H b/src/AMIInterpolation/AMIInterpolation.H index f9d722712412bd69ab17fb339e273f310a26de46..4173362f5424b252b74dc6d91f727ba5068236b5 100644 --- a/src/AMIInterpolation/AMIInterpolation.H +++ b/src/AMIInterpolation/AMIInterpolation.H @@ -122,10 +122,6 @@ class AMIInterpolation //- Weights of wource faces per target face scalarListList tgtWeights_; - //- Cache local size of target patch - // Note: size could be manipulated in parallel - label tgtPatchSize_; - //- Starting face seed index label startSeedI_; diff --git a/tutorials/incompressible/pimpleDyMFoam/mixerVesselAMI2D/system/decomposeParDict b/tutorials/incompressible/pimpleDyMFoam/mixerVesselAMI2D/system/decomposeParDict new file mode 100644 index 0000000000000000000000000000000000000000..c19a5c12d487377cf10dd9c62952978afd4047f3 --- /dev/null +++ b/tutorials/incompressible/pimpleDyMFoam/mixerVesselAMI2D/system/decomposeParDict @@ -0,0 +1,40 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: dev | +| \\ / A nd | Web: www.OpenFOAM.org | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class dictionary; + location "system"; + object decomposeParDict; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // +/* +preservePatches +( + AMI1 + AMI2 +); +*/ +numberOfSubdomains 4; + +method simple; + +simpleCoeffs +{ + n ( 2 2 1 ); + delta 0.001; +} + + +distributed no; + +roots ( ); + + +// ************************************************************************* // diff --git a/tutorials/incompressible/pimpleDyMFoam/mixerVesselAMI2D/system/fvSchemes b/tutorials/incompressible/pimpleDyMFoam/mixerVesselAMI2D/system/fvSchemes index 82ae10e9a5981c4de645a3fd6b3b8df85217b873..5e6c6725c51c470afd1f0953dfa944a3965dc117 100644 --- a/tutorials/incompressible/pimpleDyMFoam/mixerVesselAMI2D/system/fvSchemes +++ b/tutorials/incompressible/pimpleDyMFoam/mixerVesselAMI2D/system/fvSchemes @@ -24,7 +24,6 @@ gradSchemes { default Gauss linear; grad(p) Gauss linear; -// grad(U) cellLimited Gauss linear 1; grad(U) Gauss linear 1; } @@ -37,8 +36,7 @@ divSchemes laplacianSchemes { -// default Gauss linear corrected; - default Gauss linear uncorrected; + default Gauss linear corrected; } interpolationSchemes @@ -49,8 +47,7 @@ interpolationSchemes snGradSchemes { -// default corrected; - default uncorrected; + default corrected; } fluxRequired diff --git a/tutorials/incompressible/simpleFoam/motorBike/constant/transportProperties b/tutorials/incompressible/simpleFoam/motorBike/constant/transportProperties index aae90f589a16f8835210fb353493ac9d4c044bbb..9b4179188642faea47f9600747f3c6604a272fe7 100644 --- a/tutorials/incompressible/simpleFoam/motorBike/constant/transportProperties +++ b/tutorials/incompressible/simpleFoam/motorBike/constant/transportProperties @@ -16,15 +16,6 @@ FoamFile transportModel Newtonian; -method hierarchical; - -hierarchicalCoeffs -{ - n (2 1 1); - delta 0.001; - order xyz; -} - nu nu [0 2 -1 0 0 0 0] 1.5e-05; // ************************************************************************* //