prediction module#

class prediction.PlaneWave(t: float, kVec: ndarray, omega: float, hbar: float, c: complex)[source]#

Bases: object

A class to generate a plane wave for the wave function, defined as

\[\psi(\mathbf{x}, t) = c \cdot e^{ i\,(\mathbf{k} \cdot \mathbf{x} - \omega \, t) }\]

in which \(c\in\mathbb{C}\) is a normalisation constant, \(\mathbf{k}\) is the wave vector and \(\omega\) is the frequency, defined as

\[\mathbf{k} = h^{-1}\cdot \mathbf{u} \qquad \qquad \omega = (\mathbf{u}\cdot \mathbf{u}) / (2\hbar)\]

The plane wave is used to assign a fixed velocity field to a certain region.

Parameters:
  • t (float) – Initial Time.

  • kVec (np.ndarray) – Wave vector.

  • omega (float) – Frequency of the wave.

  • hbar (float) – Value of \(\hbar\).

  • c (complex) – Normalisation constant.

class prediction.schrodinger(domain: dolfinx.mesh.Mesh, ft: dolfinx.cpp.mesh.MeshTags_int32, boundary_marks: dict, degree_psi: int = 1, c: ndarray = array([1. + 0.j, 0.01 + 0.j]))[source]#

Bases: object

This class implements the prediction step of the Incompressible Schrodinger Flow, in particular the free-particle Schrodinger equation is solved.

Parameters:
  • domain (dolfinx.mesh.Mesh) – Mesh imported.

  • ft (dolfinx.cpp.mesh.MeshTags_int32) – Face tags of the boundaries.

  • boundary_marks (dict) – Dictionary with the markers for the boundaries.

  • degree_psi (int (Default = 1)) – Degree of the polynomials used for the definition of the functional space.

  • c (np.ndarray (Default = \([1, 0.01]\))) – Constant, in the __init__ is normalised such that \(\sqrt{c_1^*c_1+c_2^*c_2}\).

advect(temperature: dolfinx.fem.Function | None = None)[source]#

This function advances in time by solving the linear problem at each time step.

Parameters:

temperature (dolfinx.fem.Function (Default = None)) – Temperature at time \(t_n\), if None there is no update.

assemble(phys_parameters: dict, dt: float = 0.01, direct: bool = False, gravity_dict: dict = {'Tref': 0, 'beta': 0, 'gravity': array([0, 0, 0])})[source]#

This function assign the boundary condition (if inlet is present), assembles the forms of the weak formulations and creates the linear structures for the solution (matrix, rhs and solver).

Parameters:
  • phys_parameters (dict) – Dictionary with the physical parameters.

  • dt (float (Default: 1e-2)) – Time step.

  • direct (boolean (Default: False)) – Boolean variable to identify if a direct solver must be used.

  • gravity_dict (dict (Default: None)) – Dictionary with the gravity parameters.

updateInlet()[source]#

This function updates the inlet condition of the plane wave.