diff --git a/src/lagrangian/basic/InteractionLists/InteractionLists.C b/src/lagrangian/basic/InteractionLists/InteractionLists.C index 65ddd30dcb..862665e4ee 100644 --- a/src/lagrangian/basic/InteractionLists/InteractionLists.C +++ b/src/lagrangian/basic/InteractionLists/InteractionLists.C @@ -24,6 +24,11 @@ License \*---------------------------------------------------------------------------*/ #include "InteractionLists.H" +#include "globalIndexAndTransform.H" +#include "indexedOctree.H" +#include "treeDataFace.H" +#include "treeDataCell.H" +#include "volFields.H" // * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * // @@ -61,7 +66,7 @@ void Foam::InteractionLists::buildInteractionLists() ( procBb, allExtendedProcBbs, - globalTransforms_, + mesh_.globalData().globalTransforms(), extendedProcBbsInRange, extendedProcBbsTransformIndex, extendedProcBbsOrigProc @@ -81,6 +86,9 @@ void Foam::InteractionLists::buildInteractionLists() ); } + const globalIndexAndTransform& globalTransforms = + mesh_.globalData().globalTransforms(); + // Recording which cells are in range of an extended boundBox, as // only these cells will need to be tested to determine which // referred cells that they interact with. @@ -116,7 +124,7 @@ void Foam::InteractionLists::buildInteractionLists() cellIAndTToExchange.append ( - globalTransforms_.encode(cellI, transformIndex) + globalTransforms.encode(cellI, transformIndex) ); cellBbsToExchange.append(cellBb); @@ -173,9 +181,9 @@ void Foam::InteractionLists::buildInteractionLists() { const labelPair& ciat = cellIAndTToExchange[bbI]; - const vectorTensorTransform& transform = globalTransforms_.transform + const vectorTensorTransform& transform = globalTransforms.transform ( - globalTransforms_.transformIndex(ciat) + globalTransforms.transformIndex(ciat) ); treeBoundBox tempTransformedBb @@ -352,7 +360,7 @@ void Foam::InteractionLists::buildInteractionLists() wallFaceIAndTToExchange.append ( - globalTransforms_.encode(wallFaceI, transformIndex) + globalTransforms.encode(wallFaceI, transformIndex) ); wallFaceBbsToExchange.append(wallFaceBb); @@ -390,9 +398,9 @@ void Foam::InteractionLists::buildInteractionLists() { const labelPair& wfiat = wallFaceIAndTToExchange[bbI]; - const vectorTensorTransform& transform = globalTransforms_.transform + const vectorTensorTransform& transform = globalTransforms.transform ( - globalTransforms_.transformIndex(wfiat) + globalTransforms.transformIndex(wfiat) ); treeBoundBox tempTransformedBb @@ -518,11 +526,11 @@ void Foam::InteractionLists::buildInteractionLists() { const labelPair& wfiat = wallFaceIndexAndTransformToDistribute_[rWFI]; - label wallFaceIndex = globalTransforms_.index(wfiat); + label wallFaceIndex = globalTransforms.index(wfiat); - const vectorTensorTransform& transform = globalTransforms_.transform + const vectorTensorTransform& transform = globalTransforms.transform ( - globalTransforms_.transformIndex(wfiat) + globalTransforms.transformIndex(wfiat) ); const face& f = mesh_.faces()[wallFaceIndex]; @@ -911,6 +919,10 @@ void Foam::InteractionLists::prepareParticlesToRefer const List >& cellOccupancy ) { + const globalIndexAndTransform& globalTransforms = + mesh_.globalData().globalTransforms(); + + referredParticles_.setSize(cellIndexAndTransformToDistribute_.size()); // Clear all existing referred particles @@ -927,7 +939,7 @@ void Foam::InteractionLists::prepareParticlesToRefer { const labelPair ciat = cellIndexAndTransformToDistribute_[i]; - label cellIndex = globalTransforms_.index(ciat); + label cellIndex = globalTransforms.index(ciat); List realParticles = cellOccupancy[cellIndex]; @@ -952,9 +964,12 @@ void Foam::InteractionLists::prepareParticleToBeReferred labelPair ciat ) { - const vectorTensorTransform& transform = globalTransforms_.transform + const globalIndexAndTransform& globalTransforms = + mesh_.globalData().globalTransforms(); + + const vectorTensorTransform& transform = globalTransforms.transform ( - globalTransforms_.transformIndex(ciat) + globalTransforms.transformIndex(ciat) ); particle->position() = transform.invTransformPosition(particle->position()); @@ -993,6 +1008,9 @@ void Foam::InteractionLists::fillReferredParticleCloud() template void Foam::InteractionLists::prepareWallDataToRefer() { + const globalIndexAndTransform& globalTransforms = + mesh_.globalData().globalTransforms(); + referredWallData_.setSize ( wallFaceIndexAndTransformToDistribute_.size() @@ -1004,11 +1022,11 @@ void Foam::InteractionLists::prepareWallDataToRefer() { const labelPair& wfiat = wallFaceIndexAndTransformToDistribute_[rWVI]; - label wallFaceIndex = globalTransforms_.index(wfiat); + label wallFaceIndex = globalTransforms.index(wfiat); - const vectorTensorTransform& transform = globalTransforms_.transform + const vectorTensorTransform& transform = globalTransforms.transform ( - globalTransforms_.transformIndex(wfiat) + globalTransforms.transformIndex(wfiat) ); label patchI = mesh_.boundaryMesh().patchID() @@ -1088,7 +1106,6 @@ Foam::InteractionLists::InteractionLists(const polyMesh& mesh) writeCloud_(false), cellMapPtr_(), wallFaceMapPtr_(), - globalTransforms_(mesh_), maxDistance_(0.0), dil_(), dwfil_(), @@ -1117,7 +1134,6 @@ Foam::InteractionLists::InteractionLists writeCloud_(writeCloud), cellMapPtr_(), wallFaceMapPtr_(), - globalTransforms_(mesh_), maxDistance_(maxDistance), dil_(), dwfil_(), diff --git a/src/lagrangian/basic/InteractionLists/InteractionLists.H b/src/lagrangian/basic/InteractionLists/InteractionLists.H index 5d9d9f8115..545bb81e11 100644 --- a/src/lagrangian/basic/InteractionLists/InteractionLists.H +++ b/src/lagrangian/basic/InteractionLists/InteractionLists.H @@ -60,21 +60,17 @@ SourceFiles #define InteractionLists_H #include "polyMesh.H" -#include "globalIndexAndTransform.H" #include "referredWallFace.H" -#include "indexedOctree.H" -#include "Tuple2.H" -#include "treeDataCell.H" -#include "treeDataFace.H" -#include "mapDistribute.H" -#include "volFields.H" -#include "Random.H" +//#include "mapDistribute.H" // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // namespace Foam { +class globalIndexAndTransform; +class mapDistribute; + /*---------------------------------------------------------------------------*\ Class InteractionLists Declaration \*---------------------------------------------------------------------------*/ @@ -100,10 +96,6 @@ class InteractionLists //- mapDistribute to exchange wall face data autoPtr wallFaceMapPtr_; - //- Storage and encoding/decoding for all possible transforms - // of the geometry - globalIndexAndTransform globalTransforms_; - //- Maximum distance over which interactions will be detected scalar maxDistance_; @@ -259,9 +251,6 @@ public: //- Return access to the wallFaceMap inline const mapDistribute& wallFaceMap() const; - //- Return access to the globalTransforms - inline const globalIndexAndTransform& globalTransforms() const; - //- Return access to the direct interaction list inline const labelListList& dil() const; diff --git a/src/lagrangian/basic/InteractionLists/InteractionListsI.H b/src/lagrangian/basic/InteractionLists/InteractionListsI.H index 1b61942f5e..c793dc0e63 100644 --- a/src/lagrangian/basic/InteractionLists/InteractionListsI.H +++ b/src/lagrangian/basic/InteractionLists/InteractionListsI.H @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2008-2010 OpenCFD Ltd. + \\ / A nd | Copyright (C) 2008-2011 OpenCFD Ltd. \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -50,14 +50,6 @@ Foam::InteractionLists::wallFaceMap() const } -template -const Foam::globalIndexAndTransform& -Foam::InteractionLists::globalTransforms() const -{ - return globalTransforms_; -} - - template const Foam::labelListList& Foam::InteractionLists::dil() const {