pylbm.Simulation

class pylbm.Simulation(dico, domain=None, scheme=None, sorder=None, dtype='float64', check_inverse=False)

create a class simulation

Parameters
  • dico (dictionary) –

  • domain (object of class Domain, optional) –

  • scheme (object of class Scheme, optional) –

  • type (optional argument (default value is 'float64')) –

dim

spatial dimension

Type

int

type

the type of the values

Type

float64

domain

the domain given in argument

Type

Domain

scheme

the scheme given in argument

Type

Scheme

m

a numpy array that contains the values of the moments in each point

Type

numpy array

F

a numpy array that contains the values of the distribution functions in each point

Type

numpy array

m_halo

a numpy array that contains the values of the moments in each point

Type

numpy array

F_halo

a numpy array that contains the values of the distribution functions in each point

Type

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

__init__(dico[, domain, scheme, sorder, …])

Initialize self.

boundary_condition()

perform the boundary conditions

equilibrium()

set the moments to the equilibrium values (the array _m is modified)

f2m()

compute the moments from the distribution functions (the array _m is modified)

initialization(dico)

initialize all the numy array with the initial conditions

m2f()

compute the distribution functions from the moments (the array _F is modified)

one_time_step()

compute one time step

relaxation()

compute the relaxation phase on moments (the array _m is modified)

source_term([fraction_of_time_step])

compute the source term phase on moments (the array _m is modified)

time_info()

transport()

compute the transport phase on distribution functions (the array _F is modified)

Attributes

F

get the distribution function i in the interior domain.

F_halo

get the distribution function i on the whole domain with halo points.

m

get the moment i in the interior domain.

m_halo

get the moment i on the whole domain with halo points.