chombo-discharge
Loading...
Searching...
No Matches
CD_MFHelmholtzJumpBCImplem.H
1/*
2 * SPDX-FileCopyrightText: 2021-2026 SINTEF Energy Research
3 *
4 * SPDX-License-Identifier: GPL-3.0-or-later
5 */
6
7/*
8 @file CD_MFHelmholtzJumpBCImplem.H
9 @brief Implementation of CD_MFHelmholtzJumpBC.H
10 @author Robert Marskar
11*/
12
13#ifndef CD_MFHELMHOLTZJUMPBCIMPLEM_H
14#define CD_MFHELMHOLTZJUMPBCIMPLEM_H
15
16// Chombo includes
17#include <NeighborIterator.H>
18
19// Our includes
21#include <CD_NamespaceHeader.H>
22
23inline bool
25{
28
29 // Construct boxes that contain all the valid cells for this stencil.
31
33 curBox.grow(m_ghostCF);
34 curBox &= domain;
35 validBoxes.emplace_back(curBox);
36
38 for (nit.begin(a_dit); nit.ok(); ++nit) {
39 Box neighBox = dbl[nit()];
40 neighBox.grow(m_ghostCF);
42
43 validBoxes.emplace_back(neighBox);
44 }
45
46 // Now check that the stencil if the stencil. We set valid = false
47 // if any of the stencil points reaches out of the ghosted boxes.
48 bool valid = true;
49
50 for (int i = 0; i < a_stencil.size(); i++) {
51 const VolIndex& vof = a_stencil.vof(i);
52 const IntVect& iv = vof.gridIndex();
53
54 bool insideOneBox = false;
55 for (const auto& b : validBoxes) {
56 if (b.contains(iv))
57 insideOneBox = true;
58 }
59
60 if (!insideOneBox) {
61 valid = false;
62 break;
63 }
64 }
65
66 return valid;
67}
68
69inline Real
71{
72 Real contrib = 0.0;
73 for (int i = 0; i < a_stencil.size(); i++) {
74 contrib += a_stencil.weight(i) * a_phi(a_stencil.vof(i), m_comp);
75 }
76
77 return contrib;
78}
79
80#include <CD_NamespaceFooter.H>
81
82#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:216
int m_ghostCF
Number of grid cells that were filled over the CF.
Definition CD_MFHelmholtzJumpBC.H:266
Real applyStencil(const VoFStencil &a_stencil, const EBCellFAB &a_phi) const
Apply a stencil and return the result.
Definition CD_MFHelmholtzJumpBCImplem.H:70
bool isStencilValidCF(const VoFStencil &a_stencil, const DataIndex &a_dit) const
Check if stencil is valid.
Definition CD_MFHelmholtzJumpBCImplem.H:24
MFLevelGrid m_mflg
Grids.
Definition CD_MFHelmholtzJumpBC.H:231
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:38
TracerParticleSolver()
Default constructor.
Definition CD_TracerParticleSolverImplem.H:26