QuantLib: a free/open-source library for quantitative finance
Fully annotated sources - version 1.32
Loading...
Searching...
No Matches
fdmdirichletboundary.hpp
1/* -*- mode: c++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2
3/*
4 Copyright (C) 2008 Andreas Gaida
5 Copyright (C) 2008 Ralph Schreyer
6 Copyright (C) 2008 Klaus Spanderen
7
8 This file is part of QuantLib, a free-software/open-source library
9 for financial quantitative analysts and developers - http://quantlib.org/
10
11 QuantLib is free software: you can redistribute it and/or modify it
12 under the terms of the QuantLib license. You should have received a
13 copy of the license along with this program; if not, please email
14 <quantlib-dev@lists.sf.net>. The license is also available online at
15 <http://quantlib.org/license.shtml>.
16
17 This program is distributed in the hope that it will be useful, but WITHOUT
18 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
19 FOR A PARTICULAR PURPOSE. See the license for more details.
20*/
21
22
27#ifndef quantlib_fdm_dirichlet_boundary_hpp
28#define quantlib_fdm_dirichlet_boundary_hpp
29
30#include <ql/methods/finitedifferences/boundarycondition.hpp>
31#include <ql/methods/finitedifferences/operators/fdmlinearop.hpp>
32
33namespace QuantLib {
34
35 class FdmMesher;
36 class FdmLinearOpLayout;
37
38 class FdmDirichletBoundary : public BoundaryCondition<FdmLinearOp> {
39 public:
40 // types and enumerations
44
45 FdmDirichletBoundary(const ext::shared_ptr<FdmMesher>& mesher,
46 Real valueOnBoundary, Size direction, Side side);
47
48 void applyBeforeApplying(operator_type&) const override;
49 void applyBeforeSolving(operator_type&, array_type&) const override;
50 void applyAfterApplying(array_type&) const override;
51 void applyAfterSolving(array_type&) const override;
52 void setTime(Time) override {}
53
54 Real applyAfterApplying(Real x, Real value) const;
55
56 private:
57 const Side side_;
59 const std::vector<Size> indices_;
60
62 };
63}
64
65#endif
1-D array used in linear algebra.
Definition: array.hpp:52
Abstract boundary condition class for finite difference problems.
FdmLinearOp::array_type array_type
void applyAfterSolving(array_type &) const override
BoundaryCondition< FdmLinearOp >::Side Side
void applyAfterApplying(array_type &) const override
void applyBeforeApplying(operator_type &) const override
void applyBeforeSolving(operator_type &, array_type &) const override
const std::vector< Size > indices_
Real Time
continuous quantity with 1-year units
Definition: types.hpp:62
QL_REAL Real
real number
Definition: types.hpp:50
std::size_t Size
size of a container
Definition: types.hpp:58
Definition: any.hpp:35