Gyselalib++
 
Loading...
Searching...
No Matches
initialization_Kelvin_Helmholtz.hpp
1// SPDX-License-Identifier: MIT
2
3#pragma once
4
5#include "ddc_alias_inline_functions.hpp"
6#include "ddc_aliases.hpp"
7#include "geometry.hpp"
8
9
24{
25 double const m_epsilon;
26 double const m_mode_k;
27
28public:
35 KelvinHelmholtzInstabilityInitialization(double const epsilon, double const mode_k)
36 : m_epsilon(epsilon)
37 , m_mode_k(mode_k) {};
38
40
47 void operator()(DFieldXY allfdistribu, DFieldXY allfdistribu_equilibrium)
48 {
49 IdxRangeXY const idx_range = get_idx_range(allfdistribu);
50 double const epsilon_proxy = m_epsilon;
51 double const mode_k_proxy = m_mode_k;
52
53 ddc::parallel_for_each(
54 Kokkos::DefaultExecutionSpace(),
55 idx_range,
56 KOKKOS_LAMBDA(IdxXY const i_xy) {
57 CoordXY const coord_xy(ddc::coordinate(i_xy));
58 double const x = CoordX(coord_xy);
59 double const y = CoordY(coord_xy);
60 allfdistribu_equilibrium(i_xy) = Kokkos::sin(y);
61 allfdistribu(i_xy) = allfdistribu_equilibrium(i_xy)
62 + epsilon_proxy * Kokkos::cos(mode_k_proxy * x);
63 });
64 };
65};
Initialize the allfdistribu function.
Definition initialization_Kelvin_Helmholtz.hpp:24
KelvinHelmholtzInstabilityInitialization(double const epsilon, double const mode_k)
Instantiate the initializer.
Definition initialization_Kelvin_Helmholtz.hpp:35
void operator()(DFieldXY allfdistribu, DFieldXY allfdistribu_equilibrium)
Initialise and .
Definition initialization_Kelvin_Helmholtz.hpp:47