MAIA bb96820c
Multiphysics at AIA
Loading...
Searching...
No Matches
lbinterfacedxqy.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 LBINTERFACEDXQY_H
8#define LBINTERFACEDXQY_H
9
10#include "lbinterface.h"
11#include "lblatticedescriptor.h"
12#include "lbsolverdxqy.h"
13
14template <MInt nDim, MInt nDist, class SysEqn>
15class LbSolverDxQy;
21template <MInt nDim, MInt nDist, class SysEqn>
22class LbInterfaceDxQy : public LbInterface<nDim> {
23 public:
24 template <MInt nDim_, MInt nDist_, class SysEqn_>
25 friend class LbSolverDxQy;
26
27 public:
28 // Add fields used from template base class to avoid calling with 'this->'
31 using LbInterface<nDim>::PV;
34 using LbInterface<nDim>::m_Fext;
35 using LbInterface<nDim>::m_isEELiquid;
36 using LbInterface<nDim>::m_Fg;
37 using LbInterface<nDim>::m_isThermal;
41
43
45
48
49 // Main interface functions
50 void prolongation();
51 void restriction();
52
53 virtual void refineCell(const MInt parentId, const MInt* childIds) override final;
54 virtual void removeChildren(const MInt parentId) override final;
55
56 protected:
57 // Interface functions
58 virtual void prolongation0(){};
59 virtual void restriction0(){};
60
61 virtual void prolongation10();
62 virtual void restriction10();
63
64 template <MBool compressible = false>
66 template <MBool compressible = false>
67 void restrictionDupuis_();
68
69 virtual void prolongationDupuis();
70 virtual void restrictionDupuis();
71
74
75 virtual void prolongationRohde();
76 virtual void restrictionRohde();
77
78 virtual void prolongationThermalDupuis();
79 virtual void restrictionThermalDupuis();
80
81 virtual void prolongationThermalRohde();
82 virtual void restrictionThermalRohde();
83
84 // Functions for adaptive mesh refinement
85 virtual void refineCellDupuis(const MInt parentId, const MInt* childIds);
86 virtual void refineCellCopyPaste(const MInt parentId, const MInt* childIds);
87 virtual void removeChildsDupuisFilippova(const MInt parentId);
88 virtual void removeChildsCopyPaste(const MInt parentId);
89
90 inline void getCellForcing(std::array<MFloat, nDist>& F, const MInt cellId = -1);
91
92 private:
93 // sets the prolongation and restriction routines
95
99
100 // Sets the refine and coarsen functions
102
103 typedef void (LbInterfaceDxQy::*RefineCellFunction)(const MInt parentId, const MInt* childIds);
105
106 typedef void (LbInterfaceDxQy::*RemoveChildrenFunction)(const MInt parentId);
108
109 // Data members used to replace local static variables
110 // TODO: Remove as soon as prolong/restrict10 is cleaned up or removed..
111
112 // prolongation10
119 // restriction10
126};
127
134template <MInt nDim, MInt nDist, class SysEqn>
135inline void LbInterfaceDxQy<nDim, nDist, SysEqn>::getCellForcing(std::array<MFloat, nDist>& F,
136 const MInt cellId /*= -1*/) {
137 if(m_externalForcing) {
138 std::copy(m_Fext, m_Fext + nDist, F.begin());
139 } else {
140#ifdef WAR_NVHPC_PSTL
141 for(MInt d = 0; d < nDist; d++) {
142 F[d] = 0.0;
143 }
144#else
145 F.fill(0.0);
146#endif
147 }
148 if(cellId < 0) {
149 return;
150 }
151 if(m_isEELiquid) {
152 const MFloat alpha = m_solver->a_alphaGasLim(cellId);
153 for(MInt dist = 0; dist < nDist; dist++) {
154 F[dist] += m_Fg[dist] * alpha;
155 }
156 }
157}
158
159#endif
Interface class holding all relevant data and methods for treating prolongation, restriction and init...
virtual void restriction10()
MFloat m_static_restriction10_c[nDim *nDim]
virtual void prolongation0()
virtual void removeChildsDupuisFilippova(const MInt parentId)
Initialize parent variables from children.
MFloat m_static_restriction10_trace
void setInterfaceFunctions()
Setting function pointer to the chosen interface treatment method.
void(LbInterfaceDxQy::* RefineCellFunction)(const MInt parentId, const MInt *childIds)
virtual void restrictionThermalRohde()
Fine to coarse grid fot thermal LB.
MFloat m_static_restriction10_tmp
LbInterfaceDxQy(LbSolver< nDim > *solver)
virtual void prolongationThermalRohde()
Coarse to fine grid for thermal LB.
MFloat m_static_restriction10_tmp2
MInt m_static_prolongation10_tmpDistId
MFloat m_static_restriction10_b[2 *nDim]
virtual void restrictionDupuis()
virtual void prolongationRohde()
RemoveChildrenFunction fRemoveChildren
void prolongationDupuisCompressible()
virtual void prolongation10()
MFloat m_static_prolongation10_b[2 *nDim]
void getCellForcing(std::array< MFloat, nDist > &F, const MInt cellId=-1)
General accessor for potentially cell dependent forcing.
virtual void prolongationDupuis()
void setAdaptationFunctions()
Setting the adaptation functions chosen via property.
virtual void refineCellDupuis(const MInt parentId, const MInt *childIds)
Initialize child variables from parent.
virtual void restrictionRohde()
virtual void prolongationThermalDupuis()
Coarse to fine grid for thermal LB.
InterfaceFunction fRestriction
RefineCellFunction fRefineCell
MFloat m_static_prolongation10_trace
void(LbInterfaceDxQy::* InterfaceFunction)()
virtual void removeChildren(const MInt parentId) override final
MFloat m_static_prolongation10_tmp2
virtual ~LbInterfaceDxQy()
D'tor for the interface class.
LbSolverDxQy< nDim, nDist, SysEqn > * m_solver
MInt m_static_restriction10_tmpDistId
virtual void restrictionThermalDupuis()
Fine to coarse grid for thermal LB.
MFloat m_static_prolongation10_c[nDim *nDim]
InterfaceFunction fProlongation
MFloat m_static_prolongation10_tmp
virtual void refineCellCopyPaste(const MInt parentId, const MInt *childIds)
Initialize child variables from parent.
void(LbInterfaceDxQy::* RemoveChildrenFunction)(const MInt parentId)
void prolongationDupuis_()
Coarse to fine.
void prolongation()
Performing the chosen prolongation method.
virtual void refineCell(const MInt parentId, const MInt *childIds) override final
void restrictionDupuisCompressible()
void restrictionDupuis_()
Fine to coarse grid.
void restriction()
Performing the chosen restriction method.
virtual void restriction0()
virtual void removeChildsCopyPaste(const MInt parentId)
Initialize parent variables from children.
MPrimitiveVariables< nDim > * PV
Definition: lbinterface.h:67
MBool m_cellDependentForcing
Definition: lbinterface.h:58
MInt m_isThermal
Definition: lbinterface.h:77
MBool m_externalForcing
Definition: lbinterface.h:59
MBool m_isEELiquid
Definition: lbinterface.h:60
std::vector< Collector< LbParentCell > * > m_interfaceParents
Definition: lbinterface.h:55
MFloat * m_Fg
Definition: lbinterface.h:65
MString m_interfaceMethod
Definition: lbinterface.h:73
MFloat * m_Fext
Definition: lbinterface.h:64
MInt m_innerEnergy
Definition: lbinterface.h:78
MString m_adaptationInitMethod
Definition: lbinterface.h:74
std::vector< Collector< LbInterfaceCell > * > m_interfaceChildren
Definition: lbinterface.h:54
This class represents all LB models.
Definition: lbsolverdxqy.h:29
int32_t MInt
Definition: maiatypes.h:62
double MFloat
Definition: maiatypes.h:52
MFloat dist(const Point< DIM > &p, const Point< DIM > &q)
Definition: pointbox.h:54
LB lattice descriptor for arrays depending on D and Q.