QuantLib: a free/open-source library for quantitative finance
fully annotated source code - version 1.34
Loading...
Searching...
No Matches
Public Member Functions | Private Attributes | List of all members
NeumannBC Class Reference

Neumann boundary condition (i.e., constant derivative) More...

#include <boundarycondition.hpp>

+ Inheritance diagram for NeumannBC:
+ Collaboration diagram for NeumannBC:

Public Member Functions

 NeumannBC (Real value, Side side)
 
void applyBeforeApplying (TridiagonalOperator &) const override
 
void applyAfterApplying (Array &) const override
 
void applyBeforeSolving (TridiagonalOperator &, Array &rhs) const override
 
void applyAfterSolving (Array &) const override
 
void setTime (Time) override
 
- Public Member Functions inherited from BoundaryCondition< TridiagonalOperator >
virtual ~BoundaryCondition ()=default
 
virtual void applyBeforeApplying (operator_type &) const=0
 
virtual void applyAfterApplying (array_type &) const=0
 
virtual void applyBeforeSolving (operator_type &, array_type &rhs) const=0
 
virtual void applyAfterSolving (array_type &) const=0
 
virtual void setTime (Time t)=0
 

Private Attributes

Real value_
 
Side side_
 

Additional Inherited Members

- Public Types inherited from BoundaryCondition< TridiagonalOperator >
enum  Side
 
typedef TridiagonalOperator operator_type
 
typedef Operator::array_type array_type
 

Detailed Description

Neumann boundary condition (i.e., constant derivative)

Warning:
The value passed must not be the value of the derivative. Instead, it must be comprehensive of the grid step between the first two points–i.e., it must be the difference between f[0] and f[1].

Definition at line 76 of file boundarycondition.hpp.

Constructor & Destructor Documentation

◆ NeumannBC()

NeumannBC ( Real  value,
Side  side 
)

Definition at line 24 of file boundarycondition.cpp.

Member Function Documentation

◆ applyBeforeApplying()

void applyBeforeApplying ( TridiagonalOperator ) const
overridevirtual

This method modifies an operator \( L \) before it is applied to an array \( u \) so that \( v = Lu \) will satisfy the given condition.

Implements BoundaryCondition< TridiagonalOperator >.

Definition at line 27 of file boundarycondition.cpp.

+ Here is the call graph for this function:

◆ applyAfterApplying()

void applyAfterApplying ( Array u) const
override

Definition at line 40 of file boundarycondition.cpp.

+ Here is the call graph for this function:

◆ applyBeforeSolving()

void applyBeforeSolving ( TridiagonalOperator L,
Array rhs 
) const
override

Definition at line 53 of file boundarycondition.cpp.

+ Here is the call graph for this function:

◆ applyAfterSolving()

void applyAfterSolving ( Array ) const
override

Definition at line 69 of file boundarycondition.cpp.

◆ setTime()

void setTime ( Time  t)
overridevirtual

This method sets the current time for time-dependent boundary conditions.

Implements BoundaryCondition< TridiagonalOperator >.

Definition at line 84 of file boundarycondition.hpp.

Member Data Documentation

◆ value_

Real value_
private

Definition at line 87 of file boundarycondition.hpp.

◆ side_

Side side_
private

Definition at line 88 of file boundarycondition.hpp.