chombo-discharge
Loading...
Searching...
No Matches
CD_PetscHelmholtzDirichletEBBC.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_PETSCHELMHOLTZDIRICHLETEBBC_H
16#define CD_PETSCHELMHOLTZDIRICHLETEBBC_H
17
18// Std includes
19#include <functional>
20
21// Our includes
23#include <CD_NamespaceHeader.H>
24
31{
32public:
37
41 virtual ~PetscHelmholtzDirichletEBBC() noexcept;
42
47 virtual void
48 setValue(const Real a_value) noexcept;
49
54 virtual void
55 setValue(const std::function<Real(const RealVect& a_pos)>& a_value) noexcept;
56
66 virtual void
67 getEBFluxStencil(Real& a_boundaryWeight,
68 PetscStencil& a_stencil,
69 const int a_phase,
70 const int a_level,
71 const DataIndex& a_din,
72 const VolIndex& a_vof) const noexcept override;
73
82 virtual Real
83 getBoundaryData(const int a_phase,
84 const int a_level,
85 const DataIndex& a_din,
86 const VolIndex& a_vof) const noexcept override;
87
88protected:
93
98
103
107 std::function<Real(const RealVect& a_pos)> m_functionValue;
108};
109
110#include <CD_NamespaceFooter.H>
111
112#endif
113
114#endif
Declaration of a base class for electrode (EB) boundary conditions of PetscHelmholtzOp.
PetscHelmholtzDirichletEBBC() noexcept
Default constructor. Must subsequently set the value, the order and the weight, and call define.
Definition CD_PetscHelmholtzDirichletEBBC.cpp:23
virtual void getEBFluxStencil(Real &a_boundaryWeight, PetscStencil &a_stencil, const int a_phase, const int a_level, const DataIndex &a_din, const VolIndex &a_vof) const noexcept override
Get the flux through the EB face of a cut cell, without the b-coefficient and the face area.
Definition CD_PetscHelmholtzDirichletEBBC.cpp:67
virtual void setValue(const Real a_value) noexcept
Set a constant value on the EB.
Definition CD_PetscHelmholtzDirichletEBBC.cpp:41
bool m_useConstant
Use the constant value or not.
Definition CD_PetscHelmholtzDirichletEBBC.H:92
Real m_constantValue
Constant value on the EB.
Definition CD_PetscHelmholtzDirichletEBBC.H:102
bool m_useFunction
Use the spatially varying value or not.
Definition CD_PetscHelmholtzDirichletEBBC.H:97
virtual Real getBoundaryData(const int a_phase, const int a_level, const DataIndex &a_din, const VolIndex &a_vof) const noexcept override
Get the boundary data, i.e. phi on the EB.
Definition CD_PetscHelmholtzDirichletEBBC.cpp:86
std::function< Real(const RealVect &a_pos)> m_functionValue
Spatially varying value on the EB.
Definition CD_PetscHelmholtzDirichletEBBC.H:107
virtual ~PetscHelmholtzDirichletEBBC() noexcept
Destructor.
Definition CD_PetscHelmholtzDirichletEBBC.cpp:32
PetscHelmholtzEBBC() noexcept
Default constructor. Must subsequently set the order and the weight, and call define.
Definition CD_PetscHelmholtzEBBC.cpp:22
A linear stencil over global PETSc rows, i.e. a list of (row, weight) pairs.
Definition CD_PetscStencil.H:43