ENH: accessOp: move to classes

This commit is contained in:
mattijs
2012-04-02 11:52:58 +01:00
parent 2ff62ebccd
commit 374babde39
6 changed files with 63 additions and 63 deletions

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
@ -106,6 +106,7 @@ AccessType ListListOps::combineOffset
return result;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace Foam

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
@ -92,10 +92,8 @@ SourceFiles
namespace Foam
{
//
//template <class T> class accessOp;
//template <class T> class offsetOp;
// Dummy access operator for combine()
// Dummy access operator for ListListOps::combine()
template <class T>
class accessOp
{
@ -108,7 +106,7 @@ public:
};
// Offset operator for combineOffset()
// Offset operator for ListListOps::combineOffset()
template <class T>
class offsetOp
{

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
@ -50,6 +50,7 @@ SourceFiles
#include "faceListFwd.H"
#include "intersection.H"
#include "pointHit.H"
#include "ListListOps.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
@ -386,6 +387,30 @@ public:
};
//- Hash specialization to offset faces in ListListOps::combineOffset
template<>
class offsetOp<face>
{
public:
inline face operator()
(
const face& x,
const label offset
) const
{
face result(x.size());
forAll(x, xI)
{
result[xI] = x[xI] + offset;
}
return result;
}
};
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace Foam

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
@ -46,6 +46,7 @@ SourceFiles
#include "intersection.H"
#include "pointField.H"
#include "triPointRef.H"
#include "ListListOps.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
@ -249,6 +250,30 @@ template<>
inline bool contiguous<triFace>() {return true;}
//- Hash specialization to offset faces in ListListOps::combineOffset
template<>
class offsetOp<triFace>
{
public:
inline triFace operator()
(
const triFace& x,
const label offset
) const
{
triFace result(x);
forAll(x, xI)
{
result[xI] = x[xI] + offset;
}
return result;
}
};
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace Foam

View File

@ -28,58 +28,7 @@ License
#include "mergePoints.H"
#include "face.H"
#include "triFace.H"
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
namespace Foam
{
//- Used to offset faces in Pstream::combineOffset
template<>
class offsetOp<face>
{
public:
face operator()
(
const face& x,
const label offset
) const
{
face result(x.size());
forAll(x, xI)
{
result[xI] = x[xI] + offset;
}
return result;
}
};
//- Used to offset faces in Pstream::combineOffset
template<>
class offsetOp<triFace>
{
public:
triFace operator()
(
const triFace& x,
const label offset
) const
{
triFace result(x);
forAll(x, xI)
{
result[xI] = x[xI] + offset;
}
return result;
}
};
}
#include "ListListOps.H"
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //

View File

@ -36,6 +36,7 @@ SourceFiles
#define labelledTri_H
#include "triFace.H"
#include "ListListOps.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
@ -114,14 +115,15 @@ public:
template<>
inline bool contiguous<labelledTri>() {return true;}
//- Used to offset faces in ListListOps::combineOffset
//- Hash specialization to offset faces in ListListOps::combineOffset
template<>
class offsetOp<labelledTri>
{
public:
labelledTri operator()
inline labelledTri operator()
(
const labelledTri& x,
const label offset