ENH: labelledTri: specialisation for offsetOp

This commit is contained in:
mattijs
2012-04-02 10:47:50 +01:00
parent f42be0fb42
commit 13b90eb6ac

View File

@ -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
@ -114,6 +114,29 @@ public:
template<>
inline bool contiguous<labelledTri>() {return true;}
//- Used to offset faces in ListListOps::combineOffset
template<>
class offsetOp<labelledTri>
{
public:
labelledTri operator()
(
const labelledTri& x,
const label offset
) const
{
labelledTri result(x);
forAll(x, xI)
{
result[xI] = x[xI] + offset;
}
return result;
}
};
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //