chombo-discharge
CD_DomainFluxIFFAB.H
Go to the documentation of this file.
1 /* chombo-discharge
2  * Copyright © 2021 SINTEF Energy Research.
3  * Please refer to Copyright.txt and LICENSE in the chombo-discharge root directory.
4  */
5 
12 #ifndef CD_DomainFluxIFFAB_H
13 #define CD_DomainFluxIFFAB_H
14 
15 // Chombo includes
16 #include <BaseIFFAB.H>
17 #include <ProblemDomain.H>
18 #include <EBISLayout.H>
19 
20 // Our includes
21 #include "CD_NamespaceHeader.H"
22 
30 {
31 public:
32  static int
33  preAllocatable()
34  {
35  return 1; // Symmetric messaging
36  }
37 
42 
50  DomainFluxIFFAB(const ProblemDomain& a_domain, const EBISBox& a_ebisbox, const Box& a_box, const int a_nComp);
51 
56 
60  const Box&
61  box() const;
62 
66  int
67  nComp() const;
68 
72  const ProblemDomain&
73  getDomain() const;
74 
78  const EBISBox&
79  getEBISBox() const;
80 
85  void
86  define(const DomainFluxIFFAB& a_copy);
87 
95  void
96  define(const ProblemDomain& a_domain, const EBISBox& a_ebisbox, const Box& a_box, const int a_nComp);
97 
103  BaseIFFAB<Real>&
104  operator()(const int a_dir, const Side::LoHiSide a_side);
105 
111  const BaseIFFAB<Real>&
112  operator()(const int a_dir, const Side::LoHiSide a_side) const;
113 
118  int
119  size(const Box& R, const Interval& comps) const;
120 
125  void
126  linearOut(void* buf, const Box& R, const Interval& comps) const;
127 
132  void
133  linearIn(void* buf, const Box& R, const Interval& comps);
134 
142  void
143  copy(const Box& Rfrom, const Interval& Cdest, const Box& Rto, const DomainFluxIFFAB& src, const Interval& Csrc);
144 
145 protected:
149  ProblemDomain m_domain;
150 
154  Box m_box;
155 
159  EBISBox m_ebisbox;
160 
164  int m_nComp;
165 
170 
174  Tuple<BaseIFFAB<Real>*, CH_SPACEDIM> m_fluxLo;
175 
179  Tuple<BaseIFFAB<Real>*, CH_SPACEDIM> m_fluxHi;
180 
184  void
186 
190  void
191  clear();
192 };
193 
194 #include <CD_NamespaceFooter.H>
195 
196 #endif
Class for holding fluxes on domain boundaries.
Definition: CD_DomainFluxIFFAB.H:30
~DomainFluxIFFAB()
Destructor (does nothing)
Definition: CD_DomainFluxIFFAB.cpp:37
Tuple< BaseIFFAB< Real > *, CH_SPACEDIM > m_fluxLo
BaseIFFABs on Side::Lo sides.
Definition: CD_DomainFluxIFFAB.H:174
void setDefaultValues()
Set default values.
Definition: CD_DomainFluxIFFAB.cpp:209
EBISBox m_ebisbox
EBISBox.
Definition: CD_DomainFluxIFFAB.H:159
Tuple< BaseIFFAB< Real > *, CH_SPACEDIM > m_fluxHi
BaseIFFABs on Side::Hi sides.
Definition: CD_DomainFluxIFFAB.H:179
int nComp() const
Get number of components.
Definition: CD_DomainFluxIFFAB.cpp:56
Box m_box
Defining box.
Definition: CD_DomainFluxIFFAB.H:154
void linearOut(void *buf, const Box &R, const Interval &comps) const
Linearization function.
Definition: CD_DomainFluxIFFAB.cpp:96
ProblemDomain m_domain
Defining domain.
Definition: CD_DomainFluxIFFAB.H:149
const ProblemDomain & getDomain() const
Get the defining problem domain.
Definition: CD_DomainFluxIFFAB.cpp:62
int size(const Box &R, const Interval &comps) const
Linearization function.
Definition: CD_DomainFluxIFFAB.cpp:82
BaseIFFAB< Real > & operator()(const int a_dir, const Side::LoHiSide a_side)
Get the BaseIFFAB on a particular domain side.
Definition: CD_DomainFluxIFFAB.cpp:262
int m_nComp
Number of components.
Definition: CD_DomainFluxIFFAB.H:164
void linearIn(void *buf, const Box &R, const Interval &comps)
Linearization function.
Definition: CD_DomainFluxIFFAB.cpp:116
DomainFluxIFFAB()
Default constructor. Must subsequently call define.
Definition: CD_DomainFluxIFFAB.cpp:19
const EBISBox & getEBISBox() const
Get the defining ebis box.
Definition: CD_DomainFluxIFFAB.cpp:68
const Box & box() const
Get the defining box.
Definition: CD_DomainFluxIFFAB.cpp:50
void define(const DomainFluxIFFAB &a_copy)
Make a clone of an input data holder.
Definition: CD_DomainFluxIFFAB.cpp:74
bool m_isDefined
Is defined or not.
Definition: CD_DomainFluxIFFAB.H:169
void copy(const Box &Rfrom, const Interval &Cdest, const Box &Rto, const DomainFluxIFFAB &src, const Interval &Csrc)
Copy functiopn.
Definition: CD_DomainFluxIFFAB.cpp:244
void clear()
Clear object.
Definition: CD_DomainFluxIFFAB.cpp:225
constexpr Real R
Universal gas constant.
Definition: CD_Units.H:64