From 29cf5c8eb2db83a86bfda4ab0ab5c9e437302160 Mon Sep 17 00:00:00 2001 From: andy Date: Tue, 20 May 2008 12:11:07 +0100 Subject: [PATCH] adding components utility --- .../Field/components/Make/files | 3 + .../Field/components/Make/options | 6 + .../Field/components/components.C | 142 ++++++++++++++++++ 3 files changed, 151 insertions(+) create mode 100644 applications/utilities/postProcessing/Field/components/Make/files create mode 100644 applications/utilities/postProcessing/Field/components/Make/options create mode 100644 applications/utilities/postProcessing/Field/components/components.C diff --git a/applications/utilities/postProcessing/Field/components/Make/files b/applications/utilities/postProcessing/Field/components/Make/files new file mode 100644 index 0000000000..1f61233dd1 --- /dev/null +++ b/applications/utilities/postProcessing/Field/components/Make/files @@ -0,0 +1,3 @@ +components.C + +EXE = $(FOAM_APPBIN)/components diff --git a/applications/utilities/postProcessing/Field/components/Make/options b/applications/utilities/postProcessing/Field/components/Make/options new file mode 100644 index 0000000000..be7f7d631d --- /dev/null +++ b/applications/utilities/postProcessing/Field/components/Make/options @@ -0,0 +1,6 @@ +EXE_INC = \ + -I$(LIB_SRC)/finiteVolume/lnInclude + +EXE_LIBS = \ + -lfiniteVolume \ + diff --git a/applications/utilities/postProcessing/Field/components/components.C b/applications/utilities/postProcessing/Field/components/components.C new file mode 100644 index 0000000000..354d70c3e5 --- /dev/null +++ b/applications/utilities/postProcessing/Field/components/components.C @@ -0,0 +1,142 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 1991-2007 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 + components + +Description + Writes scalar fields corresponding to each component of the supplied + field (name) for each time. + +\*---------------------------------------------------------------------------*/ + +#include "fvCFD.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +template +void writeComponents +( + const IOobject& header, + const fvMesh& mesh, + bool& processed +) +{ + typedef GeometricField fieldType; + + if (header.headerClassName() == fieldType::typeName) + { + Info<< " Reading " << header.name() << endl; + fieldType field(header, mesh); + + for (direction i=0; i