From afeb6029125772d2b3d2e9895389f9d5ef381d8d Mon Sep 17 00:00:00 2001 From: mattijs Date: Mon, 2 Nov 2009 08:47:15 +0000 Subject: [PATCH 1/4] revert to normal HashTable --- src/edgeMesh/edgeMesh.C | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/src/edgeMesh/edgeMesh.C b/src/edgeMesh/edgeMesh.C index 6a3933c84f..d39810a62d 100644 --- a/src/edgeMesh/edgeMesh.C +++ b/src/edgeMesh/edgeMesh.C @@ -26,9 +26,6 @@ License #include "edgeMesh.H" #include "mergePoints.H" -#include "StaticHashTable.H" - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // // * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * // @@ -204,7 +201,7 @@ void Foam::edgeMesh::mergePoints(const scalar mergeDist) } // Compact using a hashtable and commutative hash of edge. - StaticHashTable > edgeToLabel + HashTable > edgeToLabel ( 2*edges_.size() ); @@ -228,7 +225,7 @@ void Foam::edgeMesh::mergePoints(const scalar mergeDist) for ( - StaticHashTable >::const_iterator iter = + HashTable >::const_iterator iter = edgeToLabel.begin(); iter != edgeToLabel.end(); ++iter From ba1422df46da6feb5df622d7f2158c7dd584a256 Mon Sep 17 00:00:00 2001 From: mattijs Date: Mon, 2 Nov 2009 13:30:36 +0000 Subject: [PATCH 2/4] Tecplot360 writer --- .../dataConversion/foamToTecplot360/Allwmake | 6 + .../foamToTecplot360/Make/files | 5 + .../foamToTecplot360/Make/options | 14 + .../foamToTecplot360/foamToTecplot360.C | 1325 +++++++++++++++++ .../foamToTecplot360/readFields.C | 87 ++ .../foamToTecplot360/readFields.H | 71 + .../foamToTecplot360/tecplotWriter.C | 517 +++++++ .../foamToTecplot360/tecplotWriter.H | 179 +++ .../foamToTecplot360/tecplotWriterTemplates.C | 199 +++ .../dataConversion/foamToTecplot360/vtkMesh.C | 84 ++ .../dataConversion/foamToTecplot360/vtkMesh.H | 179 +++ 11 files changed, 2666 insertions(+) create mode 100755 applications/utilities/postProcessing/dataConversion/foamToTecplot360/Allwmake create mode 100644 applications/utilities/postProcessing/dataConversion/foamToTecplot360/Make/files create mode 100644 applications/utilities/postProcessing/dataConversion/foamToTecplot360/Make/options create mode 100644 applications/utilities/postProcessing/dataConversion/foamToTecplot360/foamToTecplot360.C create mode 100644 applications/utilities/postProcessing/dataConversion/foamToTecplot360/readFields.C create mode 100644 applications/utilities/postProcessing/dataConversion/foamToTecplot360/readFields.H create mode 100644 applications/utilities/postProcessing/dataConversion/foamToTecplot360/tecplotWriter.C create mode 100644 applications/utilities/postProcessing/dataConversion/foamToTecplot360/tecplotWriter.H create mode 100644 applications/utilities/postProcessing/dataConversion/foamToTecplot360/tecplotWriterTemplates.C create mode 100644 applications/utilities/postProcessing/dataConversion/foamToTecplot360/vtkMesh.C create mode 100644 applications/utilities/postProcessing/dataConversion/foamToTecplot360/vtkMesh.H diff --git a/applications/utilities/postProcessing/dataConversion/foamToTecplot360/Allwmake b/applications/utilities/postProcessing/dataConversion/foamToTecplot360/Allwmake new file mode 100755 index 0000000000..5866aa8f37 --- /dev/null +++ b/applications/utilities/postProcessing/dataConversion/foamToTecplot360/Allwmake @@ -0,0 +1,6 @@ +#!/bin/sh + +if [ "$TEC_360_2009" ] +then + wmake +fi diff --git a/applications/utilities/postProcessing/dataConversion/foamToTecplot360/Make/files b/applications/utilities/postProcessing/dataConversion/foamToTecplot360/Make/files new file mode 100644 index 0000000000..270e84931b --- /dev/null +++ b/applications/utilities/postProcessing/dataConversion/foamToTecplot360/Make/files @@ -0,0 +1,5 @@ +tecplotWriter.C +vtkMesh.C +foamToTecplot360.C + +EXE = $(FOAM_APPBIN)/foamToTecplot360 diff --git a/applications/utilities/postProcessing/dataConversion/foamToTecplot360/Make/options b/applications/utilities/postProcessing/dataConversion/foamToTecplot360/Make/options new file mode 100644 index 0000000000..d03f44ae8c --- /dev/null +++ b/applications/utilities/postProcessing/dataConversion/foamToTecplot360/Make/options @@ -0,0 +1,14 @@ +EXE_INC = \ + -I$(TEC_360_2009)/include \ + /* -I../tecio/tecsrc/lnInclude/ */ \ + -I$(LIB_SRC)/lagrangian/basic/lnInclude \ + -I$(LIB_SRC)/finiteVolume/lnInclude \ + -I$(LIB_SRC)/meshTools/lnInclude + + +EXE_LIBS = \ + $(TEC_360_2009)/lib/tecio64.a \ + /* -L$(FOAM_USER_LIBBIN) -ltecio */ \ + -llagrangian \ + -lfiniteVolume \ + -lmeshTools diff --git a/applications/utilities/postProcessing/dataConversion/foamToTecplot360/foamToTecplot360.C b/applications/utilities/postProcessing/dataConversion/foamToTecplot360/foamToTecplot360.C new file mode 100644 index 0000000000..6e8cf99533 --- /dev/null +++ b/applications/utilities/postProcessing/dataConversion/foamToTecplot360/foamToTecplot360.C @@ -0,0 +1,1325 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 1991-2009 OpenCFD Ltd. + \\/ 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 2 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, write to the Free Software Foundation, + Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + +Application + foamToTecplot-bin + +Description + Tecplot binary file format writer. + +Usage + + - foamToTecplot-bin [OPTION] + +\*---------------------------------------------------------------------------*/ + +#include "pointMesh.H" +#include "volPointInterpolation.H" +#include "emptyPolyPatch.H" +#include "labelIOField.H" +#include "scalarIOField.H" +#include "sphericalTensorIOField.H" +#include "symmTensorIOField.H" +#include "tensorIOField.H" +#include "passiveParticleCloud.H" +#include "faceSet.H" +#include "stringListOps.H" +#include "wordRe.H" + +#include "vtkMesh.H" +#include "readFields.H" +#include "tecplotWriter.H" + +#include "TECIO.h" + +// Note: needs to be after TECIO to prevent Foam::Time conflicting with +// Xlib Time. +#include "fvCFD.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +template +void print(const char* msg, Ostream& os, const PtrList& flds) +{ + if (flds.size()) + { + os << msg; + forAll(flds, i) + { + os<< ' ' << flds[i].name(); + } + os << endl; + } +} + + +void print(Ostream& os, const wordList& flds) +{ + forAll(flds, i) + { + os<< ' ' << flds[i]; + } + os << endl; +} + + +labelList getSelectedPatches +( + const polyBoundaryMesh& patches, + const List& excludePatches //HashSet& excludePatches +) +{ + DynamicList