Commit da17cf9c authored by mattijs's avatar mattijs

COMP: foamVtkTools: template specialization bug in gcc

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=56480
parent 8b9375d4
......@@ -222,11 +222,19 @@ namespace Tools
template<class Type>
inline static void remapTuple(float data[]) {}
//- Template specialization for symmTensor ordering
template<>
inline void remapTuple<symmTensor>(float data[]);
//- Remapping for some OpenFOAM data types (eg, symmTensor)
// \param data[in,out] The data to be remapped in-place
template<class Type>
inline static void remapTuple(double data[]) {}
//- Template specialization for symmTensor ordering
template<>
inline void remapTuple<symmTensor>(double data[]);
//- Copy/transcribe OpenFOAM data types to VTK format
// This allows a change of data type (float vs double) as well as
// addressing any swapping issues (eg, symmTensor)
......@@ -282,13 +290,18 @@ namespace Tools
const label size
);
};
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace vtk
} // End namespace Foam
// Specializations
//- Template specialization for symmTensor ordering
template<>
inline void Tools::remapTuple<Foam::symmTensor>(float data[])
void Foam::vtk::Tools::remapTuple<Foam::symmTensor>(float data[])
{
std::swap(data[1], data[3]); // swap XY <-> YY
std::swap(data[2], data[5]); // swap XZ <-> ZZ
......@@ -297,18 +310,13 @@ inline void Tools::remapTuple<Foam::symmTensor>(float data[])
//- Template specialization for symmTensor ordering
template<>
inline void Tools::remapTuple<Foam::symmTensor>(double data[])
void Foam::vtk::Tools::remapTuple<Foam::symmTensor>(double data[])
{
std::swap(data[1], data[3]); // swap XY <-> YY
std::swap(data[2], data[5]); // swap XZ <-> ZZ
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace vtk
} // End namespace Foam
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment