diff --git a/ReleaseNotes-dev b/ReleaseNotes-dev index 815b97d862..fa6c09664b 100644 --- a/ReleaseNotes-dev +++ b/ReleaseNotes-dev @@ -184,6 +184,8 @@ + =setSet=: allows time range (e.g. 0:100) in combination with -batch argument to execute the commands for multiple times. * Post-processing + + =paraFoam=, =foamToVTK=: full support for polyhedral cell type in recent + Paraview versions. + =foamToEnsight=: parallel continuous data. new =-nodeValues= option to generate and output nodal field data. + =singleCellMesh=: new utility to convert mesh and fields to a single cell diff --git a/applications/solvers/multiphase/twoPhaseEulerFoam/kineticTheoryModels/kineticTheoryModel/kineticTheoryModel.C b/applications/solvers/multiphase/twoPhaseEulerFoam/kineticTheoryModels/kineticTheoryModel/kineticTheoryModel.C index ee2300d91e..436d373b04 100644 --- a/applications/solvers/multiphase/twoPhaseEulerFoam/kineticTheoryModels/kineticTheoryModel/kineticTheoryModel.C +++ b/applications/solvers/multiphase/twoPhaseEulerFoam/kineticTheoryModels/kineticTheoryModel/kineticTheoryModel.C @@ -218,7 +218,7 @@ void Foam::kineticTheoryModel::solve(const volTensorField& gradUat) // The solution is higly unstable close to the packing limit. gs0_ = radialModel_->g0 ( - min(max(alpha_, 1e-6), alphaMax_ - 0.01), + min(max(alpha_, scalar(1e-6)), alphaMax_ - 0.01), alphaMax_ ); @@ -255,7 +255,7 @@ void Foam::kineticTheoryModel::solve(const volTensorField& gradUat) volScalarField J1 = 3.0*betaPrim; volScalarField J2 = 0.25*sqr(betaPrim)*da_*sqr(Ur) - /(max(alpha_, 1e-6)*rhoa_*sqrtPi*(ThetaSqrt + TsmallSqrt)); + /(max(alpha_, scalar(1e-6))*rhoa_*sqrtPi*(ThetaSqrt + TsmallSqrt)); // bulk viscosity p. 45 (Lun et al. 1984). lambda_ = (4.0/3.0)*sqr(alpha_)*rhoa_*da_*gs0_*(1.0+e_)*ThetaSqrt/sqrtPi; @@ -309,7 +309,11 @@ void Foam::kineticTheoryModel::solve(const volTensorField& gradUat) volScalarField t1 = K1*alpha_ + rhoa_; volScalarField l1 = -t1*trD; volScalarField l2 = sqr(t1)*tr2D; - volScalarField l3 = 4.0*K4*max(alpha_, 1e-6)*(2.0*K3*trD2 + K2*tr2D); + volScalarField l3 = + 4.0 + *K4 + *max(alpha_, scalar(1e-6)) + *(2.0*K3*trD2 + K2*tr2D); Theta_ = sqr((l1 + sqrt(l2 + l3))/(2.0*(alpha_ + 1.0e-4)*K4)); } diff --git a/applications/utilities/parallelProcessing/redistributeMeshPar/redistributeMeshPar.C b/applications/utilities/parallelProcessing/redistributeMeshPar/redistributeMeshPar.C index b870e9efab..f51ebafb87 100644 --- a/applications/utilities/parallelProcessing/redistributeMeshPar/redistributeMeshPar.C +++ b/applications/utilities/parallelProcessing/redistributeMeshPar/redistributeMeshPar.C @@ -561,10 +561,6 @@ int main(int argc, char *argv[]) mkDir(args.path()); } - // Switch timeStamp checking to one which does not do any - // parallel sync for same reason - regIOobject::fileModificationChecking = regIOobject::timeStamp; - # include "createTime.H" diff --git a/etc/controlDict b/etc/controlDict index f9a23748ee..2c75e1539e 100644 --- a/etc/controlDict +++ b/etc/controlDict @@ -595,6 +595,7 @@ DebugSwitches muSgsSpalartAllmarasWallFunction 0; multiDirRefinement 0; multiHoleInjector 0; + multiLevel 1; multivariateSelection 0; mutRoughWallFunction 0; mutSpalartAllmarasStandardRoughWallFunction 0; diff --git a/src/OpenFOAM/algorithms/MeshWave/FaceCellWave.C b/src/OpenFOAM/algorithms/MeshWave/FaceCellWave.C index 060666e02f..95539965ce 100644 --- a/src/OpenFOAM/algorithms/MeshWave/FaceCellWave.C +++ b/src/OpenFOAM/algorithms/MeshWave/FaceCellWave.C @@ -40,8 +40,7 @@ const Foam::scalar Foam::FaceCellWave::geomTol_ = 1e-6; template -const Foam::scalar -Foam::FaceCellWave::propagationTol_ = 0.01; +Foam::scalar Foam::FaceCellWave::propagationTol_ = 0.01; template Foam::label Foam::FaceCellWave::dummyTrackData_ = 12345; @@ -516,8 +515,8 @@ void Foam::FaceCellWave::handleProcPatches() refCast(patch); // Allocate buffers - labelList receiveFaces(patch.size()); - List receiveFacesInfo(patch.size()); + labelList receiveFaces; + List receiveFacesInfo; { UIPstream fromNeighbour(procPatch.neighbProcNo(), pBufs); @@ -675,8 +674,7 @@ Foam::FaceCellWave::FaceCellWave hasCyclicPatches_(hasCyclicPatch()), nEvals_(0), nUnvisitedCells_(mesh_.nCells()), - nUnvisitedFaces_(mesh_.nFaces()), - iter_(0) + nUnvisitedFaces_(mesh_.nFaces()) {} @@ -707,16 +705,15 @@ Foam::FaceCellWave::FaceCellWave hasCyclicPatches_(hasCyclicPatch()), nEvals_(0), nUnvisitedCells_(mesh_.nCells()), - nUnvisitedFaces_(mesh_.nFaces()), - iter_(0) + nUnvisitedFaces_(mesh_.nFaces()) { // Copy initial changed faces data setFaceInfo(changedFaces, changedFacesInfo); // Iterate until nothing changes - iterate(maxIter); + label iter = iterate(maxIter); - if ((maxIter > 0) && (iter_ >= maxIter)) + if ((maxIter > 0) && (iter >= maxIter)) { FatalErrorIn ( @@ -796,7 +793,7 @@ Foam::label Foam::FaceCellWave::faceToCell() ); } - // Neighbour. Hack for check if face has neighbour. + // Neighbour. if (faceI < nInternalFaces) { cellI = neighbour[faceI]; @@ -927,11 +924,13 @@ Foam::label Foam::FaceCellWave::iterate(const label maxIter) handleProcPatches(); } - while (iter_ < maxIter) + label iter = 0; + + while (iter < maxIter) { if (debug) { - Pout<< " Iteration " << iter_ << endl; + Pout<< " Iteration " << iter << endl; } nEvals_ = 0; @@ -963,10 +962,11 @@ Foam::label Foam::FaceCellWave::iterate(const label maxIter) break; } - ++iter_; + ++iter; } - return nUnvisitedCells_; + return iter; } + // ************************************************************************* // diff --git a/src/OpenFOAM/algorithms/MeshWave/FaceCellWave.H b/src/OpenFOAM/algorithms/MeshWave/FaceCellWave.H index 6ad8a1ae32..2824d8e13a 100644 --- a/src/OpenFOAM/algorithms/MeshWave/FaceCellWave.H +++ b/src/OpenFOAM/algorithms/MeshWave/FaceCellWave.H @@ -114,9 +114,6 @@ class FaceCellWave label nUnvisitedCells_; label nUnvisitedFaces_; - //- Iteration counter - label iter_; - // Private Member Functions @@ -232,7 +229,7 @@ class FaceCellWave // Private static data static const scalar geomTol_; - static const scalar propagationTol_; + static scalar propagationTol_; //- Used as default trackdata value to satisfy default template // argument. @@ -340,8 +337,8 @@ public: // counted double) label cellToFace(); - //- Iterate until no changes or maxIter reached. Returns number of - // unset cells (see getUnsetCells) + //- Iterate until no changes or maxIter reached. Returns actual + // number of iterations. label iterate(const label maxIter); }; diff --git a/src/OpenFOAM/algorithms/MeshWave/MeshWave.H b/src/OpenFOAM/algorithms/MeshWave/MeshWave.H index a93d01cfab..d48f3c69aa 100644 --- a/src/OpenFOAM/algorithms/MeshWave/MeshWave.H +++ b/src/OpenFOAM/algorithms/MeshWave/MeshWave.H @@ -134,8 +134,8 @@ public: return calc_.data(); } - //- Iterate until no changes or maxIter reached. Returns number of - // unset cells (see getUnsetCells) + //- Iterate until no changes or maxIter reached. Returns actual + // number of iterations. label iterate(const label maxIter) { return calc_.iterate(maxIter); diff --git a/src/OpenFOAM/db/IOobjects/IOdictionary/IOdictionary.C b/src/OpenFOAM/db/IOobjects/IOdictionary/IOdictionary.C index 65276015fe..a1d6903956 100644 --- a/src/OpenFOAM/db/IOobjects/IOdictionary/IOdictionary.C +++ b/src/OpenFOAM/db/IOobjects/IOdictionary/IOdictionary.C @@ -66,6 +66,10 @@ void Foam::IOdictionary::readFile(const bool masterOnly) : Pstream::treeCommunication() ); + // Master reads headerclassname from file. Make sure this gets + // transfered as well as contents. + Pstream::scatter(comms, const_cast(headerClassName())); + Pstream::scatter(comms, note()); // Get my communication order const Pstream::commsStruct& myComm = comms[Pstream::myProcNo()]; diff --git a/src/OpenFOAM/db/regIOobject/regIOobjectRead.C b/src/OpenFOAM/db/regIOobject/regIOobjectRead.C index fcf53b985f..3ba675fe2c 100644 --- a/src/OpenFOAM/db/regIOobject/regIOobjectRead.C +++ b/src/OpenFOAM/db/regIOobject/regIOobjectRead.C @@ -201,6 +201,11 @@ bool Foam::regIOobject::read() : Pstream::treeCommunication() ); + // Master reads headerclassname from file. Make sure this gets + // transfered as well as contents. + Pstream::scatter(comms, const_cast(headerClassName())); + Pstream::scatter(comms, note()); + // Get my communication order const Pstream::commsStruct& myComm = comms[Pstream::myProcNo()]; diff --git a/src/OpenFOAM/interpolations/interpolationTable/interpolationTable.C b/src/OpenFOAM/interpolations/interpolationTable/interpolationTable.C index 6699b6349b..be8a2b71ba 100644 --- a/src/OpenFOAM/interpolations/interpolationTable/interpolationTable.C +++ b/src/OpenFOAM/interpolations/interpolationTable/interpolationTable.C @@ -284,10 +284,8 @@ Type Foam::interpolationTable::rateOfChange(const scalar value) const case interpolationTable::REPEAT: { // adjust lookupValue to >= minLimit - while (lookupValue < minLimit) - { - lookupValue += maxLimit; - } + scalar span = maxLimit-minLimit; + lookupValue = fmod(lookupValue-minLimit, span) + minLimit; break; } } @@ -325,10 +323,8 @@ Type Foam::interpolationTable::rateOfChange(const scalar value) const case interpolationTable::REPEAT: { // adjust lookupValue <= maxLimit - while (lookupValue > maxLimit) - { - lookupValue -= maxLimit; - } + scalar span = maxLimit-minLimit; + lookupValue = fmod(lookupValue-minLimit, span) + minLimit; break; } } @@ -540,11 +536,9 @@ Type Foam::interpolationTable::operator()(const scalar value) const } case interpolationTable::REPEAT: { - // adjust lookupValue to >= minLimin - while (lookupValue < minLimit) - { - lookupValue += maxLimit; - } + // adjust lookupValue to >= minLimit + scalar span = maxLimit-minLimit; + lookupValue = fmod(lookupValue-minLimit, span) + minLimit; break; } } @@ -582,10 +576,8 @@ Type Foam::interpolationTable::operator()(const scalar value) const case interpolationTable::REPEAT: { // adjust lookupValue <= maxLimit - while (lookupValue > maxLimit) - { - lookupValue -= maxLimit; - } + scalar span = maxLimit-minLimit; + lookupValue = fmod(lookupValue-minLimit, span) + minLimit; break; } } diff --git a/src/OpenFOAM/matrices/solution/solution.C b/src/OpenFOAM/matrices/solution/solution.C index 610df5b8dd..c24ed33a60 100644 --- a/src/OpenFOAM/matrices/solution/solution.C +++ b/src/OpenFOAM/matrices/solution/solution.C @@ -84,7 +84,11 @@ Foam::solution::solution dictName, obr.time().system(), obr, - IOobject::MUST_READ_IF_MODIFIED, + ( + obr.readOpt() == IOobject::MUST_READ + ? IOobject::MUST_READ_IF_MODIFIED + : obr.readOpt() + ), IOobject::NO_WRITE ) ), @@ -94,7 +98,14 @@ Foam::solution::solution defaultRelaxationFactor_(0), solvers_(ITstream("solvers", tokenList())()) { - read(solutionDict()); + if + ( + readOpt() == IOobject::MUST_READ + || readOpt() == IOobject::MUST_READ_IF_MODIFIED + ) + { + read(solutionDict()); + } } diff --git a/src/OpenFOAM/meshes/polyMesh/polyPatches/constraint/cyclic/cyclicPolyPatch.C b/src/OpenFOAM/meshes/polyMesh/polyPatches/constraint/cyclic/cyclicPolyPatch.C index e7d1991fb9..0010c5ecc4 100644 --- a/src/OpenFOAM/meshes/polyMesh/polyPatches/constraint/cyclic/cyclicPolyPatch.C +++ b/src/OpenFOAM/meshes/polyMesh/polyPatches/constraint/cyclic/cyclicPolyPatch.C @@ -273,6 +273,30 @@ void Foam::cyclicPolyPatch::calcTransforms half1Normals, half0Tols ); + + if (transform_ == ROTATIONAL && !parallel() && forwardT().size() > 1) + { + const_cast(forwardT()).setSize(1); + const_cast(reverseT()).setSize(1); + const_cast(collocated()).setSize(1); + + WarningIn + ( + "cyclicPolyPatch::calcTransforms\n" + " (\n" + " const primitivePatch&,\n" + " const UList&,\n" + " const UList&,\n" + " const UList&,\n" + " const UList&\n" + " )" + ) << "For patch " << name() + << " calculated non-uniform transform tensor even though" + << " the transform type is " << transformTypeNames[transform_] + << ". Setting the transformation tensor to be a uniform" + << " rotation." + << endl; + } } } @@ -851,22 +875,6 @@ const Foam::edgeList& Foam::cyclicPolyPatch::coupledPoints() const str<< "l " << vertI-1 << ' ' << vertI << nl; } } - - // Remove any addressing calculated for the coupled edges calculation - const_cast - ( - static_cast - ( - *this - ) - ).clearOut(); - const_cast - ( - static_cast - ( - neighbPatch() - ) - ).clearOut(); } return *coupledPointsPtr_; } @@ -1006,22 +1014,6 @@ const Foam::edgeList& Foam::cyclicPolyPatch::coupledEdges() const str<< "l " << vertI-1 << ' ' << vertI << nl; } } - - // Remove any addressing calculated for the coupled edges calculation - const_cast - ( - static_cast - ( - *this - ) - ).clearOut(); - const_cast - ( - static_cast - ( - neighbPatch - ) - ).clearOut(); } return *coupledEdgesPtr_; } diff --git a/src/OpenFOAM/meshes/polyMesh/polyPatches/constraint/processor/processorPolyPatch.C b/src/OpenFOAM/meshes/polyMesh/polyPatches/constraint/processor/processorPolyPatch.C index cd913267af..47425f1a8c 100644 --- a/src/OpenFOAM/meshes/polyMesh/polyPatches/constraint/processor/processorPolyPatch.C +++ b/src/OpenFOAM/meshes/polyMesh/polyPatches/constraint/processor/processorPolyPatch.C @@ -409,6 +409,7 @@ void Foam::processorPolyPatch::updateMesh(PstreamBuffers& pBufs) } // Remove any addressing used for shared points/edges calculation + // since mostly not needed. primitivePatch::clearOut(); } } diff --git a/src/OpenFOAM/meshes/polyMesh/polyPatches/constraint/processorCyclic/processorCyclicPolyPatch.C b/src/OpenFOAM/meshes/polyMesh/polyPatches/constraint/processorCyclic/processorCyclicPolyPatch.C index 6bc517ec25..33264fc0d3 100644 --- a/src/OpenFOAM/meshes/polyMesh/polyPatches/constraint/processorCyclic/processorCyclicPolyPatch.C +++ b/src/OpenFOAM/meshes/polyMesh/polyPatches/constraint/processorCyclic/processorCyclicPolyPatch.C @@ -174,8 +174,6 @@ void Foam::processorCyclicPolyPatch::calcGeometry(PstreamBuffers& pBufs) // Update underlying cyclic coupledPolyPatch& pp = const_cast(referPatch()); - Pout<< "updating geometry on refered patch:" << pp.name() << endl; - pp.calcGeometry ( *this, diff --git a/src/OpenFOAM/primitives/ops/ops.H b/src/OpenFOAM/primitives/ops/ops.H index 217fe8db6e..42d16029d0 100644 --- a/src/OpenFOAM/primitives/ops/ops.H +++ b/src/OpenFOAM/primitives/ops/ops.H @@ -76,6 +76,8 @@ EqOp(eqMag, x = mag(y)) EqOp(plusEqMagSqr, x += magSqr(y)) EqOp(maxEq, x = max(x, y)) EqOp(minEq, x = min(x, y)) +EqOp(minMagSqrEq, x = (magSqr(x)<=magSqr(y) ? x : y)) +EqOp(maxMagSqrEq, x = (magSqr(x)>=magSqr(y) ? x : y)) EqOp(andEq, x = (x && y)) EqOp(orEq, x = (x || y)) diff --git a/src/OpenFOAM/primitives/transform/transform.H b/src/OpenFOAM/primitives/transform/transform.H index 70e6821612..c880e05888 100644 --- a/src/OpenFOAM/primitives/transform/transform.H +++ b/src/OpenFOAM/primitives/transform/transform.H @@ -48,9 +48,11 @@ inline tensor rotationTensor const vector& n2 ) { + const scalar s = n1 & n2; + const vector n3 = n1 ^ n2; return - (n1 & n2)*I - + (1 - (n1 & n2))*sqr(n1 ^ n2)/(magSqr(n1 ^ n2) + VSMALL) + s*I + + (1 - s)*sqr(n3)/(magSqr(n3) + VSMALL) + (n2*n1 - n1*n2); } diff --git a/src/finiteVolume/fields/fvPatchFields/derived/advective/advectiveFvPatchField.C b/src/finiteVolume/fields/fvPatchFields/derived/advective/advectiveFvPatchField.C index cb18909469..209bd9cd92 100644 --- a/src/finiteVolume/fields/fvPatchFields/derived/advective/advectiveFvPatchField.C +++ b/src/finiteVolume/fields/fvPatchFields/derived/advective/advectiveFvPatchField.C @@ -163,21 +163,19 @@ tmp advectiveFvPatchField::advectionSpeed() const const surfaceScalarField& phi = this->db().objectRegistry::lookupObject(phiName_); - fvsPatchField phip = this->patch().lookupPatchField - ( - phiName_, - reinterpret_cast(0), - reinterpret_cast(0) - ); + fvsPatchField phip = + this->patch().template lookupPatchField + ( + phiName_ + ); if (phi.dimensions() == dimDensity*dimVelocity*dimArea) { - const fvPatchScalarField& rhop = this->patch().lookupPatchField - ( - rhoName_, - reinterpret_cast(0), - reinterpret_cast(0) - ); + const fvPatchScalarField& rhop = + this->patch().template lookupPatchField + ( + rhoName_ + ); return phip/(rhop*this->patch().magSf()); } diff --git a/src/finiteVolume/fields/fvPatchFields/derived/inletOutlet/inletOutletFvPatchField.C b/src/finiteVolume/fields/fvPatchFields/derived/inletOutlet/inletOutletFvPatchField.C index 9587c380f5..a1f08fd98a 100644 --- a/src/finiteVolume/fields/fvPatchFields/derived/inletOutlet/inletOutletFvPatchField.C +++ b/src/finiteVolume/fields/fvPatchFields/derived/inletOutlet/inletOutletFvPatchField.C @@ -25,15 +25,10 @@ License #include "inletOutletFvPatchField.H" -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -namespace Foam -{ - // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // template -inletOutletFvPatchField::inletOutletFvPatchField +Foam::inletOutletFvPatchField::inletOutletFvPatchField ( const fvPatch& p, const DimensionedField& iF @@ -49,7 +44,7 @@ inletOutletFvPatchField::inletOutletFvPatchField template -inletOutletFvPatchField::inletOutletFvPatchField +Foam::inletOutletFvPatchField::inletOutletFvPatchField ( const inletOutletFvPatchField& ptf, const fvPatch& p, @@ -63,7 +58,7 @@ inletOutletFvPatchField::inletOutletFvPatchField template -inletOutletFvPatchField::inletOutletFvPatchField +Foam::inletOutletFvPatchField::inletOutletFvPatchField ( const fvPatch& p, const DimensionedField& iF, @@ -93,7 +88,7 @@ inletOutletFvPatchField::inletOutletFvPatchField template -inletOutletFvPatchField::inletOutletFvPatchField +Foam::inletOutletFvPatchField::inletOutletFvPatchField ( const inletOutletFvPatchField& ptf ) @@ -104,7 +99,7 @@ inletOutletFvPatchField::inletOutletFvPatchField template -inletOutletFvPatchField::inletOutletFvPatchField +Foam::inletOutletFvPatchField::inletOutletFvPatchField ( const inletOutletFvPatchField& ptf, const DimensionedField& iF @@ -118,19 +113,18 @@ inletOutletFvPatchField::inletOutletFvPatchField // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // template -void inletOutletFvPatchField::updateCoeffs() +void Foam::inletOutletFvPatchField::updateCoeffs() { if (this->updated()) { return; } - const Field& phip = this->patch().lookupPatchField - ( - phiName_, - reinterpret_cast(0), - reinterpret_cast(0) - ); + const Field& phip = + this->patch().template lookupPatchField + ( + phiName_ + ); this->valueFraction() = 1.0 - pos(phip); @@ -139,7 +133,7 @@ void inletOutletFvPatchField::updateCoeffs() template -void inletOutletFvPatchField::write(Ostream& os) const +void Foam::inletOutletFvPatchField::write(Ostream& os) const { fvPatchField::write(os); if (phiName_ != "phi") @@ -154,7 +148,7 @@ void inletOutletFvPatchField::write(Ostream& os) const // * * * * * * * * * * * * * * * Member Operators * * * * * * * * * * * * * // template -void inletOutletFvPatchField::operator= +void Foam::inletOutletFvPatchField::operator= ( const fvPatchField& ptf ) @@ -167,8 +161,4 @@ void inletOutletFvPatchField::operator= } -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -} // End namespace Foam - // ************************************************************************* // diff --git a/src/finiteVolume/fields/fvPatchFields/derived/inletOutlet/inletOutletFvPatchField.H b/src/finiteVolume/fields/fvPatchFields/derived/inletOutlet/inletOutletFvPatchField.H index 86e68a8aa4..fe8cd0017a 100644 --- a/src/finiteVolume/fields/fvPatchFields/derived/inletOutlet/inletOutletFvPatchField.H +++ b/src/finiteVolume/fields/fvPatchFields/derived/inletOutlet/inletOutletFvPatchField.H @@ -56,6 +56,7 @@ protected: // Protected data + //- Name of flux field word phiName_; diff --git a/src/finiteVolume/fields/fvPatchFields/derived/outletInlet/outletInletFvPatchField.C b/src/finiteVolume/fields/fvPatchFields/derived/outletInlet/outletInletFvPatchField.C index bb9b907c74..858226bfe2 100644 --- a/src/finiteVolume/fields/fvPatchFields/derived/outletInlet/outletInletFvPatchField.C +++ b/src/finiteVolume/fields/fvPatchFields/derived/outletInlet/outletInletFvPatchField.C @@ -25,21 +25,17 @@ License #include "outletInletFvPatchField.H" -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -namespace Foam -{ - // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // template -outletInletFvPatchField::outletInletFvPatchField +Foam::outletInletFvPatchField::outletInletFvPatchField ( const fvPatch& p, const DimensionedField& iF ) : - mixedFvPatchField(p, iF) + mixedFvPatchField(p, iF), + phiName_("phi") { this->refValue() = *this; this->refGrad() = pTraits::zero; @@ -48,7 +44,7 @@ outletInletFvPatchField::outletInletFvPatchField template -outletInletFvPatchField::outletInletFvPatchField +Foam::outletInletFvPatchField::outletInletFvPatchField ( const outletInletFvPatchField& ptf, const fvPatch& p, @@ -56,19 +52,21 @@ outletInletFvPatchField::outletInletFvPatchField const fvPatchFieldMapper& mapper ) : - mixedFvPatchField(ptf, p, iF, mapper) + mixedFvPatchField(ptf, p, iF, mapper), + phiName_(ptf.phiName_) {} template -outletInletFvPatchField::outletInletFvPatchField +Foam::outletInletFvPatchField::outletInletFvPatchField ( const fvPatch& p, const DimensionedField& iF, const dictionary& dict ) : - mixedFvPatchField(p, iF) + mixedFvPatchField(p, iF), + phiName_(dict.lookupOrDefault("phi", "phi")) { this->refValue() = Field("outletValue", dict, p.size()); @@ -90,42 +88,43 @@ outletInletFvPatchField::outletInletFvPatchField template -outletInletFvPatchField::outletInletFvPatchField +Foam::outletInletFvPatchField::outletInletFvPatchField ( const outletInletFvPatchField& ptf ) : - mixedFvPatchField(ptf) + mixedFvPatchField(ptf), + phiName_(ptf.phiName_) {} template -outletInletFvPatchField::outletInletFvPatchField +Foam::outletInletFvPatchField::outletInletFvPatchField ( const outletInletFvPatchField& ptf, const DimensionedField& iF ) : - mixedFvPatchField(ptf, iF) + mixedFvPatchField(ptf, iF), + phiName_(ptf.phiName_) {} // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // template -void outletInletFvPatchField::updateCoeffs() +void Foam::outletInletFvPatchField::updateCoeffs() { if (this->updated()) { return; } - const fvsPatchField& phip = this->patch().lookupPatchField - ( - "phi", - reinterpret_cast(0), - reinterpret_cast(0) - ); + const fvsPatchField& phip = + this->patch().template lookupPatchField + ( + phiName_ + ); this->valueFraction() = pos(phip); @@ -134,16 +133,16 @@ void outletInletFvPatchField::updateCoeffs() template -void outletInletFvPatchField::write(Ostream& os) const +void Foam::outletInletFvPatchField::write(Ostream& os) const { fvPatchField::write(os); + if (phiName_ != "phi") + { + os.writeKeyword("phi") << phiName_ << token::END_STATEMENT << nl; + } this->refValue().writeEntry("outletValue", os); this->writeEntry("value", os); } -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -} // End namespace Foam - // ************************************************************************* // diff --git a/src/finiteVolume/fields/fvPatchFields/derived/outletInlet/outletInletFvPatchField.H b/src/finiteVolume/fields/fvPatchFields/derived/outletInlet/outletInletFvPatchField.H index a6548229d3..3ba722fceb 100644 --- a/src/finiteVolume/fields/fvPatchFields/derived/outletInlet/outletInletFvPatchField.H +++ b/src/finiteVolume/fields/fvPatchFields/derived/outletInlet/outletInletFvPatchField.H @@ -52,6 +52,14 @@ class outletInletFvPatchField public mixedFvPatchField { +protected: + + // Protected data + + //- Name of flux field + word phiName_; + + public: //- Runtime type information diff --git a/src/finiteVolume/fields/fvPatchFields/derived/selfContainedDirectMapped/selfContainedDirectMappedFixedValueFvPatchField.H b/src/finiteVolume/fields/fvPatchFields/derived/selfContainedDirectMapped/selfContainedDirectMappedFixedValueFvPatchField.H index 0d76fb6d02..20e190686d 100644 --- a/src/finiteVolume/fields/fvPatchFields/derived/selfContainedDirectMapped/selfContainedDirectMappedFixedValueFvPatchField.H +++ b/src/finiteVolume/fields/fvPatchFields/derived/selfContainedDirectMapped/selfContainedDirectMappedFixedValueFvPatchField.H @@ -48,7 +48,7 @@ namespace Foam { /*---------------------------------------------------------------------------*\ - Class selfContainedDirectMappedFixedValueFvPatch Declaration + Class selfContainedDirectMappedFixedValueFvPatch Declaration \*---------------------------------------------------------------------------*/ template @@ -75,6 +75,7 @@ class selfContainedDirectMappedFixedValueFvPatchField mutable autoPtr > interpolator_; + // Private Member Functions //- Field to sample. Either on my or nbr mesh @@ -83,6 +84,7 @@ class selfContainedDirectMappedFixedValueFvPatchField //- Access the interpolation method const interpolation& interpolator() const; + public: //- Runtime type information diff --git a/src/finiteVolume/fields/fvPatchFields/derived/waveTransmissive/waveTransmissiveFvPatchField.C b/src/finiteVolume/fields/fvPatchFields/derived/waveTransmissive/waveTransmissiveFvPatchField.C index 477bb6f22c..4dc85d5e9b 100644 --- a/src/finiteVolume/fields/fvPatchFields/derived/waveTransmissive/waveTransmissiveFvPatchField.C +++ b/src/finiteVolume/fields/fvPatchFields/derived/waveTransmissive/waveTransmissiveFvPatchField.C @@ -31,15 +31,10 @@ License #include "CrankNicholsonDdtScheme.H" #include "backwardDdtScheme.H" -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -namespace Foam -{ - // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // template -waveTransmissiveFvPatchField::waveTransmissiveFvPatchField +Foam::waveTransmissiveFvPatchField::waveTransmissiveFvPatchField ( const fvPatch& p, const DimensionedField& iF @@ -52,7 +47,7 @@ waveTransmissiveFvPatchField::waveTransmissiveFvPatchField template -waveTransmissiveFvPatchField::waveTransmissiveFvPatchField +Foam::waveTransmissiveFvPatchField::waveTransmissiveFvPatchField ( const waveTransmissiveFvPatchField& ptf, const fvPatch& p, @@ -67,7 +62,7 @@ waveTransmissiveFvPatchField::waveTransmissiveFvPatchField template -waveTransmissiveFvPatchField::waveTransmissiveFvPatchField +Foam::waveTransmissiveFvPatchField::waveTransmissiveFvPatchField ( const fvPatch& p, const DimensionedField& iF, @@ -81,7 +76,7 @@ waveTransmissiveFvPatchField::waveTransmissiveFvPatchField template -waveTransmissiveFvPatchField::waveTransmissiveFvPatchField +Foam::waveTransmissiveFvPatchField::waveTransmissiveFvPatchField ( const waveTransmissiveFvPatchField& ptpsf ) @@ -93,7 +88,7 @@ waveTransmissiveFvPatchField::waveTransmissiveFvPatchField template -waveTransmissiveFvPatchField::waveTransmissiveFvPatchField +Foam::waveTransmissiveFvPatchField::waveTransmissiveFvPatchField ( const waveTransmissiveFvPatchField& ptpsf, const DimensionedField& iF @@ -108,35 +103,32 @@ waveTransmissiveFvPatchField::waveTransmissiveFvPatchField // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // template -tmp waveTransmissiveFvPatchField::advectionSpeed() const +Foam::tmp +Foam::waveTransmissiveFvPatchField::advectionSpeed() const { // Lookup the velocity and compressibility of the patch - const fvPatchField& psip = this->patch().lookupPatchField - ( - psiName_, - reinterpret_cast(0), - reinterpret_cast(0) - ); + const fvPatchField& psip = + this->patch().template lookupPatchField + ( + psiName_ + ); const surfaceScalarField& phi = - this->db().objectRegistry::lookupObject - (this->phiName_); + this->db().template lookupObject(this->phiName_); - fvsPatchField phip = this->patch().lookupPatchField - ( - this->phiName_, - reinterpret_cast(0), - reinterpret_cast(0) - ); + fvsPatchField phip = + this->patch().template lookupPatchField + ( + this->phiName_ + ); if (phi.dimensions() == dimDensity*dimVelocity*dimArea) { - const fvPatchScalarField& rhop = this->patch().lookupPatchField - ( - this->rhoName_, - reinterpret_cast(0), - reinterpret_cast(0) - ); + const fvPatchScalarField& rhop = + this->patch().template lookupPatchField + ( + this->rhoName_ + ); phip /= rhop; } @@ -149,7 +141,7 @@ tmp waveTransmissiveFvPatchField::advectionSpeed() const template -void waveTransmissiveFvPatchField::write(Ostream& os) const +void Foam::waveTransmissiveFvPatchField::write(Ostream& os) const { fvPatchField::write(os); @@ -165,6 +157,7 @@ void waveTransmissiveFvPatchField::write(Ostream& os) const { os.writeKeyword("psi") << psiName_ << token::END_STATEMENT << nl; } + os.writeKeyword("gamma") << gamma_ << token::END_STATEMENT << nl; if (this->lInf_ > SMALL) @@ -179,8 +172,4 @@ void waveTransmissiveFvPatchField::write(Ostream& os) const } -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -} // End namespace Foam - // ************************************************************************* // diff --git a/src/finiteVolume/finiteVolume/fvSchemes/fvSchemes.C b/src/finiteVolume/finiteVolume/fvSchemes/fvSchemes.C index cd786d09fa..a489b8c935 100644 --- a/src/finiteVolume/finiteVolume/fvSchemes/fvSchemes.C +++ b/src/finiteVolume/finiteVolume/fvSchemes/fvSchemes.C @@ -256,7 +256,11 @@ Foam::fvSchemes::fvSchemes(const objectRegistry& obr) "fvSchemes", obr.time().system(), obr, - IOobject::MUST_READ_IF_MODIFIED, + ( + obr.readOpt() == IOobject::MUST_READ + ? IOobject::MUST_READ_IF_MODIFIED + : obr.readOpt() + ), IOobject::NO_WRITE ) ), @@ -364,7 +368,14 @@ Foam::fvSchemes::fvSchemes(const objectRegistry& obr) // persistent settings across reads is incorrect clear(); - read(schemesDict()); + if + ( + readOpt() == IOobject::MUST_READ + || readOpt() == IOobject::MUST_READ_IF_MODIFIED + ) + { + read(schemesDict()); + } } diff --git a/src/fvMotionSolver/fvMotionSolvers/displacement/layeredSolver/pointEdgeStructuredWalk.H b/src/fvMotionSolver/fvMotionSolvers/displacement/layeredSolver/pointEdgeStructuredWalk.H index 55d003a16a..e6852dffa2 100644 --- a/src/fvMotionSolver/fvMotionSolvers/displacement/layeredSolver/pointEdgeStructuredWalk.H +++ b/src/fvMotionSolver/fvMotionSolvers/displacement/layeredSolver/pointEdgeStructuredWalk.H @@ -37,11 +37,7 @@ SourceFiles #define pointEdgeStructuredWalk_H #include "point.H" -#include "label.H" -#include "scalar.H" #include "tensor.H" -#include "pTraits.H" - // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // @@ -75,10 +71,12 @@ class pointEdgeStructuredWalk // Private Member Functions //- Evaluate distance to point. + template inline bool update ( const pointEdgeStructuredWalk& w2, - const scalar tol + const scalar tol, + TrackingData& td ); public: @@ -111,80 +109,105 @@ public: // Needed by meshWave - //- Check whether still contains original (invalid) value. - inline bool valid() const; + //- Check whether origin has been changed at all or + // still contains original (invalid) value. + template + inline bool valid(TrackingData& td) const; //- Check for identical geometrical data. Used for cyclics checking. + template inline bool sameGeometry ( const pointEdgeStructuredWalk&, - const scalar tol + const scalar tol, + TrackingData& td ) const; //- Convert origin to relative vector to leaving point // (= point coordinate) + template inline void leaveDomain ( const polyPatch& patch, const label patchPointI, - const point& pos + const point& pos, + TrackingData& td ); //- Convert relative origin to absolute by adding entering point + template inline void enterDomain ( const polyPatch& patch, const label patchPointI, - const point& pos + const point& pos, + TrackingData& td ); //- Apply rotation matrix to origin - inline void transform(const tensor& rotTensor); + template + inline void transform + ( + const tensor& rotTensor, + TrackingData& td + ); //- Influence of edge on point + template inline bool updatePoint ( const polyMesh& mesh, const label pointI, const label edgeI, const pointEdgeStructuredWalk& edgeInfo, - const scalar tol + const scalar tol, + TrackingData& td ); //- Influence of different value on same point. // Merge new and old info. + template inline bool updatePoint ( const polyMesh& mesh, const label pointI, const pointEdgeStructuredWalk& newPointInfo, - const scalar tol + const scalar tol, + TrackingData& td ); //- Influence of different value on same point. // No information about current position whatsoever. + template inline bool updatePoint ( const pointEdgeStructuredWalk& newPointInfo, - const scalar tol + const scalar tol, + TrackingData& td ); //- Influence of point on edge. + template inline bool updateEdge ( const polyMesh& mesh, const label edgeI, const label pointI, const pointEdgeStructuredWalk& pointInfo, - const scalar tol + const scalar tol, + TrackingData& td ); + //- Same (like operator==) + template + inline bool equal(const pointEdgeStructuredWalk&, TrackingData&) + const; + // Member Operators //Note: Used to determine whether to call update. inline bool operator==(const pointEdgeStructuredWalk&) const; - inline bool operator!=(const pointEdgeStructuredWalk&) const; diff --git a/src/fvMotionSolver/fvMotionSolvers/displacement/layeredSolver/pointEdgeStructuredWalkI.H b/src/fvMotionSolver/fvMotionSolvers/displacement/layeredSolver/pointEdgeStructuredWalkI.H index d60e9b52f7..47adcdb775 100644 --- a/src/fvMotionSolver/fvMotionSolvers/displacement/layeredSolver/pointEdgeStructuredWalkI.H +++ b/src/fvMotionSolver/fvMotionSolvers/displacement/layeredSolver/pointEdgeStructuredWalkI.H @@ -29,13 +29,15 @@ License // * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * // // Update this with w2. +template inline bool Foam::pointEdgeStructuredWalk::update ( const pointEdgeStructuredWalk& w2, - const scalar tol + const scalar tol, + TrackingData& td ) { - if (!valid()) + if (!valid(td)) { // current not yet set. Walked from w2 to here (=point0) dist_ = w2.dist_ + mag(point0_-w2.previousPoint_); @@ -105,17 +107,20 @@ inline const Foam::vector& Foam::pointEdgeStructuredWalk::data() const } -inline bool Foam::pointEdgeStructuredWalk::valid() const +template +inline bool Foam::pointEdgeStructuredWalk::valid(TrackingData& td) const { return previousPoint_ != vector::max; } // Checks for cyclic points +template inline bool Foam::pointEdgeStructuredWalk::sameGeometry ( const pointEdgeStructuredWalk& w2, - const scalar tol + const scalar tol, + TrackingData& td ) const { scalar diff = Foam::mag(dist() - w2.dist()); @@ -138,18 +143,25 @@ inline bool Foam::pointEdgeStructuredWalk::sameGeometry } +template inline void Foam::pointEdgeStructuredWalk::leaveDomain ( const polyPatch& patch, const label patchPointI, - const point& coord + const point& coord, + TrackingData& td ) { previousPoint_ -= coord; } -inline void Foam::pointEdgeStructuredWalk::transform(const tensor& rotTensor) +template +inline void Foam::pointEdgeStructuredWalk::transform +( + const tensor& rotTensor, + TrackingData& td +) { previousPoint_ = Foam::transform(rotTensor, previousPoint_); } @@ -157,11 +169,13 @@ inline void Foam::pointEdgeStructuredWalk::transform(const tensor& rotTensor) // Update absolute geometric quantities. Note that distance (dist_) // is not affected by leaving/entering domain. +template inline void Foam::pointEdgeStructuredWalk::enterDomain ( const polyPatch& patch, const label patchPointI, - const point& coord + const point& coord, + TrackingData& td ) { // back to absolute form @@ -170,18 +184,20 @@ inline void Foam::pointEdgeStructuredWalk::enterDomain // Update this with information from connected edge +template inline bool Foam::pointEdgeStructuredWalk::updatePoint ( const polyMesh& mesh, const label pointI, const label edgeI, const pointEdgeStructuredWalk& edgeInfo, - const scalar tol + const scalar tol, + TrackingData& td ) { if (inZone()) { - return update(edgeInfo, tol); + return update(edgeInfo, tol, td); } else { @@ -191,17 +207,19 @@ inline bool Foam::pointEdgeStructuredWalk::updatePoint // Update this with new information on same point +template inline bool Foam::pointEdgeStructuredWalk::updatePoint ( const polyMesh& mesh, const label pointI, const pointEdgeStructuredWalk& newPointInfo, - const scalar tol + const scalar tol, + TrackingData& td ) { if (inZone()) { - return update(newPointInfo, tol); + return update(newPointInfo, tol, td); } else { @@ -211,29 +229,33 @@ inline bool Foam::pointEdgeStructuredWalk::updatePoint // Update this with new information on same point. No extra information. +template inline bool Foam::pointEdgeStructuredWalk::updatePoint ( const pointEdgeStructuredWalk& newPointInfo, - const scalar tol + const scalar tol, + TrackingData& td ) { - return update(newPointInfo, tol); + return update(newPointInfo, tol, td); } // Update this with information from connected point +template inline bool Foam::pointEdgeStructuredWalk::updateEdge ( const polyMesh& mesh, const label edgeI, const label pointI, const pointEdgeStructuredWalk& pointInfo, - const scalar tol + const scalar tol, + TrackingData& td ) { if (inZone()) { - return update(pointInfo, tol); + return update(pointInfo, tol, td); } else { @@ -242,6 +264,17 @@ inline bool Foam::pointEdgeStructuredWalk::updateEdge } +template +inline bool Foam::pointEdgeStructuredWalk::equal +( + const pointEdgeStructuredWalk& rhs, + TrackingData& td +) const +{ + return operator==(rhs); +} + + // * * * * * * * * * * * * * * * Member Operators * * * * * * * * * * * * * // inline bool Foam::pointEdgeStructuredWalk::operator== diff --git a/src/fvMotionSolver/motionDiffusivity/inversePointDistance/inversePointDistanceDiffusivity.C b/src/fvMotionSolver/motionDiffusivity/inversePointDistance/inversePointDistanceDiffusivity.C index 7ed2a34bba..486052b9db 100644 --- a/src/fvMotionSolver/motionDiffusivity/inversePointDistance/inversePointDistanceDiffusivity.C +++ b/src/fvMotionSolver/motionDiffusivity/inversePointDistance/inversePointDistanceDiffusivity.C @@ -91,6 +91,9 @@ void Foam::inversePointDistanceDiffusivity::correct() List pointWallDist(mesh.nPoints()); List edgeWallDist(mesh.nEdges()); + int dummyTrackData = 0; + + { // Seeds List seedInfo(nPatchEdges); @@ -108,7 +111,7 @@ void Foam::inversePointDistanceDiffusivity::correct() { label pointI = meshPoints[i]; - if (!pointWallDist[pointI].valid()) + if (!pointWallDist[pointI].valid(dummyTrackData)) { // Not yet seeded seedInfo[nPatchEdges] = pointEdgePoint @@ -135,7 +138,8 @@ void Foam::inversePointDistanceDiffusivity::correct() pointWallDist, edgeWallDist, - mesh.globalData().nTotalPoints() // max iterations + mesh.globalData().nTotalPoints(),// max iterations + dummyTrackData ); } diff --git a/src/lagrangian/basic/InteractionLists/InteractionLists.C b/src/lagrangian/basic/InteractionLists/InteractionLists.C index 4636911d5a..15dd9027b9 100644 --- a/src/lagrangian/basic/InteractionLists/InteractionLists.C +++ b/src/lagrangian/basic/InteractionLists/InteractionLists.C @@ -86,7 +86,8 @@ void Foam::InteractionLists::buildInteractionLists() // referred cells that they interact with. PackedBoolList cellInRangeOfCoupledPatch(mesh_.nCells(), false); - // IAndT: index and transform + // IAndT: index (=local cell index) and transform (from + // globalIndexAndTransform) DynamicList cellIAndTToExchange; DynamicList cellBbsToExchange; diff --git a/src/lagrangian/basic/Particle/Particle.C b/src/lagrangian/basic/Particle/Particle.C index b0bc7a8d0c..a56ab267a2 100644 --- a/src/lagrangian/basic/Particle/Particle.C +++ b/src/lagrangian/basic/Particle/Particle.C @@ -371,10 +371,21 @@ Foam::scalar Foam::Particle::trackToFace { // Apply tracking correction towards tet centre + if (debug) + { + Pout<< "tracking rescue using tetCentre from " << position(); + } + position_ += Cloud::trackingCorrectionTol *(tet.centre() - position_); + if (debug) + { + Pout<< " to " << position() << " due to " + << (tet.centre() - position_) << endl; + } + cloud_.trackingRescue(); return trackFraction; @@ -639,6 +650,12 @@ Foam::scalar Foam::Particle::trackToFace tetPointRef tet = currentTet(); + if (debug) + { + Pout<< "tracking rescue for lambdaMin:" << lambdaMin + << "from " << position(); + } + position_ += Cloud::trackingCorrectionTol *(tet.centre() - position_); @@ -692,6 +709,11 @@ Foam::scalar Foam::Particle::trackToFace } } + if (debug) + { + Pout<< " to " << position() << endl; + } + cloud_.trackingRescue(); } diff --git a/src/mesh/autoMesh/autoHexMesh/autoHexMeshDriver/autoLayerDriver.C b/src/mesh/autoMesh/autoHexMesh/autoHexMeshDriver/autoLayerDriver.C index 1d3219972c..68d1762993 100644 --- a/src/mesh/autoMesh/autoHexMesh/autoHexMeshDriver/autoLayerDriver.C +++ b/src/mesh/autoMesh/autoHexMesh/autoHexMeshDriver/autoLayerDriver.C @@ -159,11 +159,6 @@ Foam::label Foam::autoLayerDriver::mergePatchFacesUndo mesh.clearOut(); } - if (meshRefiner_.overwrite()) - { - mesh.setInstance(meshRefiner_.oldInstance()); - } - faceCombiner.updateMesh(map); meshRefiner_.updateMesh(map, labelList(0)); @@ -324,11 +319,6 @@ Foam::label Foam::autoLayerDriver::mergePatchFacesUndo mesh.clearOut(); } - if (meshRefiner_.overwrite()) - { - mesh.setInstance(meshRefiner_.oldInstance()); - } - faceCombiner.updateMesh(map); // Renumber restore maps @@ -396,11 +386,6 @@ Foam::autoPtr Foam::autoLayerDriver::doRemovePoints mesh.clearOut(); } - if (meshRefiner_.overwrite()) - { - mesh.setInstance(meshRefiner_.oldInstance()); - } - pointRemover.updateMesh(map); meshRefiner_.updateMesh(map, labelList(0)); @@ -454,11 +439,6 @@ Foam::autoPtr Foam::autoLayerDriver::doRestorePoints mesh.clearOut(); } - if (meshRefiner_.overwrite()) - { - mesh.setInstance(meshRefiner_.oldInstance()); - } - pointRemover.updateMesh(map); meshRefiner_.updateMesh(map, labelList(0)); @@ -3100,10 +3080,7 @@ void Foam::autoLayerDriver::addLayers //?neccesary? Update fields newMesh.updateMesh(map); - if (meshRefiner_.overwrite()) - { - newMesh.setInstance(meshRefiner_.oldInstance()); - } + newMesh.setInstance(meshRefiner_.timeName()); // Update numbering on addLayer: // - cell/point labels to be newMesh. @@ -3229,11 +3206,6 @@ void Foam::autoLayerDriver::addLayers mesh.clearOut(); } - if (meshRefiner_.overwrite()) - { - mesh.setInstance(meshRefiner_.oldInstance()); - } - meshRefiner_.updateMesh(map, labelList(0)); diff --git a/src/mesh/autoMesh/autoHexMesh/autoHexMeshDriver/autoLayerDriverShrink.C b/src/mesh/autoMesh/autoHexMesh/autoHexMeshDriver/autoLayerDriverShrink.C index 292ec5d142..d7abe804f7 100644 --- a/src/mesh/autoMesh/autoHexMesh/autoHexMeshDriver/autoLayerDriverShrink.C +++ b/src/mesh/autoMesh/autoHexMesh/autoHexMeshDriver/autoLayerDriverShrink.C @@ -756,6 +756,9 @@ void Foam::autoLayerDriver::medialAxisSmoothingInfo // Distance to wall List pointWallDist(mesh.nPoints()); + // Dummy additional info for PointEdgeWave + int dummyTrackData = 0; + // 1. Calculate distance to points where displacement is specified. { @@ -783,7 +786,8 @@ void Foam::autoLayerDriver::medialAxisSmoothingInfo wallInfo, pointWallDist, edgeWallDist, - mesh.globalData().nTotalPoints() // max iterations + mesh.globalData().nTotalPoints(), // max iterations + dummyTrackData ); } @@ -813,7 +817,7 @@ void Foam::autoLayerDriver::medialAxisSmoothingInfo { label pointI = e[ep]; - if (!pointMedialDist[pointI].valid()) + if (!pointMedialDist[pointI].valid(dummyTrackData)) { maxPoints.append(pointI); maxInfo.append @@ -857,7 +861,7 @@ void Foam::autoLayerDriver::medialAxisSmoothingInfo { label pointI = meshPoints[i]; - if (!pointMedialDist[pointI].valid()) + if (!pointMedialDist[pointI].valid(dummyTrackData)) { maxPoints.append(pointI); maxInfo.append @@ -888,7 +892,8 @@ void Foam::autoLayerDriver::medialAxisSmoothingInfo pointMedialDist, edgeMedialDist, - mesh.globalData().nTotalPoints() // max iterations + mesh.globalData().nTotalPoints(), // max iterations + dummyTrackData ); // Extract medial axis distance as pointScalarField diff --git a/src/mesh/autoMesh/autoHexMesh/autoHexMeshDriver/pointData/pointData.C b/src/mesh/autoMesh/autoHexMesh/autoHexMeshDriver/pointData/pointData.C index 6d97d1cd00..1d7f5090ae 100644 --- a/src/mesh/autoMesh/autoHexMesh/autoHexMeshDriver/pointData/pointData.C +++ b/src/mesh/autoMesh/autoHexMesh/autoHexMeshDriver/pointData/pointData.C @@ -32,19 +32,20 @@ Foam::Ostream& Foam::operator<<(Ostream& os, const pointData& wDist) if (os.format() == IOstream::ASCII) { return os - << wDist.origin() << token::SPACE << wDist.distSqr() + << static_cast(wDist) << token::SPACE << wDist.s() << token::SPACE << wDist.v(); } else { return os - << wDist.origin() << wDist.distSqr() << wDist.s() << wDist.v(); + << static_cast(wDist) + << wDist.s() << wDist.v(); } } Foam::Istream& Foam::operator>>(Istream& is, pointData& wDist) { - return is >> wDist.origin_ >> wDist.distSqr_ >> wDist.s_ >> wDist.v_; + return is >> static_cast(wDist) >> wDist.s_ >> wDist.v_; } // ************************************************************************* // diff --git a/src/mesh/autoMesh/autoHexMesh/autoHexMeshDriver/pointData/pointData.H b/src/mesh/autoMesh/autoHexMesh/autoHexMeshDriver/pointData/pointData.H index 050b9d92c7..7719079821 100644 --- a/src/mesh/autoMesh/autoHexMesh/autoHexMeshDriver/pointData/pointData.H +++ b/src/mesh/autoMesh/autoHexMesh/autoHexMeshDriver/pointData/pointData.H @@ -25,10 +25,10 @@ Class Foam::pointData Description - Holds information regarding nearest wall point. Used in pointEdgeWave. - (so not standard meshWave) - - To be used in wall distance calculation. + Variant of pointEdgePoint with some transported additional data. + WIP - should be templated on data like wallDistData. + Passive vector v_ is not a coordinate (so no enterDomain/leaveDomain + transformation needed) SourceFiles pointDataI.H @@ -39,9 +39,10 @@ SourceFiles #ifndef pointData_H #define pointData_H -#include "point.H" -#include "label.H" -#include "tensor.H" +#include "pointEdgePoint.H" +//#include "point.H" +//#include "label.H" +//#include "tensor.H" // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // @@ -49,51 +50,22 @@ SourceFiles namespace Foam { -// Class forward declarations -class polyPatch; -class polyMesh; - /*---------------------------------------------------------------------------*\ Class pointData Declaration \*---------------------------------------------------------------------------*/ class pointData +: + public pointEdgePoint { // Private data - //- position of nearest wall center - point origin_; - - //- normal distance (squared) from point to origin - scalar distSqr_; - //- additional information. scalar s_; //- additional information. vector v_; - - // Private Member Functions - - //- Evaluate distance to point. Update distSqr, origin from whomever - // is nearer pt. Return true if w2 is closer to point, - // false otherwise. - inline bool update - ( - const point&, - const pointData& w2, - const scalar tol - ); - - //- Combine current with w2. Update distSqr, origin if w2 has smaller - // quantities and returns true. - inline bool update - ( - const pointData& w2, - const scalar tol - ); - public: // Constructors @@ -118,10 +90,6 @@ public: // Access - inline const point& origin() const; - - inline scalar distSqr() const; - inline scalar s() const; inline const vector& v() const; @@ -129,81 +97,60 @@ public: // Needed by meshWave - //- Check whether origin has been changed at all or - // still contains original (invalid) value. - inline bool valid() const; - - //- Check for identical geometrical data. Used for cyclics checking. - inline bool sameGeometry(const pointData&, const scalar tol) - const; - - //- Convert origin to relative vector to leaving point - // (= point coordinate) - inline void leaveDomain - ( - const polyPatch& patch, - const label patchPointI, - const point& pos - ); - - //- Convert relative origin to absolute by adding entering point - inline void enterDomain - ( - const polyPatch& patch, - const label patchPointI, - const point& pos - ); - //- Apply rotation matrix to origin - inline void transform(const tensor& rotTensor); + template + inline void transform + ( + const tensor& rotTensor, + TrackingData& td + ); //- Influence of edge on point + template inline bool updatePoint ( const polyMesh& mesh, const label pointI, const label edgeI, const pointData& edgeInfo, - const scalar tol + const scalar tol, + TrackingData& td ); //- Influence of different value on same point. // Merge new and old info. + template inline bool updatePoint ( const polyMesh& mesh, const label pointI, const pointData& newPointInfo, - const scalar tol + const scalar tol, + TrackingData& td ); //- Influence of different value on same point. // No information about current position whatsoever. + template inline bool updatePoint ( const pointData& newPointInfo, - const scalar tol + const scalar tol, + TrackingData& td ); //- Influence of point on edge. + template inline bool updateEdge ( const polyMesh& mesh, const label edgeI, const label pointI, const pointData& pointInfo, - const scalar tol + const scalar tol, + TrackingData& td ); - - // Member Operators - - //Note: Used to determine whether to call update. - inline bool operator==(const pointData&) const; - - inline bool operator!=(const pointData&) const; - - // IOstream Operators friend Ostream& operator<<(Ostream&, const pointData&); diff --git a/src/mesh/autoMesh/autoHexMesh/autoHexMeshDriver/pointData/pointDataI.H b/src/mesh/autoMesh/autoHexMesh/autoHexMeshDriver/pointData/pointDataI.H index a04038c247..c2228eca82 100644 --- a/src/mesh/autoMesh/autoHexMesh/autoHexMeshDriver/pointData/pointDataI.H +++ b/src/mesh/autoMesh/autoHexMesh/autoHexMeshDriver/pointData/pointDataI.H @@ -26,118 +26,12 @@ License #include "polyMesh.H" #include "transform.H" -// * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * // - -// Update this with w2 if w2 nearer to pt. -inline bool Foam::pointData::update -( - const point& pt, - const pointData& w2, - const scalar tol -) -{ - scalar dist2 = magSqr(pt - w2.origin()); - - if (!valid()) - { - distSqr_ = dist2; - origin_ = w2.origin(); - s_ = w2.s(); - v_ = w2.v(); - - return true; - } - - -// if (v_ != w2.v()) -// { -// return false; -// } - - - scalar diff = distSqr_ - dist2; - - if (diff < 0) - { - // already nearer to pt - return false; - } - - if ((diff < SMALL) || ((distSqr_ > SMALL) && (diff/distSqr_ < tol))) - { - // don't propagate small changes - return false; - } - else - { - // update with new values - distSqr_ = dist2; - origin_ = w2.origin(); - s_ = w2.s(); - v_ = w2.v(); - - return true; - } -} - - -// Update this with w2 (information on same point) -inline bool Foam::pointData::update -( - const pointData& w2, - const scalar tol -) -{ - if (!valid()) - { - // current not yet set so use any value - distSqr_ = w2.distSqr(); - origin_ = w2.origin(); - s_ = w2.s(); - v_ = w2.v(); - return true; - } - - -// if (v_ != w2.v()) -// { -// return false; -// } - - - scalar diff = distSqr_ - w2.distSqr(); - - if (diff < 0) - { - // already nearer to pt - return false; - } - - if ((diff < SMALL) || ((distSqr_ > SMALL) && (diff/distSqr_ < tol))) - { - // don't propagate small changes - return false; - } - else - { - // update with new values - distSqr_ = w2.distSqr(); - origin_ = w2.origin(); - s_ = w2.s(); - v_ = w2.v(); - - return true; - } -} - - // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // // Null constructor inline Foam::pointData::pointData() : - origin_(point::max), - distSqr_(GREAT), + pointEdgePoint(), s_(GREAT), v_(point::max) {} @@ -152,8 +46,7 @@ inline Foam::pointData::pointData const vector& v ) : - origin_(origin), - distSqr_(distSqr), + pointEdgePoint(origin, distSqr), s_(s), v_(v) {} @@ -162,8 +55,7 @@ inline Foam::pointData::pointData // Construct as copy inline Foam::pointData::pointData(const pointData& wpt) : - origin_(wpt.origin()), - distSqr_(wpt.distSqr()), + pointEdgePoint(wpt), s_(wpt.s()), v_(wpt.v()) {} @@ -171,18 +63,6 @@ inline Foam::pointData::pointData(const pointData& wpt) // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // -inline const Foam::point& Foam::pointData::origin() const -{ - return origin_; -} - - -inline Foam::scalar Foam::pointData::distSqr() const -{ - return distSqr_; -} - - inline Foam::scalar Foam::pointData::s() const { return s_; @@ -195,157 +75,143 @@ inline const Foam::vector& Foam::pointData::v() const } -inline bool Foam::pointData::valid() const -{ - return origin_ != point::max; -} - - -// Checks for cyclic points -inline bool Foam::pointData::sameGeometry +template +inline void Foam::pointData::transform ( - const pointData& w2, - const scalar tol -) const -{ - scalar diff = Foam::mag(distSqr() - w2.distSqr()); - - if (diff < SMALL) - { - return true; - } - else - { - if ((distSqr() > SMALL) && ((diff/distSqr()) < tol)) - { - return true; - } - else - { - return false; - } - } -} - - -inline void Foam::pointData::leaveDomain -( - const polyPatch& patch, - const label patchPointI, - const point& coord + const tensor& rotTensor, + TrackingData& td ) { - origin_ -= coord; -} - - -inline void Foam::pointData::transform(const tensor& rotTensor) -{ - origin_ = Foam::transform(rotTensor, origin_); -} - - -// Update absolute geometric quantities. Note that distance (distSqr_) -// is not affected by leaving/entering domain. -inline void Foam::pointData::enterDomain -( - const polyPatch& patch, - const label patchPointI, - const point& coord -) -{ - // back to absolute form - origin_ += coord; + pointEdgePoint::transform(rotTensor, td); + v_ = Foam::transform(rotTensor, v_); } // Update this with information from connected edge +template inline bool Foam::pointData::updatePoint ( const polyMesh& mesh, const label pointI, const label edgeI, const pointData& edgeInfo, - const scalar tol + const scalar tol, + TrackingData& td ) { - return - update + if + ( + pointEdgePoint::updatePoint ( - mesh.points()[pointI], + mesh, + pointI, + edgeI, edgeInfo, - tol - ); + tol, + td + ) + ) + { + s_ = edgeInfo.s_; + v_ = edgeInfo.v_; + return true; } - + else + { + return false; + } +} // Update this with new information on same point +template inline bool Foam::pointData::updatePoint ( const polyMesh& mesh, const label pointI, const pointData& newPointInfo, - const scalar tol + const scalar tol, + TrackingData& td ) { - return - update + if + ( + pointEdgePoint::updatePoint ( - mesh.points()[pointI], + mesh, + pointI, newPointInfo, - tol - ); + tol, + td + ) + ) + { + s_ = newPointInfo.s_; + v_ = newPointInfo.v_; + return true; + } + else + { + return false; + } } // Update this with new information on same point. No extra information. +template inline bool Foam::pointData::updatePoint ( const pointData& newPointInfo, - const scalar tol + const scalar tol, + TrackingData& td ) { - return update(newPointInfo, tol); + if (pointEdgePoint::updatePoint(newPointInfo, tol, td)) + { + s_ = newPointInfo.s_; + v_ = newPointInfo.v_; + return true; + } + else + { + return false; + } } // Update this with information from connected point +template inline bool Foam::pointData::updateEdge ( const polyMesh& mesh, const label edgeI, const label pointI, const pointData& pointInfo, - const scalar tol + const scalar tol, + TrackingData& td + ) { - const pointField& points = mesh.points(); - - const edge& e = mesh.edges()[edgeI]; - - const point edgeMid(0.5*(points[e[0]] + points[e[1]])); - - return - update + if + ( + pointEdgePoint::updateEdge ( - edgeMid, + mesh, + edgeI, + pointI, pointInfo, - tol - ); -} - - -// * * * * * * * * * * * * * * * Member Operators * * * * * * * * * * * * * // - -inline bool Foam::pointData::operator==(const pointData& rhs) const -{ - return origin() == rhs.origin(); -} - - -inline bool Foam::pointData::operator!=(const pointData& rhs) const -{ - return !(*this == rhs); + tol, + td + ) + ) + { + s_ = pointInfo.s_; + v_ = pointInfo.v_; + return true; + } + else + { + return false; + } } diff --git a/src/mesh/autoMesh/autoHexMesh/meshRefinement/meshRefinement.C b/src/mesh/autoMesh/autoHexMesh/meshRefinement/meshRefinement.C index 512c651449..bcc98f1dff 100644 --- a/src/mesh/autoMesh/autoHexMesh/meshRefinement/meshRefinement.C +++ b/src/mesh/autoMesh/autoHexMesh/meshRefinement/meshRefinement.C @@ -481,11 +481,6 @@ Foam::autoPtr Foam::meshRefinement::doRemoveCells mesh_.clearOut(); } - if (overwrite_) - { - mesh_.setInstance(oldInstance_); - } - // Update local mesh data cellRemover.updateMesh(map); @@ -1903,9 +1898,14 @@ void Foam::meshRefinement::distribute(const mapDistributePolyMesh& map) pointMap.clear(); } } + + // If necessary reset the instance + mesh_.setInstance(timeName()); + setInstance(mesh_.facesInstance()); } +// Update local data for a mesh change void Foam::meshRefinement::updateMesh ( const mapPolyMesh& map, @@ -2027,6 +2027,10 @@ void Foam::meshRefinement::updateMesh data.transfer(newFaceData); } } + + // If necessary reset the instance + mesh_.setInstance(timeName()); + setInstance(mesh_.facesInstance()); } @@ -2137,7 +2141,7 @@ void Foam::meshRefinement::dumpRefinementLevel() const IOobject ( "cellLevel", - timeName(), + mesh_.time().timeName(),// Dump to current time, not to mesh inst mesh_, IOobject::NO_READ, IOobject::AUTO_WRITE, @@ -2165,7 +2169,7 @@ void Foam::meshRefinement::dumpRefinementLevel() const IOobject ( "pointLevel", - timeName(), + mesh_.time().timeName(),// Dump to current time, not to mesh inst mesh_, IOobject::NO_READ, IOobject::NO_WRITE, diff --git a/src/mesh/autoMesh/autoHexMesh/meshRefinement/meshRefinementBaffles.C b/src/mesh/autoMesh/autoHexMesh/meshRefinement/meshRefinementBaffles.C index a445ebf699..f43e4ab7e2 100644 --- a/src/mesh/autoMesh/autoHexMesh/meshRefinement/meshRefinementBaffles.C +++ b/src/mesh/autoMesh/autoHexMesh/meshRefinement/meshRefinementBaffles.C @@ -517,11 +517,6 @@ Foam::autoPtr Foam::meshRefinement::createBaffles mesh_.clearOut(); } - if (overwrite()) - { - mesh_.setInstance(oldInstance()); - } - //- Redo the intersections on the newly create baffle faces. Note that // this changes also the cell centre positions. faceSet baffledFacesSet(mesh_, "baffledFacesSet", 2*nBaffles); @@ -965,11 +960,6 @@ Foam::autoPtr Foam::meshRefinement::mergeBaffles mesh_.clearOut(); } - if (overwrite()) - { - mesh_.setInstance(oldInstance()); - } - // Update intersections. Recalculate intersections on merged faces since // this seems to give problems? Note: should not be nessecary since // baffles preserve intersections from when they were created. @@ -2249,11 +2239,6 @@ Foam::autoPtr Foam::meshRefinement::dupNonManifoldPoints() mesh_.clearOut(); } - if (overwrite()) - { - mesh_.setInstance(oldInstance()); - } - // Update intersections. Is mapping only (no faces created, positions stay // same) so no need to recalculate intersections. updateMesh(map, labelList(0)); @@ -2783,11 +2768,6 @@ Foam::autoPtr Foam::meshRefinement::zonify mesh_.clearOut(); } - if (overwrite()) - { - mesh_.setInstance(oldInstance()); - } - // Print some stats (note: zones are synchronised) if (mesh_.cellZones().size() > 0) { diff --git a/src/mesh/autoMesh/autoHexMesh/meshRefinement/meshRefinementMerge.C b/src/mesh/autoMesh/autoHexMesh/meshRefinement/meshRefinementMerge.C index 98dfe5aed5..c32446d3a2 100644 --- a/src/mesh/autoMesh/autoHexMesh/meshRefinement/meshRefinementMerge.C +++ b/src/mesh/autoMesh/autoHexMesh/meshRefinement/meshRefinementMerge.C @@ -103,11 +103,6 @@ Foam::label Foam::meshRefinement::mergePatchFaces mesh_.clearOut(); } - if (overwrite()) - { - mesh_.setInstance(oldInstance()); - } - faceCombiner.updateMesh(map); // Get the kept faces that need to be recalculated. @@ -203,11 +198,6 @@ Foam::autoPtr Foam::meshRefinement::mergeEdges mesh_.clearOut(); } - if (overwrite()) - { - mesh_.setInstance(oldInstance()); - } - pointRemover.updateMesh(map); // Get the kept faces that need to be recalculated. diff --git a/src/mesh/autoMesh/autoHexMesh/meshRefinement/meshRefinementRefine.C b/src/mesh/autoMesh/autoHexMesh/meshRefinement/meshRefinementRefine.C index 98b0a34ae7..76c27d7d2b 100644 --- a/src/mesh/autoMesh/autoHexMesh/meshRefinement/meshRefinementRefine.C +++ b/src/mesh/autoMesh/autoHexMesh/meshRefinement/meshRefinementRefine.C @@ -1236,11 +1236,6 @@ Foam::autoPtr Foam::meshRefinement::refine mesh_.clearOut(); } - if (overwrite()) - { - mesh_.setInstance(oldInstance()); - } - // Update intersection info updateMesh(map, getChangedFaces(map, cellsToRefine)); diff --git a/src/meshTools/PointEdgeWave/PointEdgeWave.C b/src/meshTools/PointEdgeWave/PointEdgeWave.C index 304675d71f..a11d6601be 100644 --- a/src/meshTools/PointEdgeWave/PointEdgeWave.C +++ b/src/meshTools/PointEdgeWave/PointEdgeWave.C @@ -32,36 +32,25 @@ License #include "PstreamCombineReduceOps.H" #include "debug.H" #include "typeInfo.H" +#include "globalMeshData.H" +#include "pointFields.H" // * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // -template -Foam::scalar Foam::PointEdgeWave::propagationTol_ = 0.01; +template +Foam::scalar Foam::PointEdgeWave::propagationTol_ = 0.01; - -// Offset labelList. Used for transferring from one cyclic half to the other. -template -void Foam::PointEdgeWave::offset(const label val, labelList& elems) -{ - forAll(elems, i) - { - elems[i] += val; - } -} +template +Foam::label Foam::PointEdgeWave::dummyTrackData_ = 12345; // * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * // -// Gets point-point correspondence. Is -// - list of halfA points (in cyclic patch points) -// - list of halfB points (can overlap with A!) -// - for every patchPoint its corresponding point // Handle leaving domain. Implementation referred to Type -template -void Foam::PointEdgeWave::leaveDomain +template +void Foam::PointEdgeWave::leaveDomain ( - const polyPatch& meshPatch, - const primitivePatch& patch, + const polyPatch& patch, const labelList& patchPointLabels, List& pointInfo ) const @@ -74,17 +63,16 @@ void Foam::PointEdgeWave::leaveDomain const point& pt = patch.points()[meshPoints[patchPointI]]; - pointInfo[i].leaveDomain(meshPatch, patchPointI, pt); + pointInfo[i].leaveDomain(patch, patchPointI, pt, td_); } } // Handle entering domain. Implementation referred to Type -template -void Foam::PointEdgeWave::enterDomain +template +void Foam::PointEdgeWave::enterDomain ( - const polyPatch& meshPatch, - const primitivePatch& patch, + const polyPatch& patch, const labelList& patchPointLabels, List& pointInfo ) const @@ -97,15 +85,16 @@ void Foam::PointEdgeWave::enterDomain const point& pt = patch.points()[meshPoints[patchPointI]]; - pointInfo[i].enterDomain(meshPatch, patchPointI, pt); + pointInfo[i].enterDomain(patch, patchPointI, pt, td_); } } // Transform. Implementation referred to Type -template -void Foam::PointEdgeWave::transform +template +void Foam::PointEdgeWave::transform ( + const polyPatch& patch, const tensorField& rotTensor, List& pointInfo ) const @@ -116,19 +105,22 @@ void Foam::PointEdgeWave::transform forAll(pointInfo, i) { - pointInfo[i].transform(T); + pointInfo[i].transform(T, td_); } } else { FatalErrorIn ( - "PointEdgeWave::transform(const tensorField&, List&)" - ) << "Parallel cyclics not supported" << abort(FatalError); + "PointEdgeWave::transform" + "(const tensorField&, List&)" + ) << "Non-uniform transformation on patch " << patch.name() + << " not supported for point fields" + << abort(FatalError); forAll(pointInfo, i) { - pointInfo[i].transform(rotTensor[i]); + pointInfo[i].transform(rotTensor[i], td_); } } } @@ -139,19 +131,18 @@ void Foam::PointEdgeWave::transform // Updates: // - changedPoint_, changedPoints_, nChangedPoints_, // - statistics: nEvals_, nUnvisitedPoints_ -template -bool Foam::PointEdgeWave::updatePoint +template +bool Foam::PointEdgeWave::updatePoint ( const label pointI, const label neighbourEdgeI, const Type& neighbourInfo, - const scalar tol, Type& pointInfo ) { nEvals_++; - bool wasValid = pointInfo.valid(); + bool wasValid = pointInfo.valid(td_); bool propagate = pointInfo.updatePoint @@ -160,7 +151,8 @@ bool Foam::PointEdgeWave::updatePoint pointI, neighbourEdgeI, neighbourInfo, - tol + propagationTol_, + td_ ); if (propagate) @@ -172,7 +164,7 @@ bool Foam::PointEdgeWave::updatePoint } } - if (!wasValid && pointInfo.valid()) + if (!wasValid && pointInfo.valid(td_)) { --nUnvisitedPoints_; } @@ -186,18 +178,17 @@ bool Foam::PointEdgeWave::updatePoint // Updates: // - changedPoint_, changedPoints_, nChangedPoints_, // - statistics: nEvals_, nUnvisitedPoints_ -template -bool Foam::PointEdgeWave::updatePoint +template +bool Foam::PointEdgeWave::updatePoint ( const label pointI, const Type& neighbourInfo, - const scalar tol, Type& pointInfo ) { nEvals_++; - bool wasValid = pointInfo.valid(); + bool wasValid = pointInfo.valid(td_); bool propagate = pointInfo.updatePoint @@ -205,7 +196,8 @@ bool Foam::PointEdgeWave::updatePoint mesh_, pointI, neighbourInfo, - tol + propagationTol_, + td_ ); if (propagate) @@ -217,7 +209,7 @@ bool Foam::PointEdgeWave::updatePoint } } - if (!wasValid && pointInfo.valid()) + if (!wasValid && pointInfo.valid(td_)) { --nUnvisitedPoints_; } @@ -231,19 +223,18 @@ bool Foam::PointEdgeWave::updatePoint // Updates: // - changedEdge_, changedEdges_, nChangedEdges_, // - statistics: nEvals_, nUnvisitedEdge_ -template -bool Foam::PointEdgeWave::updateEdge +template +bool Foam::PointEdgeWave::updateEdge ( const label edgeI, const label neighbourPointI, const Type& neighbourInfo, - const scalar tol, Type& edgeInfo ) { nEvals_++; - bool wasValid = edgeInfo.valid(); + bool wasValid = edgeInfo.valid(td_); bool propagate = edgeInfo.updateEdge @@ -252,7 +243,8 @@ bool Foam::PointEdgeWave::updateEdge edgeI, neighbourPointI, neighbourInfo, - tol + propagationTol_, + td_ ); if (propagate) @@ -264,7 +256,7 @@ bool Foam::PointEdgeWave::updateEdge } } - if (!wasValid && edgeInfo.valid()) + if (!wasValid && edgeInfo.valid(td_)) { --nUnvisitedEdges_; } @@ -274,9 +266,9 @@ bool Foam::PointEdgeWave::updateEdge // Check if patches of given type name are present -template +template template -Foam::label Foam::PointEdgeWave::countPatchType() const +Foam::label Foam::PointEdgeWave::countPatchType() const { label nPatches = 0; @@ -291,199 +283,110 @@ Foam::label Foam::PointEdgeWave::countPatchType() const } -// Collect changed patch points -template -void Foam::PointEdgeWave::getChangedPatchPoints -( - const primitivePatch& patch, - - DynamicList& patchInfo, - DynamicList