cideMOD.cell.equations
Classes
|
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:
dictThis 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.