FEDEM Solver  R8.0
Source code of the dynamics solver
FFpGraph.H
Go to the documentation of this file.
1 // SPDX-FileCopyrightText: 2023 SAP SE
2 //
3 // SPDX-License-Identifier: Apache-2.0
4 //
5 // This file is part of FEDEM - https://openfedem.org
7 
8 #ifndef FFP_GRAPH_H
9 #define FFP_GRAPH_H
10 
11 #include "FFpCurve.H"
12 
13 
14 class FFpGraph
15 {
16 public:
18  enum Format
19  {
25  NFORMATS
26  };
27 
28  FFpGraph(FFpCurve* curve = NULL);
29  FFpGraph(size_t nCurves, bool populateGraph = true);
30 
31  ~FFpGraph();
32 
33  void addCurve (FFpCurve* curve) { curves.push_back(curve); }
34  void clear() { curves.clear(); }
35 
36  bool empty() const { return curves.empty(); }
37  size_t numCurves() const { return curves.size(); }
38  FFpCurve& operator[] (const size_t i) { return *curves[i]; }
39 
40  void getTimeInterval (double& t0, double& t1) const { t0 = tmin; t1 = tmax; }
41  void setTimeInterval (double t0, double t1);
42  void setNoHeaderState (bool state = true) { noHeader = state; }
43  void setNoXaxisValues (bool state = true) { noXvalues = state; }
44  bool getNoXaxisValues () const { return noXvalues; }
45  bool loadTemporalData (FFrExtractor* extractor, std::string& errMsg);
46  bool loadSpatialData (FFrExtractor* extractor, std::string& errMsg);
47 
48  bool writeCurve (const std::string& fileName, int format,
49  const std::string& curveId, const std::string& descr,
50  const std::string& xTitle, const std::string& yTitle,
51  const std::string& modelName, std::string& errMsg,
52  int curveNo = 1);
53 
54  bool writeGraph (const std::string& fileName, int format,
55  const std::vector<std::string>& curveId,
56  const std::vector<std::string>& cDescr,
57  const std::string& modelName, std::string& errMsg,
58  int repeats = 0, int averages = 0,
59  int frmPts = 0, int grpPts = 0);
60 
61 private:
62  static double minIncrement (const std::vector<double>& xVals);
63 
64  std::vector<FFpCurve*> curves;
65 
66  bool noHeader;
67  bool noXvalues;
68  bool internal;
69  double tmin, tmax;
70 };
71 
72 #endif
Definition: FFpCurve.H:35
Definition: FFpGraph.H:15
FFpGraph(FFpCurve *curve=NULL)
Definition: FFpGraph.C:20
bool getNoXaxisValues() const
Definition: FFpGraph.H:44
Format
Enums for available curve export formats.
Definition: FFpGraph.H:19
@ DAC_LITTLE_ENDIAN
Definition: FFpGraph.H:21
@ RPC_LITTLE_ENDIAN
Definition: FFpGraph.H:23
@ RPC_BIG_ENDIAN
Definition: FFpGraph.H:24
@ ASCII
Definition: FFpGraph.H:20
@ DAC_BIG_ENDIAN
Definition: FFpGraph.H:22
@ NFORMATS
Definition: FFpGraph.H:25
bool writeCurve(const std::string &fileName, int format, const std::string &curveId, const std::string &descr, const std::string &xTitle, const std::string &yTitle, const std::string &modelName, std::string &errMsg, int curveNo=1)
Definition: FFpGraph.C:263
static double minIncrement(const std::vector< double > &xVals)
Definition: FFpGraph.C:533
void clear()
Definition: FFpGraph.H:34
std::vector< FFpCurve * > curves
Definition: FFpGraph.H:64
double tmax
Time interval for RDB data loading.
Definition: FFpGraph.H:69
bool noXvalues
Should only the Y-axis values be read?
Definition: FFpGraph.H:67
double tmin
Definition: FFpGraph.H:69
bool loadSpatialData(FFrExtractor *extractor, std::string &errMsg)
Definition: FFpGraph.C:161
void getTimeInterval(double &t0, double &t1) const
Definition: FFpGraph.H:40
FFpCurve & operator[](const size_t i)
Definition: FFpGraph.H:38
bool writeGraph(const std::string &fileName, int format, const std::vector< std::string > &curveId, const std::vector< std::string > &cDescr, const std::string &modelName, std::string &errMsg, int repeats=0, int averages=0, int frmPts=0, int grpPts=0)
Definition: FFpGraph.C:383
void setTimeInterval(double t0, double t1)
Definition: FFpGraph.C:58
void setNoXaxisValues(bool state=true)
Definition: FFpGraph.H:43
bool loadTemporalData(FFrExtractor *extractor, std::string &errMsg)
Definition: FFpGraph.C:72
size_t numCurves() const
Definition: FFpGraph.H:37
bool empty() const
Definition: FFpGraph.H:36
bool noHeader
Toggles writing of ASCII file header.
Definition: FFpGraph.H:66
~FFpGraph()
Definition: FFpGraph.C:51
void setNoHeaderState(bool state=true)
Definition: FFpGraph.H:42
void addCurve(FFpCurve *curve)
Definition: FFpGraph.H:33
Front-end for the result extraction module.
Definition: FFrExtractor.H:44