Added central moments functionality to lbmpy
3 unresolved threads
3 unresolved threads
This merge request will add central moment functionality to lbmpy (shift_matrix, get_central_moments). Remaining TODOs:
-
The Demo notebook can not be executed at the moment since the includes are not correct. -
Integrate central moments fully into lbmpy. This means something like this should be possible create_lb_method(..., central_moments=True)
. -
Unit tests for the get_shift_matrix
function. -
Physical test case the central moments.
Edited by Jonas Plewinski
Merge request reports
Activity
added documentation feature proposal labels
368 369 return sp.Matrix(len(moments), len(stencil), generator) 369 370 370 371 372 def shift_matrix(moments, stencil): 373 """ 374 Returns shift matrix to shift raw moments to central moment space 375 """ 376 x, y, z = MOMENT_SYMBOLS 377 dim = len(stencil[0]) 378 nr_directions = len(stencil) 379 380 directions = asarray(stencil) 381 382 u = sp.symbols("u_:{dim}".format(dim=dim)) changed this line in version 2 of the diff
added 1 commit
- a8707c7c - resolved errors in demo notebook and integrated unittest for shift_matrix
added 1 commit
- b92676d3 - Added function get_central_moments to moments.py
368 369 return sp.Matrix(len(moments), len(stencil), generator) 369 370 370 371 372 def set_up_shift_matrix(moments, stencil): 373 """ 374 Sets up a shift matrix to shift raw moments to central moment space 375 """ 376 x, y, z = MOMENT_SYMBOLS 377 dim = len(stencil[0]) 378 nr_directions = len(stencil) 379 380 directions = asarray(stencil) 381 382 u = sp.symbols(f"u_:{dim}") 368 369 return sp.Matrix(len(moments), len(stencil), generator) 369 370 370 371 372 def set_up_shift_matrix(moments, stencil): Can we add the possibility to pass a list of exponent tuples to the
moments
parameter? For this case, lines 390 and 392 wouldn't be necessary, and a caller wouldn't have to convert exponent tuples to polynomials first. Of course, the ability to pass polynomials should be kept.Edited by Frederik Hennig
Please register or sign in to reply