Merge branch 'HJ/master' into nextRelease

Conflicts:
	ThirdParty/rpmBuild/SOURCES/libccmio-2.6.1.patch_0
	ThirdParty/rpmBuild/SPECS/ParaView-3.12.0.spec
	etc/prefs.csh-EXAMPLE
	etc/prefs.sh-EXAMPLE
	etc/settings.sh
	src/OpenFOAM/interpolations/MixingPlaneInterpolation/MixingPlaneInterpolate.C
	src/OpenFOAM/interpolations/RBFInterpolation/RBFInterpolation.H
	src/OpenFOAM/meshes/polyMesh/polyPatches/constraint/mixingPlane/mixingPlanePolyPatch.C
	src/OpenFOAM/meshes/polyMesh/polyPatches/constraint/mixingPlane/mixingPlanePolyPatch.H
	src/lduSolvers/lduSolver/bicgStabSolver/bicgStabSolver.C
	testHarness/OSIG/Turbomachinery/README.txt
	testHarness/OpenFOAM/1.6-ext/CMakeFiles/CMakeLists.txt
This commit is contained in:
Henrik Rusche 2013-07-03 15:51:19 +02:00
commit eaf054002e
5 changed files with 179 additions and 472 deletions

View file

@ -160,7 +160,6 @@
#setenv ParaView_VERSION git # eg, cvs/git version #setenv ParaView_VERSION git # eg, cvs/git version
#setenv ParaView_MAJOR 3.7 #setenv ParaView_MAJOR 3.7
# System identifier for the OpenFOAM CDash test harness on openfoam-extend # System identifier for the OpenFOAM CDash test harness on openfoam-extend
# #
# By default, your system FQN/hostname will be used as the system identifier # By default, your system FQN/hostname will be used as the system identifier

View file

@ -162,7 +162,6 @@ compilerInstall=System
#export ParaView_VERSION=git # eg, cvs/git version #export ParaView_VERSION=git # eg, cvs/git version
#export ParaView_MAJOR=3.7 #export ParaView_MAJOR=3.7
# System identifier for the OpenFOAM CDash test harness on openfoam-extend # System identifier for the OpenFOAM CDash test harness on openfoam-extend
# #
# By default, your system FQN/hostname will be used as the system identifier # By default, your system FQN/hostname will be used as the system identifier

View file

