35 ext::shared_ptr<FdmLinearOpComposite> op)
36 : solverDesc_(solverDesc), schemeDesc_(schemeDesc), op_(
std::move(op)),
38 0.99 *
std::min(1.0 / 365.0,
39 solverDesc.condition->stoppingTimes().empty() ?
41 solverDesc.condition->stoppingTimes().front()))),
43 initialValues_(solverDesc.mesher->layout()->size()),
45 solverDesc.mesher->layout()->dim()[2],
46 Matrix(solverDesc.mesher->layout()->dim()[1], solverDesc.mesher->layout()->dim()[0])),
47 interpolation_(solverDesc.mesher->layout()->dim()[2]) {
49 x_.reserve(solverDesc.
mesher->layout()->dim()[0]);
50 y_.reserve(solverDesc.
mesher->layout()->dim()[1]);
51 z_.reserve(solverDesc.
mesher->layout()->dim()[2]);
53 for (
const auto& iter : *solverDesc.
mesher->layout()) {
59 if ((iter.coordinates()[1] == 0U) && (iter.coordinates()[2] == 0U)) {
60 x_.push_back(solverDesc.
mesher->location(iter, 0));
62 if ((iter.coordinates()[0] == 0U) && (iter.coordinates()[2] == 0U)) {
63 y_.push_back(solverDesc.
mesher->location(iter, 1));
65 if ((iter.coordinates()[0] == 0U) && (iter.coordinates()[1] == 0U)) {
66 z_.push_back(solverDesc.
mesher->location(iter, 2));
79 for (
Size i=0; i <
z_.size(); ++i) {
80 std::copy(rhs.
begin()+i *
y_.size()*
x_.size(),
94 for (
Size i=0; i <
z_.size(); ++i) {
108 std::vector<Matrix> thetaValues(
z_.size(),
Matrix(
y_.size(),
x_.size()));
109 for (
Size i=0; i <
z_.size(); ++i) {
110 std::copy(rhs.
begin()+i *
y_.size()*
x_.size(),
112 thetaValues[i].begin());
116 for (
Size i=0; i <
z_.size(); ++i) {
118 y_.begin(),
y_.end(), thetaValues[i])(x,
y);
bicubic spline interpolation between discrete points
1-D array used in linear algebra.
const_iterator begin() const
bicubic-spline interpolation between discrete points
void performCalculations() const override
std::vector< Real > initialValues_
std::vector< Matrix > resultValues_
const ext::shared_ptr< FdmStepConditionComposite > conditions_
const ext::shared_ptr< FdmSnapshotCondition > thetaCondition_
Real interpolateAt(Real x, Real y, Rate z) const
const FdmSolverDesc solverDesc_
Real thetaAt(Real x, Real y, Rate z) const
std::vector< ext::shared_ptr< BicubicSpline > > interpolation_
Fdm3DimSolver(const FdmSolverDesc &solverDesc, const FdmSchemeDesc &schemeDesc, ext::shared_ptr< FdmLinearOpComposite > op)
const ext::shared_ptr< FdmLinearOpComposite > op_
const FdmSchemeDesc schemeDesc_
void rollback(array_type &a, Time from, Time to, Size steps, Size dampingSteps)
virtual void calculate() const
Matrix used in linear algebra.
template class providing a null value for a given type.
cubic interpolation between discrete points
layer of abstraction to calculate the inner value
memory layout of a fdm linear operator
step condition for value inspection
composite of fdm step conditions
generic finite difference model
std::size_t Size
size of a container
const ext::shared_ptr< FdmInnerValueCalculator > calculator
const FdmBoundaryConditionSet bcSet
const ext::shared_ptr< FdmMesher > mesher