From 5355899fb532d7cd0970ff49664c7d554001a690 Mon Sep 17 00:00:00 2001 From: sniklas142 <niklas.schnierstein@googlemail.com> Date: Thu, 29 Aug 2019 09:37:44 +0200 Subject: [PATCH] added method to let the process converge --- cpp/full_code/ornstein_uhlenbeck_process.cpp | 13 +++++++++++++ cpp/full_code/ornstein_uhlenbeck_process.hpp | 2 ++ 2 files changed, 15 insertions(+) diff --git a/cpp/full_code/ornstein_uhlenbeck_process.cpp b/cpp/full_code/ornstein_uhlenbeck_process.cpp index 101093e9..38e50b1d 100644 --- a/cpp/full_code/ornstein_uhlenbeck_process.cpp +++ b/cpp/full_code/ornstein_uhlenbeck_process.cpp @@ -55,6 +55,7 @@ template <class rnumber,field_backend be> void ornstein_uhlenbeck_process<rnumber,be>::step( double dt) { + // put in "CFL"-criterium TODO!!! TIMEZONE("ornstein_uhlenbeck_process::step"); this->kk->CLOOP_K2( [&](ptrdiff_t cindex, @@ -152,6 +153,18 @@ void ornstein_uhlenbeck_process<rnumber,be>::initialize_B() }); } + + +template <class rnumber, field_backend be> +void ornstein_uhlenbeck_process<rnumber, be>::let_converge(void) +{ + //add some logic here TODO + for(int i=0; i<1000; i++) + { + this->step(2e-3); + } +} + template <class rnumber, field_backend be> void ornstein_uhlenbeck_process<rnumber,be>::add_to_field_replace( field<rnumber, be, THREE> *src) diff --git a/cpp/full_code/ornstein_uhlenbeck_process.hpp b/cpp/full_code/ornstein_uhlenbeck_process.hpp index 676ec527..6883c965 100644 --- a/cpp/full_code/ornstein_uhlenbeck_process.hpp +++ b/cpp/full_code/ornstein_uhlenbeck_process.hpp @@ -52,6 +52,8 @@ class ornstein_uhlenbeck_process{ } void initialize_B(void); + void let_converge(void); + void add_to_field_gaussian( field<rnumber,be,THREE> *src, double param); void add_to_field_sharp( -- GitLab