From f2e98ffb26d23d2b4ce503764bbd1d144c9f4c84 Mon Sep 17 00:00:00 2001 From: andy Date: Wed, 18 Jan 2012 11:53:41 +0000 Subject: [PATCH] BUG: Corrections to AMI patch output when projecting to intermediate surface --- .../cyclicAMIPolyPatch/cyclicAMIPolyPatch.C | 8 ++++---- .../mappedPolyPatch/mappedPatchBase.C | 15 +++++++++------ 2 files changed, 13 insertions(+), 10 deletions(-) diff --git a/src/meshTools/AMIInterpolation/patches/cyclic/cyclicAMIPolyPatch/cyclicAMIPolyPatch.C b/src/meshTools/AMIInterpolation/patches/cyclic/cyclicAMIPolyPatch/cyclicAMIPolyPatch.C index 821ef00dec..67414fa432 100644 --- a/src/meshTools/AMIInterpolation/patches/cyclic/cyclicAMIPolyPatch/cyclicAMIPolyPatch.C +++ b/src/meshTools/AMIInterpolation/patches/cyclic/cyclicAMIPolyPatch/cyclicAMIPolyPatch.C @@ -366,7 +366,7 @@ Foam::cyclicAMIPolyPatch::cyclicAMIPolyPatch AMIPtr_(NULL), AMIReverse_(false), surfPtr_(NULL), - surfDict_(dictionary::null) + surfDict_(fileName("surface")) { // Neighbour patch might not be valid yet so no transformation // calculation possible @@ -474,7 +474,7 @@ Foam::cyclicAMIPolyPatch::cyclicAMIPolyPatch AMIPtr_(NULL), AMIReverse_(pp.AMIReverse_), surfPtr_(NULL), - surfDict_(dictionary::null) + surfDict_(pp.surfDict_) { // Neighbour patch might not be valid yet so no transformation // calculation possible @@ -501,7 +501,7 @@ Foam::cyclicAMIPolyPatch::cyclicAMIPolyPatch AMIPtr_(NULL), AMIReverse_(pp.AMIReverse_), surfPtr_(NULL), - surfDict_(dictionary::null) + surfDict_(pp.surfDict_) { if (nbrPatchName_ == name()) { @@ -825,7 +825,7 @@ void Foam::cyclicAMIPolyPatch::write(Ostream& os) const << token::END_STATEMENT << nl; } - if (surfDict_ != dictionary::null) + if (!surfDict_.empty()) { os.writeKeyword(surfDict_.dictName()); os << surfDict_; diff --git a/src/meshTools/mappedPatches/mappedPolyPatch/mappedPatchBase.C b/src/meshTools/mappedPatches/mappedPolyPatch/mappedPatchBase.C index ec3d7c7471..9ccaf089c0 100644 --- a/src/meshTools/mappedPatches/mappedPolyPatch/mappedPatchBase.C +++ b/src/meshTools/mappedPatches/mappedPolyPatch/mappedPatchBase.C @@ -798,7 +798,7 @@ Foam::mappedPatchBase::mappedPatchBase AMIPtr_(NULL), AMIReverse_(false), surfPtr_(NULL), - surfDict_(dictionary::null) + surfDict_(fileName("surface")) {} @@ -824,7 +824,7 @@ Foam::mappedPatchBase::mappedPatchBase AMIPtr_(NULL), AMIReverse_(false), surfPtr_(NULL), - surfDict_(dictionary::null) + surfDict_(fileName("surface")) {} @@ -850,7 +850,7 @@ Foam::mappedPatchBase::mappedPatchBase AMIPtr_(NULL), AMIReverse_(false), surfPtr_(NULL), - surfDict_(dictionary::null) + surfDict_(fileName("surface")) {} @@ -876,7 +876,7 @@ Foam::mappedPatchBase::mappedPatchBase AMIPtr_(NULL), AMIReverse_(false), surfPtr_(NULL), - surfDict_(dictionary::null) + surfDict_(fileName("surface")) {} @@ -1216,8 +1216,11 @@ void Foam::mappedPatchBase::write(Ostream& os) const << token::END_STATEMENT << nl; } - os.writeKeyword(surfDict_.dictName()); - os << surfDict_; + if (!surfDict_.empty()) + { + os.writeKeyword(surfDict_.dictName()); + os << surfDict_; + } } }