diff --git a/etc/prefs.csh-EXAMPLE b/etc/prefs.csh-EXAMPLE index 3ad92a016..816907aeb 100644 --- a/etc/prefs.csh-EXAMPLE +++ b/etc/prefs.csh-EXAMPLE @@ -160,7 +160,6 @@ #setenv ParaView_VERSION git # eg, cvs/git version #setenv ParaView_MAJOR 3.7 - # System identifier for the OpenFOAM CDash test harness on openfoam-extend # # By default, your system FQN/hostname will be used as the system identifier diff --git a/etc/prefs.sh-EXAMPLE b/etc/prefs.sh-EXAMPLE index b3333dfeb..44800c433 100644 --- a/etc/prefs.sh-EXAMPLE +++ b/etc/prefs.sh-EXAMPLE @@ -162,7 +162,6 @@ compilerInstall=System #export ParaView_VERSION=git # eg, cvs/git version #export ParaView_MAJOR=3.7 - # System identifier for the OpenFOAM CDash test harness on openfoam-extend # # By default, your system FQN/hostname will be used as the system identifier diff --git a/etc/settings.sh b/etc/settings.sh index 073f7232f..5b12f2e5c 100644 --- a/etc/settings.sh +++ b/etc/settings.sh @@ -120,7 +120,7 @@ unset compilerBin compilerLib # Select compiler installation # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ # compilerInstall = OpenFOAM | System -# +# # We can override the value of compilerInstall from prefs.sh : ${compilerInstall:=System} @@ -136,11 +136,18 @@ OpenFOAM) _foamAddLib $WM_THIRD_PARTY_DIR/mpfr-2.4.1/platforms/$WM_ARCH$WM_COMPILER_ARCH/lib _foamAddLib $WM_THIRD_PARTY_DIR/gmp-4.2.4/platforms/$WM_ARCH$WM_COMPILER_ARCH/lib ;; + Gcc45) + export WM_COMPILER_DIR=$WM_THIRD_PARTY_DIR/packages/gcc-4.5.1/platforms/$WM_OPTIONS + _foamSource $WM_THIRD_PARTY_DIR/packages/gmp-5.0.1/platforms/$WM_OPTIONS/etc/gmp-5.0.1.sh + _foamSource $WM_THIRD_PARTY_DIR/packages/mpfr-3.0.1/platforms/$WM_OPTIONS/etc/mpfr-3.0.1.sh + _foamSource $WM_THIRD_PARTY_DIR/packages/mpc-0.8.2/platforms/$WM_OPTIONS/etc/mpc-0.8.2.sh + _foamSource $WM_THIRD_PARTY_DIR/packages/gcc-4.5.1/platforms/$WM_OPTIONS/etc/gcc-4.5.1.sh + ;; Gcc44) _foamSource $WM_THIRD_PARTY_DIR/packages/mpfr-3.0.1/platforms/$WM_OPTIONS/etc/mpfr-3.0.1.sh _foamSource $WM_THIRD_PARTY_DIR/packages/gmp-5.0.1/platforms/$WM_OPTIONS/etc/gmp-5.0.1.sh _foamSource $WM_THIRD_PARTY_DIR/packages/gcc-4.4.5/platforms/$WM_OPTIONS/etc/gcc-4.4.5.sh - ;; + ;; Gcc43) export WM_COMPILER_DIR=$WM_THIRD_PARTY_DIR/gcc-4.3.3/platforms/$WM_ARCH$WM_COMPILER_ARCH _foamAddLib $WM_THIRD_PARTY_DIR/mpfr-2.4.1/platforms/$WM_ARCH$WM_COMPILER_ARCH/lib @@ -480,8 +487,13 @@ export MPI_BUFFER_SIZE # Load cmake # ~~~~~~~~~~ +<<<<<<< Temporary merge branch 1 [ -z "$CMAKE_SYSTEM" ] && [ -e $WM_THIRD_PARTY_DIR/packages/cmake-2.8.8/platforms/$WM_OPTIONS ] && { _foamSource $WM_THIRD_PARTY_DIR/packages/cmake-2.8.8/platforms/$WM_OPTIONS/etc/cmake-2.8.8.sh +======= +[ -z "$CMAKE_SYSTEM" ] && [ -e $WM_THIRD_PARTY_DIR/packages/cmake-2.8.6/platforms/$WM_OPTIONS ] && { + _foamSource $WM_THIRD_PARTY_DIR/packages/cmake-2.8.6/platforms/$WM_OPTIONS/etc/cmake-2.8.6.sh +>>>>>>> Temporary merge branch 2 } [ "$FOAM_VERBOSE" -a "$PS1" ] && echo " CMAKE_DIR is initialized to: $CMAKE_DIR" @@ -509,8 +521,8 @@ export MPI_BUFFER_SIZE # Load zoltan # ~~~~~~~~~~ -[ -z "$ZOLTAN_SYSTEM" ] && [ -e $WM_THIRD_PARTY_DIR/packages/zoltan_3.5 ] && { - _foamSource $WM_THIRD_PARTY_DIR/packages/zoltan_3.5/platforms/$WM_OPTIONS/etc/zoltan_3.5.sh +[ -z "$ZOLTAN_SYSTEM" ] && [ -e $WM_THIRD_PARTY_DIR/packages/zoltan-3.5/platforms/$WM_OPTIONS ] && { + _foamSource $WM_THIRD_PARTY_DIR/packages/zoltan-3.5/platforms/$WM_OPTIONS/etc/zoltan-3.5.sh } [ "$FOAM_VERBOSE" -a "$PS1" ] && echo " ZOLTAN_DIR is initialized to: $ZOLTAN_DIR" @@ -532,8 +544,8 @@ export MPI_BUFFER_SIZE # Load QT # ~~~~~~~ -[ ! -z "$QT_THIRD_PARTY" ] && [ -e $WM_THIRD_PARTY_DIR/packages/qt-everywhere-opensource-src-4.7.0/platforms/$WM_OPTIONS ] && { - _foamSource $WM_THIRD_PARTY_DIR/packages/qt-everywhere-opensource-src-4.7.0/platforms/$WM_OPTIONS/etc/qt-everywhere-opensource-src-4.7.0.sh +[ ! -z "$QT_THIRD_PARTY" ] && [ -e $WM_THIRD_PARTY_DIR/packages/qt-everywhere-opensource-src-4.7.4/platforms/$WM_OPTIONS ] && { + _foamSource $WM_THIRD_PARTY_DIR/packages/qt-everywhere-opensource-src-4.7.4/platforms/$WM_OPTIONS/etc/qt-everywhere-opensource-src-4.7.4.sh } [ "$FOAM_VERBOSE" -a "$PS1" ] && echo " QT_DIR is initialized to: $QT_DIR" @@ -542,8 +554,6 @@ export MPI_BUFFER_SIZE # ~~~~~~~~~~~~~ [ -z "$PARAVIEW_SYSTEM" ] && [ -e $WM_THIRD_PARTY_DIR/packages/ParaView-3.12.0/platforms/$WM_OPTIONS ] && { _foamSource $WM_THIRD_PARTY_DIR/packages/ParaView-3.12.0/platforms/$WM_OPTIONS/etc/ParaView-3.12.0.sh -#[ -z "$PARAVIEW_SYSTEM" ] && [ -e $WM_THIRD_PARTY_DIR/packages/ParaView-3.8.1/platforms/$WM_OPTIONS ] && { -# _foamSource $WM_THIRD_PARTY_DIR/packages/ParaView-3.8.1/platforms/$WM_OPTIONS/etc/ParaView-3.8.1.sh } [ "$FOAM_VERBOSE" -a "$PS1" ] && echo " PARAVIEW_DIR is initialized to: $PARAVIEW_DIR" diff --git a/src/OpenFOAM/interpolations/MixingPlaneInterpolation/MixingPlaneInterpolate.C b/src/OpenFOAM/interpolations/MixingPlaneInterpolation/MixingPlaneInterpolate.C index 9b8d3b3e8..4dd912548 100644 --- a/src/OpenFOAM/interpolations/MixingPlaneInterpolation/MixingPlaneInterpolate.C +++ b/src/OpenFOAM/interpolations/MixingPlaneInterpolation/MixingPlaneInterpolate.C @@ -33,6 +33,10 @@ Contributor \*---------------------------------------------------------------------------*/ +#include +#include +#include + namespace Foam { @@ -40,13 +44,17 @@ namespace Foam template template -void MixingPlaneInterpolation::toProfile +void +MixingPlaneInterpolation:: +interpolate ( const Field& srcF, const labelListList& srcAddr, const scalarListList& srcWeights, - Field& profileBandValues -) + const labelListList& dstAddr, + const scalarListList& dstWeights, + Field& dstResultF +) const { // The src to profile transfer is done using weighted averaging // evaluation of srcF. @@ -68,133 +76,121 @@ void MixingPlaneInterpolation::toProfile // // average(phi) == sum(w*phi) + + int nbrProfileBands = interpolationProfile_.size() - 1; + + List profileBandValues(nbrProfileBands, pTraits::zero); + scalarField srcScalingValues(nbrProfileBands, 0.0); + forAll (srcAddr, bandI) { forAll (srcAddr[bandI], faceI) { profileBandValues[bandI] += srcF[srcAddr[bandI][faceI]]*srcWeights[bandI][faceI]; + + // NB: The next operation should be computed only + // once... and should sum up to 1.0 Let's keep this + // operation for now, until the mixingPlane interface is + // fully debugged (MB, 07/2010) + srcScalingValues[bandI] += srcWeights[bandI][faceI]; + + if (debug <= -200) + { + Info << "bande: " << bandI + << " src valeur: " << srcF[srcAddr[bandI][faceI]] + << " src weight: " << srcWeights[bandI][faceI] << endl; + } } } -} + // We don't need to divide the profileBandValues by the + // srcScalingValues because the srcScalingValues are identically + // equal to 1.0, thanks to the conservativeness of the GGI + // weighting factors + //profileBandValues = profileBandValues/srcScalingValues; -template -template -void MixingPlaneInterpolation::fromProfile -( - const Field& profileBandValues, - const labelListList& dstAddr, - const scalarListList& dstWeights, - Field& dstResultF -) -{ - // The profile to dst transfer is done by distributing the + // profileBandValues are now the circumferentially averaged values + + // The profile to dst transfer is done by simply distributing the // average value accordingly to the dst weighting factors forAll (dstAddr, faceI) { const labelList& curAddr = dstAddr[faceI]; const scalarList& curW = dstWeights[faceI]; - dstResultF[faceI] = pTraits::zero; - forAll (curAddr, bandI) { dstResultF[faceI] += profileBandValues[curAddr[bandI]]*curW[bandI]; + + if (debug <= -200) + { + Info<< "bande: " << dstAddr[faceI][bandI] + << " dst valeur: " << dstResultF[faceI] + << " dst weight: " << dstWeights[faceI][bandI] << endl; + } } } -} - -template -template -void MixingPlaneInterpolation::maskedFromProfile -( - const Field& profileBandValues, - const labelListList& dstAddr, - const scalarListList& dstWeights, - Field& dstResultF, - const labelList& mask -) -{ - // The profile to dst transfer is done by distributing the - // average value accordingly to the dst weighting factors - forAll (mask, maskI) + if (debug <= -500) { - // Pick the masked face - const label faceI = mask[maskI]; + error::printStack(Info); - const labelList& curAddr = dstAddr[faceI]; - const scalarList& curW = dstWeights[faceI]; + Info<< "srcF : " << srcF << nl + << "srcAddr : " << srcAddr << nl + << "srcWeights: " << srcWeights << nl + << "profileBandValues: " << profileBandValues << nl + << "srcScalingValues: " << srcScalingValues << nl + << "dstAddr : " << dstAddr << nl + << "dstWeights: " << dstWeights << nl + << "dstResultF: " << dstResultF << nl + << "srcScalingValues: " << srcScalingValues << endl; + } - dstResultF[maskI] = pTraits::zero; + if (debug <= -999) + { + fileName traceFileDir("./mixingPlaneTraceFiles"); - forAll (curAddr, bandI) + if (!exists(traceFileDir)) { - dstResultF[maskI] += profileBandValues[curAddr[bandI]]*curW[bandI]; + mkDir(traceFileDir); } + + struct timeval tod; + gettimeofday(&tod, NULL); + + //struct timespec tp; + //clock_gettime(CLOCK_MONOTONIC, &tp); + std::ostringstream osBuffer; + + osBuffer + << Foam::name(tod.tv_sec) + << "." << std::setfill('0') << std::setw(6) + << Foam::name(tod.tv_usec); + + fileName traceFileName(traceFileDir/"profileValues_" + osBuffer.str()); + OFstream dumpFileSrc(traceFileName + "_orig"); + OFstream dumpFileDst(traceFileName + "_interpolated"); + OFstream dumpFileProfile(traceFileName + "_profile"); + + //Foam::error::printStack(Info); + + InfoIn + ( + "MixingPlaneInterpolation::interpolate" + ) << "Dumping src profiles to: " << traceFileName + "_orig" << nl + << "Dumping interpolated profiles to : " + << traceFileName + "_interpolated" << nl + << "Dumping profile values to: " + << traceFileName + "_profile" << endl; + + dumpFileDst << dstResultF << endl; + dumpFileSrc << srcF << endl; + dumpFileProfile << profileBandValues << endl; } } -template -template -void MixingPlaneInterpolation::maskedTransform -( - Field& transField, - const tensorField& t, - const Field& inField, - const labelList& mask -) -{ - // The profile to dst transfer is done by distributing the - // average value accordingly to the dst weighting factors - forAll (mask, maskI) - { - // Pick the masked face - const label faceI = mask[maskI]; - - transField[maskI] = transform(t[faceI], inField[maskI]); - } -} - - -template -template -void MixingPlaneInterpolation::interpolate -( - const Field& srcF, - const labelListList& srcAddr, - const scalarListList& srcWeights, - const labelListList& dstAddr, - const scalarListList& dstWeights, - Field& dstResultF -) const -{ - Field profileBandValues(nProfileBands(), pTraits::zero); - - // Interpolate from patch to profile - toProfile - ( - srcF, - srcAddr, - srcWeights, - profileBandValues - ); - - // profileBandValues are now the circumferentially averaged values - - // Collect from profile to patch - fromProfile - ( - profileBandValues, - dstAddr, - dstWeights, - dstResultF - ); -} - - // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // template @@ -210,7 +206,7 @@ MixingPlaneInterpolation::masterToSlave FatalErrorIn ( "MixingPlaneInterpolation::masterToSlave(" - "const Field ff) const" + "const Field ff)" ) << "given field does not correspond to patch. Patch size: " << masterPatch_.size() << " field size: " << patchFF.size() << abort(FatalError); @@ -220,6 +216,16 @@ MixingPlaneInterpolation::masterToSlave // MB: We need this back Field profileFF = transform(masterPatchToProfileT(), patchFF); + if (debug > 1) + { + Info << "MixingPlaneInterpolation::masterToSlave: " + << "patchFF: " << patchFF << endl + << "profileFF: " << profileFF << endl + << "masterPatchToProfileT(): " << masterPatchToProfileT() << endl + << "slaveProfileToPatchT(): " << slaveProfileToPatchT() << endl + << endl; + } + // Do interpolation tmp > tresult ( @@ -237,14 +243,14 @@ MixingPlaneInterpolation::masterToSlave profileFF, // Master data in 'profile space' masterPatchToProfileAddr(), // From master: compute the average masterPatchToProfileWeights(), - slaveProfileToPatchAddr(), // To slave distribute average from + 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); + transform(result, slaveProfileToPatchT(), result); // MB: We need this back return tresult; } @@ -277,7 +283,7 @@ MixingPlaneInterpolation::slaveToMaster FatalErrorIn ( "MixingPlaneInterpolation::slaveToMaster(" - "const Field ff) const" + "const Field ff)" ) << "given field does not correspond to patch. Patch size: " << slavePatch_.size() << " field size: " << patchFF.size() << abort(FatalError); @@ -286,6 +292,16 @@ MixingPlaneInterpolation::slaveToMaster // Move slave data from 'patch space' to 'profile space' Field profileFF = transform(slavePatchToProfileT(), patchFF); + if (debug > 1) + { + Info << "MixingPlaneInterpolation::slaveToMaster: " + << "patchFF: " << patchFF << endl + << "profileFF: " << profileFF << endl + << "slavePatchToProfileT(): " << slavePatchToProfileT() << endl + << "masterProfileToPatchT(): " << masterProfileToPatchT() << endl + << endl; + } + // Do interpolation tmp > tresult ( @@ -329,334 +345,6 @@ MixingPlaneInterpolation::slaveToMaster return tint; } - -template -template -tmp > -MixingPlaneInterpolation::masterToProfile -( - const Field& patchFF -) const -{ - if (patchFF.size() != masterPatch_.size()) - { - FatalErrorIn - ( - "MixingPlaneInterpolation::masterToProfile(" - "const Field ff) const" - ) << "given field does not correspond to patch. Patch size: " - << masterPatch_.size() << " field size: " << patchFF.size() - << abort(FatalError); - } - - // Move master data from 'patch space' to 'profile space' - Field profileFF = transform(masterPatchToProfileT(), patchFF); - - // Do interpolation - tmp > tresult - ( - new Field - ( - nProfileBands(), - pTraits::zero - ) - ); - - Field& result = tresult(); - - toProfile - ( - profileFF, // Master data in 'profile space' - masterPatchToProfileAddr(), // From master: compute the average - masterPatchToProfileWeights(), - result - ); - - return tresult; -} - - -template -template -tmp > -MixingPlaneInterpolation::masterToProfile -( - const tmp >& tff -) const -{ - tmp > tint = masterToProfile(tff()); - tff.clear(); - return tint; -} - - -template -template -tmp > -MixingPlaneInterpolation::slaveToProfile -( - const Field& patchFF -) const -{ - if (patchFF.size() != slavePatch_.size()) - { - FatalErrorIn - ( - "MixingPlaneInterpolation::slaveToProfile(" - "const Field ff) const" - ) << "given field does not correspond to patch. Patch size: " - << slavePatch_.size() << " field size: " << patchFF.size() - << abort(FatalError); - } - - // Move slave data from 'patch space' to 'profile space' - Field profileFF = transform(slavePatchToProfileT(), patchFF); - - // Do interpolation - tmp > tresult - ( - new Field - ( - nProfileBands(), - pTraits::zero - ) - ); - - Field& result = tresult(); - - toProfile - ( - profileFF, // Slave data in 'profile space' - slavePatchToProfileAddr(), // From slave: compute the average - slavePatchToProfileWeights(), - result - ); - - return tresult; -} - - -template -template -tmp > -MixingPlaneInterpolation::slaveToProfile -( - const tmp >& tff -) const -{ - tmp > tint = slaveToProfile(tff()); - tff.clear(); - return tint; -} - - -template -template -tmp > -MixingPlaneInterpolation::profileToMaster -( - const Field& profileFF -) const -{ - if (profileFF.size() != nProfileBands()) - { - FatalErrorIn - ( - "MixingPlaneInterpolation::profileToMaster(" - "const Field ff) const" - ) << "given field does not correspond to profile. Profile size: " - << nProfileBands() << " field size: " << profileFF.size() - << abort(FatalError); - } - - // Do interpolation - tmp > tresult - ( - new Field - ( - masterPatch_.size(), - pTraits::zero - ) - ); - - Field& result = tresult(); - - fromProfile - ( - profileFF, // Master data in 'profile space' - masterProfileToPatchAddr(), // To master: distribute the average - masterProfileToPatchWeights(), - result - ); - - // Apply transform to bring the master field back from 'profile space' - // to 'patch space' - transform(result, masterProfileToPatchT(), result); - - return tresult; -} - - -template -template -tmp > -MixingPlaneInterpolation::profileToMaster -( - const tmp >& tff -) const -{ - tmp > tint = profileToMaster(tff()); - tff.clear(); - return tint; -} - - -template -template -void MixingPlaneInterpolation::maskedProfileToMaster -( - const Field& profileFF, - Field& result, - const labelList& mask -) const -{ - if (profileFF.size() != nProfileBands() || result.size() != mask.size()) - { - FatalErrorIn - ( - "bvoid MixingPlaneInterpolation::" - "maskedProfileToMaster\n" - "(\n" - " const Field& profileFF,\n" - " Field& result,\n" - " const labelList& mask\n" - ") const" - ) << "given field does not correspond to profile. Profile size: " - << nProfileBands() << " field size: " << profileFF.size() - << " result size: " << result.size() - << " mask size: " << mask.size() - << abort(FatalError); - } - - // Do interpolation - maskedFromProfile - ( - profileFF, // Master data in 'profile space' - masterProfileToPatchAddr(), // To master: distribute the average - masterProfileToPatchWeights(), - result, - mask - ); - - // Apply transform to bring the master field back from 'profile space' - // to 'patch space' - maskedTransform(result, masterProfileToPatchT(), result, mask); -} - - -template -template -tmp > -MixingPlaneInterpolation::profileToSlave -( - const Field& profileFF -) const -{ - if (profileFF.size() != nProfileBands()) - { - FatalErrorIn - ( - "MixingPlaneInterpolation::profileToSlave(" - "const Field ff) const" - ) << "given field does not correspond to profile. Profile size: " - << nProfileBands() << " field size: " << profileFF.size() - << abort(FatalError); - } - - // Do interpolation - tmp > tresult - ( - new Field - ( - slavePatch_.size(), - pTraits::zero - ) - ); - - Field& result = tresult(); - - fromProfile - ( - profileFF, // Slave data in 'profile space' - slaveProfileToPatchAddr(), // To slave distribute 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); - - return tresult; -} - - -template -template -tmp > -MixingPlaneInterpolation::profileToSlave -( - const tmp >& tff -) const -{ - tmp > tint = profileToSlave(tff()); - tff.clear(); - return tint; -} - - -template -template -void MixingPlaneInterpolation::maskedProfileToSlave -( - const Field& profileFF, - Field& result, - const labelList& mask -) const -{ - if (profileFF.size() != nProfileBands() || result.size() != mask.size()) - { - FatalErrorIn - ( - "void MixingPlaneInterpolation::" - "maskedProfileToSlave\n" - "(\n" - " const Field& profileFF,\n" - " Field& result,\n" - " const labelList& mask\n" - ") const" - ) << "given field does not correspond to profile. Profile size: " - << nProfileBands() << " field size: " << profileFF.size() - << " result size: " << result.size() - << " mask size: " << mask.size() - << abort(FatalError); - } - - maskedFromProfile - ( - profileFF, // Slave data in 'profile space' - slaveProfileToPatchAddr(), // To slave distribute average from - slaveProfileToPatchWeights(), // profile to patch - result, - mask - ); - - // Apply transform to bring the slave field back from 'profile space' - // to 'patch space' - maskedTransform(result, slaveProfileToPatchT(), result, mask); -} - - template template tmp > @@ -679,6 +367,15 @@ MixingPlaneInterpolation::masterToMaster // Move master data from 'patch space' to 'profile space' Field profileFF = transform(masterPatchToProfileT(), patchFF); + if (debug > 1) + { + Info << "MixingPlaneInterpolation::masterToMaster: " + << "patchFF: " << patchFF << endl + << "profileFF: " << profileFF << endl + << "masterPatchToProfileT(): " << masterPatchToProfileT() << endl + << endl; + } + // Do interpolation tmp > tresult ( @@ -696,7 +393,7 @@ MixingPlaneInterpolation::masterToMaster profileFF, // Master data in 'profile space' masterPatchToProfileAddr(), // From master: compute the average masterPatchToProfileWeights(), - masterProfileToPatchAddr(), // To master: distribute the average + masterProfileToPatchAddr(), // To master: distribute the average masterProfileToPatchWeights(), result ); @@ -708,7 +405,6 @@ MixingPlaneInterpolation::masterToMaster return tresult; } - template template tmp > @@ -722,7 +418,6 @@ MixingPlaneInterpolation::masterToMaster return tint; } - template template tmp > @@ -745,6 +440,15 @@ MixingPlaneInterpolation::slaveToSlave // Move slave data from 'patch space' to 'profile space' Field profileFF = transform(slavePatchToProfileT(), patchFF); + if (debug > 1) + { + Info << "MixingPlaneInterpolation::slaveToSlave: " + << "patchFF: " << patchFF << endl + << "profileFF: " << profileFF << endl + << "slavePatchToProfileT(): " << slavePatchToProfileT() << endl + << endl; + } + // Do interpolation tmp > tresult ( @@ -758,14 +462,14 @@ MixingPlaneInterpolation::slaveToSlave Field& result = tresult(); interpolate - ( - profileFF, // Slave data in 'profile space' - slavePatchToProfileAddr(), // From slave: compute the average - slavePatchToProfileWeights(), - slaveProfileToPatchAddr(), // To slave: distribute the average - slaveProfileToPatchWeights(), - result - ); + ( + profileFF, // Slave data in 'profile space' + slavePatchToProfileAddr(), // From slave: compute the average + slavePatchToProfileWeights(), + slaveProfileToPatchAddr(), // To slave: distribute the average + slaveProfileToPatchWeights(), + result + ); // Apply transform to bring the slave field back from 'profile space' // to 'patch space' @@ -774,7 +478,6 @@ MixingPlaneInterpolation::slaveToSlave return tresult; } - template template tmp > diff --git a/src/OpenFOAM/interpolations/RBFInterpolation/RBFInterpolation.H b/src/OpenFOAM/interpolations/RBFInterpolation/RBFInterpolation.H index 16e3f1579..592a9a769 100644 --- a/src/OpenFOAM/interpolations/RBFInterpolation/RBFInterpolation.H +++ b/src/OpenFOAM/interpolations/RBFInterpolation/RBFInterpolation.H @@ -29,8 +29,8 @@ Description Radial basis function interpolation class Description - Interpolation class which uses Radial Basis Functions to interpolate - field from given data points to arbitrary set of points. + Interpolation class which uses Radial Basis Functions to interpolate the + fluid displacements for given boundary displacements. The coefficient vectors, alpha and beta are determined by solving the system: @@ -38,17 +38,25 @@ Description | db | = | Mbb Pb | | alpha | | 0 | | Pb 0 | | beta | - where db are the given field values at data carrier points. + where db are the given boundary displacements, Mbb the boundary RBF correlation matrix (NbxNb), containing RBF evaluations at the boundary nodes, and Pb some linear polynomial matrix (Nbx4). - In cases where far field data is not of interest, a cutoff function - is used to eliminate unnecessary data points in the far field + Those coefficients are calculated every timestep, with the current + boundary displacements db, with the inverse of Mbb. Using those + coefficients, the RBF is evaluated at all fluid points every + timestep. + + The efficiency of this method is increased by: + 1) using control points which is a subset of the moving + boundary points. Those control points are selected by + a coarsening function. + 2) The outer boundary points are neglected since a cutoff function + is used toward the outer boundaries. Author Frank Bos, TU Delft. All rights reserved. Dubravko Matijasevic, FSB Zagreb. - Reorganisation by Hrvoje Jasak, Wikki Ltd. SourceFiles RBFInterpolation.C @@ -82,7 +90,7 @@ class RBFInterpolation const vectorField& controlPoints_; //- Reference to all points - const vectorField& dataPoints_; + const vectorField& allPoints_; //- RBF function autoPtr RBF_; @@ -128,7 +136,7 @@ public: ( const dictionary& dict, const vectorField& controlPoints, - const vectorField& dataPoints + const vectorField& allPoints ); //- Construct as copy @@ -142,18 +150,6 @@ public: // Member Functions - //- Return reference to control points - const vectorField& controlPoints() const - { - return controlPoints_; - } - - //- Reference to all points - const vectorField& dataPoints() const - { - return dataPoints_; - } - //- Interpolate template tmp > interpolate(const Field& ctrlField) const;