OGS
ProcessLib::PythonBoundaryConditionPythonSideInterface Class Reference

Detailed Description

Base class for boundary conditions. This class will get Python bindings and is intended to be to be derived in Python.

Definition at line 18 of file PythonBoundaryConditionPythonSideInterface.h.

#include <PythonBoundaryConditionPythonSideInterface.h>

Inheritance diagram for ProcessLib::PythonBoundaryConditionPythonSideInterface:
[legend]

Public Member Functions

virtual std::pair< bool, double > getDirichletBCValue (double, std::array< double, 3 >, std::size_t, std::vector< double > const &) const
 
virtual std::tuple< bool, double, std::vector< double > > getFlux (double, std::array< double, 3 >, std::vector< double > const &) const
 
bool isOverriddenEssential () const
 
bool isOverriddenNatural () const
 
virtual ~PythonBoundaryConditionPythonSideInterface ()=default
 

Private Attributes

bool _overridden_essential = true
 
bool _overridden_natural = true
 Tells if getFlux() has been overridden in the derived class in Python.
 

Constructor & Destructor Documentation

◆ ~PythonBoundaryConditionPythonSideInterface()

virtual ProcessLib::PythonBoundaryConditionPythonSideInterface::~PythonBoundaryConditionPythonSideInterface ( )
virtualdefault

Member Function Documentation

◆ getDirichletBCValue()

virtual std::pair< bool, double > ProcessLib::PythonBoundaryConditionPythonSideInterface::getDirichletBCValue ( double ,
std::array< double, 3 > ,
std::size_t ,
std::vector< double > const &  ) const
inlinevirtual

Computes Dirichlet boundary condition values for the provided arguments (time, position of the node, node id, primary variables at the node).

Returns
a pair (is_dirichlet, value) indicating if a Dirichlet BC shall be set at that node and (if so) the value of the Dirichlet BC at that node.

Reimplemented in ProcessLib::PythonBoundaryConditionPythonSideInterfaceTrampoline.

Definition at line 29 of file PythonBoundaryConditionPythonSideInterface.h.

32 {
34 return {false, std::numeric_limits<double>::quiet_NaN()};
35 }

References _overridden_essential.

Referenced by ProcessLib::pythonBindBoundaryCondition().

◆ getFlux()

virtual std::tuple< bool, double, std::vector< double > > ProcessLib::PythonBoundaryConditionPythonSideInterface::getFlux ( double ,
std::array< double, 3 > ,
std::vector< double > const &  ) const
inlinevirtual

Computes the flux for the provided arguments (time, position, primary variables at that position).

Returns
a pair (is_natural, flux, flux_jacobian) indicating if a natural BC shall be set at that position and (if so) the flux at that node and the derivative of the flux w.r.t. all primary variables.

Reimplemented in ProcessLib::PythonBoundaryConditionPythonSideInterfaceTrampoline.

Definition at line 45 of file PythonBoundaryConditionPythonSideInterface.h.

49 {
50 _overridden_natural = false;
51 return std::tuple<bool, double, std::vector<double>>{
52 false, std::numeric_limits<double>::quiet_NaN(), {}};
53 }
bool _overridden_natural
Tells if getFlux() has been overridden in the derived class in Python.

References _overridden_natural.

Referenced by ProcessLib::PythonBcData::getFlagAndFluxAndDFlux(), and ProcessLib::pythonBindBoundaryCondition().

◆ isOverriddenEssential()

bool ProcessLib::PythonBoundaryConditionPythonSideInterface::isOverriddenEssential ( ) const
inline

Tells if getDirichletBCValue() has been overridden in the derived class in Python.

Precondition
getDirichletBCValue() must already have been called once.

Definition at line 60 of file PythonBoundaryConditionPythonSideInterface.h.

60{ return _overridden_essential; }

References _overridden_essential.

◆ isOverriddenNatural()

bool ProcessLib::PythonBoundaryConditionPythonSideInterface::isOverriddenNatural ( ) const
inline

Tells if getFlux() has been overridden in the derived class in Python.

Precondition
getFlux() must already have been called once.

Definition at line 65 of file PythonBoundaryConditionPythonSideInterface.h.

65{ return _overridden_natural; }

References _overridden_natural.

Referenced by ProcessLib::PythonBcData::getFlagAndFluxAndDFlux().

Member Data Documentation

◆ _overridden_essential

bool ProcessLib::PythonBoundaryConditionPythonSideInterface::_overridden_essential = true
mutableprivate

Tells if getDirichletBCValue() has been overridden in the derived class in Python.

Definition at line 72 of file PythonBoundaryConditionPythonSideInterface.h.

Referenced by getDirichletBCValue(), and isOverriddenEssential().

◆ _overridden_natural

bool ProcessLib::PythonBoundaryConditionPythonSideInterface::_overridden_natural = true
mutableprivate

Tells if getFlux() has been overridden in the derived class in Python.

Definition at line 74 of file PythonBoundaryConditionPythonSideInterface.h.

Referenced by getFlux(), and isOverriddenNatural().


The documentation for this class was generated from the following file: