chombo-discharge
Loading...
Searching...
No Matches
CD_PetscHelmholtzDomainBC.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
12
13#ifdef CH_USE_PETSC
14
15#ifndef CD_PETSCHELMHOLTZDOMAINBC_H
16#define CD_PETSCHELMHOLTZDOMAINBC_H
17
18// Chombo includes
19#include <EBLevelGrid.H>
20#include <Stencils.H>
21#include <RealVect.H>
22#include <LoHiSide.H>
23#include <RefCountedPtr.H>
24#include <Vector.H>
25
26// Our includes
27#include <CD_PetscGrid.H>
28#include <CD_NamespaceHeader.H>
29
51{
52public:
57
62
68
74
81 operator=(const PetscHelmholtzDomainBC& a_other) = delete;
82
89 operator=(const PetscHelmholtzDomainBC&& a_other) = delete;
90
98 virtual void
99 define(const RefCountedPtr<PetscGrid>& a_petscGrid, const RealVect& a_probLo, const Vector<Real>& a_dx);
100
125 virtual void
126 getFaceFluxStencil(Real& a_boundaryWeight,
127 VoFStencil& a_stencilCoar,
128 VoFStencil& a_stencil,
129 VoFStencil& a_stencilFine,
130 const int a_phase,
131 const int a_level,
132 const DataIndex& a_din,
133 const VolIndex& a_vof,
134 const int a_dir,
135 const Side::LoHiSide a_side) const = 0;
136
149 virtual Real
150 getBoundaryData(const int a_phase,
151 const int a_level,
152 const DataIndex& a_din,
153 const VolIndex& a_vof,
154 const int a_dir,
155 const Side::LoHiSide a_side) const = 0;
156
157protected:
162
169 RefCountedPtr<PetscGrid> m_petscGrid;
170
174 RealVect m_probLo;
175
179 Vector<Real> m_dx;
180
193 RealVect
194 getBoundaryPosition(const int a_phase,
195 const int a_level,
196 const DataIndex& a_din,
197 const VolIndex& a_vof,
198 const int a_dir,
199 const Side::LoHiSide a_side) const noexcept;
200};
201
202#include <CD_NamespaceFooter.H>
203
204#endif
205
206#endif
File containing declaration of PetscGrid.
PetscHelmholtzDomainBC(const PetscHelmholtzDomainBC &&a_other)=delete
Disallowed move constructor.
PetscHelmholtzDomainBC & operator=(const PetscHelmholtzDomainBC &a_other)=delete
Disallowed copy assignment operator.
bool m_isDefined
Is defined or not.
Definition CD_PetscHelmholtzDomainBC.H:161
virtual void define(const RefCountedPtr< PetscGrid > &a_petscGrid, const RealVect &a_probLo, const Vector< Real > &a_dx)
Define the BC over the AMR hierarchy.
Definition CD_PetscHelmholtzDomainBC.cpp:34
Vector< Real > m_dx
Grid resolution on each level.
Definition CD_PetscHelmholtzDomainBC.H:179
RealVect getBoundaryPosition(const int a_phase, const int a_level, const DataIndex &a_din, const VolIndex &a_vof, const int a_dir, const Side::LoHiSide a_side) const noexcept
Get the physical position of the centroid of a domain face.
Definition CD_PetscHelmholtzDomainBC.cpp:51
PetscHelmholtzDomainBC & operator=(const PetscHelmholtzDomainBC &&a_other)=delete
Disallowed move assignment operator.
PetscHelmholtzDomainBC(const PetscHelmholtzDomainBC &a_other)=delete
Disallowed copy constructor.
virtual ~PetscHelmholtzDomainBC()
Destructor.
Definition CD_PetscHelmholtzDomainBC.cpp:28
RefCountedPtr< PetscGrid > m_petscGrid
PETSc grid.
Definition CD_PetscHelmholtzDomainBC.H:169
virtual void getFaceFluxStencil(Real &a_boundaryWeight, VoFStencil &a_stencilCoar, VoFStencil &a_stencil, VoFStencil &a_stencilFine, const int a_phase, const int a_level, const DataIndex &a_din, const VolIndex &a_vof, const int a_dir, const Side::LoHiSide a_side) const =0
Get the stencil of the face flux through a domain face, and the weight of the boundary data.
PetscHelmholtzDomainBC()
Default constructor. Must subsequently call define.
Definition CD_PetscHelmholtzDomainBC.cpp:23
virtual Real getBoundaryData(const int a_phase, const int a_level, const DataIndex &a_din, const VolIndex &a_vof, const int a_dir, const Side::LoHiSide a_side) const =0
Get the boundary data g at a domain face.
RealVect m_probLo
Lower-left corner of the computational domain.
Definition CD_PetscHelmholtzDomainBC.H:174