Skip to content

Commit

Permalink
Merge branch 'master' of github.com:OpenFOAM/OpenFOAM-2.1.x
Browse files Browse the repository at this point in the history
  • Loading branch information
mattijs committed May 14, 2012
2 parents 2cb27cc + f1044c8 commit 03c0f35
Show file tree
Hide file tree
Showing 7 changed files with 63 additions and 63 deletions.
Expand Up @@ -239,7 +239,7 @@ void Foam::SurfaceFilmModel<CloudType>::cacheFilmFields

diameterParcelPatch_ =
filmModel.cloudDiameterTrans().boundaryField()[filmPatchI];
filmModel.toPrimary(filmPatchI, diameterParcelPatch_, maxOp<scalar>());
filmModel.toPrimary(filmPatchI, diameterParcelPatch_, maxEqOp<scalar>());

UFilmPatch_ = filmModel.Us().boundaryField()[filmPatchI];
filmModel.toPrimary(filmPatchI, UFilmPatch_);
Expand Down
56 changes: 28 additions & 28 deletions src/meshTools/AMIInterpolation/AMIInterpolation/AMIInterpolation.C
Expand Up @@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
Expand Down Expand Up @@ -33,16 +33,16 @@ License
namespace Foam
{
//- Combine operator for interpolateToSource/Target
template<class Type, class BinaryOp>
template<class Type, class CombineOp>
class combineBinaryOp
{
const BinaryOp& bop_;
const CombineOp& cop_;

public:

combineBinaryOp(const BinaryOp& bop)
combineBinaryOp(const CombineOp& cop)
:
bop_(bop)
cop_(cop)
{}

void operator()
Expand All @@ -53,7 +53,7 @@ namespace Foam
const scalar weight
) const
{
x = bop_(x, weight*y);
cop_(x, weight*y);
}
};
}
Expand Down Expand Up @@ -1862,7 +1862,7 @@ template<class Type, class CombineOp>
void Foam::AMIInterpolation<SourcePatch, TargetPatch>::interpolateToTarget
(
const UList<Type>& fld,
const CombineOp& bop,
const CombineOp& cop,
List<Type>& result
) const
{
Expand Down Expand Up @@ -1894,7 +1894,7 @@ void Foam::AMIInterpolation<SourcePatch, TargetPatch>::interpolateToTarget

forAll(faces, i)
{
bop(result[faceI], faceI, work[faces[i]], weights[i]);
cop(result[faceI], faceI, work[faces[i]], weights[i]);
}
}
}
Expand All @@ -1907,7 +1907,7 @@ void Foam::AMIInterpolation<SourcePatch, TargetPatch>::interpolateToTarget

forAll(faces, i)
{
bop(result[faceI], faceI, fld[faces[i]], weights[i]);
cop(result[faceI], faceI, fld[faces[i]], weights[i]);
}
}
}
Expand All @@ -1919,7 +1919,7 @@ template<class Type, class CombineOp>
void Foam::AMIInterpolation<SourcePatch, TargetPatch>::interpolateToSource
(
const UList<Type>& fld,
const CombineOp& bop,
const CombineOp& cop,
List<Type>& result
) const
{
Expand Down Expand Up @@ -1951,7 +1951,7 @@ void Foam::AMIInterpolation<SourcePatch, TargetPatch>::interpolateToSource

forAll(faces, i)
{
bop(result[faceI], faceI, work[faces[i]], weights[i]);
cop(result[faceI], faceI, work[faces[i]], weights[i]);
}
}
}
Expand All @@ -1964,20 +1964,20 @@ void Foam::AMIInterpolation<SourcePatch, TargetPatch>::interpolateToSource

forAll(faces, i)
{
bop(result[faceI], faceI, fld[faces[i]], weights[i]);
cop(result[faceI], faceI, fld[faces[i]], weights[i]);
}
}
}
}


