diff --git a/applications/utilities/mesh/manipulation/setSet/Make/files b/applications/utilities/mesh/manipulation/setSet/Make/files index e6da558d1d..a14c37f5ee 100644 --- a/applications/utilities/mesh/manipulation/setSet/Make/files +++ b/applications/utilities/mesh/manipulation/setSet/Make/files @@ -1,7 +1,5 @@ writePointSet.C -writeFuns.C writePatch.C setSet.C EXE = $(FOAM_APPBIN)/setSet - diff --git a/applications/utilities/mesh/manipulation/setSet/Make/options b/applications/utilities/mesh/manipulation/setSet/Make/options index febadade7b..c0ebea73a0 100644 --- a/applications/utilities/mesh/manipulation/setSet/Make/options +++ b/applications/utilities/mesh/manipulation/setSet/Make/options @@ -1,7 +1,9 @@ EXE_INC = \ -I$(LIB_SRC)/meshTools/lnInclude \ + -I$(LIB_SRC)/fileFormats/lnInclude \ $(COMP_FLAGS) EXE_LIBS = \ -lmeshTools \ + -lfileFormats \ $(LINK_FLAGS) diff --git a/applications/utilities/mesh/manipulation/setSet/setSet.C b/applications/utilities/mesh/manipulation/setSet/setSet.C index 86f4880a6c..2b06872cbe 100644 --- a/applications/utilities/mesh/manipulation/setSet/setSet.C +++ b/applications/utilities/mesh/manipulation/setSet/setSet.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | Website: https://openfoam.org - \\ / A nd | Copyright (C) 2011-2018 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2020 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -92,7 +92,7 @@ void writeVTK primitiveFacePatch fp(setFaces, mesh.points()); - writePatch + vtkWriteOps::writePatch ( true, currentSet.name(), @@ -152,7 +152,7 @@ void writeVTK primitiveFacePatch fp(setFaces, mesh.points()); - writePatch + vtkWriteOps::writePatch ( true, currentSet.name(), @@ -164,7 +164,7 @@ void writeVTK } else if (isA(currentSet)) { - writePointSet + vtkWriteOps::writePointSet ( true, mesh, diff --git a/applications/utilities/mesh/manipulation/setSet/writeFuns.C b/applications/utilities/mesh/manipulation/setSet/writeFuns.C deleted file mode 100644 index 2be87a5bbd..0000000000 --- a/applications/utilities/mesh/manipulation/setSet/writeFuns.C +++ /dev/null @@ -1,240 +0,0 @@ -/*---------------------------------------------------------------------------*\ - ========= | - \\ / F ield | OpenFOAM: The Open Source CFD Toolbox - \\ / O peration | Website: https://openfoam.org - \\ / A nd | Copyright (C) 2011-2018 OpenFOAM Foundation - \\/ M anipulation | -------------------------------------------------------------------------------- -License - This file is part of OpenFOAM. - - OpenFOAM is free software: you can redistribute it and/or modify it - under the terms of the GNU General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - OpenFOAM is distributed in the hope that it will be useful, but WITHOUT - ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - for more details. - - You should have received a copy of the GNU General Public License - along with OpenFOAM. If not, see . - -\*---------------------------------------------------------------------------*/ - -#include "writeFuns.H" - -#if defined(__mips) - #include - #include -#endif - -#if defined(LITTLE_ENDIAN) \ - || defined(_LITTLE_ENDIAN) \ - || defined(__LITTLE_ENDIAN) - #define LITTLEENDIAN 1 -#elif defined(BIG_ENDIAN) || defined(_BIG_ENDIAN) || defined(__BIG_ENDIAN) - #undef LITTLEENDIAN -#else - #error "Cannot find LITTLE_ENDIAN or BIG_ENDIAN symbol defined." - #error "Please add to compilation options" -#endif - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -void Foam::writeFuns::swapWord(int32_t& word32) -{ - char* mem = reinterpret_cast(&word32); - - char a = mem[0]; - mem[0] = mem[3]; - mem[3] = a; - - a = mem[1]; - mem[1] = mem[2]; - mem[2] = a; -} - - -void Foam::writeFuns::swapWords(const label nWords, int32_t* words32) -{ - for (label i=0; i& fField -) -{ - if (binary) - { - #ifdef LITTLEENDIAN - swapWords(fField.size(), reinterpret_cast(fField.begin())); - #endif - - os.write - ( - reinterpret_cast(fField.begin()), - fField.size()*sizeof(float) - ); - - os << std::endl; - } - else - { - forAll(fField, i) - { - os << fField[i] << ' '; - - if (i > 0 && (i % 10) == 0) - { - os << std::endl; - } - } - os << std::endl; - } -} - - -void Foam::writeFuns::write -( - std::ostream& os, - const bool binary, - DynamicList& fField -) -{ - List& fld = fField.shrink(); - write(os, binary, fld); -} - - -void Foam::writeFuns::write -( - std::ostream& os, - const bool binary, - labelList& elems -) -{ - if (binary) - { - #ifdef LITTLEENDIAN - swapWords - ( - (sizeof(label)/4)*elems.size(), - reinterpret_cast(elems.begin()) - ); - #endif - os.write - ( - reinterpret_cast(elems.begin()), - elems.size()*sizeof(label) - ); - - os << std::endl; - } - else - { - forAll(elems, i) - { - os << elems[i] << ' '; - - if (i > 0 && (i % 10) == 0) - { - os << std::endl; - } - } - os << std::endl; - } -} - - -void Foam::writeFuns::write -( - std::ostream& os, - const bool binary, - DynamicList