diff --git a/src/sampling/sampledSet/writers/writer.C b/src/sampling/sampledSet/writers/writer.C index ded4523d1c8ad5d62cceaf0b287da701340bcf67..69dbdec6fe7a14c5b7ec1c5834682b8f6396a316 100644 --- a/src/sampling/sampledSet/writers/writer.C +++ b/src/sampling/sampledSet/writers/writer.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -152,6 +152,25 @@ Foam::writer<Type>::~writer() // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // +template<class Type> +void Foam::writer<Type>::write +( + const coordSet& points, + const wordList& valueSetNames, + const List<Field<Type> >& valueSets, + Ostream& os +) const +{ + List<const Field<Type>*> valueSetPtrs(valueSets.size()); + forAll(valueSetPtrs, i) + { + valueSetPtrs[i] = &valueSets[i]; + } + + write(points, valueSetNames, valueSetPtrs, os); +} + + template<class Type> Foam::Ostream& Foam::writer<Type>::write ( diff --git a/src/sampling/sampledSet/writers/writer.H b/src/sampling/sampledSet/writers/writer.H index 6e55a20b6ed2592f88344d1f6219240685547196..8c754bd47b13444b07874c0ad1f71e499f921925 100644 --- a/src/sampling/sampledSet/writers/writer.H +++ b/src/sampling/sampledSet/writers/writer.H @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -40,13 +40,7 @@ Description // Output list of points and corresponding values scalarFormatter().write ( - coordSet - ( - points, // sample coordinates - "someLine", // name of coordSet - "distance", // write coordinates as distance to refPoint - points[0] // reference point - ), + coordSet(...) "U.component(0)", // name of values vals // values ); @@ -164,6 +158,17 @@ public: Ostream& ) const = 0; + //- General entry point for writing. + // The data is organized in a set of point with one or more values + // per point + virtual void write + ( + const coordSet&, + const wordList&, + const List<Field<Type> >&, + Ostream& + ) const; + //- General entry point for writing of multiple coordSets. // Each coordSet (track) has same data variables. // The data is per variable, per track, per point of track.