Example #1
0
    """Specifies flux on (x=1,y,z)"""
    if x[0] == 1.0:
        n = np.zeros((nd,),'d'); n[0]=1.0
        return lambda x,t: np.dot(velEx(u5Ex(), a5).uOfXT(x,t),n)
    if not (x[0] in [0.0] or x[1] in [0.0,1.0] or x[2] in [0.0,1.0]):
        return lambda x,t: 0.0


# Necessary dictionaries for problem class
#store a,f in dictionaries since coefficients class allows for one entry per component
nd = 3
nc = 1
aOfX = {0: a5}
fOfX = {0: f5}
#coefficients = PoissonEquationCoefficients(aOfX, fOfX, nc, nd)
coefficients = generate("proteus_coefficients", expr)
coefficients.variableNames = ['u0']

proteus_problem_kws = {
    "name": "Poisson",
    "aOfX": aOfX,
    "fOfX": fOfX,
    "analyticalSolution": {0: u5Ex()},
    "analyticalSolutionVelocity": {0: velEx(u5Ex(), a5)},
    "dirichletConditions": {0: getDBC5},
    "advectiveFluxBoundaryConditions": {0: getAdvFluxBC5},
    "diffusiveFluxBoundaryConditions": {0: {0: getDiffFluxBC5}},
    "fluxBoundaryConditions": {0: 'setFlow'},  # options are 'setFlow','noFlow','mixedFlow'
    "coefficients": coefficients
}
Example #2
0
from ignition.dsl.sfl.language import *
from ignition.dsl.sfl.generators import generate

u = Variable('u', dim=3, space='L2')
M = Coefficient('M', rank=1, dim=3)
A = Coefficient('A', rank=1, dim=3)
B = Constant('B', [1.0, 1.0, 1.0])
C = Coefficient('C', rank=1, dim=3)

expr = M * Dt(u) + div(B*u - A*grad(u)) + C*u
generate('proteus-script', StrongForm(expr))
Example #3
0
    if x[0] == 1.0:
        n = np.zeros((nd, ), 'd')
        n[0] = 1.0
        return lambda x, t: np.dot(velEx(u5Ex(), a5).uOfXT(x, t), n)
    if not (x[0] in [0.0] or x[1] in [0.0, 1.0] or x[2] in [0.0, 1.0]):
        return lambda x, t: 0.0


# Necessary dictionaries for problem class
#store a,f in dictionaries since coefficients class allows for one entry per component
nd = 3
nc = 1
aOfX = {0: a5}
fOfX = {0: f5}
#coefficients = PoissonEquationCoefficients(aOfX, fOfX, nc, nd)
coefficients = generate("proteus_coefficients", expr)
coefficients.variableNames = ['u0']

proteus_problem_kws = {
    "name": "Poisson",
    "aOfX": aOfX,
    "fOfX": fOfX,
    "analyticalSolution": {
        0: u5Ex()
    },
    "analyticalSolutionVelocity": {
        0: velEx(u5Ex(), a5)
    },
    "dirichletConditions": {
        0: getDBC5
    },