@ -136,6 +136,13 @@ OpenFOAM)
_foamAddLib $WM_THIRD_PARTY_DIR/mpfr-2.4.1/platforms/$WM_ARCH$WM_COMPILER_ARCH/lib _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 _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) 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/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/gmp-5.0.1/platforms/$WM_OPTIONS/etc/gmp-5.0.1.sh
@ -480,8 +487,13 @@ export MPI_BUFFER_SIZE
# Load cmake # Load cmake
# ~~~~~~~~~~ # ~~~~~~~~~~
<<<<<<< Temporary merge branch 1
[ -z "$CMAKE_SYSTEM" ] && [ -e $WM_THIRD_PARTY_DIR/packages/cmake-2.8.8/platforms/$WM_OPTIONS ] && { [ -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 _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" [ "$FOAM_VERBOSE" -a "$PS1" ] && echo " CMAKE_DIR is initialized to: $CMAKE_DIR"
@ -509,8 +521,8 @@ export MPI_BUFFER_SIZE
# Load zoltan # Load zoltan
# ~~~~~~~~~~ # ~~~~~~~~~~
[ -z "$ZOLTAN_SYSTEM" ] && [ -e $WM_THIRD_PARTY_DIR/packages/zoltan_3.5 ] && { [ -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 _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" [ "$FOAM_VERBOSE" -a "$PS1" ] && echo " ZOLTAN_DIR is initialized to: $ZOLTAN_DIR"
@ -532,8 +544,8 @@ export MPI_BUFFER_SIZE
# Load QT # Load QT
# ~~~~~~~ # ~~~~~~~
[ ! -z "$QT_THIRD_PARTY" ] && [ -e $WM_THIRD_PARTY_DIR/packages/qt-everywhere-opensource-src-4.7.0/platforms/$WM_OPTIONS ] && { [ ! -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.0/platforms/$WM_OPTIONS/etc/qt-everywhere-opensource-src-4.7.0.sh _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" [ "$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 ] && { [ -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 _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" [ "$FOAM_VERBOSE" -a "$PS1" ] && echo " PARAVIEW_DIR is initialized to: $PARAVIEW_DIR"

View file

@ -33,6 +33,10 @@ Contributor
\*---------------------------------------------------------------------------*/ \*---------------------------------------------------------------------------*/
#include <sys/time.h>
#include <sstream>
#include <iomanip>
namespace Foam namespace Foam
{ {
@ -40,13 +44,17 @@ namespace Foam
template<class MasterPatch, class SlavePatch> template<class MasterPatch, class SlavePatch>
template<class Type> template<class Type>
void MixingPlaneInterpolation<MasterPatch, SlavePatch>::toProfile void
MixingPlaneInterpolation<MasterPatch, SlavePatch>::
interpolate
( (
const Field<Type>& srcF, const Field<Type>& srcF,
const labelListList& srcAddr, const labelListList& srcAddr,
const scalarListList& srcWeights, const scalarListList& srcWeights,
Field<Type>& profileBandValues const labelListList& dstAddr,
) const scalarListList& dstWeights,
Field<Type>& dstResultF
) const
{ {
// The src to profile transfer is done using weighted averaging // The src to profile transfer is done using weighted averaging
// evaluation of srcF. // evaluation of srcF.
@ -68,130 +76,118 @@ void MixingPlaneInterpolation<MasterPatch, SlavePatch>::toProfile
// //
// average(phi) == sum(w*phi) // average(phi) == sum(w*phi)
int nbrProfileBands = interpolationProfile_.size() - 1;
List<Type> profileBandValues(nbrProfileBands, pTraits<Type>::zero);
scalarField srcScalingValues(nbrProfileBands, 0.0);
forAll (srcAddr, bandI) forAll (srcAddr, bandI)
{ {
forAll (srcAddr[bandI], faceI) forAll (srcAddr[bandI], faceI)
{ {
profileBandValues[bandI] += profileBandValues[bandI] +=
srcF[srcAddr[bandI][faceI]]*srcWeights[bandI][faceI]; 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<class MasterPatch, class SlavePatch> // profileBandValues are now the circumferentially averaged values
template<class Type>
void MixingPlaneInterpolation<MasterPatch, SlavePatch>::fromProfile // The profile to dst transfer is done by simply distributing the
(
const Field<Type>& profileBandValues,
const labelListList& dstAddr,
const scalarListList& dstWeights,
Field<Type>& dstResultF
)
{
// The profile to dst transfer is done by distributing the
// average value accordingly to the dst weighting factors // average value accordingly to the dst weighting factors
forAll (dstAddr, faceI) forAll (dstAddr, faceI)
{ {
const labelList& curAddr = dstAddr[faceI]; const labelList& curAddr = dstAddr[faceI];
const scalarList& curW = dstWeights[faceI]; const scalarList& curW = dstWeights[faceI];
dstResultF[faceI] = pTraits<Type>::zero;
forAll (curAddr, bandI) forAll (curAddr, bandI)
{ {
dstResultF[faceI] += profileBandValues[curAddr[bandI]]*curW[bandI]; dstResultF[faceI] += profileBandValues[curAddr[bandI]]*curW[bandI];
}
}
}
if (debug <= -200)
template<class MasterPatch, class SlavePatch>
template<class Type>
void MixingPlaneInterpolation<MasterPatch, SlavePatch>::maskedFromProfile
(
const Field<Type>& profileBandValues,
const labelListList& dstAddr,
const scalarListList& dstWeights,
Field<Type>& 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)
{ {
// Pick the masked face Info<< "bande: " << dstAddr[faceI][bandI]
const label faceI = mask[maskI]; << " dst valeur: " << dstResultF[faceI]
<< " dst weight: " << dstWeights[faceI][bandI] << endl;
}
}
}
const labelList& curAddr = dstAddr[faceI]; if (debug <= -500)
const scalarList& curW = dstWeights[faceI];
dstResultF[maskI] = pTraits<Type>::zero;
forAll (curAddr, bandI)
{ {
dstResultF[maskI] += profileBandValues[curAddr[bandI]]*curW[bandI]; error::printStack(Info);
}
}
}
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;
}
template<class MasterPatch, class SlavePatch> if (debug <= -999)
template<class Type>
void MixingPlaneInterpolation<MasterPatch, SlavePatch>::maskedTransform
(
Field<Type>& transField,
const tensorField& t,
const Field<Type>& 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 fileName traceFileDir("./mixingPlaneTraceFiles");
const label faceI = mask[maskI];
transField[maskI] = transform(t[faceI], inField[maskI]); if (!exists(traceFileDir))
{
mkDir(traceFileDir);
} }
}
struct timeval tod;
gettimeofday(&tod, NULL);
template<class MasterPatch, class SlavePatch> //struct timespec tp;
template<class Type> //clock_gettime(CLOCK_MONOTONIC, &tp);
void MixingPlaneInterpolation<MasterPatch, SlavePatch>::interpolate std::ostringstream osBuffer;
(
const Field<Type>& srcF,
const labelListList& srcAddr,
const scalarListList& srcWeights,
const labelListList& dstAddr,
const scalarListList& dstWeights,
Field<Type>& dstResultF
) const
{
Field<Type> profileBandValues(nProfileBands(), pTraits<Type>::zero);
// Interpolate from patch to profile osBuffer
toProfile << 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
( (
srcF, "MixingPlaneInterpolation::interpolate"
srcAddr, ) << "Dumping src profiles to: " << traceFileName + "_orig" << nl
srcWeights, << "Dumping interpolated profiles to : "
profileBandValues << traceFileName + "_interpolated" << nl
); << "Dumping profile values to: "
<< traceFileName + "_profile" << endl;
// profileBandValues are now the circumferentially averaged values dumpFileDst << dstResultF << endl;
dumpFileSrc << srcF << endl;
// Collect from profile to patch dumpFileProfile << profileBandValues << endl;
fromProfile }
(
profileBandValues,
dstAddr,
dstWeights,
dstResultF
);
} }
@ -210,7 +206,7 @@ MixingPlaneInterpolation<MasterPatch, SlavePatch>::masterToSlave
FatalErrorIn FatalErrorIn
( (
"MixingPlaneInterpolation::masterToSlave(" "MixingPlaneInterpolation::masterToSlave("
"const Field<Type> ff) const" "const Field<Type> ff)"
) << "given field does not correspond to patch. Patch size: " ) << "given field does not correspond to patch. Patch size: "
<< masterPatch_.size() << " field size: " << patchFF.size() << masterPatch_.size() << " field size: " << patchFF.size()
<< abort(FatalError); << abort(FatalError);
@ -220,6 +216,16 @@ MixingPlaneInterpolation<MasterPatch, SlavePatch>::masterToSlave
// MB: We need this back // MB: We need this back
Field<Type> profileFF = transform(masterPatchToProfileT(), patchFF); Field<Type> profileFF = transform(masterPatchToProfileT(), patchFF);
if (debug > 1)
{
Info << "MixingPlaneInterpolation<MasterPatch, SlavePatch>::masterToSlave: "
<< "patchFF: " << patchFF << endl
<< "profileFF: " << profileFF << endl
<< "masterPatchToProfileT(): " << masterPatchToProfileT() << endl
<< "slaveProfileToPatchT(): " << slaveProfileToPatchT() << endl
<< endl;
}
// Do interpolation // Do interpolation
tmp<Field<Type> > tresult tmp<Field<Type> > tresult
( (
@ -237,14 +243,14 @@ MixingPlaneInterpolation<MasterPatch, SlavePatch>::masterToSlave
profileFF, // Master data in 'profile space' profileFF, // Master data in 'profile space'
masterPatchToProfileAddr(), // From master: compute the average masterPatchToProfileAddr(), // From master: compute the average
masterPatchToProfileWeights(), masterPatchToProfileWeights(),
slaveProfileToPatchAddr(), // To slave distribute average from slaveProfileToPatchAddr(), // To slave we distribute the average from
slaveProfileToPatchWeights(), // profile to patch slaveProfileToPatchWeights(), // profile to patch
result result
); );
// Apply transform to bring the slave field back from 'profile space' // Apply transform to bring the slave field back from 'profile space'
// to 'patch space' // to 'patch space'
transform(result, slaveProfileToPatchT(), result); transform(result, slaveProfileToPatchT(), result); // MB: We need this back
return tresult; return tresult;
} }
@ -277,7 +283,7 @@ MixingPlaneInterpolation<MasterPatch, SlavePatch>::slaveToMaster
FatalErrorIn FatalErrorIn
( (
"MixingPlaneInterpolation::slaveToMaster(" "MixingPlaneInterpolation::slaveToMaster("
"const Field<Type> ff) const" "const Field<Type> ff)"
) << "given field does not correspond to patch. Patch size: " ) << "given field does not correspond to patch. Patch size: "
<< slavePatch_.size() << " field size: " << patchFF.size() << slavePatch_.size() << " field size: " << patchFF.size()
<< abort(FatalError); << abort(FatalError);
@ -286,6 +292,16 @@ MixingPlaneInterpolation<MasterPatch, SlavePatch>::slaveToMaster
// Move slave data from 'patch space' to 'profile space' // Move slave data from 'patch space' to 'profile space'
Field<Type> profileFF = transform(slavePatchToProfileT(), patchFF); Field<Type> profileFF = transform(slavePatchToProfileT(), patchFF);
if (debug > 1)
{
Info << "MixingPlaneInterpolation<MasterPatch, SlavePatch>::slaveToMaster: "
<< "patchFF: " << patchFF << endl
<< "profileFF: " << profileFF << endl
<< "slavePatchToProfileT(): " << slavePatchToProfileT() << endl
<< "masterProfileToPatchT(): " << masterProfileToPatchT() << endl
<< endl;
}
// Do interpolation // Do interpolation
tmp<Field<Type> > tresult tmp<Field<Type> > tresult
( (
@ -329,334 +345,6 @@ MixingPlaneInterpolation<MasterPatch, SlavePatch>::slaveToMaster
return tint; return tint;
} }
template<class MasterPatch, class SlavePatch>
template<class Type>
tmp<Field<Type> >
MixingPlaneInterpolation<MasterPatch, SlavePatch>::masterToProfile
(
const Field<Type>& patchFF
) const
{
if (patchFF.size() != masterPatch_.size())
{
FatalErrorIn
(
"MixingPlaneInterpolation::masterToProfile("
"const Field<Type> 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<Type> profileFF = transform(masterPatchToProfileT(), patchFF);
// Do interpolation
tmp<Field<Type> > tresult
(
new Field<Type>
(
nProfileBands(),
pTraits<Type>::zero
)
);
Field<Type>& result = tresult();
toProfile
(
profileFF, // Master data in 'profile space'
masterPatchToProfileAddr(), // From master: compute the average
masterPatchToProfileWeights(),
result
);
return tresult;
}
template<class MasterPatch, class SlavePatch>
template<class Type>
tmp<Field<Type> >
MixingPlaneInterpolation<MasterPatch, SlavePatch>::masterToProfile
(
const tmp<Field<Type> >& tff
) const
{
tmp<Field<Type> > tint = masterToProfile(tff());
tff.clear();
return tint;
}
template<class MasterPatch, class SlavePatch>
template<class Type>
tmp<Field<Type> >
MixingPlaneInterpolation<MasterPatch, SlavePatch>::slaveToProfile
(
const Field<Type>& patchFF
) const
{
if (patchFF.size() != slavePatch_.size())
{
FatalErrorIn
(
"MixingPlaneInterpolation::slaveToProfile("
"const Field<Type> 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<Type> profileFF = transform(slavePatchToProfileT(), patchFF);
// Do interpolation
tmp<Field<Type> > tresult
(
new Field<Type>
(
nProfileBands(),
pTraits<Type>::zero
)
);
Field<Type>& result = tresult();
toProfile
(
profileFF, // Slave data in 'profile space'
slavePatchToProfileAddr(), // From slave: compute the average
slavePatchToProfileWeights(),
result
);
return tresult;
}
template<class MasterPatch, class SlavePatch>
template<class Type>
tmp<Field<Type> >
MixingPlaneInterpolation<MasterPatch, SlavePatch>::slaveToProfile
(
const tmp<Field<Type> >& tff
) const
{
tmp<Field<Type> > tint = slaveToProfile(tff());
tff.clear();
return tint;
}
template<class MasterPatch, class SlavePatch>
template<class Type>
tmp<Field<Type> >
MixingPlaneInterpolation<MasterPatch, SlavePatch>::profileToMaster
(
const Field<Type>& profileFF
) const
{
if (profileFF.size() != nProfileBands())
{
FatalErrorIn
(
"MixingPlaneInterpolation::profileToMaster("
"const Field<Type> ff) const"
) << "given field does not correspond to profile. Profile size: "
<< nProfileBands() << " field size: " << profileFF.size()
<< abort(FatalError);
}
// Do interpolation
tmp<Field<Type> > tresult
(
new Field<Type>
(
masterPatch_.size(),
pTraits<Type>::zero
)
);
Field<Type>& 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<class MasterPatch, class SlavePatch>
template<class Type>
tmp<Field<Type> >
MixingPlaneInterpolation<MasterPatch, SlavePatch>::profileToMaster
(
const tmp<Field<Type> >& tff
) const
{
tmp<Field<Type> > tint = profileToMaster(tff());
tff.clear();
return tint;
}
template<class MasterPatch, class SlavePatch>
template<class Type>
void MixingPlaneInterpolation<MasterPatch, SlavePatch>::maskedProfileToMaster
(
const Field<Type>& profileFF,
Field<Type>& result,
const labelList& mask
) const
{
if (profileFF.size() != nProfileBands() || result.size() != mask.size())
{
FatalErrorIn
(
"bvoid MixingPlaneInterpolation<MasterPatch, SlavePatch>::"
"maskedProfileToMaster\n"
"(\n"
" const Field<Type>& profileFF,\n"
" Field<Type>& 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<class MasterPatch, class SlavePatch>
template<class Type>
tmp<Field<Type> >
MixingPlaneInterpolation<MasterPatch, SlavePatch>::profileToSlave
(
const Field<Type>& profileFF
) const
{
if (profileFF.size() != nProfileBands())
{
FatalErrorIn
(
"MixingPlaneInterpolation::profileToSlave("
"const Field<Type> ff) const"
) << "given field does not correspond to profile. Profile size: "
<< nProfileBands() << " field size: " << profileFF.size()
<< abort(FatalError);
}
// Do interpolation
tmp<Field<Type> > tresult
(
new Field<Type>
(
slavePatch_.size(),
pTraits<Type>::zero
)
);
Field<Type>& 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<class MasterPatch, class SlavePatch>
template<class Type>
tmp<Field<Type> >
MixingPlaneInterpolation<MasterPatch, SlavePatch>::profileToSlave
(
const tmp<Field<Type> >& tff
) const
{
tmp<Field<Type> > tint = profileToSlave(tff());
tff.clear();
return tint;
}
template<class MasterPatch, class SlavePatch>
template<class Type>
void MixingPlaneInterpolation<MasterPatch, SlavePatch>::maskedProfileToSlave
(
const Field<Type>& profileFF,
Field<Type>& result,
const labelList& mask
) const
{
if (profileFF.size() != nProfileBands() || result.size() != mask.size())
{
FatalErrorIn
(
"void MixingPlaneInterpolation<MasterPatch, SlavePatch>::"
"maskedProfileToSlave\n"
"(\n"
" const Field<Type>& profileFF,\n"
" Field<Type>& 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<class MasterPatch, class SlavePatch> template<class MasterPatch, class SlavePatch>
template<class Type> template<class Type>
tmp<Field<Type> > tmp<Field<Type> >
@ -679,6 +367,15 @@ MixingPlaneInterpolation<MasterPatch, SlavePatch>::masterToMaster
// Move master data from 'patch space' to 'profile space' // Move master data from 'patch space' to 'profile space'
Field<Type> profileFF = transform(masterPatchToProfileT(), patchFF); Field<Type> profileFF = transform(masterPatchToProfileT(), patchFF);
if (debug > 1)
{
Info << "MixingPlaneInterpolation<MasterPatch, SlavePatch>::masterToMaster: "
<< "patchFF: " << patchFF << endl
<< "profileFF: " << profileFF << endl
<< "masterPatchToProfileT(): " << masterPatchToProfileT() << endl
<< endl;
}
// Do interpolation // Do interpolation
tmp<Field<Type> > tresult tmp<Field<Type> > tresult
( (
@ -708,7 +405,6 @@ MixingPlaneInterpolation<MasterPatch, SlavePatch>::masterToMaster
return tresult; return tresult;
} }
template<class MasterPatch, class SlavePatch> template<class MasterPatch, class SlavePatch>
template<class Type> template<class Type>
tmp<Field<Type> > tmp<Field<Type> >
@ -722,7 +418,6 @@ MixingPlaneInterpolation<MasterPatch, SlavePatch>::masterToMaster
return tint; return tint;
} }
template<class MasterPatch, class SlavePatch> template<class MasterPatch, class SlavePatch>
template<class Type> template<class Type>
tmp<Field<Type> > tmp<Field<Type> >
@ -745,6 +440,15 @@ MixingPlaneInterpolation<MasterPatch, SlavePatch>::slaveToSlave
// Move slave data from 'patch space' to 'profile space' // Move slave data from 'patch space' to 'profile space'
Field<Type> profileFF = transform(slavePatchToProfileT(), patchFF); Field<Type> profileFF = transform(slavePatchToProfileT(), patchFF);
if (debug > 1)
{
Info << "MixingPlaneInterpolation<MasterPatch, SlavePatch>::slaveToSlave: "
<< "patchFF: " << patchFF << endl
<< "profileFF: " << profileFF << endl
<< "slavePatchToProfileT(): " << slavePatchToProfileT() << endl
<< endl;
}
// Do interpolation // Do interpolation
tmp<Field<Type> > tresult tmp<Field<Type> > tresult
( (
@ -774,7 +478,6 @@ MixingPlaneInterpolation<MasterPatch, SlavePatch>::slaveToSlave
return tresult; return tresult;
} }
template<class MasterPatch, class SlavePatch> template<class MasterPatch, class SlavePatch>
template<class Type> template<class Type>
tmp<Field<Type> > tmp<Field<Type> >

View file

@ -29,8 +29,8 @@ Description
Radial basis function interpolation class Radial basis function interpolation class
Description Description
Interpolation class which uses Radial Basis Functions to interpolate Interpolation class which uses Radial Basis Functions to interpolate the
field from given data points to arbitrary set of points. fluid displacements for given boundary displacements.
The coefficient vectors, alpha and beta are determined by solving The coefficient vectors, alpha and beta are determined by solving
the system: the system:
@ -38,17 +38,25 @@ Description
| db | = | Mbb Pb | | alpha | | db | = | Mbb Pb | | alpha |
| 0 | | Pb 0 | | beta | | 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 Mbb the boundary RBF correlation matrix (NbxNb), containing RBF evaluations
at the boundary nodes, and Pb some linear polynomial matrix (Nbx4). at the boundary nodes, and Pb some linear polynomial matrix (Nbx4).
In cases where far field data is not of interest, a cutoff function Those coefficients are calculated every timestep, with the current
is used to eliminate unnecessary data points in the far field 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 Author
Frank Bos, TU Delft. All rights reserved. Frank Bos, TU Delft. All rights reserved.
Dubravko Matijasevic, FSB Zagreb. Dubravko Matijasevic, FSB Zagreb.
Reorganisation by Hrvoje Jasak, Wikki Ltd.
SourceFiles SourceFiles
RBFInterpolation.C RBFInterpolation.C
@ -82,7 +90,7 @@ class RBFInterpolation
const vectorField& controlPoints_; const vectorField& controlPoints_;
//- Reference to all points //- Reference to all points
const vectorField& dataPoints_; const vectorField& allPoints_;
//- RBF function //- RBF function
autoPtr<RBFFunction> RBF_; autoPtr<RBFFunction> RBF_;
@ -128,7 +136,7 @@ public:
( (
const dictionary& dict, const dictionary& dict,
const vectorField& controlPoints, const vectorField& controlPoints,
const vectorField& dataPoints const vectorField& allPoints
); );
//- Construct as copy //- Construct as copy
@ -142,18 +150,6 @@ public:
// Member Functions // Member Functions
//- Return reference to control points
const vectorField& controlPoints() const
{
return controlPoints_;
}
//- Reference to all points
const vectorField& dataPoints() const
{
return dataPoints_;
}
//- Interpolate //- Interpolate
template<class Type> template<class Type>
tmp<Field<Type> > interpolate(const Field<Type>& ctrlField) const; tmp<Field<Type> > interpolate(const Field<Type>& ctrlField) const;