template<class SourcePatch, class TargetPatch>
template<class Type, class BinaryOp>
template<class Type, class CombineOp>
Foam::tmp<Foam::Field<Type> >
Foam::AMIInterpolation<SourcePatch, TargetPatch>::interpolateToSource
(
const Field<Type>& fld,
const BinaryOp& bop
const CombineOp& cop
) const
{
tmp<Field<Type> > tresult
Expand All @@ -1989,32 +1989,32 @@ Foam::AMIInterpolation<SourcePatch, TargetPatch>::interpolateToSource
)
);

interpolateToSource(fld, combineBinaryOp<Type, BinaryOp>(bop), tresult());
interpolateToSource(fld, combineBinaryOp<Type, CombineOp>(cop), tresult());

return tresult;
}


template<class SourcePatch, class TargetPatch>
template<class Type, class BinaryOp>
template<class Type, class CombineOp>
Foam::tmp<Foam::Field<Type> >
Foam::AMIInterpolation<SourcePatch, TargetPatch>::interpolateToSource
(
const tmp<Field<Type> >& tFld,
const BinaryOp& bop
const CombineOp& cop
) const
{
return interpolateToSource(tFld(), bop);
return interpolateToSource(tFld(), cop);
}


template<class SourcePatch, class TargetPatch>
template<class Type, class BinaryOp>
template<class Type, class CombineOp>
Foam::tmp<Foam::Field<Type> >
Foam::AMIInterpolation<SourcePatch, TargetPatch>::interpolateToTarget
(
const Field<Type>& fld,
const BinaryOp& bop
const CombineOp& cop
) const
{
tmp<Field<Type> > tresult
Expand All @@ -2026,22 +2026,22 @@ Foam::AMIInterpolation<SourcePatch, TargetPatch>::interpolateToTarget
)
);

interpolateToTarget(fld, combineBinaryOp<Type, BinaryOp>(bop), tresult());
interpolateToTarget(fld, combineBinaryOp<Type, CombineOp>(cop), tresult());

return tresult;
}


template<class SourcePatch, class TargetPatch>
template<class Type, class BinaryOp>
template<class Type, class CombineOp>
Foam::tmp<Foam::Field<Type> >
Foam::AMIInterpolation<SourcePatch, TargetPatch>::interpolateToTarget
(
const tmp<Field<Type> >& tFld,
const BinaryOp& bop
const CombineOp& cop
) const
{
return interpolateToTarget(tFld(), bop);
return interpolateToTarget(tFld(), cop);
}


Expand All @@ -2053,7 +2053,7 @@ Foam::AMIInterpolation<SourcePatch, TargetPatch>::interpolateToSource
const Field<Type>& fld
) const
{
return interpolateToSource(fld, sumOp<Type>());
return interpolateToSource(fld, plusEqOp<Type>());
}


Expand All @@ -2065,7 +2065,7 @@ Foam::AMIInterpolation<SourcePatch, TargetPatch>::interpolateToSource
const tmp<Field<Type> >& tFld
) const
{
return interpolateToSource(tFld(), sumOp<Type>());
return interpolateToSource(tFld(), plusEqOp<Type>());
}


Expand All @@ -2077,7 +2077,7 @@ Foam::AMIInterpolation<SourcePatch, TargetPatch>::interpolateToTarget
const Field<Type>& fld
) const
{
return interpolateToTarget(fld, sumOp<Type>());
return interpolateToTarget(fld, plusEqOp<Type>());
}


Expand All @@ -2089,7 +2089,7 @@ Foam::AMIInterpolation<SourcePatch, TargetPatch>::interpolateToTarget
const tmp<Field<Type> >& tFld
) const
{
return interpolateToTarget(tFld(), sumOp<Type>());
return interpolateToTarget(tFld(), plusEqOp<Type>());
}


Expand Down
Expand Up @@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
Expand Down Expand Up @@ -448,36 +448,36 @@ public:


//- Interpolate from target to source with supplied binary op
template<class Type, class BinaryOp>
template<class Type, class CombineOp>
tmp<Field<Type> > interpolateToSource
(
const Field<Type>& fld,
const BinaryOp& bop
const CombineOp& cop
) const;

//- Interpolate from target tmp field to source with supplied
// binary op
template<class Type, class BinaryOp>
template<class Type, class CombineOp>
tmp<Field<Type> > interpolateToSource
(
const tmp<Field<Type> >& tFld,
const BinaryOp& bop
const CombineOp& cop
) const;

