sailfish-team/sailfish — pull request #29 by nlooije (2014-04-13 01:04:55+00:00)
Title: N-component implementation of SC model

Hi,

I have finished the implementation of the SC model for 'arbitrary' number of components.

Major revisions:
1. the number of components may be set through the 'lat_nc' argument with max 9 components.
2. multicomponent models now defined in 'lb_multi.py' ('lb_binary' and 'lb_ternary' are removed)
3. density fields are now referenced by g#m0, similar for tau#, visc#. G's are following the same template, i.e. G01 is interaction between grid 0 and 1. (examples are updated)
4. multicomp+phase mako templates are split into main, SC and FE versions for better overview
5. extra arg 'grids' passed to fields method; easiest way i found to be able to generate a list for arbitrary number of components. (maybe there is a better way?)
6. extra arg 'shanchen'=True/False added to cexpr(); when True does not format 'g0m0' and 'g1m0' to 'rho' and 'phi'.
7. relevant variables in mako templates are now designated by their grid id (easier to read in source code)

Minor revisions:
1. some grammatical mistakes in example doc strings fixed
2. 2nd moment of eq and neq dist in boundary.mako only occur now when needed for Grad and Regularized implementation.

Some issues:
lb_multi.py - line 130: is there a better way of determining SC vs FE?
lb_multi.py - line 434: should be able to fit on one line but cant get it to work, i.e. gpu_rho = {c: runner.gpu_field(eval('self.g{}m0'.format(c))) for c in range(0, self.config.lat_nc)}