chombo-discharge
Loading...
Searching...
No Matches
CD_MFInterfaceFABImplem.H
Go to the documentation of this file.
1/*
2 * SPDX-FileCopyrightText: 2021-2026 SINTEF Energy Research
3 *
4 * SPDX-License-Identifier: GPL-3.0-or-later
5 */
6
13#ifndef CD_MFINTERFACEFABIMPLEM_H
14#define CD_MFINTERFACEFABIMPLEM_H
15
16// Our includes
17#include <CD_MFInterfaceFAB.H>
18#include <CD_NamespaceHeader.H>
19
20template <class T>
23
24template <class T>
29
30template <class T>
32{
33 for (int i = 0; i < m_phase.size(); i++) {
34 delete m_phase[i];
35 }
36}
37
38template <class T>
39void
41{
42
43 const DisjointBoxLayout& dbl = a_mflg.getGrids();
44 const ProblemDomain& domain = a_mflg.getDomain();
46 const int numPhases = MultiFluidIndexSpace->numPhases();
47
48 m_ivs = a_mflg.interfaceRegion(dbl.get(a_dit), a_dit);
49 m_phase.resize(numPhases, NULL);
50
51 for (int i = 0; i < numPhases; i++) {
52 const EBLevelGrid& eblg = a_mflg.getEBLevelGrid(i);
53 const EBISLayout& ebisl = eblg.getEBISL();
54 m_phase[i] = new BaseIVFAB<T>(m_ivs, ebisl[a_dit].getEBGraph(), 1);
55 }
56}
57
58template <class T>
59const IntVectSet&
61{
62 return m_ivs;
63}
64
65template <class T>
68{
69 CH_assert(a_phase >= 0 && a_phase < m_phase.size());
70 CH_assert(m_phase[a_phase] != nullptr);
71 return *m_phase[a_phase];
72}
73
74template <class T>
75const BaseIVFAB<T>&
77{
78 CH_assert(a_phase >= 0 && a_phase < m_phase.size());
79 CH_assert(m_phase[a_phase] != nullptr);
80 return *m_phase[a_phase];
81}
82
83template <class T>
90
91template <class T>
92int
94{
95 return m_phase.size();
96}
97
98template <class T>
99void
101{
102 for (int i = 0; i < m_phase.size(); i++) {
103 m_phase[i]->setVal(a_value);
104 }
105}
106
107#include <CD_NamespaceFooter.H>
108
109#endif
Declaration of a class that allocates irregular data holders over the interface between two phases.
MFInterfaceFAB()
Constructor. Must subsequently call define.
Definition CD_MFInterfaceFABImplem.H:21
virtual int numPhases() const
Get number of phases.
Definition CD_MFInterfaceFABImplem.H:93
virtual BaseIVFAB< T > & getIVFAB(const int a_phase)
Get BaseIVFAB for specified phase.
Definition CD_MFInterfaceFABImplem.H:67
virtual void define(const MFLevelGrid &a_mflg, const DataIndex &a_dit)
Define function.
Definition CD_MFInterfaceFABImplem.H:40
virtual ~MFInterfaceFAB()
Destructor.
Definition CD_MFInterfaceFABImplem.H:31
virtual const IntVectSet & getIVS() const
Get defining region.
Definition CD_MFInterfaceFABImplem.H:60
virtual void setVal(const T &a_value)
Set value on both fabs.
Definition CD_MFInterfaceFABImplem.H:100
virtual BaseIVFAB< T > * getPhasePtr(int a_phase)
Get BaseIVFAB pointer for specified phase.
Definition CD_MFInterfaceFABImplem.H:85
Wrapper class for holding multifluid EBLevelGrids.
Definition CD_MFLevelGrid.H:30
Two-fluid index space.
Definition CD_MultiFluidIndexSpace.H:49
int numPhases() const
Get number of phases.
Definition CD_MultiFluidIndexSpace.cpp:89
Base class for a tracer particle solver. This solver can advance particles in a pre-defined velocity ...
Definition CD_TracerParticleSolver.H:38
phase::which_phase m_phase
Phase where this solver lives.
Definition CD_TracerParticleSolver.H:367
TracerParticleSolver()
Default constructor.
Definition CD_TracerParticleSolverImplem.H:26