CFDEMcoupling  2.4
 All Classes
clockModel.H
1 /*---------------------------------------------------------------------------*\
2  CFDEMcoupling - Open Source CFD-DEM coupling
3 
4  CFDEMcoupling is part of the CFDEMproject
5  www.cfdem.com
6  Christoph Goniva, christoph.goniva@cfdem.com
7  Copyright 2009-2012 JKU Linz
8  Copyright 2012- DCS Computing GmbH, Linz
9 -------------------------------------------------------------------------------
10 License
11  This file is part of CFDEMcoupling.
12 
13  CFDEMcoupling is free software; you can redistribute it and/or modify it
14  under the terms of the GNU General Public License as published by the
15  Free Software Foundation; either version 3 of the License, or (at your
16  option) any later version.
17 
18  CFDEMcoupling is distributed in the hope that it will be useful, but WITHOUT
19  ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
20  FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
21  for more details.
22 
23  You should have received a copy of the GNU General Public License
24  along with CFDEMcoupling; if not, write to the Free Software Foundation,
25  Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
26 
27 Description
28  This code is designed to realize coupled CFD-DEM simulations using LIGGGHTS
29  and OpenFOAM(R). Note: this code is not part of OpenFOAM(R) (see DISCLAIMER).
30 
31 Class
32  clockModel
33 
34 SourceFiles
35  clockModel.C
36 
37 \*---------------------------------------------------------------------------*/
38 
39 #ifndef clockModel_H
40 #define clockModel_H
41 
42 #define START(x) start(__COUNTER__,x)
43 
44 #include "fvCFD.H"
45 #include "cfdemCloud.H"
46 #include "dataExchangeModel.H"
47 
48 #include <vector>
49 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
50 
51 namespace Foam
52 {
53 
54 /*---------------------------------------------------------------------------*\
55  Class clockModel Declaration
56 \*---------------------------------------------------------------------------*/
57 
59 {
60 protected:
61 
62  // Protected data
63  const dictionary& dict_;
64  cfdemCloud& particleCloud_;
65  fileName path_;
66  scalar startTime_;
67 
68  mutable int n_;
69  mutable std::vector<clock_t> deltaT_;
70  mutable std::vector<std::string> identifier_;
71  mutable std::vector<int> nOfRuns_;
72  mutable std::vector<short> level_;
73  mutable short curLev_;
74  mutable std::vector<int> parent_;
75  mutable int curParent_;
76 
77 public:
78 
79  //- Runtime type information
80  TypeName("clockModel");
81 
82  // Declare runtime constructor selection table
83 
84  declareRunTimeSelectionTable
85  (
86  autoPtr,
87  clockModel,
88  dictionary,
89  (
90  const dictionary& dict,
91  cfdemCloud& sm
92  ),
93  (dict,sm)
94  );
95 
96 
97  // Constructors
98 
99  //- Construct from components
100  clockModel
101  (
102  const dictionary& dict,
103  cfdemCloud& sm
104  );
105 
106 
107  // Destructor
108 
109  virtual ~clockModel();
110 
111 
112  // Selector
113 
114  static autoPtr<clockModel> New
115  (
116  const dictionary& dict,
117  cfdemCloud& sm
118  );
119 
120 
121  // Member Functions
122 
123  virtual void start(int pos) const; //start measurement with custom string identifier
124  virtual void start(int pos,std::string identifier) const; //start measurement with custom string identifier
125  virtual void stop() const; //stop last started measurement
126  virtual void stop(std::string identifier) const; //stop last started measurement with check if identifier is equal
127  virtual std::string eval() const;
128  virtual void evalFile() const;
129  virtual void evalPar() const;
130  void initElems();
131  std::vector<int> calcShift() const; //detects empty indices in vector, when times are evaluated
132  void Hist() const; //calc Histogram
133  virtual void normHist() const; //calc normalized Histogram
134  void plotHist(double,std::string,int,int) const; //plot histogramm to terminal
135  void getRAMUsage() const;
136 
137 };
138 
139 
140 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
141 
142 } // End namespace Foam
143 
144 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
145 
146 #endif
147 
148 // ************************************************************************* //
Definition: clockModel.H:58
Definition: cfdemCloud.H:81