From da89474c3bc8e58dbaae2771317e46532a279f6e Mon Sep 17 00:00:00 2001 From: mattijs <mattijs@hunt.opencfd.co.uk> Date: Mon, 1 Jun 2009 13:24:10 +0100 Subject: [PATCH] use direct mapping --- .../decomposePar/fvFieldDecomposer.C | 20 ++++------------ .../decomposePar/fvFieldDecomposer.H | 23 ++++++++----------- 2 files changed, 15 insertions(+), 28 deletions(-) diff --git a/applications/utilities/parallelProcessing/decomposePar/fvFieldDecomposer.C b/applications/utilities/parallelProcessing/decomposePar/fvFieldDecomposer.C index 15eb039bfd8..f5a6451c126 100644 --- a/applications/utilities/parallelProcessing/decomposePar/fvFieldDecomposer.C +++ b/applications/utilities/parallelProcessing/decomposePar/fvFieldDecomposer.C @@ -56,13 +56,12 @@ processorVolPatchFieldDecomposer const unallocLabelList& addressingSlice ) : - addressing_(addressingSlice.size()), - weights_(addressingSlice.size()) + directAddressing_(addressingSlice.size()) { const labelList& own = mesh.faceOwner(); const labelList& neighb = mesh.faceNeighbour(); - forAll (addressing_, i) + forAll (directAddressing_, i) { // Subtract one to align addressing. label ai = mag(addressingSlice[i]) - 1; @@ -74,18 +73,14 @@ processorVolPatchFieldDecomposer // on the parallel boundary. // Give face the value of the neighbour. - addressing_[i].setSize(1); - weights_[i].setSize(1); - weights_[i][0] = 1.0; - if (addressingSlice[i] >= 0) { // I have the owner so use the neighbour value - addressing_[i][0] = neighb[ai]; + directAddressing_[i] = neighb[ai]; } else { - addressing_[i][0] = own[ai]; + directAddressing_[i] = own[ai]; } } else @@ -96,12 +91,7 @@ processorVolPatchFieldDecomposer // up the different (face) list of data), so I will // just grab the value from the owner cell - addressing_[i].setSize(1); - weights_[i].setSize(1); - - addressing_[i][0] = own[ai]; - - weights_[i][0] = 1.0; + directAddressing_[i] = own[ai]; } } } diff --git a/applications/utilities/parallelProcessing/decomposePar/fvFieldDecomposer.H b/applications/utilities/parallelProcessing/decomposePar/fvFieldDecomposer.H index 9641bf031b8..89b69a17813 100644 --- a/applications/utilities/parallelProcessing/decomposePar/fvFieldDecomposer.H +++ b/applications/utilities/parallelProcessing/decomposePar/fvFieldDecomposer.H @@ -96,15 +96,16 @@ public: }; - //- Processor patch field decomposer class + //- Processor patch field decomposer class. Maps either owner or + // neighbour data (no interpolate anymore - processorFvPatchField + // holds neighbour data) class processorVolPatchFieldDecomposer : public fvPatchFieldMapper { // Private data - labelListList addressing_; - scalarListList weights_; + labelList directAddressing_; public: @@ -120,27 +121,23 @@ public: label size() const { - return addressing_.size(); + return directAddressing_.size(); } bool direct() const { - return false; - } - - const labelListList& addressing() const - { - return addressing_; + return true; } - const scalarListList& weights() const + const unallocLabelList& directAddressing() const { - return weights_; + return directAddressing_; } }; - //- Processor patch field decomposer class + //- Processor patch field decomposer class. Surface field is assumed + // to have direction (so manipulates sign when mapping) class processorSurfacePatchFieldDecomposer : public fvPatchFieldMapper -- GitLab