cideMOD.cell.equations

Classes

ProblemEquations(state_variables)

This class will be in charge of storing the equations of the problem and identifying them with the corresponding state variable.

class cideMOD.cell.equations.ProblemEquations(state_variables: List[str])[source]

Bases: dict

This class will be in charge of storing the equations of the problem and identifying them with the corresponding state variable.

add(state_variable, equation)[source]

This method adds the equation of the specified state variable.

Parameters:
  • state_variable (str) – Name of the state variable.

  • equation (dolfinx.fem.Form) – Integral form of the equation.

Examples

To relate a variable with its equation:

>>> state_variables = ['var1', 'var2', 'var3']
>>> equations = ProblemEquations(state_variables)
>>> equations.add('var1', var1_equation)
add_boundary_conditions(state_variable, boundary)[source]

This method adds the dirichlet boundary condition of the specified state variable.

Parameters:
  • state_variable (str) – Name of the state variable.

  • boundary (dolfinx.fem.DirichletBCMetaClass) – Dirichlet boundary condition of this variable.

Examples

To relate a variable with its boundary condition:

>>> equations.add_boundary_condition('var1', var1_bc)

To access the boundary condition:

>>> equations.bcs['var1']
[var1_bc]
check()[source]

Once the state variables are initialised and with the corresponding equations added, this method is used to check that all equations have been added.

get_boundary_conditions()[source]
print(state_variable=None)[source]

This method print the equations and boundary conditions associated with each state variable.

update([E, ]**F) None.  Update D from dict/iterable E and F.[source]

If E is present and has a .keys() method, then does: for k in E: D[k] = E[k] If E is present and lacks a .keys() method, then does: for k, v in E: D[k] = v In either case, this is followed by: for k in F: D[k] = F[k]