1 #ifndef _IR_PLOT_UTILS_H_
2 #define _IR_PLOT_UTILS_H_
13 class flowprobe :
public std::vector<std::vector<double> >
25 (*this)[
RHO] = inFlowProbe[
RHO];
26 (*this)[
U] = inFlowProbe[
U];
27 (*this)[
V] = inFlowProbe[
V];
28 (*this)[
W] = inFlowProbe[
W];
29 (*this)[
P] = inFlowProbe[
P];
30 (*this)[
T] = inFlowProbe[
T];
40 std::string probeLine;
41 while(std::getline(inStream,probeLine)){
42 if(probeLine[0] ==
'#')
44 std::istringstream Instr(probeLine);
52 Instr >> time >> rho >> rhou >> rhov >> rhow >> press >> temp;
53 (*this)[
TIME].push_back(time);
54 (*this)[
RHO].push_back(rho);
55 (*this)[
U].push_back(rhou/rho);
56 (*this)[
V].push_back(rhov/rho);
57 (*this)[
W].push_back(rhow/rho);
58 (*this)[
P].push_back(press);
59 (*this)[
T].push_back(temp);
61 return((*
this)[
TIME].size());
63 void WriteData(std::ostream &outStream,
bool writeLoc =
false)
65 unsigned int nTimes = (*this)[
TIME].size();
66 for(
unsigned int i = 0;
i < nTimes;
i++){
71 outStream << (*this)[
j][
i] <<
" ";
73 outStream << std::endl;
91 inline int GNUPlot(
const std::string &commands)
93 FILE *fp = popen(
"gnuplot -persist",
"w");
94 fprintf(fp,commands.c_str());
void WriteData(std::ostream &outStream, bool writeLoc=false)
int GNUPlot(const std::string &commands)
flowprobe(const flowprobe &inFlowProbe)
void SetLocation(double xLoc, double yLoc, double zLoc)
unsigned int ReadProbeData(std::istream &inStream)
unsigned long time()
Get the value of a system timer with a millisecond precision.