Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026 #include "rawSetWriter.H"
00027 #include <sampling/coordSet.H>
00028 #include <OpenFOAM/fileName.H>
00029 #include <OpenFOAM/OFstream.H>
00030
00031
00032
00033 template<class Type>
00034 Foam::rawSetWriter<Type>::rawSetWriter()
00035 :
00036 writer<Type>()
00037 {}
00038
00039
00040
00041
00042 template<class Type>
00043 Foam::rawSetWriter<Type>::~rawSetWriter()
00044 {}
00045
00046
00047
00048
00049 template<class Type>
00050 Foam::fileName Foam::rawSetWriter<Type>::getFileName
00051 (
00052 const coordSet& points,
00053 const wordList& valueSetNames
00054 ) const
00055 {
00056 return this->getBaseName(points, valueSetNames) + ".xy";
00057 }
00058
00059
00060 template<class Type>
00061 void Foam::rawSetWriter<Type>::write
00062 (
00063 const coordSet& points,
00064 const wordList& valueSetNames,
00065 const List<const Field<Type>*>& valueSets,
00066 Ostream& os
00067 ) const
00068 {
00069
00070 List<const List<Type>*> columns(valueSets.size());
00071
00072 forAll(valueSets, i)
00073 {
00074 columns[i] = valueSets[i];
00075 }
00076
00077 this->writeTable(points, columns, os);
00078 }
00079
00080
00081 template<class Type>
00082 void Foam::rawSetWriter<Type>::write
00083 (
00084 const bool writeTracks,
00085 const PtrList<coordSet>& points,
00086 const wordList& valueSetNames,
00087 const List<List<Field<Type> > >& valueSets,
00088 Ostream& os
00089 ) const
00090 {
00091 if (valueSets.size() != valueSetNames.size())
00092 {
00093 FatalErrorIn("rawSetWriter<Type>::write(..)")
00094 << "Number of variables:" << valueSetNames.size() << endl
00095 << "Number of valueSets:" << valueSets.size()
00096 << exit(FatalError);
00097 }
00098
00099 List<const List<Type>*> columns(valueSets.size());
00100
00101 forAll(points, trackI)
00102 {
00103
00104 forAll(valueSets, i)
00105 {
00106 columns[i] = &valueSets[i][trackI];
00107 }
00108
00109 this->writeTable(points[trackI], columns, os);
00110 os << nl << nl;
00111 }
00112 }
00113
00114
00115