MAIA bb96820c
Multiphysics at AIA
Loading...
Searching...
No Matches
solver.h
Go to the documentation of this file.
1// Copyright (C) 2024 The m-AIA AUTHORS
2//
3// This file is part of m-AIA (https://git.rwth-aachen.de/aia/m-AIA/m-AIA)
4//
5// SPDX-License-Identifier: LGPL-3.0-only
6
7#ifndef SOLVER_H
8#define SOLVER_H
9
10#include <bitset>
11#include <limits>
12#include <set>
13#include "GEOM/geometry.h"
14#include "INCLUDE/maiatypes.h"
15#include "MEMORY/scratch.h"
16#include "UTIL/debug.h"
17#include "UTIL/dlbtimer.h"
18#include "UTIL/timer.h"
19#include "application.h"
20
21class Coupling;
22class Application;
23
29class Solver {
30 // Declared friend to allow for functions which should only be used in Application
32 template <MInt nDim, class ppType>
33 friend class PostProcessing;
34
35 private:
36 // The path to the testcase directory
38
39 // The path to the output directory
41
42 // The path to the restart directory
44
45 // The MPI communicator to be used by this solver
46 MPI_Comm m_mpiComm;
47
48 // The domain id of this solver on the current MPI communicator
50
51 // The number of domains of this solver on the current MPI communicator
53
54 // The current solver status in the execution recipe (solver enabled/disabled in current step)
56
59
61
63
64 static std::map<MInt, MString> m_aliases;
65
66 protected:
69
72
76 std::set<MInt> m_solutionTimeSteps;
77
85
88
91
94 MInt* m_bandWidth = nullptr;
95
96 // TODO: remove one, they are identically!
99
100 public:
101 std::set<MInt> m_freeIndices;
102
104
105 // TODO labels:toremove delete once all solvers and applications have splitAdaptation
106 MBool m_splitAdaptation = true; // TODO labels:toremove remove
107
108 // Save sensor data to file
110
111 // protected doesnot allow instances of non-derived classes
112 protected:
113 Solver(const MInt solverId, const MPI_Comm comm, const MBool isActive = true);
114
115 public:
116 MString getIdentifier(const MBool useSolverId = false, const MString preString = "", const MString postString = "_");
117
118 virtual ~Solver() = default;
119
121 virtual MInt noInternalCells() const = 0;
122
124 virtual MFloat time() const = 0;
125
127 virtual MInt noVariables() const { TERMM(-1, "Not implemented for this solver"); }
128
130 virtual void getDimensionalizationParams(std::vector<std::pair<MFloat, MString>>& /*dimParams*/) const {
131 TERMM(-1, "getDimensionalizationParams()");
132 };
133
135 void updateDomainInfo(const MInt domainId, const MInt noDomains, const MPI_Comm mpiComm, const MString& loc) {
139
140 // DEBUG output
141 m_log << "Solver #" << solverId() << " updateDomainInfo: domainId=" << domainId << ", noDomains=" << noDomains
142 << " from " << loc << std::endl;
143 //#ifndef NDEBUG
144 // std::cerr << "Solver #" << solverId() << " updateDomainInfo: domainId=" << domainId
145 // << ", noDomains=" << noDomains << " from " << loc << std::endl;
146 //#endif
147 }
148
149 // relevant for Postprocessing
150 // virtual MInt& a_level(const MInt) { TERMM(1, "Not implemented for this solver"); };
151 virtual MFloat& a_slope(const MInt, MInt const, const MInt) { TERMM(1, "Not implemented for this solver"); };
152 virtual MBool a_isBndryCell(const MInt) const { TERMM(1, "Not implemented for this solver"); };
153 virtual MFloat& a_FcellVolume(MInt) { TERMM(1, "Not implemented for this solver"); };
154 virtual MInt getCurrentTimeStep() const {
155 TERMM(1, "Not implemented for this solver");
156 return -1;
157 }
158 virtual void accessSampleVariables(MInt, MFloat*&) { TERMM(1, "Not implemented for this solver"); };
159 virtual void getSampleVariableNames(std::vector<MString>& NotUsed(varNames)) {
160 TERMM(1, "Not implemented for this solver");
161 };
162 virtual MBool a_isBndryGhostCell(MInt /*cellId*/) const { return false; }
163 // only implemented in LBSolver
164 virtual void saveCoarseSolution() { TERMM(1, "Not implemented for this solver"); }; // only implemented in LBSolver
165
166 virtual void getSolverSamplingProperties(std::vector<MInt>& NotUsed(samplingVarIds),
167 std::vector<MInt>& NotUsed(noSamplingVars),
168 std::vector<std::vector<MString>>& NotUsed(samplingVarNames),
169 const MString NotUsed(featureName) = "") {
170 TERMM(1, "Not implemented for this solver");
171 };
172 virtual void initSolverSamplingVariables(const std::vector<MInt>& NotUsed(varIds),
173 const std::vector<MInt>& NotUsed(noSamplingVars)) {
174 TERMM(1, "Not implemented for this solver");
175 };
176
177 virtual void calcSamplingVariables(const std::vector<MInt>& NotUsed(varIds), const MBool NotUsed(exchange)) {
178 TERMM(1, "Not implemented for this solver");
179 };
180 virtual void calcSamplingVarAtPoint(const MFloat* NotUsed(point), const MInt NotUsed(id),
181 const MInt NotUsed(sampleVarId), MFloat* NotUsed(state),
182 const MBool NotUsed(interpolate) = false) {
183 TERMM(1, "Not implemented for this solver");
184 };
185
186
188 virtual void balance(const MInt* const NotUsed(noCellsToReceiveByDomain),
189 const MInt* const NotUsed(noCellsToSendByDomain),
190 const MInt* const NotUsed(targetDomainsByCell),
191 const MInt NotUsed(oldNoCells)) {
192 TERMM(1, "Not implemented for this solver");
193 }
194
196 virtual MBool hasSplitBalancing() const { return false; }
197 virtual void balancePre() { TERMM(1, "Not implemented for this solver"); };
198 virtual void balancePost() { TERMM(1, "Not implemented for this solver"); };
199
200 virtual void finalizeBalance() { TERMM(1, "Not implemented for this solver"); };
201
203 virtual void resetSolver() { TERMM(1, "Not implemented for this solver " + std::to_string(m_solverId)); };
204
206 virtual void cancelMpiRequests(){};
207
209 virtual void setCellWeights(MFloat* /*unused*/) { TERMM(1, "Not implemented for this solver"); };
210
211 virtual MInt noLoadTypes() const { return -1; };
212 virtual void getDefaultWeights(MFloat* NotUsed(weights), std::vector<MString>& NotUsed(names)) const {
213 TERMM(1, "Not implemented for this solver");
214 };
215 virtual void getLoadQuantities(MInt* const NotUsed(loadQuantities)) const {};
216 virtual MFloat getCellLoad(const MInt NotUsed(cellId), const MFloat* const NotUsed(weights)) const { return -1.0; };
217 virtual void limitWeights(MFloat* NotUsed(weights)){};
218
219 virtual void localToGlobalIds(/*const MInt* const NotUsed(offsets)*/){
220 // todo labels:toenhance fix this by writing a stub in offending solver with proper warning message or reason why
221 // impl is not
222 // needed
223 // std::cerr << "ERROR: calling localToGlobalIds() within solver without implementation!"<<std::endl;
224 // TERMM(1, "Not implemented for this solver");
225 };
226 virtual void globalToLocalIds(/*const MInt* const NotUsed(offsets)*/){
227 // todo labels:toenhance fix this by writing a stub in offending solver with proper warning message or reason why
228 // impl is not
229 // needed
230 // std::cerr << "ERROR: calling globalToLocalIds() within solver without implementation!"<<std::endl;
231 // TERMM(1, "Not implemented for this solver");
232 };
233
235 virtual MInt noCellDataDlb() const { return 0; };
236 virtual MInt cellDataTypeDlb(const MInt NotUsed(dataId)) const { return -1; };
237 virtual MInt cellDataSizeDlb(const MInt NotUsed(dataId), const MInt NotUsed(cellId)) { return -1; };
238
239 // Note: create function for every datatype, else overloaded function with template parameter is
240 // not called in derived solver class when using a Solver pointer.
241 virtual void getCellDataDlb(const MInt NotUsed(dataId), const MInt NotUsed(oldNoCells),
242 const MInt* const NotUsed(bufferIdToCellId), MInt* const NotUsed(data)) {
243 TERMM(1, "Not implemented for solver.");
244 }
245 virtual void getCellDataDlb(const MInt NotUsed(dataId), const MInt NotUsed(oldNoCells),
246 const MInt* const NotUsed(bufferIdToCellId), MLong* const NotUsed(data)) {
247 TERMM(1, "Not implemented for solver.");
248 }
249 virtual void getCellDataDlb(const MInt NotUsed(dataId), const MInt NotUsed(oldNoCells),
250 const MInt* const NotUsed(bufferIdToCellId), MFloat* const NotUsed(data)) {
251 TERMM(1, "Not implemented for solver.");
252 }
253 virtual void setCellDataDlb(const MInt NotUsed(dataId), const MInt* const NotUsed(data)) {
254 TERMM(1, "Not implemented for solver.");
255 }
256 virtual void setCellDataDlb(const MInt NotUsed(dataId), const MLong* const NotUsed(data)) {
257 TERMM(1, "Not implemented for solver.");
258 }
259 virtual void setCellDataDlb(const MInt NotUsed(dataId), const MFloat* const NotUsed(data)) {
260 TERMM(1, "Not implemented for solver.");
261 }
262
263 // Methods to get/set global solver variables that should be the same for all ranks
264 virtual void getGlobalSolverVars(std::vector<MFloat>& NotUsed(globalFloatVars),
265 std::vector<MInt>& NotUsed(globalIntVars)){
266 // todo labels:toenhance fix this by writing a stub in offending solver with proper warning message or reason why
267 // impl is not
268 // needed
269 // std::cerr << "ERROR: calling getGlobalSolverVars() within solver without implementation!"<<std::endl;
270 // TERMM(1, "Not implemented for this solver");
271 };
272 virtual void setGlobalSolverVars(std::vector<MFloat>& NotUsed(globalFloatVars),
273 std::vector<MInt>& NotUsed(globalIdVars)){
274 // todo labels:toenhance fix this by writing a stub in offending solver with proper warning message or reason why
275 // impl is not
276 // needed
277 // std::cerr << "ERROR: calling setGlobalSolverVars() within solver without implementation!"<<std::endl;
278 // TERMM(1, "Not implemented for this solver");
279 };
280
281 // Enable timers for dynamic load balancing, disabled by default since not supported by all
282 // solvers/run loops
284
285 // re-enable timers, and keep them running
287
288 // Temporarily disable timers, e.g. during adaptation
290
292
294
296
298
299 inline void startIdleTimer(const MString& name) {
301 }
302
304
305 virtual MInt noSolverTimers(const MBool NotUsed(allTimings)) { return maia::dlb::g_dlbTimerController.noSubTimers(); }
306
307 virtual void getSolverTimings(std::vector<std::pair<MString, MFloat>>& NotUsed(solverTimings),
308 const MBool NotUsed(allTimings)) {
309 TERMM(1, "not implemented in base class");
310 }
311
312 virtual void getDomainDecompositionInformation(std::vector<std::pair<MString, MInt>>& NotUsed(domainInfo)) {
313 TERMM(1, "not implemented for solver");
314 };
315
316 void setDlbTimer(const MInt timerId) {
317 if(m_dlbTimerId != -1) {
318 TERMM(1, "m_dlbTimerId already set");
319 }
320 m_dlbTimerId = timerId;
321 }
322
325 virtual void prepareAdaptation(std::vector<std::vector<MFloat>>& /*unused*/, std::vector<MFloat>& /*unused*/,
326 std::vector<std::bitset<64>>& /*unused*/, std::vector<MInt>& /*unused*/) {
327 TERMM(1, "Not implemented for this solver");
328 };
329
332 virtual void reinitAfterAdaptation() { TERMM(1, "Not implemented for this solver"); };
333
335 virtual void prepareAdaptation() { TERMM(1, "Not implemented for this solver"); };
336
338 virtual void setSensors(std::vector<std::vector<MFloat>>&, std::vector<MFloat>&, std::vector<std::bitset<64>>&,
339 std::vector<MInt>&) {
340 TERMM(1, "Not implemented for this solver");
341 };
342
343 virtual void saveSensorData(const std::vector<std::vector<MFloat>>& /*sensors*/, const MInt& /*level*/,
344 const MString& /*gridFileName*/, const MInt* const /*recalcIds*/){};
345
347 virtual void postAdaptation() { TERMM(1, "Not implemented for this solver"); };
348
350 virtual void finalizeAdaptation() { TERMM(1, "Not implemented for this solver"); };
351
353 virtual void refineCell(const MInt /*unused*/) { TERMM(1, "Not implemented for this solver"); };
354
356 virtual void removeChilds(const MInt /*unused*/) { TERMM(1, "Not implemented for this solver"); };
357
359 virtual void removeCell(const MInt /*unused*/) { TERMM(1, "Not implemented for this solver"); };
360
362 virtual void swapCells(const MInt /*unused*/, const MInt /*unused*/) { TERMM(1, "Not implemented for this solver"); };
363
365 virtual void swapProxy(const MInt /*unused*/, const MInt /*unused*/) { TERMM(1, "Not implemented for this solver"); };
366
368 virtual MInt cellOutside(const MFloat* /*unused*/, const MInt /*unused*/, const MInt /*unused*/) { return -1; };
369
371 virtual void resizeGridMap() { TERMM(1, "Not implemented for this solver"); };
372
374 virtual MBool prepareRestart(MBool /*unused*/, MBool& /*unused*/) { TERMM(1, "Not implemented for this solver"); };
375
376 // Reinit the solvers after a restart
377 virtual void reIntAfterRestart(MBool /*unused*/) { TERMM(1, "Not implemented for this solver"); };
378
380 MPI_Comm mpiComm() const { return m_mpiComm; }
381
383 virtual MInt domainId() const { return m_domainId; }
384
387 virtual MInt noDomains() const { return m_noDomains; }
388
391 virtual MBool isActive() const {
392 TERMM(1, "Not implemented for solver!");
393 return false;
394 }
395
398 void setSolverStatus(const MBool status) { m_solverStatus = status; }
399
402
405
407 MString outputDir() const { return m_outputDir; }
408
410 MString restartDir() const { return m_restartDir; }
411
414
416 MString solverType() const { return m_solverType; }
417
420
423
425 MInt solverId() const { return m_solverId; };
426
428
429 MInt readSolverSamplingVarNames(std::vector<MString>& varNames, const MString featureName = "") const;
430
433 virtual MBool hasRestartTimeStep() const { return false; }
434
435 virtual MBool forceAdaptation() { return false; };
436 // If false is commented in, compilation with PGI will fail!
437 virtual void preTimeStep() = 0;
438
439 virtual void postTimeStep() = 0;
440
441 virtual void initSolver() = 0;
442
443 virtual void finalizeInitSolver() = 0;
444
445 virtual void saveSolverSolution(const MBool NotUsed(forceOutput) = false,
446 const MBool NotUsed(finalTimeStep) = false) = 0;
447
448 virtual void cleanUp() = 0;
449
450 // If false is commented in, compilation with PGI will fail!
451 virtual MBool solutionStep() { TERMM(-1, "Empty body of Solver::solutionStep()"); };
452 virtual void preSolutionStep(MInt /*mode*/) { TERMM(-1, "Empty body of Solver::preSolutionStep()"); };
453
454 virtual MBool postSolutionStep() { TERMM(-1, "Empty body of Solver::postSolutionStep()"); };
455
456
457 virtual MBool solverConverged() { return false; };
458
459 virtual void getInterpolatedVariables(MInt /*cellId*/, const MFloat* /*position*/, MFloat* /*vars*/) {
460 TERMM(-1, "Empty body of Solver::getInterpolatedVariables()");
461 };
462
463 virtual void loadRestartFile() { TERMM(-1, "Empty body of Solver::loadRestartFile()"); };
464
466 TERMM(-1, "Empty body of Solver::determineRestartTimeStep()");
467 return -1;
468 };
469
470 virtual void writeRestartFile(MBool /*unused*/) { TERMM(-1, "Empty body of Solver::writeRestartFile()"); };
471
472 virtual void writeRestartFile(const MBool /*unused*/, const MBool /*unused*/, const MString /*unused*/,
473 MInt* /*unused*/) {
474 TERMM(-1, "Empty body of Solver::writeRestartFile()");
475 };
476
477 virtual void setTimeStep() { TERMM(-1, "Empty body of Solver::setTimeStep()"); };
478
479 virtual void implicitTimeStep() { TERMM(-1, "Empty body of Solver::implicitTimeStep()"); };
480
481 virtual void prepareNextTimeStep() { return; };
482
483 protected:
484 // Methods for solver timers needed for dynamic load balancing
487
488 private:
490};
491
492#endif // SOLVER_H
Manages the initialisation of the solvers, the methods depending to the solvers and the start of the ...
Definition: application.h:37
void stopIdleTimer(const MInt dlbTimerId, const MString &name)
Stop the idle timer for the given DLB timer id.
Definition: dlbtimer.h:392
void startIdleTimer(const MInt dlbTimerId, const MString &name)
Start the idle timer for the given DLB timer id.
Definition: dlbtimer.h:371
void startLoadTimer(const MInt dlbTimerId, const MString &name)
Start the load timer for the given DLB timer id.
Definition: dlbtimer.h:334
MInt noSubTimers() const
Return the number of (sub-)timers for each DLB timer.
Definition: dlbtimer.h:487
MFloat returnLoadRecord(const MInt dlbTimerId, const MInt mode=0)
Return the load record of a DLB timer.
Definition: dlbtimer.h:464
void stopLoadTimer(const MInt dlbTimerId, const MString &name)
Stop the load timer for the given DLB timer id.
Definition: dlbtimer.h:355
void enableDlbTimers(const MInt dlbTimerId)
Enable the given DLB timer.
Definition: dlbtimer.h:254
void reEnableDlbTimer(const MInt dlbTimerId)
Definition: dlbtimer.h:445
void disableDlbTimers(const MInt dlbTimerId)
Disable the given DLB timer.
Definition: dlbtimer.h:284
MFloat returnIdleRecord(const MInt dlbTimerId, const MInt mode=0)
Return the idle record of a DLB timer.
Definition: dlbtimer.h:474
MBool dlbTimersEnabled(const MInt dlbTimerId)
Return if the given DLB timer is enabled.
Definition: dlbtimer.h:324
MBool isLoadTimerRunning(const MInt dlbTimerId)
Definition: dlbtimer.h:441
Parent class of all solvers This class is the base for all solvers. I.e. all solver class (e....
Definition: solver.h:29
MBool m_saveSensorData
Definition: solver.h:109
virtual void finalizeBalance()
Definition: solver.h:200
MBool m_solverStatus
Definition: solver.h:55
virtual void removeCell(const MInt)
Remove the given cell.
Definition: solver.h:359
virtual void getInterpolatedVariables(MInt, const MFloat *, MFloat *)
Definition: solver.h:459
MInt readSolverSamplingVarNames(std::vector< MString > &varNames, const MString featureName="") const
Read sampling variables names, store in vector and return the number of sampling variables.
Definition: solver.cpp:167
MInt m_dlbTimerId
Definition: solver.h:62
virtual void prepareAdaptation(std::vector< std::vector< MFloat > > &, std::vector< MFloat > &, std::vector< std::bitset< 64 > > &, std::vector< MInt > &)
Definition: solver.h:325
virtual void resetSolver()
Reset the solver/solver for load balancing.
Definition: solver.h:203
virtual void balance(const MInt *const NotUsed(noCellsToReceiveByDomain), const MInt *const NotUsed(noCellsToSendByDomain), const MInt *const NotUsed(targetDomainsByCell), const MInt NotUsed(oldNoCells))
Perform load balancing.
Definition: solver.h:188
MBool m_initFromRestartFile
Definition: solver.h:84
virtual void preTimeStep()=0
virtual void writeRestartFile(const MBool, const MBool, const MString, MInt *)
Definition: solver.h:472
virtual void saveCoarseSolution()
Definition: solver.h:164
virtual MBool solutionStep()
Definition: solver.h:451
virtual MInt noSolverTimers(const MBool NotUsed(allTimings))
Definition: solver.h:305
virtual void getDimensionalizationParams(std::vector< std::pair< MFloat, MString > > &) const
Return the dimensionalization parameters of this solver.
Definition: solver.h:130
MBool isLoadTimerRunning()
Definition: solver.h:303
MInt m_restartTimeStep
Definition: solver.h:80
virtual void finalizeInitSolver()=0
MBool m_splitAdaptation
Definition: solver.h:106
virtual MInt noLoadTypes() const
Definition: solver.h:211
MString outputDir() const
Return the directory for output files.
Definition: solver.h:407
virtual void prepareNextTimeStep()
Definition: solver.h:481
MBool getSolverStatus()
Get the solver status indicating if the solver is currently active in the execution recipe.
Definition: solver.h:401
virtual void balancePost()
Definition: solver.h:198
virtual void reIntAfterRestart(MBool)
Definition: solver.h:377
MFloat returnIdleRecord() const
Definition: solver.h:486
virtual void setCellDataDlb(const MInt NotUsed(dataId), const MFloat *const NotUsed(data))
Definition: solver.h:259
void stopIdleTimer(const MString &name)
Definition: solver.h:297
virtual void calcSamplingVariables(const std::vector< MInt > &NotUsed(varIds), const MBool NotUsed(exchange))
Definition: solver.h:177
virtual void setTimeStep()
Definition: solver.h:477
MString m_testcaseDir
Definition: solver.h:37
virtual void writeRestartFile(MBool)
Definition: solver.h:470
MInt * m_bandWidth
Definition: solver.h:94
MString solverMethod() const
Return the solverMethod of this solver.
Definition: solver.h:413
MBool m_restart
Definition: solver.h:97
virtual void getSolverTimings(std::vector< std::pair< MString, MFloat > > &NotUsed(solverTimings), const MBool NotUsed(allTimings))
Definition: solver.h:307
virtual MFloat & a_slope(const MInt, MInt const, const MInt)
Definition: solver.h:151
virtual void initSolver()=0
virtual MBool prepareRestart(MBool, MBool &)
Prepare the solvers for a grid-restart.
Definition: solver.h:374
virtual void finalizeAdaptation()
finalize adaptation for split sadptation after the adaptation loop
Definition: solver.h:350
void setDlbTimer(const MInt timerId)
Definition: solver.h:316
virtual void setGlobalSolverVars(std::vector< MFloat > &NotUsed(globalFloatVars), std::vector< MInt > &NotUsed(globalIdVars))
Definition: solver.h:272
static std::map< MInt, MString > m_aliases
Definition: solver.h:64
virtual MFloat time() const =0
Return the time.
MInt m_domainId
Definition: solver.h:49
void startIdleTimer(const MString &name)
Definition: solver.h:299
std::set< MInt > m_solutionTimeSteps
Definition: solver.h:76
virtual void getSolverSamplingProperties(std::vector< MInt > &NotUsed(samplingVarIds), std::vector< MInt > &NotUsed(noSamplingVars), std::vector< std::vector< MString > > &NotUsed(samplingVarNames), const MString NotUsed(featureName)="")
Definition: solver.h:166
MInt restartTimeStep() const
Return the restart interval of this solver.
Definition: solver.h:422
virtual MInt domainId() const
Return the domainId (rank)
Definition: solver.h:383
void startLoadTimer(const MString name)
Definition: solver.h:293
virtual MInt cellDataSizeDlb(const MInt NotUsed(dataId), const MInt NotUsed(cellId))
Definition: solver.h:237
MPI_Comm m_mpiComm
Definition: solver.h:46
virtual MBool isActive() const
Definition: solver.h:391
MPI_Comm mpiComm() const
Return the MPI communicator used by this solver.
Definition: solver.h:380
virtual void implicitTimeStep()
Definition: solver.h:479
virtual void removeChilds(const MInt)
Coarsen the given cell.
Definition: solver.h:356
virtual MInt noVariables() const
Return the number of variables.
Definition: solver.h:127
virtual void saveSolverSolution(const MBool NotUsed(forceOutput)=false, const MBool NotUsed(finalTimeStep)=false)=0
virtual void postAdaptation()
post adaptation for split adaptation within the adaptation loop
Definition: solver.h:347
virtual void loadRestartFile()
Definition: solver.h:463
virtual void resizeGridMap()
Swap the given cells.
Definition: solver.h:371
MFloat * m_outerBandWidth
Definition: solver.h:92
virtual MFloat getCellLoad(const MInt NotUsed(cellId), const MFloat *const NotUsed(weights)) const
Definition: solver.h:216
MInt solverId() const
Return the solverId.
Definition: solver.h:425
virtual void saveSensorData(const std::vector< std::vector< MFloat > > &, const MInt &, const MString &, const MInt *const)
Definition: solver.h:343
virtual MBool forceAdaptation()
Definition: solver.h:435
virtual MInt getCurrentTimeStep() const
Definition: solver.h:154
virtual void getCellDataDlb(const MInt NotUsed(dataId), const MInt NotUsed(oldNoCells), const MInt *const NotUsed(bufferIdToCellId), MFloat *const NotUsed(data))
Definition: solver.h:249
MBool m_useNonSpecifiedRestartFile
Definition: solver.h:83
virtual void preSolutionStep(MInt)
Definition: solver.h:452
virtual void getGlobalSolverVars(std::vector< MFloat > &NotUsed(globalFloatVars), std::vector< MInt > &NotUsed(globalIntVars))
Definition: solver.h:264
virtual void initSolverSamplingVariables(const std::vector< MInt > &NotUsed(varIds), const std::vector< MInt > &NotUsed(noSamplingVars))
Definition: solver.h:172
MString m_solutionOutput
Definition: solver.h:82
virtual ~Solver()=default
virtual void reinitAfterAdaptation()
Definition: solver.h:332
virtual MBool a_isBndryGhostCell(MInt) const
Definition: solver.h:162
void reEnableDlbTimers()
Definition: solver.h:286
MFloat * m_innerBandWidth
Definition: solver.h:93
std::set< MInt > m_freeIndices
Definition: solver.h:101
MInt m_restartInterval
The number of timesteps before writing the next restart file.
Definition: solver.h:79
virtual MInt noInternalCells() const =0
Return the number of internal cells within this solver.
virtual void balancePre()
Definition: solver.h:197
MString m_restartDir
Definition: solver.h:43
MString getIdentifier(const MBool useSolverId=false, const MString preString="", const MString postString="_")
Definition: solver.cpp:188
virtual void postTimeStep()=0
virtual void setCellWeights(MFloat *)
Set cell weights.
Definition: solver.h:209
MInt m_noDomains
Definition: solver.h:52
virtual void cleanUp()=0
virtual void accessSampleVariables(MInt, MFloat *&)
Definition: solver.h:158
virtual void getLoadQuantities(MInt *const NotUsed(loadQuantities)) const
Definition: solver.h:215
virtual void localToGlobalIds()
Definition: solver.h:219
MString testcaseDir() const
Return the testcase directory.
Definition: solver.h:404
MInt m_residualInterval
The number of timesteps before writing the next residual.
Definition: solver.h:87
virtual void getCellDataDlb(const MInt NotUsed(dataId), const MInt NotUsed(oldNoCells), const MInt *const NotUsed(bufferIdToCellId), MInt *const NotUsed(data))
Definition: solver.h:241
MInt restartInterval() const
Return the restart interval of this solver.
Definition: solver.h:419
MInt m_solutionOffset
Definition: solver.h:75
void enableDlbTimers()
Definition: solver.h:283
virtual void cancelMpiRequests()
Cancel open mpi (receive) requests in the solver (e.g. due to interleaved execution)
Definition: solver.h:206
friend Application
Definition: solver.h:31
MBool m_singleAdaptation
Definition: solver.h:103
MBool dlbTimersEnabled()
Definition: solver.h:291
virtual void setCellDataDlb(const MInt NotUsed(dataId), const MLong *const NotUsed(data))
Definition: solver.h:256
virtual void swapCells(const MInt, const MInt)
Swap the given cells.
Definition: solver.h:362
MInt m_restartOffset
Definition: solver.h:81
const MInt m_solverId
a unique solver identifier
Definition: solver.h:90
virtual MInt cellDataTypeDlb(const MInt NotUsed(dataId)) const
Definition: solver.h:236
virtual MBool solverConverged()
Definition: solver.h:457
virtual MInt noDomains() const
Definition: solver.h:387
virtual MInt noCellDataDlb() const
Methods to inquire solver data information.
Definition: solver.h:235
const MInt m_noDim
Definition: solver.h:60
virtual void setCellDataDlb(const MInt NotUsed(dataId), const MInt *const NotUsed(data))
Definition: solver.h:253
virtual void getDomainDecompositionInformation(std::vector< std::pair< MString, MInt > > &NotUsed(domainInfo))
Definition: solver.h:312
MBool m_restartFile
Definition: solver.h:98
MBool restartFile()
Definition: solver.h:427
MString m_solverType
Definition: solver.h:58
virtual void getSampleVariableNames(std::vector< MString > &NotUsed(varNames))
Definition: solver.h:159
void stopLoadTimer(const MString &name)
Definition: solver.h:295
void initAdaptation()
virtual void refineCell(const MInt)
Refine the given cell.
Definition: solver.h:353
virtual void getCellDataDlb(const MInt NotUsed(dataId), const MInt NotUsed(oldNoCells), const MInt *const NotUsed(bufferIdToCellId), MLong *const NotUsed(data))
Definition: solver.h:245
virtual void limitWeights(MFloat *NotUsed(weights))
Definition: solver.h:217
void updateDomainInfo(const MInt domainId, const MInt noDomains, const MPI_Comm mpiComm, const MString &loc)
Set new domain information.
Definition: solver.h:135
virtual void globalToLocalIds()
Definition: solver.h:226
virtual MBool a_isBndryCell(const MInt) const
Definition: solver.h:152
virtual void prepareAdaptation()
prepare adaptation for split adaptation before the adaptation loop
Definition: solver.h:335
MInt m_solutionInterval
The number of timesteps before writing the next solution file.
Definition: solver.h:74
MString restartDir() const
Return the directory for restart files.
Definition: solver.h:410
virtual void swapProxy(const MInt, const MInt)
Swap the given cells.
Definition: solver.h:365
MFloat returnLoadRecord() const
Definition: solver.h:485
virtual MInt determineRestartTimeStep() const
Definition: solver.h:465
virtual MBool hasRestartTimeStep() const
Definition: solver.h:433
virtual MBool postSolutionStep()
Definition: solver.h:454
virtual void setSensors(std::vector< std::vector< MFloat > > &, std::vector< MFloat > &, std::vector< std::bitset< 64 > > &, std::vector< MInt > &)
set solver sensors for split adaptation within the adaptation loop
Definition: solver.h:338
MString solverType() const
Return the solverType of this solver.
Definition: solver.h:416
MFloat m_Re
the Reynolds number
Definition: solver.h:68
virtual MInt cellOutside(const MFloat *, const MInt, const MInt)
Check whether cell is outside the fluid domain.
Definition: solver.h:368
MFloat m_Ma
the Mach number
Definition: solver.h:71
Solver(const MInt solverId, const MPI_Comm comm, const MBool isActive=true)
virtual void calcSamplingVarAtPoint(const MFloat *NotUsed(point), const MInt NotUsed(id), const MInt NotUsed(sampleVarId), MFloat *NotUsed(state), const MBool NotUsed(interpolate)=false)
Definition: solver.h:180
MString m_outputDir
Definition: solver.h:40
void setSolverStatus(const MBool status)
Definition: solver.h:398
void disableDlbTimers()
Definition: solver.h:289
virtual MFloat & a_FcellVolume(MInt)
Definition: solver.h:153
MString m_solverMethod
Definition: solver.h:57
virtual MBool hasSplitBalancing() const
Return if load balancing for solver is split into multiple methods or implemented in balance()
Definition: solver.h:196
virtual void getDefaultWeights(MFloat *NotUsed(weights), std::vector< MString > &NotUsed(names)) const
Definition: solver.h:212
InfoOutFile m_log
int32_t MInt
Definition: maiatypes.h:62
std::basic_string< char > MString
Definition: maiatypes.h:55
double MFloat
Definition: maiatypes.h:52
int64_t MLong
Definition: maiatypes.h:64
bool MBool
Definition: maiatypes.h:58
DlbTimerController g_dlbTimerController