mirror of
https://develop.openfoam.com/Development/openfoam.git
synced 2025-11-28 03:28:01 +00:00
ENH: Added helper function to set 'writer' API
This commit is contained in:
@ -2,7 +2,7 @@
|
|||||||
========= |
|
========= |
|
||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
\\ / O peration |
|
\\ / O peration |
|
||||||
\\ / A nd | Copyright (C) 2011 OpenFOAM Foundation
|
\\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation
|
||||||
\\/ M anipulation |
|
\\/ M anipulation |
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
@ -152,6 +152,25 @@ Foam::writer<Type>::~writer()
|
|||||||
|
|
||||||
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * 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>
|
template<class Type>
|
||||||
Foam::Ostream& Foam::writer<Type>::write
|
Foam::Ostream& Foam::writer<Type>::write
|
||||||
(
|
(
|
||||||
|
|||||||
@ -2,7 +2,7 @@
|
|||||||
========= |
|
========= |
|
||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
\\ / O peration |
|
\\ / O peration |
|
||||||
\\ / A nd | Copyright (C) 2011 OpenFOAM Foundation
|
\\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation
|
||||||
\\/ M anipulation |
|
\\/ M anipulation |
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
@ -40,13 +40,7 @@ Description
|
|||||||
// Output list of points and corresponding values
|
// Output list of points and corresponding values
|
||||||
scalarFormatter().write
|
scalarFormatter().write
|
||||||
(
|
(
|
||||||
coordSet
|
coordSet(...)
|
||||||
(
|
|
||||||
points, // sample coordinates
|
|
||||||
"someLine", // name of coordSet
|
|
||||||
"distance", // write coordinates as distance to refPoint
|
|
||||||
points[0] // reference point
|
|
||||||
),
|
|
||||||
"U.component(0)", // name of values
|
"U.component(0)", // name of values
|
||||||
vals // values
|
vals // values
|
||||||
);
|
);
|
||||||
@ -164,6 +158,17 @@ public:
|
|||||||
Ostream&
|
Ostream&
|
||||||
) const = 0;
|
) 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.
|
//- General entry point for writing of multiple coordSets.
|
||||||
// Each coordSet (track) has same data variables.
|
// Each coordSet (track) has same data variables.
|
||||||
// The data is per variable, per track, per point of track.
|
// The data is per variable, per track, per point of track.
|
||||||
|
|||||||
Reference in New Issue
Block a user