Пример #1
0
def setupPDE_vector_calculus_with_eps():
    # 4. Equation as vector calculus with aux function eps
    pde = PDE(64.0, 64.0)
    pde.setEquationExpression(PDEExpressionType.VECTOR_CALCULUS,
                              "div(eps(r) * grad( u(r) ))")
    pde.setVectorVariable("r", dimension=2)
    pde.setAuxiliaryFunctions({'eps': eps})
    pde.configureGrid()
    return pde
Пример #2
0
def setupPDE_finite_differences_with_eps():
    # 2. Finite Differences with aux function eps
    pde = PDE(64.0, 64.0)
    pde.setEquationExpression(PDEExpressionType.FINITE_DIFFERENCES,
                               'eps(i+1/2,j)*(u(i+1,j)-u(i,j)) - eps(i-1/2,j)*(u(i,j)-u(i-1,j)) + ' + \
                               'eps(i,j+1/2)*(u(i,j+1)-u(i,j)) - eps(i,j-1/2)*(u(i,j)-u(i,j-1))')
    pde.setAuxiliaryFunctions({'eps': eps})
    pde.configureGrid()
    return pde