diff --git a/src/OpenFOAM/fields/PointPatchFields/basic/coupled/CoupledPointPatchField.H b/src/OpenFOAM/fields/PointPatchFields/basic/coupled/CoupledPointPatchField.H index 92dc78878..330d7f91d 100644 --- a/src/OpenFOAM/fields/PointPatchFields/basic/coupled/CoupledPointPatchField.H +++ b/src/OpenFOAM/fields/PointPatchFields/basic/coupled/CoupledPointPatchField.H @@ -153,12 +153,6 @@ public: //- Add field to internal field virtual void addField(Field&) const = 0; - //- Initialise swap of patch point values - virtual void initSwapAdd(Field&) const - {} - - //- Complete swap of patch point values and add to local values - virtual void swapAdd(Field&) const = 0; // Matrix construction (completion) functionality diff --git a/src/OpenFOAM/fields/PointPatchFields/constraint/cyclic/CyclicPointPatchField.C b/src/OpenFOAM/fields/PointPatchFields/constraint/cyclic/CyclicPointPatchField.C index ccd399956..b392337ff 100644 --- a/src/OpenFOAM/fields/PointPatchFields/constraint/cyclic/CyclicPointPatchField.C +++ b/src/OpenFOAM/fields/PointPatchFields/constraint/cyclic/CyclicPointPatchField.C @@ -230,47 +230,6 @@ CyclicPointPatchField {} -// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // - -template -< - template class PatchField, - class Mesh, - class PointPatch, - class CyclicPointPatch, - template class MatrixType, - class Type -> -void -CyclicPointPatchField -:: -swapAdd(Field& pField) const -{ - Field pf(this->patchInternalField(pField)); - - const edgeList& pairs = cyclicPatch_.transformPairs(); - - if (doTransform()) - { - forAll(pairs, pairi) - { - Type tmp = pf[pairs[pairi][0]]; - pf[pairs[pairi][0]] = transform(forwardT()[0], pf[pairs[pairi][1]]); - pf[pairs[pairi][1]] = transform(reverseT()[0], tmp); - } - } - else - { - forAll(pairs, pairi) - { - Swap(pf[pairs[pairi][0]], pf[pairs[pairi][1]]); - } - } - - addToInternalField(pField, pf); -} - - // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // } // End namespace Foam diff --git a/src/OpenFOAM/fields/PointPatchFields/constraint/cyclic/CyclicPointPatchField.H b/src/OpenFOAM/fields/PointPatchFields/constraint/cyclic/CyclicPointPatchField.H index 8b3207717..ad98c32e3 100644 --- a/src/OpenFOAM/fields/PointPatchFields/constraint/cyclic/CyclicPointPatchField.H +++ b/src/OpenFOAM/fields/PointPatchFields/constraint/cyclic/CyclicPointPatchField.H @@ -194,8 +194,6 @@ public: virtual void addField(Field&) const {} - //- Complete swap of patch point values and add to local values - virtual void swapAdd(Field&) const; // Matrix construction (completion) functionality. Currently faked // HJ, 31/May/2007 diff --git a/src/OpenFOAM/fields/PointPatchFields/constraint/processor/ProcessorPointPatchField.C b/src/OpenFOAM/fields/PointPatchFields/constraint/processor/ProcessorPointPatchField.C index ac66a8cc6..677473247 100644 --- a/src/OpenFOAM/fields/PointPatchFields/constraint/processor/ProcessorPointPatchField.C +++ b/src/OpenFOAM/fields/PointPatchFields/constraint/processor/ProcessorPointPatchField.C @@ -601,86 +601,6 @@ setBoundaryCondition } -template -< - template class PatchField, - class Mesh, - class PointPatch, - class ProcessorPointPatch, - template class MatrixType, - class Type -> -void -ProcessorPointPatchField -:: -initSwapAdd(Field& pField) const -{ - Field pf(this->patchInternalField(pField)); - - OPstream::write - ( - Pstream::blocking, - procPatch_.neighbProcNo(), - reinterpret_cast(pf.begin()), - pf.byteSize() - ); -} - - -template -< - template class PatchField, - class Mesh, - class PointPatch, - class ProcessorPointPatch, - template class MatrixType, - class Type -> -void -ProcessorPointPatchField -:: -swapAdd(Field& pField) const -{ - Field pnf(this->size()); - - IPstream::read - ( - Pstream::blocking, - procPatch_.neighbProcNo(), - reinterpret_cast(pnf.begin()), - pnf.byteSize() - ); - - if (doTransform()) - { - const labelList& nonGlobalPatchPoints = - procPatch_.nonGlobalPatchPoints(); - - const processorPolyPatch& ppp = procPatch_.procPolyPatch(); - const labelListList& pointFaces = ppp.pointFaces(); - const tensorField& forwardT = ppp.forwardT(); - - if (forwardT.size() == 1) - { - transform(pnf, forwardT[0], pnf); - } - else - { - forAll(nonGlobalPatchPoints, pfi) - { - pnf[pfi] = transform - ( - forwardT[pointFaces[nonGlobalPatchPoints[pfi]][0]], - pnf[pfi] - ); - } - } - } - - addToInternalField(pField, pnf); -} - - // Initialise transfer of diagonal coefficients template < diff --git a/src/OpenFOAM/fields/PointPatchFields/constraint/processor/ProcessorPointPatchField.H b/src/OpenFOAM/fields/PointPatchFields/constraint/processor/ProcessorPointPatchField.H index 4afe96f86..a44c5acf1 100644 --- a/src/OpenFOAM/fields/PointPatchFields/constraint/processor/ProcessorPointPatchField.H +++ b/src/OpenFOAM/fields/PointPatchFields/constraint/processor/ProcessorPointPatchField.H @@ -291,12 +291,6 @@ public: Map::ConstraintType> & ) const; - //- Initialise swap of patch point values - virtual void initSwapAdd(Field&) const; - - //- Complete swap of patch point values and add to local values - virtual void swapAdd(Field&) const; - // Matrix construction (completion) functionality diff --git a/src/OpenFOAM/fields/PointPatchFields/derived/global/GlobalPointPatchField.C b/src/OpenFOAM/fields/PointPatchFields/derived/global/GlobalPointPatchField.C index 541f91d71..0f4dac775 100644 --- a/src/OpenFOAM/fields/PointPatchFields/derived/global/GlobalPointPatchField.C +++ b/src/OpenFOAM/fields/PointPatchFields/derived/global/GlobalPointPatchField.C @@ -629,55 +629,6 @@ void GlobalPointPatchField } -template -< - template class PatchField, - class Mesh, - class PointPatch, - class GlobalPointPatch, - template class MatrixType, - class Type -> -void GlobalPointPatchField -< - PatchField, - Mesh, - PointPatch, - GlobalPointPatch, - MatrixType, - Type ->::swapAdd(Field& pField) const -{ - // Create the global list and insert local values - if (globalPointPatch_.globalPointSize() > 0) - { - Field lpf = patchInternalField(pField); - const labelList& addr = globalPointPatch_.sharedPointAddr(); - - Field gpf - ( - globalPointPatch_.globalPointSize(), - pTraits::zero - ); - - forAll(addr, i) - { - gpf[addr[i]] += lpf[i]; - } - - combineReduce(gpf, plusEqOp >()); - - // Extract local data - forAll (addr, i) - { - lpf[i] = gpf[addr[i]]; - } - - setInInternalField(pField, lpf); - } -} - - // Add diagonal coefficients template < diff --git a/src/OpenFOAM/fields/PointPatchFields/derived/global/GlobalPointPatchField.H b/src/OpenFOAM/fields/PointPatchFields/derived/global/GlobalPointPatchField.H index d7af021b1..07150cbd8 100644 --- a/src/OpenFOAM/fields/PointPatchFields/derived/global/GlobalPointPatchField.H +++ b/src/OpenFOAM/fields/PointPatchFields/derived/global/GlobalPointPatchField.H @@ -198,9 +198,6 @@ public: Map::ConstraintType> & ) const; - //- Complete swap of patch point values and add to local values - virtual void swapAdd(Field&) const; - // Matrix construction (completion) functionality diff --git a/src/OpenFOAM/meshes/pointMesh/pointBoundaryMesh/pointBoundaryMesh.H b/src/OpenFOAM/meshes/pointMesh/pointBoundaryMesh/pointBoundaryMesh.H index e508f5bc8..30c1ae42b 100644 --- a/src/OpenFOAM/meshes/pointMesh/pointBoundaryMesh/pointBoundaryMesh.H +++ b/src/OpenFOAM/meshes/pointMesh/pointBoundaryMesh/pointBoundaryMesh.H @@ -64,7 +64,8 @@ class pointBoundaryMesh // Private Member Functions - //- Calculate the geometry for the patches (transformation tensors etc.) + //- Calculate the geometry for the patches + // (transformation tensors etc.) void calcGeometry(); //- Disallow default bitwise copy construct diff --git a/src/OpenFOAM/meshes/pointMesh/pointPatches/constraint/cyclic/cyclicPointPatch.C b/src/OpenFOAM/meshes/pointMesh/pointPatches/constraint/cyclic/cyclicPointPatch.C index 5a39769b3..1aa9923e4 100644 --- a/src/OpenFOAM/meshes/pointMesh/pointPatches/constraint/cyclic/cyclicPointPatch.C +++ b/src/OpenFOAM/meshes/pointMesh/pointPatches/constraint/cyclic/cyclicPointPatch.C @@ -48,118 +48,15 @@ addToRunTimeSelectionTable ); -// * * * * * * * * * * * * * Protected Member Functions * * * * * * * * * * // - -void Foam::cyclicPointPatch::initGeometry() -{ - transformPairs_.setSize(0); -} - - -void Foam::cyclicPointPatch::calcGeometry() -{ - const edgeList& cp = cyclicPolyPatch_.coupledPoints(); - const labelList& mp = cyclicPolyPatch_.meshPoints(); - - // If there are no global points create a 1->1 map - if (!boundaryMesh().mesh().globalData().nGlobalPoints()) - { - nonGlobalPatchPoints_.setSize(mp.size()); - forAll(nonGlobalPatchPoints_, i) - { - nonGlobalPatchPoints_[i] = i; - } - - meshPoints_ = cyclicPolyPatch_.meshPoints(); - transformPairs_ = cp; - } - else - { - // Get reference to shared points - const labelList& sharedPoints = - boundaryMesh().globalPatch().meshPoints(); - - nonGlobalPatchPoints_.setSize(mp.size()); - meshPoints_.setSize(mp.size()); - - labelList pointMap(mp.size(), -1); - - label noFiltPoints = 0; - - forAll (mp, pointI) - { - label curP = mp[pointI]; - - bool found = false; - - forAll (sharedPoints, sharedI) - { - if (sharedPoints[sharedI] == curP) - { - found = true; - break; - } - } - - if (!found) - { - pointMap[pointI] = noFiltPoints; - nonGlobalPatchPoints_[noFiltPoints] = pointI; - meshPoints_[noFiltPoints] = curP; - noFiltPoints++; - } - } - - nonGlobalPatchPoints_.setSize(noFiltPoints); - meshPoints_.setSize(noFiltPoints); - - - transformPairs_.setSize(cp.size()); - - label noFiltPointPairs = 0; - - forAll(cp, i) - { - if (pointMap[cp[i][0]] != -1 && pointMap[cp[i][1]] != -1) - { - transformPairs_[noFiltPointPairs][0] = pointMap[cp[i][0]]; - transformPairs_[noFiltPointPairs][1] = pointMap[cp[i][1]]; - noFiltPointPairs++; - } - else if (pointMap[cp[i][0]] == -1 && pointMap[cp[i][1]] != -1) - { - FatalErrorIn("cyclicPointPatch::calcGeometry() const") - << "Point " << cp[i][0] << "of point-pair " << i - << " is a global point but the other point " - << cp[i][1] << " is not" - << exit(FatalError); - } - else if (pointMap[cp[i][0]] != -1 && pointMap[cp[i][1]] == -1) - { - FatalErrorIn("cyclicPointPatch::calcGeometry() const") - << "Point " << cp[i][1] << "of point-pair " << i - << " is a global point but the other point " - << cp[i][0] << " is not" - << exit(FatalError); - } - } - - transformPairs_.setSize(noFiltPointPairs); - } -} - - void cyclicPointPatch::initUpdateMesh() { facePointPatch::initUpdateMesh(); - cyclicPointPatch::initGeometry(); } void cyclicPointPatch::updateMesh() { facePointPatch::updateMesh(); - cyclicPointPatch::calcGeometry(); } @@ -184,10 +81,6 @@ cyclicPointPatch::~cyclicPointPatch() // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // -const edgeList& cyclicPointPatch::transformPairs() const -{ - return transformPairs_; -} // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // diff --git a/src/OpenFOAM/meshes/pointMesh/pointPatches/constraint/cyclic/cyclicPointPatch.H b/src/OpenFOAM/meshes/pointMesh/pointPatches/constraint/cyclic/cyclicPointPatch.H index cda8e2195..abf52297b 100644 --- a/src/OpenFOAM/meshes/pointMesh/pointPatches/constraint/cyclic/cyclicPointPatch.H +++ b/src/OpenFOAM/meshes/pointMesh/pointPatches/constraint/cyclic/cyclicPointPatch.H @@ -79,10 +79,12 @@ protected: // Protected Member Functions //- Initialise the calculation of the patch geometry - virtual void initGeometry(); + virtual void initGeometry() + {} //- Calculate the patch geometry - virtual void calcGeometry(); + virtual void calcGeometry() + {} //- Correct patches after moving points virtual void movePoints() @@ -147,13 +149,6 @@ public: { return cyclicPolyPatch_.reverseT(); } - - - // Access functions for demand driven data - - //- Return the set of pairs of points that require transformation - // and/or mapping - virtual const edgeList& transformPairs() const; }; diff --git a/src/OpenFOAM/meshes/pointMesh/pointPatches/constraint/cyclicGgi/cyclicGgiPointPatch.C b/src/OpenFOAM/meshes/pointMesh/pointPatches/constraint/cyclicGgi/cyclicGgiPointPatch.C index 2a984f8fa..87b369c22 100644 --- a/src/OpenFOAM/meshes/pointMesh/pointPatches/constraint/cyclicGgi/cyclicGgiPointPatch.C +++ b/src/OpenFOAM/meshes/pointMesh/pointPatches/constraint/cyclicGgi/cyclicGgiPointPatch.C @@ -49,33 +49,15 @@ namespace Foam // * * * * * * * * * * * * * Protected Member Functions * * * * * * * * * * // -void Foam::cyclicGgiPointPatch::initGeometry() -{} - - -void Foam::cyclicGgiPointPatch::calcGeometry() -{ - meshPoints_ = cyclicGgiPolyPatch_.meshPoints(); - - nonGlobalPatchPoints_.setSize(meshPoints_.size()); - forAll(nonGlobalPatchPoints_, i) - { - nonGlobalPatchPoints_[i] = i; - } -} - - void Foam::cyclicGgiPointPatch::initUpdateMesh() { facePointPatch::initUpdateMesh(); - cyclicGgiPointPatch::initGeometry(); } void Foam::cyclicGgiPointPatch::updateMesh() { facePointPatch::updateMesh(); - cyclicGgiPointPatch::calcGeometry(); } diff --git a/src/OpenFOAM/meshes/pointMesh/pointPatches/constraint/cyclicGgi/cyclicGgiPointPatch.H b/src/OpenFOAM/meshes/pointMesh/pointPatches/constraint/cyclicGgi/cyclicGgiPointPatch.H index 25ed9e06b..8cef7191c 100644 --- a/src/OpenFOAM/meshes/pointMesh/pointPatches/constraint/cyclicGgi/cyclicGgiPointPatch.H +++ b/src/OpenFOAM/meshes/pointMesh/pointPatches/constraint/cyclicGgi/cyclicGgiPointPatch.H @@ -78,10 +78,12 @@ protected: // Protected Member Functions //- Initialise the calculation of the patch geometry - virtual void initGeometry(); + virtual void initGeometry() + {} //- Calculate mesh points - virtual void calcGeometry(); + virtual void calcGeometry() + {} //- Correct patches after moving points virtual void movePoints() diff --git a/src/OpenFOAM/meshes/pointMesh/pointPatches/constraint/ggi/ggiPointPatch.C b/src/OpenFOAM/meshes/pointMesh/pointPatches/constraint/ggi/ggiPointPatch.C index 87da1cddf..bb429499e 100644 --- a/src/OpenFOAM/meshes/pointMesh/pointPatches/constraint/ggi/ggiPointPatch.C +++ b/src/OpenFOAM/meshes/pointMesh/pointPatches/constraint/ggi/ggiPointPatch.C @@ -49,33 +49,15 @@ namespace Foam // * * * * * * * * * * * * * Protected Member Functions * * * * * * * * * * // -void Foam::ggiPointPatch::initGeometry() -{} - - -void Foam::ggiPointPatch::calcGeometry() -{ - meshPoints_ = ggiPolyPatch_.meshPoints(); - - nonGlobalPatchPoints_.setSize(meshPoints_.size()); - forAll(nonGlobalPatchPoints_, i) - { - nonGlobalPatchPoints_[i] = i; - } -} - - void Foam::ggiPointPatch::initUpdateMesh() { facePointPatch::initUpdateMesh(); - ggiPointPatch::initGeometry(); } void Foam::ggiPointPatch::updateMesh() { facePointPatch::updateMesh(); - ggiPointPatch::calcGeometry(); } diff --git a/src/OpenFOAM/meshes/pointMesh/pointPatches/constraint/ggi/ggiPointPatch.H b/src/OpenFOAM/meshes/pointMesh/pointPatches/constraint/ggi/ggiPointPatch.H index b145afae8..324133963 100644 --- a/src/OpenFOAM/meshes/pointMesh/pointPatches/constraint/ggi/ggiPointPatch.H +++ b/src/OpenFOAM/meshes/pointMesh/pointPatches/constraint/ggi/ggiPointPatch.H @@ -75,10 +75,12 @@ protected: // Protected Member Functions //- Initialise the calculation of the patch geometry - virtual void initGeometry(); + virtual void initGeometry() + {} //- Calculate mesh points - virtual void calcGeometry(); + virtual void calcGeometry() + {} //- Correct patches after moving points virtual void movePoints() diff --git a/src/OpenFOAM/meshes/pointMesh/pointPatches/constraint/overlapGgi/overlapGgiPointPatch.C b/src/OpenFOAM/meshes/pointMesh/pointPatches/constraint/overlapGgi/overlapGgiPointPatch.C index 85238ac0b..e525d58cf 100644 --- a/src/OpenFOAM/meshes/pointMesh/pointPatches/constraint/overlapGgi/overlapGgiPointPatch.C +++ b/src/OpenFOAM/meshes/pointMesh/pointPatches/constraint/overlapGgi/overlapGgiPointPatch.C @@ -49,33 +49,15 @@ namespace Foam // * * * * * * * * * * * * * Protected Member Functions * * * * * * * * * * // -void Foam::overlapGgiPointPatch::initGeometry() -{} - - -void Foam::overlapGgiPointPatch::calcGeometry() -{ - meshPoints_ = overlapGgiPolyPatch_.meshPoints(); - - nonGlobalPatchPoints_.setSize(meshPoints_.size()); - forAll(nonGlobalPatchPoints_, i) - { - nonGlobalPatchPoints_[i] = i; - } -} - - void Foam::overlapGgiPointPatch::initUpdateMesh() { facePointPatch::initUpdateMesh(); - overlapGgiPointPatch::initGeometry(); } void Foam::overlapGgiPointPatch::updateMesh() { facePointPatch::updateMesh(); - overlapGgiPointPatch::calcGeometry(); } diff --git a/src/OpenFOAM/meshes/pointMesh/pointPatches/constraint/overlapGgi/overlapGgiPointPatch.H b/src/OpenFOAM/meshes/pointMesh/pointPatches/constraint/overlapGgi/overlapGgiPointPatch.H index 01b21aa63..ef08baf6f 100644 --- a/src/OpenFOAM/meshes/pointMesh/pointPatches/constraint/overlapGgi/overlapGgiPointPatch.H +++ b/src/OpenFOAM/meshes/pointMesh/pointPatches/constraint/overlapGgi/overlapGgiPointPatch.H @@ -75,10 +75,12 @@ protected: // Protected Member Functions //- Initialise the calculation of the patch geometry - virtual void initGeometry(); + virtual void initGeometry() + {} //- Calculate mesh points - virtual void calcGeometry(); + virtual void calcGeometry() + {} //- Initialise the patches for moving points virtual void initMovePoints(const pointField&) diff --git a/src/OpenFOAM/meshes/pointMesh/pointPatches/constraint/processor/processorPointPatch.C b/src/OpenFOAM/meshes/pointMesh/pointPatches/constraint/processor/processorPointPatch.C index 87d413192..77022ec71 100644 --- a/src/OpenFOAM/meshes/pointMesh/pointPatches/constraint/processor/processorPointPatch.C +++ b/src/OpenFOAM/meshes/pointMesh/pointPatches/constraint/processor/processorPointPatch.C @@ -81,284 +81,11 @@ void Foam::processorPointPatch::initGeometry() pp.points() ).meshPoints(); } - - if (Pstream::parRun()) - { - initPatchPatchPoints(); - } } void Foam::processorPointPatch::calcGeometry() -{ - if (Pstream::parRun()) - { - calcPatchPatchPoints(); - } - - // If it is not runing parallel or there are no global points - // create a 1->1 map - if - ( - !Pstream::parRun() - || !boundaryMesh().mesh().globalData().nGlobalPoints() - ) - { - nonGlobalPatchPoints_.setSize(meshPoints_.size()); - forAll(nonGlobalPatchPoints_, i) - { - nonGlobalPatchPoints_[i] = i; - } - } - else - { - // Get reference to shared points - const labelList& sharedPoints = - boundaryMesh().globalPatch().meshPoints(); - - nonGlobalPatchPoints_.setSize(meshPoints_.size()); - - label noFiltPoints = 0; - - forAll (meshPoints_, pointI) - { - label curP = meshPoints_[pointI]; - - bool found = false; - - forAll (sharedPoints, sharedI) - { - if (sharedPoints[sharedI] == curP) - { - found = true; - break; - } - } - - if (!found) - { - nonGlobalPatchPoints_[noFiltPoints] = pointI; - meshPoints_[noFiltPoints] = curP; - noFiltPoints++; - } - } - - nonGlobalPatchPoints_.setSize(noFiltPoints); - meshPoints_.setSize(noFiltPoints); - } -} - - -void processorPointPatch::initPatchPatchPoints() -{ - if (debug) - { - Info<< "processorPointPatch::calcPatchPatchPoints() : " - << "constructing patch-patch points" - << endl; - } - - const polyBoundaryMesh& bm = boundaryMesh().mesh()().boundaryMesh(); - - // Get the mesh points for this patch corresponding to the faces - const labelList& ppmp = meshPoints(); - - // Create a HashSet of the point labels for this patch - Map