12 #ifndef CD_MFHelmholtzElectrostaticEBBCImplem_H
13 #define CD_MFHelmholtzElectrostaticEBBCImplem_H
20 #include <CD_NamespaceHeader.H>
25 CH_TIME(
"MFHelmholtzElectrostaticEBBC::getElectrodePotential(RealVect)");
28 int closestElectrode = 0;
29 Real minDist = std::numeric_limits<Real>::infinity();
33 for (
int i = 0; i < electrodeBCs.size(); i++) {
34 const RefCountedPtr<BaseIF>& impFunc = electrodeBCs[i].first.getImplicitFunction();
36 const Real curDist = std::abs(impFunc->value(a_pos));
38 if (curDist < minDist) {
47 constexpr Real dummyDt = 0.0;
49 return electrodeBCs[closestElectrode].second(a_pos, dummyDt);
52 #include <CD_NamespaceFooter.H>
Declaration of a Electrostatic boundary condition class for MFHelmholtzOp.
std::vector< std::pair< Electrode, BcFunction > > & getBcs()
Get all boundary conditions.
Definition: CD_ElectrostaticEbBc.cpp:79
Real getElectrodePotential(const RealVect &a_pos) const
Get electrode potential.
Definition: CD_MFHelmholtzElectrostaticEBBCImplem.H:23
ElectrostaticEbBc m_electrostaticBCs
Electrostatic boundary conditions.
Definition: CD_MFHelmholtzElectrostaticEBBC.H:117