From ca4edd382eca6e1f496055c8e4a6208eac3e9013 Mon Sep 17 00:00:00 2001 From: Hrvoje Jasak Date: Mon, 3 Sep 2012 12:49:45 +0100 Subject: [PATCH 01/13] Clean-up of RBF intrepolation --- .../RBFInterpolation/RBFFunctions/Gauss/Gauss.C | 6 +++--- .../RBFInterpolation/RBFFunctions/Gauss/Gauss.H | 4 ++-- .../RBFInterpolation/RBFFunctions/IMQB/IMQB.C | 6 +++--- .../RBFInterpolation/RBFFunctions/IMQB/IMQB.H | 4 ++-- .../RBFInterpolation/RBFFunctions/RBFFunction/RBFFunction.H | 4 ++-- .../interpolations/RBFInterpolation/RBFFunctions/TPS/TPS.C | 6 +++--- .../interpolations/RBFInterpolation/RBFFunctions/TPS/TPS.H | 4 ++-- .../interpolations/RBFInterpolation/RBFFunctions/W2/W2.C | 6 +++--- .../interpolations/RBFInterpolation/RBFFunctions/W2/W2.H | 4 ++-- .../interpolations/RBFInterpolation/RBFInterpolation.C | 2 -- .../interpolations/RBFInterpolation/RBFInterpolation.H | 5 +---- 11 files changed, 23 insertions(+), 28 deletions(-) diff --git a/src/OpenFOAM/interpolations/RBFInterpolation/RBFFunctions/Gauss/Gauss.C b/src/OpenFOAM/interpolations/RBFInterpolation/RBFFunctions/Gauss/Gauss.C index 3399043dd..bffc625e1 100644 --- a/src/OpenFOAM/interpolations/RBFInterpolation/RBFFunctions/Gauss/Gauss.C +++ b/src/OpenFOAM/interpolations/RBFInterpolation/RBFFunctions/Gauss/Gauss.C @@ -62,12 +62,12 @@ Foam::Gauss::~Gauss() Foam::tmp Foam::Gauss::weights ( - const vectorField& points, - const vector& controlPoint + const vectorField& controlPoints, + const vector& dataPoint ) const { // Algorithmic improvement, Matteo Lombardi. 21/Mar/2011 - scalarField sqrDist = magSqr(points - controlPoint); + scalarField sqrDist = magSqr(controlPoints - dataPoint); return Foam::exp(-sqr(radius_)*sqrDist); } diff --git a/src/OpenFOAM/interpolations/RBFInterpolation/RBFFunctions/Gauss/Gauss.H b/src/OpenFOAM/interpolations/RBFInterpolation/RBFFunctions/Gauss/Gauss.H index 2ecf15783..b8178faa2 100644 --- a/src/OpenFOAM/interpolations/RBFInterpolation/RBFFunctions/Gauss/Gauss.H +++ b/src/OpenFOAM/interpolations/RBFInterpolation/RBFFunctions/Gauss/Gauss.H @@ -99,8 +99,8 @@ public: //- Return weights given points virtual tmp weights ( - const vectorField& points, - const vector& controlPoint + const vectorField& controlPoints, + const vector& dataPoint ) const; }; diff --git a/src/OpenFOAM/interpolations/RBFInterpolation/RBFFunctions/IMQB/IMQB.C b/src/OpenFOAM/interpolations/RBFInterpolation/RBFFunctions/IMQB/IMQB.C index ca5849c0d..06b435c95 100644 --- a/src/OpenFOAM/interpolations/RBFInterpolation/RBFFunctions/IMQB/IMQB.C +++ b/src/OpenFOAM/interpolations/RBFInterpolation/RBFFunctions/IMQB/IMQB.C @@ -63,12 +63,12 @@ Foam::IMQB::~IMQB() Foam::tmp Foam::IMQB::weights ( - const vectorField& points, - const vector& controlPoint + const vectorField& controlPoints, + const vector& dataPoint ) const { // Algorithmic improvement, Matteo Lombardi. 21/Mar/2011 - scalarField sqrDist = magSqr(points - controlPoint); + scalarField sqrDist = magSqr(controlPoints - dataPoint); return 1/sqrt(sqrDist + sqr(radius_)); } diff --git a/src/OpenFOAM/interpolations/RBFInterpolation/RBFFunctions/IMQB/IMQB.H b/src/OpenFOAM/interpolations/RBFInterpolation/RBFFunctions/IMQB/IMQB.H index 9951ae928..7cadd7ed0 100644 --- a/src/OpenFOAM/interpolations/RBFInterpolation/RBFFunctions/IMQB/IMQB.H +++ b/src/OpenFOAM/interpolations/RBFInterpolation/RBFFunctions/IMQB/IMQB.H @@ -99,8 +99,8 @@ public: //- Return weights given points virtual tmp weights ( - const vectorField& points, - const vector& controlPoint + const vectorField& controlPoints, + const vector& dataPoint ) const; }; diff --git a/src/OpenFOAM/interpolations/RBFInterpolation/RBFFunctions/RBFFunction/RBFFunction.H b/src/OpenFOAM/interpolations/RBFInterpolation/RBFFunctions/RBFFunction/RBFFunction.H index d453474d6..dd7a9207c 100644 --- a/src/OpenFOAM/interpolations/RBFInterpolation/RBFFunctions/RBFFunction/RBFFunction.H +++ b/src/OpenFOAM/interpolations/RBFInterpolation/RBFFunctions/RBFFunction/RBFFunction.H @@ -117,8 +117,8 @@ public: //- Return RBF weights virtual tmp weights ( - const vectorField& points, - const vector& controlPoint + const vectorField& controlPoints, + const vector& dataPoint ) const = 0; }; diff --git a/src/OpenFOAM/interpolations/RBFInterpolation/RBFFunctions/TPS/TPS.C b/src/OpenFOAM/interpolations/RBFInterpolation/RBFFunctions/TPS/TPS.C index 14a29bf4d..d20d6a5ac 100644 --- a/src/OpenFOAM/interpolations/RBFInterpolation/RBFFunctions/TPS/TPS.C +++ b/src/OpenFOAM/interpolations/RBFInterpolation/RBFFunctions/TPS/TPS.C @@ -62,11 +62,11 @@ Foam::TPS::~TPS() Foam::tmp Foam::TPS::weights ( - const vectorField& points, - const vector& controlPoint + const vectorField& controlPoints, + const vector& dataPoint ) const { - scalarField dist = mag(points - controlPoint); + scalarField dist = mag(controlPoints - dataPoint); scalarField RBF(dist.size()); forAll(RBF, i) diff --git a/src/OpenFOAM/interpolations/RBFInterpolation/RBFFunctions/TPS/TPS.H b/src/OpenFOAM/interpolations/RBFInterpolation/RBFFunctions/TPS/TPS.H index 841ba92e1..6a8335041 100644 --- a/src/OpenFOAM/interpolations/RBFInterpolation/RBFFunctions/TPS/TPS.H +++ b/src/OpenFOAM/interpolations/RBFInterpolation/RBFFunctions/TPS/TPS.H @@ -98,8 +98,8 @@ public: //- Return weights given points virtual tmp weights ( - const vectorField& points, - const vector& controlPoint + const vectorField& controlPoints, + const vector& dataPoint ) const; }; diff --git a/src/OpenFOAM/interpolations/RBFInterpolation/RBFFunctions/W2/W2.C b/src/OpenFOAM/interpolations/RBFInterpolation/RBFFunctions/W2/W2.C index e937d9ae4..015f351b8 100644 --- a/src/OpenFOAM/interpolations/RBFInterpolation/RBFFunctions/W2/W2.C +++ b/src/OpenFOAM/interpolations/RBFInterpolation/RBFFunctions/W2/W2.C @@ -62,11 +62,11 @@ Foam::W2::~W2() Foam::tmp Foam::W2::weights ( - const vectorField& points, - const vector& controlPoint + const vectorField& controlPoints, + const vector& dataPoint ) const { - scalarField dist = mag(points - controlPoint); + scalarField dist = mag(controlPoints - dataPoint); scalarField RBF(dist.size()); diff --git a/src/OpenFOAM/interpolations/RBFInterpolation/RBFFunctions/W2/W2.H b/src/OpenFOAM/interpolations/RBFInterpolation/RBFFunctions/W2/W2.H index 4f096989b..05dfe5ee2 100644 --- a/src/OpenFOAM/interpolations/RBFInterpolation/RBFFunctions/W2/W2.H +++ b/src/OpenFOAM/interpolations/RBFInterpolation/RBFFunctions/W2/W2.H @@ -99,8 +99,8 @@ public: //- Return weights given points virtual tmp weights ( - const vectorField& points, - const vector& controlPoint + const vectorField& controlPoints, + const vector& dataPoint ) const; }; diff --git a/src/OpenFOAM/interpolations/RBFInterpolation/RBFInterpolation.C b/src/OpenFOAM/interpolations/RBFInterpolation/RBFInterpolation.C index d82cfa85b..e066fab1b 100644 --- a/src/OpenFOAM/interpolations/RBFInterpolation/RBFInterpolation.C +++ b/src/OpenFOAM/interpolations/RBFInterpolation/RBFInterpolation.C @@ -173,7 +173,6 @@ Foam::RBFInterpolation::RBFInterpolation const vectorField& allPoints ) : - dict_(dict), controlPoints_(controlPoints), allPoints_(allPoints), RBF_(RBFFunction::New(word(dict.lookup("RBF")), dict)), @@ -190,7 +189,6 @@ Foam::RBFInterpolation::RBFInterpolation const RBFInterpolation& rbf ) : - dict_(rbf.dict_), controlPoints_(rbf.controlPoints_), allPoints_(rbf.allPoints_), RBF_(rbf.RBF_->clone()), diff --git a/src/OpenFOAM/interpolations/RBFInterpolation/RBFInterpolation.H b/src/OpenFOAM/interpolations/RBFInterpolation/RBFInterpolation.H index 452b1070b..592a9a769 100644 --- a/src/OpenFOAM/interpolations/RBFInterpolation/RBFInterpolation.H +++ b/src/OpenFOAM/interpolations/RBFInterpolation/RBFInterpolation.H @@ -86,13 +86,10 @@ class RBFInterpolation { // Private data - //- Dictionary - const dictionary& dict_; - //- Reference to control points const vectorField& controlPoints_; - //- Rerefence to all points + //- Reference to all points const vectorField& allPoints_; //- RBF function From 0549d5006877eb89e7eca53e47bc56fe1c660275 Mon Sep 17 00:00:00 2001 From: Hrvoje Jasak Date: Mon, 3 Sep 2012 12:50:20 +0100 Subject: [PATCH 02/13] Formatting --- .../GeometricField/GeometricBoundaryField.C | 13 ++++++++++--- src/OpenFOAM/graph/graph.H | 5 ++--- 2 files changed, 12 insertions(+), 6 deletions(-) diff --git a/src/OpenFOAM/fields/GeometricFields/GeometricField/GeometricBoundaryField.C b/src/OpenFOAM/fields/GeometricFields/GeometricField/GeometricBoundaryField.C index 04742a347..1b021b747 100644 --- a/src/OpenFOAM/fields/GeometricFields/GeometricField/GeometricBoundaryField.C +++ b/src/OpenFOAM/fields/GeometricFields/GeometricField/GeometricBoundaryField.C @@ -357,7 +357,8 @@ types() const template class PatchField, class GeoMesh> -typename Foam::GeometricField::GeometricBoundaryField +typename +Foam::GeometricField::GeometricBoundaryField Foam::GeometricField::GeometricBoundaryField:: boundaryInternalField() const { @@ -402,7 +403,10 @@ typename Foam::BlockLduInterfaceFieldPtrsList::Type Foam::GeometricField::GeometricBoundaryField:: blockInterfaces() const { - typename BlockLduInterfaceFieldPtrsList::Type interfaces(this->size()); + typename BlockLduInterfaceFieldPtrsList::Type interfaces + ( + this->size() + ); forAll (interfaces, patchi) { @@ -411,7 +415,10 @@ blockInterfaces() const interfaces.set ( patchi, - &refCast >(this->operator[](patchi)) + &refCast > + ( + this->operator[](patchi) + ) ); } } diff --git a/src/OpenFOAM/graph/graph.H b/src/OpenFOAM/graph/graph.H index ed8e59998..9eebbe29e 100644 --- a/src/OpenFOAM/graph/graph.H +++ b/src/OpenFOAM/graph/graph.H @@ -209,16 +209,15 @@ public: (), () ); - // Selectors - + //- Return a reference to the selected writer static autoPtr New ( const word& writeFormat ); - + // Constructors From ea934bcc83eff67884e52cb90402ab354ea93267 Mon Sep 17 00:00:00 2001 From: Hrvoje Jasak Date: Mon, 3 Sep 2012 12:52:16 +0100 Subject: [PATCH 03/13] Fixed comments --- src/OpenFOAM/primitives/random/Random.H | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/OpenFOAM/primitives/random/Random.H b/src/OpenFOAM/primitives/random/Random.H index b9591fc62..36ca63e8e 100644 --- a/src/OpenFOAM/primitives/random/Random.H +++ b/src/OpenFOAM/primitives/random/Random.H @@ -89,8 +89,8 @@ public: void randomise(symmTensor&); void randomise(tensor&); - //- Return a normal Gaussian randon number - // with zero mean and unity variance N(0, 1) + //- Return a normal Gaussian random number + // with zero mean and unit variance N(0, 1) scalar GaussNormal(); }; From e85f3a38e57a85f55c2e84dea546370c54eb49fa Mon Sep 17 00:00:00 2001 From: Hrvoje Jasak Date: Mon, 3 Sep 2012 12:52:34 +0100 Subject: [PATCH 04/13] Changed direction to higher size. David Gaden --- src/OpenFOAM/primitives/direction/direction.H | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/src/OpenFOAM/primitives/direction/direction.H b/src/OpenFOAM/primitives/direction/direction.H index 4f67d98e8..6c255b07b 100644 --- a/src/OpenFOAM/primitives/direction/direction.H +++ b/src/OpenFOAM/primitives/direction/direction.H @@ -27,21 +27,24 @@ Primitive Description Direction is an integer type used to represent the Cartesian directions - etc. Currently it is a typedef to char which is limited to the range - (0, 255) which should be adequate. + etc. Due to the extension of block matrix with lots of components + this is upgraded to unsigned int. Request by David Gaden, 25/Nov/2012 + HJ, 31/May/2012 \*---------------------------------------------------------------------------*/ #ifndef direction_H #define direction_H -#include "char.H" +#include "int.H" // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // namespace Foam { - typedef unsigned char direction; +// typedef unsigned char direction; + // HJ, 31/May/2012 + typedef unsigned int direction; } // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // From adf3cf9c67fdadf0adf9e02a3fd368c397c45709 Mon Sep 17 00:00:00 2001 From: Hrvoje Jasak Date: Mon, 3 Sep 2012 12:52:49 +0100 Subject: [PATCH 05/13] Fix for eigenvectors --- src/OpenFOAM/primitives/Tensor/tensor/tensor.C | 6 ------ 1 file changed, 6 deletions(-) diff --git a/src/OpenFOAM/primitives/Tensor/tensor/tensor.C b/src/OpenFOAM/primitives/Tensor/tensor/tensor.C index 4ccf80efc..11ad9ff3b 100644 --- a/src/OpenFOAM/primitives/Tensor/tensor/tensor.C +++ b/src/OpenFOAM/primitives/Tensor/tensor/tensor.C @@ -201,12 +201,6 @@ vector eigenValues(const tensor& t) vector eigenVector(const tensor& t, const scalar lambda) { - // Not sure if this is OK. HJ, 9/Jul/2010 -// if (mag(lambda) < SMALL) -// { -// return vector::zero; -// } - // Construct the matrix for the eigenvector problem tensor A(t - lambda*I); From 936c0bcf957d2f5c331437503d4da07a4d0814cd Mon Sep 17 00:00:00 2001 From: Hrvoje Jasak Date: Mon, 3 Sep 2012 13:00:09 +0100 Subject: [PATCH 06/13] Comment --- .../polyPatches/constraint/processor/processorPolyPatch.C | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/OpenFOAM/meshes/polyMesh/polyPatches/constraint/processor/processorPolyPatch.C b/src/OpenFOAM/meshes/polyMesh/polyPatches/constraint/processor/processorPolyPatch.C index d3ba6e996..d83ce96e4 100644 --- a/src/OpenFOAM/meshes/polyMesh/polyPatches/constraint/processor/processorPolyPatch.C +++ b/src/OpenFOAM/meshes/polyMesh/polyPatches/constraint/processor/processorPolyPatch.C @@ -217,7 +217,7 @@ void Foam::processorPolyPatch::calcGeometry() << 100*mag(magSf - nbrMagSf)/avSf << "% -- possible face ordering problem." << endl << "patch: " << name() - << " my area:" << magSf + << " my area: " << magSf << " neighbour area: " << nbrMagSf << " matching tolerance: " << polyPatch::matchTol_ << endl From bf129f823e06d4ea0b649792974a6310656c8d84 Mon Sep 17 00:00:00 2001 From: Hrvoje Jasak Date: Mon, 3 Sep 2012 13:00:47 +0100 Subject: [PATCH 07/13] Removed info --- .../meshes/polyMesh/polyPatches/constraint/ggi/ggiPolyPatch.C | 4 ---- 1 file changed, 4 deletions(-) diff --git a/src/OpenFOAM/meshes/polyMesh/polyPatches/constraint/ggi/ggiPolyPatch.C b/src/OpenFOAM/meshes/polyMesh/polyPatches/constraint/ggi/ggiPolyPatch.C index 65d44302e..b3604dab1 100644 --- a/src/OpenFOAM/meshes/polyMesh/polyPatches/constraint/ggi/ggiPolyPatch.C +++ b/src/OpenFOAM/meshes/polyMesh/polyPatches/constraint/ggi/ggiPolyPatch.C @@ -854,10 +854,6 @@ void Foam::ggiPolyPatch::calcTransforms() if (debug > 1 && master()) { - Info<< "Writing transformed slave patch as VTK." << nl - << "Master: " << name() - << " Slave: " << shadowName() << endl; - if (patchToPatch().uncoveredMasterFaces().size() > 0) { // Write uncovered master faces From 2a489f6a0af3fa78ab1883ece458175c9e3a2dfe Mon Sep 17 00:00:00 2001 From: Hrvoje Jasak Date: Mon, 3 Sep 2012 13:20:14 +0100 Subject: [PATCH 08/13] GMRES preconditioning fix --- .../BlockBiCGStab/BlockBiCGStabSolver.C | 3 ++- src/OpenFOAM/matrices/lduMatrix/lduMatrix/lduMatrix.H | 3 +++ .../matrices/lduMatrix/lduMatrix/lduMatrixSolver.C | 11 ++++++++++- .../lduSolver/bicgStabSolver/bicgStabSolver.C | 1 + 4 files changed, 16 insertions(+), 2 deletions(-) diff --git a/src/OpenFOAM/matrices/blockLduMatrix/BlockLduSolvers/BlockBiCGStab/BlockBiCGStabSolver.C b/src/OpenFOAM/matrices/blockLduMatrix/BlockLduSolvers/BlockBiCGStab/BlockBiCGStabSolver.C index 993836dae..9c151e619 100644 --- a/src/OpenFOAM/matrices/blockLduMatrix/BlockLduSolvers/BlockBiCGStab/BlockBiCGStabSolver.C +++ b/src/OpenFOAM/matrices/blockLduMatrix/BlockLduSolvers/BlockBiCGStab/BlockBiCGStabSolver.C @@ -146,7 +146,8 @@ Foam::BlockBiCGStabSolver::solve s[i] = r[i] - alpha*v[i]; } - preconPtr_->preconditionT(sh, s); + // Bug fix, Alexander Monakov, 11/Jul/2012 + preconPtr_->precondition(sh, s); matrix.Amul(t, sh); omega = gSumProd(t, s)/gSumProd(t, t); diff --git a/src/OpenFOAM/matrices/lduMatrix/lduMatrix/lduMatrix.H b/src/OpenFOAM/matrices/lduMatrix/lduMatrix/lduMatrix.H index 3f21e7b89..779589b80 100644 --- a/src/OpenFOAM/matrices/lduMatrix/lduMatrix/lduMatrix.H +++ b/src/OpenFOAM/matrices/lduMatrix/lduMatrix/lduMatrix.H @@ -280,6 +280,9 @@ public: //- Is the stop criterion reached bool stop(lduMatrix::solverPerformance& solverPerf) const; + //- Is the converrgence criterion reached + bool converged(lduMatrix::solverPerformance& solverPerf) const; + //- Read the control parameters from the dictionary virtual void readControls(); diff --git a/src/OpenFOAM/matrices/lduMatrix/lduMatrix/lduMatrixSolver.C b/src/OpenFOAM/matrices/lduMatrix/lduMatrix/lduMatrixSolver.C index 7e48e1fc3..54d0561d8 100644 --- a/src/OpenFOAM/matrices/lduMatrix/lduMatrix/lduMatrixSolver.C +++ b/src/OpenFOAM/matrices/lduMatrix/lduMatrix/lduMatrixSolver.C @@ -104,7 +104,7 @@ Foam::autoPtr Foam::lduMatrix::solver::New FatalIOErrorIn ( "lduSolver::New", dict - ) << "Unknown asymmetric matrix solver " << solverName << nl << nl + ) << "Unknown asymmetric matrix solver " << solverName << nl << "Valid asymmetric matrix solvers are :" << endl << asymMatrixConstructorTablePtr_->toc() << exit(FatalIOError); @@ -197,6 +197,15 @@ bool Foam::lduMatrix::solver::stop return false; } + return converged(solverPerf); +} + + +bool Foam::lduMatrix::solver::converged +( + lduMatrix::solverPerformance& solverPerf +) const +{ if ( solverPerf.nIterations() >= maxIter_ diff --git a/src/lduSolvers/lduSolver/bicgStabSolver/bicgStabSolver.C b/src/lduSolvers/lduSolver/bicgStabSolver/bicgStabSolver.C index eb8066528..915d9559a 100644 --- a/src/lduSolvers/lduSolver/bicgStabSolver/bicgStabSolver.C +++ b/src/lduSolvers/lduSolver/bicgStabSolver/bicgStabSolver.C @@ -173,6 +173,7 @@ Foam::lduSolverPerformance Foam::bicgStabSolver::solve } // Execute preconditioning transpose + // Bug fix, Alexander Monakov, 11/Jul/2012 preconPtr_->preconditionT(sh, s, cmpt); matrix_.Amul(t, sh, coupleBouCoeffs_, interfaces_, cmpt); omega = gSumProd(t, s)/gSumProd(t, t); From 2a4dd8d1b78adce14212683109422f451851b089 Mon Sep 17 00:00:00 2001 From: Hrvoje Jasak Date: Mon, 3 Sep 2012 13:20:50 +0100 Subject: [PATCH 09/13] Mixing plane updates --- .../MixingPlaneInterpolate.C | 50 +++++++++---------- .../mixingPlaneGAMGInterface.H | 9 ++++ .../mixingPlane/mixingPlanePolyPatch.C | 2 +- .../mixingPlane/mixingPlanePolyPatch.H | 9 ++++ 4 files changed, 44 insertions(+), 26 deletions(-) diff --git a/src/OpenFOAM/interpolations/MixingPlaneInterpolation/MixingPlaneInterpolate.C b/src/OpenFOAM/interpolations/MixingPlaneInterpolation/MixingPlaneInterpolate.C index 4e7fbf661..4dd912548 100644 --- a/src/OpenFOAM/interpolations/MixingPlaneInterpolation/MixingPlaneInterpolate.C +++ b/src/OpenFOAM/interpolations/MixingPlaneInterpolation/MixingPlaneInterpolate.C @@ -239,15 +239,15 @@ MixingPlaneInterpolation::masterToSlave Field& result = tresult(); interpolate - ( - profileFF, // Master data in 'profile space' - masterPatchToProfileAddr(), // From master: compute the average - masterPatchToProfileWeights(), - slaveProfileToPatchAddr(), // To slave we distribute the average from - slaveProfileToPatchWeights(), // profile to patch - result - ); - + ( + profileFF, // Master data in 'profile space' + masterPatchToProfileAddr(), // From master: compute the average + masterPatchToProfileWeights(), + slaveProfileToPatchAddr(), // To slave we distribute the average from + slaveProfileToPatchWeights(), // profile to patch + result + ); + // Apply transform to bring the slave field back from 'profile space' // to 'patch space' transform(result, slaveProfileToPatchT(), result); // MB: We need this back @@ -315,14 +315,14 @@ MixingPlaneInterpolation::slaveToMaster Field& result = tresult(); interpolate - ( - profileFF, // Slave data in 'profile space' - slavePatchToProfileAddr(), // From slave: compute the average - slavePatchToProfileWeights(), - masterProfileToPatchAddr(), // To master: distribute the average - masterProfileToPatchWeights(), - result - ); + ( + profileFF, // Slave data in 'profile space' + slavePatchToProfileAddr(), // From slave: compute the average + slavePatchToProfileWeights(), + masterProfileToPatchAddr(), // To master: distribute the average + masterProfileToPatchWeights(), + result + ); // Apply transform to bring the master field back from 'profile space' // to 'patch space' @@ -389,14 +389,14 @@ MixingPlaneInterpolation::masterToMaster Field& result = tresult(); interpolate - ( - profileFF, // Master data in 'profile space' - masterPatchToProfileAddr(), // From master: compute the average - masterPatchToProfileWeights(), - masterProfileToPatchAddr(), // To master: distribute the average - masterProfileToPatchWeights(), - result - ); + ( + profileFF, // Master data in 'profile space' + masterPatchToProfileAddr(), // From master: compute the average + masterPatchToProfileWeights(), + masterProfileToPatchAddr(), // To master: distribute the average + masterProfileToPatchWeights(), + result + ); // Apply transform to bring the master field back from 'profile space' // to 'patch space' diff --git a/src/OpenFOAM/matrices/lduMatrix/solvers/GAMG/interfaces/mixingPlaneGAMGInterface/mixingPlaneGAMGInterface.H b/src/OpenFOAM/matrices/lduMatrix/solvers/GAMG/interfaces/mixingPlaneGAMGInterface/mixingPlaneGAMGInterface.H index 5934328bf..27891caf9 100644 --- a/src/OpenFOAM/matrices/lduMatrix/solvers/GAMG/interfaces/mixingPlaneGAMGInterface/mixingPlaneGAMGInterface.H +++ b/src/OpenFOAM/matrices/lduMatrix/solvers/GAMG/interfaces/mixingPlaneGAMGInterface/mixingPlaneGAMGInterface.H @@ -107,6 +107,15 @@ public: // Member Functions + // Access + + //- Return true if interface is coupled + virtual bool coupled() const + { + return true; + } + + // Agglomeration //- Agglomerating the given fine-level coefficients and return diff --git a/src/OpenFOAM/meshes/polyMesh/polyPatches/constraint/mixingPlane/mixingPlanePolyPatch.C b/src/OpenFOAM/meshes/polyMesh/polyPatches/constraint/mixingPlane/mixingPlanePolyPatch.C index 056e032b0..8fb879a7f 100644 --- a/src/OpenFOAM/meshes/polyMesh/polyPatches/constraint/mixingPlane/mixingPlanePolyPatch.C +++ b/src/OpenFOAM/meshes/polyMesh/polyPatches/constraint/mixingPlane/mixingPlanePolyPatch.C @@ -217,7 +217,7 @@ Foam::mixingPlanePolyPatch::mixingPlanePolyPatch ) : coupledPolyPatch(name, size, start, index, bm), - shadowName_("_initialize_me_"), + shadowName_(fileName::null), csPtr_ ( new coordinateSystem diff --git a/src/OpenFOAM/meshes/polyMesh/polyPatches/constraint/mixingPlane/mixingPlanePolyPatch.H b/src/OpenFOAM/meshes/polyMesh/polyPatches/constraint/mixingPlane/mixingPlanePolyPatch.H index fc863faf6..da9e0298c 100644 --- a/src/OpenFOAM/meshes/polyMesh/polyPatches/constraint/mixingPlane/mixingPlanePolyPatch.H +++ b/src/OpenFOAM/meshes/polyMesh/polyPatches/constraint/mixingPlane/mixingPlanePolyPatch.H @@ -112,6 +112,15 @@ protected: // Protected Member functions + //- Is the mixing plane active? (zone and shadow present) +// bool active() const; + + //- Initialise the calculation of the patch addressing + virtual void initAddressing(); + + //- Calculate the patch addressing + virtual void calcAddressing(); + //- Initialise the calculation of the patch geometry virtual void initGeometry(); From 61dbc3971f54aed646f743c3aef676c1dfcbe378 Mon Sep 17 00:00:00 2001 From: Hrvoje Jasak Date: Mon, 3 Sep 2012 13:21:15 +0100 Subject: [PATCH 10/13] Direction update --- .../octree/indexedOctree/indexedOctree.C | 31 ++++++++++--------- 1 file changed, 16 insertions(+), 15 deletions(-) diff --git a/src/OpenFOAM/algorithms/octree/indexedOctree/indexedOctree.C b/src/OpenFOAM/algorithms/octree/indexedOctree/indexedOctree.C index 5b0ac5552..f2c9ba0cf 100644 --- a/src/OpenFOAM/algorithms/octree/indexedOctree/indexedOctree.C +++ b/src/OpenFOAM/algorithms/octree/indexedOctree/indexedOctree.C @@ -155,14 +155,14 @@ void Foam::indexedOctree::divide ) const { List > subIndices(8); - for (direction octant = 0; octant < subIndices.size(); octant++) + for (label octant = 0; octant < subIndices.size(); octant++) { subIndices[octant].setCapacity(indices.size()/8); } // Precalculate bounding boxes. FixedList subBbs; - for (direction octant = 0; octant < subBbs.size(); octant++) + for (label octant = 0; octant < subBbs.size(); octant++) { subBbs[octant] = bb.subBbox(octant); } @@ -171,7 +171,7 @@ void Foam::indexedOctree::divide { label shapeI = indices[i]; - for (direction octant = 0; octant < 8; octant++) + for (label octant = 0; octant < 8; octant++) { if (shapes_.overlaps(shapeI, subBbs[octant])) { @@ -181,7 +181,7 @@ void Foam::indexedOctree::divide } result.setSize(8); - for (direction octant = 0; octant < subIndices.size(); octant++) + for (label octant = 0; octant < subIndices.size(); octant++) { result[octant].transfer(subIndices[octant]); } @@ -225,7 +225,7 @@ Foam::indexedOctree::divide // Append the rest. bool replaced = false; - for (direction octant = 0; octant < dividedIndices.size(); octant++) + for (label octant = 0; octant < dividedIndices.size(); octant++) { labelList& subIndices = dividedIndices[octant]; @@ -276,7 +276,7 @@ void Foam::indexedOctree::splitNodes { for ( - direction octant = 0; + label octant = 0; octant < nodes[nodeI].subNodes_.size(); octant++ ) @@ -303,7 +303,8 @@ void Foam::indexedOctree::splitNodes subNode.parent_ = nodeI; label sz = nodes.size(); nodes.append(subNode); - nodes[nodeI].subNodes_[octant] = nodePlusOctant(sz, octant); + nodes[nodeI].subNodes_[octant] = + nodePlusOctant(sz, octant); } } } @@ -332,7 +333,7 @@ Foam::label Foam::indexedOctree::compactContents if (level < compactLevel) { - for (direction octant = 0; octant < nod.subNodes_.size(); octant++) + for (label octant = 0; octant < nod.subNodes_.size(); octant++) { labelBits index = nod.subNodes_[octant]; @@ -354,7 +355,7 @@ Foam::label Foam::indexedOctree::compactContents else if (level == compactLevel) { // Compact all content on this level - for (direction octant = 0; octant < nod.subNodes_.size(); octant++) + for (label octant = 0; octant < nod.subNodes_.size(); octant++) { labelBits index = nod.subNodes_[octant]; @@ -394,7 +395,7 @@ Foam::indexedOctree::calcVolumeType volumeType myType = UNKNOWN; - for (direction octant = 0; octant < nod.subNodes_.size(); octant++) + for (label octant = 0; octant < nod.subNodes_.size(); octant++) { volumeType subType; @@ -451,7 +452,7 @@ Foam::indexedOctree::getVolumeType { const node& nod = nodes_[nodeI]; - direction octant = nod.bb_.subOctant(sample); + label octant = nod.bb_.subOctant(sample); volumeType octantType = volumeType(nodeTypes_.get((nodeI<<3)+octant)); @@ -1268,7 +1269,7 @@ bool Foam::indexedOctree::walkToParent // Find octant nodeI is in. parentOctant = 255; - for (direction i = 0; i < parentNode.subNodes_.size(); i++) + for (label i = 0; i < parentNode.subNodes_.size(); i++) { labelBits index = parentNode.subNodes_[i]; @@ -2020,7 +2021,7 @@ void Foam::indexedOctree::findBox const node& nod = nodes_[nodeI]; const treeBoundBox& nodeBb = nod.bb_; - for (direction octant = 0; octant < nod.subNodes_.size(); octant++) + for (label octant = 0; octant < nod.subNodes_.size(); octant++) { labelBits index = nod.subNodes_[octant]; @@ -2072,7 +2073,7 @@ Foam::label Foam::indexedOctree::countElements const node& nod = nodes_[nodeI]; - for (direction octant = 0; octant < nod.subNodes_.size(); octant++) + for (label octant = 0; octant < nod.subNodes_.size(); octant++) { nElems += countElements(nod.subNodes_[octant]); } @@ -2583,7 +2584,7 @@ void Foam::indexedOctree::print << "parent:" << nod.parent_ << nl << "n:" << countElements(nodePlusOctant(nodeI, 0)) << nl; - for (direction octant = 0; octant < nod.subNodes_.size(); octant++) + for (label octant = 0; octant < nod.subNodes_.size(); octant++) { const treeBoundBox subBb(bb.subBbox(octant)); From 08b09c52460de08c0ff1eaf0b1a37d08545193ac Mon Sep 17 00:00:00 2001 From: Hrvoje Jasak Date: Mon, 3 Sep 2012 13:31:18 +0100 Subject: [PATCH 11/13] Fixed tcsh bugs --- etc/cshrc | 4 +++- etc/settings.csh | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/etc/cshrc b/etc/cshrc index ca6b2b4f1..3c2ecca9a 100644 --- a/etc/cshrc +++ b/etc/cshrc @@ -79,7 +79,9 @@ alias _foamSource 'if ($?FOAM_VERBOSE && $?prompt) echo "Sourcing: \!*"; source # Add in preset user or site preferences: set foamPrefs=`$WM_PROJECT_DIR/bin/foamEtcFile prefs.csh` if ( $status == 0 ) then - _foamSource $foamPrefs + if ($foamPrefs) then + _foamSource $foamPrefs + endif endif unset foamPrefs diff --git a/etc/settings.csh b/etc/settings.csh index e8536d5a5..b0caca8cc 100644 --- a/etc/settings.csh +++ b/etc/settings.csh @@ -444,7 +444,7 @@ endif # PyFoam # ~~~~~~ -if ( $?PYFOAM_SYSTEM == 0 && -e "$WM_THIRD_PARTY_DIR"/packages/PyFoam-0.5.7 ) then +if ( $?PYFOAM_SYSTEM == 0 && -e "$WM_THIRD_PARTY_DIR"/packages/PyFoam-0.5.7/platforms/noarch ) then _foamSource $WM_THIRD_PARTY_DIR/packages/PyFoam-0.5.7/platforms/noarch/etc/PyFoam-0.5.7.csh endif From 9a67a8e6afa521548553a3a7d140644e04b23427 Mon Sep 17 00:00:00 2001 From: Hrvoje Jasak Date: Tue, 4 Sep 2012 15:10:51 +0100 Subject: [PATCH 12/13] Merging mixing plane changes --- src/finiteVolume/Make/files | 11 ++--------- 1 file changed, 2 insertions(+), 9 deletions(-) diff --git a/src/finiteVolume/Make/files b/src/finiteVolume/Make/files index 0386161f6..269423e48 100644 --- a/src/finiteVolume/Make/files +++ b/src/finiteVolume/Make/files @@ -112,7 +112,7 @@ $(constraintFvPatchFields)/ggi/ggiFvPatchFields.C $(constraintFvPatchFields)/cyclicGgi/cyclicGgiFvPatchFields.C $(constraintFvPatchFields)/overlapGgi/overlapGgiFvPatchFields.C $(constraintFvPatchFields)/mixingPlane/mixingPlaneFvPatchFields.C -$(constraintFvPatchFields)/regionCouple/regionCoupleFvPatchFields.C +$(constraintFvPatchFields)/regionCoupling/regionCouplingFvPatchFields.C derivedFvPatchFields = $(fvPatchFields)/derived $(derivedFvPatchFields)/activeBaffleVelocity/activeBaffleVelocityFvPatchVectorField.C @@ -187,13 +187,8 @@ $(constraintFvsPatchFields)/wedge/wedgeFvsPatchFields.C $(constraintFvsPatchFields)/ggi/ggiFvsPatchFields.C $(constraintFvsPatchFields)/cyclicGgi/cyclicGgiFvsPatchFields.C $(constraintFvsPatchFields)/overlapGgi/overlapGgiFvsPatchFields.C -<<<<<<< HEAD -$(constraintFvsPatchFields)/regionCoupling/regionCouplingFvsPatchFields.C -======= $(constraintFvsPatchFields)/mixingPlane/mixingPlaneFvsPatchFields.C -$(constraintFvsPatchFields)/regionCouple/regionCoupleFvsPatchFields.C ->>>>>>> remotes/origin/mixingPlane_RC1 - +$(constraintFvsPatchFields)/regionCoupling/regionCouplingFvsPatchFields.C fields/volFields/volFields.C fields/surfaceFields/surfaceFields.C @@ -216,8 +211,6 @@ $(interpolation)/interpolationCellPointWallModified/makeInterpolationCellPointWa volPointInterpolation = interpolation/volPointInterpolation $(volPointInterpolation)/pointPatchInterpolation/pointPatchInterpolation.C $(volPointInterpolation)/volPointInterpolation.C -interpolation/pointVolInterpolation/pointVolInterpolation.C - pointVolInterpolation = interpolation/pointVolInterpolation $(pointVolInterpolation)/pointVolInterpolation.C From b8faa70c51b7a66d7214c5fc0561bd91f83f982c Mon Sep 17 00:00:00 2001 From: Hrvoje Jasak Date: Tue, 4 Sep 2012 15:11:55 +0100 Subject: [PATCH 13/13] Merging mixing plane changes --- src/OpenFOAM/Make/files | 1 + 1 file changed, 1 insertion(+) diff --git a/src/OpenFOAM/Make/files b/src/OpenFOAM/Make/files index 4d7e6688d..79c52e3b9 100644 --- a/src/OpenFOAM/Make/files +++ b/src/OpenFOAM/Make/files @@ -277,6 +277,7 @@ $(GAMGInterfaces)/cyclicGAMGInterface/cyclicGAMGInterface.C $(GAMGInterfaces)/ggiGAMGInterface/ggiGAMGInterface.C $(GAMGInterfaces)/cyclicGgiGAMGInterface/cyclicGgiGAMGInterface.C $(GAMGInterfaces)/regionCoupleGAMGInterface/regionCoupleGAMGInterface.C +$(GAMGInterfaces)/mixingPlaneGAMGInterface/mixingPlaneGAMGInterface.C GAMGInterfaceFields = $(GAMG)/interfaceFields $(GAMGInterfaceFields)/GAMGInterfaceField/GAMGInterfaceField.C