From 4ec94c97879aafef15f7663135745e4ba61e62cf Mon Sep 17 00:00:00 2001 From: Adrian Kummerlaender Date: Mon, 17 May 2021 00:15:33 +0200 Subject: Extract first public LiterateLB version --- tangle/LLBM/kernel/initialize.h | 44 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 44 insertions(+) create mode 100644 tangle/LLBM/kernel/initialize.h (limited to 'tangle/LLBM/kernel/initialize.h') diff --git a/tangle/LLBM/kernel/initialize.h b/tangle/LLBM/kernel/initialize.h new file mode 100644 index 0000000..221b9ad --- /dev/null +++ b/tangle/LLBM/kernel/initialize.h @@ -0,0 +1,44 @@ +#pragma once +#include + +struct InitializeO { + +using call_tag = tag::call_by_cell_id; + +template +__device__ static void apply(descriptor::D2Q9, S f_curr[9], S f_next[9], std::size_t gid) { + f_next[0] = T{0.0277777777777778}; + f_next[1] = T{0.111111111111111}; + f_next[2] = T{0.0277777777777778}; + f_next[3] = T{0.111111111111111}; + f_next[4] = T{0.444444444444444}; + f_next[5] = T{0.111111111111111}; + f_next[6] = T{0.0277777777777778}; + f_next[7] = T{0.111111111111111}; + f_next[8] = T{0.0277777777777778}; +} + +template +__device__ static void apply(descriptor::D3Q19, S f_curr[19], S f_next[19], std::size_t gid) { + f_next[0] = T{0.0277777777777778}; + f_next[1] = T{0.0277777777777778}; + f_next[2] = T{0.0555555555555556}; + f_next[3] = T{0.0277777777777778}; + f_next[4] = T{0.0277777777777778}; + f_next[5] = T{0.0277777777777778}; + f_next[6] = T{0.0555555555555556}; + f_next[7] = T{0.0277777777777778}; + f_next[8] = T{0.0555555555555556}; + f_next[9] = T{0.333333333333333}; + f_next[10] = T{0.0555555555555556}; + f_next[11] = T{0.0277777777777778}; + f_next[12] = T{0.0555555555555556}; + f_next[13] = T{0.0277777777777778}; + f_next[14] = T{0.0277777777777778}; + f_next[15] = T{0.0277777777777778}; + f_next[16] = T{0.0555555555555556}; + f_next[17] = T{0.0277777777777778}; + f_next[18] = T{0.0277777777777778}; +} + +}; -- cgit v1.2.3