aboutsummaryrefslogtreecommitdiff
path: root/boltzgen/kernel/template/equilibrilize.cpp.mako
diff options
context:
space:
mode:
authorAdrian Kummerlaender2019-10-27 14:05:21 +0100
committerAdrian Kummerlaender2019-10-27 14:05:21 +0100
commit18c54d79699db7554faa851c87d7113db67a8a08 (patch)
treec89243b5796bb8f1e6a8cea241f3a5e1bf934ba1 /boltzgen/kernel/template/equilibrilize.cpp.mako
parent7fa72d8718d96727bcfd60cc3bcb1609526d3c9b (diff)
downloadboltzgen-18c54d79699db7554faa851c87d7113db67a8a08.tar
boltzgen-18c54d79699db7554faa851c87d7113db67a8a08.tar.gz
boltzgen-18c54d79699db7554faa851c87d7113db67a8a08.tar.bz2
boltzgen-18c54d79699db7554faa851c87d7113db67a8a08.tar.lz
boltzgen-18c54d79699db7554faa851c87d7113db67a8a08.tar.xz
boltzgen-18c54d79699db7554faa851c87d7113db67a8a08.tar.zst
boltzgen-18c54d79699db7554faa851c87d7113db67a8a08.zip
Separate functions into separate template files
Selection of the desired templates is possible via a new `functions` parameter.
Diffstat (limited to 'boltzgen/kernel/template/equilibrilize.cpp.mako')
-rw-r--r--boltzgen/kernel/template/equilibrilize.cpp.mako13
1 files changed, 13 insertions, 0 deletions
diff --git a/boltzgen/kernel/template/equilibrilize.cpp.mako b/boltzgen/kernel/template/equilibrilize.cpp.mako
new file mode 100644
index 0000000..9f082a1
--- /dev/null
+++ b/boltzgen/kernel/template/equilibrilize.cpp.mako
@@ -0,0 +1,13 @@
+void equilibrilize(${float_type}* f_next,
+ ${float_type}* f_prev,
+ std::size_t gid)
+{
+ ${float_type}* preshifted_f_next = f_next + gid*${layout.gid_offset()};
+ ${float_type}* preshifted_f_prev = f_prev + gid*${layout.gid_offset()};
+
+% for i, w_i in enumerate(descriptor.w):
+ preshifted_f_next[${layout.pop_offset(i)}] = ${w_i.evalf()};
+ preshifted_f_prev[${layout.pop_offset(i)}] = ${w_i.evalf()};
+% endfor
+}
+