MAIA bb96820c
Multiphysics at AIA
Loading...
Searching...
No Matches
couplerlblb.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 COUPLERLBLB_H_
8#define COUPLERLBLB_H_
9
10#include <algorithm>
11#include "LB/lbbndcnd.h"
12#include "LB/lbbndcnddxqy.h"
13#include "LB/lbcellcollector.h"
14#include "LB/lbcellproperties.h"
16#include "LB/lbsolver.h"
17#include "LB/lbsolverdxqy.h"
18#include "UTIL/pointbox.h"
19#include "enums.h"
20#include "solver.h"
21
22#include "coupling.h"
23#include "couplingutils.h"
24
25template <MInt nDim, MInt nDist, class SysEqn>
26class LbSolverDxQy;
27template <MInt nDim, MInt nDist, class SysEqn>
28class LbBndCndDxQy;
29
30template <MInt nDim, MInt nDist, class SysEqn>
31class CouplingLB;
32
33
34// This coupler transfers data on the same grid from its first solver to its second solver
35// The transfer of data takes place in all cells, that are located within the m_transferBox
36template <MInt nDim, MInt nDist, class SysEqn>
37class CouplerLbLb : public CouplingLB<nDim, nDist, SysEqn> {
38 private:
39 friend class LbSolverDxQy<nDim, nDist, SysEqn>;
40 friend class LbBndCndDxQy<nDim, nDist, SysEqn>;
41
42 public:
43 // Simplifications
45
47
49
50 // Constructor
51 // The first solver is the source, the second solver is the destination
52 CouplerLbLb<nDim, nDist, SysEqn>(const MInt couplingId, std::vector<LbSolver*> solvers);
54
55 private:
58 std::array<MFloat, 2 * nDim> m_transferBox{};
59 std::vector<MInt> m_transferCellIds;
64
65 protected:
67 using Base::a_childId;
68 using Base::a_noCells;
70 using Base::a_parentId;
71 using Base::lbSolver;
72 using Base::minCell;
73 using Base::noMinCells;
74
75 //--------------------------------- functions ------------------------------------------------------
76
77 private:
78 void initData();
79
80 void cleanUp() override{};
81
82 LbSolver& sourceSolver() const { return lbSolver(0); }
83 LbSolver& destSolver() const { return lbSolver(1); }
84
85 MInt source2DestId(const MInt sourceId) const { return convertId(sourceSolver(), destSolver(), sourceId); };
86 MInt dest2SourceId(const MInt destId) const { return convertId(destSolver(), sourceSolver(), destId); };
87
88 public:
89 virtual void init();
90 virtual void checkProperties(){};
91 virtual void preCouple(MInt){};
92 virtual void postCouple(MInt);
93 virtual void finalizeCouplerInit(){};
94 virtual void finalizeSubCoupleInit(MInt){};
95 virtual void subCouple(MInt, MInt, std::vector<MBool>&){};
96 virtual void readProperties();
97
99};
100
101
102#endif // ifndef COUPLERLBLB_H_
GridCell
Grid cell Property Labels.
virtual void init()
Definition: couplerlblb.cpp:31
MInt source2DestId(const MInt sourceId) const
Definition: couplerlblb.h:85
void initData()
Definition: couplerlblb.cpp:25
MInt dest2SourceId(const MInt destId) const
Definition: couplerlblb.h:86
typename maia::grid::tree::Tree< nDim >::Cell Cell
Definition: couplerlblb.h:46
solverType & lbSolver(const MInt solverId=0) const
Definition: coupling.h:454
virtual void checkProperties()
Definition: couplerlblb.h:90
void testCoupling()
virtual void preCouple(MInt)
Definition: couplerlblb.h:91
MInt * m_dataBlockSizes
Definition: couplerlblb.h:63
MFloat ** m_sourceBaseAddresses
Definition: couplerlblb.h:61
virtual void subCouple(MInt, MInt, std::vector< MBool > &)
Definition: couplerlblb.h:95
virtual void readProperties()
std::vector< MInt > m_transferCellIds
Definition: couplerlblb.h:59
LbSolver & destSolver() const
Definition: couplerlblb.h:83
MFloat ** m_destBaseAddresses
Definition: couplerlblb.h:62
std::array< MFloat, 2 *nDim > m_transferBox
Definition: couplerlblb.h:58
MInt m_sourceSolverId
Definition: couplerlblb.h:56
void cleanUp() override
Definition: couplerlblb.h:80
virtual void finalizeSubCoupleInit(MInt)
Definition: couplerlblb.h:94
MInt m_destSolverId
Definition: couplerlblb.h:57
virtual void postCouple(MInt)
LbSolver & sourceSolver() const
Definition: couplerlblb.h:82
virtual void finalizeCouplerInit()
Definition: couplerlblb.h:93
MInt m_noVarsTransfer
Definition: couplerlblb.h:60
MFloat a_cellLengthAtLevel(MInt level, const MInt id=0)
Definition: coupling.h:518
solverType & lbSolver(const MInt solverId=0) const
Definition: coupling.h:454
MInt a_childId(const MInt cellId, const MInt child, const MInt id=0)
Definition: coupling.h:508
MInt a_noCells(const MInt id=0) const
Definition: coupling.h:516
MInt noMinCells(const MInt id=0) const
Definition: coupling.h:514
MInt a_noLbCells(const MInt id=0) const
Definition: coupling.h:470
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
This class represents all LB models.
Definition: lbsolverdxqy.h:29
MInt convertId(SolverA &solverA, SolverB &solverB, const MInt solverAId)
Conversion from solverA id to the solverB id on the same-level only!
Definition: couplingutils.h:21
int32_t MInt
Definition: maiatypes.h:62
double MFloat
Definition: maiatypes.h:52
MInt * solvers
Definition: maiatypes.h:72