pylbm.
Simulation
(dico, domain=None, scheme=None, sorder=None, dtype='float64', check_inverse=False)¶create a class simulation
dico (dictionary) –
domain (object of class Domain
, optional) –
scheme (object of class Scheme
, optional) –
type (optional argument (default value is 'float64')) –
dim
¶spatial dimension
int
type
¶the type of the values
float64
scheme
¶the scheme given in argument
Scheme
m
¶a numpy array that contains the values of the moments in each point
numpy array
F
¶a numpy array that contains the values of the distribution functions in each point
numpy array
m_halo
¶a numpy array that contains the values of the moments in each point
numpy array
F_halo
¶a numpy array that contains the values of the distribution functions in each point
numpy array
Examples
see demo/examples/
Access to the distribution functions and the moments.
In 1D:
>>>F[n][k][i]
>>>m[n][k][i]
get the kth distribution function of the nth elementary scheme and the kth moment of the nth elementary scheme at the point x[0][i].
In 2D:
>>>F[n][k][j, i]
>>>m[n][k][j, i]
get the kth distribution function of the nth elementary scheme and the kth moment of the nth elementary scheme at the point x[0][i], x[1][j].
Notes
The methods
transport
,
relaxation
,
equilibrium
,
f2m
,
m2f
,
boundary_condition
,
and
one_time_step
are just call of the methods of the class
Scheme
.
__init__
(dico, domain=None, scheme=None, sorder=None, dtype='float64', check_inverse=False)¶Initialize self. See help(type(self)) for accurate signature.
Methods
|
Initialize self. |
|
perform the boundary conditions |
|
set the moments to the equilibrium values (the array _m is modified) |
|
compute the moments from the distribution functions (the array _m is modified) |
|
initialize all the numy array with the initial conditions |
|
compute the distribution functions from the moments (the array _F is modified) |
|
compute one time step |
|
compute the relaxation phase on moments (the array _m is modified) |
|
compute the source term phase on moments (the array _m is modified) |
|
|
|
compute the transport phase on distribution functions (the array _F is modified) |
Attributes
get the distribution function i in the interior domain. |
|
get the distribution function i on the whole domain with halo points. |
|
get the moment i in the interior domain. |
|
get the moment i on the whole domain with halo points. |