aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--boltzgen/kernel/template/equilibrilize.cl.mako2
-rw-r--r--boltzgen/kernel/template/equilibrilize.cpp.mako2
-rw-r--r--boltzgen/kernel/template/momenta_boundary.cl.mako8
-rw-r--r--boltzgen/kernel/template/momenta_boundary.cpp.mako8
4 files changed, 10 insertions, 10 deletions
diff --git a/boltzgen/kernel/template/equilibrilize.cl.mako b/boltzgen/kernel/template/equilibrilize.cl.mako
index 3ffa39e..8a423ae 100644
--- a/boltzgen/kernel/template/equilibrilize.cl.mako
+++ b/boltzgen/kernel/template/equilibrilize.cl.mako
@@ -2,6 +2,6 @@
<%call expr="pattern.operator('equilibrilize')">
% for i, w_i in enumerate(descriptor.w):
- ${float_type} f_next_${i} = ${w_i.evalf()};
+ const ${float_type} f_next_${i} = ${w_i.evalf()};
% endfor
</%call>
diff --git a/boltzgen/kernel/template/equilibrilize.cpp.mako b/boltzgen/kernel/template/equilibrilize.cpp.mako
index 74a6aa1..e10eb6c 100644
--- a/boltzgen/kernel/template/equilibrilize.cpp.mako
+++ b/boltzgen/kernel/template/equilibrilize.cpp.mako
@@ -2,6 +2,6 @@
<%call expr="pattern.operator('equilibrilize')">
% for i, w_i in enumerate(descriptor.w):
- ${float_type} f_next_${i} = ${w_i.evalf()};
+ const ${float_type} f_next_${i} = ${w_i.evalf()};
% endfor
</%call>
diff --git a/boltzgen/kernel/template/momenta_boundary.cl.mako b/boltzgen/kernel/template/momenta_boundary.cl.mako
index 9581a14..2cdc202 100644
--- a/boltzgen/kernel/template/momenta_boundary.cl.mako
+++ b/boltzgen/kernel/template/momenta_boundary.cl.mako
@@ -24,15 +24,15 @@ collision_subexpr, collision_assignment = model.collision(f_eq = model.equilibri
</%def>
<%call expr="momenta_boundary('velocity', [('%s%d' % (float_type, descriptor.d), 'velocity')])">
- ${float_type} ${sympy.ccode(moments_assignment[0])}
+ const ${float_type} ${sympy.ccode(moments_assignment[0])}
% for i, expr in enumerate(moments_assignment[1:]):
- ${float_type} ${expr.lhs} = velocity.${['x','y','z'][i]};
+ const ${float_type} ${expr.lhs} = velocity.${['x','y','z'][i]};
% endfor
</%call>
<%call expr="momenta_boundary('density', [(float_type, 'density')])">
- ${float_type} ${moments_assignment[0].lhs} = density;
+ const ${float_type} ${moments_assignment[0].lhs} = density;
% for i, expr in enumerate(moments_assignment[1:]):
- ${float_type} ${sympy.ccode(expr)}
+ const ${float_type} ${sympy.ccode(expr)}
% endfor
</%call>
diff --git a/boltzgen/kernel/template/momenta_boundary.cpp.mako b/boltzgen/kernel/template/momenta_boundary.cpp.mako
index 48b0fa5..ef7f7ad 100644
--- a/boltzgen/kernel/template/momenta_boundary.cpp.mako
+++ b/boltzgen/kernel/template/momenta_boundary.cpp.mako
@@ -24,15 +24,15 @@ collision_subexpr, collision_assignment = model.collision(f_eq = model.equilibri
</%def>
<%call expr="momenta_boundary('velocity', [(float_type, 'velocity[%d]' % descriptor.d)])">
- ${float_type} ${sympy.ccode(moments_assignment[0])}
+ const ${float_type} ${sympy.ccode(moments_assignment[0])}
% for i, expr in enumerate(moments_assignment[1:]):
- ${float_type} ${expr.lhs} = velocity[${i}];
+ const ${float_type} ${expr.lhs} = velocity[${i}];
% endfor
</%call>
<%call expr="momenta_boundary('density', [(float_type, 'density')])">
- ${float_type} ${moments_assignment[0].lhs} = density;
+ const ${float_type} ${moments_assignment[0].lhs} = density;
% for i, expr in enumerate(moments_assignment[1:]):
- ${float_type} ${sympy.ccode(expr)}
+ const ${float_type} ${sympy.ccode(expr)}
% endfor
</%call>