Generic simulation#
- class Simulation(mesh=None, materials=None, sources=[], boundary_conditions=[], traps=None, dt=None, settings=None, temperature=None, initial_conditions=[], exports=None, log_level=40)[source]#
Bases:
objectMain festim class representing a festim model
- Parameters:
mesh (festim.Mesh, optional) – The mesh of the model. Defaults to None.
materials (festim.Materials or list or festim.Material, optional) – The model materials. Defaults to None.
sources (list of festim.Source, optional) – Volumetric sources (particle or heat sources). Defaults to [].
boundary_conditions (list of festim.BoundaryCondition, optional) – The model’s boundary conditions (temperature of H concentration). Defaults to None.
traps (festim.Traps or list or festim.Trap, optional) – The model’s traps. Defaults to None.
dt (festim.Stepsize, optional) – The model’s stepsize. Defaults to None.
settings (festim.Settings, optional) – The model’s settings. Defaults to None.
temperature (int, float, sympy.Expr, festim.Temperature, optional) – The model’s temperature. Can be an expression or a heat transfer model. Defaults to None.
initial_conditions (list of festim.InitialCondition, optional) – The model’s initial conditions (H or T). Defaults to [].
exports (festim.Exports or list or festim.Export, optional) – The model’s exports (derived quantities, XDMF exports, txt exports…). Defaults to None.
log_level (int, optional) – set what kind of FEniCS messsages are displayed. Defaults to 40. CRITICAL = 50, errors that may lead to data corruption ERROR = 40, errors WARNING = 30, warnings INFO = 20, information of general interest PROGRESS = 16, what’s happening (broadly) TRACE = 13, what’s happening (in detail) DBG = 10 sundry
- Variables:
log_level (int) – set what kind of FEniCS messsages are displayed. CRITICAL = 50, errors that may lead to data corruption ERROR = 40, errors WARNING = 30, warnings INFO = 20, information of general interest PROGRESS = 16, what’s happening (broadly) TRACE = 13, what’s happening (in detail) DBG = 10 sundry
settings (festim.Settings) – The model’s settings.
dt (festim.Stepsize) – The model’s stepsize.
traps (festim.Traps) – The model’s traps.
materials (festim.Materials) – The model materials.
boundary_conditions (list of festim.BoundaryCondition) – The model’s boundary conditions (temperature of H concentration).
initial_conditions (list of festim.InitialCondition) – The model’s initial conditions (H or T).
T (festim.Temperature) – The model’s temperature.
exports (festim.Exports) – The model’s exports (derived quantities, XDMF exports, txt exports…).
mesh (festim.Mesh) – The mesh of the model.
sources (list of festim.Source) – Volumetric sources (particle or heat sources).
mobile (festim.Mobile) – the mobile concentration (c_m or theta)
t (fenics.Constant) – the current time of simulation
timer (fenics.timer) – the elapsed time of simulation
- attribute_source_terms()[source]#
Assigns the source terms (in self.sources) to the correct field (self.mobile, self.T, or traps)
- check_boundary_conditions()[source]#
Runs a series of checks on the BCs and raise errors accordingly
- check_mesh_dim_coords()[source]#
Checks if the used coordinates can be applied for geometry with the specified dimensions
- initialise()[source]#
Initialise the model. Defines markers, create the suitable function spaces, the functions, the variational forms…