CFDEMcoupling  2.4
 All Classes
liggghtsCommandModel.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  liggghtsCommandModel
33 
34 SourceFiles
35  liggghtsCommandModel.C
36 
37 \*---------------------------------------------------------------------------*/
38 
39 #ifndef liggghtsCommandModel_H
40 #define liggghtsCommandModel_H
41 
42 #include "fvCFD.H"
43 #include "cfdemCloud.H"
44 #include "dataExchangeModel.H"
45 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
46 
47 namespace Foam
48 {
49 
50 /*---------------------------------------------------------------------------*\
51  Class liggghtsCommandModel Declaration
52 \*---------------------------------------------------------------------------*/
53 
55 {
56 
57 protected:
58 
59  // Protected data
60  const dictionary& dict_;
61 
62  cfdemCloud& particleCloud_;
63 
64  string strCommand_;
65 
66  int nextRun_;
67 
68  int lastRun_;
69 
70  Switch runFirst_;
71 
72  Switch runLast_;
73 
74  Switch runEveryCouplingStep_;
75 
76  Switch runEveryWriteStep_;
77 
78  scalar startTime_;
79 
80  scalar endTime_;
81 
82  scalar timeInterval_;
83 
84  int firstCouplingStep_;
85 
86  int lastCouplingStep_;
87 
88  int couplingStepInterval_;
89 
90  bool exactTiming_;
91 
92  label commandLines_;
93 
94  bool verbose_;
95 
96 public:
97 
98  //- Runtime type information
99  TypeName("liggghtsCommandModel");
100 
101  // Declare runtime constructor selection table
102 
103 
104  declareRunTimeSelectionTable
105  (
106  autoPtr,
108  dictionary,
109  (
110  const dictionary& dict,
111  cfdemCloud& sm,
112  int i
113  ),
114  (dict,sm,i)
115  );
116 
117 
118  // Constructors
119 
120  //- Construct from components
122  (
123  const dictionary& dict,
124  cfdemCloud& sm,
125  int i
126  );
127 
128 
129  // Destructor
130 
131  virtual ~liggghtsCommandModel();
132 
133 
134  // Selector
135 
136  static autoPtr<liggghtsCommandModel> New
137  (
138  const dictionary& dict,
139  cfdemCloud& sm,
140  word liggghtsCommandType,
141  int i
142  );
143 
144 
145  // Member Functions
146 
147  virtual const char* command(int)=0;
148 
149  void checkTimeMode(dictionary&);
150 
151  void checkTimeSettings(const dictionary&);
152 
153  virtual bool runCommand(int)=0;
154 
155  bool runThisCommand(int);
156 
157  string addTimeStamp(word);
158 
159  virtual void set(int){};
160 
161  DynamicList<scalar> executionsWithinPeriod(scalar,scalar);
162 
163  bool checkPath(fileName);
164 
165  // Access
166 
167  int nextRun(){return nextRun_;};
168 
169  int lastRun(){return lastRun_;};
170 
171  virtual word name()=0;
172 
173  bool exactTiming(){return exactTiming_;};
174 
175  label commandLines(){return commandLines_;};
176 
177  void parseCommandList(wordList&, labelList&, scalarList&, word&, dictionary&, bool=false);
178 };
179 
180 
181 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
182 
183 } // End namespace Foam
184 
185 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
186 
187 #endif
188 
189 // ************************************************************************* //
Definition: liggghtsCommandModel.H:54
Definition: cfdemCloud.H:81