MAIA bb96820c
Multiphysics at AIA
Loading...
Searching...
No Matches
coupling.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 COUPLING_H_
8#define COUPLING_H_
9
14#include "INCLUDE/maiatypes.h"
16
17#include "LB/lbbndcnd.h"
18#include "LB/lbbndcnddxqy.h"
21#include "LB/lbsolver.h"
22#include "LB/lbsolverdxqy.h"
23
24#include "RB/rigidbodies.h"
25
26/* IDEA:
27 * ===============
28 * | Coupling |
29 * ===============
30 * /|\ /|\
31 * __| |__
32 * | |
33 * ===================== =====================
34 * | CouplingSolver1 | | CouplingSolver2 |
35 * ===================== =====================
36 * /|\ /|\
37 * |__ __|
38 * | |
39 * ===========================
40 * | CouplingSolver1Solver2 |
41 * ===========================
42 *
43 */
44
45
46// Forward declarations
47class Solver;
48
49/* \brief Base class coupler which provides the general call structure and meta information about
50 * the coupled solvers.
51 *
52 * \author Julian Vorspohl
53 * \date 31.01.2020
54 *
55 * This base class for the coupling concept declares the general structure of all solver-solver
56 * couplings and gets called only from within the unified runloop.
57 */
58
59class Coupling {
60 public:
61 Coupling(const MInt couplingId) : m_couplingId(couplingId){};
62 virtual ~Coupling() = default;
63
64 Coupling(const Coupling&) = delete;
65 Coupling& operator=(const Coupling&) = delete;
66
67 MInt couplerId() const { return m_couplingId; };
68
69 virtual void init() = 0;
70
71 virtual void finalizeSubCoupleInit(MInt solverId) = 0;
72 virtual void finalizeCouplerInit() = 0;
73
74 virtual void preCouple(MInt recipeStep) = 0;
75 virtual void subCouple(MInt recipeStep, MInt solverId, std::vector<MBool>& solverCompleted) = 0;
76 virtual void postCouple(MInt recipeStep) = 0;
77
78 virtual void cleanUp() = 0;
79
81 virtual void balancePre() {
82 std::cerr << "WARNING: coupler does not implement balancePre(), which might be necessary for "
83 "balancing to work correctly!"
84 << std::endl;
85 // TERMM(1, "Not implemented for this coupler");
86 };
87 virtual void balancePost() {
88 std::cerr << "WARNING: coupler does not implement balancePost(), which might be necessary for "
89 "balancing to work correctly!"
90 << std::endl;
91 // TERMM(1, "Not implemented for this coupler");
92 };
93 virtual void reinitAfterBalance(){};
94
95 virtual void prepareAdaptation(){};
96 virtual void postAdaptation(){};
97 virtual void finalizeAdaptation(const MInt){};
98
99 virtual void writeRestartFile(const MInt){};
100
102 virtual MInt noCellDataDlb() const { return 0; };
103 virtual MInt cellDataTypeDlb(const MInt NotUsed(dataId)) const { return -1; };
104 virtual MInt cellDataSizeDlb(const MInt NotUsed(dataId), const MInt NotUsed(cellId)) { return -1; };
105 virtual void getCellDataDlb(const MInt NotUsed(dataId), const MInt NotUsed(oldNoCells),
106 const MInt* const NotUsed(bufferIdToCellId), MInt* const NotUsed(data)) {
107 TERMM(1, "Not implemented for coupler.");
108 }
109 virtual void getCellDataDlb(const MInt NotUsed(dataId), const MInt NotUsed(oldNoCells),
110 const MInt* const NotUsed(bufferIdToCellId), MLong* const NotUsed(data)) {
111 TERMM(1, "Not implemented for coupler.");
112 }
113 virtual void getCellDataDlb(const MInt NotUsed(dataId), const MInt NotUsed(oldNoCells),
114 const MInt* const NotUsed(bufferIdToCellId), MFloat* const NotUsed(data)) {
115 TERMM(1, "Not implemented for coupler.");
116 }
117 virtual void setCellDataDlb(const MInt NotUsed(dataId), const MInt* const NotUsed(data)) {
118 TERMM(1, "Not implemented for coupler.");
119 }
120 virtual void setCellDataDlb(const MInt NotUsed(dataId), const MLong* const NotUsed(data)) {
121 TERMM(1, "Not implemented for coupler.");
122 }
123 virtual void setCellDataDlb(const MInt NotUsed(dataId), const MFloat* const NotUsed(data)) {
124 TERMM(1, "Not implemented for coupler.");
125 }
126
127 virtual void finalizeBalance(const MInt){};
128
130 virtual MInt noCouplingTimers(const MBool NotUsed(allTimings)) const {
131 return 0;
132 } // TODO labels:COUPLER,TIMERS set default to 2 (load/idle)?
133
135 virtual void getCouplingTimings(std::vector<std::pair<MString, MFloat>>& NotUsed(timings),
136 const MBool NotUsed(allTimings)){};
137
139 virtual void getDomainDecompositionInformation(std::vector<std::pair<MString, MInt>>& NotUsed(domainInfo)){};
140 void setDlbTimer(const MInt timerId) {
141 if(m_dlbTimerId != -1) {
142 TERMM(1, "m_dlbTimerId already set");
143 }
144 m_dlbTimerId = timerId;
145 }
146
148 inline void startLoadTimer(const MString& name) const {
150 }
152 inline void stopLoadTimer(const MString& name) const {
154 }
155
156
157 protected:
160
161 private:
162 virtual void checkProperties() = 0;
163 virtual void readProperties() = 0;
164
167};
168
169//------------------------------------------------------------------------------------------------
170
171/* \brief Intermediate class for LS coupling.
172 *
173 * \author Julian Vorspohl
174 * \date 31.01.2020
175 *
176 * Holds all accessors to the LS solver and its pointer.
177 *
178 */
179
180template <MInt nDim>
182
183template <MInt nDim>
184class CouplingLS : virtual public Coupling {
185 public:
187 CouplingLS(const MInt couplingId, solverType* b) : Coupling(couplingId) { m_solver = b; }
188 solverType& lsSolver() const { return *m_solver; }
189
190 // pass-through-access to the ls-solver.
191 MInt a_noLsCells() const { return lsSolver().a_noCells(); }
193
194 MInt a_noG0Cells(MInt set) const { return lsSolver().m_G0Cells[set].size(); }
195 MInt a_noBandCells(MInt set) const { return lsSolver().m_bandCells[set].size(); }
196
197 MInt a_maxGCellLevel(const MInt setId) const { return lsSolver().a_maxGCellLevel(setId); }
198
199 MFloat& a_levelSetFunctionG(const MInt cellId, const MInt setId) {
200 return lsSolver().a_levelSetFunctionG(cellId, setId);
201 }
202
203 MInt a_bodyIdG(const MInt cellId, const MInt set) const { return lsSolver().a_bodyIdG(cellId, set); }
204
205 MInt& a_bodyIdG(const MInt cellId, const MInt set) { return lsSolver().a_bodyIdG(cellId, set); }
206
207 MFloat a_coordinateG(const MInt gCellId, const MInt dim) const { return lsSolver().c_coordinate(gCellId, dim); }
208
209 MInt a_G0CellId(const MInt id, const MInt set) const { return lsSolver().a_G0CellId(id, set); }
210
211 MFloat a_normalVectorG(const MInt gCellId, const MInt dim, const MInt set) const {
212 return lsSolver().a_normalVectorG(gCellId, dim, set);
213 }
214
215 MFloat a_curvatureG(const MInt gCellId, const MInt set) const { return lsSolver().a_curvatureG(gCellId, set); }
216
217 MBool a_inBandG(MInt gcellId, MInt set) const { return lsSolver().a_inBandG(gcellId, set); }
219 MBool a_nearGapG(const MInt gcellId) const { return lsSolver().a_nearGapG(gcellId); }
220 MInt a_bodyToSet(const MInt bodyId) const { return lsSolver().m_bodyToSetTable[bodyId]; }
222 MInt a_noSets() const { return lsSolver().m_noSets; }
223 MInt a_maxnoSets() const { return lsSolver().m_maxNoSets; }
224 MInt a_startSet() const { return lsSolver().m_startSet; }
225
226 MFloat& a_extensionVelocityG(const MInt cellId, const MInt dim, const MInt setId) {
227 return lsSolver().a_extensionVelocityG(cellId, dim, setId);
228 }
229
230 private:
232};
233
234template class CouplingLS<2>;
235template class CouplingLS<3>;
236
237//------------------------------------------------------------------------------------------------
238
239
240/* \brief Intermediate class for FvMb coupling.
241 *
242 * \author Julian Vorspohl
243 * \date 31.01.2020
244 *
245 * Holds all accessors to the FvMb solver and its pointer.
246 */
247
248template <MInt nDim, class SysEqn>
249class CouplingFvMb : virtual public Coupling {
250 public:
252 CouplingFvMb(const MInt couplingId, solverType* b) : Coupling(couplingId) { m_solver = b; }
253 solverType& fvMbSolver() const { return *m_solver; }
254
255 // some accesors for easy access
256 MInt a_noFvCells() const { return fvMbSolver().a_noCells(); }
257 MInt a_noFvGridCells() const { return fvMbSolver().c_noCells(); }
258 MInt a_noLevelSetsMb() const { return fvMbSolver().m_noLevelSetsUsedForMb; }
259
260
261 private:
262 void cleanUp() override{};
264};
265
266template class CouplingFvMb<2, FvSysEqnNS<2>>;
267template class CouplingFvMb<3, FvSysEqnNS<3>>;
274
275
276//------------------------------------------------------------------------------------------------
277
278/* \brief Intermediate class for DG coupling.
279 *
280 * \author Ansgar Niemoeller
281 *
282 * Holds all accessors to the DG solver and its pointer.
283 */
284
285template <MInt nDim, class SysEqn>
287
288template <MInt nDim, class SysEqn>
289class CouplingDg : virtual public Coupling {
290 // Typedefs
291 public:
293
294 CouplingDg(const MInt couplingId, solverType* b) : Coupling(couplingId), m_dgSolver(b) {}
295 virtual ~CouplingDg() = default;
296
297 protected:
299
301 /* using ProjectionType = DgGalerkinProjection<nDim>; */
302
304 /* MPI_Comm mpiComm() const { return dgSolver().mpiComm(); } */
305
307 /* MInt domainId() const { return dgSolver().domainId(); } */
308
309 public:
310 solverType& dgSolver() const { return *m_dgSolver; }
311
312 using CV = typename SysEqn::CV;
313
315 MInt solverId() const { return dgSolver().solverId(); }
316
318 SysEqn& sysEqn() { return dgSolver().m_sysEqn; }
319
322
324 MInt noElements() const { return dgSolver().m_elements.size(); }
325
328
330 MInt getElementByCellId(const MInt cellId) { return dgSolver().getElementByCellId(cellId); }
331
333 MInt minPolyDeg() const { return dgSolver().m_minPolyDeg; }
334
336 MInt maxPolyDeg() const { return dgSolver().m_maxPolyDeg; }
337
339 MString outputDir() const { return dgSolver().outputDir(); }
340
342 void saveNodalData(const MString& fileNameBase,
343 const MInt noVars,
344 const std::vector<MString>& varNames,
345 const MFloat* const data) const {
346 dgSolver().saveNodalData(fileNameBase, noVars, varNames, data);
347 }
348};
349
350
351//------------------------------------------------------------------------------------------------
352
353/* \brief Intermediate class for Fv coupling.
354 *
355 * \author Ansgar Niemoeller
356 *
357 * Holds all accessors to the FV solver and its pointer.
358 */
359
360template <MInt nDim, class SysEqn>
361class CouplingFv : virtual public Coupling {
362 public:
364
365 CouplingFv(const MInt couplingId, std::vector<FvCartesianSolverXD<nDim, SysEqn>*> fvSolvers, const MInt noSolvers)
366 : Coupling(couplingId), m_fvSolvers(fvSolvers) {
367 TRACE();
368
369 // Store solver pointers
370 ASSERT(noSolvers == static_cast<MInt>(fvSolvers.size()), "Currently only works using this assumption...");
371 }
372
373 CouplingFv(const MInt couplingId, Solver* solvers) : Coupling(couplingId) {
374 TRACE();
375
376 // Store solver pointers
377 m_fvSolvers.push_back(static_cast<solverType*>(solvers));
378 }
379 ~CouplingFv() override = default;
380 CouplingFv(const CouplingFv&) = delete;
381 CouplingFv& operator=(const CouplingFv&) = delete;
382
383 protected:
384 // Auxiliary methods
385 MInt noSolvers() const { return m_fvSolvers.size(); }
386 solverType& fvSolver(const MInt solverId = 0) const {
387 ASSERT(solverId < noSolvers(), "Invalid solverId " + std::to_string(solverId) + "/" + std::to_string(noSolvers()));
388 return *m_fvSolvers[solverId];
389 }
390
391 MInt a_noFvCells() const { return m_fvSolvers[0]->a_noCells(); }
392 MInt a_noFvGridCells() const { return m_fvSolvers[0]->c_noCells(); }
393
394 protected:
395 std::vector<solverType*> m_fvSolvers{};
396};
397
398template class CouplingFv<2, FvSysEqnNS<2>>;
399template class CouplingFv<3, FvSysEqnNS<3>>;
408template class CouplingFv<3, FvSysEqnEEGas<3>>;
409
410
411//------------------------------------------------------------------------------------------------
412
413/* \brief Intermediate class for LB coupling.
414 *
415 * \author Julian Vorspohl
416 * \date 31.01.2020
417 *
418 * Holds all accessors to the LB solver and its pointer.
419 */
420
421template <MInt nDim>
423
424template <MInt nDim, MInt nDist, class SysEqn>
425class LbBndCndDxQy;
426
427template <MInt nDim, MInt nDist, class SysEqn>
428class CouplingLB : virtual public Coupling {
429 public:
433
434 CouplingLB(const MInt couplingId, Solver* solvers, const MInt noSolvers = 1) : Coupling(couplingId) {
435 TRACE();
436
437 // Store solver pointers
438 for(MInt i = 0; i < noSolvers; i++) {
439 m_lbSolvers.push_back(static_cast<solverType*>(&solvers[i]));
440 }
441 }
442
443 CouplingLB(const MInt couplingId, std::vector<solverType*> solvers) : Coupling(couplingId) {
444 TRACE();
445
446 // Store solver pointers
447 for(const auto& solver : solvers) {
448 m_lbSolvers.push_back(static_cast<solverType*>(solver));
449 }
450 }
451
452 protected:
453 MInt noSolvers() const { return m_lbSolvers.size(); }
454 solverType& lbSolver(const MInt solverId = 0) const {
455 ASSERT(solverId < noSolvers(), "Invalid solverId " + std::to_string(solverId) + "/" + std::to_string(noSolvers()));
456 return *m_lbSolvers[solverId];
457 }
458
459 // LbBndCnd* m_lbBndCnd;
460
461 LbBndCnd& lbBndCnd(const MInt id = 0) { return *lbSolver(id).m_bndCnd; }
462
463 private:
464 std::vector<solverType*> m_lbSolvers{};
465
466 public:
467 MFloat a_physicalTime() const { return globalTimeStep; } // The nondimensional time in LB is the globalTimeStep
468 MFloat lsTimeStep() const { return 1.0; } // The nondimensional time step in LB is 1
469 MInt a_RKStep() const { return 0; } // There is no Runge Kutta Step in LB
470 MInt a_noLbCells(const MInt id = 0) const { return lbSolver(id).a_noCells(); }
471 MInt a_noLevelSetsMb(const MInt id = 0) const { return lbSolver(id).m_noLevelSetsUsedForMb; }
472 MFloat a_Ma(const MInt id = 0) const { return lbSolver(id).m_Ma; }
473 MFloat a_Re(const MInt id = 0) const { return lbSolver(id).m_Re; }
474 MInt a_pvu(const MInt id = 0) const { return lbSolver(id).PV->U; }
475 MInt a_pvv(const MInt id = 0) const { return lbSolver(id).PV->V; }
476 MInt a_pvw(const MInt id = 0) const { return lbSolver(id).PV->W; }
477 MInt a_pvrho(const MInt id = 0) const { return lbSolver(id).PV->RHO; }
478 MInt a_pvt(const MInt id = 0) const { return lbSolver(id).PV->T; }
479 MInt a_isThermal(const MInt id = 0) const { return lbSolver(id).m_isThermal; }
480
481 MInt a_noDistributions(const MInt id = 0) const { return lbSolver(id).m_noDistributions; }
482 MFloat a_initTemperatureKelvin(const MInt id = 0) const { return lbSolver(id).m_initTemperatureKelvin; }
483
484 MFloat a_time() const { return globalTimeStep; }
485 // Access LB-BndCnd related values
487 MInt a_boundaryCellMb(const MInt cellId, const MInt id = 0) { return lbBndCnd(id).a_boundaryCellMb(cellId); }
488
489 // Access LS-related values in LB solver, should be moved at some point ~jv
490 MFloat& a_levelSetFunctionMb(const MInt cellId, const MInt set, const MInt id = 0) {
491 return lbSolver(id).a_levelSetFunctionMB(cellId, set);
492 }
493
494 MFloat a_levelSetFunctionMb(const MInt cellId, const MInt set, const MInt id = 0) const {
495 return lbSolver(id).a_levelSetFunctionMB(cellId, set);
496 }
497
498 MInt& a_associatedBodyIdsMb(const MInt cellId, const MInt set, const MInt id = 0) {
499 return lbSolver(id).a_associatedBodyIds(cellId, set);
500 }
501
502 MInt a_associatedBodyIdsMb(const MInt cellId, const MInt set, const MInt id = 0) const {
503 return lbSolver(id).a_associatedBodyIds(cellId, set);
504 }
505
506 MInt a_parentId(const MInt cellId, const MInt id = 0) { return lbSolver(id).c_parentId(cellId); }
507
508 MInt a_childId(const MInt cellId, const MInt child, const MInt id = 0) {
509 return lbSolver(id).c_childId(cellId, child);
510 }
511
512 MInt minCell(const MInt index, const MInt id = 0) const { return lbSolver(id).grid().minCell(index); }
513
514 MInt noMinCells(const MInt id = 0) const { return lbSolver(id).grid().noMinCells(); }
515
516 MInt a_noCells(const MInt id = 0) const { return lbSolver(id).grid().noCells(); }
517
518 MFloat a_cellLengthAtLevel(MInt level, const MInt id = 0) { return lbSolver(id).grid().cellLengthAtLevel(level); }
519
520 MInt a_noEmbeddedBodiesLB(const MInt id = 0) const { return lbSolver(id).m_noEmbeddedBodies; }
521
522 MBool a_isActive(const MInt cellId, const MInt id = 0) const { return lbSolver(id).a_isActive(cellId); }
523
524 MBool a_wasActive(const MInt cellId, const MInt id = 0) const { return lbSolver(id).a_wasActive(cellId); }
525
526 MInt a_noVariables(const MInt id = 0) const { return lbSolver(id).noVariables(); }
527
528 MFloat& a_variable(const MInt cellId, const MInt varId, const MInt id = 0) {
529 return lbSolver(id).a_variable(cellId, varId);
530 }
531
532 // MFloat& a_oldVariable(const MInt cellId, const MInt varId) { return lbSolver().a_oldVariable(cellId, varId); }
533 MFloat& a_oldVariable(const MInt cellId, const MInt varId, const MInt id = 0) {
534 return lbSolver(id).a_oldVariable(cellId, varId);
535 }
536
537 MInt a_bndCellId(const MInt bndCell, const MInt id = 0) { return lbBndCnd(id).m_bndCells[bndCell].m_cellId; }
538
539 MInt a_noBndCells(const MInt id = 0) { return lbBndCnd(id).m_bndCells.size(); }
540};
541
545
546/* \brief Intermediate class for LPT coupling.
547 *
548 * \author Tim Wegmann
549 * \date 24.10.2020
550 *
551 * Holds all accessors to the LPT solver and its pointer.
552 *
553 */
554template <MInt nDim>
555class LPT;
556
557template <MInt nDim>
558class CouplingParticle : virtual public Coupling {
559 public:
561
562 CouplingParticle(const MInt couplingId, LPT<nDim>* solver) : Coupling(couplingId) { m_particleSolver = solver; }
563
564 private:
565 // suppressed functions
566 void subCouple(MInt /*recipeStep*/, MInt /*solverId*/, std::vector<MBool>& /*solverCompleted*/) override{};
567 void preCouple(MInt /*recipeStep*/) override{};
568 void postCouple(MInt /*recipeStep*/) override{};
569 void finalizeCouplerInit() override{};
570 void checkProperties() override{};
571 void readProperties() override{};
572 void finalizeSubCoupleInit(MInt /*solverId*/) override{};
573 void cleanUp() override{};
574
575 protected:
576 virtual LPT<nDim>& lpt() const { return *m_particleSolver; }
577
578 private:
580};
581template class CouplingParticle<3>;
582
583template <MInt nDim>
584class CouplingRigidBodies : virtual public Coupling {
585 public:
587
588 CouplingRigidBodies(const MInt couplingId, RBodies* solver) : Coupling(couplingId) { m_rigidBodies = solver; }
589
590 MInt a_noEmbeddedBodies() const { return bodies().noEmbeddedBodies(); }
591 MInt a_noCollectorBodies() const { return bodies().noCollectorBodies(); }
592
593 protected:
594 RBodies& bodies() const { return *m_rigidBodies; }
595
596 private:
598};
599template class CouplingRigidBodies<2>;
600template class CouplingRigidBodies<3>;
601
602#endif // COUPLING_H_
virtual ~CouplingDg()=default
typename SysEqn::CV CV
Definition: coupling.h:312
MFloat * externalSource() const
Return pointer to external source memory.
Definition: coupling.h:327
MInt noElements() const
Return number of elements.
Definition: coupling.h:324
MString outputDir() const
Return output directory.
Definition: coupling.h:339
MInt minPolyDeg() const
Return the minimum polynomial degree.
Definition: coupling.h:333
SysEqn & sysEqn()
Return reference to SysEqn object.
Definition: coupling.h:318
void saveNodalData(const MString &fileNameBase, const MInt noVars, const std::vector< MString > &varNames, const MFloat *const data) const
Save nodal data to file.
Definition: coupling.h:342
ElementCollector & elements()
Return reference to elements.
Definition: coupling.h:321
solverType & dgSolver() const
Return MPI communicator.
Definition: coupling.h:310
MInt solverId() const
Return solver id.
Definition: coupling.h:315
solverType * m_dgSolver
Definition: coupling.h:298
CouplingDg(const MInt couplingId, solverType *b)
Definition: coupling.h:294
MInt getElementByCellId(const MInt cellId)
Return element id for cell id.
Definition: coupling.h:330
MInt maxPolyDeg() const
Return the maximum polynomial degree.
Definition: coupling.h:336
MInt a_noFvGridCells() const
Definition: coupling.h:392
solverType & fvSolver(const MInt solverId=0) const
Definition: coupling.h:386
~CouplingFv() override=default
CouplingFv(const MInt couplingId, Solver *solvers)
Definition: coupling.h:373
CouplingFv(const MInt couplingId, std::vector< FvCartesianSolverXD< nDim, SysEqn > * > fvSolvers, const MInt noSolvers)
Definition: coupling.h:365
CouplingFv(const CouplingFv &)=delete
std::vector< solverType * > m_fvSolvers
Definition: coupling.h:395
MInt noSolvers() const
Definition: coupling.h:385
CouplingFv & operator=(const CouplingFv &)=delete
MInt a_noFvCells() const
Definition: coupling.h:391
solverType & fvMbSolver() const
Definition: coupling.h:253
CouplingFvMb(const MInt couplingId, solverType *b)
Definition: coupling.h:252
MInt a_noFvCells() const
Definition: coupling.h:256
void cleanUp() override
Definition: coupling.h:262
MInt a_noLevelSetsMb() const
Definition: coupling.h:258
solverType * m_solver
Definition: coupling.h:263
MInt a_noFvGridCells() const
Definition: coupling.h:257
virtual void getCellDataDlb(const MInt NotUsed(dataId), const MInt NotUsed(oldNoCells), const MInt *const NotUsed(bufferIdToCellId), MLong *const NotUsed(data))
Definition: coupling.h:109
virtual void setCellDataDlb(const MInt NotUsed(dataId), const MInt *const NotUsed(data))
Definition: coupling.h:117
virtual void finalizeAdaptation(const MInt)
Definition: coupling.h:97
virtual MInt cellDataSizeDlb(const MInt NotUsed(dataId), const MInt NotUsed(cellId))
Definition: coupling.h:104
virtual void balancePost()
Definition: coupling.h:87
virtual MInt cellDataTypeDlb(const MInt NotUsed(dataId)) const
Definition: coupling.h:103
virtual void getCellDataDlb(const MInt NotUsed(dataId), const MInt NotUsed(oldNoCells), const MInt *const NotUsed(bufferIdToCellId), MFloat *const NotUsed(data))
Definition: coupling.h:113
virtual void preCouple(MInt recipeStep)=0
virtual MInt noCellDataDlb() const
Methods to inquire coupler data during balancing.
Definition: coupling.h:102
virtual void getCouplingTimings(std::vector< std::pair< MString, MFloat > > &NotUsed(timings), const MBool NotUsed(allTimings))
Return coupling timings.
Definition: coupling.h:135
MInt m_couplingId
Definition: coupling.h:165
virtual void postCouple(MInt recipeStep)=0
virtual void cleanUp()=0
virtual void getDomainDecompositionInformation(std::vector< std::pair< MString, MInt > > &NotUsed(domainInfo))
Return information on current domain decomposition (e.g. number of coupled cells/elements/....
Definition: coupling.h:139
virtual void prepareAdaptation()
Definition: coupling.h:95
void setDlbTimer(const MInt timerId)
Definition: coupling.h:140
virtual MInt noCouplingTimers(const MBool NotUsed(allTimings)) const
Number of coupling timers.
Definition: coupling.h:130
Coupling & operator=(const Coupling &)=delete
virtual void finalizeBalance(const MInt)
Definition: coupling.h:127
virtual void getCellDataDlb(const MInt NotUsed(dataId), const MInt NotUsed(oldNoCells), const MInt *const NotUsed(bufferIdToCellId), MInt *const NotUsed(data))
Definition: coupling.h:105
Coupling(const Coupling &)=delete
virtual void finalizeCouplerInit()=0
MFloat returnIdleRecord() const
Definition: coupling.h:159
virtual ~Coupling()=default
virtual void checkProperties()=0
MInt m_dlbTimerId
Definition: coupling.h:166
virtual void balancePre()
Load balancing.
Definition: coupling.h:81
virtual void subCouple(MInt recipeStep, MInt solverId, std::vector< MBool > &solverCompleted)=0
void stopLoadTimer(const MString &name) const
Stop the load timer of the coupler.
Definition: coupling.h:152
void startLoadTimer(const MString &name) const
Start the load timer of the coupler.
Definition: coupling.h:148
MFloat returnLoadRecord() const
Definition: coupling.h:158
Coupling(const MInt couplingId)
Definition: coupling.h:61
virtual void finalizeSubCoupleInit(MInt solverId)=0
virtual void setCellDataDlb(const MInt NotUsed(dataId), const MLong *const NotUsed(data))
Definition: coupling.h:120
virtual void writeRestartFile(const MInt)
Definition: coupling.h:99
virtual void postAdaptation()
Definition: coupling.h:96
MInt couplerId() const
Definition: coupling.h:67
virtual void readProperties()=0
virtual void init()=0
virtual void reinitAfterBalance()
Definition: coupling.h:93
virtual void setCellDataDlb(const MInt NotUsed(dataId), const MFloat *const NotUsed(data))
Definition: coupling.h:123
MInt a_noDistributions(const MInt id=0) const
Definition: coupling.h:481
MInt a_isThermal(const MInt id=0) const
Definition: coupling.h:479
MBool a_isActive(const MInt cellId, const MInt id=0) const
Definition: coupling.h:522
MFloat a_Re(const MInt id=0) const
Definition: coupling.h:473
MFloat a_cellLengthAtLevel(MInt level, const MInt id=0)
Definition: coupling.h:518
MInt a_noBndCells(const MInt id=0)
Definition: coupling.h:539
MFloat a_levelSetFunctionMb(const MInt cellId, const MInt set, const MInt id=0) const
Definition: coupling.h:494
MFloat & a_oldVariable(const MInt cellId, const MInt varId, const MInt id=0)
Definition: coupling.h:533
MInt a_bndCellId(const MInt bndCell, const MInt id=0)
Definition: coupling.h:537
solverType & lbSolver(const MInt solverId=0) const
Definition: coupling.h:454
MInt a_pvt(const MInt id=0) const
Definition: coupling.h:478
std::vector< solverType * > m_lbSolvers
Definition: coupling.h:464
MInt a_associatedBodyIdsMb(const MInt cellId, const MInt set, const MInt id=0) const
Definition: coupling.h:502
MInt a_pvrho(const MInt id=0) const
Definition: coupling.h:477
MInt a_childId(const MInt cellId, const MInt child, const MInt id=0)
Definition: coupling.h:508
MInt & a_associatedBodyIdsMb(const MInt cellId, const MInt set, const MInt id=0)
Definition: coupling.h:498
MInt noSolvers() const
Definition: coupling.h:453
MInt a_noLevelSetsMb(const MInt id=0) const
Definition: coupling.h:471
MBool a_wasActive(const MInt cellId, const MInt id=0) const
Definition: coupling.h:524
MInt a_boundaryCellMb(const MInt cellId, const MInt id=0)
Definition: coupling.h:487
MFloat a_initTemperatureKelvin(const MInt id=0) const
Definition: coupling.h:482
MInt a_pvv(const MInt id=0) const
Definition: coupling.h:475
MInt a_pvu(const MInt id=0) const
Definition: coupling.h:474
MFloat a_time() const
Definition: coupling.h:484
CouplingLB(const MInt couplingId, std::vector< solverType * > solvers)
Definition: coupling.h:443
MInt a_pvw(const MInt id=0) const
Definition: coupling.h:476
MInt a_noCells(const MInt id=0) const
Definition: coupling.h:516
MFloat a_physicalTime() const
Definition: coupling.h:467
MFloat a_Ma(const MInt id=0) const
Definition: coupling.h:472
MFloat & a_variable(const MInt cellId, const MInt varId, const MInt id=0)
Definition: coupling.h:528
LbBndCnd & lbBndCnd(const MInt id=0)
Definition: coupling.h:461
MInt a_noEmbeddedBodiesLB(const MInt id=0) const
Definition: coupling.h:520
MInt noMinCells(const MInt id=0) const
Definition: coupling.h:514
MInt a_noVariables(const MInt id=0) const
Definition: coupling.h:526
MbCellCollector & a_mbCell(const MInt id=0)
Definition: coupling.h:486
MInt a_noLbCells(const MInt id=0) const
Definition: coupling.h:470
CouplingLB(const MInt couplingId, Solver *solvers, const MInt noSolvers=1)
Definition: coupling.h:434
MFloat lsTimeStep() const
Definition: coupling.h:468
MInt a_parentId(const MInt cellId, const MInt id=0)
Definition: coupling.h:506
MInt minCell(const MInt index, const MInt id=0) const
Definition: coupling.h:512
MInt a_RKStep() const
Definition: coupling.h:469
MFloat & a_levelSetFunctionMb(const MInt cellId, const MInt set, const MInt id=0)
Definition: coupling.h:490
MInt a_noG0Cells(MInt set) const
Definition: coupling.h:194
MInt a_startSet() const
Definition: coupling.h:224
solverType & lsSolver() const
Definition: coupling.h:188
MInt a_bodyIdG(const MInt cellId, const MInt set) const
Definition: coupling.h:203
MInt a_noLsCells() const
Definition: coupling.h:191
MFloat a_normalVectorG(const MInt gCellId, const MInt dim, const MInt set) const
Definition: coupling.h:211
MBool a_inBandG(MInt gcellId, MInt set) const
Definition: coupling.h:217
MInt a_noSets() const
Definition: coupling.h:222
MInt a_bodyToSet(const MInt bodyId) const
Definition: coupling.h:220
MInt a_noEmbeddedBodies() const
Definition: coupling.h:221
MInt a_maxnoSets() const
Definition: coupling.h:223
MFloat a_curvatureG(const MInt gCellId, const MInt set) const
Definition: coupling.h:215
MBool a_nearGapG(const MInt gcellId) const
Definition: coupling.h:219
MFloat & a_extensionVelocityG(const MInt cellId, const MInt dim, const MInt setId)
Definition: coupling.h:226
MInt a_potentialGapCellClose(MInt gcellId) const
Definition: coupling.h:218
MInt & a_bodyIdG(const MInt cellId, const MInt set)
Definition: coupling.h:205
MInt a_maxGCellLevel(const MInt setId) const
Definition: coupling.h:197
MFloat a_coordinateG(const MInt gCellId, const MInt dim) const
Definition: coupling.h:207
MInt a_noBandCells(MInt set) const
Definition: coupling.h:195
MInt a_G0CellId(const MInt id, const MInt set) const
Definition: coupling.h:209
CouplingLS(const MInt couplingId, solverType *b)
Definition: coupling.h:187
MFloat a_outsideGValue() const
Definition: coupling.h:192
solverType * m_solver
Definition: coupling.h:231
MFloat & a_levelSetFunctionG(const MInt cellId, const MInt setId)
Definition: coupling.h:199
CouplingParticle(const MInt couplingId, LPT< nDim > *solver)
Definition: coupling.h:562
void finalizeSubCoupleInit(MInt) override
Definition: coupling.h:572
void cleanUp() override
Definition: coupling.h:573
LPT< nDim > * m_particleSolver
Definition: coupling.h:579
virtual LPT< nDim > & lpt() const
Definition: coupling.h:576
void finalizeCouplerInit() override
Definition: coupling.h:569
void readProperties() override
Definition: coupling.h:571
void subCouple(MInt, MInt, std::vector< MBool > &) override
Definition: coupling.h:566
void preCouple(MInt) override
Definition: coupling.h:567
void checkProperties() override
Definition: coupling.h:570
void postCouple(MInt) override
Definition: coupling.h:568
CouplingRigidBodies(const MInt couplingId, RBodies *solver)
Definition: coupling.h:588
MInt a_noEmbeddedBodies() const
Definition: coupling.h:590
MInt a_noCollectorBodies() const
Definition: coupling.h:591
RBodies * m_rigidBodies
Definition: coupling.h:597
RBodies & bodies() const
Definition: coupling.h:594
void saveNodalData(const MString &fileNameBase, const MInt noVars, const std::vector< MString > &varNames, const MFloat *const data) const
Save nodal data to file.
ElementCollector m_elements
void startLoadTimer(const MInt dlbTimerId, const MString &name)
Start the load timer for the given DLB timer id.
Definition: dlbtimer.h:334
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
MFloat returnIdleRecord(const MInt dlbTimerId, const MInt mode=0)
Return the idle record of a DLB timer.
Definition: dlbtimer.h:474
Definition: lpt.h:82
std::vector< LbGridBoundaryCell< nDim > > m_bndCells
Definition: lbbndcnd.h:130
MbCellCollector m_boundaryCellsMb
Definition: lbbndcnd.h:57
MInt a_boundaryCellMb(const MInt cellId)
Definition: lbbndcnd.h:83
This class represents all LB models.
Definition: lbsolverdxqy.h:29
static constexpr MInt m_noDistributions
Definition: lbsolverdxqy.h:180
LbBndCnd * m_bndCnd
Pointers for the Boundary Conditions, for flow solving.
Definition: lbsolverdxqy.h:332
MFloat & a_curvatureG(const MInt cellId, const MInt set)
Returns curvature of the cell cellId for set set.
maia::ls::cell::BitsetType::reference a_nearGapG(const MInt cellId)
MInt a_maxGCellLevel(const MInt set=-1) const
MFloat & a_levelSetFunctionG(const MInt cellId, const MInt set)
Returns levelSetFunction of the cell cellId.
std::vector< MInt > * m_G0Cells
MFloat & a_normalVectorG(const MInt cellId, const MInt dim, const MInt set)
Returns normalVector of the cell cellId for index n.
MInt a_noCells() const
MInt & a_potentialGapCellClose(const MInt id)
Returns the potential gap cell closecellId.
maia::ls::cell::BitsetTypeSet::reference a_inBandG(const MInt cellId, const MInt set)
std::vector< MInt > * m_bandCells
MFloat c_coordinate(const MInt gCellId, const MInt dim) const
Returns the coordinate of the cell cellId for direction dim.
constexpr MInt a_G0CellId(MInt id, MInt set) const
MFloat & a_extensionVelocityG(const MInt cellId, const MInt dim, const MInt set)
Returns fExt of the cell cellId for index n.
MInt & a_bodyIdG(const MInt cellId, const MInt set)
Returns bodyId of the cell cellId for set set.
Parent class of all solvers This class is the base for all solvers. I.e. all solver class (e....
Definition: solver.h:29
MString outputDir() const
Return the directory for output files.
Definition: solver.h:407
MInt solverId() const
Return the solverId.
Definition: solver.h:425
constexpr MInt size() const
Return size (i.e., currently used number of nodes)
Definition: container.h:89
Class that represents DG element collector.
MFloat & externalSource(const MInt id)
Accessor for external source terms.
Class that represents LB cell collector.
MInt globalTimeStep
int32_t MInt
Definition: maiatypes.h:62
std::basic_string< char > MString
Definition: maiatypes.h:55
double MFloat
Definition: maiatypes.h:52
MInt * solvers
Definition: maiatypes.h:72
int64_t MLong
Definition: maiatypes.h:64
bool MBool
Definition: maiatypes.h:58
DlbTimerController g_dlbTimerController