diff --git a/src/overset/oversetMesh/donorAcceptor/donorAcceptor.H b/src/overset/oversetMesh/donorAcceptor/donorAcceptor.H index e298792ff..0741ce8a0 100644 --- a/src/overset/oversetMesh/donorAcceptor/donorAcceptor.H +++ b/src/overset/oversetMesh/donorAcceptor/donorAcceptor.H @@ -211,6 +211,12 @@ public: return acceptorPoint_; } + //- Return access to acceptor location + point& acceptorPoint() + { + return acceptorPoint_; + } + // Donor side @@ -257,18 +263,36 @@ public: } } + //- Return access to donor point + point& donorPoint() + { + return donorPoint_; + } + //- Return extended donor cell numbers const DynamicLabelList& extendedDonorCells() const { return extendedDonorCells_; } + //- Return access to extended donor cell numbers + DynamicLabelList& extendedDonorCells() + { + return extendedDonorCells_; + } + //- Return extended donor cell centres const DynamicPointList& extendedDonorPoints() const { return extendedDonorPoints_; } + //- Return access to extended donor cell centres + DynamicPointList& extendedDonorPoints() + { + return extendedDonorPoints_; + } + //- Return donor to acceptor distance scalar distance() const { diff --git a/src/overset/oversetMesh/oversetFvPatch/oversetFvPatch.C b/src/overset/oversetMesh/oversetFvPatch/oversetFvPatch.C index 2cba6e331..0caff3b21 100644 --- a/src/overset/oversetMesh/oversetFvPatch/oversetFvPatch.C +++ b/src/overset/oversetMesh/oversetFvPatch/oversetFvPatch.C @@ -68,12 +68,21 @@ const Foam::oversetMesh& Foam::oversetFvPatch::overset() const return oversetMesh::New(boundaryMesh().mesh()); } + +const Foam::oversetPolyPatch& Foam::oversetFvPatch::oversetPatch() const +{ + return oversetPatch_; +} + + Foam::tmp Foam::oversetFvPatch::interfaceInternalField ( const unallocLabelList& internalData ) const { - return patchInternalField(internalData); + // Return the copy of the parameter since we need all the mapping for + // overset + return tmp(new labelField(internalData)); } @@ -88,10 +97,9 @@ void Foam::oversetFvPatch::initTransfer Foam::tmp Foam::oversetFvPatch::transfer ( const Pstream::commsTypes commsType, - const unallocLabelList& + const unallocLabelList& interfaceData ) const { - // Missing return labelField::null(); } @@ -107,10 +115,17 @@ void Foam::oversetFvPatch::initInternalFieldTransfer Foam::tmp Foam::oversetFvPatch::internalFieldTransfer ( const Pstream::commsTypes commsType, - const unallocLabelList& + const unallocLabelList& iF ) const { - return labelField::null(); + // Repackage donor data to acceptors + // Note: result is copied as internal field, re-scaled and passed across + tmp tresult(new labelField(iF)); + labelList& result = tresult(); + + overset().map().distribute(result); + + return tresult; } diff --git a/src/overset/oversetMesh/oversetFvPatch/oversetFvPatch.H b/src/overset/oversetMesh/oversetFvPatch/oversetFvPatch.H index f4aacdbf8..ff043387a 100644 --- a/src/overset/oversetMesh/oversetFvPatch/oversetFvPatch.H +++ b/src/overset/oversetMesh/oversetFvPatch/oversetFvPatch.H @@ -59,7 +59,7 @@ class oversetFvPatch // Private Data //- Reference to overset patch - const oversetPolyPatch& overPolyPatch_; + const oversetPolyPatch& oversetPatch_; protected: @@ -104,6 +104,9 @@ public: //- Return access to overset mesh const oversetMesh& overset() const; + //- Const access to overset poly patch + const oversetPolyPatch& oversetPatch() const; + //- Return true: coupled patch virtual bool coupled() const { @@ -113,7 +116,7 @@ public: // Interface transfer functions //- Return the values of the given internal data adjacent to - // the interface as a field + // the interface as a field. For overset, this is acceptor data virtual tmp interfaceInternalField ( const unallocLabelList& internalData @@ -141,6 +144,7 @@ public: ) const; //- Return neighbour field + // For overset, this is donor data for each acceptor virtual tmp internalFieldTransfer ( const Pstream::commsTypes commsType, diff --git a/src/overset/oversetMesh/oversetInterpolation/averageValueInterpolation/averageValueInterpolation.C b/src/overset/oversetMesh/oversetInterpolation/averageValueInterpolation/averageValueInterpolation.C index cb944d81f..3a05cca64 100644 --- a/src/overset/oversetMesh/oversetInterpolation/averageValueInterpolation/averageValueInterpolation.C +++ b/src/overset/oversetMesh/oversetInterpolation/averageValueInterpolation/averageValueInterpolation.C @@ -55,8 +55,8 @@ void Foam::averageValueInterpolation::calcWeights() const } // Allocate necessary storage - weightsPtr_ = new ListScalarFieldField(overset().regions().size()); - ListScalarFieldField& weights = *weightsPtr_; + weightsPtr_ = new scalarFieldFieldList(overset().regions().size()); + scalarFieldFieldList& weights = *weightsPtr_; // Loop through all overset regions forAll (overset().regions(), regionI) @@ -66,7 +66,7 @@ void Foam::averageValueInterpolation::calcWeights() const overset().regions()[regionI].acceptors(); // Get weights for this region - ScalarFieldField& regionWeights = weights[regionI]; + scalarFieldField& regionWeights = weights[regionI]; regionWeights.setSize(curAcceptors.size()); // Loop through acceptors of this region @@ -121,7 +121,7 @@ Foam::averageValueInterpolation::~averageValueInterpolation() // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // -const Foam::oversetInterpolation::ListScalarFieldField& +const Foam::oversetInterpolation::scalarFieldFieldList& Foam::averageValueInterpolation::weights() const { if (!weightsPtr_) diff --git a/src/overset/oversetMesh/oversetInterpolation/averageValueInterpolation/averageValueInterpolation.H b/src/overset/oversetMesh/oversetInterpolation/averageValueInterpolation/averageValueInterpolation.H index 5f952ae52..c0da7c738 100644 --- a/src/overset/oversetMesh/oversetInterpolation/averageValueInterpolation/averageValueInterpolation.H +++ b/src/overset/oversetMesh/oversetInterpolation/averageValueInterpolation/averageValueInterpolation.H @@ -63,7 +63,7 @@ class averageValueInterpolation // Note: for each acceptor in each region, we have a list of scalars // for all donors: master + neighbouring. Master weight is the first // [index 0], followed by neighbouring weights. - mutable ListScalarFieldField* weightsPtr_; + mutable scalarFieldFieldList* weightsPtr_; // Private Member Functions @@ -110,7 +110,7 @@ public: // Access //- Return weights - virtual const ListScalarFieldField& weights() const; + virtual const scalarFieldFieldList& weights() const; //- Update the interpolation diff --git a/src/overset/oversetMesh/oversetInterpolation/injectionInterpolation/injectionInterpolation.C b/src/overset/oversetMesh/oversetInterpolation/injectionInterpolation/injectionInterpolation.C index fa1df5e13..c8e8d72a8 100644 --- a/src/overset/oversetMesh/oversetInterpolation/injectionInterpolation/injectionInterpolation.C +++ b/src/overset/oversetMesh/oversetInterpolation/injectionInterpolation/injectionInterpolation.C @@ -55,8 +55,8 @@ void Foam::injectionInterpolation::calcWeights() const } // Allocate necessary storage - weightsPtr_ = new ListScalarFieldField(overset().regions().size()); - ListScalarFieldField& weights = *weightsPtr_; + weightsPtr_ = new scalarFieldFieldList(overset().regions().size()); + scalarFieldFieldList& weights = *weightsPtr_; // Loop through all overset regions forAll (overset().regions(), regionI) @@ -66,7 +66,7 @@ void Foam::injectionInterpolation::calcWeights() const overset().regions()[regionI].acceptors(); // Get weights for this region - ScalarFieldField& regionWeights = weights[regionI]; + scalarFieldField& regionWeights = weights[regionI]; regionWeights.setSize(curAcceptors.size()); // Loop through acceptors of this region @@ -124,7 +124,7 @@ Foam::injectionInterpolation::~injectionInterpolation() // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // -const Foam::oversetInterpolation::ListScalarFieldField& +const Foam::oversetInterpolation::scalarFieldFieldList& Foam::injectionInterpolation::weights() const { if (!weightsPtr_) diff --git a/src/overset/oversetMesh/oversetInterpolation/injectionInterpolation/injectionInterpolation.H b/src/overset/oversetMesh/oversetInterpolation/injectionInterpolation/injectionInterpolation.H index 93f830dcb..cf121460c 100644 --- a/src/overset/oversetMesh/oversetInterpolation/injectionInterpolation/injectionInterpolation.H +++ b/src/overset/oversetMesh/oversetInterpolation/injectionInterpolation/injectionInterpolation.H @@ -65,7 +65,7 @@ class injectionInterpolation // Note: for each acceptor in each region, we have a list of scalars // for all donors: master + neighbouring. Master weight is the first // [index 0], followed by neighbouring weights. - mutable ListScalarFieldField* weightsPtr_; + mutable scalarFieldFieldList* weightsPtr_; // Private Member Functions @@ -102,9 +102,8 @@ public: ); - // Destructor - - virtual ~injectionInterpolation(); + //- Destructor + virtual ~injectionInterpolation(); // Member Functions @@ -112,7 +111,7 @@ public: // Access //- Return weights - virtual const ListScalarFieldField& weights() const; + virtual const scalarFieldFieldList& weights() const; //- Update the interpolation diff --git a/src/overset/oversetMesh/oversetInterpolation/inverseDistanceInterpolation/inverseDistanceInterpolation.C b/src/overset/oversetMesh/oversetInterpolation/inverseDistanceInterpolation/inverseDistanceInterpolation.C index c3ab1de35..da00ba379 100644 --- a/src/overset/oversetMesh/oversetInterpolation/inverseDistanceInterpolation/inverseDistanceInterpolation.C +++ b/src/overset/oversetMesh/oversetInterpolation/inverseDistanceInterpolation/inverseDistanceInterpolation.C @@ -55,8 +55,8 @@ void Foam::inverseDistanceInterpolation::calcWeights() const } // Allocate necessary storage - weightsPtr_ = new ListScalarFieldField(overset().regions().size()); - ListScalarFieldField& weights = *weightsPtr_; + weightsPtr_ = new scalarFieldFieldList(overset().regions().size()); + scalarFieldFieldList& weights = *weightsPtr_; // Loop through all overset regions forAll (overset().regions(), regionI) @@ -66,7 +66,7 @@ void Foam::inverseDistanceInterpolation::calcWeights() const overset().regions()[regionI].acceptors(); // Get weights for this region - ScalarFieldField& regionWeights = weights[regionI]; + scalarFieldField& regionWeights = weights[regionI]; regionWeights.setSize(curAcceptors.size()); // Loop through acceptors of this region @@ -146,7 +146,7 @@ Foam::inverseDistanceInterpolation::~inverseDistanceInterpolation() // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // -const Foam::oversetInterpolation::ListScalarFieldField& +const Foam::oversetInterpolation::scalarFieldFieldList& Foam::inverseDistanceInterpolation::weights() const { if (!weightsPtr_) diff --git a/src/overset/oversetMesh/oversetInterpolation/inverseDistanceInterpolation/inverseDistanceInterpolation.H b/src/overset/oversetMesh/oversetInterpolation/inverseDistanceInterpolation/inverseDistanceInterpolation.H index 6391882eb..4b7fbd02e 100644 --- a/src/overset/oversetMesh/oversetInterpolation/inverseDistanceInterpolation/inverseDistanceInterpolation.H +++ b/src/overset/oversetMesh/oversetInterpolation/inverseDistanceInterpolation/inverseDistanceInterpolation.H @@ -63,7 +63,7 @@ class inverseDistanceInterpolation // Note: for each acceptor in each region, we have a list of scalars // for all donors: master + neighbouring. Master weight is the first // [index 0], followed by neighbouring weights. - mutable ListScalarFieldField* weightsPtr_; + mutable scalarFieldFieldList* weightsPtr_; // Private Member Functions @@ -100,9 +100,8 @@ public: ); - // Destructor - - virtual ~inverseDistanceInterpolation(); + //-Destructor + virtual ~inverseDistanceInterpolation(); // Member Functions @@ -110,7 +109,7 @@ public: // Access //- Return weights - virtual const ListScalarFieldField& weights() const; + virtual const scalarFieldFieldList& weights() const; //- Update the interpolation diff --git a/src/overset/oversetMesh/oversetInterpolation/leastSquareInterpolation/leastSquareInterpolation.H b/src/overset/oversetMesh/oversetInterpolation/leastSquareInterpolation/leastSquareInterpolation.H index d7e236360..39af0c2d3 100644 --- a/src/overset/oversetMesh/oversetInterpolation/leastSquareInterpolation/leastSquareInterpolation.H +++ b/src/overset/oversetMesh/oversetInterpolation/leastSquareInterpolation/leastSquareInterpolation.H @@ -98,9 +98,8 @@ public: ); - // Destructor - - virtual ~leastSquareInterpolation(); + //- Destructor + virtual ~leastSquareInterpolation(); // Member Functions diff --git a/src/overset/oversetMesh/oversetInterpolation/leastSquaresGradientInterpolation/leastSquaresGradientInterpolation.C b/src/overset/oversetMesh/oversetInterpolation/leastSquaresGradientInterpolation/leastSquaresGradientInterpolation.C index 7b41e3130..4825f7903 100644 --- a/src/overset/oversetMesh/oversetInterpolation/leastSquaresGradientInterpolation/leastSquaresGradientInterpolation.C +++ b/src/overset/oversetMesh/oversetInterpolation/leastSquaresGradientInterpolation/leastSquaresGradientInterpolation.C @@ -79,8 +79,8 @@ void Foam::leastSquaresGradientInterpolation::calcWeights() const const vectorField& neiLsIn = lsv.nVectors().internalField(); // Create a local weight field - localWeightsPtr_ = new ScalarFieldField(ld.size()); - ScalarFieldField& localWeights = *localWeightsPtr_; + localWeightsPtr_ = new scalarFieldField(ld.size()); + scalarFieldField& localWeights = *localWeightsPtr_; // Loop through local donors, setting the weights forAll (ld, ldI) @@ -155,15 +155,15 @@ void Foam::leastSquaresGradientInterpolation::calcWeights() const const labelListList& rnd = overset().remoteNeighbouringDonors(); // Create a global weights list for remote donor weights - remoteWeightsPtr_ = new ListScalarFieldField(Pstream::nProcs()); - ListScalarFieldField& remoteWeights = *remoteWeightsPtr_; + remoteWeightsPtr_ = new scalarFieldFieldList(Pstream::nProcs()); + scalarFieldFieldList& remoteWeights = *remoteWeightsPtr_; // Get the corresponding acceptor cell centres for remote donors on this // processor const vectorField& procRemAccCC = remoteAccCC()[Pstream::myProcNo()]; // Set the size of the weight field for this processor - ScalarFieldField& myProcRemoteWeights = + scalarFieldField& myProcRemoteWeights = remoteWeights[Pstream::myProcNo()]; myProcRemoteWeights.setSize(rd.size()); @@ -266,7 +266,7 @@ Foam::leastSquaresGradientInterpolation::~leastSquaresGradientInterpolation() // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // -const Foam::oversetInterpolation::ScalarFieldField& +const Foam::scalarFieldField& Foam::leastSquaresGradientInterpolation::localWeights() const { if (!localWeightsPtr_) @@ -278,7 +278,7 @@ Foam::leastSquaresGradientInterpolation::localWeights() const } -const Foam::oversetInterpolation::ListScalarFieldField& +const Foam::oversetInterpolation::scalarFieldFieldList& Foam::leastSquaresGradientInterpolation::remoteWeights() const { // We cannot calculate the remoteWeights using usual lazy evaluation @@ -288,7 +288,7 @@ Foam::leastSquaresGradientInterpolation::remoteWeights() const { FatalErrorIn ( - "const oversetInterpolation::ListScalarFieldField&\n" + "const oversetInterpolation::scalarFieldFieldList&\n" "averageValueInterpolation::remoteWeights() const" ) << "Attempted to calculate remoteWeights for a serial run." << "This is not allowed." @@ -298,7 +298,7 @@ Foam::leastSquaresGradientInterpolation::remoteWeights() const { FatalErrorIn ( - "const oversetInterpolation::ListScalarFieldField&\n" + "const oversetInterpolation::scalarFieldFieldList&\n" "averageValueInterpolation::remoteWeights() const" ) << "Attempted to calculate remoteWeights for a slave processor. " << "This is not allowed." @@ -308,7 +308,7 @@ Foam::leastSquaresGradientInterpolation::remoteWeights() const { FatalErrorIn ( - "const oversetInterpolation::ListScalarFieldField&\n" + "const oversetInterpolation::scalarFieldFieldList&\n" "averageValueInterpolation::remoteWeights() const" ) << "Calculation of remoteWeights not possible because the data \n" << "exists only on the master processor. Please calculate \n" diff --git a/src/overset/oversetMesh/oversetInterpolation/leastSquaresGradientInterpolation/leastSquaresGradientInterpolation.H b/src/overset/oversetMesh/oversetInterpolation/leastSquaresGradientInterpolation/leastSquaresGradientInterpolation.H index 8c1e3755a..219884e72 100644 --- a/src/overset/oversetMesh/oversetInterpolation/leastSquaresGradientInterpolation/leastSquaresGradientInterpolation.H +++ b/src/overset/oversetMesh/oversetInterpolation/leastSquaresGradientInterpolation/leastSquaresGradientInterpolation.H @@ -48,7 +48,7 @@ namespace Foam { /*---------------------------------------------------------------------------*\ - Class leastSquaresGradientInterpolation Declaration + Class leastSquaresGradientInterpolation Declaration \*---------------------------------------------------------------------------*/ class leastSquaresGradientInterpolation @@ -65,14 +65,14 @@ class leastSquaresGradientInterpolation //- Weights for local donor/acceptor pairs (all donors and acceptor // are on the same processor) - mutable ScalarFieldField* localWeightsPtr_; + mutable scalarFieldField* localWeightsPtr_; // Master processor data (only accessible on master processor) //- Weights for remote donor/acceptor pairs (all donors are on a // remote processor). List for all processors is stored on // master processor (trading off memory for CPU performance) - mutable ListScalarFieldField* remoteWeightsPtr_; + mutable scalarFieldFieldList* remoteWeightsPtr_; // Private Member Functions @@ -118,10 +118,10 @@ public: // Member Functions //- Return local donor weights - virtual const ScalarFieldField& localWeights() const; + virtual const scalarFieldField& localWeights() const; //- Return remote donor weights - virtual const ListScalarFieldField& remoteWeights() const; + virtual const scalarFieldFieldList& remoteWeights() const; //- Update the interpolation virtual void update() const; diff --git a/src/overset/oversetMesh/oversetInterpolation/oversetInterpolation/oversetInterpolation.H b/src/overset/oversetMesh/oversetInterpolation/oversetInterpolation/oversetInterpolation.H index 108b59893..bb44c5899 100644 --- a/src/overset/oversetMesh/oversetInterpolation/oversetInterpolation/oversetInterpolation.H +++ b/src/overset/oversetMesh/oversetInterpolation/oversetInterpolation/oversetInterpolation.H @@ -72,8 +72,7 @@ public: // Public data types - typedef FieldField ScalarFieldField; - typedef List ListScalarFieldField; + typedef List scalarFieldFieldList; private: @@ -134,10 +133,9 @@ public: ); - // Destructor - - virtual ~oversetInterpolation() - {} + //- Destructor + virtual ~oversetInterpolation() + {} // Member Functions @@ -151,7 +149,7 @@ public: } //- Return weights - virtual const ListScalarFieldField& weights() const = 0; + virtual const scalarFieldFieldList& weights() const = 0; //- Update the interpolation diff --git a/src/overset/oversetMesh/oversetMesh/oversetMeshAddressing.C b/src/overset/oversetMesh/oversetMesh/oversetMeshAddressing.C index f59e5e030..87087fac3 100644 --- a/src/overset/oversetMesh/oversetMesh/oversetMeshAddressing.C +++ b/src/overset/oversetMesh/oversetMesh/oversetMeshAddressing.C @@ -997,6 +997,7 @@ void Foam::oversetMesh::calcInterpolationMap() const ... ... ... + ) */ // Create construct map @@ -1092,8 +1093,8 @@ void Foam::oversetMesh::calcInterpolationMap() const // Get the corresponding subList const labelList::subList procDonorIDs ( - donorIDs, // Original list - nCurProcRec, // Size of the data + donorIDs, // Original list + nCurProcRec, // Size of the received data startProcIndex // Start index ); diff --git a/src/overset/oversetMesh/oversetMesh/oversetMeshInterpolate.C b/src/overset/oversetMesh/oversetMesh/oversetMeshInterpolate.C index 201b5f1e0..fd34105ae 100644 --- a/src/overset/oversetMesh/oversetMesh/oversetMeshInterpolate.C +++ b/src/overset/oversetMesh/oversetMesh/oversetMeshInterpolate.C @@ -77,7 +77,7 @@ void Foam::oversetMesh::interpolate // Get interpolation weights for all donors for a given local acceptor in a // given region - const oversetInterpolation::ListScalarFieldField& weights = + const oversetInterpolation::scalarFieldFieldList& weights = interpolation.weights(); // Note: accF field indexed by number of acceptors (region-wise @@ -91,8 +91,7 @@ void Foam::oversetMesh::interpolate const donorAcceptorList& curAcceptors = regions_[regionI].acceptors(); // Get weights for this region - const oversetInterpolation::ScalarFieldField& regionWeights = - weights[regionI]; + const scalarFieldField& regionWeights = weights[regionI]; // Loop through all acceptors of this region forAll (curAcceptors, regionAccI)