layerInfo: Corrected function inlining and contiguous trait

This commit is contained in:
Will Bainbridge
2023-05-09 11:40:11 +01:00
parent d7743bbf01
commit cb610cf060
7 changed files with 58 additions and 12 deletions

View File

@ -171,6 +171,23 @@ public:
);
};
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#define DefineContiguousLayerInfoDataType(Type, nullArg) \
template<> \
inline bool contiguous<LayerInfoData<Type>>() \
{ \
return true; \
}
DefineContiguousLayerInfoDataType(bool, );
DefineContiguousLayerInfoDataType(label, );
FOR_ALL_FIELD_TYPES(DefineContiguousLayerInfoDataType);
#undef DefineContiguousLayerInfoDataType
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace Foam

View File

@ -185,7 +185,7 @@ inline bool Foam::LayerInfoData<Type>::operator!=
// * * * * * * * * * * * * * * * Friend Operators * * * * * * * * * * * * * //
template<class Type>
inline Foam::Ostream& Foam::operator<<
Foam::Ostream& Foam::operator<<
(
Ostream& os,
const LayerInfoData<Type>& l
@ -196,7 +196,7 @@ inline Foam::Ostream& Foam::operator<<
template<class Type>
inline Foam::Istream& Foam::operator>>(Istream& is, LayerInfoData<Type>& l)
Foam::Istream& Foam::operator>>(Istream& is, LayerInfoData<Type>& l)
{
return is >> static_cast<layerInfo&>(l) >> l.data_;
}

View File

@ -177,6 +177,22 @@ public:
};
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#define DefineContiguousPointEdgeLayerInfoDataType(Type, nullArg) \
template<> \
inline bool contiguous<PointEdgeLayerInfoData<Type>>() \
{ \
return true; \
}
DefineContiguousPointEdgeLayerInfoDataType(bool, );
DefineContiguousPointEdgeLayerInfoDataType(label, );
FOR_ALL_FIELD_TYPES(DefineContiguousPointEdgeLayerInfoDataType);
#undef DefineContiguousPointEdgeLayerInfoDataType
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace Foam

View File

@ -205,7 +205,7 @@ inline bool Foam::PointEdgeLayerInfoData<Type>::operator!=
// * * * * * * * * * * * * * * * Friend Operators * * * * * * * * * * * * * //
template<class Type>
inline Foam::Ostream& Foam::operator<<
Foam::Ostream& Foam::operator<<
(
Ostream& os,
const PointEdgeLayerInfoData<Type>& l
@ -220,11 +220,7 @@ inline Foam::Ostream& Foam::operator<<
template<class Type>
inline Foam::Istream& Foam::operator>>
(
Istream& is,
PointEdgeLayerInfoData<Type>& l
)
Foam::Istream& Foam::operator>>(Istream& is, PointEdgeLayerInfoData<Type>& l)
{
return is >> static_cast<pointEdgeLayerInfo&>(l) >> l.data_;
}

View File

@ -181,10 +181,20 @@ public:
// IOstream Operators
friend Ostream& operator<<(Ostream&, const layerInfo&);
friend Istream& operator>>(Istream&, layerInfo&);
inline friend Ostream& operator<<(Ostream&, const layerInfo&);
inline friend Istream& operator>>(Istream&, layerInfo&);
};
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
template<>
inline bool contiguous<layerInfo>()
{
return true;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace Foam

View File

@ -182,7 +182,8 @@ public:
};
//- Data associated with pointEdgeLayerInfo type are contiguous
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
template<>
inline bool contiguous<pointEdgeLayerInfo>()
{

View File

@ -29,11 +29,17 @@ License
#include "FaceCellWave.H"
#include "PointEdgeWave.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
namespace Foam
{
defineTypeNameAndDebug(mappedExtrudedPatchBase, 0);
template<>
inline bool contiguous<LayerInfoData<Pair<vector>>>()
{
return true;
}
}