diff --git a/applications/utilities/mesh/conversion/fluent3DMeshToFoam/fluent3DMeshToFoam.L b/applications/utilities/mesh/conversion/fluent3DMeshToFoam/fluent3DMeshToFoam.L index 214796253e..c89c1f9d09 100644 --- a/applications/utilities/mesh/conversion/fluent3DMeshToFoam/fluent3DMeshToFoam.L +++ b/applications/utilities/mesh/conversion/fluent3DMeshToFoam/fluent3DMeshToFoam.L @@ -1081,11 +1081,9 @@ int main(int argc, char *argv[]) 0, patchi, mesh.boundaryMesh(), + cyclicPolyPatch::typeName, neighbPatchName, - cyclicPolyPatch::NOORDERING, - Zero, - Zero, - Zero + cyclicPolyPatch::NOORDERING ); } else diff --git a/applications/utilities/mesh/manipulation/createPatch/createPatch.C b/applications/utilities/mesh/manipulation/createPatch/createPatch.C index 969d2b4aa2..87e35d1d1b 100644 --- a/applications/utilities/mesh/manipulation/createPatch/createPatch.C +++ b/applications/utilities/mesh/manipulation/createPatch/createPatch.C @@ -776,18 +776,10 @@ int main(int argc, char *argv[]) const cyclicPolyPatch& cycpp = refCast(pp); - if (cycpp.transform() == cyclicPolyPatch::TRANSLATIONAL) - { - // Force to wanted separation - Info<< "On cyclic translation patch " << pp.name() - << " forcing uniform separation of " - << cycpp.separationVector() << endl; - const_cast(cpp.separation()) = - cycpp.separationVector(); - } - else + if (cycpp.transform() != cyclicPolyPatch::TRANSLATIONAL) { const cyclicPolyPatch& nbr = cycpp.neighbPatch(); + const_cast(cpp.separation()) = nbr[0].centre(mesh.points()) - cycpp[0].centre(mesh.points()); @@ -800,17 +792,8 @@ int main(int argc, char *argv[]) else if (!cpp.parallel()) { Info<< "On coupled patch " << pp.name() - << " forcing uniform rotation of " + << " uniform rotation of " << cpp.forwardT() << endl; - - // const_cast - // ( - // cpp.forwardT() - // ).setSize(1); - // const_cast - // ( - // cpp.reverseT() - // ).setSize(1); } } } diff --git a/applications/utilities/parallelProcessing/decomposePar/domainDecomposition.C b/applications/utilities/parallelProcessing/decomposePar/domainDecomposition.C index e97b950133..0f0c8f5e68 100644 --- a/applications/utilities/parallelProcessing/decomposePar/domainDecomposition.C +++ b/applications/utilities/parallelProcessing/decomposePar/domainDecomposition.C @@ -496,7 +496,7 @@ bool Foam::domainDecomposition::writeDecomposition(const bool decomposeSets) proci, curNeighbourProcessors[procPatchi], pcPatch.name(), - pcPatch.transform() + pcPatch.ordering() ); } diff --git a/etc/caseDicts/annotated/createPatchDict b/etc/caseDicts/annotated/createPatchDict index 331fe9bd01..9a9bc278cd 100644 --- a/etc/caseDicts/annotated/createPatchDict +++ b/etc/caseDicts/annotated/createPatchDict @@ -66,7 +66,7 @@ patches rotationAxis (1 0 0); rotationCentre (0 0 0); // transform translational; - // separationVector (1 0 0); + // separation (1 0 0); // Optional non-default tolerance to be able to define cyclics // on bad meshes @@ -98,7 +98,7 @@ patches rotationAxis (1 0 0); rotationCentre (0 0 0); // transform translational; - // separationVector (1 0 0); + // separation (1 0 0); } // How to construct: either from 'patches' or 'set' diff --git a/src/OpenFOAM/meshes/polyMesh/polyPatches/basic/coupled/coupledPolyPatch.C b/src/OpenFOAM/meshes/polyMesh/polyPatches/basic/coupled/coupledPolyPatch.C index 28bbbb71f0..66c749431e 100644 --- a/src/OpenFOAM/meshes/polyMesh/polyPatches/basic/coupled/coupledPolyPatch.C +++ b/src/OpenFOAM/meshes/polyMesh/polyPatches/basic/coupled/coupledPolyPatch.C @@ -37,16 +37,26 @@ namespace Foam const scalar coupledPolyPatch::defaultMatchTol_ = 1e-4; template<> - const char* NamedEnum::names[] = + const char* NamedEnum::names[] = { "unknown", - "rotational", - "translational", "coincidentFullMatch", "noOrdering" }; - const NamedEnum + const NamedEnum + coupledPolyPatch::orderingTypeNames; + + template<> + const char* NamedEnum::names[] = + { + "unspecified", + "none", + "rotational", + "translational" + }; + + const NamedEnum coupledPolyPatch::transformTypeNames; } @@ -131,12 +141,12 @@ Foam::pointField Foam::coupledPolyPatch::getAnchorPoints ( const UList& faces, const pointField& points, - const transformType transform + const orderingType ordering ) { pointField anchors(faces.size()); - if (transform != COINCIDENTFULLMATCH) + if (ordering != COINCIDENTFULLMATCH) { // Return the first point forAll(faces, facei) @@ -289,172 +299,6 @@ Foam::label Foam::coupledPolyPatch::getRotation } -void Foam::coupledPolyPatch::calcTransformTensors -( - const vectorField& Cf, - const vectorField& Cr, - const vectorField& nf, - const vectorField& nr, - const scalarField& smallDist, - const scalar absTol, - const transformType transform -) const -{ - if (debug) - { - Pout<< "coupledPolyPatch::calcTransformTensors : " << name() << endl - << " transform:" << transformTypeNames[transform] << nl - << " (half)size:" << Cf.size() << nl - << " absTol:" << absTol << nl - << " smallDist min:" << min(smallDist) << nl - << " smallDist max:" << max(smallDist) << nl - << " sum(mag(nf & nr)):" << sum(mag(nf & nr)) << endl; - } - - // Tolerance calculation. - // - normal calculation: assume absTol is the absolute error in a - // single normal/transformation calculation. Consists both of numerical - // precision (on the order of small and of writing precision - // (from e.g. decomposition) - // Then the overall error of summing the normals is sqrt(size())*absTol - // - separation calculation: pass in from the outside an allowable error. - - if (Cf.size() == 0) - { - // Dummy geometry. Assume non-separated, parallel. - parallel_ = true; - separated_ = false; - } - else - { - scalar error = absTol*Foam::sqrt(1.0*Cf.size()); - - if (debug) - { - Pout<< " error:" << error << endl; - } - - if - ( - transform == ROTATIONAL - || ( - transform != TRANSLATIONAL - && transform != COINCIDENTFULLMATCH - && (sum(mag(nf & nr)) < Cf.size() - error) - ) - ) - { - // Type is rotation or unknown and normals not aligned - - parallel_ = false; - separated_ = false; - separation_ = Zero; - - tensorField forwardT(Cf.size()); - tensorField reverseT(Cf.size()); - - forAll(forwardT, facei) - { - forwardT[facei] = rotationTensor(-nr[facei], nf[facei]); - reverseT[facei] = rotationTensor(nf[facei], -nr[facei]); - } - - if (sum(mag(forwardT - forwardT[0])) > error) - { - Pout<< "--> FOAM Warning : " - << " Variation in rotation greater than" - << " local tolerance " << error << endl; - } - - forwardT_ = forwardT[0]; - reverseT_ = reverseT[0]; - } - else - { - // Translational or (unknown and normals aligned) - - parallel_ = true; - - forwardT_ = Zero; - reverseT_ = Zero; - - - // Three situations: - // - separation is zero. No separation. - // - separation is same. Single separation vector. - // - separation differs per face -> error. - - // Check for different separation per face - bool sameSeparation = true; - bool doneWarning = false; - - const vectorField separation(Cr - Cf); - - forAll(separation, facei) - { - const scalar smallSqr = sqr(smallDist[facei]); - - // Check if separation differing w.r.t. face 0. - if (magSqr(separation[facei] - separation[0]) > smallSqr) - { - sameSeparation = false; - - if (!doneWarning && debug) - { - doneWarning = true; - - Pout<< " separation " << separation[facei] - << " at " << facei - << " differs from separation[0] " << separation[0] - << " by more than local tolerance " - << smallDist[facei] - << ". Assuming non-uniform separation." << endl; - } - } - } - - if (sameSeparation) - { - // Check for zero separation - if (mag(separation[0]) < smallDist[0]) - { - if (debug) - { - Pout<< " separation " << mag(separation[0]) - << " less than local tolerance " << smallDist[0] - << ". Assuming zero separation." << endl; - } - - separated_ = false; - separation_ = Zero; - } - else - { - if (debug) - { - Pout<< " separation " << mag(separation[0]) - << " more than local tolerance " << smallDist[0] - << ". Assuming uniform separation." << endl; - } - - separated_ = true; - separation_ = separation[0]; - } - } - else - { - Pout<< "--> FOAM Warning : " - << " Variation in separation greater than" - << " local tolerance " << smallDist[0] << endl; - - separated_ = true; - separation_ = separation[0]; - } - } - } -} - - // * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * * * * * // Foam::coupledPolyPatch::coupledPolyPatch @@ -465,12 +309,13 @@ Foam::coupledPolyPatch::coupledPolyPatch const label index, const polyBoundaryMesh& bm, const word& patchType, - const transformType transform + const orderingType ordering ) : polyPatch(name, size, start, index, bm, patchType), matchTolerance_(defaultMatchTol_), - transform_(transform), + ordering_(ordering), + transform_(UNSPECIFIED), parallel_(true), separated_(false) {} @@ -483,16 +328,22 @@ Foam::coupledPolyPatch::coupledPolyPatch const label index, const polyBoundaryMesh& bm, const word& patchType, - const transformType defaultTransform + const orderingType ordering ) : polyPatch(name, dict, index, bm, patchType), matchTolerance_(dict.lookupOrDefault("matchTolerance", defaultMatchTol_)), + ordering_ + ( + dict.found("ordering") + ? orderingTypeNames.read(dict.lookup("ordering")) + : ordering + ), transform_ ( dict.found("transform") ? transformTypeNames.read(dict.lookup("transform")) - : defaultTransform + : UNSPECIFIED ), parallel_(true), separated_(false) @@ -559,6 +410,7 @@ void Foam::coupledPolyPatch::write(Ostream& os) const { polyPatch::write(os); writeEntry(os, "matchTolerance", matchTolerance_); + writeEntry(os, "ordering", orderingTypeNames[ordering_]); writeEntry(os, "transform", transformTypeNames[transform_]); } diff --git a/src/OpenFOAM/meshes/polyMesh/polyPatches/basic/coupled/coupledPolyPatch.H b/src/OpenFOAM/meshes/polyMesh/polyPatches/basic/coupled/coupledPolyPatch.H index 9778545a6d..c3c2cae9e2 100644 --- a/src/OpenFOAM/meshes/polyMesh/polyPatches/basic/coupled/coupledPolyPatch.H +++ b/src/OpenFOAM/meshes/polyMesh/polyPatches/basic/coupled/coupledPolyPatch.H @@ -55,17 +55,25 @@ class coupledPolyPatch { public: - enum transformType + enum orderingType { - UNKNOWN, // unspecified; automatic ordering - ROTATIONAL, // rotation along coordinate axis - TRANSLATIONAL, // translation - COINCIDENTFULLMATCH,// assume no transforms + UNKNOWN, // Unspecified -> automatic ordering + COINCIDENTFULLMATCH,// Assume no transforms // and check the points in faces match - NOORDERING // unspecified, no automatic ordering + NOORDERING // Unspecified -> no automatic ordering }; - static const NamedEnum transformTypeNames; + static const NamedEnum orderingTypeNames; + + enum transformType + { + UNSPECIFIED, // Unspecified -> automatic transformation + NONE, // No tranformation + ROTATIONAL, // Rotation around a coordinate axis + TRANSLATIONAL // Translation + }; + + static const NamedEnum transformTypeNames; protected: @@ -78,6 +86,9 @@ protected: //- Local matching tolerance const scalar matchTolerance_; + //- Type of ordering + orderingType ordering_; + //- Type of transformation transformType transform_; @@ -102,22 +113,6 @@ protected: // Protected Member Functions - //- Calculate the transformation tensors - // smallDist : matching distance per face - // absTol : absolute error in normal - // if transformType = unknown it first tries rotational, then - // translational transform - void calcTransformTensors - ( - const vectorField& Cf, - const vectorField& Cr, - const vectorField& nf, - const vectorField& nr, - const scalarField& smallDist, - const scalar absTol, - const transformType = UNKNOWN - ) const; - //- Initialise the calculation of the patch geometry virtual void initGeometry(PstreamBuffers&) = 0; @@ -136,7 +131,6 @@ protected: //- Update of the patch topology virtual void updateMesh(PstreamBuffers&) = 0; - //- Write point in OBJ format static void writeOBJ(Ostream& os, const point& pt); @@ -165,7 +159,7 @@ protected: ( const UList&, const pointField&, - const transformType + const orderingType ); //- Get the number of vertices face f needs to be rotated such that @@ -196,7 +190,7 @@ public: const label index, const polyBoundaryMesh& bm, const word& patchType, - const transformType transform + const orderingType ordering ); //- Construct from dictionary @@ -207,7 +201,7 @@ public: const label index, const polyBoundaryMesh& bm, const word& patchType, - const transformType defaultTransform = UNKNOWN + const orderingType ordering = UNKNOWN ); //- Construct as copy, resetting the boundary mesh @@ -258,16 +252,14 @@ public: return !owner(); } - //- Type of transform - virtual transformType transform() const + //- Type of ordering + virtual orderingType ordering() const { - return transform_; + return ordering_; } //- Type of transform - // This is currently only for use when collapsing generated - // meshes that can have zero area faces. - virtual transformType& transform() + virtual transformType transform() const { return transform_; } diff --git a/src/OpenFOAM/meshes/polyMesh/polyPatches/constraint/cyclic/cyclicPolyPatch.C b/src/OpenFOAM/meshes/polyMesh/polyPatches/constraint/cyclic/cyclicPolyPatch.C index b37d6cb25b..6c3f11b025 100644 --- a/src/OpenFOAM/meshes/polyMesh/polyPatches/constraint/cyclic/cyclicPolyPatch.C +++ b/src/OpenFOAM/meshes/polyMesh/polyPatches/constraint/cyclic/cyclicPolyPatch.C @@ -49,6 +49,173 @@ namespace Foam // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // +void Foam::cyclicPolyPatch::calcTransformTensors +( + const vectorField& Cf, + const vectorField& Cr, + const vectorField& nf, + const vectorField& nr, + const scalarField& smallDist, + const scalar absTol, + const orderingType ordering, + const transformType transform +) const +{ + if (debug) + { + Pout<< "coupledPolyPatch::calcTransformTensors : " << name() << endl + << " transform:" << transformTypeNames[transform] << nl + << " (half)size:" << Cf.size() << nl + << " absTol:" << absTol << nl + << " smallDist min:" << min(smallDist) << nl + << " smallDist max:" << max(smallDist) << nl + << " sum(mag(nf & nr)):" << sum(mag(nf & nr)) << endl; + } + + // Tolerance calculation. + // - normal calculation: assume absTol is the absolute error in a + // single normal/transformation calculation. Consists both of numerical + // precision (on the order of small and of writing precision + // (from e.g. decomposition) + // Then the overall error of summing the normals is sqrt(size())*absTol + // - separation calculation: pass in from the outside an allowable error. + + if (Cf.size() == 0) + { + // Dummy geometry. Assume non-separated, parallel. + parallel_ = true; + separated_ = false; + } + else + { + scalar error = absTol*Foam::sqrt(1.0*Cf.size()); + + if (debug) + { + Pout<< " error:" << error << endl; + } + + if + ( + transform == ROTATIONAL + || ( + transform != TRANSLATIONAL + && ordering != COINCIDENTFULLMATCH + && (sum(mag(nf & nr)) < Cf.size() - error) + ) + ) + { + // Type is rotation or unknown and normals not aligned + + parallel_ = false; + separated_ = false; + separation_ = Zero; + + tensorField forwardT(Cf.size()); + tensorField reverseT(Cf.size()); + + forAll(forwardT, facei) + { + forwardT[facei] = rotationTensor(-nr[facei], nf[facei]); + reverseT[facei] = rotationTensor(nf[facei], -nr[facei]); + } + + if (sum(mag(forwardT - forwardT[0])) > error) + { + Pout<< "--> FOAM Warning : " + << " Variation in rotation greater than" + << " local tolerance " << error << endl; + } + + forwardT_ = forwardT[0]; + reverseT_ = reverseT[0]; + } + else + { + // Translational or (unknown and normals aligned) + + parallel_ = true; + + forwardT_ = Zero; + reverseT_ = Zero; + + + // Three situations: + // - separation is zero. No separation. + // - separation is same. Single separation vector. + // - separation differs per face -> error. + + // Check for different separation per face + bool sameSeparation = true; + bool doneWarning = false; + + const vectorField separation(Cr - Cf); + + forAll(separation, facei) + { + const scalar smallSqr = sqr(smallDist[facei]); + + // Check if separation differing w.r.t. face 0. + if (magSqr(separation[facei] - separation[0]) > smallSqr) + { + sameSeparation = false; + + if (!doneWarning && debug) + { + doneWarning = true; + + Pout<< " separation " << separation[facei] + << " at " << facei + << " differs from separation[0] " << separation[0] + << " by more than local tolerance " + << smallDist[facei] + << ". Assuming non-uniform separation." << endl; + } + } + } + + if (sameSeparation) + { + // Check for zero separation + if (mag(separation[0]) < smallDist[0]) + { + if (debug) + { + Pout<< " separation " << mag(separation[0]) + << " less than local tolerance " << smallDist[0] + << ". Assuming zero separation." << endl; + } + + separated_ = false; + separation_ = Zero; + } + else + { + if (debug) + { + Pout<< " separation " << mag(separation[0]) + << " more than local tolerance " << smallDist[0] + << ". Assuming uniform separation." << endl; + } + + separated_ = true; + separation_ = separation[0]; + } + } + else + { + Pout<< "--> FOAM Warning : " + << " Variation in separation greater than" + << " local tolerance " << smallDist[0] << endl; + + separated_ = true; + separation_ = separation[0]; + } + } + } +} + + Foam::label Foam::cyclicPolyPatch::findMaxArea ( const pointField& points, @@ -252,7 +419,7 @@ void Foam::cyclicPolyPatch::calcTransforms } - // Calculate transformation tensors + // Calculate transformation if (transform() == ROTATIONAL) { @@ -297,9 +464,53 @@ void Foam::cyclicPolyPatch::calcTransforms forwardT_ = revT.T(); reverseT_ = revT; } + else if (transform() == TRANSLATIONAL) + { + if (debug) + { + Pout<< "cyclicPolyPatch::calcTransforms :" + << " patch:" << name() + << " Specified separation vector : " + << separation_ << endl; + } + + const scalarField half0Tols + ( + matchTolerance() + *calcFaceTol + ( + half0, + half0.points(), + static_cast(half0Ctrs) + ) + ); + + // Check that separation vectors are same. + const scalar avgTol = average(half0Tols); + if + ( + mag(separation_ + neighbPatch().separation_) > avgTol + ) + { + WarningInFunction + << "Specified separation vector " << separation_ + << " differs by that of neighbouring patch " + << neighbPatch().separation_ + << " by more than tolerance " << avgTol << endl + << "patch:" << name() + << " neighbour:" << neighbPatchName() + << endl; + } + + // Set transformation + parallel_ = true; + separated_ = true; + forwardT_ = Zero; + reverseT_ = Zero; + } else { - scalarField half0Tols + const scalarField half0Tols ( matchTolerance() *calcFaceTol @@ -318,63 +529,9 @@ void Foam::cyclicPolyPatch::calcTransforms half1Normals, half0Tols, matchTolerance(), + ordering(), transform() ); - - - if (transform() == TRANSLATIONAL) - { - if (debug) - { - Pout<< "cyclicPolyPatch::calcTransforms :" - << " patch:" << name() - << " Specified separation vector : " - << separationVector_ << endl; - } - - // Check that separation vectors are same. - const scalar avgTol = average(half0Tols); - if - ( - mag(separationVector_ + neighbPatch().separationVector_) - > avgTol - ) - { - WarningInFunction - << "Specified separation vector " << separationVector_ - << " differs by that of neighbouring patch " - << neighbPatch().separationVector_ - << " by more than tolerance " << avgTol << endl - << "patch:" << name() - << " neighbour:" << neighbPatchName() - << endl; - } - - - // Override computed transform with specified. - if (mag(separation() - separationVector_) > avgTol) - { - WarningInFunction - << "Specified separationVector " << separationVector_ - << " differs from computed separation vector " - << separation() << endl - << "This probably means your geometry is not consistent" - << " with the specified separation and might lead" - << " to problems." << endl - << "Continuing with specified separation vector " - << separationVector_ << endl - << "patch:" << name() - << " neighbour:" << neighbPatchName() - << endl; - } - - // Set tensors - parallel_ = true; - separated_ = true; - separation_ = separationVector_; - forwardT_ = Zero; - reverseT_ = Zero; - } } } } @@ -393,7 +550,7 @@ void Foam::cyclicPolyPatch::getCentresAndAnchors { // Get geometric data on both halves. half0Ctrs = pp0.faceCentres(); - anchors0 = getAnchorPoints(pp0, pp0.points(), transform()); + anchors0 = getAnchorPoints(pp0, pp0.points(), ordering()); half1Ctrs = pp1.faceCentres(); if (debug) @@ -474,15 +631,15 @@ void Foam::cyclicPolyPatch::getCentresAndAnchors { Pout<< "cyclicPolyPatch::getCentresAndAnchors :" << " patch:" << name() - << "Specified translation : " << separationVector_ + << "Specified translation : " << separation_ << endl; } // Note: getCentresAndAnchors gets called on the slave side - // so separationVector is owner-slave points. + // so separation is owner-slave points. - half0Ctrs -= separationVector_; - anchors0 -= separationVector_; + half0Ctrs -= separation_; + anchors0 -= separation_; break; } default: @@ -591,15 +748,14 @@ Foam::cyclicPolyPatch::cyclicPolyPatch const label index, const polyBoundaryMesh& bm, const word& patchType, - const transformType transform + const orderingType ordering ) : - coupledPolyPatch(name, size, start, index, bm, patchType, transform), + coupledPolyPatch(name, size, start, index, bm, patchType, ordering), neighbPatchName_(word::null), neighbPatchID_(-1), rotationAxis_(Zero), rotationCentre_(Zero), - separationVector_(Zero), coupledPointsPtr_(nullptr), coupledEdgesPtr_(nullptr) { @@ -615,19 +771,16 @@ Foam::cyclicPolyPatch::cyclicPolyPatch const label start, const label index, const polyBoundaryMesh& bm, + const word& patchType, const word& neighbPatchName, - const transformType transform, - const vector& rotationAxis, - const point& rotationCentre, - const vector& separationVector + const orderingType ordering ) : - coupledPolyPatch(name, size, start, index, bm, typeName, transform), + coupledPolyPatch(name, size, start, index, bm, patchType, ordering), neighbPatchName_(neighbPatchName), neighbPatchID_(-1), - rotationAxis_(rotationAxis), - rotationCentre_(rotationCentre), - separationVector_(separationVector), + rotationAxis_(Zero), + rotationCentre_(Zero), coupledPointsPtr_(nullptr), coupledEdgesPtr_(nullptr) { @@ -643,16 +796,15 @@ Foam::cyclicPolyPatch::cyclicPolyPatch const label index, const polyBoundaryMesh& bm, const word& patchType, - const transformType defaultTransform + const orderingType ordering ) : - coupledPolyPatch(name, dict, index, bm, patchType, defaultTransform), + coupledPolyPatch(name, dict, index, bm, patchType, ordering), neighbPatchName_(dict.lookupOrDefault("neighbourPatch", word::null)), coupleGroup_(dict), neighbPatchID_(-1), rotationAxis_(Zero), rotationCentre_(Zero), - separationVector_(Zero), coupledPointsPtr_(nullptr), coupledEdgesPtr_(nullptr) { @@ -696,7 +848,7 @@ Foam::cyclicPolyPatch::cyclicPolyPatch } case TRANSLATIONAL: { - dict.lookup("separationVector") >> separationVector_; + dict.lookup("separation") >> separation_; break; } default: @@ -722,7 +874,6 @@ Foam::cyclicPolyPatch::cyclicPolyPatch neighbPatchID_(-1), rotationAxis_(pp.rotationAxis_), rotationCentre_(pp.rotationCentre_), - separationVector_(pp.separationVector_), coupledPointsPtr_(nullptr), coupledEdgesPtr_(nullptr) { @@ -747,7 +898,6 @@ Foam::cyclicPolyPatch::cyclicPolyPatch neighbPatchID_(-1), rotationAxis_(pp.rotationAxis_), rotationCentre_(pp.rotationCentre_), - separationVector_(pp.separationVector_), coupledPointsPtr_(nullptr), coupledEdgesPtr_(nullptr) { @@ -779,7 +929,6 @@ Foam::cyclicPolyPatch::cyclicPolyPatch neighbPatchID_(-1), rotationAxis_(pp.rotationAxis_), rotationCentre_(pp.rotationCentre_), - separationVector_(pp.separationVector_), coupledPointsPtr_(nullptr), coupledEdgesPtr_(nullptr) {} @@ -1240,7 +1389,7 @@ bool Foam::cyclicPolyPatch::order rotation.setSize(pp.size()); rotation = 0; - if (transform() == NOORDERING) + if (ordering() == NOORDERING) { // No faces, nothing to change. return false; @@ -1428,11 +1577,7 @@ void Foam::cyclicPolyPatch::write(Ostream& os) const } case TRANSLATIONAL: { - writeEntry(os, "separationVector", separationVector_); - break; - } - case NOORDERING: - { + writeEntry(os, "separation", separation_); break; } default: diff --git a/src/OpenFOAM/meshes/polyMesh/polyPatches/constraint/cyclic/cyclicPolyPatch.H b/src/OpenFOAM/meshes/polyMesh/polyPatches/constraint/cyclic/cyclicPolyPatch.H index 94e7c67a07..ee5d176a86 100644 --- a/src/OpenFOAM/meshes/polyMesh/polyPatches/constraint/cyclic/cyclicPolyPatch.H +++ b/src/OpenFOAM/meshes/polyMesh/polyPatches/constraint/cyclic/cyclicPolyPatch.H @@ -84,11 +84,6 @@ class cyclicPolyPatch //- Point on axis of rotation for rotational cyclics point rotationCentre_; - // For translation - - //- Translation vector - vector separationVector_; - //- List of edges formed from connected points. e[0] is the point on // the first half of the patch, e[1] the corresponding point on the @@ -105,6 +100,23 @@ class cyclicPolyPatch // Private Member Functions + //- Calculate the transformation tensors + // smallDist : matching distance per face + // absTol : absolute error in normal + // if orderingType = unknown it first tries rotational, then + // translational transform + void calcTransformTensors + ( + const vectorField& Cf, + const vectorField& Cr, + const vectorField& nf, + const vectorField& nr, + const scalarField& smallDist, + const scalar absTol, + const orderingType = UNKNOWN, + const transformType = UNSPECIFIED + ) const; + //- Find amongst selected faces the one with the largest area static label findMaxArea(const pointField&, const faceList&); @@ -204,7 +216,7 @@ public: const label index, const polyBoundaryMesh& bm, const word& patchType, - const transformType transform = UNKNOWN + const orderingType defaultOrdering = UNKNOWN ); //- Construct from components @@ -215,11 +227,9 @@ public: const label start, const label index, const polyBoundaryMesh& bm, + const word& patchType, const word& neighbPatchName, - const transformType transform, // transformation type - const vector& rotationAxis, // for rotation only - const point& rotationCentre, // for rotation only - const vector& separationVector // for translation only + const orderingType ordering ); //- Construct from dictionary @@ -230,7 +240,7 @@ public: const label index, const polyBoundaryMesh& bm, const word& patchType, - const transformType defaultTransform = UNKNOWN + const orderingType ordering = UNKNOWN ); //- Construct as copy, resetting the boundary mesh @@ -382,12 +392,6 @@ public: return rotationCentre_; } - //- Translation vector for translational cyclics - const vector& separationVector() const - { - return separationVector_; - } - //- Initialize ordering for primitivePatch. Does not // refer to *this (except for name() and type() etc.) diff --git a/src/OpenFOAM/meshes/polyMesh/polyPatches/constraint/cyclicSlip/cyclicSlipPolyPatch.H b/src/OpenFOAM/meshes/polyMesh/polyPatches/constraint/cyclicSlip/cyclicSlipPolyPatch.H index 67ced9ecf5..f4c596ede6 100644 --- a/src/OpenFOAM/meshes/polyMesh/polyPatches/constraint/cyclicSlip/cyclicSlipPolyPatch.H +++ b/src/OpenFOAM/meshes/polyMesh/polyPatches/constraint/cyclicSlip/cyclicSlipPolyPatch.H @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | Website: https://openfoam.org - \\ / A nd | Copyright (C) 2011-2018 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2019 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -69,10 +69,10 @@ public: const label index, const polyBoundaryMesh& bm, const word& patchType, - const transformType transform = UNKNOWN + const orderingType ordering = UNKNOWN ) : - cyclicPolyPatch(name, size, start, index, bm, patchType, transform) + cyclicPolyPatch(name, size, start, index, bm, patchType, ordering) {} //- Construct from dictionary diff --git a/src/OpenFOAM/meshes/polyMesh/polyPatches/constraint/oldCyclic/oldCyclicPolyPatch.C b/src/OpenFOAM/meshes/polyMesh/polyPatches/constraint/oldCyclic/oldCyclicPolyPatch.C index 04519933ff..eabf36d8fc 100644 --- a/src/OpenFOAM/meshes/polyMesh/polyPatches/constraint/oldCyclic/oldCyclicPolyPatch.C +++ b/src/OpenFOAM/meshes/polyMesh/polyPatches/constraint/oldCyclic/oldCyclicPolyPatch.C @@ -334,23 +334,6 @@ void Foam::oldCyclicPolyPatch::getCentresAndAnchors break; } - //- Problem: usually specified translation is not accurate enough - //- To get proper match so keep automatic determination over here. - // case TRANSLATIONAL: - //{ - // // Transform 0 points. - // - // if (debug) - // { - // Pout<< "oldCyclicPolyPatch::getCentresAndAnchors :" - // << "Specified translation : " << separationVector_ - // << endl; - // } - // - // half0Ctrs += separationVector_; - // anchors0 += separationVector_; - // break; - //} default: { // Assumes that cyclic is planar. This is also the initial @@ -564,14 +547,13 @@ Foam::oldCyclicPolyPatch::oldCyclicPolyPatch const label index, const polyBoundaryMesh& bm, const word& patchType, - const transformType transform + const orderingType ordering ) : - coupledPolyPatch(name, size, start, index, bm, patchType, transform), + coupledPolyPatch(name, size, start, index, bm, patchType, ordering), featureCos_(0.9), rotationAxis_(Zero), - rotationCentre_(Zero), - separationVector_(Zero) + rotationCentre_(Zero) {} @@ -587,8 +569,7 @@ Foam::oldCyclicPolyPatch::oldCyclicPolyPatch coupledPolyPatch(name, dict, index, bm, patchType), featureCos_(0.9), rotationAxis_(Zero), - rotationCentre_(Zero), - separationVector_(Zero) + rotationCentre_(Zero) { if (dict.found("neighbourPatch")) { @@ -615,7 +596,7 @@ Foam::oldCyclicPolyPatch::oldCyclicPolyPatch } case TRANSLATIONAL: { - dict.lookup("separationVector") >> separationVector_; + dict.lookup("separation") >> separation_; break; } default: @@ -635,8 +616,7 @@ Foam::oldCyclicPolyPatch::oldCyclicPolyPatch coupledPolyPatch(pp, bm), featureCos_(pp.featureCos_), rotationAxis_(pp.rotationAxis_), - rotationCentre_(pp.rotationCentre_), - separationVector_(pp.separationVector_) + rotationCentre_(pp.rotationCentre_) {} @@ -652,8 +632,7 @@ Foam::oldCyclicPolyPatch::oldCyclicPolyPatch coupledPolyPatch(pp, bm, index, newSize, newStart), featureCos_(pp.featureCos_), rotationAxis_(pp.rotationAxis_), - rotationCentre_(pp.rotationCentre_), - separationVector_(pp.separationVector_) + rotationCentre_(pp.rotationCentre_) {} @@ -1236,7 +1215,7 @@ void Foam::oldCyclicPolyPatch::write(Ostream& os) const } case TRANSLATIONAL: { - writeEntry(os, "separationVector", separationVector_); + writeEntry(os, "separation", separation_); break; } default: diff --git a/src/OpenFOAM/meshes/polyMesh/polyPatches/constraint/oldCyclic/oldCyclicPolyPatch.H b/src/OpenFOAM/meshes/polyMesh/polyPatches/constraint/oldCyclic/oldCyclicPolyPatch.H index 95e46e8524..b5ece50f37 100644 --- a/src/OpenFOAM/meshes/polyMesh/polyPatches/constraint/oldCyclic/oldCyclicPolyPatch.H +++ b/src/OpenFOAM/meshes/polyMesh/polyPatches/constraint/oldCyclic/oldCyclicPolyPatch.H @@ -69,11 +69,6 @@ class oldCyclicPolyPatch //- Point on axis of rotation for rotational cyclics point rotationCentre_; - // For translation - - //- Translation vector - vector separationVector_; - // Private Member Functions @@ -185,7 +180,7 @@ public: const label index, const polyBoundaryMesh& bm, const word& patchType, - const transformType transform = UNKNOWN + const orderingType ordering = UNKNOWN ); //- Construct from dictionary diff --git a/src/OpenFOAM/meshes/polyMesh/polyPatches/constraint/processor/processorPolyPatch.C b/src/OpenFOAM/meshes/polyMesh/polyPatches/constraint/processor/processorPolyPatch.C index 1c9d12b5ba..73322eded8 100644 --- a/src/OpenFOAM/meshes/polyMesh/polyPatches/constraint/processor/processorPolyPatch.C +++ b/src/OpenFOAM/meshes/polyMesh/polyPatches/constraint/processor/processorPolyPatch.C @@ -56,11 +56,11 @@ Foam::processorPolyPatch::processorPolyPatch const polyBoundaryMesh& bm, const int myProcNo, const int neighbProcNo, - const transformType transform, + const orderingType ordering, const word& patchType ) : - coupledPolyPatch(name, size, start, index, bm, patchType, transform), + coupledPolyPatch(name, size, start, index, bm, patchType, ordering), myProcNo_(myProcNo), neighbProcNo_(neighbProcNo), neighbFaceCentres_(), @@ -77,7 +77,7 @@ Foam::processorPolyPatch::processorPolyPatch const polyBoundaryMesh& bm, const int myProcNo, const int neighbProcNo, - const transformType transform, + const orderingType ordering, const word& patchType ) : @@ -89,7 +89,7 @@ Foam::processorPolyPatch::processorPolyPatch index, bm, patchType, - transform + ordering ), myProcNo_(myProcNo), neighbProcNo_(neighbProcNo), @@ -525,7 +525,7 @@ void Foam::processorPolyPatch::initOrder if ( !Pstream::parRun() - || transform() == NOORDERING + || ordering() == NOORDERING ) { return; @@ -562,7 +562,7 @@ void Foam::processorPolyPatch::initOrder if (owner()) { - if (transform() == COINCIDENTFULLMATCH) + if (ordering() == COINCIDENTFULLMATCH) { // Pass the patch points and faces across UOPstream toNeighbour(neighbProcNo(), pBufs); @@ -573,7 +573,7 @@ void Foam::processorPolyPatch::initOrder { const pointField& ppPoints = pp.points(); - pointField anchors(getAnchorPoints(pp, ppPoints, transform())); + pointField anchors(getAnchorPoints(pp, ppPoints, ordering())); // Get the average of the points of each face. This is needed in // case the face centroid calculation is incorrect due to the face @@ -719,7 +719,7 @@ bool Foam::processorPolyPatch::order if ( !Pstream::parRun() - || transform() == NOORDERING + || ordering() == NOORDERING ) { return false; @@ -742,11 +742,11 @@ bool Foam::processorPolyPatch::order faceMap[patchFacei] = patchFacei; } - if (transform() != COINCIDENTFULLMATCH) + if (ordering() != COINCIDENTFULLMATCH) { const pointField& ppPoints = pp.points(); - pointField anchors(getAnchorPoints(pp, ppPoints, transform())); + pointField anchors(getAnchorPoints(pp, ppPoints, ordering())); // Calculate typical distance from face centre scalarField tols @@ -783,7 +783,7 @@ bool Foam::processorPolyPatch::order matchTolerance()*calcFaceTol(pp, pp.points(), pp.faceCentres()) ); - if (transform() == COINCIDENTFULLMATCH) + if (ordering() == COINCIDENTFULLMATCH) { vectorField masterPts; faceList masterFaces; diff --git a/src/OpenFOAM/meshes/polyMesh/polyPatches/constraint/processor/processorPolyPatch.H b/src/OpenFOAM/meshes/polyMesh/polyPatches/constraint/processor/processorPolyPatch.H index b6dc85d584..0e7f1daff3 100644 --- a/src/OpenFOAM/meshes/polyMesh/polyPatches/constraint/processor/processorPolyPatch.H +++ b/src/OpenFOAM/meshes/polyMesh/polyPatches/constraint/processor/processorPolyPatch.H @@ -93,7 +93,7 @@ protected: const polyBoundaryMesh& bm, const int myProcNo, const int neighbProcNo, - const transformType transform = UNKNOWN, // transformation type + const orderingType defaultOrdering = UNKNOWN, const word& patchType = typeName ); @@ -152,7 +152,7 @@ public: const polyBoundaryMesh& bm, const int myProcNo, const int neighbProcNo, - const transformType transform = UNKNOWN, // transformation type + const orderingType ordering = UNKNOWN, const word& patchType = typeName ); diff --git a/src/OpenFOAM/meshes/polyMesh/polyPatches/constraint/processorCyclic/processorCyclicPolyPatch.C b/src/OpenFOAM/meshes/polyMesh/polyPatches/constraint/processorCyclic/processorCyclicPolyPatch.C index 505f798daf..3169032074 100644 --- a/src/OpenFOAM/meshes/polyMesh/polyPatches/constraint/processorCyclic/processorCyclicPolyPatch.C +++ b/src/OpenFOAM/meshes/polyMesh/polyPatches/constraint/processorCyclic/processorCyclicPolyPatch.C @@ -48,7 +48,7 @@ Foam::processorCyclicPolyPatch::processorCyclicPolyPatch const int myProcNo, const int neighbProcNo, const word& referPatchName, - const transformType transform, + const orderingType ordering, const word& patchType ) : @@ -61,7 +61,7 @@ Foam::processorCyclicPolyPatch::processorCyclicPolyPatch bm, myProcNo, neighbProcNo, - transform, + ordering, patchType ), referPatchName_(referPatchName), @@ -237,7 +237,9 @@ void Foam::processorCyclicPolyPatch::calcGeometry(PstreamBuffers& pBufs) if (Pstream::parRun()) { - calcTransformTensors + cyclicPolyPatch& pp = const_cast(referPatch()); + + pp.calcTransformTensors ( faceCentres(), neighbFaceCentres(), @@ -245,6 +247,7 @@ void Foam::processorCyclicPolyPatch::calcGeometry(PstreamBuffers& pBufs) neighbFaceAreas()/mag(neighbFaceAreas()), matchTolerance()*calcFaceTol(*this, points(), faceCentres()), matchTolerance(), + ordering(), transform() ); @@ -256,7 +259,7 @@ void Foam::processorCyclicPolyPatch::calcGeometry(PstreamBuffers& pBufs) // Update underlying cyclic halves. Need to do both since only one // half might be present as a processorCyclic. - coupledPolyPatch& pp = const_cast(referPatch()); + pp.calcGeometry ( *this, @@ -268,20 +271,16 @@ void Foam::processorCyclicPolyPatch::calcGeometry(PstreamBuffers& pBufs) neighbFaceCellCentres() ); - if (isA(pp)) - { - const cyclicPolyPatch& cpp = refCast(pp); - const_cast(cpp.neighbPatch()).calcGeometry - ( - *this, - neighbFaceCentres(), - neighbFaceAreas(), - neighbFaceCellCentres(), - faceCentres(), - faceAreas(), - faceCellCentres() - ); - } + const_cast(pp.neighbPatch()).calcGeometry + ( + *this, + neighbFaceCentres(), + neighbFaceAreas(), + neighbFaceCellCentres(), + faceCentres(), + faceAreas(), + faceCellCentres() + ); } } diff --git a/src/OpenFOAM/meshes/polyMesh/polyPatches/constraint/processorCyclic/processorCyclicPolyPatch.H b/src/OpenFOAM/meshes/polyMesh/polyPatches/constraint/processorCyclic/processorCyclicPolyPatch.H index 9e40ddc794..6bf52fc3a8 100644 --- a/src/OpenFOAM/meshes/polyMesh/polyPatches/constraint/processorCyclic/processorCyclicPolyPatch.H +++ b/src/OpenFOAM/meshes/polyMesh/polyPatches/constraint/processorCyclic/processorCyclicPolyPatch.H @@ -38,6 +38,7 @@ SourceFiles #define processorCyclicPolyPatch_H #include "processorPolyPatch.H" +#include "cyclicPolyPatch.H" // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // @@ -121,7 +122,7 @@ public: const int myProcNo, const int neighbProcNo, const word& referPatchName, - const transformType transform = UNKNOWN, + const orderingType ordering = UNKNOWN, const word& patchType = typeName ); @@ -304,10 +305,10 @@ public: return referPatchID_; } - const coupledPolyPatch& referPatch() const + const cyclicPolyPatch& referPatch() const { const polyPatch& pp = this->boundaryMesh()[referPatchID()]; - return refCast(pp); + return refCast(pp); } //- Return message tag to use for communication @@ -325,14 +326,6 @@ public: return referPatch().transform(); } - //- Type of transform - // This is currently only for use when collapsing generated - // meshes that can have zero area faces. - virtual transformType& transform() - { - return const_cast(referPatch()).transform(); - } - //- Transform a patch-based position from other side to this side virtual void transformPosition(pointField& l) const { diff --git a/src/OpenFOAM/primitives/globalIndexAndTransform/globalIndexAndTransform.C b/src/OpenFOAM/primitives/globalIndexAndTransform/globalIndexAndTransform.C index fab2e74eb7..9854ceeb53 100644 --- a/src/OpenFOAM/primitives/globalIndexAndTransform/globalIndexAndTransform.C +++ b/src/OpenFOAM/primitives/globalIndexAndTransform/globalIndexAndTransform.C @@ -137,23 +137,7 @@ void Foam::globalIndexAndTransform::determineTransforms() { const polyPatch& pp = patches[patchi]; - // Note: special check for unordered cyclics. These are in fact - // transform bcs and should probably be split off. - // Note: We don't want to be finding transforms for patches marked as - // coincident full match. These should have no transform by definition. - if - ( - isA(pp) - && !( - isA(pp) - && refCast(pp).transform() - == cyclicPolyPatch::NOORDERING - ) - && !( - refCast(pp).transform() - == coupledPolyPatch::COINCIDENTFULLMATCH - ) - ) + if (isA(pp)) { const coupledPolyPatch& cpp = refCast(pp); @@ -311,23 +295,7 @@ void Foam::globalIndexAndTransform::determinePatchTransformSign() { const polyPatch& pp = patches[patchi]; - // Note: special check for unordered cyclics. These are in fact - // transform bcs and should probably be split off. - // Note: We don't want to be finding transforms for patches marked as - // coincident full match. These should have no transform by definition. - if - ( - isA(pp) - && !( - isA(pp) - && refCast(pp).transform() - == cyclicPolyPatch::NOORDERING - ) - && !( - refCast(pp).transform() - == coupledPolyPatch::COINCIDENTFULLMATCH - ) - ) + if (isA(pp)) { const coupledPolyPatch& cpp = refCast(pp); diff --git a/src/dynamicMesh/fvMeshDistribute/fvMeshDistribute.C b/src/dynamicMesh/fvMeshDistribute/fvMeshDistribute.C index 714dcc7708..57fd4236cf 100644 --- a/src/dynamicMesh/fvMeshDistribute/fvMeshDistribute.C +++ b/src/dynamicMesh/fvMeshDistribute/fvMeshDistribute.C @@ -1245,7 +1245,7 @@ void Foam::fvMeshDistribute::addProcPatches Pstream::myProcNo(), proci, pcPatch.name(), - pcPatch.transform() + pcPatch.ordering() ); procPatchID[proci].insert diff --git a/src/meshTools/AMIInterpolation/patches/cyclicACMI/cyclicACMIPolyPatch/cyclicACMIPolyPatch.C b/src/meshTools/AMIInterpolation/patches/cyclicACMI/cyclicACMIPolyPatch/cyclicACMIPolyPatch.C index e59901cde3..959074bfd8 100644 --- a/src/meshTools/AMIInterpolation/patches/cyclicACMI/cyclicACMIPolyPatch/cyclicACMIPolyPatch.C +++ b/src/meshTools/AMIInterpolation/patches/cyclicACMI/cyclicACMIPolyPatch/cyclicACMIPolyPatch.C @@ -205,7 +205,7 @@ Foam::cyclicACMIPolyPatch::cyclicACMIPolyPatch const label index, const polyBoundaryMesh& bm, const word& patchType, - const transformType transform + const orderingType ordering ) : cyclicAMIPolyPatch @@ -216,7 +216,7 @@ Foam::cyclicACMIPolyPatch::cyclicACMIPolyPatch index, bm, patchType, - transform, + ordering, false, AMIInterpolation::imPartialFaceAreaWeight ), diff --git a/src/meshTools/AMIInterpolation/patches/cyclicACMI/cyclicACMIPolyPatch/cyclicACMIPolyPatch.H b/src/meshTools/AMIInterpolation/patches/cyclicACMI/cyclicACMIPolyPatch/cyclicACMIPolyPatch.H index 54126dd25d..de2629f5e0 100644 --- a/src/meshTools/AMIInterpolation/patches/cyclicACMI/cyclicACMIPolyPatch/cyclicACMIPolyPatch.H +++ b/src/meshTools/AMIInterpolation/patches/cyclicACMI/cyclicACMIPolyPatch/cyclicACMIPolyPatch.H @@ -110,7 +110,7 @@ public: const label index, const polyBoundaryMesh& bm, const word& patchType, - const transformType transform = UNKNOWN + const orderingType ordering = UNKNOWN ); //- Construct from dictionary diff --git a/src/meshTools/AMIInterpolation/patches/cyclicAMI/cyclicAMIPolyPatch/cyclicAMIPolyPatch.C b/src/meshTools/AMIInterpolation/patches/cyclicAMI/cyclicAMIPolyPatch/cyclicAMIPolyPatch.C index cb28157893..f064bd6c72 100644 --- a/src/meshTools/AMIInterpolation/patches/cyclicAMI/cyclicAMIPolyPatch/cyclicAMIPolyPatch.C +++ b/src/meshTools/AMIInterpolation/patches/cyclicAMI/cyclicAMIPolyPatch/cyclicAMIPolyPatch.C @@ -240,13 +240,12 @@ void Foam::cyclicAMIPolyPatch::calcTransforms if (debug) { Pout<< "cyclicAMIPolyPatch::calcTransforms : patch:" << name() - << " Specified translation : " << separationVector_ + << " Specified translation : " << separation_ << endl; } parallel_ = true; separated_ = true; - separation_ = separationVector_; forwardT_ = Zero; reverseT_ = Zero; @@ -480,19 +479,18 @@ Foam::cyclicAMIPolyPatch::cyclicAMIPolyPatch const label index, const polyBoundaryMesh& bm, const word& patchType, - const transformType transform, + const orderingType ordering, const bool AMIRequireMatch, const AMIInterpolation::interpolationMethod AMIMethod ) : - coupledPolyPatch(name, size, start, index, bm, patchType, transform), + coupledPolyPatch(name, size, start, index, bm, patchType, ordering), nbrPatchName_(word::null), nbrPatchID_(-1), rotationAxis_(Zero), rotationCentre_(point::zero), rotationAngleDefined_(false), rotationAngle_(0.0), - separationVector_(Zero), AMIs_(), AMITransforms_(), AMIReverse_(false), @@ -526,7 +524,6 @@ Foam::cyclicAMIPolyPatch::cyclicAMIPolyPatch rotationCentre_(point::zero), rotationAngleDefined_(false), rotationAngle_(0.0), - separationVector_(Zero), AMIs_(), AMITransforms_(), AMIReverse_(dict.lookupOrDefault("flipNormals", false)), @@ -597,7 +594,7 @@ Foam::cyclicAMIPolyPatch::cyclicAMIPolyPatch } case TRANSLATIONAL: { - dict.lookup("separationVector") >> separationVector_; + dict.lookup("separation") >> separation_; break; } default: @@ -625,7 +622,6 @@ Foam::cyclicAMIPolyPatch::cyclicAMIPolyPatch rotationCentre_(pp.rotationCentre_), rotationAngleDefined_(pp.rotationAngleDefined_), rotationAngle_(pp.rotationAngle_), - separationVector_(pp.separationVector_), AMIs_(), AMITransforms_(), AMIReverse_(pp.AMIReverse_), @@ -658,7 +654,6 @@ Foam::cyclicAMIPolyPatch::cyclicAMIPolyPatch rotationCentre_(pp.rotationCentre_), rotationAngleDefined_(pp.rotationAngleDefined_), rotationAngle_(pp.rotationAngle_), - separationVector_(pp.separationVector_), AMIs_(), AMITransforms_(), AMIReverse_(pp.AMIReverse_), @@ -698,7 +693,6 @@ Foam::cyclicAMIPolyPatch::cyclicAMIPolyPatch rotationCentre_(pp.rotationCentre_), rotationAngleDefined_(pp.rotationAngleDefined_), rotationAngle_(pp.rotationAngle_), - separationVector_(pp.separationVector_), AMIs_(), AMITransforms_(), AMIReverse_(pp.AMIReverse_), @@ -1166,11 +1160,7 @@ void Foam::cyclicAMIPolyPatch::write(Ostream& os) const } case TRANSLATIONAL: { - writeEntry(os, "separationVector", separationVector_); - break; - } - case NOORDERING: - { + writeEntry(os, "separation", separation_); break; } default: diff --git a/src/meshTools/AMIInterpolation/patches/cyclicAMI/cyclicAMIPolyPatch/cyclicAMIPolyPatch.H b/src/meshTools/AMIInterpolation/patches/cyclicAMI/cyclicAMIPolyPatch/cyclicAMIPolyPatch.H index 904a98480e..8f7e9c04c7 100644 --- a/src/meshTools/AMIInterpolation/patches/cyclicAMI/cyclicAMIPolyPatch/cyclicAMIPolyPatch.H +++ b/src/meshTools/AMIInterpolation/patches/cyclicAMI/cyclicAMIPolyPatch/cyclicAMIPolyPatch.H @@ -99,12 +99,6 @@ protected: scalar rotationAngle_; - // For translation - - //- Translation vector - vector separationVector_; - - //- AMI interpolation classes mutable PtrList AMIs_; @@ -177,7 +171,7 @@ public: const label index, const polyBoundaryMesh& bm, const word& patchType, - const transformType transform = UNKNOWN, + const orderingType ordering = UNKNOWN, const bool AMIRequireMatch = true, const AMIInterpolation::interpolationMethod AMIMethod = AMIInterpolation::imFaceAreaWeight @@ -331,9 +325,6 @@ public: //- Point on axis of rotation for rotational cyclic AMI inline const point& rotationCentre() const; - //- Translation vector for translational cyclic AMI - inline const vector& separationVector() const; - //- Transform patch-based positions from nbr side to this side virtual void transformPosition(pointField&) const; diff --git a/src/meshTools/AMIInterpolation/patches/cyclicAMI/cyclicAMIPolyPatch/cyclicAMIPolyPatchI.H b/src/meshTools/AMIInterpolation/patches/cyclicAMI/cyclicAMIPolyPatch/cyclicAMIPolyPatchI.H index 90a0ed3fe3..2403fc2228 100644 --- a/src/meshTools/AMIInterpolation/patches/cyclicAMI/cyclicAMIPolyPatch/cyclicAMIPolyPatchI.H +++ b/src/meshTools/AMIInterpolation/patches/cyclicAMI/cyclicAMIPolyPatch/cyclicAMIPolyPatchI.H @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | Website: https://openfoam.org - \\ / A nd | Copyright (C) 2011-2018 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2019 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -50,10 +50,4 @@ inline const Foam::point& Foam::cyclicAMIPolyPatch::rotationCentre() const } -inline const Foam::vector& Foam::cyclicAMIPolyPatch::separationVector() const -{ - return separationVector_; -} - - // ************************************************************************* // diff --git a/src/meshTools/AMIInterpolation/patches/cyclicRepeatAMI/cyclicRepeatAMIPolyPatch/cyclicRepeatAMIPolyPatch.C b/src/meshTools/AMIInterpolation/patches/cyclicRepeatAMI/cyclicRepeatAMIPolyPatch/cyclicRepeatAMIPolyPatch.C index 8a7cb32bd1..b204046100 100644 --- a/src/meshTools/AMIInterpolation/patches/cyclicRepeatAMI/cyclicRepeatAMIPolyPatch/cyclicRepeatAMIPolyPatch.C +++ b/src/meshTools/AMIInterpolation/patches/cyclicRepeatAMI/cyclicRepeatAMIPolyPatch/cyclicRepeatAMIPolyPatch.C @@ -305,7 +305,7 @@ Foam::cyclicRepeatAMIPolyPatch::cyclicRepeatAMIPolyPatch const label index, const polyBoundaryMesh& bm, const word& patchType, - const transformType transform + const orderingType ordering ) : cyclicAMIPolyPatch @@ -316,7 +316,7 @@ Foam::cyclicRepeatAMIPolyPatch::cyclicRepeatAMIPolyPatch index, bm, patchType, - transform, + ordering, false, AMIInterpolation::imFaceAreaWeight ), diff --git a/src/meshTools/AMIInterpolation/patches/cyclicRepeatAMI/cyclicRepeatAMIPolyPatch/cyclicRepeatAMIPolyPatch.H b/src/meshTools/AMIInterpolation/patches/cyclicRepeatAMI/cyclicRepeatAMIPolyPatch/cyclicRepeatAMIPolyPatch.H index 5b66448170..88e89c37b8 100644 --- a/src/meshTools/AMIInterpolation/patches/cyclicRepeatAMI/cyclicRepeatAMIPolyPatch/cyclicRepeatAMIPolyPatch.H +++ b/src/meshTools/AMIInterpolation/patches/cyclicRepeatAMI/cyclicRepeatAMIPolyPatch/cyclicRepeatAMIPolyPatch.H @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | Website: https://openfoam.org - \\ / A nd | Copyright (C) 2018 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2018-2019 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -86,7 +86,7 @@ public: const label index, const polyBoundaryMesh& bm, const word& patchType, - const transformType transform = UNKNOWN + const orderingType ordering = UNKNOWN ); //- Construct from dictionary diff --git a/tutorials/compressible/rhoPimpleFoam/RAS/annularThermalMixer/system/createBafflesDict b/tutorials/compressible/rhoPimpleFoam/RAS/annularThermalMixer/system/createBafflesDict index 9372c2c628..99310c48c4 100644 --- a/tutorials/compressible/rhoPimpleFoam/RAS/annularThermalMixer/system/createBafflesDict +++ b/tutorials/compressible/rhoPimpleFoam/RAS/annularThermalMixer/system/createBafflesDict @@ -31,7 +31,7 @@ baffles type cyclicAMI; matchTolerance 0.0001; neighbourPatch AMI2; - transform noOrdering; + ordering noOrdering; } slave { diff --git a/tutorials/incompressible/pimpleFoam/RAS/oscillatingInletACMI2D/README b/tutorials/incompressible/pimpleFoam/RAS/oscillatingInletACMI2D/README index 1c00d9fc49..cf93ebe1d4 100644 --- a/tutorials/incompressible/pimpleFoam/RAS/oscillatingInletACMI2D/README +++ b/tutorials/incompressible/pimpleFoam/RAS/oscillatingInletACMI2D/README @@ -16,7 +16,7 @@ from the constant/polyMesh/boundary file: nFaces 40; startFace 43720; matchTolerance 0.0001; - transform noOrdering; + ordering noOrdering; neighbourPatch ACMI2_couple; nonOverlapPatch ACMI1_blockage; } @@ -36,7 +36,7 @@ from the constant/polyMesh/boundary file: nFaces 96; startFace 43856; matchTolerance 0.0001; - transform noOrdering; + ordering noOrdering; neighbourPatch ACMI1_couple; nonOverlapPatch ACMI2_blockage; } @@ -77,7 +77,7 @@ patches) the slave patches are simply defined using 'dummy' entries, e.g.: matchTolerance 0.0001; neighbourPatch ACMI2_couple; nonOverlapPatch ACMI1_blockage; - transform noOrdering; + ordering noOrdering; } slave // dummy entries only { diff --git a/tutorials/incompressible/pimpleFoam/RAS/oscillatingInletACMI2D/system/createBafflesDict b/tutorials/incompressible/pimpleFoam/RAS/oscillatingInletACMI2D/system/createBafflesDict index bb647a14a7..b7176cea72 100644 --- a/tutorials/incompressible/pimpleFoam/RAS/oscillatingInletACMI2D/system/createBafflesDict +++ b/tutorials/incompressible/pimpleFoam/RAS/oscillatingInletACMI2D/system/createBafflesDict @@ -42,7 +42,7 @@ baffles matchTolerance 0.0001; neighbourPatch ACMI2_couple; nonOverlapPatch ACMI1_blockage; - transform noOrdering; + ordering noOrdering; } slave // not used since we're manipulating a boundary patch { @@ -82,7 +82,7 @@ baffles matchTolerance 0.0001; neighbourPatch ACMI1_couple; nonOverlapPatch ACMI2_blockage; - transform noOrdering; + ordering noOrdering; } slave // not used since we're manipulating a boundary patch { diff --git a/tutorials/incompressible/pimpleFoam/laminar/mixerVesselAMI2D/system/blockMeshDict.m4 b/tutorials/incompressible/pimpleFoam/laminar/mixerVesselAMI2D/system/blockMeshDict.m4 index 5a32319ab4..7e2ea0cb6a 100644 --- a/tutorials/incompressible/pimpleFoam/laminar/mixerVesselAMI2D/system/blockMeshDict.m4 +++ b/tutorials/incompressible/pimpleFoam/laminar/mixerVesselAMI2D/system/blockMeshDict.m4 @@ -790,7 +790,7 @@ boundary { type cyclicAMI; neighbourPatch AMI2; - transform noOrdering; + ordering noOrdering; /* optional surface { @@ -817,7 +817,7 @@ boundary { type cyclicAMI; neighbourPatch AMI1; - transform noOrdering; + ordering noOrdering; /* optional surface { diff --git a/tutorials/lagrangian/icoUncoupledKinematicParcelFoam/mixerVesselAMI2D/system/blockMeshDict.m4 b/tutorials/lagrangian/icoUncoupledKinematicParcelFoam/mixerVesselAMI2D/system/blockMeshDict.m4 index fba2977378..2e721f5646 100644 --- a/tutorials/lagrangian/icoUncoupledKinematicParcelFoam/mixerVesselAMI2D/system/blockMeshDict.m4 +++ b/tutorials/lagrangian/icoUncoupledKinematicParcelFoam/mixerVesselAMI2D/system/blockMeshDict.m4 @@ -806,7 +806,7 @@ boundary { type cyclicAMI; neighbourPatch AMI2; - transform noOrdering; + ordering noOrdering; /* optional surface { @@ -833,7 +833,7 @@ boundary { type cyclicAMI; neighbourPatch AMI1; - transform noOrdering; + ordering noOrdering; /* optional surface { diff --git a/tutorials/mesh/foamyHexMesh/mixerVessel/system/createBafflesDict b/tutorials/mesh/foamyHexMesh/mixerVessel/system/createBafflesDict index b8e0d61e6f..ffbe956bf5 100644 --- a/tutorials/mesh/foamyHexMesh/mixerVessel/system/createBafflesDict +++ b/tutorials/mesh/foamyHexMesh/mixerVessel/system/createBafflesDict @@ -80,7 +80,7 @@ baffles type cyclicAMI; matchTolerance 0.0001; neighbourPatch AMI2; - transform noOrdering; + ordering noOrdering; // Switch to zero-gradient for low weights lowWeightCorrection 0.2; } @@ -92,7 +92,7 @@ baffles type cyclicAMI; matchTolerance 0.0001; neighbourPatch AMI1; - transform noOrdering; + ordering noOrdering; lowWeightCorrection 0.2; } } diff --git a/tutorials/multiphase/interFoam/RAS/mixerVesselAMI/system/createBafflesDict b/tutorials/multiphase/interFoam/RAS/mixerVesselAMI/system/createBafflesDict index 873fe77190..ceefc5fd6c 100644 --- a/tutorials/multiphase/interFoam/RAS/mixerVesselAMI/system/createBafflesDict +++ b/tutorials/multiphase/interFoam/RAS/mixerVesselAMI/system/createBafflesDict @@ -38,7 +38,7 @@ baffles type cyclicAMI; matchTolerance 0.0001; neighbourPatch AMI2; - transform noOrdering; + ordering noOrdering; } slave @@ -48,7 +48,7 @@ baffles type cyclicAMI; matchTolerance 0.0001; neighbourPatch AMI1; - transform noOrdering; + ordering noOrdering; } } }