diff options
-rw-r--r-- | boltzgen/kernel/generator.py | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/boltzgen/kernel/generator.py b/boltzgen/kernel/generator.py index 30e2c04..92ceb72 100644 --- a/boltzgen/kernel/generator.py +++ b/boltzgen/kernel/generator.py @@ -50,3 +50,19 @@ class Generator: raise Exception('Geometry dimension must match descriptor dimension') return "\n".join(map(lambda f: self.instantiate(f, geometry, extras), functions)) + + def custom(self, geometry, source): + return Template(text = source).render( + descriptor = self.descriptor, + geometry = geometry, + index = self.index_impl(geometry), + layout = self.layout_impl(self.descriptor, self.index_impl, geometry), + + moments_subexpr = self.moments[0], + moments_assignment = self.moments[1], + collision_subexpr = self.collision[0], + collision_assignment = self.collision[1], + ccode = sympy.ccode, + + float_type = self.float_type, + ) |