Chombo + EB + MF  3.2
MFFluxFAB.H
Go to the documentation of this file.
1 #ifdef CH_LANG_CC
2 /*
3  * _______ __
4  * / ___/ / ___ __ _ / / ___
5  * / /__/ _ \/ _ \/ V \/ _ \/ _ \
6  * \___/_//_/\___/_/_/_/_.__/\___/
7  * Please refer to Copyright.txt, in Chombo's root directory.
8  */
9 #endif
10 
11 #ifndef _MFFLUXFAB_H_
12 #define _MFFLUXFAB_H_
13 
14 #include "EBFluxFAB.H"
15 #include "BoxLayoutData.H"
16 #include "EBISLayout.H"
17 #include "Vector.H"
18 #include "DisjointBoxLayout.H"
19 #include "MFIndexSpace.H"
20 #include "NamespaceHeader.H"
21 
22 /// Container for face-centered fluxes for multifluid
23 class MFFluxFAB
24 {
25 public:
26  ///
28  {
29  }
30 
31  ///
32  virtual ~MFFluxFAB();
33 
34  ///
35  MFFluxFAB(const Vector<EBISBox>& a_phaseGraphs,
36  const Box& a_region, const Vector<int>& a_nVar);
37 
38  ///
39  void
40  setVal(Vector<Real> a_value);
41 
42  ///
43  void setVal(const Real& a_value);
44 
45  ///
46  int nComp(int a_phase) const
47  {
48  return (*m_phase[a_phase]).nComp();
49  }
50 
51  ///
52  int numPhases() const
53  {
54  return m_phase.size();
55  }
56 
57  ///
58  const Box& box() const
59  {
60  return m_box;
61  }
62 
63  /// return the single-phase EBFluxFAB
64  EBFluxFAB& getPhase(int a_phase)
65  {
66  return (*m_phase[a_phase]);
67  }
68 
69  /// return a const single-phase EBFluxFAB
70  const EBFluxFAB& getPhase(int a_phase) const
71  {
72  return (*m_phase[a_phase]);
73  }
74 
75  ///
76  EBFluxFAB* getPhasePtr(int a_phase)
77  {
78  return m_phase[a_phase];
79  }
80 
81  ///
82  MFFluxFAB& copy(const MFFluxFAB& a_src);
83 
84  ///
85  void copy(const Box& RegionFrom,
86  const Interval& destInt,
87  const Box& RegionTo,
88  const MFFluxFAB& source,
89  const Interval& srcInt);
90 
91  static int preAllocatable()
92  {
93  return 1;
94  }
95 
96  ///
97  int size(const Box& R, const Interval& comps) const ;
98 
99  ///
100  void linearOut(void* buf, const Box& R, const Interval& comps) const ;
101 
102  ///
103  void linearIn(void* buf, const Box& R, const Interval& comps);
104 
105  ///invalid but necessary for leveldata to compile
106  MFFluxFAB(const Box& a_region, int a_nVar)
107  {
108  MayDay::Error("invalid constructor called for baseebfluxfab");
109  }
110 
111 
112 private:
113 
114  void operator=(const MFFluxFAB& rhs); //unimplemented
115 
118 
119 };
120 
121 /// Factory class to produce MFFluxFABs.
122 /**
123  Factory class to produce MFFluxFABs.
124  This is needed for LevelData construction.
125  */
127  : public DataFactory<MFFluxFAB>
128 {
129 public:
130 
131  MFFluxFactory(Vector<EBISLayout>& a_ebis, const Vector<int>& a_ncomp);
132 
133  MFFluxFactory(const MFIndexSpace& a_mf, const DisjointBoxLayout& a_dbl,
134  const Box& a_domain, const Vector<int>& a_ncomps,
135  int ghost);
136 
137  void define(Vector<EBISLayout>& a_ebis, const Vector<int>& a_ncomp);
138 
139  virtual ~MFFluxFactory();
140  /// factory function.
141  /**
142  Creates a new mffluxfab object
143  and returns a pointer to it. Responsibility
144  for calling operator 'delete' on this pointer is passed to the user.
145  */
146  virtual MFFluxFAB* create(const Box& a_box, int a_ncompsIgnored,
147  const DataIndex& a_dit) const;
148 
149  const EBISLayout& getEBISLayout(int phase) const
150  {
151  return m_ebis[phase];
152  }
153 
154 private:
155 
158 
159 };
160 
161 #include "NamespaceFooter.H"
162 #endif
static int preAllocatable()
Definition: MFFluxFAB.H:91
Definition: MFIndexSpace.H:17
one dimensional dynamic array
Definition: Vector.H:53
MFFluxFAB(const Box &a_region, int a_nVar)
invalid but necessary for leveldata to compile
Definition: MFFluxFAB.H:106
int size(const Box &R, const Interval &comps) const
Factory class to produce MFFluxFABs.
Definition: MFFluxFAB.H:126
virtual ~MFFluxFAB()
void operator=(const MFFluxFAB &rhs)
void setVal(Vector< Real > a_value)
A EBFaceFAB-like container for edge-centered fluxes.
Definition: EBFluxFAB.H:25
int nComp(int a_phase) const
Definition: MFFluxFAB.H:46
Structure for passing component ranges in code.
Definition: Interval.H:23
MFFluxFAB & copy(const MFFluxFAB &a_src)
double Real
Definition: REAL.H:33
EBFluxFAB & getPhase(int a_phase)
return the single-phase EBFluxFAB
Definition: MFFluxFAB.H:64
Container for face-centered fluxes for multifluid.
Definition: MFFluxFAB.H:23
A BoxLayout that has a concept of disjointedness.
Definition: DisjointBoxLayout.H:30
size_t size() const
Definition: Vector.H:192
void linearIn(void *buf, const Box &R, const Interval &comps)
static void Error(const char *const a_msg=m_nullString, int m_exitCode=CH_DEFAULT_ERROR_CODE)
Print out message to cerr and exit with the specified exit code.
void linearOut(void *buf, const Box &R, const Interval &comps) const
Vector< EBFluxFAB * > m_phase
Definition: MFFluxFAB.H:116
A Rectangular Domain on an Integer Lattice.
Definition: Box.H:469
const EBISLayout & getEBISLayout(int phase) const
Definition: MFFluxFAB.H:149
Vector< EBISLayout > m_ebis
Definition: MFFluxFAB.H:156
Box m_box
Definition: MFFluxFAB.H:117
Definition: DataIndex.H:114
const EBFluxFAB & getPhase(int a_phase) const
return a const single-phase EBFluxFAB
Definition: MFFluxFAB.H:70
const Box & box() const
Definition: MFFluxFAB.H:58
Factory object to data members of a BoxLayoutData container.
Definition: BoxLayoutData.H:30
Definition: EBISLayout.H:39
EBFluxFAB * getPhasePtr(int a_phase)
Definition: MFFluxFAB.H:76
MFFluxFAB()
Definition: MFFluxFAB.H:27
Vector< int > m_ncomp
Definition: MFFluxFAB.H:157
int numPhases() const
Definition: MFFluxFAB.H:52