From a92271176a19e06611099c0eccc4e6a6887f4915 Mon Sep 17 00:00:00 2001 From: Adrian Kummerlaender Date: Mon, 17 May 2021 00:30:13 +0200 Subject: Extract public version of SweepLB --- src/LLBM/initialize.h | 53 +++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 53 insertions(+) create mode 100644 src/LLBM/initialize.h (limited to 'src/LLBM/initialize.h') diff --git a/src/LLBM/initialize.h b/src/LLBM/initialize.h new file mode 100644 index 0000000..b361217 --- /dev/null +++ b/src/LLBM/initialize.h @@ -0,0 +1,53 @@ +#pragma once + +#include "concepts.h" + +struct InitializeO { + +template +static void apply(V f_curr[19], V f_next[19]) { + 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}; +} + +template +static void apply(V f_curr[19], V f_next[19], T scale) { + f_next[0] = T{scale * 0.0277777777777778}; + f_next[1] = T{scale * 0.0277777777777778}; + f_next[2] = T{scale * 0.0555555555555556}; + f_next[3] = T{scale * 0.0277777777777778}; + f_next[4] = T{scale * 0.0277777777777778}; + f_next[5] = T{scale * 0.0277777777777778}; + f_next[6] = T{scale * 0.0555555555555556}; + f_next[7] = T{scale * 0.0277777777777778}; + f_next[8] = T{scale * 0.0555555555555556}; + f_next[9] = T{scale * 0.333333333333333}; + f_next[10] = T{scale * 0.0555555555555556}; + f_next[11] = T{scale * 0.0277777777777778}; + f_next[12] = T{scale * 0.0555555555555556}; + f_next[13] = T{scale * 0.0277777777777778}; + f_next[14] = T{scale * 0.0277777777777778}; + f_next[15] = T{scale * 0.0277777777777778}; + f_next[16] = T{scale * 0.0555555555555556}; + f_next[17] = T{scale * 0.0277777777777778}; + f_next[18] = T{scale * 0.0277777777777778}; +} + +}; -- cgit v1.2.3