25#ifndef quantlib_mixed_scheme_hpp
26#define quantlib_mixed_scheme_hpp
72 template <
class Operator>
104 template <
class Operator>
107 for (i=0; i<bcs_.size(); i++)
110 if (L_.isTimeDependent()) {
112 explicitPart_ = I_-((1.0-
theta_) * dt_)*L_;
114 for (i=0; i<bcs_.size(); i++)
115 bcs_[i]->applyBeforeApplying(explicitPart_);
116 a = explicitPart_.applyTo(a);
117 for (i=0; i<bcs_.size(); i++)
118 bcs_[i]->applyAfterApplying(a);
121 if (L_.isTimeDependent()) {
123 implicitPart_ = I_+(
theta_ * dt_)*L_;
125 for (i=0; i<bcs_.size(); i++)
126 bcs_[i]->applyBeforeSolving(implicitPart_,a);
127 implicitPart_.solveFor(a, a);
128 for (i=0; i<bcs_.size(); i++)
129 bcs_[i]->applyAfterSolving(a);
Mixed (explicit/implicit) scheme for finite difference methods.
traits::operator_type operator_type
operator_type explicitPart_
operator_type implicitPart_
traits::condition_type condition_type
OperatorTraits< Operator > traits
traits::array_type array_type
void step(array_type &a, Time t)
MixedScheme(const operator_type &L, Real theta, bc_set bcs)
std::vector< ext::shared_ptr< bc_type > > bc_set
Operator::array_type array_type
condition to be applied at every time step
generic finite difference model
Real Time
continuous quantity with 1-year units
std::size_t Size
size of a container