diff --git a/cpp/full_code/ornstein_uhlenbeck_process.cpp b/cpp/full_code/ornstein_uhlenbeck_process.cpp index 9351e01ba41f43790da3a9f3310536c40639d82f..f5bcbb23fc7d61a13a662d5c102fa57657eec070 100644 --- a/cpp/full_code/ornstein_uhlenbeck_process.cpp +++ b/cpp/full_code/ornstein_uhlenbeck_process.cpp @@ -175,6 +175,34 @@ void ornstein_uhlenbeck_process<rnumber, be>::let_converge(void) } } +template <class rnumber, field_backend be> +void ornstein_uhlenbeck_process<rnumber, be>::strip_from_field( + field<rnumber, be, THREE> *src) +{ + assert(src->real_space_representation==false); + + this->kk->CLOOP_K2( + [&](ptrdiff_t cindex, + ptrdiff_t xindex, + ptrdiff_t yindex, + ptrdiff_t zindex, + double k2){ + + if (k2 <= this->ou_kmax_squ && k2 >= this->ou_kmin_squ){ + + for(int cc=0; cc < 3; cc++){ + for(int imag=0; imag < 2; imag++){ + src->cval(cindex,cc,imag) = 0; + } + } + } + + } + + ); + +} + template <class rnumber, field_backend be> void ornstein_uhlenbeck_process<rnumber,be>::add_to_field_replace( field<rnumber, be, THREE> *src, std::string uv) diff --git a/cpp/full_code/ornstein_uhlenbeck_process.hpp b/cpp/full_code/ornstein_uhlenbeck_process.hpp index e164860c66af52a82d7de6d2a76ba2110c9ed24b..cf635988e4cc114749aa3dd68a3ad68dc8e2f52c 100644 --- a/cpp/full_code/ornstein_uhlenbeck_process.hpp +++ b/cpp/full_code/ornstein_uhlenbeck_process.hpp @@ -62,6 +62,9 @@ class ornstein_uhlenbeck_process{ void add_to_field_replace( field<rnumber,be,THREE> *src, std::string uv); + void strip_from_field( + field<rnumber, be, THREE> *src); + void calc_ou_vorticity(void);