chombo-discharge
Loading...
Searching...
No Matches
CD_MFHelmholtzJumpBCImplem.H
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
6/*
7 @file CD_MFHelmholtzJumpBCImplem.H
8 @brief Implementation of CD_MFHelmholtzJumpBC.H
9 @author Robert Marskar
10*/
11
12#ifndef CD_MFHelmholtzJumpBCImplem_H
13#define CD_MFHelmholtzJumpBCImplem_H
14
15// Chombo includes
16#include <NeighborIterator.H>
17
18// Our includes
20#include <CD_NamespaceHeader.H>
21
22inline bool
24{
27
28 // Construct boxes that contain all the valid cells for this stencil.
30
32 curBox.grow(m_ghostCF);
33 curBox &= domain;
34 validBoxes.emplace_back(curBox);
35
37 for (nit.begin(a_dit); nit.ok(); ++nit) {
38 Box neighBox = dbl[nit()];
39 neighBox.grow(m_ghostCF);
41
42 validBoxes.emplace_back(neighBox);
43 }
44
45 // Now check that the stencil if the stencil. We set valid = false
46 // if any of the stencil points reaches out of the ghosted boxes.
47 bool valid = true;
48
49 for (int i = 0; i < a_stencil.size(); i++) {
50 const VolIndex& vof = a_stencil.vof(i);
51 const IntVect& iv = vof.gridIndex();
52
53 bool insideOneBox = false;
54 for (const auto& b : validBoxes) {
55 if (b.contains(iv))
56 insideOneBox = true;
57 }
58
59 if (!insideOneBox) {
60 valid = false;
61 break;
62 }
63 }
64
65 return valid;
66}
67
68inline Real
70{
71 Real contrib = 0.0;
72 for (int i = 0; i < a_stencil.size(); i++) {
73 contrib += a_stencil.weight(i) * a_phi(a_stencil.vof(i), m_comp);
74 }
75
76 return contrib;
77}
78
79#include <CD_NamespaceFooter.H>
80
81#endif
Declaration of class for computing "jump interface" boundary conditions for multifluid Helmholtz code...
static constexpr int m_comp
Component where stencils are stored.
Definition CD_MFHelmholtzJumpBC.H:203
int m_ghostCF
Number of grid cells that were filled over the CF.
Definition CD_MFHelmholtzJumpBC.H:253
Real applyStencil(const VoFStencil &a_stencil, const EBCellFAB &a_phi) const
Apply a stencil and return the result.
Definition CD_MFHelmholtzJumpBCImplem.H:69
bool isStencilValidCF(const VoFStencil &a_stencil, const DataIndex &a_dit) const
Check if stencil is valid.
Definition CD_MFHelmholtzJumpBCImplem.H:23
MFLevelGrid m_mflg
Grids.
Definition CD_MFHelmholtzJumpBC.H:218
virtual ProblemDomain getDomain() const
Get the problem domain.
Definition CD_MFLevelGrid.cpp:72
virtual DisjointBoxLayout getGrids() const
Get the grids.
Definition CD_MFLevelGrid.cpp:78
Base class for a tracer particle solver. This solver can advance particles in a pre-defined velocity ...
Definition CD_TracerParticleSolver.H:37
TracerParticleSolver()
Default constructor.
Definition CD_TracerParticleSolverImplem.H:25