diff --git a/applications/utilities/postProcessing/sampling/sample/FoamX/axis.cfg b/applications/utilities/postProcessing/sampling/sample/FoamX/axis.cfg deleted file mode 100644 index 8657f923a9..0000000000 --- a/applications/utilities/postProcessing/sampling/sample/FoamX/axis.cfg +++ /dev/null @@ -1,24 +0,0 @@ -/*---------------------------------------------------------------------------*\ -| ========= | | -| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | -| \\ / O peration | Version: 1.0 | -| \\ / A nd | Web: http://www.openfoam.org | -| \\/ M anipulation | | -\*---------------------------------------------------------------------------*/ - -axis -{ - type word; - description "Form of distance data"; - default distance; - valueList - ( - distance - x - y - z - xyz - ); -} - -// ************************************************************************* // diff --git a/applications/utilities/postProcessing/sampling/sample/FoamX/cloud.cfg b/applications/utilities/postProcessing/sampling/sample/FoamX/cloud.cfg deleted file mode 100644 index 89c304e331..0000000000 --- a/applications/utilities/postProcessing/sampling/sample/FoamX/cloud.cfg +++ /dev/null @@ -1,21 +0,0 @@ -/*---------------------------------------------------------------------------*\ -| ========= | | -| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | -| \\ / O peration | Version: 1.0 | -| \\ / A nd | Web: http://www.openfoam.org | -| \\/ M anipulation | | -\*---------------------------------------------------------------------------*/ - -cloud -{ - type dictionary; - description "Samples a set of specified points"; - entries - { - include "name.cfg"; - include "axis.cfg"; - include "points.cfg"; - } -} - -// ************************************************************************* // diff --git a/applications/utilities/postProcessing/sampling/sample/FoamX/curve.cfg b/applications/utilities/postProcessing/sampling/sample/FoamX/curve.cfg deleted file mode 100644 index 4f70749663..0000000000 --- a/applications/utilities/postProcessing/sampling/sample/FoamX/curve.cfg +++ /dev/null @@ -1,21 +0,0 @@ -/*---------------------------------------------------------------------------*\ -| ========= | | -| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | -| \\ / O peration | Version: 1.0 | -| \\ / A nd | Web: http://www.openfoam.org | -| \\/ M anipulation | | -\*---------------------------------------------------------------------------*/ - -curve -{ - type dictionary; - description "Samples a set of specified points that are tracked along a curve"; - entries - { - include "name.cfg"; - include "axis.cfg"; - include "points.cfg"; - } -} - -// ************************************************************************* // diff --git a/applications/utilities/postProcessing/sampling/sample/FoamX/end.cfg b/applications/utilities/postProcessing/sampling/sample/FoamX/end.cfg deleted file mode 100644 index 5d2c5b6d05..0000000000 --- a/applications/utilities/postProcessing/sampling/sample/FoamX/end.cfg +++ /dev/null @@ -1,15 +0,0 @@ -/*---------------------------------------------------------------------------*\ -| ========= | | -| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | -| \\ / O peration | Version: 1.0 | -| \\ / A nd | Web: http://www.openfoam.org | -| \\/ M anipulation | | -\*---------------------------------------------------------------------------*/ - -end -{ - type vector; - description "End point on sampling line"; -} - -// ************************************************************************* // diff --git a/applications/utilities/postProcessing/sampling/sample/FoamX/face.cfg b/applications/utilities/postProcessing/sampling/sample/FoamX/face.cfg deleted file mode 100644 index d00a4a76c4..0000000000 --- a/applications/utilities/postProcessing/sampling/sample/FoamX/face.cfg +++ /dev/null @@ -1,22 +0,0 @@ -/*---------------------------------------------------------------------------*\ -| ========= | | -| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | -| \\ / O peration | Version: 1.0 | -| \\ / A nd | Web: http://www.openfoam.org | -| \\/ M anipulation | | -\*---------------------------------------------------------------------------*/ - -face -{ - type dictionary; - description "One sampling point per face intersection"; - entries - { - include "name.cfg"; - include "axis.cfg"; - include "start.cfg"; - include "end.cfg"; - } -} - -// ************************************************************************* // diff --git a/applications/utilities/postProcessing/sampling/sample/FoamX/midPoint.cfg b/applications/utilities/postProcessing/sampling/sample/FoamX/midPoint.cfg deleted file mode 100644 index 5930161b49..0000000000 --- a/applications/utilities/postProcessing/sampling/sample/FoamX/midPoint.cfg +++ /dev/null @@ -1,22 +0,0 @@ -/*---------------------------------------------------------------------------*\ -| ========= | | -| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | -| \\ / O peration | Version: 1.0 | -| \\ / A nd | Web: http://www.openfoam.org | -| \\/ M anipulation | | -\*---------------------------------------------------------------------------*/ - -midPoint -{ - type dictionary; - description "One sampling point per cell, between two face intersections"; - entries - { - include "name.cfg"; - include "axis.cfg"; - include "start.cfg"; - include "end.cfg"; - } -} - -// ************************************************************************* // diff --git a/applications/utilities/postProcessing/sampling/sample/FoamX/midPointAndFace.cfg b/applications/utilities/postProcessing/sampling/sample/FoamX/midPointAndFace.cfg deleted file mode 100644 index bb492b5c18..0000000000 --- a/applications/utilities/postProcessing/sampling/sample/FoamX/midPointAndFace.cfg +++ /dev/null @@ -1,22 +0,0 @@ -/*---------------------------------------------------------------------------*\ -| ========= | | -| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | -| \\ / O peration | Version: 1.0 | -| \\ / A nd | Web: http://www.openfoam.org | -| \\/ M anipulation | | -\*---------------------------------------------------------------------------*/ - -midPointAndFace -{ - type dictionary; - description "One sampling point per intersected face and one per cell, between two face intersections"; - entries - { - include "name.cfg"; - include "axis.cfg"; - include "start.cfg"; - include "end.cfg"; - } -} - -// ************************************************************************* // diff --git a/applications/utilities/postProcessing/sampling/sample/FoamX/nPoints.cfg b/applications/utilities/postProcessing/sampling/sample/FoamX/nPoints.cfg deleted file mode 100644 index aba1b8a868..0000000000 --- a/applications/utilities/postProcessing/sampling/sample/FoamX/nPoints.cfg +++ /dev/null @@ -1,15 +0,0 @@ -/*---------------------------------------------------------------------------*\ -| ========= | | -| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | -| \\ / O peration | Version: 1.0 | -| \\ / A nd | Web: http://www.openfoam.org | -| \\/ M anipulation | | -\*---------------------------------------------------------------------------*/ - -nPoints -{ - type label; - description "Number of points on sampling line"; -} - -// ************************************************************************* // diff --git a/applications/utilities/postProcessing/sampling/sample/FoamX/name.cfg b/applications/utilities/postProcessing/sampling/sample/FoamX/name.cfg deleted file mode 100644 index 4ab16bf9d8..0000000000 --- a/applications/utilities/postProcessing/sampling/sample/FoamX/name.cfg +++ /dev/null @@ -1,15 +0,0 @@ -/*---------------------------------------------------------------------------*\ -| ========= | | -| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | -| \\ / O peration | Version: 1.0 | -| \\ / A nd | Web: http://www.openfoam.org | -| \\/ M anipulation | | -\*---------------------------------------------------------------------------*/ - -name -{ - type word; - description "Name of sampling set"; -} - -// ************************************************************************* // diff --git a/applications/utilities/postProcessing/sampling/sample/FoamX/points.cfg b/applications/utilities/postProcessing/sampling/sample/FoamX/points.cfg deleted file mode 100644 index 3b4f47ebbe..0000000000 --- a/applications/utilities/postProcessing/sampling/sample/FoamX/points.cfg +++ /dev/null @@ -1,16 +0,0 @@ -/*---------------------------------------------------------------------------*\ -| ========= | | -| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | -| \\ / O peration | Version: 1.0 | -| \\ / A nd | Web: http://www.openfoam.org | -| \\/ M anipulation | | -\*---------------------------------------------------------------------------*/ - -points -{ - type list; - description "List of points to be sampled"; - elementType vector; -} - -// ************************************************************************* // diff --git a/applications/utilities/postProcessing/sampling/sample/FoamX/sample.cfg b/applications/utilities/postProcessing/sampling/sample/FoamX/sample.cfg deleted file mode 100644 index 9cf95d9ae5..0000000000 --- a/applications/utilities/postProcessing/sampling/sample/FoamX/sample.cfg +++ /dev/null @@ -1,71 +0,0 @@ -/*---------------------------------------------------------------------------*\ -| ========= | | -| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | -| \\ / O peration | Version: 1.0 | -| \\ / A nd | Web: http://www.openfoam.org | -| \\/ M anipulation | | -\*---------------------------------------------------------------------------*/ -// sample tool definition - -description "Line sampling"; - -sampleDict -{ - type dictionary; - description "sample control dictionary"; - dictionaryPath "system"; - - entries - { - arguments - { - type rootCaseTimeArguments; - } - - interpolationScheme - { - type word; - description "Sampling interpolation scheme"; - default cellPoint; - valueList - ( - cell - cellPoint - cellPointFace - ); - } - - writeFormat - { - type word; - description "Output format of data"; - default raw; - valueList - ( - raw - gnuplot - xmgr - jplot - ); - } - - sampleSets - { - type list; - description "List of sampling sets"; - elementType - { - include "sampleSet.cfg"; - } - } - - fields - { - type list; - description "List of fields to be sampled"; - elementType word; - } - } -} - -// ************************************************************************* // diff --git a/applications/utilities/postProcessing/sampling/sample/FoamX/sampleSet.cfg b/applications/utilities/postProcessing/sampling/sample/FoamX/sampleSet.cfg deleted file mode 100644 index 9248dc4aec..0000000000 --- a/applications/utilities/postProcessing/sampling/sample/FoamX/sampleSet.cfg +++ /dev/null @@ -1,23 +0,0 @@ -/*---------------------------------------------------------------------------*\ -| ========= | | -| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | -| \\ / O peration | Version: 1.0 | -| \\ / A nd | Web: http://www.openfoam.org | -| \\/ M anipulation | | -\*---------------------------------------------------------------------------*/ - -sampleSet -{ - type selection; - entries - { - include "uniform.cfg"; - include "face.cfg"; - include "midPoint.cfg"; - include "midPointAndFace.cfg"; - include "curve.cfg"; - include "cloud.cfg"; - } -} - -// ************************************************************************* // diff --git a/applications/utilities/postProcessing/sampling/sample/FoamX/start.cfg b/applications/utilities/postProcessing/sampling/sample/FoamX/start.cfg deleted file mode 100644 index 5382f60eb8..0000000000 --- a/applications/utilities/postProcessing/sampling/sample/FoamX/start.cfg +++ /dev/null @@ -1,15 +0,0 @@ -/*---------------------------------------------------------------------------*\ -| ========= | | -| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | -| \\ / O peration | Version: 1.0 | -| \\ / A nd | Web: http://www.openfoam.org | -| \\/ M anipulation | | -\*---------------------------------------------------------------------------*/ - -start -{ - type vector; - description "Start point on sampling line"; -} - -// ************************************************************************* // diff --git a/applications/utilities/postProcessing/sampling/sample/FoamX/tensorFieldSample.cfg b/applications/utilities/postProcessing/sampling/sample/FoamX/tensorFieldSample.cfg deleted file mode 100644 index 1aee8b66ce..0000000000 --- a/applications/utilities/postProcessing/sampling/sample/FoamX/tensorFieldSample.cfg +++ /dev/null @@ -1,43 +0,0 @@ -/*---------------------------------------------------------------------------*\ -| ========= | | -| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | -| \\ / O peration | Version: 1.0 | -| \\ / A nd | Web: http://www.openfoam.org | -| \\/ M anipulation | | -\*---------------------------------------------------------------------------*/ - -tensorFieldSample -{ - type compound; - description "Tensor field to be sampled"; - entries - { - name - { - type word; - description "Field name"; - } - - component - { - type word; - description "Tensor component(s)"; - valueList - ( - xx - xy - xz - yx - yy - yz - zx - zy - zz - mag - full - ); - } - } -} - -// ************************************************************************* // diff --git a/applications/utilities/postProcessing/sampling/sample/FoamX/uniform.cfg b/applications/utilities/postProcessing/sampling/sample/FoamX/uniform.cfg deleted file mode 100644 index e382ed1e44..0000000000 --- a/applications/utilities/postProcessing/sampling/sample/FoamX/uniform.cfg +++ /dev/null @@ -1,23 +0,0 @@ -/*---------------------------------------------------------------------------*\ -| ========= | | -| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | -| \\ / O peration | Version: 1.0 | -| \\ / A nd | Web: http://www.openfoam.org | -| \\/ M anipulation | | -\*---------------------------------------------------------------------------*/ - -uniform -{ - type dictionary; - description "Uniform distribution of points on a line"; - entries - { - include "name.cfg"; - include "axis.cfg"; - include "start.cfg"; - include "end.cfg"; - include "nPoints.cfg"; - } -} - -// ************************************************************************* // diff --git a/applications/utilities/postProcessing/sampling/sample/FoamX/vectorFieldSample.cfg b/applications/utilities/postProcessing/sampling/sample/FoamX/vectorFieldSample.cfg deleted file mode 100644 index 89d901d975..0000000000 --- a/applications/utilities/postProcessing/sampling/sample/FoamX/vectorFieldSample.cfg +++ /dev/null @@ -1,37 +0,0 @@ -/*---------------------------------------------------------------------------*\ -| ========= | | -| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | -| \\ / O peration | Version: 1.0 | -| \\ / A nd | Web: http://www.openfoam.org | -| \\/ M anipulation | | -\*---------------------------------------------------------------------------*/ - -vectorFieldSample -{ - type compound; - description "Vector field to be sampled"; - entries - { - name - { - type word; - description "Field name"; - } - - component - { - type word; - description "Vector component(s)"; - valueList - ( - x - y - z - mag - full - ); - } - } -} - -// ************************************************************************* // diff --git a/applications/utilities/postProcessing/sampling/sample/Make/files b/applications/utilities/postProcessing/sampling/sample/Make/files deleted file mode 100644 index d8193c0500..0000000000 --- a/applications/utilities/postProcessing/sampling/sample/Make/files +++ /dev/null @@ -1,19 +0,0 @@ -combineSampleSets.C -sample.C - -writers/writer/writers.C -writers/xmgr/xmgrWriters.C -writers/gnuplot/gnuplotWriters.C -writers/jplot/jplotWriters.C -writers/raw/rawWriters.C - -sampleSets/coordSet/coordSet.C -sampleSets/sampleSet/sampleSet.C -sampleSets/cloud/cloudSet.C -sampleSets/face/faceOnlySet.C -sampleSets/curve/curveSet.C -sampleSets/uniform/uniformSet.C -sampleSets/midPoint/midPointSet.C -sampleSets/midPointAndFace/midPointAndFaceSet.C - -EXE = $(FOAM_APPBIN)/sample diff --git a/applications/utilities/postProcessing/sampling/sample/combineSampleSets.C b/applications/utilities/postProcessing/sampling/sample/combineSampleSets.C deleted file mode 100644 index 276eb1021a..0000000000 --- a/applications/utilities/postProcessing/sampling/sample/combineSampleSets.C +++ /dev/null @@ -1,120 +0,0 @@ -/*---------------------------------------------------------------------------*\ - ========= | - \\ / 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 - -\*---------------------------------------------------------------------------*/ - - -#include "Pstream.H" -#include "ListListOps.H" -#include "combineSampleSets.H" -#include "SortableList.H" -#include "IndirectList.H" - -using namespace Foam; - -// * * * * * * * * * * * * * * * Global Functions * * * * * * * * * * * * * // - -// Combine points from all processors. Sort by curveDist and produce -// index list. Valid result only on master processor. -void combineSampleSets -( - const PtrList& sampleSets, - PtrList& masterSampleSets, - labelListList& indexSets -) -{ - forAll(sampleSets, setI) - { - const sampleSet& samplePts = sampleSets[setI]; - - // Collect data from all processors - List > gatheredPts(Pstream::nProcs()); - gatheredPts[Pstream::myProcNo()] = samplePts; - Pstream::gatherList(gatheredPts); - - List gatheredSegments(Pstream::nProcs()); - gatheredSegments[Pstream::myProcNo()] = samplePts.segments(); - Pstream::gatherList(gatheredSegments); - - List gatheredDist(Pstream::nProcs()); - gatheredDist[Pstream::myProcNo()] = samplePts.curveDist(); - Pstream::gatherList(gatheredDist); - - - // Combine processor lists into one big list. - List allPts - ( - ListListOps::combine > - ( - gatheredPts, accessOp >() - ) - ); - labelList allSegments - ( - ListListOps::combine - ( - gatheredSegments, accessOp() - ) - ); - scalarList allCurveDist - ( - ListListOps::combine - ( - gatheredDist, accessOp() - ) - ); - - // Sort curveDist and use to fill masterSamplePts - SortableList sortedDist(allCurveDist); - indexSets[setI] = sortedDist.indices(); - - // Get reference point (note: only master has all points) - point refPt; - - if (allPts.size() > 0) - { - refPt = samplePts.getRefPoint(allPts); - } - else - { - refPt = vector::zero; - } - - - masterSampleSets.set - ( - setI, - new coordSet - ( - samplePts.name(), - samplePts.axis(), - IndirectList(allPts, indexSets[setI]), - refPt - ) - ); - } -} - - -// ************************************************************************* // diff --git a/applications/utilities/postProcessing/sampling/sample/combineSampleSets.H b/applications/utilities/postProcessing/sampling/sample/combineSampleSets.H deleted file mode 100644 index 3dc889ed49..0000000000 --- a/applications/utilities/postProcessing/sampling/sample/combineSampleSets.H +++ /dev/null @@ -1,60 +0,0 @@ -/*---------------------------------------------------------------------------*\ - ========= | - \\ / 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 - -InClass - Foam::combineSampleSets - -Description - Various utility functions for collection of samples on processors. - -SourceFiles - combineSampleSets.C - -\*---------------------------------------------------------------------------*/ - -#ifndef combineSampleSets_H -#define combineSampleSets_H - -#include "labelList.H" -#include "PtrList.H" -#include "coordSet.H" -#include "sampleSet.H" - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -// Combine points from all processors. Sort by curveDist and produce -// index list. Valid result only on master processor. -void combineSampleSets -( - const Foam::PtrList& sampleSets, - Foam::PtrList& masterSampleSets, - Foam::labelListList& indexSets -); - - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -#endif - -// ************************************************************************* // diff --git a/applications/utilities/postProcessing/sampling/sample/combineSampleValues.C b/applications/utilities/postProcessing/sampling/sample/combineSampleValues.C deleted file mode 100644 index adbf92f1ba..0000000000 --- a/applications/utilities/postProcessing/sampling/sample/combineSampleValues.C +++ /dev/null @@ -1,86 +0,0 @@ -/*---------------------------------------------------------------------------*\ - ========= | - \\ / 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 - -\*---------------------------------------------------------------------------*/ - - -#include "combineSampleValues.H" -#include "Pstream.H" -#include "ListListOps.H" -#include "IndirectList.H" - -using namespace Foam; - -// * * * * * * * * * * * * * * * Global Functions * * * * * * * * * * * * * // - -// Combine values from all processors. Valid result only on master processor. -template -void combineSampleValues -( - const PtrList >& sampledFields, - const labelListList& indexSets, - PtrList >& masterFields -) -{ - forAll(sampledFields, fieldI) - { - List > masterValues(indexSets.size()); - - forAll(indexSets, setI) - { - // Collect data from all processors - List > gatheredData(Pstream::nProcs()); - gatheredData[Pstream::myProcNo()] = sampledFields[fieldI][setI]; - Pstream::gatherList(gatheredData); - - if (Pstream::master()) - { - Field allData - ( - ListListOps::combine > - ( - gatheredData, - Foam::accessOp >() - ) - ); - - masterValues[setI] = - IndirectList(allData, indexSets[setI])(); - } - } - masterFields.set - ( - fieldI, - new volFieldSampler - ( - masterValues, - sampledFields[fieldI].name() - ) - ); - } -} - - -// ************************************************************************* // - diff --git a/applications/utilities/postProcessing/sampling/sample/combineSampleValues.H b/applications/utilities/postProcessing/sampling/sample/combineSampleValues.H deleted file mode 100644 index 2d21264f92..0000000000 --- a/applications/utilities/postProcessing/sampling/sample/combineSampleValues.H +++ /dev/null @@ -1,65 +0,0 @@ -/*---------------------------------------------------------------------------*\ - ========= | - \\ / 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 - -InClass - Foam::combineSampleValues - -Description - Various utility functions for collection of samples on processors. - -SourceFiles - combineSampleValues.C - -\*---------------------------------------------------------------------------*/ - -#ifndef combineSampleValues_H -#define combineSampleValues_H - -#include "labelList.H" -#include "PtrList.H" -#include "volFieldSampler.H" - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -// Combine values from all processors. Valid result only on master processor. -template -void combineSampleValues -( - const Foam::PtrList >& sampledFields, - const Foam::labelListList& indexSets, - Foam::PtrList >& masterFields -); - - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -#ifdef NoRepository -# include "combineSampleValues.C" -#endif - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -#endif - -// ************************************************************************* // diff --git a/applications/utilities/postProcessing/sampling/sample/sample.C b/applications/utilities/postProcessing/sampling/sample/sample.C deleted file mode 100644 index 18cd64e869..0000000000 --- a/applications/utilities/postProcessing/sampling/sample/sample.C +++ /dev/null @@ -1,887 +0,0 @@ -/*---------------------------------------------------------------------------*\ - ========= | - \\ / 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 - -Description - Sample field data with a choice of interpolation schemes, sampling options - and write formats. - - interpolationScheme : choice of - cell : use cell-centre value only; constant over cells - cellPoint : use cell-centre and vertex values - cellPointFace : use cell-centre, vertex and face values. - - sample: choice of - uniform evenly distributed points on line - face one point per face intersection - midPoint one point per cell, inbetween two face intersections - midPointAndFace combination of face and midPoint - - curve specified points, not nessecary on line, uses - tracking - cloud specified points, uses findCell - - writeFormat : choice of - xmgr - jplot - gnuplot - raw - -\*---------------------------------------------------------------------------*/ - -#include "Pstream.H" -#include "argList.H" -#include "OSspecific.H" - -#include "Cloud.H" -#include "passiveParticle.H" -#include "meshSearch.H" -#include "interpolation.H" -#include "volPointInterpolation.H" - -#include "writer.H" -#include "sampleSet.H" -#include "volFieldSampler.H" -#include "dictionaryEntry.H" - -#include "combineSampleSets.H" -#include "combineSampleValues.H" - -using namespace Foam; - - -template -void writeSampleFile -( - const coordSet& masterSampleSet, - const PtrList >& masterFields, - const label setI, - const fileName& timeDir, - const word& writeFormat -) -{ - if (masterFields.size() > 0) - { - wordList valueSetNames(masterFields.size()); - List*> valueSets(masterFields.size()); - - forAll(masterFields, fieldI) - { - valueSetNames[fieldI] = masterFields[fieldI].name(); - valueSets[fieldI] = &masterFields[fieldI][setI]; - } - - autoPtr > formatter - ( - writer::New(writeFormat) - ); - - fileName fName - ( - timeDir/formatter().getFileName(masterSampleSet, valueSetNames) - ); - - Info<< "Writing fields to " << fName << endl; - - formatter().write - ( - masterSampleSet, - valueSetNames, - valueSets, - OFstream(fName)() - ); - } -} - - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // -// Main program: - -int main(int argc, char *argv[]) -{ -# include "addTimeOptions.H" -# include "setRootCase.H" - -# include "createTime.H" - - // Get times list - instantList Times = runTime.times(); - - // set startTime and endTime depending on -time and -latestTime options -# include "checkTimeOptions.H" - - runTime.setTime(Times[startTime], startTime); - -# include "createMesh.H" - - // - // Hack: initialize Cloud to initialize the processor table so from - // now on we can use cloud on single processors only. - // - Cloud dummyCloud(mesh, IDLList()); - - // Read control dictionary - IOdictionary sampleDict - ( - IOobject - ( - "sampleDict", - runTime.system(), - mesh, - IOobject::MUST_READ, - IOobject::NO_WRITE - ) - ); - - const word interpolationScheme(sampleDict.lookup("interpolationScheme")); - const wordList fieldNames = sampleDict.lookup("fields"); - - // - // Construct writers - // - - word writeFormat(sampleDict.lookup("writeFormat")); - - // - // Construct interpolation dictionary (same interpolation for all fields) - // - - dictionary interpolationSchemes; - - forAll(fieldNames, fieldI) - { - interpolationSchemes.add - ( - fieldNames[fieldI], - interpolationScheme - ); - } - - // Set up interpolation - autoPtr pMeshPtr(new pointMesh(mesh)); - autoPtr pInterpPtr - ( - new volPointInterpolation(mesh, pMeshPtr()) - ); - - // Set up mesh searching - meshSearch searchEngine(mesh, true); - - - fileName samplePath; - - if (Pstream::master()) - { - if (Pstream::parRun()) - { - samplePath = runTime.path()/".."/"samples"; - } - else - { - samplePath = runTime.path()/"samples"; - } - - if (exists(samplePath)) - { - Info<< "Deleting samples/ directory" << endl << endl; - rmDir(samplePath); - } - } - - fileName oldPointsDir("constant"); - - for (label i=startTime; i > sampledScalarFields - ( - fieldNames.size() - ); - PtrList > sampledVectorFields - ( - fieldNames.size() - ); - PtrList > sampledSphericalTensorFields - ( - fieldNames.size() - ); - PtrList > sampledSymmTensorFields - ( - fieldNames.size() - ); - PtrList > sampledTensorFields - ( - fieldNames.size() - ); - - // - // Do actual interpolation - // - - label nScalarFields = 0; - label nVectorFields = 0; - label nSphericalTensorFields = 0; - label nSymmTensorFields = 0; - label nTensorFields = 0; - - forAll(fieldNames, fieldI) - { - const word& fieldName = fieldNames[fieldI]; - - IOobject fieldHeader - ( - fieldName, - runTime.timeName(), - mesh, - IOobject::MUST_READ - ); - - // Determine number of processor actually having this field - label fieldFound = (fieldHeader.headerOk() ? 1 : 0); - reduce(fieldFound, sumOp