core

Module:

This modules provides definitions of basic classes needed for parsing equations.

class core.Definition(f, form)
This class represents functions which are translated intto definitions.
class core.Equation(variable, test_function, _parts, no_dt=False)

This class represents equations. It provides functionality for parsing and storing equations.

classmethod diff_eq(eq, var)
Differentiates equation eq with respect to variable var in direction u. d(eq)/d(var) = (d/d a) eq(var + u a) at a == 0
classmethod discretize(eq)

Time derivative is implemented as a finite difference in Bender. This method returns discretized form of given equation. e.g. in the case of Crank-Nicolson scheme

Dt(vx) - f = 0 -> forward(vx)-backward(vx) - 0.5*(forward(f) + backward(f))*dt = 0
class core.ImpliciteVariable(name)
An abstract variable. It won’t be part of the FEM analysis. Serves only as a special marker. For example vector of normal to boundary dnx is internally represented as an instance of this class.
class core.Parameter(label, name)
This class represents parameters.
class core.Variable(name, element_type, function)

This class represents defined variables.

e.g.: pressure, velocity, displacement

classmethod create_variable(name, el_type)

Create a new internal variable. The new variable contains forwarded and backwarded forms which represent different time levels.

e.g.: p = Variable.create_variable(‘pressure’, ‘QC2’)

p.f ... forwarded form, this variable is called v_p

p.b ... backwarded form, this variable is called w_p

core.dt
Internal representation of time step.

Previous topic

grids

Next topic

utils

This Page