Class FdmDirichletBoundary
A Dirichlet boundary condition: a fixed value on one side of one direction of the grid, written into the solution after each application of the operator and each solve.
public sealed class FdmDirichletBoundary : BoundaryCondition<FdmLinearOp>
- Inheritance
-
FdmDirichletBoundary
- Inherited Members
Remarks
Immutable, its indices fixed at construction; the schemes call it in QuantLib's order, and it writes into the caller's span, allocating nothing.
Constructors
FdmDirichletBoundary(FdmMesher, double, int, BoundaryConditionSide)
Initializes a new instance of the FdmDirichletBoundary class.
public FdmDirichletBoundary(FdmMesher mesher, double valueOnBoundary, int direction, BoundaryConditionSide side)
Parameters
mesherFdmMesherThe mesher.
valueOnBoundarydoubleThe value on the boundary.
directionintThe direction.
sideBoundaryConditionSide
Exceptions
- ArgumentNullException
mesheris null.- ArgumentOutOfRangeException
The direction isn't one of the mesher's, where QuantLib reads past its vectors' ends.
- ArgumentException
The side is None, with QuantLib's "internal error".
Methods
ApplyAfterApplying(double, double)
A value at a location, the boundary's value beyond the boundary's extreme location and the given value inside.
public double ApplyAfterApplying(double x, double value)
Parameters
Returns
- double
The boundary's value below a lower boundary or above an upper one; otherwise the value.
ApplyAfterApplying(Span<double>)
Modifies values u, in place, so that they satisfy the condition.
public override void ApplyAfterApplying(Span<double> a)
Parameters
Exceptions
- ArgumentException
adoesn't reach the boundary's last index, where QuantLib writes past its end.
ApplyAfterSolving(Span<double>)
Modifies values u, in place, so that they satisfy the condition.
public override void ApplyAfterSolving(Span<double> a)
Parameters
Exceptions
- ArgumentException
adoesn't reach the boundary's last index, where QuantLib writes past its end.
ApplyBeforeApplying(FdmLinearOp)
Modifies an operator L before it is applied to values u, so that v = Lu satisfies the condition.
public override void ApplyBeforeApplying(FdmLinearOp op)
Parameters
opFdmLinearOpThe operator.
ApplyBeforeSolving(FdmLinearOp, Span<double>)
Modifies an operator L and the right-hand side before the system Lu' = u is solved, so that u' satisfies the condition.
public override void ApplyBeforeSolving(FdmLinearOp op, Span<double> rhs)
Parameters
opFdmLinearOpThe operator.
rhsSpan<double>The right-hand side, modified in place.
SetTime(double)
Sets the current time of a time-dependent condition.
public override void SetTime(double t)
Parameters
tdoubleThe time.