//- Interpolate from source to target with supplied op
template<class Type, class BinaryOp>
template<class Type, class CombineOp>
tmp<Field<Type> > interpolateToTarget
(
const Field<Type>& fld,
const BinaryOp& bop
const CombineOp& cop
) const;

//- Interpolate from source tmp field to target with supplied op
template<class Type, class BinaryOp>
template<class Type, class CombineOp>
tmp<Field<Type> > interpolateToTarget
(
const tmp<Field<Type> >& tFld,
const BinaryOp& bop
const CombineOp& cop
) const;

//- Interpolate from target to source
Expand Down
8 changes: 4 additions & 4 deletions src/meshTools/mappedPatches/mappedPolyPatch/mappedPatchBase.H
Expand Up @@ -353,16 +353,16 @@ public:
void distribute(List<Type>& lst) const;

//- Wrapper around map/interpolate data distribution with operation
template<class Type, class BinaryOp>
void distribute(List<Type>& lst, const BinaryOp& bop) const;
template<class Type, class CombineOp>
void distribute(List<Type>& lst, const CombineOp& cop) const;

//- Wrapper around map/interpolate data distribution
template<class Type>
void reverseDistribute(List<Type>& lst) const;

//- Wrapper around map/interpolate data distribution with operation
template<class Type, class BinaryOp>
void reverseDistribute(List<Type>& lst, const BinaryOp& bop) const;
template<class Type, class CombineOp>
void reverseDistribute(List<Type>& lst, const CombineOp& cop) const;


// I/O
Expand Down
Expand Up @@ -41,11 +41,11 @@ void Foam::mappedPatchBase::distribute(List<Type>& lst) const
}


template<class Type, class BinaryOp>
template<class Type, class CombineOp>
void Foam::mappedPatchBase::distribute
(
List<Type>& lst,
const BinaryOp& bop
const CombineOp& cop
) const
{
switch (mode_)
Expand All @@ -55,7 +55,7 @@ void Foam::mappedPatchBase::distribute
lst = AMI().interpolateToSource
(
Field<Type>(lst.xfer()),
bop
cop
);
break;
}
Expand All @@ -69,7 +69,7 @@ void Foam::mappedPatchBase::distribute
map().subMap(),
map().constructMap(),
lst,
bop,
cop,
pTraits<Type>::zero
);
}
Expand All @@ -96,11 +96,11 @@ void Foam::mappedPatchBase::reverseDistribute(List<Type>& lst) const
}


template<class Type, class BinaryOp>
template<class Type, class CombineOp>
void Foam::mappedPatchBase::reverseDistribute
(
List<Type>& lst,
const BinaryOp& bop
const CombineOp& cop
) const
{
switch (mode_)
Expand All @@ -110,7 +110,7 @@ void Foam::mappedPatchBase::reverseDistribute
lst = AMI().interpolateToTarget
(
Field<Type>(lst.xfer()),
bop
cop
);
break;
}
Expand All @@ -125,7 +125,7 @@ void Foam::mappedPatchBase::reverseDistribute
map().constructMap(),
map().subMap(),
lst,
bop,
cop,
pTraits<Type>::zero
);
break;
Expand Down
10 changes: 5 additions & 5 deletions src/regionModels/regionModel/regionModel/regionModel.H
Expand Up @@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
Expand Down Expand Up @@ -236,21 +236,21 @@ public:
) const;

//- Convert a local region field to the primary region with op
template<class Type, class BinaryOp>
template<class Type, class CombineOp>
void toPrimary
(
const label regionPatchI,
List<Type>& regionField,
const BinaryOp& bop
const CombineOp& cop
) const;

//- Convert a primary region field to the local region with op
template<class Type, class BinaryOp>
template<class Type, class CombineOp>
void toRegion
(
const label regionPatchI,
List<Type>& primaryFieldField,
const BinaryOp& bop
const CombineOp& cop
) const;


Expand Down

0 comments on commit 03c0f35

Please sign in to comment.