jLM.Solvers#
Generic RDME solvers
Functions
|
Create custom solver |
Classes
|
Solver with fixed concentration boundary conditions |
- class jLM.Solvers.ConstBoundaryConc(lmFile, exact=False)[source]#
Bases:
object
Solver with fixed concentration boundary conditions
The simulation hook runs a cythonized function which destructively sets the specified boundaries to a prescribed concentration.
- setBoundary(species, concs, boundary)[source]#
Specify boundary conditions
Specify a boundary condition using a species (or list of species), a concentration (or list of concentrations; in mol/L), and a specification of the boundary in terms of a binary lattice. Subsequent calls will add new boundary conditions. When the boundary region given by a subsequent call overlaps with a previously described region, the later call will override the earlier conditions.
- Parameters:
species (
Species
) – Species at boundaryconcs (float) – Concentrations
boundary (
ndarray
) – Binary lattice describing the boundary
- jLM.Solvers.makeSolver(rdmeSolver, customSolver)[source]#
Create custom solver
Note
The user defined class should define a hookSimulation(self, t, lattice) method where t is the current simulation time and lattice is the current state of the
lm.CudaByteLattice
.Warning
If __init__ is overridden, super().__init__ must be called first.
- Parameters:
rdmeSolver (
lm.RDMESolver
) – Base solver classcustomSolver (class) – User defined solver class
- Returns:
Composed class
- Return type:
class