From 427acc84b06a2734fa30a8e0739830a913cf23f3 Mon Sep 17 00:00:00 2001 From: mattijs <mattijs> Date: Mon, 4 Feb 2019 16:39:01 +0000 Subject: [PATCH] COMP: foamVtkTools: template specialization bug in gcc https://gcc.gnu.org/bugzilla/show_bug.cgi?id=56480 --- src/conversion/vtk/adaptor/foamVtkTools.H | 22 +++++++++++++++------- 1 file changed, 15 insertions(+), 7 deletions(-) diff --git a/src/conversion/vtk/adaptor/foamVtkTools.H b/src/conversion/vtk/adaptor/foamVtkTools.H index 91ee3f178bb..935c75801d9 100644 --- a/src/conversion/vtk/adaptor/foamVtkTools.H +++ b/src/conversion/vtk/adaptor/foamVtkTools.H @@ -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 - // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // -- GitLab